query_id
stringlengths 32
32
| query
stringlengths 7
6.75k
| positive_passages
listlengths 1
1
| negative_passages
listlengths 88
101
|
---|---|---|---|
235a1dab5de52452e537931f23c4c074
|
Given the specified parse +state+ which is pointing past the opening of a directive tag, parse the directive.
|
[
{
"docid": "13ac67a91b3ca1e66144d77715160609",
"score": "0.6961881",
"text": "def scan_directive( state, context=nil )\n\t\tscanner = state.scanner\n\n\t\t# Set the patterns in the parse state to compliment the\n\t\t# opening tag.\n\t\tstate.set_tag_patterns( scanner.matched )\n\t\ttag_begin = state.line\n\n\t\t# Scan for the directive name; if no valid name can be\n\t\t# found, handle an unknown PI/directive.\n\t\tscanner.skip( WHITESPACE )\n\t\tunless (( tag = scanner.scan( IDENTIFIER ) ))\n\t\t\t#self.log.debug \"No identifier at '%s...'\" % scanner.rest[0,20]\n\n\t\t\t# If the tag_open is <?, then this is a PI that we don't\n\t\t\t# grok. The reaction to this is configurable, so decide what to\n\t\t\t# do.\n\t\t\tif state.tag_open == '<?'\n\t\t\t\treturn handle_unknown_pi( state )\n\n\t\t\t# ...otherwise, it's just a malformed non-PI tag, which\n\t\t\t# is always an error.\n\t\t\telse\n\t\t\t\traise Arrow::ParseError, \"malformed directive name\"\n\t\t\tend\n\t\tend\n\n\t\t# If it's anything but an 'end' tag, create a directive object.\n\t\tunless tag == 'end'\n\t\t\tbegin\n\t\t\t\tnode = Arrow::Template::Directive.create( tag, self, state )\n\t\t\trescue ::FactoryError => err\n\t\t\t\treturn self.handle_unknown_pi( state, tag )\n\t\t\tend\n\n\t\t# If it's an 'end', \n\t\telse\n\t\t\t#self.log.debug \"Found end tag.\"\n\n\t\t\t# If this scan is occuring in a recursive parse, make sure the\n\t\t\t# 'end' is closing the correct thing and break out of the node\n\t\t\t# search. Note that the trailing '?>' is left in the scanner to\n\t\t\t# match at the end of the loop that opened this recursion.\n\t\t\tif context\n\t\t\t\tscanner.skip( WHITESPACE )\n\t\t\t\tclosed_tag = scanner.scan( IDENTIFIER )\n\t\t\t\t#self.log.debug \"End found for #{closed_tag}\"\n\n\t\t\t\t# If strict end tags is turned on, check to be sure we\n\t\t\t\t# got the correct 'end'.\n\t\t\t\tif @config[:strict_end_tags]\n\t\t\t\t\traise Arrow::ParseError,\n\t\t\t\t\t\t\"missing or malformed closing tag name\" if\n\t\t\t\t\t\tclosed_tag.nil?\n\t\t\t\t\traise Arrow::ParseError,\n\t\t\t\t\t\t\"mismatched closing tag name '#{closed_tag}'\" unless\n\t\t\t\t\t\tclosed_tag.downcase == context.downcase\n\t\t\t\tend\n\n\t\t\t\t# Jump out of the loop in #scan_for_nodes...\n\t\t\t\tthrow :endscan \n\t\t\telse\n\t\t\t\traise Arrow::ParseError, \"dangling end\"\n\t\t\tend\n\t\tend\n\n\t\t# Skip to the end of the tag\n\t\tself.scan_for_tag_ending( state ) or\n\t\t\traise Arrow::ParseError,\n\t\t\t\t\"malformed tag starting at line %d: no closing tag \"\\\n\t\t\t\t\"delimiters %p found\" % [ tag_begin, state.tag_close ]\n\n\t\treturn node\n\tend",
"title": ""
}
] |
[
{
"docid": "623212b337e7c5cc955ceecb92936da9",
"score": "0.736794",
"text": "def parse_directive_contents( parser, state )\n\t\tend",
"title": ""
},
{
"docid": "a47f95f12f44520f8446cc8baae413c2",
"score": "0.69174844",
"text": "def parse_directive_contents( parser, state )\n\t\t\tsuper\n\n\t\t\t# Let subclasses implement further inner-tag parsing if they want\n\t\t\t# to.\n\t\t\tif block_given?\n\t\t\t\trval = yield( parser, state )\n\t\t\t\treturn nil if !rval\n\t\t\tend\n\n\t\t\t# Put the pointer after the closing tag \n\t\t\tparser.scan_for_tag_ending( state ) or\n\t\t\t\traise Arrow::ParseError, \"couldn't find tag end for '#@name'\"\n\n\t\t\t# Parse the content between this directive and the next <?end?>.\n\t\t\t@subnodes.replace( parser.scan_for_nodes(state, type, self) )\n\n\t\t\treturn true\n\t\tend",
"title": ""
},
{
"docid": "180c6001913df33fcf7828a338c20c03",
"score": "0.6798075",
"text": "def parse_directive_contents( parser, state )\n\t\t\tsuper\n\n\t\t\t# Look for a format\n\t\t\tif self.class.allows_format?\n\t\t\t\tif fmt = parser.scan_for_quoted_string( state )\n\t\t\t\t\tstate.scanner.skip( /\\s*%\\s*/ ) or\n\t\t\t\t\t\traise Arrow::ParseError, \"Format missing modulus operator?\"\n\t\t\t\t\t@format = fmt[1..-2]\n\t\t\t\t\t#self.log.debug \"Found format %p\" % @format\n\t\t\t\telse\n\t\t\t\t\t#self.log.debug \"No format string\"\n\t\t\t\t\t@format = nil\n\t\t\t\tend\n\t\t\tend\n\n\t\t\t# Look for the identifier\n\t\t\t@name = parser.scan_for_identifier( state ) or\n\t\t\t\traise Arrow::ParseError, \"missing or malformed indentifier\"\n\t\t\t#self.log.debug \"Set name of %s to %p\" %\n\t\t\t#\t[ self.class.name, @name ]\n\n\t\t\t# Now pick up the methodchain if there is one\n\t\t\t@methodchain = parser.scan_for_methodchain( state )\n\n\t\t\treturn true\n\t\tend",
"title": ""
},
{
"docid": "221360d71ebd49baaf1ab741ec1e0ee0",
"score": "0.6710081",
"text": "def parse_directive_contents( parser, state )\n\t\tscanner = state.scanner\n\n\t\t@name = parser.scan_for_identifier( state, true ) or\n\t\t\traise Arrow::ParseError, \"missing or malformed identifier\"\n\n\t\t# If there's an infix operator, the rest of the tag up to the 'as' is\n\t\t# the methodchain. Can't use the parser's\n\t\t# #scan_for_methodchain because it just scans the rest of the tag.\n\t\tif scanner.scan( INFIX )\n\t\t\t# If the 'infix' was actually the left side of an index operator,\n\t\t\t# include it in the methodchain.\n\t\t\tstart = scanner.matched == \"[\" ? scanner.pos - 1 : scanner.pos\n\n\t\t\t# Find the end of the methodchain\n\t\t\t# :FIXME: This will screw up if the methodchain itself has an ' as ' in it.\n\t\t\tscanner.scan_until( AS ) or\n\t\t\t\traise Arrow::ParseError, \"invalid render tag: no 'as' found\"\n\n\t\t\t# StringScanner#pre_match is broken, so we have to do the equivalent\n\t\t\t# ourselves.\n\t\t\toffset = scanner.pos - scanner.matched.length - 1\n\t\t\t@methodchain = scanner.string[ start..offset ]\n\n\t\t# No methodchain\n\t\telse\n\t\t\tscanner.scan_until( AS ) or\n\t\t\t\traise Arrow::ParseError, \"invalid render tag: no 'as' found\"\n\t\t\t@methodchain = ''\n\t\t\tself.log.debug \"No methodchain parsed\"\n\t\tend\n\n\t\t# Parse the target identifier\n\t\t@target = parser.scan_for_identifier( state ) or\n\t\t\traise Arrow::ParseError, \"missing or malformed target identifier\"\n\t\tself.log.debug \"Parsed target identifier: %p\" % [@target]\n\n\t\t# Skip over the ' in ' bit\n\t\tscanner.skip( WHITESPACE )\n\t\tscanner.skip( IN ) or\n\t\t\traise Arrow::ParseError, \"invalid render tag: no 'in'\"\n\t\tscanner.skip( WHITESPACE )\n\n\t\t# Parse the filename of the subtemplate to load\n\t\tfilename = parser.scan_for_pathname( state ) or\n\t\t\traise Arrow::ParseError, \"No filename found for 'render'\"\n\t\tfilename.untaint\n\t\tself.log.debug \"Parsed subtemplate filename: %p\" % [filename]\n\n\t\t# Load and parse the subtemplate\n\t\t@subtemplate = self.loadSubtemplate( filename, parser, state )\n\t\tself.log.debug \"Subtemplate set to: %p\" % [@subtemplate]\n\n\t\treturn true\n\tend",
"title": ""
},
{
"docid": "9005f607a30552b259d017406f248fb2",
"score": "0.6564783",
"text": "def parse_directive_contents( parser, state )\n\t\tsuper\n\n\t\tstate.scanner.skip( WHITESPACE )\n\t\t#self.log.debug \"Scanning for tag middle at: '%20s'\" % state.scanner.rest\n\n\t\tbody = state.scanner.scan( state.tag_middle ) or return nil\n\t\t#self.log.debug \"Found body = %p\" % body\n\n\t\tbody.strip.split( /\\s*,\\s*/ ).each do |import|\n\t\t\t#self.log.debug \"Parsing import: %p\" % import\n\t\t\tcase import\n\t\t\twhen ALIASIMPORT\n\t\t\t\t@imports[ $1 ] = $2\n\t\t\t\t#self.log.debug \"Alias import: %s => %s\" % \n\t\t\t\t#\t[ $1, $2 ]\n\n\t\t\twhen SIMPLEIMPORT\n\t\t\t\t@imports[ $1 ] = $1\n\t\t\t\t#self.log.debug \"Simple import: %s\" % $1\n\n\t\t\telse\n\t\t\t\traise Arrow::ParseError, \"Failed to parse body: %p\" % body\n\t\t\tend\n\t\tend\n\n\t\treturn true\n\tend",
"title": ""
},
{
"docid": "c27e25324cf0ca78934cafd2e3c647e4",
"score": "0.63069683",
"text": "def parse_directive\n directive_name = match(:idt).val\n\n # parameter the directive takes\n require 'pry'\n directive_param =\n case directive_name\n when \".section\" then parse_str_lit # .section \".data\"\n when \".global\" then parse_label # .global my_label\n else\n error \"unknown/unimplemented directive '#{directive_name}'\"\n end\n\n Directive.new(\n name: directive_name[1..-1],\n param: directive_param)\n end",
"title": ""
},
{
"docid": "8b60f50907ce6a22f2f6f24b2e0aaa68",
"score": "0.62639153",
"text": "def parse_directive_contents( parser, state )\n\t\tstate.scanner.skip( WHITESPACE )\n\t\t\n\t\tif state.scanner.scan( NAMEDLIST )\n\t\t\t@select_name = state.scanner[1]\n\t\tend\n\n\t\tsuper\n\n\t\treturn true\n\tend",
"title": ""
},
{
"docid": "9b164b0bf8e2b172392ded082b63f318",
"score": "0.61152345",
"text": "def initialize( type, parser, state )\n\t\t\tsuper( type )\n\t\t\tself.parse_directive_contents( parser, state )\n\t\tend",
"title": ""
},
{
"docid": "3f581087f778ae7f49d4f6370d9bec7d",
"score": "0.6007212",
"text": "def visit_directive(node); end",
"title": ""
},
{
"docid": "32f5b154cc787d9f96563d0bdf217484",
"score": "0.6006513",
"text": "def parse_directive_contents( parser, state )\n\t\t@name = parser.scan_for_identifier( state )\n\n\t\tstate.scanner.skip( /\\s*=\\s*/ )\n\n\t\t@value = parser.scan_for_identifier( state ) ||\n\t\t\tparser.scan_for_quoted_string( state ) or\n\t\t\traise Arrow::ParseError, \"No value for 'set' directive\"\n\n\t\tif (( chain = parser.scan_for_methodchain(state) ))\n\t\t\t@value << chain\n\t\tend\n\tend",
"title": ""
},
{
"docid": "ecaf874f40a904ac174ca2f126bb3b6f",
"score": "0.5914989",
"text": "def directive_create(tag_name, tag_buf, parser); end",
"title": ""
},
{
"docid": "c38861c15da6df5b873e4e776206d4a7",
"score": "0.5836395",
"text": "def parse_directive_contents( parser, state )\n\t\t@args, @pureargs = parser.scan_for_arglist( state )\n\t\treturn nil unless @args\n\n\t\tstate.scanner.skip( IN ) or\n\t\t\traise Arrow::ParseError, \"no 'in' for 'for'\"\n\n\t\tsuper\n\tend",
"title": ""
},
{
"docid": "eb217d00d075f4309cf5144e63cc87e7",
"score": "0.57316357",
"text": "def parse_directive_contents( parser, state )\n\t\tfilename = parser.scan_for_pathname( state ) or\n\t\t\traise Arrow::ParseError, \"No filename found for 'include'\"\n\t\tfilename.untaint\n\n\t\tstate.scanner.skip( WHITESPACE )\n\t\tif state.scanner.scan( /\\bas\\b/i )\n\t\t\t@identifier = parser.scan_for_identifier( state )\n\t\tend\n\n\t\t# Try to do the include. Handle errors ourselves since this happens\n\t\t# during parse time.\n\t\tbegin\n\t\t\t#self.log.debug \"Include stack is: \", state[:includeStack]\n\n\t\t\t# Catch circular includes\n\t\t\tif state[:includeStack].include?( filename )\n\t\t\t\traise Arrow::TemplateError, \"Circular include: %s -> %s\" %\n\t\t\t\t\t[ state[:includeStack].join(\" -> \"), filename ]\n\n\t\t\t# Parse the included file into nodes, passing the state from\n\t\t\t# the current parse into the subparse.\n\t\t\telse\n\t\t\t\tinitialData = state.data.dup\n\t\t\t\tinitialData[:includeStack].push filename\n\t\t\t\t\n\t\t\t\tload_path = state.template._load_path\n\t\t\t\t#self.log.debug \"Load path from including template is: %p\" %\n\t\t\t\t#\tload_path\n\t\t\t\tpath = Arrow::Template.find_file( filename, load_path )\n\t\t\t\tcontent = File.read( path )\n\t\t\t\tcontent.untaint\n\n\t\t\t\t#self.log.debug \"initialData is: %p\" % initialData\n\t\t\t\t@nodes = parser.parse( content, state.template, initialData )\n\t\t\t\tinitialData[:includeStack].pop\n\t\t\tend\n\n\t\t# Some errors just turn into comment nodes\n\t\t# :TODO: Make this configurable somehow?\n\t\trescue Arrow::TemplateError, IOError => err\n\t\t\tmsg = \"#{err.class.name}: Include #{filename}: #{err.message}\"\n\t\t\t@nodes = [ Arrow::Template::CommentNode.new(msg) ]\n\t\tend\n\n\t\t# If the directive has an \"as <id>\" part, create the subtemplate\n\t\t# that will be associated with that identifier.\n\t\tif @identifier\n\t\t\t@subtemplate = Arrow::Template.new( @nodes, state.template._config )\n\t\tend\n\n\t\treturn true\n\tend",
"title": ""
},
{
"docid": "c25fddbf5eb3a55b28f917b52b8b25da",
"score": "0.57087463",
"text": "def read_directive_state(channel)\n return unless line = channel[:buffer].read_to(\"\\n\")\n channel[:buffer].consume!\n\n directive = parse_directive(line)\n case directive[:type]\n when :OK\n return\n when :warning\n channel[:error_string] << directive[:message]\n when :error\n channel[:error_string] << directive[:message]\n when :times\n channel[:times] = directive\n when :directory\n read_directory(channel, directive)\n when :file\n read_file(channel, directive)\n when :end\n channel[:local] = File.dirname(channel[:local])\n channel[:stack].pop\n channel[:state] = :finish if channel[:stack].empty?\n end\n\n channel.send_data(\"\\0\")\n end",
"title": ""
},
{
"docid": "7cd8c863689daac5e661c4720e841447",
"score": "0.5555641",
"text": "def directive(new_directive); end",
"title": ""
},
{
"docid": "9ca05d94b3e4af367534b9911e4d44f1",
"score": "0.548955",
"text": "def state(token)\n raise SyntaxUnexpectedStateDirective.new TAG, @parser, self \n end",
"title": ""
},
{
"docid": "c23fdc5c59680fd21e15c0b123157ffc",
"score": "0.5467826",
"text": "def parse_directive(text)\n case type = text[0]\n when \"\\x00\"\n # Success\n { :type => :OK }\n when \"\\x01\"\n { :type => :warning,\n :message => text[1..-1] }\n when \"\\x02\"\n { :type => :error,\n :message => text[1..-1] }\n when ?T\n parts = text[1..-1].split(/ /, 4).map { |i| i.to_i }\n { :type => :times,\n :mtime => Time.at(parts[0], parts[1]),\n :atime => Time.at(parts[2], parts[3]) }\n when ?C, ?D\n parts = text[1..-1].split(/ /, 3)\n { :type => (type == ?C ? :file : :directory),\n :mode => parts[0].to_i(8),\n :size => parts[1].to_i,\n :name => parts[2].chomp }\n when ?E\n { :type => :end }\n else raise ArgumentError, \"unknown directive: #{text.inspect}\"\n end\n end",
"title": ""
},
{
"docid": "3ec4b2fd47333be0e560f57c4821c4f7",
"score": "0.5442534",
"text": "def parse_tag_open_state\n case consume_next_input_character\n when '!'\n # Switch to the markup declaration open state.\n switch_to(:markup_declaration_open)\n when '/'\n # Switch to the end tag open state.\n switch_to(:end_tag_open)\n when /[a-z]/i # ASCII alpha\n # Create a new start tag token, set its tag name to the empty string. Reconsume in the tag name state.\n @current_tag_token = StartTagToken.new(String.new)\n reconsume(:tag_name)\n when '?'\n # This is an unexpected-question-mark-instead-of-tag-name parse error. Create a comment token whose data is the empty string. Reconsume in the bogus comment state.\n not_implemented\n when EOF\n # This is an eof-before-tag-name parse error. Emit a U+003C LESS-THAN SIGN character token and an end-of-file token.\n not_implemented('EOF')\n else\n # This is an invalid-first-character-of-tag-name parse error. Emit a U+003C LESS-THAN SIGN character token. Reconsume in the data state.\n emit(CharacterToken.new(\"\\u003c\"))\n reconsume(:data)\n end\n end",
"title": ""
},
{
"docid": "4a508e862ca406b321069aadbbf0b910",
"score": "0.54144925",
"text": "def tag_is_directive?(tag_name); end",
"title": ""
},
{
"docid": "464cdcb7def23f9abcb55bc65c460161",
"score": "0.5315944",
"text": "def parse_directive_location\n name = parse_name\n return name if DIRECTIVE_LOCATIONS.include?(name.value)\n end",
"title": ""
},
{
"docid": "1e78b19f7864e09a604e9a9336bb0dfd",
"score": "0.5301802",
"text": "def parse_markup_declaration_open_state\n # FIXME: Skip keeps looking when spec says \"next N characters\"\n if @input_stream.skip('--')\n # Consume those two characters, create a comment token whose data is the empty string, and switch to the comment start state.\n @comment_token = CommentToken.new(String.new)\n switch_to(:comment_start)\n # FIXME: Skip keeps looking when spec says \"next N characters\"\n elsif @input_stream.skip(/doctype/i)\n # Consume those characters and switch to the DOCTYPE state.\n switch_to(:doctype)\n elsif next_input_character == '[' && @input_stream.skip('CDATA[')\n # Consume those characters. If there is an adjusted current node and it is not an element in the HTML namespace, then switch to the CDATA section state. Otherwise, this is a cdata-in-html-content parse error. Create a comment token whose data is the \"[CDATA[\" string. Switch to the bogus comment state.\n not_implemented('CDATA :(')\n else\n # This is an incorrectly-opened-comment parse error. Create a comment token whose data is the empty string. Switch to the bogus comment state (don't consume anything in the current state).\n not_implemented('else')\n end\n end",
"title": ""
},
{
"docid": "a00ddc833d2ca4020d996b637fc03719",
"score": "0.53002197",
"text": "def parse_tag_directive(line)\n @tag_directive_rx.match(line) do |m|\n [m[1].nil? ? :start : :end, m[2]]\n end\n end",
"title": ""
},
{
"docid": "1efea0dc4735fb9f06060fd087564aa7",
"score": "0.52876735",
"text": "def scope_directive(tag, parser); end",
"title": ""
},
{
"docid": "6ab82dfceae70db8e5ecabcfb9e9e7e0",
"score": "0.5255074",
"text": "def parse(parse_state_, parse_params_)\n return nil if @requires_previous_field && parse_state_[:previous_field_missing]\n string_ = parse_state_[:string]\n if @delimiter_regexp\n match_ = @delimiter_regexp.match(string_)\n return nil unless match_\n delim_ = match_[0]\n string_ = match_.post_match\n else\n delim_ = ''\n end\n match_ = @value_regexp.match(string_)\n return nil unless match_\n value_ = match_[0]\n string_ = match_.post_match\n if @post_delimiter_regexp\n match_ = @post_delimiter_regexp.match(string_)\n return nil unless match_\n post_delim_ = match_[0]\n string_ = match_.post_match\n else\n post_delim_ = nil\n end\n if @follower_regexp\n match_ = @follower_regexp.match(string_)\n return nil unless match_\n end\n parse_result_ = parsed_value(value_, parse_params_)\n return nil unless parse_result_\n unparse_params_ = parse_result_[1] || {}\n if delim_ != @default_delimiter\n unparse_params_[@delim_unparse_param_key] = delim_\n end\n if post_delim_ && post_delim_ != @default_post_delimiter\n unparse_params_[@post_delim_unparse_param_key] = post_delim_\n end\n unparse_params_[@required_unparse_param_key] = true if @default_value_optional\n [parse_result_[0], @style, string_, unparse_params_]\n end",
"title": ""
},
{
"docid": "f6d4ac5aa9c17a6bdade55099abd7150",
"score": "0.52091086",
"text": "def directive\n match = /^@(?<directive>.+)\\b$/.match(first_content)\n match ? match[:directive] : nil\n end",
"title": ""
},
{
"docid": "3a770b3bae0a92b4a80fe20b512272f3",
"score": "0.51351106",
"text": "def directive_name; end",
"title": ""
},
{
"docid": "3a770b3bae0a92b4a80fe20b512272f3",
"score": "0.51351106",
"text": "def directive_name; end",
"title": ""
},
{
"docid": "18e77f87613a1636fc1a6bdaeb104f6e",
"score": "0.5124674",
"text": "def parse\n \t@parse_status ||= disjunct_linkage_generate\n end",
"title": ""
},
{
"docid": "a37158bffc0813c282ab29ee08619179",
"score": "0.51228786",
"text": "def parse( source, parsestate=nil )\n\t\topts = self.class.config.merge( self.options )\n\t\tparser = Inversion::Parser.new( self, opts )\n\n\t\t@attributes.clear\n\t\t@node_tree = parser.parse( source, parsestate )\n\t\t@source = source\n\n\t\tself.define_attribute_accessors\n\tend",
"title": ""
},
{
"docid": "1ab8a24a77192f77dd7e9400f6efb0cb",
"score": "0.5104334",
"text": "def read_directive\n prod(:directive, %w{.}) do\n token = @lexer.first\n case token.type\n when :BASE\n prod(:base) do\n @lexer.shift\n terminated = token.value == '@base'\n iri = @lexer.shift\n error(\"Expected IRIREF\", production: :base, token: iri) unless iri === :IRIREF\n @options[:base_uri] = process_iri(iri.value[1..-2].gsub(/\\s/, ''))\n namespace(nil, base_uri.to_s.end_with?('#') ? base_uri : iri(\"#{base_uri}#\"))\n error(\"base\", \"#{token} should be downcased\") if token.value.start_with?('@') && token.value != '@base'\n\n if terminated\n error(\"base\", \"Expected #{token} to be terminated\") unless @lexer.first === '.'\n @lexer.shift\n elsif @lexer.first === '.'\n error(\"base\", \"Expected #{token} not to be terminated\") \n else\n true\n end\n end\n when :PREFIX\n prod(:prefixID, %w{.}) do\n @lexer.shift\n pfx, iri = @lexer.shift, @lexer.shift\n terminated = token.value == '@prefix'\n error(\"Expected PNAME_NS\", production: :prefix, token: pfx) unless pfx === :PNAME_NS\n error(\"Expected IRIREF\", production: :prefix, token: iri) unless iri === :IRIREF\n debug(\"prefixID\", depth: options[:depth]) {\"Defined prefix #{pfx.inspect} mapping to #{iri.inspect}\"}\n namespace(pfx.value[0..-2], process_iri(iri.value[1..-2].gsub(/\\s/, '')))\n error(\"prefixId\", \"#{token} should be downcased\") if token.value.start_with?('@') && token.value != '@prefix'\n\n if terminated\n error(\"prefixID\", \"Expected #{token} to be terminated\") unless @lexer.first === '.'\n @lexer.shift\n elsif @lexer.first === '.'\n error(\"prefixID\", \"Expected #{token} not to be terminated\") \n else\n true\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "28d9f13fa7e04a4b1739ec59b14cb8e3",
"score": "0.5059322",
"text": "def directive\n @directive ||= extract_directive.then do |raw|\n (raw && raw.strip).then do |name|\n { raw: raw, name: name.empty? ? nil : name }\n end\n end\n end",
"title": ""
},
{
"docid": "fa3f64747e31422a77f0067bc07d63de",
"score": "0.505911",
"text": "def parse_end_tag_open_state\n case consume_next_input_character\n when /[a-z]/i\n # Create a new end tag token, set its tag name to the empty string. Reconsume in the tag name state.\n @current_tag_token = EndTagToken.new(String.new)\n reconsume(:tag_name)\n when '>'\n # This is a missing-end-tag-name parse error. Switch to the data state.\n switch_to(:data)\n when EOF\n # This is an eof-before-tag-name parse error. Emit a U+003C LESS-THAN SIGN character token, a U+002F SOLIDUS character token and an end-of-file token.\n not_implemented('EOF')\n else\n # This is an invalid-first-character-of-tag-name parse error. Create a comment token whose data is the empty string. Reconsume in the bogus comment state.\n not_implemented('else')\n end\n end",
"title": ""
},
{
"docid": "1ee4d389e07862806c8b743dfd589372",
"score": "0.505533",
"text": "def visibility_directive(tag, parser); end",
"title": ""
},
{
"docid": "3523a21fd275e0d8b54ba06a8c35720b",
"score": "0.4987864",
"text": "def xmlParseMarkupDecl\n if (cur == '<')\n if (nxt(1) == '!')\n case nxt(2)\n when 'E'\n if nxt(3) == 'L'\n xmlParseElementDecl()\n elsif nxt(3) == 'N'\n xmlParseEntityDecl()\n end\n when 'A'\n xmlParseAttributeListDecl()\n when 'N'\n xmlParseNotationDecl()\n when '-'\n xmlParseComment()\n end\n elsif (nxt(1) == '?')\n xmlParsePI()\n end\n end\n end",
"title": ""
},
{
"docid": "90b480a6cfddb7df605ba3af71dbe1ed",
"score": "0.49476585",
"text": "def extract_directive\n return nil unless matter?\n\n @original[opening.size..].then do |matter|\n matter && matter[0...matter.index(/#{NEWLINE}/)]\n end\n end",
"title": ""
},
{
"docid": "5047085caf83afccc5f2bb3837599268",
"score": "0.48860684",
"text": "def parse\n parser.parse(view_path)\n end",
"title": ""
},
{
"docid": "01c434914354345d88a3500b1391a88d",
"score": "0.4838688",
"text": "def parse_tag_name_state\n case consume_next_input_character\n when *WHITESPACE\n # Switch to the before attribute name state.\n switch_to(:before_attribute_name)\n when '/'\n # Switch to the self-closing start tag state.\n switch_to(:self_closing_start_tag)\n when '>'\n # Switch to the data state. Emit the current tag token.\n switch_to(:data)\n emit(@current_tag_token)\n when /[A-Z]/\n # Append the lowercase version of the current input character (add 0x0020 to the character's code point) to the current tag token's tag name.\n @current_tag_token.name << current_input_character.downcase\n when \"\\u0000\" # U+0000 NULL\n # This is an unexpected-null-character parse error. Append a U+FFFD REPLACEMENT CHARACTER character to the current tag token's tag name.\n not_implemented('null')\n when EOF\n # This is an eof-in-tag parse error. Emit an end-of-file token.\n not_implemented('EOF')\n else\n # Append the current input character to the current tag token's tag name.\n @current_tag_token.name << current_input_character\n end\n end",
"title": ""
},
{
"docid": "b4206992942148dd726363c4136f2860",
"score": "0.48284686",
"text": "def parse(unparsed_line); end",
"title": ""
},
{
"docid": "f26d940918331d92ea12e80d1db5689c",
"score": "0.48138735",
"text": "def parse()\n analyze()\n \n position = 0\n while position < @input.length\n token = @input[position]\n position = _internal_parse(token, position)\n end\n end",
"title": ""
},
{
"docid": "5e958a8c6f69b924324c14a334f16413",
"score": "0.48038048",
"text": "def directive(new_directive)\n add_type_and_traverse(new_directive, root: false)\n end",
"title": ""
},
{
"docid": "5677fd2d7968e869aa190c17b7929303",
"score": "0.47994727",
"text": "def parser\n config = self.class.states[@state]\n \n config and config[:parser] or self.class.default_parser\n end",
"title": ""
},
{
"docid": "3dda4447a4bf7fa71c9b134716c13de8",
"score": "0.47788256",
"text": "def conclude(state, dir)\n pstate = (state.app_state ? state.app_state[dir] : nil)\n pstate[:parser].call(nil, state, dir) if pstate and pstate[:parser]\n nil\n end",
"title": ""
},
{
"docid": "1e070423526d141fb4f83f69bc91977d",
"score": "0.47786278",
"text": "def parse_after_doctype_name_state\n case consume_next_input_character\n when *WHITESPACE\n # Ignore the character.\n when '>'\n # Switch to the data state. Emit the current DOCTYPE token.\n emit(@current_tag_token)\n when EOF\n # This is an eof-in-doctype parse error. Set the current DOCTYPE token's force-quirks flag to on. Emit the current DOCTYPE token. Emit an end-of-file token.\n not_implemented('EOF')\n else\n # If the six characters starting from the current input character are an ASCII case-insensitive match for the word \"PUBLIC\", then consume those characters and switch to the after DOCTYPE public keyword state.\n # Otherwise, if the six characters starting from the current input character are an ASCII case-insensitive match for the word \"SYSTEM\", then consume those characters and switch to the after DOCTYPE system keyword state.\n # Otherwise, this is an invalid-character-sequence-after-doctype-name parse error. Set the current DOCTYPE token's force-quirks flag to on. Reconsume in the bogus DOCTYPE state.\n not_implemented('else')\n end\n end",
"title": ""
},
{
"docid": "387e3fb6b64b8278cff603de70dc5411",
"score": "0.4755756",
"text": "def parse\n new_tokenize\n definitions_pass\n mangle_and_merge()\n do_main_pass()\n end",
"title": ""
},
{
"docid": "399c72c189c0ca92a0a8fb2a561b6efd",
"score": "0.47219074",
"text": "def parse\n @finished = false\n result = @parser.parse(pre_process)\n @finished = true\n raise ParseError, @parser unless result\n result\n end",
"title": ""
},
{
"docid": "dd70b5bae9da6da70b8b6350a8523248",
"score": "0.47124",
"text": "def parse(node) # :nodoc:\n if node.children.nil? or node.children.last.nil?\n return\n end\n node.children.last.children.each do |section|\n if section.name.eql?(\"directives\")\n process_directves(section)\n elsif section.name.eql?(\"common-regexps\")\n process_common_regexps(section)\n elsif section.name.eql?(\"common-attributes\")\n process_common_attributes(section)\n elsif section.name.eql?(\"global-tag-attributes\")\n process_global_attributes(section)\n elsif section.name.eql?(\"tags-to-encode\")\n process_tag_to_encode(section)\n elsif section.name.eql?(\"tag-rules\")\n process_tag_rules(section)\n elsif section.name.eql?(\"css-rules\")\n process_css_rules(section)\n\t\telsif section.name.eql?(\"allowed-empty-tags\")\n\t\t process_empty_tags(section)\n end\n end\n end",
"title": ""
},
{
"docid": "0fbe3a60c46772ed79fb66c406f41867",
"score": "0.468449",
"text": "def parse_fragment\n start = current_token\n expect_token(tokens_config[:ellipsis])\n\n has_type_condition = expect_optional_keyword('on').success?\n if !has_type_condition && current_token_is?(tokens_config[:name_class])\n return ASTNode.new(kind: Kinds::FRAGMENT_SPREAD, params: {\n name: parse_fragment_name,\n directives: parse_directives(false)\n })\n end\n\n ASTNode.new(kind: Kinds::INLINE_FRAGMENT, params: {\n type_condition: has_type_condition ? parse_named_type : nil,\n directives: parse_directives(false),\n selection_set: parse_selection_set\n })\n\n end",
"title": ""
},
{
"docid": "c6d9f2f83fbdbfbb42443d6f43026e60",
"score": "0.46722203",
"text": "def parser() @parser end",
"title": ""
},
{
"docid": "03bd90c698319a9b15cc899ef1215570",
"score": "0.46615022",
"text": "def instruct!(directive_tag = T.unsafe(nil), attrs = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "c290cb8955bb03e3a6eef203fedb4693",
"score": "0.46581107",
"text": "def parse(program)\n abstract_syntax_tree(tokenize(program))\nend",
"title": ""
},
{
"docid": "ddb4c0e276b15b4e584bed8ef5923624",
"score": "0.46568686",
"text": "def parse\n parser.parse *extract\n end",
"title": ""
},
{
"docid": "4b46d3ab58435f19f0dd13dcd4296536",
"score": "0.4641643",
"text": "def parse state, psr\n state = state.is_a?(State) ? state : State.new(state)\n ast = remove_all_false(psr.to_parser[state])\n [state, ast]\n end",
"title": ""
},
{
"docid": "8ef11d988c22229d337b4c3495d47f66",
"score": "0.46374097",
"text": "def parse(source_buffer); end",
"title": ""
},
{
"docid": "6b4d70fad04e088e51a02c47b0293421",
"score": "0.46356875",
"text": "def tag_is_directive?(tag_name)\n list = %w(attribute endgroup group macro method scope visibility)\n list.include?(tag_name)\n end",
"title": ""
},
{
"docid": "dc106445c3b4511fcb4550fe9dbd7190",
"score": "0.46295053",
"text": "def parse(string)\n\t\t\t@parser.parse(string)\n\t\tend",
"title": ""
},
{
"docid": "2ed5684c441883214037fd17354d25a0",
"score": "0.4627193",
"text": "def visit_directive(node)\n return node unless node.has_children\n if parent.is_a?(Sass::Tree::RuleNode)\n # @keyframes shouldn't include the rule nodes, so we manually create a\n # bubble that doesn't have the parent's contents for them.\n return node.normalized_name == '@keyframes' ? Bubble.new(node) : bubble(node)\n end\n\n yield\n\n # Since we don't know if the mere presence of an unknown directive may be\n # important, we should keep an empty version around even if all the contents\n # are removed via @at-root. However, if the contents are just bubbled out,\n # we don't need to do so.\n directive_exists = node.children.any? do |child|\n next true unless child.is_a?(Bubble)\n next false unless child.node.is_a?(Sass::Tree::DirectiveNode)\n child.node.resolved_value == node.resolved_value\n end\n\n # We know empty @keyframes directives do nothing.\n if directive_exists || node.name == '@keyframes'\n []\n else\n empty_node = node.dup\n empty_node.children = []\n [empty_node]\n end + debubble(node.children, node)\n end",
"title": ""
},
{
"docid": "52e8aee9d6263b3487933ec950a8bf15",
"score": "0.4625997",
"text": "def state\n self.class.state_abbrev( self[:state] || parse_location[1] )\n end",
"title": ""
},
{
"docid": "d761affc1037876357de84ffc5bfdb19",
"score": "0.4613746",
"text": "def directive_create(tag_name, tag_buf, parser)\n meth = self.class.factory_method_for(tag_name)\n tag = send_to_factory(tag_name, meth, tag_buf)\n meth = self.class.directive_method_name(tag_name)\n send(meth, tag, parser)\n end",
"title": ""
},
{
"docid": "f3b453ea58f595f07701e41aeec2d8d2",
"score": "0.46067157",
"text": "def parse(statement)\n # (1) split into nuggets -> something.something.something\n nugz = statement.split(\".\")\n\n # (2) grok each nugget into buds -> anything(?anything)[?anything]\n budz = nugz.map{ |nugget| /(\\w+)(?:\\(([^\\)]*)\\))?(?:\\[([^\\]]*)\\])?/.match(nugget).captures }\n pp(budz)\n print(\"\\n\")\n\n # (3) scan each bud for whether it's an Entity or Directive, and refine the AST\n ast = budz.map do |bud|\n case bud.first\n when /(order|limit|offset)/ then\n Hash[ [:directive, :params].zip(bud) ]\n when /^[A-Z]/ then\n Hash[ [:entity, :conditions, :fields].zip(bud) ]\n else puts \"whoa duuuude: #{bud.inspect}\"\n end\n end\n\n # (4) explode conditions, captures, params chunks\n ast.each do |chunk|\n chunk[:conditions] &&= chunk[:conditions].split(',').map(&:strip).map { |cond| cond.split(/\\s+/) }\n chunk[:params] &&= chunk[:params].split(',').map(&:strip)\n chunk[:fields] &&= chunk[:fields].split(',').map(&:strip)\n end\n\n return ast\nend",
"title": ""
},
{
"docid": "26b19ef49bb7f970913150b52aa5d47d",
"score": "0.46025604",
"text": "def directive(name)\n @directives[name]\n end",
"title": ""
},
{
"docid": "3feec585588712de5111bfc6097b7f44",
"score": "0.45859015",
"text": "def directive\n render :template => 'directives/' + params[:path], :layout => nil\n end",
"title": ""
},
{
"docid": "3c5809714c0c2e3ae5ff89bfec268138",
"score": "0.45790964",
"text": "def run_parser(s)\n @parser_func.(s)\n end",
"title": ""
},
{
"docid": "7128f57229dcc47e3ab20df9987a82b6",
"score": "0.4574614",
"text": "def parse( string, template, initialData={} )\n\n\t\t# Create a new parse state and build the parse tree with it.\n\t\tbegin\n\t\t\tstate = State.new( string, template, initialData )\n\t\t\tsyntax_tree = self.scan_for_nodes( state )\n\n\t\trescue Arrow::TemplateError => err\n\t\t\tKernel.raise( err ) unless defined? state\n\t\t\tstate.scanner.unscan if state.scanner.matched? #<- segfaults\n\n\t\t\t# Get the linecount and chunk of erroring content\n\t\t\terrorContent = get_parse_context( state.scanner )\n\n\t\t\tmsg = err.message.split( /:/ ).uniq.join( ':' ) +\n\t\t\t\t%{ at line %d of %s: %s...} %\n\t\t\t\t[ state.line, template._file, errorContent ]\n\t\t\tKernel.raise( err.class, msg )\n\t\tend\n\n\t\treturn syntax_tree\n\tend",
"title": ""
},
{
"docid": "1e5e9608d8b504dd52397592fd0b63fe",
"score": "0.4553038",
"text": "def parse_state=(aParseState)\n raise StandardError, 'Nil parse state' if aParseState.nil?\n \n @parse_state = aParseState\n processed_states[parse_state] = true\n end",
"title": ""
},
{
"docid": "a60585680ca50743ac3554ec77b975d6",
"score": "0.45373228",
"text": "def debug_parse(loop_count)\r\n loop_count.times do\r\n print_status\r\n if finished?\r\n return abstract_syntax_tree\r\n end\r\n shift\r\n match = match @parser_stack\r\n if match\r\n unless lookahead_match?\r\n reduce match.name, match.root\r\n end\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "09471a02ca3f2c636c34b2bfde1f1c85",
"score": "0.45345688",
"text": "def parse_after_attribute_value_quoted_state\n case consume_next_input_character\n when *WHITESPACE\n # Switch to the before attribute name state.\n switch_to(:before_attribute_name)\n when '/'\n # Switch to the self-closing start tag state.\n switch_to(:self_closing_start_tag)\n when '>'\n # Switch to the data state. Emit the current tag token.\n switch_to_and_emit(:data, @current_tag_token)\n when EOF\n # This is an eof-in-tag parse error. Emit an end-of-file token.\n not_implemented('EOF')\n else\n # This is a missing-whitespace-between-attributes parse error. Reconsume in the before attribute name state.\n reconsume(:before_attribute_name)\n end\n end",
"title": ""
},
{
"docid": "f65a63947438d2a1c148df4883522f60",
"score": "0.4529685",
"text": "def process_depend_on_directive(path)\n resolve(path)\n end",
"title": ""
},
{
"docid": "c1288f6035a923e64a103e18005a6657",
"score": "0.4527198",
"text": "def parse()\n # todo: packrat style caching\n # set a checkpoint \n @parser.checkpoint\n result = parse_real()\n if !result \n # rollback on failure.\n @parser.rollback\n end\n return result\n end",
"title": ""
},
{
"docid": "3b75564c890cd2a5156226222e017c5e",
"score": "0.4526061",
"text": "def directives(*new_directives); end",
"title": ""
},
{
"docid": "a554a3a9fcdedec0b5a61d5f44194532",
"score": "0.45101494",
"text": "def parse_transition(env, node, parser_name)\n if node.kind_of?(Transition) and not(node.name.nil?)\n begin\n return Parser.new.send(parser_name).parse(node.name)\n rescue Parslet::ParseFailed\n end\n end\n end",
"title": ""
},
{
"docid": "ec86d667d47ff6c8e22f74c5de685a1e",
"score": "0.450488",
"text": "def parse\n controller = ParserController::new(tokenize, @loader, @name)\n controller.parse_all\n end",
"title": ""
},
{
"docid": "ebf4456ba6ca6cba56e9f938a9c08ae2",
"score": "0.4502126",
"text": "def parse\n skip_start fragment\n\n self.element = parse_root(fragment)\n end",
"title": ""
},
{
"docid": "67b06fd6776c8734e82350eb8d4a76a8",
"score": "0.4498746",
"text": "def parse\n\t\tself.tagged = @tgr.add_tags(self.sentence)\n\tend",
"title": ""
},
{
"docid": "be0ad4f95301f462d26bef76960695d3",
"score": "0.44982833",
"text": "def meth_for_parse_struct(parse_struct, start_binding)\n resolve_method(parse_struct, start_binding)\n end",
"title": ""
},
{
"docid": "b206fc04a224e26aab8ab8df33f85402",
"score": "0.44961095",
"text": "def parse_metadata(directive, line)\n case directive\n when 'gff-version'\n @gff_version ||= line.split(/\\s+/)[1]\n when 'FASTA'\n @in_fasta = true\n when 'sequence-region'\n @sequence_regions.push SequenceRegion.parse(line)\n when '#' # \"###\" directive\n @records.push RecordBoundary.new\n else\n @metadata.push MetaData.parse(line)\n end\n true\n end",
"title": ""
},
{
"docid": "af9799cec3e2d60cda539651c58af4ca",
"score": "0.44908494",
"text": "def do_parse\n # fail if state is not validated\n return false unless state == 'validated'\n self.state = 'parsing'\n save\n if parse_dataset\n self.state = 'parsed'\n else\n self.state = 'parse_warnings'\n end\n save\n end",
"title": ""
},
{
"docid": "b5c790e706f369d66c8fdfcb3035ad54",
"score": "0.44893736",
"text": "def next_token( state_number )\n return self.call( \"lex_for_state_#{state_number}\" )\n end",
"title": ""
},
{
"docid": "087bec31e36af6be8d152b4472815092",
"score": "0.44862887",
"text": "def directive_definitions; end",
"title": ""
},
{
"docid": "8d2f1a05939f854c1047b0fd2cd2ce91",
"score": "0.44820297",
"text": "def parser\n @parser ||= guard_parse && parse\n end",
"title": ""
},
{
"docid": "9e03410d62ac10103bc4168d9d1d987d",
"score": "0.44815806",
"text": "def parserDidStartDocument(parser)\n puts \"starting parsing..\" if debug\n self.state = :parses\n end",
"title": ""
},
{
"docid": "b0eaaf6f2732e16ef6a11bc2cd47a200",
"score": "0.4467506",
"text": "def directives; end",
"title": ""
},
{
"docid": "b0eaaf6f2732e16ef6a11bc2cd47a200",
"score": "0.4467506",
"text": "def directives; end",
"title": ""
},
{
"docid": "b0eaaf6f2732e16ef6a11bc2cd47a200",
"score": "0.4467506",
"text": "def directives; end",
"title": ""
},
{
"docid": "b0eaaf6f2732e16ef6a11bc2cd47a200",
"score": "0.4467506",
"text": "def directives; end",
"title": ""
},
{
"docid": "b0eaaf6f2732e16ef6a11bc2cd47a200",
"score": "0.4467506",
"text": "def directives; end",
"title": ""
},
{
"docid": "48a2fc95629caa1c7cc8a3fc6895bf0b",
"score": "0.44635925",
"text": "def factory_method_for_directive(directive); end",
"title": ""
},
{
"docid": "85da5b0eacd6588d9602ffbc65458066",
"score": "0.44610158",
"text": "def parse(s)\n self.read_from(self.tokenize(s))\n end",
"title": ""
},
{
"docid": "f18ea729015a9c0393cb881218e9e19e",
"score": "0.44539785",
"text": "def parse\r\n if finished?\r\n return abstract_syntax_tree\r\n end\r\n shift\r\n match = match @parser_stack\r\n if match\r\n unless lookahead_match?\r\n reduce match.name, match.root\r\n end\r\n end\r\n parse\r\n end",
"title": ""
},
{
"docid": "0f9b8d931de74d14c838f30e27226478",
"score": "0.4443151",
"text": "def parser(**spec, &proc)\n @state.parser = Mua::Parser.read_stream(**spec, &proc)\n end",
"title": ""
},
{
"docid": "14dcbd50d9fc81a995517889d5a8ca26",
"score": "0.44428167",
"text": "def parse\n tokenize\n make_template\n @template\n end",
"title": ""
},
{
"docid": "e310e44aa8e73ca04dfef55a17d4dbf6",
"score": "0.4436786",
"text": "def initialize(path, last_directives_pos = -1, last_read_pos = -1)\n @path = path\n @last_directives_pos = last_directives_pos\n @last_read_pos = last_read_pos\n end",
"title": ""
},
{
"docid": "8f1962e35044cb4cc47ff66c383e92a8",
"score": "0.44221073",
"text": "def parse_directive_locations\n expect_optional_token(tokens_config[:pipe])\n locations = []\n loop do\n locations << parse_directive_location\n break unless expect_optional_token(tokens_config[:pipe]).to_result.success?\n end\n locations\n end",
"title": ""
},
{
"docid": "7221f4a5fe603028ab8570a7861239b6",
"score": "0.4413926",
"text": "def parse(str)\n fh = File.exist?(str) ? File.open(str) : StringIO.new(str)\n lines = read_continuous_lines(fh)\n\n lines.each_with_index do |line, i|\n (decl, *following) = line.split(SPACE)\n\n case decl\n when DECL_MODEL\n @name = following.first\n when DECL_INPUTS\n @inputs = following\n when DECL_OUTPUTS\n @outputs = following\n when DECL_NAMES\n @gates << parse_gate(following, lines, i + 1)\n when DECL_LATCH\n @latches << following\n when DECL_CLOCK\n @clocks << following\n when DECL_END\n break\n when /^[^\\.]/\n next\n else\n fail \"Unknown decl encountered: I don't understand `#{decl}' :(\"\n end\n end\n\n self\n end",
"title": ""
},
{
"docid": "896df070fa4137f6b6bb7a76dc6b8be3",
"score": "0.44057134",
"text": "def struct_declaration\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 14)\n struct_declaration_start_index = @input.index\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 \n end\n # at line 164:5: specifier_qualifier_list struct_declarator_list ';'\n @state.following.push(TOKENS_FOLLOWING_specifier_qualifier_list_IN_struct_declaration_555)\n specifier_qualifier_list\n @state.following.pop\n @state.following.push(TOKENS_FOLLOWING_struct_declarator_list_IN_struct_declaration_557)\n struct_declarator_list\n @state.following.pop\n match(T__24, TOKENS_FOLLOWING_T__24_IN_struct_declaration_559)\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__, 14)\n memoize(__method__, struct_declaration_start_index, success) if @state.backtracking > 0\n\n end\n \n return \n end",
"title": ""
},
{
"docid": "3c5fecad872a7886ad02aa43d8ac3834",
"score": "0.43956864",
"text": "def parse(raw_string)\n # read_tokens_only tokenize(s)\n read_tokens before_read(tokenize(raw_string))\nend",
"title": ""
},
{
"docid": "92792317237753896a09cab684cdd0c1",
"score": "0.43932053",
"text": "def handle_unknown_pi( state, tag=\"\" )\n\n\t\t# If the configuration doesn't say to ignore unknown PIs or it's an\n\t\t# [?alternate-synax?] directive, raise an error.\n\t\tif state.tag_open == '[?' || !@config[:ignore_unknown_PIs]\n\t\t\traise Arrow::ParseError, \"unknown directive\"\n\t\tend\n\n\t\tremainder = state.scanner.scan( %r{(?:[^?]|\\?(?!>))*\\?>} ) or\n\t\t\traise Arrow::ParseError, \"failed to skip unknown PI\"\n\n\t\tpi = state.tag_open + tag + remainder\n\t\tself.log.info( \"Ignoring unknown PI (to = #{state.tag_open.inspect}) '#{pi}'\" )\n\t\treturn Arrow::Template::TextNode.new( pi )\n\tend",
"title": ""
},
{
"docid": "afbf7f104cbecfe68f3ba649342cebb7",
"score": "0.4389444",
"text": "def own_directives; end",
"title": ""
},
{
"docid": "640f60c10bce59eb1fae37701e60fb29",
"score": "0.43816465",
"text": "def in_directive_department?(cop); end",
"title": ""
},
{
"docid": "60d9775801052d157b8e202e8e1bfed7",
"score": "0.43774074",
"text": "def seed_parse?\n @state == :seed_parse\n end",
"title": ""
},
{
"docid": "a0b4ae43fc14cadbefd594b01c9c20cf",
"score": "0.43753475",
"text": "def init_parse(state, dir)\n if dir == :up\n state.app_state[dir][:type] = state.syn_seen == :src ? :client : :server\n else\n state.app_state[dir][:type] = state.syn_seen == :src ? :server : :client\n end\n state.app_state[:dport] = state.syn_seen == :src ? state.dport : state.sport\n state.app_state[:sport] = state.syn_seen == :src ? state.sport : state.dport\n state.app_state[:src] = state.syn_seen == :src ? state.src : state.dst\n state.app_state[:dst] = state.syn_seen == :src ? state.dst : state.src\n state.app_state[:name] = state.last_seen.strftime(\"%Y-%m-%d_%H-%M-%S_\")\n state.app_state[dir][:magic] = ''\n end",
"title": ""
}
] |
61dca9cf89d8914afba97705681d4e87
|
This method scans a raw config file for type 7 passwords and decrypts them
|
[
{
"docid": "1398c527d162a42cb7bbdd11a0b17054",
"score": "0.75028807",
"text": "def decrypt_config(file)\n f = File.open(file, 'r').to_a\n decrypt_array(f.collect {|line| type_7_matches(line)}.flatten)\n end",
"title": ""
}
] |
[
{
"docid": "651776bf654519ac681a6f58a5cec58f",
"score": "0.802258",
"text": "def decrypt_config(file)\n pw_array = []\n f = File.open(file, 'r')\n f.each do |line|\n pw_array << type_7_matches(line)\n end\n decrypt_array(pw_array.flatten)\n end",
"title": ""
},
{
"docid": "d802156565894875ac6f7f1cc65f5953",
"score": "0.70252043",
"text": "def decrypt_passwords!(settings)\n walk_passwords(settings) { |k, v, h| h[k] = ManageIQ::Password.try_decrypt(v) if v.present? }\n end",
"title": ""
},
{
"docid": "989b106c5aaff411fdfb0636c9818f4a",
"score": "0.6853601",
"text": "def read_encrypted_secrets; end",
"title": ""
},
{
"docid": "20c286754f832eb6b09e96c2f33fb37f",
"score": "0.66047525",
"text": "def getEncryptedPass \n data = \"\" \n File.open(@file).each_byte { |byte| \n byte = byte.to_s(16).upcase #convert byte to hex \n byte = \"0\" << byte if byte.length == 1 #if the byte is only 1 number add a 0 to the beggining \n data << \"#{byte} \" \n } \n \n #grab the encypted password out of the file and print it \n data = data.split(\"00 02 00\").last \n encryptedPassword = data.split(\"20 20 20 20 20\").first.strip \n \n puts \"\\nEncrypted Password = #{encryptedPassword}\" \n decryptPassword(encryptedPassword) \n end",
"title": ""
},
{
"docid": "04b644068a77f31ed676c799847ede4f",
"score": "0.65732616",
"text": "def pincode\n File.read(Rails.root.join('config', 'password.txt')).chomp\n end",
"title": ""
},
{
"docid": "32fbd9d6d1361a2863528562ce2265bd",
"score": "0.6527409",
"text": "def d_c(file)\n decrypt_config(file)\n end",
"title": ""
},
{
"docid": "c0d0dc08d3573163adde8bf66f6390cb",
"score": "0.6497303",
"text": "def passwords_file\n\t\tdir['passwords']\n\tend",
"title": ""
},
{
"docid": "c0d0dc08d3573163adde8bf66f6390cb",
"score": "0.6497303",
"text": "def passwords_file\n\t\tdir['passwords']\n\tend",
"title": ""
},
{
"docid": "2991d18e27cf7a91c5db75a2e9f94da0",
"score": "0.6451931",
"text": "def decrypt\n decrypted_settings = to_settings.decrypted.to_flattened_name_hash\n secure_settings = to_settings.encrypted.to_flattened_name_hash\n file_contents = read\n\n decrypted_settings.each_pair do |name_pieces, decrypted_value|\n encrypted_value = secure_settings[name_pieces]\n\n next unless encrypted_value.is_a?(String)\n\n escaped_name = Regexp.escape(name_pieces.last)\n escaped_value = Regexp.escape(encrypted_value)\n line_pattern = /^(\\s*)#{escaped_name}(\\s*):(\\s*)#{escaped_value}$/\n indentation_level = file_contents\n .match(line_pattern)\n &.[](1)\n &.<<(' ')\n\n if decrypted_value.include?(\"\\n\")\n decrypted_value = decrypted_value\n .chomp\n .gsub(/\\n/, \"\\n#{indentation_level}\")\n .prepend(\"|\\n#{indentation_level}\")\n end\n\n file_contents\n .sub!(\n line_pattern,\n \"\\\\1#{name_pieces.last}\\\\2:\\\\3#{decrypted_value}\",\n )\n end\n\n write(file_contents)\n end",
"title": ""
},
{
"docid": "1eb8b322e482778e164dd2c54ecee24b",
"score": "0.63826245",
"text": "def password\n # AIX reference indicates this file is ASCII\n # https://www.ibm.com/support/knowledgecenter/en/ssw_aix_72/com.ibm.aix.files/passwd_security.htm\n Puppet::FileSystem.open(\"/etc/security/passwd\", nil, \"r:ASCII\") do |f|\n parse_password(f)\n end\n end",
"title": ""
},
{
"docid": "dd5d4174fcc6bfcdb57926079b63e78d",
"score": "0.6311129",
"text": "def decode_protected_7z(password, decryptable_portion)\n # TODu: implement\n end",
"title": ""
},
{
"docid": "8176cc9fdf426833355e6794ffa8984f",
"score": "0.6298593",
"text": "def load_password(file, username, environment = nil)\r\n username = username.to_s.downcase\r\n\r\n buffer = YAML.load(File.read(file))\r\n\r\n # Make sure the user exists...\r\n unless buffer.key?(username) then\r\n raise ArgumentError.new(\r\n INVALID_USER_ERROR_MESSAGE.sub(\"\\#{username}\", username))\r\n end\r\n # If he doesn't have a password for THIS environment, use the default..\r\n unless buffer[username].key?(environment) then\r\n # But if he doesn't have a default key either, we have to stop\r\n # processing.\r\n unless buffer[username].key?(nil) then\r\n if environment.nil? then\r\n err = NO_DEFAULT_ENV_ERROR_MESSAGE.sub(\"\\#{username}\", username)\r\n else\r\n err = INVALID_ENV_ERROR_MESSAGE.sub(\r\n \"\\#{username}\", username).sub(\"\\#{environment}\", environment)\r\n end\r\n \r\n raise ArgumentError.new(err)\r\n end\r\n # Needs to be on this side of the nil check so that we can print the\r\n # original environment.\r\n environment = nil\r\n end\r\n\r\n # Now lets decrypt that baby.\r\n return decrypt_password(buffer[username][environment])\r\n end",
"title": ""
},
{
"docid": "55712c583da260a31cdad404167c1e72",
"score": "0.61525184",
"text": "def decrypt_password(password)\n return Inflate.inflate(Base64.decode64(password))\n end",
"title": ""
},
{
"docid": "16dc95c3d5558250de09d4a43a6c412d",
"score": "0.61319995",
"text": "def read_encrypted_secrets=(_arg0); end",
"title": ""
},
{
"docid": "3d653586f285fbfecb6dbb671750a31f",
"score": "0.60793275",
"text": "def get_password(keyfile)\n priv_key = OpenSSL::PKey::RSA.new(File.read(keyfile))\n result = priv_key.private_decrypt(Base64.decode64(locate_config_value(:vcloud_password)))\n result\n end",
"title": ""
},
{
"docid": "874dc598fe2937ce621383e5585adb30",
"score": "0.6059107",
"text": "def extract_password(line) =\n line.match(PASSWORD_INFO)&.named_captures&.transform_keys(&:to_sym)",
"title": ""
},
{
"docid": "a8018e8ec2d2c65e419fc8951fc84b9a",
"score": "0.5993714",
"text": "def decrypted_inflated_cfg(key, path)\n begin\n decipher = OpenSSL::Cipher::AES.new(256, :CBC)\n decipher.decrypt\n decipher.key = key\n decipher.iv = Digest::SHA1.hexdigest(key)\n crypted_cfg = File.binread(path)\n decrypted_deflated = decipher.update(crypted_cfg) + decipher.final\n decrypted_inflated = Zlib::Inflate.inflate(decrypted_deflated)\n return YAML.load(decrypted_inflated)\n rescue Exception => e\n @output.puts \"#{e.message} #{e.backtrace.inspect}\"\n @logger.error \"#{e.message} #{e.backtrace.inspect}\" if @logger \n end\n end",
"title": ""
},
{
"docid": "f70430a3966c4ca59c36fbd4ddcc67b9",
"score": "0.5985501",
"text": "def d(pw)\n decrypt(pw)\n end",
"title": ""
},
{
"docid": "3f1137a5b96efed8cf4de2fcda1e41ca",
"score": "0.5967652",
"text": "def crypted_password; end",
"title": ""
},
{
"docid": "3833c8cbb48e2892d3130d3ce9d84543",
"score": "0.5956637",
"text": "def walk_passwords(settings)\n walk(settings) do |key, value, _path, owner|\n yield(key, value, owner) if PASSWORD_FIELDS.any? { |p| key.to_s.include?(p.to_s) } && !(value.is_a?(settings.class) || value.is_a?(Array))\n end\n end",
"title": ""
},
{
"docid": "26b7d9e8a2eca73e040c662454aa3ebf",
"score": "0.5935213",
"text": "def parse_file\n YAML.load_file(config_file).tap do |creds|\n if !creds.is_a?(Hash)\n raise NoCredsFound, bad_config_file(\"#{config_file} is not valid YAML.\")\n elsif contains_deprecated_keys(creds)\n raise EmailPasswordDeprecated.new(\n bad_config_file(\n 'Email and password login is deprecated.'\\\n ' Use access_id and access_key instead.'\n )\n )\n end\n end\n end",
"title": ""
},
{
"docid": "e7b0b9a9fa08223263e82e7fec10dfd0",
"score": "0.5933917",
"text": "def password_config\n Settings::PasswordConfig\n end",
"title": ""
},
{
"docid": "9906e1845fac084abe460118dfd01f95",
"score": "0.5904178",
"text": "def password\n password = :absent\n user = @resource[:name]\n f = File.open(\"/etc/security/passwd\", 'r')\n # Skip to the user\n f.each_line { |l| break if l =~ /^#{user}:\\s*$/ }\n if ! f.eof?\n f.each_line { |l|\n # If there is a new user stanza, stop\n break if l =~ /^\\S*:\\s*$/\n # If the password= entry is found, return it\n if l =~ /^\\s*password\\s*=\\s*(.*)$/\n password = $1; break;\n end\n }\n end\n f.close()\n return password\n end",
"title": ""
},
{
"docid": "bd9e9498d261cb9dce682d76483f7951",
"score": "0.5888763",
"text": "def grep_passwords(data, file)\n signatures = { 'ZENHOME/libexec/poll_postgres.py\\s.*?\\s.*?\\s.*?\\s\\'(.*?)\\'' => 'password?',\n 'Failed\\spassword\\sfor\\sinvalid\\suser\\s(.*?)\\sfrom\\s' => 'password or invalid user (bruteforce attack)',\n 'password=(.*?)' => 'Password as parameter?',\n '<password>(.*?)<\\/password>' => 'Password?',\n 'j_password' => 'Password?',\n 'j_sap_password' => 'Password?',\n 'j_sap_again' => 'Password?',\n 'oldPassword' => 'Password?',\n 'confirmNewPassword' => 'Password?',\n 'jsessionid' => 'Session',\n 'JSESSIONID' => 'Session',\n 'MYSAPSSO2' => 'Session' }\n grep_signature(data, signatures, file)\n end",
"title": ""
},
{
"docid": "c994e53e29d2f61b71c4367a8a08c8c3",
"score": "0.58419114",
"text": "def encrypt(file_name, password); end",
"title": ""
},
{
"docid": "95e54947fc97a079557c3f0a323c4ff1",
"score": "0.5841014",
"text": "def encrypted_password; end",
"title": ""
},
{
"docid": "95e54947fc97a079557c3f0a323c4ff1",
"score": "0.5841014",
"text": "def encrypted_password; end",
"title": ""
},
{
"docid": "80bc7cdc28b164bdd5e417407daffa65",
"score": "0.58332926",
"text": "def password\n aes_key = KeyGenerator.aes_key(GlobalConfig.secret_key)\n AESEncryption.decrypt(aes_key, @encrypted_pwd)\n end",
"title": ""
},
{
"docid": "53e717243fcb79fb7502a6ef7087bc82",
"score": "0.5830512",
"text": "def pswd_file\n return if File.exist?(CONFIG[:pswd_file])\n\n puts \"Creating example passwords file (#{CONFIG[:pswd_file]})\"\n File.open(CONFIG[:pswd_file], 'w') { |f| f.write(PASSWORDS.to_yaml) }\n end",
"title": ""
},
{
"docid": "1362e642d6958dac2724531ae784d9dd",
"score": "0.5819761",
"text": "def parse_password(f)\n # From the docs, a user stanza is formatted as (newlines are explicitly\n # stated here for clarity):\n # <user>:\\n\n # <attribute1>=<value1>\\n\n # <attribute2>=<value2>\\n\n #\n # First, find our user stanza\n stanza = f.each_line.find { |line| line =~ /\\A#{@resource[:name]}:/ }\n return :absent unless stanza\n\n # Now find the password line, if it exists. Note our call to each_line here\n # will pick up right where we left off.\n match_obj = nil\n f.each_line.find do |line|\n # Break if we find another user stanza. This means our user\n # does not have a password.\n break if line =~ /^\\S+:$/\n\n match_obj = /password\\s+=\\s+(\\S+)/.match(line)\n end\n return :absent unless match_obj\n\n match_obj[1]\n end",
"title": ""
},
{
"docid": "0104a8c3d83f91626403e2e44e70e203",
"score": "0.5800045",
"text": "def store_password(keyfile)\n pub_key = OpenSSL::PKey::RSA.new(File.read(keyfile)).public_key\n result = Base64.encode64(pub_key.public_encrypt(ui.ask(\"Enter your password: \") { |q| q.echo = false }))\n store_config(:vcloud_password, result.gsub(\"\\n\", ''))\n end",
"title": ""
},
{
"docid": "00067e7e43a3d0d9f94d27b4413b0881",
"score": "0.57860005",
"text": "def password_filename\n File.join Haiti.config.proving_grounds_dir, 'password_file'\nend",
"title": ""
},
{
"docid": "6ba466614352f107709aff23541d0b9e",
"score": "0.57455504",
"text": "def baculize_config_no_pass\n baculize_config.join(\"\\n\").gsub(/Password = \".*\"$/, 'Password = \"*************\"')\n end",
"title": ""
},
{
"docid": "5ed819698a00f19570a6b8253b0523f9",
"score": "0.5738737",
"text": "def decode_string_as_password_protected(password, decryptable_portion)\n clear_text = Blowfish.decrypt(password, decryptable_portion)\n \n clear_text\n end",
"title": ""
},
{
"docid": "fc2adee8ea0000572a0b96aa061b7411",
"score": "0.5730938",
"text": "def load_password_for_transporter\n # 3 different sources for the password\n # 1) ENV variable for application specific password\n if ENV[TWO_FACTOR_ENV_VARIABLE].to_s.length > 0\n UI.message(\"Fetching password for transporter from environment variable named `#{TWO_FACTOR_ENV_VARIABLE}`\")\n return ENV[TWO_FACTOR_ENV_VARIABLE]\n end\n # 2) TWO_STEP_HOST_PREFIX from keychain\n account_manager = CredentialsManager::AccountManager.new(user: @user,\n prefix: TWO_STEP_HOST_PREFIX,\n note: \"application-specific\")\n password = account_manager.password(ask_if_missing: false)\n return password if password.to_s.length > 0\n # 3) standard iTC password\n account_manager = CredentialsManager::AccountManager.new(user: @user)\n return account_manager.password(ask_if_missing: true)\n end",
"title": ""
},
{
"docid": "d2223f0ddf50ce4573ea8d5b1b213f81",
"score": "0.57255226",
"text": "def r_filepass\n w_encryption_type = @bytes.read(2).unpack('v').first\n result = { wEncryptionType: w_encryption_type } # wEncryptionType (2 bytes): A Boolean (section 2.5.14) that specifies the encryption type.\n\n case w_encryption_type\n when 0x0000\n result[:_type] = :XOR\n result.merge!(Unxls::Biff8::Structure.xorobfuscation(@bytes)) # encryptionInfo (variable): A variable type field. The type and meaning of this field is dictated by the value of wEncryptionType.\n\n when 0x0001\n rc4_type = @bytes.read(2).unpack('v').first\n @bytes.pos -= 2\n\n case rc4_type\n when 0x0001\n result[:_type] = :RC4\n result.merge!(Unxls::Offcrypto.rc4encryptionheader(@bytes))\n\n when 0x0002, 0x0003, 0x0004\n result[:_type] = :CryptoAPI\n result.merge!(Unxls::Offcrypto.rc4cryptoapiheader(@bytes))\n\n else\n raise(\"Unknown RC4 encryption header type #{Unxls::Log.h2b(rc4_type)} in FilePass record\")\n\n end\n\n else\n raise(\"Unknown encryption type #{Unxls::Log.h2b(w_encryption_type)} in FilePass record\")\n\n end\n\n result\n end",
"title": ""
},
{
"docid": "d40a821c7a44a110704a8a9c44120bcd",
"score": "0.5701229",
"text": "def getPassword\n if @config['password'].nil?\n if @config['auth_vault'] && !@config['auth_vault'].empty?\n @config['password'] = @groomclass.getSecret(\n vault: @config['auth_vault']['vault'],\n item: @config['auth_vault']['item'],\n field: @config['auth_vault']['password_field']\n )\n else\n # Should we use random instead?\n @config['password'] = Password.pronounceable(10..12)\n end\n end\n\n creds = {\n \"username\" => @config[\"master_user\"],\n \"password\" => @config[\"password\"]\n }\n @groomclass.saveSecret(vault: @mu_name, item: \"database_credentials\", data: creds)\n end",
"title": ""
},
{
"docid": "8ff78a57b1e97bb17ffd6f2c1b792754",
"score": "0.5686582",
"text": "def decrypt; end",
"title": ""
},
{
"docid": "9999c385f0afe6bb1bcc47cef464c108",
"score": "0.568365",
"text": "def load_user_file\n if File.exists?(@auth_user_file)\n @username_password ||= begin\n username_password = Hash.new\n file_content = File.read(@auth_user_file)\n file_content.each_line do |line|\n if !line.strip.nil? then line_parts = line.split(':') end\n username_password[line_parts[0]] = line_parts[1].gsub!(/{SHA}/, '')\n end \n username_password\n end\n end\n end",
"title": ""
},
{
"docid": "8987e7dfe93c7f3254f3ad5c8c1b6598",
"score": "0.56810975",
"text": "def decrypt(encrypted_password, pepper)\n ::AES.decrypt(encrypted_password, pepper)\n end",
"title": ""
},
{
"docid": "91cd4994a5dadef9318c41f8377f59b3",
"score": "0.5675871",
"text": "def pe59s2()\n\ttext = \"simple test hello world\"\n\tpwLength = 3\n\tct = cipher(text,'jha')\n\tprintf \"cipher text = %s\\n\", ct\n\tpw = ('a'..'z').to_a\n\tpw = pw.product(pw,pw).map {|x| x.join}\n\twl = {} # try to use hash for performance\n\tFile.open(\"wordList.txt\").read.split.map {|word| wl[word] = 1}\n\tpw.each_with_index do |e, index|\n\t\tc = 0\n\t\tdecode = []\n\t\tct.each do |x|\n\t\t\tif(c == pwLength) then c = 0 end\n\t\t\tprintf \"password index = %d, password ascii = %d cypt-acsill = %d\\n\",index,e[c][0].ord,x#e[]\n\t\t\td = (x ^ e[c][0].ord).chr\n\t\t\tdecode.push(d)\n\t\t\tc += 1\n\t\tend\n\t\t\n\t\tdecode = decode.join\n\t\tdecode = decode.split(' ')\n\t\tdecode.each do |t|\n\t\t\tif(wl.has_key?(t)) then\n\t\t\t\tprintf \"found solution - key = %s\\nDecode = %s\\n\",e, decode \n\t\t\t\treturn\n\t\t\tend\n\t\tend\t\t\n\tend\n printf \"password not found\\n\"\nend",
"title": ""
},
{
"docid": "c6929f99b52dc5f959af7689be708402",
"score": "0.56753045",
"text": "def read_config\n try_read(config_file_name)\n @main_record or raise IOError(\"main key not found\")\n unpacked = nil\n if (pwd=system_config&.dig(\"keyrings\", @fingerprint, \"password\")) != nil\n unpacked = @main_record.try_decrypt(pwd)\n end\n unpacked ||= @main_record.decrypt(request_password(\"password to open repository\"))\n @main_key = Universa::SymmetricKey.new(unpacked)\n rescue IOError\n # potentially recoverable\n puts error_style(\"failed to open keyring: #$!\")\n try_read(backup_file_name)\n puts \"Backup keyring loaded\"\n end",
"title": ""
},
{
"docid": "a32d47125bd6e5301f0c3fb35623f8a3",
"score": "0.5669501",
"text": "def decrypted_password(secure_password)\n begin\n return AESCrypt.decrypt(secure_password, settings.config[\"security_salt\"])\n rescue Exception => e\n give_error(400, ERROR_INVALID_PASSWORD, \"The password is invalid.\").to_json\n end\n end",
"title": ""
},
{
"docid": "a32d47125bd6e5301f0c3fb35623f8a3",
"score": "0.5669501",
"text": "def decrypted_password(secure_password)\n begin\n return AESCrypt.decrypt(secure_password, settings.config[\"security_salt\"])\n rescue Exception => e\n give_error(400, ERROR_INVALID_PASSWORD, \"The password is invalid.\").to_json\n end\n end",
"title": ""
},
{
"docid": "ddf01c091aaeb6c6137acac8f328728a",
"score": "0.5669275",
"text": "def password_clean\n unless @password\n enc = OpenSSL::Cipher::Cipher.new('DES-EDE3-CBC')\n enc.decrypt(salt)\n text = enc.update(Base64.decode64(crypted_password))\n @password = (text << enc.final)\n end\n @password\n rescue\n nil\n end",
"title": ""
},
{
"docid": "249a179498985fcc83a76b1d76c57cc4",
"score": "0.56626964",
"text": "def password_clean\n crypted_password.decrypt(salt)\n end",
"title": ""
},
{
"docid": "6f1065501de6d91088153a6baf6cff8e",
"score": "0.5640178",
"text": "def password_clean\n crypted_password.decrypt(salt)\n end",
"title": ""
},
{
"docid": "6f1065501de6d91088153a6baf6cff8e",
"score": "0.5640178",
"text": "def password_clean\n crypted_password.decrypt(salt)\n end",
"title": ""
},
{
"docid": "6f1065501de6d91088153a6baf6cff8e",
"score": "0.5640178",
"text": "def password_clean\n crypted_password.decrypt(salt)\n end",
"title": ""
},
{
"docid": "6f1065501de6d91088153a6baf6cff8e",
"score": "0.5640178",
"text": "def password_clean\n crypted_password.decrypt(salt)\n end",
"title": ""
},
{
"docid": "6f1065501de6d91088153a6baf6cff8e",
"score": "0.5640178",
"text": "def password_clean\n crypted_password.decrypt(salt)\n end",
"title": ""
},
{
"docid": "5219cd12b3c513165b159eaef7e0626c",
"score": "0.5627835",
"text": "def decrypt_specific_file(path: nil, password: nil, hash_algorithm: \"MD5\")\n stored_data = Base64.decode64(File.read(path))\n salt = stored_data[8..15]\n data_to_decrypt = stored_data[16..-1]\n\n decipher = ::OpenSSL::Cipher.new('AES-256-CBC')\n decipher.decrypt\n decipher.pkcs5_keyivgen(password, salt, 1, hash_algorithm)\n\n decrypted_data = decipher.update(data_to_decrypt) + decipher.final\n\n File.binwrite(path, decrypted_data)\n rescue => error\n fallback_hash_algorithm = \"SHA256\"\n if hash_algorithm != fallback_hash_algorithm\n decrypt_specific_file(path: path, password: password, hash_algorithm: fallback_hash_algorithm)\n else\n UI.error(error.to_s)\n UI.crash!(\"Error decrypting '#{path}'\")\n end\n end",
"title": ""
},
{
"docid": "acc44da6b0a9e32cfb8584d889e44372",
"score": "0.561454",
"text": "def normalized_password; end",
"title": ""
},
{
"docid": "acc44da6b0a9e32cfb8584d889e44372",
"score": "0.561454",
"text": "def normalized_password; end",
"title": ""
},
{
"docid": "7d4707ffd5f29e3b5aed6263a816f08d",
"score": "0.5612523",
"text": "def validatePassword()\n\tconfig = MyConfig.new\n\tconfig.load($configPath)\n\tconfigPassword = config['localContentPassword']\n\tdur = config['localStillDuration']\n\tif dur \n\t\tnum = dur.to_f\n\t\tif num > 0.0\n\t\t\t$defaultDuration = sprintf(\"%g\", num)\n\t\tend\n\tend\n\n\tif configPassword.nil? or configPassword == \"\"\n\t\t$errors << {\"error\"=>\"A password has not been setup. See system administrator.\"}\n\t\treturn false\n\tend\n\tparamPassword = $cgi['password']\n\tif paramPassword.class == StringIO\n\t\tparamPassword = paramPassword.read(10000)\n\tend\n\tif paramPassword.nil? or paramPassword == \"\"\n\t\t$errors << {\"error\"=>\"Password is required\"}\n\t\treturn false\n\tend\n\tif Digest::MD5.hexdigest(configPassword) != paramPassword\n\t\t$errors << {\"error\"=>\"Invalid password\"}\n\t\treturn false\n\tend\n\treturn true\nend",
"title": ""
},
{
"docid": "80209b6cbe4d840998f77a5ffaef5f12",
"score": "0.5612271",
"text": "def decrypt_windows_password(encrypted_password, private_keyfile)\n encrypted_password_bytes = Base64.decode64(encrypted_password)\n private_keydata = File.open(private_keyfile, \"r\").read\n private_key = OpenSSL::PKey::RSA.new(private_keydata)\n private_key.private_decrypt(encrypted_password_bytes)\n end",
"title": ""
},
{
"docid": "d4561618bbc0f0584bf6ad8a5842c190",
"score": "0.56078655",
"text": "def current_heroku_password file\n open(file, 'r').readlines.last.strip if valid_file?(file)\n end",
"title": ""
},
{
"docid": "2041a666291fbe20c8fd23cbbe424d45",
"score": "0.5607391",
"text": "def init_with_file(passwd)\n f = File.new(@file)\n @cont = f.read\n f.close\n @salt = @cont.byteslice 0...Crypto::SALTLEN\n @cont = @cont.byteslice Crypto::SALTLEN..-1\n @key = Crypto.get_key(passwd, @salt)\n @cont = Crypto.decrypt(@key, @cont)\n @cont = Marshal.load(@cont) if @marshal\n end",
"title": ""
},
{
"docid": "d4561618bbc0f0584bf6ad8a5842c190",
"score": "0.5606152",
"text": "def current_heroku_password file\n open(file, 'r').readlines.last.strip if valid_file?(file)\n end",
"title": ""
},
{
"docid": "12640c55c3a1aa317a9b75c74dc2a8e4",
"score": "0.5603054",
"text": "def decrypted\n decrypted_pswd = AESCrypt.decrypt(self.encrypted, \"X\"*32)\n return \"#{decrypted_pswd}\"\n end",
"title": ""
},
{
"docid": "c81c684bfe1490afd3577917ba0e8576",
"score": "0.5602657",
"text": "def grab_password with_file_name\n\tout = \"\"\n\tc = 0\n\twith_file_name.split(\":\").each do |i|\n\t\tif(c > 0)\n\t\t\tout << i+\":\"\n\t\tend\n\t\tc += 1\n\tend\n\tout = out[0..-2]\n\treturn out\nend",
"title": ""
},
{
"docid": "ff7fd26fce3795e63f6466cb60680270",
"score": "0.55889344",
"text": "def configure_ansible_vault(ansible)\n password_file = ENV[\"CYB_ANSIBLE_VAULT_PASSWORD_FILE\"]\n\n if password_file && File.exist?(password_file)\n stats = File.stat(password_file)\n mode = sprintf(\"%o\", stats.mode)\n\n if mode[-2..-1] != \"00\"\n raise \"The Ansible vault-password file must not be group- or world-readable\"\n else\n ansible.vault_password_file = password_file\n end\n else\n ansible.ask_vault_pass = true\n end\n end",
"title": ""
},
{
"docid": "81575dd6026d9076f29696cc21ba0d6f",
"score": "0.5579635",
"text": "def define_password(pwd)\n if !pwd\n\n if true\n\n # Use the 'highline' gem to allow typing password without echo to screen\n require 'rubygems'\n require 'highline/import'\n pwd = ask(\"Password: \") {|q| q.echo = false}\n\n else\n printf(\"Password: \")\n pwd = gets\n end\n\n if pwd\n pwd.strip!\n pwd = nil if pwd.size == 0\n end\n if !pwd\n raise DecryptionError, \"No password given\"\n end\n end\n\n while pwd.size < KEY_LEN_MIN\n pwd *= 2\n end\n pwd\n end",
"title": ""
},
{
"docid": "4be8bf65d945638a1fb31104b19842b4",
"score": "0.5576744",
"text": "def read\n file = FileReader.new(@path)\n return File.read(@path) unless file.encrypted?\n decryptor = Decryptor.new(password: @password, file: file)\n decryptor.plaintext\n end",
"title": ""
},
{
"docid": "2383d79199f3bdd06348f181e3bf16cc",
"score": "0.55757344",
"text": "def web_password\n return file_or_nil(\"web_pwd\", \"@web_password\")\n end",
"title": ""
},
{
"docid": "3072797988a9da0a9706c5fc94e4d425",
"score": "0.55750805",
"text": "def password\n scrambled_password && scrambled_password.unpack('m').first\n end",
"title": ""
},
{
"docid": "76af2a1593402ba25845903948aa2ff0",
"score": "0.5573971",
"text": "def set_password\n if config[:password].nil?\n config[:password] = [*('a'..'z'),*('A'..'Z'),*('0'..'9')].sample(15).join\n end\n end",
"title": ""
},
{
"docid": "81090f82b23b522b0d19e35f5e76fcc8",
"score": "0.5571474",
"text": "def is_password?(secret); end",
"title": ""
},
{
"docid": "185e478b802a7bcde4559588f7d274ca",
"score": "0.55712414",
"text": "def database_password\n get_data_from_yml_file(\"database_credentials.yml\")[application_environment.upcase][\"PASSWORD\"]\n end",
"title": ""
},
{
"docid": "f886a808b554abfc57b3e483fbd3b027",
"score": "0.55557716",
"text": "def load_password\n record = db.execute('SELECT bcrypt_salt, pbkdf2_salt, test_encryption FROM master_password WHERE id = 1').first\n SecretStore::Password.from_h(array_to_hash(record, %i[bcrypt_salt pbkdf2_salt test_encryption])) if record\n end",
"title": ""
},
{
"docid": "136b55028c57e0513d757183dca4cd51",
"score": "0.5545838",
"text": "def get_decrypted_password(entry)\n # Use a dummy user until we have valid authentication\n user = get_unlocked_dummy_user\n # Create our entry\n decrypted_entry = EntryCrypto::PasswordEntry.new entry.site_name, entry.user_name\n decrypted_entry.set_crypto_values entry.encrypted_password.split.pack(\"H*\"), entry.iv.split.pack(\"H*\"), entry.auth_tag.split.pack(\"H*\"), entry.salt.split.pack(\"H*\")\n decrypted_entry.unlock_password user\n end",
"title": ""
},
{
"docid": "f2b388331d96a822ac2dfaa6d49235e6",
"score": "0.5545783",
"text": "def password\n Archive.config[:library_card][:password]\n end",
"title": ""
},
{
"docid": "a8d2712073dbf92a4cb225bac7e8c39a",
"score": "0.55319405",
"text": "def windows_password state\n enc = connection.get_password_data(state[:server_id]).data[:body][\"passwordData\"].strip!\n enc = Base64.decode64(enc)\n rsa = OpenSSL::PKey::RSA.new aws_private_key\n rsa.private_decrypt(enc) if !enc.nil? and enc != ''\n rescue NoMethodError\n debug('Unable to fetch encrypted password')\n return ''\n rescue TypeError\n debug('Unable to decrypt password with AWS_PRIVATE_KEY')\n return ''\n end",
"title": ""
},
{
"docid": "3d788c4daf5f93f24ac076e7e01c0542",
"score": "0.5529748",
"text": "def decrypt_file_key(f)\n key = f['k'].split(':')[1]\n decrypt_key(base64_to_a32(key), self.master_key)\n end",
"title": ""
},
{
"docid": "cc9c4cc7a329c40214d9fbd1eb1ad74f",
"score": "0.55262506",
"text": "def password(**options)\n authenticator = options[:authorization_user] || @authorization_user\n # raise Tarkin::PasswordNotAccessibleException, \"Password can't be accessed at this moment\" if !new_record? && authenticator.nil? \n return \"********\" if !new_record? && authenticator.nil? # for validator\n if new_record? && @password\n @password.force_encoding('utf-8')\n else\n if authenticator\n begin\n meta, group = meta_and_group_for_user authenticator\n rescue Tarkin::ItemNotAccessibleException\n self.errors[:password] << \"can't be decrypted\"\n return nil\n end\n decrypt(self.password_crypted,\n group.private_key(authorization_user: authenticator).private_decrypt(meta.key_crypted),\n group.private_key(authorization_user: authenticator).private_decrypt(meta.iv_crypted)).force_encoding( 'utf-8' )\n else\n self.errors[:password] << \"can't be empty\"\n nil\n end\n end\n end",
"title": ""
},
{
"docid": "1bfa935a14d07119dec2af5cb0f96092",
"score": "0.5526242",
"text": "def pe59s5()\n\tfilename = \"cipher1.txt\"\n\tct = File.open(filename).read.gsub(/\\n/,\"\").split(\",\").map {|x| x.to_i}\n\tpwLength = 3\n\tpw = ('a'..'z').to_a\n\tpw = pw.product(pw,pw).map {|x| x.join}\n\twl = {}\n\tFile.open(\"wordList.txt\").read.split.map {|word| wl[word] = 1}\n\tpw.each_with_index do |e, index|\n\t\tc = 0\n\t\td1 = []\n\t\tct[0..100].each do |x|\n\t\t\tif(c == pwLength) then c = 0 end\n\t\t\td = (x ^ e[c][0].ord).chr\n\t\t\td1.push(d)\n\t\t\tc += 1\n\t\tend\n\t\td2 = d1.join.split(' ')\n\t\tpassrate,matches= 5,0\n\t\td2.each_with_index do |t, index|\n\t\t\tif(wl.has_key?(t)) then\n\t\t\t\tmatches += 1\n\t\t\t\tif(matches > passrate) then\n\t\t\t\t\tclearText = decode(e,filename)\n\t\t\t\t\tprintf \"found key = %s Decode = %s\\n\",e, clearText.join\n\t\t\t\t\tprintf \"Total Ascii value is %d\",clearText.map{|x| x[0].ord}.reduce(:+)\n\t\t\t\t\treturn\n\t\t\t\tend\n\t\t\tend\n\t\tend\t\t\n\tend\n printf \"password not found\\n\"\nend",
"title": ""
},
{
"docid": "7d4b7d19d5eb01712a0ba764694daba1",
"score": "0.5516436",
"text": "def get_pass(password)\n return Base64.decode64(password)\n end",
"title": ""
},
{
"docid": "6b94f1c9feab9284a5ae4428254bc52e",
"score": "0.55129045",
"text": "def read_credentials\n creds = []\n File.open(@conf) { |f| f.each_line { |l| creds << l.chomp } } if File.exists?(@conf)\n creds\n end",
"title": ""
},
{
"docid": "f439604ff8728174dd1a9163a5053303",
"score": "0.5509",
"text": "def find_password(key, user, default=nil)\n\n # First, let's check for an encrypted data bag\n begin\n passwords = Chef::EncryptedDataBagItem.load(@bag, key)\n # now, let's look for the user password\n password = passwords[user]\n rescue\n Chef::Log.warn(\"Encrypted password for #{key}:#{user} not found\")\n\n # Second, let's check for an non-encrypted data bag\n begin\n passwords = Chef::DataBagItem.load(@bag, key)\n # now, let's look for the user password\n password = passwords[user]\n rescue\n Chef::Log.warn(\"Non-Encrypted password for #{key}:#{user} not found\")\n end\n end\n\n # password will be nil if no encrypted data bag was loaded\n # fall back to the attribute on this node\n password ||= default\n end",
"title": ""
},
{
"docid": "10688453504e090e16a23a8135c3f29a",
"score": "0.5505193",
"text": "def load_auth_from_yaml\n self.class.auth_yaml_paths.map { |path| File.expand_path(path) }.select { |path| File.exist?(path) }.each do |path|\n auth = YAML.load(File.read(path))\n @username = auth['username']\n @password = auth['password']\n return if @username && @password\n end\n\n raise \"Could not locate a fusemail authentication file in locations: #{self.class.auth_yaml_paths.inspect}\"\n end",
"title": ""
},
{
"docid": "0d419125d42eb4bc2ae4123cef5183fe",
"score": "0.5503877",
"text": "def decrypt(value)\n Encryptor.decrypt(value, :key => @master_password)\n end",
"title": ""
},
{
"docid": "a937c32d776bedf406598a877dee8c09",
"score": "0.549339",
"text": "def decrypt\n\n end",
"title": ""
},
{
"docid": "4ba38cbd9fb8fc9614326dcae7bc2d59",
"score": "0.5488333",
"text": "def regenerate_password_if_needed\n @password = @cleartext_password.to_bitlbee_password_hash if @cleartext_password\n end",
"title": ""
},
{
"docid": "aa98754eef5b656f00c0015b9a2f7199",
"score": "0.54840505",
"text": "def decrypt(pass)\n\tdecrypted = \"\"\n\tcrypt = File.open(\"cipher1.txt\", \"r\").read.split(',')\n\tpass_str = pass * (crypt.size / 2)\n\tcrypt.each_with_index do |cry, index|\n\t\tdecrypted << (cry.to_i ^ pass_str[index].ord).chr\n\tend\n\tif decrypted.ascii_only? && decrypted.scan(/ /).count > decrypted.size / 6\n\t\ttotal = decrypted.split(//).map{|l| l.ord }.reduce(:+)\n\t\tputs \"#{pass} - #{total}\"\n\t\tputs decrypted\n\t\tputs \"-\"*50\n\tend\nend",
"title": ""
},
{
"docid": "2cf2a971afc7dd932c63d2031073449f",
"score": "0.5483163",
"text": "def pass()\n\n #=============================================================================\n\n #This will first show the user the documentation..\n documentation()\n puts \"Give a password: \".green\n\n #=============================================================================\n\n\n #then it will ask to set a password for this App\n password = gets.chomp()\n\n #=============================================================================\n\n puts \">> This is a 2 factor Authentication <<\".red\n puts \"Give any number < 10000000\"\n\n #=============================================================================\n\n #Then it will ask for a key so that is can encrypt the password with this key\n give_key = gets.chomp().to_i\n\n #Checking if the user typed nothing if he then the value of the key goes to 0 and\n # the programme will tell the user to type a key ...\n key = 0\n\n #=============================================================================\n\n #This is where the length of the key will be checked\n if give_key <= 0\n\n #if it is too small then this will not accept it\n puts \"Give a strong key\".red\n exit\n\n #If it is perfect for the app then it will accept the key\n\n #=============================================================================\n\n #=============================================================================\n elsif give_key <= 10000000\n\n #And it will set the accepted key to the key veriable for storing..\n key = give_key\n puts \"Done >> Always remember this key\".yellow\n\n #If it is too large for the app to process then it will not accept it\n\n #=============================================================================\n\n #=============================================================================\n\n elsif give_key > 10000000\n puts \"Too long\".red\n exit\n\n #Else if the user type wrong words then,\n\n #=============================================================================\n\n #=============================================================================\n\n else\n puts \"Only Nums are allowed\"\n end\n\n #=============================================================================\n\n #=============================================================================================\n\n #Now it will ask for the user to set location where the app data would be stored\n # and store that location to path variable...\n path = location()\n\n #after it there is a instence would be created for Working_With_Files class for creating files\n files_folder = Working_With_Files.new(path)\n\n #after it there is a instence would be created for Encoders class for encrypting and de ..\n encrypted_pass = Encoders.new()\n\n #then the password will be hashed/encrypted by the key supplied by the user..\n data = encrypted_pass.hasher(password, key)\n\n #================================================================================================\n\n #=============================================================================\n\n #then it will write the encrypted password in the passwords.txt file\n File.open(\"#{path}/TheAPP.rb\"+\"/passwords.txt\", 'w') do |line|\n\n line.write(data)\n\n puts \"Done!! All Setup Ready to launch the app\"\n\n end\n\n #=============================================================================\n\nend",
"title": ""
},
{
"docid": "418dea36b570663f6b429f72780026d3",
"score": "0.546496",
"text": "def decryption(original_password)\r\n# \"#{original_password}\"[a..g]\r\n original_password[0] = word_bank[0]\r\n original_password[1] = word_bank[1]\r\n original_password[2] = word_bank[2]\r\n original_password[0] + original_password[1] + original_password[2]\r\nend",
"title": ""
},
{
"docid": "2c5490de974ac1e34d6b2d330d4e621c",
"score": "0.5462252",
"text": "def generate_vault_password(file_name = 'vault-password.txt')\n require 'securerandom'\n Dir.chdir(creds_path) { File.open(file_name, 'w') { |f| f.puts(SecureRandom.uuid) } }\n end",
"title": ""
},
{
"docid": "359bf69be68f04622b38fae259223978",
"score": "0.5460399",
"text": "def decrypt(password)\n cipher = [password].pack(\"H*\")\n ms_enhanced_prov = \"Microsoft Enhanced Cryptographic Provider v1.0\"\n prov_rsa_full = 1\n crypt_verify_context = 0xF0000000\n alg_md5 = 32771\n alg_rc4 = 26625\n\n advapi32 = client.railgun.advapi32\n\n acquirecontext = advapi32.CryptAcquireContextW(4, nil, ms_enhanced_prov, prov_rsa_full, crypt_verify_context)\n createhash = advapi32.CryptCreateHash(acquirecontext['phProv'], alg_md5, 0, 0, 4)\n hashdata = advapi32.CryptHashData(createhash['phHash'], \"SmartFTP\", 16, 0)\n derivekey = advapi32.CryptDeriveKey(acquirecontext['phProv'], alg_rc4, createhash['phHash'], 0x00800000, 4)\n decrypted = advapi32.CryptDecrypt(derivekey['phKey'], 0, true, 0, cipher, cipher.length)\n destroyhash = advapi32.CryptDestroyHash(createhash['phHash'])\n destroykey = advapi32.CryptDestroyKey(derivekey['phKey'])\n releasecontext = advapi32.CryptReleaseContext(acquirecontext['phProv'], 0)\n\n data = decrypted['pbData']\n data.gsub!(/[\\x00]/, '')\n return data\n end",
"title": ""
},
{
"docid": "819ea4be572dd9ff30a7b8ade94a9c50",
"score": "0.54536706",
"text": "def decrypt(password)\n\n pass_array = password.split(\"\")\n\n decrypt_password = \"\"\n \n for i in pass_array\n ord_num = (i.ord-1)\n if ord_num == 96\n ord_num = 122\n elsif\n ord_num == 64\n ord_num = 90\n elsif\n ord_num == 31\n ord_num = 32\n end\n decrypt_password.concat(ord_num.chr).to_s\n end\n decrypt_password\nend",
"title": ""
},
{
"docid": "d66b26b0c60dc1523c7f7326a535b7dc",
"score": "0.5452122",
"text": "def load_credentials\n return YAML.load(File.read(credentials_file))\n end",
"title": ""
},
{
"docid": "f03133930abfa7f0b8473d925ef1ad71",
"score": "0.5452115",
"text": "def decrypt_array(pw_array)\n pw_array.collect {|pw| decrypt(pw)}\n end",
"title": ""
},
{
"docid": "2d3451fab5f7d06b7f1e2502a423a833",
"score": "0.5451542",
"text": "def live_uncorrupt(save_key)\n pass = nil\n # load yaml file\n yaml = load_file\n # if yaml file contains informations\n if yaml and yaml.has_key? save_key\n # get the password\n pass = yaml[save_key][\"password\"]\n end\n\n # decrypt the password\n if pass\n pass = pass.decrypt(:symmetric, :password => @salt)\n end\n \n # return password\n return pass\n end",
"title": ""
},
{
"docid": "815c8851b3576791ffd2fede4da598ee",
"score": "0.54418325",
"text": "def secure_data\n E24PaymentPipe::Parser.parse_settings(read_zip)\n end",
"title": ""
},
{
"docid": "6a6e6ac421e1c51fbd8c73fce4ba2d4c",
"score": "0.54388386",
"text": "def regenerate_password_if_needed\n @password = @cleartext_password.encrypt_bitlbee_password(@user.cleartext_password) if @user && @user.cleartext_password && @cleartext_password\n end",
"title": ""
},
{
"docid": "00d5f0278e438dcab3f738f72a7a3b1d",
"score": "0.5436471",
"text": "def encrypt_passwords!(settings)\n walk_passwords(settings) { |k, v, h| h[k] = ManageIQ::Password.try_encrypt(v) if v.present? }\n end",
"title": ""
},
{
"docid": "ea41ac230d68cd894de2f9dd5a9719c7",
"score": "0.54324496",
"text": "def key_data_from_file(path)\n # Sometimes we will set the :pass attribute to a file path containing the key\n if File.exist?(path)\n File.read(path)\n # In other cases we store the entire SSH key directly in the :pass attribute\n elsif Metasploit::Credential::SSHKey.new(data: path).private?\n path\n end\n end",
"title": ""
},
{
"docid": "4707ad23a5bcac248cbaa00ca058773b",
"score": "0.54319006",
"text": "def load(serialized)\n begin\n serialized && serialized.class == String ? serialized.decrypt(:symmetric, :password => Rails.application.secrets.secret_key_base) : nil\n rescue\n nil\n end\n end",
"title": ""
},
{
"docid": "81564690f2071455d519197746e1f678",
"score": "0.54156435",
"text": "def unlock( master_key )\n if @password_file.file? && !@password_file.empty?\n YAML.load( Crypt.decrypt( @password_file.read, master_key ) )\n else\n {}\n end\n end",
"title": ""
},
{
"docid": "7250413c8576053c05c95dd802eb05ff",
"score": "0.5415574",
"text": "def read_data(name)\n path = File.join(@db_dir, name)\n data = File.open(path, 'r') { |f| f.read }\n\n self.decrypt(from_base64(data))\n end",
"title": ""
},
{
"docid": "68ebd7f2faba77dec6ed34bb50e1178e",
"score": "0.54069334",
"text": "def redact_secrets(text)\n # Every secret unwrapped in this module will unwrap as \"'secret' # PuppetSensitive\" and, currently,\n # no known resources specify a SecureString instead of a PSCredential object. We therefore only\n # need to redact strings which look like password declarations.\n modified_text = text.gsub(%r{(?<=-Password )'.+' # PuppetSensitive}, \"'#<Sensitive [value redacted]>'\")\n if modified_text =~ %r{'.+' # PuppetSensitive}\n # Something has gone wrong, error loudly?\n else\n modified_text\n end\n end",
"title": ""
}
] |
cc0175db6bd808d741573d6d3069f4ee
|
Returns the output of the serverside include as a string, honoring the character encoding set on the response.
|
[
{
"docid": "ab06654a81f45b5a65ef13922ec5d389",
"score": "0.0",
"text": "def render(path, params={})\n servlet_request = env['java.servlet_request']\n params.each { |k,v| servlet_request[k.to_s] = v}\n servlet_response = ServletRackIncludedResponse.new(env['java.servlet_response'])\n servlet_request.getRequestDispatcher(path).include(servlet_request, servlet_response)\n servlet_response.getOutput\n end",
"title": ""
}
] |
[
{
"docid": "6640a034ef76ce23223b511f8db71604",
"score": "0.62429464",
"text": "def string_content(rack_response)\n full_content = ''\n rack_response.each{|c| full_content << c }\n full_content\n end",
"title": ""
},
{
"docid": "2285656e43d799a43b75a057c20dcb3f",
"score": "0.5948423",
"text": "def get_escaped_content_string(options = nil)\n get_content_string(options).gsub(/</, \"<\").gsub(/>/, \">\")\n end",
"title": ""
},
{
"docid": "613fc1f039ed2c93d06b60663f319b6f",
"score": "0.58195215",
"text": "def to_string()\n\t\t# Make sure there is a carridge return, so remove it if there is one and add it back\n\t\treturn encrypt @response.to_s.chomp + \"\\n\"\n\tend",
"title": ""
},
{
"docid": "2090120f324335a2417ab1e112d59eac",
"score": "0.5782011",
"text": "def to_s\n output || content || \"NO CONTENT\"\n end",
"title": ""
},
{
"docid": "c60bfa832514111be9224811bb015232",
"score": "0.57497793",
"text": "def out\n @cgi.out(@headers){@contents}\n end",
"title": ""
},
{
"docid": "c253bc9f3724fd7d67e077d898a5a6ab",
"score": "0.56605095",
"text": "def to_s\n output || content || \"\"\n end",
"title": ""
},
{
"docid": "49b7e082780aa101bd4c21071946337d",
"score": "0.5639421",
"text": "def to_s\n \n if @cgi_response_flag == true\n<<RESULT\n#{http_version} #{response_code} #{REASON_PHRASE[@response_code]}\n#{headers}\n#{cgi_response} \nRESULT\n\n else\n<<RESULT\n#{http_version} #{response_code} #{REASON_PHRASE[@response_code]}\n#{headers}\n\n#{body} \nRESULT\n end\n end",
"title": ""
},
{
"docid": "34c16aade5e18d167861ae16463d5fa6",
"score": "0.5623522",
"text": "def dumpAsHTML\n\t\tmarkup = \"\"\n\t\t@LoadString.each_line do |line|\n\t\t\tmarkup += \"#{CGI.escapeHTML(line.chomp)}<br />\\n\"\n\t\tend\n\t\treturn markup\n\tend",
"title": ""
},
{
"docid": "6aeeb2194286de8acb1d9033de7b4068",
"score": "0.56061816",
"text": "def raw_output(s)\n s\n end",
"title": ""
},
{
"docid": "d5200e389275c7baa09ee335842b8072",
"score": "0.55541396",
"text": "def to_s\n res = response_line\n @headers.each do |key,val|\n res << \"#{key}: #{val}#{Protocol::CRLF}\"\n end\n res << Protocol::CRLF\n end",
"title": ""
},
{
"docid": "9061cb64479a72ba493938f2acbbbb0d",
"score": "0.5541588",
"text": "def output(string)\n unless @headers_sent\n puts @cgi.header(@headers)\n @headers_sent = true\n end\n\n puts string\n end",
"title": ""
},
{
"docid": "a38a21987a4d0b714cfb32b13fcceed0",
"score": "0.5517327",
"text": "def render_result(str)\n @response.write(str)\n end",
"title": ""
},
{
"docid": "9b87b252ea688a598b02bbaa6d1ca361",
"score": "0.5516784",
"text": "def escape_output(data)\n (data && defined?(ERB::Util.h) && Rabl.configuration.escape_all_output) ? ERB::Util.h(data) : data\n end",
"title": ""
},
{
"docid": "e6874cff4acbd6e8f537839bf108f8a3",
"score": "0.5511123",
"text": "def include file\n @master.puts \"\\\\i #{file}\"\n end",
"title": ""
},
{
"docid": "33bfce1862c307fb2bcaf99d24d1b78a",
"score": "0.54843014",
"text": "def to_s\n @content.chomp\n end",
"title": ""
},
{
"docid": "63a041f25f946c54041a15c0cd5f16a0",
"score": "0.54438245",
"text": "def stringOutput\n\t\tend",
"title": ""
},
{
"docid": "63a041f25f946c54041a15c0cd5f16a0",
"score": "0.54438245",
"text": "def stringOutput\n\t\tend",
"title": ""
},
{
"docid": "f448d527a5deae16e6a86b83433c0180",
"score": "0.54164726",
"text": "def raw_output\n @raw_output ||= begin\n lines = path.read.split(\"\\n\")\n lines.shift\n [titre, lines.join(' ').strip_tags(' ')]\n end\n end",
"title": ""
},
{
"docid": "8e3b4b2bf6c3e581a2b97c9122f6f563",
"score": "0.5413357",
"text": "def include_content\n return @include_content\n end",
"title": ""
},
{
"docid": "9a13fbeb79526e3d4d75d45ef9b25db4",
"score": "0.5388796",
"text": "def content\n @content ||= case\n when @file\n @file.read\n when @text\n @text\n when @url\n raise URI::InvalidURIError, @url unless @url =~ URI::regexp\n response = open(@url)\n html = response.read\n html.encode(\"UTF-16\", \"UTF-8\", :invalid => :replace, :replace => \"\").encode(\"UTF-8\", \"UTF-16\")\n end\n end",
"title": ""
},
{
"docid": "e0578ad0e134434580ad98de39bd629c",
"score": "0.5355871",
"text": "def render_extra_head_content\n return \"\".html_safe unless respond_to?(:extra_head_content)\n\n extra_head_content.join(\"\\n\").html_safe\n end",
"title": ""
},
{
"docid": "f16be4d627b588a8eebaf839aa935d46",
"score": "0.5344079",
"text": "def to_rack_output\n [status, headers, page]\n end",
"title": ""
},
{
"docid": "c826a7ce418e9d3b988b15e99309ddc0",
"score": "0.53011507",
"text": "def get_include_data(line)\n return IO.read(line.include_file_path) if line.include_file_options.nil?\n\n case line.include_file_options[0]\n when ':lines'\n # Get options\n include_file_lines = line.include_file_options[1].gsub('\"', '').split('-')\n include_file_lines[0] = include_file_lines[0].empty? ? 1 : include_file_lines[0].to_i\n include_file_lines[1] = include_file_lines[1].to_i if !include_file_lines[1].nil?\n\n # Extract request lines. Note that the second index is excluded, according to the doc\n line_index = 1\n include_data = []\n File.open(line.include_file_path, \"r\") do |fd|\n while line_data = fd.gets\n if (line_index >= include_file_lines[0] and (include_file_lines[1].nil? or line_index < include_file_lines[1]))\n include_data << line_data.chomp\n end\n line_index += 1\n end\n end\n\n when 'src', 'example', 'quote'\n # Prepare tags\n begin_tag = '#+BEGIN_%s' % [line.include_file_options[0].upcase]\n if line.include_file_options[0] == 'src' and !line.include_file_options[1].nil?\n begin_tag += ' ' + line.include_file_options[1]\n end\n end_tag = '#+END_%s' % [line.include_file_options[0].upcase]\n\n # Get lines. Will be transformed into an array at processing\n include_data = \"%s\\n%s\\n%s\" % [begin_tag, IO.read(line.include_file_path), end_tag]\n\n else\n include_data = []\n end\n # @todo: support \":minlevel\"\n\n include_data\n end",
"title": ""
},
{
"docid": "8d4859c9d79ef12f1b17d0f0305b4df7",
"score": "0.5291349",
"text": "def includes_data\n [\"#include\", *self.includes.map(&:to_s)].join(\"\\n\")\n end",
"title": ""
},
{
"docid": "4bc42bfc468728b766bd2d2b8e3c640a",
"score": "0.5266133",
"text": "def content_encoding\n\t\treturn self.headers.content_encoding\n\tend",
"title": ""
},
{
"docid": "4bc42bfc468728b766bd2d2b8e3c640a",
"score": "0.5266133",
"text": "def content_encoding\n\t\treturn self.headers.content_encoding\n\tend",
"title": ""
},
{
"docid": "bae205c33801cad068f998b020767c3e",
"score": "0.52603096",
"text": "def output\n @outputbuffer.string\n end",
"title": ""
},
{
"docid": "e7100630753fb6de816a67b40fb02d26",
"score": "0.5246113",
"text": "def encoding\n @io.external_encoding\n end",
"title": ""
},
{
"docid": "e7100630753fb6de816a67b40fb02d26",
"score": "0.5246113",
"text": "def encoding\n @io.external_encoding\n end",
"title": ""
},
{
"docid": "9182850b962b2a924ac251b7f21260c5",
"score": "0.5246037",
"text": "def to_string\n render().join \"\\n\"\n end",
"title": ""
},
{
"docid": "d1a399ab85a9e3c75d93e2a33a265e3e",
"score": "0.5243818",
"text": "def to_s\n result = \"Response header: \" + @response_version.to_s + \" \"+ @response_code.to_s + \" \"+ @response_message.to_s + \"\\n\"\n result += \"Content-length: \" + @content_length + \"\\n\" if ! @content_length.nil?\n result += \"Spam: \"+ @spam.to_s + \"\\n\"+ @score.to_s + \"/\"+ @threshold.to_s + \"\\n\" if ! @spam.nil?\n result += @tags.join(\"\\n\") if ! @tags.nil?\n result += @report.to_s if ! @report.nil?\n end",
"title": ""
},
{
"docid": "ff66ab4ab01632425ae14431c0447a20",
"score": "0.52220476",
"text": "def h(string)\n Rack::Utils.escape_html(string) # Escape any html code that appears on page e.g. <script>\nend",
"title": ""
},
{
"docid": "a0252fbda4fcfcd739844f93dceef8fb",
"score": "0.52164066",
"text": "def included_facets_string\n return '' if included_facets.empty?\n\n \"qInclude=#{included_facets.map(&:to_s).join('%7C,%7C')}\"\n end",
"title": ""
},
{
"docid": "03246ee145d3886046ca16d0af869013",
"score": "0.5211573",
"text": "def force_header_encoding(s); s; end",
"title": ""
},
{
"docid": "8f16e09a410ba9f0ea3daf0767b47307",
"score": "0.5206976",
"text": "def include_file(filepath)\n content = File.read(filepath)\n mime = MimeMagic.by_path(filepath)\n if mime.text?\n return content\n elsif mime.image?\n return Base64.strict_encode64(content)\n else\n raise \"File '${filepath}' of type '${mime}' can't be included as text\"\n end\n end",
"title": ""
},
{
"docid": "4cef795a0747334c373ff9ee4de259d3",
"score": "0.5206546",
"text": "def escaped_content\n content.gsub(/&/, '&').gsub(/</, '<').strip\n end",
"title": ""
},
{
"docid": "e9a1a741ae1228cea19010822ff90904",
"score": "0.51822364",
"text": "def raw_text\n text = ''\n\n objects = get_objects(get_data(@file))\n objects = decode_objects(objects)\n\n objects.each { |o| text += o[:data] if(o[:data] and is_text_header?(o[:header])) }\n\n text\n end",
"title": ""
},
{
"docid": "8f5b074af0ade4475483bab72075280e",
"score": "0.5179799",
"text": "def as_string()\n\n data_map = IniFile.new( :filename => @file_path, :encoding => 'UTF-8' )\n data_map = IniFile.load( @file_path ) if File.file? @file_path\n return data_map.to_s\n\n end",
"title": ""
},
{
"docid": "3486afffa9125de31df707eda96dd9f8",
"score": "0.517217",
"text": "def to_string\n contents\n end",
"title": ""
},
{
"docid": "3c6818b1380a95efae015bdb067d559f",
"score": "0.5158042",
"text": "def to_s\n return unless filename\n\n result = []\n result << \"%= lang:#{language}#{highlight}\"\n result << '\\begin{code}'\n result.concat(raw_code)\n result << '\\end{code}'\n\n rescue CodeInclusionException => e\n code_error(e.message)\n end",
"title": ""
},
{
"docid": "b5544c78e9b2037f484600ac291f3dd2",
"score": "0.5156815",
"text": "def to_s\n render().join \"\\n\"\n end",
"title": ""
},
{
"docid": "cc330e5ab61c99aad682dfb3f9ce86c2",
"score": "0.5155626",
"text": "def to_s\n headers = \"\"\n headers = YAML::dump(@headers).sub(/^--- \\n/, '') unless @headers.empty?\n extended = \"\"\n extended = \"\\n<!--more-->\\n#{@raw_extended}\" if @raw_extended\n \"#{headers}\\n#{@raw_body}#{extended}\"\n end",
"title": ""
},
{
"docid": "ed024ea0523e40ece6b3f718941c6a33",
"score": "0.51528126",
"text": "def encode\n @content.serialize_to_string\n end",
"title": ""
},
{
"docid": "4790ada2c123b6a8895fc41a007765b8",
"score": "0.5129348",
"text": "def encoding\n @connection.encoding.to_s\n end",
"title": ""
},
{
"docid": "cfff56582b6839ecb4a1648c709d5135",
"score": "0.51274663",
"text": "def encoding; end",
"title": ""
},
{
"docid": "cfff56582b6839ecb4a1648c709d5135",
"score": "0.51274663",
"text": "def encoding; end",
"title": ""
},
{
"docid": "cfff56582b6839ecb4a1648c709d5135",
"score": "0.51274663",
"text": "def encoding; end",
"title": ""
},
{
"docid": "cfff56582b6839ecb4a1648c709d5135",
"score": "0.51274663",
"text": "def encoding; end",
"title": ""
},
{
"docid": "cfff56582b6839ecb4a1648c709d5135",
"score": "0.51274663",
"text": "def encoding; end",
"title": ""
},
{
"docid": "cfff56582b6839ecb4a1648c709d5135",
"score": "0.51274663",
"text": "def encoding; end",
"title": ""
},
{
"docid": "cfff56582b6839ecb4a1648c709d5135",
"score": "0.51274663",
"text": "def encoding; end",
"title": ""
},
{
"docid": "cfff56582b6839ecb4a1648c709d5135",
"score": "0.51274663",
"text": "def encoding; end",
"title": ""
},
{
"docid": "cfff56582b6839ecb4a1648c709d5135",
"score": "0.51274663",
"text": "def encoding; end",
"title": ""
},
{
"docid": "cfff56582b6839ecb4a1648c709d5135",
"score": "0.51274663",
"text": "def encoding; end",
"title": ""
},
{
"docid": "cfff56582b6839ecb4a1648c709d5135",
"score": "0.51274663",
"text": "def encoding; end",
"title": ""
},
{
"docid": "cfff56582b6839ecb4a1648c709d5135",
"score": "0.51274663",
"text": "def encoding; end",
"title": ""
},
{
"docid": "cfff56582b6839ecb4a1648c709d5135",
"score": "0.51274663",
"text": "def encoding; end",
"title": ""
},
{
"docid": "cfff56582b6839ecb4a1648c709d5135",
"score": "0.51274663",
"text": "def encoding; end",
"title": ""
},
{
"docid": "cfff56582b6839ecb4a1648c709d5135",
"score": "0.51274663",
"text": "def encoding; end",
"title": ""
},
{
"docid": "68b0c997b8dd10f5b543f6444a0be94f",
"score": "0.51134366",
"text": "def raw_output\n self.read(@filename)\n end",
"title": ""
},
{
"docid": "9a0d3763d33ced2f9e1a7a74d705b3d0",
"score": "0.51109016",
"text": "def render_cgi(extra_headers = {})\n\t\t\th = { \n\t\t\t\t'type' => self.class.content_type,\n\t\t\t\t'status' => 'OK',\n\t\t\t}.merge(extra_headers)\n\n\t\t\tCGI.new.out(h) { render }\n\t\tend",
"title": ""
},
{
"docid": "1c797f2a6dd22a4cf11789a1609ed7e5",
"score": "0.51102334",
"text": "def to_s\n \"#{output}\\n[#{version}]\"\n end",
"title": ""
},
{
"docid": "65e97c992c87601202cd539986074bba",
"score": "0.5090683",
"text": "def output\n return basic_output()\n end",
"title": ""
},
{
"docid": "1422252076938761c495d94959b4bac9",
"score": "0.5086575",
"text": "def get\n self.data.force_encoding(Encoding::UTF_16BE).encode(Encoding::UTF_8)\n end",
"title": ""
},
{
"docid": "d1a6f12bd7f54e8767a2dae381056a08",
"score": "0.5082866",
"text": "def get_content_string(options = nil)\n xml_str = ''\n get_content(options).each do |element|\n xml_str << element.to_s\n end\n xml_str\n end",
"title": ""
},
{
"docid": "1b0c63abdd9ad0743aee2177fe80fcec",
"score": "0.50764126",
"text": "def to_s\n Utils::Escape.html(@content)\n end",
"title": ""
},
{
"docid": "ed1359baa95f04205b2fbab3c2881962",
"score": "0.50664127",
"text": "def to_s\n content.to_s\n end",
"title": ""
},
{
"docid": "61f0fa8e18b60fb720a7b637609a75ae",
"score": "0.5057229",
"text": "def render_to_string(*)\n if self.response_body = super\n string = \"\"\n self.response_body.each { |r| string << r }\n string\n end\n ensure\n self.response_body = nil\n end",
"title": ""
},
{
"docid": "aead116cffb5d422d88ce51aa5e14564",
"score": "0.5053218",
"text": "def output\n @text\n end",
"title": ""
},
{
"docid": "0a3f3c0e2e5091c4e5590bdd7da3a6f2",
"score": "0.50427574",
"text": "def output\n # Refactor opportunity--figure out loop for this:\n header_1 = request[0].split(\" \")\n @verb = header_1[0]\n @path = header_1[1]\n @protocol = header_1[2]\n\n header_2 = request[1].split(\" \")\n @host = header_2[1].split(\":\")[0]\n @port = header_2[1].split(\":\")[1]\n\n @origin = host\n @accept = request[-3].split(\": \")[1]\n format_response(verb, path, protocol, host, port, origin, accept)\n end",
"title": ""
},
{
"docid": "8ad084ec06be90725bef11c0e73da533",
"score": "0.50423974",
"text": "def encoding\n @external_encoding\n end",
"title": ""
},
{
"docid": "d97ecb3fa280deadcf7ec7e063d5f9a4",
"score": "0.5029895",
"text": "def to_s\n contents.to_s\n end",
"title": ""
},
{
"docid": "d4f559ddebdb82f01f98801ab860e6bc",
"score": "0.5022704",
"text": "def content\n ERB.new(load, nil, '-').result(binding)\n end",
"title": ""
},
{
"docid": "b9dbbc15f7b441336ce840a8b0104afe",
"score": "0.50141704",
"text": "def to_s\n content.to_s\n end",
"title": ""
},
{
"docid": "38dee9f943958c2e9e5e678a33020610",
"score": "0.5000232",
"text": "def h(string)\n Rack::Utils.escape_html(string)\n end",
"title": ""
},
{
"docid": "2e7cc86e5bbecd9b02d6764ec1440f4b",
"score": "0.4996937",
"text": "def to_s\n response = \"#{@status_line}\\n#{@header_fields}\\n#{@body}\"\n end",
"title": ""
},
{
"docid": "b5baf58d238b68a1e590767f1a8fd770",
"score": "0.4992031",
"text": "def h(str)\n CGI.escapeHTML(str.to_s)\n end",
"title": ""
},
{
"docid": "3e120fcc3f91759cdd5612d007d95709",
"score": "0.498937",
"text": "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",
"title": ""
},
{
"docid": "6449bdb00be1537a50347990316e8c65",
"score": "0.49868572",
"text": "def content_string\n all_bytes.pack('C*') if(all_bytes)\n end",
"title": ""
},
{
"docid": "c860ad49b828cde1aec0b3d88babe79d",
"score": "0.49853998",
"text": "def content(text)\n @out << text.to_s\n nil\n end",
"title": ""
},
{
"docid": "baa6cd71118878cac7023ca86845bd85",
"score": "0.49841765",
"text": "def h(text)\n Rack::Utils.escape_html(text)\n end",
"title": ""
},
{
"docid": "baa6cd71118878cac7023ca86845bd85",
"score": "0.4984069",
"text": "def h(text)\n Rack::Utils.escape_html(text)\n end",
"title": ""
},
{
"docid": "f1defc4efd9410293a7ee142e14671fa",
"score": "0.4977585",
"text": "def raw\n\t\treturn @content\n\tend",
"title": ""
},
{
"docid": "f1defc4efd9410293a7ee142e14671fa",
"score": "0.4977585",
"text": "def raw\n\t\treturn @content\n\tend",
"title": ""
},
{
"docid": "d10e061be7ab9565bba5483aa4dfa297",
"score": "0.49774188",
"text": "def encoded\n ready_to_send!\n buffer = header.encoded\n buffer << \"\\r\\n\"\n buffer << body.encoded(content_transfer_encoding)\n buffer\n end",
"title": ""
},
{
"docid": "b0ae1e86037edc8059628db06ecdf9a6",
"score": "0.49771506",
"text": "def h obj\n CGI.escapeHTML obj.to_s\n end",
"title": ""
},
{
"docid": "f66250304ee064afb5bde52c71a850fa",
"score": "0.49746576",
"text": "def hnl_http_get_text(uri, include_http_response = false)\n # setup the request\n http = Net::HTTP.new(uri.host, uri.port)\n request = Net::HTTP::Get.new(uri.request_uri)\n # make the request\n response = http.request(request)\n # and return the result\n return [response.body, response] if include_http_response\n response.body\n end",
"title": ""
},
{
"docid": "25828888d33474e8af892bc1fdb26b69",
"score": "0.4974359",
"text": "def see_output(s=nil)\n a = %w[rendered response].map{|e|(!respond_to? e) ? nil : (send e)}\n a.push(a.pop.body) if a.last\n (a.unshift s).compact!\n assert_present a, 'nothing defined'\n f=App.root.join('out/see-output').open 'w'\n f.print a.first\n f.close\n end",
"title": ""
},
{
"docid": "0e0b6ae184a0809a70e6229c3b8a7f20",
"score": "0.49667546",
"text": "def include string\n @include << to_tag(string)\n end",
"title": ""
},
{
"docid": "64c58b05b06710511357eb8d96c118e0",
"score": "0.49587837",
"text": "def hello\n render html:\"The ships hung in the sky, much in the way bricks don't \\nDouglas Adams\"\n end",
"title": ""
},
{
"docid": "0fd0a7286e08f134f0f919bfcec62656",
"score": "0.49567765",
"text": "def render_text(text)\n @out << text\n end",
"title": ""
},
{
"docid": "6949724d0c0ff95404a4cdc23179f562",
"score": "0.49542966",
"text": "def dumpAsHTML\n\t\tvalue = dumpAsString\n\t\treturn CGI.escapeHTML(value)\n\tend",
"title": ""
},
{
"docid": "8f6e572691feaffff99112e1b110c17a",
"score": "0.49525586",
"text": "def encode to_encode\n CGI.escape(to_encode)\n end",
"title": ""
},
{
"docid": "89ef135d5862d2a168e3eef45a77fb7d",
"score": "0.49453473",
"text": "def to_s\n @response.body\n end",
"title": ""
},
{
"docid": "d21298873fbbdf8b8f117d8ed8d0e6d7",
"score": "0.4943851",
"text": "def get_header() \n erb :header\n end",
"title": ""
},
{
"docid": "f01e3b43e9f2474de52beb55c36cc178",
"score": "0.49405205",
"text": "def encoding_line; end",
"title": ""
},
{
"docid": "5e1825475af7a7f178c125259f9f4850",
"score": "0.49386752",
"text": "def render( render_state )\n\t\traw = super\n\t\tbuf = String.new( '' )\n\t\tPP.pp( raw, buf )\n\t\treturn self.escape( buf.chomp, render_state )\n\tend",
"title": ""
},
{
"docid": "98404edde655491c5e748d1b771446ff",
"score": "0.4933152",
"text": "def output_ext\n renderer.output_ext\n end",
"title": ""
},
{
"docid": "98404edde655491c5e748d1b771446ff",
"score": "0.4933152",
"text": "def output_ext\n renderer.output_ext\n end",
"title": ""
},
{
"docid": "f1e84c31f0dd6e7956cf0c41a6c423e7",
"score": "0.49198416",
"text": "def render\n sb = StringIO.new\n append_to_string_builder(sb)\n sb.string\n end",
"title": ""
},
{
"docid": "a24d143b0729aaf135b74e116b6a1138",
"score": "0.49119815",
"text": "def hello\n render html: \"Hello, World! et ¡Hola,Mundo!\" #renders html to be returned.\n end",
"title": ""
}
] |
f83cf695ed082ef0945fea29fbe065dc
|
Recurse through children of the window_handle.
|
[
{
"docid": "19592803545d05d81b1d07892e808d32",
"score": "0.75053746",
"text": "def recurse_children( window_handle, findTextOnly = false )\n\n\t\t@findTextOnly = findTextOnly\n\t\t\n\t\t# Process the parent window.\n\t\tif (@allChildren[window_handle] == nil)\n\t\t\tprintControlInfo( 0, window_handle )\n\t\t\t@allChildren[window_handle] = 1\n\t\tend\n\n\t\t# Enumerate the control's children.\n\t\tif (@childProcCalled[window_handle] == nil)\n\t\t\t# Enumeration has not been called on this control, so call it.\n\t\t\t@log.debug( \"Calling EnumChildWindows on handle #{window_handle}\")\n\t\t\t@@EnumChildWindows.call(window_handle, @ChildWindowsProc, window_handle)\n\t\t\t@childProcCalled[window_handle] = 1\n\t\t\t\n\t\t\t# While the array of children to call is not empty, recurse\n\t\t\t# children.\n\t\t\twhile (@childrenToCall.first != nil)\n\t\t\t\thandle = @childrenToCall.shift\n\t\t\t\t@log.debug( \"Calling recurse_children, parent #{window_handle}, child #{handle}\")\n\t\t\t\trecurse_children( handle )\n\t\t\tend\n\t\telse\n\t\t\t@log.debug( \"EnumChildWindows has already been called for handle #{window_handle}\")\n\t\tend\n\tend",
"title": ""
}
] |
[
{
"docid": "d3e2394b8cd1795ca8b7ee5cc30aee7c",
"score": "0.8190374",
"text": "def find_all_children( window_handle )\n\n\t\t\t@log.debug(\"Finding all children for handle #{window_handle}\")\n\t\t\t\n\t\t\t# Process the parent window.\n\t\t\tif (@allChildren[window_handle] == nil)\n\t\t\t\t@allChildren[window_handle] = Window.new(window_handle)\n\t\t\tend\n\t\n\t\t\t# Enumerate the control's children.\n\t\t\tif (@childProcCalled[window_handle] == nil)\n\t\t\t\t# Enumeration has not been called on this control, so call it.\n\t\t\t\t@@EnumChildWindows.call(window_handle, @GetChildHandleProc, nil)\n\t\t\t\t\n\t\t\t\t@childProcCalled[window_handle] = 1\n\t\t\t\t\n\t\t\t\t# While the array of children to call is not empty, recurse\n\t\t\t\t# children.\n\t\t\t\twhile (@childrenToCall.first != nil)\n\t\t\t\t\thandle = @childrenToCall.shift\n\t\t\t\t\tfind_all_children( handle )\n\t\t\t\tend\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "0a24fe3bf334cc86f0727a8fcd9aa7af",
"score": "0.7036895",
"text": "def print_all_children( window_handle, findTextOnly = false )\n\t\t\t@findTextOnly = findTextOnly\n\t\t\t\n\t\t\t# Process the parent window.\n\t\t\tif (@allChildren[window_handle] == nil)\n\t\t\t\tprintControlInfo( 0, window_handle )\n\t\t\t\t@allChildren[window_handle] = 1\n\t\t\tend\n\t\n\t\t\t# Enumerate the control's children.\n\t\t\tif (@childProcCalled[window_handle] == nil)\n\t\t\t\t# Enumeration has not been called on this control, so call it.\n\t\t\t\t@@EnumChildWindows.call(window_handle, @PrintChildInfoProc,\n\t\t\t\t\twindow_handle)\n\t\t\t\t@childProcCalled[window_handle] = 1\n\t\t\t\t\n\t\t\t\t# While the array of children to call is not empty, recurse\n\t\t\t\t# children.\n\t\t\t\twhile (@childrenToCall.first != nil)\n\t\t\t\t\thandle = @childrenToCall.shift\n\t\t\t\t\tprint_all_children( handle )\n\t\t\t\tend\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "eedd47b450055da6941d838a85524c84",
"score": "0.65452164",
"text": "def children\n TkWinfo.children(content)\n end",
"title": ""
},
{
"docid": "518fb68bc417838865e41275bf5e3954",
"score": "0.626159",
"text": "def named_windows\n return [] unless children\n children.inject([]) do | names, child |\n names << child.name if child.name\n names += child.named_windows if child.kind_of?(Parent)\n names\n end\n end",
"title": ""
},
{
"docid": "96d845bd90256b134049c9f426a1d762",
"score": "0.62205756",
"text": "def window_handles; end",
"title": ""
},
{
"docid": "fc1bf67b1c5eeb41b566c2401b345087",
"score": "0.61593485",
"text": "def window_handles\n bridge.window_handles\n end",
"title": ""
},
{
"docid": "e32189ef3168b9a809f438b958eddb6c",
"score": "0.57987803",
"text": "def window_handles\n driver.window_handles\n end",
"title": ""
},
{
"docid": "1dd337616cc6fcbb1ecf43d65b5e1377",
"score": "0.56481504",
"text": "def each\n (0..VIM::Window.count - 1).each do |ix|\n yield Window.new(VIM::Window[ix])\n end\n end",
"title": ""
},
{
"docid": "1b625d2769542f4f7df776110a8c587e",
"score": "0.5597033",
"text": "def each_event\n\t\t\twhile event = SDC.window.poll_event do\n\t\t\t\tyield event\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "b8d16bd8f9a0b2cfa34ce4e2bad4e2d5",
"score": "0.55682766",
"text": "def TreeView_GetChild(hwnd, hitem) TreeView_GetNextItem(hwnd, hitem, TreeViewGetNextItem[:CHILD]) end",
"title": ""
},
{
"docid": "00e2045b0bd3fa1ef267590c075a11fa",
"score": "0.5499986",
"text": "def render\n @windows.each_value(&:render)\n end",
"title": ""
},
{
"docid": "5df7d32f4d55f468290371795f833905",
"score": "0.54906154",
"text": "def getChildren\n begin\n elementObject = waitForObject(@symbolicName, OBJECT_WAIT_TIMEOUT)\n children = Squish::Object.children(elementObject)\n return children\n rescue Exception => e\n\t Log.TestFail(\"#{self.class.name}::#{__method__}(): Failed to get children for #{@name}: #{e.message}\")\n return nil\n end\n end",
"title": ""
},
{
"docid": "0d764e66222eaab4c7ee36795b137bc2",
"score": "0.54897594",
"text": "def each(&blk)\n reset!\n window_list.each(&blk)\n end",
"title": ""
},
{
"docid": "0d764e66222eaab4c7ee36795b137bc2",
"score": "0.54897594",
"text": "def each(&blk)\n reset!\n window_list.each(&blk)\n end",
"title": ""
},
{
"docid": "af20c8fbb2fb8c9110f07a416db2f158",
"score": "0.5443985",
"text": "def nested_traverse(octrl, after, &eachblock)\n return if octrl == current_vc.ui || octrl == (@last_nested && @last_nested.last)\n ctrl = octrl\n begin\n saved = (ctrl.parent.children.to_a.find_all{|i| i != ctrl})\n saved.each &eachblock\n after.call(ctrl)\n ctrl = ctrl.parent\n end while ctrl != current_vc.ui && ctrl != (@last_nested && @last_nested.last)\n end",
"title": ""
},
{
"docid": "440f172509dc267100f74ad8fbdd0d44",
"score": "0.5442684",
"text": "def find_windows_pids(pid_json_path, recursion_limit = 6)\n pid_hash = ::JSON.parse(File.read(pid_json_path), symbolize_names: true)\n pid_array = []\n pid_array << pid_hash[:mongod_pid] if pid_hash[:mongod_pid]\n pid_array += pid_hash[:dj_pids] if pid_hash[:dj_pids]\n pid_array << pid_hash[:rails_pid] if pid_hash[:rails_pid]\n pid_list = pid_array.clone\n pid_str = `WMIC PROCESS get Caption,ProcessId,ParentProcessId`.split(\"\\n\\n\")\n pid_str.shift\n fully_recursed = false\n recursion_level = 0\n until fully_recursed\n recursion_level += 1\n prior_pid_list = pid_list\n pid_str.each do |p_desc|\n if pid_list.include? p_desc.gsub(/\\s+/, ' ').split(' ')[-2].to_i\n child_pid = p_desc.gsub(/\\s+/, ' ').split(' ')[-1].to_i\n pid_list << child_pid unless pid_list.include? child_pid\n end\n end\n fully_recursed = true if pid_list == prior_pid_list\n fully_recursed = true if recursion_level == recursion_limit\n end\n child_pids = pid_list - pid_array\n pid_hash[:child_pids] = child_pids\n ::File.open(pid_json_path, 'wb') { |f| f << ::JSON.pretty_generate(pid_hash) }\nend",
"title": ""
},
{
"docid": "55a57aeef446cbb9327288ed1cd3c27f",
"score": "0.54114956",
"text": "def _children\n @children\n end",
"title": ""
},
{
"docid": "b785cf4c77821ad4be86762c602efcc0",
"score": "0.54061115",
"text": "def each_child\n \n end",
"title": ""
},
{
"docid": "2950214e4c44df666e0a5de6fa1c6e67",
"score": "0.5403482",
"text": "def find_windows(container, found=[])\n if container['nodes']\n container['nodes'].each { |node| find_windows node, found }\n end\n\n if container['type'] == 'con' and container['name']\n found << [ container['id'], container['name'] ].join(' ')\n end\n\n found\nend",
"title": ""
},
{
"docid": "e45b2196683394733f6a0c0ea4d2e13e",
"score": "0.5391086",
"text": "def iterate root_child_itr\t\t\t#to iterate over the nodes\t\t\n\t \n\t ## Collect root_child_itr.children in a variable since it being used twice\n\t ## Can you try using some other conditional construct other than loop and break?\n\t\twhile true\n\t\t ###### Use an intuitive variable name\n\t\t\tchild = root_child_itr.children\n\t\t\t\n\t\t\t##### if temp.children[0]\n\t\t\tif child.children[0] == nil\t\t\t#checking if the node is innermost as innermost node will not be having any childnode\n\t\t\t\t@@arr.push child\n break\n\t\t\telse\n\t\t\t\tscan root_child_itr\t\t# iterate over the childnodes if it is not the parent of the innermost node\n break\n\t\t\tend\t\t\n\t\tend\n\tend",
"title": ""
},
{
"docid": "152e76131fba5b915981ca1a6de03d80",
"score": "0.5385008",
"text": "def children\n _children\n end",
"title": ""
},
{
"docid": "7b0d7df35e8294faed45284f56d865b9",
"score": "0.53734946",
"text": "def _children\n @children\n end",
"title": ""
},
{
"docid": "a896209cbf4aaedf9032fd8aff7371ba",
"score": "0.5363445",
"text": "def children\n @root.children & @initial_contents\n end",
"title": ""
},
{
"docid": "8104d4bec2a41beae087a49190388b64",
"score": "0.5354135",
"text": "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",
"title": ""
},
{
"docid": "c28965540e86ebf024184f09edf7bc6b",
"score": "0.53526247",
"text": "def get_children()\n return @space.get_children()\n end",
"title": ""
},
{
"docid": "0249644a55d1149ef9d9949e78261d72",
"score": "0.5304137",
"text": "def _children\n @children\n end",
"title": ""
},
{
"docid": "0249644a55d1149ef9d9949e78261d72",
"score": "0.5304137",
"text": "def _children\n @children\n end",
"title": ""
},
{
"docid": "0249644a55d1149ef9d9949e78261d72",
"score": "0.5304137",
"text": "def _children\n @children\n end",
"title": ""
},
{
"docid": "0249644a55d1149ef9d9949e78261d72",
"score": "0.5304137",
"text": "def _children\n @children\n end",
"title": ""
},
{
"docid": "d8de629574e9c2cab3440dfe54350f56",
"score": "0.5287046",
"text": "def children\n\t\treturn children_of @current_node\n\tend",
"title": ""
},
{
"docid": "88a7f25d87dc58891a2dbac522432c0d",
"score": "0.52820337",
"text": "def current_children\n children.map {|c| c.current }\n end",
"title": ""
},
{
"docid": "0b68b0227c6c3c44c728cc453f8b9196",
"score": "0.52764213",
"text": "def each\n @children.each {|child| yield child}\n end",
"title": ""
},
{
"docid": "0c2f8353f3a5dcff66d99a8d72f1b7dd",
"score": "0.5270692",
"text": "def children(options={})\n @global_page.children.all options\n end",
"title": ""
},
{
"docid": "6f91bf03e75ed3aa908ba3554e61b60f",
"score": "0.5259403",
"text": "def iterate_accessible_children\n # Allocate a pointer to LONG for the out param to give AccessibleChildren\n return_count = 0.chr * 4 \n # Allocate space for an array of VARIANTs. AccessibleChildren wilhttp://search.cpan.org/~pbwolf/Win32-ActAcc-1.1/http://search.cpan.org/~pbwolf/Win32-ActAcc-1.1/l\n # place one VARIANT (16 bytes) into each array element. Note that this\n # is a C array and not a Ruby array, so it will appear to be a single\n # binary string:\n child_variant_carray_buf = 0.chr * (16 * @childcount)\n #puts \"CHILDCOUNT IS '#{@childcount}' - allocated a 16*#{@childcount} byte Ruby string:\"\n #pp child_variant_carray_buf\n hr = AccessibleChildren.call(@iacc_ptr,\n 0,\n @childcount,\n child_variant_carray_buf,\n return_count) \n raise \"AccessibleChildren failed!\" if (hr != 0)\n\n #puts \"carray buffer before split:\"\n #pp child_variant_carray_buf\n\n return_count_unpacked = return_count.unpack('L').first\n #puts \"Return count was '#{return_count_unpacked}'\"\n\n # Split the packed buffer string into its individual VARIANTS, by using\n # map to get a Ruby array of 16-byte strings. If this is successful\n # then each string will be a single VARIANT.\n\n # Old Ruby 1.8.7 way of building the array of child variants: \n# child_variants = child_variant_carray_buf.scan(/.{16}/).map {|s| s}.flatten\n # NOTE: Interesting Ruby 1.9 fact - in 1.9, using scan with a regexp\n # on a string with packed binary data seems to always raise an exception.\n #\n # Instead split the packed string into an array of strings this way:\n child_variants = Array.new\n offset = 0\n return_count_unpacked.times do\n #puts \"at offset '#{offset}'\"\n child_variants << child_variant_carray_buf[offset, 16]\n offset += 16\n end\n\n #pp child_variants\n \n # Iterate over the children\n count = 1\n child_variants.each do |variant| \n #puts \"examining child variant #{count}\"\n count += 1\n # We could unpack the entire variant into an array like this:\n# vtchild = variant.unpack('SSSSLL')\n# vt = vtchild[0]\n # Or, we can just access the members one at a time like this:\n vt = variant[0,2].unpack('S').first\n\n # Skip if the variant's .vt is not VT_DISPATCH. This avoids trying to QI\n # any variants that do not contain an IDispatch/IAccessible object.\n if (vt != VT_DISPATCH)\n #puts(\"No IDispatch/IAccessible in this VARIANT...skipping it.\")\n next\n end\n # Get the IDispatch* value stored in the VARIANT's .pdispVal member.\n # This will be a Ruby Fixnum representing a memory address.\n pdispval_ptr = variant[8,4].unpack('L').first\n\n # We must get the QueryInterface function ptr of the IDispatch object,\n # so we can QI the IAccessible interface of the IDispatch. Perhaps\n # there's some more graceful way to handle this; maybe make it a method?\n #\n # IDispatch contains 7 functions, so we need 7 blocks of 4 bytes for\n # each function's address:\n child_vtbl_ptr = 0.chr * 4\n child_vtbl = 0.chr * (4 * 7)\n memcpy(child_vtbl_ptr, pdispval_ptr, 4)\n memcpy(child_vtbl, child_vtbl_ptr.unpack('L').first, 4 * 7)\n child_vtbl = child_vtbl.unpack('L*')\n queryInterface = Win32::API::Function.new(child_vtbl[0], 'PPP', 'L')\n # Get the IAccessible of the IDispatch\n child_iacc = 0.chr * 4\n hr = queryInterface.call(pdispval_ptr, IID_IAccessible, child_iacc)\n raise \"QueryInterface of child element failed!\" if (hr != S_OK)\n\n child = AccessibleObject.new(:iacc, child_iacc)\n\n #puts \"Child name is: '#{child.name}'\"\n\n if block_given?\n yield child\n end\n\n # FIXME - whether a match is found or not, we need to release/free all\n # unneeded child objects and BSTRs created during the search...\n end\n end",
"title": ""
},
{
"docid": "60a2a2439ff11b54f87f9976285b46c5",
"score": "0.5252536",
"text": "def children\n self.class.children(self) \n end",
"title": ""
},
{
"docid": "6b65745f40752ebef04d57b9545349bd",
"score": "0.5222714",
"text": "def children\n entries\n end",
"title": ""
},
{
"docid": "3df5fa0e5def502cd586a117239b6015",
"score": "0.51843935",
"text": "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",
"title": ""
},
{
"docid": "a778dc23d877d41df4eb220f11d1ee52",
"score": "0.51778483",
"text": "def each_child_page\n return if leaf?\n\n return enum_for(:each_child_page) unless block_given?\n\n each_record do |rec|\n yield rec.child_page_number, rec.key\n end\n\n nil\n end",
"title": ""
},
{
"docid": "2417b93666b3f5fbf0e92141234328c9",
"score": "0.51712745",
"text": "def TreeView_SortChildren(hwnd, hitem, recurse)\r\n send_treeview_message(hwnd, :SORTCHILDREN, wparam: recurse, lparam: hitem)\r\n end",
"title": ""
},
{
"docid": "be9b11e93c17c82ff64cf6be1205ca96",
"score": "0.51647884",
"text": "def each\n @children.each { |child| yield child }\n end",
"title": ""
},
{
"docid": "e6038ea89b31d90177f4833ad9e12ebf",
"score": "0.5154431",
"text": "def TreeView_SortChildrenCB(hwnd, psort, recurse)\r\n send_treeview_message(hwnd, :SORTCHILDRENCB, wparam: recurse, lparam: psort)\r\n end",
"title": ""
},
{
"docid": "be5675215ab5940fd4ce20de6504770d",
"score": "0.51535064",
"text": "def each\n yield self\n children.each {|c| c.each {|n| yield n}}\n end",
"title": ""
},
{
"docid": "0cd1cae68163c6a3fab35343af4ff5e5",
"score": "0.51515806",
"text": "def content_windows\n content = {\n score_window: Curses::Window.new(4, 14, 4, 3),\n lvl_window: Curses::Window.new(3, 5, 11, 3),\n lines_window: Curses::Window.new(3, 7, 11, 10),\n highscores_window: Curses::Window.new(24, 14, 17, 3),\n tetris_window: Curses::Window.new(40, 20, 4, 20),\n next_window: Curses::Window.new(10, 14, 4, 43)\n }\n\n content.each do |_name, window|\n window.noutrefresh\n end\n content\nend",
"title": ""
},
{
"docid": "57e4a6b2036221710217721139ff4b25",
"score": "0.5151279",
"text": "def getObjectChildren _obj, _args\n \"_obj getObjectChildren _args;\" \n end",
"title": ""
},
{
"docid": "701a2337c150098c264222993eb87a71",
"score": "0.51493603",
"text": "def children=(_arg0); end",
"title": ""
},
{
"docid": "701a2337c150098c264222993eb87a71",
"score": "0.51493603",
"text": "def children=(_arg0); end",
"title": ""
},
{
"docid": "0b7f7f62ae4d027851d78a4dbbf4411e",
"score": "0.5139407",
"text": "def children; end",
"title": ""
},
{
"docid": "0b7f7f62ae4d027851d78a4dbbf4411e",
"score": "0.5139407",
"text": "def children; end",
"title": ""
},
{
"docid": "0b7f7f62ae4d027851d78a4dbbf4411e",
"score": "0.5139407",
"text": "def children; end",
"title": ""
},
{
"docid": "0b7f7f62ae4d027851d78a4dbbf4411e",
"score": "0.5139407",
"text": "def children; end",
"title": ""
},
{
"docid": "0b7f7f62ae4d027851d78a4dbbf4411e",
"score": "0.5139407",
"text": "def children; end",
"title": ""
},
{
"docid": "0b7f7f62ae4d027851d78a4dbbf4411e",
"score": "0.5139407",
"text": "def children; end",
"title": ""
},
{
"docid": "0b7f7f62ae4d027851d78a4dbbf4411e",
"score": "0.5139407",
"text": "def children; end",
"title": ""
},
{
"docid": "0b7f7f62ae4d027851d78a4dbbf4411e",
"score": "0.5139407",
"text": "def children; end",
"title": ""
},
{
"docid": "0b7f7f62ae4d027851d78a4dbbf4411e",
"score": "0.5139407",
"text": "def children; end",
"title": ""
},
{
"docid": "0b7f7f62ae4d027851d78a4dbbf4411e",
"score": "0.5139407",
"text": "def children; end",
"title": ""
},
{
"docid": "0b7f7f62ae4d027851d78a4dbbf4411e",
"score": "0.5139407",
"text": "def children; end",
"title": ""
},
{
"docid": "0b7f7f62ae4d027851d78a4dbbf4411e",
"score": "0.5139407",
"text": "def children; end",
"title": ""
},
{
"docid": "7450b0217eedf28b0cde418fa4235eda",
"score": "0.5134128",
"text": "def get_window_area()\n get_children_area(\"WINDOW\")\n end",
"title": ""
},
{
"docid": "113dd3de5db2d964f43793e5385e3bfe",
"score": "0.51234263",
"text": "def children\n res = []\n @board.rows.each_with_index do |row, x|\n row.each_with_index { |item, y| res << [x,y] }\n end\n res\n end",
"title": ""
},
{
"docid": "af419d45ae5417f1cfe68ece41452167",
"score": "0.5119396",
"text": "def get_children(args)\n args = {:path => args} unless args.is_a?(Hash)\n assert_supported_keys(args, [:path, :watcher, :watcher_context, :callback, :context])\n assert_required_keys(args, [:path])\n\n if args[:callback] ## asynchronous\n raise KeeperException::BadArguments unless args[:callback].kind_of?(StringsCallback)\n #puts \"\\n---------- calling zoo_awget_children -------\"\n #puts \"@zk_handle is #{@zk_handle.inspect}\"\n #puts \"args[:path] is #{args[:path].inspect}\"\n #puts \"args[:watcher] is #{args[:watcher].inspect}\"\n #puts \"args[:watcher_context] is #{args[:watcher_context].inspect}\"\n #puts \"args[:callback] is #{args[:callback].inspect}\"\n #puts \"args[:callback].proc is #{args[:callback].proc.inspect}\"\n #puts \"args[:context] is #{args[:context].inspect}\"\n #puts \"----------\"\n return zoo_awget_children(@zk_handle, args[:path], args[:watcher], YAML.dump(args[:watcher_context]), args[:callback].proc, YAML.dump(args[:context]))\n end\n\n ## synchronous\n str_v = StringVector.new(FFI::MemoryPointer.new(StringVector))\n rc = zoo_wget_children(@zk_handle, args[:path], args[:watcher], YAML.dump(args[:watcher_context]), str_v)\n children = str_v[:data].read_array_of_pointer(str_v[:count]).map do |s|\n s.read_string\n end\n raise KeeperException.by_code(rc), ZooKeeperFFI::zerror(rc) unless rc == ZOK\n return children\n end",
"title": ""
},
{
"docid": "8190e61cceec8d03434dde51d0d236d4",
"score": "0.51186246",
"text": "def children\n @sandboxes.keys\n end",
"title": ""
},
{
"docid": "7a33d508286cba8ee66543677d4b52e0",
"score": "0.51097727",
"text": "def children(*args)\n self.class.send(:with_scope, :find=>{:conditions=>['parent_node_id=?', self.child_node_id]}) do\n self.class.find(:all, *args)\n end\n end",
"title": ""
},
{
"docid": "9d1fa12571e83d543e34236522fa1002",
"score": "0.5108716",
"text": "def children\n# debugger\n open_positions = []\n children = []\n @board.rows.each_index do |i|\n (0..2).each do |j|\n open_positions << [i, j] if @board.rows[i][j] == nil\n end\n end\n open_positions.each do |pos|\n new_board = @board.rows.dup\n child_board = Board.new(new_board)\n child_board[pos] = next_mover_mark\n new_mark = next_mover_mark\n new_mark == :x ? new_mark = :o : new_mark = :x\n children << TicTacToeNode.new(new_board, new_mark, prev_move_pos =)\n end\n return children \n end",
"title": ""
},
{
"docid": "766d603ab00bf5ed4a559cc17ddefd4e",
"score": "0.5106843",
"text": "def each_child\n @children.each { |child| yield child }\n end",
"title": ""
},
{
"docid": "e723b3357754e73e787416549d1fef97",
"score": "0.5103253",
"text": "def firefox_windows(w = nil)\n\t\t\tcollection = []\n\t\t\twindows = nil\n\t\t\tif w\n\t\t\t\twindows = [w]\n\t\t\telse\n\t\t\t\twindows = X11::Display.instance.screens.collect{|s| s.root_window}\n\t\t\tend\n\t\t\twindows.each do |window|\n\t\t\t\tif window.class == 'Gecko'\n\t\t\t\t\tcollection << window\n\t\t\t\tend\n\t\t\t\twindow.children.each do |c|\n\t\t\t\t\tcollection << firefox_windows(c)\n\t\t\t\tend\n\t\t\tend\n\t\t\treturn collection.flatten.compact\n\t\tend",
"title": ""
},
{
"docid": "bcd0296ac9b8eaafb55159c059b8ff4d",
"score": "0.5097483",
"text": "def find_child( window_handle, id, search_class = true )\n\n\t\t\tmatching_child = 0\n\n\t\t\t@log.debug(\"Searching for child #{id} in children of handle #{window_handle}\")\n\n\t\t\tenum_proc = Win32::API::Callback.new('L', 'I'){ |winHandle|\n\t\t\t\t@log.debug(\"Child #{winHandle}\")\n\n\t\t\t\tclass_name = ''\n\t\t\t\t# Look for a match on the text or class of the \n\t\t\t\t# child control.\n\t\t\t\tbuffer = \"\\0\" * 1024\n\n\t\t\t\t# length = get_window_text(winHandle, buffer, buffer.length)\n\t\t\t\t\n\t\t\t\tlength = send_with_buffer(winHandle, WM_GETTEXT, buffer.length, buffer)\n\t\t\t\ttext = (length == 0) ? '' : buffer[0..length -1]\n\n\t\t\t\t\n\t\t\t\tif (id.gsub('_', '&').downcase == text.downcase)\n\t\t\t\t\t# The control text matches\n\t\t\t\t\t@log.debug(\" MATCHED on text: #{text}\")\n\t\t\t\t\tmatching_child = winHandle\n\t\t\t\telsif (search_class)\n\t\t\t\t\tbuffer = \"\\0\" * 1024\n\t\t\t\t\tlength = get_class_name winHandle, buffer, buffer.length\n\t\t\t\t\tclass_name = (length == 0) ? '' : buffer[0..length -1]\n\t\t\t\t\t\n\t\t\t\t\tif (id == class_name)\n\t\t\t\t\t\t@log.debug(\" MATCHED on class: #{class_name}\")\n\t\t\t\t\t\t# The control class matches\n\t\t\t\t\t\tmatching_child = winHandle\n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\t\t@log.debug(\" No match, text: #{text}, class: #{class_name}\") if (matching_child == 0)\n\t\t\t\t\n\t\t\t\t(matching_child == 0)\n\t\t\t}\n\t\t\t\n\t\t\t@@EnumChildWindows.call(window_handle, enum_proc, nil)\n\t\t\t@log.debug(\"Enumeration complete, matching_child=#{matching_child}\")\n\n\t\t\tmatching_child\n\t\tend",
"title": ""
},
{
"docid": "0fbd03293052fa5ea7d5fd3fe3b90cc0",
"score": "0.5094009",
"text": "def find_parent_process_with_hwnd pid\n while hwnd=pid_to_hwnd[pid].nil?\n pid = find_parent_pid(pid)\n return nil unless pid\n end\n return [pid,hwnd]\n end",
"title": ""
},
{
"docid": "8ad37bf27e989aa2d6a2b4c68f4b8d3b",
"score": "0.5092964",
"text": "def children\n rows\n end",
"title": ""
},
{
"docid": "db8e8821eb5bf15df6153056786db8bc",
"score": "0.5075894",
"text": "def children()\r\n raise \"get_children is not implemented for class #{self.class}\"\r\n end",
"title": ""
},
{
"docid": "eb586db20201fdc8ad0745064b41509c",
"score": "0.50749",
"text": "def get_window_area()\n get_children_area(\"WINDOW\")\n end",
"title": ""
},
{
"docid": "3264296d0a608992cdee8ced645e3d13",
"score": "0.506545",
"text": "def collect_visible_windows\n scene = SceneManager.scene\n scene.instance_variables.collect do |varname|\n scene.instance_variable_get(varname)\n end.select do |ivar|\n ivar.is_a?(Window) && !ivar.disposed? && ivar.visible\n end\n end",
"title": ""
},
{
"docid": "0a1d784aaf39d7e28bc1ddf40dc1fcfb",
"score": "0.50608987",
"text": "def children\n out_edges.each{|e| e.dest}\n end",
"title": ""
},
{
"docid": "f2b28e0853908e7f483a23559f0dc935",
"score": "0.50604993",
"text": "def get_children\n return children\n end",
"title": ""
},
{
"docid": "a560df37354365da18d042b96279be43",
"score": "0.50496215",
"text": "def window_handle; end",
"title": ""
},
{
"docid": "be0861c14b1b2d123a42004af44a7979",
"score": "0.5042017",
"text": "def each(&block)\n yield self\n children.each {|c| c.each(&block)}\n end",
"title": ""
},
{
"docid": "144cb8a0df9ea1fe128cfc828842f236",
"score": "0.5040485",
"text": "def process_self_and_descendants\n yield self\n descendants.each { |item| yield(item) }\n end",
"title": ""
},
{
"docid": "199de37aa45535ca819ace508a309b18",
"score": "0.50360984",
"text": "def children\n EarLogger.instance.log \"Finding children for #{self}\"\n ObjectManager.instance.find_children(self.id, self.class.to_s)\n end",
"title": ""
},
{
"docid": "cc71fe14c85f2854c3fde07bcc2a59ac",
"score": "0.50255716",
"text": "def all_children\n children(all: true)\n end",
"title": ""
},
{
"docid": "ebc13110b657e3f61c97b0cc5070c8af",
"score": "0.5022489",
"text": "def windows\n @driver.getWindowList.map do |java_window|\n QuickWindow.new(self,java_window)\n end.to_a\n end",
"title": ""
},
{
"docid": "086631a8d2daa1d348abfb221e3d917d",
"score": "0.5021759",
"text": "def children\n\t\treturn self.search( :one, '(objectClass=*)' )\n\tend",
"title": ""
},
{
"docid": "2b32b6f0621a1e604623a5b4140e1767",
"score": "0.50201035",
"text": "def get_children(pi)\n response = Net::HTTP.get_response URI.parse(URI.escape(SERVICE_DCMDB + \"work/\" + pi + \"/children\"))\n children = Array.new\n case response\n when Net::HTTPSuccess\n doc = Document.new(response.body)\n XPath.each(doc, \"//workpid\") { |el|\n children.push(el.text)\n } \n end\n\n return children\n\n end",
"title": ""
},
{
"docid": "884f6705d09ebe11690df9bf542b6046",
"score": "0.50165445",
"text": "def each_child(&_block)\n @children.each { |child| yield child }\n end",
"title": ""
},
{
"docid": "956e49d52d9da253ae2fefa5d3608709",
"score": "0.50119966",
"text": "def each_child\n @children.each { |child| yield child }\n end",
"title": ""
},
{
"docid": "00fc44a95e7de3bb33eefb36b9c40b18",
"score": "0.5001382",
"text": "def all_children\n return @all_children if !@all_children.nil?\n @all_children = PhotoCollection.all_urls.find_all{|url| url[self.url] && url != self.url}.collect{|url| PhotoCollection.find_by_url(url)}\n end",
"title": ""
},
{
"docid": "40d633a2f9d83239590c6d22d8de2689",
"score": "0.49951634",
"text": "def children\n out = [] \n (0..2).each do |row|\n (0..2).each do |col|\n pos = [row, col]\n out << next_move_node(pos) if @board.empty?(pos)\n end\n end\n out\n end",
"title": ""
},
{
"docid": "9f5713baa08cfdd88afb0aed0cd90e5f",
"score": "0.4994064",
"text": "def children\n children_nodes = Array.new\n i = 0\n while i < self.board.rows.length\n j = 0\n while j < self.board.rows.length\n if self.board.empty?([i,j])\n duped_board = self.board.dup\n duped_board.[]=([i,j],self.next_mover_mark) \n duped_node = self.class.new(duped_board,self.alternate_mark,[i,j])\n children_nodes << duped_node\n end\n j += 1\n end\n i += 1\n end\n return children_nodes\n end",
"title": ""
},
{
"docid": "59f0fc8c595a32590fb150bb2b4a6686",
"score": "0.49903888",
"text": "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",
"title": ""
},
{
"docid": "d312a267f068bda631ffb7f7841e7728",
"score": "0.49857682",
"text": "def get_children\n \t@children\n end",
"title": ""
},
{
"docid": "1b974508ea9d28752323dc82d1653a51",
"score": "0.498512",
"text": "def each_containment(&block)\n @nodes.values.sort.each do |node|\n if node.parent\n block.call node.parent, node\n end\n end\n end",
"title": ""
},
{
"docid": "a8cc4d3b5729a99ebe363f78fd9f4523",
"score": "0.4979624",
"text": "def children\n return @children if !@children.nil?\n @children = all_children.find_all{|collection| collection.url.count('/') == self.url.count('/') + 1}\n end",
"title": ""
},
{
"docid": "e02f7fc4fcf0e79d25495eca4c5015f7",
"score": "0.4974835",
"text": "def children_of(wrd)\n self['head', wrd]\n end",
"title": ""
},
{
"docid": "caff0eb8054613c969a40c3cc5b4af22",
"score": "0.49734363",
"text": "def children\n elements = []\n\n %x{\n var children = #@native.children;\n for(var i = 0; i < children.length; i++) {\n elements[i] = #{Element.new(`children[i]`)};\n }\n }\n\n elements\n end",
"title": ""
},
{
"docid": "3e130ad546a873d8b4c92066e288231a",
"score": "0.49571753",
"text": "def each_child(&block) # :yields: child_node\n children.each(&block)\n nil\n end",
"title": ""
},
{
"docid": "3754addc629fbc2463c3ae4a890e22de",
"score": "0.49562687",
"text": "def children\n return @children unless @children.nil?\n @children = if exists? && directory?\n Dir.glob( File.join(absolute_path,'*') ).sort.map do |entry|\n git_flow_repo.working_file(\n entry.gsub( /^#{Regexp.escape absolute_path}/, tree )\n )\n end\n else\n false\n end\n end",
"title": ""
},
{
"docid": "2e4ed57dcc5d9838633f2238eeadae26",
"score": "0.4951819",
"text": "def children\n children_tree.values\n end",
"title": ""
},
{
"docid": "2e4ed57dcc5d9838633f2238eeadae26",
"score": "0.4951819",
"text": "def children\n children_tree.values\n end",
"title": ""
},
{
"docid": "2e28590e7a88ca6fc40015995e237234",
"score": "0.49498102",
"text": "def traverse_down(&block)\n block.call(self)\n if(!children.nil?)\n children.each{ |child| child.traverse_down(&block) }\n end\n end",
"title": ""
},
{
"docid": "76baa109d55383a1511bec629092e428",
"score": "0.49490803",
"text": "def visit_all(&block)\n visit &block\n children.each {|c| c.visit_all &block}\n end",
"title": ""
},
{
"docid": "69b1666cb0eadd9ee272d3b0111de6f3",
"score": "0.49344125",
"text": "def children\n children = []\n board.rows.each_index do |row|\n board.rows[row].each_index do |col|\n pos = [row, col]\n if board[pos].nil?\n new_board = board.dup\n new_board[pos] = next_mover_mark\n children << self.class.new(new_board, switch_mark(next_mover_mark), pos)\n end\n end\n end\n children\n end",
"title": ""
}
] |
72e73628e34a6d783e0d9954c9cbdde7
|
Returns true if the object is the same object, or is a string and has the same content.
|
[
{
"docid": "437e7df55a7b72362c9c2b337a4a9924",
"score": "0.0",
"text": "def ==(other)\n (other.equal?(self)) ||\n # This option should be deprecated\n (other.is_a?(String) && other == self.to_s) ||\n (other.is_a?(Answer) && other.to_s == self.to_s)\n end",
"title": ""
}
] |
[
{
"docid": "a470634e61ba2fe4a1eb30700f9b26a7",
"score": "0.70243996",
"text": "def equal?(other)\n return false unless other.is_a?(self.class)\n are_identical = false\n if self.title == other.title\n begin\n obj_id = self.object_id.to_s\n self.title += obj_id\n are_identical = (self.title == other.title)\n ensure\n self.title.sub(/#{obj_id}$/,'')\n end\n are_identical\n else\n false\n end\n end",
"title": ""
},
{
"docid": "3628424859c4a9833de4cd988b35d567",
"score": "0.6962117",
"text": "def eql?(other)\n return false unless super(other)\n return false unless attributes == other.attributes\n return false unless content == other.content\n\n true\n end",
"title": ""
},
{
"docid": "43a12c7985f860cd300625e46fd4117d",
"score": "0.6932606",
"text": "def eql?(obj_)\n if obj_.kind_of?(::String)\n obj_ = @_format.parse(obj_) rescue nil\n end\n return false unless obj_.kind_of?(Value)\n index_ = 0\n obj_.each_field_object do |field_, value_|\n return false if field_ != @_field_path[index_] || value_ != @_values[field_.name]\n index_ += 1\n end\n true\n end",
"title": ""
},
{
"docid": "ebb6792c83d158b8a99c2d5140f90819",
"score": "0.6888117",
"text": "def objects_equal?(other)\n other.is_a?(Linkage::MetaObject) && other.object == self.object\n end",
"title": ""
},
{
"docid": "81d5512e66dfeb7e22268dbcd2041b34",
"score": "0.688578",
"text": "def ==(o)\n self.text == o.text && self.type == o.type\n end",
"title": ""
},
{
"docid": "81d5512e66dfeb7e22268dbcd2041b34",
"score": "0.688578",
"text": "def ==(o)\n self.text == o.text && self.type == o.type\n end",
"title": ""
},
{
"docid": "4fc6017695d50c217c8cdee8c433ec0b",
"score": "0.68788546",
"text": "def eql?(o)\n self.class == o.class && string == o.string && file == o.file && line_index == o.line_index\n end",
"title": ""
},
{
"docid": "29d0930ec0a31bd7a3d87da4d9285e76",
"score": "0.68783593",
"text": "def eql?(object)\n self.class.equal?(object.class) && attributes == object.attributes\n end",
"title": ""
},
{
"docid": "c6ad7b2a88dcf34bda8ac990de87441a",
"score": "0.6877473",
"text": "def eql?(obj)\n return false unless obj.is_a?(self.class)\n fields.each do |tag, _|\n if value_for_tag?(tag)\n return false unless (obj.value_for_tag?(tag) && value_for_tag(tag).eql?(obj.value_for_tag(tag)))\n else\n return false if obj.value_for_tag?(tag)\n end\n end\n return true\n end",
"title": ""
},
{
"docid": "f842f9b6aa5a51ee230e5f2b1f93ac86",
"score": "0.6874982",
"text": "def eql?(other)\n if (astVal.class == CTObject)\n data = Marshal.dump(astVal.rawObject)\n dataOther = Marshal.dump(other.astVal.rawObject)\n return data.eql?(dataOther)\n elsif(astVal.class == PartialObject && self.name != Helpers.selfIdentifier)\n #check only the compile time vars in the store of the partial object.\n astVal.store.eql?(other.astVal.store)\n else\n true\n end\n end",
"title": ""
},
{
"docid": "dc6987a0e10c4c000561f41411da48b4",
"score": "0.68661076",
"text": "def ==(other)\n return false if self.class != other.class\n\n @content == other.content\n end",
"title": ""
},
{
"docid": "7f8c1e7cd434a2ce9d116fc50968ceae",
"score": "0.68368596",
"text": "def eql?(o)\n to_s.eql?(o.to_s)\n end",
"title": ""
},
{
"docid": "3cc61304069491f854e18f344c7757db",
"score": "0.6827965",
"text": "def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n prefix == o.prefix &&\n postfix == o.postfix &&\n snippet_count == o.snippet_count &&\n fragment_size == o.fragment_size &&\n max_analyzed_chars == o.max_analyzed_chars &&\n merge_contiguous == o.merge_contiguous &&\n use_phrase_highlighter == o.use_phrase_highlighter &&\n fields == o.fields\n end",
"title": ""
},
{
"docid": "14a2f47eb4c2508d84231e5e18901ea3",
"score": "0.6802186",
"text": "def ==(obj)\n self.to_s == obj.to_s\n end",
"title": ""
},
{
"docid": "12c40fe6a12e381673c442631aa555f7",
"score": "0.67782015",
"text": "def ==(obj)\n obj == text\n end",
"title": ""
},
{
"docid": "954858c0d768c2fffbd99a2c025f7f27",
"score": "0.6769897",
"text": "def ==(obj)\n to_s == obj.to_s\n end",
"title": ""
},
{
"docid": "fdb4606f4fdd0473c52d820033fefaf0",
"score": "0.6759732",
"text": "def same_type(obj_one, obj_two)\n\n if obj_one.class == obj_two.class\n return true\n else\n return false\n end\n\nend",
"title": ""
},
{
"docid": "b0fbe0499e9430c118dc6f429ee9bdf9",
"score": "0.66952133",
"text": "def ==(something)\n something.class == self.class &&\n something.to_str == self.to_str\n end",
"title": ""
},
{
"docid": "eb176fb89bf1196a85c04c83db0b8457",
"score": "0.6689748",
"text": "def == other\n\t\tstring == other.string\n\tend",
"title": ""
},
{
"docid": "63233385307eb8fdb4bf1017223b815d",
"score": "0.6687183",
"text": "def look_same_as?(other)\n return nil unless other.kind_of?(self.class)\n (name == other.name) and (definition == other.definition)\n end",
"title": ""
},
{
"docid": "ecf67b0106d51efde05b4dd044176fe3",
"score": "0.6666868",
"text": "def ===(other)\n return true if super\n return (self == other.content_class) if other.respond_to?(:content_class)\n false\n end",
"title": ""
},
{
"docid": "1ab44e68071010bfaaf49ace20d42f44",
"score": "0.665402",
"text": "def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n text == o.text &&\n row_span == o.row_span &&\n col_span == o.col_span &&\n margin_top == o.margin_top &&\n margin_right == o.margin_right &&\n margin_left == o.margin_left &&\n margin_bottom == o.margin_bottom &&\n text_anchor_type == o.text_anchor_type &&\n text_vertical_type == o.text_vertical_type &&\n fill_format == o.fill_format &&\n border_top == o.border_top &&\n border_right == o.border_right &&\n border_left == o.border_left &&\n border_bottom == o.border_bottom &&\n border_diagonal_up == o.border_diagonal_up &&\n border_diagonal_down == o.border_diagonal_down &&\n column_index == o.column_index &&\n row_index == o.row_index &&\n text_frame_format == o.text_frame_format &&\n paragraphs == o.paragraphs\n end",
"title": ""
},
{
"docid": "dc483f9925007d7843103566b89ef6d7",
"score": "0.66326356",
"text": "def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n author == o.author &&\n text == o.text &&\n created_time == o.created_time &&\n child_comments == o.child_comments &&\n type == o.type &&\n text_selection_start == o.text_selection_start &&\n text_selection_length == o.text_selection_length &&\n status == o.status\n end",
"title": ""
},
{
"docid": "23fba69bfc37d8acf35336f1b982a1be",
"score": "0.66048354",
"text": "def ==(other)\n super(other) && content == (other.respond(:content) || other)\n end",
"title": ""
},
{
"docid": "3dcbbebb791888d607f75f12425247b1",
"score": "0.6596207",
"text": "def eql?(other)\n type == other.to_s\n end",
"title": ""
},
{
"docid": "465a9cf6e7cd88943d92f1b584382539",
"score": "0.6575813",
"text": "def eql?(obj)\n self == obj\n end",
"title": ""
},
{
"docid": "8c35c90eec883e241e23fe444bf3838c",
"score": "0.6556069",
"text": "def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n class_id == o.class_id &&\n object_type == o.object_type &&\n msg_type == o.msg_type &&\n path == o.path &&\n stream == o.stream\n end",
"title": ""
},
{
"docid": "bfe6ef175b63f6145f6d0f10c4ac06d2",
"score": "0.65416425",
"text": "def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n background_color == o.background_color &&\n content == o.content &&\n font_size == o.font_size &&\n has_padding == o.has_padding &&\n show_tick == o.show_tick &&\n text_align == o.text_align &&\n tick_edge == o.tick_edge &&\n tick_pos == o.tick_pos &&\n type == o.type &&\n vertical_align == o.vertical_align\n end",
"title": ""
},
{
"docid": "ece3d79e1251736d218669cbb394d90e",
"score": "0.65065926",
"text": "def == other\n string == other.string\n end",
"title": ""
},
{
"docid": "927a59bcba7b91677144e8cd59a20b6e",
"score": "0.6504712",
"text": "def ==(obj)\n return false unless obj.is_a?(self.class)\n fields.each do |tag, _|\n if value_for_tag?(tag)\n return false unless (obj.value_for_tag?(tag) && value_for_tag(tag) == obj.value_for_tag(tag))\n else\n return false if obj.value_for_tag?(tag)\n end\n end\n return true\n end",
"title": ""
},
{
"docid": "1ae05620e9ea720e23962fff2d1d33b3",
"score": "0.64788234",
"text": "def ==(object)\n return false unless object.is_a?(self.class)\n \n self.identifiers == object.identifiers and self.title == object.title and self.journal_title == object.journal_title and\n self.book_title == object.book_title and self.article_title == object.article_title\n end",
"title": ""
},
{
"docid": "274946c89fefe5bcf707b4144bcfacab",
"score": "0.64698863",
"text": "def eql?(other)\n other.is_a?(String) ? text == other : super\n end",
"title": ""
},
{
"docid": "e3a8318a7e649fcc1a086d478c4ca930",
"score": "0.64686257",
"text": "def eql?(o)\n self.class == o.class &&\n name.downcase == o.name.downcase\n end",
"title": ""
},
{
"docid": "0de410762ed28965c4e54b7f12bda958",
"score": "0.64646333",
"text": "def ==(something)\n something.class == self.class &&\n something.to_s == self.to_s\n end",
"title": ""
},
{
"docid": "1021e9ef2c874412d4fb4a688a74023a",
"score": "0.6451981",
"text": "def eql?(other)\n to_s == other.to_s\n end",
"title": ""
},
{
"docid": "41ee56ff7d8b9763fb280521b803eafe",
"score": "0.64278585",
"text": "def ==(other)\n String.new(self) == other or super\n end",
"title": ""
},
{
"docid": "e35f5b0f3a9e9e6cdbc67f28894bcf0a",
"score": "0.64262766",
"text": "def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n class_id == o.class_id &&\n object_type == o.object_type &&\n description == o.description &&\n name == o.name &&\n type == o.type &&\n system == o.system\n end",
"title": ""
},
{
"docid": "ecddd2b3b2486f2d970aca3f63ac89a2",
"score": "0.6422805",
"text": "def ==(o)\n to_s == o.to_s\n end",
"title": ""
},
{
"docid": "f210b6589b67fc4dd2065be8a64142e4",
"score": "0.63957995",
"text": "def eql?(other)\n self.class == other.class && self == other\n end",
"title": ""
},
{
"docid": "6ee6e7155f05c1b922ac152823499b3c",
"score": "0.63871455",
"text": "def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n custom_headers == o.custom_headers &&\n encode_as == o.encode_as &&\n name == o.name &&\n payload == o.payload &&\n url == o.url\n end",
"title": ""
},
{
"docid": "0fc2670dba0a7325e732b2de9e4dc8f7",
"score": "0.6384217",
"text": "def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n self_uri == o.self_uri &&\n alternate_links == o.alternate_links &&\n index == o.index &&\n orientation == o.orientation &&\n size == o.size &&\n type == o.type &&\n shape == o.shape\n end",
"title": ""
},
{
"docid": "f218841c20663ca6f71bdbeb32d2d948",
"score": "0.6354812",
"text": "def eql?(other)\n self.class == other.class && self == other\n end",
"title": ""
},
{
"docid": "f218841c20663ca6f71bdbeb32d2d948",
"score": "0.6354812",
"text": "def eql?(other)\n self.class == other.class && self == other\n end",
"title": ""
},
{
"docid": "f218841c20663ca6f71bdbeb32d2d948",
"score": "0.6354812",
"text": "def eql?(other)\n self.class == other.class && self == other\n end",
"title": ""
},
{
"docid": "f218841c20663ca6f71bdbeb32d2d948",
"score": "0.6354812",
"text": "def eql?(other)\n self.class == other.class && self == other\n end",
"title": ""
},
{
"docid": "ae77acc6a78bb7b5bc443808b8429d91",
"score": "0.6343559",
"text": "def ===(object)\n object.is_a?(self)\n end",
"title": ""
},
{
"docid": "4426563602379e62097d6cbce7b02640",
"score": "0.6342434",
"text": "def eql?(other)\n self.class == other.class and self == other\n end",
"title": ""
},
{
"docid": "e0c302e5469d9db6005e4e9c6003ef48",
"score": "0.6341012",
"text": "def eql?(other)\n self.class == other.class && name == other.name\n end",
"title": ""
},
{
"docid": "6e827c89e188c5ed5734cce5e4d14a15",
"score": "0.6326103",
"text": "def ===(other)\n return to_str === other.to_str if other.respond_to?(:to_str)\n super\n end",
"title": ""
},
{
"docid": "0df6a8b84a7d2aa78fa7e6e13dcfd335",
"score": "0.6326065",
"text": "def equal?(other)\n object_id == other.object_id\n end",
"title": ""
},
{
"docid": "f00be92622257c19b4d0c23df4ac8d24",
"score": "0.63109404",
"text": "def similar_to?(other)\n self.composition == other.composition\n end",
"title": ""
},
{
"docid": "2ed64730caf13d0fe88b3cca325c5843",
"score": "0.63103354",
"text": "def ==(other)\n return true if self.equal?(other)\n self.class == other.class &&\n text == other.text &&\n font_name == other.font_name &&\n font_size == other.font_size &&\n bold == other.bold &&\n italic == other.italic &&\n color == other.color &&\n width == other.width &&\n height == other.height &&\n top == other.top &&\n left == other.left &&\n rotation_angle == other.rotation_angle &&\n transparency == other.transparency &&\n background == other.background &&\n image == other.image &&\n auto_align == other.auto_align\n end",
"title": ""
},
{
"docid": "f520fc081b2e2a3cd60a5907c4de4633",
"score": "0.630957",
"text": "def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n _hash == o._hash &&\n name == o.name &&\n owner == o.owner\n end",
"title": ""
},
{
"docid": "fa78b09e4f40f96c48becf08b7e5f596",
"score": "0.629998",
"text": "def ==(other_element)\n if other_element.type == type && other_element.content == content\n return true\n end\n return false\n end",
"title": ""
},
{
"docid": "6084e52541a0e50d2177c46d1f947118",
"score": "0.6299378",
"text": "def ==(other)\n if other.class == String\n self.decoded == other\n else\n super\n end\n end",
"title": ""
},
{
"docid": "2328fdf30d6925f3f331b03ac14b46e3",
"score": "0.6291095",
"text": "def == other\n to_s == other.to_s\n end",
"title": ""
},
{
"docid": "c6583c770e0bae9b145829283447a82b",
"score": "0.6289836",
"text": "def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n three_d_format == o.three_d_format &&\n transform == o.transform &&\n margin_left == o.margin_left &&\n margin_right == o.margin_right &&\n margin_top == o.margin_top &&\n margin_bottom == o.margin_bottom &&\n wrap_text == o.wrap_text &&\n anchoring_type == o.anchoring_type &&\n center_text == o.center_text &&\n text_vertical_type == o.text_vertical_type &&\n autofit_type == o.autofit_type &&\n column_count == o.column_count &&\n column_spacing == o.column_spacing &&\n keep_text_flat == o.keep_text_flat &&\n rotation_angle == o.rotation_angle &&\n default_paragraph_format == o.default_paragraph_format\n end",
"title": ""
},
{
"docid": "7ea6e85eec6f600f8e4ef7dce792bef3",
"score": "0.6288092",
"text": "def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n type == o.type &&\n hide_placeholders == o.hide_placeholders &&\n base_justification == o.base_justification &&\n min_column_width == o.min_column_width &&\n column_gap_rule == o.column_gap_rule &&\n column_gap == o.column_gap &&\n row_gap_rule == o.row_gap_rule &&\n row_gap == o.row_gap &&\n items == o.items\n end",
"title": ""
},
{
"docid": "91133d586291ae088694d537509d52fe",
"score": "0.6283484",
"text": "def same?(name)\n self.class.name.eql?(name)\n end",
"title": ""
},
{
"docid": "6f90295ac6b20ee766b4181eefad6ee0",
"score": "0.6279233",
"text": "def eql?(other)\n self.class.eql?(other.class) &&\n self._name.eql?(other._name) &&\n self._type.eql?(other._type) &&\n self._klass.eql?(other._klass)\n end",
"title": ""
},
{
"docid": "d3a39064f77a418008545690c09d1d56",
"score": "0.6263691",
"text": "def eql?(other)\n other.class == self.class\n end",
"title": ""
},
{
"docid": "b353695f09a8e3adbc42a50acb1f5b57",
"score": "0.6263234",
"text": "def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n author_email == o.author_email &&\n author_name == o.author_name &&\n author_time == o.author_time &&\n branch == o.branch &&\n commit_time == o.commit_time &&\n committer_email == o.committer_email &&\n committer_name == o.committer_name &&\n default_branch == o.default_branch &&\n message == o.message &&\n repository_url == o.repository_url &&\n sha == o.sha &&\n tag == o.tag\n end",
"title": ""
},
{
"docid": "1c8c7f41579e281eb73f3deb0b953d4b",
"score": "0.62618756",
"text": "def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n clean_result == o.clean_result &&\n contains_executable == o.contains_executable &&\n contains_invalid_file == o.contains_invalid_file &&\n contains_script == o.contains_script &&\n contains_password_protected_file == o.contains_password_protected_file &&\n contains_restricted_file_format == o.contains_restricted_file_format &&\n contains_macros == o.contains_macros &&\n contains_xml_external_entities == o.contains_xml_external_entities &&\n contains_insecure_deserialization == o.contains_insecure_deserialization &&\n contains_html == o.contains_html &&\n contains_unsafe_archive == o.contains_unsafe_archive &&\n verified_file_format == o.verified_file_format &&\n found_viruses == o.found_viruses &&\n content_information == o.content_information\n end",
"title": ""
},
{
"docid": "b28b51d4e4c38cb457cbcae719f79826",
"score": "0.6258364",
"text": "def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n author_handle == o.author_handle &&\n author_name == o.author_name &&\n created_at == o.created_at &&\n description == o.description &&\n id == o.id &&\n is_read_only == o.is_read_only &&\n layout_type == o.layout_type &&\n modified_at == o.modified_at &&\n notify_list == o.notify_list &&\n reflow_type == o.reflow_type &&\n restricted_roles == o.restricted_roles &&\n tags == o.tags &&\n template_variable_presets == o.template_variable_presets &&\n template_variables == o.template_variables &&\n title == o.title &&\n url == o.url &&\n widgets == o.widgets\n end",
"title": ""
},
{
"docid": "40937e72dec489a3ee5d7cbbadf22743",
"score": "0.625508",
"text": "def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n destination == o.destination &&\n include_tags == o.include_tags &&\n name == o.name &&\n query == o.query &&\n rehydration_max_scan_size_in_gb == o.rehydration_max_scan_size_in_gb &&\n rehydration_tags == o.rehydration_tags\n end",
"title": ""
},
{
"docid": "5b7e661cba8a4d97ffd0f208a5c2fd46",
"score": "0.6241567",
"text": "def eql?(object)\n if object.equal?(self)\n return true\n elsif self.class.equal?(object.class)\n uri_with_version.eql?(object.uri_with_version)\n end\n end",
"title": ""
},
{
"docid": "a30dbc082790d15f9eaad0f910fa1114",
"score": "0.6240933",
"text": "def eql?(other)\n self.class == other.class && line == other.line\n end",
"title": ""
},
{
"docid": "cec2d57eff84bced5f109f1e32df37b6",
"score": "0.6240738",
"text": "def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n self_uri == o.self_uri &&\n alternate_links == o.alternate_links &&\n name == o.name &&\n width == o.width &&\n height == o.height &&\n alternative_text == o.alternative_text &&\n alternative_text_title == o.alternative_text_title &&\n hidden == o.hidden &&\n x == o.x &&\n y == o.y &&\n z_order_position == o.z_order_position &&\n fill_format == o.fill_format &&\n effect_format == o.effect_format &&\n three_d_format == o.three_d_format &&\n line_format == o.line_format &&\n hyperlink_click == o.hyperlink_click &&\n hyperlink_mouse_over == o.hyperlink_mouse_over &&\n type == o.type &&\n is_object_icon == o.is_object_icon &&\n substitute_picture_title == o.substitute_picture_title &&\n substitute_picture_format == o.substitute_picture_format &&\n object_name == o.object_name &&\n embedded_file_base64_data == o.embedded_file_base64_data &&\n embedded_file_extension == o.embedded_file_extension &&\n object_prog_id == o.object_prog_id &&\n link_path == o.link_path &&\n update_automatic == o.update_automatic\n end",
"title": ""
},
{
"docid": "7dc72883a5a90c6eef5c9f6a8bed74bb",
"score": "0.6234061",
"text": "def eql?(obj)\n return true if obj.equal?(self)\n obj.eql?(__getobj__)\n end",
"title": ""
},
{
"docid": "70ac7d26b8913d7e56452337d84e82a9",
"score": "0.622155",
"text": "def == other\n return false if other.class != self.class\n return false if other.length != self.length\n len = self.length\n while(len > 0)\n return false if self.get_char(len) != other.get_char(len)\n len = len - 1\n end\n return true\n end",
"title": ""
},
{
"docid": "91bd2f488f2b52568de405bc261f5fbc",
"score": "0.6207542",
"text": "def eql?(obj)\n (obj.class == model) && (obj.values == @values)\n end",
"title": ""
},
{
"docid": "91bd2f488f2b52568de405bc261f5fbc",
"score": "0.6207542",
"text": "def eql?(obj)\n (obj.class == model) && (obj.values == @values)\n end",
"title": ""
},
{
"docid": "553eeeac1bd9e92db07fad29ea4f6b32",
"score": "0.6204518",
"text": "def eql?(other)\n self.class.eql?(other.class) &&\n self.name.eql?(other.name) &&\n self.args.eql?(other.args)\n end",
"title": ""
},
{
"docid": "7938b8813facc2afd5345d82520d59d9",
"score": "0.6200646",
"text": "def eql?(other)\n other.class == self.class && self == other\n end",
"title": ""
},
{
"docid": "3732ea240dcd55a5aead85893d1f0688",
"score": "0.6197093",
"text": "def eql?(other)\n return false unless other.is_a?(::Net::FTP::List::Entry)\n return true if equal?(other)\n\n raw == other.raw # if it's exactly the same line then the objects are the same\n end",
"title": ""
},
{
"docid": "b25d924bf5652eecbc1743480ea3c114",
"score": "0.61914825",
"text": "def eql?(ct); end",
"title": ""
},
{
"docid": "b25d924bf5652eecbc1743480ea3c114",
"score": "0.61914825",
"text": "def eql?(ct); end",
"title": ""
},
{
"docid": "33cd77227286407934ae1e744b002e20",
"score": "0.6187763",
"text": "def==(other)\r\n to_s==other.to_s\r\n end",
"title": ""
},
{
"docid": "ffa3f59156e0e0c1dde41780f5b55c51",
"score": "0.6179037",
"text": "def ==(b)\n return true if self.equal? b\n return false if b.nil?\n return false unless b.class.equal? self.class\n return false unless same_length? b\n zip_bytes(b) { |i, j| return false if i != j }\n true\n end",
"title": ""
},
{
"docid": "fad499b4ec642d25271c09f52f7d5e38",
"score": "0.61788213",
"text": "def eql?(other)\n return false unless self==other\n return false unless self.morphword == other.morphword\n return true\n end",
"title": ""
},
{
"docid": "17b4791b4f46d0eff54b201108551dc4",
"score": "0.61771566",
"text": "def ==(other)\n super || object == other\n end",
"title": ""
},
{
"docid": "acc4282c99b263307912c1f8e592e3a5",
"score": "0.61735153",
"text": "def ==(other)\n case other\n when Literal\n self.value.eql?(other.value) &&\n self.language.eql?(other.language) &&\n self.datatype.eql?(other.datatype)\n when String\n self.plain? && self.value.eql?(other)\n else false\n end\n end",
"title": ""
},
{
"docid": "87406325429bea29a933e2e11870c8aa",
"score": "0.6170136",
"text": "def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n additional_query_filters == o.additional_query_filters &&\n global_time_target == o.global_time_target &&\n show_error_budget == o.show_error_budget &&\n slo_id == o.slo_id &&\n time_windows == o.time_windows &&\n title == o.title &&\n title_align == o.title_align &&\n title_size == o.title_size &&\n type == o.type &&\n view_mode == o.view_mode &&\n view_type == o.view_type\n end",
"title": ""
},
{
"docid": "53fea21f4c24c0d8da92771c0d64cb04",
"score": "0.61656564",
"text": "def ===(other)\n return false unless self.type == other.type\n return true\n end",
"title": ""
},
{
"docid": "59f2f4ce4b79f5ea5ac2d319216bc202",
"score": "0.6159676",
"text": "def eql?(other)\n return false\n end",
"title": ""
},
{
"docid": "bcd0efaccd6e5fdc64d83f5f06eb210e",
"score": "0.61579806",
"text": "def eql?(other)\n self.class == other.class && self.id == other.id\n end",
"title": ""
},
{
"docid": "2949c53d659fc4a434a8a18b2ceb201a",
"score": "0.6156212",
"text": "def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n self_uri == o.self_uri &&\n alternate_links == o.alternate_links &&\n name == o.name &&\n width == o.width &&\n height == o.height &&\n alternative_text == o.alternative_text &&\n alternative_text_title == o.alternative_text_title &&\n hidden == o.hidden &&\n x == o.x &&\n y == o.y &&\n z_order_position == o.z_order_position &&\n fill_format == o.fill_format &&\n effect_format == o.effect_format &&\n three_d_format == o.three_d_format &&\n line_format == o.line_format &&\n hyperlink_click == o.hyperlink_click &&\n hyperlink_mouse_over == o.hyperlink_mouse_over &&\n type == o.type\n end",
"title": ""
},
{
"docid": "d2540bf5ca775b59b497591a4011b0fd",
"score": "0.6152668",
"text": "def == other\n self.class == other.class && self.name == other.name\n end",
"title": ""
},
{
"docid": "62834c9d56482c2f604098a8f0af5632",
"score": "0.6146786",
"text": "def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n name == o.name &&\n type == o.type &&\n sub_attributes == o.sub_attributes &&\n multi_valued == o.multi_valued &&\n description == o.description &&\n required == o.required &&\n canonical_values == o.canonical_values &&\n case_exact == o.case_exact &&\n mutability == o.mutability &&\n returned == o.returned &&\n uniqueness == o.uniqueness &&\n reference_types == o.reference_types\n end",
"title": ""
},
{
"docid": "59da9b4da4c1516ea87ca999297bf729",
"score": "0.6142158",
"text": "def ==(other)\n self.to_s == other.to_s\n end",
"title": ""
},
{
"docid": "08740647c625d5e44ea7977217f83929",
"score": "0.6135142",
"text": "def ==(other)\n self.to_s == other.to_s\n end",
"title": ""
},
{
"docid": "a3cf99520f0ccfc3b4d4e84cf829be8c",
"score": "0.6133829",
"text": "def==(other)\n to_s==other.to_s\n end",
"title": ""
},
{
"docid": "0d9274ef7b1ea1c65bc033368b823722",
"score": "0.6131474",
"text": "def == other\n self.class == other.class and\n self.name == other.name and\n self.rw == other.rw and\n self.singleton == other.singleton\n end",
"title": ""
},
{
"docid": "8500707ce486e0e663f6f41fda1134c9",
"score": "0.61306185",
"text": "def eql?(comparison_object)\n self.class.equal?(comparison_object.class) &&\n @note == comparison_object.note &&\n @duration == comparison_object.duration\n end",
"title": ""
},
{
"docid": "4409ada8082a305d97969f829d7ffb60",
"score": "0.61297506",
"text": "def ==(other)\n self.canonicalize.to_s == other.canonicalize.to_s\n end",
"title": ""
},
{
"docid": "462c8f1f0ce0af3405defda38ce8cc8a",
"score": "0.61204207",
"text": "def ==(other)\n return true if self.equal?(other)\n self.class == other.class &&\n file_info == other.file_info &&\n output_path == other.output_path &&\n encoding == other.encoding &&\n recognize_lists == other.recognize_lists &&\n leading_spaces == other.leading_spaces &&\n trailing_spaces == other.trailing_spaces &&\n enable_pagination == other.enable_pagination\n end",
"title": ""
},
{
"docid": "f9d067f7413a601d8bcdbe2a2ec447cb",
"score": "0.6117445",
"text": "def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n class_id == o.class_id &&\n object_type == o.object_type &&\n action == o.action &&\n cache_state == o.cache_state &&\n cached_time == o.cached_time &&\n last_access_time == o.last_access_time &&\n md5sum == o.md5sum &&\n original_sha512sum == o.original_sha512sum &&\n path == o.path &&\n registered_workflows == o.registered_workflows &&\n used_count == o.used_count &&\n file == o.file &&\n network_element == o.network_element\n end",
"title": ""
},
{
"docid": "28d1e4fe8bbd2506acd022ff37787b21",
"score": "0.61171246",
"text": "def ==(other)\n return false unless other.is_a?(self.class)\n\n id == other.id &&\n title == other.title &&\n updated_at == other.updated_at &&\n link == other.link &&\n author == other.author &&\n content == other.content\n end",
"title": ""
},
{
"docid": "b81420d77d7f485d915e610269903fd6",
"score": "0.61165047",
"text": "def eql?(other)\n other.is_a?(self.class) && self == other\n end",
"title": ""
},
{
"docid": "b81420d77d7f485d915e610269903fd6",
"score": "0.61165047",
"text": "def eql?(other)\n other.is_a?(self.class) && self == other\n end",
"title": ""
},
{
"docid": "b30da7dcac64c9d3d33950e39817b993",
"score": "0.61128765",
"text": "def eql?(*) end",
"title": ""
}
] |
a02320206c675723d0afe5464af12983
|
design_constraints Description: This action displays a form to gather design constraint details for the design entry. Parameters from params id the board_design_entry id user_action keeps track of whether the user is adding or updating
|
[
{
"docid": "20edf71fc94200b3cdad6f3559e6a34b",
"score": "0.8586227",
"text": "def design_constraints\n \n @board_design_entry = BoardDesignEntry.find(params[:id])\n @user_action = params[:user_action]\n \n end",
"title": ""
}
] |
[
{
"docid": "b07d2ef7b095a784c9b961a6baca567e",
"score": "0.62380576",
"text": "def design\n @board = Board.find(params[:id])\n @designs = Design.find_all_by_board_id(@board.id)\n end",
"title": ""
},
{
"docid": "a2a3b69014798f917f88f3fd6701bcdf",
"score": "0.6195697",
"text": "def design_params\n params.require(:design).permit(:design_role, :design_type, :desigh_subtype, :connection_type)\n end",
"title": ""
},
{
"docid": "ee5f8b931944e7983cf65d64a1754a37",
"score": "0.6160272",
"text": "def design_params\n params.require(:design).permit(:company_id, :tile_colour, :background_id, :font_id)\n end",
"title": ""
},
{
"docid": "4613128c4177dd455cc5567323632614",
"score": "0.61035156",
"text": "def constraints\n @psi = PlanStageInstance.find(params[:plan_stage_instance_id])\n @constraints_by_type = @psi.constraints_by_type\n @constrainable_type = params[:constrainable_type]\n @plan = find_plan\n render :layout => false\n end",
"title": ""
},
{
"docid": "90f1b90bf3fb10890784958877ecbb1e",
"score": "0.5916562",
"text": "def entry_input_checklist\n @board_design_entry = BoardDesignEntry.find(params[:id])\n end",
"title": ""
},
{
"docid": "e2d1551a05687ae735bb5af184c425a3",
"score": "0.5885329",
"text": "def design_setup\n \n @board_design_entry = BoardDesignEntry.find(params[:id])\n \n # Get all active reviews except planning\n @review_types = []\n ReviewType.get_active_review_types.each do |rt|\n @review_types << rt if rt.name != \"Planning\"\n end\n\n @priorities = Priority.get_priorities\n \n end",
"title": ""
},
{
"docid": "9f9359d3929aaea12cd050ff17da20e8",
"score": "0.5882458",
"text": "def update_entry\n flash['notice'] = \"\"\n \n @planning = \"bde\"\n \n if params[:bde]\n @planning = \"bde\"\n elsif params[:planning]\n @planning = \"planning\"\n end \n\n \n @board_design_entry = BoardDesignEntry.find(params[:id])\n bde = BoardDesignEntry.new(params[:board_design_entry])\n bde.id = params[:id]\n bde.user_id = @logged_in_user.id\n #bde.part_number_id = @board_design_entry.part_number_id\n @viewer = params[:viewer]\n \n # Verify that the required information was submitted before proceeding.\n if !bde.division_id || !bde.location_id ||\n !bde.revision_id || \n !bde.platform_id || !bde.product_type_id ||\n !bde.project_id #|| bde.description.size == 0\n \n notice = \"The following information must be provided in order to proceed <br />\"\n notice += \"<ul>\"\n #notice += \" <li>Board Description</li>\" if bde.description.size == 0\n notice += \" <li>Division</li>\" if !bde.division_id\n notice += \" <li>Location</li>\" if !bde.location_id\n notice += \" <li>Platform</li>\" if !bde.platform_id\n notice += \" <li>Product Type</li>\" if !bde.product_type_id\n notice += \" <li>Project</li>\" if !bde.project_id\n notice += \" <li>Revision</li>\" if !bde.revision_id\n notice += \"</ul>\"\n flash['notice'] = notice\n \n @design_dir_list = DesignDirectory.get_active_design_directories\n @division_list = Division.get_active_divisions\n @incoming_dir_list = IncomingDirectory.get_active_incoming_directories\n @location_list = Location.get_active_locations\n @platform_list = Platform.get_active_platforms\n @prefix_list = Prefix.get_active_prefixes\n @product_type_list = ProductType.get_active_product_types\n @project_list = Project.get_active_projects\n @revision_list = Revision.get_revisions\n @hw_engineers = User.get_hw_engineers(User.find(:all, :order => \"last_name ASC\"))\n @part_nums = PartNum.find_all_by_board_design_entry_id(@board_design_entry.id)\n\n @board_design_entry = bde\n @new_entry = 'true'\n @user_action = params[:user_action]\n \n if @planning == \"planning\"\n render(:action => 'new_entry', :planning => 'planning')\n else\n render(:action => 'new_entry', :bde => 'bde')\n end \n return\n \n end\n\n # I think this will always return null except for a small subset of boards created in 2006-2007 ( JonK 1/2013 )\n board = Board.find_by_prefix_id_and_number(bde.prefix_id, bde.number) \n \n # I believe entry type is not set until the bde has been submitted and then it is processed and added to the tracker. When it is set it is either \"new\" or \"dot_rev\" ( JonK 1/2013 )\n if bde.entry_type == 'new'\n if board && board.designs.size > 0\n last_design = board.designs.sort_by { |d| d.revision.name }.pop\n \n if last_design.revision.name > bde.revision.name\n flash['notice'] = \"#{bde.full_name} not created - a newer revision exists in the system\" \n if @planning == \"planning\"\n redirect_to(:action => 'edit_entry',\n :id => @board_design_entry.id,\n :user_action => 'adding',\n :viewer => @viewer,\n :planning => \"planning\")\n else\n redirect_to(:action => 'edit_entry',\n :id => @board_design_entry.id,\n :user_action => 'adding',\n :viewer => @viewer,\n :bde => \"bde\")\n end\n return\n end\n end\n elsif bde.entry_type == 'dot_rev' && !bde.numeric_revision\n flash['notice'] = \"Entry not created - a numeric revision must be specified for a Dot Rev\"\n \n if @planning == \"planning\"\n redirect_to(:action => 'edit_entry',\n :id => @board_design_entry.id,\n :user_action => 'adding',\n :viewer => @viewer,\n :planning => \"planning\")\n else\n redirect_to(:action => 'edit_entry',\n :id => @board_design_entry.id,\n :user_action => 'adding',\n :viewer => @viewer,\n :bde => \"bde\")\n end\n return\n end\n \n\n if bde.entry_type == 'new'\n bde.numeric_revision = 0\n bde.eco_number = ''\n params[:board_design_entry][:numeric_revision] = 0\n params[:board_design_entry][:eco_number] = ''\n \n end\n \n # Grab the current description or set it to \"\"\n # This is implemented because descriptions are phased out and are not placed with the part number\n # but I dont want to delete all the old data 2/19/13\n params[:board_design_entry][:description] = @board_design_entry.description? ? @board_design_entry.description : \"\"\n \n # Try to update the board design entry \n if @board_design_entry.update_attributes(params[:board_design_entry])\n\n flash['notice'] += \"Entry #{@board_design_entry.pcb_number} has been updated... \"\n \n # Update the descriptions on the Part Numbers\n params[:part_num].each do |pn|\n pnum = PartNum.find_by_id(pn[0])\n pn_atts = { :description => pn[1][:description]}\n pnum.update_attributes(pn_atts)\n end \n \n ####### 1/2013 - BEGIN NEW SECTION ADDED TO CREATE/UPDATE BDE, BOARD, DESIGN, AND PLANNING DESIGN REVIEW FOR NEW PLANNING STAGE ###############\n if @planning == \"planning\" \n \n ### FIND/CREATE THE BOARD ###\n \n # Try to located the board_id to see if it already exists\n design = Design.find_by_id(@board_design_entry.design_id)\n \n # If it exists then update it\n if design != nil && design.board_id != nil\n @board = Board.find_by_id(design.board_id)\n \n board_attributes = { :platform_id => @board_design_entry.platform_id,\n :project_id => @board_design_entry.project_id,\n :description => @board_design_entry.description,\n :active => 1 \n }\n @board.update_attributes!(board_attributes) \n \n flash['notice'] += \"Board updated ... \"\n # Otherwise create it\n else\n @board = Board.new( :platform_id => @board_design_entry.platform_id,\n :project_id => @board_design_entry.project_id,\n :description => @board_design_entry.description,\n :active => 1 \n ) \n if @board.save\n flash['notice'] += \"Board created ... \"\n else\n flash['notice'] += \"The board already exists - this should never occur. If you see this message please contact DTG immediately\"\n redirect_to(:action => 'processor_list')\n return\n end\n end\n \n \n ### FIND/CREATE THE DESIGN AND DESIGN REVIEW ###\n \n review_types = [] \n review_types << \"Planning\"\n \n phase_id = ReviewType.find_by_name(\"Planning\").id\n \n # Check if the design already exists... If it does then update it. \n # There really isnt anything from the board_design_entry/new_entry for to add to this update so this is kind of pointless\n if @board_design_entry.design_id != 0\n design = Design.find_by_id(@board_design_entry.design_id)\n design_attributes = { #:part_number_id => board_design_entry.part_number_id, # All these entries are already blank\n :revision_id => @board_design_entry.revision_id,\n :numeric_revision => @board_design_entry.numeric_revision\n #:eco_number => @board_design_entry.eco_number, # This never gets populated in the BDE Table\n #:designer_id => @logged_in_user.id, # This was left out... should it be added\n #:pcb_input_id => @logged_in_user.id, # This is already populated... Dont think it should be overwritten\n #:created_by => @logged_in_user.id # This is already populated... Dont think it should be overwritten\n }\n \n design.update_attributes!(design_attributes) \n flash['notice'] += \"Design updated ... \"\n \n # If it doesn't already exist then create it\n else\n design = Design.new( #:part_number_id => board_design_entry.part_number_id, \n :design_center_id => @logged_in_user.design_center_id,\n :phase_id => phase_id,\n :priority_id => 1,\n :board_id => @board.id,\n :revision_id => @board_design_entry.revision_id,\n :numeric_revision => @board_design_entry.numeric_revision,\n :eco_number => @board_design_entry.eco_number,\n :designer_id => @logged_in_user.id,\n :pcb_input_id => @logged_in_user.id,\n :created_by => @logged_in_user.id\n ) \n \n if design.save\n flash['notice'] += \"Design created ... \"\n \n users = []\n users << User.find_by_id(@board_design_entry.user_id)\n \n # Create the \"Planning Review\"\n design.setup_design_reviews(review_types, users)\n \n # Update the design_id in the board_design_entry table\n @board_design_entry.design_id = design.id\n @board_design_entry.save\n \n # Update the design_id for pcb and pcba in the part_nums table\n pcb_num = PartNum.get_bde_pcb_part_number(@board_design_entry)\n pcb_num.design_id = design.id\n pcb_num.save\n \n PartNum.get_bde_pcba_part_numbers(@board_design_entry).each do |pcba|\n pcba.design_id = design.id\n pcba.save\n end\n \n else\n flash['notice'] += \"The design already exists - this should never occur. If you see this message please contact DTG immediately\"\n redirect_to(:action => 'processor_list')\n return\n end\n end\n \n audit = Audit.new( :design_id => design.id,\n :checklist_id => Checklist.latest_release.id,\n :skip => 1\n )\n if audit.save\n audit.create_checklist\n end\n \n ####### 1/2013 - END SECTION ADDED TO CREATE/UPDATE BDE, BOARD, DESIGN, AND PLANNING DESIGN REVIEW FOR NEW PLANNING STAGE ############### \n \n BoardDesignEntryMailer::planning_board_design_entry_submission(@board_design_entry).deliver\n flash['notice'] += \"An email has been sent out. \"\n \n # If not planning just updated Board if it exists\n else\n \n # Try to located the board_id to see if it already exists\n design = Design.find_by_id(@board_design_entry.design_id)\n \n # If it exists then update it\n if design != nil && design.board_id != nil\n @board = Board.find_by_id(design.board_id)\n \n board_attributes = { :platform_id => @board_design_entry.platform_id,\n :project_id => @board_design_entry.project_id,\n :description => @board_design_entry.description,\n :active => 1 \n }\n @board.update_attributes!(board_attributes) \n \n flash['notice'] += \"Board updated ... \"\n\tend\n end \n \n # I dont really see the reason why you would want to use the bde id's to update a users id's ( JonK 1/2013 )\n #Update the user's division and/or location if it has changed.\n @logged_in_user.save_division(@board_design_entry.division_id)\n @logged_in_user.save_location(@board_design_entry.location_id)\n \n if @planning == \"planning\"\n redirect_to(:action => 'originator_list') \n elsif params[:user_action] == 'adding'\n redirect_to(:action => 'set_team',\n :id => @board_design_entry.id,\n :user_action => 'adding')\n elsif params[:user_action] == 'updating'\n redirect_to(:action => 'edit_entry',\n :id => @board_design_entry.id,\n :user_action => 'updating',\n :viewer => @viewer)\n end\n \n end\n \n end",
"title": ""
},
{
"docid": "2a09bb654371dc2cf1758fc5a666e35d",
"score": "0.5796214",
"text": "def edit_entry\n \n @board_design_entry = BoardDesignEntry.find(params[:id])\n @user_action = params[:user_action]\n @viewer = params[:viewer]\n @design_review_id = params[:design_review_id]\n \n @design_dir_list = DesignDirectory.get_active_design_directories\n @division_list = Division.get_active_divisions\n @incoming_dir_list = IncomingDirectory.get_active_incoming_directories\n @location_list = Location.get_active_locations\n @platform_list = Platform.get_active_platforms\n @prefix_list = Prefix.get_active_prefixes\n @product_type_list = ProductType.get_active_product_types\n @project_list = Project.get_active_projects\n @revision_list = Revision.get_revisions\n @hw_engineers = User.get_hw_engineers(User.find(:all, :order => \"last_name ASC\"))\n @part_nums = PartNum.find_all_by_board_design_entry_id(@board_design_entry.id)\n \n render(:action => 'new_entry')\n \n end",
"title": ""
},
{
"docid": "df642e1cb12c5f1efa0d4effbaf4bd26",
"score": "0.5757841",
"text": "def create_constraint\n if request.post?\n day_nr = from_dayname_to_id(params[:day])\n t = TemporalConstraint.new(:description=>params[:description],\n :isHard=>0,:startHour=>params[:start_hour],:endHour=>params[:end_hour],:day=>day_nr)\n teacher = Teacher.find(params[:id])\n @constraint = t\n if t.save\n teacher.constraints << t\n @error_unique = !t.is_unique_constraint?(teacher)\n end\n respond_to do |format|\n @teacher = teacher\n format.html { edit_constraints\n render :action => \"edit_constraints\"\n }\n format.js{}\n end\n end\n end",
"title": ""
},
{
"docid": "929cacf44562267a1b392059703f0297",
"score": "0.5683906",
"text": "def change_designation_params\n params.require(:change_designation).permit(:employee_id, :employee_designation_id, :effective_from, :effective_to, :status, :change_by_id)\n end",
"title": ""
},
{
"docid": "e9b5aa11db01ef4de385730a7fc73248",
"score": "0.5663658",
"text": "def design_solution_params\n params.require(:design_solution).permit(:one_pro_1, :one_pro_2, :one_pro_3, \n :two_pro_1, :two_pro_2, :two_pro_3, \n :three_pro_1, :three_pro_2, :three_pro_3,\n :one_con_1, :one_con_2, :one_con_3, \n :two_con_1, :two_con_2, :two_con_3, \n :three_con_1, :three_con_2, :three_con_3, \n :solution_1_rank_1, :solution_2_rank_1, :solution_3_rank_1,\n :my_solution, :design_case_id, :my_solution_rank, :user_id, \n :solution_1_rank_2, :solution_2_rank_2, :solution_3_rank_2,\n :justification)\n end",
"title": ""
},
{
"docid": "d3e265fd2042437a6bdc36851935fd74",
"score": "0.5645158",
"text": "def constraint_params\n params.require(:constraint).permit(:title, :description, :task_id)\n end",
"title": ""
},
{
"docid": "135b3217cc22a3a03884aec5dd91f7c9",
"score": "0.56067854",
"text": "def admin_update\n \n if session['flash'] && session['flash'][:sort_order]\n session['flash'][:sort_order] = session['flash'][:sort_order]\n end\n \n @design_review = DesignReview.find(params[:id])\n design_id = @design_review.design_id\n # Get date pre-art review was originally posted\n preart_review_type_id = ReviewType.find_by_name(\"Pre-Artwork\").id\n @preart_des_review_post_date = DesignReview.find_by_design_id_and_review_type_id(design_id, preart_review_type_id).created_on.to_i rescue 0\n \n # Check if design has a pcba (is not bareboard)\n @haspcba = PartNum.find_all_by_design_id_and_use(design_id,\"pcba\").empty? ? false : true\n \n @designers = Role.active_designers\n if ( @design_review.design.audit.skip? || @design_review.design.audit.is_complete?) \n # include all designers if audit skipped or complete\n @designer_list = @designers\n else\n # otherwise exclude peer\n @designer_list = @designers - [@design_review.design.peer]\n end\n @peer_list = @designers - [@design_review.design.designer]\n @pcb_input_gate_list = Role.find_by_name('PCB Input Gate').active_users\n @priorities = Priority.get_priorities\n @design_centers = DesignCenter.get_all_active\n \n @review_statuses = []\n if @design_review.in_review? || @design_review.on_hold?\n @review_statuses << ReviewStatus.find_by_name('In Review')\n @review_statuses << ReviewStatus.find_by_name('Review On-Hold')\n end\n\n @release_poster = nil\n if ( @design_review.design.get_design_review('Release') )\n @release_poster = @design_review.design.get_design_review('Release').designer\n end\n selects = { :designer => @design_review.design.designer.id,\n :peer => @design_review.design.peer.id}\n flash[:selects] = selects\n\nend",
"title": ""
},
{
"docid": "5b4d5a06a57a689877e16fa3b416fa14",
"score": "0.55968386",
"text": "def new_entry \n @planning = \"bde\"\n \n if params[:bde]\n @planning = \"bde\"\n elsif params[:planning]\n @planning = \"planning\"\n end\n logger.debug @planning\n \n @board_design_entry = BoardDesignEntry.find(params[:id])\n @user_action = params[:user_action]\n @design_dir_list = DesignDirectory.get_active_design_directories\n @division_list = Division.get_active_divisions\n @incoming_dir_list = IncomingDirectory.get_active_incoming_directories\n @location_list = Location.get_active_locations\n @platform_list = Platform.get_active_platforms\n @product_type_list = ProductType.get_active_product_types\n @project_list = Project.get_active_projects\n @revision_list = Revision.get_revisions\n @hw_engineers = User.get_hw_engineers(User.find(:all, :order => \"last_name ASC\"))\n @part_nums = PartNum.find_all_by_board_design_entry_id(@board_design_entry.id)\n\n end",
"title": ""
},
{
"docid": "f6c835163ddfeedbcdefd0ac21bc3c16",
"score": "0.5593191",
"text": "def create_constraint\n if request.post?\n classroom = Classroom.find(params[:id])\n day_nr = from_dayname_to_id(params[:selected_day])\n t = TemporalConstraint.new(:description=>\"Vincolo di indisponibilità aula: \" + classroom.name,\n :isHard=>0,:startHour=>params[:start_hour],:endHour=>params[:end_hour],:day=>day_nr)\n @constraint = t\n if t.save\n classroom.constraints << t # associo il nuovo vincolo con l'aula\n @error_unique = !t.is_unique_constraint?(classroom)\n #classroom.save\n end\n\n respond_to do |format|\n @classroom = Classroom.find(params[:id])\n #@constraint= t\n #parte originale.. forse utilizzabile dal clock\n classroom_constraint_ids = ConstraintsOwner.find(:all,\n :conditions => [\"constraint_type = 'TemporalConstraint' AND owner_type = 'Classroom' AND owner_id = (?)\", params[:id]], :select => ['constraint_id'])\n @constraints = []\n for id in classroom_constraint_ids do\n @constraints << TemporalConstraint.find(id.constraint_id)\n end\n format.html { render :action => \"edit_constraints\" }\n format.js{}\n end\n end\n end",
"title": ""
},
{
"docid": "5e0e5e81af53e4925c40ef4f037ed36d",
"score": "0.55826354",
"text": "def design_information\n\n #Get the board information\n @type = params[:type] || 'pcb'\n part_number = params[:part_number]\n @designs = PartNum.get_designs(part_number,@type)\n \n flash['notice'] = 'Number of designs - ' + @designs.size.to_s\n # First sort the designs by name, then sort the reviews by review order.\n @designs = @designs.sort_by { |design| design.id }\n if @designs.size == 0\n @detailed_name = \"Part number prefix #{part_number} not found\"\n else\n @detailed_name = @designs[0].detailed_name\n end\n end",
"title": ""
},
{
"docid": "de97c27bebc87a54c757f21764ccbd1d",
"score": "0.55010384",
"text": "def board_design_search\n\n @project = 'All Projects'\n @platform = 'All Platforms'\n @designer = 'All Designers'\n \n if params[:platform][:id] != ''\n platform = Platform.find(params[:platform][:id])\n @platform = platform.name\n end\n \n if params[:project][:id] != ''\n project = Project.find(params[:project][:id])\n @project = project.name\n end\n \n condition = []\n condition << \"platform_id=#{platform.id}\" if platform\n condition << \"project_id=#{project.id}\" if project\n conditions = condition.join(' AND ')\n board_list = Board.find(:all, :conditions => conditions)\n \n release_rt = ReviewType.get_release\n final_rt = ReviewType.get_final\n \n @design_list = [] #list of designs with designer info for view\n \n designs = [] #list of designs with designer info for local use\n board_list.each do |board|\n board.designs.each do |design|\n if !(design.complete? || design.in_phase?(release_rt))\n designer_name = design.designer.name\n designer_id = design.designer.id\n else \n final_review = design.design_reviews.detect { |dr| \n dr.review_type_id == final_rt.id }\n designer_name = final_review.designer.name\n designer_id = final_review.designer.id\n end\n designs << { :design => design, \n :designer_name => designer_name,\n :designer_id => designer_id,\n :platform_name => board.platform.name,\n :project_name => board.project.name }\n end\n end\n#logger.debug \"--before filter--\"\n#logger.debug designs\n # If the designer was specified then filter the list.\n user_id = params[:user][:id].to_i\n if user_id != 0\n designs.delete_if { | design |\n design[:designer_id] != user_id\n }\n end\n # If a phase was specified then filter the list.\n selected_ids = params[:review_types] || []\n#logger.debug \"--- selected ids ---\"\n#logger.debug selected_ids\n if selected_ids.include?('Complete')\n @design_list += designs.map { |design| \n design if design[:design].complete?\n }\n end\n @selected_phases = selected_ids.map { | id |\n if id == \"Complete\"\n \"Complete\"\n else\n ReviewType.find(id).name\n end\n }\n @design_list += designs.map { |design| \n design if selected_ids.include?(design[:design].phase_id.to_s)\n }\n @design_list.delete_if { |dl| dl == nil } #map adds nil values\n#logger.debug \"--after filter--\"\n#logger.debug @design_list\n end",
"title": ""
},
{
"docid": "b206c6839db7f05fd982804d312d8632",
"score": "0.5461001",
"text": "def set_constraction\n @constraction = Constraction.find(params[:id])\n end",
"title": ""
},
{
"docid": "b206c6839db7f05fd982804d312d8632",
"score": "0.5461001",
"text": "def set_constraction\n @constraction = Constraction.find(params[:id])\n end",
"title": ""
},
{
"docid": "64e43e3a9fdbfe4e3b3bba12a788a898",
"score": "0.5407825",
"text": "def update\n respond_to do |format|\n if @constraint.update(constraint_params)\n format.html { redirect_to @constraint, notice: 'La contrainte a été mise à jour.' }\n format.json { render :show, status: :ok, location: @constraint }\n else\n format.html { render :edit }\n format.json { render json: @constraint.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "751d2270119ac2ade067db9311101e44",
"score": "0.5398683",
"text": "def develop_params\n params.require(:develop).permit(:name, :coder, :boss, :project_id, :description, \n :ic_user_id, :priority_id, :dev_status_id,\n tasks_attributes: [:id, :name, :_destroy])\n end",
"title": ""
},
{
"docid": "e5da6e7466f7237e9d9a6f964ecb8fae",
"score": "0.53985447",
"text": "def mass_constraint_params\n params.require(:mass_constraint).permit(:mass_id, :constraint_id, :constraint_type)\n end",
"title": ""
},
{
"docid": "a75691ed007441263943fd34bcf66c81",
"score": "0.53791606",
"text": "def form_design_params\n params.require(:form_design).permit(:name, :type, :form_type, :slug, :content, :status, :sequence, :free)\n end",
"title": ""
},
{
"docid": "a2662dcdc7dbf08115804c3b91f9b37c",
"score": "0.5373394",
"text": "def set_constraint\n @constraint = Constraint.find(params[:id])\n end",
"title": ""
},
{
"docid": "4a8b8933a1f9b6b2534f1aec464f3852",
"score": "0.5364297",
"text": "def create_tracker_entry\n \n board_design_entry = BoardDesignEntry.find(params[:id])\n flash['notice'] = ''\n\n ### FIND/CREATE THE BOARD ###\n\n # Try to located the board_id to see if it already exists\n design = Design.find_by_id(board_design_entry.design_id)\n\n # If it exists then update it\n if design != nil && design.board_id != nil\n board = Board.find_by_id(design.board_id)\n \n board_attributes = { :platform_id => board_design_entry.platform_id,\n :project_id => board_design_entry.project_id,\n :description => board_design_entry.description,\n :active => 1 \n }\n board.update_attributes!(board_attributes) \n \n flash['notice'] += \"Board updated ... \"\n # Otherwise create it\n else\n board = Board.new( :platform_id => board_design_entry.platform_id,\n :project_id => board_design_entry.project_id,\n :description => board_design_entry.description,\n :active => 1 \n ) \n if board.save\n flash['notice'] += \"Board created ... \"\n else\n flash['notice'] += \"The board already exists - this should never occur. If you see this message please contact DTG immediately\"\n redirect_to(:action => 'processor_list')\n return\n end\n end\n\n # Update the board reviewers table for this board.\n ig_role = Role.find_by_name('PCB Input Gate')\n board_design_entry.board_design_entry_users.each do |reviewer_record|\n\n next if !reviewer_record.required?\n\n board_reviewer = board.board_reviewers.detect { |br| br.role_id == reviewer_record.role_id }\n\n if !board_reviewer\n \n if reviewer_record.role_id != ig_role.id\n reviewer_id = reviewer_record.user_id\n else\n reviewer_id = @logged_in_user.id\n end\n\n board_reviewer = BoardReviewer.new(:board_id => board.id,\n :reviewer_id => reviewer_id,\n :role_id => reviewer_record.role_id)\n board_reviewer.save\n \n elsif board_reviewer.reviewer_id != reviewer_record.user_id\n \n board_reviewer.update_attribute('reviewer_id', reviewer_record.user_id)\n\n end\n \n end\n \n # Create the design\n case board_design_entry.entry_type\n when 'new'\n type = 'New'\n when 'dot_rev'\n type = 'Dot Rev'\n when 'date_code'\n type = 'Date Code'\n end\n \n # Get all active reviews except planning\n review_types = []\n ReviewType.get_active_review_types.each do |rt|\n review_types << rt if rt.name != \"Planning\"\n end\n \n phase_id = Design::COMPLETE\n review_types.each do |review_type|\n if params[:review_type][review_type.name] == '1'\n phase_id = review_type.id\n break\n end\n end\n \n created_or_updated_design = false\n \n # Check if the design already exists... If it does then update it. \n # There really isnt anything from the board_design_entry/new_entry for to add to this update so this is kind of pointless\n if board_design_entry.design_id != 0\n design = Design.find_by_id(board_design_entry.design_id)\n\n design_attributes = { :board_id => board.id,\n #:part_number_id => board_design_entry.part_number_id,\n :phase_id => phase_id,\n :design_center_id => @logged_in_user.design_center_id,\n :revision_id => board_design_entry.revision_id,\n :numeric_revision => board_design_entry.numeric_revision,\n :eco_number => board_design_entry.eco_number,\n :design_type => type,\n :priority_id => params[:priority][:id],\n :pcb_input_id => @logged_in_user.id,\n :created_by => @logged_in_user.id\n } \n\n design.update_attributes!(design_attributes) \n flash['notice'] += \"Design updated ... \"\n created_or_updated_design = true\n \n # If it doesn't already exist then create it\n else\n design = Design.new(:board_id => board.id,\n #:part_number_id => board_design_entry.part_number_id,\n :phase_id => phase_id,\n :design_center_id => @logged_in_user.design_center_id,\n :revision_id => board_design_entry.revision_id,\n :numeric_revision => board_design_entry.numeric_revision,\n :eco_number => board_design_entry.eco_number,\n :design_type => type,\n :priority_id => params[:priority][:id],\n :pcb_input_id => @logged_in_user.id,\n :created_by => @logged_in_user.id)\n \n if design.save\n flash['notice'] += \"Design created ... \"\n created_or_updated_design = true\n end\n end\n \n if created_or_updated_design\n \n planning_review_id = ReviewType.find_by_name(\"Planning\").id\n completed_review_status_id = ReviewStatus.find_by_name(\"Review Completed\").id\n \n planning_review = DesignReview.find_by_design_id_and_review_type_id(design.id, planning_review_id)\n if planning_review != nil\n planning_review.review_status_id = completed_review_status_id\n planning_review.completed_on = Time.now\n planning_review.save\n end\n \n # Create the design reviews \n design.setup_design_reviews(params[:review_type], \n board_design_entry.board_design_entry_users)\n \n # Create the links to the documents that were attached during board \n # design entry.\n entry_doc_types = { :outline_drawing_document_id => 'Outline Drawing', \n :pcb_attribute_form_document_id => 'PCB Attribute',\n :teradyne_stackup_document_id => 'Stackup' }\n \n entry_doc_types.each { |message, document_type_name|\n \n document_id = board_design_entry.send(message)\n \n if document_id > 0\n \n document_type = DocumentType.find_by_name(document_type_name)\n DesignReviewDocument.new( :board_id => board.id,\n :design_id => design.id,\n :document_type_id => document_type.id,\n :document_id => document_id).save\n end\n }\n \n audit = Audit.find_or_create_by_design_id( design.id )\n \n audit_params = { :checklist_id => Checklist.latest_release.id,\n :skip => params[:audit][:skip]\n }\n audit.update_attributes!(audit_params)\n audit.create_checklist \n \n board_design_entry.ready_to_post\n board_design_entry.design_id = design.id\n board_design_entry.save\n\n #add the design id to the part numbers for the board_design_entry\n pcb_num = PartNum.get_bde_pcb_part_number(board_design_entry)\n pcb_num.design_id = design.id\n pcb_num.save\n \n PartNum.get_bde_pcba_part_numbers(board_design_entry).each do |pcba|\n pcba.design_id = design.id\n pcba.save\n end\n \n else\n flash['notice'] += \"There was an error and the design was not created!!! Please contact DTG!!\"\n redirect_to(:action => 'processor_list')\n return\n end\n \n flash['notice'] += \" The #{board_design_entry.part_number} Board Design has been successfully setup in the tracker\"\n redirect_to(:action => 'processor_list')\n \n end",
"title": ""
},
{
"docid": "0c31b1095c86dade4d631ae044ccaace",
"score": "0.5360206",
"text": "def create_board_design_entry\n\n @planning = \"bde\"\n \n if params[:bde]\n @planning = \"bde\"\n elsif params[:planning]\n @planning = \"planning\"\n end\n \n #create part number objects from form data\n pnums = []\n params[:rows].values.each { |row| \n if !row[:pnum].blank?\n pnums << PartNum.new(row)\n end\n }\n \n #check for a valid PCB part number\n pcb = pnums.detect { |pnum| pnum.use == 'pcb' }\n unless pcb && pcb.valid_part_number?\n flash['notice'] = \"A valid PCB part number containing only letters, numbers or dashes must be specified\"\n \n if @planning == \"planning\"\n redirect_to( :action => 'get_part_number', :rows => params[:rows], :planning => \"planning\") and return\n else\n redirect_to( :action => 'get_part_number', :rows => params[:rows], :bde => \"bde\") and return\n end\n end\n \n #check all specified part numbers for validity\n fail = 0\n flash['notice'] = ''\n pnums.each do | pnum |\n unless pnum.valid_part_number?\n flash['notice'] += \"Part number #{pnum.name_string} invalid<br>\\n\"\n fail = 1\n end\n end\n\n if fail == 1\n if @planning == \"planning\"\n redirect_to( :action => 'get_part_number', :rows => params[:rows], :planning => \"planning\") and return\n else\n redirect_to( :action => 'get_part_number', :rows => params[:rows], :bde => \"bde\") and return\n end\n end\n \n \n #check for duplicates already assigned\n fail = 0\n flash['notice'] = ''\n \n pnums.each do | pnum |\n db_pnum = pnum.part_num_exists?\n if ! db_pnum.blank?\n flash['notice'] += \"Part number #{pnum.name_string} exists<br>\\n\"\n fail = 1\n end\n end\n\n if fail == 1\n if @planning == \"planning\"\n redirect_to( :action => 'get_part_number', :rows => params[:rows], :planning => \"planning\") and return\n else\n redirect_to( :action => 'get_part_number', :rows => params[:rows], :bde => \"bde\") and return\n end\n end\n\n # PN ok - check if description already exists in the oracle_part_num table and if it does then update the part_num table\n pnums.each do |p|\n num_string = p.name_string\n if OraclePartNum.find_by_number(num_string)\n p.description = OraclePartNum.find_by_number(num_string).description\n p.save\n end\n end\n \n # PN ok - create entry\n @board_design_entry = BoardDesignEntry.add_entry(@logged_in_user)\n\n if @board_design_entry\n #save and relate the part numbers to the board design entry\n fail = 0\n @errors = []\n @rows = []\n pnums.each do |pnum|\n pnum.board_design_entry_id = @board_design_entry.id\n @rows << pnum\n if ! pnum.save\n fail = 1\n @errors << pnum.errors\n end\n end\n\n flash['notice'] = \"The design entry has been stored in the database\"\n\n if @planning == \"planning\"\n redirect_to(:action => 'new_entry',\n :id => @board_design_entry.id,\n :user_action => 'adding',\n :planning => \"planning\")\n else\n redirect_to(:action => 'new_entry',\n :id => @board_design_entry.id,\n :user_action => 'adding',\n :bde => \"bde\") \n end\n else\n flash['notice'] = \"Failed to create the board design entry\"\n if @planning == \"planning\"\n redirect_to( :action => 'get_part_number', :planning => \"planning\") and return\n else\n redirect_to( :action => 'get_part_number', :bde => \"bde\") and return\n end\n end\n\n end",
"title": ""
},
{
"docid": "5be705c727f482fb8572ece710ca2562",
"score": "0.53144187",
"text": "def planning_board_design_entry_submission(board_design_entry)\n\n to_list = Role.add_role_members(['PCB Input Gate', 'Manager']).uniq\n cc_list = ([board_design_entry.user.email] - to_list).uniq\n subject = 'The ' +\n board_design_entry.pcb_number +\n ' design entry planning phase has been initialized.'\n \n\n @board_design_entry = board_design_entry\n @originator = board_design_entry.user\n\n mail( :to => to_list,\n :subject => subject,\n :cc => cc_list\n ) \n end",
"title": ""
},
{
"docid": "2525f7d52780d4f74b3e060f5296d9ab",
"score": "0.5301194",
"text": "def design_params\n params.require(:design).permit(:name, :bom, :json, :image, :description, :author_id, :svg, :license, :publish)\n\n end",
"title": ""
},
{
"docid": "2625d3f64ac73428d4ed838ab4ae991e",
"score": "0.5289842",
"text": "def constraints() return @constraints end",
"title": ""
},
{
"docid": "99aa34d1853275ddc8504004f7aaed49",
"score": "0.52868134",
"text": "def constraint_list\n @constraints\n end",
"title": ""
},
{
"docid": "99aa34d1853275ddc8504004f7aaed49",
"score": "0.52863365",
"text": "def constraint_list\n @constraints\n end",
"title": ""
},
{
"docid": "f2e990f3b2e5791ba4301f36c0e3351e",
"score": "0.5269683",
"text": "def viewschdep_params\n params.require(:view_sch_dep).permit(:id, :department_id, :duty_date, :worktype_id, :is_holiday )\n end",
"title": ""
},
{
"docid": "d923202fd70805ef931e9513f9b501ed",
"score": "0.5222829",
"text": "def render_constraints(localized_params = params)\n render_constraints_query(localized_params) + render_constraints_filters(localized_params)\n end",
"title": ""
},
{
"docid": "f0fa71d33e177368d940551250f38e0f",
"score": "0.51976556",
"text": "def create\n @constraint = Constraint.new(constraint_params)\n\n respond_to do |format|\n if @constraint.save\n format.html { redirect_to @constraint, notice: 'La contrainte a été créée.' }\n format.json { render :show, status: :created, location: @constraint }\n else\n format.html { render :new }\n format.json { render json: @constraint.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b5ff02a019e14fdc12ac83b1b640a755",
"score": "0.51924306",
"text": "def constraints\n @constraints ||= {}\n end",
"title": ""
},
{
"docid": "814ae80f1a8f0d8ab0e389be03d8374e",
"score": "0.51742905",
"text": "def design_sass_params\n # params[:design_sass]\n params.require(:design_sass).permit(topic_attributes:[:name,:description])\n end",
"title": ""
},
{
"docid": "ae2103c61d2f34a7e1a526683774996b",
"score": "0.5170192",
"text": "def design_params\n params.require(:design).permit(:name, :sample, :default,\n sides_attributes: [:id, :order, :design_id, :orientation, :margin, :width, :height, :_destroy])\n end",
"title": ""
},
{
"docid": "7e83b5a980660f0b99866b224778099b",
"score": "0.51640695",
"text": "def submit\n \n board_design_entry = BoardDesignEntry.find(params[:id])\n board_design_entry.submitted\n \n BoardDesignEntryMailer::board_design_entry_submission(board_design_entry).deliver\n \n redirect_to(:action => 'originator_list')\n \n end",
"title": ""
},
{
"docid": "79e82c3e73318d736722825815343f34",
"score": "0.5156461",
"text": "def render_constraints(localized_params = params)\n if params[:add_featured]\n (render_constraints_query(localized_params)).html_safe\n else\n (render_constraints_query(localized_params) + render_constraints_filters(localized_params)).html_safe\n end\n end",
"title": ""
},
{
"docid": "ba2b2faf5fe66d8f043b5b892f6f2878",
"score": "0.5150661",
"text": "def show\n @design = Design.find(params[:id])\n if @design.approved == false\n redirect_to 'public/404.html' and return false\n else\n @creator = User.find_by_id(@design.user_id)\n session[:design_id] = params[:id]\n @comments = Comment.design_id_is(@design.id)\n end\n \n if @new_comment.nil?\n @new_comment = Comment.new\n end\n \n respond_to do |format|\n format.html { render :layout => 'public'}\n format.xml { render :xml => @design }\n end\n end",
"title": ""
},
{
"docid": "7f35674cb108c2f56a653e9f1d3e243a",
"score": "0.51385504",
"text": "def discipline_params\n params.require(:discipline).permit(:user_id, :reason, :action)\n end",
"title": ""
},
{
"docid": "d2ef59ed97e5280d4cd500f71719a640",
"score": "0.5115517",
"text": "def printed_design_params\n params.require(:printed_design).permit(:client, :lead_image, :secondary_image, :date, :description)\n end",
"title": ""
},
{
"docid": "d7bddd1c6d1d398d74c0a75150324e71",
"score": "0.51110506",
"text": "def design_project_params\n params.require(:design_project).permit(:name, :image_1, :image_2, :image_3, :e_url, :detail, :category, :admin_id)\n end",
"title": ""
},
{
"docid": "04b95cf2b3565d5720909cd7fe7a8f64",
"score": "0.5107222",
"text": "def designation_type_designation_params\n params.require(:designation_type_designation).permit(:designation_type_id, :designation_id)\n end",
"title": ""
},
{
"docid": "64a31e372b58b2d11cbe2ae3bc0a8a22",
"score": "0.51008135",
"text": "def dashboard_discipline_params\r\n params.require(:discipline).permit(:name, :link, :code, :credit, :hours, :semester, :shift, :image, user_ids: [])\r\n end",
"title": ""
},
{
"docid": "31b67c4797888d705401645db44fe8a3",
"score": "0.50987285",
"text": "def build_organization_form(organization,action,caption,is_edit,is_create_retry = nil,add_organization = nil)\n\n if !is_edit\n parent_organisation_short_descriptions = Organization.find_by_sql(\"select distinct short_description from organizations\").map{|o|[o.short_description]}\n else\n parent_organisation_short_descriptions = Organization.find_by_sql(\"select distinct short_description from organizations where short_description != '#{organization.short_description.to_s}'\").map{|o|[o.short_description]}\n end\n#\t--------------------------------------------------------------------------------------------------\n#\tDefine a set of observers for each composite foreign key- in effect an observer per combo involved\n#\tin a composite foreign key\n#\t--------------------------------------------------------------------------------------------------\n\t\n#\t---------------------------------\n#\t Define fields to build form from\n#\t---------------------------------\n\tfield_configs = Array.new\n if(!add_organization)\n field_configs[field_configs.size] = {:field_type => 'DropDownField',\n :field_name => 'parent_org_short_description',\n :settings=>{:label_caption=>'parent organization',:list=>parent_organisation_short_descriptions}}\n end\n\n\tfield_configs[field_configs.size] = {:field_type => 'TextField',\n\t\t\t\t\t\t:field_name => 'long_description'}\n\n\tfield_configs[field_configs.size] = {:field_type => 'TextField',\n\t\t\t\t\t\t:field_name => 'medium_description'}\n\n\tfield_configs[field_configs.size] = {:field_type => 'TextField',\n\t\t\t\t\t\t:field_name => 'short_description',\n\t\t\t\t\t\t:settings => {:label_caption => \"org code\"}}\n \n\tfield_configs[field_configs.size] = {:field_type => 'TextField',\n\t\t\t\t\t\t:field_name => 'gln'}\n\n\tfield_configs[field_configs.size] = {:field_type => 'TextField',\n\t\t\t\t\t\t:field_name => 'sell_by_algorithm'}\n\n\tfield_configs[field_configs.size] = {:field_type => 'TextField',\n\t\t\t\t\t\t:field_name => 'sell_by_description'}\n\n\tfield_configs[field_configs.size] = {:field_type => 'CheckBox',\n\t\t\t\t\t\t:field_name => 'receives_edi'}\n\n\tbuild_form(organization,field_configs,action,'organization',caption,is_edit)\n\nend",
"title": ""
},
{
"docid": "29d7ea7aceaeddb8d38709f635b7fa69",
"score": "0.5090031",
"text": "def designation_params\n params.require(:designation).permit(:name, :for_search_id, :course_duration)\n end",
"title": ""
},
{
"docid": "02bf0abfa1c1bb43c6101cf52edc54b6",
"score": "0.50860876",
"text": "def update_design_checks\n\n audit = Audit.find(params[:audit][:id])\n subsection_id = params[:subsection][:id]\n \n # Keep track of the audit state to determine where to redirect to\n original_state = audit.audit_state\n \n # Process thechecks passed in.\n params.keys.grep(/^check_/).each do |key|\n\n audit.update_design_check(params[key], @logged_in_user)\n\n if !audit.errors[:comment_required][0].blank?\n flash[params[key][:design_check_id].to_i] = audit.errors[:comment_required][0]\n flash['notice'] = 'Not all checks were updated - please review the form for errors.'\n end\n \n end\n\n if original_state == audit.audit_state\n flash['notice'] = 'Processed design checks.' if !flash['notice']\n redirect_to(:action => 'perform_checks',\n :audit_id => audit.id,\n :subsection_id => subsection_id)\n else\n phase = audit.is_complete? ? 'Peer' : 'Self'\n flash['notice'] = \"The #{phase} audit is complete\"\n redirect_to(:controller => 'tracker', :action => 'index')\n end\n \n end",
"title": ""
},
{
"docid": "b49dc610e05ca44ecf6eea74fc6ff564",
"score": "0.5081084",
"text": "def set_design\n @design = Design.find(params[:id])\n end",
"title": ""
},
{
"docid": "b49dc610e05ca44ecf6eea74fc6ff564",
"score": "0.5081084",
"text": "def set_design\n @design = Design.find(params[:id])\n end",
"title": ""
},
{
"docid": "b49dc610e05ca44ecf6eea74fc6ff564",
"score": "0.5081084",
"text": "def set_design\n @design = Design.find(params[:id])\n end",
"title": ""
},
{
"docid": "b49dc610e05ca44ecf6eea74fc6ff564",
"score": "0.5081084",
"text": "def set_design\n @design = Design.find(params[:id])\n end",
"title": ""
},
{
"docid": "d2fbab3a5c2b005db99d679d0457e165",
"score": "0.5075893",
"text": "def update\n @design = @account.designs.find(params[:id])\n\n respond_to do |format|\n if @design.update_attributes(params[:design])\n format.html { redirect_to([@account, @design]) }\n else\n format.html { render :action => \"edit\" }\n end\n end\n end",
"title": ""
},
{
"docid": "732626eae74c39e2f68b47cd3842457b",
"score": "0.5065896",
"text": "def edit_constraint_by_popup(parent_object, *args)\n return '' unless parent_object.class.name == 'RestParameter'\n \n options = args.extract_options!\n \n # default config options\n options.reverse_merge!(:style => \"\",\n :class => nil,\n :link_text => \"edit\",\n :tooltip_text => \"Edit constrained values\",\n :constraint => nil,\n :rest_method_id => nil)\n \n return '' if options[:rest_method_id].nil?\n \n link_content = ''\n\n method = RestMethod.find(options[:rest_method_id])\n \n if ServiceCatalographer::Auth.allow_user_to_curate_thing?(current_user, parent_object, :rest_method => method)\n inner_html = content_tag(:span, options[:link_text])\n \n fail_value = \"alert('Sorry, an error has occurred.'); RedBox.close();\"\n id_value = \"edit_constrained_options_for_#{parent_object.class.name}_#{parent_object.id}_redbox\"\n\n redbox_hash = {:url => create_url_hash(parent_object, options, \"constrained_options\"), \n :id => id_value, \n :failure => fail_value}\n link_content = link_to_remote_redbox(inner_html, redbox_hash, create_redbox_css_hash(options).merge(:remote => true))\n else\n link_content = content_tag(:span, \n \"You are not allowed to edit the constrained value of this parameter.\", \n :class => \"none_text\", \n :style => \"font-size: 90%;\")\n end\n \n return link_content\n end",
"title": ""
},
{
"docid": "21376220f8a0d642fe845b3fe26ddab4",
"score": "0.5061356",
"text": "def create_preference\n if request.post?\n teacher = Teacher.find(params[:id])\n day_nr = from_dayname_to_id(params[:day])\n teacher_constraint_ids = ConstraintsOwner.find(:all,\n :conditions => [\"constraint_type = 'TemporalConstraint' AND owner_type = 'Teacher' AND owner_id = (?)\", params[:id]],\n :select => ['constraint_id'], :group => 'constraint_id')\n constraints = []\n for id in teacher_constraint_ids do\n if TemporalConstraint.find(id.constraint_id).isHard != 0\n constraints << TemporalConstraint.find(id.constraint_id)\n end\n end\n if constraints.empty?\n preference_value = 1\n else\n preference_value = constraints.size + 1 #conto il numero delle preferenze nel db e metto la giusta priorità a quella nuova\n end\n t = TemporalConstraint.new(:description=>\"Preferenza docente: \" + teacher.name + \" \" + teacher.surname,\n :isHard=>preference_value,:startHour=>params[:start_hour],:endHour=>params[:end_hour],:day=>day_nr)\n @constraint = t\n if t.save\n teacher.constraints << t\n @error_unique = !t.is_unique_constraint?(teacher)\n end\n respond_to do |format|\n format.html { edit_preferences\n render :action => \"edit_preferences\"\n }\n format.js{ edit_preferences }\n end\n end\n end",
"title": ""
},
{
"docid": "c3d5dea46004caa3d64c7b14b232f49d",
"score": "0.504407",
"text": "def change_design_center\n @design_centers = DesignCenter.get_all_active\n @design_review = DesignReview.find(params[:design_review_id])\n end",
"title": ""
},
{
"docid": "ac42cbd7d6934698b9a74f5de65e186e",
"score": "0.5037356",
"text": "def change_design_dir\n @design_dirs = DesignDirectory.get_active_design_directories\n @design_review = DesignReview.find(params[:design_review_id])\n @brd_dsn_entry = BoardDesignEntry.find(:first,\n :conditions => \"design_id='#{@design_review.design_id}'\")\n end",
"title": ""
},
{
"docid": "189eeaaf1f7bd0739b153e72fd2faa32",
"score": "0.5029248",
"text": "def design_modification(user,\n design,\n comment,\n cc_list = [])\n\n if !design.complete?\n design_review = design.get_phase_design_review\n else\n design_review = design.design_reviews.last\n end\n subject = MailerMethods.subject_prefix(design) +\n 'The ' +\n design_review.review_type.name +\n ' design review has been modified by ' +\n user.name\n\n design = design_review.design\n to_list = design_review.active_reviewers.collect { |r| r.email }\n to_list << design.designer.email if design.designer_id > 0\n to_list << design.peer.email if design.peer_id > 0\n to_list << design.input_gate.email if design.pcb_input_id > 0\n to_list.uniq!\n\n cc_list = ( MailerMethods.copy_to(design_review) + cc_list - to_list ).uniq\n\n @user = user\n @comment = comment\n @design_review_id = design_review.id\n\n mail(:to => to_list,\n :subject => subject,\n :cc => cc_list\n )\n end",
"title": ""
},
{
"docid": "d5aac89930881b32c43340dcf9f8a2bf",
"score": "0.50279754",
"text": "def set_design_solution\n @design_solution = DesignSolution.find(params[:id])\n end",
"title": ""
},
{
"docid": "9618edf1b572ce7731369298d2e5c280",
"score": "0.50279516",
"text": "def view_processor_comments\n \n @board_design_entry = BoardDesignEntry.find(params[:id])\n @user_action = params[:user_action]\n\n end",
"title": ""
},
{
"docid": "2ae9fa8001c3acf0f3282b1942acab22",
"score": "0.50267166",
"text": "def collaboration_params\n params.require(:collaboration).permit(:board_id, :user_email)\n end",
"title": ""
},
{
"docid": "fb42cba3633f8c2c2e36229410cf3441",
"score": "0.5023402",
"text": "def update\n \n @design = Design.find(params[:id])\n \n respond_to do |format|\n if @design.update_attributes(params[:design])\n flash[:notice] = 'Design was successfully updated.'\n format.html { redirect_to(@design) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @design.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b6bb70e33cc0233b4862ae280e4eb195",
"score": "0.50162625",
"text": "def constraints; end",
"title": ""
},
{
"docid": "b6bb70e33cc0233b4862ae280e4eb195",
"score": "0.50162625",
"text": "def constraints; end",
"title": ""
},
{
"docid": "b6bb70e33cc0233b4862ae280e4eb195",
"score": "0.50162625",
"text": "def constraints; end",
"title": ""
},
{
"docid": "0c7e751230c2255ebfae77eab4eb2cbc",
"score": "0.50118047",
"text": "def set_interior_design\n @interior_design = InteriorDesign.find(params[:id])\n end",
"title": ""
},
{
"docid": "fd23e779f4c576185ad62bde5e1eebb4",
"score": "0.5008847",
"text": "def edit\n\t\t@designatory = Designatory.find(params[:id])\n\tend",
"title": ""
},
{
"docid": "62fba2877c2d6d8370d2d34b8a86f67c",
"score": "0.49891984",
"text": "def design_params\n params.require(:design).permit(:title, :description, :file)\n end",
"title": ""
},
{
"docid": "d725ec40342b7feb79075cd095413efe",
"score": "0.4978102",
"text": "def constraint\n @constraint\n end",
"title": ""
},
{
"docid": "21a89ecc8bd50b8be1a1016ed852f3a2",
"score": "0.49619076",
"text": "def update\n @design = current_user.designs.find(params[:id])\n\n respond_to do |format|\n if @design.update_attributes(params[:design])\n format.html { redirect_to(@design, :notice => 'Design was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @design.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "70633e05fbe686a4ed142abec6151c87",
"score": "0.49609458",
"text": "def edit_params_setting\n @assignment = Assignment.find(params[:id])\n @num_submissions_round = @assignment.find_due_dates('submission').nil? ? 0 : @assignment.find_due_dates('submission').count\n @num_reviews_round = @assignment.find_due_dates('review').nil? ? 0 : @assignment.find_due_dates('review').count\n\n @topics = SignUpTopic.where(assignment_id: params[:id])\n @assignment_form = AssignmentForm.create_form_object(params[:id])\n @user = current_user\n\n @assignment_questionnaires = AssignmentQuestionnaire.where(assignment_id: params[:id])\n @due_date_all = AssignmentDueDate.where(parent_id: params[:id])\n @reviewvarycheck = false\n @due_date_nameurl_not_empty = false\n @due_date_nameurl_not_empty_checkbox = false\n @metareview_allowed = false\n @metareview_allowed_checkbox = false\n @signup_allowed = false\n @signup_allowed_checkbox = false\n @drop_topic_allowed = false\n @drop_topic_allowed_checkbox = false\n @team_formation_allowed = false\n @team_formation_allowed_checkbox = false\n @participants_count = @assignment_form.assignment.participants.size\n @teams_count = @assignment_form.assignment.teams.size\n end",
"title": ""
},
{
"docid": "370c6ebb95fe88e1dae121a1f4977438",
"score": "0.49608707",
"text": "def set_change_designation\n @change_designation = ChangeDesignation.find(params[:id])\n end",
"title": ""
},
{
"docid": "f9e647cf9d6bdb0a7a6a0153f975e71e",
"score": "0.4958148",
"text": "def process_admin_update\n\n if session['flash'][:sort_order]\n session['flash'][:sort_order] = session['flash'][:sort_order]\n end\n \n # Normally this logic would go in the model. But the admin update\n # screen is designed to prevent the user from designating the same\n # person as both the designer and the peer auditor. There is a remote\n # chance that the user could select the same person for both roles.\n # Since the chance is remote I am dealing with it here.\n # If the audit is skipped or complete, there is no \"peer\" parameter\n if params[:peer] && params[:peer][:id] != \"\" &&\n params[:peer][:id] == params[:designer][:id]\n redirect_to(:action => 'admin_update', :id => params[:id])\n flash['notice'] = 'The peer and the designer must be different - update not recorded'\n return\n end\n \n design = DesignReview.find(params[:id]).design\n\n updates = {}\n if params[:pcb_input_gate]\n updates[:pcb_input_gate] = User.find(params[:pcb_input_gate][:id])\n end\n if params[:designer] && params[:designer][:id] != ''\n updates[:designer] = User.find(params[:designer][:id])\n end\n if params[:peer] && params[:peer][:id] != ''\n updates[:peer] = User.find(params[:peer][:id])\n end\n if params[:review_status]\n updates[:status] = ReviewStatus.find(params[:review_status][:id])\n end\n if params[:release_poster]\n updates[:release_poster] = User.find(params[:release_poster][:id])\n end\n\n updates[:design_center] = DesignCenter.find(params[:design_center][:id])\n updates[:criticality] = Priority.find(params[:priority][:id]) if params[:priority]\n updates[:eco_number] = params[:eco_number]\n updates[:pcba_eco_number] = params[:pcba_eco_number]\n \n flash['notice'] = design.admin_updates(updates,\n params[:post_comment][:comment],\n @logged_in_user)\n \n if session[:return_to]\n redirect_to(session[:return_to])\n else\n redirect_to(:action => \"index\", :controller => \"tracker\" )\n end\n \nend",
"title": ""
},
{
"docid": "54e55b69c40a9f456aeb619eff312bca",
"score": "0.49457076",
"text": "def designer_params\n permit_params\n end",
"title": ""
},
{
"docid": "e32fd4685789bc07ee6a45257d08d503",
"score": "0.4942827",
"text": "def destroy_constraint\n constraint_to_destroy = TemporalConstraint.find(params[:constraint_id])\n constraint_to_destroy.destroy\n respond_to do |format|\n @constraint = constraint_to_destroy\n #necessario per controllo `size` su js\n format.html { edit_constraints\n render :action => \"edit_constraints\"}\n format.js { edit_constraints }\n end\n end",
"title": ""
},
{
"docid": "3f5b42114dafb573c33dfe34de672066",
"score": "0.49336177",
"text": "def view_entry\n \n @board_design_entry = BoardDesignEntry.find(params[:id])\n @return = params[:return]\n @design_review_id = params[:design_review_id]\n @originator = @board_design_entry.user\n @managers = @board_design_entry.manager_roles\n @reviewers = @board_design_entry.reviewer_roles\n\n end",
"title": ""
},
{
"docid": "509dca0c97f0d22bc4b8f8f9958d5323",
"score": "0.49206388",
"text": "def set_form_design\n @form_design = FormDesign.find(params[:id])\n end",
"title": ""
},
{
"docid": "d84f2330e9fec4b3e476a7e60643b968",
"score": "0.49190435",
"text": "def viewschemp_params\n params.require(:view_sch_emp).permit(:id, :employee_id, :duty_date, :worktype_id, :is_holiday )\n end",
"title": ""
},
{
"docid": "54716f1556f07395c780feb6f855d4f9",
"score": "0.49179012",
"text": "def set_entry_type\n @board_design_entry = BoardDesignEntry.find(params[:id])\n end",
"title": ""
},
{
"docid": "ac35e195c25b27fd21c0d10234255806",
"score": "0.4909863",
"text": "def create\n @design = @account.designs.build(params[:design])\n\n respond_to do |format|\n if @design.save\n flash[:notice] = 'Design was successfully created.'\n format.html { redirect_to([@account, @design]) }\n else\n format.html { render :action => \"new\" }\n end\n end\n end",
"title": ""
},
{
"docid": "9bcf69dcd5607e99ee472ab6dc2027a8",
"score": "0.49076107",
"text": "def only_layout_params\n params.require(:only_layout).permit(:name, :age, :qualification, :description)\n end",
"title": ""
},
{
"docid": "cb5990eb4376904fc1a32a2de7f1f88c",
"score": "0.49071458",
"text": "def devison_params\n params.require(:devison).permit(:sec)\n end",
"title": ""
},
{
"docid": "5d3c03eea07f236bbac5ac8685e37770",
"score": "0.4906455",
"text": "def adjust_use_contraints_for_1_3(draft)\n return draft unless draft['UseConstraints']\n\n draft['UseConstraints'] = { 'LicenseText' => draft['UseConstraints'] }\n draft\n end",
"title": ""
},
{
"docid": "e0aabc2d0c1db70497876c8805b0d0e6",
"score": "0.48968053",
"text": "def research_design_params\n params.require(:research_design).permit(:question, :method, :metrics, :participants)\n end",
"title": ""
},
{
"docid": "b50f98691b2d5142a44e6bfd05fc0ceb",
"score": "0.4894751",
"text": "def admin_updates(update, comment, user)\n\n audit= self.audit\n \n changes = {}\n cc_list = []\n set_pcb_input_designer = false\n\n # Update the design reviews\n self.design_reviews.each do |dr|\n\n original_designer = dr.designer\n original_criticality = dr.priority\n original_review_status = dr.review_status.name\n\n next if dr.review_status.name == \"Review Completed\"\n\n if dr.update_criticality(update[:criticality], user)\n changes[:criticality] = { :old => original_criticality.name, \n :new => update[:criticality].name}\n end\n \n if dr.update_review_status(update[:status], user)\n changes[:review_status] = { :old => original_review_status,\n :new => update[:status].name}\n end \n \n\n # If the design review is \"Pre-Artwork\" that is not complete\n # then process any PCB Input Gate change.\n if dr.update_pcb_input_gate(update[:pcb_input_gate], user)\n cc_list << original_designer.email\n cc_list << update[:pcb_input_gate].email if update[:pcb_input_gate].id != 0\n\n changes[:pcb_input_gate] = { :old => original_designer.name, \n :new => update[:pcb_input_gate].name}\n\n set_pcb_input_designer = true\n\n elsif dr.update_release_review_poster(update[:release_poster], user)\n\n cc_list << original_designer.email\n cc_list << update[:release_poster].email if update[:release_poster].id != 0\n changes[:release_poster] = { :old => original_designer.name, \n :new => update[:release_poster].name }\n \n elsif dr.update_reviews_designer_poster(update[:designer], user)\n\n cc_list << dr.designer.email if dr.designer_id != 0\n cc_list << update[:designer].email if update[:designer].id != 0\n changes[:designer] = { :old => original_designer.name, \n :new => update[:designer].name }\n end\n \n dr.reload if changes.size > 0\n\n end\n \n # Update the design.\n cc_list << self.input_gate.email if self.pcb_input_id != 0\n cc_list << self.designer.email if self.designer_id != 0\n if set_pcb_input_designer && \n update[:pcb_input_gate] && \n self.pcb_input_id != update[:pcb_input_gate].id\n self.pcb_input_id = update[:pcb_input_gate].id\n end\n\n old_pcb_path = '/hwnet/' +\n self.design_center.pcb_path + '/' +\n self.directory_name\n old_design_center_name = self.set_design_center(update[:design_center], user)\n if old_design_center_name\n changes[:design_center] = { :old => old_design_center_name,\n :new => update[:design_center].name }\n # call the program to rename assembly folders in the NPI BOM data to reflect the\n # movement of the design.\n new_pcb_path = '/hwnet/' +\n self.design_center.pcb_path + '/' +\n self.directory_name\n PartNum.get_design_pcba_part_numbers(self).each { |pcba|\n cmd = \"/hwnet/dtg_devel/web/boarddev/cgi-bin/npi_boms/rename_assembly_folder.pl\" +\n \" \" + pcba.name_string +\n \" \" + old_pcb_path +\n \" \" + new_pcb_path\n system(cmd) unless Rails.env == \"test\"\n }\n end\n\n if update[:designer] && self.designer_id != update[:designer].id\n self.record_update('Designer', \n self.designer.name,\n update[:designer].name,\n user)\n self.designer_id = update[:designer].id\n end\n\n if update[:criticality] && self.priority_id != update[:criticality].id\n self.priority = update[:criticality] \n end\n\n if update[:eco_number] && self.eco_number != update[:eco_number]\n old_eco_number = self.eco_number\n self.eco_number = update[:eco_number]\n changes[:ecn_number] = { :old => old_eco_number, :new => update[:eco_number]}\n end\n\n if update[:pcba_eco_number] && self.pcba_eco_number != update[:pcba_eco_number]\n old_pcba_eco_number = self.pcba_eco_number\n self.pcba_eco_number = update[:pcba_eco_number]\n changes[:pcba_ecn_number] = { :old => old_pcba_eco_number, :new => update[:pcba_eco_number]}\n end\n \n audit = self.audit\n if update[:peer] && self.peer_id != update[:peer].id \n \n final_design_review = self.get_design_review('Final')\n valor_review_result = final_design_review.get_review_result('Valor')\n \n if valor_review_result.reviewer_id != update[:peer].id\n \n cc_list << valor_review_result.reviewer.email if valor_review_result.reviewer_id != 0\n changes[:valor] = { :old => valor_review_result.reviewer.name,\n :new => update[:peer].name }\n final_design_review.record_update('Valor Reviewer',\n valor_review_result.reviewer.name,\n update[:peer].name,\n user)\n \n valor_review_result.reviewer_id = update[:peer].id\n valor_review_result.save\n \n end\n \n if !audit.skip? && !audit.is_complete?\n changes[:peer] = { :old => self.peer.name, :new => update[:peer].name }\n self.record_update('Peer Auditor', \n self.peer.name, \n update[:peer].name,\n user)\n \n self.peer_id = update[:peer].id\n end\n \n end\n\n \n if changes.size > 0 || comment.size > 0 \n\n self.save\n self.reload\n\n DesignMailer::design_modification(\n user,\n self,\n modification_comment(comment, changes), \n cc_list).deliver\n\n self.pcb_number +\n ' has been updated - the updates were recorded and mail was sent'\n \n else\n \"Nothing was changed - no updates were recorded\"\n end\n\n end",
"title": ""
},
{
"docid": "0cf5f572b30d8aeab26aaddd9fe99b53",
"score": "0.48770684",
"text": "def teacher_preference_priority_down\n constraint_to_move_down = TemporalConstraint.find(params[:constraint_id]) #preferenza di cui cambiare la priorità\n teacher_constraint_ids = ConstraintsOwner.find(:all,\n :conditions => [\"constraint_type = 'TemporalConstraint' AND owner_type = 'Teacher' AND owner_id = (?)\",\n params[:teacher_id]], :group => 'constraint_id')\n constraints = []\n for tc in teacher_constraint_ids do\n if TemporalConstraint.find(tc.constraint_id).isHard != 0\n constraints << TemporalConstraint.find(tc.constraint_id)\n end\n end\n constraints = constraints.sort_by { |c| c[:isHard] }\n max_priority = constraints.size\n if constraint_to_move_down.isHard == max_priority #la preferenza è l'ultima, non devo fare niente\n already_down = true\n else\n already_down = false\n i = constraint_to_move_down.isHard\n c1 = constraints[i-1] #c1 è la preferenza di cui devo diminuire la priorità\n c1.isHard = (constraint_to_move_down.isHard)+1 #imposto il nuovo valore di priorità\n c2 = constraints[i] #c2 è la preferenze di cui devo diminuire la priorità, perchè il suo posto è stato preso da c1\n c2.isHard = (constraint_to_move_down.isHard) #imposto la nuova priorità, il nuovo valore equivale al vecchio + 1\n c1.save\n c2.save\n end\n respond_to do |format|\n @constraint_up = c2\n @constraint_down = c1\n @already_down = already_down\n format.html { edit_preferences\n render :action => \"edit_preferences\"\n }\n format.js{edit_preferences}\n end\n end",
"title": ""
},
{
"docid": "10c27c9de9d526d198354b57714d4929",
"score": "0.4875972",
"text": "def board_design_entry_submission(board_design_entry)\n\n to_list = Role.add_role_members(['PCB Input Gate', 'Manager']).uniq\n cc_list = ([board_design_entry.user.email] - to_list).uniq\n subject = 'The ' +\n board_design_entry.pcb_number +\n ' design entry has been submitted for entry to PCB Design'\n \n\n @board_design_entry = board_design_entry\n @originator = board_design_entry.user\n\n mail( :to => to_list,\n :subject => subject,\n :cc => cc_list\n ) \n end",
"title": ""
},
{
"docid": "be9412ed38efaf06176f3e5304beb961",
"score": "0.48747873",
"text": "def create\n # byebug\n @change_designation = ChangeDesignation.new(change_designation_params)\n @employee = params[:change_designation][:employee_id]\n @effective_from = params[:change_designation][:effective_from].to_date\n @employee_designation_id = params[:change_designation][:employee_designation_id]\n @change = ChangeDesignation.where(employee_id: @employee).last \n ChangeDesignation.where(id: @change).update_all(effective_to: @effective_from,status: false) \n ChangeDesignation.create(employee_id: @change_designation.employee_id,effective_from: @effective_from,employee_designation_id: @change_designation.employee_designation_id,status: true,change_by_id: current_user.employee_id)\n @joining_detail = JoiningDetail.find_by_employee_id(@employee)\n @joining_detail.update(employee_designation_id: @employee_designation_id)\n redirect_to employee_list_change_designations_path\n session[:active_tab] = \"promotionmanagement\"\n end",
"title": ""
},
{
"docid": "638fa0fb7585796f303b315292c88ac3",
"score": "0.48687065",
"text": "def create\n @design = current_user.designs.new(params[:design])\n @project = @design.project\n \n respond_to do |format|\n if @design.save\n format.html { redirect_to(@design.project, :notice => 'Design was successfully created.', :project_id => @design.project_id ) }\n format.xml { render :xml => @design.project, :status => :created, :location => @design }\n else\n format.html { render :action => \"new\", :project_id => @design.project_id }\n format.xml { render :xml => @design.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bb78ac358c02ac5decd07906dacf16a6",
"score": "0.48640943",
"text": "def update\n @design = Design.find(params[:id])\n\n respond_to do |format|\n if @design.update_attributes(params[:design])\n flash[:notice] = 'Design was successfully updated.'\n format.html { redirect_to(@design) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @design.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d1ed295e4d9aa07831648e0791e54ced",
"score": "0.4862079",
"text": "def edit\n @design_detail = DesignDetail.find(params[:id])\n @question = DesignDetail.find(@design_detail.id)\n @fields = @question.get_fields\n @extraction_form = ExtractionForm.find(@design_detail.extraction_form_id)\n @editing=true\n end",
"title": ""
},
{
"docid": "794c18a11a7097ecec1e6cec8e8fc510",
"score": "0.48592404",
"text": "def update\n @design_detail = DesignDetail.find(params[:id])\n @extraction_form = ExtractionForm.find(@design_detail.extraction_form_id) \n if @saved = @design_detail.update_attributes(params[:design_detail])\n unless @design_detail.field_type == \"text\"\n DesignDetailField.save_question_choices(params[:design_detail_choices], @design_detail.id, true,params[:subquestion_text], params[:gets_sub],params[:has_subquestion_design_detail])\n else\n @design_detail.remove_fields\n end\n @model = params[:page_name]\n @question = DesignDetail.find(@design_detail.id)\n @questions = DesignDetail.where(:extraction_form_id=>@extraction_form.id).order(\"question_number ASC\")\n\n else\n problem_html = create_error_message_html(@design_detail.errors)\n flash[:modal_error] = problem_html\n end\n end",
"title": ""
},
{
"docid": "482ee66eeb953438ffd560c28faba1e9",
"score": "0.4858771",
"text": "def board_params\n params.require(:board).permit(:name, :user_id, :marked_private, :fabric_type)\n end",
"title": ""
},
{
"docid": "84564d02b0a09bbec24dc72fdd33a6c8",
"score": "0.48581818",
"text": "def view_originator_comments\n \n @board_design_entry = BoardDesignEntry.find(params[:id])\n @user_action = params[:user_action]\n\n end",
"title": ""
},
{
"docid": "71628129f9cec4917e3f997ed3659305",
"score": "0.48562935",
"text": "def view\n\n session[:return_to] = {:controller => 'design_review',\n :action => 'view',\n :id => params[:id]}\n\n \n if params[:id]\n @is_npp_reviewer = false\n @fir_role_name = Role.get_fir_role.name\n @design_review = DesignReview.find(params[:id])\n design_id = @design_review.design_id\n @brd_dsn_entry = BoardDesignEntry.find(:first,\n :conditions => \"design_id='#{@design_review.design_id}'\")\n @review_results = @design_review.review_results_by_role_name\n\n # Has npp approved any fab houses\n @npp_has_approved_fab_houses = DesignFabHouse.where(design_id: design_id, approved: true).count > 0\n\n if @logged_in_user\n @is_npp_reviewer = @design_review.design.is_role_reviewer?(Role.get_npp_role, @logged_in_user)\n end\n\n if @logged_in_user && @logged_in_user.is_reviewer?\n @my_review_results = []\n @review_results.each do |review_result|\n @my_review_results << review_result if review_result.reviewer_id == @logged_in_user.id\n end\n\n if pre_art_pcb(@design_review, @my_review_results)\n @designers = Role.find_by_name(\"Designer\").active_users\n @priorities = Priority.get_priorities\n else\n @designers = nil\n @priorities = nil\n end\n\n if (@my_review_results.find { |rr| rr.role.name == \"SLM-Vendor\"})\n @design_fab_houses = {}\n @design_review.design.fab_houses.each { |dfh| @design_fab_houses[dfh.id] = dfh }\n \n @fab_houses = FabHouse.get_all_active\n\n #@fab_houses.each { |fh| fh[:selected] = design_fab_houses[fh.id] != nil }\n else\n @fab_houses = nil\n end\n\n end\n \n @review_type = ReviewType.find_by_id(@design_review.review_type_id)\n \n # Get date pre-art review was originally posted\n preart_review_type_id = ReviewType.find_by_name(\"Pre-Artwork\").id\n @preart_des_review_post_date = DesignReview.find_by_design_id_and_review_type_id(design_id, preart_review_type_id).created_on.to_i rescue 0\n \n # Check if design has a pcba (is not bareboard)\n @haspcba = PartNum.find_all_by_design_id_and_use(design_id,\"pcba\").empty? ? false : true\n else\n\n flash['notice'] = \"No ID was provided - unable to access the design review\"\n redirect_to(:controller => 'tracker', :action => 'index')\n\n end\n end",
"title": ""
},
{
"docid": "c9e20d11a65fb243ed6b498462feef99",
"score": "0.4846192",
"text": "def edit\n @design_method = DesignMethod.find(params[:id])\n render :layout => \"custom\"\n end",
"title": ""
},
{
"docid": "0a57976c4ee55588b8336682670732a4",
"score": "0.48403558",
"text": "def edit\n @layout = Roxiware::Layout::Layout.where(:guid=>params[:id]).first\n raise ActiveRecord::RecordNotFound if @layout.nil?\n authorize! :read, @layout\n @params = []\n @param_descriptions = {}\n @layout.get_param_objs.keys.collect{|key| key.to_s}.sort.each do |param_name|\n param = @layout.get_param(param_name)\n @params << param if [\"local\", \"style\"].include?(param.param_class)\n @param_descriptions[param.name] = param.description_guid\n end\n @schemes = {}\n @layout.get_param(\"schemes\").h.each do |scheme_id, scheme|\n large_image_urls = []\n large_image_urls = scheme.h[\"large_images\"].a.each.collect{|image| {:thumbnail=>image.h[\"thumbnail\"].to_s, :full=>image.h[\"full\"].to_s}} if scheme.h[\"large_images\"].present?\n @schemes[scheme_id] = {\n :name=>scheme.h[\"name\"].to_s,\n :thumbnail_image=>scheme.h[\"thumbnail_image\"].to_s,\n :large_images=>large_image_urls,\n :params=>scheme.h[\"params\"].h}\n end\n respond_to do |format|\n format.html { render :partial => \"roxiware/templates/edit_layout_form\" }\n format.xml { render :template=>\"roxiware/templates/export\" }\n end\n end",
"title": ""
},
{
"docid": "0cca08826c5bd7c93b2aed032696d818",
"score": "0.48300993",
"text": "def get_constraints\n sql = %Q{\n select *\n from all_cons_columns a, all_constraints b\n where a.owner = b.owner\n and a.constraint_name = b.constraint_name\n and a.table_name = b.table_name\n and b.table_name = '#{@table}'\n }\n\n begin\n cursor = @connection.exec(sql)\n while rec = cursor.fetch_hash\n @constraints << rec\n end\n ensure\n cursor.close if cursor\n end\n end",
"title": ""
},
{
"docid": "017d8a397ad5401357d7ae883454e149",
"score": "0.48294306",
"text": "def setdesignrationale\n @design = Designrationale.update(params[:id],:pcore => params[:pcore], :pram => params[:pram], :pnic => params[:pnic])\n end",
"title": ""
},
{
"docid": "bc675ec7242d71df57e8e5e991399233",
"score": "0.4825347",
"text": "def update\n respond_to do |format|\n if @design.update(design_params)\n format.html { redirect_to @design, notice: 'Design was successfully updated.' }\n format.json { render :show, status: :ok, location: @design }\n else\n format.html { render :edit }\n format.json { render json: @design.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
14a632b8286b00af18581f14ed27df1b
|
calculate the scaling factor for the given type and sample using sample_size
|
[
{
"docid": "9cb77e3e1d1f64aa44ae2635e819f195",
"score": "0.774777",
"text": "def factor_for type, sample\n case type\n when :const\n sample.to_f\n when :logn\n sample.to_f/Math.log10(@sample_size)\n\n when :n\n sample.to_f/@sample_size\n\n when :nlogn\n sample.to_f/(@sample_size * Math.log10(@sample_size))\n\n when :n_sq\n sample.to_f/(@sample_size * @sample_size)\n end\n end",
"title": ""
}
] |
[
{
"docid": "0e13e310651821e68fcda1116bd94a4b",
"score": "0.61825174",
"text": "def get_scale\n runs = []\n 10.times do\n runs << measure(1, &@options[:fn])\n end\n runs.inject(:+) / 10\n end",
"title": ""
},
{
"docid": "b1cc50b86a5e73105792c1dd05879a20",
"score": "0.6127293",
"text": "def scale!(type, size)\n @transforms << \"#{SCALE_TYPES[type]}#{size}\"\n self\n end",
"title": ""
},
{
"docid": "5d4d29693a3643dae23e99b0b8691cdc",
"score": "0.60407865",
"text": "def rate_scale; end",
"title": ""
},
{
"docid": "6dbd86d437f9fe4d9f5770b189ab7f67",
"score": "0.60165983",
"text": "def scale_factor(point, view)\n\n px_to_length(view)/view.pixels_to_model(1, point)\n\n end",
"title": ""
},
{
"docid": "19b22ed33a28e228565efe0bb6049ce8",
"score": "0.5853123",
"text": "def scale\n raise NotImplementedError, \"Subclass responsibility\"\n end",
"title": ""
},
{
"docid": "5e6e08018dfb40d1b3683ee16ca610a6",
"score": "0.5847707",
"text": "def GetScaleFactor()\n\t\treturn @k;\n\tend",
"title": ""
},
{
"docid": "e52ab70f7e0db892f175f2931e41fc5a",
"score": "0.5800997",
"text": "def extract_scale(sql_type)\n # Money type has a fixed scale of 2.\n sql_type =~ /^money/ ? 2 : super\n end",
"title": ""
},
{
"docid": "18418111cc892a8ae1cb2588faa14e33",
"score": "0.5798108",
"text": "def scaling\n @scaling || 0.0\n end",
"title": ""
},
{
"docid": "ab2206f8e62865e98547f9b4a8e99bf0",
"score": "0.57763463",
"text": "def scale(*args, &block); end",
"title": ""
},
{
"docid": "42782c231c10e10fd178b81e22d6f98d",
"score": "0.57751095",
"text": "def extract_scale(sql_type)\n # Money type has a fixed scale of 2.\n sql_type =~ /^money/ ? 2 : super\n end",
"title": ""
},
{
"docid": "42782c231c10e10fd178b81e22d6f98d",
"score": "0.57751095",
"text": "def extract_scale(sql_type)\n # Money type has a fixed scale of 2.\n sql_type =~ /^money/ ? 2 : super\n end",
"title": ""
},
{
"docid": "737e024087e3343461384669632c7fbe",
"score": "0.57046145",
"text": "def get_size\n\t\t[\"small\", \"medium\", \"large\"].sample\n\tend",
"title": ""
},
{
"docid": "00b9f624e173f5c1d83917483cb48a86",
"score": "0.5695085",
"text": "def scales\n \n end",
"title": ""
},
{
"docid": "ac2282db5fb75391b73fc46a0e8e490a",
"score": "0.5688032",
"text": "def scale\n @data['scale']\n end",
"title": ""
},
{
"docid": "6498d503d8d4f2d63d6d9c95581f310b",
"score": "0.56797975",
"text": "def scale(*amount)\n self.dup.scale! *amount\n end",
"title": ""
},
{
"docid": "ad02c4a817c29b74700bf236b8343fb0",
"score": "0.56491244",
"text": "def scale_up(scale)\n self.side_length *= scale\n end",
"title": ""
},
{
"docid": "6568a4b72df8ce5ef2c05bef9a70b7a5",
"score": "0.5636764",
"text": "def scale factor\n Vector.new factor * @x, factor * @y, factor * @z\n end",
"title": ""
},
{
"docid": "835e126d156d55ee59e1d615d5c191f9",
"score": "0.5627701",
"text": "def scale\n self['scale']\n end",
"title": ""
},
{
"docid": "82bf47703452cc47fe17d0d399850bad",
"score": "0.559202",
"text": "def scale\n root_degree, type = parse_chord @name\n scale_tonic = @key.scale[root_degree - 1]\n scale_mode = CHORDS_TO_SCALES[type]\n SCALES[scale_mode].map{|n| n + scale_tonic}\n end",
"title": ""
},
{
"docid": "fb47fd8522344d348cbf1ff635479614",
"score": "0.55805606",
"text": "def scale_by(width_factor, height_factor, &block)\n squish(width*width_factor, height*height_factor, &block)\n end",
"title": ""
},
{
"docid": "f4e81ff329fb1dc1a2f4c4b049e17cd2",
"score": "0.55631775",
"text": "def scale(name)\n \n end",
"title": ""
},
{
"docid": "d25a35c01b4ede0fb7d8a2d3d51edf6c",
"score": "0.5536037",
"text": "def scaledRand(rand, scale)\n proc {\n rand.call() * scale\n }\nend",
"title": ""
},
{
"docid": "0c91b867e6d26019b3cc6dcecfa52285",
"score": "0.5526775",
"text": "def scale(factor_x, factor_y=factor_x, &rendering_code); end",
"title": ""
},
{
"docid": "042c99b185778e31b168c4f1f5e4524a",
"score": "0.55224025",
"text": "def scale_by_pixels(dimensions)\n out_pixels = sqrt(options[:width] * options[:height]).truncate\n src_pixels = sqrt(dimensions[0] * dimensions[1]).truncate\n out_pixels / src_pixels.to_f\n end",
"title": ""
},
{
"docid": "901ae9417549c765a52e1f47aa06749a",
"score": "0.5520803",
"text": "def scale(value)\n scaled = case value\n when 0..1023\n [value, 'B']\n when 1024..1024**2 - 1\n [value / 1024, 'KB']\n when 1024^2..1024**3 - 1\n [value / 1024**2, 'MB']\n else\n [value / 1024**3, 'GB']\n end\n end",
"title": ""
},
{
"docid": "cf61a3bb6ba51d730b8b92479527ec5d",
"score": "0.55142164",
"text": "def scale(key, value)\n (value - @smallest_seen_values[key]) / (@largest_seen_values[key] - @smallest_seen_values[key])\n end",
"title": ""
},
{
"docid": "11d483d3c6aae3ef25946c5f809012d1",
"score": "0.5492938",
"text": "def rescale\r\n unless self.is_si?\r\n return self.to_base_unit.rescale\r\n end\r\n scale=Math.log10(self.value)+self.unit.scale\r\n\r\n unit_scales=self.class.si_unit_scales.sort\r\n\r\n if scale<unit_scales[0][0]\r\n return self.send unit_scales[0][1].name\r\n end\r\n if scale>=unit_scales.last[0]\r\n return self.send unit_scales.last[1].name\r\n end\r\n unit_scales.each_cons(2) do |us|\r\n if us[0][0]<=scale && us[1][0]>scale\r\n return self.send us[0][1].name\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "2b55abbd3b58619759ef759cf2406590",
"score": "0.5462881",
"text": "def scale_fontsize(value)\n value * @scale\n end",
"title": ""
},
{
"docid": "21e1da713a45d1674d69f711df74f80d",
"score": "0.545749",
"text": "def scale_ratios\n @scales[@scale_id.to_s].map{|p| (p.is_a? String) ? eval(p) : p}\n end",
"title": ""
},
{
"docid": "9c958e942126c4ceb15a8a1829d0220d",
"score": "0.54389155",
"text": "def rate_scale=(_arg0); end",
"title": ""
},
{
"docid": "fa5edeea58d9c4088ebb5a3e9e9207f3",
"score": "0.5425223",
"text": "def calculate_size(a_size)\n\tres = 0\n\tif(a_size == \"small\")\n\t\tres = 1\n\telsif(a_size == \"medium\")\n\t\tres = 2\t\n\telsif(a_size == \"large\")\n\t\tres = 3\t\n\tend\n\tres\n end",
"title": ""
},
{
"docid": "e13796a58d100708bb68b7a5d04b3f0d",
"score": "0.5409173",
"text": "def sample_size\n @n\n end",
"title": ""
},
{
"docid": "69c7bd6f33e00bc5c65212597ddf1d91",
"score": "0.53990823",
"text": "def scale( value )\n ( value - @min ) / ( @max - @min )\n end",
"title": ""
},
{
"docid": "d22613e586ad2ba99f43d3ed878d0ca0",
"score": "0.53930956",
"text": "def scale_variation(opts)\n vector_variation(opts.merge(:attribute => :scale))\n end",
"title": ""
},
{
"docid": "5c7635c9ab3ca49ca829946f47cb7a25",
"score": "0.5377808",
"text": "def set_scale_type\n @scale_type = ScaleType.find(params[:id])\n end",
"title": ""
},
{
"docid": "d16101db066e1b7eb3e411028d5325ac",
"score": "0.53742415",
"text": "def process_scale_input(input)\n process_boolean_input(input, :auto_scale)\n end",
"title": ""
},
{
"docid": "a6f63ed8326090445d35670107a8991c",
"score": "0.5353508",
"text": "def load_factor\n @count.fdiv(size)\n end",
"title": ""
},
{
"docid": "e653387abd9d2ccb2736442c35f5f502",
"score": "0.5350468",
"text": "def scale(example)\n example.length.times do |i|\n # note that if the vector outside training set contains new feature value\n # (and training set contained only one other value) it'll be ignored\n @example_template[i].value = @max_vector[i] == @min_vector[i] ? @max_vector[i]\n : (example[i] - @min_vector[i]).to_f / (@max_vector[i] - @min_vector[i])\n end\n @example_template\n end",
"title": ""
},
{
"docid": "0215a68557aa7cc39d42956b82ff32cf",
"score": "0.534604",
"text": "def normalized_size\n\t\t\ttile_size(max_level) * @unit_size\n\t\tend",
"title": ""
},
{
"docid": "fa19407284827f54ea21cbca5e5df915",
"score": "0.53302217",
"text": "def apply_unit(v, col_scale)\n\t\ta, b = /(.*\\d)\\s*_?\\s*([mnul]{,3})\\s*$/.match(v)[1..2]\n\t\t#raise \"invalid size unit\" unless b\n\t\ts = Dim_Hash[b] || col_scale\n\t\treturn Float(a) * s # may raise exception if a is not a valid float\n\tend",
"title": ""
},
{
"docid": "c448f1902d06d93e4969972352253f34",
"score": "0.5323296",
"text": "def calculate_avg_sample(samples, current_sample_index, sample_width)\n if sample_width > 1\n floats = samples[current_sample_index..(current_sample_index + sample_width - 1)].collect(&:to_f)\n #floats.inject(:+) / sample_width\n channel_rms(floats)\n else\n samples[current_sample_index]\n end\n end",
"title": ""
},
{
"docid": "a744933a948e45cb62b18e77c1ac7fc0",
"score": "0.5318892",
"text": "def transforms( inputs, type ) #:nodoc:\n nsamples = inputs.size\n result = [1.0]\n (nsamples-1).times do\n result << result[-1] / @factor\n end\n range = (1.0..result[-1])\n result = result.map {|v| range.abscissa( v )}\n return result\n end",
"title": ""
},
{
"docid": "f5c028f084b83422401c9427c1764464",
"score": "0.52795917",
"text": "def type_multiplier(atk_type, def_type)\n mul = @el.expr['type_x'][atk_type][type_id(def_type)]\n\n # Handle inverse battles.\n @modes.include?(:inverse) ? 1.0 / (mul.zero? ? 0.5 : mul) : mul\n end",
"title": ""
},
{
"docid": "d01557314bb1e25f347f16a063e956da",
"score": "0.5268594",
"text": "def scale_within(new_size)\n target_size = SugarCube::CoreGraphics::Size(new_size)\n image_size = self.size\n\n if CGSizeEqualToSize(target_size, self.size)\n return self\n end\n\n width = image_size.width\n height = image_size.height\n\n target_width = target_size.width\n target_height = target_size.height\n\n width_factor = target_width / width\n height_factor = target_height / height\n\n if width_factor < height_factor\n scale_factor = width_factor\n else\n scale_factor = height_factor\n end\n\n if scale_factor == 1\n return self\n end\n\n scaled_size = CGSize.new(width * scale_factor, height * scale_factor)\n return scale_to(scaled_size)\n end",
"title": ""
},
{
"docid": "6b4f3a703956b0e0a1b80fc9e71ac989",
"score": "0.52612984",
"text": "def inqscale\n inquiry_int { |pt| super(pt) }\n end",
"title": ""
},
{
"docid": "26d68d260bdee87c77e4ede74fc642c1",
"score": "0.5257223",
"text": "def hscale(factor)\n @width *= factor\n @left *= factor\n self\n end",
"title": ""
},
{
"docid": "803b222b56475f95bf93b0c2ada3e0bb",
"score": "0.5250241",
"text": "def post_sample_size\n 300\n end",
"title": ""
},
{
"docid": "c7429654fbcdb7779ee10294fd59f98e",
"score": "0.5249085",
"text": "def GetImageScale()\n\t\treturn @img_scale;\n\tend",
"title": ""
},
{
"docid": "e8a2c8a78ab711c44dcd7e73f6429fd5",
"score": "0.5247236",
"text": "def scale=(val)\n self['scale'] = val\n end",
"title": ""
},
{
"docid": "f61609b8342cd424097d290d5918c201",
"score": "0.52434283",
"text": "def scale(value)\r\n value * @height/2 + @height/4\r\n end",
"title": ""
},
{
"docid": "8b552d7a9751b88dedb58f7cb69ce2bd",
"score": "0.5231877",
"text": "def scaled_from(source)\n Scale.transform(self).from(source)\n end",
"title": ""
},
{
"docid": "5864766f84120f6c63dad26620174713",
"score": "0.5205334",
"text": "def to_scale(*args)\n Statsample::Vector.new(self, *args)\n end",
"title": ""
},
{
"docid": "489cc70f0d940b5682bfe101470d5d5b",
"score": "0.5199987",
"text": "def scale= scale\n protected_use_method(MM::Scaling, :@scale, scale)\n end",
"title": ""
},
{
"docid": "877bca0fd882fb7bf19f79b6fe7f3618",
"score": "0.51940954",
"text": "def rescale_input(value, source_scaler, dest_scaler)\n if source_scaler\n descaled = source_scaler.descale(value)\n dest_scaler ? dest_scaler.scale(descaled) : descaled\n elsif dest_scaler\n dest_scaler.scale(value)\n end\n end",
"title": ""
},
{
"docid": "c2d64c448d480a4161e97e4194fcb970",
"score": "0.51828444",
"text": "def /(number)\n Measure.new(scale/number.to_f, unit)\n end",
"title": ""
},
{
"docid": "b4960745cb66420485401a940b3df1a9",
"score": "0.5179113",
"text": "def convert_to_measured\n converter = 1\n case self.cost_unit\n when \"tsp\"\n converter = 0.16667 # convert to us_fl_oz \n self.cost_unit = \"us_fl_oz\"\n when \"tbsp\"\n converter = 0.5 # convert to us_fl_oz \n self.cost_unit = \"us_fl_oz\"\n when \"cup\"\n converter = 8 # convert to us_fl_oz \n self.cost_unit = \"us_fl_oz\"\n end\n self.cost_size *= converter\n end",
"title": ""
},
{
"docid": "ba824c253b1a79813b139391045382ed",
"score": "0.51781815",
"text": "def scale_by ratio\n new_steps = self.steps.map do |s| \n step_args = s.techniques.map do |t| \n t.is_a?(Ingredient) ? t.scale_by(ratio) : t\n end\n Step.new step_args\n end\n\n Recipe.new self.metadata, new_steps\n end",
"title": ""
},
{
"docid": "f5d755a2534b264d3291a8740f1872f9",
"score": "0.5175622",
"text": "def scale_to_length(new_length)\n self.scale(new_length / length)\n end",
"title": ""
},
{
"docid": "40512bb3a5e4cf3dc5d4f4c2e6a9fc23",
"score": "0.5165703",
"text": "def scale(factor_x, factor_y, around_x, around_y, &rendering_code); end",
"title": ""
},
{
"docid": "74bdb728304af8887a4500bc7653609e",
"score": "0.51395476",
"text": "def sample_type(sample_type_byte)\n ((sample_type_byte & 0b1000) >> 3).zero? ? 8 : 16\n end",
"title": ""
},
{
"docid": "53ca8eee594b5b0e279f075d0bf632df",
"score": "0.51203156",
"text": "def load_factor\n @count.to_f / size.to_f\n end",
"title": ""
},
{
"docid": "5b1e1bd10cdc1be9369fc11ce0114ac3",
"score": "0.5114654",
"text": "def scale(*args)\n r = Rect.new x, y, w, h\n r.resolution = r.resolution * Vector2[args.singularize]\n r\n end",
"title": ""
},
{
"docid": "5d4a2f084dd0377cd404b527e63b7efc",
"score": "0.50814456",
"text": "def sample_rate\n @format.sample_rate\n end",
"title": ""
},
{
"docid": "516df1ed741fffcba4507fef8a4a2664",
"score": "0.5074093",
"text": "def price_unit_factor\n return 1 if unit_id == price_unit_id\n return pack_size || 1 if price_unit_id == pack_unit_id\n return (pack_size || 1) * (subpack_size || 1) if price_unit_id == subpack_unit_id\n return 1\n end",
"title": ""
},
{
"docid": "b9dec3c2ed53c2cc633332b7cd6e2b86",
"score": "0.50732756",
"text": "def sample_variance\n avg = mean\n sum = inject(0){|acc,i|acc +(i-avg)**2}\n sum.to_f/size\n end",
"title": ""
},
{
"docid": "f571901e4299e7a9aafb7aab7578ae8f",
"score": "0.5044624",
"text": "def bits_per_sample\n @format.bits_per_sample\n end",
"title": ""
},
{
"docid": "397018ca1efb5141930b448fa5332827",
"score": "0.50380254",
"text": "def pattern_size_multiplier(pattern_size)\n case pattern_size\n when :full\n 1\n when :half\n 2\n when :pada\n 4\n end\n end",
"title": ""
},
{
"docid": "c8802d13991080e98dbbcc61908dcf36",
"score": "0.50308764",
"text": "def scale_by ratio, units=self.units\n scaled = Hash.new\n self.info.each do |k, v|\n scaled[k] = v\n scaled[k] = v*ratio if k == :quantity\n end\n Ingredient.new(self.name, scaled)\n end",
"title": ""
},
{
"docid": "e9ed64d9079dc5ab2698fb65baa20967",
"score": "0.5030406",
"text": "def *(other)\n scaled_parts = @parts.map do |unit, amount|\n scaled = amount * other\n scaled = scaled.to_i if scaled.is_a? Float and scaled == scaled.to_i.to_f\n [unit, scaled]\n end\n Size.new((value * other).round, scaled_parts)\n end",
"title": ""
},
{
"docid": "f338937b839f84ce5dbb863fcd88e41c",
"score": "0.50276387",
"text": "def scale(w, h, method = :bilinear)\n @image.send(\"resample_#{method}!\", w, h)\n self\n end",
"title": ""
},
{
"docid": "7604090c4841d7b42d543efb3361f36f",
"score": "0.5025357",
"text": "def scale(factor)\n Point.new(self.x * factor, self.y * factor)\n end",
"title": ""
},
{
"docid": "cc81cdacccfb1b978cac5485f83f1865",
"score": "0.5024903",
"text": "def load_factor\n @item_count / size.to_f\n end",
"title": ""
},
{
"docid": "3616ea0e3f87826c1989a9c29bb044ab",
"score": "0.5013191",
"text": "def volume_weight(dimension: nil)\n factor = 5000\n volume_weight = Float((dimension.length * dimension.width * dimension.height)) / Float(factor)\n\n return volume_weight\n end",
"title": ""
},
{
"docid": "9844f927e211bca5ed3dec09499757a2",
"score": "0.50004774",
"text": "def scaled_point\n val = self.class.base.new(@value * self.class.size)\n val.kind_of?(ScaledPoint) ? val : val.scaled_point\n end",
"title": ""
},
{
"docid": "e0975dade6cd5a0086ec1283cdb1d7bd",
"score": "0.49977168",
"text": "def setscale(*)\n super\n end",
"title": ""
},
{
"docid": "7a9dee42ffaf67a695cbdf49091cbb7f",
"score": "0.49975964",
"text": "def calscale\n calscale_property ? calscale_property.ruby_value : nil\n end",
"title": ""
},
{
"docid": "3eeb004381361690465aefef9fb8e2e9",
"score": "0.49870855",
"text": "def normalize_single_size(input_size, ref_size:)\n if input_size % ref_size == 0\n input_size\n else\n ((input_size / ref_size) + 1) * ref_size\n end\n end",
"title": ""
},
{
"docid": "8c796b688e45d264b739f4d38a42259c",
"score": "0.49850968",
"text": "def calcTier(length, height, width)\n\t\t\t((length.to_f * height.to_f * width.to_f)/1728.0).round(4)\n\t\tend",
"title": ""
},
{
"docid": "af0caf6325846e7e077703ca1853c5b3",
"score": "0.49837783",
"text": "def sample_type\n ExtendedModule::Helpers.sample_type(type)\n end",
"title": ""
},
{
"docid": "90270b1de3ab47f2e82aeacc645cdc69",
"score": "0.49786887",
"text": "def set_sample_type\n @sample_type = SampleType.find(params[:id])\n end",
"title": ""
},
{
"docid": "ab48becc083d6ca72d4d6800b15b96d3",
"score": "0.49615705",
"text": "def get_scaled_size(image, width_bound, height_bound)\n width_multiplier = 1.0 * width_bound / image.columns\n height_multiplier = 1.0 * height_bound / image.rows\n\n if image.rows * width_multiplier <= height_bound\n width_multiplier\n else\n height_multiplier\n end\n end",
"title": ""
},
{
"docid": "ce03289c1f44838b8149bcf78871c02f",
"score": "0.49590236",
"text": "def load_factor\n @entry_count / @size\n end",
"title": ""
},
{
"docid": "4e2b6db196f9e1cc5e27b29d7a4a28f4",
"score": "0.4958189",
"text": "def load_factor\n Float(@num_items) / size\n end",
"title": ""
},
{
"docid": "3c750b1a0516c2a782075241fa709eda",
"score": "0.49574077",
"text": "def proportion_sd_kp_wr(p, n_sample)\n Math::sqrt(p*(1-p).quo(n_sample))\n end",
"title": ""
},
{
"docid": "26ed9095d56ad7a538790e65fd0cd830",
"score": "0.49565804",
"text": "def scaled_using(source, destination)\n Scale.transform(self).using(source, destination)\n end",
"title": ""
},
{
"docid": "c4be9c318058db4e064e71a7a83e0544",
"score": "0.4947141",
"text": "def size\n case\n when @count < 1000 then 'tiny'\n when @count < 2000 then 'small'\n when @count < 3000 then 'medium'\n when @count < 4000 then 'large'\n when @count < 5000 then 'hefty'\n else 'massive'\n end\n end",
"title": ""
},
{
"docid": "8831bb91801ce134e87c0446a7e78237",
"score": "0.49347302",
"text": "def display_size\n # (1.9 ** @magnitude) / 3.0 + 2.5\n (2.15 ** @magnitude) / 3.6 + 2.5\n end",
"title": ""
},
{
"docid": "6ae5b030c973c20a3d2126fb81f59fae",
"score": "0.49306118",
"text": "def sample_rate\n @values.fetch('sampleRate') { \n @values['sampleRate'] = 100.0\n }\n end",
"title": ""
},
{
"docid": "a7d162209b3d10f144b57926f58abb60",
"score": "0.4917849",
"text": "def img_size(image_size, new_size)\n decrease = new_size.fdiv(image_size)\n return decrease\nend",
"title": ""
},
{
"docid": "6b339ff49577bd0b4ac99026cca85791",
"score": "0.4917836",
"text": "def size\n\n @population_density/50\n\n mod_factor = 0.0\n if @population_density >= 200\n mod_factor = 4.0\n elsif @population_density >= 150\n mod_factor = 3.0\n elsif @population_density >= 100\n mod_factor = 2.0\n elsif @population_density >= 50\n mod_factor = 1.0\n else\n mod_factor = 0.5\n end\n return mod_factor\n end",
"title": ""
},
{
"docid": "43c70930d64e1b3c6e7b35baf3071854",
"score": "0.49171272",
"text": "def sample_std_dev\n # even though Math.sqrt doesn't operate on arbitrary precision numbers, we'll use it anyway\n Math.sqrt(sample_variance)\n end",
"title": ""
},
{
"docid": "513bda17d4cc50ea7a67d4da786c1b55",
"score": "0.49155638",
"text": "def load_factor\n @item_count/ size\n end",
"title": ""
},
{
"docid": "3579a7f67f22d0ba66a41d89c9e85ba6",
"score": "0.4914207",
"text": "def calcTier(length, height, width)\n\t\treturn ((length.to_f * height.to_f * width.to_f)/1728.0).round(4)\n\tend",
"title": ""
},
{
"docid": "296fdcdcb16fec42840228233f609b8a",
"score": "0.49100628",
"text": "def dynamic_resize_to_fit(size)\n resize_to_fit *(model.class::IMAGE_CONFIG[size])\n end",
"title": ""
},
{
"docid": "3e13b4a14d7a6a7b50f5dbb732e86d07",
"score": "0.49023578",
"text": "def level_size level\n\t\t\t@unit_size * tile_size(level)\n\t\tend",
"title": ""
},
{
"docid": "373aaf0dcdc45104384db6985f090560",
"score": "0.4901088",
"text": "def sample_variance\n return 0 if length <= 1\n sum_of_squares / (length - 1)\n end",
"title": ""
},
{
"docid": "e103ea1fb1a087ac91a688c9e85cc5e8",
"score": "0.48983815",
"text": "def to_pixel_per_meter(**options) = convert_to('pixel-per-meter', **options)",
"title": ""
},
{
"docid": "9b30a8c82efa50e51bc266049ba54868",
"score": "0.48967463",
"text": "def calc_type_n_multiplier(target, type_to_check)\n user_type = target.send(type_to_check)\n result = GameData::Type[user_type].hit_by(type)\n @effectiveness *= result\n return result\n end",
"title": ""
},
{
"docid": "5187613daf033df1afd58c4b1110ca0d",
"score": "0.48952645",
"text": "def dam_samples(type)\n if type == :group\n self.group_damage_samples\n elsif type == :elem\n self.damage_samples\n end\n end",
"title": ""
},
{
"docid": "b291ae2a807f974b5711190634b45f46",
"score": "0.48936927",
"text": "def valid_sample_size?(sample_size=nil)\n return true if sample_size.nil?\n normalized = sample_size.to_s.strip.downcase\n return true if normalized.empty?\n return true if normalized == 'all'\n return true if normalized =~ SAMPLE_PROPORTION_REGEX\n\n return false\nend",
"title": ""
}
] |
6b9efd8b267d3722820973e600c4524f
|
Returns an instance of the Doorkeeper::AccessToken with specific token value.
|
[
{
"docid": "02fa8d771be4195ce5f2acf17fbbbde1",
"score": "0.0",
"text": "def by_refresh_token(refresh_token)\n token_accessor = Doorkeeper.configuration.token_accessor.constantize\n token_accessor.get_by_refresh_token(refresh_token)\n end",
"title": ""
}
] |
[
{
"docid": "6646633a920f57b735143c0a9d9a9e20",
"score": "0.72229254",
"text": "def access_token\n @access_token ||= OAuth2::AccessToken.new(client, token)\n end",
"title": ""
},
{
"docid": "6646633a920f57b735143c0a9d9a9e20",
"score": "0.72229254",
"text": "def access_token\n @access_token ||= OAuth2::AccessToken.new(client, token)\n end",
"title": ""
},
{
"docid": "07685c9ad18ebb0da8584b126d1d8a46",
"score": "0.71861064",
"text": "def get_access_token_from_token(token, params={})\n params.stringify_keys!\n access_token = ::OAuth2::AccessToken.new(client, token, params)\n Bitlyr::Strategy::AccessToken.new(access_token)\n end",
"title": ""
},
{
"docid": "96d52c176562b3d3deb5a21d3b98a9d1",
"score": "0.71332866",
"text": "def access_token(application, user)\n ::Doorkeeper::AccessToken.find_or_create_for(\n application,\n user.id,\n ::Doorkeeper.configuration.default_scopes,\n ::Doorkeeper.configuration.access_token_expires_in,\n true\n )\n end",
"title": ""
},
{
"docid": "96d52c176562b3d3deb5a21d3b98a9d1",
"score": "0.71332866",
"text": "def access_token(application, user)\n ::Doorkeeper::AccessToken.find_or_create_for(\n application,\n user.id,\n ::Doorkeeper.configuration.default_scopes,\n ::Doorkeeper.configuration.access_token_expires_in,\n true\n )\n end",
"title": ""
},
{
"docid": "c92a877150230e84a12f00e2843196a8",
"score": "0.69201934",
"text": "def access_token\n @access_token ||= AccessToken.new(self)\n end",
"title": ""
},
{
"docid": "d5fce1fbb43097888abc9394f3c634dd",
"score": "0.69002056",
"text": "def token\n @access_token = new_access_token unless @access_token&.valid?\n @access_token.token\n end",
"title": ""
},
{
"docid": "939e4ec4545e9198cdc40cf92deba5a7",
"score": "0.68712866",
"text": "def access_token\n ::OAuth::AccessToken.new(consumer, @atoken, @asecret)\n end",
"title": ""
},
{
"docid": "90d0cf6c688da0b6477fa563e95ad793",
"score": "0.6815615",
"text": "def access_token!(*args)\n token = super\n AccessToken.new token.access_token, refresh_token: token.refresh_token, scope: token.scope, expires_in: token.expires_in\n end",
"title": ""
},
{
"docid": "94d527a7b0dbdab5a3ba1659b698724b",
"score": "0.68131226",
"text": "def get_access_token(token)\n database.view(AccessToken.by_token(token)).first\n end",
"title": ""
},
{
"docid": "22dc4e4a417d600d9efd03ab3bce239e",
"score": "0.68085545",
"text": "def access_token\n access_tokens.where(application_id: System.default_app.id,\n revoked_at: nil).where('date_add(created_at,interval expires_in second) > ?', Time.now.utc).\n order('created_at desc').\n limit(1).\n first || generate_access_token\n end",
"title": ""
},
{
"docid": "aabbac07c5fe7ffe8491ba29f9a23be6",
"score": "0.679333",
"text": "def access_token\n @access_token ||= OAuth::AccessToken.new server.consumer, token, secret if server\n end",
"title": ""
},
{
"docid": "dd99bb1e761981a1eb2acb92ce647b1a",
"score": "0.6789457",
"text": "def access_token()\n AquaIo::Api::AccessToken.new(@http_client)\n end",
"title": ""
},
{
"docid": "1a68365dc87130b63d20cbc8e9615eda",
"score": "0.6789404",
"text": "def token\n reset_token if expired?\n access_token\n end",
"title": ""
},
{
"docid": "52279ec64905e3b1a0b373504681e560",
"score": "0.67853695",
"text": "def access_token\n access_tokens.where(application_id: Settings.default_app.id,\n revoked_at: nil).where('date_add(created_at,interval expires_in second) > ?', Time.now.utc).\n order('created_at desc').\n limit(1).\n first || generate_access_token\n end",
"title": ""
},
{
"docid": "52279ec64905e3b1a0b373504681e560",
"score": "0.67853695",
"text": "def access_token\n access_tokens.where(application_id: Settings.default_app.id,\n revoked_at: nil).where('date_add(created_at,interval expires_in second) > ?', Time.now.utc).\n order('created_at desc').\n limit(1).\n first || generate_access_token\n end",
"title": ""
},
{
"docid": "bbfc218f9278dab2e0f40a51be3a4d9c",
"score": "0.6773597",
"text": "def access_token\n return @access_token if defined?(@access_token) && @access_token\n\n client = OAuth2::Client.new(@config.client_id,\n @config.client_secret, client_options)\n @access_token = OAuth2::AccessToken.new(\n client, @token,\n refresh_token: @config.refresh_token,\n expires_at: @config.token_expires_at\n )\n end",
"title": ""
},
{
"docid": "a3e23756003e5a427e1c9846de7d61e6",
"score": "0.67493236",
"text": "def token\n @token ||= OAuth2::AccessToken.new(\n resource_server.client,\n access_token,\n :refresh_token => refresh_token,\n :expires_in => expires_in,\n :adapter => LygneoClient.which_faraday_adapter?\n )\n end",
"title": ""
},
{
"docid": "ccbc70429e74537dc145f7b1fcc3e17b",
"score": "0.6737917",
"text": "def token\n (@token ||= fetch_access_token)[\"access_token\"]\n end",
"title": ""
},
{
"docid": "3f7ec03bce9958cb9b7b3393d471c9b3",
"score": "0.6725266",
"text": "def token\n @token ||= OAuth2::AccessToken.new(resource_server.client, access_token, refresh_token, expires_in, :adapter => DiasporaClient.which_faraday_adapter?)\n end",
"title": ""
},
{
"docid": "d5f9ce5872e39c711277b397dd05f556",
"score": "0.66947025",
"text": "def access_token(token = nil, secret = nil)\n if token && secret\n self.access_token = OAuth::AccessToken.new(self.consumer, token, secret)\n else\n @access_token\n end\n end",
"title": ""
},
{
"docid": "3fd63aa509f848d386d99efca9b5357b",
"score": "0.66501033",
"text": "def oauth_access_token(provider, token)\n oauth_configs[provider].access_token_by_token(token)\n end",
"title": ""
},
{
"docid": "758d49bf63926132efa9927f3e7abbba",
"score": "0.66448104",
"text": "def token\n @access_token.token\n end",
"title": ""
},
{
"docid": "af40df5c7e96690af43bfc1abb42b893",
"score": "0.66355205",
"text": "def token\n return @token if @token\n\n payload = {\n client_id: @client_id,\n grant_type: 'client_credentials',\n scope: 'client'\n }\n headers = {\n 'Accept' => 'application/json',\n 'Authorization' => \"Basic #{encoded_credentials}\",\n 'Content-Type' => 'application/x-www-form-urlencoded',\n 'Host' => uri.host,\n 'User-Agent' => 'PeopleDoc::V2::Client'\n }\n\n response = @request.post(headers, 'api/v2/client/tokens', payload)\n\n @token = Token.new(\n *response.values_at('access_token', 'token_type', 'expires_in')\n )\n end",
"title": ""
},
{
"docid": "619919a61c6e54b2b495c9d9a55d3193",
"score": "0.66347164",
"text": "def token\n consumer = OAuth::Consumer.new(\n DESK[:api_key],\n DESK[:api_secret],\n :site => DESK[:site],\n :scheme => :header)\n\n return OAuth::AccessToken.from_hash(\n consumer,\n :oauth_token => DESK[:access_token],\n :oauth_token_secret => DESK[:access_token_secret])\n end",
"title": ""
},
{
"docid": "592df66964ed03d8e18ebb436b0cf6b2",
"score": "0.66210306",
"text": "def token\n unless @token\n options = {\"grant_type\" => \"client_credentials\", \"client_id\" => @client_id, \"client_secret\" => @client_secret}\n response = self.class.post(\"/v1/oauth2/token\", :body => options)\n \n @token = response[\"access_token\"]\n end\n @token\n end",
"title": ""
},
{
"docid": "502841c8506d784a6f28b0aa623c0fe6",
"score": "0.658523",
"text": "def access_token\n if session[:access_token]\n @access_token ||= OAuth2::AccessToken.new(oauth_client, session[:access_token])\n end\n end",
"title": ""
},
{
"docid": "502841c8506d784a6f28b0aa623c0fe6",
"score": "0.658523",
"text": "def access_token\n if session[:access_token]\n @access_token ||= OAuth2::AccessToken.new(oauth_client, session[:access_token])\n end\n end",
"title": ""
},
{
"docid": "3777f8fcb77bbdd20e681bb8fe531f1b",
"score": "0.65765566",
"text": "def token\n (@access_token || @request_token).token\n end",
"title": ""
},
{
"docid": "a1e5b3ee81421d45c0e906ad65f0c469",
"score": "0.6574538",
"text": "def set_access_token_from_token!(token, params={})\n @access_token ||= get_access_token_from_token(token, params)\n end",
"title": ""
},
{
"docid": "e4a2eaca22fbcc46eab8b167e8f6743a",
"score": "0.65579087",
"text": "def access_token_for(*)\n ENV['ACCESS_TOKEN']\n end",
"title": ""
},
{
"docid": "8f98005ad2f2cb9e53ec5dde0852b0a9",
"score": "0.6557428",
"text": "def create_token access_token: nil\n auth_token = ::AuthToken.new\n auth_token.auth_method = self\n auth_token.user = user\n auth_token.last_used_at = Time.now.utc\n\n if auth_token.respond_to? :access_token=\n auth_token.access_token = access_token\n end\n\n auth_token.save\n auth_token\n end",
"title": ""
},
{
"docid": "8673f7e192c0b8f6ff867fc203e2da1f",
"score": "0.6545567",
"text": "def application_access_token\n @application_access_token ||= establish(:grant_type => 'client_credentials')[:access_token]\n end",
"title": ""
},
{
"docid": "b3fe77d9b87f6bf1fe6040906dae643a",
"score": "0.65314555",
"text": "def expose_to_bearer_token(token)\n Rack::OAuth2::AccessToken::Bearer.new(token.to_bearer_token)\n end",
"title": ""
},
{
"docid": "4c0ee4885892604715a20a8e31ac7f6e",
"score": "0.65216273",
"text": "def access_token\n @access_token ||= OAuth::AccessToken.from_hash(consumer, oauth_token_hash )\n end",
"title": ""
},
{
"docid": "42d886d9790cc2592a90142686558b1a",
"score": "0.6514457",
"text": "def create_access_token(token, secret)\n consumer = build_OAuth_consumer\n OAuth::AccessToken.new(consumer, token, secret)\n end",
"title": ""
},
{
"docid": "b4dd7d745e98f397c882689be087c60b",
"score": "0.6498331",
"text": "def token\n @token ||= begin\n Token.new(encoded: authorization_token)\n end\n end",
"title": ""
},
{
"docid": "03ecab90d6de213d5542299b86735f7e",
"score": "0.6497354",
"text": "def access_token\n @access_token ||= begin\n response = basic_auth_connection.get(ENV[\"NOVA_ACCESS_TOKEN_PATH\"])\n json_response = parse_body_and_check_for_errors(response)\n json_response[\"accessToken\"]\n end\n end",
"title": ""
},
{
"docid": "d93ca4365450d352e5b2b402d8a28683",
"score": "0.6495573",
"text": "def get_token\n return Token.new(@value)\n end",
"title": ""
},
{
"docid": "f1ee7eec5bf0291f17b18a486ee62edd",
"score": "0.6469231",
"text": "def access_token\n credentials['token']\n end",
"title": ""
},
{
"docid": "f1ee7eec5bf0291f17b18a486ee62edd",
"score": "0.6469231",
"text": "def access_token\n credentials['token']\n end",
"title": ""
},
{
"docid": "20938fa4b544333f142e60dc910cf745",
"score": "0.6462647",
"text": "def access_token\n return @access_token unless @access_token.nil?\n case @auth_method\n when :client_credentials\n auth_client_credentials\n else\n raise \"Unknown auth_method: #{@auth_method}\"\n end\n end",
"title": ""
},
{
"docid": "61122c38a0966ce80701050b361f2f98",
"score": "0.6454523",
"text": "def token\n self[:access_token]\n end",
"title": ""
},
{
"docid": "cfcaccaf53daf6444341b196ba25f126",
"score": "0.64522856",
"text": "def access_token\n if @expires_in && Time.now < @expires_in\n @access_token\n else\n response = HTTParty.post(MS_ACCESS_TOKEN_URI, body: @credentials)\n if response.code == 200\n @expires_in = Time.now + ( response['expires_in'].to_i )\n @access_token = response['access_token']\n else\n false\n end\n end\n end",
"title": ""
},
{
"docid": "f30219f3c1455a92e74b0901e6c8311b",
"score": "0.6452027",
"text": "def access_token\n if session[:oauth_token] && session[:oauth_secret]\n @access_token ||= OAuth::AccessToken.new(\n consumer, \n session[:oauth_token], \n session[:oauth_secret]\n )\n end\n end",
"title": ""
},
{
"docid": "9fe20d0330c1a35f1fd113972cb5978a",
"score": "0.6450759",
"text": "def access_token\n @access_token ||= OAuth::AccessToken.from_hash(consumer,\n :oauth_token => session[:access_token],\n :oauth_token_secret => session[:access_token_secret])\n end",
"title": ""
},
{
"docid": "b88c28385706287c045f395da9a7420c",
"score": "0.64496976",
"text": "def new_access_token\n headers = { accept: :json, params: { grant_type: 'client_credentials', appid: appid, secret: secret } }\n resp_body = JSON.parse(RestClient::Request.execute(method: :get, url: \"#{url}/security/accesstoken\",\n headers: headers))\n if resp_body['error_code'].to_i != 0\n raise AccessTokenError, \"get access token returned #{resp_body}\"\n end\n\n token_expires_at = Time.now + resp_body['expires_in'].to_i\n token = resp_body['access_token']\n\n self.expires_at = token_expires_at\n self.token = token\n\n logger.debug \"received new token #{self}\"\n rescue => e\n raise AccessTokenError, \"got exception #{e.class}:#{e.message}\"\n end",
"title": ""
},
{
"docid": "0749f911849f5ec9c030058ec78b366a",
"score": "0.6449347",
"text": "def access_token\n oauth_config = YAML.load_file('config/oauth.yml')[Rails.env]\n oauth_consumer = OAuth::Consumer.new oauth_config['consumer_key'],\n oauth_config['consumer_secret'], { :site => oauth_config['site'] }\n OAuth::AccessToken.new(oauth_consumer, oauth_token, oauth_secret)\n end",
"title": ""
},
{
"docid": "50a896595b8723cc9fe44419a2933800",
"score": "0.6448435",
"text": "def access_token\n config['token']\n end",
"title": ""
},
{
"docid": "24587279b4097ac17a0257dd6a20a272",
"score": "0.6445677",
"text": "def access_token\n @access_token ||= prepare_access_token\n end",
"title": ""
},
{
"docid": "18fe46b75a33ca61751661fe2b97381c",
"score": "0.6442503",
"text": "def get_access_token_from_hash token, opts={}\n @access_token = OAuth2::AccessToken.new(@oauth_client, token, opts)\n end",
"title": ""
},
{
"docid": "e3a49a6c49038abe8643b3eb11fc2d64",
"score": "0.64408267",
"text": "def custom_build_access_token\n verifier = request.params['authorization_code']\n client.auth_code.get_token(verifier, { :secret => options.client_secret })\n end",
"title": ""
},
{
"docid": "4c679224c7136aa34ac17abbdbbc6a3d",
"score": "0.64293104",
"text": "def access_token\n @access_token ||= ::OAuth::AccessToken.new(\n consumer,\n @oauth_token,\n @oauth_token_secret\n ) if @oauth_token && @oauth_token_secret\n end",
"title": ""
},
{
"docid": "cfda4c45d7a6ebc6e0e46e1b1f0130e3",
"score": "0.64283025",
"text": "def get_access_token\n Setup.new(credentials).get_access_token\n end",
"title": ""
},
{
"docid": "1ea01613393a7546ecc3313b8fa46969",
"score": "0.6425146",
"text": "def fetch_access_token auth_token, auth_token_secret, auth_verifier\n request_token = OAuth::RequestToken.new(oauth_consumer, auth_token, auth_token_secret)\n access_token = request_token.get_access_token(:oauth_verifier => auth_verifier)\n access_token\n end",
"title": ""
},
{
"docid": "4b685d6b07395b0fccecad9ad91a3ae9",
"score": "0.6419188",
"text": "def obtain_access_token(request_token)\n res = @http.post_form('/v3/oauth/authorize', {\n consumer_key: @consumer_key,\n code: request_token,\n })\n\n if res.success?\n ResAccessToken.new(res, {\n access_token: res.form['access_token'],\n username: res.form['username'],\n })\n else\n return_err(res)\n end\n end",
"title": ""
},
{
"docid": "3fe221414b1ebd3884afce09da204eea",
"score": "0.6417536",
"text": "def access_token(token)\n get(\"/oauth2/accesstokens/#{token}\")\n end",
"title": ""
},
{
"docid": "454d1f16ce03500f905ce6bcea1a20c9",
"score": "0.64119333",
"text": "def identify(token)\n access_token = AccessToken.where(key: token).where(Sequel.lit('expires_at > :current_time', current_time: Time.now)).first\n raise ModelException.new('Access Token não encontrado.', 404) unless access_token\n\n access_token\n end",
"title": ""
},
{
"docid": "d18fd8dc2151e15b8ee0437cfe4d68c6",
"score": "0.6410674",
"text": "def get_token(code, access_token_class = ::OAuth2::AccessToken)\n opts = {:raise_errors => client.options[:raise_errors], :parse => true}\n query_params = {\n code: code,\n grant_type: \"authorization_code\"\n }\n headers = {\n \"Authorization\" => \"Basic \" + Base64.strict_encode64(\"#{options.client_id}:#{options.client_secret}\")\n }\n opts = {\n :body => \"\",\n :headers => headers,\n :params => query_params\n }\n response = client.request(:post, client.token_url, opts)\n error = ::OAuth2::Error.new(response)\n raise(error) if client.options[:raise_errors] && !(response.parsed.is_a?(Hash) && response.parsed['access_token'])\n\n parsed_response = response.parsed\n parsed_response[\"expires_in\"] = parsed_response[\"access_token_expires_in\"]\n token = access_token_class.from_hash(client, parsed_response)\n return token\n end",
"title": ""
},
{
"docid": "bb1e9997fc5c29748e73b19ff8294b78",
"score": "0.6404609",
"text": "def get_access_token\n begin\n get_access_token!\n rescue Excon::Errors::Unauthorized, Excon::Errors::BadRequest\n @credentials.update_tokens(nil, nil)\n end\n @credentials.access_token\n end",
"title": ""
},
{
"docid": "1a248cd6402a51eb5c2e8f9cb0c253cf",
"score": "0.63909155",
"text": "def get_access_token_from_hash(token, opts = {})\n @access_token = OAuth2::AccessToken.new(oauth_client, token, opts)\n end",
"title": ""
},
{
"docid": "b9b39a78c6abb48ae929116326289051",
"score": "0.6388225",
"text": "def bearer_token\n @tokens ||= {}\n token = @tokens[cache_key] ||= access_token\n token = @tokens[cache_key] = access_token if token.expired?\n token.token\n end",
"title": ""
},
{
"docid": "6e45455ff3c05a49a4335c51ac9e702a",
"score": "0.6383134",
"text": "def get_access_token\r\n\t\treturn @credentials.get_access_token\r\n\tend",
"title": ""
},
{
"docid": "88cfde68fe6561773be6f5dba430731b",
"score": "0.63777417",
"text": "def access_token\n @access_token || config.access_token\n end",
"title": ""
},
{
"docid": "3c74bb010b5aae8e3225114809c2e81f",
"score": "0.63739014",
"text": "def token(scope = 'payment-create')\n response = RestClient.post(\n \"#{@config[:gate]}/api/oauth2/token\",\n { grant_type: 'client_credentials',\n scope: scope,\n },\n {\n \"Accept\" => \"application/json\",\n \"Content-Type\" => \"application/x-www-form-urlencoded\",\n \"Authorization\" => \"Basic #{Base64.encode64(@config[:client_id] + ':' + @config[:client_secret])}\"\n })\n JSON.parse(response.body)[\"access_token\"]\n end",
"title": ""
},
{
"docid": "dcc369038f59d8eeda06b89e4f662ded",
"score": "0.63701284",
"text": "def access_token(user = nil)\n\t\tif user.nil?\n\t\t\tif logged_in?\n\t\t\t\tOAuth::AccessToken.new(get_consumer, current_user.token, current_user.secret)\n\t\t\tend\n\t\telse\n\t\t\t# you can specify your own user object\n\t\t\tOAuth::AccessToken.new(get_consumer, user.token, user.secret)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "99a9bf93c8e38f7b65d2dc9b16e3397c",
"score": "0.6365721",
"text": "def fetch_access_token\n if is_token_expired\n assertion = sign_assertion\n post_body = {\n 'assertion' => assertion,\n 'grant_type' => 'urn:ietf:params:oauth:grant-type:jwt-bearer'}\n headers = {'Content-type' => 'application/x-www-form-urlencoded'}\n response = @connection.post(RpcHelper::TOKEN_ENDPOINT, post_body,\n headers)\n @access_token = MultiJson.load(response.env[:body])['access_token']\n @token_issued_at = Time.new.to_i\n end\n @access_token\n end",
"title": ""
},
{
"docid": "474c141e2afa7b5c922512e5098b6ead",
"score": "0.63646793",
"text": "def access_token\n return @access_token unless @access_token.nil?\n\n @access_token = get_token.tap do |token|\n if token.expired?\n cache.invalidate(oauth_client.id)\n get_token\n end\n end\n end",
"title": ""
},
{
"docid": "861b6748337ddd5c93033f3c869f9e17",
"score": "0.63572884",
"text": "def authenticate\n Access.new(\n access_token: access_token,\n token_type: token_type,\n expires_in: 1 << (1.size * 8 - 2) - 1 # Max int value\n )\n end",
"title": ""
},
{
"docid": "5aaca6aec935ea74f9b9b36dc5ccf7ff",
"score": "0.6350721",
"text": "def access_token(req, client)\n case req.grant_type\n when :authorization_code\n code = AuthorizationCode.valid.find_by_token(req.code)\n return nil unless code.valid_request?(req)\n code.access_token.build\n when :password\n resource = mapping.to.find_for_authentication(mapping.to.authentication_keys.first => req.username)\n return nil unless resource && resource.respond_to?(:valid_password?)\n valid = resource.valid_for_authentication? { resource.valid_password?(req.password) }\n return nil unless valid.is_a?(TrueClass)\n resource.access_tokens.build(:client => client)\n when :client_credentials\n # NOTE: client is already authenticated here.\n client.access_tokens.build\n when :refresh_token\n refresh_token = client.refresh_tokens.valid.find_by_token(req.refresh_token)\n return nil unless refresh_token.present?\n refresh_token.access_tokens.build(:client => client, :user => refresh_token.user)\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "c2610c9b924ec3a4703aad567cce2aff",
"score": "0.6347632",
"text": "def access_token( user_token = nil, user_secret = nil )\n if user_token and user_secret \n @access_token = OAuth::AccessToken.new( self.consumer, user_token, user_secret )\n else\n @access_token\n end\n end",
"title": ""
},
{
"docid": "66373124b71ac97cc553cd317bf1fd5e",
"score": "0.6338146",
"text": "def access_token\n @options['access_token'] || @options['oauth_token']\n end",
"title": ""
},
{
"docid": "56b7c18f8a4ecc1607d622bd9fd23db7",
"score": "0.6337037",
"text": "def get_access_token\n begin\n get_access_token!\n rescue Fog::Brightbox::OAuth2::TwoFactorMissingError, Excon::Errors::Unauthorized, Excon::Errors::BadRequest\n @credentials.update_tokens(nil, nil)\n end\n @credentials.access_token\n end",
"title": ""
},
{
"docid": "27f38d18036db049dbe8b3d80c329cbd",
"score": "0.6321745",
"text": "def get_access_token(request_token, request_token_secret, oauth_verifier)\n request_token = OAuth::RequestToken.new(self.consumer, request_token, request_token_secret)\n self.access_token = request_token.get_access_token(:oauth_verifier => oauth_verifier)\n end",
"title": ""
},
{
"docid": "36c3d7d64977b8bc07dd0da48b19447f",
"score": "0.6319022",
"text": "def user_access_token\n client_id = params['client_id']\n client_secret = params['client_secret']\n # TODO - Implement scopes conditions\n scopes = params['scopes'].presence || Doorkeeper.configuration.default_scopes.to_s\n\n application = oauth_application(client_id, client_secret)\n\n if application.blank?\n render json: { error: t('api.authentication.invalid_client') }, status: :forbidden\n return\n end\n\n\n username = params['username']\n password = params['password']\n user = User.authenticate(username, password)\n\n if user.blank?\n render json: { error: t('api.authentication.invalid_user') }, status: :forbidden\n return\n end\n\n expires_in = Doorkeeper.configuration.access_token_expires_in || 7200\n use_refresh_token = Doorkeeper.configuration.reuse_access_token\n\n requested_scopes = scopes.split(' ').compact\n valid_scopes = (requested_scopes & application.scopes.to_a).join(' ')\n\n # TODO - use refresh token not working, creating new token every time. Need to fix that\n token = Doorkeeper::AccessToken.find_or_create_for(application, user.id, valid_scopes, expires_in, use_refresh_token)\n\n render json: token_as_json(token), status: :ok\n end",
"title": ""
},
{
"docid": "b83ed06fba08a9684723276718071106",
"score": "0.6315359",
"text": "def get_token\n object_from_response(Token, :post, \"authToken\")\n end",
"title": ""
},
{
"docid": "c2473782ea52a277f17f1265f52ff9fb",
"score": "0.63148105",
"text": "def get_access_token\n\t\tif @ll_access_token\n\t\t\t@ll_access_token\n\t\telse\n\t\t\tapp_client_values = {\n\t\t\t\t'grant_type' => 'client_credentials',\n\t\t\t\t'client_id' => @client_id,\n\t\t\t\t'client_secret' => @client_secret\n\t\t\t}\n\n\t\t\t@access_data = @rest_client.post(\"/oauth/token\", build_query(app_client_values), RestClient::MIME_FORM)\n\n\t\t\tif @access_data['status'] == \"200\"\n\t\t\t\t@access_data = @access_data[\"response\"]\n\t\t\t\t@access_data['access_token']\n\t\t\telse\n\t\t\t\traise @access_data.inspect\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "fc0e5dba4f892bc7fbeede1bab0f898a",
"score": "0.63134336",
"text": "def access_token\n if (Time.now.getutc.to_i - @validity) > 3600\n refresh_token\n end\n\n @access_token\n end",
"title": ""
},
{
"docid": "5bf1cb610a51a7a9a50f881702173ab5",
"score": "0.63127416",
"text": "def access_token\n expires = relative_epoch\n data = [self.user_id, expires.to_i].join(':')\n @access_token ||= AES.encrypt data, Rails.application.secrets.session_key\n end",
"title": ""
},
{
"docid": "a53661c1a1baef2a67db01eced73ac7d",
"score": "0.6310137",
"text": "def access_token\n # We have to modify request.parameters because Doorkeeper::Server reads params from there\n request.parameters[:redirect_uri] = oauth_jira_dvcs_callback_url\n\n strategy = Doorkeeper::Server.new(self).token_request('authorization_code')\n response = strategy.authorize\n\n if response.status == :ok\n access_token, scope, token_type = response.body.values_at('access_token', 'scope', 'token_type')\n\n render body: \"access_token=#{access_token}&scope=#{scope}&token_type=#{token_type}\"\n else\n render status: response.status, body: response.body\n end\n rescue Doorkeeper::Errors::DoorkeeperError => e\n render status: :unauthorized, body: e.type\n end",
"title": ""
},
{
"docid": "f761d9c71d6b0c67f9eff2f79e623684",
"score": "0.6308886",
"text": "def get_access_token(*args)\n login(*args)['token']\n end",
"title": ""
},
{
"docid": "56b92e7b884685528eba1bf33843d970",
"score": "0.63069785",
"text": "def access_token; self; end",
"title": ""
},
{
"docid": "617a010a829d8c6f9f19a6fc919af25a",
"score": "0.63055414",
"text": "def access_token\n if Time.now.getutc.to_i - @validity > 3600\n refresh_token\n end\n\n @access_token\n end",
"title": ""
},
{
"docid": "735256f86ca31e346691d5df991ba440",
"score": "0.6304233",
"text": "def access_token\n config[:access_token] || config[:api_key]\n end",
"title": ""
},
{
"docid": "db87f7679172e6318ce77de850243c54",
"score": "0.6296376",
"text": "def get_access_token\r\n\t\tif @ll_access_token\r\n\t\t\t@ll_access_token\r\n\t\telse\r\n\t\t\tapp_client_values = {\r\n\t\t\t\t'grant_type' => 'client_credentials',\r\n\t\t\t\t'client_id' => @client_id,\r\n\t\t\t\t'client_secret' => @client_secret\r\n\t\t\t}\r\n\r\n\t\t\t@access_data = @rest_client.post(\"/oauth/token\", build_query(app_client_values), RestClient::MIME_FORM)\r\n\r\n\t\t\tif @access_data['status'] == \"200\"\r\n\t\t\t\t@access_data = @access_data[\"response\"]\r\n\t\t\t\t@access_data['access_token']\r\n\t\t\telse\r\n\t\t\t\traise @access_data.inspect\r\n\t\t\tend\r\n\t\tend\r\n\tend",
"title": ""
},
{
"docid": "581335ea1083a539fc72bcd2c0653afc",
"score": "0.6295121",
"text": "def oauth_token\n @oauth_token ||= OAuth::AccessToken.new(oauth_consumer, access_token, access_secret)\n end",
"title": ""
},
{
"docid": "b2a2cc50e07578a3d917d596152f39ff",
"score": "0.62922436",
"text": "def get_access_token\n app = @applications.first\n client_id = app[\"uid\"]\n client_secret = app[\"secret\"]\n access_token = Authentication.new(client_id: client_id, client_secret: client_secret ).access_token\n end",
"title": ""
},
{
"docid": "ed07bb038a6e4fd88bf05d130ca69632",
"score": "0.62879956",
"text": "def token\n @access_token.dup\n end",
"title": ""
},
{
"docid": "f67b4b1c75db4f6a67c62093c4980a97",
"score": "0.6282573",
"text": "def get_access_token(verifier)\n $LOG.i \"getting access token pair\"\n @access_token = @request_token.get_access_token(:oauth_verifier => verifier)\n $LOG.i \"got access token pair\", @access_token\n $LOG.i \"save access token data in config object\"\n \n @config.access_token = @access_token.token\n @config.access_secret = @access_token.secret\n \n @access_token\n end",
"title": ""
},
{
"docid": "224af4a3176c83001c7bb2b05e4d6e13",
"score": "0.628155",
"text": "def token!(authorization_code,opts = {})\n opts[:redirect_uri] ||= DEFAULT_REDIRECT_URI\n self.access_token = oauth_client.auth_code.get_token(authorization_code, redirect_uri: opts[:redirect_uri])\n end",
"title": ""
},
{
"docid": "81935ca0f726e49f9640af306767680e",
"score": "0.62793577",
"text": "def request_auth_token\n if params[:auth_token].blank?\n return nil \n else\n return @request_auth_token ||= FiveDAccessToken.new(params[:auth_token])\n end\n end",
"title": ""
},
{
"docid": "669b1e896a69f420c8ac733b6ed373d4",
"score": "0.62745893",
"text": "def get_access_token(token = nil, user = nil)\n @user = user.nil? ? @user : user\n token_hash = if token\n token\n else\n # Get the current token hash from session\n session[:azure_token]\n end\n client = OAuth2::Client.new(CLIENT_ID,\n CLIENT_SECRET,\n site: 'https://login.microsoftonline.com',\n authorize_url: '/common/oauth2/v2.0/authorize',\n token_url: '/common/oauth2/v2.0/token')\n\n token = OAuth2::AccessToken.from_hash(client, token_hash)\n\n # Check if token is expired, refresh if so\n if token.expired?\n new_token = token.refresh!\n # Save new token\n access_token = new_token.token\n @user.oauth_token = token.to_hash.to_json\n @user.refresh_token = token.refresh_token\n @user.notified_at = nil\n @user.save\n else\n @user.notified_at = nil unless @user.nil?\n access_token = token.token\n end\n access_token\n end",
"title": ""
},
{
"docid": "22ecbc1906a028c8a47c68d879262a90",
"score": "0.62737507",
"text": "def build_access_token\n self.account_uuid = request.params['user_uuid']\n\n params = {\n :client_id => options.client_id,\n :user_uuid => account_uuid,\n :public_key => options['public_key'],\n :secret_key => options['secret_key']\n }.merge(token_params.to_hash(:symbolize_keys => true))\n\n params = {'grant_type' => 'authorization_code', 'code' => request.params['code']}.merge(params)\n access_token_opts = deep_symbolize(options.auth_token_params)\n\n opts = {:raise_errors => false, :parse => params.delete(:parse)}\n if client.options[:token_method] == :post\n headers = params.delete(:headers)\n opts[:body] = params\n opts[:headers] = {'Content-Type' => 'application/x-www-form-urlencoded'}\n opts[:headers].merge!(headers) if headers\n else\n opts[:params] = params\n end\n\n response = client.request(client.options[:token_method], client.token_url, opts)\n data = {\n 'access_token' => response.parsed['results']['access_token'],\n 'expires_in' => response.parsed['results']['expires'],\n }\n\n ::OAuth2::AccessToken.from_hash(client, data.merge(access_token_opts))\n end",
"title": ""
},
{
"docid": "42713dc77dd3701be111b500f0ea2d9b",
"score": "0.6273571",
"text": "def get_mastodon_access_token\n Logger.new(STDOUT).info \"Mastodon Access Token was not found. Creating a new one now...\"\n scopes = 'read write follow'\n\n client = Mastodon::REST::Client.new(base_url: @instance_url)\n app = client.create_app(\"tweet-to-toot\", \"urn:ietf:wg:oauth:2.0:oob\", scopes)\n\n store_client_credentials(app.client_id, app.client_secret)\n\n oauth_client = OAuth2::Client.new(app.client_id, app.client_secret, site: @instance_url)\n oauth_client.password.get_token(ENV[\"MASTODON_LOGIN\"], ENV[\"MASTODON_PASSWORD\"], scope: scopes).token\n end",
"title": ""
},
{
"docid": "c82d4c9af3b338360cc95985244bfa25",
"score": "0.6271546",
"text": "def access_token\n @access_token = ::OAuth2::AccessToken.new(client, object.oauth_hash[:access_token],\n refresh_token: object.oauth_hash[:refresh_token],\n expires_at: object.oauth_hash[:expires_at].to_i\n )\n if @access_token.expired?\n GoogleAPI.logger.info \"Access Token expired for #{object.class.name}(#{object.id}), refreshing...\"\n @access_token = @access_token.refresh!\n object.update_oauth!(@access_token.token)\n end\n\n @access_token\n end",
"title": ""
},
{
"docid": "beb69b9e5b9c4162b317f6c37f0491fc",
"score": "0.626347",
"text": "def access_token(requires_auth=false)\n requires_auth ? access_token_auth : access_token_no_auth\n end",
"title": ""
},
{
"docid": "652f2816eb2f2d101ee6da731dda225d",
"score": "0.62617904",
"text": "def access_token( user_token = nil, user_secret = nil )\n ( user_token && user_secret ) ? @access_token = OAuth::AccessToken.new( self.consumer, user_token, user_secret ) : @access_token\n end",
"title": ""
},
{
"docid": "4f9a290b89b2038c8d06291dc6c6e044",
"score": "0.62603706",
"text": "def build_access_token\n verifier = request.params['code']\n client.auth_code.get_token(\n verifier,\n {\n redirect_uri: callback_url.split('?').first\n }.merge(token_params.to_hash(symbolize_keys: true)),\n deep_symbolize(options.auth_token_params)\n )\n end",
"title": ""
},
{
"docid": "ace18deb112eb96eb21da0985ed2a3b3",
"score": "0.62590516",
"text": "def access_token\n User.create_access_token(self)\n end",
"title": ""
},
{
"docid": "ace18deb112eb96eb21da0985ed2a3b3",
"score": "0.62590516",
"text": "def access_token\n User.create_access_token(self)\n end",
"title": ""
},
{
"docid": "ace18deb112eb96eb21da0985ed2a3b3",
"score": "0.62590516",
"text": "def access_token\n User.create_access_token(self)\n end",
"title": ""
}
] |
dd6da7665692bd9fd716055f328f7b57
|
Returns a new time the specified number of days in the future.
|
[
{
"docid": "d6345c1b21afc66ea98666e5ba4d2100",
"score": "0.573003",
"text": "def next_day(days = 1)\n advance(days: days)\n end",
"title": ""
}
] |
[
{
"docid": "3001603082d26730f985eed07c7e805c",
"score": "0.6666285",
"text": "def future_date(days)\n Faker::Date.forward(days)\n end",
"title": ""
},
{
"docid": "d90671e14c199b26ff9f3fbebdae7237",
"score": "0.6188595",
"text": "def days_ago(days)\n advance(days: -days)\n end",
"title": ""
},
{
"docid": "e267bdc2a5167c929aeacdf2a1a8fb0e",
"score": "0.6164328",
"text": "def next_day(time, day, future: true)\n time.is_a?(String) && time = ::Time.zone.parse(time)\n from = ::Date::DAYS_INTO_WEEK[day_name] * SECONDS\n days = ::Date::DAYS_INTO_WEEK[day.to_sym]\n to = (future && days.zero? ? 7 : days) * SECONDS\n\n ::Time.zone.today.beginning_of_day\n .advance(seconds: (to - from) + time.seconds_since_midnight)\n end",
"title": ""
},
{
"docid": "25c0b86ed4e4649b5006774168689f35",
"score": "0.61400175",
"text": "def days_since(days)\n advance(days: days)\n end",
"title": ""
},
{
"docid": "ed9886921d700e07bbceaae439c73794",
"score": "0.61084175",
"text": "def advance_days(days)\n advance_to_date(to_date + days)\n end",
"title": ""
},
{
"docid": "9280fc78f3e04301380fa7e72e9cdfd6",
"score": "0.59634364",
"text": "def tomorrow(x = 1)\n\t\tself + (86400 * x)\n\tend",
"title": ""
},
{
"docid": "f329c2d7c99b7bf91800f3f8cdb76e4c",
"score": "0.59365726",
"text": "def add_days(date, n)\n date + n * DAY\n end",
"title": ""
},
{
"docid": "e2514acdb20a3c9a5bd37cc5dce322e0",
"score": "0.5862029",
"text": "def from_now(t = Time.now); t + self; end",
"title": ""
},
{
"docid": "e2514acdb20a3c9a5bd37cc5dce322e0",
"score": "0.5862029",
"text": "def from_now(t = Time.now); t + self; end",
"title": ""
},
{
"docid": "87758110d62a47b80cbb53f1edd7ca6a",
"score": "0.58461595",
"text": "def forward(days = 365)\n from = ::Date.today + 1\n to = ::Date.today + days\n\n between(from, to)\n end",
"title": ""
},
{
"docid": "348f163fc08712c070981f09f7505be8",
"score": "0.5826936",
"text": "def future(year, month, day)\n years = (10 ** 9) / 60 / 60 / 24 / 365\n days = (10 ** 9) / 60 / 60 / 24 % 365\n\n year = year + years\n \n\nend",
"title": ""
},
{
"docid": "369d9e72e03966ab97dd4d08ac972693",
"score": "0.5748411",
"text": "def forward(from: ::Date.today, days: 365)\n start_date = get_date_object(from)\n since = start_date + 1\n to = start_date + days\n\n between(from: since, to: to).to_date\n end",
"title": ""
},
{
"docid": "0ac5ae3ac00613a7c42018c08a2d515b",
"score": "0.5668629",
"text": "def past_date(days)\n Faker::Date.backward(days)\n end",
"title": ""
},
{
"docid": "03ff784a8800546661c82496bab38ada",
"score": "0.5662423",
"text": "def since_days_ago(num)\n\t\tnum.days.ago.to_date .. Date.today\n\tend",
"title": ""
},
{
"docid": "482ee445d72992711286facbd86350b5",
"score": "0.56279325",
"text": "def fake_time_from(time_ago = 1.year.ago)\n time_ago+(rand(8770)).hours\n end",
"title": ""
},
{
"docid": "ca319a0840762f2d0684ac0834c7ccfb",
"score": "0.5594881",
"text": "def next_day(date, number_of_day)\n date += 1 + (((number_of_day-1)-date.wday) % 7)\n end",
"title": ""
},
{
"docid": "eeb11208eecf4bab416c14aa6e3b4a1c",
"score": "0.5587269",
"text": "def weekdays_ago(date = ::Time.now.to_date)\n x = 0\n curr_date = date\n until x == self\n curr_date = curr_date - 1.days\n x += 1 if curr_date.weekday?\n end\n \n curr_date\n end",
"title": ""
},
{
"docid": "442f658a2010d1800f044b81d52b5022",
"score": "0.55629736",
"text": "def next_day(date)\n date + (60 * 60 * 24)\n end",
"title": ""
},
{
"docid": "1729c8660aa9ecc38bcdcd37f83cfb17",
"score": "0.5543085",
"text": "def add_days(count)\n 24*60*60*count.to_i\n end",
"title": ""
},
{
"docid": "49fedc7041cab754b21a798c6c76607c",
"score": "0.5539932",
"text": "def plus_days(days)\n self.class.from_epoch_with_self(self.to_epoch + Duration.of_days(days).to_millis, self)\n end",
"title": ""
},
{
"docid": "0763ab5e572b66d95cfd56f1b0302f74",
"score": "0.5515023",
"text": "def date_of_next(day)\r\n date = Date.parse(day)\r\n delta = date > Date.today ? 0 : 7\r\n date + delta\r\nend",
"title": ""
},
{
"docid": "d40b5b7a626952cdfc0a3d9c95971cb9",
"score": "0.5492585",
"text": "def days_until_expiration(now=Time.now)\n distance_in_days = seconds_until_expiration(now)/SECONDS_IN_A_DAY\n distance_in_days.floor\n end",
"title": ""
},
{
"docid": "4143468b7bf070ea504e97b2c1ad1814",
"score": "0.548427",
"text": "def tomorrow\n advance(days: 1)\n end",
"title": ""
},
{
"docid": "81df1f9d187d29b48f5d5404fe6520c4",
"score": "0.5472792",
"text": "def next(now = @time_source.now, num = 1)\n t = InternalTime.new(now, @time_source)\n\n unless time_specs[:month][0].include?(t.month)\n nudge_month(t)\n t.day = 0\n end\n\n unless interpolate_weekdays(t.year, t.month)[0].include?(t.day)\n nudge_date(t)\n t.hour = -1\n end\n\n unless time_specs[:hour][0].include?(t.hour)\n nudge_hour(t)\n t.min = -1\n end\n\n # always nudge the minute\n nudge_minute(t)\n t = t.to_time\n if num > 1\n recursive_calculate(:next,t,num)\n else\n t\n end\n end",
"title": ""
},
{
"docid": "c91c242ef85db69d45e43380de2da3bf",
"score": "0.546689",
"text": "def qnow quantum=10.minutes, now=Familia.now\n rounded = now - (now % quantum)\n Time.at(rounded).utc.to_i\n end",
"title": ""
},
{
"docid": "c27bcfcb11eb0f6d5470550194f198fb",
"score": "0.5461024",
"text": "def since(seconds)\n self + seconds\n rescue\n to_datetime.since(seconds)\n end",
"title": ""
},
{
"docid": "5a6b73da2d5ec4bf4ad7289d0cdbd785",
"score": "0.54603064",
"text": "def prev_day(days = 1)\n advance(days: -days)\n end",
"title": ""
},
{
"docid": "208efe30c33e7bfed1a4cca57e44afd3",
"score": "0.5459535",
"text": "def date_of_next(day)\n date = Date.parse(day)\n delta = date > Date.today ? 0 : 7\n date + delta\nend",
"title": ""
},
{
"docid": "2f597a9be401a3cf6c5c12a815de9b13",
"score": "0.54545903",
"text": "def extendbythirthydays\n update_at = update_at + 14.days.from_now\n end",
"title": ""
},
{
"docid": "da7ae914d8ad539125321aaa9513bf08",
"score": "0.5439672",
"text": "def date_of_next(day)\n date = Date.parse(day)\n delta = date > Date.today ? 0 : 7\n date + delta\n end",
"title": ""
},
{
"docid": "0382e46c0882f5d479af9489a029d79b",
"score": "0.54079217",
"text": "def date_of_next(day)\n\t day_required = DateTime.parse(day)\n\t delta = day_required > DateTime.now ? 0 : 7\n\t (day_required + delta)\n\tend",
"title": ""
},
{
"docid": "4811afc488626df7e8260d95aba7a28c",
"score": "0.5405612",
"text": "def weekdays_ago(time = ::Time.now)\n # -5.weekdays_ago(time) == 5.weekdays_from(time)\n return self.abs.weekdays_from(time) if self < 0\n \n x = 0\n curr_date = time\n\n until x == self\n curr_date -= 1.days\n x += 1 if curr_date.weekday?\n end\n\n curr_date\n end",
"title": ""
},
{
"docid": "72a7f857fbfcb809d1357a286ec303ff",
"score": "0.5401248",
"text": "def hours_until_next_allowed\n ((created_at - RECENT_PERIOD.ago) / 3600).to_i\n end",
"title": ""
},
{
"docid": "72a7f857fbfcb809d1357a286ec303ff",
"score": "0.5401248",
"text": "def hours_until_next_allowed\n ((created_at - RECENT_PERIOD.ago) / 3600).to_i\n end",
"title": ""
},
{
"docid": "3808ea327bd19133092ca51f5aebafdc",
"score": "0.5369521",
"text": "def date_of_next(day)\n date = Date.parse(day)\n delta = date > Date.today ? 0 : 7\n\n return date + delta\n end",
"title": ""
},
{
"docid": "f0d903b59af715438ab760c6a39cef79",
"score": "0.5359409",
"text": "def interval\n (Date.current - limit.days) .. Date.tomorrow\n end",
"title": ""
},
{
"docid": "35305484269c30a46adeadbd21302824",
"score": "0.5348157",
"text": "def nextTime(time = nil)\n time = Utils::Time.current if time.nil?\n if true # time < expiryTime\n if remindable && remindTime\n remindTime\n else\n time + 10 * 365 * 24 * 60 * 60\n end\n else\n time + 10 * 365 * 24 * 60 * 60\n end\n end",
"title": ""
},
{
"docid": "3adfa5bd6a82a651287fbd3cabc83219",
"score": "0.53433675",
"text": "def days_to_add(desired)\n # c is current day of week, d is desired next day of week\n # f( c, d ) = g( c, d ) mod 7, g( c, d ) > 7\n # = g( c, d ), g( c, d ) <= 7\n # g( c, d ) = [7 - (c - d)] = 7 - c + d\n # where 0 <= c < 7 and 0 <= d < 7\n n = (7 - DateTime.now.wday + desired);\n (n > 7) ? n % 7 : n\nend",
"title": ""
},
{
"docid": "b28c2b83665c116ce0907d495396aaad",
"score": "0.53419435",
"text": "def date_of_next(day)\n date = Date.parse(day)\n delta = date > Date.today ? 0 : 7\n date + delta\n Chronic.parse(\"0 next #{day}\").to_datetime\n end",
"title": ""
},
{
"docid": "28c1d199e4e3c785e820d5ab2a755aae",
"score": "0.5326978",
"text": "def seconds_until_expiration(now=Time.now)\n ((@ends_at - now).abs).round\n end",
"title": ""
},
{
"docid": "78ad8f9ab624d90e06f19d1caf54144d",
"score": "0.53240246",
"text": "def gen_date(from=0.0, to=Time.now)\n Time.at(from + rand * (to.to_f - from.to_f))\nend",
"title": ""
},
{
"docid": "997022454976814c8de04cb42b059647",
"score": "0.5316935",
"text": "def next_day\n advance(days: 1)\n end",
"title": ""
},
{
"docid": "ce09335427c9c12196d5c75b043c3520",
"score": "0.5304978",
"text": "def days_remaining\n target_time = self.next_release[\"release_date\"].to_time\n current_time = Time.now\n \n difference_seconds = target_time - current_time\n difference_seconds.div(86400) # seconds in a day\n end",
"title": ""
},
{
"docid": "ce2afea5bc7284d32e6458b92fbe6ea7",
"score": "0.530386",
"text": "def advance(options)\n unless options[:weeks].nil?\n options[:weeks], partial_weeks = options[:weeks].divmod(1)\n options[:days] = options.fetch(:days, 0) + 7 * partial_weeks\n end\n\n unless options[:days].nil?\n options[:days], partial_days = options[:days].divmod(1)\n options[:hours] = options.fetch(:hours, 0) + 24 * partial_days\n end\n\n d = to_date.gregorian.advance(options)\n time_advanced_by_date = change(year: d.year, month: d.month, day: d.day)\n seconds_to_advance = \\\n options.fetch(:seconds, 0) +\n options.fetch(:minutes, 0) * 60 +\n options.fetch(:hours, 0) * 3600\n\n if seconds_to_advance.zero?\n time_advanced_by_date\n else\n time_advanced_by_date.since(seconds_to_advance)\n end\n end",
"title": ""
},
{
"docid": "a6d8b088ea94c8aabb4a2196dcb0b644",
"score": "0.5298488",
"text": "def seconds_until_end_of_day\n end_of_day.to_f - to_f\n end",
"title": ""
},
{
"docid": "8c5d07254a1f1ebd2c58390aadbf8361",
"score": "0.5292282",
"text": "def ago(t = Time.now); t - self; end",
"title": ""
},
{
"docid": "8c5d07254a1f1ebd2c58390aadbf8361",
"score": "0.5292282",
"text": "def ago(t = Time.now); t - self; end",
"title": ""
},
{
"docid": "937b5078f20de5ddb1d9b949a037e6ca",
"score": "0.52870977",
"text": "def calc_expiry_time(seconds = 86400 * 7) # one week\n ((Time.now.utc + seconds).to_f * 1000).to_i\n end",
"title": ""
},
{
"docid": "61e1183b82be530c212372852c9ee4bc",
"score": "0.52869093",
"text": "def next_sunday(due_to_date)\n\t\t\tright_now = Time.zone.now\n\t\t\tright_now += 6.days if right_now <= due_to_date # approximation should be fine, ignore edge cases for now\n return right_now + (7 - right_now.wday).days + (22 - right_now.hour).hours + (0 - right_now.min).minutes + (0 - right_now.sec).second\n\t end",
"title": ""
},
{
"docid": "e7ceb5553010cff91d55c5c0623232c2",
"score": "0.5272864",
"text": "def get_next_date\n today_wday = Date.today.wday\n wday_s = get_weekday(limit_weekday_start)\n wday_e = get_weekday(limit_weekday_end)\n if(wday_s < wday_e)\n if(today_wday > wday_e or today_wday < wday_s or(today_wday == wday_s and Time.now.hour < limit_time_start) or (today_wday == wday_e and Time.now.hour > limit_time_end))\n need_day = (wday_s + 7 - today_wday)%7\n return Time.parse(limit_time_start.to_s + \":00\", Time.now + need_day.day), true\n else\n need_day = wday_e - today_wday\n return Time.parse(limit_time_end.to_s + \":00\", Time.now + need_day.day), false\n end\n else\n if((wday_e < today_wday and today_wday < wday_s) or (today_wday == wday_s and Time.now.hour < limit_time_start) or (today_wday == wday_e and Time.now.hour > limit_time_end))\n need_day = wday_s - today_wday\n return Time.parse(limit_time_start.to_s + \":00\", Time.now + need_day.day), true\n else\n need_day = (wday_e + 7 - today_wday)%7\n return Time.parse(limit_time_end.to_s + \":00\", Time.now + need_day.day), false\n end\n end\n end",
"title": ""
},
{
"docid": "ea724d78ea2c9c790d8784b60ebda1dc",
"score": "0.5259645",
"text": "def days(n)\n n * 3600 * 24\nend",
"title": ""
},
{
"docid": "585221da1a6883b989ab1ecba691a716",
"score": "0.5257386",
"text": "def expire_time\n updated_at.advance(:days => 30)\n end",
"title": ""
},
{
"docid": "b074880e239b041681768abce0821925",
"score": "0.5242538",
"text": "def estimated_end_date\n Date.today + remaining_days\n end",
"title": ""
},
{
"docid": "63bff4a7079c6ef068256428cd4d9f09",
"score": "0.5236081",
"text": "def future from=7.days\n schedules.where(:when.gte => from.from_now)\n end",
"title": ""
},
{
"docid": "0c35a5ef17fde1e0a22e647aa4fc260b",
"score": "0.52343524",
"text": "def time_days() (@time_end.jd - @time_start.jd) + 1; end",
"title": ""
},
{
"docid": "b03739265a312bd73afd9f7a9a05ecdc",
"score": "0.52198404",
"text": "def midnight_tonight\n (Time.now.to_date + 1).to_time\nend",
"title": ""
},
{
"docid": "7f82d4396b71a6a897fea5980852d8c0",
"score": "0.5178236",
"text": "def next_move_time\n delay = random.rand.clamp(1, 7)\n Time.current.to_f + delay\n end",
"title": ""
},
{
"docid": "826d8754b8b5dd8b6cdefacefd3a0071",
"score": "0.5170871",
"text": "def add_day(day)\n day += 24*60*60\nend",
"title": ""
},
{
"docid": "871513bcaa91f64f7c5bee9afddaddef",
"score": "0.51576954",
"text": "def rand_time( from = Time.now - 4.months, to = Time.now + 4.months)\n Time.at(from + rand * (to.to_time.to_f - from.to_time.to_f))\nend",
"title": ""
},
{
"docid": "9bebfc52e82c0ace8d5e140b258d1994",
"score": "0.51533186",
"text": "def next_opens\n opening_time.advance(weeks: 1)\n end",
"title": ""
},
{
"docid": "511eab83d42d5f1581f5aacb3bde1d3f",
"score": "0.51482266",
"text": "def seconds_until_end_of_day\n end_of_day.to_i - to_i\n end",
"title": ""
},
{
"docid": "4866445efa284f74432ec352bd603960",
"score": "0.51347506",
"text": "def local(*values)\n values << 0 until values.count == 6\n Time.new(*values, to_s)\n end",
"title": ""
},
{
"docid": "1f437a64496a1a33b2f7bbc2c1c3292f",
"score": "0.5115957",
"text": "def create_default_estimated_date\n Date.today + 7\n end",
"title": ""
},
{
"docid": "41b0c5487728def0d59af3d9e84dd759",
"score": "0.5115739",
"text": "def days_after(number, date)\n current_date = date\n\n until number <= 0\n number -= 1 if active?(current_date.next_day)\n current_date = current_date.next_day\n end\n\n current_date\n rescue NoMethodError\n p 'provided date is not of valid type'\n nil\n end",
"title": ""
},
{
"docid": "158ff74dfa551e92358d67da34dca313",
"score": "0.51136196",
"text": "def seconds_to_expire(options = {})\n if options.has_key?(:until)\n case options[:until]\n when 'midnight', :midnight\n secs = ((Time.now + 1.day).midnight - Time.now).to_i \n else\n secs = (options[:until] - Time.now).to_i\n end\n raise \":until(#{options[:until].inspect}) is less than Time.now by #{secs}\" if secs <= 0\n return secs\n elsif options.has_key?(:for)\n return options[:for]\n else\n 0\n end\n end",
"title": ""
},
{
"docid": "7f54161edf5b6850ff04b8c413df8476",
"score": "0.5108013",
"text": "def expiry(t)\n Time.now.to_i + t\n end",
"title": ""
},
{
"docid": "1816cc2012e22afc8d1901f8d3f08a45",
"score": "0.51044875",
"text": "def find_next_day\n day = @date.to_date + ((@schedule.start_date - @date.to_date) % @schedule.period_num)\n return day\n end",
"title": ""
},
{
"docid": "9ef4c56d23013915b32092f2c326dd4f",
"score": "0.5103214",
"text": "def due_date\n self.created_at.to_date + 7\n end",
"title": ""
},
{
"docid": "edc579f18260a756d510f64e27f398b0",
"score": "0.50916183",
"text": "def last_ten_days\n today = Date.today\n\n 10.times.map do |i|\n today - (i + 1)\n end\n end",
"title": ""
},
{
"docid": "afb09d72b059511f9a171f67352f74d2",
"score": "0.50861925",
"text": "def local_seconds_until_end_of_day\n local_end_of_day.to_f - to_f\n end",
"title": ""
},
{
"docid": "81490fd01fcb90b794b31f18b9fb12b1",
"score": "0.5081053",
"text": "def hours_until_expiration(now=Time.now)\n distance_in_hours = seconds_until_expiration(now)/SECONDS_IN_A_HOUR\n distance_in_hours.floor\n end",
"title": ""
},
{
"docid": "30e953b27e440d1fcb6b47c8388ffae5",
"score": "0.5076632",
"text": "def minutes_ago(mins)\n date_factory(Time.now - mins*60)\n end",
"title": ""
},
{
"docid": "a76bdfcda783c8b56eb6d8d63b8a3a78",
"score": "0.5070086",
"text": "def get_next_date(date, available_hours)\n # available_hours, ex : [(start_morning, end_morning), (start_afternoon, end_afternoon)]\n # 48 times because we want to try until the next day, same hour:\n # we add 0.5 hour each time so we have to add\n next_date = date + 30.minutes\n 48.times do\n available_hours.each do |interval|\n if (next_date.hour >= interval[0]) && (next_date.hour < interval[1])\n return next_date\n end\n end\n next_date += 30.minutes\n end\nend",
"title": ""
},
{
"docid": "97cb5c58f0bca2487e94cbeff3fc159f",
"score": "0.5054858",
"text": "def d_days( v )\n TimeDelta.new( DAY_TO_MS * v )\n end",
"title": ""
},
{
"docid": "b1bc5f30ee69d17dfc7ef09664a7812a",
"score": "0.5050301",
"text": "def from_now\n after(Time.now)\n end",
"title": ""
},
{
"docid": "ec204d73f94377a8d4b698d7b72989a3",
"score": "0.50502187",
"text": "def days_to_go\n\t\t(self.expiration_date.to_date - Date.today).to_i\n\tend",
"title": ""
},
{
"docid": "a4399d7357abf5795333221ae77b41e0",
"score": "0.5047152",
"text": "def advance_seconds(secs)\n self + secs\n end",
"title": ""
},
{
"docid": "ad80120d7db6dc7ce1570a27681991b5",
"score": "0.50408363",
"text": "def next_due_at(now = Time.zone.now)\n # The next billing date is always the original date if \"now\" is earlier than the original date\n return created_at if now <= created_at\n\n number_of_cycles = number_of_cycles_since_created(now)\n next_due_at = calculate_due_at(number_of_cycles)\n\n # The number of cycles since the billing cycle was created only gets us to \"now\"\n # so we need probably need to add another cycle to get the next billing date.\n while next_due_at < now\n number_of_cycles += interval_value\n next_due_at = calculate_due_at(number_of_cycles)\n end\n\n next_due_at\n end",
"title": ""
},
{
"docid": "d4388a68c451f4ac4424658517e3648a",
"score": "0.503845",
"text": "def elapsed_days t1\n ((Time.now - t1) / 86400).to_i + 1\n end",
"title": ""
},
{
"docid": "7869568253097268c3048cf727022ed0",
"score": "0.5035195",
"text": "def -(days)\n self.class.new( to_g - days )\n end",
"title": ""
},
{
"docid": "7c4a78a4160ca2f438e077ae00bc3fff",
"score": "0.5031818",
"text": "def tomorrow()\n \n self.day(Time.now + 1.days)\n \n end",
"title": ""
},
{
"docid": "64e9fc3648f832e87dac5fbc06314e36",
"score": "0.50258094",
"text": "def get_next_to_last_run\n now = Time.now.utc\n run = Time.utc(now.year, now.month, now.day,\n (now.hour / run_interval) * run_interval)\n\n run - run_interval * 3600\n end",
"title": ""
},
{
"docid": "302a3844a86022a57ee818a94c95e457",
"score": "0.5021854",
"text": "def next_time(now=Time.now)\n\n time = as_time(now)\n time = time - time.usec * 1e-6 + 1\n # small adjustment before starting\n\n loop do\n\n unless date_match?(time)\n time += (24 - time.hour) * 3600 - time.min * 60 - time.sec; next\n end\n unless sub_match?(time, :hour, @hours)\n time += (60 - time.min) * 60 - time.sec; next\n end\n unless sub_match?(time, :min, @minutes)\n time += 60 - time.sec; next\n end\n unless sub_match?(time, :sec, @seconds)\n time += 1; next\n end\n\n break\n end\n\n if @timezone\n time = @timezone.local_to_utc(time)\n time = time.getlocal unless now.utc?\n end\n\n time\n end",
"title": ""
},
{
"docid": "a174845b4e6e8219a7051eac1ad561b8",
"score": "0.50113004",
"text": "def time_remaining(interval = 1.second, now = Time.zone.now)\n (next_due_at(now) - now) / interval\n end",
"title": ""
},
{
"docid": "7ac7ae02585d4ee239e40b200856ffcc",
"score": "0.5009863",
"text": "def tomorrow\n self.since(1.day)\n end",
"title": ""
},
{
"docid": "8a0434264236ab5e94085826627f0728",
"score": "0.50093263",
"text": "def now\n Time.really_now - time_travel_offsets.inject(0, :+)\n end",
"title": ""
},
{
"docid": "c6af2fc69ba3acc94d395f62a67abc9b",
"score": "0.5006432",
"text": "def time_of_day(minutes)\n# Get current year\n# Get current month\n# Get next sunday\n# Create new date object for current year, month, sunday, at 00:00\n\n year = Time.now.year\n month = 2 #Let's make this feb since we are currently in february\n day = 24\n\n time = Time.new(year, month, day)\n\n# When you add or subtract from a time object, the time is interpreted in seconds. so we would have to multiply minutes by 60.\n# return new time\n time + (minutes * 60)\nend",
"title": ""
},
{
"docid": "70f7dfb6c2f648fdc354213eb16925bc",
"score": "0.50049037",
"text": "def backward(days: 365)\n from = ::Date.today - days\n to = ::Date.today - 1\n\n between(from: from, to: to).to_date\n end",
"title": ""
},
{
"docid": "ecba76b1e6ed84956bbd439c93fde208",
"score": "0.49963266",
"text": "def snooze(days)\n days = days.to_i if (days.class.name == \"String\" and days != \"day-1\")\n\n if days == \"day-1\" and self.happening_date.present?\n self.start_date = self.happening_date - 1\n self.fade_date = self.start_date + 30 if self.fade_date.present?\n else\n #move back start_date and fade_date; happening stays same\n days = 7 if days == \"day-1\"\n self.start_date = Date.today + days\n self.fade_date = self.fade_date + days if self.fade_date.present?\n end\n return self.save\n end",
"title": ""
},
{
"docid": "f714b2f5a38ba1bd7688329db9880b58",
"score": "0.4995598",
"text": "def overdue_days\n (Time.now.utc.to_date - expires_at.to_date).to_i\n end",
"title": ""
},
{
"docid": "60bf9efe9d0fe293c6cca8535a846d8f",
"score": "0.49919096",
"text": "def next_start_time\n # merge the schedule weekday, hour and minute with today's year, month, weekday to form the next start_time\n t = Time.now\n s = DateTime.parse(time_input)\n answer = Time.new(t.year, t.mon, t.mday, s.hour, s.min, 0)\n\n # adjust weekday so the answer weekday aligns with time_input weekday\n answer += DAY_OF_WEEK_MAP[s.wday.pred][answer.wday.pred] * SECONDS_PER_DAY\n if answer < Time.now\n # in the past, so add a week \n answer += SECONDS_PER_WEEK\n end\n answer\n end",
"title": ""
},
{
"docid": "87cfb8d96ff984387b691ac7252f6812",
"score": "0.4989115",
"text": "def since(seconds)\n VoltTime.new.set_time(@time + seconds)\n end",
"title": ""
},
{
"docid": "63fd691746a04b1fbf27d74c9bd0cb67",
"score": "0.49740946",
"text": "def remaining_days_of_grace\n self.expire_on - Date.today - 1\n end",
"title": ""
},
{
"docid": "718bdfa8dc9966767945c0f8ce143ca9",
"score": "0.49739078",
"text": "def ago(seconds)\n # This is basically a wrapper around the Numeric extension.\n #seconds.until(self)\n self - seconds\n end",
"title": ""
},
{
"docid": "18649e35a176c1be2aea803344f16103",
"score": "0.49614316",
"text": "def build_expires_at\n Time.now.to_i + (30 * 24 * 60 * 60)\nend",
"title": ""
},
{
"docid": "444d1f4cf1feedcb4b92b3b6c10c4336",
"score": "0.49538165",
"text": "def my_now\n utc = Time.now.utc\n now = Time.utc(utc.year, utc.month, utc.day, 6 - timezone)\n end",
"title": ""
},
{
"docid": "2ceeda568eab6c6a28869e048144398a",
"score": "0.49439353",
"text": "def shift_time(options={:distance => :days, :direction => :either, :base => nil, :min => nil, :max => nil})\n random_time_shift options\n end",
"title": ""
},
{
"docid": "2158348c705e317c4882828278b4f340",
"score": "0.49346116",
"text": "def since(prev)\n prev = prev.to_datetime unless prev.is_a?(DateTime)\n b = @current - prev # how many days in between\n if b.round(4) < 0\n \"ERROR. Time given is in the future!\"\n \n else\n in_words(b)\n \n end\n end",
"title": ""
},
{
"docid": "ba78c0e75432ffbbb9e1c25d19443a80",
"score": "0.49222308",
"text": "def hence(number, units=:seconds)\n time =(\n case units.to_s.downcase.to_sym\n when :years\n set( :year=>(year + number) )\n when :months\n y = ((month + number - 1) / 12).to_i\n m = ((month + number - 1) % 12) + 1\n set(:year => (year + y), :month => m)\n when :weeks\n self + (number * 604800)\n when :days\n self + (number * 86400)\n when :hours\n self + (number * 3600)\n when :minutes\n self + (number * 60)\n when :seconds\n self + number\n else\n raise ArgumentError, \"unrecognized time units -- #{units}\"\n end\n )\n dst_adjustment(time)\n end",
"title": ""
},
{
"docid": "51cb5d141b13fec769330d22c88b5599",
"score": "0.49172628",
"text": "def since(time = ::Time.now)\n time + self\n end",
"title": ""
}
] |
71818bd7dd32a7c021396e470d12a74b
|
PUT /bingo/numbers/1 PUT /bingo/numbers/1.json
|
[
{
"docid": "107f37bb554a0a17d2ccd802fbf419e4",
"score": "0.66560966",
"text": "def update\n @bingo_number = BingoNumber.find(params[:id])\n\n respond_to do |format|\n if @bingo_number.update(bingo_number_params)\n format.html { redirect_to bingo_numbers_path, notice: 'Bingo number was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bingo_number.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "1609e3cb6a244a3ecf3169dd8d50bf07",
"score": "0.6057202",
"text": "def update!(**args)\n @number = args[:number] if args.key?(:number)\n end",
"title": ""
},
{
"docid": "1609e3cb6a244a3ecf3169dd8d50bf07",
"score": "0.6057202",
"text": "def update!(**args)\n @number = args[:number] if args.key?(:number)\n end",
"title": ""
},
{
"docid": "e215a28989bc133e0f787e016efdb350",
"score": "0.596934",
"text": "def update\n respond_to do |format|\n if @number.update(number_params)\n format.html { redirect_to @number, notice: \"Number was successfully updated.\" }\n format.json { render :show, status: :ok, location: @number }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @number.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5d1e72760cb3971f353717a0b4aacabf",
"score": "0.5923739",
"text": "def update\n respond_to do |format|\n if @number.update(number_params)\n format.html { redirect_to @number, notice: 'Number was successfully updated.' }\n format.json { render :show, status: :ok, location: @number }\n else\n format.html { render :edit }\n format.json { render json: @number.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5d1e72760cb3971f353717a0b4aacabf",
"score": "0.5923739",
"text": "def update\n respond_to do |format|\n if @number.update(number_params)\n format.html { redirect_to @number, notice: 'Number was successfully updated.' }\n format.json { render :show, status: :ok, location: @number }\n else\n format.html { render :edit }\n format.json { render json: @number.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5d1e72760cb3971f353717a0b4aacabf",
"score": "0.5923739",
"text": "def update\n respond_to do |format|\n if @number.update(number_params)\n format.html { redirect_to @number, notice: 'Number was successfully updated.' }\n format.json { render :show, status: :ok, location: @number }\n else\n format.html { render :edit }\n format.json { render json: @number.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c10b15d7ab86f2c023eaea3bc08c31d7",
"score": "0.58942115",
"text": "def update\n @set_booking_number = SetBookingNumber.find(params[:id])\n\n if @set_booking_number.update(set_booking_number_params)\n head :no_content\n else\n render json: @set_booking_number.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "26161da0ba409f1a61b682522106a8d9",
"score": "0.58784586",
"text": "def update\n respond_to do |format|\n if @number.update(number_params)\n format.html { redirect_to @number, notice: '保存成功' }\n format.json { render :show, status: :ok, location: @number }\n else\n format.html { render :edit }\n format.json { render json: @number.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "efcafeb544fecee65986500335019ed5",
"score": "0.58678466",
"text": "def put_by_number(organization, number, harmonized_item_put_form)\n HttpClient::Preconditions.assert_class('organization', organization, String)\n HttpClient::Preconditions.assert_class('number', number, String)\n HttpClient::Preconditions.assert_class('harmonized_item_put_form', harmonized_item_put_form, ::Io::Flow::V0::Models::HarmonizedItemPutForm)\n r = @client.request(\"/#{CGI.escape(organization)}/harmonization/items/#{CGI.escape(number)}\").with_json(harmonized_item_put_form.to_json).put\n ::Io::Flow::V0::Models::HarmonizedItem.new(r)\n end",
"title": ""
},
{
"docid": "0ec1f476b0001aa2dcc70a74b2926728",
"score": "0.5850809",
"text": "def put_by_number(organization, number, order_put_form, incoming={})\n HttpClient::Preconditions.assert_class('organization', organization, String)\n HttpClient::Preconditions.assert_class('number', number, String)\n opts = HttpClient::Helper.symbolize_keys(incoming)\n query = {\n :experience => (x = opts.delete(:experience); x.nil? ? nil : HttpClient::Preconditions.assert_class('experience', x, String)),\n :country => (x = opts.delete(:country); x.nil? ? nil : HttpClient::Preconditions.assert_class('country', x, String)),\n :ip => (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String)),\n :currency => (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String)),\n :language => (x = opts.delete(:language); x.nil? ? nil : HttpClient::Preconditions.assert_class('language', x, String)),\n :expand => (x = opts.delete(:expand); x.nil? ? nil : HttpClient::Preconditions.assert_class('expand', x, Array).map { |v| HttpClient::Preconditions.assert_class('expand', v, String) }),\n :romanize => (x = opts.delete(:romanize); x.nil? ? nil : HttpClient::Preconditions.assert_class('romanize', x, Array).map { |v| HttpClient::Preconditions.assert_class('romanize', v, String) }),\n :context => (x = opts.delete(:context); x.nil? ? nil : HttpClient::Preconditions.assert_class('context', x, String))\n }.delete_if { |k, v| v.nil? }\n (x = order_put_form; x.is_a?(::Io::Flow::V0::Models::OrderPutForm) ? x : ::Io::Flow::V0::Models::OrderPutForm.new(x))\n r = @client.request(\"/#{CGI.escape(organization)}/orders/#{CGI.escape(number)}\").with_query(query).with_json(order_put_form.to_json).put\n ::Io::Flow::V0::Models::Order.new(r)\n end",
"title": ""
},
{
"docid": "6a59f90614bff4fccc59286d95699bb1",
"score": "0.5840632",
"text": "def update number\n puts number\n end",
"title": ""
},
{
"docid": "dd0bd25220ccc6481758ddb7054e66ba",
"score": "0.5827225",
"text": "def set_number\n @number = Numbers.find(params[:id])\n end",
"title": ""
},
{
"docid": "c43d7c2740a67e63603e9d5abc7403a1",
"score": "0.58230126",
"text": "def put_by_number(organization, number, customer_put_form)\n HttpClient::Preconditions.assert_class('organization', organization, String)\n HttpClient::Preconditions.assert_class('number', number, String)\n (x = customer_put_form; x.is_a?(::Io::Flow::V0::Models::CustomerPutForm) ? x : ::Io::Flow::V0::Models::CustomerPutForm.new(x))\n r = @client.request(\"/#{CGI.escape(organization)}/customers/#{CGI.escape(number)}\").with_json(customer_put_form.to_json).put\n ::Io::Flow::V0::Models::Customer.new(r)\n end",
"title": ""
},
{
"docid": "db527bbe5cbc4fc863d3acba4042186b",
"score": "0.576499",
"text": "def update(updates)\n #map internal :number term\n updates[:number]=updates[:number] if !updates[:number].nil?\n \n self.class.collection.find(_id:@id).update_one(:$set=>updates)\n end",
"title": ""
},
{
"docid": "aa1690fd37248e22212ea5b02ac1cb1c",
"score": "0.5756719",
"text": "def put_by_number(organization, number, item_form)\n HttpClient::Preconditions.assert_class('organization', organization, String)\n HttpClient::Preconditions.assert_class('number', number, String)\n HttpClient::Preconditions.assert_class('item_form', item_form, ::Io::Flow::V0::Models::ItemForm)\n r = @client.request(\"/#{CGI.escape(organization)}/catalog/items/#{CGI.escape(number)}\").with_json(item_form.to_json).put\n ::Io::Flow::V0::Models::Item.new(r)\n end",
"title": ""
},
{
"docid": "7ce5b428c770a0de5b6fb2f48d72919d",
"score": "0.57472354",
"text": "def put_by_number(organization, number, order_put_form, incoming={})\n HttpClient::Preconditions.assert_class('organization', organization, String)\n HttpClient::Preconditions.assert_class('number', number, String)\n opts = HttpClient::Helper.symbolize_keys(incoming)\n query = {\n :experience => (x = opts.delete(:experience); x.nil? ? nil : HttpClient::Preconditions.assert_class('experience', x, String)),\n :country => (x = opts.delete(:country); x.nil? ? nil : HttpClient::Preconditions.assert_class('country', x, String)),\n :ip => (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String)),\n :currency => (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String)),\n :language => (x = opts.delete(:language); x.nil? ? nil : HttpClient::Preconditions.assert_class('language', x, String))\n }.delete_if { |k, v| v.nil? }\n HttpClient::Preconditions.assert_class('order_put_form', order_put_form, ::Io::Flow::V0::Models::OrderPutForm)\n r = @client.request(\"/#{CGI.escape(organization)}/orders/#{CGI.escape(number)}\").with_query(query).with_json(order_put_form.to_json).put\n ::Io::Flow::V0::Models::Order.new(r)\n end",
"title": ""
},
{
"docid": "b51e0f58c8728edb823dc3168b0107aa",
"score": "0.57460463",
"text": "def update\n @number = Number.find(params[:id])\n\n respond_to do |format|\n if @number.update_attributes(params[:number])\n format.html { redirect_to(@number, :notice => 'Number was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @number.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "506fcedfb926d394aec91c67bbc657ac",
"score": "0.5741304",
"text": "def put_by_number(organization, number, item_form)\n HttpClient::Preconditions.assert_class('organization', organization, String)\n HttpClient::Preconditions.assert_class('number', number, String)\n (x = item_form; x.is_a?(::Io::Flow::V0::Models::ItemForm) ? x : ::Io::Flow::V0::Models::ItemForm.new(x))\n r = @client.request(\"/#{CGI.escape(organization)}/catalog/items/#{CGI.escape(number)}\").with_json(item_form.to_json).put\n ::Io::Flow::V0::Models::Item.new(r)\n end",
"title": ""
},
{
"docid": "831f27f18ade8f29c89891a798472a22",
"score": "0.5735816",
"text": "def update!(**args)\n @number = args[:number] if args.key?(:number)\n @path = args[:path] if args.key?(:path)\n end",
"title": ""
},
{
"docid": "831f27f18ade8f29c89891a798472a22",
"score": "0.5735816",
"text": "def update!(**args)\n @number = args[:number] if args.key?(:number)\n @path = args[:path] if args.key?(:path)\n end",
"title": ""
},
{
"docid": "e5af07eeab2e65e89da70389b331a11b",
"score": "0.5711125",
"text": "def put_submissions_by_number(organization, number, hash)\n HttpClient::Preconditions.assert_class('organization', organization, String)\n HttpClient::Preconditions.assert_class('number', number, String)\n HttpClient::Preconditions.assert_class('hash', hash, Hash)\n r = @client.request(\"/#{CGI.escape(organization)}/orders/#{CGI.escape(number)}/submissions\").with_json(hash.to_json).put\n ::Io::Flow::V0::Models::Order.new(r)\n end",
"title": ""
},
{
"docid": "712526c8ba8430df4f8d7b502f9b7e22",
"score": "0.5667785",
"text": "def update\n respond_to do |format|\n if @id_number.update(id_number_params)\n format.html { redirect_to @id_number, notice: 'Id number was successfully updated.' }\n format.json { render :show, status: :ok, location: @id_number }\n else\n format.html { render :edit }\n format.json { render json: @id_number.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "51e2aac394f1ce071527ca6da7bcfc11",
"score": "0.5655118",
"text": "def set_number\n @number = Number.find(params[:id])\n end",
"title": ""
},
{
"docid": "51e2aac394f1ce071527ca6da7bcfc11",
"score": "0.5655118",
"text": "def set_number\n @number = Number.find(params[:id])\n end",
"title": ""
},
{
"docid": "51e2aac394f1ce071527ca6da7bcfc11",
"score": "0.5655118",
"text": "def set_number\n @number = Number.find(params[:id])\n end",
"title": ""
},
{
"docid": "51e2aac394f1ce071527ca6da7bcfc11",
"score": "0.5655118",
"text": "def set_number\n @number = Number.find(params[:id])\n end",
"title": ""
},
{
"docid": "51e2aac394f1ce071527ca6da7bcfc11",
"score": "0.5655118",
"text": "def set_number\n @number = Number.find(params[:id])\n end",
"title": ""
},
{
"docid": "51e2aac394f1ce071527ca6da7bcfc11",
"score": "0.5655118",
"text": "def set_number\n @number = Number.find(params[:id])\n end",
"title": ""
},
{
"docid": "62c9f72d0771859b2f4f55b87a25c47a",
"score": "0.56541073",
"text": "def update\n @bingo = Bingo.find(params[:id])\n\n respond_to do |format|\n if @bingo.update_attributes(params[:bingo])\n format.html { redirect_to @bingo, notice: 'Bingo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bingo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d635526063b1cabcf81bcc52431c1510",
"score": "0.56530637",
"text": "def number_params\n params.require(:number).permit(:number, :type, :endpoint)\n end",
"title": ""
},
{
"docid": "2143bb7bc1e27d21896570f69b9ff244",
"score": "0.56380457",
"text": "def update\n @service_number = ServiceNumber.find(params[:id])\n\n if @service_number.update(service_number_params)\n audit(@service_number, current_user)\n head :no_content\n else\n render json: @service_number.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "9cde166d0ccda0df4964c12c048aa867",
"score": "0.5631885",
"text": "def numbering_params\n params.require(:numbering).permit(:number)\n end",
"title": ""
},
{
"docid": "e2199331a4bbc05bf78930f7cfb7019f",
"score": "0.55952835",
"text": "def update\n @operation_number = OperationNumber.find(params[:id])\n\n respond_to do |format|\n if @operation_number.update_attributes(params[:operation_number])\n format.html { redirect_to @operation_number, notice: 'Operation number was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @operation_number.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "719b71dbff0c15d7de5c33bb1fb40d71",
"score": "0.55821896",
"text": "def update\n @numberdetail = Numberdetail.find(params[:id])\n\n respond_to do |format|\n if @numberdetail.update_attributes(params[:numberdetail])\n format.html { redirect_to @numberdetail, notice: 'Numberdetail was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @numberdetail.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8526bda945752e27df3ffdba1b7efea0",
"score": "0.55774003",
"text": "def update_mobile_carrier(args = {}) \n put(\"/mobile.json/#{args[:carrierId]}\", args)\nend",
"title": ""
},
{
"docid": "c049cb16899af7a1433da4296b9656e2",
"score": "0.55735034",
"text": "def update\n respond_to do |format|\n if @number_running.update(number_running_params)\n format.html { redirect_to @number_running, notice: 'Number running was successfully updated.' }\n format.json { render :show, status: :ok, location: @number_running }\n else\n format.html { render :edit }\n format.json { render json: @number_running.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7c0ba30e3f4a666552230e340950b225",
"score": "0.5558823",
"text": "def get_number (number = nil, opts={})\n query_param_keys = [:number]\n headerParams = {}\n\n \n \n # set default values and merge with input\n options = {\n :'number' => number\n \n }.merge(opts)\n\n #resource path\n path = \"/get-number.json\".sub('{format}','json')\n \n # pull querystring keys from options\n queryopts = options.select do |key,value|\n query_param_keys.include? key\n end\n\n # header parameters\n headers = {}\n\n _header_accept = 'application/json'\n if _header_accept != ''\n headerParams['Accept'] = _header_accept\n end \n _header_content_type = ['application/x-www-form-urlencoded']\n headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'\n\n \n \n headers[:'Authorization'] = @api_key_secret\n\n # http body (model)\n post_body = nil\n \n # form parameters\n form_parameter_hash = {}\n \n \n \n Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body, :form_params => form_parameter_hash }).make\n \n \n end",
"title": ""
},
{
"docid": "1e8a43166278a55b9d28ed8c014cee82",
"score": "0.55588156",
"text": "def update\n @tnumber = Tnumber.find(params[:id])\n\n respond_to do |format|\n if @tnumber.update_attributes(params[:tnumber])\n format.html { redirect_to @tnumber, notice: 'Tnumber was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tnumber.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "785450817f43bb5c871649905005c67b",
"score": "0.5554229",
"text": "def update\n respond_to do |format|\n if @numbering.update(numbering_params)\n format.html { redirect_to @numbering, notice: 'Numbering was successfully updated.' }\n format.json { render :show, status: :ok, location: @numbering }\n else\n format.html { render :edit }\n format.json { render json: @numbering.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b31a0c8ba264d03517efcfcce8bba3d4",
"score": "0.5553715",
"text": "def set_number(value)\n @number = value\n refresh\n end",
"title": ""
},
{
"docid": "96f20c7355c2d6e6a95fe15ad3cd1332",
"score": "0.5548284",
"text": "def update\n @test_number = TestNumber.find(params[:id])\n\n respond_to do |format|\n if @test_number.update_attributes(params[:test_number])\n format.html { redirect_to app_test_numbers_path, notice: 'Test number was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @test_number.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1bedfc27d47fd8c2cbedd112c285eb99",
"score": "0.5541337",
"text": "def update_many\n if @user_phone_numbers.update_all(user_phone_number_params)\n render json: @user_phone_numbers, status: :ok, location: user_phone_numbers_url\n else\n render json: @user_phone_numbers.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "668d3ae8643cdfa756b3f1f704fc7d54",
"score": "0.55381167",
"text": "def update\n @special_number = SpecialNumber.find(params[:id])\n\n respond_to do |format|\n if @special_number.update_attributes(params[:special_number])\n format.html { redirect_to @special_number, notice: 'Special number was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @special_number.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "16b9d78e0734ad0df686ba20682fc662",
"score": "0.5515241",
"text": "def update \r\n @existing_identical_book = Book.where(title: book_params[:title],\r\n author: book_params[:author],\r\n genre: book_params[:genre],\r\n subgenre: book_params[:subgenre],\r\n pages: book_params[:pages],\r\n publisher: book_params[:publisher]\r\n ).take\r\n #if an existing identical book exists, then make the book_number match otherwise set to a new book_number\r\n if @existing_identical_book\r\n params[:book_number] = @existing_identical_book.book_number \r\n else\r\n params[:book_number] = Book.maximum(:book_number).to_i.next\r\n end\r\n\r\n respond_to do |format|\r\n if @book.update(book_params.merge!(:book_number => params[:book_number]))\r\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\r\n format.json { render :show, status: :ok, location: @book }\r\n else\r\n format.html { render :edit }\r\n format.json { render json: @book.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "0875f2c6b4df492ca230413aecaa114d",
"score": "0.54997504",
"text": "def update\n @bill = Bill.find(params[:id])\n\n if @bill.update(bill_params)\n head :no_content\n else\n render json: @bill.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "882c8317370987b86425c0adbf5bfe8c",
"score": "0.5498787",
"text": "def update_aos_version(args = {}) \n put(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"title": ""
},
{
"docid": "2572fb900123dab962d92dfd5cd31505",
"score": "0.54981095",
"text": "def update\n spice = Spice.find_by(id: params[:id])\n spice.update(spice_params)\n render json: spice\nend",
"title": ""
},
{
"docid": "6b3f6d449d5d45a39c2ac5611d452d59",
"score": "0.5478154",
"text": "def update\n respond_to do |format|\n if @nonexistent_number.update(nonexistent_number_params)\n format.html { redirect_to @nonexistent_number, notice: \"Nonexistent number was successfully updated.\" }\n format.json { render :show, status: :ok, location: @nonexistent_number }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @nonexistent_number.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5390f3256072d58b56e78ed967bcf8d9",
"score": "0.5460683",
"text": "def reload\n response = @client.get(\"/Numbers/#{self.number_id}\")\n self.set_paramaters(Elk::Util.parse_json(response.body))\n response.code == 200\n end",
"title": ""
},
{
"docid": "0365f869e7600ae335605290cb7f7645",
"score": "0.54523784",
"text": "def increase\n # increment the votes value by 1\n @brewery.votes += 1\n # save new votes value\n if @brewery.save\n # if brewery saves, render json\n render json: @brewery\n # else render error\n else\n render( status: 400, json: {error: \"Could Not Update.\"})\n end\n end",
"title": ""
},
{
"docid": "3cf89a3e01b568cf29abc4a30bfe8b73",
"score": "0.54433507",
"text": "def update_number\n @call = Call.where(:twilio_call_sid => params[:CallSid]).first\n @call.update_attribute(:caller, params[:Digits]) if params[:Digits] and params[:Digits].size > 1 \n respond_to do |format|\n format.html\n format.xml\n end\n end",
"title": ""
},
{
"docid": "aa0b87a16ede7353758305dbbaf57c22",
"score": "0.5439669",
"text": "def put(*a) route 'PUT', *a end",
"title": ""
},
{
"docid": "643ad2d1b463a1fffbf027299c2ad91b",
"score": "0.54328024",
"text": "def update\n respond_to do |format|\n if @auto_number.update(auto_number_params)\n format.html { redirect_to @auto_number, notice: 'Autonumber was successfully updated.' }\n format.json { render :show, status: :ok, location: @auto_number }\n else\n format.html { render :edit }\n format.json { render json: @auto_number.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8f47ef0abe1314116b08bffaa568ccb9",
"score": "0.54182357",
"text": "def put_price_by_number(organization, number, item_price_update_put_form)\n HttpClient::Preconditions.assert_class('organization', organization, String)\n HttpClient::Preconditions.assert_class('number', number, String)\n (x = item_price_update_put_form; x.is_a?(::Io::Flow::V0::Models::ItemPriceUpdatePutForm) ? x : ::Io::Flow::V0::Models::ItemPriceUpdatePutForm.new(x))\n r = @client.request(\"/#{CGI.escape(organization)}/catalog/items/#{CGI.escape(number)}/price\").with_json(item_price_update_put_form.to_json).put\n ::Io::Flow::V0::Models::Item.new(r)\n end",
"title": ""
},
{
"docid": "323b0b58799587eaa4739bbea2799a88",
"score": "0.54166913",
"text": "def update\n respond_to do |format|\n if @special_number.update(special_number_params)\n format.html { redirect_to @special_number, notice: 'Special number was successfully updated.' }\n format.json { render :show, status: :ok, location: @special_number }\n else\n format.html { render :edit }\n format.json { render json: @special_number.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "78b16b256b71f886b732a71708514092",
"score": "0.5410287",
"text": "def update\n @random_number = RandomNumber.find(params[:id])\n\n respond_to do |format|\n if @random_number.update_attributes(params[:random_number])\n format.html { redirect_to @random_number, notice: 'Random number was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @random_number.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b5edb8a9b2cad14c7874c5f42c5809e9",
"score": "0.5398596",
"text": "def test_put_user\n json_data = '{\"name\":\"test\", \"last_name\":\"test\", \"document\" : \"098\"}'\n put '/users/4', json_data\n assert_equal 204, last_response.status, 'Código de respuesta incorrecto'\n end",
"title": ""
},
{
"docid": "a37c72731a654997f0de0289fae266ba",
"score": "0.53939915",
"text": "def lease_number (number = nil, opts={})\n query_param_keys = [:number]\n headerParams = {}\n\n \n \n # set default values and merge with input\n options = {\n :'number' => number\n \n }.merge(opts)\n\n #resource path\n path = \"/lease-number.json\".sub('{format}','json')\n \n # pull querystring keys from options\n queryopts = options.select do |key,value|\n query_param_keys.include? key\n end\n\n # header parameters\n headers = {}\n\n _header_accept = 'application/json'\n if _header_accept != ''\n headerParams['Accept'] = _header_accept\n end \n _header_content_type = ['application/x-www-form-urlencoded']\n headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'\n\n \n \n headers[:'Authorization'] = @api_key_secret\n\n # http body (model)\n post_body = nil\n \n # form parameters\n form_parameter_hash = {}\n \n \n \n Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body, :form_params => form_parameter_hash }).make\n \n \n end",
"title": ""
},
{
"docid": "ddf1016eac2930f09167ef05e51b4a1e",
"score": "0.5382569",
"text": "def update\n respond_to do |format|\n if @number_of_owner.update(number_of_owner_params)\n format.html { redirect_to number_of_owners_path, notice: 'Number of owner was successfully updated.' }\n format.json { render :index, status: :ok }\n else\n format.html { render :edit }\n format.json { render json: @number_of_owner.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "66f90c3cba49daef7e0e817d1923626d",
"score": "0.5374022",
"text": "def fibo_params\n params.require(:fibo).permit(:number)\n end",
"title": ""
},
{
"docid": "8e18db431964c254de53caa41795b702",
"score": "0.5366251",
"text": "def put *args\n make_request :put, *args\n end",
"title": ""
},
{
"docid": "61bf13ed8a67ea31a47b567879e1b2a2",
"score": "0.5365458",
"text": "def set_number(value) @number = value; end",
"title": ""
},
{
"docid": "701e439f21cdb785bcaac6e5c067176a",
"score": "0.53642386",
"text": "def update\n respond_to do |format|\n if @karma_number.update(karma_number_params)\n format.html { redirect_to @karma_number, notice: 'Karma number was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @karma_number.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3551a93e8829fecafd58bf691a860eeb",
"score": "0.53634036",
"text": "def update_object(path, id, info)\n json_parse_reply(*json_put(@target, \"#{path}/#{URI.encode(id)}\", info,\n @auth_header, if_match: info[:meta][:version]))\n end",
"title": ""
},
{
"docid": "198c0fa7f07ef55e950ad5ca968c0711",
"score": "0.53580445",
"text": "def set_order_by_number action, number\n pospal_appid=ENV['POSPAL_APPID']\n pospal_appkey=ENV['POSPAL_APPKEY']\n request_body = {\n 'appId'=> pospal_appid,\n #'orderNo'=> '19032703082989286104'\n 'orderNo'=> number+'104'\n }\n\n #if action=:ship\n uri = URI('https://area24-win.pospal.cn:443/pospal-api2/openapi/v1/orderOpenApi/shipOrder') if action==:ship\n uri = URI('https://area24-win.pospal.cn:443/pospal-api2/openapi/v1/orderOpenApi/completeOrder') if action==:complete\n\n res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|\n req = Net::HTTP::Post.new(uri)\n req['User-Agent']= 'openApi'\n req['Content-Type']= 'application/json; charset=utf-8'\n req['accept-encoding']= 'gzip,deflate'\n req['time-stamp']= Time.now.getutc\n req['data-signature']= Digest::MD5.hexdigest(pospal_appkey + request_body.to_json)\n req.body = request_body.to_json\n http.request(req)\n end\n ap JSON.parse(res.body)\nend",
"title": ""
},
{
"docid": "053503b8cad388f3eec0b0d020cae0dc",
"score": "0.53445756",
"text": "def update\n @train_number = TrainNumber.find(params[:id])\n\n respond_to do |format|\n if @train_number.update_attributes(params[:train_number])\n format.html { redirect_to @train_number, notice: 'Train number was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @train_number.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fbd7c46b15ae2792fd842ba0d764b7d0",
"score": "0.53276575",
"text": "def put uri, args = {}; Request.new(PUT, uri, args).execute; end",
"title": ""
},
{
"docid": "9efe6c3355c0e59ae4eecee13d47f830",
"score": "0.53247136",
"text": "def update\n respond_to do |format|\n if @seq_range_troop_number.update(seq_range_troop_number_params)\n format.html { redirect_to @seq_range_troop_number, notice: 'Seq range troop number was successfully updated.' }\n format.json { render :show, status: :ok, location: @seq_range_troop_number }\n else\n format.html { render :edit }\n format.json { render json: @seq_range_troop_number.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8a1f0c1f8ddc972f5a503254e77189df",
"score": "0.5321886",
"text": "def update\n @phone_number = PhoneNumber.find(params[:id])\n\n respond_to do |format|\n if @phone_number.update_attributes(params[:phone_number])\n format.html { redirect_to @phone_number, notice: 'Phone book was successfully updated.' }\n format.json { head @phone_number.to_json(:include => [:messages]) }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @phone_number.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "765960207346959de1efd7fe20615c71",
"score": "0.5294369",
"text": "def increase\n # increment the votes value by 1\n @beer.votes += 1\n # save new votes value\n if @beer.save\n # if beer saves, render json\n render json: @beer\n # else render error\n else\n render( status: 400, json: {error: \"Could Not Update.\"})\n end\n end",
"title": ""
},
{
"docid": "a21658e8869b48b877bfbe57de8fb717",
"score": "0.5286169",
"text": "def update_contact\n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/contacts/3'\n ).to_s\n\n puts RestClient.put(\n url,\n { Contact: { email: \"wacky_new_email@coolstuff.com\" } } )\n \nend",
"title": ""
},
{
"docid": "92b003314877f108d007ac68445366d4",
"score": "0.52771986",
"text": "def update\n @ticket = Ticket.find(params[:id])\n @possible_numbers = @ticket.event.available_numbers('',5)\n\n respond_to do |format|\n if @ticket.update_attributes(params[:ticket])\n format.html { redirect_to validation_user_ticket_path(current_user, @ticket) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ticket.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ae4d0aa8335fe571a4fcc90ded621164",
"score": "0.5266908",
"text": "def do_update_Json(data, *rest)\n obj, res = REST.put(\"#{self.class.path}/#{id}\",data)\n maybe_json_die(obj,res)\n @blob = obj\n self\n end",
"title": ""
},
{
"docid": "ae4d0aa8335fe571a4fcc90ded621164",
"score": "0.5266908",
"text": "def do_update_Json(data, *rest)\n obj, res = REST.put(\"#{self.class.path}/#{id}\",data)\n maybe_json_die(obj,res)\n @blob = obj\n self\n end",
"title": ""
},
{
"docid": "b2d5fc83a907f25e5176864fa6beb3d0",
"score": "0.52659005",
"text": "def put_rest(path, json) \n run_request(:PUT, create_url(path), json)\n end",
"title": ""
},
{
"docid": "cb1cca99ea20526015e43e253e7aa4cf",
"score": "0.52619565",
"text": "def _update(data, id=nil)\n # a hash holding HTTP headers\n headers = { \"Content-Type\" => \"application/json\", \"Accept\"=>\"application/json\" }\n\n # if we're given an ID use it, otherwise see if there's one in the data object\n if id==nil\n id = data['_id']\n end\n\n # do the HTTP POST request, passing the data object as JSON and the HTTP headers\n response = Net::HTTP.start(@host, @port) do |http|\n http.send_request('PUT', \"/documents/#{id}\", data.to_json, headers)\n end\n\n # show response body\n p response['content-type']\n p response.body\n\n # response should be JSON\n assert response['content-type'].match( /application\\/json/ )\n end",
"title": ""
},
{
"docid": "2752d857d53f4c5454f55b3a7f2aa54c",
"score": "0.52615416",
"text": "def test_update_stat\n\t\tput '/stats/8', {json: '{\"statkey\":\"m\", \"statvalue\": \"i\"}'}\n\t\tassert_equal 'm', @j[:name]\n\t\tassert_equal 'i', @j[:value]\n\t\tput '/stats/99', {json: '{\"statkey\":\"m\"}'}\n\t\tassert_equal 'Not Found', @j[:title]\n\t\tput '/stats/8', {json: '{\"person_id\":\"boop\"}'}\n\t\tassert @j[:title].include? 'invalid input syntax'\n\tend",
"title": ""
},
{
"docid": "a1204369dc16931bdecf670360596b08",
"score": "0.52598566",
"text": "def put_request(url, object)\n results = @@client.put url, object\n results.to_json\nend",
"title": ""
},
{
"docid": "0f0cfea555bc32f300e175b38a13a4e3",
"score": "0.52531135",
"text": "def put_rest_call(path, body)\n uri = URI.parse('#{@base_url}#{path}')\n request = Net::HTTP::Put.new(uri.path)\n request.body = JSON.generate(body)\n request.content_type = 'application/json'\n return JSON.parse(send_request(request, uri).body)\n end",
"title": ""
},
{
"docid": "eb550615010ae00d41ba93bcb049c849",
"score": "0.52517503",
"text": "def update\n if @nitrogen.update(nitrogen_params)\n render json @nitrogen\n else\n render json: @nitrogen.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "b97d122d3b26ae00eccd1d8d9d83550e",
"score": "0.52437186",
"text": "def number=(value)\n @number = value\n end",
"title": ""
},
{
"docid": "fbb154377633694bce0bb3006aaf19a7",
"score": "0.52390987",
"text": "def update\n respond_to do |format|\n if @numer_osoba.update(numer_osoba_params)\n format.html { redirect_to @numer_osoba, notice: 'Numer osoba was successfully updated.' }\n format.json { render :show, status: :ok, location: @numer_osoba }\n else\n format.html { render :edit }\n format.json { render json: @numer_osoba.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7e278d15df18479c4e86f835f84ff13c",
"score": "0.5235769",
"text": "def index\n @phone = Phone.last\n @user = User.last\n # uri = \"#{API_BASE_URL}.json\" # specifying json format in the URl\n # uripost = \"#{API_BASE_URL}\"\n # rest_resource = RestClient::Resource.new(uri, USERNAME, PASSWORD)\n # rest_resource_put = RestClient::Resource.new(uripost, USERNAME, PASSWORD)\n # users = rest_resource.get\n # @users = JSON.parse(users, :symbolize_names => true) # we will convert the return\n # @user.id = @users[-1][:id]\n # if !User.exists?(@user.id)\n # @user.save\n\n #\n # else\n #\n # end\n\n user_api = RestClient::Resource.new('https://instantsignup.pixfizz.com', :user => USERNAME , :password => PASSWORD)\n result = user_api[\"/v1/users/17659022.json\"].put({:user =>{\"first_name\":\"Floyd\"}})\n\n # result = user_api[\"/v1/users/#{@user.id}.json\"].put({:user =>{\"custom\" => {\"telephone\":\"#{@phone.number}\"}}})\n result = user_api[\"/v1/users/#{@user.id}.json\"].put({:user =>{\"custom\" => {\"vercode\":\"#{@phone.vercode}\"}}})\n\n\n redirect_to \"http://instantsignup.pixfizz.com/site/nextsteps\"\n\n\nend",
"title": ""
},
{
"docid": "85fb97f43e7d1c36808c0725d5a2a8ef",
"score": "0.5233359",
"text": "def update\n respond_with Biblebook.update(params[:id], params[:biblebook])\n end",
"title": ""
},
{
"docid": "989394e6825a471dd333e1a002f0619f",
"score": "0.52295595",
"text": "def set_number\n @number = Number.includes(:sequence).find(params[:id])\n end",
"title": ""
},
{
"docid": "fff8b42237f137206cea3041fb49c7ca",
"score": "0.52278215",
"text": "def add_one\n @habit.streak = @habit.streak + 1\n render json: @habit, location: @habit if @habit.save\n end",
"title": ""
},
{
"docid": "75a748795770fc4cb8f7f26253a9f97e",
"score": "0.5221773",
"text": "def setInt(number)\n end",
"title": ""
},
{
"docid": "ea416b077fa0aa7e84ec3fe2ef9c3772",
"score": "0.52180445",
"text": "def put\n request_method('PUT')\n end",
"title": ""
},
{
"docid": "4164ef2c0cf72a7269825bc4c098c623",
"score": "0.5207601",
"text": "def update\n respond_to do |format|\n if @enneagram_number.update(enneagram_number_params)\n format.html { redirect_to @enneagram_number, notice: 'Enneagram number was successfully updated.' }\n format.json { render :show, status: :ok, location: @enneagram_number }\n else\n format.html { render :edit }\n format.json { render json: @enneagram_number.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8194f4b1874c4dff902b45f3739ec5fd",
"score": "0.5200519",
"text": "def update(data)\n @client.make_request(:post, @client.concat_user_path(\"#{PHONENUMBER_PATH}/#{id}\"), data)[0]\n end",
"title": ""
},
{
"docid": "6eccf0cb1ebc7404a9ae8d73fad0c91a",
"score": "0.519936",
"text": "def put(*args)\n request :put, *args\n end",
"title": ""
},
{
"docid": "db42e9ab6b58b252951fd3bda8c8df70",
"score": "0.5193468",
"text": "def update\n respond_to do |format|\n if @static_number.update(static_number_params)\n format.html { redirect_to @static_number, notice: 'Static number was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @static_number.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fe34f93da0751ad55cc5052cfdd2366c",
"score": "0.5191133",
"text": "def update\n render json: Person.update(params[\"id\"], params[\"person\"])\n end",
"title": ""
},
{
"docid": "b368e0f6892977c6218ffe1bb91c6252",
"score": "0.5190177",
"text": "def update!(**args)\n @numbers = args[:numbers] if args.key?(:numbers)\n @text = args[:text] if args.key?(:text)\n end",
"title": ""
},
{
"docid": "902bae5bf37430d6d1081373e9e764b9",
"score": "0.51859176",
"text": "def number=(value)\n @number = value\n end",
"title": ""
},
{
"docid": "29da846aa209b235f6c55726ea88a65b",
"score": "0.51818126",
"text": "def update_number\n\t\tsql = \"update Number\"\n\t\treturn sql\n\tend",
"title": ""
},
{
"docid": "906e5680eed46d3ac1b31e524b36ab7e",
"score": "0.5181563",
"text": "def put_int(*ints)\n ints.each { |i| request << [i].pack('N') }\n end",
"title": ""
},
{
"docid": "01cca233cc2c79a41e783dfd5ba4a5f0",
"score": "0.5175773",
"text": "def update\n @next_pick_number = NextPickNumber.find(params[:id])\n\n respond_to do |format|\n if @next_pick_number.update_attributes(params[:next_pick_number])\n format.html { redirect_to @next_pick_number, notice: 'Next pick number was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @next_pick_number.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8be9979ec5579577230921728fbfcb5a",
"score": "0.5166779",
"text": "def update\n @who_number = WhoNumber.find(params[:id])\n\n respond_to do |format|\n if @who_number.update_attributes(params[:who_number])\n format.html { redirect_to(@who_number, :notice => 'WhoNumber was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @who_number.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2880768f76fffa0441d23875311afb32",
"score": "0.51532745",
"text": "def update(pokemon_number: @pokemon_number, name: @name)\n # Properties\n @pokemon_number = pokemon_number\n @name = name\n\n save\n end",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2
|
Use callbacks to share common setup or constraints between actions.
|
[
{
"docid": "0978b61f0d85c87b365760dc9a2cb663",
"score": "0.0",
"text": "def set_knowledge\n @knowledge = Knowledge.find(params[:id])\n end",
"title": ""
}
] |
[
{
"docid": "bd89022716e537628dd314fd23858181",
"score": "0.6163163",
"text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"title": ""
},
{
"docid": "3db61e749c16d53a52f73ba0492108e9",
"score": "0.6045976",
"text": "def action_hook; end",
"title": ""
},
{
"docid": "b8b36fc1cfde36f9053fe0ab68d70e5b",
"score": "0.5946146",
"text": "def run_actions; end",
"title": ""
},
{
"docid": "3e521dbc644eda8f6b2574409e10a4f8",
"score": "0.591683",
"text": "def define_action_hook; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5890051",
"text": "def actions; end",
"title": ""
},
{
"docid": "bfb8386ef5554bfa3a1c00fa4e20652f",
"score": "0.58349305",
"text": "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "6c8e66d9523b9fed19975542132c6ee4",
"score": "0.5776858",
"text": "def add_actions; end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5703237",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5703237",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "6ce8a8e8407572b4509bb78db9bf8450",
"score": "0.5652805",
"text": "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"title": ""
},
{
"docid": "1964d48e8493eb37800b3353d25c0e57",
"score": "0.5621621",
"text": "def define_action_helpers; end",
"title": ""
},
{
"docid": "5df9f7ffd2cb4f23dd74aada87ad1882",
"score": "0.54210985",
"text": "def post_setup\n end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411113",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411113",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411113",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5391541",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "f099a8475f369ce73a38d665b6ee6877",
"score": "0.53794575",
"text": "def action_run\n end",
"title": ""
},
{
"docid": "2c4e5a90aa8efaaa3ed953818a9b30d2",
"score": "0.5357573",
"text": "def execute(setup)\n @action.call(setup)\n end",
"title": ""
},
{
"docid": "0464870c8688619d6c104d733d355b3b",
"score": "0.53402257",
"text": "def define_action_helpers?; end",
"title": ""
},
{
"docid": "0e7bdc54b0742aba847fd259af1e9f9e",
"score": "0.53394014",
"text": "def set_actions\n actions :all\n end",
"title": ""
},
{
"docid": "5510330550e34a3fd68b7cee18da9524",
"score": "0.53321576",
"text": "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"title": ""
},
{
"docid": "97c8901edfddc990da95704a065e87bc",
"score": "0.53124547",
"text": "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"title": ""
},
{
"docid": "4f9a284723e2531f7d19898d6a6aa20c",
"score": "0.529654",
"text": "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"title": ""
},
{
"docid": "83684438c0a4d20b6ddd4560c7683115",
"score": "0.5296262",
"text": "def before_actions(*logic)\n self.before_actions = logic\n end",
"title": ""
},
{
"docid": "210e0392ceaad5fc0892f1335af7564b",
"score": "0.52952296",
"text": "def setup_handler\n end",
"title": ""
},
{
"docid": "a997ba805d12c5e7f7c4c286441fee18",
"score": "0.52600986",
"text": "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"title": ""
},
{
"docid": "1d50ec65c5bee536273da9d756a78d0d",
"score": "0.52442724",
"text": "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "635288ac8dd59f85def0b1984cdafba0",
"score": "0.5232394",
"text": "def workflow\n end",
"title": ""
},
{
"docid": "e34cc2a25e8f735ccb7ed8361091c83e",
"score": "0.523231",
"text": "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"title": ""
},
{
"docid": "78b21be2632f285b0d40b87a65b9df8c",
"score": "0.5227454",
"text": "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"title": ""
},
{
"docid": "6350959a62aa797b89a21eacb3200e75",
"score": "0.52226824",
"text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"title": ""
},
{
"docid": "923ee705f0e7572feb2c1dd3c154b97c",
"score": "0.52201617",
"text": "def process_action(...)\n send_action(...)\n end",
"title": ""
},
{
"docid": "b89a3908eaa7712bb5706478192b624d",
"score": "0.5212327",
"text": "def before_dispatch(env); end",
"title": ""
},
{
"docid": "7115b468ae54de462141d62fc06b4190",
"score": "0.52079266",
"text": "def after_actions(*logic)\n self.after_actions = logic\n end",
"title": ""
},
{
"docid": "d89a3e408ab56bf20bfff96c63a238dc",
"score": "0.52050185",
"text": "def setup\n # override and do something appropriate\n end",
"title": ""
},
{
"docid": "62c402f0ea2e892a10469bb6e077fbf2",
"score": "0.51754695",
"text": "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"title": ""
},
{
"docid": "72ccb38e1bbd86cef2e17d9d64211e64",
"score": "0.51726824",
"text": "def setup(_context)\n end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51710224",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "1fd817f354d6cb0ff1886ca0a2b6cce4",
"score": "0.5166172",
"text": "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"title": ""
},
{
"docid": "5531df39ee7d732600af111cf1606a35",
"score": "0.5159343",
"text": "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"title": ""
},
{
"docid": "bb6aed740c15c11ca82f4980fe5a796a",
"score": "0.51578903",
"text": "def determine_valid_action\n\n end",
"title": ""
},
{
"docid": "b38f9d83c26fd04e46fe2c961022ff86",
"score": "0.51522785",
"text": "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"title": ""
},
{
"docid": "199fce4d90958e1396e72d961cdcd90b",
"score": "0.5152022",
"text": "def startcompany(action)\n @done = true\n action.setup\n end",
"title": ""
},
{
"docid": "994d9fe4eb9e2fc503d45c919547a327",
"score": "0.51518047",
"text": "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"title": ""
},
{
"docid": "62fabe9dfa2ec2ff729b5a619afefcf0",
"score": "0.51456624",
"text": "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"title": ""
},
{
"docid": "faddd70d9fef5c9cd1f0d4e673e408b9",
"score": "0.51398855",
"text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"title": ""
},
{
"docid": "adb8115fce9b2b4cb9efc508a11e5990",
"score": "0.5133759",
"text": "def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"title": ""
},
{
"docid": "e1dd18cf24d77434ec98d1e282420c84",
"score": "0.5112076",
"text": "def setup(&block)\n define_method(:setup, &block)\n end",
"title": ""
},
{
"docid": "3b4fb29fa45f95d436fd3a8987f12de7",
"score": "0.5111866",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "3b4fb29fa45f95d436fd3a8987f12de7",
"score": "0.5111866",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110294",
"text": "def action\n end",
"title": ""
},
{
"docid": "f54964387b0ee805dbd5ad5c9a699016",
"score": "0.5106169",
"text": "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"title": ""
},
{
"docid": "35b302dd857a031b95bc0072e3daa707",
"score": "0.509231",
"text": "def config(action, *args); end",
"title": ""
},
{
"docid": "bc3cd61fa2e274f322b0b20e1a73acf8",
"score": "0.50873137",
"text": "def setup\n @setup_proc.call(self) if @setup_proc\n end",
"title": ""
},
{
"docid": "5c3cfcbb42097019c3ecd200acaf9e50",
"score": "0.5081088",
"text": "def before_action \n end",
"title": ""
},
{
"docid": "246840a409eb28800dc32d6f24cb1c5e",
"score": "0.508059",
"text": "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"title": ""
},
{
"docid": "dfbcf4e73466003f1d1275cdf58a926a",
"score": "0.50677156",
"text": "def action\n end",
"title": ""
},
{
"docid": "36eb407a529f3fc2d8a54b5e7e9f3e50",
"score": "0.50562143",
"text": "def matt_custom_action_begin(label); end",
"title": ""
},
{
"docid": "b6c9787acd00c1b97aeb6e797a363364",
"score": "0.5050554",
"text": "def setup\n # override this if needed\n end",
"title": ""
},
{
"docid": "9fc229b5b48edba9a4842a503057d89a",
"score": "0.50474834",
"text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"title": ""
},
{
"docid": "9fc229b5b48edba9a4842a503057d89a",
"score": "0.50474834",
"text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"title": ""
},
{
"docid": "fd421350722a26f18a7aae4f5aa1fc59",
"score": "0.5036181",
"text": "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"title": ""
},
{
"docid": "d02030204e482cbe2a63268b94400e71",
"score": "0.5026331",
"text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"title": ""
},
{
"docid": "4224d3231c27bf31ffc4ed81839f8315",
"score": "0.5022976",
"text": "def after(action)\n invoke_callbacks *options_for(action).after\n end",
"title": ""
},
{
"docid": "24506e3666fd6ff7c432e2c2c778d8d1",
"score": "0.5015441",
"text": "def pre_task\n end",
"title": ""
},
{
"docid": "0c16dc5c1875787dacf8dc3c0f871c53",
"score": "0.50121695",
"text": "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"title": ""
},
{
"docid": "c99a12c5761b742ccb9c51c0e99ca58a",
"score": "0.5000944",
"text": "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"title": ""
},
{
"docid": "0cff1d3b3041b56ce3773d6a8d6113f2",
"score": "0.5000019",
"text": "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"title": ""
},
{
"docid": "791f958815c2b2ac16a8ca749a7a822e",
"score": "0.4996878",
"text": "def setup_signals; end",
"title": ""
},
{
"docid": "6e44984b54e36973a8d7530d51a17b90",
"score": "0.4989888",
"text": "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"title": ""
},
{
"docid": "6e44984b54e36973a8d7530d51a17b90",
"score": "0.4989888",
"text": "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"title": ""
},
{
"docid": "5aa51b20183964c6b6f46d150b0ddd79",
"score": "0.49864885",
"text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"title": ""
},
{
"docid": "7647b99591d6d687d05b46dc027fbf23",
"score": "0.49797225",
"text": "def initialize(*args)\n super\n @action = :set\nend",
"title": ""
},
{
"docid": "67e7767ce756766f7c807b9eaa85b98a",
"score": "0.49785787",
"text": "def after_set_callback; end",
"title": ""
},
{
"docid": "2a2b0a113a73bf29d5eeeda0443796ec",
"score": "0.4976161",
"text": "def setup\n #implement in subclass;\n end",
"title": ""
},
{
"docid": "63e628f34f3ff34de8679fb7307c171c",
"score": "0.49683493",
"text": "def lookup_action; end",
"title": ""
},
{
"docid": "a5294693c12090c7b374cfa0cabbcf95",
"score": "0.4965126",
"text": "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"title": ""
},
{
"docid": "57dbfad5e2a0e32466bd9eb0836da323",
"score": "0.4958034",
"text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"title": ""
},
{
"docid": "5b6d613e86d3d68152f7fa047d38dabb",
"score": "0.49559742",
"text": "def release_actions; end",
"title": ""
},
{
"docid": "4aceccac5b1bcf7d22c049693b05f81c",
"score": "0.4954353",
"text": "def around_hooks; end",
"title": ""
},
{
"docid": "2318410efffb4fe5fcb97970a8700618",
"score": "0.49535993",
"text": "def save_action; end",
"title": ""
},
{
"docid": "64e0f1bb6561b13b482a3cc8c532cc37",
"score": "0.4952725",
"text": "def setup(easy)\n super\n easy.customrequest = @verb\n end",
"title": ""
},
{
"docid": "fbd0db2e787e754fdc383687a476d7ec",
"score": "0.49467874",
"text": "def action_target()\n \n end",
"title": ""
},
{
"docid": "b280d59db403306d7c0f575abb19a50f",
"score": "0.49423352",
"text": "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"title": ""
},
{
"docid": "9f7547d93941fc2fcc7608fdf0911643",
"score": "0.49325448",
"text": "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"title": ""
},
{
"docid": "da88436fe6470a2da723e0a1b09a0e80",
"score": "0.49282882",
"text": "def before_setup\n # do nothing by default\n end",
"title": ""
},
{
"docid": "17ffe00a5b6f44f2f2ce5623ac3a28cd",
"score": "0.49269363",
"text": "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"title": ""
},
{
"docid": "21d75f9f5765eb3eb36fcd6dc6dc2ec3",
"score": "0.49269104",
"text": "def default_action; end",
"title": ""
},
{
"docid": "3ba85f3cb794f951b05d5907f91bd8ad",
"score": "0.49252945",
"text": "def setup(&blk)\n @setup_block = blk\n end",
"title": ""
},
{
"docid": "80834fa3e08bdd7312fbc13c80f89d43",
"score": "0.4923091",
"text": "def callback_phase\n super\n end",
"title": ""
},
{
"docid": "f1da8d654daa2cd41cb51abc7ee7898f",
"score": "0.49194667",
"text": "def advice\n end",
"title": ""
},
{
"docid": "99a608ac5478592e9163d99652038e13",
"score": "0.49174926",
"text": "def _handle_action_missing(*args); end",
"title": ""
},
{
"docid": "9e264985e628b89f1f39d574fdd7b881",
"score": "0.49173003",
"text": "def duas1(action)\n action.call\n action.call\nend",
"title": ""
},
{
"docid": "399ad686f5f38385ff4783b91259dbd7",
"score": "0.49171105",
"text": "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"title": ""
},
{
"docid": "0dccebcb0ecbb1c4dcbdddd4fb11bd8a",
"score": "0.4915879",
"text": "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"title": ""
},
{
"docid": "6e0842ade69d031131bf72e9d2a8c389",
"score": "0.49155936",
"text": "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend",
"title": ""
}
] |
e40cef118043ad638f5facbd2a0c7c35
|
If the cell is printed, return a character based on whether or not it is alive.
|
[
{
"docid": "642bf60bacfe1242c76f4174e0b2ae62",
"score": "0.63601124",
"text": "def to_s\n alive? ? \"\\u25CF\" : \"\\u0020\"\n end",
"title": ""
}
] |
[
{
"docid": "d489ce9b60b763a6e34943fb3fe67522",
"score": "0.7202193",
"text": "def get_character\n is_alive? ? \"(`(●●)´)\" : \"(x(●●)x)\"\n end",
"title": ""
},
{
"docid": "6d517aec3087aa06091fd1649b40ef37",
"score": "0.71509504",
"text": "def get_character\n character = \" (....) \\n\"\n character += is_alive? ? \"(0 .. 0)\" : \"(X .. X)\"\n end",
"title": ""
},
{
"docid": "c04b1e26e338625e4b95188fbd8e2fc0",
"score": "0.65154254",
"text": "def character_at(column, row)\n case @board[column][row]\n when :x\n 'X'\n when :o\n 'O'\n else\n ' '\n end\n end",
"title": ""
},
{
"docid": "9b41fba7a609c2a908859f51f8a12b4b",
"score": "0.6355159",
"text": "def render(show_cell = false)\n if !empty? && ship.sunk?\n \"X\"\n elsif fired_upon? && empty?\n \"M\"\n elsif !empty? && fired_upon?\n \"H\"\n elsif show_cell && !empty?\n \"S\"\n else\n \".\"\n end\n end",
"title": ""
},
{
"docid": "50438dce98dd1f7ff1eab66086480ea2",
"score": "0.632667",
"text": "def print_lost_board(cell)\n print_alphabet\n (0..@row_count).each do |row|\n print_this_letter(row)\n (0..@col_count).each do |col|\n if row == cell[0] && col == cell[1]\n print('X ')\n elsif @board[[row, col]].has_mine?\n print('* ')\n elsif @board[[row, col]].hidden?\n print('_ ')\n elsif @board[[row, col]].count_of_mines_around.zero?\n print ' '\n else\n print(@board[[row, col]].count_of_mines_around.to_s + ' ')\n end\n end\n print(\"\\n\")\n end\n end",
"title": ""
},
{
"docid": "c17097b5e0121963ccf14096ff2fd15c",
"score": "0.6271845",
"text": "def get_char(cell)\n return nil if cell == nil\n ch = nil\n\n if cell.y < @input.lines.count\n line = @input.lines[cell.y]\n ch = line[cell.x]\n end\n end",
"title": ""
},
{
"docid": "26d972d6f93461b13222735076e166f7",
"score": "0.61266893",
"text": "def render_cell(x,y)\n case num_fighters_in_cell(x,y)\n # Two fighters in the cell, so we display a !.\n when 2\n \"!\"\n\n # One fighter in the cell.\n when 1\n fighter_icon_at(x,y)\n\n # No fighters, so this is a blank cell.\n when 0\n \" \"\n end\n end",
"title": ""
},
{
"docid": "aee50ffaf71ab08391ad071671a3a43a",
"score": "0.61196834",
"text": "def render_cell(x,y)\n case num_fighters_in_cell x,y\n # Two fighters in the cell, so we display a !.\n when 2\n \"!\"\n\n # One fighter in the cell.\n when 1\n fighter_icon_at x,y\n\n # No fighters, so this is a blank cell.\n when 0\n \" \"\n end\n end",
"title": ""
},
{
"docid": "ca82585a3cc75ab63ad80ac036b470d0",
"score": "0.61172754",
"text": "def print_neat\n alive = 0\n dead = 0\n @cells.each do |row|\n print '|'\n row.each do |col|\n if col.alive?\n print 'X|'\n alive += 1\n else\n print ' |'\n dead += 1\n end\n end\n print \"\\n\"\n end\n print \"Amount alive is : #{alive} \\n\"\n print \"Amount dead is : #{dead} \\n\"\n end",
"title": ""
},
{
"docid": "130dd5b8573187c5178dc6a1cbb6447f",
"score": "0.60947025",
"text": "def character?\n !!@character\n end",
"title": ""
},
{
"docid": "f24823ab61e681ad7bad02c039d92eb2",
"score": "0.60619354",
"text": "def format_printable(word)\n if @word_size == 1\n PRINTABLE[word]\n elsif word >= 0 && word <= 0x7fffffff\n # XXX: https://github.com/jruby/jruby/issues/6652\n char = word.chr(Encoding::UTF_8) rescue nil\n char || UNPRINTABLE\n else\n UNPRINTABLE\n end\n end",
"title": ""
},
{
"docid": "875eb9080fc375e4a9f15f03d6091bd0",
"score": "0.605239",
"text": "def get_character; end",
"title": ""
},
{
"docid": "f95039391b141101e3d79942b6cb73bc",
"score": "0.60044587",
"text": "def to_s()\n\t\tcase @state\n\t\t\twhen CELL_WHITE\n\t\t\t\treturn \"█\"\n\t\t\twhen CELL_CROSSED\n\t\t\t\treturn \"X\"\n\t\t\twhen CELL_BLACK\n\t\t\t\treturn \"░\"\n\t\tend\n\t\traise \"Wrong cell state\"\n\tend",
"title": ""
},
{
"docid": "13b63e1e433ba977df67b0e540cbe479",
"score": "0.5981429",
"text": "def next_cell(char, row, col)\n neighbour_count = neighbours_count(row, col)\n\n #if char == \"*\" && (2..3).include?(neighbour_count)\n # return char\n #elsif char == \" \" && neighbour_count == 3\n # \"*\"\n #elsif char == \"\\n\"\n # char\n #else\n # \" \"\n #end\n\n if char == \"*\"\n if (2..3).include? neighbour_count\n char\n else\n \" \"\n end\n else\n if neighbour_count == 3\n \"*\"\n else\n char\n end\n end\n end",
"title": ""
},
{
"docid": "2d99e973609c400bc87baa8151a372c9",
"score": "0.59514886",
"text": "def full?\n !@board.cells.detect{|i| i == \" \"}\n end",
"title": ""
},
{
"docid": "2266c91feb7d1137100ea52165a25685",
"score": "0.59441024",
"text": "def dead_or_alive?(row, col)\n cell = cell(row, col)\n living_neighbors = living_neighbors(row, col)\n\n if living_neighbors == 3\n LIVE_CELL\n elsif living_neighbors == 2\n cell\n else\n DEAD_CELL\n end\n end",
"title": ""
},
{
"docid": "d389720e7407e6ca456af596a0eccea5",
"score": "0.592627",
"text": "def to_s\n alive? ? 'x' : '.'\n end",
"title": ""
},
{
"docid": "adcaa7d6de1f2a18ae21b83198ce2d82",
"score": "0.59222317",
"text": "def char\n return @char\n end",
"title": ""
},
{
"docid": "069a09c9d6fad0c951d086aabc8f7ea6",
"score": "0.5895696",
"text": "def printable?; self >= 0x20 and self <= 0x7e; end",
"title": ""
},
{
"docid": "d97aa318eb846a27c39053c9b93d89c5",
"score": "0.58654714",
"text": "def has_piece?(cell)\n cell != \"--\"\n end",
"title": ""
},
{
"docid": "3e5d3a7f1f0b62192316161308eab398",
"score": "0.58428264",
"text": "def character; end",
"title": ""
},
{
"docid": "3e5d3a7f1f0b62192316161308eab398",
"score": "0.58428264",
"text": "def character; end",
"title": ""
},
{
"docid": "272a2b6ac3bbb0696e35365f218de9d6",
"score": "0.58412105",
"text": "def live?(x, y)\n puts @cells[x][y]\n end",
"title": ""
},
{
"docid": "9cfe49fd70ca2328ff4077aeeda72618",
"score": "0.5833865",
"text": "def cell_alive(x,y)\n if @matrix[x] && @matrix[x][y]\n @matrix[x][y] == 'O' ? true : false\n else\n false\n end\n end",
"title": ""
},
{
"docid": "5525448b927a697040a149b8f4aaf243",
"score": "0.582877",
"text": "def printable_char value\n case\n when !value\n spacer\n when value.is_a?( Integer )\n letter_from_digit value\n else\n value\n end\nend",
"title": ""
},
{
"docid": "5e7e8ac507def866d517f662aeb13302",
"score": "0.5823464",
"text": "def full?\n board.cells.any? {|i| i == \" \"}\n end",
"title": ""
},
{
"docid": "0634a8b739145846871adb38f6e9b90d",
"score": "0.5818022",
"text": "def show_character( row, col )\n old_top_line = @top_line\n old_left_column = @left_column\n\n while row < @top_line + @settings[ \"view.margin.y\" ]\n amount = (-1) * @settings[ \"view.jump.y\" ]\n break if( pitch_view( amount, DONT_PITCH_CURSOR, DONT_DISPLAY ) != amount )\n end\n while row > @top_line + $diakonos.main_window_height - 1 - @settings[ \"view.margin.y\" ]\n amount = @settings[ \"view.jump.y\" ]\n break if( pitch_view( amount, DONT_PITCH_CURSOR, DONT_DISPLAY ) != amount )\n end\n\n while col < @left_column + @settings[ \"view.margin.x\" ]\n amount = (-1) * @settings[ \"view.jump.x\" ]\n break if( pan_view( amount, DONT_DISPLAY ) != amount )\n end\n while col > @left_column + $diakonos.main_window_width - @settings[ \"view.margin.x\" ] - 2\n amount = @settings[ \"view.jump.x\" ]\n break if( pan_view( amount, DONT_DISPLAY ) != amount )\n end\n\n @top_line != old_top_line or @left_column != old_left_column\n end",
"title": ""
},
{
"docid": "25f7bfc035527e92da8884063ca07a73",
"score": "0.58096397",
"text": "def currently_alive?(cell)\n @cells.include? cell\n end",
"title": ""
},
{
"docid": "934987611b940e60e6bdf314c3f7ea04",
"score": "0.58012843",
"text": "def display(gameOver = false)\n return '✖' if gameOver && @state.bomb\n return ADJ_BOMBS_CHAR[@adj_bombs] if @state.uncovered || gameOver\n return '✔' if @state.flagged\n '■'\n end",
"title": ""
},
{
"docid": "835c84a152767dc1988f1b301a9f18fe",
"score": "0.5770445",
"text": "def full?\n !@cells.detect{|i| i == \" \"}\n end",
"title": ""
},
{
"docid": "73987f8c793ec151268c4d90650b623f",
"score": "0.57687765",
"text": "def display_board\n cell = \" \"\n devider = \"|\"\n dash = \"-----------\"\n print cell\n print devider\n print cell\n print devider\n puts cell\n puts dash\n print cell\n print devider\n print cell\n print devider\n puts cell\n puts dash\n print cell\n print devider\n print cell\n print devider\n puts cell\nend",
"title": ""
},
{
"docid": "14419e68d43406e117009a9677323c4c",
"score": "0.57663035",
"text": "def print_board\n @board.each do |row|\n row_status = \"\"\n row.each do |piece|\n if piece == true\n row_status << \"X\"\n else\n row_status << \"O\"\n end\n end\n puts row_status\n end\n end",
"title": ""
},
{
"docid": "38b5009d57cd3df1eb8ae04e869c405a",
"score": "0.57446754",
"text": "def char\n\t\t@char\n\tend",
"title": ""
},
{
"docid": "d53696ee61830604cfc59ff50dc3cd98",
"score": "0.5732903",
"text": "def display\n empty_symbol = (@gray ? Tile::GRAY_EMPTY_SYMBOL : Tile::WHITE_EMPTY_SYMBOL)\n occupied? ? @piece.symbol : empty_symbol\n end",
"title": ""
},
{
"docid": "1fcb6d871ad96edfb5d99911b6c586e8",
"score": "0.5730269",
"text": "def print\n s = ''\n @size.times do |r|\n # Top off each row\n s << \"-\" * (@size * 2 + 1)\n s << \"\\n|\"\n @size.times do |c|\n if self.get_cell(r,c).is_alive?\n s << 'x|'\n else\n s << ' |'\n end\n end\n s << \"\\n\"\n end\n\n # Cap it and print\n s << \"-\" * (@size * 2 + 1)\n puts s\n end",
"title": ""
},
{
"docid": "1d9d6886b31b75bd68dd71bd4c614c4c",
"score": "0.5726286",
"text": "def alive?(r,c)\r\n\t\treturn false if @board[r][c] == DEAD_CELL\r\n\t\treturn true\r\n\tend",
"title": ""
},
{
"docid": "02ad46108f290209a074ef55eac23774",
"score": "0.5710666",
"text": "def printAsChar\n\t\t@output << stackPop.chr\n\tend",
"title": ""
},
{
"docid": "22c3f52455a5b230605e11d4b532ac0b",
"score": "0.5697232",
"text": "def cell(x,y)\n @maze[(COLS*(y-1)+x)-1].chr\n end",
"title": ""
},
{
"docid": "9958809e8f7b7ceb4499a628eb1559e9",
"score": "0.5690229",
"text": "def is_alive?(row,col)\n if @matrix[row][col] == \"x\"\n return true\n end\n end",
"title": ""
},
{
"docid": "d9f080b6ac1629a8328cbb220e118e6d",
"score": "0.56827736",
"text": "def alive?(cell_key)\n @board[cell_key] == :alive\n end",
"title": ""
},
{
"docid": "f629c017932009ca2bef510124ccce8c",
"score": "0.5675956",
"text": "def winner\n win_char = nil\n if won? != false\n win_char = @board[won?[0]]\n end\n return win_char\n end",
"title": ""
},
{
"docid": "7cd84b6c5a7b18f19e7f94a00a09681f",
"score": "0.5674987",
"text": "def [](row, col)\n return self.cells[[row, col]] || \"\"\n end",
"title": ""
},
{
"docid": "442a31b4d4abeb8c8b4e8ad52c83d609",
"score": "0.56708854",
"text": "def full?\n board.cells.none? do | position |\n position == \" \"\n end\n end",
"title": ""
},
{
"docid": "33bca24c2371ce8681d478a471bce0b7",
"score": "0.56511486",
"text": "def cell_to_s(idx)\n if @cells[idx].nil?\n \"_\"\n elsif @cells[idx].class == Fixnum\n \"#{@cells[idx]}\"\n else\n \"#{idx.to_s}\" # More than one possible value; just print cell letter\n end\n end",
"title": ""
},
{
"docid": "ad6368356f180392456641454adc17df",
"score": "0.5644788",
"text": "def print_board\n system \"clear\" # Clear the console before printing anything\n\n 30.times do |y| # Iterate over the first 30 rows\n row = '' # Create a new String to contain the row\n 80.times do |x| # Iterate over the first 80 columns\n if alive?(\"#{x},#{y}\") # Build the cell key and ask if that cell is alive\n row << '#' # If the cell is alive, add '#' to the row string\n else\n row << '.' # If the cell is dead, add '.' to the row string\n end\n end\n puts row # Print the row string to the console\n end\n end",
"title": ""
},
{
"docid": "a012c976fb76a06e1b660ba0cb804a6e",
"score": "0.5636033",
"text": "def render(show = false)\n # M is a missed shot.\n if empty? && fired_upon?\n \"M\"\n # H is a hit.\n elsif fired_upon? && !@ship.sunk?\n \"H\"\n # Hits will turn to Xs once the ship has sunk.\n elsif fired_upon? && @ship.sunk?\n \"X\"\n # The S shows the user where their ships are placed.\n elsif !fired_upon? && !empty? && show\n \"S\"\n # '.' is the standard initial cell status.\n else\n \".\"\n end\n end",
"title": ""
},
{
"docid": "6667ec8e034293f160707d7e766ed8f1",
"score": "0.5629289",
"text": "def player\n @board.count(\" \") % 2 == 0 ? \"O\" : \"X\"\n end",
"title": ""
},
{
"docid": "25d8a3e8d5f706a9c8c305e14101ddea",
"score": "0.56229424",
"text": "def single_character_display\n SINGLE_CHARACTER.color(:red).bright\n end",
"title": ""
},
{
"docid": "99d745ae6f5b0bf7c3de111419228935",
"score": "0.5621067",
"text": "def current_player(board)\n #if else and .even? and .odd? format\n if turn_count(board).even? == false #assigns value \"O\" to character being used by current player if condition is true\n character = \"O\"\n else turn_count(board).even? == true #vice-versa\n character = \"X\"\n end\nend",
"title": ""
},
{
"docid": "3aa9edf043934c2f3ea11dd922aacb72",
"score": "0.56042993",
"text": "def ascii?; end",
"title": ""
},
{
"docid": "1cf70826894e43e2c2c0c0895fd888be",
"score": "0.56010664",
"text": "def full?\n !self.cells.include?(' ')\n end",
"title": ""
},
{
"docid": "a89b44af6b7bbf173e5468bb898b75f6",
"score": "0.55924445",
"text": "def dead?(pos)\n valid_position?(pos)\n self[pos] && self[pos] == ' '\n end",
"title": ""
},
{
"docid": "0a0b8241ac9344a2e2de0b7308ccb649",
"score": "0.559095",
"text": "def display_board(cell = String.new(\" \"))\n puts \" #{cell[0]} | #{cell[1]} | #{cell[2]} \"\n puts \"-----------\"\n puts \" #{cell[3]} | #{cell[4]} | #{cell[5]} \"\n puts \"-----------\"\n puts \" #{cell[6]} | #{cell[7]} | #{cell[8]} \"\nend",
"title": ""
},
{
"docid": "4cd5c19426c2d0846b186375248cf76b",
"score": "0.5586933",
"text": "def full?\n cells.none? { |cell| cell == \" \"}\n end",
"title": ""
},
{
"docid": "9a2459b64621531a5dfd2a7aed8e89a3",
"score": "0.5581235",
"text": "def full?\n !cells.include?(\" \")\n end",
"title": ""
},
{
"docid": "adc5d9c430ff7b216c2581c1fa716f0c",
"score": "0.5568205",
"text": "def board\n puts '---------------------'.green\n output_string = \"\"\n @board.each_char.with_index do |char,index|\n output_string << char + ' '\n if index % 9 == 2 || index % 9 == 5\n output_string << '| '.green\n elsif index % 9 == 8\n output_string << \"\\n\"\n if (index + 1) % 27 == 0\n output_string << '---------------------'.green + \"\\n\"\n end\n end\n end\n output_string\n end",
"title": ""
},
{
"docid": "c09e30b559b43c8ed49fc4644e555881",
"score": "0.55669755",
"text": "def print\n # puts print_as_string\n puts @cells.inspect\n end",
"title": ""
},
{
"docid": "834890ba977a140902b257f9c9d8ee2a",
"score": "0.55642146",
"text": "def display\n if !self.lose?\n print \" 0 1 2 3 4 5 6 7 8\"\n puts\n puts\n @rows.each_with_index do |row,row_idx|\n print \"#{row_idx} \"\n row.each_with_index do |col,col_idx|\n if !self.[]([row_idx,col_idx]).revealed && !self.[]([row_idx,col_idx]).flagged\n print \"* \"\n elsif !self.[]([row_idx,col_idx]).revealed && self.[]([row_idx,col_idx]).flagged\n print \"F \"\n elsif self.[]([row_idx,col_idx]).revealed && !self.[]([row_idx,col_idx]).bomb\n print \"#{self.[]([row_idx,col_idx]).neighbors_bomb_count} \"\n else\n print \"B \"\n end\n end\n puts\n end\n else\n print \" 0 1 2 3 4 5 6 7 8\"\n puts\n puts\n @rows.each_with_index do |row,row_idx|\n print \"#{row_idx} \"\n row.each_with_index do |col,col_idx|\n if self[[row_idx,col_idx]].flagged && self[[row_idx,col_idx]].bomb\n print \"b \"\n elsif !self[[row_idx,col_idx]].flagged && self[[row_idx,col_idx]].bomb\n print \"B \"\n elsif !self[[row_idx,col_idx]].bomb\n print \"#{self.[]([row_idx,col_idx]).neighbors_bomb_count} \"\n end\n end\n puts\n\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "09dbd22a0fa92339c29198dd60cc279e",
"score": "0.5561449",
"text": "def someone(board, player)\r\n WINNING_LINES.each do |line|\r\n if (board.values_at(*line).count(MARKER_X) == 3) && (player == 'X')\r\n return 'Player'\r\n elsif (board.values_at(*line).count(MARKER_O) == 3) && (player == 'O')\r\n return 'Player'\r\n elsif (board.values_at(*line).count(MARKER_X) == 3) && (player == 'O')\r\n return 'Computer'\r\n elsif (board.values_at(*line).count(MARKER_O) == 3) && (player == 'X')\r\n return 'Computer'\r\n elsif board_full(board)\r\n return 'tie'\r\n else\r\n end\r\n end\r\nend",
"title": ""
},
{
"docid": "004fbf4b020c0ea4316666b15b3acfc1",
"score": "0.55514073",
"text": "def single_character_display\n SINGLE_CHARACTER\n end",
"title": ""
},
{
"docid": "004fbf4b020c0ea4316666b15b3acfc1",
"score": "0.55514073",
"text": "def single_character_display\n SINGLE_CHARACTER\n end",
"title": ""
},
{
"docid": "004fbf4b020c0ea4316666b15b3acfc1",
"score": "0.55514073",
"text": "def single_character_display\n SINGLE_CHARACTER\n end",
"title": ""
},
{
"docid": "004fbf4b020c0ea4316666b15b3acfc1",
"score": "0.55514073",
"text": "def single_character_display\n SINGLE_CHARACTER\n end",
"title": ""
},
{
"docid": "7ed50fe30d1200678940b7014004844f",
"score": "0.55493987",
"text": "def full?\n @cells.none? do | position |\n position == \" \" || position == \"\"\n end\n end",
"title": ""
},
{
"docid": "a200e4171fe8c93115c6ce26ac447a11",
"score": "0.55455506",
"text": "def check(position)\n if @cells[position].nil?\n # return nil if the cell holds no entity\n return 'empty', nil, nil\n elsif @cells[position].snake\n return 'snake', @cells[position].start, @cells[position].end\n elsif @cells[position].ladder\n return 'ladder', @cells[position].start, @cells[position].end\n end\n end",
"title": ""
},
{
"docid": "180d78042d8bb0bdb0f20a55fda043b2",
"score": "0.55411154",
"text": "def display\n c = self.cells\n puts \" #{c[0]} | #{c[1]} | #{c[2]} \"\n puts \"-----------\"\n puts \" #{c[3]} | #{c[4]} | #{c[5]} \"\n puts \"-----------\"\n puts \" #{c[6]} | #{c[7]} | #{c[8]} \"\n end",
"title": ""
},
{
"docid": "1c5259c941186e47eabc1aa14746c1e8",
"score": "0.5529331",
"text": "def full?\n !@cells.include?(\" \")\n end",
"title": ""
},
{
"docid": "1c5259c941186e47eabc1aa14746c1e8",
"score": "0.5529331",
"text": "def full?\n !@cells.include?(\" \")\n end",
"title": ""
},
{
"docid": "ccaa979b8870962b1e402db5367ec298",
"score": "0.5527554",
"text": "def printable_ascii_char\n one_of(*@@printable_ascii_chars.map(&method(:constant)))\n end",
"title": ""
},
{
"docid": "58127160bd3e4baed4758c3072175df2",
"score": "0.5527314",
"text": "def full?\n @cells.none?(\" \")\n end",
"title": ""
},
{
"docid": "f9002bf992eb2ed62838d9ee5603ae7e",
"score": "0.5525438",
"text": "def curr_char\n @input[@curr_char_index] and @input[@curr_char_index].chr \n end",
"title": ""
},
{
"docid": "ff7b6eb7a64158684599f95b806e6c67",
"score": "0.55220306",
"text": "def print_maze_piece row, col\n\t\tif @wall_matrix[row][col].to_s.eql? '0' # 0 represents an empty space in the maze\n\t\t\tprint ' '\n\t\telse\n\t\t\tif row%2 == 0\n\t\t\t\tif col%2 == 0\n\t\t\t\t\tprint '+' # even row and even column\n\t\t\t\telse\n\t\t\t\t\tprint '-' # even row and odd column\n\t\t\t\tend\n\t\t\telse # odd numbered rows are either empty or a pipe\n\t\t\t\tprint '|'\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "2230c5932099dfbd197ce1c3bcb282db",
"score": "0.55083454",
"text": "def display_board\n dash_field = \"\" # Temp string variable to output the current state of the game\n @board.each do |letter|\n dash_field += letter + \" \"\n end\n p dash_field \n end",
"title": ""
},
{
"docid": "0b0da4bd59a41625519d545e8fae5e8a",
"score": "0.55041456",
"text": "def char\n if success?\n SUCCESS_CHAR\n elsif warning?\n WARNING_CHAR\n else\n INFO_CHAR\n end\n end",
"title": ""
},
{
"docid": "640c831c86a72c3ae3dabe687d98aa62",
"score": "0.54990077",
"text": "def party_over?\n rslt = true\n @board.board.flatten.each { |c| rslt = false if c == \" \" }\n rslt\n end",
"title": ""
},
{
"docid": "45d116808bb56cdfc006a6360c5514bb",
"score": "0.5495006",
"text": "def character\n byte.chr\n end",
"title": ""
},
{
"docid": "5554ae0743771ec4473e158384c0435a",
"score": "0.5491191",
"text": "def full?\n !cells.any? { |s| s == \" \" }\n end",
"title": ""
},
{
"docid": "c6b4b9d4a5a7bd96af5a1e7e0fdcfe7d",
"score": "0.5489067",
"text": "def get_char(coord)\n return @grid[coord.first][coord.last]\n end",
"title": ""
},
{
"docid": "4f07e804993a7083a65311cc65efee6b",
"score": "0.546262",
"text": "def print_board\n # Print top number row\n print \"\\n \"\n (1..@n).each { |x| print \"#{x} \"}\n print \"\\n\\n\"\n\n # Print letter column and board\n (0..@n - 1).each do |y|\n letter = (97 + y).chr\n print \" #{letter} \"\n\n (0..@n - 1).each do |x|\n if @cells_grid[y][x] == 0\n print \" \"\n else\n print \"#{@cells_grid[y][x] == 1 ? 'X' : 'O'} \"\n end\n end\n\n print \"\\n\"\n end\n\n print \"\\n\"\n end",
"title": ""
},
{
"docid": "3f9adbb85ed189f495e160670e803189",
"score": "0.54621977",
"text": "def on_ground\n \tnot free?(0,1) #If character is 1 pixel or closer/against the ground\n \tend",
"title": ""
},
{
"docid": "62815971831fefc48caba7fa0223b11e",
"score": "0.5461115",
"text": "def current_char\n @current_char\n end",
"title": ""
},
{
"docid": "6731d5e66772a77540d6f2431d432db8",
"score": "0.54493725",
"text": "def full?\n cells.all? do |token|\n token == \"X\" || token == \"O\"\n end\n end",
"title": ""
},
{
"docid": "4638130a6796567c60ffd64e51964587",
"score": "0.54450357",
"text": "def render(show_ship = false)\n if show_ship == false\n puts \"\\n 1 2 3 4\\nA #{@cells[\"A1\"].render} #{@cells[\"A2\"].render} #{@cells[\"A3\"].render} #{@cells[\"A4\"].render}\\nB #{@cells[\"B1\"].render} #{@cells[\"B2\"].render} #{@cells[\"B3\"].render} #{@cells[\"B4\"].render}\\nC #{@cells[\"C1\"].render} #{@cells[\"C2\"].render} #{@cells[\"C3\"].render} #{@cells[\"C4\"].render}\\nD #{@cells[\"D1\"].render} #{@cells[\"D2\"].render} #{@cells[\"D3\"].render} #{@cells[\"D4\"].render}\\n\"\n elsif show_ship == true\n puts \"\\n 1 2 3 4\\nA #{@cells[\"A1\"].render(true)} #{@cells[\"A2\"].render(true)} #{@cells[\"A3\"].render(true)} #{@cells[\"A4\"].render(true)}\\nB #{@cells[\"B1\"].render(true)} #{@cells[\"B2\"].render(true)} #{@cells[\"B3\"].render(true)} #{@cells[\"B4\"].render(true)}\\nC #{@cells[\"C1\"].render(true)} #{@cells[\"C2\"].render(true)} #{@cells[\"C3\"].render(true)} #{@cells[\"C4\"].render(true)}\\nD #{@cells[\"D1\"].render(true)} #{@cells[\"D2\"].render(true)} #{@cells[\"D3\"].render(true)} #{@cells[\"D4\"].render(true)}\\n\"\n end\n end",
"title": ""
},
{
"docid": "3dc9933aebbce3fe8c617b5795e06402",
"score": "0.5444193",
"text": "def output_letter\n a = @deck.first\n\ta = 53 if a.instance_of? String\n\toutput = @deck[a]\n\tif output.instance_of? String\n\t nil\n\telse\n\t output -= 26 if output > 26\n\t (output + 64).chr\n\tend\n end",
"title": ""
},
{
"docid": "e70d9ec0ad19dbb084489baecfc85be6",
"score": "0.54422057",
"text": "def to_c\n if alive?\n '.'.colorize(color: :blue, background: :blue)\n else\n '*'.colorize(color: :white, background: :white)\n end\n end",
"title": ""
},
{
"docid": "9da6b9807f5f87a8018f089056d1e080",
"score": "0.5438093",
"text": "def over?\n #!@board.cells.include?(\" \")\n won? || draw?\n end",
"title": ""
},
{
"docid": "0aca9fe9c9023897d74aecd89997d75b",
"score": "0.5433435",
"text": "def maze_display(maze = @maze)\n @maze.each do |rowval|\n rowval.each do |char|\n if char == '1'; print 'x' #if the spot is a wall, put an x\n elsif char == '2'; print 'o' \n elsif char == '3'; print '|' \n elsif char == '4'; print 'E'\n else print ' ' #if spot is an open cell, put a blank space. \n end\n end\n print \"\\n\"\n end\n end",
"title": ""
},
{
"docid": "d4eacdb0df875189b82e97d75f18f61e",
"score": "0.5432601",
"text": "def cells_to_print\r\n @cells[(@cells.index(@current_cell)-DISPLAY_BUFFER_CELLS..@cells.index(@current_cell)+DISPLAY_BUFFER_CELLS)]\r\n end",
"title": ""
},
{
"docid": "e2ca345358436c5eae32247d6603848b",
"score": "0.54248774",
"text": "def full?\n @cells.all? {|token| token != \" \"}\n end",
"title": ""
},
{
"docid": "776fa97c9825804cc21fc9b128771ec9",
"score": "0.542113",
"text": "def full?\n cells.all?{|c| c == \"X\" || c == \"O\"} # .all will send every value in the array through a loop to see what's in each position\n end",
"title": ""
},
{
"docid": "2172691bda94e5c00c01bff778b66501",
"score": "0.54145277",
"text": "def char\n index.char\n end",
"title": ""
},
{
"docid": "0ab5f15d4cec30a248f80a9377ddd071",
"score": "0.5413581",
"text": "def print_row row\n\t@checkers_state[row].split(\"\").each do |num|\n\t\tif num == \"0\"\n\t\t\tprint \" |\"\n\t\telsif num == \"1\"\n\t\t\tprint \"\\u2B24 |\"\n\t\telsif num == \"2\"\n\t\t\tprint \"\\u25EF |\"\n\t\tend\n\tend\nend",
"title": ""
},
{
"docid": "0ab5f15d4cec30a248f80a9377ddd071",
"score": "0.5413581",
"text": "def print_row row\n\t@checkers_state[row].split(\"\").each do |num|\n\t\tif num == \"0\"\n\t\t\tprint \" |\"\n\t\telsif num == \"1\"\n\t\t\tprint \"\\u2B24 |\"\n\t\telsif num == \"2\"\n\t\t\tprint \"\\u25EF |\"\n\t\tend\n\tend\nend",
"title": ""
},
{
"docid": "ce3378560098e37dee81fcdc6051ddd2",
"score": "0.54127574",
"text": "def full?\n @board.none? {|space| space == \" \"}\n end",
"title": ""
},
{
"docid": "a3ce01771c98f23b47cdaad2776570ca",
"score": "0.5412403",
"text": "def full?\n !@cells.include?(\" \");\n end",
"title": ""
},
{
"docid": "b3c8a93ba738aa09f141c615453de7a4",
"score": "0.54096854",
"text": "def render\n board.grid.each_with_index do |row, row_i|\n row.each_with_index do |cell, cell_i|\n if [row_i, cell_i] != @cursor.cursor_pos \n print cell.to_s.on_light_red if (row_i + cell_i).odd?\n print cell.to_s.on_red if (row_i + cell_i).even?\n elsif self.cursor.selected\n print cell.to_s.green.on_magenta\n else\n print cell.to_s.cyan.on_yellow\n end\n end\n puts\n end\n end",
"title": ""
},
{
"docid": "c776141387a0d59e3ec7c98bbe11e4f4",
"score": "0.54062855",
"text": "def full?\n @cells.all? {|x| x != \" \"}\n end",
"title": ""
},
{
"docid": "2c15f87dbac292e0273e2da289ba1dc4",
"score": "0.5403344",
"text": "def isCharDead?\n if @age <= 50\n return false\n else\n return true\n end\n end",
"title": ""
},
{
"docid": "f84fae73a80fb6307b3f894b4277ba12",
"score": "0.5403265",
"text": "def write_char( x, y, c )\n puts \"x-#{x}, y-#{y}, c-#{c}\"\n @board[x][y] = Tile.new(c, \"\")\n end",
"title": ""
},
{
"docid": "d6f69a6650540763a4f02d671c6721e1",
"score": "0.540113",
"text": "def valid_move?(row, column)\n\t\t# Check if the cell is empty, return boolean for loop purposes\n\t\tcel = self.instance_variable_get(\"@#{row}\")[column.to_sym]\n\t\tif cel == \" \"\n\t\t\treturn true\n\t\telsif cel == nil\n\t\t\tputs \"Couldn't find a cel there, make sure you're not writing two rows' names\"\n\t\telse\n\t\t\tputs \"The selected cell already has the character #{cel} on it.\"\n\t\t\treturn false\n\t\tend\n\tend",
"title": ""
}
] |
89d174c27d632df93b91c49cfb28ebc9
|
POST /d_loggers POST /d_loggers.json
|
[
{
"docid": "7ac1cf0ff1008cd7b01d42705fc4cc14",
"score": "0.6380608",
"text": "def create\n @d_logger = DLogger.new(params[:d_logger])\n\n respond_to do |format|\n if @d_logger.save\n format.html { redirect_to @d_logger, notice: 'D logger was successfully created.' }\n format.json { render json: @d_logger, status: :created, location: @d_logger }\n else\n format.html { render action: \"new\" }\n format.json { render json: @d_logger.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "14ed0af8afd0927e75675c837fe5db07",
"score": "0.6185742",
"text": "def index\n @d_loggers = DLogger.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @d_loggers }\n end\n end",
"title": ""
},
{
"docid": "ab66dca7a8868b24b7880b60893bed42",
"score": "0.5732787",
"text": "def create\n @dlog = Dlog.new(params[:dlog])\n\n respond_to do |format|\n if @dlog.save\n format.html { redirect_to @dlog, notice: 'Dlog was successfully created.' }\n format.json { render json: @dlog, status: :created, location: @dlog }\n else\n format.html { render action: \"new\" }\n format.json { render json: @dlog.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "617ca7ddde9d4420c455d1f98e0b87ee",
"score": "0.553599",
"text": "def loggers\n @loggers ||= []\n end",
"title": ""
},
{
"docid": "de0d6a812487e0c6d9ed65c7880b7616",
"score": "0.5434369",
"text": "def create\n @log = current_app.logs.create(params)\n render json: @log\n end",
"title": ""
},
{
"docid": "4ccc4779d9502b2d19499ffc7d8f1d9a",
"score": "0.53945065",
"text": "def new_tagged_logger; end",
"title": ""
},
{
"docid": "366bb7205e27b4bcb29e8a3fcd71d620",
"score": "0.5383984",
"text": "def initialize(loggers)\n @loggers = Array(loggers)\n end",
"title": ""
},
{
"docid": "be2f8f522caf68afa924d610ba21d4fc",
"score": "0.53803736",
"text": "def new\n @d_logger = DLogger.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @d_logger }\n end\n end",
"title": ""
},
{
"docid": "8f97ee756ed1c64e54c8cf0103c7fe6e",
"score": "0.5341819",
"text": "def log(data)\n t = Thread.new do\n uri = URI(\"http://logs-01.loggly.com/inputs/.../tag/ost/\")\n req = Net::HTTP::Post.new(uri)\n req['content-type'] = \"content-type:application/x-www-form-urlencoded\"\n req.body = data.to_json\n res = Net::HTTP.start(uri.hostname, uri.port) {|http|\n http.request(req)\n }\n end\nend",
"title": ""
},
{
"docid": "fb1553cfe43d9478d8db01ee58c21cbe",
"score": "0.5329151",
"text": "def new_tagged_logger\n TaggedLoggerProxy.new server.logger,\n tags: server.config.log_tags.map { |tag| tag.respond_to?(:call) ? tag.call(request) : tag.to_s.camelize }\n end",
"title": ""
},
{
"docid": "bead33c7e7b77c148a7cbd13bd7255aa",
"score": "0.52632195",
"text": "def loggers\n @hash.keys\n end",
"title": ""
},
{
"docid": "6208cb8a233d66f94c77984e63f5523a",
"score": "0.5249636",
"text": "def create\n @devlog = Devlog.new(devlog_params)\n\n respond_to do |format|\n if @devlog.save\n format.html { redirect_to [:admin, @devlog], notice: 'Devlog was successfully created.' }\n format.json { render :show, status: :created, location: @devlog }\n else\n format.html { render :new }\n format.json { render json: @devlog.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e2f6b610107effa2a185a79573b9e81a",
"score": "0.5247384",
"text": "def create\n # If the request body contains a single log (request body is not an array)\n if ( !JSON.parse(request.body.read).is_a?(Array) )\n log_data = JSON.parse(request.body.read)\n status, log = create_new_log(log_data)\n if (status)\n render json: log, status: :created\n else\n render json: log.errors, status: :unprocessable_entity\n end\n # If the request body contains multiple logs (request body is an array)\n else\n logs = []\n # Loop through all logs. Each array element is considered a single log\n JSON.parse(request.body.read).each do |log_data|\n status, log = create_new_log(log_data)\n if (!status)\n render render json: log.errors, status: :unprocessable_entity\n else\n logs.push(log)\n end\n end\n render json: logs, status: :created\n end\n \tend",
"title": ""
},
{
"docid": "4f5f86643a009fdef3e944626a6d6428",
"score": "0.52302265",
"text": "def send_cdn_logs\n authorize! :manage, CdnLog\n @log_data = JSON.load(params[:logdata])\n CdnLog.create(@log_data)\n respond_to do |format|\n format.json{ head :ok }\n end\n end",
"title": ""
},
{
"docid": "4a6d2b849a858ca379a5c17fc44bd91d",
"score": "0.522303",
"text": "def initialize(loggers)\n @loggers = []\n super(nil)\n @loggers = Array(loggers)\n end",
"title": ""
},
{
"docid": "8dd4da66412e23056a3c1c2eaaabc108",
"score": "0.52159095",
"text": "def method_missing(meth, *args, &block)\n for_all_loggers(meth, *args, &block)\n end",
"title": ""
},
{
"docid": "5aafb89d28605751df7e66f3ed8f0155",
"score": "0.521381",
"text": "def create\n @dlog = Dlog.new(params[:dlog])\n\n respond_to do |format|\n if @dlog.save\n format.html { redirect_to(@dlog, :notice => 'Dlog was successfully created.') }\n format.xml { render :xml => @dlog, :status => :created, :location => @dlog }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @dlog.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f48620b30279e072dd9426ac6ba91903",
"score": "0.52125996",
"text": "def create\n\n @grower=Grower.find(1)\n @logentry = @grower.logentries.new(logentry_params)\n\n respond_to do |format|\n if @logentry.save\n format.html { redirect_to group_grower_path, notice: 'Logentry was successfully created.' }\n format.json { render action: 'show', status: :created, location: @logentry }\n else\n format.html { render action: 'new' }\n format.json { render json: @logentry.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b3ca2a922f5f5c153002de3be6a46ea9",
"score": "0.5201808",
"text": "def post_create\n response = self.class.post(\"/service/#{$service_id}/version/#{$service_version}/logging/sftp\", \n headers: { \"Fastly-Key\" => $key},\n body: { \"name\" => \"#{$name}\",\n \"address\" => \"#{$address}\",\n \"port\" => \"22\",\n \"format\" => \"#{$log_format}\",\n \"user\" => \"#{$user}\",\n \"secret_key\" => \"#{$secret_key}\",\n \"public_key\" => \"#{$public_key}\" })\n end",
"title": ""
},
{
"docid": "2af99279eb8e4915f0055f60e2c2cca3",
"score": "0.515927",
"text": "def logs\n end",
"title": ""
},
{
"docid": "9099c6650b4d62c55b5f95da0dae87dc",
"score": "0.5125284",
"text": "def create\n params[:logs].each { |message| Passbook::Log.create(message: message) }\n head :ok\n end",
"title": ""
},
{
"docid": "352a0176c953e78d6685c2155bca242c",
"score": "0.5119989",
"text": "def logs\n\n end",
"title": ""
},
{
"docid": "b9a84c69a0e73d5b54cea89e7a591709",
"score": "0.5070596",
"text": "def add_applogs(options={})\n self.class.post(\"#{applogs_endpoint}/applogs.json?apikey=#{apikey}\", :body => MultiJson.encode({applog: options}))\n end",
"title": ""
},
{
"docid": "dc41a66be034275152db07b36c174fb1",
"score": "0.5035801",
"text": "def create\n case raw_json\n when Array then handle_many_logs\n when Hash then handle_single_log\n else; sorry \"Post a JSON array or object.\", 422\n end\n end",
"title": ""
},
{
"docid": "1fa433f3589e2fc8fce446678bb6c0af",
"score": "0.49757436",
"text": "def destroy\n @d_logger = DLogger.find(params[:id])\n @d_logger.destroy\n\n respond_to do |format|\n format.html { redirect_to d_loggers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fbfc59115700f68dac8476cc02ece8bb",
"score": "0.49362823",
"text": "def log_request\n ServerRequestLog.create! default_log_hash\n end",
"title": ""
},
{
"docid": "8da03703afdd87a8cb666a1cf5f74e8d",
"score": "0.49257734",
"text": "def create\n @data_log = DataLog.new(data_log_params)\n\n respond_to do |format|\n if @data_log.save\n format.html { redirect_to @data_log, notice: 'Data log was successfully created.' }\n format.json { render :show, status: :created, location: @data_log }\n else\n format.html { render :new }\n format.json { render json: @data_log.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "10b1608a3c48dc2986d264921aae3a4a",
"score": "0.49186048",
"text": "def create\n @log = Log.new(log_params)\n\n if @log.save\n render json: @log, status: :created, location: @log\n else\n render json: @log.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "1b71054a6a91d32aa5f2769307346a29",
"score": "0.48980346",
"text": "def new\n @dlog = Dlog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dlog }\n end\n end",
"title": ""
},
{
"docid": "b80084008d6356a0b27eedc7c77248ae",
"score": "0.48754194",
"text": "def create\n @driver_log = DriverLog.new(driver_log_params)\n\n respond_to do |format|\n if @driver_log.save\n format.html { redirect_to @driver_log, notice: 'Driver log was successfully created.' }\n format.json { render :show, status: :created, location: @driver_log }\n else\n format.html { render :new }\n format.json { render json: @driver_log.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0262b25c919761756da7cebe92be5e3b",
"score": "0.48637706",
"text": "def request_bulk(logs, token, dimensions, application_type)\n # NOTE: X-ApplicationType is not supported for V3 API.\n post_headers = {\n x_auth_token: token,\n content_type: 'application/json'\n }\n\n data = {\n \"dimensions\" => dimensions,\n \"logs\" => logs.map {|message, log_dimensions|\n {\n \"message\" => message,\n # Currently monasca errors if per-message dimensions are omitted.\n \"dimensions\" => log_dimensions,\n }\n }\n }.to_json\n\n @rest_client['logs'].post(data, post_headers)\n end",
"title": ""
},
{
"docid": "62147b79c08f51befa1baf300a39a5de",
"score": "0.48605528",
"text": "def method_missing(name, *args, &block)\n @loggers.each do |logger|\n if logger.respond_to?(name)\n logger.send(name, args, &block)\n end\n end\n end",
"title": ""
},
{
"docid": "14daa7e49c62ff03ecb5edb6bdc4316c",
"score": "0.48514387",
"text": "def jsonlogger(status,certname,jsonuuid)\n tempHash = {\n \"status\" => status,\n \"certname\" => certname,\n \"uuid\" => jsonuuid\n }\n File.open(logfile,\"a\") do |f|\n f.puts(tempHash.to_json)\n end\nend",
"title": ""
},
{
"docid": "7b6a290f3a3f06b64a4031518bd16145",
"score": "0.48503244",
"text": "def list_log_loggly_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: LoggingLogglyApi.list_log_loggly ...'\n end\n # unbox the parameters from the hash\n service_id = opts[:'service_id']\n version_id = opts[:'version_id']\n # verify the required parameter 'service_id' is set\n if @api_client.config.client_side_validation && service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_id' when calling LoggingLogglyApi.list_log_loggly\"\n end\n # verify the required parameter 'version_id' is set\n if @api_client.config.client_side_validation && version_id.nil?\n fail ArgumentError, \"Missing the required parameter 'version_id' when calling LoggingLogglyApi.list_log_loggly\"\n end\n # resource path\n local_var_path = '/service/{service_id}/version/{version_id}/logging/loggly'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'Array<LoggingLogglyResponse>'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['token']\n\n new_options = opts.merge(\n :operation => :\"LoggingLogglyApi.list_log_loggly\",\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: LoggingLogglyApi#list_log_loggly\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "71f51ae0ece44254e45fc0648ea23f2e",
"score": "0.4833526",
"text": "def method_missing(name, *args, &)\n @loggers.each do |logger|\n logger.send(name, args, &) if logger.respond_to?(name)\n end\n end",
"title": ""
},
{
"docid": "533f600ff536028e90f21ed92957d079",
"score": "0.48128912",
"text": "def create\n @server_monitor_log = ServerMonitorLog.new(server_monitor_log_params)\n\n respond_to do |format|\n if @server_monitor_log.save\n format.html { redirect_to @server_monitor_log, notice: 'Server monitor log was successfully created.' }\n format.json { render :show, status: :created, location: @server_monitor_log }\n else\n format.html { render :new }\n format.json { render json: @server_monitor_log.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1082e907c750adcbe2882793c3d5db4e",
"score": "0.48116162",
"text": "def create\n @ncr_api_log = NcrApiLog.new(ncr_api_log_params)\n # authorize(@ncr_api_log)\n respond_to do |format|\n if @ncr_api_log.save\n format.html { redirect_to @ncr_api_log, notice: 'Ncr api log was successfully created.' }\n format.json { render :show, status: :created, location: @ncr_api_log }\n else\n format.html { render :new }\n format.json { render json: @ncr_api_log.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4b253eca5db7f071653caafa803fe87d",
"score": "0.4790121",
"text": "def create\n @user = User.find(params[:user_id])\n # @log = @user.logs.create!(log_params)\n @log = @user.logs.create!\n\n respond_to do |format|\n if @log.save\n format.html { redirect_to user_logs_url, notice: 'Log was successfully created.' }\n format.json { render :show, status: :created, location: @log }\n else\n format.html { render :new }\n format.json { render json: @log.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "236abcf2f371de7389c633f6aba632f3",
"score": "0.4764375",
"text": "def create\n @log = Log.new(params[:log])\n @log.goal = @goal\n @logs = @goal.logs\n\n respond_to do |format|\n if @log.save\n format.html { redirect_to :back, notice: 'Log was successfully created.' }\n format.json { render json: @log, status: :created, location: @log }\n else\n format.html { render action: 'index' }\n format.json { render json: @log.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "54c4bfe1aa66b1c6380ed2ecb30764b7",
"score": "0.47613442",
"text": "def update_logger_config(service_setup_data)\n driver = VaultDriver.from_secrets_file service_setup_data[:environment]\n service_name = service_setup_data['deployment']['service_name']\n logger = Syslogger.new(driver)\n if logger.check_record_exists(self)\n puts 'record already exists'\n return\n end\n result, error = logger.add_record_to_rsyslog(self)\n if result\n puts 'syslog updated!'\n else\n puts \"error #{error}\" unless error.nil?\n puts 'not updated'\n end\n end",
"title": ""
},
{
"docid": "2b64a92adc8b35d5415714a3e48eb0f7",
"score": "0.47581774",
"text": "def initialize(*loggers)\n # We don't really inherit from Logger\n #super(nil)\n\n @loggers = []\n loggers.each do |logger|\n next if logger.nil?\n\n attach(logger)\n end\n end",
"title": ""
},
{
"docid": "04eba65d0e8f645a8809388861c285f9",
"score": "0.4750348",
"text": "def each\n for fullname, logger in Repository.instance.loggers\n yield fullname, logger\n end\n end",
"title": ""
},
{
"docid": "18144a55aeed622c66ae8bbdd2ad2be9",
"score": "0.47487226",
"text": "def sys_logger(action_logged)\n log = SysLog.new({:log_date => Time.now, :user_id => session[:user_id], :user_name => session[:user_name], :user_ip => session[:user_ip],\n :action_logged => action_logged}, :as => :logger)\n log.save!\n end",
"title": ""
},
{
"docid": "f652b4a4c4d323e9c13a2e9e2bc604be",
"score": "0.47382027",
"text": "def create\n @wr_log = WrLog.new(params[:wr_log])\n\n respond_to do |format|\n if @wr_log.save\n format.html { redirect_to @wr_log, notice: 'Wr log was successfully created.' }\n format.json { render json: @wr_log, status: :created, location: @wr_log }\n else\n format.html { render action: \"new\" }\n format.json { render json: @wr_log.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "030d352b87b97baaed884bf7c981d0c4",
"score": "0.4737822",
"text": "def list(options={})\n Mailgun.submit(:get, log_url, options)\n end",
"title": ""
},
{
"docid": "ea34f91609c1cd9978169e810d1df34f",
"score": "0.4736392",
"text": "def create\n @foodlog = Foodlog.new(params[:foodlog])\n\n respond_to do |format|\n if @foodlog.save\n format.html { redirect_to @foodlog, :notice => 'Foodlog was successfully created.' }\n format.json { render :json => @foodlog, :status => :created, :location => @foodlog }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @foodlog.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "94dd631489fee1dc8e13b489fc5c5695",
"score": "0.47329208",
"text": "def method_missing(name, *args, &block)\n @loggers.each do |logger|\n if logger.respond_to?(name)\n logger.send(name, args, &block)\n end\n end\n end",
"title": ""
},
{
"docid": "930f3c817aeb6d4410cf6657d8d3c59e",
"score": "0.4718795",
"text": "def create\n @blog = Blog.create(blog_params)\n params[:tags][:tag_id].each do |p|\n @tagging = Tagging.create(tag_id: p.to_i, blog_id: @blog.id)\n end\n respond_to do |format|\n\n format.html { redirect_to @blog, notice: 'Blog was successfully created.' }\n format.json { render :show, status: :created, location: @blog }\n\n end\nend",
"title": ""
},
{
"docid": "c21450540246445f4ba98754b9fff2ed",
"score": "0.47067404",
"text": "def get_all_logs(date_range_start, date_range_end, search = '', log_level = '',\n logger_assembly = '', user_id = 0, message_group_id = 0,\n include_traces = nil, org_unit_id = 0, bookmark = '')\n path = \"/d2l/api/lp/#{$lp_ver}/logging/\"\n path += \"?dateRangeStart=#{date_range_start}\"\n path += \"&dateRangeEnd=#{date_range_end}\"\n path += \"&search=#{search}\" if search != ''\n path += \"&logLevel=#{log_level}\" if log_level != ''\n path += \"&loggerAssembly=#{logger_assembly}\" if logger_assembly != ''\n path += \"&userId=#{user_id}\" if user_id != 0\n path += \"&messageGroupId=#{message_group_id}\" if message_group_id != 0\n path += \"&includeTraces=#{include_traces}\" unless include_traces.nil?\n path += \"&orgUnitId=#{org_unit_id}\" if org_unit_id != 0\n path += \"&bookmark=#{bookmark}\" if bookmark != ''\n ap path\n _get(path)\n # returns paged result set of Message data blocks\nend",
"title": ""
},
{
"docid": "81878c02ca8cdc50283f403713213652",
"score": "0.4696803",
"text": "def create_log_loggly_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: LoggingLogglyApi.create_log_loggly ...'\n end\n # unbox the parameters from the hash\n service_id = opts[:'service_id']\n version_id = opts[:'version_id']\n # verify the required parameter 'service_id' is set\n if @api_client.config.client_side_validation && service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_id' when calling LoggingLogglyApi.create_log_loggly\"\n end\n # verify the required parameter 'version_id' is set\n if @api_client.config.client_side_validation && version_id.nil?\n fail ArgumentError, \"Missing the required parameter 'version_id' when calling LoggingLogglyApi.create_log_loggly\"\n end\n allowable_values = [\"none\", \"waf_debug\", \"null\"]\n if @api_client.config.client_side_validation && opts[:'placement'] && !allowable_values.include?(opts[:'placement'])\n fail ArgumentError, \"invalid value for \\\"placement\\\", must be one of #{allowable_values}\"\n end\n allowable_values = [1, 2]\n if @api_client.config.client_side_validation && opts[:'format_version'] && !allowable_values.include?(opts[:'format_version'])\n fail ArgumentError, \"invalid value for \\\"format_version\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/service/{service_id}/version/{version_id}/logging/loggly'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n\n # form parameters\n form_params = opts[:form_params] || {}\n form_params['name'] = opts[:'name'] if !opts[:'name'].nil?\n form_params['placement'] = opts[:'placement'] if !opts[:'placement'].nil?\n form_params['response_condition'] = opts[:'response_condition'] if !opts[:'response_condition'].nil?\n form_params['format'] = opts[:'format'] if !opts[:'format'].nil?\n form_params['format_version'] = opts[:'format_version'] if !opts[:'format_version'].nil?\n form_params['token'] = opts[:'token'] if !opts[:'token'].nil?\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'LoggingLogglyResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['token']\n\n new_options = opts.merge(\n :operation => :\"LoggingLogglyApi.create_log_loggly\",\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: LoggingLogglyApi#create_log_loggly\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "8c825859518ff1c1618cb477af1dd66e",
"score": "0.46819562",
"text": "def create\n @dice = Dice.new(dice_params)\n\n if @dice.save\n render json: @dice, status: :created, location: @dice\n else\n render json: @dice.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "0ef9e7117ea6d3938674ca13463f7047",
"score": "0.46761656",
"text": "def dumpLogJson(baseJson = {})\n json = baseJson.dup.update({ :type => :guild }) ;\n# json = super(json) ;\n \n corpListJson = [] ;\n @corpList.each{|corp|\n# p [:corp, corp.name]\n corpListJson.push(corp.dumpLogJson()) ;\n }\n json[:corpList] = corpListJson ;\n \n return json ;\n end",
"title": ""
},
{
"docid": "a1702932bdef208bb4dd2104089a53a0",
"score": "0.46713257",
"text": "def create\n @config_log = ConfigLog.new(config_log_params)\n\n respond_to do |format|\n if @config_log.save\n format.html { redirect_to @config_log, notice: 'Config log was successfully created.' }\n format.json { render :show, status: :created, location: @config_log }\n else\n format.html { render :new }\n format.json { render json: @config_log.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d90822c17d27ef7c13b30fe2edc989bd",
"score": "0.46550098",
"text": "def log( *files, **options )\n\t\toptions[:graph] = false\n\n\t\tentries = self.server.run_with_json_template( :log, *files, **options )\n\n\t\treturn entries.map {|entry| Hglib::Repo::LogEntry.new(entry) }\n\tend",
"title": ""
},
{
"docid": "f526a33b0c181a867d56179f11ecaf70",
"score": "0.4640716",
"text": "def logger=(logger)\n @loggers = Array(logger)\n end",
"title": ""
},
{
"docid": "d3474d4a948a9aeaac44f2219905600c",
"score": "0.4635567",
"text": "def create\n @advertise = Advertise.new(advertise_params)\n @advertise.user = current_user\n\n respond_to do |format|\n if @advertise.save\n\n Log.create(:logable => @advertise, :user => current_user,\n :msg => _(\"new advertise \\#%{id} created\") % {:id => @advertise.id, asdasD: \"Asd\"})\n\n format.html { redirect_to target_url || @advertise, notice: 'Advertise was successfully created.' }\n format.json { render action: 'show', status: :created, location: @advertise }\n else\n @categories = Category.all\n format.html { render action: 'new' }\n format.json { render json: @advertise.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0cc4336f8b5f4d2dfd93d5f96d888ae7",
"score": "0.46280095",
"text": "def logentry_params\n params.require(:logentry).permit(:date, :note, :operator, :workers,pmu_ids:[])\n end",
"title": ""
},
{
"docid": "6e389cb36a485401e5af6ac8d763c7a9",
"score": "0.46275657",
"text": "def init_loggers(logger, logger_stderr)\n @logger = logger\n @logger_stderr = logger_stderr\n set_loggers_format\n end",
"title": ""
},
{
"docid": "f86cadd821bde8effe53472eb4ccd65b",
"score": "0.46146667",
"text": "def logger\n JsonApiServer.configuration.logger\n end",
"title": ""
},
{
"docid": "b4d195c163380af174b0a337d2cf0511",
"score": "0.46117178",
"text": "def create\n @steps_log = StepsLog.new(params[:steps_log])\n\n respond_to do |format|\n if @steps_log.save\n format.html { redirect_to @steps_log, notice: 'Steps log was successfully created.' }\n format.json { render json: @steps_log, status: :created, location: @steps_log }\n else\n format.html { render action: \"new\" }\n format.json { render json: @steps_log.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a1c88d63e98996cd734573dfa86cda89",
"score": "0.460951",
"text": "def configure_logs(logdevs = {})\n # Remove all exsiting logs\n @logdevs.each { |name, ld| remove_log(name) } if @logdevs\n\n # Parse logdevs hash options\n @logdevs = {}\n logdevs = [logdevs] if logdevs.is_a? Hash\n\n # If the user provides a device then set up a single log as :log\n unless logdevs.is_a? Array\n @logdevs[:default] = {dev: logdevs, level: DEFAULT_LEVEL}\n @lowest_level = @logdevs[:default][:level]\n return\n end\n\n # If the user provides a hash, check each arg\n logdevs.each do |ld|\n name = ld[:name] ||= :default\n dev = ld[:dev] ||= $stdout\n level = ld[:level] ||= DEFAULT_LEVEL\n shift_age = ld[:shift_age] ||= @shift_age\n shift_size = ld[:shift_size] ||= @shift_size\n level = MultiLog.string_to_level(level) unless level.is_a? Fixnum\n\n # Add to the name deely.\n add_log(name, dev, level, shift_age, shift_size)\n end\n end",
"title": ""
},
{
"docid": "843505ba2c473d82b6550fc57f4011ce",
"score": "0.46024406",
"text": "def create\n @daily_task_log = DailyTaskLog.new(daily_task_log_params)\n\n respond_to do |format|\n if @daily_task_log.save\n format.html { redirect_to @daily_task_log, notice: 'Daily task log was successfully created.' }\n format.json { render :show, status: :created, location: @daily_task_log }\n else\n format.html { render :new }\n format.json { render json: @daily_task_log.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e4e0ed2d9221848ae6e7fa5c0db37d89",
"score": "0.46023878",
"text": "def create\n @entry_log = EntryLog.new(entry_log_params)\n\n respond_to do |format|\n if @entry_log.save\n format.html { redirect_to @entry_log, notice: 'Entry log was successfully created.' }\n format.json { render :show, status: :created, location: @entry_log }\n else\n format.html { render :new }\n format.json { render json: @entry_log.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7314f1a0576d4887cb94db835aa5b08e",
"score": "0.45899838",
"text": "def create\n @rjlog = Rjlog.new(rjlog_params)\n\n respond_to do |format|\n if @rjlog.save\n format.html { redirect_to @rjlog, notice: 'Rjlog was successfully created.' }\n format.json { render :show, status: :created, location: @rjlog }\n else\n format.html { render :new }\n format.json { render json: @rjlog.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9bb606f51766e18019f35d96a204b4f5",
"score": "0.45825675",
"text": "def log_writer; end",
"title": ""
},
{
"docid": "cdbce30c77e0a7375629e1c9eb689fbc",
"score": "0.45740306",
"text": "def post_report dep_name, user, vars, log\n require 'net/http'\n require 'uri'\n\n returning(Net::HTTP.post_form(\n URI.parse('http://gist.github.com/api/v1/xml/new'),\n {\n \"files[from]\" => user,\n \"files[vars.yml]\" => vars,\n \"files[#{dep_name}.log]\" => log.decolorize\n }\n )) do |response|\n report_report_result dep_name, response\n end.is_a? Net::HTTPSuccess\n end",
"title": ""
},
{
"docid": "7336b9bd36157f2a119a299052596585",
"score": "0.45691296",
"text": "def log_tags; end",
"title": ""
},
{
"docid": "7336b9bd36157f2a119a299052596585",
"score": "0.45691296",
"text": "def log_tags; end",
"title": ""
},
{
"docid": "7336b9bd36157f2a119a299052596585",
"score": "0.45691296",
"text": "def log_tags; end",
"title": ""
},
{
"docid": "a9d64c7856b23ff51efa34c939af3af5",
"score": "0.45650426",
"text": "def create\n @user_log = UserLog.new(params[:user_log])\n\n respond_to do |format|\n if @user_log.save\n format.html { redirect_to @user_log, notice: 'User log was successfully created.' }\n format.json { render json: @user_log, status: :created, location: @user_log }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user_log.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "15d0fd44c3635bf54c1ff5f8b98db02c",
"score": "0.45614994",
"text": "def add_to_log\n user_name = self.user.name || self.user.email.split('@')[0]\n Log.create!(loggingtype: 2,user_id_1: self.user.id ,user_id_2: nil,admin_id: nil,story_id: self.story.id ,interest_id: nil,message: (user_name+\" commented on \\\"\" + self.story.title + \"\\\" with \\\"\" + self.content + \"\\\"\").to_s )\n Admin.push_notifications \"/admins/index\" ,\"\"\n end",
"title": ""
},
{
"docid": "b3fad3ac90dfdd8fc618bf59819288d1",
"score": "0.4550392",
"text": "def create\n @sample_storage_log = SampleStorageLog.new(sample_storage_log_params)\n\n respond_to do |format|\n if @sample_storage_log.save\n format.html { redirect_to @sample_storage_log, notice: 'Sample storage log was successfully created.' }\n format.json { render :show, status: :created, location: @sample_storage_log }\n else\n format.html { render :new }\n format.json { render json: @sample_storage_log.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "43e2f829357473ed525f92ec942619be",
"score": "0.45439473",
"text": "def index\n @ledgers = Ledger.all\n end",
"title": ""
},
{
"docid": "848959144fab2b7e89c6c9ff72e3e65c",
"score": "0.45408484",
"text": "def logger_level; end",
"title": ""
},
{
"docid": "67236d92eadbe8bcca58f744c20f3d19",
"score": "0.45394218",
"text": "def create_logger\n logger = Log4r::Logger.new(\"rrproxy\")\n log_format = Log4r::PatternFormatter.new(:pattern => \"[%d : %l] %m\")\n logger.add(Log4r::StdoutOutputter.new(\"console\", :formatter => log_format))\n logger.level = Log4r::INFO\n logger\nend",
"title": ""
},
{
"docid": "efb5e796dac5a7fe87112b923a487594",
"score": "0.45385203",
"text": "def registry_created\n raise ActionController::RoutingError, \"Not found\" if Registry.count > 0\n end",
"title": ""
},
{
"docid": "af5e1b4efc6c065b3eef7c43359aed1d",
"score": "0.4537244",
"text": "def app_logger(**tags)\n logger_tags =\n { url: request.url,\n ip: request.ip,\n user_id: current_user.id,\n params: params.to_unsafe_h }.merge(tags)\n\n Helli::Logger.new(logger_tags)\n end",
"title": ""
},
{
"docid": "7f50fe519ecb42469c8d8f2574f33950",
"score": "0.45313624",
"text": "def create\n @ventilation_log = VentilationLog.new(ventilation_log_params)\n\n respond_to do |format|\n if @ventilation_log.save\n format.html { redirect_to @ventilation_log, notice: 'Ventilation log was successfully created.' }\n format.json { render :show, status: :created, location: @ventilation_log }\n else\n format.html { render :new }\n format.json { render json: @ventilation_log.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4eedec37c07d0227f94601662e77044c",
"score": "0.45288622",
"text": "def create\n @log_entry = LogEntry.new(params[:log_entry])\n\n respond_to do |format|\n if @log_entry.save\n format.html { redirect_to log_entries_path, :notice => 'Log entry was successfully created.' }\n format.json { render :json => @log_entry, :status => :created, :location => @log_entry }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @log_entry.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7c52927d5d70c78fc92f262fe81907ab",
"score": "0.4525018",
"text": "def index\n @logs = @goal.logs.order('log_date DESC')\n @log = Log.new\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @logs }\n end\n end",
"title": ""
},
{
"docid": "07f63c1bac908d688108adb23f0ce939",
"score": "0.450259",
"text": "def create\n @log = Log.new(log_params)\n\n respond_to do |format|\n if @log.save\n format.html { redirect_to admin_log_path(@log), notice: 'Log was successfully created.' }\n# format.json { render action: 'show', status: :created, location: @log }\n format.json {render :json => { :success => :created}}\n else\n format.html { render action: 'new' }\n# format.json { render json: @log.errors, status: :unprocessable_entity }\n format.json { render :json => {:errors => @log.errors, :success => :failed}, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fe0d1acce75c3e4cb19e7d3bb9d4eb22",
"score": "0.44872972",
"text": "def create\n @signout_log = SignoutLog.new(params[:signout_log])\n\n respond_to do |format|\n if @signout_log.save\n format.html { redirect_to @signout_log, :notice => 'Signout log was successfully created.' }\n format.json { render :json => @signout_log, :status => :created, :location => @signout_log }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @signout_log.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9b1d1adf8f60327af7d1edc8f984859d",
"score": "0.4486936",
"text": "def create\n @user = current_user;\n @toeic_log = ToeicLog.new(params[:toeic_log])\n\n respond_to do |format|\n if @toeic_log.save\n format.html { redirect_to @toeic_log, notice: 'Toeic log was successfully created.' }\n format.json { render json: @toeic_log, status: :created, location: @toeic_log }\n else\n format.html { render action: \"new\" }\n format.json { render json: @toeic_log.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6896fda6215ed471480547a799e51712",
"score": "0.4478718",
"text": "def create\n @web_service_log = WebServiceLog.new(params[:web_service_log])\n\n respond_to do |format|\n if @web_service_log.save\n format.html { redirect_to @web_service_log, notice: 'Web service log was successfully created.' }\n format.json { render json: @web_service_log, status: :created, location: @web_service_log }\n else\n format.html { render action: \"new\" }\n format.json { render json: @web_service_log.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "42934f9ef09d210bb13f9e858e886172",
"score": "0.4472812",
"text": "def create\n @heat_log = HeatLog.new(params[:heat_log])\n\n respond_to do |format|\n if @heat_log.save\n format.html { redirect_to @heat_log, notice: 'Heat log was successfully created.' }\n format.json { render json: @heat_log, status: :created, location: @heat_log }\n else\n format.html { render action: \"new\" }\n format.json { render json: @heat_log.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c33abe5783aff45b5752a80fba7bcab7",
"score": "0.44691595",
"text": "def registry_created\n raise ActionController::RoutingError, \"Not found\" if Registry.any?\n end",
"title": ""
},
{
"docid": "bb83bce3fb76e6d43307fd62c6aae3b5",
"score": "0.44633475",
"text": "def create_listener\n return unless self.controller_name == \"registrations\"\n @listener = Listener.new\n @listener.save\n end",
"title": ""
},
{
"docid": "908b6297b1f876b7db0dc266d5e7e72a",
"score": "0.44617423",
"text": "def create\n @search_log = SearchLog.new(search_log_params)\n\n respond_to do |format|\n if @search_log.save\n format.html { redirect_to @search_log, notice: \"Search log was successfully created.\" }\n format.json { render :show, status: :created, location: @search_log }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @search_log.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "205ac564611b5549f28f981876879761",
"score": "0.44596675",
"text": "def postSales_logSyndication( action_type, syndication_type, publisher_id, expiry_date, entity_id, group_id, seed_masheryid, supplier_masheryid, country, reseller_masheryid)\n params = Hash.new\n params['action_type'] = action_type\n params['syndication_type'] = syndication_type\n params['publisher_id'] = publisher_id\n params['expiry_date'] = expiry_date\n params['entity_id'] = entity_id\n params['group_id'] = group_id\n params['seed_masheryid'] = seed_masheryid\n params['supplier_masheryid'] = supplier_masheryid\n params['country'] = country\n params['reseller_masheryid'] = reseller_masheryid\n return doCurl(\"post\",\"/sales_log/syndication\",params)\n end",
"title": ""
},
{
"docid": "ec6c1168bafb7fab5d9afc4b0c132690",
"score": "0.44548687",
"text": "def delete_log_loggly_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: LoggingLogglyApi.delete_log_loggly ...'\n end\n # unbox the parameters from the hash\n service_id = opts[:'service_id']\n version_id = opts[:'version_id']\n logging_loggly_name = opts[:'logging_loggly_name']\n # verify the required parameter 'service_id' is set\n if @api_client.config.client_side_validation && service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_id' when calling LoggingLogglyApi.delete_log_loggly\"\n end\n # verify the required parameter 'version_id' is set\n if @api_client.config.client_side_validation && version_id.nil?\n fail ArgumentError, \"Missing the required parameter 'version_id' when calling LoggingLogglyApi.delete_log_loggly\"\n end\n # verify the required parameter 'logging_loggly_name' is set\n if @api_client.config.client_side_validation && logging_loggly_name.nil?\n fail ArgumentError, \"Missing the required parameter 'logging_loggly_name' when calling LoggingLogglyApi.delete_log_loggly\"\n end\n # resource path\n local_var_path = '/service/{service_id}/version/{version_id}/logging/loggly/{logging_loggly_name}'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_id.to_s)).sub('{' + 'logging_loggly_name' + '}', CGI.escape(logging_loggly_name.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\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'InlineResponse200'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['token']\n\n new_options = opts.merge(\n :operation => :\"LoggingLogglyApi.delete_log_loggly\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LoggingLogglyApi#delete_log_loggly\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "5f6a5a5b87d242d7ee00054f5ad92955",
"score": "0.44488835",
"text": "def logger; end",
"title": ""
},
{
"docid": "5f6a5a5b87d242d7ee00054f5ad92955",
"score": "0.44488835",
"text": "def logger; end",
"title": ""
},
{
"docid": "5f6a5a5b87d242d7ee00054f5ad92955",
"score": "0.44488835",
"text": "def logger; end",
"title": ""
},
{
"docid": "5f6a5a5b87d242d7ee00054f5ad92955",
"score": "0.44488835",
"text": "def logger; end",
"title": ""
},
{
"docid": "5f6a5a5b87d242d7ee00054f5ad92955",
"score": "0.44488835",
"text": "def logger; end",
"title": ""
},
{
"docid": "5f6a5a5b87d242d7ee00054f5ad92955",
"score": "0.44488835",
"text": "def logger; end",
"title": ""
},
{
"docid": "5f6a5a5b87d242d7ee00054f5ad92955",
"score": "0.44488835",
"text": "def logger; end",
"title": ""
},
{
"docid": "5f6a5a5b87d242d7ee00054f5ad92955",
"score": "0.44488835",
"text": "def logger; end",
"title": ""
},
{
"docid": "5f6a5a5b87d242d7ee00054f5ad92955",
"score": "0.44488835",
"text": "def logger; end",
"title": ""
},
{
"docid": "5f6a5a5b87d242d7ee00054f5ad92955",
"score": "0.44488835",
"text": "def logger; end",
"title": ""
},
{
"docid": "5f6a5a5b87d242d7ee00054f5ad92955",
"score": "0.44488835",
"text": "def logger; end",
"title": ""
}
] |
95ebe4ba7c6f2ab0c939f49aa713562a
|
Sorts jobs in decreasing order of the difference (weight length). If two jobs have equal difference (weight length), schedule the job with higher weight first. This algorithm is not always optimal. Optimal to schedule jobs by weight/length ratio.
|
[
{
"docid": "fc9275b1c2de2eaa90045787915ee38a",
"score": "0.5866837",
"text": "def compare_by_weight_length_difference other_task\n compare_result = @weight_minus_length <=> other_task.weight_minus_length\n compare_result = @weight <=> other_task.weight if compare_result == 0\n compare_result\n end",
"title": ""
}
] |
[
{
"docid": "557ab4b383d69da721a06177b023f2b4",
"score": "0.67740095",
"text": "def calculate_and_sort_differences\n @joblist.each_with_index do |job, index|\n @differences[index] = job[0] - job[1]\n end\n # sort jobs by differences in decreasing order\n @differences = @differences.sort_by {|k,v| v}.reverse.to_h\n end",
"title": ""
},
{
"docid": "0068d32e8489249e077f72f266ffd508",
"score": "0.629597",
"text": "def calculate_and_sort_ratio\n @joblist.each_with_index do |job, index|\n @ratio[index] = job[0] / job[1]\n end\n # sort jobs by ratio in decreasing order\n @ratio = @ratio.sort_by {|k,v| v}.reverse.to_h\n end",
"title": ""
},
{
"docid": "df5ebfc20090e9fe499e9565ba72cea7",
"score": "0.6181225",
"text": "def sort_jobs\n\t\t@jobs.sort{|x,y| y['memory_required'] <=> x['memory_required']}\n\tend",
"title": ""
},
{
"docid": "2823c6d4369fb2c837a5e92f2bb9cf58",
"score": "0.60920626",
"text": "def calculate_and_schedule(mode = 1)\n @criterion = {}\n # puts \"\\n----------\\nNo greedy rule used (unsorted order)\" if mode == 1\n # puts \"\\n----------\\nSorting by d * p\" if mode == 2\n # puts \"\\n----------\\nSorting by p\" if mode == 3\n # puts \"\\n----------\\nSorting by d\" if mode == 4\n @joblist.each_with_index do |job, index|\n rule = 1 if mode == 1\n rule = job[0] * job[1] if mode == 2\n rule = job[1] if mode == 3\n rule = job[0] if mode == 4\n @criterion[index] = rule\n end\n # sort jobs by criterion in increasing order\n @criterion = @criterion.sort_by {|k,v| v}.to_h\n\n # schedule jobs in order of chosen criterion\n schedule_jobs\n\n # calculate the sum of weighted completion times of the resulting schedule and also max_lateness and total_lateness\n calculate_sum\n end",
"title": ""
},
{
"docid": "98ff31243b9706faf44e2dda2c1a7bf6",
"score": "0.5860178",
"text": "def sort_jobs(all_jobs)\n return all_jobs.sort do |x,y| \n # First we check if the jobs have been completed\n if x[1][\"completed\"] == nil and y[1][\"completed\"] != nil\n -1\n elsif x[1][\"completed\"] != nil and y[1][\"completed\"] == nil\n 1\n # Check if one job is the parent of the other.\n elsif check_if_parent all_jobs, x[0], y[0]\n -1\n elsif check_if_parent all_jobs, y[0], x[0]\n 1\n # For uncomp, higher priority is more urgent, and lower ttc is better\n elsif x[1][\"completed\"] == nil and y[1][\"completed\"] == nil\n get_parent_urgency(all_jobs, y[0]) <=> get_parent_urgency(all_jobs, x[0])\n # For completed, just sort by date completed.\n else\n y[1][\"completed\"] <=> x[1][\"completed\"]\n end\n end\nend",
"title": ""
},
{
"docid": "2f37cd492e1667f8cb9a7d1b072a0f28",
"score": "0.58302486",
"text": "def bubble_sort(list)\n list.each_index do |i|\n (list.length - i - 1).times do |job|\n if list[job] > list[job + 1]\n list[job], list[job + 1] = list[job + 1], list[job]\n end\n end\n end\nend",
"title": ""
},
{
"docid": "f2db0702d95f7d9cfb15c8280ffd767d",
"score": "0.5716334",
"text": "def sort!\n @events.sort! { |job1, job2| job1.next_run <=> job2.next_run }\n end",
"title": ""
},
{
"docid": "92555fe24afcab1d8aa66bb64b4c754e",
"score": "0.56996435",
"text": "def reverse_jobs(jobs)\n if jobs = {\"a\" => \" \", \"b\" => \"c\", \"c\" => \" \"}\n jobs.sort { |x, y| x[1]<=>y[1] }\n end\n end",
"title": ""
},
{
"docid": "61c3ad5ff737ef2273060c91f26ee614",
"score": "0.56903076",
"text": "def jobSorter batch\n # create sorted jobs array\n jobs = [] \n \n # process each key/value in hash\n until batch.empty?\n # Select jobs with resolved dependencies\n cleared_jobs = batch.select {|key, value| ([*value]-jobs).empty? }.keys\n # Throw error if batch is non-empty and no job is resolved to avoid infinite loops\n raise StandardError.new \"Unresolved job dependencies\" if cleared_jobs.empty?\n # add resolved jobs to sorted jobs array\n jobs += cleared_jobs\n # remove resolved jobs from hash\n batch.except(*cleared_jobs)\n \n # break\n end\n\n # return sorted jobs\n return jobs\n end",
"title": ""
},
{
"docid": "56da382781c97d7e674d36299d25f82f",
"score": "0.56843066",
"text": "def make_it_better distribution\n distribution = sort_distributions distribution\n heaviest_press_jobs = distribution.last.clone\n lightest_press_jobs = distribution.first.clone\n old_heavy_load = distribution_length heaviest_press_jobs\n heaviest_press_jobs.each do |heavy_job|\n lightest_press_jobs.each do |light_job|\n if !(heavy_job == light_job) && !(light_job > heavy_job)\n new_heaviest_press_jobs, new_lightest_press_jobs = change_jobs heaviest_press_jobs.clone, lightest_press_jobs.clone, heavy_job, light_job\n heavy_load = distribution_length(new_heaviest_press_jobs)\n light_load = distribution_length(new_lightest_press_jobs)\n # if there is a better solution then change the values\n if heavy_load < old_heavy_load && light_load < old_heavy_load\n heaviest_press_jobs = distribution.last\n lightest_press_jobs = distribution.first\n heaviest_press_jobs, lightest_press_jobs = change_jobs distribution.last, distribution.first, heavy_job, light_job\n return distribution\n end\n end\n end\n end\n return distribution\n end",
"title": ""
},
{
"docid": "642aa0ced982393497f76b521a286e42",
"score": "0.5669868",
"text": "def order_jobs_by_dependings\n @jobs.each do |job|\n @ordered_jobs += reorder(job).reverse! if !@ordered_jobs.include?(job.name)\n end\n end",
"title": ""
},
{
"docid": "f00edf2bfb36857a1aa48f7930aa6be0",
"score": "0.5626243",
"text": "def sort_checks_on_new_jobs\n @total_jobs_hash = @total_jobs.index_by(&:id)\n @checks.sort_by! do |check|\n if check.job.split_parent_job_id.present? || check.job.parent_job_id.present?\n split_image_values = check.job.initial_image_name.split('.').first.split('_').from(1)\n @compare_job = check.job\n split_image_values.length.times do |t|\n if check.job.split_parent_job_id.present?\n @compare_job = @total_jobs_hash[@compare_job.split_parent_job_id]\n elsif check.job.parent_job_id.present?\n @compare_job = @total_jobs_hash[@compare_job.parent_job_id]\n end\n end\n \"#{@compare_job.id}.#{split_image_values.present? ? split_image_values.join() : '0'}\".to_f\n else\n check.job_id.to_f\n end\n end\n end",
"title": ""
},
{
"docid": "365d638fa6653c5711dca4f960281d8d",
"score": "0.55751383",
"text": "def prio_sort(elements); end",
"title": ""
},
{
"docid": "f461fd8c4baa57ff319c99b03746c206",
"score": "0.5548095",
"text": "def opto_bsort\n return self if self.size <= 1\n length = self.size\n until length == 0 do \n counter = 0\n (1...length).each do |i|\n if self[i-1] > self[i]\n self[i-1], self[i] = self[i], self[i-1]\n counter = i\n end\n end\n length = counter #length is contantly decremented\n end\n self\n end",
"title": ""
},
{
"docid": "f5e6c18df7c9685622b6c001d19f33f0",
"score": "0.55272824",
"text": "def initialize(js, type)\n @jobs = js.sort do |j_x, j_y| \n score_x = j_x[:weight].send(TYPES[type.to_sym], j_x[:length].to_f)\n score_y = j_y[:weight].send(TYPES[type.to_sym], j_y[:length].to_f)\n s = score_y <=> score_x\n s.zero? ? j_y[:weight] <=> j_x[:weight] : s\n end\n end",
"title": ""
},
{
"docid": "17223976668425914f2134ddebe5a6ad",
"score": "0.54118407",
"text": "def printJobScheduling(arr, t)\n\n\t# length of array\n\tn = arr.length() - 1\n\n\t# Sort all jobs according to\n\t# decreasing order of profit\n\tfor i in 0..n do\n\t\tfor j in 0..n - i do\n\t\t\tif arr[j][2] < arr[j + 1][2]\n\t\t\t\tarr[j], arr[j + 1] = arr[j + 1], arr[j]\n end \n end \n end\n\t# To keep track of free time slots\n\tresult = [False] * t\n\n\t# To store result (Sequence of jobs)\n\tjob = ['-1'] * t\n\n\t# Iterate through all given jobs\n\tfor i in 0..n do\n\n\t\t# Find a free slot for this job\n\t\t# (Note that we start from the\n\t\t# last possible slot)\n\n #resolver esse for aqui\n\t\tfor j in (t - 1, arr[i][1] - 1).min()..-1 do\n\t\t\t# Free slot found\n\t\t\tif result[j] == False\n\t\t\t\tresult[j] = True\n\t\t\t\tjob[j] = arr[i][0]\n\t\t\t\tbreak\n end \n end\n end \n\t# print the sequence\n\tprint(job)\n\nend",
"title": ""
},
{
"docid": "108bbff9fa9d9196ff8889f27e34f8d7",
"score": "0.5404379",
"text": "def sort_by_weight(nodes)\n nodes.sort_by { |node| node[0].weight }.reverse!\n end",
"title": ""
},
{
"docid": "14fab16b628579632060fec441246e92",
"score": "0.54000497",
"text": "def job_scheduling(start_time, end_time, profit)\n\n schedule = []\n\n (0...profit.length).each do |idx|\n schedule << {:start_time => start_time[idx], :end_time => end_time[idx], :profit => profit[idx]}\n end\n\n schedule.sort_by! { |shift| shift[:end_time] }\n \n # memo_helper(schedule)\n dp_helper(schedule)\n \nend",
"title": ""
},
{
"docid": "b22b3546c20a91573ef3c2c8c18b3a0f",
"score": "0.53951186",
"text": "def main_sort_running_order; end",
"title": ""
},
{
"docid": "8a4ff91f491f3c4bdf9347e13d07e90f",
"score": "0.53931624",
"text": "def calculate_job_diff(from, to)\n @changed_jobs = []\n @unchanged_jobs = []\n @added_jobs = []\n @removed_jobs = []\n\n from.jobs.each do |from_job|\n to_job = to.jobs.find do |to_job|\n from_job.name == to_job.name\n end\n\n if to_job.nil?\n @removed_jobs.push({\n :name => from_job.name,\n :from_size => from_job.size,\n :to_size => 0\n })\n else\n if to_job.size == from_job.size\n @unchanged_jobs.push({\n :name => from_job.name,\n :from_size => from_job.size,\n :to_size => to_job.size\n })\n else\n @changed_jobs.push({\n :name => from_job.name,\n :from_size => from_job.size,\n :to_size => to_job.size\n })\n end\n end\n end\n\n to.jobs.each do |to_job|\n from_job = from.jobs.find do |from_job|\n from_job.name == to_job.name\n end\n\n if from_job.nil?\n @added_jobs.push({\n :name => to_job.name,\n :from_size => 0,\n :to_size => to_job.size\n })\n end\n end\n end",
"title": ""
},
{
"docid": "ec81b9a4ec069b6f467f18b8f557a0ed",
"score": "0.538047",
"text": "def jobs_of_lower_order(type)\n priority = HireFire.configuration.worker_priority[type.to_sym].to_i \n Delayed::Job.where(['priority > ?', priority]).count \n end",
"title": ""
},
{
"docid": "b12ea2bbcd2f9d136901d5beabc0c582",
"score": "0.53769445",
"text": "def gen_workload()\n job_set = job_set_to_run\n return [] if job_set.empty?\n # Parse priority by user\n group = Hash.new(0)\n job_set.each{|j|group[j[:user_id]] += 1}\n\n job_set = job_set.map do |j|\n job = Job.new\n # Use execution time as deadline first, convert it on simulation\n job.deadline = Time.at(j[:deadline])\n\n # Model priority by user\n job.priority = group[j[:user_id]]\n (0...j[:allocated_processors]).each do\n job.add_task SleepTask.new(j[:run_time].to_f)\n end\n # Parse submission time\n {:job => job, :submit_time => j[:submit_time]}\n end\n\n # Parse submission time to wait (sleep) time\n (0...job_set.size-1).each do |i|\n job_set[i][:wait_time] = job_set[i+1][:submit_time] - job_set[i][:submit_time]\n end\n job_set[-1][:wait_time] = 0\n job_set.each{|j| j.delete :submit_time}\n\n # Merge batch\n merged_batch = [{:wait_time => 0, :batch =>[]}]\n job_set.each do |j|\n if j[:wait_time] > @batch_threshold or merged_batch[-1][:wait_time] > @batch_threshold\n merged_batch << {:wait_time => j[:wait_time], :batch =>[j[:job]]}\n else\n merged_batch[-1][:wait_time] += j[:wait_time]\n merged_batch[-1][:batch] << j[:job]\n end\n end\n merged_batch.shift if merged_batch[0][:batch].empty?\n\n # Generate batch deadline\n merged_batch.each do |b|\n batch_deadline = b[:batch].map{|j| j.deadline.to_f}.max * @deadline_rate\n b[:batch].each{|j| j.deadline = Time.at(batch_deadline)}\n end\n\n return merged_batch\n end",
"title": ""
},
{
"docid": "3fb8559b9099fa4893d6d72a45ce8df1",
"score": "0.52953553",
"text": "def bubble_sort(&prc)\n prc ||= Proc.new {|a, b| a <=> b}\n part = self.length - 1\n while part > 0 \n (1..part).each do |i|\n self[i - 1], self[i] = self[i], self[i - 1] if prc.call(self[i], self[i - 1]) < 0\n end\n part -= 1\n end\n self\n end",
"title": ""
},
{
"docid": "40104362694ab876ee2e52d3f6abf779",
"score": "0.52871555",
"text": "def sort_generation(generation)\n sorted_generation = generation.clone\n # i,j son del tipo generation: BUBBLE SORT! XD\n # deben de estar de menor a mayor. Entre menor sea mejor es la sol\n (0..(sorted_generation.length - 1)).each do |i|\n (0..(sorted_generation.length - 1)).each do |j|\n if eval_solution(generation[i]) < eval_solution(generation[j])\n temp = generation[j]\n generation[j] = generation[i]\n generation[i] = temp\n end\n end\n end\n\nend",
"title": ""
},
{
"docid": "1c2c6e7336a42eda4b13d199b313f4e0",
"score": "0.5262447",
"text": "def sort_and_print_jobs_min_salary(jobs, view)\n jobs.sort! { |one, two| two.min_sal.to_i <=> one.min_sal.to_i }\n jobs.each { |job| view.jobs_and_min_salary(job) }\n end",
"title": ""
},
{
"docid": "c90504d2c4b21ceb5e41bfc42974f06c",
"score": "0.52263945",
"text": "def sort_and_print_jobs_deadline(jobs, view)\n jobs.sort! { |one, two| year_first(one.app_deadline) <=> year_first(two.app_deadline) }\n jobs.each { |job| view.jobs_and_app_deadline(job) }\n end",
"title": ""
},
{
"docid": "9f14bd110452a494bfc0d48e9258d25b",
"score": "0.52230644",
"text": "def reconstruct_queue(people)\n people_lg = people.length\n sorted = people.sort\n queue = []\n\n until queue.length == people_lg\n current_max_height = sorted.last[0]\n\n relevant_els = sorted.select { |h, k| h == current_max_height }\n\n relevant_els.each do |person|\n queue.insert(person[1], person)\n end\n\n sorted.pop(relevant_els.length)\n end\n\n queue\nend",
"title": ""
},
{
"docid": "371f339e509cfd9a388f0c41cdabfb44",
"score": "0.5221419",
"text": "def m_form_sort\n array = self.args\n number_of_swaps = 0\n number_of_items = array.length\n for x in 0...(number_of_items-1)\n if array[x].is_a?(Power)\n a_1 = array[x].base\n else\n a_1 = array[x]\n end\n\n if array[x+1].is_a?(Power)\n a_2 = array[x+1].base\n else\n a_2 = array[x+1]\n end\n\n if a_1.is_a?(String) && a_2.is_a?(String) && a_2 < a_1\n array[x+1],array[x] = array[x],array[x+1]\n number_of_swaps += 1\n end\n\n if a_1.is_a?(String) && a_2.is_a?(Numeric)\n array[x+1],array[x] = array[x],array[x+1]\n number_of_swaps += 1\n end\n\n end\n\n if number_of_swaps == 0\n self.args = array\n return mtp(array)\n else\n mtp(array).m_form_sort\n end\n end",
"title": ""
},
{
"docid": "371f339e509cfd9a388f0c41cdabfb44",
"score": "0.5221419",
"text": "def m_form_sort\n array = self.args\n number_of_swaps = 0\n number_of_items = array.length\n for x in 0...(number_of_items-1)\n if array[x].is_a?(Power)\n a_1 = array[x].base\n else\n a_1 = array[x]\n end\n\n if array[x+1].is_a?(Power)\n a_2 = array[x+1].base\n else\n a_2 = array[x+1]\n end\n\n if a_1.is_a?(String) && a_2.is_a?(String) && a_2 < a_1\n array[x+1],array[x] = array[x],array[x+1]\n number_of_swaps += 1\n end\n\n if a_1.is_a?(String) && a_2.is_a?(Numeric)\n array[x+1],array[x] = array[x],array[x+1]\n number_of_swaps += 1\n end\n\n end\n\n if number_of_swaps == 0\n self.args = array\n return mtp(array)\n else\n mtp(array).m_form_sort\n end\n end",
"title": ""
},
{
"docid": "893e2eb81a7466f0fee3e5bdfe2834b3",
"score": "0.5221226",
"text": "def reconstruct_queue(people)\n people_hash = {}\n people.each do |individual|\n if people_hash.include? (individual[0])\n people_hash[individual[0]] << individual[1]\n else\n people_hash[individual[0]] = [individual[1]]\n end\n end\n people_hash.transform_values{|k_array| k_array.sort!}\n heights_inc = people_hash.keys.sort_by!{|el| el}\n\n queue = []\n highest_el = heights_inc.pop\n\n while highest_el\n k_array = people_hash[highest_el]\n k_array.each do |idx|\n queue.insert(idx, [highest_el, idx])\n end\n highest_el = heights_inc.pop\n end\n queue\nend",
"title": ""
},
{
"docid": "23cf9cb4a6d6b057cdbaf2c3699d61e4",
"score": "0.5202918",
"text": "def sort\n fold_subtasks\n if @options[:reverse]\n @data.sort! { |a,b| a[1] <=> b[1] }\n else\n @data.sort! { |a,b| b[1] <=> a[1] }\n end\n unfold_subtasks\n end",
"title": ""
},
{
"docid": "d1524ca489f1ce9053e3dbac80828e10",
"score": "0.5196164",
"text": "def bubble_sort(&prc)\n prc ||= proc { |a, b| a <=> b }\n (1...size).each do |i|\n next if prc.call(self[i - 1], self[i]).negative?\n\n self[i - 1], self[i] = self[i], self[i - 1]\n self.bubble_sort(&prc)\n end\n self\n end",
"title": ""
},
{
"docid": "55edb17dae67267195dfa46a1a2b37f1",
"score": "0.51921475",
"text": "def sort_and_print_jobs_max_salary(jobs, view)\n jobs.sort! { |one, two| two.max_sal.to_i <=> one.max_sal.to_i }\n jobs.each { |job| view.jobs_and_max_salary(job) }\n end",
"title": ""
},
{
"docid": "a5ce2f9a070864dcfb5351f0e6d8f4be",
"score": "0.5187943",
"text": "def jobs_of_higher_order(type)\n priority = HireFire.configuration.worker_priority[type.to_sym].to_i \n Delayed::Job.where(['priority < ?', priority]).count\n end",
"title": ""
},
{
"docid": "354a9d6717ba08dd796f2c8c87970977",
"score": "0.518376",
"text": "def decremental_sort(new_run)\n if new_run[-2] < new_run[-1]\n elem = new_run.pop\n insert_at = new_run.bsearch_index { |i| i < elem }\n new_run.insert(insert_at, elem)\n end\n new_run\nend",
"title": ""
},
{
"docid": "ec0cb43c1b665c444f7a80e235752549",
"score": "0.5182322",
"text": "def sort_books\n @books.each do |book|\n @space = ((@max_weight) - (book[\"weight\"])).round_to(2)\n @most_space = @large_books.last \n if @most_space == nil \n @most_space = 0\n else\n @most_space = (@max_weight - @most_space[\"weight\"])\n end\n #first, determine if there are any books that are too heavy to share a box, and put them in their own box\n if @space < @books.last[\"weight\"]\n @boxes = {\"box#{@boxcount}\" => {\"id\" => \"#{boxcount}\", \"total_weight\" => book[\"weight\"], \"contents\" => [book]}}\n @boxcount+=1\n @boxed_books << book\n\n #if the book couldn't go into a box with the box with the most space in the large books array, it also joins the large books array\n elsif (book[\"weight\"] > @most_space)\n @large_books << book\n end\n end\n @small_books = ((@books - @large_books) - @boxed_books)\n #order large books from smallest to largest\n @large_books.reverse!\n end",
"title": ""
},
{
"docid": "be194b3425412a5c453f0396298e837f",
"score": "0.5179881",
"text": "def optimal_tourney_sort(array)\n sorted_array = []\n pq = PriorityQueue.new\n array.each { |num| pq << num }\n sorted_array << pq.remove_min until pq.size == 1\n sorted_array\nend",
"title": ""
},
{
"docid": "2363161df98d01a39ea8d448d0d94311",
"score": "0.51671034",
"text": "def sort!\n # define sorting heuristics in a subclass\n end",
"title": ""
},
{
"docid": "f84deaafcfaf20b5017d74e385127a4f",
"score": "0.5154907",
"text": "def dronesSorting\n @drones = get_drone_info\n # loop for going through information of each individual drone\n for drone in @drones\n # how much time from now will the drone be able to pick up another package\n @nextPackageTime = 1\n # how much time will it take to get from next destination to depot\n\t\t\t\t# allows next destination to be the depot\n @depotTime = 1\n # how long to get back to the depot after next destination\n\t\t\t\t@depotDistance = 1\n # if it has a package, calculate when it will drop the package off\n\t\t\t # based on the package destination and where the drone is currently\n\t\t\t # after that's calculated determine how long it will take to get back to the depo\n if drone[\"packages\"].length > 0\n package = drone[\"packages\"][0]\n # how many kilometers does the drone have to travel\n @dropOfdistance = distance_between(drone[\"location\"],package[\"destination\"])\n # how much time required to drop off\n @dropOfTime = @dropOfdistance / DRONE_SPEED\n # how many km between the package dest and the depo\n @depotDistance = distance_between(package[\"destination\"],DEPO)\n # how much time it will take to get back to the depo after dropping off the package\n @depotTime = @depotDistance / DRONE_SPEED\n # how much time will it take for the drone to get back to depo\n @nextPackageTime = @dropOfTime + @depotTime\n\n else\n # we're assuming the drone is heading back to the depot to pickup\n @depotDistance = distance_between(drone[\"location\"],DEPO)\n # how much time will it take to get back to the depo\n @depotTime = @depotDistance / DRONE_SPEED\n @nextPackageTime = @depotTime\n end\n drone[\"nextPackageTime\"] = @nextPackageTime*60*60\n end\n # adding drones into queue sorted by nextPackageTime\n @dronesQueue = sorting(@drones, \"nextPackageTime\")\n end",
"title": ""
},
{
"docid": "302acda6c1c1b4096d32c026b01b3247",
"score": "0.5149656",
"text": "def bubble_sort(array)\n array.each_index do |i|\n (array.length - i - 1).times do |job|\n # take the length of the array, we sutract 1 from it\n # so that we don't compare last element to nil\n # eliminates the number of elements we need to compare on array\n if array[job] > array[job+1]\n array[job],array[job+1] = array[job+1],array[job]\n end # ends if statement\n end # ends times loop\n end # ends each loop\n array\nend",
"title": ""
},
{
"docid": "dd6fd6570270e54dc72555ada9dfc1e6",
"score": "0.5149293",
"text": "def main_sort_big_done; end",
"title": ""
},
{
"docid": "6e3c08c9f1cbec3ae23aa9afdc08f0a7",
"score": "0.5142018",
"text": "def sort_by_subtree_size!(tg)\n # create an adjacency list with tg\n tg_adj = build_adjacency_list(tg)\n\n # create a hash of [id,exec]=>subtree_size, fill in using DFS ordering\n subtree_sizes = Hash.new\n\n #DFS(there are no cycles)\n dfs_stack = Array.new\n # find the root task(s), push to stack\n tg_adj.each_pair do |task,edges|\n root = true\n edges.each do |edge|\n root = false if edge[1] == task[0]\n end\n dfs_stack.push(task) if root\n end\n\n while(task = dfs_stack.last)\n finished = true # all children are finished\n \n # push unfinished children onto stack\n children = Array.new \n tg_adj[task].each do |edge| \n if edge[0] == task[0]\n if subtree_sizes[child=lookup_task(tg,edge[1])] == nil # this child is not finished\n finished = false\n dfs_stack.push child\n end\n children << child\n end\n \n end\n \n if finished\n dfs_stack.pop\n subtree_sizes[task] = children.reduce(0){|total,child| total+1+subtree_sizes[child]}\n end\n end\n \n # sort tg on subtree size\n tg[0].sort! {|a,b| subtree_sizes[b] <=> subtree_sizes[a] }\n return tg_adj\nend",
"title": ""
},
{
"docid": "0574c26fc63d8e3937c493217e326c75",
"score": "0.51410896",
"text": "def sortjob(jobtype)\n # binding.pry\n case jobtype\n # binding.pry\n when 'cook'\n then @@jobs[:cook].push self\n when 'farmhands'\n then @@jobs[:farmhands].push self\n when 'farmer'\n then @@jobs[:farmer].push self\n when 'owner'\n then @@jobs[:owner].push self\n when 'unemployeed'\n then @@jobs[:unemployeed].push self\n end\n end",
"title": ""
},
{
"docid": "8ce03f592c41fe7b58fcb03ce3ca5cb9",
"score": "0.51237565",
"text": "def sort_and_print_jobs_pos_avail(jobs, view)\n jobs.sort! { |one, two| two.pos_available <=> one.pos_available }\n jobs.each { |job| view.jobs_and_pos_avail(job) }\n end",
"title": ""
},
{
"docid": "6cbafdca20fb59207fbbdddcda36498b",
"score": "0.50603974",
"text": "def queen_sort()\n target = self.clone\n target.sort! {\n |x,y| x <=> y\n }\n target.count_attacks\n target\n end",
"title": ""
},
{
"docid": "486dff169e775d10f908492b66ddbcaf",
"score": "0.5059332",
"text": "def order\n @jobs_hash.inject([]) do |jobs, pair|\n job, dependency = pair\n\n raise SelfDependencyError, \"Jobs can't depend on themeselves\" if job == dependency\n raise CircularDependencyError, \"Jobs can't have circular dependencies\" if has_circular_dependency_for pair, dependency\n\n if job_position = jobs.index(job)\n jobs.insert job_position, dependency\n else\n dependency.empty? ? jobs << job : jobs.concat(pair.reverse)\n end\n\n end.uniq.join\n end",
"title": ""
},
{
"docid": "4aad4204a9e04cc12275caca839eff7a",
"score": "0.50500387",
"text": "def sort!()\n @results.each_value do |jobs|\n jobs.sort! do |x , y|\n d_x = Date.parse(posting_date(x))\n d_y = Date.parse(posting_date(y))\n d_y <=> d_x\n end\n end\n end",
"title": ""
},
{
"docid": "052e3038badf19e0b57a8291fc82e497",
"score": "0.50296646",
"text": "def sort_by_length(my_sentence)\n #insertion sort\n my_sentence = my_sentence.split\n i = 0\n num_words = my_sentence.length\n\n while i < num_words\n j = i\n while j > 0\n if my_sentence[j].length < my_sentence[j - 1].length\n #parallel assignment\n my_sentence[j], my_sentence[j - 1] = my_sentence[j - 1], my_sentence[j]\n end\n j -= 1\n end\n i += 1\n end\n\n return my_sentence\n\nend",
"title": ""
},
{
"docid": "e6eec4f4411a47400a78b30848624136",
"score": "0.50293106",
"text": "def solve_b(people)\n sorted = people.sort\n\n find_lis_by_weight(sorted).size\n end",
"title": ""
},
{
"docid": "a6287e25f3212bb90047fdccbe27f79f",
"score": "0.5027696",
"text": "def sort_each\n # Deep copy\n aux = Marshal.load(Marshal.dump(self))\n result = []\n\n # Each iteration finds the minimun from aux,\n # deletes it and add it to result\n self.length.times do |i|\n m = aux.each_with_index.min\n aux.delete_at(m[1])\n result << m[0]\n end\n \n return result\n end",
"title": ""
},
{
"docid": "47ec1e6a66f058fecfb564b78a0d368a",
"score": "0.50163037",
"text": "def sort_by_views(jobs)\n\t\t@jobs = @jobs.sort_by(&:num_views).reverse #if params[:SortName].present?\n\tend",
"title": ""
},
{
"docid": "2261c4747cb70b115a5ecaa7fd4dd01e",
"score": "0.5015658",
"text": "def job_sequencing(arr, max_deadline)\n return if arr.empty?\n\n length = arr.length\n\n # sort array by decending profit\n arr.sort! { |a, b| b[2] <=> a[2] }.to_s\n\n # true denotes time_slot is empty\n time_slots = Array.new(max_deadline) { |_a| true }\n output = []\n profit = 0\n filled_slots = 0\n arr.each_with_index do |job, _index|\n min_deadline = [max_deadline, job[1]].min\n\n # as index start from 0, and min deadline can be 1. We decremented 1\n min_deadline -= 1\n\n # try to accomodate job at deadline or before\n while min_deadline >= 0\n # empty slot found\n if time_slots[min_deadline]\n time_slots[min_deadline] = false\n profit += job[2]\n output[min_deadline] = job[0]\n filled_slots += 1\n break\n end\n min_deadline -= 1\n end\n break if filled_slots == max_deadline\n end\n output\nend",
"title": ""
},
{
"docid": "32400602468410bf537c34fba0a5721e",
"score": "0.50132203",
"text": "def sort(from)\n #int i;\n #int bs; /* best score */\n #int bi; /* best i */\n #gen_t g;\n\n bs = -1\n bi = from\n \n i = from\n while (i < @first_move[@ply + 1])\n if (gen_dat[i].score > bs)\n bs = @gen_dat[i].score;\n bi = i;\n end\n i += 1\n end\n \n g = @gen_dat[from];\n @gen_dat[from] = @gen_dat[bi];\n @gen_dat[bi] = g;\n end",
"title": ""
},
{
"docid": "0aba39740c650e4644300894b95782df",
"score": "0.50097644",
"text": "def sort\n # If there is no priority, use 0.\n @queue.sort_by! { |cmd| cmd.respond_to?(:priority) ? -cmd.priority : 0 }\n\n self\n end",
"title": ""
},
{
"docid": "1def5de6da343e684a5f17d0d09199ef",
"score": "0.5002549",
"text": "def time_greedy_partitions_for(file_to_times_hash, all_files, workers)\n # exclude tests that are not present\n file_to_times_hash.slice!(*all_files)\n min_test_time = file_to_times_hash.values.flatten.min\n setup_time = (min_test_time)/2\n # Any new tests get added in here.\n all_files.each { |file| file_to_times_hash[file] ||= [min_test_time] }\n\n files_by_worker = []\n runtimes_by_worker = []\n\n file_to_times_hash.to_a.sort_by { |a| a.last.max }.reverse_each do |file, times|\n file_runtime = times.max\n if runtimes_by_worker.length < workers\n files_by_worker << [file]\n runtimes_by_worker << file_runtime\n else\n fastest_worker_time, fastest_worker_index = runtimes_by_worker.each_with_index.min\n files_by_worker[fastest_worker_index] << file\n runtimes_by_worker[fastest_worker_index] += file_runtime - setup_time\n end\n end\n files_by_worker\n end",
"title": ""
},
{
"docid": "259ab100f1de92fe1ad2672b15c3eb01",
"score": "0.49939972",
"text": "def time_greedy_partitions_for(file_to_times_hash, all_files, workers)\n # exclude tests that are not present\n file_to_times_hash.slice!(*all_files)\n min_test_time = file_to_times_hash.values.flatten.min\n setup_time = (min_test_time)/2\n # Any new tests get added in here.\n all_files.each { |file| file_to_times_hash[file] ||= [min_test_time] }\n\n files_by_worker = []\n runtimes_by_worker = []\n\n file_to_times_hash.to_a.sort_by { |a| a.last.max }.reverse_each do |file, times|\n file_runtime = times.max\n if runtimes_by_worker.length < workers\n files_by_worker << [file]\n runtimes_by_worker << file_runtime\n else\n fastest_worker_time, fastest_worker_index = runtimes_by_worker.each_with_index.min\n files_by_worker[fastest_worker_index] << file\n runtimes_by_worker[fastest_worker_index] += file_runtime - setup_time\n end\n end\n files_by_worker\n end",
"title": ""
},
{
"docid": "d7eaaf988f19a50955939ac008ccba23",
"score": "0.49869555",
"text": "def bubble_sort(&prc)\n prc ||= Proc.new {|x,y| (x <=> y)}\n (0...self.length-1).each do |t|\n (0...self.length-t-1).each do |i|\n if prc.call(self[i], self[i+1]) > 0\n swap(self, i, i+1)\n end\n end\n end\n return self\n end",
"title": ""
},
{
"docid": "fdea8d1c42fb67fe24a6c8ca828dfd32",
"score": "0.4986227",
"text": "def my_sort(vowel_words)\n done = false\n loop_times = vowel_words.size-1\n while !done\n done = true\n loop_times.times do |order|\n if vowel_words[order].size > vowel_words[order+1].size\n vowel_words[order],vowel_words[order+1] =vowel_words[order+1],vowel_words[order]\n done =false\n end\n end \n end\n return vowel_words\nend",
"title": ""
},
{
"docid": "79ec9d56ffe5002e477c1a9c6cf7603d",
"score": "0.49691585",
"text": "def sort(culling_cost=nil)\n\t\t@array_pathes = Array.new\n\t\t@buses.each do |bus|\n\t\t\tif (culling_cost != nil)\n\t\t\t\t@culling_cost = culling_cost\n\t\t\telse\n\t\t\t\t@culling_cost = (2**(0.size * 8 -2)-1) #system Max\n\t\t\tend\n\t\t\tarray_locations = Array.new\n\t\t\t@passengers.each do |passenger|\n\t\t\t\tarray_locations.push(passenger.pick_location)\n\t\t\t\tarray_locations.push(passenger.drop_location)\n\t\t\tend\n\t\t\tlowest_cost_sort(bus.end_location ,array_locations) #find out the lowest cost routine for this bus for all passengers\n\t\t\t@array_pathes.push(array_locations)\n\t\tend\n\t\t@result_distribution = @array_pathes\n\tend",
"title": ""
},
{
"docid": "fdf068e687d9afffc71d6c018d4b8da0",
"score": "0.49658144",
"text": "def optimize(total_weight)\r\n table = []\r\n \r\n (0...total_weight).each do |cur_weight|\r\n best = nil\r\n $items.each_with_index do |item, i|\r\n c = item.cost\r\n item_weight = item.weight\r\n if item_weight <= cur_weight\r\n c += table[cur_weight - item_weight]\r\n end\r\n best = c if best.nil? || c < best\r\n end\r\n table[cur_weight] = best\r\n end\r\n table[total_weight-1]\r\nend",
"title": ""
},
{
"docid": "af34fffece4d5aca3f3a0b64b51530ac",
"score": "0.49611378",
"text": "def incremental_sort(new_run)\n if new_run[-2] > new_run[-1]\n elem = new_run.pop\n insert_at = new_run.bsearch_index { |i| i > elem }\n new_run.insert(insert_at, elem)\n end\n new_run\nend",
"title": ""
},
{
"docid": "0a72ec78f1df2bb2060cfa9b5da67e24",
"score": "0.49502653",
"text": "def combSort!(time=false,verbose=false,visual=false,eleven=false,shrink=1.3)\n startTime = Time.now() if time\n result = cSort(self,verbose,visual,eleven,shrink)\n endTime = Time.now() if time\n return [result, endTime - startTime] if time\n return result\n end",
"title": ""
},
{
"docid": "9b7569d2e716a1a4a9c5a38ff42c832f",
"score": "0.49482656",
"text": "def merge_sort\n return self if size <= 1\n pieces = split_for_merge_sort # => [left half, right half which may be one item larger]\n left = pieces[0].merge_sort\n right = pieces[1].merge_sort\n result = left.join_for_merge_sort(right)\n end",
"title": ""
},
{
"docid": "6eb943e47f87277981d1bb94c5ec7369",
"score": "0.49446627",
"text": "def jobs\n [\n 'hoover lounge',\n 'dust/wipe lounge',\n 'empty lounge bin',\n 'hoover stairs and landing',\n 'hoover and mop porch and downstairs bathroom',\n 'clean toilet and sink downstairs',\n 'hoover and mop kitchen floor',\n 'garden',\n 'wipe dining table and sides',\n 'clean hobs and sink',\n 'clean microwave',\n 'empty bins',\n 'clean toilet and sink upstairs',\n 'clean bath and shower screen',\n 'clean bathroom surfaces and mirror',\n 'hoover upstairs landing and hoover and mop bathroom floor',\n ]\nend",
"title": ""
},
{
"docid": "47895d31a035e14e4c5b746ee9e656cf",
"score": "0.49385023",
"text": "def sort_by_warnsdorffs_heuristics(positions)\n positions.sort_by do |position|\n find_next_positions_at(position).size\n end\n end",
"title": ""
},
{
"docid": "ca674b1d75edf9f35fbcde666824deb9",
"score": "0.49380922",
"text": "def rec_sort unsorted, sorted\n if unsorted.length <= 0\n return sorted\n end\n\n#'smallest' is last value of unsorted, popped off...\n#empty array holding TBD values also declared\n#empty array will be where remaining unsorted words land...\n\nsmallest = unsorted.pop\nstill_unsorted = []\n\n#for each 'tested_object' in unsorted...\n\nunsorted.each do |tested_object|\n\n#IF TO is smaller than smallest...\n\n if tested_object < smallest\n\n#smallest goes to STILL UNSORTED\n#it's not the term we're looking for...\n\n still_unsorted.push smallest\n\n#TO becomes new smallest\n smallest = tested_object\n else\n#OR ELSE TO gets pushed to STILL_unsorted\n#it's too big to be considered\n still_unsorted.push tested_object\n end\nend\n\n#push the smallest of the small to SORTED\n\nsorted.push smallest\n\n#call rec_sort... pass it remaining unsorted and\n#single value sorted list\n#all rec_sort does is continually get passed smaller and smaller values in still_unsorted\n#when still_unsorted FINALLY reaches 0, sorted is returned\n\nrec_sort still_unsorted, sorted\nend",
"title": ""
},
{
"docid": "91823f3b7f520dbf360ea3ccba10a1f5",
"score": "0.4936638",
"text": "def bubble_sort_rec(&prc)\n return self if length <= 1\n prc ||= proc { |a, b| a <=> b }\n\n each_index do |i|\n j = i + 1\n next if j == length\n self[i], self[j] = self[j], self[i] if prc.call(self[i], self[j]) > 0\n end\n\n self[0...length - 1].bubble_sort_rec(&prc) + [last]\n end",
"title": ""
},
{
"docid": "a8e456856c0c08c8bc9cd16a709fbb4f",
"score": "0.49320826",
"text": "def Sort()\n\t @flows.sort!{|x,y| x.start<=>y.start}\n end",
"title": ""
},
{
"docid": "b027ca78ae0772b25ac61f3aa2cc2b54",
"score": "0.49304658",
"text": "def stooge_sort(arr, i, j)\n\treturn [] if j < 0 \n\tif arr[i] > arr[j]\n\t\ttemp = arr[i]\n\t\tarr[i] = arr[j]\n\t\tarr[j] = temp\n\tend\n\treturn if (i + 1) >= j\n\tk = ((j - i + 1) / 3.0).ceil\n\tstooge_sort(arr, i, j - k)\n\tstooge_sort(arr, i + k, j)\n\tstooge_sort(arr, i, j - k)\n\tarr\nend",
"title": ""
},
{
"docid": "e60ef5f1606a14a0fe98a1932ae4f29a",
"score": "0.492522",
"text": "def selection_sort!\n \n (0...size).each do |j|\n # find index of minimum element in the unsorted part \n iMin = j\n (j+1...size).each do |i|\n iMin = i if self[i] < self[iMin]\n end\n \n # then swap it\n self[j], self[iMin] = self[iMin], self[j]\n end\n end",
"title": ""
},
{
"docid": "eb7b7563e8f467c9ee840f55ca5e50a3",
"score": "0.4918825",
"text": "def sort\n redirect_to my_queue_path and return if invalid_inputs?\n \n normalize_queue_item_positions\n \n redirect_to my_queue_path\n end",
"title": ""
},
{
"docid": "a505a9f369790d3dfb13e12a3ac83154",
"score": "0.49178347",
"text": "def sort_and_print_jobs_temp_reg(jobs, view)\n jobs.sort! { |one, two| one.temp_reg <=> two.temp_reg }\n jobs.each { |job| view.jobs_and_temp_reg(job) }\n end",
"title": ""
},
{
"docid": "f7602b8cae1c599ddb5438fc805959b8",
"score": "0.49096996",
"text": "def weighted_order\n if !block_given?\n return @j_del.java_method(:weightedOrder, []).call()\n end\n raise ArgumentError, \"Invalid arguments when calling weighted_order()\"\n end",
"title": ""
},
{
"docid": "581851d0cdb205f626a79b682eb7d0d6",
"score": "0.49056268",
"text": "def bubble_sort_more_optimize(values)\n type = 'Bubble Sort - More Optimized:'.cyan\n puts type\n given = values\n puts \"Given List: #{values}\\n\\n\".cyan\n no_of_comparisons = 0\n no_of_swaps = 0\n length = values.size\n while length > 1\n new_last = 0\n (1..length - 1).each do |j|\n no_of_comparisons += 1\n puts \"Comparison: #{values[j]} #{values[j - 1]}\".red\n if values[j] < values[j - 1]\n puts \"Swap: #{values[j]} #{values[j - 1]}\".green\n swap(j, j - 1, values)\n no_of_swaps += 1\n new_last = j\n end\n puts \"Current State: #{values}\\n\\n\".yellow\n end\n length = new_last\n end\n [no_of_comparisons, no_of_swaps, values, type, given]\nend",
"title": ""
},
{
"docid": "89b9dc4912e3d1ef27801cb1032ebcd5",
"score": "0.48994747",
"text": "def bubble_sort!(&prc) # 3 times \n sorted = false \n prc ||= Proc.new { |a, b| a <=> b }\n\n until sorted \n sorted = true \n\n (0...self.length - 1).each do |i|\n if prc.call(self[i], self[i + 1]) == 1\n self[i], self[i + 1] = self[i + 1], self[i]\n sorted = false \n end \n end\n end\n\n self \n end",
"title": ""
},
{
"docid": "c5b606c5400d3ca61c4a83ea1dbde472",
"score": "0.48990905",
"text": "def sort_and_print_jobs_full_part(jobs, view)\n jobs.sort! { |one, two| one.full_part <=> two.full_part }\n jobs.each { |job| view.jobs_and_full_part(job) }\n end",
"title": ""
},
{
"docid": "84943ebdd33f9212211e8fd14abff08d",
"score": "0.48949364",
"text": "def second_pass()\n @tsort = form_graph_and_tsort()\n tsort.each do |task_name|\n task = task_hash[task_name]\n task.process_wrapper_name() if task.wrapper_name\n add_producer(task) if task.inputs.empty?\n task.targets.each do |child_name|\n task_hash[child_name].parent = task\n task.ct_validate(task_hash[child_name])\n end\n end\n self\n end",
"title": ""
},
{
"docid": "65a57b4f834d2b413a03c1f142fcaaab",
"score": "0.4892044",
"text": "def bubble_sort(&prc)\n prc ||= proc { |a, b| a <=> b }\n nil while (0..self.length - 2).any? do |i|\n if prc.call(self[i], self[i + 1]) == 1\n self[i], self[i + 1] = self[i + 1], self[i] \n end\n end\n self\n end",
"title": ""
},
{
"docid": "c490ed8abe196f89fb3ef98deac1dcb4",
"score": "0.48902622",
"text": "def bubble_sort\n each do\n i = 0\n (1...length).each do\n self[i], self[i + 1] = self[i + 1], self[i] if self[i] > self[i + 1]\n i += 1\n end\n end\n self\n end",
"title": ""
},
{
"docid": "cab38fea7c83db944d6297cbfe26dbc0",
"score": "0.4890019",
"text": "def combSort(time=false,verbose=false,visual=false,eleven=false,shrink=1.3)\n startTime = Time.now() if time\n result = cSort(self.dup,verbose,visual,eleven,shrink)\n endTime = Time.now() if time\n return [result, endTime - startTime] if time\n return result\n end",
"title": ""
},
{
"docid": "6c1e5cfef436e750fea55363bf80f1af",
"score": "0.488662",
"text": "def custom_sort\n puts \"in custom_sort\"\n sleep 0.567\n yield\n end",
"title": ""
},
{
"docid": "144fd0bd3948eb4ff4bea6c66b67385d",
"score": "0.48850965",
"text": "def bubble_sort(&prc)\n prc ||= Proc.new {|a,b| a <=> b}\n sorted = false\n while !sorted do\n sorted = true\n (self.length-1).times do |i| \n if prc.call(self[i], self[i + 1]) == 1\n self[i], self[i + 1] = self[i + 1], self[i]\n sorted = false\n end\n end\n end\n self \n end",
"title": ""
},
{
"docid": "2cac6b807929c984e66549e399e0110f",
"score": "0.48847106",
"text": "def bubble_sort(&prc)\n if prc.nil?\n sorted = false\n until sorted\n sorted = true\n (0...self.length - 1).each do |i|\n if self[i] > self[i + 1]\n self[i], self[i + 1] = self[i + 1], self[i]\n sorted = false\n end\n end\n end\n self\n end\nend",
"title": ""
},
{
"docid": "442fe33392b2fcd34ad467f381356ecf",
"score": "0.48846242",
"text": "def minimum_waiting_time(queries)\n queries.sort!\n total_waiting_time = 0\n\n (0..queries.length).each do |idx|\n duration = queries[idx]\n queries_left = queries.length - (idx + 1)\n total_waiting_time += duration.to_i * queries_left\n end\n total_waiting_time\nend",
"title": ""
},
{
"docid": "038d089f199a35c82e10e6510c60c510",
"score": "0.48824432",
"text": "def sort\n unless @first_node.nil? || @first_node.last?\n comparator = @first_node\n index = 0\n @counter-1.times do\n if comparator > comparator.next_list_item# if 1st is > 2nd\n moving_item = comparator#call 1st the moving item\n moving_item.next_list_item = comparator.next_list_item.next_list_item.next_list_item#moving item's next = 4th\n comparator.next_list_item.next_list_item = moving_item #3rd = moving item\n remove(index)#cuts out the 1st(comparator) item so the rest will shuffle left one\n comparator = comparator.next_list_item#iterate the 1st to the next position\n index += 1#iterate the associated index\n end\n end\n end\n self\n end",
"title": ""
},
{
"docid": "380cbf9010ac67030f187d805d1b3e7a",
"score": "0.4879759",
"text": "def bubble_sort(&prc)\n solved = false\n l = self.length - 1\n \n\n while solved == false\n solved = true\n i = 0\n if prc == nil\n while i < l\n if self[i] > self[i + 1]\n solved = false\n self[i], self[i + 1] = self[i + 1], self[i]\n end\n i += 1\n end\n\n else\n while i < l\n n = prc.call(self[i], self[i + 1])\n if n == 1\n solved = false\n self[i], self[i + 1] = self[i + 1], self[i]\n end\n i += 1\n end\n end\n \n end\n self\n end",
"title": ""
},
{
"docid": "ffe9657b6228adc054b0e92c9d356a46",
"score": "0.48754752",
"text": "def dequeue_jobs\n Job.pending.select('DISTINCT priority, path, batch_id').reorder(nil).collect do |distinct_job|\n queue_scope = Job.where(:path => distinct_job.path, :batch_id => distinct_job.batch_id)\n\n # Give queues which have are further along more priority to reduce latency\n priority_adjustment = ((queue_scope.completed.count.to_f / queue_scope.count) * config.employee_limit).floor\n\n queue_scope.pending.limit(distinct_job.priority + priority_adjustment)\n end.flatten.sort_by(&:id)\n end",
"title": ""
},
{
"docid": "3bfb7b8b94e7689cadfff5c2775119b8",
"score": "0.48689923",
"text": "def job_arrival(jobs)\n # put new job in queue\n new_jobs = Array.new\n jobs.each do |job|\n if job.arrival == @timestep\n # update the deadline according to the current timestep\n job.deadline += @timestep\n @job_queue << job\n new_jobs << job\n end\n end\n return new_jobs\n end",
"title": ""
},
{
"docid": "a1283f230ddcb5b5c9a4c67fb04c6757",
"score": "0.48644465",
"text": "def _decay_thread()\n# \tstruct job_record *job_ptr = NULL;\n# \tListIterator itr;\n# \ttime_t start_time = time(NULL);\n# \ttime_t last_ran = 0;\n# \ttime_t last_reset = 0, next_reset = 0;\n# \tuint32_t calc_period = $slurm_get_priority_calc_period;\n# \tdouble decay_hl = $slurm_get_priority_decay_hl;\n# \tdouble decay_factor = 1;\n# \tuint16_t reset_period = $slurm_get_priority_reset_period;\n\tjob_ptr = nil;\n\tstart_time = $actual_time;\n\tlast_ran = nil;\n\tlast_reset = 0\n\tnext_reset = 0;\n\tcalc_period = $slurm_get_priority_calc_period;\n\tdecay_hl = $slurm_get_priority_decay_hl;\n\tdecay_factor = 1;\n\treset_period = $slurm_get_priority_reset_period;\n\n\n# \t/*\n# \t * DECAY_FACTOR DESCRIPTION:\n# \t *\n# \t * The decay thread applies an exponential decay over the past\n# \t * consumptions using a rolling approach.\n# \t * Every calc period p in seconds, the already computed usage is\n# \t * computed again applying the decay factor of that slice :\n# \t * decay_factor_slice.\n# \t *\n# \t * To ease the computation, the notion of decay_factor\n# \t * is introduced and corresponds to the decay factor\n# \t * required for a slice of 1 second. Thus, for any given\n# \t * slice ot time of n seconds, decay_factor_slice will be\n# \t * defined as : df_slice = pow(df,n)\n# \t *\n# \t * For a slice corresponding to the defined half life 'decay_hl' and\n# \t * a usage x, we will therefore have :\n# \t * >> x * pow(decay_factor,decay_hl) = 1/2 x <<\n# \t *\n# \t * This expression helps to define the value of decay_factor that\n# \t * is necessary to apply the previously described logic.\n# \t *\n# \t * The expression is equivalent to :\n# \t * >> decay_hl * ln(decay_factor) = ln(1/2)\n# \t * >> ln(decay_factor) = ln(1/2) / decay_hl\n# \t * >> decay_factor = e( ln(1/2) / decay_hl )\n# \t *\n# \t * Applying THe power series e(x) = sum(x^n/n!) for n from 0 to infinity\n# \t * >> decay_factor = 1 + ln(1/2)/decay_hl\n# \t * >> decay_factor = 1 - ( 0.693 / decay_hl)\n# \t *\n# \t * This explain the following declaration.\n# \t */\n\tif (decay_hl > 0)\n\t\tdecay_factor = 1 - (0.693 / decay_hl);\n\tend\n# // \t_read_last_decay_ran(&last_ran, &last_reset); DON'T CARE\n\tif (last_reset == 0)\n\t\tlast_reset = start_time;\n\tend\n\n\twhile (1)\n# \t\ttime_t now = start_time;\n# \t\tdouble run_delta = 0.0, real_decay = 0.0;\n\t\tnow = start_time;\n\t\trun_delta = 0.0\n\t\treal_decay = 0.0;\n\n\t\trunning_decay = 1;\n\n# \t\t/* this needs to be done right away so as to\n# \t\t * incorporate it into the decay loop.\n# \t\t */\n# \t\t/*switch(reset_period) {\n# \t\tcase PRIORITY_RESET_NONE:\n# \t\t\tbreak;\n# \t\tcase PRIORITY_RESET_NOW:\t//do once\n# \t\t\t_reset_usage();\n# \t\t\treset_period = PRIORITY_RESET_NONE;\n# \t\t\tlast_reset = now;\n# \t\t\tbreak;\n# \t\tcase PRIORITY_RESET_DAILY:\n# \t\tcase PRIORITY_RESET_WEEKLY:\n# \t\tcase PRIORITY_RESET_MONTHLY:\n# \t\tcase PRIORITY_RESET_QUARTERLY:\n# \t\tcase PRIORITY_RESET_YEARLY:\n# \t\t\tif (next_reset == 0) {\n# \t\t\t\tnext_reset = _next_reset(reset_period,\n# \t\t\t\t\t\t\t last_reset);\n# \t\t\tend\n# \t\t\tif (now >= next_reset) {\n# \t\t\t\t_reset_usage();\n# \t\t\t\tlast_reset = next_reset;\n# \t\t\t\tnext_reset = _next_reset(reset_period,\n# \t\t\t\t\t\t\t last_reset);\n# \t\t\tend\n# \t\t}*/\n\n# \t\t/* now calculate all the normalized usage here */\n# \t\t_set_children_usage_efctv(assoc_mgr_root_assoc.usage.childern_list);\n\t\t_set_children_usage_efctv($assoc_mgr_root_assoc.children);\n\n\t\tgoto_get_usage = false\n\t\t\n\t\tif (last_ran == nil)\n\t\t\tgoto_get_usage = true;\n\t\telse\n\t\t\trun_delta = start_time - last_ran\n\t\tend\n\t\n\t\tif (run_delta <= 0)\n\t\t\tgoto_get_usage = true;\n\t\tend\n\t\t\n\t\t\n\t\tif !goto_get_usage\n\t\t\t\n\t# \t\treal_decay = pow(decay_factor, (double)run_delta);\n\t\t\treal_decay = (decay_factor ** run_delta);\n\t# #ifdef DBL_MIN\n\t# \t\tif (real_decay < DBL_MIN)\n\t# \t\t\treal_decay = DBL_MIN;\n\t# #endif\n\t\t\tdebug(\"Decay factor over %g seconds goes from %.15f . %.15f\\n\",\n\t\t\t\trun_delta, decay_factor, real_decay);\n\n\t# \t\t/* first apply decay to used time */\n\t\t\tif (_apply_decay(real_decay) != $SLURM_SUCCESS)\n\t\t\t\tdebug(\"priority/multifactor: problem applying decay\\n\");\n\t\t\t\trunning_decay = 0;\n\t\t\t\tbreak;\n\t\t\tend\n\n\t\t\t\n\t\t\tif( $job_list.length > 0)\n\t\t\t\tdebug(\"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX DECAY thread get_job_energy_usagen\\n\");\n\t\t\telse\n\t\t\t\tdebug(\"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX DECAY thread USELESS\\n\");\n\t\t\tend\n\t\t\t\n\t\t\t$job_list.each do |job_ptr|\n\t\t\t\tdebug(\"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX DECAY thread for %i\\n\", job_ptr.job_id);\n\t\t\n# \t\t\t\tdebug(\"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX steps %i %i\\n\", job_ptr.step_list, list_count(job_ptr.step_list));\n\t\t\t\t\n\t\t\t\tdebug(\"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ce %u\\n\", job_ptr.consumed_energy);\n\t\t\t\t\n# \t\t\t\t/* apply new usage */\n\t\t\t\tif (!IS_JOB_PENDING(job_ptr) &&job_ptr.start_time && job_ptr.assoc_ptr)\n\t\t\t\t\tif (!_apply_new_usage(\n\t\t\t\t\t\t job_ptr, decay_factor,\n\t\t\t\t\t\t last_ran, start_time))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tend\n\t\t\t\tend\n\n# \t\t\t\t/*\n# \t\t\t\t * Priority 0 is reserved for held\n# \t\t\t\t * jobs. Also skip priority\n# \t\t\t\t * calculation for non-pending jobs.\n# \t\t\t\t */\n# \t\t\t\tif ((job_ptr.priority == 0) || !IS_JOB_PENDING(job_ptr))\n# \t\t\t\t\tcontinue;\n# \t\t\t\tend\n# // \t\t\t\tjob_ptr.priority = _get_priority_internal( DON'T CARE\n# // \t\t\t\t\tstart_time, job_ptr);\n\t\t\t\tlast_job_update = Time.now();\n# \t\t\t\tdebug(\"priority for job %u is now %u\\n\", job_ptr.job_id, job_ptr.priority);\n\t\t\tend\n\n\t\tend\n\n\t\tlast_ran = start_time;\n\n# // \t\t_write_last_decay_ran(last_ran, last_reset);\n\n\t\trunning_decay = 0;\n\t\t\n# \t\t/* Sleep until the next time. */\n\t\tnow = $actual_time;\n\t\telapsed = now - start_time;\n\t\tif (elapsed < calc_period)\n\t\t\tdebug(\"sleep for %u\\n\", (calc_period - elapsed));\n# puts \"to be ran: \"+$jobs_to_be_ran.length.to_s + \" jobb_list: \"+ $job_list.length.to_s\n# \t\t\tsleep(calc_period - elapsed);\n\t\t\tupdate_job_list(calc_period - elapsed)\n\t\t\t\n\t\t\tstart_time = $actual_time;\n\t\telse\n\t\t\tstart_time = now;\n\t\tend\n# \t\t/* repeat ;) */\n\t\t#or not ;)\n\t\tif $jobs_to_be_ran.length == 0 && $job_list.length == 0 && $list_of_print_time.length == 0\n\t\t\tdebug(\"THE END !\\n\")\n\t\t\treturn\n\t\tend\n\tend\nend",
"title": ""
},
{
"docid": "b0b212c1d5230a9b8d9562c050ef7d4f",
"score": "0.48602712",
"text": "def sort!\n # no op\n end",
"title": ""
},
{
"docid": "c1afd9bc9dcaee7671124b6ba80692df",
"score": "0.48539847",
"text": "def sort_jugglers(circuit_jugglers)\n circuit_jugglers.each do |course, jugglers|\n sorted_jugglers = jugglers.sort! do |x,y|\n # get x juggler's score\n jug_x_score = x[:scores][y[:current_pref]].values[0]\n # get y juggler's score\n jug_y_score = y[:scores][y[:current_pref]].values[0]\n\n # if the scores are equal, the juggler who's preference for this course\n # is higher wins\n if jug_y_score == jug_x_score \n y[:current_pref] <=> x[:current_pref]\n else\n jug_y_score <=> jug_x_score\n end\n end\n end\n end",
"title": ""
},
{
"docid": "8f7bf5ba92686945fe746912fee259d9",
"score": "0.48450428",
"text": "def bubble_sort(&prc)\n sorted = false\n prc ||= Proc.new { |a, b| a <=> b } #self[idx] <=> self[idx + 1]\n\n while sorted == false\n sorted = true\n \n (0...self.length-1).each do |i|\n\n spaceship = prc.call(self[i], self[i + 1])\n if spaceship > 0\n sorted = false\n self[i], self[i + 1] = self[i + 1], self[i]\n end\n\n end\n end\n\n self\n end",
"title": ""
},
{
"docid": "a8f61198ae676fa35e5e5d6499a81a72",
"score": "0.48437175",
"text": "def bubble_sort(&prc)\n prc ||= proc { |a, b| a <=> b }\n\n sorted = false\n until sorted\n sorted = true\n (0...length - 1).each do |i|\n if prc.call(self[i], self[i + 1]) == 1\n sorted = false\n self[i], self[i + 1] = self[i + 1], self[i]\n end\n end\n end\n\n self\n end",
"title": ""
},
{
"docid": "e66e82b1a7056b5652315eec58e95963",
"score": "0.48436397",
"text": "def sort_by_job_status\n <<~SQL\n CASE status\n WHEN 'waiting_for_resource' THEN 0\n ELSE 1\n END ASC\n SQL\n end",
"title": ""
},
{
"docid": "9d24baf03526be169263027f3020dc1f",
"score": "0.4835783",
"text": "def bubble_sort(&prc)\n prc ||= Proc.new {|a,b| a <=> b }\n sorted = false\n while !sorted\n sorted = true\n (0...self.length - 1).each do |i|\n if prc.call(self[i], self[i + 1]) == 1\n sorted = false \n self[i] , self[i +1] = self[i + 1] , self[i]\n end\n end\n end\n self\n end",
"title": ""
},
{
"docid": "2514c4de3c0a94479060bb46f824d263",
"score": "0.48319724",
"text": "def bubble_sort_optimize(values)\n type = 'Bubble Sort - Optimized:'.cyan\n puts type\n given = values\n puts \"Given List: #{values}\\n\\n\".cyan\n no_of_comparisons = 0\n no_of_swaps = 0\n swapped = true\n length = values.size\n while swapped\n swapped = false\n (1..length - 1).each do |j|\n no_of_comparisons += 1\n puts \"Comparison: #{values[j]} #{values[j - 1]}\".red\n if values[j] < values[j - 1]\n puts \"Swap: #{values[j]} #{values[j - 1]}\".green\n swap(j, j - 1, values)\n swapped = true\n no_of_swaps += 1\n end\n puts \"Current State: #{values}\\n\\n\".yellow\n end\n length -= 1\n end\n [no_of_comparisons, no_of_swaps, values, type, given]\nend",
"title": ""
},
{
"docid": "ef5a3dbd4eebd9c6070119216b1a315e",
"score": "0.48313242",
"text": "def sort\n return self if length <= 1\n\n pivot = self[0]\n\n part = self[1..-1].partition do |e|\n # FIXME: Had to add \"pivot\" here to work around bug in variable lifting\n pivot\n (e <=> pivot) <= 0\n end\n\n left = part[0].sort\n right = part[1].sort\n\n left + [pivot] + right\n end",
"title": ""
},
{
"docid": "e8cb78444df197c8b0523918bb9b4b43",
"score": "0.48245332",
"text": "def bubble_sort(&prc)\n prc ||= Proc.new { |a, b| a <=> b }\n\n sorted = false\n while !sorted\n sorted = true\n\n (0...self.length - 1).each do |i|\n if prc.call(self[i], self[i + 1]) == 1\n self[i], self[i + 1] = self[i + 1], self[i]\n sorted = false\n end\n end\n end\n\n self\n end",
"title": ""
},
{
"docid": "e3676d74be54a81afcc1dcae5859b306",
"score": "0.4822584",
"text": "def spaghetti_sort(arr)\n return arr if arr.empty?\n\n # simulates placing spaghetti in hand\n min = arr.min\n size = arr.max - min + 1\n\n # simulates lowering spaghetti to table\n # by placing each rod/rods into a bucket of size rod\n # O(n) time\n buckets = Array.new(size) { 0 }\n arr.each do |num|\n buckets[num - min] += 1\n end\n\n # simulates lowering hand to the spaghetti rods\n # places longest rod into array on each lowering\n # O(1)\n sorted_arr = []\n (size - 1).downto(0) do |count|\n until buckets[count].zero?\n buckets[count] -= 1\n sorted_arr.unshift(count + min)\n end\n end\n\n sorted_arr\nend",
"title": ""
},
{
"docid": "7cf7ee9455e9abb3b0b46e91ea294c0b",
"score": "0.4821521",
"text": "def sort_parts!; end",
"title": ""
}
] |
247893e2cf48dfb4b22181bb1d8b12e8
|
Saves Omniauth details to Authentication model.
|
[
{
"docid": "06bee2dc0b1382df047e602b367041c8",
"score": "0.81371385",
"text": "def save_omniauth_details\n authentication = @user.authentications.find_or_create_by(\n provider: auth_info.provider,\n uid: auth_info.uid\n )\n\n authentication.update_attributes!(\n email: auth_email,\n nickname: auth_nickname,\n image: auth_info.image,\n raw_info: @auth.to_json\n )\n end",
"title": ""
}
] |
[
{
"docid": "f935ea398caacc1d99f16f589ff0fa9a",
"score": "0.6947328",
"text": "def update_with_omniauth(authentication, omniauth)\n authentication.token = omniauth['credentials']['token']\n authentication.secret = omniauth['credentials']['secret']\n\n self.update_timezone(omniauth['extra']['raw_info']['time_zone'])\n authentication.save\n\n self.nickname = omniauth['info']['nickname']\n self.name = omniauth['info']['name']\n self.save\n end",
"title": ""
},
{
"docid": "0759809da9e3d0514f2c8e34148f31f9",
"score": "0.68043184",
"text": "def save_omniauth(provider, uid, access_token, refresh_token=nil)\n\t credentials = self.provider_credentials.find_or_create_by(company: company, provider: Provider.named(provider), uid: uid)\n\t Rails.logger.info credentials.inspect\n\t credentials.access_token = access_token\n\t credentials.refresh_token = refresh_token\n\t credentials.save!\n\t Rails.logger.info credentials.inspect\n\t Rails.logger.info credentials.errors.inspect\n\tend",
"title": ""
},
{
"docid": "92613c33b2b5b4d7aac211e8d491b6e5",
"score": "0.67533815",
"text": "def save\n auth_hash = request.env['omniauth.auth']\n\n if auth_hash.blank?\n Kadmin.logger.error('No authorization hash provided')\n flash.alert = I18n.t('kadmin.auth.error')\n redirect_to action: :login\n return\n end\n\n email = auth_hash.dig('info', 'email')\n if Kadmin::Auth.users.exists?(email)\n session[SESSION_KEY] = email\n redirect_url = request.env['omniauth.origin']\n redirect_url = Kadmin.config.mount_path unless valid_redirect_url?(redirect_url)\n else\n flash.alert = I18n.t('kadmin.auth.unauthorized_message')\n redirect_url = url_for(action: :login)\n end\n\n redirect_to redirect_url\n end",
"title": ""
},
{
"docid": "cf2b68900cb5eaa9c10527324a419e4c",
"score": "0.6656411",
"text": "def create\n omniauth = env['omniauth.auth']\n\n user = User.find_by(uid: omniauth['uid'])\n unless user\n # New user registration\n user = User.new(uid: omniauth['uid'])\n end\n user.email = omniauth['info']['email']\n user.save\n\n # p omniauth\n\n # Currently storing all the info\n session[:user_id] = omniauth\n\n flash[:notice] = t(:successfully_logged_in)\n redirect_to root_path\n end",
"title": ""
},
{
"docid": "7155bd9ad824d394923c97bcf8637ca7",
"score": "0.66562104",
"text": "def apply_omniauth(auth)\n # In previous omniauth, 'user_info' was used in place of 'raw_info'\n self.email = auth['extra']['raw_info']['email']\n # Again, saving token is optional. If you haven't created the column in authentications table, this will fail\n authentications.build(:provider => auth['provider'], :uid => auth['uid'], :token => auth['credentials']['token'])\n end",
"title": ""
},
{
"docid": "6dcabeaaa4d79e1958ef9a08ccac94bb",
"score": "0.6650838",
"text": "def apply_omniauth(omniauth)\n self.email = omniauth['info']['email'] if email.blank?\n self.username = omniauth['info']['name'] if username.blank?\n puts \"******************************\"\n puts omniauth\n puts \"******************************\"\n authentications.build(provider:omniauth['provider'], uid:omniauth['uid'])\n end",
"title": ""
},
{
"docid": "749200394fa3b5fce696c9d13b79057d",
"score": "0.6559535",
"text": "def add_omniauth_identity_to_current_user\n current_user.identities.build.apply_omniauth(omniauth).save\n end",
"title": ""
},
{
"docid": "9802170b4ea652e37217ec101a16fa14",
"score": "0.64579386",
"text": "def apply_omniauth(omniauth)\r\n self.email = omniauth['user_info']['email'] if email.blank?\r\n authentications.build(:provider => omniauth['provider'], :uid => omniauth['uid'])\r\n end",
"title": ""
},
{
"docid": "67397f206c8c22ddea1da4efd6403e91",
"score": "0.64387196",
"text": "def set_attributes(email,password,first_name,last_name)#called by sign_in api in apis controller\n self.email = email\n self.password = password\n self.first_name = first_name\n self.last_name = last_name\n self.save\n end",
"title": ""
},
{
"docid": "0734c8a5b1c81d0bb7946ba8076ce96a",
"score": "0.64380586",
"text": "def update_omniauth(auth_hash)\n token = auth_hash['credentials']['token']\n secret = auth_hash['credentials']['secret']\n self.access_token = '%s:%s' % [token, secret]\n\n self.save(validate: false)\n end",
"title": ""
},
{
"docid": "07e429f902346f6d9305dbda31d05e32",
"score": "0.641002",
"text": "def create_identity\n user = User.find_by(email: params[:user][:email])\n if user.update(user_params)\n sign_in('user', user)\n redirect_to user_profile_path(user), notice: 'Information stored successfully.'\n clear_omniauth_data\n else\n redirect_to(\n new_user_registration_path(:redirected_from => params[:user][:identity_attributes][:provider]),\n error: \"Could not update information due to : #{user.errors.full_messages.join(', ')}\"\n )\n end\n end",
"title": ""
},
{
"docid": "c735c787a8c04c69fc1104175d0ac1b9",
"score": "0.6390203",
"text": "def apply_omniauth(auth)\n self.email = auth['extra']['raw_info']['email'] if auth['extra']['raw_info']['email']\n self.password = Devise.friendly_token[0,20]\n authentications.build(:provider=>auth['provider'], :uid=>auth['uid'], :token=>auth['credentials']['token'], :secret=>auth['credentials']['secret'])\n end",
"title": ""
},
{
"docid": "8425dfbf2b06faacf9c855fdb17496ce",
"score": "0.635954",
"text": "def apply_omniauth(omniauth)\n self.email = omniauth['user_info']['email'] if email.blank?\n apply_trusted_services(omniauth) if self.new_record?\n authentications.build(:provider => omniauth['provider'], :uid => omniauth['uid'])\n end",
"title": ""
},
{
"docid": "cdb3a7de766724c3a62b0c0ff53e097d",
"score": "0.63505197",
"text": "def amniauth_create\n user = User.find_or_create_by(:provider => auth_hash[:provider], :uid => auth_hash[:uid]) do |user|\n user.name = auth_hash[:info][:name]\n end\n\n session[:user_id] = user.id\n redirect_to user_path(user)\n end",
"title": ""
},
{
"docid": "67b769e2e92deeefa5dfc15c07a4d561",
"score": "0.62538886",
"text": "def create \n omniauth = request.env[\"omniauth.auth\"]\n \n authentication = Authentication.find_by_provider_and_uid(omniauth['provider'], omniauth['uid'])\n if authentication\n #directly sign in existing user with existing authentication\n flash[:notice] = \"signed in successfully\"\n sign_in_and_redirect(:user, authentication.user)\n elsif current_user\n #create a new authentication for currently signed in user\n current_user.authentications.create(:provider => omniauth['provider'], :uid => omniauth['uid']) \n flash[:notice] = \"Authentication successful.\" \n redirect_to authentications_url\n else\n # user does not have an account or is authenticated through a provider\n user = User.new\n user.apply_omniauth(omniauth) \n if user.save\n flash[:notice] = \"Signed in successfully.\" \n sign_in_and_redirect(:user, user) \n else\n session[:omniauth] = omniauth.except('extra') \n redirect_to new_user_registration_url\n end \n end\n end",
"title": ""
},
{
"docid": "76a1304f0ef7505b2b7d079f0bba09fe",
"score": "0.6250524",
"text": "def save\r\n SystemConfig.set :auth, to_h, true\r\n end",
"title": ""
},
{
"docid": "f76a44a7a8de1e729b73da4b6639e409",
"score": "0.62424845",
"text": "def save\n id and ensure_authentication and super\n end",
"title": ""
},
{
"docid": "380f829e24d74f08e4f965e0a3727068",
"score": "0.62378293",
"text": "def apply_omniauth(omni)\n self.authentications.build(:provider => omni['provider'],\n :uid => omni['uid'],\n :token => omni['credentials']['token'],\n :token_secret => omni['credentials']['secret'])\n\n self.send(\"set_#{omni['provider']}_info\", omni)\n end",
"title": ""
},
{
"docid": "7d2719f8b21760fb2639f5eb399e812d",
"score": "0.6226744",
"text": "def save\n response = if @id.nil?\n Cloud.instance.post ['cloud-service-auth', 'accounts', @account.id, 'authorities'], self\n else\n raise 'editing authorities not supported'\n # @cloud.put [\"cloud-service-auth\", \"principals\", @id], self\n end\n apply_data(response.body)\n self\n end",
"title": ""
},
{
"docid": "b3748b62658babfd523a350c576c6d2b",
"score": "0.618767",
"text": "def omniauth\n @user = User.from_omniauth(auth)\n @user.save\n session[:user_id] = @user.id\n puts \"You have been successfully logged in with Google\"\n redirect_to orders_path\n end",
"title": ""
},
{
"docid": "4cc105a7d845d3e84897b9d2400d2370",
"score": "0.61812717",
"text": "def create_or_update_identity_from_omniauth_hash\n # Create or update an identity from the attributes mapped in the mapper\n identity = identities.find_or_initialize_by(uid: omniauth_hash_map.uid, provider: omniauth_hash_map.provider)\n identity.properties.merge!(omniauth_hash_map.properties)\n identity.save\n end",
"title": ""
},
{
"docid": "4cd5eab818b670fc8640aa1dd3af764e",
"score": "0.61774224",
"text": "def update_using_auth o\n\t\tself.user_id = o.info.user_id\n\t\tself.login_name = o.info.profile.login_name\n\t\tself.email = o.info.email\n\t\tself.join_tsz = o.info.profile.join_tsz\n\t\tself.transaction_buy_count = o.info.profile.transaction_buy_count\n\t\tself.transaction_sold_count = o.info.profile.transaction_sold_count\n\t\tself.is_seller = o.info.profile.is_seller\n\t\tself.location = o.info.profile.lon ? [o.info.profile.lon, o.info.profile.lat] : nil\n\t\tself.image_url = o.info.profile.image_url_75x75\n\t\tself.country_id = o.info.profile.country_id\n\t\tself.gender = o.info.profile.gender\n\t\tself.oauth_token = o.extra.access_token.token\n\t\tself.oauth_token_secret = o.extra.access_token.secret\n\t\tsave\n\t\tself\n\tend",
"title": ""
},
{
"docid": "37aaba9aa8a2612ad93079343a940242",
"score": "0.61748105",
"text": "def create\n omniauth = request.env[\"omniauth.auth\"]\n authentication = Authentication.find_by_provider_and_uid(omniauth['provider'], omniauth['uid'])\n initial_session(omniauth)\n\n if current_user\n if authentication #if such user with such SN already exists\n accounts_merge(authentication)\n sign_in_and_redirect(:user, authentication.user)\n else\n current_user.authentications.create(:provider => omniauth['provider'], :uid => omniauth['uid'])\n redirect_to authentications_path, :notice => t('authentication.succes')\n end\n elsif authentication\n flash[:notice] = t('authentication.signed_succes')\n sign_in_and_redirect(:user, authentication.user)\n else\n if User.find_by_email(omniauth['info']['email'])\n user = User.new(:email => omniauth['provider'] + \":\" +omniauth['info']['email'])\n else\n user = User.new(:email => omniauth['info']['email'])\n end\n user.authentications.build(:provider => omniauth['provider'], :uid => omniauth['uid'])\n set_profile(user, omniauth)\n user.save\n user.save(:validate => false)\n flash[:notice] = t('authentication.signed_succes')\n sign_in_and_redirect(:user, user)\n end\n end",
"title": ""
},
{
"docid": "a2ecace297bfe3b8895e99c487d025e9",
"score": "0.6172262",
"text": "def create_from_omniauth\n auth_hash = request.env[\"omniauth.auth\"]\n authentication = Authentication.find_by_provider_and_uid(auth_hash[\"provider\"], auth_hash[\"uid\"]) || Authentication.create_with_omniauth(auth_hash)\n\n # if: previously already logged in with OAuth\n if authentication.user\n user = authentication.user\n authentication.update_token(auth_hash)\n @next = root_url\n @notice = \"Signed in!\"\n # else: user logs in with OAuth for the first time\n else\n user = User.create_with_auth_and_hash(authentication, auth_hash)\n # you are expected to have a path that leads to a page for editing user details\n @next = edit_user_path(user)\n @notice = \"User created. Please confirm or edit details\"\n end\n\n sign_in(user)\n redirect_to @next, :notice => @notice\n end",
"title": ""
},
{
"docid": "47395e7f06485f3f883226ec8bdd250e",
"score": "0.6148629",
"text": "def create\n @authentication = Authentication.find(:first, conditions: {provider: omniauth['provider'], uid: omniauth['uid']})\n\n if @authentication #.persisted? #???\n flash[:notice] = I18n.t \"devise.omniauth_callbacks.success\", kind: @authentication.provider_name\n # sign_in_and_redirect @user, :event => :authentication\n sign_in_and_redirect(:user, @authentication.user)\n\n elsif current_user\n current_user.authentications.create!(provider: omniauth['provider'], uid: omniauth['uid'])\n flash[:notice] = \"Authentication successful. #{provider} added to your account.\"\n redirect_to current_user\n\n else\n user = User.new\n user.apply_omniauth(omniauth)\n if user.save\n user.authentications.map &:save!\n # send pass by mail? or just tell that a random pass was set, click link to reset (change behaviour of the reset)\n flash[:notice] = \"Signed in successfully.\"\n sign_in_and_redirect(:user, user)\n else\n # session[\"devise.omniauth_data\"] = omniauth.except('extra')\n session[:omniauth] = omniauth\n redirect_to new_user_registration_url\n end\n end\n end",
"title": ""
},
{
"docid": "2c9bbe71e6ab8cc36a6902b2787bc0cf",
"score": "0.61391747",
"text": "def create \n # render :text => request.env[\"omniauth.auth\"].to_yaml\n omniauth = request.env[\"omniauth.auth\"]\n authentication = Authentication.find_by_provider_and_uid(omniauth['provider'], omniauth['uid'])\n if authentication\n flash[:notice] = \"Signed in successfully.\"\n sign_in_and_redirect(:user, authentication.user)\n elsif current_user # if user logged in but doesn't have this auth in DB\n current_user.authentications.create!(:provider => omniauth['provider'], :uid => omniauth['uid'])\n flash[:notice] = \"Authentication successful.\"\n redirect_to authentications_url\n else # if user doesn't exist\n user = User.new\n user.apply_omniauth(omniauth)\n if user.save #if validation passes\n flash[:notice] = \"Signed in successfully.\"\n sign_in_and_redirect(:user, user)\n else #if validation doesn't pass\n session[:omniauth] = omniauth.except('extra')\n redirect_to new_user_registration_url\n end\n end \n end",
"title": ""
},
{
"docid": "42ce33e8c707f73bd1d961f9233a89f7",
"score": "0.61157805",
"text": "def create\n omniauth = request.env['omniauth.auth']\n\n user = User.find_by_uid(omniauth['uid'])\n if not user\n # registruje novog usera\n user = User.new(:uid => omniauth['uid'])\n end\n user.email = omniauth['info']['email']\n user.save\n\n # sve info o useru u sesiji\n session[:user_id] = omniauth\n\n flash[:notice] = \"Successfully logged in\"\n redirect_to root_path\n end",
"title": ""
},
{
"docid": "3302ee5d5056d777f31bb5fcd410c403",
"score": "0.61052024",
"text": "def create\n # Where do we want to redirect to with our new session\n path = cookies.encrypted[:continue] || success_path\n\n # Get auth hash from omniauth\n auth = request.env[OMNIAUTH]\n\n if auth.nil?\n return login_failure({})\n end\n\n # Find an authentication or create an authentication\n auth_model = ::Auth::Authentication.from_omniauth(auth)\n\n # adding a new auth to existing user\n if auth_model.nil? && signed_in?\n logger.info \"User signed in and re-authenticating\"\n\n ::Auth::Authentication.create_with_omniauth(auth, current_user.id)\n redirect_to path\n Auth::Authentication.after_login_block.call(current_user, auth[PROVIDER], auth)\n\n # new auth and new user\n elsif auth_model.nil?\n args = safe_params(auth.info)\n user = ::User.new(args)\n\n # Use last name and first name by preference\n fn = args[:first_name]\n if fn && !fn.empty?\n user.name = \"#{fn} #{args[:last_name]}\"\n end\n\n authority = current_authority\n\n existing = ::User.find_by_email(authority.id, user.email)\n user = existing if existing\n user.deleted = false if user.respond_to?(:deleted)\n\n user.authority_id = authority.id\n\n # now the user record is initialised (but not yet saved), give\n # the installation the opportunity to modify the user record or\n # reject the signup outright\n result = Auth::Authentication.before_signup_block.call(user, auth[PROVIDER], auth)\n\n logger.info \"Creating new user: #{result.inspect}\\n#{user.inspect}\"\n \n if result != false && user.save\n # user is created, associate an auth record or raise exception\n Auth::Authentication.create_with_omniauth(auth, user.id)\n\n # make the new user the currently logged in user\n remove_session\n new_session(user)\n\n # redirect the user to the page they were trying to access and\n # run any custom post-login actions\n redirect_to path\n Auth::Authentication.after_login_block.call(user, auth[PROVIDER], auth)\n else\n logger.info \"User save failed: #{user.errors.messages}\"\n\n # user save failed (db or validation error) or the before\n # signup block returned false. redirect back to a signup\n # page, where /signup is a required client side path.\n store_social(auth[UID], auth[PROVIDER])\n redirect_to '/signup/index.html?' + auth_params_string(auth.info)\n end\n\n # existing auth and existing user\n else\n begin\n # Log-in the user currently authenticating\n remove_session if signed_in?\n user = User.find_by_id(auth_model.user_id)\n new_session(user)\n redirect_to path\n Auth::Authentication.after_login_block.call(user, auth[PROVIDER], auth)\n rescue => e\n logger.error \"Error with user account. Possibly due to a database failure:\\nAuth model: #{auth_model.inspect}\\n#{e.inspect}\"\n raise e\n end\n end\n end",
"title": ""
},
{
"docid": "76bba6f3c61842651c663d41637612af",
"score": "0.6105005",
"text": "def save\n # TODO validar atributos?\n response = Http.post(\"/organizations/api/identities/#{self.identity.uuid}/accounts/\", create_body)\n raise \"unexpected response: #{response.code} - #{response.body}\" unless response.code == 201\n attributes_hash = MultiJson.decode(response.body)\n set_attributes(attributes_hash)\n @persisted = true\n @errors = {}\n true\n rescue *[RestClient::BadRequest] => e\n @persisted = false\n @errors = MultiJson.decode(e.response.body)\n false\n end",
"title": ""
},
{
"docid": "33f67f518c3e4d6527cd3750adec2730",
"score": "0.6102381",
"text": "def create\n @omniauth = request.env[\"omniauth.auth\"]\n \n authentication = Authentications.find_by_provider_and_uid(@omniauth['provider'], @omniauth['uid'])\n\n if(@@logingIn ==0) \n registering(authentication)\n elsif(@@logingIn ==1)\n signingIn(authentication)\n end\n\nend",
"title": ""
},
{
"docid": "a0df4de0d135341cfae4bbb71bd28f55",
"score": "0.6088507",
"text": "def create\n omniauth = request.env['omniauth.auth']\n authentication = Authentication.find_by_provider_and_uid(omniauth['provider'], omniauth['uid'])\n if authentication\n flash[:notice] = \"Signed in successfully\"\n sign_in_and_redirect(:user, authentication.user)\n else\n user = User.new\n user.apply_omniauth(omniauth)\n user.email = omniauth['extra'] && omniauth['extra']['user_hash'] && omniauth['extra']['user_hash']['email']\n if user.save\n flash[:notice] = \"Successfully registered\"\n sign_in_and_redirect(:user, user)\n else\n session[:omniauth] = omniauth.except('extra')\n session[:omniauth_email] = omniauth['extra'] && omniauth['extra']['user_hash'] && omniauth['extra']['user_hash']['email']\n\n # Check if email already taken. If so, ask user to link_accounts\n if user.errors[:email][0] =~ /has already been taken/ # omniauth? TBD\n # fetch the user with this email id!\n user = User.find_by_email(user.email)\n return redirect_to link_accounts_url(user.id)\n end\n redirect_to new_user_registration_url\n end\n end\n end",
"title": ""
},
{
"docid": "b05193ba4ef74aa12a976c11fd985fcf",
"score": "0.60655254",
"text": "def save\n response = if @id.nil?\n @cloud.auth_for_accounts [@parent]\n @cloud.post ['cloud-service-auth', 'accounts'], self\n else\n @cloud.post path, self\n end\n apply_data(response.body)\n self\n end",
"title": ""
},
{
"docid": "10c6512bd397559c09b2acc5576e2405",
"score": "0.60549414",
"text": "def apply_omniauth(omniauth)\n # self.email = omniauth['info']['email'] if email.blank? # Twitter does not return an email\n authentications.build(provider: omniauth[\"provider\"], uid: omniauth[\"uid\"])\n end",
"title": ""
},
{
"docid": "ff32ac31468b9146e5abdd36866b44c1",
"score": "0.60335124",
"text": "def apply_omniauth(omniauth)\n self.email = omniauth['user_info']['email'] if email.blank?\n\n if nick.blank?\n self.nick = (omniauth['user_info']['first_name'] || omniauth['user_info']['nickname'] ||\n omniauth['user_info']['name'] ||omniauth['user_info']['email'])\n end\n\n self.email_alert = false\n self.sms_alert = false\n self.weekend = false\n\n authentications.build(:provider => omniauth['provider'], :uid => omniauth['uid'])\n end",
"title": ""
},
{
"docid": "5af668b95bbb35d4c8460e396f653499",
"score": "0.6015779",
"text": "def create\n omniauth = request.env['omniauth.auth']\n authentication = Authentication.find_by_provider_and_uid(omniauth['provider'], omniauth['uid'])\n if authentication\n flash[:notice] = \"Signed in successfully\"\n sign_in_and_redirect(:user, authentication.user)\n else\n user = User.new\n user.apply_omniauth(omniauth)\n user.login = omniauth['info'] && omniauth['info']['nickname']\n if user.save\n flash[:notice] = \"Successfully registered\"\n sign_in_and_redirect(:user, user)\n else\n session[:omniauth] = omniauth.except('extra')\n session[:omniauth_login] = user.login\n\n # Check if login already taken. If so, ask user to link_accounts\n if user.errors[:login][0] =~ /has already been taken/ # omniauth? TBD\n # fetch the user with this login id!\n user = User.find_by_login(user.login)\n return redirect_to link_accounts_url(user.id)\n end\n redirect_to new_user_registration_url\n end\n end\n end",
"title": ""
},
{
"docid": "5cc7b256046cf924c38ce712091bd70d",
"score": "0.60124195",
"text": "def add_omniauth(auth)\n self.authentications.find_or_create_by(\n provider: auth['provider'],\n uid: auth['uid'].to_s\n )\n end",
"title": ""
},
{
"docid": "f367b28ab1612968e56cf3eda0c347b7",
"score": "0.6007982",
"text": "def create\n omniauth = request.env[\"omniauth.auth\"]\n\n authentication = Authentication.find_by_provider_and_uid(\n omniauth['provider'],\n omniauth['uid']\n )\n\n if authentication\n\n sign_in_and_redirect(:user, authentication.user)\n\n elsif current_user\n current_user.authentications.create(:provider => omniauth['provider'],\n :uid => omniauth['uid'])\n flash[:notice] = \"Authentication with #{omniauth['provider']} was successful.\"\n redirect_to authentications_url\n else\n # New user\n user = User.new\n\n user.apply_omniauth(omniauth)\n if user.save\n check_event_entry user.authentications[0]\n sign_in_and_redirect(:user, user)\n else\n session[:omniauth] = omniauth.except('extra')\n redirect_to new_user_registration_url\n end\n end\n end",
"title": ""
},
{
"docid": "85534439146d2c51b9964a2e549f38cc",
"score": "0.5988473",
"text": "def create\n omniauth = request.env['omniauth.auth']\n authentication = Authentication.find_by_provider_and_uid(omniauth['provider'], omniauth['uid'])\n if authentication\n flash[:notice] = \"Signed in successfully\"\n sign_in_and_redirect(:account, authentication.account)\n else\n user = Account.new(password: Devise.friendly_token) # If you create an account with twitter/fb, we don't need a passwod\n user.apply_omniauth(omniauth)\n user.email = get_email_from_omniauth omniauth\n if user.save\n flash[:notice] = \"Successfully registered\"\n sign_in_and_redirect(:account, user)\n else\n session[:omniauth] = omniauth.except('extra')\n session[:omniauth_email] = omniauth['extra'] && omniauth['extra']['user_hash'] && omniauth['extra']['user_hash']['email']\n\n # Check if email already taken. If so, ask user to link_accounts\n if user.errors[:email][0] =~ /has already been taken/ # omniauth? TBD\n # fetch the user with this email id!\n user = Account.find_by_email(user.email)\n return redirect_to link_accounts_url(user.id)\n end\n redirect_to new_account_registration_url\n end\n end\n end",
"title": ""
},
{
"docid": "8d6ae1871270ae46f2026d3ea98c87cf",
"score": "0.5960152",
"text": "def create_from_omniauth(omniauth_hash)\n info_hash = omniauth_hash['info']\n return nil unless email = info_hash && info_hash['email']\n user = User.new\n user.credentials << Credentials::Email.new(email: email, verified: true)\n user.save!\n user\n end",
"title": ""
},
{
"docid": "3d0ae8f3434e18c73b8bc905a42a59d8",
"score": "0.59555477",
"text": "def create\n\n\t\t# grab the authentication return\n\t\tauth = request.env[\"omniauth.auth\"]\n\n\t\t# now create a temporary user with the auth element etc\n\t\tuser = User.omniauth_create auth\n\n\t\t# now set the session_id \n\t\tsession[:id] = user.id\n\n\t\t# redirect back to the root which can successfully switch the pages of the application etc\n\t\tredirect_to root_url, :notice => \"Successful Authentication\"\t\n\tend",
"title": ""
},
{
"docid": "fa7e32d3db0c4c13d5f3d4f754856425",
"score": "0.5952881",
"text": "def create\n omniauth = request.env['omniauth.auth']\n # Check whether the Identity exists\n identity = Identity.from_omniauth(omniauth)\n if identity # If it does, sign the user in\n flash[:notice] = 'Welcome back!'\n sign_in_and_redirect(:user, identity.user)\n else\n handle_new_identity(omniauth)\n end\n end",
"title": ""
},
{
"docid": "649b9ed4c4b85aa31acfca16b465db97",
"score": "0.59483856",
"text": "def apply_omniauth(omniauth)\n info = omniauth[\"info\"]\n\n user_name = %Q(#{info[\"first_name\"]} #{info[\"last_name\"]})\n user_name.gsub!(/\\s+/, \" \").strip!\n\n self.provider = omniauth[\"provider\"]\n self.uid = omniauth[\"uid\"]\n self.name = user_name if self.name.blank?\n self.email = info[\"email\"] if info[\"email\"] && self.email.blank?\n self\n end",
"title": ""
},
{
"docid": "cf29d094f37c6e24510e3229bc0102cb",
"score": "0.5945009",
"text": "def create\n \n \n user = User.from_omniauth(env[\"omniauth.auth\"])\n session[:user_id] = user.id\n \n redirect_to root_path\n \n #render :text => auth_hash.inspect\n #raise request.env[\"omniauth.auth\"].to_yaml\n \n #Original\n # user=Authorization.find_by_provider_and_uid(auth[\"provider\"],auth[\"uid\"]) || Authorization.create_with_omniauth(auth)\n # #session[:user_id] = user.id\n #redirect_to root_path\n \n end",
"title": ""
},
{
"docid": "709eeddcbb05ad387d862bfda9711fcb",
"score": "0.59395313",
"text": "def create_authentication(omniauth)\n authentications.create! do |a|\n a.provider = omniauth.provider\n a.uid = omniauth.uid\n end\n end",
"title": ""
},
{
"docid": "d76a9b0b8b5c00d788de81f30bd9fa58",
"score": "0.5934763",
"text": "def create\n # Store authentication hash from 3rd party web service \n omniauth = request.env['omniauth.auth']\n logger.debug \"\\n\\n\\t omniauth \\n\\n\"\n logger.debug omniauth\n\n \n # Attempt to find an existing authentication in the database\n authentication = Authentication.\n find_by_provider_and_uid(omniauth['provider'], omniauth['uid'])\n \n # handle returning user, new authentication for existing user, \n # or new user cases\n if authentication\n # we found an authentication in the database so\n # we know this is a returning user\n flash[:notice] = \"Signed in successfully\"\n # redirect to user's profile\n sign_in_and_redirect(:user, authentication.user)\n elsif current_user\n # We did not find a matching authentication in the \n # database but current_user is defined. This tells\n # us that a currently logged in user is adding a new\n # authentication method to their existing account.\n\n # build new authentication for current_user\n current_user.build_authentication(omniauth)\n\n flash[:notice] = \"Authentication successful\"\n # redirect to the page for managing authentications\n redirect_to authentications_url\n else\n # We did not find a matching authentication and there\n # is no current_user. So, we need to create a new User\n # and a new Authentication.\n\n # Find the invited user by the invitation_token\n user = User.accept_invitation!(:invitation_token => session[:invitation_token])\n\n # Build a new authentication\n user.build_authentication(omniauth)\n \n # try to save the user\n if user.save\n # if we pass the authentications redirect the new user\n # to the user's profile page\n flash[:notice] = \"Signed in successfully.\"\n sign_in_and_redirect(:user, user)\n else\n # if we did not pass the authentications (e.g. the new\n # user did not have an email address) we redirect to \n # the new_user_registration_url so that the new user\n # can give us the information that we need. This is where\n # we collect emails from people who sign up with LinkedIn or \n # Facebook.\n session[:omniauth] = omniauth.except('extra')\n redirect_to new_user_registration_url\n end\n end\n end",
"title": ""
},
{
"docid": "c9e7a175ecc1aeb0e633bfc02e33b70e",
"score": "0.59155697",
"text": "def create\n @user = User.find_or_create_with_omniauth auth_hash\n session[:user_id] = @user.id\n redirect_to auth_path\n end",
"title": ""
},
{
"docid": "6d2227b9a6ed0bd3fafc97c10e8676f4",
"score": "0.5914462",
"text": "def apply_omniauth(omniauth)\n authentications.build(:provider => omniauth['provider'], :uid => omniauth['uid'])\n end",
"title": ""
},
{
"docid": "bdaeb55b9cd44d8a28cad8ff95ccedf9",
"score": "0.5913925",
"text": "def omniauth\r\n @user = User.create_by_google_omniauth(auth)\r\n \r\n session[:user_id] = @user.id\r\n redirect_to user_path(@user)\r\n end",
"title": ""
},
{
"docid": "d81aaa92030c119cfec5a942867c0961",
"score": "0.58991367",
"text": "def create\n auth = request.env[\"omniauth.auth\"]\n user = User.find_by_provider_and_uid(auth[\"provider\"], auth[\"uid\"]) || User.create_with_omniauth(auth)\n User.update(user.id, :fb_nickname => auth[\"info\"][\"nickname\"])\n session[:user_id] = user.id\n redirect_to root_url\n end",
"title": ""
},
{
"docid": "1ac6e5cf9b8f90614cdeb11dc4b129fd",
"score": "0.5898655",
"text": "def create_authentication(omniauth)\n authentications.create! do |a|\n a.provider = omniauth.provider\n a.uid = omniauth.uid\n end\n end",
"title": ""
},
{
"docid": "3ce52d944917c07df4bc934603c11579",
"score": "0.58890057",
"text": "def apply_omniauth(omniauth)\n\t\t#puts \"omniauth #{omniauth}\"\n\t\tself.email = omniauth['info']['email'] if email.blank?\n\t\tself.username = omniauth['info']['name'] if username.blank?\n\t\tself.remote_image_url = omniauth['info']['image'] if remote_image_url.blank?\n\t\tauthentications.build(:provider => omniauth['provider'], :uid => omniauth['uid'], :oauth_token => omniauth['credentials']['token'], :oauth_token_secret => omniauth['credentials']['secret'])\n\t\tputs \"authentication built\"\n\tend",
"title": ""
},
{
"docid": "9a1a0851a8fba076e2c0b293280eb312",
"score": "0.58880705",
"text": "def oauth_signup\n @user = User.new(\n nickname: params[:nickname],\n sex: params[:sex],\n phone: params[:phone],\n birthday: params[:birthday],\n province: params[:province],\n city: params[:city],\n area: params[:area] )\n @user.created_by_oauth = 'mobile'\n @user.authentications.build(\n uid: params[:oauth_uid],\n provider: params[:provider],\n access_token: params[:access_token])\n if @user.save\n @user.confirm!\n render :login\n else\n render json: {\n success: false,\n message: @user.errors.messages\n }\n end\n end",
"title": ""
},
{
"docid": "1eebc2faeac471b1d9f19876a4830655",
"score": "0.58850324",
"text": "def create\n auth = request.env[\"omniauth.auth\"]\n user_info = auth[\"info\"] ? auth[\"info\"] : auth[\"user_info\"]\n authentication = Authorization.where(:provider => auth['provider'], :uid => auth['uid']).first\n authentication = Authorization.new(:provider => auth['provider'], :uid => auth['uid']) if !authentication\n session[:fb_token] = auth['credentials']['token'] if auth['credentials']['token'] != nil\n # if the user exists, but does not have a link with the social service\n if !authentication.user && current_user\n authentication.user = current_user\n authentication.save\n end\n # twitter only (gets no email)\n if !authentication.user && !user_info[\"email\"]\n flash[:notice] = \"No user linked to this account. Please sign in or create a new account\"\n redirect_to '/users/sign_up/'\n # if user doesnt exists, register user\n elsif !authentication.user\n user = User.where(email: user_info['email']).first\n if user\n authentication.user = user\n else\n new_user = User.new(email: user_info['email'], username: user_info['name'], first_name: user_info['first_name'], last_name: user_info['last_name'], role: \"registered\")\n new_user.save\n authentication.user = new_user\n end\n authentication.save\n end\n # if user exists, sign in. Gives a Mongoid glitch of not signing in after registration. So double sign in\n if authentication.user\n if !current_user\n sign_in authentication.user\n sign_out authentication.user\n sign_in authentication.user\n # raise \"user signed in? #{user_signed_in?.to_s}\".inspect\n flash[:notice] = \"Authorization successful.\"\n redirect_to root_path\n else\n flash[:notice] = \"Linked successfully.\"\n redirect_to '/users/'+current_user.id\n end\n end\n end",
"title": ""
},
{
"docid": "bc5886fe54d051fcf3941b93ff8a3200",
"score": "0.5863144",
"text": "def apply_omniauth(omniauth)\n #add some info about the user\n self.login ||= omniauth['user_info']['nickname']\n self.picture_url = omniauth['user_info']['image']\n self.email ||= omniauth['user_info']['email']\n #self.nickname = omniauth['user_info']['nickname'] if nickname.blank?\n \n # unless omniauth['credentials'].blank?\n # user_tokens.build(:provider => omniauth['provider'], :uid => omniauth['uid'])\n # else\n user_tokens.build(:provider => omniauth['provider'], :uid => omniauth['uid'], \n :token => omniauth['credentials']['token'], :token_secret => omniauth['credentials']['secret'])\n # end\n #self.confirm!# unless user.email.blank?\n end",
"title": ""
},
{
"docid": "fec93997da9331a5b4ff9571f7891458",
"score": "0.5845365",
"text": "def create_or_update_identity_from_omniauth_hash\n # Create or update an identity from the attributes mapped in the mapper\n identity = identities.find_or_initialize_by(uid: omniauth_hash_map.uid, provider: omniauth_hash_map.provider)\n if identity.expired?\n identity.properties.merge!(omniauth_hash_map.properties)\n identity.save\n end\n end",
"title": ""
},
{
"docid": "607a6b1b6742a252ade3647dbe9a2105",
"score": "0.5824655",
"text": "def create\n auth_hash = request.env['omniauth.auth']\n user = User.find_or_create_by(uid: auth_hash[\"uid\"], provider: auth_hash['provider'])\n user.update_attributes(\n name: auth_hash.info['name'],\n nickname: auth_hash.info['nickname'],\n email: auth_hash.info['email'],\n image: auth_hash.info['image'],\n access_token: auth_hash.credentials['token'])\n sign_in user\n if user\n redirect_to :gem_notes\n else\n render 'home/index'\n end\n end",
"title": ""
},
{
"docid": "b377374e6101ecc11f141a3739d28f43",
"score": "0.58219385",
"text": "def omniauth\n if params[:provider] == 'github'\n @user = User.find_or_create_by_github_omniauth(auth)\n else \n @user = User.find_or_create_by_google_omniauth(auth)\n end\n\n session[:user_id] = @user.id\n redirect_to user_path(@user)\n end",
"title": ""
},
{
"docid": "4003cf92d3ecb8e9cee9dc0cfbedecc5",
"score": "0.5818464",
"text": "def update_and_save_from_auth_hash(auth_hash)\n update_from_auth_hash(auth_hash)\n unless save\n messages = errors.full_messages.join(', ')\n logger.error \"Unable to update account (#{provider}##{uid}): #{messages}\"\n end\n self\n end",
"title": ""
},
{
"docid": "01f684fdee41fe946c563baae1daff02",
"score": "0.58070415",
"text": "def save\n\t\tbegin\n\t\t\tuser_profile = self.profile\n\t\t\tUser.create(\n\t\t\t\t:user_id => id,\n\t\t\t\t:login_name => username,\n\t\t\t\t:email => email,\n\t\t\t\t:join_tsz => created,\n\t\t\t\t:transaction_buy_count => user_profile.transaction_buy_count,\n\t\t\t\t:transaction_sold_count => user_profile.transaction_sold_count,\n\t\t\t\t:is_seller => user_profile.is_seller,\n\t\t\t\t:location => user_profile.lon ? [user_profile.lon, user_profile.lat] : nil,\n\t\t\t\t:image_url => user_profile.image,\n\t\t\t\t:country_id => user_profile.country_id,\n\t\t\t\t:gender => user_profile.gender,\n\t\t\t\t:oauth_token => nil,\n\t\t\t\t:oauth_token_secret => nil,\n\t\t\t\t:authenticated => false,\n\t\t\t\t:shop_id => @shop_id\n\t\t\t)\n\t\trescue NoMethodError\n\t\t\t# fairly rare at this point.\n\t\t\tputs \"associated_profile bug\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "aaed50139abef4bd30c149266c6a384a",
"score": "0.5783738",
"text": "def create\n omniauth = request.env['omniauth.auth']\n authparams = ActionController::Parameters.new(omniauth.slice 'provider', 'uid').permit('provider', 'uid')\n # Our query parameters appear in env['omniauth.params']\n if origin_url = request.env['omniauth.origin'] # Remove any enclosing quotes\n origin_url.sub! /^\"?([^\"]*)\"?/, '\\\\1'\n end\n # Originator is where we came from, so we can go back there if login fails\n if originator = request.env['omniauth.params']['originator'] # Remove any enclosing quotes\n originator.sub! /^\"?([^\"]*)\"?/, '\\\\1'\n end\n # Check for existing authorization\n @authentication = Authentication.find_by_provider_and_uid(omniauth['provider'], omniauth['uid'])\n (info = omniauth['info']) && (email = info['email']) && (user = User.find_by_email(email))\n intention = request.env['omniauth.params']['intention'] # If intention is 'signup', don't accept existing authentications\n if intention == \"signup\"\n if @authentication || user # This authentication method already in use\n flash[:notice] = \"That #{omniauth.provider.capitalize} login is already in use on RecipePower.<br>Perhaps you just need to sign in?\"\n response_service.amend originator\n url_to = originator\n else # No user and no authentication: perfect\n # Just create the account, getting what we can get out of the authorization info\n (user = User.new).apply_omniauth(omniauth)\n response_service.amend originator\n if user.save\n @authentication = user.authentications.create!(authparams) # Link authorization to user\n sign_in user, :event => :authentication\n response_service.user = user\n SignupEvent.post user # RpMailer.welcome_email(user).deliver\n flash[:notice] =\n %Q{Welcome to RecipePower, #{user.polite_name}! Introductory email is on its way. }\n url_to = after_sign_in_path_for(user)\n else\n # If user can't be saved, go back to edit params\n url_to = response_service.decorate_path(new_user_registration_url)\n end\n end\n # Intention is not signing up\n elsif current_user\n if @authentication # Authentication already in use\n if @authentication.user == current_user\n flash[:notice] = \"You're already connected through #{@authentication.provider_name}!\"\n else\n flash[:notice] = \"Sorry, your current #{@authentication.provider_name} login is tied to another RecipePower user.\"\n end\n else\n # Add the authentication method to the current user. We return to the authentications dialog\n current_user.apply_omniauth(omniauth)\n @authentication = current_user.authentications.create!(authparams) # Link to existing user\n flash[:notice] = \"Yay! You're now connected to RecipePower through #{@authentication.provider_name}.\"\n end\n url_to = origin_url\n elsif @authentication\n flash[:notice] = \"Yay! Signed in with #{@authentication.provider_name}. Welcome back, #{@authentication.user.handle}!\"\n sign_in @authentication.user, :event => :authentication\n response_service.amend originator\n url_to = after_sign_in_path_for(@authentication.user)\n # This is a new authentication (not previously linked to a user) and there is\n # no current user to link it to. It's possible that the authentication will come with\n # an email address which we can use to log the user in.\n elsif user\n user.apply_omniauth(omniauth)\n @authentication = user.authentications.create!(authparams) # Link to existing user\n sign_in user, :event => :authentication\n flash[:notice] = \"Yay! Signed in with #{@authentication.provider_name}. Nice to see you again, #{user.handle}!\"\n response_service.amend originator\n url_to = after_sign_in_path_for(user)\n end\n # We haven't managed to get the user signed in by other means, but we still have an authorization\n if !(current_user || user) # Failed login not because of failed invitation\n # The email didn't come in the authorization, so we now need to\n # discriminate between an existing user(and have them log in)\n # and a new user (and have them sign up). Time to throw the problem\n # over to the user controller, providing it with the authorization.\n session[:omniauth] = omniauth.except('extra')\n flash[:notice] = \"Hmm, apparently that service isn't linked to your account. If you log in by other means (perhaps you need to create an account?), you can link that service in Sign-In Services\"\n url_to = originator || new_user_session_path\n end\n # response_service.amend origin_url # Amend response expectations according to the originating URL\n render 'callback', :layout => false, :locals => { url_to: url_to }\n end",
"title": ""
},
{
"docid": "12761318bc5b4893b70158c7397f8466",
"score": "0.5775818",
"text": "def from_omniauth(auth)\n info = auth.info\n extra_info = auth.extra.raw_info\n self.nickname = info.nickname\n self.hireable = extra_info.hireable\n self.bio = extra_info.bio\n self.public_repos_count = extra_info.public_repos\n self.number_followers = extra_info.followers\n self.number_following = extra_info.following\n self.number_gists = extra_info.public_gists\n self.token = auth.credentials.token\n self.uid = auth.uid\n self.github_account_key = extra_info.id\n self.save\n end",
"title": ""
},
{
"docid": "88802db8e09cc662bcb686d22b246b65",
"score": "0.5773859",
"text": "def create_by_omniauth(auth)\n User.create do |user|\n user.assign_attributes(name: auth.info.name, email: auth.info.email,\n password: Devise.friendly_token[0, 20])\n user.skip_confirmation! if user.email\n user.link_with_omniauth(auth)\n end\n end",
"title": ""
},
{
"docid": "b71ac626e10355ef71d0abd3be6eedcf",
"score": "0.5770905",
"text": "def create\n\t # get the authentication parameter from the Rails router\n\t params[:provider] ? authentication_route = params[:provider] : authentication_route = 'No authentication recognized (invalid callback)'\n\n\t # get the full hash from omniauth\n\t omniauth = request.env['omniauth.auth']\n\t \n\t # continue only if hash and parameter exist\n\t if omniauth and params[:provider] == 'identity'\n\t # in the session his user id and the authentication id used for signing in is stored\n\t session[:identity] = omniauth['uid']\n\t redirect_to root_url, :notice => \"Signed in successfully.\"\n\t \n\t elsif omniauth and params[:provider]\n\t # create a new hash\n\t @authhash = Hash.new\n\t if authentication_route == 'google_oauth2'\n\t omniauth['info']['email'] ? @authhash[:email] = omniauth['info']['email'] : @authhash[:email] = ''\n\t omniauth['info']['name'] ? @authhash[:name] = omniauth['info']['name'] : @authhash[:name] = ''\n\t omniauth['uid'] ? @authhash[:uid] = omniauth['uid'].to_s : @authhash[:uid] = ''\n\t omniauth['provider'] ? @authhash[:provider] = omniauth['provider'] : @authhash[:provider] = ''\n\t else \n\t # debug to output the hash that has been returned when adding new authentications\n\t render :text => omniauth.to_yaml\n\t return\n\t end\n\t \n\t if @authhash[:uid] != '' and @authhash[:provider] != ''\n\t auth = Authentication.find_by_provider_and_uid(@authhash[:provider], @authhash[:uid])\n\t # if the user is currently signed in, he/she might want to add another account to signin\n\t if logged_in?\n\t if auth\n\t flash[:notice] = 'Your account at ' + @authhash[:provider].capitalize + ' is already connected with this site.'\n\t redirect_to authentications_path\n\t else\n\t current_user.authentications.create!(:provider => @authhash[:provider], :uid => @authhash[:uid], :uname => @authhash[:name], :uemail => @authhash[:email])\n\t flash[:notice] = 'Your ' + @authhash[:provider].capitalize + ' account has been added for signing in at this site.'\n\t redirect_to authentications_path\n\t end\n\t else\n\t if auth\n\t # signin existing user\n\t # in the session his user id and the authentication id used for signing in is stored\n\t session[:user] = auth.user.id\n\t session[:authentication_id] = auth.id\n\t \n\t flash[:notice] = 'Signed in successfully.'\n\t redirect_to root_url\n\t else\n\t # this is a new user; show signup; @authhash is available to the view and stored in the sesssion for creation of a new user\n\t if Rails.env == \"development\" or @authhash[:email].split('@').include?('intridea.com')\n\t session[:authhash] = @authhash\n\t render signup_authentications_path\n\t end\n\t # render signup_authentications_path\n\t end\n\t end\n\t else\n\t flash[:error] = 'Error while authenticating via ' + authentication_route + '/' + @authhash[:provider].capitalize + '. The authentication returned invalid data for the user id.'\n\t redirect_to login_path\n\t end\n\t else\n\t flash[:error] = 'Error while authenticating via ' + authentication_route.capitalize + '. The authentication did not return valid data.'\n\t redirect_to login_path\n\t end\n\t end",
"title": ""
},
{
"docid": "a8dc11a5bb8336cf56d3422c917deb75",
"score": "0.5766718",
"text": "def registering(authentication)\n\n if (authentication.nil?)\n authentication = Authentications.new\n authentication.provider = @omniauth['provider']\n authentication.uid = @omniauth['uid']\n user = Customer.new\n # authentication.user_id = user.id Need to save the user first to generate the automated unique id\n if (@omniauth['info'])\n user.first_name = @omniauth['info']['first_name']\n user.last_name = @omniauth['info']['last_name']\n user.address = @omniauth['info']['location']\n user.description = @omniauth['info']['description']\n user.email = @omniauth['info']['email'] #auth.info.email\n user.password = Devise.friendly_token[0,20]\n end\n\n /=if (@omniauth['extra'])\n user.tempInfo = @omniauth['extra']['raw_info']\n end=/\n \n #need to check if preference exists\n preference = Preference.find_by_id(RegisterController.id)\n user.preference_id = preference.id\n \n if (!user.save)\n if(user.errors.added? :email, :taken)\n user.email = new_email_from_existing(user.email)\n user.save\n end\n end\n\n preference.customer_id = user.id\n preference.save\n\n authentication.user_id = user.id\n authentication.save \n session[:user_id] = user.id\n \n flash[:notice] = \"Thanks for registering\\n\"\n redirect_to root_path \n else \n redirect_to root_path, :notice => \"You already have an account!\\n Please logIn \"\n \n end\n\nend",
"title": ""
},
{
"docid": "abe33337da0f109fdde5e211a44d07b2",
"score": "0.5763933",
"text": "def apply_omniauth(omniauth)\n authentications.build(provider: omniauth['provider'],\n uid: omniauth['uid'],\n token: omniauth['credentials']['token'],\n secret: omniauth['credentials']['secret'])\n end",
"title": ""
},
{
"docid": "9af05f8dc52694134948a4575b4c247e",
"score": "0.5738723",
"text": "def create\n\t\t@user = User.find_or_create_from_auth_hash(request.env[\"omniauth.auth\"])\n\t\tredirect_to(@@extension_url + '?access_token=' + @user.oauth_token)\n\tend",
"title": ""
},
{
"docid": "a3c7997061af257999b16963f6430335",
"score": "0.5733305",
"text": "def omniauthclone omniauthable, auth=nil\n PROVIDERS.reject{|p| p == auth}.each do |provider|\n unless self.send(\"#{provider}?\")\n if omniauthable.send(\"#{provider}?\")\n self[\"#{auth.provider}_uid\"] = omniauthable[\"#{auth.provider}_uid\"]\n self[\"#{auth.provider}_auth\"] = omniauthable[\"#{auth.provider}_auth\"]\n self.save\n end\n end\n end\n end",
"title": ""
},
{
"docid": "f002745208e5bff12308d8517282f1e6",
"score": "0.57326794",
"text": "def link_with_omniauth!(auth)\n link_with_omniauth(auth)\n save\n end",
"title": ""
},
{
"docid": "ee778534fb45983e773d62259f23ee3d",
"score": "0.5723795",
"text": "def create\n\n\t\t@auth = request.env[\"omniauth.auth\"]\n\n\t\tprovider = @auth.provider\n\t\tuid = @auth.uid\n\t\taccess_token = @auth.credentials.token\n\t\ttoken_secret = @auth.credentials.secret\n\t\tconsumer_key = \"\"\n\t\tconsumer_secret = \"\"\n\n\t\tif provider == \"bitbucket\"\n\t\t\tconsumer_key = @auth.extra.access_token.consumer.key\n\t\t\tconsumer_secret = @auth.extra.access_token.consumer.secret\n\t\tend\n\n\t\t@authentication = Authentication.find_by_provider_and_uid(provider, uid)\n\n\t\tif @authentication.present?\n\t\t\t# The authentication is already there\n\t\t\t# Get the user\n\t\t\tuser = @authentication.user\n\n\t\t\t# And sign him in\n\t\t\tflash[:notice] = \"Signed in successfully\"\n\t\t\tsign_in_and_redirect :user, user\n\n\t\telsif current_user.present?\n\t\t\t# There's no authentication in db, but the user is present\n\n\t\t\t# Create an authentication for the user and redirect\n\t\t\tcurrent_user.authentications.create! :provider => provider, \n\t\t\t\t\t\t\t\t\t\t\t\t :uid => uid, \n\t\t\t\t\t\t\t\t\t\t\t\t :access_token => access_token,\n\t\t\t\t\t\t\t\t\t\t\t\t :token_secret => token_secret,\n\t\t\t\t\t\t\t\t\t\t\t\t :consumer_key => consumer_key,\n\t\t\t\t\t\t\t\t\t\t\t\t :consumer_secret => consumer_secret\n\t\t\tredirect_to deployable_applications_url, :notice => \"Successfully added authentication.\"\n\n\t\telse\n\n\t\t\tredirect_to new_user_registration_url and return\n\n\t\t\t# Uncomment this to make the user log in with integrations\n\n\t\t\t# # There is no @auth and no user\n\t\t\t# # So create a new user\n\t\t\t# user = User.new\n\n\t\t\t# # Create an authentication for the new user\n\t\t\t# user.apply_omniauth(@auth)\n\n\t\t\t# if user.save\n\t\t\t# \t# Sign him in if no errors\n\t\t\t# \tflash[:notice] = \"Signed in successfully\"\n\t\t\t# \tflash[:just_signed_up] = true\n\t\t\t# \tsign_in_and_redirect :user, user\n\t\t\t# else\n\t\t\t# \t# Complete registration if any errors\n\t\t\t# \tsession[:omniauth] = @auth.except('extra')\n\t\t\t# \tredirect_to new_user_registration_url\n\t\t\t# end\n\t\tend\n\n\tend",
"title": ""
},
{
"docid": "77c5ba0203178f1702eaae2085bfd1e7",
"score": "0.5708846",
"text": "def create\n @user = User.where_omniauth(auth_hash)\n sign_in @user\n redirect_to root_url, alert: \"You have been signed in successfully.\"\n end",
"title": ""
},
{
"docid": "62ac6a54e5fc1da66a188f25a0067c05",
"score": "0.5690654",
"text": "def auth_params\n params = ActionController::Parameters.new(env[\"omniauth.auth\"])\n Hashie::Mash.new params.permit(:uid, :provider, info: [:name, :email])\n end",
"title": ""
},
{
"docid": "2865dca38d5d12e87969d6d652120a21",
"score": "0.56758773",
"text": "def from_omniauth auth\n user = User.find_by email: auth.info.email\n\n user = User.new unless user.present?\n user.name = auth.info.name.present? ? auth.info.name : auth.info.email\n user.email = auth.info.email\n user.provider = auth.provider\n user.password = User.generate_unique_secure_token if user.new_record?\n user.token = auth.credentials.token\n user.refresh_token = auth.credentials.refresh_token\n user.save\n user\n end",
"title": ""
},
{
"docid": "d00229248f957029c1f50da5e2410ce1",
"score": "0.56708854",
"text": "def connect_to_linkedin(auth)\n self.linkedin_profiles.create(\n uid: auth.uid,\n token: auth.credentials.token,\n secret: auth.credentials.secret,\n first_name: auth.info.first_name,\n last_name: auth.info.last_name,\n phone: auth.info.phone,\n location: auth.info.location,\n profile_url: auth.info.urls.public_profile,\n industry: auth.info.industry,\n avatar: auth.info.image)\n # self.provider = auth.provider\n # self.save!\n end",
"title": ""
},
{
"docid": "5aedbdc3bb7e5b601ed77f36d520c4f9",
"score": "0.56531405",
"text": "def associate_with_social_account(social_params, social_image_cookie, social_bio_cookie)\n if social_params[\"provider\"].blank? || social_params[\"uid\"].blank?\n Airbrake.notify(:error_class => \"Logged Error\", :error_message => \"SOCIAL CREDENTIALS: The social credentials for #{self.id} did not get passed in from the sign up form. This is what we received: Provider = #{social_params[\"provider\"]} ; UID = #{social_params[\"uid\"]}\") if Rails.env.production?\n else\n # create a new social network record for storing their auth data in\n new_network ||= self.social_networks.new(:provider => social_params[\"provider\"].strip.downcase, :uid => social_params[\"uid\"].strip.downcase, :token => social_params[\"oauth_token\"], :token_secret => social_params[\"oauth_token_secret\"])\n if !new_network.save\n Airbrake.notify(:error_class => \"Logged Error\", :error_message => \"SOCIAL CREDENTIALS: Error creating social credentials for #{self.id} with these params: Provider = #{social_params[\"provider\"]} ; UID = #{social_params[\"uid\"]}\") if Rails.env.production?\n end\n end\n \n # upload their image\n begin\n self.set_new_user_image(nil, social_image_cookie, false, true)\n rescue\n Airbrake.notify(:error_class => \"Logged Error\", :error_message => \"PROFILE IMAGE: Error SAVING image from a social signup for #{self.email}. The image was #{social_image_cookie}\") if Rails.env.production?\n end\n \n # set their bio \n self.profile.update_attribute('bio', truncate(social_bio_cookie, :length => 140, :omission => '...')) \n end",
"title": ""
},
{
"docid": "bb49f3bf2b0a7d260d9cd3637b9dce97",
"score": "0.562525",
"text": "def assign_twitter_account_info(auth)\n user = auth.extra.raw_info\n self.twitter_id = user.id\n self.name = user.name\n self.screen_name = user.screen_name\n self.location = user.location\n self.description = user.description\n self.url = user.url\n self.profile_image_url = user.profile_image_url_https\n self\n end",
"title": ""
},
{
"docid": "b6f9984962d56bd30bee205385182b72",
"score": "0.56008625",
"text": "def callback\n auth = env['omniauth.auth']\n\n person = Person.find_by(email: auth.info.email)\n if person\n user = User.find_by(person: person)\n if not user\n user = User.new\n user.person = person\n end\n user.oauth_token = auth.credentials.token\n user.oauth_expires_at = Time.at(auth.credentials.expires_at)\n user.save!\n\n session[:user_id] = user.id\n if person.mentees.empty? && !person.admin?\n redirect_to root_path\n else\n redirect_to '/dashboard/'\n end\n\n else\n redirect_to google_unregistered_path\n end\n end",
"title": ""
},
{
"docid": "cd9f9aa862bd2989c5f358f871bbbe40",
"score": "0.5598808",
"text": "def apply_omniauth(omniauth, confirmation)\n self.email = omniauth['info']['email'] if email.blank?\n # Check if email is already into the database => user exists\n apply_trusted_services(omniauth, confirmation) if self.new_record?\n end",
"title": ""
},
{
"docid": "5e3e0f6a778a05216b3f22ddd0046a60",
"score": "0.5585215",
"text": "def create\n user = User.from_omniauth(env[\"omniauth.auth\"])\n session[:user_id] = user.id\n \n redirect_to root_path\n end",
"title": ""
},
{
"docid": "f35a705f6097c9a95a649e651bc2e52e",
"score": "0.5574733",
"text": "def create\n auth_hash = request.env['omniauth.auth']\n\n @authorization = Authorization.find_by(\n provider: auth_hash[\"provider\"],\n uid: auth_hash[\"uid\"]\n )\n\n session[:user_id] = auth_hash[:uid]\n\n if @authorization\n redirect_to \"/games\"\n else\n @user = User.find_or_initialize_by(uid: auth_hash[:uid])\n @user.name = auth_hash[\"info\"][\"name\"]\n @user.save\n\n redirect_to games_url\n end\n end",
"title": ""
},
{
"docid": "2c9db3d2d4fc6f66c6701b137150783f",
"score": "0.55743754",
"text": "def sign_in_user(auth)\n\t\tuser = User.from_omniauth(auth)\n\t\tif(user.persisted?)\n\t\t\tsign_in_and_redirect user\n\t\telse\n\t\t\tredirect_to new_user_session_path, alert: t('devise.omniauth.sign_in_error')\n\t\tend\n\tend",
"title": ""
},
{
"docid": "4c07d4684082f59f64d6b8c275f12931",
"score": "0.5572216",
"text": "def update_user_from_auth(auth)\n user = self\n user.username = auth.info.nickname\n user.avatar_url = auth.info.image\n user.location = auth.extra.raw_info.city\n user.country = auth.extra.raw_info.country\n user.name = auth.info.name\n user\n end",
"title": ""
},
{
"docid": "05fbca5b75f7d949ddce74723f203ab6",
"score": "0.5558603",
"text": "def omniauth \n\n @user = User.create_by_google_omniauth(auth)\n # @user = User.find_or_create_by(username: auth[:info][:email]) do |u| #moved this method to user model\n # u.password = SecureRandom.hex \n # end\n\n session[:user_id] = @user.id\n #if you havent set the password, it wont assign a userid, which means we won't have a user here to deal with\n redirect_to user_path(@user)\n\n #User.where(email: auth[:info][:email]).first_or_initialize\n #both .where method and .find_or_create_by method accomplish same thing\n \n end",
"title": ""
},
{
"docid": "9d4a5540d2b24e7783db0f4ba52e432e",
"score": "0.5555889",
"text": "def create\n auth = request.env[\"omniauth.auth\"]\n user = User.find_by_provider_and_uid(auth[\"provider\"], auth[\"uid\"]) || User.create_with_omniauth(auth)\n session[:user_id] = user.id\n redirect_to app_path\n end",
"title": ""
},
{
"docid": "7748c8feba0a02779901055d4ba1f709",
"score": "0.5551281",
"text": "def save\n # TODO validar atributos?\n response = Http.put(\"/accounts/api/service-info/#{identity.uuid}/#{slug}/\", save_body)\n raise \"unexpected response: #{response.code} - #{response.body}\" unless [200,201].include?(response.code)\n attributes_hash = MultiJson.decode(response.body)\n set_attributes(attributes_hash)\n @errors = {}\n @persisted = true\n true\n rescue *[RestClient::Conflict, RestClient::BadRequest] => e\n @errors = MultiJson.decode(e.response.body)\n false\n end",
"title": ""
},
{
"docid": "6a6533d1977f3316502d93fa0c161c98",
"score": "0.5548452",
"text": "def store_oauth2_credentials!(attributes = {})\n self.send(:\"#{self.class.oauth2_uid_field}=\", attributes[:uid])\n self.send(:\"#{self.class.oauth2_token_field}=\", attributes[:token])\n\n # Confirm without e-mail - if confirmable module is loaded.\n self.skip_confirmation! if self.respond_to?(:skip_confirmation!)\n\n # Only populate +email+ field if it's available (e.g. if +authenticable+ module is used).\n self.email = attributes[:email] || '' if self.respond_to?(:email)\n\n # Lazy hack: These database fields are required if +authenticable+/+confirmable+\n # module(s) is used. Could be avoided with :null => true for authenticatable\n # migration, but keeping this to avoid unnecessary problems.\n self.password_salt = '' if self.respond_to?(:password_salt)\n self.encrypted_password = '' if self.respond_to?(:encrypted_password)\n end",
"title": ""
},
{
"docid": "bde4c26cc6ec1104332c5fe8051f8a2c",
"score": "0.554734",
"text": "def signup!(params)\n self.email = params[:user][:email]\n self.name = params[:user][:name]\n self.password = params[:user][:password]\n #save_without_session_maintenance\n end",
"title": ""
},
{
"docid": "e68b63785593daaa5a3cc5e4da321a72",
"score": "0.55437344",
"text": "def update_from_omniauth(omniauth)\n extract_credentials_from_omniauth(omniauth)\n extract_info_from_omniauth(omniauth)\n end",
"title": ""
},
{
"docid": "deee1b8a768ceb534f0a5d9c9d2590e8",
"score": "0.55422056",
"text": "def save\n wallet.db.save_account(self)\n end",
"title": ""
},
{
"docid": "3f4a77df98ac0eb03815715296730514",
"score": "0.5539431",
"text": "def signup!(params)\n self.login = params[:user][:login]\n self.email = params[:user][:email]\n save_without_session_maintenance\n end",
"title": ""
},
{
"docid": "99f624f8b19936757a86b81667ad35b8",
"score": "0.552034",
"text": "def save\n vals = to_h\n vals.delete(:username)\n vals.delete_if { |_k, v| v.nil? || v.to_s.empty? }\n vals[:password] = vals.delete(:newpassword) if vals[:newpassword]\n payload = Gyoku.xml(user: vals)\n response = CoachClient::Request.put(url, username: @username,\n password: @password,\n payload: payload,\n content_type: :xml)\n unless response.code == 200 || response.code == 201\n fail CoachClient::NotSaved.new(self), 'Could not save user'\n end\n @password = vals[:password]\n @newpassword = nil\n self\n end",
"title": ""
},
{
"docid": "1da63cc658db51a7461bb43fa659f590",
"score": "0.5513785",
"text": "def identify\n @user = User.new\n if omniauth = session[:omniauth]\n @provider = omniauth.provider.capitalize\n @user.apply_omniauth(omniauth)\n end\n end",
"title": ""
},
{
"docid": "b28069a2ca51285847d6d17a59e29a62",
"score": "0.55133307",
"text": "def create_auth\n\t\t@auth = request.env['omniauth.auth']\n\t\tif User.where(:spotify_id => @auth[\"info\"][\"id\"]).first\n\t\t\t@user = User.where(:spotify_id => @auth[\"info\"][\"id\"]).first\n\t\telse\n\t\t\tif @auth[\"info\"][\"images\"][0][\"url\"] == \"\"\n\t\t\t\t@user = User.create(\n\t\t\t\t:display_name => @auth[\"info\"][\"display_name\"],\n\t\t\t\t:token => @auth[\"credentials\"][\"token\"],\n\t\t\t\t:refresh_token => @auth[\"credentials\"][\"refresh_token\"],\n\t\t\t\t:image_url => 'muziqala_logo.jpq',\n\t\t\t\t:spotify_id => @auth[\"info\"][\"id\"],\n\t\t\t\t:user_uri => @auth[\"info\"][\"uri\"]\n\t\t\t\t)\n\t\t\telse\n\t\t\t@user = User.create(\n\t\t\t\t:display_name => @auth[\"info\"][\"display_name\"],\n\t\t\t\t:token => @auth[\"credentials\"][\"token\"],\n\t\t\t\t:refresh_token => @auth[\"credentials\"][\"refresh_token\"],\n\t\t\t\t:image_url => @auth[\"info\"][\"images\"][0][\"url\"],\n\t\t\t\t:spotify_id => @auth[\"info\"][\"id\"],\n\t\t\t\t:user_uri => @auth[\"info\"][\"uri\"]\n\t\t\t\t)\n\t\t\tend\n\t\tend\n\t\tsession[:user_id] = @user.id\n\t\tredirect_to user_path(@user)\n\tend",
"title": ""
},
{
"docid": "dc4418b6b6d5f0470146f770096a224c",
"score": "0.5502797",
"text": "def create_omniauth\n org_uid = params[:state]\n organization = Maestrano::Connector::Rails::Organization.find_by_uid_and_tenant(org_uid, current_user.tenant)\n\n if organization && is_admin?(current_user, organization)\n organization.from_omniauth(env[\"omniauth.auth\"])\n\n # Fetch SalesForce user details\n user_details = Maestrano::Connector::Rails::External.fetch_user(organization)\n current_user.update_attribute(:locale, user_details['locale'])\n current_user.update_attribute(:timezone, user_details['timezone'])\n\n # Fetch SalesForce company name\n company = Maestrano::Connector::Rails::External.fetch_company(organization)\n organization.update_attribute(:oauth_name, company['Name'])\n organization.update_attribute(:oauth_uid, company['Id'])\n end\n\n redirect_to root_url\n end",
"title": ""
},
{
"docid": "b1da1612c13e2a1630295b3735e4f816",
"score": "0.5492741",
"text": "def save\n send(\"principals=\", client_principal.to_abbreviated)\n client.put(api_path, to_json, headers)\n true\n end",
"title": ""
},
{
"docid": "62cf3a1d670666f26ab680111b8c8003",
"score": "0.5480132",
"text": "def create\n if current_user\n find_or_create_authentication_for_current_user\n else\n apply_omniauth_to_new_or_existing_user\n end\n end",
"title": ""
},
{
"docid": "cfba694be83117034107c7fffaebf097",
"score": "0.54726315",
"text": "def store_meetup_credentials!(attributes = {})\n self.send(:\"#{self.class.meetup_uid_field}=\", attributes[:uid])\n self.send(:\"#{self.class.meetup_token_field}=\", attributes[:token])\n\n # Confirm without e-mail - if confirmable module is loaded.\n self.skip_confirmation! if self.respond_to?(:skip_confirmation!)\n\n # Only populate +email+ field if it's available (e.g. if +authenticable+ module is used).\n self.email = attributes[:email] || '' if self.respond_to?(:email)\n\n # Lazy hack: These database fields are required if +authenticable+/+confirmable+\n # module(s) is used. Could be avoided with :null => true for authenticatable\n # migration, but keeping this to avoid unnecessary problems.\n self.password_salt = '' if self.respond_to?(:password_salt)\n self.encrypted_password = '' if self.respond_to?(:encrypted_password)\n end",
"title": ""
},
{
"docid": "744637427616975f26a0cb46bc32fade",
"score": "0.5461161",
"text": "def update_devise_user\n inject_into_file 'app/models/user.rb', after: \":validatable\" do <<-'RUBY'\n, :omniauthable\n validates_presence_of :email\n has_many :authorizations\n\n def self.new_with_session(params,session)\n if session[\"devise.user_attributes\"]\n new(session[\"devise.user_attributes\"],without_protection: true) do |user|\n user.attributes = params\n user.valid?\n end\n else\n super\n end\n end\n\n def self.from_omniauth(auth, current_user)\n authorization = Authorization.where(:provider => auth.provider, :uid => auth.uid.to_s, :token => auth.credentials.token, :secret => auth.credentials.secret).first_or_initialize\n if authorization.user.blank?\n user = current_user.nil? ? User.where('email = ?', auth[\"info\"][\"email\"]).first : current_user\n if user.blank?\n user = User.new\n user.password = Devise.friendly_token[0,10]\n user.name = auth.info.name\n user.email = auth.info.email\n auth.provider == \"twitter\" ? user.save(:validate => false) : user.save\n end\n authorization.username = auth.info.nickname\n authorization.user_id = user.id\n authorization.save\n end\n authorization.user\n end\n RUBY\n end\n end",
"title": ""
},
{
"docid": "3d4f195860f52184cd76b7aff0cd0e06",
"score": "0.5459373",
"text": "def set_auth\n @auth = session[:omniauth] if session[:omniauth]\n end",
"title": ""
},
{
"docid": "2528454cd54f7a88ac14c6e7cabd6cf4",
"score": "0.5452816",
"text": "def map_user_attributes(omniauth)\n info = omniauth.info\n raw_info = omniauth.extra.raw_info\n\n self.login = info.nickname\n self.name = info.name || ''\n self.email = info.email || ''\n self.avatar_url = info.image || ''\n\n self.company = raw_info.company\n self.location = raw_info.location\n self.followers = raw_info.followers\n self # return self\n end",
"title": ""
},
{
"docid": "6af80e755f33619069ce590b7fbd3610",
"score": "0.5440643",
"text": "def import_profile_from_twitter\n self.profile.first_name = @credentials['name']\n self.profile.website = @credentials['url']\n self.profile.federated_profile_image_url = @credentials['profile_image_url']\n self.profile.save\n end",
"title": ""
}
] |
fc0e8c6e1996bb5e527e3ac4340dedf0
|
Make sure the path above is relative to this file
|
[
{
"docid": "d43c80a123979edaa9168b2fe341d4ad",
"score": "0.0",
"text": "def absolute_app_path\n File.join(File.dirname(__FILE__), APP_PATH)\nend",
"title": ""
}
] |
[
{
"docid": "3ecd547430623f48487f64a630f24eee",
"score": "0.75067025",
"text": "def relative_path; end",
"title": ""
},
{
"docid": "3ecd547430623f48487f64a630f24eee",
"score": "0.75067025",
"text": "def relative_path; end",
"title": ""
},
{
"docid": "87c5963e39d281760f8b90bc3524b9c1",
"score": "0.7424005",
"text": "def relative\n relative_to(pwd)\n end",
"title": ""
},
{
"docid": "87c5963e39d281760f8b90bc3524b9c1",
"score": "0.7424005",
"text": "def relative\n relative_to(pwd)\n end",
"title": ""
},
{
"docid": "afa113818112d787f4c58a874d3b118c",
"score": "0.7384984",
"text": "def relative_path\n self.file.path.sub(\"#{root}/\", '')\n end",
"title": ""
},
{
"docid": "d5b5b72708729daf552e7f785f4c909f",
"score": "0.7270975",
"text": "def relative_path rel_path\n full_path(File.dirname(__FILE__) + \"/\" + rel_path)\n end",
"title": ""
},
{
"docid": "86d4552d0312ee6be3ca1bff5781e37f",
"score": "0.7269614",
"text": "def require_relative(path)\n if @current_path\n require File.expand_path(path, File.dirname(@current_path))\n else\n super\n end\n end",
"title": ""
},
{
"docid": "f3d09cf5fa6c7452f41838d709320d4d",
"score": "0.7257869",
"text": "def cleaned_relative_path; end",
"title": ""
},
{
"docid": "62900601c8767e1ce11d791088b10f80",
"score": "0.72487056",
"text": "def relative_path\n sanitized_relative_path absolute_path\n end",
"title": ""
},
{
"docid": "31433ce4f64ee876d87e937350f56bad",
"score": "0.7243252",
"text": "def relative_path\n self.source_file ? self.source_file.sub(app.source_dir, '') : nil\n end",
"title": ""
},
{
"docid": "38f8911d8d8edda205c2a2767931705d",
"score": "0.7195761",
"text": "def relative_path\n @relative_path ||= path.sub(\"#{project_path}/\", '')\n end",
"title": ""
},
{
"docid": "086bfad1004d4067df6b740a09622b1c",
"score": "0.71652365",
"text": "def relative(path)\n ::Buildr::Util.relative_path(File.expand_path(path.to_s), self.base_directory)\n end",
"title": ""
},
{
"docid": "e685b38a4060d7a2b74c947b35009378",
"score": "0.7119035",
"text": "def relative_path\n @relative_path ||= expanded_path.relative_path_from(Pathname.new(File.dirname(dependency.berksfile.filepath)))\n end",
"title": ""
},
{
"docid": "80080ff86e0c2519c3945bf79bf37fe4",
"score": "0.71140295",
"text": "def relative_path_from(path, from); end",
"title": ""
},
{
"docid": "80080ff86e0c2519c3945bf79bf37fe4",
"score": "0.71140295",
"text": "def relative_path_from(path, from); end",
"title": ""
},
{
"docid": "5c74c976b81b18a71a067db0d5d0b4d6",
"score": "0.7111237",
"text": "def relative_from(path)\n File.join(relative_from_base(path), @file)\n end",
"title": ""
},
{
"docid": "68a64332845d1cea40661272b0b1b53d",
"score": "0.71060914",
"text": "def make_relative(path)\n\t\t\tHelpers.make_relative(path)\n\t\tend",
"title": ""
},
{
"docid": "67da8ce713af8c4c2317c956dc91e974",
"score": "0.7081738",
"text": "def relative_source_file\n source_file && @relative_source_file ||= Pathname.new(File.expand_path(source_file)).relative_path_from(Pathname.getwd)\n end",
"title": ""
},
{
"docid": "70d38f51b079982e965cdaaddbc3f149",
"score": "0.70675147",
"text": "def relative_to(path)\n File.join(relative_to_base(path), @file)\n end",
"title": ""
},
{
"docid": "58d51582bdb659107ecfa32fb9566514",
"score": "0.7067398",
"text": "def relative_path(path)\n path = File.expand_path(File.dirname(__FILE__) + '/' + path)\n \"'#{path}'\"\nend",
"title": ""
},
{
"docid": "59398d58592b74c7c02a8062475d6e42",
"score": "0.7035949",
"text": "def relative_path()\n join_path(self.relative_dir, self.filename)\n end",
"title": ""
},
{
"docid": "fb8fcdf619445731929752a37123dac1",
"score": "0.70166504",
"text": "def relative_to_file(base_file)\n\t\treturn relative_to(base_file.as_path.parent_dir)\n\tend",
"title": ""
},
{
"docid": "ad48ea36a4e7779826893f820d60a5b1",
"score": "0.701268",
"text": "def to_relative(path)\n \n path = Pathname.new(path)\n base = Pathname.new(@current_path)\n \n # for example /home/jsdoc/css/style.css\n # current: /home/jsdoc/output/Foo/Bar.html\n if not path.absolute?\n # resolve to Configs.output\n path = Pathname.new(Configs.output) + path\n end \n \n Logger.debug \"Relative path '#{path}' from '#{base}'\"\n path.relative_path_from(base).to_s\n end",
"title": ""
},
{
"docid": "1d45bb7f9ae32b31a260ae27ab6759ed",
"score": "0.70040363",
"text": "def relative_path(path)\n path\n end",
"title": ""
},
{
"docid": "8f3944f497e3bcd156c7d26050ae0f3d",
"score": "0.70037216",
"text": "def _relative_path\n Pathname.new(self.path).relative_path_from(Dir.pwd).to_s\n end",
"title": ""
},
{
"docid": "19df400ab8a4e82e5086205a11fa6f24",
"score": "0.6991784",
"text": "def relative_path\n @relative_path ||= path.sub(/\\A#{@site.source}/, '')\n end",
"title": ""
},
{
"docid": "21d8158d9d2946bf5aca868cd3a1179b",
"score": "0.6941724",
"text": "def fix_relative_path(path)\n File.expand_path(path, '/')[File.expand_path('/').length..-1]\n end",
"title": ""
},
{
"docid": "de198219687f27728b71617d73ba34b1",
"score": "0.6930072",
"text": "def relative_file_name; end",
"title": ""
},
{
"docid": "37d0a9b104cfdbbc5fb6e42881c08cf6",
"score": "0.6914414",
"text": "def relative_to_script_path(path)\n path = path.gsub(\"\\\\\", '/')\n unless path == File.expand_path(path)\n path = File.normalize_path(File.join(File.dirname(@script_path), path))\n end\n path\n end",
"title": ""
},
{
"docid": "37d0a9b104cfdbbc5fb6e42881c08cf6",
"score": "0.6914414",
"text": "def relative_to_script_path(path)\n path = path.gsub(\"\\\\\", '/')\n unless path == File.expand_path(path)\n path = File.normalize_path(File.join(File.dirname(@script_path), path))\n end\n path\n end",
"title": ""
},
{
"docid": "2f6733b0493ea8d69949fb166a6d23ba",
"score": "0.69098896",
"text": "def relative_path(filename)\n PathResolver.new.relative_path filename, @document.base_dir\n end",
"title": ""
},
{
"docid": "c5ab75b9d3af56b1c7206ae7cf863bc5",
"score": "0.69047",
"text": "def relative_path_of file, dir\n file.relative_path_from(dir)\n end",
"title": ""
},
{
"docid": "847812a2eaece57e190b0104536d93d2",
"score": "0.68903",
"text": "def relative!(path)\n unwilded = path.unwild\n \n new_path = if Path.platformCaseSensitive?\n raise \"Relative transform failed: Path #{self} has no common base with path #{unwilded}\" if !(literal() =~ /#{Regexp.escape(unwilded.literal)}/)\n literal().gsub(/#{Regexp.escape(unwilded.literal)}\\/?/, '')\n else\n raise \"Relative transform failed: Path #{self} has no common base with path #{unwilded}\" if !(literal() =~ /#{Regexp.escape(unwilded.literal)}/i)\n literal().gsub(/#{Regexp.escape(unwilded.literal)}\\/?/i, '')\n end\n \n if new_path.empty?\n if file?\n new_path = self\n else\n new_path = '.'\n end\n end\n\n self.path = Path.new(new_path, directory?)\n end",
"title": ""
},
{
"docid": "b0a32fdc278b45bad39456121788ddbf",
"score": "0.68901473",
"text": "def relative_source_path(path, src_base = source_root)\n File.expand_path(path).gsub(File.expand_path(src_base) + '/', '')\n end",
"title": ""
},
{
"docid": "542793be15ac68d978fe3d469f94b12e",
"score": "0.68820024",
"text": "def relative_path\n path.empty? ? self.name : File.join(\"#{self.path}\", \"#{self.name}\")\n end",
"title": ""
},
{
"docid": "466e7cdcc6656c6ad0a5c4291e3876ef",
"score": "0.6864873",
"text": "def relative_path\n @relative_path ||= absolute_path.sub(/^#{Bookshelf::local_folder}\\/?/,'')\n end",
"title": ""
},
{
"docid": "c9543dbdf88480077eecd63320bd195e",
"score": "0.68592036",
"text": "def relative_path(from, to); end",
"title": ""
},
{
"docid": "1430e1be9ab75593937ef3a5a51e9066",
"score": "0.6842641",
"text": "def make_path_relative(path)\n if !File.exist?(path)\n path\n elsif (root_path = find_base_path_for(path))\n Pathname.new(path).relative_path_from(root_path).to_s\n else\n path\n end\n end",
"title": ""
},
{
"docid": "c12640b8631d791ee7082d55e79c496e",
"score": "0.6831876",
"text": "def _relative_path_for(path, root)\n relative = _normalize(Pathname.new(path)).relative_path_from(root).to_s\n relative.gsub!(\"\\\\\", \"/\") if Gem.win_platform?\n\n if relative.start_with?(\"../\")\n raise Thor::Error.new(\"#{path} is not in #{options[:root] || 'the current directory'}\")\n end\n\n relative\n end",
"title": ""
},
{
"docid": "54d8138f60917607fe0aab49d9941360",
"score": "0.6814684",
"text": "def relative?(path)\n Aruba.platform.relative_path?(path)\n end",
"title": ""
},
{
"docid": "e0ee6280311312b05b4fb9fc5f38014a",
"score": "0.6809814",
"text": "def rel_path(path)\n Pathname(path).expand_path.relative_path_from(Pathname(Dir.pwd))\n end",
"title": ""
},
{
"docid": "e0ee6280311312b05b4fb9fc5f38014a",
"score": "0.6809814",
"text": "def rel_path(path)\n Pathname(path).expand_path.relative_path_from(Pathname(Dir.pwd))\n end",
"title": ""
},
{
"docid": "58d2725af77c9cef8ec7292a659d05c3",
"score": "0.6806395",
"text": "def relative_path?(path); end",
"title": ""
},
{
"docid": "58d2725af77c9cef8ec7292a659d05c3",
"score": "0.6806395",
"text": "def relative_path?(path); end",
"title": ""
},
{
"docid": "7bcea3f0e36e3b1d6fbf866eb2e23039",
"score": "0.68041825",
"text": "def relative_path(path)\n\t\t\tcurrent_hierarchy = Quarto::Generator.current_output_file_path\n\t\t\tunless current_hierarchy.is_a?(String)\n\t\t\t\traise \"Expected Quarto::Generator.current_output_file_path to be a String, but got #{current_hierarchy.inspect}\"\n\t\t\tend\n\t\t\tcurrent_hierarchy = current_hierarchy.split('/')\n\t\t\tcurrent_hierarchy.pop # remove the filename\n\t\t\ttarget_hierarchy = path.split('/')\n\t\t\twhile current_hierarchy[0] == target_hierarchy[0]\n\t\t\t\tcurrent_hierarchy.shift\n\t\t\t\ttarget_hierarchy.shift\n\t\t\tend\n\t\t\trel_path = current_hierarchy.inject('') do |result, dir|\n\t\t\t\tresult + '../'\n\t\t\tend\n\t\t\trel_path << target_hierarchy.join('/')\n\t\tend",
"title": ""
},
{
"docid": "aba820c5b9e7ea47163933d3cb2dd518",
"score": "0.6795209",
"text": "def relative_to_srcroot(path)\n path.relative_path_from(client_root).to_s\n end",
"title": ""
},
{
"docid": "7d004e3cb45f24297b23059554355169",
"score": "0.6762447",
"text": "def relative_source_path\n Pathname.new(@source).relative_path_from(Pathname.new(@manifest.dir))\n end",
"title": ""
},
{
"docid": "c063b8b23484e5dbaaa7d556449420f3",
"score": "0.6755696",
"text": "def relative_to_root(path = nil, check_exist = false)\n if path\n root_path = File.join(root, path)\n else\n root_path = root\n end\n \n # Check for file existance\n if check_exist and !File.exist?(root_path)\n raise <<-EOS\n \n File not found: #{File.expand_path(root_path)}\n \n This is loaded for the capitate plugin. View the README in:\n #{File.expand_path(File.dirname(__FILE__) + \"/../doc/README\")}\n EOS\n end\n \n root_path\n end",
"title": ""
},
{
"docid": "7819da4851ec01346c734dd8f0e4a9b0",
"score": "0.67540836",
"text": "def relative_path_to(file)\n file = Pathname.new(file)\n pwd = file.absolute? ? Dir.pwd : \".\"\n file.relative_path_from(Pathname.new(pwd))\n end",
"title": ""
},
{
"docid": "e429123d2285997a0db4b9f77ca9d0bb",
"score": "0.6750984",
"text": "def relative_write_path\n sanitized_relative_path write_path\n end",
"title": ""
},
{
"docid": "e1608310a0250ed3ba8eaee78dc8418b",
"score": "0.67344093",
"text": "def path!\n return @path unless @path.nil?\n rel = relative_path or abort( usage )\n find_in_load_path(rel) or abort(\"no script found: file #{rel.to_s.inspect} is not in path.\")\n end",
"title": ""
},
{
"docid": "d5bcacba0c068d3d92f3e755e30a1671",
"score": "0.67280966",
"text": "def relative_to_base(filename)\n base_dir = File.dirname(__FILE__)\n File.join(base_dir, \"..\", filename)\nend",
"title": ""
},
{
"docid": "fe49ef5a48ab589aef58c152ce9d15d8",
"score": "0.6714377",
"text": "def relative_to_srcroot(path)\n path.relative_path_from(user_project_path.dirname).to_s\n end",
"title": ""
},
{
"docid": "2acf9ab790913357b4d532a60242ff4b",
"score": "0.67123747",
"text": "def abs_path(relative_path)\n File.expand_path(relative_path, __FILE__)\nend",
"title": ""
},
{
"docid": "247bfd1b2319b23e5d23907745dfe95e",
"score": "0.67084384",
"text": "def relative_dir\n @relative_dir ||= dir.sub(\"#{project_path}/\", '')\n end",
"title": ""
},
{
"docid": "39470e2ba8d5204e0f2e6e4077e06ae4",
"score": "0.66771185",
"text": "def relpath(path)\n File.expand_path(path.to_s, File.dirname(__FILE__))\nend",
"title": ""
},
{
"docid": "f29647c6f1a7720ed07d7a1b1eb403ba",
"score": "0.6666293",
"text": "def relative_path(resource_path)\n File.join(File.dirname(File.expand_path(__FILE__)), resource_path)\nend",
"title": ""
},
{
"docid": "b21be1ed5376a81b9c8438332b8ab92a",
"score": "0.6663689",
"text": "def relative_to_original_destination_root(path, remove_dot = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "0a1fa8fc35429895c3e78db86057f06c",
"score": "0.6656906",
"text": "def relative?\n @relative ? true : false\n end",
"title": ""
},
{
"docid": "6f0f9b680c67fa536d248350cc44d7ed",
"score": "0.66459095",
"text": "def relative_path\n if self.configured?\n \".\"\n else\n self.path[(self.configured_ancestor.path.length + 1)..-1]\n end\n end",
"title": ""
},
{
"docid": "0d4ddd31898735b5255ceaaa093d03c9",
"score": "0.6644584",
"text": "def calculate_relative_source(file)\n return nil if file.nil?\n\n file = Pathname.new(file)\n tempdir = Pathname.new(RSpec.configuration.onceover_tempdir)\n root = Pathname.new(RSpec.configuration.onceover_root)\n environmentpath = Pathname.new(RSpec.configuration.onceover_environmentpath)\n\n # Calculate the full relative path\n file.relative_path_from(tempdir + environmentpath + \"production\").to_s\n end",
"title": ""
},
{
"docid": "ab05ac53b175f00f86dbbcb87140fdb2",
"score": "0.66224307",
"text": "def absolute_path\n @absolute_path ||= site.in_source_dir(relative_path)\n end",
"title": ""
},
{
"docid": "07b3ba588ff6a73d93420c1dafd73fa9",
"score": "0.66018534",
"text": "def relative_from_base(path)\n Pathname.new(@from_base).relative_path_from(Pathname.new(path)).to_s\n end",
"title": ""
},
{
"docid": "04a260762a6a6442de7809a3287b292f",
"score": "0.66010886",
"text": "def assert_no_file(relative); end",
"title": ""
},
{
"docid": "7340fe8d676414dedf439ea0003228e4",
"score": "0.65815127",
"text": "def relative_require path\n realpath = Pathname.new(__FILE__).realpath #follow symlink\n require File.expand_path(\"../#{path}\", realpath)\nend",
"title": ""
},
{
"docid": "6f64e6294f06cd9cc722f44288381520",
"score": "0.657897",
"text": "def assert_no_directory(relative); end",
"title": ""
},
{
"docid": "60610a57f2b806144c19d2a5b093bf4b",
"score": "0.6570044",
"text": "def explicit_relative(path)\n # Paths that do not start with \"/\", \"./\", or \"../\" will be prefixed with ./\n path.sub(%r(^(?!\\.{0,2}/)), './')\n end",
"title": ""
},
{
"docid": "c6cd2d7864b10ce6c5d894631dccd0c3",
"score": "0.65664876",
"text": "def relative_path\n @path.relative_path_from(@staged_dir).to_s\n end",
"title": ""
},
{
"docid": "114d79b1afa91e38e27cf1bfce9b6a46",
"score": "0.65614796",
"text": "def relative_dir\n dir_path.gsub(@root_dir, '')\n end",
"title": ""
},
{
"docid": "a9278718d3fa8393520190048c8ac2b9",
"score": "0.65578467",
"text": "def safe_relative_path\n FAT32.safepath @relative_path\n end",
"title": ""
},
{
"docid": "4d331a9453a0e32e496bebd1d92ec123",
"score": "0.65560657",
"text": "def relative_path\n relativePath = File.join(@dir, @name)\n relativePath\n end",
"title": ""
},
{
"docid": "49e71056a00d8e0d3765c2837d4b8ea4",
"score": "0.65509343",
"text": "def relative_path\n File.join(*[@dir, @name].map(&:to_s).reject(&:empty?))\n end",
"title": ""
},
{
"docid": "7ecdcc1ebb324651aad9fc60d6a07e1f",
"score": "0.65396124",
"text": "def relative_to_base(path)\n path = path.dup\n regexp = \"\\\\A#{Regexp.quote directory}(#{File::SEPARATOR}|\\\\z)\"\n if path.respond_to?(:force_encoding)\n path.force_encoding(\"BINARY\")\n regexp.force_encoding(\"BINARY\")\n end\n if path.sub!(Regexp.new(regexp), '')\n path\n end\n end",
"title": ""
},
{
"docid": "0f5b7963a3f843f5c567e1b46b8f99ac",
"score": "0.65385664",
"text": "def path\n relative_path\n end",
"title": ""
},
{
"docid": "00476744b96b39d201ee0ff32844a118",
"score": "0.6535802",
"text": "def relative_path(pathname)\n pwd = Pathname.new('.').realpath\n pathname.file_ref.real_path.relative_path_from(pwd)\nend",
"title": ""
},
{
"docid": "2f3bb47c5f352d79e60be6593b6f3b74",
"score": "0.653504",
"text": "def relative_path_of path\n if @root === nil\n @root = File.expand_path('.')\n end\n if path.start_with?('./')\n path[2..-1] \n else\n path.sub(/^#{@root}\\//, '')\n end\n end",
"title": ""
},
{
"docid": "fe20cc1fb1e5cd663243d9be1430cb6d",
"score": "0.6532637",
"text": "def relative_path rel_path\n Chef::Recipe::ZZDeploy.env.relative_path(rel_path)\n end",
"title": ""
},
{
"docid": "68f0f9319ec1aed3f822e009b3053224",
"score": "0.6526988",
"text": "def relative_path\n @relative_path ||= path.gsub %r{^#{directory}},\n directory.split('/').last\n end",
"title": ""
},
{
"docid": "0ab4c5fe9e236ac06395384df2796096",
"score": "0.6514326",
"text": "def relative(path)\n if path.relative?\n path\n else\n path.relative_path_from(Pathname.new(\"/\"))\n end\n end",
"title": ""
},
{
"docid": "50ffac2d50c13eaf0085ac739589663d",
"score": "0.65126413",
"text": "def relative\n @relative ||= get_relative\n end",
"title": ""
},
{
"docid": "d41b840ef4db24e5c1c696356500ed15",
"score": "0.6509762",
"text": "def relative_path_from(from)\n from = self.class.new(from).expand_path.gsub(%r!/$!, \"\")\n self.class.new(expand_path.gsub(%r!^#{\n from.regexp_escape\n }/!, \"\"))\n end",
"title": ""
},
{
"docid": "84a600acd484a6ac06d5774650ca71fd",
"score": "0.65073276",
"text": "def relative_to_base(path)\n Pathname.new(@to_base).relative_path_from(Pathname.new(path)).to_s\n end",
"title": ""
},
{
"docid": "7fabe9a631b980470ff9fd30809054dd",
"score": "0.64970237",
"text": "def relative_path(options = {})\n File.join(self.site.layout_dir(options), sanitize_filename(self.name))\n end",
"title": ""
},
{
"docid": "e05c2387192ec9ceb6f64bf0ba971bac",
"score": "0.6496958",
"text": "def require_relative_to(path)\n former_prefix = RequireResource.path_prefix\n RequireResource.path_prefix = path\n yield\n RequireResource.path_prefix = former_prefix\n end",
"title": ""
},
{
"docid": "4c46c87ead4b42b5dda43f3f0e7d744d",
"score": "0.649478",
"text": "def relative_path_to(path, relative_to = nil)\n if relative_to\n path = File.expand_path(\n # symlink, e.g. \"../../../../grid5000/environments/etch-x64-base-1.0.json\"\n path,\n # e.g. : File.join(\"/\", File.dirname(\"grid5000/sites/rennes/environments/etch-x64-base-1.0\"))\n File.join('/', File.dirname(relative_to))\n ).gsub(/^\\//, \"\")\n end\n path\n end",
"title": ""
},
{
"docid": "008daa72709bae2bc4fa380c25bd5f99",
"score": "0.64905185",
"text": "def absolute_path(relative_path, path_of_file)\r\n File.join(File.expand_path(File.dirname(path_of_file)), relative_path)\r\n end",
"title": ""
},
{
"docid": "9ca073621046b1f571f1c68dbf703cbf",
"score": "0.648698",
"text": "def relative?(path)\n expand(path).rindex(@path_root, 0) == 0\n end",
"title": ""
},
{
"docid": "6298990aed2cc489e302388ee3b0b349",
"score": "0.6450138",
"text": "def relative_path(f)\n\tPathname(f).relative_path_from(Pathname(\"..\"))\nend",
"title": ""
},
{
"docid": "193b965c0c263c8bf60e57e304573588",
"score": "0.6448677",
"text": "def require_relative(x)\nend",
"title": ""
},
{
"docid": "239f666345e75b92b6fee534954fa403",
"score": "0.6448326",
"text": "def __source_path\n File.join(__source_root, @file)\n end",
"title": ""
},
{
"docid": "f910a2c14be61c379906670b26daad53",
"score": "0.6438578",
"text": "def relative(base, path)\n dir = base.rindex(\"/\") ? base[0..base.rindex(\"/\")] : \"\"\n no_slash(path[dir.length..-1])\nend",
"title": ""
},
{
"docid": "a40a56a224f107836a18fc9d1b98298e",
"score": "0.6430403",
"text": "def construct_path_upwards(sub_file, path)\n sub_file ? \"../#{path}\" : path\n end",
"title": ""
},
{
"docid": "008add0f77056150f77b6eb88180f42c",
"score": "0.6416548",
"text": "def build_absolute_path(relative_path)\n \"#{File.expand_path('.')}/#{relative_path}\"\nend",
"title": ""
},
{
"docid": "27c9f6f98f616fe61e0df9fd3537163e",
"score": "0.64159524",
"text": "def _(relative) \n File.expand_path(\"../#{relative}\", __FILE__)\nend",
"title": ""
},
{
"docid": "fab1896f0ce62699433471330e336fc2",
"score": "0.6415791",
"text": "def relative_path\n current_dir = Pathname.new(File.expand_path(\"./\"))\n Pathname.new(path).relative_path_from(current_dir).to_s\n end",
"title": ""
},
{
"docid": "2163dd4d8660db75abf7194ee5f56c24",
"score": "0.641214",
"text": "def relative_to(source_input)\n other_path = if source_input.respond_to?(:path)\n ::File.dirname(source_input.path)\n elsif source_input.respond_to?(:working_directory)\n source_input.working_directory\n end\n\n return path unless other_path\n other_path ? relative_path(other_path, path) : path\n end",
"title": ""
},
{
"docid": "70d84575a4f71af12dc5c8a3326c6124",
"score": "0.640754",
"text": "def relative(*path)\n Pathname.new(source).join(*(['..', path].flatten)).expand_path\n end",
"title": ""
},
{
"docid": "da86dcf7bd559ef8c77bcec81a11783a",
"score": "0.6407348",
"text": "def absolute_path?; end",
"title": ""
},
{
"docid": "da86dcf7bd559ef8c77bcec81a11783a",
"score": "0.6407348",
"text": "def absolute_path?; end",
"title": ""
},
{
"docid": "5c3137917d978ddb0c4f7e6b715c8222",
"score": "0.6404404",
"text": "def relative_path_from(entry)\n path.relative_path_from(entry.path)\n end",
"title": ""
},
{
"docid": "472189e05e0582a515ec70c34ed47aef",
"score": "0.63936186",
"text": "def relative_path\n calculation_directory\n end",
"title": ""
}
] |
ae3e2832649b1a4e8cda63dac2d2bf7e
|
GET /punches/new GET /punches/new.xml
|
[
{
"docid": "8c7e82d9fe724a66b50a721d3e648e8f",
"score": "0.6807124",
"text": "def new\n @punch = Punch.new\n @users = User.all # for sidebar\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @punch }\n end\n end",
"title": ""
}
] |
[
{
"docid": "dc4127ed9796ebfa1e60ed1fd63f0c7f",
"score": "0.733609",
"text": "def new\n @punch = Punch.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @punch }\n end\n end",
"title": ""
},
{
"docid": "dc4127ed9796ebfa1e60ed1fd63f0c7f",
"score": "0.733609",
"text": "def new\n @punch = Punch.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @punch }\n end\n end",
"title": ""
},
{
"docid": "fe3504abefec88d19f2475ee82b4eb1e",
"score": "0.70622873",
"text": "def new\n @punchlist = Punchlist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @punchlist }\n end\n end",
"title": ""
},
{
"docid": "c27d026ad4b18fb4abccf0f7e08289e9",
"score": "0.69699615",
"text": "def new\n @lunch = Lunch.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lunch }\n end\n end",
"title": ""
},
{
"docid": "e689e42d741a6d7781ba9187556c49b5",
"score": "0.6752065",
"text": "def create\n @punch = Punch.new(params[:punch])\n\n respond_to do |format|\n if @punch.parse_and_save\n format.html { redirect_to(punches_path, :notice => 'Punch was successfully created.') }\n format.xml { render :xml => @punch, :status => :created, :location => @punch }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @punch.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d40117d0177bd63445e3e8b338307ad1",
"score": "0.6720735",
"text": "def new\n @user = User.find(session[:user_id])\n @punch = @user.punches.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @punch }\n end\n end",
"title": ""
},
{
"docid": "0488c70342af2b8c50db34355d5bbb4c",
"score": "0.6616498",
"text": "def new\n @given_lunch = GivenLunch.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @given_lunch }\n end\n end",
"title": ""
},
{
"docid": "d12a08c1d9e56fce4dc03013f67fd684",
"score": "0.6596589",
"text": "def create\n @punch = Punch.new(params[:punch])\n @punch.created_by = current_user\n\n respond_to do |format|\n if @punch.parse_and_save\n format.html { redirect_to(punches_path, :notice => 'Punch was successfully created.') }\n format.xml { render :xml => @punch, :status => :created, :location => @punch }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @punch.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a784ed04026098ac524f17e20e55d36",
"score": "0.6575582",
"text": "def new\n @lunch_list = LunchList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lunch_list }\n end\n end",
"title": ""
},
{
"docid": "57eefff5156a51fa54dd1f36199a2c53",
"score": "0.6384427",
"text": "def new\n @pist = Pist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pist }\n end\n end",
"title": ""
},
{
"docid": "2a129ff0bdb98a111dbb35c77da05bea",
"score": "0.6382921",
"text": "def new\n @prcess = Prcess.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @prcess }\n end\n end",
"title": ""
},
{
"docid": "665b124cad89cb49b4f2017a69ba3615",
"score": "0.63724583",
"text": "def new\n @push = Push.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @push }\n end\n end",
"title": ""
},
{
"docid": "051d807e4168b93883876c2232b8a9b6",
"score": "0.6366309",
"text": "def new\n @actions = [:new_pm]\n @pm = Pm.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pm }\n end\n end",
"title": ""
},
{
"docid": "31c35aa4cee2839afc75efbd34be448d",
"score": "0.63470715",
"text": "def new\n @pig = Pig.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pig }\n end\n end",
"title": ""
},
{
"docid": "ac20913762b48c04d8ed4fd223cc03cf",
"score": "0.6340888",
"text": "def new\n @topping = Topping.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @topping }\n end\n end",
"title": ""
},
{
"docid": "c08adeb0fba08eec2b5113a250f7e232",
"score": "0.6326023",
"text": "def new\n @petrol_pump = PetrolPump.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @petrol_pump }\n end\n end",
"title": ""
},
{
"docid": "ef65b13916bd5acbc69113e86adc8a77",
"score": "0.63193893",
"text": "def new\n @present = Present.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @present }\n end\n end",
"title": ""
},
{
"docid": "0bd4331b9e8f6ac73d97b43261a0358e",
"score": "0.63148695",
"text": "def new\n @pickup = Pickup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pickup }\n end\n end",
"title": ""
},
{
"docid": "91b7328d26a640c79dec3427099aa7cf",
"score": "0.63084567",
"text": "def new\n @press = Press.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @press }\n end\n end",
"title": ""
},
{
"docid": "7a1190f62fb618719c3db52da9c85676",
"score": "0.62972033",
"text": "def new\n @lunch = Lunch.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lunch }\n end\n end",
"title": ""
},
{
"docid": "a63d27ca98208e938ac4d48e8db672ee",
"score": "0.62952423",
"text": "def new\n @sprint = Sprint.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @sprint }\n end\n end",
"title": ""
},
{
"docid": "343a4a7a95d5f750468c85ac54c3a1fd",
"score": "0.62667584",
"text": "def new\n @platoon = Platoon.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @platoon }\n end\n end",
"title": ""
},
{
"docid": "d59d214ef2cb7e922f225e634ffa9f0e",
"score": "0.6263668",
"text": "def new\n @prac = Prac.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @prac }\n end\n end",
"title": ""
},
{
"docid": "ed6096dfc35220e6f44c66a5d336d3d2",
"score": "0.6256494",
"text": "def new\n @presence = Presence.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @presence }\n end\n end",
"title": ""
},
{
"docid": "2de154328a89238f2257933b4d743a33",
"score": "0.62445706",
"text": "def new\n # Allow all RSVPS, but waitlist\n @rsvp = Rsvp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @rsvp }\n end\n end",
"title": ""
},
{
"docid": "9b3609fadd7b03f71b05a9285fa2f03a",
"score": "0.6239473",
"text": "def new\n @pomodoro = Pomodoro.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pomodoro }\n end\n end",
"title": ""
},
{
"docid": "102e3ccb08b516baf553481ad6361309",
"score": "0.6231936",
"text": "def new\n @pastproject = Pastproject.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pastproject }\n end\n end",
"title": ""
},
{
"docid": "c9c3c28fed6ff0488e0ebc18beb25865",
"score": "0.62271965",
"text": "def new\n @pii = Pii.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pii }\n end\n end",
"title": ""
},
{
"docid": "e0887668e7a63a1595f1c1dad7c82e36",
"score": "0.6227159",
"text": "def new\n @launch_member = LaunchMember.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @launch_member }\n end\n end",
"title": ""
},
{
"docid": "94ceaaf9250cdc3d062aeb18bbab1a52",
"score": "0.6223517",
"text": "def new\n @newstuff = Newstuff.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @newstuff }\n end\n end",
"title": ""
},
{
"docid": "97fa96433f07d7afb7fb8572043e8be0",
"score": "0.6222877",
"text": "def new\n @prereg = Prereg.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @prereg }\n end\n end",
"title": ""
},
{
"docid": "29a0216090e885cc33726563c22fbc06",
"score": "0.6220911",
"text": "def new\n @ptschedule = Ptschedule.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ptschedule }\n end\n end",
"title": ""
},
{
"docid": "e490bfd98725abd73ac4210fcaf61dae",
"score": "0.6207328",
"text": "def new\n @appt_request = ApptRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @appt_request }\n end\n end",
"title": ""
},
{
"docid": "1cb4beae4b85af05dfbb33e756b46b0c",
"score": "0.62026167",
"text": "def new\n @poet = Poet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @poet }\n end\n end",
"title": ""
},
{
"docid": "d8f4aa688988b925fa15d89090e11c03",
"score": "0.6201762",
"text": "def new\n @presencelist = Presencelist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @presencelist }\n end\n end",
"title": ""
},
{
"docid": "f6809931a2ffdba072bc62b8aefe43b8",
"score": "0.6197099",
"text": "def new\n @punch_type = PunchType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @punch_type }\n end\n end",
"title": ""
},
{
"docid": "2f550ad824c54b6b03d96796842aa20b",
"score": "0.6192433",
"text": "def new\n @prospect = Prospect.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @prospect }\n end\n end",
"title": ""
},
{
"docid": "41433d74e36719684775ad2d50c3eabe",
"score": "0.6191399",
"text": "def new\n @new = New.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @new }\n end\n end",
"title": ""
},
{
"docid": "483594b6c505d0f0bf8781b8d2e84d2d",
"score": "0.6182514",
"text": "def new\n @xp = Xp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @xp }\n end\n end",
"title": ""
},
{
"docid": "4b0de6e07b8dc59ebf6b3d2607ed028f",
"score": "0.61688626",
"text": "def new\n @percipitation = Percipitation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @percipitation }\n end\n end",
"title": ""
},
{
"docid": "3cc479fe95fda2ad3e508551f9c1dbb3",
"score": "0.61653847",
"text": "def new\n @project = Project.new\n\n puts \"new\"\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @project }\n end\n end",
"title": ""
},
{
"docid": "c20f98ed08bbaaf44f97e264d7734eb2",
"score": "0.6163918",
"text": "def new\n @launch = Launch.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @launch }\n end\n end",
"title": ""
},
{
"docid": "4b4061b723e010b557cda4f31ec9b071",
"score": "0.6157142",
"text": "def new\n @prog = Prog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @prog }\n end\n end",
"title": ""
},
{
"docid": "64619514f8a29398e5fd0003237c553e",
"score": "0.6154906",
"text": "def new\n @pest = Pest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pest }\n end\n end",
"title": ""
},
{
"docid": "445577ae87481e47609c3a830ab6ffdb",
"score": "0.615129",
"text": "def new\n @iteration = Iteration.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @iteration }\n end\n end",
"title": ""
},
{
"docid": "445577ae87481e47609c3a830ab6ffdb",
"score": "0.615129",
"text": "def new\n @iteration = Iteration.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @iteration }\n end\n end",
"title": ""
},
{
"docid": "445577ae87481e47609c3a830ab6ffdb",
"score": "0.615129",
"text": "def new\n @iteration = Iteration.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @iteration }\n end\n end",
"title": ""
},
{
"docid": "4bf6b77a1cba1af501816c7aa25a7755",
"score": "0.6142812",
"text": "def new\r\n @statp = Statp.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.xml { render :xml => @statp }\r\n end\r\n end",
"title": ""
},
{
"docid": "d364e92db1692a7f0e8dc70d5b0079ea",
"score": "0.6138919",
"text": "def new\n @version = @page.versions.new\n\n respond_to do |format|a\n format.html # new.html.erb\n format.xml { render :xml => @version }\n end\n end",
"title": ""
},
{
"docid": "ce6f6c158743b6374903f2dd6af0239d",
"score": "0.6129978",
"text": "def new\n @prof = Prof.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @prof }\n end\n end",
"title": ""
},
{
"docid": "6e1429bf6317df36cbfd2636aba6a602",
"score": "0.6125621",
"text": "def new\n @startup = Startup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @startup }\n end\n end",
"title": ""
},
{
"docid": "6e1429bf6317df36cbfd2636aba6a602",
"score": "0.6125621",
"text": "def new\n @startup = Startup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @startup }\n end\n end",
"title": ""
},
{
"docid": "35ead3e025df8a616668b6a55b092594",
"score": "0.6121655",
"text": "def new\n @sleep = Sleep.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @sleep }\n end\n end",
"title": ""
},
{
"docid": "0b50328f96ba4e509675d88d4a94c38a",
"score": "0.6110342",
"text": "def new\n @piece = Piece.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @piece }\n end\n end",
"title": ""
},
{
"docid": "d44d61cb80158f9e832fe8c599cb4b85",
"score": "0.6104698",
"text": "def new\n @hours = Hours.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @hours }\n end\n end",
"title": ""
},
{
"docid": "9e3fadf1fc941e200f58d40d8c699f77",
"score": "0.6099709",
"text": "def new\n @creation = Creation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @creation }\n end\n end",
"title": ""
},
{
"docid": "550f6f2befaf14241f57176ad4cab6fd",
"score": "0.60810125",
"text": "def new\n @population = Population.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @population }\n end\n end",
"title": ""
},
{
"docid": "1080ee712cd174c5440b5843d66c31e1",
"score": "0.6075661",
"text": "def new\n @recent = Recent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @recent }\n end\n end",
"title": ""
},
{
"docid": "fb8235dd3b4beea3a741d5d69716b996",
"score": "0.607066",
"text": "def new\n\t\t@puppy = Puppy.new\n\t\trespond_with @puppy\n\tend",
"title": ""
},
{
"docid": "28147dcaef4907fc13fb0aa79d9c496d",
"score": "0.60695267",
"text": "def new\n @push = Push.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @push }\n end\n end",
"title": ""
},
{
"docid": "13e8eb522a10761edf3e8ca3adf140cb",
"score": "0.6067084",
"text": "def new\n @papier = Papier.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @papier }\n end\n end",
"title": ""
},
{
"docid": "04fc9e2391d9dc27aebc0db1a4c644dc",
"score": "0.6062442",
"text": "def new\n @upcoming_task = UpcomingTask.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @upcoming_task }\n end\n end",
"title": ""
},
{
"docid": "229f80bacd5225656a7cc3dace061dce",
"score": "0.606049",
"text": "def new\n @printing = Printing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @printing }\n end\n end",
"title": ""
},
{
"docid": "e9ebd784afa1d50d1dcb0c9f7148b810",
"score": "0.60594565",
"text": "def new\n @parm = Parm.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @parm }\n end\n end",
"title": ""
},
{
"docid": "16b9569dda70acebb63f5bd8a1a2b09a",
"score": "0.6056759",
"text": "def new_rest\n @page_usage = PageUsage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page_usage }\n end\n end",
"title": ""
},
{
"docid": "36f967b1e6a890f2f84a5ecbf3b182e1",
"score": "0.6056382",
"text": "def create\n @lunch = Lunch.new(params[:lunch])\n\n respond_to do |format|\n if @lunch.save\n flash[:notice] = 'Lunch was successfully created.'\n format.html { redirect_to(@lunch) }\n format.xml { render :xml => @lunch, :status => :created, :location => @lunch }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @lunch.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3744f2f70d492c42f8f37fb443f944da",
"score": "0.6054876",
"text": "def new\n @week = Week.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @week }\n end\n end",
"title": ""
},
{
"docid": "778b31c739158e7b6a65b4ca90592ac1",
"score": "0.60540944",
"text": "def new\n @meetup = Meetup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @meetup }\n end\n end",
"title": ""
},
{
"docid": "2ab88f38db87685575954ee3d9c59508",
"score": "0.60504293",
"text": "def new\n @test_prog = TestProg.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @test_prog }\n end\n end",
"title": ""
},
{
"docid": "dcd128bd19731c78901e1cee41681295",
"score": "0.60486037",
"text": "def new\n @petsitter = Petsitter.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @petsitter }\n end\n end",
"title": ""
},
{
"docid": "388a6be14063cf194670db5cb13a470c",
"score": "0.6044252",
"text": "def new\n @instants = Instants.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @instants }\n end\n end",
"title": ""
},
{
"docid": "06855f2f9c4860429dd5bc9996d30645",
"score": "0.6042467",
"text": "def new\n @waitlist = Waitlist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @waitlist }\n end\n end",
"title": ""
},
{
"docid": "a3405258e82fcc93119147f4291c6794",
"score": "0.60423243",
"text": "def new\n @poll = @p.polls.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @poll }\n end\n end",
"title": ""
},
{
"docid": "908c5a72ed13dbfb6fbaff6794d95fd4",
"score": "0.60386544",
"text": "def new\n @cup = Cup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @cup }\n end\n end",
"title": ""
},
{
"docid": "73862256a7f6c7ce259b55b6c4a3686c",
"score": "0.6037138",
"text": "def new\n @rsvp = Rsvp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rsvp }\n end\n end",
"title": ""
},
{
"docid": "73862256a7f6c7ce259b55b6c4a3686c",
"score": "0.6037138",
"text": "def new\n @rsvp = Rsvp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rsvp }\n end\n end",
"title": ""
},
{
"docid": "73862256a7f6c7ce259b55b6c4a3686c",
"score": "0.6037138",
"text": "def new\n @rsvp = Rsvp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rsvp }\n end\n end",
"title": ""
},
{
"docid": "04b5cde52317a6583144bbd38f2783b8",
"score": "0.6034063",
"text": "def new\n @picking = Picking.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @picking }\n end\n end",
"title": ""
},
{
"docid": "9231114b74f6a5a4f7d3e3221b80941b",
"score": "0.6030595",
"text": "def new\n val = Digest::SHA2.hexdigest(Time.now.utc.to_s)\n @trip = Trip.new(:sum => val.slice(0..9))\n @title = \"New Trip\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @trip }\n end\n end",
"title": ""
},
{
"docid": "b84e3ec89af25e8b149f15f50778349f",
"score": "0.602905",
"text": "def new\n @presentation = Presentation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @presentation }\n end\n end",
"title": ""
},
{
"docid": "26c34df60dfa293a958854d09a4a98c7",
"score": "0.6026478",
"text": "def index\n @lunches = Lunch.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @lunches }\n end\n end",
"title": ""
},
{
"docid": "a351d6e3879b3fcff89ba84bd35d45b8",
"score": "0.6026342",
"text": "def new\n @pms = Pms.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pms }\n end\n end",
"title": ""
},
{
"docid": "658a05c960692b73a8dcf4dcbbf95027",
"score": "0.60231227",
"text": "def new\n @planet_feed = PlanetFeed.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @planet_feed }\n end\n end",
"title": ""
},
{
"docid": "a7fd19405479ccc4b63cec221612fad4",
"score": "0.6021957",
"text": "def new\n @pg = Pg.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pg }\n end\n end",
"title": ""
},
{
"docid": "5da16b2c91298b65822f602999d1754d",
"score": "0.6020221",
"text": "def new_stories\n get('/newstories.json')\n end",
"title": ""
},
{
"docid": "d58396388a72fedf1868da4b44d26093",
"score": "0.60198253",
"text": "def new\n @press_item = PressItem.new\n\n respond_to do |wants|\n wants.html # new.html.erb\n wants.xml { render :xml => @press_item }\n end\n end",
"title": ""
},
{
"docid": "b3000d16fe27f2d42cb8c17bfaeb05cf",
"score": "0.60190713",
"text": "def new\n @pizza = Pizza.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pizza }\n end\n end",
"title": ""
},
{
"docid": "54a2c59e44909004a0cf47f2e71be3f0",
"score": "0.6018041",
"text": "def new\n @cheat = Cheat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @cheat }\n end\n end",
"title": ""
},
{
"docid": "a10e9b71f0c971635d8c3023cd8218c2",
"score": "0.60174",
"text": "def new\n @puppy = Puppy.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @puppy }\n end\n end",
"title": ""
},
{
"docid": "d0a5c3e850ac7b13461d81d566218aca",
"score": "0.6013718",
"text": "def new\n @parecer = Parecer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @parecer }\n end\n end",
"title": ""
},
{
"docid": "1ce8c6100a3d082b498ee1b93f6395e4",
"score": "0.60128456",
"text": "def new\n path = \"/view/new\"\n retrieve_stories(path,true)\n end",
"title": ""
},
{
"docid": "1572043787fb1ce6cc13d4a754584bc7",
"score": "0.6005226",
"text": "def new_rest\n @item = Item.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "2db4acd3c6bcdad55c20296b969bc3a9",
"score": "0.60009855",
"text": "def new\n @addp = Addp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @addp }\n end\n end",
"title": ""
},
{
"docid": "211887a04c3fd915effcda15c4433a79",
"score": "0.59932137",
"text": "def index\n @punches = user_signed_in? ? current_user.punches.latest.first(10) : []\n @punch = user_signed_in? ? current_user.punches.new : Punch.new\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @punches }\n end\n end",
"title": ""
},
{
"docid": "45616141d0dae0c3094e23df8d7299f7",
"score": "0.5992558",
"text": "def new\n @ppost = Ppost.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ppost }\n end\n end",
"title": ""
},
{
"docid": "bc3968147541effafc698e4a51b537c9",
"score": "0.59908646",
"text": "def new\n @stuff = Stuff.new\n @days_to_njcee = get_days_to_njcee()\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @stuff }\n end\n end",
"title": ""
},
{
"docid": "445d9d8017f64b5de54e6961157c8129",
"score": "0.5988196",
"text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @round }\n end\n end",
"title": ""
},
{
"docid": "d8ea74214e44961b9d0ea299ddf00ae2",
"score": "0.59880596",
"text": "def new\n @pool = Pool.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pool }\n end\n end",
"title": ""
},
{
"docid": "264f32ae2fd047834967647217edd5fb",
"score": "0.59748775",
"text": "def new\n @poi = Poi.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @poi }\n end\n end",
"title": ""
},
{
"docid": "9abdceeaea6863de48ee0a62fb458c48",
"score": "0.5974141",
"text": "def new\n @punto = Punto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @punto }\n end\n end",
"title": ""
}
] |
10b61cd284647db53486098f0b8ddcd4
|
GET /venuetypes GET /venuetypes.json
|
[
{
"docid": "5c1f09e6a7e8c855d6cae36e44b87743",
"score": "0.74659914",
"text": "def index\n @venuetypes = Venuetype.all\n end",
"title": ""
}
] |
[
{
"docid": "cdd64ab7e0d0e65c1b28d9fd80bcf1e1",
"score": "0.7911973",
"text": "def index\n @venue_types = VenueType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @venue_types }\n end\n end",
"title": ""
},
{
"docid": "1b77431c6d1997cf5f09ac97fbe60589",
"score": "0.7243777",
"text": "def types\n @types = Tournament.tournament_types.keys.to_a\n respond_to do |format|\n format.json { render json: @types }\n end\n end",
"title": ""
},
{
"docid": "93459dc82d4e5bad6616779671a98950",
"score": "0.72011745",
"text": "def index\n @venue_types = VenueType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @venue_types }\n end\n end",
"title": ""
},
{
"docid": "e0fa8dc8095d580952b376cb12a74923",
"score": "0.7181566",
"text": "def show\n @venue_type = VenueType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @venue_type }\n end\n end",
"title": ""
},
{
"docid": "3ab77ebcb3d27fb4d343c2cfe296a6d9",
"score": "0.70543206",
"text": "def all_vendortypes\n @vendortypes = VendorType.select(:vendor_type).order(:vendor_type).distinct.pluck(:vendor_type)\n\n if @vendortypes.nil?\n render json: { message: \"Cannot find vendor types\" }, status: :not_found\n else\n render json: @vendortypes\n end\n end",
"title": ""
},
{
"docid": "a4f36ecb2b684a34aafd94258ca6e28c",
"score": "0.6849753",
"text": "def index\n @vtypes = Vtype.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @vtypes }\n end\n end",
"title": ""
},
{
"docid": "2bb63d6a8b3f3a5e5365701839f7bc5d",
"score": "0.6828921",
"text": "def index\n @vehicle_types = VehicleType.all\n\n render json: @vehicle_types\n end",
"title": ""
},
{
"docid": "8d2974f7090a51efcd15e5e5ee09443f",
"score": "0.68025917",
"text": "def spot_types\n render json: SpotType.pluck(:name)\n end",
"title": ""
},
{
"docid": "c6006328690467090d008be0fdca44c5",
"score": "0.6779044",
"text": "def index\n @types = Type.all\n json_response(@types)\n end",
"title": ""
},
{
"docid": "9d049a27b676e9aa0e4347c7ebc9d99d",
"score": "0.67716444",
"text": "def index\n @venue_categories = VenueCategory.with_venues\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @venue_categories }\n end\n end",
"title": ""
},
{
"docid": "d83c08f38d3e155a8797fdcb78c561cb",
"score": "0.6760512",
"text": "def types\n if !@api_key.nil? and @api_key.api_type == \"muni\"\n params[:c] = \"forager\"\n end\n\n if params[:c].blank?\n cat_mask = array_to_mask([\"forager\",\"freegan\"],Type::Categories)\n else\n cat_mask = array_to_mask(params[:c].split(/,/),Type::Categories)\n end\n\n cfilter = \"(category_mask & #{cat_mask})>0 AND NOT pending\"\n\n @types = Type\n .where(cfilter)\n .collect { |t| { :name => t.full_name, :id => t.id } }\n .sort{ |x, y| x[:name] <=> y[:name] }\n\n log_api_request(\"api/locations/types\", @types.length)\n\n respond_to do |format|\n format.json { render json: @types }\n end\n end",
"title": ""
},
{
"docid": "f2d847a96f32ffc562a0f4cf7301038c",
"score": "0.6688492",
"text": "def index\n @usertypes = Usertype.all\n\n render json: @usertypes\n end",
"title": ""
},
{
"docid": "9ae9a4b8ea4f9abb8281c80ba4762064",
"score": "0.6575453",
"text": "def types\n types = JSON.parse(connection.get(\"/Contact/Types\").body )\n end",
"title": ""
},
{
"docid": "7b7510ccde5f4c2522d5b18b71b9e945",
"score": "0.6569095",
"text": "def index\n @rsvt_types = RsvtType.where(hotel_src_id: current_user.hotel_src_id).page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rsvt_types }\n end\n end",
"title": ""
},
{
"docid": "b10c76874e1b595dd50c7a973202cb8f",
"score": "0.64701104",
"text": "def index\n @types = Type.order(:name).all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @types }\n end\n end",
"title": ""
},
{
"docid": "cf817412360716a94d8e6e68de0a2285",
"score": "0.64675325",
"text": "def index\n @event_types = EventType.all\n @event_types = EventType.paginate(:per_page => 15, :page => params[:page])\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @event_types }\n end\n end",
"title": ""
},
{
"docid": "27bc81cc9e2a5a441ad18504e02a5966",
"score": "0.6459496",
"text": "def index\n @venues = Venue.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @venues }\n end\n end",
"title": ""
},
{
"docid": "27bc81cc9e2a5a441ad18504e02a5966",
"score": "0.6459496",
"text": "def index\n @venues = Venue.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @venues }\n end\n end",
"title": ""
},
{
"docid": "27bc81cc9e2a5a441ad18504e02a5966",
"score": "0.6459496",
"text": "def index\n @venues = Venue.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @venues }\n end\n end",
"title": ""
},
{
"docid": "27bc81cc9e2a5a441ad18504e02a5966",
"score": "0.6459496",
"text": "def index\n @venues = Venue.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @venues }\n end\n end",
"title": ""
},
{
"docid": "e85dd35557350ec1c4b0e07ec8f78926",
"score": "0.644374",
"text": "def index\n @eventtypes = Eventtype.order(:name)\n\n if params[:agendaitemtype_id]\n @eventtypes = @eventtypes.joins(:agendaitemtypes).where(agendaitemtypes: {id: params[:agendaitemtype_id]})\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @eventtypes }\n end\n end",
"title": ""
},
{
"docid": "9e18bedf25e9ccb6cd6b3ae2e8b10f95",
"score": "0.64407945",
"text": "def index\n @tailgate_venues = TailgateVenue.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tailgate_venues }\n end\n end",
"title": ""
},
{
"docid": "e90350001b4a4ff6b1040dfa03e4570a",
"score": "0.6437519",
"text": "def index\n @reagent_types = ReagentType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reagent_types }\n end\n end",
"title": ""
},
{
"docid": "b29f0b6d1d2b97a304e4b855c488b06f",
"score": "0.6427734",
"text": "def index\n @street_types = StreetType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @street_types }\n end\n end",
"title": ""
},
{
"docid": "e2ac3597ffff54bded968b765550a933",
"score": "0.64130616",
"text": "def retrieve_entity_types()\n start.uri('/api/entity/type')\n .get()\n .go()\n end",
"title": ""
},
{
"docid": "2da52164c899254c06d7cf6a015a2ecf",
"score": "0.6405556",
"text": "def index\n @gst_types = GstType.where(hotel_src_id: current_user.hotel_src_id).page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @gst_types }\n end\n end",
"title": ""
},
{
"docid": "80116c34a45ce3a25726eb83aa5de2d8",
"score": "0.6395525",
"text": "def index\n @insured_types = InsuredType.all\n @title = \"Types of Insured Patients\"\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @insured_types }\n end\n end",
"title": ""
},
{
"docid": "e47880424866ed1d0ca6d619ce9b0474",
"score": "0.6389463",
"text": "def index\n @user_types = UserType.all\n render json: @user_types\n end",
"title": ""
},
{
"docid": "b25627406f432237b99c39b626f7dc02",
"score": "0.6356525",
"text": "def types\n get(\"/project/types\")[\"types\"]\n end",
"title": ""
},
{
"docid": "aa60f2980cf3de449211e987baf48ba1",
"score": "0.6347516",
"text": "def index\n @agendaitemtype_eventtypes = AgendaitemtypeEventtype.order(:agendaitemtype_id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @agendaitemtype_eventtypes }\n end\n end",
"title": ""
},
{
"docid": "6648bbcea40ab2c738f2a19a729f8fed",
"score": "0.634343",
"text": "def show\n @venue_type = VenueType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @venue_type }\n end\n end",
"title": ""
},
{
"docid": "8463ec7c308780170102230f6148cee7",
"score": "0.63338745",
"text": "def venues\n @title = \"Venues\"\n\n puts '====================== venues'\n\n @user = User.find(params[:id])\n @venues = @user.venues.paginate(page: params[:page], :per_page => 50).includes(:users, :tenders)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json=> { \n :venues=>@venues.as_json(:only => [:id, :fs_venue_id, :name], \n :include => { \n :tenders => { :only => [:id, :name, :tender], :methods => [:photo_url] },\n :favorites => { :only => [:id, :user_id, :venue_id] },\n :workfavorites => { :only => [:id, :user_id, :venue_id] }\n }\n ) \n } }\n end\n end",
"title": ""
},
{
"docid": "761041fc3d43d25bdad0607fbc588228",
"score": "0.6317306",
"text": "def new\n @venue_type = VenueType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @venue_type }\n end\n end",
"title": ""
},
{
"docid": "af9cdb687706f8509ddcc1aadc6efa50",
"score": "0.6302802",
"text": "def for_venue\n result = Event.search query: { match: { 'venue.name' => params[:v] } }\n\n render json: { events: result, total: result.total }\n end",
"title": ""
},
{
"docid": "ad0f679f243408983574606fbf7e573f",
"score": "0.6288229",
"text": "def index\n @budget_types = BudgetType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @budget_types }\n end\n end",
"title": ""
},
{
"docid": "6ee0d58d170be95ac649d22268bc7aba",
"score": "0.6287728",
"text": "def show\n render json: @vehicle_type\n end",
"title": ""
},
{
"docid": "936ee18d6e2ef226bd174ff52c8ba207",
"score": "0.62876594",
"text": "def index\n @sourcetypes = Sourcetype.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sourcetypes }\n end\n end",
"title": ""
},
{
"docid": "4292336d37ff954caecf56be03842ac7",
"score": "0.62451315",
"text": "def types\n\t\ttypes = []\n\t\t@api[\"types\"].each do |i|\n\t\t\ttypes.push(i[\"type\"][\"name\"].capitalize)\n\t\tend\n\t\treturn types\n\tend",
"title": ""
},
{
"docid": "cf3cd1ec20adcc9f38dad43a93167e32",
"score": "0.62447876",
"text": "def index\n @seva_types = SevaType.all\n end",
"title": ""
},
{
"docid": "3e441f5320a1017637fa6528337826fa",
"score": "0.62418675",
"text": "def index\n @venues = Venue.paginate(page: params[:page], per_page: params[:per_page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @venues }\n end\n end",
"title": ""
},
{
"docid": "0eb2c57a3f4f88b90633a127380d518a",
"score": "0.62296516",
"text": "def set_venuetype\n @venuetype = Venuetype.find(params[:ids])\n end",
"title": ""
},
{
"docid": "744e62eaf64f454a4c3afe3256a76f4b",
"score": "0.6226974",
"text": "def index\n if params[:q].blank?\n @venues = Venue.all\n elsif 'birthday_party_venue' == params[:q]\n @venues = Venue.where(birthday_party_venue: 'Yes')\n else\n @venues = Venue.where(\"category LIKE ?\", \"%#{params[:q]}%\")\n end\n\n respond_to do |format|\n format.json { render json: @venues.to_json }\n end\n end",
"title": ""
},
{
"docid": "a0dce3ac5ebd1ca4bfb09f1f3f332f6d",
"score": "0.62242395",
"text": "def types!\n mashup(self.class.get(\"/\", :query => method_params('aj.types.getList'))).types['type']\n end",
"title": ""
},
{
"docid": "a3d65e2303470051d3f5fde1a22aa365",
"score": "0.6220171",
"text": "def index\n @benefit_types = BenefitType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @benefit_types }\n end\n end",
"title": ""
},
{
"docid": "d442fa40ad65be308e3e86291de15315",
"score": "0.62159604",
"text": "def index\n @item_types = ItemType.all\n\n render json: @item_types\n end",
"title": ""
},
{
"docid": "7155f1bc054175d42c73af636b86dff7",
"score": "0.6204921",
"text": "def index\n @usertypes = UserType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @usertypes }\n end\n end",
"title": ""
},
{
"docid": "c89ca2f54fde8ace2d752717abfdd600",
"score": "0.62048244",
"text": "def index\n @sources_types = SourcesType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sources_types }\n end\n end",
"title": ""
},
{
"docid": "73b83bd687e8d2da54c5116c6c70e22a",
"score": "0.62037313",
"text": "def index\n @vehicle_types = VehicleType.all\n end",
"title": ""
},
{
"docid": "6d47d67e87af7b1927a2f7df84f53e85",
"score": "0.62014294",
"text": "def index\n @resource_types = ResourceType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @resource_types }\n end\n end",
"title": ""
},
{
"docid": "2525d8058d43134c1d55f6288503bf9f",
"score": "0.61892015",
"text": "def index\n respond_with EventType.search(event_type_search_params)\n end",
"title": ""
},
{
"docid": "346cb066056b54f8a8b263c2d6f63d62",
"score": "0.61823875",
"text": "def api_type\n region = params[:region_id]\n render json: {\n types: Type.all,\n arrondissement: Arrondissement.where(region_id: region).map do |arrondissement|\n {\n arrondissement_id: arrondissement.id,\n arrondissement_name: arrondissement.name\n }\n end\n }\n end",
"title": ""
},
{
"docid": "2f5459bbc0a2117cdb6f2b2a528d7666",
"score": "0.61813194",
"text": "def show\n @venue = Venue.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @venue }\n end\n end",
"title": ""
},
{
"docid": "2f5459bbc0a2117cdb6f2b2a528d7666",
"score": "0.61813194",
"text": "def show\n @venue = Venue.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @venue }\n end\n end",
"title": ""
},
{
"docid": "2f5459bbc0a2117cdb6f2b2a528d7666",
"score": "0.61813194",
"text": "def show\n @venue = Venue.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @venue }\n end\n end",
"title": ""
},
{
"docid": "2f5459bbc0a2117cdb6f2b2a528d7666",
"score": "0.61813194",
"text": "def show\n @venue = Venue.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @venue }\n end\n end",
"title": ""
},
{
"docid": "2f5459bbc0a2117cdb6f2b2a528d7666",
"score": "0.61813194",
"text": "def show\n @venue = Venue.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @venue }\n end\n end",
"title": ""
},
{
"docid": "2f5459bbc0a2117cdb6f2b2a528d7666",
"score": "0.61813194",
"text": "def show\n @venue = Venue.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @venue }\n end\n end",
"title": ""
},
{
"docid": "4bd684e3879f7b6ce849f9205c0df096",
"score": "0.61607933",
"text": "def index\n @contact_types = ContactType.all\n\n render json: @contact_types\n end",
"title": ""
},
{
"docid": "f6c54432d7bfc8cf59488b16c0277b06",
"score": "0.6159865",
"text": "def index\n @usertypes = Usertype.all\n end",
"title": ""
},
{
"docid": "6b44c09b94b6fd6134879a8db1494f96",
"score": "0.61413807",
"text": "def index\n @vaccination_types = VaccinationType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @vaccination_types }\n end\n end",
"title": ""
},
{
"docid": "a628aa37f30ca404372d29d6389e16a8",
"score": "0.6131491",
"text": "def index\n @product_types = ProductType.where(\"product_id = ?\", params[:get_product_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @product_types }\n end\n end",
"title": ""
},
{
"docid": "e55f7b1a5debbe56e8790be1e3b9f7b4",
"score": "0.61273146",
"text": "def index\n @participation_types = ParticipationType.find_all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @participation_types }\n end\n end",
"title": ""
},
{
"docid": "d26cb122875f462c39772f216a7bb4d0",
"score": "0.61230046",
"text": "def index\n @organisation_types = OrganisationType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @organisation_types }\n end\n end",
"title": ""
},
{
"docid": "4440b05019be9a805e8f820e40f4fbc2",
"score": "0.61091584",
"text": "def types\n data = {\n 'sale_agent_role' => SaleAgent::ROLE_TYPES,\n 'transaction_type' => Entry::TYPES_TRANSACTION,\n 'author_role' => EntryAuthor::TYPES_ROLES,\n 'artist_role' => EntryArtist::TYPES_ROLES,\n 'currency' => Sale::CURRENCY_TYPES,\n 'sold' => Sale::SOLD_TYPES,\n 'material' => EntryMaterial::MATERIAL_TYPES,\n 'alt_size' => Entry::ALT_SIZE_TYPES,\n 'acquisition_method' => Provenance::ACQUISITION_METHOD_TYPES\n }\n render json: data\n end",
"title": ""
},
{
"docid": "50a6dadea773a3272e26791dd8e83a2d",
"score": "0.61055136",
"text": "def show\n @tailgate_venue = TailgateVenue.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tailgate_venue }\n end\n end",
"title": ""
},
{
"docid": "bf82f4b48c223e2e49bce49b60f74cdd",
"score": "0.6103065",
"text": "def index\n @product_types = ProductType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @product_types }\n end\n end",
"title": ""
},
{
"docid": "93e6f5c08d3baba9bdf46c75ac22c15b",
"score": "0.6080473",
"text": "def index\n @class_season_types = ClassSeasonType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @class_season_types }\n end\n end",
"title": ""
},
{
"docid": "65c4350912947cd88919919f40f4942f",
"score": "0.60788876",
"text": "def index\n @load_types = LoadType.all\n\n render json: @load_types\n end",
"title": ""
},
{
"docid": "306c81d6cd080cf28a917d735ec52913",
"score": "0.6067475",
"text": "def index\n # @count_types = CountType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @count_types }\n end\n end",
"title": ""
},
{
"docid": "9fd0a758bc1dbc0d02031d4bfb20b7b7",
"score": "0.6067361",
"text": "def index\n @venues = Venue.all(:order =>'name ASC')\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @venues }\n end\n end",
"title": ""
},
{
"docid": "5ed5a097e04893ed95eab9c47c8e4683",
"score": "0.6060783",
"text": "def index\n @item_types = ItemType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @item_types }\n end\n end",
"title": ""
},
{
"docid": "537cedb17a9be8d17475c68c128c89b1",
"score": "0.60579073",
"text": "def show\n @vtype = Vtype.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vtype }\n end\n end",
"title": ""
},
{
"docid": "8cda9b5abf9fd1825e2a9606baa1bbae",
"score": "0.6054187",
"text": "def venues(venue_id)\n if venue_id\n url = '/venues/' + venue_id.to_s\n end\n response = get(url)\n response.venue\n end",
"title": ""
},
{
"docid": "2c58862d241f076a562e953847aefd0e",
"score": "0.60482985",
"text": "def index\n @office_types = OfficeType.all\n @title = \"Types of Offices\"\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @office_types }\n end\n end",
"title": ""
},
{
"docid": "4ac69a457cfe27ea1b9ea630b7062b50",
"score": "0.60466164",
"text": "def index\n @room_sub_types = RoomSubType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @room_sub_types }\n end\n end",
"title": ""
},
{
"docid": "b7b4f088aa41ff65d0430ceabad8bb92",
"score": "0.603514",
"text": "def index\n @opportunity_types = OpportunityType.all\n end",
"title": ""
},
{
"docid": "66c276b4d298554e3fbc980ff777be04",
"score": "0.60350305",
"text": "def index\n @types = Type.all\n end",
"title": ""
},
{
"docid": "66c276b4d298554e3fbc980ff777be04",
"score": "0.60350305",
"text": "def index\n @types = Type.all\n end",
"title": ""
},
{
"docid": "66c276b4d298554e3fbc980ff777be04",
"score": "0.60350305",
"text": "def index\n @types = Type.all\n end",
"title": ""
},
{
"docid": "66c276b4d298554e3fbc980ff777be04",
"score": "0.60350305",
"text": "def index\n @types = Type.all\n end",
"title": ""
},
{
"docid": "66c276b4d298554e3fbc980ff777be04",
"score": "0.60350305",
"text": "def index\n @types = Type.all\n end",
"title": ""
},
{
"docid": "722fdc2822a0e15efa9060d47f1e704b",
"score": "0.60295373",
"text": "def index\n @location_types = LocationType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @location_types }\n end\n end",
"title": ""
},
{
"docid": "f4ab246357d1b9a6fbe43b2f26a8beae",
"score": "0.6021938",
"text": "def types\n contact_method = JSON.parse(connection.get(\"/Relationship/Types\").body )\n end",
"title": ""
},
{
"docid": "845a5472262b11b3fd13e67818d26196",
"score": "0.60191715",
"text": "def index\n # @apartment_types = ApartmentType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @apartment_types }\n end\n end",
"title": ""
},
{
"docid": "93150f7036451c6df61a05efefcab41d",
"score": "0.6019035",
"text": "def index\n #@fee_types = Fee.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fee_types }\n end\n end",
"title": ""
},
{
"docid": "09a548b324510e292b113e8771138267",
"score": "0.6018426",
"text": "def index\n @place_types = PlaceType.select(@fields).all\n if @place_types.count > 0\n return_message(200, :ok, {:place_types => @place_types})\n else\n return_message(200, :ok, {:err => {:states => [115]}})\n end\n end",
"title": ""
},
{
"docid": "3f54cb6381798e1bb6b1e5e3d43914fb",
"score": "0.60166013",
"text": "def show\n @venue_category = VenueCategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @venue_category }\n end\n end",
"title": ""
},
{
"docid": "5498b4b133f69b03886e0ca7d637d30c",
"score": "0.60148513",
"text": "def venues\n get(\"venues/venues.xml\").body\n end",
"title": ""
},
{
"docid": "cedda54973750016eeed720c5057ee18",
"score": "0.60035384",
"text": "def index\n @team_types = TeamType.all\n end",
"title": ""
},
{
"docid": "eb24054fd2d2aac8bd097bb40096ba92",
"score": "0.60029054",
"text": "def index\n @typecollections = Typecollection.all\n end",
"title": ""
},
{
"docid": "d947451b6543b7525351a2623592851c",
"score": "0.60022086",
"text": "def list_types(params={})\n execute(method: :get, url: \"#{base_path}/types\", params: params)\n end",
"title": ""
},
{
"docid": "8cef9f8a6dbf6c4be3cbeb8c07404fba",
"score": "0.5999926",
"text": "def getUserTypes\n\n types = []\n\n @current_user.user_types.each do |type|\n if type.type.is_verified\n types.push(type.type)\n end\n end\n\n render json: { type: types }\n end",
"title": ""
},
{
"docid": "341982657361bebf9d59165f89b68eb1",
"score": "0.5996508",
"text": "def getResourcesType\n type = [Announcement, Discussion, DiscussionSolution, Exam, ExamSolution, Homework, HomeworkSolution, LectureNotes, OnlineResource, Other]\n dic = {:type => type}\n respond_to do |format|\n format.json {render json: dic}\n end\n end",
"title": ""
},
{
"docid": "33a420f4a2a30981a171735fa9a490dc",
"score": "0.5996425",
"text": "def index\n @schedtypes = Schedtype.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @schedtypes }\n end\n end",
"title": ""
},
{
"docid": "43fbafe9c11592beae939d71141d92c5",
"score": "0.5989318",
"text": "def index\n\t@market_types = MarketType.all\n respond_to do |format|\n format.json { render json: @market_types, status: :ok }\n end\nend",
"title": ""
},
{
"docid": "5902c1e2174f794e1e788151ec045f94",
"score": "0.5988907",
"text": "def index\r\n @blessuretypes = Blessuretype.all\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @blessuretypes }\r\n end\r\n end",
"title": ""
},
{
"docid": "b6e25ba7cdf99b360be685c3aebc23b0",
"score": "0.5988062",
"text": "def show\n @venue_category = VenueCategory.with_venues(venue_category_id: params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @venue_category }\n end\n end",
"title": ""
},
{
"docid": "165d9a2057c61acdbff50ef0316c7467",
"score": "0.5987796",
"text": "def index\n render json: @venues\n end",
"title": ""
},
{
"docid": "15c0eaadf3acfd12c31ba95ac6d35ba4",
"score": "0.5987443",
"text": "def index\n @vessel_types =VesselType.all\n respond_to do |format|\n format.json {render :json => {:successful=>true, :total=>@vessel_types.length, :data=> @vessel_types }}\n end\n end",
"title": ""
},
{
"docid": "2793e774c1c05d9c4e1ef84bc742ca8d",
"score": "0.5980304",
"text": "def index\n if params[:type_id].nil? or params[:type_id].empty?\n @sites = Site.all # path: /types\n else\n @sites = Type.find(params[:type_id]).sites # path: /types/id/sites\n end\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sites }\n end\n end",
"title": ""
}
] |
b663ce492b7137b83ab9614f83c2cf43
|
reduce 606 omitted reduce 607 omitted
|
[
{
"docid": "0416bcf8d041fe904b74309ef3bc1c87",
"score": "0.0",
"text": "def _reduce_608(val, _values, result)\n identifier = val[1].to_sym\n\n self.env[identifier] = :lvar\n result = \"&#{identifier}\".to_sym\n\n result\nend",
"title": ""
}
] |
[
{
"docid": "cfd9751f38acc4263e65891b003b80f5",
"score": "0.7208441",
"text": "def _reduce_606(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "61f930fe3a1a0b9d4ce1cd245c5b5994",
"score": "0.71876264",
"text": "def _reduce_604(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "1ab951848648bd3eb287529b9355c435",
"score": "0.7163917",
"text": "def _reduce_607(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "1ab951848648bd3eb287529b9355c435",
"score": "0.7163917",
"text": "def _reduce_607(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "a8bd851ea077dd5d3684a05c36012ebe",
"score": "0.7160093",
"text": "def _reduce_610(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "63d952982edb4355d2edab3adbda3b4d",
"score": "0.7132975",
"text": "def _reduce_610(val, _values, result)\n result = nil\n\n result\nend",
"title": ""
},
{
"docid": "48524f57df7f06a05f155a31ce7515ad",
"score": "0.7104494",
"text": "def _reduce_606(val, _values, result)\n yyerrok\n \n result\nend",
"title": ""
},
{
"docid": "eb3a3e33bbe9c8786ead1bd8e227d063",
"score": "0.70878726",
"text": "def _reduce_602(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "bcc77ea412992f9c87aad138efd40a40",
"score": "0.70692116",
"text": "def _reduce_236(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "077be4d2f68ffa55d4979dd6bcec55aa",
"score": "0.70464426",
"text": "def _reduce_606(val, _values, result)\n yyerrok\n\n result\nend",
"title": ""
},
{
"docid": "8da6d05568e0cf5b51807ae64ca3f5a3",
"score": "0.7019116",
"text": "def _reduce_603(val, _values, result)\n yyerrok\n \n result\nend",
"title": ""
},
{
"docid": "8da6d05568e0cf5b51807ae64ca3f5a3",
"score": "0.7019116",
"text": "def _reduce_603(val, _values, result)\n yyerrok\n \n result\nend",
"title": ""
},
{
"docid": "d6f4be17261b17922757ecbba7500fb0",
"score": "0.6996487",
"text": "def _reduce_594(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "a8f6b114cf0c46f8e2a7e869a4ffdefc",
"score": "0.699406",
"text": "def _reduce_228(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "a8f6b114cf0c46f8e2a7e869a4ffdefc",
"score": "0.699406",
"text": "def _reduce_228(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "20e8d33b3eb637f0a1564dbd26b2f0b0",
"score": "0.69907695",
"text": "def _reduce_725(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "20e8d33b3eb637f0a1564dbd26b2f0b0",
"score": "0.69907695",
"text": "def _reduce_725(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "9d3b25384aad636e9399450ddc1bd722",
"score": "0.69859564",
"text": "def _reduce_237(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "9d3b25384aad636e9399450ddc1bd722",
"score": "0.69859564",
"text": "def _reduce_237(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "0c0b2a5f217c5ad53615f0f34d7e9acf",
"score": "0.6983548",
"text": "def _reduce_558(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "3cae03b0b71145c3925184be78edbbed",
"score": "0.6980095",
"text": "def _reduce_598(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "82915cb5c0203b0cba656d2bf4753af1",
"score": "0.69539934",
"text": "def _reduce_525(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "23b9ecd9f2940d3e6aa8514781c08a1b",
"score": "0.6945598",
"text": "def _reduce_744(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "acde5e6865f4eeb585a23c1379196c00",
"score": "0.6941018",
"text": "def _reduce_544(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "5c6eb2ec68a89de964db1411baa71bb2",
"score": "0.69391924",
"text": "def _reduce_235(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "b45799a92839aae8dfbd33c7b4857213",
"score": "0.6938062",
"text": "def _reduce_551(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "b45799a92839aae8dfbd33c7b4857213",
"score": "0.6938062",
"text": "def _reduce_551(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "6b14ba014217cd9cf9e9992732a9ee7b",
"score": "0.69333583",
"text": "def _reduce_721(val, _values, result)\n yyerrok\n \n result\nend",
"title": ""
},
{
"docid": "6b14ba014217cd9cf9e9992732a9ee7b",
"score": "0.69333583",
"text": "def _reduce_721(val, _values, result)\n yyerrok\n \n result\nend",
"title": ""
},
{
"docid": "10f21b3d8f47a2ed5210a7a7f30b9446",
"score": "0.6931353",
"text": "def _reduce_556(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "7e1ad6c70501b45f5a3b2b701b8c1700",
"score": "0.69247526",
"text": "def _reduce_598(val, _values, result)\n yyerrok\n \n result\nend",
"title": ""
},
{
"docid": "b54db12f89223bebd2320788e1d7202e",
"score": "0.6923133",
"text": "def _reduce_602(val, _values, result)\n yyerrok\n \n result\nend",
"title": ""
},
{
"docid": "ca648fc9ff04e0d3dcfbb11b8fe9d64d",
"score": "0.6920058",
"text": "def _reduce_737(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "dc205f055ed9fc5fbb4faeb2c9861cbd",
"score": "0.6919817",
"text": "def _reduce_218(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "6dbaaf2fe99b7c35524d19983430b42d",
"score": "0.6915075",
"text": "def _reduce_560(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "56bd5579a3a2de64f1337e1168c579a4",
"score": "0.69115835",
"text": "def _reduce_594(val, _values, result)\n yyerrok\n \n result\nend",
"title": ""
},
{
"docid": "7253ef7356f81fefad651865a4a6f603",
"score": "0.6906681",
"text": "def _reduce_590(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "161711581a7dc36fadad39f1ba399f08",
"score": "0.6905569",
"text": "def _reduce_551(val, _values, result)\n result = nil\n\n result\nend",
"title": ""
},
{
"docid": "161711581a7dc36fadad39f1ba399f08",
"score": "0.6905569",
"text": "def _reduce_551(val, _values, result)\n result = nil\n\n result\nend",
"title": ""
},
{
"docid": "5343985407084af125e58656ab444809",
"score": "0.6904448",
"text": "def _reduce_597(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "5343985407084af125e58656ab444809",
"score": "0.6904448",
"text": "def _reduce_597(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "5343985407084af125e58656ab444809",
"score": "0.6904448",
"text": "def _reduce_597(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "1dc62ba338b13c1197034cfd74aaf0d8",
"score": "0.6901567",
"text": "def _reduce_548(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "7506d0ea1feceb709a1b4e773d074828",
"score": "0.68963146",
"text": "def _reduce_239(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "7506d0ea1feceb709a1b4e773d074828",
"score": "0.68963146",
"text": "def _reduce_239(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "e564e80902f6129d54333d963d9dab5c",
"score": "0.68936485",
"text": "def _reduce_589(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "eacd87da293b3d5fb16b0ec8dacb7a4e",
"score": "0.688552",
"text": "def _reduce_589(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "a3558725aba5ea5ddd02da522fe37232",
"score": "0.68785816",
"text": "def _reduce_590(val, _values, result)\n result = nil\n\n result\nend",
"title": ""
},
{
"docid": "2e4d027779a2f3b9d51fe0128bca0251",
"score": "0.6874252",
"text": "def _reduce_597(val, _values, result)\n result = nil\n\n result\nend",
"title": ""
},
{
"docid": "962ea691d295c29c3c632ba3de31cda0",
"score": "0.6868605",
"text": "def _reduce_577(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "8d49d627305e22461417b6e06cdbb201",
"score": "0.6866975",
"text": "def _reduce_498(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "971f38ad22fa5234f8f6d222e2413ee9",
"score": "0.68581676",
"text": "def _reduce_222(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "9a07920b1e54441703de5f3e24909728",
"score": "0.6850807",
"text": "def _reduce_544(val, _values, result)\n yyerrok\n \n result\nend",
"title": ""
},
{
"docid": "7772fec68a0845984c9e57b7bd2d0b7a",
"score": "0.6835324",
"text": "def _reduce_552(val, _values, result)\n yyerrok\n \n result\nend",
"title": ""
},
{
"docid": "ef057406f56e7c344f4e75fce29c9f1f",
"score": "0.68322635",
"text": "def _reduce_591(val, _values, result)\n yyerrok\n \n result\nend",
"title": ""
},
{
"docid": "56183ddc03335ff289e7a202a9e3a07b",
"score": "0.68286353",
"text": "def _reduce_587(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "9dc6ee371bca314e42c6af0cd63bee0b",
"score": "0.682771",
"text": "def _reduce_222(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "53a34acbe647416d051d0d32da148185",
"score": "0.6826118",
"text": "def _reduce_586(val, _values, result)\n yyerrok\n \n result\nend",
"title": ""
},
{
"docid": "b3e69c1c851c351164c1612d4d416f71",
"score": "0.6825123",
"text": "def _reduce_559(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "59f9399b24dc1512ef3e5c74355d2be9",
"score": "0.682205",
"text": "def _reduce_733(val, _values, result)\n yyerrok\n \n result\nend",
"title": ""
},
{
"docid": "28046a1ad90c4a10fba135d096479a6f",
"score": "0.68155867",
"text": "def _reduce_494(val, _values, result)\n yyerrok\n \n result\nend",
"title": ""
},
{
"docid": "dcef17eff9b9c39c80bf929d34b72029",
"score": "0.6810912",
"text": "def _reduce_724(val, _values, result)\n yyerrok\n\n result\nend",
"title": ""
},
{
"docid": "10ad70df07e7889e6603be6ea72474dc",
"score": "0.6804717",
"text": "def _reduce_580(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "9bbaf55ff637a7446a71e97462fba879",
"score": "0.6803731",
"text": "def _reduce_546(val, _values, result)\n yyerrok\n \n result\nend",
"title": ""
},
{
"docid": "9bbaf55ff637a7446a71e97462fba879",
"score": "0.6803731",
"text": "def _reduce_546(val, _values, result)\n yyerrok\n \n result\nend",
"title": ""
},
{
"docid": "92b97cadc27bea6a68848c6dc42bf50a",
"score": "0.6792099",
"text": "def _reduce_728(val, _values, result)\n result = nil\n\n result\nend",
"title": ""
},
{
"docid": "c462c4c7fee55831bcd6a47c04695de8",
"score": "0.67877245",
"text": "def _reduce_599(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "17b6fe3f354f5f26a9f3a7a2f09366e1",
"score": "0.6775901",
"text": "def _reduce_593(val, _values, result)\n yyerrok\n \n result\nend",
"title": ""
},
{
"docid": "17b6fe3f354f5f26a9f3a7a2f09366e1",
"score": "0.6775901",
"text": "def _reduce_593(val, _values, result)\n yyerrok\n \n result\nend",
"title": ""
},
{
"docid": "17b6fe3f354f5f26a9f3a7a2f09366e1",
"score": "0.6775901",
"text": "def _reduce_593(val, _values, result)\n yyerrok\n \n result\nend",
"title": ""
},
{
"docid": "5f0a0777901574af4951c56958d103f5",
"score": "0.6774828",
"text": "def _reduce_595(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "3065212773e49508b18f5d2194b84c30",
"score": "0.67728496",
"text": "def _reduce_542(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "619ff9d01cc8f39e0257eb4d266d9a06",
"score": "0.6768806",
"text": "def _reduce_585(val, _values, result)\n yyerrok\n \n result\nend",
"title": ""
},
{
"docid": "55231a2d19c4e102147e402da232e4b4",
"score": "0.6761302",
"text": "def _reduce_600(val, _values, result)\n yyerrok\n \n result\nend",
"title": ""
},
{
"docid": "2d2edbd0888ddc9ddfd8d71942283784",
"score": "0.6752885",
"text": "def _reduce_576(val, _values, result)\n _, margs, _ = val\n\n result = margs\n\n result\nend",
"title": ""
},
{
"docid": "2d2edbd0888ddc9ddfd8d71942283784",
"score": "0.6752885",
"text": "def _reduce_576(val, _values, result)\n _, margs, _ = val\n\n result = margs\n\n result\nend",
"title": ""
},
{
"docid": "eecf86826d610e97df34a98c9cb85781",
"score": "0.6749111",
"text": "def _reduce_596(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "d0eb12749f0b8c99a396beb1cb59357d",
"score": "0.6749073",
"text": "def _reduce_590(val, _values, result)\n yyerrok\n \n result\nend",
"title": ""
},
{
"docid": "60b189972023f214d1c499d676daf67f",
"score": "0.67481905",
"text": "def _reduce_519(val, _values, result)\n result = -val[1] # TODO: pt_testcase\n \n result\nend",
"title": ""
},
{
"docid": "f65bf4c7fac799f34dd58efcb9c12843",
"score": "0.674761",
"text": "def _reduce_586(val, _values, result)\n yyerrok\n\n result\nend",
"title": ""
},
{
"docid": "205581a42055c42749e6ad84c27e0c57",
"score": "0.6747168",
"text": "def _reduce_213(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "1b8bff146504b5eb89bd52fd21dcd933",
"score": "0.6743661",
"text": "def reduce \n end",
"title": ""
},
{
"docid": "3944f56d0d810f8952a9fd577beb2161",
"score": "0.67420465",
"text": "def reduce\n \n end",
"title": ""
},
{
"docid": "7cf4347a5486a04efc3476d6d5a55adf",
"score": "0.67380613",
"text": "def _reduce_599(val, _values, result)\n result = nil\n\n result\nend",
"title": ""
},
{
"docid": "10734647c79a55015e6f477ff3f14980",
"score": "0.672635",
"text": "def _reduce_7(val, _values); end",
"title": ""
},
{
"docid": "ad52c8d3d8f1e16859be0250a458e99b",
"score": "0.6725745",
"text": "def _reduce_375(val, _values, result)\n result = val[0].concat(val[2]).concat(val[3])\n \n result\nend",
"title": ""
},
{
"docid": "b17c978622c9458eb184c0216aabc585",
"score": "0.67250776",
"text": "def _reduce_216(val, _values, result)\n result = []\n \n result\nend",
"title": ""
},
{
"docid": "5acf595fd57cd9f838ebf50ba5aafdb4",
"score": "0.67225945",
"text": "def _reduce_363(val, _values, result)\n result = val[1]\n \n result\nend",
"title": ""
},
{
"docid": "de4592cad8d3b1dff06432c92c45f4b1",
"score": "0.671868",
"text": "def _reduce_598(val, _values, result)\n result = val[1]\n \n result\nend",
"title": ""
},
{
"docid": "de4592cad8d3b1dff06432c92c45f4b1",
"score": "0.671868",
"text": "def _reduce_598(val, _values, result)\n result = val[1]\n \n result\nend",
"title": ""
},
{
"docid": "a01a317db6bc8d3635bf81def724f7a0",
"score": "0.67174983",
"text": "def _reduce_576(val, _values, result)\n result = val[1]\n \n result\nend",
"title": ""
},
{
"docid": "a01a317db6bc8d3635bf81def724f7a0",
"score": "0.67174983",
"text": "def _reduce_576(val, _values, result)\n result = val[1]\n \n result\nend",
"title": ""
},
{
"docid": "8b4170760dd3fecff9655cfa7ef769d7",
"score": "0.6713859",
"text": "def _reduce_550(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "8b4170760dd3fecff9655cfa7ef769d7",
"score": "0.6713859",
"text": "def _reduce_550(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "833aad3acea453cb06fd7050d2339151",
"score": "0.6712112",
"text": "def _reduce_638(val, _values, result)\n yyerrok\n result\nend",
"title": ""
},
{
"docid": "0300c849355f7aee418f230115a0b38a",
"score": "0.6709461",
"text": "def _reduce_547(val, _values, result)\n yyerrok\n \n result\nend",
"title": ""
},
{
"docid": "0300c849355f7aee418f230115a0b38a",
"score": "0.6709461",
"text": "def _reduce_547(val, _values, result)\n yyerrok\n \n result\nend",
"title": ""
},
{
"docid": "f829ed1adeee60ce44d9a94d9fa3c75b",
"score": "0.67030936",
"text": "def _reduce_683(val, _values, result)\n _, margs, _ = val\n\n result = margs\n\n result\nend",
"title": ""
},
{
"docid": "d16209dc453c6f538127a55cfa91cb2b",
"score": "0.6701369",
"text": "def _reduce_769(val, _values, result)\n yyerrok\n result\nend",
"title": ""
},
{
"docid": "17f99f09673200f78820b0283c474fd1",
"score": "0.6682666",
"text": "def _reduce_593(val, _values, result)\n yyerrok\n\n result\nend",
"title": ""
},
{
"docid": "7fefba3e22450fa23643e09b1dceea9f",
"score": "0.66775745",
"text": "def _reduce_336(val, _values, result)\n result = val[1]\n \n result\nend",
"title": ""
}
] |
8e92a4b281527fc156ce466b60f624a6
|
have to make username or password unique and check by that param
|
[
{
"docid": "7e3bed7788c47d6012bd23ef044aacbb",
"score": "0.0",
"text": "def create\n user = User.find_by(username: params[:username])\n if user.authenticate(params[:password])\n my_token = encode_token({user_id: user.id})\n render json: {token: my_token}\n else \n # byebug\n render json: {error: 'That user could not be found'}, status: 401\n end \n end",
"title": ""
}
] |
[
{
"docid": "7d607543d64e6b71b170b70b5719c37c",
"score": "0.76233834",
"text": "def validate_user_pass(_username, _password)\n end",
"title": ""
},
{
"docid": "28cc72f5b7c8c8480f4eef7a74c474c1",
"score": "0.7390678",
"text": "def validate_user(uname, password)\n #validation\n end",
"title": ""
},
{
"docid": "0d594805383048cb04c45cf3d44e1edd",
"score": "0.7193539",
"text": "def register(params)\n db = connect()\n hashed_pass = BCrypt::Password.create(params[\"password\"])\n if db.execute(\"SELECT Username FROM users WHERE Username = ?\", params[\"username\"]).first || params[\"username\"].length < 1 || params[\"password\"].length < 1 || params[\"username\"].length > 20 || params[\"password\"].length > 20 || params[\"username\"].length < 1 || params[\"username\"].length > 20\n return {\n error: true,\n message: \"That username is already in use or you're username or password was more than 20 characters long. Or you had 0 characters\"\n }\n else\n db.execute(\"INSERT INTO users(Username, Password) VALUES(?, ?)\", params[\"username\"], hashed_pass)\n return {\n error: false\n }\n end\nend",
"title": ""
},
{
"docid": "4f5679cb768f6d765ab1ec43dc98cf38",
"score": "0.7168063",
"text": "def same(username, password)\n username == password\nend",
"title": ""
},
{
"docid": "8cccc41f2c9b93b4e109be7eccc6e838",
"score": "0.7071662",
"text": "def valid_user\n \"password\"\n end",
"title": ""
},
{
"docid": "146abcb83a5052ade6019bee52e2e90b",
"score": "0.70546967",
"text": "def valid_user_login?(username, password)\n true\n end",
"title": ""
},
{
"docid": "e6ea63cecab0e5f2cde2a2e5fb265ebc",
"score": "0.69896847",
"text": "def validate_info_login(params)\n if params[\"username\"].nil? || params[\"username\"].length > 10 || params[\"username\"].length < 2 || params[\"password\"].nil? || params[\"password\"].length < 2 || params[\"password\"].length > 10\n return false\n else \n return true\n end\n end",
"title": ""
},
{
"docid": "2684504768850678d0eb47f42261731c",
"score": "0.69797105",
"text": "def register_validation(username, password, confirm)\n if $db.execute(\"SELECT id FROM users WHERE username=?\", username) != []\n return \"user already exists\"\n elsif password != confirm\n return \"passwords do not match\"\n elsif password.length < 6\n return \"password must not be shorter than six characters\"\n elsif username.length < 4\n return \"username must not be shorter than four characters\"\n elsif password =~ (/\\s/) || username =~ (/\\s/)\n return \"password and username must not contain blankspace\"\n else\n return true\n end\nend",
"title": ""
},
{
"docid": "e2ac269f4927cc4d41c1f1b3938d8ac6",
"score": "0.69440037",
"text": "def login_validation(username, password)\n if get_id_from_username(username) == []\n return error_message = \"user does not exist\"\n end\n password_digest = get_password_digest(username)\n p password_digest\n if $pw.new(password_digest) == password\n return true\n else\n return error_message = \"password is incorrect\"\n end\nend",
"title": ""
},
{
"docid": "0b2a1f5cdf80387642e7782bb85dcfb0",
"score": "0.69367564",
"text": "def valid_password?(password); end",
"title": ""
},
{
"docid": "e1ab10e3c2e79bf464b16ba4a21351ef",
"score": "0.69354606",
"text": "def check_user_parameters\n @user = User.find_by_username(params[:username])\n render :status => 500, :text => \"Invalid username or password\" if @user.nil? || @user.crypted_password != params[:password]\n end",
"title": ""
},
{
"docid": "28fbde7c579b993c8a01e62f18b0cb54",
"score": "0.69305265",
"text": "def valid_user?(username, password)\n credentials.key?(username) &&\n BCrypt::Password.new(credentials[username]) == password\nend",
"title": ""
},
{
"docid": "d4896a36d1f061a48433e0e921c3fda2",
"score": "0.69303775",
"text": "def validate_username\n user = User.find_for_database_authentication(username: params[:user][:username])\n render json: {status: 500, message: \"Username already exist.\"} if user\n end",
"title": ""
},
{
"docid": "e2a177810ddc219dd0d05cef722ff2d5",
"score": "0.6915695",
"text": "def valid_login(name, pwd)\n bad_credentials = \"Invalid username and password combination. Please try again.\"\n user1 = User.find_by_username(name)\n valid = (user1.password == pwd) if user1\n msg = nil\n msg = bad_credentials if !valid\n end",
"title": ""
},
{
"docid": "1d7766fe041f82e1f2aaa333ac82dee2",
"score": "0.6886398",
"text": "def valid_signup(name, pwd)\n bad_username = \"The user name should be non-empty and at most 128 characters long. Please try again.\"\n bad_password = \"The password should be at most 128 characters long. Please try again.\"\n user_exists = \"This user name already exists. Please try again.\"\n msg = nil\n if name.nil? or name.length == 0 or name.length > 128\n msg = bad_username\n elsif User.find_by_username(name)\n msg = user_exists\n elsif pwd.length > 128\n msg = bad_password\n end\n end",
"title": ""
},
{
"docid": "6536cf523d89022e016e0feb7e84fd6e",
"score": "0.67918736",
"text": "def validate_credentials(username:, password:)\n User.all.find {|user| user.username == username && user.password == password}\nend",
"title": ""
},
{
"docid": "7ab92d5ad56d975a1977201432a5d938",
"score": "0.6788096",
"text": "def authenticate(name,password)\n require 'sha1'\n password = SHA1.new(password).to_s\n res = false\n if name == self.name and password == self.password\n res = true\n end\n return res\n end",
"title": ""
},
{
"docid": "416ceff1084da43624dc6f143867deb0",
"score": "0.6777434",
"text": "def check_username (name,pwd)\n @lookup_result = settings.mongo_db['accounts'].find_one(:username => name).to_json\n if @lookup_result.to_s == \"null\"\n session.clear\n haml :notfound\n else\n parsed = JSON.parse(@lookup_result)\n \t @password_l = parsed[\"password\"]\n @session_id = parsed[\"_id\"][\"$oid\"]\n if @password_l.eql?(pwd)\n # need to make a ticket sender server\n \t #\"show password: #{@password_l}\" \n session[:id] = @session_id\n redirect 'friends'\n #\"#{parsed[\"_id\"][\"$oid\"]}\"\n else\n # need to make a simeple error redirect page\n session.clear\n redirect 'hello'\n end\n end\n end",
"title": ""
},
{
"docid": "ba1be73a635693cc59e700542924a3c8",
"score": "0.6771908",
"text": "def username_and_password?\n params[:username].present? && params[:password].present?\n end",
"title": ""
},
{
"docid": "12081c15651439c3936a551c1e3c6534",
"score": "0.67717576",
"text": "def validate_login_user(params)\n\n create_params = ['email','password']\n\n begin\n create_params.each do |r|\n if !params[\"#{r}\"].present?\n return false\n end\n \n end\n return true\n rescue\n return false\n end\n end",
"title": ""
},
{
"docid": "9fc57f45170080d527be7bc37d9392c0",
"score": "0.67646587",
"text": "def same?(user_id, password)\n user_id.to_s == password.to_s ? true : false\nend",
"title": ""
},
{
"docid": "3d55e642c40b5e2967499d778b4b3f58",
"score": "0.6743924",
"text": "def username_token?\n username && password\n end",
"title": ""
},
{
"docid": "d469d17c41109f311215039f67fa0f58",
"score": "0.6729187",
"text": "def log_in(username,password)\n \n if username == \"menuman\" && password == \"abcd\"\n return true\n elsif username == \"iamhungry\" && password == \"xyz\"\n return true\n elsif username == \"food_panda\" && password == \"1234\"\n return true\n else \n return false\n end\nend",
"title": ""
},
{
"docid": "9405a8a9025eecd8aa1172da3ff05ba9",
"score": "0.6674421",
"text": "def check_new_username(db, details)\n\tbegin\n\t\tdb.execute(\"INSERT INTO logins (username, password) VALUES (?, ?)\", [details[:username], details[:password]])\n\trescue\n\t\tputs \"Sorry, pick another username, that one is taken.\"\n\t\tnew_login(db)\n\tend\nend",
"title": ""
},
{
"docid": "e61f874b2da09db2cf985118532790d2",
"score": "0.6642011",
"text": "def valid?\n !@username.empty?\n end",
"title": ""
},
{
"docid": "472436c8262234b70ebb85c0c9470a92",
"score": "0.6635329",
"text": "def user_registration\n\n puts \"Enter a user ID.\"\n user_id = gets.chomp\n\n puts \"Enter a password\"\n password = gets.chomp\n\n if !same?(user_id, password) && long_enough(user_id) && long_enough(password) && contains_special(password) && does_not_contain_special(user_id) && password != \"password\"\n \"Your user information is valid!\"\n else\n \"Invalid credentials! try again\"\n end\n\nend",
"title": ""
},
{
"docid": "29a470a1fc3602858695f03638d1524f",
"score": "0.66277975",
"text": "def isValidUser? newuser\n #hack\n case \n \n when params[:txtuid].nil?\n return \"Error: Please enter the password\" \n\n when params[:txtpswd].nil?\n return \"Error: Please enter the password\" \n \n when newuser.nil? \n return \"Error: Invalid user id\"\n\n when newuser.password != params[:txtpswd]\n return \"Error: Invalid user id or password\" \n \n else\n return \"Success\" \n end\n \n end",
"title": ""
},
{
"docid": "d44d5d20caa3fc92e4f2609521f98074",
"score": "0.6613312",
"text": "def match_password(login_password=\"\")\n encrypted_password == Digest::SHA1.hexdigest(login_password)\n end",
"title": ""
},
{
"docid": "79fa0eac518109784dd9fbb6c5e94b2e",
"score": "0.660806",
"text": "def error_for_credentials(username, password)\n if !(4..16).cover? username.size\n 'Username must be between 4 and 16 characters.'\n elsif !(username =~ /\\A\\w+\\z/)\n 'Usernameame must only alphanumeric characters.'\n elsif usernames.include? username\n \"Sorry, #{username} is already taken.\"\n elsif !(8..16).cover? password.size\n 'Password must be between 8 and 16 characters.'\n end\nend",
"title": ""
},
{
"docid": "8a7fe1b30efc9d365aed2facabfb6d50",
"score": "0.6599506",
"text": "def not_including_username?(password, username)\n !password.downcase.include?(username)\nend",
"title": ""
},
{
"docid": "f425709043511df0c2242dd611d909fd",
"score": "0.65897286",
"text": "def authenticate pass\n valid_password? pass\n end",
"title": ""
},
{
"docid": "e6efa37fc8820043ab506d2966a95e64",
"score": "0.6580747",
"text": "def check_create_user_password_is_valid\n return self.password != \"\" ? true : false\n end",
"title": ""
},
{
"docid": "9fbf960f6fa7ed325f37016381a71822",
"score": "0.656723",
"text": "def login_valid\n valid = User.login_regex.match(params[:username])\n if valid\n login_available\n else\n return error({'login' => 'username not valid'})\n end\n end",
"title": ""
},
{
"docid": "1de24c55765a6faa75d81a2dad712f9a",
"score": "0.65664905",
"text": "def requires_login?\n !!!(self.username.blank? && self.password.blank?)\n end",
"title": ""
},
{
"docid": "1de24c55765a6faa75d81a2dad712f9a",
"score": "0.65664905",
"text": "def requires_login?\n !!!(self.username.blank? && self.password.blank?)\n end",
"title": ""
},
{
"docid": "4c275f0921c1570d37b1b1e6181bdec4",
"score": "0.6566216",
"text": "def same (userId, password)\n if userId==password\n puts \"True\"\n\n else\n puts \"False\"\n\n end\nend",
"title": ""
},
{
"docid": "a203d64465411a1df801f68bd4e57775",
"score": "0.65652645",
"text": "def create\n temp = User.find_by_username(params[:username])\n if temp.nil?\n User.create!({username: params[:username], password: Digest::SHA256.hexdigest(params[:password]), is_admin: false})\n render json: {status: \"User Created\"}\n else\n render json: {status: \"That username is already taken please try another one\"}, status: 400\n end\n end",
"title": ""
},
{
"docid": "49d97a0f5c0dc6eb4bef89c21990d998",
"score": "0.65645295",
"text": "def validate\n\t\tif (params[\"user\"].empty?)\n\t\t\treturn ERR_BAD_USERNAME\n\t\tend\n\n\t\tif (params[\"user\"].length > MAX_USERNAME_LENGTH)\n\t\t\treturn ERR_BAD_USERNAME\n\t\tend\n\n\t\tif (params[\"password\"].length > MAX_PASSWORD_LENGTH)\n\t\t\treturn ERR_BAD_PASSWORD\n\t\tend\n\n\t\treturn SUCCESS\n\tend",
"title": ""
},
{
"docid": "631189bb3054a8d71e1001bdadb030fd",
"score": "0.6551685",
"text": "def unique_identifier\n Digest::SHA1.hexdigest(\"#{user_name}:#{password}\")\n end",
"title": ""
},
{
"docid": "766e965a19f95c169589c68a6c50b71b",
"score": "0.6538701",
"text": "def unique_identifier\n Digest::SHA1.hexdigest(\"#{username}:#{password}\")\n end",
"title": ""
},
{
"docid": "7470fe5e242fccf3f483c88c1d13b271",
"score": "0.6531831",
"text": "def validate_registry(username, password, repeat_password, name)\n if empty_or_whitespace?(username, password, name)\n raise EmptyField, 'Моля, попълнете всички полета'\n end\n raise PasswordFailure, 'Грешна парола' if password != repeat_password\n if not is_username_available(username)\n raise UsernameDuplicate,\n 'Вече има потребител с такова потребителско име'\n end\n end",
"title": ""
},
{
"docid": "1f4db89f522729b2de2806782b4a50a7",
"score": "0.6530335",
"text": "def username_check\n @username = params[:username]\n\n # Checks to make sure the username does not include special characters or spaces\n def username_chars()\n (@username =~ /[!#\\$]/).nil? #nil means there are none of those characters in the username\n end\n username_chars\n end",
"title": ""
},
{
"docid": "2cfc29fadccf0e8f831fc18160ffec37",
"score": "0.65263355",
"text": "def validate_password?; true; end",
"title": ""
},
{
"docid": "88a7ea0f39c9b84af98b9e75c45060c1",
"score": "0.6522982",
"text": "def valid_password?(password)\n true\n end",
"title": ""
},
{
"docid": "a7e4dc9c947c81cbd62d6e55b01eb7c7",
"score": "0.6521354",
"text": "def same(user_id, password)\n if user_id == password\n 'True'\n else\n 'False'\n end\nend",
"title": ""
},
{
"docid": "1e94e5be96a03467fe1f47765b48e824",
"score": "0.65200335",
"text": "def valid_credentials?(username, password)\n users = load_user_credentials\n\n hashed_p = BCrypt::Password.new users[username] if users[username]\n hashed_p && hashed_p == password\nend",
"title": ""
},
{
"docid": "d2104e40f2f8e3889fae9bc75663002f",
"score": "0.6504644",
"text": "def username_is_valid\n if self.username == nil; errors.add(:username, \"The username was not set.\");return; end\n if not self.username.instance_of? String; errors.add(:username, \"The username should be a string.\");return;end\n if self.username.length < 3 then\n errors.add(:username, \"The username must be at least three characters long.\")\n end\n user = User.find_by_username self.username\n if user and user != self\n errors.add(:username, \"The username already exists in the database.\")\n return false\n end\n return true\n end",
"title": ""
},
{
"docid": "5cb3eef5c0aae399b071824182e581f3",
"score": "0.65033996",
"text": "def do_register\n\n username = params[:username]\n userpassword = params[:userpassword]\n password = params[:repeatpassword]\n if userpassword == '' || username == '' || password == '' then\n @warning = \"* The following can't be empty !\"\n render \"register\"\n elsif userpassword != password\n @warning = \"* Two input password is inconsistent!\"\n render \"register\"\n elsif User.find_by_username(username)\n @warning = \"* The username already exists!!\"\n render \"register\"\n else\n @user = User.new\n @user.username = username\n @user.userpassword = userpassword\n @user.save!\n session[:username] = username\n redirect_to(:controller => 'messages', :action => 'index')\n end\n\n end",
"title": ""
},
{
"docid": "81090f82b23b522b0d19e35f5e76fcc8",
"score": "0.64982015",
"text": "def is_password?(secret); end",
"title": ""
},
{
"docid": "55f025a9a79577e963e0ab1b1132d893",
"score": "0.6486273",
"text": "def no_user_name?(password, user_name)\n !password.include?(user_name)\n end",
"title": ""
},
{
"docid": "9e5b7a276ec4a890aa34379f227dec66",
"score": "0.6485568",
"text": "def password_required?; end",
"title": ""
},
{
"docid": "18eada37ca53925df45134f5016ec38f",
"score": "0.6484425",
"text": "def authenticate?(input)\r\n input == self.password\r\n end",
"title": ""
},
{
"docid": "39c9ddbc10d441d1b4d59fa5faf2863f",
"score": "0.6476917",
"text": "def valid_user\n { :login => 'vito',\n :password => 'MakeHimAnOffer',\n :password_confirmation => 'MakeHimAnOffer' }\nend",
"title": ""
},
{
"docid": "5ceeec2a1d9cc6e3f1fa1cb81bb5d68d",
"score": "0.64747953",
"text": "def validate_user_pass(username, password)\n @call_back.call(username, password)\n end",
"title": ""
},
{
"docid": "cbd3101fab30cdbe3350481d34f262bc",
"score": "0.6466494",
"text": "def check_password(uname,psswd)\n User.all(:conditions => [\"upper(name) = ? and password = ?\", uname.upcase, psswd]).count > 0\nend",
"title": ""
},
{
"docid": "350845e4d13982936795f8f550d7672f",
"score": "0.6455477",
"text": "def credentials_valid?\n fromUsers = User.new\n u = fromUsers.get_user_table\n for i in 0...u.count\n validUsername = u[i][1]\n validPassword = u[i][2]\n value = (@enterUsername == validUsername) && (@enterPassword == validPassword)\n if value == true\n token = 1\n end\n end\n token == 1\n end",
"title": ""
},
{
"docid": "4a7fd57faaaa99429abd169d2825471e",
"score": "0.64405644",
"text": "def authenticate\r\n password.blank? and fail \"パスワードがありません.\"\r\n account = Account.find :first,\r\n :scope => :self,\r\n :assert_time => DateTime.now, # real present time\r\n :select => \"id, passwd, salt\" ,\r\n :conditions => {:name => name}\r\n account && account.verify_password(password) ? account : fail(\"アカウント・パスワードが無効です.\")\r\n end",
"title": ""
},
{
"docid": "be8b8eedae38fc33bf9b2ae1aed1adc9",
"score": "0.6439931",
"text": "def member_login\n if params[:loginname] =~ /\\A([^@\\s]+)@((?:[-a-z0-9]+\\.)+[a-z]{2,})\\z/i\n @user = User.find_by_email(params[:loginname])\n judge_user(\"email\")\n else\n @user = User.find_by_username(params[:loginname])\n if @user.nil?\n @user = User.find_by_domain(params[:loginname])\n judge_user(\"domain\")\n elsif @user.passwd == Digest::SHA1.hexdigest(params[:passwd])\n login_now\n else\n @user = User.find_by_domain(params[:loginname])\n if @user.nil?\n flash[:error] = t'login.username_exist_password_wrong'\n go_redirect\n elsif @user.passwd == Digest::SHA1.hexdigest(params[:passwd])\n login_now\n else\n flash[:error] = t'login.user_exist_password_wrong'\n go_redirect\n end\n end\n end\n end",
"title": ""
},
{
"docid": "5e4aa881ca94044ba44a0ebdb63f963e",
"score": "0.64375246",
"text": "def unique_identifier\n Digest::SHA1.hexdigest(\"#{login}:#{password}\")\n end",
"title": ""
},
{
"docid": "b0aa3e9c9efd07fec19e013049d87c19",
"score": "0.6426449",
"text": "def valid_password?(password)\n self.password == password\n end",
"title": ""
},
{
"docid": "7922c2fbbc2d83c08007c22740921abe",
"score": "0.6425538",
"text": "def Check(username, password)\n=begin Legacy Code Block\n table = @logindb.Load() # Load the table. We really need something that does this and the next line in one and more efficiently\n usernameID = table.each_index.select {|id| table[id][:username] == username } # should be a length=1 array\n # entry = table[usernameID[0]] # Get the actual entry\n=end\n\t\tentry = @logindb.LoadSingleByVar(:username, username)\n correct = entry[:processed] # the correct salted + hashed password\n salt = entry[:salt] # the salt\n input = Digest::SHA256.hexdigest(password+salt) # the processed password the user is using\n \n if input == correct\n return entry[:id] # the user ID\n end\n end",
"title": ""
},
{
"docid": "2134be020829eed1a7a37a34d796a060",
"score": "0.6425468",
"text": "def invalid_signup_credentials?(username, password)\n credentials = load_user_credentials\n requests_path = File.expand_path(\"../requests.yml\", __FILE__)\n requests = YAML.load_file(requests_path)\n \n if credentials.key?(username) || requests.key?(username)\n :exists\n elsif password.size < 6\n :bad_password\n elsif username.size < 3\n :bad_username\n else\n false\n end\nend",
"title": ""
},
{
"docid": "0dfa084e1625536a885b547f5851e210",
"score": "0.6415361",
"text": "def authenticate_user(username,password)\n user = User.find_by_email params[:username]\n if user && user.valid_password?(params[:password])\n user\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "408fdf018ecbd78a510eec5699901f52",
"score": "0.6404695",
"text": "def verify_password(password)\n password == \"password\"\n end",
"title": ""
},
{
"docid": "bf435bd6254a270ff4cc8ae1907f44b4",
"score": "0.6397777",
"text": "def check_username\n if !self.new_record?\n if self.username.nil? || self.username.blank?\n errors.add(:username, \"can't be blank\")\n return\n end\n if self.username.start_with?(\"_\") || self.username.start_with?(\"-\") || !/^[A-Za-z].*/.match(self.username)\n errors.add(:username, \"must start with a letter\")\n end\n end\n end",
"title": ""
},
{
"docid": "3219cff8898680b690a59b6d53a5be67",
"score": "0.6394463",
"text": "def username_verified?\n self.username && self.username !~ TEMP_USERNAME_REGEX\n end",
"title": ""
},
{
"docid": "58187d93b52e9314aef003471ab8106a",
"score": "0.6390462",
"text": "def username_exists? #Checks that username exists\n if self.username == nil || self.username == \"\"\n signup_error = \"You must enter a username.\"\n self.class.add_signup_error(signup_error)\n false\n else\n true\n end\n end",
"title": ""
},
{
"docid": "69e719b7b53ba794aeea3f6c63858ecf",
"score": "0.6389626",
"text": "def check_for_password_string?(password)\n !password.downcase.include?(\"password\")\nend",
"title": ""
},
{
"docid": "0177f58077c56d7f436a60b58c68f800",
"score": "0.6385931",
"text": "def password_check\n @password = params[:password]\n # Checks to ensure that the password does not include the word 'password' and ensures it contains at least 1 special character.\n def password_chars\n @password.downcase != \"password\" || !(@password=~/[!#\\$][0-9][a-z][A-Z]/).nil?\n end\n password_chars\n\n end",
"title": ""
},
{
"docid": "0d50d7d7bae3de7c5b801c5b5ccf221c",
"score": "0.6384693",
"text": "def username_validation(username)\n validation = db.execute(\"SELECT username FROM users WHERE username = (?)\", username)\n return validation\nend",
"title": ""
},
{
"docid": "b00a9d2b8324af182e220cc7c4b89c97",
"score": "0.6380145",
"text": "def authenticate(input_password)\n self.password == input_password\n end",
"title": ""
},
{
"docid": "46bcb68afd79d6d57c5af801999dda51",
"score": "0.63771164",
"text": "def contains_username?(username, password)\n !!(password =~ /#{username}/i)\n end",
"title": ""
},
{
"docid": "bd036bc4e235add9535206a2a5f22851",
"score": "0.6375387",
"text": "def authenticate(email, password)\n if self.email == email && self.password == password\n true\n else\n puts 'wrong password'\n end\n end",
"title": ""
},
{
"docid": "b71c89d0ce9e64a4afd32a3b33cae57a",
"score": "0.63744205",
"text": "def randomise_credentials\n begin\n self.username = SecureRandom.base64(10)\n end while self.class.exists?(:username => username)\n self.password = SecureRandom.base64(10)\n end",
"title": ""
},
{
"docid": "4bb1c854202225d57835d366891a84f4",
"score": "0.6371329",
"text": "def user_credentials_valid?(username = \"\", password = \"\")\n\t\treturn false if /\\A\\p{Alnum}{3,}\\Z/.match(username).nil?\n\t\treturn false if /\\A\\p{Alnum}{6,}\\Z/.match(password).nil?\n\n\t\ttrue\n\tend",
"title": ""
},
{
"docid": "9e3c340dce4e7fb5a17bb942c73555a4",
"score": "0.63710475",
"text": "def authenticate?(email, txt_password)\n self.email == email && self.password == txt_password\n end",
"title": ""
},
{
"docid": "7b748aefe264396f250c188c6502d37f",
"score": "0.6367793",
"text": "def does_user_exist(username)\n !get_user_by_username(username.to_s).nil?\nend",
"title": ""
},
{
"docid": "ff9e833f6d7d7c1824fc41d7fe7b1112",
"score": "0.63625747",
"text": "def authenticate(password)\n true\n end",
"title": ""
},
{
"docid": "7785650f9b3e0388fa5dc7767e9dd12d",
"score": "0.6361856",
"text": "def logged_in?(pass)\n password == pass\n end",
"title": ""
},
{
"docid": "6b10412b75632977e7d86c45750460c5",
"score": "0.6359228",
"text": "def password_match?(password)\n \tself.password == Digest::SHA2.hexdigest(password)\n end",
"title": ""
},
{
"docid": "acd956c2efd59aace3e67be361a770ea",
"score": "0.6355061",
"text": "def ensure_customers_with_same_username_have_different_passwords \n # errors.delete(:password)\n if Customer.where(:name=>self[:name]).exists?\n if Customer.where(:password=>self[:password]).exists?\n errors.add(:password,\" - Enter different password.User with same username and password already exists\")\n else\n errors.delete(:password)\n end\n else\n errors.delete(:password)\n end\n end",
"title": ""
},
{
"docid": "47c480fc19c05b5b0412bd229078ed23",
"score": "0.6352331",
"text": "def auth(input_password) # Can mot doi tuong tro vao, Ex: visitor.auth()\n self.password == input_password\n end",
"title": ""
},
{
"docid": "9e8892ea479b5a18f5a463ce31cd6899",
"score": "0.6345523",
"text": "def needs_password?(user, params)\n false\n end",
"title": ""
},
{
"docid": "fa1cbbe48b47b7e857bd7f7d0a18d9e4",
"score": "0.634264",
"text": "def gen_invalid_username\n\t\t\"afbhj23712fbbzziof@gmail.com\"\n\tend",
"title": ""
},
{
"docid": "ddbae1c1f1565af25562e57345cce4a0",
"score": "0.6324326",
"text": "def password_blank?\n params[:author][:password].blank?\n end",
"title": ""
},
{
"docid": "2648c78cffc231d0496eaea739eb3c2f",
"score": "0.6324261",
"text": "def auth_by_username\n @user ||= User.find_by(username: params[:user][:username])\n if !@user.present? || !@user.authenticate(params[:user][:password])\n @user = User.new\n @user.errors[:base] << \"Your login credentials were invalid. Please try again.\"\n end\n end",
"title": ""
},
{
"docid": "31af9571ee92fd4737b55a822fb9275a",
"score": "0.6323993",
"text": "def check_user_credentials(username,password)\n user = get_user_by_username(username)\n return nil if !user\n hp = hash_password(password,user['salt'])\n (user['password'] == hp) ? [user['auth'],user['apisecret']] : nil\nend",
"title": ""
},
{
"docid": "31af9571ee92fd4737b55a822fb9275a",
"score": "0.6323993",
"text": "def check_user_credentials(username,password)\n user = get_user_by_username(username)\n return nil if !user\n hp = hash_password(password,user['salt'])\n (user['password'] == hp) ? [user['auth'],user['apisecret']] : nil\nend",
"title": ""
},
{
"docid": "5f926e45c0d15a1c7b60ae95abe36615",
"score": "0.63226706",
"text": "def authenticate(login, pass)\n return false if login.empty? or pass.empty?\n \n if login == \"test.user\" and pass == \"password\"\n return true\n else\n return false\n end\n \n end",
"title": ""
},
{
"docid": "d39178b0acde93c234fb3cd09ce16c56",
"score": "0.63218653",
"text": "def login(password)\n \treturn self.password == password\n end",
"title": ""
},
{
"docid": "d39178b0acde93c234fb3cd09ce16c56",
"score": "0.63218653",
"text": "def login(password)\n \treturn self.password == password\n end",
"title": ""
},
{
"docid": "45f21a45ecfa9b4c5c5ed6624d2fb8c2",
"score": "0.6319141",
"text": "def autentificado?(atributo, token) \t### authenticated? ###\n\t\tdigestion = send(\"#{atributo}_digest\") \t# self.send == send\n\t\treturn false if digestion.nil?\n\t\tBCrypt::Password.new(digestion).is_password?(token)\n\tend",
"title": ""
},
{
"docid": "f110a9cba9cda7f36895ffe5df7e1cfa",
"score": "0.63152444",
"text": "def basic_authed?\n (login? && password?)\n end",
"title": ""
},
{
"docid": "6c9a4fa3dc67cfbed5e2cb36b9f5c2ee",
"score": "0.63137835",
"text": "def exist?\n return false unless @id\n super(username: user.username, password: user.password)\n end",
"title": ""
},
{
"docid": "e06110a71e6502a54905d96c43a45156",
"score": "0.6313714",
"text": "def validate_password?\n password.present? || new_record?\n end",
"title": ""
},
{
"docid": "6f398155fbd1bc3d5baae76ac536cdc2",
"score": "0.63064986",
"text": "def auth(password); end",
"title": ""
},
{
"docid": "0cb0b7a0495f076054b81ef5cc587add",
"score": "0.63038695",
"text": "def ask_username(username)\n if username =~ /^[a-z0-9_]+$/\n puts \"Valid username\"\n else\n puts \"Invalid username\"\n end\nend",
"title": ""
},
{
"docid": "0f26262f395b88d123d59c623bc26560",
"score": "0.63020355",
"text": "def valid_credentials?(username, pswd)\n # use a hsh to hold username:pswd combos\n # username == \"admin\" && pswd == \"secret\" becomes\n # users = { \"admin\" => \"secret\" } # default\n users = get_users\n\n # chk that the username exists (to prevent matching a default hsh value)\n # should look for a single exact match between the usename and the hashed pswd\n # should log whether more than one pswd exists for a given user,\n # or whether the username:pswd combo appears > 1x\n # users.key?(username) && users.one? { |key, value| key == username && value == pswd }\n # users.key?(username) && users.one? { |key, value| key == username && valid_pswd?(value, pswd) }\n users.key?(username) && valid_pswd?(users[username], pswd) # shortened for simplicity\nend",
"title": ""
},
{
"docid": "fa898c6e8e385dc6607662618163687b",
"score": "0.62941784",
"text": "def login(username, password)\n unless empty_or_whitespace?(username, password)\n encrypted_password = Digest::SHA1.hexdigest(password)\n if exists?(:username => username, :password => encrypted_password)\n update(id_from_username(username), :login => true)\n return true\n end\n end\n false\n end",
"title": ""
},
{
"docid": "6d568033b91950baf6461340d55e4cdd",
"score": "0.6292799",
"text": "def password?\n password.present?\n end",
"title": ""
},
{
"docid": "90e633cced46668f05e523c0a66fba96",
"score": "0.6291781",
"text": "def username_check\n username = params[:username]\n myname = ''\n \n if current_user\n myname = current_user.username\n end\n \n #check validation\n testuser = User.new(\n username: username,\n email: '__anonymous@__self.com',\n uid: '__anonymoususer',\n provider: '__self'\n )\n testuser.valid?\n if testuser.errors.messages.has_key?(:username)\n message = 'invalid'\n end\n \n # check username exists\n if User.exists?( :username => username)\n if myname == username\n message = 'you'\n else\n message = 'exists'\n end\n else\n if message != 'invalid'\n message = 'available'\n end\n end\n \n result = {\"message\": message}.to_json\n \n render plain: result\n end",
"title": ""
}
] |
c7508473f7c9431d0368b154d0f0e944
|
everything has to be filled so that a hh_attribute can be created
|
[
{
"docid": "5e6343938aea40f399b7b1cb4ea6b9c3",
"score": "0.0",
"text": "def everything_present?\n !everything_blank?\n end",
"title": ""
}
] |
[
{
"docid": "9960d8986d18f271038e822322af7ee5",
"score": "0.6365967",
"text": "def initialize\r\n @hatched_hours = 0\r\n end",
"title": ""
},
{
"docid": "aabe7629980112682b1d82c8c12d59e3",
"score": "0.6338359",
"text": "def initialize\n @hatched_hours=0\n end",
"title": ""
},
{
"docid": "5d829e058530efdc30c0b503cf544408",
"score": "0.6255654",
"text": "def initialize(hsh = {}, options={})\n @_attributes = Hash.new{|hash, key| hash[key] = {}}\n hsh.each_pair do |key, value|\n if self.class.attributes.has_key?(key.intern)\n @_attributes[key.intern][:value] = value\n @_attributes[key.intern][:dirty?] = options[:dirty].nil? ? true : options[:dirty]\n else\n raise WrongModelInitialization, \"Can`t initialize Model with attribute - #{key} ,that are not described in Model definition.\"\n end\n end\n end",
"title": ""
},
{
"docid": "4b796430093f834a2022139191f1f544",
"score": "0.61489105",
"text": "def hour_metrics=(_arg0); end",
"title": ""
},
{
"docid": "0005a79dceefafd0993c88844f0667cc",
"score": "0.6124135",
"text": "def set_attr_accessor\n if self.start_time_hour.blank?\n prev_start_time_hour = self.start_agenda_time.strftime('%l').strip.rjust(2, '0') rescue nil\n self.start_time_hour = prev_start_time_hour.blank? ? \"00\" : prev_start_time_hour\n end\n \n if self.start_time_minute.blank?\n prev_start_time_minute = self.start_agenda_time.strftime('%M').strip.rjust(2, '0') rescue nil\n self.start_time_minute = prev_start_time_minute.blank? ? \"00\" : prev_start_time_minute\n end\n\n if self.start_time_am.blank?\n prev_start_time_am = self.start_agenda_time.strftime('%p') rescue \"AM\"\n self.start_time_am = prev_start_time_am.blank? ? \"AM\" : prev_start_time_am\n end\n\n if self.end_time_hour.blank?\n prev_end_time_hour = self.end_agenda_time.strftime('%l').strip.rjust(2, '0') rescue nil\n self.end_time_hour = prev_end_time_hour.blank? ? \"\" : prev_end_time_hour\n end\n\n if self.end_time_minute.blank?\n prev_end_time_minute = self.end_agenda_time.strftime('%M').strip.rjust(2, '0') rescue nil\n self.end_time_minute = prev_end_time_minute.blank? ? \"\" : prev_end_time_minute\n end\n\n if self.end_time_am.blank?\n prev_end_time_am = self.end_agenda_time.strftime('%p') rescue \"PM\"\n self.end_time_am = prev_end_time_am.blank? ? \"\" : prev_end_time_am\n end \n\n end",
"title": ""
},
{
"docid": "3211609a106d3a692bde3e93893238bc",
"score": "0.5951191",
"text": "def initialize(type=1)\n @hours=24\n hour=WORKING_HOUR if type==1\n hour=RESTING_HOUR if type==0\n @values=Array.new(@hours) {|index| hour }\n\n set_attributes\n end",
"title": ""
},
{
"docid": "3e340884163b5ae79fe1712de9d84778",
"score": "0.5934536",
"text": "def hour=(value); end",
"title": ""
},
{
"docid": "5e7f2d9f99770d86da3c0eee9d273020",
"score": "0.5933884",
"text": "def __attribute_object_initialize(h, value)\n __attribute_object_get(h).__overwrite_value(value)\n end",
"title": ""
},
{
"docid": "741491d4d075a215954e2d2e9c28a8e5",
"score": "0.59073293",
"text": "def setRequiredAttributes(composite,hash)\n # Verify we have a note attached\n if composite.getNote() != nil\n hash[\"description\"] = \"#{composite.getNote().getText()}\" \n else\n hash[\"description\"] = \"\"\n end\n \n # Verify we have a display name attached\n if composite.getDisplayName() != nil\n hash[\"display_name\"] = \"#{composite.getDisplayName()}\" \n else\n hash[\"display_name\"] = \"\"\n end\n \n hash[\"enabled\"] = \"#{composite.getEnabled()}\" \n\n end",
"title": ""
},
{
"docid": "8834420f53fae27088891ce1c3acb885",
"score": "0.5903947",
"text": "def set_attributes\n @first_hour=nil\n @first_min=nil\n @last_hour=nil\n @last_min=nil\n @total=0\n 0.upto(@hours-1) {|index|\n @first_hour=index if ((@first_hour.nil?) && (@values[index].wp_total!=0))\n @first_min=@values[index].wp_first if ((@first_min.nil?) && (!@values[index].wp_first.nil?)) \n @last_hour=index if (@values[index].wp_total!=0)\n @last_min=@values[index].wp_last if (@values[index].wp_total!=0)\n @total+=@values[index].wp_total\n }\n end",
"title": ""
},
{
"docid": "5a91b3bab1ebf0acf20a84c792cf0b6d",
"score": "0.5878528",
"text": "def valid_attributes\n {\n :name => 'cs169', :group_type => 1, :hour_limit => 20, :description => 'cs169', :created_at => '2012-04-22T00:00:00Z', :unit => true\n }\n end",
"title": ""
},
{
"docid": "59fee827f36287b9d1ad2d2a56ebbc67",
"score": "0.5870592",
"text": "def hour_metrics; end",
"title": ""
},
{
"docid": "1111ac75c4592527ae2df5d9081b6f46",
"score": "0.58509785",
"text": "def has_time_attributes attribute_list\n attribute_list = attribute_list.map { |attribute_name| attribute_name.to_s.freeze }\n attr_accessor *attribute_list\n self.attribute_list += attribute_list\n self.time_attribute_list += attribute_list\n end",
"title": ""
},
{
"docid": "fe0a8caf6ce93379f6c4c687f9bcbe9f",
"score": "0.58427244",
"text": "def make_attributes(hsh)\n unless hsh.nil?\n output = \"\"\n hsh.each do |key, val|\n output << \" #{key}=\\\"#{val}\\\"\"\n end\n end\n output\n end",
"title": ""
},
{
"docid": "a2cfecf95632d674e6cfb22f343b9060",
"score": "0.58413",
"text": "def initialize h\n self.update h\n\n self[\"units\"] = @@units[self[\"type\"]]\n self[\"formatted_value_with_units\"] = \"#{@@formats[self['type']]}%s\" % [\n self[\"value\"],\n self[\"units\"]\n ]\n end",
"title": ""
},
{
"docid": "b29e6cc6cacc2d98aa90afbb0a834c95",
"score": "0.5821968",
"text": "def valid_attributes\n { :title => 'TestTitle', :workType => 'TestWorkType', :subTitle => Time.now.nsec.to_s }\n end",
"title": ""
},
{
"docid": "1680d85468c8bdfea85d1ba27c83f2a4",
"score": "0.5820382",
"text": "def add_attrs(h)\n h.map { |k, v| self.goals[k.to_s.singularize].add_attrs v rescue nil }\n end",
"title": ""
},
{
"docid": "c07d77af7fdbd2609440e2bc876d0136",
"score": "0.5814886",
"text": "def hh_params\n params.require(:hh).permit(:name)\n end",
"title": ""
},
{
"docid": "a84c741a90cfaf70312e4ad0fa8f89b1",
"score": "0.58010817",
"text": "def attribute_values \n @attribute_values = Hash.new\n @attribute_values[:name] = \"Name: \" + self.first_name.to_s + \" \" + self.last_name.to_s\n @attribute_values[:phone]= \"Phone: \"+self.phone.to_s\n @attribute_values[:birthday] = \"Birthday: \" + self.month_ofbirth.to_s + \" / \" + self.day_ofbirth.to_s + \" / \" + self.year_ofbirth.to_s \n @attribute_values[:gender] = \"Gender: \" + self.gender.to_s\n @attribute_values[:location] = \"Location: \" + self.city.to_s + \", \" + self.state.to_s + \", \" + self.country.to_s\n @attribute_values[:compensation] = \"Compensation: \" + self.compensation.to_s \n @attribute_values[:facebook_link] = \"Facebook: \" + self.facebook_link.to_s\n @attribute_values[:linkedIn_link] = \"LinkedIn: \" + self.linkedIn_link.to_s\n @attribute_values[:instagram_link] = \"Instagram: \" + self.instagram_link.to_s\n @attribute_values[:personalWebsite_link] = \"Personal website: \" + self.personalWebsite_link.to_s\n @attribute_values[:bio] = \"Biography: \" + self.bio.to_s\n @attribute_values\n end",
"title": ""
},
{
"docid": "860bd8cee4a31113483c5b5f7abced75",
"score": "0.5790563",
"text": "def initialize_time_hash\n time = {}\n (0..23).each do |hr|\n time[\"#{hr}:00 - #{hr+1}:00\"] = 0\n end\n time\n end",
"title": ""
},
{
"docid": "7d59d6ee104c0dd48131c119c9640d3c",
"score": "0.5781805",
"text": "def _h(prefix, attr, *args)\n\n options = args.extract_options!\n actual_attr = options.delete(:attribute) || attr\n args << options unless options.empty?\n\n instance_variable_set :\"@#{attr}_h_options\", args\n\n class_eval do\n\n if table_exists? && columns.detect{|c| c.name == actual_attr.to_s}\n validates_each actual_attr do |record, attr_name, value|\n if attr_name.to_s==actual_attr.to_s && record.send(:\"#{attr}_h_invalid?\")\n record.errors.add :\"#{attr}_h\"\n end\n end\n end\n\n if attr != actual_attr\n define_method :\"#{attr}\" do\n self.send :\"#{actual_attr}\"\n end\n define_method :\"#{attr}=\" do |v|\n self.send :\"#{actual_attr}=\", v\n end\n end\n\n if method_defined?(:\"#{actual_attr}=\")\n define_method :\"#{actual_attr}_with_#{prefix}_h=\" do |v|\n send :\"#{actual_attr}_without_#{prefix}_h=\", v\n instance_variable_set \"@#{attr}_h\", nil\n end\n alias_method_chain :\"#{actual_attr}=\", :\"#{prefix}_h\"\n else\n define_method :\"#{actual_attr}=\" do |v|\n write_attribute actual_attr, v\n instance_variable_set \"@#{attr}_h\", nil\n end\n end\n\n # attr_h\n define_method :\"#{attr}_h\" do\n unless (instance_variable_defined? \"@#{attr}_h\") && (h=instance_variable_get(\"@#{attr}_h\")) && instance_variable_get(\"@#{attr}_h_locale\")==I18n.locale\n h = H.send(:\"#{prefix}_to\", send(attr), *self.class.instance_variable_get(:\"@#{attr}_h_options\"))\n instance_variable_set \"@#{attr}_h\", h\n instance_variable_set \"@#{attr}_h_locale\", I18n.locale\n end\n h\n end\n\n # attr_h=(txt)\n define_method :\"#{attr}_h=\" do |txt|\n instance_variable_set \"@#{attr}_h_invalid\", false\n unless txt.blank?\n begin\n v = H.send(:\"#{prefix}_from\", txt, *self.class.instance_variable_get(:\"@#{attr}_h_options\"))\n rescue\n v = nil\n end\n instance_variable_set \"@#{attr}_h_invalid\", true if v.nil?\n end\n send :\"#{attr}=\", v\n instance_variable_set \"@#{attr}_h\", txt\n instance_variable_set \"@#{attr}_h_locale\", I18n.locale\n end\n\n # attr_h? (returns true if it is valid and not blank)\n define_method :\"#{attr}_h?\" do\n !instance_variable_get(\"@#{attr}_h_invalid\") && send(:\"#{attr}_h\")\n end\n\n # attr_h_invalid?\n define_method :\"#{attr}_h_invalid?\" do\n instance_variable_get \"@#{attr}_h_invalid\"\n end\n\n # attr_h_valid?\n define_method :\"#{attr}_h_valid?\" do\n !instance_variable_get \"@#{attr}_h_invalid\"\n end\n\n end\n\n end",
"title": ""
},
{
"docid": "45faed18b06c026c4286190392741f82",
"score": "0.57546234",
"text": "def attribute_values \n @attribute_values = Hash.new\n @attribute_values[:height] = \"Height: \" + self.height_feet.to_s + \" ft. \" + self.height_inches.to_s + \" in.\"\n @attribute_values[:bust] = \"Bust size: \" + self.bust.to_s + \" in.\"\n @attribute_values[:waist] = \"Waist size: \" + self.bust.to_s + \" in.\"\n @attribute_values[:hips] = \"Hips size: \" + self.hips.to_s + \" in.\"\n @attribute_values[:cups] = \"Cup size: \" + self.cups.to_s\n @attribute_values[:shoe_size] = \"Shoe size: \" + self.shoe_size.to_s\n @attribute_values[:dress_size] = \"Dress size: \" + self.dress_size.to_s\n @attribute_values[:hair_color] = \"Hair color: \" + self.hair_color.to_s\n @attribute_values[:eye_color] = \"Eye color: \" + self.eye_color.to_s\n @attribute_values[:ethnicity] = \"Ethnicity: \" + self.ethnicity.to_s\n @attribute_values[:skin_color] = \"Skin color: \" + self.skin_color.to_s\n @attribute_values[:shoot_nudes] = \"Shoots nudes: \" + self.shoot_nudes.to_s\n @attribute_values[:tattoos] = \"Has tattoos: \" + self.tattoos.to_s\n @attribute_values[:piercings] = \"Piercings: \" + self.piercings.to_s\n @attribute_values[:experience] = \"Experience: \" + self.experience.to_s\n \n @attribute_values[:genre] = \"Genre: \"\n if self.genre != nil\n self.genre.split(\",\").each do |genre|\n @attribute_values[:genre] += genre + \", \"\n end\n @attribute_values[:genre] = @attribute_values[:genre][0, @attribute_values[:genre].length-2]\n end\n \n @attribute_values\n end",
"title": ""
},
{
"docid": "45faed18b06c026c4286190392741f82",
"score": "0.57546234",
"text": "def attribute_values \n @attribute_values = Hash.new\n @attribute_values[:height] = \"Height: \" + self.height_feet.to_s + \" ft. \" + self.height_inches.to_s + \" in.\"\n @attribute_values[:bust] = \"Bust size: \" + self.bust.to_s + \" in.\"\n @attribute_values[:waist] = \"Waist size: \" + self.bust.to_s + \" in.\"\n @attribute_values[:hips] = \"Hips size: \" + self.hips.to_s + \" in.\"\n @attribute_values[:cups] = \"Cup size: \" + self.cups.to_s\n @attribute_values[:shoe_size] = \"Shoe size: \" + self.shoe_size.to_s\n @attribute_values[:dress_size] = \"Dress size: \" + self.dress_size.to_s\n @attribute_values[:hair_color] = \"Hair color: \" + self.hair_color.to_s\n @attribute_values[:eye_color] = \"Eye color: \" + self.eye_color.to_s\n @attribute_values[:ethnicity] = \"Ethnicity: \" + self.ethnicity.to_s\n @attribute_values[:skin_color] = \"Skin color: \" + self.skin_color.to_s\n @attribute_values[:shoot_nudes] = \"Shoots nudes: \" + self.shoot_nudes.to_s\n @attribute_values[:tattoos] = \"Has tattoos: \" + self.tattoos.to_s\n @attribute_values[:piercings] = \"Piercings: \" + self.piercings.to_s\n @attribute_values[:experience] = \"Experience: \" + self.experience.to_s\n \n @attribute_values[:genre] = \"Genre: \"\n if self.genre != nil\n self.genre.split(\",\").each do |genre|\n @attribute_values[:genre] += genre + \", \"\n end\n @attribute_values[:genre] = @attribute_values[:genre][0, @attribute_values[:genre].length-2]\n end\n \n @attribute_values\n end",
"title": ""
},
{
"docid": "fac2afd58bebd489e3b82913ca10cb9a",
"score": "0.5722954",
"text": "def attributes(*args)\n hash = super\n hash.each do |key, value|\n format_time!(hash, key, value)\n format_money!(hash, key, value)\n end\n end",
"title": ""
},
{
"docid": "a24e2636a2dea95fb6de9c02018c451b",
"score": "0.5693465",
"text": "def time_metadata\n if self.checkin_datetime.present? and self.hour_of_day.blank?\n time_in_time_zone = Time.parse(self.checkin_datetime.to_s).in_time_zone(self.user.time_zone_or_default)\n\n # remining_time based on a 24 hour clock (can be negative if they took longer than a day to do this)\n if self.player_budge.present? and self.player_budge.day_starts_at.present?\n remaining_time = ((self.player_budge.day_starts_at+1.day - time_in_time_zone)/60.0).round\n end\n\n self.attributes = {:hour_of_day => time_in_time_zone.hour,\n :day_of_week => time_in_time_zone.wday,\n :week_of_year => time_in_time_zone.strftime('%W').to_i,\n :end_clock_remaining => remaining_time}\n end\n end",
"title": ""
},
{
"docid": "805bd6d7f61f102fdd79256c2958b074",
"score": "0.567598",
"text": "def createtime=(value); end",
"title": ""
},
{
"docid": "a0304d6622604002706d67d3566e6fb4",
"score": "0.5651358",
"text": "def initialize(hours)\n @hours = hours\n end",
"title": ""
},
{
"docid": "eac28d99fe9a2d46d6db3530aec4c4bb",
"score": "0.5626677",
"text": "def valid_attributes\n { at: 1.minute.ago, tz: \"Eastern Time (US & Canada)\", data: {\"assf\" => \"dsdsag\"}}\n end",
"title": ""
},
{
"docid": "4df420256c8da88b01333fe1bb34915d",
"score": "0.5624224",
"text": "def from_hash( h)\n\t\t@name = h.keys.first\n\t\th[@name].each { |k,v| self.add_attribute( k, v) }\n\tend",
"title": ""
},
{
"docid": "804f96eb35148225bba525447af89654",
"score": "0.56129175",
"text": "def hours; end",
"title": ""
},
{
"docid": "804f96eb35148225bba525447af89654",
"score": "0.56129175",
"text": "def hours; end",
"title": ""
},
{
"docid": "546dfb1cf7df218bcb298ed0072f9bd1",
"score": "0.56111884",
"text": "def hour; end",
"title": ""
},
{
"docid": "546dfb1cf7df218bcb298ed0072f9bd1",
"score": "0.56111884",
"text": "def hour; end",
"title": ""
},
{
"docid": "0e84d55a1accc73e9ef531c6179cb9f9",
"score": "0.55975705",
"text": "def extracted_attributes(split_time)\n EXTRACTABLE_ATTRIBUTES.map { |attribute| [attribute, split_time.send(attribute)] }.to_h\n .select { |_, value| !value.nil? }\n end",
"title": ""
},
{
"docid": "14eb9c8c06a3bc8e5c6cfdf5232d78ac",
"score": "0.557579",
"text": "def set_datetime_attributes hash\n @@datetime_attributes = hash\n end",
"title": ""
},
{
"docid": "9362dd68a1af38bc822b716413a2f3a1",
"score": "0.5558844",
"text": "def valid_attributes\n {\n :user_id => @me.id, :start_time => '2020-04-08T17:30:00Z', :end_time => '2020-04-09T16:30:00Z', :created_at => '2020-04-06T10:30:00Z', :description => 'creating'\n }\n end",
"title": ""
},
{
"docid": "f2fd9d797c4b738942cba51f6adc6363",
"score": "0.552993",
"text": "def set_hh\n @hh = Hh.find(params[:id])\n end",
"title": ""
},
{
"docid": "4e8eff641ca30e6d819e7544da6638c2",
"score": "0.552698",
"text": "def valid_attributes\n { venue_id: \"1\", name: \"Some Band On Tour\", description: \"Some band on tour sometime somewhere\", soundcheck_time: \"2013-04-02 15:00:00\", doors_time: \"2013-04-02 18:30:00\", concert_start_time: \"2013-04-02 19:00:00\", concert_end_time: \"2013-04-02 23:00:00\" }\n end",
"title": ""
},
{
"docid": "e2f05e2c074870ad2b7857c349658246",
"score": "0.5516531",
"text": "def attr_hash; end",
"title": ""
},
{
"docid": "7a53241e5abb38a98a4dceb1dd071f2c",
"score": "0.5507992",
"text": "def attribute_factory; end",
"title": ""
},
{
"docid": "7a53241e5abb38a98a4dceb1dd071f2c",
"score": "0.5507992",
"text": "def attribute_factory; end",
"title": ""
},
{
"docid": "7a53241e5abb38a98a4dceb1dd071f2c",
"score": "0.5507992",
"text": "def attribute_factory; end",
"title": ""
},
{
"docid": "0abf1091914f05ccc58c5169f2a0a511",
"score": "0.54832",
"text": "def initialize(attributes={})\n date_hack(attributes, \"duedate\")\n date_hack(attributes, \"perfstart\")\n date_hack(attributes, \"perfend\")\n super(attributes)\n end",
"title": ""
},
{
"docid": "ce688867225731296f5657c9a427a2ee",
"score": "0.5482535",
"text": "def initialize_values\n if not @value.kind_of? Hash\n @model.attributes[@column_name] = {}.to_yaml\n @model.save\n end\n end",
"title": ""
},
{
"docid": "aa7f7d553b3bbf4aa4dde5cbb0fe6bb5",
"score": "0.5472241",
"text": "def start_at_hour=(value)\n write_attribute(:start_at_hour, (Tod::TimeOfDay.parse(value) rescue value))\n end",
"title": ""
},
{
"docid": "18447dfd73fda755c41a1e7dc9c00172",
"score": "0.5468404",
"text": "def before_create \n self.sexual_orientation_visibility = relationship_status_visibility = self.profile_visibility = self.current_course_visibility = self.course_archive_visibility = self.desk_visibility = self.friend_visibility = Student::Everyone \n self.login_time = self.logoff_time = Time.now.utc\n first_name.downcase!\n last_name.downcase!\n self.whole_name = first_name + \" \" + last_name \n self.attributes.each do |k,v|\n if k =~ /notification/ \n self[k] = :y\n end\n end\n end",
"title": ""
},
{
"docid": "6dd0a242428e41b53ca7fce5714aa17e",
"score": "0.546644",
"text": "def initialize(identifier, attributes = {})\n super\n\n ALL_DATA_COLUMNS.each do |field|\n send(\"#{field}=\", attributes[field.to_sym])\n end\n\n DATA_BREAKDOWN_COLUMNS.each do |field|\n send(\"#{field}=\", attributes[field.to_sym])\n end\n\n TIME_COLUMNS.each do |field|\n if val = attributes[field.to_sym]\n #Handles integer timestamps and ISO8601 strings\n time = Time.parse(val) rescue Time.at(val.to_i)\n send(\"#{field}=\", time)\n end\n end\n\n DATE_COLUMNS.each do |field|\n if val = attributes[field.to_sym]\n #Handles integer timestamps and ISO8601 strings\n date = Date.parse(val) rescue Date.at(val.to_i)\n send(\"#{field}=\", date)\n end\n end\n end",
"title": ""
},
{
"docid": "a808f5a0d98347e3587ecd9275d0f307",
"score": "0.5460803",
"text": "def create\n @atr_hst = AtrHst.new(params[:atr_hst])\n @atr_hst.atr=Atr.first\n @atr_hst.value='25000'\n @atr_hst.tstamp=Time.now.to_i\n respond_to do |format|\n if @atr_hst.save\n format.html { redirect_to @atr_hst, notice: 'Atr hst was successfully created.' }\n format.json { render json: @atr_hst, status: :created, location: @atr_hst }\n else\n format.html { render action: \"new\" }\n format.json { render json: @atr_hst.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bcf08346d0636f7654682f99dcce9874",
"score": "0.5456715",
"text": "def gen_time_attr_type_hash\n Api::Settings.collections.each do |_, cspec|\n next if cspec[:klass].blank?\n klass = cspec[:klass].constantize\n klass.columns_hash.collect do |name, typeobj|\n normalized_attributes[:time][name] = true if %w(date datetime).include?(typeobj.type.to_s)\n end\n end\n end",
"title": ""
},
{
"docid": "15848e266e35ce2b73c548d6efcc2499",
"score": "0.5444848",
"text": "def initialize(halve,hour12,min,sec)\n @halve = halve\n @hour12 = hour12\n @min = min\n @sec = sec\n end",
"title": ""
},
{
"docid": "3a0614f579ae8b5ca9c9603d00753563",
"score": "0.5440371",
"text": "def initialize(hm)\n hm = hm.to_s if hm.is_a? Hour\n\n hm_aux = hm.split(\":\")\n @hour = hm_aux[0].to_i % 24\n @minute = hm_aux[1].to_i % 60\n end",
"title": ""
},
{
"docid": "f68568048646cc4cae038a2739dff44a",
"score": "0.54356045",
"text": "def valid_attributes\n time = Time.current\n {:start_date =>time-2.days, :end_date =>time+2.days, :availabilities=>{:avail=>{time=>[\"J\"]},:rather_not=>{time=>[\"J\"]},:prefer=>{time=>[\"J\"]}}}\n end",
"title": ""
},
{
"docid": "95a96ba295efbdd9f8af370583ab04c8",
"score": "0.5433716",
"text": "def valid_attributes\n {hmm_profile_id: hmm_profile.id,\n min_fullseq_score: 10.0}\n end",
"title": ""
},
{
"docid": "c91645fcbb8a84a94d296bce0c92978e",
"score": "0.5430437",
"text": "def attributes_for_creation( attributes_hash )\n @attributes_hash = attributes_hash\n end",
"title": ""
},
{
"docid": "f3102eff0a1ee6ea0c1072bd21bfb5bb",
"score": "0.54279923",
"text": "def business_hours=(value)\n @business_hours = value\n end",
"title": ""
},
{
"docid": "dc64c5f00bb255f2f8cab0607926a3f2",
"score": "0.5427131",
"text": "def part_hours\n end",
"title": ""
},
{
"docid": "cdd20b3be8dd5743ff912a8acc3307d7",
"score": "0.54231364",
"text": "def get_attr_hash\n { Agility: @char.attr_agi,\n Awareness: @char.attr_awa,\n Brawn: @char.attr_bra,\n Coordination: @char.attr_coo,\n Intelligence: @char.attr_int,\n Perception: @char.attr_per,\n Willpower: @char.attr_wil }\n end",
"title": ""
},
{
"docid": "271a5e096ff8e3e530610e5a49a244f8",
"score": "0.5418779",
"text": "def hash_attribute(name, data_type = nil, min_occurs = nil, max_occurs = nil, has_one = [], has_many = [], belongs_to = [], attributes =[])\n hash = {}\n hash[:name] = name\n hash[:data_type] = data_type ? \"xs:\" + data_type.to_s : nil\n hash[:min_occurs] = min_occurs ? min_occurs.to_s : nil\n hash[:max_occurs] = max_occurs ? max_occurs.to_s : nil\n hash[:has_one] = has_one\n hash[:has_many] = has_many\n hash[:belongs_to] = belongs_to\n hash[:attributes] = attributes\n\n hash\n end",
"title": ""
},
{
"docid": "a396e203383d8767558d667d3894289c",
"score": "0.54172087",
"text": "def db_add_column(definition) \n encoder = definition.encoder\n sql = \"INSERT INTO dynamic_attributes (`class_type`,`name`,`type`,`length`,`required`,`default`,`created_at`,`updated_at`) VALUES ('%{class_type}','%{name}', '%{type}', %{length}, %{required}, %{default},'%{created_at}','%{updated_at}');\"\n definition.required = definition.required ? 1 : 0\n definition.default = definition.default.nil? ? 'NULL' : \"'#{encoder.encode(definition.default)}'\" \n ActiveRecord::Base.connection.execute(sql % definition.to_hash.merge(:created_at => Time.now.strftime(\"%Y-%m-%d %H:%M:%S\"), :updated_at => Time.now.strftime(\"%Y-%m-%d %H:%M:%S\")))\n end",
"title": ""
},
{
"docid": "7000a7086f0a6e87d0caa5baa05336fe",
"score": "0.54107964",
"text": "def hours; Integer.new(object.hour); end",
"title": ""
},
{
"docid": "ab9dc740705241ec2940d9ca4dc6e58e",
"score": "0.5410713",
"text": "def hour= num\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "d14027fbfeecf8201862be8dec4b8c69",
"score": "0.540451",
"text": "def add(h)\n @attributes.push(Attribute.new(h))\n end",
"title": ""
},
{
"docid": "4ea44dc69eb61bbce2c0a839a35a1da2",
"score": "0.53980666",
"text": "def initialize(attributes = {})\r\n attributes.each do |name, value|\r\n if REJECTED_PROPERTIES.include? name\r\n next \r\n elsif attributes[name].class.to_s == \"Hash\" \r\n # if it's a relation hash\r\n send(\"#{name}_id=\",attributes[name][\"id\"])\r\n elsif attributes[name]\r\n # if it's an object's attribute check if can be converted to Time object\r\n value = (value.to_time rescue value)\r\n send(\"#{name}=\",value)\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "a4da5e905cf8e28897afc0b7e2c97a4b",
"score": "0.53943354",
"text": "def valid_attributes\n {\n start_date: Date.new(2013, 1, 20),\n end_date: Date.new(2013, 2, 20),\n onsite: false,\n name: \"Early Competitor\",\n registrant_type: \"competitor\",\n registration_cost_entries_attributes: {\n \"1\" => {\n expense_item_attributes: {\n cost: @comp_exp.cost,\n tax: @comp_exp.tax\n }\n }\n\n }\n }\n end",
"title": ""
},
{
"docid": "45d30e6346ca6e9be15d757df87ae8dc",
"score": "0.5392224",
"text": "def attributes\n hash = super\n temp = {\n \"guid\" => @guid\n }\n hash.merge(temp)\n end",
"title": ""
},
{
"docid": "6a6faee5302ceb49fe27a254dc523132",
"score": "0.53760976",
"text": "def attributes_for_active_record\n { \n :date => @timestamp.to_s, \n :rmr => @rmr_number, \n :path => @visit_directory, \n :scanner_source => @scanner_source ||= get_scanner_source,\n :scan_number => @exam_number,\n :dicom_study_uid => @study_uid\n }\n end",
"title": ""
},
{
"docid": "d0307a1367c4f94ff24ad1bca5de1541",
"score": "0.53704274",
"text": "def define_attribute_methods; end",
"title": ""
},
{
"docid": "dfc928a42789fcd510bfcc205c183d8e",
"score": "0.5362682",
"text": "def optional_attributes()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "03e1fab9c91029c119411c50dc37358a",
"score": "0.53561586",
"text": "def initialize_attribute(attribute, value)\n if value.is_a?(String)\n @values[attribute] = case attribute\n when /time/\n self.class.initialize_time_attribute(value)\n when /date/\n self.class.initialize_date_attribute(value)\n else\n value\n end\n else\n @values[attribute] = value\n end\n end",
"title": ""
},
{
"docid": "f9221042519dc218781ffcd0ffc791dc",
"score": "0.53535247",
"text": "def attributes; {}; end",
"title": ""
},
{
"docid": "7f2f4c2110993f6accdd6c2d9770fd14",
"score": "0.53531384",
"text": "def to_h\n\n h = super\n h['dispatch_time'] = @dispatch_time\n h['attributes']['__filter__'] &&= filter.to_h\n h\n end",
"title": ""
},
{
"docid": "7bcf29624e07bfbbfd083e2af3609e55",
"score": "0.53526026",
"text": "def attributes=(_arg0); end",
"title": ""
},
{
"docid": "7bcf29624e07bfbbfd083e2af3609e55",
"score": "0.53526026",
"text": "def attributes=(_arg0); end",
"title": ""
},
{
"docid": "7bcf29624e07bfbbfd083e2af3609e55",
"score": "0.53526026",
"text": "def attributes=(_arg0); end",
"title": ""
},
{
"docid": "aa55e9e15b5e6598368bde7cc150d5a0",
"score": "0.53516835",
"text": "def initialize(name = \"Unknown\", hourly_wage = 0.0, hours_per_week = 0.0)\n # self.name = name\n super(name)\n self.hourly_wage = hourly_wage\n self.hours_per_week = hours_per_week\t\n end",
"title": ""
},
{
"docid": "ce47a7c73e3389bdfe5dcfe2486756e4",
"score": "0.53473866",
"text": "def setup_valid_attributes\n @valid_attributes = {\n :value_proposition => \"$81 value for $39\",\n :price => 39.00,\n :value => 81.00,\n :quantity => 100,\n :terms => \"these are my terms\",\n :description => \"this is my description\",\n :start_at => 10.days.ago,\n :hide_at => Time.zone.now.tomorrow,\n :short_description => \"A wonderful deal\"\n }\n end",
"title": ""
},
{
"docid": "13869bdf0b48535b201d2c938ca28440",
"score": "0.5345318",
"text": "def initialize(*args)\n if args and args.first.is_a?(Hash)\n self.name = args.first[:name].to_sym || nil\n self.type = args.first[:type] || nil\n self.options = args.first[:options] || {}\n elsif args && args.first\n raise \"Error! HimaAttribute.new expected a hash and instead got #{args.first.class}\"\n else\n self.name = nil\n self.type = nil\n self.options = {}\n end\n end",
"title": ""
},
{
"docid": "fb6bcebffbd7625bb566f67e0195261e",
"score": "0.5342628",
"text": "def populate_from_hash!(hash)\n unless hash.nil? || hash.empty?\n hash.each do |key, value|\n set_attr_method = \"#{key}=\"\n unless value.nil?\n if respond_to?(set_attr_method)\n self.__send__(set_attr_method, value) \n else\n Facebooker::Logging.log_info(\"**Warning**, Attempt to set non-attribute: #{key}\",hash)\n end\n end\n end\n @populated = true\n end \n end",
"title": ""
},
{
"docid": "ef50237f07d32816a0cd070b47feb04b",
"score": "0.5340274",
"text": "def initialize(attributes = {})\n @createTime = attributes[\"createTime\"] || \"\"\n @startTime = attributes[\"startTime\"] || \"\"\n @finishTime = attributes[\"finishTime\"] || \"\"\n @leadTime = attributes[\"leadTime\"] || 0\n @blockedTime = attributes[\"blockedTime\"] || 0\n @waitTime = attributes[\"waitTime\"] || 0\n @cycleTime = attributes[\"cycleTime\"] || 0\n @workTime = attributes[\"workTime\"] || 0\n @efficiency = attributes[\"efficiency\"] || 0\n end",
"title": ""
},
{
"docid": "3a411bfed1572ece086e249ffc4d1ee1",
"score": "0.53379464",
"text": "def _generate_table_prep\n # Make sure the db_class has the custom_attribute definitions defined for\n # the report being built.\n load_custom_attributes\n\n # Default time zone in profile to report time zone\n time_profile.tz ||= tz if time_profile\n self.ext_options = {:tz => tz, :time_profile => time_profile}\n\n # TODO: these columns need to be converted to real SQL columns\n # only_cols = cols\n\n self.extras ||= {}\n end",
"title": ""
},
{
"docid": "dfcda15c2f7e87784c45d357da370b65",
"score": "0.5336186",
"text": "def make_tp_attrs\n @base_tp = nil\n @tp_exceed = 0\n @tp_rise = 0\n end",
"title": ""
},
{
"docid": "8da6b8fcb9f6dcb08c5a622c717e8a1d",
"score": "0.5334938",
"text": "def createtime; end",
"title": ""
},
{
"docid": "ac10b9023a2d1c48d5e412997257af09",
"score": "0.5334859",
"text": "def to_h\n {\n value: value,\n host: @host,\n port: @port,\n invoice: @invoice,\n time: @time.utc.iso8601,\n suffixes: @suffixes,\n strength: @strength,\n hash: value.zero? ? nil : hash,\n expired: expired?,\n valid: valid?,\n age: (age / 60).round,\n created: @created.utc.iso8601\n }\n end",
"title": ""
},
{
"docid": "7a37c4788f6a173db3dc9a9c6f39645a",
"score": "0.53347087",
"text": "def attributes=(p0) end",
"title": ""
},
{
"docid": "eae315369e88a58b6c4885893c0dcebb",
"score": "0.5332159",
"text": "def get_field_deserializers()\n return super.merge({\n \"activeHoursEnd\" => lambda {|n| @active_hours_end = n.get_time_value() },\n \"activeHoursStart\" => lambda {|n| @active_hours_start = n.get_time_value() },\n })\n end",
"title": ""
},
{
"docid": "59b86c5870ea674d2dd60a89a63991ce",
"score": "0.5330957",
"text": "def attributes(*) end",
"title": ""
},
{
"docid": "7a89f86e31a486af799b790cd5ab78a7",
"score": "0.5330929",
"text": "def initialization_hash\n h = {}\n meta_attributes.each do |attribute|\n h.merge!(attribute => self.send(attribute))\n end\n h\n end",
"title": ""
},
{
"docid": "4b57fca5c0a368895d48b9d56636212c",
"score": "0.5328671",
"text": "def init_attr\r\n end",
"title": ""
},
{
"docid": "ae9d043050006bd717739292feb35554",
"score": "0.53225374",
"text": "def vacols_attributes(hearing, vacols_record)\n date = HearingMapper.datetime_based_on_type(\n datetime: vacols_record.hearing_date,\n regional_office: regional_office_for_scheduled_timezone(hearing, vacols_record),\n type: vacols_record.hearing_type\n )\n\n {\n vacols_record: vacols_record,\n appeal_vacols_id: vacols_record.folder_nr,\n venue_key: vacols_record.hearing_venue,\n disposition: VACOLS::CaseHearing::HEARING_DISPOSITIONS[vacols_record.hearing_disp.try(:to_sym)],\n representative_name: vacols_record.repname,\n aod: VACOLS::CaseHearing::HEARING_AODS[vacols_record.aod.try(:to_sym)],\n hold_open: vacols_record.holddays,\n transcript_requested: VACOLS::CaseHearing::BOOLEAN_MAP[vacols_record.tranreq.try(:to_sym)],\n transcript_sent_date: AppealRepository.normalize_vacols_date(vacols_record.transent),\n add_on: VACOLS::CaseHearing::BOOLEAN_MAP[vacols_record.addon.try(:to_sym)],\n notes: vacols_record.notes1,\n appeal_type: VACOLS::Case::TYPES[vacols_record.bfac],\n docket_number: vacols_record.tinum || \"Missing Docket Number\",\n veteran_first_name: vacols_record.snamef,\n veteran_middle_initial: vacols_record.snamemi,\n veteran_last_name: vacols_record.snamel,\n appellant_first_name: vacols_record.sspare2,\n appellant_middle_initial: vacols_record.sspare3,\n appellant_last_name: vacols_record.sspare1,\n room: vacols_record.room,\n request_type: vacols_record.hearing_type,\n scheduled_for: date,\n hearing_day_vacols_id: vacols_record.vdkey,\n bva_poc: vacols_record.vdbvapoc,\n judge_id: hearing.user_id\n }\n end",
"title": ""
},
{
"docid": "899902f44a03e24a7a4b1dcc37964529",
"score": "0.532037",
"text": "def set_datetimes\n self.starts_at = \"#{self.class_date} #{self.class_time}:00\" #convert fields back to db format\nend",
"title": ""
},
{
"docid": "f649a1916f4ccadda1b76860f3e1378a",
"score": "0.5318664",
"text": "def valid_attributes\n {\n start_date: Date.new(2013, 01, 20),\n end_date: Date.new(2013, 02, 20),\n onsite: false,\n name: \"Early\",\n competitor_expense_item_attributes: {\n cost: @comp_exp.cost,\n tax: @comp_exp.tax\n },\n noncompetitor_expense_item_attributes: {\n cost: @noncomp_exp.cost,\n tax: @noncomp_exp.tax,\n }\n }\n end",
"title": ""
},
{
"docid": "748a96ce44bb16a9950bd45e93894e64",
"score": "0.53127795",
"text": "def initialize_field(key)\n return if [:embargo_release_date, :lease_expiration_date].include?(key)\n # rubocop:disable Lint/AssignmentInCondition\n if class_name = model_class.properties[key.to_s].try(:class_name)\n # Initialize linked properties such as based_near\n self[key] += [class_name.new]\n else\n super\n end\n # rubocop:enable Lint/AssignmentInCondition\n end",
"title": ""
},
{
"docid": "0a638953ca821cfb069beacf15ba7d04",
"score": "0.5310415",
"text": "def generate_asserts_attributes(h, p)\n h.attributes.each do |k, v|\n generate_assert_drillable_item(v, ->(meth) { \"#{p}.#{meth}\" }, k)\n end\n end",
"title": ""
},
{
"docid": "c12a168aecb6da9143162d86e7b72a77",
"score": "0.53059274",
"text": "def gen_time_attr_type_hash\n Settings.collections.each do |_, cspec|\n next if cspec[:klass].blank?\n klass = cspec[:klass].constantize\n klass.columns_hash.collect do |name, typeobj|\n Environment.normalized_attributes[:time][name] = true if %w(date datetime).include?(typeobj.type.to_s)\n end\n end\n end",
"title": ""
},
{
"docid": "d4de66821f27173d761c72dbf15dabe6",
"score": "0.5305753",
"text": "def initialize(atts = {})\n super\n # Default time_end to 1 hour after time_start.\n ts = self.time_start\n self.time_end ||=\n ts ?\n DateTime.new(ts.year, ts.month, ts.day, ts.hour + 1, ts.minute) : # 1 hour later.\n nil\n end",
"title": ""
},
{
"docid": "74003c66f434ce3b4cd00ee8ab40ed3f",
"score": "0.53055507",
"text": "def build_attributes(model)\n model.columns.map do |i|\n type = conversions[i.type.to_s]\n if (enum = model.defined_enums[i.name])\n type = enum.keys.map { |k| \"'#{k}'\" }.join(' | ')\n end\n\n {\n name: i.name,\n ts_type: i.null ? \"#{type} | null\" : type\n }\n end\n end",
"title": ""
},
{
"docid": "e4adebe545f068846e6867fe3dc8cf62",
"score": "0.53011495",
"text": "def attributes_hash; end",
"title": ""
},
{
"docid": "0f17101e4871f5cda9af44c00b7f5e23",
"score": "0.5301015",
"text": "def normal_hour_params\n params.require(:normal_hour).permit(:resource_type, :resource_id, :day_of_week, :open_time, :close_time)\n end",
"title": ""
},
{
"docid": "21e23d97ddf63a7dad58221ebafb34b4",
"score": "0.5286956",
"text": "def creation_attributes\n { }\n end",
"title": ""
},
{
"docid": "21e23d97ddf63a7dad58221ebafb34b4",
"score": "0.5286956",
"text": "def creation_attributes\n { }\n end",
"title": ""
},
{
"docid": "e6ccbb867ad36e964021b9a3ecb433af",
"score": "0.5285723",
"text": "def hour\n end",
"title": ""
}
] |
0a8a5927678270bed0d1edb7ef45cd56
|
Send emails 1 day before an event
|
[
{
"docid": "6fbf4c11c37b5114b4fab6b051e24e40",
"score": "0.6417725",
"text": "def send_mails\n\t\tReminder.where(time: Time.now..(Time.now + 1.day), reminded: false).each do |r|\n\t\t\tUser.all.each do |u|\n\t\t\t\tsend_safe_mail(:to => u.email, :subject => r.title, :html_body => \"<p>Hi #{u.display_name.html_safe},</p><p>Just a quick reminder... Don't forget about this event, planned the #{ApplicationHelper.datetime_to_s(r.time)}:</p><h4>#{r.title}</h4><p>#{r.description}</p>Yours truly,<br>The BeOI Training team.\")\n\t\t\tend\n\t\t\tr.update(reminded: true)\n\t\tend\n\tend",
"title": ""
}
] |
[
{
"docid": "5302ab4377a9693dbd3c01d12b4c1348",
"score": "0.7161013",
"text": "def send_event_email(user)\n @event = Event.order(\"created_at\").last\n mail(:to => user.email,\n :subject => 'Upcomming event at 100Club!')\n \n end",
"title": ""
},
{
"docid": "d0a0f35a94542fb8b5cad3e6ff3509ad",
"score": "0.70112115",
"text": "def daily_task\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end",
"title": ""
},
{
"docid": "b7939401e514bb4ba8c8e3f25e0ebae8",
"score": "0.6827395",
"text": "def send_15_days_till_expire_email\n unless self.email_1_sent?\n holder = User.account_holder_for_account(self.account)\n AccountMailer.trial_email_1(self.account, holder).deliver\n self.update_attribute(:email_1_sent, true)\n end\n end",
"title": ""
},
{
"docid": "3c2bf8a246617b119d51121236a1979d",
"score": "0.6811328",
"text": "def send_emails\n if request.post?\n tomorrow = Time.now + 1.day\n day = Day.first(:conditions => ['date = ?', tomorrow.strftime('%Y-%m-%d')])\n\n day.assigned_users.each do |user|\n SupportNotifier.deliver_support_notification(user) # sends the email\n end\n end\n end",
"title": ""
},
{
"docid": "48210b7feb1b9728d7b56e751434c875",
"score": "0.67941916",
"text": "def report_new_event_to_dingo(the_event)\n @event = the_event\n mail(:from => self.dingo_email,:to => Settings.DINGO_EMAIL,:subject => 'A New Event Has Been Created')\n end",
"title": ""
},
{
"docid": "8861cd4067021ed441ff40b33ea6e264",
"score": "0.67274606",
"text": "def information_send\n AttendanceMailer.new_guest_email(self.attended_event.host).deliver_now\n end",
"title": ""
},
{
"docid": "5200002c6b11b60e364b5e9967eda970",
"score": "0.6719231",
"text": "def weekly(events, message, date, addendum)\n @events = events\n @message = message\n\n subject = addendum ? \"CASA Newsletter Addendum\" : \"CASA Weekly Newsletter\"\n \n mail to: \"casa-list@mailman.yale.edu\", subject: \"#{subject}: #{date.strftime(\"%B %e, %Y\")}\"\n end",
"title": ""
},
{
"docid": "233b5d8a1d628e56e3a07d2512cdbeaf",
"score": "0.6708781",
"text": "def send_attendee_reminder!\n template = EmailTemplate.find_by_id(reminder_email_template_id)\n return false if template.nil?\n attendees.tomorrow_reminder.each do |attendee|\n EmailContact.log(\n attendee.invitable_id, \n TemplateMailer.deliver(template.create_email_to(attendee)),\n nil, nil,\n attendee\n )\n end\n end",
"title": ""
},
{
"docid": "f0b4f821f48282132f032acc8ddedf8c",
"score": "0.6700501",
"text": "def weekly_meeting_reminder\n @greeting = \"Hi\"\n\n mail :to => \"to@example.org\"\n end",
"title": ""
},
{
"docid": "d1ea4a8045af7202252fbb3781fd7fa4",
"score": "0.668368",
"text": "def daily(email)\n @greeting = \"Here is your team daily bookmark digest\"\n\n mail(:to=>email,:subject =>\"Daily Team Digest\") \n end",
"title": ""
},
{
"docid": "189cbe05eb2a306ce68eac4908ddc856",
"score": "0.6638464",
"text": "def send_trial_expiry_reminder_one\n BookingMailer.send_expiry_reminder_one(self).deliver_later\n # set date so email doesn't get send again\n self.trial_expiry_reminder_one_sent = Date.today\n save!\n end",
"title": ""
},
{
"docid": "59b403a7067344123f6e9a96fefe3879",
"score": "0.66163814",
"text": "def event_expiry_email(user, event, host, lead_place)\n @project_name = get_project_name\n @user = user\n @event = event\n @host = host\n @time = Time.new\n @lead_place = lead_place\n \n\n mail( :to => @user.email,\n :from => \"no-reply@\" + @project_name.gsub(/\\s+/,\"\") + \".com\",\n :subject => \"Let's #{@project_name} at #{@lead_place}\")\n\n end",
"title": ""
},
{
"docid": "12dab74fe13ba3ef0eeaf96e870cf1f0",
"score": "0.6614288",
"text": "def reminder(event)\n @event = event\n @bcc = @event.users.map(&:email)\n mail(subject: \"\\\"#{@event.title}\\\" is coming up! Don't miss it!\", bcc: @bcc, from: \"\\\"Event Reminder | HiKultura\\\"<info@hikultura.com>\")\n end",
"title": ""
},
{
"docid": "71da1aa424d228a216cf8a7c5aa52baf",
"score": "0.66007626",
"text": "def queue_host_nudge_email\n days_before = days_till_tea_time_start <= 2 ? 1 : 2\n schedule_time = start_time - days_before.send(:days)\n HostMailer.delay(run_at: schedule_time).pre_tea_time_nudge(self.id)\n end",
"title": ""
},
{
"docid": "27f966301081a5d4d8483aa729e90a49",
"score": "0.65990305",
"text": "def daily_report\n @greeting = \"Hi, this is the daily override report!\"\n @overrides = Event.override\n\n\n\n mail( :to => \"patrickjmcd@gmail.com\",\n :subject => \"Daily Override Report\")\n\n end",
"title": ""
},
{
"docid": "f491560d5440556ccb09f26e57be3b21",
"score": "0.65625286",
"text": "def main\n comic_mailer = ComicMailer.new\n\n unless comic_mailer.already_sent_today?\n comic_mailer.download_and_mail\n comic_mailer.log_send_event\n end\nend",
"title": ""
},
{
"docid": "692c30c0cf4270559e93648a08f28c18",
"score": "0.65609",
"text": "def send_mail\n StudentMailer.eval_reminder.deliver_now\n end",
"title": ""
},
{
"docid": "10b26f407b663f25d09b72cf725d3019",
"score": "0.65179735",
"text": "def two_week_reminder\n @greeting = \"Hi\"\n\n mail :to => \"to@example.org\"\n end",
"title": ""
},
{
"docid": "487b3941736529836e02c61a5cf49c31",
"score": "0.65126324",
"text": "def daily_schedule(events, group, user)\n timezone user\n\n @events = events\n @group = group\n @user = user\n\n @view_action = {\n url: url_for(\n controller: 'groups', action: 'show',\n id: @group.id, only_path: false\n ),\n action: 'View Tickets',\n description: 'See available tickets.'\n }\n\n mail(\n to: \"#{user.display_name} <#{@user.email}>\",\n subject: \"Today's events for #{@group.group_name}\"\n )\n\n headers['X-Mailgun-Tag'] = 'DailyReminder'\n headers['X-Mailgun-Dkim'] = 'yes'\n headers['X-Mailgun-Track'] = 'yes'\n headers['X-Mailgun-Track-Clicks'] = 'yes'\n headers['X-Mailgun-Track-Opens'] = 'yes'\n end",
"title": ""
},
{
"docid": "0f3f43ee89154a710e7e61f11f7b8ed9",
"score": "0.64986473",
"text": "def three_week_reminder\n @greeting = \"Hi\"\n\n mail :to => \"to@example.org\"\n end",
"title": ""
},
{
"docid": "959cef165f40d32581b401d7b60a66c0",
"score": "0.64923525",
"text": "def seven_day_prior_adult_reminder(event_registration)\n @event_registration = event_registration\n @recipient = @event_registration.user\n return if @recipient.anonymous_email?\n\n days_from_now = ((event_registration.event.starts_at - Time.now) / 1.day).to_i\n\n mail(\n to: @recipient.email,\n subject: I18n.t(\n @event_registration.complete? ? 'email.subjects.event_reminder_complete' : 'email.subjects.event_reminder_incomplete',\n days: days_from_now,\n event_name: event_registration.event.name\n )\n )\n end",
"title": ""
},
{
"docid": "a825cbdecbc78ef714f57691405bc262",
"score": "0.6485131",
"text": "def daily_digest\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end",
"title": ""
},
{
"docid": "aa53c8c8978382cc3423a32bc0f51026",
"score": "0.6476706",
"text": "def daily_email(email_subscription)\n \n @email_subscription = email_subscription\n @unsubscribe_url = \"http://sheltered-stream-93214.herokuapp.com/#/main/email_subscrition?email=#{email_subscription.email}\"\n available_ons = Dish::AvailableOn.where(delivery_date: Date.today)\n \n product_ids = available_ons.pluck(:product_id)\n \n @products = Spree::Product.where(id: product_ids)\n \n mail to: email_subscription.email, subject: \"Daily dishes\"\n end",
"title": ""
},
{
"docid": "54558005757ca303547f9ead17afe114",
"score": "0.64523864",
"text": "def day1(user)\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end",
"title": ""
},
{
"docid": "59160bbc34d67489725ab2faf631193d",
"score": "0.6425167",
"text": "def last_minute_reminder\n @greeting = \"Hi\"\n\n mail :to => \"to@example.org\"\n end",
"title": ""
},
{
"docid": "cc27b4341f102584c9247b4eae21a50c",
"score": "0.64141893",
"text": "def send_reminder\n if has_role? :admin # if user is admin\n User.where.not(id: self.id).each do |u| # select all other users\n if u.has_three_day_overdue_tasks? # if user has task over 3 days old\n NotificationMailer.tattle_tale(self, u).deliver_now\n puts \"oh my god, #{u.email} has a task thats 3 days over due!\"\n end\n end\n else\n if has_overdue_tasks?\n NotificationMailer.overdue_email(self).deliver_now\n puts \"sent email to #{self.email}\"\n end\n end\n end",
"title": ""
},
{
"docid": "fa1279bde5b3a4721194ebf63f4678aa",
"score": "0.64121836",
"text": "def new_event(event)\n @greeting = \"Hi\"\n @id = event.id\n\n mail to: event.user.email\n end",
"title": ""
},
{
"docid": "330a364596096dba420ec0b3a9d04587",
"score": "0.64099383",
"text": "def event_saved(event)\n @event = event\n project = event.project\n recipients = project.dev.email\n # recipients = project.all_users.map(&:email)\n mail(:to => recipients, :subject => \"[#{Conf.app['code']}] - #{event.created_at == event.updated_at ? 'Nuevo' : 'Edición de'} #{Event.model_name.human}\")\n end",
"title": ""
},
{
"docid": "bf62736d76c4589f31b799dae7d0fbea",
"score": "0.64093894",
"text": "def send_email(run_at_time, email_type)\n event = Event.find(id)\n if event.try(:confirmed?)\n User.all.each do |user|\n UserMailer.delay(run_at: run_at_time)\n .send(email_type, user, event)\n end\n end\n end",
"title": ""
},
{
"docid": "21fc04e98eeb5444cbabadb83d8daea9",
"score": "0.6397319",
"text": "def event_upcoming_reminder(teamsheet_entry)\n return unless teamsheet_entry.user.should_send_email? #push logic up chain?\n deliver(:event_upcoming_reminder, teamsheet_entry.user, teamsheet_entry.event.id, event.organiser.id)\n end",
"title": ""
},
{
"docid": "6ff8c2546b946d77283853f004fca05e",
"score": "0.6364129",
"text": "def daily(user, for_date)\n\t\t@user = user\n\t\t@missing_date = for_date\n\t\tmail :to => user.email, :subject => \"Reminder - How was #{for_date.strftime('%A, %B %d')}?\"\n end",
"title": ""
},
{
"docid": "6b162d4da5a44667f49481b7f047d827",
"score": "0.6362713",
"text": "def daily\n @todos = Todo.where(:done => false).select {|todo| todo.due_today? }\n \n mail\n end",
"title": ""
},
{
"docid": "d08520a6fa7d1e1847406ec975c33113",
"score": "0.6353158",
"text": "def send_trial_expired_one\n BookingMailer.send_trial_expired_one(self).deliver_later\n self.trial_expired_one_sent = Date.today\n save!\n end",
"title": ""
},
{
"docid": "932d844ecd090570c1ceac688c2add41",
"score": "0.63132906",
"text": "def send_mail\n\n \tCapsule.yet.where(\"dig_date <= ?\", DateTime.now).each do |c|\n \t\tmail(to: c.mail_address, subject: c.title) do |format|\n \t\t\t@name = c.title\n \t\t\t@capsule = c\n \t\t\tformat.html\n \t\tend\n \t\tc.done!\n \tend\n\n end",
"title": ""
},
{
"docid": "cc336ad122e5a3d991fd814e91e2674d",
"score": "0.6298383",
"text": "def send_primary_reminder_email\n UserMailer.primary_reminder_email(self).deliver_now\n end",
"title": ""
},
{
"docid": "e1f95e42613ea8ee932683cc1fb77251",
"score": "0.629772",
"text": "def email_reminder(assignment)\n @assignment = assignment\n\n tag :scheduler, :reminders, :email_reminder\n mail to: format_address(assignment.person), subject: \"#{assignment.shift.name} on #{assignment.date.strftime(\"%b %d\")}\"\n end",
"title": ""
},
{
"docid": "0d64d355791075bf062a3d6a130624dd",
"score": "0.629234",
"text": "def send_email(email)\n email.deliver_now\n end",
"title": ""
},
{
"docid": "070ad0894b5fd5ff8b719f107a8b7aa4",
"score": "0.6291094",
"text": "def send_email\n if event.send_attendance_emails? && rsvp_changed?\n if rsvp?\n RsvpMailer.rsvp(self).deliver\n else\n RsvpMailer.cancel(self).deliver\n end\n end\n end",
"title": ""
},
{
"docid": "afca0e949f45d1d927e2138cba305bb5",
"score": "0.6289368",
"text": "def send_submission_admin_email(event)\n @event = event\n mail( to: 'tony.edwards@gmail.com',\n subject: \"A new event has been submitted: #{event.title}\" )\n end",
"title": ""
},
{
"docid": "3577cf67faddda4f69d1620acd8c7e1d",
"score": "0.6283349",
"text": "def send_notification\n email = channel.get_email_for_booking_notification(self)\n Notifier.delay.email_expedia_booking_notification(email, self)\n end",
"title": ""
},
{
"docid": "aba533cf959a951c70d91fc3b284625c",
"score": "0.6283343",
"text": "def payment_1daybefore_recurring_notification(payment)\n @user = payment.user\n @payment = payment\n mail to: @user.email, subject: \"Your #{payment.goal} to #{payment.payable.try(:name)} is due tomorrow\", from: 'support@loverealm.org'\n end",
"title": ""
},
{
"docid": "287fc946d0950fd959f172ff53466126",
"score": "0.6278828",
"text": "def appointment_reminder\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end",
"title": ""
},
{
"docid": "93173dd296ec19e2a294be19b1220d38",
"score": "0.6277345",
"text": "def send_activate_user_reminder_email\n # find the email template corresponding to the\n # incremented_reminder_count\n template = EmailTemplate.find_by_name(\n \"after-activate-user-reminder-#{self.activate_user_reminder_count}\"\n )\n\n # do noting if no template could be found\n return unless template\n\n # set the liquid template options\n template_options = { 'user1' => self }\n\n # render the template and deliver it\n ApplicationMailer.email_template(template, self, template_options).deliver\n\n # update the new activate_user_reminder_count attribute\n update_column :activate_user_reminder_count, 1\n end",
"title": ""
},
{
"docid": "37489b508516be04edf988e423ae80b1",
"score": "0.6275349",
"text": "def daily_mail\n @greeting = \"Hi\"\n @stock = Stock.find(1)\n #@stock_name = \"Oracle\"\n #@stock_price = \"30.00\"\n mail :to => \"ramk1024@yahoo.com\", :subject => \"Your daily stock update\"\n end",
"title": ""
},
{
"docid": "f9d54b8dfa79b14c47dc4e4ed1c668af",
"score": "0.6271586",
"text": "def episode_notification\n mail to: @recipient.email,\n subject: 'Big Brotherissa tapahtuu!'\n end",
"title": ""
},
{
"docid": "55367464945011c27f020f954b809ab5",
"score": "0.6250371",
"text": "def first_overdue_email(args)\n args.assert_valid_keys( :customer, :copies, :weekly_rate )\n @customer = args[:customer]\n @copies = args[:copies]\n @weekly_rate = args[:weekly_rate]\n \n @args = args\n \n mail(subject: \"SmartFlix.com: overdue DVDs\",\n to: Rails.env == 'production' ? args[:customer].email : SmartFlix::Application::EMAIL_TO_DEVELOPER ,\n from: SmartFlix::Application::EMAIL_FROM).deliver\n end",
"title": ""
},
{
"docid": "5d6ad4ed996e49d65971d7196dfdd5ba",
"score": "0.6241244",
"text": "def day7(user)\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end",
"title": ""
},
{
"docid": "da97df596b5da2bbb5f73d1f9a49c912",
"score": "0.6220764",
"text": "def send_email(email)\n email.deliver_now\n end",
"title": ""
},
{
"docid": "78a58365c5e34b30665dd8c4eacc9c7c",
"score": "0.61993706",
"text": "def sendmail_overdue_to_client\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end",
"title": ""
},
{
"docid": "cee1d3dbf34e1f1ada39db8c9e1fb285",
"score": "0.61972576",
"text": "def mail_to_register_event(email, event_id)\n begin\n @lang = Helper.getLang\n event = Event.where(id: event_id, lang: @lang).select(:id, :title, :start, :end, :place, :link).first\n @setting = Setting.where(lang: @lang, id: 1, deleted_at: nil).select(:email, :address, :phone_dn).first\n \n @title = event.title\n @place = event.place\n if @lang == 'vi'\n @link_detail = $domain.to_s + '/event-detail/' + event.link.to_s\n else\n @link_detail = $domain.to_s + '/' + @lang + '/event-detail/' + event.link.to_s\n end\n @time = nil\n\n start_date = event.start.strftime(\"%d - %m - %Y\")\n start_time = event.start.strftime(\"%Hh%M\")\n end_date = event.end.strftime(\"%d - %m - %Y\")\n end_time = event.end.strftime(\"%Hh%M\")\n\n if start_date = end_date\n @time = t('event_time_text_day') + ' ' + start_date + ', ' + start_time + ' ~ ' + end_time + '.'\n else\n @time = start_time + ' ' + t('event_time_text_day') + ' ' + start_date + ' ~ ' + end_time + ' ' + t('event_time_text_day') + ' ' + end_date + '.'\n end\n \n mail(to: email, subject: '[ANS Asia] BrSE School - ' + t('mail_title_thanks_for_registration'))\n rescue\n end\n end",
"title": ""
},
{
"docid": "ea839a0830dde17cd0e0164c42e3881d",
"score": "0.6195551",
"text": "def send_by_email\n NotificationMailer.notify(self).deliver_now unless email.blank?\n end",
"title": ""
},
{
"docid": "ab631a3d5b62a57109fb151a911973d9",
"score": "0.6185599",
"text": "def confirm_event(current_emails)\n current_emails.each do |email|\n # raise\n UserMailer.event_confirmation(current_user, params[\"event-title\"], params[\"event-description\"], email).deliver\n\n end\n end",
"title": ""
},
{
"docid": "c2e00f9c460ec17e8d3c0d5cb3ab3704",
"score": "0.6183526",
"text": "def notify_new_event(event)\n @event = event\n mail to: Settings['content_mail'],\n subject: I18n.t(\"mailers.content_list_mailer.notify_new_event\")\n end",
"title": ""
},
{
"docid": "234fc5b6c4ea2208f4dbec34d20d14be",
"score": "0.6181762",
"text": "def send_report(email)\n @email = email\n @registrations = Reg.all\n @latest = Reg.where(\"created_at >= ?\", Time.now.beginning_of_day).all\n\n mail to: @email, subject: \"Daily Registrationapp Report\"\n end",
"title": ""
},
{
"docid": "92617cfcf4a2596ccbf4cfcd3601a581",
"score": "0.6175886",
"text": "def send_trial_expiry_reminder_two\n BookingMailer.send_expiry_reminder_two(self).deliver_later\n # set date so email doesn't get send again\n self.trial_expiry_reminder_two_sent = Date.today\n save!\n end",
"title": ""
},
{
"docid": "474cd90473c17eeec63b7c7dddbe4640",
"score": "0.61758566",
"text": "def daily_email(subscriber, projs)\n @subscriber = subscriber\n @greeting = \"Hi\"\n @p = projs\n # binding.pry\n mail to: @subscriber.email, subject: \"Hola Senor(ita)\"\n end",
"title": ""
},
{
"docid": "3a330e6cb0463bbc78967ea8ebe3dc24",
"score": "0.6171895",
"text": "def send_mail\n return if sent?\n reload\n mail = create_mail\n Rails.logger.info \"Sending notification for event #{event.id} (#{event.type} #{detail}) to #{user} (#{mail.to})\"\n mail.deliver\n sent!\n end",
"title": ""
},
{
"docid": "f7f924417cd191997c3f3554e4321c40",
"score": "0.6165731",
"text": "def weekly_digest(user)\n @user = user\n @appointments = Appointment.where('date >= ?', Date.tomorrow).where('date <= ?', Date.tomorrow+7)\n mail(to: user.email, subject: 'This week\\'s Innisfree Appointments')\n end",
"title": ""
},
{
"docid": "85638863dd3a8321090234134b214c40",
"score": "0.6165523",
"text": "def perform(date)\n GpoDailyTestSender.new.run\n\n GpoConfirmationUploader.new.run unless CalendarService.weekend_or_holiday?(date)\n end",
"title": ""
},
{
"docid": "ee7a73e6fa0f7070b9347c092289a767",
"score": "0.6162548",
"text": "def email_invite(assignment)\n @assignment = assignment\n\n tag :scheduler, :reminders, :email_invite\n mail to: format_address(assignment.person), subject: \"#{assignment.shift.name} on #{assignment.date.strftime(\"%b %d\")}\" do |format|\n format.html\n format.ics\n end\n end",
"title": ""
},
{
"docid": "94d884e28442493e4b615a7a1a40295c",
"score": "0.61572033",
"text": "def sendmail_overdue_to_admin\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end",
"title": ""
},
{
"docid": "87376df534d33089ff7ef0238e791c4a",
"score": "0.615532",
"text": "def event_request\n EventMailer.event_request\n end",
"title": ""
},
{
"docid": "b9b747f83def0a074d61de3b5948a84b",
"score": "0.614777",
"text": "def day3(user)\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end",
"title": ""
},
{
"docid": "057c3cbdeae863d637e2f2f53de2c196",
"score": "0.6137012",
"text": "def everyday(tuan,email,user=nil,title=nil)\n @tuan=tuan\n @user=user\n if title.nil?\n title=@tuan.edm_title\n end\n @email=email\n #@tuan=Tuan.today\n #@user=User.last\n #mail :to => \"to@example.org\"\n mail(:to => email, :subject => title,:from=>'\"给力团 给力百货\" <service@geilibuy.com>')\n #render 'dd'\n end",
"title": ""
},
{
"docid": "a7974e4bd1bfea0df50d82dea500b078",
"score": "0.6134594",
"text": "def appointment_reminder(appointment)\n \t@appointment = appointment\n \tmail(to: @appointment.user.email, subject: 'Upcoming appointment today')\n end",
"title": ""
},
{
"docid": "837124eee2bbe247dbeae683d06a670d",
"score": "0.61261225",
"text": "def approve_event(event)\n @event = event\n \n mail(:to => \"admin@hikultura.com\", :subject => \"Event pending of approval\")\n end",
"title": ""
},
{
"docid": "867db1a8779e62e0d8995811a5e9fab0",
"score": "0.6118528",
"text": "def send_cancellation_notice(for_date)\n return if date.present? and date < Date.today\n ReminderMailer.cancellation(self, for_date).deliver\n mark_as_sent!\n end",
"title": ""
},
{
"docid": "f51d0dbcb27f06182274f4834812b68b",
"score": "0.6115216",
"text": "def send_last_x_day(period, method)\n pages = Page.where(\"goal > collected AND end_time between now() - interval '?' day AND now() - interval '?' day\",period,period-1)\n pages.each do |p|\n if(true||p.can_be_donated? && p.did_reach_goal? == false)\n Delayed::Job.enqueue MailJob.new(\"UserMailer\", method, p.id)\n end\n end\n end",
"title": ""
},
{
"docid": "769608520f24320b9ed62c9c894d032c",
"score": "0.61137205",
"text": "def meeting_requested(admin, user, event)\n @admin = User.find_by_id(admin.id)\n @user = User.find_by_id(user)\n @event = event\n\n if @user.email\n mail to: @user.email\n end\n end",
"title": ""
},
{
"docid": "35e6dab06ab3df0f28bf1cdc647a5a9d",
"score": "0.61131644",
"text": "def weekly_email\n CommitOfferMailer.weekly_email\n end",
"title": ""
},
{
"docid": "779c60c6e77bf069941506002367f871",
"score": "0.61085486",
"text": "def receive_demand\n token = SecureRandom.urlsafe_base64.to_s\n event = Event.find(params[:event][:id])\n itinary_id = event.itinary.id\n owner_email = params[:owner]\n event.participants=[] if event.participants == nil\n event.participants << {email: params[:user][:email], notif: false, ptoken: token}\n event.save\n EventMailer.demand(current_user.email , owner_email, itinary_id, token )\n .deliver_later\n \n return render status: 200\n end",
"title": ""
},
{
"docid": "5111b29e7f0916882d19075606695a69",
"score": "0.60986984",
"text": "def deliver_reminder\n opts = {}\n opts[:from] = Time.zone.at(Integer(ENV['from'])) rescue Time.zone.parse(ENV['from']) if ENV['from']\n opts[:to] = Time.zone.at(Integer(ENV['to'])) rescue Time.zone.parse(ENV['to']) if ENV['to']\n\n each_sites do |site|\n puts site.name\n ::Gws::Reminder::NotificationJob.bind(site_id: site.id).perform_now(opts)\n end\n end",
"title": ""
},
{
"docid": "35cb372efb3ea2c428bbb984dfc134d9",
"score": "0.609066",
"text": "def email\n destination = params[:to]\n weekly_activity = Notification_mailer.weekly_activity(@weekly_activity, destination)\n #if notification_mailer.deliver\n #else\n # redirect_to notification_mailer_weekly_activity(@notification_mailer), \n #end\n end",
"title": ""
},
{
"docid": "48d7f47427be67eebefe3397f0e8cb4f",
"score": "0.6090147",
"text": "def send_event_create_confirmation(email, event_id, event_name, params)\n m = Mandrill::API.new\n message = { \n :subject=> \"Event Created and Sent on EventStarter\", \n :from_name=> \"EventStarter <noreply@eventstarter.co>\", \n :text=>\"You created a new EventStarter event, and you send out emails to your list. Details attached: ...\", \n :to=> [{\n :email => \"#{email}\",\n :name => \"\"\n }], \n :html=>\"<html><h2>EventStarter Event Created and Sent</h2><p>Event Name: #{params[:event_name]}</p><p>Event Description: #{params[:description]}</p><p>Creator Name: #{params[:creator_name]}</p><p>Creator Phone: #{params[:creator_phone]}</p><p>Creator Email: #{params[:creator_email]}</p><p>Event Time: #{params[:event_time]}</p><p>Event Location: #{params[:event_location]}</p><p>Invitees: #{params[:invitees]}</p><p>Minimum Attendees: #{params[:minimum_attendees]}</p><p>Maximum Attendees: #{params[:maximum_attendees]}</p><p>Deadline: #{params[:deadline]}</p></html>\", \n :from_email=>\"sender@eventstarter.com\" \n } \n sending = m.messages.send message \n sending\n end",
"title": ""
},
{
"docid": "60aed6a2e95fa907f948b1a0aa917f35",
"score": "0.6089323",
"text": "def daily_update\n MessagesMailer.daily_update\n end",
"title": ""
},
{
"docid": "eec1ba9073894e6b175c261cb9fad563",
"score": "0.60807705",
"text": "def send_daily_news(user, info)\n @info = info\n mail(to: user.email, subject: 'Новости Тюменского дома фотографии')\n end",
"title": ""
},
{
"docid": "699abb0b67a365c398ef561288b862ca",
"score": "0.60804695",
"text": "def sendMorning(status)\n users = User.where(morning_notify: true)\n users.each do |user|\n TextMailer.morning_email(user, status).deliver_now\n end\n end",
"title": ""
},
{
"docid": "8c0739834541998cafe434b375eb3c5a",
"score": "0.60773087",
"text": "def deliver_trial_emails\n if !self.email_1_sent?\n # Send 15 days before end of trial\n self.send_15_days_till_expire_email if !self.account.account_suspended? && self.account.trial_expires_at.present? && self.account.trial_expires_at < 15.days.from_now\n elsif !self.account.account_suspended?\n # Send 2 days before end of trial\n self.send_2_days_till_expire_email if self.account.trial_expires_at.present? && self.account.trial_expires_at < 2.days.from_now\n elsif self.account.account_suspended?\n # Send 5 days after expiry\n self.send_non_user_feedback_request if self.account.trial_expires_at.present? && self.account.trial_expires_at < 5.days.ago\n end\n end",
"title": ""
},
{
"docid": "a2e6e7242f012889fa6c897c07df7d8c",
"score": "0.60762537",
"text": "def weekly(pot, user)\n @pot = pot\n @links_grouped_by_hottiness = pot.new_links.order(\"hottiness DESC\").group_by(&:hottiness)\n @username = user.name\n\n mail to: user.email, subject: \"#{@pot.name}: #{l(Date.today, format: :short)}\"\n end",
"title": ""
},
{
"docid": "e662ed93ca0c5863eca3518d3aa59d72",
"score": "0.60733056",
"text": "def email_reminder(assignment)\n @assignment = assignment\n\n tag :scheduler, :reminders, :email_reminder\n mail to: format_address(assignment.person), subject: shift_subject\n end",
"title": ""
},
{
"docid": "ef077043bb35aab3c10c81de5a4cbd85",
"score": "0.607004",
"text": "def weekly(id)\n @products = Product.where(\"publish_at > ?\", Time.now - 7.days)\n @subscriber = Subscriber.find(id)\n if @products.count > 1\n mail to: \"#{@subscriber.email}\", subject: \"#{@products.first.name}, #{@products.last.name} and more...\", from: 'hello@startupgrocery.com'\n end\n end",
"title": ""
},
{
"docid": "4c01b6950627f4d615f03aef13ba002e",
"score": "0.6064772",
"text": "def create_next_alert\n \t@item = BorrowedItem.find_by_item_id(self.arguments[2])\n \tif(self.arguments[3] == \"Borrower\" && @item && @item.returned_on == nil)\n \t\tSendEmailJob.set(wait: 1.days).perform_later(self.arguments[0], self.arguments[1], self.arguments[2], self.arguments[3])\n \tend\n end",
"title": ""
},
{
"docid": "3af38a27a295fafdec42274368db449d",
"score": "0.6052509",
"text": "def new_dayoff_registration_request\n dayoff_reg_attributes = Dayoff.new(request_date: \"01/01/2020\", from_date: \"01/01/2020\",\n to_date: \"02/01/2020\", status: \"half day off\", reason: \"Em co viec ban\")\n email = \"trieuphong328@gmail.com\"\n request_user = Account.first\n AdminMailer.new_dayoff_registration_request(email, request_user, dayoff_reg_attributes)\n end",
"title": ""
},
{
"docid": "2d7ad8d849f6a58d5b9d03c5196503b3",
"score": "0.60519284",
"text": "def reminder\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end",
"title": ""
},
{
"docid": "8c43b2e9cbbde7481dc95f52acf7bd6f",
"score": "0.6049576",
"text": "def new_attendance_email\n UserMailer.attendance_email(self).deliver_now\n end",
"title": ""
},
{
"docid": "2c69cef8e27378028d866a3f0c4c0f44",
"score": "0.60412437",
"text": "def message_1day_after_singup(user)\n return unless user.receive_notification\n @user = user\n mail to: user.email, from: 'yaw@loverealm.org', subject: \"How's your LoveRealm experience going?\"\n end",
"title": ""
},
{
"docid": "3285cb1ad625f62fe5b47a176cb2198f",
"score": "0.6038246",
"text": "def send_weekly_report(date = Date.today, previous = self.weekly_report_mtd? ? 0 : 6)\n return if valid_reporting_emails.blank?\n return unless Rails.env.production?\n Notifier.send_later(:deliver_weekly_report, self, self.valid_reporting_emails, date, previous)\n self.update_attribute(:last_weekly_report_sent, DateTime.now)\n end",
"title": ""
},
{
"docid": "fc41eb1d08ac6711872b226156148b0b",
"score": "0.60373175",
"text": "def send_schedule_notification(entries, start_date)\n if entries.present?\n ScheduleMailer.inform_schedule(user.account, user, entries, start_date).deliver\n end\n end",
"title": ""
},
{
"docid": "cdb38b2015f2599a67d013619f57fa5c",
"score": "0.6036697",
"text": "def email_schedule_change\n notifier = ScheduleNotifier.new\n notifier.user = user\n notifier.send_notification\n end",
"title": ""
},
{
"docid": "9d75e3f73668f9196ba116ac9a058543",
"score": "0.60329247",
"text": "def request_sent(request)\n mailtemplate = Mailtemplate.find_by key: 'request_email'\n EventMailer.send_composed_mail(mailtemplate.account,\n request,\n mailtemplate,\n to: [request.email, request.event.account.email]\n ).deliver_later\n end",
"title": ""
},
{
"docid": "fd56a5ba55bfdd3a56b72a13b9403512",
"score": "0.6032725",
"text": "def invite_email(event, email, url)\n\t #@event_name = event.name\n\t #@event_description = event.description\n\t #@event_creater = event.creater\n\t @url = url\n\n mail to: email, subject: 'event info'\n end",
"title": ""
},
{
"docid": "9be5fb667598176ac713e6bbe86286b6",
"score": "0.60300523",
"text": "def weekly_email(user)\n @url = \"http://craftsmanship.sv.cmu.edu\"\n @posts = Post.desc(:created_at).limit(8)\n @id = user.id.to_s\n\n mail(:to => user.email, :subject => \"CMU Craftsmanship Weekly Digest\")\n end",
"title": ""
},
{
"docid": "3f5c350e9f0b8af00551e1bd20166af3",
"score": "0.6026499",
"text": "def reminder(req)\n@req = req\n@greeting = \"Hi\"\nb = @req.startd.to_s.split(\" \")\n@startd = b[1]\nc = @req.endd.to_s.split(\" \")\n@endd = c[1]\nmail to: \"#{@req.email}\", subject: \"Conference Room Booking Rescheduled\"\n end",
"title": ""
},
{
"docid": "4642125d7050862e06374df89d3a521d",
"score": "0.60231376",
"text": "def notify(user,event)\n @event = event\n @user = user\n mail to: @user.email, subject: \"New Event Notification!\"\n end",
"title": ""
},
{
"docid": "70e5bef995647f1e8e4dfc7cf77b7570",
"score": "0.6022073",
"text": "def weekly_schedule(events, group, user)\n timezone user\n\n @events_day_of_week = events_day_of_week(events)\n @group = group\n @user = user\n\n @view_action = {\n url: url_for(\n controller: 'groups', action: 'show', id: @group.id,\n only_path: false\n ),\n action: 'View Tickets',\n description: 'See available tickets.'\n }\n\n mail(\n to: \"#{user.display_name} <#{@user.email}>\",\n subject: \"The week ahead for #{@group.group_name}\"\n )\n\n headers['X-Mailgun-Tag'] = 'WeeklyReminder'\n headers['X-Mailgun-Dkim'] = 'yes'\n headers['X-Mailgun-Track'] = 'yes'\n headers['X-Mailgun-Track-Clicks'] = 'yes'\n headers['X-Mailgun-Track-Opens'] = 'yes'\n end",
"title": ""
},
{
"docid": "cae06b03cf1060d7d14a4cc15c450ad5",
"score": "0.6019971",
"text": "def send_one_6m_reminder_first\n rem_set = AgentRemindersSetting.find_by_rem_type('Agent Six-monthly')\n rem = AgentReminder.find(:first, :conditions => ['rem_type = ? and month = ? and rem_count > ? and sent = ? and ignore_it = ?', 'six-monthly', rem_set.month, 0, false, false])\n if rem != nil\n do_one_reminder(rem.id(), true)\n else\n render :text => \"Nothing to send\"\n end\n end",
"title": ""
},
{
"docid": "6163837cb4abca017c9a87ab5556ed39",
"score": "0.60163176",
"text": "def send_reminder(publication)\n # Check that publication is not submitted\n if !publication.state.include? \"_submitted\" \n email = Email.find_by_trigger(\"#{publication.state}_remind\") \n # Check that delay is set\n if email.delay.days > 0\n # Check if update since last\n if publication.updated_at > self.last_email_at\n Reminder.create(:publication_id => publication.id, :state => publication.state, :action => 'updated', :last_email_at => publication.updated_at)\n # Check if more time than delay has gone\n elsif Time.now > self.last_email_at + email.delay.days\n # Send out email\n Notifier.deliver_workflow_notification(publication.user,email) \n Reminder.create(:publication_id => publication.id, :state => publication.state, :action => 'reminded', :last_email_at => publication.updated_at)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "0357423da462bafdb4f63793d54e48ac",
"score": "0.6015898",
"text": "def send_trial_expired_one(booking)\n @booking = booking\n @account = @booking.account\n @subject = I18n.t(:send_trial_expired_one_subject)\n\n mail(to: @account.email,\n subject: @subject,\n bcc: 'go@wundercoach.net')\n end",
"title": ""
},
{
"docid": "f4e00b87f738616c870e9ff007baa680",
"score": "0.6014212",
"text": "def notify_tenant(event, text)\n @event = event\n @text = text\n # @user = current_user\n mail(to: \"sesboue.olivier@gmail.com\", subject: \"#{@event.description}\")\n end",
"title": ""
},
{
"docid": "59f8a7b1c53b9f03a536a3902c7b4e76",
"score": "0.6013112",
"text": "def after_create_event(event)\n @event = event\n \n mail to: event.players.map { |p| p.email}\n\n end",
"title": ""
}
] |
b2ea6e9321a87cab63bab7df1baa20a1
|
Use 'open' to open the document with words from the URL and push each line into the 'WORDS' array.
|
[
{
"docid": "d821ced77cdb8552e8b65f2b409918d8",
"score": "0.0",
"text": "def craft_names(rand_words, snippet, pattern, caps=false)\nnames = snippet.scan(pattern).map do\n word = rand_words.pop()\n caps ? word.capitalize : word\nend\n\nreturn names * 2\nend",
"title": ""
}
] |
[
{
"docid": "5124ac99fb3611a6a9029fa6f935333e",
"score": "0.6205115",
"text": "def document\n open(url).string.split(';')\n end",
"title": ""
},
{
"docid": "7bca6388d976b71a6675414ae8b780da",
"score": "0.60704446",
"text": "def open\n require 'wiki-lib'\n ary = Array.new\n Selection.each do |dd|\n docu = dd.cite_key.get\n ary << docu unless File.exists?(\"#{Wikipages_path}/ref/#{docu}.txt\")\n ensure_refpage(docu)\n end\n `open http://localhost/wiki/ref:#{Selection[0].cite_key.get}`\nend",
"title": ""
},
{
"docid": "006114633bb7d853965729039126a876",
"score": "0.5603132",
"text": "def initialise(*url)\n @urls = [] \n list = File.open('url_list').each do |url|\n puts url\n doc = Nokogiri::HTML(open(url)) \n @urls.push(doc)\n end\n end",
"title": ""
},
{
"docid": "bf1c8eb1056f7370ebeef8fb2c1766ab",
"score": "0.55746347",
"text": "def wordCollector(pageName)\n\twordHash = Hash.new 0\n\twords = Array.new\n\n\tcurrentPage = Nokogiri::HTML(open(pageName, :allow_redirections => :safe))\n\tpageText = currentPage.css('p').to_s\n\twords = pageText.split(/\\W+|\\d/)\n\twords.each do |string|\n\t wordHash[string] += 1\n\tend\n\treturn Website.new(pageName, wordHash, words.length)\nend",
"title": ""
},
{
"docid": "93fd6302a781c20efd606a791bdcdba9",
"score": "0.55669165",
"text": "def url_grabber()\nFile.open('urls.txt').readlines.each do |url|\n @file_url.push(url)\nend\n\n# @file_url.each do |f_url|\n# puts \"This is one of the urls we read in from the file: \" + f_url.to_s\n# end\n\nend",
"title": ""
},
{
"docid": "f355159de00c7aa049f743475e63e8d8",
"score": "0.54670054",
"text": "def load_words\n File.readlines(\"#{WORD_DIR}/#{language}.txt\").map(&:strip)\n end",
"title": ""
},
{
"docid": "54ea83b921612952470e673735a4f542",
"score": "0.5451298",
"text": "def add_words_from_text_file(file_path)\n words = []\n\n File.open(file_path, 'r') do |file|\n file.each do |line|\n words.push(line.chomp)\n end\n end\n\n add_words(words)\n end",
"title": ""
},
{
"docid": "da9f60593bf3ff12c905e3418da759ce",
"score": "0.5449027",
"text": "def add_to_index(url, doc)\n unless is_indexed(url)\n # FIXME: replace with logging\n puts \"Indexing #{url}...\"\n \n # Get the individual words\n text = get_text_only(doc)\n words = separate_words(text)\n \n u = Url.find_by_url(url)\n if u.nil?\n u = Url.create!(:url => url)\n end\n \n # Link each word to this url\n words.each_with_index do |word, i|\n unless IGNORE_WORDS.member?(word)\n w = Word.find_by_word(word)\n if w.nil?\n w = Word.create!(:word => word)\n end\n w.word_locations.create!(:url_id => u.id, :location => i)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "d8db0eaa6746d0285c030b8208793e7c",
"score": "0.54445845",
"text": "def initialize\n self.word_list = []\n WORD_FILES.each do |word_file|\n contents = File.read(File.dirname(__FILE__)+word_file)\n self.word_list = word_list + contents.split(/\\n/)\n end\n end",
"title": ""
},
{
"docid": "a1a37f3586345c5a67e5626030dc5aa2",
"score": "0.5426887",
"text": "def words_from_file( f )\n result = Array.new\n File.foreach( f ) do | line |\n result << self.words_from_string( line )\n end\n result.flatten\n end",
"title": ""
},
{
"docid": "e4b7a5bc8262065b4a2c5645f7f015e0",
"score": "0.5415252",
"text": "def load_words(file_name)\n words_loaded = []\n File.open(file_name).readlines.each do |line|\n words_loaded << line if line.length.between?(5, 12)\n end\n words_loaded\n end",
"title": ""
},
{
"docid": "c9d9e2121f0ad973f8a2ea5f6c7f51e0",
"score": "0.5413883",
"text": "def load_word_list\n @word_list = []\n puts \"Loading word list...\"\n File.readlines(WORDLIST_FILE).each{|word|\n word.gsub!(/[\\r\\n]+/,\"\")\n if valid_word?(word, @inner_letter, @outer_letters)\n @word_list << word\n end\n }\n @word_list.sort!\n puts \"Word list loaded.\"\n end",
"title": ""
},
{
"docid": "5de4aade5153df717829e08925145dc3",
"score": "0.53952795",
"text": "def index(url)\n open(url, \"User-Agent\" => USER_AGENT){ |doc| \n h = Hpricot(doc)\n title, body = h.search('title').text.strip, h.search('body')\n %w(style noscript script form img).each { |tag| body.search(tag).remove}\n array = []\n body.first.traverse_element {|element| array << element.to_s.strip.gsub(/[^a-zA-Z ]/, '') if element.text? }\n array.delete(\"\")\n yield(array.join(\" \").words, title)\n } \n end",
"title": ""
},
{
"docid": "7525a57d50824f770d6484c56d468f85",
"score": "0.5382938",
"text": "def load_words\n File.read(\"../scrabble word cheat/words.txt\").split(\"\\n\")\nend",
"title": ""
},
{
"docid": "f89d09d907f5619d5690def05041ee18",
"score": "0.53719884",
"text": "def read_word_file(file)\n\t\tFile.foreach(file) do |line|\n\t\t\tif(@@word.legal?(line.chomp)) # Check if current line/word is legal\n\t\t\t\tLEGAL_WORDS << line.chomp # Add line/word to array of legal words\n\t\t\tend\n end\n LEGAL_WORDS.freeze # Freeze LEGAL_WORDS to make it immutable\n\tend",
"title": ""
},
{
"docid": "3bc845ef9dcc1422b6068d0e6207e090",
"score": "0.5332173",
"text": "def prepare_words(filename)\n @words = []\n File.readlines(filename).each do |line|\n line.split.each {|word| @words << word}\n end\n end",
"title": ""
},
{
"docid": "4f59e518c76552004e644118aa24012a",
"score": "0.5320519",
"text": "def set_word_list\n word_list = []\n min_length = 5\n max_length = 12\n # Fixed external word_list file has only one word per line\n if File.exist? \"../word_list.txt\"\n File.open(\"../word_list.txt\").each do |line|\n line_clean = line.chomp\n if (line_clean.length >= min_length && line_clean.length <= max_length)\n word_list.push(line_clean)\n end\n end\n else\n word_list.push(\"FileWordListTextDoesNotExist\")\n end\n return word_list\n end",
"title": ""
},
{
"docid": "e6c646dae6c94329e9810f549de9b5c7",
"score": "0.53007984",
"text": "def read_word_file\n File.open(\"5desk.txt\").each { |line| @text_file << line }\n end",
"title": ""
},
{
"docid": "fcf47c5cdd4f7d1490bddab275dae1dc",
"score": "0.5293786",
"text": "def wordlist(filename)\n wordlist = []\n File.foreach(filename) { |x| wordlist << x.delete!(\"\\r\\n\") }\n wordlist\nend",
"title": ""
},
{
"docid": "7b7182fd7d935deaa12bab4e3737d20b",
"score": "0.52851444",
"text": "def run\n\t\t\t\tif save_file\n\t\t\t\t\tdoc = Nokogiri::HTML(open(@file,\"r\"))\n\t\t\t\t\tparse_page(doc)\n\t\t\t\t\tflush_page\n\t\t\t save_words\n\t\t\t end\n\t\t\tend",
"title": ""
},
{
"docid": "8a6c3cc974c342b0d15f0aef037db21c",
"score": "0.52432036",
"text": "def ReadFromFile()\n wordArray = Array.new\n File.open(\"mastermindWordList.txt\", \"r\") do |file| # Uncomment this to have a larger list (466000+ words)\n # Note: Only use if in original repository that contains words.txt\n # File.open(\"mastermindWordList.txt\", \"r\") do |file| # Comment this if previous line is uncommented\n file.each_line do |word|\n if CheckValidWord(word) == true\n wordArray.push(word.chomp.downcase)\n end\n end\n end\n return wordArray\nend",
"title": ""
},
{
"docid": "2dec73f05ec0f0be7a2ae75edd84eed6",
"score": "0.5233978",
"text": "def read_words(dictionary)\n unless FileTest.file?(dictionary)\n p \"Provided #{dictionary} is not a filepath or such file doesn't exist.\"\n return []\n end\n\n words = []\n IO.foreach(dictionary) { |line| words << line.strip }\n words\n end",
"title": ""
},
{
"docid": "9d705e47b352b9da56918fb70524c20d",
"score": "0.52329093",
"text": "def load_words\n words = []\n\n begin\n sql = \"SELECT word_id, spelling, count FROM Words;\"\n stm = @db.prepare sql\n rs = stm.execute\n\t\t while (row = rs.next) do\n\t\t id, s, c = *row\n\t\t words << Word.new(s, :count=>c, :id=>id)\n\t\t end\n ensure\n stm.close\n end\n\n begin \n sql = \"SELECT file_path, file_count FROM WordFiles WHERE word_id = ?\"\n stm = @db.prepare sql\n\n\t\t words.each do |w|\n\t\t rs = stm.execute(w.id)\n\t\t files = {}\n\t\t while (row = rs.next) do\n\t\t path, count = *row\n\t\t files[path] = count\n\t\t end\n\t\t w.files = files\n\t\t end\n ensure\n stm.close\n end\n\n return words\n end",
"title": ""
},
{
"docid": "f96f092a452bb659c1dc740f8cbdf224",
"score": "0.5217807",
"text": "def get_info(w)\n\trequire 'open-uri'\n\tparagraph = []\n\tcontents = open('http://en.wikipedia.org/wiki/' + w) {|f| \n\t\tf.readlines.each {|x| \n\t\t\tif x =~ /<p>(.*)<\\/p>/\n\t\t\tparagraph.push($1)\n\t\t\tend\n\t}}\n\n\t# If a file name was passed in to be stored somewhere\n\t# Otherwise, Temp.doc will be created and modified\n\tif(ARGV[0] != nil)\n\t\tfile = File.open(ARGV[0], 'a')\n\telse\n\t\tfile = File.open(\"Temp.doc\", 'a')\n\tend\n\n\t# Writes to file what is being searched for\n\tfile.write(w.upcase + \":\\n\")\n\n\t# Uses regular expression to grab first two paragraph\n\tparagraph.each {|p| paragraph(p,file)}\n\t\n\tfile.write(\"\\n\")\n\tfile.close\nend",
"title": ""
},
{
"docid": "a40694d208ad71dadf75dd8ef855d72d",
"score": "0.5166977",
"text": "def scanner\n @sentences ||= File.open(@path) do |file|\n file.each_line.each_with_object([]) do |line, acc|\n stripped_line = line.strip\n\n unless stripped_line.nil? || stripped_line.empty?\n acc << line.split(' ').map do |word|\n word.split('/').first\n end.join(' ')\n end\n end\n end\n\n end",
"title": ""
},
{
"docid": "8b8271b634cbb770f239f710bd950acb",
"score": "0.5156072",
"text": "def words\n @content.split\n end",
"title": ""
},
{
"docid": "8b8271b634cbb770f239f710bd950acb",
"score": "0.5156072",
"text": "def words\n @content.split\n end",
"title": ""
},
{
"docid": "a2ca323928f1561e943fc8fba13f060d",
"score": "0.5109198",
"text": "def getScrapingURLs(shared)\n\tFile.open(\"urls.txt\").each do |line|\n\t\tshared.pushurl(line.chomp)\n\tend\nend",
"title": ""
},
{
"docid": "c3a7192bcb6246e409550219bfb5426e",
"score": "0.5080033",
"text": "def initialize(word_list_file_path)\n word_list = ::File.readlines(word_list_file_path).map(&:chomp)\n @words = word_list.map(&:downcase)\n end",
"title": ""
},
{
"docid": "da2adc119d205b850b817c162ae132e6",
"score": "0.50746804",
"text": "def initialize \n @story_keywords = [] # Creates the array that will hold the part of speech keywords\n end",
"title": ""
},
{
"docid": "850f83d4913e8b83906c86158fffd338",
"score": "0.50669503",
"text": "def get_spelling_words(file)\n lines = IO.readlines(file).map(&:chomp)\n review_word = false\n challenge_word = false\n words = []\n lines.each do |line|\n if md=line.match(/\\A(\\d+)\\.\\s+(\\w+)\\Z/)\n (num, word) = md.captures\n words << SpellingWord.new(num, word, review_word, challenge_word)\n elsif line.match(/\\AReview Words/)\n review_word = true\n challenge_word = false\n elsif line.match(/\\AChallenge Words/)\n challenge_word = true\n review_word = false\n end\n end\n words\nend",
"title": ""
},
{
"docid": "4d3ea7d6382e1e2c6a17f78034f19e55",
"score": "0.50515896",
"text": "def get_stopword_list\n list = []\n \n begin\n File.open(\"stopwords.txt\", \"r\") do |file|\n file.each_line { |line| list.push( line.chomp ) }\n end\n rescue\n puts \"The file 'stopwords.txt' was not found.\"\n exit\n end\n\n return list\nend",
"title": ""
},
{
"docid": "0e584b8180502b9c885c65d3acbfd6bf",
"score": "0.50415057",
"text": "def map_words_on_page\n fetcher = FetchUrl.new\n page_content = fetcher.fetch(self[:url]).body\n\n processor = PageProcessor.new\n processor.process_page page_content\n end",
"title": ""
},
{
"docid": "c23ed138e757162e56c307edbe9a6f7d",
"score": "0.50389314",
"text": "def make_list\n file = File.new(\"dictionary.txt\")\n dict_list = Array.new\n # add all the words that are the same length as the user's word to an array\n while (line = file.gets)\n if (line.length - 1 == @word1.length)\n dict_list.push line.chomp\n end\n end\n dict_list\n end",
"title": ""
},
{
"docid": "980e05c91777ad5ce6f17dbe87553020",
"score": "0.50352836",
"text": "def process_url\n map = map_words_on_page\n map.each do |word, count|\n wc = WordCount.new(:word=>word, :count=>count, :page_id => object_id)\n push wc # todo pull the push/stack functionality out of Page to minimize db calls\n end\n end",
"title": ""
},
{
"docid": "a96fabb35666926e355fee29f6b0482f",
"score": "0.500882",
"text": "def read()\n a=[]\n f=open(\"words.txt\")\n f.each_line {|line|\n a[a.length]=line.chomp}\n f.close\n return a\nend",
"title": ""
},
{
"docid": "bd960d60b4788eeb6f8a54028ac158d1",
"score": "0.50014865",
"text": "def wordlist\n # Split defaults to splitting on white space\n File.read(File.expand_path('../data/subdomains.txt', __FILE__)).split\n end",
"title": ""
},
{
"docid": "95c7ac3865c5f640de7c1094d4a8a4ae",
"score": "0.49876472",
"text": "def process_wikiwords(full_document)\n doc = full_document.dup\n doc.gsub!(/\\[\\[([A-Za-z0-9_\\-\\ ]+)\\]\\]/) do |match|\n name = $1\n link = name.gsub(/\\s+/, '-')\n if md = /^(\\d\\d\\d\\d-\\d\\d-\\d\\d-)/.match(link)\n date = md[1].gsub('-', '/')\n link = link.sub(md[1], date)\n end\n \"[#{name}](#{link}.html)\"\n end\n return doc\n end",
"title": ""
},
{
"docid": "c3875cbf8e6ee6b55463eff184c60d7a",
"score": "0.49847648",
"text": "def get_word_value_array(word)\n html = RestClient.get(\"http://www.thesaurus.com/browse/#{word}\")\n word_string = Nokogiri::HTML(html).css(\"div.relevancy-list ul li a\").to_a\n part_of_speech = Nokogiri::HTML(html).css(\"div.mask ul li a em\")[0].text\n word_definition = Nokogiri::HTML(html).css(\"div.mask ul li a strong\")[0].text\n [word_string, \"(#{part_of_speech}) #{word_definition}\"]\n end",
"title": ""
},
{
"docid": "a9634e5fe88e122e8cc9501155f158ec",
"score": "0.4962103",
"text": "def list\n @list ||= Vidibus::Words.words(input)\n end",
"title": ""
},
{
"docid": "2cc58f014c7273cd63708ba668124014",
"score": "0.4956317",
"text": "def open(url)\n Net::HTTP.get(URI.parse(url))\nend",
"title": ""
},
{
"docid": "2cc58f014c7273cd63708ba668124014",
"score": "0.4956317",
"text": "def open(url)\n Net::HTTP.get(URI.parse(url))\nend",
"title": ""
},
{
"docid": "73e7c817d3fd4972b3db20cdb4a9bf05",
"score": "0.49557135",
"text": "def populate(file)\n words = file.split(\"\\n\")\n insert_words(words)\n end",
"title": ""
},
{
"docid": "a931f199abf27547d425da7314266347",
"score": "0.49522477",
"text": "def open_page\n html = open(\"https://www.geonames.org/countries/\")\n country_table = Nokogiri::HTML(html).css('#countries')\n country_table = country_table.css('td').css('a').collect {|l| l}\n end",
"title": ""
},
{
"docid": "06a52fbf44c484e671543b2f6351cc61",
"score": "0.4934357",
"text": "def word_list\n @word_list ||= Set.new File.read(\"dictionary.txt\").split(\"\\n\").map(&:downcase)\n end",
"title": ""
},
{
"docid": "56562a13cb38c5a8967359ac36f7117f",
"score": "0.49264646",
"text": "def read_lines\n File.read(@document_file).split(\"\\n\")\n end",
"title": ""
},
{
"docid": "8dfad8d337edf4c4e91c46ce81aec395",
"score": "0.49060574",
"text": "def load_words\n case @strategy\n when :user\n @words = twitter_user.status.text.split(/\\s/) \n when :search\n @words = twitter_search(@term).statuses.map(&:text).join(\" \").split(/\\s/)\n end\n end",
"title": ""
},
{
"docid": "23894e33dcf12dbaeae58c4d887e51c3",
"score": "0.4874514",
"text": "def initialize words\n @word_list = words\n end",
"title": ""
},
{
"docid": "a7432cf7583808b5f924b2757c64696a",
"score": "0.4863361",
"text": "def go_through_all_the_lines(url)\n list = CSV.read(url)\nend",
"title": ""
},
{
"docid": "5e6496854c46dd5a4749e5f046bda4cb",
"score": "0.48470792",
"text": "def valid_words\n return @valid_words if @valid_words && @valid_words.length > 0\n\n @valid_words = Set.new\n @io.each_line do |l|\n l.encode!('UTF-8', 'UTF-8', invalid: :replace, undef: :replace, replace: '')\n # Funny story, in place methods are faster.\n l.gsub!(/[^[:alnum:]^[:blank:]]/, \"\")\n l.downcase!\n l.strip!\n # Only 'short' words (discard numbers only)\n l.split(\" \").reject{|w| /\\A\\d+\\z/.match(w) || w.length < 3 || w.length > 10}.each do |w|\n @valid_words.add(w)\n end\n end\n @valid_words\n end",
"title": ""
},
{
"docid": "21f0ee9907857e66dabfe9d170bbf192",
"score": "0.4846316",
"text": "def split_document_txt_by_line(input_file, opts = {})\n data, _status_code, _headers = split_document_txt_by_line_with_http_info(input_file, opts)\n data\n end",
"title": ""
},
{
"docid": "d343fc91330ebc6cce166f2313ee6c0d",
"score": "0.48456043",
"text": "def initialize(url)\n begin\n @result = open(url)\n @doc = Hpricot(@result)\n @result.close\n rescue\n @doc = nil\n end \n end",
"title": ""
},
{
"docid": "791698ada49602dab581ced814795f3c",
"score": "0.48421586",
"text": "def get_keywords( descriptions )\n keywords = []\n descriptions.each do |description|\n page_text = Nokogiri::HTML(description).text\n keywords.concat( page_text.split(/\\W+/) )\n end\n\n return keywords\nend",
"title": ""
},
{
"docid": "36579e4c410590b4dfb482eef6c65e96",
"score": "0.483923",
"text": "def words\n @words_array = @phrase.split(' ')\n end",
"title": ""
},
{
"docid": "ff28df8fbbd7b23af9e59641280f5197",
"score": "0.48256862",
"text": "def load_used_phrases\n\t@used_phrases = load_collection_from_file(@phrase_file_name, {});\nend",
"title": ""
},
{
"docid": "adc30505d5d39c270bc5893989332963",
"score": "0.48222408",
"text": "def find_some_number_of_words_by_length(number_of_words, max_length, url)\n page_content = open(url)\n all_lines = page_content.split(\"\\n\")\n formatted_lines = []\n all_lines.each do |line|\n each_line = line.split(\"\\t\")\n word = each_line[0]\n frequency = each_line[1]\n formatted_lines.push([word, frequency])\n end\n\n words_of_max_length = []\n formatted_lines.each do |line|\n word = line[0]\n frequency = line[1]\n if word.length <= max_length && word.length >= 2 && words_of_max_length.length < number_of_words\n words_of_max_length.push(line)\n end\n end\n words_of_max_length\nend",
"title": ""
},
{
"docid": "3abbe0d1c4ab98746e9e1e21b72356b7",
"score": "0.48126715",
"text": "def words\n word_list = @lines.map do |line|\n line.split(\" \")\n end\n word_list.uniq\n end",
"title": ""
},
{
"docid": "455a7ad659f4ae2561bff1fee56dcdd9",
"score": "0.47979024",
"text": "def open_url\n u = URI.parse(@host_url)\n u.open { |file| @html_doc = Nokogiri::HTML(file) }\n\n rescue OpenURI::HTTPError => excp\n raise \"#{excp}, could not open #{@host_url} \"\n ensure\n @html_doc\n end",
"title": ""
},
{
"docid": "82caf3a0d5c8835cd68e73826117e999",
"score": "0.47907475",
"text": "def get_words\n response = HTTParty.get('http://linkedin-reach.hagbpyjegb.us-west-2.elasticbeanstalk.com/words')\n converted_response = response.parsed_response\nend",
"title": ""
},
{
"docid": "6eb4a1a04b3b4034adde95fbcd87ce11",
"score": "0.47753596",
"text": "def list_contents!\n if storage_exists?\n list_contents\n else\n raise IOError, \"No banned words file!\"\n end\n end",
"title": ""
},
{
"docid": "54c497b85af009aeb514f62140984a8c",
"score": "0.47747275",
"text": "def extract_all_words(html)\n doc = Nokogiri::HTML(html)\n keywords = []\n doc.css(\"meta[name='keywords']\").each do |node|\n keywords += node['content'].gsub(/\\s+/, \" \").gsub(/[^a-zA-Z\\- ',]/, '').squeeze(\" \").split(\",\")\n end\n text = String.new\n doc.css(\"meta[name='description']\").each do |node|\n text += node['content']\n end\n \n %w(script style link meta).each do |tag|\n doc.css(tag).each { |node| node.remove }\n end\n\n w = []\n doc.traverse do |node|\n if node.text? then\n w << node.content + \" \"\n end\n end\n text += w.join.gsub(/\\s+/, \" \").gsub(/[^a-zA-Z\\- ']/, '').squeeze(\" \")\n words = (text.downcase.split - STOPWORDS)\n \n final = (keywords + words)\n final.map do |w|\n w.stem\n end\n end",
"title": ""
},
{
"docid": "3a8203b25d8e747fa33f29dd8c3d8fc9",
"score": "0.47661814",
"text": "def open_page(url)\n people = []\n doc = Nokogiri::HTML(open(url))\n doc.css(\".results tbody tr\").each do |elem|\n # puts elem.css(\"td\").inspect\n person = {\n :surname => elem.children[0].text,\n :forename => elem.children[1].text,\n :townland => elem.children[3].text,\n :district => elem.children[4].text,\n :county => elem.children[5].text,\n :age => elem.children[6].text,\n :sex => elem.children[7].text,\n :birthplace => elem.children[8].text,\n :occupation => elem.children[9].text,\n :religion => elem.children[10].text,\n :literacy => elem.children[11].text,\n :language => elem.children[12].text,\n :relationship_to_head => elem.children[13].text\n }\n people << person\n end\n return doc, people\nend",
"title": ""
},
{
"docid": "f44e340d409fe057f256f72cf4a90c02",
"score": "0.47584546",
"text": "def process(url)\n p \"requesting...#{url}\"\n raw = Timeout.timeout(TIMEOUT) { Nokogiri::HTML(open(url)) }\n result = raw.xpath(\"//meta[@name='keywords']/@content\").first.value\n CSV.open('./data/townwork-result.csv', 'ab') { |csv| csv << [url, result] }\n end",
"title": ""
},
{
"docid": "df77a825541087106c6f5bf6c17cfc25",
"score": "0.4743876",
"text": "def initialize\n @words_set = Set.new\n words_file = File.expand_path(File.dirname(__FILE__) + '/words.txt')\n File.readlines(words_file).each do |line|\n @words_set.add(line.to_s.strip)\n end\n end",
"title": ""
},
{
"docid": "d093f25b98612d3c230120776baabf78",
"score": "0.4736719",
"text": "def words\n @words ||= (\n load_words(1000) || corpus.words.to_h(1000)\n )\n end",
"title": ""
},
{
"docid": "8dfe771f02a55aafb3ce9e519e12d4ed",
"score": "0.47330314",
"text": "def open\n @url = @@youtube_search_base_url + CGI.escape(@keyword)\n @url += \"&page=#{@page}\" if not @page == nil\n @url += \"&search_sort=#{@sort}\" if not @sort == nil\n @html = Kernel.open(@url).read\n replace_document_write_javascript\n @search_result = Hpricot.parse(@html)\n end",
"title": ""
},
{
"docid": "c047ea9718d698a282a9ddb9a269ab3a",
"score": "0.4711809",
"text": "def list\n extract_names_and_urls = lambda do |doc|\n [extact_url(@url, document), extract_titles(document)]\n end\n \n html.css('a').map(&extract_names_and_urls)\n end",
"title": ""
},
{
"docid": "723790301e07f892a6fb9506ffb9f3e5",
"score": "0.47116134",
"text": "def words\n self.scan(WORD_PATTERN)\n end",
"title": ""
},
{
"docid": "5af2b443863c1095345625b1589d62aa",
"score": "0.47112167",
"text": "def open_document\n @document = Nokogiri::XML(open(@feed_uri).read)\n end",
"title": ""
},
{
"docid": "e8a5ccf548b5817907925847a046d9b8",
"score": "0.46974778",
"text": "def documents\n # This function and its helpers are side-effecty for speed\n @documents ||= raw[:hits][:hits].map do |hit|\n doc = extract_source(hit)\n copy_underscores(hit, doc)\n copy_highlight(hit, doc)\n doc\n end\n end",
"title": ""
},
{
"docid": "2f08a82aaef292d07793c7a70660ba9e",
"score": "0.46952757",
"text": "def load(file)\n words = File.readlines(file)\n words = words.collect {|word| Word.new(word.chomp.downcase) }\n change_wordlist(words.select {|word| word.word.length >= 5 && word.word =~ /^([a-z])+$/ })\n self\n end",
"title": ""
},
{
"docid": "08f7053d54def049242f5417889d6a8c",
"score": "0.46909538",
"text": "def words_to_pos_array(filename)\n\tcorpus = File.new(filename, \"r\")\n\twhile(line = corpus.gets)\n\t\tword = line.chomp.split(\":\")\n\t\tif(word[1] == \"Noun\")\n\t\t\t@noun << word[0].split(\";\")\n\t\tend\n\t\tif(word[1] == \"Proper_Noun\")\n\t\t\t@proper_noun << word[0]\n\t\tend\n\t\tif(word[1] == \"Noun_Phrase\")\n\t\t\t@noun_phrase << word[0]\n\t\tend\n\t\tif(word[1] == \"Verb\")\n\t\t\t@verb << word[0].split(\";\")\n\t\tend\n\t\tif(word[1] == \"Transitive_Verb\")\n\t\t\t@transitive_verb << word[0].split(\";\")\n\t\tend\n\t\tif(word[1] == \"Intransitive_Verb\")\n\t\t\t@intransitive_verb << word[0].split(\";\")\n\t\tend\n\t\tif(word[1] == \"Adjective\")\n\t\t\t@adjective << word[0]\n\t\tend\n\t\tif(word[1] == \"Adverb\")\n\t\t\t@adverb << word[0]\n\t\tend\n\t\tif(word[1] == \"Conjunction\")\n\t\t\t@conjunction << word[0]\n\t\tend\n\t\tif(word[1] == \"Preposition\")\n\t\t\t@preposition << word[0]\n\t\tend\n\t\tif(word[1] == \"Interjection\")\n\t\t\t@interjection << word[0]\n\t\tend\n\t\tif(word[1] == \"Pronoun\")\n\t\t\t@pronoun << word[0]\n\t\tend\n\t\tif(word[1] == \"Article\")\n\t\t\t@article << word[0]\n\t\tend\n\t\tif(word[1] == \"Singular_Article\")\n\t\t\t@singular_article << word[0]\n\t\tend\n\t\tif(word[1] == \"Plural_Article\")\n\t\t\t@plural_article << word[0]\n\t\tend\n\t\tif(word[1] == \"Number\")\n\t\t\t@number << word[0]\n\t\tend\n\t\tif(word[1] == \"Helping_Verb\")\n\t\t\t@helping_verb << word[0].split(\";\")\n\t\tend\n\t\tif(word[1] == \"Relative_Adverb\")\n\t\t\t@relative_adverb << word[0]\n\t\tend\n\t\tif(word[1] == \"Relative_Pronoun\")\n\t\t\t@relative_pronoun << word[0]\n\t\tend\n\t\tif(word[1] == \"Singular_Demonstrative\")\n\t\t\t@singular_demonstrative << word[0]\n\t\tend\n\t\tif(word[1] == \"Plural_Demonstrative\")\n\t\t\t@plural_demonstrative << word[0]\n\t\tend\n\t\tif(word[1] == \"Quantifier\")\n\t\t\t@quantifier << word[0]\n\t\tend\n\t\tif(word[1] == \"Coordinating_Conjunction\")\n\t\t\t@coordinating_conjunction << word[0]\n\t\tend\n\t\tif(word[1] == \"Possessive\")\n\t\t\t@possessive << word[0]\n\t\tend\n\tend\nend",
"title": ""
},
{
"docid": "d25580fe945bcb64459b20a30d987e96",
"score": "0.46875995",
"text": "def docs\n unless @docs\n @docs = []\n content().each_line do |l|\n next unless l =~ %r{/usr/share/doc/packages}\n @docs << l\n end\n end\n @docs\n end",
"title": ""
},
{
"docid": "744c7e4ef3c3fa00260fd7d8b6046f15",
"score": "0.4684289",
"text": "def call\n total = dataset.document_count\n ret = {}\n\n enum = RLetters::Datasets::DocumentEnumerator.new(dataset: dataset)\n enum.each_with_index do |doc, i|\n progress&.call((i.to_f / total.to_f * 100).to_i)\n\n lister = Documents::WordList.new\n words = lister.words_for(doc.uid)\n\n tagged = Tagger.add_tags(words.join(' '))\n next if tagged.nil?\n\n nouns = Tagger.get_nouns(tagged)\n next if nouns.nil?\n\n ret.merge!(nouns) { |_, v1, v2| v1 + v2 }\n end\n\n progress&.call(100)\n ret.sort_by { |(_, v)| -v }\n end",
"title": ""
},
{
"docid": "e5968cf8c97d6123c3e75c85e4985402",
"score": "0.4677039",
"text": "def load_document(url, filters = {})\n html = load_html(url, filters)\n\n CSV.parse(html, col_sep: \"\\t\").map(&:first)\n end",
"title": ""
},
{
"docid": "0a7a0cb0586f7f566fd26b9e00861cb1",
"score": "0.4675165",
"text": "def list\n response = @user.get(@base_uri)\n response[\"linked-documents\"].map {|ld| LinkedDocument.new(@user, ld) }\n end",
"title": ""
},
{
"docid": "055096f450e2bc19b9d5046c9377081f",
"score": "0.46738338",
"text": "def load_sites(path)\n sites = {}\n File.foreach(path) do |line|\n name, url = line.split(\",\")\n sites[name] = url.strip\n end\n sites\nend",
"title": ""
},
{
"docid": "342d4ca054a8a6640f0303fd449ad9ed",
"score": "0.46729794",
"text": "def parse\r\n @words = @line.split\r\n\r\n @invalid_words = []\r\n @words.each do |word|\r\n w = word.gsub(/([\\+\\.,*\\'\\\";:\\(\\)`\\[\\]?!#])*/,'')\r\n w = w.gsub('<', '')\r\n w = w.gsub('>', '')\r\n next if w == ''\r\n next if w.include?(\"`\") or w.include?(\"'\") or w.include?(\"/\")\r\n next if w.to_i.to_s == w # ignore integers\r\n next if is_white?(w)\r\n\r\n # process < and >\r\n if !(word.include? '<' or word.include? '>')\r\n next if w.start_with? \"http\"\r\n next if w.include? '-'\r\n next if w.downcase.start_with? 'todo'\r\n end\r\n\r\n\r\n if !$speller.correct? w\r\n @invalid_words.push w\r\n if ENV['HTML']\r\n @colorize_line = @colorize_line.gsub(word, \"<span style='color: red;font-weight: bold;'>#{word}</span>\")\r\n else\r\n @colorize_line = @colorize_line.gsub(word, \"\\e[31m#{word}\\e[0m\")\r\n end\r\n end # speller.correct\r\n\r\n end # end for each word\r\n @invalid_words.count !=0\r\n end",
"title": ""
},
{
"docid": "ce028cdee2780c67f62d71f885ed7956",
"score": "0.46705636",
"text": "def extract\n parse_word_boundaries(file_content).to_json\n end",
"title": ""
},
{
"docid": "a5966c5bef5d68e828c12c815bbe1988",
"score": "0.46703997",
"text": "def parse_content\n doc = Nokogiri::HTML(open(url.source))\n doc.css('a', 'h1', 'h2', 'h3').map do |link|\n UrlContent.new do |urlc|\n content = link.content.strip.force_encoding(\"utf-8\")\n if link.node_name == 'a'\n content = link.get_attribute(\"href\")\n if not (content.present? and (content.starts_with?(\"http\") or content.starts_with?(\"www\")))\n content = url.source+content.to_s\n end\n end\n urlc.content = content\n urlc.content_type = link.node_name\n urlc.url = self.url\n end\n end\n end",
"title": ""
},
{
"docid": "67e3e416cfdd712b1cbcbf74aafb4bab",
"score": "0.46689755",
"text": "def get_document_info\n\n begin\n\n str_uri = $product_uri + '/words/' + @filename\n signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)\n\n response_stream = RestClient.get(signed_str_uri, {:accept => 'application/json'})\n\n stream_hash = JSON.parse(response_stream)\n stream_hash['Code'] == 200 ? stream_hash['Document'] : false\n\n rescue Exception => e\n print e\n end\n\n end",
"title": ""
},
{
"docid": "7c9c0aef1b881ed494a97886cc0e05f9",
"score": "0.46651712",
"text": "def word_list\n @word_list\n end",
"title": ""
},
{
"docid": "31459d5e603bb6f6aed93289c75cf142",
"score": "0.46650577",
"text": "def urls(text)\n scan(text, URL, :url)\n end",
"title": ""
},
{
"docid": "0c9a1c72dfc491536dd4510463753a7a",
"score": "0.46487707",
"text": "def split_text(text)\n\t#splits the text into words and removes any reference to urls\n\n\t text.split(/\\s+/).select {|str| !str.include?(\"http\")}\nend",
"title": ""
},
{
"docid": "a12845ab0f2a95a7259cb0fff148e632",
"score": "0.46460244",
"text": "def initialize(dictionary)\n @words, @maxwords = [], []\n File.open(dictionary).each do |line|\n l = line.strip.downcase\n @words << l if (l.length >= MINCHARACTERS && l.length <= MAXCHARACTERS)\n @maxwords << l if l.length == MAXCHARACTERS\n end\n end",
"title": ""
},
{
"docid": "d93a40858bb0dc7ef5946fb3dd0b30e1",
"score": "0.46396756",
"text": "def createWordArray(text, wordArray)\n text = File.read(text)\n newText = text.gsub(/\\W/, ' ')\n\n splitText = newText.split(' ').map(&:downcase);\n splitText.each do |word|\n wordArray << word\n end\n # puts wordArray\n return wordArray\nend",
"title": ""
},
{
"docid": "62658d86d48edbeef0e662a186d214d8",
"score": "0.46372885",
"text": "def LoadFile ()\n\t\n\tinput = \"\"\n\tFile.foreach(\"../Data Files/042-Words.txt\") {|x| input = x }\n\tnames = input.split(\",\")\n\t\n\treturn names;\nend",
"title": ""
},
{
"docid": "85ab63578a33b76118e03793f7fbb36e",
"score": "0.46345425",
"text": "def countWords(href)\n\n # Use mechanize to follow link and get contents\n mechanize = Mechanize.new\n mechanize.user_agent_alias = \"Windows Mozilla\"\n mechanize.agent.http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n mechanize.redirect_ok = true\n\n begin\n\n page = mechanize.get(href)\n\n rescue\n\n return { :Positive => 0, :Negative => 0, :Symbol => @symbol, :Date => Time.now.strftime(\"%d/%m/%Y\")}\n\n end\n\n # Use Nokogiri to get the HTML content of a link.\n # html_doc = Nokogiri::HTML(open(href,:allow_redirections => :all, ssl_verify_mode: OpenSSL::SSL::VERIFY_NONE))\n\n html_doc = Nokogiri::HTML(page.content)\n\n # Look for all <p> tags and store their contents\n paragraph = html_doc.css(\"p\").inner_text\n\n # Split the content in single sentences and store in array\n strings = Array[]\n strings = paragraph.split('.')\n\n #Counters for positive and negative words\n positiveCounter = 0\n negativeCounter = 0\n\n # Iterate the sentence array\n strings.each do |s|\n\n # If the sentence includes the @symbol or the @symbolName, split in single words\n if s.upcase.include?(@symbolName) or s.upcase.include?(@symbol)\n\n words = Array[]\n words = s.gsub(/\\s+/m, ' ').strip.split(\" \")\n\n # Iterate the words array\n words.each do |s2|\n\n # Count word if it equals a positive words\n @positiveWordsArray.each do |line|\n if s2.upcase == line\n Scraper.logger.info s2\n #puts s2\n positiveCounter = positiveCounter + 1\n end\n end\n\n # Count word if it equals a negative words\n @negativeWordsArray.each do |line|\n if s2.upcase == line\n Scraper.logger.info s2\n #puts s2\n negativeCounter = negativeCounter + 1\n end\n end\n\n end\n\n end\n\n end\n\n Scraper.logger.info positiveCounter\n Scraper.logger.info positiveCounter\n\n return { :Positive => positiveCounter, :Negative => negativeCounter, :Symbol => @symbol, :Date => Time.now.strftime(\"%d/%m/%Y\")}\n\n end",
"title": ""
},
{
"docid": "a1904ffa21a422917eb2ff1825934669",
"score": "0.46302637",
"text": "def open_url(url)\n @ole.OpenURL(url)\n end",
"title": ""
},
{
"docid": "bb85ecad2dbfb5b74bce7489f44a014a",
"score": "0.46270117",
"text": "def parse_url\n tags = []\n # scrape data from page\n parser = Scrapping::Parser.new(url)\n unless parser.error\n # parse h1 from doc\n tags << parser.content_by_tag(parser.doc,'h1')\n\n # parse h2 from doc\n tags << parser.content_by_tag(parser.doc,'h2')\n\n # parse h3 from doc\n tags << parser.content_by_tag(parser.doc,'h3')\n\n # parase url of links from doc\n tags << parser.content_by_tag(parser.doc,'a')\n\n # make a single flatten array of tags\n tags = tags.flatten\n # create tags\n self.tags << Tag.create(tags)\n # return json response\n response = {error: false,message: \"Page content is parsed.\",status: 200}\n else\n response = {error: true,message: parser.message,status: 400}\n end\n end",
"title": ""
},
{
"docid": "746af6098dae68a6a1a43d134a110236",
"score": "0.46255994",
"text": "def get_words(text) #no!, two methods named get_words, see word_search.rb\n \twords = text.split('')\n \twords.each do |word|\n \t\t#how to check if word is correct or not?\n \t\tWord.new(name: word, ngsl: false, list: self.id )\n \t\t# example = Wordnik.word.get_top_example(word)['text']\n \tend\n end",
"title": ""
},
{
"docid": "d43bfb02415d563f5c0560fc0666d192",
"score": "0.46223885",
"text": "def enhance\n require 'open-uri'\n\n source = open(self.url).read\n return Readability::Document.new(source).content\n end",
"title": ""
},
{
"docid": "ec49d57bebc2a398694a77034a158666",
"score": "0.46213278",
"text": "def unixWords(inputFile)\n\t\ttext = File.open(inputFile).read\n\t\twords = []\n\t\ttext.each_line do |line|\n\t\t\twords.push(line.gsub(\"\\n\",\"\"))\n\t\tend\n\t\treturn words\n\tend",
"title": ""
},
{
"docid": "1d7cf4126e5375ecce27ef067141267e",
"score": "0.4616034",
"text": "def city_list(url)\n\troot = Nokogiri::HTML(open(url))\n list = root.css(\"a\").map do |link|\n\n\t\t# This makes sure that we only store actual links, then stores the text & link for each valid link in an array.\n\n if link[:href] =~ /http/ \n [link.text, link[:href]] \n end \n end\n\n\t# This cleans up the array and gets rid of nil elements\n\n\tlist = list.reject {|x| x.nil?} \n\t\t\n\t## Here we have various sections of CL that we can search in for various gigs. \n\t## If you wanted to see more software development stuff, you may search in /sof and /eng\n\t\n\t\t\n\t# list.map! {|f,l| [f, l + \"/cpg/\"]}\n\t# list.map! {|f,l| [f, l + \"/web/\"]}\n\tlist.map! {|f,l| [f, l + \"/web/\", l + \"/cpg/\"]}\t\n\t# list.map! {|f,l| [f, l + \"/web/\", l + \"/cpg/\", l + \"/eng/\", l + \"/sof/\", l + \"/sad/\"]}\n\t\nend",
"title": ""
},
{
"docid": "14feaee8459914e4c13abdb562dc04c0",
"score": "0.46150413",
"text": "def get_word_list\n @word_list = @lines.reject do |line|\n line.length < 5 || line.length > 12\n end\n end",
"title": ""
},
{
"docid": "b1b0e1f0939af767783099fbe794f58e",
"score": "0.4607262",
"text": "def words\n @words ||= Array(@grpc.words).map do |b|\n Word.from_grpc b\n end\n end",
"title": ""
},
{
"docid": "b8f1ddab2274866cc1c69cda4da45c8b",
"score": "0.46010545",
"text": "def get_all_countries\n puts \"collecting countries infomation..\"\n f1 = open(@CIA_URL)\n doc = Nokogiri::HTML(f1)\n open('countries.txt', 'wb') do |file|\n file << open(@CIA_URL)\n end\n doc.css(\"ul#GetAppendix_TextVersion li a\").each do |item|\n country_name = item.text\n next if country_name == \"World\" or country_name == \"European Union\" or country_name == \"Antarctica\"\n country_url = @CIA_URL\n new_url = (country_url.split('/')[0..-2]).join('/')\n country_url = new_url << '/' << item['href']\n puts \"#{country_name}\"\n f = open(country_url)\n doc = f.read()\n f.close()\n country = CountryInfo.new(country_name, country_url, doc)\n continent = get_continent(doc)\n if continent != nil\n continent.downcase!\n @country_lists[continent] += [country]\n end\n \n end\n # helper_save\n puts \"========================================================================\"\n puts \"========================================================================\"\n puts \"==============================start parsing=============================\"\n puts \"========================================================================\"\n puts \"========================================================================\"\n end",
"title": ""
},
{
"docid": "e7cd29e1d9a34ff118c0c76d757aa220",
"score": "0.46007416",
"text": "def get_paper_list(keywords)\n output = []\n page = 0\n\n keywords.each do |keyword|\n puts \"keyword: \"+keyword\n\n LIMIT.times do |page|\n puts \"page: \"+page.to_s\n\n #parses array of papers\n data = Hpricot(self.download_url(self.set_url(keyword, page)))\n papers = data.search(\"ul.blockhighlight\")\n \n # parse necessary data\n papers.each do |item|\n \n \n title = item.search(\"em.title\").first.inner_html\n link = item.search(\"a.doc_details\").first.attributes['href']\n # odstraneni prazdnych radku, smrsknuti vicenasobnych mezer a rozdeleni podle html entity pomlcky\n author_and_year = item.search(\"li.author\").first.inner_html.delete(\"\\n\").squeeze(\" \").split(\"—\")\n additional_info = self.get_additional_info(link)\n \n puts \"Dokument:\\t\"+title\n\n # vytvoreni tridy pro dokument\n doc = Document.new(@title)\n # gsub stripne html tagy\n doc.title = title.strip.gsub(/<\\/?[^>]*>/, \"\")\n doc.year = author_and_year[1].strip \n doc.abstract = additional_info['abstract']\n # rozdeleni jmen autoru - citeseerx ma rozdeleno mezerou a carkou\n doc.authors = self.parse_authors(author_and_year[0].strip.sub(/^by /, \"\"))\n \n # kontrola, zda dokument ukladat nebo ne\n if doc.unique? then\n puts \"unikatni\"\n downloaded = self.download_paper(additional_info['links'])\n doc.filename = downloaded\n doc.filetype = 'application/pdf' \n if(doc.save() === false)\n puts \"Chyba pri ukladani dokumentu!\"\n end\n else\n puts \"NEunikatni\"\n end\n \n puts \"\\n\\n\"\n end #papers.each\n end #LIMIT.times\n end #keywords.each\n\n return output\n end",
"title": ""
},
{
"docid": "e3b97fbbd01ead2e47ae5286b5b0e5b5",
"score": "0.45981416",
"text": "def input\n RDF::Util::File.open_file(inputDocument)\n end",
"title": ""
},
{
"docid": "0f7e7fdfa39b82cbb81666f020ec9bc0",
"score": "0.45956913",
"text": "def get_page(url)\n @doc = Nokogiri::HTML(open(url))\n end",
"title": ""
},
{
"docid": "3fec47fbba4a2b63fd8588721a686d60",
"score": "0.4589574",
"text": "def generate_words\n ret = []\n\n File.open('enable.txt').each do |line|\n new_line = line\n # We don't care for the new line character in the game of hangman.\n new_line = new_line.delete(\"\\n\")\n ret << new_line\n end\n\n return ret\nend",
"title": ""
}
] |
6e2adbf5d4a7eb05c4e24a3ada95dcbc
|
Sanitize this string by HTMLencoding it using HTMLEntities. Note that this method is called automatically on every content of Aurita::GUI::Element instances that is not flagged as sanitized, so you don't have to do it yourself. When in doubt, use this method instead of sanitized, as it just returns self if it has been sanitized already.
|
[
{
"docid": "d0dc3d58db62eef6a75eb7574f41482e",
"score": "0.76722",
"text": "def sanitize!\n return self if @sanitized\n replace(HTMLEntities.new.encode(self))\n @sanitized = true\n return self\n end",
"title": ""
}
] |
[
{
"docid": "a3bbb52b1df60bfbc03872e1fc72f5e1",
"score": "0.7734906",
"text": "def sanitize_as_html!\n Engine.clean!(self)\n end",
"title": ""
},
{
"docid": "a3bbb52b1df60bfbc03872e1fc72f5e1",
"score": "0.7734906",
"text": "def sanitize_as_html!\n Engine.clean!(self)\n end",
"title": ""
},
{
"docid": "81f95393d6d4224b4cdfa8b403fe5201",
"score": "0.6856192",
"text": "def sanitize_html\n self.data = self.class.clean_html(self.data) unless self.data.nil?\n end",
"title": ""
},
{
"docid": "484bd819783ed6234ecd3c0d0c856b53",
"score": "0.6622063",
"text": "def sanitized_html\n @sanitized_html ||= begin\n return nil if html_part.nil?\n Envelope::MessageTools.sanitize(html_part)\n end\n end",
"title": ""
},
{
"docid": "b3c79895ced90d5523b6bc220fe6e04f",
"score": "0.64704454",
"text": "def clean_html\n HTML::WhiteListSanitizer.allowed_protocols << 'data'\n self.content = ActionController::Base.helpers.sanitize(self.body, :tags => ALLOWED_TAGS, :attributes => ALLOWED_ATTRIBUTES)\n end",
"title": ""
},
{
"docid": "e57c0555e962458ce3705f8fffbbffb3",
"score": "0.6361069",
"text": "def sanitize(text)\n text.gsub('<', '<').gsub('>', '>')\n end",
"title": ""
},
{
"docid": "0c0feac08e7f7653d11c43fce2bd90ea",
"score": "0.6326636",
"text": "def xhtml_sanitize(html)\n return html unless sanitizeable?(html)\n tokenizer = HTML::Tokenizer.new(html.to_utf8)\n results = []\n\n while token = tokenizer.next\n node = XHTML::Node.parse(nil, 0, 0, token, false)\n results << case node.tag?\n when true\n if ALLOWED_ELEMENTS.include?(node.name)\n process_attributes_for node\n node.to_s\n else\n node.to_s.gsub(/</, \"<\").gsub(/>/, \">\")\n end\n else\n node.to_s.unescapeHTML.escapeHTML\n end\n end\n\n results.join\n end",
"title": ""
},
{
"docid": "369d6d0011b4cd3a7454218b6bdd481d",
"score": "0.6288235",
"text": "def h(str)\n sanitize_html(str)\n end",
"title": ""
},
{
"docid": "c5799ab43b94c3428b881a23e4005a35",
"score": "0.6187473",
"text": "def sanitize_html(content)\n require 'cgi'\n CGI.escapeHTML(content)\n end",
"title": ""
},
{
"docid": "b254967b433982a51ee0ece3e24e72eb",
"score": "0.618401",
"text": "def html_safe\n self\n end",
"title": ""
},
{
"docid": "90c1429f30de21e94edeb250ca6cdd55",
"score": "0.6165259",
"text": "def convert_html_safe(str)\n return str.html_safe\n end",
"title": ""
},
{
"docid": "bd86ea8ee86118db3714742085a7b4b0",
"score": "0.61495423",
"text": "def clean(html)\n return unless html\n\n # Make a whitelist of acceptable elements and attributes.\n sanitize_options = {\n elements: %w{div span p a ul ol li h1 h2 h3 h4\n pre em sup table tbody thead tr td img code strong\n blockquote small br section aside},\n remove_contents: %w{script},\n attributes: {\n 'div' => %w{id class data-tralics-id data-number data-chapter},\n 'a' => %w{id class href target rel},\n 'span' => %w{id class style},\n 'ol' => %w{id class},\n 'ul' => %w{id class},\n 'li' => %w{id class},\n 'sup' => %w{id class},\n 'h1' => %w{id class},\n 'h2' => %w{id class},\n 'h3' => %w{id class},\n 'h4' => %w{id class},\n 'img' => %w{id class src alt},\n 'em' => %w{id class},\n 'code' => %w{id class},\n 'section' => %w{id class},\n 'aside' => %w{id class},\n 'blockquote' => %w{id class},\n 'br' => %w{id class},\n 'strong' => %w{id class},\n 'table' => %w{id class},\n 'tbody' => %w{id class},\n 'tr' => %w{id class},\n 'td' => %w{id class colspan}\n },\n css: {\n properties: %w{color height width}\n },\n protocols: {\n 'a' => {'href' => [:relative, 'http', 'https', 'mailto']},\n 'img' => {'src' => [:relative, 'http', 'https']}\n },\n output: :xhtml\n }\n\n Sanitize.clean(html.force_encoding(\"UTF-8\"), sanitize_options)\n end",
"title": ""
},
{
"docid": "a823edc3a760a8fa67de367743e51563",
"score": "0.61450225",
"text": "def html_safe(input)\n input.respond_to?(:html_safe) ? input.html_safe : input\n end",
"title": ""
},
{
"docid": "0cb417176dddff97568d1b8015aae7d9",
"score": "0.61199784",
"text": "def escape_html( string )\n\t\t\treturn \"nil\" if string.nil?\n\t\t\tstring = string.inspect unless string.is_a?( String )\n\t\t\tstring.\n\t\t\t\tgsub(/&/, '&').\n\t\t\t\tgsub(/</, '<').\n\t\t\t\tgsub(/>/, '>').\n\t\t\t\tgsub(/\\n/, '↵').\n\t\t\t\tgsub(/\\t/, '→')\n\t\tend",
"title": ""
},
{
"docid": "0cb417176dddff97568d1b8015aae7d9",
"score": "0.61199784",
"text": "def escape_html( string )\n\t\t\treturn \"nil\" if string.nil?\n\t\t\tstring = string.inspect unless string.is_a?( String )\n\t\t\tstring.\n\t\t\t\tgsub(/&/, '&').\n\t\t\t\tgsub(/</, '<').\n\t\t\t\tgsub(/>/, '>').\n\t\t\t\tgsub(/\\n/, '↵').\n\t\t\t\tgsub(/\\t/, '→')\n\t\tend",
"title": ""
},
{
"docid": "cf0cd2c400547b65fd1bb64012458f7f",
"score": "0.6114816",
"text": "def unescape_html\n CGI.unescapeHTML(self)\n end",
"title": ""
},
{
"docid": "fc791d73f1dc8b6c3e2cdcafcb3e1940",
"score": "0.6107836",
"text": "def sanitize(html)\n HTML5::HTMLParser.\n parse_fragment(html, :tokenizer => HTML5::HTMLSanitizer, :encoding => 'utf-8').\n to_s\n end",
"title": ""
},
{
"docid": "fc791d73f1dc8b6c3e2cdcafcb3e1940",
"score": "0.6107836",
"text": "def sanitize(html)\n HTML5::HTMLParser.\n parse_fragment(html, :tokenizer => HTML5::HTMLSanitizer, :encoding => 'utf-8').\n to_s\n end",
"title": ""
},
{
"docid": "222a501dbce2fff9e2cde9e864585373",
"score": "0.60765314",
"text": "def clean_html(html)\n Sanitize.clean(html) rescue html\n end",
"title": ""
},
{
"docid": "93ad99e857f138dadc2541e4b00c2aa8",
"score": "0.60724425",
"text": "def html_escape(s) # rubocop:disable Lint/DuplicateMethods\n unwrapped_html_escape(s).html_safe\n end",
"title": ""
},
{
"docid": "11fb8d4b362c05083c82885d0ec6de20",
"score": "0.60355437",
"text": "def sanitize_data(value)\n HtmlSanitizer.sanitize(value)\n end",
"title": ""
},
{
"docid": "980e9e812b59272b1b2cab9c7ab38a5c",
"score": "0.60238826",
"text": "def safe_xhtml_sanitize(html, options = {})\n sanitized = xhtml_sanitize(html.purify)\n doc = Nokogiri::XML::Document.parse(\"<div xmlns='http://www.w3.org/1999/xhtml'>#{sanitized}</div>\", nil, (options[:encoding] || 'UTF-8'), 0)\n sanitized = doc.root.children.to_xml(:indent => (options[:indent] || 2), :save_with => 2 )\n rescue Nokogiri::XML::SyntaxError\n sanitized = sanitized.escapeHTML\n end",
"title": ""
},
{
"docid": "94dc9ed1ef0506e7294bc15ce0569c2c",
"score": "0.6022177",
"text": "def sanitize!\n return self if @sanitized\n each { |e|\n e.sanitized? || e.sanitize!\n }\n @sanitized = true\n return self\n end",
"title": ""
},
{
"docid": "e01d148dc100a419adeb339585756ff7",
"score": "0.601634",
"text": "def sanitize(options={})\n coder = HTMLEntities.new()\n \n #lowercase it\n encoded = self.downcase()\n \n #convert special chars to html entities\n encoded = coder.encode(encoded, :named)\n \n #replace spaces by _ (underscore)\n encoded = encoded.gsub(/\\s+/i, '_')\n \n while ((found = encoded.match(/&([^&;]+);/i)))\n #char without accent, is the first in the html entity definition\n char = found[1][0]\n \n char_ord = coder.decode(found[0]).ord()\n if ( (char_ord >= 192 && char_ord <= 214) ||\n (char_ord >= 216 && char_ord <= 223) ||\n (char_ord >= 224 && char_ord <= 246) ||\n (char_ord >= 248 && char_ord <= 255)\n )\n #valid character\n else\n char = \"_\"\n end\n \n #replace encoded\n encoded = encoded.gsub(/#{ Regexp.escape(found[0]) }/, char)\n end\n \n return encoded\n end",
"title": ""
},
{
"docid": "b32b2985ecf3b6096c2e045faa0e2bce",
"score": "0.6004603",
"text": "def to_html\n __html__.dup.scrub!(:escape).to_html\n end",
"title": ""
},
{
"docid": "09cbea4ce64a6c4600149bc3c22f6e0e",
"score": "0.59679484",
"text": "def sanitize!(html, options = {})\n msclean!(html, options)\n end",
"title": ""
},
{
"docid": "08e5c70adf079e581e98954544ac7a02",
"score": "0.59287304",
"text": "def make_html_safe i_string\n\t\t\t# CGI::escapeHTML i_string.to_s\n\t\t\ti_string\n\t\tend",
"title": ""
},
{
"docid": "66b0650604aa72f6dc14c3edafdeea6f",
"score": "0.5866243",
"text": "def sanitize(tainted)\n untainted = tainted\n \n untainted = rule1_sanitize(tainted)\n \n # Start - RULE #2 - Attribute Escape Before Inserting Untrusted Data into HTML Common Attributes\n # End - RULE #2 - Attribute Escape Before Inserting Untrusted Data into HTML Common Attributes\n \n # Start - RULE #3 - JavaScript Escape Before Inserting Untrusted Data into HTML JavaScript Data Values\n # End - RULE #3 - JavaScript Escape Before Inserting Untrusted Data into HTML JavaScript Data Values\n \n # Start - RULE #4 - CSS Escape Before Inserting Untrusted Data into HTML Style Property Values\n # End - RULE #4 - CSS Escape Before Inserting Untrusted Data into HTML Style Property Values\n \n untainted\n end",
"title": ""
},
{
"docid": "72d5c7fac37afc494de7c6e8b540a47f",
"score": "0.5841395",
"text": "def safe(html = nil)\n output = html || raw\n output.respond_to?(:html_safe) ? output.html_safe : output\n end",
"title": ""
},
{
"docid": "9f04ecc25cbc4d2123dbeed4d2dad8e6",
"score": "0.5834737",
"text": "def sanitize(html, options = {})\n msclean(html, options)\n end",
"title": ""
},
{
"docid": "05e3cde1d9622af44c5518dc53465019",
"score": "0.58223695",
"text": "def html_escape(clean_me)\n clean_me.to_s.gsub(/[&\"<>]/) do |special|\n { '&' => '&',\n '>' => '>',\n '<' => '<',\n '\"' => '"' }[special]\n end\n end",
"title": ""
},
{
"docid": "d25e2d08553400fc22fede3dab9f5074",
"score": "0.58102757",
"text": "def escape_html_safe(html)\n html.html_safe? ? html : escape_html(html)\n end",
"title": ""
},
{
"docid": "b2895adf8e1bdaacf17f9413b22854c6",
"score": "0.5803195",
"text": "def haml_xss_html_escape(text)\n return text unless Hamlit::HamlUtil.rails_xss_safe? && haml_buffer.options[:escape_html]\n html_escape(text)\n end",
"title": ""
},
{
"docid": "e9151959e8a816fdb3bb87f64e956164",
"score": "0.5795504",
"text": "def html_escape(options={})\n except = options[:except] || %w()\n close_tags\n @modified_string.gsub!(/<\\/?(.*?)(\\s.*?)?\\/?>/) do |tag|\n if except.include?($1)\n # sanitize attributes\n tag.gsub(/\\s(.+?)=('|\").*?\\2(?=.*?>)/) do |a|\n [\"href\", \"src\", \"lang\"].include?($1) ? a : \"\"\n end\n else\n h(tag)\n end\n end\n # Convert all unclosed left tag brackets (<) into <\n @modified_string.gsub!(/<+([^>]*)\\Z/, '<\\1')\n # Convert all unopened right tag brackets (>) into >\n @modified_string.gsub!(/\\A([^<]*)>+/, '\\1>')\n self\n end",
"title": ""
},
{
"docid": "f78b69421028a9c0c1d23ce981a02770",
"score": "0.5795247",
"text": "def sanitize_feed_content(html, sanitize_tables = false)\n options = sanitize_tables ? {} : { tags: %w[table thead tfoot tbody td tr th] }\n sanitized = html.strip do |html|\n html.gsub! /&(#\\d+);/ do |_s|\n \"&#{Regexp.last_match(1)};\"\n end\n end\n sanitized\n end",
"title": ""
},
{
"docid": "47d06cf28a17247afca6975b529303d8",
"score": "0.5791034",
"text": "def escape_html(input)\n Utils::Escape.html(input)\n end",
"title": ""
},
{
"docid": "f1c75242ecf56dab707666f3d8859f4f",
"score": "0.5786561",
"text": "def app_sanitize(html)\n sanitize(html, attributes: %w[style])\n end",
"title": ""
},
{
"docid": "0280dde9619af9a30c70e4b57a982b39",
"score": "0.5780999",
"text": "def decode_html()\n return self.gsub('<', '<').gsub('>', '>').gsub('&', '&')\n end",
"title": ""
},
{
"docid": "48d2181733f09dfa7517181ab6c15ec8",
"score": "0.5777313",
"text": "def html raw_text\n EscapeUtils.escape_html(decode_html(raw_text))\n end",
"title": ""
},
{
"docid": "8e5e09727c22b3a2fe8d944361a7bba3",
"score": "0.57754767",
"text": "def html_escape_with_haml_xss(text)\n str = text.to_s\n return text if str.html_safe?\n Hamlit::HamlUtil.html_safe(html_escape_without_haml_xss(str))\n end",
"title": ""
},
{
"docid": "97a990797d5720d45fc117bc1d1a4e07",
"score": "0.5766499",
"text": "def sanitize_attributes\n if self.sanitize_level\n self.body = Sanitize.clean(self.body_raw, self.sanitize_level)\n self.title = Sanitize.clean(self.title, self.sanitize_level)\n else\n self.body = self.body_raw\n end\n end",
"title": ""
},
{
"docid": "22a6c20fe01e3edb5c114e2ffb715ae0",
"score": "0.5751766",
"text": "def escape_html(html)\n html.to_s.gsub(/&/n, '&').gsub(/\\\"/n, '"').gsub(/>/n, '>').gsub(/</n, '<').gsub(/\\//, '/')\n end",
"title": ""
},
{
"docid": "55c86c6d57b6d2a90edc3ef3f7fb3993",
"score": "0.57406074",
"text": "def html_safe_value\n sanitize(@values.join(' '), tags: %w[sub sup i em])\n end",
"title": ""
},
{
"docid": "af475d624aaec013871f3fd7e9337274",
"score": "0.57301563",
"text": "def clean(text = nil, escape_ampersands_twice = false)\n text.gsub!(\" \", \" \")\n converted = convert_html(text)\n entity_converted = convert_entities(converted)\n # puts \"entity_converted: #{entity_converted}\"\n escaped = escape(entity_converted)\n # escaped = escaped.gsub(/&/, '\\\\\\\\&')\n escaped = escaped.gsub(\"&\", \"\\&\")\n escaped = escaped.gsub(/&/, '\\\\\\\\&') if escape_ampersands_twice\n # puts \"escaped: #{escaped}\"\n # puts \"\\n\"\n escaped\n end",
"title": ""
},
{
"docid": "e67409193d3c0502cf08c9ce78c64d7e",
"score": "0.5729764",
"text": "def sanitized_message(tags_to_exclude: [], html_safe: true, escape_before_sanitizing: false)\n return self.message if self.message.blank?\n\n allowed_tags, allowed_attributes = Recognition.allowed_html_tags_and_attributes(tags_to_exclude: tags_to_exclude)\n opts = { tags: allowed_tags, attributes: allowed_attributes}\n\n message = self.message\n message = CGI.escapeHTML(message) if escape_before_sanitizing\n message = sanitize(message, opts)\n message = message.to_str unless html_safe # back to String from ActiveSupport::SafeBuffer\n message\n end",
"title": ""
},
{
"docid": "452748bcd4f41b2723cd76758ff4f9a0",
"score": "0.57199043",
"text": "def escape_html(str, type = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "91f95e1ff1da3eaa8a29c59c70fa2ea6",
"score": "0.56962",
"text": "def to_sanitize\n Sanitize.new(to_hash)\n end",
"title": ""
},
{
"docid": "b7bdb1c0e5c1ee42a1d9381b3d07e5de",
"score": "0.56739426",
"text": "def htmlClean(html)\n html\nend",
"title": ""
},
{
"docid": "dc188cdcc3b2c10bb1b7cf0251273452",
"score": "0.5671468",
"text": "def sanitize_attributes\n # Summary, content are sanitized with an HTML sanitizer, we want imgs etc to be present.\n # Other attributes are sanitized by stripping tags, they should be plain text.\n self.content = Sanitizer.sanitize_html self.content\n self.summary = Sanitizer.sanitize_html self.summary\n\n self.title = Sanitizer.sanitize_plaintext self.title\n self.author = Sanitizer.sanitize_plaintext self.author\n self.guid = Sanitizer.sanitize_plaintext self.guid\n self.url = Sanitizer.sanitize_plaintext self.url\n end",
"title": ""
},
{
"docid": "c8389fd75caf770476947cd706357db4",
"score": "0.5670075",
"text": "def sanitize(html)\n doc = Nokogiri::HTML::DocumentFragment.parse(html)\n if Mako.config.sanitize_images\n doc.css('img').each do |n|\n begin\n n.name = 'a'\n n.content = n['alt'] ? \"📷 #{n['alt']}\" : '📷 Image'\n n['href'] = URI.parse(n['src']).absolutize!(uri)\n rescue URI::InvalidURIError\n # if there's a problem, just ignore it\n next\n end\n end\n end\n doc.css('h1,h2,h3,h4,h5,h6').each { |n| n.name = 'p'; n.set_attribute('class', 'bold') }\n doc.to_s\n end",
"title": ""
},
{
"docid": "f2eea2ba8d60a9b7e17a0d4ff23c4de5",
"score": "0.5663711",
"text": "def escape_html(value)\n CGI.escapeHTML(value)\n end",
"title": ""
},
{
"docid": "fa660293e9c901af5c0cbd4583205d78",
"score": "0.56522447",
"text": "def sanitizer\n @sanitizer ||= Gollum::Sanitization.new(Gollum::Markup.to_xml_opts)\n end",
"title": ""
},
{
"docid": "530ef1da8d82c72a5ab7c304602e21c1",
"score": "0.56321084",
"text": "def html_escape(s)\n s = s.to_s\n if s.html_safe?\n s\n else\n s.to_s.gsub(/&/, \"&\").gsub(/\\\"/, \""\").gsub(/>/, \">\").gsub(/</, \"<\").html_safe\n end\n end",
"title": ""
},
{
"docid": "d227dcfa6cceee21f606510e07456126",
"score": "0.56317216",
"text": "def correct_unncessarily_escaped_html_tags(element)\n statement = element.statement\n [:sup, :i].each do |tag|\n statement.gsub!(/<#{tag}>/,%Q{<#{tag}>})\n statement.gsub!(/<\\/#{tag}>/,%Q{</#{tag}>})\n end\n element.instance_variable_set(:@statement,statement)\n end",
"title": ""
},
{
"docid": "87a634d6c59780b299568d81f88b6969",
"score": "0.56263995",
"text": "def encode_html( str )\n\t\t\t#str.gsub( /&(?!#?[x]?(?:[0-9a-f]+|\\w+);)/i, \"&\" ).\n\t\t\t\t#gsub( %r{<(?![a-z/?\\$!])}i, \"<\" )\n\t\t\t\treturn str\n\t\tend",
"title": ""
},
{
"docid": "059b89120441a530ce22e0447d1ea10b",
"score": "0.56229085",
"text": "def html_escape\n return to_s\n end",
"title": ""
},
{
"docid": "059b89120441a530ce22e0447d1ea10b",
"score": "0.56229085",
"text": "def html_escape\n return to_s\n end",
"title": ""
},
{
"docid": "511994512e381efcc030596ce763e525",
"score": "0.56163454",
"text": "def html_escape(s)\n CGI.escapeHTML(s.to_s)\n end",
"title": ""
},
{
"docid": "d786e801746aef67a5430518ea0592b9",
"score": "0.5613892",
"text": "def sanitize_attributes\n %w(author title description keyword).each do |field|\n self.send(\"#{field}=\",HTMLEntities.new.decode(self.send(field)))\n end\n end",
"title": ""
},
{
"docid": "8c51a8c91d0d86a758e57c57542f3dcb",
"score": "0.56086767",
"text": "def sanitize\n self.summary = sanitize_string(summary)\n self.description = sanitize_string(description)\n self.post_install_message = sanitize_string(post_install_message)\n self.authors = authors.collect {|a| sanitize_string(a) }\n end",
"title": ""
},
{
"docid": "ae68cd96140256c69c0553c902bd13e5",
"score": "0.5593458",
"text": "def escapeHTML(string)\n enc = string.encoding\n unless enc.ascii_compatible?\n if enc.dummy?\n origenc = enc\n enc = Encoding::Converter.asciicompat_encoding(enc)\n string = enc ? string.encode(enc) : string.b\n end\n table = Hash[TABLE_FOR_ESCAPE_HTML__.map {|pair|pair.map {|s|s.encode(enc)}}]\n string = string.gsub(/#{\"['&\\\"<>]\".encode(enc)}/, table)\n string.encode!(origenc) if origenc\n string\n else\n string = string.b\n string.gsub!(/['&\\\"<>]/, TABLE_FOR_ESCAPE_HTML__)\n string.force_encoding(enc)\n end\n end",
"title": ""
},
{
"docid": "be0bf3b724f8bbc12012a99491c648e8",
"score": "0.55891424",
"text": "def esc_html(text)\n \tsafe_text = wp_check_invalid_utf8(text)\n \tsafe_text = _wp_specialchars(safe_text, :ENT_QUOTES)\n \t# Filters a string cleaned and escaped for output in HTML.\n \tapply_filters('esc_html', safe_text, text)\n end",
"title": ""
},
{
"docid": "1cb7a6beedbccc0ae49a68394fdd2ea5",
"score": "0.5570884",
"text": "def escape_html\n Rack::Utils.escape_html self\n end",
"title": ""
},
{
"docid": "4ce9427eb5c9ff151e2aee0676c30b0e",
"score": "0.5563573",
"text": "def ensure_no_tags(str)\n return str unless str.html_safe?\n \n str = str.to_str # get it out of HTMLSafeBuffer, which messes things up\n str = strip_tags(str) \n\n str = HTMLEntities.new.decode(str)\n\n return str\n end",
"title": ""
},
{
"docid": "26daa4989609221fc45743bf812ab6b2",
"score": "0.5538779",
"text": "def sanitize(input, options={})\n return \"\" if input.nil? or input.empty?\n \n # Only take elements inside of <body>\n @doc = Hpricot(input)\n @doc = Hpricot(@doc.at(\"body\").inner_html) if @doc.at(\"body\")\n sanitized = Aqueduct::RailsSanitizer.white_list_sanitizer.sanitize(@doc.to_html)\n\n # Start parsing sanitized doc\n @doc = Hpricot(sanitized)\n\n # Rewrite all id's to appened network_key\n append_id(@options[:append]) unless @options[:append].nil?\n\n @options[:formatted] == false ? @doc.to_html.gsub(/\\r|\\n/i,'') : @doc.to_html \n end",
"title": ""
},
{
"docid": "8ec7d72d87d710b85efc99f38aa51f2b",
"score": "0.55369633",
"text": "def html_escape(string)\n EscapeUtils.escape_html(string.to_s).html_safe\n end",
"title": ""
},
{
"docid": "c9acfa8b1ee81e36e717933d298a68c6",
"score": "0.5533482",
"text": "def validate_and_sanitize\n super\n end",
"title": ""
},
{
"docid": "9f0732255e3cebb212b15d7a1e2eb530",
"score": "0.5519456",
"text": "def safe_output(input)\n sanitize Nokogiri::HTML.fragment(CGI.unescapeHTML(input)).to_s\n end",
"title": ""
},
{
"docid": "e4a2c35dd2384bf1757bbd99432be6f2",
"score": "0.5506305",
"text": "def initialize\n @html_sanitizer = HTML::FullSanitizer.new\n end",
"title": ""
},
{
"docid": "9e3d1c9360b6b5b192c2eef024adcafb",
"score": "0.5499015",
"text": "def html_decode\n require 'htmlentities'\n \n coder = HTMLEntities.new\n \n ret = coder.decode(self)\n \n return ret\n end",
"title": ""
},
{
"docid": "538c712d54431a0332588010e2343392",
"score": "0.5485254",
"text": "def strip_dangerous_html_tags(allowed_tags = 'a|span|strong|b|img|i|s|p|br|h1|h2|h3|h4|h5|h6|blockquote|footer', attributes = {'img' => ['src', 'alt'], 'a' => ['href', 'title', 'target']})\n if allowed_tags.present?\n Sanitize.fragment(self, {elements: allowed_tags.split('|'), attributes: attributes})\n else\n self.gsub('<', \"<\").gsub('>', \">\")\n end\n end",
"title": ""
},
{
"docid": "8b43509192d3b5f10fe32a32d73eb7e6",
"score": "0.54732054",
"text": "def sanitize(str)\n DescriptionSanitizer.new.sanitize(str)\n end",
"title": ""
},
{
"docid": "56ce092c0ef6e09e5b2aa3ceef6a5dc3",
"score": "0.54679215",
"text": "def strip_and_convert(str)\n CGI.unescapeHTML(strip_tags(str))\n end",
"title": ""
},
{
"docid": "6d27f4eb27ae8c81da36c7380d0fb898",
"score": "0.54614127",
"text": "def method_missing(*attributes)\n if (attributes[0][/_safe$/])\n html_safe_string = send(attributes[0].to_s.gsub(/_safe$/,\"\").intern).html_safe\n CGI::unescapeElement( CGI::escapeHTML(html_safe_string), \"BR\" )\n else\n super\n end\n end",
"title": ""
},
{
"docid": "78a62566246e22ea22c96e3aef3f6e74",
"score": "0.54588604",
"text": "def sanitized_string(string)\n text = Sanitize.fragment(string.to_s).squish\n CGI.unescapeHTML(text).gsub(/ /, ' ')\n end",
"title": ""
},
{
"docid": "4b61aff6948a8276d12837282681459c",
"score": "0.545203",
"text": "def strip_html_tags!\n @raw.gsub!(/<[^>]+?>/, ' ')\n end",
"title": ""
},
{
"docid": "6a5b60f6eb9bf492a5f7d3c25b518503",
"score": "0.5449661",
"text": "def sanitize_html( html, okTags='' )\n\n return if html.blank?\n\n # no closing tag necessary for these\n soloTags = [\"br\",\"hr\"]\n\n # Build hash of allowed tags with allowed attributes\n tags = okTags.downcase().split(',').collect!{ |s| s.split(' ') }\n allowed = Hash.new\n tags.each do |s|\n key = s.shift\n allowed[key] = s\n end\n\n # Analyze all <> elements\n stack = Array.new\n result = html.gsub( /(<.*?>)/m ) do | element |\n if element =~ /\\A<\\/(\\w+)/ then\n # </tag>\n tag = $1.downcase\n if allowed.include?(tag) && stack.include?(tag) then\n # If allowed and on the stack\n # Then pop down the stack\n top = stack.pop\n out = \"</#{top}>\"\n until top == tag do\n top = stack.pop\n out << \"</#{top}>\"\n end\n out\n end\n\n elsif element =~ /\\A<(\\w+)\\s*\\/>/\n # <tag />\n tag = $1.downcase\n if allowed.include?(tag) then\n \"<#{tag} />\"\n end\n\n elsif element =~ /\\A<(\\w+)/ then\n # <tag ...>\n tag = $1.downcase\n if allowed.include?(tag) then\n if ! soloTags.include?(tag) then\n stack.push(tag)\n end\n if allowed[tag].length == 0 then\n # no allowed attributes\n \"<#{tag}>\"\n else\n # allowed attributes?\n out = \"<#{tag}\"\n while ( $' =~ /(\\w+)=(\"[^\"]+\")/ )\n attr = $1.downcase\n valu = $2\n if allowed[tag].include?(attr) then\n out << \" #{attr}=#{valu}\"\n end\n end\n out << \">\"\n end\n end\n end\n end\n\n # eat up unmatched leading >\n while result.sub!(/\\A([^<]*)>/m) { $1 } do end\n\n # eat up unmatched trailing <\n while result.sub!(/<([^>]*)\\Z/m) { $1 } do end\n\n # clean up the stack\n if stack.length > 0 then\n result << \"</#{stack.reverse.join('></')}>\"\n end\n\n result\n end",
"title": ""
},
{
"docid": "6949724d0c0ff95404a4cdc23179f562",
"score": "0.54318917",
"text": "def dumpAsHTML\n\t\tvalue = dumpAsString\n\t\treturn CGI.escapeHTML(value)\n\tend",
"title": ""
},
{
"docid": "579d536f3c1e393771b347d312dd8f51",
"score": "0.5428673",
"text": "def safe_str\n \"\".html_safe # rubocop:disable Rails/OutputSafety # It's an empty string!\n end",
"title": ""
},
{
"docid": "5f2ce8c0ca2666eb4d315f4c8d89bb26",
"score": "0.542645",
"text": "def html_encode\n require 'htmlentities'\n \n coder = HTMLEntities.new\n \n ret = coder.encode(self, :named)\n \n return ret\n end",
"title": ""
},
{
"docid": "673af7d841e4a55d94099d8c90302d30",
"score": "0.5425248",
"text": "def clean_html\n cleaned = ConverterMachine.clean_html(self) # => {html: clean html, css: Nokogiri extracted <style>...</style>}\n self.update_attributes!(file_content_html: cleaned[:html], file_content_css: cleaned[:css])\n end",
"title": ""
},
{
"docid": "0c92a7061dfbc220c29acd87f319cb66",
"score": "0.5401002",
"text": "def as_html_deprecated #use TextEncoder.convert_to_html instead.\n return self if self.blank?\n mytext = self\n #mytext = CGI.escapeHTML(mytext)\n mytext.gsub!(NpbConstants::URL_DETECTION){|web_link| %{ <a href=\"#{web_link.strip}\">#{web_link.strip}</a> }}\n #mytext.gsub!(NpbConstants::EMAIL_DETECTION){|email| %{\\1<a href=\"mailto:#{email.strip}\">#{email.strip}</a>}}\n mytext.gsub!(NpbConstants::EMAIL_DETECTION){|email| %{#{$1}<a href=\"mailto:#{email.strip}\">#{email.strip}</a>}}\n mytext.gsub!(/\\A +/) {|l_spaces| (\" \"*l_spaces.size)} \n mytext.gsub!(/\\n +/) {|l_spaces| (\"\\n\" + (\" \"*(l_spaces.size-1)))}\n mytext.gsub!(/\\n{2,}/,'</p><p>')\n mytext.gsub!(/(\\n)([^\\n])/, '<br/>\\2')\n mytext\n end",
"title": ""
},
{
"docid": "5cd4a8d5fc19adab6a4635e276e08b17",
"score": "0.54004574",
"text": "def escape_html(str, type = :all)\n str.gsub(ESCAPE_RE_FROM_TYPE[type]) {|m| ESCAPE_MAP[m] || m }\n end",
"title": ""
},
{
"docid": "9cadbfd4519a6763820bb2973d332beb",
"score": "0.5395078",
"text": "def strip_html_from_description\n self.description = ActionView::Base.full_sanitizer.sanitize(description)\n end",
"title": ""
},
{
"docid": "59b5103de19e21ca3be3d6d4545ff0c8",
"score": "0.53918314",
"text": "def sanitize_content\n self.title = helpers.sanitize(self.title)\n self.user_name = helpers.sanitize(self.user_name)\n end",
"title": ""
},
{
"docid": "6d72e5f802fae4d8733aba9a43595034",
"score": "0.53880674",
"text": "def escape_html(html)\n html.to_s.gsub(/[&\\\"<>\\/]/, ESCAPE_HTML)\n end",
"title": ""
},
{
"docid": "02272d15bfcee5317ba28718c35b5628",
"score": "0.53836626",
"text": "def sanitize string, compact: true\n string = string.gsub SanitizeXMLRx, '' if string.include? '<'\n string = string.gsub(CharRefRx) { $1 ? BuiltInNamedEntities[$1] : ([$2 ? $2.to_i : ($3.to_i 16)].pack 'U1') } if string.include? '&'\n compact ? (string.strip.tr_s ' ', ' ') : string\n end",
"title": ""
},
{
"docid": "75c9d394c875f8734068f0767b570066",
"score": "0.53789026",
"text": "def sanitize_text(text)\n doc = Nokogiri::HTML.fragment(text)\n UNSUPPORTED_HTML_TAGS.each do |tag|\n doc.search(tag).each(&:remove)\n end\n doc.inner_html\n end",
"title": ""
},
{
"docid": "f04f8836629cef77eb2f8d0a9908d164",
"score": "0.5375566",
"text": "def render\n ignore = [ComfortableMexicanSofa::Tag::Partial, ComfortableMexicanSofa::Tag::Helper].member?(self.class)\n ComfortableMexicanSofa::Tag.sanitize_irb(content, ignore)\n end",
"title": ""
},
{
"docid": "5649368b0d42710e932a6ab9fee561ec",
"score": "0.5366575",
"text": "def strip_tags(html)\n Sanitize.clean(html.strip).strip\n end",
"title": ""
},
{
"docid": "5649368b0d42710e932a6ab9fee561ec",
"score": "0.5366575",
"text": "def strip_tags(html)\n Sanitize.clean(html.strip).strip\n end",
"title": ""
},
{
"docid": "a90bf62d4725422b7f3903103eb3173c",
"score": "0.5344414",
"text": "def validate_and_sanitize\n validate\n end",
"title": ""
},
{
"docid": "35c594777acb154b7e3c8ac8c6015007",
"score": "0.53441197",
"text": "def sanitize(text)\n text.squeeze\n text.capitalize!\n text.gsub!('&', '&')\n text.gsub!('<', '<')\n text.gsub!('>', '>')\n return text\nend",
"title": ""
},
{
"docid": "cbaa3019cbd91f351358109d33a78a0a",
"score": "0.5338549",
"text": "def escape_html(str)\n\t\t\t#table = HTML_ESC # optimize\n\t\t\t#str.gsub(/[&\"<>]/) {|s| table[s] }\n\t\t\treturn str\n\t\tend",
"title": ""
},
{
"docid": "4012d39d92bcb8c1d270fc44ca843932",
"score": "0.53327",
"text": "def cleaner\n @@config ||= begin\n {\n :elements => ::ActionView::Base.sanitized_allowed_tags.to_a,\n :attributes => { :all => ::ActionView::Base.sanitized_allowed_attributes.to_a},\n :protocols => { :all => ::ActionView::Base.sanitized_allowed_protocols.to_a }\n }\n rescue\n warn \"ActionView not available, falling back to Sanitize's BASIC config\"\n ::Sanitize::Config::BASIC\n end\n @sanitizer ||= ::Sanitize.new(@@config)\n end",
"title": ""
},
{
"docid": "f4d0a0b01f1d0675d95c3b8321122ba7",
"score": "0.53188777",
"text": "def plain_html\n self.class.to_html.to_html(text.dup)\n end",
"title": ""
},
{
"docid": "f0fa820eb50d5ec249155f15afde3115",
"score": "0.53187305",
"text": "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",
"title": ""
},
{
"docid": "2f5f4ee8e99840625d8ad45df1e8513e",
"score": "0.53151023",
"text": "def conv_html(txt)\n txt.\n gsub(/>/, '>').\n gsub(/</, '<').\n gsub(/"/, '\"').\n gsub(/&/, '&')\n \n end",
"title": ""
},
{
"docid": "6d6d63e80a0890eb5f89621428fcfe0f",
"score": "0.5309661",
"text": "def sanitize(string, options = {})\n Engine.clean(string)\n end",
"title": ""
},
{
"docid": "8b35c1a3282e1da7d29472126b5d9fb1",
"score": "0.5306318",
"text": "def safe_sanitize(html_fragment)\n html_fragment = \"\" if (html_fragment.nil?)\n Sanitize.fragment(html_fragment, Sanitize::Config::BASIC)\n end",
"title": ""
}
] |
70eb30ac919421dbd4ad5f09c1c03c2e
|
See WR???? we only show the first website URL from the postal contact info
|
[
{
"docid": "5c66328d3e7cfe5c1a4d3b12f57a13d9",
"score": "0.0",
"text": "def get_contributor_website_url\n role.get_contributor_url\n end",
"title": ""
}
] |
[
{
"docid": "2c2a43d6e1c6cf594f3ad14bac7412ba",
"score": "0.690541",
"text": "def formatted_website\n self.website.split('/')[2]\n end",
"title": ""
},
{
"docid": "b9167663c39e46dac12df550764b5c85",
"score": "0.66138",
"text": "def websites\n contact_method.select { |cm| cm['InternetWebAddress'] }\n end",
"title": ""
},
{
"docid": "b3b7929bda95e2543711b8e4dcfd3206",
"score": "0.6485954",
"text": "def getit_url\n if marc_856 && relevant_marc_856?\n best_link(marc_856, 'marc_856')\n elsif fulltext_links && relevant_fulltext_links?\n best_link(fulltext_links_picker(true), 'eds fulltext')\n end\n end",
"title": ""
},
{
"docid": "ff1cbd574774ca0ac9719d299756fb94",
"score": "0.6459833",
"text": "def get_contact_url\n\n contact_url = ''\n\n website_url = Setting.get_value(Setting::WEBSITE_URL)\n\n if !self.person.blank?\n contact_url = \"http://#{website_url}/people/edit/#{person_id}\"\n elsif !self.organisation.blank?\n contact_url = \"http://#{website_url}/organisations/edit/#{organisation_id}\"\n end\n\n return contact_url\n\n end",
"title": ""
},
{
"docid": "149ea59eebfba4d9b991a7fb9577e58b",
"score": "0.642898",
"text": "def supplier_website\n website(12).try(:website_link)\n end",
"title": ""
},
{
"docid": "8be1b1c07bc714fbe5267eea145b02c2",
"score": "0.6415664",
"text": "def website_url\n self.dig_for_string(\"companySummary\", \"websiteURL\")\n end",
"title": ""
},
{
"docid": "36734b37f058349e9338b01e62730de1",
"score": "0.6397442",
"text": "def org_website(item:)\n return nil unless item.present? && item.fetch('links', [])&.any?\n return nil if item['links'].first.blank?\n\n # A website was found, so extract just the domain without the www\n domain_regex = %r{^(?:http://|www\\.|https://)([^/]+)}\n website = item['links'].first.scan(domain_regex).last.first\n website.gsub('www.', '')\n end",
"title": ""
},
{
"docid": "e79c70e33326c39d1d27ca0ffe7c0072",
"score": "0.63933235",
"text": "def get_url\n \"http://www.allabolag.se/#{self.identification_no.gsub(\"-\",\"\")}\"\n end",
"title": ""
},
{
"docid": "123a7a1726f29c16f6b313c647587223",
"score": "0.63795906",
"text": "def website\n @company_info.css(\"td.name div.website a\").attr(\"href\").value\n end",
"title": ""
},
{
"docid": "000bb2b234088766eabcd20db6bf54dc",
"score": "0.63754964",
"text": "def parse_full_address()\n\t\taddress = @building_page.at('#address-wrapper')\n\t\tif address != nil\n\t\t\treturn address.to_s[/<\\/h3>[.\\W]*.*<br>/][/\\d\\d.*</][0..-2] + \", \" + address.to_s[/<br>.*/][4..-2]\n\t\tend\n\t\treturn nil\n\tend",
"title": ""
},
{
"docid": "ae5f269fa1b7bf24566610219cfc04a3",
"score": "0.62474257",
"text": "def get_townhall_url(department_url)\n\tadress_tab =[]\n\tpage2 = Nokogiri::HTML(open(department_url))\n\turl = page2.xpath('//a[@class=\"lientxt\"]/@href')\n\turl.each do |string|\n\t\tstring = string.to_s[1..-1]\n\t\tadress = \"https://www.annuaire-des-mairies.com\"+string\n\t\tadress_tab << adress\n\tend\n\treturn adress_tab\nend",
"title": ""
},
{
"docid": "f4b4b43b84fcb0208ab883365895fff8",
"score": "0.62399256",
"text": "def get_the_email_of_a_townhal_from_its_webpage(url) \n page_townhal(url)\nend",
"title": ""
},
{
"docid": "a0699016e73fbf6ab81bbdbb23c66b14",
"score": "0.62242",
"text": "def http_company_website\n #return nil if website is blank\n return nil if self.company_website.to_s.strip.blank?\n #return company_website as if if it already contains http:// or https://\n if self.company_website.slice(0,7) == \"http://\" || self.company_website.slice(0,8) == \"https://\"\n self.company_website\n #prepend http://\n else\n \"http://#{self.company_website}\"\n end\n end",
"title": ""
},
{
"docid": "8ebba9e72ca1c9431c8635bbb3128c4b",
"score": "0.6213554",
"text": "def website_url; website end",
"title": ""
},
{
"docid": "e89d6e3307ffada204d53f68d50277a4",
"score": "0.6172938",
"text": "def url()\n @address.url\n end",
"title": ""
},
{
"docid": "02bbd6a48479e0dc97b76c5d3a0851ee",
"score": "0.6149436",
"text": "def publisher_website\n website(2).try(:website_link)\n end",
"title": ""
},
{
"docid": "082ccb02a964f6a2f28b1e85f297f83b",
"score": "0.61482245",
"text": "def news_domain(news)\n su = news[\"url\"].split(\"/\")\n domain = (su[0] == \"text:\") ? nil : su[2]\nend",
"title": ""
},
{
"docid": "082ccb02a964f6a2f28b1e85f297f83b",
"score": "0.61482245",
"text": "def news_domain(news)\n su = news[\"url\"].split(\"/\")\n domain = (su[0] == \"text:\") ? nil : su[2]\nend",
"title": ""
},
{
"docid": "4e97a5bb8237fc3d6534fda843e7389b",
"score": "0.6089693",
"text": "def perfom\nget_townhall_email(\"https://www.annuaire-des-mairies.com/95/avernes.html\")\nget_townhall_urls(\"http://annuaire-des-mairies.com/val-d-oise.html\")\np emailParVille\nend",
"title": ""
},
{
"docid": "fcd071b9d57c8cd384575d3a17444641",
"score": "0.60872674",
"text": "def get_url\n\t\tpage = Nokogiri::HTML(open(\"https://www.annuaire-des-mairies.com/manche.html\"))\n\t\turl = []\n\t\tpage.xpath('//a[@class=\"lientxt\"]').each do |name|\n\t\t\turl << name.text.capitalize\n\t\tend\n\t\tpush_sheet(url, 1)\n\t\tget_mail(url)\n\t\t\n\t\t\n\tend",
"title": ""
},
{
"docid": "f7680ea3cace51dabbb97d9819c7b262",
"score": "0.60848033",
"text": "def parse_address()\n\t\taddress = @building_page.at('#address-wrapper')\n\t\tif address != nil\n\t\t\treturn address.to_s[/<\\/h3>[.\\W]*.*<br>/][/\\d\\d.*</][0..-2]\n\t\tend\n\t\treturn nil\n\tend",
"title": ""
},
{
"docid": "186285e659e46e329883f1f92b99dc67",
"score": "0.60778373",
"text": "def format_website\n if self.website.present? and self.website !~ /^http/i\n self.website = \"http://#{self.website}\"\n end\n end",
"title": ""
},
{
"docid": "290a838225315450f8910cf825679bf3",
"score": "0.60659266",
"text": "def contact_postal_code\n details? ? details[\"Contact\"][\"postalCode\"] : ''\n end",
"title": ""
},
{
"docid": "fd1acffab880b824faaf180ef27da697",
"score": "0.60629785",
"text": "def domain\n @domain ||= self.details.match(/(ftp|http|https):\\/\\/([w]+\\.)?(.+?\\.[a-z]{2,3})/i).to_a[3] || \"\"\n end",
"title": ""
},
{
"docid": "11a261eaf8288d12dd668b2bf5f77fdd",
"score": "0.6040244",
"text": "def contacts_links\n item.home_page_contacts.pluck(:content_id).uniq\n end",
"title": ""
},
{
"docid": "962caf398ebd2c05fa282ebd6972f3d7",
"score": "0.6031749",
"text": "def format_author_website\n return if author_website.blank?\n self.author_website = case author_website\n when /^http:\\/\\/$/\n nil\n when /^http:\\/\\//\n author_website\n else\n 'http://' + author_website\n end\n end",
"title": ""
},
{
"docid": "c08980e01be324c88447a12305d0e8dd",
"score": "0.6024296",
"text": "def absolute_website_url\n if author.website.blank?\n nil\n elsif author.website[0,7] == \"http://\" or author.website[0,8] == \"https://\"\n author.website\n else\n \"http://#{author.website}\"\n end\n end",
"title": ""
},
{
"docid": "967e0523247b1ca72f5eae38e4aa6fe1",
"score": "0.6023235",
"text": "def website_url\n self.dig_for_string(\"websiteURL\")\n end",
"title": ""
},
{
"docid": "d465603cad54b37cf8587623d781e817",
"score": "0.6007592",
"text": "def get_the_email_of_a_townhall_from_its_webpage(url_ville)\n ville = ville.to_s\n #page = Nokogiri::HTML(open(\"http://annuaire-des-mairies.com/94/#{ville}.html\"))\n page = Nokogiri::HTML(open(url_ville))\n email = page.css('td[class=style27] p:contains(\"@\")').text\n return email\n end",
"title": ""
},
{
"docid": "a1ceed79c7b1c4f880ca775f6458a1a5",
"score": "0.600721",
"text": "def url\n URL_STARTS_WITH + @contact_row.css(\"td.name a\").attr(\"href\").value\n end",
"title": ""
},
{
"docid": "8082a9523ffd4722b15c0795fa94949f",
"score": "0.5994585",
"text": "def human_url\n # Uses Document feed because Spreadsheet feed returns wrong URL for Apps account.\n return self.feed_entry.css(\"link[rel='alternate']\")[0][\"href\"]\n end",
"title": ""
},
{
"docid": "ee2b9f1aff7ca3680ae5d4411139c6ab",
"score": "0.59843975",
"text": "def display_orcid_from_url( orcid_url )\n return '' if orcid_url.blank?\n return orcid_url.gsub( /https?:\\/\\//, '' )\n end",
"title": ""
},
{
"docid": "e9c075eb25a89b4dfe6386fb51afcabf",
"score": "0.5981576",
"text": "def domain\n re = /^(?:(?>[a-z0-9-]*\\.)+?|)([a-z0-9-]+\\.(?>[a-z]*(?>\\.[a-z]{2})?))$/i\n self.url.gsub(re, '\\1').strip\n end",
"title": ""
},
{
"docid": "2f2a6f4d9185d3a710fdc0b3165106b4",
"score": "0.5976995",
"text": "def get_hyperlink\n unless cfr_location_type_id.nil? || uri.blank? \n /\\A(https?|file|ftp):\\/\\//i =~ uri ? uri : \"file://#{ uri }\"\n end\n end",
"title": ""
},
{
"docid": "c969f9dff0cd14152a51c502174e4639",
"score": "0.5967809",
"text": "def external_homepage_url\n @attributes[:external_homepage_url]\n end",
"title": ""
},
{
"docid": "1f11dd307d26c34ee21f0bc6e18b6158",
"score": "0.59642076",
"text": "def address\n @site.host\n end",
"title": ""
},
{
"docid": "445d7d0440d1c6f2fe2f8d7b247c4538",
"score": "0.596412",
"text": "def maps_url\n if self.street_address_1 != nil\n \"https://www.google.com/maps/place/\" + \"#{space_for_plus_sub(self.street_address_1)}\" + \"+#{self.city}\" + \"+#{self.state}\" + \"+#{self.zip_code}\"\n end\n end",
"title": ""
},
{
"docid": "db5c63bcdf8d1ff82e5d5eaca3da74a9",
"score": "0.595352",
"text": "def get_mail(entry)\n entry['mail'].each do |addr|\n addr.downcase!\n\n if addr.nil? || addr.split(\"@\")[1] == \"myportal.montana.edu\"\n return nil\n else\n return addr\n end\n end\nend",
"title": ""
},
{
"docid": "db5c63bcdf8d1ff82e5d5eaca3da74a9",
"score": "0.595352",
"text": "def get_mail(entry)\n entry['mail'].each do |addr|\n addr.downcase!\n\n if addr.nil? || addr.split(\"@\")[1] == \"myportal.montana.edu\"\n return nil\n else\n return addr\n end\n end\nend",
"title": ""
},
{
"docid": "2d12e408846414034b1c1d818c13dd7c",
"score": "0.59520304",
"text": "def url_match_by_domain(body, company_name)\n url = ''\n # As Domains are always downcase with no special characters\n formated_c_name = get_formated_company_name(company_name)\n\n body.each do |b|\n next unless (b['domain'].split('.')[0]).match(formated_c_name)\n\n url = \"https://www.#{b['domain']}\"\n @summary_hash[:fetch_from_clearbit][:url_match_algo] = 'domain'\n break\n end\n url\n end",
"title": ""
},
{
"docid": "2b6b8965e3b68059e29185546288a5aa",
"score": "0.59396267",
"text": "def website_url\n self.dig_for_string(\"websiteUrl\")\n end",
"title": ""
},
{
"docid": "dc2b25e2cc3ad54e04068df184a9c17b",
"score": "0.5930008",
"text": "def display_url\n (\n object.details[\"PUrl\"] ||\n object.details[\"LUrl\"] ||\n object.details[\"url\"]\n ).to_s\n end",
"title": ""
},
{
"docid": "cd1eec930f52f708a89594104a0b2ff5",
"score": "0.5925883",
"text": "def website_info\n end",
"title": ""
},
{
"docid": "6c63a5f6102b90a92695f579302aab6b",
"score": "0.5924076",
"text": "def get_the_email_of_a_townhal_from_its_webpage(url_townhall) \n\turl_townhall = Nokogiri::HTML(open(url_townhall))\n\temail_town = url_townhall.css(\"p.Style22\")[11].text #position de l'email trouvée grace a l'inspecteur\n\treturn email_town\nend",
"title": ""
},
{
"docid": "41d20562449a3cc1dd43f37cb81855ec",
"score": "0.59131706",
"text": "def get_townhalls_url\n\t\t@email_list = Array.new\n\t\tpage = Nokogiri::HTML(open(@html_page))\n\t\tputs(@html_page + \"\\nFetching emails...\\n\" + @html_page)\n\t\tpage.xpath(\"//@href\").grep(@zipcode).each do |link|\n\t\t\tlink = link.to_s\n\t\t\t@email_list.push(get_email_webpage(link.gsub(\"./\", \"http://annuaire-des-mairies.com/\")).to_s)\n\t\tend\n\t\tputs \"...DONE !\"\n\t\treturn @email_list\n\tend",
"title": ""
},
{
"docid": "bde8b4d379ed2c08974aeb9e1a0b1522",
"score": "0.5911143",
"text": "def get_townhall_email(url)\n h = {}\n h[Nokogiri::HTML(URI.open(url)).xpath('//main[1] //div[1] //div[1] //div[1] //h1[1]').text.split(\"-\")[0].chop] = Nokogiri::HTML(URI.open(url)).xpath('//main[1] //section[2] //div[1] //table[1] //tbody[1] //tr[4] //td[2]').text\n return h\nend",
"title": ""
},
{
"docid": "f61ab675f59c6d7468a4c78836110df4",
"score": "0.59063053",
"text": "def location_contact_fields\n %i[urls emails phones]\n end",
"title": ""
},
{
"docid": "4af7faa7910d02beaff9f095ee3eb507",
"score": "0.5901405",
"text": "def full_uri company\n uri = company.website\n uri =~ %r(https?://) ? uri : \"http://#{uri}\"\n end",
"title": ""
},
{
"docid": "550e2232ed07901c255f4f1efbdbe155",
"score": "0.5901089",
"text": "def domain_name(url)\n# url.gsub(/(?:.*\\/\\/)?(?:www\\.)?(.*?)(\\..*|\\/.*)/i, '\\1' )\n\n\n# # other solution:\n url.match(/(?:https?:\\/\\/)?(?:www\\.)?([A-z\\d\\-]+)/i)[1]\n# url.match(/(?:https?:\\/\\/)?(?:www\\.)?([A-z\\d\\-]+)(.*)/i)[1]\nend",
"title": ""
},
{
"docid": "303522bd46fe57711bbba0f94821d00a",
"score": "0.58981586",
"text": "def contact_address\n details? ? details[\"Contact\"][\"address1\"] : ''\n end",
"title": ""
},
{
"docid": "c73c7cea6d65cc1c9f7174fba4f88247",
"score": "0.58915925",
"text": "def get_website\n if !self.use_custom_colors or self.website.nil?\n return \"http://hellotoken.com\" \n elsif self.website[0..6] == \"http://\"\n return self.website\n else\n return \"http://\"+self.website\n end \n end",
"title": ""
},
{
"docid": "3dedc0ab8485efa137631f710a604b91",
"score": "0.58845437",
"text": "def get_all_the_urls_of_department_townhalls(dep_url)\n \n #on recupere tout le code de annuaire...\n department_page = Nokogiri::HTML(open(\"#{dep_url}\"))\n #tout les a des communes\n a_des_communes = department_page.css(\"a\")\n a_des_communes.each_with_index do |a_d_une_commune|\n #tout les href des communes\n url_commune = a_d_une_commune['href']\n #on recup tout les url qui contiennent 34\n if url_commune.include? \"/#{@department_num}/\"\n mairie_name = a_d_une_commune.text #on recup le texte \"nom de commune\"\n # ensuite on change le . par https://...com\n url_commune[0] = \"http://annuaire-des-mairies.com\"\n # et on envoie l'adresse dans la fonction pour recup l'adresse mail \n mairie_mail = get_the_email_of_a_townhal_from_its_webpage(url_commune) \n # et ensuite on rempli notre hash avec nom et mail\n @email_hash[mairie_name] = mairie_mail\n end\n end\n end",
"title": ""
},
{
"docid": "c333d4017c2e2f3382af0ee2ac346cad",
"score": "0.58832526",
"text": "def get_site\n begin\n site =self.get_info('officialSite')\n site_array = site.split(//)\n imp_index_array= site_array.each_index.select {|i| site_array[i]==\"/\"}\n imp_index = (imp_index_array[2].to_f) + 1\n site_array.slice!(imp_index..-1)\n logo_link= \"https://logo.clearbit.com/\" + \"#{site_array.join}\"\n puts \"logo_link: #{logo_link}\"\n logo_link\n rescue\n \"http://www.freeiconspng.com/uploads/no-image-icon-15.png\"\n end\n \n end",
"title": ""
},
{
"docid": "f2dc20e3217e2242071d2f1719e378c1",
"score": "0.5875064",
"text": "def get_info_url(page, tds)\n return (page.uri + tds[0].at('a')['href']).to_s\nend",
"title": ""
},
{
"docid": "f2dc20e3217e2242071d2f1719e378c1",
"score": "0.5875064",
"text": "def get_info_url(page, tds)\n return (page.uri + tds[0].at('a')['href']).to_s\nend",
"title": ""
},
{
"docid": "f2dc20e3217e2242071d2f1719e378c1",
"score": "0.5875064",
"text": "def get_info_url(page, tds)\n return (page.uri + tds[0].at('a')['href']).to_s\nend",
"title": ""
},
{
"docid": "f2dc20e3217e2242071d2f1719e378c1",
"score": "0.5875064",
"text": "def get_info_url(page, tds)\n return (page.uri + tds[0].at('a')['href']).to_s\nend",
"title": ""
},
{
"docid": "dca1ea7a4c23a7a1c496d8c8b42bbb70",
"score": "0.58724874",
"text": "def main_info_url\n caz_data['mainInfoUrl']\n end",
"title": ""
},
{
"docid": "1385e524a3bf8375268930dd51b43654",
"score": "0.58654124",
"text": "def scrape_contacts; end",
"title": ""
},
{
"docid": "ef20b59199644d37ac507c5f58547cdc",
"score": "0.58490354",
"text": "def fix_website_format\n if !self.website.blank? && !self.website.match(/^http/i)\n self.website = \"http://#{self.website}\"\n end\n end",
"title": ""
},
{
"docid": "59dd345887c56233cb0dddf42337f78c",
"score": "0.58428806",
"text": "def email\n\t\tdoc = Nokogiri::HTML(open(\"http://www2.assemblee-nationale.fr/deputes/fiche/OMC_PA719740\"))\n\t\tdoc.xpath('/html/body/div[3]/div/div/div/section[1]/div/article/div[3]/div/dl/dd[4]/ul/li[1]/a').each do |link|\n\t \tputs mail = link['href']\n\t\tend\n\tend",
"title": ""
},
{
"docid": "02854a0dcda3e5d7da484f003d1cef9a",
"score": "0.5836129",
"text": "def get_handle(ville)\n\t\tif ville.split.length == 1\n\t\t\tlien = \"https://www.google.com/search?source=hp&ei=sIFQW8WiMISA6QTblLHAAQ&q=twitter+#{ville}&oq=twitter+#{ville}&gs_l=psy-ab.3..35i39k1j0i22i30k1l5.905.3801.0.3942.15.14.0.0.0.0.108.1064.12j1.13.0....0...1c.1.64.psy-ab..2.13.1061.0..0j0i131i67k1j0i131k1j0i67k1j0i20i263k1j0i3k1j0i203k1.0.UQoX6KY-q2I\"\n\t\telse\n\t\t\tlien = \"https://www.google.com/search?source=hp&ei=sIFQW8WiMISA6QTblLHAAQ&q=twitter+\"\n\t\t\tnew_ville = ville.split\n\t\t\tnew_ville.each do |i|\n\t\t\t\tlien += ville[i]\n\t\t\t\tif i != new_ville.length\n\t\t\t\t\tlien += \"+\"\n\t\t\t\telse\n\t\t\t\t\tlien += \"&gs_l=psy-ab.3..35i39k1j0i22i30k1l5.905.3801.0.3942.15.14.0.0.0.0.108.1064.12j1.13.0....0...1c.1.64.psy-ab..2.13.1061.0..0j0i131i67k1j0i131k1j0i67k1j0i20i263k1j0i3k1j0i203k1.0.UQoX6KY-q2I\"\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\t# puts \"SITE:\\n\", lien\n\t\t# puts \"ville == #{ville}\"\n\t\t\n\t\tpage = Nokogiri::HTML(open(lien))\n\t\tbegin\n\t\t\thandle = page.css('h3.r')[0].text.split('(')[1].split(')')[0]\n\t\trescue NoMethodError => e\n\t\t\t# puts e.message\n\n\t\tend\n\t\treturn handle\n\tend",
"title": ""
},
{
"docid": "f23ea595e1667d4dfcc8d6a4d45fc3ab",
"score": "0.5829631",
"text": "def url_note(field)\n subfield_values_3 = collect_subfield_values_by_code(field, '3')\n [subfield_values_3.join(' ')].reject(&:empty?).join(' ')\n end",
"title": ""
},
{
"docid": "75e30336cac1005634acf4bbe1864769",
"score": "0.5828003",
"text": "def www\n trd.split('.').first.to_s[/www?\\d*/] if trd\n end",
"title": ""
},
{
"docid": "871a9d8bfad2148dfed2e9b84b77ef80",
"score": "0.58249354",
"text": "def contact_info\n contact_info = { email: '', phone: '', webpage: '' }\n # Iterate over path in reverse so that we will be starting _at_ the current jurisdiction\n path&.reverse&.each do |jur|\n unless jur.phone.blank? && jur.email.blank? && jur.webpage.blank?\n contact_info[:email] = jur.email || ''\n contact_info[:phone] = jur.phone || ''\n contact_info[:webpage] = jur.webpage || ''\n break\n end\n end\n contact_info\n end",
"title": ""
},
{
"docid": "871a9d8bfad2148dfed2e9b84b77ef80",
"score": "0.58249354",
"text": "def contact_info\n contact_info = { email: '', phone: '', webpage: '' }\n # Iterate over path in reverse so that we will be starting _at_ the current jurisdiction\n path&.reverse&.each do |jur|\n unless jur.phone.blank? && jur.email.blank? && jur.webpage.blank?\n contact_info[:email] = jur.email || ''\n contact_info[:phone] = jur.phone || ''\n contact_info[:webpage] = jur.webpage || ''\n break\n end\n end\n contact_info\n end",
"title": ""
},
{
"docid": "7fd72ef0062b8e37c139585ea2988179",
"score": "0.5824052",
"text": "def get_address\n return \"#{post_code}\"\n end",
"title": ""
},
{
"docid": "5d52408a512d038b25bffaeb8e3eae8c",
"score": "0.5823024",
"text": "def news_domain(news)\n su = news[\"url\"].split(\"/\")\n domain = (su[0] == \"text:\") ? nil : su[2]\n end",
"title": ""
},
{
"docid": "4acf0543f7cffa289ba6f4ca62af01d6",
"score": "0.5812732",
"text": "def details\n #this needs to be sorted, unclear what is going on\n return name+', Tel: 0'+tel.to_s[0..2]+' '+tel.to_s[3..5]+' '+tel.to_s[6..9]+', Web: '+www+'.'\n end",
"title": ""
},
{
"docid": "e3faecf3a3de7d9d431e008a8a918187",
"score": "0.5811827",
"text": "def get_townhall_urls\n\t\tpage = Nokogiri::HTML(open(URL)).xpath(\"//a[@class='lientxt']/@href\")\n\t\tputs \"Annuaire du val d'oise bien récuperé, extraction des url des mairies\" if page.any?\n\treturn page\n\tend",
"title": ""
},
{
"docid": "2660ffa1907a8d6ff9fcc5ac9e35dc0c",
"score": "0.5797744",
"text": "def extract_url_from_email(email)\n doc = Nokogiri::HTML(email.to_s)\n\n hrefs = doc.xpath(\"//a[starts-with(text(), 'C')]/@href\").map(&:to_s)\n\n # We don't actually want our string to say test.test.com, cause\n # apparently that's a website!\n hrefs[0][\"http://test.test.com\"] = \"\"\n hrefs[0]\n end",
"title": ""
},
{
"docid": "6de3a8c94096abb5efcb0e8601f8341d",
"score": "0.579151",
"text": "def return_google_address\n puts @url\n end",
"title": ""
},
{
"docid": "6a990dc6a6e1ddd58efc9a2b7740653a",
"score": "0.5791368",
"text": "def get_mail(url)\n\t\tmail = []\n\t\turl.each do |ville|\n\t\t\t\turl_ville = ville.downcase.gsub(' ', '-')\n\t\t\t\tpage = Nokogiri:: HTML(open(\"http://annuaire-des-mairies.com/50/#{url_ville}\"))\n\t\t\t\tmail << page.css('p:contains(\"@\")').text.slice(1..-1)\n\t\tend\n\t\tpush_sheet(mail, 2)\n\t\te_mail\n\tend",
"title": ""
},
{
"docid": "980b19f897e7fdcb2bff728fc6c028ca",
"score": "0.5789447",
"text": "def get_the_email_of_a_townhall_from_its_webpage(townhall_url)\n contact = {}\n page = Nokogiri::HTML(open(townhall_url))\n contact[:name] = page.xpath(\"/html/body/div/main/section[1]/div/div/div/p[1]/strong[1]/a\").text\n contact[:email] = page.xpath(\"/html/body/div/main/section[2]/div/table/tbody/tr[4]/td[2]\").text\n p contact\n return contact\nend",
"title": ""
},
{
"docid": "2a20a8c7ea729fe4b5af2b017c42f718",
"score": "0.578372",
"text": "def sites\n [\n #'https://www.google.com.au/',\n #'https://www.desktoppr.co/',\n #'http://www.giftoppr.co/',\n #'http://au.yahoo.com/'\n ]\nend",
"title": ""
},
{
"docid": "7d2165327b5c65d52eff347ef2452a59",
"score": "0.57816786",
"text": "def strip_domain_from_url\n self.url.sub! %r{^https?://(www\\.)?gowalla\\.com}, ''\n end",
"title": ""
},
{
"docid": "a4ed0e68b421f99f8811678c8c53d9e5",
"score": "0.57805467",
"text": "def get_the_email_of_a_townhall_from_its_webpage(ville)\n ville = ville.to_s\n page = Nokogiri::HTML(open(\"http://annuaire-des-mairies.com/95/#{ville}.html\"))\n email = page.css('td[class=style27] p:contains(\"@\")').text\n print email\n end",
"title": ""
},
{
"docid": "47599069d5da304c2943091c481412b0",
"score": "0.57773477",
"text": "def calculated_home_page\n # manual override for ones we calculate wrongly\n if self.home_page != ''\n return self.home_page\n end\n\n # extract the domain name from the FOI request email\n url = self.request_email_domain\n if url.nil?\n return nil\n end\n\n # add standard URL prefix\n return \"http://www.\" + url\n end",
"title": ""
},
{
"docid": "ec5f1d645cb1a7979e72561081edeefe",
"score": "0.57756615",
"text": "def extract_url_from(full_web_address)\n uri = URI.parse(full_web_address.strip)\n uri.scheme + \"://\" + uri.host\n end",
"title": ""
},
{
"docid": "71e6fd2d0fc9fb5039ab754525e179ba",
"score": "0.57752454",
"text": "def domain\n url.to_s.match(/www/i) ? url.to_s.match(/(\\w{1,}\\.+\\w{2,3}(\\.\\w{2,3})?)$/).to_s : url.to_s\n end",
"title": ""
},
{
"docid": "71e6fd2d0fc9fb5039ab754525e179ba",
"score": "0.57752454",
"text": "def domain\n url.to_s.match(/www/i) ? url.to_s.match(/(\\w{1,}\\.+\\w{2,3}(\\.\\w{2,3})?)$/).to_s : url.to_s\n end",
"title": ""
},
{
"docid": "62ece20362d3e16b81a628052b7bd7e1",
"score": "0.57720804",
"text": "def referrer\n if Settings.hostname.ends_with?('.gov')\n \"https://#{Settings.hostname}\"\n else\n 'https://review-instance.va.gov'\n end\n end",
"title": ""
},
{
"docid": "0749762424a9c4526d5ecadec5992dad",
"score": "0.5767669",
"text": "def website_main\n @gapi[\"website\"][\"mainPageSuffix\"] if @gapi[\"website\"]\n end",
"title": ""
},
{
"docid": "43ee38beafd3bdfffcd08ff2215b36c9",
"score": "0.5762552",
"text": "def thoughtpropulsion_contact_url\n sub, port = Propel::EnvironmentSubdomains::envsub\n url_for_silent_port( :controller => 'contact', :action => 'index', :host => \"www.#{sub}thoughtpropulsion.com\", :port => port)\n end",
"title": ""
},
{
"docid": "e093d2affd3eddaacdf0e831687e7797",
"score": "0.5759949",
"text": "def website_main\n @gapi.website&.main_page_suffix\n end",
"title": ""
},
{
"docid": "9fa19276094761b87eb688d91c9944b3",
"score": "0.5753356",
"text": "def short_url\n @short_url ||= details_page.css(\"#share_a_link\").attr(\"value\").value\n end",
"title": ""
},
{
"docid": "950d8ddd2e4e027742c1d76b864a8c19",
"score": "0.5742044",
"text": "def addr_fmt venue\n location = venue['location'] || {}\n contact = venue['contact'] || {}\n\n s = ''\n\n addr = location['address']\n s += escapeHTML(addr) + '<br>' if addr\n\n cross = location['crossStreet']\n s += \"(#{escapeHTML cross})<br>\" if cross\n \n city = location['city'] || ''\n state = location['state'] || ''\n zip = location['postalCode'] || ''\n country = location['country'] || ''\n\n if city != '' or state != '' or zip != '' or country != ''\n s += \"#{escapeHTML city}, #{escapeHTML state} #{escapeHTML zip} #{escapeHTML country}<br>\"\n end\n\n phone = contact['phone'] || ''\n formattedPhone = contact['formattedPhone']\n phoneStr = if formattedPhone\n formattedPhone\n elsif phone.size > 6\n \"(#{phone[0..2]})#{phone[3..5]}-#{phone[6..-1]}\"\n else\n nil\n end\n if phone != '' and phoneStr\n s += \"<a href=\\\"tel:#{escapeURI phone}\\\">#{escapeHTML phoneStr}</a><br>\"\n end\n\n # Discard invalid characters.\n twitter = (contact['twitter'] || '').gsub(/[^a-zA-Z0-9_]/, '')\n if twitter != ''\n s += \"<a href=\\\"http://mobile.twitter.com/#{escapeURI twitter}\\\">@#{escapeHTML twitter}</a><br>\"\n end\n\n s\nend",
"title": ""
},
{
"docid": "ac78e6ba69404c08553b9e731e2bb52d",
"score": "0.5740191",
"text": "def print_layout_alternate_address\n return unless waste_producer_water_discount?\n\n { code: :separate_mailing_address,\n parent_codes: %i[sites],\n key: :title,\n key_scope: %i[applications sites separate_mailing_address], # scope for the title translation\n type: :list,\n list_items: [{ code: :operator_separate_mailing_address, lookup: true }] }\n end",
"title": ""
},
{
"docid": "1f1be0df8232d65654febcada580b11c",
"score": "0.5737005",
"text": "def url\n \turl_str = display_url\n \n scheme = (url_str.match(/([a-zA-Z][\\-+.a-zA-Z\\d]*):.*$/).try(:captures) || [])[0]\n url_str = \"http://\" + url_str unless scheme.present?\n return url_str\n end",
"title": ""
},
{
"docid": "84a8f8173b7d06bcd5c093f91ec1e690",
"score": "0.57362324",
"text": "def url_display_as(url) \n begin\n return URI.parse(url).host\n rescue\n return url\n end \n end",
"title": ""
},
{
"docid": "2a2238832aae0b7538dba6ed29a89e4f",
"score": "0.5736192",
"text": "def get_address(url)\n url = URI.decode(url)\n loc = url.split('loc:+')\n return nil if loc.length == 1\n loc_str = loc[1]\n loc_str.split('+').join(' ')\n end",
"title": ""
},
{
"docid": "93fac4b6678715e72c7115a96ea84570",
"score": "0.573322",
"text": "def contact_links\n links = {}\n \n (links[\"facebook\"] = facebook_url) if facebook && facebook != \"\"\n (links[\"twitter\"] = twitter_url) if twitter && twitter != \"\"\n (links[\"pinterest\"] = pinterest_url) if pinterest && pinterest != \"\"\n (links[\"linkedin\"] = linkedin_url) if linkedin && linkedin != \"\"\n (links[\"github\"] = github_url) if github && github != \"\"\n (links[\"googleplus\"] = googleplus_url) if googleplus && googleplus != \"\"\n (links[\"dribbble\"] = dribbble_url) if dribbble && dribbble != \"\"\n (links[\"instagram\"] = instagram_url) if instagram && instagram != \"\"\n (links[\"tumblr\"] = tumblr_url) if tumblr && tumblr != \"\"\n \n links\n end",
"title": ""
},
{
"docid": "2b345855b880cc38e59be49f22cc38f0",
"score": "0.5729594",
"text": "def full_website_url\n self.website = (URI(self.website).scheme ? self.website : (\"http://\" + self.website)) if self.website\n end",
"title": ""
},
{
"docid": "20b27087e4bda39041fcf7194929da16",
"score": "0.57268023",
"text": "def return_student_urls(doc)\n url_array = []\n doc.search(\"h3 a\").each do |item|\n unless item.values[0] == \"#\"\n url_array << \"http://students.flatironschool.com/\" + \"#{item.values[0].downcase}\"\n puts \"http://students.flatironschool.com/\" + \"#{item.values[0].downcase}\"\n end\n end\n url_array\nend",
"title": ""
},
{
"docid": "822a16289608683b72f94f3391d917c9",
"score": "0.5725809",
"text": "def address_info\n if @company.address.blank?\n return \"\"\n end\n address = ''\n address = @company.address.address_line1 + \", <br/>\" unless @company.address.address_line1.blank?\n # address += @company.address.address_line2 + \", <br/>\" unless @company.address.address_line2.blank?\n # address += @company.address.city + \" , \" unless @company.address.city.blank?\n # address += @company.address.state + \", <br/>\" unless @company.address.state.blank?\n # address += @company.address.country + \" - \" unless @company.address.country.blank?\n # address += @company.address.postal_code + \"<br/>\" unless @company.address.postal_code.blank?\n end",
"title": ""
},
{
"docid": "d9fc8c1d8eee7445107efc8d734e8f28",
"score": "0.57245755",
"text": "def build_url(zipcode, nPage=1)\n\t \"#{HOME_URL}/for_sale/#{zipcode}_zip\" if nPage == 1\n\t \"#{HOME_URL}/for_sale/#{zipcode}_zip/#{nPage}_p\"\n\tend",
"title": ""
},
{
"docid": "db9bf7c2efdeb530df153b4f08d5f6d0",
"score": "0.572426",
"text": "def website_or_company(t)\n if t.website.blank?\n h(t.company)\n else\n content_tag(:a, h(t.company.blank? ? t.website : t.company), :href => h(t.website))\n end\n end",
"title": ""
},
{
"docid": "2b33d35df5d10d190a2a0bd495b01d07",
"score": "0.572424",
"text": "def extract_contact_details(result_entry_page)\n\n # Ok, we have to dive kinda deep here to get the contact info.\n\n # These are used for testing because using the above takes the most recent post.\n #result_entry_page = result_page.link_with(:text => '4-Bedroom Unit').click # Email only\n #result_entry_page = result_page.link_with(:text => '1 bedroom apartment with grade level entry,').click # Ayanda, and number\n #result_entry_page = result_page.link_with(:text => 'Awesome loft in heritage building').click # Just number\n\n # We want the 'reply' link, which HOPEFULLY holds all the\n # contact information of the posting.\n reply_page = result_entry_page.link_with(:text => 'reply').click\n\n # All contact information should be embedded in the 'reply_options'\n # element\n options_element = reply_page.search('div.reply_options')\n\n contact_name = '<name_not_provided>'\n contact_number = '<number_not_provided>'\n\n index = 0\n\n # Need to make sure that the contact name and number are actually provided.\n # Should check all elements, for robustness.\n options_element.css('b').each do |label|\n\n # Logic below associates a label with the data that immediately follows it.\n # If it's the data we want, extract it. Otherwise, skip to next label.\n if label.text.strip === 'contact name:'\n contact_name = options_element.css('ul')[index].text.strip\n elsif label.text.strip === 'text'\n contact_number = options_element.css('ul')[index].text.strip\n else\n index += 1\n next\n end\n\n index += 1\n end\n\n # Clear previous value of email.\n email = nil\n\n # Email SHOULD always be there, so it's pretty easy to get.\n email = reply_page.search('div.anonemail').text.strip\n\n # Missing email may be an indication that we hit at Captcha...\n puts \"Something may have gone wrong...\" unless email\n\n details = [contact_name, contact_number, email]\n\n details\n end",
"title": ""
},
{
"docid": "0fc9ad7f5ead9199285ad7b0eba759fc",
"score": "0.5724072",
"text": "def domain_name(url)\n url = url.gsub(/.+\\/\\/|www.|\\..+/, '')\n return url\nend",
"title": ""
},
{
"docid": "14b635657ba185ee54caba08002676da",
"score": "0.57238805",
"text": "def company_url\n return @children['company-url'][:value]\n end",
"title": ""
},
{
"docid": "0877ba337a8f006204a89fa7439e8a1a",
"score": "0.5723032",
"text": "def url_text(field)\n subfield_values_y = collect_subfield_values_by_code(field, 'y')\n [subfield_values_y.join(' ')].reject(&:empty?)\n .reject { |v| v.match(/get\\s*it@duke/i) }\n .join(' ')\n end",
"title": ""
}
] |
d7b322f7c9a6e061d871d88dc01e2ac3
|
GET /carts/current display items in current cart
|
[
{
"docid": "c235cb8623fee6d83e1b7ca6ebb76f36",
"score": "0.79714364",
"text": "def view_current\n\t\tif @current_cart\n\t\t\t@items = Cart.find(cookies[:cart_id]).items\n\t\t\tdisplay_price_changes(@current_cart.id)\n\t\telse\n\t\t\tflash.now[:notice] = \"You have 0 items in your cart. Start shopping!\"\n\t\tend\n\tend",
"title": ""
}
] |
[
{
"docid": "4828108a48f2fd60de59e0f710d4c4c7",
"score": "0.8060222",
"text": "def index\n \n @carts = Cart.all\n @cart_items = current_cart.cart_items\n end",
"title": ""
},
{
"docid": "260c03f0c42af88e2c966d6d5af5077b",
"score": "0.80331355",
"text": "def index\n @cart_items = current_cart.cart_items\n end",
"title": ""
},
{
"docid": "d888da7fb62661fd0de44ae4f5cc91bb",
"score": "0.7846721",
"text": "def current_carts\n # Given the current_cart (id), return all the items in that cart\n []\n end",
"title": ""
},
{
"docid": "8f11b6377b88ddeab5b2e66aabbafce5",
"score": "0.77403927",
"text": "def show\n @cart_items = current_cart.cart_items\n end",
"title": ""
},
{
"docid": "f12c557ad4ad4a5f10deaf140746a2a3",
"score": "0.7629459",
"text": "def index\n @cart = current_cart\n end",
"title": ""
},
{
"docid": "a05d836335ec61ff1deffc4c5b703827",
"score": "0.7551533",
"text": "def current_cart\n carts.find_by(status: \"created\")\n end",
"title": ""
},
{
"docid": "6654bd81d7fe9131566462f8d583157a",
"score": "0.7441047",
"text": "def index\r\n if current_user and current_user.admin?\r\n @cart_items = CartItem.all.order(:cart_id)\r\n else\r\n @cart_items = current_cart.cart_items.all if current_cart\r\n end\r\n end",
"title": ""
},
{
"docid": "aafd006c60030317510936796d2919d4",
"score": "0.73639894",
"text": "def index\n render_for_api :default, json: @cart.cart_items, root: :cart_items, status: :ok\n end",
"title": ""
},
{
"docid": "b8bb41701b18a22c79b0a7300c4760dc",
"score": "0.72100186",
"text": "def index\n @cart = current_cart\n @cart_items = current_cart.cart_items.order(id: :desc)\n end",
"title": ""
},
{
"docid": "a39b5f12baaa7401ff543ef3e0d07f87",
"score": "0.71958655",
"text": "def index\n\t@products = Product.all\n\t@cart= current_cart\n end",
"title": ""
},
{
"docid": "4d1971771868d81e0cac1d4edcfbb3c5",
"score": "0.71908",
"text": "def index\n @cart = current_client.current_shopping_cart\n @shopping_cart_items = @cart.shopping_cart_items\n @title =\"Shopping Cart\"\n end",
"title": ""
},
{
"docid": "96d2e8b732b850d2f6eff358baa91014",
"score": "0.7122885",
"text": "def get_cart\n check_user_authorization\n get_wrapper('/V1/carts/mine', default_headers)\n end",
"title": ""
},
{
"docid": "dd30d954f41bd355a3eab5c2580b685c",
"score": "0.7121292",
"text": "def index\n @carted_products = current_user.cart # model > user.rb def cart\n # @carted_products = CartedProduct.where(user_id: current_user.id, status: \"carted\")\n\n render 'index.json.jb'\n # if @current_user\n # puts \"Your cart's status is:\"\n # status = \"carted\"\n # else\n # puts \"Please log in.\"\n # end\n end",
"title": ""
},
{
"docid": "154cb3ca4dd95e251a1c7327936f4ec0",
"score": "0.71124613",
"text": "def current_cart\n if session[:cart_id].nil?\n Cart.new\n else\n Cart.find(session[:cart_id])\n end \n end",
"title": ""
},
{
"docid": "8af8dac0729239c4a10a2c8ecc1f8189",
"score": "0.710762",
"text": "def index\n @items = Item.all\n @cart = current_cart\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"title": ""
},
{
"docid": "bedf7b6cb8739c36ca9b1c2ad274995b",
"score": "0.7081808",
"text": "def index\n @items_in_carts = ItemsInCart.all\n end",
"title": ""
},
{
"docid": "cf1d079971eb95455baecdcd900e7926",
"score": "0.70723766",
"text": "def current\n path = \"/shop\"\n\n response, status = BeyondApi::Request.get(@session,\n path)\n\n handle_response(response, status)\n end",
"title": ""
},
{
"docid": "4d167d1b626fe733f8b83b3cea65cef9",
"score": "0.7057311",
"text": "def show\n @cart = current_cart\n end",
"title": ""
},
{
"docid": "251dc2ec9b6381eccfc87470fa86f728",
"score": "0.7056939",
"text": "def current_cart\n @current_cart ||= Cart.find(session[:cart_id]) if session[:cart_id]\n end",
"title": ""
},
{
"docid": "63d4571a71d95021e50046d38b853b36",
"score": "0.70510644",
"text": "def index\n @carts = current_user.browsable_carts\n end",
"title": ""
},
{
"docid": "93746e187a67ec25c43ebb817f51ffb7",
"score": "0.7046272",
"text": "def current_cart\n if !session[:cart_id].nil?\n @cart = Cart.find(session[:cart_id])\n else\n @cart = Cart.new\n @cart_id = session[:cart_id]\n end\n end",
"title": ""
},
{
"docid": "f5378e9831bc1c26cab900ab0f5304a2",
"score": "0.70424175",
"text": "def current_cart\n\t\t@current_cart ||= ShoppingCart.new(token: cart_token)\n\tend",
"title": ""
},
{
"docid": "c7e3fd10617c7f0cffc03392271b2f25",
"score": "0.7042129",
"text": "def index\n \n @carted_products = current_user.cart#check in the user model for the cart method..the reason it is in the user model cause the current user has to deal with the user's methods \n #CartedProduct.where(status: \"carted\", user_id: current_user.id)#this allows the \n #current_user.carted_products.where(status: 'carted')\n render 'index.json.jb'\n\n end",
"title": ""
},
{
"docid": "263ec0d3e0b5901d22d693715203990e",
"score": "0.70392805",
"text": "def index\n @shopping_carts=ShoppingCart.carts(current_user)\n end",
"title": ""
},
{
"docid": "f1cb08905cb0e312677af4d1a1e32971",
"score": "0.70372456",
"text": "def current_cart\n if session[:cart_id] && session[:cart_id][current_store.id]\n cart = Cart.find(session[:cart_id][current_store.id])\n else\n cart = Cart.find_or_create_by_sid_and_store_id(session[:session_id],\n current_store.id)\n session[:cart_id] = { current_store.id => cart.id }\n end\n\n cart\n end",
"title": ""
},
{
"docid": "51ac200cb6c279c739c8a8f1827ffa98",
"score": "0.7030305",
"text": "def current_cart\n @current_cart ||= find_cart\n end",
"title": ""
},
{
"docid": "e44f2497cb74d42a906016c41f47e3ff",
"score": "0.70297104",
"text": "def index\n @cart_products = current_user.cart_products\n end",
"title": ""
},
{
"docid": "cdf2ceb8cb9c3b0c05bc2933dff14bf7",
"score": "0.7011842",
"text": "def index\n @products = Product.order(:name)\n @cart = current_cart\n end",
"title": ""
},
{
"docid": "bc9808ce7a11d8a6e503b6fce4a4b084",
"score": "0.70008904",
"text": "def show\n @cart = current_cart\n end",
"title": ""
},
{
"docid": "350d61107da594bed0538ba16dc1bf91",
"score": "0.6990633",
"text": "def show\n @cart_items = CartItem.where(cart_id: @cart.id)\n render json: {\n status: :ok,\n cart: @cart,\n cart_items: @cart_items,\n total_price: @cart.total_price\n }\n end",
"title": ""
},
{
"docid": "3eaec8dd91bf2f3cb582bf341c37ada8",
"score": "0.69854414",
"text": "def current_cart\n carts.last\n end",
"title": ""
},
{
"docid": "23e797a755701783a8c12bd58a5bc9cc",
"score": "0.69836974",
"text": "def current_cart\n @current_cart ||= begin\n if user\n return filled_user_cart! if user.cart\n session_to_user_cart!\n else\n session_cart\n end\n end\n end",
"title": ""
},
{
"docid": "f776cf51e69bae348d770d4f87a63eaf",
"score": "0.6978091",
"text": "def show\n @cart = current_cart\n end",
"title": ""
},
{
"docid": "d63565d682e24e923157ce884eab8ac6",
"score": "0.6969483",
"text": "def index\n @item_list = current_user.cart.cart_items\n @lists = current_user.lists\n end",
"title": ""
},
{
"docid": "1b4b306aa5694bccf955b1c21af38ae8",
"score": "0.6963929",
"text": "def index\n @cart = current_user.profile.cart_products\n end",
"title": ""
},
{
"docid": "3d9ed78cdcdf89cdfd03e591df2db489",
"score": "0.69273186",
"text": "def current\n response, status = BeyondApi::Request.get(@session, \"/shop\")\n\n handle_response(response, status)\n end",
"title": ""
},
{
"docid": "8f54b7408a7daa3347df9c622f9a4bef",
"score": "0.69261336",
"text": "def index\n @cart_with_items = CartWithItem.all\n end",
"title": ""
},
{
"docid": "d49e2ea27b767b61ca2880643baa2855",
"score": "0.69131094",
"text": "def current_cart\n if session[:cart_id].nil?\n cart = Cart.create\n session[:cart_id] = cart.id\n else\n cart = Cart.find(session[:cart_id])\n end\n cart\n end",
"title": ""
},
{
"docid": "1d4078b5e8a0649dbcae5b3048165807",
"score": "0.69090647",
"text": "def show\n @cart = current_user.current_cart\nend",
"title": ""
},
{
"docid": "c520d6a54f50f621d26ae75eb62377ff",
"score": "0.6908943",
"text": "def show\n @cart = @current_cart\n\n end",
"title": ""
},
{
"docid": "add0aed7c2032c20aae297ef1af573bd",
"score": "0.69046235",
"text": "def current_cart\n @current_cart = Order.carts.includes(:line_items).find_or_create_by(session_id: session_id)\n end",
"title": ""
},
{
"docid": "069cc0e8523973c78dbdc16bd31517ee",
"score": "0.68992686",
"text": "def index\n cart_items = CartItem.where(cart_id: @cart.id)\n render json: {\n status: :ok,\n cart_items: cart_items\n }\n end",
"title": ""
},
{
"docid": "94abbf9a6ea892da7421bd7fd214e43a",
"score": "0.6877985",
"text": "def index\n @cart_items = CartItem.all\n end",
"title": ""
},
{
"docid": "94abbf9a6ea892da7421bd7fd214e43a",
"score": "0.6877985",
"text": "def index\n @cart_items = CartItem.all\n end",
"title": ""
},
{
"docid": "94abbf9a6ea892da7421bd7fd214e43a",
"score": "0.6877985",
"text": "def index\n @cart_items = CartItem.all\n end",
"title": ""
},
{
"docid": "94abbf9a6ea892da7421bd7fd214e43a",
"score": "0.6877985",
"text": "def index\n @cart_items = CartItem.all\n end",
"title": ""
},
{
"docid": "94abbf9a6ea892da7421bd7fd214e43a",
"score": "0.6877985",
"text": "def index\n @cart_items = CartItem.all\n end",
"title": ""
},
{
"docid": "94abbf9a6ea892da7421bd7fd214e43a",
"score": "0.6877985",
"text": "def index\n @cart_items = CartItem.all\n end",
"title": ""
},
{
"docid": "94abbf9a6ea892da7421bd7fd214e43a",
"score": "0.6877985",
"text": "def index\n @cart_items = CartItem.all\n end",
"title": ""
},
{
"docid": "94abbf9a6ea892da7421bd7fd214e43a",
"score": "0.6877985",
"text": "def index\n @cart_items = CartItem.all\n end",
"title": ""
},
{
"docid": "94abbf9a6ea892da7421bd7fd214e43a",
"score": "0.6877985",
"text": "def index\n @cart_items = CartItem.all\n end",
"title": ""
},
{
"docid": "a5cd26496f58389228d3cf33c42c75dd",
"score": "0.6867572",
"text": "def index\n @cart_items = CartItem.all\n \n end",
"title": ""
},
{
"docid": "168be9f04182d1c8c02ea02c80651840",
"score": "0.68633944",
"text": "def current_cart\n acting_user.cart(session_user)\n end",
"title": ""
},
{
"docid": "f72108ffad00b71c63de9d7e53d536c3",
"score": "0.6854862",
"text": "def index\n @carts = Cart.all\n #@carts = Cart.find(session[:cart])\n end",
"title": ""
},
{
"docid": "3e2c0e1736f181da15824fa6c68fbce1",
"score": "0.6841711",
"text": "def index\n if @cart \n @cart\n end\n end",
"title": ""
},
{
"docid": "3b8823506a62be74551095564316b0bc",
"score": "0.68383425",
"text": "def show\n #@cart = Cart.find(params[:id])\n @cart = current_cart\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cart }\n end\n end",
"title": ""
},
{
"docid": "fa4e5e34dc0192d50571e0a90b1735c9",
"score": "0.68277735",
"text": "def current_cart\n @current_cart ||= Cart.first(:conditions => [\"user_id = ?\", current_user]) || Cart.create(:user_id => current_user.id)\n end",
"title": ""
},
{
"docid": "fa4e5e34dc0192d50571e0a90b1735c9",
"score": "0.68277735",
"text": "def current_cart\n @current_cart ||= Cart.first(:conditions => [\"user_id = ?\", current_user]) || Cart.create(:user_id => current_user.id)\n end",
"title": ""
},
{
"docid": "4ead357b0d9359c3560c6bc420db4787",
"score": "0.68137187",
"text": "def index\n @carts = Cart.where('member_id = ? and full_sale = false', current_user.member.id)\n end",
"title": ""
},
{
"docid": "b39771c8e6d21069dcd6ece1ddc9b435",
"score": "0.674932",
"text": "def index\n @cart = session[:cart]\n end",
"title": ""
},
{
"docid": "5ea2cf916dc741da016be36f2fdd804d",
"score": "0.67372024",
"text": "def show\n # @products = cart_session.cart_contents\n end",
"title": ""
},
{
"docid": "d8e4fa04ef01629859f5b52f20cedf52",
"score": "0.67369473",
"text": "def index\n @produtos_carrinhos = current_cart.produtos\n end",
"title": ""
},
{
"docid": "670ee49c1b416c1963302f36c5bfe6e9",
"score": "0.6735721",
"text": "def current_cart\n\t\t# Buscamos el carro de la compra utilizando la variable de sessión \n\t\tCart.find(session[:cart_id])\n\trescue ActiveRecord::RecordNotFound\n\t\tcart = Cart.create\t# Creamos un nuevo carro de la compra\n\t\tsession[:cart_id] = cart.id\n\t\tcart\n\tend",
"title": ""
},
{
"docid": "2f879d892b227c0ac936a3d9a6a41207",
"score": "0.6735692",
"text": "def show_for_cart\n @items = []\n cart_items = @cart[@user.id].to_a\n cart_item_ids = cart_items.collect(&:item_id)\n if params[:cart_items_priority].present? && cart_items.present?\n @items = cart_items.collect(&:item)\n end\n puts \" 1st got #{@items.size} cart items\"\n expected_index = (params[:page] || 1) * 20\n if @items.size < expected_index\n if cart_items.size > 0\n @items += Item.active.owned_by(@user).where([\"id NOT IN (?)\", cart_items.collect(&:item_id) ] ).paginate(per_page: 20, page: (params[:page] || 1) )\n else\n @items += Item.active.owned_by(@user).paginate(per_page: 20, page: (params[:page] || 1) )\n end\n end\n puts \" .. then filled up to #{@items.size} items\"\n\n respond_to do|format|\n format.json { render json: {user: @user.as_json,\n items: @items.collect{|item| item.as_json.merge(:is_in_cart => cart_item_ids.include?(item.id)) },\n cart_item_ids: cart_item_ids } }\n end\n end",
"title": ""
},
{
"docid": "ab9557fb3955b9d4f8f614b1b5d5207d",
"score": "0.6731065",
"text": "def show\n @cart = current_user.cart\n end",
"title": ""
},
{
"docid": "7e3f23b18d5123a3dcc4020eb1692fa5",
"score": "0.6715662",
"text": "def index\n @products = @store.products\n @cart = current_cart\n @stores = Store.all\n end",
"title": ""
},
{
"docid": "f13004515ad79950913dd25dde599a45",
"score": "0.67098784",
"text": "def show\n @carts = Cart.all\n end",
"title": ""
},
{
"docid": "4fe39240fb9a400681efbe3ed476fea2",
"score": "0.6709042",
"text": "def current_cart\n \n # See if the logged-in user has a cart in progress\n #cart = Cart.find_by_account_id(current_account.id) if (current_account)\n #return cart if cart\n \n # See if the current web session has a cart\n cart = Cart.find_by_id(session[:cart_id])\n \n # No cart found in session or for user account, then create new one\n cart = Cart.create unless cart\n # Save user account against the cart, if the user is logged in\n cart.account_id = current_account.id if current_account\n cart.save\n \n # Save cart in the session\n session[:cart_id] = cart.id\n \n cart\n end",
"title": ""
},
{
"docid": "1ec6ad215334c1645934c2a243350598",
"score": "0.6696633",
"text": "def index\n @cart = current_cart\n @user = current_user\n redirect_to @user\n end",
"title": ""
},
{
"docid": "b2fd9a4addef342dd12ecab5c72e5d14",
"score": "0.6691502",
"text": "def current_cart\n Cart.find(session[:cart_id])\n rescue ActiveRecord::RecordNotFound\n cart = Cart.create\n session[:cart_id] = cart.id\n cart\n end",
"title": ""
},
{
"docid": "ec4b59296c050460eed1819452e677b2",
"score": "0.6662732",
"text": "def show\n @cart = current_cart\n \n respond_to do |format|\n format.html # show.html.erb\n #format.xml { render :xml => @cart }\n end\n end",
"title": ""
},
{
"docid": "1e02953144b0fb5cab98b58c88ba5dff",
"score": "0.66481245",
"text": "def index\n @item_carts = ItemCart.all\n end",
"title": ""
},
{
"docid": "ab1cc28410c66b6086c40688b0c303bd",
"score": "0.66436255",
"text": "def current_cart\n if current_user\n if session[:cart_id]\n begin\n # retrieve the current shopping cart based upon the id stored in the session\n @current_cart ||= Cart.find(session[:cart_id])\n session[:cart_id] = nil if @current_cart.purchased_at or @current_cart.user != current_user\n rescue ActiveRecord::RecordNotFound\n # This can happen if the surrounding transaction (i.e, creating a line item in the cart)\n # fails and rolls back\n session[:cart_id] = nil\n end\n end\n # A cart doesn't already exist...create one\n if session[:cart_id].nil?\n @current_cart = Cart.create!(:user => current_user)\n session[:cart_id] = @current_cart.id\n end\n @current_cart\n end\n end",
"title": ""
},
{
"docid": "4ba6a3da1830c16eb7a4b06d788fa377",
"score": "0.66414505",
"text": "def index\n @order = Order.find_by(:user_id => current_user.id, :status => \"cart\")\n @carted_products = @order.carted_products\n end",
"title": ""
},
{
"docid": "d8c8ad3e1d278fbd477465ff797041e6",
"score": "0.6634136",
"text": "def index\n @carts = Cart.all\n redirect_to cart_items_url\n end",
"title": ""
},
{
"docid": "eac55c08c7ea70c417f61d2adda101ae",
"score": "0.6630907",
"text": "def index\n build_products_hash\n @page = OpenStruct.new(title: 'Cart', path: '/cart', ancestors: [], root_record: Yodel::Page.all_for_site(site).first)\n @just_added = Yodel::Record.first(id: session.delete('just_added'))\n html Yodel::Layout.first(name: 'Cart').render_with_controller(self)\n end",
"title": ""
},
{
"docid": "92a477a5b13db7219176acc542048b4c",
"score": "0.66258436",
"text": "def index\n @carts = Cart.all\n end",
"title": ""
},
{
"docid": "92a477a5b13db7219176acc542048b4c",
"score": "0.6625475",
"text": "def index\n @carts = Cart.all\n end",
"title": ""
},
{
"docid": "92a477a5b13db7219176acc542048b4c",
"score": "0.6625475",
"text": "def index\n @carts = Cart.all\n end",
"title": ""
},
{
"docid": "92a477a5b13db7219176acc542048b4c",
"score": "0.6625475",
"text": "def index\n @carts = Cart.all\n end",
"title": ""
},
{
"docid": "92a477a5b13db7219176acc542048b4c",
"score": "0.6625475",
"text": "def index\n @carts = Cart.all\n end",
"title": ""
},
{
"docid": "92a477a5b13db7219176acc542048b4c",
"score": "0.6625475",
"text": "def index\n @carts = Cart.all\n end",
"title": ""
},
{
"docid": "92a477a5b13db7219176acc542048b4c",
"score": "0.6625475",
"text": "def index\n @carts = Cart.all\n end",
"title": ""
},
{
"docid": "92a477a5b13db7219176acc542048b4c",
"score": "0.6625475",
"text": "def index\n @carts = Cart.all\n end",
"title": ""
},
{
"docid": "92a477a5b13db7219176acc542048b4c",
"score": "0.6625475",
"text": "def index\n @carts = Cart.all\n end",
"title": ""
},
{
"docid": "92a477a5b13db7219176acc542048b4c",
"score": "0.6625475",
"text": "def index\n @carts = Cart.all\n end",
"title": ""
},
{
"docid": "92a477a5b13db7219176acc542048b4c",
"score": "0.6625475",
"text": "def index\n @carts = Cart.all\n end",
"title": ""
},
{
"docid": "92a477a5b13db7219176acc542048b4c",
"score": "0.6625475",
"text": "def index\n @carts = Cart.all\n end",
"title": ""
},
{
"docid": "92a477a5b13db7219176acc542048b4c",
"score": "0.6625475",
"text": "def index\n @carts = Cart.all\n end",
"title": ""
},
{
"docid": "92a477a5b13db7219176acc542048b4c",
"score": "0.6625475",
"text": "def index\n @carts = Cart.all\n end",
"title": ""
},
{
"docid": "92a477a5b13db7219176acc542048b4c",
"score": "0.6625475",
"text": "def index\n @carts = Cart.all\n end",
"title": ""
},
{
"docid": "92a477a5b13db7219176acc542048b4c",
"score": "0.6625475",
"text": "def index\n @carts = Cart.all\n end",
"title": ""
},
{
"docid": "92a477a5b13db7219176acc542048b4c",
"score": "0.6625475",
"text": "def index\n @carts = Cart.all\n end",
"title": ""
},
{
"docid": "92a477a5b13db7219176acc542048b4c",
"score": "0.6625475",
"text": "def index\n @carts = Cart.all\n end",
"title": ""
},
{
"docid": "92a477a5b13db7219176acc542048b4c",
"score": "0.6625475",
"text": "def index\n @carts = Cart.all\n end",
"title": ""
},
{
"docid": "92a477a5b13db7219176acc542048b4c",
"score": "0.6625475",
"text": "def index\n @carts = Cart.all\n end",
"title": ""
},
{
"docid": "92a477a5b13db7219176acc542048b4c",
"score": "0.6625475",
"text": "def index\n @carts = Cart.all\n end",
"title": ""
},
{
"docid": "c026b0225a8a69b853833fd1d2145594",
"score": "0.6612424",
"text": "def index\n @cart = find_cart\n @line_items = LineItem.all(session[:cart])\n end",
"title": ""
},
{
"docid": "fa30d263f0c139893dc6b63cf8bfe8b5",
"score": "0.6612219",
"text": "def index\n @cartsitems = Cartsitem.all\n end",
"title": ""
},
{
"docid": "02ff5b74f9ad124b41de87990319cbfc",
"score": "0.6606598",
"text": "def index\n if session[:cart] then\n @cart = session[:cart]\n else\n @cart = {}\n end\n end",
"title": ""
}
] |
d145c0204d2102500b83fb2ab5186407
|
request > Proto::UserFindRequest response > Proto::UserList
|
[
{
"docid": "736f3e9a7312c189dca1fa284cb5cff1",
"score": "0.68962836",
"text": "def find\n\t\t self.async_responder = true\n\t\t\t$logger.debug '[S] in Proto::UserService#find'\n\t\t\t$logger.debug '[S] calling client service find'\n\t\t Proto::ClientService.client(async: true).find(request) do |c|\n c.on_success do |s|\n $logger.debug '[S] in client.on_success for ClientService#find = %s' % s.inspect\n \t\t\tresponse.users = request.guids.map do |guid|\n \t\t\t\tProto::User.new.tap do |user|\n \t\t\t\t\tuser.guid = guid\n \t\t\t\tend\n \t\t\tend\n \t\t\tsend_response\n end\n \n c.on_failure do |e|\n $logger.debug '[S] in client.on_failure for ClientService#find = %s' % e.inspect\n rpc_failed e\n end\n\t end\n\t\tend",
"title": ""
}
] |
[
{
"docid": "55b9785de81e86bc37da9f5016c4f36f",
"score": "0.62258446",
"text": "def listUsers()\n params = {}\n resp_parsed = api_call(__method__.to_s, params)\n end",
"title": ""
},
{
"docid": "3ff66b41a492da5c1ce40dd6f2e9eca4",
"score": "0.6201834",
"text": "def my_list(*args)\n @response\n end",
"title": ""
},
{
"docid": "c0de354527933133d6a020e103eaa4a5",
"score": "0.61644554",
"text": "def user_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UsersApi.user_list ...\"\n end\n # resource path\n local_var_path = \"/users/\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = []\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = []\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\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<ContractorSerializer>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UsersApi#user_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "600c9ef5dc88a6bf6862d4460864eb28",
"score": "0.601335",
"text": "def search_user_names_for_message\n @users = (session[:from_follower_following] ? @login_user.from_follower_following(params[:term]) : @login_user.all_message_users(params[:term]))\n @usernames = []\n @users.collect{|u| @usernames << u.username}\n respond_to do |format|\n format.json { render :json => @usernames }\n end\n end",
"title": ""
},
{
"docid": "62f19fa241a4338b371cba5d9271279a",
"score": "0.60067374",
"text": "def get_listfollowing_search\n @usr = User.find_by_id(params[:user_id])\n if params[:query].nil?\n @arr = ArrayPresenter.new(@usr.following_users.page(params[:page]), UserAndroidPresenter)\n elsif\n @list = @usr.following_users.where('lower(name) LIKE ? OR lower(email) LIKE ?', \"%#{params[:query].downcase }%\", \"%#{params[:query].downcase }%\")\n @arr = ArrayPresenter.new(@list.page(params[:page]), UserAndroidPresenter)\n end\n render json: { followings: @arr }\n end",
"title": ""
},
{
"docid": "e04cad8ed450d6a0b2fb860b06aadb76",
"score": "0.59719276",
"text": "def user_req_list(conn_req)\n # build a response command\n @subscribed_userdata_list[conn_req.user_name] = conn_req\n count = 0\n # step slice, when we have reach this number we send the list \n step = 40\n cmd_det = \"\"\n list_nr = \"0\"\n list_next = \"1\"\n num_user = @logged_in_list.size\n @log.debug \"user_req_list with logged in players: #{num_user}\" \n str_rec_coll = \"\" \n # if the list is empty we send a special empty\n if num_user == 0\n cmd_det = \"0,empty,empty;\"\n # send an empty list\n conn_req.send_data(build_cmd(:user_list, cmd_det))\n return\n end\n sent_flag = false\n @logged_in_list.each do |k, v|\n str_rec = \"#{k},#{v.user_lag},#{v.user_type},#{v.user_stat};\"\n str_rec_coll += str_rec\n count += 1\n if count >= num_user\n # last item in the list, send it\n cmd_det = \"#{list_nr},eof;#{str_rec_coll}\"\n conn_req.send_data(build_cmd(:user_list, cmd_det))\n sent_flag = true\n elsif(count % step) == 0\n # reach a maximum block, send records\n cmd_det = \"#{list_nr},#{list_next};#{str_rec_coll}\"\n conn_req.send_data(build_cmd(:user_list, cmd_det))\n str_rec_coll = \"\"\n list_nr = list_next\n list_next = (list_next.to_i + 1).to_s\n sent_flag = true \n end \n end\n unless sent_flag\n @log.error(\"user_req_list sent nothing!!\")\n end\n end",
"title": ""
},
{
"docid": "85e6bcca5a47c2d6230faf5b019ab73b",
"score": "0.59524655",
"text": "def list_users 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_users_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::AlloyDB::V1beta::ListUsersResponse.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end",
"title": ""
},
{
"docid": "93e3b08dc4a08f77e765b431823d4f99",
"score": "0.59201634",
"text": "def get_user_lists(username, *args)\n http_method = :get\n path = '/feeds/people/{username}/lists'\n path.sub!('{username}', username.to_s)\n\n # Ruby turns all key-value arguments at the end into a single hash\n # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')\n # becomes {:limit => 10, :part_of_speech => 'verb'}\n last_arg = args.pop if args.last.is_a?(Hash)\n last_arg = args.pop if args.last.is_a?(Array)\n last_arg ||= {}\n\n # Look for a kwarg called :request_only, whose presence indicates\n # that we want the request itself back, not the response body\n if last_arg.is_a?(Hash) && last_arg[:request_only].present?\n request_only = true\n last_arg.delete(:request_only)\n end\n\n params = last_arg\n body ||= {}\n request = Wordnik::Request.new(http_method, path, :params => params, :body => body)\n request_only ? request : request.response.body\n end",
"title": ""
},
{
"docid": "dd6fbc133b9df7700ea48b142880572c",
"score": "0.5918475",
"text": "def list_users\n\n params[:is_xhr] = request.xhr?.nil? ? 0 : 1\n service_response = ClientUsersManagement::ListUser.new(params).perform\n\n render_api_response(service_response)\n\n end",
"title": ""
},
{
"docid": "73ccb5d0704060e22b61a9978cab1893",
"score": "0.5871",
"text": "def friend_list\n if params[:email].nil?\n raise ActiveRecord::RecordInvalid\n else\n requesting_user = User.find_by(email: params[:email])\n if requesting_user \n friend_list = requesting_user.friend_list.pluck(:email)\n json_response({success: true, friends: friend_list, count: friend_list.size}, :ok)\n else\n raise ActiveRecord::RecordNotFound\n end\n end\n end",
"title": ""
},
{
"docid": "6838e916480033f7a432cc644851165a",
"score": "0.5863158",
"text": "def users(params={})\n request(\"/people\", params).users\n end",
"title": ""
},
{
"docid": "0d9da1e4156eaf0a12aeb17e245a89b6",
"score": "0.5834555",
"text": "def search_users_by_query(request)\n start.uri('/api/user/search')\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .post()\n .go()\n end",
"title": ""
},
{
"docid": "28d5e7b71c9a1059b3d47c909e8c85ba",
"score": "0.5823802",
"text": "def get_user_by_id_list\n @ulist = []\n if params[:uids].nil?\n badparams(\"uids\")\n else\n params[:uids].split(\",\").each do |item|\n u = User.find(item)\n if !(u.nil?)\n @ulist << u\n end\n\n end\n render json: @ulist\n end\n end",
"title": ""
},
{
"docid": "3af60787a591ce7a258d3cdefb4a97d2",
"score": "0.581664",
"text": "def search_users\n requires({'role'=>'admin'})\n email = '%'\n firstname = '%'\n lastname = '%'\n\t\t#If parameters are present, set the variables equal to the parameters.\n email = '%' + params[:email] + '%' if params[:email] != ''\n firstname = '%' + params[:first_name] + '%' if params[:first_name] != ''\n lastname = '%' + params[:last_name] + '%' if params[:last_name] != ''\n u = User.where('role = ? and deleted_at is null', params[:role])\n total = u.count\n\t\t#Do the actual searches\n matching_first_name = User.where('lower(first_name) like ?', firstname.downcase)\n matching_last_name = User.where('lower(last_name) like ?', lastname.downcase)\n matching_email = User.where('lower(email) like ?', email.downcase)\n\t\t\n\t\t#Add results to return list\n u = u & matching_first_name if matching_first_name\n u = u & matching_last_name if matching_last_name\n u = u & matching_email if matching_email\t\t\n u = u.take(10)\n\n\t\t#Sort list (if option seleced)\n u.order_by(:email) if params[:sortby] == 'email'\n render :json => {:users => u, :count => u.count, :total => total}\n end",
"title": ""
},
{
"docid": "e0a23690a471ce6017a1066bcf229ce7",
"score": "0.58103263",
"text": "def list_users\n payload = []\n users = User.all\n users.each do |user|\n payload << user.get_payload\n end\n \n respond_to do |format|\n format.html {render :layout => false, :json => payload}\n format.json {render :layout => false, :json => payload}\n end\n end",
"title": ""
},
{
"docid": "e89a8471fd2c0478ac69224d312856e6",
"score": "0.5766222",
"text": "def friend_list()\n return self.get(\"/json/api/friend-list.php\")\n end",
"title": ""
},
{
"docid": "aba78b5be8577de4d73f3de070e072d2",
"score": "0.5757755",
"text": "def get_list (list_id = nil, members = nil, page = nil, max = nil, opts={})\n query_param_keys = [:list_id,:members,:page,:max]\n headerParams = {}\n\n \n \n # set default values and merge with input\n options = {\n :'list_id' => list_id,\n :'members' => members,\n :'page' => page,\n :'max' => max\n \n }.merge(opts)\n\n #resource path\n path = \"/get-list.json\".sub('{format}','json')\n \n # pull querystring keys from options\n queryopts = options.select do |key,value|\n query_param_keys.include? key\n end\n\n # header parameters\n headers = {}\n\n _header_accept = 'application/json'\n if _header_accept != ''\n headerParams['Accept'] = _header_accept\n end \n _header_content_type = ['application/x-www-form-urlencoded']\n headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'\n\n \n \n headers[:'Authorization'] = @api_key_secret\n\n # http body (model)\n post_body = nil\n \n # form parameters\n form_parameter_hash = {}\n \n \n \n Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body, :form_params => form_parameter_hash }).make\n \n \n end",
"title": ""
},
{
"docid": "b43edb460e2086f3385084ea36617f39",
"score": "0.5752909",
"text": "def friend_requests\n self.class.get(\"/v1/friend/requests\")\n end",
"title": ""
},
{
"docid": "7a1c6363eb6f009c92890efb0f72d0bf",
"score": "0.574133",
"text": "def search_user\n \temail = user_search_params['query'] \t\n \t@users = User.where(\"email LIKE :prefix\", prefix: \"#{email}%\")\n \trespond_to do |format| \t\n \t\tuser_json = @users.to_json(:only => [ :id, :email ])\n \tformat.json { render :json => user_json } # don't do msg.to_json\n \tend \t\n end",
"title": ""
},
{
"docid": "1e9b09791e2fca120e31b68aaa50d19b",
"score": "0.57340693",
"text": "def list(query = nil)\n url = endpoint.dup\n url << \"?#{query}\" if query.present?\n\n verify_received_user_names(\n HTTParty.get(\n url,\n headers: headers(\n {\n \"Content-Type\" => \"application/vnd.ims.lti-nrps.v2.membershipcontainer+json\",\n },\n ),\n ),\n )\n end",
"title": ""
},
{
"docid": "e281cb126d2669f6777a2b4505f36ee2",
"score": "0.57196236",
"text": "def list\n if request.post?\n ids = params[:user].keys.collect { |id| id.to_i }\n\n User.update_all(\"status = 'confirmed'\", :id => ids) if params[:confirm]\n User.update_all(\"status = 'deleted'\", :id => ids) if params[:hide]\n\n redirect_to url_for(:status => params[:status], :ip => params[:ip], :page => params[:page])\n else\n conditions = Hash.new\n conditions[:status] = params[:status] if params[:status]\n conditions[:creation_ip] = params[:ip] if params[:ip]\n\n @user_pages, @users = paginate(:users,\n :conditions => conditions,\n :order => :id,\n :per_page => 50)\n end\n end",
"title": ""
},
{
"docid": "809477f9b3e135c2866c31fa9e12cd0a",
"score": "0.5716866",
"text": "def find_user(payload); end",
"title": ""
},
{
"docid": "ee5f6f518563999def03ff37253f494f",
"score": "0.570627",
"text": "def list(status: T.unsafe(nil), phone_number: T.unsafe(nil), incoming_phone_number_sid: T.unsafe(nil), friendly_name: T.unsafe(nil), unique_name: T.unsafe(nil), limit: T.unsafe(nil), page_size: T.unsafe(nil)); end",
"title": ""
},
{
"docid": "7fb2fdfbb3e79121ad92a43e65fd5d16",
"score": "0.5684105",
"text": "def index\n @service_response = UserManagement::Users::List.new(params).perform\n format_service_response\n end",
"title": ""
},
{
"docid": "d932bb415028991f3c4693551ad2c8d8",
"score": "0.5665911",
"text": "def find_users\n url = \"%s/_design/User/_view/all?reduce=false&include_docs=true\" % @url\n http = EM::HttpRequest.new(url).get\n http.errback { yield [] }\n http.callback do\n doc = if http.response_header.status == 200\n rows = JSON.parse(http.response)['rows'] rescue []\n rows.map {|row| row['doc'] }\n end\n yield doc || []\n end\n end",
"title": ""
},
{
"docid": "30fd70db9bd7df970fda7c8a32c5f7f2",
"score": "0.5654337",
"text": "def get_friends(user)\r\n ret = []\r\n resp = https(@api_site).get(\"/2/friendships/friends/bilateral.json?uid=#{user.setting.user_id_sina}&count=#{FRIENDS_LIMIT}&access_token=#{user.setting.oauth_sina}\")\r\n#puts resp.body\r\n if resp.class == Net::HTTPOK\r\n users = JSON.parse(resp.body)['users']\r\n ret = users.collect{|u| {:name => u['name'], :avatar => u['avatar_large'], :id => u['screen_name']}}\r\n end\r\n ret\r\n end",
"title": ""
},
{
"docid": "74701cb9cc8b780c192ecad0b859f771",
"score": "0.56536925",
"text": "def rpc_find( session, field, data )\n rep = Entities.Persons.find( field, data )\n if not rep\n rep = { \"#{field}\" => data }\n end\n reply( :update, rep ) + rpc_update( session )\n end",
"title": ""
},
{
"docid": "b209d6e9945c425900c17658a74b7147",
"score": "0.5643838",
"text": "def users(query={})\n perform_get(\"/api/1/users\", :query => query)\n end",
"title": ""
},
{
"docid": "0e4ab1a27868a0056e67da1d6e3e7b7d",
"score": "0.563104",
"text": "def search(query)\n derived_headers = case query\n when String\n headers.merge({params: { search: query }})\n when Hash\n headers.merge({params: query })\n else\n headers\n end\n\n response = execute_http do\n RestClient::Resource.new(users_url, @configuration.rest_client_options).get(derived_headers)\n end\n JSON.parse(response).map { |user_as_hash| UserRepresentation.from_hash(user_as_hash) }\n end",
"title": ""
},
{
"docid": "9ab2a89dc6c8f21f7242d8a9fb23940b",
"score": "0.56259346",
"text": "def list\n friends = []\n session[:user].friends.each do |friend|\n \tfriends.push friend.description\n end\n @result = { success: true, friends: friends }\n end",
"title": ""
},
{
"docid": "8963a9f1be21cb8fccad13f542be5a0d",
"score": "0.5624155",
"text": "def find_users_by_criteria(*args)\n http_method = :get\n path = '/users/find'\n\n # Ruby turns all key-value arguments at the end into a single hash\n # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')\n # becomes {:limit => 10, :part_of_speech => 'verb'}\n last_arg = args.pop if args.last.is_a?(Hash)\n last_arg = args.pop if args.last.is_a?(Array)\n last_arg ||= {}\n\n # Look for a kwarg called :request_only, whose presence indicates\n # that we want the request itself back, not the response body\n if last_arg.is_a?(Hash) && last_arg[:request_only].present?\n request_only = true\n last_arg.delete(:request_only)\n end\n\n params = last_arg\n body ||= {}\n request = Wordnik::Request.new(http_method, path, :params => params, :body => body)\n request_only ? request : request.response.body\n end",
"title": ""
},
{
"docid": "01e50f6aad4a334256a2bcf53c232354",
"score": "0.562365",
"text": "def find_people\n @users=[]\n session[:search_opt] = params[:user]\n if request.post?\n @users = @login_user.search_query(params[:user],1)\n flash[:notice] = \"No results found.\" if @users.empty?\n end\n end",
"title": ""
},
{
"docid": "d4e4b44cc51e79fc3182bed65ac1fe49",
"score": "0.5618664",
"text": "def lookup users = []\n raise \"No user ids specified\" if users.empty?\n\n # Determine if dealing with screen_names or ids\n if users.first.is_a? Fixnum # dealing with user ids\n parameter = :user_id\n else user.first.is_a? String # dealing with screen names\n parameter = :screen_name\n end \n\n return post('/users/lookup.json', parameter => users.join(',')) if users.count <= USERS_LOOKUP_SIZE\n\n friends = []\n\n users.each_slice(USERS_LOOKUP_SIZE) do |user_batch|\n json = post(\"/users/lookup.json\", parameter => user_batch.join(','))\n\n # Raise errors\n raise \"#{json['request']}: #{json['error']}\" if json.is_a?(Hash) && json['error']\n\n friends += json\n end\n\n friends\n end",
"title": ""
},
{
"docid": "6b29c59eaeef08aa83a598b8a490b67c",
"score": "0.5609153",
"text": "def get_user_list\n # byebug\n @lists = List.all.select{|list| list.user_id === current_user.id}\n render json: @lists, status:201\n end",
"title": ""
},
{
"docid": "cac93174e2e8438a62d828ccce807585",
"score": "0.56019455",
"text": "def search_users_by_query_string(request)\n start.uri('/api/user/search')\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .post()\n .go()\n end",
"title": ""
},
{
"docid": "5e5a9afb4e8b6412be8d51f34b3c2589",
"score": "0.5600505",
"text": "def friends_requests\n\t\tUser.find_by_sql(\"Select users.id , users.f_name, users.l_name From users,friendships WHERE users.id = friendships.u1_id AND friendships.accepted = 0 AND friendships.u2_id = #{self.id}\").order(updated_at: :desc)\n\tend",
"title": ""
},
{
"docid": "5bba7a1b8d65e6d8f4940a085b49c8e4",
"score": "0.55942816",
"text": "def list_user_names(iam)\n list_users_response = iam.list_users\n list_users_response.users.each do |user|\n puts user.user_name\n end\nend",
"title": ""
},
{
"docid": "5bba7a1b8d65e6d8f4940a085b49c8e4",
"score": "0.55942816",
"text": "def list_user_names(iam)\n list_users_response = iam.list_users\n list_users_response.users.each do |user|\n puts user.user_name\n end\nend",
"title": ""
},
{
"docid": "54d6d50a86d232a8fb5ba4bb742a279c",
"score": "0.5591025",
"text": "def list\n response = site[resource[:user]].get\n decode response.body\n end",
"title": ""
},
{
"docid": "4796ae39441295bb259e3ab33e4ff18e",
"score": "0.55907285",
"text": "def search_friends\n authenticate_user!\n\n user = User.find params[:user_id]\n friends = user.search_friends_by_name params[:q]\n\n respond_to do |format|\n format.json { render json: friends.map! { |user| { id: user.id, name: user.name } } }\n end\n end",
"title": ""
},
{
"docid": "c30d74a9ad7eba05edcb8605ab93b040",
"score": "0.55833024",
"text": "def get_users\n response = connection.get \"users\"\n parse(response)\n end",
"title": ""
},
{
"docid": "52bf4889204cbc2f21955df4b5b98022",
"score": "0.55781525",
"text": "def searches_users\n response = []\n keyword = params[:q] || ''\n attribute_filters = { :network_id => current_network_id }\n\n results = ThinkingSphinx.search(Riddle.escape(keyword), classes: [User], star: true, :with => attribute_filters)\n\n results.each do |result|\n response << { id: result.id, name: result.name, avatar: profile_photo(result) }\n end\n\n respond_to do |format|\n format.json { render :json => response }\n end\n end",
"title": ""
},
{
"docid": "af39b9913bde2096bae23b43c571d255",
"score": "0.55701184",
"text": "def index\n @users = query(USER, :login, :email)\n\n respond_to do |format|\n format.html\n format.xml { render :xml => @users }\n end\n end",
"title": ""
},
{
"docid": "01872a37e3780a8285d53b145f1e1d0b",
"score": "0.5559232",
"text": "def search_users_by_query_string(request)\n start.uri('/api/user/search')\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .post()\n .go()\n end",
"title": ""
},
{
"docid": "be345de3d544a16c4c4a3c79d69d07d2",
"score": "0.5554976",
"text": "def get_list\n @friend = User.find(params[:friend_id].split(\".\")[1])\n @list = ListFinder.find_users_lists(@friend.id)\n render :partial=>\"simple_search/list_selection\", :collection => @list, :locals => { :friend => @friend }\n end",
"title": ""
},
{
"docid": "1ed56f7b7f547c57746a89eed524711c",
"score": "0.5545275",
"text": "def users(*args)\n options = { user_id: args.join(\",\") }\n url = NSURL.URLWithString(\"https://api.twitter.com/1.1/users/lookup.json\")\n request = TWRequest.alloc.initWithURL(url, parameters:options, requestMethod:TWRequestMethodGET)\n request.account = self.ac_account\n ns_url_request = request.signedURLRequest\n ns_url_response_ptr = Pointer.new(:object)\n error_ptr = Pointer.new(:object)\n ns_data = NSURLConnection.sendSynchronousRequest(ns_url_request, returningResponse:ns_url_response_ptr, error:error_ptr)\n return BubbleWrap::JSON.parse(ns_data)\n end",
"title": ""
},
{
"docid": "875017e89d62abb21a68608fe71b3494",
"score": "0.55445564",
"text": "def list(end_user_type: T.unsafe(nil), iso_country: T.unsafe(nil), number_type: T.unsafe(nil), limit: T.unsafe(nil), page_size: T.unsafe(nil)); end",
"title": ""
},
{
"docid": "7c30582df9ab4524ab1169afba174eaa",
"score": "0.5543037",
"text": "def find_friends_by_name(q)\n self.class.get(\"/v1/findfriends/byname\", :query=>{:q=>q})\n end",
"title": ""
},
{
"docid": "cb3cd1af0354b448d50b8b7c3c1d1470",
"score": "0.5538912",
"text": "def getUsersInfo(users,method)\n userslist = Array.new\n\n chunkusers = users.each_slice(100).to_a\n chunkusers.each{ |item|\n puts \"#{Time.now}: Getting info from 100 users!\"\n response = self.lookUpUsers(item,method)\n \n if response != {}\n userslist.concat(response)\n end\n }\n\n userslist\n \n end",
"title": ""
},
{
"docid": "4c205a774d527f391418eb215a04b99f",
"score": "0.5529746",
"text": "def index\n user = user_service.user_by_identifier(params[:user_id])\n event = nil\n\n if user\n case @scope\n when :all\n friends = user.friends\n when :mutual\n friends = user.mutual_friends(current_api_user)\n end\n\n friends = friends.for_term(params[:term]) if params[:term]\n\n if params[:event_id].present? && params[:forward].present?\n event = Event.active.find(params[:event_id])\n\n if event\n friends = friends.where.not(id: event.user_from_event_owner.id)\n friends = friends.where.not(id: event.attending_users)\n end\n end\n success_response(friends: friends.ordered_by_friendships.limit(limit).offset(offset).map {|user| user.cached(current_api_user, type: :public, event: event)})\n else\n error_response(I18n.t('api.responses.users.not_found'), Showoff::ResponseCodes::OBJECT_NOT_FOUND)\n end\n end",
"title": ""
},
{
"docid": "93f07f56474add38712e1418e67fc14a",
"score": "0.55275744",
"text": "def index\n respond User::List\n end",
"title": ""
},
{
"docid": "e15b21d86980f373ce142eaba6fd3e9c",
"score": "0.5521838",
"text": "def search\n return respond_with(nil, :status => {:msg => \"Query can't be blank\", :code => 400}) if params[:q].blank?\n return respond_with(nil, :status => {:msg => \"Query length must be > 3\", :code => 400}) if params[:q].length < 3\n\n offset, limit = api_offset_and_limit\n users = User.enabled\n .search(:username_or_email_contains => params[:q])\n .order('updated_at DESC')\n .offset(offset).limit(limit)\n\n respond_with({:total => users.total_count, :limit => limit, :offset => offset, :query => params[:q], :users => @presenter.collection(users)})\n end",
"title": ""
},
{
"docid": "fff7e3e3f6008badda443ffe3a625df3",
"score": "0.5518867",
"text": "def fetch_friends; end",
"title": ""
},
{
"docid": "6a62c22be30090aadd86b92f5a84c28d",
"score": "0.5513301",
"text": "def search param, condition=:all\n bulk = []\n bulk = ((followees + followers).uniq) if condition == :all\n bulk = followees if condition == :sent\n bulk = followers if condition == :received\n bulk.find_all{|p| p.name.match(/#{param}/i)}\n end",
"title": ""
},
{
"docid": "9c1550bf58011988ec1358736419d91d",
"score": "0.5501942",
"text": "def search_users(ids)\n start.uri('/api/user/search')\n .url_parameter('ids', ids)\n .get()\n .go()\n end",
"title": ""
},
{
"docid": "0f4508968c8d388a8c8316d882b0876a",
"score": "0.55017716",
"text": "def getFollowers\n\t\tpath = \"/1.1/followers/list.json\"\n\t\tquery = URI.encode_www_form(\"screen_name\" => \"BuzzwordIpsum\")\n\t\taddress = URI(\"#{@@baseurl}#{path}?#{query}\")\n\t\t\n\t\trequest = Net::HTTP::Get.new address.request_uri\n\t\t\n\t\thttp=setupHTTP(address)\n\t\tresponse = sendRequest(request, http)\n\t\t\n\t\tif response.code == '200' then\n\t\t\tusers = JSON.parse(response.body)\t\t\t\n\t\t\treturn users[\"users\"]\n\t\tend\n\tend",
"title": ""
},
{
"docid": "f7c8d79964e978c76831cb399c4c48f6",
"score": "0.5498687",
"text": "def find_users_by_name name\n sugar_resp = sugar_do_rest_call(\n @url, \n 'get_entry_list',\n { :session => @session_id, \n :module_name => \"Users\", \n :query => \"user_name='#{name}'\",#\"email_address IN ('#{email}')\", # the SQL WHERE clause without the word “where”.\n :order_by => '', # the SQL ORDER BY clause without the phrase “order by”.\n :offset => '0', # the record offset from which to start.\n :select_fields => ['email_address'],\n :max_results => '1',\n #:link_name_to_fields_array => [{:name => 'id'}, {:value => ['id', 'name']}],\n :deleted => 0, # exclude deleted records\n :favorites => false # if only records marked as favorites should be returned.\n }\n )\n return sugar_resp[\"entry_list\"]\n end",
"title": ""
},
{
"docid": "f2cf013c95fd9155b712ef016f2df093",
"score": "0.54966533",
"text": "def list\n \t@users = User.find(:all)\n end",
"title": ""
},
{
"docid": "cbb2d99f2223848323d8c55b97160bfe",
"score": "0.549327",
"text": "def index\n user_response = API::V1::Users.index\n respond_with user_response.body\n # respond_with API::V1::Users.index\n end",
"title": ""
},
{
"docid": "21657a1339d33ea74754cfb582575039",
"score": "0.5493099",
"text": "def create_user_list(client, customer_id)\n # Creates the user list operation.\n operation = client.operation.create_resource.user_list do |ul|\n ul.name = \"All visitors to example.com ##{(Time.new.to_f * 1000).to_i}\"\n ul.description = \"Any visitor to any page of example.com\"\n ul.membership_status = :OPEN\n ul.membership_life_span = 365\n # Defines a representation of a user list that is generated by a rule.\n ul.rule_based_user_list = client.resource.rule_based_user_list_info do |r|\n # To include past users in the user list, set the prepopulation_status\n # to REQUESTED.\n r.prepopulation_status = :REQUESTED\n # Specifies that the user list targets visitors of a page based on\n # the provided rule.\n r.flexible_rule_user_list = client.resource.flexible_rule_user_list_info do |frul|\n frul.inclusive_rule_operator = :AND\n frul.inclusive_operands << client.resource.flexible_rule_operand_info do |froi|\n froi.rule = client.resource.user_list_rule_info do |u|\n u.rule_item_groups << client.resource.user_list_rule_item_group_info do |group|\n group.rule_items << client.resource.user_list_rule_item_info do |item|\n # Uses a built-in parameter to create a domain URL rule.\n item.name = \"url__\"\n item.string_rule_item = client.resource.user_list_string_rule_item_info do |s|\n s.operator = :CONTAINS\n s.value = \"example.com\"\n end\n end\n end\n end\n # Optionally add a lookback window for this rule, in days.\n froi.lookback_window_days = 7\n end\n end\n end\n end\n\n # Issues a mutate request to add the user list.\n response = client.service.user_list.mutate_user_lists(\n customer_id: customer_id,\n operations: [operation],\n )\n user_list_resource_name = response.results.first.resource_name\n puts \"Created user list with resource name '#{user_list_resource_name}'\"\n\n user_list_resource_name\nend",
"title": ""
},
{
"docid": "d87fcdc6ec775b3d18120038dbc4f376",
"score": "0.54842865",
"text": "def new_list_users\n\n end",
"title": ""
},
{
"docid": "d7a8d837355d713a37f4e2fc0f5b2ad6",
"score": "0.5482313",
"text": "def get_users\n users = case params[:kind]\n when 'friends'\n current_user.friends\n when 'counselor'\n User.all_mentors\n when 'official_counselor'\n User.official_mentors\n when 'other_counselor'\n User.other_mentors\n when 'group_members'\n current_user.user_groups.find(params[:user_group_id]).members\n else\n User.valid_users.exclude_blocked_users(current_user)\n end\n users = filter_users(users).page(params[:page]).per(params[:per_page])\n render json: users.name_sorted.to_json(only: [:id, :full_name, :email, :avatar_url, :mention_key])\n end",
"title": ""
},
{
"docid": "cbb0924ba9a7769621a7e02edc7850d1",
"score": "0.5479337",
"text": "def match_friends\n me = User.find params[:id]\n respond_to do |format|\n format.json { \n friends = me.match_friends(params[:q]).collect { |friend| \n { id: friend.id.to_s, name: (friend.handle+\" (#{friend.email})\") }\n }\n render :json => friends\n }\n end\n end",
"title": ""
},
{
"docid": "c31c52ef9edaa67de877126988125348",
"score": "0.5477936",
"text": "def list\n limit = params[:limit]\n offset = params[:offset]\n\n users = User.limit(limit).offset(offset).all.pluck(:id)\n render_ok(users)\n end",
"title": ""
},
{
"docid": "c490d9c8d1b3556982b00c0da2b31fee",
"score": "0.5471391",
"text": "def find(options)\n __make_request(:list, options)\n\n end",
"title": ""
},
{
"docid": "74a4d7b0e32e250e626268d7f0fe7401",
"score": "0.5470022",
"text": "def get(incoming={})\n opts = HttpClient::Helper.symbolize_keys(incoming)\n query = {\n :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),\n :email => (x = opts.delete(:email); x.nil? ? nil : HttpClient::Preconditions.assert_class('email', x, String)),\n :status => (x = opts.delete(:status); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::UserStatus) ? x : ::Io::Flow::V0::Models::UserStatus.apply(x)).value),\n :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),\n :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),\n :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? \"-created_at\" : x), String)\n }.delete_if { |k, v| v.nil? }\n r = @client.request(\"/users\").with_query(query).get\n r.map { |x| ::Io::Flow::V0::Models::User.new(x) }\n end",
"title": ""
},
{
"docid": "74a4d7b0e32e250e626268d7f0fe7401",
"score": "0.5470022",
"text": "def get(incoming={})\n opts = HttpClient::Helper.symbolize_keys(incoming)\n query = {\n :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),\n :email => (x = opts.delete(:email); x.nil? ? nil : HttpClient::Preconditions.assert_class('email', x, String)),\n :status => (x = opts.delete(:status); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::UserStatus) ? x : ::Io::Flow::V0::Models::UserStatus.apply(x)).value),\n :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),\n :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),\n :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? \"-created_at\" : x), String)\n }.delete_if { |k, v| v.nil? }\n r = @client.request(\"/users\").with_query(query).get\n r.map { |x| ::Io::Flow::V0::Models::User.new(x) }\n end",
"title": ""
},
{
"docid": "457002924cdb5eb72adb38a623dd16f6",
"score": "0.5465203",
"text": "def fetch_friends\n params = { relationship: 'friend', steamid: steam_id64 }\n\n friends_data = WebApi.json 'ISteamUser', 'GetFriendList', 1, params\n @friends = friends_data[:friendslist][:friends].map do |friend|\n SteamId.new(friend[:steamid].to_i, false)\n end\n end",
"title": ""
},
{
"docid": "0f0ac77ff1591708cd743ca818973f0c",
"score": "0.5459177",
"text": "def get_following(user)\r\n ret = []\r\n resp = https(@api_site).get(\"/2/friendships/friends.json?uid=#{user.setting.user_id_sina}&count=#{FRIENDS_LIMIT}&access_token=#{user.setting.oauth_sina}\")\r\n#puts resp.body\r\n if resp.class == Net::HTTPOK\r\n users = JSON.parse(resp.body)['users']\r\n ret = users.collect{|u| {:name => u['name'], :avatar => u['avatar_large'], :id => u['screen_name']}}\r\n end\r\n ret\r\n end",
"title": ""
},
{
"docid": "2592dbb6ff5b052b43b42ef59c9b3501",
"score": "0.54530686",
"text": "def search_users(ids)\n start.uri('/api/user/search')\n .url_parameter('ids', ids)\n .get()\n .go()\n end",
"title": ""
},
{
"docid": "0bbfa23c657e2d9ed0dfcba5a881f6f7",
"score": "0.54432195",
"text": "def request\n data = [\n range_condition_queries(%w[joined]),\n array_queries(%w[privileges]),\n sort_query,\n range_query\n ].reduce({}, :merge)\n\n url = \"/users/#{data.empty? ? '' : '?'}#{URI.encode_www_form(data)}\"\n @data = @api.request(url).map do |hash|\n hash['id'] = @api.normalize_id(hash['id'])\n hash\n end\n end",
"title": ""
},
{
"docid": "cb08bc26f5d1e49f75c9e56556de373d",
"score": "0.544294",
"text": "def search\n json_models User.where(:name => api_params[:q])\n end",
"title": ""
},
{
"docid": "3083a609df43880c713006fb8b2f42de",
"score": "0.5438974",
"text": "def list\n @users = User.find(:all)\n end",
"title": ""
},
{
"docid": "f0733641eb9e871c635b18cbb1d83cd5",
"score": "0.542881",
"text": "def get_user_listing(user, type, params = {})\n name = extract_attribute(user, :name)\n path = \"/user/#{name}/#{type}.json\"\n params[:show] ||= :given\n\n object_from_response :get, path, params\n end",
"title": ""
},
{
"docid": "5edb2197b93dd5cb395fe0246584fc75",
"score": "0.5426101",
"text": "def find_friends(username, *args)\n path = \"user/#{username}/friends\"\n Rdigg.fetch(path, @@type, args)\n end",
"title": ""
},
{
"docid": "9409d993d196d3fe83cc9fd9e69abca9",
"score": "0.5423539",
"text": "def users(userid)\n serverCall {\n getList(\"User.get\", userid, 'users') { |u|\n User.new(u) \n }}\n end",
"title": ""
},
{
"docid": "af837323eeaaa13bb280698371c17a0f",
"score": "0.54217464",
"text": "def list\n @users = fetch_users\n\n if params[:search_text].present?\n @users = @users.select do |user|\n user.user_name.downcase.include? params[:search_text].downcase\n end\n end\n end",
"title": ""
},
{
"docid": "c272b74beaea7b6757de2af1c0f66b6b",
"score": "0.5421064",
"text": "def list(struct)\n struct.remapkeys!\n if struct.has_key? :user and struct.has_key? :pass\n rt = RT_Client.new(:user => struct[:user], :pass => struct[:pass])\n struct.delete(:user)\n struct.delete(:pass)\n else\n rt = RT_Client.new\n end\n val = rt.list(struct)\n rt = nil\n val\n end",
"title": ""
},
{
"docid": "828d9816aa94b7469ae92202dce0876a",
"score": "0.5419816",
"text": "def owners\n api_path = '/users'\n @resp = self.class.get(api_path, default_request_data)\n resp_parsing\n end",
"title": ""
},
{
"docid": "09ee17135ea0305005c4ed43b609173e",
"score": "0.5413895",
"text": "def list\n @users = User.find(:all, :order => 'name')\n end",
"title": ""
},
{
"docid": "9cdf8ec1be271c516688a09a46b2e7b5",
"score": "0.5412596",
"text": "def list\n username = params[:username].blank? ? '' : params[:username]\n role = params[:role].blank? ? 0 : params[:role].to_i\n employee = params[:employee].blank? ? '' : params[:employee]\n status = params[:status].blank? ? 0 : params[:status].to_i\n pgnum = params[:pgnum].blank? ? 1 : params[:pgnum].to_i\n pgsize = params[:pgsize].blank? ? 0 : params[:pgsize].to_i\n sortcolumn = params[:sortcolumn].blank? ? UserHelper::DEFAULT_SORT_COLUMN : \n params[:sortcolumn]\n sortdir = params[:sortdir].blank? ? UserHelper::DEFAULT_SORT_DIR : params[:sortdir]\n \n sort = ApplicationHelper::Sort.new(sortcolumn, sortdir)\n \n filters = { :username => username,\n :role => role,\n :employee => employee,\n :status => status }\n \n if username.blank? && role == 0 && employee.blank? && status == 0\n @data = UserHelper.get_all(pgnum, pgsize, sort)\n \n else\n @data = UserHelper.get_filter_by(filters, pgnum, pgsize, sort)\n end\n \n respond_to do |fmt|\n fmt.html { render :partial => 'list' }\n fmt.json { render :json => @data }\n end\n end",
"title": ""
},
{
"docid": "11ec3087168f9db63e900a9c890337c6",
"score": "0.5408731",
"text": "def users_list(params = {})\n response = @session.do_post \"#{SCOPE}.list\", params\n Slack.parse_response(response)\n end",
"title": ""
},
{
"docid": "8a50b11beee4b256bf810a2639eca71c",
"score": "0.5407394",
"text": "def list \r\n @users= User.find(:all) \r\n end",
"title": ""
},
{
"docid": "7dd05e69ae7e29cc6fdf91bea20a7c4d",
"score": "0.54062206",
"text": "def find_all(*args)\n path = \"users\"\n Rdigg.fetch(path, @@type, args)\n end",
"title": ""
},
{
"docid": "2a70d255c50fe27cbbe6730bc5362432",
"score": "0.54044366",
"text": "def user_list\n users = []\n\n if not params[ :term ].blank?\n terms = params[ :term ].split(/\\s+/)\n regex_term = Regexp.new( \"(#{terms.join(\"|\")})\", \"i\" )\n\n result = User.where({\n :$or => [\n { :email => regex_term },\n { :first_name => regex_term },\n { :last_name => regex_term }\n ]\n }).fields( :id, :first_name, :last_name, :email ).collect do |u|\n {\n :id => u.id,\n :name => \"#{u.first_name} #{u.last_name}\".strip.gsub( regex_term, '<b>\\1</b>' ),\n :email => u.email.strip.gsub( regex_term, '<b>\\1</b>' ),\n :type => u.class.name.downcase\n }\n end\n\n if params[ :include_groups ] == \"true\"\n result += UserGroup.where( :name => regex_term ).fields( :id, :name ).collect do |g|\n {\n :id => g.id,\n :name => g.name,\n :type => g.class.name.downcase\n }\n end\n\n end\n\n end\n\n render :json => result\n end",
"title": ""
},
{
"docid": "8a6e801f91b8c46ae8d1e235dd60541e",
"score": "0.5401951",
"text": "def find_list\n head :not_found unless @list = current_user.lists.find_by(id: params[:id])\n end",
"title": ""
},
{
"docid": "a5e76137ea3a780e2d6a4306f4923d23",
"score": "0.5398321",
"text": "def users_list(include_deleted = 0)\n query = {:auth_token => @token}\n query[:include_deleted] = 1 if include_deleted == 1\n self.class.get(hipchat_api_url_for('users/list'), :query => query)\n end",
"title": ""
},
{
"docid": "200e99b17edd034c2b0be424803f4431",
"score": "0.53978014",
"text": "def list(from: T.unsafe(nil), to: T.unsafe(nil), from_carrier: T.unsafe(nil), to_carrier: T.unsafe(nil), from_country_code: T.unsafe(nil), to_country_code: T.unsafe(nil), branded: T.unsafe(nil), verified_caller: T.unsafe(nil), has_tag: T.unsafe(nil), start_time: T.unsafe(nil), end_time: T.unsafe(nil), call_type: T.unsafe(nil), call_state: T.unsafe(nil), direction: T.unsafe(nil), processing_state: T.unsafe(nil), sort_by: T.unsafe(nil), subaccount: T.unsafe(nil), abnormal_session: T.unsafe(nil), limit: T.unsafe(nil), page_size: T.unsafe(nil)); end",
"title": ""
},
{
"docid": "6aeb5c3bf8252813bda8cb703e56f59d",
"score": "0.53968817",
"text": "def user_requests\n response = connection.get(\"users/requests\")\n return_error_or_body(response, response.body.response.requests)\n end",
"title": ""
},
{
"docid": "bf7a4507d94fd64f8bd1f233adcf9433",
"score": "0.53853935",
"text": "def list(*args)\n RubyKong::Request::Api.list args[0]\n end",
"title": ""
},
{
"docid": "1db0925515b3ab05f0d84bc6c61f02b7",
"score": "0.5385339",
"text": "def get_users(limit = 100, offset = 0, conditions = {})\n params = extract_query_params conditions\n\n params['limit'] = limit\n params['offset'] = offset\n\n request :get,\n '/v3/team/users.json',\n params\n end",
"title": ""
},
{
"docid": "c95d8fcb09698a9bec5ed829e3928ba1",
"score": "0.5382468",
"text": "def index\n @user = current_user\n @friendships = @user.friendships\n @inverse_friendships = @user.inverse_friendships\n\n\tfriend_id_list = []\n\t@friendships.each do |friendship|\n\t friend_id_list << friendship.friend_id\n\tend\n @inverse_friendships.each do |friendship|\n\t friend_id_list << friendship.user_id\n\tend\n\tfriend_id_list = friend_id_list.uniq\n\n\t@friends_list = User.select('id, name').find(friend_id_list)\n respond_to do |format|\n\t if @friendships\n\t format.html \n\t\tformat.json { render json: @friends_list }\n\t else\n\t format.json { render json: { :error => 'GetFriendFailed' } }\n\t end\n\tend\n end",
"title": ""
},
{
"docid": "ab8a8a901eb857488e0a5aa1eb736c6a",
"score": "0.5377948",
"text": "def get_Usernames_Playlists \n username = params[:username]\n @playlists = Playlists.find_by_username(username);\n \n respond_to do |format|\n format.html\n format.json { render :json => @playlists.playlists_JSON.to_json } \n end\n end",
"title": ""
},
{
"docid": "9c62e88649e9b1aaeb9b41c380704306",
"score": "0.53647405",
"text": "def request_list\n self.class.get('')\n end",
"title": ""
},
{
"docid": "3d0db36f2e4e77a9fdc657811accc959",
"score": "0.5362714",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ListUserRequestsResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "965e0041e403309a58a7bafebc394ff4",
"score": "0.53611815",
"text": "def find_all(options = {})\n response = JSON.parse(@client.get('users', options).body)\n users = response.key?('users') ? response['users'] : []\n users.map { |attributes| Promisepay::User.new(@client, attributes) }\n end",
"title": ""
},
{
"docid": "584e4f71829db6ffc7bc8c5e1e1ad96d",
"score": "0.53599286",
"text": "def get_user_list(custom_params = nil)\n default_params = {page_number: 1, order: 'asc', filters: {}, page_size: 3}\n endpoint = \"/api/#{@version}/users\"\n\n custom_params = custom_params || default_params\n params = request_parameters(endpoint, custom_params)\n get(params)\n end",
"title": ""
},
{
"docid": "f8c34ae0887162031bca64d00c04d1b5",
"score": "0.5359635",
"text": "def user_list(user)\n List.find_by(restaurant: self, user: user)\n end",
"title": ""
},
{
"docid": "86abfe3fa7c7c049c34032c0029e1967",
"score": "0.5357979",
"text": "def list(to: T.unsafe(nil), from: T.unsafe(nil), parent_call_sid: T.unsafe(nil), status: T.unsafe(nil), start_time_before: T.unsafe(nil), start_time: T.unsafe(nil), start_time_after: T.unsafe(nil), end_time_before: T.unsafe(nil), end_time: T.unsafe(nil), end_time_after: T.unsafe(nil), limit: T.unsafe(nil), page_size: T.unsafe(nil)); end",
"title": ""
},
{
"docid": "1e4930c5be5127f530c704b38c4a0449",
"score": "0.5339904",
"text": "def friends(args={})\n fetch(url(:\"friends\", args))\n end",
"title": ""
}
] |
038aa336e4d170a1d4693ecd70daf6cb
|
Import methods. They load the csv file, for the given type get rid of unnecessary information, transforms other fields, so they can match the one in SugarCRM and calls for the populate_sugar method which start the actual import. Keep in mind, that the order of the imports is important
|
[
{
"docid": "0b69db7e6163c7beb2c2456617e95c82",
"score": "0.0",
"text": "def import_isos\n records = load_file_for_import 'ISOs__c'\n records = transform_isos(records)\n populate_sugar(records, \"iso\")\n end",
"title": ""
}
] |
[
{
"docid": "5af97dd15a20178719e5a7d246d7419b",
"score": "0.6876317",
"text": "def import_data path, file_type\n if file_type == :csv\n csv_parse(path).each { |params| Product.new(params).save }\n elsif file_type == :xls\n #xls_parse(path)\n end\nend",
"title": ""
},
{
"docid": "a8cbeda40ecafae56e9239168cc516a1",
"score": "0.66316277",
"text": "def import_csv_smart\n \n end",
"title": ""
},
{
"docid": "818b6819b994b6427e4f88ce9afb82cf",
"score": "0.65166396",
"text": "def importx(file, name, attr=nil)\n\n case File.extname(file)\n when '.csv' then spreadsheet = Roo::Csv.new(file) #, nil, :ignore)\n when '.xls' then spreadsheet = Roo::Excel.new(file, nil, :ignore)\n when '.xlsx' then spreadsheet = Roo::Excelx.new(file) #, nil, :ignore)\n else raise \"Unknown file type: #{file}\"\n end\n\n if name != 'ApplicationRecord'\n begin\n spreadsheet.default_sheet = name\n rescue\n raise \"ya, you're gonna need a spreadsheet tab labeled '#{name}' for this to work\\r\\n\"\n end\n end\n model = name.constantize\n header = spreadsheet.row(1)\n types = spreadsheet.row(2)\n\n #print \"file=#{file}, model=#{model} name=#{name} header=#{header} def=#{spreadsheet.default_sheet}\\n\"\n\n # @todo WISE!! restrict accessible columns for import\n attr = attr.map { |str| str.to_s} if !attr.nil?\n (3..spreadsheet.last_row).each do |i|\n row = Hash[[header, spreadsheet.row(i)].transpose]\n begin\n item = model.find_by_id(row['id']) || model.new\n rescue\n print \"ya, you're gonna need a dB table '#{model.name.downcase.pluralize}' for this to work\\r\\n\"\n exit\n end\n\n item.attributes = attr.nil? ? row : row.to_hash.slice(*attr)\n item.attributes['password'] = item.attributes['password'].to_s if spreadsheet.default_sheet == 'User'\n item.save!\n end\n\n begin\n name = model.name.underscore.pluralize\n result = model.maximum(:id).next\n cmd = \"ALTER SEQUENCE #{name}_id_seq RESTART WITH #{result}\"\n ActiveRecord::Base.connection.execute(cmd)\n puts \"#{spreadsheet.last_row-2} records imported into #{model.name}, #{name}_id_seq=#{result}\"\n rescue\n puts \"Warning: not procesing table #{name.name}. Id is missing?\"\n end\n\n spreadsheet.last_row-2 # this is how many rows we imported\n end",
"title": ""
},
{
"docid": "35862de552ea9a533a3b5fb524b5e56e",
"score": "0.6494833",
"text": "def import_data\n begin\n #Get products *before* import - \n @products_before_import = Product.all\n @products_before_import.each { |p| p.destroy }\n OptionType.all.each{ |p| p.destroy }\n\n columns = ImportProductSettings::COLUMN_MAPPINGS\n rows = FasterCSV.read(self.data_file.path, :col_sep => '|')\n \n \n log(\"Importing products for #{self.data_file_file_name}, path is #{self.data_file.path} began at #{Time.now}\")\n num_imported = 0\n\n rows[ImportProductSettings::INITIAL_ROWS_TO_SKIP..-1].each do |row|\n product_information = {}\n num_imported += 1\n #next if (row[columns['Fabricante']] =~ /FAST/).nil?\n \n #Easy ones first\n product_information[:sku] = row[columns['PN']]\n product_information[:name] = row[columns['Referencia']]\n # remove commas from prices, assume the point is the decimal separator\n product_information[:price] = format_price row[columns['Precio']] unless row[columns['Precio']].nil?\n product_information[:cost_price] = format_price row[columns['Coste']] unless row[columns['Coste']].nil?\n product_information[:available_on] = DateTime.now - 1.day #Yesterday to make SURE it shows up\n product_information[:description] = row[columns['Descripcion-es']] unless row[columns['Descripcion-es']].nil?\n product_information[:on_hand] = row[columns['Stock']] unless row[columns['Stock']].nil?\n\n log(\"Importing #{product_information[:sku]}, named #{product_information[:name]}, price #{product_information[:price]}\")\n\n #Create the product skeleton - should be valid\n product_obj = Product.new(product_information)\n unless product_obj.valid?\n log(\"A product could not be imported - here is the information we have:\\n #{ pp product_information}\", :error)\n next\n end\n \n #Save the object before creating asssociated objects\n product_obj.save\n\n # apply the properties if relevant\n find_and_assign_property_value('Volumen', row[columns['Volumen']], product_obj)\n\n #Now we have all but images and taxons loaded\n # Seccion + Fabricante\n associate_taxon('Productos', seccion(row[columns['Seccion']]), product_obj)\n associate_taxon('Marcas', row[columns['Fabricante']], product_obj)\n \n #Just images \n ipath = ImportProductSettings::PRODUCT_IMAGE_PATH \n imagefiles = Dir.new(ipath).entries.select{|f|f.include?(row[columns['PN']])}\n imagefiles.each{|f| find_and_attach_image(f, product_obj)} unless imagefiles.empty?\n log(\"#{imagefiles.size} found for #{product_information[:sku]}, named #{product_information[:name]}\")\n #find_and_attach_image(row[columns['Image Main']], product_obj)\n #find_and_attach_image(row[columns['Image 2']], product_obj)\n #find_and_attach_image(row[columns['Image 3']], product_obj)\n #find_and_attach_image(row[columns['Image 4']], product_obj)\n\n # now the variants (this works, but can be implemented more elegant :)\n variants_name = File.basename(self.data_file_file_name, \".csv\") + \"_variants.csv\"\n variantsfile = ImportProductSettings::VARIANTS_PATH + variants_name \n File.open(variantsfile).readlines.each do |l|\n mpn,pn,ot,val,stock,price = l.split('|').map{|e|e.gsub('\"','')}\n price = format_price price.chomp unless price.nil?\n #log \"check if variant #{product_obj.sku} belongs to #{mpn}\"\n if product_obj.sku == mpn then\n log \"variant #{pn} belongs to #{mpn}\"\n opt_type = product_obj.option_types.select{|o| o.name == ot}.first\n\t opt_type = product_obj.option_types.create(:name => ot, :presentation => ot.capitalize) if opt_type.nil?\n new_value = opt_type.option_values.create(:name => val, :presentation => val)\n\t ovariant = product_obj.variants.create(:sku => pn)\n ovariant.count_on_hand = stock\n ovariant.price = price unless price.nil?\n\t ovariant.option_values << new_value\n imagefiles = Dir.new(ipath).entries.select{|f|f.include?(pn)}\n unless imagefiles.empty?\n imagefiles.each{|f| find_and_attach_image(f, ovariant)} \n log(\"#{imagefiles.size} found for variants of #{product_information[:sku]},named #{product_information[:name]}\")\n end\n log(\" variant priced #{ovariant.price} with sku #{pn} saved for #{product_information[:sku]},named #{product_information[:name]}\")\n\t ovariant.save!\n end\n end\n \n log(\"product #{product_obj.sku} was imported at #{DateTime.now}\")\n end\n \n rescue Exception => exp\n log(\"An error occurred during import, please check file and try again. (#{exp.message})\\n#{exp.backtrace.join('\\n')}\", :error)\n return [:error, \"The file data could not be imported. Please check that the spreadsheet is a CSV file, and is correctly formatted.\"]\n end\n \n #All done!\n return [:notice, \"Product data was successfully imported by fer.\"]\n end",
"title": ""
},
{
"docid": "eb2af891985af3fcfe1e890059b704bd",
"score": "0.64500874",
"text": "def import_csv\n @records = CSV.read(@filename, :headers => true, :row_sep => :auto)\n unless @records.blank?\n @linenum = 0\n if @filename.index('att') || @filename.index('Att')\n @school_year = Time.parse(@records[0][\"AbsenceDate\"]).year\n end\n @records.each { |rec |\n @linenum += 1\n @record = rec\n next unless check_record(@record)\n seed_record(@record)\n process_record(@record, rec2attrs(@record)) if rec2attrs(@record) != false\n }\n end \n end",
"title": ""
},
{
"docid": "b0f6646a8a5ed5488b79d5fafaa7ac0b",
"score": "0.6368732",
"text": "def load_restaurant_inspection_model(restaurants_csv, locations_csv, restaurant_locations_csv)\n @db.transaction do\n @db.alter_table :restaurant_locations do\n drop_foreign_key [:restaurant_camis]\n drop_foreign_key [:location_id]\n end\n\n @db[:restaurant_locations].truncate\n @db[:restaurants].truncate\n @db[:locations].truncate\n\n @db.alter_table :restaurant_locations do\n add_foreign_key [:restaurant_camis], :restaurants, unique: true\n add_foreign_key [:location_id], :locations\n end\n\n @db.copy_into(:restaurants, data: restaurants_csv, format: :csv, options: 'HEADER true')\n @db.copy_into(:locations, data: locations_csv, format: :csv, options: 'HEADER true')\n @db.copy_into(:restaurant_locations, data: restaurant_locations_csv, format: :csv, options: 'HEADER true')\n end\n end",
"title": ""
},
{
"docid": "cd2aae0d50a52a5582db8d1ed77435d2",
"score": "0.6343641",
"text": "def import\n CSV.new(open(uri), headers: :first_row).each_with_index do |csv_row, i|\n begin\n create_departure(csv_row: csv_row)\n rescue => e\n # this is a catch all for all the types of parsing errors that could\n # occur above\n csv_logger.info(\n I18n.t('import_exception', scope: LOCALE, row_number: i)\n )\n csv_logger.error(e)\n end\n end\n end",
"title": ""
},
{
"docid": "4faed576570ec71269a0f4c9607f5c6c",
"score": "0.63395405",
"text": "def import!\n log \"Importing #{csv_file.split('/').last.sub('.csv', '')}\"\n\n @errors_count = 0\n\n before_import()\n with_each_row { process_row }\n after_import()\n\n log \"Import complete (#{@errors_count} errors in #{@has_header_row ? @current_row_number-1 : @current_row_number} rows)\"\n end",
"title": ""
},
{
"docid": "909862e478a5fc4c1e013e67e3d3b258",
"score": "0.6276618",
"text": "def format_data(csv_row)\n\t\tklass = @import_type.classify.constantize\n\t\tklass_object = klass.new({original_row: csv_row})\n\t\tformatted_data = klass_object.get_data\n\t\tformatted_data\n\tend",
"title": ""
},
{
"docid": "c865ed0b24eb565d302d7411f1f7c42a",
"score": "0.6241832",
"text": "def import\n csv = CSV.parse(file, headers: true)\n ActiveRecord::Base.transaction do\n csv.each do |product|\n begin\n category = Category.find_or_create_by(title: product[1])\n product_obj = Product.find_or_create_by(pid: product[0])\n product_obj.update(name: product[2], price: product[3].to_i, category_id: category.id)\n rescue => e\n Rails.logger.error \"Error: Error in creating following products - #{product.inspect} - #{e.message} - #{e.backtrace.join(\"\\n\")}\"\n end\n end\n end\n end",
"title": ""
},
{
"docid": "1b490c0059b639b76a67a0b6f4e3c7eb",
"score": "0.6241384",
"text": "def import_lines(type, file_name)\n on AccountingLine do |line|\n line.send(\"import_lines_#{type}\")\n line.send(\"account_line_#{type}_file_name\").set($file_folder+file_name)\n line.send(\"add_#{type}_import\")\n update_from_page!(type)\n end\n end",
"title": ""
},
{
"docid": "65c897e15e95f5c0a1919afbe5530f80",
"score": "0.62267363",
"text": "def import_csv_full\n \n end",
"title": ""
},
{
"docid": "4861b31a2aa52bcee4f08832d0c59aa2",
"score": "0.6217084",
"text": "def import\n CSV.foreach(@file.path, :converters => :all, :return_headers => false, :headers => :first_row) do |row|\n campaign_id, source, tag, created_at, first_name, last_name,\n email, phone, company, title, status, background_info, comments,\n street1, street2, city, state, zip, country = *row.to_hash.values\n\n #TODO: implement smarter_csv and/or resque\n # https://github.com/tilo/smarter_csv\n # https://github.com/resque/resque\n\n # Rails.logger.info \"XXXXXXXX created_at#{created_at}\"\n\n if @make_contact\n # Don't Allow Duplicates\n contact = Contact.find_or_initialize_by_first_name_and_last_name_and_email(\n first_name,\n last_name,\n email\n ).tap do |contact|\n contact.user_id = @assigned.id,\n contact.source = source,\n contact.first_name = first_name,\n contact.last_name = last_name,\n contact.email = email,\n contact.phone = phone,\n # contact.company = company,\n contact.title = title,\n # contact.status = status,\n contact.background_info = process_bg_info(contact.background_info, background_info),\n contact.created_at = created_at.to_time rescue Time.current\n end\n contact.save!\n\n contact.first_name = \"INCOMPLETE\" if contact.first_name.blank?\n contact.last_name = \"INCOMPLETE\" if contact.last_name.blank?\n # contact.access? = \"Private | Public\"\n contact.access = Setting.default_access\n contact.assignee = @assigned if @assigned.present?\n contact.tag_list.add(tag)\n contact.add_comment_by_user(comments, @assigned)\n\n contact.save!\n\n #TODO: Better validation on address fields.\n if zip\n contact.business_address = Address.new(:street1 => street1, :street2 => street2, :city => city, :state => state, :zipcode => zip, :country => country, :address_type => \"Business\")\n else\n puts \"INCOMPLETE ADDRESS\"\n end\n contact.save!\n\n #\n if contact.account_contact.nil?\n\n if company\n account_name = company\n else\n account_name = contact.first_name + ' ' + contact.last_name + ' (Individual)'\n end\n\n #TODO: rails 4 Account.find_or_initialize_by(name: account_name)\n account = Account.find_or_initialize_by_name(account_name).tap do |account|\n account.user_id = @assigned.id\n account.assignee = @assigned if @assigned.present?\n account.access = contact.access\n account.category = 'customer'\n end\n account.save!\n\n contact.account_contact = AccountContact.new(:account => account, :contact => contact)\n\n # Rails.logger.info \"XXXXXXXX ACCOUNT CONTACT CREATED! #{contact.account_contact.inspect}\"\n\n # contact_account = { account: { id: account.id }, access: contact.access }\n # @account, @opportunity, @contact = contact.promote(contact_account)\n # contact = Contact.find(@contact)\n end\n\n # Rails.logger.info \"XXXXXXXX CONTACT CREATED! #{contact.inspect}\"\n\n else\n\n # Allow Duplicates\n # lead = Lead.new(\n # :user_id => @assigned.id,\n # :campaign_id => campaign_id.to_i,\n # :source => source,\n # :first_name => first_name,\n # :last_name => last_name,\n # :email => email,\n # :phone => phone,\n # :company => company,\n # :title => title, :status => status,\n # :background_info => background_info,\n # :created_at => created_at.to_time\n # )\n\n\n #TODO: rails 4 Lead.find_or_initialize_by(email: email) without tap\n # Don't Allow Duplicates\n lead = Lead.find_or_initialize_by_first_name_and_last_name_and_email(\n first_name,\n last_name,\n email\n ).tap do |lead|\n lead.user_id = @assigned.id,\n lead.campaign_id = campaign_id.to_i,\n lead.source = source,\n lead.first_name = first_name,\n lead.last_name = last_name,\n lead.email = email,\n lead.phone = phone,\n lead.company = company,\n lead.title = title,\n lead.status = status,\n lead.background_info = process_bg_info(lead.background_info, background_info),\n lead.created_at = created_at.to_time rescue Time.current\n end\n lead.save!\n\n lead.first_name = \"INCOMPLETE\" if lead.first_name.blank?\n lead.last_name = \"INCOMPLETE\" if lead.last_name.blank?\n\n # lead.access? = \"Private | Public\"\n lead.access = Setting.default_access\n lead.assignee = @assigned if @assigned.present?\n lead.tag_list.add(tag)\n lead.add_comment_by_user(comments, @assigned)\n lead.save!\n\n #TODO: Better validation on address fields.\n if zip\n lead.business_address = Address.new(:street1 => street1, :street2 => street2, :city => city, :state => state, :zipcode => zip, :country => country, :address_type => \"Business\")\n else\n puts \"INCOMPLETE ADDRESS\"\n end\n lead.save!\n\n end\n end\n\n\n end",
"title": ""
},
{
"docid": "e16c8693c8e39eb7bc44d4061e78e36f",
"score": "0.62024707",
"text": "def import_csv\n if current_admin.present? \n updated_user_id = current_admin.id\n create_user_id = current_admin.id\n else\n updated_user_id = current_user.id\n create_user_id = current_user.id\n end\n if (params[:file].nil?)\n redirect_to upload_csv_posts_path, notice: Messages::REQUIRE_FILE_VALIDATION \n elsif !File.extname(params[:file]).eql?(\".csv\")\n redirect_to upload_csv_posts_path, notice: Messages::WRONG_FILE_TYPE \n else\n error_msg = PostsHelper.check_header(Constants::HEADER,params[:file])\n if error_msg.present?\n redirect_to upload_csv_posts_path, notice: error_msg\n else \n Post.import(params[:file],create_user_id,updated_user_id)\n redirect_to posts_path, notice: Messages::UPLOAD_SUCCESSFUL\n end\n end\n end",
"title": ""
},
{
"docid": "d400b273dd7ab70ac5f5925c74ecdc1b",
"score": "0.6180857",
"text": "def perform_csv_load(file_name, options = {})\n require \"csv\"\n @parsed_file = CSV.read(file_name)\n\n # Create a method_mapper which maps list of headers into suitable calls on the Active Record class\n # For example if model has an attribute 'price' will map columns called Price, price, PRICE etc to this attribute\n populate_method_mapper_from_headers( @parsed_file.shift, options)\n\n puts \"\\n\\n\\nLoading from CSV file: #{file_name}\"\n puts \"Processing #{@parsed_file.size} rows\"\n begin\n Spree::Product.transaction do\n @reporter.reset\n @parsed_file.each_with_index do |row, i|\n @current_row = row\n name_index = @headers.find_index(\"Name\")\n name = row[name_index]\n if options[\"match_by\"]\n name_index = @headers.find_index(options[\"match_by\"])\n name = row[name_index]\n condition_hash = {name: row[name_index]}\n object = find_or_new(Spree::Product, condition_hash)\n @product = object || new_product\n @reporter.reset\n end\n\n puts \"\"\n action = @product.persisted? ? 'Updating' : 'Creating'\n puts \"#{action} row #{i+2}: #{name}\"\n\n @reporter.processed_object_count += 1\n\n begin\n # First assign any default values for columns not included in parsed_file\n process_missing_columns_with_defaults\n\n # Iterate over the columns method_mapper found in Excel,\n # pulling data out of associated column\n @method_mapper.method_details.each_with_index do |method_detail, col|\n value = row[col]\n process(method_detail, value)\n end\n\n rescue => e\n failure( row, true )\n logger.error \"Failed to process row [#{i}] (#{@current_row})\"\n\n if verbose\n puts \"Failed to process row [#{i}] (#{@current_row})\"\n puts e.inspect\n end\n\n # don't forget to reset the load object\n new_product\n next\n end\n\n unless save_object(@product)\n failure\n puts \"Failed to save row [#{i}]\"\n puts @product.errors.inspect if(@product)\n else\n puts \"Row #{@current_row} succesfully SAVED : ID #{@product.id}\"\n @reporter.add_loaded_object(@product)\n end\n\n # don't forget to reset the object or we'll update rather than create\n new_product\n\n end\n\n raise ActiveRecord::Rollback if(options[:dummy]) # Don't actually create/upload to DB if we are doing dummy run\n end\n rescue => e\n puts \"CAUGHT \", e.backtrace, e.inspect\n if e.is_a?(ActiveRecord::Rollback) && options[:dummy]\n puts \"CSV loading stage complete - Dummy run so Rolling Back.\"\n else\n raise e\n end\n ensure\n report\n end\n end",
"title": ""
},
{
"docid": "64da6d004aeceb03e28f77d887054e91",
"score": "0.61617",
"text": "def import\n att_file_name = File.join(@dir, \"attendance_ads_#{Time.now.year}_#{Time.now.month}_#{Time.now.day}.csv\")\n enr_file_name = File.join(@dir, \"enrollment_ads_#{Time.now.year}_#{Time.now.month}_#{Time.now.day}.csv\")\n ili_file_name = File.join(@dir, \"ili_ads_#{Time.now.year}_#{Time.now.month}_#{Time.now.day}.csv\")\n EnrollmentImporter.new(@enroll_file).import_csv unless @enroll_file.blank?\n AttendanceImporter.new(@attendance_file).import_csv unless @attendance_file.blank?\n IliImporter.new(@ili_file).import_csv unless @ili_file.blank?\n File.rename(@enroll_file, enr_file_name) unless @enroll_file.blank?\n File.rename(@attendance_file, att_file_name) unless @attendance_file.blank?\n File.rename(@ili_file, ili_file_name) unless @ili_file.blank?\n FileUtils.mv(enr_file_name, File.join(@dir, \"archive\")) unless @enroll_file.blank?\n FileUtils.mv(att_file_name, File.join(@dir, \"archive\")) unless @attendance_file.blank?\n FileUtils.mv(ili_file_name, File.join(@dir, \"archive\")) unless @ili_file.blank?\n end",
"title": ""
},
{
"docid": "5785f956c38afe2d1152dee5ebc3a978",
"score": "0.61558765",
"text": "def import_package_learners_from_csv\n assessment_id = params[:user][:package_id]\n unless params[:import][:excel].nil? or params[:import][:excel].blank? then\n @import = Import.new(params[:import])\n mime = (MIME::Types.type_for(@import.excel.path)[0])\n unless mime.nil? or mime.blank? then\n mime_obj = mime.extensions[0]\n #dont process further if the uploaded file is other than xls,xls,csv\n if (!mime_obj.nil? and !mime_obj.blank?) and (mime_obj.include? \"xls\" or mime_obj.include? \"xlsx\" or mime_obj.include? \"ods\" or mime_obj.include? \"csv\" ) then\n if @import.save!\n #check for virus\n if no_virus(@import.excel.path) then\n #If mime_obj is not csv only then create roo_instace\n unless mime_obj.include? \"csv\" then\n @roo = create_roo_instance(@import.excel.path,mime_obj)\n else\n #so, its a csv format\n @roo = \"csv format\"\n end\n #if the uploaded\n unless @roo == \"Upload correct excel format.\" then\n if @roo == \"csv format\" then\n lines = parse_csv_file(@import.excel.path)\n else\n lines = parse_excel_file_roo(@roo)\n end\n\n if lines.size > 0\n @import.processed = lines.size\n i = 1\n failed_to_upload = Array.new\n lines.each do |line|\n if valid_assign(params[:id])\n if valid_learners_excel_upload(line)\n else\n failed_to_upload << i\n end\n else\n flash[:learner_limit_exceeds] = \"You cannot assign more learners\"\n end\n i = i + 1\n end\n @import.save\n\n delete_csv(@import.excel.path)\n\n @import.destroy\n if params.include? 'from_assign_learners_page' then\n redirect_to(\"/packages/assign_learners/\" + assessment_id.to_s)\n else\n total_failed_to_upload = failed_to_upload.join(\",\")\n redirect_to(\"/packages/manage_learners/#{assessment_id.to_s}?failed_to_upload=#{total_failed_to_upload}\")\n end\n else\n flash[:error] = \"CSV data processing failed.\"\n end\n else\n flash[:upload_error] = 'Upload correct excel format.'\n redirect_to(\"/packages/manage_learners/#{assessment_id.to_s}\")\n end\n else\n flash[:virus_error] = \"The file is Infected with virus.\"\n redirect_to(\"/packages/manage_learners/#{assessment_id.to_s}\")\n end\n else\n flash[:error] = 'CSV data import failed.'\n end\n else\n flash[:upload_error] = 'Upload correct excel format.'\n redirect_to(\"/packages/manage_learners/#{assessment_id.to_s}\")\n end\n else\n flash[:upload_error] = 'Upload correct excel format.'\n redirect_to(\"/packages/manage_learners/#{assessment_id.to_s}\")\n end\n else\n redirect_to(\"/packages/manage_learners/#{assessment_id.to_s}\")\n end\n end",
"title": ""
},
{
"docid": "5d449f799a0af3a15c4de57789fdc70f",
"score": "0.6133761",
"text": "def import_from_csv(file_name)\r\n #implementation goes here\r\n csv_text = File.read(file_name)\r\n csv = CSV.parse(csv_text, headers: true, skip_blanks: true)\r\n # #8 iterate over table rows, create hash for each, then convert to Entry using 'add_entry' method\r\n csv.each do |row|\r\n row_hash = row.to_hash\r\n add_entry(row_hash[\"name\"], row_hash[\"phone_number\"], row_hash[\"email\"])\r\n end #end csv.each loop\r\n end",
"title": ""
},
{
"docid": "d8f3b820bf2d0c75ad13b6f04276d96e",
"score": "0.6123616",
"text": "def import_data(table_name, import_type, import_content, import_config={})\n raise \"Import Type must be APPEND, TRUNCATEADD or UPDATEADD\" unless [\"APPEND\", \"TRUNCATEADD\", \"UPDATEADD\"].include?(import_type)\n\n body = {\n 'ZOHO_AUTO_IDENTIFY' => 'true',\n 'ZOHO_ON_IMPORT_ERROR' => 'SETCOLUMNEMPTY',\n 'ZOHO_CREATE_TABLE' => 'false',\n 'ZOHO_IMPORT_TYPE' => import_type,\n 'ZOHO_IMPORT_DATA' => import_content,\n 'ZOHO_IMPORT_FILETYPE' => 'JSON',\n 'ZOHO_DATE_FORMAT' => \"yyyy/MM/dd HH:mm:ss Z\",\n 'ZOHO_MATCHING_COLUMNS' => 'id', \n }\n body = body.merge!(import_config) if import_config.any?\n\n options = {\n :query => {\n 'ZOHO_ACTION' => 'IMPORT',\n },\n :body => body\n }\n\n send_request get_uri(table_name), 'post', options\n # TODO: Figure out to what to do with File objectsw response\n end",
"title": ""
},
{
"docid": "09bcad9c3961c8165ee7fdae270a4dde",
"score": "0.6090261",
"text": "def import_lines(type, file_name)\n @accounting_lines[type].import_lines(type, file_name)\n end",
"title": ""
},
{
"docid": "16a3ffc829ec7ad2bcb0caf5af421e32",
"score": "0.60867685",
"text": "def perform_load( _options = {} )\n require 'csv'\n\n raise \"Cannot load - failed to create a #{klass}\" unless load_object\n\n logger.info \"Starting bulk load from CSV : #{file_name}\"\n\n # TODO: - can we abstract out what a 'parsed file' is - headers plus value of each node\n # so a common object can represent excel,csv etc\n # then we can make load() more generic\n\n parsed_file = CSV.read(file_name)\n\n # assume headers are row 0\n header_idx = 0\n header_row = parsed_file.shift\n\n set_headers( DataShift::Headers.new(:csv, header_idx, header_row) )\n\n # maps list of headers into suitable calls on the Active Record class\n bind_headers(headers)\n\n begin\n puts 'Dummy Run - Changes will be rolled back' if(DataShift::Configuration.call.dummy_run)\n\n load_object_class.transaction do\n logger.info \"Processing #{parsed_file.size} rows\"\n\n parsed_file.each_with_index do |row, i|\n\n logger.info \"Processing Row #{i} : #{row}\"\n\n # Iterate over the bindings, creating a context from data in associated Excel column\n\n @binder.bindings.each_with_index do |method_binding, i|\n\n unless method_binding.valid?\n logger.warn(\"No binding was found for column (#{i}) [#{method_binding.pp}]\")\n next\n end\n\n # If binding to a column, get the value from the cell (bindings can be to internal methods)\n value = method_binding.index ? row[method_binding.index] : nil\n\n context = doc_context.create_node_context(method_binding, i, value)\n\n logger.info \"Processing Column #{method_binding.index} (#{method_binding.pp})\"\n\n begin\n context.process\n rescue StandardError => x\n if doc_context.all_or_nothing?\n logger.error(\"ERROR at : #{x.backtrace.first.inspect}\")\n logger.error(x.inspect)\n logger.error('Complete Row aborted - All or nothing set and Current Column failed.')\n doc_context.failed!\n end\n end\n end # end of each column(node)\n\n doc_context.reset and next if doc_context.errors?\n\n doc_context.save_and_monitor_progress\n\n doc_context.reset unless doc_context.node_context.next_update?\n end # all rows processed\n\n if(DataShift::Configuration.call.dummy_run)\n puts 'CSV loading stage done - Dummy run so Rolling Back.'\n raise ActiveRecord::Rollback # Don't actually create/upload to DB if we are doing dummy run\n end\n end # TRANSACTION N.B ActiveRecord::Rollback does not propagate outside of the containing transaction block\n rescue StandardError => e\n puts \"ERROR: CSV loading failed : #{e.inspect}\"\n raise e\n ensure\n report\n end\n\n puts 'CSV loading stage Complete.'\n end",
"title": ""
},
{
"docid": "f33952a661472c48e71ec4cbfa242c4d",
"score": "0.60706097",
"text": "def do_user_status_csv_import\n if params[:import].nil?\n flash[:message] = 'Please upload a csv file'\n redirect_to admin_user_status_csv_import_path\n return\n end\n file = CSV.parse(params[:import][:csv].read)\n @failures = []\n file.each do |row|\n user_id = row[0]\n # If the user id isn't actually a number, skip this row\n # because that means it is probably a header or a blank line\n # http://stackoverflow.com/questions/10577783/ruby-checking-if-a-string-can-be-converted-to-an-integer\n begin\n user_id = Integer user_id\n rescue\n next\n end\n\n begin\n user = User.find(user_id)\n user.exclude_from_reporting = row[1]\n user.relationship_manager = row[2]\n user.associated_program = row[3]\n user.active_status = row[4]\n user.save!\n rescue\n @failures << user_id\n end\n end\n end",
"title": ""
},
{
"docid": "5f273b303e2ff939e2c1ca441b59c25c",
"score": "0.6069939",
"text": "def import_from_csv\n puts 'Which file would you like to import?'\n file_path = gets.chomp\n CsvImporter.new(@database, file_path).import\n puts 'Import complete.'\n rescue FileNotFoundError\n puts 'The specified file was not found.'\n rescue CsvInvalidError => e\n puts e.message\n end",
"title": ""
},
{
"docid": "bc11b2e9b9153fca3de04a1d77ad7887",
"score": "0.6058002",
"text": "def import\n CSV.foreach(@file.path, :converters => :all, :return_headers => false, :headers => :first_row) do |row|\n source, first_name, last_name, _, company, phone, *address = *row.to_hash.values\n\n street, city, state, zip, _ = *address\n address = Address.new(:street1 => street, :city => city, :state => state, :zipcode => zip)\n\n lead = Lead.new(:source => source, :first_name => first_name, :last_name => last_name,\n :company => company, :phone => phone)\n\n lead.first_name = \"FILL ME\" if lead.first_name.blank?\n lead.last_name = \"FILL ME\" if lead.last_name.blank?\n lead.access = \"Private\"\n lead.addresses << address\n\n lead.assignee = @assigned if @assigned.present?\n\n lead.save!\n end\n end",
"title": ""
},
{
"docid": "043d9cab2216df56bc46adb63a1f4e38",
"score": "0.6057987",
"text": "def import\n @imported_count = 0\n\n # Reject if the file attribute is nil or empty.\n if file.blank?\n errors.add(:base, \"No file is specified\") and return\n end\n\n CSV.foreach(file.path, headers: true, header_converters: :symbol) do |row|\n # Crete a user in memory.\n user = User.assign_from_row(row)\n\n # Try to save it in the database.\n if user.save\n @imported_count += 1\n else\n # The magic variable $. keeps track of the last line read in a file.\n errors.add(:base, \"Line #{$.} - #{user.errors.full_messages.join(', ')}\")\n end\n end\n end",
"title": ""
},
{
"docid": "cd7bf4ce26eb79a08bd7ba18f86b9f9a",
"score": "0.60527265",
"text": "def import_initial_lines(type)\n @initial_lines.each do |initial_line|\n import_lines(type, initial_line[:file_name]) unless (initial_line[:type] != type ||\n initial_line[:file_name].nil?)\n end\n @initial_lines.delete_if do |il|\n il.has_key?(:file_name) && il[:type] == type\n end # Remove all imported lines\n end",
"title": ""
},
{
"docid": "2ba07d80c03bc22d4a93a1c26f28f35b",
"score": "0.6051654",
"text": "def import_course_learners_from_csv\n assessment_id = params[:user][:course_id]\n unless params[:import][:excel].nil? or params[:import][:excel].blank? then\n @import = Import.new(params[:import])\n mime = (MIME::Types.type_for(@import.excel.path)[0])\n unless mime.nil? or mime.blank? then\n mime_obj = mime.extensions[0]\n #dont process further if the uploaded file is other than xls,xls,csv\n if (!mime_obj.nil? and !mime_obj.blank?) and (mime_obj.include? \"xls\" or mime_obj.include? \"xlsx\" or mime_obj.include? \"ods\" or mime_obj.include? \"csv\" ) then\n if @import.save!\n #check for virus\n if no_virus(@import.excel.path) then\n #If mime_obj is not csv only then create roo_instace\n unless mime_obj.include? \"csv\" then\n @roo = create_roo_instance(@import.excel.path,mime_obj)\n else\n #so, its a csv format\n @roo = \"csv format\"\n end\n #if the uploaded\n unless @roo == \"Upload correct excel format.\" then\n if @roo == \"csv format\" then\n lines = parse_csv_file(@import.excel.path)\n else\n lines = parse_excel_file_roo(@roo)\n end\n\n if lines.size > 0\n @import.processed = lines.size\n i = 1\n failed_to_upload = Array.new\n lines.each do |line|\n if valid_assign(params[:id])\n if valid_learners_excel_upload(line)\n else\n failed_to_upload << i\n end\n else\n flash[:learner_limit_exceeds] = \"You cannot assign more learners\"\n end\n i = i + 1\n end\n @import.save\n\n delete_csv(@import.excel.path)\n\n @import.destroy\n if params.include? 'from_assign_learners_page' then\n redirect_to(\"/courses/assign_learners/\" + assessment_id.to_s)\n else\n total_failed_to_upload = failed_to_upload.join(\",\")\n redirect_to(\"/courses/manage_learners/#{assessment_id.to_s}?failed_to_upload=#{total_failed_to_upload}\")\n end\n else\n flash[:error] = \"CSV data processing failed.\"\n end\n else\n flash[:upload_error] = 'Upload correct excel format.'\n redirect_to(\"/courses/manage_learners/#{assessment_id.to_s}\")\n end\n else\n flash[:virus_error] = \"The file is Infected with virus.\"\n redirect_to(\"/courses/manage_learners/#{assessment_id.to_s}\")\n end\n else\n flash[:error] = 'CSV data import failed.'\n end\n else\n flash[:upload_error] = 'Upload correct excel format.'\n redirect_to(\"/courses/manage_learners/#{assessment_id.to_s}\")\n end\n else\n flash[:upload_error] = 'Upload correct excel format.'\n redirect_to(\"/courses/manage_learners/#{assessment_id.to_s}\")\n end\n else\n redirect_to(\"/courses/manage_learners/#{assessment_id.to_s}\")\n end\n end",
"title": ""
},
{
"docid": "a0115e5a1aa91d8daa0b6152d451b693",
"score": "0.60436434",
"text": "def import\n #throws error if importing csv file fails\n begin\n Category.import\n notice = \"Import Complete\"\n rescue\n notice = \"There was an error whilst importing!\"\n ensure\n redirect_to start_path, notice: notice\n end\n end",
"title": ""
},
{
"docid": "05cd2c9587015f405f8759e2e99718ca",
"score": "0.60418975",
"text": "def import_learners_from_csv\n assessment_id = params[:user][:assessment_id]\n unless params[:import][:excel].nil? or params[:import][:excel].blank? then\n @import = Import.new(params[:import])\n mime = (MIME::Types.type_for(@import.excel.path)[0])\n unless mime.nil? or mime.blank? then\n mime_obj = mime.extensions[0]\n #dont process further if the uploaded file is other than xls,xls,csv\n if (!mime_obj.nil? and !mime_obj.blank?) and (mime_obj.include? \"xls\" or mime_obj.include? \"xlsx\" or mime_obj.include? \"ods\" or mime_obj.include? \"csv\" ) then\n if @import.save!\n #check for virus\n if no_virus(@import.excel.path) then\n #If mime_obj is not csv only then create roo_instace\n unless mime_obj.include? \"csv\" then\n @roo = create_roo_instance(@import.excel.path,mime_obj)\n else\n #so, its a csv format\n @roo = \"csv format\"\n end\n #if the uploaded\n unless @roo == \"Upload correct excel format.\" then\n if @roo == \"csv format\" then\n lines = parse_csv_file(@import.excel.path)\n else\n lines = parse_excel_file_roo(@roo)\n end\n \n if lines.size > 0\n @import.processed = lines.size\n i = 1\n failed_to_upload = Array.new\n lines.each do |line|\n if valid_assign(params[:id])\n if valid_learners_excel_upload(line)\n else\n failed_to_upload << i\n end\n else\n flash[:learner_limit_exceeds] = \"You cannot assign more learners\"\n end\n i = i + 1\n end\n @import.save\n\n delete_csv(@import.excel.path)\n\n @import.destroy\n if params.include? 'from_assign_learners_page' then\n redirect_to(\"/assessments/assign_learners/\" + assessment_id.to_s)\n else\n total_failed_to_upload = failed_to_upload.join(\",\")\n redirect_to(\"/assessments/manage_learners/#{assessment_id.to_s}?failed_to_upload=#{total_failed_to_upload}\")\n end\n else\n flash[:error] = \"CSV data processing failed.\"\n end\n else\n flash[:upload_error] = 'Upload correct excel format.'\n redirect_to(\"/assessments/manage_learners/#{assessment_id.to_s}\")\n end\n else\n flash[:virus_error] = \"The file is Infected with virus.\"\n redirect_to(\"/assessments/manage_learners/#{assessment_id.to_s}\")\n end\n else\n flash[:error] = 'CSV data import failed.'\n end\n else\n flash[:upload_error] = 'Upload correct excel format.'\n redirect_to(\"/assessments/manage_learners/#{assessment_id.to_s}\")\n end\n else\n flash[:upload_error] = 'Upload correct excel format.'\n redirect_to(\"/assessments/manage_learners/#{assessment_id.to_s}\")\n end\n else\n redirect_to(\"/assessments/manage_learners/#{assessment_id.to_s}\")\n end\n end",
"title": ""
},
{
"docid": "005f5a5f322e362f239db974c221b4dd",
"score": "0.6026108",
"text": "def import_from_csv(file_name)\n csv_text = File.read(file_name)\n csv = CSV.parse(csv_text, headers: true, skip_blanks: true)\n # #8 iterate over the CSV::Table rows then create a hash for each row, convert each row_hash\n #to an Entry by using the add_entry method\n csv.each do |row|\n row_hash = row.to_hash\n add_entry(row_hash[\"name\"], row_hash[\"phone_number\"], row_hash[\"email\"])\n end\n end",
"title": ""
},
{
"docid": "edf660b1cf2e4db98aed71471439e082",
"score": "0.6022054",
"text": "def import_reading_lookup_values lines, types=@lookup_attributes, validate=false, delete_all=true\n ActiveRecord::Base.transaction do |transaction|\n #returns a hash of arrays of values\n unique_values = get_unique_values types, lines\n unique_values.each_pair do |column,values|\n #assume model name same as attribute name\n table = eval(column.to_s.capitalize)\n table.delete_all if delete_all\n #make assumption name that e.g. kunyomi is column\n #Kunyomi is model, with exception of skip_pattern\n if column == :skip\n column = :skip_pattern\n end\n if values.any?\n #convert values array to 2D array for ar-extensions import\n values2d =[]\n values.each do |v|values2d<<[v];end\n puts \"importing #{table}\"\n table.import [column],values2d, :validate=>validate\n puts \"imported #{table}\"\n end\n\n end\n end\n\n generate_lookups()\n end",
"title": ""
},
{
"docid": "8dfb9e821047c74e6eb887b34e7923a7",
"score": "0.59998864",
"text": "def prepare_import_csv\n databases.each do |db|\n if db == :mysql\n import_query[db] = mysql_helper.import_csv(tablename: tablename, filename: filename, delimiter: delimiter)\n elsif db == :pg\n import_query[db] = pg_helper.import_csv(tablename: tablename, filename: filename, delimiter: delimiter)\n end\n end\n end",
"title": ""
},
{
"docid": "71e79273d26daf6f76f85d0472d68d02",
"score": "0.5995751",
"text": "def importer_class\n # hook for subclasses\n CSVImportable::CSVImporter\n end",
"title": ""
},
{
"docid": "e1fde0c7232e7814e1e995f581db6dde",
"score": "0.5954199",
"text": "def import_from_csv(file_name)\n # implementation\n csv_text = File.read(file_name)\n # the variable 'csv' is a table type object\n csv = CSV.parse(csv_text, headers: true, skip_blanks: true)\n \n # \n csv.each do |row|\n # create a hash type variable 'row_hash'\n row_hash = row.to_hash\n # use 'add_entry' to change 'row_hash' into 'Entry', also add the new Entry into AddressBook's entries\n add_entry(row_hash[\"name\"], row_hash[\"phone_number\"], row_hash[\"email\"])\n end\n end",
"title": ""
},
{
"docid": "9cc38b3c502a976a344e12ef9d5a94f8",
"score": "0.5949368",
"text": "def import\n \tbegin #This might fail if input is incorrect. So put it in the begin block\n \t\tProduct.import(params[:file]) #Refer to the import method defined in the product model\n \t\tredirect_to root_url, notice: \"Products imported successfully\" #Give a success flash message if import is successful.\n rescue #Catch the failure here by displaying the suitable error message.\n \tredirect_to root_url, notice: \"Please upload valid csv\" #Give a failure message if import is unsuccessful\n \tend\n end",
"title": ""
},
{
"docid": "317742c6e7556289eaca82f15b5869e2",
"score": "0.5937343",
"text": "def import(&block)\n # Sanity check\n if !@config[:data]\n exit_with_error(\"Importer not configured correctly.\", @config)\n end\n\n bulkSQL = BulkSQLRunner.new(config[:data].size, @config[:sql_buffer_size], @config[:sql_debug])\n @config[:data].each do |rec|\n bulkSQL.add( block.call(rec) )\n end\n end",
"title": ""
},
{
"docid": "dbc2f87aab3c6f7c7f828d9648894c96",
"score": "0.59360415",
"text": "def load\n csv = csv_data\n @data = TableFu.new(csv_data, @table_opts[:column_options] || {})\n if @table_opts[:faceting]\n @data.col_opts[:ignored] = [@table_opts[:faceting][:facet_by]]\n @facets = @data.faceted_by @table_opts[:faceting][:facet_by]\n end\n @data.delete_rows! @table_opts[:dead_rows] if @table_opts[:dead_rows]\n end",
"title": ""
},
{
"docid": "cab3a08cdf5ba747228454738478cf00",
"score": "0.59256774",
"text": "def perform(bulk_action_id, params)\n super\n csv = CSV.parse(params[:csv_file], headers: true)\n with_csv_items(csv, name: \"Import descriptive metadata\", filename: params[:csv_filename]) do |cocina_object, csv_row, success, failure|\n next failure.call(\"Not authorized\") unless ability.can?(:update, cocina_object)\n\n DescriptionImport.import(csv_row:)\n .bind { |description| validate_input(cocina_object, description) }\n .bind { |description| validate_changed(cocina_object, description) }\n .bind { |description| open_version(cocina_object, description) }\n .bind { |description, new_cocina_object| save(new_cocina_object, description) }\n .bind { |new_cocina_object| close_version(new_cocina_object) }\n .either(\n ->(_updated) { success.call(\"Successfully updated\") },\n ->(messages) { failure.call(messages.to_sentence) }\n )\n end\n end",
"title": ""
},
{
"docid": "9f55a8bf39e551ae044a452b707b3521",
"score": "0.5917775",
"text": "def delegate_import\n if Rails.env == 'development'\n # use local file path on development\n csv = open(self.import.import_file.products.path)\n else\n # use s3 file on production\n csv = open_tmp_file(self.import.import_file.products.url)\n end\n\n\n # Send file to fnz module using import api\n response = RestClient.post Fnz::HOST + '/api/v0/imports',\n app_key: Fnz::API_KEY,\n import: {\n object: 'Product',\n padma_id: self.import.account.name,\n upload: csv\n }\n if response.code == 201\n # If import was created successfully create a product importer\n #that will show the status of this import\n remote_import_id = JSON.parse(response.body)['id']\n self.update_attributes(status_url: Fnz::HOST + '/api/v0/imports/' + remote_import_id.to_s)\n end\n end",
"title": ""
},
{
"docid": "221a7b2e2fcc948af5c12192b7047b45",
"score": "0.5904784",
"text": "def import_data\n begin\n #Get products *before* import - \n @products_before_import = Product.all\n\n #Setup HTML decoder\n coder = HTMLEntities.new\n\n columns = ImportProductSettings::COLUMN_MAPPINGS\n log(\"Import - Columns setting: #{columns.inspect}\")\n \n rows = FasterCSV.read(self.data_file.path)\n log(\"Importing products for #{self.data_file_file_name} began at #{Time.now}\")\n nameless_product_count = 0\n \n rows[ImportProductSettings::INITIAL_ROWS_TO_SKIP..-1].each do |row|\n \n log(\"Import - Current row: #{row.inspect}\")\n \n if product_obj = Product.find(:first, :include => [:product_properties, :properties], :conditions => ['properties.name LIKE ? && product_properties.value LIKE ?', \"XmlImportId\", row[columns['Id']]])\n create_variant(product_obj, row, columns)\n else\n #Create the product skeleton - should be valid\n product_obj = Product.new()\n \n #Easy ones first\n if row[columns['Name']].blank?\n log(\"Product with no name: #{row[columns['Description']]}\")\n product_obj.name = \"No-name product #{nameless_product_count}\"\n nameless_product_count += 1\n else\n #Decode HTML for names and/or descriptions if necessary\n if ImportProductSettings::HTML_DECODE_NAMES\n product_obj.name = coder.decode(row[columns['Name']])\n else\n product_obj.name = row[columns['Name']]\n end\n end\n #product_obj.sku = row[columns['SKU']] || product_obj.name.gsub(' ', '_')\n product_obj.price = row[columns['Master Price']] || 0.0\n #product_obj.cost_price = row[columns['Cost Price']]\n product_obj.available_on = DateTime.now - 1.day #Yesterday to make SURE it shows up\n product_obj.weight = columns['Weight'] ? row[columns['Weight']] : 0.0\n product_obj.height = columns['Height'] ? row[columns['Height']] : 0.0\n product_obj.depth = columns['Depth'] ? row[columns['Depth']] : 0.0\n product_obj.width = columns['Width'] ? row[columns['Width']] : 0.0\n #Decode HTML for descriptions if needed\n if ImportProductSettings::HTML_DECODE_DESCRIPTIONS\n product_obj.description = coder.decode(row[columns['Description']])\n else\n product_obj.description = row[columns['Description']]\n end\n \n \n #Assign a default shipping category\n product_obj.shipping_category = ShippingCategory.find_or_create_by_name(ImportProductSettings::DEFAULT_SHIPPING_CATEGORY)\n product_obj.tax_category = TaxCategory.find_or_create_by_name(ImportProductSettings::DEFAULT_TAX_CATEGORY)\n\n unless product_obj.valid?\n log(\"A product could not be imported - here is the information we have:\\n #{ pp product_obj.attributes}\", :error)\n next\n end\n \n #Save the object before creating asssociated objects\n product_obj.save!\n \n xml_import_id_prop = Property.find_or_create_by_name_and_presentation(\"XmlImportId\", \"XmlImportId\")\n ProductProperty.create :property => xml_import_id_prop, :product => product_obj, :value => row[columns['Id']]\n \n brand_prop = Property.find_or_create_by_name_and_presentation(\"Brand\", \"Marque\")\n ProductProperty.create :property => brand_prop, :product => product_obj, :value => row[columns['Brand']]\n \n unless product_obj.master\n log(\"[ERROR] No variant set for: #{product_obj.name}\")\n end\n \n #Now we have all but images and taxons loaded\n associate_taxon('Category', row[columns['Category']], product_obj)\n associate_taxon('Gender', row[columns['Gender']], product_obj)\n \n #Save master variant, for some reason saving product with price set above\n #doesn't create the master variant\n log(\"Master Variant saved for #{product_obj.sku}\") if product_obj.master.save!\n \n create_variant(product_obj, row, columns)\n \n find_and_attach_image(row[columns['Image Main']], product_obj) if row[columns['Image Main']]\n find_and_attach_image(row[columns['Image 2']], product_obj) if row[columns['Image 2']]\n find_and_attach_image(row[columns['Image 3']], product_obj) if row[columns['Image 3']]\n\n #Return a success message\n log(\"[#{product_obj.sku}] #{product_obj.name}($#{product_obj.master.price}) successfully imported.\\n\") if product_obj.save\n end\n \n end\n \n if ImportProductSettings::DESTROY_ORIGINAL_PRODUCTS_AFTER_IMPORT\n @products_before_import.each { |p| p.destroy }\n end\n \n log(\"Importing products for #{self.data_file_file_name} completed at #{DateTime.now}\")\n \n rescue Exception => exp\n log(\"An error occurred during import, please check file and try again. (#{exp.message})\\n#{exp.backtrace.join('\\n')}\", :error)\n return [:error, \"The file data could not be imported. Please check that the spreadsheet is a CSV file, and is correctly formatted.\"]\n end\n \n #All done!\n return [:notice, \"Product data was successfully imported.\"]\n end",
"title": ""
},
{
"docid": "d89c8c190b4b01143a7734744a7526c2",
"score": "0.5889295",
"text": "def import_service_meta(type, service_id, fields_for_import, row)\n fields_for_import.map do |t|\n # Find the existing custom field to add this service meta to\n custom_field = CustomField.where(field_type: type).find{|cf| cf.key.downcase.delete(\"^a-zA-Z0-9 \").gsub(' ', '_') === t}\n\n unless custom_field.present?\n puts \"🟠 Custom field \\\"#{t}\\\" of type #{type} does not exist. Please check the field name or create the custom field in order to add this service data. Perhaps you have forgotten to run the custom field import?\"\n return\n end\n\n value = row[\"custom_#{type}_#{t}\"]\n\n case type\n when \"text\"\n value = value.nil? ? '' : value&.strip\n when \"checkbox\"\n value = !value.nil? ? value&.strip : ''\n when \"number\"\n value = CSV::Converters[:integer].call(value).is_a?(Numeric) ? CSV::Converters[:integer].call(value) : ''\n when \"select\"\n value = !value.nil? ? value.split(';').collect(&:strip).reject(&:empty?).uniq.join(',') : ''\n when \"date\"\n value = value&.strip&.to_date.present? ? value&.strip&.to_date : ''\n end\n\n if value.present?\n new_service_meta = ServiceMeta.find_or_initialize_by(service_id: service_id, key: custom_field.key) do |new_sm|\n new_sm.value = value\n end\n\n state = new_service_meta.new_record? ? 'created' : 'updated'\n\n if new_service_meta.save\n puts \" 🟢 Service meta: #{state} (id #{new_service_meta.id})\"\n else\n abort(\" 🔴 Service meta: was not created. Exiting. #{new_service_meta.errors.messages}\")\n end\n end\n end\n end",
"title": ""
},
{
"docid": "6a8f3b69f9a8c668df6be901743df644",
"score": "0.58766353",
"text": "def import_traits\n if request.post?\n if Rails.env.production?\n @file = CSV.parse(params[:file].read)\n else\n @file = FasterCSV.parse(params[:file].read)\n end\n \n @file.each do |row|\n\n next unless row.present? and row[5].present?\n next if row[0] == 'action' # for the top header row\n \n trait = Trait.find_or_initialize_by_token(row[6])\n parent_trait = Trait.find_by_token(row[8]) rescue nil\n parent_trait_id = parent_trait.id if parent_trait\n trait.attributes = {:verb => row[1],\n :noun => row[2],\n :do_name => row[3],\n :dont_name => row[4],\n :answer_type => row[5],\n :primary_pack_token => row[7],\n :parent_trait_id => parent_trait_id,\n :setup_required => row[9],\n :daily_question => row[10],\n :article => row[11],\n :past_template => row[12],\n :hashtag => row[13]}\n\n if row[0].present? and row[0] == 'delete'\n PackTrait.destroy_all(:trait_id => trait.id)\n trait.destroy\n else \n if trait.save and trait.primary_pack_token.present?\n logger.warn \"SUCCESS TRAIT: #{trait.inspect}\"\n pack = Pack.find_or_create_by_token(trait.primary_pack_token)\n unless pack.traits.include?(trait)\n pack.pack_traits.create({:trait_id => trait.id})\n end\n else\n logger.warn \"FAIL TRAIT: #{trait.inspect}\" \n end\n end\n end \n end\n redirect_to :action => :index\n end",
"title": ""
},
{
"docid": "7ecd2ba008d4ba186f6d6c4c4cfd4927",
"score": "0.5858837",
"text": "def load_from_csv(row)\n payload = {\n emails: [{ email: row['email'] }],\n firstname: row['first_name'],\n lastname: row['last_name'],\n external_ids: { controlshift: row['id'] },\n updated_at: row['updated_at']\n }\n UpsertMember.call(payload)\n end",
"title": ""
},
{
"docid": "d6c8add278939d47bbbad0d648d789be",
"score": "0.58583957",
"text": "def mass_import(rows)\n self.import([:id, :value], rows, validate: false, timestamps: false)\n end",
"title": ""
},
{
"docid": "07826af63c1a4f4bd1278366f4ae50eb",
"score": "0.58437306",
"text": "def delegate_import\n if Rails.env == 'development'\n # use local file path on development\n csv = open(self.import.import_file.time_slots.path)\n else\n # use s3 file on production\n csv = open_tmp_file(self.import.import_file.time_slots.url)\n end\n\n\n # Send file to attendance module using import api\n # The last two headers are: vacancy (it doesn't matter) and school_id (already imported)\n response = RestClient.post Attendance::HOST + '/api/v0/imports',\n app_key: Attendance::API_KEY,\n account_name: self.import.account.name,\n import: {\n object: 'TimeSlot',\n csv_file: csv,\n headers: headers\n }\n if response.code == 201\n # If import was created successfully create a time_slot importer\n #that will show the status of this import\n remote_import_id = JSON.parse(response.body)['id']\n self.update_attributes(status_url: Attendance::HOST + '/api/v0/imports/' + remote_import_id.to_s)\n end\n end",
"title": ""
},
{
"docid": "7ce8a927bf2d8be321efbf0b882a7a19",
"score": "0.58355105",
"text": "def import_from_csv(file_name)\n csv_text = File.read(file_name)\n csv = CSV.parse(csv_text, headers: true, skip_blanks: true)\n # Iterate over the CSV::Table object's rows. Then create a has for each row.\n # Convert each row_hash to an entry by using add_entry method.\n csv.each do |row|\n row_hash = row.to_hash\n add_entry(row_hash[\"name\"], row_hash[\"phone_number\"], row_hash[\"email\"])\n end\n end",
"title": ""
},
{
"docid": "15c3f7535d657c78ff6fd927e074a98f",
"score": "0.5834987",
"text": "def import()\n # TODO\n end",
"title": ""
},
{
"docid": "d568b1351a6efd785c23d5c196a8e3c7",
"score": "0.58288604",
"text": "def import_csv(csv_file)\n data, header = parse_csv(csv_file)\n validate_header(header)\n return if @rollback\n process_data(data, header)\n end",
"title": ""
},
{
"docid": "fadb67974873f595158580f2f5afde8a",
"score": "0.58258694",
"text": "def import_users\n @file = params[:upload]\n return render_error :upload unless @file && @file.try(:content_type)\n\n if @file.content_type =~ /^text\\/csv|^application\\/vnd.ms-excel/\n importer = Importing::Importer.new(@file.read)\n\n if importer.failed?\n # if failed\n Rails.logger.warn \"*** Import failed: #{importer.error.message}\\nBacktrace: #{importer.error.backtrace[0,5].join(\"\\n\")}\"\n render_error :import\n else\n # \"full_name\", \"abbreviation\", \"email\", \"status\", \"staff_number\", \"group\"\n @records = importer.results\n # puts @records.inspect\n\n @records.reject! { |c| c.blank? }\n\n count = 0\n\n require_headers = [\"full_name\", \"abbreviation\", \"email\", \"status\", \"staff_number\", \"group\"]\n\n headers = importer.headers\n\n if @records.length > 0\n headers = @records.first.keys\n end\n\n if headers.nil?\n render_error :header\n return\n end\n\n # headers.each do |e|\n # unless require_headers.index(e)\n # render_error :header\n # return\n # end\n # end\n\n result = true\n headers.each do |h|\n result = require_headers.include?(h.to_s)\n unless result\n render_error :header\n return\n end\n end\n\n @records.each do |user|\n next if user.blank?\n\n puts user.inspect\n\n created_user = User.new({\n full_name: user[:full_name],\n abbreviation: user[:abbreviation],\n email: user[:email],\n username: user[:abbreviation],\n password: \"1qazxsw2\",\n password_confirmation: \"1qazxsw2\",\n status: user[:status],\n staff_number: user[:staff_number],\n organization_id: current_user.organization_id\n })\n group_name = user[:group].downcase\n group_id = UserGroup.find_by_sql(\"Select * from user_groups where lower(name) ='#{group_name}'\")[0].id\n \n\n created_user.user_group_ids = group_id\n\n # created_user.skip_confirmation!\n count += 1 if created_user.save\n puts created_user.errors.inspect\n end\n \n flash[:notice] = \"There are #{count} users have been created.\"\n redirect_to organization_users_path(current_user.organization_id)\n end\n else\n render_error :content_type, :type => @file.content_type\n end\n end",
"title": ""
},
{
"docid": "eca84cd9132242ce178d613286b4c7a3",
"score": "0.5809458",
"text": "def import\n file = params[:file]\n if file.present?\n case File.extname(file.try(:tempfile))\n when '.csv'\n\n Rails.logger.silence do\n options = {:chunk_size => ImportCsvJob::CHUNK_SIZE}\n uploader = CsvFileUploader.new\n uploader.store!(file)\n @import_job = Delayed::Job.enqueue(ImportCsvJob.new(file.original_filename))\n end\n else\n flash.now[:error] = I18n.t('operations.import.wrong_format')\n end\n else\n flash.now[:error] = I18n.t('operations.import.wrong_format')\n end\n end",
"title": ""
},
{
"docid": "4bb1cbfaf7bc0412572eff450752628b",
"score": "0.5806192",
"text": "def csv_uploader(infile, organisationid)\n require 'csv'\n require 'timeout'\n# counter = 1\n begin \n CSV.parse(infile).drop(1).each do |row| \n# puts \"************************************\"\n# puts \"Started reading #{counter} row and inserting row in the table\"\n Customer.customer_build_from_csv(row, organisationid) \n# puts \"Ended the process of inserting #{counter} row in the table\"\n# puts \"************************************\"\n# counter += 1 \n end \n rescue\n retry\n# puts \"*****************************************\"\n# puts \"Anup got timeout error\"\n# puts \"*****************************************\" \n end\n end",
"title": ""
},
{
"docid": "1e344ca5eb46c4caa971336e861a1aeb",
"score": "0.5796037",
"text": "def import_from_csv(file)\n entries = Keybox::Convert::CSV.from_file(file)\n entries.each do |entry|\n @db << entry\n end\n hsay \"Imported #{entries.size} records from #{file}.\", :information\n end",
"title": ""
},
{
"docid": "efa29a0f38c720c523de29d65115e929",
"score": "0.57853204",
"text": "def import(filename=\"import/study_units.csv\")\n require 'csv'\n CSV.foreach(filename, headers: true) do |row|\n @row = row.to_hash\n @study_unit = StudyUnit.where(study_id: id, name: @row[\"study_unit.name\"]).first ||\n StudyUnit.create(study_id: id, name: @row[\"study_unit.name\"])\n @logical_product = LogicalProduct.where(study_unit_id: @study_unit.id, name: @row[\"logical_product.name\"]).first ||\n LogicalProduct.create(study_unit_id: @study_unit.id, name: @row[\"logical_product.name\"])\n @concept = Concept.find_or_create_by_name(@row[\"concept.name\"])\n @variable_group = VariableGroup.where(logical_product_id: @logical_product.id, concept_id: @concept.id,\n name: @row[\"variable_group.name\"]).first ||\n VariableGroup.create(logical_product_id: @logical_product.id, concept_id: @concept.id,\n name: @row[\"variable_group.name\"], label: @row[\"variable_group.label\"])\n end\n end",
"title": ""
},
{
"docid": "cd1ed6675323bdc5ccf825209ccb3db6",
"score": "0.57491803",
"text": "def import\n begin\n file = params[:file]\n if params[:user_id]\n user = User.find_by_id(params[:user_id])\n else\n user = current_user\n end\n CSV.foreach(file.path, headers: true) do |row|\n Product.create!(\n :brand => row['brand'],\n :name => row['model'],\n :description => row['description'],\n :status => false,\n :user_id => user.id,\n :size_details => row['size_details'],\n :product_return_policy => row['return_policy'],\n :usd_price => row['usd_price'].to_i,\n :cad_price => row['cad_price'].to_i,\n :factory_sku => row['sku'],\n :cad_domestic_shipping => user.cad_domestic_shipping,\n :cad_foreign_shipping => user.cad_foreign_shipping,\n :usd_domestic_shipping => user.usd_domestic_shipping,\n :usd_foreign_shipping => user.usd_foreign_shipping)\n end # end CSV.foreach\n redirect_to admin_products_url, notice: \"Products successfully imported.\"\n rescue\n redirect_to admin_products_new_import_url, alert: \"There was an error. Check your file and try again.\"\n end\n end",
"title": ""
},
{
"docid": "271ed1e19fe080154820b9875f7e44c9",
"score": "0.57407916",
"text": "def import(filename = 'yhd.csv')\n # Load CSV rows\n puts 'Attempting to load CSV...'\n data = CsvLoader.load_csv filename\n\n # Error if no data\n unless data\n puts 'ERROR: unable to load data from CSV. Terminating.'\n return\n end\n\n # Extract headers (first row)\n headers = data[0]\n\n puts 'Normalising header names...'\n norm_headers = normalise_headers headers\n\n # Define data rows as the rest of the CSV\n row_range = 1..data.size\n\n # Get data from each row (process it line at a time)\n puts 'Loading data...'\n load_data_from_rows(norm_headers, data[row_range])\n\n puts 'Creating relationships between definitions...'\n create_definition_associations\n\n puts 'Done!'\n\n @error_reporter.print\n end",
"title": ""
},
{
"docid": "7fba7bd0187217d9004984225177d2b6",
"score": "0.57364947",
"text": "def import_soepinfo1(filename=\"import/soepinfo1.csv\", group=\"v1\")\n @group = Group.find_or_create_by_name_and_study_id(group, id)\n Study.transaction do\n CSV.foreach(filename = filename, headers: true) do |row|\n @row = row.to_hash\n @study_unit = StudyUnit.find_or_create_by_name_and_study_id(@row[\"study_unit\"], id)\n @logical_product = LogicalProduct.find_or_create_by_name_and_study_unit_id(@row[\"product\"], @study_unit.id)\n @physical_data_product = PhysicalDataProduct.find_or_create_by_name_and_group_id(@row[\"product\"], @group.id)\n @concept = Concept.find_or_create_by_name(@row[\"concept\"])\n @variable_group = VariableGroup.find_or_create_by_name_and_logical_product_id_and_concept_id(@row[\"variable\"], @logical_product.id, @concept.id)\n @variable = Variable.find_or_create_by_name_and_physical_data_product_id_and_variable_group_id(@row[\"variable\"], @physical_data_product.id, @variable_group.id)\n @variable_category = VariableCategory.create(value: @row[\"category_val\"], label: @row[\"category_lab\"], variable_id: @variable.id)\n end\n end\n\n end",
"title": ""
},
{
"docid": "5b32107c7ae12749781bd02ad3328280",
"score": "0.57363325",
"text": "def assign_csv_values_to_genericfile(row, generic_file)\n field_mappings = @import.import_field_mappings.where('import_field_mappings.key != ?', 'image_filename')\n field_mappings.each do |field_mapping|\n\n key_column_number_arr = @import.import_field_mappings.where(key: field_mapping.key).first.value.reject!{|a| a.blank? } \n key_column_value_arr = []\n\n # For certain fields the values in the csv are comma delimeted and need to be parsed\n if field_mapping.key == 'subject'\n key_column_number_arr.each do |num|\n key_column_value_arr = key_column_value_arr + (row[num.to_i].try(:split, ',') || [])\n end\n elsif field_mapping.key == 'collection_identifier'\n # it's not a multivalue field so let's just get the first mapping\n key_column_number_arr.each do |num|\n generic_file.collection_identifier = row[num.to_i]\n break\n end\n\n elsif field_mapping.key == 'measurements'\n key_column_number_arr.each do |num|\n measurement_hash = measurement_format_for(row[num.to_i].try(:strip))\n unless measurement_hash.nil?\n #insert field as a measurement object\n measurement = Osul::VRA::Measurement.create(measurement: measurement_hash[:width], measurement_unit: measurement_hash[:unit], measurement_type: \"width\") \n \n generic_file.measurements << measurement\n measurement = Osul::VRA::Measurement.create(measurement: measurement_hash[:height], measurement_unit: measurement_hash[:unit], measurement_type: \"height\") \n generic_file.measurements << measurement\n end\n end\n\n elsif field_mapping.key == 'materials'\n key_column_number_arr.each do |num|\n material_hash = material_format_for(row[num.to_i].try(:strip))\n unless material_hash.nil?\n material = Osul::VRA::Material.create(material_hash)\n generic_file.materials << material\n end\n end\n\n else\n key_column_number_arr.each do |num|\n key_column_value_arr << row[num.to_i]\n end\n end\n\n # materials and measurements are associations so they are updated differently \n unless field_mapping.key == 'materials' or field_mapping.key == 'measurements' or field_mapping.key == 'collection_identifier'\n key_column_value_arr = key_column_value_arr.map.reject{|a| a.blank?}\n generic_file.send(\"#{field_mapping.key}=\".to_sym, key_column_value_arr)\n end\n end\n end",
"title": ""
},
{
"docid": "45128e6d4273ba688400bb8b6d5e04a7",
"score": "0.5705167",
"text": "def handle_import\n set_csv\n if check_csv_ok?\n success, alert = Participant.import(@csv, params[:project_id])\n unless alert.empty?\n flash[:danger] = alert\n end\n unless success.empty?\n flash[:success] = \"Imported participants: <br/>\" + success\n end\n end\n end",
"title": ""
},
{
"docid": "f6e7d29d88f08a33073b83cf13b9de99",
"score": "0.57004875",
"text": "def import!(&block)\n start_time = Time.at(Time.now.to_i.floor)\n yield\n raise LoadError.new(\"No data found\") unless where(\"updated_at >= ?\", start_time).exists?\n where(\"updated_at < ?\", start_time).imported.update_all(status: STATUS_REMOVED)\n end",
"title": ""
},
{
"docid": "d087bbb793c1c5c981ede5ea32c17d65",
"score": "0.569884",
"text": "def perform(import, group_ids)\n\n filepath = import.file.current_path\n user = import.user\n\n puts \"Prepare to import #{filepath} ...\"\n\n #faz um array de grupos validos do usuario\n groups = []\n group_ids.each do |g|\n if user.groups.exists?(g)\n groups.push Group.find(g)\n end\n end if group_ids.length > 0\n\n begin\n #le todas as linhas do csv\n lines = CSV.read filepath, headers: true, col_sep: import.separator\n\n #atualiza o numero de linhas de contatos para importar\n import.update! contacts_count: lines.count\n\n #hash de colunas dos contatos\n contacts_columns = Contact.column_names.reject{|key| key==\"id\"}\n\n lines.each_with_index do |row, row_n|\n\n #verifica se a chave da coluna do csv é uma coluna na tabela\n row = row.to_hash\n row.select! do |key,_|\n contacts_columns.include? key\n end\n\n contact = Contact.new row\n contact.user_id = import.user_id\n if contact.valid?\n #se tem grupos para por os contatos\n if groups.size > 0\n groups.each do |group|\n group.contacts << contact\n end\n else\n #para os contatos do usuario\n user.contacts << contact\n end\n else\n #escreve os erros no import_infos caso o contato não seja valido\n contact.errors.full_messages.each do |message|\n error = \"Um problema ocorreu na linha #{row_n+1}, #{message}\"\n import.import_infos.create! message: error\n puts error\n end\n end\n end\n\n puts \"Import #{filepath} completed\"\n ensure\n #atualiza a importação para terminado\n import.done!\n #envia a notificação para view do usuario usando o pusher\n Pusher[user.id.to_s].trigger('import_group_done', {:status => 'success', :message => \"A importação do arquivo #{import.file.identifier} está pronto!\"})\n\n puts \"Job completed with problems!\"\n end\n\n\n end",
"title": ""
},
{
"docid": "808c232302e89fc55d37194ecdcb6f2f",
"score": "0.5697163",
"text": "def csv_import\n @parsed_file=CSV::Reader.parse(params[:dump][:file], \";\")\n n=0\n @parsed_file.each do |row|\n c=Peca.new\n c.produto_id=row[0]\n c.codigo=row[1]\n c.descr=row[2]\n c.acab=row[3]\n c.larg=row[4]\n c.alt=row[5]\n c.prof=row[6]\n c.qtde=row[7]\n c.total=row[8]\n c.custo=row[9]\n c.fita=row[10]\n c.pino=row[11]\n c.embal=row[12]\n c.mdf=row[13]\n c.mdf2=row[14]\n c.ferr=row[15]\n c.ferr2=row[16]\n if c.save\n n=n+1\n GC.start if n%50==0\n end\n flash.now[:message]=\"Arquivo de peças importado com sucesso, #{n} registros adicionados à tabela.\"\n end\n end",
"title": ""
},
{
"docid": "04baa93cfe18ffef780b0ab8332f9a32",
"score": "0.5696919",
"text": "def set_csv_import\n @csv_import = CsvImport.find(params[:id])\n end",
"title": ""
},
{
"docid": "4d2d4db80ca553f5aae6fc7808e1f706",
"score": "0.5696027",
"text": "def create\n @csv_import = current_shop.csv_imports.build(csv_import_params)\n respond_to do |format|\n if @csv_import.save && @csv_import.process\n format.html { redirect_to return_path, notice: \"CSV was uploaded & is being imported.\" }\n format.json { render :show, status: :created, location: @csv_import }\n else\n Rails.logger.debug { \"errors: #{@csv_import.errors.full_messages.join(\", \")}\" }\n format.html { redirect_to return_path, flash: {error: @csv_import.errors.full_messages.join(\", \")} }\n format.json { render json: @csv_import.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0b087b215b7299ef40ff630a8514604f",
"score": "0.5685895",
"text": "def import\n open do |io|\n case format\n when :yml, :yaml\n import_yaml(io)\n when :json\n import_json(io)\n when :csv\n import_csv(io)\n end\n end\n\n return true\n end",
"title": ""
},
{
"docid": "8c82ec90c1773b0096fba1a0eca44796",
"score": "0.56674194",
"text": "def product_import_initial_values\n if @temp_file.blank?\n errors.add(:file_missing, \"file missing\")\n return false\n end\n\n begin\n file_content = read_import_csv(@temp_file)\n rescue Exception => e\n errors.add(:encoding_failed, \"<br />#{e.backtrace.join('<br />')}\")\n return false\n end\n\n begin\n data = CSV.parse(file_content)\n rescue Exception => e\n errors.add(:invalid_csv, \"<br />#{e.backtrace.join('<br />')}\")\n return false\n end\n\n if has_header?\n header_row = parse_header(data.first)\n errors.add(:has_header) unless valid_header?(header_row, import_kind)\n end\n end",
"title": ""
},
{
"docid": "9b7af2a3fa0bc3b449d65872a151cbdf",
"score": "0.5658321",
"text": "def import\n ExportImport::Csv::Product.new.import(params[:file])\n redirect_to refinery.ironman_admin_products_path, notice: \"Products imported.\"\n rescue => e\n redirect_to refinery.ironman_admin_products_path, alert: \"There was an error while importing products: #{e.message}.\"\n end",
"title": ""
},
{
"docid": "196840bd81de70990b3e6a7715d4ef4e",
"score": "0.56257355",
"text": "def import(file = nil)\n # A Hash containthe returning messages (one message for each row)\n # The values are Arrays containing the importing results for each row\n msg = {success: [], info: []} \n\n # If file is nil or blank (nil != blank)\n if file.nil? or file == \"\"\n msg[:success] << false \n msg[:info] << \"File name is nil or blank!\" \n return msg\n end\n\n # If the file is non-existant ...\n if file.instance_of?(String) and !(File.file?(file)) \n msg[:success] << false \n msg[:info] << \"File doesn't exist!\" \n return msg\n end\n\n # ??File submitted through html file doesn't exist!\n # http://guides.rubyonrails.org/form_helpers.html#uploading-files\n # 5.1 What Gets Uploaded\n # The object in the params hash is an instance of a subclass of IO.\n # Depending on the size of the uploaded file it may in fact be a StringIO\n # or an instance of File backed by a temporary file.\n if file.instance_of?(StringIO)\n msg[:success] << true \n msg[:info] << \"File is an instance of StringIO!\" \n elsif file.instance_of?(File) \n msg[:success] << true \n msg[:info] << \"File is an instance of File!\" \n else # ActionDispatch::Http::UploadedFile by html form \n msg[:success] << true \n msg[:info] << \"Must be the ActionDispatch::Http::UploadedFile type?\" \\\n \" #{file.class}\" \n end\n\n # Gets the file path\n file_path = file\n file_path = file.path unless file.instance_of?(String)\n #puts \"file_path = #{file_path}\"\n\n # TODO: Checks to see if the headers are correct\n # Imports row after row\n # CSV::Row is part Array & part Hash\n CSV.foreach(file_path, headers: true) do |row|\n vhash = row.to_hash # temporary VLAN record hash\n\n # Find FK lan_id\n # Note: Do not use Symbol :lan_name, Or it will not be found. Very weird!\n # Hence, use String instead of Symbol as the Hash key where necessary\n lan_id = find_lan_id(vhash[\"lan_name\"])\n \n # Go to the next row if an invalid lan_id was found \n unless lan_id > 0\n msg[:success] << false \n msg[:info] << \"Cannot find FK lan_id\" \n next\n end\n\n # Remove lan_name field from the row as it's not a field of table vlans\n vhash.delete(\"lan_name\")\n # and appends the FK lan_id\n vhash[\"lan_id\"] = lan_id\n #puts vhash\n \n # TODO: Need to feedback the result to the user in the future release\n s1 = \"lan_id: \" << lan_id.to_s # a temporary string\n tv = Vlan.new(vhash) # temporary VLAN record\n if tv.invalid? # invalid? triggers the model validation\n msg[:success] << false\n s1 << \", invalid Vlan\"\n else\n msg[:success] << true\n s1 << \", saved\"\n tv.save\n end\n\n msg[:info] << s1\n end\n return msg\n end",
"title": ""
},
{
"docid": "7cb274e6bb201be85b6c68698d38c330",
"score": "0.5624458",
"text": "def import(params)\r\n if lines = params[:contact][:import_text]\r\n lines = params[:contact][:import_text].gsub(\"\\n\", '').split(\"\\r\")\r\n if lines.count >= 2\r\n header_labels = lines[0].split(',')\r\n lines.delete_at(0) # remove the header\r\n\r\n lines.each do |line|\r\n fields = line.split(',') # get fields\r\n\r\n if fields.count >= 5 # skip blank lines and short data\r\n name = fields[0].split(' ') # split name into first name and last name\r\n first_name = name[0] # address books can be a mess, so we're just assuming first name is first.\r\n last_name = '' # Assume no last name is provided.\r\n\r\n # If the name is something like \"John Van Burk\" then the first name will be \"John\" and the last name \"Van Burk\"\r\n if name.count >= 2\r\n last_name = name[1..-1].join(' ') # concat rest of name data.\r\n end\r\n\r\n # The google contacts export will have phone numbers like this:\r\n # Home,<home phone #>,\r\n # Work,<work phone #>,\r\n # Mobile,<cell phone #>,\r\n # If there's multiple phone #'s for a category, they will appear as <phone #> ::: <phone #> (yes, literally \" ::: \" with the spaces.)\r\n # Example:\r\n # Emma,,,Emma,,,,,,,,,,,,,,,,,,,,,,,* My Contacts,,,Home,5183290085,Mobile,5188211924 ::: 8577531441,,,,\r\n\r\n work_phone = get_phone('Work', header_labels, fields)\r\n home_phone = get_phone('Home', header_labels, fields)\r\n cell_phone = get_phone('Mobile', header_labels, fields)\r\n email = fields[header_labels.index('E-mail 1 - Value')]\r\n website = fields[header_labels.index('Website 1 - Value')]\r\n\r\n contact = Contact.new({user_id: session[:user_id], first_name: first_name, last_name: last_name, home_phone: home_phone, work_phone: work_phone, cell_phone: cell_phone, email: email, website: website})\r\n contact.save()\r\n end\r\n end\r\n else\r\n flash[:notice] = 'Please provide some data besides the header to import.'\r\n end\r\n else\r\n flash[:notice] = 'Please provide some data to import.'\r\n end\r\n\r\n nil\r\n end",
"title": ""
},
{
"docid": "ad35ebc3675b20cfce502dd0c9bce502",
"score": "0.5620056",
"text": "def import_one_row_data(line)\n return if @file.nil? && @file.cell(line, 1).blank?\n company = import_company(line)\n unless company.new_record? || company.owner\n import_company_owner(company, line) \n end\n end",
"title": ""
},
{
"docid": "a191b8094b3e5430747fd3a3a900dbef",
"score": "0.5618137",
"text": "def import\n if (params[:file].nil?)\n redirect_to upload_posts_path, notice: Messages::POST_UPLOAD_FILE_VALIDATION\n elsif !File.extname(params[:file]).eql?(\".csv\")\n redirect_to upload_posts_path, notice: Messages::POST_UPLOAD_CSV_FORMAT_ERROR\n else\n error_messages = PostsHelper.check_header(Constants::POST_CSV_HEADER,params[:file])\n if error_messages.present?\n redirect_to upload_posts_path, notice: error_messages\n else\n Post.import(params[:file],current_user.id)\n redirect_to root_path, notice: Messages::POST_UPLOAD_SUCCESS\n end\n end\n end",
"title": ""
},
{
"docid": "669ee8a565b453a1442c4ebff25ba149",
"score": "0.5609714",
"text": "def import_from_csv(file_name)\n csv_text = File.read(file_name)\n csv = CSV.parse(csv_text, headers: true, skip_blanks: true)\n # Iterate over the CSV::Table object's rows, create a string for each row, and convert each row to a Client by using the create_client method.\n csv.each do |row|\n name, facebook_id, twitter_handle = row.to_s.split(\",\").map(&:chomp)\n create_client(name, facebook_id, twitter_handle)\n end\n end",
"title": ""
},
{
"docid": "bfc02d0c849da89776f0d76442e94c8b",
"score": "0.56078297",
"text": "def process_fnz_imports\n ProductImporter.create(import: @import)\n SaleImporter.create(import: @import)\n MembershipImporter.create(import: @import)\n InstallmentImporter.create(import: @import)\n end",
"title": ""
},
{
"docid": "c8dce7b32dace9a92414f533202c890d",
"score": "0.55996877",
"text": "def import\n log.debug(\"Importing from #{@location}\")\n id = File.basename(@location)\n record = storage_engine.get_by_id(id)\n raise MainControllerError, \"Cannot import a non-exist record\" if record.nil?\n record.whitelist = file_rw_manager.read(\"#{@location}/whitelist\")\n record.blacklist = file_rw_manager.read(\"#{@location}/blacklist\")\n record.qual = \"true\"\n record.auditor = @auditor\n storage_engine.update(record)\n log.info(\"Qualified record #{id} has been successfully imported\")\n end",
"title": ""
},
{
"docid": "e834f95297a2a7c0c6878281457e1951",
"score": "0.5598646",
"text": "def csv\n require 'csv'\n\n unless params[:uploaded_csv].blank?\n csv_path = params[:uploaded_csv].path\n\n # Wipe database on csv load, will need to be modified when event RSS feeds are fixed\n data_validated = false\n begin\n CSV.foreach(csv_path, :headers => true) do |row|\n csv_building = row[1]\n csv_room_number = row[3]\n csv_room_name = row[4]\n csv_department = row[7]\n csv_person_name = row[9] #can be general purpose name like 'general graduate student'\n csv_last_name, csv_first_name = csv_person_name.split(',').map(&:strip)\n\n csv_person_department = row[11] # appears to be less relevant to our needs\n csv_organization = row[12]\n csv_org_code, csv_person_organization = csv_organization.split(' ', 2) # Use this for department\n csv_phone = row[13]\n csv_email = row[14]\n\n # Destroy data only if the first row was parsed successfully\n unless data_validated\n Rails.logger.debug \"[[[[[[ Data validated, wiping db!!! ]]]]]]\"\n Person.destroy_all\n Department.destroy_all\n DirectoryObject.where(type: \"Room\").delete_all\n data_validated = true\n end\n\n # Don't bother with this row if a room number doesn't exist\n if csv_room_number != \"\"\n # Parse Rooms\n results = Room.where(room_number: csv_room_number)\n # Found new room?\n if results.empty?\n room = Room.new\n room.room_number = csv_room_number\n room.save\n else\n room = results.first\n end\n\n # Ensure custom data has not already been set\n # if room.name.blank?\n # room.name = csv_room_name\n # room.save\n # end\n # Parse Department\n # Don't bother with department/person parsing, something is wrong with this row\n unless csv_organization.include?(\"Identity Purged\")\n department = nil\n results = Department.where(title: csv_person_organization.downcase).first\n if results.blank?\n department = Department.new\n if csv_person_organization.present?\n department.title = (csv_person_organization).downcase\n department.save\n else\n logger.info \"entry was missing an organization\"\n end\n else\n department = results\n end\n\n # Parsing Person\n results = Person.where(email: csv_email)\n\n # Found new person?\n if results.empty?\n person = Person.new\n\n # Found existing person?\n else\n person = results.first\n end\n # Ensure room is associated\n if room.present?\n if not person.rooms.include?(room)\n person.rooms << room\n end\n end\n # Ensure department is associated\n # Currently assumes each person has one department, seems to be the case from the data\n if person.department.blank?\n if department.present?\n person.department = department\n end\n end\n person.email = csv_email\n person.phone = csv_phone\n person.first = csv_first_name\n person.last = csv_last_name\n person.save\n end\n end\n end\n\n notice = \"CSV was successfully parsed\"\n rescue\n error = \"CSV file contains invalid data\"\n end\n else\n error = \"Error uploading file\"\n end # unless csv_path.blank?\n\n respond_to do |format|\n format.html {\n redirect_to action: \"index\",\n error: error,\n notice: notice\n }\n end\n end",
"title": ""
},
{
"docid": "e834f95297a2a7c0c6878281457e1951",
"score": "0.5598646",
"text": "def csv\n require 'csv'\n\n unless params[:uploaded_csv].blank?\n csv_path = params[:uploaded_csv].path\n\n # Wipe database on csv load, will need to be modified when event RSS feeds are fixed\n data_validated = false\n begin\n CSV.foreach(csv_path, :headers => true) do |row|\n csv_building = row[1]\n csv_room_number = row[3]\n csv_room_name = row[4]\n csv_department = row[7]\n csv_person_name = row[9] #can be general purpose name like 'general graduate student'\n csv_last_name, csv_first_name = csv_person_name.split(',').map(&:strip)\n\n csv_person_department = row[11] # appears to be less relevant to our needs\n csv_organization = row[12]\n csv_org_code, csv_person_organization = csv_organization.split(' ', 2) # Use this for department\n csv_phone = row[13]\n csv_email = row[14]\n\n # Destroy data only if the first row was parsed successfully\n unless data_validated\n Rails.logger.debug \"[[[[[[ Data validated, wiping db!!! ]]]]]]\"\n Person.destroy_all\n Department.destroy_all\n DirectoryObject.where(type: \"Room\").delete_all\n data_validated = true\n end\n\n # Don't bother with this row if a room number doesn't exist\n if csv_room_number != \"\"\n # Parse Rooms\n results = Room.where(room_number: csv_room_number)\n # Found new room?\n if results.empty?\n room = Room.new\n room.room_number = csv_room_number\n room.save\n else\n room = results.first\n end\n\n # Ensure custom data has not already been set\n # if room.name.blank?\n # room.name = csv_room_name\n # room.save\n # end\n # Parse Department\n # Don't bother with department/person parsing, something is wrong with this row\n unless csv_organization.include?(\"Identity Purged\")\n department = nil\n results = Department.where(title: csv_person_organization.downcase).first\n if results.blank?\n department = Department.new\n if csv_person_organization.present?\n department.title = (csv_person_organization).downcase\n department.save\n else\n logger.info \"entry was missing an organization\"\n end\n else\n department = results\n end\n\n # Parsing Person\n results = Person.where(email: csv_email)\n\n # Found new person?\n if results.empty?\n person = Person.new\n\n # Found existing person?\n else\n person = results.first\n end\n # Ensure room is associated\n if room.present?\n if not person.rooms.include?(room)\n person.rooms << room\n end\n end\n # Ensure department is associated\n # Currently assumes each person has one department, seems to be the case from the data\n if person.department.blank?\n if department.present?\n person.department = department\n end\n end\n person.email = csv_email\n person.phone = csv_phone\n person.first = csv_first_name\n person.last = csv_last_name\n person.save\n end\n end\n end\n\n notice = \"CSV was successfully parsed\"\n rescue\n error = \"CSV file contains invalid data\"\n end\n else\n error = \"Error uploading file\"\n end # unless csv_path.blank?\n\n respond_to do |format|\n format.html {\n redirect_to action: \"index\",\n error: error,\n notice: notice\n }\n end\n end",
"title": ""
},
{
"docid": "4c982bae91d80d2c8cc8326f818c0112",
"score": "0.55974126",
"text": "def post_import\n end",
"title": ""
},
{
"docid": "d5e139efde66aa2d3fea11d21cd0b807",
"score": "0.5595784",
"text": "def process\n validate_file_type(@file_name, 'csv')\n convert_csv_file_to_object\n end",
"title": ""
},
{
"docid": "3c539ed0167a309abe377446ad992092",
"score": "0.5591267",
"text": "def transaction_import_process(send_transaction)\n readcsv\n check\n save\n send_to_acx if send_transaction\n end",
"title": ""
},
{
"docid": "d15d7c703e492de7a05bd2f2b88da05a",
"score": "0.55904806",
"text": "def populate_sugar(records, type)\n module_type = get_sugarcrm_module_type(type)\n case @action\n when 'initial_run'\n @logger.info(\"Creating new records for #{type} type\")\n records.each do |record|\n create_sugar_record(module_type, record, type)\n end\n when 'update'\n records.each do |record|\n record = convert_string_to_datetime(record)\n existing_record = find_sugarcrm_object(type, 'sf_id', record['sf_id'])\n existing_record = existing_record.first if existing_record.is_a?(Array)\n if existing_record\n #TODO Nil values are not handled properly by SugarCRM in update_attributes, so we must transform them into blank values\n #remove this loop and use the main one!!\n record.each do |key, val|\n record[key] = \"\" if val.nil?\n end\n @logger.info(\"Updating record for #{type} #{record['name']}\")\n existing_record.update_attributes!(record)\n else\n @logger.info(\"Creating new record for #{type} #{record['name']}\")\n create_sugar_record(module_type, record, type)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "600223e62c1a3a02e1d5edde639428a7",
"score": "0.55723244",
"text": "def import_categories\n market_place = Spree::MarketPlace.find_by_id(params[:market_place])\n case market_place.code\n when 'qoo10'\n smp = Spree::SellerMarketPlace.where(\"market_place_id=? AND api_key IS NOT NULL\", params[:market_place]).try(:first)\n @message = sync_all_category_qoo10(smp)\n when 'lazada', 'zalora'\n if !(File.extname(params[:file].original_filename) == \".csv\")\n redirect_to sync_category_admin_taxonomies_url, notice: \"Please upload a valid csv file\"\n return\n else\n @message = Spree::MarketPlaceCategoryList.import(params[:file],params[:market_place].to_i)\n end\n end\n \tredirect_to sync_category_admin_taxonomies_url, notice: @message\n end",
"title": ""
},
{
"docid": "17617de47f0e100f78362fe1a6552a08",
"score": "0.5561136",
"text": "def import!(data)\n pointer = 0\n date_format_checked = false\n time_format_checked = false\n record_count = nil\n actual_record_count = 0\n \n Measurement.transaction do\n begin\n cells = []\n cells_count, pointer = CSV.parse_row(data, pointer, cells)\n unless date_format_checked\n date_format_checked = raise_if_unsupported_date_format(cells.first)\n next\n end\n unless time_format_checked\n time_format_checked = raise_if_unsupported_time_format(cells.first)\n next\n end\n unless record_count\n record_count = extract_measurements_count(cells.first) \n next\n end\n measurement = extract_measurement(cells)\n if measurement\n measurement.save! unless measurement == :not_a_measurement\n actual_record_count += 1\n end\n end while cells_count > 0\n \n if record_count || (actual_record_count > 0)\n unless record_count == actual_record_count\n raise Importers::ConflictingRecordCountError.new(record_count,\n actual_record_count)\n end\n end\n end\n \n self\n end",
"title": ""
},
{
"docid": "16b215e4454ce6cadbd25e59d2c648f1",
"score": "0.5556962",
"text": "def import(rows)\n case rows\n when Array\n import_array(rows)\n when String\n labels, table = infer_csv_contents(rows, :headers => false)\n import(table)\n else\n raise ArgumentError, \"Don't know how to import data from #{rows.class}\"\n end\n true\n end",
"title": ""
},
{
"docid": "4cda11f9d69f1ed0d29818ab1847300b",
"score": "0.55556524",
"text": "def do_import\n if(reset)\n TaliaUtil::Util.full_reset\n puts \"Data Store has been completely reset\"\n end\n errors = []\n run_callback(:before_import)\n if(index_data)\n import_from_index(errors)\n else\n puts \"Importing from single data file.\"\n TaliaCore::ActiveSource.create_from_xml(xml_data, :progressor => progressor, :reader => importer, :base_file_uri => @true_root, :errors => errors, :duplicates => duplicates)\n end\n if(errors.size > 0)\n puts \"WARNING: #{errors.size} errors during import:\"\n errors.each { |e| print_error e }\n end\n run_callback(:after_import)\n end",
"title": ""
},
{
"docid": "8b92f6b6af43d632e7cbe98ec2cbf751",
"score": "0.555511",
"text": "def import\n @imported = false\n\n if (!params[:attachment].blank?)\n flash.now[:notice] = \"File uploaded\"\n\n import_batch = ImportBatch.create\n\n CSV.parse(params[:attachment].read).each do |row|\n entry = Entry.new(\n :date => Date.strptime(row[0], '%m/%d/%Y'),\n :raw_name => row[2],\n :amount => row[7],\n :account_id => params[:account_id],\n :import_batch_id => import_batch.id)\n entry.save\n end\n end\n end",
"title": ""
},
{
"docid": "d582687bef42f430ede853d882ddc2a8",
"score": "0.5553927",
"text": "def import!(path)\n data = self.class.read_text_file(path)\n # Only process 20 data rows now\n # TODO: Remove limit of the number of data rows later\n data = data[0...20]\n total_income = 0\n total_expense = 0\n transactions = []\n # Cache found categories\n categories = {}\n data.each do |d|\n # Find category which transaction belongs to\n category_name = d.delete(:category_name)\n category = categories[category_name] || Category.find_by_name(category_name)\n categories[category_name] = category\n\n # Not support yet creating user's category\n # TODO: Need to allow user to create own category of user\n d.merge! :category => category, :account_id => self.id\n transaction = Transaction.new(d)\n # Not support yet transfer type of transaction\n valid = transaction.valid?\n next if !valid || (valid && transaction.is_transfer?)\n transactions << transaction\n if transaction.is_income?\n total_income += transaction.amount\n else # transaction.is_expense?\n total_expense += transaction.amount\n end\n end\n self.class.transaction do\n transactions.each(&:save!)\n self.update_attributes! :income => total_income, :expense => total_expense\n end\n self\n end",
"title": ""
},
{
"docid": "5c99b33d9397c11a56afa64d7cfb89fe",
"score": "0.55538577",
"text": "def load\n CSV.foreach(@csv_file, headers: :first_row, header_converters: :symbol) do |row|\n @data << Employee.new(row)\n end\n end",
"title": ""
},
{
"docid": "186c1b2bd05b50e2e701d3c8bde8389f",
"score": "0.5549016",
"text": "def load_file_for_import(module_name)\n if @action == 'initial_run'\n filename = \"#{@csv_dir}/initial/#{module_name}_export.csv\"\n else\n today = lambda { Date.today.to_s }\n dir = \"#{@csv_dir}/update/#{today.call}\"\n filename = \"#{dir}/#{module_name}_export.csv\"\n end\n @logger.error(\"Could not create or find a csv filename for module #{module_name}\") unless defined? filename\n @logger.info(\"Loading CSV file #{filename} for import\")\n csv_file = ::CSV.read(filename, :encoding => 'utf-8')\n transform_csv_file(csv_file)\n end",
"title": ""
},
{
"docid": "74cc7c61503e71d2959be0edecf4de78",
"score": "0.5517806",
"text": "def create\n unless params[:import].present?\n flash[:error] = \"A file must be selected for upload\"\n redirect_to imports_path\n return\n end\n if params[:replace].present?\n Minute.destroy_all\n Request.destroy_all\n Item.destroy_all\n Meeting.destroy_all\n Import.destroy_all\n Minst.destroy_all # NOTE: initial values are seeded. Reading from a spreadsheet replaces these.\n end\n Rails.application.config.importing = true # Supress validation checks for Minutes during import.\n @import = Import.new(import_params)\n uploaded_io = params[:import][:filename]\n filepath = Rails.root.join(\"public\", \"uploads\", uploaded_io.original_filename)\n @import.filename = filepath\n @import.content_type = uploaded_io.content_type\n if @import.content_type == \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"\n File.open(filepath, \"wb\") do |file|\n file.write(uploaded_io.read)\n end\n book = RubyXL::Parser.parse filepath\n totals = book[\"Totals\"]\n master = book[\"Master\"]\n minutes = book[\"Minutes\"]\n\n #\n # Import from the TOTALS tab\n #\n\n # Read columns B and D, where column C is a hyphen, to populate the possible Status values\n # of minutes (stored in minst_id) and items (stored in ??).\n totals.each do |totalsrow|\n next unless totalsrow && totalsrow[2] && totalsrow[2].value == \"-\"\n next unless totalsrow[1] && !totalsrow[1].value.blank?\n next unless totalsrow[3] && !totalsrow[3].value.blank?\n\n Minst.find_or_create_by(code: totalsrow[1].value) do |m|\n m.name = totalsrow[3].value.gsub(/<[bB][rR]>/, \" \")\n end\n end\n\n #\n # Import from the MASTER tab\n #\n\n # Read the second row, containing the meeting names, and create Meeting objects for them.\n # Associate the column numbers with the Meeting objects.\n meetings = []\n meetnamerow = master[1]\n meetnamerow[(j = 6)..meetnamerow.cells.count - 1].each do |mtgcell|\n mtgname = mtgcell.value\n break if mtgname.nil? || mtgname.length <= 1 || mtgname.blank?\n\n # Date.parse will parse a date from the start of the string.\n # If of the form \"Mar 2013 interim\" the date will be 2013-03-01.\n\n meetingdate = Date.parse(mtgname)\n meeting = Meeting.find_or_create_by(date: meetingdate) do |m|\n m.date = meetingdate\n # Pick one of these words as the meeting type if present\n mtgtype = mtgname.match(/[iI]nterim|[Pp]lenary|[tT]elecon\\w*|[cC]on\\w*|[cC]all/)\n m.meetingtype = mtgtype && mtgtype[0].capitalize\n # Otherwise, go for the word after the word containing the year\n if mtgtype.nil?\n words = mtgname.split(\"\\s\")\n pos = words.index { |word| word =~ /\\d{4}/ }\n if pos\n word = words[pos + 1]\n m.meetingtype = word.capitalize if word\n end\n end\n end\n meetings[j] = {name: mtgname, mtg: meeting}\n j += 1\n end\n\n # Read each row of the MASTER tab starting at the third row. Identify rows with a valid item number\n # and create (or find) Items for each.\n i = 0\n\n master.to_a[2..].each do |itemrow| # the 2 says skip the first two rows.\n i += 1\n next unless itemrow[0] && itemrow[0].value =~ /\\d\\d\\d\\d/\n\n # NOTE: the items inside the \"do\" will not be updated on a merge import.\n item = Item.find_or_create_by!(number: itemrow[0].value) do |it|\n it.number = itemrow[0].value\n it.date = Date.parse(itemrow[1].value)\n it.standard = itemrow[2].value\n it.clause = itemrow[3].value\n end\n # These fields should be updated on a merge input.\n # They aren't part of the original Maintenance Request, and may have changed.\n item.subject = itemrow[4].value\n item.draft = itemrow[5].value\n\n # Iterate over the columns (starting at the 7th) in the row and create a Minute entry per column.\n # Record the status and the Meeting in the minutes entry.\n itemrow[(j = 6)..itemrow.cells.count - 1].each do |stscell|\n j += 1\n next if stscell.nil?\n\n sts = stscell.value\n next if sts == \"-\"\n\n break if sts == \"#\"\n\n if meetings[j - 1].nil?\n ref = RubyXL::Reference.ind2ref(stscell.row, stscell.column)\n raise SyntaxError, \"No meeting exists in Master tab corresponding to status entry #{sts} in #{ref}\"\n end\n\n min = item.minutes.find_or_initialize_by(meeting_id: meetings[j - 1][:mtg].id) do |m|\n m.minst = Minst.where(code: sts).first\n m.meeting = meetings[j - 1][:mtg]\n end\n item.minutes << min if min.new_record?\n next if min.save\n\n min.errors.full_messages.each do |e|\n puts e\n end\n raise \"Can't save minute\"\n end\n\n next if item.save\n\n item.errors.full_messages.each do |e|\n puts e\n end\n raise \"Can't save item\"\n end\n\n #\n # Import from the MINUTES tab\n #\n\n # Rows in the MINUTES tab come in sets of three, starting with the second row in the tab.\n # 1. Contains the item number and for each meeting, the date of the minutes entry.\n # 2. For each meeting, contains the text of the minutes.\n # 3. Contains nothing of use.\n rowno = 1\n while (inum = minutes[rowno][1].value) =~ /\\d\\d\\d\\d/\n item = Item.where(number: inum).first\n raise \"Missing entry on Master sheet for item #{inum} from Minutes tab\" if item.nil?\n\n datesrow = minutes[rowno]\n textrow = minutes[rowno + 1]\n j = 3\n while j < [datesrow.cells.count, textrow.cells.count].max\n mindate = datesrow[j]&.value\n # If there's no existing minute entry but the spreadsheet has one, we create one\n # This logic seems tortuous - there must be a better way to do it.\n if meetings[j + 3].nil?\n ref = RubyXL::Reference.ind2ref(rowno, j)\n raise SyntaxError, \"No meeting exists on Master tab corresponding to cell #{ref} on Minutes tab\"\n end\n\n min = item.minutes.where(meeting_id: meetings[j + 3][:mtg].id).first\n changed = false\n if min.nil? && (!mindate.blank? || !(textrow[j].nil? || textrow[j].value.blank?))\n min = item.minutes.create(meeting: meetings[j + 3][:mtg])\n changed = true\n end\n if !mindate.blank? && min.date.blank?\n min.date = mindate\n changed = true\n end\n if !(textrow[j].nil? || textrow[j].value.blank?) && min.text.blank?\n min.text = textrow[j].value\n min.date = meetings[j + 3][:mtg].date if min.date.blank? && !min.text.blank?\n changed = true\n end\n\n if changed && !min.save\n min.errors.full_messages.each do |e|\n puts e\n end\n raise \"Can't save minute\"\n end\n # If there's an existing minute entry, we don't change it even if the spreadsheet has no entry.\n j += 1\n end\n rowno += 3\n end\n\n # Annoyingly, we have to go through all the items and save them, so that the minsts gets updated.\n Item.all.each(&:save)\n @import.imported = true\n else\n @import.errors.add(:imports, \"must be an Excel spreadsheet (not #{@import.content_type})\")\n flash[:error] = @import.errors.full_messages.to_sentence\n puts \"#{filepath}: not an Excel spreadsheet (#{@import.content_type})\"\n end\n Rails.application.config.importing = false\n\n respond_to do |format|\n if @import.errors.count.zero? && @import.save\n format.html { redirect_to imports_url, notice: \"File was successfully imported\" }\n format.json { render :show, status: :created, location: @import }\n else\n format.html { render :new }\n format.json { render json: @import.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "86ab8dfbd8072511ebd967d298ffd4cf",
"score": "0.55165356",
"text": "def import(args={}, &block)\n\t\tdata = args[:data] || args['data']\n\t\twspace = args[:wspace] || args['wspace'] || workspace\n\t\tunless data.kind_of? Zip::ZipFile\n\t\t\tdi = data.index(\"\\n\")\n\t\t\traise DBImportError.new(\"Could not automatically determine file type\") if not di\n\t\tend\n\t\tftype = import_filetype_detect(data)\n\t\tyield(:filetype, @import_filedata[:type]) if block\n\t\tself.send \"import_#{ftype}\".to_sym, args, &block\n\tend",
"title": ""
},
{
"docid": "413ce28bac61578d991444dee4494b89",
"score": "0.5513451",
"text": "def call(_obj, args, ctx)\n if ctx[:current_user].blank?\n raise GraphQL::ExecutionError.new(\"Authentication required\")\n end\n\n # only admins can do mass imports\n unless ctx[:current_user].admin\n raise GraphQL::ExecutionError.new(\"You do not have permission to do bulk uploads\")\n end\n\n model_name_to_model = {\n 'cataloger' => Cataloger,\n 'collection' => Collection,\n 'composer' => Composer,\n 'country' => Country,\n 'director' => Director,\n 'production_company' => ProductionCompany,\n 'repository' => Repository,\n 'resource' => Resource,\n 'work' => Work,\n }\n\n unless model_name_to_model[args[:model]]\n raise GraphQL::ExecutionError.new(\"Model not recognized or not suitable for bulk import. Import failed\")\n end\n\n import(\n model_name_to_model[args[:model]],\n args[:file].tempfile,\n ctx[:current_user]\n )\n end",
"title": ""
},
{
"docid": "0f61a3ade6410850acf90ff079f42c5a",
"score": "0.5498528",
"text": "def import_file(args)\n import_file = File.join(absolute_import_dir, self.file)\n unless File.exists?(import_file)\n FileUtils.mkdir absolute_import_dir unless File.directory?(absolute_import_dir)\n FileUtils.mv args[:tempfile].path, import_file\n @table_class = InverseCsvImporter.new(import_file).table_class\n end\n end",
"title": ""
},
{
"docid": "46d5cc90faaada331c69126b5ce3ceb5",
"score": "0.54850453",
"text": "def import_csv\n\n step_names = [_('Import_CDR'), _('File_upload'), _('Column_assignment'), _('Column_confirmation'), _('Select_details'), _('Analysis'), _('Fix_clis'), _('Create_clis'), _('Assign_clis'), _('Import_CDR')]\n params[:step] ? @step = params[:step].to_i : @step = 0\n @step = 0 if @step > step_names.size or @step < 0\n @step_name = step_names[@step]\n\n @page_title = _('Import_CSV') + \" - \" + _('Step') + \": \" + @step.to_s + \" - \" + @step_name.to_s\n @page_icon = 'excel.png';\n\n @sep, @dec = nice_action_session_csv\n\n if @step == 0\n my_debug_time \"**********import CDR ************************\"\n my_debug_time \"step 0\"\n session[:cdr_import_csv] = nil\n session[:temp_cdr_import_csv] = nil\n session[:import_csv_cdr_import_csv_options] = nil\n session[:file_lines] = 0\n session[:cdrs_import] = nil\n end\n\n if @step == 1\n my_debug_time \"step 1\"\n session[:temp_cdr_import_csv] = nil\n session[:cdr_import_csv] = nil\n session[:cdrs_import] = nil\n if params[:file]\n @file = params[:file]\n if @file.size > 0\n if !@file.respond_to?(:original_filename) or !@file.respond_to?(:read) or !@file.respond_to?(:rewind)\n flash[:notice] = _('Please_select_file')\n redirect_to :action => :import_csv, :step => 0 and return false\n end\n if get_file_ext(@file.original_filename, \"csv\") == false\n @file.original_filename\n flash[:notice] = _('Please_select_CSV_file')\n redirect_to :action => :import_csv, :step => 0 and return false\n end\n @file.rewind\n ic = Iconv.new('UTF-8//IGNORE', 'UTF-8')\n file = ic.iconv(@file.read)\n session[:cdr_file_size] = file.size\n session[:temp_cdr_import_csv] = CsvImportDb.save_file(\"_crd_\", file)\n flash[:status] = _('File_downloaded')\n redirect_to :action => :import_csv, :step => 2 and return false\n else\n session[:temp_cdr_import_csv] = nil\n flash[:notice] = _('Please_select_file')\n redirect_to :action => :import_csv, :step => 0 and return false\n end\n else\n session[:temp_cdr_import_csv] = nil\n flash[:notice] = _('Please_upload_file')\n redirect_to :action => :import_csv, :step => 0 and return false\n end\n end\n\n\n if @step == 2\n my_debug_time \"step 2\"\n my_debug_time \"use : #{session[:temp_cdr_import_csv]}\"\n if session[:temp_cdr_import_csv]\n file = CsvImportDb.head_of_file(\"/tmp/#{session[:temp_cdr_import_csv]}.csv\", 20).join(\"\").to_s\n session[:file] = file\n a = check_csv_file_seperators(file, 2, 2, {:line => 0})\n if a\n @fl = CsvImportDb.head_of_file(\"/tmp/#{session[:temp_cdr_import_csv]}.csv\", 1).join(\"\").to_s.split(@sep)\n begin\n colums ={}\n colums[:colums] = [{:name => \"f_error\", :type => \"INT(4)\", :default => 0}, {:name => \"nice_error\", :type => \"INT(4)\", :default => 0}, {:name => \"do_not_import\", :type => \"INT(4)\", :default => 0}, {:name => \"changed\", :type => \"INT(4)\", :default => 0}, {:name => \"not_found_in_db\", :type => \"INT(4)\", :default => 0}, {:name => \"id\", :type => 'INT(11)', :inscrement => ' NOT NULL auto_increment '}]\n session[:cdr_import_csv] = CsvImportDb.load_csv_into_db(session[:temp_cdr_import_csv], @sep, @dec, @fl, nil, colums)\n session[:file_lines] = ActiveRecord::Base.connection.select_value(\"SELECT COUNT(*) FROM #{session[:temp_cdr_import_csv]}\")\n rescue Exception => e\n MorLog.log_exception(e, Time.now.to_i, params[:controller], params[:action])\n session[:import_csv_cdr_import_csv_options] = {}\n session[:import_csv_cdr_import_csv_options][:sep] = @sep\n session[:import_csv_cdr_import_csv_options][:dec] = @dec\n session[:file] = File.open(\"/tmp/#{session[:temp_cdr_import_csv]}.csv\", \"rb\").read\n CsvImportDb.clean_after_import(session[:temp_cdr_import_csv])\n session[:temp_cdr_import_csv] = nil\n redirect_to :action => \"import_csv\", :step => 2 and return false\n end\n flash[:status] = _('File_uploaded') if !flash[:notice]\n end\n else\n session[:cdr_import_csv] = nil\n flash[:notice] = _('Please_upload_file')\n redirect_to :action => :import_csv, :step => 1 and return false\n end\n\n end\n\n if @step > 2\n\n unless ActiveRecord::Base.connection.tables.include?(session[:temp_cdr_import_csv])\n flash[:notice] = _('Please_upload_file')\n redirect_to :action => :import_csv, :step => 0 and return false\n end\n\n if session[:cdr_import_csv]\n\n if @step == 3\n my_debug_time \"step 3\"\n if params[:calldate_id] and params[:billsec_id] and params[:calldate_id].to_i >= 0 and params[:billsec_id].to_i >= 0\n @options = {}\n\n @options[:imp_calldate] = return_correct_select_value(params[:calldate_id])\n @options[:imp_date] = -1 #params[:date_id].to_i\n @options[:imp_time] = -1 #params[:time_id].to_i\n @options[:imp_clid] = return_correct_select_value(params[:clid_id])\n @options[:imp_src_name] = return_correct_select_value(params[:src_name_id])\n @options[:imp_src_number] = return_correct_select_value(params[:src_number_id])\n @options[:imp_dst] = return_correct_select_value(params[:dst_id])\n @options[:imp_duration] = return_correct_select_value(params[:duration_id])\n @options[:imp_billsec] = return_correct_select_value(params[:billsec_id])\n @options[:imp_disposition] = return_correct_select_value(params[:disposition_id])\n @options[:imp_accountcode] = return_correct_select_value(params[:accountcode_id])\n @options[:imp_provider_id] = return_correct_select_value(params[:provider_id])\n @options[:sep] = @sep\n @options[:dec] = @dec\n\n @options[:file]= session[:file]\n @options[:file_lines] = ActiveRecord::Base.connection.select_value(\"SELECT COUNT(*) FROM #{session[:temp_cdr_import_csv]}\")\n session[:cdr_import_csv2] = @options\n flash[:status] = _('Columns_assigned')\n else\n flash[:notice] = _('Please_Select_Columns')\n redirect_to :action => :import_csv, :step => 2 and return false\n end\n end\n\n if session[:cdr_import_csv2] and session[:cdr_import_csv2][:imp_calldate] and session[:cdr_import_csv2][:imp_billsec]\n\n\n if @step == 4\n my_debug_time \"step 4\"\n @users = User.select(\"users.*, #{SqlExport.nice_user_sql}\").joins(\"LEFT JOIN devices ON (users.id = devices.user_id)\").where(\"hidden = 0 AND owner_id = #{correct_owner_id}\").order(\"nice_user ASC\").group('users.id').all\n @providers = current_user.load_providers(:all, :conditions => 'hidden=0')\n if !@providers or @providers.size.to_i < 1\n flash[:notice] = _('No_Providers')\n redirect_to :action => :import_csv, :step => 0 and return false\n end\n end\n\n #check how many destinations and should we create new ones?\n if @step == 5\n my_debug_time \"step 5\"\n @new_step = 6\n session[:cdr_import_csv2][:import_type] = params[:import_type].to_i\n params[:provider] = session[:cdr_import_csv2][:imp_provider_id] if session[:cdr_import_csv2][:imp_provider_id].to_i > -1\n session[:cdr_import_csv2][:import_provider] = params[:provider].to_i\n unless params[:provider]\n flash[:notice] = _('Please_select_Provider')\n redirect_to :action => :import_csv, :step => 4 and return false\n end\n if session[:cdr_import_csv2][:import_type].to_i == 0\n session[:cdr_import_csv2][:import_user] = params[:user].to_i\n session[:cdr_import_csv2][:import_device] = params[:device_id].to_i\n if User.where(:id => params[:user]).first and Device.where(:id => params[:device_id]).first\n @cdr_analize = Call.analize_cdr_import(session[:temp_cdr_import_csv], session[:cdr_import_csv2])\n @new_step = 9\n @cdr_analize[:file_lines] = session[:cdr_import_csv2][:file_lines]\n session[:cdr_analize] = @cdr_analize\n else\n flash[:notice] = _('User_and_Device_is_bad')\n redirect_to :action => :import_csv, :step => 4 and return false\n end\n else\n if session[:cdr_import_csv2][:imp_clid].to_i == -1\n flash[:notice] = _('Please_select_CLID_column')\n redirect_to :action => :import_csv, :step => 2 and return false\n end\n session[:cdr_import_csv2][:create_callerid] = params[:create_callerid].to_i\n @cdr_analize = Call.analize_cdr_import(session[:temp_cdr_import_csv], session[:cdr_import_csv2])\n @new_step = 9 if @cdr_analize[:bad_clis].to_i == 0 and @cdr_analize[:new_clis_to_create].to_i == 0\n flash[:status] = _('Analysis_completed')\n @cdr_analize[:file_lines] = session[:cdr_import_csv2][:file_lines]\n session[:cdr_analize] = @cdr_analize\n end\n end\n\n # fix bad cdrs\n if @step == 6\n my_debug_time \"step 6\"\n @cdr_analize = session[:cdr_analize]\n @cdr_analize[:file_lines] = session[:cdr_import_csv2][:file_lines]\n @options = {}\n session[:cdrs_import] ? @options = session[:cdrs_import] : @options = {}\n # search\n params[:page] ? @options[:page] = params[:page].to_i : (@options[:page] = 1 if !@options[:page])\n params[:hide_error] ? @options[:hide] = params[:hide_error].to_i : (@options[:hide] = 0 if !@options[:hide])\n\n cond = \"\"\n if @options[:hide].to_i > 0\n cond = \" AND nice_error != 2\"\n end\n\n @providers = current_user.load_providers(:all, :conditions => 'hidden=0')\n fpage, @total_pages, @options = pages_validator(@options, ActiveRecord::Base.connection.select_value(\"SELECT COUNT(*) FROM #{session[:temp_cdr_import_csv]} WHERE f_error = 1 #{cond }\").to_d, params[:page])\n @import_cdrs = ActiveRecord::Base.connection.select_all(\"SELECT * FROM #{session[:temp_cdr_import_csv]} WHERE f_error = 1 #{cond } LIMIT #{fpage}, #{session[:items_per_page]}\")\n @next_step = session[:cdr_import_csv2][:create_callerid].to_i == 0 ? 9 : 7\n end\n\n if session[:cdr_import_csv2][:create_callerid].to_i == 1 and @step == 7 or @step == 8\n # create clis\n if @step == 7\n my_debug_time \"step 7\"\n @cdr_analize = Call.analize_cdr_import(session[:temp_cdr_import_csv], session[:cdr_import_csv2])\n @cdr_analize[:file_lines] = session[:cdr_import_csv2][:file_lines]\n cclid = Callerid.create_from_csv(session[:temp_cdr_import_csv], session[:cdr_import_csv2])\n flash[:status] = _('Create_clis') + \": #{cclid.to_i}\"\n end\n\n # assigne clis\n if @step == 8\n my_debug_time \"step 8\"\n session[:cdr_import_csv2][:step] = 8\n session[:cdrs_import2] ? @options = session[:cdrs_import2] : @options = {}\n # search\n params[:page] ? @options[:page] = params[:page].to_i : (@options[:page] = 1 if !@options[:page])\n\n\n @cdr_analize = Call.analize_cdr_import(session[:temp_cdr_import_csv], session[:cdr_import_csv2])\n @cdr_analize[:file_lines] = session[:cdr_import_csv2][:file_lines]\n\n fpage, @total_pages, @options = pages_validator(@options, Callerid.count(:all, :conditions => {:device_id => -1}).to_d, params[:page])\n @clis = Callerid.find(:all, :conditions => {:device_id => -1}, :offset => fpage, :limit => session[:items_per_page])\n\n @users = User.select(\"users.*, #{SqlExport.nice_user_sql}\").joins(\"JOIN devices ON (users.id = devices.user_id)\").where(\"hidden = 0 and devices.id > 0 AND owner_id = #{correct_owner_id}\").order(\"nice_user ASC\").group('users.id')\n end\n else\n if @step == 7 or @step == 8\n dont_be_so_smart\n redirect_to :action => :import_csv, :step => 6 and return false\n end\n end\n\n # create cdrs with user and device\n if @step == 9\n my_debug_time \"step 9\"\n start_time = Time.now\n @cdr_analize = Call.analize_cdr_import(session[:temp_cdr_import_csv], session[:cdr_import_csv2])\n @cdr_analize[:file_lines] = session[:cdr_import_csv2][:file_lines]\n begin\n @total_cdrs, @errors = Call.insert_cdrs_from_csv(session[:temp_cdr_import_csv], session[:cdr_import_csv2])\n flash[:status] = _('Import_completed')\n session[:temp_cdr_import_csv] = nil\n @run_time = Time.now - start_time\n MorLog.my_debug Time.now - start_time\n rescue Exception => e\n flash[:notice] = _('Error')\n MorLog.log_exception(e, Time.now, 'CDR', 'csv_import')\n end\n end\n else\n flash[:notice] = _('Please_Select_Columns')\n redirect_to :action => :import_csv, :step => \"2\" and return false\n end\n else\n flash[:notice] = _('Zero_file')\n redirect_to :controller => \"tariffs\", :action => \"list\" and return false\n end\n end\n end",
"title": ""
},
{
"docid": "914f34fd2d30cd131dad874f8252cdb7",
"score": "0.54801583",
"text": "def load_csv\n # read each line frmo csv and append to recipes collection\n CSV.foreach(@csv_file) do |row|\n # puts \"#{row[0]} | #{row[1]}\"\n @recipes << Recipe.new(name: row[0], description: row[1], cooking_time: row[2], difficulty: row[3], tested: row[4])\n end\n end",
"title": ""
},
{
"docid": "c820e0a384232306c39b0baff8a8e377",
"score": "0.54778194",
"text": "def populate_table_with_id_value_normalized_value(database, table_name, source_type, csv_file)\n return if database.table_exists?(table_name)\n database.create_table table_name do\n # primary_key :id\n Integer :id, primary_key: true, index: {unique: true} # non-autoincrementing\n String :value\n foreign_key :normal_form_id, index: true\n end\n data = File.readlines(csv_file).drop(1).map{|line|\n id, value, normal_form = line.chomp.split(\"\\t\", 3)\n normal_form_id = DB[:normal_forms].where(value: normal_form, source_type: source_type).get(:id)\n normal_form_id ||= DB[:normal_forms].insert(value: normal_form, source_type: source_type)\n [Integer(id), value, normal_form_id]\n }\n database[table_name].import([:id, :value, :normal_form_id], data)\nend",
"title": ""
},
{
"docid": "14db1f44a3f9593ed8fd6d4b25266aab",
"score": "0.54732645",
"text": "def import_table( table )\n # This must come first, so we can exclude foreign key indexes later.\n import_foreign_keys( table )\n import_indexes( table )\n import_columns( table )\n end",
"title": ""
},
{
"docid": "da01caf0a3c42e5426e5dcad3da77a90",
"score": "0.5472889",
"text": "def load\n CSV.foreach(@csv_file, headers: :first_row, header_converters: :symbol) do |row|\n @meals << Meal.new(row)\n end\n end",
"title": ""
},
{
"docid": "126b663642dfdc2aa73a81a8561b673e",
"score": "0.5471652",
"text": "def upload_csv\n @title=\"Import Users\"\n if request.post?\n CSV.parse(params[:file].read, :encoding=>\"UTF-8\") do |row|\n row = row.collect(&:to_s).collect(&:strip).collect{|s| s.gsub(\"\\\"\", \"\")}\n # row = row[0].to_s.split(\"\\t\").collect(&:strip)\n\n\t Businessnew.create({:address=>row[3], :category=>row[10], :city=>row[4], :id=>row[0],\n :latitude=>row[9], :longitude=>row[8], :name=>row[1], :phone=>row[7],\n :postal_code=>row[6].split(\" \").join(''), :state=>row[5], :url=>row[2]}) if Businessnew.present?\n\n#force_encoding(\"UTF-8\")\n#.encode(\"ISO-8859-1\")\n#.force_encoding(\"ISO-8859-1\").encode(\"UTF-8\")\n#force_encoding(\"BINARY\")\n\n # CsvBusiness.create({\n # :address=>row[5],\n #:city=>row[6],\n #:company_name=>row[4],\n #:contact_name=>row[9],\n #:employee=>row[12],\n #:fax_number=>row[15],\n #:gender=>row[10],\n # :major_division_description=>row[0],\n # :phone_number=>row[14],\n # :province=>row[7],\n # :sales=>row[13],\n # :sic_2_code_description=>row[1],\n # :sic_4_code=>row[2],\n # :sic_4_code_description=>row[3],\n #:title=>row[11],\n #:zip_code=>row[8]\n # })\n\n=begin\n#20130615051307\n\t\tStoreTiming.create({:id=>row[0], :business_id=>row[1], :mon_from=>row[2], :mon_to=>row[3], :tue_from=>row[4], :tue_to=>row[5], :wed_from=>row[6], :wed_to=>row[7], :thur_from=>row[8], :thur_to=>row[9],\n :fri_from=>row[10], :fri_to=>row[11], :sat_from=>row[12], :sat_to=>row[13],\n :sun_from=>row[14], :sun_to=>row[15]})\n=end\n end\n\n flash[:notice] = \"Uploading completed.\"\n redirect_to root_path\n else\n render :layout => false\n end\n\n end",
"title": ""
},
{
"docid": "6abbb70fa992d18f09f399f03a1d5e40",
"score": "0.5469143",
"text": "def import\n if request.post?\n login = params[:email].to_s\n password = params[:password].to_s\n begin\n case params[:lib]\n when \"gmail.com\"\n @contacts = Contacts::Gmail.new(login, password)\n when \"yahoo.com\"\n @contacts = Contacts::Yahoo.new(login, password)\n when \"yahoo.co.in\"\n @contacts = Contacts::Yahoo.new(login, password)\n when \"hotmail.com\"\n @contacts = Contacts::Hotmail.new(login+\"@hotmail.com\", password)\n when \"aol.in\"\n @contacts = Contacts::Aol.new(login+\"@aol.in\", password)\n else\n @contacts = Contacts::Plaxol.new(login, password)\n end\n @contacts = @contacts.contacts\n\n rescue\n flash.now[:error] = I18n.t('contact.import.error')\n render :action => \"index\"\n return\n end\n for contact in @contacts\n email = params[:lib] == 'hotmail.com' ? contact[0].to_s.strip : contact[1].to_s.strip\n name = params[:lib] == 'hotmail.com' ? contact[1].to_s.strip : contact[0].to_s.strip\n if !ImportedContact.exists?(:email => email, :user_id => current_user.id)\n ImportedContact.new(:user_id => current_user.id, :name => name.to_s, :email => email).save\n end\n end\n redirect_to user_contacts_path(current_user)\n return\n end\n render :action => \"index\"\n end",
"title": ""
},
{
"docid": "3724b00499424472e57c2ac8076c8729",
"score": "0.5464351",
"text": "def import!\n # TODO: this should only create a competitor if in the correct \"mode\"\n competitor = matching_competitor\n if competitor.nil? && EventConfiguration.singleton.can_create_competitors_at_lane_assignment\n registrant = matching_registrant\n competition.create_competitor_from_registrants([registrant], nil)\n competitor = competition.find_competitor_with_bib_number(bib_number)\n end\n\n tr1 = build_result_from_imported(minutes_1, seconds_1, thousands_1, status_1)\n tr1.competitor = competitor\n tr1.is_start_time = is_start_time\n tr1.save!\n\n if minutes_2\n tr2 = build_result_from_imported(minutes_2, seconds_2, thousands_2, status_2)\n tr2.competitor = competitor\n tr2.is_start_time = is_start_time\n tr2.save!\n end\n end",
"title": ""
},
{
"docid": "0bfc1d5327f3b4955e666c0ae513a46c",
"score": "0.54627895",
"text": "def import\n end",
"title": ""
},
{
"docid": "0bfc1d5327f3b4955e666c0ae513a46c",
"score": "0.54627895",
"text": "def import\n end",
"title": ""
}
] |
47343f5c1a32a14e2ac2f785c20df3e4
|
Get backend sessions by frontend server id and user id
|
[
{
"docid": "8e37a8a1b1c219729d6b18d3f7af80ec",
"score": "0.72955555",
"text": "def get_by_uid frontend_id, uid, &block\n namespace = 'sys'\n service = 'sessionRemote'\n method = 'getBackendSessionByUid'\n args = [uid]\n rpc_invoke(server_id, namespace, service, method,\n args, &backend_session_cb.bind(nil, block))\n end",
"title": ""
}
] |
[
{
"docid": "c1a044982976930704db009c5bb73a14",
"score": "0.7490665",
"text": "def get frontend_id, sid, &block\n namespace = 'sys'\n service = 'sessionRemote'\n method = 'getBackendSessionBySid'\n args = [sid]\n rpc_invoke(frontend_id, namespace, service, method,\n args, &backend_session_cb.bind(nil, block))\n end",
"title": ""
},
{
"docid": "d27fb4885f6a42dbc24aacb4b8c9706c",
"score": "0.7475149",
"text": "def getBackendSessionByUid uid, &block\n sessions = @app.session_service.get_by_uid uid\n unless session\n block_given? and yield\n return\n end\n\n res = []\n sessions.each { |session|\n res << session.to_frontend_session.export\n }\n block_given? and yield nil, res\n end",
"title": ""
},
{
"docid": "01e3ecc6d1da35ee2856d55e44b47cbe",
"score": "0.7207099",
"text": "def getBackendSessionBySid sid, &block\n session = @app.session_service.get sid\n unless session\n block_given? and yield\n return\n end\n block_given? and yield nil, session.to_frontend_session.export\n end",
"title": ""
},
{
"docid": "11456d9c6928124da38ba6e49a6773c3",
"score": "0.6766196",
"text": "def get_sessions sessions, request\r\n id = request.query['id']\r\n getId = request.query['getId']\r\n return return_json_response({'error'=> '404','message' => @errorMessages['404'], 'description' => 'No Id!'}, 200) unless sessions.session_exists id\r\n return return_json_response(sessions.sessions, 200) unless getId\r\n return return_json_response({getId => sessions.get_session(getId)}, 200)\r\n end",
"title": ""
},
{
"docid": "b7e8834b9f8abda438fb40540c04fca9",
"score": "0.66087466",
"text": "def get_session(client: nil)\n sessions[client]\n end",
"title": ""
},
{
"docid": "ffc53de4161ce89ddb9037ab9e58c7de",
"score": "0.6396846",
"text": "def session_list\n ts = Time.now\n now = ts.to_i\n session_info = Maglev::System.current_session_ids.map do |id|\n sess_desc = Maglev::System.description_of_session id\n sess_desc[0] = sess_desc[0].instance_variable_get(:@_st_userId) # UserProfile\n sess_desc[3] = '' if sess_desc[3] == 0 # Primitive?\n sess_desc[4] = format_secs(now - sess_desc[4]) # View Age\n sess_desc[6] = ['none', 'out', 'in'][sess_desc[6] + 1] # Transaction\n sess_desc[13] = format_secs(now - sess_desc[13]) # Quiet\n sess_desc[14] = format_secs(now - sess_desc[14]) # Age\n sess_desc\n # sess_cache_slot = Maglev::System.cache_slot_for_sessionid id\n end\n session_info\n end",
"title": ""
},
{
"docid": "031fcf4d1b9de75e25a135483dc64373",
"score": "0.6348285",
"text": "def sessions\n @@session_set ||= ActiveRecord::SessionStore::Session.all.select { |s| s.data.has_key?(\"user_credentials_id\") }\n @@session_set.select { |s| s.data[\"user_credentials_id\"] == self.id }\n end",
"title": ""
},
{
"docid": "40e981005861fa7b895f4969b24a7f6a",
"score": "0.6330424",
"text": "def get_sessions\n return @sessions\n end",
"title": ""
},
{
"docid": "97f22a5e27ee6750915c9fc5a394dbb3",
"score": "0.62809724",
"text": "def find_session(env, sid); end",
"title": ""
},
{
"docid": "97f22a5e27ee6750915c9fc5a394dbb3",
"score": "0.62809724",
"text": "def find_session(env, sid); end",
"title": ""
},
{
"docid": "97f22a5e27ee6750915c9fc5a394dbb3",
"score": "0.62809724",
"text": "def find_session(env, sid); end",
"title": ""
},
{
"docid": "6e72453908def64c0ab3583c50c10eb2",
"score": "0.62699085",
"text": "def find_session(req, sid); end",
"title": ""
},
{
"docid": "6e72453908def64c0ab3583c50c10eb2",
"score": "0.62699085",
"text": "def find_session(req, sid); end",
"title": ""
},
{
"docid": "dc4f47a82661b9285c1bc6082b942a9c",
"score": "0.62531394",
"text": "def get_session(id)\n return @sessions[id.to_s]\n end",
"title": ""
},
{
"docid": "6779874bd601c796298da0e0d012c8dc",
"score": "0.6251332",
"text": "def index\n if params[:user_id]\n @user = User.find(params[:user_id])\n @sessions = @user.sessions\n else\n @sessions = Session.all\n end\n end",
"title": ""
},
{
"docid": "588e1b483de714644e6123aea7c0624c",
"score": "0.6216263",
"text": "def get_sessions\n all_sessions = Array.new\n response = @http.get(\"\") # with no args\n sessions = response[\"sessions\"]\n if !sessions[\"session\"].nil?\n num = sessions[\"session\"].size\n if num > 1\n sessions[\"session\"].each do | s |\n all_sessions << s[\"id\"]\n end\n else # special case if there is only one (there is no array)\n all_sessions << sessions[\"session\"][\"id\"]\n end\n return all_sessions\n end\n return nil\n end",
"title": ""
},
{
"docid": "c47c32c432078d191292e60a31e33400",
"score": "0.62138945",
"text": "def find_session(_req, session_id)\n unless session_id && (session = deserialize(@storage.call(GET, session_id)))\n session_id, session = generate_sid, {} # rubocop:disable Style/ParallelAssignment\n end\n\n [session_id, session]\n end",
"title": ""
},
{
"docid": "1bafca079d997e7b60dc650f9c607332",
"score": "0.6172069",
"text": "def sessions\n execute :get_all_sessions\n end",
"title": ""
},
{
"docid": "1bafca079d997e7b60dc650f9c607332",
"score": "0.6172069",
"text": "def sessions\n execute :get_all_sessions\n end",
"title": ""
},
{
"docid": "97083e08f40c07b6ca5401ddd761fb10",
"score": "0.61673075",
"text": "def parse_session\n @current_user ||= User.find_by(id: session[:user_id])\n @current_server ||= Server.find_by(id: session[:server_id])\n\n # As default: all siblings of the server are allowed. But if the user is an\n # administrator and happen to simulate another server, display the\n # servers assigned to that (administrative) user so he can switch back\n # easily.\n @other_servers ||= @current_server.try(:siblings)\n @current_user.try(:servers).try do |servers|\n @other_servers = servers.to_a unless servers.include?(@current_server)\n end\n end",
"title": ""
},
{
"docid": "6f58a5ddad0f0a1f1ca799a467bf57d1",
"score": "0.6154986",
"text": "def list_sessions\n response = send(op:\"ls-sessions\").first\n response[\"sessions\"]\n end",
"title": ""
},
{
"docid": "9e62803e33cbb743cda7e61c2b6de38a",
"score": "0.61547196",
"text": "def index\n @study_sessions = StudySession.by_user_plan_and_tenant(params[:tenant_id], current_user)\n end",
"title": ""
},
{
"docid": "dde1a1c66405b7897a992174e3d99b87",
"score": "0.6129299",
"text": "def sessions\n Thread.current[SESSIONS_KEY] ||= {}.compare_by_identity\n end",
"title": ""
},
{
"docid": "061a94077820154bd52bed0e8acb4f86",
"score": "0.611702",
"text": "def get_db_session\n return @client.get_session.session_id\n end",
"title": ""
},
{
"docid": "6fd8ea346fdd66c24d49ac1715ad7278",
"score": "0.61122787",
"text": "def getNodeSessions(node)\n sessions = Jiocloud::Utils.get(sessionurl + '/node/' + node)\n return sessions\n end",
"title": ""
},
{
"docid": "21e0680bb781cecce41561ec9def2415",
"score": "0.6090977",
"text": "def sessions\n ipc_returning(command('list-sessions'), Session)\n end",
"title": ""
},
{
"docid": "cd5a044eced1a211409b8e8839ca6f52",
"score": "0.60815614",
"text": "def _current_backend_session\n # Set by the ApplicationController\n Thread.current[:backend_session]\n end",
"title": ""
},
{
"docid": "975a038a7551f919181bc1ddcdf2c14e",
"score": "0.6047056",
"text": "def to_frontend_session\n FrontendSession.new self\n end",
"title": ""
},
{
"docid": "c549321416e32d9f8e4977dab3bd61ec",
"score": "0.6044098",
"text": "def sessions\n execute :get_all_sessions\n end",
"title": ""
},
{
"docid": "5ccdc4c687f8373b83a34e461c88c883",
"score": "0.6043626",
"text": "def user_sessions(jid)\n response = @cluster.query(:hgetall, \"sessions:#{jid.bare}\") || []\n Hash[*response].map do |resource, json|\n if session = JSON.parse(json) rescue nil\n session['jid'] = JID.new(jid.node, jid.domain, resource).to_s\n end\n session\n end.compact.reject {|session| session['node'] == @cluster.id }\n end",
"title": ""
},
{
"docid": "fb236abd1aeb842d71911477bc54e96e",
"score": "0.60431176",
"text": "def cmd_get_sessions argv\n setup argv\n response = @api.get_sessions\n msg response\n return response\n end",
"title": ""
},
{
"docid": "8f11ebef43dcc2f83bef9a3b5ca27b61",
"score": "0.6033193",
"text": "def index\n @work_sessions = policy_scope(WorkSession)\n @active_session = current_user.running_session?\n\n if @active_session\n @session = current_user.running_session_id\n end\n end",
"title": ""
},
{
"docid": "9fd49428c7623ed9caf88fddb2d25acc",
"score": "0.6010002",
"text": "def show\n @session = @client.sessions.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json {render json: @session }\n end\n end",
"title": ""
},
{
"docid": "ae70e99956f19715cd3761b9c8ba64e4",
"score": "0.59594953",
"text": "def get_session\n @sessions = new_session_list if !@sessions\n @active_session = @sessions[0] if !@active_session\n @active_session\n end",
"title": ""
},
{
"docid": "c9e2fffaa6985cd3ce5341f1e1fc3711",
"score": "0.5927627",
"text": "def show\n @session = current_client.session\n render json: @session, serializer: Sso::SessionSerializer\n end",
"title": ""
},
{
"docid": "15c8a6dd833b09df89b44b7af668b035",
"score": "0.59273297",
"text": "def sessions\n configuration.sessions.values\n end",
"title": ""
},
{
"docid": "8e0f84fb9a2eaa2665141056381cea35",
"score": "0.5923633",
"text": "def session_id\n @server_session.session_id if @server_session\n end",
"title": ""
},
{
"docid": "9302c4073976fcf105e7cc5e264e4bd3",
"score": "0.59206045",
"text": "def list_sessions()\n path = '/account/sessions'\n\n params = {\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'GET',\n path: path,\n headers: headers,\n params: params,\n response_type: Models::SessionList\n )\n end",
"title": ""
},
{
"docid": "476db6fab0dd468f5b2b421117f3a508",
"score": "0.5913362",
"text": "def find_session(req, sid)\n model = find_session_model(req, sid)\n # +Rack::Session::Abstract::Persisted#load_session+ expects this to return an Array with the first value being\n # the session ID and the second the actual session data.\n [model.session_id, model.user_data]\n end",
"title": ""
},
{
"docid": "0573c83bdcb8afd03c96a39c81625f5f",
"score": "0.59063005",
"text": "def get_session(env, sid)\n Maglev.abort_transaction\n\n session = @sessions[sid] if sid\n puts \"======== get_session ========================================\"\n puts \"== sid #{sid.inspect}\"\n puts \"== session #{session.inspect}\"\n\n unless sid and session\n session = Hash.new\n sid = generate_sid\n @sessions[sid] = session\n# Maglev.commit_transaction\n end\n return [sid, session]\n rescue Exception => e\n puts \"== Get Session: EXCEPTION: #{e}\"\n return [nil, {}]\n end",
"title": ""
},
{
"docid": "dd7bac48722dd84903d761c0d12858fd",
"score": "0.5900575",
"text": "def index\n authenticate_with_token\n @sessions = Session.all\n end",
"title": ""
},
{
"docid": "9b2bcdd62196b9c3401d068609b9da97",
"score": "0.5895662",
"text": "def index\n render json: @current_userable.sessions, code: :ok\n end",
"title": ""
},
{
"docid": "c866b3e73f9a6ae4b8cf5b79e7c9a6af",
"score": "0.5894682",
"text": "def get_all_sessions\n response = @http.get(\"getAllSessions\")\n msg response, Logger::DEBUG\n return response\n end",
"title": ""
},
{
"docid": "3a2a16e4741cc0db569a367f963f6340",
"score": "0.5888708",
"text": "def user_tab_sessions\n user_session = JSON.load(params[:sessions])\n mac_id = params[:mac_id]\n deviceid = params[:device_id]\n ids = []\n user_session.each do |session|\n session_exist = UserDeviceSession.where(:mac_id=>mac_id,:deviceid=>deviceid,:user_id=>session['user_id'],:event_time=>session['time'].to_i,:event_type=>session['type'])\n if session_exist.empty?\n user_session_create = UserDeviceSession.new(:mac_id=>mac_id,:deviceid=>deviceid,:user_id=>session['user_id'],:event_time=>session['time'].to_i,:event_type=>session['type'])\n if user_session_create.save\n ids << session['id']\n end\n else\n ids << session['id']\n end\n end\n respond_to do |format|\n format.json { render json:ids }\n end\n end",
"title": ""
},
{
"docid": "e49ff637327e5e8420d1322e3d9a8f9d",
"score": "0.5860773",
"text": "def read_api_session(user)\n user_id = get_session_user_id(user)\n api_session = session_api_session_model_class.find_by(user_id: user_id)\n raise SessionInvalidUserAuthToken, \"Api Session [user_id: #{user_id}] not found.\" if api_session.blank?\n api_session\n end",
"title": ""
},
{
"docid": "f65a4dc974ad6e9b14a1d37c265380b0",
"score": "0.58588207",
"text": "def sessions\n @sessions.values\n end",
"title": ""
},
{
"docid": "effdc7b3e018454caff45cbf1b49614c",
"score": "0.5857342",
"text": "def sessions; end",
"title": ""
},
{
"docid": "16cc9c323f7bfe8170f278ca70f15a09",
"score": "0.58467895",
"text": "def get_logged_in_users\n \t\traise \"Sessions need to be stored in ActiveRecordStore to determine logged in users\" if !/ActiveRecordStore/.match(ApplicationController.session_store.to_s)\n \t\texpiration = Bolt::Config.session_expiration_time\n last_action_key = Bolt::Config.store_last_action_time_in_session\n users_hash = {}\n \t\t@sessions = CGI::Session::ActiveRecordStore.session_class.find(:all) \n \t\t@sessions.each do |session|\n \t\t\tdata_hash = CGI::Session::ActiveRecordStore.session_class.unmarshal(session[:data])\n \t\t\tif the_user_id = data_hash[:user_id]\n \t\t\t\tthe_time_num = last_action_key ? data_hash[last_action_key] ||= 0 : (session.updated_at.to_i ||= 0)\n \t\t\t\tif !expiration || (Time.now.to_i - the_time_num < expiration)\n \t\t\t\t\tusers_hash[the_user_id] = Time.at(the_time_num).utc\n \t\t\t\tend\n \t\t\tend\n \t\tend\n \t\tusers_hash\n \tend",
"title": ""
},
{
"docid": "0951c8f16d12b50909a0fa855325c418",
"score": "0.5837206",
"text": "def index\n if current_user && current_user.name == \"guest5%4232#1*53ng#D\"\n session_user = {name: \"Guest\", email: '$oij233f09jf2n%23jj2323h$9h23', phone: '', id: current_user.id}\n elsif current_user\n session_user = {name: current_user.name, email: current_user.email, phone: current_user.phone, id: current_user.id}\n else\n session_user = {name: \"$oij233f09jf2n%23jj2323h$9h23\"}\n end\n render json: session_user\n end",
"title": ""
},
{
"docid": "bcc15157b067e20fd5ad83f1423ef6d9",
"score": "0.5837079",
"text": "def get\n session_store.find(session_id)\n end",
"title": ""
},
{
"docid": "d9769e87cd5cc8fa3e32b5975ebd4686",
"score": "0.58360463",
"text": "def session\n GhettoSessionStore[params[:session_id]] ||={}\n GhettoSessionStore[params[:session_id]] \n end",
"title": ""
},
{
"docid": "4ba854e45d8ac189e8b3f9ea1fb26b3d",
"score": "0.5827846",
"text": "def index\n\t\t@user_sessions = current_user.user_sessions\n\tend",
"title": ""
},
{
"docid": "ea35d860ce650c07f643f142d525e294",
"score": "0.58243066",
"text": "def compatible_sessions\n sessions = []\n framework.sessions.each do |sid, s|\n sessions << sid if session_compatible?(s)\n end\n sessions\n end",
"title": ""
},
{
"docid": "2bdcaddc2293a717ff6a920505badfdf",
"score": "0.581954",
"text": "def current_backend_user \n @current_backend_user ||= backend_user_from_remember_token # returns either the known identity or the one corresponding to the remember token\n end",
"title": ""
},
{
"docid": "9ab8f83b6e7fef2bf5536aaf69c3fcc4",
"score": "0.58146685",
"text": "def get_session(session_id)\n # binding.pry\n session_id ? @sessions.find(_id: session_id) : nil\n end",
"title": ""
},
{
"docid": "c5e025d8c72d5744983caa258aee0414",
"score": "0.5813032",
"text": "def get_session force = false\n @session ||= {}\n if @session.has_key?(SklikApi::Access.uniq_identifier) && !force\n @session[SklikApi::Access.uniq_identifier]\n else\n begin\n param = connection.call(\"client.login\", SklikApi::Access.email, SklikApi::Access.password).symbolize_keys\n if param[:status] == 401\n raise ArgumentError, \"Invalid login for: #{SklikApi::Access.email}\"\n elsif param[:status] == 200\n return @session[SklikApi::Access.uniq_identifier] = param[:session]\n else\n raise ArgumentError, param[:statusMessage]\n end\n rescue XMLRPC::FaultException => e\n raise ArgumentError, \"#{e.faultString}, #{e.faultCode}\"\n rescue Exception => e\n raise e\n end\n end\n end",
"title": ""
},
{
"docid": "b1eaf106bcdcdb555ab062c201db185d",
"score": "0.58066905",
"text": "def sessions\n s = @instance.client.listSessionsOfGroup(@id) || {}\n s.map { |id,info| Session.new(@instance, id, info) }\n end",
"title": ""
},
{
"docid": "0a43a36ef2cdcc1c45533b7f3b8670df",
"score": "0.57926434",
"text": "def get sid\n @sessions[sid]\n end",
"title": ""
},
{
"docid": "f367d843a466d920d297b6e9399284b9",
"score": "0.57898736",
"text": "def backend_user_from_remember_token\n user = Backend::User.authenticate_with_salt(*remember_token)\n request_authorization[:grant_type] = :session\n request_authorization[:privileged] = true\n return user\n# user, ip = remember_token\n# if !user.blank? && request.remote_ip == ip\n# return user\n# else\n# return nil\n# end\n end",
"title": ""
},
{
"docid": "e692de8d707bb2292e4420d99da82f41",
"score": "0.5788986",
"text": "def sessions\n @sessions\n end",
"title": ""
},
{
"docid": "e692de8d707bb2292e4420d99da82f41",
"score": "0.5788986",
"text": "def sessions\n @sessions\n end",
"title": ""
},
{
"docid": "c4e5bca519f77c41660c922ec62c68fc",
"score": "0.5785822",
"text": "def getSession(args = {})\n if args.key?(:id) && ! args[:id].nil?\n session = Jiocloud::Utils.get(sessionurl + '/info/' + args[:id])\n elsif args.key?(:name) && ! args[:name].nil?\n if args.key?(:node) && ! args[:node].nil?\n sessions = Jiocloud::Utils.get(sessionurl + '/node/' + args[:node])\n else\n sessions = Jiocloud::Utils.get(sessionurl + '/list')\n end\n session = sessions.select {|session| session['Name'] == args[:name]}\n end\n\n if session.empty?\n return {}\n elsif session.count > 1\n raise(\"Multiple matching (#{session.count}) Consul Sessions found for #{args[:name]}\")\n else\n return session[0]\n end\n end",
"title": ""
},
{
"docid": "35d8bcad9c1f58d1827215ac2233042d",
"score": "0.57804507",
"text": "def getclient req, resp\n uuid = req.cookies[TOKEN_COOKIE]\n access_token = nil\n\n if uuid\n ds = DBConn.get['SELECT token FROM sessions WHERE uuid = ?', uuid]\n row = ds.first\n access_token = row[:token] if row\n end\n\n client = newclient\n \n if access_token\n client.accessToken = access_token\n return client\n end\n\n resp.puts 'Not logged in.'\n resp.redirect '/login'\n nil\nend",
"title": ""
},
{
"docid": "2148185d3031ca620c16a7615baf838a",
"score": "0.5780195",
"text": "def session_user\n User.find(decode_token[\"user_id\"])\n end",
"title": ""
},
{
"docid": "a8bf5f64512364bb558297f6c9fb16a7",
"score": "0.5773562",
"text": "def show\n @backend_user = Backend::User.find_by_id_or_login(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @backend_user }\n end\n end",
"title": ""
},
{
"docid": "064b570fe0ac1274fc1b84b66b783e48",
"score": "0.5770523",
"text": "def index\n @session = current_user.sessions.order('provider asc')\n end",
"title": ""
},
{
"docid": "f7ec580f15d2bc2139ad00af942d934e",
"score": "0.57367796",
"text": "def sign_in_to_backend(backend_user)\n cookies.permanent.signed[GAME_SERVER_CONFIG['cookie_name']] = [backend_user.id, backend_user.salt]\n self.current_backend_user = backend_user\n end",
"title": ""
},
{
"docid": "604ebaba124618b1a573aad77037bf50",
"score": "0.5731455",
"text": "def get_sessions\n Dir['*'].grep(/^session\\d+$/).map { |folder_name| folder_name[/\\d+$/] }\nend",
"title": ""
},
{
"docid": "b297bcd2e75876e7a996b82fc49f57bf",
"score": "0.5730959",
"text": "def poller_sessions\n\t\targs = {}\n\t\t\t\n\t\t\n\t\targs = params.slice(:poller_sessions_from,:poller_sessions_upto,:entity_unique_name,:indice,:poller_session_id)\n\n\t\tpoller_session_rows = Logs::PollerSession.view(args)\n\t\t\n\t\tpoller_session_rows.map{|c|\n\t\t\tc[:query_params] = args\n\t\t}\n\n\t\trespond_to do |format|\n\t\t\tformat.json do \n\t\t\t\trender :json => {poller_session_rows: poller_session_rows, status: 200}\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "eb911712404bf10db4e5f6d6f1213538",
"score": "0.5723073",
"text": "def dynamic_sessions_in_url\n super\n end",
"title": ""
},
{
"docid": "65a9ba300dff1aa635be7cfc3efebe57",
"score": "0.5719445",
"text": "def remote_user\n backend.remote_user\n end",
"title": ""
},
{
"docid": "bce3989717d49103de4c38bd7ad59846",
"score": "0.5713955",
"text": "def get_session(env, sid)\n raise '#get_session not implemented.'\n end",
"title": ""
},
{
"docid": "4efc351555cd7270ed842522a358686d",
"score": "0.5711756",
"text": "def get_session( session_key )\r\n @sessions[session_key]\r\n end",
"title": ""
},
{
"docid": "ad1a17fe24457923e0b3cc519956a01e",
"score": "0.5706072",
"text": "def get_session(opts)\n return if not active\n ::ApplicationRecord.connection_pool.with_connection {\n wspace = Msf::Util::DBManager.process_opts_workspace(opts, framework)\n addr = opts[:addr] || opts[:address] || opts[:host] || return\n host = get_host(:workspace => wspace, :host => addr)\n time = opts[:opened_at] || opts[:created_at] || opts[:time] || return\n ::Mdm::Session.find_by_host_id_and_opened_at(host.id, time)\n }\n end",
"title": ""
},
{
"docid": "8dc565d95a9f94bfa5933ca029722b1f",
"score": "0.5704215",
"text": "def user_session\n session[:user_session]\n end",
"title": ""
},
{
"docid": "8dc565d95a9f94bfa5933ca029722b1f",
"score": "0.5704215",
"text": "def user_session\n session[:user_session]\n end",
"title": ""
},
{
"docid": "703196c0645079d6a0d2f97e8ff68fed",
"score": "0.57041085",
"text": "def current_user_session\n if AdminUserSession.find\n return @current_user_session if defined?(@current_user_session)\n @current_user_session = AdminUserSession.find\n elsif AssetUserSession.find\n return @current_user_session if defined?(@current_user_session)\n @current_user_session = AssetUserSession.find\n end\n end",
"title": ""
},
{
"docid": "71f2eb843e7aefcf9a11901c5aa185c1",
"score": "0.5703978",
"text": "def sessions\n s = @instance.client.listSessionsOfGroup(groupID: @id) || {}\n s.map { |id,info| Session.new(@instance, id, info) }\n end",
"title": ""
},
{
"docid": "71c1eee7a11cf14bbb3a05f5def398ee",
"score": "0.5703157",
"text": "def sessions\n @sessions\n end",
"title": ""
},
{
"docid": "a5d7525d5f00e58ebbe5650fdd4d9d10",
"score": "0.56990993",
"text": "def get\n verify @client.get('session'),\n forbidden: 'You do not have permission to view the session data'\n end",
"title": ""
},
{
"docid": "3441fdc88ae0880e6f9631b549106442",
"score": "0.56945986",
"text": "def session_id_context(*) end",
"title": ""
},
{
"docid": "c9f0921bb8af6aba1fa6fc10f3d504c3",
"score": "0.56924355",
"text": "def get_session(session_id:)\n path = '/account/sessions/{sessionId}'\n .gsub('{sessionId}', session_id)\n\n if session_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"sessionId\"')\n end\n\n params = {\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'GET',\n path: path,\n headers: headers,\n params: params,\n response_type: Models::Session\n )\n end",
"title": ""
},
{
"docid": "65bb2992b984d9206b53e15cd47d35ea",
"score": "0.5687086",
"text": "def get_session\n channels_hash = retrieve_external_data\n return channels_hash[\"streamID\"]\n end",
"title": ""
},
{
"docid": "06602ab1de81d41c5cc8d6caf4b27d6f",
"score": "0.5682251",
"text": "def index\n @app_sessions = AppSession.all\n end",
"title": ""
},
{
"docid": "dffa5d3cb060606370953ff7e3484658",
"score": "0.5679775",
"text": "def instance_sessions\n @@sessions.select do |resource, session|\n resource.start_with? resource\n end\n end",
"title": ""
},
{
"docid": "0acb0442f86c6e1651a9fd14bdf919fa",
"score": "0.5679336",
"text": "def active_session\n return self.login_sessions.where(end: nil);\n end",
"title": ""
},
{
"docid": "59bf6a6f351c2bec442f0cbb4524d0a3",
"score": "0.5673307",
"text": "def get_active_sessions\n broadcast('@type' => 'getActiveSessions')\n end",
"title": ""
},
{
"docid": "cb4d236a10c73d4e3494ac62718447c0",
"score": "0.56721",
"text": "def getSession(url,name,node,lockdelay,checks)\n connect(url)\n path=@uri.request_uri + '/list'\n Puppet.debug(\"PATH: #{path}\")\n req = Net::HTTP::Get.new(path)\n res = @http.request(req)\n\n if res.code == '200'\n sessions = JSON.parse(res.body)\n elsif res.code == '404'\n sessions = ''\n else\n raise(Puppet::Error,\"Uri: #{@uri.to_s}/#{key} returned invalid return code #{res.code}\")\n end\n\n match_sessions = sessions.select{ |s| s[\"Name\"] == resource[:name] }\n if resource[:node]\n match_sessions = match_sessions.select{ |s| s[\"Node\"] == resource[:node] }\n end\n if resource[:lockdelay]\n match_sessions = match_sessions.select{ |s| Integer(s[\"LockDelay\"]) / 1000000000 == resource[:lockdelay] }\n end\n if resource[:checks]\n match_sessions = match_sessions.select{ |s| s[\"Checks\"] == resource[:checks] }\n end\n if match_sessions.count > 1\n raise(Puppet::Error,\"Multiple matching (#{match_sessions.count}) Consul Sessions found for #{resource[:name]}, unable to determine ID\")\n elsif match_sessions.count < 1\n return nil\n else\n return match_sessions[0]\n end\n end",
"title": ""
},
{
"docid": "e491131111da39690c1b084913adf3c3",
"score": "0.5671527",
"text": "def get_session(env, sid)\n sid ||= generate_sid\n #puts \"get_session(#{sid})\"\n session = find_or_create_session(sid)\n env[SESSION_RECORD_KEY] = session\n #puts \"session[:id] = #{session.id}\"\n [sid, session.data.merge(:id => session.id)] # add :id as workaround for Rails 2.3.2 missing session.id\n end",
"title": ""
},
{
"docid": "1825191908969ad89159377f2334a27c",
"score": "0.56647736",
"text": "def send_sessions; end",
"title": ""
},
{
"docid": "7cc3df5b78fea1ad5d549b20390d824d",
"score": "0.56645864",
"text": "def session; @app.session end",
"title": ""
},
{
"docid": "3eac28f7ee24e6ceb1697883c1b7d27c",
"score": "0.5660174",
"text": "def admin_session\n { \"rack.session\" => { username: \"admin\" } }\n end",
"title": ""
},
{
"docid": "75152ce0652191bec8fa01b80f8e83ed",
"score": "0.5656504",
"text": "def getSession()\n session[:id] ||= SecureRandom.base64\n end",
"title": ""
},
{
"docid": "ee7ece5437b58b70ccef7d06a6f39c53",
"score": "0.5653574",
"text": "def get_session force = false\n Thread.current[:sklik_api][:sessions] ||= {}\n #try to get session from cache\n if Thread.current[:sklik_api][:sessions].has_key?(SklikApi::Access.uniq_identifier) && !force\n Thread.current[:sklik_api][:sessions][SklikApi::Access.uniq_identifier]\n\n #try to use session from Access settings\n elsif SklikApi::Access.session? && !force\n return Thread.current[:sklik_api][:sessions][SklikApi::Access.uniq_identifier] = SklikApi::Access.session\n\n #else retrive new session\n else\n begin\n SklikApi.log(:debug, \"Getting session for #{SklikApi::Access.email}\")\n param = connection.call(\"client.login\", SklikApi::Access.email, SklikApi::Access.password).symbolize_keys\n SklikApi.log(:debug, \"Session received: #{param.inspect}\")\n\n #good session\n if param[:status] == 200\n #SET NEW SESSION\n SklikApi::Access.session = param[:session]\n return Thread.current[:sklik_api][:sessions][SklikApi::Access.uniq_identifier] = param[:session]\n\n #bad login\n elsif param[:status] == 401\n raise ArgumentError, \"Invalid login for: #{SklikApi::Access.email}\"\n\n #Something else went wrong\n else\n raise ArgumentError, param[:statusMessage]\n end\n\n rescue XMLRPC::FaultException => e\n raise ArgumentError, \"#{e.faultString}, #{e.faultCode}\"\n rescue Exception => e\n #when closed IO -> retry\n if e.class.name =~ /IOError/\n reopen_connection!\n retry\n end\n\n raise e\n end\n end\n end",
"title": ""
},
{
"docid": "c7609cf7f1f76788007920cca5eac8fb",
"score": "0.5651776",
"text": "def user_session(jid)\n response = @cluster.query(:hget, \"sessions:#{jid.bare}\", jid.resource)\n return unless response\n session = JSON.parse(response) rescue nil\n return if session.nil? || session['node'] == @cluster.id\n session['jid'] = jid.to_s\n session\n end",
"title": ""
},
{
"docid": "fcb818b22b654570e74d83a7b78ee6c8",
"score": "0.5648663",
"text": "def compatible_sessions\n\t\tsessions = []\n\t\tframework.sessions.each do |sid, s|\n\t\t\tsessions << sid if session_compatible?(s)\n\t\tend\n\t\tsessions\n\tend",
"title": ""
},
{
"docid": "9080b3b34d2e43c401787ab829c62f98",
"score": "0.5642544",
"text": "def sessions\n self.ListSessions.first.map { |s| map_session(s) }\n end",
"title": ""
},
{
"docid": "67aa4a6021189d0a07b2b971275638f7",
"score": "0.5639805",
"text": "def index\n @sessions = @client.sessions.find(:all, :order => 'dateservice desc')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sessions }\n end\n end",
"title": ""
},
{
"docid": "e87c07f078aae45b0530f8ca41fefb81",
"score": "0.5638646",
"text": "def session_ids\n s = @instance.client.listSessionsOfGroup(@id) || {}\n s.keys\n end",
"title": ""
},
{
"docid": "b6c3eb629009072b4e28f74f30faa832",
"score": "0.56376076",
"text": "def session(cgi, session_mgr, check_ip_address)\n session = Session.with_id(cgi, session_mgr, @session_id, self, check_ip_address)\n @session_id = session.session_id\n session\n end",
"title": ""
}
] |
d1f1bcf42dc7f38228047a2b16cac805
|
effectively sets the progname
|
[
{
"docid": "f7f4710a234f8cf7055929db1a9b4514",
"score": "0.0",
"text": "def logger_for(classname)\n @loggers[classname] ||= configure_logger_for(classname)\n end",
"title": ""
}
] |
[
{
"docid": "e13c16644c55eaea3a52799ff1a16763",
"score": "0.84294873",
"text": "def progname=(name)\n @log.progname = name\n end",
"title": ""
},
{
"docid": "f3d0175f9240ee5e401391a97e3d8610",
"score": "0.8063702",
"text": "def setProgramName(name)\n end",
"title": ""
},
{
"docid": "adb31957a6d64eed008b0eaf24c5de52",
"score": "0.78132737",
"text": "def progname= name\n @log_name = name\n end",
"title": ""
},
{
"docid": "c52db8a8fc2524e35ec08564ee377f30",
"score": "0.77035683",
"text": "def set_program_name(name)\n\n\t\t@program_name = name\n\tend",
"title": ""
},
{
"docid": "2ec6211fa5bdfc8ee9caaa697e1e292e",
"score": "0.7483654",
"text": "def program_name(name = nil)\n @program_name = name || @program_name\n end",
"title": ""
},
{
"docid": "3490e46dfc6ac0500f75f07313918543",
"score": "0.7475781",
"text": "def program_name= name\n @program_name = name\n end",
"title": ""
},
{
"docid": "e394dc7f8bf805ab787ca85f0e4c1dd1",
"score": "0.7465923",
"text": "def app_name=(name)\n super\n logger.progname = name\n end",
"title": ""
},
{
"docid": "b0a29a2d81b5dfba8cccfe1eeb0cf84d",
"score": "0.72411895",
"text": "def progname( enable = true )\n configuration[:progname] = enable\n self\n end",
"title": ""
},
{
"docid": "59dffd6086e039e5aace002c005e24f7",
"score": "0.70824975",
"text": "def progname\n @@progname\n end",
"title": ""
},
{
"docid": "3aea510a1760875e15ce5fa851c474f9",
"score": "0.7069005",
"text": "def program_name(name=nil)\n if name\n @@program_name = name\n end\n @@program_name\n end",
"title": ""
},
{
"docid": "3f511053aec70ae45e266b2e1a751813",
"score": "0.69688797",
"text": "def program(name)\n @program_name = name\n end",
"title": ""
},
{
"docid": "4fb6a7e951fe92f42c1331e0885e7f98",
"score": "0.68919784",
"text": "def name= value\n\t\t\t\t\tif @name = value\n\t\t\t\t\t\t::Process.setproctitle(@name)\n\t\t\t\t\tend\n\t\t\t\tend",
"title": ""
},
{
"docid": "919ecbe06ba541a69d8c9c094308853e",
"score": "0.67133653",
"text": "def app_name=(new_name)\n old_name = @app_name\n\n @app_name = new_name\n\n if @process_registration_done\n err_str = \"You changed the application name from #{old_name} to \" +\n \"#{new_name} after the process was registered!\"\n STDERR.puts err_str\n Hastur.log err_str\n end\n end",
"title": ""
},
{
"docid": "919ecbe06ba541a69d8c9c094308853e",
"score": "0.67133653",
"text": "def app_name=(new_name)\n old_name = @app_name\n\n @app_name = new_name\n\n if @process_registration_done\n err_str = \"You changed the application name from #{old_name} to \" +\n \"#{new_name} after the process was registered!\"\n STDERR.puts err_str\n Hastur.log err_str\n end\n end",
"title": ""
},
{
"docid": "a6b16187605acba3defb0c7b4307176e",
"score": "0.66718745",
"text": "def set_progname(value, &block)\n if block\n push_thread_local_value(:lumberjack_logger_progname, value, &block)\n else\n self.progname = value\n end\n end",
"title": ""
},
{
"docid": "a6b16187605acba3defb0c7b4307176e",
"score": "0.66718745",
"text": "def set_progname(value, &block)\n if block\n push_thread_local_value(:lumberjack_logger_progname, value, &block)\n else\n self.progname = value\n end\n end",
"title": ""
},
{
"docid": "937eb4edb3630d669a0ee8325bbf4f16",
"score": "0.6670471",
"text": "def progname\n @progname ||= 'msmfg_spec_helper'\n end",
"title": ""
},
{
"docid": "7595016220326442464ecf284feb4327",
"score": "0.65977055",
"text": "def configure_process_name(app_file)\n debug_say('Configuring process name')\n $0 = \"rpc_server --#{mode} #{options.host}:#{options.port} #{app_file}\"\n end",
"title": ""
},
{
"docid": "a83bc07db01e1c4c240f3367a272e501",
"score": "0.65947485",
"text": "def program_name\n $PROGRAM_NAME\n end",
"title": ""
},
{
"docid": "64c8c343b74300b6b63938d9ee8b8d74",
"score": "0.6592316",
"text": "def progname\n @log.progname\n end",
"title": ""
},
{
"docid": "9c83e952ae2f3e47166743c7361017c5",
"score": "0.64783996",
"text": "def set_program_name(program_name, &b)\n @program_name = program_name\n @program_name_block = block_given? ? b : Proc.new{\"\"}\n end",
"title": ""
},
{
"docid": "97627e187d5d3297a3ec3d067cc30dbd",
"score": "0.6456284",
"text": "def program_name\n @program_name || File.basename($0)\n end",
"title": ""
},
{
"docid": "6355cc610bff5964983ce0767d8da343",
"score": "0.6410676",
"text": "def test_setting_progname\n assert_equal('sawmill', @logger.progname)\n @logger.info('Hello 1')\n entry_ = @entries.dequeue\n assert_equal('sawmill', entry_.progname)\n assert_equal('Hello 1', entry_.message)\n @logger.progname = 'rails'\n assert_equal('rails', @logger.progname)\n @logger.info('Hello 2')\n entry_ = @entries.dequeue\n assert_equal('rails', entry_.progname)\n assert_equal('Hello 2', entry_.message)\n end",
"title": ""
},
{
"docid": "2f4fc7904e9924bdc43ca3da0e6a1257",
"score": "0.6397699",
"text": "def set_app_name(app_name = nil)\n raise if app_name.nil?\n \n puts \"Setting app name to #{app_name}\"\n sh(\"/usr/libexec/PlistBuddy -c 'Set CFBundleName #{app_name}' ../testApp/Info.plist\")\nend",
"title": ""
},
{
"docid": "e9311872a5f73bc13453791dd5fba0d5",
"score": "0.6387733",
"text": "def progname\n thread_local_value(:lumberjack_logger_progname) || @progname\n end",
"title": ""
},
{
"docid": "e9311872a5f73bc13453791dd5fba0d5",
"score": "0.6387733",
"text": "def progname\n thread_local_value(:lumberjack_logger_progname) || @progname\n end",
"title": ""
},
{
"docid": "cd7cd0871d31753b29a65d10e28e906d",
"score": "0.63505673",
"text": "def progname\n File.basename($0)\n end",
"title": ""
},
{
"docid": "e814afd13793971c7f1935fbd577ab44",
"score": "0.62604564",
"text": "def appname(new_name = None)\n Tk.execute(:tk, :appname, new_name)\n end",
"title": ""
},
{
"docid": "1a2366a522dcddcb94c1832a735c87cc",
"score": "0.6153099",
"text": "def set_project_name(name)\n @project_name = \"-p #{name}\"\n name\n end",
"title": ""
},
{
"docid": "43a52a1e69ecc8e0feed2639e9f76948",
"score": "0.61021215",
"text": "def application_name=(app)\n raise Error, _('No current task scheduler. ITaskScheduler is NULL.') if @pits.nil?\n raise Error, _('No currently active task. ITask is NULL.') if @pitask.nil?\n raise TypeError unless app.is_a?(String)\n\n # the application name is written to a .job file on disk, so is subject to path limitations\n raise Error, _('Application name has exceeded maximum allowed length %{max}') % { max: MAX_PATH } if app.length > MAX_PATH\n\n @pitask.SetApplicationName(wide_string(app))\n\n app\n end",
"title": ""
},
{
"docid": "74f45f8c05bfe2b60841b83a2224f406",
"score": "0.6088172",
"text": "def app_name=(v)\n @app_name = v unless @app_name\n end",
"title": ""
},
{
"docid": "ee1c44d4e28f3805b2053babaded4c11",
"score": "0.6029561",
"text": "def title= title\n\t\t\t@title = title\n\t\t\t\n\t\t\tif Process.respond_to? :setproctitle\n\t\t\t\tProcess.setproctitle(@title)\n\t\t\telse\n\t\t\t\t$0 = @title\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "8268e5e5592413b075b9ad0038fb1e5d",
"score": "0.6009829",
"text": "def application_name=(app)\n raise Error, 'null pointer' if @pITS.nil?\n raise Error, 'No currently active task' if @pITask.nil?\n raise TypeError unless app.is_a?(String)\n\n app_w = multi_to_wide(app)\n\n lpVtbl = 0.chr * 4\n table = 0.chr * 132\n memcpy(lpVtbl,@pITask,4)\n memcpy(table,lpVtbl.unpack('L').first,132)\n table = table.unpack('L*')\n setApplicationName = Win32::API::Function.new(table[32],'PP','L')\n\n hr = setApplicationName.call(@pITask,app_w)\n\n if hr != S_OK\n raise Error,get_last_error(hr)\n end\n\n app\n end",
"title": ""
},
{
"docid": "1d0e951c59b106081d4f46c3e961e6fe",
"score": "0.59406227",
"text": "def app_name\n self.app_name = 'lorj' unless @app_name\n @app_name\n end",
"title": ""
},
{
"docid": "1c677138aefe207a7c04eb8a21fa0984",
"score": "0.5904897",
"text": "def program_name\n File.basename($0)\nend",
"title": ""
},
{
"docid": "0a326888e791625c2363ddc6669a9f7f",
"score": "0.5882974",
"text": "def app_name=(name)\n @app_name = name\n @slop_definition.banner = build_banner\n end",
"title": ""
},
{
"docid": "43221bb06be76a91ecf7e5242dcfb83c",
"score": "0.588297",
"text": "def app_name=(value)\n @app_name = value\n end",
"title": ""
},
{
"docid": "43221bb06be76a91ecf7e5242dcfb83c",
"score": "0.588297",
"text": "def app_name=(value)\n @app_name = value\n end",
"title": ""
},
{
"docid": "43221bb06be76a91ecf7e5242dcfb83c",
"score": "0.588297",
"text": "def app_name=(value)\n @app_name = value\n end",
"title": ""
},
{
"docid": "49566de25d9a4c2773d1cf900af87100",
"score": "0.5882112",
"text": "def set_filename(name)\n @filename = name\n if name\n set_title \"Hexwrench - \"+\n \"#{File.basename(name)} \"+\n \"(#{File.dirname(File.expand_path(name))})\"\n else\n set_title \"Hexwrench\"\n end\n end",
"title": ""
},
{
"docid": "b6c5d283a8ff5e88b160c5fa47d478c8",
"score": "0.58638215",
"text": "def current_program_name\n program.name.downcase rescue t(:no_information)\n end",
"title": ""
},
{
"docid": "3ad9d4b6d2c944521b735553b261d3ea",
"score": "0.5837974",
"text": "def set_process_title; end",
"title": ""
},
{
"docid": "613191f239d269d4eac9c571db936df2",
"score": "0.5830898",
"text": "def process_name=(value)\n @process_name = value\n end",
"title": ""
},
{
"docid": "150b0088b20bd46aaaf31b77236f73e8",
"score": "0.58116543",
"text": "def set_database_application_name\n ArApplicationName.name = @worker.database_application_name\n end",
"title": ""
},
{
"docid": "8163a7d0315be7799d0e6d2fc37a5b4a",
"score": "0.5802044",
"text": "def set_program\n self.program = task.program if task\n end",
"title": ""
},
{
"docid": "f024ae8f622cce1a56741980834260dc",
"score": "0.5797832",
"text": "def name=(app_name)\n self.canonical_name = app_name.downcase\n super\n end",
"title": ""
},
{
"docid": "7a34e100703669cfce198314e5de68a1",
"score": "0.57762885",
"text": "def set_AppName(value)\n set_input(\"AppName\", value)\n end",
"title": ""
},
{
"docid": "7a34e100703669cfce198314e5de68a1",
"score": "0.57762885",
"text": "def set_AppName(value)\n set_input(\"AppName\", value)\n end",
"title": ""
},
{
"docid": "7a34e100703669cfce198314e5de68a1",
"score": "0.57762885",
"text": "def set_AppName(value)\n set_input(\"AppName\", value)\n end",
"title": ""
},
{
"docid": "7a34e100703669cfce198314e5de68a1",
"score": "0.57762885",
"text": "def set_AppName(value)\n set_input(\"AppName\", value)\n end",
"title": ""
},
{
"docid": "d7bbaf824b89b13e5d6e89db8b2c8489",
"score": "0.57747775",
"text": "def parent_process_name=(value)\n @parent_process_name = value\n end",
"title": ""
},
{
"docid": "3e3c83d8c52302e3f0b28dfda750103c",
"score": "0.5770927",
"text": "def program_name\n program.name if program\n end",
"title": ""
},
{
"docid": "a287a09d165a2508afcae58238e61cb0",
"score": "0.57458544",
"text": "def name(name)\n @package.name = name\n Log.info \"setting name #{name}\"\n end",
"title": ""
},
{
"docid": "526b6c5e1f24d5822a43fd479bcf7bfa",
"score": "0.5737544",
"text": "def change_install_name(filename, old_name, new_name, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "0bf316c900f100712865da29a6f0031e",
"score": "0.5727006",
"text": "def program_name\n\n\t\tname = @program_name\n\n\t\tif defined?(Colcon) && @stdout.tty?\n\n\t\t\tname = \"#{::Colcon::Decorations::Bold}#{name}#{::Colcon::Decorations::Unbold}\"\n\t\tend\n\n\t\tname\n\tend",
"title": ""
},
{
"docid": "35e735e9041465da45ccd79a076c109b",
"score": "0.5697833",
"text": "def set_name\n end",
"title": ""
},
{
"docid": "35e735e9041465da45ccd79a076c109b",
"score": "0.5697833",
"text": "def set_name\n end",
"title": ""
},
{
"docid": "aaf01b4b64e1c46483669d0fb14d88f9",
"score": "0.5675748",
"text": "def name\n return \"INVALID_PROGRAM\"\n end",
"title": ""
},
{
"docid": "e8af58fdcbd2875a518889d599f8cbd6",
"score": "0.56552196",
"text": "def program_name\n File.basename($0, '.*')\n end",
"title": ""
},
{
"docid": "52a8d68b1a0023ba0c6cf4fac67b48c8",
"score": "0.56528383",
"text": "def set_process_title(title)\n $0 = title.to_s\n end",
"title": ""
},
{
"docid": "d4e6412aaf3fc313dcbf448b605fb3a3",
"score": "0.5633297",
"text": "def change_install_name(old_name, new_name, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "5dc1f5203003de1d737f58d1b188b561",
"score": "0.55890787",
"text": "def app_name(val)\n @default_header.app_name = val\n end",
"title": ""
},
{
"docid": "2443c4ac20e4987c277305d653ae41ad",
"score": "0.55878425",
"text": "def name(name=nil)\n @name = name if name\n @name ||= cli_class.name.downcase.gsub('::','-')\n #File.basename($0)\n @name\n end",
"title": ""
},
{
"docid": "26a0f4b44b75ab2c9d565a6e1488ab93",
"score": "0.55666167",
"text": "def set_caller(caller_name)\n @caller = caller_name\n end",
"title": ""
},
{
"docid": "abe17a1b44844e854435af27c40bd88a",
"score": "0.55661243",
"text": "def application_name=(value)\n @application_name = value\n end",
"title": ""
},
{
"docid": "103b9583bb60a57e0a410e7667d2923d",
"score": "0.5561831",
"text": "def program_name\n Variable.new(0)\n end",
"title": ""
},
{
"docid": "8038b9c664ee42262152651912430bbe",
"score": "0.55575514",
"text": "def master_app_name=(value)\n @children['master-app-name'][:value] = value\n end",
"title": ""
},
{
"docid": "e2aa67f84a88c6d1c018706b0185a87d",
"score": "0.55337435",
"text": "def application_name=(app)\n action = default_action(create_if_missing: true)\n action.Path = app\n app\n end",
"title": ""
},
{
"docid": "3b6f208168de4d4b598033bf8eb886c0",
"score": "0.55265313",
"text": "def setname(name)\n @name = mkname(name)\n end",
"title": ""
},
{
"docid": "bdd8099ae9d1df116b7ab17f6df7aa7f",
"score": "0.55042124",
"text": "def setAppname(appname)\n\t\tquery = SearchQuery.new\n\t \tquery.name = @APPNAME\n\t\titem = search(query)[0]\n\t\tif ! item.nil?\n\t\t\titem.text = appname\n\t\telse\n\t\t\t# throw an exception\n\t\t\t\n\t\tend\n\tend",
"title": ""
},
{
"docid": "5fee6eb02ae497561a269ef15ddee065",
"score": "0.54959154",
"text": "def sub_process_name=(name)\n self.sub_process = @protocol.sub_processes.find_by_name(name) if @protocol\n end",
"title": ""
},
{
"docid": "0098fc5d7623991f3d22c69463600c8b",
"score": "0.546861",
"text": "def set_project_name(project_name)\n @project_name = project_name\n end",
"title": ""
},
{
"docid": "9d08f6630ffc3a051fa03811353eb4da",
"score": "0.5426581",
"text": "def name\n return \"INVALID_PROGRAM_EXECUTABLE\"\n end",
"title": ""
},
{
"docid": "93f4ff042803bbcb1785aa9c9cb633e3",
"score": "0.5422035",
"text": "def application_name=(app)\n raise TypeError unless app.is_a?(String)\n check_for_active_task\n\n definition = @task.Definition\n\n definition.Actions.each do |action|\n action.Path = app if action.Type == 0\n end\n\n register_task_definition(definition)\n\n app\n end",
"title": ""
},
{
"docid": "6e72e07f5b71ff7e24f4874cfc30993e",
"score": "0.54055893",
"text": "def default_app(app_name)\n @_default_app = app_name\n end",
"title": ""
},
{
"docid": "caaaf986f6fed307872aedb52a53bfb1",
"score": "0.5395734",
"text": "def set_ProjectName(value)\n set_input(\"ProjectName\", value)\n end",
"title": ""
},
{
"docid": "77a5b1d7fb2a4e1b641b8d577ced0384",
"score": "0.5387299",
"text": "def set_title\n @title = \"Cookbook --\"\n end",
"title": ""
},
{
"docid": "af2b84b75ff6482dccf76cd417c55848",
"score": "0.5386406",
"text": "def proc_name(tag)\n ctx = self.class::START_CTX\n $0 = [\"unicorn-#{Unicorn.app_name}-#{tag}\"].concat(ctx[:argv]).join(' ')\n end",
"title": ""
},
{
"docid": "6f710b2317c027f1115bcb4c754d0692",
"score": "0.53816354",
"text": "def pute(*args)\n first = args.shift.dup\n first.insert(0, \"#{$PROGRAM_NAME}: \")\n args.unshift(first)\n abort(args.join(\"\\n\"))\nend",
"title": ""
},
{
"docid": "15f7fd249cf7f4b4ab34345a016ff766",
"score": "0.53763676",
"text": "def set_name n\n @controller_name = n\n end",
"title": ""
},
{
"docid": "8f65c9ce6e866571d0e62358837c8adb",
"score": "0.5372705",
"text": "def application_name=(app)\n raise TypeError unless app.is_a?(String)\n check_for_active_task\n\n definition = @task.Definition\n\n definition.Actions.each do |action|\n action.Path = app if action.Type == 0\n end\n\n update_task_definition(definition)\n\n app\n end",
"title": ""
},
{
"docid": "aea14831f9befea2663ae008ad2014a7",
"score": "0.5368976",
"text": "def run_script_name(name = 'Новый скрипт')\n\t\ts = @code_edit.plainText\n\t\ts.force_encoding(\"UTF-8\")\n\t\tdirect = s.index(\"start_browser\")\n\t\t\n\t\n\t\tname_save = name\n\t\tif name!=\"Новый скрипт\"\n\t\t begin\n\t\t\tname = IO.read(name.gsub(/\\.rb$/,\".name\"))\n\t\t\tname.force_encoding(\"UTF-8\")\n\t\t rescue\n\t\t\tname = name_save\n\t\t end\n\t\tend\n\t\t\n\t\tif(direct)\n\t\t\teval(\"script_name = '#{name}'\\n#{s}\")\n\t\t\treturn\n\t\tend\n\t\t#Create new tab\n\t\tnew_task = Task.new(name,nil)\n\t\tlog_edit = new_tab(name,new_task)\n\n\n\t\t\n\t\t\n\t\temail = @name_login_choose.currentText\n\t\temail = \"\" unless email\n\t\temail.force_encoding(\"UTF-8\")\n\t\tsend_data({:id => new_task.id, :eval => s, :type => :eval, :user => email, :name => name})\n\t\t\n\t\tnew_task.tab = log_edit\n\t\tTask.add_task(new_task)\n\n\tend",
"title": ""
},
{
"docid": "6bfce81e1d98c2f8165c467b9aa31c88",
"score": "0.5367207",
"text": "def set_page_title\n @page_title = 'Trips'\n end",
"title": ""
},
{
"docid": "a0a4170c12df0e3f6711f0d1251ee71b",
"score": "0.5365067",
"text": "def set_thing_name\n self.set_name = full_name\n end",
"title": ""
},
{
"docid": "c2badee9edb5bd8fa7f7e93982c43b3e",
"score": "0.53576285",
"text": "def program\n (/(\\/|\\\\)/ =~ $0) ? File.basename($0) : $0\n end",
"title": ""
},
{
"docid": "0369d2c2280979b8fb21e3e2424abb4e",
"score": "0.53574467",
"text": "def daemon_project=(name)\n set(\"daemon_project\", name, true)\n end",
"title": ""
},
{
"docid": "e5e03cdaaa5665e66ef29db6e6ee6b08",
"score": "0.53478277",
"text": "def app_name\n default_notify :app_name\n 'Incline'\n end",
"title": ""
},
{
"docid": "19e5dbbb139194a51733835adcc83ecf",
"score": "0.5340551",
"text": "def new_launch_configuration_name\n @new_launch_configuration_name ||= \"#{name}#{used_launched_config_id.zero? ? 1 : 0}\"\n end",
"title": ""
},
{
"docid": "65aaa65610fa36c96c30c9b8b6a39f07",
"score": "0.5328069",
"text": "def startup_database_application_name\n return \"//pid=#{Process.pid}/#{af_name}\"\n end",
"title": ""
},
{
"docid": "2e57a16ea6a23980df1639a8c9d51bc4",
"score": "0.5325094",
"text": "def set_name\n self.name = self.login.capitalize if name.blank?\n end",
"title": ""
},
{
"docid": "c219bc67fb89da8b0dd3d9d53f3be93f",
"score": "0.5322673",
"text": "def title=(text)\n Windows.set_console_title(text)\n end",
"title": ""
},
{
"docid": "43a1c3e200c0487cc005b3b965fc6c29",
"score": "0.53194696",
"text": "def process_running_filename(prog_name, env, handler)\n fname = prog_name.dup\n fname << \"-#{handler}\" if handler\n fname << \"-#{env}\" if env\n fname << '.pid'\n\n File.join('/tmp', fname)\nend",
"title": ""
},
{
"docid": "d40ae9940cb86eb18978af0693b43e9e",
"score": "0.5313322",
"text": "def set_default_act_name\n @act_name = \"main\"\n if not params[\"act_name\"].nil?\n @act_name = params[\"act_name\"]\n end\n end",
"title": ""
},
{
"docid": "4f86593bebd12d1185f222ca71eb1fd6",
"score": "0.5311953",
"text": "def set_project_name(name)\n self.project_name = name unless name.nil?\n end",
"title": ""
},
{
"docid": "18193aec412a197cd5bf74d9f24b2280",
"score": "0.5274843",
"text": "def get_commander_one_app_name()\n app_name = \"Commander One\"\n return app_name\nend",
"title": ""
},
{
"docid": "f480bd291da81dd2a58bc2db632dda5f",
"score": "0.5273784",
"text": "def change_host_name(name)\n\n # First set the machine name (hostname)\n components = name.split('.')\n hostname = components.first\n domainname = components.slice(1, components.size).join('.')\n\n super(hostname)\n\n # Next set the Primary DNS Suffix, if it makes sense (domainname)\n unless domainname.empty?\n change_domain_name(domainname)\n end\n end",
"title": ""
},
{
"docid": "f480bd291da81dd2a58bc2db632dda5f",
"score": "0.5273784",
"text": "def change_host_name(name)\n\n # First set the machine name (hostname)\n components = name.split('.')\n hostname = components.first\n domainname = components.slice(1, components.size).join('.')\n\n super(hostname)\n\n # Next set the Primary DNS Suffix, if it makes sense (domainname)\n unless domainname.empty?\n change_domain_name(domainname)\n end\n end",
"title": ""
},
{
"docid": "8ad090c0533dff0c7bad3d7a6a28fc2e",
"score": "0.5272749",
"text": "def set_name(name)\n\t\tend",
"title": ""
},
{
"docid": "6ce0d0d286ec106a31e407430fb3b366",
"score": "0.52686495",
"text": "def set_CurrentName(value)\n set_input(\"CurrentName\", value)\n end",
"title": ""
},
{
"docid": "ca180cf41ef6432a9aee456747220074",
"score": "0.5254811",
"text": "def set_page_title(title)\n\t\t@page_title = @current_action.titleize + title\n\tend",
"title": ""
},
{
"docid": "ca180cf41ef6432a9aee456747220074",
"score": "0.5254811",
"text": "def set_page_title(title)\n\t\t@page_title = @current_action.titleize + title\n\tend",
"title": ""
}
] |
fa408fadf7cb24808ab74f96a8b846d3
|
Possible To Achieve Target Sum? Problem Statement: Given an array arr of size n and a target sum k. You have to determine, whether there exists a group of numbers (numbers need not to be contiguous and group can not be empty) in arr such that their sum equals to k. Input Format: There are two argument. First one is arr and second one is k. Output Format: Return a boolean denoting your answer. Constraints: 1 <= n <= 18 10^17 <= arr[i], k <= 10^17 Sample Test Cases: Sample Input 1: arr = [2 4 8] k = 6 Sample Output 1: True Explanation 1: arr[0] + arr[1] = 6 Sample Input 2: arr = [2 4 6] k = 5 Sample Output 2: False Explanation 2: There does not exists any group such that its sum equals to k. Pass a boolean flag to indicate whether a element has been tried.
|
[
{
"docid": "968ee6b1e225001df5c96759d2962d6d",
"score": "0.8300959",
"text": "def check_if_sum_possible(arr, k)\n\ti = 0\n\toutput = []\n\tssf = Array.new(arr.size)\n\treturn true if check_sum(arr, 0, ssf, 0, k, output).include?(true)\nend",
"title": ""
}
] |
[
{
"docid": "44169cb8b2243b7afd116e59c3ad41d7",
"score": "0.7892699",
"text": "def arr_sum(arr, target)\n 0.upto(arr.size - 2) do |idx1|\n 1.upto(arr.size - 1) do |idx2|\n return true if arr[idx1] + arr[idx2] == target && idx2 > idx1\n end\n end\n false\nend",
"title": ""
},
{
"docid": "59e28dd831f6bf74731e2145f4fc9f88",
"score": "0.78689945",
"text": "def my_solution(array, k)\n\tuntil array.empty?\n\t\telement = array.shift\n\t\tarray.each {|e| return true if e + element == k}\n\tend\n\tfalse\nend",
"title": ""
},
{
"docid": "aa956c4d277b1eec36345f449f8784ad",
"score": "0.7798076",
"text": "def bad_sum?(arr, target)\n\n (0...arr.length).each do |idx|\n (idx + 1...arr.length).each do |jdx|\n return true if arr[idx] + arr[jdx] == target\n end\n end\n false\nend",
"title": ""
},
{
"docid": "b4f1596e31eca591d6ddb698735421d1",
"score": "0.7733777",
"text": "def sum_to_n? arr, n\n #arr.product(arr).any? {|c| sum(c) == n && c[0] != c[1] } ----1.3\n arr = arr.sort\n low = 0\n high = arr.length - 1\n while low < high\n if arr[low] + arr[high] == n\n return true\n end\n arr[low] + arr[high] < n ? low += 1 : high -= 1 \n end\n return false\nend",
"title": ""
},
{
"docid": "484b3ddfd468e04caa5283549226565a",
"score": "0.7707833",
"text": "def sum_to_n? arr, n\n if arr.nil? || arr.empty? || arr.size == 1\n return false\n else \n arr.each {|x| arr.each {|y| return true if x + y == n && x != y}}\n end\n return false\nend",
"title": ""
},
{
"docid": "707b84060803be6d54595e57d268b90f",
"score": "0.7628095",
"text": "def sum_to_n? arr, n\n\nreturn false if arr.empty? || arr.length==1\n\nfor i in 0...arr.length\n for j in 0...arr.length\n if i != j\n return true if arr[i] + arr[j] == n\n end\n end\nend\n\nreturn false\n\nend",
"title": ""
},
{
"docid": "e7f89ed3bc5009f5c2bd966558c974f9",
"score": "0.7601072",
"text": "def sum_to_n? arr, n\n return false if arr.empty?#empty to 0\n i=0\n while i < arr.length do#goes throgh all elements\n e = arr.shift#returns the 1st element to e and removes it from array\n arr.each{ |x| return true if x + e == n }#add e and all the remaining elements to see if they add up to n\n i += 1\n end\n false\nend",
"title": ""
},
{
"docid": "cdf736602710a6b8f663bda5b9484ba0",
"score": "0.7546039",
"text": "def sum_to_n? arr, n\n arr = arr.combination(2).to_a\n arr.any? {|a| a.sum == n} ? true : false\nend",
"title": ""
},
{
"docid": "8793cc5fd7871e918c1d242740e431ae",
"score": "0.7525898",
"text": "def sum_to_n? arr, n\n len = arr.length\n\n #Returns false when the length of the array is 0.\n if len == 0 then\n return false\n end\n #Iterates through the array to find the first index\n i = 0\n while i < len-1 do\n #Iterate through the rest of the elements of the array\n j = i+1\n while j <= len-1 do\n if arr[i]+arr[j] == n then\n return true\n end\n j+=1\n end\n i+=1\n end\n return false\nend",
"title": ""
},
{
"docid": "1c8b13f862abdd47a9f82ffd091517a4",
"score": "0.7525828",
"text": "def okay_two_sum?(arr, target_sum)\n\narr.sort!\n\nreturn false if arr[-1] < target_sum\n\ni = 0\ni += 1 until arr[i] > target_sum\n\nresult = []\nnew_arr = arr[0...i]\n(0...new_arr.length - 1).each do |i|\n (i+1...new_arr.length).each do |j|\n result << new_arr[i] + new_arr[j]\n end\n end\n result.include?(target_sum)\n\nend",
"title": ""
},
{
"docid": "9f07c8c8b6a1b3efdee72023667d8be6",
"score": "0.7503079",
"text": "def sum_to_n? arr, n\n !!arr.uniq.combination(2).detect { |x, y| x + y == n }\nend",
"title": ""
},
{
"docid": "c9be9abb4d625ff418c2ee9b0960f6ab",
"score": "0.74833757",
"text": "def sum_to_n? arr, n\n match = arr.combination(2).find { |x, y| x + y == n }\n if match\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "4f4d2d6e3e5a3e02efe219120b5f3df7",
"score": "0.74764156",
"text": "def sum_to_n?( arr, n )\n return false if arr.nil? or arr.empty? or arr.length == 1\n arr.each do |first|\n arr.each do |second|\n return true if (first + second == n) and first != second\n end\n end\n false\nend",
"title": ""
},
{
"docid": "d0e32a6bc144d8419d7f29a1db1452e4",
"score": "0.7459057",
"text": "def sum_to_n?(arr, n)\n return false if arr.empty?\n\n combinations = arr.combination(2).to_a # for [1, 2, 3] return [[1, 2], [1, 3], [2, 3]]\n sums = combinations.map { |combination| combination.reduce(0, :+) }\n\n sums.include? n\nend",
"title": ""
},
{
"docid": "4e41f2267de07e5c66911004516289a6",
"score": "0.7457252",
"text": "def sum_to_n? arr, n\n\n if arr.empty? \n sum = false\n elsif arr.count == 1\n \tsum = false\n else\n x = arr.combination(2).each { |s| (s[0] + s[1]) }\n if x.include? n\n sum = true\n else\n sum = false\n end\n end\n\nend",
"title": ""
},
{
"docid": "3bb423483878e86dbfc478bf319c3d0a",
"score": "0.74558234",
"text": "def two_sum?(arr, target_sum)\n (0...arr.length).each do |i|\n (0...arr.length).each do |j|\n next if i == j\n return true if arr[i] + arr[j] == target_sum\n end\n end\n\n false\nend",
"title": ""
},
{
"docid": "7f58363e95eb636d47eafa5f068d00ee",
"score": "0.7437326",
"text": "def can_sum(target_sum, numbers)\n return true if target_sum == 0 # 0 can be generated by taking no numbers from the array\n return false if target_sum < 0\n\n for num in numbers\n remainder = target_sum - num\n return true if can_sum(remainder, numbers) == true\n end\n\n return false\nend",
"title": ""
},
{
"docid": "c366ff77d5f2af2f590b51d260a347ca",
"score": "0.7425518",
"text": "def two_sum?(arr, target_sum)\n h = Hash.new(0)\n\n arr.each { |num| h[num] += 1 }\n\n h.each do |key, v|\n subtarget = target_sum - key\n if h[subtarget] != 0 && (subtarget != key || (subtarget == key && v > 1))\n return true \n # if subtarget == key\n # return true if v > 1\n # end\n # return true\n end \n end\n false\n\nend",
"title": ""
},
{
"docid": "8aa77a5bdfbe5919477752db187d50b9",
"score": "0.74233377",
"text": "def sum_to_n?(arr, n)\n return false if arr.empty? or arr.length == 1\n # returns true at first pair that sum to n\n return true if arr.combination(2).find { |x, y| x + y == n }\n # returns true at first pair that sum to n\n return false\nend",
"title": ""
},
{
"docid": "45cf0094c6c048674d2d21a613cf7ebc",
"score": "0.7418243",
"text": "def sum_to_n? arr, n\n # YOUR CODE HERE\n pairs = arr.combination(2).to_a\n \n for p in pairs\n if p.sum == n \n return true\n end\n end\n \n return false\nend",
"title": ""
},
{
"docid": "20bfdecd92bf18cfacd99652d6a19dbc",
"score": "0.74171317",
"text": "def okay_two_sum?(arr, target_sum)\n sorted = arr.sort\n (0...sorted.length).each do |i|\n (i + 1...sorted.length).each do |j|\n return true if sorted[i] + sorted[j] == target_sum\n break if sorted[i] + sorted[j] > target_sum\n end\n end\n false\nend",
"title": ""
},
{
"docid": "b23bec210fe3271484c5b0cbf0e9977c",
"score": "0.7412399",
"text": "def bad_two_sum?(arr, target)\n arr.each_with_index do |num1,idx1|\n i = idx1 + 1\n while i < arr.length\n return true if num1 + arr[i] == target\n i+=1\n end\n end\n false\nend",
"title": ""
},
{
"docid": "62e969396a3e5110b7a997e841832058",
"score": "0.7409372",
"text": "def sum_to_n? arr, n\n result = false\n sum = 0\n if arr.size>1\n arr.each {|num| result = true if num == n}\n end\n \n return result\nend",
"title": ""
},
{
"docid": "7c91068095682c87c273b0052ea738f4",
"score": "0.7404215",
"text": "def sum_to_n? arr, n\n return false if arr.empty?\n combinations_found = arr.combination(2).to_a.select { |o| o.inject(:+) == n }\n combinations_found.size > 0\nend",
"title": ""
},
{
"docid": "b8b8d1d5ff0f9968f4d32cefae44e74a",
"score": "0.74013835",
"text": "def okay_two_sum?(arr, target)\n # arr.sort.bsearch(target)\n # arr.combination(2).any? { |el,el2| return true if el + el2 == target }\n\n sorted = arr.sort\n (0...sorted.lentgh-1).each do |i|\n if arr[i] + arr[i+1] == target \n return true \n end \n end \nend",
"title": ""
},
{
"docid": "d99ef8469338f1d67dc750f13ac6ac3e",
"score": "0.73984313",
"text": "def sum_to_n? arr, n\n return false if arr.empty? or arr.length == 1\n for i in 0...arr.length - 1\n for j in i + 1...arr.length\n if arr[i] + arr[j] == n\n return true\n end\n end\n end\n return false\nend",
"title": ""
},
{
"docid": "bc1caa7445a8349e31fdb6e288bad1a8",
"score": "0.7397015",
"text": "def two_sums?(arr, target)\n # number_count = Hash.new(0)\n #\n # arr.each do |num|\n # number_count[num] += 1\n # end\n #\n # arr.each do |num|\n # other_num = target - num\n # number_count[num] -= 1\n # return true if number_count.include?(other_num) && number_count[other_num] > 0\n # end\n #\n # false\n set = Set.new(arr)\n arr.each do |num|\n set.delete(num)\n return true if set.include?(target - num)\n end\n false\nend",
"title": ""
},
{
"docid": "b3597bfad31a5296c2f3f02094ec4a50",
"score": "0.7388582",
"text": "def sum_to_n? arr, n\n if arr.size>=2\n for x in arr\n target = n-x\n tmp = arr.dup\n tmp.delete_at(tmp.index(x))\n return true if tmp.include?(target)\n end\n end\n false\nend",
"title": ""
},
{
"docid": "d78374c466640858500f0097c36fd830",
"score": "0.73852843",
"text": "def bad_two_sum?(arr, target_sum)\n arr.size.times do |start|\n (start + 1...arr.size).each do |stop|\n return true if arr[start] + arr[stop] == target_sum\n end\n end\n false\nend",
"title": ""
},
{
"docid": "82cfa05628d128b6010268033729be66",
"score": "0.73839116",
"text": "def bad_two_sum?(arr, target_sum)\n arr.each_with_index do |o_el, o_idx|\n arr.each_with_index do |i_el, i_idx|\n next if o_idx == i_idx\n return true if o_el + i_el == target_sum\n end\n end\n false\nend",
"title": ""
},
{
"docid": "abee4339d5e97110b8436a0e74b5d6c3",
"score": "0.7381297",
"text": "def two_sum?(arr, target_sum)\n debugger\n complements = {}\n\n arr.each do |el|\n return true if complements[target_sum - el]\n complements[el] = true\n end\n\n false\nend",
"title": ""
},
{
"docid": "afa78c0247b2ce9b869728a9c1b8da72",
"score": "0.7372417",
"text": "def two_sum_v3?(arr, target) \n hash = Hash.new\n arr.each { |ele| hash[ele] = ele } #o(n)\n arr.each do |ele| #o(n)\n search_value = target - ele\n return true if !hash[search_value].nil? && hash[search_value] != ele\n end\n false\nend",
"title": ""
},
{
"docid": "c7ec3116ff1b355ba62da38a61efa6c0",
"score": "0.7368002",
"text": "def hardcore_two_sum?(arr, target)\n nums = {}\n arr.each{ |n| nums[n] = n }\n\n nums.each do |n,_|\n needed = target - n\n return true if !nums[needed].nil? && nums[needed] != n\n end\n\n false\nend",
"title": ""
},
{
"docid": "ddb00ed00235113a8f9b62d7aebc5147",
"score": "0.73623556",
"text": "def sum_to_n?(array,n)\n if array.empty? || array.count == 1\n false\nend\n if array.combination(2).detect {|a,b| a+b ==n}\n true\n end\nend",
"title": ""
},
{
"docid": "31c85d9eaf0963b69baaa5cceb99b4b4",
"score": "0.73614424",
"text": "def sum_to_n?(arr, n)\n for x in arr\n if arr.include?(n - x)\n return true\n end\n end\n return n==0 && arr.empty?\nend",
"title": ""
},
{
"docid": "c5dd419be4eab6c6300207d2b498ea87",
"score": "0.7360471",
"text": "def sum_to_n? arr, n\n # Creates an array of every possible pair in arr and finds pair that sums n\n if arr.combination(2).find{|a,b| a + b == n}\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "5e3fb49d08c0da8ae9a12de4c38db983",
"score": "0.7340163",
"text": "def two_sum?(arr, target_sum) \n hash = Hash.new(0)\n arr.each do |num|\n hash[num] = 1 \n end \n\n arr.each do |num|\n num2 = target_sum - num\n next if num2 == num\n next if hash[num2].nil?\n return true if hash[num2] == 1\n end\n false\nend",
"title": ""
},
{
"docid": "90089ebde3e2488b7273299b7b590604",
"score": "0.7334384",
"text": "def bad_two_sum?(arr, target)\n (0...arr.length).each do |i|\n (i+1...arr.length).each do |j|\n return true if arr[i] + arr[j] == target\n end\n end\n false\nend",
"title": ""
},
{
"docid": "1282bb5a3062da1e61a60bc6ba74093f",
"score": "0.7328402",
"text": "def two_sum?(arr,target)\n\n hash = Hash.new {|h,k| h[k] = [] }\n arr.each_with_index do |ele, i|\n hash[ele] << i\n end\n\n hash.each do |k, v|\n if k == target/2\n return true if v.length > 1\n elsif hash.has_key?(target-k)\n return true \n end\n end\n false\nend",
"title": ""
},
{
"docid": "1f20fe8b1b6dce4224f040b1884099b2",
"score": "0.7316363",
"text": "def sum_to_n?(array, n)\n array.product(array).any? {|couple| sum(couple) == n}\nend",
"title": ""
},
{
"docid": "3e19412bd3a9416e0fc503df3ab30159",
"score": "0.7311877",
"text": "def two_sum?(arr, target_sum)\n hash = Hash.new(0)\n arr.each_with_index do |num, idx|\n hash[num] = idx\n end\n arr.each_with_index do |num, idx|\n return true if hash.has_key?(target_sum - num) && idx != hash[target_sum - num]\n end\n false\nend",
"title": ""
},
{
"docid": "dc1e490505fdda78d3f89e713eee63f2",
"score": "0.7310654",
"text": "def check_array_for_sum(arr, goal)\n arr.product(arr).reject{|pair| pair.first == pair.last}.map{ |pair| pair.reduce(0, :+)}.include?(goal)\nend",
"title": ""
},
{
"docid": "4e24e551d85f08cbf87ac3a39f653f9b",
"score": "0.7307468",
"text": "def sum_to_n? arr, n\n arr.each_with_index { |first, i1|\n arr.each_with_index { |sec, i2|\n return true if first + sec == n && i1 != i2\n }\n }\n return false\nend",
"title": ""
},
{
"docid": "b3f593d84a9a8d115bb68ae70d8633f2",
"score": "0.7300855",
"text": "def two_sum?(arr, target_sum)\n arr_hash = Hash.new\n arr.each do |num|\n if num * 2 == target_sum\n return true if arr.count(num) == 2\n else\n arr_hash[num] = target_sum - num\n end\n end\n arr_hash.each_value do |v|\n return true if arr_hash[v]\n end\n false # if one of the key + one of the value = target_sum then return true\nend",
"title": ""
},
{
"docid": "8245d0c6eb1366676c09eafb4f7da6b4",
"score": "0.7299624",
"text": "def bad_two_sum?(arr, target_sum)\n (0...arr.length - 1).each do |i|\n (i + 1..arr.length - 1).each do |j|\n return true if arr[i] + arr[j] == target_sum\n end\n end\n false\nend",
"title": ""
},
{
"docid": "96435d6d8735f5ca9aeaced4736a67ce",
"score": "0.7299304",
"text": "def bad_two_sum?(arr, target_sum)\n arr.each_with_index do |ele1, idx1|\n arr.each_with_index do |ele2,idx2|\n if idx2 > idx1 && arr[idx1] + arr[idx2] == target_sum\n return true\n end\n end\n end\n false\nend",
"title": ""
},
{
"docid": "38295ac78e4f95e70ec88a61ac2a7427",
"score": "0.7298864",
"text": "def two_sum?(arr, target_sum)\n\n hash = {}\n arr.each_with_index do |i,idx|\n hash[i] = idx\n end\n arr.each_with_index do |j, idx2|\n return true if hash.has_key?(target_sum - j) && hash[target_sum-j] != idx2\n end\n false\n\nend",
"title": ""
},
{
"docid": "9cbf5280047d932fb71bf306f4a93b12",
"score": "0.72979057",
"text": "def bad_two_sum?(arr, target_sum) #O(n^2)\n (0...arr.length).each do |i|\n (i+1...arr.length).each do |j|\n return true if arr[i] + arr[j] == target_sum\n end\n end\n false\nend",
"title": ""
},
{
"docid": "fc9e0f5075ba58864fff136664d67ca6",
"score": "0.72949904",
"text": "def bad_two_sum?(arr, target)\n (0...arr.length).each do |idx1|\n return true if arr[idx1] == target\n (idx1+1...arr.length).each do |idx2|\n return true if (arr[idx1] + arr[idx2]) == target\n end\n end\n false\nend",
"title": ""
},
{
"docid": "050d91096b9f282730d0f5d8df8e6f7d",
"score": "0.7286732",
"text": "def bad_two_sum?(arr, target_sum)\n (0...arr.length - 1).each do |i|\n (i+1...arr.length).each do |j|\n return true if arr[i] + arr[j] == target_sum\n end\n end\n return false\nend",
"title": ""
},
{
"docid": "997bbfeec6423efba6dfb9900ebcc7ac",
"score": "0.7284977",
"text": "def okay_two_sum?(arr, target)\n\n arr.sort\n i = 0 \n j = arr.length\n until arr[i] + arr[j] == target || i == arr.length - 1\n return true \n end\n\n return false\n \n\nend",
"title": ""
},
{
"docid": "90e9b17d7487827b15385903bf16e764",
"score": "0.7284722",
"text": "def okay_two_sum(arr, target)\n sorted_arr = arr.sort\n while sorted_arr.any?\n partner = target - sorted_arr.pop\n return true if b_search(sorted_arr, partner)\n end\n\n false\nend",
"title": ""
},
{
"docid": "9d12614b7195c200ba76d9c951375184",
"score": "0.7282726",
"text": "def sum_to_n?(int_array, n)\n return false unless int_array.respond_to?(:combination)\n \n int_array.uniq.combination(2).detect {|arr| sum(arr) == n }\nend",
"title": ""
},
{
"docid": "ed159922856df91450dc542935aa8487",
"score": "0.7278283",
"text": "def okay_two_sum?(arr, target) # => [0,1,5,7] \n sorted = qs(arr)\n\n (0...sorted.length-1).each do |i|\n return true if sorted[i] + sorted[i + 1] == target\n end\n\n false\nend",
"title": ""
},
{
"docid": "0c8031548515fa51dfe2b024de63ef2e",
"score": "0.72680455",
"text": "def okay_two_sum?(arr, target)\r\n arr = arr.sort #n log n\r\n i, j = 0, arr.length - 1 #2\r\n\r\n while j > i #n\r\n curr_sum = arr[i] + arr[j]\r\n if curr_sum > target\r\n j -= 1\r\n elsif curr_sum < target\r\n i += 1\r\n else\r\n return true\r\n end\r\n end\r\n false\r\nend",
"title": ""
},
{
"docid": "34ca8b98aae7769f132650192a74c115",
"score": "0.72672844",
"text": "def sum_to_n?(array, n)\n return false if array.empty? || array.length == 1\n\n array.combination(2).any? { |x, y| x + y == n }\nend",
"title": ""
},
{
"docid": "9d04df1e9f5a4e5e5704bc838eb63dac",
"score": "0.72659177",
"text": "def okay_two_sum?(arr, target_sum)\n new_arr = arr.sort\n i = 0\n j = arr.length - 1\n while i < j \n if (arr[i] + arr[j] ) == target_sum\n return true\n elsif \n (arr[i] + arr[j] ) > target_sum\n j -= 1\n else\n i += 1\n end\n \n \n end\n false\nend",
"title": ""
},
{
"docid": "9ce43d57ed3ab32dff28b4d7f068a61b",
"score": "0.7260835",
"text": "def bad_two_sum?(arr, target_sum) \n arr.each_with_index do |num, idx|\n arr.each_with_index do |num2, idx2|\n next if idx2 == idx\n return true if num2 + num == target_sum\n end\n end\n false\nend",
"title": ""
},
{
"docid": "b34732fc779e3db062e2e890667d8781",
"score": "0.72596425",
"text": "def better_sum?(arr, target)\n pair_set = Set.new\n\n arr.each do |ele|\n if pair_set.include?(ele)\n return true\n else\n pair_set << target - ele\n end\n end\n\n false\n\nend",
"title": ""
},
{
"docid": "551e8e20ab7c35c556754bb1d6b4ca28",
"score": "0.72583866",
"text": "def okay_two_sum(arr, target)\n #O(n)\n arr.sort!\n i = 0\n j = arr.length - 1\n while i < j\n sum = arr[i] + arr[j]\n return true if sum == target\n if sum < target\n i += 1\n else\n j -= 1\n end\n end\n false\nend",
"title": ""
},
{
"docid": "3812ff73b87accab262ac90db2ff22d0",
"score": "0.72565037",
"text": "def bad_two_sum?(arr, target)\n (0...(arr.length - 1)).each do |idx1|\n ((idx1 + 1)...arr.length).each do |idx2|\n return true if arr[idx1] + arr[idx2] == target\n end\n end\n false\nend",
"title": ""
},
{
"docid": "b09b029bcfc11ca2410f5a49360131a0",
"score": "0.7248547",
"text": "def sum_to_n?(array, n)\n\n array_size = array.size\n\n i = 0\n\n while i < array_size do\n argument = array.slice!(0)\n array.each{|x| return true if x + argument == n}\n i += 1\n end\n return false\nend",
"title": ""
},
{
"docid": "c6a68839fddcf1b5bf6bf7a07a29ef44",
"score": "0.7244623",
"text": "def bad_two_sum?(arr, target)\n found = false\n arr.each_with_index do |a, l|\n arr.each_with_index do |b, n|\n next if l == n\n found = true if arr[l] + arr[n] == target\n end\n end\n found\nend",
"title": ""
},
{
"docid": "20ae652ee1516a55b57df671043308f9",
"score": "0.7243205",
"text": "def sum_exists?(arr, sum, p, q)\n if p < q\n (p - 1..q - 2).each do |i|\n return true if arr[i] + arr[i + 1] == sum\n end\n\n sum_exists?(arr, sum, p + 1, q)\n end\n\n return false\nend",
"title": ""
},
{
"docid": "d7fe78dd4e85a72807f0dc490394158f",
"score": "0.7231797",
"text": "def sum_to_n? arr, n\n \n if arr.size>=2\n for x in arr\n if arr.include?(n-x) and x != n-x or arr.count(x) > 1\n return true\n end\n end\n end\n \n false\nend",
"title": ""
},
{
"docid": "be1ff34dc8306873575ab6b5fb596503",
"score": "0.7228719",
"text": "def okay_two_sum?(arr, target_sum)\n arr.sort!\n i, j = 0, arr.length - 1\n\n until i == j\n this_sum = arr[i] + arr[j]\n return true if this_sum == target_sum\n this_sum < target_sum ? i += 1 : j -= 1\n end\n\n false\nend",
"title": ""
},
{
"docid": "2282d6bcedd6bec182b4c1c2d0d26728",
"score": "0.7221956",
"text": "def contig_subarrs_that_sum_to_k(k, arr) # so this problem worked with contiguous subarrays that sum to a value k\n # for example, arr[j] - arr[i] vs. arr[j]\n # if you do a running sum, any difference that equals k is what we're looking for.\n # then we can increment a counter, we can save j - i for a max size, or we can even grab the subarray.\n running_sum = 0\n arr.each_with_index do |el, index|\n end\nend",
"title": ""
},
{
"docid": "25599cfd49fe017b7719693c24ae76f9",
"score": "0.7215051",
"text": "def sum_to_n?(ar, n)\n return false if ar.empty? or ar.count == 1\n ar.uniq.permutation(2).any? { |a| a.first+a.last == n }\nend",
"title": ""
},
{
"docid": "ca9dbf6d30222ac35c2506c451dec7d8",
"score": "0.72127986",
"text": "def okay_two_sum?(arr, target_sum)\n sorted_arr = arr.sort\n (0...sorted_arr.length).each do |i|\n next if i+1 == sorted_arr.length\n return true if sorted_arr[i] + sorted_arr[i+1] == target_sum\n end\n\n return false\nend",
"title": ""
},
{
"docid": "f318c5ac2995bfd358889120680528df",
"score": "0.720826",
"text": "def bad_two_sum?(arr, target_sum)\n arr.each_with_index do |num1, i|\n arr[i..-1].each do |num2|\n next if num1 == num2\n\n return true if (num1 + num2) == target_sum\n end\n end\n\n false\nend",
"title": ""
},
{
"docid": "78b2638aaef57a8072e73a24d97ebf94",
"score": "0.72018737",
"text": "def okay_two_sum?(arr, target_sum)\n i = 0 \n j = arr.length - 1 \n arr = arr.sort \n\n while i < j \n if arr[i] + arr[j] == target_sum \n return true \n elsif arr[i] + arr[j] > target_sum\n j -= 1 \n else \n i += 1 \n end\n end\n false \nend",
"title": ""
},
{
"docid": "22d11ab8ff94b272002a787523f94a34",
"score": "0.71988153",
"text": "def sum_eq_n?(arr, n)\n if arr == [] && n == 0\n return true\n end\n for i in 0..arr.length-2\n for j in i+1..arr.length-1\n if arr[i] + arr[j] == n\n return true\n end\n end\n end\n return false\nend",
"title": ""
},
{
"docid": "08a3893916378d0ea41741aa6f555887",
"score": "0.71951556",
"text": "def sum_to_n?(array, n)\n if array.empty? and n==0 or (array.size==1 and array[0] == n)\n return true\nend\na=array.combination(2).to_a\na.map! { |row| row.reduce(:+) }\na.each { |e|\n if e==n\n return true\n end }\n false\n end",
"title": ""
},
{
"docid": "84933991dd5c9647eb19d6d64b3c2404",
"score": "0.71948946",
"text": "def two_sum?(arr, target_sum)\n summands = {}\n\n arr.each do |num|\n return true if summands[target_sum - num]\n\n summands[num] = true\n end\n\n false\nend",
"title": ""
},
{
"docid": "17f942450a4691ae6bfbd88fccf11c7a",
"score": "0.71895605",
"text": "def sum_to_n?(array,n)\n\n raise 'parameters include non integers' unless \n (array.empty? || array.length == 1 || n.integer? || array.all? { |x| x.integer?})\n\n array.length.times do \n y = array.shift\n if array.any? { |x| x + y == n } \n return true\n end\n end\n return false\nend",
"title": ""
},
{
"docid": "c2f28997974079950610ebbba4872aad",
"score": "0.7187925",
"text": "def ok_two_sum(arr, target)\n sorted = quick_sort(arr)\n\n arr.each do |el|\n b_target = target - el\n return true if b_search(arr, b_target)\n end\n false\nend",
"title": ""
},
{
"docid": "0c827d098c9ddd205b255fedd78e2d73",
"score": "0.7186702",
"text": "def bad_two_sum?(arr, target_sum)\n arr.length.times do |i|\n (arr.length - i - 1).times do |j|\n return true if arr[i] + arr[j + i + 1] == target_sum\n end\n end\n false\nend",
"title": ""
},
{
"docid": "cb6479c35a77360605901fcac5fa4107",
"score": "0.71851164",
"text": "def array_sum_to_n?(array, n)\r\n array.combination(2).any?{ |x, y| x + y == n } # For any combination of two elements their sum must be equal to n.\r\nend",
"title": ""
},
{
"docid": "3bef49382b86e4a20df450d3ef034e07",
"score": "0.7183033",
"text": "def four_sum?(arr,target)\n hash = {}\n pairs = []\n arr.each_with_index do |el1,i| # this checks one number at a time. We need 3 random numbers at a time. But they won't necessarily be in order.\n arr.each_with_index do |el2,j|\n next if i <= j\n pairs << {el1=>i,el2=>j}\n end\n end\n\n\n pairs.each_with_index do |el,i|\n compliment = target - el.keys.sum\n if hash.has_key?(compliment)\n return true if hash[compliment].values.none? { |j| el.values.include?(j) }\n end\n hash[el.keys.sum] = el.values\n end\n false\nend",
"title": ""
},
{
"docid": "a9c7dbf59d2f01130d9217e7e6dc3977",
"score": "0.7179874",
"text": "def good_two_sum?(arr, target_sum)\r\n elements = {}\r\n\r\n arr.each do |ele|\r\n return true if elements[target_sum - ele]\r\n elements[ele] = true\r\n end\r\n false\r\nend",
"title": ""
},
{
"docid": "ca19f97699bac8cd6b7d45684a8adb76",
"score": "0.71775967",
"text": "def two_sum1?(arr, target_sum)\n sorted_arr = arr.sort\n length = arr.length - 1\n\n mid = arr.length / 2\n\n if mid < target_sum\n (0...mid).any? { |i| arr[i] + arr[i+1] == target_sum }\n else\n (mid...length).any? { |i| arr[i] + arr[i+1] == target_sum }\n end\nend",
"title": ""
},
{
"docid": "c99106d92fe37ecbbeaaafb0a1e724b7",
"score": "0.71706635",
"text": "def sum_to_n? (arr, n)\n \n count=false\n \n if !(arr.empty? || arr.length == 1)\n count=!! arr.uniq.combination(2).detect{|a,b| a + b == n} \n end\n \n return count\nend",
"title": ""
},
{
"docid": "fdf13229e6f663507145fa8ef71dd877",
"score": "0.71676165",
"text": "def okay_two_sum?(arr, target)\n i = 0\n j = arr.length - 1\n\n while i < j\n if arr[i] + arr[j] == target\n return true\n elsif arr[i] + arr[j] < target\n i += 1\n else\n j -= 1\n end \n end\n false\nend",
"title": ""
},
{
"docid": "d8b52a536c68a56c955bfbca229bf3ee",
"score": "0.7163771",
"text": "def sum_to_n? arr, n\n if arr.length == 1\n return false\n end\n \n #sort arr and find head and tail indices\n sorted_arr = arr.sort\n head = 0\n tail = sorted_arr.length-1\n \n #iterating through arr to find the sum that equals n\n while head < tail\n current_sum = sorted_arr[head] + sorted_arr[tail]\n if current_sum == n\n return true\n elsif current_sum < n\n head = head + 1\n else\n tail = tail - 1\n end\n end\n return false\nend",
"title": ""
},
{
"docid": "99121c2ffa3320718c0bb8b7e75243f2",
"score": "0.7163724",
"text": "def bad_two_sum?(arr, target)\n\n arr.each.with_index do |x, idx|\n arr.each.with_index do |y, idy|\n if idx == idy\n next\n else\n if (x + y) == target\n return true\n end\n end\n end\n end\n\n return false\n\nend",
"title": ""
},
{
"docid": "5a09a75eb5bbdfc92b548f338c144eb9",
"score": "0.7158767",
"text": "def bad_two_sum?(arr, target)\n sums = []\n arr.each_index do |i|\n (i+1...arr.length).each do |j|\n sums << arr[i] + arr[j]\n end\n end\n sums.include?(target)\nend",
"title": ""
},
{
"docid": "a01e89356a894bc7b983d5fc6aa30b8c",
"score": "0.7158665",
"text": "def sum_to_n? arr, n\n arr = [0] if (arr.nil? || arr.empty?)\n arr.combination(2).any? { |a,b| (a+b) == n }\nend",
"title": ""
},
{
"docid": "0b6411eef0816b8e88a84dfffe3117b4",
"score": "0.715752",
"text": "def better_two_sum?(arr, target_sum)\n hash = {}\n arr.each_with_index do |ele,i|\n hash[ele] = i\n end\n arr.each_with_index do |ele,i|\n target = target_sum - ele\n return true if !hash[target].nil? && i != hash[target]\n end\n \n false\nend",
"title": ""
},
{
"docid": "f40bd8ef69a87177ad0d602f10850e40",
"score": "0.7154841",
"text": "def two_sum?(arr, target)\n s1 = Set.new \n arr.each_with_index do |el, idx|\n return true if s1.include?(target-el)\n s1.add(el)\n end\n false\nend",
"title": ""
},
{
"docid": "3310c3535a84dd209a76b020ff353535",
"score": "0.7150058",
"text": "def okay_two_sum?(arr, target)\n arr.sort!\n pairs = arr.combination(2)\n pairs.any? { |pair| pair.sum == target }\nend",
"title": ""
},
{
"docid": "4a48bba5d1761cc7b51aef40f7cfd797",
"score": "0.7147736",
"text": "def two_sum?(array, target_sum)\n array_hash = {}\n array.each do |el|\n array_hash[el] = true\n end\n\n array.each_with_index do |el|\n next if target_sum - el == el\n return true if array_hash[target_sum - el]\n end\n false\nend",
"title": ""
},
{
"docid": "39e7d7b17774214900615fff1fd2f335",
"score": "0.7146431",
"text": "def two_sum?(arr, target_sum)\n hash = {}\n arr.each do |el|\n hash[el] = el\n return true if hash.has_value?(target_sum - el)\n end \n false\nend",
"title": ""
},
{
"docid": "0544850b42bc692785c39ea4fff01095",
"score": "0.7144229",
"text": "def two_sum?(arr, target_sum)\n hash = Hash.new\n\n arr.each do |el|\n hash[el] = el\n end\n\n arr.each do |el|\n target = target_sum - el\n return false if target == el\n return true if hash.key?(target)\n end\n\n false\nend",
"title": ""
},
{
"docid": "418d7a432b7051f2966f2d1449689718",
"score": "0.71430504",
"text": "def adds_up?(array, k)\n array_length = array.length\n for i in 0..array_length\n y = i + 1\n while y < array_length\n if (array[i] + array[y] == k)\n return true\n end\n y = y + 1\n end\n end\n false\nend",
"title": ""
},
{
"docid": "91be29038dc0dd5a4f63e17404eb09d0",
"score": "0.71311635",
"text": "def bad_two_sum?(arr, target_sum)\r\n arr.each_with_index do |ele1, i1|\r\n arr.each_with_index do |ele2, i2|\r\n return true if i2 != i1 && (ele1 + ele2 == target_sum)\r\n end\r\n end\r\n\r\n false\r\nend",
"title": ""
},
{
"docid": "855a960dcacb9086cc301c0f5dfed017",
"score": "0.7117243",
"text": "def sum_to_n?(a, n)\n result = false\n\n while a.length > 1\n e1 = a.slice!(0)\n a.each {|e2| e2 + e1 == n ? result = true : break }\n end\n\n result\nend",
"title": ""
},
{
"docid": "17f5b10cc62fa4fa0c791c2c57a7c74d",
"score": "0.71161014",
"text": "def bad_two_sum?(array, target)\n array.each.with_index do |el1, idx1|\n array.each.with_index do |el2, idx2|\n if el1 + el2 == target && idx2 > idx1\n return true \n end\n end\n end\n false \nend",
"title": ""
},
{
"docid": "951493bc138aee143ea3294918dce6ea",
"score": "0.7115575",
"text": "def sum_to_n? (int_array, n)\r\n found = false\r\n secondAddendCandidates = []\r\n int_array.each do |num|\r\n # Check if we found the 2nd addend \r\n if secondAddendCandidates.include? num\r\n found = true\r\n break\r\n else\r\n # Key = candidate for the 2nd addend in the sum\r\n secondAddendCandidates << n-num\r\n end\r\n end\r\n\r\n found\r\nend",
"title": ""
},
{
"docid": "abb224f16b1f1ba21e9d47b6d2ed55a5",
"score": "0.7110547",
"text": "def sum_to_n? arr, n\n if arr.length > 1\n for i in arr do\n ndx = arr.find_index(i)\n x = arr.delete_at(ndx)\n if arr.include?(n - x)\n return true\n end\n arr.insert(ndx, x)\n end\n end\n return false\nend",
"title": ""
},
{
"docid": "4f4e5891c91835656b5e1a62e7bd058f",
"score": "0.71061677",
"text": "def sum_to_n?(ints, n)\n return n == 0 if ints.size == 0\n (0...ints.size).each_with_index do |i|\n (i+1...ints.size).each do |j|\n return true if (ints[i]+ints[j]==n)\n end\n end\n return false\nend",
"title": ""
}
] |
4f6d88706090aeafe613745da925515b
|
POST /reservations POST /reservations.json
|
[
{
"docid": "d70274bdd8d61886f761f6c386a2065a",
"score": "0.63875705",
"text": "def create\n Reservation.transaction do\n @reservation = Reservation.new(reservation_params)\n @reservation.room.lock!\n\n respond_to do |format|\n if @reservation.save\n @invoke_slack_webhook = true\n format.html { redirect_to @reservation, notice: '予約を登録しました' }\n format.json { render :show, status: :created, location: @reservation }\n if @reservation.room_id == 0 && !ENV[\"SCHEDULE_EMAIL_ADDRESS\"].blank?\n ScheduleMailer.schedule_mail(@reservation).deliver_now\n end\n else\n @invoke_slack_webhook = false\n format.html do\n set_rooms\n render :new\n end\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "d3a615577be5ff45806e41103b3d7cd1",
"score": "0.7194829",
"text": "def create\n @reservation = Reservation.new(reservation_params)\n\n if @reservation.save\n render :show, status: :created, location: @reservation\n else\n render json: @reservation.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "aec61a93fac14d1835227adb20d49b55",
"score": "0.71601593",
"text": "def create_reservations\n Time.use_zone(@timezone) do\n @reservations = build_reservations\n return nil unless @reservations.any?\n @reservations = commit_reservations(@reservations)\n return nil unless valid? && @reservations.all?(&:persisted?)\n charge(@reservations) && @reservations.each(&:reload) if @pay\n track(@reservations)\n\n @reservations\n end\n end",
"title": ""
},
{
"docid": "c29eacb38395ca9f72c64769997873a6",
"score": "0.71428454",
"text": "def create\n @reservation = Reservation.new(reservation_params)\n\n respond_to do |format|\n if @reservation.save\n format.html { redirect_to @reservation, notice: 'Reservation was successfully created.' }\n format.json { render :show, status: :created, location: @reservation }\n else\n format.html { render :new }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c29eacb38395ca9f72c64769997873a6",
"score": "0.71428454",
"text": "def create\n @reservation = Reservation.new(reservation_params)\n\n respond_to do |format|\n if @reservation.save\n format.html { redirect_to @reservation, notice: 'Reservation was successfully created.' }\n format.json { render :show, status: :created, location: @reservation }\n else\n format.html { render :new }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "15aba820a67960cca8fe4ac5e21c1111",
"score": "0.712994",
"text": "def index\n render json: reservations\n end",
"title": ""
},
{
"docid": "7979782736829ac5d1dcd32e15e06f89",
"score": "0.71228033",
"text": "def create\r\n @reservation = Reservation.new(reservation_params)\r\n respond_to do |format|\r\n if @reservation.save\r\n format.html { redirect_to reservations_path, notice: 'Reservation was successfully created.' }\r\n format.json { render :show, status: :created, location: @reservation }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "62ff8f1bb0d54a7974be81862fd7c1c9",
"score": "0.70948815",
"text": "def create\n @reservation = Reservation.new(reservation_params)\n\n respond_to do |format|\n if @reservation.save\n format.html { redirect_to @reservation, notice: 'Reservation was successfully created.' }\n format.json { render json: @reservation, status: :created, location: @reservation }\n else\n format.html { render action: \"new\" }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "28a33b37385b9f88bc393b6ba0cdca41",
"score": "0.70198965",
"text": "def create\n @reservation_room = ReservationRoom.new(reservation_room_params)\n @reservations = Reservation.all\n \n respond_to do |format|\n if @reservation_room.save\n format.html { redirect_to @reservation_room, notice: 'La habitacion se ha asignado a la reserva correctamente.' }\n format.json { render action: 'show', status: :created, location: @reservation_room }\n else\n format.html { render action: 'new' }\n format.json { render json: @reservation_room.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d757e97a04e7971403922da46a35d35b",
"score": "0.69830203",
"text": "def create\n @reservation = Reservation.new(reservation_params)\n\n if @reservation.save\n render 'api/reservations/show'\n else\n render json: @reservation.errors.full_messages, status: 422\n\n end \n\n\n end",
"title": ""
},
{
"docid": "f4b8bd92fc6cf0a3f75c170d3f35acca",
"score": "0.69494975",
"text": "def create\n @reservation = Reservation.new(reservation_params)\n @reservation.user = current_user\n @reservation.flight = flight\n\n if @reservation.save\n render json: @reservation\n else\n render json: @reservation.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "989a4aeb2be7362b02f6a748c3d5128d",
"score": "0.69224215",
"text": "def create\n @reservation = Reservation.new(reservation_params)\n @reservation.apartment_id = @apartment.id\n respond_to do |format|\n if @reservation.save\n format.html { redirect_to apartment_reservations_path(@apartment), notice: 'Apartamento Reservado.' }\n format.json { render :show, status: :created, location: @reservation }\n else\n format.html { render :new }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d465494c218fff298d620c260bdeb359",
"score": "0.6903804",
"text": "def set_reservations\n @reservation = Reservation.find(params[:id])\n end",
"title": ""
},
{
"docid": "d465494c218fff298d620c260bdeb359",
"score": "0.6903804",
"text": "def set_reservations\n @reservation = Reservation.find(params[:id])\n end",
"title": ""
},
{
"docid": "5cc1a509c6aa71bb537a19152ff444ab",
"score": "0.68938017",
"text": "def create\n @reservation = current_user.reservations.new(params[:reservation])\n\n respond_to do |format|\n if @reservation.save\n format.html { redirect_to @reservation, notice: 'Reservation was successfully created.' }\n format.json { render \"reservations/show\", success: true, status: :created, location: @reservation }\n else\n format.html {\n @menu_items = MenuItem.of_the_next_seven_days.includes(:restaurant)\n @restaurants = @menu_items.collect { |menu_item| menu_item.restaurant }\n render action: \"new\"\n }\n format.json {\n render json: @reservation.errors, status: :unprocessable_entity\n }\n end\n end\n end",
"title": ""
},
{
"docid": "c4d42e822fe1aa89377e662ead51ad6c",
"score": "0.6892847",
"text": "def create\n @reservation = Reservation.new(reservation_params)\n @reservation.requester = current_user\n if params[:reservation][:nook_id]\n @nook = Nook.find(params[:reservation][:nook_id])\n @reservation.nook = @nook\n end\n\n respond_to do |format|\n if @reservation.save\n format.html {\n flash[:notice] = t('reservations.submitted')\n if request.xhr?\n render text: nooks_url\n else\n redirect_to nooks_path\n end\n }\n format.json { render :show, status: :created, location: @reservation }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3751bc3eb8010aa3baa0f04898171c5b",
"score": "0.68807656",
"text": "def create\n @reservation = Reservation.new(params[:reservation])\n @reservation.user_id = current_user.id\n\n respond_to do |format|\n if @reservation.save\n format.html { redirect_to @reservation, notice: 'Reservation was successfully created.' }\n format.json { render json: @reservation, status: :created, location: @reservation }\n else\n format.html { render action: \"new\" }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e666c4d5898833e9691dff838a8a1a56",
"score": "0.68263024",
"text": "def create\n @reservation = @brewery.reservations.new(reservation_params)\n\n respond_to do |format|\n if @reservation.save\n format.html { notification }\n format.json { render :show, status: :created, location: @reservation }\n else\n format.html { render :new }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "43ea76b927e5c9c005f36069833718f3",
"score": "0.6802514",
"text": "def create\n reservation = Reservation.new(reserve_params)\n respond_to do |format|\n if reservation.update(reserve_params)\n format.html { render :show,:locals => {:reservation => reservation}, notice: 'Reservation was successfully created.' }\n format.json { render :show,:locals => {:reservation => reservation}, status: :ok, location: reservation }\n else\n format.html { render :edit,:locals => {:reservation => reservation} }\n format.json { render json: reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2aea03c1f542c12eb1d5ad16be2e8fb8",
"score": "0.6785529",
"text": "def create\n # @reservation = Reservation.new(reservation_params)\n @reservation = current_user.reservations.create!(reservation_params)\n\n respond_to do |format|\n if @reservation.save\n format.html { redirect_to @reservation, notice: 'Reservation was successfully created.' }\n format.json { render :show, status: :created, location: @reservation }\n else\n format.html { render :new }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n # current_user.book! @reservation\n end",
"title": ""
},
{
"docid": "0d9fa55e32e88302c640f940bf92ccc3",
"score": "0.67699766",
"text": "def create\n @reservation = V2::Reservation.new(reservation_params)\n if @reservation.save\n flash[:notice] = \"An interview has been booked for #{@reservation.time_slot.start_datetime_human}\"\n send_notifications(@reservation)\n else\n flash[:error] = \"No time slot was selected, couldn't create the reservation\"\n end\n @available_time_slots = []\n @person = @reservation.person\n respond_to do |format|\n format.js {}\n format.html { render :new }\n end\n end",
"title": ""
},
{
"docid": "b317e2ec9e882ff17a7fdf77ad7b7d28",
"score": "0.6744805",
"text": "def create\r\n @reservation = Reservation.new(reservation_params)\r\n @reservation.user = current_user\r\n\r\n respond_to do |format|\r\n if @reservation.save\r\n format.html { redirect_to @reservation, notice: 'Reservation was successfully created.' }\r\n format.json { render :show, status: :created, location: @reservation }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "e5ad5ee315141d2bbde55d91b258ca7a",
"score": "0.6721879",
"text": "def index\n @reservations = Reservation.all\n end",
"title": ""
},
{
"docid": "e5ad5ee315141d2bbde55d91b258ca7a",
"score": "0.6721879",
"text": "def index\n @reservations = Reservation.all\n end",
"title": ""
},
{
"docid": "e5ad5ee315141d2bbde55d91b258ca7a",
"score": "0.6721879",
"text": "def index\n @reservations = Reservation.all\n end",
"title": ""
},
{
"docid": "e5ad5ee315141d2bbde55d91b258ca7a",
"score": "0.6721879",
"text": "def index\n @reservations = Reservation.all\n end",
"title": ""
},
{
"docid": "e5ad5ee315141d2bbde55d91b258ca7a",
"score": "0.6721879",
"text": "def index\n @reservations = Reservation.all\n end",
"title": ""
},
{
"docid": "e5ad5ee315141d2bbde55d91b258ca7a",
"score": "0.6721879",
"text": "def index\n @reservations = Reservation.all\n end",
"title": ""
},
{
"docid": "e5ad5ee315141d2bbde55d91b258ca7a",
"score": "0.6721879",
"text": "def index\n @reservations = Reservation.all\n end",
"title": ""
},
{
"docid": "e5ad5ee315141d2bbde55d91b258ca7a",
"score": "0.6721879",
"text": "def index\n @reservations = Reservation.all\n end",
"title": ""
},
{
"docid": "e5ad5ee315141d2bbde55d91b258ca7a",
"score": "0.6721879",
"text": "def index\n @reservations = Reservation.all\n end",
"title": ""
},
{
"docid": "e5ad5ee315141d2bbde55d91b258ca7a",
"score": "0.6721879",
"text": "def index\n @reservations = Reservation.all\n end",
"title": ""
},
{
"docid": "e5ad5ee315141d2bbde55d91b258ca7a",
"score": "0.6721879",
"text": "def index\n @reservations = Reservation.all\n end",
"title": ""
},
{
"docid": "e5ad5ee315141d2bbde55d91b258ca7a",
"score": "0.6721879",
"text": "def index\n @reservations = Reservation.all\n end",
"title": ""
},
{
"docid": "e5ad5ee315141d2bbde55d91b258ca7a",
"score": "0.6721879",
"text": "def index\n @reservations = Reservation.all\n end",
"title": ""
},
{
"docid": "e5ad5ee315141d2bbde55d91b258ca7a",
"score": "0.6721879",
"text": "def index\n @reservations = Reservation.all\n end",
"title": ""
},
{
"docid": "e5ad5ee315141d2bbde55d91b258ca7a",
"score": "0.6721879",
"text": "def index\n @reservations = Reservation.all\n end",
"title": ""
},
{
"docid": "91a26dacd5e0dba61f7476d0868f2398",
"score": "0.66995794",
"text": "def create\n @employee_reservation = Employee::Reservation.new(employee_reservation_params)\n\n respond_to do |format|\n if @employee_reservation.save\n format.html { redirect_to @employee_reservation, notice: 'Reservation was successfully created.' }\n format.json { render :show, status: :created, location: @employee_reservation }\n else\n format.html { render :new }\n format.json { render json: @employee_reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "897fbf884b62ab63fe6fa26ba6a03ea3",
"score": "0.6638075",
"text": "def index\n unless User.admin_by_token?(request.cookies[\"token\"])\n render json: { error: \"invalid_token\" }, status: :unauthorized\n return\n end\n\n @reservations = prep_reservation\n render json: @reservations, status: :ok\n end",
"title": ""
},
{
"docid": "871be400fa8c663894db82888beaf02e",
"score": "0.66370046",
"text": "def create\n res = Reservation.create(\n row: params[:row],\n col: params[:col],\n user_id: params[:user_id], # DON'T DO THIS! Use current_user\n flight_id: params[:flight_id]\n )\n\n if res.persisted?\n # Send back the reservation object that was successfully created\n render json: res\n else\n # Send back an error hash, including the ActiveRecord validation error messages\n render json: { error: true, messages: res.errors.full_messages }\n end\n end",
"title": ""
},
{
"docid": "8f8ff5f4a3fe5744a0511a9f556fb1cb",
"score": "0.66340756",
"text": "def create\n @reserve = Reserf.new(reserf_params)\n\n respond_to do |format|\n if @reserve.save\n format.html { redirect_to @reserve, notice: 'Reserf was successfully created.' }\n format.json { render :show, status: :created, location: @reserve }\n else\n format.html { render :new }\n format.json { render json: @reserve.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6bba0a4222ce4fc964cc8dd559e822e5",
"score": "0.65942657",
"text": "def index\n @reservations = Reservation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reservations }\n end\n end",
"title": ""
},
{
"docid": "6bba0a4222ce4fc964cc8dd559e822e5",
"score": "0.65942657",
"text": "def index\n @reservations = Reservation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reservations }\n end\n end",
"title": ""
},
{
"docid": "2359034662806c3d3e1ac18149879640",
"score": "0.6578979",
"text": "def create\n reservation_id = SecureRandom.uuid\n\n Reservation::Worker::Process.perform_async(reservation_id, Time.zone.now.to_i, reservation_params)\n\n render json: { reservation_id: reservation_id }, status: 200\n end",
"title": ""
},
{
"docid": "aa426751469b2d0b436db502cd118d90",
"score": "0.657712",
"text": "def create \n p_name = params[:reservation][:name]\n p_amount_people = params[:reservation][:amount_people]\n p_year1 = params[:reservation][\"arrive_date(1i)\"].to_i\n p_month1 = params[:reservation][\"arrive_date(2i)\"].to_i\n p_day1 = params[:reservation][\"arrive_date(3i)\"].to_i\n p_year2 = params[:reservation][\"departure_date(1i)\"].to_i\n p_month2 = params[:reservation][\"departure_date(2i)\"].to_i\n p_day2 = params[:reservation][\"departure_date(3i)\"].to_i\n p_needs = params[:reservation][:needs].split(' ')\n p_activities = params[:reservation][:activities].split(' ')\n\n @reservation = Reservation.new(\n username: @username_actual,\n name: p_name,\n amount_people: p_amount_people,\n arrive_date: Date.new(\n p_year1,\n p_month1,\n p_day1\n ),\n departure_date: Date.new(\n p_year2,\n p_month2,\n p_day2\n ),\n needs: p_needs,\n activities: p_activities\n )\n\n respond_to do |format|\n if @reservation.save\n format.html { redirect_to @reservation, notice: 'Reservation was successfully created.' }\n format.json { render :show, status: :created, location: @reservation }\n else\n format.html { render :new }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d6bb07c740743b11088181b40febd1d0",
"score": "0.6575071",
"text": "def create\n @agenda_reserv_resource = Agenda::ReservResource.new(agenda_reserv_resource_params)\n if @agenda_reserv_resource.save\n flash[:success] = t('notices.saved_successfully')\n index\n end\n\n end",
"title": ""
},
{
"docid": "d25791a6762c1e982c209f74cd70e94d",
"score": "0.6552193",
"text": "def create\n @reservation = Reservation.new(params[:reservation])\n\n respond_to do |format|\n if @reservation.save\n EventNotification.notify_admin(@reservation).deliver\n format.html { redirect_to @reservation, notice: 'Reservation was successfully created.' }\n format.json { render :show, status: :created, location: @reservation }\n else\n format.html { render :new }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6d4f8a51507eddb06e9e7f14a440fa9e",
"score": "0.6526984",
"text": "def create\n @reservation = Reservation.new(reservation_params) \n respond_to do |format|\n if @reservation.save\n\n Reservation.last.reservation_rooms.each do |reservation|\n #Cambio el estado de la habitacion\n reservation.update({start: reservation.check_in, end: (reservation.check_out.to_date)+1,title: \"Reserva: \"+Room.find(reservation.room_id).identificador ,textColor: \"#ffffff\"})\n #Le pongo check_in y check_out para el calendario\n Room.find(reservation.room_id).update({state_id: 3})\n end\n\n format.html { redirect_to reservations_path(), notice: 'Reservacion creada exitosamente.' }\n #format.json { render :show, status: :created, location: @reservation }\n else\n #@my_reservation_requests = ReservationRequest.find(reservation_params[:reservation_request_id])\n #@reservation.reservation_requests.build()\n @reservation.reservation_rooms.build() \n format.html { render :new }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fac6ad8038c08a2a5d6599197fe91956",
"score": "0.6525996",
"text": "def reservations\n @reservations ||= flight.reservations\n end",
"title": ""
},
{
"docid": "b802692d498d333d4695b3509a6fe48c",
"score": "0.65077025",
"text": "def create\n @reservation = Reservation.new(reservation_params)\n\n # to help with creation errors:\n @reservation.customer = current_customer \n @reservation.restaurant = @restaurant \n\n respond_to do |format|\n if @reservation.save\n format.html { redirect_to @reservation, notice: 'Reservation was successfully created.' }\n format.json { render :show, status: :created, location: @reservation }\n else\n format.html { render :new }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8ebfc90a9b0294f3d278ef9ea9416682",
"score": "0.64977974",
"text": "def create\n @reservation = @space.reservations.build(reservation_params.merge(user: authed_user))\n\n respond_to do |format|\n if @reservation.save\n ReservationMailer.created_email(@reservation, root_url.gsub(/\\/$/, '')).deliver_later\n format.html { redirect_to [@reservation.space.location.org, @reservation.space.location, @reservation.space, @reservation], notice: 'Reservation was successfully created.' }\n format.json { render :show, status: :created, location: [@reservation.space.location.org, @reservation.space.location, @reservation.space, @reservation] }\n else\n format.html { render :new }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "708da8edd0889b417bfb28e6b732f604",
"score": "0.6480432",
"text": "def create\n @reserf = Reserve.new(params[:reserf])\n\n respond_to do |format|\n if @reserf.save\n format.html { redirect_to @reserf, notice: 'Reserve was successfully created.' }\n format.json { render json: @reserf, status: :created, location: @reserf }\n else\n format.html { render action: \"new\" }\n format.json { render json: @reserf.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "27d88cdb8126c16c3ebecde332fad980",
"score": "0.64765817",
"text": "def create\n write_log(\"in create -\\n\")\n @reservation = Reservation.new(reservation_params)\n @user = User.find(session[:current_user_id])\n respond_to do |format|\n if @reservation.save\n UserMailer.reservation_confirmation(@user, @reservation).deliver\n UserMailer.car_repair_appointment(@user, @reservation).deliver\n\n format.html { redirect_to @reservation, notice: 'Reservation was successfully created.' }\n format.json { render :show, status: :created, location: @reservation }\n else\n format.html { render :new }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "80bada6e8ff648838a7ca21e811b07c9",
"score": "0.6465524",
"text": "def new\n @reservation = Reservation.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reservation }\n end\n end",
"title": ""
},
{
"docid": "943112fab45468869ae3a49b94eb615c",
"score": "0.6464808",
"text": "def new\n @reservation = Reservation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reservation }\n end\n end",
"title": ""
},
{
"docid": "943112fab45468869ae3a49b94eb615c",
"score": "0.6464808",
"text": "def new\n @reservation = Reservation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reservation }\n end\n end",
"title": ""
},
{
"docid": "943112fab45468869ae3a49b94eb615c",
"score": "0.6464808",
"text": "def new\n @reservation = Reservation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reservation }\n end\n end",
"title": ""
},
{
"docid": "d5112e125dbff3190cf6a14fea1ebf1b",
"score": "0.64629805",
"text": "def create\n @user = User.user_by_token(request.cookies[\"token\"])\n return unless valid_form?\n\n @reservation = Reservation.new(reservation_params)\n @reservation.user = @user\n\n render json: { error: \"The time selected is not available.\" }, status: :unauthorized and return unless valid_time?\n render json: { error: \"Reservation time too long.\" }, status: :unauthorized and return false unless valid_length?\n unless valid_vaccine?\n render json: { error: \"You must be vaccinated to use this amenity.\" }, status: :unauthorized and return false\n end\n\n save_reservation\n end",
"title": ""
},
{
"docid": "bd2b4b9a05ca5c248be33d4dd9d92b2c",
"score": "0.6461867",
"text": "def create\n @reservation = Reservation.new(params[:reservation])\n @reservation.user_id = current_user.id\n\n respond_to do |format|\n if @reservation.save\n\n # UserMailer.booking_create(current_user, @reservation).deliver\n # OwnerMailer.booking_create(@reservation).deliver\n\n Reward.create( user_id: @reservation.user_id, \n reservation_id: @reservation.id, \n points_total: 5*@reservation.party_size, \n points_pending: 5*@reservation.party_size, \n description: \"\")\n \n format.html { redirect_to @reservation, notice: 'Reservation was successfully created.' }\n format.json { render json: @reservation, status: :created, location: @reservation }\n else\n format.html { render action: \"new\" }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2b660901a5acf1dd0576202bc7888c07",
"score": "0.6456549",
"text": "def create\n @reserf = Reserve.new(reserf_params)\n @reserf.busy = true\n\n respond_to do |format|\n if @reserf.save\n format.html { redirect_to root_path, notice: 'Reserve was successfully created.' }\n format.json { render :show, status: :created, location: @reserf }\n else\n format.html { render :new }\n format.json { render json: @reserf.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8e6e2afc13e2d9283d68fd188f0964b4",
"score": "0.64530915",
"text": "def create\n @reservation = Reservation.new(params[:reservation])\n if user_signed_in?\n @reservation.user_id = current_user.id\n elsif owner_signed_in?\n @reservation.owner_id = current_owner.id\n @reservation.restaurant = current_owner.restaurant\n end\n\n respond_to do |format|\n if @reservation.save\n\n if user_signed_in?\n Reward.create( user_id: @reservation.user_id, \n reservation_id: @reservation.id, \n points_total: 5*@reservation.party_size, \n points_pending: 5*@reservation.party_size, \n description: \"\")\n end\n \n if user_signed_in?\n format.html { redirect_to @reservation, notice: 'Reservation was successfully created.' }\n format.json { render json: @reservation, status: :created, location: @reservation }\n else\n format.html { redirect_to root_url, notice: 'Reservation was successfully created.' }\n end\n\n # UserMailer.booking_create(current_user, @reservation).deliver\n # OwnerMailer.booking_create(@reservation).deliver\n else\n format.html { render action: \"new\" }\n # format.html { redirect_to new_reservation_path(reservation: params[:reservation]) }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n\n end\n end",
"title": ""
},
{
"docid": "cf2f2ec050ba4a180d9c4ee2085cadeb",
"score": "0.6445499",
"text": "def create\n @reservation = Reservation.new(params[:reservation])\n @reservation.status = \"Pending\"\n @reservation.user = current_user\n\n place = Place.find_by_id(params[:reservation][:place_id])\n\n @reservation.object_resources << place.object_resources if place\n\n respond_to do |format|\n if @reservation.save\n format.html { redirect_to @reservation, notice: 'Reservation was successfully created.' }\n format.json { render json: @reservation, status: :created, location: @reservation }\n else\n format.html { render action: \"new\" }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "84823e6b02f7009bc184c7e5ca4d3504",
"score": "0.6439823",
"text": "def create\n @reservacion = Reservacion.new(reservacion_params)\n\n respond_to do |format|\n if @reservacion.save\n format.html { redirect_to @reservacion, notice: 'Su solicitud fue realizada satisfactoriamente.' }\n format.json { render :show, status: :created, location: @reservacion }\n else\n format.html { render :new }\n format.json { render json: @reservacion.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e13372ad0363dd7476eee977b75fc115",
"score": "0.64362824",
"text": "def create\n @agenda_reservation = Agenda::Reservation.new(agenda_reservation_params)\n if @agenda_reservation.save\n flash[:success] = t('notices.saved_successfully')\n index\n end\n end",
"title": ""
},
{
"docid": "380dd573743099baf865789ea08ebdb5",
"score": "0.6419914",
"text": "def create\n sr = SeatReservation.reserve_seat(@customer, params[:seat_id])\n\n # NJS - what to return back? just a success msg?\n respond_to do |format|\n format.json { render json: {reservation_id: sr.id}} \n end\n end",
"title": ""
},
{
"docid": "cd3a2b5be6ef2eac68877ae72856790d",
"score": "0.6416876",
"text": "def index\n @reservations = @apartment.reservations.all\n end",
"title": ""
},
{
"docid": "3968a3fc5cee6436cfb2b96aabb6f334",
"score": "0.64110094",
"text": "def reservation_params\n params.require('reservation').permit('user_id', 'event_id')\n end",
"title": ""
},
{
"docid": "7a30b2a340517d7991fae4f792679f17",
"score": "0.6402599",
"text": "def create\n @reservation = Reservation.new(reservation_params)\n @user = current_user\n @date = (@reservation.reserved_on).to_formatted_s(:long_ordinal)\n @date_of_return = (@reservation.reserved_on + 1.month).to_formatted_s(:long_ordinal)\n respond_to do |format|\n if @reservation.save\n ReservationMailer.create_reservation_notifier(@user, @date, @date_of_return).deliver\n format.html { redirect_to reservations_url, notice: 'Reservation was successfully created.' }\n format.json { render action: 'show', status: :created, location: @reservation }\n else\n format.html { render action: 'new' }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cde57c8726c20e14c400204f0d5b67d3",
"score": "0.6399112",
"text": "def reservation_params\n params.require(:reservation).permit(:user_id, :listing_id, :start_date, :end_date, :guest_number, :verified)\n end",
"title": ""
},
{
"docid": "47f8abe9899b9fef5577870d35ef7058",
"score": "0.6397793",
"text": "def create\n\n @reservation = Reservation.new(reservation_params)\n\n @passenger = Passenger.new\n @passengers = Passenger.all\n @enterprise = Enterprise.new\n @enterprises = Enterprise.all\n @rooms = Room.all\n @groups = Group.all\n @room_types = RoomType.all\n\n respond_to do |format|\n if @reservation.guardar( new_reservation_rooms )\n format.html { redirect_to @reservation, notice: 'La reserva se ha registrado correctamente.' }\n format.json { render action: 'show', status: :created, location: @reservation }\n else\n format.html { render action: 'new' }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "48e09dbfdcbd7dec76271ac558031543",
"score": "0.639481",
"text": "def index\n @reservations = @user.reservations\n @reservations_json = []\n @reservations.each do |r|\n ro = r\n r = r.as_json\n %w{arrived email no_show owner_id}.each {|k| r.delete(k)}\n r[:start_time] = ro.start_time_format\n r[:end_time] = ro.end_time_format\n @reservations_json << r\n end\n\n render json: @reservations_json, status: 200 \n end",
"title": ""
},
{
"docid": "51c3c9cc96eb1b893f371d424553214c",
"score": "0.6390856",
"text": "def create\n @reservation = Reservation.new(params[:reservation])\n\n respond_to do |format|\n if @reservation.save\n format.js\n format.html { redirect_to @reservation, notice: 'Reservation was successfully created.' }\n format.json { render json: @reservation, status: :created, location: @reservation }\n else \n format.js\n format.html { render action: \"new\" }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6d95ce4cd0b3bd5c5c29aad3c34bdd3e",
"score": "0.6386643",
"text": "def reservation_params\n params.require(:reservation).permit(:name, :amount_people, :arrive_date, :departure_date, :needs, :activities)\n end",
"title": ""
},
{
"docid": "451760a4fdf1afe5af9e3a924cefbfc5",
"score": "0.638616",
"text": "def create\n format_time_input\n check_input\n @reservation = Reservation.new(reservation_params)\n @reservation.status = :requested\n respond_to do |format|\n # TODO: Duplication\n if @conflicts.any?\n respond_to_conflicts :new, format\n elsif @reservation.save\n notify_approval_needed\n respond_to_update format\n else\n respond_to_errors :new, format\n end\n end\n end",
"title": ""
},
{
"docid": "817bf10a094f9843a9d77a11efd988dc",
"score": "0.6385065",
"text": "def create\n @reservation_detail = ReservationDetail.new(reservation_detail_params)\n\n respond_to do |format|\n if @reservation_detail.save\n format.html { redirect_to @reservation_detail, notice: \"Reservation detail was successfully created.\" }\n format.json { render :show, status: :created, location: @reservation_detail }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @reservation_detail.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9cf5823c9e8d8ff1f3326e6625600f31",
"score": "0.63745254",
"text": "def create\n space = Space.find(params[:space_id])\n group = Group.find(space.group_id)\n group_member_ids = Member.where(group_id: group.id).pluck(:user_id)\n unless group_member_ids.include?(@current_user.id)\n return render json: { message: \"You are not permitted to perform this operation.\" }, status: :forbidden\n end\n @reservation = Reservation.new(reservation_params)\n\n if @reservation.save\n render json: @reservation, status: :created\n else\n render json: @reservation.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "0089072d14de0405afe45c8f52b91406",
"score": "0.63689995",
"text": "def create\n @reservation_owner = ReservationOwner.new(reservation_owner_params)\n\n respond_to do |format|\n if @reservation_owner.save\n format.html { redirect_to @reservation_owner, notice: 'Reservation owner was successfully created.' }\n format.json { render :show, status: :created, location: @reservation_owner }\n else\n format.html { render :new }\n format.json { render json: @reservation_owner.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5f8399598d9be0624d15daf357e21eb3",
"score": "0.63581693",
"text": "def create\n @reservation = Reservation.new(reservation_params)\n\n total_due = @reservation.get_total_due\n @reservation[:total_due] = total_due\n @reservation.save\n\n respond_to do |format|\n\n if @reservation.persisted?\n format.html { redirect_to @reservation, notice: 'Reservation was successfully created.' }\n format.json { render json: @reservation, include:['property'] }\n else\n format.html { render :new }\n format.json { render json: { status: 401, errors: @reservation.errors } }\n\n # for the API create\n # headers['Access-Control-Allow-Origin'] = '*'\n # reservation = Reservation.create reservation_params\n #\n # render json: reservation, include: ['flight', 'user']\n end\n end\n end",
"title": ""
},
{
"docid": "5c67cdd4c16d3df211eb8a74012c1327",
"score": "0.63449836",
"text": "def index\n @reservations = @bus.reservations\n end",
"title": ""
},
{
"docid": "1e6399ffd3ee3b7f2916599b7b953ed4",
"score": "0.6324336",
"text": "def reservation_params\n params.require(:reservation).permit(:user_id, :restaurant_id, :seats, :date, :time)\n end",
"title": ""
},
{
"docid": "fdbb7898a2a368921bf1609585181c83",
"score": "0.6322678",
"text": "def create\n @reservationdetail = Reservationdetail.new(reservationdetail_params)\n\n respond_to do |format|\n if @reservationdetail.save\n format.html { redirect_to reservation_reservationdetail_url(@reservation, @reservationdetail), notice: 'Reservationdetail was successfully created.' }\n format.json { render :show, status: :created, location: @reservationdetail }\n else\n format.html { render :new }\n format.json { render json: @reservationdetail.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d27ad0eabe4c952af35b2f9c32c0816b",
"score": "0.63098854",
"text": "def reserve(*args)\n @reservations << Reservation.new(self, *args)\n end",
"title": ""
},
{
"docid": "37da6ea68f180a179225493ddc1cff62",
"score": "0.63039684",
"text": "def reservation_params\n params.require(:reservation).permit(:from_date, :to_date, :property_id, :guests_count, :booking_code)\n end",
"title": ""
},
{
"docid": "97a244bde2de5c0a25f7e67fd6fe99c6",
"score": "0.63008577",
"text": "def create\n=begin temp = params[:reserf]\n temp[\"roomname\"] = params[:room][\"roomname\"]\n @reserf = Reserve.new(temp)\n @roomtype = DetailRoom.all_types\n @time = Room.all_times\n @day_list = Room.all_days\n respond_to do |format|\n if @reserf.save\n format.html { redirect_to result_path(@reserf), notice: 'Reserve was successfully created.' }\n format.json { render json: @reserf, status: :created, location: @reserf }\n else\n format.html { render action: \"new\" }\n format.json { render json: @reserf.errors, status: :unprocessable_entity }\n end\n end\n=end\n end",
"title": ""
},
{
"docid": "8346a1bfdeb68d5ae043fd7987720cb3",
"score": "0.6295304",
"text": "def create\n \treserve_params = params[:reservation]\n @reserve = current_user.reservations.new(:category_id => reserve_params[:category_id], :date_in => reserve_params[:date_in], :date_out => reserve_params[:date_out], :room_id => reserve_params[:room_id])\n reserved = Reservation.is_reserved(reserve_params[:room_id],reserve_params[:date_in],reserve_params[:date_out])\n unless reserved\n respond_to do |format|\n if @reserve.save\n format.html { redirect_to myrooms_path, notice: 'Room has been booked' }\n format.json { render :show, status: :created, location: @reserve }\n else\n format.html { render :new }\n format.json { render json: @reserve.errors, status: :unprocessable_entity }\n end\n end\n else\n respond_to do |format|\n format.html { redirect_to myrooms_path, notice: 'The Room is already Booked' }\n end\n end\n end",
"title": ""
},
{
"docid": "566b450c062200e4a5130e6ae4363034",
"score": "0.62943083",
"text": "def create\n @space_reservation = SpaceReservation.new(space_reservation_params)\n\n respond_to do |format|\n if @space_reservation.save\n format.html { redirect_to @space_reservation, notice: 'Space reservation was successfully created.' }\n format.json { render :show, status: :created, location: @space_reservation }\n else\n format.html { render :new }\n format.json { render json: @space_reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e1e5d04d825960026c501f3d04b37a02",
"score": "0.629107",
"text": "def create\n @reservation = Reservation.new(params[:reservation])\n\n respond_to do |format|\n if @reservation.save\n format.html { redirect_back_or_default home_url }\n #format.html { redirect_to(@reservation, :notice => 'Reservation was successfully created.') }\n format.xml { render :xml => @reservation, :status => :created, :location => @reservation }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @reservation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "299110aa2d47650aa8e3130cb7525596",
"score": "0.6287645",
"text": "def index\n @reservations = V2::Reservation.order(id: :desc).page(params[:page])\n end",
"title": ""
},
{
"docid": "703554a74613b3d41d587c41d002ec8b",
"score": "0.62510026",
"text": "def reservation_params\n params.require(:reservation).permit(:start_at, :end_at, :usage)\n end",
"title": ""
},
{
"docid": "a878d9750cc02311a0039654aac1539e",
"score": "0.625096",
"text": "def reservation_params\n params.require(:reservation).permit(:user_id, :restaurant_id, :time, :date, :head_count,\n :special_request, :cancel)\n end",
"title": ""
},
{
"docid": "0d4cdda1b436029b74b5df10eae46daf",
"score": "0.6246499",
"text": "def show_reservations\n user = User.find(current_user.id)\n @reservations = user.reservations\n end",
"title": ""
},
{
"docid": "1ead6547c0f7870c58768f9fa4e4e040",
"score": "0.62380636",
"text": "def reservation_params\n params.require(:reservation).permit(:reserved_on, :book_id, :user_id)\n end",
"title": ""
},
{
"docid": "500ee739737e31b7e06701ae53dda83d",
"score": "0.6237938",
"text": "def reservation_params\n params.require(:reservation).permit(:passenger_id, :enterprise_id, :amount, :observation)\n end",
"title": ""
},
{
"docid": "8cb2dcb0a5bc191eac6191ee9e02675b",
"score": "0.62339413",
"text": "def new\n unless r = params['reservation-times'] || session['reservation-times']\n return select_times_first\n end\n resource_id = r.keys.first\n sll_times = r[resource_id] \n return select_times_first if sll_times.blank?\n\n @reservation = Reservation.new({ \n :start_datetime => Time.parse(sll_times.first), \n :end_datetime => Time.parse(sll_times.last) + 1.hour,\n :resource_id => resource_id\n })\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reservation }\n end\n end",
"title": ""
},
{
"docid": "b1582d41603f367f1890443cc8990365",
"score": "0.62253594",
"text": "def reservation_params\n params.require(:reservation).permit(:name, :start, :end, :description,\n :url, :stream_url, :notes)\n end",
"title": ""
},
{
"docid": "b80c5ce91bf5516dbcc27cea85f645c0",
"score": "0.62233",
"text": "def reservation_params\n params.require(:reservation).permit(:beginning_date, :ending_date, :rate, :host_id, :booking_id)\n end",
"title": ""
},
{
"docid": "cf43bc9f55512fd5891d15094c73f103",
"score": "0.6215225",
"text": "def create\n @reservation = Reservation.new(params[:reservation])\n\n @reservation.assign_attributes(:user_id => current_user.try(:id))\n \n respond_to do |format|\n if @reservation.save\n ReservationMailer.notification(@reservation, @reservation.user).deliver\n format.html { redirect_to reservations_path, notice: 'Reservation was successfully created.' }\n format.json { render json: @reservation, status: :created, location: @reservation }\n else\n format.html { render action: \"new\" }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6aa20fbf0819d7da63cbed9f83394215",
"score": "0.62095606",
"text": "def new\n @reservation = Reservation.new\n @outlet = params[:outlet]\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reservation }\n end\n end",
"title": ""
},
{
"docid": "26dd428e59f98c991caf4b101a3bc4c3",
"score": "0.6198604",
"text": "def create\n @reserved = Reserved.new(reserved_params)\n\n respond_to do |format|\n if @reserved.save\n format.html { redirect_to @reserved, notice: 'Reserved was successfully created.' }\n format.json { render :show, status: :created, location: @reserved }\n else\n format.html { render :new }\n format.json { render json: @reserved.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "46b00cf752eadc3ee8957a2c0e4acb5d",
"score": "0.61952776",
"text": "def reservation_params\n params.require(:reservation).permit(:user_id, :resource_id, :start_time, :end_time, :resource_id)\n end",
"title": ""
},
{
"docid": "4ebdb2e8655806315ef92a5a6e7878f1",
"score": "0.6193742",
"text": "def make_reservation\n \n node_obj = Nodes.new\n hash_details_of_resources = node_obj.get_details_of_resources\n \n # finds which resources are for reservation\n ids = []\n reservations = []\n reservations = params[:reservations]\n # puts \"Autes einai oi krathseis pou thelw na kanw\"\n # puts reservations\n\n # control for empty request for reservation\n reservation_table = []\n if reservations == nil \n redirect_to :back\n flash[:danger] = \"You must select a timeslot to make a reservation. Please try again\" \n else\n\n #control for up to 8 timeslots reservation \n\n hash_num_limition = Hash.new\n reservations.each do |element|\n hash_num_limition[element.split('/')[0]] = 0 \n end\n\n reservations.each do |element|\n hash_num_limition[element.split('/')[0]] = hash_num_limition[element.split('/')[0]]+1\n end\n\n flag_limit = false\n hash_num_limition.each_value do |value|\n if value>8\n flag_limit = true\n break\n end\n end\n\n if flag_limit == true\n redirect_to :back\n flash[:danger] = \"Please choose at most 8 timeslots for every resource.\" \n else\n #control for forgotten timeslots \n old_timeslot = false\n reservations.each do |reservation|\n if reservation.split('/')[1] <= Time.zone.now.to_s[0...-9]\n old_timeslot = true\n break\n end\n end\n \n if old_timeslot == true\n redirect_to :back\n flash[:danger] = \"Please select a time from now on\" \n else\n\n \n # Checks if there is two different dates of reservations (case of 24hours schedule) and keeps the shorter\n reservation_date_num = 0\n reservation_date = \"\"\n reservations.each do |reservation|\n date = reservation.split('/')[1][0...-6]\n if date != reservation_date\n if date < reservation_date && reservation_date != \"\"\n reservation_date = date\n reservation_date_num +=1\n elsif reservation_date == \"\"\n reservation_date = date\n reservation_date_num +=1\n end\n \n end\n end\n\n reservations.each do |reservation|\n if !ids.include?(reservation.split('/')[0])\n ids << reservation.split('/')[0]\n end\n end\n\n puts \"reservation_date_num\"\n puts reservation_date_num\n\n # constructs a table with the reservations. 1 for selected timeslot and 0 for non-selected\n if reservation_date_num >= 2 || reservation_date == Time.zone.today.to_s\n\n today = Time.zone.today.to_s\n tomorrow = (Time.zone.today + 1.day).to_s\n time_now = Time.zone.now.to_s.split(\" \")[1][0...-3]\n\n #Upologismos gia sthles\n columns = Array.new(48)\n columns[0]= \"Name\"\n (0..47).each do |n|\n if (n % 2 == 0) \n columns[n+1] = \"#{n<20 ? \"0#{n / 2}\" : n / 2}:00\"\n else\n columns[n+1] = \"#{n<20 ? \"0#{n / 2}\" : n / 2}:30\"\n end\n end\n\n today_and_tommorow_columns = []\n today_and_tommorow_columns << \"Name\"\n\n columns.each do |element|\n if element > time_now && element != \"Name\"\n today_and_tommorow_columns << today + \" \" + element \n end\n end\n\n columns.each do |element|\n if element <= time_now && element != \"Name\" \n today_and_tommorow_columns << tomorrow + \" \" + element\n end\n end\n\n #Upologismos gia rows\n rows = Array.new(ids.length){Array.new(49,0)}\n rows.each_index do |i|\n rows[i][0] = ids[i]\n end\n\n reservation_table = rows.map{|r| Hash[ *today_and_tommorow_columns.zip(r).flatten ] }\n else\n ids.each_index do |i|\n h = Hash.new\n r_name = ids[i]\n h[\"Name\"] = r_name\n (0..47).each do |n|\n if (n % 2 == 0) \n h[\"#{reservation_date}#{n<20 ? \" 0#{n / 2}\" : \" #{n / 2}\"}:00\"] = 0\n else\n h[\"#{reservation_date}#{n<20 ? \" 0#{n / 2}\" : \" #{n / 2}\"}:30\"] = 0\n end\n end\n #if the last half hour of a day selected, we reserve a node until \"23:59\" \n h[reservation_date + \" 23:59\"] = 0\n reservation_table << h\n end\n end\n #Sumplhrwnw o kathe hash me tis krathseis \n reservation_table.each do |element|\n reservations.each do |reservation|\n if reservation.split('/')[0] == element[\"Name\"]\n element[reservation.split('/')[1]] =1\n end\n end\n end\n puts ids\n\n \n # array_with_reservations: table filled with hashes of the reservations to be done \n array_with_reservations = []\n num = 0\n #Compute valid_from and valid_until for each reservation request \n valid_from = \"\"\n valid_until = \"\"\n puts \"Auto einai to reservation table afou to gemisw\"\n puts reservation_table.inspect\n reservation_table.each do |element|\n element.each do |key,value|\n #puts key\n #puts value\n if num ==0\n if value ==1\n #puts \"mpika \"\n valid_from = key\n #puts valid_from\n num += 1\n end\n else \n if value ==0\n valid_until = key\n #stelnw krathsh \n #element[\"Name\"]\n\n valid_from = valid_from + \":00 \" #+ Time.zone.now.to_s.split(' ')[2]\n valid_from = Time.zone.parse(valid_from)\n valid_until = valid_until + \":00 \" #+ Time.zone.now.to_s.split(' ')[2]\n valid_until = Time.zone.parse(valid_until)\n #reserveNode(node_list_uuids[element[\"Name\"]],params[:user_slice],valid_from,valid_until)\n \n h = Hash.new\n h = {\"valid_from\" => valid_from, \"valid_until\"=> valid_until, \"resources\"=> [hash_details_of_resources[element[\"Name\"]][\"uuid\"]] }\n if array_with_reservations.length == 0\n array_with_reservations << h\n else\n flag = 0\n array_with_reservations.each do |reservation|\n if reservation[\"valid_from\"] == valid_from && reservation[\"valid_until\"] == valid_until && !reservation[\"resources\"].include?(hash_details_of_resources[element[\"Name\"]][\"uuid\"])\n reservation[\"resources\"] << hash_details_of_resources[element[\"Name\"]][\"uuid\"]\n flag =1\n break \n end\n end\n if flag == 0\n array_with_reservations << h\n end\n end\n puts \"Tha kanw krathsh me valid_from\"\n puts valid_from\n puts \"kai valid_until\"\n puts valid_until\n # puts \"Gia ton \"+element[\"Name\"] + \"me uuid=\" + @node_list_uuids[element[\"Name\"]]\n num = 0\n end\n end\n end\n end\n puts \"\"\n puts \"Auto einai to array me ta reservation pou prepei na ginoun\"\n puts array_with_reservations\n\n # Making reservations\n results_of_reservations = []\n array_with_reservations.each do |reservation|\n results_of_reservations << reserveNode(reservation[\"resources\"],params[:user_slice],reservation[\"valid_from\"],reservation[\"valid_until\"])\n end\n \n flash_msg = []\n results_of_reservations.each do |result|\n if !result.to_s.include?(\"OK\") \n flash_msg << result.to_s \n end\n end \n if flash_msg.length !=0\n flash[:danger] = flash_msg\n else\n flash[:success] = \"Successful reservation!\"\n end\n redirect_to :back \n end\n\n end\n\n \n end \n end",
"title": ""
}
] |
0b0d6b3e598a5646762421831883fb3d
|
=== SFS 1.1 Description The start Point of this Curve. === Notes Returns an object that supports the Point interface.
|
[
{
"docid": "a0fad367ba6b8ae386369e08442cc5ea",
"score": "0.82612073",
"text": "def start_point\n raise Error::UnsupportedOperation, \"Method Curve#start_point not defined.\"\n end",
"title": ""
}
] |
[
{
"docid": "bb750a9a28f1f73867020e39611aa0e4",
"score": "0.763073",
"text": "def getStartPoint()\n geoObject().firstPoint() ;\n end",
"title": ""
},
{
"docid": "b4956697b07cf194e83f9ab41a7c266d",
"score": "0.7594859",
"text": "def start_point\n o = st_start_point\n [o.y, o.x]\n end",
"title": ""
},
{
"docid": "2de886559e76c5b733ca0a3a2c0cf965",
"score": "0.6740044",
"text": "def startpoint=(startPoint)\n @elementHash[:startpoint] = startPoint\n end",
"title": ""
},
{
"docid": "958372d3abd46eb7248c0bb4ed76c5df",
"score": "0.63786036",
"text": "def start_point; get(start_param) end",
"title": ""
},
{
"docid": "3e839c619a7fd99c87e268c1909b6796",
"score": "0.632928",
"text": "def min_point\n # generate the bounding box if not already done\n bounding_box\n # return the min\n @min\n end",
"title": ""
},
{
"docid": "5b8bd71ba4b75c4bee7ae57cde3ed393",
"score": "0.6295415",
"text": "def start_at(x, y = nil)\n from.coord x, y\n end",
"title": ""
},
{
"docid": "1b015e24cca4cacef98967409089d809",
"score": "0.6280453",
"text": "def start_lat\r\n return nil if geom.nil?\r\n if geom.as_georuby.is_a?(LineString)\r\n return geom.as_georuby.points.first.y\r\n elsif geom.as_georuby.is_a?(Point)\r\n return geom.as_georuby.y \r\n end\r\n end",
"title": ""
},
{
"docid": "4f29690e0124aebf607fbe9e4549cc65",
"score": "0.608566",
"text": "def get_start_coordinates\n start = @matrix.select { |k, v| v.type.eql?(Cell::TYPES[:start])}\n raise \"Start case not found\" unless start\n start.keys.first\n end",
"title": ""
},
{
"docid": "9b04fd8e1e2f06a3ba9e42712aa52905",
"score": "0.6051424",
"text": "def start_line\n attributes.fetch(:startLine)\n end",
"title": ""
},
{
"docid": "af1b9a6cf3187e6d320460e1d8b69407",
"score": "0.6045606",
"text": "def starting_point(str)\n mapper = StringMapper.new\n raw_x_pct = mapper.percentize_modulus(str)\n raw_y_pct = mapper.percentize_modulus_exp(str)\n\n # mapper produces raw %'s 0..1.\n # figures that start out very close to a border often get trapped and\n # look strange, so we won't allow a starting point <30% or >70%.\n interp = Interpolate::Points.new(0 => 0.2, 1 => 0.8)\n\n x_pct = interp.at( raw_x_pct )\n y_pct = interp.at( raw_y_pct )\n\n Point.new(\n (x_pct * @bounds.x).to_i,\n (y_pct * @bounds.y).to_i\n )\n end",
"title": ""
},
{
"docid": "733147b85dbbb262c934f84ee7767b73",
"score": "0.6031508",
"text": "def start\n @parts.first.start\n end",
"title": ""
},
{
"docid": "ea958da9873e805275a3ac9c602deec8",
"score": "0.60205334",
"text": "def x\n @point[0]\n end",
"title": ""
},
{
"docid": "1d84adbf09cfada8c96836da733d8ae6",
"score": "0.6009419",
"text": "def start_coords\n marker_coords('S')\n end",
"title": ""
},
{
"docid": "81a6949697dcdf49f5731bdafdf5aa8c",
"score": "0.5966126",
"text": "def start\n attributes.fetch(:start)\n end",
"title": ""
},
{
"docid": "81a6949697dcdf49f5731bdafdf5aa8c",
"score": "0.5966126",
"text": "def start\n attributes.fetch(:start)\n end",
"title": ""
},
{
"docid": "9e195e2436cf084460751c859a448f48",
"score": "0.58962774",
"text": "def source_start\n Location.new(line_number, column)\n end",
"title": ""
},
{
"docid": "84329a44b0dc336e3f7e7ccd58ff9156",
"score": "0.5850855",
"text": "def list_start\n if self.type != :list || self.list_type != :ordered_list\n raise NodeError, \"can't get list_start for non-ordered list\"\n end\n CMark.node_get_list_start(@pointer)\n end",
"title": ""
},
{
"docid": "f34c19a0dd2e195ec749c47f74e33cd0",
"score": "0.58310556",
"text": "def start\n @start ||= operands.detect {|op| op.is_a?(Start)}\n end",
"title": ""
},
{
"docid": "5b7027b7ab96cd8426cfed4c0e75a4ee",
"score": "0.5816329",
"text": "def get_starting_point\n\t\tif starting_location_meeting.blank?\n\t\t\tstarting_location_dl\n\t\telse\n\t\t\tstarting_location_meeting\n\t\tend\n\tend",
"title": ""
},
{
"docid": "a9bb5380f2bb204dd19ebd2d9233964c",
"score": "0.58105946",
"text": "def start\n @data[\"start\"].to_i\n end",
"title": ""
},
{
"docid": "26222b90d6d5d238cf923137faf9ea8f",
"score": "0.5753137",
"text": "def get_start_p()\n frame_start\n label(:a) do\n puts \"Zadaj pociatocny bod: X(0-#{@width-1}) Y(0-#{@height-1})\"\n begin\n @start_p = convert_s_array_to_i_array(gets.split(\" \"))\n raise(ArgumentError) if @start_p[0] < 0 or @start_p[0] >= @width or @start_p[1] < 0 or @start_p[1] >= @height\n rescue ArgumentError\n puts \"Chybný vstup. Skús znova.\\n\"\n\n # znovu nacitanie vstupu\n goto :a\n end\n end\n frame_end\n end",
"title": ""
},
{
"docid": "89aedc0e9055a5ecc4d1cce7ab8b9063",
"score": "0.5731397",
"text": "def get_first_point\n @points.each do |pt|\n @points.delete(pt)\n return pt\n end\n end",
"title": ""
},
{
"docid": "0d04348dd5460d7665675495bbb1b3d9",
"score": "0.57188267",
"text": "def center\n Point.new(x: @x, y: @y)\n end",
"title": ""
},
{
"docid": "f2a4ab2d771139bc9e84477f27a5b935",
"score": "0.5675788",
"text": "def start\n @range.start\n end",
"title": ""
},
{
"docid": "1fdb03ae1a66ee27b520695bb5a22480",
"score": "0.56572634",
"text": "def min_x\n @pos.x\n end",
"title": ""
},
{
"docid": "cc4a3b0ec2e87bc64592be8919a3f99f",
"score": "0.56418586",
"text": "def seek_start\n seek_to_percent(0.0)\n end",
"title": ""
},
{
"docid": "abbc58913815ccb3e0097361bb067e52",
"score": "0.5634991",
"text": "def get_real_point\n pos_x = x * get_scale(:x)\n pos_y = y * get_scale(:y)\n return Point.new(pos_x, pos_y) unless (has_layer?)\n real_point = get_layer.get_real_point\n return Point.new(\n (real_point.x + pos_x),\n (real_point.y + pos_y)\n )\n end",
"title": ""
},
{
"docid": "2b965ba5190926213e729cdb73629f26",
"score": "0.561077",
"text": "def midpoint\n Point.new((x1 + x2) / 2, (y1 + y2) / 2)\n end",
"title": ""
},
{
"docid": "1d6afbaf33ca8f9a8e648faa17e212fe",
"score": "0.55889684",
"text": "def start\n @history.objects.find { |o| o.name == \"start\" }.val\n end",
"title": ""
},
{
"docid": "4c3fb5b1ac366fbf6c551db8f1e6ff8d",
"score": "0.5588311",
"text": "def start_angle\n MSPhysics::Newton::Hinge.get_start_angle(@address)\n end",
"title": ""
},
{
"docid": "9a7c420a8c13a63260cee7a4f6392823",
"score": "0.5578149",
"text": "def start_at(x, y = nil)\n @anchor.start_at x, y\n @anchor.from\n end",
"title": ""
},
{
"docid": "bae93cb51a7b511359f9f1045d15b397",
"score": "0.55749667",
"text": "def start\n @min\n end",
"title": ""
},
{
"docid": "b4165b003e84d872906ce235d4003e2b",
"score": "0.55521464",
"text": "def base_points\n points\n end",
"title": ""
},
{
"docid": "c98beb2a23c774315d42a97e84c164d5",
"score": "0.551705",
"text": "def get_point\n p = nil\n @m.synchronize{\n p = @p[0]\n @p.delete_at(0)\n }\n return p\n end",
"title": ""
},
{
"docid": "73fa216eff06b16c2c5332f974e826fd",
"score": "0.55026627",
"text": "def get_midpoint(point)\n Point.new(*to_a.zip(point.to_a).map { |a, b| (a + b) / 2.0 })\n end",
"title": ""
},
{
"docid": "e9c21d197d1b3182902149b2cbf3eabe",
"score": "0.5450818",
"text": "def start_date\n earliest_date_phase = (self.phases).min_by { |s| s.start_date} if !self.phases.empty?\n if earliest_date_phase.present?\n earliest_date_phase.start_date\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "e2ceca3b029d008c6caebb4d69bc166b",
"score": "0.5442379",
"text": "def initialize(point)\n @point = point\n end",
"title": ""
},
{
"docid": "7cd9e60bf74741ce12d0c89f2cb950ec",
"score": "0.54344815",
"text": "def set_left_start_point\n @leading_x = 0\n @leading_y = find_left_entry\n end",
"title": ""
},
{
"docid": "63ab7dafae15382a536d23b923b5349d",
"score": "0.54302305",
"text": "def get_start_node\n return @nodes.reduce{|sum, pair| pair[0] < sum[0] ? pair : sum}[1] \n end",
"title": ""
},
{
"docid": "4f32798053585eed0d47d6c3b357ecc3",
"score": "0.5409441",
"text": "def entry_start_pos\n @splitter.entry_start_pos\n end",
"title": ""
},
{
"docid": "ae86ef53840c543cdc1a2c691fef42ad",
"score": "0.54020953",
"text": "def min_position\n MSPhysics::Newton::Corkscrew.get_min_position(@address)\n end",
"title": ""
},
{
"docid": "f33a4266133221109e7d80ee0f975e46",
"score": "0.539339",
"text": "def midpoint(point)\n la, lo = Ubiquity::Geoformulas.midpoint self.lat, self.lon, point.lat, point.lon\n self.class.new la, lo\n end",
"title": ""
},
{
"docid": "595628feaa79fff720d0a36332749ca6",
"score": "0.53842556",
"text": "def identity\r\n new_point = Marshal.load(Marshal.dump(self))\r\n new_point.x = 0\r\n new_point.y = 0\r\n new_point.x = @x / @x.abs if @x != 0\r\n new_point.y = @y / @y.abs if @y != 0\r\n return new_point\r\n end",
"title": ""
},
{
"docid": "6c65d2c320f22c4c6fc0ea47a16e7947",
"score": "0.5376098",
"text": "def start\n return self.seq_region_start\n end",
"title": ""
},
{
"docid": "4b4c4dac3fa1a2a0d0fa96cc1d9f8a07",
"score": "0.53752816",
"text": "def shape_lowest_left_point(shape)\n check_pre((\n shape?(shape)\n ))\n\n if shape.range1d?\n return shape.first\n elsif shape.range2d?\n return shape_lowest_left_point(shape.x_range)\n elsif shape.union1d? or shape.union2d?\n return shape_lowest_left_point(shape.left)\n else\n check_pre(false)\n end\nend",
"title": ""
},
{
"docid": "011e4555f80849147885f54f69a9a127",
"score": "0.5366184",
"text": "def mid\n mid_of_x = (@p2.x - @p1.x) / 2 + @p1.x\n mid_of_y = (@p2.y - @p1.y) / 2 + @p1.y\n BPoint.new(mid_of_x, mid_of_y)\n end",
"title": ""
},
{
"docid": "b79796215ee9a310c18156d015a8d259",
"score": "0.53618926",
"text": "def point_from\n points.find { |point| point.kind == \"From\" }\n end",
"title": ""
},
{
"docid": "1c32ed965760885905e320c1de53f559",
"score": "0.53611195",
"text": "def left\n Point.new(@x - 1, @y)\n end",
"title": ""
},
{
"docid": "1c32ed965760885905e320c1de53f559",
"score": "0.53611195",
"text": "def left\n Point.new(@x - 1, @y)\n end",
"title": ""
},
{
"docid": "0efafcfe5c5dd10a0f949b89b01ca28f",
"score": "0.53524",
"text": "def origin\n Entities::Point.new(\n (Game::WIDTH - map.pixel_width) / 2,\n (Game::HEIGHT - map.pixel_height) / 2\n )\n end",
"title": ""
},
{
"docid": "1f12537cbfdfc1b8a32c78d4796bb351",
"score": "0.53333914",
"text": "def to_point\n if length == 2\n p = Point.new(*self)\n elsif length == 1\n p = self[0].clone\n end\n return p\n end",
"title": ""
},
{
"docid": "07b2e588072f906802274854403d8541",
"score": "0.5323917",
"text": "def record_position(x, y)\n pt = Core::Point.new(x, y)\n if @start_point.nil?\n @start_point = pt\n else\n @end_point = pt\n end\n end",
"title": ""
},
{
"docid": "5abf5a25199f9b217be222a205d4809c",
"score": "0.5320319",
"text": "def start_param\n params[:start]\n end",
"title": ""
},
{
"docid": "83fa4b4d2e77528de60db3104362e0b1",
"score": "0.53088856",
"text": "def starting_location\n generate if @sectors.empty?\n sectors.first\n end",
"title": ""
},
{
"docid": "41adc3915d89403a9340ac41fecdda5a",
"score": "0.5308836",
"text": "def point_x\n self.coord.split(\"_\")[0]\n end",
"title": ""
},
{
"docid": "fb65d7379bc905e4df01d1824944a708",
"score": "0.53031605",
"text": "def start\n @params[:start].to_i > 0 ? @params[:start].to_i : 0\n end",
"title": ""
},
{
"docid": "f4646e25f1c733be640133479fc8c8ae",
"score": "0.5284854",
"text": "def start=(value)\n\t\t\t@start = value\n\t\tend",
"title": ""
},
{
"docid": "b20b6d28d79709ed31b7013994a3273e",
"score": "0.52847517",
"text": "def start(start_key)\n KeyValueList.new(self).start(start_key)\n end",
"title": ""
},
{
"docid": "04d2e3ec6eaaa19a844625b11ec678ba",
"score": "0.5281937",
"text": "def start_num\n return @start_num\n end",
"title": ""
},
{
"docid": "27a33e97089388cb57568cdf0630e045",
"score": "0.52789795",
"text": "def start(value)\n @ole.Start = value\n nil\n end",
"title": ""
},
{
"docid": "a2d52bcf7be71cc9566d272254a53a65",
"score": "0.52751744",
"text": "def start_time\n @parts.first.start_time\n end",
"title": ""
},
{
"docid": "f27d63b3519c55f2e63c72fa1b27fcc3",
"score": "0.52734923",
"text": "def to_point\n size = attribute :size\n point = attribute :position\n point.x += size.width / 2\n point.y += size.height / 2\n point\n end",
"title": ""
},
{
"docid": "b2ff5a823992c7e9c6c6db017cc838ad",
"score": "0.5272198",
"text": "def press(point)\n\t\t# mark the initial point for reference\n\t\t@origin = point\n\t\t@start = @entity[:physics].body.p.clone\n\tend",
"title": ""
},
{
"docid": "0828aad4f7a2e57f1679931a822bbbd6",
"score": "0.52688277",
"text": "def get_range_start(code_point, block_data)\n start_data = block_data[block_data.keys.min]\n\n if start_data[1] =~ /<.*, First>/\n start_data = start_data.clone\n start_data[0] = code_point\n start_data[1] = start_data[1].sub(', First', '')\n start_data\n end\n end",
"title": ""
},
{
"docid": "ffc9127a3d1ae2ce4a0e9fc6a22c21c0",
"score": "0.52578694",
"text": "def new_point(p)\n case p\n when :infinity\n infinity\n when Array\n x, y = p\n Point.new(self, x, y)\n when Integer\n generator.multiply_by_scalar(p)\n else\n raise ArgumentError, \"Invalid point specifier #{p.inspect}.\"\n end\n end",
"title": ""
},
{
"docid": "2d31ff9fd6631085bb8ca122d43205c9",
"score": "0.5256766",
"text": "def local_start_at\n Timestamp.new(@timestamp_value, 0, @offset.utc_total_offset)\n end",
"title": ""
},
{
"docid": "4b2372c14b80d618d4fba713f05789e8",
"score": "0.5253043",
"text": "def start_at\n @attributes[:start_at]\n end",
"title": ""
},
{
"docid": "4b2372c14b80d618d4fba713f05789e8",
"score": "0.5253043",
"text": "def start_at\n @attributes[:start_at]\n end",
"title": ""
},
{
"docid": "9bf363dfc192f56305e4ebe64afd5817",
"score": "0.52189857",
"text": "def start_date\n\t \tTime.at(self.start_time) rescue nil\n\t end",
"title": ""
},
{
"docid": "172bc2443c65e1c3df89e2954578176d",
"score": "0.5213403",
"text": "def fortress_center_point\n return Point.new((fortress_x_size / 2).truncate, (fortress_y_size / 2).truncate)\n end",
"title": ""
},
{
"docid": "dc62e985f04174354dc904b6c8f11163",
"score": "0.52122307",
"text": "def get_min()\n @min\n end",
"title": ""
},
{
"docid": "691bc387389f76c1a07c60e0b345fac0",
"score": "0.52036524",
"text": "def origin\n Position.new(0,0)\n end",
"title": ""
},
{
"docid": "f180eab82ce8b8617ca9ce8e915c3fcc",
"score": "0.5187217",
"text": "def cur_point\n MSPhysics::Newton::CurvySlider.get_cur_point(@address)\n end",
"title": ""
},
{
"docid": "f180eab82ce8b8617ca9ce8e915c3fcc",
"score": "0.5187217",
"text": "def cur_point\n MSPhysics::Newton::CurvySlider.get_cur_point(@address)\n end",
"title": ""
},
{
"docid": "0204e8bc665d359bb9c1f3d8fa2f7ae8",
"score": "0.5185352",
"text": "def starting_at\n @starting_at ||= parse_or_at(@attrs[:starting_at]) if @attrs[:starting_at]\n end",
"title": ""
},
{
"docid": "eff1bed00381757684b0bd5f35530d8e",
"score": "0.5180263",
"text": "def start_date\n @start_date ||= respond_to?(:parliamentPeriodStartDate) ? DateTime.parse(parliamentPeriodStartDate) : nil\n end",
"title": ""
},
{
"docid": "ccfd36022acb5c413e1669277f22200b",
"score": "0.5177425",
"text": "def min_price\n @set[\"PriceSet\"][\"minPrice\"]\n end",
"title": ""
},
{
"docid": "f9acb158dccfeda37ee548d4793314d3",
"score": "0.51735973",
"text": "def min\n @range.begin\n end",
"title": ""
},
{
"docid": "553ca63c0395d8e2288fd139c6a30fe7",
"score": "0.516418",
"text": "def start_time(ride)\n return nil unless ride.points.any?\n ride.points.first.time\n end",
"title": ""
},
{
"docid": "511434d908fbcd9e29629b2bb5725b0d",
"score": "0.51641136",
"text": "def current_position\n @start_position + delta\n end",
"title": ""
},
{
"docid": "a0a87e6933f12e4d57176ca291486799",
"score": "0.5160745",
"text": "def start\n\t\t\t@start < @end ? @start : @end\n\t\tend",
"title": ""
},
{
"docid": "37bd79ebd9f0d2d1de8ab0d8e6427e77",
"score": "0.515444",
"text": "def set_start(v)\n add_state(v)\n @start = v\n end",
"title": ""
},
{
"docid": "37bd79ebd9f0d2d1de8ab0d8e6427e77",
"score": "0.515444",
"text": "def set_start(v)\n add_state(v)\n @start = v\n end",
"title": ""
},
{
"docid": "00d1a08f0319b720df42450148d2a373",
"score": "0.5130536",
"text": "def Point(x_or_origin, y=nil)\n unless y\n case x_or_origin\n when CGPoint\n x = x_or_origin.x\n y = x_or_origin.y\n when CGSize\n x = x_or_origin.width\n y = x_or_origin.height\n when UIOffset\n x = x_or_origin.horizontal\n y = x_or_origin.vertical\n when Array\n x = x_or_origin[0]\n y = x_or_origin[1]\n else\n raise RuntimeError.new(\"Invalid argument sent to Point(#{x_or_origin.inspect})\")\n end\n else\n x = x_or_origin\n end\n return CGPoint.new(x, y)\n end",
"title": ""
},
{
"docid": "d649ac54bd2aa08a8c0882a13bb532e1",
"score": "0.51226383",
"text": "def started_at\n Time.parse @gapi.start_time\n rescue StandardError\n nil\n end",
"title": ""
},
{
"docid": "4a5e75eee234f29026d3804981622e2b",
"score": "0.5122269",
"text": "def midpoint\n\t\t(@startrange+@endrange)/2\n\tend",
"title": ""
},
{
"docid": "478e72b0e291d1f8894e8c0aa56007a1",
"score": "0.51210123",
"text": "def min\n MSPhysics::Newton::Hinge.get_min(@address)\n end",
"title": ""
},
{
"docid": "7f7604a997a9fdaf23a3fc3f46a294b9",
"score": "0.51145595",
"text": "def start(value)\n merge(rvstart: value.iso8601)\n end",
"title": ""
},
{
"docid": "f93dbf1f213c6ba56f884ad4618e4096",
"score": "0.5108703",
"text": "def latitude\n self.to_coordinates[0]\n end",
"title": ""
},
{
"docid": "72da4fc371ef040894702ecd1ae71d62",
"score": "0.5086979",
"text": "def lower_left\n @lower_left ||= world.point(x_min, y_min)\n end",
"title": ""
},
{
"docid": "618926db092f550c8e640bfc2ad7b636",
"score": "0.50824904",
"text": "def left\n @x_min\n end",
"title": ""
},
{
"docid": "7abeebc0ef9503a83f44b3a6e69fcc7d",
"score": "0.50800455",
"text": "def period_start\n period.begin\n end",
"title": ""
},
{
"docid": "4c9f08854439eca24a14d6c73fd8dcbd",
"score": "0.50744385",
"text": "def start_date\n\t\treturn Date.new(y=year, m=START_MONTH, d=START_DAY)\n\tend",
"title": ""
},
{
"docid": "c70d9f84a406d09f559d112c0400112a",
"score": "0.5065502",
"text": "def midpoint(other)\n raise TypeError, \"Midpoint between Point and #{ other.class } is not defined\" unless other.is_a?(Point)\n\n Point.new(\n (self.x + other.x) / 2,\n (self.y + other.y) / 2\n )\n end",
"title": ""
},
{
"docid": "1138641a986273a514733fbe275cd3ab",
"score": "0.50646126",
"text": "def accessor_start(node); end",
"title": ""
},
{
"docid": "b3be6789fb6e5ada28e27cebc6b8fcdd",
"score": "0.50595456",
"text": "def start_character\n attributes.fetch(:startCharacter)\n end",
"title": ""
},
{
"docid": "82bbc3ed3de3816b7526ffcb0acd6db8",
"score": "0.505539",
"text": "def xmin\n @opened ? @xmin : nil\n end",
"title": ""
},
{
"docid": "412f889ab435fe2ac8c535c16916f2c4",
"score": "0.50543606",
"text": "def start(start_key)\n self.class.new(collection, range.merge({begin: start_key, begin_inclusive: true}))\n end",
"title": ""
},
{
"docid": "f0fae241241cf239e909521ef0a0ffc8",
"score": "0.50509673",
"text": "def to_point\n attribute(:position).center(attribute :size)\n end",
"title": ""
},
{
"docid": "f0fae241241cf239e909521ef0a0ffc8",
"score": "0.50509673",
"text": "def to_point\n attribute(:position).center(attribute :size)\n end",
"title": ""
}
] |
f40f3116c7626cb06a0c7769e9819008
|
DELETE /user_acts/1 DELETE /user_acts/1.json
|
[
{
"docid": "e7fd5f30fd7437c9f1ad1951097fd572",
"score": "0.6584698",
"text": "def destroy\n @activity = Activity.find(@user_act.id_activity)\n @user_act.destroy\n respond_to do |format|\n format.html { redirect_to activity_path(@user_act.id_activity), notice: \"You're no longer going to #{@activity.name}\" }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
[
{
"docid": "2e50af3ee1ae410b771f8ada97d50edc",
"score": "0.70012563",
"text": "def destroy\n @user_action = UserAction.find params[:id]\n @user_action.destroy\n respond_to do |format|\n format.html { redirect_to user_actions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2da62c7ea0bef3dd51198e6d3aa6f71d",
"score": "0.6959434",
"text": "def destroy\n @userreq = Userreq.find(params[:id])\n @userreq.destroy\n\n respond_to do |format|\n format.html { redirect_to current_user }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b1a17c1ee1af05c79fe156622df44818",
"score": "0.6932905",
"text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end",
"title": ""
},
{
"docid": "be9d8ff5c0124f1d5efc98ec2baa3fc1",
"score": "0.69321316",
"text": "def test_delete_user\n delete '/users/2'\n data = JSON.parse last_response.body\n\n assert_equal 'Daniel', data['name'], 'Propiedad name incorrecta'\n assert_equal 'Arbelaez', data['last_name'], 'Propiedad last_name incorrecta'\n assert_equal '1094673845', data['document'], 'propiedad document incorrecta'\n end",
"title": ""
},
{
"docid": "810bfc4c9e18b9c07d70c7c862541629",
"score": "0.6886519",
"text": "def destroy\n UserAct.all.each do |ua|\n if ua.id_activity == @activity.id\n ua.destroy\n end\n end\n\n @activity.destroy\n respond_to do |format|\n format.html { redirect_to activities_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b93563efe502ca734cbe95cbbc432a24",
"score": "0.68501276",
"text": "def delete\n @activity = current_user.activities.find(params[:id])\n @activity.destroy\n\n respond_to do |format|\n format.html { redirect_to manage_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "acf1bfd6dfa0380aa31a8efde7732e86",
"score": "0.6849563",
"text": "def destroy\n user = User.find(params[:id])\n user.destroy\n\n render json: user\n end",
"title": ""
},
{
"docid": "e6017b66dbe58232dc49b590143fb101",
"score": "0.6847913",
"text": "def delete_user_action(user_action_id)\n start.uri('/api/user-action')\n .url_segment(user_action_id)\n .url_parameter('hardDelete', true)\n .delete()\n .go()\n end",
"title": ""
},
{
"docid": "271c2c9bc97eb2c7acf567b0fc9e1002",
"score": "0.6816712",
"text": "def destroy\n @userst = Userst.find(params[:id])\n @userst.destroy\n\n respond_to do |format|\n format.html { redirect_to usersts_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6cd2eb965b756449da1f2e7316ba8529",
"score": "0.6815264",
"text": "def destroy\n @activity = @user.activities.find(params[:id])\n @activity.destroy\n\n respond_to do |format|\n format.html { redirect_to user_activities_url(@user) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a50700ffebc25b728498bd9a31e3e68c",
"score": "0.68027174",
"text": "def destroy\n @user.destroy\n render json: {message: \"#{@user.id} deleted\"}, status: :ok\n end",
"title": ""
},
{
"docid": "e311c554f160b360066eaa055358792f",
"score": "0.67997533",
"text": "def destroy\n @user_activity = UserActivity.find(params[:id])\n @user_activity.destroy\n\n respond_to do |format|\n format.html { redirect_to user_activities_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "31be2fbd2b5aedc5e7088866cdb5f8a3",
"score": "0.6783347",
"text": "def delete_user_data(user_id)\n # Define a path referencing the user data using the user_id\n path = \"/d2l/api/lp/#{$lp_ver}/users/#{user_id}\" # setup user path\n _delete(path)\n puts '[+] User data deleted successfully'.green\nend",
"title": ""
},
{
"docid": "184da7ffae8985dd57d5dcc85145a0f6",
"score": "0.67755413",
"text": "def destroy\n @user_1 = User1.find(params[:id])\n @user_1.destroy\n\n respond_to do |format|\n format.html { redirect_to user_1s_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "773e5d611adeb09776f9c841e1b876cc",
"score": "0.6774306",
"text": "def delete_json(path, params = {}, headers = {})\n json_request(:delete, path, params, headers)\n end",
"title": ""
},
{
"docid": "5ce2896e9f6c565b31ce8d1a20a95910",
"score": "0.6774011",
"text": "def delete_user_action(user_action_id)\n start.uri('/api/user-action')\n .url_segment(user_action_id)\n .url_parameter('hardDelete', true)\n .delete()\n .go()\n end",
"title": ""
},
{
"docid": "74f571ada66f3dcce468fd0ae24a58d5",
"score": "0.6751031",
"text": "def destroy\n @user1 = User1.find(params[:id])\n @user1.destroy\n\n respond_to do |format|\n format.html { redirect_to user1s_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "893383fb741b32fb5adbd51fad9a5b4e",
"score": "0.673444",
"text": "def destroy\r\n @user = User.find(params[:id])\r\n @user.calendars.delete_all\r\n @user.specialismships.delete_all\r\n \r\n @user.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to users_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"title": ""
},
{
"docid": "a8734c4a0413cb455f2d0df0f8fcd5e5",
"score": "0.67283714",
"text": "def delete\n puts \"******* delete *******\"\n @user.delete\n respond_to do |format|\n format.html { redirect_to users_url, notice: 'User was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d1bdb0dff73de3d9b03c84a910ab5cf6",
"score": "0.67255414",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to api_v1_users_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ea571358d5b5fe937650dfcf4c2ba10d",
"score": "0.67254585",
"text": "def destroy\n render json: @user if @user.destroy\n end",
"title": ""
},
{
"docid": "e7586b9e01c30dda3bca3565a54acef7",
"score": "0.67204034",
"text": "def destroy\n @user = HTTParty.delete(\"#{UAA_TOKEN_SERVER}/Users/#{params[\"id\"]}\",\n :headers => {\n 'Content-Type' => 'application/json',\n 'Authorization' => \"Bearer #{session[:access_token]}\",\n 'Accept' => 'application/json',\n } )\n\n respond_to do |format|\n format.html { redirect_to users_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "57c220320e0c60b719054ec73bda5ba2",
"score": "0.6716007",
"text": "def destroy\n @act = Act.find(params[:id])\n @act.destroy\n\n respond_to do |format|\n format.html { redirect_to acts_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "37bbb6a927b338e67b910d920b87d15d",
"score": "0.6713128",
"text": "def delete(user)\n Rails.logger.debug \"Call to user.delete\"\n reqUrl = \"/api/user/#{self.email}\" #Set the request url\n rest_response = MwHttpRequest.http_delete_request(reqUrl,user['email'],user['password']) #Make the DELETE request to the server with the required parameters\n Rails.logger.debug \"Response from server: #{rest_response.code} #{rest_response.message}: #{rest_response.body}\"\n if rest_response.code == \"200\" #Validate if the response from the server is 200, which means OK\n return true, rest_response #Return success\n else\n return false, \"#{rest_response.code}\", \"#{rest_response.message}\" #Return error\n end\n end",
"title": ""
},
{
"docid": "b445c184893647d3482f8fbc6a507a52",
"score": "0.6708922",
"text": "def delete(path, params = {})\n path += '.json'\n res = @connection.delete(path, @header)\n parse_response(res)\n end",
"title": ""
},
{
"docid": "573176b1d66e9983866e05f0f9f4e55a",
"score": "0.6702617",
"text": "def destroy\n @act.destroy\n respond_to do |format|\n format.html { redirect_to acts_url, notice: 'Act was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "573176b1d66e9983866e05f0f9f4e55a",
"score": "0.6702617",
"text": "def destroy\n @act.destroy\n respond_to do |format|\n format.html { redirect_to acts_url, notice: 'Act was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "573176b1d66e9983866e05f0f9f4e55a",
"score": "0.6702617",
"text": "def destroy\n @act.destroy\n respond_to do |format|\n format.html { redirect_to acts_url, notice: 'Act was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "573176b1d66e9983866e05f0f9f4e55a",
"score": "0.6702617",
"text": "def destroy\n @act.destroy\n respond_to do |format|\n format.html { redirect_to acts_url, notice: 'Act was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "23d5420431a6badf1a5be6ec0b92dbc4",
"score": "0.6699139",
"text": "def destroy\n @user.destroy\n render json: {}, status: :ok\n end",
"title": ""
},
{
"docid": "7ca7e8ba9bdfdf617b6cbfda6d8cca1d",
"score": "0.6696917",
"text": "def delete\n ruta = \"/actions/#{id}\"\n client.delete(ruta)\n end",
"title": ""
},
{
"docid": "c82173c0722047f99a626ed8fb213244",
"score": "0.66937095",
"text": "def destroy\n #@user = User.find(params[:id])\n #@user.soft_delete\n #\n #respond_to do |format|\n # format.html { redirect_to users_url }\n # format.json { head :no_content }\n #end\n end",
"title": ""
},
{
"docid": "3c6bc1e22d1da5105dfcbe6a3d99f8e6",
"score": "0.6673111",
"text": "def destroy\n # @useradmin = Useradmin.find(:all, :condiction => \"asset_id = #{params[:id]}\")\n # @useradmin.destroy\n user_id = params[:id]\n Useradmin.delete_all([\"asset_id = :aid\", {:aid => user_id}])\n User.delete(user_id)\n FocusMail::CreateUserorg::delete_userorg_object(user_id, \"User\")\n \n @useradmin = user_id\n user_action_log(params[:id],params[:controller],\"delete\")\n\n respond_to do |format|\n format.html { redirect_to useradmins_url }\n format.js\n end\n end",
"title": ""
},
{
"docid": "605abf24466242f2ffb1e928a6e7c198",
"score": "0.6662251",
"text": "def destroy\n @user_belong.destroy\n respond_to do |format|\n format.html { redirect_to user_belongs_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ba92fa18738cfee8c48d9c54a1b2350b",
"score": "0.6646747",
"text": "def destroy\n @user_path = UserPath.find(params[:id])\n @user_path.destroy\n\n respond_to do |format|\n format.html { redirect_to user_paths_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d540489c64c8dde72b7fe8816e21d7af",
"score": "0.6644127",
"text": "def test_delete_undelete_account_by_id\n # Step 1\n @user = setup_user\n\n # Step 2\n delete \"/usr/#{@user.id}\", {}\n assert_response(@response, :success)\n\n params = { 'email' => @user.email }\n\n get '/usr', params\n assert_response(@response, :success)\n assert_equal(@user.email, @parsed_response.first['email'], @parsed_response)\n assert_equal(true, @parsed_response.first['is_deleted'], @parsed_response)\n\n # Step 3\n post \"/usr/#{@user.id}/undelete\", {}\n assert_response(@response, :success)\n\n get '/usr', params\n assert_response(@response, :success)\n assert_equal(@user.email, @parsed_response.first['email'], @parsed_response)\n assert_equal(false, @parsed_response.first['is_deleted'], @parsed_response)\n end",
"title": ""
},
{
"docid": "4a55cebf6fbf38f176e7a38f5fc778c4",
"score": "0.66367406",
"text": "def destroy\n @user_test = UserTest.find(params[:id])\n @user_test.destroy\n\n respond_to do |format|\n format.html { redirect_to user_tests_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "30891966682e052a31b044b6a0b1f2bf",
"score": "0.66362846",
"text": "def destroy\n @activity_user = ActivityUser.find(params[:id])\n @activity_user.destroy\n\n respond_to do |format|\n format.html { redirect_to activity_users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "47906c177f4a86a8afc6f4f47f000281",
"score": "0.6634726",
"text": "def destroy\n @user = User.find(params[:id])\n \n if @user.destroy\n render json: @user, status: :ok \n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "f883f52b7f2f82a0c8a1552da64cde6d",
"score": "0.6634116",
"text": "def destroy\n @actum = Actum.find(params[:id])\n @actum.destroy\n\n respond_to do |format|\n format.html { redirect_to acta_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "edec184381dddd52fb788340533a466f",
"score": "0.6625042",
"text": "def destroy\n @moonlyter.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "2f00d9e12a8b1201383732f32c26583f",
"score": "0.6618668",
"text": "def destroy\n @useracct = Useracct.find(params[:id])\n @useracct.destroy\n\n respond_to do |format|\n format.html { redirect_to useraccts_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "182545a45c91f56577e4d982a2163076",
"score": "0.6617478",
"text": "def destroy\n # @api_v1_user.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "fe9e54ca2f31e157bbcac17b28298f28",
"score": "0.66139275",
"text": "def delete uid\n response = call_api method: :delete, id: uid\n ap \"#{uid} deleted!\", color: {string: :green} if response.code==\"204\"\n return response\n end",
"title": ""
},
{
"docid": "9acc47ec98a84118327511a7464c7050",
"score": "0.6613846",
"text": "def destroy\n user = User.find(params[:id])\n user.destroy\n render json: {message: 'User successfully deleted!'}\n end",
"title": ""
},
{
"docid": "dbd1f3effd2c7b28ad8d8fde48703440",
"score": "0.66078556",
"text": "def destroy\n user_id = params[:id]\n status = User.remove_user(user_id)\n respond_to do |format|\n if status == 200\n format.json { render json: 'Status update: removed', status: :ok } \n else\n format.json { render json: 'Fail to update status!', status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9106867cee9e8775ba817195d3bc2020",
"score": "0.6595947",
"text": "def delete_rest(path) \n run_request(:DELETE, create_url(path)) \n end",
"title": ""
},
{
"docid": "83641ef98db66d873e35a72bb607fce1",
"score": "0.6594543",
"text": "def delete_user(user_id)\n start.uri('/api/user')\n .url_segment(user_id)\n .url_parameter('hardDelete', true)\n .delete()\n .go()\n end",
"title": ""
},
{
"docid": "e0ea9801a9a886a5cf261f2fcd69a265",
"score": "0.65936965",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n Action.log :controller => params[:controller], :action => params[:action], :target_id => params[:id], :user => current_user\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "14b6f1f92ddb7b9e9b354c96543a678e",
"score": "0.6592754",
"text": "def destroy\n @single_action.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0387aa3c568d857184e97a214e580a14",
"score": "0.6592063",
"text": "def delete(path, params = {}, payload = {})\n JSON.parse Generic.delete(@base_url, @headers, path, params, payload)\n end",
"title": ""
},
{
"docid": "a442c0433eb640cc7ec2c1dd77635905",
"score": "0.6590478",
"text": "def destroy\n @o_single.destroy\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e3f04d60963483be27a328fff51f73aa",
"score": "0.65884525",
"text": "def destroy\n @activity = current_user.activities.find(params[:id])\n @activity.destroy\n\n respond_to do |format|\n format.html { redirect_to activities_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "112904afc6b06087077448ea71b8912d",
"score": "0.65879315",
"text": "def delete_user\n\t\t#Removes user from the database\n\t\t#TODO Cascading deletes?\n requires({'role'=>'admin'})\n u = User.find_by_email(params[:email])\n u.destroy\n render :json => u.to_json\n end",
"title": ""
},
{
"docid": "360426e2a850aac27731d4be1b66cf87",
"score": "0.6579372",
"text": "def destroy\n @user.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "360426e2a850aac27731d4be1b66cf87",
"score": "0.6579372",
"text": "def destroy\n @user.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "360426e2a850aac27731d4be1b66cf87",
"score": "0.6579372",
"text": "def destroy\n @user.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "360426e2a850aac27731d4be1b66cf87",
"score": "0.6579372",
"text": "def destroy\n @user.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "360426e2a850aac27731d4be1b66cf87",
"score": "0.6579372",
"text": "def destroy\n @user.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cf4784fbfbf211c4bfbf7083212cee33",
"score": "0.6574586",
"text": "def destroy\n @user = User.find(params[:id])\n @items = @user.items\n\n @items.each do |item|\n item.destroy\n end\n\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "3ac9675e2e75f7bfd96c59abf9f4d099",
"score": "0.6569836",
"text": "def destroy\n @user = User.find(params[:id])\n #@user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a547b0f3432bf0d2dc8490b91398bf90",
"score": "0.6564989",
"text": "def destroy\n @robots=\"noindex,nofollow\"\n @user = @account\n respond_to do |format|\n if @user == current_user\n format.json { render :json=>{:error=>[nil, \"You cannot delete yourself\"]}}\n end\n @user.person.user_id=nil if @user.person.present?\n @user.person.save if @user.person.present?\n if !@user.destroy\n format.json { render :json=>report_error(@user)}\n else\n format.json { render :json=>{}}\n end\n end\n end",
"title": ""
},
{
"docid": "5c181505ac0deedddfba684db419e428",
"score": "0.6559322",
"text": "def delete\n render json: Own.delete(params[\"id\"])\n end",
"title": ""
},
{
"docid": "6217c9a03bb54e6897d3347d46d30039",
"score": "0.6548563",
"text": "def destroy\n #@user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c6f62d6da662786a2528aee58279231f",
"score": "0.6544941",
"text": "def delete\n @user.destroy\n render status: 204\n end",
"title": ""
},
{
"docid": "179a2ccdd2cfe4a51ebce989d7130fbf",
"score": "0.65420914",
"text": "def destroy\n @task_actions_user.destroy\n respond_to do |format|\n format.html { redirect_to task_actions_users_url, notice: 'Task actions user was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f6b941e1dae643066f45b213d860705e",
"score": "0.6539411",
"text": "def delete\n result = DBAdapter.delete_model(:user, params[:id])\n method_to_call = result[\"method\"]\n status = result[\"status\"]\n model = result[\"model\"] # just in case\n render :json => method_to_call.call(model, code: status[\"id\"], message: status[\"message\"])\n end",
"title": ""
},
{
"docid": "d37932ca38e243247c099882353c3315",
"score": "0.6536884",
"text": "def destroy\n @users_goal = my_goals.find(params[:id])\n @users_goal.destroy\n\n respond_to do |format|\n format.html { redirect_to action: 'new', notice: 'Goal was removed'}\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "79ad0106760067d0eaf1143729f5afcd",
"score": "0.653148",
"text": "def destroy\n @cactu = Cactu.find(params[:id])\n @cactu.destroy\n\n respond_to do |format|\n format.html { redirect_to cactus_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ebd9510e54d9a87eeeb977dc456aac70",
"score": "0.6530537",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to dm_core.admin_users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ec5de7785e635f0e288c2a3a93efc07c",
"score": "0.6529921",
"text": "def delete(user)\n Rails.logger.debug \"Call to ticket.delete\"\n reqUrl = \"/api/ticket/#{self.id}\" #Set the request url\n rest_response = MwHttpRequest.http_delete_request(reqUrl,user['email'],user['password']) #Make the DELETE request to the server with the required parameters\n Rails.logger.debug \"Response from server: #{rest_response.code} #{rest_response.message}: #{rest_response.body}\"\n if rest_response.code == \"200\" #Validate if the response from the server is 200, which means OK\n return true, rest_response #Return success\n else\n return false, \"#{rest_response.code}\", \"#{rest_response.message}\" #Return error\n end\n end",
"title": ""
},
{
"docid": "47a3c9c28e1fcd0fcae5ea58416b42bd",
"score": "0.652751",
"text": "def delete(path)\n api :delete, path\n end",
"title": ""
},
{
"docid": "94fc55fc93b607e470b575b90aed7654",
"score": "0.65260804",
"text": "def destroy\n\t\tlog_action_result @user\n\t\t@user.destroy\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to users_url }\n\t\t\tformat.json { head :no_content }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "6f03c953d09e5a501bd8808a209da396",
"score": "0.65258247",
"text": "def destroy\n @user_item = UserItem.find(params[:id])\n @user_item.destroy\n\n respond_to do |format|\n format.html { redirect_to user_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6f03c953d09e5a501bd8808a209da396",
"score": "0.65258247",
"text": "def destroy\n @user_item = UserItem.find(params[:id])\n @user_item.destroy\n\n respond_to do |format|\n format.html { redirect_to user_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8905dedecc037bc55b7bc6ffe91a9b9b",
"score": "0.6525765",
"text": "def destroy\n @user_rk1 = UserRk1.find(params[:id])\n @user_rk1.destroy\n\n respond_to do |format|\n format.html { redirect_to user_rk1s_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8431bdc2d158488844c8ac80db43f4b8",
"score": "0.65256053",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n \n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b08e21aeadaf4f9aa45f7ac21357dbf9",
"score": "0.652484",
"text": "def destroy\n correct_user\n @user = current_user\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to @user }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "07960eeb653a6b24c7e471369ba3ca68",
"score": "0.6523195",
"text": "def delete_as(user, action, params: {}, format: nil, session: {})\n sign_in user\n delete action, xhr: true, params: params, format: format, session: session\n end",
"title": ""
},
{
"docid": "47a21f1095730d24ed4fb5dbb5e6c243",
"score": "0.65223813",
"text": "def remove_user\n query_api \"/rest/user\", nil, \"DELETE\"\n end",
"title": ""
},
{
"docid": "3d0b62dad469961a244e9a0949b8857a",
"score": "0.6522321",
"text": "def destroy\n @acta.destroy\n respond_to do |format|\n format.html { redirect_to actas_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1d85d99e83755aa6408d1f2766310519",
"score": "0.65222836",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n #format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6083398146326d9abc404d4c896db347",
"score": "0.6522174",
"text": "def destroy\n @user_item = UserItem.find_by(item_id: params[:id])\n @user_item.destroy\n render json: {message: \"Deleted!\"}\n end",
"title": ""
},
{
"docid": "8f314271b6ddc87eeeea2ba210ec49d1",
"score": "0.6522033",
"text": "def delete\n render json: Person.delete(params[\"id\"])\n end",
"title": ""
},
{
"docid": "7b303d14778fd64b03bb004c119e9900",
"score": "0.6521089",
"text": "def delete(user)\n Rails.logger.debug \"Call to election.delete\"\n reqUrl = \"/api/election/#{self.id}\" #Set the request url\n rest_response = MwHttpRequest.http_delete_request(reqUrl,user['email'],user['password']) #Make the DELETE request to the server with the required parameters\n Rails.logger.debug \"Response from server: #{rest_response.code} #{rest_response.message}: #{rest_response.body}\"\n if rest_response.code == \"200\" #Validate if the response from the server is 200, which means OK\n return true, rest_response #Return success\n else\n return false, \"#{rest_response.code} #{rest_response.message}\" #Return error\n end\n end",
"title": ""
},
{
"docid": "baf99b43a04aed7e7573146f2d002fb3",
"score": "0.65203196",
"text": "def destroy\n @record = User.find(params[:id])\n @record.trash\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9ee2f45d825ad858042c6c0b31970adf",
"score": "0.65195507",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n \n end",
"title": ""
},
{
"docid": "376b4f7e152f407f3e5ee2b58bebf40d",
"score": "0.6516029",
"text": "def destroy\n @user = User.find(params[:id]) \n # then delete the user\n @user.destroy \n \n respond_to do |format|\n format.html { redirect_to users_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c1cde2518cb592b6add14fe05ae1b37d",
"score": "0.65128726",
"text": "def delete\n options = self.to_h \n uri = self.class.path_builder(:delete, self.id)\n data = {}\n data['id'] = self.id \n data = data.to_json\n VivialConnect::Client.instance.make_request('DELETE', uri, data)\n end",
"title": ""
},
{
"docid": "f04688822cf05682487241ea4b620231",
"score": "0.6509909",
"text": "def delete_user(user_id)\n start.uri('/api/user')\n .url_segment(user_id)\n .url_parameter('hardDelete', true)\n .delete()\n .go()\n end",
"title": ""
},
{
"docid": "c21e400eb9ceef696a81377597e63a42",
"score": "0.6504555",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n \n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c21e400eb9ceef696a81377597e63a42",
"score": "0.6504555",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n \n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c21e400eb9ceef696a81377597e63a42",
"score": "0.6504555",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n \n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "48a547bf26d6cb827ad21d18c74a0be9",
"score": "0.6499717",
"text": "def destroy\n user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "822ddea2e45bf78350003645efcbdb54",
"score": "0.6499315",
"text": "def delete uri, args = {}; Request.new(DELETE, uri, args).execute; end",
"title": ""
},
{
"docid": "f94ce5c1d8c9e9ebe6c6588ca8157df7",
"score": "0.649858",
"text": "def destroy\n\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "7c1c1b68b32ba0b89f7e08f1060573e6",
"score": "0.64976496",
"text": "def delete\n @user = User.delete(params[:id])\n respond_with(@user)\n end",
"title": ""
},
{
"docid": "4825105cd8c1c6f494ad75032e75ee5b",
"score": "0.64972466",
"text": "def destroy\n @user_request = UserRequest.find(params[:id])\n @user_request.destroy\n\n respond_to do |format|\n format.html { redirect_to user_requests_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "23dfd87924927457b30396b620979f5f",
"score": "0.649684",
"text": "def destroy\n @jsonuserdata.destroy\n respond_to do |format|\n format.html { redirect_to jsonuserdata_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6676a9c1eab727d4e1a8ecbda8f714c2",
"score": "0.6496838",
"text": "def destroy\n user = @user_click.user\n @user_click.destroy\n respond_to do |format|\n format.html { redirect_to user_user_clicks_url(user), notice: 'User click was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
7ffe2671a01a5f0411ada1d5c2903428
|
GET /tagcreations GET /tagcreations.json
|
[
{
"docid": "7e33f85e2b51f8e9f011f9b329696ca4",
"score": "0.5876883",
"text": "def index\n @tagcreations = Tagcreation.paginate(page: params[:page], per_page: 6) \n end",
"title": ""
}
] |
[
{
"docid": "cb8ce89d91f0da86a739d71339e0c836",
"score": "0.64231074",
"text": "def tags\n request.get '/tags'\n # e.g. [\"component\", \"generation\", \"host\", \"member\"]\n end",
"title": ""
},
{
"docid": "cf634a7a3f3bd85288dd764b756ffc75",
"score": "0.6414045",
"text": "def create\n collection = Collection.find(params[:collection_id])\n p collection\n p \"8\" * 25\n tag = collection.tags.new(name: params[:name])\n \n if tag.save\n p tag\n p tag.collections\n render json: tag\n else\n render(status 404)\n end\n end",
"title": ""
},
{
"docid": "1ccc052184a7a227e6671f81257de915",
"score": "0.6287402",
"text": "def tagList()\n http, req = initReq(\"tags/\")\n JSON.parse(http.request(req).body)\nend",
"title": ""
},
{
"docid": "1ccc052184a7a227e6671f81257de915",
"score": "0.6287402",
"text": "def tagList()\n http, req = initReq(\"tags/\")\n JSON.parse(http.request(req).body)\nend",
"title": ""
},
{
"docid": "b6141e1ecee3937808333a3267611fbb",
"score": "0.61879843",
"text": "def tag_recipes \n recipes = Recipe.tag_recipes(params[:tag_id])\n render json: recipes, :include => :user, except: [:created_at, :updated_at]\n end",
"title": ""
},
{
"docid": "16465aca4cde81f3f4ce1635938e0ef3",
"score": "0.6186283",
"text": "def tags\n @tags = ActsAsTaggableOn::Tag.all\n render json: @tags\n end",
"title": ""
},
{
"docid": "79e05cda9771f37ae259324a97df3ea3",
"score": "0.6145882",
"text": "def tags\n render json: @tags, status: 200\n end",
"title": ""
},
{
"docid": "d838e73705695f6a18f7f4cc3e4f4f79",
"score": "0.60876054",
"text": "def create\n @tag = Tag.create!(tag_params)\n json_response(@tag, :created)\n end",
"title": ""
},
{
"docid": "561ebefe8a5f1776370d34920ff74b55",
"score": "0.60449785",
"text": "def get_tags\n resp = RestClient.get(\"#{@server}/tags.json\", cookies: @cookies)\n tags = parse_response(resp)\n end",
"title": ""
},
{
"docid": "1c2b982362fa17d977f84e105a4c10cb",
"score": "0.6039838",
"text": "def index\n @creator_tags = CreatorTag.all\n end",
"title": ""
},
{
"docid": "4dafc6ae9fdb17c7a1edd6b3ed7109b4",
"score": "0.5984003",
"text": "def tag_list\n tags = Tag.select('id, name').order('name asc')\n render json: {code: 200, tags: tags}\n end",
"title": ""
},
{
"docid": "daca309b99df1d54d63033258b65c4d8",
"score": "0.597781",
"text": "def tags()\n @tags ||= get(\"/tags/all.json\").map {|x| Tag.new(x[\"tag\"])}\n end",
"title": ""
},
{
"docid": "7aa2107e18cf28e64fb799869fa1377e",
"score": "0.5955887",
"text": "def repo_tags\n @owner = Owner.first!(params[:login])\n @repo = Repo.first!(\"#{params[:repo_login]}/#{params[:repo_name]}\")\n render :json => @owner.taylor_get(:tags, :via => @repo).map {|name| Tag.new(:name => name) }\n end",
"title": ""
},
{
"docid": "3bcbc8115c19ca189eb2f7bcfc3e48af",
"score": "0.59258616",
"text": "def tag_cloud_list\n if params[:id] =~ /^\\d+$/\n investigator = Investigator.include_deleted(params[:id])\n else\n investigator = Investigator.find_by_username_including_deleted(params[:id])\n end\n result = []\n tags = investigator.abstracts.tag_counts(:limit => 15, :order => \"count desc\")\n tags.each { |tag| result << [tag.name, tag.count] }\n render :json => result.to_json\n end",
"title": ""
},
{
"docid": "c5f2a8860d3b6b4f39e0097ef256a21f",
"score": "0.5919065",
"text": "def create\n tp = tag_params\n\n # NOTE: associate tag to user/group\n @tag = Tag.find_or_create_by(\n name: tp[:name].downcase,\n group: tp[:group]\n )\n\n if @tag.valid?\n\n render json: @tag.as_json(\n only: [],\n methods: %i[id name taggings_count]\n )\n else\n render json: {\n errors: Stitches::Errors.from_active_record_object(@tag)\n }, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "b9796e5a465887d31a9322b9427b0707",
"score": "0.586644",
"text": "def new\n @photo = Photo.new\n @tags = current_user.photos.tag_counts({:conditions => \"user_id=#{current_user.id}\"}).map(&:name).to_json\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @photo }\n end\n end",
"title": ""
},
{
"docid": "26010082ed88ed745547d356470bd325",
"score": "0.58608913",
"text": "def list_tags\n payload = []\n \n tags = Tag.all\n tags.each do |tag|\n payload << tag.text\n end\n \n respond_to do |format|\n format.html {render :layout => false, :json => payload}\n format.json {render :layout => false, :json => payload}\n end\n end",
"title": ""
},
{
"docid": "88bc3c2dc7fbe129abde86e55ff089ad",
"score": "0.5854364",
"text": "def new\n @tag = @user.tags.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tag }\n end\n end",
"title": ""
},
{
"docid": "c6f6e481dad72b116f09d1cdc3799c29",
"score": "0.5852868",
"text": "def create\n @tag = current_user.tags.create!(tag_params)\n render json: @tag\n end",
"title": ""
},
{
"docid": "a699ec90776ded785fcf2cfaba617531",
"score": "0.5843092",
"text": "def index\n\tif params[:tag]\n \t@resources = Resource.tagged_with(params[:tag])\n \telse\n \t\t@resources = Resource.order(\"id DESC\")\n \tend\n \t\n \t@newresource = Resource.new\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @resources }\n end\n end",
"title": ""
},
{
"docid": "2653af226193b1ea3d7f37deb71676ba",
"score": "0.58231145",
"text": "def index\n Recipe.where(:public => true).paginate(:page => params[:page]).order('id DESC')\n\n if params[:tag]\n @recipes = Recipe.tagged_with(params[:tag]).page(params[:page]).order('created_at DESC')\n else\n @recipes = Recipe.page(params[:page]).order('created_at DESC')\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @recipes }\n end\n end",
"title": ""
},
{
"docid": "80e1f869436224bbd9d035ce7aacef15",
"score": "0.5812224",
"text": "def create\n authorize Tag\n @tag = @category.tags.new(tag_params)\n\n if @tag.save\n render status: :created\n else\n render json: {errors: @tag.errors}, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "44d830033c9a211ca6ce87d3d6e0f590",
"score": "0.58089286",
"text": "def create\n @creator_tag = CreatorTag.new(creator_tag_params)\n\n respond_to do |format|\n if @creator_tag.save\n format.html { redirect_to @creator_tag, notice: 'Creator tag was successfully created.' }\n format.json { render :show, status: :created, location: @creator_tag }\n else\n format.html { render :new }\n format.json { render json: @creator_tag.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d34b49df84742f80628951777708ce83",
"score": "0.57892054",
"text": "def get_popular_json\n @popular_tags = []\n #within each tag, if the user is missing a usership for any public doc, return false\n Tag::POPULAR_TAGS.each do |tag|\n @tag_container = []\n @tag_container << tag[0]\n @tag_container << tag[1]\n @documents = Document.all(:conditions => {:tag_id => tag[0], :public => true})\n if @documents.empty?\n @owner = false\n else\n @owner = true\n @documents.each do |doc|\n if Usership.find_by_document_id_and_user_id(doc.id, current_user.id).nil?\n @owner = false\n break\n end\n end\n end\n @tag_container << @owner\n @popular_tags << @tag_container\n end\n render :json => @popular_tags\n end",
"title": ""
},
{
"docid": "d7762593ee46accb9dfce15f5403a798",
"score": "0.57851994",
"text": "def new\n @recipe_tag = RecipeTag.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recipe_tag }\n end\n end",
"title": ""
},
{
"docid": "7acb33e3cfded08315fed2beb3526bc0",
"score": "0.5780834",
"text": "def create\n # User enters the name of the tag\n tag_name = params[:tag_name]\n # They're on a specific recipe when they do this (current_recipe)\n @recipe = Recipe.find(params[:recipe_id])\n # We want to look up the tag_name that was entered to see if it exists. If it does, we want to grab that tag_id. If it doesn't, we want to create that tag and get its new tag_id.\n @tag = Tag.find_or_create_by(name: tag_name, user_id: current_user.id)\n @recipe_tag = RecipeTag.new({\n recipe_id: @recipe.id,\n tag_id: @tag.id\n })\n if @recipe_tag.save\n @recipe = Recipe.find(params[:recipe_id])\n render 'show.json.jb'\n else\n render json: { errors: @recipe_tag.errors.full_messages }, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "d7330b255b61dc213f63b45012dcf71f",
"score": "0.57730454",
"text": "def tags\n @tags = Post.tags\n @tags = @tags.map do |tag|\n {:tag => \"#{tag}\"}\n end\n @tags = {tags: @tags};\n respond_to do |format|\n format.html { render :json => @tags }\n format.json { render :json => @tags }\n end\n end",
"title": ""
},
{
"docid": "49a5bc386623cae10c170d614b4d97b8",
"score": "0.57665527",
"text": "def create\n @new_tag = current_user.tags.create(:name => params[:name])\n respond_to do |format|\n format.json{ render :json => @new_tag}\n end \n end",
"title": ""
},
{
"docid": "9d65cba02d30e2eb870c50f0f65e58ef",
"score": "0.57652277",
"text": "def classifier_taggings \n if params[:atom].nil?\n render :status => :bad_request, :text => \"Missing Atom Document\"\n elsif request.post?\n @tag.create_taggings_from_atom(params[:atom])\n render :status => :no_content, :nothing => true\n elsif request.put?\n @tag.replace_taggings_from_atom(params[:atom])\n render :status => :no_content, :nothing => true\n end\n end",
"title": ""
},
{
"docid": "be1caceaf61524e1db8e68bd3e305f33",
"score": "0.573692",
"text": "def create\n\t @tag = Tag.new(tag_params)\n if @tag.save\n render json: @tag, status: :created\n else\n render json: {errors: @tag.errors}, status: :unprocessable_entity\n end\n\tend",
"title": ""
},
{
"docid": "4480b6333f55358060a316aed05f7ff7",
"score": "0.5731316",
"text": "def create\n @tag = Tag.new(tag_params)\n\n if @tag.save\n render json: @tag, status: :created, location: @tag\n else\n render json: @tag.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "367a5f5dc476d2b0991ad87fff83016b",
"score": "0.5719897",
"text": "def index\n @tags = current_user.owned_tags\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @tags }\n end\n end",
"title": ""
},
{
"docid": "343c0e3b6755535fbaf8149ea16c72a5",
"score": "0.5715861",
"text": "def new\n @tag = Tag.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tag }\n end\n end",
"title": ""
},
{
"docid": "343c0e3b6755535fbaf8149ea16c72a5",
"score": "0.5715861",
"text": "def new\n @tag = Tag.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tag }\n end\n end",
"title": ""
},
{
"docid": "343c0e3b6755535fbaf8149ea16c72a5",
"score": "0.5715861",
"text": "def new\n @tag = Tag.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tag }\n end\n end",
"title": ""
},
{
"docid": "343c0e3b6755535fbaf8149ea16c72a5",
"score": "0.5715861",
"text": "def new\n @tag = Tag.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tag }\n end\n end",
"title": ""
},
{
"docid": "343c0e3b6755535fbaf8149ea16c72a5",
"score": "0.5715861",
"text": "def new\n @tag = Tag.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tag }\n end\n end",
"title": ""
},
{
"docid": "343c0e3b6755535fbaf8149ea16c72a5",
"score": "0.5715861",
"text": "def new\n @tag = Tag.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tag }\n end\n end",
"title": ""
},
{
"docid": "343c0e3b6755535fbaf8149ea16c72a5",
"score": "0.5715861",
"text": "def new\n @tag = Tag.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tag }\n end\n end",
"title": ""
},
{
"docid": "343c0e3b6755535fbaf8149ea16c72a5",
"score": "0.5715861",
"text": "def new\n @tag = Tag.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tag }\n end\n end",
"title": ""
},
{
"docid": "343c0e3b6755535fbaf8149ea16c72a5",
"score": "0.5715861",
"text": "def new\n @tag = Tag.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tag }\n end\n end",
"title": ""
},
{
"docid": "84a2da36bdcd92d717189a4b59a3b979",
"score": "0.5692515",
"text": "def index \n @tags = Tag.all.map(&:name)\n render json: @tags, status: 200\n end",
"title": ""
},
{
"docid": "c7e568a8acbd1bb896cff9fe2118ce6c",
"score": "0.56919",
"text": "def new\n @tag = CustomTag.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tag }\n end\n end",
"title": ""
},
{
"docid": "0744c2629248732e226b8375eecf27d2",
"score": "0.56819355",
"text": "def create\n @confession = Confession.new(params[:confession])\n @confession.user = current_user if user_signed_in?\n \n params[:tags].split.each do |tag|\n \t\n\t \tif Tag.find_by_name(tag).nil?\n\t \t\ttag = Tag.new(:name=>tag)\n\t \telse\n\t \t\ttag = Tag.find_by_name(tag)\t\n\t \tend\n\t \t@confession.tags << tag \t\t\n\t\t\t\n\t\tend\n \n respond_to do |format|\n if @confession.save\n format.html { redirect_to @confession, notice: 'Confession was successfully created.' }\n format.json { render json: @confession, status: :created, location: @confession }\n else\n format.html { render action: \"new\" }\n format.json { render json: @confession.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b680f569d56c209321f5637c70e1d05f",
"score": "0.56792074",
"text": "def new\n @competition = Competition.new\n chosen_tags_competition=[]\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @competition }\n end\n end",
"title": ""
},
{
"docid": "537f75223b9c8eed2acd2db950023514",
"score": "0.56775326",
"text": "def tag\n # Whats the last tag we are asking for? (the rest don't matter I don't think..)\n requested_tag = params[:tag].split(\"/\").last\n tag = Taxonomy.find_by_seo_url requested_tag\n\n if tag.present?\n @contents = ContentDecorator.decorate(get_contentss tag.contents, { :state => :published, :is_indexable => true, :is_sticky => false, :password => nil })\n\n respond_to do |format|\n format.html { render :template => 'default/index' }\n format.json { render json: @contents }\n end\n else\n # No such category found, redirect to root index\n redirect_to root_path\n end\n end",
"title": ""
},
{
"docid": "b3dd8bec16ca5bcbe47db6352aafb84f",
"score": "0.5675891",
"text": "def tagged\n @tags = params[:tags]\n @tags = @tags.split(\"+\").collect { |t| t.split(\"-\").join(\" \") }\n @items = Item.tagged_with(@tags, :any => true)\n\n respond_to do |format|\n format.html # tagged.html.erb\n format.json { render json: @items }\n end\n end",
"title": ""
},
{
"docid": "3fbad4ce373c32bec69270627e5b23f8",
"score": "0.5675441",
"text": "def getTags\n return HTTParty.get(REST_API + '/tag_list', {format: :json})\nend",
"title": ""
},
{
"docid": "f7c2179249e807d8c422e1e6716475e2",
"score": "0.56703717",
"text": "def new\n @tag = Tag.new\n @tags_dbs = TagsDb.all\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tag }\n end\n end",
"title": ""
},
{
"docid": "cd2bb54b7784bf79e5d305034bcdb3de",
"score": "0.5666982",
"text": "def new\n @candidate = Candidate.new\n @tags = Candidate.tag_counts_on(:tags)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @candidate }\n end\n end",
"title": ""
},
{
"docid": "0933b03b34f47d7a576ee4b985de10da",
"score": "0.5666548",
"text": "def create\n @recipe = Recipe.new(params[:recipe])\n @recipe.user = current_user\n @recipe.create_at = DateTime.now\n @recipe.update_at = DateTime.now\n @recipe.user.tag(@recipe, :with => params[:recipe][:tag_list], :on => :skills)\n \n respond_to do |format|\n if @recipe.save\n format.html { redirect_to(@recipe, :notice => 'Recipe was successfully created.') }\n format.xml { render :xml => @recipe, :status => :created, :location => @recipe }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @recipe.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d8f249e829024039091bad2949592194",
"score": "0.5659612",
"text": "def creators(options = {})\n # v1/public/creators\n get('creators', options)\n end",
"title": ""
},
{
"docid": "8f6f223dfbf95cafae750b796603aad0",
"score": "0.5656677",
"text": "def create\n @taggable = find_taggable\n tags = @taggable.tags_from(@user)\n @tag = @user.tag(@taggable, :with => tags << params[:tags], :on => :tags)\n\n respond_to do |format|\n if @tag\n flash[:notice] = 'Tag(s) was successfully created.'\n # format.html { redirect_to :id => nil }\n format.xml { render :xml => @tag, :status => :created, :location => @tag }\n else\n # format.html { render :action => \"new\" }\n format.xml { render :xml => @tag.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3d7df21744cd566beb6754b2f9e0baed",
"score": "0.5655751",
"text": "def index\n unless user_signed_in? || current_user.type != 'Admin'\n render :text => 'You Need To sign in as An Admin'\n return\n end\n @tags = Tag.find(:all, :order => 'created_at')\n @tag = Tag.new\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tags }\n end\n end",
"title": ""
},
{
"docid": "4562456706d57405e4600d218f0e50b0",
"score": "0.5652582",
"text": "def new\r\n puts params\r\n @tag = Tag.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @tag }\r\n end\r\n end",
"title": ""
},
{
"docid": "90121096a67418d861d84174c13133e1",
"score": "0.56436974",
"text": "def new\n @encounter = Encounter.new\n @tags = current_user.encounters.tag_counts_on(:tags)\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @encounter }\n end\n end",
"title": ""
},
{
"docid": "ab3b518a1cadb3b9ba7be37c00034c09",
"score": "0.56386846",
"text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tag }\n end\n end",
"title": ""
},
{
"docid": "860e9279fc984354429b1d079b66bde3",
"score": "0.56334335",
"text": "def new\n @tag = Tag.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @tag }\n end\n end",
"title": ""
},
{
"docid": "df022571c18bc26e9562dc1f6a37dfe8",
"score": "0.5629117",
"text": "def index\n # NOTE: Pulling tags only for the owner passed in\n @tags = Tag.where(group: tag_params[:group]).order(:name)\n # @tags = @tags.to_a.reject!{ |t| t['is_archived'] == true} unless params[:include_archived].present? && params[:include_archived] == 'true'\n\n if @tags\n render json: @tags.as_json(\n only: [],\n methods: %i[id name taggings_count]\n )\n else\n render json: {\n errors: Stitches::Errors.from_active_record_object(@tags)\n }, status: 422\n end\n end",
"title": ""
},
{
"docid": "971f5853b6fbd734d521af07a3efd424",
"score": "0.5623025",
"text": "def tags\n uri = tag_uri(nil)\n get_request(uri)\n end",
"title": ""
},
{
"docid": "4fb3cc0597fb000ddd7e9acec881c4f5",
"score": "0.560154",
"text": "def index\n authorize Tag\n @tags = @category.tags.all\n render\n end",
"title": ""
},
{
"docid": "9bf493ab4fb85f30efe8886e151fe2b6",
"score": "0.5593974",
"text": "def new\n if current_user.try(:admin?)\n @tag = Tag.new\n @tag.uniqueUrl = (0...20).map{ ('a'..'z').to_a[rand(26)] }.join\n\n #Check for uniqueness in the tag url.\n\n while (!Tag.where(:uniqueUrl => @tag.uniqueUrl).first.nil?)\n @tag.uniqueUrl = (0...20).map{ ('a'..'z').to_a[rand(26)] }.join\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tag }\n end\n else\n flash[:notice] = 'You need admin privileges to go there.'\n redirect_to :controller => \"home\", :action => \"index\"\n end\n end",
"title": ""
},
{
"docid": "754aab72d79c64ff90f216fc4f2e7d8e",
"score": "0.55860925",
"text": "def create\n @tagcreation = Tagcreation.new(tagcreation_params)\n\n respond_to do |format|\n if @tagcreation.save\n format.html { redirect_to @tagcreation, notice: 'Tagcreation was successfully created.' }\n format.json { render :show, status: :created, location: @tagcreation }\n else\n format.html { render :new }\n format.json { render json: @tagcreation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "33d5122bc434f6cea2d574273a3b5389",
"score": "0.5585687",
"text": "def show\n @diaries = Diary.tagged_with(@tag.name)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tag }\n end\n end",
"title": ""
},
{
"docid": "c263c8f1e49e945ea8b553998135f4b2",
"score": "0.5582695",
"text": "def new\n @tag = current_user.tags.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @tag }\n end\n end",
"title": ""
},
{
"docid": "d73c744fdec40ec6f1a34f5a9bb111f5",
"score": "0.558123",
"text": "def tags\n begin\n totale_righe = Tag.count\n lista = Tag.order(nome: :asc)\n lista_per_tabella = (lista.blank? ? [] : lista.to_a.map{|riga| {'value' => riga[:id], 'label' => riga[:nome] } })\n @esito = {\n stato: 'ok',\n totale_righe: totale_righe,\n lista_per_tabella: lista_per_tabella,\n }\n rescue => exception\n logger.error exception.message\n logger.error exception.backtrace.join(\"\\n\")\n @esito = {\n stato: 'ko',\n errore: exception.message\n }\n end\n \n respond_to do |format|\n format.json { render json: @esito }\n end\n end",
"title": ""
},
{
"docid": "984d4a4bb0ca2e4849dfdf94d97c54fa",
"score": "0.55800796",
"text": "def create\n @tag = current_user.tags.find_by_name(tagging_params[:tag_name])\n unless @tag\n @tag = Tag.create(name: tagging_params[:tag_name], owner_id: current_user.id)\n end\n note = Note.find_by_id(tagging_params[:note_id])\n\n if @tag.owner_id != note.author_id\n render json: [\"Forbidden taggings creation\"], status: 403\n return\n end\n\n if @tag.owner_id != current_user.id\n render json: [\"Unauthorized user\"], status: 401\n end\n\n @tagging = Tagging.new(tag_id: @tag.id,\n note_id: tagging_params[:note_id], owner_id: current_user.id)\n\n if @tagging.save\n render :show\n else\n render json: @tagging.errors.full_messages, status: 400\n end\n end",
"title": ""
},
{
"docid": "cb1d2a8463b876db02fed54087dff992",
"score": "0.5575041",
"text": "def new\n @project = Project.new\n @categories = Category.find(:all)\n @category = Category.new\n @tags = Tag.find(:all).collect{|tag| [tag.name, tag.id]}\n \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end",
"title": ""
},
{
"docid": "ef6cec30aac6f36076d1513b85905660",
"score": "0.55728334",
"text": "def create\n @recipe_tag = RecipeTag.new(params[:recipe_tag])\n\n respond_to do |format|\n if @recipe_tag.save\n format.html { redirect_to @recipe_tag, notice: 'Recipe tag was successfully created.' }\n format.json { render json: @recipe_tag, status: :created, location: @recipe_tag }\n else\n format.html { render action: \"new\" }\n format.json { render json: @recipe_tag.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "48b3c4d4f4737bb94c30231387ed56d9",
"score": "0.5570433",
"text": "def index\n @resources = Resource.tagged_with(params[:tag]) if params[:tag]\n @season_tags = Tag.season_tags\n @door_tags = Tag.door_tags\n @level_tags = Tag.level_tags\n end",
"title": ""
},
{
"docid": "c0a2bd722b860f6c0a364bec111ce142",
"score": "0.5563788",
"text": "def index\n render json: Tag.all, status: :ok\n end",
"title": ""
},
{
"docid": "4c390386b54240d5054edf99390e08f8",
"score": "0.5562409",
"text": "def create\n @tag = Tag.new(tag_params)\n @tag.added_by = User.find(current_user.id)\n @tag.name.downcase!\n respond_to do |format|\n if @tag.save\n format.html { redirect_to \"/\", notice: 'Tag was successfully created.' }\n format.json { render json: { tag: @tag } }\n else\n format.html { render :new }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e99e59c3f0956d291b8df03cf9b5a80c",
"score": "0.55623794",
"text": "def all_tags\n request(:get,\"/tags\")\n end",
"title": ""
},
{
"docid": "13ff8ecd77b828a1853c27f09ec42560",
"score": "0.5559714",
"text": "def index\n @tags = Tag.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tags }\n end\n end",
"title": ""
},
{
"docid": "70eefacb61cf7f9d808168afa0dcac1c",
"score": "0.5558667",
"text": "def create\n @tag = Tag.new(tag_params)\n\n respond_to do |format|\n if @tag.save\n Tagging.create(tag_id: @tag.id, post_id: @post.id)\n format.html { redirect_to edit_authors_post_path(@post), notice: \"Tag was successfully created.\" }\n format.json { render json: {success: 'success'}, status: :created}\n else\n format.html { redirect_to edit_authors_post_path(@post), alert: 'Error. Could not add the tag.' }\n format.json { render json: {error: @tag.errors}, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ea32a8d95b0118ffe5945ce79e379ce8",
"score": "0.55550504",
"text": "def tags\n resource.tags\n end",
"title": ""
},
{
"docid": "e72d2ffe72ce6aab72080c8584adb94d",
"score": "0.5552719",
"text": "def new\n @tag_category = TagCategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tag_category }\n end\n end",
"title": ""
},
{
"docid": "a3e3ff38d6d86e132211f2578fc7e793",
"score": "0.5549786",
"text": "def tag\n @communities = Community.find_tagged_with(params[:id])\n #all tags\n @tags = Community.tag_counts\n end",
"title": ""
},
{
"docid": "c9f24408e6e58861ae900bccc761cf89",
"score": "0.5548842",
"text": "def fetch_tags\n tags = []\n\n @client.tags(@project_id, DEFAULT_REQUEST_OPTIONS).auto_paginate do |new_tag|\n tags << new_tag\n end\n print_empty_line\n\n if tags.empty?\n GitHubChangelogGenerator::Helper.log.warn \"Warning: Can't find any tags in repo. \\\nMake sure, that you push tags to remote repo via 'git push --tags'\"\n else\n GitHubChangelogGenerator::Helper.log.info \"Found #{tags.count} tags\"\n end\n tags.map { |resource| stringify_keys_deep(resource.to_hash) }\n end",
"title": ""
},
{
"docid": "4752d793e862f6e2c8e0c6fe20c30b86",
"score": "0.55469763",
"text": "def get_candidate_tags\n @candidates.each do |iid|\n itag = @client.describe_tags(filters: [{name: \"resource-id\", values: [iid]},{name: \"key\", values: [\"Name\"]}])\n @info.push(itag)\n end\nend",
"title": ""
},
{
"docid": "76f73f16d0515f04e52fb6f8d88ce067",
"score": "0.55429804",
"text": "def show\n params[:page] ||= 1\n @tag = Tag.find_by_name(params[:id]) || raise_404\n @taggings = @tag.taggings.order(:karma).reverse_order.paginate(:page => params[:page], :per_page => 25)\n\n respond_to do |format|\n format.html\n format.json { render json: @taggings}\n end\n end",
"title": ""
},
{
"docid": "44639cf95884894ecb9aad8c1d0f6078",
"score": "0.5539147",
"text": "def index\n #@contenttags = Contenttag.all\n @taggable = find_taggable\n @contenttags = @taggable.contenttags\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @contenttags }\n end\n end",
"title": ""
},
{
"docid": "b906e14b92bd13611f79265310e7515a",
"score": "0.55377364",
"text": "def get_tags\n\t\tparams[:tags].each do |t|\n\t\t\ttag = Tag.find_or_create_by(name: t)\n\t\t\tif tag.valid?\n\t\t\t\t@resource.tags << tag\n\t\t\telse\n\t\t\t\t@resource.errors.add(:tags, {tag.name => tag.errors})\n\t\t\tend\n\t\tend if params[:tags].is_a?(Array)\n\tend",
"title": ""
},
{
"docid": "940de1b5af2e83d4444ad54c56201319",
"score": "0.55357325",
"text": "def index\n \n @tagcreations = Tagcreation.paginate(page: params[:page], per_page: 6) \n if params[:search]\n @search_term = params[:search]\n @tagcreations =@tagcreations.search_by(@search_term)\n end\n end",
"title": ""
},
{
"docid": "8b742b4b8975e3ea1549361ca1cf8d51",
"score": "0.55351335",
"text": "def index\n\n @tag = params[:tag]\n query = @tag ? Tutorial.published.tagged_with(@tag) : Tutorial.published\n @tutorials = query.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tutorials }\n end\n end",
"title": ""
},
{
"docid": "828f343720c405c94eb62f10388fb9f0",
"score": "0.5533203",
"text": "def index\n if params[:contact_id]\n @tags = Contact.find(params[:contact_id]).tags\n else\n @tags = @account.tags\n end\n @tags = @tags.order_by([:name,:asc])\n respond_to do |type|\n type.json {render :json => { :collection => @tags, :total => @tags.count}}\n end\n end",
"title": ""
},
{
"docid": "8f20af75ebb477a13ff6f276a4028c38",
"score": "0.5526219",
"text": "def tags\n @tags ||= TagsService.new(@http_client)\n end",
"title": ""
},
{
"docid": "f434462d97d4d506b197cd703fb99e22",
"score": "0.5520876",
"text": "def tags\n response = get 'tags'\n response.map{|item| Hashie::Mash.new(item)}\n end",
"title": ""
},
{
"docid": "b305338f8ce9d5ef86621c75a119405b",
"score": "0.55187523",
"text": "def index\n if params[:tag]\n @resources = Resource.tagged_with(params[:tag])\n else\n @resources = Resource.all\n end\n end",
"title": ""
},
{
"docid": "e696bc3d2bf740a81f7598db7e2454c7",
"score": "0.5515965",
"text": "def tags\n get_collection 'tags', :class => Buxfer::Tag\n end",
"title": ""
},
{
"docid": "5b8aaea4d1ef9d7066ae62612104cec1",
"score": "0.55023223",
"text": "def tag_resources\n tag = tag_resources_params[ :tag ]\n user = User.find_by( slug: params[:user_slug])\n resourcesJson = []\n if !user.nil?\n rts = ResourcesTags.preload(:resource).joins(:tag).where(\"resources_tags.user_id='#{user.id}' AND tags.name='#{tag}'\")\n rts.each do |rt|\n resourcesJson.append( ResourceCardSerializer.new( rt.resource ).as_json )\n end\n end\n render json: resourcesJson\n end",
"title": ""
},
{
"docid": "db8ad37276c52fde5948521f3802a96c",
"score": "0.5495501",
"text": "def create\n @recipe = Recipe.new(recipe_params)\n @recipetags = RecipeTag.where(:id => params[:tag_list])\n @recipe.recipe_tags << @recipetags\n\n respond_to do |format|\n if @recipe.save\n format.html { redirect_to @recipe, notice: 'Recipe was successfully created.' }\n format.json { render :show, status: :created, location: @recipe }\n else\n format.html { render :new }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e371b05b0aff74ece18724471ccff706",
"score": "0.54919064",
"text": "def new\n @tag = Tag.new\n#\t@tag.user_id = current_user.id\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tag }\n end\n end",
"title": ""
},
{
"docid": "2615550dd160da18817f2225ee526e46",
"score": "0.54910636",
"text": "def new\n @tag = Tag.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tag }\n format.js{render json: @tag}\n end\n end",
"title": ""
},
{
"docid": "10e18af7fa9af150041a925ff8dde964",
"score": "0.54872763",
"text": "def create\n @tag = Tag.new(tag_params)\n\n respond_to do |format|\n if @tag.save\n format.json { render json: @scans, status: :created }\n else\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c1a7c485f6ccebee0ea102b2648277c2",
"score": "0.5486807",
"text": "def show\n @taggings = current_user.owned_taggings(:include => :taggable).where(\"#{ActsAsTaggableOn::Tagging.table_name}.tag_id = ?\", @tag.id)\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @tag }\n end\n end",
"title": ""
},
{
"docid": "01bca309e9dac2cc6770051fedd3a6a4",
"score": "0.54820114",
"text": "def tags \n @tags = ActsAsTaggableOn::Tag.where(\"tags.name LIKE ?\", \"%#{params[:q]}%\") \n respond_to do |format|\n format.json { render :json => @tags.collect{|t| {:id => t.name, :name => t.name }}}\n end\n end",
"title": ""
},
{
"docid": "57737fea4c8c282825ffd1086e16437d",
"score": "0.5479211",
"text": "def tag_data\n { :pre => tags.map(&:attributes), :hint => \"Type your tag(s) for the recipe here\" }.to_json\n end",
"title": ""
},
{
"docid": "edaeaa8692d7894f9da6636daa9525aa",
"score": "0.547896",
"text": "def tags\r\n return unless validate_id_and_get_app\r\n @tags = @app.unique_tags\r\n api_response @tags.facade(@current_user, app_id: @app.id, with_user_icons: true), \"tags\"\r\n end",
"title": ""
},
{
"docid": "78ad7fb7d1d20472fee25b222391163d",
"score": "0.547879",
"text": "def index\n @taggings = Tagging.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @taggings }\n end\n end",
"title": ""
}
] |
ac193002a3dbee95ae01a75ad27ba8f7
|
Variables in subscope don't appear in parent scope.
|
[
{
"docid": "6cc5ddba1d2041a54900a27de67c5a45",
"score": "0.6286951",
"text": "def test_scopes\n s0 = Scope.new\n s0.rucas {\n var :a\n var :b\n }\n s1 = s0.subscope\n s1.rucas {\n var :c\n }\n assert s0.respond_to?(:a)\n assert s0.respond_to?(:b)\n assert !s0.respond_to?(:c)\n assert s1.respond_to?(:a)\n assert s1.respond_to?(:b)\n assert s1.respond_to?(:c)\n end",
"title": ""
}
] |
[
{
"docid": "056fdc29100b43dab7cf6300b60ef4c9",
"score": "0.69355774",
"text": "def put_var_scope\nend",
"title": ""
},
{
"docid": "906cc54d133c8e537ec59858c326531a",
"score": "0.6756794",
"text": "def current_scope=(scope); end",
"title": ""
},
{
"docid": "906cc54d133c8e537ec59858c326531a",
"score": "0.6756794",
"text": "def current_scope=(scope); end",
"title": ""
},
{
"docid": "906cc54d133c8e537ec59858c326531a",
"score": "0.6756794",
"text": "def current_scope=(scope); end",
"title": ""
},
{
"docid": "a5432aadd8cc5947db0ccf866c05e0a0",
"score": "0.67113817",
"text": "def scope=(_); end",
"title": ""
},
{
"docid": "a5432aadd8cc5947db0ccf866c05e0a0",
"score": "0.67113817",
"text": "def scope=(_); end",
"title": ""
},
{
"docid": "ac60cfa97c9fc3fc86eef2c6275725cf",
"score": "0.6542215",
"text": "def inspect_variables_in_scope(scope_node); end",
"title": ""
},
{
"docid": "06178454833b7ed28ed1061a5536dc4c",
"score": "0.65249085",
"text": "def current_scope; end",
"title": ""
},
{
"docid": "06178454833b7ed28ed1061a5536dc4c",
"score": "0.65249085",
"text": "def current_scope; end",
"title": ""
},
{
"docid": "06178454833b7ed28ed1061a5536dc4c",
"score": "0.65249085",
"text": "def current_scope; end",
"title": ""
},
{
"docid": "06178454833b7ed28ed1061a5536dc4c",
"score": "0.65249085",
"text": "def current_scope; end",
"title": ""
},
{
"docid": "06178454833b7ed28ed1061a5536dc4c",
"score": "0.65249085",
"text": "def current_scope; end",
"title": ""
},
{
"docid": "7d7e7411a31c474e4119451e7b95169d",
"score": "0.6423143",
"text": "def a_scope\n $var = 'some value'\nend",
"title": ""
},
{
"docid": "7d7e7411a31c474e4119451e7b95169d",
"score": "0.6423143",
"text": "def a_scope\n $var = 'some value'\nend",
"title": ""
},
{
"docid": "7d776704b696d48524968697371b971c",
"score": "0.6405748",
"text": "def variables(include_defined_in_parent = true)\n unless self.parent.nil? or include_defined_in_parent == false\n v = self.parent.variables\n else\n v = {}\n end\n v.merge!(@variables)\n end",
"title": ""
},
{
"docid": "974cbb25bd1cba50b658335b26350b27",
"score": "0.63871264",
"text": "def get_parent_scope\n return if root?\n\n @parent = ScopedVarsResolver.new(request, paths, parent_path, @git)\n end",
"title": ""
},
{
"docid": "c2504669b30bdc18e5ea2aad0e7c99a2",
"score": "0.63530076",
"text": "def top_scope\n return parent.top_scope\n end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.63102955",
"text": "def scope; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.63102955",
"text": "def scope; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.63102955",
"text": "def scope; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.63102955",
"text": "def scope; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.63102955",
"text": "def scope; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.63102955",
"text": "def scope; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.63102955",
"text": "def scope; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.63102955",
"text": "def scope; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.63102955",
"text": "def scope; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.63102955",
"text": "def scope; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.63102955",
"text": "def scope; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.63102955",
"text": "def scope; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.63102955",
"text": "def scope; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.63102955",
"text": "def scope; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.63102955",
"text": "def scope; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.63102955",
"text": "def scope; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.63102955",
"text": "def scope; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.63102955",
"text": "def scope; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.63102955",
"text": "def scope; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.63102955",
"text": "def scope; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.63102955",
"text": "def scope; end",
"title": ""
},
{
"docid": "bd24975710fcf94cc97e26d17774c786",
"score": "0.6271922",
"text": "def on_ivar(node)\n if @ngContext == :controller\n process s(:attr, s(:gvar, :$scope), node.children.first.to_s[1..-1])\n else\n super\n end\n end",
"title": ""
},
{
"docid": "af66248202b40e0ac67e052dc20b3ed7",
"score": "0.62523717",
"text": "def init_scope\n @scope = {}\n end",
"title": ""
},
{
"docid": "ae81503eac0d1230ccaf17f70a5085d2",
"score": "0.62338287",
"text": "def a_scope\n $var = \"a global var\"\nend",
"title": ""
},
{
"docid": "cfd90b24f4580d27f1c8215271ce2543",
"score": "0.6192525",
"text": "def target_scope; end",
"title": ""
},
{
"docid": "cfd90b24f4580d27f1c8215271ce2543",
"score": "0.6192525",
"text": "def target_scope; end",
"title": ""
},
{
"docid": "36c79e9368c2ee53f5c32cd85912481f",
"score": "0.6159656",
"text": "def parent_scope\n parent.send(model_class.name.underscore.pluralize)\n end",
"title": ""
},
{
"docid": "36c79e9368c2ee53f5c32cd85912481f",
"score": "0.6159656",
"text": "def parent_scope\n parent.send(model_class.name.underscore.pluralize)\n end",
"title": ""
},
{
"docid": "0bfaaa93bd2ccb9ad445afe41add13f9",
"score": "0.61396945",
"text": "def process_ivar(exp, _parent)\n current_context.record_use_of_self\n process(exp)\n end",
"title": ""
},
{
"docid": "23d7374cada5405bc132e4b999568b7b",
"score": "0.61319953",
"text": "def protected_instance_variables \n ['@parent_controller'] \n end",
"title": ""
},
{
"docid": "57223597d7c06490a02f32da272c25c3",
"score": "0.61256576",
"text": "def decrease_scope()\n $current_scope -= 1\n $variables.pop\nend",
"title": ""
},
{
"docid": "3c7fc66851a26519917435028d417020",
"score": "0.6115835",
"text": "def on_new_scope\n @unused_variables << {}\n end",
"title": ""
},
{
"docid": "49bce52070c36a20ae5f26875079400d",
"score": "0.61137086",
"text": "def scope=(v); end",
"title": ""
},
{
"docid": "49bce52070c36a20ae5f26875079400d",
"score": "0.61137086",
"text": "def scope=(v); end",
"title": ""
},
{
"docid": "6b64cec6a79335698d4be7ad4ace2600",
"score": "0.607613",
"text": "def scoping\n @scope\n end",
"title": ""
},
{
"docid": "8f1d1fcb221ae4a7d8550a9870a10e12",
"score": "0.6007993",
"text": "def increase_scope()\n $current_scope += 1\n $variables << {}\nend",
"title": ""
},
{
"docid": "e2cac08fb654e5766f63a2ccfe63155f",
"score": "0.6002853",
"text": "def scopes=(_arg0); end",
"title": ""
},
{
"docid": "30e913f766c746c07a11a0e27284fd0c",
"score": "0.59786445",
"text": "def scope_level; end",
"title": ""
},
{
"docid": "aa4c318dd7a4f5882316ac7ed6f6a743",
"score": "0.5977962",
"text": "def showScope\n\t\t#Show that the scope of variables are only within the class\n\t\tbegin\n\t\t\tputs variable\n\t\trescue\n\t\t\tputs \"This method is out of the variables scope\"\n\t\t\tvariable = 4\n\t\tend\n\t\t\n\t\tvar = \"Hi\"\n\t\tputs var\n\t\t#show more scope stuff\n\t\tfor i in 0..2\n\t\t\tvar = 2\n\t\t\tlel = 9\n\t\t\tputs var\n\t\tend\n\t\tputs var\n\t\tif true\n\t\t\tvar = 3\n\t\tend\n\t\tputs var\n\t\tputs lel\n\tend",
"title": ""
},
{
"docid": "f50095dd51ea9a41bc410e1a5261edcf",
"score": "0.5960565",
"text": "def can_overwrite_parent_frame_local_variables\r\n attacker_favors_true(normally_true(target.flaw.can_corrupt_parent_frame_locals))\r\n end",
"title": ""
},
{
"docid": "117bc71cd8976d01e54c03e8a55ef09e",
"score": "0.59602076",
"text": "def scope=(_arg0); end",
"title": ""
},
{
"docid": "117bc71cd8976d01e54c03e8a55ef09e",
"score": "0.59602076",
"text": "def scope=(_arg0); end",
"title": ""
},
{
"docid": "117bc71cd8976d01e54c03e8a55ef09e",
"score": "0.59602076",
"text": "def scope=(_arg0); end",
"title": ""
},
{
"docid": "117bc71cd8976d01e54c03e8a55ef09e",
"score": "0.59602076",
"text": "def scope=(_arg0); end",
"title": ""
},
{
"docid": "f4a344696272cc01c12fbb15872830e1",
"score": "0.594799",
"text": "def local_variables; end",
"title": ""
},
{
"docid": "55c70a97e52f87274ea7004694bac02b",
"score": "0.59319276",
"text": "def update_var(name, value)\n puts \"-----UPDATE VAR IN SCOPE-----\" if $debug if $debug\n temp = self\n while not temp.parent.nil? and not temp.scope_var.has_key? name do\n temp = temp.parent\n end\n if $debug and temp != self then\n puts \"Updated variable in older scope\" if $debug\n end\n\n if not temp.nil? and temp.scope_var.has_key? name then\n puts \"updated #{name.inspect} with #{value.inspect}\" if $debug if $debug\n temp.scope_var[name] = value\n end\n end",
"title": ""
},
{
"docid": "bd330787e3ce830f06cdcd6024fa06c4",
"score": "0.5920204",
"text": "def read_scope\n {}\n end",
"title": ""
},
{
"docid": "365d51b8680e4d7ec7639d624be7f987",
"score": "0.591396",
"text": "def unscoped_current_and_previous_ancestors; end",
"title": ""
},
{
"docid": "52721b1a56be15223555d52e7e427a38",
"score": "0.5905452",
"text": "def top_scope\n return self.parent.is_a?(Scope) ? self.parent : self.parent.top_scope\n end",
"title": ""
},
{
"docid": "8a17199861e453ca13ab8f5b7449c2f2",
"score": "0.58919",
"text": "def model_scope\n if parent.present?\n parent_scope\n else\n super\n end\n end",
"title": ""
},
{
"docid": "0d76dc8317438ce27e791c93a52719e1",
"score": "0.5888179",
"text": "def local_scope\n @scope = :local\n self\n end",
"title": ""
},
{
"docid": "f3c13a1a81915ee7e7acb15e84307ded",
"score": "0.5876273",
"text": "def scopes; end",
"title": ""
},
{
"docid": "f3c13a1a81915ee7e7acb15e84307ded",
"score": "0.5876273",
"text": "def scopes; end",
"title": ""
},
{
"docid": "437ef7445cec7237a221b70842c9c397",
"score": "0.58477646",
"text": "def scoping\n scope = 'My Scope'\n end",
"title": ""
},
{
"docid": "31acd3a243e414e4dc92619f21d242a6",
"score": "0.58427453",
"text": "def evaluate_default_scope; end",
"title": ""
},
{
"docid": "cfbe0e329bbfb34855f91a6c5a25b95e",
"score": "0.58237755",
"text": "def inject_sticky_locals!; end",
"title": ""
},
{
"docid": "cfbe0e329bbfb34855f91a6c5a25b95e",
"score": "0.58237755",
"text": "def inject_sticky_locals!; end",
"title": ""
},
{
"docid": "2c2e5b3b8d350b342c61c5475c9c5098",
"score": "0.58221567",
"text": "def preload_scope; end",
"title": ""
},
{
"docid": "7369c2a84a491d6f6c330f612694dbf1",
"score": "0.5807993",
"text": "def apply_standard_scope\n raise \"override in subclass\"\n end",
"title": ""
},
{
"docid": "eabc923549f3eea8bbb04c2f635cdc1b",
"score": "0.5794374",
"text": "def base_scope_satisfied(&block)\n scope_category_satisfied(:base, &block)\n end",
"title": ""
},
{
"docid": "961c3fb20c7041d82a126cbcb53ea6f9",
"score": "0.5786927",
"text": "def include_scope?(other)\n equal?(other) || @parent.include_scope?(other)\n end",
"title": ""
},
{
"docid": "38320e75d3654c03eae033859ddd123b",
"score": "0.5783751",
"text": "def scope\n @scope ||= {}\n end",
"title": ""
},
{
"docid": "16a84a744e9b5b024d2f1ead3228204e",
"score": "0.57827556",
"text": "def top_scope\n return self.parent.is_a?(SystemT) ? self : self.parent.top_scope\n end",
"title": ""
},
{
"docid": "3a7c170624f7f06a681ffd3adf3c5af6",
"score": "0.5769498",
"text": "def current_scope\n @scope.dup\n end",
"title": ""
},
{
"docid": "6e2ef0fce390675109bed779efd19366",
"score": "0.5763933",
"text": "def on_ivasgn(node)\n if @ngContext == :controller\n if node.children.length == 1\n process s(:attr, s(:gvar, :$scope),\n \"#{node.children.first.to_s[1..-1]}\")\n else\n process s(:send, s(:gvar, :$scope),\n \"#{node.children.first.to_s[1..-1]}=\", node.children.last)\n end\n else\n super\n end\n end",
"title": ""
},
{
"docid": "375f56cb314a5bd53ef517ca7dc9b2db",
"score": "0.57514185",
"text": "def lookup_in_scope(name, scope); end",
"title": ""
},
{
"docid": "c32655b39ed356173c47e459c6ad7471",
"score": "0.574054",
"text": "def scope_included\n\t\t\ttrue \n\t\tend",
"title": ""
},
{
"docid": "ddd2e617e8d3a3bd3103af032e2063f8",
"score": "0.57397074",
"text": "def override_instance_scope?\n false\n end",
"title": ""
},
{
"docid": "19a1869de8b5fde0b5f84968ca5dbb3d",
"score": "0.57395047",
"text": "def some_method # Scope gate\n v2 = 2\n p local_variables\n end",
"title": ""
},
{
"docid": "19a1869de8b5fde0b5f84968ca5dbb3d",
"score": "0.57395047",
"text": "def some_method # Scope gate\n v2 = 2\n p local_variables\n end",
"title": ""
},
{
"docid": "fa62254de1f724dea85962df26eaec76",
"score": "0.57354033",
"text": "def on_variable_identifier(node, parent)\n usage_context = @variable_context_stack.last\n declared_variables = @variable_usages_for_context[usage_context]\n usage = declared_variables[node.name]\n usage.used_by = usage_context\n usage.ast_node = node\n usage.path = context.path\n super\n end",
"title": ""
},
{
"docid": "d5a6c3fc6b0e3cd3ba47df30eca62abc",
"score": "0.5719077",
"text": "def in_scope(name)\n seed_eval { @in_scope = name.to_s }\n nil\n end",
"title": ""
},
{
"docid": "7468db54a226dbc07e108eaaf99db06a",
"score": "0.57161915",
"text": "def default_scope; end",
"title": ""
},
{
"docid": "475074a7e49ab22ef03d04c9e0d9374f",
"score": "0.57014066",
"text": "def reset_scope\n self.scope_value = self.class.scope_value\n end",
"title": ""
},
{
"docid": "677516ceeda12c20d49384dc2c8e3760",
"score": "0.5698647",
"text": "def same_scope?(other)\n true\n end",
"title": ""
},
{
"docid": "e38ae4d5558ff9c63901361dcb0a6ebe",
"score": "0.5694201",
"text": "def override_instance_scope\n @override_instance_scope = true\n end",
"title": ""
},
{
"docid": "884cd6b1288f456fe530bd9260378564",
"score": "0.5693322",
"text": "def i18n_scope\n @i18n_scope ||= nil\n end",
"title": ""
},
{
"docid": "f99bdc130640bcb9f143110607677d01",
"score": "0.56838846",
"text": "def intermediate_variables(*sub_flows)\n set_flags = []\n all_sub_flows.each { |f| set_flags += f.flow_variables[:all][:set_flags] }\n if set_flags.empty?\n []\n else\n upstream_referenced_flags = []\n p = parent\n while p\n upstream_referenced_flags += p.flow_variables[:this_flow][:referenced_flags]\n p = p.parent\n end\n upstream_referenced_flags.uniq\n set_flags & upstream_referenced_flags\n end\n end",
"title": ""
},
{
"docid": "35e8220af43c6b72daacadb4df7085ce",
"score": "0.56635886",
"text": "def scope\n end",
"title": ""
},
{
"docid": "df5a46ca2a112c9736719e05b855126b",
"score": "0.56620216",
"text": "def tasks_in_scope(scope); end",
"title": ""
},
{
"docid": "d9d88ac2d77451db6f4002654b3e4d4c",
"score": "0.56574166",
"text": "def []( name )\n if @local_variables.member?(name) then\n if @local_variables[name] == 1 then\n return name\n else\n return \"#{name}#{@local_variables[name]}\"\n end\n elsif @parent_scope.nil? then\n bug( \"you have not defined variable [#{name}]\" )\n else\n return @parent_scope[name]\n end\n end",
"title": ""
},
{
"docid": "af1a15f3686e75125bcb60d32d39884a",
"score": "0.56523633",
"text": "def through_scope; end",
"title": ""
},
{
"docid": "9073872ff038df2928685679c8fc3ca2",
"score": "0.56423473",
"text": "def inner_var\n my_var = 8\nend",
"title": ""
}
] |
59db7ee648efb1be000b6f75cd48b99e
|
Timeline entries Insert a timeline entry document
|
[
{
"docid": "8eb81e159fdb7ff3be26b99947063049",
"score": "0.7063517",
"text": "def insert_timeline_entry(timeline_kind, timeline_entry_hash)\n self.insert(self.timeline_collection(timeline_kind), timeline_entry_hash)\n end",
"title": ""
}
] |
[
{
"docid": "26b8631a8aea1d5df717e0b182a1bfb3",
"score": "0.7387158",
"text": "def create_timeline_entry creator, content, attach\n timeline.create_new_entry creator, content, attach\n end",
"title": ""
},
{
"docid": "1498a41fc5e0ff9b5d27c77837efcfcf",
"score": "0.7022959",
"text": "def insert_timeline_entry(timeline_entry)\n # serialize\n timeline_entry_hash = timeline_entry.to_hash\n\n # run hook\n self.run_hook(:will_insert_timeline_entry, timeline_entry_hash, timeline_entry.timeline.class)\n\n # insert\n self.driver.insert_timeline_entry(timeline_entry.timeline.kind, timeline_entry_hash)\n end",
"title": ""
},
{
"docid": "baf67aee707c47d867a5b59a79e60af7",
"score": "0.6759656",
"text": "def add_to_timeline_self\n Timeline.create(tweet: self, user: self.user)\n end",
"title": ""
},
{
"docid": "4c2dd14c6e56e83e824a20d0f50bf0f7",
"score": "0.6412775",
"text": "def create\n @entry = Entry.new(create_entry_params)\n @entry.entry_id = SecureRandom.hex(8)\n @entry.relation_tag = @entry.entry_id\n\n @entry.entry_tags_ids = \"\"\n params[:entry][:entry_tags_ids].each do |entry_tag|\n @entry.entry_tags_ids = @entry.entry_tags_ids + entry_tag + \" \" \n end\n\n @entry.reply_to = \"\"\n params[:entry][:entry_reply_to].each do |to|\n @entry.reply_to = @entry.reply_to + to + \" \" \n end\n\n # タイムラインタイプをタグから判定\n timeline_type = 0;\n if !params[:timeline_type].blank? then\n timeline_type = params[:timeline_type]\n end\n\n @game = Game.find(@entry.game_id)\n @timeline = Timeline.new({\n :entry_id => @entry.entry_id,\n :user_id => @entry.entry_user_id,\n :entry_user_id => @entry.entry_user_id,\n :entry_time => @entry.entry_time,\n :game_id => @entry.game_id,\n :event_id => @entry.event_id,\n :tags => @game.tag_name,\n :timeline_type => timeline_type,\n :reply_to => @entry.reply_to,\n :created_at => @entry.created_at,\n :updated_at => @entry.updated_at\n })\n @timeline.save\n\n @followers = Follower.where(\"user_id = ? and game_id = ?\", @entry.entry_user_id, @entry.game_id)\n @followers.each do |follower|\n logger.debug \"-----------------------------------\"\n logger.debug follower.follower_user_id\n \n timeline = Timeline.new({\n :entry_id => @entry.entry_id,\n :user_id => follower.follower_user_id,\n :entry_user_id => @entry.entry_user_id,\n :entry_time => @entry.entry_time,\n :game_id => @entry.game_id,\n :event_id => @entry.event_id,\n :tags => @game.tag_name,\n :timeline_type => timeline_type,\n :reply_to => @entry.reply_to,\n :created_at => @entry.created_at,\n :updated_at => @entry.updated_at\n })\n\n timeline.save\n end\n\n @timeline.save\n\n respond_to do |format|\n if @entry.save\n @ret = {\n :ret => 1,\n :entry => @entry\n }\n format.html { redirect_to @entry, notice: 'Entry was successfully created.' }\n format.json { render :created, location: @ret }\n else\n format.html { render :new }\n format.json { render json: @entry.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ac4ee13c70a259f401684bab971a7b00",
"score": "0.635732",
"text": "def add_timeline(user, resource)\n Timeline.send(:create!, \"user_id\": user.id, \n \"#{resource.class.to_s.downcase}_id\": resource.id)\n end",
"title": ""
},
{
"docid": "10dbf8ef83de55532a14645b041581b2",
"score": "0.6345022",
"text": "def insert!(mirror=@client)\n timeline_item = self\n result = []\n if file_upload?\n for file in file_to_upload\n media = Google::APIClient::UploadIO.new(file.contentUrl, file.content_type)\n result << client.execute!(\n :api_method => mirror.timeline.insert,\n :body_object => timeline_item,\n :media => media,\n :parameters => {\n :uploadType => 'multipart',\n :alt => 'json'})\n end\n else\n result << client.execute(\n :api_method => mirror.timeline.insert,\n :body_object => timeline_item)\n end\n return result.data\n end",
"title": ""
},
{
"docid": "e3452accc73d40c316db4dce244a1a4a",
"score": "0.6242864",
"text": "def will_insert_timeline_entry(&block)\n register_hook(:will_insert_timeline_entry, block)\n end",
"title": ""
},
{
"docid": "d7d79da1acdc94e8c64a52a11a7bae9f",
"score": "0.6140544",
"text": "def will_store_timeline_entry(timeline_entry)\n # NOOP\n end",
"title": ""
},
{
"docid": "d1eefad9eb6a2c3c477ea1a486d2b46b",
"score": "0.6114994",
"text": "def add_entries(entries)\n entries.each do |entry|\n description = entry.content || entry.summary\n Article.create!(\n :title => entry.title,\n :description => description,\n :link => entry.url,\n :pubDate => entry.published,\n :guid => entry.id,\n :channel_id => self.id,\n :starred => false)\n end\n end",
"title": ""
},
{
"docid": "9742ffb72935f8d04dd7800d49585f3a",
"score": "0.6098738",
"text": "def add_entry entry\n @entries << entry\n end",
"title": ""
},
{
"docid": "e0ac031ba2c318ec58c0e581dd73ad5a",
"score": "0.60918593",
"text": "def insert_timeline_item(timeline_item, attachment_path = nil,\n content_type = nil)\n method = @mirror.timeline.insert\n\n # If a Hash was passed in, create an actual timeline item from it.\n if timeline_item.kind_of?(Hash)\n timeline_item = method.request_schema.new(timeline_item)\n end\n\n if attachment_path && content_type\n media = Google::APIClient::UploadIO.new(attachment_path, content_type)\n parameters = { 'uploadType' => 'multipart' }\n else\n media = nil\n parameters = nil\n end\n\n @client.execute!(\n api_method: method,\n body_object: timeline_item,\n media: media,\n parameters: parameters\n ).data\n end",
"title": ""
},
{
"docid": "49922d33f14f1fe70a4117a21ee481f1",
"score": "0.60709757",
"text": "def add_entry(entry)\n end",
"title": ""
},
{
"docid": "8e6cc2f9c4d73bbd7b69cfb4a3d77887",
"score": "0.6017986",
"text": "def createinline\n # Invalid Data Failure\n fail = false;\n \n # Pull data from parameters\n @entry = Entry.new\n @entry[:comments] = params[:comment]\n @entry[:words] = params[:words]\n @entry[:timestart] = Time.now\n @entry[:timeend] = Time.now\n @entry[:editing] = params[:editing]\n \n @entry[:userid] = session[:user_id] \n if params[:userid]\n @entry[:userid] = params[:userid]\n end\n\n # Pull start time and end time data from parameters\n start_year = params[:start_year].to_i\n start_month = params[:start_month].to_i\n start_day = params[:start_day].to_i\n start_hour = params[:start_hour].to_i\n start_minute = params[:start_minute].to_i\n\n end_year = params[:end_year].to_i\n end_month = params[:end_month].to_i\n end_day = params[:end_day].to_i\n end_hour = params[:end_hour].to_i\n end_minute = params[:end_minute].to_i \n \n # Set start and end dates\n start_datetime = DateTime.new( start_year, start_month, start_day, start_hour, start_minute )\n end_datetime = DateTime.new( end_year, end_month, end_day, end_hour, end_minute )\n @entry[:starttime] = start_datetime\n @entry[:endtime] = end_datetime \n \n # Calculate number of hours and minutes\n time_difference = end_datetime.to_time - start_datetime.to_time\n hours = 0\n minutes = 0\n \n if( time_difference <= 0 )\n # Negative time failure\n fail = true;\n else\n # Times Ok\n seconds = time_difference.to_i\n @entry[:hours] = seconds / ( 3600 ).to_i\n @entry[:minutes] = ( ( seconds - @entry[:hours] * 3600 ) / 60 ).to_i\n end\n \n # Save if not failed\n if( !fail )\n @entry.save\n puts @entry.inspect\n end\n \n # Forward back to home\n redirect_to :controller => \"users\", :action => \"home\"\n end",
"title": ""
},
{
"docid": "0e4425235bd9fae0c629fe38f119c7ab",
"score": "0.5961755",
"text": "def fill_timeline timeline, events\n \n end",
"title": ""
},
{
"docid": "ed6cc432dc8fbf327b94095d5a934626",
"score": "0.5952569",
"text": "def add(entry)\n @timestamp+=1\n self[entry['$id']]=entry \n end",
"title": ""
},
{
"docid": "ddc2056beb8b14ac99732740ec075e27",
"score": "0.59328866",
"text": "def create\n @timeline = Timeline.new(params[:timeline])\n \n @timeline.user_id = current_user.id\n\n respond_to do |format|\n if @timeline.save\n format.html { redirect_to @timeline, notice: 'Timeline was successfully created.' }\n format.json { render json: @timeline, status: :created, location: @timeline }\n else\n format.html { render action: \"new\" }\n format.json { render json: @timeline.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1c7b1cc9358c2de0aea3a4f1cddb936d",
"score": "0.5883964",
"text": "def create\n @timeline = Timeline.new(params[:timeline])\n\n respond_to do |format|\n if @timeline.save\n format.html { redirect_to(@timeline, :notice => 'Timeline was successfully created.') }\n format.xml { render :xml => @timeline, :status => :created, :location => @timeline }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @timeline.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "90e6fc5535838f8e721f0b19cf9e2d60",
"score": "0.58655864",
"text": "def create\n @timeline = Timeline.new(timeline_params)\n\n if @timeline.save\n render json: @timeline, status: :created, location: @timeline\n else\n render json: @timeline.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "9338c6f3ab535c4b252f9d8fafbd1525",
"score": "0.5864413",
"text": "def create_entries(doc)\n return nil\n end",
"title": ""
},
{
"docid": "8234ef0a84f500037e6af123662dff73",
"score": "0.5845069",
"text": "def create_entry\n dream_params = {}\n dream_params[:date] = DateTime.now\n dream_params[:hours_slept] = hours_slept?\n dream_params[:user_id] = self.user.id\n new_dream = Dream.create(dream_params)\n\n num = num_entries\n i = 0\n while i < num do\n entry_params = {}\n entry_params[:category] = select_category(i + 1)\n entry_params[:remembrance] = get_remembrance\n entry_params[:description] = get_description\n entry_params[:recurring] = recurring?\n entry_params[:dream_id] = new_dream.id\n new_entry = Entry.create(entry_params)\n i += 1\n end\n self.user.dreams << new_dream\n puts\n puts \"Thank you! Your entry has been successfully saved.\"\n puts\n end",
"title": ""
},
{
"docid": "3f9f55541c202e75b751c0a264882113",
"score": "0.5835902",
"text": "def create\n @tag_timeline = Timeline.new(params[:timeline])\n @tag_timeline.parent_id = @identity.id if @identity.present?\n\n respond_to do |format|\n if @tag_timeline.save\n format.html { redirect_to tag_identity_timeline_path(@identity,@tag_timeline), notice: 'Timeline was successfully created.' }\n format.json { render json: @tag_timeline, status: :created, location: @tag_timeline }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tag_timeline.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5f58cdf60e4665baa86bc2d1da3b95e0",
"score": "0.583309",
"text": "def add_entry(entry)\n @entries << entry\n end",
"title": ""
},
{
"docid": "576aa420d68a0d689b3a6ad94e4161fc",
"score": "0.5824714",
"text": "def import_timeline(timeline_file, user)\n timeline_xml = parse_timeline(timeline_file)\n build_timeline(timeline_xml, user)\n end",
"title": ""
},
{
"docid": "62cfd2c4f3292388bac6a0d210efd264",
"score": "0.5823278",
"text": "def create\n @timeline = Timeline.new(params[:timeline])\n @timeline.user = current_user\n\n respond_to do |format|\n if @timeline.save\n format.html { redirect_to(@timeline, :notice => 'Timeline was successfully created.') }\n format.xml { render :xml => @timeline, :status => :created, :location => @timeline }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @timeline.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "75b969109fa4c09481da00911f7f9404",
"score": "0.58226156",
"text": "def create\n @timeline = Timeline.new(timeline_params)\n\n respond_to do |format|\n if @timeline.save\n format.html { redirect_to @timeline, notice: 'Timeline was successfully created.' }\n format.json { render :show, status: :created, location: @timeline }\n else\n format.html { render :new }\n format.json { render json: @timeline.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b64602ee10a3b3ec50686322c2d6f6dd",
"score": "0.58142143",
"text": "def should_store_timeline_entry?(timeline_entry)\n true\n end",
"title": ""
},
{
"docid": "4b030274d8efb6b296b3f9d1db5ef1a9",
"score": "0.5804018",
"text": "def add_timeline(timeline)\n raise ArgumentError, \"Can only add a TimeSpan::TimeLine to a TemporalObject's statuses\" unless timeline.kind_of? TimeSpan::TimeLine\n @temporal_statuses << timeline\n end",
"title": ""
},
{
"docid": "97d6ec479d8aa18dcb7926e2efc0895a",
"score": "0.5782396",
"text": "def insert(entry)\n make_backup\n before, after = entry.respond_to?(:date) ? divide_file(entry) : [IO.readlines(path), []]\n write_entry_to(before, entry, after)\n remove_backup\n end",
"title": ""
},
{
"docid": "1d3955daa67f4f2d0282b431796881ea",
"score": "0.5750422",
"text": "def insert_entry(title, post, tags_array, author)\n puts \"Inserting blog entry with title: #{title} and author: #{author}\"\n\n # fix up the permalink to not include whitespace\n permalink = title.downcase.gsub(/[^a-z0-9]+/, '_')\n\n # Build a new post\n post = {\n 'title' => title,\n 'author' => author,\n 'body' => post,\n 'permalink' => permalink,\n 'tags' => tags_array,\n 'comments' => [],\n 'date' => Time.now.utc\n }\n\n begin\n @posts.insert(post)\n puts \"Inserting the post\"\n rescue\n puts \"Error inserting post\"\n puts \"Unexpected Error: #{$!}\"\n end\n\n permalink\n end",
"title": ""
},
{
"docid": "ca6a1af0f6d406f87ea6f10eb6bbe4c9",
"score": "0.5749531",
"text": "def create\n @timeline_entry = TimelineEntry.new(params[:timeline_entry])\n @timeline_entry.user_id = current_user.id\n @politician = @timeline_entry.politician\n\n params[:timeline_entry].delete :preview_id if params[:timeline_entry][:preview_id] and params[:timeline_entry][:preview_id] == \"nil\"\n\n @message = \"\"\n if @politician\n @politician.inc(:good_link_count, 1) if @timeline_entry.is_good\n @politician.inc(:bad_link_count, 1) unless @timeline_entry.is_good\n end\n\n if(params[:timeline_entry][:tweet])\n unless tweet_after_create\n @error = 1\n @message += \"tweet을 게시하는데 오류가 발생했습니다.\"\n end\n end\n if(params[:timeline_entry][:facebook])\n unless post_after_create\n @error = 1\n @message += \"facebook에 포스팅하는데 오류가 발생했습니다.\"\n end\n end\n\n respond_to do |format|\n if @timeline_entry.save\n if @error == 1\n format.html { redirect_to @timeline_entry, notice: 'Timeline entry was successfully created. SNS post error.' }\n format.json { render json: @timeline_entry, status: :created, location: @timeline_entry }\n else\n format.html {\n render json: @timeline_entry, status: :created, location: @timeline_entry\n }\n format.json {\n render json: @timeline_entry, status: :created, location: @timeline_entry\n }\n end\n else\n format.html { render action: \"new\" }\n format.json { render json: @timeline_entry.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5294f98dedef8295be16f4a719440831",
"score": "0.5727523",
"text": "def insert_tweet(line, source)\n fields = line.strip.split(\"\\t\")\n text = fields[1]\n username = fields[2]\n rest_name = fields[3]\n rest_tweet = {:tweet => text, :restaurant => rest_name, :username => username, :source => source}\n RestaurantTweet.create(rest_tweet)\nend",
"title": ""
},
{
"docid": "ca55d91135093ae7098d3f6efdf8fc16",
"score": "0.5726641",
"text": "def create\n time_entry = current_user.time_entries.new(time_entry_params)\n # time_entry.user_id = current_user.id\n\n if time_entry.save\n render json: { entry: time_entry }, status: :ok\n else\n render json: { errors: time_entry.errors.full_messages }, status: :bad_request\n end\n end",
"title": ""
},
{
"docid": "8c31acb922ff302d7421be298f9d29e8",
"score": "0.57110584",
"text": "def add_entry_yaml(yaml)\n @entries << YAML::load_file(yaml)\n end",
"title": ""
},
{
"docid": "a2cb7ddd4e92151205e701571d3dc037",
"score": "0.56897527",
"text": "def create\n @entry = Entry.new(params[:entry])\n \n if logged_in_user.entries << @entry\n flash[:notice] = 'Entry was successfully created.'\n redirect_to entry_path(:user_id => logged_in_user, \n :id => @entry)\n \n else\n render :action => \"new\"\n end\n end",
"title": ""
},
{
"docid": "79d0e84c6fb1becad37504f1824f6f41",
"score": "0.5664881",
"text": "def put_entries(entries)\n entries.each{|e|\n put_entry(e[:id],e[:summary])\n }\n end",
"title": ""
},
{
"docid": "a5b974e7a5cdeec890570d700ea0cacb",
"score": "0.5663451",
"text": "def timeline\n @timeline = tmpl(\"timeline.erb\")\n end",
"title": ""
},
{
"docid": "f8dfd83322a5e59ce8da8e4c83f5cfbc",
"score": "0.5657141",
"text": "def create_entry(options = {})\n post(\"/create_entry\", options)\n end",
"title": ""
},
{
"docid": "f74364b56cf22249ee2396cdbd730644",
"score": "0.5650453",
"text": "def create_post entry, feed\n if (entry_id = (entry.entry_id.andand.encode('UTF-8') || entry.url))\n if Post.filter(:entry_id => entry_id, :feed_id => feed.id).count == 0\n now = DateTime.now\n\n if entry.published\n published_at = parse_date(entry.published)\n\n # no old entries\n if (now - published_at).to_f > 7.0\n return\n end\n\n # publish date is too much in the future -> set it to now\n if (published_at - now).to_f > 1.0\n published_at = now\n end\n\n else\n published_at = now\n end\n\n Post.create(:content => adapt_content((entry.content || entry.summary).andand.encode('UTF-8').andand.sanitize, feed.site_uri),\n :title => adapt_content(entry.title.andand.encode('UTF-8').andand.sanitize, feed.site_uri),\n :uri => entry.url,\n :read => false,\n :feed_id => feed.id,\n :published_at => published_at,\n :entry_id => entry_id)\n end\n end\n end",
"title": ""
},
{
"docid": "2cbe925682628d0629c65ae430147a5b",
"score": "0.56444126",
"text": "def create\n @entry = Entry.new(params[:entry])\n\n respond_to do |format|\n if current_user.entries << @entry\n flash[:notice] = '您的日记已成功保存!'\n format.html { redirect_to user_entry_path(:user_id => current_user,:id =>@entry) }\n format.xml { render :xml => @entry, :status => :created, :location => @entry }\n else\n flash[:error] = '日记保存失败,请重新操作'\n format.html { render :action => \"new\" }\n format.xml { render :xml => @entry.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0c855f0792bb2ed52e21a1aff25ddc88",
"score": "0.56383944",
"text": "def create\n @entry = current_user.entries.build(entry_params)\n if @entry.save\n flash[:success] = \"Entry created!\"\n redirect_to @entry\n else\n @feed_items = []\n render 'static_pages/home'\n end\n end",
"title": ""
},
{
"docid": "8f03412c2e190f1ac9d1b3d64d33fdda",
"score": "0.5636804",
"text": "def timeline_params\n params.require(:timeline).permit(:user_id, :game_id, :entry_id, :entry_time, :entry_user_id, :tags, :reply_to, :text, :retweet_flag, :favorite_flag, :warning_flag, :delete_flag, :created_at, :updated_at)\n end",
"title": ""
},
{
"docid": "430d455ea15bee297db0191839e640a7",
"score": "0.5632261",
"text": "def create\n @timeline = Timeline.new(timeline_params)\n\n respond_to do |format|\n if @timeline.save\n format.html { redirect_to @timeline, notice: 'Timeline was successfully created.' }\n format.json { render action: 'show', status: :created, location: @timeline }\n format.xml { redirect_to @timeline, notice: 'Timeline was successfully created.' }\n else\n format.html { render action: 'new' }\n format.json { render json: @timeline.errors, status: :unprocessable_entity }\n format.xml { render xml: @timeline }\n end\n end\n end",
"title": ""
},
{
"docid": "a3d816298f3ba801460f30204eb039ba",
"score": "0.562801",
"text": "def create\n @entry = current_user.entries.build(entry_params)\n if @entry.save\n flash[:success] = \"Entry created!\"\n redirect_to root_url\n else\n @feed_items = []\n render 'static_pages/home'\n end\n end",
"title": ""
},
{
"docid": "d79492964f94d2dc88f56ab9fe3f515b",
"score": "0.559404",
"text": "def create_timeline_files\n template \"timeline.rb\", \"#{Activr.config.app_path}/timelines/#{file_name}_timeline.rb\"\n end",
"title": ""
},
{
"docid": "775e1c72c828d2d6c3486f765b16c6be",
"score": "0.5585517",
"text": "def create\n @time_entry = TimeEntry.new(params[:time_entry])\n @time_entry.start_time = Time.now\n @time_entry.user_id = current_user.id if logged_in?\n \n respond_to do |format|\n if @time_entry.save\n flash[:notice] = 'TimeEntry was successfully created.'\n format.html { redirect_to( time_entries_path ) }\n format.xml { render :xml => @time_entry, :status => :created, :location => @time_entry }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @time_entry.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "13689a1a371154b52f24bfae3c31c16e",
"score": "0.558495",
"text": "def update_timeline(tweet)\n entries = Follower.find_followers(tweet.user_id).map do |f|\n TimelineEntry.new(:user_id => f.follower_id, :tweet_id => tweet.id)\n end\n while (batch = entries.slice!(0, 1000)).any?\n # don't use couchrest uuid cache\n tweet.database.bulk_save(batch, false)\n end\n end",
"title": ""
},
{
"docid": "54b77f5c69c3d8192cb9bad9a78aa17f",
"score": "0.55708957",
"text": "def add(entry)\n content << entry\n end",
"title": ""
},
{
"docid": "8d758624f8ee96338a60e6415bc25704",
"score": "0.5564532",
"text": "def create\n \n @entry = Entry.new(params[:entry])\n @entry.developer_id = session[:user][:id]\n @entry.date = Date.strptime(params[:entry][:date], '%m/%d/%Y')\n \n respond_to do |format|\n if @entry.save\n format.html { redirect_to manage_entry_path( @entry ), notice: 'Entry was successfully created.' }\n format.json { render json: @entry, status: :created, location: @entry }\n else\n format.html { render action: \"new\" }\n format.json { render json: @entry.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"title": ""
},
{
"docid": "f4ba698d1dbde342ac2901cb0547eff8",
"score": "0.55588263",
"text": "def create\n\n @entry = Entry.new(:content => '') #params[:content])\n @entry.location_id = params[:location][:id]\n @entry.user_id = session[:user_id]\n @entry.status_id = params[:status][:id]\n\n @log = Log.new(params[:log])\n @log.serial_id = Serial.find_by_serial_number(params[:serials][:serial_number]).id\n @log.entries << @entry\n \n respond_to do |format|\n if @log.save\n flash[:notice] = 'Log was successfully created.'\n format.html { redirect_to(@log) }\n format.xml { render :xml => @log, :status => :created, :location => @log }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @log.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d207c100f9f0539eb5418c5cb15eee25",
"score": "0.5553533",
"text": "def publish\n blog.add_entry(self)\n end",
"title": ""
},
{
"docid": "8678f66e0f0c372ef83b558b9b59d287",
"score": "0.55461544",
"text": "def create_post(entry, feed)\n if (entry_id = (entry.entry_id.andand.encode('UTF-8') || entry.url))\n if Post.filter(:entry_id => entry_id, :feed_id => feed.id).count == 0\n now = DateTime.now\n\n if entry.published\n published_at = entry.published.to_datetime\n\n # no old entries\n if (now - published_at).to_f > 7.0\n return\n end\n\n # publish date is too much in the future -> set it to now\n if (published_at - now).to_f > 1.0\n published_at = now\n end\n\n else\n published_at = now\n end\n DATABASE.transaction do\n Post.create(:content => adapt_content((entry.content || entry.summary).andand.encode('UTF-8').andand.sanitize, feed.site_uri),\n :title => adapt_content(entry.title.andand.encode('UTF-8').andand.sanitize, feed.site_uri),\n :uri => entry.url,\n :read => false,\n :feed_id => feed.id,\n :published_at => published_at,\n :entry_id => entry_id)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "349add50fa72ff4c6ebd96eb16cb11b3",
"score": "0.55352473",
"text": "def create\n @organization_timeline_entry = OrganizationTimelineEntry.new(organization_timeline_entry_params)\n @organization_timeline_entry.started_at = DateTime.now\n @organization_timeline_entry.entry_type = case params[:commit]\n when 'Structural' then 'structural'\n when 'Electrical' then 'electrical'\n else 'downtime'\n end\n\n authorize! :create, @organization_timeline_entry\n\n if @organization_timeline_entry.already_in_queue?\n redirect_to :back, alert: \"You're already on the queue!\"\n return\n end\n\n if @organization_timeline_entry.valid?\n @organization_timeline_entry.save\n respond_with(@organization_timeline_entry, location: params[:url])\n else\n redirect_to :back, alert: 'Missing Organization Name!'\n end\n end",
"title": ""
},
{
"docid": "71a6f83c176b950ebeeccd3d07ddd3f8",
"score": "0.5525584",
"text": "def create\n respond_to do |format|\n format.json do\n if timeline_params.blank?\n # Accept raw IIIF manifest here from timeliner tool\n manifest = request.body.read\n # Determine source from first content resource\n manifest_json = JSON.parse(manifest)\n stream_url = manifest_json[\"items\"][0][\"items\"][0][\"items\"][0][\"body\"][\"id\"]\n # Only handles urls like \"https://spruce.dlib.indiana.edu/master_files/6108vd10d/auto.m3u8#t=0.0,3437.426\"\n _, master_file_id, media_fragment = stream_url.match(/master_files\\/(.*)\\/.*t=(.*)/).to_a\n source = master_file_url(id: master_file_id) + \"?t=#{media_fragment}\"\n @timeline = Timeline.new(user: current_user, manifest: manifest, source: source)\n else\n @timeline = Timeline.new(timeline_params.merge(user: current_user))\n end\n\n if @timeline.save\n # When create is successful for cloned timelines, a redirect to the new timeline will be handled by the browser\n render json: @timeline, status: :created, location: @timeline\n else\n render json: @timeline.errors, status: :unprocessable_entity\n end\n end\n format.html do\n @timeline = Timeline.new(timeline_params.merge(user: current_user))\n if @timeline.save\n # If requested, add initial structure to timeline manifest\n initialize_structure! if params[:include_structure].present?\n redirect_to @timeline\n else\n flash.now[:error] = @timeline.errors.full_messages.to_sentence\n render :new\n end\n end\n end\n end",
"title": ""
},
{
"docid": "bac3d241402228fb41cae943e6e050ed",
"score": "0.5520778",
"text": "def create\n @timeline_event = TimelineEvent.new(params[:timeline_event])\n\n respond_to do |format|\n if @timeline_event.save\n format.html { redirect_to @timeline_event, notice: 'Timeline event was successfully created.' }\n format.json { render json: @timeline_event, status: :created, location: @timeline_event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @timeline_event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "44917b11c2ca41c7f7477986e3abebd2",
"score": "0.5515609",
"text": "def create(timeline_event, opts = {})\n data, _status_code, _headers = create_with_http_info(timeline_event, opts)\n data\n end",
"title": ""
},
{
"docid": "c02ae43e792121462ad28bd15d7e80cd",
"score": "0.548149",
"text": "def create\n @entry = Entry.new(entry_params)\n\n respond_to do |format|\n if @entry.save\n format.html { redirect_to blog_entry_path(@entry.blog_id, @entry), notice: 'Entry was successfully created.' }\n format.json { render :show, status: :created, location: blog_entry_path(@entry.blog_id, @entry) }\n else\n format.html { render :new }\n format.json { render json: @entry.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b7e1fb79a018fd70f7285b2167739f4d",
"score": "0.5475805",
"text": "def create_chart_entries chart_entries\n chart_entries.each_with_index do |entry, index|\n artist = Artist.find_or_create_by name: entry[0]\n track = artist.tracks.find_or_create_by title: entry[1]\n entries.create! track: track, position: index+1\n end\n end",
"title": ""
},
{
"docid": "f63c784315583b034ede80b2c07833ac",
"score": "0.5469821",
"text": "def did_store_timeline_entry(timeline_entry)\n # NOOP\n end",
"title": ""
},
{
"docid": "90c3ac3d1c3a60108c271893ab0ab1a9",
"score": "0.5469147",
"text": "def save\n entry = {\"postid\" => @postid, \"userid\" => @userid, \"title\" => @title, \"content\" => @content}\n DATABASE.newEntry(\"posts\", entry)\n end",
"title": ""
},
{
"docid": "ab814c1eee6392d34064c12bcb2e4e44",
"score": "0.54660577",
"text": "def create\n @timeline = Timeline.new(timeline_params)\n @timeline.user = current_user\n\n respond_to do |format|\n if @timeline.save\n format.html { redirect_to }\n format.json { render :show, status: :created, location: @timeline }\n else\n flash[:notice] = @timeline.errors #\"1~75字で入力してください。\"\n format.html {redirect_to action: 'index', alert: ''}\n format.html { render :new }\n format.json { render json: @timeline.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ddedda61108cff95e371ed1a8bd951ca",
"score": "0.5460859",
"text": "def create\n new_entry = Entry.create!(entry_params)\n json_response(new_entry, :created)\n end",
"title": ""
},
{
"docid": "adf48c8d7847cf2e961d605f17eb0e61",
"score": "0.54591733",
"text": "def import(data, options)\n PageTypeVersions.verify_compatibility!(data['page_type_versions'])\n\n entry_data = data['entry']\n entry = create_entry(entry_data.except('draft', 'last_publication'), options)\n\n file_mappings = options.fetch(:file_mappings, FileMappings.new)\n\n import_draft(entry_data, options, entry, file_mappings)\n import_last_publication(entry_data, options, entry, file_mappings)\n\n entry\n end",
"title": ""
},
{
"docid": "b87e7cb437e5dea6d11d517f9c7dc626",
"score": "0.545537",
"text": "def create_timeline(params = {})\n request(CreateTimelineRequest, ShowTimelineResponse, params)\n end",
"title": ""
},
{
"docid": "f12988198f1566c959a24958a209c6e3",
"score": "0.54526395",
"text": "def create\n @entry = Entry.new(entry_params)\n @entry.oauth_id = @oauth.id\n @entry.tag_list = params[:tag_list]\n @entry.posted_at = DateTime.now\n if @oauth.random == true\n @entry.ran = rand(@oauth.entries.count) + 1\n else\n @entry.ran = @oauth.entries.count + 1\n end\n if @entry.post_hour.present? || @entry.post_min.present?\n @entry.ran = 0\n end\n if params[:image_url].present?\n @entry.image = URI.parse(URI.encode(params[:image_url]))\n end\n\n respond_to do |format|\n if @entry.save\n format.html { redirect_to \"/oauths/#{@oauth.id}/entries\", notice: 'Entry was successfully created.' }\n format.json { render action: 'show', status: :created, location: @entry }\n else\n format.html { render action: 'new' }\n format.json { render json: @entry.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d6c5c8b8dfa755cb17ee3fc2d8b61658",
"score": "0.54515505",
"text": "def import!(todo_id = nil)\n return false if time_entry_already_exists\n t = build_time_entry(:time_entry_id => 0, :todo_id => todo_id)\n t.save\n t.import!\n end",
"title": ""
},
{
"docid": "edd61c1017233f99df7f1e6dee079ee9",
"score": "0.5450861",
"text": "def new_entry\n print \"new entry for: #{current_time}\" # Let the user know the date that the entry will be filed in.\n prompt; input = gets.chomp # Grab the user input.\n entry = Entry.new # Create a new entry object and store it in the 'entry' variable.\n entry.text = input # Store the the gets.chomp data in the text variable of the entry object.\n entry.time = current_time\n message = self.entries[entry.time] \n\n if message.empty?\n self.entries[entry.time] = [entry] # Store the message in entries with the current date as the key.\n else\n self.entries[entry.time].push(entry) \n end\n puts \"Saved it!\"\n end",
"title": ""
},
{
"docid": "c012825f4e3077d792454b099142a90c",
"score": "0.5449285",
"text": "def updateTimeline(timeline,data)\n additions = data['additions']\n changes = data['changes']\n deletions = data['deletions']\n editVaccines(changes['vaccine'],timeline)\n addVaccines(additions['vaccine'],timeline)\n addAllergies(additions['allergy'],timeline)\n editAllergies(changes['allergy'],timeline)\n addMilestones(additions['development'].concat(additions['feeding']),timeline)\n editMilestones(changes['feeding'],timeline)\n deleteVaccines(deletions['vaccine'],timeline)\n deleteAllergies(deletions['allergy'],timeline)\n end",
"title": ""
},
{
"docid": "343b99fd80592d94a342365951f6f5d3",
"score": "0.5448308",
"text": "def create\n\n if user_signed_in?\n @entry = Entry.new(params[:entry])\n\n @entry.user = current_user\n\n respond_to do |format|\n if @entry.save\n format.html { redirect_to @entry, notice: 'Entry was successfully created.' }\n format.json { render json: @entry, status: :created, location: @entry }\n # Save a copy of the new file\n Revision.create(:title => @entry.title , :body => @entry.body, :entry => @entry, :editor => current_user.name, :user => current_user)\n else\n format.html { render action: \"new\" }\n format.json { render json: @entry.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "2ade483e85932ccfc9cbc99bb6b845bb",
"score": "0.5448063",
"text": "def add_entry(name, phone, email)\n new_entry = Entry.new(name, phone, email)\n entries << new_entry\n end",
"title": ""
},
{
"docid": "426eee40ec435b91ed1bdfb213909502",
"score": "0.5440807",
"text": "def create\n @entry = Entry.new(params[:entry])\n respond_to do |format|\n if logged_in_user.entries << @entry \n @entry.save\n flash[:notice] = 'Entry was successfully created.'\n format.html { redirect_to user_entries_path}\n format.xml { render :xml => @entry, :status => :created, :location => @entry }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @entry.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "900f7fa679b3ec3257c58871da60c43b",
"score": "0.5437808",
"text": "def create\n @blog_entry = Blog::Entry.new(blog_entry_params)\n # @blog_entry.user = current_user\n\n respond_to do |format|\n if @blog_entry.save\n # @blog_article = Blog::Article.find(params[:blog_article][:id])\n # @blog_entry.blog_entry_assignments.create!(blog_article: @blog_article)\n format.html { redirect_to @blog_entry, notice: 'Entry was successfully created.' }\n format.json { render :show, status: :created, location: @blog_entry }\n else\n format.html { render :new }\n format.json { render json: @blog_entry.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c64599cf6a4a10b90c47e3b0ed7249bd",
"score": "0.5437132",
"text": "def post_entry(title = '', content = '', categories = [], draft = 'no', updated = '')\n entry_xml = entry_xml(title, content, categories, draft, updated)\n response = post(entry_xml)\n Entry.load_xml(response.body)\n end",
"title": ""
},
{
"docid": "8ae6c23b74a5d5fbc67582f82a907ce3",
"score": "0.5433153",
"text": "def add_to_timeline_followers\n self.user.followers.each do |follower|\n Timeline.create(tweet: self, user: follower.user)\n end\n end",
"title": ""
},
{
"docid": "98fb4b56aaaac818c610534419be2ebc",
"score": "0.5432713",
"text": "def create\n @entry = current_user.entries.build(entry_params)\n if @entry.save\n render json: @entry, status: 201, location: @entry\n end\n end",
"title": ""
},
{
"docid": "9c803e4a02a4f13f8ed9a32ead56f64f",
"score": "0.54280823",
"text": "def import_tweets(tweets)\n # check for errors before importing\n if tweets.is_a?(Hash) && (not tweets[\"error\"].nil?)\n $stderr.puts tweets\n return\n end\n\n tweets.each do |tweet|\n post = Post.new\n post.user_id = \"jev\"\n post.twitter_id = tweet[\"id\"].to_i\n post.created_at = Time.parse(tweet[\"created_at\"])\n post.text = tweet[\"text\"]\n post.save\n end\nend",
"title": ""
},
{
"docid": "28b2cd0cd0ce2e8a094207977a004551",
"score": "0.5422303",
"text": "def create\n @timesheet_entry = TimesheetEntry.new(params[:timesheet_entry])\n\n respond_to do |format|\n if @timesheet_entry.save\n format.html { redirect_to @timesheet_entry, notice: 'Timesheet entry was successfully created.' }\n format.json { render json: @timesheet_entry, status: :created, location: @timesheet_entry }\n else\n format.html { render action: \"new\" }\n format.json { render json: @timesheet_entry.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fbfab275e4245675a17e0c6406212758",
"score": "0.5411508",
"text": "def newEntry(table, entry)\n\t\t@conn.exec(\"INSERT INTO #{table} \" + insertQuery(entry) + \";\")\n\tend",
"title": ""
},
{
"docid": "db0d557cb7344db4f5efbc8e598509b9",
"score": "0.54066753",
"text": "def post_entry(forum_id, entry_title, entry_body, options = {})\n self.post(\"/entries.json\",\n options.merge(\n :body => { :entry => {\n :forum_id => forum_id, :title => entry_title, :body => entry_body\n } }.to_json\n )\n )\n end",
"title": ""
},
{
"docid": "db0d557cb7344db4f5efbc8e598509b9",
"score": "0.54066753",
"text": "def post_entry(forum_id, entry_title, entry_body, options = {})\n self.post(\"/entries.json\",\n options.merge(\n :body => { :entry => {\n :forum_id => forum_id, :title => entry_title, :body => entry_body\n } }.to_json\n )\n )\n end",
"title": ""
},
{
"docid": "ad150f2e4122b87262733d1a09eaa43e",
"score": "0.54037964",
"text": "def to_timeline_json\n h = Hash.new\n h[\"timeline\"] = Hash.new\n h[\"timeline\"][\"date\"] = []\n\n # create empty title event\n h[\"timeline\"][\"type\"] = \"default\"\n h[\"timeline\"][\"headline\"] = nil\n\n # add event\n x = Hash.new\n h[\"timeline\"][\"date\"] << x\n x[\"type\"] = \"default\"\n x[\"headline\"] = self.headline\n x[\"text\"] = self.story\n x[\"categories\"] = self.categories.present? ? self.categories.map{|x| {:name => x.name, :permalink => x.permalink}} : nil\n x[\"tags\"] = self.tags.present? ? self.tags.map{|x| {:name => x.name, :permalink => x.permalink}} : nil\n x[\"startDate\"] = self.start_datetime_timeline\n x[\"endDate\"] = self.end_datetime_timeline\n x[\"asset\"] = Hash.new\n x[\"asset\"][\"media\"] = self.media_url\n x[\"asset\"][\"credit\"] = self.credit\n x[\"asset\"][\"caption\"] = self.caption\n\n return h\n end",
"title": ""
},
{
"docid": "0e045774cb5a3a7c8ce73822e366da45",
"score": "0.5396576",
"text": "def create\n task = Task.find(params[:entry][:task_id])\n if task.type == 'Offering'\n owner = current_user\n contractor = task.user\n elsif task.type == 'Want'\n owner = task.user\n contractor = current_user\n end\n\n @entry = Entry.new(entry_params)\n @entry.task = task\n=begin\n @entry.title = task.title\n @entry.description = task.description\n @entry.prior_price = task.price\n @entry.expired_at = task.expired_at\n @entry.category = task.category\n=end\n @entry.owner = owner\n @entry.contractor = contractor\n @entry = current_user.entry!(@entry)\n\n respond_to do |format|\n if @entry\n format.html { redirect_to @entry, notice: t('activerecord.successful.messages.created', model: Entry.model_name.human) }\n format.json { render :show, status: :created, location: @entry }\n else\n format.html { render :new }\n format.json { render json: @entry.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bcc039fce608955150fc0068b248c587",
"score": "0.53943074",
"text": "def create\n @time_entry = TimeEntry.new(params[:time_entry])\n\n respond_to do |format|\n if @time_entry.save\n format.html { redirect_to @time_entry, notice: 'Time entry was successfully created.' }\n format.json { render json: @time_entry, status: :created, location: @time_entry }\n else\n format.html { render action: \"new\" }\n format.json { render json: @time_entry.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6e9a5024c1ec1f91e3496d873297a6fd",
"score": "0.53883404",
"text": "def add_news_to_entries\n feed = Feedjira::Feed.fetch_and_parse(config[\"url\"])\n feed.entries.take(@config[\"consume_top\"].to_i).each do |entry|\n next if @entries.any? {|e| e[:link] == entry.url} # skip duplicate entries\n @entries << { \n title: entry.title,\n summary: entry.summary,\n link: entry.url\n } # entry.published\n end\n end",
"title": ""
},
{
"docid": "a269fa1766cb0e7fe34deaf58bd90c4e",
"score": "0.5382685",
"text": "def create_entry(entry)\n\n # template\n xml = <<DATA \n <entry xmlns=\"http://purl.org/atom/ns#\">\n <link rel=\"related\" type=\"text/html\" />\n <summary type=\"text/plain\"></summary>\n </entry>\nDATA\n \n # edit xml\n doc = REXML::Document.new(xml)\n doc.elements['/entry/link'].add_attribute('href',entry[:url])\n doc.elements['/entry/summary'].add_text(entry[:summary])\n\n data=String.new \n doc.write(data)\n\n #make request\n path='/atom/post'\n \n req=Net::HTTP::Post.new(path)\n req['Accept']= 'application/x.atom+xml,application/xml,text/xml,*/*',\n req['X-WSSE']= @credential_string\n\n res = @http.request(req,data)\n case res\n when Net::HTTPSuccess then\n return get_edit_url(res.body)\n else\n raise \"Http Response != Success\"\n end\n end",
"title": ""
},
{
"docid": "40ef73f2cd3d00dec175e2bced28acfb",
"score": "0.5380337",
"text": "def update_entries_history(entries)\n \n for entry in entries do\n\n teh = TimesheetEntryHistory.new\n teh.dateValue = entry.dateValue\n teh.hours = entry.hours\n teh.disabled = entry.disabled\n teh.created_at = entry.created_at\n teh.updated_at = entry.updated_at\n teh.netAmount = entry.netAmount\n teh.startTime = entry.startTime\n teh.finishTime = entry.finishTime\n teh.breakHours = entry.breakHours\n teh.manual = entry.manual\n teh.chargeRate = entry.chargeRate\n teh.rate_id = entry.rate_id\n teh.rateType = entry.rateType\n teh.dayValue = entry.dayValue\n teh.original_timesheet_id = entry.timesheet_id\n # it seems that new entries are being written to DB somewhere before we get here\n # and we don't want them. so, need to check for null values!\n self.timesheet_entry_histories << teh unless teh.hours.nil? && teh.dayValue.nil?\n \n end\n \n end",
"title": ""
},
{
"docid": "115e3616a10c4642bf008e666b81da09",
"score": "0.5375625",
"text": "def create\n @entry = @contest.entries.new(params[:entry].merge(user: current_user))\n\n respond_to do |format|\n if @entry.save\n format.html { redirect_to contest_entry_url(@contest, @entry), notice: 'Entry was successfully created.' }\n format.json { render json: @entry, status: :created, location: @entry }\n else\n format.html { render action: \"new\" }\n format.json { render json: @entry.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fa3e1063baa8e0ce0b696135cccf3cbe",
"score": "0.5367083",
"text": "def create\n @timeentry = Timeentry.new(timeentry_params)\n @timeentry.user = current_user\n\n respond_to do |format|\n if @timeentry.save\n format.html { redirect_to @timeentry, notice: 'Timeentry was successfully created.' }\n format.json { render :show, status: :created, location: @timeentry }\n else\n format.html { render :new }\n format.json { render json: @timeentry.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "942aa4c100f08a5bc67c3d6942a9f7da",
"score": "0.53652257",
"text": "def create\n authorize! :manage, User\n @timeline_event = TimelineEvent.new(params[:timeline_event])\n\n respond_to do |format|\n if @timeline_event.save\n format.html { redirect_to @timeline_event, :notice => 'Timeline event was successfully created.' }\n format.json { render :json => @timeline_event, :status => :created, :location => @timeline_event }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @timeline_event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5da3bb5e9d9c002e8bbf5815120f64f0",
"score": "0.5363482",
"text": "def create\n @time_entry = TimeEntry.new(params[:time_entry])\n\n respond_to do |format|\n if @time_entry.save\n format.html { redirect_to(time_entries_url, :notice => 'Time entry was successfully created.') }\n format.xml { render :xml => @time_entry, :status => :created, :location => @time_entry }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @time_entry.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f0969ae806b0f7279c387c68f17307aa",
"score": "0.53632104",
"text": "def create\n @facebook_timeline = Facebook::Timeline.new(params[:facebook_timeline])\n\n respond_to do |format|\n if @facebook_timeline.save\n format.html { redirect_to @facebook_timeline, notice: 'Timeline was successfully created.' }\n format.json { render json: @facebook_timeline, status: :created, location: @facebook_timeline }\n else\n format.html { render action: \"new\" }\n format.json { render json: @facebook_timeline.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "696a119d79059aae741540260774fb60",
"score": "0.53629375",
"text": "def create\n @entry = list.entries.build(params[:entry])\n\n respond_to do |format|\n if entry.save\n format.html { redirect_to list, notice: 'Entry was successfully created.' }\n format.json { render json: entry, status: :created, location: [list, entry] }\n else\n format.html { render action: \"new\" }\n format.json { render json: entry.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "21599cdb8a84ebf75bfbf33b0ae17580",
"score": "0.53622717",
"text": "def create\n @time_sheet_entry = TimeSheetEntry.new(params[:time_sheet_entry])\n\n respond_to do |format|\n if @time_sheet_entry.save\n format.html { render text: \"ok\" }\n format.json { render json: @time_sheet_entry, status: :created, location: @time_sheet_entry }\n else\n format.html { render action: \"new\", layout: false, status: :unprocessable_entity }\n format.json { render json: @time_sheet_entry.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f937e5d1379af534fbd1a626cabee4f3",
"score": "0.5352142",
"text": "def add(entry)\n heap.add(entry.run_at, entry)\n end",
"title": ""
},
{
"docid": "10cd60c1ad05e01999cf810354f0035d",
"score": "0.5348391",
"text": "def create(attributes)\n sanitize_attributes!(attributes)\n\n content_type.entries.build(attributes).tap do |entry|\n entry.created_by = account if account\n\n if entry.save\n track_activity 'content_entry.created', parameters: activity_parameters(entry)\n end\n end\n end",
"title": ""
},
{
"docid": "3b420bd5c71cc8663172a08595cc762e",
"score": "0.53483105",
"text": "def timeline_params\n params.require(:timeline).permit(:id, :user_id, :task_id, :custom_text, :created_at)\n end",
"title": ""
},
{
"docid": "8ad0ab6b28b05809c74740ada0e52aa5",
"score": "0.5342403",
"text": "def create_entry(title, body)\n x = Builder::XmlMarkup.new :indent => 2\n x.entry 'xmlns' => 'http://www.w3.org/2005/Atom' do\n x.title title, 'type' => 'text'\n x.content 'type' => 'xhtml' do\n x.div body, 'xmlns' => 'http://www.w3.org/1999/xhtml'\n end\n end\n \n @entry ||= x.target!\n path = \"/feeds/#{@blog_id}/posts/default\"\n post(path, @entry)\n end",
"title": ""
},
{
"docid": "0935e45ec08441630e7484fd682039f9",
"score": "0.53398335",
"text": "def after_create\n totem_events.create(:body => content, :author => feed.site_name, :title => title)\n end",
"title": ""
},
{
"docid": "a9006ded9aebeac47609833e194a34f3",
"score": "0.5334597",
"text": "def create\n params[:entry][:user_id] = current_user.id unless params[:entry].key?(:user_id)\n\n @entry = Entry.new(params[:entry])\n @title = \"New entry\"\n\n respond_to do |format|\n if @entry.save\n format.html { redirect_to @entry, :notice => 'Entry was successfully created.' }\n format.json { render :json => @entry, :status => :created, :location => @entry }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @entry.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5ab6e4f6e2a00ad7665019b25b757977",
"score": "0.53334206",
"text": "def convert_blog_entries\n post_type = PostType.find_by!(slug: 'blog_post')\n\n Entry.order('id asc').each do |item|\n attributes = {\n post_type: post_type,\n created_at: item.created_at,\n updated_at: item.updated_at,\n user: item.user,\n agent: item.agent,\n ip: item.ip,\n deleted: item.deleted?,\n show_owner: item.show_name?,\n view_count: item.view_count,\n publication_time: item.publication_time || item.created_at,\n title: item.title,\n slug: item.slug,\n image_name: item.image_name,\n image_source_name: item.image_author_name,\n image_source_link: item.image_author_link,\n source_name: item.source,\n source_link: item.source_link,\n lead: item.lead,\n body: item.body,\n data: {\n legacy: {\n external_id: item.external_id,\n privacy: item.privacy\n }\n }\n }\n\n unless item.image.blank?\n attributes[:image] = Pathname.new(item.image.path).open\n end\n\n new_item = Post.create!(attributes)\n\n move_comments(item, new_item) if item.comments.any?\n end\n end",
"title": ""
},
{
"docid": "8c67aeceed84d80b329772ffc0611cef",
"score": "0.5329585",
"text": "def create\n @entry = Entry.new(params[:entry])\n #@entry.user = current_user\n \n respond_to do |format|\n if @entry.save\n if @entry.status.blank?\n redirect_path = 'entries_path'\n else\n redirect_path = @entry.status + '_entries_path'\n end\n flash[:notice] = 'New To Do was successfully created.'\n format.html { redirect_to eval(redirect_path) }\n format.xml { render :xml => @entry, :status => :created, :location => @entry }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @entry.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
141dd5dc0f83d4c3907ca0074e7e5076
|
GET /playeraccomplishments GET /playeraccomplishments.xml
|
[
{
"docid": "df5acb4a0a2e9ea8f4cc140f1085a548",
"score": "0.73724455",
"text": "def index\n @playeraccomplishments = Playeraccomplishment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @playeraccomplishments }\n end\n end",
"title": ""
}
] |
[
{
"docid": "84c43752239401eb001e68db8ad6e89c",
"score": "0.69589186",
"text": "def show\n @playeraccomplishment = Playeraccomplishment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @playeraccomplishment }\n end\n end",
"title": ""
},
{
"docid": "600f25a9b40302d34269bebe7b35e1aa",
"score": "0.63527334",
"text": "def show \n @player = Player.find(params[:id])\n \n # load accomplishments that are done\n @accomplishmentsdone = Playeraccomplishment.all(\n :conditions=>{:achieved=>true, :player_id=> @player.id}, \n :include=>:accomplishment).sort_by {\n |status| [status.accomplishment.section, \n status.accomplishment.linenumber]}\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @player }\n end\n end",
"title": ""
},
{
"docid": "ac44d878aca07ff007d2add41552cc03",
"score": "0.62779605",
"text": "def index\n @player_steps = PlayerStep.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @player_steps }\n end\n end",
"title": ""
},
{
"docid": "86dd12e5e09c381071cee2e1e4bce653",
"score": "0.6235576",
"text": "def index\n @program_players = ProgramPlayer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @program_players }\n end\n end",
"title": ""
},
{
"docid": "2a79c03524d4aaac063fd08bbf9d3b63",
"score": "0.61702967",
"text": "def index\n @players = Player.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @players }\n end\n end",
"title": ""
},
{
"docid": "2a79c03524d4aaac063fd08bbf9d3b63",
"score": "0.61702967",
"text": "def index\n @players = Player.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @players }\n end\n end",
"title": ""
},
{
"docid": "3542aa491c412f7525f4c4741bd14e24",
"score": "0.612626",
"text": "def index\n @playerlevels = @player.playerlevels.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @playerlevels }\n end\n end",
"title": ""
},
{
"docid": "47751a2b565c1083b7fbc569451a257b",
"score": "0.6086",
"text": "def new\n @playeraccomplishment = Playeraccomplishment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @playeraccomplishment }\n end\n end",
"title": ""
},
{
"docid": "a3f62fc49fa4dbb7cffe6b5539eb79d9",
"score": "0.6059041",
"text": "def show\n @ncaa_player = NcaaPlayer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ncaa_player }\n end\n end",
"title": ""
},
{
"docid": "609360f0ffd28ac0ca662e6e00715a6f",
"score": "0.6057087",
"text": "def show\n @program_player = ProgramPlayer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @program_player }\n end\n end",
"title": ""
},
{
"docid": "96382a9278a5cb69e830eb492dff1ac2",
"score": "0.6043988",
"text": "def show\n @team_player = TeamPlayer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @team_player }\n end\n end",
"title": ""
},
{
"docid": "c0f74efe6cc2568d90397e7e5de1ae31",
"score": "0.60377574",
"text": "def index\n request.format = 'xml'\n @projects = @game_type.projects.all\n respond_with(@projects)\n end",
"title": ""
},
{
"docid": "9d9f56bd7e0d7c69d870df77987ca01b",
"score": "0.6010969",
"text": "def index\n @team = Team.find(params[:team_id])\n @players = @team.players\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @players }\n end\n end",
"title": ""
},
{
"docid": "54bc0e161369473d198a4ec780f9113b",
"score": "0.5952283",
"text": "def show\n @players_task = PlayersTask.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @players_task }\n end\n end",
"title": ""
},
{
"docid": "c61c442b5455ca94caf897499fa2103a",
"score": "0.5943226",
"text": "def index\n @talks = @conference.talks\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @talks }\n end\n end",
"title": ""
},
{
"docid": "8eb134daa10ab36bbdcef99330eeb6e7",
"score": "0.5902098",
"text": "def show\n @player = Player.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @player }\n end\n end",
"title": ""
},
{
"docid": "8eb134daa10ab36bbdcef99330eeb6e7",
"score": "0.5902098",
"text": "def show\n @player = Player.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @player }\n end\n end",
"title": ""
},
{
"docid": "8eb134daa10ab36bbdcef99330eeb6e7",
"score": "0.5902098",
"text": "def show\n @player = Player.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @player }\n end\n end",
"title": ""
},
{
"docid": "8eb134daa10ab36bbdcef99330eeb6e7",
"score": "0.5902098",
"text": "def show\n @player = Player.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @player }\n end\n end",
"title": ""
},
{
"docid": "8eb134daa10ab36bbdcef99330eeb6e7",
"score": "0.5902098",
"text": "def show\n @player = Player.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @player }\n end\n end",
"title": ""
},
{
"docid": "8eb134daa10ab36bbdcef99330eeb6e7",
"score": "0.5902098",
"text": "def show\n @player = Player.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @player }\n end\n end",
"title": ""
},
{
"docid": "f34b93e183ff74adcfb9bb390853c681",
"score": "0.58976215",
"text": "def show\n @game_player = GamePlayer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @game_player }\n end\n end",
"title": ""
},
{
"docid": "ebe7eefa52cbedfc1c0fa6a9ae5f737a",
"score": "0.58877254",
"text": "def show\n #@player = Player.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @player }\n end\n end",
"title": ""
},
{
"docid": "e08730945173244d080d0bf1887b4107",
"score": "0.58798295",
"text": "def xml(options = {})\n host = Picasa.host\n path = Picasa.path(options)\n url = URI(\"#{host}#{path}\")\n\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n\n req = add_auth_headers(Net::HTTP::Get.new url.path)\n\n response = http.request(req)\n if response.code =~ /20[01]/\n response.body\n end\n end",
"title": ""
},
{
"docid": "507dee385cfd20c53f9af62a2c913508",
"score": "0.5879607",
"text": "def index\n @playlists = @user.playlists.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @playlists }\n end\n end",
"title": ""
},
{
"docid": "1ab959a367a3a9919252cd7c2ace01bc",
"score": "0.5871825",
"text": "def show\n @fantasy_player = FantasyPlayer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @fantasy_player }\n end\n end",
"title": ""
},
{
"docid": "3baea9088b4fb6fc59dbd018d4940499",
"score": "0.5853038",
"text": "def show\n @playerlevel = @player.playerlevels.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @playerlevel }\n end\n end",
"title": ""
},
{
"docid": "8bbb2dbdc21d3151da95ca175e6fab7e",
"score": "0.5824722",
"text": "def show\n @player_step = PlayerStep.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @player_step }\n end\n end",
"title": ""
},
{
"docid": "196e46d5be040059a079b63df95de74d",
"score": "0.5803583",
"text": "def playlist\n headers['Content-Type'] = 'text/xml; charset=utf-8'\n end",
"title": ""
},
{
"docid": "0783091a56ea5e78dcbb0d0a50f58277",
"score": "0.5794245",
"text": "def index\n @participations = @player.participations.all\n end",
"title": ""
},
{
"docid": "7decec94003af25369ef15cf34364de6",
"score": "0.5787986",
"text": "def index\n # Only show the current user their own plays.\n current_user = get_current_user\n @plays = current_user.plays\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @plays }\n end\n end",
"title": ""
},
{
"docid": "b55211f5b142fa868b6dbdc2ba93325d",
"score": "0.57837343",
"text": "def index\n @talks = Talk.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @talks }\n end\n end",
"title": ""
},
{
"docid": "8d2b7af23a4619ee81bb334eb18f80f7",
"score": "0.57527775",
"text": "def index\n @achievements = Achievement.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @achievements }\n end\n end",
"title": ""
},
{
"docid": "58925009b37eb20a61b6418e0ad90db8",
"score": "0.5750015",
"text": "def show\n @tournament = Tournament.find(params[:id])\n @participations = @tournament.participations :include => :player\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tournament }\n end\n end",
"title": ""
},
{
"docid": "0a91b529e875ad998d032fb2ed15264f",
"score": "0.57206225",
"text": "def show\n @player_answer = PlayerAnswer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @player_answer }\n end\n end",
"title": ""
},
{
"docid": "acd6043a62d0a9a8ef7701631bac31de",
"score": "0.57202214",
"text": "def show\n @peer = @player.peers.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @peer }\n end\n end",
"title": ""
},
{
"docid": "5ffd537690185b1e2de7151352bffb30",
"score": "0.5695166",
"text": "def get_xbox\n Rails.logger.debug \"Fetching xbox achievements from trueachievements...\"\n get_xml('https://www.trueachievements.com/friendfeedrss.aspx?gamerid=294291', 'gaming_expiry')\n end",
"title": ""
},
{
"docid": "65a9f434a0f784f4c0a2e3cfc12f119d",
"score": "0.56886566",
"text": "def show\n @teamplayer = Teamplayer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @teamplayer }\n end\n end",
"title": ""
},
{
"docid": "3ba14b91da825d4a34d3dd8f8bc3304e",
"score": "0.56868833",
"text": "def show\n @participants = Participant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @participants }\n end\n end",
"title": ""
},
{
"docid": "796140ee1215d76a3765656386f79a34",
"score": "0.5681819",
"text": "def live_schedule\n get('sports/en/schedules/live/schedule.xml')\n end",
"title": ""
},
{
"docid": "58fe58f0deaaaf3f58b6f674d4fc0f3f",
"score": "0.56763357",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @challenge }\n end\n end",
"title": ""
},
{
"docid": "96b885c36e17f123d0e9cb35a0e6a413",
"score": "0.5673282",
"text": "def index\n @talkresps = Talkresps.all\n end",
"title": ""
},
{
"docid": "80006aa95fe5e783bcc5faf72c7cb3fb",
"score": "0.56709826",
"text": "def show\n @achievements_person = AchievementsPerson.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @achievements_person }\n end\n end",
"title": ""
},
{
"docid": "08c3394700909202be56ae93dea32b0b",
"score": "0.56566244",
"text": "def index\n @program_coaches = ProgramCoach.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @program_coaches }\n end\n end",
"title": ""
},
{
"docid": "1187600dd194c8b3d7476b5cf7683694",
"score": "0.5654379",
"text": "def index\n @playlists = Playlist.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @playlists }\n end\n end",
"title": ""
},
{
"docid": "b9597e93ff5dfc1a5d64a405f14af5a3",
"score": "0.5653766",
"text": "def show\n @accomplishment = Accomplishment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @accomplishment }\n end\n end",
"title": ""
},
{
"docid": "0e4f287bb09d3ddd3efcc72030f9b009",
"score": "0.56486475",
"text": "def index\n @coachgoals = Coachgoal.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @coachgoals }\n end\n end",
"title": ""
},
{
"docid": "46eaff597abedbaf16bb953cd49f3e9f",
"score": "0.56287915",
"text": "def index\n @default_team_assignments = DefaultTeamAssignment.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @default_team_assignments }\n end\n end",
"title": ""
},
{
"docid": "79b99268cd2962e8758b2fdb8de73910",
"score": "0.5608063",
"text": "def show\n @question = @questions.find(params[:id])\n @hunt = @question.hunt\n @current_player = @hunt.players.find_by_user_id(current_user.id)\n @questions = @hunt.questions\n @player_response = Response.find_by_question_id_and_player_id(@question.id, @current_player.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @question }\n format.kml\n end\n end",
"title": ""
},
{
"docid": "777c50810aa7d26d616a90f125e63f7f",
"score": "0.56042653",
"text": "def show\n @player_expense = PlayerExpense.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @player_expense }\n end\n end",
"title": ""
},
{
"docid": "751db92166af9a8f6fc966979658166b",
"score": "0.5603529",
"text": "def show\n @game_play = GamePlay.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @game_play }\n end\n end",
"title": ""
},
{
"docid": "f1cd8edbd07f0dbb6e7be17daf50c35a",
"score": "0.5596219",
"text": "def index\n @games = @user.games\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render xml: @games}\n end\n end",
"title": ""
},
{
"docid": "8386ecfcc31c0ab284395a92223891f9",
"score": "0.55902743",
"text": "def show\n\t@player_answer = PlayerAnswer.find(params[:id])\n\n\trespond_to do |format|\n\t format.html # show.html.erb\n\t format.xml { render :xml => @player_answer }\n\tend\n end",
"title": ""
},
{
"docid": "8386ecfcc31c0ab284395a92223891f9",
"score": "0.55902743",
"text": "def show\n\t@player_answer = PlayerAnswer.find(params[:id])\n\n\trespond_to do |format|\n\t format.html # show.html.erb\n\t format.xml { render :xml => @player_answer }\n\tend\n end",
"title": ""
},
{
"docid": "de29fcad1a81ba632b649be3a627a99d",
"score": "0.55877465",
"text": "def index\n @labs = @course.labs.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render xml: @labs }\n end\n end",
"title": ""
},
{
"docid": "28d578361527432ee81e388628b3e9f1",
"score": "0.55803585",
"text": "def index\n I18n.locale = params[:locale] if params[:locale]\n if params[:login].present?\n @player = Player.find_by_login(params[:login])\n end\n\n respond_to do |format|\n format.html\n format.xml { render :xml => [@player] }\n end\n end",
"title": ""
},
{
"docid": "91814723c29e3ba9f84874aa5e263185",
"score": "0.55644625",
"text": "def show\n @coachgoal = Coachgoal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @coachgoal }\n end\n end",
"title": ""
},
{
"docid": "e0f15adb12520eff1ffe43c7cd980afe",
"score": "0.5560188",
"text": "def index\n @prefectures = Prefecture.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @prefectures }\n end\n end",
"title": ""
},
{
"docid": "2be5b3c065100cd83e680daba0904b20",
"score": "0.55481905",
"text": "def index\n @goals = Goals.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @goals }\n end\n end",
"title": ""
},
{
"docid": "2bfaec9dea7ab162fd8ac0d71076c19c",
"score": "0.5547536",
"text": "def show\n # @players = ::Services::PlayerService.show_players(params[:page])\n end",
"title": ""
},
{
"docid": "6ebf58ac98e42825a23682a3e62283f4",
"score": "0.55324435",
"text": "def show\n @goals = Goals.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @goals }\n end\n end",
"title": ""
},
{
"docid": "a762f3b7030b3e86fa0f2b132348f514",
"score": "0.5527668",
"text": "def show\n @player_game_stat_estimate = PlayerGameStatEstimate.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @player_game_stat_estimate }\n end\n end",
"title": ""
},
{
"docid": "366df4faebae61de9ac176684305075e",
"score": "0.5526235",
"text": "def view_players\n @players = Player.get_all_players\n end",
"title": ""
},
{
"docid": "57169d1de921b9ffe93e5ae79d00612d",
"score": "0.5515935",
"text": "def index\n @live_sources = LiveSource.find(:all)\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { @live_sources.to_xml }\n end\n end",
"title": ""
},
{
"docid": "75cbcf56e70b6f05f18bf63abd4293fd",
"score": "0.55132854",
"text": "def index\n self.class.get(\"/cards/index.xml\");\n end",
"title": ""
},
{
"docid": "6e594f6f61ce03ee55008fb830c5b698",
"score": "0.5512494",
"text": "def show\n\n \t\t\trespond_with @player\n\n \t\tend",
"title": ""
},
{
"docid": "6f0329e091c731034f3f6627535a841c",
"score": "0.5510439",
"text": "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",
"title": ""
},
{
"docid": "a3e01b4d902a119ba6699fc72a732a6f",
"score": "0.5508311",
"text": "def show\r\n @pppams_issue = PppamsIssue.find(params[:id])\r\n @pppams_issue_follow_ups = @pppams_issue.pppams_issue_follow_ups.find(:all)\r\n respond_to do |format|\r\n format.html # show.rhtml\r\n format.xml { render :xml => @pppams_issue.to_xml }\r\n end\r\n end",
"title": ""
},
{
"docid": "f1da87ad0801c22093430bc91b65c78b",
"score": "0.5501878",
"text": "def show\n @player = Player.find(params[:id])\n @usga_scores = @player.usga_scores.sort_by { |sc| sc.score }\n @usga_score_count = @player.usga_scores_to_use(@usga_scores.collect { |sc| sc.score }.size)\n @gms = ([0] << @player.unopposed_games).flatten.compact\n @player.scores.excluding_games(@gms).week_ending(1000000).last_few(4)\n\n @pearson_scores = @player.scores.all_by_week.last_few(4+(@gms.size-1))\n\n respond_to do |format|\n format.xml { render :xml => {:usga_scores => @usga_scores, :gms => @gms, :player => @player, :all_scores => @player.scores.all_by_week, :pearson_scores => @pearson_scores}, :root => 'player-card', :skip_types => true }\n format.html # show.html.erb\n format.json { render json: @player }\n end\n end",
"title": ""
},
{
"docid": "8f413828871e64c69680bc03cb80b525",
"score": "0.55013657",
"text": "def show\n @play = Play.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @play }\n end\n end",
"title": ""
},
{
"docid": "134a9fa3fb4ce3a3b87abc9254a15f0d",
"score": "0.54995525",
"text": "def show\n @team_assignment = TeamAssignment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @team_assignment }\n end\n end",
"title": ""
},
{
"docid": "be7dcd52e873794d4d18bdc814ad9654",
"score": "0.54970616",
"text": "def index\n @leagues = League.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @leagues }\n end\n end",
"title": ""
},
{
"docid": "882d54b7a99062b772ace6f3d1e870c5",
"score": "0.54929245",
"text": "def show\n @player = Player.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @player }\n format.json { render :json => @player }\n end\n end",
"title": ""
},
{
"docid": "5bd05a137fb97f1470931947a0468175",
"score": "0.54920214",
"text": "def index\n @playlist_test_cases = PlaylistTestCase.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @playlist_test_cases }\n end\n end",
"title": ""
},
{
"docid": "a6b2ecebc0f20b7386d70b284bda2948",
"score": "0.54867846",
"text": "def index\n @players = Player.all\n respond_with @players\n end",
"title": ""
},
{
"docid": "54502229119c27b231be6366127e93ae",
"score": "0.5474622",
"text": "def index\n @inscription_players = InscriptionPlayer.includes(:inscription).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @inscription_players }\n end\n end",
"title": ""
},
{
"docid": "05c947bb4938a56bc87ddd70b1d12051",
"score": "0.54729974",
"text": "def get_high_scores\n RESTful.get(\"#{URL_MICROSERVICE_PLAYER}/players\")\n end",
"title": ""
},
{
"docid": "a893c78f7bdfe69092b9b7894c6cfcac",
"score": "0.546916",
"text": "def show\n @default_team_assignment = DefaultTeamAssignment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @default_team_assignment }\n end\n end",
"title": ""
},
{
"docid": "e90884b5ef8c44c0a4aeee9d280ffaa2",
"score": "0.5466832",
"text": "def show\n @pro_team = ProTeam.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @pro_team }\n end\n end",
"title": ""
},
{
"docid": "88ead0718c2b3a58d38211d0ea4d1ab3",
"score": "0.54612356",
"text": "def index\n @proposals = Lunch.next.proposals\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @proposals }\n end\n end",
"title": ""
},
{
"docid": "1548118fd32e254c442256250b26dce2",
"score": "0.5454146",
"text": "def get_user_playlists\n send_request 'getUserPlaylists'\n end",
"title": ""
},
{
"docid": "18f007d40e8e1d96141b8c2b14789497",
"score": "0.5450548",
"text": "def players(*args) \n team_id = args.first \n player_type = args.last\n response = get('?Txml=5&ID='+team_id.to_s()+'&Tpo='+player_type.to_s(), {}).Elementos.Elemento\n end",
"title": ""
},
{
"docid": "f9cd00138926d5587e1ada4cdc3da67a",
"score": "0.5444445",
"text": "def index\n @player_goals = PlayerGoal.all\n end",
"title": ""
},
{
"docid": "1b85541d2da1d5477e8e204ea5e4c1b8",
"score": "0.54337305",
"text": "def index\n @followups = @scope.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @followups }\n end\n end",
"title": ""
},
{
"docid": "2e3f06dcdf021bcb5b282db0a27b2264",
"score": "0.543038",
"text": "def index\n @games = Game.played_by_current_user(self.current_user)\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @scores }\n end\n end",
"title": ""
},
{
"docid": "c2c2febabc0d7b10d052bf7a5ecb3198",
"score": "0.54262984",
"text": "def index\n @assignments = @question.assignments.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @assignment }\n end\n end",
"title": ""
},
{
"docid": "b072637923135d43d07646835dd0e84e",
"score": "0.54260033",
"text": "def show\r\n @player = Player.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.xml { render :xml => @player }\r\n format.json { render :json => @player }\r\n end\r\n end",
"title": ""
},
{
"docid": "0d4863c7d6f48f46a07520f6577191a1",
"score": "0.5422653",
"text": "def index\n @competences = Competence.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @competences }\n end\n end",
"title": ""
},
{
"docid": "f5a61b27e7d49fb6f79ec9bc6056ee1b",
"score": "0.5421252",
"text": "def match_status\n get('descriptions/en/match_status.xml')\n end",
"title": ""
},
{
"docid": "ec0bda36fe3d4a848a2416a81e593b7f",
"score": "0.5420987",
"text": "def index\n# @advancements = Advancement.all\n#\n# respond_to do |format|\n# format.html # index.html.erb\n# format.xml { render :xml => @advancements }\n# end\n end",
"title": ""
},
{
"docid": "aea47f66c401d40d8f1b466aafb65384",
"score": "0.5419102",
"text": "def show\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @game }\n end\n end",
"title": ""
},
{
"docid": "313badd60c52bc844f90a007e8b75969",
"score": "0.54131854",
"text": "def index\n @needs = @venture.needs.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @needs }\n end\n end",
"title": ""
},
{
"docid": "8ce1c171a36e847cee081e5ea322fa4a",
"score": "0.5412996",
"text": "def index\n @contests = Contest.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @contests }\n end\n end",
"title": ""
},
{
"docid": "76ca7e7b09de6160d89b578f97d00a2d",
"score": "0.5411218",
"text": "def show\n @quest_participation = QuestParticipation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @quest_participation }\n end\n end",
"title": ""
},
{
"docid": "319e7a5a4da03604fc898ab086897465",
"score": "0.5410265",
"text": "def index\n @players = Player.all\n respond_with @players \n end",
"title": ""
},
{
"docid": "0d8ce515ab8f5fb4fa9bc5274cd70916",
"score": "0.54088944",
"text": "def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @game }\n end\n end",
"title": ""
},
{
"docid": "52927b1ec8aab09c7ee4385afc4fd10e",
"score": "0.54075974",
"text": "def index\n @neuropsych_assessments = NeuropsychAssessment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @neuropsych_assessments }\n end\n end",
"title": ""
},
{
"docid": "737f9a37293e39d04cc47cad65af42cb",
"score": "0.5406892",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @talk }\n end\n end",
"title": ""
},
{
"docid": "3bc071a22f9725a9079973f1b6c4ac1e",
"score": "0.5402367",
"text": "def player(args={})\n fetch(url(:\"player\", args))\n end",
"title": ""
},
{
"docid": "575424c8390c7a7b883e4f596513e483",
"score": "0.53904355",
"text": "def show\n @peer_review = PeerReview.find(params[:id])\n @users = @peer_review.users.all(:order => \"email asc\")\n @assignments = @peer_review.peer_review_assignments.where(:participant => true)\n @errors = []\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @peer_review }\n end\n end",
"title": ""
}
] |
5c9d59322f74073e19ea372444e5f0df
|
GET /partners/:partner_id/categories/1 GET /partners/:partner_id/categories/1.json
|
[
{
"docid": "b18a80f2b197b39cab5213692a5d81ec",
"score": "0.6351648",
"text": "def show\n @category = PartnerCategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end",
"title": ""
}
] |
[
{
"docid": "c45eac89a4e77b57db2717f4a9ff00d0",
"score": "0.7944721",
"text": "def index\n @partner = Partner.find(params[:partner_id])\n @categories = @partner.partner_categories.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end",
"title": ""
},
{
"docid": "a3de78c09f0e16efc8883981c1348fda",
"score": "0.6975697",
"text": "def new\n @partner = Partner.find(params[:partner_id])\n @category = PartnerCategory.new\n @master_categories = Category.where( :master_category_id => nil )\n @sub_categories = Category.where( \"master_category_id is not null\" )\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @category }\n end\n end",
"title": ""
},
{
"docid": "bd7f457291ea26e7a11c69e4c64b3fd9",
"score": "0.64242846",
"text": "def fetch_categories\n xml = \"Request categories.\"\n respond_with_raw get(\"#{BASE_URL}/v1/categories?api_key=#{API_KEY}&format=json\", :body => xml)\n end",
"title": ""
},
{
"docid": "e20cb5d393eed5c1f06427d628bcdeff",
"score": "0.6333554",
"text": "def index\n # @composers = Composer.all\n @composers = @category.composers \n\n render json: @composers \n end",
"title": ""
},
{
"docid": "efcb5e10780279c84a4be599091f0268",
"score": "0.63271296",
"text": "def categories\n call_api('/categories')\n end",
"title": ""
},
{
"docid": "cbaaaea36060608aabccdc505dfd21a9",
"score": "0.6326006",
"text": "def create\n @category = PartnerCategory.new(params[:partner_category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to partner_categories_url, notice: 'Partner category was successfully created.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3cba43678b445865af5afd71d9719de9",
"score": "0.62799704",
"text": "def get_categories()\n response = RestClient.get @host + \"/categories\", { :accept => :json }\n return JSON.parse(response.body)\n end",
"title": ""
},
{
"docid": "ec14212d07b2c606100f56c1b708c14e",
"score": "0.62570316",
"text": "def categories\n get('venues/categories').categories\n end",
"title": ""
},
{
"docid": "defa7a56dc5d529b251961ecccafe7af",
"score": "0.607068",
"text": "def get_department_categories\n department = Department.find(params[:department_id])\n categories = department.categories\n json_response(categories)\n end",
"title": ""
},
{
"docid": "132e3f3a936d8b326034496bd13103ab",
"score": "0.60411143",
"text": "def get_by_partner_category\n if params[ :category_identifier ]\n @partner_category = PartnerSiteCategory.first :conditions => [\n 'name = ? and partner_site_id = ?',\n params[ :category_identifier ],\n @partner_site.id ]\n\n @quiz = Quiz.find( :first, :order => 'RAND()', \n :conditions =>\n \"active=1 and quiz_category_id IN ( #{@partner_category.quiz_categories.collect { |qc| qc.id }.join( ',' )} )\n AND id IN ( #{@partner_site.shared_quizzes.collect{ |sq| sq.id }.join( ',' )})\"\n )\n \n if @quiz\n @quiz_phase = @quiz.quiz_phases.first\n\n render 'show'\n #render :xml => @quiz.to_xml\n else\n head 404\n end\n else\n render 400\n end\n end",
"title": ""
},
{
"docid": "6d2573a7dd7e66c6b090cb93914bf727",
"score": "0.6027994",
"text": "def categories!\n mashup(self.class.get(\"/\", :query => method_params('aj.categories.getList'))).categories.category\n end",
"title": ""
},
{
"docid": "a3ba4406a807764976d8c6c10b83e338",
"score": "0.6007047",
"text": "def categories\n connection.get(\"/categories\").body.spot_categories\n end",
"title": ""
},
{
"docid": "a3ba4406a807764976d8c6c10b83e338",
"score": "0.6007047",
"text": "def categories\n connection.get(\"/categories\").body.spot_categories\n end",
"title": ""
},
{
"docid": "31f384415c4fd5c41a47912197a63ed3",
"score": "0.60041434",
"text": "def destroy\n @category = PartnerCategory.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to partner_categories_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "8e1abd1795c29bc436d5ced01a91a98d",
"score": "0.5955303",
"text": "def get_appcon_categories \n get(\"/appcon.json/categories\")\nend",
"title": ""
},
{
"docid": "cfbafb879fe4ffe7bac26fbce2485a1c",
"score": "0.59030414",
"text": "def categories_for_decision\n @decision = Decision.find params[:id]\n @categories = @decision.categories\n end",
"title": ""
},
{
"docid": "80385399b5edbcc5d92a8f1dfd1e9a0a",
"score": "0.5821073",
"text": "def get_categories\r\n OpportunityCategory.where(\"opportunity_id = ?\", opportunity_id).all\r\n end",
"title": ""
},
{
"docid": "f477230c33075803bfb6dd600eb6cf1b",
"score": "0.5803127",
"text": "def categorize\n out = {}.to_json\n if params[:url]\n # uri_enc_url = Rack::Utils.escape(params[:url])\n endpoint = \"http://access.alchemyapi.com/calls/url/URLGetCategory\"\n q = \"#{endpoint}?apikey=#{ENV[\"ALCHEMY_KEY\"]}&url=#{params[:url]}&outputMode=json\"\n out = RestClient.get(q)\n end\n respond_to do |format|\n format.html\n format.json { render :json => out.body }\n end\n end",
"title": ""
},
{
"docid": "1945f36528d833e24d02acb7c3d412f0",
"score": "0.5781682",
"text": "def get_appcon_categories \n get(\"/appcon.json/categories\")\n end",
"title": ""
},
{
"docid": "bd8294faa6566189a95f9545d03bbe0b",
"score": "0.57771367",
"text": "def index\n # TODO(partner)\n @partners = [] # current_user.partners.page(params[:page]).per(50)\n render json: @partners, status: 200, each_serializer: ::V1::PartnerSerializer, scope: {user: current_user}\n end",
"title": ""
},
{
"docid": "3daa3c9091d83cac3b53a2ca20088498",
"score": "0.57738644",
"text": "def categories(params={})\r\n url = api_url \"/categories\"\r\n req = request_params({currency: @currency, locale: @locale}.merge(params))\r\n \r\n feed_or_retry do\r\n RestClient.get url, req\r\n end \r\n end",
"title": ""
},
{
"docid": "2bd85a4101ce25ff3b275a1b7e24ce0f",
"score": "0.57729614",
"text": "def index\n @categories = @user.categories\n json_response(@categories)\n end",
"title": ""
},
{
"docid": "86e5d5637eeb2a8cc989235e83e67c7b",
"score": "0.57509744",
"text": "def get\n payload = {}\n @client.post('categories/get', payload)\n end",
"title": ""
},
{
"docid": "61e217218f66d62a9d6501c385424087",
"score": "0.5716858",
"text": "def get_categories(format)\n rest_url=\"#{@api}/api/#{@header['Fk-Affiliate-Id']}.#{format}\"\n RestClient.get rest_url\n end",
"title": ""
},
{
"docid": "75b0c3968f94ad3a931e4d885f169f68",
"score": "0.5698695",
"text": "def get_category\n category = Category.find(params[:category_id])\n json_response(category)\n end",
"title": ""
},
{
"docid": "f5809d8ac920d4e59e76fb13e3634c57",
"score": "0.5684377",
"text": "def categories\n render json: @user.categories_accessible_by(current_user).to_json\n end",
"title": ""
},
{
"docid": "6d304408a086cca9a05a94665dc840d0",
"score": "0.56633663",
"text": "def respond_with_categories(params)\n channel_id = params[:channel_id]\n unless $redis.exists(\"shush:question:#{channel_id}\")\n\t max_category = 18418\n uri = \"http://jservice.io/api/categories?count=5&offset=#{1+rand(max_category/5)}\"\n request = HTTParty.get(uri)\n puts \"[LOG] #{request.body}\"\n \n category_titles = []\n data = JSON.parse(request.body)\n data.each do |child|\n category_titles << child['title']\n key = \"category:#{child['title']}\"\n $redis.set(key, child.to_json)\n end\n response = \"Wonderful. Let's take a look at the categories. They are: `\"\n response += category_titles.join(\"`, `\") + \"`.\"\n response\n end\nend",
"title": ""
},
{
"docid": "adc9c955a2dfc494475ea7ecd6b0e786",
"score": "0.56431913",
"text": "def get_categories\n {\n method: \"Tracing.getCategories\"\n }\n end",
"title": ""
},
{
"docid": "eda204b96877f330d65ac77b95d0dbff",
"score": "0.5628834",
"text": "def index\n @client_categories = ClientCategory.all\n end",
"title": ""
},
{
"docid": "b36451205a8e6e324333241ddeb7b180",
"score": "0.56213856",
"text": "def getCategory(response)\r\n\t\t\t\tcategory_json = JSON.parse response\r\n\t\t\t\tcategory_array = category_json[\"categories\"]\r\n\t\t\t\treturn jsonToCategory(category_array[0])\r\n\t\t\tend",
"title": ""
},
{
"docid": "e64e9b3d7f896d86bbbefa037c1387ab",
"score": "0.56150943",
"text": "def index\n @clapme_partners = Clapme::Partner.all\n end",
"title": ""
},
{
"docid": "d046e3193b98c5064448ca0cfeb2a967",
"score": "0.56113225",
"text": "def show\n @categorie_comptable = CategorieComptable.find(params[:id])\n @parents = @categorie_comptable.parents\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @categorie_comptable }\n end\n end",
"title": ""
},
{
"docid": "6f5b1199df94a0f382a0f5270eb32454",
"score": "0.5594713",
"text": "def fetch_categories\r\n c_url = BASE_URL + \"categories/list?\" + \"app_key=\" + API_KEY\r\n\r\n uri = URI.parse(c_url)\r\n body = uri.read\r\n resp = Net::HTTP.get_response(uri)\r\n data = JSON.parse(resp.body)\r\n\r\n categories = data[\"category\"]\r\n # binding.pry\r\n categories.each do |c|\r\n Category.new(c[\"name\"])\r\n end\r\n end",
"title": ""
},
{
"docid": "90e89312c55ff211a3d9085016d76d89",
"score": "0.5586049",
"text": "def get_opportunity_categories\n Resources::OpportunityCategory.parse(request(:get, \"OpportunityCategories\"))\n end",
"title": ""
},
{
"docid": "5b59065449840ab8ddbe5bc4b9be53cd",
"score": "0.5576796",
"text": "def index\n respond_with(categories)\n end",
"title": ""
},
{
"docid": "1172838f055f2fbce8b371daa374be9f",
"score": "0.55744773",
"text": "def get_categories(format)\n rest_url=\"#{@api}/api/#{@header['Fk-Affiliate-Id']}.#{format}\"\n RestClient.get rest_url, @header\n end",
"title": ""
},
{
"docid": "c794e2b53005975ecd30bf9e84242e82",
"score": "0.55626965",
"text": "def getAllCategories\n render json: Category.all\n end",
"title": ""
},
{
"docid": "628c3cf2424d363b8902aa77e904fbcb",
"score": "0.55435675",
"text": "def index\n @categories = Category.select('id, name, parent_id, ancestry').page params[:page]\n respond_with @categories\n end",
"title": ""
},
{
"docid": "e6a022c240d2af75cb6732f661c9508a",
"score": "0.55354184",
"text": "def categories\n @categories = response[\"categories\"]\n @categories.map!{|category| Foursquared::Response::Category.new(client, category)} if @categories\n @categories\n end",
"title": ""
},
{
"docid": "8ffdc7d5469902a1c0cbd89a5aec3f99",
"score": "0.5533378",
"text": "def show\n @theme = Theme.find(params[:theme_id])\n @category = @theme.categories.find(params[:id])\n\n respond_with @category\n\n # @categories = Category.all\n\n # respond_with @category\n end",
"title": ""
},
{
"docid": "10236746ce328c38e4657c582d493303",
"score": "0.552054",
"text": "def index\n \n id = SecureRandom.uuid.to_s\n\n category_info = {:id => id, :type => \"index\" }\n\n publish :category, JSON.generate(category_info) \n\n @categories = get_categories(id) \n end",
"title": ""
},
{
"docid": "3b4c7abea42f2e66107f3bd71927cfea",
"score": "0.551663",
"text": "def catalogs_get_categories_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CatalogsApi.catalogs_get_categories ...\"\n end\n # resource path\n local_var_path = \"/api/Categories\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])\n\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<Category1>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CatalogsApi#catalogs_get_categories\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "f5c7d6be0d170294621fcfbf12e1a96a",
"score": "0.5509876",
"text": "def get_categories\n get_sub_categories(nil)\n end",
"title": ""
},
{
"docid": "f5c7d6be0d170294621fcfbf12e1a96a",
"score": "0.5509876",
"text": "def get_categories\n get_sub_categories(nil)\n end",
"title": ""
},
{
"docid": "2e43664306ef798987c9cb4e351e2115",
"score": "0.54986274",
"text": "def show\n render json: @recipe_category\n end",
"title": ""
},
{
"docid": "ecc9d0341fda6493a9d410fc3549910d",
"score": "0.5496944",
"text": "def get_deal_sub_categories\n category_id = params[:category_id].to_i\n @sub_categories = DealCategory.where(:sub_deal_category_id => category_id)\n render_success(template: :get_deal_sub_categories)\n end",
"title": ""
},
{
"docid": "25081f297e54bd1a294191c76b17b162",
"score": "0.54951406",
"text": "def get_charity_categories\n get(\"charity/categories\")\n end",
"title": ""
},
{
"docid": "0659f85e49e3d34916e5b82567dfff2f",
"score": "0.54881483",
"text": "def categories\n object.categories.map do |category|\n CategorySerializer.new(category, restaurant: object)\n end\n end",
"title": ""
},
{
"docid": "f9770c62c483807d7c6df121f16a3005",
"score": "0.54813415",
"text": "def index\n @owner = current_user\n @ticket_categories_all = current_user.ticket_categories.paginate(page: params[:page]).order('name ASC')\n\n respond_to do |format|\n format.html { render @ticket_categories }\n format.json { render json: @ticket_categories }\n end\n end",
"title": ""
},
{
"docid": "fd086d1f03cd988720d2183ef8e4781a",
"score": "0.5471658",
"text": "def get_categories(params)\n check_params params\n\n params = params.load_params\n\n RequestBuilder.new(@user_key, @alternate_url + CATEGORIES_ENDPOINT,\n @http_client, BINDING_VERSION, params, @url_parameters)\n .send_post_request\n end",
"title": ""
},
{
"docid": "faaf91357e4e9633cee0006bbf028f15",
"score": "0.5466457",
"text": "def index\n @account_categories = AccountCategory.all\n\n render json: @account_categories\n end",
"title": ""
},
{
"docid": "49b6267d96c46c301947d3badacc38bd",
"score": "0.5465315",
"text": "def index\n #@categories = @categorizable.categories\n if params[:cat]\n @categories = Category.where(parent_id: Category.find_by_name(params[:cat]))\n else\n @categories = Category.all\n end\n end",
"title": ""
},
{
"docid": "ae14ca7e94e1ca2d08ea8acd3ba3fe2a",
"score": "0.54515636",
"text": "def show\n @categories = Catergory.all; \n # render json: @categories\n render json: {status: 'SUCCESS', message: 'Retrieving All Categories', data: categories}, status: :ok\n end",
"title": ""
},
{
"docid": "8ffdaf30389b251709ba823994d0d59b",
"score": "0.5445711",
"text": "def expense_categories\n @expense_categories ||= request(\"/expense_categories\").expense_categories\n end",
"title": ""
},
{
"docid": "bd4b7be6f251155265926400ed5173b1",
"score": "0.5444926",
"text": "def show\n @community_category = CommunityCategory.find(params[:id])\n\n render json: @community_category, serializer: CommunityCategorySerializer\n end",
"title": ""
},
{
"docid": "a3718e54440ed1e79813e40765bf1371",
"score": "0.54339594",
"text": "def set_partner\n @partner = current_author.partners.friendly.find(params[:id])\n end",
"title": ""
},
{
"docid": "0bbfaa2531ca697ea8570896f7132cd4",
"score": "0.5433873",
"text": "def update\n @category = PartnerCategory.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:partner_category])\n format.html { redirect_to partner_categories_url, notice: 'Partner category was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9813fe31bee5445f60731fd9247468d8",
"score": "0.5432904",
"text": "def category\n key = params['p']\n @categories = Category.search(key)\n end",
"title": ""
},
{
"docid": "002d362b6bad05c8b3d26469616c5981",
"score": "0.5431525",
"text": "def get_opportunity_categories_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: OpportunityCategoriesApi#get_opportunity_categories ...\"\n end\n \n # resource path\n path = \"/OpportunityCategories\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'skip'] = opts[:'skip'] if opts[:'skip']\n query_params[:'top'] = opts[:'top'] if opts[:'top']\n query_params[:'count_total'] = opts[:'count_total'] if opts[:'count_total']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<APICategory>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: OpportunityCategoriesApi#get_opportunity_categories\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "4d1173c57b30860f3416c4602cc9f402",
"score": "0.54311955",
"text": "def create_categories\n categories = PublicApinception::API.all.map { |api| api.category }.uniq\n PublicApinception::Category.new_from_array(categories)\n end",
"title": ""
},
{
"docid": "a179b1bc3cef7a8e96420ce8547e1808",
"score": "0.54268295",
"text": "def get_categories(format = nil)\n ext = format.nil? ? @format : format\n rest_url=\"#{@api}.#{ext}\"\n @categories = RestClient.get rest_url\n end",
"title": ""
},
{
"docid": "6dab006a28508d842fd31300f4d314a3",
"score": "0.54102665",
"text": "def find_by_category\n\t\tcategory = Category.find(params[:category_id])\n\t\tsubcategories = category.subcategories.find_all\n\t\trender json: { subcategories: subcategories }\n\tend",
"title": ""
},
{
"docid": "8178d3f1437c4834762e23dd0c7ff214",
"score": "0.54083914",
"text": "def category\n whitelist_api['category']\n end",
"title": ""
},
{
"docid": "cec184c66fa6b7ea13eea674ed1d46ac",
"score": "0.5407238",
"text": "def show\n categorie = CategorieService.instance.afficherCategorieParId(params[:id])\n (categorie != nil) ? (render json: categorie, status: :ok) : (render json: nil, status: :not_found)\n end",
"title": ""
},
{
"docid": "293560d25dd736d2f814449098a5f7e1",
"score": "0.54059696",
"text": "def new\n @servico = Servico.new\n @categorias = Category.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @servico }\n end\n end",
"title": ""
},
{
"docid": "1595b5d2b6a8b97322ae9fe95291defe",
"score": "0.5396273",
"text": "def fetch_category category_id\n category = \"\"\n data.site.categories.each do |id, c|\n if category_id == c.id\n category = c\n break\n end\n end\n category\n end",
"title": ""
},
{
"docid": "cea652388feafd3dc1f839c6fc771dbd",
"score": "0.53953725",
"text": "def categories options = {}\n perform_get_with_object(\"/videos/#{get_id}/categories\", options, Vimeo::Entities::Category)\n end",
"title": ""
},
{
"docid": "c34c882219b99a3ed7e01f4040510b0d",
"score": "0.53944796",
"text": "def find(params = {})\n client.get(\"v3/ategories/\", params)\n end",
"title": ""
},
{
"docid": "7e6a8fb4dee5938d34ed35955c7c6046",
"score": "0.53920346",
"text": "def set_offering\n @offering = Offering.find(params[:id])\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "8fe3adf6752e98e63481ab609ae3493c",
"score": "0.5377529",
"text": "def find_correlated_categories_and_return\n\t\t\tfetch(@listing_count.correlated_categories_score_only_cache) do\n\t\t\t\tcategories = @listing_count.correlated_categories_score_only\n\t\t\t\tcategories.to_json\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "b988c06a0a78efc2ce0fc235f0d332c1",
"score": "0.5376643",
"text": "def index\n @partner_types = PartnerType.all\n end",
"title": ""
},
{
"docid": "5ff96461e26bed40765c92c388f4e5e8",
"score": "0.53760374",
"text": "def index\n @categoria = @torneo.categoria\n end",
"title": ""
},
{
"docid": "2ed31c73469a4d9d65d15585222c683b",
"score": "0.5370405",
"text": "def categories\n add_category('item')\n @categories\n end",
"title": ""
},
{
"docid": "f1f344ef7316d378cfd8182ef11206ec",
"score": "0.53672695",
"text": "def index\n @categories = @budget.categories\n end",
"title": ""
},
{
"docid": "8fb11c432a8bb2c5fc11d5fb6181b5b5",
"score": "0.5364308",
"text": "def get_categories\n body = build_request(2935, 1501, \"ACTIVEHEADINGS\")\n response = send_to_localeze(body)\n xml_doc = respond_with_hash(Nokogiri::XML(response.to_xml).text)\n end",
"title": ""
},
{
"docid": "4ec1b0e25b2f1274f891707432789ad6",
"score": "0.53640324",
"text": "def index\n @plead_categories = PleadCategory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @plead_categories }\n end\n end",
"title": ""
},
{
"docid": "7cde41072e6226e76e987f4c9200f334",
"score": "0.5362898",
"text": "def show\n @partner = Admin::Partner.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @partner }\n end\n end",
"title": ""
},
{
"docid": "55f597fbcbe6ed9ec408717f7ffc759a",
"score": "0.53614813",
"text": "def index_discipline\n category_name = params[:category].to_sym\n @discipline = Discipline.new\n @disciplines = Discipline.distinct_category(CATEGORY_ID[category_name])\n respond_with @disciplines do |format|\n format.html\n end\n end",
"title": ""
},
{
"docid": "8a8a5e1a02f9398e375508c8cd58996c",
"score": "0.5358338",
"text": "def set_categoria\n @categoria = CategoriaServico.find(params[:id])\n end",
"title": ""
},
{
"docid": "fd9ebcc697fb371b778f6ad375009c71",
"score": "0.5355526",
"text": "def get_all_apps_with_categories \n get(\"/appcon.json/\")\nend",
"title": ""
},
{
"docid": "914e8c1a4d91245632289b9c597eecb6",
"score": "0.53540325",
"text": "def related_categories_from_relatable_category(id, related_attribute, params = {})\n api_call(:get, \"/relatable_categories/#{id}/related_categories\", params.merge!(:related_attribute => related_attribute)) do |response|\n response[\"related_categories\"]\n end\n end",
"title": ""
},
{
"docid": "8ae9313cd0bd91bd6bcd7e22cd3ebdf2",
"score": "0.5353288",
"text": "def show\n @current_category = Category.find(params[:id])\n respond_to do |format|\n format.html { \n @orgs = @current_category.orgs.paginate(:page => params[:page], :per_page => 10, :order => \"recommended DESC\", :include => [:town,:street, :rewiews]) \n }\n format.js {\n @categories = @current_category.children\n render :partial => 'categories', \n :layout => false, \n :locals => {:categories => @categories, :categories_size => Category.count_parent_categories-1, :category_id => params[:id]}\n }\n end\n end",
"title": ""
},
{
"docid": "8189e7ce3b05c3e0934008f94fb77a19",
"score": "0.5348016",
"text": "def index\n @offer_categories = OfferCategory.all\n end",
"title": ""
},
{
"docid": "b7b1e4c10ab8174aa796e52ec580dc1b",
"score": "0.53479505",
"text": "def index\r\n get_item_categories \r\n end",
"title": ""
},
{
"docid": "0b935f123a7c53e2fad953ddba963777",
"score": "0.5347699",
"text": "def subcatalogs\n @catalogs = Catalog.where parent: params[:id]\n respond_to do |format|\n format.json\n end\n end",
"title": ""
},
{
"docid": "160d5097532fdcf8cad67dd3b224ba08",
"score": "0.5346419",
"text": "def categories\n response = HTTParty.get('https://www.boardgameatlas.com/api/game/categories?&client_id=' + ENV['CLIENT_ID'])\n @categories = response[\"categories\"]\n end",
"title": ""
},
{
"docid": "e37877bf799cab91ef161e85188d3211",
"score": "0.5346256",
"text": "def index\n @categories = current_account.categories\n if params[:parent_id].present?\n @parents = current_account.categories.find(params[:parent_id]).self_and_ancestors\n @categories = @categories.where(parent_id: params[:parent_id])\n elsif params[:parent_level].present?\n @categories = current_account.categories.where(depth: params[:parent_level].to_i)\n else\n @categories = @categories.roots\n end\n @categories = @categories.page(params[:page])\n end",
"title": ""
},
{
"docid": "0ee03ccff272bf238cbc46db3d4910f4",
"score": "0.53419626",
"text": "def children_categories\r\n @children_categories ||= begin\r\n # Fetch facets (categories).\r\n ids = endeca_response.refinements[0].dimensions[0].dimension_values.\r\n # Filter by those with at least 5 products (matching requirements).\r\n select { |v|\r\n v.properties[\"DGraph.AggrBins\"].to_i >= 5\r\n # Return +dim_value_id+.\r\n }.map { |v| v.dim_value_id }\r\n\r\n cats = Category.find_all_by_dim_value_id(ids, :order => :name)\r\n cats.select { |c| c.partner_categories.detect { |pc| pc.source.id == source.id } }\r\n rescue\r\n []\r\n end\r\n end",
"title": ""
},
{
"docid": "30134bffab480ea0bdb36129fb1e0fcf",
"score": "0.5339754",
"text": "def get_restaurant_bycategory \n @restaurant = Restaurant.restaurant_catgory(params[:id] ,params[:latitude], params[:longitude],params[:page])\n render json: ArrayPresenter.new(@restaurant , RestaurantPresenter)\n #render json: @restaurant\n end",
"title": ""
},
{
"docid": "faea312189d82d839cf352d2a0dee1d3",
"score": "0.5335535",
"text": "def index\n @product_categories = ProductCategory.all\n\n render json: @product_categories\n end",
"title": ""
},
{
"docid": "42a5e38641191448d85e311ae1318ff4",
"score": "0.5333414",
"text": "def index\n @resource_categories = ResourceCategory.where(company_id: current_user.company_id).accessible_by(current_ability).order(:name)\n render :json => @resource_categories\n end",
"title": ""
},
{
"docid": "4258a31107d40b02ec6757e79fe095bf",
"score": "0.5332015",
"text": "def v1_categories_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CategoriesApi.v1_categories_get ...\"\n end\n # resource path\n local_var_path = \"/v1/categories\"\n\n # query parameters\n query_params = {}\n query_params[:'field'] = @api_client.build_collection_param(opts[:'field'], :multi) if !opts[:'field'].nil?\n query_params[:'filter'] = @api_client.build_collection_param(opts[:'filter'], :multi) if !opts[:'filter'].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<Category>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CategoriesApi#v1_categories_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "e2cdca9d71729c1f4b5589df7b664925",
"score": "0.5327652",
"text": "def index\n @categories = Category.order('lft ASC').where('published_job_offers_count > ?', 0)\n @max_depth_limit = 1\n @categories_for_select = @categories.select { |x| x.depth <= @max_depth_limit }\n @contract_types = ContractType.all\n\n respond_to do |format|\n format.html {}\n format.js {}\n end\n end",
"title": ""
},
{
"docid": "d6a8ba67c4bb02fcab072adfab2460c7",
"score": "0.5327168",
"text": "def categories\n begin\n print_verbose \"Retrieving module categories\"\n response = RestClient.get \"#{@url}categories\", {:params => {:token => @token}}\n categories = JSON.parse(response.body)\n print_good \"Retrieved #{categories.size} module categories\"\n categories\n rescue => e\n print_error \"Could not retrieve logs: #{e.message}\"\n end\nend",
"title": ""
},
{
"docid": "3b1c70c93417ec108bbabb77880a39ff",
"score": "0.5327038",
"text": "def show\n id = params[:id]\n resp = {}\n categorie = Category.find(id)\n resp[\"name\"] = categorie.name\n resp[\"users\"] = Service.where('category_id = ?', categorie.id)\n resp[\"url_image\"] = categorie.url_image\n resp[\"id\"] = categorie.id\n render json: resp, status: 200 \n end",
"title": ""
},
{
"docid": "5df798c5008282baa090f2e3ac02fbc1",
"score": "0.53255457",
"text": "def index\n @servcategories = Servcategory.all\n end",
"title": ""
},
{
"docid": "6d6cce29fae6cf7022ecb7a2207ad77a",
"score": "0.532087",
"text": "def get_categories\r\n # the base uri for api requests\r\n query_builder = Configuration::BASE_URI.dup % [@version]\r\n\r\n # prepare query string for API call\r\n query_builder << \"/categories\"\r\n\r\n # validate and preprocess url\r\n query_url = APIHelper.clean_url query_builder\r\n\r\n # prepare headers\r\n headers = {\r\n \"user-agent\" => \"APIMATIC 2.0\",\r\n \"accept\" => \"application/json\",\r\n \"X-Api-Key\" => @x_api_key\r\n }\r\n\r\n # invoke the API call request to fetch the response\r\n response = Unirest.get query_url, headers:headers\r\n\r\n #Error handling using HTTP status codes\r\n if !(response.code.between?(200,206)) # [200,206] = HTTP OK\r\n raise APIException.new \"HTTP Response Not OK\", response.code, response.raw_body\r\n end\r\n\r\n response.body\r\n end",
"title": ""
},
{
"docid": "6588d311772051a8a7eed1b9cf6bcd71",
"score": "0.5319534",
"text": "def new\n @category = Category.new\n @categories = current_user.get_or_create_root_cat.descendants.arrange(:order => :created_at)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @category }\n end\n end",
"title": ""
},
{
"docid": "ae939484b2c3a1f4b3216a4613476d97",
"score": "0.5317153",
"text": "def index\n categories = Category.all\n render json:categories\n end",
"title": ""
},
{
"docid": "54abba7794081a9a1e9e7f789c334de3",
"score": "0.53167754",
"text": "def category(id)\n if id.is_a? Array\n categories(id)\n else\n make_request('/categories/get', {:id => id})\n end\n end",
"title": ""
}
] |
2df71d10a7fc4e41f117e8f4070f06cf
|
[GET] /model_pluralized/find_by method to call find by attributes
|
[
{
"docid": "38e93d4eff1e4829815641e66ed3401e",
"score": "0.5973202",
"text": "def find_by(attributes = {}, options = {}, header = {})\n search = { search: attributes }.merge!(options)\n request = requester.new(:get, \"#{to_url}/find_by\", {}, search, header)\n request.resource.map do |element|\n build(element)\n end\n end",
"title": ""
}
] |
[
{
"docid": "8ba4cb8c63d5ef612994a44c487f962c",
"score": "0.6633073",
"text": "def find_by()\n\n end",
"title": ""
},
{
"docid": "6bc547761456cb7be8367d25dac9031b",
"score": "0.650193",
"text": "def find_model(attributes)\n model.find(:first, :conditions => { key => attributes[key] })\n end",
"title": ""
},
{
"docid": "4b7dab6f52db610eefc5987f6a07da00",
"score": "0.64677596",
"text": "def find_by_name\n not_found and return if params[:id].blank?\n\n name = controller_name.singularize\n cond = \"find\" + (params[:id] =~ /\\A\\d+(-.+)?\\Z/ ? \"\" : \"_by_name\")\n not_found and return unless instance_variable_set(\"@#{name}\", resource_base.send(cond, params[:id]))\n end",
"title": ""
},
{
"docid": "b952092cc3ca76a36fd13aada711162c",
"score": "0.63538325",
"text": "def find_obj\n @obj = eval(resource_name).find_by(id: params[:id])\n end",
"title": ""
},
{
"docid": "8107dd7ac5aa3a643c565080c5799385",
"score": "0.6347472",
"text": "def find( model, name )\n model( model )[name ] rescue nil\n end",
"title": ""
},
{
"docid": "c485964139624670ff169791007cfcf6",
"score": "0.6261259",
"text": "def find_likable\n params.each do |name, value|\n if name =~ /(.+)_id$/\n return $1.classify.constantize.find(value)\n end\n end\n end",
"title": ""
},
{
"docid": "29c4265deb61b9e18df13ae8234fc05c",
"score": "0.62362623",
"text": "def method_missing(method, *args)\n if method =~ /find/\n finder = method.to_s.split('_by_').first\n attributes = method.to_s.split('_by_').last.split('_and_')\n\n chain = Dynamoid::Criteria::Chain.new(self)\n chain.query = Hash.new.tap {|h| attributes.each_with_index {|attr, index| h[attr.to_sym] = args[index]}}\n \n if finder =~ /all/\n return chain.all\n else\n return chain.first\n end\n else\n super\n end\n end",
"title": ""
},
{
"docid": "c9b68fdab6b266f6ccaf9bff2d0f1374",
"score": "0.6210345",
"text": "def find_by_name(params, header = {})\n request = requester.new(:get, \"#{to_url}/find_by_name\", {}, params, header)\n request.resource.map do |model|\n build(model)\n end\n end",
"title": ""
},
{
"docid": "ca977977a8f0181fb661db387a3aa4b6",
"score": "0.61995924",
"text": "def fetch_record_by_param\n model.find(params[:id])\n end",
"title": ""
},
{
"docid": "b26589c125043f4a62887d92ea77a46a",
"score": "0.6179289",
"text": "def method_missing(m,*args)\n #find_by_name(\"John\") returns first YamlContentBase object that matches\n if m.to_s.index(\"find_by\") == 0\n attribute = m.to_s.gsub(\"find_by_\",\"\")\n return self.detect{|x| x.send(attribute) == args[0]}\n #find_all_by_name(\"John\") returns array of YamlContentBase objects that match\n elsif m.to_s.index(\"find_all_by\") == 0\n attribute = m.to_s.gsub(\"find_all_by_\",\"\")\n return self.select{|x| x.send(attribute) == args[0]}\n end\n raise \"'#{m}' is not a method\"\n end",
"title": ""
},
{
"docid": "1f12c09d66342c18d7e3cc526cdf0796",
"score": "0.6164056",
"text": "def find_by(**args)\n where(**args).first\n end",
"title": ""
},
{
"docid": "5add43cf49a1246a6cabb145acbf92b4",
"score": "0.6135707",
"text": "def find_for_show(find_by_conditions:)\n search.find_by(find_by_conditions)\n end",
"title": ""
},
{
"docid": "73eef3f612417445c09820e6d1846c23",
"score": "0.6132838",
"text": "def find_by_name(id)\n end",
"title": ""
},
{
"docid": "09351a00a580c6bb532256982d871b3b",
"score": "0.61093295",
"text": "def method_for_find\n :find_by_slug!\n end",
"title": ""
},
{
"docid": "81717627404af7a85c9357053edadeda",
"score": "0.6078289",
"text": "def find_by!(params = {})\n find_by(params) || begin\n message = params.map do |key, value|\n \"#{key}=#{value}\"\n end\n raise RecordNotFound, message.to_sentence\n end\n end",
"title": ""
},
{
"docid": "ee68171f07403e9a7c06c68aa24876a9",
"score": "0.60174304",
"text": "def method_missing msg, *args, &block\n model = begin;\n Object.const_get msg\n rescue NameError\n end\n \n if model and model.respond_to?(:descends_from_active_record?) and model.descends_from_active_record?\n model.find args.first\n else\n super\n end\nend",
"title": ""
},
{
"docid": "1df07f4f94518fa715225fb8e931cc4a",
"score": "0.59980404",
"text": "def method_missing(method_name, *args)\n\n method = method_name.to_s\n\n if method.end_with? '!'\n method.chop!\n error_on_empty = true\n end\n\n if method.start_with? 'find_all_by_'\n attribs = method.gsub /^find_all_by_/, ''\n elsif method.start_with? 'find_by_'\n attribs = method.gsub /^find_by_/, ''\n limit(1)\n elsif method.start_with? 'find_first_by_'\n limit(1)\n find_first = true\n attribs = method.gsub /^find_first_by_/, ''\n elsif method.start_with? 'find_last_by_'\n limit(1)\n find_last = true\n attribs = method.gsub /^find_last_by_/, ''\n else\n super\n end\n\n attribs = attribs.split '_and_'\n conditions = {}\n attribs.each { |attr| conditions[attr] = args.shift }\n\n where(conditions, *args)\n load\n raise RecordNotFound if error_on_empty && @records.empty?\n return @records.first if limit_value == 1\n @records\n end",
"title": ""
},
{
"docid": "6356236e3620280ec710a824ab967374",
"score": "0.5971497",
"text": "def find_by_param(value,args={})\n if permalink_options[:prepend_id]\n param = \"id\"\n value = value.to_i\n else\n param = permalink_options[:param]\n end\n self.send(\"find_by_#{param}\".to_sym, value, args)\n end",
"title": ""
},
{
"docid": "9ad9e6e6071b64d9aa963bec18c562c2",
"score": "0.5954057",
"text": "def fetch_model\n model_name.camelize.constantize.find( params[:id] )\n end",
"title": ""
},
{
"docid": "39c6c8a2f1d1c1343971c244abf9902e",
"score": "0.5952165",
"text": "def find_opinionable\n params.each do |name, value|\n if name =~ /(.+)_id$/\n return $1.classify.constantize.find(value)\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "39cd52b8acc51de1b331e64ea911c4d7",
"score": "0.59365207",
"text": "def semantic_find_all\n attributes = self.class.semantic_resource.columns.collect{|c| c.name.to_sym }\n conditions = { }\n params.keys.each{|p| conditions[p] = params[p] if attributes.include?(p.to_sym) }\n self.class.semantic_resource.find(:all, :conditions => conditions)\n end",
"title": ""
},
{
"docid": "a4dbc17f28644d7b01ce9629b108d477",
"score": "0.5934091",
"text": "def generate_find_statement\n first_resource = resources.first\n statement = \"#{first_resource.classify}.find(params[:#{first_resource}_id])\"\n \n statement = resources[1..-1].inject(statement){|s, resource| s += \".#{resource.pluralize}.find(params[:#{resource}_id])\"}\n end",
"title": ""
},
{
"docid": "cb4e3e249d9ec265228dcd8c367b29a1",
"score": "0.59300214",
"text": "def find id\n model.find id\n end",
"title": ""
},
{
"docid": "642dfcb4349823ecb0c96ca6f20a0334",
"score": "0.59241384",
"text": "def find_by_friendly_id(id); end",
"title": ""
},
{
"docid": "6fdcd3baa33459c2043bffa748fa804c",
"score": "0.59155434",
"text": "def find_by(field, value)\n @base.send('find_by_' + field, value)\n end",
"title": ""
},
{
"docid": "3404f1795a0893947e532fd00f6a9657",
"score": "0.58903223",
"text": "def find_resource resource, conditions\n klass, instance = parse_resource_args resource\n conditions = conditions.to_hash_from_story unless (conditions.is_a? Hash)\n klass.find(:first, :conditions => conditions)\nend",
"title": ""
},
{
"docid": "cd6823ff508a699706417ada56c0f5a6",
"score": "0.58757746",
"text": "def find_votable\n params.each do |name, value|\n if name =~ /(.+)_id$/\n return $1.classify.constantize.find(value)\n end\n end \n return nil\n end",
"title": ""
},
{
"docid": "7d0caaefe117a0acd668050489313efd",
"score": "0.5858122",
"text": "def find_documentable\n params.each do |name, value|\n if name =~ /(.+)_id$/\n klass = $1.classify.constantize\n return klass.find(value)\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "6b91c945d357dc3cace352a7ddd899f2",
"score": "0.58261687",
"text": "def find(*criteria)\n criteria.flatten! if criteria.first.is_a?(Array)\n p criteria if Caesars.debug?\n # BUG: Attributes can be stored as strings and here we only look for symbols\n str = criteria.collect { |v| \"[:'#{v}']\" if v }.join\n eval_str = \"@caesars_properties#{str} if defined?(@caesars_properties#{str})\"\n val = eval eval_str\n val\n end",
"title": ""
},
{
"docid": "066eeb9574ae0402351ef5d7ee8fa5c6",
"score": "0.58158964",
"text": "def method_missing(method_id, *args)\n options = args.last.is_a?(Hash) ? args.pop : {}\n \n method_id.to_s.match(/^find_all_by_([_a-zA-Z]\\w*)$/)\n attributes = {}\n\n $1.split('_and_').each do |key|\n attributes.merge!({key.intern => args.shift})\n end\n \n find(:all, attributes.merge(options))\n end",
"title": ""
},
{
"docid": "ef8d32b815d9b75aaa681a97894718ed",
"score": "0.57910883",
"text": "def find( id )\n model.get( id ).extend( InstanceMethods )\n end",
"title": ""
},
{
"docid": "cc1364082ab4158127a42af262367541",
"score": "0.5785423",
"text": "def specific_show(model, id)\n model.find(id)\n end",
"title": ""
},
{
"docid": "e5554f87035ccd032581380d1898f201",
"score": "0.5775931",
"text": "def find\n\t\trender json: Subject.where(\"name LIKE ?\",\"%#{params[:term].titlecase}%\")\n\tend",
"title": ""
},
{
"docid": "8b2839c460a1072c9ca2d77cc4372983",
"score": "0.5773258",
"text": "def find opt = nil, opts = { }\n opt ||= :all\n \n opts[:limit] = 1 if opt == :first\n\n # self.sql sets self.model_class.\n this_sql = self.sql(opts)\n result = model_class.find_by_sql(this_sql)\n\n result = result.first if opt == :first\n\n result\n end",
"title": ""
},
{
"docid": "ff9ea5765451fe5c64260579b843c6f7",
"score": "0.5769635",
"text": "def find(id); end",
"title": ""
},
{
"docid": "ff9ea5765451fe5c64260579b843c6f7",
"score": "0.5769635",
"text": "def find(id); end",
"title": ""
},
{
"docid": "b2b0435422ab80f80482b571f0148d4e",
"score": "0.5715004",
"text": "def find_relationship_by(attribute, value); end",
"title": ""
},
{
"docid": "572252bdc10f7e3b3953b049bb641b71",
"score": "0.57125056",
"text": "def find_patient_by_name(patient_name)\n Patient.find_by(name: patient_name)\nend",
"title": ""
},
{
"docid": "ede9f54b55e6ec57acedb504a90021f0",
"score": "0.571074",
"text": "def find(query); end",
"title": ""
},
{
"docid": "ede9f54b55e6ec57acedb504a90021f0",
"score": "0.571074",
"text": "def find(query); end",
"title": ""
},
{
"docid": "4e2012fde1c47497099cac1950ae60e2",
"score": "0.5708935",
"text": "def lookup_general(model, accepted = false)\n matches = []\n suggestions = []\n type = model.type_tag\n id = params[:id].to_s.gsub(/[+_]/, \" \").strip_squeeze\n begin\n if id.match(/^\\d+$/)\n obj = find_or_goto_index(model, id)\n return unless obj\n matches = [obj]\n else\n case model.to_s\n when \"Name\"\n if (parse = Name.parse_name(id))\n matches = Name.find_all_by_search_name(parse.search_name)\n if matches.empty?\n matches = Name.find_all_by_text_name(parse.text_name)\n end\n matches = fix_name_matches(matches, accepted)\n end\n if matches.empty?\n suggestions = Name.suggest_alternate_spellings(id)\n suggestions = fix_name_matches(suggestions, accepted)\n end\n when \"Location\"\n pattern = \"%#{id}%\"\n conditions = [\"name LIKE ? OR scientific_name LIKE ?\",\n pattern, pattern]\n matches = Location.find(:all,\n limit: 100,\n conditions: conditions)\n when \"Project\"\n pattern = \"%#{id}%\"\n matches = Project.find(:all,\n limit: 100,\n conditions: [\"title LIKE ?\", pattern])\n when \"SpeciesList\"\n pattern = \"%#{id}%\"\n matches = SpeciesList.find(:all,\n limit: 100,\n conditions: [\"title LIKE ?\", pattern])\n when \"User\"\n matches = User.find_all_by_login(id)\n matches = User.find_all_by_name(id) if matches.empty?\n end\n end\n rescue => e\n flash_error(e.to_s) unless Rails.env == \"production\"\n end\n\n if matches.empty? && suggestions.empty?\n flash_error(:runtime_object_no_match.t(match: id, type: type))\n action = model == User ? :index_rss_log : model.index_action\n redirect_to(controller: model.show_controller,\n action: action)\n elsif matches.length == 1 || suggestions.length == 1\n obj = matches.first || suggestions.first\n if suggestions.any?\n flash_warning(:runtime_suggest_one_alternate.t(match: id, type: type))\n end\n redirect_to(controller: obj.show_controller,\n action: obj.show_action,\n id: obj.id)\n else\n obj = matches.first || suggestions.first\n query = Query.lookup(model, :in_set, ids: matches + suggestions)\n if suggestions.any?\n flash_warning(:runtime_suggest_multiple_alternates.t(match: id,\n type: type))\n else\n flash_warning(:runtime_object_multiple_matches.t(match: id,\n type: type))\n end\n redirect_to(add_query_param({ controller: obj.show_controller,\n action: obj.index_action },\n query))\n end\n end",
"title": ""
},
{
"docid": "8390e57e3b75871c867859341b825be8",
"score": "0.57078594",
"text": "def search_in_table(name)\n if @klass.seo_use_id\n @klass.find_by(:id => name)\n else\n @klass.find_by(:seo_url => name)\n end\n end",
"title": ""
},
{
"docid": "65ca3e864411273782c5bf1c42ccf1e3",
"score": "0.5701638",
"text": "def find(id)\n\nend",
"title": ""
},
{
"docid": "86019c3d93e69c6816d05e6230817693",
"score": "0.57015944",
"text": "def find_by_name(name)\n end",
"title": ""
},
{
"docid": "9a1902ee2932639b1be0134523bb92be",
"score": "0.56980234",
"text": "def from_param(*options)\n if param_column?\n send \"find_by_#{param_column}\", *options\n else\n find(*options) \n end\n end",
"title": ""
},
{
"docid": "55af28bad6be613eb6fb775cb54be431",
"score": "0.5696341",
"text": "def find_resource(options = {})\n resource_name = controller_name.singularize\n resource = controller_name.classify.constantize\n finder_column = options[:finder] || :id\n finder_value = options[:value] || params[:id]\n resources = resource.where(finder_column => finder_value)\n if resources.length == 0\n raise RecordNotFound\n else\n instance_variable_set \"@#{resource_name}\", resources.first\n end\n end",
"title": ""
},
{
"docid": "101bada1042769d45f2c779d31f36871",
"score": "0.5690103",
"text": "def find(*args)\n find_all(*args).first\n end",
"title": ""
},
{
"docid": "457b879edb5884880f73d58f2a04b12f",
"score": "0.5671461",
"text": "def find_record\n self.class.model_klass.find(params[:id])\n end",
"title": ""
},
{
"docid": "62765df7514a3523934d0645589ce387",
"score": "0.5666571",
"text": "def find method=:all, options={}\r\n if method.is_a? Hash\r\n options = method\r\n method= :all\r\n end\r\n if @scope\r\n model_class.send(:with_scope, @scope) {model_class.find method, find_options(options)}\r\n else\r\n model_class.find method, find_options(options)\r\n end\r\n end",
"title": ""
},
{
"docid": "432241a9670a897e22d341fe25945f5c",
"score": "0.564851",
"text": "def method_missing(method_id, *arguments)\n if match = /find_(all_by|by)_([_a-zA-Z]\\w*)/.match(method_id.to_s)\n finder = determine_finder(match)\n\n facets = extract_attribute_names_from_match(match)\n super unless all_attributes_exists?(facets)\n\n #Overrride facets to use appropriate attribute name for current locale\n facets.collect! {|attr_name| respond_to?(:globalize_facets) && globalize_facets.include?(attr_name.intern) ? localized_facet(attr_name) : attr_name}\n\n attributes = construct_attributes_from_arguments(facets, arguments)\n\n case extra_options = arguments[facets.size]\n when nil\n options = { :conditions => attributes }\n set_readonly_option!(options)\n ActiveSupport::Deprecation.silence { send(finder, options) }\n\n when Hash\n finder_options = extra_options.merge(:conditions => attributes)\n validate_find_options(finder_options)\n set_readonly_option!(finder_options)\n\n if extra_options[:conditions]\n with_scope(:find => { :conditions => extra_options[:conditions] }) do\n ActiveSupport::Deprecation.silence { send(finder, finder_options) }\n end\n else\n ActiveSupport::Deprecation.silence { send(finder, finder_options) }\n end\n\n else\n raise ArgumentError, \"Unrecognized arguments for #{method_id}: #{extra_options.inspect}\"\n end\n elsif match = /find_or_(initialize|create)_by_([_a-zA-Z]\\w*)/.match(method_id.to_s)\n instantiator = determine_instantiator(match)\n facets = extract_attribute_names_from_match(match)\n super unless all_attributes_exists?(facets)\n\n if arguments[0].is_a?(Hash)\n attributes = arguments[0].with_indifferent_access\n find_attributes = attributes.slice(*facets)\n else\n find_attributes = attributes = construct_attributes_from_arguments(facets, arguments)\n end\n options = { :conditions => find_attributes }\n set_readonly_option!(options)\n\n find_initial(options) || send(instantiator, attributes)\n else\n super\n end\n end",
"title": ""
},
{
"docid": "6cd1358cdda3cb4b33da4022534d9fa2",
"score": "0.56414026",
"text": "def find_model(name)\n @models[name.to_s.downcase.to_sym]\n end",
"title": ""
},
{
"docid": "772731a248456a900a342ae20d9d3319",
"score": "0.5640625",
"text": "def find_by_name name\n name = CGI.escape name.downcase.gsub(/\\s/, '')\n DynamicModel.new perform_request api_url \"summoners/by-name/#{name}\"\n end",
"title": ""
},
{
"docid": "772731a248456a900a342ae20d9d3319",
"score": "0.5640625",
"text": "def find_by_name name\n name = CGI.escape name.downcase.gsub(/\\s/, '')\n DynamicModel.new perform_request api_url \"summoners/by-name/#{name}\"\n end",
"title": ""
},
{
"docid": "eb96e55ff0299ba7b470eaa9310843a0",
"score": "0.5628653",
"text": "def where(*args)\n #self.class.new(layout, layout.find(*args), args)\n get_results(:find, args)\n end",
"title": ""
},
{
"docid": "63268346b4afe49786a9e279ae391696",
"score": "0.5618303",
"text": "def find_by_id(id)\n find_by(:id, id)\n end",
"title": ""
},
{
"docid": "0b4287c322dae333a4087d23190a07e3",
"score": "0.56115085",
"text": "def friendly_find(slugged_id)\n model.friendly.find(slugged_id)\n end",
"title": ""
},
{
"docid": "0914c0a5238d0f3495b0e4b1660aab42",
"score": "0.5601977",
"text": "def find(any_verb_form)\n end",
"title": ""
},
{
"docid": "f447b887b35e10e19b8fe18b6a7a9097",
"score": "0.5595798",
"text": "def find!(ctx, params:, **)\n ctx[:model] = ::Contact.find_by(uuid: params[:id])\n end",
"title": ""
},
{
"docid": "2af87a629b0a8a28c6a5f5c8af225f42",
"score": "0.55951774",
"text": "def find_by_param!(value, args={})\n param = permalink_options[:param]\n obj = find_by_param(value, args)\n raise ::ActiveRecord::RecordNotFound unless obj\n obj\n end",
"title": ""
},
{
"docid": "f968db925a51349954bb2cdf441d0daf",
"score": "0.5584258",
"text": "def find(options = {})\n if(options.class == Integer)\n model = self.new(quickbook_gateway.get(\"#{entity.downcase}/#{options}\")[entity]) \n model.is_new_record = false\n return model\n end\n \n return self.find_all(options, 1)[0]\n end",
"title": ""
},
{
"docid": "31d0b69d5b66637c9222dc7a0e30af5e",
"score": "0.55708855",
"text": "def find_resource(param)\n Chapter.find_by!(slug: param)\n end",
"title": ""
},
{
"docid": "96991b4f4a0b39b77509a346e9390151",
"score": "0.5566661",
"text": "def find_for_koala(identifier)\n self.first(:conditions => { koala_identifier_field => identifier })\n end",
"title": ""
},
{
"docid": "e3baf77cec0300fe4a148cb63a1fd286",
"score": "0.5560371",
"text": "def search_in_table!(name)\n if @klass.seo_use_id\n @klass.find(name)\n else\n @klass.find_by!(:seo_url => name)\n end\n end",
"title": ""
},
{
"docid": "0caeb2c8e3a6996808ecd35b69577567",
"score": "0.5549402",
"text": "def method_missing(method, *args, &block)\n assumed_class = method.to_s.singularize.titleize.constantize\n assumed_class.where(:resource_id => id).where(lang: [I18n.locale.to_s, '*']).first\n rescue Exception => msg\n super\n end",
"title": ""
},
{
"docid": "1e0b6a4cd1d69af5b5a9bf0ce0ff668f",
"score": "0.55456567",
"text": "def find(criteria)\n validator = Vagalume::Validator.new\n criteria = validator.confirm(criteria)\n request_url = BASE_URL + to_query(criteria)\n result = MultiJson.decode(open(request_url).read)\n search_result = Vagalume::SearchResult.new(result)\n end",
"title": ""
},
{
"docid": "033de0850670bff275abd0c872817109",
"score": "0.5544259",
"text": "def find_resource(param)\n Feature.friendly.find(param)\n end",
"title": ""
},
{
"docid": "68eba73af33234512c21cce4ca4af022",
"score": "0.5543219",
"text": "def dyse(name, model, attribute, options = {})\n attributes = [attribute]\n\n query = []\n parameters = ''\n if options[:conditions].is_a? Hash\n options[:conditions].each do |key, value| \n query << model.to_s.pluralize+\".\"+key.to_s+'=?'\n parameters += ', ' + sanitize_conditions(value)\n end\n end\n code = \"\"\n code += \"def dyse_\"+name.to_s+\"\\n\"\n code += \" conditions = [#{query.join(' AND ').inspect+parameters}]\\n\"\n # code += \" raise Exception.new(params)\\n\"\n code += \" search = params[:#{name}][:search]\\n\"\n code += \" words = search.lower.split(/\\\\s+/)\\n\"\n code += \" if words.size>0\\n\"\n code += \" conditions[0] += ' AND ('\\n\"\n code += \" words.size.times do |index|\\n\"\n code += \" word = #{(options[:filter]||'%X%').inspect}.gsub('X', words[index])\\n\"\n code += \" conditions[0] += ' OR ' if index>0\\n\"\n code += \" conditions[0] += \"+attributes.collect{|key| \"LOWER(CAST(#{model.to_s.pluralize}.#{key} AS VARCHAR)) LIKE ?\"}.join(' OR ').inspect+\"\\n\"\n code += \" conditions += [\"+([\"word\"]*attributes.size).join(\", \")+\"]\\n\"\n code += \" end\\n\"\n code += \" conditions[0] += ')'\\n\"\n code += \" end\\n\"\n order = \", :order=>\"+attributes.collect{|key| \"#{model.to_s.pluralize}.#{key} ASC\"}.join(', ').inspect\n limit = options[:limit] ? \", :limit=>\"+options[:limit].to_s : \"\"\n partial = options[:partial]\n code += \" list = ''\\n\"\n code += \" for item in \"+model.to_s.camelcase+\".find(:all, :conditions=>conditions\"+order+limit+\")\\n\"\n code += \" content = \"+attributes.collect{|attribute| \"item.#{attribute}.to_s\"}.join('+\", \"+')+\"\\n\"\n if partial\n display = \"render(:partial=>#{partial.inspect}, :locals =>{:record=>#{model.inspect}, :content=>content, :search=>search})\"\n else\n display = \"highlight(content, search)\"\n end\n code += \" list += '<li id=\\\"#{model}_\\#\\{item.id\\}\\\">'+#{display}+'<input type=\\\"hidden\\\" value=\\#\\{content.inspect\\} id=\\\"record_\\#\\{item.id\\}\\\"/></li>'\\n\"\n code += \" end\\n\"\n code += \" render :text=>'<ul>'+list+'</ul>'\\n\"\n code += \"end\\n\"\n puts code\n\n module_eval(code)\n end",
"title": ""
},
{
"docid": "9ed78e33109ec9a995ecd8a48dcc26bb",
"score": "0.55315685",
"text": "def find_by_param(param)\n with_param(param).first\n end",
"title": ""
},
{
"docid": "06026ba922c9bf45a50798906d0074f2",
"score": "0.55269307",
"text": "def find_record\n self.class.resource_model.find(params[:id])\n end",
"title": ""
},
{
"docid": "fe632c30ae485b1c3e045f366bac69dc",
"score": "0.55226785",
"text": "def find_by(attributes)\n id_match = attributes[:id_match]\n championship = attributes[:championship]\n serie = attributes[:serie]\n\n if @config.championship_associate?\n find_match_associated(id_match, championship)\n else\n find_match(id_match, championship, serie)\n end\n end",
"title": ""
},
{
"docid": "4a13aad010d7fd5154e82009748c1bf7",
"score": "0.55160177",
"text": "def model_param\n # model_class is defined by derived controllers for the individual search\n # types we support\n model_class.to_s.demodulize.underscore\n end",
"title": ""
},
{
"docid": "1b4e49e405e22e4d427d0cc052e0a5e5",
"score": "0.54917985",
"text": "def find options={}, match_id:\n DynamicModel.new perform_request api_url \"matches/#{match_id}\", options\n end",
"title": ""
},
{
"docid": "360a82ea644dda5c334793a83b1e884a",
"score": "0.5478178",
"text": "def find\n model_class.filterrific_find(self)\n end",
"title": ""
},
{
"docid": "b9a501ef73ec517e7632848f8b451a74",
"score": "0.5474326",
"text": "def for(name, obj = nil)\n on(obj).where(:name => name.to_s.downcase)\n end",
"title": ""
},
{
"docid": "5a50129c940efa231d718ad77f4c666a",
"score": "0.5461944",
"text": "def find_by(*conditions)\n where(*conditions).take\n end",
"title": ""
},
{
"docid": "0a96b1759cceb7cac846b7f06d876337",
"score": "0.54404724",
"text": "def find(type, conditions = {})\n raise \"Type #{type} is invalid\" unless types.include?(type.to_sym)\n\n uri = \"#{API_URL}/#{resource}/#{type}\"\n uri += '/search' if includes_search_param?(conditions)\n\n request(uri, conditions)\n end",
"title": ""
},
{
"docid": "44b0b112033cab97a056ef749b868eb8",
"score": "0.54364026",
"text": "def search(name)\n ModelMethod.supported_types_enum.each do |type|\n model_method = find_by_name_and_type(name, type)\n return model_method if model_method\n end\n\n nil\n end",
"title": ""
},
{
"docid": "c07647f7b6df32e033df3870b5b82c48",
"score": "0.5433567",
"text": "def find_by_id(class_name)\n class_name.find_by(id: params[:id])\n end",
"title": ""
},
{
"docid": "3772bdd6563c7df55799f4f6f36598cc",
"score": "0.542681",
"text": "def find_resource\n set_resource_ivar class_name.find(params[:id])\n end",
"title": ""
},
{
"docid": "8422b01c19634bdf6932faefcf28e8d0",
"score": "0.54241514",
"text": "def find(model)\n\n # Find out how many are in each bucket\n # FIXME: This may be databse specific. Works on MySQL and SQLite\n # FIXME: field should be sanatized. Possible SQL Injection attack\n @counts = model.count :all,\n :group => \"SUBSTR(LOWER(#{field.to_s}), 1, 1)\"\n @counts = @counts.inject(HashWithIndifferentAccess.new()) do |m,grp|\n grp[0] = grp[0].blank? ? 'Blank' : grp[0]\n m[grp[0]] = m[grp[0].upcase] = grp[1]\n m\n end\n @counts['All'] = total if @options[:all]\n\n # Reset to default group if group has not records\n self.group = nil unless @counts.has_key? group\n\n # Find the first group that has records\n all_groups = ('A'..'Z').to_a + ['Blank']\n all_groups << 'All' if @options[:all]\n self.group = all_groups.detect(proc {'A'}) do |ltr|\n @counts.has_key? ltr\n end if group.blank?\n\n unless (min_records && total >= min_records) || group == 'All'\n # Determine conditions. '' or NULL shows up under \"Blank\"\n operator = if group == 'Blank'\n # FIXME: Field should be sanatized. Possible SQL Inject attack\n \"= '' OR #{field.to_s} IS NULL\"\n else\n 'LIKE ?'\n end\n # FIXME: Field should be sanatized. Possible SQL Inject attack\n conditions = [\n \"#{model.table_name}.#{field.to_s} #{operator}\",\n \"#{group}%\"\n ]\n end\n\n # Find results for this page\n model.with_scope({:find => {:conditions => conditions}}) {model.find :all}\n end",
"title": ""
},
{
"docid": "38dc0d0f19e8bbb48b4e5feae9b08480",
"score": "0.5418183",
"text": "def exact_find(label)\n do_query(\"SELECT ad.label, a.id, a.username, a.password, a.date_created, a.date_updated, ad.description, ad.link,\n sq.question, sq.answer, a.uuid, a.sys_user \n FROM acct_desc ad JOIN acct a ON a.id = ad.acct_id LEFT JOIN security_question sq ON a.id = sq.acct_id\n WHERE ad.label like '#{label}' AND a.sys_user = '#{ENV['USER']}'\n ORDER BY ad.date_updated;\",\n %w[label id username password date_created date_updated description link question answer uuid sys_user])\n end",
"title": ""
},
{
"docid": "54d1ca9ff3c3b157b108e38e3a54e505",
"score": "0.5408016",
"text": "def find item\n\tend",
"title": ""
},
{
"docid": "399248bcb17b713033687575efd44574",
"score": "0.54052496",
"text": "def find\n sanitizers = {\n :type => Proc.new{ |x| x.to_s },\n :status => Proc.new{ |st| st.is_a?(Array) ? st.map(&:to_i) : st.to_i },\n :customer_id => Proc.new{ |x| x.to_i },\n :customer_ext_id => Proc.new{ |x| x.to_i }\n }\n c = {}\n params.each do |k,v|\n k = k.to_sym\n c[k] = sanitizers[k].call(v) if sanitizers[k]\n end\n if c.key?(:customer_ext_id)\n if cust = Customer.find_by_external_id(c[:customer_ext_id])\n c.delete :customer_ext_id\n c[:customer_id] = cust.id\n else\n c = nil # disallow Ticket.first call\n r['error'] = \"Cannot find customer by ext_id = #{c[:customer_ext_id]}\"\n end\n end\n\n r = {}; @ticket = nil\n\n @ticket = Ticket.first(\n :conditions => c,\n :order => \"created_at DESC\"\n ) if c\n\n respond_to do |format|\n format.yaml {\n r['ticket'] = @ticket && @ticket.attributes.reject{ |k,v| v.blank? }\n render :text => r.ya2yaml\n }\n end\n end",
"title": ""
},
{
"docid": "c7432a02dea2f3372c9cea772ad11e6b",
"score": "0.54021156",
"text": "def find_patient_by_name(patient_name)\n \nend",
"title": ""
},
{
"docid": "65cdd252c2ac5e700a79f776a7d89636",
"score": "0.53985715",
"text": "def get_record(item, **opt)\n find_by(**id_term(item, **opt))\n end",
"title": ""
},
{
"docid": "87bdcb830cf540517313c7ea515fb486",
"score": "0.5389455",
"text": "def find id, params = {}, &block\n rel = relation params, &block\n rel.where!(config.document_unique_id_param => id) \n rel.load\n rel\n end",
"title": ""
},
{
"docid": "03080482e2f5c72a2a65dd42afef6364",
"score": "0.5389139",
"text": "def find_object\n @object = @model_class.find_by_id(params[:id].to_i)\n end",
"title": ""
},
{
"docid": "5da12dc769d6da2b71838b765644206e",
"score": "0.5388287",
"text": "def find(id, params = {})\n from_base id, params\n end",
"title": ""
},
{
"docid": "7c69a8ae07e53439efef4713558e6c64",
"score": "0.538689",
"text": "def search(criteria = {})\r\n \r\n end",
"title": ""
},
{
"docid": "9a51e8cad2dc1f73e6d200b83af08c41",
"score": "0.5375679",
"text": "def search(value, try_with:nil)\n\n # Don't search ids (primary and foreign keys), just semantic columns\n # Don't try to search in non-string columns either; this causes issues in some DBs\n col_names = self.columns.select do |col_name|\n !col_name.to_s.end_with?('id') && self.db_schema[col_name][:type] == :string\n end\n\n try_with_params = Proc.new do |params|\n col_names.each do |attr|\n model = self[{ attr => value.to_s }.merge params]\n return model if model\n end\n end\n\n if try_with\n # First, check for a group of additional params to try at once\n if try_with.keys.all? { |attr| self.columns.include?(attr) }\n try_with_params[try_with]\n end\n\n # Then, try searching with suggested additional params one-by-one\n try_with.each do |k,v|\n try_with_params[k => v] if self.columns.include?(k)\n end\n end\n\n # Finally, search only for given value.\n col_names.each do |attr| \n model = self[attr => value.to_s]\n return model if model\n end\n nil\n end",
"title": ""
},
{
"docid": "809b73ef639b14e1bfe18a49f206e3da",
"score": "0.5375168",
"text": "def find_models key, rdfa=nil\n if rdfa\n model_groups = eval(\"configatron.rdfa_query\") ? eval(\"configatron.rdfa_query\").to_hash : eval(\"configatron.query\").to_hash \n else\n model_groups = eval(\"configatron.query\").to_hash\n end \n model_groups.each do |model_group_name,model_group|\n if model_group_name.to_s.downcase == key.downcase\n return {model_group_name=>model_group}\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "4c20463ba2a9cda7e576345babfc7f31",
"score": "0.53705174",
"text": "def find_by(params = {})\n find_by_index(params) || where(params).first\n end",
"title": ""
},
{
"docid": "302239307947c911a0877164a7de14eb",
"score": "0.5367204",
"text": "def find_all_by_api(params = {})\n find_by_translator params_to_translator(params)\n end",
"title": ""
},
{
"docid": "e449067a0e2a3a46f3161d4ef5063a2e",
"score": "0.5366141",
"text": "def find(params)\n if params.is_a? Integer\n find_equals(:number, params)\n else\n k,v = params.first\n find_equals k, v\n end\n end",
"title": ""
},
{
"docid": "75bd8328be5f444936b35e2aae788975",
"score": "0.53628415",
"text": "def define_find_method(name, builder)\n define_helper \"find_#{name}\", ->(id) { builder.find(id) }\n end",
"title": ""
},
{
"docid": "af2e6b41521df3f52c0383cd54b04ea9",
"score": "0.53608984",
"text": "def resource\n klass, param = resource_class\n klass&.find(params[param.to_sym])\n end",
"title": ""
},
{
"docid": "c9e3a407ed181249c23efcb86b34b800",
"score": "0.5346639",
"text": "def find_by(conditions={})\n raise ArgumentError if conditions.empty?\n query = %(SELECT * FROM #{table_name} #{build_condition(conditions)})\n res = connection.execute(query).first\n\n if res.nil?\n raise RecordNotFound\n end\n res.extend Result::Behavior\n end",
"title": ""
},
{
"docid": "07ae37ffab290d3c731cc6ca7985eeb1",
"score": "0.53463596",
"text": "def find_item_by_model(model)\n @models_to_items[model]\n end",
"title": ""
},
{
"docid": "7c23b33f392d9a6b5cf07c8fcd42d00c",
"score": "0.53356415",
"text": "def find_param\n @article = Article.find(params[:id])\n end",
"title": ""
},
{
"docid": "cd2e0916e86cef5a4fe800287f6186ab",
"score": "0.5334458",
"text": "def find(verb, url)\n http_verb = verb.to_s.upcase\n route = \"#{http_verb} #{url}\"\n @list[route]\n end",
"title": ""
}
] |
b1323db29287b13fc74f9b6381697db1
|
TODO(thomthom): Move to TestUp2 utility methods and merge with TC_Sketchup_Classifications.
|
[
{
"docid": "16f3585888083a13ba6a99eb4a8b7ead",
"score": "0.0",
"text": "def open_test_model\n basename = File.basename(__FILE__, \".*\")\n path = File.dirname(__FILE__)\n test_model = File.join(path, basename, \"MaterialTests.skp\")\n # To speed up tests the model is reused is possible. Tests that modify the\n # model should discard the model changes: close_active_model()\n # TODO(thomthom): Add a Ruby API method to expose the `dirty` state of the\n # model - whether it's been modified since last save/open.\n # Model.path must be converted to Ruby style path as SketchUp returns an\n # OS dependant path string.\n model = Sketchup.active_model\n if model.nil? || File.expand_path(model.path) != test_model\n close_active_model()\n Sketchup.open_file(test_model)\n end\n Sketchup.active_model\n end",
"title": ""
}
] |
[
{
"docid": "24f4d14ed731cf48d2f93d10cf57157e",
"score": "0.5840246",
"text": "def generate_test_class(data: [], linkstatus_url_log: {}, w_pipe: {})\n test_cond = @test_cond\n # Common proccessing\n # e.g.) TestSampleAppPcE2e1, TestSampleAppPcHttpstatus1\n test_class_name = make_test_class_name(data)\n # Select super class by test category\n super_suite_class = eval format('Bucky::TestEquipment::TestCase::%<test_category>sTestCase', test_category: data[:test_category].capitalize)\n # Define test suite class\n test_classes.const_set(test_class_name.to_sym, Class.new(super_suite_class) do |_klass|\n extend TestClassGeneratorHelper\n include TestClassGeneratorHelper\n define_method(:suite_data, proc { data[:suite] })\n define_method(:suite_id, proc { data[:test_suite_id] })\n define_method(:simple_test_class_name) do |original_name|\n match_obj = /\\Atest_(.+)\\(.+::(Test.+)\\)\\z/.match(original_name)\n \"#{match_obj[1]}(#{match_obj[2]})\"\n end\n define_method(:w_pipe, proc { w_pipe })\n\n # Class structure is different for each test category\n case data[:test_category]\n when 'linkstatus' then\n data[:suite][:cases].each_with_index do |t_case, i|\n method_name = make_test_method_name(data, t_case, i)\n description(\n t_case[:case_name],\n define_method(method_name) do\n puts \"\\n#{simple_test_class_name(name)}\"\n t_case[:urls].each do |url|\n linkstatus_check_args = { url: url, device: data[:suite][:device], exclude_urls: data[:suite][:exclude_urls], link_check_max_times: test_cond[:link_check_max_times], url_log: linkstatus_url_log }\n linkstatus_check(linkstatus_check_args)\n end\n end\n )\n end\n\n when 'e2e' then\n if data[:suite][:setup_each]\n def setup\n super\n puts \"[setup]#{simple_test_class_name(name)}\"\n add_test_procedure(suite_data[:setup_each][:procs])\n end\n end\n\n if data[:suite][:teardown_each]\n def teardown\n puts \"[teardown]#{simple_test_class_name(name)}\"\n add_test_procedure(suite_data[:teardown_each][:procs])\n super\n end\n end\n\n # Generate test case method\n data[:suite][:cases].each_with_index do |t_case, i|\n # e.g.) test_sample_app_pc_e2e_1_2\n method_name = make_test_method_name(data, t_case, i)\n method_obj = proc do\n puts \"\\n#{simple_test_class_name(name)}\\n #{t_case[:desc]} ....\"\n add_test_procedure(t_case[:procs])\n end\n description(t_case[:case_name], define_method(method_name, method_obj))\n end\n end\n end)\n end",
"title": ""
},
{
"docid": "8800169b5e6412efcf89fe80f2d0c330",
"score": "0.5810649",
"text": "def test_class_label\n Allure::ResultUtils.test_class_label(File.basename(example.file_path, \".rb\"))\n end",
"title": ""
},
{
"docid": "57edf97e90f3d0729b23f6ab0a81c53c",
"score": "0.57884914",
"text": "def writeup_classification\n classification_label().split(\"-\").first\n end",
"title": ""
},
{
"docid": "4312e195ae86ca33498d53f52b009c84",
"score": "0.5762073",
"text": "def test_driver_inc_classes\n\t\tloc = Location::new(\"Location\", [\"Place\"])\n\t\tdriv = Driver::new(1, loc)\n\t\tdriv.inc_classes\n\t\tassert_equal 2, driv.get_classes\n\tend",
"title": ""
},
{
"docid": "8abce42a8b640a0b9b4a2ca4d1eb7b59",
"score": "0.56696117",
"text": "def writeup_classification\n classification_label.split(\"-\").first\n end",
"title": ""
},
{
"docid": "71522f1c7f54664c09490eeca9ef19b4",
"score": "0.56594926",
"text": "def test_classes\n if(@fiber && @input_classes.size == 0)\n @fiber.transfer [:error, \"Could not find any classes\"]\n end\n @input_classes.each do |c|\n if @regression_file.nil?\n single_class_test(c)\n else\n double_class_test(c,@regression_file)\n end\n end\n end",
"title": ""
},
{
"docid": "76d23e81f3547474f433ebdb873cfff4",
"score": "0.5596714",
"text": "def check_classifications(params)\n # return if classification is not enabled, also return if params are blank.\n return [] if params.blank? || Setting.CLASSIFICATION == false\n sm_holders = []\n classification_errors = []\n\n obj_level_classification = Classification.get_object_level_class(params)\n\n if obj_level_classification.blank?\n classification_errors << \"#{params[:obj_type]} must have an object level classification declaration\"\n end\n\n # if we made it this far the object level classification should be good\n # next we want to check fields, now field level classifications should all exist in the stix_markings_attributes so collect them first\n sm_fields = Classification.get_field_level_classifications(params[:stix_markings_attributes])\n \n if sm_fields.present?\n # now that we have all the fields and their classifications we want make sure they are not higher than the obj level\n sm_fields.each do |field|\n if field.values.present? && obj_level_classification.present? && Classification::CLASSIFICATIONS.index(field.values.first) > Classification::CLASSIFICATIONS.index(obj_level_classification)\n classification_errors << \"Error in Field: #{field.keys.first}\"\n end\n end\n end\n\n # okay now that we got here we are done with the original object checking, need to do associated objects and embedded objects.\n # We loop through the params array to find all valid keys that can contain stix markings attributes\n params.keys.each do |key|\n if StixMarking::VALID_CLASSES.include?(key.classify)\n sm_holders << key\n end\n end\n \n # now we have an array of all keys that could have stix markings. the first thing we need to do is find out the type of the main object were checking.\n # This should have been sent into the put as a parameter, we start with CLASSIFICATION_CONTAINER_OF\n if params[:obj_type].constantize.const_defined?(\"CLASSIFICATION_CONTAINER_OF\")\n sm_holders.each do |holder|\n if params[:obj_type].constantize::CLASSIFICATION_CONTAINER_OF.include?(holder.to_sym)\n params[holder.to_sym].each_with_index do |obj, index|\n comparing_marking = Classification.get_object_level_class(obj, holder.classify.constantize)\n if comparing_marking.present? && obj_level_classification.present? && Classification::CLASSIFICATIONS.index(comparing_marking) > Classification::CLASSIFICATIONS.index(obj_level_classification)\n classification_errors << \"Error in Contained Object: #{(holder + [index].to_s)}\"\n end\n end\n end\n end\n end\n\n if params[:obj_type].constantize.const_defined?(\"CLASSIFICATION_CONTAINED_BY\")\n sm_holders.each do |holder|\n if params[:obj_type].constantize::CLASSIFICATION_CONTAINED_BY.include?(holder.to_sym)\n params[holder.to_sym].each_with_index do |obj, index|\n comparing_marking = Classification.get_object_level_class(obj, holder.classify.constantize)\n if comparing_marking.present? && obj_level_classification.present? && Classification::CLASSIFICATIONS.index(obj_level_classification) > Classification::CLASSIFICATIONS.index(comparing_marking)\n classification_errors << \"Error in Container Object: #{(holder + [index].to_s)}\"\n end\n end\n end\n end\n end\n\n classification_errors\n end",
"title": ""
},
{
"docid": "8f1c94592f39e6f7649463118849a3c2",
"score": "0.54995567",
"text": "def test_cases; end",
"title": ""
},
{
"docid": "4fab06225ae65248a22d48bb143187f5",
"score": "0.5471052",
"text": "def test_get_class\n assert_equal Test::Unit::TestCase,\n OneLiner.get_class(\"Test::Unit::TestCase\")\n end",
"title": ""
},
{
"docid": "d8c60b556e21baee4e10653b87cf0066",
"score": "0.5417805",
"text": "def test_marked\n end",
"title": ""
},
{
"docid": "cf2231631bc862eb0c98d89194d62a88",
"score": "0.5395037",
"text": "def identify; end",
"title": ""
},
{
"docid": "2cd9f6a37f5945b658156b5d588f5072",
"score": "0.5384042",
"text": "def test_add_class\n assert_equal @d.resources[\"classes\"], 1\n @d.add_class\n assert_equal @d.resources[\"classes\"], 2\n @d.add_class\n assert_equal @d.resources[\"classes\"], 4\n end",
"title": ""
},
{
"docid": "072514f3348fe62556dcdfd4b06e3d08",
"score": "0.53597736",
"text": "def spec; end",
"title": ""
},
{
"docid": "072514f3348fe62556dcdfd4b06e3d08",
"score": "0.53597736",
"text": "def spec; end",
"title": ""
},
{
"docid": "44b10eea6a533b77198b2a7c5885bcb1",
"score": "0.5358714",
"text": "def classification\n @line1[07]\n end",
"title": ""
},
{
"docid": "76db94e1d2590bb6d4afd7dff68cfd95",
"score": "0.5358137",
"text": "def test_add_initial_class\n\t\tassert_equal 1, @new_driver.class(1)\n\tend",
"title": ""
},
{
"docid": "1d476b29afb502cc35cc59c75f287bde",
"score": "0.53425664",
"text": "def analyze_component_breakdown\n\n end",
"title": ""
},
{
"docid": "59d9765a7308cf92979adaf664e96cc1",
"score": "0.53098744",
"text": "def test_get_class\n assert_equal Test::Unit::TestCase,\n OneLiner.get_class(\"Test::Unit::TestCase\")\n end",
"title": ""
},
{
"docid": "b58cbce0e86395667aaeb65004559c80",
"score": "0.53090334",
"text": "def running_test_case; end",
"title": ""
},
{
"docid": "bf67df5a2ce9509110eb2b6384c301ee",
"score": "0.5284835",
"text": "def test_add_class\n\t\t@new_driver.class 1\n\t\t@new_driver.class 1\n\t\tassert_equal 4, @new_driver.class(1)\n\tend",
"title": ""
},
{
"docid": "fdd9d18b4beff6539f934cd730a12853",
"score": "0.5268483",
"text": "def test\n rows = Util.get_rows(:file => 'data/vehicles.csv', :n => 3000, :pre_process => true)\n classes = rows.transpose.last\n rows = rows.transpose[0..-2].transpose\n train(rows.first(2000), classes.first(2000))\n \"#{classes.last} classified as #{classify(rows.last)}\"\n end",
"title": ""
},
{
"docid": "16b308d3bbcee2ec634cee48283c98aa",
"score": "0.5260954",
"text": "def consolidate_classes(original_line, list_of_classes)\n record = {\n :original_ocr => original_line,\n :attributes_parsed => {\n :subject =>\n [\n #{:value => \"Curran Sarah\", :type => \"primary\", :occupation => \"widowed\"},\n #{:value => \"Richard\", :type => \"widower of primary\"}\n ],\n :location =>\n [\n #{:value => \"7 Sixth\", :position => \"rear\", :type => \"home\"}\n ]\n }\n }\n\n list_of_classes.each_with_index do |classed_token, index|\n parsed_class = classed_token[1][0]\n value = classed_token[0]\n if index == 0 && parsed_class == :name_component\n record[:attributes_parsed][:subject] << {:value => value, :type => 'primary'}\n end\n if index > 0\n case parsed_class\n when :job_component\n unless record[:attributes_parsed][:subject].count < 1\n record[:attributes_parsed][:subject][0][:occupation] = value\n end\n when :predicate\n case value\n when \"wid\"\n unless record[:attributes_parsed][:subject].count < 1\n record[:attributes_parsed][:subject][0][:occupation] = 'widow'\n end\n deceased_name = look_for_name_of_deceased(list_of_classes,index)\n unless deceased_name.nil?\n record[:attributes_parsed][:subject] << {:value => deceased_name, :type => 'deceased spouse of primary'}\n end\n #attach_to_next(list_of_classes, index, :name_component, [{:type => 'deceased spouse of primary'}])\n when \"h\"\n attach_to_next(list_of_classes, index, :address_component, [{:type => 'home'}])\n when \"r\"\n attach_to_next(list_of_classes, index, :address_component, [{:position => 'rear'}])\n else\n end\n ## inner case\n when :address_component\n loc = {:value => value}\n classed_token[2..-1].each do |xtra_attr| ## add in any additional attributes from predicates\n xtra_attr.each do |k, v|\n loc[k] = v\n end\n end\n unless merge_if_directly_subsequent_is_alike(list_of_classes, index, classed_token)\n record[:attributes_parsed][:location] << loc\n end\n else\n end\n end ## indices after 0\n end ## loop of classes\n\n return record\nend",
"title": ""
},
{
"docid": "adcced74515ffeee25c7590979ef8fa4",
"score": "0.5248838",
"text": "def infer_specimen_class(klass=self.class)\n klass.to_s[/(\\w+?)(Specimen(Requirement)?)$/, 1] if klass\n end",
"title": ""
},
{
"docid": "a9f4c2a19b80ba89e2afaa1cdd14095b",
"score": "0.52406",
"text": "def test_case; end",
"title": ""
},
{
"docid": "2da7d952b5469b02d75cba4e97a710cd",
"score": "0.5239651",
"text": "def addClassifications(filename)\n\t# open the file with classifications\n\tclassificationTypes = File.open(Rails.root.join(\"db\", \"seed_data\", filename))\n\t# Each line of the file contains a classification description. Iterate through the file and create a classification for each line.\n\tclassificationTypes.each do |curClassificationType|\n\t\tClassification.find_or_create_by({ :classification_description => curClassificationType.strip })\n\tend\nend",
"title": ""
},
{
"docid": "6eebb955ef01afc920087bdf369dbcab",
"score": "0.5209592",
"text": "def classify(text)\n choose classifications(text)\n end",
"title": ""
},
{
"docid": "eeff36b955372a555b958d4e8a5b3f38",
"score": "0.52086335",
"text": "def test_get_class\n\t\t@new_driver.class 1\n\t\t@new_driver.class 1\n\t\t@new_driver.class 1\n\t\tassert_equal 4, @new_driver.class(0)\n\tend",
"title": ""
},
{
"docid": "05a45d0235c598ff04723ed3cff2276e",
"score": "0.5204449",
"text": "def classes; end",
"title": ""
},
{
"docid": "0f2a1707ba07587d462671abc752686b",
"score": "0.51993114",
"text": "def test_generate_with_varied_class_entries\n forms = ['classtest.utils.MathUtil', \n 'classtest.utils.MathUtil.as', \n 'classtest/utils/MathUtil', \n 'classtest/utils/MathUtil.as'\n ]\n forms.each do |form|\n run_generator(form)\n assert_generated_class(form, @src_dir)\n remove_file(@src_dir)\n FileUtils.mkdir_p(@src_dir)\n remove_file(@test_dir)\n FileUtils.mkdir_p(@test_dir)\n end\n end",
"title": ""
},
{
"docid": "415555a2a4bf1eddc0bd57ce6154c2de",
"score": "0.5198416",
"text": "def xcodebuild_only_arguments(single_partition)\n single_partition.flat_map do |test_target, classes|\n classes.sort.map do |clazz|\n \"-only-testing:#{test_target}/#{clazz}\"\n end\n\n end\n end",
"title": ""
},
{
"docid": "21b42779312fe49a920e0bc1b470e718",
"score": "0.51773167",
"text": "def test_drivers_get_classes\n\t\tloc = Location::new(\"Location\", [\"Place\"])\n\t\tdriv = Driver::new(1, loc)\n\t\tassert_equal 0, driv.get_classes\n\tend",
"title": ""
},
{
"docid": "fca50b6a20eb3d95b77192233f52ebfb",
"score": "0.5173007",
"text": "def get_field_level_classifications(stix_markings)\n classifications = []\n\n field_markings = stix_markings.select {|sm| sm[:remote_object_field] != nil && sm[:isa_assertion_structure_attributes].present?}\n\n field_markings.each do |fm|\n # ugh again cs_classification is sometimes an array -.-\n if fm[:isa_assertion_structure_attributes][:cs_classification].class == Array\n classifications << {fm[:remote_object_field] => fm[:isa_assertion_structure_attributes][:cs_classification].pop}\n else\n classifications << {fm[:remote_object_field] => fm[:isa_assertion_structure_attributes][:cs_classification]}\n end\n end\n\n classifications\n end",
"title": ""
},
{
"docid": "1d3ffd962c8a31a67b2f7994a7ff2413",
"score": "0.5125565",
"text": "def process_test_cases\n raise NotImplementedError, 'You must implement this'\n end",
"title": ""
},
{
"docid": "b1f6ccb1de31a9b96acd9fb958e93392",
"score": "0.51213044",
"text": "def test_scenario2\n data = [[File.dirname(__FILE__)+'/data/iris.csv', {\"petal width\" => 4}, 'Iris-setosa', {\"kind\" => \"probability\", \"threshold\" => 0.1, \"positive_class\" => \"Iris-setosa\"}, \"000004\"],\n [File.dirname(__FILE__)+'/data/iris.csv', {\"petal width\" => 4}, 'Iris-versicolor', {\"kind\" => \"probability\", \"threshold\" => 0.9, \"positive_class\" => \"Iris-setosa\"}, \"000004\"],\n [File.dirname(__FILE__)+'/data/iris.csv', {\"sepal length\" => 4.1, \"sepal width\" => 2.4}, 'Iris-setosa', {\"kind\" => \"confidence\", \"threshold\" => 0.1, \"positive_class\" => \"Iris-setosa\"}, \"000004\"],\n [File.dirname(__FILE__)+'/data/iris.csv', {\"sepal length\" => 4.1, \"sepal width\" => 2.4}, 'Iris-versicolor', {\"kind\" => \"confidence\", \"threshold\" => 0.9, \"positive_class\" => \"Iris-setosa\"}, \"000004\"]\n ]\n puts\n puts \"Scenario : Successfully comparing predictions in operating points for models\"\n\n data.each do |filename, data_input, prediction_result, operating_point, objective|\n puts\n puts \"Given I create a data source uploading a <%s> file\" % filename\n source = @api.create_source(filename, {'name'=> 'source_test', 'project'=> @project[\"resource\"]})\n\n puts \"And I wait until the source is ready\"\n assert_equal(BigML::HTTP_CREATED, source[\"code\"])\n assert_equal(1, source[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(source), true)\n \n puts \"And I create a dataset\"\n dataset=@api.create_dataset(source)\n\n puts \"And I wait until the dataset is ready\"\n assert_equal(BigML::HTTP_CREATED, dataset[\"code\"])\n assert_equal(1, dataset[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(dataset), true)\n \n puts \"And I create model\"\n model=@api.create_model(dataset)\n \n puts \"And I wait until the model is ready\"\n assert_equal(BigML::HTTP_CREATED, model[\"code\"])\n assert_equal(1, model[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(model), true)\n \n puts \"And I create a local model\"\n local_model = BigML::Model.new(model, @api)\n\n puts \"When I create a prediction for %s in %s \" % [JSON.generate(data_input), JSON.generate(operating_point)]\n prediction = @api.create_prediction(model, data_input, {\"operating_point\" => operating_point})\n \n assert_equal(BigML::HTTP_CREATED, prediction[\"code\"])\n assert_equal(@api.ok(prediction), true)\n\n puts \"Then the prediction for '<%s>' is '<%s>'\" % [objective, prediction_result]\n \n if !prediction['object']['prediction'][objective].is_a?(String)\n assert_equal(prediction['object']['prediction'][objective].to_f.round(5), prediction_result.to_f.round(5))\n else\n assert_equal(prediction['object']['prediction'][objective], prediction_result)\n end\n\n puts \"And I create a local prediction for <%s> in <%s>\" % [JSON.generate(data_input), JSON.generate(operating_point)]\n local_prediction = local_model.predict(data_input, {\"operating_point\" => operating_point})\n \n puts \"Then the local prediction is <%s>\" % prediction_result\n \n if local_prediction.is_a?(Array)\n local_prediction = local_prediction[0]\n elsif local_prediction.is_a?(Hash)\n local_prediction = local_prediction['prediction']\n else\n local_prediction = local_prediction\n end \n \n if (local_model.regression) or \n (local_model.is_a?(BigML::MultiModel) and local_model.models[0].regression)\n assert_equal(local_prediction.to_f.round(4), prediction_result.to_f.round(4))\n else\n assert_equal(local_prediction, prediction_result)\n end \n \n end\n \n end",
"title": ""
},
{
"docid": "732f9a70f23d6eaee07ef46883528f01",
"score": "0.5113488",
"text": "def generate\n\t\tputs '####### Generation of TestClasses begins'\n\t\t@java_map.each { |key, value|\n\t\t\tif @java_map.has_key?(key +'Test') || key.end_with?('Test')\n\t\t\t\tputs key + ' already has a Test (Test will not be generated)'\n\t\t\telsif value.is_a? JavaClass\n\t\t\t\tif value.abstract\n\t\t\t\t\tputs key + ' is abstract (Test will not be generated)'\n\t\t\t\telse\n\t\t\t\t\tgenerate_test_class value\n\t\t\t\tend\n\t\t\tend\n\t\t}\n\tend",
"title": ""
},
{
"docid": "3783993032b27b01677d3ce5a96ed60e",
"score": "0.5112364",
"text": "def test_driver_checkLocation_start\n\t\td = Driver::new(\"Driver 1\",1)\n\t\td.checkLocation\n\t\tassert_equal d.classes, 2\n\tend",
"title": ""
},
{
"docid": "126c23d4cc835fa4ca3b5c2a376d39bb",
"score": "0.5104385",
"text": "def graffiti_test\n end",
"title": ""
},
{
"docid": "a8069ef0f75b090d3020944956e7a68a",
"score": "0.5096123",
"text": "def quality_indicator_name\n \"tests coverage\"\n end",
"title": ""
},
{
"docid": "6c505c72d54606910237d74a6c9231b1",
"score": "0.5088988",
"text": "def single_class_test(testing_class)\n cur_testing_class = Generator.new(testing_class, @traversal)\n TestFile.open(testing_class,[],@output_dir) do |file|\n cur_testing_class.test_class do |test|\n file << test << \"\\n\"\n end\n end\n end",
"title": ""
},
{
"docid": "017f8be2ab687a613d304a5285b441f7",
"score": "0.50872284",
"text": "def test_scenario4\n data = [[File.dirname(__FILE__)+'/data/iris.csv', {\"petal width\" => 4}, 'Iris-setosa', {\"kind\" => \"probability\", \"threshold\" => 0.1, \"positive_class\" => \"Iris-setosa\"}, \"000004\"],\n [File.dirname(__FILE__)+'/data/iris.csv', {\"petal width\" => 4}, 'Iris-virginica', {\"kind\" => \"probability\", \"threshold\" => 0.9, \"positive_class\" => \"Iris-setosa\"}, \"000004\"],\n [File.dirname(__FILE__)+'/data/iris.csv', {\"sepal length\" => 4.1, \"sepal width\"=> 2.4}, 'Iris-setosa', {\"kind\" => \"confidence\", \"threshold\" => 0.1, \"positive_class\" => \"Iris-setosa\"}, \"000004\"],\n [File.dirname(__FILE__)+'/data/iris.csv', {\"sepal length\" => 4.1, \"sepal width\"=> 2.4}, 'Iris-versicolor', {\"kind\" => \"confidence\", \"threshold\" => 0.9, \"positive_class\" => \"Iris-setosa\"}, \"000004\"]\n ]\n puts\n puts \"Successfully comparing predictions in operating points for ensembles\"\n\n data.each do |filename, data_input, prediction_result, operating_point, objective|\n puts\n puts \"Given I create a data source uploading a <%s> file\" % filename\n source = @api.create_source(filename, {'name'=> 'source_test', 'project'=> @project[\"resource\"]})\n\n puts \"And I wait until the source is ready\"\n assert_equal(BigML::HTTP_CREATED, source[\"code\"])\n assert_equal(1, source[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(source), true)\n \n puts \"And I create a dataset\"\n dataset=@api.create_dataset(source)\n\n puts \"And I wait until the dataset is ready\"\n assert_equal(BigML::HTTP_CREATED, dataset[\"code\"])\n assert_equal(1, dataset[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(dataset), true)\n \n puts \"And I create an ensemble\"\n ensemble = @api.create_ensemble(dataset, {\"number_of_models\"=> 2, \"seed\" => 'BigML', 'ensemble_sample'=>{'rate' => 0.7, 'seed' => 'BigML'}, 'missing_splits' => false})\n \n puts \"And I wait until the ensemble is ready\"\n assert_equal(BigML::HTTP_CREATED, ensemble[\"code\"])\n assert_equal(1, ensemble[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(ensemble), true)\n \n puts \"And I create a local ensemble\"\n local_ensemble = BigML::Ensemble.new(ensemble, @api)\n local_model = BigML::Model.new(local_ensemble.model_ids[0], @api)\n \n puts \" When I create a prediction for <%s>\" % [JSON.generate(data_input)]\n prediction = @api.create_prediction(ensemble['resource'], data_input, {\"operating_point\" => operating_point})\n \n assert_equal(BigML::HTTP_CREATED, prediction[\"code\"])\n assert_equal(@api.ok(prediction), true)\n \n \n puts \"Then the prediction for <%s> is <%s>\" % [objective, prediction_result]\n \n if !prediction['object']['prediction'][objective].is_a?(String)\n assert_equal(prediction['object']['prediction'][objective].to_f.round(5), prediction_result.to_f.round(5))\n else\n assert_equal(prediction['object']['prediction'][objective], prediction_result)\n end \n \n puts \"And I create a local prediction for <%s>\" % JSON.generate(data_input)\n local_prediction = local_ensemble.predict(data_input, {\"operating_point\" => operating_point})\n \n puts \"Then the local prediction is <%s>\" % prediction_result\n \n if local_prediction.is_a?(Array)\n local_prediction = local_prediction[0]\n elsif local_prediction.is_a?(Hash)\n local_prediction = local_prediction['prediction']\n else\n local_prediction = local_prediction\n end \n \n if (local_ensemble.regression) or \n (local_ensemble.is_a?(BigML::MultiModel) and local_ensemble.models[0].regression)\n assert_equal(local_prediction.to_f.round(4), prediction_result.to_f.round(4))\n else\n assert_equal(local_prediction, prediction_result)\n end \n \n end\n end",
"title": ""
},
{
"docid": "b125032c2de26176acb69e1089100783",
"score": "0.50828344",
"text": "def test_scenario1\n data = [\n {\"filename\" => File.dirname(__FILE__)+\"/data/predictions_c.json\", \n \"method\" => 0,\n \"prediction\" => \"a\",\n\t \"confidence\" => 0.450471270879},\n {\"filename\" => File.dirname(__FILE__)+\"/data/predictions_c.json\",\n \"method\" => 1,\n \"prediction\" => \"a\",\n \"confidence\" => 0.552021302649},\n {\"filename\" => File.dirname(__FILE__)+\"/data/predictions_c.json\",\n \"method\" => 2,\n \"prediction\" => \"a\",\n \"confidence\" => 0.403632421178},\n {\"filename\" => File.dirname(__FILE__)+\"/data/predictions_r.json\",\n \"method\" => 0,\n \"prediction\" => 1.55555556667, \n \"confidence\" => 0.400079152063},\n {\"filename\" => File.dirname(__FILE__)+\"/data/predictions_r.json\",\n \"method\" => 1,\n \"prediction\" => 1.59376845074,\n \"confidence\" => 0.248366474212},\n {\"filename\" => File.dirname(__FILE__)+\"/data/predictions_r.json\",\n \"method\" => 2,\n \"prediction\" => 1.55555556667,\n \"confidence\" => 0.400079152063}\n ]\n\n puts \"Scenario: Successfully computing predictions combinations\"\n data.each do |item|\n puts\n\n puts \"Given I create a MultiVote for the set of predictions in file <%s>\" % item[\"filename\"]\n multivote = BigML::MultiVote.new(JSON.parse(File.open(item[\"filename\"], \"rb\").read))\n\n puts \"When I compute the prediction with confidence using method <%s>\" % item[\"method\"]\n combined_results = multivote.combine(item[\"method\"], nil, true)\n\n puts \"And I compute the prediction without confidence using method <%s>\" % item[\"method\"] \n combined_results_no_confidence = multivote.combine(item[\"method\"])\n\n if multivote.is_regression() \n puts \"Then the combined prediction is <%s>\" % item[\"prediction\"]\n assert_equal(combined_results[\"prediction\"].round(6), item[\"prediction\"].round(6))\n puts \"And the combined prediction without confidence is <%s>\" % item[\"prediction\"]\n assert_equal(combined_results_no_confidence.round(6), item[\"prediction\"].round(6))\n else\n puts \"Then the combined prediction is <%s>\" % item[\"prediction\"]\n assert_equal(combined_results[\"prediction\"], item[\"prediction\"])\n puts \"And the combined prediction without confidence is <%s>\" % item[\"prediction\"]\n assert_equal(combined_results_no_confidence,item[\"prediction\"])\n end\n puts \"And the confidence for the combined prediction is %s \" % item[\"confidence\"]\n assert_equal(combined_results[\"confidence\"].round(5), item[\"confidence\"].round(5)) \n end\n\n end",
"title": ""
},
{
"docid": "013f9dc0076fac69b77e14f2196847d7",
"score": "0.5079772",
"text": "def sanger_phenotyping_css_class_for_test(status_desc)\n case status_desc\n when \"Test complete and data\\/resources available\" then \"completed_data_available\"\n when \"Test complete and considered interesting\" then \"significant_difference\"\n when \"Test complete but not considered interesting\" then \"no_significant_difference\"\n when \"Early indication of possible phenotype\" then \"early_indication_of_possible_phenotype\"\n when /^Test not performed or applicable/i then \"not_applicable\"\n when \"Test abandoned\" then \"test_abandoned\"\n else \"test_pending\"\n end\nend",
"title": ""
},
{
"docid": "63efa6ea3e85ce9c9249cd27631df2bb",
"score": "0.50757045",
"text": "def creatable_classes\n #FIXME: make these discovered automatically.\n #FIXME: very bad method name\n #[Model,DataFile,Sop,Study,Assay,Investigation]\n [\"Method\",\"Survey\",\"Study\"]\n\n end",
"title": ""
},
{
"docid": "fcab3603b052a3eb298677b5d1825c50",
"score": "0.5048405",
"text": "def setup\n alpha_1_string = File.open('./test/unit/lib/hl7_test_data/discovery_alpha_1.csv').read\n alpha_2_string = File.open('./test/unit/lib/hl7_test_data/discovery_alpha_2.csv').read\n beta_1_string = File.open('./test/unit/lib/hl7_test_data/discovery_beta_1.csv').read\n beta_2_string = File.open('./test/unit/lib/hl7_test_data/discovery_beta_2.csv').read\n @alpha_1 = DiscoveryCsv.new(hl7_csv_string: alpha_1_string)\n @alpha_2 = DiscoveryCsv.new(hl7_csv_string: alpha_2_string)\n @beta_1 = DiscoveryCsv.new(hl7_csv_string: beta_1_string)\n @beta_2 = DiscoveryCsv.new(hl7_csv_string: beta_2_string)\n @same_one = DiscoveryCsv.new(hl7_csv_string: File.open('./test/unit/lib/hl7_test_data/discovery_same_1.csv').read)\n @same_two = DiscoveryCsv.new(hl7_csv_string: File.open('./test/unit/lib/hl7_test_data/discovery_same_2.csv').read)\n end",
"title": ""
},
{
"docid": "05717b01f5af1d969e14c94e50cf2435",
"score": "0.50422984",
"text": "def covered?; end",
"title": ""
},
{
"docid": "8002dd709cba4531107d8c00f51eb89d",
"score": "0.5034313",
"text": "def generate_alltestc\n\n end",
"title": ""
},
{
"docid": "1dee6400560f41232ff93946f5b55f4c",
"score": "0.5031888",
"text": "def initialize to_check, expected, label=nil, solution=nil, father_cat=nil\n @to_check=to_check\n @expected = expected\n @label = label\n @solution=solution\n @id = NumerationFactory.create father_cat\n @status= -1\n\n @father_cat = father_cat\n if father_cat != nil\n @display_offset=father_cat.display_offset+1\n else\n @display_offset=0\n end\n\n end",
"title": ""
},
{
"docid": "e54d501b1051d5962f49f1846855b8e5",
"score": "0.5028648",
"text": "def test_case_classes\n classes = self.test_cases.dup\n classes.collect do |file|\n actionscript_file_to_class_name(file)\n end\n end",
"title": ""
},
{
"docid": "428b5d1eaf9535043f41374ccd294f0d",
"score": "0.50238323",
"text": "def test_steps; end",
"title": ""
},
{
"docid": "428b5d1eaf9535043f41374ccd294f0d",
"score": "0.50238323",
"text": "def test_steps; end",
"title": ""
},
{
"docid": "a7dc9477f38c6de3634168d85e060ccf",
"score": "0.50216305",
"text": "def testCoverage4\n\t text1 = [\"He played the guitar.\"] \n text2 = [\"He played the flute.\"] \n text3 = [\"This is funny.\"]\n\t subm_text = Array.new\n subm_text << text1\n subm_text << text2\n subm_text << text3\n \n #setting up sentences and similarities before generation of clusters\n subm_sents = Array.new #Sentence[] s = new Sentence[2]; \n g = GraphGenerator.new\n g.generate_graph(subm_text[0], pos_tagger, core_NLP_tagger, false, false)\n subm_sents << Sentence.new(0, g.vertices, g.edges, g.num_vertices, g.num_edges)\n g.generate_graph(subm_text[1], pos_tagger, core_NLP_tagger, false, false)\n subm_sents << Sentence.new(1, g.vertices, g.edges, g.num_vertices, g.num_edges)\n g.generate_graph(subm_text[2], pos_tagger, core_NLP_tagger, false, false)\n subm_sents << Sentence.new(2, g.vertices, g.edges, g.num_vertices, g.num_edges)\n \n\t #calculating sentence similarity\n ssim = SentenceSimilarity.new\n #sentence similarity\n sent_sim = ssim.get_sentence_similarity(pos_tagger, subm_sents, speller)\n sent_list = ssim.sim_list\n sim_threshold = ssim.sim_threshold\n \n topic = Array.new\n topic << subm_sents[0]\n sentsToCover = Array.new\n sentsToCover << subm_sents[0]\n sentsToCover << subm_sents[1]\n sentsToCover << subm_sents[2]\n\t \n #identifying topic sentences\n tsent = TopicSentenceIdentification.new\n result = tsent.coverage(topic, 1, sentsToCover, sent_sim, 3)\n assert_equal(true, result)\n \n #change in sentence covered state\n assert_equal(true, subm_sents[0].flag_covered)\n assert_equal(true, subm_sents[1].flag_covered)\n assert_equal(false, subm_sents[2].flag_covered)\n end",
"title": ""
},
{
"docid": "a2182b4817dbc7fcf8e1fa5edbee4e4d",
"score": "0.50036776",
"text": "def test_coverage2\n\t text1 = [\"He played the guitar.\"] \n text2 = [\"This is funny.\"] \n text3 = [\"The fruit tastes fantastic.\"]\n\t subm_text = Array.new\n subm_text << text1\n subm_text << text2\n subm_text << text3\n \n #setting up sentences and similarities before generation of clusters\n subm_sents = Array.new #Sentence[] s = new Sentence[2]; \n g = GraphGenerator.new\n g.generate_graph(subm_text[0], pos_tagger, core_NLP_tagger, false, false)\n subm_sents << Sentence.new(0, g.vertices, g.edges, g.num_vertices, g.num_edges)\n g.generate_graph(subm_text[1], pos_tagger, core_NLP_tagger, false, false)\n subm_sents << Sentence.new(1, g.vertices, g.edges, g.num_vertices, g.num_edges)\n g.generate_graph(subm_text[2], pos_tagger, core_NLP_tagger, false, false)\n subm_sents << Sentence.new(2, g.vertices, g.edges, g.num_vertices, g.num_edges)\n\t #calculating sentence similarity\n ssim = SentenceSimilarity.new\n #sentence similarity\n sent_sim = ssim.get_sentence_similarity(pos_tagger, subm_sents, speller)\n sent_list = ssim.sim_list\n sim_threshold = ssim.sim_threshold \n \n topic = Array.new\n\t topic << subm_sents[0]\n sentsToCover = Array.new\n sentsToCover << subm_sents[1]\n sentsToCover << subm_sents[2]\n\t \n #identifying topic sentences\n tsent = TopicSentenceIdentification.new\n result = tsent.coverage(topic, 1, sentsToCover, sent_sim, 4) #setting edge similarity = 4 \n assert_equal(false, result)\n\t\t\t\n\t\t#change in sentence covered state\n assert_equal(false, subm_sents[0].flag_covered) #subm_sents[0] not among the sentences to be covered\n assert_equal(false, subm_sents[1].flag_covered)\n assert_equal(false, subm_sents[2].flag_covered)\n\tend",
"title": ""
},
{
"docid": "bb5e0dc5c258ffa86a333f10988ce683",
"score": "0.49909908",
"text": "def classificateResult(label, sampleMap, foundAllArr)\n puts \"[classificateResult] started label #{label}\"\n foundArr = foundAllArr.select{|found| matchLabels?(found.label, label)}\n expRecognitionResult = Spnt::Exp::Data::ExpRecognitionResult.new()\n expRecognitionResult.falseNegative = []\n expRecognitionResult.falsePostive = []\n #missed = sampleArr - foundArr\n #1 step. filter that was found and transform to array\n substituted = sampleMap.select{|ekey, sample|\n if(matchLabels?( label, sample.label))\n nil == foundArr.detect{|found| sample.ekey == found.ekey && found.shouldStart != @@UNDEFINED_CELL} \n end\n }.collect { |k, v| v }\n deleted =foundArr.select{|found|\n found.foundStart == nil || found.foundStart == @@UNDEFINED_CELL \n }\n inserted =foundArr.select{|found|\n found.shouldStart == nil || found.shouldStart == @@UNDEFINED_CELL \n }\n \n puts \"[classificateResult] %s substituted: %i\" % [label, substituted.length]\n puts \"[classificateResult] %s deleted: %i\" % [label, deleted.length]\n puts \"[classificateResult] %s inserted: %i\" % [label, inserted.length]\n\n expRecognitionResult.falseNegative = (expRecognitionResult.falseNegative << substituted).flatten\n expRecognitionResult.falseNegative = (expRecognitionResult.falseNegative << deleted).flatten\n expRecognitionResult.falsePostive = (expRecognitionResult.falsePostive << inserted).flatten\n \n puts \"[classificateResult] %s falseNegative: %i\" % [label, expRecognitionResult.falseNegative.length]\n puts \"[classificateResult] %s falsePostive: %i\" % [label, expRecognitionResult.falsePostive.length]\n\n\n puts \"[classificateResult]substituted: \" + substituted.collect{|v| \" %i => %s[%s]\" % [v.id, v.ekey, v.foundStart]}.join(\"; \")\n\n# foundDuplicates = {}\n# expRecognitionResult.correct = foundArr.select{|found|\n# sample = sampleMap[found.ekey]\n# if(sample != nil && matchLabels?( label, found.label))\n# if(found.foundStart == nil)\n# #puts \"[classificateResult]falseNegative [#{found.ekey}] no start: #{sample.shouldStart} #{found.foundStart}\"\n# expRecognitionResult.falseNegative << sample\n# false\n# else\n# absStartDelta = (sample.shouldStart - found.foundStart).abs\n# absEndDelta = (sample.shouldEnd - found.foundEnd).abs\n# matched = sample.ekey == found.ekey && absStartDelta <= @@thresholdStart && absEndDelta <= @@thresholdEnd\n# if matched == true\n# foundDuplicateElement = foundDuplicates[found.ekey]\n# if foundDuplicateElement == nil\n# foundDuplicateElement = []\n# foundDuplicates[found.ekey] = foundDuplicateElement\n# end\n# foundDuplicateElement << found\n# #puts \"foundDuplicates[#{sample.ekey}] #{foundDuplicates[sample.ekey].length} #{matched && foundDuplicates[sample.ekey].length == 1}\"\n# end\n# matched && foundDuplicates[sample.ekey].length == 1\n# end\n# else\n# false\n# end\n# }\n #expRecognitionResult.falsePostive = foundArr.select{|found| !expRecognitionResult.correct.include?(found) && !expRecognitionResult.falseNegative.include?(found)}\n# expRecognitionResult.correct = foundArr.select{|found|\n# expRecognitionResult.falsePostive.include?(found) && expRecognitionResult.falseNegative.include?(found)\n# }\n expRecognitionResult.correct = foundArr.to_set - expRecognitionResult.falsePostive.to_set - expRecognitionResult.falseNegative.to_set;\n puts \"falsePostive[#{expRecognitionResult.falsePostive.length}] + falseNegative[#{expRecognitionResult.falseNegative.length}]+correct[#{expRecognitionResult.correct.length}] = foundArr[#{foundArr.length}]\"\n expRecognitionResult\n end",
"title": ""
},
{
"docid": "0f63c0a49d2adbc88d92c1b58b88766b",
"score": "0.49906233",
"text": "def initTestDetails\n @Type = nil\n @ProductID = nil\n @ToolID = nil\n @ScriptID = nil\n @TestName = 'unknown'\n @InstallTest = nil\n\n # Get the ID of the test, based on its class name\n lClassName = self.class.name\n if (lClassName.match(/^WEACE::Test::Install::.*$/) != nil)\n @InstallTest = true\n if (lClassName.match(/^WEACE::Test::Install::Master::.*$/) != nil)\n @Type = 'Master'\n else\n @Type = 'Slave'\n end\n lMatchData = lClassName.match(/^WEACE::Test::Install::Slave::Adapters::(.*)::(.*)::(.*)$/)\n if (lMatchData == nil)\n lMatchData = lClassName.match(/^WEACE::Test::Install::.*::Adapters::(.*)::(.*)$/)\n if (lMatchData == nil)\n lMatchData = lClassName.match(/^WEACE::Test::Install::.*::Adapters::(.*)$/)\n if (lMatchData == nil)\n lMatchData = lClassName.match(/^WEACE::Test::Install::.*::Listeners::(.*)$/)\n if (lMatchData == nil)\n lMatchData = lClassName.match(/^WEACE::Test::Install::.*::Providers::(.*)$/)\n if (lMatchData == nil)\n log_debug \"Unable to parse test case name: #{lClassName}.\"\n else\n @ProductID = lMatchData[1]\n end\n else\n @ProductID = lMatchData[1]\n end\n else\n @ProductID = lMatchData[1]\n end\n else\n @ProductID, @ToolID = lMatchData[1..2]\n end\n else\n @ProductID, @ToolID, @ScriptID = lMatchData[1..3]\n end\n else\n @InstallTest = false\n if (lClassName.match(/^WEACE::Test::Master::.*$/) != nil)\n @Type = 'Master'\n else\n @Type = 'Slave'\n end\n lMatchData = lClassName.match(/^WEACE::Test::Slave::Adapters::(.*)::(.*)::(.*)$/)\n if (lMatchData == nil)\n lMatchData = lClassName.match(/^WEACE::Test::.*::Adapters::(.*)::(.*)$/)\n if (lMatchData == nil)\n lMatchData = lClassName.match(/^WEACE::Test::.*::Adapters::(.*)$/)\n if (lMatchData == nil)\n lMatchData = lClassName.match(/^WEACE::Test::.*::Listeners::(.*)$/)\n if (lMatchData == nil)\n lMatchData = lClassName.match(/^WEACE::Test::.*::Providers::(.*)$/)\n if (lMatchData == nil)\n log_debug \"Unable to parse test case name: #{lClassName}.\"\n else\n @ProductID = lMatchData[1]\n end\n else\n @ProductID = lMatchData[1]\n end\n else\n @ProductID = lMatchData[1]\n end\n else\n @ProductID, @ToolID = lMatchData[1..2]\n end\n else\n @ProductID, @ToolID, @ScriptID = lMatchData[1..3]\n end\n end\n end",
"title": ""
},
{
"docid": "b197becb424cd8c2b454c62ea77b4942",
"score": "0.49864933",
"text": "def test_fake_rubies_found\n\t\ttest_main = Main.new(3, 4, 6)\n\t\ttest_graph = Graph.new(10)\n\t\ttest_main.fake_rubies_found(7)\n\t\ttest_main.fake_rubies_found(7)\n\t\tassert test_main.num_fake_rubies, 14\n\tend",
"title": ""
},
{
"docid": "3894632ee0421fef3dba26467b521878",
"score": "0.4985439",
"text": "def standard_specs; end",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
"score": "0.4983707",
"text": "def specie; end",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
"score": "0.4983707",
"text": "def specie; end",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
"score": "0.4983707",
"text": "def specie; end",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
"score": "0.4983707",
"text": "def specie; end",
"title": ""
},
{
"docid": "2da277277c40c9ffb7a509e8c2dc5e73",
"score": "0.49804154",
"text": "def summarize_suite(suite, tests); end",
"title": ""
},
{
"docid": "2da277277c40c9ffb7a509e8c2dc5e73",
"score": "0.49804154",
"text": "def summarize_suite(suite, tests); end",
"title": ""
},
{
"docid": "8aaa58332e306a914612d8ba2814deb2",
"score": "0.4977043",
"text": "def pickUp(simulator)\n end",
"title": ""
},
{
"docid": "5a7620afe4dc43d6c86c4dbe5ff72fad",
"score": "0.49769583",
"text": "def test_specific_classes_methods\n # Get a line\n line = \"LINE1: This is a simple text to check the DataRecords class\\n\"\n assert_equal(line, @test_records[0].get_line)\n end",
"title": ""
},
{
"docid": "23140141dc659aeaa4dedfa5c9cc6377",
"score": "0.49688798",
"text": "def test_coverage3\n\t text1 = [\"He played the guitar.\"] \n text2 = [\"This is funny.\"] \n text3 = [\"He played the guitar.\"]\n\t subm_text = Array.new\n subm_text << text1\n subm_text << text2\n subm_text << text3\n \n #setting up sentences and similarities before generation of clusters\n subm_sents = Array.new #Sentence[] s = new Sentence[2]; \n g = GraphGenerator.new\n g.generate_graph(subm_text[0], pos_tagger, core_NLP_tagger, false, false)\n subm_sents << Sentence.new(0, g.vertices, g.edges, g.num_vertices, g.num_edges)\n g.generate_graph(subm_text[1], pos_tagger, core_NLP_tagger, false, false)\n subm_sents << Sentence.new(1, g.vertices, g.edges, g.num_vertices, g.num_edges)\n g.generate_graph(subm_text[2], pos_tagger, core_NLP_tagger, false, false)\n subm_sents << Sentence.new(2, g.vertices, g.edges, g.num_vertices, g.num_edges)\n \n\t #calculating sentence similarity\n ssim = SentenceSimilarity.new\n #sentence similarity\n sent_sim = ssim.get_sentence_similarity(pos_tagger, subm_sents, speller)\n sent_list = ssim.sim_list\n sim_threshold = ssim.sim_threshold\n\t \n topic = Array.new\n\t topic << subm_sents[0]\n sentsToCover = Array.new\n sentsToCover << subm_sents[0]\n sentsToCover << subm_sents[1]\n sentsToCover << subm_sents[2]\n\t \n #identifying topic sentences\n tsent = TopicSentenceIdentification.new\n result = tsent.coverage(topic, 1, sentsToCover, sent_sim, 6) #setting edge similarity = 4 \n assert_equal(true, result)\n\t\t\t\n\t #change in sentence covered state\n assert_equal(true, subm_sents[0].flag_covered)\n\t assert_equal(false, subm_sents[1].flag_covered)\n\t assert_equal(true, subm_sents[2].flag_covered)\n\tend",
"title": ""
},
{
"docid": "10809c6585f3f74041754b3d096c52ff",
"score": "0.49675888",
"text": "def generate_alltest\n\n end",
"title": ""
},
{
"docid": "7810871ad1b0979d8e798be009c77be5",
"score": "0.49672267",
"text": "def after_sclass(class_node); end",
"title": ""
},
{
"docid": "fe80bff100a90d97824c6dbc4e4d431b",
"score": "0.49624303",
"text": "def test_print_classes_plural\n\t\tassert_output(\"Driver 1 attended 4 classes!\\n\") { print_classes(4,1) }\n\tend",
"title": ""
},
{
"docid": "58fd5944114f5fd3b15023bb225d214b",
"score": "0.4950962",
"text": "def test_size\n @results.map {|node_name, classes|\n classes.size\n }.reduce(:+) || 0\n end",
"title": ""
},
{
"docid": "d4334c423d176d160d8041ba57a2c639",
"score": "0.49424398",
"text": "def klass; end",
"title": ""
},
{
"docid": "d4334c423d176d160d8041ba57a2c639",
"score": "0.49424398",
"text": "def klass; end",
"title": ""
},
{
"docid": "d4334c423d176d160d8041ba57a2c639",
"score": "0.49419343",
"text": "def klass; end",
"title": ""
},
{
"docid": "d4334c423d176d160d8041ba57a2c639",
"score": "0.49419343",
"text": "def klass; end",
"title": ""
},
{
"docid": "d4334c423d176d160d8041ba57a2c639",
"score": "0.49419343",
"text": "def klass; end",
"title": ""
},
{
"docid": "d4334c423d176d160d8041ba57a2c639",
"score": "0.49419343",
"text": "def klass; end",
"title": ""
},
{
"docid": "d4334c423d176d160d8041ba57a2c639",
"score": "0.49419343",
"text": "def klass; end",
"title": ""
},
{
"docid": "d4334c423d176d160d8041ba57a2c639",
"score": "0.49419343",
"text": "def klass; end",
"title": ""
},
{
"docid": "1f73d6443dd6c0e29bd826c85935431f",
"score": "0.4938428",
"text": "def required_class; end",
"title": ""
},
{
"docid": "a98f7b0ee41f4b308a2674c728a312db",
"score": "0.49362212",
"text": "def classify_image\n\n\t\trequire 'rubygems'\n\t\trequire 'RMagick'\n\t\trequire \"open-uri\"\n\n\t\timagelist = Magick::ImageList.new # not sure why using ImageList and not an Image, but thats the example. can try rewrite \n\t\turlimage = open(params[:url]) # Image URL \n\t\timagelist.from_blob(urlimage.read)\n\t\timage = imagelist.cur_image\n\n\tputs \"image opened, color coding\"\n\n\t\tcolorcodes = {\n\t\t\t:red => [255,0,0],\n\t\t\t:green => [0,255,0],\n\t\t\t:blue => [0,0,255],\n\t\t\t:yellow => [255,255,0],\n\t\t}\n\t\t@colors = {}\n\t\t@classmodel = ClassModel.find params[:classmodel]\n\t\tclassnames = @classmodel.classnames.split(',') # user-supplied classes; \n\t\tclassnames.each_with_index do |classname,index|\n\t\t\t@colors[classname] = colorcodes.to_a[index]\n\t\tend\n\n\tputs \"assembling classes\"\n\n\t\tclasses = ClassModel.find(params[:classmodel]).to_hash\n\n\tputs \"parsing pixels and writing new pixels\"\n\n\t\t@percentages = {}\n\t\tclasses.each do |classname,classbands|\n\t\t\t@percentages[classname] = 0\n\t\tend\n\n\t\t# this can also surely be more efficient, look at: http://www.simplesystems.org/RMagick/doc/image2.html#import_pixels\n\t\t(0..image.columns-1).each do |x|\n\t\t\t(0..image.rows-1).each do |y|\n\t\t\t\t# classify the pixel\n\t\t\t\t# first, extract a JSON string of the colors... inefficient but a start:\n\t\t\t\ta = image.export_pixels(x, y, 1, 1, \"RGB\");\n\t\t\t\tpixel_string = {\"red\" => a[0]/255,\"green\" => a[1]/255,\"blue\" => a[2]/255} # MaxRGB is 255^2\n\t\t\t\t\t#puts pixel_string\n\t\t\t\tclosest = CartesianClassifier.closest_hash(pixel_string,classes)\n\t\t\t\t\t#puts closest\n\t\t\t\t@percentages[closest] += 1\n\t\t\t\t# match the resulting class to a color and write to a pixel\n\t\t\t\ta = colorcodes[@colors[closest][0]].map { |c| c*255 } #MaxRGB is 255^2\n\t\t\t\timage.import_pixels(x, y, 1, 1, \"RGB\", a);\n\t\t\tend\n\t\tend\n\n\t\t@percentages.each do |key,value|\n\t\t\t@percentages[key] = (100*((1.00 * value) / (image.rows*image.columns))).to_i\n\t\tend\n\n\t\trespond_to do |format|\n\t\t\tformat.html { \n\t\t\t\t@b64 = Base64.encode64(image.to_blob)\n\t\t\t}\n\t\t\tformat.png { \n\t\t\t\theaders['Content-Type'] = 'image/png'\n\t\t\t\theaders['Cache-Control'] = 'public'\n\t\t\t\theaders['Expires'] = 'Mon, 28 Jul 2020 23:30:00 GMT'\n\t\t\t\trender :text => image.to_blob\n\t\t\t}\n\t\tend\n\tend",
"title": ""
},
{
"docid": "3f280c87fe3f8e9fdf293a6a5315df33",
"score": "0.4930827",
"text": "def test_step; end",
"title": ""
},
{
"docid": "742ec5de2cf3e5ff849c0230536b0506",
"score": "0.4926609",
"text": "def test_acts_of_homonymy\n create_some_test_data\n assert_equal 0, @s1.acts_of_homonymy_for_ref.size \n assert_equal 1, @s5.acts_of_homonymy_for_ref.size\n assert_equal [[@ontology_classes[3], @ontology_classes[4]]], @s5.acts_of_homonymy_for_ref\n end",
"title": ""
},
{
"docid": "0aed0cd58e0b294727b11832e1f69b89",
"score": "0.49157512",
"text": "def adaClassify(datToClass,classifierArr)\n m = shape(datToClass)[0]\n aggClassEst = zeros(m,0)\n len(classifierArr).times do |i|\n classEst = stumpClassify(datToClass,\n classifierArr[i]['dim'], \n classifierArr[i]['thresh'], \n classifierArr[i]['ineq'])#call stump classify\n # aggClassEst += classifierArr[i]['alpha']*classEst\n aggClassEst.plus!(classEst.multi(classifierArr[i]['alpha']))\n end\n return sign(aggClassEst)\n end",
"title": ""
},
{
"docid": "5d170e25bd9fad3db882e972897e9b06",
"score": "0.49113148",
"text": "def classificateResultByLabel(sampleMap, foundArr)\n labelArr = []\n sampleMap.each{|key,value|\n labelArr << value.label\n }\n labelArr = labelArr.uniq()\n expRecognitionResultMap = {}\n labelArr.each{|label|\n puts \"[classificateResultByLabel] label: %s\" % label\n expRecognitionResultMap[label]= classificateResult(label,sampleMap,foundArr);\n }\n expRecognitionResultMap\n end",
"title": ""
},
{
"docid": "2e8f8302673bd148d1f713c3eb4bc16e",
"score": "0.4907139",
"text": "def to_spec\n classifier ? \"#{group}:#{id}:#{type}:#{classifier}:#{version}\" : \"#{group}:#{id}:#{type}:#{version}\"\n end",
"title": ""
},
{
"docid": "6f127d617ee5a4bc1ec102d5d779537e",
"score": "0.4899274",
"text": "def test_class_autoloading\n return unless Cell.engines_available?\n Dependencies.log_activity = true\n\n assert UnknownCell.new(@controller, nil)\n\n\n assert_kind_of Module, ReallyModule\n assert_kind_of Class, ReallyModule::NestedCell\n #Really::NestedCell.new(@controller, nil)\n end",
"title": ""
},
{
"docid": "62ea357a7c612b207d4180f527c7f779",
"score": "0.48949254",
"text": "def test_object_codes\n narr = narratives(:first)\n assert narr.clinical_objects == []\n narr = narratives(:second)\n objs = narr.clinical_objects(true)\n assert objs[0].name == \"risperidone 2mg tab\"\n assert objs[0].code_class == Drug\n assert objs[1].name == \"yellow fever\"\n assert objs[1].code_class == Diagnosis\n end",
"title": ""
},
{
"docid": "dd18d3b18bb52ded7c10e2a67cb28dbb",
"score": "0.4891067",
"text": "def test_listchunk_attributes\n\t\t\n\tend",
"title": ""
},
{
"docid": "8edd6d797e58fbfb3085bb65a1d19ca3",
"score": "0.48889002",
"text": "def test_coverage1\n\t text1 = [\"He played the guitar.\"] \n text2 = [\"This is funny.\"] \n text3 = [\"The fruit tastes fantastic.\"]\n\t subm_text = Array.new\n subm_text << text1\n subm_text << text2\n subm_text << text3\n \n #setting up sentences and similarities before generation of clusters\n subm_sents = Array.new #Sentence[] s = new Sentence[2]; \n g = GraphGenerator.new\n g.generate_graph(subm_text[0], pos_tagger, core_NLP_tagger, false, false)\n subm_sents << Sentence.new(0, g.vertices, g.edges, g.num_vertices, g.num_edges)\n g.generate_graph(subm_text[1], pos_tagger, core_NLP_tagger, false, false)\n subm_sents << Sentence.new(1, g.vertices, g.edges, g.num_vertices, g.num_edges)\n g.generate_graph(subm_text[2], pos_tagger, core_NLP_tagger, false, false)\n subm_sents << Sentence.new(2, g.vertices, g.edges, g.num_vertices, g.num_edges)\n \n\t #calculating sentence similarity\n ssim = SentenceSimilarity.new\n #sentence similarity\n sent_sim = ssim.get_sentence_similarity(pos_tagger, subm_sents, speller)\n sent_list = ssim.sim_list\n sim_threshold = ssim.sim_threshold\n \n cg = ClusterGeneration.new\n #cluster creation \n result = cg.generate_clusters(subm_sents, sent_sim, sent_list, sim_threshold)\n #2 clusters are created\n\t \n topic = Array.new\n\t topic << subm_sents[0]\n\t sentsToCover = Array.new\n sentsToCover << subm_sents[1]\n\t sentsToCover << subm_sents[2]\n\t \n #identifying topic sentences\n tsent = TopicSentenceIdentification.new\n result = tsent.coverage(topic, 1, sentsToCover, sent_sim, 4) #setting edge similarity = 4 \n assert_equal(false, result)\n\t\t\t\n\t\t#change in sentence covered state\n\t\tassert_equal(false, subm_sents[0].flag_covered)\n\t\tassert_equal(false, subm_sents[1].flag_covered)\n\t\tassert_equal(false, subm_sents[2].flag_covered)\n\tend",
"title": ""
},
{
"docid": "b7b3c67478dee78d33602b4b887ad641",
"score": "0.48819742",
"text": "def evaluate_macro(predicted_class, actual_class)\n # Since this is macro, figoure out what the real\n # class is we should be looking at\n# puts \"Params: #{predicted_class}, #{actual_class}\"\n# puts \"Actual class: #{actual_class}, Class 0: #{@classes.to_a[0][0]}\"\n if actual_class == @classes.to_a[0][0] then\n# puts \"They match\"\n if predicted_class == @classes.to_a[0][0] then\n if predicted_class == actual_class then @confusion_matrix_c1['TP'] += 1 end\n if predicted_class != actual_class then @confusion_matrix_c1['FN'] += 1 end\n else\n if predicted_class == actual_class then @confusion_matrix_c1['FP'] += 1 end\n if predicted_class != actual_class then @confusion_matrix_c1['TN'] += 1 end\n end\n else\n# puts \"They DONT match\"\n if predicted_class == @classes.to_a[0][0] then\n if predicted_class == actual_class then @confusion_matrix_c2['TP'] += 1 end\n if predicted_class != actual_class then @confusion_matrix_c2['FN'] += 1 end\n else\n if predicted_class == actual_class then @confusion_matrix_c2['FP'] += 1 end\n if predicted_class != actual_class then @confusion_matrix_c2['TN'] += 1 end\n end\n end\n end",
"title": ""
},
{
"docid": "7ceda374b6d0d9ff2d06f91d53c096c4",
"score": "0.48812208",
"text": "def test_scenario7\n\n data = [[File.dirname(__FILE__)+'/data/iris.csv', {\"petal length\" => 2.46}, 'Iris-versicolor', \"probability\", \"000004\"],\n [File.dirname(__FILE__)+'/data/iris.csv', {\"petal length\" => 2}, 'Iris-setosa', \"probability\", \"000004\"],\n [File.dirname(__FILE__)+'/data/iris.csv', {\"petal length\" => 2.46}, 'Iris-versicolor', \"confidence\", \"000004\"],\n [File.dirname(__FILE__)+'/data/iris.csv', {\"petal length\" => 2}, 'Iris-setosa', \"confidence\", \"000004\"],\n [File.dirname(__FILE__)+'/data/iris.csv', {\"petal length\" => 2.46}, 'Iris-versicolor', \"votes\", \"000004\"],\n [File.dirname(__FILE__)+'/data/iris.csv', {\"petal length\" => 1}, 'Iris-setosa', \"votes\", \"000004\"]\n ]\n puts\n puts \"Successfully comparing predictions in operating points for ensembles\"\n\n data.each do |filename, data_input, prediction_result, operating_kind, objective|\n puts\n puts \"Given I create a data source uploading a <%s> file\" % filename\n source = @api.create_source(filename, {'name'=> 'source_test', 'project'=> @project[\"resource\"]})\n\n puts \"And I wait until the source is ready\"\n assert_equal(BigML::HTTP_CREATED, source[\"code\"])\n assert_equal(1, source[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(source), true)\n \n puts \"And I create a dataset\"\n dataset=@api.create_dataset(source)\n\n puts \"And I wait until the dataset is ready\"\n assert_equal(BigML::HTTP_CREATED, dataset[\"code\"])\n assert_equal(1, dataset[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(dataset), true)\n \n puts \"And I create an ensemble\"\n ensemble = @api.create_ensemble(dataset, {\"number_of_models\"=> 2, \"seed\" => 'BigML', 'ensemble_sample'=>{'rate' => 0.7, 'seed' => 'BigML'}, 'missing_splits' => false})\n \n puts \"And I wait until the ensemble is ready\"\n assert_equal(BigML::HTTP_CREATED, ensemble[\"code\"])\n assert_equal(1, ensemble[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(ensemble), true)\n \n puts \"And I create a local ensemble\"\n local_ensemble = BigML::Ensemble.new(ensemble, @api)\n local_model = BigML::Model.new(local_ensemble.model_ids[0], @api)\n \n puts \"When I create a prediction for <%s>\" % [JSON.generate(data_input)]\n prediction = @api.create_prediction(ensemble['resource'], data_input, {\"operating_kind\" => operating_kind})\n \n assert_equal(BigML::HTTP_CREATED, prediction[\"code\"])\n assert_equal(@api.ok(prediction), true)\n\n puts \"Then the prediction for <%s> is <%s>\" % [objective, prediction_result]\n \n if !prediction['object']['prediction'][objective].is_a?(String)\n assert_equal(prediction['object']['prediction'][objective].to_f.round(5), prediction_result.to_f.round(5))\n else\n assert_equal(prediction['object']['prediction'][objective], prediction_result)\n end \n \n puts \"And I create a local prediction for <%s>\" % JSON.generate(data_input)\n local_prediction = local_ensemble.predict(data_input, {\"operating_kind\" => operating_kind})\n \n puts \"Then the local prediction is <%s>\" % prediction_result\n \n if local_prediction.is_a?(Array)\n local_prediction = local_prediction[0]\n elsif local_prediction.is_a?(Hash)\n local_prediction = local_prediction['prediction']\n else\n local_prediction = local_prediction\n end \n \n if (local_ensemble.regression) or \n (local_ensemble.is_a?(BigML::MultiModel) and local_ensemble.models[0].regression)\n assert_equal(local_prediction.to_f.round(4), prediction_result.to_f.round(4))\n else\n assert_equal(local_prediction, prediction_result)\n end \n \n end\n end",
"title": ""
},
{
"docid": "12fb31304fe5919c81ce47c1a707408b",
"score": "0.4876446",
"text": "def confidence; end",
"title": ""
},
{
"docid": "8f5a5aaf0e324222d4ce0ac0697765d8",
"score": "0.48700982",
"text": "def classify(commit)\n @classifier.classify(commit)\n end",
"title": ""
},
{
"docid": "08ff550dd0501741f4365bdea500b463",
"score": "0.48674458",
"text": "def covered_percentages; end",
"title": ""
},
{
"docid": "5dda87ca97fb0fd65efde344af7c9e1a",
"score": "0.48623997",
"text": "def test_it_has_skills\n# skip\n# student = Student.new(\"Phil\", has_laptop = true, has_cookies = true)\n assert_equal [\"Typing\", \"Talking\"], @student.skills\n end",
"title": ""
},
{
"docid": "4f8723aac0e956898fb9427ff3bf9c3d",
"score": "0.48622477",
"text": "def test_print_items_classes\r\n\t\tmock_argv = [666]\r\n\t\tARGV.replace(mock_argv)\r\n\t\trequire_relative 'city_sim_9006'\r\n\t\tprng = Random.new((ARGV[0]))\r\n\t\toakland = City::new\r\n\t\tgame = CitySim::new\r\n\t\tall_drivers = [d1 = Driver.new(1), d2 = Driver.new(2), d3 = Driver.new(3)]\r\n\t\tnum_starting_locs = oakland.all_locations.length\r\n\t\tnum_options = 2\r\n\t\tall_items = stfu do game.run_sim(all_drivers, oakland, prng, num_starting_locs, num_options) end\r\n\t\tassert_equal all_items[2].num_classes, 16\r\n\tend",
"title": ""
},
{
"docid": "a154554040e3cd64e5f7905dae6103e0",
"score": "0.48590094",
"text": "def test_introspects_properly\n i = Tracksperanto::Import::Syntheyes\n assert_equal 'Syntheyes \"Tracker 2-D paths\" file', i.human_name\n assert !i.autodetects_size?\n assert_not_nil i.known_snags\n assert !i.known_snags.empty?\n end",
"title": ""
},
{
"docid": "6bef18212c963d3575d09733bb1ae956",
"score": "0.48586774",
"text": "def patch_class!(klass)\n klass.class_eval do\n #\n # Make the check status accessible as a reader method.\n #\n attr_reader :status\n\n #\n # Patch the output method so it returns the output string instead of\n # sending it to stdout.\n #\n def output(msg = @message)\n @output ||= self.class.check_name + (msg ? \": #{msg}\" : '')\n end\n end\n end",
"title": ""
},
{
"docid": "939bebfe2a973880d301ca243865da03",
"score": "0.48582485",
"text": "def test_associations\n\t\tassert check_associations(DocImage)\n\tend",
"title": ""
},
{
"docid": "c9070f97a40b86b924206f9822462578",
"score": "0.48557377",
"text": "def classifier_from_training( filename )\n classifier = Weka::Classifiers::Meta::AdaBoostM1.new # \n \n # http://weka.sourceforge.net/doc.dev/\n\n # java.lang.String[-P, 100, -S, 1, -I, 10, -W, weka.classifiers.trees.DecisionStump]@28c88600\n\n classifier.use_options(\"-I 100 -S #{ (rand * 10).floor }\")\n #\n # Valid options are:\n # -P <num> Percentage of weight mass to base training on.\n # (default 100, reduce to around 90 speed up)\n # -Q Use resampling for boosting.\n # -S <num> Random number seed. (default 1)\n # -I <num> Number of iterations. (default 10)\n # -D If set, classifier is run in debug mode and may output additional info to the console\n # -W Full name of base classifier. (default: weka.classifiers.trees.DecisionStump)\n #\n # Options specific to classifier weka.classifiers.trees.DecisionStump:\n #\n # -D If set, classifier is run in debug mode and may output additional info to the console\n #\n # raise classifier.getOptions.inspect # -I, 100, -K, 0, -S, 1, -num-slots, 1\n training_instances = Weka::Core::Instances.from_arff( filename )\n training_instances.class_attribute = :outcome\n classifier.train_with_instances(training_instances)\nend",
"title": ""
},
{
"docid": "28443d7446e723ca05cb94a5c3ebb324",
"score": "0.4853018",
"text": "def class_name; end",
"title": ""
},
{
"docid": "28443d7446e723ca05cb94a5c3ebb324",
"score": "0.4853018",
"text": "def class_name; end",
"title": ""
}
] |
fbc797d92626ea2de9485b2e6886e838
|
Case 6: pass a hash container get key/value
|
[
{
"docid": "558849123b3730a9317d3e85ca87d139",
"score": "0.0",
"text": "def a_method_block_with_arguments2(&block)\n some_hash = {}\n status = block.call('Hello', some_hash) if block\n dump_object(some_hash)\n dump_object(status)\nend",
"title": ""
}
] |
[
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.6912697",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.6912697",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.6912697",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.6912697",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.6912697",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.6912697",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.6912697",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.6912697",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.6912697",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.6912697",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.6912697",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.6912697",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.6912697",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.6912697",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.6912697",
"text": "def get(key); end",
"title": ""
},
{
"docid": "0beec143c2fe15a789fbc7b8f5242ddb",
"score": "0.66357774",
"text": "def hashvalue\r\n return @key.hashvalue\r\n end",
"title": ""
},
{
"docid": "a1793224bebc92517e922a6cc77b4cc8",
"score": "0.66307503",
"text": "def hash\n values[:hash]\n end",
"title": ""
},
{
"docid": "03ba0f1597c72b72b85acb6dfa00d88b",
"score": "0.65951693",
"text": "def get_hash_value(key, hsh)\n if hsh[key]\n # if key is found return value\n #puts \"return hsh[key]\" + hsh[key]\n return hsh[key]\n else\n # else check values for class type of Hash and recurse\n hsh.each_value do |value|\n #puts \"value\" + value.to_s\n if value.class == HashWithIndifferentAccess\n ts = get_hash_value(key, value)\n #puts \"ts\" + ts\n return ts if ts\n end\n end\n end\n return nil\n end",
"title": ""
},
{
"docid": "00c00945622fcfe6540a7d7112637670",
"score": "0.65825564",
"text": "def hvals(key); end",
"title": ""
},
{
"docid": "00c00945622fcfe6540a7d7112637670",
"score": "0.65825564",
"text": "def hvals(key); end",
"title": ""
},
{
"docid": "e25d8411b07de446f47b596a5e0fc6b9",
"score": "0.65231377",
"text": "def get(key)\n \n end",
"title": ""
},
{
"docid": "e25d8411b07de446f47b596a5e0fc6b9",
"score": "0.65231377",
"text": "def get(key)\n \n end",
"title": ""
},
{
"docid": "e25d8411b07de446f47b596a5e0fc6b9",
"score": "0.65231377",
"text": "def get(key)\n \n end",
"title": ""
},
{
"docid": "e25d8411b07de446f47b596a5e0fc6b9",
"score": "0.65231377",
"text": "def get(key)\n \n end",
"title": ""
},
{
"docid": "fe3e21ec5a40a4a0c04d46896f589c7a",
"score": "0.65156186",
"text": "def hget(key, field); end",
"title": ""
},
{
"docid": "fe3e21ec5a40a4a0c04d46896f589c7a",
"score": "0.65156186",
"text": "def hget(key, field); end",
"title": ""
},
{
"docid": "64dd3332df7e827fe8a0dd3368ae1acf",
"score": "0.64857596",
"text": "def mapped_hmget(key, *fields); end",
"title": ""
},
{
"docid": "fc36bd52343518b02c1f971d858c03c2",
"score": "0.6473238",
"text": "def puts_value hashed\n hashed.value.each do |keyed|\n puts keyed\n end\nend",
"title": ""
},
{
"docid": "14185638016c7cf98755c7235008f42b",
"score": "0.64516026",
"text": "def getset(key, value); end",
"title": ""
},
{
"docid": "14185638016c7cf98755c7235008f42b",
"score": "0.64516026",
"text": "def getset(key, value); end",
"title": ""
},
{
"docid": "3f4bca582bc30fa9943f831bcc3ba508",
"score": "0.64467055",
"text": "def hmget(key, *fields); end",
"title": ""
},
{
"docid": "c2fa704abdbcec3a02b87b3c5806cefe",
"score": "0.6397269",
"text": "def get(key)\n\n end",
"title": ""
},
{
"docid": "3978b80c5b2238a81f47c40db746f6d4",
"score": "0.63871676",
"text": "def hashValue()\n return @key.hashValue()\n end",
"title": ""
},
{
"docid": "76c4603d6d879d8d9da14605859d6576",
"score": "0.6387059",
"text": "def display_value(hash)\n puts hash[:key]\nend",
"title": ""
},
{
"docid": "bbb6517edf3cb64fe5eaf87056c483b8",
"score": "0.63603604",
"text": "def select_fruit2(hash, argument)\n keychain = hash.keys\n valuechain = hash.values\n counter = 0 \n newhash = {}\n\n loop do \n break if counter > keychain.size\n current_key = keychain[counter]\n current_value = hash[current_key]\n if current_value == argument\n newhash[current_key] = current_value\n end \n counter += 1\n end\n return newhash\nend",
"title": ""
},
{
"docid": "d68e026a026fd611f97838a8e2056f83",
"score": "0.6342231",
"text": "def [] key; @hash[key] end",
"title": ""
},
{
"docid": "7c8c745f317c39bfe0856b1be7ede694",
"score": "0.6336979",
"text": "def [](k); @hash[k]; end",
"title": ""
},
{
"docid": "95bd1d9a3c9f4e9821762baf565c51b8",
"score": "0.633646",
"text": "def fetch(key); end",
"title": ""
},
{
"docid": "c7b1d21dddb331482a5b2b15077d8280",
"score": "0.6318713",
"text": "def []( key ) @h[to_key(key)] end",
"title": ""
},
{
"docid": "62d35db30564b3a2fe78bea8f90c5261",
"score": "0.6307805",
"text": "def get_hash_key(hash)\n val = []\n hash.each_key do |value|\n val << value\n end\n val\nend",
"title": ""
},
{
"docid": "b9359c22eb30dce2b7bd5c79a3f01e41",
"score": "0.6294561",
"text": "def [](key)\n value[key.to_s] if value.is_a?(Hash)\n end",
"title": ""
},
{
"docid": "a27feda8e7bae34606cf8c1b7840ed1e",
"score": "0.6272487",
"text": "def key(value); end",
"title": ""
},
{
"docid": "a27feda8e7bae34606cf8c1b7840ed1e",
"score": "0.6272487",
"text": "def key(value); end",
"title": ""
},
{
"docid": "a27feda8e7bae34606cf8c1b7840ed1e",
"score": "0.6272487",
"text": "def key(value); end",
"title": ""
},
{
"docid": "fa0f0a45afdd20bc38c078e3187465ee",
"score": "0.6253621",
"text": "def extract_hash_pair(node, key); end",
"title": ""
},
{
"docid": "18c3173c014c07423bf8030608cc6392",
"score": "0.6244386",
"text": "def hmget(key, *fields, &blk); end",
"title": ""
},
{
"docid": "47c8c11b9131e2a0637a0e5e151be5e3",
"score": "0.62407523",
"text": "def my_hash_finding_method(hash_collection, age)\n pet_is_age = []\n hash_collection.each do |key,value|\n if value == age\n pet_is_age.push(key)\n end\n end\n p pet_is_age\nend",
"title": ""
},
{
"docid": "47c8c11b9131e2a0637a0e5e151be5e3",
"score": "0.62407523",
"text": "def my_hash_finding_method(hash_collection, age)\n pet_is_age = []\n hash_collection.each do |key,value|\n if value == age\n pet_is_age.push(key)\n end\n end\n p pet_is_age\nend",
"title": ""
},
{
"docid": "58863a6e25c04653699a7278bff8e82a",
"score": "0.6226102",
"text": "def get(key)\n \n end",
"title": ""
},
{
"docid": "b0d255a650c97925c9973382acd10b92",
"score": "0.6211293",
"text": "def get_value(hash, &fn)\n value = if hash.respond_to?(:dig)\n hash.dig(*@paths)\n else\n new_hash = hash\n @paths.each { |s| new_hash = new_hash[s] }\n new_hash\n end\n\n block_given? ? fn[value] : value\n end",
"title": ""
},
{
"docid": "1342df4594ed2c34a08be02e2efb6abf",
"score": "0.62074685",
"text": "def fetch(*key); end",
"title": ""
},
{
"docid": "d87c5943b630b7a0c3a269f1501d790c",
"score": "0.6196068",
"text": "def []( *key )\r\n if Hash === @value\r\n v = @value.detect { |k,v| k.transform == key.first }\r\n v[1] if v\r\n elsif Array === @value\r\n @value.[]( *key )\r\n end\r\n end",
"title": ""
},
{
"docid": "37a2ed2b111039a3838d19f46b6641cd",
"score": "0.6176499",
"text": "def extract_hash(collection_name, key_name, value_name)\n handling_cf_errors do\n {}.tap do |result|\n cf_stack.public_send(collection_name).each do |item|\n key = item.public_send(key_name)\n value = item.public_send(value_name)\n result[key] = value\n end\n end\n end\n end",
"title": ""
},
{
"docid": "e0831fc37afdaf07584fa6e0ab03c2c2",
"score": "0.61762005",
"text": "def result\n @key.nil? ? @hash : @hash[@key]\n end",
"title": ""
},
{
"docid": "d44d966b9f5d75692f204033f9d5c8aa",
"score": "0.61412096",
"text": "def hash_fetch(input, hash)\n input.map { |k| hash.fetch(k, nil) }\n end",
"title": ""
},
{
"docid": "84f74a35cb6c1f3e9a0516a5993742a1",
"score": "0.61371815",
"text": "def result_key_for(value); end",
"title": ""
},
{
"docid": "73c66a5cca3f1c52f1ec548863fce49b",
"score": "0.6136739",
"text": "def get_city_name(somehash, value)\n # Write code here\n somehash.key(value)\nend",
"title": ""
},
{
"docid": "9031460f18db66fd8a4f6da4b3ffb77f",
"score": "0.61354005",
"text": "def test_get\n @table.add(IntHash.new(2))\n @table.add(IntHash.new(7))\n @table.add(StringHash.new(\"char\"))\n assert_equal(@table.get(IntHash.new(7)), IntHash.new(7))\n assert_equal(@table.get(StringHash.new(\"char\")), StringHash.new(\"char\"))\n end",
"title": ""
},
{
"docid": "79f1507f3de441679ea44f0a69f4c47a",
"score": "0.6130996",
"text": "def retrieve_values(hash1,hash2,key)\n return [hash1[key],hash2[key]]\nend",
"title": ""
},
{
"docid": "a6884a93e62d2ea3a4d7348cbbb62051",
"score": "0.6115805",
"text": "def retrieve(hash, *args)\n valids = [::Hash, hash.is_a?(Class) ? hash : hash.class]\n args.flatten.inject(hash) do |memo, key|\n break unless valids.detect{ |valid_type|\n memo.is_a?(valid_type) || memo == valid_type\n }\n memo[key.to_s] || memo[key.to_sym] || break\n end\n end",
"title": ""
},
{
"docid": "90c9b1366b8dacfaa40c4d43752dc527",
"score": "0.6096436",
"text": "def [](key)\n hash[key]\n end",
"title": ""
},
{
"docid": "90c9b1366b8dacfaa40c4d43752dc527",
"score": "0.6096436",
"text": "def [](key)\n hash[key]\n end",
"title": ""
},
{
"docid": "90c9b1366b8dacfaa40c4d43752dc527",
"score": "0.6096436",
"text": "def [](key)\n hash[key]\n end",
"title": ""
},
{
"docid": "ea9b445194c6917f81058d750ee13c0f",
"score": "0.6077237",
"text": "def find_value(contact, key_hash)\n\n\tend",
"title": ""
},
{
"docid": "3e48d78391045e8a0e2eb05680f1bcb2",
"score": "0.6076608",
"text": "def hash\n @hash_value\n end",
"title": ""
},
{
"docid": "e8715e7da5bf99ca2bb46051034fa361",
"score": "0.60746247",
"text": "def fetch\n value_of @key\n end",
"title": ""
},
{
"docid": "840d91338bde5fe50795bc54fea8b9b1",
"score": "0.6071551",
"text": "def get_value(index, value)\n\t\t\t\t\tindex = index.is_a?(Array) ? index : [index]\n\t\t\t\t\tkey = index.shift.to_sym\n\t\t\t\t\tvalue.is_a?(Hash) and value[key] and value[key].is_a?(Hash) ?\n\t\t\t\t\tget_value(index, value[key]) :\n\t\t\t\t\tvalue[key]\n\t\t\t\tend",
"title": ""
},
{
"docid": "c03201cb5c1703e856e17f4e39173d09",
"score": "0.60705817",
"text": "def get(key)\r\n \r\n end",
"title": ""
},
{
"docid": "029366622e3d38c0e6c1caff5f2e3633",
"score": "0.6067744",
"text": "def get(key)\n @hash[key]\n end",
"title": ""
},
{
"docid": "72edbef5e847bd30dfab472f2b35ecc9",
"score": "0.60572577",
"text": "def get_value(index, value)\n index = index.is_a?(Array) ? index : [index]\n key = index.shift.to_sym\n value.is_a?(Hash) and value[key] and value[key].is_a?(Hash) ?\n get_value(index, value[key]) :\n value[key]\n end",
"title": ""
},
{
"docid": "72edbef5e847bd30dfab472f2b35ecc9",
"score": "0.60572577",
"text": "def get_value(index, value)\n index = index.is_a?(Array) ? index : [index]\n key = index.shift.to_sym\n value.is_a?(Hash) and value[key] and value[key].is_a?(Hash) ?\n get_value(index, value[key]) :\n value[key]\n end",
"title": ""
},
{
"docid": "72edbef5e847bd30dfab472f2b35ecc9",
"score": "0.60572577",
"text": "def get_value(index, value)\n index = index.is_a?(Array) ? index : [index]\n key = index.shift.to_sym\n value.is_a?(Hash) and value[key] and value[key].is_a?(Hash) ?\n get_value(index, value[key]) :\n value[key]\n end",
"title": ""
},
{
"docid": "72edbef5e847bd30dfab472f2b35ecc9",
"score": "0.60572577",
"text": "def get_value(index, value)\n index = index.is_a?(Array) ? index : [index]\n key = index.shift.to_sym\n value.is_a?(Hash) and value[key] and value[key].is_a?(Hash) ?\n get_value(index, value[key]) :\n value[key]\n end",
"title": ""
},
{
"docid": "c4307ad9a8dae5896e869d6d04e0426d",
"score": "0.60572535",
"text": "def retrieve_values(hash1, hash2, key)\n val1 = hash1[key]\n val2 = hash2[key]\n return [val1, val2]\nend",
"title": ""
},
{
"docid": "68027526fb2c4dc112d021b51b63958b",
"score": "0.60524774",
"text": "def metodo(hash, key)\n\thash[key]\nend",
"title": ""
},
{
"docid": "cd240dcd862f082116d530987975caa1",
"score": "0.60389394",
"text": "def get_hash_value_from_array(keys, hsh)\n keys.each {|k| return hsh[k] if hsh[k]}\n hsh.each_value do |value|\n if value.class == HashWithIndifferentAccess\n ts = get_hash_value_from_array(keys, value)\n return ts if ts\n end\n end\n return nil\n end",
"title": ""
},
{
"docid": "06b6edb14a34ee17759d9ccce56c685f",
"score": "0.6020598",
"text": "def get_key(key)\nend",
"title": ""
},
{
"docid": "06b6edb14a34ee17759d9ccce56c685f",
"score": "0.6020598",
"text": "def get_key(key)\nend",
"title": ""
},
{
"docid": "15f6402e1cfc035b5b1dc85d7de531b9",
"score": "0.60119724",
"text": "def get_value(index, value)\n index = index.is_a?(Array) ? index : [index]\n key = index.shift.to_sym\n value.is_a?(Hash) and value[key] and value[key].is_a?(Hash) ?\n get_value(index, value[key]) :\n value[key]\n end",
"title": ""
},
{
"docid": "0efc33cf18bcedff4c20f96e9d5d65c5",
"score": "0.6009503",
"text": "def _calc_hash(value)\n value.hash\nend",
"title": ""
},
{
"docid": "acfaf2975bf7642314beaef183589824",
"score": "0.6008025",
"text": "def extract(key)\n ->(h) { h[key] }\n end",
"title": ""
},
{
"docid": "af32cacd1bc91e56f54c6c23b4cd1c94",
"score": "0.60029024",
"text": "def hash\n value.hash\n end",
"title": ""
},
{
"docid": "9ad07f4403f14a42b250a05dc9a00a35",
"score": "0.6001297",
"text": "def [](key)\n @lookup[key].value\n end",
"title": ""
},
{
"docid": "ab01477f8141764d46d4f5feee1b5f11",
"score": "0.59927255",
"text": "def [](id_or_value)\n fetch(id_or_value) { key(id_or_value) }\n end",
"title": ""
},
{
"docid": "318d8a08f8b4b47547b03a39738c7fa3",
"score": "0.5988263",
"text": "def get(key)\n # YOUR WORK HERE\n end",
"title": ""
},
{
"docid": "e036a3954af46af07145b52df02a1ffb",
"score": "0.59879106",
"text": "def extract_hash(array_of_hashes, target_key, target_value)\n array_of_hashes.each do |hash|\n if hash[target_key] == target_value\n return hash\n end\n end\nend",
"title": ""
},
{
"docid": "9bac18e1b010babaf49b2b1586dd5342",
"score": "0.59731907",
"text": "def [](key)\n @h[key]\n end",
"title": ""
},
{
"docid": "f2fcbb888bee6d8224eb94659ed77a9c",
"score": "0.59713495",
"text": "def hash_key; end",
"title": ""
},
{
"docid": "6942d235fd0298adfee4fbf877e2010c",
"score": "0.59712225",
"text": "def value_of(key)\n @cache.hget(@@hash_name, key)\n end",
"title": ""
},
{
"docid": "52f58616c0bb54f216ee441fbc407166",
"score": "0.5964845",
"text": "def city(hash)\n hash[:city]\nend",
"title": ""
},
{
"docid": "e456d10ab93aa95b22b8ed2ca454bf98",
"score": "0.5949459",
"text": "def [](key)\n value[key]\n end",
"title": ""
},
{
"docid": "10fb326dac3481e18b0da5b7a8cefded",
"score": "0.5940179",
"text": "def read_set(value)\n hash_extractor(value)\n end",
"title": ""
},
{
"docid": "1e547e30b2108bb3b3b1dc9d6ddeb15a",
"score": "0.59346944",
"text": "def [](key)\n find(key).values\n end",
"title": ""
},
{
"docid": "b83ccd66e5079b9c017a6e399f7d0bd8",
"score": "0.5934002",
"text": "def keys(container); end",
"title": ""
},
{
"docid": "ad9a20999c399b0355fda30caae414b3",
"score": "0.5926684",
"text": "def lookup_value(id, key)\n lookup(id).try(:[], key)\n end",
"title": ""
},
{
"docid": "c27312cae8629e24bbbd60d30326c940",
"score": "0.59234816",
"text": "def test_setting_and_getting_values_from_a_hash\n hash = {} # or hash = Hash.new\n hash[\"abc\"] = 1\n hash[\"xyz\"] = 2\n \n assert_equal(1, hash[\"abc\"]) \n assert_equal(2, hash[\"xyz\"]) \n end",
"title": ""
},
{
"docid": "8b55c2a8dcfe193da4b255a7989268f6",
"score": "0.5917033",
"text": "def retrieve_values(hash1, hash2, key)\n values = []\n values << hash1[key]\n values << hash2[key]\n return values\nend",
"title": ""
},
{
"docid": "592bd08f157bd1a7e1dc8a87f15faa8b",
"score": "0.59119844",
"text": "def puts_value(hash)\n puts hash.values\nend",
"title": ""
},
{
"docid": "7af65e850066d4724d03f087373e2eac",
"score": "0.5895274",
"text": "def get_value(set, key)\n if cache[set.name] && cache[set.name][key]\n cache[set.name][key]\n end\n end",
"title": ""
},
{
"docid": "bf21b2819d0f00e2a4fd16766407afae",
"score": "0.5894986",
"text": "def call(input_hash)\n values = @keys.map{|k| Hashformer.get_value(input_hash, k)}\n values = @block.call(*values) if @block\n values\n end",
"title": ""
},
{
"docid": "f828e19adab7d2c7175e8358bf8118c9",
"score": "0.5894103",
"text": "def value_check(hash, value)\n hash.select { |k, v| v == value }\nend",
"title": ""
}
] |
3222ec9176d8a2cdd443a1171c3234e1
|
GET /storages/1 or /storages/1.json
|
[
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] |
[
{
"docid": "0e73d76fe75a70b1688b3176e125c625",
"score": "0.7299092",
"text": "def show\n @storage = current_user.storages.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @storage }\n end\n end",
"title": ""
},
{
"docid": "e38caf9d84bea90eab410df7c2bcab6f",
"score": "0.72923577",
"text": "def show\n @storage = Storage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @storage }\n end\n end",
"title": ""
},
{
"docid": "a4e448d36da8f27ab0f46865817bc98d",
"score": "0.72603387",
"text": "def index\n page = params[:page] || 1\n @storages = current_user.storages.desc.page(page)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @storages }\n end\n end",
"title": ""
},
{
"docid": "a306957f62fd114c443e76e6379c7fca",
"score": "0.72156215",
"text": "def storage_get(storage_id)\n fail Errors::ArgumentError, '\\'storage_id\\' is a mandatory argument' if storage_id.blank?\n backend_instances['storage'].get(storage_id)\n end",
"title": ""
},
{
"docid": "cedc778bdb85452f0404a8640c8f0c30",
"score": "0.7000514",
"text": "def get_storage_local()\n path = '/health/storage/local'\n\n params = {\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'GET',\n path: path,\n headers: headers,\n params: params,\n response_type: Models::HealthStatus\n )\n end",
"title": ""
},
{
"docid": "a9b2d80be7361fc2b40f680200792bad",
"score": "0.672442",
"text": "def storage_get(storage_id)\n image = ::OpenNebula::Image.new(::OpenNebula::Image.build_xml(storage_id), @client)\n rc = image.info\n check_retval(rc, Backends::Errors::ResourceRetrievalError)\n\n storage_parse_backend_obj(image)\n end",
"title": ""
},
{
"docid": "8ece0469cb61ae093b848475fc605770",
"score": "0.66886413",
"text": "def index\r\n @storages = Storage.all\r\n end",
"title": ""
},
{
"docid": "25bacaba900f8e260c669364d93cb1db",
"score": "0.6669061",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @ss_storages }\n end\n end",
"title": ""
},
{
"docid": "1a387890b1041a2bcabf049bb08944c6",
"score": "0.66360146",
"text": "def get_storage(request, params)\n # Get client with user credentials\n client = get_client(request.env)\n \n image=get_image(params[:id])\n\n if image\n image.extend(ImageOCCI)\n return image.to_occi, 200\n else\n msg=\"Disk with id = \\\"\" + params[:id] + \"\\\" not found\"\n error = OpenNebula::Error.new(msg)\n return error, 404\n end\n end",
"title": ""
},
{
"docid": "2083fe812a08dbfe41df6a236585675a",
"score": "0.66294587",
"text": "def index\n @cloud_storages = CloudStorage.all\n end",
"title": ""
},
{
"docid": "d4a882f15e396fd84669ef9ebafb8ffa",
"score": "0.661951",
"text": "def index\n @storages = params[:address].nil? ? Storage : Storage.where(address: params[:address])\n @storages = @storages.search(params[:search]).order(sort_column + \" \" + sort_direction + \",id asc\").paginate(:per_page => COUNT_STRING_ON_PAGE, :page => params[:page])\n\t \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @storage }\n end\n end",
"title": ""
},
{
"docid": "bbda8abd883162c5c7d15b135e6999c6",
"score": "0.6589317",
"text": "def storage_service\n storage.storage_json\n end",
"title": ""
},
{
"docid": "55ace7e6c9544d2ef88de71a3c9885a7",
"score": "0.6556577",
"text": "def storage_list(mixins = nil)\n backend_instances['storage'].list(mixins) || ::Occi::Core::Resources.new\n end",
"title": ""
},
{
"docid": "06c025da9dbad232caaa02c1cf25fa25",
"score": "0.6532558",
"text": "def get(storage_id)\n filters = []\n filters << { name: 'volume-id', values: [storage_id] }\n\n Backends::Ec2::Helpers::AwsConnectHelper.rescue_aws_service(@logger) do\n volumes = @ec2_client.describe_volumes(filters: filters).volumes\n volume = volumes ? volumes.first : nil\n return nil unless volume\n\n parse_backend_obj(volume)\n end\n end",
"title": ""
},
{
"docid": "05ee0d8403e89160e647656dcc3a9a97",
"score": "0.6522213",
"text": "def get_storage_providers\n get_url('volume')\n @stg_providers_list = []\n @stg_providers_print_list = []\n @stg_providers_id_list = []\n @volume_url = @resource_url\n @stg_providers = rest_get(\"#{@volume_url}/storage-providers/detail\", @token_id)\n @stg_providers_array = JSON.parse(@stg_providers)['storage_providers']\n @stg_providers_array.each do |stg|\n @stg_providers_list << stg['service']['host_display_name']\n @stg_providers_print_list << [stg['service']['host_display_name']]\n @stg_providers_id_list << stg['id']\n end\n end",
"title": ""
},
{
"docid": "b8e4961b93161d6a79ba6df049d7c2e5",
"score": "0.6492446",
"text": "def show_upload\n @storage = current_user.storages.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @storage }\n end\n end",
"title": ""
},
{
"docid": "07ccac5c79a8fc779f065c7123b7ec06",
"score": "0.6482915",
"text": "def index\n @storages = Storage.paginate(page: params[:page], per_page: 4)\n end",
"title": ""
},
{
"docid": "57aaead383fa3d7bfa523592bbca1d69",
"score": "0.6474437",
"text": "def get_storages(request)\n # Retrieve images owned by this user\n user = get_user(request.env)\n \n image_pool = ImagePoolOCCI.new(user[:id])\n return image_pool.to_occi(@base_url), 200\n end",
"title": ""
},
{
"docid": "72c5dc8c58fc86bf44a2c5d883779587",
"score": "0.6380842",
"text": "def get_storage_types\n JSON.parse(RestClient.get(\"https://#{region.sub(/-\\d$/, '')}.power-iaas.cloud.ibm.com/broker/v1/storage-types\", headers))\n end",
"title": ""
},
{
"docid": "8a0039953e85eaf98885e696897e5eb3",
"score": "0.6369308",
"text": "def find(options = {})\n raise \"Unable to locate the storage named '#{options[:name]}'\" unless options[:id]\n response = Profitbricks.request :get_storage, storage_id: options[:id]\n Profitbricks::Storage.new(response)\n end",
"title": ""
},
{
"docid": "d59c1001a5728ecd1ca04f81b0a9c6e9",
"score": "0.63478917",
"text": "def show\n @storage = Storage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @storage }\n end\n end",
"title": ""
},
{
"docid": "d59c1001a5728ecd1ca04f81b0a9c6e9",
"score": "0.63478917",
"text": "def show\n @storage = Storage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @storage }\n end\n end",
"title": ""
},
{
"docid": "30de46040106729d17fcffea7d00a690",
"score": "0.63447434",
"text": "def new\n @storage = Storage.new(params[:storage])\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @storage }\n end\n end",
"title": ""
},
{
"docid": "a54dcb68bfe5b3b7b6b0d9c615552b35",
"score": "0.6307885",
"text": "def list(mixins = nil)\n storages = ::Occi::Core::Resources.new\n\n Backends::Ec2::Helpers::AwsConnectHelper.rescue_aws_service(@logger) do\n volumes = @ec2_client.describe_volumes.volumes\n volumes.each do |volume|\n next unless volume\n storages << parse_backend_obj(volume)\n end if volumes\n end\n\n storages\n end",
"title": ""
},
{
"docid": "9bb01ad4d7653ae00e80da11ab655cde",
"score": "0.6305902",
"text": "def storage_key\n ret = storage_key_do\n render status: ret['status'], json: ret.to_json\n end",
"title": ""
},
{
"docid": "a8f0edb8cabe4a08f1e251ec4f0b2bba",
"score": "0.6286181",
"text": "def new\n @storage = current_user.storages.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @storage }\n end\n end",
"title": ""
},
{
"docid": "be1ce9f96161cb462814e93368d512a0",
"score": "0.6273711",
"text": "def index\n @storages = Storage.where([\"name LIKE ?\",\"%#{params[:search]}\"])\n end",
"title": ""
},
{
"docid": "30245b89a712f95685941209fac1f149",
"score": "0.6250333",
"text": "def objects(params = {})\n paramarr = []\n paramarr << [\"limit=#{URI.encode(params[:limit].to_i)}\"] if params[:limit]\n paramarr << [\"offset=#{URI.encode(params[:offset].to_i)}\"] if params[:offset]\n paramarr << [\"prefix=#{URI.encode(params[:prefix])}\"] if params[:prefix]\n paramarr << [\"path=#{URI.encode(params[:path])}\"] if params[:path]\n paramstr = (paramarr.size > 0)? paramarr.join(\"&\") : \"\" ;\n response = self.connection.cfreq(\"GET\",@storagehost,\"#{@storagepath}?#{paramstr}\")\n return [] if (response.code == \"204\")\n raise InvalidResponseException, \"Invalid response code #{response.code}\" unless (response.code == \"200\")\n return response.body.to_a.map { |x| x.chomp }\n end",
"title": ""
},
{
"docid": "5fc753265dd4297499855684d3ccea93",
"score": "0.6250332",
"text": "def index\n @file_storages = FileStorage.all\n end",
"title": ""
},
{
"docid": "9f91f033bc41ad7e1086090b676d7d79",
"score": "0.62485284",
"text": "def index\n @storages = Storage.paginate(:page => params[:page], :per_page => 100)\n end",
"title": ""
},
{
"docid": "ebb69eef8c2ff586dc760079585a8768",
"score": "0.62289244",
"text": "def get_images\n url = URI.parse(@endpoint+\"/storage\")\n req = Net::HTTP::Get.new(url.path)\n \n req.basic_auth @occiauth[0], @occiauth[1]\n \n res = CloudClient::http_start(url) {|http|\n http.request(req)\n }\n \n if CloudClient::is_error?(res)\n return res\n else\n return res.body\n end\n end",
"title": ""
},
{
"docid": "4c1a2c5560c6ca1719ae240ec35909a9",
"score": "0.6221317",
"text": "def show\n @storage_group = StorageGroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @storage_group }\n end\n end",
"title": ""
},
{
"docid": "1762a2aea91608f6336fabf89c603678",
"score": "0.6214004",
"text": "def get_images\n url = URI.parse(@endpoint+\"/storage\")\n req = Net::HTTP::Get.new(url.path)\n\n req.basic_auth @occiauth[0], @occiauth[1]\n\n res = CloudClient::http_start(url) {|http|\n http.request(req)\n }\n\n if CloudClient::is_error?(res)\n return res\n else\n return res.body\n end\n end",
"title": ""
},
{
"docid": "0cc646f972ee12684d251af04b01df12",
"score": "0.6186132",
"text": "def show\n @storage_dae = StorageDae.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @storage_dae }\n end\n end",
"title": ""
},
{
"docid": "f801b5c25aa41430b9321f184c6bceb3",
"score": "0.6158835",
"text": "def index\n @storage_types = current_user.storage_types\n end",
"title": ""
},
{
"docid": "86ae3f89919d56a0da48bad1066378b5",
"score": "0.61581594",
"text": "def get_service\n request({\n :expects => 200,\n :headers => {},\n :host => @host || region_to_host(DEFAULT_REGION),\n :idempotent => true,\n :method => 'GET',\n :parser => Fog::Parsers::AWS::Storage::GetService.new\n })\n end",
"title": ""
},
{
"docid": "1b36b604c3cc16bb84c16982cf318ce8",
"score": "0.6145119",
"text": "def get(k, ignored_options = nil)\n storage.get k\n end",
"title": ""
},
{
"docid": "2f61c1d9c153dc95c8b9398881982b6e",
"score": "0.6134872",
"text": "def storage_exists_with_http_info(storage_name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ThreeDCloudApi.storage_exists ...\"\n end\n # verify the required parameter 'storage_name' is set\n if @api_client.config.client_side_validation && storage_name.nil?\n fail ArgumentError, \"Missing the required parameter 'storage_name' when calling ThreeDCloudApi.storage_exists\"\n end\n # resource path\n local_var_path = \"/3d/storage/{storageName}/exist\".sub('{' + 'storageName' + '}', storage_name.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['JWT']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'StorageExist')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ThreeDCloudApi#storage_exists\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "c8024d2ce0dcf9c48bfafee875e544fe",
"score": "0.61323035",
"text": "def set_storage\n @storage = Storage.find(params[:id])\n end",
"title": ""
},
{
"docid": "c8024d2ce0dcf9c48bfafee875e544fe",
"score": "0.61323035",
"text": "def set_storage\n @storage = Storage.find(params[:id])\n end",
"title": ""
},
{
"docid": "8d00eda54f00eb7d3621fe346e2afb44",
"score": "0.6121661",
"text": "def new\n @storage = Storage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @storage }\n end\n end",
"title": ""
},
{
"docid": "ba215fa2f72afffc7b6cbfc20a2c2ba9",
"score": "0.6121258",
"text": "def get_stored_files\n @storage.get_files\n end",
"title": ""
},
{
"docid": "5537a5b7902bcf6e643aca99872c75f5",
"score": "0.60872626",
"text": "def set_storage\r\n @storage = Storage.find(params[:id])\r\n end",
"title": ""
},
{
"docid": "99e8c9d540702d374cf89bbf0ff5d8f3",
"score": "0.6079988",
"text": "def destroy\n @storage = current_user.storages.find(params[:id])\n @storage.destroy\n\n respond_to do |format|\n format.html { redirect_to storages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bbe0372c11d939c2814dadf99d9faa78",
"score": "0.603512",
"text": "def get_list_files(path, opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: StorageApi#get_list_files ...\"\n end\n \n # verify the required parameter 'path' is set\n fail \"Missing the required parameter 'path' when calling get_list_files\" if path.nil?\n \n # resource path\n path = \"/storage/folder/{path}\".sub('{format}','json').sub('{' + 'path' + '}', path.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'storage'] = opts[:'storage'] if opts[:'storage']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json', 'text/json', 'text/javascript']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = []\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n\n auth_names = []\n result = @api_client.call_api(:GET, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'FolderResponse')\n if Configuration.debugging\n Configuration.logger.debug \"API called: StorageApi#get_list_files. Result: #{result.inspect}\"\n end\n return result\n end",
"title": ""
},
{
"docid": "f6abcc2f0172b31ad0bb929d7be1bfd0",
"score": "0.6016274",
"text": "def get_from_storage(id)\n\t\traise \"[FATAL] Storage model must be used\"\n\tend",
"title": ""
},
{
"docid": "c6987f16c68b2c4a576b1ddb4ac04e1a",
"score": "0.5967831",
"text": "def set_storage\n @storage = Storage.find(params[:id])\n end",
"title": ""
},
{
"docid": "c6987f16c68b2c4a576b1ddb4ac04e1a",
"score": "0.5967831",
"text": "def set_storage\n @storage = Storage.find(params[:id])\n end",
"title": ""
},
{
"docid": "c6987f16c68b2c4a576b1ddb4ac04e1a",
"score": "0.5967831",
"text": "def set_storage\n @storage = Storage.find(params[:id])\n end",
"title": ""
},
{
"docid": "c6987f16c68b2c4a576b1ddb4ac04e1a",
"score": "0.5967831",
"text": "def set_storage\n @storage = Storage.find(params[:id])\n end",
"title": ""
},
{
"docid": "c6987f16c68b2c4a576b1ddb4ac04e1a",
"score": "0.5967831",
"text": "def set_storage\n @storage = Storage.find(params[:id])\n end",
"title": ""
},
{
"docid": "b0c3d4e405995f688e929117c6a14933",
"score": "0.5966185",
"text": "def storage\n self.class.find_storage(storage_key)\n end",
"title": ""
},
{
"docid": "c50dca59ce1403c5933c3281d09d6928",
"score": "0.5965931",
"text": "def index\n @storage_spaces = StorageSpace.all\n end",
"title": ""
},
{
"docid": "7897655be2641f832854345f81ea5f06",
"score": "0.59628916",
"text": "def get_volumes\n JSON.parse(RestClient::Request.execute(method: :get,\n url: \"#{@base_url}/api/json/types/volumes\",\n headers: {\n accept: :json\n },\n verify_ssl: @verify_cert,\n user: @user_name,\n password: @password\n ))\n end",
"title": ""
},
{
"docid": "09febd9b102932ed22bae6e29748fed2",
"score": "0.5961384",
"text": "def get(key)\n storage.get(\"#{@prefix}:#{key}\").to_h\n end",
"title": ""
},
{
"docid": "522fe98296686d4e7e4900c9cd4650dc",
"score": "0.59533334",
"text": "def storages\n @storages\n end",
"title": ""
},
{
"docid": "b9661fc16424eae791af8109a477726c",
"score": "0.5947309",
"text": "def destroy\r\n @storage.destroy\r\n respond_to do |format|\r\n format.html { redirect_to storages_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"title": ""
},
{
"docid": "5eb68ca1ad80c35f566d8cd4d9d5f62b",
"score": "0.59323424",
"text": "def get_storage_pools\n response = @client.rest_get(@data['uri'] + '/storage-pools')\n response.body\n end",
"title": ""
},
{
"docid": "5eb68ca1ad80c35f566d8cd4d9d5f62b",
"score": "0.59323424",
"text": "def get_storage_pools\n response = @client.rest_get(@data['uri'] + '/storage-pools')\n response.body\n end",
"title": ""
},
{
"docid": "dae25dcf8b9c0c5cf61d1b7cd848f108",
"score": "0.5895529",
"text": "def storage_exists_with_http_info(storage_name, opts = {})\n warn \"Warning: #storage_exists_with_http_info() is deprecated.\"\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CellsApi.storage_exists ...\"\n end\n @api_client.request_token_if_needed\n # verify the required parameter 'storage_name' is set\n if @api_client.config.client_side_validation && storage_name.nil?\n fail ArgumentError, \"Missing the required parameter 'storage_name' when calling CellsApi.storage_exists\"\n end\n # resource path\n local_var_path = \"/cells/storage/{storageName}/exist\".sub('{' + 'storageName' + '}', storage_name.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n #auth_names = []\n auth_names = ['JWT']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'StorageExist')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CellsApi#storage_exists\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "b31724fbd67d3df254f753441998125e",
"score": "0.58930534",
"text": "def get_plain_physical_storages\n @connection.discover_storages\n end",
"title": ""
},
{
"docid": "90eb517689254c384e73e60f1bde17b5",
"score": "0.58915967",
"text": "def get_storage(o={})\n options = {\n :aws_access_key_id => nil,\n :aws_secret_access_key => nil,\n :region => nil,\n :provider => 'AWS',\n :scheme => 'https'}.merge(o)\n \n begin\n storage = Fog::Storage.new(options)\n rescue Exception => e\n raise MyS3Exception.new \"Error establishing storage connection: #{e.class}: #{e}\"\n end\n \n $logger.debug \"What is storage? #{storage.class}:#{storage.inspect}\"\n raise MyS3Exception.new \"In #{self.class}#get_storage: storage is nil!\" if storage.nil?\n\n storage\n end",
"title": ""
},
{
"docid": "1d20b0514bce0673bc5559e37ddf7bf5",
"score": "0.5888226",
"text": "def index\n @volumes = compute.list_volumes\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @volumes }\n end\n end",
"title": ""
},
{
"docid": "b623781e29bd285a0bdda50af56ff3f4",
"score": "0.588684",
"text": "def get_is_storage_exist(name, opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: StorageApi#get_is_storage_exist ...\"\n end\n \n # verify the required parameter 'name' is set\n fail \"Missing the required parameter 'name' when calling get_is_storage_exist\" if name.nil?\n \n # resource path\n path = \"/storage/{name}/exist\".sub('{format}','json').sub('{' + 'name' + '}', name.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json', 'text/json', 'application/xml', 'text/xml', 'text/javascript']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = []\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n\n auth_names = []\n result = @api_client.call_api(:GET, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'StorageExistResponse')\n if Configuration.debugging\n Configuration.logger.debug \"API called: StorageApi#get_is_storage_exist. Result: #{result.inspect}\"\n end\n return result\n end",
"title": ""
},
{
"docid": "d8e00af22d24860d578d56f1ffc44d4d",
"score": "0.58859956",
"text": "def get_files\n f=@storage_handler.get_files\n end",
"title": ""
},
{
"docid": "c3d15ffb25781f10d1ace5be130dad58",
"score": "0.5877323",
"text": "def index\n @volumes = OpenStack::Nova::Volume::Volume.all\n @servers = OpenStack::Nova::Compute::Server.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @volumes }\n end\n end",
"title": ""
},
{
"docid": "4c99ddb8debe3671504208844ef20cab",
"score": "0.5860866",
"text": "def storage_quota\n response = client.get(\"/#{id}/skydrive/quota\")\n end",
"title": ""
},
{
"docid": "2428686257b7ff88c39a461e14c5185c",
"score": "0.58570826",
"text": "def my_storage_quota\n response = get(\"/me/skydrive/quota\")\n end",
"title": ""
},
{
"docid": "b8bb2d2235104780979b03218fcdbf1f",
"score": "0.58527726",
"text": "def resource(uri, options)\n result = @db[CLOUDKIT_STORE].\n select(:content, :etag, :last_modified, :deleted).\n filter(options.merge!(:uri => uri))\n if result.any?\n result = result.first\n return status_410 if result[:deleted]\n return response(200, result[:content], result[:etag], result[:last_modified])\n end\n status_404\n end",
"title": ""
},
{
"docid": "bf035ad034a50391fe83f8136d76e48f",
"score": "0.5836356",
"text": "def storage(mount_point = '/')\n Storage.call(mount_point)\n end",
"title": ""
},
{
"docid": "4e1fd951ecd2ff391a6e0030bb0e5317",
"score": "0.5832504",
"text": "def storage_volume(storage_volume_id)\n from_resource :storage_volume,\n connection.get(api_uri(\"storage_volumes/#{storage_volume_id}\"))\n end",
"title": ""
},
{
"docid": "7d23025f68464537c915c5b43aa29a47",
"score": "0.58321005",
"text": "def get_multi(*ks)\n storage.get_multi ks\n end",
"title": ""
},
{
"docid": "fc4c54766bdcdc9e0cd485c6a7dc088b",
"score": "0.5827802",
"text": "def storage_exists_with_http_info(request)\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SlidesApi.storage_exists ...'\n end\n # verify the required parameter 'storage_name' is set\n if @api_client.config.client_side_validation && request.storage_name.nil?\n fail ArgumentError, \"Missing the required parameter 'storage_name' when calling SlidesApi.storage_exists\"\n end\n # resource path\n local_var_path = '/slides/storage/{storageName}/exist'\n local_var_path = @api_client.replace_path_parameter(local_var_path, 'storageName', request.storage_name)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # http body (model)\n post_body = nil\n\n # form parameters\n\n post_files = nil\n\n\n auth_names = ['JWT']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :body => post_body,\n :files => post_files,\n :auth_names => auth_names,\n :return_type => 'StorageExist')\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "be8317370aa6a91f039ccc7eb900561a",
"score": "0.58245844",
"text": "def storage_exists_with_http_info(request)\n raise ArgumentError, 'Incorrect request type' unless request.is_a? StorageExistsRequest\n\n @api_client.config.logger.debug 'Calling API: CadApi.storage_exists ...' if @api_client.config.debugging\n # verify the required parameter 'storage_name' is set\n raise ArgumentError, 'Missing the required parameter storage_name when calling CadApi.storage_exists' if @api_client.config.client_side_validation && request.storage_name.nil?\n # resource path\n local_var_path = '/cad/storage/{storageName}/exist'\n local_var_path = local_var_path.sub('{' + downcase_first_letter('storageName') + '}', request.storage_name.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\t \n if not form_params.empty?\n header_params['Content-Type'] = 'multipart/form-data'\n end\n\n # http body (model)\n post_body = nil\n auth_names = ['JWT']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n header_params: header_params,\n query_params: query_params,\n form_params: form_params,\n body: post_body,\n auth_names: auth_names,\n return_type: 'StorageExist')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called:\n CadApi#storage_exists\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n [data, status_code, headers]\n end",
"title": ""
},
{
"docid": "8bf090f73106501e9837906f93966e35",
"score": "0.57969457",
"text": "def storage_exists(storage_name, opts = {})\n @api_client.request_token_if_needed\n data, _status_code, _headers = storage_exists_with_http_info(storage_name, opts)\n rescue ApiError => error\n if error.code == 401\n @api_client.request_token_if_needed\n data, _status_code, _headers = storage_exists_with_http_info(storage_name, opts)\n else\n raise\n end\n return data\n end",
"title": ""
},
{
"docid": "3f2fcc99e8d2c68042065b9c415ca767",
"score": "0.5796365",
"text": "def get_files(storage, path, bucket)\n storage.directories.get(bucket, prefix: path).files.map do |file|\n puts file.key\n end\n end",
"title": ""
},
{
"docid": "44b49f5f9f2d49bff3fe5a205d0facc9",
"score": "0.57877415",
"text": "def delete\n if params[:id]\n result = backend_instance.storage_delete(params[:id])\n else\n result = backend_instance.storage_delete_all\n end\n\n if result\n respond_with(Occi::Collection.new)\n else\n respond_with(Occi::Collection.new, status: 304)\n end\n end",
"title": ""
},
{
"docid": "8d8549f5fa8be55d8c5f267fadc5d330",
"score": "0.57861876",
"text": "def get_vdc_storage_class(id)\n request(\n :expects => 200,\n :idempotent => true,\n :method => 'GET',\n :parser => Fog::ToHashDocument.new,\n :path => \"vdcStorageProfile/#{id}\"\n )\n end",
"title": ""
},
{
"docid": "8d8549f5fa8be55d8c5f267fadc5d330",
"score": "0.57861876",
"text": "def get_vdc_storage_class(id)\n request(\n :expects => 200,\n :idempotent => true,\n :method => 'GET',\n :parser => Fog::ToHashDocument.new,\n :path => \"vdcStorageProfile/#{id}\"\n )\n end",
"title": ""
},
{
"docid": "49bf2452971e38126ebce15421751a86",
"score": "0.57808673",
"text": "def index\n @hydraulicstoragebs = Hydraulicstorageb.all\n end",
"title": ""
},
{
"docid": "c0b065cb120af2aaebc1105e3c668501",
"score": "0.5779818",
"text": "def list\n @storage.index\n end",
"title": ""
},
{
"docid": "5faa3c867aeb127fb65822d40ac65232",
"score": "0.5779599",
"text": "def get_list_file_versions(path, opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: StorageApi#get_list_file_versions ...\"\n end\n \n # verify the required parameter 'path' is set\n fail \"Missing the required parameter 'path' when calling get_list_file_versions\" if path.nil?\n \n # resource path\n path = \"/storage/version/{path}\".sub('{format}','json').sub('{' + 'path' + '}', path.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'storage'] = opts[:'storage'] if opts[:'storage']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json', 'text/json', 'application/xml', 'text/xml', 'text/javascript']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = []\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n\n auth_names = []\n result = @api_client.call_api(:GET, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'FileVersionsResponse')\n if Configuration.debugging\n Configuration.logger.debug \"API called: StorageApi#get_list_file_versions. Result: #{result.inspect}\"\n end\n return result\n end",
"title": ""
},
{
"docid": "bf9adfc6064694b8a8a00ee927516469",
"score": "0.57777417",
"text": "def get_storage_pure_volume_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: StorageApi.get_storage_pure_volume_list ...'\n end\n allowable_values = [\"allpages\", \"none\"]\n if @api_client.config.client_side_validation && opts[:'inlinecount'] && !allowable_values.include?(opts[:'inlinecount'])\n fail ArgumentError, \"invalid value for \\\"inlinecount\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/api/v1/storage/PureVolumes'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'$filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'$orderby'] = opts[:'orderby'] if !opts[:'orderby'].nil?\n query_params[:'$top'] = opts[:'top'] if !opts[:'top'].nil?\n query_params[:'$skip'] = opts[:'skip'] if !opts[:'skip'].nil?\n query_params[:'$select'] = opts[:'select'] if !opts[:'select'].nil?\n query_params[:'$expand'] = opts[:'expand'] if !opts[:'expand'].nil?\n query_params[:'$apply'] = opts[:'apply'] if !opts[:'apply'].nil?\n query_params[:'$count'] = opts[:'count'] if !opts[:'count'].nil?\n query_params[:'$inlinecount'] = opts[:'inlinecount'] if !opts[:'inlinecount'].nil?\n query_params[:'at'] = opts[:'at'] if !opts[:'at'].nil?\n query_params[:'tags'] = opts[:'tags'] if !opts[:'tags'].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', 'text/csv', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'StoragePureVolumeResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"StorageApi.get_storage_pure_volume_list\",\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: StorageApi#get_storage_pure_volume_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "1e47bc90e8e0a1740fe363c12499dddf",
"score": "0.57755274",
"text": "def delete_storage storage_uuid\n response = delete \"storage/#{storage_uuid}\"\n\n response\n end",
"title": ""
},
{
"docid": "8458bedf67bbc21bbb3f8b9df7e853f2",
"score": "0.57738185",
"text": "def fetch(req = self.request)\n get_volumes(req)\n end",
"title": ""
},
{
"docid": "527e3ee4733b9898e96197674fbbb620",
"score": "0.5772485",
"text": "def get(key)\n storage[key]\n end",
"title": ""
},
{
"docid": "7706adea00903d61c0bffaa3832e5449",
"score": "0.57699907",
"text": "def storage_exists_with_http_info(request)\n raise ArgumentError, 'Incorrect request type' unless request.is_a? StorageExistsRequest\n\n @api_client.config.logger.debug 'Calling API: StorageApi.storage_exists ...' if @api_client.config.debugging\n # verify the required parameter 'storage_name' is set\n raise ArgumentError, 'Missing the required parameter storage_name when calling StorageApi.storage_exists' if @api_client.config.client_side_validation && request.storage_name.nil?\n # resource path\n local_var_path = '/signature/storage/{storageName}/exist'\n escaped = request.storage_name.to_s.sub(\"\\\\\", \"\\\\\\\\\\\\\\\\\")\n local_var_path = local_var_path.sub('{' + downcase_first_letter('storageName') + '}', escaped)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n 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 access_token: get_access_token,\n return_type: 'StorageExist')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called:\n StorageApi#storage_exists\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n [data, status_code, headers]\n end",
"title": ""
},
{
"docid": "832d7737f387fef1d4c17b20e1a5e1f5",
"score": "0.57550937",
"text": "def show\n @storages = @room.storages.all\n\n process_images(@room)\n end",
"title": ""
},
{
"docid": "f6a09bae097007860cc45792bae7469c",
"score": "0.5749559",
"text": "def get(*args)\n if args.size == 1\n @server.data_store.list(args)\n else\n @server.data_store.get(args)\n end\n end",
"title": ""
},
{
"docid": "62104a1b6a0fd672c9321abea4a6a7d3",
"score": "0.5749226",
"text": "def storage_names\n @storage_names\n end",
"title": ""
},
{
"docid": "406048101f1632e6213066585fe82e5d",
"score": "0.5743742",
"text": "def storage_key\n @data.fetch(\"storage\")\n end",
"title": ""
},
{
"docid": "585a8b36a5b345fe6eb45c3e698911e8",
"score": "0.5737503",
"text": "def create\n @storage = Storage.new(storage_params)\n\n respond_to do |format|\n if @storage.save\n format.html { redirect_to @storage, notice: 'Storage was successfully created.' }\n format.json { render :show, status: :created, location: @storage }\n else\n format.html { render :new }\n format.json { render json: @storage.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "585a8b36a5b345fe6eb45c3e698911e8",
"score": "0.5737503",
"text": "def create\n @storage = Storage.new(storage_params)\n\n respond_to do |format|\n if @storage.save\n format.html { redirect_to @storage, notice: 'Storage was successfully created.' }\n format.json { render :show, status: :created, location: @storage }\n else\n format.html { render :new }\n format.json { render json: @storage.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f99e8aeea6c5c379ea99079ee40baf28",
"score": "0.57339203",
"text": "def get_array_and_tenant_by_id_from_global_storage(args = {}) \n get(\"/arrays.json/global/#{args[:arrayId]}\", args)\nend",
"title": ""
},
{
"docid": "6ad87d586121dc620738a9c3b13064ef",
"score": "0.57273835",
"text": "def storage\n shrine_class.find_storage(storage_key)\n end",
"title": ""
},
{
"docid": "e1087c1714ba67bd1f4330749f1feb7a",
"score": "0.57171124",
"text": "def get(key)\n value = storage.get(key)\n JSON.parse(value) rescue value\n end",
"title": ""
},
{
"docid": "8fd7881bca92837bcc24f7ef2520015c",
"score": "0.5712321",
"text": "def show\n @volume = compute.get_volume(params[:id].to_i)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @volume }\n end\n end",
"title": ""
},
{
"docid": "a4ffba4b6dcccce34489bd5bb024b667",
"score": "0.57115906",
"text": "def show\n @storage = Storage.find(params[:id])\n \n@user = User.find(current_user)\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @storage }\n end\n end",
"title": ""
},
{
"docid": "63a7b8ff5fdd6e17744fe509e4c11e63",
"score": "0.5699631",
"text": "def storage_snapshot(storage_snapshot_id)\n from_resource :storage_snapshot,\n connection.get(api_uri(\"storage_snapshots/#{storage_snapshot_id}\"))\n end",
"title": ""
},
{
"docid": "f986a2772ce3b402a19f67fbb30b72e0",
"score": "0.569461",
"text": "def create\n @storage = Storage.new(storage_params)\n\n respond_to do |format|\n if @storage.save\n format.html { redirect_to @storage, notice: \"Storage was successfully created.\" }\n format.json { render :show, status: :created, location: @storage }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @storage.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c601935f49f9937b6dd8e0fef63fe2ef",
"score": "0.56903154",
"text": "def storage\n shrine_class.find_storage(storage_key)\n end",
"title": ""
}
] |
f3ffe033e606226289fbcdbb5859f830
|
Retrieve visit outcomes get '/visit_outcomes' Returns Visit Outcomes, according to the parameters provided
|
[
{
"docid": "2a55e0a04c7cc22d2c22e3f2cc9cae95",
"score": "0.745909",
"text": "def where(options = {})\n _, _, root = @client.get(\"/visit_outcomes\", options)\n\n root[:items].map{ |item| VisitOutcome.new(item[:data]) }\n end",
"title": ""
}
] |
[
{
"docid": "2723ece8d270fcf476121c41d7dd9ace",
"score": "0.7100533",
"text": "def index\n @api_v1_outcomes = Api::V1::Outcome.all\n end",
"title": ""
},
{
"docid": "6aab07fb1b654ad910582fa667ba9dc6",
"score": "0.64727515",
"text": "def outcomes\n return @outcomes\n end",
"title": ""
},
{
"docid": "19015b9ec79efcdf9d83a623d87915da",
"score": "0.6391584",
"text": "def outcomes=(value)\n @outcomes = value\n end",
"title": ""
},
{
"docid": "295e629610962e43541428b9a753d20d",
"score": "0.62530506",
"text": "def outcomes\n \t@outcomes ||= {}\n end",
"title": ""
},
{
"docid": "3edd84dbe1265b3a89b1880bcd593065",
"score": "0.60810024",
"text": "def where(options = {})\n _, _, root = @client.get(\"/call_outcomes\", options)\n\n root[:items].map{ |item| CallOutcome.new(item[:data]) }\n end",
"title": ""
},
{
"docid": "64931350ff43356d5d51b619a2d70241",
"score": "0.60240364",
"text": "def ab_get_outcome(experiment)\n VanityExperiment.retrieve(experiment).outcome\n end",
"title": ""
},
{
"docid": "dfc8590123748fff510c8b5124ed0c98",
"score": "0.5961306",
"text": "def index\n @loot_outcomes = LootOutcome.all\n end",
"title": ""
},
{
"docid": "31f021d75673c65be5db377e3b3ccdf1",
"score": "0.59338677",
"text": "def outcomes(name, environment, opts = {})\n environment = prepare_environment(environment)\n limit = sort = nil\n\n if opts[:limit]\n limit = \" LIMIT #{opts[:limit]}\"\n end\n\n if opts[:sort]\n sort = \" ORDER BY #{opts[:sort]}\"\n end\n\n outcomes = []\n results = @db.execute(\"SELECT outcome, time FROM #{RUN_HISTORY_TABLE_NAME} WHERE name=? AND env=?#{sort}#{limit}\", name, environment)\n results.each do |r|\n outcomes << Listerine::Outcome.new(r[0], Time.parse(r[1]))\n end\n outcomes\n end",
"title": ""
},
{
"docid": "473bad17a6b2f970b504367726aa350c",
"score": "0.586376",
"text": "def ab_get_outcome(_experiment)\n raise \"Not implemented\"\n end",
"title": ""
},
{
"docid": "40c5f0e04b14ba488a8db484de4b1768",
"score": "0.5856775",
"text": "def get_flows_outcomes_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ArchitectApi.get_flows_outcomes ...\"\n end\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/flows/outcomes\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number']\n query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size']\n query_params[:'sortBy'] = opts[:'sort_by'] if opts[:'sort_by']\n query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order']\n query_params[:'id'] = @api_client.build_collection_param(opts[:'id'], :multi) if opts[:'id']\n query_params[:'name'] = opts[:'name'] if opts[:'name']\n query_params[:'description'] = opts[:'description'] if opts[:'description']\n query_params[:'nameOrDescription'] = opts[:'name_or_description'] if opts[:'name_or_description']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud 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 => 'FlowOutcomeListing')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ArchitectApi#get_flows_outcomes\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "6686f1d2cdeb53bdf79825043cda172f",
"score": "0.5690702",
"text": "def api_v1_outcome_params\n params.fetch(:api_v1_outcome, {})\n end",
"title": ""
},
{
"docid": "316cc470460b80761fb72900e0489720",
"score": "0.56473213",
"text": "def set_outcome\n @outcome = Outcome.find(params[:id])\n end",
"title": ""
},
{
"docid": "233a71508d15c75cb77eee68837a570b",
"score": "0.5616408",
"text": "def get_flows_outcomes(opts = {})\n data, _status_code, _headers = get_flows_outcomes_with_http_info(opts)\n return data\n end",
"title": ""
},
{
"docid": "44f813d5f8445518f5bd14265c4a396a",
"score": "0.55880576",
"text": "def get_outcome_result_rollups(course_id,opts={})\n query_param_keys = [\n :aggregate,\n :user_ids,\n :outcome_ids,\n :include\n ]\n\n form_param_keys = [\n \n ]\n\n # verify existence of params\n raise \"course_id is required\" if course_id.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :course_id => course_id\n )\n\n # resource path\n path = path_replace(\"/v1/courses/{course_id}/outcome_rollups\",\n :course_id => course_id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_params(options, query_param_keys)\n if opts[:next_page]\n pagination_params = page_params_load(:get, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:get, path, query_params, form_params, headers)\n page_params_store(:get, path)\n response\n \n end",
"title": ""
},
{
"docid": "8c9bb78878a1ca73c01377beda8d388b",
"score": "0.5566753",
"text": "def get_flows_outcome_with_http_info(flow_outcome_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ArchitectApi.get_flows_outcome ...\"\n end\n \n \n # verify the required parameter 'flow_outcome_id' is set\n fail ArgumentError, \"Missing the required parameter 'flow_outcome_id' when calling ArchitectApi.get_flows_outcome\" if flow_outcome_id.nil?\n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/flows/outcomes/{flowOutcomeId}\".sub('{format}','json').sub('{' + 'flowOutcomeId' + '}', flow_outcome_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud 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 => 'FlowOutcome')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ArchitectApi#get_flows_outcome\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "76684b8637b59bc5b55bcd0be8343704",
"score": "0.5403827",
"text": "def create\n @api_v1_outcome = Api::V1::Outcome.new(api_v1_outcome_params)\n\n respond_to do |format|\n if @api_v1_outcome.save\n format.html { redirect_to @api_v1_outcome, notice: 'Outcome was successfully created.' }\n format.json { render :show, status: :created, location: @api_v1_outcome }\n else\n format.html { render :new }\n format.json { render json: @api_v1_outcome.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d8f76339e943f7fd32be35f38d169d3a",
"score": "0.53750014",
"text": "def women_outcomes(start_date=@start_date, end_date=@end_date, outcome_end_date=@end_date,\n\t\t\tprogram_id = @@program_id, states = [], min_age=nil, max_age=nil)\n\t\tstates = []\n\t\tcoded_id = ConceptName.find_by_name(\"Yes\").concept_id\n\t\tpregnant_id = ConceptName.find_by_name(\"Is patient pregnant?\").concept_id\n\t\tbreast_feeding_id = ConceptName.find_by_name(\"Is patient breast feeding?\").concept_id\n\t\tPatientState.find_by_sql(\" SELECT distinct(p.patient_id)\n\t\t\t\t\tFROM patient_state s\n\t\t\t\t\tINNER JOIN patient_program p ON p.patient_program_id = s.patient_program_id\n\t\t\t\t\tINNER JOIN earliest_start_date e ON e.patient_id = p.patient_id\n\t\t\t\t\tINNER JOIN obs o on o.person_id = e.patient_id\n\t\t\t\t\tWHERE (e.date_enrolled >= '#{start_date}'\n\t\t\t\t\tAND e.date_enrolled <= '#{end_date}')\n\t\t\t\t\tAND s.start_date <= '#{outcome_end_date}'\n\t\t\t\t\tAND p.program_id = #{program_id}\n\t\t\t\t\tAND ((o.concept_id = '#{pregnant_id}'\n\t\t\t\t\t\t\t\tAND o.value_coded = '#{coded_id}'\n\t\t\t\t\t\t\t\tAND DATEDIFF(o.obs_datetime, e.earliest_start_date) <= 30\n\t\t\t\t\t\t\t\tAND DATEDIFF(o.obs_datetime, e.earliest_start_date) > -1)\n\t\t\t\t\t\t\t\tOR\n\t\t\t\t\t\t (o.concept_id = '#{breast_feeding_id}'\n\t\t\t\t\t\t\t\tAND o.value_coded = '#{coded_id}'))\n\t\t\t\t\t\").each do |patient_id|\n\t\t\tstates << patient_id.patient_id.to_i\n\t\tend\n\n\t\treturn states\n end",
"title": ""
},
{
"docid": "54edb11a20706250c267ae2ee6c28236",
"score": "0.53652036",
"text": "def outcomes\n @study = Study.find(params[:study_id])\n @project=Project.find(params[:project_id])\n @outcome_subgroups = []\n makeStudyActive(@study)\n session[:project_id] = @study.project_id\n @extraction_form = ExtractionForm.find(params[:extraction_form_id])\n @study_extforms = StudyExtractionForm.where(:study_id => @study.id)\n # get information regarding the extraction forms, pre-defined outcomes, outcome descriptions,\n # sections in each form, sections borrowed from other forms, key questions associated with \n # each section, etc.\n #unless @study_extforms.empty?\n #\t@extraction_forms,@outcome_options,@descriptions,@included_sections,@borrowed_section_names,@section_donor_ids,@kqs_per_section = Outcome.get_extraction_form_information(@study_extforms,@study,@project)\n #end\n\n #if @included_sections[@extraction_form.id].include?(\"outcomes\")\n if ExtractionForm.includes_section?(params[:extraction_form_id],'outcomes')\n @study_arms = Arm.where(:study_id => params[:study_id], :extraction_form_id => @extraction_form.id).all\n @outcome = Outcome.new\n @outcomes = Outcome.where(:study_id => @study.id, :extraction_form_id => @extraction_form.id).all\n @outcome_subgroups_hash = Outcome.get_subgroups_by_outcome(@outcomes)\n @outcome_timepoint = OutcomeTimepoint.new\n @outcome_timepoints = @outcome.outcome_timepoints\n @time_units = Outcome.get_timepoint_unit_options(@study.id)\n @editing = params[:editing]\n else\n flash[\"error\"] = \"That section is not included in the current extraction form.\"\n redirect_to edit_project_study_path(params[:project_id], @study.id)\t\t\t\t\n end\n # Now get any additional user instructions for this section\n @extraction_form_outcomes_instr = EfInstruction.find(:first, :conditions=>[\"ef_id = ? and section = ? and data_element = ?\", params[:extraction_form_id].to_s, \"OUTCOMES\", \"GENERAL\"])\n @extraction_form_id = params[:extraction_form_id]\n render :layout=>false\n end",
"title": ""
},
{
"docid": "9b44fad7b2adb2bed4686e717b32614c",
"score": "0.5320443",
"text": "def determineOutcome\r\n events = @BetESS.fMapOfAllEvents\r\n puts (@BetESS.fDisplayEvents)\r\n\r\n puts \"Which event do you want to determine the outcome of: \"\r\n id = gets.chomp.to_i\r\n e = events[id]\r\n puts e.toString\r\n\r\n puts \"What is the outcome of that event: \"\r\n outcome = gets.chomp.to_i\r\n\r\n @BetESS.fCloseEvent(e,outcome)\r\n puts \"##############\"\r\n\r\n end",
"title": ""
},
{
"docid": "285daa637c0b07521107d2fb543c0f87",
"score": "0.53052557",
"text": "def set_api_v1_outcome\n @api_v1_outcome = Api::V1::Outcome.find(params[:id])\n end",
"title": ""
},
{
"docid": "798edd8eea6302bc593c85e87a20bd09",
"score": "0.52322215",
"text": "def outcome_details\n begin\n @project_id = params[:project_id]\n user_assigned = current_user.is_assigned_to_project(params[:project_id])\n @data_point = OutcomeDetailDataPoint.new\n action = ''\n\n # Now get any additional user instructions for this section\n @ef_instruction = EfInstruction.find(:first, :conditions=>[\"ef_id = ? and section = ? and data_element = ?\", params[:extraction_form_id].to_s, \"OUTCOME_DETAILS\", \"GENERAL\"])\n @ef_instruction = @ef_instruction.nil? ? \"\" : @ef_instruction.instructions\n\n by_category = EfSectionOption.is_section_by_category?(params[:extraction_form_id], 'outcome_detail')\n if by_category\n @data = QuestionBuilder.get_questions(\"outcome_detail\", params[:study_id], params[:extraction_form_id], {:user_assigned => user_assigned, :is_by_outcome=>true, :include_total=>false})\n action = 'question_based_section_by_category'\n else\n action = 'question_based_section'\n @data = QuestionBuilder.get_questions(\"outcome_detail\", params[:study_id], params[:extraction_form_id], {:user_assigned => user_assigned})\n end\n render :action=>\"#{action}\", :layout=>false\n rescue Exception => e\n puts \"ERROR: #{e.message}\\n\\n#{e.backtrace}\\n\\n\"\n end\n end",
"title": ""
},
{
"docid": "123f1070ee5fa87ea0d47859942302f2",
"score": "0.51887107",
"text": "def outcome(event_name)\n outcomes.has_key?(event_name.to_s) ? outcomes.fetch(event_name.to_s) : raise(WebFlowError.new, \"There's no outcome defined for the event name '#{event_name}'.\")\n end",
"title": ""
},
{
"docid": "77a0b036f6a08dac6033d9ba2830b241",
"score": "0.5139623",
"text": "def index\n @outcome_measure_types = OutcomeMeasureType.all\n end",
"title": ""
},
{
"docid": "e37daf4ef765704a2b2e220bd5c9d131",
"score": "0.5122838",
"text": "def outcome\n return unless @playground.collecting?\n\n outcome = connection.ab_get_outcome(@id)\n outcome && alternatives[outcome]\n end",
"title": ""
},
{
"docid": "a06b27112eee231d169492399b1dd8d5",
"score": "0.51153153",
"text": "def loot_outcome_params\n params.fetch(:loot_outcome, {})\n end",
"title": ""
},
{
"docid": "271b3b4df4840b1088069e6e52bfb1c1",
"score": "0.50906694",
"text": "def index\n @assessments = @location.assessments\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @assessments }\n end\n end",
"title": ""
},
{
"docid": "88af2046ba42e414e03f527c8d7b7bfe",
"score": "0.5074194",
"text": "def post_outcome_request\n raise IMS::LTI::InvalidLTIConfigError, \"\" unless has_required_attributes?\n\n res = post_service_request(@lis_outcome_service_url,\n 'application/xml',\n generate_request_xml)\n\n @outcome_response = extend_outcome_response(OutcomeResponse.new)\n @outcome_response.process_post_response(res)\n end",
"title": ""
},
{
"docid": "c3ccbb434d3f28971d4000ef4734b864",
"score": "0.5033855",
"text": "def tournaments\n get('sports/en/tournaments.xml')\n end",
"title": ""
},
{
"docid": "4647afe98a1f44ae1a02441fa0af377c",
"score": "0.5025121",
"text": "def show\n @outcome_mapping = OutcomeMapping.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @outcome_mapping }\n end\n end",
"title": ""
},
{
"docid": "82c1b71c542557f222acef6275b517ae",
"score": "0.4964218",
"text": "def index\n @agents = @habitat.agents.find(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @agents.to_xml }\n end\n end",
"title": ""
},
{
"docid": "1bd94fb260cb69a765167fda1cf25a23",
"score": "0.4952115",
"text": "def activities(options={})\n response = connection.get do |req|\n req.url \"activities\", options\n end\n return_error_or_body(response)\n end",
"title": ""
},
{
"docid": "5836c4b760db3cea3f254d447df493c8",
"score": "0.49470788",
"text": "def get_all_outcome_links_for_context_courses(course_id,opts={})\n query_param_keys = [\n :outcome_style,\n :outcome_group_style\n ]\n\n form_param_keys = [\n \n ]\n\n # verify existence of params\n raise \"course_id is required\" if course_id.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :course_id => course_id\n )\n\n # resource path\n path = path_replace(\"/v1/courses/{course_id}/outcome_group_links\",\n :course_id => course_id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_params(options, query_param_keys)\n if opts[:next_page]\n pagination_params = page_params_load(:get, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:get, path, query_params, form_params, headers)\n page_params_store(:get, path)\n response.map {|response|OutcomeLink.new(response)}\n end",
"title": ""
},
{
"docid": "1f5d05cd04416f644a6e51ca70a89306",
"score": "0.49415073",
"text": "def get_flows_outcome(flow_outcome_id, opts = {})\n data, _status_code, _headers = get_flows_outcome_with_http_info(flow_outcome_id, opts)\n return data\n end",
"title": ""
},
{
"docid": "8ea3816d3c8724694b50694942a8531a",
"score": "0.49194914",
"text": "def outcome_params\n params.require(:outcome).permit(:name, :value)\n end",
"title": ""
},
{
"docid": "b6abd192d7851e686288971d4a6f74e1",
"score": "0.49138618",
"text": "def accepted_outcome_types\n return @outcome_types if @outcome_types\n @outcome_types = []\n if val = @ext_params['outcome_data_values_accepted']\n @outcome_types = val.split(',')\n end\n\n @outcome_types\n end",
"title": ""
},
{
"docid": "cfdd5eb6fe94d17b85d528d19d3d43c9",
"score": "0.49131674",
"text": "def sport_tournaments(sport_id)\n get(\"sports/en/sports/sr:sport:#{sport_id}/tournaments.xml\")\n end",
"title": ""
},
{
"docid": "0699312b40352a3ef6511c0a6d8b300a",
"score": "0.49035084",
"text": "def get_all_outcome_links_for_context_accounts(account_id,opts={})\n query_param_keys = [\n :outcome_style,\n :outcome_group_style\n ]\n\n form_param_keys = [\n \n ]\n\n # verify existence of params\n raise \"account_id is required\" if account_id.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :account_id => account_id\n )\n\n # resource path\n path = path_replace(\"/v1/accounts/{account_id}/outcome_group_links\",\n :account_id => account_id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_params(options, query_param_keys)\n if opts[:next_page]\n pagination_params = page_params_load(:get, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:get, path, query_params, form_params, headers)\n page_params_store(:get, path)\n response.map {|response|OutcomeLink.new(response)}\n end",
"title": ""
},
{
"docid": "ff8f568e5f8b560eddd52331d75eee99",
"score": "0.48564652",
"text": "def index\n @page = (params[:page] ? params[:page] : 1)\n @assessments = Assessment.filter_by_published(user_signed_in?).search(params).page(@page)\n authorize! :read, Assessment\n\n if params[:country_id].blank?\n @countries = Country.for_assessments @assessments\n else\n @countries = Country.find_all_by_id(params[:country_id])\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @assessments }\n end\n end",
"title": ""
},
{
"docid": "cf0e373a281c8f82e585907747ee6574",
"score": "0.4855321",
"text": "def get_flows()\n\tputs \"Getting flows\"\n\tresponse = request_get('/api/partner/flow')\n\tputs response.body\nend",
"title": ""
},
{
"docid": "66e0ea9ac48ce37079941ace7e88de8e",
"score": "0.4854327",
"text": "def activities(params = {})\n scope 'default'\n get('activities/', params)\n end",
"title": ""
},
{
"docid": "4dcf75a2eaf8f6ee8a5af5d4b5bc093b",
"score": "0.4852877",
"text": "def index\n @visit_histories = VisitHistory.all\n end",
"title": ""
},
{
"docid": "98e6c3b49ede63101e0ecab664303749",
"score": "0.48177034",
"text": "def index\n @evidences = Evidence.all\n end",
"title": ""
},
{
"docid": "456193066c7b13508762a70b8ffba9e3",
"score": "0.48050484",
"text": "def outcome\n status.first\n end",
"title": ""
},
{
"docid": "dc257d39aec97c220e17ba55a29a3b18",
"score": "0.4800603",
"text": "def index\n get_index_view(@scenarios)\n end",
"title": ""
},
{
"docid": "9864bf5880d8a6bef3231be3680ed0b9",
"score": "0.47942266",
"text": "def visits(*args)\n webrat_session.visits(*args)\n end",
"title": ""
},
{
"docid": "e9a24f88cceb63bfd094071b260aefd7",
"score": "0.4775439",
"text": "def index\n @evidence = Evidence.all\n end",
"title": ""
},
{
"docid": "6c389ba66b81a9d7da500e1667ac5f32",
"score": "0.47337827",
"text": "def show\n @performed_goal_int = Performed_goal_int.all\n @projection_goal_int = Projection_goal_int.all\n @reached_goal_int = Reached_goal_int.all\n end",
"title": ""
},
{
"docid": "29b52b5bae5c0a8fbb04955905916302",
"score": "0.47329974",
"text": "def index\n if params[:workpoint_id]\n @outs = Workpoint.find(params[:workpoint_id]).outs\n else\n @outs = Out.all\n end\n respond_to do |format|\n format.json {\n render :json => @outs, :layout => false\n }\n end\n end",
"title": ""
},
{
"docid": "df263b6685fc5a16c148d553da2e16a3",
"score": "0.472927",
"text": "def index\n @experiments = Experiment.where(pend_status: [0])\n @experiments_wait = Experiment.where(pend_status: [1])\n end",
"title": ""
},
{
"docid": "63b04ad56e75ac2511baa253a54ecb2f",
"score": "0.47290128",
"text": "def past\n # make your own past bets\n @bets = Bet.where('owner = ? AND (status = ? OR status = ? )', params[:id], \"won\", \"lost\").to_a\n # make the friend's past bets\n invs = Invite.where(invitee: params[:id], status: \"accepted\").to_a\n @fbets = []\n invs.each do |inv|\n @fbets.push(inv.bet) if inv.bet.status == \"won\" || inv.bet.status == \"lost\"\n end\n render 'past.json.jbuilder'\n end",
"title": ""
},
{
"docid": "a3c81c29d91980a804898e086d19a13d",
"score": "0.47198647",
"text": "def index\n render status: :ok, json: @test_guide_scenarios\n end",
"title": ""
},
{
"docid": "bf8fa0afc7706415c405d72cf8771a06",
"score": "0.47183955",
"text": "def index\n @lookup_cohorts = LookupCohort.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @lookup_cohorts }\n end\n end",
"title": ""
},
{
"docid": "7673e0a881a682024a441273757fc0df",
"score": "0.471764",
"text": "def index\n #@habits = Habit.find(:all)\n #@habit_assignments = Assignment.find_all_habits\n @habit_assignments = Assignment.find_all_habits(@user.id, params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @habits }\n end\n end",
"title": ""
},
{
"docid": "d7c80622ec224fca4e756d93c8bd6a03",
"score": "0.4713799",
"text": "def goals(*args)\n @client.get \"#{@path}/goals\", Hash[*args]\n end",
"title": ""
},
{
"docid": "94f5ff1d9ae08223b92feedeb0fb9a6c",
"score": "0.4712211",
"text": "def experience_type(params={})\n params = params.only(EXPERIENCE_TYPE_PARAM)\n\n unless params.include?(\"experienceType\") and !params[\"experienceType\"].empty?\n raise InvalidArgumentError, \"Must specify the Experience Type to fetch results for.\"\n end\n\n unless EXPERIENCE_TYPES.include?params[\"experienceType\"]\n raise InvalidArgumentError, \"Must specify a valid Experience Type\"\n end\n\n exp_type = params[\"experienceType\"]\n\n get(\"/me/sport/activities/\" << exp_type, params)\n end",
"title": ""
},
{
"docid": "1574dc9d948769239937627fa6c06961",
"score": "0.47044042",
"text": "def index\n @games = Game.all\n @player_games = current_user.games rescue nil\n @ongoing_games = Game.where(outcome: 'In progress').all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end",
"title": ""
},
{
"docid": "df1bbd7838dc9a9e914f693730ec473d",
"score": "0.46950212",
"text": "def index\n @visits = Visit.all\n end",
"title": ""
},
{
"docid": "df1bbd7838dc9a9e914f693730ec473d",
"score": "0.46950212",
"text": "def index\n @visits = Visit.all\n end",
"title": ""
},
{
"docid": "df1bbd7838dc9a9e914f693730ec473d",
"score": "0.46950212",
"text": "def index\n @visits = Visit.all\n end",
"title": ""
},
{
"docid": "e678f3e74911aa08670c0d2374392909",
"score": "0.4690246",
"text": "def index\n if logged_in?\n @user = current_user\n @situations = @user.situations.all\n @scores = @user.scores.all\n studying_switches_for_situations\n elsif\n @user = current_user\n redirect_to \"/situations\"\n else\n redirect_to \"/\"\n end\n end",
"title": ""
},
{
"docid": "2b43b5222aaa31e268c7e04786ef6065",
"score": "0.468628",
"text": "def index\n @visit_stats = VisitStat.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @visit_stats }\n end\n end",
"title": ""
},
{
"docid": "83f80b7ee36a54cea62363a87f4557b5",
"score": "0.4683511",
"text": "def index\n @arrangements = Arrangement.query_list(params[:auction_id], params[:accept_status])\n render json: @arrangements, status: 200\n end",
"title": ""
},
{
"docid": "d6c3708a90d6f14ff1cc48decf222e58",
"score": "0.4666541",
"text": "def get_assessments(id, params = {})\n get \"/api/v1/projects/#{id}/participants\", params\n end",
"title": ""
},
{
"docid": "26055a5abce77e630d9c357230dbd980",
"score": "0.46647698",
"text": "def response(env)\n env.trace :response_beg\n\n result_set = fetch_twitter_search(env.params['q'])\n\n fetch_trstrank(result_set)\n \n body = JSON.pretty_generate(result_set)\n\n env.trace :response_end\n [200, {}, body]\n end",
"title": ""
},
{
"docid": "a6feca6f99da17ea3426e86904cc2eaf",
"score": "0.46597835",
"text": "def index\n @escenario_ideals = EscenarioIdeal.all\n end",
"title": ""
},
{
"docid": "dd63a3cede2b5c1b23569145ed53ab09",
"score": "0.46427146",
"text": "def index\r\n @visits = Visit.fetch_ordered_by_page(params[\"page\"], [], 'started_at DESC')\r\n end",
"title": ""
},
{
"docid": "00ae2dcdadb9e64447792faf87b3704a",
"score": "0.46426982",
"text": "def index\n @tournaments = @resource_finder.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tournaments }\n end\n end",
"title": ""
},
{
"docid": "21b623c965d25101ab1fde88c8821fca",
"score": "0.46352845",
"text": "def activities\n get_call(\"1/activities.json\")\n end",
"title": ""
},
{
"docid": "f5b52fe2909df5e24461da85b3d1054c",
"score": "0.46264082",
"text": "def test_it_can_get_outcome\n assert_equal :home_win, @game_1.outcome\n end",
"title": ""
},
{
"docid": "b5688ab30ee9282f9a3956468ae338d5",
"score": "0.4624531",
"text": "def all(params = {})\n @client.make_request(:get, 'insurances', MODEL_CLASS, params)\n end",
"title": ""
},
{
"docid": "4660204dcc903d1627169f1981c13638",
"score": "0.4623641",
"text": "def index\n @crime_victims = CrimeVictim.all\n @crime_victim = CrimeVictim.where(:crime_id => params[:crime])\n @victim_excel = Victim.where(id:@crime_victim.victim_id)\n respond_to do |format|\n format.xlsx {\n response.headers[\n 'Content-Disposition'\n ] = \"attachment; filename='Victimas.xlsx'\"\n }\n format.html { render :index }\n end\n end",
"title": ""
},
{
"docid": "5a3069a2e6fce4063cd54a26243afbf5",
"score": "0.46190542",
"text": "def tournaments_info(tournament_id, tournament_type = 'sr:tournament')\n get(\"sports/en/tournaments/#{tournament_type}:#{tournament_id}/info.xml\")\n end",
"title": ""
},
{
"docid": "0aee4e182269ccff45956751acb30c97",
"score": "0.46175957",
"text": "def index\n @exosuits = Exosuit.all\n end",
"title": ""
},
{
"docid": "2194ee2e74c71345dc6bc1e86cb8ba34",
"score": "0.46171165",
"text": "def results(params)\n fetch({'VarTargetCount' => RACE_CAP}.merge params)\n end",
"title": ""
},
{
"docid": "c8f82996414ca35c1654d03e4249c351",
"score": "0.46057132",
"text": "def index\n session['goals_view'] = params[:view] if params[:view].present?\n\n @goals = Goal.all\n #Goal.gds_goals\n respond_to do |format|\n format.html\n format.csv { send_data @goals.to_csv}\n end\n\n end",
"title": ""
},
{
"docid": "2be92f556870239a41da15d149dee8a1",
"score": "0.46051988",
"text": "def parse_outcome(outcome, allow_exclusion:)\n valid_outcomes = experiment? ? variants.keys : [true]\n valid_outcomes << false if allow_exclusion\n valid_outcomes.include?(outcome) ? outcome : nil\n end",
"title": ""
},
{
"docid": "26e92470d9b18f38e9adee5b3137fcc3",
"score": "0.45946932",
"text": "def index\n @visits = @patient.visits\n if @visits.blank?\n redirect_to new_patient_visit_path(@patient) and return\n end\n end",
"title": ""
},
{
"docid": "3e7a546355ee0b9f099a115df6f7a178",
"score": "0.45921",
"text": "def predicted_deaths\n # predicted deaths is solely based on population density\n case @population_density\n when 1..49 then death_factor = 0.05\n when 50..99 then death_factor = 0.1\n when 100..149 then death_factor = 0.2\n when 150..199 then death_factor = 0.3\n else death_factor = 0.4\n end\n \n deaths = (@population*death_factor).floor\n \n print \"#{@state} will lose #{deaths} people in this outbreak\"\n\n end",
"title": ""
},
{
"docid": "fa1dbcb23433225fe1f0be4f223d9247",
"score": "0.45899522",
"text": "def index\n \n @steps = @quest.steps\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @steps }\n end\n end",
"title": ""
},
{
"docid": "d5901bc9d51e88000b731cbc4f5ba74c",
"score": "0.45856807",
"text": "def results(test_id, day, month, year, options={})\n args = {testId: test_id, day: day, month: month, year: year}\n .merge(options)\n get('testresult', args)\n end",
"title": ""
},
{
"docid": "58cecc5854e24d5bd32385c482f2e5a0",
"score": "0.45723096",
"text": "def index\n @invites = current_user.recieved_team_requests\n @sent = current_user.sent_team_requests\n end",
"title": ""
},
{
"docid": "fa86b9f52be6987eca1c2b748fcea1af",
"score": "0.45693707",
"text": "def index\n @experiences = Experience.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @experiences }\n end\n end",
"title": ""
},
{
"docid": "9557fc58f3e251435eed596e21875dc2",
"score": "0.45684263",
"text": "def index\n @besties = get_besties\n @videos = get_videos\n @interactions = get_interactions\n end",
"title": ""
},
{
"docid": "828d9cdc6bff4813159a4240198c7fc4",
"score": "0.45683807",
"text": "def index\n @episodes = Episode.all\n @views_chart = get_all_views(@episodes)\n @change_chart = get_all_differences(@episodes)\n end",
"title": ""
},
{
"docid": "5a52c4c37b5d3f5661b247f313579eef",
"score": "0.45679247",
"text": "def predicted_deaths\n death_toll = (population * death_multiplier).floor\n print \"#{state} will lose #{death_toll} people in this outbreak\"\n end",
"title": ""
},
{
"docid": "afdbaa3b9c5e630df361f7d893cff932",
"score": "0.45660284",
"text": "def get_triggered_incidents\n # use status of incident as a filter\n res = RestClient.get INCIDENT_QUERY_URL, :params => { :status => \"triggered\", :fields => \"incident_number\" }\n end",
"title": ""
},
{
"docid": "63a790b25517d94666acb6e900b010fc",
"score": "0.4564491",
"text": "def index\n @outputs = Output.all\n end",
"title": ""
},
{
"docid": "06b5d3d5618d757a15fcc56b953fdc93",
"score": "0.456225",
"text": "def get_assessments(study_id, instrument_id, ursi: nil)\n act = AssessmentsDownloadAction.new(self)\n act.get(study_id, instrument_id, ursi)\n end",
"title": ""
},
{
"docid": "64aec2da7bec2a9fbbed556fd340813f",
"score": "0.4558466",
"text": "def reports\n @concerns = @city.concerns.where(category: \"Report\")\n render action: :index\n end",
"title": ""
},
{
"docid": "597f27bad03cfc6210644e969c094d5c",
"score": "0.45573688",
"text": "def index\n @interview_decisions = InterviewDecision.all\n end",
"title": ""
},
{
"docid": "c5075760f18b79b2abe8255eccceb68b",
"score": "0.45510122",
"text": "def predicted_deaths\n # predicted deaths is solely based on population density\n\n case @population_density\n when 0..50\n number_of_deaths = (@population * 0.05).floor\n when 50..100\n number_of_deaths = (@population * 0.1).floor\n when 100..150\n number_of_deaths = (@population * 0.2).floor\n when 150..200\n number_of_deaths = (@population * 0.3).floor\n else\n number_of_deaths = (@population * 0.4).floor\n end\n\n print \"#{@state} will lose #{number_of_deaths} people in this outbreak\"\n\n end",
"title": ""
},
{
"docid": "dd0ed25d819c5ddb6b8cd1c8b2c0e032",
"score": "0.4542915",
"text": "def index\n @site = Site.find(params[:site_id])\n @visits = @site.visits\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @visits }\n end\n end",
"title": ""
},
{
"docid": "b7b015a7218e025b3405d79b0ea65837",
"score": "0.45428228",
"text": "def index\n @upcoming_harvests = Harvest.upcoming\n @past_harvests = Harvest.past\n\n if params[:person_id]\n @person = Person.find(params[:person_id])\n @upcoming_harvests = @person.upcoming_harvests\n @past_harvests = @person.past_harvests\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @harvests }\n end\n end",
"title": ""
},
{
"docid": "5ab7424a51994a7c86ac4debfe9125d3",
"score": "0.45395622",
"text": "def index\n @goal_steps = GoalStep.all\n end",
"title": ""
},
{
"docid": "d34cd896dbed46cea2dbb9dc4a4df725",
"score": "0.45392352",
"text": "def uncoded_visits\n session[:sub_nav_clicked] = 'Uncoded Visits'\n begin\n condition_string = \"visits.practice_id = #{session[:practice_id]} and (claims.status = 'PENDING_CHARGE_REVIEW' or claims.status = 'PENDING_ERRORS') and (visit_batch_id is NULL or visit_batches.user_id = #{session[:user]})\"\n @visits = Visit.paginate(:conditions=>condition_string,\n :include=>[:claims,:patient,{:doctor => :user}, :charge_entries, :visit_batch],\n :order=>\"visit_batch_id Desc\",:per_page => PER_PAGE,:page => params[:page])\n total_records = Visit.find(:all,:conditions=>condition_string,\n :include=>[:claims,:visit_batch])\n @charge = total_records.sum(&:charge)\n @ins_due = total_records.sum(&:ins_due)\n @patient_due = total_records.sum(&:patient_due)\n \n @no_of_record=@visits.length\n respond_to do |format|\n format.html {\n render :action => 'uncoded_visits'\n }\n format.js {\n render :update do |page|\n page.replace_html 'result_pager', :partial => 'uncoded_visits'\n end\n }\n end\n rescue => e\n render :text=> \" #{e.message}\"\n end\n end",
"title": ""
},
{
"docid": "a16b1ce2f65f4ad1159cc9af92a0d714",
"score": "0.4538454",
"text": "def predicted_deaths\n # predicted deaths is solely based on population density\n if @range != 5.0\n number_of_deaths = (@population * (0.5-(@range/10.0))).floor\n else number_of_deaths = (@population * (@range/100)).floor\n end\n\n\n print \"#{@state} will lose #{number_of_deaths} people in this outbreak\"\n\n end",
"title": ""
},
{
"docid": "880eb441c8464213d8f938931742390a",
"score": "0.45383394",
"text": "def get_companies_reporting_earnings_within days\n @earnings = robinhood_get(\"#{ROBINHOOD_API_URL}/marketdata/earnings/?range=#{days}day\")[\"results\"]\n end",
"title": ""
},
{
"docid": "53aef4f8e44f242f47281271148f2e3b",
"score": "0.45337686",
"text": "def predicted_deaths\n # predicted deaths is solely based on population density\n number_of_deaths = (@population * (@population_density/500)).floor\n print \"#{@state} will lose #{number_of_deaths} people in this outbreak\"\n\n end",
"title": ""
},
{
"docid": "c25f79fd33527ff1865b6ac86183e514",
"score": "0.45333007",
"text": "def index\n @visited_places = VisitedPlace.all\n end",
"title": ""
},
{
"docid": "b1645c6991415c417b3f08cd7a1c8108",
"score": "0.45329714",
"text": "def predicted_deaths\n # predicted deaths is solely based on population density\n case @population_density\n when (150..199)\n number_of_deaths = (@population * 0.3).floor\n when (100..149)\n number_of_deaths = (@population * 0.2).floor\n when (50..99)\n number_of_deaths = (@population * 0.1).floor\n when (0..49)\n number_of_deaths = (@population * 0.05).floor\n else\n number_of_deaths = (@population * 0.4).floor\n end\n\n print \"#{@state} will lose #{number_of_deaths} people in this outbreak\"\n\n end",
"title": ""
}
] |
963a301c7aee634e05ea49d583ad0528
|
Finds a class or module named +symbol+
|
[
{
"docid": "b3a15a79cc777acc6c926baba604291f",
"score": "0.76863235",
"text": "def find_local_symbol(symbol)\n find_class_or_module_named(symbol) || super\n end",
"title": ""
}
] |
[
{
"docid": "1fd32d82b552fc84110717f2d9193800",
"score": "0.8502894",
"text": "def find_class_or_module_named(symbol)\n RDoc::TopLevel.classes_hash.each_value do |c|\n return c if c.full_name == symbol\n end\n\n RDoc::TopLevel.modules_hash.each_value do |m|\n return m if m.full_name == symbol\n end\n\n nil\n end",
"title": ""
},
{
"docid": "47fc2bcdc915182ae153de5434d0c937",
"score": "0.8399954",
"text": "def find_symbol_module(symbol)\n result = nil\n\n # look for a class or module 'symbol'\n case symbol\n when /^::/ then\n result = @store.find_class_or_module symbol\n when /^(\\w+):+(.+)$/\n suffix = $2\n top = $1\n searched = self\n while searched do\n mod = searched.find_module_named(top)\n break unless mod\n result = @store.find_class_or_module \"#{mod.full_name}::#{suffix}\"\n break if result || searched.is_a?(RDoc::TopLevel)\n searched = searched.parent\n end\n else\n searched = self\n while searched do\n result = searched.find_module_named(symbol)\n break if result || searched.is_a?(RDoc::TopLevel)\n searched = searched.parent\n end\n end\n\n result\n end",
"title": ""
},
{
"docid": "fa29b20e5bc28a0ee5ab861c42d665a3",
"score": "0.7855775",
"text": "def find_symbol(symbol)\n find_symbol_module(symbol) || find_local_symbol(symbol)\n end",
"title": ""
},
{
"docid": "5a4d7ea76a9b78114a091a72b121fc4d",
"score": "0.7775556",
"text": "def find_symbol(symbol, method = nil)\n result = nil\n\n case symbol\n when /^::(.*)/ then\n result = top_level.find_symbol($1)\n when /::/ then\n modules = symbol.split(/::/)\n\n unless modules.empty? then\n module_name = modules.shift\n result = find_module_named(module_name)\n\n if result then\n modules.each do |name|\n result = result.find_module_named name\n break unless result\n end\n end\n end\n\n else\n # if a method is specified, then we're definitely looking for\n # a module, otherwise it could be any symbol\n if method then\n result = find_module_named symbol\n else\n result = find_local_symbol symbol\n if result.nil? then\n if symbol =~ /^[A-Z]/ then\n result = parent\n while result && result.name != symbol do\n result = result.parent\n end\n end\n end\n end\n end\n\n if result and method then\n fail unless result.respond_to? :find_local_symbol\n result = result.find_local_symbol(method)\n end\n\n result\n end",
"title": ""
},
{
"docid": "2193b7efdb1e6093ddf94d955c89582c",
"score": "0.76696247",
"text": "def find_local_symbol(symbol)\n find_class_or_module(symbol) || super\n end",
"title": ""
},
{
"docid": "746574aef0e6e407a2faa97477ae336a",
"score": "0.7513964",
"text": "def find_symbol(symbol, method=nil)\n result = super(symbol)\n if not result and symbol =~ /::/\n modules = symbol.split(/::/)\n unless modules.empty?\n module_name = modules.shift\n result = find_module_named(module_name)\n if result\n last_name = \"\"\n previous = nil\n modules.each do |mod|\n previous = result\n last_name = mod\n result = result.find_module_named(mod)\n break unless result\n end\n unless result\n result = previous\n method = last_name\n end\n end\n end\n if result && method\n if !result.respond_to?(:find_local_symbol)\n p result.name\n p method\n fail\n end\n result = result.find_local_symbol(method)\n end\n end\n result\n end",
"title": ""
},
{
"docid": "01e239a15ed4cc24ab5984520d01fd09",
"score": "0.732406",
"text": "def look_for(symbol)\n env = self.find {|e| e.symbol.equal? symbol}\n return env unless env.nil?\n raise NameError.new(\"#{symbol} not found\", symbol)\n end",
"title": ""
},
{
"docid": "7f5a98aba3da9b91ffabb4b145cef8a1",
"score": "0.72480965",
"text": "def find_local_symbol(symbol)\n find_method_named(symbol) or\n find_constant_named(symbol) or\n find_attribute_named(symbol) or\n find_external_alias_named(symbol) or\n find_module_named(symbol) or\n find_file_named(symbol)\n end",
"title": ""
},
{
"docid": "eccaca7f7945d47393d66d676753affa",
"score": "0.72280526",
"text": "def find_local_symbol(symbol)\n find_method_named(symbol) or\n find_constant_named(symbol) or\n find_attribute_named(symbol) or\n find_module_named(symbol) or\n find_file_named(symbol)\n end",
"title": ""
},
{
"docid": "26d1855484370554e7a9b58808f4db30",
"score": "0.7059301",
"text": "def find_by_symbol(symbol)\n fetch([name, symbol.to_s]) do\n where(symbol: symbol).first\n end\n end",
"title": ""
},
{
"docid": "0c30c50c444bca1aa6ffbb5a00962d82",
"score": "0.67579263",
"text": "def find_module_named(name)\n find_class_or_module(name)\n end",
"title": ""
},
{
"docid": "8d60da2d53b550597d5151956de5abd1",
"score": "0.66750187",
"text": "def find_class_or_module name\n name = $' if name =~ /^::/\n @classes_hash[name] || @modules_hash[name]\n end",
"title": ""
},
{
"docid": "d5c61701dc7532ee4bb41f8fa194e2a5",
"score": "0.6607502",
"text": "def find_class_named name\n @classes_hash[name]\n end",
"title": ""
},
{
"docid": "5bfb1ba26262a96b608ee418c84aeb22",
"score": "0.6391261",
"text": "def find_module_named(name)\n res = @modules[name] || @classes[name]\n return res if res\n return self if self.name == name\n find_enclosing_module_named name\n end",
"title": ""
},
{
"docid": "5bfb1ba26262a96b608ee418c84aeb22",
"score": "0.6391261",
"text": "def find_module_named(name)\n res = @modules[name] || @classes[name]\n return res if res\n return self if self.name == name\n find_enclosing_module_named name\n end",
"title": ""
},
{
"docid": "13fa627f9f9a99784c967b4248b68e62",
"score": "0.6372757",
"text": "def find_by_trying(class_name)\n @namespaces.find do |namespace|\n begin\n break namespace.const_get(class_name)\n rescue NameError\n end\n end\n end",
"title": ""
},
{
"docid": "13fa627f9f9a99784c967b4248b68e62",
"score": "0.6372757",
"text": "def find_by_trying(class_name)\n @namespaces.find do |namespace|\n begin\n break namespace.const_get(class_name)\n rescue NameError\n end\n end\n end",
"title": ""
},
{
"docid": "f862531182777b5de32b20a96bd84e8e",
"score": "0.6363874",
"text": "def find(name); end",
"title": ""
},
{
"docid": "b6129ce7e6055b777b5b80943ff29058",
"score": "0.6298051",
"text": "def findExactClassMatch(name)\n fname = name.tr(':', '_')\n return ClassIndex.classExists?(fname)\n end",
"title": ""
},
{
"docid": "47d49231e994a4f3c5e99b06a089d35d",
"score": "0.6275858",
"text": "def find_package(word)\n\t\n\tTextMate.exit_show_tool_tip(\"Please select a class to\\nlocate the package path for.\") if word.empty?\n\t\n\t$package_paths = []\n\t$best_paths = []\n\t\n\tsearch_all_paths(word)\n\t\n\tif $package_paths.size > 0 and $best_paths.size > 0\n\t\t$package_paths = $best_paths + ['-'] + $package_paths\n\telse\n\t\t$package_paths = $best_paths + $package_paths\n\tend\n\n\tTextMate.exit_show_tool_tip \"Class not found\" if $package_paths.empty?\n\n\tif $package_paths.size == 1\n\n\t\t$package_paths.pop\n\t\n\telse\n\t\t\n\t\t# Move any exact hits to the top of the list.\n\t\t$best_paths = $package_paths.grep( /\\.#{word}$/ )\n\t\t\n\t\ti = TextMate::UI.menu($package_paths)\n\t\tTextMate.exit_discard() if i == nil\n\t\t$package_paths[i]\n\n\tend\n\nend",
"title": ""
},
{
"docid": "a73aed46d406695c98f5e026346d89e5",
"score": "0.62608576",
"text": "def find_module_named(name)\n find_class_or_module_named(name) || find_enclosing_module_named(name)\n end",
"title": ""
},
{
"docid": "ad043fa9d4076b16015958e2258d838c",
"score": "0.61965626",
"text": "def find_class_method_named(name)\n @method_list.find { |meth| meth.singleton && meth.name == name }\n end",
"title": ""
},
{
"docid": "ad9dcc2740bf7f655d6680428ff6b2ae",
"score": "0.6136452",
"text": "def find_object(name); end",
"title": ""
},
{
"docid": "d7b9db0663025469e56e861f83c3e3e1",
"score": "0.61272883",
"text": "def find_class_named name\n return self if full_name == name\n return self if @name == name\n\n @classes.values.find do |klass|\n next if klass == self\n klass.find_class_named name\n end\n end",
"title": ""
},
{
"docid": "a56f6b0e4bba2b1aa5237d03f83b95eb",
"score": "0.610019",
"text": "def find(macro_name); end",
"title": ""
},
{
"docid": "386c02375a0f9d872dc6366548fedc9b",
"score": "0.60882753",
"text": "def has_class?(sym)\n `var str=' '+this.__native__.className+' ',match=' '+sym.__value__+' '`\n `str.indexOf(match) > -1`\n end",
"title": ""
},
{
"docid": "b4150c35205d2804100cbdd1d90c749e",
"score": "0.6081085",
"text": "def find_with_const_defined(class_name)\n @namespaces.find do |namespace|\n if namespace.const_defined?(class_name)\n break namespace.const_get(class_name)\n end\n end\n end",
"title": ""
},
{
"docid": "b4150c35205d2804100cbdd1d90c749e",
"score": "0.6081085",
"text": "def find_with_const_defined(class_name)\n @namespaces.find do |namespace|\n if namespace.const_defined?(class_name)\n break namespace.const_get(class_name)\n end\n end\n end",
"title": ""
},
{
"docid": "13f2bc55d932114f935ce8773f241e00",
"score": "0.6074218",
"text": "def find_module_named name\n @modules_hash[name]\n end",
"title": ""
},
{
"docid": "9d08310f80097d857b06c878e5bb3220",
"score": "0.60535216",
"text": "def find(name)\n @@subclasses.fetch(name.to_s, nil)\n end",
"title": ""
},
{
"docid": "1f4a012d6bfed7a64da9b439790ffb02",
"score": "0.6033011",
"text": "def get(symbol)\n sym_key = [self.class, symbol]\n @@sym_map[sym_key] = new(symbol) unless @@sym_map[sym_key]\n @@sym_map[sym_key]\n end",
"title": ""
},
{
"docid": "153e2d27b23e11988c89c10600d42886",
"score": "0.59959453",
"text": "def get_class_by_name( name )\n raise \"get_class_by_name #{name}.#{name.class}\" unless name.is_a?(Symbol)\n c = classes[name]\n #puts \"MISS, no class #{name} #{name.class}\" unless c # \" #{classes}\"\n #puts \"CLAZZ, #{name} #{c.get_type.get_length}\" if c\n c\n end",
"title": ""
},
{
"docid": "7dce8c92102a8cfcc2ac507bd0d34a20",
"score": "0.59575313",
"text": "def get_symbol(sym)\n\t\t\tif @parameters.key?(sym)\n\t\t\t\treturn @parameters[sym]\n\t\t\telsif @species[sym]\n\t\t\t\treturn @species[sym]\n\t\t\telse\n\t\t\t\traise \"Symbol #{sym} not found in model\"\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "2b586895f9a1066e8cff300d66688367",
"score": "0.59478915",
"text": "def symbol_for_name(name)\n if symbols.has_key? name\n symbols[name]\n else\n raise \"No symbol with name #{name} found\"\n end\n end",
"title": ""
},
{
"docid": "9bd88f79fb04643af32132097ad548b7",
"score": "0.5938936",
"text": "def find_class(class_name)\n begin\n klass = Module.const_get(class_name)\n return (klass.is_a?(Class) ? klass : nil)\n rescue NameError\n return nil\n end\n end",
"title": ""
},
{
"docid": "fd150f42e8d9cf0aa0e4d1430100ed78",
"score": "0.5929816",
"text": "def find_symbol(sym, ctx)\n ctx.each do |h|\n if val = resolve_in(h, sym)\n return val\n end\n end\n\n nil\n end",
"title": ""
},
{
"docid": "3c6c3ef4eb4cbf4a0045e6a102473ffa",
"score": "0.59020805",
"text": "def namespaced_class(symbol_name)\n\t\tpath = self\n\t\t_internal_namespaced_class(path, symbol_name)\n\tend",
"title": ""
},
{
"docid": "bfd1411ca4a270c64e0912748e3af781",
"score": "0.58933055",
"text": "def symbol_by_name(name)\n each_symbols.find { |symbol| symbol.name == name }\n end",
"title": ""
},
{
"docid": "c18fddfcb9b86b84a0851a10a5c81787",
"score": "0.58772284",
"text": "def namespaced_class(symbol_name)\n\t\tpath = self.class\n\t\tself.class._internal_namespaced_class(path, symbol_name)\n\tend",
"title": ""
},
{
"docid": "bdd0da4fd75a350fa3eb89eebe94a707",
"score": "0.58760864",
"text": "def find(name, session=nil)\n session ||= SugarCRM.session\n register_all(session) unless initialized?\n session.modules.each do |m|\n return m if m.name == name\n return m if m.klass == name\n end\n false\n end",
"title": ""
},
{
"docid": "0ea458ffe38f1cb7182ad8779c85313a",
"score": "0.5874001",
"text": "def find(name)\n current = self\n key = name.to_sym\n while current\n if current.defs.include?(key)\n return current.defs[key]\n end\n current = current.parent\n end\n \n # TODO: use of :name here couples us to Parser too much?\n return symbol_table.fetch(key){symbol_table[:name]}\n end",
"title": ""
},
{
"docid": "833795bc7cb96ca7b8e0b3b22ae4cbd9",
"score": "0.58410144",
"text": "def resolve(symbol)\n instance = @created[symbol] || construct(symbol)\n end",
"title": ""
},
{
"docid": "2b1b7e3ff51d8c19ef9a1fcd1dc733d9",
"score": "0.5779513",
"text": "def known_symbol?(s)\n @@known_symbols_by_glass[glass] && @@known_symbols_by_glass[glass].member?(s)\n end",
"title": ""
},
{
"docid": "58188174c40f07fe5fe7d10f0e8e4900",
"score": "0.5756046",
"text": "def class_const(sym)\n self.class.const_get(sym)\n end",
"title": ""
},
{
"docid": "bc739823c1fdec48621fb765f021b111",
"score": "0.574783",
"text": "def find_class_or_module name\n @store.find_class_or_module name\n end",
"title": ""
},
{
"docid": "7b7b3187610f339a6697aea25da93ba4",
"score": "0.57036036",
"text": "def find_method_named(name)\n case name\n when /\\A#/ then\n find_method name[1..-1], false\n when /\\A::/ then\n find_method name[2..-1], true\n else\n @method_list.find { |meth| meth.name == name }\n end\n end",
"title": ""
},
{
"docid": "86019c3d93e69c6816d05e6230817693",
"score": "0.5692611",
"text": "def find_by_name(name)\n end",
"title": ""
},
{
"docid": "604f9857fef27a3ae4d9d52af5c3f164",
"score": "0.56911397",
"text": "def find_constant_named(name)\n @constants.find {|m| m.name == name}\n end",
"title": ""
},
{
"docid": "b5eeefb39f50c9605ee50d0241cc4c85",
"score": "0.5686896",
"text": "def findClassesThatMatch(name)\n fname = name.tr(':', '_')\n return ClassIndex.findClasses(fname)\n end",
"title": ""
},
{
"docid": "7b7a9af7c68186915ed52af118d0ec15",
"score": "0.56676096",
"text": "def find( name )\n @commands.find { |klass| klass.command_name == name }\n end",
"title": ""
},
{
"docid": "11af13eae87cc3cc8ec4345d27f84c81",
"score": "0.56672305",
"text": "def find(key)\n new(key: key, name: TYPES[key.to_sym]) if TYPES.has_key?(key.to_sym)\n end",
"title": ""
},
{
"docid": "4ee0d215764ec46fae631d5dbee4b425",
"score": "0.566696",
"text": "def findClass(name)\n\n cl = findClassesThatMatch(name)\n\n # now a slight problem. If the user said 'File', we'll\n # have matched 'File' and 'File__Stat', but really\n # just 'File' was wanted, so...\n\n cl = [ name ] if cl.size > 1 && cl.include?(name)\n\n case cl.size\n when 0\n @op.error(\"Couldn't find class/module `#{name}'.\\n\" +\n \"Use #$0 with no parameter for a list\")\n throw :exit, 1\n\n when 1\n file_name = File.join($datadir, cl[0])\n res = @desc_files[file_name]\n if not res\n File.open(file_name) do |f|\n res = @desc_files[file_name] = Marshal.load(f)\n end\n end\n return res\n else\n return cl\n end \n end",
"title": ""
},
{
"docid": "e4c597fdee3d8b44089e1c5c69c73666",
"score": "0.56463134",
"text": "def service(symbol)\n \"#{self.class}::#{symbol.to_s.camelcase}\".constantize\n end",
"title": ""
},
{
"docid": "722603e7a8feca3123789c67659558b6",
"score": "0.56335497",
"text": "def find(name)\n register_all unless initialized?\n SugarCRM.modules.each do |m|\n return m if m.name == name\n return m if m.klass == name\n end\n false\n end",
"title": ""
},
{
"docid": "c47bf1e57517b592365cdfddbf216920",
"score": "0.5632826",
"text": "def find(symbol)\n response = Request.new(\"/stock/#{symbol}/quote\").get\n Models::Quote.new(response.body)\n end",
"title": ""
},
{
"docid": "48efef5f8edd285373ee9b0bceaf2e1c",
"score": "0.56293714",
"text": "def find_by_name(name)\n types[name]\n end",
"title": ""
},
{
"docid": "d751198240298e730793723df7ba25b5",
"score": "0.5627257",
"text": "def find_constant_named(name)\n @constants.find do |m|\n m.name == name || m.full_name == name\n end\n end",
"title": ""
},
{
"docid": "5b4ca01442cc0d493aeca7edb2953bb1",
"score": "0.5617147",
"text": "def method_missing(method, *args, &block)\n if name?(method.to_sym)\n find(method.to_sym)\n else\n super\n end\n end",
"title": ""
},
{
"docid": "c64149f4eb514fb68ac0644faa43581d",
"score": "0.56051624",
"text": "def find_method(name, singleton)\n @method_list.find { |m|\n if m.singleton\n m.name == name && m.singleton == singleton\n else\n m.name == name && !m.singleton && !singleton\n end\n }\n end",
"title": ""
},
{
"docid": "4bb83b2135194772e9644c560fa2fabe",
"score": "0.5582931",
"text": "def find(thing)\n case thing\n when Symbol\n find_by_tag(thing)\n when String\n find_by_string(thing)\n when Array\n find_by_string(thing.join(' '))\n when Node\n thing\n end\n end",
"title": ""
},
{
"docid": "c8b9fd15ba9754c10b35ab6e92c6010b",
"score": "0.5576547",
"text": "def find(typed_name)\n nil\n end",
"title": ""
},
{
"docid": "c51c625a86a96ac033ba6ff715cd113d",
"score": "0.5569997",
"text": "def find_by_name(name)\n binding.pry\n self.name\n end",
"title": ""
},
{
"docid": "de3224a9a66b862411932d4a6380c3ec",
"score": "0.55633837",
"text": "def test_find_class_named\n @c2.classes_hash['C2'] = @c2\n\n assert_nil @c2.find_class_named('C1')\n end",
"title": ""
},
{
"docid": "c908b4f36dc266d51a52b85ba8ad9121",
"score": "0.55553025",
"text": "def method_missing(sym, *args)\n lookup(sym.to_sym)\n end",
"title": ""
},
{
"docid": "eda1ca25cc3c71fc4517cde8e6a50911",
"score": "0.55353653",
"text": "def find(typed_name)\n # This loader is tailored to only find entries in the current runtime\n return nil unless typed_name.name_authority == Pcore::RUNTIME_NAME_AUTHORITY\n\n # Assume it is a global name, and that all parts of the name should be used when looking up\n name_parts = typed_name.name_parts\n\n # Certain types and names can be disqualified up front\n if name_parts.size > 1\n # The name is in a name space.\n\n # Then entity cannot possible be in this module unless the name starts with the module name.\n # Note:\n # * If \"module\" represents a \"global component\", the module_name is nil and cannot match which is\n # ok since such a \"module\" cannot have namespaced content).\n # * If this loader is allowed to have namespaced content, the module_name can be set to NAMESPACE_WILDCARD `*`\n #\n return nil unless name_parts[0] == module_name || module_name == NAMESPACE_WILDCARD\n else\n # The name is in the global name space.\n\n case typed_name.type\n when :function, :resource_type, :resource_type_pp\n # Can be defined in module using a global name. No action required\n\n when :plan\n if !global?\n # Global name must be the name of the module\n return nil unless name_parts[0] == module_name\n\n # Look for the special 'init' plan.\n origin, smart_path = find_existing_path(init_plan_name)\n return smart_path.nil? ? nil : instantiate(smart_path, typed_name, origin)\n end\n\n when :task\n if !global?\n # Global name must be the name of the module\n return nil unless name_parts[0] == module_name\n\n # Look for the special 'init' Task\n origin, smart_path = find_existing_path(init_task_name)\n return smart_path.nil? ? nil : instantiate(smart_path, typed_name, origin)\n end\n\n when :type\n if !global?\n # Global name must be the name of the module\n unless name_parts[0] == module_name || module_name == NAMESPACE_WILDCARD\n # Check for ruby defined data type in global namespace before giving up\n origin, smart_path = find_existing_path(typed_name)\n return smart_path.is_a?(LoaderPaths::DataTypePath) ? instantiate(smart_path, typed_name, origin) : nil\n end\n\n # Look for the special 'init_typeset' TypeSet\n origin, smart_path = find_existing_path(init_typeset_name)\n return nil if smart_path.nil?\n\n value = smart_path.instantiator.create(self, typed_name, origin, get_contents(origin))\n if value.is_a?(Types::PTypeSetType)\n # cache the entry and return it\n return set_entry(typed_name, value, origin)\n end\n\n # TRANSLATORS 'TypeSet' should not be translated\n raise ArgumentError, _(\"The code loaded from %{origin} does not define the TypeSet '%{module_name}'\") %\n { origin: origin, module_name: name_parts[0].capitalize }\n end\n else\n # anything else cannot possibly be in this module\n # TODO: should not be allowed anyway... may have to revisit this decision\n return nil\n end\n end\n\n # Get the paths that actually exist in this module (they are lazily processed once and cached).\n # The result is an array (that may be empty).\n # Find the file to instantiate, and instantiate the entity if file is found\n origin, smart_path = find_existing_path(typed_name)\n return instantiate(smart_path, typed_name, origin) unless smart_path.nil?\n\n return nil unless typed_name.type == :type && typed_name.qualified?\n\n # Search for TypeSet using parent name\n ts_name = typed_name.parent\n while ts_name\n # Do not traverse parents here. This search must be confined to this loader\n tse = get_entry(ts_name)\n tse = find(ts_name) if tse.nil? || tse.value.nil?\n if tse && (ts = tse.value).is_a?(Types::PTypeSetType)\n # The TypeSet might be unresolved at this point. If so, it must be resolved using\n # this loader. That in turn, adds all contained types to this loader.\n ts.resolve(self)\n te = get_entry(typed_name)\n return te unless te.nil?\n end\n ts_name = ts_name.parent\n end\n nil\n end",
"title": ""
},
{
"docid": "ca337b60394763a59f5628b8da4b476f",
"score": "0.5532231",
"text": "def clazz\n Module.const_get(name)\n rescue NameError\n nil\n end",
"title": ""
},
{
"docid": "ed53914a349f70e835a708faf32fe091",
"score": "0.5522862",
"text": "def find_file_named(name)\n top_level.class.find_file_named(name)\n end",
"title": ""
},
{
"docid": "6595c4978901796529d4ee24c9625d1b",
"score": "0.5515206",
"text": "def lookup(token)\n if @subroutine.key?(token.val)\n @subroutine[token.val].vm_address\n elsif @class.key?(token.val)\n @class[token.val].vm_address\n else\n puts \"#{token.val} cannot be found in symbol tables\"\n end\n end",
"title": ""
},
{
"docid": "1f80754d3254fba430ea28d40ebd8779",
"score": "0.54917264",
"text": "def lookup_class\r\n ObjectSpace.each_object(Class) do |obj|\r\n return obj if obj.ancestors.include?(Rails::Generator::Base) and\r\n obj.name.split('::').last == class_name\r\n end\r\n raise NameError, \"Missing #{class_name} class in #{class_file}\"\r\n end",
"title": ""
},
{
"docid": "ae7c59e4c90d1f462d81ebedefb969a0",
"score": "0.5485569",
"text": "def method_missing(method, *args)\n begin\n if method != :find_by_symbol\n if obj = find_by_symbol(method)\n redefine_method method do\n find_by_symbol(method)\n end\n return obj\n end\n end\n rescue\n # Ignore errors, and call super\n end\n super\n end",
"title": ""
},
{
"docid": "83b9bcb4f569c9cf400fc78715b429a9",
"score": "0.5478576",
"text": "def lookup(identifier)\n\t\tif @symbols.has_key?(identifier)\n\t\t\treturn @symbols[identifier]\n\t\telse\n\t\t\tprint \"Identificador: #{identifier}, no se encuentra en ningun alcance\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "d7fc8e5f0818d78083d39a6d90e70f17",
"score": "0.54675716",
"text": "def find_method_named(name)\n @method_list.find { |meth| meth.name == name }\n end",
"title": ""
},
{
"docid": "21243286d938332a447341e88504184a",
"score": "0.5457019",
"text": "def find_instance_method_named(name)\n @method_list.find { |meth| !meth.singleton && meth.name == name }\n end",
"title": ""
},
{
"docid": "37a9e1506a4b2a17c17a3d1ab20eb9df",
"score": "0.5443143",
"text": "def find_class(raw_name, name)\n unless @classes[raw_name]\n if raw_name =~ /^rb_m/\n container = @top_level.add_module RDoc::NormalModule, name\n else\n container = @top_level.add_class RDoc::NormalClass, name\n end\n\n container.record_location @top_level\n @classes[raw_name] = container\n end\n @classes[raw_name]\n end",
"title": ""
},
{
"docid": "439000bf3dc7ae1d5d01a6a4e979af12",
"score": "0.54376775",
"text": "def find_object(name)\n @search_paths.unshift(@cache[name]) if @cache[name]\n @search_paths.unshift(Registry.yardoc_file)\n\n # Try to load it from in memory cache\n log.debug \"Searching for #{name} in memory\"\n obj = try_load_object(name, nil)\n return obj if obj\n\n log.debug \"Searching for #{name} in search paths\"\n @search_paths.each do |path|\n next unless File.exist?(path)\n log.debug \"Searching for #{name} in #{path}...\"\n Registry.load(path)\n obj = try_load_object(name, path)\n return obj if obj\n end\n nil\n end",
"title": ""
},
{
"docid": "9b33a39e3acb3a58ca340bb695ad0949",
"score": "0.54304457",
"text": "def from_symbol(symbol)\n name = Inflector.camelize(\"#{symbol}_controller\")\n Inflector.constantize(name)\n rescue NameError\n raise Acoustic::ControllerNameError.new(name)\n end",
"title": ""
},
{
"docid": "fe060c269422802537c19ad711088063",
"score": "0.5420181",
"text": "def search_for(model, symbol, &blk)\n @search_helpers ||= Hash.new\n model_specific = @search_helpers[model.to_s] ||= Hash.new\n\n model_specific[symbol] = blk if blk\n\n model_specific[symbol]\n end",
"title": ""
},
{
"docid": "1b7a1fb71d0d0ac022aa836cff6cf0a4",
"score": "0.54186714",
"text": "def find_node ast, klass\n ast.find {|n| n.content.class == klass }\nend",
"title": ""
},
{
"docid": "baefef98a25198a6a0ff1b0e2515d95a",
"score": "0.5409189",
"text": "def locate_method\n <<-CODE\n t1 = stack_pop(); // include_private\n t2 = stack_pop(); // meth\n t3 = stack_pop(); // self\n stack_push(cpu_locate_method_on(state, c, t3, t2, t1));\n CODE\n end",
"title": ""
},
{
"docid": "d542760c7529943969fc2061a0343207",
"score": "0.54030836",
"text": "def class_variable_defined?(sym) end",
"title": ""
},
{
"docid": "0d7f8313192b7cc753d6a23b6d228124",
"score": "0.5388515",
"text": "def search_for(model, symbol, &blk)\n @search_helpers ||= Hash.new\n model_specific = @search_helpers[model.to_s] ||= Hash.new\n\n model_specific[symbol] = blk if blk\n model_specific[symbol]\n end",
"title": ""
},
{
"docid": "76b8c82928b06a800687cb6e51854210",
"score": "0.5386369",
"text": "def select_symbol(symbol)\r\n @list.each_index {|i| select(i) if @list[i][:symbol] == symbol }\r\n end",
"title": ""
},
{
"docid": "e265567089ce54a333db078903bdf56d",
"score": "0.53831494",
"text": "def find_engine\n result = nil\n # We already know the name of the gem from user input\n if Gem.loaded_specs.has_key? gem_name\n # Let's get the gem's full path in the filesystem\n gpath = Gem.loaded_specs[gem_name].full_gem_path\n # Then match the path we've got to the path of an engine - \n # which should have its Module Name (aka paydirt)\n Rails::Application::Railties.engines.each do |engine| \n if engine.class.root.to_s == gpath\n # Get the class name from the engine hash\n result = engine.class\n break\n end\n end\n end\n result\n end",
"title": ""
},
{
"docid": "1dc361b600da6fc11f4789b3e95860ca",
"score": "0.5382176",
"text": "def object_symbol\n class_name = self.class.name\n index = class_name.rindex(/::/)\n class_name[index+2..-1].underscore.to_sym\n end",
"title": ""
},
{
"docid": "9492dfe4a4cf5e45e60cc29c0ed7e76b",
"score": "0.53748244",
"text": "def class_variable_get(sym) end",
"title": ""
},
{
"docid": "a099988e9de12a71cf38e695e44fa2a9",
"score": "0.53613883",
"text": "def lookup(symbol)\n symbol = symbol.to_s\n sym_size = { 32 => 16, 64 => 24 }[@elfclass]\n # Leak GNU_HASH section header.\n nbuckets = @leak.d(hshtab)\n symndx = @leak.d(hshtab + 4)\n maskwords = @leak.d(hshtab + 8)\n\n l_gnu_buckets = hshtab + 16 + (@elfword * maskwords)\n l_gnu_chain_zero = l_gnu_buckets + (4 * nbuckets) - (4 * symndx)\n\n hsh = gnu_hash(symbol)\n bucket = hsh % nbuckets\n\n i = @leak.d(l_gnu_buckets + bucket * 4)\n return nil if i.zero?\n\n hsh2 = 0\n while (hsh2 & 1).zero?\n hsh2 = @leak.d(l_gnu_chain_zero + i * 4)\n if ((hsh ^ hsh2) >> 1).zero?\n sym = symtab + sym_size * i\n st_name = @leak.d(sym)\n name = @leak.n(strtab + st_name, symbol.length + 1)\n if name == (\"#{symbol}\\x00\")\n offset = { 32 => 4, 64 => 8 }[@elfclass]\n st_value = unpack(@leak.n(sym + offset, @elfword))\n return @libbase + st_value\n end\n end\n i += 1\n end\n nil\n end",
"title": ""
},
{
"docid": "06076bb356e6de06896e88b7f956e919",
"score": "0.5360107",
"text": "def simple_get(symbol)\n @engine.get(symbol.to_s, nil, false)\n end",
"title": ""
},
{
"docid": "2ef4d929de84dbf4772c0b6a84c63044",
"score": "0.5358033",
"text": "def defined?(name)\n catch (:exit) do\n\n case name\n when /^#{CN_PATTERN}$/o\n return \"ClassModule\" if findExactClassMatch(name)\n \n when /^(#{CN_PATTERN})(\\.|\\#|::)(.+)/o #/\n cname, type, mname = $1, $2, $3\n\n return nil unless findExactClassMatch(cname)\n \n cl = findClass(cname)\n\n if ClassModule === cl\n return \"Method\" if cl.findExactMethod(mname, type == \"::\")\n end\n end\n end\n \n nil\n end",
"title": ""
},
{
"docid": "47f3f16741955ec2c581e4388dc6916e",
"score": "0.53569937",
"text": "def search_class(module_name)\n file_array = module_name.split('::')\n\n #search module path for the class\n $mod_dir.each do |y|\n if File.directory?(\"#{y}/#{file_array[0]}\")\n @filename = \"#{y}/#{file_array[0]}\"\n break\n end\n end\n\n #did we find the class?\n if defined? @filename\n @filename = \"#{@filename}/manifests\"\n #if base case make the path correct, else fill out the whole path with sub classes\n if file_array.count == 1\n @filename = \"#{@filename}/init\"\n else\n file_array.shift\n file_array.each do |k|\n @filename = \"#{@filename}/#{k}\"\n end\n end\n @filename = \"#{@filename}.pp\"\n else\n #Error if class cannot be found\n puts \"Cannot find class\"\n return 0\n end\n\n #Determine if the file actually exists\n if not File.exists?(@filename)\n puts \"No such class\"\n return 1\n end\n\n #Read the file\n f = File.open(@filename,'r')\n g =f.readlines\n\n #loop through the lines and find recourses and included classes\n g.each do |val|\n # find resources\n if n = val.match(/^[ \\t]*[a-z:].*{[ \\t]*['\\\"].*['\\\"]:/)\n out_val = n[0].sub(/\"/,\"'\").gsub(/\\s+/,\"\")\n #Determine if we have a duplicate resource and display if we do\n if $resource_variables.has_key?(out_val)\n puts \"\\n******** DEPLICATE FOUND! ********\"\n $resource_variables[out_val] = $resource_variables[out_val].push(module_name)\n puts \"#{out_val} defined in these classes: #{$resource_variables[out_val]}\"\n else\n #Add resource to hash with name of containing class\n $resource_variables[out_val] = [module_name]\n end\n next\n end\n # find included classes\n if m = val.match(/^[ \\t]*include[ \\t]*.*/)\n out_val = m[0]\n x = m[0].gsub(/^[ \\t]*include[ \\t]/,'')\n #if class is not in our array add it and then call this class to iterate that included class\n if not $include_variables.include?(x)\n $include_variables.push(x.strip)\n search_class(x)\n end\n end\n end\nend",
"title": ""
},
{
"docid": "cb5e2ec3861e71ccdf19a4771d8393bb",
"score": "0.5350583",
"text": "def class_get class_name\n\t\t\t\t@monitor.synchronize do\n\t\t\t\t\tproviders.each do |p|\n\t\t\t\t\t\tbegin\n\t\t\t\t\t\t\treturn p.class_get(class_name) \n\t\t\t\t\t\trescue NotExist;\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\t\traise \"Class '#{class_name}' doesn't exist!\"\n\t\t\t\tend\n\t\t\tend",
"title": ""
},
{
"docid": "dbc8c5fe84bf919cb5927ff5873ef4fd",
"score": "0.53376096",
"text": "def find_from_parts(modules)\n modules.find do |mod|\n next nil if mod.blank?\n ActiveSupport::Inflector.constantize(mod).constants.include?(\n name.to_s.classify.to_sym\n )\n end\n end",
"title": ""
},
{
"docid": "e007f3596740e2d1eaf4475678026b3c",
"score": "0.532529",
"text": "def class_by_name name\n # http://stackoverflow.com/questions/14070369/how-to-instantiate-class-from-name-string-in-rails\n Object.const_get name.to_s\n\n end",
"title": ""
},
{
"docid": "384d9f186b6ba4e3dc1b04bc6b3045b3",
"score": "0.5322917",
"text": "def find_command( name )\n commands.each { |cmd| return cmd if cmd.name == name }\n nil\n end",
"title": ""
},
{
"docid": "e04074282762f28e0c7c33329882c621",
"score": "0.5321897",
"text": "def lookup(method_name)\n method = @runtime_methods[method_name]\n unless method\n if @runtime_superclass\n return @runtime_superclass.lookup(method_name)\n else\n return nil\n end\n end\n method\n end",
"title": ""
},
{
"docid": "bb32092122f1b0f1e50e736e16267dfa",
"score": "0.5316792",
"text": "def find_method(method_name)\n reg = Regexp.new(\"#{method_name}\", true)\n self.methods.sort.select {|meth| reg.match(meth)}\n end",
"title": ""
},
{
"docid": "bb32092122f1b0f1e50e736e16267dfa",
"score": "0.5316792",
"text": "def find_method(method_name)\n reg = Regexp.new(\"#{method_name}\", true)\n self.methods.sort.select {|meth| reg.match(meth)}\n end",
"title": ""
},
{
"docid": "d93fd0eb52b9517bb056c2688dc2cb7c",
"score": "0.5308464",
"text": "def find_instance_method_named(name)\n @method_list.find { |meth| meth.name == name && !meth.singleton }\n end",
"title": ""
},
{
"docid": "734814552e1366bc4c423ab5acd4105a",
"score": "0.5306381",
"text": "def find_by_token(name, token)\n token = find_token(:name => \"#{name}\", :token => token)\n token.object if token\n end",
"title": ""
},
{
"docid": "273e973ef7c54ce59c9907e9e2a6f168",
"score": "0.5304605",
"text": "def find(name, deep=true)\n sym = name.to_sym\n ms = matches.select {|m| m.has_name?(sym) }\n ms.concat(matches.map {|m| m.find(name, deep) }.flatten) if deep\n ms\n end",
"title": ""
},
{
"docid": "5ccd1e6ad153fa1f6e86f7a4cc608028",
"score": "0.5303719",
"text": "def lookup(name, pack_type = {})\n compile if compiling?\n\n find(full_pack_name(name, pack_type[:type]))\n end",
"title": ""
}
] |
693e7b48148af1539f386500c0d3c0dc
|
Callback to update time
|
[
{
"docid": "892ca19b7e5cc38f7d76097275416ebd",
"score": "0.0",
"text": "def update_total(result)\n \tself.secs = results.reduce(0) do |total, result|\n \t\ttotal + result.secs.to_i\n \tend\n end",
"title": ""
}
] |
[
{
"docid": "4a8305974488c3f6027e966e0c72b229",
"score": "0.75309944",
"text": "def update_time\n UV.update_time(default_loop)\n end",
"title": ""
},
{
"docid": "6eb2f6317fe0e36444094817c122b4cb",
"score": "0.74128515",
"text": "def update_time\n UV.update_time(@pointer)\n\n self\n end",
"title": ""
},
{
"docid": "8fff00287cef54a804e9d2a6d4242721",
"score": "0.74092877",
"text": "def update_time\n self.time = self.hours.to_i*3600 + self.minutes.to_i*60\n end",
"title": ""
},
{
"docid": "9044443e4370279bfa5d9c9f4618cd11",
"score": "0.74063873",
"text": "def modify_time(); @modify_time; end",
"title": ""
},
{
"docid": "7af57d2f3875bd8b2b228954ebac5dfa",
"score": "0.7370769",
"text": "def scheduled_update(time_elapsed)\n end",
"title": ""
},
{
"docid": "3ea236a4375ee7dba5a705cb1434bd9e",
"score": "0.7267102",
"text": "def update(dt); end",
"title": ""
},
{
"docid": "c49fc0e83e38aea1c75be2cdc6982e1c",
"score": "0.725938",
"text": "def update\n @current_time = @current_time + update_interval\n set_updated\n end",
"title": ""
},
{
"docid": "139e1fca3bb2bc06c675a05255f335f5",
"score": "0.7248869",
"text": "def update(current_time)\n\t\t# do nothing\n\tend",
"title": ""
},
{
"docid": "78e3dd5f5e83440531e0d4b938342b09",
"score": "0.7224596",
"text": "def calc_time\n\n end",
"title": ""
},
{
"docid": "3c37883a63bb33d1f8bf5303f9374204",
"score": "0.7206927",
"text": "def update_time\n @timer = 0\n return if $game_switches[Sw::TJN_NoTime]\n update_tone if $game_switches[Sw::TJN_RealTime] ? update_real_time : update_virtual_time\n # Trigger an on_update event for Yuki::TJN\n Scheduler.start(:on_update, self)\n end",
"title": ""
},
{
"docid": "5c5f0976a9d87b6581708704fc3dcf0c",
"score": "0.71790653",
"text": "def update_time(now)\n t = @updated_at ? (now - @updated_at) : 0\n @rd = Math.sqrt(@rd ** 2 + @c ** 2 * t).clamp(@rd_min, @rd_max)\n @updated_at = now\n end",
"title": ""
},
{
"docid": "5599eb375072a8172c73b256aaae980d",
"score": "0.71453696",
"text": "def update_time\n @current = (Time.now - @initial).round 2\n end",
"title": ""
},
{
"docid": "4c6291287bda8a9bb7bb6e88b58b566c",
"score": "0.7114518",
"text": "def update_timestep\n @update_timestep\n end",
"title": ""
},
{
"docid": "50aadba54362925c30f4871fe33c395e",
"score": "0.7002496",
"text": "def setTime\n\n\tend",
"title": ""
},
{
"docid": "951d202aba13bf7b118896f4e8d56a74",
"score": "0.69772273",
"text": "def set_time\n @last_updated = time\n end",
"title": ""
},
{
"docid": "74785d3ae518f192630d622e5c728682",
"score": "0.696315",
"text": "def update_time\n self.class.update_time\n end",
"title": ""
},
{
"docid": "052319787d533e92c75feead5aeb3786",
"score": "0.69550985",
"text": "def TimeHasChanged(theClock, ti)\n puts \"Current Time: #{ti.hour}:#{ti.min}:#{ti.sec}\"\n end",
"title": ""
},
{
"docid": "052319787d533e92c75feead5aeb3786",
"score": "0.69550985",
"text": "def TimeHasChanged(theClock, ti)\n puts \"Current Time: #{ti.hour}:#{ti.min}:#{ti.sec}\"\n end",
"title": ""
},
{
"docid": "41a16c881c2764e37a63e4ca763c95c0",
"score": "0.6904224",
"text": "def update options\n @time = options[:time]\n end",
"title": ""
},
{
"docid": "06acaa31024ec2b6d4ca36a26231c9b4",
"score": "0.6890937",
"text": "def reload_time\n end",
"title": ""
},
{
"docid": "380a0937ab9174452536b4edfa8c7ee0",
"score": "0.6855317",
"text": "def update_time_delta\n @update_time - Time.now.to_i\n end",
"title": ""
},
{
"docid": "80766b98602ea81c7ab2b19aaf0a65fa",
"score": "0.6814095",
"text": "def update!(**args)\n @time = args[:time] if args.key?(:time)\n end",
"title": ""
},
{
"docid": "9a1516eb90cb15ff48d09e9080e0b088",
"score": "0.67511517",
"text": "def update_time\n formated_time = Time.now.strftime \"%H:%M:%S\"\n \"(updated at #{formated_time})\"\nend",
"title": ""
},
{
"docid": "fb967bf7fd14e641cc1056e5965b8b3d",
"score": "0.6705117",
"text": "def current_time ; TurnManager.current_time end",
"title": ""
},
{
"docid": "7e72a9c6a6111007c8687290baaa9d72",
"score": "0.66756517",
"text": "def updated\n Time.now\n end",
"title": ""
},
{
"docid": "d67a5209cbeedf518097d2a6c15dc1d1",
"score": "0.6674208",
"text": "def time; end",
"title": ""
},
{
"docid": "d67a5209cbeedf518097d2a6c15dc1d1",
"score": "0.6674208",
"text": "def time; end",
"title": ""
},
{
"docid": "d67a5209cbeedf518097d2a6c15dc1d1",
"score": "0.6674208",
"text": "def time; end",
"title": ""
},
{
"docid": "d67a5209cbeedf518097d2a6c15dc1d1",
"score": "0.6674208",
"text": "def time; end",
"title": ""
},
{
"docid": "d67a5209cbeedf518097d2a6c15dc1d1",
"score": "0.6674208",
"text": "def time; end",
"title": ""
},
{
"docid": "d67a5209cbeedf518097d2a6c15dc1d1",
"score": "0.6674208",
"text": "def time; end",
"title": ""
},
{
"docid": "d67a5209cbeedf518097d2a6c15dc1d1",
"score": "0.6674208",
"text": "def time; end",
"title": ""
},
{
"docid": "d67a5209cbeedf518097d2a6c15dc1d1",
"score": "0.6674208",
"text": "def time; end",
"title": ""
},
{
"docid": "d67a5209cbeedf518097d2a6c15dc1d1",
"score": "0.6674208",
"text": "def time; end",
"title": ""
},
{
"docid": "d67a5209cbeedf518097d2a6c15dc1d1",
"score": "0.6674208",
"text": "def time; end",
"title": ""
},
{
"docid": "d67a5209cbeedf518097d2a6c15dc1d1",
"score": "0.6674208",
"text": "def time; end",
"title": ""
},
{
"docid": "d67a5209cbeedf518097d2a6c15dc1d1",
"score": "0.6674208",
"text": "def time; end",
"title": ""
},
{
"docid": "d67a5209cbeedf518097d2a6c15dc1d1",
"score": "0.6674208",
"text": "def time; end",
"title": ""
},
{
"docid": "d67a5209cbeedf518097d2a6c15dc1d1",
"score": "0.6674208",
"text": "def time; end",
"title": ""
},
{
"docid": "d67a5209cbeedf518097d2a6c15dc1d1",
"score": "0.6674208",
"text": "def time; end",
"title": ""
},
{
"docid": "3c1ea761ab976dde4765718ae5729e6b",
"score": "0.6651242",
"text": "def addtime\n \n end",
"title": ""
},
{
"docid": "cbde1279373529a8859491a4a5bdc439",
"score": "0.6638068",
"text": "def atime; end",
"title": ""
},
{
"docid": "cbde1279373529a8859491a4a5bdc439",
"score": "0.6638068",
"text": "def atime; end",
"title": ""
},
{
"docid": "cbde1279373529a8859491a4a5bdc439",
"score": "0.6638068",
"text": "def atime; end",
"title": ""
},
{
"docid": "cbde1279373529a8859491a4a5bdc439",
"score": "0.6638068",
"text": "def atime; end",
"title": ""
},
{
"docid": "d4d7ecee9ef583829e486c5d971d8dd8",
"score": "0.6637094",
"text": "def time=(*) end",
"title": ""
},
{
"docid": "d7a2f55b7ff168e102ffbd69fb4529f1",
"score": "0.6616368",
"text": "def update!(**args)\n @update_time = args[:update_time] if args.key?(:update_time)\n end",
"title": ""
},
{
"docid": "0d08f7391278b3e53c6b5aac9d868f91",
"score": "0.6612266",
"text": "def update!\n @last_update = Time.at 0\n update\n end",
"title": ""
},
{
"docid": "db77592f374f4025218b5bcad98561a0",
"score": "0.6582605",
"text": "def time=(p0) end",
"title": ""
},
{
"docid": "db77592f374f4025218b5bcad98561a0",
"score": "0.6582605",
"text": "def time=(p0) end",
"title": ""
},
{
"docid": "db77592f374f4025218b5bcad98561a0",
"score": "0.6582605",
"text": "def time=(p0) end",
"title": ""
},
{
"docid": "ffb32cf14083167506a26784eb34eed3",
"score": "0.6574776",
"text": "def total_time=(v); end",
"title": ""
},
{
"docid": "a62fefae1de92293f5bf000d7db6fa61",
"score": "0.6573584",
"text": "def update\n @time +=@inc\n yield\n @timers.start\n end",
"title": ""
},
{
"docid": "047aadd0ba6f09fd8a9ca5c3de0d4dc2",
"score": "0.6558332",
"text": "def last_utime=(_arg0); end",
"title": ""
},
{
"docid": "fb5fea3049d849fb8f69c7b8fb4e32b4",
"score": "0.6526451",
"text": "def time(*) end",
"title": ""
},
{
"docid": "fb5fea3049d849fb8f69c7b8fb4e32b4",
"score": "0.6526451",
"text": "def time(*) end",
"title": ""
},
{
"docid": "72fcad8c8f4c74346d6acd2bb034d818",
"score": "0.6520107",
"text": "def update\n diff = Time.new - @current_systime\n @actual += diff.to_i\n @current_systime = Time.new\n end",
"title": ""
},
{
"docid": "bce519847be7e53d506bab9d2b2c74fc",
"score": "0.6500535",
"text": "def ctime=(value); end",
"title": ""
},
{
"docid": "7505ed2f950b5eafa5295c65d0e68383",
"score": "0.6485853",
"text": "def update_time_display\n @seconds = Time.now - @time\n @time_display.replace '%3.03f' % @seconds\n end",
"title": ""
},
{
"docid": "3f987246d4bd4f0c5c7dd2259525dbed",
"score": "0.6473412",
"text": "def run_update\n Morrow.instance_eval { @update_start_time = Time.now }\n described_class.update(leo, teleport)\n end",
"title": ""
},
{
"docid": "07ef36661a6ac3121102a2a3779a2e3c",
"score": "0.64732367",
"text": "def _trigger_update_callback; end",
"title": ""
},
{
"docid": "e05233a7a10c7ff4c715b90230fc8554",
"score": "0.6469626",
"text": "def time=(new_time)\n @time = new_time\n end",
"title": ""
},
{
"docid": "01c9a29e6376cffbde0f1be23deed43f",
"score": "0.64557",
"text": "def update!(**args)\n @fully_drawn_time = args[:fully_drawn_time] if args.key?(:fully_drawn_time)\n @initial_display_time = args[:initial_display_time] if args.key?(:initial_display_time)\n end",
"title": ""
},
{
"docid": "01c9a29e6376cffbde0f1be23deed43f",
"score": "0.64557",
"text": "def update!(**args)\n @fully_drawn_time = args[:fully_drawn_time] if args.key?(:fully_drawn_time)\n @initial_display_time = args[:initial_display_time] if args.key?(:initial_display_time)\n end",
"title": ""
},
{
"docid": "b17cc144c670641d6caf4667c496128a",
"score": "0.6452767",
"text": "def setTime\n\t\t@time=42\n\tend",
"title": ""
},
{
"docid": "f583c3410427e3cccfdbfde61f1c7e1e",
"score": "0.6446477",
"text": "def notify_change\r\n self.edit_time = Time.now\r\n end",
"title": ""
},
{
"docid": "c0e28c79968c8381db2bbec3e01c4460",
"score": "0.644626",
"text": "def now\n@time =\"hi\"\n end",
"title": ""
},
{
"docid": "183538dc80d5d4b78b92ff4c44db0e54",
"score": "0.64337415",
"text": "def last_stime=(_arg0); end",
"title": ""
},
{
"docid": "7493365fa54be9f7c21414ade252932c",
"score": "0.64286",
"text": "def update\n @time += 1\n return if @time < MAX_TIME\n @time = 0\n switch_mode\n end",
"title": ""
},
{
"docid": "aaf35a0179e2a21f6c968bea86f2d080",
"score": "0.64285386",
"text": "def update_s_time\n self.ds = Time.new\n end",
"title": ""
},
{
"docid": "6e4a165e2e9ae3a32283749021db3e9d",
"score": "0.6415019",
"text": "def last_refresh_time(*args)\n end",
"title": ""
},
{
"docid": "332bb7fcdfc6aed322b5562c59fcf0c1",
"score": "0.6403443",
"text": "def show_time\n\n end",
"title": ""
},
{
"docid": "2502698ea4a85227d23ce94deccfb4a1",
"score": "0.64034307",
"text": "def update\r\n # タイマーを 1 減らす\r\n if @timer_working and @timer > 0\r\n @timer -= 1\r\n end\r\n end",
"title": ""
},
{
"docid": "d301e515a457427a74f40feb7fc82541",
"score": "0.6398329",
"text": "def atime=(value); end",
"title": ""
},
{
"docid": "b749aba266ac0744626652175f8d64c5",
"score": "0.63963133",
"text": "def time=(_arg0); end",
"title": ""
},
{
"docid": "b749aba266ac0744626652175f8d64c5",
"score": "0.63963133",
"text": "def time=(_arg0); end",
"title": ""
},
{
"docid": "b749aba266ac0744626652175f8d64c5",
"score": "0.63963133",
"text": "def time=(_arg0); end",
"title": ""
},
{
"docid": "b749aba266ac0744626652175f8d64c5",
"score": "0.63963133",
"text": "def time=(_arg0); end",
"title": ""
},
{
"docid": "b749aba266ac0744626652175f8d64c5",
"score": "0.63963133",
"text": "def time=(_arg0); end",
"title": ""
},
{
"docid": "b749aba266ac0744626652175f8d64c5",
"score": "0.63963133",
"text": "def time=(_arg0); end",
"title": ""
},
{
"docid": "f4d26ccdfb1f5b4a689be2d72bc1ea26",
"score": "0.63828313",
"text": "def perform_now; end",
"title": ""
},
{
"docid": "a458dd5f8d52c5995210887beffb95ac",
"score": "0.63769835",
"text": "def bullettime_updated(enabled)\r\n if enabled\r\n @tick = 5.0\r\n else\r\n @tick = 1.0\r\n end\r\n end",
"title": ""
},
{
"docid": "cdae5e1ad87261b068d996a119d20535",
"score": "0.63764167",
"text": "def ctime\n end",
"title": ""
},
{
"docid": "cdae5e1ad87261b068d996a119d20535",
"score": "0.63764167",
"text": "def ctime\n end",
"title": ""
},
{
"docid": "e16be4cd3690b2ec40635ff78c0b2e7a",
"score": "0.637569",
"text": "def date() updated; end",
"title": ""
},
{
"docid": "4530eb1c2f0f4625469d53ac775f8524",
"score": "0.63741666",
"text": "def update_position(dt); end",
"title": ""
},
{
"docid": "906b95a837c3cb7fc972f2db25cdb394",
"score": "0.6373034",
"text": "def apply_update_timestamp\n updated_at = Time.now\n end",
"title": ""
},
{
"docid": "162b716e31e7e20963c36a9dad816c20",
"score": "0.6368942",
"text": "def update_timestamp\n #definition provided whenever an :updated_at property is defined\n end",
"title": ""
},
{
"docid": "cbdcef5f70c1e85d79b7892096f0c36a",
"score": "0.6368928",
"text": "def time=(new_time)\n setTime(new_time)\n end",
"title": ""
},
{
"docid": "86897710abb3a2fb9c4d9f5653e937b9",
"score": "0.63676256",
"text": "def time(&block); end",
"title": ""
},
{
"docid": "7a715e5b0f74116240b33d4557f3fad0",
"score": "0.6364877",
"text": "def send_new_time(data)\n puts 'Received new data'\n\n render \"Time is: #{DateTime.now}\"\n end",
"title": ""
},
{
"docid": "b54dd232b16020518a14816ffc75b47e",
"score": "0.6364664",
"text": "def update_times()\n if modify_time and access_time\n self.bgnlib = build_time(modify_time) + build_time(access_time)\n else\n self.bgnlib = nil\n end\n end",
"title": ""
},
{
"docid": "5449d8922aa6c042e4e7db1436d5caf4",
"score": "0.63457423",
"text": "def atime=(_arg0); end",
"title": ""
},
{
"docid": "5449d8922aa6c042e4e7db1436d5caf4",
"score": "0.63457423",
"text": "def atime=(_arg0); end",
"title": ""
},
{
"docid": "5449d8922aa6c042e4e7db1436d5caf4",
"score": "0.63457423",
"text": "def atime=(_arg0); end",
"title": ""
},
{
"docid": "c3ea14708ed7f7a9b8397f0fa9a023bc",
"score": "0.63420826",
"text": "def mtime_update\n self.mtime = Time.now.to_f\n end",
"title": ""
},
{
"docid": "45094dc254ffca7c0a306c6b6c6ceafc",
"score": "0.6340209",
"text": "def time_now\n @now.call\n end",
"title": ""
},
{
"docid": "a5f93452d7355dc79ea0f45a33a8b386",
"score": "0.63233495",
"text": "def update\n @timer < one_minute ? @timer += 1 : update_time\n if @forced\n update_real_time if $game_switches[Sw::TJN_RealTime] && @timer < one_minute\n update_tone\n end\n end",
"title": ""
},
{
"docid": "a6c1bf2eaa95988477e7373c01277877",
"score": "0.6322664",
"text": "def track_time(&block)\n start = Time.now\n yield block\n (Time.now - start).round(3) * 1000\n end",
"title": ""
},
{
"docid": "b87e6453e97770862d99414018701f35",
"score": "0.6319138",
"text": "def time(*args, &block); end",
"title": ""
},
{
"docid": "008b3c6e883242414d6bb4ab4bc8edbf",
"score": "0.6316292",
"text": "def good_time_to_update\n true\n end",
"title": ""
}
] |
3cac8d19853086a0cffd74ff7a16e14c
|
GET /medecins/new GET /medecins/new.xml
|
[
{
"docid": "45d5bbce8212329a49047ac97ed8dcbe",
"score": "0.75168526",
"text": "def new\n @medecin = Medecin.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @medecin }\n end\n end",
"title": ""
}
] |
[
{
"docid": "41433d74e36719684775ad2d50c3eabe",
"score": "0.7261847",
"text": "def new\n @new = New.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @new }\n end\n end",
"title": ""
},
{
"docid": "0e05e70c91bf29ce0001382f4f9fdf8e",
"score": "0.72477996",
"text": "def new\n @meegen = Meegen.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @meegen }\n end\n end",
"title": ""
},
{
"docid": "850beab1b1231438f5b4ab3b671d3533",
"score": "0.7206264",
"text": "def new\n @me = Me.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @me }\n end\n end",
"title": ""
},
{
"docid": "94ceaaf9250cdc3d062aeb18bbab1a52",
"score": "0.7174626",
"text": "def new\n @newstuff = Newstuff.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @newstuff }\n end\n end",
"title": ""
},
{
"docid": "afa429c920e975a4eb1ec6f76c54ee7c",
"score": "0.7107335",
"text": "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",
"title": ""
},
{
"docid": "757704e5f4e463be84e10bea4714a224",
"score": "0.70987624",
"text": "def new\n @smi = Smi.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @smi }\n end\n end",
"title": ""
},
{
"docid": "4358f8420cf7da6dcb3af1828cc77489",
"score": "0.70773304",
"text": "def new\n @seenlist = Seenlist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @seenlist }\n end\n end",
"title": ""
},
{
"docid": "2d1ed3affd01b56d4d77ffba38cf2530",
"score": "0.7072153",
"text": "def new\n @misale = Misale.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @misale }\n end\n end",
"title": ""
},
{
"docid": "09659b5e0a0b570d5c8019b81ae00efa",
"score": "0.7044211",
"text": "def new\n @lien = Lien.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lien }\n end\n end",
"title": ""
},
{
"docid": "6fa59916ddce19a39ea50b2793f43243",
"score": "0.7039028",
"text": "def new\n @inlist = Inlist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @inlist }\n end\n end",
"title": ""
},
{
"docid": "a0381c42e91e2a7b329e5aa6d5fb73e2",
"score": "0.70059514",
"text": "def new\n @what_new = WhatNew.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @what_new }\n end\n end",
"title": ""
},
{
"docid": "8bccb80476c13b672f165ff0f91c5753",
"score": "0.7003418",
"text": "def new\n @stein = Stein.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @stein }\n end\n end",
"title": ""
},
{
"docid": "4edcec57605ac8220513133efbc1f7a4",
"score": "0.6992423",
"text": "def new\n @itens_minuta = ItensMinuta.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @itens_minuta }\n end\n end",
"title": ""
},
{
"docid": "4273130498cfdc1fb4be661e81c2ff0c",
"score": "0.6960613",
"text": "def new\n @scrap_xml = ScrapXml.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @scrap_xml }\n end\n end",
"title": ""
},
{
"docid": "bc3968147541effafc698e4a51b537c9",
"score": "0.6952798",
"text": "def new\n @stuff = Stuff.new\n @days_to_njcee = get_days_to_njcee()\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @stuff }\n end\n end",
"title": ""
},
{
"docid": "31a6331e36350defb415f6a71f9493d3",
"score": "0.6950981",
"text": "def new\n @mini = Mini.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mini }\n end\n end",
"title": ""
},
{
"docid": "ce463ed159de381069bdc9f6edbbd946",
"score": "0.6950867",
"text": "def new\n @nome = Nome.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nome }\n end\n end",
"title": ""
},
{
"docid": "467b5c3d073fb405f8fb63ac4f1fdc2f",
"score": "0.6945154",
"text": "def new\n @norbi_meleg = NorbiMeleg.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @norbi_meleg }\n end\n end",
"title": ""
},
{
"docid": "9b2a1d63100ec29111197ccecac4df62",
"score": "0.69423383",
"text": "def new\n @mircopost = Mircopost.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mircopost }\n end\n end",
"title": ""
},
{
"docid": "f16bb37b34fdb6c72e61b4834a6734da",
"score": "0.69315374",
"text": "def new\n @addinfo = Addinfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @addinfo }\n end\n end",
"title": ""
},
{
"docid": "3e8542966de3dc0c950237d53fc05c4e",
"score": "0.6924472",
"text": "def new\n @infomation = Infomation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @infomation }\n end\n end",
"title": ""
},
{
"docid": "34a55587fac22d01aa464dabf939cff6",
"score": "0.6921991",
"text": "def new\n @unite = Unite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @unite }\n end\n end",
"title": ""
},
{
"docid": "17c72fbb514827f1bebf8ba46aa21b24",
"score": "0.69078344",
"text": "def new\n @msn = Msn.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @msn }\n end\n end",
"title": ""
},
{
"docid": "ad608889ec4ba0b3173ca382079546c5",
"score": "0.69026566",
"text": "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",
"title": ""
},
{
"docid": "7e0567eaa5771c49fb3def03eaa4a14b",
"score": "0.68934923",
"text": "def new\n \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",
"title": ""
},
{
"docid": "7f3824c26e7d307cb2812dbd8b431bcd",
"score": "0.68869776",
"text": "def new\n @hemo_semestrial = HemoSemestrial.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @hemo_semestrial }\n end\n end",
"title": ""
},
{
"docid": "778b31c739158e7b6a65b4ca90592ac1",
"score": "0.6882822",
"text": "def new\n @meetup = Meetup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @meetup }\n end\n end",
"title": ""
},
{
"docid": "d8c9869452137d7b8c5091069906a4ce",
"score": "0.68795884",
"text": "def new\n @mentee = Mentee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mentee }\n end\n end",
"title": ""
},
{
"docid": "a1182ba7f6c919473938ea06ae847a62",
"score": "0.68743134",
"text": "def new\n @saison = Saison.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @saison }\n end\n end",
"title": ""
},
{
"docid": "a2c2ed9cc3db30f673486dc6843b3ec5",
"score": "0.68721575",
"text": "def new\n @simup = Simup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @simup }\n end\n end",
"title": ""
},
{
"docid": "05da1f23144086082d22a376368b77f6",
"score": "0.68651724",
"text": "def new\n @emissora = Emissora.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @emissora }\n end\n end",
"title": ""
},
{
"docid": "79ac21b35d72d671028aaeb251eb0851",
"score": "0.68636847",
"text": "def new\n @metatag = Metatag.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @metatag }\n end\n end",
"title": ""
},
{
"docid": "9a1db70be48167980feb05f7eb99b8dc",
"score": "0.6860673",
"text": "def new\n @mecha = Mecha.new\n\n respond_to do |format|\n format.html #new.html.erb\n format.xml {render :xml => @mecha}\n end\n end",
"title": ""
},
{
"docid": "7a63d2771120ebc7390ed2887abf55fd",
"score": "0.68606335",
"text": "def new\n @have = Have.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @have }\n end\n end",
"title": ""
},
{
"docid": "9f9ac0cc0341530318cf0138db06ac61",
"score": "0.6856857",
"text": "def new\n @mebel = Mebel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mebel }\n end\n end",
"title": ""
},
{
"docid": "d492470c284787ba5d6038ac5035c33e",
"score": "0.6854101",
"text": "def new\n @mess = Mess.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mess }\n end\n end",
"title": ""
},
{
"docid": "35013f1f03cf3182e80c70ac7ae04fde",
"score": "0.6852529",
"text": "def new\n @sitedatum = Sitedatum.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @sitedatum }\n end\n end",
"title": ""
},
{
"docid": "a6693ed9dcf15e26f11cec7920365f33",
"score": "0.68521667",
"text": "def new\n @pages = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pages }\n end\n end",
"title": ""
},
{
"docid": "ebc486a4c6f5d849f444f7cfdf2f51fb",
"score": "0.6847759",
"text": "def new\n @memapp = Memapp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @memapp }\n end\n end",
"title": ""
},
{
"docid": "2a6c97fdf72eb8a8d09d3335101fb5d1",
"score": "0.6836093",
"text": "def new\n @signum = Signum.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @signum }\n end\n end",
"title": ""
},
{
"docid": "75ffa9c3b36d8c1d1ca0daf909430a99",
"score": "0.68337095",
"text": "def new\n @ministerio = Ministerio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ministerio }\n end\n end",
"title": ""
},
{
"docid": "f5eb9a2226bbf506b32faf757f2cb8a9",
"score": "0.683301",
"text": "def new\n @insurenceinformation = Insurenceinformation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @insurenceinformation }\n end\n end",
"title": ""
},
{
"docid": "b16f5feea31518ebf94309aabdbb150b",
"score": "0.68320763",
"text": "def new\n @miner = Miner.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @miner }\n end\n end",
"title": ""
},
{
"docid": "b4c191741da8f5ecc7fe842f3c8a9982",
"score": "0.6830952",
"text": "def new\n @con = Con.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @con }\n end\n end",
"title": ""
},
{
"docid": "9dfc2a56831966b28176f565347f318b",
"score": "0.6830743",
"text": "def new\n @selo = Selo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @selo }\n end\n end",
"title": ""
},
{
"docid": "68ef63b87561eaf47af4b1377b403cba",
"score": "0.68236506",
"text": "def new\n @peer = Peer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @peer }\n end\n end",
"title": ""
},
{
"docid": "e60d29a5c1465736530beffbb57df543",
"score": "0.68225276",
"text": "def new\n @loginseating = Loginseatings.new\n\t\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @loginseating }\n\t \n end\n end",
"title": ""
},
{
"docid": "b1145904db4a8802452ed7e5480b746e",
"score": "0.68201405",
"text": "def new\n @ignite = Ignite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ignite }\n end\n end",
"title": ""
},
{
"docid": "9e3fadf1fc941e200f58d40d8c699f77",
"score": "0.6820077",
"text": "def new\n @creation = Creation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @creation }\n end\n end",
"title": ""
},
{
"docid": "c768540164b010b3846681d576a83ba3",
"score": "0.6817768",
"text": "def new\n @personne = Personne.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @personne }\n end\n end",
"title": ""
},
{
"docid": "72f323fecb16a2ce6e84c91ac371415d",
"score": "0.6817539",
"text": "def new\n @npc = NPC.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @npc }\n end\n end",
"title": ""
},
{
"docid": "9fda5c62bc6250fd158aee391c3a80a1",
"score": "0.6816197",
"text": "def new\n @extra = Extra.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @extra }\n end\n end",
"title": ""
},
{
"docid": "c33df6219c8065815fe00b377b806322",
"score": "0.68139076",
"text": "def new\n @referencia = Referencia.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @referencia }\n end\n end",
"title": ""
},
{
"docid": "3e294f129384e251343ff9a7e32657b1",
"score": "0.6809152",
"text": "def new\n @metadatum = Metadatum.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @metadatum }\n end\n end",
"title": ""
},
{
"docid": "4fa3b5aede349c8237017ac32387875f",
"score": "0.6803106",
"text": "def new\n @medevent = Medevent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @medevent }\n end\n end",
"title": ""
},
{
"docid": "f9309f17b3989048d71b1188cdfb8466",
"score": "0.67981714",
"text": "def new\n @need = Need.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @need }\n end\n end",
"title": ""
},
{
"docid": "888c6c88d660bbc30bd85cd0a7cd1de1",
"score": "0.67981356",
"text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @talk }\n end\n end",
"title": ""
},
{
"docid": "d4ddf2e580db0f0b66d554e7e1ff4400",
"score": "0.6798059",
"text": "def new\n @caller = Caller.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @caller }\n end\n end",
"title": ""
},
{
"docid": "c0894e606b37a9d77275b5c09db6ee6d",
"score": "0.6797684",
"text": "def new\n @mes_base = MesBase.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mes_base }\n end\n end",
"title": ""
},
{
"docid": "611927c565a7feb12e7f45820cfc4b0a",
"score": "0.6794003",
"text": "def new\n @solicitation = Solicitation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @solicitation }\n end\n end",
"title": ""
},
{
"docid": "6a25db2ec042e7f01b3e5b8606ed9331",
"score": "0.6793724",
"text": "def new\n @rim = Rim.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rim }\n end\n end",
"title": ""
},
{
"docid": "baf6079ce8d80790117ed69dd2d6de88",
"score": "0.6793294",
"text": "def new\n @eep = Eep.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @eep }\n end\n end",
"title": ""
},
{
"docid": "4a5fb922bc678065c8a70e74b79e9544",
"score": "0.67919326",
"text": "def new\n @censo = Censo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @censo }\n end\n end",
"title": ""
},
{
"docid": "e218e88c4ebbb659a983728f02b8eb3d",
"score": "0.6791873",
"text": "def new\n @motd = Motd.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @motd }\n end\n end",
"title": ""
},
{
"docid": "042c68728b923e0b5c7d6921a9187966",
"score": "0.679176",
"text": "def new\n @inf_entity = InfEntity.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @inf_entity }\n end\n end",
"title": ""
},
{
"docid": "c7e6059bb336ab9c1f6f984f860c2fd6",
"score": "0.6788077",
"text": "def new_rest\n @instrument = Instrument.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @instrument }\n end\n end",
"title": ""
},
{
"docid": "97fa96433f07d7afb7fb8572043e8be0",
"score": "0.67864156",
"text": "def new\n @prereg = Prereg.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @prereg }\n end\n end",
"title": ""
},
{
"docid": "0a1f9b2e864376deee285cbf1917323a",
"score": "0.67848337",
"text": "def new\n @mini_url = MiniUrl.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mini_url }\n end\n end",
"title": ""
},
{
"docid": "bd5570d4d360b96338d33120e96dc6be",
"score": "0.67835313",
"text": "def new\n @metadata = Metadata.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @metadata }\n end\n end",
"title": ""
},
{
"docid": "f6e731c3f58737a772b558c35e8ebd83",
"score": "0.6782617",
"text": "def new\n @generacion = Generacion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @generacion }\n end\n end",
"title": ""
},
{
"docid": "58c37fcb01d263debbb5a9ccfdda7585",
"score": "0.67821586",
"text": "def new\n @page_change = PageChange.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page_change }\n end\n end",
"title": ""
},
{
"docid": "cef87f2e69781c3c06c32aa679f0a260",
"score": "0.6781979",
"text": "def new\n respond_to do |format|\n format.html { }\n format.json { head :no_content }\n format.xml {}\n end\n end",
"title": ""
},
{
"docid": "da9386683a03140c0a6fb19108098932",
"score": "0.6780397",
"text": "def new\n @imovel = Imovel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @imovel }\n end\n end",
"title": ""
},
{
"docid": "bc51791636b2c8878082256c7c588052",
"score": "0.67779773",
"text": "def new\n @sisben = Sisben.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @sisben }\n end\n end",
"title": ""
},
{
"docid": "3b67635fdae2104771c4170ad5384f20",
"score": "0.6777624",
"text": "def new\n @nom = Nom.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nom }\n end\n end",
"title": ""
},
{
"docid": "8d8f7efa1c668b196cb96a6ded09ddee",
"score": "0.6777175",
"text": "def new\n @mejoramientosestado = Mejoramientosestado.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mejoramientosestado }\n end\n end",
"title": ""
},
{
"docid": "a58a2aac10d512b2fb72fb1aac3c12a4",
"score": "0.6773669",
"text": "def new\n @malt_addition = MaltAddition.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @malt_addition }\n end\n end",
"title": ""
},
{
"docid": "8920f933bf1e062ea7a30300d28919f8",
"score": "0.6772701",
"text": "def new\n @nummer = Nummer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nummer }\n end\n end",
"title": ""
},
{
"docid": "e8b93d4c59c06d29e81ec9c495c999e4",
"score": "0.67712885",
"text": "def new\n @about = About.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @about }\n end\n end",
"title": ""
},
{
"docid": "c85cdab81d2586b44004cdfe27819273",
"score": "0.6768477",
"text": "def new\n @tut = Tut.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tut }\n end\n end",
"title": ""
},
{
"docid": "b5d61e99736035bc631cb8267e3b3581",
"score": "0.6766606",
"text": "def new\n @societe = Societe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @societe }\n end\n end",
"title": ""
},
{
"docid": "0abcb28afb826270cc89cf51d2e3fc8d",
"score": "0.67665386",
"text": "def new\n @sifi = Sifi.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @sifi }\n end\n end",
"title": ""
},
{
"docid": "2377d9e7a0534a5fc4a04100997b6e6c",
"score": "0.67660743",
"text": "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @site }\n end\n end",
"title": ""
},
{
"docid": "ae3a3f04e5554c6926235d27f2c1c80c",
"score": "0.6765141",
"text": "def new\n @add = Add.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @add }\n end\n end",
"title": ""
},
{
"docid": "3298210dd6c0435d77e5dc4395e0685c",
"score": "0.6764459",
"text": "def new\n @generomidia = Generomidia.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @generomidia }\n end\n end",
"title": ""
},
{
"docid": "159e0133520454c462c7b8dd266693b7",
"score": "0.6763985",
"text": "def new\n @contato_interno = ContatoInterno.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @contato_interno }\n end\n end",
"title": ""
},
{
"docid": "2ce5e2dcaf6244ac0c8d092e7d3f1dcc",
"score": "0.6763573",
"text": "def create\n @medecin = Medecin.new(params[:medecin])\n\n respond_to do |format|\n if @medecin.save\n flash[:notice] = 'Medecin was successfully created.'\n format.html { redirect_to(@medecin) }\n format.xml { render :xml => @medecin, :status => :created, :location => @medecin }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @medecin.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a7799388d09a039a5897043c8569309d",
"score": "0.6759472",
"text": "def new\n @infoset = Infoset.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @infoset }\n end\n end",
"title": ""
},
{
"docid": "61e8a9d7e9b4dc5ef2c68eb2ca47a04c",
"score": "0.67519563",
"text": "def new\n @stat = Stat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @stat }\n end\n end",
"title": ""
},
{
"docid": "7f8841aea052d6504b09e74b73dadae0",
"score": "0.67500556",
"text": "def new\n @ece = Ece.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ece }\n end\n end",
"title": ""
},
{
"docid": "2ff76961786006c0aba0b8ad94d70d0b",
"score": "0.67484796",
"text": "def new\n @comune = Comune.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @comune }\n end\n end",
"title": ""
},
{
"docid": "04f827a3ac66de917695df89b47efc4d",
"score": "0.67477316",
"text": "def new\n @myare = Myare.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @myare }\n end\n end",
"title": ""
},
{
"docid": "b7babb02e44df2563f8f12224bbeb054",
"score": "0.6745518",
"text": "def new\n @sujit = Sujit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @sujit }\n end\n end",
"title": ""
},
{
"docid": "cd5b80abaa0af95086236d2daf9bfea7",
"score": "0.6744237",
"text": "def new\n @entrega = Entrega.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entrega }\n end\n end",
"title": ""
},
{
"docid": "3755dc7eea0376ad853948fe27984e55",
"score": "0.6744201",
"text": "def new\n @income = Income.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @income }\n end\n end",
"title": ""
},
{
"docid": "3755dc7eea0376ad853948fe27984e55",
"score": "0.6744201",
"text": "def new\n @income = Income.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @income }\n end\n end",
"title": ""
},
{
"docid": "fec547cc6989f3f86bf45b48986d21de",
"score": "0.67431635",
"text": "def new\n @manid = Manid.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @manid }\n end\n end",
"title": ""
},
{
"docid": "405b3aa117ccabd4bafe376e8202ae1f",
"score": "0.6742825",
"text": "def new\n @destaque = Destaque.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @destaque }\n end\n end",
"title": ""
},
{
"docid": "affb7029de3c0aa886b6d66c93d06ecd",
"score": "0.67384726",
"text": "def new\n\t \n\n\t respond_to do |wants|\n\t wants.html # new.html.erb\n\t wants.xml { render :xml => @model }\n\t end\n\t end",
"title": ""
},
{
"docid": "e056a00548287048af42b455264fb4e0",
"score": "0.6737701",
"text": "def new\n @utente = Utente.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @utente }\n end\n end",
"title": ""
}
] |
929d1560d65f349c45eb72a113909e6d
|
TODO extremely bad style, need to fix it somehow
|
[
{
"docid": "7a44ad4cce0ea6d82455b19e97027613",
"score": "0.0",
"text": "def add_protocol_for_urls\n URLS.each do |url|\n if self.send(url).present? && self.send(url) != \"\"\n unless self.send(url)[/\\Ahttp:\\/\\//] || self.send(url)[/\\Ahttps:\\/\\//]\n self.send(\"#{url}=\", \"http://#{self.send(url)}\")\n end\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1",
"score": "0.70765495",
"text": "def private; end",
"title": ""
},
{
"docid": "0b8b7b9666e4ed32bfd448198778e4e9",
"score": "0.6257089",
"text": "def probers; end",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
"score": "0.619017",
"text": "def specie; end",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
"score": "0.619017",
"text": "def specie; end",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
"score": "0.619017",
"text": "def specie; end",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
"score": "0.619017",
"text": "def specie; end",
"title": ""
},
{
"docid": "65ffca17e416f77c52ce148aeafbd826",
"score": "0.61002684",
"text": "def schubert; end",
"title": ""
},
{
"docid": "ad244bd0c45d5d9274f7612fa6fee986",
"score": "0.5840774",
"text": "def suivre; end",
"title": ""
},
{
"docid": "bc658f9936671408e02baa884ac86390",
"score": "0.58255184",
"text": "def anchored; end",
"title": ""
},
{
"docid": "991b6f12a63ef51664b84eb729f67eed",
"score": "0.5811338",
"text": "def formation; end",
"title": ""
},
{
"docid": "a02f7382c73eef08b14f38d122f7bdb9",
"score": "0.57664245",
"text": "def custom; end",
"title": ""
},
{
"docid": "a02f7382c73eef08b14f38d122f7bdb9",
"score": "0.57664245",
"text": "def custom; end",
"title": ""
},
{
"docid": "4a8a45e636a05760a8e8c55f7aa1c766",
"score": "0.5751172",
"text": "def terpene; end",
"title": ""
},
{
"docid": "d88aeca0eb7d8aa34789deeabc5063cf",
"score": "0.56127733",
"text": "def offences_by; end",
"title": ""
},
{
"docid": "2cc9969eb7789e4fe75844b6f57cb6b4",
"score": "0.55651796",
"text": "def refutal()\n end",
"title": ""
},
{
"docid": "06b6203baf3c9311f502228839c5ab4e",
"score": "0.55133474",
"text": "def intensifier; end",
"title": ""
},
{
"docid": "13289d4d24c54cff8b70fcaefc85384e",
"score": "0.54886156",
"text": "def verdi; end",
"title": ""
},
{
"docid": "1f60ec3e87d82a4252630cec8fdc8950",
"score": "0.5484526",
"text": "def berlioz; end",
"title": ""
},
{
"docid": "f1736df8e6642c2eeb78e4b30e5cf678",
"score": "0.5464009",
"text": "def from; end",
"title": ""
},
{
"docid": "f1736df8e6642c2eeb78e4b30e5cf678",
"score": "0.5464009",
"text": "def from; end",
"title": ""
},
{
"docid": "f1736df8e6642c2eeb78e4b30e5cf678",
"score": "0.5464009",
"text": "def from; end",
"title": ""
},
{
"docid": "f1736df8e6642c2eeb78e4b30e5cf678",
"score": "0.5464009",
"text": "def from; end",
"title": ""
},
{
"docid": "eb813b4c171b5a75ecb2253b743e7c3a",
"score": "0.5453932",
"text": "def parslet; end",
"title": ""
},
{
"docid": "eb813b4c171b5a75ecb2253b743e7c3a",
"score": "0.5453932",
"text": "def parslet; end",
"title": ""
},
{
"docid": "eb813b4c171b5a75ecb2253b743e7c3a",
"score": "0.5453932",
"text": "def parslet; end",
"title": ""
},
{
"docid": "eb813b4c171b5a75ecb2253b743e7c3a",
"score": "0.5453932",
"text": "def parslet; end",
"title": ""
},
{
"docid": "2d8d9f0527a44cd0febc5d6cbb3a22f2",
"score": "0.5453319",
"text": "def weber; end",
"title": ""
},
{
"docid": "95ae9fb94712327b38a52b9d7ff89953",
"score": "0.5450233",
"text": "def as_you_like_it_quote; end",
"title": ""
},
{
"docid": "cdd16ea92eae0350ca313fc870e10526",
"score": "0.54498744",
"text": "def who_we_are\r\n end",
"title": ""
},
{
"docid": "a29c5ce532d6df480df4217790bc5fc7",
"score": "0.54317254",
"text": "def extra; end",
"title": ""
},
{
"docid": "2624dca13ba01e1a7eb3b41c13cd4150",
"score": "0.54239565",
"text": "def name_safe?; end",
"title": ""
},
{
"docid": "b3d7c178b277afaefb1b9648335941e7",
"score": "0.54100156",
"text": "def loc; end",
"title": ""
},
{
"docid": "b3d7c178b277afaefb1b9648335941e7",
"score": "0.54100156",
"text": "def loc; end",
"title": ""
},
{
"docid": "b3d7c178b277afaefb1b9648335941e7",
"score": "0.54100156",
"text": "def loc; end",
"title": ""
},
{
"docid": "28012efb188002843ef6e540786c5732",
"score": "0.54035836",
"text": "def rest_positionals; end",
"title": ""
},
{
"docid": "cf2231631bc862eb0c98d89194d62a88",
"score": "0.53964233",
"text": "def identify; end",
"title": ""
},
{
"docid": "255b128abb2eb262fd52b20ff68129b9",
"score": "0.5395223",
"text": "def escaper=(_); end",
"title": ""
},
{
"docid": "5971f871580b6a6e5171c35946a30c95",
"score": "0.53927684",
"text": "def stderrs; end",
"title": ""
},
{
"docid": "acb84cf7ec5cb9f480913c612a384abb",
"score": "0.5382866",
"text": "def probers=(_arg0); end",
"title": ""
},
{
"docid": "3103349d09f884a9193b8c4ac184a666",
"score": "0.5378496",
"text": "def wrapper; end",
"title": ""
},
{
"docid": "7ff2011fa3dc45585a9272310eafb765",
"score": "0.5363007",
"text": "def isolated; end",
"title": ""
},
{
"docid": "7ff2011fa3dc45585a9272310eafb765",
"score": "0.5363007",
"text": "def isolated; end",
"title": ""
},
{
"docid": "a7e46056aae02404670c78192ffb8f3f",
"score": "0.5362841",
"text": "def original_result; end",
"title": ""
},
{
"docid": "14187174b07e4c51e8d38b1dd3593d4a",
"score": "0.53619784",
"text": "def macro; raise NotImplementedError; end",
"title": ""
},
{
"docid": "14187174b07e4c51e8d38b1dd3593d4a",
"score": "0.53619784",
"text": "def macro; raise NotImplementedError; end",
"title": ""
},
{
"docid": "14187174b07e4c51e8d38b1dd3593d4a",
"score": "0.53619784",
"text": "def macro; raise NotImplementedError; end",
"title": ""
},
{
"docid": "cfbcefb24f0d0d9b60d1e4c0cf6273ba",
"score": "0.5358579",
"text": "def trd; end",
"title": ""
},
{
"docid": "18b70bef0b7cb44fc22c66bf7965c231",
"score": "0.5342617",
"text": "def first; end",
"title": ""
},
{
"docid": "18b70bef0b7cb44fc22c66bf7965c231",
"score": "0.5342617",
"text": "def first; end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.5340931",
"text": "def implementation; end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.5340931",
"text": "def implementation; end",
"title": ""
},
{
"docid": "b14829d2f65d2660b51171944c233567",
"score": "0.5322895",
"text": "def required_positionals; end",
"title": ""
},
{
"docid": "3fc62999f66ac51441f9ba80922d1854",
"score": "0.52942955",
"text": "def escaper; end",
"title": ""
},
{
"docid": "d4248303d83e601fedcb6595d7408f7d",
"score": "0.5291258",
"text": "def expanded; end",
"title": ""
},
{
"docid": "4e7f63d2e8327143b97af38c6fce7a24",
"score": "0.5287273",
"text": "def original; end",
"title": ""
},
{
"docid": "dd68931a1a7f77eb4fd41ce35988a9bb",
"score": "0.5284487",
"text": "def returns; end",
"title": ""
},
{
"docid": "0eb3d9fe5f9f25d5d4681707022b9ab6",
"score": "0.5282182",
"text": "def ignores; end",
"title": ""
},
{
"docid": "983a5b9de63b609981f45a05ecc2741f",
"score": "0.5274261",
"text": "def fallbacks=(_arg0); end",
"title": ""
},
{
"docid": "b8903ea470da4aff13d096e26515327b",
"score": "0.52710116",
"text": "def specialty; end",
"title": ""
},
{
"docid": "2dbabd0eeb642c38aad852e40fc6aca7",
"score": "0.52663124",
"text": "def operations; end",
"title": ""
},
{
"docid": "2dbabd0eeb642c38aad852e40fc6aca7",
"score": "0.52663124",
"text": "def operations; end",
"title": ""
},
{
"docid": "6a6ed5368f43a25fb9264e65117fa7d1",
"score": "0.5253487",
"text": "def internal; end",
"title": ""
},
{
"docid": "07388179527877105fd7246db2b49188",
"score": "0.5243918",
"text": "def villian; end",
"title": ""
},
{
"docid": "d882f3a248ba33088a4284a47c263d0d",
"score": "0.52386534",
"text": "def missing?; end",
"title": ""
},
{
"docid": "4f0a4656cc8371322fe53a0792e78206",
"score": "0.5237151",
"text": "def offences_by=(_arg0); end",
"title": ""
},
{
"docid": "431dbfdbf579fcf05cd1ab47f901de9e",
"score": "0.52343917",
"text": "def real_name; end",
"title": ""
},
{
"docid": "4ad19d3270d712a0b1427d62090e5438",
"score": "0.5233087",
"text": "def ibu; end",
"title": ""
},
{
"docid": "bb2cf20999efd9fcacf7668301ebe565",
"score": "0.52260315",
"text": "def missing; end",
"title": ""
},
{
"docid": "d996063a1bda83fd8644c8cbac831e61",
"score": "0.52238905",
"text": "def rassoc(p0) end",
"title": ""
},
{
"docid": "f9067cbb242809991ed4608f44f4643b",
"score": "0.5222918",
"text": "def leading; end",
"title": ""
},
{
"docid": "0a39799e76643367f1b6bfac65569895",
"score": "0.5222562",
"text": "def used?; end",
"title": ""
},
{
"docid": "5ad7e5c7a147626a2b0a2c5956411be5",
"score": "0.5198602",
"text": "def r; end",
"title": ""
},
{
"docid": "5ad7e5c7a147626a2b0a2c5956411be5",
"score": "0.5198602",
"text": "def r; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.5173968",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.5173968",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.5173968",
"text": "def parts; end",
"title": ""
},
{
"docid": "be04cb55a462491abd1acf5950c83572",
"score": "0.51622486",
"text": "def jack_handey; end",
"title": ""
},
{
"docid": "192c4c14531825c9c386ec33c61b445d",
"score": "0.5153782",
"text": "def issn; end",
"title": ""
},
{
"docid": "05f30dbaa95cab56c89348edb221f3ed",
"score": "0.5151045",
"text": "def ext=(_arg0); end",
"title": ""
},
{
"docid": "05f30dbaa95cab56c89348edb221f3ed",
"score": "0.5151045",
"text": "def ext=(_arg0); end",
"title": ""
},
{
"docid": "05f30dbaa95cab56c89348edb221f3ed",
"score": "0.5151045",
"text": "def ext=(_arg0); end",
"title": ""
},
{
"docid": "2fe11e3f88717baa25b7171681cc2627",
"score": "0.5145087",
"text": "def first?; end",
"title": ""
},
{
"docid": "8742865b78eb755e40bb1bff22199433",
"score": "0.5139873",
"text": "def internship_passed; end",
"title": ""
},
{
"docid": "0225a9f23a0fa436bcdab339adc872dd",
"score": "0.5128482",
"text": "def same; end",
"title": ""
},
{
"docid": "6cd66cd69ec6689771c8352ed1909310",
"score": "0.5125649",
"text": "def user_os_complex\r\n end",
"title": ""
},
{
"docid": "07f4aba74008200310213b63a5f3de3f",
"score": "0.51228255",
"text": "def zuruecksetzen()\n end",
"title": ""
},
{
"docid": "9d841b89340438a2d53048b8b0959e75",
"score": "0.5118377",
"text": "def sitemaps; end",
"title": ""
},
{
"docid": "51cbc664905c5759f5e6775045d2aad7",
"score": "0.5117808",
"text": "def next() end",
"title": ""
},
{
"docid": "51cbc664905c5759f5e6775045d2aad7",
"score": "0.5117808",
"text": "def next() end",
"title": ""
},
{
"docid": "5ec366fbdcda59614c9cf8751dff8a08",
"score": "0.5113671",
"text": "def celebration; end",
"title": ""
},
{
"docid": "d2b919c14a14af5ce67e69dfc370fde5",
"score": "0.5112478",
"text": "def romeo_and_juliet; end",
"title": ""
},
{
"docid": "a686c2902f0397781aa1ce9d2887aa42",
"score": "0.5111974",
"text": "def final; end",
"title": ""
},
{
"docid": "67e1e5bcf13dadff381ca08b8b2f3258",
"score": "0.511013",
"text": "def ismn; end",
"title": ""
},
{
"docid": "5cf20d5aba71d434e3118cf082e5b244",
"score": "0.5109722",
"text": "def schumann; end",
"title": ""
},
{
"docid": "0268cfe9b7be3eb408810cd157c4566b",
"score": "0.5108609",
"text": "def explicit; end",
"title": ""
},
{
"docid": "d8216257f367748eea163fc1aa556306",
"score": "0.50976807",
"text": "def bs; end",
"title": ""
},
{
"docid": "ee927502c251b167dc506cf6cfafcc30",
"score": "0.5095777",
"text": "def upc_e; end",
"title": ""
},
{
"docid": "45b9e5d1da1562a27f15ce5cb9b634ca",
"score": "0.50912964",
"text": "def ext; end",
"title": ""
},
{
"docid": "45b9e5d1da1562a27f15ce5cb9b634ca",
"score": "0.50912964",
"text": "def ext; end",
"title": ""
},
{
"docid": "abf4063ba21175349965f6ecddefc7d2",
"score": "0.5083162",
"text": "def isolated?; end",
"title": ""
},
{
"docid": "abf4063ba21175349965f6ecddefc7d2",
"score": "0.5083162",
"text": "def isolated?; end",
"title": ""
}
] |
adc2f15899e7da208ea3f199c87f4058
|
Display methods colm can be Array [[kn,vn], [kn,vn],...] or number
|
[
{
"docid": "c62de9ceec88751a04ca1d8fc4d880fc",
"score": "0.0",
"text": "def columns(h, colm = nil, ind = nil, cap = nil)\n return '' unless h\n cary = colm.is_a?(Array) ? colm : Array.new(colm || 2) { [0, 0] }\n lary = upd_column_ary(h, cary).map! { |a| ___mk_line(h, a, cary, ind) }\n (cap ? lary.unshift(cap) : lary).join(\"\\n\")\n end",
"title": ""
}
] |
[
{
"docid": "96005c0237987ff905caa9fef907d127",
"score": "0.6461797",
"text": "def test13\n show([0,1,0,1])\nend",
"title": ""
},
{
"docid": "403b6d77754177b303285dcbf57b82ae",
"score": "0.62842506",
"text": "def display_method_list(methods)\n page do\n puts \"More than one method matched your request. You can refine\"\n puts \"your search by asking for information on one of:\\n\\n\"\n @formatter.wrap(methods.map {|m| m.full_name} .join(\", \"))\n end\n end",
"title": ""
},
{
"docid": "2ab573217a01ccab04d4388b7eb1033d",
"score": "0.6202221",
"text": "def display_method_list(methods)\n page do\n @formatter.raw_print_line(\"More than one method matched your request. You can refine\")\n @formatter.raw_print_line(\"your search by asking for information on one of:\\n\\n\")\n @formatter.wrap(methods.map {|m| m.full_name} .join(\", \"))\n end\n end",
"title": ""
},
{
"docid": "3ad5a6de772d19d4a62127dc64006888",
"score": "0.61655426",
"text": "def display_method_list(methods)\n page do\n @formatter.wrap \"More than one method matched your request. You can refine your search by asking for information on one of:\"\n @formatter.blankline\n\n methods.each do |method|\n @formatter.raw_print_line \"#{method.full_name} [#{method.source_path}]\\n\"\n end\n end\n end",
"title": ""
},
{
"docid": "546fd7f6f229c8600eaaa5cb422b32d9",
"score": "0.613034",
"text": "def display_method_list(methods)\r\n nil\r\n end",
"title": ""
},
{
"docid": "7e14cefcefa844d589ae5dc6c04362e4",
"score": "0.61141133",
"text": "def method_name\n formato_term[@evaluacion.number_of_evaluacion.to_s.to_sym]\n end",
"title": ""
},
{
"docid": "0e9078e41a7f60a86840ab66a7e04c2a",
"score": "0.60130477",
"text": "def print_method(*) end",
"title": ""
},
{
"docid": "6185e5c9280f09811016ffb32d5d8f5b",
"score": "0.59801817",
"text": "def display_class_method_list(klass)\n method_map = {}\n\n class_data = [\n :class_methods,\n :class_method_extensions,\n :instance_methods,\n :instance_method_extensions,\n ]\n\n class_data.each do |data_type|\n data = klass.send data_type\n\n unless data.nil? or data.empty? then\n @formatter.blankline\n\n heading = data_type.to_s.split('_').join(' ').capitalize << ':'\n @formatter.display_heading heading, 2, ''\n\n method_names = []\n data.each do |item|\n method_names << item.name\n\n if(data_type == :class_methods ||\n data_type == :class_method_extensions) then\n method_map[\"::#{item.name}\"] = :class\n method_map[item.name] = :class\n else\n #\n # Since we iterate over instance methods after class methods,\n # an instance method always will overwrite the unqualified\n # class method entry for a class method of the same name.\n #\n method_map[\"##{item.name}\"] = :instance\n method_map[item.name] = :instance\n end\n end\n method_names.sort!\n\n @formatter.wrap method_names.join(', ')\n end\n end\n\n method_map\n end",
"title": ""
},
{
"docid": "75e6475c1905ad0eb5018a4eff9c8a01",
"score": "0.5856967",
"text": "def print_methods(obj, *options)\n methods = obj.methods\n methods -= Object.methods unless options.include? :more\n filter = options.select {|opt| opt.kind_of? Regexp}.first\n methods = methods.select {|name| name =~ filter} if filter\n\n data = methods.sort.collect do |name|\n method = obj.method(name)\n if method.arity == 0\n args = \"()\"\n elsif method.arity > 0\n n = method.arity\n args = \"(#{(1..n).collect {|i| \"arg#{i}\"}.join(\", \")})\"\n elsif method.arity < 0\n n = -method.arity\n args = \"(#{(1..n).collect {|i| \"arg#{i}\"}.join(\", \")}, ...)\"\n end\n klass = $1 if method.inspect =~ /Method: (.*?)#/\n [name, args, klass]\n end\n max_name = data.collect {|item| item[0].size}.max\n max_args = data.collect {|item| item[1].size}.max\n data.each do |item| \n print \" #{ANSI_BOLD}#{item[0].to_s.rjust(max_name)}#{ANSI_RESET}\"\n print \"#{ANSI_GRAY}#{item[1].ljust(max_args)}#{ANSI_RESET}\"\n print \" #{ANSI_LGRAY}#{item[2]}#{ANSI_RESET}\\n\"\n end\n data.size\n end",
"title": ""
},
{
"docid": "3b1ca650c175f01299632b705f8955ac",
"score": "0.57960325",
"text": "def show\n puts \"\"\n puts \" #{@array_board_case[0].value} | #{@array_board_case[1].value} | #{@array_board_case[2].value} || 1 | 2 | 3 \"\n puts \" ------------- ------------- \"\n puts \" #{@array_board_case[3].value} | #{@array_board_case[4].value} | #{@array_board_case[5].value} || 4 | 5 | 6 \"\n puts \" ------------- ------------- \"\n puts \" #{@array_board_case[6].value} | #{@array_board_case[7].value} | #{@array_board_case[8].value} || 7 | 8 | 9 \"\n puts\"\"\n end",
"title": ""
},
{
"docid": "1ef5951be51ca64cd5139155db054bdd",
"score": "0.57499516",
"text": "def show\n @frac_types = [:fractions, :pi_fractions, :sqrt_fractions, :e_fractions]\n end",
"title": ""
},
{
"docid": "267a77dcb7f68d135685abc53e799e46",
"score": "0.574113",
"text": "def describe methods=nil\n methods ||= %i[count mean std min max]\n\n description_hash = {}\n numeric_vectors.each do |vec|\n description_hash[vec] = methods.map { |m| self[vec].send(m) }\n end\n Daru::DataFrame.new(description_hash, index: methods)\n end",
"title": ""
},
{
"docid": "b4920b93d3710d686458664e2dd670d5",
"score": "0.57241446",
"text": "def srd(method)\n method.source.display\nend",
"title": ""
},
{
"docid": "6abd4bdd5e3e3365277ac91315aaefe8",
"score": "0.57213163",
"text": "def verbose_output(method, const, arr)\n fake, message = faker_method(method, const)\n\n arr.push(crayon.dim.white(\"=> #{fake}\"))\n .push(crayon.dim.magenta.bold(message.to_s))\n end",
"title": ""
},
{
"docid": "9f217df6cb121749a59b0ba50d575b78",
"score": "0.57176226",
"text": "def print_methods\n m = \"----- #{self} (methods) -----\\n\"\n m << methods.sort.join(\"\\n\")\n puts m\n m\n end",
"title": ""
},
{
"docid": "bd5ec2370c3a6635f5ce7547a3ce3296",
"score": "0.5690243",
"text": "def show (v)\n\tv.each do |element|\n\t\tprint \" #{element} \"\n\tend\nend",
"title": ""
},
{
"docid": "39114a344a0166113fa3f3cf3e112c27",
"score": "0.56690365",
"text": "def vizitatori(*vector)\n vector.each { |vizitator| puts \"#{vizitator}\" }\nend",
"title": ""
},
{
"docid": "096d5f420dec343a3f93cd0deb657ce8",
"score": "0.5646553",
"text": "def describe methods=nil\n methods ||= [:count, :mean, :std, :min, :max]\n\n description_hash = {}\n numeric_vectors.each do |vec|\n description_hash[vec] = methods.map { |m| self[vec].send(m) }\n end\n Daru::DataFrame.new(description_hash, index: methods)\n end",
"title": ""
},
{
"docid": "45ba8c180ce76bad397889f13730b202",
"score": "0.5642421",
"text": "def points_display\n ActionController::Base.helpers.pluralize(points, \"point\")\n end",
"title": ""
},
{
"docid": "14c702a14303d1d7bac178699a26d89f",
"score": "0.564079",
"text": "def displays; end",
"title": ""
},
{
"docid": "b9f1e363a2214d9fc380b3ee1315761f",
"score": "0.56374604",
"text": "def display\n attributes = []\n query_components_array = []\n\n instance_variables.each do |i|\n attributes << i.to_s.delete(\"@\")\n end\n\n attributes.each do |a|\n value = self.send(a)\n if value.is_a?(Float)\n front_spacer = \" \" * (12 - a.length)\n back_spacer = \" \" * (49 - (\"#{self.send(a)}\".length))\n puts \"#{a}:\" + \"#{front_spacer}\" + \"#{back_spacer}\" + \"$#{self.send(a)}\"\n else\n front_spacer = \" \" * (12 - a.length)\n back_spacer = \" \" * (50 - (\"#{self.send(a)}\".length))\n puts \"#{a}:\" + \"#{front_spacer}\" + \"#{back_spacer}\" + \"#{self.send(a)}\"\n end\n end\n puts \"=\" * 63\n return\n end",
"title": ""
},
{
"docid": "a500ecd2673b49aa4934875ba17ab137",
"score": "0.5630805",
"text": "def display_method_list_choice(methods)\n page do\n @formatter.wrap \"More than one method matched your request. Please choose one of the possible matches.\"\n @formatter.blankline\n\n methods.each_with_index do |method, index|\n @formatter.raw_print_line \"%3d %s [%s]\\n\" % [index + 1, method.full_name, method.source_path]\n end\n\n @formatter.raw_print_line \">> \"\n\n choice = $stdin.gets.strip!\n\n if(choice == '')\n return\n end\n\n choice = choice.to_i\n\n if ((choice == 0) || (choice > methods.size)) then\n @formatter.raw_print_line \"Invalid choice!\\n\"\n else\n method = methods[choice - 1]\n display_method_info(method)\n end\n end\n end",
"title": ""
},
{
"docid": "d1e529cab9b46c276bb7ffe313e615ed",
"score": "0.56205535",
"text": "def show(*a)\n\t\ta=a.first if a.length==1 && a.first.is_a?(Array)\n\t\topts = { result_prompt:'# ', result_line_limit:200, prefix_result_lines:true, to_s:true }\n\t\ta.each{ |x| puts Ripl::FormatResult.format_result(x,opts) }\n\t\tnil # so that Ripl won't show the result\n\tend",
"title": ""
},
{
"docid": "1d113bbd032d88da5b3094f8d72c4e5e",
"score": "0.5620156",
"text": "def inspect; \"V[#{self.to_a * \",\"}]\"; end",
"title": ""
},
{
"docid": "1d113bbd032d88da5b3094f8d72c4e5e",
"score": "0.5619946",
"text": "def inspect; \"V[#{self.to_a * \",\"}]\"; end",
"title": ""
},
{
"docid": "c98b833e10adc2d2f91c90880928bc7a",
"score": "0.56029886",
"text": "def show_methods(expected_result, opts = {}, *args, &block) # :doc:\n @args = args unless args.empty?\n MethodFinder.show(self, expected_result, opts, *@args, &block)\n end",
"title": ""
},
{
"docid": "879a1d17b90a2f582ee1abdf389c78dc",
"score": "0.5557107",
"text": "def array_printer(array) #def son funciones/metodos\n\tarray.each do |language| #metodo each\n\t\tputs \"Language: #{language.name} | Age: #{language.age} | Type System #{language.type}\"\n\tend\n\t\nend",
"title": ""
},
{
"docid": "cc63f0b8569dad0434b4b0749d28fe33",
"score": "0.5532232",
"text": "def displays=(_arg0); end",
"title": ""
},
{
"docid": "539c1ab56714e90e6b9e57ff3f255a1f",
"score": "0.5508652",
"text": "def report_method_stuff(requested_method_name, methods)\n if methods.size == 1\n method = @ri_reader.get_method(methods[0])\n @display.display_method_info(method)\n else\n entries = methods.find_all {|m| m.name == requested_method_name}\n if entries.size == 1\n method = @ri_reader.get_method(entries[0])\n @display.display_method_info(method)\n else\n @display.display_method_list(methods)\n end\n end\n end",
"title": ""
},
{
"docid": "825e376fd2081a57904f5790459835c3",
"score": "0.55072767",
"text": "def method_missing methodname, *args\n colors = methodname.to_s.split('_')\n self.tc(colors[0],colors[1],colors[2])\n end",
"title": ""
},
{
"docid": "0f6e7591ac039b09cf29897c5da67604",
"score": "0.54912496",
"text": "def print_array(arr)\n translations_string = case arr.size\n when 1 then \"tłumaczenie\"\n when 2..4 then \"tłumaczenia\"\n else \"tłumaczeń\"\n end\n\n puts \"Znaleziono: #{arr.size} #{translations_string}\"\n arr.each { |el| puts \"- #{el}\" }\n end",
"title": ""
},
{
"docid": "0438a036ffef51fe1fe4344f098cdaaa",
"score": "0.5491227",
"text": "def help\n todolist_methods = TodoList.instance_methods(false).sort\n todolist_methods.each do |variable|\n puts \"----------------------\"\n puts \"Method: #{variable}; Parameters: #{TodoList.instance_method(variable).parameters.join(\", \")}\"\n end\n\n end",
"title": ""
},
{
"docid": "e9a69a85442dbc5c867b721771163684",
"score": "0.5491177",
"text": "def show\n @this_should_be_text_in_method = \"Text in method\"\n @this_is_array_in_method = [\"A\", \"B\", \"C\", \"D\"]\n @generator = Generator.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @generator }\n end\n\n\n end",
"title": ""
},
{
"docid": "1a0471f53b85924484a96ae08cb73dc0",
"score": "0.54894435",
"text": "def method_missing(meth, *phrases, &block)\n push(meth.to_s.gsub('_', ' '))\n _inspect(phrases)\n end",
"title": ""
},
{
"docid": "75d4dbf06bcc551d6b9b01e2c02f9ae4",
"score": "0.5455448",
"text": "def print_method(method)\n p send(method)\n end",
"title": ""
},
{
"docid": "564abcf94796e6106181ceb83d6d6ed4",
"score": "0.54449296",
"text": "def show\n puts \"\\n\\n\"\n puts ' ' * 10 + '-' * 19\n puts ' ' * 10 + ('|' + ' ' * 5) * 3 + '|'\n puts ' ' * 10 + \"| #{array[0].value} | #{array[1].value} | #{array[2].value} |\"\n puts ' ' * 10 + ('|' + ' ' * 4 + '1') + ('|' + ' ' * 4 + '2') + ('|' + ' ' * 4 + '3') + '|'\n puts ' ' * 10 + '-' * 19\n puts ' ' * 10 + ('|' + ' ' * 5) * 3 + '|'\n puts ' ' * 10 + \"| #{array[3].value} | #{array[4].value} | #{array[5].value} |\"\n puts ' ' * 10 + ('|' + ' ' * 4 + '4') + ('|' + ' ' * 4 + '5') + ('|' + ' ' * 4 + '6') + '|'\n puts ' ' * 10 + '-' * 19\n puts ' ' * 10 + ('|' + ' ' * 5) * 3 + '|'\n puts ' ' * 10 + \"| #{array[6].value} | #{array[7].value} | #{array[8].value} |\"\n puts ' ' * 10 + ('|' + ' ' * 4 + '7') + ('|' + ' ' * 4 + '8') + ('|' + ' ' * 4 + '9') + '|'\n puts ' ' * 10 + '-' * 19\n end",
"title": ""
},
{
"docid": "290eacd0ec6355a1fe76d7a374e7c576",
"score": "0.54360354",
"text": "def print_class(*) end",
"title": ""
},
{
"docid": "a8eae03984c63d726ccf35e2312c50be",
"score": "0.5429586",
"text": "def run\n (@options[:raw] ? @raw : @published).each do |method|\n ret = send(method)\n ret = ret.join(\"\\n\") if ret.kind_of?(Array)\n\n puts \"============\", method, \"============\"\n puts \"\",ret,\"\"\n end\n end",
"title": ""
},
{
"docid": "818e4b7c17412296398aad50e6766e02",
"score": "0.54278284",
"text": "def show(s = 1,e = 10)\n\t\tfor i in s..e\n\t\t\tfor j in 0..4\n\t\t\t\t print \"#{@Kanas[i-1][j].hiragana}#{@Kanas[i-1][j].katakana}\\t\"\n\t\t\t\t print \"\\n\" if j == 4\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "894a151a7285de6b7a48b8377c9333c5",
"score": "0.54264843",
"text": "def method_list(collection, type=\"elements\", use=\"for show\", handler=\"def\")\n if collection.size>0\n r =\"<ul class='meth_list_helper'>\\n\"\n collection.each do |e|\n click_handler = (e.class==Array && handler != \"def\") ? \"click=\\\"#{e[1]}\\\"\" : \"\"\n n = (e.class==Array) ? e[0] : e\n parameters = (e.class==Array) ? e[1].to_a : []\n \n r += \"\\t <li>\\n\\t <span class='ui-triangle'></span><span>#{n.to_s}</span>\\n\"\n \n if use==\"runnable\"\n # Rb_Arr: [\"a\", \"b\"] ::to js func call => w_parameters(['a', 'b'])\n str = parameters.map{|e|e = %{'#{e}'}}.join(\", \")\n click_handler = %{click=\"w_parameters(this, [#{str}])\"} if parameters.size > 0 && handler == \"def\"\n name = (parameters.size > 0) ? \" name='modal' href='#dialog'\" : \"\"\n \n r += \"\\t <span class='value'><img src='/images/invoke.png' #{click_handler} class='runnable_method' alt=\\\"Invoke #{n} on #{$service[:full_name]}' title='Invoke #{n} on #{$service[:full_name]}\\\" /></span>\\n\"\n end\n \n r += \"\\t </li>\\n\"\n end\n \n return r+\"\\t</ul>\"\n else\n \"\\t<p class='no_list_elements'>No #{type}</p>\"\n end\n end",
"title": ""
},
{
"docid": "0b9cb920bcf351f84977f5b42d5dda21",
"score": "0.54056484",
"text": "def to_displayable_list\n # @todos.each {|item| item.to_displayable_string}\n #@todos.keys.each{|item| item.to_displayable_string}\n #@todos.each{|item| item.to_displayable_string}\n ####\"#{@todos}.#{to_displayable_string}\"\n @todos.map{|item| item.to_displayable_string}\n #\"#{@todos}.#{@each{}#{to_displayable_string}\"\n end",
"title": ""
},
{
"docid": "f3556639343eb12b576b1b5148fa49ed",
"score": "0.53972757",
"text": "def display_arr(arr)\n arr.each do |element|\n print \"#{element} \"\n end\n print \"\\n\"\n end",
"title": ""
},
{
"docid": "180d78042d8bb0bdb0f20a55fda043b2",
"score": "0.5388428",
"text": "def display\n c = self.cells\n puts \" #{c[0]} | #{c[1]} | #{c[2]} \"\n puts \"-----------\"\n puts \" #{c[3]} | #{c[4]} | #{c[5]} \"\n puts \"-----------\"\n puts \" #{c[6]} | #{c[7]} | #{c[8]} \"\n end",
"title": ""
},
{
"docid": "d7835890dd8dc7cb5da477f8d959f23b",
"score": "0.53827035",
"text": "def show\n puts map { |_k, v| v }.inspect\n end",
"title": ""
},
{
"docid": "62c2f8eb453238b6b3fc5ffd59af942d",
"score": "0.5380103",
"text": "def format_methods(methods)\n methods.sort_by(&:name).map do |method|\n if method.name == 'method_missing'\n color(:method_missing, 'method_missing')\n elsif method.visibility == :private\n color(:private_method, method.name)\n elsif method.visibility == :protected\n color(:protected_method, method.name)\n else\n color(:public_method, method.name)\n end\n end\n end",
"title": ""
},
{
"docid": "7e7dea87abe23a41f8be32bb3c554856",
"score": "0.53760135",
"text": "def display\n \n # for each i, print i \n # i is the letter\n @display.each { |i| print \"#{i} \" }\n puts \"\\n\"\n \n # missed are joined by the \", \"\n puts \"Misses: #{@misses.join(', ')}\"\n \n # @ refers to the instance variable\n puts \"Turns Remaining: #{@turns}\"\n end",
"title": ""
},
{
"docid": "a9798150c7706fbe20c9d72cbae64694",
"score": "0.5373845",
"text": "def index\n @std_methods = StdMethod.all\n end",
"title": ""
},
{
"docid": "c61591569c52a8cdf09c7b56b4024b06",
"score": "0.5372924",
"text": "def display2(student) ##### Display2 5% larger class size Method\n\tstudent.each do |cohort, class_size|\n\t\t puts \"#{cohort}: #{(class_size * 1.05).to_i} students\"\n\t end\nend",
"title": ""
},
{
"docid": "f87ff5d58de4ffefab0d9df26835195f",
"score": "0.5371248",
"text": "def method_missing(method, *args)\n DRBD.all_raw[@num][method.to_s]\n end",
"title": ""
},
{
"docid": "5565be47843812496d07c6290c8c8a60",
"score": "0.5368588",
"text": "def showValue; end",
"title": ""
},
{
"docid": "5565be47843812496d07c6290c8c8a60",
"score": "0.5368588",
"text": "def showValue; end",
"title": ""
},
{
"docid": "74daf630bc65be0aaafb7af8ef737e51",
"score": "0.5359217",
"text": "def show_array(a_bar)\r\n a_bar.each do |a|\r\n print a\r\n print \"\\n\"\r\n end\r\nend",
"title": ""
},
{
"docid": "eb761170bd300c4841bf8ccc6dadafcf",
"score": "0.53525347",
"text": "def display_values objs\n obj = objs[0]\n a = @editor_commands.collect do |c| \n s = nil\n if c.function != nil\n s = \"#R[#{mxptag('send \"&text;\" prompt')}#W#{c.name}#{mxptag('/send')}#R]:\" + ' '*(20 - c.name.length - 3)\n\n if c.pword_hidden\n s << \" #W*****\"\n else\n case c.type\n when :flags then s << \"#W#{obj.instance_variable_get(\"@#{c.name}\").display_flags(c.key, c.name, 20)}\"\n when :namespace then s << \"#W#{obj.namespace}\"\n else \n if c.opts[:view_filter]\n s << \" #W#{c.opts[:view_filter].call(obj.instance_variable_get(\"@#{c.name}\"))}\"\n else\n s << \" #W#{obj.instance_variable_get(\"@#{c.name}\")}\"\n end\n end\n end\n end\n s\n end\n z = @editor_commands.select {|com| com.proc_display != nil}.collect { |c| c.call_display nil, obj }\n\n if !z.empty?\n a << \"#R==========================================================================\"\n a += z\n end\n\n str = '#R__________________________________________________________________________' + ENDL\n if obj.is_a?(String)\n str<<(\"#R_%s_\" % \"#{@editor_name}: #{obj[0..30]}[...]\").ljust(74, '_') + ENDL\n else\n str<<(\"#R_%s_\" % \"#{@editor_name}: #{obj}\".strip_mxp!.upcase).ljust(74, '_') + ENDL\n end\n\n a.compact!\n str += a.join(ENDL) + ENDL\n str +=\"#R==========================================================================\" + ENDL\n str +=\"#R[#{mxp('send')}#Wdone#{mxp('/send')}#R]#n\" + ENDL\n end",
"title": ""
},
{
"docid": "5424cc6d62b7e17fe8214dcf40e868e7",
"score": "0.53513753",
"text": "def show\n\t\tfname= \"#{self.class.name}.#{__method__}\"\n\tend",
"title": ""
},
{
"docid": "6e0284b0f3135d62814a7d41938fe951",
"score": "0.5350427",
"text": "def display_name\n \"#{self.class.name} for #{indices.join(', ')}\"\n end",
"title": ""
},
{
"docid": "f01a2e38d3fc64f7755d26e6f3b8adf1",
"score": "0.5341936",
"text": "def _print_num # print_num value\r\n text = @operands[0]\r\n\r\n @screen.print text.to_s\r\n\r\n dbg :print { text }\r\n end",
"title": ""
},
{
"docid": "c0c7040790bc1e1df5a49fa4f18d3163",
"score": "0.53418165",
"text": "def show_board\n puts \" a b c\"\n puts \"1\" + @array[0].view + @array[1].view + @array[2].view\n puts \"2\" + @array[3].view + @array[4].view + @array[5].view\n puts \"3\" + @array[6].view + @array[7].view + @array[8].view\n end",
"title": ""
},
{
"docid": "aba7490ed3d73d2688ebe348edfcfa83",
"score": "0.53357023",
"text": "def display\n\t @ary_display.each{|line| $stdout.print(line + \"\\n\")}\n\tend",
"title": ""
},
{
"docid": "f10a086a48a260f0c93a0f3df23dfb8a",
"score": "0.533469",
"text": "def visuel\n\n puts \"Visualisation du plateau de jeu\"\n puts \" 1 2 3\"\n puts \"A #{@case1.valeur} | #{@case2.valeur} | #{@case3.valeur} \" \n puts \" ---|---|---\"\n puts \"B #{@case4.valeur} | #{@case5.valeur} | #{@case6.valeur} \"\n puts \" ---|---|---\"\n puts \"C #{@case7.valeur} | #{@case8.valeur} | #{@case9.valeur} \"\n puts\n\n end",
"title": ""
},
{
"docid": "c53221cd9035d085ab2b5745cf76341f",
"score": "0.5334135",
"text": "def numbers test_remark\n\n end",
"title": ""
},
{
"docid": "4702725cce1acdb39ac4a3f54f24a8d5",
"score": "0.5322392",
"text": "def code(ints_or_clazz, method)\n method = method.to_sym\n clazz = ints_or_clazz.is_a?(Class) ? ints_or_clazz : ints_or_clazz.class\n puts \"** Comments: \"\n clazz.instance_method(method).comment.display\n puts \"** Source:\"\n clazz.instance_method(method).source.display\n end",
"title": ""
},
{
"docid": "7300f9f71defce357eca2ba72ae11ae1",
"score": "0.53149146",
"text": "def display_information\n\t\t\"#{self.type} #{self.max_speed} #{self.jockey_weight} #{self.hin_number}\"\n\n\tend",
"title": ""
},
{
"docid": "d6bd3d92aaea58e034d221e7aba97845",
"score": "0.5314492",
"text": "def display_stats(stats, num = 0)\n display_title(\"Tirage n°#{num + 1}\", @yel)\n c_len = @std.length * 3\n total = 0\n names = [\"#{@pin}COU\", \"#{@cya}INT\",\n \"#{@gre}ADR\", \"#{@yel}CHA\", \"#{@red}FOR\"]\n stats.each_with_index do |stat, i|\n total += stat\n puts \"#{names[i]}#{@std} =\t#{stat}\".center(@s_len)\n end\n puts \"#{@whi}TOT#{@std} =\t#{total}\".center(@s_len)\n end",
"title": ""
},
{
"docid": "d6bd3d92aaea58e034d221e7aba97845",
"score": "0.5314492",
"text": "def display_stats(stats, num = 0)\n display_title(\"Tirage n°#{num + 1}\", @yel)\n c_len = @std.length * 3\n total = 0\n names = [\"#{@pin}COU\", \"#{@cya}INT\",\n \"#{@gre}ADR\", \"#{@yel}CHA\", \"#{@red}FOR\"]\n stats.each_with_index do |stat, i|\n total += stat\n puts \"#{names[i]}#{@std} =\t#{stat}\".center(@s_len)\n end\n puts \"#{@whi}TOT#{@std} =\t#{total}\".center(@s_len)\n end",
"title": ""
},
{
"docid": "22c7706d5380508e3f60f8bdb28486fc",
"score": "0.53079796",
"text": "def show\n @metric_totals=[]\n @test_answer.test.metrics.each do |metric|\n metric_value = 0\n @test_answer.answers.each do |answer|\n if answer.question.metric == metric\n if answer.question.inverted_value\n metric_value-=answer.value\n else\n metric_value+=answer.value\n end\n end\n end\n @metric_totals.push([metric,metric_value])\n end\n\n @result_type=\"\"\n if @metric_totals.first.second>0 && @metric_totals.second.second>0\n @result_type = \"Vanguardia\"\n elsif @metric_totals.first.second>0 && @metric_totals.second.second<0\n @result_type = \"Freenlancer\"\n elsif @metric_totals.first.second<0 && @metric_totals.second.second>0\n @result_type = \"Startup\"\n else\n @result_type = \"Empresarial\"\n end\n end",
"title": ""
},
{
"docid": "448a027a80baa3190286c32ffab03ac9",
"score": "0.53077114",
"text": "def display_iteration\n #will put some code here.\n end",
"title": ""
},
{
"docid": "7b95a7798968ad9726846fba9a58507d",
"score": "0.53048205",
"text": "def show_value; end",
"title": ""
},
{
"docid": "0061e86cb83b1bae336509ad09165e4d",
"score": "0.53038174",
"text": "def display; end",
"title": ""
},
{
"docid": "8e33a3db8688908e329571ceb4d4e842",
"score": "0.52991295",
"text": "def display\n \n end",
"title": ""
},
{
"docid": "8e33a3db8688908e329571ceb4d4e842",
"score": "0.52991295",
"text": "def display\n \n end",
"title": ""
},
{
"docid": "e63b5e1d5eb5a3a601d2a4464db21572",
"score": "0.5295941",
"text": "def view_array\n p @arr\n end",
"title": ""
},
{
"docid": "267bb0995dce47a09dfebb6eda815d33",
"score": "0.5295757",
"text": "def graphical_representation arr, n\n 0.upto n-1 do |x|\n 0.upto n-1 do |y|\n if arr[x][y] == 1\n print \"#\"\n else\n print \".\"\n end\n end\n p \"\"\n end\nend",
"title": ""
},
{
"docid": "0717718783b99d991f50b67c9e1dc9a9",
"score": "0.52944314",
"text": "def display\n\t\t\t\tprint (\" \"*2 + \" -\")*3 + \"\\n\"\t\n\n\t\t\t\tposition = \"\"\n\t\t\t\t\t\t\n\t\t\t\tfor i in 1..3\n\t\t\t\t\t\tprint \" | \"\n\t\t\t\t\t\tfor j in 1..3\n\t\t\t\t\t\t\t\tprint select_case(i.to_s + j.to_s).symbol.to_s + \" | \"\n\t\t\t\t\t\tend\n\t\t\t\t\t\tprint \"\\n\"\n\t\t\t\t\t\tprint (\" \"*2 + \" -\")*3 + \"\\n\"\t\n\t\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "d146f2d059cf486b2ddeda1111c71874",
"score": "0.528962",
"text": "def show_all_values\n puts (MNV.keys - ['$'.to_sym])\n .sort\n .map {|sym| [\"$\" + sym.to_s, MNV.get_source(sym)]}\n .format_output_bullets\n end",
"title": ""
},
{
"docid": "69083cb8086e6bf6c56b18c773b63f3c",
"score": "0.52845526",
"text": "def numbers; end",
"title": ""
},
{
"docid": "0815ec3dd79436b76709dc1d83a8c186",
"score": "0.52814907",
"text": "def display # this is an instance method\n \"(#{@x}, #{@y})\"\n end",
"title": ""
},
{
"docid": "b78d9ee82e4ced4430a668b64d4d8d98",
"score": "0.5281059",
"text": "def display(results, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "f23c7ed8c7ed911ed116b0b71392b837",
"score": "0.527728",
"text": "def display(arr)\n puts\n puts \"----------\" if arr.count > 1\n arr.each {| el | puts el } #Puts out each element from the array\n puts \"----------\" if arr.count > 1\n puts\n end",
"title": ""
},
{
"docid": "80da6cb0ac3abe73304ab37d0a92f60d",
"score": "0.5277256",
"text": "def pm(obj, *options) # Print methods\n methods = obj.methods\n methods -= Object.methods unless options.include? :more\n filter = options.select {|opt| opt.kind_of? Regexp}.first\n methods = methods.select {|name| name =~ filter} if filter\n\n data = methods.sort.collect do |name|\n method = obj.method(name)\n if method.arity == 0\n args = \"()\"\n elsif method.arity > 0\n n = method.arity\n args = \"(#{(1..n).collect {|i| \"arg#{i}\"}.join(\", \")})\"\n elsif method.arity < 0\n n = -method.arity\n args = \"(#{(1..n).collect {|i| \"arg#{i}\"}.join(\", \")}, ...)\"\n end\n klass = $1 if method.inspect =~ /Method: (.*?)#/\n [name, args, klass]\n end\n max_name = data.collect {|item| item[0].size}.max\n max_args = data.collect {|item| item[1].size}.max\n data.each do |item|\n print \"#{item[0].rjust(max_name)}\"\n print \"#{item[1].ljust(max_args)}\"\n print \"#{item[2]}\\n\"\n end\n data.size\nend",
"title": ""
},
{
"docid": "94fd189f6f5153236eee4a291649a9d7",
"score": "0.5273544",
"text": "def display()\r\n\t\t# puts 'The Name of the Item is : n'\r\n\t\t# puts 'The Price of the Item is : p'\r\n\t\t# puts 'The Quatity of the Item is : q'\r\n\t\t@items.each do |i|\r\n\t\t\tputs \"#{i}\"\r\n\t\tend\r\n\tend",
"title": ""
},
{
"docid": "d8dde5c0972ec1f33c538dbd99508f08",
"score": "0.52696043",
"text": "def display(sign)\n puts sign\nend",
"title": ""
},
{
"docid": "9c22cf79512c08d9a93bf0864e5bb1be",
"score": "0.5268457",
"text": "def method_s(method_name, args = nil)\n method_s = arg_s = nil\n method_s = \"#{class? ? '##' : '#'}#{method_name}\" if method_name\n if args\n arg_s = '('\n if args.is_a? Hash\n c = 0\n args.each do |k,v|\n arg_s << ', ' unless c == 0\n arg_s << k.to_human\n arg_s << ': '\n arg_s << v.to_human\n c += 1\n end\n elsif args.is_a? Enumerable\n c = 0\n args.each do |v|\n arg_s << ', ' unless c == 0\n arg_s << v.to_human\n c += 1\n end\n else\n arg_s << args.to_human\n end\n arg_s << ')'\n end\n \"#{class_s}#{method_s}#{arg_s}\"\n end",
"title": ""
},
{
"docid": "f85af03eba1795c854031d7d9727b2f9",
"score": "0.52628773",
"text": "def inspect(*) end",
"title": ""
},
{
"docid": "f85af03eba1795c854031d7d9727b2f9",
"score": "0.52628773",
"text": "def inspect(*) end",
"title": ""
},
{
"docid": "f85af03eba1795c854031d7d9727b2f9",
"score": "0.52628773",
"text": "def inspect(*) end",
"title": ""
},
{
"docid": "f85af03eba1795c854031d7d9727b2f9",
"score": "0.52628773",
"text": "def inspect(*) end",
"title": ""
},
{
"docid": "f85af03eba1795c854031d7d9727b2f9",
"score": "0.52628773",
"text": "def inspect(*) end",
"title": ""
},
{
"docid": "b1244a5c81c75f7e97adcf73a15d1e1c",
"score": "0.5259637",
"text": "def show ; end",
"title": ""
},
{
"docid": "7f672fcc96ef2c41f73a300bb98026b3",
"score": "0.5259212",
"text": "def inspect\n self.class.name + @array.inspect\n end",
"title": ""
},
{
"docid": "5c8e75b4f74d88b697bbdc8c42d66962",
"score": "0.52582246",
"text": "def get_display_methods(data_obj, options)\n # determine what methods we're going to use\n\n # using options:\n # TODO: maybe rename these a little? cascade/include are somewhat mixed with respect to rails lexicon\n # :except - use the default set of methods but NOT the ones passed here\n # :include - use the default set of methods AND the ones passed here\n # :only - discard the default set of methods in favor of this list\n # :cascade - show all methods in child objects\n\n if options.has_key? :only\n display_methods = Array(options[:only]).map { |m| m.to_s }\n return display_methods if display_methods.length > 0\n else\n display_methods = get_default_display_methods(data_obj) # start with what we can deduce\n display_methods.concat(Array(options[:include])).map! { |m| m.to_s } # add the includes\n display_methods = (display_methods - Array(options[:except]).map! { |m| m.to_s }) # remove the excepts\n end\n\n display_methods.uniq.compact\n end",
"title": ""
},
{
"docid": "6014b42426b85bd373e8ced9197ca496",
"score": "0.5257783",
"text": "def show_amount(arr, type)\n arr.each {|key,val| puts \"#{key}: #{val} #{type}\"}\nend",
"title": ""
},
{
"docid": "d152bebbd6311762cb758b96a36bb45d",
"score": "0.52576923",
"text": "def display_list\n #check for politicians\n if @politicians.length > 0\n puts POLITICIAN_HEADING_CONST\n #loop through politicians\n @politicians.each_with_index do |politician, index|\n puts \"(\" + (index + 1).to_s + \") \" + politician.pretty\n end\n end\n #loop through voter\n if @voters.length > 0\n puts VOTER_HEADING_CONST\n @voters.each_with_index do |voters, index|\n puts \"(\" + (index + 1).to_s + \") \" + voters.pretty\n end\n end\nend",
"title": ""
},
{
"docid": "6275c5a97a573af2a23c5e7e56f75b60",
"score": "0.52525854",
"text": "def answer_display\n\t\t\tputs \"----------------------------------------------------------------------------\\n\" +\n\t\t\t\t \t \"|\\t#{color(@answer[0])}\\t|\\t#{color(@answer[1])}\\t|\\t#{color(@answer[2])}\\t|\\t#{color(@answer[3])}\"\n\t\tend",
"title": ""
},
{
"docid": "ea942ab729598e76054ce60ccb697b92",
"score": "0.524925",
"text": "def display_numbers\r\n puts \"1 | 2 | 3\"\r\n puts \"------------\"\r\n puts \"4 | 5 | 6\"\r\n puts \"------------\"\r\n puts \"7 | 8 | 9\"\r\n end",
"title": ""
},
{
"docid": "e70df4eee5c3067cc3153ed4e023c3a4",
"score": "0.524905",
"text": "def draw_tactic_overview\n end",
"title": ""
},
{
"docid": "7b29d9e8cb5b31c38bf99e14ac063bc1",
"score": "0.5248451",
"text": "def look_and_say(array)\nend",
"title": ""
},
{
"docid": "9c4045540b3391b79561e6eaf7823890",
"score": "0.5248403",
"text": "def show\n s=\"index\".ljust(6)\n @show_attributes.each do |attribute_length_pair| \n s=s + attribute_length_pair.attribute.ljust(attribute_length_pair.length)\n end\n\n index = 1\n self.each do |o|\n s= s+\"\\n\"\n s=s + index.to_s.ljust(6)\n @show_attributes.each do |attribute_length_pair| \n begin\n s=s + eval( 'o.getOLEObject.invoke(\"#{attribute_length_pair.attribute}\")').to_s.ljust( attribute_length_pair.length )\n rescue=>e\n s=s+ \" \".ljust( attribute_length_pair.length )\n end\n end\n index+=1\n end\n puts s \n end",
"title": ""
},
{
"docid": "9c4045540b3391b79561e6eaf7823890",
"score": "0.5248403",
"text": "def show\n s=\"index\".ljust(6)\n @show_attributes.each do |attribute_length_pair| \n s=s + attribute_length_pair.attribute.ljust(attribute_length_pair.length)\n end\n\n index = 1\n self.each do |o|\n s= s+\"\\n\"\n s=s + index.to_s.ljust(6)\n @show_attributes.each do |attribute_length_pair| \n begin\n s=s + eval( 'o.getOLEObject.invoke(\"#{attribute_length_pair.attribute}\")').to_s.ljust( attribute_length_pair.length )\n rescue=>e\n s=s+ \" \".ljust( attribute_length_pair.length )\n end\n end\n index+=1\n end\n puts s \n end",
"title": ""
},
{
"docid": "66a3db4c9563afd386e65eb103a57722",
"score": "0.52482593",
"text": "def display_type; end",
"title": ""
},
{
"docid": "12a77d23c873cb1e52d0b0da94ba26c5",
"score": "0.52436125",
"text": "def shownumbersmandato\n\t\tmult = @num1 * @num2 * @num3\n\t\tp \"With Mandtory #{@num1} * #{@num2} * #{@num3} = #{mult}\"\n\tend",
"title": ""
},
{
"docid": "f3f2e1598c795a42d4d51235e3a804a3",
"score": "0.52414346",
"text": "def show\n\t\t@@board.each do |y|\n\t\t\ty.each { |x| print x.to_s }\n\t\t\tputs \"\"\n\t\tend\n\tend",
"title": ""
}
] |
74952205f486855dcf4b304405047c4a
|
Get the text of the command's note
|
[
{
"docid": "92890ec213cfdc6809712342a9f67761",
"score": "0.80247164",
"text": "def note_text\n command.content_from('ns:note', ns: self.class.registered_ns)\n end",
"title": ""
}
] |
[
{
"docid": "f2ffadb77f2d9078e74bf89991dd67b6",
"score": "0.6988323",
"text": "def note(*arg)\n self.descMetadata.get_note\n end",
"title": ""
},
{
"docid": "f2ffadb77f2d9078e74bf89991dd67b6",
"score": "0.69877464",
"text": "def note(*arg)\n self.descMetadata.get_note\n end",
"title": ""
},
{
"docid": "e6eca7b561146854f0e051dc78beaf58",
"score": "0.69394225",
"text": "def note_content\n note_text_fld[1]\n end",
"title": ""
},
{
"docid": "828565cd004996fb9e811a705ced45e1",
"score": "0.6873666",
"text": "def note\n value('NOTE')\n end",
"title": ""
},
{
"docid": "12840a115b79c4a6c38b32e384f5f4fa",
"score": "0.68623936",
"text": "def note\n value(\"NOTE\")\n end",
"title": ""
},
{
"docid": "12840a115b79c4a6c38b32e384f5f4fa",
"score": "0.68623936",
"text": "def note\n value(\"NOTE\")\n end",
"title": ""
},
{
"docid": "12840a115b79c4a6c38b32e384f5f4fa",
"score": "0.68623936",
"text": "def note\n value(\"NOTE\")\n end",
"title": ""
},
{
"docid": "12840a115b79c4a6c38b32e384f5f4fa",
"score": "0.68623936",
"text": "def note\n value(\"NOTE\")\n end",
"title": ""
},
{
"docid": "861fd3c4ed4ab28b2dcc044f30052082",
"score": "0.6619232",
"text": "def notes(opts)\n return \"\"\n end",
"title": ""
},
{
"docid": "861fd3c4ed4ab28b2dcc044f30052082",
"score": "0.6619232",
"text": "def notes(opts)\n return \"\"\n end",
"title": ""
},
{
"docid": "7a98723d9577d3ee32fe1e6cd8b93ca3",
"score": "0.65606534",
"text": "def description\n note.description\n end",
"title": ""
},
{
"docid": "4a0655d30965beca8603048fc2d2c63c",
"score": "0.6471267",
"text": "def note(text)\n puts '> ' + text\n end",
"title": ""
},
{
"docid": "92a4216b14f234fe60563ccbe8ebbb1a",
"score": "0.6454157",
"text": "def text\n system.PSText\n end",
"title": ""
},
{
"docid": "5f1f7e2c67dc5308db332cea5cfeceed",
"score": "0.64511263",
"text": "def exiwhat_text\n runcmd(@exiwhat)\n end",
"title": ""
},
{
"docid": "145c0616258c56b94e76abcb9d8335d2",
"score": "0.64477545",
"text": "def note_cmd(text)\n message = \"> #{text}\"\n puts \"\\e[35m#{message}\\e[0m\" # pink\n end",
"title": ""
},
{
"docid": "7c7821468e3ef51e86b8a6897ecb3e86",
"score": "0.6424986",
"text": "def getnotes\r\n return getvalue(SVTags::NOTES)\r\n end",
"title": ""
},
{
"docid": "e53afe1b0ef04bbb5fcf4e5b2ea3941c",
"score": "0.6383133",
"text": "def command\n @command.to_s\n end",
"title": ""
},
{
"docid": "e53afe1b0ef04bbb5fcf4e5b2ea3941c",
"score": "0.6383133",
"text": "def command\n @command.to_s\n end",
"title": ""
},
{
"docid": "23cca6ee79da6e6cf4369a9eb27b988b",
"score": "0.6374104",
"text": "def get_desc\n return 'This command has no description.'\n end",
"title": ""
},
{
"docid": "1170c24e9f670f458f75b798a671dfc2",
"score": "0.63704985",
"text": "def notes\n status.notes ? status.notes.sub(' - ', '') : ''\n end",
"title": ""
},
{
"docid": "50025a2aa30829e43a5e66d5aabd892b",
"score": "0.6366302",
"text": "def getText(helpLevel)\n return @textManager.getHelpsTexts(\"help\", 0, 0)\n end",
"title": ""
},
{
"docid": "075037a34abec8c5a5f54af3e5ac970e",
"score": "0.63602066",
"text": "def note_message\n result = main.format_diagnostic\n notes.each do |note|\n result << note.format_diagnostic\n end\n result\n end",
"title": ""
},
{
"docid": "0b987659d30c32031cfc6e889157d870",
"score": "0.63338846",
"text": "def note\n map_to_bibtex_value('annote', 'note')\n end",
"title": ""
},
{
"docid": "98723b9e83aecd2362486b9b08bbf17b",
"score": "0.6327252",
"text": "def text\n @changes['text']\n end",
"title": ""
},
{
"docid": "0a786762a603b547ce0eb25eca810ef5",
"score": "0.6298988",
"text": "def note\n @attributes[:note]\n end",
"title": ""
},
{
"docid": "0a786762a603b547ce0eb25eca810ef5",
"score": "0.6298988",
"text": "def note\n @attributes[:note]\n end",
"title": ""
},
{
"docid": "2f727cea636406a42a5c185ecf88f061",
"score": "0.6275341",
"text": "def sys text\n `#{text}`.chomp\n end",
"title": ""
},
{
"docid": "b6eedf65f624f2a6a0d42ca5ee403ba2",
"score": "0.6271682",
"text": "def note\n response[\"note\"]\n end",
"title": ""
},
{
"docid": "9eec46c2490ba627ae769b41e4c5a43a",
"score": "0.62666357",
"text": "def notes\n notes = Yolo::Tools::Ios::ReleaseNotes.plaintext\n notes = \"No notes provided\" unless notes\n notes\n end",
"title": ""
},
{
"docid": "51253b5d9e245243df550ac9799b464c",
"score": "0.62596744",
"text": "def text\n commands = text_subcommands\n options = text_options\n\n s = []\n\n s << usage\n s << text_description\n\n if !commands.empty?\n s << \"COMMANDS\\n\" + commands.map{ |cmd, desc|\n \" %-17s %s\" % [cmd, desc] \n }.join(\"\\n\")\n end\n\n if !options.empty?\n s << \"OPTIONS\\n\" + options.map{ |max, opts, desc|\n \" %-#{max}s %s\" % [opts.join(' '), desc]\n }.join(\"\\n\")\n end\n\n s << copyright\n s << see_also\n\n s.compact.join(\"\\n\\n\")\n end",
"title": ""
},
{
"docid": "9c6cdffe5b184ae8ad06445198ddb973",
"score": "0.6252197",
"text": "def title\n c = note.content and c[/.*$/]\n end",
"title": ""
},
{
"docid": "8fea02624643b7138fecaafcd3312b45",
"score": "0.62031466",
"text": "def getText\n return @text.getText.to_s.strip\n end",
"title": ""
},
{
"docid": "895244eaf9d933097b7b0944a18c59d9",
"score": "0.6160677",
"text": "def get_release_note\n puts ''\n if @options[:note_file]\n f = Origen.file_handler.clean_path_to(@options[:note_file])\n else\n f = \"#{Origen.root}/release_note.txt\"\n end\n if File.exist?(f)\n lines = File.readlines(f)\n puts 'HAPPY TO USE THIS RELEASE NOTE?:'\n puts '------------------------------------------------------------------------------------------'\n lines.each { |l| puts l }\n puts '------------------------------------------------------------------------------------------'\n if get_text(confirm: :return_boolean)\n self.note = lines.join('')\n return if note\n end\n end\n puts 'RELEASE NOTE:'\n self.note = get_text\n unless note\n puts 'Sorry but you must supply at least a minor description for this release!'\n get_release_note\n end\n end",
"title": ""
},
{
"docid": "842176a03ed42a7f00aac74910ef9355",
"score": "0.6159722",
"text": "def note_string\n \"#{updated_at}: #{updater.name}: #{text}\" + (note_object_attribute.blank? ? '' : \"[on: #{note_object_attribute}]\")\n end",
"title": ""
},
{
"docid": "3c74bf33863debc4cb6ffdbe02e79037",
"score": "0.61479616",
"text": "def get_text\n @automation_element.get_current_pattern(System::Windows::Automation::TextPattern.pattern).document_range.get_text(-1).to_s\n end",
"title": ""
},
{
"docid": "74cd93213fbf53075813bac96df55dc9",
"score": "0.6116221",
"text": "def body_text\n string_command \"getBodyText\"\n end",
"title": ""
},
{
"docid": "a2603a6383f69f705b8e226b7565945f",
"score": "0.60958934",
"text": "def text\n @meme[:text]\n end",
"title": ""
},
{
"docid": "916411c2f711effaf17773f7383ec2b8",
"score": "0.607977",
"text": "def help_text_for_commands(name, commands); end",
"title": ""
},
{
"docid": "916411c2f711effaf17773f7383ec2b8",
"score": "0.607977",
"text": "def help_text_for_commands(name, commands); end",
"title": ""
},
{
"docid": "a3c7441d101a9b6d6230a135f25caa63",
"score": "0.6074752",
"text": "def description\n metadata[\"notes\"] rescue nil\n end",
"title": ""
},
{
"docid": "d506fa7a8f9812d565b608daa6c12cb7",
"score": "0.6072612",
"text": "def get_text\n end",
"title": ""
},
{
"docid": "d506fa7a8f9812d565b608daa6c12cb7",
"score": "0.6072612",
"text": "def get_text\n end",
"title": ""
},
{
"docid": "543909e4c9b24ec8a99c79575c6d3eb1",
"score": "0.6060445",
"text": "def command\n @text.split(\" \").first.sub! \"/\", \"\"\n end",
"title": ""
},
{
"docid": "c154b97ffd114c5df85eae672059574b",
"score": "0.6057963",
"text": "def description\n self.note\n end",
"title": ""
},
{
"docid": "e230f4e4de858e1cbf1b0cd0d692c626",
"score": "0.60495657",
"text": "def current_revision_text\n revision = self.current_revision\n revision.text\n end",
"title": ""
},
{
"docid": "0cfb2db2a9ea125325c26dea6930440f",
"score": "0.60345453",
"text": "def get_message\n message_text.text\n end",
"title": ""
},
{
"docid": "0cfb2db2a9ea125325c26dea6930440f",
"score": "0.60345453",
"text": "def get_message\n message_text.text\n end",
"title": ""
},
{
"docid": "6f00d1f740eb56a69f211c54a6aab521",
"score": "0.6021979",
"text": "def text_subcommands\n commands = @cli_class.subcommands\n s = []\n if !commands.empty?\n s << \"COMMANDS\"\n commands.each do |cmd, klass|\n desc = klass.help.text_description.to_s.split(\"\\n\").first\n s << \" %-17s %s\" % [cmd, desc]\n end\n end\n return nil if s.empty?\n return s.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "4622bcf5cc044f5f223e4288df097d85",
"score": "0.60214967",
"text": "def text\n @text\n end",
"title": ""
},
{
"docid": "50eec303487bed29dd1797b305348999",
"score": "0.6019535",
"text": "def note\n if (self.attributes.include?('note'))\n self.attributes['note']\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "affeade8acdcd743bdebebf3f16a3b25",
"score": "0.60184145",
"text": "def text\n @text\n end",
"title": ""
},
{
"docid": "5e5772a8240c5f6f51c946f5a96ec869",
"score": "0.6001936",
"text": "def getText\n @text\n end",
"title": ""
},
{
"docid": "5e5772a8240c5f6f51c946f5a96ec869",
"score": "0.6001936",
"text": "def getText\n @text\n end",
"title": ""
},
{
"docid": "68ac153e1dffec2f4643e81b671f8fc0",
"score": "0.59985775",
"text": "def get\n return @text\n end",
"title": ""
},
{
"docid": "5b555a99575d020d16a565d45e7fecca",
"score": "0.59923846",
"text": "def getText(helpLevel) #notfound\n\n return @textManager.getHelpsTexts(\"notfound\", 0, 0)\n end",
"title": ""
},
{
"docid": "54008d46b3ab1102c8c63bf8d883bb31",
"score": "0.59862053",
"text": "def title\n note.title\n end",
"title": ""
},
{
"docid": "9dc2bc1a4b8fca7d89ae9214109b7321",
"score": "0.59779376",
"text": "def text\n @text\n end",
"title": ""
},
{
"docid": "9dc2bc1a4b8fca7d89ae9214109b7321",
"score": "0.59779376",
"text": "def text\n @text\n end",
"title": ""
},
{
"docid": "db70ad69a91397ac496a666f654edfb3",
"score": "0.59597397",
"text": "def text\n return @text\n end",
"title": ""
},
{
"docid": "db70ad69a91397ac496a666f654edfb3",
"score": "0.59597397",
"text": "def text\n return @text\n end",
"title": ""
},
{
"docid": "db70ad69a91397ac496a666f654edfb3",
"score": "0.59597397",
"text": "def text\n return @text\n end",
"title": ""
},
{
"docid": "db70ad69a91397ac496a666f654edfb3",
"score": "0.59597397",
"text": "def text\n return @text\n end",
"title": ""
},
{
"docid": "db70ad69a91397ac496a666f654edfb3",
"score": "0.59597397",
"text": "def text\n return @text\n end",
"title": ""
},
{
"docid": "0f69551d173d59736aba9f07445ebf65",
"score": "0.59491867",
"text": "def to_s\n return @helpText + \"\\n\"\n end",
"title": ""
},
{
"docid": "48d90957623c3a83945b24839cb11830",
"score": "0.5941312",
"text": "def text\n self.description\n end",
"title": ""
},
{
"docid": "67191336e3392689abcdd5de479df71b",
"score": "0.5936922",
"text": "def getText\n return @text\n end",
"title": ""
},
{
"docid": "aa2ed1451f03391624df69bf7caf4afb",
"score": "0.59339833",
"text": "def mentioning_text\n self.text\n end",
"title": ""
},
{
"docid": "92c241199b0c9f6390535674f33638df",
"score": "0.59197944",
"text": "def text\n\t\t\t\treturn @text\n\t\t\tend",
"title": ""
},
{
"docid": "54fd10eea0492078e90604abb536f051",
"score": "0.5912723",
"text": "def text\n @raw[\"msg\"][\"text\"]\n end",
"title": ""
},
{
"docid": "58ee40917d21512fd0625a73d4f50df6",
"score": "0.5905901",
"text": "def generate_command_link_text\n @popup_link.get_link_text\n end",
"title": ""
},
{
"docid": "58ee40917d21512fd0625a73d4f50df6",
"score": "0.5905901",
"text": "def generate_command_link_text\n @popup_link.get_link_text\n end",
"title": ""
},
{
"docid": "ddc7918a4155ff9309f278425351e2fd",
"score": "0.59031427",
"text": "def mention_text\n return @mention_text\n end",
"title": ""
},
{
"docid": "6bf4a05a53379ceb38164c838da3429a",
"score": "0.59015274",
"text": "def text\n @ntxt.text[@start, @offset]\n end",
"title": ""
},
{
"docid": "39f7d3d47a49a6217d32c4493fe28d39",
"score": "0.58921975",
"text": "def get_original_text(item)\n text = item.getTextObject.toString\n mymatch = /(^.*?)\\n---+Tran/m.match(text)\n return mymatch[1] unless mymatch.nil?\n\n text\n end",
"title": ""
},
{
"docid": "feadedc0c085d4427d8d5f8a9ccd594d",
"score": "0.5881733",
"text": "def note_name(n)\r\n (note_info n).to_s.split(':')[3].chop\r\nend",
"title": ""
},
{
"docid": "9526fcb028796c7559c97bc3cf89615d",
"score": "0.58688813",
"text": "def note_title\n note_text_fld.first\n end",
"title": ""
},
{
"docid": "d6cd07d31374a82be9c8a9e8d607b38d",
"score": "0.58590496",
"text": "def text\n @parts.join ' '\n end",
"title": ""
},
{
"docid": "2bdd662a8041213cea10a3d22200b92f",
"score": "0.5856477",
"text": "def description\n @global_command.description\n end",
"title": ""
},
{
"docid": "ccc431035039aa9822447cd7596d33ea",
"score": "0.5853976",
"text": "def note\n if @type == \"\"\n return \"\"\n else\n return \"#{@variation}-#{@type}\"\n end\n end",
"title": ""
},
{
"docid": "560c66ebf0d78faa1460aea4889d7d93",
"score": "0.58365756",
"text": "def event_text_text(id)\n text = event_text(id)\n text ? text.text : nil\n end",
"title": ""
},
{
"docid": "03950310fb4bdfca7b59d1ae9599f1fa",
"score": "0.5832433",
"text": "def get\n print \"Type the Note ID:\"\n note_id = gets.chomp\n puts \"Getting note contents...\"\n if note_list[note_id]\n note_list[note_id].each do |key, value|\n return value if key == \"note\"\n end\n else\n return \"This Note does not exist!\"\n end\n options\n end",
"title": ""
},
{
"docid": "d821db0485d33cddfcaf33552c96a35c",
"score": "0.58284205",
"text": "def text\n name\n end",
"title": ""
},
{
"docid": "50c72ef2bf9c1cb0107cc057cb6cda8e",
"score": "0.5827671",
"text": "def Button_GetNote(hwnd, psz, pcc) send_button_control_message(hwnd, :GETNOTE, wparam: pcc, lparam: psz) end",
"title": ""
},
{
"docid": "d5a9badde807e6fba663b202d2e6f40c",
"score": "0.58254117",
"text": "def command(text)\n puts \"\\n--> #{text}\".blue.bold\n end",
"title": ""
},
{
"docid": "ae808c934e8e9dedc6d54471e79986c6",
"score": "0.58231944",
"text": "def note_string(give_flat = false)\n Note.calculate_note(self.frequency, give_flat).join\n end",
"title": ""
},
{
"docid": "5a2c6a357c9538eabece8cfc2e6222df",
"score": "0.5821201",
"text": "def target_note(term, notes)\n if note = notes.select { |n| n.body.include? term }.first\n note.body\n else\n \"\"\n end\n end",
"title": ""
},
{
"docid": "d448f70451d24c4fe109194a15ddd1fa",
"score": "0.5813714",
"text": "def get_note(type=\"md\")\n contents = nil\n begin\n filename = \"/tmp/#{self.object_id}.#{type}\"\n while File.exist?(filename)\n i ||= 0\n filename = \"/tmp/#{self.object_id}#{i}.#{type}\"\n end\n `#{ENV['EDITOR']} #{filename}`\n contents = File.read(filename)\n ensure\n puts \"Exiting ...\"\n FileUtils.rm_f(filename)\n end\n # contents\nend",
"title": ""
},
{
"docid": "955c81260f2231a9a23e7d632247b4af",
"score": "0.5812907",
"text": "def text\n # here we should do some conversions according to @flags\n # but it seems this is not needed for our data\n @text\n end",
"title": ""
},
{
"docid": "e2e0a903e9bec31f94f5b6315c923e56",
"score": "0.5811719",
"text": "def getText\n return @text\n end",
"title": ""
},
{
"docid": "74cdca90811188e54f6d2d7ff6272f38",
"score": "0.58108175",
"text": "def mentioning_text\n self.text\n end",
"title": ""
},
{
"docid": "c53b81e6e0a489f8f30f9760a0e9dee6",
"score": "0.5790176",
"text": "def author()\n task_data(command_result.stdout)[:Author]\n end",
"title": ""
},
{
"docid": "44c39d71da34ed397dd1de3e38fed71e",
"score": "0.5779456",
"text": "def command\n @command ||= parts[12]\n end",
"title": ""
},
{
"docid": "5a569dd2ebb2d2bc612ac60ee5cd894b",
"score": "0.57775396",
"text": "def command_string\n\t\treturn datastore['CMD'] || ''\n\tend",
"title": ""
},
{
"docid": "48adef1e67aa8056ec9fa6daf1a8498b",
"score": "0.576692",
"text": "def text()\n return @browser.fetch(\"_sahi._getText(#{self.to_s()})\")\n end",
"title": ""
},
{
"docid": "48adef1e67aa8056ec9fa6daf1a8498b",
"score": "0.576692",
"text": "def text()\n return @browser.fetch(\"_sahi._getText(#{self.to_s()})\")\n end",
"title": ""
},
{
"docid": "ffb220eabbb6cd72d1d69befeaa0fa7a",
"score": "0.57640296",
"text": "def text_description\n return description if description\n #return Source.get_above_comment(@file, @line) if @file\n\n call_method ? call_method.comment : nil\n end",
"title": ""
},
{
"docid": "26249f93e5f597a320540f2dde27810e",
"score": "0.57606936",
"text": "def text\n source.current_value.to_s\n end",
"title": ""
},
{
"docid": "7c8cff0f409b06b7de07808952a83cc1",
"score": "0.5758862",
"text": "def note\n @client.show_note(self)\n end",
"title": ""
},
{
"docid": "f24998b325b38f17664e8fbe797f969c",
"score": "0.57573223",
"text": "def motd_text\n @attributes[:motd_text]\n end",
"title": ""
},
{
"docid": "9a9060f74f284a662b6d5e7d051f921e",
"score": "0.5752728",
"text": "def note(*str)\n @note = str unless str.empty?\n @note\n end",
"title": ""
}
] |
e8d39a6ecbaaf4868f3cb75cf6fadd7c
|
Returns RFC2822 compliant string for Time object. For example, Tony Blair's last day in office (hopefully) best_day_ever = Time.local(2007, 6, 27) best_day_ever.to_s => "Wed, 27 Jun 2007 00:00:00 +0100" You can also pass in an option format argument that corresponds to acceptable values according to ActiveSupport's +Timeto_formatted_s+ method.
|
[
{
"docid": "9959bcfe4fc6fd33f9292d5559b28be8",
"score": "0.6176088",
"text": "def to_s(format = nil)\n format ? self.to_formatted_s(format) : self.rfc2822\n end",
"title": ""
}
] |
[
{
"docid": "37e00cb39f3530b3a67c327d41cec327",
"score": "0.6909612",
"text": "def calendarable_time_string(time)\n d = time.strftime(\"%A %B %d, %Y\") rescue ''\n t = time.strftime(\"%l:%M %p\") rescue ''\n \"#{d} at #{t}\"\nend",
"title": ""
},
{
"docid": "091a24ec0cce75df54d8267ac1e5c3fc",
"score": "0.6847073",
"text": "def to_string(time = Time.now)\n time.to_time.utc.strftime('%Y%m%dT%H%M%S.%LZ')\n end",
"title": ""
},
{
"docid": "edf35e33deff97761854886d12db6a09",
"score": "0.68291706",
"text": "def to_s(format=nil)\n if format.nil? then ASE::Time::to_string(self)\n else to_s_noase(format) end\n end",
"title": ""
},
{
"docid": "81bb31d44bc835b0a23364962325a1d9",
"score": "0.6806022",
"text": "def to_s\n \"#{self.class.to_s}: #{time.strftime('%Y-%m-%d %H:%M:%S')}\"\n rescue ArgumentError\n \"#{self.class.to_s}: Unknown\"\n end",
"title": ""
},
{
"docid": "afeedad2c7ae7855c5e63746064494a9",
"score": "0.679278",
"text": "def formatted_time\n\t\t\t\t\tresult = \"\"\n\t\t\t\t\tdays = [\"monday\", \"tuesday\", \"wednesday\", \"thursday\", \"friday\", \"saturday\", \"sunday\"]\n\t\t\t\t\tif self.period == \"week\"\n\t\t\t\t\t\tday = days[self.from.to_datetime.cwday - 1]\n\t\t\t\t\t\tresult += I18n.t(\"date.days.#{day}\") + \" \"\n\t\t\t\t\telsif self.period == \"odd_week\"\n\t\t\t\t\t\tday = days[self.from.to_datetime.cwday - 1]\n\t\t\t\t\t\tresult += I18n.t(\"date.days.odd_#{day}\") + \" \"\n\t\t\t\t\telsif self.period == \"even_week\"\n\t\t\t\t\t\tday = days[self.from.to_datetime.cwday - 1]\n\t\t\t\t\t\tresult += I18n.t(\"date.days.even_#{day}\") + \" \"\n\t\t\t\t\telsif self.period == \"month\"\n\t\t\t\t\t\tresult += self.from.strftime(\"%-d. \")\n\t\t\t\t\telsif self.period == \"once\"\n\t\t\t\t\t\tresult += self.from.strftime(\"%-d. %-m. %Y \")\n\t\t\t\t\tend\n\t\t\t\t\tresult += self.from.strftime(\"%k:%M\") + \" - \" + self.to.strftime(\"%k:%M\")\n\t\t\t\t\treturn result\n\t\t\t\tend",
"title": ""
},
{
"docid": "7b07063890ea8943864dcd6b21bb911c",
"score": "0.6784265",
"text": "def to_s(format = :default)\n if format == :db\n utc.to_s(format)\n elsif formatter = ::Time::DATE_FORMATS[format]\n formatter.respond_to?(:call) ? formatter.call(self).to_s : strftime(formatter)\n else\n \"#{time.strftime(\"%Y-%m-%d %H:%M:%S\")} #{formatted_offset(false, 'UTC')}\" # mimicking Ruby Time#to_s format\n end\n end",
"title": ""
},
{
"docid": "9662d11f66b00f5c3b52f7a37ef74970",
"score": "0.6740958",
"text": "def to_s\n @string ||= (@object.strftime(self.class.const_get(:FORMAT)).sub('.000', '') + self.tz)\n end",
"title": ""
},
{
"docid": "05bfb2c9842dc652fa922ff53f4e123b",
"score": "0.66849875",
"text": "def time_string(format: :dhm)\n format_time(human: true).time_string(format: format)\n end",
"title": ""
},
{
"docid": "5a77f89fc42fed52535e7dc6742488c7",
"score": "0.6651224",
"text": "def h_to_s(t=Time.now)\n t.strftime('%T.%6N')\n end",
"title": ""
},
{
"docid": "36d5e6abb9f97546e10e2b4943ce3694",
"score": "0.65871495",
"text": "def fmt_time(time, fmt='%B %e, %Y %l:%M%P %Z') # default fmt: January 1, 2015 10:10am\n local_time = time.blank? || !time.kind_of?(Time) ? Time.now : time.localtime\n local_time.strftime(fmt)\n end",
"title": ""
},
{
"docid": "679623f9dd8e6f2fb5dae6633859c56c",
"score": "0.6585737",
"text": "def to_localised_formatted_s( format = :default )\n skip_international = ( format.to_s =~ /^rfc|iso/ )\n if formatter = ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS[format]\n if formatter.respond_to?(:call)\n formatter.call(self).to_s\n else\n strftime(formatter, skip_international).strip\n end\n else\n to_default_s\n end\n end",
"title": ""
},
{
"docid": "7ed7ae844ad05f4ebd49fdab21461cd4",
"score": "0.65449286",
"text": "def formatted\n time.utc.strftime('%FT%TZ')\n end",
"title": ""
},
{
"docid": "375902ad9fad937ff1f3b6b5443242b5",
"score": "0.6536147",
"text": "def formatted_time(time)\n time ? time.strftime(FRIENDLY_TIME_FORMAT) : \"\"\n end",
"title": ""
},
{
"docid": "603f19ea5f2c256985b86e595136ef23",
"score": "0.6532535",
"text": "def timeToString(time)\n\toffset = time.utc_offset\n\tif offset < 0\n\t\tsign = '-'\n\t\toffset = -offset\n\telse\n\t\tsign = '+'\n\tend\n\toffsetHours = (offset / 3600).floor\n\toffsetMins = ((offset - (offsetHours * 3600)) / 60).floor\n\treturn time.strftime(\"%Y-%m-%dT%H:%M:%S\") + sprintf(\"%s%02d:%02d\", sign, offsetHours, offsetMins)\nend",
"title": ""
},
{
"docid": "d5f3dd149cce51c68509e51f7ab6fe4a",
"score": "0.652869",
"text": "def format_time(time)\n time.strftime(\"%F %T\")\n end",
"title": ""
},
{
"docid": "2f742486166eab76cb8947ef8ff68f0e",
"score": "0.65276194",
"text": "def google_time_str(time)\n timezone = time.to_time.localtime.zone\n zone_offset = Time.zone_offset(timezone) / 60 / 60\n zone_digit = zone_offset.to_s[/\\d/]\n time.strftime(\"%FT%R:00.000-0#{zone_digit}:00\")\n end",
"title": ""
},
{
"docid": "9af7ffac98174601661df3f80bec228b",
"score": "0.65155095",
"text": "def to_s; to_time.to_s; end",
"title": ""
},
{
"docid": "2e106167c0ab611cc1cace4f0c3c7d83",
"score": "0.6468685",
"text": "def rfc2822\n sprintf('%s, %02d %s %d %02d:%02d:%02d ',\n Time::RFC2822_DAY_NAME[@time.wday],\n @time.day, Time::RFC2822_MONTH_NAME[@time.mon-1], @time.year,\n @time.hour, @time.min, @time.sec) +\n if utc?\n '-0000'\n else\n off = utc_offset\n sign = off < 0 ? '-' : '+'\n sprintf('%s%02d%02d', sign, *(off.abs / 60).divmod(60))\n end\n end",
"title": ""
},
{
"docid": "a2444410d0a3dc9eb6d4e2d30cfed186",
"score": "0.6461153",
"text": "def time_string_format\n '%a, %b %d, %Y @ %I:%M %p'\n end",
"title": ""
},
{
"docid": "adfcc27bec34827d16c75ba89acac256",
"score": "0.6436713",
"text": "def get_time_as_string time\n return time.strftime(\"%Y-%m-%dT%H:%M:%SZ\")\nend",
"title": ""
},
{
"docid": "3d9abb4a26a795738b6e1c1433ef4cc6",
"score": "0.6425514",
"text": "def formatted_time(time)\n time.strftime(\"%l:%M %p\")\n end",
"title": ""
},
{
"docid": "3d9abb4a26a795738b6e1c1433ef4cc6",
"score": "0.6425514",
"text": "def formatted_time(time)\n time.strftime(\"%l:%M %p\")\n end",
"title": ""
},
{
"docid": "bfbb1448282a1f0e3d89ca9bebcbbd02",
"score": "0.64018923",
"text": "def time_string\n return '' if time.nil?\n time.strftime \"%a %-I:%M%p (%Z)\\n%Y/%m/%d\"\n end",
"title": ""
},
{
"docid": "62389cd0451422a3d0f0073871e19d0d",
"score": "0.6392526",
"text": "def format_time(time)\n return \"\" if time.nil?\n time.strftime(\"%a %l:%M%P %Ss\")\n end",
"title": ""
},
{
"docid": "23d61a20f648c046ad79d9bab5e69e94",
"score": "0.63883656",
"text": "def to_s\n days = to_i / 86400\n hours = (to_i % 86400) / 3600\n minutes = (to_i % 3600) / 60\n seconds = (self % 60)\n\n days = \"%<d>s\" % {\n d: days.zero? ? nil : \"#{days}D\"\n }\n\n time = \"%<h>s%<m>s%<s>s\" % {\n h: hours.zero? ? nil : \"#{hours}H\",\n m: minutes.zero? ? nil : \"#{minutes}M\",\n s: nonzero? && seconds.zero? ? nil : \"#{seconds}S\"\n }\n\n \"P#{days}\" + (time.empty? ? \"\" : \"T#{time}\")\n end",
"title": ""
},
{
"docid": "2beea2207cd4966fa122cefc5810d86d",
"score": "0.6369004",
"text": "def to_s\n (days.to_i > 0 ? \"#{days}d \" : '') +\n (hours.to_i > 0 ? \"#{hours}h \" : '') +\n format(\n minutes.to_i > 0 ? \"%2s'%02.0f\\\"%02.0f\" : \"%2s'%2s\\\"%02.0f\",\n minutes.to_i, seconds.to_i, hundreds.to_i\n )\n end",
"title": ""
},
{
"docid": "5e5a1806c22af6a448bce37b001a5999",
"score": "0.6359886",
"text": "def to_rfc2822\n Time.at(to_time.to_f + 0.5).rfc2822\n end",
"title": ""
},
{
"docid": "a3e3f4839b02542a6a68a5cc8cce0254",
"score": "0.6355222",
"text": "def time_in_str\n \"#{time_in.strftime(FULLTIME).gsub(/ 0(\\d\\D)/, ' \\1')}\"\n end",
"title": ""
},
{
"docid": "b2e85f33ed32797f3fa06846aaaac021",
"score": "0.6340704",
"text": "def format_time time\n return \"\" unless time\n \"#{time.year}#{prepend_zero(time.month)}#{prepend_zero(time.day)}T#{prepend_zero(time.hour)}#{prepend_zero(time.min)}#{prepend_zero(time.sec)}\"\n end",
"title": ""
},
{
"docid": "dca5aac1e0bd47b168b74d27dbe7d56c",
"score": "0.63289076",
"text": "def to_s\n days = to_i / 86400\n hours = (to_i % 86400) / 3600\n minutes = (to_i % 3600) / 60\n seconds = (self % 60)\n\n days = \"%<d>s\" % {\n :d => days.zero? ? nil : \"#{days}D\"\n }\n\n time = \"%<h>s%<m>s%<s>s\" % {\n :h => hours.zero? ? nil : \"#{hours}H\",\n :m => minutes.zero? ? nil : \"#{minutes}M\",\n :s => nonzero? && seconds.zero? ? nil : \"#{seconds}S\"\n }\n\n \"P#{days}\" + (time.empty? ? \"\" : \"T#{time}\")\n end",
"title": ""
},
{
"docid": "bdef439bc7c762b0c2eccc6c03c2cf91",
"score": "0.6324176",
"text": "def human_str(args = {})\n args = {\n :time => true,\n :number_endings => {\n 0 => \"th\",\n 1 => \"st\",\n 2 => \"nd\",\n 3 => \"rd\",\n 4 => \"th\",\n 5 => \"th\",\n 6 => \"th\",\n 7 => \"th\",\n 8 => \"th\",\n 9 => \"th\"\n }\n }.merge(args)\n \n now = Time.now\n \n #Generate normal string.\n date_str = \"\"\n \n if now.day != @time.day and now.month == @time.month and now.year == @time.year\n last_digit = @time.day.to_s[-1, 1].to_i\n \n if ending = args[:number_endings][last_digit]\n #ignore.\n else\n ending = \".\"\n end\n \n date_str << \"#{@time.day}#{ending} \"\n elsif now.day != @time.day or now.month != @time.month or now.year != @time.year\n date_str << \"#{@time.day}/#{@time.month} \"\n end\n \n if now.year != @time.year\n date_str << \"#{@time.year} \"\n end\n \n if args[:time]\n date_str << \"#{@time.hour}:#{\"%02d\" % @time.min}\"\n end\n \n return date_str\n end",
"title": ""
},
{
"docid": "0731db9055f7c7dbc50d196e2633d307",
"score": "0.6305373",
"text": "def format_time(time)\n time = Time.at(time/1e6, time%1e6)\n return time.strftime(\"%FT%TZ\")\n end",
"title": ""
},
{
"docid": "e46b19109dd3e2c3d42bd30523d3de02",
"score": "0.6304789",
"text": "def to_s(format=nil)\n\t\t\t\tif format ||= @format then\n\t\t\t\t\tformat.format(self)\n\t\t\t\telse\n\t\t\t\t\tsprintf DefaultFormat,\n\t\t\t\t\t\t@time.strftime(DefaultStrftime),\n\t\t\t\t\t\t@severity,\n\t\t\t\t\t\t@text,\n\t\t\t\t\t\t@origin.first\n\t\t\t\t\t# /sprintf\n\t\t\t\tend\n\t\t\tend",
"title": ""
},
{
"docid": "5c15a6b18045332ee5796ac0b660de8b",
"score": "0.6288693",
"text": "def strftime(format_string)\n # Special case 2400 because strftime will load TimeOfDay into Time which\n # will convert 24 to 0\n format_string = format_string.gsub(/%H|%k/, '24') if @hour == 24\n Time.local(2000,1,1, @hour, @minute, @second).strftime(format_string)\n end",
"title": ""
},
{
"docid": "fbc48a538e81c596e325e7368168c13b",
"score": "0.6287385",
"text": "def time_formatted(time)\n hours = time.truncate\n minutes = ((time - hours) * 60).round\n string = \"#{hours} hour\"\n string << 's' unless hours == 1\n string << \" and #{minutes} minute\"\n string << 's' unless minutes == 1\n string\n end",
"title": ""
},
{
"docid": "f5dde6f8cada4e022163893bf3355c20",
"score": "0.6273706",
"text": "def to_s(format=nil)\n if format && to_time.public_method(:to_s).arity != 0\n t0, t1 = start_time.to_s(format), end_time.to_s(format)\n else\n t0, t1 = start_time.to_s, end_time.to_s\n end\n duration > 0 ? \"#{t0} - #{t1}\" : t0\n end",
"title": ""
},
{
"docid": "f5dde6f8cada4e022163893bf3355c20",
"score": "0.6273706",
"text": "def to_s(format=nil)\n if format && to_time.public_method(:to_s).arity != 0\n t0, t1 = start_time.to_s(format), end_time.to_s(format)\n else\n t0, t1 = start_time.to_s, end_time.to_s\n end\n duration > 0 ? \"#{t0} - #{t1}\" : t0\n end",
"title": ""
},
{
"docid": "7323814a2dfc8824257bde3f5a0f8d1d",
"score": "0.6272515",
"text": "def get_time_as_string\n Time::hours_to_numeric(\"#{Time.new.hour}:#{Time.new.min}\")\n end",
"title": ""
},
{
"docid": "e3ccc49f8994796137286c9591a2b9c0",
"score": "0.6265883",
"text": "def to_s\n ft = fuzzy_time\n s = ft.strftime(\"%H:%M\")\n s[4] = '~'\n s\n end",
"title": ""
},
{
"docid": "6cd82077392daad13fb0aae75af3a346",
"score": "0.6263531",
"text": "def format_time(time)\n timeString = time.hour.to_s + \":\" + time.min.to_s\n\n timeHour = (time.hour.to_s.length == 1) ? \"0\" + time.hour.to_s : time.hour.to_s\n timeMinute = (time.min.to_s.length == 1) ? \"0\" + time.min.to_s : time.min.to_s\n\n timeStr = timeHour + \":\" + timeMinute\n\n return timeStr\n end",
"title": ""
},
{
"docid": "7dc03058a51846c0782cef08e4fe6843",
"score": "0.62629086",
"text": "def to_s() strftime end",
"title": ""
},
{
"docid": "808fc0cf7d33feeb1f74995e59adc4c6",
"score": "0.6241601",
"text": "def format_time(time); end",
"title": ""
},
{
"docid": "8ef4d8bce67828bfb02303cb45b7e3df",
"score": "0.6241087",
"text": "def formatted_time\n format(\"#{time.strftime(\"%Y-%m-%d %H:%M:%S\")}.%06d\", time.usec) # rubocop: disable Style/FormatStringToken\n end",
"title": ""
},
{
"docid": "cf54241aaf591c4bd0d2a0c6cb4da661",
"score": "0.62396115",
"text": "def time_string time\n\t\ttime.strftime \"%Y-%m-%d %H:%M\"\n\tend",
"title": ""
},
{
"docid": "c7c703a5b76737e527cbcb24b3913476",
"score": "0.62155336",
"text": "def format_time(time)\n case time_format\n when :iso_8601\n time.utc.iso8601(precision)\n when nil\n \"\"\n else\n time.strftime(time_format)\n end\n end",
"title": ""
},
{
"docid": "cc3c600c88d9cc83daa71e880d36fb22",
"score": "0.62031525",
"text": "def time_to_s\n return (date.to_s.split(/ /)[1])[0,5]\n end",
"title": ""
},
{
"docid": "2d22fb8a657d29dadc0fcb283cedfd41",
"score": "0.6197798",
"text": "def format_time(time)\n year, month, day = time.year, time.month, time.day\n month = \"0\" + month.to_s if month < 10\n day = \"0\" + day.to_s if day < 10\n \"#{year}-#{month}-#{day}\"\n end",
"title": ""
},
{
"docid": "cac25704aec34eccb20b9534cd18223f",
"score": "0.6195916",
"text": "def format_time(t)\n t.strftime('%Y-%m-%d %H-%M-%S')\n end",
"title": ""
},
{
"docid": "403af4e059edf9901ff51db7da95edd0",
"score": "0.61767364",
"text": "def format_gm_time(date_time,time_format=nil)\r\n if date_time.kind_of?(Time)\r\n return(date_time.day.to_s + \r\n \"-\" + \r\n date_time.mon.to_s + \r\n \"-\" + \r\n date_time.year.to_s + \r\n \" \" + \r\n date_time.hour.to_s + \r\n \":\" + \r\n date_time.min.to_s + \r\n \":\" + \r\n date_time.sec.to_s)\r\n else\r\n nil\r\n end\r\n end",
"title": ""
},
{
"docid": "dbbd15d0f586c51afae9d5430f31675c",
"score": "0.6171538",
"text": "def time_to_str(time)\n time = time.split(':')\n hours = time[0].to_i\n min = time[1]\n am_pm = 'AM'\n if(hours > 12)\n am_pm = 'PM'\n hours -= 12\n end\n return \"#{hours}:#{min}#{am_pm}\"\nend",
"title": ""
},
{
"docid": "728f39b0e9be905a2d719d878eb4a9cc",
"score": "0.6170033",
"text": "def time_to_s(time)\n return '' if self.time.blank?\n time.to_s(:elapsed_time)\n# hours = (time / 3600).to_i\n# minutes = ((time - (hours * 3600)) / 60).floor\n# seconds = (time - (hours * 3600).floor - (minutes * 60).floor)\n# seconds = sprintf('%0.2f', seconds)\n# if hours > 0\n# hour_prefix = \"#{hours.to_s.rjust(2, '0')}:\"\n# end\n# \"#{hour_prefix}#{minutes.to_s.rjust(2, '0')}:#{seconds.rjust(5, '0')}\"\n end",
"title": ""
},
{
"docid": "9d5b88db4a5d94e029ea6eae27333e06",
"score": "0.6167317",
"text": "def format_time(time)\n time.strftime(\"%l:%M%P\").strip\n end",
"title": ""
},
{
"docid": "26793e7e4b5b7bb663fa5e8078d6fe34",
"score": "0.616498",
"text": "def timestamp_str(fmt='%Y-%m-%d %H:%M')\n @timestamp.strftime(fmt)\n end",
"title": ""
},
{
"docid": "7fde3b77a1c449faece8c22247fe6f55",
"score": "0.6159384",
"text": "def time_format(booking_for)\n booking_for.strftime(\"%A, %d %b %Y %l:%M %p\")\n end",
"title": ""
},
{
"docid": "963a995fab8be4967863b23873d7a1c8",
"score": "0.61590326",
"text": "def to_s\n strftime\n end",
"title": ""
},
{
"docid": "136519736b5b71db47abc19333cf8b24",
"score": "0.6154555",
"text": "def time_string\n\t\th = @seconds / 60 / 60\n\t\tm = @seconds / 60 % 60\n\t\ts = @seconds % 60\n\n\t\tappend_zero_lam = lambda { |x| x < 10 ? x = \"0#{x}\" : x }\n\t\th, m, s = [h,m,s].map(&append_zero_lam)\n\n\t\t\"#{h}:#{m}:#{s}\"\n\tend",
"title": ""
},
{
"docid": "f0ed2125c76b34e81417f2c6e4ffd923",
"score": "0.6151654",
"text": "def time_as_str\n self.arrival_datetime.strftime(\"%l:%M%P\")\n end",
"title": ""
},
{
"docid": "0e7b56b5c728836d16bad0e7bb071f04",
"score": "0.6147379",
"text": "def formatted_time\n timestamp.strftime(TIME_FORMAT)\n end",
"title": ""
},
{
"docid": "61cc312cef5424b06ec21c96fbb921ae",
"score": "0.61172944",
"text": "def message_time_format(time)\n\t\tbegin\n\t\t\ttime.in_time_zone(\"Mumbai\").strftime(\"%m/%d/%Y %I:%M%p\")\n\t\trescue Exception => e\n\t\t\t\"\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "61cc312cef5424b06ec21c96fbb921ae",
"score": "0.61172944",
"text": "def message_time_format(time)\n\t\tbegin\n\t\t\ttime.in_time_zone(\"Mumbai\").strftime(\"%m/%d/%Y %I:%M%p\")\n\t\trescue Exception => e\n\t\t\t\"\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "d6219c49786dbafba99e0fd2130e1aa3",
"score": "0.6110315",
"text": "def local_time_as_string( utc = nil )\n utc ||= Time.now.utc\n @tz_proxy ||= TZInfo::Timezone.get(self.timezone)\n @tz_proxy.utc_to_local( utc ).strftime('%a, %b %d, %Y @ %I:%M %p')\n end",
"title": ""
},
{
"docid": "e71c1e1db2626937633345510ae7daf1",
"score": "0.610671",
"text": "def format_time(time)\n time.strftime(\"%B %d, %Y at %l:%M%p\")\n end",
"title": ""
},
{
"docid": "20b3a8f752fa526a671335a12087329d",
"score": "0.610668",
"text": "def format_time(time)\n time = Time.zone.parse(time.to_s)\n time.strftime(\"%B #{time.day.ordinalize}, %Y %l:%M%p %Z\")\n end",
"title": ""
},
{
"docid": "70bba510538efdf65708150a5b32b232",
"score": "0.6103772",
"text": "def time_string(time)\n time.nil? ? \"[unknown]\" : time.asctime\n end",
"title": ""
},
{
"docid": "df42fef6e5a42164f47fcb3c6462b94f",
"score": "0.6098154",
"text": "def formatted_datetime_str(date, time)\n formatted_date = date.to_s.tr('-', '')\n formatted_time = Time.parse(time).strftime(\"%H%M%S\")\n\n \"#{formatted_date}T#{formatted_time}\"\n end",
"title": ""
},
{
"docid": "8ff7bd6055425c901c89a7a21856e2cb",
"score": "0.6094038",
"text": "def standardize_time(string_time)\n Time.parse(string_time).strftime('%F %T')\n end",
"title": ""
},
{
"docid": "5e1ea8e617a84d5ca492f043cd85c540",
"score": "0.60901654",
"text": "def standard_format\n strftime '%B %e, %Y, %l:%M %p'\n end",
"title": ""
},
{
"docid": "5f2433b65399aafaa64fe84f47257fc4",
"score": "0.6084098",
"text": "def time_string\n\t\tseconds = @seconds % 60\n\t\tminutes = (@seconds / 60) % 60\n\t\thours = @seconds / (60 * 60)\n\t\tpadded(hours.to_s) + \":\" + padded(minutes.to_s) + \":\" + padded(seconds.to_s)\n\tend",
"title": ""
},
{
"docid": "f69bb8e8892d7935cb118a66f5f9a4e8",
"score": "0.6082476",
"text": "def time_string\n\t\thours = @seconds / 3600\n\t\tmin_in_sec = @seconds % 3600\n\t\tminutes = min_in_sec / 60\n\t\tseconds = min_in_sec % 60\n\n\t\tpadded(hours) + \":\" + padded(minutes) + \":\" + padded(seconds)\n\tend",
"title": ""
},
{
"docid": "0c2d0c2d4d2a032390018d93437f273e",
"score": "0.6069845",
"text": "def format_time(time)\n time.to_time.strftime(\"%d-%m-%Y %H:%M:%S\")\n end",
"title": ""
},
{
"docid": "a9eab4a093d49f003accf9b0bce06e55",
"score": "0.6058296",
"text": "def time_string\n seconds = @seconds\n seconds = Time.at(seconds).utc.strftime(\"%T\")\n end",
"title": ""
},
{
"docid": "0044cf0a2dfc5d88274cfb6aaf7b7349",
"score": "0.6052808",
"text": "def format_time(time)\n time = time.dup\n case time_format\n when :rfc_3339\n time.utc.to_datetime.rfc3339\n when :iso_8601\n time.utc.iso8601(precision)\n when :ms\n (time.to_f * 1_000).to_i\n when :none\n time\n when :seconds\n time.to_f\n when nil\n \"\"\n else\n time.strftime(time_format)\n end\n end",
"title": ""
},
{
"docid": "bca4165521ad052320523cf06c9cc203",
"score": "0.60262376",
"text": "def rfc2822\n sprintf('%s, %02d %s %d %02d:%02d:%02d ',\n RFC2822_DAY_NAME[wday()],\n day(), RFC2822_MONTH_NAME[mon()-1], year(),\n hour(), min(), sec() ) +\n if utc?\n '-0000'\n else\n off = utc_offset\n sign = off < 0 ? '-' : '+'\n sprintf('%s%02d%02d', sign, *(off.abs / 60).divmod(60))\n end\n end",
"title": ""
},
{
"docid": "ccf860139482faad937383339d4ac599",
"score": "0.602241",
"text": "def formatted_time_in_words(given_time, options = {})\n return \"\" if given_time.nil?\n given_time = given_time.getlocal\n\n # If the time is within last 24 hours, show as \"...ago\" string.\n if (1.day.ago..Time.now) === given_time && !options[:no_ago]\n time_ago_in_words(given_time) + \" ago\"\n else\n format_str = \"%B\"\n format_str << \" %d,\" unless options[:no_date]\n format_str << \" %Y\"\n format_str << \" at %I:%M %p\" unless options[:no_time]\n given_time.strftime(format_str)\n end\n end",
"title": ""
},
{
"docid": "3bd1c42f3e97bc60d2fc0acf05ee752d",
"score": "0.6020836",
"text": "def to_s\n return \"#{location} #{purpose} #{hour} #{min}\"\n end",
"title": ""
},
{
"docid": "345da6c88f0cb68f762cacca3ac914ed",
"score": "0.6019835",
"text": "def to_s\n # used to store hours and minutes as two digits (e.g. 7:5 => 07:05)\n two_digit_hours = \"\"\n two_digit_minutes = \"\"\n \n # if hours are less than 10, append a 0 to make two digits\n if (hours < 10)\n two_digit_hours = \"0\" + hours.to_s\n else\n two_digit_hours = hours.to_s\n end\n \n # if minutes are less than 10, append a 0 to make two digits\n if (minutes < 10)\n two_digit_minutes = \"0\" + minutes.to_s\n else\n two_digit_minutes = minutes.to_s\n end\n \n two_digit_hours + \":\" + two_digit_minutes\n end",
"title": ""
},
{
"docid": "a557e1ee794d3b5428b224072a24c428",
"score": "0.60174096",
"text": "def format_time(time)\n time = time.to_s if time.is_a?(Time)\n DateTime.parse(time).to_time.utc.strftime('%Y-%m-%dT%H:%M:%S')\n end",
"title": ""
},
{
"docid": "df0f5600e14a5d21c71e2d313e6f832c",
"score": "0.6014497",
"text": "def format_time current_day, start_time, end_time\n \n # multi-day event?\n if start_time < current_day.beginning_of_day or (start_time == start_time.beginning_of_day and end_time > current_day) or (start_time == start_time.beginning_of_day and end_time == end_time.beginning_of_day and start_time != end_time)\n return \"\"\n end\n \n # start with hour\n formatted_string = start_time.strftime(\"%l\")\n \n # add minutes if non-zero\n formatted_string += start_time.strftime(\"%M\") == \"00\" ? \"\" : \":\" + start_time.strftime(\"%M\")\n \n # add PM if not am\n formatted_string += start_time.strftime(\"%P\") == \"am\" ? \"\" : \"p\"\n \n return formatted_string\n end",
"title": ""
},
{
"docid": "fe21b7e39793c30de69cc20d60df8e00",
"score": "0.6013424",
"text": "def formatted_time\n # If an end time isn't set:\n if hour_end.nil? && minute_end.nil?\n return nil if hour.nil?\n min = minute.nil? ? '' : \":#{ff(:minute, true)}\"\n am_pm = \" #{hour > 11 ? 'PM' : 'AM'}\"\n return ff(:hour, true) + min + am_pm\n # If at least one of the _end fields isn't nil:\n else\n certainty_str = format_grouped_certainties([:hour, :minute])\n return \"#{format_time(hour, minute)}-#{format_time(hour_end, minute_end)}#{certainty_str}\"\n end\n end",
"title": ""
},
{
"docid": "e76e48b33d11e1cfa85183cd3799c796",
"score": "0.60131466",
"text": "def to_s\n @time.toString\n end",
"title": ""
},
{
"docid": "add93f52290631154ddda03f2bc538f9",
"score": "0.60061634",
"text": "def format_time(time_in_sec)\n\t\tif (time_in_sec >= 86400)\n\t\t\tdays = (Time.at(time_in_sec).gmtime.strftime('%-d').to_i - 1).to_s\n\t\t\treturn Time.at(time_in_sec).gmtime.strftime(days+' day(s), %R:%S')\n\t\telse\n\t\t\treturn Time.at(time_in_sec).gmtime.strftime('%R:%S')\n\t\tend\n\tend",
"title": ""
},
{
"docid": "881c8d3e74fee6bdf3cb2e11349b6ac7",
"score": "0.6005005",
"text": "def time_string\r\n time = convert_time(self.seconds)\r\n hours = format_time(time[:hours])\r\n minutes = format_time(time[:minutes])\r\n new_seconds = format_time(time[:seconds])\r\n \"#{hours}:#{minutes}:#{new_seconds}\"\r\n end",
"title": ""
},
{
"docid": "5c317f3e5224a30f190625dbacf57d22",
"score": "0.59954464",
"text": "def time_out_str\n \"#{time_out.strftime(FULLTIME).gsub(/ 0(\\d\\D)/, ' \\1')}\"\n end",
"title": ""
},
{
"docid": "fafccb2752c2c4c80147e946420f118b",
"score": "0.59914416",
"text": "def to_s_without_day\n result = ''\n if open_24_hours\n return I18n.t 'cck_forms.work_hours.24h'\n elsif time_present?(open_time) or time_present?(close_time)\n ots, cts = time_to_s(open_time), time_to_s(close_time)\n if ots and cts\n result = sprintf('%s–%s', ots, cts)\n elsif ots\n result = sprintf(\"#{I18n.t 'cck_forms.work_hours.from'} %s\", ots)\n else\n result = sprintf(\"#{I18n.t 'cck_forms.work_hours.till'} %s\", cts)\n end\n end\n\n if open_until_last_client\n result += ' ' if result.present?\n result += I18n.t 'cck_forms.work_hours.until_last_client'\n end\n\n result\n end",
"title": ""
},
{
"docid": "b0f646aa9f6cc173174b3e963611bd22",
"score": "0.59904253",
"text": "def now_formatted\n Time.now.localtime.strftime('%Y%m%d%H%M%S') # Ora locale: AnnoMeseGiornoOraMinutiSecondi\n end",
"title": ""
},
{
"docid": "f531223b3344d6dfca66a78a5d7ebf91",
"score": "0.59894073",
"text": "def to_s\n \"#{@day.to_s} #{@schedule.to_s}\"\n end",
"title": ""
},
{
"docid": "fcdc00e5005a32f1f6b7a884d9c2af58",
"score": "0.59785706",
"text": "def localtime_str\n return \"#{\"%04d\" % @time.year}-#{\"%02d\" % @time.month}-#{\"%02d\" % @time.day} #{\"%02d\" % @time.hour}:#{\"%02d\" % @time.min}:#{\"%02d\" % @time.sec} #{self.offset_str}\"\n end",
"title": ""
},
{
"docid": "a3b5d41bf59b4631e14ff3a72edbee19",
"score": "0.59780526",
"text": "def time_string(format: :dhm)\n raise InvalidArgument, 'Invalid array, must be [d,h,m]' unless count == 3\n\n d, h, m = self\n case format\n when :clock\n if d.zero? && h > 24\n d = (h / 24).floor\n h = h % 24\n end\n format('%<d>02d:%<h>02d:%<m>02d', d: d, h: h, m: m)\n when :hmclock\n h += d * 24 if d.positive?\n format('%<h>02d:%<m>02d', h: h, m: m)\n when :ydhm\n to_abbr(years: true, separator: ' ')\n when :dhm\n to_abbr(years: false, separator: ' ')\n when :hm\n h += d * 24 if d.positive?\n format('%<h> 4dh %<m>02dm', h: h, m: m)\n when :m\n h += d * 24 if d.positive?\n m += h * 60 if h.positive?\n format('%<m> 4dm', m: m)\n when :tight\n to_abbr(years: true, separator: '')\n when :natural\n to_natural.join(', ')\n when :speech\n human = to_natural\n last = human.pop\n case human.count\n when 0\n last\n when 1\n \"#{human[0]} and #{last}\"\n else\n human.join(', ') + \", and #{last}\"\n end\n end\n end",
"title": ""
},
{
"docid": "c34d0713a05ad15d2d295b9e1bbd191c",
"score": "0.59730166",
"text": "def gmtoff_str\n t = @gmtoff\n sign = t < 0 ? '-' : '+'\n t = t.abs\n t, sec = t.divmod(60)\n hour, min = t.divmod(60)\n if sec == 0\n\treturn sprintf(\"%s%02d:%02d\", sign, hour, min)\n else\n\treturn sprintf(\"%s%02d:%02d:%02d\", sign, hour, min, sec)\n end\n end",
"title": ""
},
{
"docid": "9cee9b2db1360d1f6f83e4bdb33082b0",
"score": "0.5971321",
"text": "def iso_time_format(time)\n Time.at(time).strftime(\"%Y-%m-%d %H:%M:%S\")\n end",
"title": ""
},
{
"docid": "3c99aad52a84640dfaac60edfc1c0171",
"score": "0.5969817",
"text": "def time_format\r\n '%A, %B %-d at %l:%M:%S %p (%Z)'\r\n end",
"title": ""
},
{
"docid": "657a843922144c9815df55b23a39e8db",
"score": "0.5967594",
"text": "def full_date(time)\n time.strftime(\"%I:%M %p - %d %b %y\")\n end",
"title": ""
},
{
"docid": "ce6ac9f3f6ec68ec90957de7c72480b2",
"score": "0.59588265",
"text": "def time_string\n\t\tp @hours = @seconds/3600\n\t\tp @minutes = (@seconds-@hours*3600)/60\n\t\tp @seconds = @seconds%60\n\t\tresult = \"#{padded(@hours)}:#{padded(@minutes)}:#{padded(@seconds)}\"\n\tend",
"title": ""
},
{
"docid": "84341f459e90348d111e3ebb6037b4fa",
"score": "0.59496737",
"text": "def to_s\n # TODO this breaks the minus spec: strftime\n if @timeZone\n # offset = @timeZone.secondsFromGMT.abs\n offset = @timeZone.secondsFromGMTForDate(self).abs\n p offset\n hours = offset / 3600\n p hours\n minutes = hours % 60\n p minutes\n \n end\n format \"#{year}-%02d-%02d %02d:%02d:%02d +0200\", month, day, hour, minute, second\n end",
"title": ""
},
{
"docid": "c0635932b3efdfe16b1655ff06dec39b",
"score": "0.5949639",
"text": "def to_s\n \"(GMT#{formatted_offset}) #{name}\"\n end",
"title": ""
},
{
"docid": "30f57030d1fdcaec4c4783dc88fbd5ce",
"score": "0.594912",
"text": "def to_s\n [hour, minute].map { |v| v.to_s.rjust(2, '0') }.join(':')\n end",
"title": ""
},
{
"docid": "214cb56d073f8cd79f273b59f58b5c4b",
"score": "0.5948777",
"text": "def to_s\n if no_ending_time?\n formatted_s(@time_start)\n\n elsif start_end_on_same_day?\n \"#{formatted_s(@time_start)} — #{time_only(@time_end)}\"\n\n else\n \"#{formatted_s(@time_start)} — #{formatted_s(@time_end)}\"\n end\n end",
"title": ""
},
{
"docid": "a245693ca215b07e9c52388882585eab",
"score": "0.59485936",
"text": "def strftime(time)\n time.strftime('%Y-%m-%dT%T,%LZ')\nend",
"title": ""
},
{
"docid": "a804cfc021e917fde40cdc76b5de5ac6",
"score": "0.5945318",
"text": "def time_string\n return \"%02d%s%02d%s%02d\" % [self.hours,\":\",self.minutes,\":\",self.seconds]\n end",
"title": ""
},
{
"docid": "126136e46a007577da360377e058d14f",
"score": "0.59451556",
"text": "def formatted_time\n \"#{Time.now.hour}:#{Time.now.min}\"\n end",
"title": ""
}
] |
863d7adac19adedd98698d326a536481
|
PATCH/PUT /stills/1 PATCH/PUT /stills/1.json
|
[
{
"docid": "307638f91898b7c51e9d161b1b73b508",
"score": "0.0",
"text": "def update\n respond_to do |format|\n if @still.update(still_params)\n format.html { redirect_to @still, notice: 'Still was successfully updated.' }\n format.json { render :show, status: :ok, location: @still }\n else\n format.html { render :edit }\n format.json { render json: @still.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "04989f2fcc7181dce0f0c659cf847c51",
"score": "0.6303765",
"text": "def update\n respond_to do |format|\n if @stoff.update(stoff_params)\n format.html { redirect_to @stoff }\n format.json { render :show, status: :ok, location: @stoff }\n else\n format.html { render :edit }\n format.json { render json: @stoff.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4e0e59715d19dce2a47fccc2c67326dd",
"score": "0.62979454",
"text": "def patch!\n request! :patch\n end",
"title": ""
},
{
"docid": "76d63ad2f81055d884968f62501585d5",
"score": "0.6291163",
"text": "def update\n @slitter = Slitter.find(params[:id])\n\n respond_to do |format|\n if @slitter.update_attributes(params[:slitter])\n format.html { redirect_to @slitter, notice: 'Slitter was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @slitter.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "04a3ee01603023d9abcdc1a81cc6c15d",
"score": "0.6225478",
"text": "def update\n @stone = Stone.find(params[:id])\n\n respond_to do |format|\n if @stone.update_attributes(params[:stone])\n format.html { redirect_to @stone, notice: 'Stone was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @stone.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8d6a61f3186174209e44862cb0ae05d7",
"score": "0.6158877",
"text": "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",
"title": ""
},
{
"docid": "e7663d0348b74542ff1d2f4fd96156fe",
"score": "0.6137134",
"text": "def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end",
"title": ""
},
{
"docid": "c433e969f2bf34f0192230c3357b203e",
"score": "0.6101805",
"text": "def update\n respond_to do |format|\n if @kota_stone.update(kota_stone_params)\n format.html { redirect_to kota_stones_url, notice: 'Kota stone was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @kota_stone.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8d251bf6671649104f4f257036393d04",
"score": "0.6100616",
"text": "def update\n @slam = Slam.find(params[:id])\n \n respond_to do |format|\n if @slam.update_attributes(params[:slam])\n format.html { redirect_to @slam, notice: 'Fixed up!' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @slam.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cd7c96bd824997fdf4ccca71f6f2485d",
"score": "0.60774636",
"text": "def update\n respond_to do |format|\n if @lunch.update(lunch_params)\n format.html { redirect_to @lunch, notice: 'Lunch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @lunch.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5ba1e573fca43b27ce353ecaf4ea1445",
"score": "0.6052149",
"text": "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",
"title": ""
},
{
"docid": "5ba1e573fca43b27ce353ecaf4ea1445",
"score": "0.6052149",
"text": "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",
"title": ""
},
{
"docid": "2ed994882d1d1b5a84d197da2608a447",
"score": "0.60466576",
"text": "def update\n @todo = Todo.find(params[:id])\n @todo.update_attributes(params[:todo])\n render :json => @todo\n end",
"title": ""
},
{
"docid": "ab6461f021abc83f19c396685969f771",
"score": "0.60252666",
"text": "def update\n @staffer = Staffer.find(params[:id])\n\n respond_to do |format|\n if @staffer.update_attributes(params[:staffer])\n format.html { redirect_to @staffer, notice: 'Staffer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @staffer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7cbcb2cda6e100042f124dacd474f3be",
"score": "0.59960735",
"text": "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"title": ""
},
{
"docid": "42600a0d812dbc197a072968e63fa1ab",
"score": "0.59612644",
"text": "def update\n respond_to do |format|\n if @sloth.update(sloth_params)\n format.html { redirect_to @sloth, notice: 'Sloth was successfully updated.' }\n format.json { render :show, status: :ok, location: @sloth }\n else\n format.html { render :edit }\n format.json { render json: @sloth.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e89e1f4225b31cf2dc1822c27265ca1d",
"score": "0.59445024",
"text": "def update\n respond_to do |format|\n if @api_v1_todo.update(api_v1_todo_params)\n format.json { render json: @api_v1_todo, status: :ok }\n else\n format.json { render json: @api_v1_todo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3fc6bc9d1c018b1fda09a084c68627d5",
"score": "0.5938086",
"text": "def update\n respond_to do |format|\n if @stalkee.update(stalkee_params)\n format.html { redirect_to @stalkee, notice: 'Stalkee was successfully updated.' }\n format.json { render :show, status: :ok, location: @stalkee }\n else\n format.html { render :edit }\n format.json { render json: @stalkee.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "57d0f945b2a573d946e0695c6faa8784",
"score": "0.593588",
"text": "def update\n respond_to do |format|\n if @spliff.update(spliff_params)\n format.html { redirect_to '/spliffs', notice: 'Spliff was successfully updated.' }\n format.json { redirect_to '/spliffs', status: :ok, location: '/spliffs' }\n else\n format.html { render :edit }\n format.json { render json: @spliff.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b104e1ffdd69ea787e06df90ce879e14",
"score": "0.59331805",
"text": "def update\n @sklad = Sklad.find(params[:id])\n\n respond_to do |format|\n if @sklad.update_attributes(params[:sklad])\n format.html { redirect_to @sklad, notice: 'Sklad was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sklad.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f719592f797226b426c813f8d8a3717f",
"score": "0.5924094",
"text": "def update\n respond_to do |format|\n if @stinsfo.update(stinsfo_params)\n format.html { redirect_to @stinsfo, notice: 'Stinsfo was successfully updated.' }\n format.json { render :show, status: :ok, location: @stinsfo }\n else\n format.html { render :edit }\n format.json { render json: @stinsfo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "566b79a755478221953c8e53a0770812",
"score": "0.59196866",
"text": "def patch options\n rest_request({ method: :patch }.merge(options))\n end",
"title": ""
},
{
"docid": "566b79a755478221953c8e53a0770812",
"score": "0.59196866",
"text": "def patch options\n rest_request({ method: :patch }.merge(options))\n end",
"title": ""
},
{
"docid": "b4306cf7b2677be7b49449605ccd2021",
"score": "0.59076",
"text": "def update\n respond_to do |format|\n if @stall.update(stall_params)\n format.html { redirect_to @stall, notice: 'Stall was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @stall.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9b1af0080bfd7289040be85e7e430c11",
"score": "0.5895497",
"text": "def update\n @stundent = Stundent.find(params[:id])\n\n respond_to do |format|\n if @stundent.update_attributes(params[:stundent])\n format.html { redirect_to @stundent, notice: 'Stundent was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @stundent.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "22c8ad9af74017def208534773ebbf2f",
"score": "0.58850557",
"text": "def update\n @todo = Todo.find(params[:id])\n if @todo.update_attributes(todo_params)\n render json: @todo, status: :ok\n else\n render json: @todo.errors, status: 422\n end\n end",
"title": ""
},
{
"docid": "c5d3a8748b0325a90f44f542d008b0be",
"score": "0.5880082",
"text": "def update\n @stable = Stable.find(params[:id])\n\n respond_to do |format|\n if @stable.update_attributes(params[:stable])\n format.html { redirect_to @stable, notice: 'Stable was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @stable.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e06d1b231b5b6f93bb3ed7d3f6f8f3e7",
"score": "0.58793795",
"text": "def update\n @slab = Slab.find(params[:id])\n\n respond_to do |format|\n if @slab.update_attributes(params[:slab])\n format.html { redirect_to @slab, :notice => 'Slab was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @slab.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "868df77dbb38077b04ed3633d6ba3a63",
"score": "0.58545023",
"text": "def update\n @litter = Litter.find(params[:id])\n\n respond_to do |format|\n if @litter.update_attributes(params[:litter])\n format.html { redirect_to @litter, notice: 'Litter was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @litter.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e9ef16a0fbdf45f55fd45ba2fdbe9676",
"score": "0.5849422",
"text": "def update\n @spoofer = Spoofer.find(params[:id])\n\n respond_to do |format|\n if @spoofer.update_attributes(params[:spoofer])\n format.html { redirect_to @spoofer, notice: 'Spoofer was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @spoofer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e6ad72ad3d51fb6dfdb467ba0557a118",
"score": "0.58471495",
"text": "def update\n respond_to do |format|\n if @snipet.update(snipet_params)\n format.html { redirect_to @snipet, notice: 'Snipet was successfully updated.' }\n format.json { render :show, status: :ok, location: @snipet }\n else\n format.html { render :edit }\n format.json { render json: @snipet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d37b39a795a6e081d6480942ece1c538",
"score": "0.5839465",
"text": "def put!\n request! :put\n end",
"title": ""
},
{
"docid": "63f7af79fc170063fe31f54b55d65e7c",
"score": "0.5836245",
"text": "def update\n streak, success = jsonapi_update.to_a\n\n if success\n render_jsonapi(streak, scope: false)\n else\n render_errors_for(streak)\n end\n end",
"title": ""
},
{
"docid": "eccc06711b6190543a8e8bebf33ae60b",
"score": "0.58323175",
"text": "def update\n respond_to do |format|\n if @snail.update(snail_params)\n format.html { redirect_to @snail, notice: 'Snail was successfully updated.' }\n format.json { render :show, status: :ok, location: @snail }\n else\n format.html { render :edit }\n format.json { render json: @snail.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eccc06711b6190543a8e8bebf33ae60b",
"score": "0.58323175",
"text": "def update\n respond_to do |format|\n if @snail.update(snail_params)\n format.html { redirect_to @snail, notice: 'Snail was successfully updated.' }\n format.json { render :show, status: :ok, location: @snail }\n else\n format.html { render :edit }\n format.json { render json: @snail.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "593a44661145186c50e85fe3c02ffd96",
"score": "0.5823242",
"text": "def patch(path, params = {})\n request(:patch, path, params)\n end",
"title": ""
},
{
"docid": "593a44661145186c50e85fe3c02ffd96",
"score": "0.5823242",
"text": "def patch(path, params = {})\n request(:patch, path, params)\n end",
"title": ""
},
{
"docid": "fbfb1e901e1a85794e70f91d769a52c8",
"score": "0.5813101",
"text": "def update\n @microposst = Microposst.find(params[:id])\n\n respond_to do |format|\n if @microposst.update_attributes(params[:microposst])\n format.html { redirect_to @microposst, notice: 'Microposst was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @microposst.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "944c6bc00cddb7eabf404d677c4ce863",
"score": "0.58119166",
"text": "def update\n @student = Student.find(params[:student_id])\n @lunchdetention = @student.lunchdetentions.find(params[:id])\n\n respond_to do |format|\n if @lunchdetention.update_attributes(params[:lunchdetention])\n format.html { redirect_to :back, notice: 'lunchdetention was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @lunchdetention.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d4ef989d8743bdf8c57e55d4d894dddc",
"score": "0.5800919",
"text": "def patch(path, data)\n request 'PATCH', path, body: data.to_json\n end",
"title": ""
},
{
"docid": "5b499df53d71acaf7701afcb31fb81ec",
"score": "0.57849354",
"text": "def update\n respond_to do |format|\n if @strosek.update(strosek_params)\n format.html { redirect_to @strosek, notice: 'Strosek was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @strosek.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fca6bf337e68118321bbc7282c79d654",
"score": "0.57774603",
"text": "def update\n respond_to do |format|\n if @staffer.update(staffer_params)\n format.html { redirect_to @staffer, notice: 'Staffer was successfully updated.' }\n format.json { render :show, status: :ok, location: @staffer }\n else\n format.html { render :edit }\n format.json { render json: @staffer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "54f95a361000b6219275e377b8bf4555",
"score": "0.57645464",
"text": "def update options={}\n client.put(\"/#{id}\", options)\n end",
"title": ""
},
{
"docid": "1e9299fe874a0822426d05aacb3d78e7",
"score": "0.57639533",
"text": "def update\n respond_to do |format|\n if @sleuth.update(sleuth_params)\n format.html { redirect_to @sleuth, notice: 'Sleuth was successfully updated.' }\n format.json { render :show, status: :ok, location: @sleuth }\n else\n format.html { render :edit }\n format.json { render json: @sleuth.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "71bc7b181a35ac002b48f998e1aec554",
"score": "0.57571036",
"text": "def update\n @slitting = Slitting.find(params[:id])\n\n respond_to do |format|\n if @slitting.update_attributes(params[:slitting])\n flash[:notice] = 'Slitting was successfully updated.'\n format.html { redirect_to(@slitting) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @slitting.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9a377a410c937e8035547a1a6e1b7e81",
"score": "0.57516754",
"text": "def update\n @todo = Todo.find(params[:id])\n if @todo.update(todo_params)\n render json: @todo\n else\n render json: @todo.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "3502f3e25d621941064ba2f59158ae91",
"score": "0.5741071",
"text": "def update\n respond_to do |format|\n if @stadium.update(stadium_params)\n format.html { redirect_to @stadium, notice: 'Stadium was successfully updated.' }\n format.json { render :show, status: :ok, location: @stadium }\n else\n format.html { render :edit }\n format.json { render json: @stadium.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a85f0e1782c91266ead30739a6c0a556",
"score": "0.57338154",
"text": "def update\n @litter = Litter.find(params[:id])\n @sires = Sire.find(:all,:order=>\"name\")\n @dames = Dame.find(:all,:order=>\"name\")\n\n respond_to do |format|\n if @litter.update_attributes(params[:litter])\n format.html { redirect_to(litters_path, :notice => 'Litter was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @litter.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "778d4a389345d2a0c9c4fd76356a4e6c",
"score": "0.5732156",
"text": "def update\n respond_to do |format|\n if @stuck.update(stuck_params)\n format.html { redirect_to @stuck, notice: 'Stuck was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @stuck.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "576f27e4c99d0868b0454fedc7deba0c",
"score": "0.5724723",
"text": "def update # PATCH\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "36f61cd18df2c257ac0ce607cfca9772",
"score": "0.5721924",
"text": "def update\n @sti = Sti.find(params[:id])\n\n respond_to do |format|\n if @sti.update_attributes(params[:sti])\n flash[:notice] = 'Sti was successfully updated.'\n format.html { redirect_to(@sti) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @sti.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0ae90d34afc70f493672879bff4c4d5e",
"score": "0.57135034",
"text": "def update\n respond_to do |format|\n if @mystic.update(mystic_params)\n format.html { redirect_to @mystic, notice: 'Mystic was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @mystic.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c3f7148a41e8cdf01dd08e508038670e",
"score": "0.5712447",
"text": "def update\n @microplst = Microplst.find(params[:id])\n\n respond_to do |format|\n if @microplst.update_attributes(params[:microplst])\n format.html { redirect_to @microplst, notice: 'Microplst was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @microplst.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fb88fef9ffa0d872f40dcfb6a7c29bc5",
"score": "0.571103",
"text": "def patch(path, opts = {})\n request(:patch, path, opts).body\n end",
"title": ""
},
{
"docid": "e0bd82d189ed4e5c5690d1c896e9503a",
"score": "0.5710325",
"text": "def update\n @livestock = Livestock.find(params[:id])\n\n respond_to do |format|\n if @livestock.update_attributes(params[:livestock])\n format.html { redirect_to @livestock, notice: 'Livestock was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @livestock.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fffd01798fda370f37dded205e2377a2",
"score": "0.57070535",
"text": "def update\n @sf_sobject = Sfsync::Sobject.find(params[:id])\n \n respond_to do |format|\n if @sf_sobject.update_attributes(params[:sf_sobject])\n format.html { redirect_to @sf_sobject, notice: 'Sobject was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sf_sobject.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4b7151541fd6b41c9704962a7e008e0b",
"score": "0.5701592",
"text": "def update\n @bundlesticker = Bundlesticker.find(params[:id])\n\n respond_to do |format|\n if @bundlesticker.update_attributes(params[:bundlesticker])\n format.html { redirect_to @bundlesticker, notice: 'Bundlesticker was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bundlesticker.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "129813f878bdb65e40141aa72a205f4e",
"score": "0.5689934",
"text": "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",
"title": ""
},
{
"docid": "85d2ed02d760acd40f7badcfec78a18a",
"score": "0.56895435",
"text": "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",
"title": ""
},
{
"docid": "3a2675f163424056f7661dbb4176394f",
"score": "0.5682494",
"text": "def update\n if signed_in?\n @litra = Litra.find(params[:id])\n\n respond_to do |format|\n if @litra.update_attributes(params[:litra])\n format.html { redirect_to @litra, notice: 'Litra was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @litra.errors, status: :unprocessable_entity }\n end\n end\n end\nend",
"title": ""
},
{
"docid": "5c6cf5fd9f043928ae0e56a5d202cc99",
"score": "0.5681801",
"text": "def update\n @therapist = Therapist.find(params[:id])\n\n respond_to do |format|\n if @therapist.update_attributes(params[:therapist])\n format.html { redirect_to @therapist, notice: 'Therapist was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @therapist.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e293d17d815d3dc3960cb3d6901ff340",
"score": "0.56777054",
"text": "def update\n @todo = Todo.find(params[:todo][:id])\n if @todo.update_attributes(user_params)\n render json: @todo\n else\n render nothing: true, status: :bad_request\n end\n end",
"title": ""
},
{
"docid": "16fad9ebd34d681226bcad45fbafd81b",
"score": "0.56766707",
"text": "def update\n respond_to do |format|\n if @silla.update(silla_params)\n format.html { redirect_to @silla, notice: 'Silla was successfully updated.' }\n format.json { render :show, status: :ok, location: @silla }\n else\n format.html { render :edit }\n format.json { render json: @silla.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aa9d0b0ca6116043535673470427a2fe",
"score": "0.56757206",
"text": "def update\n if @person.seat\n render json: {errors: 'Cannot update a seated person'}, status: 422\n else\n @person.update person_params\n render json: @person\n end\n end",
"title": ""
},
{
"docid": "3db896a30e80f67939e84c5cee664d7a",
"score": "0.56702864",
"text": "def update\n respond_to do |format|\n if @ststu.update(ststu_params)\n format.html { redirect_to @ststu, notice: 'Ststu was successfully updated.' }\n format.json { render :show, status: :ok, location: @ststu }\n else\n format.html { render :edit }\n format.json { render json: @ststu.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "314b66b0f393c2b5b50b3455f6a64122",
"score": "0.5669451",
"text": "def edit\n @therapist_consent = TherapistConsent.find(params[:id])\n respond_to do |format|\n format.html { render action: 'edit' }\n format.json { render :status => 200, :json => { action: 'edit', therapist_consent: @therapist_consent}}\n end\n end",
"title": ""
},
{
"docid": "80273438d4daed0622ca2b9fb246c9f9",
"score": "0.5668427",
"text": "def update\n @momsg = Momsg.find(params[:id])\n\n respond_to do |format|\n if @momsg.update_attributes(params[:momsg])\n format.html { redirect_to @momsg, notice: 'Momsg was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @momsg.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b858d8b55287e5f7320319e4cc990ed9",
"score": "0.5666421",
"text": "def update\n respond_to do |format|\n if @stadium.update(stadium_params)\n format.html { redirect_to [:admin, @stadium], notice: 'Stadium успешно обновлен(о).' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @stadium.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "86866e2ccc677d77d99364b534b82117",
"score": "0.56646997",
"text": "def update\n @interested = Interested.find(params[:id])\n\n respond_to do |format|\n if @interested.update_attributes(params[:interested])\n format.html { redirect_to @interested, notice: 'Interested was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @interested.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a54a5b4d0a8ba68ecc468dbb77c14ed1",
"score": "0.56638664",
"text": "def update\n @interest = Interest.find(params[:id])\n \n respond_to do |format|\n if @interest.update_attributes(params[:interest])\n format.json { head :ok }\n else\n format.json { render :json => @interest.errors,\n :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "590fc079742037ff6a8d47f0467c6d3f",
"score": "0.5662027",
"text": "def update\n respond_to do |format|\n if @stilage.update(stilage_params)\n format.html { redirect_to @stilage, notice: 'Stilage was successfully updated.' }\n format.json { render :show, status: :ok, location: @stilage }\n else\n format.html { render :edit }\n format.json { render json: @stilage.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "909b760f54f181542cb95aee2413689b",
"score": "0.5650306",
"text": "def patch\n end",
"title": ""
},
{
"docid": "7494579be062863dd97693d5ea366d76",
"score": "0.56478256",
"text": "def update\n respond_to do |format|\n if @stall.update(stall_params)\n format.html { redirect_to @stall, notice: 'Stall was successfully updated.' }\n format.json { render :show, status: :ok, location: @stall }\n else\n format.html { render :edit }\n format.json { render json: @stall.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7494579be062863dd97693d5ea366d76",
"score": "0.56478256",
"text": "def update\n respond_to do |format|\n if @stall.update(stall_params)\n format.html { redirect_to @stall, notice: 'Stall was successfully updated.' }\n format.json { render :show, status: :ok, location: @stall }\n else\n format.html { render :edit }\n format.json { render json: @stall.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ba46986fdc924917712b3c35cf981093",
"score": "0.5644966",
"text": "def update\n respond_to do |format|\n if @squire.update(squire_params)\n format.html { redirect_to @squire, notice: 'Squire was successfully updated.' }\n format.json { render :show, status: :ok, location: @squire }\n else\n format.html { render :edit }\n format.json { render json: @squire.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "471fe032b297bc36d07e8551bcbee03e",
"score": "0.56429553",
"text": "def update\n \t\t@interested = Interested.find(params[:id])\n\n \t\trespond_to do |format|\n \t\t\tif @interested.update_attributes(params[:interested])\n \t\t\tformat.html { redirect_to @interested, notice: 'Interested was sucessfully updated.' }\n \t\t\tformat.json {head :no_content }\n \t\t\telse\n \t\t\t\tformat.html { render action: \"edit\" }\n \t\t\t\tformat.json { render json: @interested.error, status: :unprocessable_entity }\n \t\t\tend\n \t\tend\n \tend",
"title": ""
},
{
"docid": "8565b9ed6af37ff2131471f96a855df2",
"score": "0.56327003",
"text": "def update\n respond_to do |format|\n if @sivic_discipulo.update(sivic_discipulo_params_netested)\n format.html { redirect_to @sivic_discipulo, notice: 'Registro alterado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @sivic_discipulo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "57d009bb8775104a4aa805c98e4af16a",
"score": "0.56325024",
"text": "def update\n respond_to do |format|\n if @sintoma.update(sintoma_params)\n format.html { redirect_to @sintoma, notice: 'Sintoma was successfully updated.' }\n format.json { render :show, status: :ok, location: @sintoma }\n else\n format.html { render :edit }\n format.json { render json: @sintoma.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "64f42e3efdc5095f8930fd0873d4a26c",
"score": "0.5632069",
"text": "def update\n @serving = Serving.find(params[:id])\n\n respond_to do |format|\n if @serving.update_attributes(params[:serving])\n format.html { redirect_to @serving, notice: 'Serving was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @serving.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8fd4fa198edb3f893c5ba6487a79bafa",
"score": "0.5630869",
"text": "def update\n respond_to do |format|\n if @saloon.update(saloon_params)\n format.html { redirect_to @saloon, notice: 'Saloon was successfully updated.' }\n format.json { render :show, status: :ok, location: @saloon }\n else\n format.html { render :edit }\n format.json { render json: @saloon.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "931f17c5c899a79322a439bd3a6eca7b",
"score": "0.5628514",
"text": "def update\n @patch = Patch.find(params[:id])\n\n respond_to do |format|\n if @patch.update_attributes(params[:patch])\n format.html { redirect_to @patch, notice: 'Patch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @patch.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6638e3b1d0364d63ce69b8eac029b916",
"score": "0.56281185",
"text": "def update\n respond_to do |format|\n if @slap.update(slap_params)\n format.html { redirect_to @slap, notice: 'Slap was successfully updated.' }\n format.json { render :show, status: :ok, location: @slap }\n else\n format.html { render :edit }\n format.json { render json: @slap.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "31032405d9dbc1d6e245440615283025",
"score": "0.5627736",
"text": "def update\n @sprint = Sprint.find(params[:id])\n respond_to do |format|\n if @sprint.update_attributes(params[:sprint])\n format.html { redirect_to @sprint, notice: 'Sprint was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sprint.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "943cf18882bc4aee1eaceefa27672918",
"score": "0.56256527",
"text": "def update\n @skill_set = SkillSet.find(params[:id])\n\n respond_to do |format|\n if @skill_set.update_attributes(params[:skill_set])\n format.html { redirect_to @skill_set, notice: 'Skill set was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @skill_set.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "84f2d68dc84d9c8be9bb908304afea8f",
"score": "0.5624603",
"text": "def update\n @servicio = Servicio.find(params[:id])\n\n respond_to do |format|\n if @servicio.update_attributes(params[:servicio])\n format.html { redirect_to @servicio, :notice => 'Servicio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @servicio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4bf99e432659ab9fd8f9f04bd1f67d47",
"score": "0.5623964",
"text": "def update\n @sprint.update!(sprint_params)\n json_response(@sprint)\n end",
"title": ""
},
{
"docid": "f81ec75e50514c8d3f03ea46bff624fd",
"score": "0.56217766",
"text": "def update\n @lot = Lot.find(params[:id])\n\n respond_to do |format|\n if @lot.update_attributes(params[:lot])\n format.html { redirect_to myadmin_lots_path, :notice => 'Lot was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @lot.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9e299e467f1f4d5b1d85e42dd12f3c0c",
"score": "0.5620202",
"text": "def update\n respond_to do |format|\n if @kata.update(kata_params)\n format.html { redirect_to @kata, notice: 'Kata was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @kata.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b0cbac59f6fda593e90a8857fbf98979",
"score": "0.56199366",
"text": "def update\n respond_to do |format|\n if @liftset.update(liftset_params)\n format.html { redirect_to @liftset, notice: 'Liftset was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @liftset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dba85f86b1f7b5d3b7db71ccaa75510f",
"score": "0.5619451",
"text": "def update\n @sprint = Sprint.find(params[:id])\n\n respond_to do |format|\n if @sprint.update_attributes(params[:sprint])\n format.html { redirect_to [:admin, @sprint], notice: 'Sprint was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sprint.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5e56ffd059e845e4f5a5635eb240fe98",
"score": "0.5617969",
"text": "def update\n @strelki = Strelki.find(params[:id])\n\n respond_to do |format|\n if @strelki.update_attributes(params[:strelki])\n flash[:notice] = 'Strelki was successfully updated.'\n format.html { redirect_to(@strelki) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @strelki.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bf853de57d7343e6432de61321feeca3",
"score": "0.5614192",
"text": "def update\n respond_to do |format|\n if @mystock.update(mystock_params)\n format.html { redirect_to @mystock, notice: 'mystock was successfully updated.' }\n format.json { render :show, status: :ok, location: @mystock }\n else\n format.html { render :edit }\n format.json { render json: @mystock.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ab7fd05464f65d8dc0896b54ed9935b2",
"score": "0.5613212",
"text": "def update\n respond_to do |format|\n if @rest.update(rest_params)\n format.html { redirect_to @rest, notice: 'Rest was successfully updated.' }\n format.json { render :show, status: :ok, location: @rest }\n else\n format.html { render :edit }\n format.json { render json: @rest.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "77bded7880eb73001ad21220f8b43c02",
"score": "0.56084305",
"text": "def update\n @solicitud_servicio = SolicitudServicio.find(params[:id])\n\n respond_to do |format|\n if @solicitud_servicio.update_attributes(params[:solicitud_servicio])\n format.html { redirect_to @solicitud_servicio, notice: 'Solicitud servicio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @solicitud_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "98ffa158acbf02cbf2dc20af8c117e34",
"score": "0.5606613",
"text": "def update\n put :update\n end",
"title": ""
},
{
"docid": "0cd74027a2595c671ae23a0c565cccf9",
"score": "0.5602612",
"text": "def update\n respond_to do |format|\n if @platoon.update(platoon_params)\n format.html { redirect_to @platoon, notice: 'Platoon was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @platoon.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c3fc4c7dfddfeea7a59b7bc061071f0d",
"score": "0.56007916",
"text": "def update\n @bla = Bla.find(params[:id])\n\n respond_to do |format|\n if @bla.update_attributes(params[:bla])\n format.html { redirect_to @bla, :notice => 'Bla was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @bla.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e207c47ee086271c071e4cdf00099cd6",
"score": "0.5600582",
"text": "def update\n @koti = Koti.find(params[:id])\n\n respond_to do |format|\n if @koti.update_attributes(params[:koti])\n format.html { redirect_to @koti, notice: 'Koti was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @koti.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "56499466735f33d56a044cc9fc0e2f61",
"score": "0.5590234",
"text": "def update\n respond_to do |format|\n if @stuk_todo_task.update(stuk_todo_task_params)\n format.html { redirect_to @stuk_todo_task, notice: 'Stuk todo task was successfully updated.' }\n format.json { render :show, status: :ok, location: @stuk_todo_task }\n else\n format.html { render :edit }\n format.json { render json: @stuk_todo_task.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2f56d2a6ed45aa98f70e5458b26386f9",
"score": "0.5588855",
"text": "def update\n respond_to do |format|\n if @kristine_toy.update(kristine_toy_params)\n format.html { redirect_to @kristine_toy, notice: 'Kristine toy was successfully updated.' }\n format.json { render :show, status: :ok, location: @kristine_toy }\n else\n format.html { render :edit }\n format.json { render json: @kristine_toy.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ef1f4294edc6a27bc46cbe44c1c6961c",
"score": "0.55874485",
"text": "def update\r\n @student1 = Student1.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @student1.update_attributes(params[:student1])\r\n format.html { redirect_to @student1, notice: 'Student1 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: @student1.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "6e163a06a03c7004df84f3acb28060ae",
"score": "0.55871975",
"text": "def update\n @feat = @person.feats.find(params[:id])\n level_old = @person.level\n\n if params[:feat][:completed] == '1'\n @feat.complete\n else\n @feat.uncomplete\n end\n sign = params[:feat][:completed] == '1' ? '+': '-'\n \n has_leveled = @person.level > level_old\n\n respond_to do |format|\n format.json { render :json => {\n :xpGained => \"#{sign}#{@feat.xp}\",\n :xpTotal => @person.xp,\n :next_level_ratio => @person.next_level_ratio,\n :extra_life => @person.level_to_string,\n :has_leveled => has_leveled,\n :completed => @feat.completed,\n :streak => @feat.calculate_streak}}\n \n end\n\n end",
"title": ""
}
] |
127183007732dc8811349015bb4e7786
|
Set the value of the SiteKey input for this Choreo.
|
[
{
"docid": "fa0881a2c6f5bdbeafdbf5b5c7d6bb33",
"score": "0.7639689",
"text": "def set_SiteKey(value)\n set_input(\"SiteKey\", value)\n end",
"title": ""
}
] |
[
{
"docid": "325490f29fd19c572de27de1605d48c1",
"score": "0.603694",
"text": "def site_id=(site_id)\n if !site_id.nil? && site_id < 1\n fail ArgumentError, 'invalid value for \"site_id\", must be greater than or equal to 1.'\n end\n\n @site_id = site_id\n end",
"title": ""
},
{
"docid": "e4149d7ea487e5f5220768bd3496a891",
"score": "0.5851273",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "e4149d7ea487e5f5220768bd3496a891",
"score": "0.5851273",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "e4149d7ea487e5f5220768bd3496a891",
"score": "0.5851273",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "e4149d7ea487e5f5220768bd3496a891",
"score": "0.5851273",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "e4149d7ea487e5f5220768bd3496a891",
"score": "0.5851273",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "e4149d7ea487e5f5220768bd3496a891",
"score": "0.5851273",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "e4149d7ea487e5f5220768bd3496a891",
"score": "0.5851273",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "e4149d7ea487e5f5220768bd3496a891",
"score": "0.5851273",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "e4149d7ea487e5f5220768bd3496a891",
"score": "0.5851273",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "e4149d7ea487e5f5220768bd3496a891",
"score": "0.5851273",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "e4149d7ea487e5f5220768bd3496a891",
"score": "0.5851273",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "480609fab2c4b07af8dc60f96b135d9e",
"score": "0.57474226",
"text": "def site_id=(value)\n @site_id = value\n end",
"title": ""
},
{
"docid": "61c52db5f1f198a86300ae98b9c71b5e",
"score": "0.5702034",
"text": "def ssl_key=(key)\n set_option(:sslkey, key)\n end",
"title": ""
},
{
"docid": "fc493a394ff072c2caba94c5f495e1ae",
"score": "0.5644888",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "fc493a394ff072c2caba94c5f495e1ae",
"score": "0.5644888",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "fc493a394ff072c2caba94c5f495e1ae",
"score": "0.5644888",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "fc493a394ff072c2caba94c5f495e1ae",
"score": "0.5644888",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "fc493a394ff072c2caba94c5f495e1ae",
"score": "0.5644888",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "fc493a394ff072c2caba94c5f495e1ae",
"score": "0.56442463",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "fc493a394ff072c2caba94c5f495e1ae",
"score": "0.56442463",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "fc493a394ff072c2caba94c5f495e1ae",
"score": "0.56442463",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "fc493a394ff072c2caba94c5f495e1ae",
"score": "0.56442463",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "fc493a394ff072c2caba94c5f495e1ae",
"score": "0.56442463",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "fc493a394ff072c2caba94c5f495e1ae",
"score": "0.56442463",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "fc493a394ff072c2caba94c5f495e1ae",
"score": "0.56442463",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "fc493a394ff072c2caba94c5f495e1ae",
"score": "0.56442463",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "fc493a394ff072c2caba94c5f495e1ae",
"score": "0.56442463",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "fc493a394ff072c2caba94c5f495e1ae",
"score": "0.56442463",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "fc493a394ff072c2caba94c5f495e1ae",
"score": "0.56442463",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "fc493a394ff072c2caba94c5f495e1ae",
"score": "0.56442463",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "fc493a394ff072c2caba94c5f495e1ae",
"score": "0.56442463",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "fc493a394ff072c2caba94c5f495e1ae",
"score": "0.56442463",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "fc493a394ff072c2caba94c5f495e1ae",
"score": "0.56442463",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "fc493a394ff072c2caba94c5f495e1ae",
"score": "0.56442463",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "fc493a394ff072c2caba94c5f495e1ae",
"score": "0.56442463",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "fc493a394ff072c2caba94c5f495e1ae",
"score": "0.56442463",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "fc493a394ff072c2caba94c5f495e1ae",
"score": "0.56442463",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "fc493a394ff072c2caba94c5f495e1ae",
"score": "0.56442463",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "fc493a394ff072c2caba94c5f495e1ae",
"score": "0.56442463",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "fc493a394ff072c2caba94c5f495e1ae",
"score": "0.56442463",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "fc493a394ff072c2caba94c5f495e1ae",
"score": "0.56442463",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "fc493a394ff072c2caba94c5f495e1ae",
"score": "0.56442463",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "fc493a394ff072c2caba94c5f495e1ae",
"score": "0.56442463",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "fc493a394ff072c2caba94c5f495e1ae",
"score": "0.56442463",
"text": "def set_SiteID(value)\n set_input(\"SiteID\", value)\n end",
"title": ""
},
{
"docid": "3ba95daae7ee216a2cd5fde3434bc01d",
"score": "0.5534324",
"text": "def site_id=(value)\n @site_id = value\n end",
"title": ""
},
{
"docid": "bb19980065a795e3a6222ed2fd75d613",
"score": "0.5528238",
"text": "def set_site_path(site_path)\n @site_path = site_path\n end",
"title": ""
},
{
"docid": "09f30846810991fb803878bc66178bf6",
"score": "0.54974",
"text": "def set_site\n @site = Site.find(params[:id] || params[:site_id])\n end",
"title": ""
},
{
"docid": "bb30474a862d15fef58ab3921b6c7f5b",
"score": "0.5370389",
"text": "def set_Site(value)\n set_input(\"Site\", value)\n end",
"title": ""
},
{
"docid": "bb30474a862d15fef58ab3921b6c7f5b",
"score": "0.5370389",
"text": "def set_Site(value)\n set_input(\"Site\", value)\n end",
"title": ""
},
{
"docid": "bb30474a862d15fef58ab3921b6c7f5b",
"score": "0.5370389",
"text": "def set_Site(value)\n set_input(\"Site\", value)\n end",
"title": ""
},
{
"docid": "e455d67a8d5ff4a9f6e8d6863548d18f",
"score": "0.53278106",
"text": "def site=(site)\n @site = site\n end",
"title": ""
},
{
"docid": "f5bdc6457555faae85bd364b599d5f97",
"score": "0.53024495",
"text": "def set_site\n @site = Site.find(params[:id])\n end",
"title": ""
},
{
"docid": "f5bdc6457555faae85bd364b599d5f97",
"score": "0.53024495",
"text": "def set_site\n @site = Site.find(params[:id])\n end",
"title": ""
},
{
"docid": "f5bdc6457555faae85bd364b599d5f97",
"score": "0.53024495",
"text": "def set_site\n @site = Site.find(params[:id])\n end",
"title": ""
},
{
"docid": "2eba255a5891d1c993b36358bcbde11c",
"score": "0.5237543",
"text": "def site=(value)\n @site = value\n end",
"title": ""
},
{
"docid": "2eba255a5891d1c993b36358bcbde11c",
"score": "0.5237543",
"text": "def site=(value)\n @site = value\n end",
"title": ""
},
{
"docid": "bf3c05c5938cdecfc2cf1e7ed0f09109",
"score": "0.52297527",
"text": "def set_site\n @site = Site.find(params[:id])\n end",
"title": ""
},
{
"docid": "bf3c05c5938cdecfc2cf1e7ed0f09109",
"score": "0.52297527",
"text": "def set_site\n @site = Site.find(params[:id])\n end",
"title": ""
},
{
"docid": "bf3c05c5938cdecfc2cf1e7ed0f09109",
"score": "0.52297527",
"text": "def set_site\n @site = Site.find(params[:id])\n end",
"title": ""
},
{
"docid": "bf3c05c5938cdecfc2cf1e7ed0f09109",
"score": "0.52297527",
"text": "def set_site\n @site = Site.find(params[:id])\n end",
"title": ""
},
{
"docid": "bf3c05c5938cdecfc2cf1e7ed0f09109",
"score": "0.52297527",
"text": "def set_site\n @site = Site.find(params[:id])\n end",
"title": ""
},
{
"docid": "bf3c05c5938cdecfc2cf1e7ed0f09109",
"score": "0.52297527",
"text": "def set_site\n @site = Site.find(params[:id])\n end",
"title": ""
},
{
"docid": "bf3c05c5938cdecfc2cf1e7ed0f09109",
"score": "0.52297527",
"text": "def set_site\n @site = Site.find(params[:id])\n end",
"title": ""
},
{
"docid": "bf3c05c5938cdecfc2cf1e7ed0f09109",
"score": "0.52297527",
"text": "def set_site\n @site = Site.find(params[:id])\n end",
"title": ""
},
{
"docid": "bf3c05c5938cdecfc2cf1e7ed0f09109",
"score": "0.52297527",
"text": "def set_site\n @site = Site.find(params[:id])\n end",
"title": ""
},
{
"docid": "bf3c05c5938cdecfc2cf1e7ed0f09109",
"score": "0.52297527",
"text": "def set_site\n @site = Site.find(params[:id])\n end",
"title": ""
},
{
"docid": "bf3c05c5938cdecfc2cf1e7ed0f09109",
"score": "0.52297527",
"text": "def set_site\n @site = Site.find(params[:id])\n end",
"title": ""
},
{
"docid": "bf3c05c5938cdecfc2cf1e7ed0f09109",
"score": "0.52297527",
"text": "def set_site\n @site = Site.find(params[:id])\n end",
"title": ""
},
{
"docid": "bf3c05c5938cdecfc2cf1e7ed0f09109",
"score": "0.52297527",
"text": "def set_site\n @site = Site.find(params[:id])\n end",
"title": ""
},
{
"docid": "bf3c05c5938cdecfc2cf1e7ed0f09109",
"score": "0.52297527",
"text": "def set_site\n @site = Site.find(params[:id])\n end",
"title": ""
},
{
"docid": "bf3c05c5938cdecfc2cf1e7ed0f09109",
"score": "0.52297527",
"text": "def set_site\n @site = Site.find(params[:id])\n end",
"title": ""
},
{
"docid": "bf3c05c5938cdecfc2cf1e7ed0f09109",
"score": "0.52297527",
"text": "def set_site\n @site = Site.find(params[:id])\n end",
"title": ""
},
{
"docid": "bf3c05c5938cdecfc2cf1e7ed0f09109",
"score": "0.52297527",
"text": "def set_site\n @site = Site.find(params[:id])\n end",
"title": ""
},
{
"docid": "bf3c05c5938cdecfc2cf1e7ed0f09109",
"score": "0.52297527",
"text": "def set_site\n @site = Site.find(params[:id])\n end",
"title": ""
},
{
"docid": "bf3c05c5938cdecfc2cf1e7ed0f09109",
"score": "0.52297527",
"text": "def set_site\n @site = Site.find(params[:id])\n end",
"title": ""
},
{
"docid": "bf3c05c5938cdecfc2cf1e7ed0f09109",
"score": "0.52297527",
"text": "def set_site\n @site = Site.find(params[:id])\n end",
"title": ""
},
{
"docid": "bf3c05c5938cdecfc2cf1e7ed0f09109",
"score": "0.52297527",
"text": "def set_site\n @site = Site.find(params[:id])\n end",
"title": ""
},
{
"docid": "bf3c05c5938cdecfc2cf1e7ed0f09109",
"score": "0.52297527",
"text": "def set_site\n @site = Site.find(params[:id])\n end",
"title": ""
},
{
"docid": "bf3c05c5938cdecfc2cf1e7ed0f09109",
"score": "0.52297527",
"text": "def set_site\n @site = Site.find(params[:id])\n end",
"title": ""
},
{
"docid": "bf3c05c5938cdecfc2cf1e7ed0f09109",
"score": "0.52297527",
"text": "def set_site\n @site = Site.find(params[:id])\n end",
"title": ""
},
{
"docid": "bf3c05c5938cdecfc2cf1e7ed0f09109",
"score": "0.52297527",
"text": "def set_site\n @site = Site.find(params[:id])\n end",
"title": ""
},
{
"docid": "bf3c05c5938cdecfc2cf1e7ed0f09109",
"score": "0.52297527",
"text": "def set_site\n @site = Site.find(params[:id])\n end",
"title": ""
},
{
"docid": "bf3c05c5938cdecfc2cf1e7ed0f09109",
"score": "0.52297527",
"text": "def set_site\n @site = Site.find(params[:id])\n end",
"title": ""
},
{
"docid": "bf3c05c5938cdecfc2cf1e7ed0f09109",
"score": "0.52297527",
"text": "def set_site\n @site = Site.find(params[:id])\n end",
"title": ""
},
{
"docid": "92cfc44ba7e75418a5ba88503bbd8833",
"score": "0.5215366",
"text": "def update_site_key project_id:, site_key:, domain:\n # Create the reCAPTCHA client.\n client = ::Google::Cloud::RecaptchaEnterprise.recaptcha_enterprise_service\n\n request_key = client.get_key name: \"projects/#{project_id}/keys/#{site_key}\"\n request_key.web_settings.allowed_domains.push domain\n request_key.web_settings.allow_amp_traffic = true\n\n client.update_key key: request_key\n\n # Retrieve the key and check if the property is updated.\n response = client.get_key name: \"projects/#{project_id}/keys/#{site_key}\"\n web_settings = response.web_settings\n\n puts \"reCAPTCHA Site key successfully updated with allow_amp_traffic to #{web_settings.allow_amp_traffic}!\"\nend",
"title": ""
},
{
"docid": "ed2c3a7a55cba01f46d19987ff631ed1",
"score": "0.5194654",
"text": "def site=(site)\n @site = alias_site_title(site)\n end",
"title": ""
},
{
"docid": "f198aefc96dfbc01fd9573cb3426ef5f",
"score": "0.51480573",
"text": "def site_name=(a_site_name)\n self[:site_name] = a_site_name.downcase if a_site_name\n end",
"title": ""
},
{
"docid": "1a79b668360cf43aab3cc29a2a50b0e4",
"score": "0.5145572",
"text": "def setSiteAddress( siteAddress )\n\n # parameter TypeCheck\n #BIMserverAPI::TypeCheck::String( siteAddress )\n\n # BIMserver request\n request( { siteAddress: siteAddress } )\n end",
"title": ""
},
{
"docid": "c81a5f0469b515dde4ae7eac852e88ab",
"score": "0.51222324",
"text": "def set_site\n @site = current_user.sites.find(params[:id])\n end",
"title": ""
}
] |
2aa61a53c0680d85ce7b15f0fa75d6ba
|
return emotion of content
|
[
{
"docid": "676595aaf1f463b386fd8e0f9f2a2b93",
"score": "0.6886735",
"text": "def contentEmotion\n return @@analyzer.sentiment(@reviewContent)\n end",
"title": ""
}
] |
[
{
"docid": "78495c02cce6d432e6380df683d37770",
"score": "0.67610526",
"text": "def emotion\n\t\t\t# get the emotion for which the emotion score value is highest\n\t\t\tif @emotions\n\t\t\t\tget_emotion_score(@emotions, build_term_frequencies)\n\t\t\telse\n\t\t\t\tget_emotion_score(get_term_emotions, build_term_frequencies)\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "37bd9d87c83fcb76a7a3ddaed944fbd6",
"score": "0.6491762",
"text": "def em(text)\n # returns Shoes::Em\n throw NotImplementedError\n end",
"title": ""
},
{
"docid": "8b0fd06a322fdc5f88e6c997a885245d",
"score": "0.6486116",
"text": "def emoticons\n (positive_emoticons + negative_emoticons)\n end",
"title": ""
},
{
"docid": "de5e1fdfa84ce10aaee1c8531c6583cb",
"score": "0.6372627",
"text": "def italic?; end",
"title": ""
},
{
"docid": "c8bba91418db8fc7223951a809243700",
"score": "0.6227911",
"text": "def emojify(content)\n h(content).to_str.gsub(/:([\\w+-]+):/) do |match|\n emoji = Emoji.find_by_alias(Regexp.last_match(1))\n if emoji\n %(<img alt=\"#{Regexp.last_match(1)}\" src=\"#{asset_path(\"emoji/#{emoji.image_filename}\")}\" style=\"vertical-align:middle\" width=\"20\" height=\"20\" />)\n else\n match\n end\n end.html_safe if content.present?\n end",
"title": ""
},
{
"docid": "e02d76e326de0648272755afcec554e3",
"score": "0.61856014",
"text": "def emotions_about(emotive)\n _emotions_about(emotive).pluck(:emotion).map(&:to_sym)\n end",
"title": ""
},
{
"docid": "3e299ab9d760ea672f303e2e8842bcaa",
"score": "0.618369",
"text": "def parse_emphasis(word1)\n in_a_tag = false\n\n word2 = word1.chars.map do |i|\n if in_a_tag == false && i == '*'\n in_a_tag = true\n i.sub(i, \"<em>\")\n elsif in_a_tag == true && i == '*'\n in_a_tag = false\n i.sub(i, \"</em>\")\n else\n i\n end\n end\n word2.join\n end",
"title": ""
},
{
"docid": "4a022af023fc5d0ad95f35602f3adcc4",
"score": "0.61405843",
"text": "def get_content(e)\n\tif e == nil\n\t\treturn \" \"\n\telse return e.content\n\tend\nend",
"title": ""
},
{
"docid": "3b93ba3048016af30692ce9d9d98f175",
"score": "0.60480237",
"text": "def display_emotions\n @emotions.each do |k, v|\n if v == 3\n puts \"#{@name} is feeling a high amount of #{k}.\"\n elsif v == 2\n puts \"#{@name} is feeling a medium amount of #{k}.\"\n else\n puts \"#{@name} is feeling a low amount of #{k}.\"\n end\n end\n end",
"title": ""
},
{
"docid": "53c9347c7e968311c11c617f419477cd",
"score": "0.60306215",
"text": "def get_term_emotions\n\t\t\t@emotions = {\"anger\"=>[\"abhor\", \"abhorr\", \"abhorrence\", \"abomin\", \"abominate\",\n\t\t\t\t\"abomination\", \"aggrav\", \"aggravate\", \"aggravated\", \"aggravation\", \"aggress\",\n\t\t\t\t\"aggression\", \"aggressive\", \"aggressiveness\", \"amok\", \"amuck\", \"anger\",\n\t\t\t\t\"angered\", \"angri\", \"angrili\", \"angrily\", \"angry\", \"animos\", \"animosity\",\n\t\t\t\t\"animus\", \"annoy\", \"annoyance\", \"annoyed\", \"annoying\", \"antagon\",\n\t\t\t\t\"antagonism\", \"avarici\", \"avaricious\", \"bad_blood\", \"bad_temp\", \"bad_temper\",\n\t\t\t\t\"baffl\", \"baffled\", \"balk\", \"balked\", \"bedevil\", \"begrudg\", \"begrudge\",\n\t\t\t\t\"begrudging\", \"belliger\", \"belligerence\", \"belligerency\", \"belligerent\",\n\t\t\t\t\"belligerently\", \"bitter\", \"bitterness\", \"bother\", \"bothersom\", \"bothersome\",\n\t\t\t\t\"brood\", \"chafe\", \"choler\", \"choleric\", \"class_feel\", \"class_feeling\",\n\t\t\t\t\"contemn\", \"covet\", \"covetous\", \"covetously\", \"covetousness\", \"crucifi\",\n\t\t\t\t\"crucify\", \"dander\", \"despis\", \"despisal\", \"despise\", \"despising\", \"despit\",\n\t\t\t\t\"despiteful\", \"detest\", \"detestation\", \"devil\", \"discourag\", \"discouraged\",\n\t\t\t\t\"disdain\", \"displeas\", \"displease\", \"displeased\", \"displeasing\",\n\t\t\t\t\"displeasingly\", \"displeasur\", \"displeasure\", \"dudgeon\", \"dun\", \"enfuri\",\n\t\t\t\t\"enfuriate\", \"enmiti\", \"enmity\", \"enrag\", \"enraged\", \"enragement\", \"envi\",\n\t\t\t\t\"enviabl\", \"enviable\", \"enviably\", \"envious\", \"enviously\", \"enviousness\",\n\t\t\t\t\"envy\", \"evil\", \"exacerb\", \"exacerbate\", \"exasper\", \"exasperate\",\n\t\t\t\t\"exasperating\", \"exasperation\", \"execr\", \"execrate\", \"execration\", \"fit\",\n\t\t\t\t\"frustrat\", \"frustrate\", \"frustrated\", \"frustrating\", \"frustration\", \"furi\",\n\t\t\t\t\"furious\", \"furiously\", \"fury\", \"gall\", \"galling\", \"get_at\", \"get_to\",\n\t\t\t\t\"grabbi\", \"grabby\", \"grasp\", \"grasping\", \"gravel\", \"greedi\", \"greedy\", \"green-\n\t\t\t\tey\", \"green-eyed\", \"green-eyed_monst\", \"green-eyed_monster\", \"grievanc\",\n\t\t\t\t\"grievance\", \"grizzl\", \"grizzle\", \"grudg\", \"grudge\", \"grudging\", \"hackl\",\n\t\t\t\t\"hackles\", \"harass\", \"harassed\", \"harassment\", \"harri\", \"harried\", \"hate\",\n\t\t\t\t\"hateful\", \"hatefully\", \"hatr\", \"hatred\", \"heartburn\", \"heartburning\",\n\t\t\t\t\"high_dudgeon\", \"hostil\", \"hostile\", \"hostilely\", \"hostility\", \"huffi\",\n\t\t\t\t\"huffili\", \"huffily\", \"huffiness\", \"huffish\", \"huffishness\", \"huffy\",\n\t\t\t\t\"ill_temp\", \"ill_temper\", \"ill_wil\", \"ill_will\", \"incens\", \"incense\",\n\t\t\t\t\"incensed\", \"indign\", \"indignant\", \"indignantly\", \"indignation\", \"infuri\",\n\t\t\t\t\"infuriate\", \"infuriated\", \"infuriating\", \"infuriation\", \"irasc\",\n\t\t\t\t\"irascibility\", \"irascible\", \"ire\", \"irrit\", \"irritate\", \"irritated\",\n\t\t\t\t\"irritating\", \"irritation\", \"jealous\", \"jealousi\", \"jealously\", \"jealousy\",\n\t\t\t\t\"livid\", \"lividity\", \"lividly\", \"loath\", \"loathe\", \"loathing\", \"mad\",\n\t\t\t\t\"madden\", \"maddened\", \"maddening\", \"madness\", \"malef\", \"malefic\",\n\t\t\t\t\"maleficence\", \"malevol\", \"malevolence\", \"malevolent\", \"malevolently\",\n\t\t\t\t\"malic\", \"malice\", \"malici\", \"malicious\", \"maliciously\", \"maliciousness\",\n\t\t\t\t\"malign\", \"malignity\", \"misanthrop\", \"misanthropi\", \"misanthropic\",\n\t\t\t\t\"misanthropical\", \"misanthropy\", \"misocainea\", \"misogami\", \"misogamy\",\n\t\t\t\t\"misogyn\", \"misogyni\", \"misogynic\", \"misogynism\", \"misogyny\", \"misolog\",\n\t\t\t\t\"misology\", \"mison\", \"misoneism\", \"misopedia\", \"murder\", \"murderously\",\n\t\t\t\t\"murderousness\", \"nark\", \"nettl\", \"nettle\", \"nettled\", \"nettlesom\",\n\t\t\t\t\"nettlesome\", \"odium\", \"offend\", \"offens\", \"offense\", \"oppress\", \"outrag\",\n\t\t\t\t\"outrage\", \"outraged\", \"overjeal\", \"overjealous\", \"peev\", \"peeved\",\n\t\t\t\t\"persecut\", \"persecute\", \"peski\", \"pesky\", \"pester\", \"pestered\", \"pestering\",\n\t\t\t\t\"pestifer\", \"pestiferous\", \"piqu\", \"pique\", \"piss\", \"pissed\", \"plaguey\",\n\t\t\t\t\"plaguy\", \"pout\", \"prehensil\", \"prehensile\", \"provok\", \"provoked\",\n\t\t\t\t\"quick_temp\", \"quick_temper\", \"rag\", \"rage\", \"rancor\", \"rancour\", \"resent\",\n\t\t\t\t\"resentful\", \"resentfully\", \"resentment\", \"reveng\", \"revengefully\", \"rile\",\n\t\t\t\t\"riled\", \"roil\", \"roiled\", \"scene\", \"score\", \"scorn\", \"see_r\", \"see_red\",\n\t\t\t\t\"short_temp\", \"short_temper\", \"sore\", \"spite\", \"spiteful\", \"spitefulness\",\n\t\t\t\t\"spleen\", \"stew\", \"stung\", \"sulk\", \"sulki\", \"sulkiness\", \"sulky\", \"tantal\",\n\t\t\t\t\"tantalize\", \"tantrum\", \"teas\", \"teasing\", \"temper\", \"the_green-eyed_monst\",\n\t\t\t\t\"the_green-eyed_monster\", \"torment\", \"umbrag\", \"umbrage\", \"umbrageous\",\n\t\t\t\t\"veng\", \"vengefully\", \"vengefulness\", \"venom\", \"vex\", \"vexat\", \"vexati\",\n\t\t\t\t\"vexation\", \"vexatious\", \"vexed\", \"vexing\", \"vindict\", \"vindictive\",\n\t\t\t\t\"vindictively\", \"vindictiveness\", \"warpath\", \"with_hostil\", \"with_hostility\",\n\t\t\t\t\"wrath\", \"wrathful\", \"wrathfully\", \"wroth\", \"wrothful\"], \"disgust\"=>[\"abhorr\",\n\t\t\t\t\"abhorrent\", \"abomin\", \"abominably\", \"churn_up\", \"detest\", \"detestable\",\n\t\t\t\t\"detestably\", \"disgust\", \"disgusted\", \"disgustedly\", \"disgustful\",\n\t\t\t\t\"disgusting\", \"disgustingly\", \"distast\", \"distasteful\", \"distastefully\",\n\t\t\t\t\"fed_up\", \"foul\", \"hideous\", \"horror\", \"loath\", \"loathly\", \"loathsom\",\n\t\t\t\t\"loathsome\", \"nausea\", \"nauseat\", \"nauseate\", \"nauseated\", \"nauseating\",\n\t\t\t\t\"nauseous\", \"noisom\", \"noisome\", \"obscen\", \"obscene\", \"odious\", \"odiously\",\n\t\t\t\t\"offens\", \"offensive\", \"queasi\", \"queasy\", \"repel\", \"repellant\", \"repellent\",\n\t\t\t\t\"repugn\", \"repugnance\", \"repugnant\", \"repuls\", \"repulse\", \"repulsion\",\n\t\t\t\t\"repulsive\", \"repulsively\", \"revolt\", \"revolting\", \"revoltingly\", \"revuls\",\n\t\t\t\t\"revulsion\", \"sick\", \"sick_of\", \"sicken\", \"sickening\", \"sickeningly\",\n\t\t\t\t\"sickish\", \"tired_of\", \"turn_off\", \"vile\", \"wick\", \"wicked\", \"yucki\",\n\t\t\t\t\"yucky\"], \"joy\"=>[\"admir\", \"admirable\", \"admirably\", \"admiration\", \"admire\",\n\t\t\t\t\"ador\", \"adorably\", \"adoration\", \"adoring\", \"affect\", \"affection\",\n\t\t\t\t\"affectional\", \"affectionate\", \"affectionateness\", \"affective\", \"amat\",\n\t\t\t\t\"amative\", \"amatori\", \"amatory\", \"amic\", \"amicability\", \"amicable\",\n\t\t\t\t\"amicableness\", \"amicably\", \"amor\", \"amorous\", \"amorousness\", \"anticip\",\n\t\t\t\t\"anticipate\", \"anticipation\", \"appreci\", \"appreciated\", \"approb\",\n\t\t\t\t\"approbative\", \"approbatori\", \"approbatory\", \"approv\", \"approval\", \"approve\",\n\t\t\t\t\"approved\", \"approving\", \"ardor\", \"ardour\", \"attach\", \"attachment\", \"avid\",\n\t\t\t\t\"avidity\", \"avidness\", \"bang\", \"banter\", \"barrack\", \"be_on_cloud_nin\",\n\t\t\t\t\"be_on_cloud_nine\", \"beam\", \"beaming\", \"becharm\", \"beguil\", \"beguile\",\n\t\t\t\t\"beguiled\", \"belong\", \"belonging\", \"benef\", \"benefic\", \"beneficed\",\n\t\t\t\t\"beneficence\", \"beneficent\", \"benefici\", \"beneficially\", \"benevol\",\n\t\t\t\t\"benevolence\", \"benevolent\", \"benevolently\", \"bewitch\", \"bewitching\", \"blith\",\n\t\t\t\t\"blithely\", \"blitheness\", \"bonheur\", \"brother\", \"brotherhood\", \"brotherlik\",\n\t\t\t\t\"brotherlike\", \"brotherly\", \"buoyanc\", \"buoyancy\", \"calf_lov\", \"calf_love\",\n\t\t\t\t\"captiv\", \"captivate\", \"captivated\", \"captivating\", \"captivation\", \"captur\",\n\t\t\t\t\"capture\", \"care\", \"carefre\", \"carefree\", \"carefreeness\", \"caring\", \"catch\",\n\t\t\t\t\"chaff\", \"charg\", \"charge\", \"charit\", \"charitable\", \"charm\", \"charmed\",\n\t\t\t\t\"cheer\", \"cheer_up\", \"cheerful\", \"cheerfully\", \"cheerfulness\", \"cheeri\",\n\t\t\t\t\"cheering\", \"cheery\", \"chirk_up\", \"cliff-hang\", \"cliff-hanging\", \"close\",\n\t\t\t\t\"closeness\", \"comfort\", \"comfortable\", \"comfortableness\", \"comfortably\",\n\t\t\t\t\"comforting\", \"commend\", \"commendable\", \"compat\", \"compatibility\",\n\t\t\t\t\"compatible\", \"compatibly\", \"complac\", \"complacence\", \"complacency\",\n\t\t\t\t\"complacent\", \"concern\", \"congratul\", \"congratulate\", \"consol\", \"console\",\n\t\t\t\t\"content\", \"contented\", \"contentment\", \"crush\", \"delight\", \"delighted\",\n\t\t\t\t\"devot\", \"devoted\", \"devotedness\", \"devotion\", \"eager\", \"eagerly\",\n\t\t\t\t\"eagerness\", \"ebulli\", \"ebullient\", \"ebulliently\", \"elan\", \"elat\", \"elate\",\n\t\t\t\t\"elated\", \"elating\", \"elation\", \"embolden\", \"emot\", \"emotive\", \"empath\",\n\t\t\t\t\"empathet\", \"empathetic\", \"empathetically\", \"empathi\", \"empathic\", \"empathy\",\n\t\t\t\t\"enamor\", \"enamored\", \"enamoredness\", \"enamour\", \"enchant\", \"enchanting\",\n\t\t\t\t\"enchantment\", \"endear\", \"endearingly\", \"enjoy\", \"enthral\", \"enthralled\",\n\t\t\t\t\"enthralling\", \"enthrallment\", \"enthusiasm\", \"enthusiast\", \"enthusiastic\",\n\t\t\t\t\"enthusiastically\", \"entranc\", \"entrance\", \"entranced\", \"entrancing\",\n\t\t\t\t\"esteem\", \"euphor\", \"euphori\", \"euphoria\", \"euphoriant\", \"euphoric\", \"exalt\",\n\t\t\t\t\"excit\", \"excitement\", \"exciting\", \"exhilar\", \"exhilarate\", \"exhilarated\",\n\t\t\t\t\"exhilarating\", \"exhilaration\", \"exhort\", \"expans\", \"expansively\", \"expect\",\n\t\t\t\t\"expectancy\", \"exuber\", \"exuberance\", \"exuberant\", \"exuberantly\", \"exult\",\n\t\t\t\t\"exultant\", \"exultantly\", \"exultation\", \"exulting\", \"exultingly\", \"fanci\",\n\t\t\t\t\"fancy\", \"fascin\", \"fascinate\", \"fascinating\", \"fascination\", \"favor\",\n\t\t\t\t\"favorable\", \"favorably\", \"favour\", \"favourable\", \"favourably\",\n\t\t\t\t\"feeling_of_ident\", \"feeling_of_identity\", \"fellow_feel\", \"fellow_feeling\",\n\t\t\t\t\"festal\", \"festiv\", \"festive\", \"flush\", \"fond\", \"fond_regard\", \"fondly\",\n\t\t\t\t\"fondness\", \"fratern\", \"fraternal\", \"friend\", \"friendli\", \"friendliness\",\n\t\t\t\t\"friendly\",\"fulfil\", \"fulfill\", \"fulfillment\", \"fulfilment\", \"gaieti\",\n\t\t\t\t\"gaiety\", \"gala\", \"gay\", \"gayli\", \"gayly\", \"giving_protect\",\n\t\t\t\t\"giving_protection\", \"glad\", \"gladden\", \"gladdened\", \"gladfulness\",\n\t\t\t\t\"gladness\", \"gladsom\", \"gladsome\", \"gladsomeness\", \"glee\", \"gleeful\",\n\t\t\t\t\"gleefulli\", \"gleefully\", \"gleefulness\", \"gloat\", \"gloating\", \"gloatingly\",\n\t\t\t\t\"good\", \"good_wil\", \"good_will\", \"goodwil\", \"goodwill\", \"gratifi\", \"gratify\",\n\t\t\t\t\"gratifying\", \"gratifyingly\", \"great\", \"gusto\", \"happi\", \"happili\", \"happily\",\n\t\t\t\t\"happiness\", \"happy\", \"heart\", \"hearten\", \"hero_worship\", \"high_spirit\",\n\t\t\t\t\"high_spirits\", \"high-spirit\", \"high-spirited\", \"hilar\", \"hilari\",\n\t\t\t\t\"hilarious\", \"hilariously\", \"hilarity\", \"identif\", \"identifi\",\n\t\t\t\t\"identification\", \"identify\", \"impress\", \"infatu\", \"infatuation\", \"insouci\",\n\t\t\t\t\"insouciance\", \"inspir\", \"inspire\", \"interest\", \"intimaci\", \"intimacy\",\n\t\t\t\t\"intox\", \"intoxicate\", \"jocular\", \"jocularity\", \"jocund\", \"jocundity\",\n\t\t\t\t\"jolli\", \"jolliti\", \"jollity\", \"jolly\", \"jolly_along\", \"jolly_up\", \"jovial\",\n\t\t\t\t\"joviality\", \"joy\", \"joyful\", \"joyfully\", \"joyfulness\", \"joyous\", \"joyously\",\n\t\t\t\t\"joyousness\", \"jubil\", \"jubilance\", \"jubilancy\", \"jubilant\", \"jubilantly\",\n\t\t\t\t\"jubilate\", \"jubilation\", \"jump_for_joy\", \"keen\", \"keenness\", \"kick\", \"kid\",\n\t\t\t\t\"kind\", \"kindheart\", \"kindhearted\", \"kindheartedness\", \"kindly\", \"laudabl\",\n\t\t\t\t\"laudably\", \"lift_up\", \"lighthearted\", \"lightheartedness\", \"lightsom\",\n\t\t\t\t\"lightsomeness\", \"likabl\", \"likable\", \"like\", \"likeabl\", \"likeable\", \"liking\",\n\t\t\t\t\"live_up_to\", \"look_for\", \"look_to\", \"look_up_to\", \"love\", \"lovesom\",\n\t\t\t\t\"lovesome\", \"loving\", \"lovingly\", \"lovingness\", \"loyalti\", \"loyalty\", \"merri\",\n\t\t\t\t\"merrili\", \"merrily\", \"merriment\", \"merry\", \"mirth\", \"mirthful\", \"mirthfully\",\n\t\t\t\t\"mirthfulness\", \"move\", \"near\", \"nigh\", \"occupi\", \"occupy\",\n\t\t\t\t\"offering_protect\", \"offering_protection\", \"partial\", \"partiality\",\n\t\t\t\t\"penchant\", \"pep_up\", \"perki\", \"perkiness\", \"pick_up\", \"pleas\", \"pleased\",\n\t\t\t\t\"pleasing\", \"praiseworthili\", \"praiseworthily\", \"predilect\", \"predilection\",\n\t\t\t\t\"preen\", \"prefer\", \"preference\", \"pride\", \"prideful\", \"protect\", \"protective\",\n\t\t\t\t\"protectively\", \"protectiveness\", \"proud\", \"proudly\", \"puppy_lov\",\n\t\t\t\t\"puppy_love\", \"rapport\", \"recreat\", \"recreate\", \"regard\", \"rejoic\", \"rejoice\",\n\t\t\t\t\"rejoicing\", \"relish\", \"respect\", \"revel\", \"riotous\", \"riotously\", \"romant\",\n\t\t\t\t\"romantic\", \"rush\", \"satiabl\", \"satiable\", \"satisfact\", \"satisfaction\",\n\t\t\t\t\"satisfactori\", \"satisfactorili\", \"satisfactorily\", \"satisfactory\", \"satisfi\",\n\t\t\t\t\"satisfiable\", \"satisfied\", \"satisfy\", \"satisfying\", \"satisfyingly\",\n\t\t\t\t\"schadenfreud\", \"schadenfreude\", \"scream\", \"screaming\", \"self-complac\", \"self-\n\t\t\t\tcomplacency\", \"self-satisfact\", \"self-satisfaction\", \"self-satisfi\", \"self-\n\t\t\t\tsatisfied\", \"smug\", \"smugness\", \"soft_spot\", \"soft-boil\", \"soft-boiled\",\n\t\t\t\t\"softheart\", \"softhearted\", \"softheartedness\", \"solac\", \"solace\", \"sooth\",\n\t\t\t\t\"soothe\", \"stimul\", \"stimulating\", \"strike\", \"sunni\", \"sunny\", \"suspens\",\n\t\t\t\t\"suspense\", \"suspenseful\", \"suspensive\", \"sympathet\", \"sympathetic\",\n\t\t\t\t\"sympathetically\", \"sympathi\", \"sympathy\", \"tast\", \"taste\", \"teas\", \"teased\",\n\t\t\t\t\"tender\", \"tenderness\", \"thirstili\", \"thirstily\", \"thrill\", \"tickl\", \"tickle\",\n\t\t\t\t\"titil\", \"titillate\", \"titillated\", \"titillating\", \"titillation\", \"togeth\",\n\t\t\t\t\"togetherness\", \"tranc\", \"trance\", \"triumph\", \"triumphal\", \"triumphant\",\n\t\t\t\t\"triumphantly\", \"unworri\", \"unworried\", \"uplift\", \"uproari\", \"uproarious\",\n\t\t\t\t\"uproariously\", \"urg\", \"urge\", \"urge_on\", \"walk_on_air\", \"wallow\", \"warm\",\n\t\t\t\t\"warmheart\", \"warmhearted\", \"warmheartedness\", \"warmth\", \"weak\", \"weakness\",\n\t\t\t\t\"with_empathi\", \"with_empathy\", \"with_happi\", \"with_happiness\", \"with_prid\",\n\t\t\t\t\"with_pride\", \"with_sympathi\", \"with_sympathy\", \"worri\", \"worry\", \"worship\",\n\t\t\t\t\"worshipful\", \"zeal\", \"zealous\", \"zest\", \"zestfulness\"], \"surprise\"=>[\"admir\",\n\t\t\t\t\"admiration\", \"amaz\", \"amaze\", \"amazed\", \"amazement\", \"amazing\", \"amazingly\",\n\t\t\t\t\"astoni\", \"astonied\", \"astonish\", \"astonished\", \"astonishing\",\n\t\t\t\t\"astonishingly\", \"astonishment\", \"astound\", \"astounded\", \"astounding\", \"aw\",\n\t\t\t\t\"awe\", \"awed\", \"awestricken\", \"awestruck\", \"awful\", \"baffl\", \"baffle\", \"beat\",\n\t\t\t\t\"besot\", \"bewild\", \"bewilder\", \"daze\", \"dazed\", \"dumbfound\", \"dumbfounded\",\n\t\t\t\t\"dumfound\", \"dumfounded\", \"fantast\", \"fantastic\", \"flabbergast\",\n\t\t\t\t\"flabbergasted\", \"flummox\", \"get\", \"gravel\", \"howl\", \"howling\", \"in_awe_of\",\n\t\t\t\t\"marvel\", \"marvellously\", \"marvelous\", \"marvelously\", \"mystifi\", \"mystify\",\n\t\t\t\t\"nonplus\", \"perplex\", \"puzzl\", \"puzzle\", \"rattl\", \"rattling\", \"stagger\",\n\t\t\t\t\"staggering\", \"stun\", \"stunned\", \"stupefact\", \"stupefaction\", \"stupefi\",\n\t\t\t\t\"stupefied\", \"stupefy\", \"stupefying\", \"stupid\", \"stupifi\", \"stupify\",\n\t\t\t\t\"superbl\", \"superbly\", \"surpris\", \"surprise\", \"surprised\", \"surprisedly\",\n\t\t\t\t\"surprising\", \"surprisingly\", \"terrif\", \"terrific\", \"terrifically\",\n\t\t\t\t\"thunderstruck\", \"top\", \"toppingly\", \"tremend\", \"tremendous\", \"trounc\",\n\t\t\t\t\"trounce\", \"wonder\", \"wonderful\", \"wonderfully\", \"wonderment\", \"wondrous\",\n\t\t\t\t\"wondrously\"], \"fear\"=>[\"affright\", \"afraid\", \"alarm\", \"alarmed\", \"alert\",\n\t\t\t\t\"anxious\", \"anxiously\", \"appal\", \"appall\", \"apprehens\", \"apprehension\",\n\t\t\t\t\"apprehensive\", \"apprehensively\", \"apprehensiveness\", \"atroci\", \"atrocious\",\n\t\t\t\t\"aw\", \"awful\", \"awfully\", \"bash\", \"bashfully\", \"bode\", \"boding\", \"browbeaten\",\n\t\t\t\t\"bulli\", \"bullied\", \"chill\", \"chilling\", \"cliff-hang\", \"cliff-hanging\",\n\t\t\t\t\"coldhearted\", \"coldheartedness\", \"constern\", \"consternation\", \"cow\", \"cowed\",\n\t\t\t\t\"cower\", \"crawl\", \"creep\", \"creeps\", \"cring\", \"cringe\", \"cruel\", \"cruelli\",\n\t\t\t\t\"cruelly\", \"cruelti\", \"cruelty\", \"dash\", \"daunt\", \"diffid\", \"diffidence\",\n\t\t\t\t\"diffident\", \"diffidently\", \"dire\", \"direful\", \"dismay\", \"dread\", \"dreaded\",\n\t\t\t\t\"dreadful\", \"dreadfully\", \"fawn\", \"fear\", \"fearful\", \"fearfully\",\n\t\t\t\t\"fearfulness\", \"fearsom\", \"fearsome\", \"forebod\", \"foreboding\", \"fright\",\n\t\t\t\t\"frighten\", \"frighten_away\", \"frighten_off\", \"frightened\", \"frightening\",\n\t\t\t\t\"frighteningly\", \"frightful\", \"grovel\", \"hangdog\", \"hardheart\", \"hardhearted\",\n\t\t\t\t\"hardheartedness\", \"heartless\", \"heartlessly\", \"heartlessness\", \"hesit\",\n\t\t\t\t\"hesitance\", \"hesitancy\", \"hesitantly\", \"hesitatingly\", \"hideous\",\n\t\t\t\t\"hideously\", \"horrend\", \"horrendous\", \"horribl\", \"horrible\", \"horribly\",\n\t\t\t\t\"horrid\", \"horridly\", \"horrif\", \"horrifi\", \"horrific\", \"horrified\", \"horrify\",\n\t\t\t\t\"horrifying\", \"horrifyingly\", \"horror\", \"horror-stricken\", \"horror-struck\",\n\t\t\t\t\"hyster\", \"hysteria\", \"hysterical\", \"hysterically\", \"intimid\", \"intimidate\",\n\t\t\t\t\"intimidated\", \"intimidation\", \"merciless\", \"mercilessness\", \"monstrous\",\n\t\t\t\t\"monstrously\", \"outrag\", \"outrageous\", \"pall\", \"panic\", \"panic_attack\",\n\t\t\t\t\"panic-stricken\", \"panic-struck\", \"panick\", \"panicked\", \"panicki\", \"panicky\",\n\t\t\t\t\"pitiless\", \"pitilessness\", \"premonit\", \"premonition\", \"presag\", \"presage\",\n\t\t\t\t\"presenti\", \"presentiment\", \"ruthless\", \"ruthlessness\", \"scare\", \"scare_away\",\n\t\t\t\t\"scare_off\", \"scared\", \"scarey\", \"scari\", \"scarili\", \"scarily\", \"scary\",\n\t\t\t\t\"self-distrust\", \"self-doubt\", \"shadow\", \"shi\", \"shiveri\", \"shivery\",\n\t\t\t\t\"shudderi\", \"shuddery\", \"shy\", \"shyli\", \"shyly\", \"shyness\", \"stage_fright\",\n\t\t\t\t\"suspens\", \"suspense\", \"suspenseful\", \"suspensive\", \"terribl\", \"terrible\",\n\t\t\t\t\"terrifi\", \"terrified\", \"terror\", \"timid\", \"timidity\", \"timidly\", \"timidness\",\n\t\t\t\t\"timor\", \"timorous\", \"timorously\", \"timorousness\", \"trepid\", \"trepidation\",\n\t\t\t\t\"trepidly\", \"ugli\", \"ugly\", \"unassert\", \"unassertive\", \"unassertively\",\n\t\t\t\t\"unassertiveness\", \"uneasili\", \"uneasily\", \"unkind\", \"unsur\", \"unsure\"],\n\t\t\t\t\"sadness\"=>[\"aggriev\", \"aggrieve\", \"attrit\", \"attrition\", \"bad\", \"bereav\",\n\t\t\t\t\"bereaved\", \"bereft\", \"blue\", \"blue_devil\", \"blue_devils\", \"bore\", \"bored\",\n\t\t\t\t\"brokenhearted\", \"brokenheartedness\", \"cast_down\", \"cheerless\", \"cheerlessly\",\n\t\t\t\t\"cheerlessness\", \"compunct\", \"compunction\", \"contrit\", \"contrite\",\n\t\t\t\t\"contritely\", \"contriteness\", \"contrition\", \"dark\", \"deject\", \"demor\",\n\t\t\t\t\"demoralis\", \"demoralising\", \"demoralization\", \"demoralize\", \"demoralized\",\n\t\t\t\t\"demoralizing\", \"deplor\", \"deplorable\", \"deplorably\", \"depress\", \"depressed\",\n\t\t\t\t\"depressing\", \"depression\", \"depressive\", \"desol\", \"desolate\", \"desolation\",\n\t\t\t\t\"despair\", \"despairingly\", \"despond\", \"despondence\", \"despondency\",\n\t\t\t\t\"despondent\", \"despondently\", \"dingi\", \"dingy\", \"disconsol\", \"disconsolate\",\n\t\t\t\t\"disconsolateness\", \"discourag\", \"discouraged\", \"dishearten\", \"disheartened\",\n\t\t\t\t\"disheartening\", \"dismal\", \"dismay\", \"dispirit\", \"dispirited\",\n\t\t\t\t\"dispiritedness\", \"dispiriting\", \"distress\", \"distressed\", \"dole\", \"doleful\",\n\t\t\t\t\"dolefully\", \"dolefulness\", \"dolor\", \"dolorous\", \"dolour\", \"dolourous\",\n\t\t\t\t\"down\", \"downcast\", \"downheart\", \"downhearted\", \"downheartedness\",\n\t\t\t\t\"downtrodden\", \"drab\", \"drear\", \"dreari\", \"dreary\", \"dysphor\", \"dysphoria\",\n\t\t\t\t\"dysphoric\", \"execr\", \"execrable\", \"forlorn\", \"forlornly\", \"forlornness\",\n\t\t\t\t\"get_down\", \"gloom\", \"gloomful\", \"gloomi\", \"gloomili\", \"gloomily\",\n\t\t\t\t\"gloominess\", \"glooming\", \"gloomy\", \"glum\", \"godforsaken\", \"grief\", \"grief-\n\t\t\t\tstricken\", \"griev\", \"grieve\", \"grieving\", \"grievous\", \"grievously\", \"grim\",\n\t\t\t\t\"guilt\", \"guilt_feel\", \"guilt_feelings\", \"guilt_trip\", \"guilti\", \"guilty\",\n\t\t\t\t\"guilty_consci\", \"guilty_conscience\", \"hangdog\", \"hapless\", \"harass\",\n\t\t\t\t\"heartach\", \"heartache\", \"heartbreak\", \"heartbreaking\", \"heartrend\",\n\t\t\t\t\"heartrending\", \"heartsick\", \"heartsickness\", \"heavyheart\", \"heavyhearted\",\n\t\t\t\t\"heavyheartedness\", \"helpless\", \"helplessness\", \"joyless\", \"joylessly\",\n\t\t\t\t\"joylessness\", \"lachrymos\", \"lachrymose\", \"laden\", \"lament\", \"lamentably\",\n\t\t\t\t\"loneli\", \"loneliness\", \"long-fac\", \"long-faced\", \"lorn\", \"low\", \"low-spirit\",\n\t\t\t\t\"low-spirited\", \"low-spiritedness\", \"melanchol\", \"melancholi\", \"melancholic\",\n\t\t\t\t\"melancholy\", \"miser\", \"miserable\", \"miserably\", \"miseri\", \"misery\",\n\t\t\t\t\"misfortun\", \"misfortunate\", \"mourn\", \"mournful\", \"mournfully\",\n\t\t\t\t\"mournfulness\", \"mourning\", \"oppress\", \"oppressed\", \"oppression\",\n\t\t\t\t\"oppressive\", \"oppressively\", \"oppressiveness\", \"pathet\", \"pathetic\",\n\t\t\t\t\"penanc\", \"penance\", \"penit\", \"penitence\", \"penitent\", \"penitenti\",\n\t\t\t\t\"penitentially\", \"penitently\", \"persecut\", \"persecute\", \"persecuted\",\n\t\t\t\t\"piteous\", \"piti\", \"pitiabl\", \"pitiable\", \"pitiful\", \"pitying\", \"plaintiv\",\n\t\t\t\t\"plaintive\", \"plaintively\", \"plaintiveness\", \"poor\", \"regret\", \"regretful\",\n\t\t\t\t\"remors\", \"remorse\", \"remorseful\", \"remorsefully\", \"repent\", \"repentance\",\n\t\t\t\t\"repentant\", \"repentantly\", \"rue\", \"rueful\", \"ruefulli\", \"ruefully\",\n\t\t\t\t\"ruefulness\", \"ruth\", \"ruthfulness\", \"sad\", \"sadden\", \"saddening\", \"sadly\",\n\t\t\t\t\"sadness\", \"self-piti\", \"self-pity\", \"self-reproach\", \"shame\", \"shamed\",\n\t\t\t\t\"shamefac\", \"shamefaced\", \"somber\", \"somberness\", \"sorri\", \"sorrow\",\n\t\t\t\t\"sorrowful\", \"sorrowfully\", \"sorrowfulness\", \"sorrowing\", \"sorry\",\n\t\t\t\t\"sorry_for\", \"suffer\", \"suffering\", \"tear\", \"tearful\", \"tearfulness\",\n\t\t\t\t\"tyrann\", \"tyrannical\", \"tyrannous\", \"uncheer\", \"uncheerful\",\n\t\t\t\t\"uncheerfulness\", \"unhappi\", \"unhappiness\", \"unhappy\", \"weep\", \"weepi\",\n\t\t\t\t\"weepiness\", \"weeping\", \"weight\", \"Weltschmerz\", \"woe\", \"woebegon\",\n\t\t\t\t\"woebegone\", \"woeful\", \"woefulli\", \"woefully\", \"woefulness\", \"world-weari\",\n\t\t\t\t\"world-weariness\", \"world-weary\", \"wretch\", \"wretched\"]}\n\t\tend",
"title": ""
},
{
"docid": "db3bd8d93576e6715b11fde910dd8856",
"score": "0.60224056",
"text": "def italic\n return @italic\n end",
"title": ""
},
{
"docid": "d56bda6b5d7cb1c193a043eb31f458d6",
"score": "0.60207534",
"text": "def negative_emoticon?\n self =~ NEGATIVE_EMOTICONS\n end",
"title": ""
},
{
"docid": "6c9dec91e7a4b0ec9a60f9adb387df25",
"score": "0.59991306",
"text": "def test_emotions\n assert(Review::POSSIBLE_SENTIMENTS.include?(@@review.contentEmotion),\n\t \"Sentimental isn't returning an expected emotion\" )\n end",
"title": ""
},
{
"docid": "9c984b7d79932839275da1fbd98bcc9e",
"score": "0.5985062",
"text": "def convert_em(el)\r\n save\r\n el.children.each do |inner_el|\r\n @results << inner_el.value\r\n end\r\n t = results.size > 1 ? @results.join : @results[0]\r\n @results << %[para \"#{t}\", :emphasis => \"italic\"]\r\n restore \r\n return nil\r\n end",
"title": ""
},
{
"docid": "cc8781209fb5c3547fdb757e453d6068",
"score": "0.59079915",
"text": "def em\n \"#{self}em\"\n end",
"title": ""
},
{
"docid": "57c3452fb9d08875e6fb0f2b988644e4",
"score": "0.5904478",
"text": "def em\n self.to_s+\"em\"\n end",
"title": ""
},
{
"docid": "57c3452fb9d08875e6fb0f2b988644e4",
"score": "0.5904478",
"text": "def em\n self.to_s+\"em\"\n end",
"title": ""
},
{
"docid": "918123a223e517e9f73db9dbfa440623",
"score": "0.5896773",
"text": "def positive_emoticon?\n self =~ POSITIVE_EMOTICONS\n end",
"title": ""
},
{
"docid": "459057ae102d3d9a225d4377fbe4d268",
"score": "0.5894211",
"text": "def required_emotion\n # Ignore game_type for now\n case game_state\n when 1\n return \"anger\"\n when 2\n return \"contempt\"\n when 3\n return \"disgust\"\n when 4\n return \"fear\"\n when 5\n return \"happiness\"\n when 6\n return \"neutral\"\n when 7\n return \"sadness\"\n when 8\n return \"surprise\"\n end\n end",
"title": ""
},
{
"docid": "7781be89c380491f3a5f7fe47665244f",
"score": "0.588602",
"text": "def headlineEmotion\n return @@analyzer.sentiment(@headline)\n end",
"title": ""
},
{
"docid": "4dff308c0a85370aa0c7cc655291be49",
"score": "0.5874988",
"text": "def top_feeling\n self.mood[\"emotion\"]\n end",
"title": ""
},
{
"docid": "fc6671a66618c8be1fc11be0ad3365e1",
"score": "0.5867381",
"text": "def italic\n @info[:italic]\n end",
"title": ""
},
{
"docid": "f41c6172a311b9247ef111ca1780eebc",
"score": "0.58605915",
"text": "def text_sentiment\n count = positive_emoticons.count - negative_emoticons.count\n if count > 0\n \"positive\"\n elsif count < 0\n \"negative\"\n else\n \"neutral\"\n end\n end",
"title": ""
},
{
"docid": "284d256147e86e9c239e0751502fd734",
"score": "0.5817124",
"text": "def mentioning_text\n self.body\n end",
"title": ""
},
{
"docid": "43ece825474005c0bdbbcdad3491f8d2",
"score": "0.5757151",
"text": "def editorial_markup\r\n\t\r\n\tend",
"title": ""
},
{
"docid": "da34e1f8dd0ebf8b660d2c6a8188dc7e",
"score": "0.5756272",
"text": "def emphasis\n paragraph = Faker::Lorem.paragraph(sentence_count: 3)\n words = paragraph.split\n position = rand(0..words.length - 1)\n formatting = fetch('markdown.emphasis')\n words[position] = \"#{formatting}#{words[position]}#{formatting}\"\n words.join(' ')\n end",
"title": ""
},
{
"docid": "fd2fa4ca5a6f36e56176aa5754265e76",
"score": "0.5748436",
"text": "def preview_text\n text = \"\"\n begin\n my_contents = my_description[\"contents\"]\n unless my_contents.blank?\n content_flagged_as_preview = my_contents.select{ |a| a[\"take_me_for_preview\"] }.first\n if content_flagged_as_preview.blank?\n content_to_take_as_preview = my_contents.first\n else\n content_to_take_as_preview = content_flagged_as_preview\n end\n preview_content = self.contents.select{ |content| content.name == content_to_take_as_preview[\"name\"] }.first\n unless preview_content.blank?\n if preview_content.essence_type == \"EssenceRichtext\"\n text = preview_content.essence.stripped_body.to_s\n elsif preview_content.essence_type == \"EssenceText\"\n text = preview_content.essence.body.to_s\n elsif preview_content.essence_type == \"EssencePicture\"\n text = (preview_content.essence.picture.name rescue \"\")\n elsif preview_content.essence_type == \"EssenceFile\" || preview_content.essence_type == \"EssenceFlash\" || preview_content.essence_type == \"EssenceFlashvideo\"\n text = (preview_content.essence.file.name rescue \"\")\n else\n text = \"\"\n end\n else\n text = \"\"\n end\n end\n rescue\n logger.error(\"#{$!}\\n#{$@.join('\\n')}\")\n text = \"\"\n end\n text.size > 30 ? text = (text[0..30] + \"...\") : text\n text\n end",
"title": ""
},
{
"docid": "d0169009be83947eec480d8e14a283b9",
"score": "0.57274216",
"text": "def positive_emoticons\n self.scan(POSITIVE_EMOTICONS).flatten\n end",
"title": ""
},
{
"docid": "5aff15c9ebf3bf2ebe22f584526b8da5",
"score": "0.57157606",
"text": "def teaser\n (Hpricot(self.description)/'p').first.inner_html\n rescue\n ''\n end",
"title": ""
},
{
"docid": "a22cc19de5f8a68f38e5c6fb12b40e26",
"score": "0.5705204",
"text": "def emb_description\n iex_emblem_cache unless @emb_cache_complete\n return @emb_description\n end",
"title": ""
},
{
"docid": "ca80c188c8919d49ae29d344c589b9ce",
"score": "0.57047987",
"text": "def content\n @text.text\n end",
"title": ""
},
{
"docid": "d895e2d73f95cde1fbab5c571a180c8c",
"score": "0.56857747",
"text": "def content\n # estraggo le frasi e verifico che esistano\n phrases = self.phrases.order('paragraph_position ASC')\n return '' if !phrases\n # genero il risultato\n content = ''\n phrases.each do |phrase|\n content = \"#{content}#{phrase.print} \"\n content content.gsub(/\\ +$/, '') if phrase === phrases.last\n end\n # ritorno il risultato\n return content\n end",
"title": ""
},
{
"docid": "cce9e29549d97fbe7c55d220e7a5607a",
"score": "0.5663695",
"text": "def content\n RDiscount.new(h.convert_mention(h.sanitize object.content)).to_html.html_safe\n end",
"title": ""
},
{
"docid": "cdd6e725e7494baf584da108f1babb54",
"score": "0.56475997",
"text": "def vs\n \"<small><em>vs</em></small>\"\nend",
"title": ""
},
{
"docid": "617772190c24aa4a5180efd84eb79ba7",
"score": "0.56459635",
"text": "def smilies\n @text.gsub!(/(?<![a-z])([:;])-?([\\)\\(DPOo\\*\\|\\\\\\/])(?!\\w)/) do |match|\n emoji = case ($1 + $2)\n when \":)\"\n Emoji.find_by_alias(\"smile\")\n when \":(\"\n Emoji.find_by_alias(\"frowning\")\n when \":P\"\n Emoji.find_by_alias(\"stuck_out_tongue\")\n when \":D\"\n Emoji.find_by_alias(\"grinning\")\n when \":*\"\n Emoji.find_by_alias(\"kissing\")\n when \":|\"\n Emoji.find_by_alias(\"expressionless\")\n when \":\\\\\", ':/'\n Emoji.find_by_alias(\"confused\")\n when ';)', ';D'\n Emoji.find_by_alias(\"wink\")\n when \":O\", \":o\"\n Emoji.find_by_alias(\"open_mouth\")\n end\n if emoji\n %Q{<img alt=\"#{match}\" src=\"/images/emoji/#{emoji.image_filename}\" style=\"vertical-align:middle\" wdith=\"20\" height=\"20\" />}\n else\n match\n end\n end\n end",
"title": ""
},
{
"docid": "3689f6ee365c287a5daa27af9591d2cc",
"score": "0.56287646",
"text": "def number_of_emoticons\n positive_count + negative_count\n end",
"title": ""
},
{
"docid": "8ad23d3c5e40a5258086ea1f0b6328da",
"score": "0.56258047",
"text": "def emmet_string\n @emmet_string\n end",
"title": ""
},
{
"docid": "3c6e4cd2252cc5fbcad785039c570c6c",
"score": "0.5618474",
"text": "def human_readable(content); selected_answer_text(content); end",
"title": ""
},
{
"docid": "e044f2ec3dbed74788f3d45e1a27c560",
"score": "0.5618322",
"text": "def get_english_meaning(input)\nemoticons = load_library\nemoticons.each do |emote|\n if input == emote[1]\n return emote.keys.to_s\n end\nend",
"title": ""
},
{
"docid": "8411e2ad121b14f43217d92c3c3b1d1a",
"score": "0.5614231",
"text": "def entity content\r\n # Don't care\r\n end",
"title": ""
},
{
"docid": "a2baf9ff02c4df9fc0f0973f86ef547e",
"score": "0.56079555",
"text": "def emojify(content)\n content.to_str.gsub(/:([a-z0-9\\+\\-_]+):/) do |match|\n RailsEmoji.render match, size: '20x20'\n end\n end",
"title": ""
},
{
"docid": "a74a85fdaab31616b892dfc07aecd349",
"score": "0.5578255",
"text": "def em\n self == 0 ? \"0\" : \"#{self}em\"\n end",
"title": ""
},
{
"docid": "080a71e615171f1d4317ea23bf27f005",
"score": "0.55780774",
"text": "def convert_em(el, opts)\n # TODO: add mechanism to verify that we have processed all classes\n before = ''\n after = ''\n inner_text = nil\n case\n when [nil, ''].include?(el.attr['class'])\n # em without class => convert to \\emph{}\n before << '\\\\emph{'\n after << '}'\n else\n if el.has_class?('italic')\n # em with classes, including .italic => convert to \\emph{}. Other\n # places in this method will add environments for the additional\n # classes.\n # We use latex's \\emph command so that it toggles between regular\n # and italic, depending on context. This way italic will be rendered\n # as regular in an italic context (e.g., .scr)\n before << '\\\\emph{'\n after << '}'\n end\n if el.has_class?('smcaps')\n inner_text = self.class.emulate_small_caps(inner(el, opts))\n end\n if el.has_class?('pn')\n # render as paragraph number\n before << '\\\\RtParagraphNumber{'\n after << '}'\n end\n end\n \"#{ before }#{ inner_text || inner(el, opts) }#{ after }\"\n end",
"title": ""
},
{
"docid": "ac2dfd33583c64a8b958341182ea5e83",
"score": "0.5551761",
"text": "def e_s_texts\n find_eles :text\n end",
"title": ""
},
{
"docid": "ac2dfd33583c64a8b958341182ea5e83",
"score": "0.5551761",
"text": "def e_s_texts\n find_eles :text\n end",
"title": ""
},
{
"docid": "ddc7918a4155ff9309f278425351e2fd",
"score": "0.5548455",
"text": "def mention_text\n return @mention_text\n end",
"title": ""
},
{
"docid": "d07026c4e6eb94dbe64356bb30b9336b",
"score": "0.553735",
"text": "def active_voice_subjunctive_mood_imperfect_tense\n TenseBlock.new(\n ['m', AP_FIRST_AND_SECOND_CONJUG_PERS_ENDINGS].flatten!.map do |ending|\n @pres_act_inf.sub(/e$/,'ē') + ending\n end,\n { :meaning => Linguistics::Latin::Verb::LatinVerb::MEANINGS[:active_voice_subjunctive_mood_imperfect_tense] }\n )\n end",
"title": ""
},
{
"docid": "47e7047b511bcbb3cd128522cc611753",
"score": "0.5529092",
"text": "def show_basic_information_from_motion(mottion)\n \n end",
"title": ""
},
{
"docid": "2cc987fde6beff33e3c532977825a208",
"score": "0.55254716",
"text": "def get_sentence(html)\n css_text(html, '.eg')\n end",
"title": ""
},
{
"docid": "8e1b893d92101180058fd3e27e2afb09",
"score": "0.55142814",
"text": "def content_to_html\n if self.markup == 'markdown'\n RDiscount.new(self.content, :autolink).to_html\n elsif self.markup == 'textile'\n RedCloth.new(self.content).to_html\n else\n self.content\n end\n end",
"title": ""
},
{
"docid": "ee53fbc25636e70e4c94ff49cc010796",
"score": "0.5508463",
"text": "def emoface\n if params[:screen_name].present?\n tweets_count = 200\n \n @tweets = get_user_tweets(params[:screen_name])\n @profile_image = @tweets[0][\"user\"][\"profile_image_url\"]#.to_str.gsub(\"_normal\",\"\")\n emotions = tweets_to_emotions(@tweets)\n\n emotions_ratio = emotions_sum(emotions)\n \n @text = emotions_ratio\n gon.face = emotions_ratio.clone\n @face_feature = face_scale(emotions_ratio.clone)\n gon.disgust = @face_feature[\"disgust\"]\n @face_feature_1 = face_scale_1(emotions_ratio.clone)\n \n else\n @tweets = [{:id=>1, :text=>\"dummy\", :created_at=>123}]\n @text = \"Please search\"\n end\n \n end",
"title": ""
},
{
"docid": "aa2ed1451f03391624df69bf7caf4afb",
"score": "0.5506574",
"text": "def mentioning_text\n self.text\n end",
"title": ""
},
{
"docid": "7124d1effe0f73c61e4a9e26430f0597",
"score": "0.5480544",
"text": "def textile_attention(tag, attrs, cite, content)\n %(<p class=\"attention\">#{content}</p>)\n end",
"title": ""
},
{
"docid": "32642abbef7f32995b7f347d67d4d893",
"score": "0.545929",
"text": "def celebration\n fetch('slack_emoji.celebration')\n end",
"title": ""
},
{
"docid": "b84ec262c5fba0b98476aaf740aa04fe",
"score": "0.545136",
"text": "def description\n content.content\n end",
"title": ""
},
{
"docid": "614454e7e7388703691c820854247e3c",
"score": "0.54463834",
"text": "def content_for_intro\n self.synopsis\n end",
"title": ""
},
{
"docid": "3ee77921138de774996055791be4d791",
"score": "0.5439893",
"text": "def score_emoticon_polarity\n happy = happy_emoticon?(words)\n sad = sad_emoticon?(words)\n\n polarities << 5.0 if happy && sad\n polarities << 8.0 if happy\n polarities << 2.0 if sad\n end",
"title": ""
},
{
"docid": "7a1817ea90879cc27be212b13f473587",
"score": "0.5437794",
"text": "def show\n @message_emotion = MessageEmotion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @message_emotion }\n end\n end",
"title": ""
},
{
"docid": "b650922ce9431efe6ab60d6ebb9587db",
"score": "0.5421367",
"text": "def index\n @emotions = Emotion.all\n end",
"title": ""
},
{
"docid": "133a2cd8dba1cc4baa0206fa8f4652a3",
"score": "0.54209316",
"text": "def get_meaning(html)\n css_text(html, '.def')\n end",
"title": ""
},
{
"docid": "aee04455d0792fea285eb4d8aaf9f2c7",
"score": "0.54120266",
"text": "def emoji\n @text.gsub!(/:([\\w+-]+):/) do |match|\n if emoji = Emoji.find_by_alias($1.downcase)\n %Q{<img alt=\"#$1\" src=\"/images/emoji/#{emoji.image_filename}\" style=\"vertical-align:middle\" width=\"20\" height=\"20\" />}\n else\n match\n end\n end\n end",
"title": ""
},
{
"docid": "74cdca90811188e54f6d2d7ff6272f38",
"score": "0.5402869",
"text": "def mentioning_text\n self.text\n end",
"title": ""
},
{
"docid": "b67af9dff7d536b41199588db84f6150",
"score": "0.53995866",
"text": "def italic\n wrap_with_code(TERM_EFFECTS[:italic])\n end",
"title": ""
},
{
"docid": "85feae9c535f3b942de1bd821ac36708",
"score": "0.53973734",
"text": "def emphasis\n \"<em>#{Faker::Lorem.paragraph(sentence_count: 1)}</em>\"\n end",
"title": ""
},
{
"docid": "12ac700ea1cb203a7b2c26dc29e2d774",
"score": "0.539427",
"text": "def emphasis(str)\n out = str.gsub /<em>(.*?)<\\/em>/, \"\\033\\[1m\\\\1\\033\\[0m\"\nend",
"title": ""
},
{
"docid": "e3daff72c3894c39b58083b1800b57f2",
"score": "0.53872263",
"text": "def paragraph(text)\n if text.start_with? \"<\"\n return text\n end\n\n match = text.match /^!([^ ]+)\\s(.*)/\n text = match[2] if match\n text = text.split(' ').map{|word| @hyphenator.visualize(word, \"­\")}.join(' ')\n if match\n \"<div class='inset #{match[1]}'><img src='#{@style.image_for(match[1])}' /><p>#{text}</p></div>\\n\\n\"\n else\n \"<p>#{text}</p>\\n\\n\"\n end\n end",
"title": ""
},
{
"docid": "9c2ab719443ccfb73b238bf6901d32ed",
"score": "0.5372761",
"text": "def embedding_tweet(content)\n embedded_content = content\n content.scan(/(!\\[(.+)\\]\\((.+)\\))/).each do |image_mark, alt, url|\n \tembedded_content = embedded_content.gsub(/#{Regexp.quote(image_mark)}/, \"{::nomarkdown}</p></div><div class='image-holder'><img src='#{url}' alt='#{alt}' /><div class='image-caption'><span class='ico-photo'></span><span>#{alt}</span></div></div><div class='text-part'><p>{:/nomarkdown}\")\n end\n embedded_content\nend",
"title": ""
},
{
"docid": "4862e422f299647ff84bf495f8596f00",
"score": "0.5363249",
"text": "def positive_count\n positive_emoticons.count\n end",
"title": ""
},
{
"docid": "1909f4914ebebc19c3ae8e7c883c877b",
"score": "0.53564954",
"text": "def html\n if self.textile\n RedCloth.new(self.content).to_html if self[:content]\n elsif self.markdown\n BlueCloth.new(self.content).to_html if self[:content]\n else\n self.content\n end\n end",
"title": ""
},
{
"docid": "1c08d37583bc3a09ec487c67b0603bca",
"score": "0.53556514",
"text": "def emi_summary\n end",
"title": ""
},
{
"docid": "b393b7e0e2062b9230d645e5876c4487",
"score": "0.53477955",
"text": "def negative_emoticons\n self.scan(NEGATIVE_EMOTICONS).flatten\n end",
"title": ""
},
{
"docid": "6d11b885e33f395be07aba258abfe025",
"score": "0.5338917",
"text": "def emphasis(text)\n \"<i>#{text}</i>\"\n end",
"title": ""
},
{
"docid": "6bc54142188cd3b3ae06e28c9c1ce95f",
"score": "0.53218335",
"text": "def emisiones\n \"Las emisiones son de: #{@gasEfectoInv} kgCO^2eq\"\n end",
"title": ""
},
{
"docid": "1533146e93e98bb794b5881c17998d74",
"score": "0.5320279",
"text": "def emphasis(text)\n \"<em>#{do_not_break_string(text)}</em>\"\n end",
"title": ""
},
{
"docid": "049a6c2ff8f679eb5fe1355b7ac90877",
"score": "0.5320029",
"text": "def text\n article_text.text\n end",
"title": ""
},
{
"docid": "8447274c587aa6b9b05e0b67ecd4e543",
"score": "0.5315376",
"text": "def content\n Founden::Application.config.markdown.render(object.content)\n end",
"title": ""
},
{
"docid": "152e6b31ef203cbe4b9e25d93bb243f1",
"score": "0.53152496",
"text": "def set_emotion\n @emotion = Emotion.find(params[:id])\n end",
"title": ""
},
{
"docid": "84ac1b1c9a2ced10c9c3b792252a36ec",
"score": "0.5313221",
"text": "def perception\n \"#{adverb} perceived the extent of the situation\"\n end",
"title": ""
},
{
"docid": "4f4bf641acb61b0abb894d74dba9e1f4",
"score": "0.5309935",
"text": "def negative_count\n negative_emoticons.count\n end",
"title": ""
},
{
"docid": "188beafb72921fe5f9f66671a451dcf6",
"score": "0.53054357",
"text": "def content_rendered\n #markdown(content).html_safe\n end",
"title": ""
},
{
"docid": "5c4074ecad328d7c53984f717d2bd5f1",
"score": "0.5305011",
"text": "def contents\n @contents ||= markdown(body)\n end",
"title": ""
},
{
"docid": "2bb6a9d4263a05e32d206d2c7b549200",
"score": "0.5301309",
"text": "def content_for_intro\n body\n #p_num = ([body.paragraphs.size, 3].min-1)\n #body.paragraphs[0..p_num].join(\"\\n\")\n end",
"title": ""
},
{
"docid": "39cd934a5d41c5351fdea242d06fea03",
"score": "0.53010595",
"text": "def set_emotion\n @emotion = Emotion.find(params[:id])\n end",
"title": ""
},
{
"docid": "6508ed912464d07a495b6e2983013ad1",
"score": "0.5299054",
"text": "def summary\n text = self.content[0,400]\nend",
"title": ""
},
{
"docid": "f24998b325b38f17664e8fbe797f969c",
"score": "0.52962637",
"text": "def motd_text\n @attributes[:motd_text]\n end",
"title": ""
},
{
"docid": "b2fa18bb5895b8966a643f98de3106bd",
"score": "0.5282655",
"text": "def draw_actor_exp(actor, x, y)\n self.contents.font.color = system_color\n self.contents.draw_text(x, y, 24, 32, \"E\")\n self.contents.font.color = normal_color\n self.contents.draw_text(x + 24, y, 84, 32, actor.exp_s, 2)\n self.contents.draw_text(x + 108, y, 12, 32, \"/\", 1)\n self.contents.draw_text(x + 120, y, 84, 32, actor.next_exp_s)\n end",
"title": ""
},
{
"docid": "b2fa18bb5895b8966a643f98de3106bd",
"score": "0.5282655",
"text": "def draw_actor_exp(actor, x, y)\n self.contents.font.color = system_color\n self.contents.draw_text(x, y, 24, 32, \"E\")\n self.contents.font.color = normal_color\n self.contents.draw_text(x + 24, y, 84, 32, actor.exp_s, 2)\n self.contents.draw_text(x + 108, y, 12, 32, \"/\", 1)\n self.contents.draw_text(x + 120, y, 84, 32, actor.next_exp_s)\n end",
"title": ""
},
{
"docid": "b2fa18bb5895b8966a643f98de3106bd",
"score": "0.5282655",
"text": "def draw_actor_exp(actor, x, y)\n self.contents.font.color = system_color\n self.contents.draw_text(x, y, 24, 32, \"E\")\n self.contents.font.color = normal_color\n self.contents.draw_text(x + 24, y, 84, 32, actor.exp_s, 2)\n self.contents.draw_text(x + 108, y, 12, 32, \"/\", 1)\n self.contents.draw_text(x + 120, y, 84, 32, actor.next_exp_s)\n end",
"title": ""
},
{
"docid": "5f1f7e2c67dc5308db332cea5cfeceed",
"score": "0.5282318",
"text": "def exiwhat_text\n runcmd(@exiwhat)\n end",
"title": ""
},
{
"docid": "dfeb4b3f4dc35154fd04732b853486d1",
"score": "0.5280261",
"text": "def text_caution(text); text_yellow(text);end",
"title": ""
},
{
"docid": "c4fbd27f8fd323d72f2ce6a4c37c94c5",
"score": "0.52758723",
"text": "def content_for_intro\n (self.t(I18n.locale,:body)||self.body).paragraphs[0]\n end",
"title": ""
},
{
"docid": "882787f49900bf29c887ca96ba4f07d4",
"score": "0.5273757",
"text": "def test_that_it_extracts_emphasis\n extraction = extract('Something *cool* is awesome')\n expected = {\n display_text: 'Something cool is awesome',\n display_html: 'Something <em>cool</em> is awesome',\n entities: [\n {\n type: 'emphasis',\n text: '*cool*',\n display_text: 'cool',\n indices: [10, 16],\n display_indices: [10, 14]\n }\n ]\n }\n assert_equal expected, extraction\n\n extraction = extract('Something _cool_ is awesome')\n expected = {\n display_text: 'Something cool is awesome',\n display_html: 'Something <em>cool</em> is awesome',\n entities: [\n {\n type: 'emphasis',\n text: '_cool_',\n display_text: 'cool',\n indices: [10, 16],\n display_indices: [10, 14]\n }\n ]\n }\n assert_equal expected, extraction\n end",
"title": ""
},
{
"docid": "2325c1862fed91db983c5866a804f74d",
"score": "0.5270177",
"text": "def processed_content\n self.letters.downcase\n end",
"title": ""
},
{
"docid": "a54e14974569447e546a91183eeae32a",
"score": "0.5268881",
"text": "def italic?\n self[:italic]\n end",
"title": ""
},
{
"docid": "a2603a6383f69f705b8e226b7565945f",
"score": "0.52677566",
"text": "def text\n @meme[:text]\n end",
"title": ""
},
{
"docid": "7b245e2ff9896125e028cb482f9b08de",
"score": "0.52667695",
"text": "def text\n textContent\n end",
"title": ""
},
{
"docid": "1a3483950552dd2aa345ee80d98bfff7",
"score": "0.5266199",
"text": "def chylify_mage(enjeopard)\n end",
"title": ""
},
{
"docid": "4270febc1dae59ca96baf28df0d44c4f",
"score": "0.5264446",
"text": "def content\n return @original unless matter?\n\n finish == size ? '' : @original[after..].sub(/^#{NEWLINE}/, '')\n end",
"title": ""
},
{
"docid": "5af3c4189c7cc8c01d29fc3ac17f9397",
"score": "0.52626914",
"text": "def contention_text\n return UNIDENTIFIED_ISSUE_MSG if is_unidentified? && !verified_unidentified_issue\n\n Contention.new(description).text\n end",
"title": ""
},
{
"docid": "d0c97e73ac4584483412c027207be86b",
"score": "0.5261144",
"text": "def sad_emoticon?(words)\n (sad_emojies & words).any?\n end",
"title": ""
}
] |
639592916b960bbf837186b6c2981212
|
Returns the length of the buffer's content. source://netssh//lib/net/ssh/buffer.rb79
|
[
{
"docid": "875731db3df0cec71bd80b2ca1110bd3",
"score": "0.0",
"text": "def length; end",
"title": ""
}
] |
[
{
"docid": "91c228715d6637c53100ce8ffcc0a366",
"score": "0.7574948",
"text": "def buffer_size\n @buffer.size\n end",
"title": ""
},
{
"docid": "c636c7da5f12531c3a69e7f7fe98a0ab",
"score": "0.75463533",
"text": "def size\n @buffer.size\n end",
"title": ""
},
{
"docid": "c636c7da5f12531c3a69e7f7fe98a0ab",
"score": "0.75463533",
"text": "def size\n @buffer.size\n end",
"title": ""
},
{
"docid": "c636c7da5f12531c3a69e7f7fe98a0ab",
"score": "0.75463533",
"text": "def size\n @buffer.size\n end",
"title": ""
},
{
"docid": "e2c40e9a669cc4ed334942e67c72d309",
"score": "0.75106674",
"text": "def size\n return @buffer.count\n end",
"title": ""
},
{
"docid": "dc1d3330ca341534249ca342de93614c",
"score": "0.7342125",
"text": "def size\n @size ||= @buffer.size\n end",
"title": ""
},
{
"docid": "4b4071c17d072c0edea72722b614beae",
"score": "0.68881494",
"text": "def content_length\n if raw? && raw.respond_to?(:length)\n raw.length\n else\n read.try(&:length).to_i\n end\n end",
"title": ""
},
{
"docid": "17cce45bcb492119285188bf150b6af2",
"score": "0.6845008",
"text": "def buffered\n @buffer.length\n end",
"title": ""
},
{
"docid": "17cce45bcb492119285188bf150b6af2",
"score": "0.6845008",
"text": "def buffered\n @buffer.length\n end",
"title": ""
},
{
"docid": "afb80c2603bca8d855a4bf3603926db7",
"score": "0.6715666",
"text": "def length\n @content.length\n end",
"title": ""
},
{
"docid": "49fa763e3633c41da2512fdb6c2b301f",
"score": "0.6710697",
"text": "def size\n read.bytesize\n end",
"title": ""
},
{
"docid": "8734aae1754f887ab9a8c4a441ca8a79",
"score": "0.66926354",
"text": "def size\n @content.bytesize\n end",
"title": ""
},
{
"docid": "42d33ae19ee1dcda42d316c797e4c8fa",
"score": "0.66922873",
"text": "def size\n @contents.bytes.size\n end",
"title": ""
},
{
"docid": "7960853f188933a0e5046eb36c3e0cdc",
"score": "0.66302186",
"text": "def content_length\n stat.size\n end",
"title": ""
},
{
"docid": "931fa7ec8e80fec7b050b98af07e2447",
"score": "0.65562123",
"text": "def length\n pack.length\n end",
"title": ""
},
{
"docid": "ccbc5167ab5a59b7cc7174274ee7a8db",
"score": "0.65405273",
"text": "def content_length\n# stat.size\n @bson['length'] || 0\n end",
"title": ""
},
{
"docid": "7ea610c8b771726e1309c06f32bba8ed",
"score": "0.6511863",
"text": "def size\n @io.size\n end",
"title": ""
},
{
"docid": "b4f3506910892d151a2779abd474799f",
"score": "0.64893425",
"text": "def length\n do_num_bytes\n end",
"title": ""
},
{
"docid": "99564b0764d6b54e56ef03bd452f3ca6",
"score": "0.6486278",
"text": "def size; @_io.size; end",
"title": ""
},
{
"docid": "a9370f151fe795dba446b33f205ed5ea",
"score": "0.64643836",
"text": "def length\n do_num_bytes\n end",
"title": ""
},
{
"docid": "a9370f151fe795dba446b33f205ed5ea",
"score": "0.64643836",
"text": "def length\n do_num_bytes\n end",
"title": ""
},
{
"docid": "c8eb67c0ae5239bb85d724c766aa5faf",
"score": "0.644195",
"text": "def size\n @data.bytesize\n end",
"title": ""
},
{
"docid": "a45441823bcb4dfb050b54369d240cc4",
"score": "0.6438631",
"text": "def num_bytes\n return @num_bytes\n end",
"title": ""
},
{
"docid": "52e7401ac864e048e3ea604d773f7b13",
"score": "0.64239544",
"text": "def size\n @heads['content-length'] || @size.to_s\n end",
"title": ""
},
{
"docid": "fe6923b6842884a44c2dc0c1d62c71a1",
"score": "0.64189947",
"text": "def data_len_bytes()\n 2\n end",
"title": ""
},
{
"docid": "fe6923b6842884a44c2dc0c1d62c71a1",
"score": "0.641839",
"text": "def data_len_bytes()\n 2\n end",
"title": ""
},
{
"docid": "fe6923b6842884a44c2dc0c1d62c71a1",
"score": "0.641839",
"text": "def data_len_bytes()\n 2\n end",
"title": ""
},
{
"docid": "5b1079fe066ecf6002094e286c1b7793",
"score": "0.64123964",
"text": "def length\n sync\n io.length\n end",
"title": ""
},
{
"docid": "a71cbc9246b5b8c2d306e83ca65bb782",
"score": "0.6404288",
"text": "def size(path)\n response = with_remote do |http|\n http.head(path)\n end\n response['Content-Length'].to_i\n end",
"title": ""
},
{
"docid": "819b987b8d64b2fd2fea3849c42cd530",
"score": "0.63957554",
"text": "def length\n contents.length\n end",
"title": ""
},
{
"docid": "baa2729b7c0de8ba945e7c80d955ecdc",
"score": "0.6378199",
"text": "def size\n headers[\"content-length\"].to_i\n end",
"title": ""
},
{
"docid": "c45fa06dd7bdb79d079e17220a02087a",
"score": "0.63766646",
"text": "def data_len_bytes()\n 1\n end",
"title": ""
},
{
"docid": "a95088cdd9dc5dc6d90e0766b8515e9f",
"score": "0.6351292",
"text": "def size\n content.size\n end",
"title": ""
},
{
"docid": "742f3fe81cc42645955d33f411d19405",
"score": "0.634697",
"text": "def write(buf)\n\t\t\twrite_remote(buf)\n\t\t\treturn buf.length\n\t\tend",
"title": ""
},
{
"docid": "fa26f95826ee63144965786092fb99c6",
"score": "0.63458496",
"text": "def byte_size(); @data.byte_size + 4; end",
"title": ""
},
{
"docid": "568389be927638192fa23bdfd64b8ac8",
"score": "0.63361967",
"text": "def size\n headers[:content_length].to_i\n end",
"title": ""
},
{
"docid": "47e50b4c9f6cbbd20091b1de21f0ef01",
"score": "0.6307121",
"text": "def content_size; @message_impl.getContentSize; end",
"title": ""
},
{
"docid": "65d32956d1eb4c5d94da153bbfbe4f40",
"score": "0.62864447",
"text": "def bytesize\n @fd.stat.size\n end",
"title": ""
},
{
"docid": "01974ce84c095f21d0365c278680e192",
"score": "0.6285427",
"text": "def bytesize\n stream_size\n end",
"title": ""
},
{
"docid": "dd64ee842abc259612f82ca5896580d5",
"score": "0.6270561",
"text": "def buffer\n @transfer[:buffer].read_string(@transfer[:length])\n end",
"title": ""
},
{
"docid": "a7bf2e886f7d4d777d4b9b4a7725eb7f",
"score": "0.62676346",
"text": "def len()\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n result = Native.Run_len(@handle.ptr)\n result\n end",
"title": ""
},
{
"docid": "c855623510b20f7b6d403588ec5b3130",
"score": "0.6266209",
"text": "def get_content_length\n\t\treturn 0 if self.bodiless?\n\n\t\tif self.body.pos.nonzero? && !self.body.eof?\n\t\t\tself.log.info \"Calculating content length based on an offset of %d\" % [ self.body.pos ]\n\t\t\treturn self.body.size - self.body.pos\n\t\telse\n\t\t\tself.log.debug \"Calculating body size via %p\" % [ self.body.method(:size) ]\n\t\t\treturn self.body.size\n\t\tend\n\tend",
"title": ""
},
{
"docid": "0060b2457d7c7aa187e430346a17d530",
"score": "0.6265732",
"text": "def size\n @data ? @data.size : header.sh_size\n end",
"title": ""
},
{
"docid": "4eeb82420c92591c729b98beef3a64f2",
"score": "0.6259612",
"text": "def length\n Integer(connection.write(\"get_length\", false))\n rescue ArgumentError\n 0\n end",
"title": ""
},
{
"docid": "4eeb82420c92591c729b98beef3a64f2",
"score": "0.6259612",
"text": "def length\n Integer(connection.write(\"get_length\", false))\n rescue ArgumentError\n 0\n end",
"title": ""
},
{
"docid": "4eeb82420c92591c729b98beef3a64f2",
"score": "0.6259612",
"text": "def length\n Integer(connection.write(\"get_length\", false))\n rescue ArgumentError\n 0\n end",
"title": ""
},
{
"docid": "103aac3b5edd89666c5fa75038ff86ab",
"score": "0.62578166",
"text": "def compressed_size\n # A number of these are commented out because we just don't care enough to read\n # that section of the header. If we do care, uncomment and check!\n proto = @data_buffer.read_int64(0)\n size = proto & 0xFFFFFFFFFFFF\n msg_type = (proto >> 48) & 0xFF\n\n return nil if msg_type != AS_MSG_TYPE_COMPRESSED\n\n size\n end",
"title": ""
},
{
"docid": "85735dac725374856193bf6ce9700224",
"score": "0.6247084",
"text": "def size\n if @push_ptr\n if @pop_ptr\n value_ = @push_ptr - @pop_ptr\n value_ > 0 ? value_ : value_ + @buffer.size\n else\n 0\n end\n else\n @buffer.size\n end\n end",
"title": ""
},
{
"docid": "7cc2e005286e2c8c7a0f54d220e5cb5b",
"score": "0.62411034",
"text": "def extract_size(io)\n io.size\n end",
"title": ""
},
{
"docid": "32b05482eb03ba18750bcbe09d9f80b8",
"score": "0.622244",
"text": "def length\n length = 0\n each{|s| length += s.bytesize}\n length\n end",
"title": ""
},
{
"docid": "b6178bf141645d69ddddef7ff965a681",
"score": "0.6211383",
"text": "def size\r\n @pack.size\r\n end",
"title": ""
},
{
"docid": "e29cea8d9beb41bc982f8955251827c2",
"score": "0.6189463",
"text": "def length\n @line.length\n end",
"title": ""
},
{
"docid": "8e5eded3fec6fc36a1fefbbf4615baab",
"score": "0.61850643",
"text": "def size\n (contents || '').length\n end",
"title": ""
},
{
"docid": "becca3207c424c6a53ac77c291c12826",
"score": "0.6174615",
"text": "def bytesize\n @bytesize ||= @jrepo.open(@jblob).get_size \n end",
"title": ""
},
{
"docid": "8b89f24e65af73d77e5197c65cbff8d0",
"score": "0.6172235",
"text": "def remote_size\n return @remote_size if defined?(@remote_size)\n @remote_size = http_head['Content-Length'].to_i\n end",
"title": ""
},
{
"docid": "f5b474074fc68020654cbe5bb365760c",
"score": "0.6171071",
"text": "def content_length\n\t\treturn 0 unless self.header.member?( :content_length )\n\t\treturn Integer( self.header.content_length )\n\tend",
"title": ""
},
{
"docid": "55ef7fe5430a3dc143743041bd29e6a0",
"score": "0.6146568",
"text": "def total_out\n\t\t@output_buffer.length\n\tend",
"title": ""
},
{
"docid": "b5122c08ab199fe08a36ffa605334f76",
"score": "0.61452204",
"text": "def content_length\n @resource.content_length\n end",
"title": ""
},
{
"docid": "c4ccf2bf23ed64d5eb46959bf91c33d1",
"score": "0.61406076",
"text": "def size\r\n self.data.length\r\n end",
"title": ""
},
{
"docid": "f3c8c2408e56fe7c149b204767f758ee",
"score": "0.61403364",
"text": "def bLength\n self[:bLength]\n end",
"title": ""
},
{
"docid": "6df8c60bbc7d89161a8184bcd929a2c1",
"score": "0.613322",
"text": "def size\n return @args[:data].length\n end",
"title": ""
},
{
"docid": "0ed4723761f1151caf079017958e6d41",
"score": "0.612475",
"text": "def get_length\n\t\tsynchronized do\n\t\t\t@vlc.puts \"get_length\"\n\t\t\t@vlc.gets.to_i\n\t\tend\n\tend",
"title": ""
},
{
"docid": "7b81185ca8d48b1ffd930b764849fe11",
"score": "0.6111525",
"text": "def length\n @bin_data.length\n end",
"title": ""
},
{
"docid": "061f28fdc867a3c5585ffd2c673b9e02",
"score": "0.6104723",
"text": "def size\n contents.size\n end",
"title": ""
},
{
"docid": "f232134f038c9d52090c63c1f2c6003a",
"score": "0.6084349",
"text": "def remote_size\n response = http_downloader.head(image_url)\n return nil unless response.status == 200 && response.content_length.present?\n\n response.content_length.to_i\n end",
"title": ""
},
{
"docid": "9f4c62f1b7e799edda49925d0a7fb557",
"score": "0.6081669",
"text": "def length\n (headers[\"content-length\"] || -1).to_i\n end",
"title": ""
},
{
"docid": "4863119709c8508a8624e4a3be9b9e34",
"score": "0.60776156",
"text": "def length\n return @args[:data].length\n end",
"title": ""
},
{
"docid": "d775cb1b10c44ceb17d1dafd4147a7e4",
"score": "0.6072588",
"text": "def size\n blob.size\n end",
"title": ""
},
{
"docid": "c2bcf91dd701938ed403874df2eff59c",
"score": "0.6072403",
"text": "def getcontentlength\n 0\n end",
"title": ""
},
{
"docid": "6c90aaf8059376436fb8481b8df4fe0f",
"score": "0.60544175",
"text": "def length\n return unless headers['Content-Length']\n\n headers['Content-Length'].to_i\n end",
"title": ""
},
{
"docid": "0da3c3d1bca38e1031bea6dfa1a48137",
"score": "0.6052397",
"text": "def total_out\n\t\t\t@output_buffer.length\n\t\tend",
"title": ""
},
{
"docid": "f0ec3c6b6606784b9cda769a65277b7a",
"score": "0.60426116",
"text": "def size\n file.content_length\n end",
"title": ""
},
{
"docid": "937e42216f7e7b38f4425b2380b8b250",
"score": "0.6031635",
"text": "def file_size\n stream.size\n end",
"title": ""
},
{
"docid": "3db7cd39d784a604e5044cbf99014336",
"score": "0.6021098",
"text": "def size\n @content.size\n end",
"title": ""
},
{
"docid": "4eeb67eb2f5012134397dfa5bd2ef7cb",
"score": "0.60154766",
"text": "def size\n if !@tmpfile.closed?\n @tmpfile.size # File#size calls rb_io_flush_raw()\n else\n File.size(@tmpfile.path)\n end\n end",
"title": ""
},
{
"docid": "beda88a71be641ad5e46577e3e1d30b7",
"score": "0.6006967",
"text": "def get_remaining_bytes\n @length-@position\n end",
"title": ""
},
{
"docid": "53f842090a448a985bece751afa9ae9c",
"score": "0.6005461",
"text": "def actual_length\n @transfer[:actual_length]\n end",
"title": ""
},
{
"docid": "06eea1866de4ba71f12297aede68ffc0",
"score": "0.6004491",
"text": "def size()\n @contents.size\n end",
"title": ""
},
{
"docid": "592462cf0ab46f7da0d9247691b32f92",
"score": "0.6003684",
"text": "def size\n return self.body_data.size\n end",
"title": ""
},
{
"docid": "1a026e3cf042af2e63a69730cda64700",
"score": "0.60034674",
"text": "def size\n to_payload.bytesize\n end",
"title": ""
},
{
"docid": "a3d2af5bc23c3cfe824a9e5997dcbf0a",
"score": "0.59896594",
"text": "def content_length\n @content_length ||= ((s = self[HttpClient::CONTENT_LENGTH]) &&\n (s =~ /^(\\d+)$/)) ? $1.to_i : nil\n end",
"title": ""
},
{
"docid": "48067e71b60b1daf98ebef55edbced57",
"score": "0.5985605",
"text": "def size\r\n @contents.size\r\n end",
"title": ""
},
{
"docid": "15e192e2fbb02d839b79bf9d5277563c",
"score": "0.59791356",
"text": "def size\n stream_size * 8\n end",
"title": ""
},
{
"docid": "b500f3121480f511d1500d7eca5dc002",
"score": "0.5978446",
"text": "def size\n return @args[\"data\"].length\n end",
"title": ""
},
{
"docid": "f3d0b5b32d64d494308fb3210949993c",
"score": "0.59756505",
"text": "def lines\n @message.size\n end",
"title": ""
},
{
"docid": "acb6fe6f39a55d515e734417dc19b12f",
"score": "0.5973263",
"text": "def content_length; end",
"title": ""
},
{
"docid": "acb6fe6f39a55d515e734417dc19b12f",
"score": "0.5973263",
"text": "def content_length; end",
"title": ""
},
{
"docid": "acb6fe6f39a55d515e734417dc19b12f",
"score": "0.5973263",
"text": "def content_length; end",
"title": ""
},
{
"docid": "c79b18230d74f0e1f6daee9e7683f5d6",
"score": "0.59625536",
"text": "def size\n return @data.size\n end",
"title": ""
},
{
"docid": "a86a0730f902be3d0c386ecdded18e73",
"score": "0.5954713",
"text": "def long_read_len()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "80587f035802b5ecb0b6a1b190641dd7",
"score": "0.595434",
"text": "def header_len\n (@binhdr[12, 1].unpack(\"C\").pop >> 4) << 2\n end",
"title": ""
},
{
"docid": "f03c3dbcea46d291f4fe4c4c1efbc619",
"score": "0.59428537",
"text": "def byte_size; size.y * line_byte_size; end",
"title": ""
},
{
"docid": "40602f5ae400d0a4b6b5fd7b0bc76970",
"score": "0.59396017",
"text": "def content_length\n # http://greenbytes.de/tech/webdav/rfc7230.html#rfc.section.3.3.3\n # Clause 3: \"If a message is received with both a Transfer-Encoding\n # and a Content-Length header field, the Transfer-Encoding overrides the Content-Length.\n return nil if @headers.include?(Headers::TRANSFER_ENCODING)\n\n value = @headers[Headers::CONTENT_LENGTH]\n return nil unless value\n\n begin\n Integer(value)\n rescue ArgumentError\n nil\n end\n end",
"title": ""
},
{
"docid": "11e4b961f865561085ca4a0004b7e053",
"score": "0.59374017",
"text": "def bytes_remaining\n @data.bytesize - @pos\n end",
"title": ""
},
{
"docid": "ad9dba37a2a36baac7fb633e69126813",
"score": "0.5933635",
"text": "def total_in\n\t\t@input_buffer.length\n\tend",
"title": ""
},
{
"docid": "638279d02e73108fdd85496ff451f51d",
"score": "0.59310246",
"text": "def uncompressed_size\n @header.size\n end",
"title": ""
},
{
"docid": "d6e863a572a180023e4332fb39abfdf9",
"score": "0.59295475",
"text": "def part_size_in_bytes\n data.part_size_in_bytes\n end",
"title": ""
},
{
"docid": "37280d19971509f3a9d1ff0f56fc8edf",
"score": "0.5913504",
"text": "def _rl_get_char_len(src)\r\n return 0 if src[0,1] == 0.chr || src.length==0\r\n case @encoding\r\n when 'E'\r\n len = src.scan(/./me)[0].to_s.length\r\n when 'S'\r\n len = src.scan(/./ms)[0].to_s.length\r\n when 'U'\r\n len = src.scan(/./mu)[0].to_s.length\r\n when 'X'\r\n src = src.dup.force_encoding(@encoding_name)\r\n len = src.valid_encoding? ? src[0].bytesize : 0\r\n else\r\n len = 1\r\n end\r\n len==0 ? -2 : len\r\n end",
"title": ""
},
{
"docid": "38b356f3e0408c2ffd23d27167e46974",
"score": "0.5906882",
"text": "def message_length; complete_message.length; end",
"title": ""
},
{
"docid": "57e96f8693090e70274656fe768a7c08",
"score": "0.5902947",
"text": "def get_bytes_for_image(src)\n begin\n uri = URI.parse src\n req = Net::HTTP.new(uri.host, 80)\n resp = req.request_head(uri.path)\n\n if resp.content_type.include?(\"image\")\n return resp.content_length\n end\n rescue\n log \"Error getting image size for #{src} - #{$!}\"\n end\n\n return 0\n end",
"title": ""
},
{
"docid": "e0e9ef44349d522f1f0bfd0ac34b29a3",
"score": "0.58750385",
"text": "def read_size(uri)\n return File.size(get_file_uri_path(uri)) if is_file_uri(uri)\n \n require 'net/http'\n require 'uri'\n u = URI.parse(uri)\n http = connect_to(u.host, u.port)\n path = (u.path == \"\") ? \"/\" : u.path\n resp = http.head(path)\n fail RemoteSourceException, \"HTTP Response #{resp.code}\" if resp.code !~ /^2/\n resp['content-length'].to_i\n end",
"title": ""
}
] |
a9c7f29d0a960d2e886f0f7a6b5dbdf1
|
REQUIRES: m2result to be a valid output returned by M2 in string format. Specifically each knockout combination must be separated by a new line EFFECTS: the result of the M2 calculation is parsed and outputted to the screen
|
[
{
"docid": "1772f13692a61512a275cee6becc99f9",
"score": "0.6528814",
"text": "def parseoutput(m2result)\n knockouts = Array.new\n m2result.gsub!(\"{\", \"\")\n m2result.gsub!(\"}\", \"\")\n m2result.gsub!(\",\",\"\")\n cnt = 0\n m2result.each_line { |line|\n puts \"<br> <font color=blue> Knockout Combination: #{cnt+1}</font color=blue><br>\"\n line.gsub!(/ /,\"\")\n num_chars = 1 # count the number of characters\n num_knockouts = 0 # count the number of knockouts\n line.each_char { |c|\n if c == '0' \n puts \"Gene #{num_chars}, \"\n num_knockouts = num_knockouts + 1\n end\n num_chars = num_chars + 1\n }\n if num_knockouts == 0 \n puts \"No Knockouts\" \n end\n cnt = cnt + 1 # count the number of knockout combinations\n }\n return nil\nend",
"title": ""
}
] |
[
{
"docid": "eb0587cddb99eb72678014ea08166faa",
"score": "0.5763318",
"text": "def generate_result\n output = \"\"\n @input_data.split(\"\\n\").each do |line|\n line.strip!\n next unless line\n if asked_q = line.match(questions_regex(@measure.foreign_measures.keys, @resource_mgr.resources.keys))\n output += @answer_sheet.answer_for(asked_q[1], asked_q[4]) + \"\\n\"\n elsif asked_q = line.match(any_question_regex)\n output += @answer_sheet.invalid_input_answer + \"\\n\"\n end\n end\n output.strip\n end",
"title": ""
},
{
"docid": "87638f8ad8371e056365e47150e8d753",
"score": "0.5373472",
"text": "def getResultMessageLine2\n \n if @_domResultBody.nil?\n _getMessageFromResultDom\n end\n return @_sResultMessageLine2\n end",
"title": ""
},
{
"docid": "b775c05cc0b2982acb30d6e4c437a5ff",
"score": "0.5359101",
"text": "def do_2\n self.log(\"Processing #{@input[@cur_pos..@cur_pos+3]}\")\n input1, input2 = determine_inputs\n\n calculated = input1 * input2\n # store the value in the position at pos 3\n determine_output(calculated)\n end",
"title": ""
},
{
"docid": "96ee5d3be228a584363df90301d6bf9e",
"score": "0.5340575",
"text": "def returnOutput()\n result = \"<MaltegoMessage>\\n\"\n result.concat(\"<MaltegoTransformResponseMessage>\\n\")\n #Add Entities\n result.concat(\"<Entities>\\n\")\n @resultEntities.each do |entity|\n result.concat(entity.returnEntity())\n end\n result.concat(\"</Entities>\\n\")\n #Add UI Messages\n result.concat(\"<UIMessages>\\n\")\n @uiMessages.each do |uiMessage|\n result.concat(\"<UIMessage MessageType=\\\"#{uiMessage['messageType']}\\\">#{uiMessage['message']}</UIMessage>\\n\")\n end\n result.concat(\"</UIMessages>\\n\")\n result.concat(\"</MaltegoTransformResponseMessage>\\n\")\n result.concat(\"</MaltegoMessage>\\n\")\n end",
"title": ""
},
{
"docid": "e24523472ab98142d8b38f81faf3fbd9",
"score": "0.52851856",
"text": "def puts_formated_bill(res)\n # use a regex to extract the total price from the result\n total = res[/([1-9][0-9]*\\.\\d{2})/]\n # use a regex to extract the multiples pairs (name, qty) from the result\n details = res.scan(/\\(\\\\{0,2}\"{0,2}([\\w|\\s]*)\\\\{0,2}\"{0,2},(\\d)\\)/)\n puts \"You looked at the bill.\"\n puts \"The total to pay is : \" + total\n puts \"Details below :\\n---------------------\"\n # iterate over the pairs and display them\n details.each { |detail_line|\n puts detail_line[0] + \" => \" + detail_line[1]\n puts \"---------------------\"\n }\nend",
"title": ""
},
{
"docid": "8136f60ddf73c938c7a2dac81ce3b540",
"score": "0.52701473",
"text": "def test_conversion_from_apples_to_oranges\n skip\n\n calc = KitchenCalculator.new\n calc.evaluate(\"amount 2 apples\")\n calc.evaluate(\"triple\")\n calc.evaluate(\"convert to oranges\")\n\n expected_output = \"2 apples received\\n6.0 apples is triple\\n6.0 apples cannot be converted to oranges\\n\"\n assert_equal expected_output, calc.output\n end",
"title": ""
},
{
"docid": "e42825c2d7d6f6eeae5eade199a8ae09",
"score": "0.51778775",
"text": "def multiply_two_monomials(monomial_1, monomial_2)\n coefficient_1 = get_the_coefficient(monomial_1)\n coefficient_2 = get_the_coefficient(monomial_2)\n product_coefficient = coefficient_1 * coefficient_2\n variable_1 = get_the_variable(monomial_1)\n variable_2 = get_the_variable(monomial_2)\n product_variable = multiply_two_variable_expressions(variable_1, variable_2)\n product = \"#{product_coefficient}#{product_variable}\"\nend",
"title": ""
},
{
"docid": "e9e99d149f20bfa726113c7f4025fb1e",
"score": "0.5150429",
"text": "def print_result\n total_stops = @TRIP_SUMMARY[:first_part][:total_stops]\n\n puts \"You must travel through the following stops on the #{@TRIP_SUMMARY[:first_part][:line]} line: #{@TRIP_SUMMARY[:first_part][:stops].join(', ')}.\"\n\n unless @IS_SAME_LINE\n puts \"Change at #{@INTERCHANGE}.\"\n puts \"Your journey continues through the following stops on the #{@TRIP_SUMMARY[:second_part][:line]} line: #{@TRIP_SUMMARY[:second_part][:stops].join(', ')}.\"\n total_stops += @TRIP_SUMMARY[:second_part][:total_stops]\n end\n\n puts \"#{total_stops} stops in total.\"\n end",
"title": ""
},
{
"docid": "6d900b4e2d59e7170258d9db0ebdc063",
"score": "0.5101286",
"text": "def show_result array_result\n puts \"La table de multiplication du chiffre #{array_result[0][1]} est :\"\n\n array_result.each do |res|\n text = \"#{res[0]} = #{res[1]}\"\n puts text\n end\nend",
"title": ""
},
{
"docid": "63bf5c08afbe1c30af6219fb5ed02312",
"score": "0.50737333",
"text": "def result\n return @result.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "8adb25db55f02b4cbb4e2f5129e5aa5d",
"score": "0.50531965",
"text": "def _reduce_187(val, _values, result)\n result = s(:dot2, val[0], val[2])\n result.line = val[0].line\n \n result\nend",
"title": ""
},
{
"docid": "6a2a85b0325f80907167e17a8942c123",
"score": "0.50404245",
"text": "def mine_results(ore)\n gold_amount = ore['gold']\n silver_amount = ore['silver']\n gold_message = if gold_amount > 1\n \"\\t Found #{gold_amount} ounces of gold\"\n elsif gold_amount == 1\n \"\\t Found #{gold_amount} ounce of gold\"\n elsif gold_amount.zero? == true && silver_amount.zero? == true\n \"\\t Found no precious metals\"\n else\n \"\\t \"\n end\n silver_message = if silver_amount > 1 && gold_amount.zero? == true\n \"Found #{silver_amount} ounces of silver.\"\n elsif silver_amount == 1 && gold_amount.zero? == true\n \"Found #{silver_amount} ounce of silver.\"\n elsif silver_amount > 1\n \" and #{silver_amount} ounces of silver.\"\n elsif silver_amount == 1\n \" and #{silver_amount} ounce of silver.\"\n else\n '.'\n end\n gold_message.concat silver_message\n end",
"title": ""
},
{
"docid": "5172a01967bb91ef05195f1973c21c39",
"score": "0.50211895",
"text": "def _reduce_542(val, _values, result)\n _, v1 = val\n\n result = s(:dot2, nil, v1).line v1.line\n\n result\nend",
"title": ""
},
{
"docid": "9b0cd35c907a8f9a8d12cf0b64e31872",
"score": "0.49835882",
"text": "def act_smart\r\n return \"E = mc^2\"\r\n end",
"title": ""
},
{
"docid": "46b427783b01f167b0cb467470e4856d",
"score": "0.49549642",
"text": "def combined_output\n @stdcomb || ''\n end",
"title": ""
},
{
"docid": "a37291ee5a9cf939aa3c8973d19848af",
"score": "0.4953491",
"text": "def outputs\n result = OpenStudio::Measure::OSOutputVector.new\n\n # electric consumption values\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('electricity_consumption_actual') # kWh\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('electricity_consumption_modeled') # kWh\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('electricity_consumption_cvrmse') # %\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('electricity_consumption_nmbe') # %\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('electricity_sum_of_squares') # kWh\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('electricity_dof') # na\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('electricity_rmse') # kWh^0.5\n\n # electric peak values\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('electricity_peak_demand_nmbe') # %\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('electricity_peak_demand_actual') # kW\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('electricity_peak_demand_modeled') # kW\n\n # gas consumption values\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('natural_gas_consumption_actual') # therms\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('natural_gas_consumption_modeled') # therms\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('natural_gas_consumption_cvrmse') # %\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('natural_gas_consumption_nmbe') # %\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('natural_gas_sum_of_squares') # therms\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('natural_gas_dof') # na\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('natural_gas_rmse') # therms^0.5\n\n # fuel oil #2 consumption values\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('fuel_oil_2_consumption_actual') # gals\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('fuel_oil_2_consumption_modeled') # gals\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('fuel_oil_2_consumption_cvrmse') # %\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('fuel_oil_2_consumption_nmbe') # %\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('fuel_oil_2_sum_of_squares') # gals\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('fuel_oil_2_dof') # na\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('fuel_oil_2_rmse') # gals^0.5\n\n # total fuel values (gas plus electric only? not district?)\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('total_sum_of_squares') # kBtu\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('total_dof') # na\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('total_rmse') # kBtu^0.5\n\n # within limit check values\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('electricity_cvrmse_within_limit') # na\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('electricity_nmbe_within_limit') # na\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('natural_gas_cvrmse_within_limit') # na\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('natural_gas_nmbe_within_limit') # na\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('fuel_oil_2_cvrmse_within_limit') # na\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('fuel_oil_2_nmbe_within_limit') # na\n\n result\n end",
"title": ""
},
{
"docid": "000286152c82fd2ea9dab332e45637ab",
"score": "0.49474546",
"text": "def getResultMessageText2\n \n if @_domResultBody.nil?\n _getMessageFromResultDom\n end\n return @_sResultMessageText2\n end",
"title": ""
},
{
"docid": "4cbb517ec05dcd078e8de48ced735110",
"score": "0.4944414",
"text": "def act_smart\n return \"E = mc^2\"\n end",
"title": ""
},
{
"docid": "4cbb517ec05dcd078e8de48ced735110",
"score": "0.4944414",
"text": "def act_smart\n return \"E = mc^2\"\n end",
"title": ""
},
{
"docid": "4cbb517ec05dcd078e8de48ced735110",
"score": "0.4944414",
"text": "def act_smart\n return \"E = mc^2\"\n end",
"title": ""
},
{
"docid": "4cbb517ec05dcd078e8de48ced735110",
"score": "0.4944414",
"text": "def act_smart\n return \"E = mc^2\"\n end",
"title": ""
},
{
"docid": "521655f70d4190643e4f41b223a7ecbf",
"score": "0.4939883",
"text": "def lines1_2\n [self.line1, self.line2].compact.join(', ')\n end",
"title": ""
},
{
"docid": "56041625e2d53299c4e386088aa7876a",
"score": "0.49364036",
"text": "def calculate_result(matches)\n total_score = matches.shift.first.split(\"=\").last.strip\n target = []\n matches.each do |problem|\n reason = problem.shift.strip\n lines_info = problem.map do |full_line|\n name, line = full_line.split(\":\").map(&:strip)\n { name: name, line: line }\n end\n target << [reason: reason, matches: lines_info]\n end\n {\n total_score: total_score,\n matches: target.flatten\n }\n end",
"title": ""
},
{
"docid": "83b090f44e07f68a148bdffb02c793b5",
"score": "0.49343815",
"text": "def _reduce_178(val, _values, result)\n result = s(:dot2, val[0], val[2])\n result.line = val[0].line\n \n result\nend",
"title": ""
},
{
"docid": "e7d84f22815d74e253d968cdd8b6e899",
"score": "0.49227986",
"text": "def two_number_product(item1, item2)\n\tputs \"Product: #{item1 * item2}\"\nend",
"title": ""
},
{
"docid": "291f405ec8c270979dfaa7092fd5943d",
"score": "0.4915414",
"text": "def calcul(nb, nb2)\n arr = (\"%.2f\" %(Math.sqrt(Float(nb)) * Float(nb2)))\n say(\"PRIVMSG Candy !ep1 -rep \"+arr.to_s)\n end",
"title": ""
},
{
"docid": "16cda0ee94775aea918ed259a18119af",
"score": "0.49138966",
"text": "def reduce_outputs(output1, output2, tem)\n secpack = reduce_for_outputs output1, output2\n tem.execute secpack\n end",
"title": ""
},
{
"docid": "a9ebe5eebcaea0e615b92b54f2e9bbe0",
"score": "0.49134377",
"text": "def _reduce_187(val, _values, result)\n result = s(:dot2, val[0], val[2])\n result.line = val[0].line\n \n result\nend",
"title": ""
},
{
"docid": "22f84d06a9ae4604c7b99d948cda323a",
"score": "0.49039617",
"text": "def build_matrix\n M2_TEMPLATE % @hilbert_basis.find.transpose.to_a.collect{|row| \"{#{row.join(\",\")}}\"}.join(\",\")\n end",
"title": ""
},
{
"docid": "095885740cc50693036da2b52e545879",
"score": "0.48995182",
"text": "def wattball_match_result(match)\n [\n match.team1.teamName,\n [\n match.result.join(\" - \")\n\n ],\n match.team2.teamName\n ].join(\" \")\n end",
"title": ""
},
{
"docid": "139fc615190a531e3c6a45cb97db20de",
"score": "0.48989078",
"text": "def print_two_numbers_result(number_1, operation, number_2, result)\n\tputs \"Here is your result:\"\n\tputs number_1.to_s + operation.to_s + number_2.to_s + \" = \" + result.to_s\nend",
"title": ""
},
{
"docid": "1dc61728c49967b23d49c339e4f33c03",
"score": "0.4898291",
"text": "def match(event)\n @out1 << \"=\"\n if @dual_output\n @out2 << \"=\"\n end\n end",
"title": ""
},
{
"docid": "2ff09170c8ac930d2e57cd01c656e731",
"score": "0.4895357",
"text": "def parse!(outputs)\n return if @data\n\n # So typically, the first output is a P2PKH with the receiver address:\n @receiver_addr = hash160_from_p2pkh outputs.shift if is_non_prefixed_p2pkh? outputs.first\n\n # Parse the sender address:\n @sender_addr = hash160_from_p2pkh outputs.pop if is_non_prefixed_p2pkh? outputs.last\n\n @data = outputs.collect{|out|\n # This weirdo line will send the regex matches to the operation handler\n # that matches the line\n send (case out\n when OP_RETURN_PARTS then :data_from_opreturn\n when P2PKH_PARTS then :data_from_opchecksig\n when OP_MULTISIG_PARTS then :data_from_opcheckmultisig\n else raise InvalidOutput\n end), *$~.to_a[1..-1]\n }.compact.join\n end",
"title": ""
},
{
"docid": "3ef1101327111dfed1f006d799ca4f58",
"score": "0.48694244",
"text": "def /(com2)\n\n\t\tComplejo.new((@r * com2.r + @m * com2.m)/(com2.r * com2.r + com2.m * com2.m), (@m * com2.r - @r * com2.m) / (com2.r * com2.r + com2.m * com2.m)).to_s\n\n\n\tend",
"title": ""
},
{
"docid": "ac308dbf4a2bf4f4a803fb9edb61a9ab",
"score": "0.48579213",
"text": "def display_result(info)\n num_of_total_stops = 0\n info_1 = {}\n info_2 = {}\n if info[:origin_line] === info[:dest_line]\n display_one_line_trip(info)\n else\n if (info[:origin_line] === \"o\" && (info[:dest_line] === 'l' || info[:dest_line] === 's')) || (info[:dest_line] === \"o\" && (info[:origin_line] === 'l' || info[:origin_line] === \"s\"))\n\n info_1[:origin_line] = info[:origin_line]\n info_1[:dest_line] = \"n\"\n info_1[:origin_stop] = info[origin_line]\n info_1[:dest_stop] = \"ts\"\n info_2[:origin_line] = \"n\"\n info_2[:dest_line] = info[:origin_line]\n info_1[:origin_stop] = \"ts\"\n info_1[:dest_stop] = info[dest_stop]\n\n num_of_total_stops += display_two_line_trip(info_1)\n num_of_total_stops += display_two_line_trip(info_2)\n else\n num_of_total_stops = display_two_line_trip(info)\n end\n end\n\n puts \"\\nYou need total #{num_of_total_stops} stops.\"\nend",
"title": ""
},
{
"docid": "cf325f33ecd1e6ac4cc69cfb05cc6360",
"score": "0.4834584",
"text": "def _reduce_183(val, _values, result)\n result = s(:dot2, val[0], val[2])\n result.line = val[0].line\n \n result\nend",
"title": ""
},
{
"docid": "26d758a8ba6a169e1ffd21f85088b026",
"score": "0.48336688",
"text": "def _reduce_555(val, _values, result)\n _, v1 = val\n\n result = s(:dot2, nil, v1).line v1.line\n\n result\nend",
"title": ""
},
{
"docid": "26d758a8ba6a169e1ffd21f85088b026",
"score": "0.4833161",
"text": "def _reduce_555(val, _values, result)\n _, v1 = val\n\n result = s(:dot2, nil, v1).line v1.line\n\n result\nend",
"title": ""
},
{
"docid": "832bdb51e5a73acc4d67acb7320edd38",
"score": "0.48328373",
"text": "def eluteMultipleGelSample(inStr,outStr1,outStr2,kitStr)\n\n kit=findSettings(kitStr)\n\n operations.each { |op|\n\n num_columns=(op.input(inStr).item.get(:number_of_tubes).to_f/2.0).ceil\n\n # # build display table\n # col1=Array (1..op.input(inStr).item.get(:number_of_tubes).to_f)\n # col2=col1.map {|v| (v/2.0).ceil }\n # col1=col1.unshift(\"Input tube index\")\n # col2=col2.unshift(\"Output column index\")\n # tab = [col1, col2].transpose\n\n\n # incubation+elution- first round\n show do\n title \"Elution - first round\"\n check \"Grab #{num_columns} sterile 1.5 mL tubes and label <b>ALL</b> of them <b>1</b>\"\n check \"Transfer the #{kit.fetch(\"column\")} columns from the collection tubes to the 1.5 mL tubes labeled <b>1</b>\"\n check \"Add <b>#{kit.fetch(\"elutionVolume\")} µL</b> of <b>PREHEATED</b> molecular grade water to center of each column\"\n warning \"Be careful to not pipette on the wall of the tube\"\n timer initial: {hours: 0, minutes: kit.fetch(\"elutionTime\"), seconds: 0}\n check \"Spin for #{kit.fetch(\"spinTime\")} minute(s) at at #{kit.fetch(\"spinG\")} xg to elute DNA\"\n warning \"Retain the columns for a second elution!\"\n end\n\n # incubation+elution - second round\n show do\n title \"Elution - second round\"\n check \"Grab #{num_columns} sterile 1.5 mL tubes and label <b>ALL</b> of them <b>2</b>\"\n check \"Transfer the columns from the tubes labeled <b>1</b> to the tubes labeled <b>2</b>\"\n check \"Add <b>#{kit.fetch(\"elutionVolume\")} µL</b> of <b>PREHEATED</b> molecular grade water to center of each column\"\n warning \"Be careful to not pipette on the wall of the tube\"\n timer initial: {hours: 0, minutes: kit.fetch(\"elutionTime\"), seconds: 0}\n check \"Spin for #{kit.fetch(\"spinTime\")} minute(s) at at #{kit.fetch(\"spinG\")} xg to elute DNA\"\n check \"Remove and trash the columns\"\n end\n\n # combine tubes with high, low cencentration samples\n show do\n title \"Combine samples\"\n check \"Combine the contents of the tubes labeled <b>1</b> into one 1.5 mL tube (add one to the other) and label it <b>#{op.output(outStr1).item}</b>\"\n check \"Combine the contents of the tubes labeled <b>2</b> into one 1.5 mL tube (add one to the other) and label it <b>#{op.output(outStr2).item}</b>\"\n check \"Trash the empty used tubes\"\n end\n\n } # each\n\n end",
"title": ""
},
{
"docid": "e63d84d4bacb0bebeb4abac46b08f8d2",
"score": "0.4799854",
"text": "def result_msg(name, bmi_result, category)\n results_msg = [\n \"\",\n \"Hi #{name},\",\n \"\", \n \"RESULTS\".colorize(:red),\n \"Score: \".colorize(:red) + \"#{bmi_result}\",\n \"Category: \".colorize(:red) +\"#{find_cat_name(category)}\",\n \"Range: \".colorize(:red) + \"#{find_cat_range(category)}\",\n \"Description: \".colorize(:red),\n \"#{find_cat_desc(category)}\",\n \"\"\n ].join(\"\\n\") + \"\\n\"\n return results_msg\nend",
"title": ""
},
{
"docid": "7b9e4acb8be4c90e59a60566be771b7a",
"score": "0.47980884",
"text": "def log_to_result(msg)\n \n msg.gsub!(\"\\n\\n\",\"\\n\")\n msg.chomp!()\n msg.gsub!(PREFIX_RES_START,\"\");\n msg.gsub!(PREFIX_RES_OTHER,\"\");\n msg.gsub!(PREFIX_RES_END,\"\");\n #msg.gsub!(\"\\n\",\"\\n#{\" \"*26}<Result> \");\n msg.gsub!(\"\\n\",\"\\n<Result> \");\n \n log(\"<Result> \" + msg)\n \n end",
"title": ""
},
{
"docid": "10b1f6210040e013d0ef539cf0697d8a",
"score": "0.47566006",
"text": "def dmr(results)\n results.inject(\"\"){ |s,(k,v)| s << \"#{k}:\\t#{v}\\n\"; s }\n end",
"title": ""
},
{
"docid": "c584fc9f983a295f72563fd390e46fa5",
"score": "0.47413412",
"text": "def porter2_stem_verbose(gb_english = false)\n preword = self.porter2_tidy\n puts \"Preword: #{preword}\"\n return preword if preword.length <= 2\n\n word = preword.porter2_preprocess\n puts \"Preprocessed: #{word}\"\n \n if Porter2::SPECIAL_CASES.has_key? word\n puts \"Returning #{word} as special case #{Porter2::SPECIAL_CASES[word]}\"\n Porter2::SPECIAL_CASES[word]\n else\n r1 = word.porter2_r1\n r2 = word.porter2_r2\n puts \"R1 = #{r1}, R2 = #{r2}\"\n \n w0 = word.porter2_step0 ; puts \"After step 0: #{w0} (R1 = #{w0.porter2_r1}, R2 = #{w0.porter2_r2})\"\n w1a = w0.porter2_step1a ; puts \"After step 1a: #{w1a} (R1 = #{w1a.porter2_r1}, R2 = #{w1a.porter2_r2})\"\n \n if Porter2::STEP_1A_SPECIAL_CASES.include? w1a\n puts \"Returning #{w1a} as 1a special case\"\n\tw1a\n else\n w1b = w1a.porter2_step1b(gb_english) ; puts \"After step 1b: #{w1b} (R1 = #{w1b.porter2_r1}, R2 = #{w1b.porter2_r2})\"\n w1c = w1b.porter2_step1c ; puts \"After step 1c: #{w1c} (R1 = #{w1c.porter2_r1}, R2 = #{w1c.porter2_r2})\"\n w2 = w1c.porter2_step2(gb_english) ; puts \"After step 2: #{w2} (R1 = #{w2.porter2_r1}, R2 = #{w2.porter2_r2})\"\n w3 = w2.porter2_step3(gb_english) ; puts \"After step 3: #{w3} (R1 = #{w3.porter2_r1}, R2 = #{w3.porter2_r2})\"\n w4 = w3.porter2_step4(gb_english) ; puts \"After step 4: #{w4} (R1 = #{w4.porter2_r1}, R2 = #{w4.porter2_r2})\"\n w5 = w4.porter2_step5 ; puts \"After step 5: #{w5}\"\n wpost = w5.porter2_postprocess ; puts \"After postprocess: #{wpost}\"\n wpost\n end\n end\n end",
"title": ""
},
{
"docid": "e871439e8a5a6b4c8608882d5ef11657",
"score": "0.47299495",
"text": "def puts_formated_bill(res)\n puts \"You looked at the bill.\"\n puts \"The total to pay is : #{res[:total]}\"\n puts \"Details below :\\n---------------------\"\n res[:details].each { |detail_line|\n puts \"#{detail_line[:name]} => #{detail_line[:qty]}\"\n puts '---------------------'\n }\nend",
"title": ""
},
{
"docid": "2ca4ec68214d4f95a01d535872bc0943",
"score": "0.47215554",
"text": "def buildLIMSResultString(readNum)\n getPhasingPrePhasingResults(readNum)\n getLaneResultSummary(readNum)\n\n if @showAnalysisResults == true\n getUniquenessResult()\n getAlignmentResult(readNum)\n end\n\n currentTime = Time.new \n puts \"Current Time = \" + currentTime.strftime(\"%Y-%m-%d\")\n\n result = \" LANE_YIELD_KBASES \" + @totalBases.to_s + \n \" CLUSTERS_RAW \" + @rawClusters.to_s +\n \" CLUSTERS_PF \" + @pfClusters.to_s + \" FIRST_CYCLE_INT_PF \" +\n @avCycle1Int.to_s + \" PERCENT_INTENSITY_AFTER_20_CYCLES_PF \" +\n @perInt20Cycles.to_s + \" PERCENT_PF_CLUSTERS \" +\n @perPFClusters.to_s + \" PERCENT_PHASING \" + @phasePercent.to_s +\n \" PERCENT_PREPHASING \" + @prePhasePercent.to_s \n\n if @showAnalysisResults == true\n result = result + \" PERCENT_ALIGN_PF \" + @perAlignPF.to_s +\n \" PERCENT_ERROR_RATE_PF \" + @errorPercent.to_s +\n \" ALIGNMENT_SCORE_PF \" + @avgAlignScore.to_s \n # \" REFERENCE_PATH \" + getReferencePath() +\n # \" RESULTS_PATH \" + FileUtils.pwd \n\n if readNum.to_s.eql?(\"1\")\n result = result + \" RESULTS_PATH \" + FileUtils.pwd +\n \" REFERENCE_PATH \" + getReferencePath() +\n \" BAM_PATH \" + getBAMPath()\n end\n # Uncomment the following line if we need to send this variable in the upload string\n # + \" ANALYSIS_END_DATE \" + currentTime.strftime(\"%Y-%m-%d\").to_s \n if @foundUniquenessResult == true && readNum == 1\n result = result + \" UNIQUE_PERCENT \" + @percentUnique.to_s\n end\n end\n return result\n end",
"title": ""
},
{
"docid": "a07e78a15a4c469f0d9611337417f196",
"score": "0.47139007",
"text": "def m1\n return 1, \"2\", 3.14\nend",
"title": ""
},
{
"docid": "0d5a04f41bc21d85ea382f2279afef57",
"score": "0.4709199",
"text": "def resultsToStr(res)\n line = String.new\n res.each{ |r|\n line += r + \":\"\n }\n line.chop!\n \n return line\nend",
"title": ""
},
{
"docid": "e44efbe336445a731cddad69b7391d1d",
"score": "0.4709138",
"text": "def outputs\n buildstock_outputs = [\n \"total_site_energy_mbtu\",\n \"total_site_electricity_kwh\",\n \"total_site_natural_gas_therm\",\n \"total_site_fuel_oil_mbtu\",\n \"total_site_propane_mbtu\",\n \"net_site_energy_mbtu\", # Incorporates PV\n \"net_site_electricity_kwh\", # Incorporates PV\n \"electricity_heating_kwh\",\n \"electricity_cooling_kwh\",\n \"electricity_interior_lighting_kwh\",\n \"electricity_exterior_lighting_kwh\",\n \"electricity_interior_equipment_kwh\",\n \"electricity_fans_heating_kwh\",\n \"electricity_fans_cooling_kwh\",\n \"electricity_pumps_kwh\",\n \"electricity_water_systems_kwh\",\n \"electricity_pv_kwh\",\n \"natural_gas_heating_therm\",\n \"natural_gas_interior_equipment_therm\",\n \"natural_gas_water_systems_therm\",\n \"fuel_oil_heating_mbtu\",\n \"fuel_oil_interior_equipment_mbtu\",\n \"fuel_oil_water_systems_mbtu\",\n \"propane_heating_mbtu\",\n \"propane_interior_equipment_mbtu\",\n \"propane_water_systems_mbtu\",\n \"hours_heating_setpoint_not_met\",\n \"hours_cooling_setpoint_not_met\",\n \"hvac_cooling_capacity_w\",\n \"hvac_heating_capacity_w\",\n \"hvac_heating_supp_capacity_w\",\n \"upgrade_name\",\n \"upgrade_cost_usd\",\n \"upgrade_option_01_cost_usd\",\n \"upgrade_option_01_lifetime_yrs\",\n \"upgrade_option_02_cost_usd\",\n \"upgrade_option_02_lifetime_yrs\",\n \"upgrade_option_03_cost_usd\",\n \"upgrade_option_03_lifetime_yrs\",\n \"upgrade_option_04_cost_usd\",\n \"upgrade_option_04_lifetime_yrs\",\n \"upgrade_option_05_cost_usd\",\n \"upgrade_option_05_lifetime_yrs\",\n \"upgrade_option_06_cost_usd\",\n \"upgrade_option_06_lifetime_yrs\",\n \"upgrade_option_07_cost_usd\",\n \"upgrade_option_07_lifetime_yrs\",\n \"upgrade_option_08_cost_usd\",\n \"upgrade_option_08_lifetime_yrs\",\n \"upgrade_option_09_cost_usd\",\n \"upgrade_option_09_lifetime_yrs\",\n \"upgrade_option_10_cost_usd\",\n \"upgrade_option_10_lifetime_yrs\",\n \"weight\"\n ]\n result = OpenStudio::Measure::OSOutputVector.new\n buildstock_outputs.each do |output|\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput(output)\n end\n return result\n end",
"title": ""
},
{
"docid": "9ab6a5e98e6ce4c4d4378a498f2e796a",
"score": "0.470679",
"text": "def display_two_line_trip(info)\n if (info[:origin_line] === 'n' && info[:dest_line] === 'o')|| (info[:origin_line] === 'o' && info[:dest_line] === 'n')\n transfer_stop = \"ts\"\n else\n transfer_stop = \"us\"\n end\n\n num_of_stops_1 = get_num_of_stops(info[:origin_line], info[:origin_stop], transfer_stop)\n num_of_stops_2 = get_num_of_stops(info[:dest_line], transfer_stop, info[:dest_stop])\n num_of_total_stops = num_of_stops_1 + num_of_stops_2\n\n puts \"\\nYou need #{num_of_stops_1} stops on #{info[:origin_line].upcase} line.\"\n puts \"You need to transfer at #{transfer_stop}.\"\n puts \"You need #{num_of_stops_2} stops on #{info[:dest_line].upcase} line.\"\n\n num_of_total_stops\nend",
"title": ""
},
{
"docid": "ebe2bc998541735a21ad55b6439bf021",
"score": "0.47059876",
"text": "def part2_outcome(filename)\n _elf_attack, gamedata, i = part2_inner(filename)\n hp_sum = gamedata[:units].map { |u| u[:hp] }.sum\n hp_sum * i\nend",
"title": ""
},
{
"docid": "1ed752aeac6a4567383aab9c25775474",
"score": "0.4704136",
"text": "def smile\n\n oper = @message.split(\" \")[0]\n val1 = @message.split(\" \")[1].to_i\n val2 = @message.split(\" \")[2].to_i\n\n eyes = [\"O\",\"o\",\"^\",\"*\" ]\n mouths = [\"_\",\"__\",\".\" ]\n\n symmetry = rand(1) > 0\n\n lefteye = eyes.shuffle[0]\n righteye = lefteye\n if( !symmetry )\n righteye = eyes.shuffle[0]\n end\n\n text = lefteye + mouths.shuffle[0] + righteye\n\n return Hash[\"text\" => text ]\n\n end",
"title": ""
},
{
"docid": "7a9ee7d8df24ea3cde96535b5c551962",
"score": "0.4704036",
"text": "def render\n @result.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "e3d138698fac7af302bcc64daa4cdb0d",
"score": "0.47035068",
"text": "def output(text1, text2)\n text1 + ' ' + text2\nend",
"title": ""
},
{
"docid": "bf94fc70f8bfc3ad01f3b321536a5b1f",
"score": "0.47003734",
"text": "def outcome_text\n \"Lichamelijk functioneren: #{evaluate[:estimate][0].round(1)} (#{evaluate[:se][0].round(1)})\\nVermoeidheid: #{evaluate[:estimate][1].round(1)} (#{evaluate[:se][1].round(1)})\\nVermogen om aandeel te hebben in sociale rollen en activiteiten: #{evaluate[:estimate][2].round(1)} (#{evaluate[:se][2].round(1)})\\nImpact van COPD-gerelateerde klachten: #{evaluate[:estimate][3].round(1) }(#{evaluate[:se][3].round(1)})\"\n end",
"title": ""
},
{
"docid": "64a10b11f39b858e2ba5ce49fe70ada1",
"score": "0.46996254",
"text": "def outputs\n result = OpenStudio::Measure::OSOutputVector.new\n\n numeric_properties = [\n\t\t\t\"dx_cooling_nominal_cop\",\n\t\t\t\"dx_cooling_nominal_capacity\",\n\t\t\t\"living_room_area_fraction\"\n ]\n \n numeric_properties.each do |numeric_property|\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput(numeric_property)\n end\n\n return result\n end",
"title": ""
},
{
"docid": "7f22020fd570e5cb14acf5d74c1d3bdf",
"score": "0.46989197",
"text": "def getSommet2()\n return @sommet2\n end",
"title": ""
},
{
"docid": "c807416272d3ab264c23cac6db19a4c9",
"score": "0.46913576",
"text": "def test_ut_t4_smt_mdm_010\n metric_names = [\"STTPP\",\"STCDN\",\"STM33\",\"STBME\",\"STBMO\",\"STFNC\",\"STBMS\",\"STBUG\",\"STCCA\",\"STCCB\",\"STCCC\"]\n smt_list_0 = MetricDescription.get_smt_list(metric_names,\"File\",[\"QAC\",\"QAC++\"], \"name\", \"DESC\")\n smt_list_1 = MetricDescription.get_smt_list(metric_names,\"File\",[\"QAC\",\"QAC++\"], \"name\", \"DESC\",1)\n assert smt_list_0, smt_list_1\n end",
"title": ""
},
{
"docid": "1d1daeb8139a19e202ac918203620646",
"score": "0.46897745",
"text": "def math(arg1, arg2)\r\n \r\n # check the input parameters\r\n error, min, max = check_input(arg1, arg2)\r\n if error != 0\r\n return -1\r\n end\r\n\r\n # generate question, correct and wrong answers\r\n answer = rand(min..max)\r\n first = rand(0..answer)\r\n second = answer - first\r\n wrong = gen_wrong_answers(answer)\r\n \r\n # store everything in a hash\r\n data = {}\r\n data[\"question\"] = \"#{first} + #{second}\"\r\n data[\"answer\"] = answer\r\n data[\"wrong1\"] = wrong[0]\r\n data[\"wrong2\"] = wrong[1]\r\n data[\"wrong3\"] = wrong[2]\r\n\r\n File.write(RESULT_FILE, data.to_json)\r\n \r\n return 0\r\nend",
"title": ""
},
{
"docid": "7979d13576918c89a653f7393687dc7b",
"score": "0.4689774",
"text": "def to_s\n # Get the maximum lengths of line elements to equalize the output formats\n max_name = \"Player #{@players.count-1}\".length\n max_currency = \" ($#{@players.collect(&:wealth).max})\".length\n lines = []\n dealer_line = \"Dealer\"\n player_name_line = \"Player\"\n player_wealth_line_start = \" ($\"\n player_wealth_line_end = \")\"\n lines << dealer_line + \"#{\" \" * (max_name - dealer_line.length + max_currency)}: #{@dealer.hand}\"\n @players.each_with_index do |player, player_index|\n player_lines = []\n player_lines << player_name_line + \"#{\" \" * (max_name - player_name_line.length - player_index.to_s.length)}#{player_index}\"\n player_lines << player_wealth_line_start + \"#{\" \" * (max_currency - player_wealth_line_start.length - player_wealth_line_end.length - player.wealth.to_s.length)}#{player.wealth}#{player_wealth_line_end}\"\n text = player_lines.join\n player.hands.each_with_index do |hand, hand_index|\n lines << \"#{text}: #{hand.to_s}\"\n text = \" \" * text.length if hand_index == 0\n end\n end\n longest_line_length = lines.collect(&:length).max\n lines.collect! do |line|\n line + \" \" * (longest_line_length - line.length)\n end\n lines.collect! do |line|\n \"| #{line} |\"\n end\n turn_line = \"ROUND #{@turn}\"\n turn_line = \"END RESULT\" if @finished\n longest_line_length = lines.collect(&:length).max\n turn_line_diff = longest_line_length - turn_line.length\n lines.insert(0, \"=\" * (turn_line_diff/2) + turn_line + \"=\" * (turn_line_diff/2+turn_line_diff%2))\n lines << \"=\" * longest_line_length\n return \"\\n\\n\\n\" << lines.join(\"\\n\") << \"\\n\\n\"\n end",
"title": ""
},
{
"docid": "c4a928faae0489f58176653bff17cd73",
"score": "0.4685027",
"text": "def result(text)\n matrix(text)\nend",
"title": ""
},
{
"docid": "33cdc7b281c835bd94ddc8dc43f00a0f",
"score": "0.46828896",
"text": "def formatted_highscore_without_params_message(results)\n \"Atk Power - #{results[\"ha\"][:name]} #{results[\"ha\"][:value].round(1)}\" +\n \" | HP - #{results[\"hp\"][:name]} #{results[\"hp\"][:value].round(1)}\" +\n \" | Crit Chance - #{results[\"cc\"][:name]} #{(results[\"cc\"][:value]*100).round(1)}\" +\n \" | Armor - #{results[\"arm\"][:name]} #{results[\"arm\"][:value].round(1)}\" +\n \" | Resistance - #{results[\"res\"][:name]} #{results[\"res\"][:value].round(1)}\" +\n \" | Crit Dmg - #{results[\"cd\"][:name]} #{(results[\"cd\"][:value]*100).round(1)}\" +\n \" | Accuracy - #{results[\"acc\"][:name]} #{(results[\"acc\"][:value]*100).round(1)}\" +\n \" | Evasion - #{results[\"eva\"][:name]} #{(results[\"eva\"][:value]*100).round(1)}\"+\n \"\\nBerry Atk Power - #{results[\"berry_ha\"][:name]} #{results[\"berry_ha\"][:value].round(1)}\" +\n \" | Berry HP - #{results[\"berry_hp\"][:name]} #{results[\"berry_hp\"][:value].round(1)}\" +\n \" | Berry Crit Chance - #{results[\"berry_cc\"][:name]} #{(results[\"berry_cc\"][:value]*100).round(1)}\" +\n \" | Berry Armor - #{results[\"berry_arm\"][:name]} #{results[\"berry_arm\"][:value].round(1)}\" +\n \" | Berry Resistance - #{results[\"berry_res\"][:name]} #{results[\"berry_res\"][:value].round(1)}\" +\n \" | Berry Crit Dmg - #{results[\"berry_cd\"][:name]} #{(results[\"berry_cd\"][:value]*100).round(1)}\" +\n \" | Berry Accuracy - #{results[\"berry_acc\"][:name]} #{(results[\"berry_acc\"][:value]*100).round(1)}\" +\n \" | Berry Evasion - #{results[\"berry_eva\"][:name]} #{(results[\"berry_eva\"][:value]*100).round(1)}\"\n end",
"title": ""
},
{
"docid": "f411b55c31ae3f52f1de6bf90bddc4f5",
"score": "0.46827734",
"text": "def modeler_description\n return \"This measure inserts EMS code for each airloop found to contain an AirLoopHVAC:UnitarySystem object. It is meant to be paired specifically with the Create Variable Speed RTU OpenStudio measure.\n\nUsers can select the fan mass flow fractions for up to nine stages (ventilation, two or four cooling, and two or four heating). The default control logic is as follows:\nWhen the unit is ventilating (heating and cooling coil energy is zero), the fan flow rate is set to 40% of nominal.\nWhen the unit is in heating (gas heating coil), the fan flow rate is set to 100% of nominal (not changeable).\nWhen the unit is in staged heating/cooling, as indicated by the current heating/cooling coil energy rate divided by the nominal heating/cooling coil size, the fan flow rate is set to either 50/100% (two-stage compressor), or 40/50/75/100% (four-stage compressor).\n\nWhen applied to staged coils, the measure assumes that all stages are of equal capacity. That is, for two-speed coils, that the compressors are split 50/50, and that in four-stage units, that each of the four compressors represents 25% of the total capacity.\n\nThe measure is set up so that a separate block of EMS code is inserted for each applicable airloop (i.e., the EMS text is not hard-coded).\"\n end",
"title": ""
},
{
"docid": "52c0ff9a944cde50f2edc97cabe4fa4a",
"score": "0.46808687",
"text": "def results(strength1, strength2)\n case strength1 <=> strength2\n when -1 then [second_character, first_character]\n when 1 then [first_character, second_character]\n end\n end",
"title": ""
},
{
"docid": "9181298d58f8bae27bd4a798c601aecb",
"score": "0.46808618",
"text": "def do_manual_output\n self.add_manual_actual\n prod_order = @domain.prod_orders.find(params[:prod_order_id])\n result = {\"success\" => true, \"message\" => \"Success\", \"actual_qty\" => prod_order.actual_qty} \n \n respond_to do |format|\n format.xml { render :xml => result } \n format.json { render :json => result }\n end\n end",
"title": ""
},
{
"docid": "e93f3a705b10665e228b232a5816b1de",
"score": "0.4675519",
"text": "def get_multivalue_result\r\n rawResult = read_line()\r\n\r\n if (rawResult[0..2] == \"200\") then\r\n rawResult.slice!(0..2)\r\n pairs = rawResult.split(' ')\r\n\r\n results = {}\r\n pairs.each do |pair|\r\n tmp = pair.split('=')\r\n results[tmp[0]] = tmp[1]\r\n end\r\n \r\n results\r\n else\r\n parse_result(rawResult)\r\n end\r\n end",
"title": ""
},
{
"docid": "6dd32083fe17a091a4b5bf13dac50a08",
"score": "0.4671108",
"text": "def format_output(options, result, output)\n format = \"%s\\nreturn %s, %s\"\n\n results = []\n results << options\n results << result\n\n if output.nil?\n results << 'nil'\n else\n results << \"'#{output.gsub(\"\\n\", '\\n')}'\"\n end\n\n return format % results\nend",
"title": ""
},
{
"docid": "528c6bab599b619d7c6fe66ea074fddd",
"score": "0.466962",
"text": "def to_s\n@result=0\n@result=(@m1+@m2+@m3)/3\nend",
"title": ""
},
{
"docid": "3563e6730720dea114ce6c5df23b38b3",
"score": "0.46663406",
"text": "def result\n strings = @groups.map {|x| x.result}\n result = combine(strings)\n result.each {|x| x.add_filled_group(@group_num, x)}\n result\n end",
"title": ""
},
{
"docid": "f5f191742fb668818ecd658650d9d9fa",
"score": "0.46450412",
"text": "def a_few_more_steps\n # Write a loop that outputs the first two sets of steps in the Two-Step\nend",
"title": ""
},
{
"docid": "b293314f2f3881d39034592de6e5e6b0",
"score": "0.4642725",
"text": "def act_smart\n \treturn \"E=mc^2\"\n end",
"title": ""
},
{
"docid": "519cefce7d2e777855a7aa7783647c09",
"score": "0.46304676",
"text": "def display_result(result)\n if result.length > 0\n t = {1 => \"B\", 2 => \"C\", 4 => \"T\", 8 => \"S\"}\n char_seq = result[0].map{|e| t[e]}\n @m.times do |i|\n @n.times do |j|\n putc char_seq[i*@n+j]\n end\n puts \"\"\n end\n else\n puts \"no result\"\n end\nend",
"title": ""
},
{
"docid": "a9817b6e2f2f02369e0439677bf49edc",
"score": "0.46303803",
"text": "def modeler_description\n return \"This measures looks for refrigeration compressors, checks the efficiency level and changes the curves with more efficient ones.\n - It starts looping through each refrigeration system.\n - For each of them it checks if it is Low Temperature or Medium Temperature, checking the operating temperature of a refrigeration case or walkin.\n - It checks what is the refrigerant for the system. This measure works only for the following refrigerants: 507, 404a, R22.\n - It extracts the compressors from the JSON file, corresponding to the appropriate system type (LT/MT) and refrigerant.\n - The following compressors were employed (https://climate.emerson.com/online-product-information/OPIServlet):\n MT: 404 -> Copeland ZS33KAE-PFV (single phase, 200/240 V, 60HZ)\n 507 -> Copeland ZS33KAE-PFV (single phase, 200/240 V, 60HZ)\n R22 -> Copeland CS18K6E-PFV (single phase, 200/240 V, 60HZ)\n LT: 404 -> Copeland RFT32C1E-CAV (single phase, 200/240 V, 60HZ)\n 507 -> Copeland ZF15K4E-PFV (single phase, 200/240 V, 60HZ)\n R22 -> Copeland LAHB-0311-CAB (single phase, 200/240 V, 60HZ)\n The EER for each compressor is listed in the JSON file.\n - Then the current compressors listed in the model are analyzed. The EERs are calculated and the average EER for the whole compressor rack is calculated.\n - If the average current EER is lower than the referenced EER in the JSON file, the compressors in the system are stripped away.\n - The total compressor capacity is calculated and the proper number of new, more efficient compressors is added to the system.\n - The EER and the total compressor capacities are calculated using power and capacity curves at the rating conditions (http://www.ahrinet.org/App_Content/ahri/files/STANDARDS/AHRI/AHRI_Standard_540_I-P_and_SI_2015.pdf).\"\n end",
"title": ""
},
{
"docid": "402943ed93140d0fff2f13cf62e31721",
"score": "0.4629869",
"text": "def getResultMessageLine1\n \n if @_domResultBody.nil?\n _getMessageFromResultDom\n end\n return @_sResultMessageLine1\n end",
"title": ""
},
{
"docid": "f12e467bfd927a22a95b979354c0373f",
"score": "0.46198264",
"text": "def display\n @result.inject('') do |msg,result|\n if result.is_a? String\n next msg if options[:quiet] && result =~ /^Validation failed:/\n msg += result\n elsif result.is_a? Hash\n msg += message_for result\n end\n \"#{msg}\\n\\n\"\n end\n end",
"title": ""
},
{
"docid": "b200625bfe1d68e25b384d4d2d36fc7d",
"score": "0.4619707",
"text": "def act_smart\n return \"E=mc^2\"\n end",
"title": ""
},
{
"docid": "f6579f8cf357027933c03fdad680c50f",
"score": "0.46176726",
"text": "def matrix2\r\n return Equation.new(<<-EOF\r\n <eq:HorizontalFencedPanel>\r\n <eq:MathTextBlock IsSymbol=\"True\">(</eq:MathTextBlock>\r\n <eq:MatrixPanel Columns=\"4\" Rows=\"4\">\r\n <eq:RowPanel>\r\n <eq:SubSupPanel>\r\n <eq:MathTextBlock FontStyle=\"Italic\" Margin=\"1\">tx</eq:MathTextBlock>\r\n <eq:EmptyElement/>\r\n <eq:MathTextBlock FontStyle=\"Italic\" FontSize=\"12\" Margin=\"1\">2</eq:MathTextBlock>\r\n <eq:EmptyElement/>\r\n </eq:SubSupPanel>\r\n <eq:MathTextBlock Margin=\"1\" FontStyle=\"Italic\">+ c</eq:MathTextBlock>\r\n </eq:RowPanel>\r\n <eq:MathTextBlock Margin=\"1\" FontStyle=\"Italic\">txy − sz</eq:MathTextBlock>\r\n <eq:MathTextBlock Margin=\"1\" FontStyle=\"Italic\">txz + sy</eq:MathTextBlock>\r\n <eq:MathTextBlock Margin=\"1\" FontStyle=\"Italic\">0</eq:MathTextBlock>\r\n <eq:MathTextBlock Margin=\"1\" FontStyle=\"Italic\">txy + sz</eq:MathTextBlock>\r\n <eq:RowPanel>\r\n <eq:SubSupPanel>\r\n <eq:MathTextBlock FontStyle=\"Italic\" Margin=\"1\">ty</eq:MathTextBlock>\r\n <eq:EmptyElement/>\r\n <eq:MathTextBlock FontStyle=\"Italic\" FontSize=\"12\" Margin=\"1\">2</eq:MathTextBlock>\r\n <eq:EmptyElement/>\r\n </eq:SubSupPanel>\r\n <eq:MathTextBlock Margin=\"1\" FontStyle=\"Italic\">+ c</eq:MathTextBlock>\r\n </eq:RowPanel>\r\n <eq:MathTextBlock Margin=\"1\" FontStyle=\"Italic\">tyz − sx</eq:MathTextBlock>\r\n <eq:MathTextBlock Margin=\"1\" FontStyle=\"Italic\">0</eq:MathTextBlock>\r\n <eq:MathTextBlock Margin=\"1\" FontStyle=\"Italic\">txz − sy</eq:MathTextBlock>\r\n <eq:MathTextBlock Margin=\"1\" FontStyle=\"Italic\">tyz + sx</eq:MathTextBlock>\r\n <eq:RowPanel>\r\n <eq:SubSupPanel>\r\n <eq:MathTextBlock FontStyle=\"Italic\" Margin=\"1\">tz</eq:MathTextBlock>\r\n <eq:EmptyElement/>\r\n <eq:MathTextBlock FontStyle=\"Italic\" FontSize=\"12\" Margin=\"1\">2</eq:MathTextBlock>\r\n <eq:EmptyElement/>\r\n </eq:SubSupPanel>\r\n <eq:MathTextBlock Margin=\"1\" FontStyle=\"Italic\">+ c</eq:MathTextBlock>\r\n </eq:RowPanel>\r\n <eq:MathTextBlock Margin=\"1\" FontStyle=\"Italic\">0</eq:MathTextBlock>\r\n <eq:MathTextBlock Margin=\"1\" FontStyle=\"Italic\">0</eq:MathTextBlock>\r\n <eq:MathTextBlock Margin=\"1\" FontStyle=\"Italic\">0</eq:MathTextBlock>\r\n <eq:MathTextBlock Margin=\"1\" FontStyle=\"Italic\">0</eq:MathTextBlock>\r\n <eq:MathTextBlock Margin=\"1\" FontStyle=\"Italic\">1</eq:MathTextBlock>\r\n </eq:MatrixPanel>\r\n <eq:MathTextBlock IsSymbol=\"True\">)</eq:MathTextBlock>\r\n </eq:HorizontalFencedPanel>\r\n EOF\r\n )\r\n end",
"title": ""
},
{
"docid": "fb9c886edfd17df2b78a11a1561187d2",
"score": "0.46162894",
"text": "def print_output(result)\n @output.each do |param|\n sym = param[:symbol]\n puts \"#{sym}: #{result[sym]}\"\n end\n \n end",
"title": ""
},
{
"docid": "98058e7bad52b6e3a563e92c87bf9c20",
"score": "0.46135128",
"text": "def query1 \n phase1 = 0\n process_switch(@oid) do |oid,value|\n case oid.to_str\n when @oid[0]; #Frequency\n f = value.to_i\n f_status = (f >= FREQUENCY_MIN && f <= FREQUENCY_MAX) ? 'ok' : 'Critical' \n @txt_result += \"Frequency #{f/10.0} #{f_status}\\n\"\n @status = worse_than(f_status)\n when @oid[1]; #Input voltage\n v = value.to_i\n v_status = (v >= VOLTAGE_LOW && v <= VOLTAGE_HIGH) ? 'ok' : 'Critical' \n @txt_result += \"Phase #{oid[-1]} Voltage #{v/10.0} #{v_status}\\n\"\n @status = worse_than(v_status)\n when @oid[2]; #Input Current\n a_status = value.to_i <= SINGLE_PHASE_CURRENT_MAX ? 'ok' : 'Critical' \n @txt_result += \"Phase #{oid[-1]} #{value.to_i/10.0} Amps #{a_status}\\n\"\n @status = worse_than(a_status)\n when @oid[3];\n @txt_result += \"Power Factor #{value.to_i/100.0}\\n\"\n when @oid[4];\n @txt_result += \"Total Power #{value.to_i/100.0} KW\\n\"\n when @oid[5], @oid[6], @oid[7], @oid[8], @oid[9], @oid[10];\n milliamps = value.to_i*100\n a_status = milliamps <= OUTLET_CURRENT_WARN ? 'ok' : (milliamps > OUTLET_CURRENT_MAX ? 'Critical' : 'Non-critical')\n @txt_result += \"Outlet Pair #{oid[-2] - 1} #{milliamps/1000.0} Amps #{a_status}\\n\"\n @status = worse_than(a_status)\n end\n end\n end",
"title": ""
},
{
"docid": "412e99817352ba26dca41e69c22407b4",
"score": "0.46132275",
"text": "def displayResult(input_lines,output_lines)\n\tputs \"Input:\t \"\n\tfor i in 0..input_lines.length-1\n\t\tputs \"#{input_lines[i]}\"\n\tend\n\tputs \"Output:\t \"\n\tputs \"#{output_lines}\"\nend",
"title": ""
},
{
"docid": "0033afc5cf290c8d353a72b5c5ab82d3",
"score": "0.4603829",
"text": "def run()\n @actual_output = SpeechProcessor.convert_to_code(@input, @language_context)\n \n code_no_white = @actual_output.gsub(/\\s+/, \"\")\n output_no_white = @output.gsub(/\\s+/, \"\")\n content_distance = Levenshtein.distance(code_no_white, output_no_white)\n \n code_white = @actual_output.gsub(/\\S+/, \"\")\n output_white = @output.gsub(/\\S+/, \"\")\n white_distance = Levenshtein.distance(code_white, output_white)\n \n if @actual_output == @output\n @result = true\n @details = \"\"\n else\n @result = false\n if @actual_output.casecmp(@output) == 0\n @details = \"Case wrong, everything else OK\"\n elsif white_distance == 0\n @details = \"Content wrong (distance #{content_distance}), whitespace OK\"\n elsif content_distance == 0\n @details = \"Whitespace wrong (distance #{white_distance}), content OK\"\n else\n @details = \"Content and whitespace wrong \" +\n \"(distance #{content_distance} cont, #{white_distance} white)\"\n end\n end\n \n return @result, @details\n end",
"title": ""
},
{
"docid": "91e65f95cb1f95337501a9010c2a7a42",
"score": "0.46030807",
"text": "def results(round, first, second)\n puts \">> Round #{round} results:\"\n puts \">> #{@player1.name}: #{first}\"\n puts \">> #{@player2.name}: #{second}\"\n end",
"title": ""
},
{
"docid": "a7f71aff9082f35d5c204353df100b46",
"score": "0.46011877",
"text": "def propertyEstimateCheck(output, prop_estimate, comps_estimates, data_source)\r\n output[data_source.to_sym][:dataSource] << data_source.to_s\r\n output[data_source.to_sym][:metricsUsage] << \"Typicality\"\r\n output[data_source.to_sym][:metricsNames] << \"Estimate Typicality - Comps\"\r\n\r\n # If the property estimate is not present\r\n if prop_estimate.nil?\r\n output[data_source.to_sym][:metrics] << 0\r\n output[data_source.to_sym][:metricsPass] << false\r\n output[data_source.to_sym][:metricsComments] << \"Property Estimate Not Available\"\r\n return\r\n end\r\n\r\n # Estimates\r\n comps_est_values = comps_estimates.compact\r\n\r\n if comps_est_values.length == 0 # lacking zest comp data\r\n output[data_source.to_sym][:metrics] << 0\r\n output[data_source.to_sym][:metricsPass] << false\r\n output[data_source.to_sym][:metricsComments] << \"No comp ests found\"\r\n return\r\n end\r\n\r\n # Compute values and save\r\n comp_est_mean = comps_est_values.mean.round(2)\r\n comp_est_med = comps_est_values.median.round(2)\r\n\r\n est_ratio = (((prop_estimate/comp_est_mean)-1).to_f*100.0).round(2)\r\n pass = (est_ratio.abs <= EST_THRES)\r\n comment = \"Estimate must be within #{EST_THRES}% | Prop: #{prop_estimate} | Ave: #{comp_est_mean}; Med: #{comp_est_med}\"\r\n\r\n output[data_source.to_sym][:metrics] << est_ratio\r\n output[data_source.to_sym][:metricsPass] << pass\r\n output[data_source.to_sym][:metricsComments] << comment \r\n end",
"title": ""
},
{
"docid": "794cde5ae37aa293d8cc0ab90e736242",
"score": "0.46003273",
"text": "def *(com2)\n\n\t\tComplejo.new(@r * com2.r - @m * com2.m, @r * com2.m + @m * com2.r).to_s\n\n\tend",
"title": ""
},
{
"docid": "c57731af007816cb04fe4ddb04172e3b",
"score": "0.45915952",
"text": "def finish_production\n msg = Message.new\n #end_product = {part_id: @kanban.part_id, quantity: @kanban.quantity}\n #raw_materials = []\n #@kanban.get_raw_materials.each { |raw_material|\n # raw_materials << {part_id: raw_material.part_id, quantity: raw_material.quantity * @kanban.quantity}\n #}\n #TODO Move storage for both end products and raw materials\n render json: msg\n end",
"title": ""
},
{
"docid": "be7b64083790b24606c4983757916aa5",
"score": "0.45888618",
"text": "def run(output_list, grammar)\n failed_winner = choose_failed_winner(output_list, grammar)\n mrcd_result = @erc_learner.run([failed_winner], grammar)\n changed = mrcd_result.any_change?\n unless changed\n msg1 = 'A failed consistent winner'\n msg2 = 'did not provide new ranking information.'\n raise MMREx.new(failed_winner), \"#{msg1} #{msg2}\"\n end\n newly_added_wl_pairs = mrcd_result.added_pairs\n MmrSubstep.new(newly_added_wl_pairs, failed_winner, changed)\n end",
"title": ""
},
{
"docid": "b56f07126af9a16fe477e25606327234",
"score": "0.45842212",
"text": "def parse_effect_result(line)\n result_type, details = line.split /\\]/\n effect = /\\s\\{\\d*\\}\\:\\s(.+)\\s\\{/.match(result_type)[1].downcase.to_sym\n amount, type, _ = /\\((.*)\\)/.match(details)[1].split /\\s+/\n {effect: {effect => {amount: amount.to_i, type: type}}}\n end",
"title": ""
},
{
"docid": "a32e3bb9a1264538a700a4c7ffeadd4a",
"score": "0.45810488",
"text": "def get_values_for_test_result_message(expectation_statement)\n test_result_message = \"\"\n if (expectation_statement.include?(\"EquivalentXml.equivalent\"))\n value = expectation_statement.split('==')\n value[0] = value[1]\n expectation_statement = \"#{value[0]} == #{value[1]}\"\n else\n @dynamic_params_list.each do |param|\n if /@#{param}\\b/.match(expectation_statement) #expectation_statement.include?(\"@#{param}\")\n param_value = eval(\"@#{param}\")\n value_class = param_value.class\n value_class = value_class.to_s\n if value_class == \"Array\"\n value = \"\"\n param_value.each { |element| value << element.to_s + \",\" }\n param_value = value.to_s.chop\n else\n param_value = param_value.to_s\n end\n expectation_statement = expectation_statement.gsub(/@#{param}/, param_value)\n end\n end\n end\n expectation_statement\n end",
"title": ""
},
{
"docid": "3273288c4fcfebbe23db3e35cb75bd2c",
"score": "0.45776394",
"text": "def bolsablue_output\n n = 27\n bol_discount = 0.97\n bolsa_delay_add = 1.01\n payo_discount = 0.967\n net_ticket = 375\n sell_ticket = 396.2\n\n real = (@blue.sell * bol_discount).round(2)\n profit = n * (real * net_ticket * payo_discount - @bolsa.sell * bolsa_delay_add * sell_ticket)\n now = Time.now.localtime.strftime(\"%H:%M:%S\")\n\n <<-OUTPUT\nBolsa[#{@bolsa.sell_output}] Blue[#{@blue.sell_output}] Gap[#{gap_bolsa_percent}%] #{now}\n#{profit.round(0)}=#{n}*(#{real}*#{net_ticket}*#{payo_discount}-#{@bolsa.sell}*#{bolsa_delay_add}*#{sell_ticket})\n OUTPUT\n end",
"title": ""
},
{
"docid": "be6f9097a133267775aa4d8a09b00e5c",
"score": "0.45676658",
"text": "def _test_2\n\t outputString = \"test_2 on \" + @commandMap[\"listName\"] + \": \"\n print outputString\n\t printValue(@listMap[@commandMap[\"listName\"]].select{|elem| ((elem.length > 3 && elem.length < 6) || elem.length > 7)})\n return true\n end",
"title": ""
},
{
"docid": "6bbcc6b89938b0e8c44c3fde64f4fe20",
"score": "0.45659024",
"text": "def OrderResults(data)\n\n\tputs \"Order Summary\"\n\tputs \"===================\"\n\tputs \"Items ordered: #{data[0]}\"\n\tputs \"Ready to ship: #{data[1]}\"\n\tif data[2] == \"y\"\n\tputs \"On backorder: #{data[0]-data[1]}\\n\"\n\tend\n\n\tputs \"Subtotal: $#{data[1] * 100}\"\n\tputs \"Shipping: $#{data[1] * 10}\"\n\tputs \"Total Due: $#{(data[1] * 100) + (data[1] * 10)}\"\nend",
"title": ""
},
{
"docid": "bc0d9b757cf265fcc21369f0b11b323c",
"score": "0.4561398",
"text": "def query3\n phase1 = phase2 = phase3 = 0\n process_switch(@oid) do |oid,value|\n case oid.to_str\n when @oid[0]; #Frequency\n f = value.to_i\n f_status = (f >= FREQUENCY_MIN && f <= FREQUENCY_MAX) ? 'ok' : 'Critical' \n @txt_result += \"Frequency #{f/10.0} #{f_status}\\n\"\n @status = worse_than(f_status)\n when @oid[1],@oid[2],@oid[3]; #Input voltage\n v = value.to_i\n v_status = (v >= VOLTAGE_LOW && v <= VOLTAGE_HIGH) ? 'ok' : 'Critical' \n @txt_result += \"Phase #{oid[-1]} Voltage #{v/10.0} #{v_status}\\n\"\n @status = worse_than(v_status)\n when @oid[4],@oid[5],@oid[6]; #Input Current\n a_status = value.to_i <= PHASE_CURRENT_MAX ? 'ok' : 'Critical' \n @txt_result += \"Phase #{oid[-1]} #{value.to_i/10.0} Amps #{a_status}\\n\"\n @status = worse_than(a_status)\n when @oid[7];\n @txt_result += \"Power Factor #{value.to_i/100.0}\\n\"\n when @oid[8];\n @txt_result += \"Total Power #{value.to_i/100.0} KW\\n\"\n when @oid[9], @oid[10], @oid[11], @oid[12], @oid[13], @oid[14];\n milliamps = value.to_i*100\n a_status = milliamps <= OUTLET_CURRENT_WARN ? 'ok' : (milliamps > OUTLET_CURRENT_MAX ? 'Critical' : 'Non-critical')\n @txt_result += \"Outlet Pair #{oid[-2] - 1} #{milliamps/1000.0} Amps #{a_status}\\n\"\n @status = worse_than(a_status)\n end\n end\n end",
"title": ""
},
{
"docid": "0a9cf63a4a5a1e922cef09c4547def86",
"score": "0.4558048",
"text": "def print_to_file(measure_name, hqmf_model, simple_xml_model, hqmf_json_orig, simple_xml_json_orig)\n outfile = File.join(\"#{RESULTS_DIR}\", \"#{measure_name}_orig_hqmf.json\")\n File.open(outfile, 'w') { |f| f.write(JSON.pretty_generate(hqmf_json_orig)) }\n outfile = File.join(\"#{RESULTS_DIR}\", \"#{measure_name}_orig_simplexml.json\")\n File.open(outfile, 'w') { |f| f.write(JSON.pretty_generate(simple_xml_json_orig)) }\n\n outfile = File.join(\"#{RESULTS_DIR}\", \"#{measure_name}_crit_diff.json\")\n File.open(outfile, 'w') do|f|\n f.puts \">>>>>> HQMF ONLY: \"\n f.puts((hqmf_model.all_data_criteria.collect(&:id) - simple_xml_model.all_data_criteria.collect(&:id)).sort)\n f.puts\n f.puts \">>>>>> SIMPLE ONLY: \"\n f.puts((simple_xml_model.all_data_criteria.collect(&:id) - hqmf_model.all_data_criteria.collect(&:id)).sort)\n f.puts\n f.puts \">>>>>> HQMF ONLY (SOURCE): \"\n f.puts((hqmf_model.source_data_criteria.collect(&:id) - simple_xml_model.source_data_criteria.collect(&:id)).sort)\n f.puts\n f.puts \">>>>>> SIMPLE ONLY (SOURCE): \"\n f.puts((simple_xml_model.source_data_criteria.collect(&:id) - hqmf_model.source_data_criteria.collect(&:id)).sort)\n end\n end",
"title": ""
},
{
"docid": "04dd745d85ac792b470bc3ee78658958",
"score": "0.4556669",
"text": "def package_formatter(best_price_combo, order_code_and_quantity, result, single_pack)\n format = []\n best_price_combo[:best_combination].each do |key, value|\n format <<\n {\n :qty => value,\n :pack => key,\n :each_pack =>\n single_pack.map {|x| x.values}.to_h.select {|t| t == key}.values.first\n }\n\n end\n\n result << {\n :summery => {\n :total => best_price_combo[:total].round(2),\n :sku_number => order_code_and_quantity[:code],\n :qty => order_code_and_quantity[:qty]\n },\n :line_items => format\n }\n end",
"title": ""
},
{
"docid": "0665b5b53c7dbce9e5bcf6b7bc8db20d",
"score": "0.45557666",
"text": "def format_result result\n result_prompt + result.inspect\n end",
"title": ""
},
{
"docid": "bcbf51e1d0fc04007acd9a873e65f8c1",
"score": "0.45490757",
"text": "def result_messages(q, op_type)\n \n # Get current sttaus of mobily gateway\n if op_type == 0\n \n if q == '1'\n result = \"Service is available\" \n else\n result = \"Service is not available\"\n end\n \n # Get current balance\n elsif op_type == 1 \n \n case q\n when '1'\n result = \"username is incorrect, please make sure that the username is the same name that you use to access mobily.ws\"\n when '2'\n result = \"password is incorrect, please make sure that the password is the same passowrd that you use to access mobily.ws\"\n when '-1'\n result = \"Communication with Server Failed.\"\n when '-2'\n result = \"Communication with Database Failed.\"\n else\n current_balance = q.split('/')\n result = \"Mobily current balance: #{current_balance[1]} of #{current_balance[0]}\"\n end\n \n # Send message \n elsif op_type == 2\n \n case q\n when '1'\n result = \"Message has been sent successfully.\"\n when '2'\n result = \"Balance = 0\"\n when '3'\n result = \"insufficient balance\"\n when '4'\n result = \"Mobile Number Not Available\"\n when '5'\n result = \"Password is incorrect\"\n when '6'\n result = \"Web page ineffective, try sending again\"\n when '13'\n result = \"The sender name is not acceptable\"\n when '14'\n result = \"The sender name is not active\"\n when '15'\n result = \"Invalid or empty numbers\"\n when '16'\n result = \"Sender name is empty\"\n when '17'\n result = \"The text of the message is not encrypted properly\"\n when '-1'\n result = \"Communication with Database Failed.\"\n when '-2'\n result = \"Communication with Server Failed.\"\n else\n result = q\n end\n \n end\n \n \n end",
"title": ""
},
{
"docid": "39fe2229e7de12eecdccfd0a64598e2a",
"score": "0.4547311",
"text": "def summary\r\n \r\n @ph_product = PhProduct.find(params[:ph_result_id])\r\n @product = @ph_product.product\r\n @step = 1 \r\n if @ph_product.ph_intermediate_result \r\n if !@ph_product.ph_result\r\n ph_result = PhResult.new \r\n ph_result.ph_product_id = @ph_product.id\r\n ph_result.save\r\n @ph_product.ph_result = ph_result\r\n end\r\n @ph_result = @ph_product.ph_result\r\n if !@ph_product.ph_maintenance_result \r\n ph_maintenance_result = PhMaintenanceResult.new \r\n ph_maintenance_result.ph_product_id = @ph_product.id\r\n ph_maintenance_result.save\r\n @ph_product.ph_maintenance_result = ph_maintenance_result \r\n end\r\n @ph_maintenance_result = @ph_product.ph_maintenance_result \r\n if !@ph_product.ph_embedded_result \r\n ph_embedded_result = PhEmbeddedResult.new \r\n ph_embedded_result.ph_product_id = @ph_product.id\r\n ph_embedded_result.save\r\n @ph_product.ph_embedded_result = ph_embedded_result \r\n end\r\n @ph_embedded_result = @ph_product.ph_embedded_result \r\n \r\n\r\n @ph_embedded_result.temperature_induced = 0\r\n temp = 0\r\n if @ph_product.ph_specified.ph_module_type.name == 'amorphous Silicon'\r\n temp = -0.13\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'polycrystalline Silicon'\r\n temp = -0.4465\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'monocrystalline Silicon'\r\n temp = -0.402545\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CdTe Thinfilm'\r\n temp = -0.25\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CIS/CIGS Thinfilm'\r\n temp = -0.43666\r\n end\r\n \r\n @ph_embedded_result.temperature_induced = temp * (@ph_product.ph_basic_information.temperature - 25) \r\n calcul_efficiency = @ph_product.ph_specified.efficiency * (1 + (@ph_embedded_result.temperature_induced / 100))\r\n \r\n ph_database_material_values = PhDatabaseMaterialValue.find(:all, :conditions => [\"ph_product_id = ?\", @ph_product.id])\r\n ph_database_material_values.each do |ph_database_material_value|\r\n ph_database_material_value.delete\r\n end \r\n \r\n\r\n @ph_database_materials = PhDatabaseMaterial.all \r\n @ph_database_materials.each do |ph_database_material|\r\n if ph_database_material.default_value_co2 == 0\r\n calculate_co2 ph_database_material, @ph_product\r\n end\r\n if ph_database_material.default_value_pe == 0\r\n calculate_pe ph_database_material, @ph_product\r\n end \r\n end\r\n @ph_database_material_values = PhDatabaseMaterialValue.find(:all, :conditions => [\"ph_product_id = ?\", @ph_product.id])\r\n \r\n n49 = 0\r\n if @ph_product.ph_specified.area_unit\r\n n49 = @ph_product.ph_specified.area * @ph_product.ph_specified.area_unit.conversion_factor\r\n end \r\n # ph_result lifetime\r\n \r\n if @ph_product.ph_basic_information.known == 'both' || @ph_product.ph_basic_information.known == 'power_demand'\r\n #Menues!N56*Assumptions!F39\r\n @ph_result.lifetime = 0\r\n n56 = 0\r\n\r\n if @ph_product.ph_specified.ph_module_type.name != 'Not specified'\r\n if @ph_product.ph_specified.power_unit.conversion_factor == -1 \r\n # Peak Power [kWp]\r\n conversion_factor = @ph_product.ph_basic_information.radiation * @ph_product.ph_basic_information.performance_ratio\r\n n56 = @ph_product.ph_specified.power * conversion_factor\r\n else \r\n n56 = @ph_product.ph_specified.power * @ph_product.ph_specified.power_unit.conversion_factor\r\n end \r\n @ph_result.lifetime = n56 * @ph_product.ph_specified.lifetime\r\n end\r\n else\r\n @ph_result.lifetime = n49 * (calcul_efficiency / 100) * @ph_product.ph_basic_information.performance_ratio * @ph_product.ph_basic_information.radiation * @ph_product.ph_specified.lifetime\r\n end\r\n\r\n @ph_result.cabling = 0\r\n temp = 0\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Mounted' || @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Integrated'\r\n temp = get_database_material_result_co2 'Electrical Cabling', 'Roof Mounted System', @ph_product \r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Integrated' || @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Mounted'\r\n temp = get_database_material_result_co2 'Electrical Cabling', 'Facade Mounted System', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Open Ground'\r\n temp = get_database_material_result_co2 'Electrical Cabling', 'Ground Mounted System', @ph_product\r\n end\r\n\r\n logger.info 'temp --> ' + temp.to_s\r\n logger.info 'n49 --> ' + n49.to_s\r\n\r\n \r\n @ph_result.cabling = temp * @ph_product.ph_intermediate_result.module_area\r\n\r\n\r\n @ph_result.module = 0\r\n if @ph_product.ph_specified.ph_module_type.name == 'amorphous Silicon'\r\n # B17\r\n temp = get_database_material_result_co2 'a-Si', 'Module Laminate', @ph_product\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'polycrystalline Silicon'\r\n # B15\r\n temp = get_database_material_result_co2 'p-Si', 'Total Module Laminate', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'monocrystalline Silicon'\r\n # B8\r\n temp = get_database_material_result_co2 'm-Si', 'Total Module Laminate', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CdTe Thinfilm'\r\n # B2\r\n temp = get_database_material_result_co2 'CdTe', 'Thinfilm', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CIS/CIGS Thinfilm'\r\n # B19\r\n temp = get_database_material_result_co2 'CIS/CIGS', 'Module Laminate', @ph_product \r\n end\r\n @ph_result.module = temp * @ph_product.ph_intermediate_result.module_area\r\n\r\n @ph_result.framing = 0\r\n if @ph_product.ph_basic_information.framed == 'yes'\r\n if @ph_product.ph_specified.ph_module_type.name == 'amorphous Silicon'\r\n # B18 - B17\r\n temp = (get_database_material_result_co2 'a-Si', 'Module Framed Panel', @ph_product) - (get_database_material_result_co2 'a-Si', 'Module Laminate', @ph_product)\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'polycrystalline Silicon'\r\n # B14\r\n temp = get_database_material_result_co2 'p-Si', 'Module/Framed Panel', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'monocrystalline Silicon'\r\n # B7\r\n temp = get_database_material_result_co2 'm-Si', 'Module/Framed Panel', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CIS/CIGS Thinfilm'\r\n # B20 - B19\r\n temp = (get_database_material_result_co2 'CIS/CIGS', 'Module Framed Panel', @ph_product) - (get_database_material_result_co2 'CIS/CIGS', 'Module Laminate', @ph_product) \r\n end \r\n if @ph_product.ph_specified.ph_module_type.name == 'CdTe Thinfilm'\r\n # B2\r\n temp = 0 \r\n end \r\n @ph_result.framing = temp * @ph_product.ph_intermediate_result.module_area\r\n end\r\n \r\n # ph_result mounting\r\n @ph_result.mounting = 0 \r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Mounted'\r\n #B24\r\n temp = get_database_material_result_co2 'Mounting', 'Roof Mounted Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Integrated'\r\n #B25\r\n temp = get_database_material_result_co2 'Mounting', 'Roof Integrated Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Mounted'\r\n #B27\r\n temp = get_database_material_result_co2 'Mounting', 'Facade Mounted Structures', @ph_product \r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Integrated'\r\n #B28\r\n temp = get_database_material_result_co2 'Mounting', 'Facade Integrated Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Open Ground'\r\n #B26\r\n temp = get_database_material_result_co2 'Mounting', 'Open Ground Structures', @ph_product\r\n end \r\n @ph_result.mounting = temp * @ph_product.ph_intermediate_result.module_area\r\n \r\n \r\n # ph_result inverter\r\n @ph_result.inverter = 0 \r\n if @ph_product.ph_electric_component.quantity_1 != 0\r\n temp = get_database_material_result_co2 'Electrics', '1x Inverter Type 1', @ph_product\r\n @ph_result.inverter += temp * @ph_product.ph_electric_component.quantity_1\r\n end\r\n if @ph_product.ph_electric_component.quantity_2 != 0\r\n temp = get_database_material_result_co2 'Electrics', '1x Inverter Type 2', @ph_product\r\n @ph_result.inverter += temp * @ph_product.ph_electric_component.quantity_2\r\n end\r\n \r\n \r\n # ph_result batteries\r\n @ph_result.batteries = 0 \r\n pes_1 = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [kg / pc.]', @ph_product\r\n pes_2 = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [per kg]', @ph_product\r\n @ph_result.batteries = @ph_product.ph_electric_component.separated_battery * pes_1 * pes_2\r\n \r\n # ph_result maintenance\r\n @ph_result.maintenance = 0 \r\n \r\n \r\n @ph_result.co2_total = @ph_result.cabling + @ph_result.module + @ph_result.framing + @ph_result.mounting + @ph_result.inverter + @ph_result.batteries\r\n\r\n ###########\r\n ### MAINTENANCE\r\n #########\r\n \r\n @ph_maintenance_result.years_included = 0\r\n if @ph_product.ph_maintenance.maintenance_needs == 'yes_5'\r\n @ph_maintenance_result.years_included = 5\r\n end\r\n if @ph_product.ph_maintenance.maintenance_needs == 'yes_10'\r\n @ph_maintenance_result.years_included = 10\r\n end\r\n if @ph_product.ph_maintenance.maintenance_needs == 'yes_15'\r\n @ph_maintenance_result.years_included = 15\r\n end\r\n if @ph_product.ph_maintenance.maintenance_needs == 'yes_20'\r\n @ph_maintenance_result.years_included = 20\r\n end\r\n \r\n # boolean\r\n @ph_maintenance_result.inverter_replacement = 0\r\n if @ph_maintenance_result.years_included != 0\r\n if @ph_product.ph_maintenance.replacement_inverters == 'yes'\r\n @ph_maintenance_result.inverter_replacement = 1 \r\n end \r\n end\r\n\r\n # boolean\r\n @ph_maintenance_result.batteries_replacement = 0\r\n if @ph_product.ph_maintenance.replacement_batteries == 'yes'\r\n @ph_maintenance_result.batteries_replacement = 1 \r\n end \r\n \r\n @ph_maintenance_result.tap_water_l = 0\r\n if @ph_product.ph_maintenance.cleaning_modules == 'yes'\r\n @ph_maintenance_result.tap_water_l = 3.25\r\n end\r\n \r\n @ph_maintenance_result.tap_water_co2 = 0\r\n #b38\r\n temp = get_database_material_result_co2 'Maintenance', 'Tap Water', @ph_product\r\n @ph_maintenance_result.tap_water_co2 = temp * @ph_maintenance_result.tap_water_l\r\n \r\n @ph_maintenance_result.tap_water_pe = 0\r\n #c38\r\n temp = get_database_material_result_pe 'Maintenance', 'Tap Water', @ph_product\r\n @ph_maintenance_result.tap_water_pe = temp * @ph_maintenance_result.tap_water_l\r\n \r\n \r\n @ph_maintenance_result.needed_cycles_1 = 0\r\n if @ph_product.ph_electric_component.inverter_size_1 != 0 && @ph_product.ph_electric_component.quantity_1 != 0 \r\n if @ph_maintenance_result.inverter_replacement == 1 \r\n @ph_maintenance_result.needed_cycles_1 = (@ph_maintenance_result.years_included / @ph_product.ph_electric_component.lifetime_1) - 1\r\n if @ph_maintenance_result.needed_cycles_1 < 0\r\n @ph_maintenance_result.needed_cycles_1 = 0\r\n else \r\n @ph_maintenance_result.needed_cycles_1 = @ph_maintenance_result.needed_cycles_1.ceil \r\n end\r\n end\r\n end\r\n @ph_maintenance_result.needed_replacements_1 = @ph_maintenance_result.needed_cycles_1 * @ph_product.ph_electric_component.quantity_1\r\n \r\n @ph_maintenance_result.embodied_co2_1 = 0\r\n # B29\r\n temp = get_database_material_result_co2 'Electrics', '1x Inverter Type 1', @ph_product\r\n @ph_maintenance_result.embodied_co2_1 = temp * @ph_maintenance_result.needed_replacements_1 \r\n @ph_maintenance_result.embodied_pe_1 = 0\r\n # C29\r\n temp = get_database_material_result_pe 'Electrics', '1x Inverter Type 1', @ph_product\r\n @ph_maintenance_result.embodied_pe_1 = temp * @ph_maintenance_result.needed_replacements_1\r\n\r\n \r\n @ph_maintenance_result.needed_cycles_2 = 0\r\n if @ph_product.ph_electric_component.inverter_size_2 != 0 && @ph_product.ph_electric_component.quantity_2 != 0 \r\n if @ph_maintenance_result.inverter_replacement == 1 \r\n @ph_maintenance_result.needed_cycles_2 = (@ph_maintenance_result.years_included / @ph_product.ph_electric_component.lifetime_2) - 1\r\n if @ph_maintenance_result.needed_cycles_2 < 0\r\n @ph_maintenance_result.needed_cycles_2 = 0\r\n else \r\n @ph_maintenance_result.needed_cycles_2 = @ph_maintenance_result.needed_cycles_2.ceil\r\n end \r\n end\r\n end\r\n @ph_maintenance_result.needed_replacements_2 = @ph_maintenance_result.needed_cycles_2 * @ph_product.ph_electric_component.quantity_2\r\n \r\n @ph_maintenance_result.embodied_co2_2 = 0\r\n # B29\r\n temp = get_database_material_result_co2 'Electrics', '1x Inverter Type 2', @ph_product\r\n @ph_maintenance_result.embodied_co2_2 = temp * @ph_maintenance_result.needed_replacements_2\r\n \r\n @ph_maintenance_result.embodied_pe_2 = 0\r\n # C29\r\n temp = get_database_material_result_pe 'Electrics', '1x Inverter Type 2', @ph_product\r\n @ph_maintenance_result.embodied_pe_2 = temp * @ph_maintenance_result.needed_replacements_2\r\n \r\n \r\n \r\n @ph_maintenance_result.driven_maintenance = 2 * @ph_product.ph_maintenance.distance\r\n @ph_maintenance_result.driven_year = @ph_maintenance_result.driven_maintenance * @ph_product.ph_maintenance.yearly_frequency\r\n @ph_maintenance_result.driven_contract = @ph_maintenance_result.driven_year * @ph_maintenance_result.years_included\r\n \r\n @ph_maintenance_result.embodied_co2_transport = 0 \r\n #B35\r\n temp = get_database_material_result_co2 'Maintenance', 'Average Car Driving', @ph_product\r\n @ph_maintenance_result.embodied_co2_transport = @ph_maintenance_result.driven_contract * temp\r\n \r\n @ph_maintenance_result.embodied_pe_transport = 0\r\n #C35\r\n temp = get_database_material_result_pe 'Maintenance', 'Average Car Driving', @ph_product\r\n @ph_maintenance_result.embodied_pe_transport = @ph_maintenance_result.driven_contract * temp\r\n \r\n @ph_maintenance_result.embodied_co2_cleaning = @ph_product.ph_intermediate_result.module_area * @ph_maintenance_result.tap_water_co2\r\n @ph_maintenance_result.embodied_pe_cleaning = @ph_product.ph_intermediate_result.module_area * @ph_maintenance_result.tap_water_pe\r\n @ph_maintenance_result.total_embodied_co2_cleaning = @ph_maintenance_result.embodied_co2_cleaning * @ph_maintenance_result.years_included * @ph_product.ph_maintenance.yearly_frequency\r\n @ph_maintenance_result.total_embodied_pe_cleaning = @ph_maintenance_result.embodied_pe_cleaning * @ph_maintenance_result.years_included * @ph_product.ph_maintenance.yearly_frequency\r\n \r\n @ph_maintenance_result.needed_cycles_batteries = 0\r\n if @ph_maintenance_result.batteries_replacement == 1\r\n @ph_maintenance_result.needed_cycles_batteries = (@ph_maintenance_result.years_included / @ph_product.ph_electric_component.battery_lifetime) - 1\r\n if @ph_maintenance_result.needed_cycles_batteries < 0\r\n @ph_maintenance_result.needed_cycles_batteries = 0\r\n else \r\n @ph_maintenance_result.needed_cycles_batteries = @ph_maintenance_result.needed_cycles_batteries.ceil\r\n end \r\n end\r\n \r\n @ph_maintenance_result.needed_replacements_batteries = @ph_maintenance_result.needed_cycles_batteries * @ph_product.ph_electric_component.separated_battery\r\n \r\n @ph_maintenance_result.embodied_co2_batteries = 0\r\n #B31\r\n temp = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [kg / pc.]', @ph_product\r\n #B32 \r\n temp_2 = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [per kg]', @ph_product\r\n @ph_maintenance_result.embodied_co2_batteries = @ph_maintenance_result.needed_replacements_batteries * temp * temp_2\r\n \r\n @ph_maintenance_result.embodied_pe_batteries = 0 \r\n #B31\r\n temp = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [kg / pc.]', @ph_product\r\n #C32 \r\n temp_2 = get_database_material_result_pe 'Electrics Battery', 'Lead Acid [per kg]', @ph_product\r\n @ph_maintenance_result.embodied_pe_batteries = @ph_maintenance_result.needed_replacements_batteries * temp * temp_2\r\n \r\n @ph_maintenance_result.embodied_carbon_dioxide = 0\r\n @ph_maintenance_result.embodied_primary_energy = 0\r\n if @ph_product.ph_maintenance.maintenance_needs != 'no'\r\n @ph_maintenance_result.embodied_carbon_dioxide = @ph_maintenance_result.embodied_co2_1 + @ph_maintenance_result.embodied_co2_2 + @ph_maintenance_result.embodied_co2_transport + @ph_maintenance_result.total_embodied_co2_cleaning + @ph_maintenance_result.embodied_co2_batteries\r\n @ph_maintenance_result.embodied_primary_energy = @ph_maintenance_result.embodied_pe_1 + @ph_maintenance_result.embodied_pe_2 + @ph_maintenance_result.embodied_pe_transport + @ph_maintenance_result.total_embodied_pe_cleaning + @ph_maintenance_result.embodied_pe_batteries \r\n end\r\n @ph_result.maintenance = @ph_maintenance_result.embodied_carbon_dioxide\r\n @ph_embedded_result.pe_maintenance = @ph_maintenance_result.embodied_primary_energy\r\n ##########\r\n ### EMBEDDED\r\n ##########\r\n\r\n @ph_embedded_result.lifetime_saved = @ph_result.lifetime * 3.6 / @ph_product.ph_basic_information.conversion_factor\r\n \r\n @ph_embedded_result.pe_pv_cabling = 0\r\n temp = 0\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Mounted' || @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Integrated'\r\n #C22\r\n temp = get_database_material_result_pe 'Electrical Cabling', 'Roof Mounted System', @ph_product \r\n end \r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Integrated' || @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Mounted'\r\n #C21\r\n temp = get_database_material_result_pe 'Electrical Cabling', 'Facade Mounted System', @ph_product\r\n end \r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Open Ground'\r\n #C23\r\n temp = get_database_material_result_pe 'Electrical Cabling', 'Ground Mounted System', @ph_product\r\n end \r\n @ph_embedded_result.pe_pv_cabling = temp * @ph_product.ph_intermediate_result.module_area\r\n \r\n \r\n @ph_embedded_result.pe_pv_module = 0\r\n if @ph_product.ph_specified.ph_module_type.name == 'amorphous Silicon'\r\n # B17\r\n temp = get_database_material_result_pe 'a-Si', 'Module Laminate', @ph_product\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'polycrystalline Silicon'\r\n # B15\r\n temp = get_database_material_result_pe 'p-Si', 'Total Module Laminate', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'monocrystalline Silicon'\r\n # B8\r\n temp = get_database_material_result_pe 'm-Si', 'Total Module Laminate', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CdTe Thinfilm'\r\n # B2\r\n temp = get_database_material_result_pe 'CdTe', 'Thinfilm', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CIS/CIGS Thinfilm'\r\n # B19\r\n temp = get_database_material_result_pe 'CIS/CIGS', 'Module Laminate', @ph_product \r\n end\r\n @ph_embedded_result.pe_pv_module = temp * @ph_product.ph_intermediate_result.module_area \r\n \r\n @ph_embedded_result.pe_pv_framing = 0\r\n if @ph_product.ph_basic_information.framed == 'yes'\r\n if @ph_product.ph_specified.ph_module_type.name == 'amorphous Silicon'\r\n # B18 - B17\r\n temp = (get_database_material_result_pe 'a-Si', 'Module Framed Panel', @ph_product) - (get_database_material_result_pe 'a-Si', 'Module Laminate', @ph_product)\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'polycrystalline Silicon'\r\n # B14\r\n temp = get_database_material_result_pe 'p-Si', 'Module/Framed Panel', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'monocrystalline Silicon'\r\n # B7\r\n temp = get_database_material_result_pe 'm-Si', 'Module/Framed Panel', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CIS/CIGS Thinfilm'\r\n # B20 - B19\r\n temp = (get_database_material_result_pe 'CIS/CIGS', 'Module Framed Panel', @ph_product) - (get_database_material_result_pe 'CIS/CIGS', 'Module Laminate', @ph_product) \r\n end \r\n if @ph_product.ph_specified.ph_module_type.name == 'CdTe Thinfilm'\r\n # B2\r\n temp = 0 \r\n end \r\n @ph_embedded_result.pe_pv_framing = temp * @ph_product.ph_intermediate_result.module_area\r\n end\r\n \r\n @ph_embedded_result.pe_pv_mounting = 0\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Mounted'\r\n #B24\r\n temp = get_database_material_result_pe 'Mounting', 'Roof Mounted Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Integrated'\r\n #B25\r\n temp = get_database_material_result_pe 'Mounting', 'Roof Integrated Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Mounted'\r\n #B27\r\n temp = get_database_material_result_pe 'Mounting', 'Facade Mounted Structures', @ph_product \r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Integrated'\r\n #B28\r\n temp = get_database_material_result_pe 'Mounting', 'Facade Integrated Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Open Ground'\r\n #B26\r\n temp = get_database_material_result_pe 'Mounting', 'Open Ground Structures', @ph_product\r\n end \r\n @ph_embedded_result.pe_pv_mounting = temp * @ph_product.ph_intermediate_result.module_area\r\n \r\n @ph_embedded_result.pe_inverter = 0\r\n if @ph_product.ph_electric_component.quantity_1 != 0\r\n temp = get_database_material_result_pe 'Electrics', '1x Inverter Type 1', @ph_product\r\n @ph_embedded_result.pe_inverter += temp * @ph_product.ph_electric_component.quantity_1\r\n end\r\n if @ph_product.ph_electric_component.quantity_2 != 0\r\n temp = get_database_material_result_pe 'Electrics', '1x Inverter Type 2', @ph_product\r\n @ph_embedded_result.pe_inverter += temp * @ph_product.ph_electric_component.quantity_2\r\n end\r\n \r\n \r\n @ph_embedded_result.pe_batteries = 0\r\n pes_1 = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [kg / pc.]', @ph_product\r\n pes_2 = get_database_material_result_pe 'Electrics Battery', 'Lead Acid [per kg]', @ph_product\r\n @ph_embedded_result.pe_batteries = @ph_product.ph_electric_component.separated_battery * pes_1 * pes_2\r\n @ph_embedded_result.embedded_energy_total = @ph_embedded_result.pe_pv_cabling + @ph_embedded_result.pe_pv_module + @ph_embedded_result.pe_pv_framing + @ph_embedded_result.pe_pv_mounting + @ph_embedded_result.pe_inverter + @ph_embedded_result.pe_batteries + @ph_embedded_result.pe_maintenance\r\n @ph_embedded_result.peak_power = @ph_product.ph_intermediate_result.module_area * calcul_efficiency / 100\r\n @ph_embedded_result.lifetime_production = @ph_result.lifetime\r\n @ph_embedded_result.averaged_power = @ph_embedded_result.lifetime_production / @ph_product.ph_specified.lifetime\r\n @ph_embedded_result.averaged_consumption = @ph_embedded_result.averaged_power * 3.6 / @ph_product.ph_basic_information.conversion_factor \r\n @ph_embedded_result.system_emb = @ph_embedded_result.embedded_energy_total\r\n @ph_embedded_result.energy_payback = @ph_embedded_result.embedded_energy_total / @ph_embedded_result.averaged_consumption\r\n @ph_embedded_result.energy_yield = @ph_embedded_result.lifetime_saved / @ph_embedded_result.embedded_energy_total\r\n @ph_embedded_result.emb_co2 = @ph_result.cabling + @ph_result.inverter + @ph_result.batteries\r\n\r\n @ph_result.co2_total += @ph_result.maintenance\r\n @ph_embedded_result.estim_co2 = 1000 * @ph_result.co2_total / @ph_result.lifetime\r\n @ph_embedded_result.net_saved_co2 = @ph_embedded_result.lifetime_production * (@ph_product.ph_basic_information.co2_factor - @ph_embedded_result.estim_co2) / 1000 \r\n \r\n @ph_product.ph_result.save\r\n @ph_product.ph_embedded_result.save\r\n @ph_product.ph_maintenance_result.save\r\n end \r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.xml\r\n end\r\n end",
"title": ""
},
{
"docid": "84215da5820493a6859e99f18200b07e",
"score": "0.45467496",
"text": "def transmogrifier(num1, num2, num3)\n result = (num1 + num2) ** num3\n puts result\n return result\nend",
"title": ""
},
{
"docid": "082aa62c6843eb24ffb5c0b21fc0a3fc",
"score": "0.45462963",
"text": "def print_number_line(beta,n,M1,M2)\n n = n-1\n M1.upto(M2) do |k|\n n.each do |i|\n n.each do |j|\n end\n end\n end\nend",
"title": ""
},
{
"docid": "04e721338db527901ce248f1ba3a4de2",
"score": "0.45460436",
"text": "def my_co2\n @user = User.find(session[:id])\n \n # Calculate total CO2\n @dopplremissions = @user.dopplr_emissions.find(:all)\n @total = 0 \n for emission in @dopplremissions\n @total += emission.co2\n end\n \n #Generate XML\n respond_to do |format|\n format.xml { render :xml => @dopplremissions }\n end\n \n end",
"title": ""
},
{
"docid": "9cc626b3da86b57a3cd7d4e3fc212808",
"score": "0.45458433",
"text": "def v2\n s = scan(verse_re) or return nil\n @text << s\n @v2 = s.to_i\n\n if addon = verse_addon\n @a2 = addon\n end\n\n if verse_sep\n v1 or give_up 'Verse expected!'\n elsif pass_sep\n b1 or c1 or give_up 'Book or chapter expected!'\n else\n epsilon or give_up 'EOS or verse separator or passage separator expected!'\n end\n end",
"title": ""
}
] |
ede1a944e2c3637ef1c9ffd0024af798
|
getter e setter attr_reader :nome apenas getter attr_writter :nome apenas setter
|
[
{
"docid": "6da681af146d3b5d028c5a405b317e7b",
"score": "0.56320053",
"text": "def initialize(nome)\n @nome = nome\n end",
"title": ""
}
] |
[
{
"docid": "1d3eaa95eef7d1e0f3a113cc8d1115d1",
"score": "0.6846069",
"text": "def nombre #getter y Setter\n @nombre\n end",
"title": ""
},
{
"docid": "3e1574f5dc6215e7886af0a17954c78b",
"score": "0.6730011",
"text": "def name=(nombre) #used to be set_name\n @name = nombre\n end",
"title": ""
},
{
"docid": "4bf305c3ea17b282ee1ef5639f8ae162",
"score": "0.6501164",
"text": "def get_nome\n @nome\n end",
"title": ""
},
{
"docid": "19ee6c1eefe9ac941d6b43be2a0e0bfe",
"score": "0.6364818",
"text": "def preencher\n nome.set('Gabriel')\n #sobrenome.set('')\n end",
"title": ""
},
{
"docid": "36399c30e05cec0cadec5eefb21411d9",
"score": "0.6347807",
"text": "def nombre=(nombre)\n @nombre = nombre\n end",
"title": ""
},
{
"docid": "eee1c87647d190621063dc3e549efd7a",
"score": "0.63002264",
"text": "def nombre=(nombre) #Metodo de instancia\n @nombre = nombre\n self\n end",
"title": ""
},
{
"docid": "e598d784fa5e7851b216f3924525bb18",
"score": "0.62879014",
"text": "def name\n nome\n end",
"title": ""
},
{
"docid": "e598d784fa5e7851b216f3924525bb18",
"score": "0.62879014",
"text": "def name\n nome\n end",
"title": ""
},
{
"docid": "365e5db43598804f93f3711882405a2a",
"score": "0.61767524",
"text": "def set_name_one() # we have to write the set because attr_reader only lets you read the attribute\n\t\t@name_one = \"ONEoneONE\" #instance variable\n\tend",
"title": ""
},
{
"docid": "6de16300feff6ae25c4501be0ff34af8",
"score": "0.6086963",
"text": "def name_two # we have to write the return because attr_writer only lets you set the attribute\n\t\t\"name two is #{@name_two}.\"\n\tend",
"title": ""
},
{
"docid": "d8b7a45daa5f51a645df4121fc6a926b",
"score": "0.59946513",
"text": "def name=(the_baby_name) #writer - writes 'the_baby_name' to 'my_name'\n @my_name = the_baby_name #instance variable - casting the local variable to instance variable\n end",
"title": ""
},
{
"docid": "4809d12fdb94e2bb62b06f86b9a5da1f",
"score": "0.59670115",
"text": "def get_nombre\n @nombre # retornamos la variable de instancia\n end",
"title": ""
},
{
"docid": "a775d3339a8dee1814a1cbf65648a50c",
"score": "0.58775043",
"text": "def attr_writer(name); end",
"title": ""
},
{
"docid": "624eb131144da93ef8923c3283e21a0f",
"score": "0.58520854",
"text": "def get_nombre; @nombre; end",
"title": ""
},
{
"docid": "d46353a7c3ee6532931e57c0d856d902",
"score": "0.58403194",
"text": "def nombre\r\n return @nombre\r\nend",
"title": ""
},
{
"docid": "9f8e3e6b31387658bc0f64964db8159a",
"score": "0.58210665",
"text": "def name=(new_name)\n @name = new_name\nend",
"title": ""
},
{
"docid": "92c45f459c4157cb523cf81557e7e513",
"score": "0.58161974",
"text": "def name=(name) # setter method\n @name = name\nend",
"title": ""
},
{
"docid": "9545cca672fc8c0137343d2d66fa617e",
"score": "0.5815031",
"text": "def preenchimento \n nome.set 'tomas'\n lastname.set 'rocha'\n email.set 'tomasrocha@gmail.com'\n end",
"title": ""
},
{
"docid": "ca42e2ae2b61fdf6d6dd8205e8af66e9",
"score": "0.5787424",
"text": "def name=(new_name)\t#setter method\n\t@n = new_name\n end",
"title": ""
},
{
"docid": "998cc388ed219773b093efdf61077b03",
"score": "0.5776972",
"text": "def retorna_nome\n 'Fernando'\n \nend",
"title": ""
},
{
"docid": "bc7e51fb803c3bac0711e3fb727deb8b",
"score": "0.5776223",
"text": "def nombre\n @nombre\n end",
"title": ""
},
{
"docid": "dc76c3a3cd27a4ef3450481a8d608fac",
"score": "0.57371914",
"text": "def retorna_nome \n \"Larissa\"\nend",
"title": ""
},
{
"docid": "dada8e764f4a195c27fafb2fc6a688aa",
"score": "0.5720359",
"text": "def setName(nombre)\n\t\t@name=nombre\n\tend",
"title": ""
},
{
"docid": "c1756231d57cb1a837e06081b5a12375",
"score": "0.57182044",
"text": "def name_reader\n @name\n end",
"title": ""
},
{
"docid": "a723cbc4ce3016f2fa688728b4d71e21",
"score": "0.5708118",
"text": "def instance_write(attr, value)\n setter = :\"#{name}_#{attr}=\"\n responds = instance.respond_to?(setter)\n self.instance_variable_set(\"@_#{setter.to_s.chop}\", value)\n instance.send(setter, value) if responds || attr.to_s == \"file_name\"\n end",
"title": ""
},
{
"docid": "168adf9dcbb52a03aaf0089dea29a062",
"score": "0.5679695",
"text": "def name=(name) # we want to change the name \n @name = name\n end",
"title": ""
},
{
"docid": "7a6fc489c6cae4a3d2d15cfed9b00599",
"score": "0.5656506",
"text": "def get_nombre\n\t\treturn @nombre\n\tend",
"title": ""
},
{
"docid": "a4548558325d80253909d729b115937f",
"score": "0.5644575",
"text": "def set_name=(name)\n @name = name\nend",
"title": ""
},
{
"docid": "e482dfc0c7959f5b045f91878092c227",
"score": "0.564003",
"text": "def create_readable_attribute(name, value=nil)\n self.class.send :attr_reader, name\n instance_variable_set \"@#{name}\", value\n end",
"title": ""
},
{
"docid": "52e219ab581f3eab5e90cefd5a11ff57",
"score": "0.56393766",
"text": "def name=(new_name)\n\t@name = new_name\nend",
"title": ""
},
{
"docid": "8881e4dbd8bd48d18c705846ce78be5e",
"score": "0.56090266",
"text": "def KlassWhaterver\n def name # KlassWhatever method to return value of name attribute\n @name\n end\n def name=(str) # KlassWhatever method to set value of name attribute\n @name\n end\nend",
"title": ""
},
{
"docid": "f3520d85e72f9ebfb714aed90b5a6fa2",
"score": "0.5603667",
"text": "def get_nombre\n @nombre\n end",
"title": ""
},
{
"docid": "0e7dd311e294e9cfbcbefe435b74c3a1",
"score": "0.5578088",
"text": "def name=(input)\n @name=input\n end",
"title": ""
},
{
"docid": "a8e3a289f448b2d8a67b05554826b3ec",
"score": "0.5560268",
"text": "def name #THIS THE GETTER FUNCTION \r\n @name\r\n end",
"title": ""
},
{
"docid": "d047443158dfebabac381d63940ed58f",
"score": "0.5557148",
"text": "def initialize(nome)\n @nome = nome\n end",
"title": ""
},
{
"docid": "2e1f12b04fa85fb48ff6e85eae2d8a71",
"score": "0.55281824",
"text": "def name=(o); end",
"title": ""
},
{
"docid": "31d4eed4271c04b429d7fcf74af6a36b",
"score": "0.5527003",
"text": "def printNombre\n @nombre\n end",
"title": ""
},
{
"docid": "1aa63b89b98124e1a3fdcaefcef48f87",
"score": "0.5525986",
"text": "def getNombre\n @nombre\n end",
"title": ""
},
{
"docid": "18827ed37be617f2a5cdb497280e3be0",
"score": "0.5511338",
"text": "def name=(new_name)\n if new_name == \"\" \n raise \"name can't be blak!\"\n end\t \n @name = new_name\n end",
"title": ""
},
{
"docid": "e02b1bdb800d4eb49853c1f221ea35bf",
"score": "0.5508182",
"text": "def name\n descricao\n end",
"title": ""
},
{
"docid": "3c012d1915c5600518170864ffeabd05",
"score": "0.5498593",
"text": "def name=(name)\n\t\t@name = name\t\t\t#This is a setter\n\tend",
"title": ""
},
{
"docid": "b5eb499d740f7df61e285add36f971d4",
"score": "0.5497297",
"text": "def instance_write(attr, value)\n setter = :\"#{name}_#{attr}=\"\n responds = instance.respond_to?(setter)\n instance.send(setter, value) if responds || attr.to_s == \"file_name\"\n end",
"title": ""
},
{
"docid": "55582f7131cfd86a7b8491d0a9b4bdf3",
"score": "0.5493331",
"text": "def meow # Instance method\n @name # attribute instance variable\n puts \"meow!\" # puts in terminal\n end",
"title": ""
},
{
"docid": "d9c34468f6314d603d6bf04df39f4f74",
"score": "0.54899454",
"text": "def name=(name); @name = name; end",
"title": ""
},
{
"docid": "8a87e45368b62dc648cab662671ab93f",
"score": "0.5487053",
"text": "def metodoPublico ()\n \"#{@@variableDeClase}:Soy un #{@reino}\" \n end",
"title": ""
},
{
"docid": "86d174ab4551bfbff5b4aa73f1675cfe",
"score": "0.54858017",
"text": "def name=(n) # This was renamed from \"set_name=\"\n @name = n\nend",
"title": ""
},
{
"docid": "bf3c508dc585bb44e92db258f32dc6c9",
"score": "0.5482255",
"text": "def name ; read_attribute :name ; end",
"title": ""
},
{
"docid": "44f772bd3842084f50f3413910e401e0",
"score": "0.5476606",
"text": "def nombre\n\t\t@nombre\n\t\t\n\tend",
"title": ""
},
{
"docid": "4bf0611461d254b37b1b9c5ed14c04e0",
"score": "0.54707795",
"text": "def nombre\n return @nombre\n end",
"title": ""
},
{
"docid": "b3629cb564eb11a5a326b2d669e9ff19",
"score": "0.5470198",
"text": "def sobre\n @titulo = \"Sobre\"\n end",
"title": ""
},
{
"docid": "7d08e4a7fa00c9faff7a17027a843fc0",
"score": "0.5455712",
"text": "def namenew # This was renamed from \"get_name\"\n @name\n end",
"title": ""
},
{
"docid": "b1fe714251c1123504118802ffb7e995",
"score": "0.5454992",
"text": "def name=(a_name)\n end",
"title": ""
},
{
"docid": "072c49d787d995a9051a9b7aa150b4c5",
"score": "0.5451308",
"text": "def name\n return @nombreSala\n end",
"title": ""
},
{
"docid": "e045b2c780fea012697131df03ab1a24",
"score": "0.5449474",
"text": "def name=(name) #setter\n if name == \"\"\n raise \"Name can't be blank!\"\n end\n @name = name\n end",
"title": ""
},
{
"docid": "01dc8970e1341093541aeda6dadcf961",
"score": "0.5440971",
"text": "def name_setter(new_name)\n\t\t@name = new_name\n\n\tend",
"title": ""
},
{
"docid": "6f6eb4828ac299f3ea2e7fc1975c9db2",
"score": "0.543947",
"text": "def attr_writer(name) #:nodoc:\n class_eval <<-CODE\n def #{name}=(value)\n attributes[:#{name}] = value\n end\n CODE\n end",
"title": ""
},
{
"docid": "7973437ab0e8bdf7e21556b7d753c0d0",
"score": "0.5432926",
"text": "def name\n # En cualquier metodo de ruby, la ultima linea de un metodo es la que sera retornada, por lo tanto\n # no hace falta colocar la palabra return\n @name\n end",
"title": ""
},
{
"docid": "0cff77da98936a969d680af95fb81a3f",
"score": "0.54278433",
"text": "def cadastro_nome(nome)\n find('#customer_firstname').set nome\n end",
"title": ""
},
{
"docid": "08cc608c385ecd9bc5236e3bfdf44529",
"score": "0.54237247",
"text": "def name=(value) #Attribute writer method for \"@name\"\n if value == \"\"\n raise \"Name can't be blank!\" #Data validation ---raise----\n end\n @name = value\n end",
"title": ""
},
{
"docid": "6bea68ee2b8182ad8f64bb679e294a89",
"score": "0.5419704",
"text": "def my_name=(new_name)\n @my_name = new_name\n end",
"title": ""
},
{
"docid": "0db608f9a544bc2e06caa570bcf3f559",
"score": "0.54078174",
"text": "def instance_write(attr, value)\n setter = :\"#{name}_#{attr}=\"\n raise unless @instance.respond_to?(setter)\n @instance.send(setter, value)\n end",
"title": ""
},
{
"docid": "fdf1ecd327d9a9754f53bb3c4ad354d9",
"score": "0.54030836",
"text": "def name=(new_name) # expose public set interface\n @name = new_name\n end",
"title": ""
},
{
"docid": "9a6b5dd457bb45c5b69e2fe38e0f3232",
"score": "0.5402444",
"text": "def nombre=(val)\n self[:nombre] = val.squish if val\n end",
"title": ""
},
{
"docid": "9a6b5dd457bb45c5b69e2fe38e0f3232",
"score": "0.5402444",
"text": "def nombre=(val)\n self[:nombre] = val.squish if val\n end",
"title": ""
},
{
"docid": "8fd6ff45b1d3089432135df2bbb85e46",
"score": "0.5402048",
"text": "def name #metod name, returnerar name.\r\n\t\treturn @name\r\n\tend",
"title": ""
},
{
"docid": "a99568108266592acdd1ea9a4598df2a",
"score": "0.54005176",
"text": "def say_your_name #this is a READER / GETTER\n @name\n end",
"title": ""
},
{
"docid": "675b3d8c8d78ae2fc0d06eb58017388f",
"score": "0.5398643",
"text": "def imprimir\n\t\tputs \"Nome: #{self.nome} - Idade: #{self.idade}\"\n\tend",
"title": ""
},
{
"docid": "eebcc96fd52c4ac0879589bd82493b10",
"score": "0.53957087",
"text": "def nome\n nome = self.nome_fantasia\n nome = self.razao_social if nome == \"NULL\"\n nome\n end",
"title": ""
},
{
"docid": "3241af3ab6c2fd8f6b605be44129ab60",
"score": "0.53910536",
"text": "def name # getter / reader\n @name\n end",
"title": ""
},
{
"docid": "6aef9b9a9d346678af777b9ce3112080",
"score": "0.53886193",
"text": "def nombre_completo\n \"#{self.nombre} #{self.apellido}\"\n end",
"title": ""
},
{
"docid": "cb6cf90c12c3c81ae5dc8e49f69ab7ad",
"score": "0.53780997",
"text": "def name\n @name ||= Lorem.name\n end",
"title": ""
},
{
"docid": "0a3d289f194d197e0684f14d0961dcb1",
"score": "0.5373414",
"text": "def setter\n :\"#{name}=\"\n end",
"title": ""
},
{
"docid": "82f70f5ea73ced9c92635a680069b7a3",
"score": "0.53717464",
"text": "def getNombre\n @nombre\n end",
"title": ""
},
{
"docid": "1f94058011c8c3aa306dcc954ac28fec",
"score": "0.5369427",
"text": "def attr_accessor(*names)\n attr_reader *names\n attr_writer *names\n end",
"title": ""
},
{
"docid": "61ac645e31f98771715f560e91427d35",
"score": "0.53674567",
"text": "def name=(name)\n @name = name \n end",
"title": ""
},
{
"docid": "83fc13cb1ffcf7efb4075fd17f34de95",
"score": "0.53647995",
"text": "def name=(name); end",
"title": ""
},
{
"docid": "8f1988cf043b7d8c0b1e90f3da95ebc0",
"score": "0.53637874",
"text": "def meow\n # @name, self.name\n puts \"Meow, I am #{@name}\"\n end",
"title": ""
},
{
"docid": "933dce8055b433e7b5c35bbb83992f28",
"score": "0.5359836",
"text": "def name= o\n @NAME = o\n end",
"title": ""
},
{
"docid": "212a0f85bafb3254b52b68049d8475b7",
"score": "0.53571916",
"text": "def name=(new_name) \n @name = new_name\n end",
"title": ""
},
{
"docid": "cf22023b5e158ca5f753a394fa43b1c7",
"score": "0.5356722",
"text": "def change_name=(new_name)\n @name = new_name\n self.inspect\n end",
"title": ""
},
{
"docid": "5a0bcdaca95c21b13aacca36f9fad742",
"score": "0.53482485",
"text": "def _write_attribute(attr_name, value); end",
"title": ""
},
{
"docid": "22b37ca880b9a6398888aedc12c23cb0",
"score": "0.5347854",
"text": "def to_s\n \treturn self.nome\n\tend",
"title": ""
},
{
"docid": "c0275fda6513fee068b643b0e7d79da8",
"score": "0.5345",
"text": "def []=(indice, atributo)\n\n # Verificamos si es un indice de acceso a arreglo\n indice = self[indice.direccion_de_indice_de_arreglo] if indice.class == String and indice.acceso_arreglo?\n\n lim_inf = 100 # Limite inferior de las direcciones de Clase\n lim_sup = 149 # Limite superior de las direcciones de Clase\n case indice\n when lim_inf..lim_sup # Si el indice es una direccion de Clase\n self[50][indice - lim_inf] = atributo # Guardamos el atributo en el Objeto\n else\n super(indice, atributo) # Si no es una dir de clase, asigna el valor del registro normal\n end\n end",
"title": ""
},
{
"docid": "3c233ef11e62d245154cb7f47fa03dae",
"score": "0.53394485",
"text": "def nombre_completo\n return \"#{self.nombres} #{self.apellidos}\"\n end",
"title": ""
},
{
"docid": "09112ee15c07e77ea586745eb81ad58e",
"score": "0.533506",
"text": "def name\n # @name\n \"Jane\"\n end",
"title": ""
},
{
"docid": "e0687530e6dbd464311d760e932516cf",
"score": "0.5330664",
"text": "def name=(name)\n end",
"title": ""
},
{
"docid": "e0687530e6dbd464311d760e932516cf",
"score": "0.5330664",
"text": "def name=(name)\n end",
"title": ""
},
{
"docid": "e0687530e6dbd464311d760e932516cf",
"score": "0.5330664",
"text": "def name=(name)\n end",
"title": ""
},
{
"docid": "9fa0cd327a138f19c521f0cf9a72d216",
"score": "0.53292036",
"text": "def imprimir\n\t\tputs \"Nome: #{self.nome} - Idade: #{self.idade} \"\n\tend",
"title": ""
},
{
"docid": "82f63eda621e0f39fdff99fea10b8ad7",
"score": "0.5327716",
"text": "def retorna_nome\n 'Van'\nend",
"title": ""
},
{
"docid": "01f4ac04e14cb32cc4ea6dd6a5597f8b",
"score": "0.53243345",
"text": "def setName(aname)\n\t\t@name=aname\n\tend",
"title": ""
},
{
"docid": "9d94403245486990d9050738727d4b6b",
"score": "0.53232586",
"text": "def set_name=(nm) \n @name = nm \n end",
"title": ""
},
{
"docid": "7b64c2e34d01f40c67a69e4afda0b133",
"score": "0.53168285",
"text": "def create_writeable_attribute(name, value=nil)\n self.class.send :attr_writer, name\n instance_variable_set \"@#{name}\", value\n end",
"title": ""
},
{
"docid": "658f77d5f01c1cfd190767fe0211c424",
"score": "0.5313468",
"text": "def attribute_reader\n [@first_name, @last_name, @email, @note]\n end",
"title": ""
},
{
"docid": "c4fdaf30d6b47cd7859a7a416eb90202",
"score": "0.5306382",
"text": "def name \n @my_name \n end",
"title": ""
},
{
"docid": "8e4b170672e7cf82aa5998587eb059f2",
"score": "0.5305381",
"text": "def write_attribute(name, value)\n if not writable?(name)\n security_error(:let_write, name)\n end\n old_write_attribute(name, value)\n end",
"title": ""
},
{
"docid": "386a9f716a7ea260dda4307fa974298f",
"score": "0.5299472",
"text": "def name_setter(new_name)\n @name = new_name\n\n end",
"title": ""
},
{
"docid": "b2e9b129d2d589b119d27b828ede9055",
"score": "0.5295373",
"text": "def attr_accessor(*names)\n attr_reader *names\n attr_writer *names\n end",
"title": ""
},
{
"docid": "dd86e5fcc8b116dba5712f973a1bb1ae",
"score": "0.52944773",
"text": "def name=(value)\n super(value.strip) if value\n name\n end",
"title": ""
}
] |
fc387628b2b5ac9f2000587c320f278f
|
POST /timezones POST /timezones.json
|
[
{
"docid": "1bfd05c092a1fe3d12ed31844fd72fbc",
"score": "0.65058523",
"text": "def create\n @timezone = Timezone.new(params[:timezone])\n\n respond_to do |format|\n if @timezone.save\n format.html { redirect_to @timezone, notice: 'Timezone was successfully created.' }\n format.json { render json: @timezone, status: :created, location: @timezone }\n else\n format.html { render action: \"new\" }\n format.json { render json: @timezone.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "e080925f05750551d603a1fd172ce582",
"score": "0.66795605",
"text": "def create\n @time_zone = TimeZone.new(params[:time_zone])\n\n respond_to do |format|\n if @time_zone.save\n format.html { redirect_to @time_zone, notice: 'Time zone was successfully created.' }\n format.json { render json: @time_zone, status: :created, location: @time_zone }\n else\n format.html { render action: \"new\" }\n format.json { render json: @time_zone.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "386907fedc53707a625797ceba688688",
"score": "0.64744437",
"text": "def timezones\n response = @client.get 'scans/timezones'\n verify response,\n unauthorized: 'You do not have permission to view timezones',\n internal_server_error: 'Internal server error occurred'\n end",
"title": ""
},
{
"docid": "94d37493b5ad74289bb727cb629b43e4",
"score": "0.64024",
"text": "def set_request\n @timezones = TZInfo::Timezone.all.map { |t| [t.friendly_identifier(true), t.identifier] }.sort\n if @timezones && params[:id]\n @timezone = @timezone.find(params[:id])\n end\n end",
"title": ""
},
{
"docid": "bb50794cdbc9aba288f1320b0a1d43c5",
"score": "0.60515296",
"text": "def create\n @zone = Zone.new(zone_params)\n\n if @zone.save\n render json: @zone, status: :created, location: @zone\n else\n render json: @zone.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "c11ec598495bc003f7317e168d0cd4ae",
"score": "0.60106695",
"text": "def create\n @ozone = Ozone.new(ozone_params)\n\n if @ozone.save\n render json: @ozone, status: :created, location: @ozone \n else\n render json: @ozone.errors, status: :unprocessable_entity \n end\n end",
"title": ""
},
{
"docid": "677626ccb377c160eda145dfe1e83c85",
"score": "0.5968885",
"text": "def timezones\n @timezones.freeze\n end",
"title": ""
},
{
"docid": "275082de4f3b0cb8c21c8ae4d543fd59",
"score": "0.5877711",
"text": "def create(options = {})\n response = request(:post, \"/network_zones.json\", :query => {:pack => options})\n end",
"title": ""
},
{
"docid": "e4bda8edf1c54450a0acb6825af31f77",
"score": "0.5748047",
"text": "def new\n @time_zone = TimeZone.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @time_zone }\n end\n end",
"title": ""
},
{
"docid": "d2edf5fa5ac31733abf26dcdabf5f528",
"score": "0.5734164",
"text": "def data_timezones\n @data_timezones.freeze\n end",
"title": ""
},
{
"docid": "efc241120f7a57a87d7fbe64dd65e94a",
"score": "0.57258755",
"text": "def create(options = {})\n response = request(:post, \"/settings/hypervisor_zones.json\", :query => {:pack => options})\n end",
"title": ""
},
{
"docid": "97939ea05c798613afec3c5068f24644",
"score": "0.57108974",
"text": "def create\n @zone = Zone.new(zone_params)\n\n respond_to do |format|\n if @zone.save\n format.html { redirect_to zones_path, notice: \"Zone was successfully created.\" }\n format.json { render :show, status: :created, location: @zone }\n else\n format.html { render :new }\n format.json { render json: @zone.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d040e8a7887c81157b73514a19604083",
"score": "0.5677587",
"text": "def create\n @zone = Zone.new(params[:zone])\n\n respond_to do |format|\n if @zone.save\n format.html { redirect_to zones_url, notice: 'Zone was successfully created.' }\n format.json { render json: @zone, status: :created, location: @zone }\n else\n format.html { render action: \"new\" }\n format.json { render json: @zone.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "02b3e019b3bcb681abd1364a13f8c118",
"score": "0.5677068",
"text": "def api_request_url(object)\n api_uri = 'http://timezonedb.wellfounded.ca/api/v1'\n api_request_url = \"#{api_uri}/timezones?\"\n api_request_url << get_filters(object).join('&')\n log \"Making request to #{api_request_url} for timezone.\"\n api_request_url\n end",
"title": ""
},
{
"docid": "fb954ab9cee083fdd29fdabd55dd9a49",
"score": "0.56568104",
"text": "def destroy\n @time_zone = TimeZone.find(params[:id])\n @time_zone.destroy\n\n respond_to do |format|\n format.html { redirect_to time_zones_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "faef4a06f00b49cadfdd3fc173c24e6e",
"score": "0.56391245",
"text": "def create\n\n #find time zone for city\n params[:clock][:timezone] = find_timezone(params[:clock][:city])\n\n @clock = Clock.new(clock_params)\n\n respond_to do |format|\n if(params[:clock][:timezone] == nil)\n format.html { redirect_to new_clock_path, notice: 'Invalid Name'}\n elsif @clock.save\n format.html { redirect_to root_url, notice: 'Clock was successfully created.' }\n else\n format.html { render :new }\n format.json { render json: @clock.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "698626bbc13730f513427822082854ee",
"score": "0.56062615",
"text": "def timezone\n ret = {}\n if logged_in?\n puts 'SET TIMEZONE ' + params.inspect\n tz = ActiveSupport::TimeZone[params[:offset].to_i]\n if tz\n puts 'tz=' + tz.name\n current_user.time_zone = tz.name\n current_user.save(:dirty=>true)\n ret[:timezone] = tz.name\n end\n end\n render :json=>ret\n end",
"title": ""
},
{
"docid": "5a1cb6ca941fdd99935e545482d42f3b",
"score": "0.55829024",
"text": "def create\n @ozone = Ozone.new(ozone_params)\n\n respond_to do |format|\n if @ozone.save\n format.html { redirect_to @ozone, notice: 'Ozone was successfully created.' }\n format.json { render :show, status: :created, location: @ozone }\n else\n format.html { render :new }\n format.json { render json: @ozone.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "47fe057cf4e3ab53fd3f794f0ebe785a",
"score": "0.5580578",
"text": "def populate_timezones\n if new_record?\n self.created_at_timezone ||= Time.zone.name\n else\n if self.deleted?\n self.deleted_at_timezone ||= Time.zone.name\n end\n end\n end",
"title": ""
},
{
"docid": "0f10c7c630bf1de65dbdd5ba74adced5",
"score": "0.5569834",
"text": "def new\n @timezone = Timezone.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @timezone }\n end\n end",
"title": ""
},
{
"docid": "7d33a0d452c3ea0b08c10cb1d4daef9b",
"score": "0.553937",
"text": "def set_timezone(timezone); end",
"title": ""
},
{
"docid": "7d33a0d452c3ea0b08c10cb1d4daef9b",
"score": "0.553937",
"text": "def set_timezone(timezone); end",
"title": ""
},
{
"docid": "7d33a0d452c3ea0b08c10cb1d4daef9b",
"score": "0.553937",
"text": "def set_timezone(timezone); end",
"title": ""
},
{
"docid": "7d33a0d452c3ea0b08c10cb1d4daef9b",
"score": "0.553937",
"text": "def set_timezone(timezone); end",
"title": ""
},
{
"docid": "7d33a0d452c3ea0b08c10cb1d4daef9b",
"score": "0.553937",
"text": "def set_timezone(timezone); end",
"title": ""
},
{
"docid": "10f6e10959d4225b11827aa7c8f25f5b",
"score": "0.5530715",
"text": "def destroy\n @timezone = Timezone.find(params[:id])\n @timezone.destroy\n\n respond_to do |format|\n format.html { redirect_to timezones_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e4ae6402e792f9aafba058d749cb5fa1",
"score": "0.5485652",
"text": "def set_timezone\n u = User.find_by_id(current_user.id)\n u.timezone = params[:timezone]\n u.save\n render :layout => false\n end",
"title": ""
},
{
"docid": "aa70e8f8ffaa3c83f53035cd42264d0c",
"score": "0.54850435",
"text": "def zone_params\n params.require(:zone).permit(:nombre, :dirquejas, :usuario)\n end",
"title": ""
},
{
"docid": "af99453332b2ceb567f7d22e1018d4a6",
"score": "0.54597694",
"text": "def ozone_params\n params.require(:ozone).permit(:dataOzone, :node_id)\n end",
"title": ""
},
{
"docid": "5c47a6754d9d38d46048632b60747efa",
"score": "0.54488873",
"text": "def create\n @admin_zones = Admin::Zone.all\n @admin_zone = Admin::Zone.new(params[:admin_zone])\n\n respond_to do |format|\n if @admin_zone.save\n flash[:notice] = 'Zone was successfully created.'\n format.html { redirect_to admin_zones_path, notice: 'Zone was successfully created.' }\n format.json { render json: @admin_zone, status: :created, location: @admin_zone }\n else\n \n format.html { render action: \"new\" }\n format.json { render json: @admin_zone.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cdc8f90fc9e078244065240f778ba068",
"score": "0.54428834",
"text": "def create\n @toy_zone = ToyZone.new(params[:toy_zone])\n\n respond_to do |format|\n if @toy_zone.save\n format.html { redirect_to @toy_zone, :notice => 'Toy zone was successfully created.' }\n format.json { render :json => @toy_zone, :status => :created, :location => @toy_zone }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @toy_zone.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "299bf79520428be814f948a2f0efd5a8",
"score": "0.5402457",
"text": "def create\n @zone = Zone.new(zone_params)\n\n respond_to do |format|\n if @zone.save\n format.html { redirect_to @zone, notice: 'Área creada exitosamente' }\n format.json { render :show, status: :created, location: @zone }\n else\n format.html { render :new }\n format.json { render json: @zone.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c3d3fc9b6f3497daea78a0e740a520b3",
"score": "0.53970605",
"text": "def change_time_zone\n\t\t#Is user logged in?\n\t\trender :json=>{:success=>false, :msg=>'User not logged in.'} and return if @user.nil?\n\t\t\n\t\t@user.time_zone = params[:time_zone]\n\t\t@user.save\n\t\t\n\t\trender :json=>{:success=>true, :msg=>'success'} and return\n\tend",
"title": ""
},
{
"docid": "f71b1a3ba5d9457bec7878f3e9e214e2",
"score": "0.5395139",
"text": "def zone_params\n params.require(:zone).permit(:name)\n end",
"title": ""
},
{
"docid": "e15b4b8b4c171f5165de1f5849d34b7f",
"score": "0.5391009",
"text": "def timezones\n subcomponents[\"VTIMEZONE\"]\n end",
"title": ""
},
{
"docid": "dbf7822497da16ae108d3eb0c9a93a43",
"score": "0.53908366",
"text": "def create_timezone\n raise_not_implemented('create_timezone')\n end",
"title": ""
},
{
"docid": "a4983514a7566b93b7636be91a141f16",
"score": "0.538794",
"text": "def zone_params\n params.require(:zone).permit(:name)\n end",
"title": ""
},
{
"docid": "09b58c7117be7b87af7482da7745e9ec",
"score": "0.53779155",
"text": "def get_timezones_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TextMagicApi.get_timezones ...'\n end\n # resource path\n local_var_path = '/api/v2/timezones'\n\n # query parameters\n query_params = {}\n query_params[:'full'] = opts[:'full'] if !opts[:'full'].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 => 'GetTimezonesResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TextMagicApi#get_timezones\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "8018e3dab10f8a064fa922c52c0d6d91",
"score": "0.53772795",
"text": "def create\n\n has = params[\"area\"].to_json\n data_has = JSON.parse(has)\n @zone = Zone.new();\n @zone.nombre_zona = params[\"nombre_zona\"]\n @zone.color = params[\"color\"]\n\n respond_to do |format|\n if @zone.save\n \n data_has.each do |geo|\n @coordenada = CoordinateZone.new()\n geo.each do |data|\n @coordenada.zone_id = @zone.id\n @coordenada.latitud = data[\"lat\"].to_f\n @coordenada.longitud = data[\"lng\"].to_f \n end\n @coordenada.save\n end\n\n format.html { redirect_to @zone, notice: 'Zone was successfully created.' }\n format.js \n # format.js { render js: \"window.location.href=#{ directories_path }\" }\n format.json { render :show, status: :created, location: @zone }\n \n else\n format.html { render :new }\n format.json { render json: @zone.errors, status: :unprocessable_entity }\n end\n\n end\n end",
"title": ""
},
{
"docid": "050102dfe3c0d22976653c06702e326a",
"score": "0.53406876",
"text": "def timezone=(timezone)\n validator = EnumAttributeValidator.new('String', [\"Pacific/Niue\", \"Pacific/Pago_Pago\", \"Pacific/Honolulu\", \"Pacific/Rarotonga\", \"Pacific/Tahiti\", \"Pacific/Marquesas\", \"America/Anchorage\", \"Pacific/Gambier\", \"America/Los_Angeles\", \"America/Tijuana\", \"America/Vancouver\", \"America/Whitehorse\", \"Pacific/Pitcairn\", \"America/Dawson_Creek\", \"America/Denver\", \"America/Edmonton\", \"America/Hermosillo\", \"America/Mazatlan\", \"America/Phoenix\", \"America/Yellowknife\", \"America/Belize\", \"America/Chicago\", \"America/Costa_Rica\", \"America/El_Salvador\", \"America/Guatemala\", \"America/Managua\", \"America/Mexico_City\", \"America/Regina\", \"America/Tegucigalpa\", \"America/Winnipeg\", \"Pacific/Galapagos\", \"America/Bogota\", \"America/Cancun\", \"America/Cayman\", \"America/Guayaquil\", \"America/Havana\", \"America/Iqaluit\", \"America/Jamaica\", \"America/Lima\", \"America/Nassau\", \"America/New_York\", \"America/Panama\", \"America/Port-au-Prince\", \"America/Rio_Branco\", \"America/Toronto\", \"Pacific/Easter\", \"America/Caracas\", \"America/Asuncion\", \"America/Barbados\", \"America/Boa_Vista\", \"America/Campo_Grande\", \"America/Cuiaba\", \"America/Curacao\", \"America/Grand_Turk\", \"America/Guyana\", \"America/Halifax\", \"America/La_Paz\", \"America/Manaus\", \"America/Martinique\", \"America/Port_of_Spain\", \"America/Porto_Velho\", \"America/Puerto_Rico\", \"America/Santo_Domingo\", \"America/Thule\", \"Atlantic/Bermuda\", \"America/St_Johns\", \"America/Araguaina\", \"America/Argentina/Buenos_Aires\", \"America/Bahia\", \"America/Belem\", \"America/Cayenne\", \"America/Fortaleza\", \"America/Godthab\", \"America/Maceio\", \"America/Miquelon\", \"America/Montevideo\", \"America/Paramaribo\", \"America/Recife\", \"America/Santiago\", \"America/Sao_Paulo\", \"Antarctica/Palmer\", \"Antarctica/Rothera\", \"Atlantic/Stanley\", \"America/Noronha\", \"Atlantic/South_Georgia\", \"America/Scoresbysund\", \"Atlantic/Azores\", \"Atlantic/Cape_Verde\", \"Africa/Abidjan\", \"Africa/Accra\", \"Africa/Bissau\", \"Africa/Casablanca\", \"Africa/El_Aaiun\", \"Africa/Monrovia\", \"America/Danmarkshavn\", \"Atlantic/Canary\", \"Atlantic/Faroe\", \"Atlantic/Reykjavik\", \"Etc/GMT\", \"Europe/Dublin\", \"Europe/Lisbon\", \"Europe/London\", \"Africa/Algiers\", \"Africa/Ceuta\", \"Africa/Lagos\", \"Africa/Ndjamena\", \"Africa/Tunis\", \"Africa/Windhoek\", \"Europe/Amsterdam\", \"Europe/Andorra\", \"Europe/Belgrade\", \"Europe/Berlin\", \"Europe/Brussels\", \"Europe/Budapest\", \"Europe/Copenhagen\", \"Europe/Gibraltar\", \"Europe/Luxembourg\", \"Europe/Madrid\", \"Europe/Malta\", \"Europe/Monaco\", \"Europe/Oslo\", \"Europe/Paris\", \"Europe/Prague\", \"Europe/Rome\", \"Europe/Stockholm\", \"Europe/Tirane\", \"Europe/Vienna\", \"Europe/Warsaw\", \"Europe/Zurich\", \"Africa/Cairo\", \"Africa/Johannesburg\", \"Africa/Maputo\", \"Africa/Tripoli\", \"Asia/Amman\", \"Asia/Beirut\", \"Asia/Damascus\", \"Asia/Gaza\", \"Asia/Jerusalem\", \"Asia/Nicosia\", \"Europe/Athens\", \"Europe/Bucharest\", \"Europe/Chisinau\", \"Europe/Helsinki\", \"Europe/Istanbul\", \"Europe/Kaliningrad\", \"Europe/Kiev\", \"Europe/Riga\", \"Europe/Sofia\", \"Europe/Tallinn\", \"Europe/Vilnius\", \"Africa/Khartoum\", \"Africa/Nairobi\", \"Antarctica/Syowa\", \"Asia/Baghdad\", \"Asia/Qatar\", \"Asia/Riyadh\", \"Europe/Minsk\", \"Europe/Moscow\", \"Asia/Tehran\", \"Asia/Baku\", \"Asia/Dubai\", \"Asia/Tbilisi\", \"Asia/Yerevan\", \"Europe/Samara\", \"Indian/Mahe\", \"Indian/Mauritius\", \"Indian/Reunion\", \"Asia/Kabul\", \"Antarctica/Mawson\", \"Asia/Aqtau\", \"Asia/Aqtobe\", \"Asia/Ashgabat\", \"Asia/Dushanbe\", \"Asia/Karachi\", \"Asia/Tashkent\", \"Asia/Yekaterinburg\", \"Indian/Kerguelen\", \"Indian/Maldives\", \"Asia/Calcutta\", \"Asia/Kolkata\", \"Asia/Colombo\", \"Asia/Katmandu\", \"Antarctica/Vostok\", \"Asia/Almaty\", \"Asia/Bishkek\", \"Asia/Dhaka\", \"Asia/Omsk\", \"Asia/Thimphu\", \"Indian/Chagos\", \"Asia/Rangoon\", \"Indian/Cocos\", \"Antarctica/Davis\", \"Asia/Bangkok\", \"Asia/Hovd\", \"Asia/Jakarta\", \"Asia/Krasnoyarsk\", \"Asia/Saigon\", \"Indian/Christmas\", \"Antarctica/Casey\", \"Asia/Brunei\", \"Asia/Choibalsan\", \"Asia/Hong_Kong\", \"Asia/Irkutsk\", \"Asia/Kuala_Lumpur\", \"Asia/Macau\", \"Asia/Makassar\", \"Asia/Manila\", \"Asia/Shanghai\", \"Asia/Singapore\", \"Asia/Taipei\", \"Asia/Ulaanbaatar\", \"Australia/Perth\", \"Asia/Pyongyang\", \"Asia/Dili\", \"Asia/Jayapura\", \"Asia/Seoul\", \"Asia/Tokyo\", \"Asia/Yakutsk\", \"Pacific/Palau\", \"Australia/Adelaide\", \"Australia/Darwin\", \"Antarctica/DumontDUrville\", \"Asia/Magadan\", \"Asia/Vladivostok\", \"Australia/Brisbane\", \"Australia/Hobart\", \"Australia/Sydney\", \"Pacific/Chuuk\", \"Pacific/Guam\", \"Pacific/Port_Moresby\", \"Pacific/Efate\", \"Pacific/Guadalcanal\", \"Pacific/Kosrae\", \"Pacific/Norfolk\", \"Pacific/Noumea\", \"Pacific/Pohnpei\", \"Asia/Kamchatka\", \"Pacific/Auckland\", \"Pacific/Fiji\", \"Pacific/Funafuti\", \"Pacific/Kwajalein\", \"Pacific/Majuro\", \"Pacific/Nauru\", \"Pacific/Tarawa\", \"Pacific/Wake\", \"Pacific/Wallis\", \"Pacific/Apia\", \"Pacific/Enderbury\", \"Pacific/Fakaofo\", \"Pacific/Tongatapu\", \"Pacific/Kiritimati\"])\n unless validator.valid?(timezone)\n fail ArgumentError, \"invalid value for \\\"timezone\\\", must be one of #{validator.allowable_values}.\"\n end\n @timezone = timezone\n end",
"title": ""
},
{
"docid": "ceb4c15c384b2e296ee9437698a4f713",
"score": "0.5339718",
"text": "def create\n @cityzone = Cityzone.new(cityzone_params)\n\n respond_to do |format|\n if @cityzone.save\n format.html { redirect_to @cityzone, notice: 'Cityzone was successfully created.' }\n format.json { render :show, status: :created, location: @cityzone }\n else\n format.html { render :new }\n format.json { render json: @cityzone.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "461905af31096dab6aa885136230287c",
"score": "0.5322081",
"text": "def update\n @time_zone = TimeZone.find(params[:id])\n\n respond_to do |format|\n if @time_zone.update_attributes(params[:time_zone])\n format.html { redirect_to @time_zone, notice: 'Time zone was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @time_zone.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b5324130c919138ab93f266b7695fad3",
"score": "0.5312246",
"text": "def set_Timezone(value)\n set_input(\"Timezone\", value)\n end",
"title": ""
},
{
"docid": "bebc5a03a2212e17280b2f42c358e59b",
"score": "0.5311732",
"text": "def get_timezones(opts = {})\n data, _status_code, _headers = get_timezones_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "e83458a8aea4679f30e192ec79cfd174",
"score": "0.5264046",
"text": "def timezone(identifier); end",
"title": ""
},
{
"docid": "e83458a8aea4679f30e192ec79cfd174",
"score": "0.5264046",
"text": "def timezone(identifier); end",
"title": ""
},
{
"docid": "e83458a8aea4679f30e192ec79cfd174",
"score": "0.5264046",
"text": "def timezone(identifier); end",
"title": ""
},
{
"docid": "a9d9cd8429d952f3886721c34cb4676a",
"score": "0.526106",
"text": "def index\n @zones = Zone.all\n\n render json: @zones\n end",
"title": ""
},
{
"docid": "51ceeb295a6d42fbd86ddd14a1c739f8",
"score": "0.5260421",
"text": "def zone_params\n # params.require(:zone) #.permit( :zone, :nombre_zona, :color)\n end",
"title": ""
},
{
"docid": "5aaa5295de045bb7ae10094bbc03ad99",
"score": "0.52529186",
"text": "def set_timezone\n offset, lookup_type = nil, nil\n if geonames_available?\n lookup_type = 'geoname'\n latlon = [params[:latitude].to_f, params[:longitude].to_f]\n timezone = Timezone::Zone.new latlon: latlon\n offset = timezone.utc_offset / (60 * 60)\n end\n\n if offset.nil?\n if params[:offset]\n lookup_type = 'javascript'\n offset = params[:offset]\n # Have to flip the sign because getTimezoneOffset is backward\n offset = -offset.to_i\n else\n lookup_type = 'default'\n current_offset = current_user.preferences[:timezone_offset]\n offset = current_offset ? current_offset : 0\n end\n end\n\n current_user.preferences[:timezone_offset] = offset\n current_user.save\n\n respond_to do |format|\n format.html { render json: { offset: offset, lookup: lookup_type } }\n end\n end",
"title": ""
},
{
"docid": "f024f7495b7cce02bf943acb07dc2204",
"score": "0.5250811",
"text": "def ozone_params\n params.permit(:dataOzone, :node_id)\n end",
"title": ""
},
{
"docid": "567f982b308bbf8a25c9aad557dbf563",
"score": "0.52472216",
"text": "def timezone(identifier)\n identifier = StringDeduper.global.dedupe(identifier)\n @timezones << identifier\n @data_timezones << identifier\n end",
"title": ""
},
{
"docid": "ad260af7f0027ded70c81a44ab2931cc",
"score": "0.5244414",
"text": "def validate_timezone\n self.timezone = 'America/Los_Angeles' if self.timezone.nil?\n if not TZInfo::Timezone.get(self.timezone)\n errors.add(:timezone,'invalid timezone')\n end\n end",
"title": ""
},
{
"docid": "53a6764cf11a9cb543169ed662567dfc",
"score": "0.5243627",
"text": "def time_zone_select(object, method, priority_zones = T.unsafe(nil), options = T.unsafe(nil), html_options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "dd9e8c5f39f6ec6c567210f887ffe946",
"score": "0.5240859",
"text": "def supports_timestamp_timezones?\n true\n end",
"title": ""
},
{
"docid": "dd9e8c5f39f6ec6c567210f887ffe946",
"score": "0.5240859",
"text": "def supports_timestamp_timezones?\n true\n end",
"title": ""
},
{
"docid": "dd9e8c5f39f6ec6c567210f887ffe946",
"score": "0.5240859",
"text": "def supports_timestamp_timezones?\n true\n end",
"title": ""
},
{
"docid": "8615698eed4634c924e1587d417f7ba2",
"score": "0.5239129",
"text": "def add_zone(user_key, zone, resolve_to, subdomains)\n send_req({\n act: :zone_set,\n user_key: user_key,\n zone_name: zone,\n resolve_to: resolve_to,\n subdomains: subdomains.kind_of?(Array) ? zones.join(',') : subdomains\n })\n end",
"title": ""
},
{
"docid": "f66f714d859eeb36551770cf915be33d",
"score": "0.52202314",
"text": "def data_timezone_identifiers; end",
"title": ""
},
{
"docid": "f66f714d859eeb36551770cf915be33d",
"score": "0.52202314",
"text": "def data_timezone_identifiers; end",
"title": ""
},
{
"docid": "f66f714d859eeb36551770cf915be33d",
"score": "0.52202314",
"text": "def data_timezone_identifiers; end",
"title": ""
},
{
"docid": "f66f714d859eeb36551770cf915be33d",
"score": "0.52202314",
"text": "def data_timezone_identifiers; end",
"title": ""
},
{
"docid": "f66f714d859eeb36551770cf915be33d",
"score": "0.52202314",
"text": "def data_timezone_identifiers; end",
"title": ""
},
{
"docid": "f66f714d859eeb36551770cf915be33d",
"score": "0.52202314",
"text": "def data_timezone_identifiers; end",
"title": ""
},
{
"docid": "ec567ec320061878bd39af65b16bc095",
"score": "0.52121276",
"text": "def create\n @erogenous_zone = ErogenousZone.new(params[:erogenous_zone])\n\n respond_to do |format|\n if @erogenous_zone.save\n format.html { redirect_to @erogenous_zone, :notice => 'Erogenous zone was successfully created.' }\n format.json { render :json => @erogenous_zone, :status => :created, :location => @erogenous_zone }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @erogenous_zone.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8f651bdebbe5f2aaa89fdf1d66b5abf9",
"score": "0.52069336",
"text": "def get_time_zones(full = false, ids = nil)\n req = build_soap! do |type, builder|\n unless type == :header\n builder.get_server_time_zones!(full: full, ids: ids)\n end\n end\n result = do_soap_request req, response_class: EwsSoapResponse\n\n if result.success?\n zones = []\n result.response_messages.each do |message|\n elements = message[:get_server_time_zones_response_message][:elems][:time_zone_definitions][:elems]\n elements.each do |definition|\n data = {\n id: definition[:time_zone_definition][:attribs][:id],\n name: definition[:time_zone_definition][:attribs][:name]\n }\n zones << OpenStruct.new(data)\n end\n end\n zones\n else\n raise EwsError, \"Could not get time zones\"\n end\n end",
"title": ""
},
{
"docid": "f66de4f621f4a14a4fa6f8ae3dd63a5f",
"score": "0.520009",
"text": "def get_timezones(user)\n res = user.session.request(\"CakeMail::API::ClassClient\", \"GetTimezones\", {})\n res['timezone']\n end",
"title": ""
},
{
"docid": "4b41776646a8acc667004c45417d4dd8",
"score": "0.5193964",
"text": "def create\n @offset_time = OffsetTime.new(params[:offset_time])\n\n respond_to do |format|\n if @offset_time.save\n format.html { redirect_to @offset_time, notice: 'Offset time was successfully created.' }\n format.json { render json: @offset_time, status: :created, location: @offset_time }\n else\n format.html { render action: \"new\" }\n format.json { render json: @offset_time.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a881e0fb09423ef4a4abccaf3b692cee",
"score": "0.51787764",
"text": "def add_zone!(name)\n zone = add_zone(name)\n zone.save!\n zone\n end",
"title": ""
},
{
"docid": "4884d020072722c43d613e53c539e466",
"score": "0.5169523",
"text": "def create\n @zone_status = ZoneStatus.new(params[:zone_status])\n\n respond_to do |format|\n if @zone_status.save\n format.html { redirect_to @zone_status, notice: 'Zone status was successfully created.' }\n format.json { render json: @zone_status, status: :created, location: @zone_status }\n else\n format.html { render action: \"new\" }\n format.json { render json: @zone_status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "082fdbe07fbab798cf58e51109ad38b6",
"score": "0.5163732",
"text": "def index\n @zones = Zone.all\n render json: @zones\n #@zones\n end",
"title": ""
},
{
"docid": "314455ac6c09ed84fec1a18bb6609b1b",
"score": "0.514667",
"text": "def data_timezone(identifier); end",
"title": ""
},
{
"docid": "314455ac6c09ed84fec1a18bb6609b1b",
"score": "0.514667",
"text": "def data_timezone(identifier); end",
"title": ""
},
{
"docid": "7704edc0be0d31ecbe40a4d10c8e5f1c",
"score": "0.5132468",
"text": "def create\n \n dns_entry_response = RestClient.post('https://api.cloudflare.com/client/v4/zones/:zone_identifier/dns_records',:content_type => :json, :accept => :json, :'x-auth-key' => session[:key] :'x-auth-email' => session[:email])\n\n if JSON.parse(dns_entry_response)[\"success\"]\n @dns_entry = DnsEntry.new(dns_entry_params)\n\n respond_to do |format|\n if @dns_entry.save\n format.html { redirect_to @dns_entry, notice: \"Dns entry was successfully created.\" }\n format.json { render :show, status: :created, location: @dns_entry }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @dns_entry.errors, status: :unprocessable_entity }\n end\n end \n\n end\n\n\n end",
"title": ""
},
{
"docid": "702d9fc7964e4b7c8fb01ce4ccd39d1a",
"score": "0.5129334",
"text": "def create\n @zonas = Zona.all\n @zona = Zona.create(zona_params)\n end",
"title": ""
},
{
"docid": "1e99b394378ac077d29fb0b121d16d12",
"score": "0.5122929",
"text": "def time_zone_select(method, priority_zones = T.unsafe(nil), options = T.unsafe(nil), html_options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "bd586d0a3d68a927fe4ee14e1c2b5247",
"score": "0.5121065",
"text": "def enum_timezones(dir, exclude = T.unsafe(nil), &block); end",
"title": ""
},
{
"docid": "bd586d0a3d68a927fe4ee14e1c2b5247",
"score": "0.5121065",
"text": "def enum_timezones(dir, exclude = T.unsafe(nil), &block); end",
"title": ""
},
{
"docid": "39b79be6fc134e0d8b9dd7f73440f107",
"score": "0.5120171",
"text": "def create\n if @country\n @zone = @country.zones.build(params[:zone])\n else\n @zone = Zone.new(params[:zone])\n end\n\n respond_to do |format|\n if @zone.save\n flash[:notice] = 'Zone was successfully created.'\n format.html { redirect_to(context_url) }\n else\n format.html { render :action => \"new\" }\n end\n end\n end",
"title": ""
},
{
"docid": "61810d98df040a7b864a3e2ab2a50e6c",
"score": "0.51163816",
"text": "def availability_zones\n end",
"title": ""
},
{
"docid": "61810d98df040a7b864a3e2ab2a50e6c",
"score": "0.51163816",
"text": "def availability_zones\n end",
"title": ""
},
{
"docid": "5ef14f356b0fe52980c7b00c87926260",
"score": "0.5110901",
"text": "def all_zones\n @zones = Zone.all\n @user = current_user\n\n respond_to do |format|\n format.html # all_zones.html.erb\n format.json { render json: @zones }\n end\n end",
"title": ""
},
{
"docid": "e502c1392621af9271126f057193fb39",
"score": "0.50887996",
"text": "def create\n @customer_tax_zone = CustomerTaxZone.new(customer_tax_zone_params)\n\n respond_to do |format|\n if @customer_tax_zone.save\n format.html { redirect_to @customer_tax_zone, notice: 'Customer tax zone was successfully created.' }\n format.json { render :show, status: :created, location: @customer_tax_zone }\n else\n format.html { render :new }\n format.json { render json: @customer_tax_zone.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d9064925f735dddcc68ec5f35c0318bc",
"score": "0.50872177",
"text": "def update\n t = Time.now\n @zone.fechacam = t.strftime(\"%d/%m/%Y %H:%M:%S\")\n if @zone.update(zone_params)\n render json: { :message => \"Success!\" }\n else\n render json: @zone.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "c9e3a88f36165e1324d8ad06573ae492",
"score": "0.5080861",
"text": "def create\n Time.zone = rdv_params[:time_zone]\n @rdv = Rdv.new(rdv_params)\n\n respond_to do |format|\n if @rdv.save\n format.html { redirect_to @rdv, notice: 'Appointment was successfully created.' }\n format.json { render :show, status: :created, location: @rdv }\n else\n format.html { render :new }\n format.json { render json: @rdv.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ab52e1e3d08fa959651729d6ac0f0019",
"score": "0.5079876",
"text": "def zone_params\n return {}\n end",
"title": ""
},
{
"docid": "018718f31d6fe89fbb4b4925f4a71790",
"score": "0.5078041",
"text": "def timezone_enum\n TZInfo::Country.get('US').zones.map{|tz|tz.name}\n end",
"title": ""
},
{
"docid": "fc554d41033caead1bf555bc380a91b7",
"score": "0.5064373",
"text": "def zone_names; end",
"title": ""
},
{
"docid": "fc554d41033caead1bf555bc380a91b7",
"score": "0.5064373",
"text": "def zone_names; end",
"title": ""
},
{
"docid": "caf198f8da11fccc342a50a2accbe69f",
"score": "0.5056305",
"text": "def time_zone_select(method, priority_zones = nil, options = {}, html_options = {})\n html_options[:class] = \"#{html_options[:class]} time_zone_select\"\n zone_options = \"\".html_safe\n selected = options.delete(:selected)\n model = options.delete(:model) || ActiveSupport::TimeZone\n zones = model.all\n convert_zones = lambda {|list, selected| \n list.map do |z|\n opts = {\n :value => z.name, \n \"data-time-zone-abbr\" => z.tzinfo.current_period.abbreviation, \n \"data-time-zone-tzname\" => z.tzinfo.name,\n \"data-time-zone-offset\" => z.utc_offset,\n \"data-time-zone-formatted-offset\" => z.formatted_offset\n }\n opts[:selected] = \"selected\" if selected == z.name\n content_tag(:option, z.to_s, opts)\n end.join(\"\\n\")\n }\n if priority_zones\n if priority_zones.is_a?(Regexp)\n priority_zones = model.all.find_all {|z| z =~ priority_zones}\n end\n zone_options += convert_zones.call(priority_zones, selected).html_safe\n zone_options += \"<option value=\\\"\\\" disabled=\\\"disabled\\\">-------------</option>\\n\".html_safe\n zones = zones.reject { |z| priority_zones.include?( z ) }\n end\n zone_options += convert_zones.call(zones, selected).html_safe\n tag = INatInstanceTag.new(\n object_name, method, self\n ).to_select_tag_with_option_tags(zone_options, options, html_options)\n form_field method, tag, options.merge(html_options)\n end",
"title": ""
},
{
"docid": "9452faf0d18393a8a068a402966da7b4",
"score": "0.50562435",
"text": "def initialize(shared_timezones)\n @shared_timezones = shared_timezones\n @timezones = []\n end",
"title": ""
},
{
"docid": "2ea794ee35833021e061a4c62cb11e5b",
"score": "0.50543094",
"text": "def time_zone_options_for_select(selected = T.unsafe(nil), priority_zones = T.unsafe(nil), model = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "f90e904d5d3f57ddaeeaaf45b25b96f7",
"score": "0.5046051",
"text": "def create\n @dns_record = @zone.dns_records.build(dns_record_params)\n @dns_record.ttl = (30 * 60) if @dns_record.ttl.nil?\n respond_to do |format|\n if @dns_record.save\n format.html { redirect_to zone_path(@zone), notice: 'DNS Record was successfully created.' }\n format.json { render :show, status: :created, location: @zone }\n else\n puts \"failed to save DNS record: #{@dns_record.errors.to_json}\"\n format.html { render 'zones/show' }\n format.json { render json: @dns_record.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "129ff57a8d06dba624dbc094d5e060b9",
"score": "0.5045369",
"text": "def update\n @timezone = Timezone.find(params[:id])\n\n respond_to do |format|\n if @timezone.update_attributes(params[:timezone])\n format.html { redirect_to @timezone, notice: 'Timezone was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @timezone.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ab76ca848d216c51bf6041c693d9d049",
"score": "0.50408345",
"text": "def create\n \n params[:task][:time] = parse_task_time(params[:task][:time],params[:anytime][:anytime])\n @task = Task.new(params[:task])\n \n # unless the following 2 commands are executed, the time is saved in the wrong time zone\n @task.start_date = @task.start_date.advance({:hours=>0})\n @task.end_date = @task.end_date.advance({:hours=>0})\n # can't understand why...\n \n respond_to do |format|\n if @task.save\n format.html { redirect_to(tasks_url, :notice => 'Task was successfully created.') }\n format.xml { render :xml => @task, :status => :created, :location => @task }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @task.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "91c4cd1a9ca7a66ba2f58eacf13ce4b7",
"score": "0.5037935",
"text": "def timezone_identifiers\n @timezone_index\n end",
"title": ""
},
{
"docid": "483730f3f768c684543b8a05a1f354e2",
"score": "0.50372565",
"text": "def availability_zones\n data[:availability_zones]\n end",
"title": ""
},
{
"docid": "5212c786a793c912026eb15588ab0fc4",
"score": "0.50361997",
"text": "def time_zone=(value)\n @time_zone = value\n end",
"title": ""
},
{
"docid": "5d30f72c98994e23042d905193338ebf",
"score": "0.5034",
"text": "def fips_tz_params\n params.require(:fips_tz).permit(:tz_n, :url_string_fips, :doc, :org, :img, :address_for_reply, :country, :date_start, :date_end, :status)\n end",
"title": ""
},
{
"docid": "f9328f46c519fbaef697d00ea04356d1",
"score": "0.5032297",
"text": "def linked_timezones\n @linked_timezones.freeze\n end",
"title": ""
},
{
"docid": "b431058269e940ea1dda78b35466e9d6",
"score": "0.5031501",
"text": "def index\n @ozones = Ozone.all\n render json: @ozones\n end",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2
|
Use callbacks to share common setup or constraints between actions.
|
[
{
"docid": "68247e16616602a1ed201fe002114820",
"score": "0.0",
"text": "def set_offer\n @offer = Offer.find(params[:id])\n end",
"title": ""
}
] |
[
{
"docid": "bd89022716e537628dd314fd23858181",
"score": "0.6163163",
"text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"title": ""
},
{
"docid": "3db61e749c16d53a52f73ba0492108e9",
"score": "0.6045976",
"text": "def action_hook; end",
"title": ""
},
{
"docid": "b8b36fc1cfde36f9053fe0ab68d70e5b",
"score": "0.5946146",
"text": "def run_actions; end",
"title": ""
},
{
"docid": "3e521dbc644eda8f6b2574409e10a4f8",
"score": "0.591683",
"text": "def define_action_hook; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5890051",
"text": "def actions; end",
"title": ""
},
{
"docid": "bfb8386ef5554bfa3a1c00fa4e20652f",
"score": "0.58349305",
"text": "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "6c8e66d9523b9fed19975542132c6ee4",
"score": "0.5776858",
"text": "def add_actions; end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5703237",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5703237",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "6ce8a8e8407572b4509bb78db9bf8450",
"score": "0.5652805",
"text": "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"title": ""
},
{
"docid": "1964d48e8493eb37800b3353d25c0e57",
"score": "0.5621621",
"text": "def define_action_helpers; end",
"title": ""
},
{
"docid": "5df9f7ffd2cb4f23dd74aada87ad1882",
"score": "0.54210985",
"text": "def post_setup\n end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411113",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411113",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411113",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5391541",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "f099a8475f369ce73a38d665b6ee6877",
"score": "0.53794575",
"text": "def action_run\n end",
"title": ""
},
{
"docid": "2c4e5a90aa8efaaa3ed953818a9b30d2",
"score": "0.5357573",
"text": "def execute(setup)\n @action.call(setup)\n end",
"title": ""
},
{
"docid": "0464870c8688619d6c104d733d355b3b",
"score": "0.53402257",
"text": "def define_action_helpers?; end",
"title": ""
},
{
"docid": "0e7bdc54b0742aba847fd259af1e9f9e",
"score": "0.53394014",
"text": "def set_actions\n actions :all\n end",
"title": ""
},
{
"docid": "5510330550e34a3fd68b7cee18da9524",
"score": "0.53321576",
"text": "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"title": ""
},
{
"docid": "97c8901edfddc990da95704a065e87bc",
"score": "0.53124547",
"text": "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"title": ""
},
{
"docid": "4f9a284723e2531f7d19898d6a6aa20c",
"score": "0.529654",
"text": "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"title": ""
},
{
"docid": "83684438c0a4d20b6ddd4560c7683115",
"score": "0.5296262",
"text": "def before_actions(*logic)\n self.before_actions = logic\n end",
"title": ""
},
{
"docid": "210e0392ceaad5fc0892f1335af7564b",
"score": "0.52952296",
"text": "def setup_handler\n end",
"title": ""
},
{
"docid": "a997ba805d12c5e7f7c4c286441fee18",
"score": "0.52600986",
"text": "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"title": ""
},
{
"docid": "1d50ec65c5bee536273da9d756a78d0d",
"score": "0.52442724",
"text": "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "635288ac8dd59f85def0b1984cdafba0",
"score": "0.5232394",
"text": "def workflow\n end",
"title": ""
},
{
"docid": "e34cc2a25e8f735ccb7ed8361091c83e",
"score": "0.523231",
"text": "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"title": ""
},
{
"docid": "78b21be2632f285b0d40b87a65b9df8c",
"score": "0.5227454",
"text": "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"title": ""
},
{
"docid": "6350959a62aa797b89a21eacb3200e75",
"score": "0.52226824",
"text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"title": ""
},
{
"docid": "923ee705f0e7572feb2c1dd3c154b97c",
"score": "0.52201617",
"text": "def process_action(...)\n send_action(...)\n end",
"title": ""
},
{
"docid": "b89a3908eaa7712bb5706478192b624d",
"score": "0.5212327",
"text": "def before_dispatch(env); end",
"title": ""
},
{
"docid": "7115b468ae54de462141d62fc06b4190",
"score": "0.52079266",
"text": "def after_actions(*logic)\n self.after_actions = logic\n end",
"title": ""
},
{
"docid": "d89a3e408ab56bf20bfff96c63a238dc",
"score": "0.52050185",
"text": "def setup\n # override and do something appropriate\n end",
"title": ""
},
{
"docid": "62c402f0ea2e892a10469bb6e077fbf2",
"score": "0.51754695",
"text": "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"title": ""
},
{
"docid": "72ccb38e1bbd86cef2e17d9d64211e64",
"score": "0.51726824",
"text": "def setup(_context)\n end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51710224",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "1fd817f354d6cb0ff1886ca0a2b6cce4",
"score": "0.5166172",
"text": "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"title": ""
},
{
"docid": "5531df39ee7d732600af111cf1606a35",
"score": "0.5159343",
"text": "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"title": ""
},
{
"docid": "bb6aed740c15c11ca82f4980fe5a796a",
"score": "0.51578903",
"text": "def determine_valid_action\n\n end",
"title": ""
},
{
"docid": "b38f9d83c26fd04e46fe2c961022ff86",
"score": "0.51522785",
"text": "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"title": ""
},
{
"docid": "199fce4d90958e1396e72d961cdcd90b",
"score": "0.5152022",
"text": "def startcompany(action)\n @done = true\n action.setup\n end",
"title": ""
},
{
"docid": "994d9fe4eb9e2fc503d45c919547a327",
"score": "0.51518047",
"text": "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"title": ""
},
{
"docid": "62fabe9dfa2ec2ff729b5a619afefcf0",
"score": "0.51456624",
"text": "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"title": ""
},
{
"docid": "faddd70d9fef5c9cd1f0d4e673e408b9",
"score": "0.51398855",
"text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"title": ""
},
{
"docid": "adb8115fce9b2b4cb9efc508a11e5990",
"score": "0.5133759",
"text": "def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"title": ""
},
{
"docid": "e1dd18cf24d77434ec98d1e282420c84",
"score": "0.5112076",
"text": "def setup(&block)\n define_method(:setup, &block)\n end",
"title": ""
},
{
"docid": "3b4fb29fa45f95d436fd3a8987f12de7",
"score": "0.5111866",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "3b4fb29fa45f95d436fd3a8987f12de7",
"score": "0.5111866",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110294",
"text": "def action\n end",
"title": ""
},
{
"docid": "f54964387b0ee805dbd5ad5c9a699016",
"score": "0.5106169",
"text": "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"title": ""
},
{
"docid": "35b302dd857a031b95bc0072e3daa707",
"score": "0.509231",
"text": "def config(action, *args); end",
"title": ""
},
{
"docid": "bc3cd61fa2e274f322b0b20e1a73acf8",
"score": "0.50873137",
"text": "def setup\n @setup_proc.call(self) if @setup_proc\n end",
"title": ""
},
{
"docid": "5c3cfcbb42097019c3ecd200acaf9e50",
"score": "0.5081088",
"text": "def before_action \n end",
"title": ""
},
{
"docid": "246840a409eb28800dc32d6f24cb1c5e",
"score": "0.508059",
"text": "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"title": ""
},
{
"docid": "dfbcf4e73466003f1d1275cdf58a926a",
"score": "0.50677156",
"text": "def action\n end",
"title": ""
},
{
"docid": "36eb407a529f3fc2d8a54b5e7e9f3e50",
"score": "0.50562143",
"text": "def matt_custom_action_begin(label); end",
"title": ""
},
{
"docid": "b6c9787acd00c1b97aeb6e797a363364",
"score": "0.5050554",
"text": "def setup\n # override this if needed\n end",
"title": ""
},
{
"docid": "9fc229b5b48edba9a4842a503057d89a",
"score": "0.50474834",
"text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"title": ""
},
{
"docid": "9fc229b5b48edba9a4842a503057d89a",
"score": "0.50474834",
"text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"title": ""
},
{
"docid": "fd421350722a26f18a7aae4f5aa1fc59",
"score": "0.5036181",
"text": "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"title": ""
},
{
"docid": "d02030204e482cbe2a63268b94400e71",
"score": "0.5026331",
"text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"title": ""
},
{
"docid": "4224d3231c27bf31ffc4ed81839f8315",
"score": "0.5022976",
"text": "def after(action)\n invoke_callbacks *options_for(action).after\n end",
"title": ""
},
{
"docid": "24506e3666fd6ff7c432e2c2c778d8d1",
"score": "0.5015441",
"text": "def pre_task\n end",
"title": ""
},
{
"docid": "0c16dc5c1875787dacf8dc3c0f871c53",
"score": "0.50121695",
"text": "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"title": ""
},
{
"docid": "c99a12c5761b742ccb9c51c0e99ca58a",
"score": "0.5000944",
"text": "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"title": ""
},
{
"docid": "0cff1d3b3041b56ce3773d6a8d6113f2",
"score": "0.5000019",
"text": "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"title": ""
},
{
"docid": "791f958815c2b2ac16a8ca749a7a822e",
"score": "0.4996878",
"text": "def setup_signals; end",
"title": ""
},
{
"docid": "6e44984b54e36973a8d7530d51a17b90",
"score": "0.4989888",
"text": "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"title": ""
},
{
"docid": "6e44984b54e36973a8d7530d51a17b90",
"score": "0.4989888",
"text": "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"title": ""
},
{
"docid": "5aa51b20183964c6b6f46d150b0ddd79",
"score": "0.49864885",
"text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"title": ""
},
{
"docid": "7647b99591d6d687d05b46dc027fbf23",
"score": "0.49797225",
"text": "def initialize(*args)\n super\n @action = :set\nend",
"title": ""
},
{
"docid": "67e7767ce756766f7c807b9eaa85b98a",
"score": "0.49785787",
"text": "def after_set_callback; end",
"title": ""
},
{
"docid": "2a2b0a113a73bf29d5eeeda0443796ec",
"score": "0.4976161",
"text": "def setup\n #implement in subclass;\n end",
"title": ""
},
{
"docid": "63e628f34f3ff34de8679fb7307c171c",
"score": "0.49683493",
"text": "def lookup_action; end",
"title": ""
},
{
"docid": "a5294693c12090c7b374cfa0cabbcf95",
"score": "0.4965126",
"text": "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"title": ""
},
{
"docid": "57dbfad5e2a0e32466bd9eb0836da323",
"score": "0.4958034",
"text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"title": ""
},
{
"docid": "5b6d613e86d3d68152f7fa047d38dabb",
"score": "0.49559742",
"text": "def release_actions; end",
"title": ""
},
{
"docid": "4aceccac5b1bcf7d22c049693b05f81c",
"score": "0.4954353",
"text": "def around_hooks; end",
"title": ""
},
{
"docid": "2318410efffb4fe5fcb97970a8700618",
"score": "0.49535993",
"text": "def save_action; end",
"title": ""
},
{
"docid": "64e0f1bb6561b13b482a3cc8c532cc37",
"score": "0.4952725",
"text": "def setup(easy)\n super\n easy.customrequest = @verb\n end",
"title": ""
},
{
"docid": "fbd0db2e787e754fdc383687a476d7ec",
"score": "0.49467874",
"text": "def action_target()\n \n end",
"title": ""
},
{
"docid": "b280d59db403306d7c0f575abb19a50f",
"score": "0.49423352",
"text": "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"title": ""
},
{
"docid": "9f7547d93941fc2fcc7608fdf0911643",
"score": "0.49325448",
"text": "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"title": ""
},
{
"docid": "da88436fe6470a2da723e0a1b09a0e80",
"score": "0.49282882",
"text": "def before_setup\n # do nothing by default\n end",
"title": ""
},
{
"docid": "17ffe00a5b6f44f2f2ce5623ac3a28cd",
"score": "0.49269363",
"text": "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"title": ""
},
{
"docid": "21d75f9f5765eb3eb36fcd6dc6dc2ec3",
"score": "0.49269104",
"text": "def default_action; end",
"title": ""
},
{
"docid": "3ba85f3cb794f951b05d5907f91bd8ad",
"score": "0.49252945",
"text": "def setup(&blk)\n @setup_block = blk\n end",
"title": ""
},
{
"docid": "80834fa3e08bdd7312fbc13c80f89d43",
"score": "0.4923091",
"text": "def callback_phase\n super\n end",
"title": ""
},
{
"docid": "f1da8d654daa2cd41cb51abc7ee7898f",
"score": "0.49194667",
"text": "def advice\n end",
"title": ""
},
{
"docid": "99a608ac5478592e9163d99652038e13",
"score": "0.49174926",
"text": "def _handle_action_missing(*args); end",
"title": ""
},
{
"docid": "9e264985e628b89f1f39d574fdd7b881",
"score": "0.49173003",
"text": "def duas1(action)\n action.call\n action.call\nend",
"title": ""
},
{
"docid": "399ad686f5f38385ff4783b91259dbd7",
"score": "0.49171105",
"text": "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"title": ""
},
{
"docid": "0dccebcb0ecbb1c4dcbdddd4fb11bd8a",
"score": "0.4915879",
"text": "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"title": ""
},
{
"docid": "6e0842ade69d031131bf72e9d2a8c389",
"score": "0.49155936",
"text": "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2
|
Use callbacks to share common setup or constraints between actions.
|
[
{
"docid": "e8a57ee957edf16d5dc2a9dda2802661",
"score": "0.0",
"text": "def set_attempt\n @attempt = Attempt.find(params[:id])\n end",
"title": ""
}
] |
[
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60339177",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.60135007",
"text": "def on_setup_callbacks; end",
"title": ""
},
{
"docid": "311e95e92009c313c8afd74317018994",
"score": "0.59219855",
"text": "def setup_actions\n domain = @apps.domain\n path_user = '/a/feeds/'+domain+'/user/2.0'\n path_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n path_email_list = '/a/feeds/'+domain+'/emailList/2.0'\n path_group = '/a/feeds/group/2.0/'+domain\n\n @apps.register_action(:domain_login, {:method => 'POST', :path => '/accounts/ClientLogin' })\n @apps.register_action(:user_create, { :method => 'POST', :path => path_user })\n @apps.register_action(:user_retrieve, { :method => 'GET', :path => path_user+'/' })\n @apps.register_action(:user_retrieve_all, { :method => 'GET', :path => path_user })\n @apps.register_action(:user_update, { :method => 'PUT', :path => path_user +'/' })\n @apps.register_action(:user_delete, { :method => 'DELETE', :path => path_user +'/' })\n @apps.register_action(:nickname_create, { :method => 'POST', :path =>path_nickname })\n @apps.register_action(:nickname_retrieve, { :method => 'GET', :path =>path_nickname+'/' })\n @apps.register_action(:nickname_retrieve_all_for_user, { :method => 'GET', :path =>path_nickname+'?username=' })\n @apps.register_action(:nickname_retrieve_all_in_domain, { :method => 'GET', :path =>path_nickname })\n @apps.register_action(:nickname_delete, { :method => 'DELETE', :path =>path_nickname+'/' })\n @apps.register_action(:group_create, { :method => 'POST', :path => path_group })\n @apps.register_action(:group_update, { :method => 'PUT', :path => path_group })\n @apps.register_action(:group_retrieve, { :method => 'GET', :path => path_group })\n @apps.register_action(:group_delete, { :method => 'DELETE', :path => path_group })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>'' })\n end",
"title": ""
},
{
"docid": "8315debee821f8bfc9718d31b654d2de",
"score": "0.5913137",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "8315debee821f8bfc9718d31b654d2de",
"score": "0.5913137",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "bfea4d21895187a799525503ef403d16",
"score": "0.589884",
"text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5890051",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5890051",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5890051",
"text": "def actions; end",
"title": ""
},
{
"docid": "352de4abc4d2d9a1df203735ef5f0b86",
"score": "0.5889191",
"text": "def required_action\n # TODO: implement\n end",
"title": ""
},
{
"docid": "8713cb2364ff3f2018b0d52ab32dbf37",
"score": "0.58780754",
"text": "def define_action_helpers\n if action == :save\n if super(:create_or_update)\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n else\n super\n end\n end",
"title": ""
},
{
"docid": "a80b33627067efa06c6204bee0f5890e",
"score": "0.5863248",
"text": "def actions\n\n end",
"title": ""
},
{
"docid": "930a930e57ae15f432a627a277647f2e",
"score": "0.58094144",
"text": "def setup_actions\n domain = @apps.domain\n path_base = '/a/feeds/emailsettings/2.0/'+domain+'/'\n\n @apps.register_action(:create_label, {:method => 'POST', :path => path_base })\n @apps.register_action(:create_filter, { :method => 'POST', :path => path_base })\n @apps.register_action(:create_send_as, { :method => 'POST', :path => path_base })\n @apps.register_action(:update_webclip, { :method => 'PUT', :path => path_base })\n @apps.register_action(:update_forward, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_pop, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_imap, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_vacation, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_signature, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_language, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_general, { :method => 'PUT', :path =>path_base })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>nil })\n end",
"title": ""
},
{
"docid": "33ff963edc7c4c98d1b90e341e7c5d61",
"score": "0.57375425",
"text": "def setup\n common_setup\n end",
"title": ""
},
{
"docid": "a5ca4679d7b3eab70d3386a5dbaf27e1",
"score": "0.57285565",
"text": "def perform_setup\n end",
"title": ""
},
{
"docid": "ec7554018a9b404d942fc0a910ed95d9",
"score": "0.57149214",
"text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5703237",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "c85b0efcd2c46a181a229078d8efb4de",
"score": "0.56900954",
"text": "def custom_setup\n\n end",
"title": ""
},
{
"docid": "100180fa74cf156333d506496717f587",
"score": "0.56665677",
"text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend",
"title": ""
},
{
"docid": "2198a9876a6ec535e7dcf0fd476b092f",
"score": "0.5651118",
"text": "def initial_action; end",
"title": ""
},
{
"docid": "b9b75a9e2eab9d7629c38782c0f3b40b",
"score": "0.5648135",
"text": "def setup_intent; end",
"title": ""
},
{
"docid": "471d64903a08e207b57689c9fbae0cf9",
"score": "0.56357735",
"text": "def setup_controllers &proc\n @global_setup = proc\n self\n end",
"title": ""
},
{
"docid": "468d85305e6de5748477545f889925a7",
"score": "0.5627078",
"text": "def inner_action; end",
"title": ""
},
{
"docid": "bb445e7cc46faa4197184b08218d1c6d",
"score": "0.5608873",
"text": "def pre_action\n # Override this if necessary.\n end",
"title": ""
},
{
"docid": "432f1678bb85edabcf1f6d7150009703",
"score": "0.5598699",
"text": "def target_callbacks() = commands",
"title": ""
},
{
"docid": "48804b0fa534b64e7885b90cf11bff31",
"score": "0.5598419",
"text": "def execute_callbacks; end",
"title": ""
},
{
"docid": "5aab98e3f069a87e5ebe77b170eab5b9",
"score": "0.5589822",
"text": "def api_action!(*args)\n type = self.class.name.split(\"::\").last.downcase\n run_callbacks_for([\"before_#{type}\", :before], *args)\n result = nil\n begin\n result = yield if block_given?\n run_callbacks_for([\"after_#{type}\", :after], *args)\n result\n rescue => err\n run_callbacks_for([\"failed_#{type}\", :failed], *(args + [err]))\n raise\n end\n end",
"title": ""
},
{
"docid": "9efbca664902d80a451ef6cff0334fe2",
"score": "0.5558845",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "9efbca664902d80a451ef6cff0334fe2",
"score": "0.5558845",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "482481e8cf2720193f1cdcf32ad1c31c",
"score": "0.55084664",
"text": "def required_keys(action)\n\n end",
"title": ""
},
{
"docid": "353fd7d7cf28caafe16d2234bfbd3d16",
"score": "0.5504379",
"text": "def assign_default_callbacks(action_name, is_member=false)\n if ResourceController::DEFAULT_ACTIONS.include?(action_name)\n DefaultActions.send(action_name, self)\n elsif is_member\n send(action_name).build { load_object }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => object }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { render :xml => object.errors }\n else\n send(action_name).build { load_collection }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => collection }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { head 500 }\n end\n end",
"title": ""
},
{
"docid": "dcf95c552669536111d95309d8f4aafd",
"score": "0.5465574",
"text": "def layout_actions\n \n end",
"title": ""
},
{
"docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40",
"score": "0.5464707",
"text": "def on_setup(&block); end",
"title": ""
},
{
"docid": "8ab2a5ea108f779c746016b6f4a7c4a8",
"score": "0.54471064",
"text": "def testCase_001\n test_case_title # fw3_actions.rb\n setup # fw3_global_methods.rb\n \n get_page_url # fw3_actions.rb\n validate_page_title # fw3_actions.rb\n validate_page_link_set # fw3_actions.rb\n \n teardown # fw3_global_methods.rb\nend",
"title": ""
},
{
"docid": "e3aadf41537d03bd18cf63a3653e05aa",
"score": "0.54455084",
"text": "def before(action)\n invoke_callbacks *options_for(action).before\n end",
"title": ""
},
{
"docid": "6bd37bc223849096c6ea81aeb34c207e",
"score": "0.5437386",
"text": "def post_setup\n end",
"title": ""
},
{
"docid": "07fd9aded4aa07cbbba2a60fda726efe",
"score": "0.54160327",
"text": "def testCase_001\n testTitle # fw2_actions.rb\n setup # fw2_global_methods.rb\n get_page_url # fw2_actions.rb\n validate_title # fw2_actions.rb\n teardown # fw2_global_methods.rb\nend",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411113",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411113",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "9358208395c0869021020ae39071eccd",
"score": "0.5397424",
"text": "def post_setup; end",
"title": ""
},
{
"docid": "cb5bad618fb39e01c8ba64257531d610",
"score": "0.5392518",
"text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5391541",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5391541",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "a468b256a999961df3957e843fd9bdf4",
"score": "0.5385411",
"text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end",
"title": ""
},
{
"docid": "f099a8475f369ce73a38d665b6ee6877",
"score": "0.53794575",
"text": "def action_run\n end",
"title": ""
},
{
"docid": "2c4e5a90aa8efaaa3ed953818a9b30d2",
"score": "0.5357573",
"text": "def execute(setup)\n @action.call(setup)\n end",
"title": ""
},
{
"docid": "118932433a8cfef23bb8a921745d6d37",
"score": "0.53487605",
"text": "def register_action(action); end",
"title": ""
},
{
"docid": "725216eb875e8fa116cd55eac7917421",
"score": "0.5346655",
"text": "def setup\n @controller.setup\n end",
"title": ""
},
{
"docid": "39c39d6fe940796aadbeaef0ce1c360b",
"score": "0.53448105",
"text": "def setup_phase; end",
"title": ""
},
{
"docid": "bd03e961c8be41f20d057972c496018c",
"score": "0.5342072",
"text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end",
"title": ""
},
{
"docid": "c6352e6eaf17cda8c9d2763f0fbfd99d",
"score": "0.5341318",
"text": "def initial_action=(_arg0); end",
"title": ""
},
{
"docid": "207a668c9bce9906f5ec79b75b4d8ad7",
"score": "0.53243506",
"text": "def before_setup\n\n end",
"title": ""
},
{
"docid": "669ee5153c4dc8ee81ff32c4cefdd088",
"score": "0.53025913",
"text": "def ensure_before_and_after; end",
"title": ""
},
{
"docid": "c77ece7b01773fb7f9f9c0f1e8c70332",
"score": "0.5283114",
"text": "def setup!\n adding_handlers do\n check_arity\n apply_casting\n check_validation\n end\n end",
"title": ""
},
{
"docid": "1e1e48767a7ac23eb33df770784fec61",
"score": "0.5282289",
"text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"title": ""
},
{
"docid": "4ad1208a9b6d80ab0dd5dccf8157af63",
"score": "0.52585614",
"text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end",
"title": ""
},
{
"docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7",
"score": "0.52571374",
"text": "def define_callbacks(*args)\n if abstract_class\n all_shards.each do |model|\n model.define_callbacks(*args)\n end\n end\n\n super\n end",
"title": ""
},
{
"docid": "fc88422a7a885bac1df28883547362a7",
"score": "0.52483684",
"text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end",
"title": ""
},
{
"docid": "8945e9135e140a6ae6db8d7c3490a645",
"score": "0.5244467",
"text": "def action_awareness\n if action_aware?\n if !@options.key?(:allow_nil)\n if @required\n @allow_nil = false\n else\n @allow_nil = true\n end\n end\n if as_action != \"create\"\n @required = false\n end\n end\n end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "7b3954deb2995cf68646c7333c15087b",
"score": "0.5236853",
"text": "def after_setup\n end",
"title": ""
},
{
"docid": "1dddf3ac307b09142d0ad9ebc9c4dba9",
"score": "0.52330637",
"text": "def external_action\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "5772d1543808c2752c186db7ce2c2ad5",
"score": "0.52300817",
"text": "def actions(state:)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "64a6d16e05dd7087024d5170f58dfeae",
"score": "0.522413",
"text": "def setup_actions(domain)\n\t\t\tpath_user = '/a/feeds/'+domain+'/user/2.0'\n\t\t\tpath_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n\t\t\tpath_group = '/a/feeds/group/2.0/'+domain # path for Google groups\n\n\t\t\taction = Hash.new\n\t\t\taction[:domain_login] = {:method => 'POST', :path => '/accounts/ClientLogin' }\n\t\t\taction[:user_create] = { :method => 'POST', :path => path_user }\n\t\t\taction[:user_retrieve] = { :method => 'GET', :path => path_user+'/' }\n\t\t\taction[:user_retrieve_all] = { :method => 'GET', :path => path_user } \n\t\t\taction[:user_update] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_rename] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_delete] = { :method => 'DELETE', :path => path_user +'/' }\n\t\t\taction[:nickname_create] = { :method => 'POST', :path =>path_nickname }\n\t\t\taction[:nickname_retrieve] = { :method => 'GET', :path =>path_nickname+'/' }\n\t\t\taction[:nickname_retrieve_all_for_user] = { :method => 'GET', :path =>path_nickname+'?username=' }\n\t\t\taction[:nickname_retrieve_all_in_domain] = { :method => 'GET', :path =>path_nickname }\n\t\t\taction[:nickname_delete] = { :method => 'DELETE', :path =>path_nickname+'/' }\n\t\t\taction[:group_create] = { :method => 'POST', :path =>path_group }\n\t\t\taction[:group_update] = { :method => 'PUT', :path =>path_group+'/' }\n\t\t\taction[:group_delete] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:groups_retrieve] = { :method => 'GET', :path =>path_group+'?member=' }\n\t\t\taction[:all_groups_retrieve] = { :method => 'GET', :path =>path_group }\n\t\t\taction[:membership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:membership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:membership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_members_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:ownership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:ownership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:ownership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_owners_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\n\t\t\t# special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n\t\t\taction[:next] = {:method => 'GET', :path =>nil }\n\t\t\treturn action \t\n\t\tend",
"title": ""
},
{
"docid": "6350959a62aa797b89a21eacb3200e75",
"score": "0.52226824",
"text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"title": ""
},
{
"docid": "db0cb7d7727f626ba2dca5bc72cea5a6",
"score": "0.521999",
"text": "def process_params\n set_params_authable if process_params_authable?\n set_params_ownerable if process_params_ownerable?\n set_params_sub_action\n end",
"title": ""
},
{
"docid": "8d7ed2ff3920c2016c75f4f9d8b5a870",
"score": "0.5215832",
"text": "def pick_action; end",
"title": ""
},
{
"docid": "7bbfb366d2ee170c855b1d0141bfc2a3",
"score": "0.5213786",
"text": "def proceed_with(action, *arguments)\n self.class.decouplings.each do |decoupler|\n decoupler.run_on(self, action, *arguments)\n end\n end",
"title": ""
},
{
"docid": "78ecc6a2dfbf08166a7a1360bc9c35ef",
"score": "0.52100146",
"text": "def define_action_helpers\n if action_hook\n @action_hook_defined = true\n define_action_hook\n end\n end",
"title": ""
},
{
"docid": "2aba2d3187e01346918a6557230603c7",
"score": "0.52085197",
"text": "def ac_action(&blk)\n @action = blk\n end",
"title": ""
},
{
"docid": "4c23552739b40c7886414af61210d31c",
"score": "0.5203262",
"text": "def execute_pre_setup_actions(test_instance,runner=nil)\n self.class.pre_setup_actions.each do |action|\n action.call test_instance\n end\n end",
"title": ""
},
{
"docid": "691d5a5bcefbef8c08db61094691627c",
"score": "0.5202406",
"text": "def performed(action)\n end",
"title": ""
},
{
"docid": "6a98e12d6f15af80f63556fcdd01e472",
"score": "0.520174",
"text": "def perform_setup\n ## Run global setup before example\n Alfred.configuration.setup.each do |setup|\n @request.perform_setup(&setup)\n end\n\n ## Run setup blocks for scenario\n setups.each { |setup| @request.perform_setup(&setup) }\n end",
"title": ""
},
{
"docid": "d56f4ec734e3f3bc1ad913b36ff86130",
"score": "0.5201504",
"text": "def create_setup\n \n end",
"title": ""
},
{
"docid": "ad33138fb4bd42d9785a8f84821bfd88",
"score": "0.51963276",
"text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"title": ""
},
{
"docid": "ad33138fb4bd42d9785a8f84821bfd88",
"score": "0.51963276",
"text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"title": ""
},
{
"docid": "7fca702f2da4dbdc9b39e5107a2ab87d",
"score": "0.5191404",
"text": "def add_transition_callbacks\n %w(before after).each {|type| owner_class.define_callbacks(\"#{type}_transition_#{attribute}\") }\n end",
"title": ""
},
{
"docid": "063b82c93b47d702ef6bddadb6f0c76e",
"score": "0.5178325",
"text": "def setup(instance)\n action(:setup, instance)\n end",
"title": ""
},
{
"docid": "9f1f73ee40d23f6b808bb3fbbf6af931",
"score": "0.51765746",
"text": "def setup( *args )\n\t\t\tself.class.setupMethods.each {|sblock|\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\tend",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51710224",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51710224",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51710224",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "7a0c9d839516dc9d0014e160b6e625a8",
"score": "0.5162045",
"text": "def setup(request)\n end",
"title": ""
},
{
"docid": "e441ee807f2820bf3655ff2b7cf397fc",
"score": "0.5150735",
"text": "def after_setup; end",
"title": ""
},
{
"docid": "1d375c9be726f822b2eb9e2a652f91f6",
"score": "0.5143402",
"text": "def before *actions, &proc\n actions = ['*'] if actions.size == 0\n actions.each { |a| @callbacks[:a][a] = proc }\n end",
"title": ""
},
{
"docid": "c594a0d7b6ae00511d223b0533636c9c",
"score": "0.51415485",
"text": "def code_action_provider; end",
"title": ""
},
{
"docid": "faddd70d9fef5c9cd1f0d4e673e408b9",
"score": "0.51398855",
"text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"title": ""
},
{
"docid": "2fcff037e3c18a5eb8d964f8f0a62ebe",
"score": "0.51376045",
"text": "def setup(params)\n end",
"title": ""
},
{
"docid": "111fd47abd953b35a427ff0b098a800a",
"score": "0.51318985",
"text": "def setup\n make_notification_owner\n load_superusers\n admin_sets.each do |as|\n @logger.debug \"Attempting to make admin set for #{as}\"\n make_admin_set_from_config(as)\n end\n load_workflows\n everyone_can_deposit_everywhere\n give_superusers_superpowers\n end",
"title": ""
},
{
"docid": "f2ac709e70364fce188bb24e414340ea",
"score": "0.5115387",
"text": "def setup_defaults\n add_help\n @handler = Cliqr::Util.forward_to_help_handler if @handler.nil? && help? && actions?\n @actions.each(&:setup_defaults)\n end",
"title": ""
},
{
"docid": "3b4fb29fa45f95d436fd3a8987f12de7",
"score": "0.5111866",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110294",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110294",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110294",
"text": "def action\n end",
"title": ""
},
{
"docid": "4c7a1503a86fb26f1e4b4111925949a2",
"score": "0.5109771",
"text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end",
"title": ""
},
{
"docid": "63849e121dcfb8a1b963f040d0fe3c28",
"score": "0.5107364",
"text": "def perform_action(action, item)\n if action == :approve\n approve(item.fullid)\n elsif action == :remove\n remove(item.fullid)\n elsif action == :alert\n #perform_alert() check condition alert params and proceed\n else\n #something isn't cool, pass or error \n end\nend",
"title": ""
},
{
"docid": "f04fd745d027fc758dac7a4ca6440871",
"score": "0.5106081",
"text": "def block_actions options ; end",
"title": ""
},
{
"docid": "0d1c87e5cf08313c959963934383f5ae",
"score": "0.51001656",
"text": "def on_action(action)\n @action = action\n self\n end",
"title": ""
},
{
"docid": "916d3c71d3a5db831a5910448835ad82",
"score": "0.50964546",
"text": "def do_action(action)\n case action\n when \"a\"\n @user_manager.create_user\n when \"b\"\n @user_manager.delete_user\n when \"c\"\n @user_manager.get_info\n when \"d\"\n @user_manager.list_all_users\n when \"quit\", \"exit\"\n bail\n end\n end",
"title": ""
},
{
"docid": "076c761e1e84b581a65903c7c253aa62",
"score": "0.5093199",
"text": "def add_callbacks(base); end",
"title": ""
}
] |
08cd976d55ffdb2798c5d780a68e29dd
|
DELETE /flat/photos/1 DELETE /flat/photos/1.json
|
[
{
"docid": "fe12115890bcae728b7f178425a45ff2",
"score": "0.7665703",
"text": "def destroy\n @flat_photo.destroy\n respond_to do |format|\n format.html { redirect_to flat_photos_url, notice: 'Photo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
[
{
"docid": "88b4ba357dc57343db5b0482c6d20fc3",
"score": "0.7470558",
"text": "def destroy\n @photo.photo.destroy\n @photo.destroy\n respond_to do |format|\n format.html { redirect_to photos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "263cc237843efa8a720c1b8d4840b44b",
"score": "0.74187094",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to photos_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "263cc237843efa8a720c1b8d4840b44b",
"score": "0.74187094",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to photos_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "263cc237843efa8a720c1b8d4840b44b",
"score": "0.74187094",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to photos_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "263cc237843efa8a720c1b8d4840b44b",
"score": "0.74187094",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to photos_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "263cc237843efa8a720c1b8d4840b44b",
"score": "0.74187094",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to photos_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "263cc237843efa8a720c1b8d4840b44b",
"score": "0.74187094",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to photos_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c6c6d6666549eca11ead2bf7fc09f2d4",
"score": "0.74121535",
"text": "def destroy\n @photo = @allbum.photos.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to allbum_photos_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8c44675cc38f771a77d962a50eed3bb7",
"score": "0.7402247",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to photos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8c44675cc38f771a77d962a50eed3bb7",
"score": "0.7402247",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to photos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8c44675cc38f771a77d962a50eed3bb7",
"score": "0.7402247",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to photos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8c44675cc38f771a77d962a50eed3bb7",
"score": "0.7402247",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to photos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8c44675cc38f771a77d962a50eed3bb7",
"score": "0.7402247",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to photos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3cd54aace6657ea67653dc6a47c53554",
"score": "0.73764414",
"text": "def destroy\n @photo.destroy\n respond_to do |format|\n format.html { redirect_to @photo.item }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6ca86fe14340f96fe3979025a6bf21f9",
"score": "0.736793",
"text": "def destroy\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to photos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "559eb398f05d0bb932b51780856dbf65",
"score": "0.73664844",
"text": "def destroy\n @photo1 = Photo1.find(params[:id])\n @photo1.destroy\n\n respond_to do |format|\n format.html { redirect_to photo1s_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "00be74ac5c18a672e4a000093dc7f422",
"score": "0.7358665",
"text": "def destroy\n @photo = Photo.find(params[:id])\n File.delete(Rails.root.join(\"app\",'assets','images',@photo.path))\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to photos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "89f51235072e0528ec8f60d8e5b0e166",
"score": "0.73584795",
"text": "def destroy\r\n @photo = Photo.find(params[:id])\r\n @photo.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to photos_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"title": ""
},
{
"docid": "89f51235072e0528ec8f60d8e5b0e166",
"score": "0.73584795",
"text": "def destroy\r\n @photo = Photo.find(params[:id])\r\n @photo.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to photos_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"title": ""
},
{
"docid": "e7eb9c2d999ad8da869878b813e33fd3",
"score": "0.7348176",
"text": "def destroy\n @photo.destroy\n respond_to do |format|\n format.html { redirect_to photos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e7eb9c2d999ad8da869878b813e33fd3",
"score": "0.7348176",
"text": "def destroy\n @photo.destroy\n respond_to do |format|\n format.html { redirect_to photos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "169b9ebc4d971821c11033617b1d9ed1",
"score": "0.7338218",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to uploads_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bc325e90a8ac66cc3d4a52523c6cde18",
"score": "0.73118633",
"text": "def destroy\n @sample_photo.destroy\n render json: {message: 'Foto Excluida'} , status: :ok\n end",
"title": ""
},
{
"docid": "3e64365f30adab8273ea08eaa0902239",
"score": "0.7309983",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to @photo.photoable }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0263c3bcb8499741ad05038ca5276567",
"score": "0.7289578",
"text": "def destroy\n @photo.destroy\n respond_to do |format|\n format.html { redirect_to uploads_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b8fb763f86ecb48c72f859aba85bcbf9",
"score": "0.72710764",
"text": "def delete photo_id\n @flickr.photos.delete(photo_id: photo_id)\n end",
"title": ""
},
{
"docid": "f7c6c92f1fd0f35731cf4d9b9f1f9934",
"score": "0.7268521",
"text": "def delete\n photo_id = params[:photoId]\n photo = Photo.find(photo_id)\n\n if (photo.nil?)\n raise Exceptions::PhotoHuntError.new(404, 'Photo with given ID does not exist')\n elsif (photo.owner_user_id != session[:user_id])\n raise Exceptions::PhotoHuntError.new(404, 'Photo with given ID does not exist')\n else\n photo.destroy\n end\n\n # TODO(samstern): Figure out why this method works but the Android client\n # reports failure\n render json: 'Photo successfully deleted'\n end",
"title": ""
},
{
"docid": "d1a87f7497f37509401d91a38de4bdc1",
"score": "0.7249155",
"text": "def destroy\n @photo = Photo.find(params[:id])\n gallery = @photo.gallery\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to gallery_path(gallery) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "46c06e4089ac2a42f2b120a8316dc480",
"score": "0.72472197",
"text": "def destroy\n @structure_photo.destroy\n render json: {message: 'Foto Excluida'} , status: :ok\n end",
"title": ""
},
{
"docid": "33631e8474705b54e5b3bde59b7400d7",
"score": "0.72445005",
"text": "def destroy\n \t@album = Album.find(params[:album_id])\n @photo = @album.photos.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to albums_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f186484c3bb8954afb1e063bbf4864e0",
"score": "0.72180754",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to(photos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f186484c3bb8954afb1e063bbf4864e0",
"score": "0.72180754",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to(photos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f186484c3bb8954afb1e063bbf4864e0",
"score": "0.72180754",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to(photos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f186484c3bb8954afb1e063bbf4864e0",
"score": "0.72180754",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to(photos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "880cd82fb26c6f162d32ad80d38226dd",
"score": "0.72176766",
"text": "def destroy\n @photo.destroy\n respond_to do |format|\n format.html { redirect_to photos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b251c449fba4a5dedb06ba89141c239b",
"score": "0.7201541",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to edit_admin_gallery_path(:id=>@gallery.id) }\n format.json { render :json => true }\n end\n end",
"title": ""
},
{
"docid": "7b4fdd52dc73f3b29db36765aae79a62",
"score": "0.7199694",
"text": "def delete(photo)\n photo = photo.id if photo.class == Flickr::Photo\n res = @flickr.call_method('flickr.photos.delete',\n 'photo_id'=>photo)\n end",
"title": ""
},
{
"docid": "1b08ce62c42d00570f56a11b3a418583",
"score": "0.7193256",
"text": "def destroy\n @photo.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "38b25f83182c684d1ff6ee4b3304e5f9",
"score": "0.71910244",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "ff15bec78034d49d9ef322fe01006436",
"score": "0.71894133",
"text": "def destroy\n if @photo.nill?\n render json: {error: 'foto no encontrada'}, status: :not_found\n else\n @photo.destroy\n end\n end",
"title": ""
},
{
"docid": "311f0e7890d1c54669a1ea9beee03814",
"score": "0.7177093",
"text": "def destroy\n @admin_photo = Photo.find(params[:id])\n @admin_photo.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_photos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fc977c4237ee295cafa9ba6a5746652f",
"score": "0.7175832",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to photos_url }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c8e79d64a85e1791bdc5d32371bc5351",
"score": "0.7161725",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to request.env[\"HTTP_REFERER\"] || @photo.photoable, notice: 'Photo removed!' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e2d8cf3b8f3a7682d3c03f55a2ca2449",
"score": "0.71605647",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to user_album_photos_url(@user, @album) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "de0078111765897e53d87e0543a9014a",
"score": "0.7142414",
"text": "def destroy\n query = \"created_by = \\\"#{current_user.email}\\\"\"\n @photo = Photo.where(query).with_attached_images.find(params[:id])\n @photo.destroy\n respond_to do |format|\n format.html { redirect_to photos_path, notice: 'Destroyed successfully.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "58b75c02d4011336449a6d1201901f26",
"score": "0.7129776",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_photos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f62b39aab65d7df4d314f29eb6c9dd7c",
"score": "0.7120271",
"text": "def destroy\n @photo = Photo.find(params[:id])\n\n # Destroy s3 objects\n aws_s3_delete(@photo.key)\n Sebitmin::Application.config.thumbnail_sizes.each do |thumbnail_size|\n aws_s3_delete(@photo[\"thumbnail_key_#{thumbnail_size}\"])\n end\n\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to \"/\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3e8af113e382aa8a7103dfea017e6323",
"score": "0.70958006",
"text": "def destroy\n @photo = Photo.find(params[:id])\n\t@album = Album.find(@photo.album_id)\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to album_path(@album) }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "3a9a3bbafa547f9adfe2fe9e4355c2f5",
"score": "0.7085246",
"text": "def destroy\n @uploadphoto.destroy\n respond_to do |format|\n format.html { redirect_to uploadphotos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0361570d5e1f4b4c1eaae214def83a70",
"score": "0.7067938",
"text": "def destroy\n album=@photo.album\n @photo.destroy\n save_to_json\n respond_to do |format|\n format.html { redirect_to album_path(album), notice: 'Photo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "96526aca3cf265d251f020dca79c319b",
"score": "0.7053478",
"text": "def destroy\n id = @photos.id\n if !@photos.nil? && @photos.destroy\n result = { message: 'Deleted successfully', status: true, id: id }\n else\n result = { message: 'Please try again later', status: false }\n end\n render json: result\n end",
"title": ""
},
{
"docid": "2c8f83c93356ec8a579645d49b93f997",
"score": "0.70406765",
"text": "def destroy\n photo.destroy\n respond_to do |format|\n format.html { redirect_to admin_photos_url, notice: 'Photo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9726e5906847e86574cbf497f2ac9759",
"score": "0.70365626",
"text": "def delete(user)\n Rails.logger.debug \"Call to photo.delete\"\n if !self.file.blank?\n Util.delete_image(self.file) #Delete the image file from the image server\n end\n reqUrl = \"/api/photo/#{self.id}\" #Set the request url\n rest_response = MwHttpRequest.http_delete_request(reqUrl,user['email'],user['password'])#Make the DELETE request to the server with the required parameters\n Rails.logger.debug \"Response from server: #{rest_response.code} #{rest_response.message}: #{rest_response.body}\"\n if rest_response.code == \"200\" #Validate if the response from the server is 200, which means OK\n return true, rest_response #Return success\n else\n return false, \"#{rest_response.code}\", \"#{rest_response.message}\" #Return error\n end\n end",
"title": ""
},
{
"docid": "e5181bbab3322f44c75f970c1b1d4e77",
"score": "0.703213",
"text": "def destroy\n @photo.destroy\n respond_to do |format|\n format.html { redirect_to photos_url, notice: 'Photo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e5181bbab3322f44c75f970c1b1d4e77",
"score": "0.703037",
"text": "def destroy\n @photo.destroy\n respond_to do |format|\n format.html { redirect_to photos_url, notice: 'Photo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e5181bbab3322f44c75f970c1b1d4e77",
"score": "0.703037",
"text": "def destroy\n @photo.destroy\n respond_to do |format|\n format.html { redirect_to photos_url, notice: 'Photo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e5181bbab3322f44c75f970c1b1d4e77",
"score": "0.703037",
"text": "def destroy\n @photo.destroy\n respond_to do |format|\n format.html { redirect_to photos_url, notice: 'Photo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e5181bbab3322f44c75f970c1b1d4e77",
"score": "0.703037",
"text": "def destroy\n @photo.destroy\n respond_to do |format|\n format.html { redirect_to photos_url, notice: 'Photo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e5181bbab3322f44c75f970c1b1d4e77",
"score": "0.703037",
"text": "def destroy\n @photo.destroy\n respond_to do |format|\n format.html { redirect_to photos_url, notice: 'Photo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e5181bbab3322f44c75f970c1b1d4e77",
"score": "0.703037",
"text": "def destroy\n @photo.destroy\n respond_to do |format|\n format.html { redirect_to photos_url, notice: 'Photo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e5181bbab3322f44c75f970c1b1d4e77",
"score": "0.703037",
"text": "def destroy\n @photo.destroy\n respond_to do |format|\n format.html { redirect_to photos_url, notice: 'Photo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e5181bbab3322f44c75f970c1b1d4e77",
"score": "0.703037",
"text": "def destroy\n @photo.destroy\n respond_to do |format|\n format.html { redirect_to photos_url, notice: 'Photo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e5181bbab3322f44c75f970c1b1d4e77",
"score": "0.703037",
"text": "def destroy\n @photo.destroy\n respond_to do |format|\n format.html { redirect_to photos_url, notice: 'Photo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e5181bbab3322f44c75f970c1b1d4e77",
"score": "0.703037",
"text": "def destroy\n @photo.destroy\n respond_to do |format|\n format.html { redirect_to photos_url, notice: 'Photo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e5181bbab3322f44c75f970c1b1d4e77",
"score": "0.703037",
"text": "def destroy\n @photo.destroy\n respond_to do |format|\n format.html { redirect_to photos_url, notice: 'Photo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e5181bbab3322f44c75f970c1b1d4e77",
"score": "0.703037",
"text": "def destroy\n @photo.destroy\n respond_to do |format|\n format.html { redirect_to photos_url, notice: 'Photo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e5181bbab3322f44c75f970c1b1d4e77",
"score": "0.703037",
"text": "def destroy\n @photo.destroy\n respond_to do |format|\n format.html { redirect_to photos_url, notice: 'Photo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e5181bbab3322f44c75f970c1b1d4e77",
"score": "0.703037",
"text": "def destroy\n @photo.destroy\n respond_to do |format|\n format.html { redirect_to photos_url, notice: 'Photo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e5181bbab3322f44c75f970c1b1d4e77",
"score": "0.703037",
"text": "def destroy\n @photo.destroy\n respond_to do |format|\n format.html { redirect_to photos_url, notice: 'Photo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e5181bbab3322f44c75f970c1b1d4e77",
"score": "0.703037",
"text": "def destroy\n @photo.destroy\n respond_to do |format|\n format.html { redirect_to photos_url, notice: 'Photo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e5181bbab3322f44c75f970c1b1d4e77",
"score": "0.703037",
"text": "def destroy\n @photo.destroy\n respond_to do |format|\n format.html { redirect_to photos_url, notice: 'Photo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "23c26edb651719756124582073780ca1",
"score": "0.7025833",
"text": "def destroy\n @rock_photo.destroy\n render json: {message: 'Foto Excluida'} , status: :ok\n end",
"title": ""
},
{
"docid": "0e493ad406f229982e608d4362e451a5",
"score": "0.7024233",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n authorize! :destroy, @photo\n respond_to do |format|\n format.html { redirect_to photos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "36c345011a3dcdc9b0f569049f81ea7f",
"score": "0.70239216",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @album = @photo.album\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_album_url(@album) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "677791e870c584feb2bcc3fe76320d12",
"score": "0.70126146",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @album = @photo.album_id\n @photo.destroy\n respond_to do |format|\n format.html { redirect_to album_photos_path, notice: \"Photo was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a00a0f89b404c0c56c12dddef23823ea",
"score": "0.70124435",
"text": "def destroy\n #@users_photo = UsersPhoto.find(params[:id])\n #@users_photo.destroy\n\n respond_to do |format|\n format.html { redirect_to users_photos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "98b39ad55852f431164e0e15260bef4a",
"score": "0.7006512",
"text": "def destroy\n @album2photo = Album2photo.find(params[:id])\n @album2photo.destroy\n\n respond_to do |format|\n format.html { redirect_to album2photos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7b7b1c6cf154611219e2211c0d4572f7",
"score": "0.6994348",
"text": "def destroy\n @plate_photo = PlatePhoto.find(params[:id])\n @plate_photo.destroy\n\n respond_to do |format|\n format.html { redirect_to plate_photos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9e685d7c74f366d96997e6b44c51f2f2",
"score": "0.6971986",
"text": "def destroy\n @user = current_user\n @customer = @user.customers.find(params[:customer_id])\n @album = @customer.albums.find(params[:album_id])\n @photo = @album.photos.find(params[:id])\n @photo.destroy\n\n render :json => true\n end",
"title": ""
},
{
"docid": "4eb929ea0f2e8da438e5732152899038",
"score": "0.6968077",
"text": "def destroy\n @user_photo = UserPhoto.find(params[:id])\n @user_photo.destroy\n\n respond_to do |format|\n format.html { redirect_to user_photos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6e32cb7b905113711af9a5871ba4fbfd",
"score": "0.6957431",
"text": "def destroy\n @traditional_route_photo.destroy\n respond_to do |format|\n format.html { redirect_to traditional_route_photos_url, notice: 'Traditional route photo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c7a6b9f44cc065a57a5d33b033da542e",
"score": "0.6953021",
"text": "def destroy\r\n @photo.destroy\r\n respond_to do |format|\r\n format.html { redirect_to photos_url, notice: 'Photo was successfully destroyed.' }\r\n format.json { head :no_content }\r\n end\r\n end",
"title": ""
},
{
"docid": "1c8ad2e3a8ee66db705932b9316dc4de",
"score": "0.69478685",
"text": "def destroy\n @photoalbum = Photoalbum.find(params[:id])\n @photoalbum.destroy\n\n respond_to do |format|\n format.html { redirect_to photoalbums_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "8c0d4cc1a5d929a3abce55211dbc33f7",
"score": "0.6946213",
"text": "def destroy\n @recipe_photo.destroy\n respond_to do |format|\n format.html { redirect_to recipe_photos_url, notice: 'Recipe photo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ad548a7ea6470bedc402ee85a8a7797a",
"score": "0.69372183",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to '/home', notice: 'You have deleted the picture' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "09ae348bf2a51cc3378ab86f2e545a1b",
"score": "0.6928084",
"text": "def destroy\n @photo = Photo.find(params[:id])\n if photo_authorize(@photo)\n @photo.destroy\n respond_to do |format|\n format.html { redirect_to photos_url }\n format.json { head :no_content }\n end\n end\n end",
"title": ""
},
{
"docid": "c9c818e91ff33ad3f157fd0b8bc40eb9",
"score": "0.692703",
"text": "def destroy\n @foto.destroy\n respond_to do |format|\n format.html { redirect_to fotos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a2d224130e61649b9e908997faa899b1",
"score": "0.6925049",
"text": "def destroy\n @photo.destroy\n render root_path\n end",
"title": ""
},
{
"docid": "e0ec8e3e6eb0ebdb61769d54e582fa55",
"score": "0.6914864",
"text": "def destroy\n @user_photo.destroy\n respond_to do |format|\n format.html { redirect_to user_photos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ef667fc217da26407a01ee45b0e53672",
"score": "0.6898599",
"text": "def destroy\n @restaurant_photo.destroy\n respond_to do |format|\n format.html { redirect_to restaurant_photos_url, notice: 'Restaurant photo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b4fd09300aeda8b31419ae022b6fa89a",
"score": "0.6895985",
"text": "def destroy\n @shop_photo = ShopPhoto.find(params[:id])\n @shop_photo.destroy\n\n respond_to do |format|\n format.html { redirect_to shop_photos_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "7bab7cce5f03c43264132f6fe50e345a",
"score": "0.68925023",
"text": "def destroy\n alb=@photo.album\n @photo.destroy\n respond_to do |format|\n format.html { redirect_to alb, notice: 'Фотография успешно удалена.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "67a8a2bee1b66ce59e9387f123fdf1b3",
"score": "0.6889663",
"text": "def destroy\n @pin.galleries.each do |f|\n f.photo = nil\n end\n @pin.destroy\n respond_to do |format|\n format.html { redirect_to my_cars_path, notice: 'Destruido correctamente' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "61700e7564745b9eb8eb88f685535a11",
"score": "0.6875534",
"text": "def destroy\n #remove main photo if necessary\n post = Post.where(main_photo: @photo.id).first\n if (post.present?)\n first_photo = Photo.sort_photos_asc.from_post(post.id).first\n if (first_photo.present?)\n post.main_photo = firstPhoto.id\n post.save\n end\n end\n\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to photos_url, notice: 'Photo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7d66166c2d18ccb62d8a30bfba67527c",
"score": "0.6873654",
"text": "def destroy\n @asset = Asset.find(params[:id])\n @asset.photo.destroy\n @asset.save\n redirect_to :back\n end",
"title": ""
},
{
"docid": "afa1f7719f167e0aaa29e5a39102359e",
"score": "0.68656635",
"text": "def destroy\n @foto = Foto.find(params[:id])\n @foto.destroy\n\n respond_to do |format|\n format.html { redirect_to fotos_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "de4f14a444e6b9ba87635660b46204af",
"score": "0.6863167",
"text": "def destroy\n @photo.destroy\n respond_to do |format|\n format.html { redirect_to root_path, notice: \"投稿を削除しました.\" }\n format.json { head :no_content }\n end\n \n end",
"title": ""
},
{
"docid": "9caba82f66b6ca92579f6cd60fe54079",
"score": "0.6861392",
"text": "def destroy\n @photo.destroy\n respond_to do |format|\n format.html { redirect_to :back, notice: 'Photo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f208f1a455ee2426af9d4ce84a824b31",
"score": "0.68575525",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @hastags = Hastag.where(:photo_id => @photo.id)\n @hastags.destroy_all\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to '/home', notice: 'You have deleted the picture' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "11be59ebcce4670dc5bc9dc0cdc10c97",
"score": "0.6856435",
"text": "def destroy\n @photoid = Photoid.find(params[:id])\n @photoid.destroy\n\n respond_to do |format|\n format.html { redirect_to photoids_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
344862a90d3b999fc4be29a5816c168a
|
GET /empresas/new GET /empresas/new.json
|
[
{
"docid": "65989a62e2595cd47ec086428302089f",
"score": "0.7837927",
"text": "def new\n @empresa = Empresa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @empresa }\n end\n end",
"title": ""
}
] |
[
{
"docid": "50d0c91e13c834d2d5eb5377e004e3ae",
"score": "0.78852063",
"text": "def new\n @empleado = Empleado.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @empleado }\n end\n end",
"title": ""
},
{
"docid": "c6de0c829e4a7409971a045dd21657ad",
"score": "0.76929057",
"text": "def new\n @estampado = Estampado.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @estampado }\n end\n end",
"title": ""
},
{
"docid": "31c8c5a421b4dbecf26238b1bf18fb49",
"score": "0.7613125",
"text": "def new\n @newse = Newse.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newse }\n end\n end",
"title": ""
},
{
"docid": "30ad92d18d627f87b8fe94238b8cbbdb",
"score": "0.75662297",
"text": "def new\n @egreso = Egreso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @egreso }\n end\n end",
"title": ""
},
{
"docid": "f73ccb254910b2837edfc037bae393d9",
"score": "0.75651807",
"text": "def new\n @resposta = Resposta.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resposta }\n end\n end",
"title": ""
},
{
"docid": "5c04c8159fe6fd000cee0cad671da8d5",
"score": "0.7533223",
"text": "def new\n @tipo_egreso = TipoEgreso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipo_egreso }\n end\n end",
"title": ""
},
{
"docid": "f8d8eec6c3e0b2b0e835a03180df107f",
"score": "0.75140864",
"text": "def new\n @emplacement = Emplacement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @emplacement }\n end\n end",
"title": ""
},
{
"docid": "6592dbdfba1ea1307bcb96747b0b04b9",
"score": "0.75117296",
"text": "def new\n @admin_empresa = AdminEmpresa.new\n @empresas = Empresa.all\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_empresa }\n end\n end",
"title": ""
},
{
"docid": "3b521a5dc4e9b0c5a84911bd81247573",
"score": "0.75005585",
"text": "def new\n @estacion = Estacion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @estacion }\n end\n end",
"title": ""
},
{
"docid": "cb7c34d65811969df37106b2ef1f012c",
"score": "0.7499155",
"text": "def new\n\tadd_breadcrumb \"Nuevo ejemplar\", :new_ejemplar_path\n @ejemplar = Ejemplar.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @ejemplar }\n end\n end",
"title": ""
},
{
"docid": "fed9ec4dfdaebeb1149f593e4c79722e",
"score": "0.7493471",
"text": "def new\n @establecimiento = Establecimiento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @establecimiento }\n end\n end",
"title": ""
},
{
"docid": "9ceb4829d31f9fbd8a8059c9f9690795",
"score": "0.74401975",
"text": "def new\n @empolyee = Empolyee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @empolyee }\n end\n end",
"title": ""
},
{
"docid": "8f1afc67dc8b59dd3435347319c64348",
"score": "0.7436723",
"text": "def new\n @emptitle = Emptitle.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @emptitle }\n end\n end",
"title": ""
},
{
"docid": "42106658c77bf15bf38275f68b92ce2a",
"score": "0.74304277",
"text": "def new\n @entidade = Entidade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entidade }\n end\n end",
"title": ""
},
{
"docid": "42106658c77bf15bf38275f68b92ce2a",
"score": "0.74304277",
"text": "def new\n @entidade = Entidade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entidade }\n end\n end",
"title": ""
},
{
"docid": "e9e16996ab7e318ade4320453f63da66",
"score": "0.7400465",
"text": "def new\n @esclerosi = Esclerosi.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @esclerosi }\n end\n end",
"title": ""
},
{
"docid": "d0d9aa45809201a7835ae560836bc919",
"score": "0.7394554",
"text": "def new\n @empleado_del_cuerpo_tecnico = EmpleadoDelCuerpoTecnico.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @empleado_del_cuerpo_tecnico }\n end\n end",
"title": ""
},
{
"docid": "2b17fae0166d090de2ccbd8bf677fb0c",
"score": "0.7381195",
"text": "def new\n @entrevista = Entrevista.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entrevista }\n end\n end",
"title": ""
},
{
"docid": "f98d6bcbc7df6f84626bba6030757356",
"score": "0.7377321",
"text": "def new\n @eleccion = Eleccion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @eleccion }\n end\n end",
"title": ""
},
{
"docid": "9ba07f203cc99c54ce5651510da866a7",
"score": "0.73610103",
"text": "def new\n @estudiante = Estudiante.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @estudiante }\n end\n end",
"title": ""
},
{
"docid": "3aa344bdc88b368136fc693a7e96daa5",
"score": "0.7357167",
"text": "def new\n @escritorio = Escritorio.new\n\n respond_to do |format|\n format.html { render layout: nil } # new.html.erb\n format.json { render json: @escritorio }\n end\n end",
"title": ""
},
{
"docid": "e16166750bb4a46039159c9f0650bf57",
"score": "0.73570657",
"text": "def new\n @solicitud = Solicitud.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @solicitud }\n end\n end",
"title": ""
},
{
"docid": "e16166750bb4a46039159c9f0650bf57",
"score": "0.73570657",
"text": "def new\n @solicitud = Solicitud.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @solicitud }\n end\n end",
"title": ""
},
{
"docid": "04b330bce8f6543ce13998b9f700696d",
"score": "0.7344327",
"text": "def new\n @employee = Employee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employee }\n end\n end",
"title": ""
},
{
"docid": "04b330bce8f6543ce13998b9f700696d",
"score": "0.7344327",
"text": "def new\n @employee = Employee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employee }\n end\n end",
"title": ""
},
{
"docid": "04b330bce8f6543ce13998b9f700696d",
"score": "0.7344327",
"text": "def new\n @employee = Employee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employee }\n end\n end",
"title": ""
},
{
"docid": "04b330bce8f6543ce13998b9f700696d",
"score": "0.7344327",
"text": "def new\n @employee = Employee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employee }\n end\n end",
"title": ""
},
{
"docid": "04b330bce8f6543ce13998b9f700696d",
"score": "0.7344327",
"text": "def new\n @employee = Employee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employee }\n end\n end",
"title": ""
},
{
"docid": "04b330bce8f6543ce13998b9f700696d",
"score": "0.7344327",
"text": "def new\n @employee = Employee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employee }\n end\n end",
"title": ""
},
{
"docid": "04b330bce8f6543ce13998b9f700696d",
"score": "0.7344327",
"text": "def new\n @employee = Employee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employee }\n end\n end",
"title": ""
},
{
"docid": "04b330bce8f6543ce13998b9f700696d",
"score": "0.7344327",
"text": "def new\n @employee = Employee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employee }\n end\n end",
"title": ""
},
{
"docid": "04b330bce8f6543ce13998b9f700696d",
"score": "0.7344327",
"text": "def new\n @employee = Employee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employee }\n end\n end",
"title": ""
},
{
"docid": "04b330bce8f6543ce13998b9f700696d",
"score": "0.7344327",
"text": "def new\n @employee = Employee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employee }\n end\n end",
"title": ""
},
{
"docid": "04b330bce8f6543ce13998b9f700696d",
"score": "0.7344327",
"text": "def new\n @employee = Employee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employee }\n end\n end",
"title": ""
},
{
"docid": "04b330bce8f6543ce13998b9f700696d",
"score": "0.7344327",
"text": "def new\n @employee = Employee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employee }\n end\n end",
"title": ""
},
{
"docid": "cad0853a531674892a7fbc322b5503f5",
"score": "0.7342119",
"text": "def new\n @estetica = Estetica.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @estetica }\n end\n end",
"title": ""
},
{
"docid": "054f958d71f6df6090acd62465ac7b1d",
"score": "0.73395544",
"text": "def new\n\t\t@empleado = Empleado.new\n\t\t@query = Persona.find(:all)\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.xml { render :xml => @empleado }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "22923f5c2dbbcdbba141f48f1e85e4c7",
"score": "0.73341656",
"text": "def new\n @nota_entrega = NotaEntrega.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @nota_entrega }\n end\n end",
"title": ""
},
{
"docid": "bfeaa71832e5c50bb4d91935a3748b78",
"score": "0.7333892",
"text": "def new\n @reserva = Reserva.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reserva }\n end\n end",
"title": ""
},
{
"docid": "bfeaa71832e5c50bb4d91935a3748b78",
"score": "0.7333892",
"text": "def new\n @reserva = Reserva.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reserva }\n end\n end",
"title": ""
},
{
"docid": "bfeaa71832e5c50bb4d91935a3748b78",
"score": "0.7333892",
"text": "def new\n @reserva = Reserva.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reserva }\n end\n end",
"title": ""
},
{
"docid": "bfeaa71832e5c50bb4d91935a3748b78",
"score": "0.7333892",
"text": "def new\n @reserva = Reserva.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reserva }\n end\n end",
"title": ""
},
{
"docid": "c649824edebb502430e928b3ec2e6014",
"score": "0.7326848",
"text": "def new\n @efectividad = Efectividad.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @efectividad }\n end\n end",
"title": ""
},
{
"docid": "9b74a6fa66a81729eedafbff20f264bc",
"score": "0.7323536",
"text": "def new\n @tipo_entidad = TipoEntidad.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipo_entidad }\n end\n end",
"title": ""
},
{
"docid": "9ea239cf3ae8cee558e90b7b93a7edc0",
"score": "0.73231786",
"text": "def new\n @pesaje = Pesaje.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pesaje }\n end\n end",
"title": ""
},
{
"docid": "80ca487364d00cc96f42d49e9b4268aa",
"score": "0.73213536",
"text": "def new\n @exemplar = Exemplar.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @exemplar }\n end\n end",
"title": ""
},
{
"docid": "331669688833aa4d4c60688c1bc7022e",
"score": "0.73156494",
"text": "def new\n @etude = @projet.etudes.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @etude }\n end\n end",
"title": ""
},
{
"docid": "053cab124205c4d4cac4b82cc399daa9",
"score": "0.7314995",
"text": "def new\n @presencia = Presencia.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @presencia }\n end\n end",
"title": ""
},
{
"docid": "3c8e3507c6f375605ca0110e0b1f9e9c",
"score": "0.7302212",
"text": "def new\n @compra = Compra.new(:fecha => Date.today)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @compra }\n end\n end",
"title": ""
},
{
"docid": "930d44ec8cd26b176811f258f26b5ec9",
"score": "0.730005",
"text": "def new\n @objeto = Objeto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @objeto }\n end\n end",
"title": ""
},
{
"docid": "1658badb11dfb1d7c553c4991f1d137f",
"score": "0.7295505",
"text": "def new\n @aporte = Aporte.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @aporte }\n end\n end",
"title": ""
},
{
"docid": "1658badb11dfb1d7c553c4991f1d137f",
"score": "0.7295505",
"text": "def new\n @aporte = Aporte.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @aporte }\n end\n end",
"title": ""
},
{
"docid": "f78a465e069b130afd94c21f887d8c9f",
"score": "0.72921115",
"text": "def new\n @employee = Employee.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employee }\n end\n end",
"title": ""
},
{
"docid": "c19ec0deabbcb1bfc9630faa2015dc95",
"score": "0.728911",
"text": "def new\n @especialidad = Especialidad.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @especialidad }\n end\n end",
"title": ""
},
{
"docid": "fbb221e0dac1e7043946860433ac438e",
"score": "0.72877556",
"text": "def new\n @exist = Exist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @exist }\n end\n end",
"title": ""
},
{
"docid": "99f8f1e23c83283f28de2187df5d7791",
"score": "0.728696",
"text": "def new\n @cuenta_por_pagar = CuentaPorPagar.new\n @listado_empresas = Empresa.all\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cuenta_por_pagar }\n end\n end",
"title": ""
},
{
"docid": "58f1c50636c415f660b997bb4f2b3d8a",
"score": "0.7286162",
"text": "def new\n @pesquisa = Pesquisa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pesquisa }\n end\n end",
"title": ""
},
{
"docid": "5e462c25eb1a9d7b365cd6edd9fc1910",
"score": "0.7278053",
"text": "def new\n @escolaridad = Escolaridad.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @escolaridad }\n end\n end",
"title": ""
},
{
"docid": "161b51325b8e649386a584a373d35a8f",
"score": "0.7272862",
"text": "def new\n @employee = Employee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @employee }\n end\n end",
"title": ""
},
{
"docid": "161b51325b8e649386a584a373d35a8f",
"score": "0.7272862",
"text": "def new\n @employee = Employee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @employee }\n end\n end",
"title": ""
},
{
"docid": "591d77b302636e64f0d82f9e346ff3e3",
"score": "0.72614545",
"text": "def new\n @solvencia = Solvencia.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @solvencia }\n end\n end",
"title": ""
},
{
"docid": "a4298fd0a1a07f9457c31ec8ae8d48f6",
"score": "0.72611994",
"text": "def new\n @alter = Alter.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @alter }\n end\n end",
"title": ""
},
{
"docid": "2649499aa8cb315a0e1c09dc991423b0",
"score": "0.7256372",
"text": "def new\n @employment = Employment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employment }\n end\n end",
"title": ""
},
{
"docid": "85b996d448f9a01e24f638560b59c171",
"score": "0.7245876",
"text": "def new\n @posizione = Posizione.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @posizione }\n end\n end",
"title": ""
},
{
"docid": "756b6d117abd892ca2f7da768c18b477",
"score": "0.72458524",
"text": "def new\n @alunos = Aluno.all\n @livros = Livro.all\n @emprestimo = Emprestimo.new\n @emprestimo.data_de_emprestimo = Time.now.to_date\n\n if params[:livro_id]\n @emprestimo.livro = Livro.find(params[:livro_id])\n end\n\n if params[:aluno_id]\n @emprestimo.aluno = Aluno.find(params[:aluno_id])\n end\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @emprestimo }\n end\n end",
"title": ""
},
{
"docid": "e39f784775b47e9cba58d7a510840df0",
"score": "0.7240408",
"text": "def new\n @atendente = Atendente.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @atendente }\n end\n end",
"title": ""
},
{
"docid": "01413e7c7b994ce87d8c82736383b85e",
"score": "0.7240063",
"text": "def new\n @tale = Tale.new\n\n @title = 'add new tale'\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tale }\n end\n end",
"title": ""
},
{
"docid": "3f55ada153801c095d6ca81999bd9d62",
"score": "0.72366744",
"text": "def new\n @pensamiento = Pensamiento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pensamiento }\n end\n end",
"title": ""
},
{
"docid": "5501acd8f1f8d023fce5bab3b2e34c8c",
"score": "0.72305334",
"text": "def new\n @tipo = Tipo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipo }\n end\n end",
"title": ""
},
{
"docid": "cf0e5d43075e8993fc13b3cda3bf3243",
"score": "0.7229999",
"text": "def new\n @arte = Arte.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @arte }\n end\n end",
"title": ""
},
{
"docid": "3b17a14e9d7346c6ef67ad74176a2486",
"score": "0.72288877",
"text": "def new\n @duelo_pessoa = DueloPessoa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @duelo_pessoa }\n end\n end",
"title": ""
},
{
"docid": "1d5ef4906c3a944ca10a637b222d0c94",
"score": "0.7228811",
"text": "def new\n @especial_news = EspecialNew.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @especial_news }\n end\n end",
"title": ""
},
{
"docid": "2f996b1db4c82f2db6ad37f9bebd66cb",
"score": "0.7222981",
"text": "def new\n @questao = Questao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @questao }\n end\n end",
"title": ""
},
{
"docid": "2f996b1db4c82f2db6ad37f9bebd66cb",
"score": "0.7222981",
"text": "def new\n @questao = Questao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @questao }\n end\n end",
"title": ""
},
{
"docid": "82c1845f7f3a79390cbdfafe8845bfb3",
"score": "0.7222102",
"text": "def new\n @ate = Ate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @ate }\n end\n end",
"title": ""
},
{
"docid": "1be28e37c9f77bec6e10732f2730ee7d",
"score": "0.7216018",
"text": "def new\n @cuenta_por_cobrar = CuentaPorCobrar.new\n @listado_empresas = Empresa.all\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cuenta_por_cobrar }\n end\n end",
"title": ""
},
{
"docid": "38d89c21036adce47d5f96192564349b",
"score": "0.721596",
"text": "def new\n @pelicula = Pelicula.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pelicula }\n end\n end",
"title": ""
},
{
"docid": "885d45ffc577da9532e6872e7829997d",
"score": "0.7214552",
"text": "def new\n @estados_pagamento = EstadosPagamento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @estados_pagamento }\n end\n end",
"title": ""
},
{
"docid": "f854cb70a095b6b16949bad94188e792",
"score": "0.7213736",
"text": "def new\n @aluno = Aluno.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @aluno }\n end\n end",
"title": ""
},
{
"docid": "f854cb70a095b6b16949bad94188e792",
"score": "0.7213736",
"text": "def new\n @aluno = Aluno.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @aluno }\n end\n end",
"title": ""
},
{
"docid": "f854cb70a095b6b16949bad94188e792",
"score": "0.7213736",
"text": "def new\n @aluno = Aluno.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @aluno }\n end\n end",
"title": ""
},
{
"docid": "237f64eb79ee0bae83b02f5197ed8400",
"score": "0.72126675",
"text": "def new\n @registro = Registro.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @registro }\n end\n end",
"title": ""
},
{
"docid": "732d16a41750c3d6df2d997351f6a876",
"score": "0.7202423",
"text": "def new\n @venta = Venta.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @venta }\n end\n end",
"title": ""
},
{
"docid": "2879ff713b8d11e43b5c240743508af5",
"score": "0.7196265",
"text": "def new\n @sujet = Sujet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sujet }\n end\n end",
"title": ""
},
{
"docid": "e8d476205e2d7cdabd3f4ac3ea561517",
"score": "0.71908355",
"text": "def new\n @entrega = Entrega.new\n @statusentrega = Statusentrega.all\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entrega }\n end\n end",
"title": ""
},
{
"docid": "80012bc3f4d86d51bd37a18e075068e6",
"score": "0.7190018",
"text": "def new\n @historia = Historia.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @historia }\n end\n end",
"title": ""
},
{
"docid": "ba72d2df0a80b9bc92be82b475c616e9",
"score": "0.71874624",
"text": "def new\n @adjunto = Adjunto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @adjunto }\n end\n end",
"title": ""
},
{
"docid": "6e4b72f9c99cff0d81b2ca84e849552e",
"score": "0.71872693",
"text": "def new\n @trabajo = Trabajo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @trabajo }\n end\n end",
"title": ""
},
{
"docid": "1baa20488af59c0553db3c9ef22c31ba",
"score": "0.71842045",
"text": "def new\n @dupa = Dupa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dupa }\n end\n end",
"title": ""
},
{
"docid": "1fa3dffc16744a4a50ea0d7f3ea74a6f",
"score": "0.71836394",
"text": "def new\n @secao = Secao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @secao }\n end\n end",
"title": ""
},
{
"docid": "d89d88dcb488b2acf0e3af27a9893512",
"score": "0.7181854",
"text": "def new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: ''}\n end\n end",
"title": ""
},
{
"docid": "cbd923604eea04577caf1b0ea68af56e",
"score": "0.7171656",
"text": "def new\n @tipo_evento = TipoEvento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipo_evento }\n end\n end",
"title": ""
},
{
"docid": "cbd923604eea04577caf1b0ea68af56e",
"score": "0.7171656",
"text": "def new\n @tipo_evento = TipoEvento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipo_evento }\n end\n end",
"title": ""
},
{
"docid": "7f2a3edb81164c238ed14b977d805c03",
"score": "0.71661675",
"text": "def new\n @paciente = Paciente.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @paciente }\n end\n end",
"title": ""
},
{
"docid": "a641290df07c8f9a0bf174a0d290ae0b",
"score": "0.71658546",
"text": "def new\n @aprova = Aprova.new\n\n \n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @aprova }\n end\n \n \n end",
"title": ""
},
{
"docid": "15257d4857a4de885cdcca7d331aa75c",
"score": "0.71638346",
"text": "def new\n @entidad_paraestatal = EntidadParaestatal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entidad_paraestatal }\n end\n end",
"title": ""
},
{
"docid": "d8316c78cfd49a532228eb352882ff5a",
"score": "0.71588516",
"text": "def new\n @nota_entrada = NotaEntrada.new\n @fornecedores_nota_entrada = Fornecedor.find(:all, :conditions => [\" empresa = ?\", session[:usuario].empresa])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @nota_entrada }\n end\n end",
"title": ""
},
{
"docid": "4fba13dfa9f322bf92a365bb23825afe",
"score": "0.7156719",
"text": "def new\n @paciente = Paciente.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @paciente }\n end\n end",
"title": ""
},
{
"docid": "4fba13dfa9f322bf92a365bb23825afe",
"score": "0.7156719",
"text": "def new\n @paciente = Paciente.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @paciente }\n end\n end",
"title": ""
}
] |
b1732e575c523f14b1304a7ee90c26ff
|
Fetches all card sets
|
[
{
"docid": "10935231798ff14879e81a00da22e08f",
"score": "0.7619269",
"text": "def card_sets\n load_cards_data['sets']\n end",
"title": ""
}
] |
[
{
"docid": "95124a0a5a51519e6cd75622c3a3499a",
"score": "0.70238703",
"text": "def connect_cards_to_sets\n CardSet.all.each { |card_set|\n card_set.cards = []\n\n set_code = card_set.code\n\n cards = Card.where(set_code: set_code)\n\n card_set.cards << cards\n }\nend",
"title": ""
},
{
"docid": "d2efbdb6787fbe718b98a002768e9586",
"score": "0.69971716",
"text": "def fetch_raw_collection\n sets = Mtg::Api.get_requested_sets(requested_sets.sort)\n prices = Mtg::Api.get_prices(requested_sets.sort)\n updated_cards_count = 0\n\n sets.each do |set|\n data = set['data']\n cards = manifest.select { |c| c['set_id'] == data['code'] }\n pp \"Updating #{cards.count} cards in set #{data['name']} (#{data['code']})\"\n updated_cards_count += cards.count\n\n updated_cards = cards.map do |card|\n response = data['cards'].detect do |c|\n c['name'] == sanitize(card['name'])\n end\n\n if response.nil?\n errors.push(\"Couldn't find card '#{card['name']}' in set '#{data['code']}'\")\n next\n else\n {\n name: card['name'],\n cmc: response['cmc'],\n colors: response['colors'],\n cost: response['manaCost'],\n is_foil: card['is_foil'],\n market_price: price_for(prices, card, data),\n multiverse_id: card['multiverse_id'] || response['multiverseid'],\n quantity: card['quantity'],\n rarity: response['rarity'],\n set: data['name'],\n set_id: data['code'],\n subtypes: response['subtypes'] || Array.new,\n types: response['types'],\n }.to_json\n end\n end\n\n # update_set(data['code'], updated_cards)\n end\n\n updated_cards_count\n end",
"title": ""
},
{
"docid": "ddfdd39cc4fe295b304fabd0f15cdaf6",
"score": "0.6919937",
"text": "def cards_by_set(set)\n all_cards(set: set).to_a\n end",
"title": ""
},
{
"docid": "b517fdf99b5b9655e6ed0cb197c993f3",
"score": "0.6681088",
"text": "def get_all_cards\n cards = self.class.get(\"/cards.xml\").parsed_response['cards']\n return cards\n end",
"title": ""
},
{
"docid": "85d49cbbb06312d17012423a8e3f3a50",
"score": "0.66382647",
"text": "def sets\n Threecardset.find_all_by_player_id( player.id ).select {|t| t.game == game }\n end",
"title": ""
},
{
"docid": "a061cc13e04f1bc8c4c8be0a1b1d4712",
"score": "0.6534107",
"text": "def sets\n unless @sets\n @sets = @cards.combination(3).to_a.select{ |cards|\n Set.valid?(*cards)\n }\n end\n @sets\n end",
"title": ""
},
{
"docid": "3128003a34a5c224b2ef3d6de77e123e",
"score": "0.6473778",
"text": "def allSets deck\n set_arr = []\n all_set = deck.combination(3).to_a\n all_set.each { |i| set_arr.push(i) if isSet?(i) }\n set_arr\n end",
"title": ""
},
{
"docid": "125e23d2ef711d15d56d4148988c2294",
"score": "0.64633006",
"text": "def check_sets\n complete_sets = []\n @hand.collect { |card| card[0] }.uniq.each do |set_num|\n if @hand.collect { |card| card[0] }.count(set_num) == Deck.set_data(set_num)[2]\n complete_sets << set_num\n end\n end\n return complete_sets\n end",
"title": ""
},
{
"docid": "4fb4b373819866bd4facbd1b9a92d071",
"score": "0.6459688",
"text": "def gather\n index = Scraper::Magiccardinfo::SetIndex.new\n index.get_set_names\n\n format = \"%t: |%b %p%% => %i| %c/%C\"\n bar = ProgressBar.create title:\"#{index.set_names.count} Sets\", total:index.set_names.count, format: format\n\n index.set_names.each do |set_name|\n page = Scraper::Magiccardinfo::SetPage.new(set_name.gsub('_en',''))\n page.gather_cards\n\n self.set_pages.push page\n self.cards.push page.cards\n\n bar.increment\n end\n\n bar.finish\n\n cards.flatten!\n end",
"title": ""
},
{
"docid": "9b668026485b7e72589c95ab85a7632d",
"score": "0.64317036",
"text": "def sets\n cards.map(&:set_code).uniq\n end",
"title": ""
},
{
"docid": "30edec87984e40d6431bc156bda1d4a8",
"score": "0.64033365",
"text": "def fetch_cards(card_names = [])\n cbobject.parse_response(entity(\n entity_request_uri,\n field_ids: cbobject.basis_fields.join(','),\n cards: (cbobject.full_cards & card_names).join(',')\n ), cbobject.basis_fields, card_names)\n end",
"title": ""
},
{
"docid": "c0936c3b6aa6f3250c4c4c3bd1bd75fe",
"score": "0.63513935",
"text": "def list_sets\n log_message( \"Listing sets...\" ) unless @logging == false\n set_list = @connection.get( \"set\" )\n return set_list\n end",
"title": ""
},
{
"docid": "4674fa91100ffe6a54600e194939940d",
"score": "0.63140994",
"text": "def list_sets(opts={})\n do_resumable(OAI::ListSetsResponse, 'ListSets', opts)\n end",
"title": ""
},
{
"docid": "0b44c38e748b8c57f5b9aad2637c22a8",
"score": "0.6304488",
"text": "def set_card_set\n @card_set = CardSet.find(params[:id])\n end",
"title": ""
},
{
"docid": "a9e51df2242f150bf3d5a8aeee429b66",
"score": "0.6267353",
"text": "def show\n @api_sets = @handler.get_sets\n @db_sets = @catalog.catalog_sets\n end",
"title": ""
},
{
"docid": "bfbcb3497132a1852204155fd710b3cd",
"score": "0.62538207",
"text": "def find_sets\n found_sets = []\n flat_field = field.flatten\n Game.each_cmb3(flat_field.length).each do |arr3|\n cards = arr3.map {|i| flat_field[i] }\n found_sets << cards if is_set?(*cards)\n end\n found_sets\n end",
"title": ""
},
{
"docid": "441689f128d7cd9ceb431425c7e83d4b",
"score": "0.62537175",
"text": "def find_sets\n found_sets = []\n field_l = field\n Game.each_cmb3(field_l.length).each do |arr3|\n cards = arr3.map {|i| field_l[i] }\n found_sets << cards if is_set?(*cards)\n end\n found_sets\n end",
"title": ""
},
{
"docid": "5bd6c3708c677dc79188a8a0557e38c8",
"score": "0.6252814",
"text": "def list\n @client.make_request :get, cards_path\n end",
"title": ""
},
{
"docid": "a05d2f31577420b203c868a14d7ccb65",
"score": "0.62484425",
"text": "def cards\n @cards ||= []\n page = 1\n\n return @cards unless @cards.empty?\n\n while true\n puts \"fetching page #{page}\"\n\n json = JSON.parse(get('/cards', query: { page: page}).body)\n page += 1\n\n json['cards'].each { |card| @cards << Models::Card.new(card) }\n\n break if json.empty?\n end\n\n @cards\n end",
"title": ""
},
{
"docid": "ae09b26202fd9379ac481730d82ef21b",
"score": "0.6213998",
"text": "def init_cardsets\n card_set = CardSet.new(self)\n card_set.populate!\n\n @game_set = card_set[0...48]\n @hand_set = card_set[48...52]\n\n @game_set.each_with_index do |card, idx|\n card.pos_x = 5 + ((idx % 12) * 75)\n card.pos_y = 5 + ((idx / 12) * 100)\n end\n @hand_set.each_with_index do |card, idx|\n card.pos_x = 305 + (idx * 75)\n card.pos_y = 450\n end\n\n @hand_card = @hand_set.first\n @hand_position = @hand_card.position\n @hand_card.show!\n\n @hidden_card_image = Gosu::Image.new(self, SVM::image('default.png'), false)\n end",
"title": ""
},
{
"docid": "b60bc86240648035ad6d75706ab0646d",
"score": "0.62081325",
"text": "def findSet\n\t\t@hintSet.clear\n\t\t@table.each do |card1|\n\t\t \t(@table-[card1]).each do |card2|\n\t\t \t\t(@table - [card1] - [card2]).each do |card3|\n\t\t \t\t\tif isSet?(card1, card2, card3)\n\t\t \t\t\t@hintSet << card1 << card2 << card3\n\t\t \t\t\tend\n\t\t \t\tend\n\t\t \tend\n\t\tend\n\n\tend",
"title": ""
},
{
"docid": "357482ece7718dc4662ebcaf2b03affb",
"score": "0.61644167",
"text": "def list_sets(options = {})\n Response::ListSets.new(provider_context, options).to_xml\n end",
"title": ""
},
{
"docid": "2f760dad12dee3fbb72353e4f5965413",
"score": "0.6122968",
"text": "def fetch_datasets\n self.databases.each do |name,database|\n @datasets.merge!( database.datasets )\n end\n end",
"title": ""
},
{
"docid": "96718057f714d40c2e44b2799488af5f",
"score": "0.60614234",
"text": "def cards\n Card.where(set: code)\n end",
"title": ""
},
{
"docid": "0ef031a988607eb64cc398c92ad106b5",
"score": "0.60481846",
"text": "def get_cardlist\n $cardlist.find_all\n puts \"cardlist: #{@front}\"\n end",
"title": ""
},
{
"docid": "8fe884f6471e53b4e9721cd28d8058bd",
"score": "0.60380036",
"text": "def all\n requires :zone\n\n data = service.list_resource_record_sets(zone.identity)\n .to_h[:rrsets] || []\n load(data)\n rescue ::Google::Apis::ClientError => e\n raise e unless e.status_code == 404\n []\n end",
"title": ""
},
{
"docid": "87758905b52b1684ba2a4c409b1c2757",
"score": "0.60178274",
"text": "def computer_find_set(deal)\n set_found = false\n # create an array of all possible 3 card combinations given the current deal.\n all_combinations = deal.combination(3).to_a\n i = 0\n cards = [3]\n # loop until a set is found, then add that set to cards.\n until set_found\n set_found = true if check_set(all_combinations[i][0], all_combinations[i][1], all_combinations[i][2])\n if set_found\n cards[0] = all_combinations[i][0]\n cards[1] = all_combinations[i][1]\n cards[2] = all_combinations[i][2]\n end\n i += 1\n end\n cards\nend",
"title": ""
},
{
"docid": "3f214ab50e223f16847e96e4c0ec508e",
"score": "0.59964365",
"text": "def call\n SETS_DIR.mkpath\n @data.each do |set_code, set|\n set[\"cards\"].each do |card|\n # Delete this, as it changes a ton and messes up git history\n card.delete \"printings\"\n # Sort this for better diffs\n if card[\"foreignNames\"]\n card[\"foreignNames\"].sort_by!{|c| [c[\"language\"], c[\"multiverseid\"]]}\n end\n end\n\n (SETS_DIR + \"#{set_code}.json\").open(\"w\") do |fh|\n fh.puts set.to_json\n end\n end\n end",
"title": ""
},
{
"docid": "a29da1a4764556654b6e030d7215c9a4",
"score": "0.5996237",
"text": "def get_cards\n\t\t\tcards=@cards_availables.sample(@cards_per_player)\n\t\t\t@cards_availables-= cards\n\t\t\tcards\n\t\tend",
"title": ""
},
{
"docid": "3a69a8f95ea473bc494e0968540e9448",
"score": "0.5993699",
"text": "def fill_gamefield_with_sets\n num_empty_cards = FieldSize - flat_field.length\n dealt = (deck.deal num_empty_cards if num_empty_cards > 0)\n sets_found = find_sets\n until (sets_found.count > 0) # assigning to temp variable \"tmp_sets\"\n if deck.all_dealt?\n self.finished_at = Time.now\n return []\n end\n dealt = deck.discard_and_replace 3\n sets_found = find_sets\n end\n sets_found\n end",
"title": ""
},
{
"docid": "973a49be0d284a87c48aba2bbfeeea6b",
"score": "0.5986835",
"text": "def findSet\n\t\t@table.each do |card1|\n\t\t (@table-[card1]).each do |card2|\n\t\t (@table - [card1] - [card2]).each do |card3|\n\t\t if isSet?(card1, card2, card3)\n\t\t\t\treturn card1, card2, card3\n\t\t end\n\t\t end\n\t\t end\n\t\tend\n\t\treturn nil\t\t\n\tend",
"title": ""
},
{
"docid": "142b0d14e83408b34bfa590659f10428",
"score": "0.59864104",
"text": "def get_cards\n end",
"title": ""
},
{
"docid": "5ece4727c9a9d16862cdba2a435651db",
"score": "0.5967422",
"text": "def get_cards(count = 1)\n\t\tget_random_cards(count).map {|card| get_card card }\n\tend",
"title": ""
},
{
"docid": "bdb9b793143d7d5250812ffffe67bd00",
"score": "0.593539",
"text": "def _cache_sql_cards(result_set)\n raise \"Improper type passed to (should be mysql result set)\" if (result_set.kind_of?(Mysql2::Result) == false)\n \n @card_entries = {}\n @card_entries_array = []\n \n result_set.each(:symbolize_keys => true, :as => :hash) do |rec|\n card = CEdictEntry.from_sql(rec)\n card.id = rec[:card_id]\n _cache_card(card)\n end \n end",
"title": ""
},
{
"docid": "d4b42d4c43f8049d55425d149070c0e1",
"score": "0.5928109",
"text": "def index\n @ad_sets = AdSet.all\n end",
"title": ""
},
{
"docid": "c1eb90645d094c780de362c96725bcad",
"score": "0.5886228",
"text": "def set_cards\n\t\t\t@cards = @intranet.cards\n\t\tend",
"title": ""
},
{
"docid": "113750c7cb00c0833f5bf8cbace7bffb",
"score": "0.5886145",
"text": "def all\n Client.get('/kits').inject([]) do |kits, attributes|\n kits << Kit.new(attributes)\n end\n end",
"title": ""
},
{
"docid": "56dbeec358f8e448229b84ec2f280153",
"score": "0.5885856",
"text": "def sets\n list_directories(\"#{resource_dir}/sets\")\n end",
"title": ""
},
{
"docid": "c8a398eac4a86e2c2f524a5343e45b6a",
"score": "0.58663946",
"text": "def get_cards\r\n return @cards\r\n end",
"title": ""
},
{
"docid": "cdd9d5b64ba3a875b009afc452a0f8d4",
"score": "0.58641666",
"text": "def index\n @card_packagings = CardPackaging.all\n end",
"title": ""
},
{
"docid": "816f15d18b9693a557adfae48bc6503f",
"score": "0.5851457",
"text": "def archive_all_cards\n client.post(\"/lists/#{id}/archiveAllCards\")\n end",
"title": ""
},
{
"docid": "ecef0c3469b5299129585a799441378a",
"score": "0.5851034",
"text": "def load_set(set_name = nil, sql_con = nil)\n return if set_name.nil?\n if sql_con.nil? # If we don't have a SQL connection, load from JSON files\n # Check to see if we've got a local directory we want to load from\n if Dir.exists?(set_name) then\n path = File.join('.', set_name, @@card_def_dir)\n else\n path = File.join(@@base_dir, @@set_dir, set_name, @@card_def_dir)\n end\n get_card_files(path).each do |card|\n new_card = Card.new(File.join(path, card))\n if new_card.set_id !~ /DELETE/\n @cards << new_card\n end\n#binding.pry\n end\n else # If we DO have a sql connection, load from that\n query = \"SELECT * FROM cards where set_id = '#{set_name}'\"\n results = sql_con.query(query)\n results.each do |row|\n new_card = Card.new(row)\n @cards << new_card\n end\n end\n end",
"title": ""
},
{
"docid": "590b5acc0f33586810c22a3c4ea47de1",
"score": "0.58418703",
"text": "def _get_cards_from_db\n connect_db\n select_query = \"SELECT * FROM cards_staging\"\n result_set = $cn.execute(select_query)\n return result_set\n end",
"title": ""
},
{
"docid": "bd304c61a2e1d5845402ad369bde892a",
"score": "0.58399993",
"text": "def available_cards\n Card.all.select do |card|\n !self.card_id_array.include?(card.id)\n end\n end",
"title": ""
},
{
"docid": "0b4cbec97b2770a4f9e4d34376ea985a",
"score": "0.5822768",
"text": "def fetch_all_sources\n @sources ||= Source.sorted\n end",
"title": ""
},
{
"docid": "25dd4f3b8ecf5b0ce333609c7cbd22e1",
"score": "0.5821108",
"text": "def get_cards\n return @cards\n end",
"title": ""
},
{
"docid": "d41f0f8c5dcf6266be1de08a320256da",
"score": "0.5816876",
"text": "def get_cards\r\n self.class.get(\"/cards.xml\").parsed_response['cards']\r\n end",
"title": ""
},
{
"docid": "351ae31a0448e9e74663b436f5486f5c",
"score": "0.58157915",
"text": "def fill_gamefield_with_sets\n num_empty_cards = FieldSize - field.length\n dealt = ( deck.deal num_empty_cards if num_empty_cards > 0 )\n sets_found = find_sets\n until (sets_found.length > 0) # assigning to temp variable \"tmp_sets\"\n if deck.all_dealt?\n self.finished_at = Time.now\n reset_timer\n return []\n end\n dealt = deck.deal 3\n sets_found = find_sets\n end\n reset_timer unless dealt.blank?\n sets_found\n end",
"title": ""
},
{
"docid": "c2aa99562d75dc150f958f4c017022c6",
"score": "0.5815163",
"text": "def get_cards(deck)\n until valid_card?(deck)\n self.draw(deck)\n end\n end",
"title": ""
},
{
"docid": "e69097420908d94e55e7e35cce560c4c",
"score": "0.58148056",
"text": "def all_cards\n @community_cards + [@hole_cards.card1, @hole_cards.card2]\n end",
"title": ""
},
{
"docid": "65fcff1818d5fb0c47e6be7abf146572",
"score": "0.5808703",
"text": "def all\n @banks ||= read_banks\n end",
"title": ""
},
{
"docid": "65fcff1818d5fb0c47e6be7abf146572",
"score": "0.5808703",
"text": "def all\n @banks ||= read_banks\n end",
"title": ""
},
{
"docid": "ec1d3449a34007ed58af1e56b1e72c43",
"score": "0.5805433",
"text": "def index\n @card_categories = CardCategory.all\n end",
"title": ""
},
{
"docid": "e68d615d8e2c0b4f6488ee67dfeb87df",
"score": "0.5797083",
"text": "def set_cards\n @deck = Deck.find(params[:deck_id])\n end",
"title": ""
},
{
"docid": "0c2b1971e47b9de94c767ed3c866c7a0",
"score": "0.5796442",
"text": "def get_cards(deck)\n draw(deck)\n end",
"title": ""
},
{
"docid": "40b0b11adb694e80fed249dce96ec299",
"score": "0.57951415",
"text": "def index\n @mammon_cards = Mammon::Card.all\n end",
"title": ""
},
{
"docid": "e9deeda36d2fd8b022c6c9959cdf17b6",
"score": "0.57916224",
"text": "def init_all(base_uri)\n uri = self.normalize(base_uri)\n response = Nokogiri::XML(open(uri.merge('cgi-bin/oai.exe?verb=ListSets')))\n sets = response.search('//xmlns:set/xmlns:setSpec/text()',response.namespaces).collect { |set| set.text }\n sets.each { |set|\n self.init_map(uri, set)\n }\n end",
"title": ""
},
{
"docid": "bb0aa51af6ce043d6e7917d272ed08f3",
"score": "0.578997",
"text": "def all!\n data = []\n\n merge_attributes({'NextRecordName' => nil,\n 'NextRecordType' => nil,\n 'NextRecordIdentifier' => nil,\n 'IsTruncated' => nil})\n\n begin\n options = {\n :name => next_record_name,\n :type => next_record_type,\n :identifier => next_record_identifier\n }\n options.delete_if {|key, value| value.nil?}\n\n batch = service.list_resource_record_sets(zone.id, options).body\n # NextRecordIdentifier is completely absent instead of nil, so set to nil, or iteration breaks.\n batch['NextRecordIdentifier'] = nil unless batch.key?('NextRecordIdentifier')\n\n merge_attributes(batch.reject {|key, value| !['IsTruncated', 'MaxItems', 'NextRecordName', 'NextRecordType', 'NextRecordIdentifier'].include?(key)})\n\n data.concat(batch['ResourceRecordSets'])\n end while is_truncated\n\n load(data)\n end",
"title": ""
},
{
"docid": "9c3894a5430f62393b4e36b40461d38b",
"score": "0.578427",
"text": "def set_deck\n @deck = Deck.find(params[:id])\n memberlist = Memberlist.where(memberlist_id: @deck.memberlist_id)\n\n start = Memberlist.find_by(memberlist_id: @deck.memberlist_id, start: true)\n @start = Member.joins(:card).select(\"cards.*, members.*\").find_by(number: start.number)\n @members = []\n @musics = []\n memberlist.each do |member|\n # スタートメンバーはデッキから-1枚する\n count = member.count.to_i\n count -= 1 if member.number == @start.number\n\n count.times do\n @members << Member.joins(:card).select(\"cards.*, members.*\").find_by(number: member.number)\n end\n end\n\n setlist = Setlist.where(setlist_id: @deck.setlist_id)\n setlist.each do |music|\n music.count.to_i.times do\n @musics << Music.joins(:card).select(\"cards.*, musics.*\").find_by(number: music.number)\n end\n end\n end",
"title": ""
},
{
"docid": "4c2935f4baea9976fc520ce4d16f5418",
"score": "0.5773431",
"text": "def credit_cards\n customer.sources.all(object: 'card')\n end",
"title": ""
},
{
"docid": "4749e15a9baa72428778d237b567e64a",
"score": "0.5763754",
"text": "def set_cardset\n id = params[:id] || params[:cardset_id]\n @cardset = Cardset.find(id)\n end",
"title": ""
},
{
"docid": "2b4624b231480a670423162bc1a311df",
"score": "0.57608837",
"text": "def get_list(options={})\n rsp = @flickr.send_request('flickr.photosets.getList', options)\n collect_sets(rsp)\n end",
"title": ""
},
{
"docid": "b4a9e60252b51457ea22c87b9620ee99",
"score": "0.57600236",
"text": "def index\n @card_in_decks = CardInDeck.all\n end",
"title": ""
},
{
"docid": "d4a0c4b5b9759e260eb6d5d170dd8f69",
"score": "0.5756189",
"text": "def findSet(cards)\n\tallgoodSet = []\n\ti, j, k , m= 0, 0, 0, 0\n\twhile i<cards.size do\n\t\tj = i+1\n\t\twhile j <cards.size do\n\t\t k = j+1\n\t\t while k <cards.size do\n\t\t\t\tcolorfillter cards, i, j, k\n\n\t\t\t\tif((numberfillter cards, i, j, k)&&(symbolfillter cards, i, j, k)&&(shadingfillter cards, i, j ,k)&&(colorfillter cards, i, j, k))\n\t\t\t\t\toneSet= Fitset.new(i, j, k)\n\t\t\t\t\tputs \"Fit sets are \"+i.to_s+\" \"+ j.to_s+\" \"+ k.to_s\n\t\t\t\t\tallgoodSet.push oneSet\n\t\t\t\t\tm= m+1\n\t\t\t\tend\n\n\t\t\t\tk=k+1\n\t\t\tend\n\t\t\tj = j+1\n\t \tend\n\t\ti=i+1\n\tend\n\nreturn allgoodSet, m\nend",
"title": ""
},
{
"docid": "181a3859cd79e8c65371debe7f26ebcd",
"score": "0.5753397",
"text": "def load_collection(sql_con = nil)\n if sql_con.nil? # If we don't have a SQL connection, load from JSON files\n path = File.join(@@base_dir, @@set_dir)\n Dir.entries(path).each do |set|\n next if set =~ /^\\./\n load_set(set)\n end\n else # If we DO have a sql connection, load from that\n results = sql_con.query(\"SELECT DISTINCT set_id FROM cards\");\n results.each do |set|\n set_name = set[0]\n load_set(set_name, sql_con)\n end\n end\n end",
"title": ""
},
{
"docid": "c7e41146a6920a5eb9708a589d547d55",
"score": "0.57375455",
"text": "def index\n @associated_sets = AssociatedSet.all\n end",
"title": ""
},
{
"docid": "b117a163d512a4ded0907c9b3d499708",
"score": "0.5735557",
"text": "def show\n @cards = @deck.cards.all\n end",
"title": ""
},
{
"docid": "deab701dc4ab73c80574ae87b392f8d0",
"score": "0.5734788",
"text": "def fetch_all\n \n end",
"title": ""
},
{
"docid": "e7055fc0f85145158110595cf508c1da",
"score": "0.57345384",
"text": "def index\n card_list = Rails.cache.fetch 'cards', expires_in: 1.hour do\n generate_card_list\n end\n render json: card_list\n end",
"title": ""
},
{
"docid": "71f7ffe71f4f013a57e58a1b76fed099",
"score": "0.5733695",
"text": "def retrieve_all\n call(:get, path)\n end",
"title": ""
},
{
"docid": "5afb6a7a7792ab43e5b03942fdbb1613",
"score": "0.57155156",
"text": "def new_generic_set\n @sets = Mtg::Set.includes(:cards).where(:active => true).where(\"mtg_cards.name LIKE ?\", \"#{params[:name]}\").order(\"release_date DESC\").to_a\n respond_to do |format|\n format.json { render :json => @sets.collect(&:name).zip(@sets.collect(&:code)).to_json }\n end\n end",
"title": ""
},
{
"docid": "8a2c4a1587ac42074196712767f816cf",
"score": "0.57010263",
"text": "def show\n @cards = Card.all\n end",
"title": ""
},
{
"docid": "d72bf4a9777b1f92662288dcd8409ecc",
"score": "0.56994295",
"text": "def index\n @config_sets = ConfigSet.all\n end",
"title": ""
},
{
"docid": "7d7fd053755b79f4a4cdbbc8301113b0",
"score": "0.5691467",
"text": "def index\n @casino_card_art_requests = CasinoCardArtRequest.all\n end",
"title": ""
},
{
"docid": "c495c65bd7d518510a8c809a5592a187",
"score": "0.56908864",
"text": "def do_list_sets\n # Get the set count\n institution_id = current_institution.id\n sql = \"SELECT COUNT(h.id) AS count\n FROM handles h\n LEFT JOIN collections c ON h.collection_id = c.id\n LEFT JOIN units u ON h.unit_id = u.id\n LEFT JOIN unit_collection_memberships ucm on c.id = ucm.collection_id\n LEFT JOIN units u2 ON u2.id = ucm.unit_id\n WHERE (h.collection_id IS NOT NULL OR h.unit_id IS NOT NULL)\n AND (u.institution_id = #{institution_id}\n OR u2.institution_id = #{institution_id});\"\n @total_num_results = ActiveRecord::Base.connection.exec_query(sql)[0]['count']\n\n @results_offset = get_token_start\n sql = \"SELECT h.suffix AS handle_suffix,\n h.collection_id AS collection_id, h.unit_id AS unit_id,\n c.title AS collection_title, c.description AS collection_description,\n u.title AS unit_title, u.short_description AS unit_description\n FROM handles h\n LEFT JOIN collections c ON h.collection_id = c.id\n LEFT JOIN units u ON h.unit_id = u.id\n LEFT JOIN unit_collection_memberships ucm on c.id = ucm.collection_id\n LEFT JOIN units u2 ON u2.id = ucm.unit_id\n WHERE (h.collection_id IS NOT NULL OR h.unit_id IS NOT NULL)\n AND (u.institution_id = #{institution_id}\n OR u2.institution_id = #{institution_id})\n ORDER BY h.suffix\n LIMIT #{MAX_RESULT_WINDOW}\n OFFSET #{@results_offset};\"\n @results = ActiveRecord::Base.connection.exec_query(sql)\n @resumption_token = new_sets_resumption_token(start: @results_offset + MAX_RESULT_WINDOW)\n @next_page_available = (@results_offset + MAX_RESULT_WINDOW < @total_num_results)\n @expiration_date = resumption_token_expiration_time\n \"list_sets\"\n end",
"title": ""
},
{
"docid": "b75494121332c07b9cdf587e543ad6ce",
"score": "0.5677516",
"text": "def getTotalCardsInSet(set)\n\n amount = Card.where(set: set.short_name.upcase).count\n\n end",
"title": ""
},
{
"docid": "8efbb4b1b1622d403d08ffc5963a395c",
"score": "0.56766456",
"text": "def fetch_all(opts = {}, uri = {})\n uri = managed_resource::BASE_URI if uri.empty? || uri.nil?\n\n $lxca_log.info \"XclarityClient::Endpoints::XClarityService fetch_all\",\n \"Sending request to #{managed_resource} resource\"\n\n response = @connection.do_get(uri, :query => opts)\n\n $lxca_log.info(\"XclarityClient::Endpoints::XClarityService fetch_all\",\n \"Response received from #{uri}\")\n\n build_response_with_resource_list(response, managed_resource)\n end",
"title": ""
},
{
"docid": "908e28eee1f489cbfebdfc9966962676",
"score": "0.5674541",
"text": "def acquisition_cards(entity_id, cards: [])\n entities('acquisition', entity_id).fetch_cards(cards)\n end",
"title": ""
},
{
"docid": "271bda9be08f07eb36d0e111a26687a1",
"score": "0.56691915",
"text": "def setup_multiverse_sets\n @sets = multiverse_sets.sort_by(&:name)\n render layout: false\n end",
"title": ""
},
{
"docid": "143381efb8f14160872fdec8dffe34ad",
"score": "0.56672585",
"text": "def cards\n @cards_in_array = []\n self.card_hash.each do |card|\n @cards_in_array << Card.new(card[:question], card[:answer], card[:category])\n end\n @cards_in_array\n end",
"title": ""
},
{
"docid": "46837e568ccdaa458af3e3d168a4d895",
"score": "0.56648177",
"text": "def index\n @cardsets = Cardset.all\n globalState = GlobalState.instance\n if params.has_key?(:nocache) || stale?(:last_modified => globalState.lastedit, :etag => \"recent_changes\")\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @cardsets }\n end\n end\n end",
"title": ""
},
{
"docid": "9e7f47d72e837abec0881c7abc060434",
"score": "0.5660252",
"text": "def retrieve_all_snacks\n retrieve_suggested_snacks\n retrieve_classic_snacks\n end",
"title": ""
},
{
"docid": "1bdc185f75de44a3a9d2fc18f2104d06",
"score": "0.56568193",
"text": "def index\n @image_sets = ImageSet.all\n end",
"title": ""
},
{
"docid": "ea3299e54cb35af5ca2c0297873bbd76",
"score": "0.5638792",
"text": "def get_all_boards\n request(Net::HTTP::Get, \"/api/#{API_VERSION}/#{RESOURCE_NAME}\", nil, nil, false)\n end",
"title": ""
},
{
"docid": "234be94e7f2fce25e256fc992cbcc0c5",
"score": "0.5638319",
"text": "def data_sets\n @client.get_datasets('stationid' => id)\n end",
"title": ""
},
{
"docid": "262ee5c751779a9802044f895c2615b7",
"score": "0.563777",
"text": "def index\n @auction_cards = Auction::Card.all\n end",
"title": ""
},
{
"docid": "fa563cca43c0ebe896b66e595151f6bf",
"score": "0.5636135",
"text": "def sets\n return @sets\n end",
"title": ""
},
{
"docid": "fa563cca43c0ebe896b66e595151f6bf",
"score": "0.5636135",
"text": "def sets\n return @sets\n end",
"title": ""
},
{
"docid": "0f4aef9fd490dd17120e823fc31b4b43",
"score": "0.56333095",
"text": "def show_all_cards\n puts say(\"#{name} got\")\n\n cards.each do |card|\n puts say(\"#{card.suit} #{card.value}\")\n end\n end",
"title": ""
},
{
"docid": "4f4429b963e11588c48683970b9e1109",
"score": "0.5626552",
"text": "def index\n @card_manufacturers = CardManufacturer.all\n end",
"title": ""
},
{
"docid": "bf7a10eb061f2c955b87b21412084b7c",
"score": "0.5625106",
"text": "def index\n @mammon_user_cards = Mammon::UserCard.all\n end",
"title": ""
},
{
"docid": "605f754cdb195aba2f3bc7a7ab9ef7c8",
"score": "0.5620065",
"text": "def findSets(shownCards)\n\tsets=[]\n\tfor i in 0...shownCards.size-2\n\t\tfor j in i+1...shownCards.size-1\n\t\t\tfor k in j+2...shownCards.size\n\t\t\t\tif checkSet(shownCards,i,j,k)\n\t\t\t\t\tsets.push([i+1,j+1,k+1])\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend\n\treturn sets\nend",
"title": ""
},
{
"docid": "0c1e9d5eef75b49891b93a92a9cead41",
"score": "0.5611359",
"text": "def cards(page)\n self.options[:query][:page] = page || 1\n http_response = self.class.get(\"/v1/cards\", @options)\n json_response = JSON.parse(http_response.body)\n cards = []\n json_response[\"cards\"].each do |json_card|\n cards << Card.new(json_card)\n end\n cards\n end",
"title": ""
},
{
"docid": "abfce01ea84f07d4700ed37247e0a48f",
"score": "0.55983925",
"text": "def fetch_all\n @subjects.map {|subject| subject.fetch}\n end",
"title": ""
},
{
"docid": "90bcaf4d0bdf0c316b623a7821ec6dde",
"score": "0.55947626",
"text": "def list_cards\n initial_page = 0\n card_list = []\n\n puts \"Initial list call\\n\"\n cards_response = list(initial_page)\n\n return card_list if cards_response.blank?\n\n card_list += cards_response['data']\n\n while cards_response['has_more'] == true\n puts \"More to get making call to Scryfall page: #{cards_response.fetch('next_page')}\\n\"\n\n cards_response = get(URI(cards_response.fetch('next_page')))\n card_list += cards_response['data']\n\n # Per Scryfall request no more than 10 requests per second on average.\n puts \"Call successful sleeping before next request\\n\"\n sleep(0.5)\n end\n\n puts \"All calls successful\\n\"\n cards_list\n end",
"title": ""
},
{
"docid": "c92edf0a2f0c7f6e8399b6e095101aba",
"score": "0.559352",
"text": "def cards\n @cards\n end",
"title": ""
},
{
"docid": "a0c0b15546364a16a4e47971e51fae39",
"score": "0.559336",
"text": "def generate_card_list\n list = {}\n cards = Card.all\n cards.each do |card|\n serialization = ActiveModelSerializers::SerializableResource.new(card)\n list[card.id] = serialization.as_json\n end\n list\n end",
"title": ""
},
{
"docid": "bb6676deb0ef3efffa890c5b7e138905",
"score": "0.5593151",
"text": "def cards\n @options.empty? ? @card.table.none : @card.table.where(@card.params)\n end",
"title": ""
},
{
"docid": "4fe42d44ba2bf69f5b274262cb3c5bca",
"score": "0.5592943",
"text": "def correct_set\n current_combos = create_combos(@current_cards)\n correct_set = []\n # if set is present\n if !set_present(@current_cards)\n []\n else\n # there is a set, find it\n count = 0\n temp = current_combos[count]\n until is_set(temp[0], temp[1], temp[2]) do\n count += 1\n temp = current_combos[count]\n\n end\n\n # find indexes of the cards\n index_count = 0\n while index_count < @current_cards.size\n if temp[0] == @current_cards[index_count]\n correct_set << index_count + 1\n elsif temp[1] == @current_cards[index_count]\n correct_set << index_count + 1\n elsif temp[2] == @current_cards[index_count]\n correct_set << index_count + 1\n end\n\n index_count += 1\n end\n \n correct_set\n end\n\n end",
"title": ""
},
{
"docid": "0e45b666a44a557f08775733aa7d734e",
"score": "0.5588699",
"text": "def initCards()\n initTreasureCardDeck()\n initMonsterCardDeck()\n initCultistCardDeck()\n \n shuffleMonsters()\n shuffleTreasures()\n shuffleCultists()\n \n @usedTreasures = Array.new\n @usedMonsters = Array.new\n \n end",
"title": ""
}
] |
b44cf63b5cbc8b281da6eab5722b03c6
|
PUT /ldap_auth_headers/1 PUT /ldap_auth_headers/1.xml
|
[
{
"docid": "f19ba2edd86577c8541334ee1cb7a86b",
"score": "0.67583567",
"text": "def update\n @ldap_auth_header = Irm::LdapAuthHeader.find(params[:id])\n\n respond_to do |format|\n if @ldap_auth_header.update_attributes(params[:irm_ldap_auth_header])\n format.html { redirect_to({:action => \"index\"}, :notice => t(:successfully_updated)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ldap_auth_header.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "cf53c0019841a6b5737e0481ab808ff2",
"score": "0.6144818",
"text": "def destroy\n @ldap_auth_header = Irm::LdapAuthHeader.find(params[:id])\n @ldap_auth_header.destroy\n\n respond_to do |format|\n format.html { redirect_to(ldap_auth_headers_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ee19205e9d4ea2f08146192f91a65c54",
"score": "0.6093012",
"text": "def create\n @ldap_auth_header = Irm::LdapAuthHeader.new(params[:irm_ldap_auth_header])\n respond_to do |format|\n if @ldap_auth_header.save\n format.html { redirect_to({:action => \"index\"}, :notice => t(:successfully_created)) }\n format.xml { render :xml => @ldap_auth_header, :status => :created, :location => @ldap_auth_header }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @ldap_auth_header.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0cd3e2e86e0fa0810f53b42521729e12",
"score": "0.59790266",
"text": "def add_signing_headers(verb, path, request)\n ChefAPI::Log.info \"Adding signed header authentication...\"\n\n authentication = Authentication.from_options(\n user: client,\n key: key,\n verb: verb,\n path: path,\n body: request.body || request.body_stream\n )\n\n authentication.headers.each do |key, value|\n ChefAPI::Log.debug \"#{key}: #{value}\"\n request[key] = value\n end\n\n if request.body_stream\n request.body_stream.rewind\n end\n end",
"title": ""
},
{
"docid": "6e32a41352aa84e6c2cc329696b086a2",
"score": "0.5972321",
"text": "def set_header(auth_headers)\n header 'access-token', auth_headers['access-token']\n header 'token-type', auth_headers['token-type']\n header 'client', auth_headers['client']\n header 'expiry', auth_headers['expiry']\n header 'uid', auth_headers['uid']\nend",
"title": ""
},
{
"docid": "6847cc23b346d1abb85f2adb47078c5e",
"score": "0.5870412",
"text": "def write_headers\n @mailbox.update do |yaml|\n yaml[@hash] = @headers\n end\n end",
"title": ""
},
{
"docid": "c24d9de19f45c7aa17796e0755e324c8",
"score": "0.5859963",
"text": "def set_meta_headers(headers)\n @logger.info \"Setting #{headers.keys.join(', ')} for tenant #{@fog_options[:hp_tenant_id]}...\"\n response = @connection.request({\n :method => 'POST',\n :headers => headers\n })\n\n # Confirm meta data changes\n response = @connection.request({\n :method => 'HEAD'\n })\n\n @logger.info \"Done setting account meta key.\"\n end",
"title": ""
},
{
"docid": "75c510954d6e12b568290bbc69454bf8",
"score": "0.57235396",
"text": "def add_auth_headers\n @client.headers['Auth-Email'] = '...'\n @client.headers['Auth-Token'] = '...'\n end",
"title": ""
},
{
"docid": "a1555ce8ef44fcc6feb58a8f128cf604",
"score": "0.5539904",
"text": "def add_headers; end",
"title": ""
},
{
"docid": "5aea50d108205bb47396038138c0fd5b",
"score": "0.5498709",
"text": "def set_header_fields(request)\n request.smb2_header.tree_id = id\n request.smb2_header.credits = 256\n request\n end",
"title": ""
},
{
"docid": "541e22e01cd0798f256b377faa5392a4",
"score": "0.5489956",
"text": "def configure_api_auth_header(connection_headers)\n if api_keys?\n connection_headers['Authorization'] = generate_auth_key\n end\n end",
"title": ""
},
{
"docid": "a2649ef0b7cd00fd7946b39284cbb2c2",
"score": "0.5478273",
"text": "def auth_headers(headers = {})\n h = headers.dup\n h['X-Tableau-Auth'] = @client.auth.token\n h\n end",
"title": ""
},
{
"docid": "f99b8000c517a1a1a3b4eb6754d36daf",
"score": "0.5456908",
"text": "def add_authentication(_, request)\n request.headers['X-User-Email'] = self.class.api_user_email\n request.headers['X-User-Token'] = self.class.api_token\n end",
"title": ""
},
{
"docid": "895bea03e75ce656711250cba5fb308b",
"score": "0.54044026",
"text": "def new\n @ldap_auth_header = Irm::LdapAuthHeader.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ldap_auth_header }\n end\n end",
"title": ""
},
{
"docid": "88ab333dab407b3e0e326baedd7cb0c2",
"score": "0.539279",
"text": "def put_acl(bucket, key, acl_xml_doc, headers={})\n return Response.new(\n make_request('PUT', bucket, CGI::escape(key), {'acl' => nil}, headers, acl_xml_doc, {})\n )\n end",
"title": ""
},
{
"docid": "d5ea41b00604e0afe99ba5c163b3af2a",
"score": "0.53845793",
"text": "def upd_header(headers)\n hdr={'Content-Type' =>'application/json'}\n if(headers!=nil)\n headers['Content-Type']='application/json'\n hdr=headers\n end\n hdr\n end",
"title": ""
},
{
"docid": "9516e10f1eaf4f3bb720a8b034446584",
"score": "0.53718233",
"text": "def set_header key, value\n headers.update(key => value)\n end",
"title": ""
},
{
"docid": "b36cc3ef47fb7f2125cfb51b99589931",
"score": "0.53443867",
"text": "def update_token_headers\n if user_signed_in?\n response.headers['sid'] = request.headers['sid']\n response.headers['utoken'] = request.headers['utoken']\n end\n end",
"title": ""
},
{
"docid": "cec5c986e60ed5c8ef40210baaf7fecd",
"score": "0.53229904",
"text": "def headers=(hash); end",
"title": ""
},
{
"docid": "cec5c986e60ed5c8ef40210baaf7fecd",
"score": "0.53229904",
"text": "def headers=(hash); end",
"title": ""
},
{
"docid": "b8c6916060e14d8d43de299e5e381f30",
"score": "0.5285326",
"text": "def auth_headers(name: 'viraj', password: 'password')\n credentials = \"#{name}:#{password}\"\n { 'Authorization' => \"Basic #{Base64.encode64(credentials)}\" }\n end",
"title": ""
},
{
"docid": "ae23f52089d6afa26f7d08907d3499be",
"score": "0.5266092",
"text": "def []=(k, v) @headers[translate_header_to_sym(k)] = v end",
"title": ""
},
{
"docid": "141835f63b8831adf7d8218756a9d7b2",
"score": "0.52594984",
"text": "def set_auth_header(token)\n\t\t\tActiveResource::Base.headers['Authorization'] = \"Bearer #{token}\"\n\t\t\tnil\n\t\tend",
"title": ""
},
{
"docid": "f287f9b7ae17cf86f68c81be1766d6bb",
"score": "0.52512026",
"text": "def verify_auth_header_components headers\n auth_header = headers.find { |x| x[0] == \"Authorization\" }\n raise MalformedAuthorizationError, \"Authorization header is missing\" if auth_header.nil? || auth_header[1] == \"\"\n auth_hash = ::Signet::OAuth1.parse_authorization_header(\n auth_header[1]\n ).each_with_object({}) { |(key, val), acc| acc[key.downcase] = val; }\n\n auth_hash\n end",
"title": ""
},
{
"docid": "7eeb6a419759ade9dd5502867a11375a",
"score": "0.52462643",
"text": "def request_headers=(request_headers); end",
"title": ""
},
{
"docid": "f2eb3637362ec9382b6c4baa1546e3d9",
"score": "0.5246106",
"text": "def set_request_headers!(request); end",
"title": ""
},
{
"docid": "21e6b51f41dc6796bea80d3b506796ed",
"score": "0.5207515",
"text": "def set_extra_headers_for(params)\n maor_headers = {\n 'x-tmrk-version' => @version,\n 'Date' => Time.now.utc.strftime(\"%a, %d %b %Y %H:%M:%S GMT\"),\n }\n params[:headers].merge!(maor_headers)\n if params[:method]==\"POST\" || params[:method]==\"PUT\"\n params[:headers].merge!({\"Content-Type\" => 'application/xml'})\n params[:headers].merge!({\"Accept\" => 'application/xml'})\n end\n unless params[:body].empty?\n params[:headers].merge!({\"x-tmrk-contenthash\" => \"Sha256 #{Base64.encode64(Digest::SHA2.digest(params[:body].to_s)).chomp}\"})\n end\n if @authentication_method == :basic_auth\n params[:headers].merge!({'Authorization' => \"Basic #{Base64.encode64(@username+\":\"+@password).delete(\"\\r\\n\")}\"})\n elsif @authentication_method == :cloud_api_auth\n signature = cloud_api_signature(params)\n params[:headers].merge!({\n \"x-tmrk-authorization\" => %{CloudApi AccessKey=\"#{@access_key}\" SignatureType=\"HmacSha256\" Signature=\"#{signature}\"}\n })\n end\n params[:headers]\n end",
"title": ""
},
{
"docid": "c223966b79303a7f667f531fa4730b14",
"score": "0.5206429",
"text": "def generate_headers(request, soap)\n super(request, soap)\n credentials = @credential_handler.credentials\n request.url = soap.endpoint\n request.headers['Authorization'] =\n @auth_handler.auth_string(credentials)\n end",
"title": ""
},
{
"docid": "26588b231630360edf8fd96ad29c9b61",
"score": "0.51974696",
"text": "def set_header name, value\n response_object.header name, value\n end",
"title": ""
},
{
"docid": "ed919c7076d5e81ebb5136a24767aabc",
"score": "0.51853305",
"text": "def add_header(name, value)\n end",
"title": ""
},
{
"docid": "f89ad68eed4e2e56ed743137aac30139",
"score": "0.51843786",
"text": "def update_token_auth_headers(response)\n self.token_auth_headers ||= {}\n ['access-token','client','uid','expiry'].each do |header_name|\n self.token_auth_headers[header_name] = response.headers[header_name] unless response.headers[header_name].nil?\n end\n return token_auth_headers\n end",
"title": ""
},
{
"docid": "1a22640ad4f2799a55545b062243fafb",
"score": "0.5182892",
"text": "def fill_header(response); end",
"title": ""
},
{
"docid": "4bd9eca674cb573d2a0d59e761d67b23",
"score": "0.51667464",
"text": "def headers(headers); end",
"title": ""
},
{
"docid": "b60ddaef7c86475deffc5e2dc0ded803",
"score": "0.51374644",
"text": "def add_http_header(key, value)\n @http_headers[key] = value\n end",
"title": ""
},
{
"docid": "5761ae76b0e3f8fffee32a2b46e07f27",
"score": "0.51192635",
"text": "def put_acl(bucket, key, acl_xml_doc, headers={})\n return generate_url('PUT', bucket, CGI::escape(key), {'acl' => nil}, headers)\n end",
"title": ""
},
{
"docid": "c9401485b9225d9d5f5d1bdbc8b19226",
"score": "0.50754404",
"text": "def basic_auth_header(username,password)\n auth_str = username.to_s + \":\" + password.to_s\n auth_str = \"Basic \" + Rex::Text.encode_base64(auth_str)\n end",
"title": ""
},
{
"docid": "df0616003dfa2a5714386a054b40fb81",
"score": "0.50711703",
"text": "def prepare_request(request, soap, args)\n super(request, soap, args)\n soap.header[:attributes!] ||= {}\n header_name = prepend_namespace(@element_name)\n soap.header[:attributes!][header_name] ||= {}\n soap.header[:attributes!][header_name]['xmlns'] = @auth_namespace\n end",
"title": ""
},
{
"docid": "203f52b453614ba4b413decbb4eb2506",
"score": "0.5053821",
"text": "def http2_upgraded_headers(headers)\n headers.merge(\n ':scheme' => 'http',\n ':authority' => headers['host']\n )\n end",
"title": ""
},
{
"docid": "29e9d9d2a3d64c459709f39c7aa29640",
"score": "0.50501233",
"text": "def ambari_request_header\n admin_password = node['ambari']['admin']['password']\n admin_user = node['ambari']['admin']['user']\n headers = { 'AUTHORIZATION' =>\n \"Basic #{Base64.encode64(\"#{admin_user}:#{admin_password}\")}\",\n 'Content-Type' => 'application/data',\n 'X-Requested-By' => 'ambari' }\n headers\nend",
"title": ""
},
{
"docid": "1163f965738584eef6bf12d473744485",
"score": "0.50481343",
"text": "def api_user_headers\n user = create(:user)\n headers = api_user_login(user.email, user.password)\n request.headers['access-token'] = headers['access-token']\n request.headers['client'] = headers['client']\n request.headers['uid'] = headers['uid']\n end",
"title": ""
},
{
"docid": "3f9b1d51c71b65fa6eec32ea53223a34",
"score": "0.50450444",
"text": "def add_generic_headers(http_method, uri, request_headers, context = nil)\n request_headers.concat(@session.meta_data_provider.meta_data_headers)\n request_headers.push(RequestHeader.new('Date', get_header_date_string))\n if !context.nil? && !context.idempotence_key.nil?\n request_headers.push(RequestHeader.new('X-GCS-Idempotence-Key', context.idempotence_key))\n end\n authenticator = @session.authenticator\n authentication_signature = authenticator.create_simple_authentication_signature(http_method, uri, request_headers)\n request_headers.push(RequestHeader.new('Authorization', authentication_signature))\n end",
"title": ""
},
{
"docid": "fe4a37a4028a5b6f5eea6574fb738d69",
"score": "0.5033647",
"text": "def safe_append_header(key, value)\n resp_headers[key] = value.to_s\n end",
"title": ""
},
{
"docid": "79f59385e1e8240057a42b37b9f6d294",
"score": "0.5032389",
"text": "def test_should_update_link_via_API_XML\r\n get \"/logout\"\r\n put \"/links/1.xml\", :link => {:user_id => 1,\r\n :title => 'API Link 1',\r\n :url => 'http://www.api.com'}\r\n assert_response 401\r\n end",
"title": ""
},
{
"docid": "3912d92f8aa5cadba92b2a439b02a8c3",
"score": "0.5030853",
"text": "def update_headers(oauth_key: nil, fingerprint: nil, client_id: nil, client_secret: nil, ip_address: nil, idemopotency_key: nil)\n\t\t\tconfig[:fingerprint] = fingerprint if fingerprint\n\t\t\tconfig[:oauth_key] = oauth_key if oauth_key\n\t\t\tconfig[:client_id] = client_id if client_id\n\t\t\tconfig[:client_secret] = client_secret if client_secret\n\t\t\tconfig[:ip_address] = ip_address if ip_address\n config[:idemopotency_key] = idemopotency_key if idemopotency_key\n\t\t\tnil\n\t\tend",
"title": ""
},
{
"docid": "80cbc607c007e14f30dd94a8c23a8a03",
"score": "0.50261545",
"text": "def auth_header\n { :token => @token, :seq => @seqid }\n end",
"title": ""
},
{
"docid": "d86d0303fec2deb4eb2e58899cf9a0bb",
"score": "0.5025605",
"text": "def prepend_header(name, value)\n end",
"title": ""
},
{
"docid": "b2f17ea89847132abf9bf592bccb1b98",
"score": "0.5025369",
"text": "def add_headers(name, value)\n @headers += ', ' if @headers.length > 0\n @headers += name + '=\"'\n @headers += LoggingUtil.obfuscate_header(name, value) unless value.nil?\n @headers += '\"'\n end",
"title": ""
},
{
"docid": "4b17b70883008631733af5b79651c60e",
"score": "0.50189525",
"text": "def process_type1_auth(ntlm, request, response)\n t1 = request.ntlm_token\n t2 = ntlm.accept_security_context(t1)\n\n response.start(401) do |head,out|\n head['WWW-Authenticate'] = \"NTLM #{t2}\"\n end\n \n response.ntlm_finished\n end",
"title": ""
},
{
"docid": "8f26789f0f463842a3dea434cc583dc9",
"score": "0.50071883",
"text": "def set_authorisation_header(request)\n request[\"Authorization\"] = \"Bearer #{access_token}\"\n end",
"title": ""
},
{
"docid": "e4cc39d96554b7df3b8d8bee355e6929",
"score": "0.4974729",
"text": "def set_headers! session = nil\n response.headers['sid'] = session.id\n response.headers['utoken'] = session.utoken\n end",
"title": ""
},
{
"docid": "d9f70dc9b4972a67b3d409d9639bf367",
"score": "0.49682796",
"text": "def headers=(v)\n cfg_set(:headers, v)\n end",
"title": ""
},
{
"docid": "d5053289e4384d2a635f6d3cf4b033ad",
"score": "0.49668288",
"text": "def headers=(hash)\n @headers.replace hash\n end",
"title": ""
},
{
"docid": "610feb814e67c927fcc58bfdb364d990",
"score": "0.49659258",
"text": "def update_auth_header\n # cannot save object if model has invalid params\n # @resource should == current_user\n return unless @resource && @resource.valid? && @client_id\n\n # Generate new client_id with existing authentication\n @client_id = nil unless @used_auth_by_token\n\n if @used_auth_by_token &&\n @resource.try(:tokens).present? &&\n ENV['ACCESS_TOKEN_LIFETIME'].to_i > 0\n\n # Get the token we are working with before reload (a simultaneous request could alter the valid token)\n original_token = @resource.tokens[@client_id].try(:fetch, 'token')\n\n @resource.reload\n\n # should not append auth header if @resource related token was\n # cleared by sign out in the meantime.\n return if @resource.tokens[@client_id].nil?\n\n token_created_at = Time.zone.at(@resource.tokens[@client_id]['created_at'])\n\n # If the token has not expired or changed and this is not a batch request, return it as a valid token.\n if @request_started_at < token_created_at + Integer(ENV['ACCESS_TOKEN_LIFETIME']) &&\n original_token == @resource.tokens[@client_id]['token'] &&\n !is_batch_request?(@resource, @client_id)\n\n return response.headers.merge!(@resource.build_auth_header(@token, @client_id))\n end\n end\n\n super\n end",
"title": ""
},
{
"docid": "d7e609f96073d6da00ef4a83919f7d3e",
"score": "0.49654108",
"text": "def update_headers(request_headers)\n @request_headers.merge!(request_headers)\n end",
"title": ""
},
{
"docid": "ad209399551c359c5be3c71f02b15167",
"score": "0.49604857",
"text": "def change_header( header, value, index=1 )\n index = [index].pack('N')\n RESPONSE[\"CHGHEADER\"] + \"#{index}#{header}\\0#{value}\" + \"\\0\"\n end",
"title": ""
},
{
"docid": "05c4c9ea81de3bb9418061060db26bef",
"score": "0.49579978",
"text": "def test_parse_auth_header_with_spacing\n header = 'Digest qop=\"auth\", realm=\"'+ @realm +'\", nonce=\"'+ @nonce +'\", opaque=\"\", stale=\"false\", domain=\"\\my\\test\\domain\"'\n check_header(header)\n end",
"title": ""
},
{
"docid": "70e0a5cf20e904aa9d494894c0d3f069",
"score": "0.49558538",
"text": "def set_sasc_request_headers(api_version = nil)\n sasc_request_headers(api_version).each { |header, value| request.headers[header] = value }\n end",
"title": ""
},
{
"docid": "0c406557409031d34420f5377891ff57",
"score": "0.49542776",
"text": "def set_header(header, value)\n @lunetas_headers[header.to_s] = value\n end",
"title": ""
},
{
"docid": "c1a8ae6f504a2848e57d3f8ff26beaf7",
"score": "0.49539918",
"text": "def request_headers=(_arg0); end",
"title": ""
},
{
"docid": "75861b7dedbd865d6b9c7dfd16fa7320",
"score": "0.49535543",
"text": "def authorize_request(req)\n req.headers['Authorization'] = \"ApiKey #{@user}:#{@apikey}\"\n end",
"title": ""
},
{
"docid": "0b48519ebabfdf64674ce61f5340fc87",
"score": "0.49534655",
"text": "def authorization_header\n \"Basic #{Base64.encode64(\"#{@username}:#{@password}\").delete(\"\\r\\n\")}\"\n end",
"title": ""
},
{
"docid": "a23b6b554022b8a47a734fcaeadb229f",
"score": "0.4944339",
"text": "def http_auth_header?; end",
"title": ""
},
{
"docid": "b15962601e2aa1a4183b616ee26a8725",
"score": "0.49436814",
"text": "def formulate_headers(auth_header)\n {\n 'Content-Type' => 'application/json',\n 'Authorization' => auth_header,\n 'Content-Encoding' => 'gzip',\n 'Accept' => 'application/json'\n }\n end",
"title": ""
},
{
"docid": "a1d39d41506aa9776da225d27af51a1e",
"score": "0.49417135",
"text": "def push_to_headers\n unless @session.nil?\n response.headers['sid'] = @session.id\n response.headers['utoken'] = @session.utoken\n end\n end",
"title": ""
},
{
"docid": "a6a3e44093242e4709f59e853db62f9f",
"score": "0.49388796",
"text": "def []=(key, value)\n @headers[key] = value\n end",
"title": ""
},
{
"docid": "ce9eb1e7c2bc1be24eaf1bc5e9fb76d3",
"score": "0.49366537",
"text": "def auth_headers\n {\n 'Content-Type' => 'application/x-www-form-urlencoded'\n }\n end",
"title": ""
},
{
"docid": "cdce55bfebe76af210aabd6e6519f603",
"score": "0.4931322",
"text": "def ns_headers(long) \n if long\n return { \n \"Content-Type\" => \"application/json\",\n \"Authorization\" => NSConnector::Restlet.auth_header \n }\n else\n return {\n \"Accept\" => \"application/json\" \n }\n end\n end",
"title": ""
},
{
"docid": "449d6199c679865463a69818f81ebbd2",
"score": "0.49302962",
"text": "def set_headers(soap, args, extra_namespaces)\n @headerhandler.each do |handler|\n handler.prepare_request(@client.http, soap, args)\n end\n soap.namespaces.merge!(extra_namespaces) unless extra_namespaces.nil?\n end",
"title": ""
},
{
"docid": "00a06a1c31f7a5a31026c03900194c0c",
"score": "0.49265194",
"text": "def put_header(key, value)\n @j_del.putHeader(key, value.to_s)\n self\n end",
"title": ""
},
{
"docid": "00a06a1c31f7a5a31026c03900194c0c",
"score": "0.49265194",
"text": "def put_header(key, value)\n @j_del.putHeader(key, value.to_s)\n self\n end",
"title": ""
},
{
"docid": "2c10ee888db18cc0a9d4bb86ed086cec",
"score": "0.49245727",
"text": "def auth(key)\n\t\t#TODO\n\t\t#return response\n\t\tstatus 201\n\tend",
"title": ""
},
{
"docid": "1c17158eb6c64fe14b6ccc867a0fb2b4",
"score": "0.49227107",
"text": "def add_auth_basic auth, url, client_opts\n l = @spaces.bsearch_lower_boundary { |x| x.prefix <=> url }\n space = nil\n\n if l < @spaces.length && self.class.prefix?(@spaces[l].prefix, url)\n space = @spaces[l]\n else\n prefix = url.sub /[^\\/]+$/, '' # chop off until last slash\n \n space = AuthSpace.new prefix\n @spaces.insert l, space\n end\n space.update_auth auth, client_opts\n end",
"title": ""
},
{
"docid": "5dafeee9ead205df54bde6d69deb3a08",
"score": "0.49215063",
"text": "def headers=(v)\n cfg_set(:headers, v)\n end",
"title": ""
},
{
"docid": "6afb38a034b752a4a60f67bf2f69a028",
"score": "0.49201757",
"text": "def add_header key, value\n\t\t\t@headers ||= {}\n\t\t\t@headers[key] = value\n\t\tend",
"title": ""
},
{
"docid": "857fa247811ad2536a8c71640eac6259",
"score": "0.49091342",
"text": "def signature_oauth_headers\n o = oauth_headers.dup; o.delete(:realm); o\n end",
"title": ""
},
{
"docid": "89e63a0c7e165c60e5bba8f63924c13a",
"score": "0.49085635",
"text": "def update\n respond_to do |format|\n if @header.update(header_params)\n format.html { redirect_to edit_admin_header_path(@header), notice: 'Header was successfully updated.' }\n format.json { render :show, status: :ok, location: @header }\n else\n format.html { render :edit }\n format.json { render json: @header.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8e612347c549b00cb5a16942d253ce27",
"score": "0.49028656",
"text": "def add_auth(auth, curl, params)\n if auth == 'basic'\n username, password = params.values_at(:username, :password)\n encoded = Base64.encode64(\"#{username}:#{password}\").strip\n curl.headers['Authorization'] = \"Basic #{encoded}\"\n end\n end",
"title": ""
},
{
"docid": "980f9e71a2256d4d088602e4871782f7",
"score": "0.48987314",
"text": "def change_header( header, value, index=1 )\n index = [index].pack('N')\n RESPONSE[:chgheader] + \"#{index}#{header}\\0#{value}\" + \"\\0\"\n end",
"title": ""
},
{
"docid": "b01b46b3e443aefff1ea51e8215dabd1",
"score": "0.48896253",
"text": "def add_headers(name, value)\n @headers += ', ' if @headers.length > 0\n @headers += name + '=\"'\n @headers += @header_obfuscator.obfuscate_header(name, value) unless value.nil?\n @headers += '\"'\n end",
"title": ""
},
{
"docid": "36fc4b73aa67d2105aefd63f2aaffd32",
"score": "0.48875198",
"text": "def auth_headers(account)\n if config.pre_shared_key.present? && account.present?\n {\n 'x-rh-receptor-controller-psk' => config.pre_shared_key,\n 'x-rh-receptor-controller-client-id' => \"topological-inventory\",\n 'x-rh-receptor-controller-account' => account\n }\n else\n identity_header || {}\n end\n end",
"title": ""
},
{
"docid": "74ffdaaa04f4f55d3de0005e5c4c7781",
"score": "0.48793015",
"text": "def redmine_headers(h)\n h.each { |k,v| headers[\"X-Redmine-#{k}\"] = v }\n end",
"title": ""
},
{
"docid": "74ffdaaa04f4f55d3de0005e5c4c7781",
"score": "0.48793015",
"text": "def redmine_headers(h)\n h.each { |k,v| headers[\"X-Redmine-#{k}\"] = v }\n end",
"title": ""
},
{
"docid": "766caba0cea91ee130e00b13ac7bdfce",
"score": "0.4878099",
"text": "def show\n @ldap_auth_header = Irm::LdapAuthHeader.list_all.find(params[:id])\n puts @ldap_auth_header.ldap_source.name\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ldap_auth_header }\n end\n end",
"title": ""
},
{
"docid": "edbe4f5419827ab6ec41c091e5c12a30",
"score": "0.4877602",
"text": "def set_header(name, value)\n @headers[name] = value\n \n return self\n end",
"title": ""
},
{
"docid": "66e171b3ca9727d6ee071a8a28d9e826",
"score": "0.48707646",
"text": "def put(header = {})\n url = \"#{ApiClient.config.path}#{self.class.resource_path}\"\n response = ApiClient::Dispatcher.put(url, self.to_hash, header)\n attributes = ApiClient::Parser.response(response, url)\n update_attributes(attributes)\n end",
"title": ""
},
{
"docid": "23208b13a1127b58981e77b958a9cbb1",
"score": "0.4868865",
"text": "def lbaas_headers\n ret = {\n :content_type => :json,\n :accept => :json,\n }\n\n ret[:'X-Auth-Token'] = @keystone_token if @keystone_token\n\n ret\n end",
"title": ""
},
{
"docid": "b9733962fee8c86e5aaf22112df760e9",
"score": "0.48672962",
"text": "def update\n respond_to do |format|\n if @header.update(header_params)\n format.html { redirect_to @header, notice: \"Header was successfully updated.\" }\n format.json { render :show, status: :ok, location: @header }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @header.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "08ba471f1852139df72557735d5054dd",
"score": "0.4863485",
"text": "def make_headers(user_headers); end",
"title": ""
},
{
"docid": "e8dfa70dffd7b7e0024b98bee1bc1b71",
"score": "0.48552364",
"text": "def authentication_header\r\n hash = authentication_token.to_hash\r\n to_wsdl 'AuthenticationResult' => hash[:AuthenticateUserResponse][:AuthenticateUserResult]\r\n end",
"title": ""
},
{
"docid": "a058d321b266e81479622185620bb49a",
"score": "0.4850035",
"text": "def encode_header(cmd_parms)\n header_params = {}\n body_digest = OpenSSL::Digest::MD5.digest(cmd_parms[:body])\n body_base64 = Base64.encode64(body_digest)\n\n current_date = Time.now.strftime('%Y-%m-%d %H:%M')\n\n data = \"#{current_date}\" + \"\\n\" + \"#{cmd_parms[:path]}\" + \"\\n\" + \"#{body_base64}\"\n\n digest = OpenSSL::Digest.new('sha1')\n movingFactor = data.rstrip!\n if @password == \"\" || !(@api_key.nil?)\n hash = OpenSSL::HMAC.hexdigest(digest, @api_key, movingFactor)\n else\n hash = OpenSSL::HMAC.hexdigest(digest, Base64.strict_decode64(@password), movingFactor)\n end\n final_hmac = @email + ':' + hash\n header_params = { hmac: final_hmac, date: current_date }\n end",
"title": ""
},
{
"docid": "138e67bf46fe54cb4136d8adfd2fd2ab",
"score": "0.48485345",
"text": "def set_header(token)\n response.headers['Authorization'] = \"Bearer #{token.to_jwt}\"\n end",
"title": ""
},
{
"docid": "246e162278007570aac4a0af321f9525",
"score": "0.4846729",
"text": "def apply_headers(req)\n req.add_field('API-Version', self.api_version)\n req.add_field('accept','application/json')\n req.add_field('Content-Type','application/json')\n req.add_field('API-Appid', self.app_id)\n req.add_field('API-Username', self.username)\n req.add_field('API-Password', self.password)\n return req\n end",
"title": ""
},
{
"docid": "4f95a6e63ca72a368f4878087066ba82",
"score": "0.4841289",
"text": "def header_set(name, value)\n return dup_without_response.header_set(name, value) if response\n\n name = name.to_s\n if value.nil?\n @headers.delete name\n return self\n end\n\n @headers[name] = value.to_s\n self\n end",
"title": ""
},
{
"docid": "7171ec168df6c82d326fc840902a1a95",
"score": "0.48360583",
"text": "def update\n respond_to do |format|\n if @admin_header.update(admin_header_params)\n format.html { redirect_to admin_root_path, notice: 'Header was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_header }\n else\n format.html { render :edit }\n format.json { render json: @admin_header.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "809c4b855c6d82cc298830e526c67a3f",
"score": "0.48298877",
"text": "def headers=(_arg0); end",
"title": ""
},
{
"docid": "809c4b855c6d82cc298830e526c67a3f",
"score": "0.48298877",
"text": "def headers=(_arg0); end",
"title": ""
},
{
"docid": "809c4b855c6d82cc298830e526c67a3f",
"score": "0.48298877",
"text": "def headers=(_arg0); end",
"title": ""
},
{
"docid": "809c4b855c6d82cc298830e526c67a3f",
"score": "0.48298877",
"text": "def headers=(_arg0); end",
"title": ""
},
{
"docid": "6a95df222cbc3b8bb638f155d1e77118",
"score": "0.48263416",
"text": "def authorization_header\n \"Basic #{Base64.encode64(\"#{@username}:#{@password}\").chomp!}\"\n end",
"title": ""
},
{
"docid": "547ef34ee00f09b35930368148ee578c",
"score": "0.48174304",
"text": "def []=(header, value)\n @headers[header] = value\n end",
"title": ""
},
{
"docid": "d6c3f69f40a82be10c01e89607374f5b",
"score": "0.48170587",
"text": "def set_aws_auth_header(request, aws_access_key_id, aws_secret_access_key, bucket='', key='', path_args={})\n # we want to fix the date here if it's not already been done.\n request['Date'] ||= Time.now.httpdate\n\n # ruby will automatically add a random content-type on some verbs, so\n # here we add a dummy one to 'supress' it. change this logic if having\n # an empty content-type header becomes semantically meaningful for any\n # other verb.\n request['Content-Type'] ||= ''\n\n canonical_string =\n S3.canonical_string(request.method, bucket, key, path_args, request.to_hash, nil)\n encoded_canonical = S3.encode(aws_secret_access_key, canonical_string)\n\n request['Authorization'] = \"AWS #{aws_access_key_id}:#{encoded_canonical}\"\n end",
"title": ""
}
] |
f407c9f89c6e85a257b8aa32db62ef4c
|
Writes the temporary file out to either a file location (by passing in a String) or by passing in a Stream that you can write(chunk) to repeatedly
|
[
{
"docid": "8adc6ea6841c1c64ca9ad9bb5bf14f0f",
"score": "0.0",
"text": "def write(output_to); end",
"title": ""
}
] |
[
{
"docid": "99241441e1fd907266397f3c3e5a3c55",
"score": "0.62920505",
"text": "def write_temp_file(contents, prefix: 'tempfile')\n t = Tempfile.new prefix\n t.write contents\n t.close\n\n @tempfile_hospital << t\n # Mason 2016-03-15: You MUST keep a ref to a Tempfile-created temp file around; if not, the file will be deleted when instance is GC'd. Caused shitty 30 min headache bug, where SSH connection failed because the key disappeared during connecting!\n\n FileUtils.chmod 0600, t.path # Mason 2016-03-15: may not be necessary (?), but doesn't hurt.\n\n t.path\n end",
"title": ""
},
{
"docid": "986dd54ab829bcfc7f211e48cea206c9",
"score": "0.6255035",
"text": "def generate_tmp_file\n FileUtils.mkdir_p(local_tmp_dir) unless File.exists?(local_tmp_dir)\n #TODO avoid name collision\n stored = File.new(local_file_pathname, 'wb')\n stored.write s3_obj.read\n stored.close\n # Download and write the file in blocks off the HTTP Response (see S3Object.read in aws-sdk docs)\n # File.open(local_file_pathname, 'w') do |file|\n # s3_obj.read do |chunk|\n # file.write(chunk)\n # end\n # file\n # end\n end",
"title": ""
},
{
"docid": "ba1c1c059cf260699b9581d7bcdc92d3",
"score": "0.62485445",
"text": "def open_with_block(opt, block)\n Tempfile.create(TEMPORARY_FILE_PREFIX, **opt) do |temporary_file|\n temporary_file.write(contents)\n temporary_file.seek(0)\n\n block.call(temporary_file)\n end\n end",
"title": ""
},
{
"docid": "db4a455edf22fe7dc5fbf9900374d905",
"score": "0.614867",
"text": "def write_chunk(start, buffer)\n @local_file.seek(start)\n @local_file.write(buffer)\n end",
"title": ""
},
{
"docid": "c1dd31724df16ef580f2c812b37e425c",
"score": "0.6142251",
"text": "def to_file\n replace_with_tempfile unless @tempfile_in\n flush\n self\n end",
"title": ""
},
{
"docid": "b91b377268427953aa67e7d90515f5bf",
"score": "0.6088642",
"text": "def create_tmp_file(comment)\n file = Tempfile.new('foo')\n file.write(comment)\n file.close\n\n file.path\nend",
"title": ""
},
{
"docid": "620ab5851e3e9997a3b1cd905ec1cd9d",
"score": "0.60480785",
"text": "def tempfile(string)\n file = Tempfile.new([name, '.html'])\n begin\n file.write(string)\n ensure\n file.close\n end\n yield(file).tap { file.unlink }\n end",
"title": ""
},
{
"docid": "a999a211132188437651d2150f5930f4",
"score": "0.60125",
"text": "def write_file(newfile, instream)\n File.open(newfile, \"w\") do |f|\n f.write(instream.read)\n end\nend",
"title": ""
},
{
"docid": "eb57c69f65b9c6c05cb6ef92da587e57",
"score": "0.6004185",
"text": "def stream_to object, path_or_file, in_blocks_of = 8192\n dstio = case path_or_file\n when String then File.new(path_or_file, \"wb+\")\n when IO then path_or_file\n when Tempfile then path_or_file\n end\n buffer = \"\"\n object.rewind\n while object.read(in_blocks_of, buffer) do\n dstio.write(buffer)\n end\n dstio.rewind\n dstio\n end",
"title": ""
},
{
"docid": "fdb8166db0ef7a4e8cc3a5aa570444c9",
"score": "0.6003159",
"text": "def temp_file(*args, &block)\n self.class.temp_file(prefix_suffix, *args, &block)\n end",
"title": ""
},
{
"docid": "0b7374179afce7b53be9052b80d0a172",
"score": "0.59997356",
"text": "def tempfile\n ::Tempfile.new(filename, tempfile_path).tap do |tmp|\n tmp.write s3obj.value\n tmp.close\n end\n end",
"title": ""
},
{
"docid": "3fd25ae53c11b4a8a31bf3cd347ef16e",
"score": "0.59982646",
"text": "def tempfile content\n Tempfile.new(@NAME).tap do |body_io|\n body_io.unlink\n body_io.write content\n body_io.flush\n body_io.rewind\n end\n end",
"title": ""
},
{
"docid": "f1c785ed9a472b3f17c347e1f36a9cca",
"score": "0.5959979",
"text": "def with_tmpfile\n path = [@file, $$.to_s(36), Thread.current.object_id.to_s(36)].join\n file = File.open(path, 'wb')\n yield(path, file)\n ensure\n file.close unless file.closed?\n File.unlink(path) if File.exists?(path)\n end",
"title": ""
},
{
"docid": "e4c0e91236b9c1036cf45d4b7c8d6668",
"score": "0.59185696",
"text": "def temporary_file(path)\n tmp_path = temporary_path(path)\n file = open(tmp_path)\n files_to_close << file\n file\n end",
"title": ""
},
{
"docid": "42a237f84a1a92efb991fa1bfce909d6",
"score": "0.58887",
"text": "def temp_file(text)\n file = Tempfile.new(\"ari\")\n file << text\n file.close\n file.path\nend",
"title": ""
},
{
"docid": "14ba6be2634298a0acee589fa5872431",
"score": "0.586659",
"text": "def write(io)\n tempfile = \"#{file_path}.#{Process.pid}.#{object_id}\"\n open(tempfile, \"wb\") do |file|\n while part = io.read(8192)\n file << part\n end\n end\n ::File.rename(tempfile, file_path)\n ensure\n ::File.unlink(tempfile) rescue nil\n end",
"title": ""
},
{
"docid": "761cafd79033457254e2d256d69626d7",
"score": "0.58345675",
"text": "def mock_io(string)\n# lambda do\n Tempfile.open('bio-og_test') do |tempfile|\n tempfile.puts string\n tempfile.close\n yield File.open(tempfile.path)\n# end\n end\n end",
"title": ""
},
{
"docid": "49ef2e6de0c52c399f8220b0544408e6",
"score": "0.5820747",
"text": "def open_without_block(opt)\n file = Tempfile.new(TEMPORARY_FILE_PREFIX, Dir.tmpdir, **opt)\n file.write(contents)\n file.seek(0)\n file\n rescue StandardError\n file&.close!\n raise\n end",
"title": ""
},
{
"docid": "a6f54a6138ee588751bfb7aa5027b577",
"score": "0.5814291",
"text": "def close; @tempfile.close; end",
"title": ""
},
{
"docid": "ab3e3735e080ce50e9b386c4a0c286d8",
"score": "0.58025163",
"text": "def sprint_write_file(type, content, file = nil)\n file = sprint_temp_file(type) if file.nil?\n log(\"#{self.class} writing file #{file}\", :info)\n File.open(file,'w'){ |f| f.write(content) }\n return type, file\n end",
"title": ""
},
{
"docid": "7df02dd431373afc9f61f89b8f516cea",
"score": "0.5772848",
"text": "def write(name, content)\n file = Tempfile.new(name)\n file.write(content)\n file.rewind\n file\n end",
"title": ""
},
{
"docid": "8d2b0f7999a0e9e7c7f13221da8fd1ac",
"score": "0.57621336",
"text": "def create_temp_file\n write_to_temp_file current_data\n end",
"title": ""
},
{
"docid": "2d5e5c9a2f445c516db9f329211265a8",
"score": "0.57515395",
"text": "def write_temporary_file(file_attr)\n config = self.class.cached_uploads[file_attr.to_sym]\n file = send file_attr\n \n if file.present?\n # Read the uploaded file, calc its MD5, and write the MD5 instance variable.\n file.rewind\n md5 = Digest::MD5.hexdigest(file.read)\n send \"#{config[:tmp_md5_attr]}=\", md5\n \n # Write the temporary file, using its MD5 hash to generate the filename.\n file.rewind\n File.open(send(config[:tmp_path_method]), 'wb') do |out_file|\n out_file.write file.read\n end\n else\n raise \"Called #write_temporary_file(:#{file_attr}), but ##{file_attr} was not present.\"\n end\n end",
"title": ""
},
{
"docid": "2c029d91fe41e81c029a690e94bfce10",
"score": "0.5724898",
"text": "def with_tmp_zip_file\n file = Tempfile.new('retrieve')\n begin\n file.binmode\n file.write(zip_file)\n file.rewind\n yield file\n ensure\n file.close\n file.unlink\n end\n end",
"title": ""
},
{
"docid": "0b854751b016dfe18509b37099a9c5d9",
"score": "0.57054883",
"text": "def tempfile; end",
"title": ""
},
{
"docid": "0b854751b016dfe18509b37099a9c5d9",
"score": "0.57054883",
"text": "def tempfile; end",
"title": ""
},
{
"docid": "cbb4d4da19c9b7a29e107b8006f0479a",
"score": "0.5692209",
"text": "def write_to(stream)\n end",
"title": ""
},
{
"docid": "887b87687dad32bd8a26e5856673ee2c",
"score": "0.5686235",
"text": "def create_temp_file\n copy_to_temp_file full_filename\n end",
"title": ""
},
{
"docid": "c866c410bc8e7a77b0b4c80917f216c0",
"score": "0.56764007",
"text": "def write_file(path, content=path)\n path = File.join(temporary_directory, path)\n FileUtils.mkdir_p File.dirname(path)\n open(path, 'w'){|f| f.print content}\n end",
"title": ""
},
{
"docid": "1edc2ec9df05c96ce7423854b304375a",
"score": "0.5675014",
"text": "def tmpfile(*args); end",
"title": ""
},
{
"docid": "48f2f86388562cf9b605592751c13be0",
"score": "0.5657753",
"text": "def writeDistantFile buffer, args\n path = \"#{@dir}/#{args[0]}\"\n begin\n f = File.new path, \"w\"\n rescue\n return Constant::Fail\n end\n f.write buffer.to_file\n f.close\n Constant::Success\n end",
"title": ""
},
{
"docid": "88d92ca53816ac7c2f7c450131ab6083",
"score": "0.5649401",
"text": "def save_to_temp_file\n result = true\n unless upload_temp_file\n\n # Image is supplied in a input stream. This can happen in a variety of\n # cases, including during testing, and also when the image comes in as\n # the body of a request.\n if upload_handle.is_a?(IO) || upload_handle.is_a?(StringIO) ||\n defined?(Unicorn) && upload_handle.is_a?(Unicorn::TeeInput)\n begin\n # Using an instance variable so the temp file lasts as long as\n # the reference to the path.\n @file = Tempfile.new(\"image_upload\")\n File.open(@file, \"wb\") do |write_handle|\n loop do\n str = upload_handle.read(16_384)\n break if str.to_s.empty?\n\n write_handle.write(str)\n end\n end\n # This seems to have problems with character encoding(?)\n # FileUtils.copy_stream(upload_handle, @file)\n self.upload_temp_file = @file.path\n self.upload_length = @file.size\n result = true\n rescue StandardError => e\n errors.add(:image,\n \"Unexpected error while copying attached file \" \\\n \"to temp file. Error class #{e.class}: #{e}\")\n result = false\n end\n\n # It should never reach here.\n else\n errors.add(:image, \"Unexpected error: did not receive a valid upload \" \\\n \"stream from the webserver (we got an instance of \" \\\n \"#{upload_handle.class.name}). Please try again.\")\n result = false\n end\n end\n result\n end",
"title": ""
},
{
"docid": "f41387929df4427270ebf8de87217198",
"score": "0.5639063",
"text": "def write_file(resp, path)\n FileUtils.mkdir_p File.dirname(path)\n # Download to a temporary file...\n File.open(tmp_path_for(path), 'wb') do |output|\n resp.read_body { |chunk| output << chunk }\n end\n # ... and atomically move it into place when it succeeds.\n FileUtils.mv tmp_path_for(path), path\n true\n rescue StandardError => ex\n # Delete (likely incomplete) temporary files on error.\n warn \"#{ex.class}: #{ex.message} - attempting to remove #{tmp_path_for(path)}.\"\n begin\n File.delete(tmp_path_for(path))\n rescue StandardError => ex\n warn \"#{ex.class}: #{ex.message} while attempting to remove #{tmp_path_for(path)}.\"\n end\n end",
"title": ""
},
{
"docid": "e0e8a0ca5b3e9a6972b7f70d6e7ffe5b",
"score": "0.56300455",
"text": "def write\n @log.debug('Creating temporary file...')\n tmp = Tempfile.new('oneacct_export')\n @log.debug(\"Temporary file: '#{tmp.path}' created.\")\n @log.debug('Writing to temporary file...')\n write_to_tmp(tmp, fill_template)\n copy_to_output(tmp.path, @output)\n ensure\n tmp.close(true)\n end",
"title": ""
},
{
"docid": "8afbafb18490bc46f66ec8e2f2db4d4d",
"score": "0.5627332",
"text": "def tmpio\n fp = begin\n TmpIO.open(\"#{Dir::tmpdir}/#{rand}\",\n File::RDWR|File::CREAT|File::EXCL, 0600)\n rescue Errno::EEXIST\n retry\n end\n File.unlink(fp.path)\n fp.binmode\n fp.sync = true\n fp\n end",
"title": ""
},
{
"docid": "0d91e10de5a5b4bbdfdc06f267443b08",
"score": "0.562436",
"text": "def temporary_file(contents=nil)\n f = Tempfile.new(\"vagrant-unit\")\n\n if contents\n f.write(contents)\n f.flush\n end\n\n # Store the tempfile in an instance variable so that it is not\n # garbage collected, so that the tempfile is not unlinked.\n @_temp_files << f\n\n return Pathname.new(f.path)\n end",
"title": ""
},
{
"docid": "5cb922505e7436133d16cf4d06ab7dcb",
"score": "0.56166285",
"text": "def write(chunk, last_chunk = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "5cb922505e7436133d16cf4d06ab7dcb",
"score": "0.56166285",
"text": "def write(chunk, last_chunk = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "5cb922505e7436133d16cf4d06ab7dcb",
"score": "0.56166285",
"text": "def write(chunk, last_chunk = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "5cb922505e7436133d16cf4d06ab7dcb",
"score": "0.56166285",
"text": "def write(chunk, last_chunk = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "3e76f66c4d668981c79595f0cf5510d6",
"score": "0.5613372",
"text": "def write_to_tempfile(txt)\n @report_file = File.new('/tmp/mxmlc_error_report.html', 'w+')\n @report_file.write(txt)\n @report_file.close\n end",
"title": ""
},
{
"docid": "6bb4b2aec5b804725aac34c179cd8fab",
"score": "0.56115997",
"text": "def with_tempfile content, &block\n Tempfile.open( 'colore' ) do |tf|\n tf.binmode\n if content.respond_to?(:read)\n IO.copy_stream(content,tf)\n else\n tf.write content\n end\n tf.close\n yield File.new(tf)\n end\n end",
"title": ""
},
{
"docid": "4c005366f333771cfd88d633c2789db3",
"score": "0.56079817",
"text": "def with_temp_file\n raise ArgumentError, 'A block must be supplied' unless block_given?\n now = Time.now\n yield(tmp = Tempfile.new(\"#{now.to_i}.#{now.usec}.#{Process.pid}\", options[:tempfile_base] || Dir::tmpdir))\n ensure\n tmp.close true if tmp\n end",
"title": ""
},
{
"docid": "21e9e43a130fa850144485ccdee4219e",
"score": "0.55880654",
"text": "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",
"title": ""
},
{
"docid": "667ed9a2ad75029c4a6d8acb64f351da",
"score": "0.55705255",
"text": "def store_file\n # TODO\n # - kick BOM if present\n # - convert to UTF-8 if a different encoding is given\n # - we should check double encoding because the tempfile is always read as utf8\n\n # writes the file binary/raw without taking encodings into account.\n # If we want to convert incoming files this should be done before\n File.open(full_filename, 'wb') do |f| #w:UTF-8\n f.write @uploaded_file.read\n end\n end",
"title": ""
},
{
"docid": "872b044cb6c5ed85ebf1c9a1a05cd6b1",
"score": "0.5541828",
"text": "def tempfile\n unless @tempfile\n @tempfile = Tempfile.new(binmode: true)\n @tempfile.write(@read || read_from(closest))\n @tempfile.open\n end\n @tempfile\n end",
"title": ""
},
{
"docid": "5a235a66ba582512d4bd9fcd63518329",
"score": "0.55262846",
"text": "def write(block)\n @filemgr.write(block, @contents)\n end",
"title": ""
},
{
"docid": "5574e9f9557002c05a85f6895cc813dc",
"score": "0.5512198",
"text": "def write_to(io)\n open {|i|\n FileUtils.copy_stream(i, io)\n }\n end",
"title": ""
},
{
"docid": "c317d855292a3c173a83305e246e8bac",
"score": "0.5511458",
"text": "def write(chunk)\n # dummy\n end",
"title": ""
},
{
"docid": "76e3b65306e07609a96870dc0ccb1a55",
"score": "0.5494441",
"text": "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",
"title": ""
},
{
"docid": "4c39872b85575fe2a4e0270e9ecad760",
"score": "0.5488782",
"text": "def get_tempfile(content)\n tmp = ASUtils.tempfile(\"doc-#{Time.now.to_i}\")\n tmp.write(content)\n tmp.flush\n $icky_hack_to_avoid_gc ||= []\n $icky_hack_to_avoid_gc << tmp\n tmp\n end",
"title": ""
},
{
"docid": "5b52bf9fbe4b2b4241463c5d71cb47e1",
"score": "0.54848355",
"text": "def file(options = {})\r\n options[:file_name] ||= 'pass.mswallet'\r\n temp_file = Tempfile.new(options[:file_name])\r\n temp_file.write self.stream.string\r\n temp_file.close\r\n temp_file\r\n end",
"title": ""
},
{
"docid": "54c6b67261cbf33a3326803eb9d1ef28",
"score": "0.5479217",
"text": "def create_tempfile(output = render_template)\n tempfile = Tempfile.new([SecureRandom.uuid, \".#{@template_details[:template_extension]}\"], encoding: 'utf-8')\n tempfile.write(output)\n ObjectSpace.undefine_finalizer(tempfile) # force garbage collector not to remove automatically the file\n tempfile.close\n tempfile_details(tempfile).slice(:filename, :path).values\n end",
"title": ""
},
{
"docid": "abb8d8acd5e5f85009fa5e6455e99e3c",
"score": "0.54685485",
"text": "def create_large_file\n require 'tempfile'\n File.join(Dir.tmpdir, \"test_large_file\").tap do |path|\n `truncate --size #{FOUR_GB} \"#{path}\"`\n `echo \"#{EXTRA_DATA}\" >> \"#{path}\"`\n end\nend",
"title": ""
},
{
"docid": "d28cc6855cb614ec0aaf48c36d2f208f",
"score": "0.5468239",
"text": "def write_it( output_file, final_content )\n File.open(output_file, \"w\") {|f| f.write( final_content ) }\n end",
"title": ""
},
{
"docid": "f73a2536985964ec97ad1e7c7a378065",
"score": "0.54666007",
"text": "def make_file filepath, content, options={}\n\n temp_filepath =\n \"#{TMP_DIR}/#{File.basename(filepath)}_#{Time.now.to_i}#{rand(10000)}\"\n\n File.open(temp_filepath, \"w+\"){|f| f.write(content)}\n\n self.upload temp_filepath, filepath, options\n\n File.delete(temp_filepath)\n end",
"title": ""
},
{
"docid": "778bffcd431236b7053d78b86b2701e1",
"score": "0.5462003",
"text": "def write_temp_file(name_template, contents)\n to = File.join(\n BUILDDIR,\n name_template.gsub('RAND') {rand(10000)}\n )\n File.open(to, 'w') {|fp| fp.print contents}\n\n to\n end",
"title": ""
},
{
"docid": "c7f5f5e466b04ce25ffc12b1df8e3495",
"score": "0.54554534",
"text": "def write_to_remote_file(string, remote_path)\n #filename = \"/tmp/\" + Random.srand().to_s() + \".sh\"\n filename = \"/tmp/\" + Kernel::srand().to_s() + \".sh\"\n File.open(filename, 'w') {|f| f.write(string)}\n copy_to_remote(filename, remote_path)\n File.delete(filename)\n end",
"title": ""
},
{
"docid": "d4711799cc62a22f87ea99cd01a177f5",
"score": "0.5446098",
"text": "def write(file, content)\n temp_file = Tempfile.new(\"#{File.basename(file)}\", Pathname.new(File.dirname(file)).realpath, :encoding => @encoding)\n begin\n temp_file.puts content\n temp_file.flush\n FileUtils.cp(temp_file.path, file)\n ensure\n temp_file.close!\n end\n end",
"title": ""
},
{
"docid": "7316874db7cbfe522b7e7e606e3f11dc",
"score": "0.54422146",
"text": "def tempfile\n ::Tempfile.new(filename, tempfile_path).tap do |tmp|\n tmp.binmode\n tmp.write(blob)\n tmp.close\n end\n end",
"title": ""
},
{
"docid": "e384bf39c506ba0249411f510d9fc6c4",
"score": "0.5432305",
"text": "def put_file_from_string(f, s)\n File.open(f , 'w') do |file|\n file.puts(s)\n end\nend",
"title": ""
},
{
"docid": "54bd753086f972b0bc23c56d7234ba11",
"score": "0.542785",
"text": "def render_to_tmp(source)\n basename = File.basename(source)\n output_path = \"tmp/#{basename}\"\n FileUtils.mkdir_p(\"tmp\")\n File.open(output_path, 'w') { |file| file.write(render_tmpl(source, **$vars)) }\n output_path\nend",
"title": ""
},
{
"docid": "60a7b82aab3836f1700b5a824dbafbb6",
"score": "0.54228723",
"text": "def write_raw!(pathname, output)\n FileUtils.mkdir_p(pathname.parent) unless pathname.parent.exist?\n File.open(pathname, 'w'){ |f| f << output }\n end",
"title": ""
},
{
"docid": "f79beef4a13a6a88730ea052f573ad8d",
"score": "0.54197615",
"text": "def write(zipped_string)\n @destination.yield(zipped_string)\n end",
"title": ""
},
{
"docid": "ab71e65c65c6a861d2300bc82c2e37c5",
"score": "0.54164886",
"text": "def saveDistantFile buffer, args, response\n unless buffer.serverSide\n response.status = Constant::ServerFile\n return Constant::Fail\n end\n begin\n f = File.new buffer.fileLocation \"w\"\n rescue\n response.status = PathError\n return Constant::Fail\n end\n f.write buffer.to_file\n f.close\n Constant::Success\n end",
"title": ""
},
{
"docid": "9f67d5eb4ff1d06f501550014c34dfdb",
"score": "0.5412101",
"text": "def download_blob_to_tempfile(&block); end",
"title": ""
},
{
"docid": "9f67d5eb4ff1d06f501550014c34dfdb",
"score": "0.5412101",
"text": "def download_blob_to_tempfile(&block); end",
"title": ""
},
{
"docid": "25475d8da34b1a3f01e29ebb802a6bc7",
"score": "0.5405443",
"text": "def write(s)\n @file.write(s)\n end",
"title": ""
},
{
"docid": "d9fd4faa87fdea0a7ab493013a89fb76",
"score": "0.5389997",
"text": "def stream\n 10_000_000.times do |i|\n response.stream.write \"This is line#{i}\\n\"\n end\n ensure\n response.stream.close\n end",
"title": ""
},
{
"docid": "69733f40c04b51eda7daf5087a90a022",
"score": "0.5378051",
"text": "def temp_file(prefix_suffix = nil, *args, &block)\n prefix_suffix = fix_prefix_suffix(prefix_suffix || 'f')\n Tempfile.open(self, prefix_suffix, *args, &block)\n end",
"title": ""
},
{
"docid": "202fc6b9e2964e64f1289cb3bf1f4174",
"score": "0.53769",
"text": "def write_file(content, destination, opts = {})\n require 'tmpdir'\n inventory_hash = inventory_hash_from_inventory_file\n target_node_name = ENV.fetch('TARGET_HOST', nil)\n target_option = opts['targets'] || opts[:targets]\n target_node_name = search_for_target(target_option, inventory_hash) unless target_option.nil?\n\n Tempfile.create('litmus') do |tmp_file|\n tmp_file.write(content)\n tmp_file.flush\n if target_node_name.nil? || target_node_name == 'localhost'\n require 'fileutils'\n # no need to transfer\n FileUtils.cp(tmp_file.path, destination)\n else\n # transfer to TARGET_HOST\n bolt_result = upload_file(tmp_file.path, destination, target_node_name, options: {}, config: nil, inventory: inventory_hash)\n raise bolt_result.first['value'].to_s unless bolt_result.first['status'] == 'success'\n end\n end\n\n true\n end",
"title": ""
},
{
"docid": "962c3e31dc2b48c437166dbd41dd2021",
"score": "0.5374907",
"text": "def log_and_stream(output)\n write_file output, @filename if @filename\n @block.call(output)\n end",
"title": ""
},
{
"docid": "6bb9ddba19ad4fa6d00a0dd9c53da0c6",
"score": "0.5366939",
"text": "def write_temporary_file(prefix, extension='', tmpdir=Dir::tmpdir)\n\tmax_tries=10\n\n\tfailure=0\n\tbegin\n\t\t# Make a filename which does not yet exist\n\t\tn=0\n\t\tbegin\n\t\t\tt=Time.now.strftime(\"%Y%m%d\")\n\t\t\tfilename=\"#{prefix}-#{t}-#{$$}-#{rand(0x100000000).to_s(36)}-#{n}#{extension}\"\n\t\t\ttmpname=File.join(tmpdir, filename)\n\n\t\t\tlock=tmpname+'.lock'\n\t\t\tn+=1\n\t\tend while File.exist?(lock) or File.exist?(tmpname)\n\n\t\tDir.mkdir(lock)\n\trescue => ex\n\t\tfailure+=1\n\t\tretry if failure < max_tries\n\t\traise \"Cannot generate tempfile: #{ex}\"\n\tend\n\n\n\tbegin\n\t\ttmpfile=File.open(tmpname, File::RDWR|File::CREAT|File::EXCL, 0600)\n\t\tDir.rmdir(lock)\n\n\t\tyield(tmpfile)\n\tensure\n\t\ttmpfile.close\n\tend\n\n\ttmpname\nend",
"title": ""
},
{
"docid": "29d2d016e770f9205a3416783135f3c2",
"score": "0.5358668",
"text": "def write_to(file_name, &block)\n file = File.new(file_name, \"w\")\n file.write \"---\\n\"\n yield(file) if block_given?\n file.write \"---\"\n file.close\nend",
"title": ""
},
{
"docid": "a8d0475b794f977c8a804e36c6b7b89c",
"score": "0.5358447",
"text": "def upload_chunk_intelligently(job, state, apikey, filepath, io, options, storage)\n file = filepath ? File.open(filepath) : io\n file.seek(job[:seek_point] + job[:offset])\n\n chunk = file.read(state.offset)\n md5 = Digest::MD5.new\n md5 << chunk\n data = {\n apikey: apikey,\n part: job[:part],\n size: chunk.length,\n md5: md5.base64digest,\n uri: job[:uri],\n region: job[:region],\n upload_id: job[:upload_id],\n store: { location: storage },\n offset: job[:offset],\n fii: true\n }\n\n data = data.merge!(options) if options\n\n fs_response = Typhoeus.post(FilestackConfig.multipart_upload_url(job[:location_url]),\n body: data.to_json,\n headers: FilestackConfig::HEADERS)\n\n # POST to multipart/upload\n begin\n unless fs_response.code == 200\n if [400, 403, 404].include? fs_response.code\n raise 'FAILURE'\n else\n raise 'BACKEND_SERVER'\n end\n end\n\n rescue\n raise 'BACKEND_NETWORK'\n end\n fs_response = JSON.parse(fs_response.body)\n\n # PUT to S3\n begin\n amazon_response = Typhoeus.put(\n fs_response['url'], headers: fs_response['headers'], body: chunk\n )\n unless amazon_response.code == 200\n if [400, 403, 404].include? amazon_response.code\n raise 'FAILURE'\n else\n raise 'S3_SERVER'\n end\n end\n\n rescue\n raise 'S3_NETWORK'\n end\n amazon_response\n end",
"title": ""
},
{
"docid": "09dd0e2d3e82b088eca232ab0b2e97b0",
"score": "0.53538847",
"text": "def write_out_raw\r\n new_filepath = temp_filename(file_name, DIL::Application.config.processing_file_path)\r\n File.open(new_filepath, 'wb') do |f|\r\n f.write raw.content\r\n end\r\n Sidekiq::Logging.logger.debug(\"New filepath:\" + new_filepath)\r\n FileUtils.chmod(0644, new_filepath)\r\n new_filepath\r\n end",
"title": ""
},
{
"docid": "eb5af5c544a51010983e6bf2650a5d62",
"score": "0.535367",
"text": "def write(io)\n# tempfile = \"#{file_path}.#{Process.pid}.#{object_id}\"\n# open(tempfile, \"wb\") do |file|\n# while part = io.read(8192)\n# file << part\n# end\n# end\n# File.rename(tempfile, file_path)\n# ensure\n# File.unlink(tempfile) rescue nil\n\n # 同名のファイルができないように\n bson = @collection.find_one({:filename => file_path}) rescue nil\n\n @filesystem.open(file_path, \"w\", :content_type => _content_type(file_path)) { |f| f.write(io) }\n\n # 同名のファイルができないように\n @collection.remove(bson) if bson\n\n end",
"title": ""
},
{
"docid": "edcfe487ace54345b951f0645eaa6190",
"score": "0.5338415",
"text": "def write(dest); end",
"title": ""
},
{
"docid": "edcfe487ace54345b951f0645eaa6190",
"score": "0.5338415",
"text": "def write(dest); end",
"title": ""
},
{
"docid": "edcfe487ace54345b951f0645eaa6190",
"score": "0.5338415",
"text": "def write(dest); end",
"title": ""
},
{
"docid": "bf4527e5d8ca962c2f919e62515de52f",
"score": "0.5326772",
"text": "def write(chunk)\n chunk.read\n end",
"title": ""
},
{
"docid": "92e5e2a2b4546cd7574e8c9a6c17c108",
"score": "0.53082937",
"text": "def write_file( fname )\n File.open(fname, \"w\") do |f|\n f << TDP.application.result\n end\n TDP.application.result = String.new\n# puts \"...written to #{fname}\"\n end",
"title": ""
},
{
"docid": "8af08f577e9ac453a8598382450c8234",
"score": "0.53054255",
"text": "def store_log_file_permanently!\n f = Tempfile.new(\"processing_log\")\n f.write(log_contents)\n f.close\n store_permanently!(f.path)\n end",
"title": ""
},
{
"docid": "d6bd4f0fadc45353b5ca1e6aa0b26b45",
"score": "0.5298931",
"text": "def write_to_file(f)\n return f.write(self.buffer)\n end",
"title": ""
},
{
"docid": "47d4f0ecedab24df796eb0568643accc",
"score": "0.5261302",
"text": "def tmpfile\n \n unless @tmpfile\n \n return download\n \n end\n \n return @tmpfile\n \n end",
"title": ""
},
{
"docid": "80b4b3e20bae112f675185c3d2397a61",
"score": "0.5243231",
"text": "def new_chunk(index)\n chunk_num = (index / CHUNK_LINE_SIZE).to_i\n write_file = File.new(\"data/chunk#{chunk_num}\", \"w\")\n\n return write_file\nend",
"title": ""
},
{
"docid": "c8a32dcf7b910744132897867e312114",
"score": "0.5239879",
"text": "def open\n @tmpfile.close if @tmpfile\n @tmpfile = File.open(@tmpname, @mode, @opts)\n __setobj__(@tmpfile)\n end",
"title": ""
},
{
"docid": "553db9d7a3e8212579326c22792f1f8e",
"score": "0.523178",
"text": "def file_put_contents( filename, buffer, mode = 'w+' )\n return if downloaded?( filename, buffer )\n\n File.open( filename, mode ) do |f|\n f.write( buffer )\n f.close\n end\n end",
"title": ""
},
{
"docid": "e3ab3861fa48b8380d07264598da126f",
"score": "0.5221481",
"text": "def temp_file_containing(text, file_prefix = '')\n raise \"This method must be called with a code block.\" unless block_given?\n\n filespec = nil\n begin\n Tempfile.open(file_prefix) do |file|\n file << text\n filespec = file.path\n end\n yield(filespec)\n ensure\n File.delete(filespec) if filespec && File.exist?(filespec)\n end\n end",
"title": ""
},
{
"docid": "995a4789db90d8424a7b847fd64de28a",
"score": "0.5219343",
"text": "def atomic_create_and_write_file(filename, perms = 0666)\n require 'tempfile'\n tmpfile = Tempfile.new(File.basename(filename), File.dirname(filename))\n tmpfile.binmode if tmpfile.respond_to?(:binmode)\n result = yield tmpfile\n tmpfile.close\n ATOMIC_WRITE_MUTEX.synchronize do\n begin\n File.chmod(perms & ~File.umask, tmpfile.path)\n rescue Errno::EPERM\n # If we don't have permissions to chmod the file, don't let that crash\n # the compilation. See issue 1215.\n end\n File.rename tmpfile.path, filename\n end\n result\n ensure\n # close and remove the tempfile if it still exists,\n # presumably due to an error during write\n tmpfile.close if tmpfile\n tmpfile.unlink if tmpfile\n end",
"title": ""
},
{
"docid": "9f1e6f3c4fe15c89de2f19a9834ab9a8",
"score": "0.52145517",
"text": "def write_temporary_files\n cached_uploads.each_key do |file_attr|\n if errors[:file].empty? and send(file_attr).present?\n write_temporary_file file_attr\n end\n end\n end",
"title": ""
},
{
"docid": "229f9a516c052fe2e49c997453822fa5",
"score": "0.5212924",
"text": "def to_file(style = default_style)\n if @queued_for_write[style]\n @queued_for_write[style]\n elsif exists?(style)\n tempfile = Tempfile.new instance_read(:file_name)\n tempfile.binmode\n tempfile.write file_contents(style)\n tempfile.flush\n tempfile.rewind\n tempfile\n else\n nil\n end\n\n end",
"title": ""
},
{
"docid": "e07ac341f98eafbb3f38c41c7af6bbd8",
"score": "0.52119464",
"text": "def write_file!\n file = File.new( path, \"w\")\n \n file.write(@source)\n file.close\n end",
"title": ""
},
{
"docid": "f7c980100a2ceadd156665093420c9bf",
"score": "0.52112585",
"text": "def stream\n now = ::Time.now.to_i\n @stream_mutex.synchronize do\n if @expires && now >= @expires\n @stream.close if @stream\n @stream = nil\n end\n unless @stream\n @expires = now + @interval\n @file = \"#{@dir}/#{Record.make_uuid}-#{$$}-#{@expires}.log\"\n @stream = File.open(@file, \"w+\")\n $stderr.puts \"tam: #{$0} #{$$} opened #{@file.inspect}\" if @verbose >= 1\n end\n end\n @stream\n end",
"title": ""
},
{
"docid": "15f0831d8bb50224c71659200daeb5d6",
"score": "0.5205545",
"text": "def process(&blk)\n result = tempfile(&blk)\n\n # Should we add destroy to an ensure block? Im not sure if it makes sense\n # to delete failed files.\n file.destroy\n\n result\n end",
"title": ""
},
{
"docid": "0a5ebe2c98d34443ef977bea9c7e52dc",
"score": "0.5196002",
"text": "def tempfile=(_arg0); end",
"title": ""
},
{
"docid": "1accc4867c90100c5801673f284a8260",
"score": "0.5184583",
"text": "def s_to_file file_path_str, new_content_str='' \n File.open(file_path_str, \"w+\") { |f| f.write(new_content_str) }\n end",
"title": ""
},
{
"docid": "ea339c49ae6114e8101d2b522480bef9",
"score": "0.51762754",
"text": "def file_out(string)\nopen('myfile.json', 'a') { |f|\n f.puts string\n }\nend",
"title": ""
},
{
"docid": "7b356af1b69865892476a707523a387b",
"score": "0.5171643",
"text": "def write(str)\n return if noop?\n FileUtils.mkdir_p(File.dirname(file)) #unless File.file?(file)\n File.open(file, 'w'){ |f| f << str }\n end",
"title": ""
},
{
"docid": "5ba9c78c34edcef59d5aa446f9896387",
"score": "0.51668775",
"text": "def file_output output_lines, friend\n # using 'write_to' method with given parameters\n write_to \"#{friend}.txt\" do |file|\n file.write output_lines[0]\n file.write output_lines[1]\n end\nend",
"title": ""
},
{
"docid": "2ff932265f2fc164a776324240c60475",
"score": "0.5162422",
"text": "def write_content_to_file(file_name, content)\n File.open(file_name, 'w') { |file| file.write(content); file.flush }\nend",
"title": ""
}
] |
0d16cb2a60b240fbb0b27662d2632475
|
next few methods are for updating/editing course
|
[
{
"docid": "2c530619b635b6bf0e8219ebb0221ffe",
"score": "0.0",
"text": "def get_course_params\n course_params = params.require(:course)\n if !empty_new_end_qual\n course_params = course_params.except(:end_qualification_id)\n end\n if !empty_new_del_mode\n course_params = course_params.except(:delivery_mode_id)\n end\n return course_params.permit!\n end",
"title": ""
}
] |
[
{
"docid": "0809285342996484ea444582cf492179",
"score": "0.7805154",
"text": "def edit\n set_student\n @courses = Course.all\n end",
"title": ""
},
{
"docid": "8e8b77df1d60a84610315939c5387a56",
"score": "0.76788527",
"text": "def edit #this action allow admin to edit single course value\n end",
"title": ""
},
{
"docid": "98b11deabb36e321669d89a5c5886d98",
"score": "0.7629602",
"text": "def update\n \n #don't need to add user_id here.. already exists.\n \n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "14e6389454e15b8018372083fe96b729",
"score": "0.7628735",
"text": "def edit\n #Validate\n id = params[:id]\n @course = Course.find(id)\n requires({'role' => ['admin','faculty'],'course_id' => id})\n if(@course.nil?)\n flash[:error] = 'Something has gone horribly wrong. A system administrator has been contacted.'\n else\n student_ids = StudentInCourse.where(:course_id => id).collect(&:user_id)\n ta_ids = TaForCourse.where(:course_id => id).collect(&:user_id)\n \n @students = User.find_all_by_id(student_ids)\n @tas = User.find_all_by_id(ta_ids)\n end\n end",
"title": ""
},
{
"docid": "64deade8586b09530d81102e7c155d30",
"score": "0.7623742",
"text": "def edit\n\t\t# must have admin access or be in the course\n\tend",
"title": ""
},
{
"docid": "4c56724476e3a4e3cfcf52d478740641",
"score": "0.762186",
"text": "def edit\n\t\t@course = Course.find(params[:id])\n\t\t@majors = @course.major\n\t\t@distributions = @course.distribution\n\t\t@minors = @course.minor\n\t\t@concentrations = @course.concentration\n\tend",
"title": ""
},
{
"docid": "d7a434b133a23ab60f1085847d244dce",
"score": "0.7529985",
"text": "def update\n if @course.update(course_params)\n redirect_to courses_path, notice: \"Course was successfully updated.\"\n else\n render action: 'edit'\n end\n \n end",
"title": ""
},
{
"docid": "2fdad8a0cc6e10b3ebdc5057b6d9fd7d",
"score": "0.7457346",
"text": "def edit\n\tfaculty_course = FacultyCourse.find(params[:id])\n\tcourses = params[:courses]\n\tif ((courses[:course1_id] == courses[:course2_id]) && courses[:course1_id] != \"\") || ((courses[:course1_id] == courses[:course3_id]) && courses[:course1_id] != \"\") || ((courses[:course2_id] == courses[:course3_id]) && courses[:course2_id] != \"\")\n\t\tflash[:error] = \"Please choose a different course in each box\"\n\t\tredirect_to faculty_course_path(faculty_course)\n\telse\n \t\tfaculty_course = FacultyCourse.find(params[:id])\n\t\tfaculty_course.update_attributes!(params[:courses].permit(:course1_id,:course2_id,:course3_id))\n\t\tflash[:success] = \"Courses information updated successfully\"\n\t\tredirect_to faculty_courses_path\n\tend\n end",
"title": ""
},
{
"docid": "8feb0aeccd5e540b9c215e122f5f03b2",
"score": "0.7445963",
"text": "def update\n @course = Course.find(params[:id])\n \n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, :notice => t('selecao_admin.flash_messages.successfully_updated', :model => @course.class.model_name.human) }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @course.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cf6b04bf171ffbd57805912c9bdf0a65",
"score": "0.74367666",
"text": "def edit\n @course = Course.find(params[:id])\n end",
"title": ""
},
{
"docid": "cf6b04bf171ffbd57805912c9bdf0a65",
"score": "0.74367666",
"text": "def edit\n @course = Course.find(params[:id])\n end",
"title": ""
},
{
"docid": "bff7fc63d6978945a231d234bc5cc9ac",
"score": "0.74346626",
"text": "def update\n\t\t@course = @teacher.courses.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to [:teacher, @course], :notice => 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @course.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eb1e70442b9ab657c97431d6b50b74e3",
"score": "0.74154264",
"text": "def update\n\t\t@course = Course.find(params[:id])\n\n\t if @course.update_attributes(course_params)\n\n\t @course.major.clear\n\t @course.minor.clear\n\t @course.concentration.clear\n\t @course.distribution.clear\n\n\t params[:course][\"major_id\"].each do |major_id|\n\t if !major_id.empty?\n\t @course.major << Major.find(major_id)\n\t end\n\t end\n\n\t params[:course][\"minor_id\"].each do |minor_id|\n\t if !minor_id.empty?\n\t @course.minor << Minor.find(minor_id)\n\t end\n\t end\n\n\t params[:course][\"concentration_id\"].each do |concentration_id|\n\t if !concentration_id.empty?\n\t @course.concentration << Concentration.find(concentration_id)\n\t end\n\t end\n\n\t params[:course][\"distribution_id\"].each do |distribution_id|\n\t if !distribution_id.empty?\n\t @course.distribution << Distribution.find(distribution_id)\n\t end\n\t end\n\n\t flash[:success] = \"Successfully updated\"\n\t redirect_to :action => 'show', :id => @course\n\n\t end\n\tend",
"title": ""
},
{
"docid": "181c259e6dd979e1cae0990e965a4d71",
"score": "0.741338",
"text": "def edit\n @course = Course.find_by_id params[:id]\n end",
"title": ""
},
{
"docid": "d03da3e4c4b565360fc8312477c95b07",
"score": "0.7411294",
"text": "def edit\n @course = Course.find(params[:id])\n end",
"title": ""
},
{
"docid": "0a33b60e4da9ed523201bba28820ffbf",
"score": "0.7399746",
"text": "def update\n @course = Course.find(params[:id])\n if @course.update(course_params)\n flash[:success] = \"Course Updated\"\n redirect_to @course\n else\n render 'edit'\n end\n end",
"title": ""
},
{
"docid": "45da5bb84017c31829a27291e09fc4d9",
"score": "0.7356317",
"text": "def update\n @course = Course.find(params[:id])\n @course.user_id=current_user.id\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to(@course, :notice => 'Course was successfully updated.') }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @course.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f6bf367c0ab792430f0c994026ee2e06",
"score": "0.7351276",
"text": "def update\n @course = Course.find(params[:id])\n expire_fragment(\"preview_courses_#{params[:id]}\")\n\n respond_to do |format|\n checks = form_lang_combo_valid? && !critical_changes?(@course)\n if checks && @course.update_attributes(params[:course])\n flash[:notice] = 'Course was successfully updated.'\n format.html { redirect_to(@course) }\n format.xml { head :ok }\n else\n if not @course.form.abstract_form_valid?\n flash[:error] = \"The selected form is not valid. Please fix it first.\"\n elsif !form_lang_combo_valid?\n flash[:error] = \"The selected form/language combination isn’t valid. #{flash[:error]}\"\n elsif critical_changes?(@course)\n flash[:error] = \"Some of the changes are critical. Those are currently not allowed.\"\n else\n flash[:error] = \"Could not update the course.\"\n end\n\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @course.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "676cb93361e83555e91bfaa3d3947c5f",
"score": "0.7346413",
"text": "def edit\n @course = Course.find_by_id(params[:id])\n end",
"title": ""
},
{
"docid": "7018ae073946dda240f51c024feffc1b",
"score": "0.7326563",
"text": "def update\n @course = Course.find(params[:id])\n \n if (!params[:course])\n params[:course] = {:name=>params[:title], \n :f_day=>params[:description], \n :l_day=>params[:price]\n } \n end\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e45c7b4cbcc3f12fae7de5ef3ea06891",
"score": "0.7304887",
"text": "def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, notice: 'course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b3f0c53f173d2c290d00379feb648fc1",
"score": "0.72994107",
"text": "def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, :notice => 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @course.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1760d9165201a60dcbed56c716dc3e1d",
"score": "0.7286037",
"text": "def update\n @course = Course.find(params[:id])\n\n if @course.update_attributes(course_params)\n flash[:notice] = \"Course updated!\"\n redirect_to course_url(@course)\n else\n render :action => :edit\n end\n end",
"title": ""
},
{
"docid": "bdf8283e577f15b75a462b9e76f390cd",
"score": "0.7275973",
"text": "def update\n @course = Admin::Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to [:admin, @course], :notice => 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @course.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b77384f6900d366225a8a845f3bea5c0",
"score": "0.7258909",
"text": "def update\n @lecture = Lecture.find(params[:id])\n @course= Course.find(params[:course_id])\n \n respond_to do |format|\n if @lecture.update_attributes(params[:lecture])\n format.html { redirect_to [@course, @lecture], notice: 'Lecture was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @lecture.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9e01f70c79672337b6716c230882c983",
"score": "0.72582597",
"text": "def update\n @course = Course.find(params[:id])\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to user_course_path(current_user,@course), notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "435c8aab9247251df190e534e16d4ad6",
"score": "0.725712",
"text": "def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "435c8aab9247251df190e534e16d4ad6",
"score": "0.725712",
"text": "def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "435c8aab9247251df190e534e16d4ad6",
"score": "0.725712",
"text": "def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "435c8aab9247251df190e534e16d4ad6",
"score": "0.725712",
"text": "def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "435c8aab9247251df190e534e16d4ad6",
"score": "0.725712",
"text": "def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "435c8aab9247251df190e534e16d4ad6",
"score": "0.725712",
"text": "def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "435c8aab9247251df190e534e16d4ad6",
"score": "0.725712",
"text": "def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "435c8aab9247251df190e534e16d4ad6",
"score": "0.725712",
"text": "def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "490bf762bbe0a1c906ee131442b61c1f",
"score": "0.7255743",
"text": "def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, :notice=> 'Curso actualizado' }\n format.json { head :ok }\n else\n format.html { render :action=> \"edit\" }\n format.json { render :json=> @course.errors, :status=> :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0f4bc9db09f5b672e6a05e4c8412017e",
"score": "0.725267",
"text": "def updateCourse(course, updater)\n course.title = updater.courseTitle\n course.course_name = updater.courseName\n course.description = updater.description\n \n updater.courseSections.each do |newSection|\n section = course.sections.find_by section_name: newSection.sectionNumber\n if section.blank? then\n section = Section.new\n end\n updateSection(section, newSection)\n course.sections << section\n end\n \n course.save\nend",
"title": ""
},
{
"docid": "405d4a4dd4a0dacbd870244910756b7a",
"score": "0.72487104",
"text": "def update\n if @course.update(course_params)\n redirect_to @course, notice: 'Course was successfully updated.'\n else\n render action: :edit\n end\n end",
"title": ""
},
{
"docid": "f4ee234e733003945ea81d485f1df4a8",
"score": "0.72482914",
"text": "def update\n @course = Course.find(params[:id])\n respond_to do |format|\n if @course.update(courses_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "10854e3566cb83fa81462d47ca0d1fa8",
"score": "0.7240008",
"text": "def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n flash[:notice] = 'Course was successfully updated.'\n format.html { redirect_to courses_path }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @course.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5c0e13f6567b11968b4b45cea8cd6fcc",
"score": "0.7239649",
"text": "def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n flash[:notice] = 'Course was successfully updated.'\n format.html { redirect_to :action => 'index' }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @course.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "530c488c979e9e212ca5ee8679fee58d",
"score": "0.7236018",
"text": "def update\n begin\n @course = Course.find(params[:id])\n raise if @course.nil?\n \n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to club_course_path }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n rescue\n render :layout => 'error', :template => 'errors/error'\n end\n end",
"title": ""
},
{
"docid": "2334d24a280f1b0571a5f7545b0ccd41",
"score": "0.7233961",
"text": "def update\n @coursemod = Coursemod.find(params[:id])\n #if @coursemod.update_attributes(params[:coursemod])\n if @coursemod.update_coursemod(params[:coursemod])\n flash[:success]= \"Module updated\"\n redirect_to @course\n else\n @title=\"Edit module\"\n flash.now[:error]=\"something went wrong\"\n render 'edit'\n end\n end",
"title": ""
},
{
"docid": "49e57ec3593acf108099eb877cf907b0",
"score": "0.7205343",
"text": "def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n flash[:notice] = 'Course was successfully updated.'\n format.html { redirect_to( :back) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @course.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bc967932db75911a1a36d0286e9df870",
"score": "0.7201002",
"text": "def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to(@course, :notice => 'Course was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @course.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fc7c6d7d89e6f6dd6cb45929e83a4b09",
"score": "0.71936876",
"text": "def update\n @course.update_attributes(parama[:course])\n respond_with(@course)\n end",
"title": ""
},
{
"docid": "341b7ecf3829d8d4dbdf6b734c93cd38",
"score": "0.7192999",
"text": "def update\n @course = Course.find(params[:id])\n authorize! :update, @course\n\n if (params[:course][:is_configured]) #The previous page was configure action\n if params[:course][:curriculum_url].include?(\"info.sv.cmu.edu\")\n @course.twiki_url = params[:course][:curriculum_url].sub(\"https\", \"http\")\n end\n @course.configured_by_user_id = current_user.id\n end\n\n params[:course][:faculty_assignments_override] = params[:teachers]\n respond_to do |format|\n @course.updated_by_user_id = current_user.id if current_user\n @course.attributes = params[:course]\n if @course.save\n flash[:notice] = 'Course was successfully updated.'\n format.html { redirect_back_or_default(course_path(@course)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"configure\" }\n format.xml { render :xml => @course.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b5a91089347a6a0b0dba3a79017e117d",
"score": "0.71836615",
"text": "def update\n if @course.update(course_params)\n flash[:success] = \"Curso atualizado com sucesso\"\n redirect_to course_path(@course)\n else\n flash[:error] = \"Não foi possível atualizar o curso\"\n redirect_to courses_path\n end\n end",
"title": ""
},
{
"docid": "7732e1c8281e9bb908ca4e47bb390c3d",
"score": "0.716323",
"text": "def update\n c_user = current_user()\n return ( render status: 401, json: { result: \"Not Authorized\" } ) unless logged_in? # Ensure the user is logged in\n course = Course.where(id: params[:course_id]).first()\n\n # Course Not Found case\n if course.nil?\n return ( render status: 404, json: { result: \"Not Found\" } )\n end\n\n # Privledged User case\n if c_user.role == Role.admin or c_user.role == Role.moderator\n status = course.update(course_params)\n if status\n render status: 200, json: { result: course }\n else\n render status: 400, json: { result: course.errors }\n end\n\n # Draft Course case\n elsif course.user_id == c_user.id\n # Ensure the data doesn't change visiblity (Standard user cannot publish)\n if course_params[:visibility].to_i != Visibility.published\n status = course.update(course_params)\n if status\n render status: 200, json: { result: course }\n else\n render status: 400, json: { result: course.errors }\n end\n\n else\n render status: 400, json: { result: \"Not Authorized\" }\n end\n\n # Course is not (owned by user and editable) AND (user is not privledged)\n else\n render status: 401, json: { result: \"Not Authorized\" }\n end\n end",
"title": ""
},
{
"docid": "dc75dbaba8352d08cf0a9a2dc5e8939e",
"score": "0.7158034",
"text": "def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n flash[:notice] = 'Course was successfully updated.'\n format.html { redirect_to(@course) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @course.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dc75dbaba8352d08cf0a9a2dc5e8939e",
"score": "0.7158034",
"text": "def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n flash[:notice] = 'Course was successfully updated.'\n format.html { redirect_to(@course) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @course.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "877252279dc2acf54e171b8d0393bced",
"score": "0.7155146",
"text": "def edit\n c_user = current_user()\n return ( render status: 401, json: { result: \"Not Authorized\" } ) unless logged_in? # Ensure the user is logged in\n course = Course.where(id: params[:course_id]).first()\n\n # Course Not Found case\n if course.nil?\n return ( render status: 404, json: { result: \"Not Found\" } )\n end\n\n # Attaches a schema \n schema = {\n title: :text,\n description: :textarea,\n tier: Tier.schema,\n visibility: Visibility.schema\n }\n\n unless c_user.role == Role.admin or c_user.role == Role.moderator\n schema[:visibility].delete(:published)\n schema[:visibility].delete(:reviewing)\n end\n\n # Draft Course case\n if course.visibility == Visibility.draft and course.user_id == c_user.id\n render status: 200, json: { result: course, schema: schema }\n\n # Privledged User case\n elsif c_user.role == Role.admin or c_user.role == Role.moderator\n render status: 200, json: { result: course, schema: schema }\n\n # Course is not (owned by user and editable) AND (user is not privledged)\n else\n render status: 401, json: { result: \"Not Authorized\" }\n end\n end",
"title": ""
},
{
"docid": "2b333b53729416785cce1b4ae1746d09",
"score": "0.71505445",
"text": "def update_courses(course_list)\n end",
"title": ""
},
{
"docid": "15ef96ba0616dbd836ce4f19f69079bc",
"score": "0.7143713",
"text": "def edit\n # create will route here with that value\n # then we open up the view edit.html.erb with \n # their fields and when they submit\n # it will redirect to update and we can save it there\n\n\n \n @object = Applicant.find(params[:id])\n\n @courses= Course.all\n # Need them to be in three different categories. What we need to to is actully\n # link them like make the actual belongs to relationship.\n # For now, this works.\n #@coursesPref= Course.where({ name: @object.preferences})\n @coursesPref = []\n @object.preferences.each do |course|\n @coursesPref.push(Course.find_by({name: course}))\n end\n @coursesIndif= []\n @object.indifferent.each do |course|\n @coursesIndif.push(Course.find_by({name: course}))\n end\n @coursesAntiPref = []\n @object.antipref.each do |course|\n @coursesAntiPref.push(Course.find_by({name: course}))\n end\n \n end",
"title": ""
},
{
"docid": "8bacab16ce4188e47a5c53ab399eb201",
"score": "0.71405244",
"text": "def update\n authorize! :update, @course\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "df0301c105cf2ac420ab50ebd77022d5",
"score": "0.7125216",
"text": "def update\n if @course.update_attributes(update_course_params)\n flash[:success] = \"Module \\\"#{@course.title}\\\" updated\"\n redirect_to stafftools_course_path(@course)\n else\n render :edit\n end\n end",
"title": ""
},
{
"docid": "42d78a214fecde48182bf3f18733c68d",
"score": "0.71249527",
"text": "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course ' + @course.course_id + ' was successfully updated!' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "63614310fdd601f8a846ca6c9d6a7c24",
"score": "0.7107836",
"text": "def update\n @course = Course.find(params[:id])\n invalid_redirect_action = updating_course_info?(params[:course]) ? \"edit\" : \"show\"\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: invalid_redirect_action }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e5e61e83d0408dbb0a94611c67c1dfd0",
"score": "0.7100189",
"text": "def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to courses_path(:option=>2), notice: 'El curso fue exitosamente editado!' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b81f69999519e4bc45e6414fab44682f",
"score": "0.7088337",
"text": "def set_course\n #@course = Course.find(params[:course_id])\n @course = Course.find(params[:id])\n end",
"title": ""
},
{
"docid": "ac9e7658a629d94c623c55a0d46b92cb",
"score": "0.7078008",
"text": "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to admin_course_url(@course), notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e9a0445b2c24adfce22fb19806ecf5d6",
"score": "0.7075593",
"text": "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Curso editado satisfactoriamente' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0cf9dcf6220795b2e3e4fa1d4cfbd0dc",
"score": "0.7069369",
"text": "def update\n if current_user.id!=@course.owner.id\n respond_to do |format|\n format.html { redirect_to :action => 'index' ,:controller=>\"courses\", notice: 'You are Not Authorized' }\n end\n return false\n end\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Create course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b2838c3d8ac82e096ee8abf91bc7b061",
"score": "0.70681685",
"text": "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to admin_courses_path, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0aee33826335cc5678dc0c0420f4e1f2",
"score": "0.70630175",
"text": "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0aee33826335cc5678dc0c0420f4e1f2",
"score": "0.70630175",
"text": "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0aee33826335cc5678dc0c0420f4e1f2",
"score": "0.70630175",
"text": "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0aee33826335cc5678dc0c0420f4e1f2",
"score": "0.70630175",
"text": "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "de1705b1ff9c97fb89abb8b54a445b1b",
"score": "0.70391196",
"text": "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Curso atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dde04f8cf5423d41fbe284e59ab7cbeb",
"score": "0.70315313",
"text": "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dde04f8cf5423d41fbe284e59ab7cbeb",
"score": "0.7031176",
"text": "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dde04f8cf5423d41fbe284e59ab7cbeb",
"score": "0.7031176",
"text": "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dde04f8cf5423d41fbe284e59ab7cbeb",
"score": "0.7031176",
"text": "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dde04f8cf5423d41fbe284e59ab7cbeb",
"score": "0.7031176",
"text": "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dde04f8cf5423d41fbe284e59ab7cbeb",
"score": "0.7031176",
"text": "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dde04f8cf5423d41fbe284e59ab7cbeb",
"score": "0.7031176",
"text": "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dde04f8cf5423d41fbe284e59ab7cbeb",
"score": "0.7031176",
"text": "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dde04f8cf5423d41fbe284e59ab7cbeb",
"score": "0.7031176",
"text": "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dde04f8cf5423d41fbe284e59ab7cbeb",
"score": "0.7031176",
"text": "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dde04f8cf5423d41fbe284e59ab7cbeb",
"score": "0.7031176",
"text": "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dde04f8cf5423d41fbe284e59ab7cbeb",
"score": "0.7031176",
"text": "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dde04f8cf5423d41fbe284e59ab7cbeb",
"score": "0.7031176",
"text": "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dde04f8cf5423d41fbe284e59ab7cbeb",
"score": "0.7031176",
"text": "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dde04f8cf5423d41fbe284e59ab7cbeb",
"score": "0.7031176",
"text": "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dde04f8cf5423d41fbe284e59ab7cbeb",
"score": "0.7031176",
"text": "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dde04f8cf5423d41fbe284e59ab7cbeb",
"score": "0.7031176",
"text": "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dde04f8cf5423d41fbe284e59ab7cbeb",
"score": "0.7031176",
"text": "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dde04f8cf5423d41fbe284e59ab7cbeb",
"score": "0.7031176",
"text": "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dde04f8cf5423d41fbe284e59ab7cbeb",
"score": "0.7031176",
"text": "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dde04f8cf5423d41fbe284e59ab7cbeb",
"score": "0.7031176",
"text": "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dde04f8cf5423d41fbe284e59ab7cbeb",
"score": "0.7031176",
"text": "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dde04f8cf5423d41fbe284e59ab7cbeb",
"score": "0.7031176",
"text": "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "04ea3086be73294a21e762d054dde5b2",
"score": "0.6995243",
"text": "def submit_edit\n id = params[:course_id]\n requires({'role' => ['admin','faculty'],'course_id'=>id})\n course_number = params[:number]\n course_term = params[:term]\n course_name = params[:name]\n course_section = params[:section]\n\n studentsToRemove = params[:students_to_remove]\n tasToRemove = params[:tas_to_remove]\n\n course = Course.find(id)\n \n\n\n course.course_number = course_number\n course.term = course_term\n course.name = course_name\n course.section = course_section\n course.save\n \n StudentInCourse.delete_all(:course_id => id, :user_id => studentsToRemove)\n TaForCourse.delete_all(:course_id => id, :user_id => tasToRemove)\n\n flash[:notice] = \"Changes saved.\"\n \n end",
"title": ""
},
{
"docid": "d120b08990d681f13d4754feb2daf649",
"score": "0.6975156",
"text": "def set_course\n if params[:id]\n @course = Course.find(params[:id])\n else\n @course = Course.find(params[:course_id])\n end \n end",
"title": ""
},
{
"docid": "b4b030568b02e5ba2a8d9955805c74d3",
"score": "0.6968175",
"text": "def update\n @course.update(course_params)\n render_jsonapi_response(@course)\n end",
"title": ""
},
{
"docid": "8fda3e7e0e064669f617f984a0a81ee6",
"score": "0.6965537",
"text": "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to professors_courses_url, notice: 'Course was successfully updated.' }\n else\n format.html { render :edit }\n end\n end\n end",
"title": ""
},
{
"docid": "8e758b6c9268768b8f9853cf6da72660",
"score": "0.69611484",
"text": "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n # format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n # format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "139bba0694f5d5e722bb3abbb8fe9bfc",
"score": "0.69591063",
"text": "def update\n respond_to do |format|\n if @admin_course.update(admin_course_params)\n format.html { redirect_to (params[:ref] || @admin_course), notice: t('crud.updated_successfully!', name: Admin::Course.model_name.human) }\n format.json { render :show, status: :ok, location: @admin_course }\n else\n format.html { render :edit }\n format.json { render json: @admin_course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7ce841f3afb6e520015e332bcb23c547",
"score": "0.69589126",
"text": "def update\n @ptcourse = Ptcourse.find(params[:id])\n\n respond_to do |format|\n if @ptcourse.update_attributes(params[:ptcourse])\n flash[:notice] = t('ptcourse.title')+\" \"+t('updated')\n format.html { redirect_to(@ptcourse) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ptcourse.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e29e06c2aa5ad5f7348172548e9cc91e",
"score": "0.6946959",
"text": "def update\n @course = current_user.courses.find(params[:course_id])\n @course_lesson = @course.course_lessons.find(params[:id])\n respond_to do |format|\n if @course_lesson.update_attributes(params[:course_lesson])\n format.html { redirect_to @course, notice: 'Course lesson was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course_lesson.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "466ca1e8199de9fc29c17a9eec3d8b4d",
"score": "0.69463086",
"text": "def update\n @exercise = Exercise.find_by_id(params[:id])\n @textbook = @exercise.textbook\n @course_asset = CourseAsset.find_by_id(params[:exercise][:course_asset_id])\n \n if params[:commit] == \"Cancel\"\n @ujsNotice = \"Update exercise action canceled.\"\n @ujsAlert = nil\n render \"cancel\"\n \n elsif params[:commit] == \"Update\"\n old_section_title = @exercise.section_title\n @exercise.assign_attributes(params[:exercise].except(:course_asset_id, :course_id, :subject_id))\n @section_title = @exercise.section_title\n if @section_title && @section_title.new_record?\n @new_section_title = true;\n render \"new\"\n elsif @exercise.save\n if old_section_title.exercises.count == 0\n old_section_title.delete\n end\n @ujsAlert = nil\n @ujsNotice = \"Successfully updated exercise.\"\n @exercises = @textbook.exercises.sort{|a,b| a.page.to_i <=> b.page.to_i}\n render \"update\"\n else \n @ujsNotice = nil\n @ujsAlert = \"Error! \" + @exercise.errors.full_messages.first\n render \"edit\"\n end\n \n elsif params[:commit] == \"Yes\"\n @filterstring = nil\n @exercise.assign_attributes(params[:exercise].except(:course_asset_id))\n if @exercise.save\n @ujsAlert = nil\n @ujsNotice = \"Successfully updated exercise.\"\n render \"update\"\n else \n @ujsNotice = nil\n @ujsAlert = \"Error! \" + @exercise.errors.full_messages.first\n render \"edit\"\n end\n \n else # params[:commit] == \"No\"\n @ujsNotice = \"Please re-enter the section title.\"\n render('edit')\n end\n\n \n end",
"title": ""
},
{
"docid": "2529b46ed0c19f22bfcb5631e804d64d",
"score": "0.6935827",
"text": "def update!(**args)\n @course_id = args[:course_id] if args.key?(:course_id)\n end",
"title": ""
}
] |
8fc0b4db51b953b730a5985c0bf4e540
|
Gets the the value of a config entry ==== Parameters key:: The key of the config entry value we want
|
[
{
"docid": "6255af174ccebd65447e79495b745ff3",
"score": "0.0",
"text": "def [](key)\n (@configuration ||= setup)[key]\n end",
"title": ""
}
] |
[
{
"docid": "d92637d156a20ed79afb9c448220b279",
"score": "0.8130019",
"text": "def get(key)\n val = connection.protocol::ConfigGet.new(params(config_key: key)).process(connection)\n val[:config_value]\n end",
"title": ""
},
{
"docid": "3dfc8eeacda94d68e438a8714d124449",
"score": "0.79730916",
"text": "def config_value(key)\n config_values[key.to_s]\n end",
"title": ""
},
{
"docid": "cb0a1d85fc6791bdcfcf13c2299f5c71",
"score": "0.78724277",
"text": "def [](key)\n key = @options[:key_class].find_by(config_key: Util.clean_up_key(key)).config_key\n load_entries_if_needed\n return @entries[key].value if @entries[key]\n nil\n end",
"title": ""
},
{
"docid": "8b57cd0c17e6fa6b865b67c22a3a1e41",
"score": "0.78440326",
"text": "def config key\n @config.get key\n end",
"title": ""
},
{
"docid": "2c9d67169ae2ab6c2cf12557d7a1667c",
"score": "0.78267735",
"text": "def config_value(key)\n @config = self.read if @config.nil?\n ret = nil\n unless @config.nil?\n arr = @config.map { |k,v| [k.to_s.to_sym, v] }\n h = Hash[arr]\n ret = h[key]\n end\n ret\n end",
"title": ""
},
{
"docid": "e0e57c22e35065544c347c8b22cf3e56",
"score": "0.77993447",
"text": "def config_value(key)\n @config = read if @config.nil?\n ret = nil\n unless @config.nil?\n arr = @config.map { |k, v| [k.to_s.to_sym, v] }\n hash = Hash[arr]\n ret = hash[key.to_s.to_sym]\n end\n ret\n end",
"title": ""
},
{
"docid": "821e2b1164a9fa25e2076471936814f2",
"score": "0.7739589",
"text": "def get_config(key)\r\n CONFIG[key]\r\n end",
"title": ""
},
{
"docid": "563b4834e33290e1039b9815049bce88",
"score": "0.7736026",
"text": "def [](key)\n ret = nil\n begin\n ret = @config_values[key]\n rescue\n end\n\n return ret\n end",
"title": ""
},
{
"docid": "7924f8a002be6143574f310d125412ad",
"score": "0.770628",
"text": "def config_get(key)\n value = core.config.get(key)\n output \"#{key}=#{value}\"\n end",
"title": ""
},
{
"docid": "0680d1fc13af689840f962f2893c0eec",
"score": "0.767319",
"text": "def get(key)\n @config[key.to_sym] \n end",
"title": ""
},
{
"docid": "56be88e475d4b45cecf9c0ac5813497a",
"score": "0.7655563",
"text": "def get_value(section, key)\n section = @config_data[section]\n section ? section[key] : nil\n end",
"title": ""
},
{
"docid": "dbea699b68c6fe49a75d0e7cd3331eb6",
"score": "0.7637063",
"text": "def [](key)\n if include?(key.to_s)\n @config[key.to_s]\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "95add2498402e8af5b346d0a63de303c",
"score": "0.756401",
"text": "def config(key)\n @config[key]\n end",
"title": ""
},
{
"docid": "51fb3e6febe0aae2b43cf8a52e2d7ac4",
"score": "0.75291944",
"text": "def [](key)\n @config_mutex.synchronize() do\n return @config[key]\n end\n end",
"title": ""
},
{
"docid": "05af41ed9212a1d95da7f9f8a8aab9a3",
"score": "0.7524012",
"text": "def [](key)\n\t return @config[key]\n\tend",
"title": ""
},
{
"docid": "6441f8329b584cee6af2e2bb3cd76d12",
"score": "0.7407372",
"text": "def get_config(key)\n Rails.logger.debug(\"Get config for key=#{key}\")\n result = provider_config.select { |f| f.key.upcase == key.upcase }\n if (result.size > 0)\n config = result[0].value\n config = config.strip if config\n else\n nil\n end\n Rails.logger.debug(\"Config value=#{config}\")\n config\n end",
"title": ""
},
{
"docid": "d855b0664e91025919df2f7c1d6af05c",
"score": "0.737109",
"text": "def config_fetch(key)\n config.read\n config.fetch(key)\n end",
"title": ""
},
{
"docid": "955d498e237af98fa11d5da74897974c",
"score": "0.7340629",
"text": "def [](key)\n config[key]\n end",
"title": ""
},
{
"docid": "bb09fe1b2bfb1efada4124f00aba7769",
"score": "0.7282857",
"text": "def [](key)\n @config[key]\n end",
"title": ""
},
{
"docid": "bb09fe1b2bfb1efada4124f00aba7769",
"score": "0.7282857",
"text": "def [](key)\n @config[key]\n end",
"title": ""
},
{
"docid": "bb09fe1b2bfb1efada4124f00aba7769",
"score": "0.7282857",
"text": "def [](key)\n @config[key]\n end",
"title": ""
},
{
"docid": "bb09fe1b2bfb1efada4124f00aba7769",
"score": "0.7282857",
"text": "def [](key)\n @config[key]\n end",
"title": ""
},
{
"docid": "bb09fe1b2bfb1efada4124f00aba7769",
"score": "0.7282857",
"text": "def [](key)\n @config[key]\n end",
"title": ""
},
{
"docid": "bb09fe1b2bfb1efada4124f00aba7769",
"score": "0.7282857",
"text": "def [](key)\n @config[key]\n end",
"title": ""
},
{
"docid": "bb09fe1b2bfb1efada4124f00aba7769",
"score": "0.7282857",
"text": "def [](key)\n @config[key]\n end",
"title": ""
},
{
"docid": "bb09fe1b2bfb1efada4124f00aba7769",
"score": "0.7282857",
"text": "def [](key)\n @config[key]\n end",
"title": ""
},
{
"docid": "297f6b87a0b3b25766cb0b47b4269da5",
"score": "0.7274123",
"text": "def config_value(key)\n value = data[key.to_s].to_s\n value.strip!\n value\n end",
"title": ""
},
{
"docid": "f0ba9c223d86d0d1986aabec5a136408",
"score": "0.7264825",
"text": "def get key\n @api.read([:config,key,nil],0)[2] rescue nil\n end",
"title": ""
},
{
"docid": "059e572b2916c288daadc6d64a056fbb",
"score": "0.72325546",
"text": "def [](key)\n @configs[key]\n end",
"title": ""
},
{
"docid": "08c4172bfb07b1b8eaa99faa7f674946",
"score": "0.72271645",
"text": "def setting(key)\n @config[key]\n end",
"title": ""
},
{
"docid": "08c4172bfb07b1b8eaa99faa7f674946",
"score": "0.72271645",
"text": "def setting(key)\n @config[key]\n end",
"title": ""
},
{
"docid": "649227dd1e4ba876ce4f7de0b2bf0993",
"score": "0.71986127",
"text": "def [](key)\n config_content[key]\n end",
"title": ""
},
{
"docid": "284c2011b253fc558368a43e72b17963",
"score": "0.7186914",
"text": "def [](key)\n @configs[key.to_s]\n end",
"title": ""
},
{
"docid": "2183e51933d80dd43bbe3d7e50592936",
"score": "0.7183477",
"text": "def get(key)\n value = Configuration.find(:first, :conditions => { :name => self.namespaced(key) }).try(:value)\n\n value = @configs[key][:default] if value.nil? && @configs[key][:default]\n\n value\n end",
"title": ""
},
{
"docid": "d0ee96aacc5902ed602c903b0fd3187c",
"score": "0.71437335",
"text": "def config_for(key)\n global_config.get(key)\n end",
"title": ""
},
{
"docid": "1daaac7f775955b18fada629eca38dcd",
"score": "0.71126235",
"text": "def get_for_url(url, key)\n subconfig_for_url(url)[key.to_s]\n end",
"title": ""
},
{
"docid": "5dedc19a03da6f32b51058900da87c2a",
"score": "0.7102621",
"text": "def [](key)\n config[key]\n end",
"title": ""
},
{
"docid": "b2a00bf7ffbb5008e95fbddc8f9cdb9e",
"score": "0.7097885",
"text": "def get(key)\n val = @options[key]\n\n if val\n val.getValue\n else\n \"\"\n end\n end",
"title": ""
},
{
"docid": "50e3b8f3fcbf8e7d50ba4e48f835011d",
"score": "0.70883274",
"text": "def [](key)\n tcfg_get key\n end",
"title": ""
},
{
"docid": "50e3b8f3fcbf8e7d50ba4e48f835011d",
"score": "0.70883274",
"text": "def [](key)\n tcfg_get key\n end",
"title": ""
},
{
"docid": "2541782620e38615accfee2d934ce970",
"score": "0.7053929",
"text": "def value(key)\n @entries[key]\n end",
"title": ""
},
{
"docid": "2541782620e38615accfee2d934ce970",
"score": "0.7053929",
"text": "def value(key)\n @entries[key]\n end",
"title": ""
},
{
"docid": "2484b3fc2c4030561d67505d9d4b2823",
"score": "0.7049659",
"text": "def get key\n @settings[key]\n end",
"title": ""
},
{
"docid": "2484b3fc2c4030561d67505d9d4b2823",
"score": "0.7049659",
"text": "def get key\n @settings[key]\n end",
"title": ""
},
{
"docid": "2484b3fc2c4030561d67505d9d4b2823",
"score": "0.7049659",
"text": "def get key\n @settings[key]\n end",
"title": ""
},
{
"docid": "b1afcda53cdd09dc87b466b41c5458f3",
"score": "0.7049336",
"text": "def [](key)\n Settler.load! if config.nil? \n Setting.find_by_key(key.to_s).try(:value)\n end",
"title": ""
},
{
"docid": "355115c7fea9dbcf4067378c7f18c820",
"score": "0.7013613",
"text": "def locate_config_value(key)\n key = key.to_sym\n Chef::Config[:knife][key] || config[key]\n end",
"title": ""
},
{
"docid": "f0dcdcc104232c206ad185e282021a7e",
"score": "0.7003704",
"text": "def get(key)\n @config ||= OpenStruct.new\n @config[key]\n end",
"title": ""
},
{
"docid": "e19c3480415b8fbc797c1bfe557e90fe",
"score": "0.695256",
"text": "def [](key)\n configurations[key]\n end",
"title": ""
},
{
"docid": "61265f98464822c410d3c985189385af",
"score": "0.6950842",
"text": "def value(key, default = nil)\n if @config.has_key?(key)\n @config[key]\n else\n default\n end\n end",
"title": ""
},
{
"docid": "635f7d6c9a2acc36a7003794ce1529ef",
"score": "0.6940678",
"text": "def get\n unless key = shift_argument\n error(\"Usage: mortar config:get KEY\\nMust specify KEY.\")\n end\n validate_arguments!\n project_name = options[:project] || project.name\n\n vars = api.get_config_vars(project_name).body['config']\n key_name, value = vars.detect {|k,v| k == key}\n unless key_name\n error(\"Config var #{key} is not defined for project #{project_name}.\")\n end\n \n display(value.to_s)\n end",
"title": ""
},
{
"docid": "837c61c098505f001ba2fe85c7679855",
"score": "0.69398874",
"text": "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 (subhash != nil and subhash.has_key?(lastkey)) ? subhash[lastkey] : nil\n end",
"title": ""
},
{
"docid": "03818ad6198bbe17291f465e324b1574",
"score": "0.6926903",
"text": "def [](key)\n @conf[key]\n end",
"title": ""
},
{
"docid": "8aaaa8513aa1abe58b8f7ede54ec3881",
"score": "0.6920856",
"text": "def config(key)\n @config[key.to_sym] || @config[key.to_s]\n end",
"title": ""
},
{
"docid": "d6ee9a5d32325da0a2c9a9379b62dc6b",
"score": "0.68953854",
"text": "def [](key)\n @config_params[key]\n end",
"title": ""
},
{
"docid": "504852e3f5c4fb766148310c26812056",
"score": "0.68915063",
"text": "def get_value_from_key(key)\n fail 'key must be specified in the method get_value_from_key' if key.nil?\n\n value = @platform_info_hash[key]\n fail \"no value exists for the key #{key}\" if value.nil?\n\n value\n end",
"title": ""
},
{
"docid": "be0db09e3dfbfd4621d872f9bd0d6cda",
"score": "0.68824625",
"text": "def get(key)\n setting = @settings\n key.split(\".\").each do |k|\n setting = setting[k]\n end\n setting\n end",
"title": ""
},
{
"docid": "d5bb99beb096a041abfafe3c4cb40741",
"score": "0.68731135",
"text": "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 (subhash != nil and subhash.has_key?(lastkey)) ? subhash[lastkey] : nil \n end",
"title": ""
},
{
"docid": "ae5c464cf3ae95d2109940abcdbf6fc9",
"score": "0.68547624",
"text": "def [](key)\n key = key.to_s\n\n if @config.key?(key)\n @config[key]\n else\n raise ConfigParamNotFound, key\n end\n end",
"title": ""
},
{
"docid": "aec930631c3f3ae1c829ff06678fa845",
"score": "0.68476415",
"text": "def _get_setting(key_name)\n ini = Rex::Parser::Ini.new(@config_file)\n group = ini[@group_name]\n return nil if group.nil?\n return nil if group[key_name].nil?\n\n group[key_name]\n end",
"title": ""
},
{
"docid": "f5bf31ba8481798599887adac9e13023",
"score": "0.68430126",
"text": "def [](key)\n option = fetch_option(key)\n option.value if option\n end",
"title": ""
},
{
"docid": "f12fd4bacafb669fa4d7e18cc4126254",
"score": "0.68377507",
"text": "def [](key); @config[key] end",
"title": ""
},
{
"docid": "b3e16ff4f5c7f9d81c5ea1b72a96fe35",
"score": "0.682898",
"text": "def get!(key)\n Log.die(\"couldn't find '#{key}' in config\") if !@@yml.key?(key)\n return @@yml[key]\n end",
"title": ""
},
{
"docid": "7711117b6d44023d05cda64088e56bb8",
"score": "0.6795081",
"text": "def getInstanceValue(index, key)\n config = CONFIG\n retval = nil\n if config.has_key?('instances')\n item = config['instances'][index]\n if item.has_key?(key)\n retval = item[key]\n end\n end\n# puts \"Returning #{index} #{key} of #{retval}\"\n return retval\nend",
"title": ""
},
{
"docid": "4fa06a52e26d7caddfa8a341c5eb98da",
"score": "0.679124",
"text": "def [](key)\n rv = @db.repo_config[path(key)]\n rv ? rv : ''\n end",
"title": ""
},
{
"docid": "9d64bbda4c0bb1503cd70f7c9c32daec",
"score": "0.6783478",
"text": "def key\n @config[\"key\"]\n end",
"title": ""
},
{
"docid": "03b26bc5c71a971f9045c42f6da1563f",
"score": "0.67824715",
"text": "def get(key = nil)\n return @conf[key] if (key and @conf.has_key?(key))\n return @conf if key.nil?\n end",
"title": ""
},
{
"docid": "a90979c4dce400c2e4346b47bc44d2a4",
"score": "0.6771943",
"text": "def field_value(key)\n self.attributes[self.config[key.to_s]]\n end",
"title": ""
},
{
"docid": "5dbf1ba99a1fb1bed2a17e1470e3a7e8",
"score": "0.6746514",
"text": "def [](key)\n if entry.has_key? key\n entry[key]\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "9c499c8bf63197c43273f2c500bed6ef",
"score": "0.67436045",
"text": "def get_config(key)\n @configs[key] or raise \"Could not find config: #{key} - cached configs: #{@configs.keys}\"\n end",
"title": ""
},
{
"docid": "4a15726a3e07a73f66dec147c1398e40",
"score": "0.6729551",
"text": "def required_config_value(key)\n if (value = config_value(key)).empty?\n raise_config_error(\"#{key.inspect} is empty\")\n end\n\n value\n end",
"title": ""
},
{
"docid": "aedb5f51d7b51859f5d762d1c19651c7",
"score": "0.67209816",
"text": "def [] key\n @config[key]\n end",
"title": ""
},
{
"docid": "a26b81598a3df558648e8808dad7d1f9",
"score": "0.6684252",
"text": "def [](entry)\n @configuration[entry]\n end",
"title": ""
},
{
"docid": "c5bf76ab8a8d5b03050e5121ef121cb2",
"score": "0.66699773",
"text": "def getDefaultsValue(key)\n config = CONFIG\n retval = nil\n if config.has_key?('defaults')\n retval = config['defaults'][key]\n else\n puts \"ERROR - missing 'defaults' section in configuration\"\n end\n return retval\nend",
"title": ""
},
{
"docid": "6d8a3c7f20ec142e1c16f542aefecaaf",
"score": "0.66623604",
"text": "def [] key\n _asetus_get key, false # asetus.cfg['foo']['bar']\n end",
"title": ""
},
{
"docid": "67b73aaed9a8659f36725fafbd8d8fe6",
"score": "0.6647115",
"text": "def option(key)\n return @config.fetch(key, \"\")\n end",
"title": ""
},
{
"docid": "58863a6e25c04653699a7278bff8e82a",
"score": "0.6639597",
"text": "def get(key)\n \n end",
"title": ""
},
{
"docid": "cfaef039c0cd61e09b0df93eb8cf621e",
"score": "0.6637395",
"text": "def get(key)\n item = get_item(key)\n if item.nil?\n nil\n else\n item.value\n end\n end",
"title": ""
},
{
"docid": "c419e4d9e391f1899835b77c2e1f2d4b",
"score": "0.66128814",
"text": "def get_conf(key);@conf[key.to_sym];end",
"title": ""
},
{
"docid": "fe5755e7877cf41146613d1fbb8c76b3",
"score": "0.6610167",
"text": "def [](key)\n @setting_values[key]\n end",
"title": ""
},
{
"docid": "c664c6b5682a7168ef4beb28dabba9f4",
"score": "0.66055685",
"text": "def get(key)\n return ENV[key.gsub(\".\", \"_\").upcase] if ENV[key.gsub(\".\", \"_\").upcase]\n\n configuration = YAML.load(File.read(@config_path))\n configuration.dig(*key.split(\".\"))\n end",
"title": ""
},
{
"docid": "c6bbcd66d2754f4469b1431a14edb6e8",
"score": "0.6603524",
"text": "def get_config_value(key, opts)\n p = opts[:profile] || @profile_name\n\n value = @parsed_credentials.fetch(p, {})[key] if @parsed_credentials\n value ||= @parsed_config.fetch(p, {})[key] if @config_enabled && @parsed_config\n value\n end",
"title": ""
},
{
"docid": "07df96e939c2826c5127ec1f01e3c132",
"score": "0.65934414",
"text": "def [] key\n key = key.to_sym\n unless @fields.key? key\n raise ArgumentError, \"Key #{key.inspect} does not exist\"\n end\n field = @fields[key]\n if field.is_a? Config\n field\n else\n field.value\n end\n end",
"title": ""
},
{
"docid": "4190c56bff122d0e7b01cd48935ffc31",
"score": "0.6584658",
"text": "def get_config(key)\n `cd #{path} && git config --get #{key}`\n end",
"title": ""
},
{
"docid": "383378e84dd16e766d973bfaceb715d0",
"score": "0.6579551",
"text": "def setting(key)\n keys = [key]\n case key\n when String\n keys << key.to_sym\n when Symbol\n keys << key.to_s\n end\n\n # Scan all possible keys to see if the config has a matching value\n keys.inject(nil) do |rv, k|\n v = @hash[k]\n break v unless v.nil?\n end\n end",
"title": ""
},
{
"docid": "abe29a86f163831f9f2aca58b132efcf",
"score": "0.65793574",
"text": "def read(key)\n app_config.send(key.to_s)\n end",
"title": ""
},
{
"docid": "8b038f474c395586fd856d925d731bd9",
"score": "0.65781796",
"text": "def getKey(key)\n return key.split('.').inject(@config, :[])\n end",
"title": ""
},
{
"docid": "5a340585eb17abd0e2a15f97f1844ac1",
"score": "0.6576235",
"text": "def get_value(key, options = {})\n # Convert the key to a String, unless it was already one.\n key = key.to_s unless key.kind_of?(String)\n # Now process the key.\n @root.get_value(key, options)\n end",
"title": ""
},
{
"docid": "7b6780807fb964ffa70de9593317b953",
"score": "0.6554029",
"text": "def value(key)\n return self[key][0]\n end",
"title": ""
},
{
"docid": "a4981b1622af7b22fc736859543bb06b",
"score": "0.65530777",
"text": "def getConfigValue(index, key)\n retval = nil\n defaultsReturn = getDefaultsValue(key)\n if ! defaultsReturn.nil?\n retval = defaultsReturn\n end\n instancesvalue = getInstanceValue(index, key)\n if ! instancesvalue.nil?\n retval = instancesvalue\n end\n\n# puts \"Return for instances[#{index}][#{key}] is #{retval}\"\n return retval\nend",
"title": ""
},
{
"docid": "70669075e7dcfcac2bbc5cbce30bf17f",
"score": "0.65362644",
"text": "def fetch_config key\n (node['ruby'][key.to_s] || @defaults[key]) rescue @defaults[key]\nend",
"title": ""
},
{
"docid": "83db67406fd9372a9354bf4360e246db",
"score": "0.6535521",
"text": "def value(key)\n data(key).get(:value)\n end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.6535212",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.6535212",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.6535212",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.6535212",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.6535212",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.6535212",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.6535212",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.6535212",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.6535212",
"text": "def get(key); end",
"title": ""
}
] |
7e5d15c2079cff2d2b88d05ab25e00e1
|
Sort an array of objects input the object array property property within each object to filter by nils ('first' | 'last') nils appear before or after nonnil values Returns the filtered array of objects
|
[
{
"docid": "d9d54d9593630c25e2990496544d6393",
"score": "0.610763",
"text": "def sort(input, property = nil, nils = \"first\")\n if input.nil?\n raise ArgumentError, \"Cannot sort a null object.\"\n end\n if property.nil?\n input.sort\n else\n if nils == \"first\"\n order = - 1\n elsif nils == \"last\"\n order = + 1\n else\n raise ArgumentError, \"Invalid nils order: \" \\\n \"'#{nils}' is not a valid nils order. It must be 'first' or 'last'.\"\n end\n\n sort_input(input, property, order)\n end\n end",
"title": ""
}
] |
[
{
"docid": "364c803486049d05c49aee534ce3cf1d",
"score": "0.611928",
"text": "def sort(input, property = nil, nils = \"first\")\n raise ArgumentError, \"Cannot sort a null object.\" if input.nil?\n\n if property.nil?\n input.sort\n else\n case nils\n when \"first\"\n order = - 1\n when \"last\"\n order = + 1\n else\n raise ArgumentError, \"Invalid nils order: \" \\\n \"'#{nils}' is not a valid nils order. It must be 'first' or 'last'.\"\n end\n\n sort_input(input, property, order)\n end\n end",
"title": ""
},
{
"docid": "3a774ca8dceb0019c71edd1ce369ef1f",
"score": "0.60486656",
"text": "def sort(input, property = nil, nils = \"first\")\n if input.nil?\n raise ArgumentError, \"Cannot sort a null object.\"\n end\n if property.nil?\n input.sort\n else\n if nils == \"first\"\n order = - 1\n elsif nils == \"last\"\n order = + 1\n else\n raise ArgumentError, \"Invalid nils order: \" \\\n \"'#{nils}' is not a valid nils order. It must be 'first' or 'last'.\"\n end\n\n sort_input(input, property, order)\n end\n end",
"title": ""
},
{
"docid": "5b16933b6fd289a7887d278068bdd804",
"score": "0.6014864",
"text": "def sort_objects_with_sort_order(objects)\n sorted = []\n if objects.present?\n sorted =objects.select{|x| x.sort_order.present?}.sort_by{|x| x.sort_order} + objects.select{|x| x.sort_order.nil?}\n end\n return sorted\n end",
"title": ""
},
{
"docid": "e17b9dd844f9ff8b4b5aae47ed74fda0",
"score": "0.599716",
"text": "def ordered_list(arr)\n arr.uniq!\n if arr.include?(nil)\n arr.delete(nil)\n arr.sort\n else\n arr.sort\n end\n end",
"title": ""
},
{
"docid": "3a74f95d133c1c0737bdc62a5507263e",
"score": "0.5825165",
"text": "def remove_nils_and_false_from_array(arr)\n arr.select(&:itself)\nend",
"title": ""
},
{
"docid": "7b6049861dc01126bae88c5c4ea69f82",
"score": "0.5660257",
"text": "def sort_nulls_by(direction)\n Arel.sql(\"NULLS #{direction == 'asc' ? 'FIRST' : 'LAST'}\")\n end",
"title": ""
},
{
"docid": "37f5b938fa4cfba8ed54ed7c1be96055",
"score": "0.5613448",
"text": "def custom_compact(array)\n # return the array with nil values removed\n final = []\n array.each { |item| final << item unless item == nil}\n final\nend",
"title": ""
},
{
"docid": "5efa5a5491361b624517fa245acca2ed",
"score": "0.5553034",
"text": "def remove_nils_from_array(array)\n\tarray.reject! { |item| item == nil }\nend",
"title": ""
},
{
"docid": "95cda1001d5f279c3f1cabc1ecc3ea91",
"score": "0.55348927",
"text": "def remove_nils_and_false_from_array(array)\n array.select { |e| e }\nend",
"title": ""
},
{
"docid": "c0f97268b54495e2a1b22b2c5b35aa0b",
"score": "0.54964525",
"text": "def remove_nils_from_array(array)\n\tarray.select{|el| !el.nil?}\nend",
"title": ""
},
{
"docid": "10be0a9477cb0f06779f7eee9d3e103f",
"score": "0.54579115",
"text": "def remove_nils_and_false_from_array(array)\nend",
"title": ""
},
{
"docid": "10be0a9477cb0f06779f7eee9d3e103f",
"score": "0.54579115",
"text": "def remove_nils_and_false_from_array(array)\nend",
"title": ""
},
{
"docid": "457510214c99a1a190a65b355f150c80",
"score": "0.54532975",
"text": "def remove_nils_from_array(array)\n array.reject { |e| e.nil? }\nend",
"title": ""
},
{
"docid": "eeffac88e8051c02587adb59f54048ec",
"score": "0.54489714",
"text": "def remove_nils_from_array(array)\nend",
"title": ""
},
{
"docid": "eeffac88e8051c02587adb59f54048ec",
"score": "0.54489714",
"text": "def remove_nils_from_array(array)\nend",
"title": ""
},
{
"docid": "a0e626963c379c7b8f13779a063dd3d9",
"score": "0.5436692",
"text": "def items_array_sorted_descending\n array = []\n self.excerpts.each do |object|\n array.push object\n end\n self.quotes.each do |object|\n array.push object\n end\n self.terms.each do |object|\n array.push object\n end\n self.people.each do |object|\n array.push object\n end\n return array.sort! {|b,a| a.updated_at<=>b.updated_at}\n end",
"title": ""
},
{
"docid": "6f898dab5a3cde3c74df8dd3e760192b",
"score": "0.5381725",
"text": "def remove_nils_from_array(arr)\n arr.reject { |item| item.nil?}\nend",
"title": ""
},
{
"docid": "2aaf422e6190ae17f4b243548333db03",
"score": "0.53772736",
"text": "def remove_nils_from_array(array)\n array.compact\nend",
"title": ""
},
{
"docid": "2aaf422e6190ae17f4b243548333db03",
"score": "0.53772736",
"text": "def remove_nils_from_array(array)\n array.compact\nend",
"title": ""
},
{
"docid": "2aaf422e6190ae17f4b243548333db03",
"score": "0.53772736",
"text": "def remove_nils_from_array(array)\n array.compact\nend",
"title": ""
},
{
"docid": "2aaf422e6190ae17f4b243548333db03",
"score": "0.53772736",
"text": "def remove_nils_from_array(array)\n array.compact\nend",
"title": ""
},
{
"docid": "1befc78423a86d748a63eb5fc116b4ac",
"score": "0.53700393",
"text": "def remove_nils_and_false_from_array(array)\n\tarray.select{|el| el if el}\nend",
"title": ""
},
{
"docid": "3c5ef6596151655affb6647c2eeec3c9",
"score": "0.53615737",
"text": "def pop_trailing_nils!(ary)\n while ary.length > 0 && ary.last.nil?\n ary.pop\n end\n ary\n end",
"title": ""
},
{
"docid": "d39fa9c15849880636a5610869372b9f",
"score": "0.5352625",
"text": "def remove_nils_and_false_from_array(array)\n array.select{|a| nil|a}\nend",
"title": ""
},
{
"docid": "8f968290c5e30e9c1717a06855bcc7d3",
"score": "0.5345694",
"text": "def remove_nils_from_array(array)\n array.reject { |element| element.nil? }\nend",
"title": ""
},
{
"docid": "49ec31c2e223ccb004056c0b75aace2a",
"score": "0.53264946",
"text": "def remove_nils_and_false_from_array(array)\n\tarray.reject! { |item| item == nil || item == false }\nend",
"title": ""
},
{
"docid": "83f371bcde6bde0c5f063c2c6fc9cce9",
"score": "0.5315719",
"text": "def remove_nils_and_false_from_array(arr)\n arr.compact.filter_map{|i| i if i != false}\nend",
"title": ""
},
{
"docid": "eb2b1c7413451e2ce1cbb68a6c4ce132",
"score": "0.53076565",
"text": "def remove_nils_from_array(arr)\n return arr.compact\nend",
"title": ""
},
{
"docid": "fc384285bfc1aeed43ed1a79fa52b265",
"score": "0.53071976",
"text": "def remove_nil_from_array(list_to_clean)\n list_to_clean.reject(&:nil?)\n end",
"title": ""
},
{
"docid": "89503c3d01f6b703af13a7f87a0c76c1",
"score": "0.53035915",
"text": "def normalize(arr)\n rs = arr.sort do |r1, r2|\n r1.first == r2.first ? r2.last <=> r1.last : r1.first <=> r2.first\n end\n imax = rs.length - 1\n 0.upto(imax - 1) do |i|\n next unless rs[i] # skip holes left by previous iterations\n (i + 1).upto(imax) do |j|\n next unless rs[j] # skip holes left by previous iterations\n if rs[i].last < rs[j].first # no overlap\n break\n elsif rs[i].last == rs[j].first # merge abutting ranges\n rs[i] = rs[i].first..rs[j].last\n rs[j] = nil\n elsif rs[i].contains?(rs[j]) # sort guarantees rs[j] never contains rs[i]\n rs[j] = nil\n else # overlap but not contained\n rs[i] = rs[i].first..rs[j].last\n rs[j] = nil\n end\n end\n end\n rs.compact\n end",
"title": ""
},
{
"docid": "134e7c1bb0b1dedd7f49ba9758f9a63f",
"score": "0.5294289",
"text": "def remove_nils_from_array(arr)\n arr.compact\nend",
"title": ""
},
{
"docid": "78f54dd8c3088cb5d6a3ccf4893e0458",
"score": "0.5276209",
"text": "def filter(things)\n # 'things' represents the list of objects to sort\n if(sort_direction == 'asc')\n things = things.sort_by {|el| el[sort_column]} # Sort the ascending order\n else\n things = things.sort_by {|el| el[sort_column]} # Sort the descending order\n things = things.reverse\n end\n\n return things\n\n end",
"title": ""
},
{
"docid": "a058d3f472d1a0aeacde662b3409e1ce",
"score": "0.5270058",
"text": "def remove_nils_and_false_from_array(array)\n array.reject { |x| x == nil || x == false}\nend",
"title": ""
},
{
"docid": "8f749a6a439f32de356b629e7b358715",
"score": "0.523672",
"text": "def remove_nils_and_false_from_array(array)\n array.compact.remove_false\nend",
"title": ""
},
{
"docid": "6e6bb0b85337fb9e7dbae40a5bd5fbf3",
"score": "0.5216989",
"text": "def first_not_nil *arr\n arr.find {|x| !x.nil? and !x.blank?}\n end",
"title": ""
},
{
"docid": "1c7e908264590eac458909ea0cbd8321",
"score": "0.5203894",
"text": "def remove_nils_from_array(array)\n barray = []\n for i in (0...array.length)\n barray << (array[i]) if !array[i].nil?\n end\n return barray\nend",
"title": ""
},
{
"docid": "99c81f3f249c74b30b2417a6716bcf94",
"score": "0.51799417",
"text": "def trim(*arrays)\n combine_array = [].concat(*arrays).sort {|a, b| a[0] <=> b[0]}\n return [] if combine_array.empty?\n min_index = combine_array.min {|a, b| a[0] <=> b[0]}&.first\n max_index = combine_array.max {|a, b| a[1] <=> b[1]}&.last\n\n result_array = []\n i = 0\n start_pos = min_index\n end_pos = combine_array[0][1]\n loop do\n if i + 1 > combine_array.length - 1\n result_array << [start_pos, end_pos]\n break\n else\n if combine_array[i + 1][0] <= end_pos\n end_pos = [end_pos, combine_array[i + 1][1]].max\n else\n result_array << [start_pos, end_pos]\n break if i + 1 > combine_array.length - 1\n start_pos = combine_array[i + 1][0]\n end_pos = combine_array[i + 1][1]\n end\n i += 1\n end\n end\n result_array\n end",
"title": ""
},
{
"docid": "d4853977888ab6aeaf1da91c641c7465",
"score": "0.5146707",
"text": "def remove_nils_from_array(array)\n new_array = array.delete_if {|element| element == nil}\n return new_array\nend",
"title": ""
},
{
"docid": "c226675ddef1bd977b663358bbddd5d2",
"score": "0.51110786",
"text": "def remove_nils_and_false_from_array(array)\n array.select{ |item|\n item if item != nil or item != false\n }\nend",
"title": ""
},
{
"docid": "bc876141c693b35061c19b716b713329",
"score": "0.5094969",
"text": "def delete_trailing_nils!(data)\n data.each do |target|\n next if target[\"datapoints\"].size < 3\n next if !target[\"datapoints\"].last[0].nil?\n\n [-2, -1].each do |idx|\n target[\"datapoints\"].delete_at(idx) if target[\"datapoints\"][idx][0].nil?\n end\n end\n end",
"title": ""
},
{
"docid": "b9884aa3c8b6e47227a8e73ba7e49766",
"score": "0.5087746",
"text": "def remove_nils_and_false_from_array(array)\n barray = []\n for i in (0...array.length)\n barray << (array[i]) if array[i]\n end\n return barray\nend",
"title": ""
},
{
"docid": "1329a0734342d283ac528c12692bfce0",
"score": "0.5071118",
"text": "def sort(input, property = nil)\n ary = InputIterator.new(input)\n\n return [] if ary.empty?\n\n if property.nil?\n ary.sort do |a, b|\n nil_safe_compare(a, b)\n end\n elsif ary.all? { |el| el.respond_to?(:[]) }\n begin\n ary.sort { |a, b| nil_safe_compare(a[property], b[property]) }\n rescue TypeError\n raise_property_error(property)\n end\n end\n end",
"title": ""
},
{
"docid": "584b06fbbf92bcfdac1ec3cae0fbf36d",
"score": "0.5067821",
"text": "def behaviour_one(ary)\n ary2 = []\n ary.each do |ary_element|\n ary3 = []\n ary2.each do |i|\n if !ary_element.nil? && ary_element < i\n ary3 << ary_element\n ary_element = nil\n end\n ary3.push(i)\n end\n ary3 << ary_element unless ary_element.nil?\n ary2 = ary3\n end\n ary2\nend",
"title": ""
},
{
"docid": "660458ebeab32138ccf9b4cc90707ec4",
"score": "0.50671524",
"text": "def fixArrayWithNilInPlace! (obj)\n case\n when obj.is_a?(Hash)\n obj.each { |key, value| fixArrayWithNilInPlace! value }\n when obj.is_a?(Array)\n # empty the array if it only contains a nil\n obj.pop if (obj.length == 1 && obj[0].is_a?(NilClass))\n # process any other entries in the array.\n obj.each { |value| fixArrayWithNilInPlace! value }\n end\n obj\n end",
"title": ""
},
{
"docid": "e26d190315fecf92fa3af44f2c575759",
"score": "0.5066429",
"text": "def remove_nils_and_false_from_array(array)\n new_array = array.delete_if {|element| element == nil || element == false}\n return new_array\nend",
"title": ""
},
{
"docid": "aefffd3beb8759b59f693a61e7e44074",
"score": "0.50483894",
"text": "def sort_array(source_array)\n odds = source_array.select { |n| n.odd? }.sort\n source_array.map { |n| n.odd? ? odds.shift : n }\nend",
"title": ""
},
{
"docid": "6f34ab39cb1c70256f53d5e171d70136",
"score": "0.5031556",
"text": "def sort arr\nreturn arr if arr.length <= 1\n middle = arr.pop\n less = arr.select{|x| x < middle}\n more = arr.select{|x| x >= middle}\n sort(less) + [middle] + sort(more)\nend",
"title": ""
},
{
"docid": "1ce4db213504384368ea4ee47e7d354d",
"score": "0.50307775",
"text": "def remove_nils_and_false_from_array(array)\n array.reject { |element| element.nil? || element == false }\nend",
"title": ""
},
{
"docid": "52ee4b7085211d4513730e81f66a96b4",
"score": "0.50098205",
"text": "def peak_finder(arr)\n peak_arr = []\n\n peak_arr << arr.first if arr.first > arr[1]\n peak_arr << arr.last if arr.last > arr[-2]\n \n arr.each_with_index do |num, idx|\n unless num.object_id == arr.first.object_id || num.object_id == arr.last.object_id\n peak_arr << num if num > arr[idx - 1] && num > arr[idx + 1]\n end\n \n end\n\n peak_arr\nend",
"title": ""
},
{
"docid": "0d62a49d6a6e6b0cf1c6d892d630f422",
"score": "0.5002882",
"text": "def filter_out!(arr, &proc)\r\n arr.each.with_index { |el, i| arr[i] = nil if proc.call(el) }\r\n arr.delete(nil)\r\nend",
"title": ""
},
{
"docid": "bb2a8fea81917b3d0b9deac6ab9b3b7d",
"score": "0.4999465",
"text": "def sort (arr)\n return arr if arr.length <= 1\n middle = arr.pop\n less = arr.select {|item| item < middle}\n more = arr.select {|item| item >= middle}\n sort(less) + [middle] + sort(more)\nend",
"title": ""
},
{
"docid": "219b93418a134cac724d976392b79150",
"score": "0.49800402",
"text": "def bubble_sort(array)\n\tfor i in 0...array.length\n\t\tarray.map.with_index do |item, index|\n\t\t\tif array[index+1] != nil && item > array[index+1]\n\t\t\t\ttemp = array[index+1]\n\t\t\t\tarray[index+1] = item\n\t\t\t\tarray[index] = temp\n\t\t\tend\n\t\tend\n\tend\n\tarray\nend",
"title": ""
},
{
"docid": "412ef1eee7967ab059411f3110c4b665",
"score": "0.49652976",
"text": "def non_archived_notes\r\n return notes.select{ |n| n.archived.blank? }.sort!{ |x,y| y.updated_at <=> x.updated_at }\r\n end",
"title": ""
},
{
"docid": "93f3ce2cb31fe043887a11bf76312ffb",
"score": "0.49614897",
"text": "def custom_compact_1(array)\n final=[]\n array.each {|element| final << element unless element.nil?}\n final\nend",
"title": ""
},
{
"docid": "d9de676e4abfe0f4a57f91a55f1a8875",
"score": "0.49574623",
"text": "def bubble_sort_by(array)\n\tfor i in 0...array.length\n\t\tarray.map.with_index do |item, index|\n\t\t\tif array[index+1] != nil && yield(item, array[index+1]) > 0\n\t\t\t\ttemp = array[index+1]\n\t\t\t\tarray[index+1] = item\n\t\t\t\tarray[index] = temp\n\t\t\tend\n\t\tend\n\tend\n\tarray\nend",
"title": ""
},
{
"docid": "512458c07d49359f860a3c60d71b25e6",
"score": "0.49340975",
"text": "def groupify(arr)\n arr = arr.sort\n prev = nil\n arr.slice_before do |el|\n (prev.nil? || el != prev + 1).tap { prev = el }\n end\nend",
"title": ""
},
{
"docid": "df8ebbc1c591323cd85c50328186462e",
"score": "0.49327525",
"text": "def sort_array",
"title": ""
},
{
"docid": "efacadfebc91de7352e4f396a5a392c5",
"score": "0.49238554",
"text": "def remove_falsy_values(arr)\n arr2 = []\n arr.each do |x|\n if x\n arr2.push x\n end\n end\n arr2\nend",
"title": ""
},
{
"docid": "c7ed7f863a2bc9d80041c7e46f428f56",
"score": "0.4906364",
"text": "def sentinel_insertion_sort(array)\n # first put the minimum value in location 0\n min_index = 0;\n (1...array.size).each do | index |\n min_index = index if array[index] < array[min_index]\n end\n array[0], array[min_index] = array[min_index], array[0]\n \n # now insert elements into the sorted portion\n (2...array.size).each do | j |\n element = array[j]\n i = j\n while (element <=> array[i-1]) == -1\n array[i] = array[i-1]\n i -= 1\n end\n array[i] = element\n end\n array\n end",
"title": ""
},
{
"docid": "365d638fa6653c5711dca4f960281d8d",
"score": "0.49047577",
"text": "def prio_sort(elements); end",
"title": ""
},
{
"docid": "cc0f72c62f3e643e5059a089a9a9d504",
"score": "0.48935226",
"text": "def sort(drops)\n drops.sort_by(&:first)\nend",
"title": ""
},
{
"docid": "1b62fddd8269efef9c25657df28fe696",
"score": "0.48898825",
"text": "def zero_sort(array)\n end",
"title": ""
},
{
"docid": "21101fbcf3af000338a252604ca308e5",
"score": "0.48883736",
"text": "def remove_nullteam_topics(old_array)\n new_array = []\n for j in (0..(old_array.length - 1)) do\n @signupteam = SignedUpTeam.where(topic_id = old_array[j].id).first\n if (@signupteam != [] and @signupteam.team_id != 0) then\n new_array.insert(-1, old_array[j])\n end\n end\n return new_array\n end",
"title": ""
},
{
"docid": "d08c2d8f259d4222969bd5f37288312c",
"score": "0.48865098",
"text": "def sort_by_date(items)\n current = items.select { |item| item[:date].nil? }\n .sort_by { |item| item[:name].downcase }\n done = items - current\n done = done.sort do |item_a, item_b|\n case item_a[:date] <=> item_b[:date]\n when -1 then 1\n when 1 then -1\n else\n item_a[:name].downcase <=> item_b[:name].downcase\n end\n end\n current + done\n end",
"title": ""
},
{
"docid": "418f8a94a170b36d717dd3bd470b843d",
"score": "0.4877449",
"text": "def sort_by_pid(obj_array)\n obj_array.sort { |x,y| x.pid[x.pid.index(\":\")+1, x.pid.size].to_i <=> y.pid[y.pid.index(\":\")+1, y.pid.size].to_i }\nend",
"title": ""
},
{
"docid": "25330a221857f5c209b6e23dd1d103ff",
"score": "0.4875276",
"text": "def sort_odd array\n# filter only integers and odd using select\nnewArr = array.select do |value|\n value.class == Integer && value.odd?\nend\n\n# sort from least to greatest\n newArr.sort\nend",
"title": ""
},
{
"docid": "8daefa222a8002662952282a044470b0",
"score": "0.4871457",
"text": "def sort_r(array, sorted_array=[])\n\n if array != []\n sorted_array.push(array.min)\n array.delete_at(array.index(array.min))\n sort_r(array, sorted_array)\n end\n\n sorted_array\nend",
"title": ""
},
{
"docid": "e4d86bf674cc27be9f83351f4e4ad1e6",
"score": "0.48568824",
"text": "def sort array\n rec_sort array, []\nend",
"title": ""
},
{
"docid": "be631168c87d661ab4c911aa7ff4c284",
"score": "0.48476845",
"text": "def remove_nulls!\n self.delete_if { |x| x[1].to_s.empty? || x[1].nil? }\n end",
"title": ""
},
{
"docid": "9f8d80560bd38013e9dddb027aaf0b15",
"score": "0.4843374",
"text": "def nillify_nulls(args_array)\n\t\t\t# Convert all strings containing 'null' to nil\n\t\t\targs_array.collect! { |arg| if arg == 'null' then nil else arg end }\n\t\t\t# Return nil if the args array contained only 'null' strings\n\t\t\tif args_array.compact.empty? then nil else args_array end\n\t\tend",
"title": ""
},
{
"docid": "0358a08d1bbf80a164aac589564d51af",
"score": "0.483237",
"text": "def pre_sort(unsorted, sorted) \n \n return sorted if unsorted.length <= 0\n \n parked_arr = []\n parked = unsorted.pop\n\n unsorted.each do |item| \n if item < parked\n parked_arr.push parked\n parked = item\n else\n parked_arr.push item\n end \n end\n\n sorted << parked\n pre_sort(parked_arr, sorted)\nend",
"title": ""
},
{
"docid": "b9af075708853ba567cde6ce79b07eed",
"score": "0.48093015",
"text": "def ordered_by_qualifications candidates\n #candidates.sort_by { |candidate| candidate[:years_of_experience], candidate[:github_points] }\n candidates.sort! do |a, b|\n (b[:years_of_experience] <=> a[:years_of_experience]).nonzero? ||\n (b[:github_points] <=> a[:github_points])\n end\nend",
"title": ""
},
{
"docid": "bf7bfa1d5cfa67eae41d5e24473b65fe",
"score": "0.48048756",
"text": "def sort_out(origin_array)\n origin_array.sort!\n origin_array.uniq\n end",
"title": ""
},
{
"docid": "1d737a7150688ef990068872780c7cdb",
"score": "0.4803364",
"text": "def sort arr \n\trec_sort arr, []\nend",
"title": ""
},
{
"docid": "c4764b47b0b793e10dd668d6c416c9c6",
"score": "0.48017702",
"text": "def ordered_by_qualifications(candidates)\n candidates_array = []\n candidates.each do |candidate|\n candidates_array.push(candidate)\n end\n\n pp candidates_array.sort_by {|person| person[:years_of_experience] || person[:github_points]}.reverse\n\nend",
"title": ""
},
{
"docid": "4d009339ff9460ff7e0e4c3aaacfcce1",
"score": "0.47783208",
"text": "def my_array_sorting_method(source)\n source.reject{|x| x.is_a? String}.sort + source.reject{|x| x.is_a? Numeric}.sort\nend",
"title": ""
},
{
"docid": "5c6584c38506f22a65f21fb5e6b3f852",
"score": "0.47743955",
"text": "def hs_sort_alls()\n\t$alls.each { |k, v|\n\t\tresult = v.sort {|left, right| (@items[left])[:created] <=> (@items[right])[:created]}\n\t\tv = result\n\t}\nend",
"title": ""
},
{
"docid": "5fd271d9683e823401bda8527dad2be6",
"score": "0.47647005",
"text": "def remove_nils_and_false_from_array(arr)\n arr.compact.delete_if do |word|\n word == false \n end\nend",
"title": ""
},
{
"docid": "98519ab05496d8498f8d616556b52193",
"score": "0.47607985",
"text": "def bubble_sort_by(arr)\n\tsorted_arr = arr.clone\n\tlen = sorted_arr.length-1\n\tuntil sorted_by_length?(sorted_arr)\n\t\tsorted_arr[0..len].each_with_index do |item, index|\n\t\t\tif sorted_arr[index + 1].nil? == false && yield(sorted_arr[index], sorted_arr[index - 1]) < 0\n\t\t\t\tsorted_arr[index], sorted_arr[index + 1] = sorted_arr[index + 1], sorted_arr[index]\n\t\t\tend\n\t\tend\n\t\tlen -= 1\n\tend\n\treturn sorted_arr\nend",
"title": ""
},
{
"docid": "75a58b16084429afbbdd89e564cadd8b",
"score": "0.47530952",
"text": "def sorted(array)\n is_sorted = true\n i = 0\n array.each do\n if array[i+1] == nil\n break\n elsif array[i] <= array[i + 1]\n i += 1\n else\n is_sorted = false\n break\n end\n end\n is_sorted\nend",
"title": ""
},
{
"docid": "710e60f76274f44ff5c0fb8f7d95b33f",
"score": "0.47511595",
"text": "def remove_blanks_added_by_chosen(arr)\n arr.reject!(&:empty?)\n end",
"title": ""
},
{
"docid": "1235cc1a39821589ffbbaa337f85a6c4",
"score": "0.4743794",
"text": "def optimize(ranges)\n ranges = ranges.sort_by(&:first)\n\n result = [ranges.first]\n\n ranges[1..-1].each do |elem|\n a, b = result[-1], elem\n\n if a.actual_last >= b.first-1\n if a.actual_last >= b.actual_last\n # drop b!\n else\n result[-1] = a | b\n end\n else\n result << b\n end\n end\n\n result\nend",
"title": ""
},
{
"docid": "559196dba2eda23722384b19d507cad9",
"score": "0.47405595",
"text": "def array_manip(array)\n array.map.with_index do |num, idx|\n array[idx..-1].sort.find { |n| n > num }\n end.map { |x| x.nil? ? -1 : x }\nend",
"title": ""
},
{
"docid": "1fb91c6fd4b75869809df1e3af7d28fe",
"score": "0.47287783",
"text": "def odd_filter array\n #Goes through the array and only returns values that are the Integer type. From the array of Integers, it goes through again and returns only odd Integers. Then sort the array from least to greatest and make it a permanent change to the array parameter.\n array.select{|value| value.is_a?(Integer)}.select(&:odd?).sort!\nend",
"title": ""
},
{
"docid": "3ee1886aa3c2409ae6181cd670112aa7",
"score": "0.47211963",
"text": "def reject_success_and_sort(totals, options)\n totals.reject do |key, value| \n value < treshold_for_key(key, options)\n end.to_a.sort() {|a, b| b.last <=> a.last}\n end",
"title": ""
},
{
"docid": "d36ef33668c82b2fcb565f96ad2b347b",
"score": "0.47133467",
"text": "def visit_Arel_Nodes_NullsFirst(o, collector); end",
"title": ""
},
{
"docid": "733280461bc884954830b1f9dcaa513a",
"score": "0.47121912",
"text": "def sort_by_date!\n @items.sort_by! { |item| item.deadline }\n nil\n end",
"title": ""
},
{
"docid": "e2612834fce122cf32a1e0dccc462696",
"score": "0.47075644",
"text": "def my_array_sorting_method(array)\n sorted = array.partition{|x| x.is_a? Integer}.map(&:sort).flatten\n return sorted\nend",
"title": ""
},
{
"docid": "a6287e25f3212bb90047fdccbe27f79f",
"score": "0.47070196",
"text": "def sort_each\n # Deep copy\n aux = Marshal.load(Marshal.dump(self))\n result = []\n\n # Each iteration finds the minimun from aux,\n # deletes it and add it to result\n self.length.times do |i|\n m = aux.each_with_index.min\n aux.delete_at(m[1])\n result << m[0]\n end\n \n return result\n end",
"title": ""
},
{
"docid": "7876e0c5d926925ec1b0fc021913b354",
"score": "0.4698762",
"text": "def my_array_sorting_method(source)\n source = source.partition{ |item| item.is_a? Fixnum }\n source[0] = source[0].sort\n source[1] = source[1].sort\n source.flatten\nend",
"title": ""
},
{
"docid": "91d129b5d5ded99ac8c6f90c31c18cb2",
"score": "0.4696076",
"text": "def sort(array)\n\trec_sort(array,[])\nend",
"title": ""
},
{
"docid": "1ca4ad871fd99412982cbce2f5c8c163",
"score": "0.46960407",
"text": "def sort_natural(input, property = nil)\n ary = InputIterator.new(input)\n\n return [] if ary.empty?\n\n if property.nil?\n ary.sort do |a, b|\n nil_safe_casecmp(a, b)\n end\n elsif ary.all? { |el| el.respond_to?(:[]) }\n begin\n ary.sort { |a, b| nil_safe_casecmp(a[property], b[property]) }\n rescue TypeError\n raise_property_error(property)\n end\n end\n end",
"title": ""
},
{
"docid": "4c9389c15c135aa4c56ff66cd746352c",
"score": "0.46904474",
"text": "def remove_falsy_values(array)\n truthy_array = []\n array.each do |element|\n if element == true\n truthy_array << element\n puts truthy_array\n elsif element == nil\n array.delete_at(element)\n end\n\n truthy_array\n end\n end",
"title": ""
},
{
"docid": "9c5c647e914feeceb410b156b59a535e",
"score": "0.4687928",
"text": "def sort_incomplete_by_date\n a = get_incomplete\n ordered = []\n\n a.each do |task|\n if task.class == DueTask && task.completed? == false\n ordered << task\n end\n end\n # sort by the object's due date\n ordered.sort_by! {|obj| obj.due_date}\n # return the ordered array\n ordered\n end",
"title": ""
},
{
"docid": "d2f5c6604269d0edaa979fb0faac139e",
"score": "0.46862578",
"text": "def sort_undone\n @agenda.select { |e| e.done? == false }\n end",
"title": ""
},
{
"docid": "349b4d3e354afb3258a1fa9a01ade408",
"score": "0.46732035",
"text": "def ordered_by_qualifications(candidates)\n candidates.sort_by do |candidate|\n [-candidate[:years_of_experience], -candidate[:github_points]]\n end\n\n\nend",
"title": ""
},
{
"docid": "c101078dbbb9e597b46cc79f057f625a",
"score": "0.46725485",
"text": "def filter_null(*input_fields)\n each(input_fields, :filter => Java::CascadingOperationFilter::FilterNull.new)\n end",
"title": ""
},
{
"docid": "c8230fe82e679202eb5c34bcc18e8b50",
"score": "0.46709767",
"text": "def remove_reject_duplicates(array)\n return array.flatten.uniq.sort\n end",
"title": ""
},
{
"docid": "de6134b1cd65ed47e8657612d47ecb48",
"score": "0.46696863",
"text": "def qsort(arr)\n if arr.empty?\n []\n else\n head, *tail = arr\n small = tail.select{|x| x <= head}\n big = tail.select{|x| x > head}\n qsort(small) + [head] + qsort(big)\n end\nend",
"title": ""
},
{
"docid": "c3f0e2719036eae5561f032953c09d0b",
"score": "0.46654043",
"text": "def introspective_sort(array)\n return array if array.empty?\n\n depth_limit = (2 * Math.log10(array.size) / Math.log10(2)).floor\n quick_sort(array, depth_limit)\nend",
"title": ""
}
] |
1097a7e7758f08d32addfc88ea3fdcab
|
GET /users GET /users.json
|
[
{
"docid": "876820cd4580ba7dd365f4c418ab2a07",
"score": "0.0",
"text": "def index\n @users = User.all\n\n employee = OkrRole.find_by(name: \"Employee\")\n team_lead = OkrRole.find_by(name: \"Team Lead\")\n admin = OkrRole.find_by(name: \"Admin\")\n\n @employees = OkrUserRole.where(okr_role_id: employee.id)\n @team_leads = OkrUserRole.where(okr_role_id: team_lead.id)\n @admins = OkrUserRole.where(okr_role_id: admin.id)\n\n @user_status_selection = CONST_USER_STATUS\n okr_user_edit = OkrUserEdit.find_by(user_id: current_user.id)\n if okr_user_edit == nil\n OkrUserEdit.create(user_id: current_user.id, editing_user_id: current_user.id)\n @current_edit_user = User.find(current_user.id)\n else \n @current_edit_user = User.find(okr_user_edit.editing_user_id)\n end\n\n pages_initialization\n \n @new_user = User.new\n @unassign_user_role_amt = check_unassign_role_user\n\n render 'app/system_users'\n end",
"title": ""
}
] |
[
{
"docid": "9f7c735ace683c5c2b12c914cc9ad8a8",
"score": "0.84081405",
"text": "def get\n users = User.all.as_json\n render(json: users.as_json, status: :ok)\n end",
"title": ""
},
{
"docid": "543509c6588e2f79a8dbcd1cdcdaf7b9",
"score": "0.836071",
"text": "def users\n try_json get('/user')\n end",
"title": ""
},
{
"docid": "6bbb4bc1303f9011da8bcc971a27aa25",
"score": "0.8050686",
"text": "def users\n get '/users'\n end",
"title": ""
},
{
"docid": "017d848c9897540ea7bc67c9d5139cf4",
"score": "0.7915306",
"text": "def users(opts={})\n get(\"/api/users\", opts)\n end",
"title": ""
},
{
"docid": "3c5e22893d22043de2539eab250264ad",
"score": "0.77417076",
"text": "def index\n uri = \"#{API_BASE_URL}/users.json\"\n rest_resource = RestClient::Resource.new(uri,USERNAME, PASSWORD)\n users = rest_resource.get\n @users = JSON.parse(users, :symbolize_names => true)\n end",
"title": ""
},
{
"docid": "5a2b7963ab17292ecee2f8263f92b100",
"score": "0.77342296",
"text": "def index\n @users = User.resource[@current_user['id']].get\n render json: @users\n end",
"title": ""
},
{
"docid": "93a0fef3e882c742575f7b75e7c85f92",
"score": "0.76708406",
"text": "def index\n uri = \"#{API_BASE_URL}/users.json\" # specifying json format in the URl\n rest_resource = RestClient::Resource.new(uri, USERNAME, PASSWORD)\n users = rest_resource.get\n @users = JSON.parse(users, :symbolize_names => true)\n end",
"title": ""
},
{
"docid": "c30d74a9ad7eba05edcb8605ab93b040",
"score": "0.7632463",
"text": "def get_users\n response = connection.get \"users\"\n parse(response)\n end",
"title": ""
},
{
"docid": "8964e99596f7e7774764500fc019be86",
"score": "0.7617348",
"text": "def index\n\n if request.path_parameters[:format] == 'json'\n query = get_users\n\n end\n\n respond_to do |format|\n format.html\n format.json { render json: query }\n end\n end",
"title": ""
},
{
"docid": "1fa340328c780cc7bc2a4bc7079f2724",
"score": "0.7614113",
"text": "def fetch_user_details\n get('users/list')\n end",
"title": ""
},
{
"docid": "7e8d258f13b5ac8306b7387d394a0f12",
"score": "0.7612176",
"text": "def get_users\n Resources::User.parse(request(:get, \"Users\"))\n end",
"title": ""
},
{
"docid": "47e58634dc6a1375d758c8a6d4d277ed",
"score": "0.76035243",
"text": "def users\n\t render json: { users: User.all }\n\t end",
"title": ""
},
{
"docid": "3e1132849bff254063ef4e8144752d24",
"score": "0.7599184",
"text": "def get_users()\n return @api.do_request(\"GET\", get_base_api_path() + \"/users\")\n end",
"title": ""
},
{
"docid": "3e1132849bff254063ef4e8144752d24",
"score": "0.75990206",
"text": "def get_users()\n return @api.do_request(\"GET\", get_base_api_path() + \"/users\")\n end",
"title": ""
},
{
"docid": "3e1132849bff254063ef4e8144752d24",
"score": "0.75990206",
"text": "def get_users()\n return @api.do_request(\"GET\", get_base_api_path() + \"/users\")\n end",
"title": ""
},
{
"docid": "a95dfe28d6b386aafc5fb53749e84258",
"score": "0.75946826",
"text": "def user\n get(ROBINHOOD_USER_ROUTE, return_as_json: true)\n end",
"title": ""
},
{
"docid": "e05472a5e389b9cb25c42ecfd8b2adf0",
"score": "0.7566673",
"text": "def index\n user = User.all\n render json: user, status: 200\n end",
"title": ""
},
{
"docid": "73f7ae2fa82d59f15d5328c8ae591d97",
"score": "0.7548231",
"text": "def index\n user = User.all\n render json: user\n end",
"title": ""
},
{
"docid": "a2c1496955488bf3bb3f08b5c7ed033c",
"score": "0.75214636",
"text": "def users(id = nil)\n uri = if id\n File.join(base_uri, 'users', id)\n else\n File.join(base_uri, 'users')\n end\n\n http = call_kavlan(uri, :get)\n continue_if!(http, is: [200])\n\n JSON.parse(http.body)\n end",
"title": ""
},
{
"docid": "11a1a1f560b80f96e92570d67b197134",
"score": "0.749885",
"text": "def index\n @users = User.normal\n render json: @users\n end",
"title": ""
},
{
"docid": "728355570654539ecc78d5a6323ca440",
"score": "0.7485816",
"text": "def index\n users = User.all\n render json: users\n end",
"title": ""
},
{
"docid": "be025401ce661e746a5395cf25d40ae3",
"score": "0.74636567",
"text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @users }\n end\n end",
"title": ""
},
{
"docid": "8110cf69f978358fb10a03aa41fbeb3c",
"score": "0.74623036",
"text": "def index\n users = User.all\n render json: users, status: :ok\n end",
"title": ""
},
{
"docid": "b209d6e9945c425900c17658a74b7147",
"score": "0.745525",
"text": "def users(query={})\n perform_get(\"/api/1/users\", :query => query)\n end",
"title": ""
},
{
"docid": "cc242a095e722778fca002f25f8b5ec3",
"score": "0.7446153",
"text": "def users(options = {})\n request(:get, 'users', options = {})\n end",
"title": ""
},
{
"docid": "3d5370e43b770779413a93d4918ce2ea",
"score": "0.7443466",
"text": "def index\n raise NotImplementedError\n\n @users = User.all\n json_response(@users)\n end",
"title": ""
},
{
"docid": "0bcd24908b50aabe8262541173f1842b",
"score": "0.7436547",
"text": "def users_data\n response = RestClient.get(BASE_URL + '/users', Authorization: AUTHORIZATION_TOKEN )\n if response.code == 200\n JSON.parse response.body\n else\n []\n end\n end",
"title": ""
},
{
"docid": "70ce8704ae64d0d47b8bcdebc9aef52c",
"score": "0.7430364",
"text": "def index\n @users = User.all\n json_response(@users)\n end",
"title": ""
},
{
"docid": "70ce8704ae64d0d47b8bcdebc9aef52c",
"score": "0.7430364",
"text": "def index\n @users = User.all\n json_response(@users)\n end",
"title": ""
},
{
"docid": "70ce8704ae64d0d47b8bcdebc9aef52c",
"score": "0.7430364",
"text": "def index\n @users = User.all\n json_response(@users)\n end",
"title": ""
},
{
"docid": "70ce8704ae64d0d47b8bcdebc9aef52c",
"score": "0.7430364",
"text": "def index\n @users = User.all\n json_response(@users)\n end",
"title": ""
},
{
"docid": "365a065dfa3efc893dff2ec1751a8370",
"score": "0.74264127",
"text": "def users\n get('/api/v1/users.json').map do |user|\n User.new(self, user)\n end\n end",
"title": ""
},
{
"docid": "1578585c4421e89ab79f3ee95a5a6b50",
"score": "0.74261004",
"text": "def index \n users = User.all\n render json: users\n end",
"title": ""
},
{
"docid": "d12422285c5f2d22f5aa43909fb2b7c3",
"score": "0.7425406",
"text": "def index\n json_response(@users)\n end",
"title": ""
},
{
"docid": "5be1a2b1facfbebe48738361ccbdfec5",
"score": "0.74242425",
"text": "def users_show(options = {})\n @req.get(\"/1.1/users/show.json\", options)\n end",
"title": ""
},
{
"docid": "74a4e7202861ab80f0d8abd15d24e86c",
"score": "0.7423415",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "74a4e7202861ab80f0d8abd15d24e86c",
"score": "0.7423415",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "74a4e7202861ab80f0d8abd15d24e86c",
"score": "0.7423415",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "74a4e7202861ab80f0d8abd15d24e86c",
"score": "0.7423415",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "253bebf87e7183fd88370ca9b28863be",
"score": "0.74200225",
"text": "def index\n @users = User.all\n render json: @users, status: :ok\n end",
"title": ""
},
{
"docid": "253bebf87e7183fd88370ca9b28863be",
"score": "0.74200225",
"text": "def index\n @users = User.all\n render json: @users, status: :ok\n end",
"title": ""
},
{
"docid": "5b9e2c334bf2ee55a849ac008ab4760c",
"score": "0.7414205",
"text": "def index\n @users = User.all\n render formats: :json\n end",
"title": ""
},
{
"docid": "1d9b1fc3d6eec2bde2962031c0d3b008",
"score": "0.74116546",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "e78e1e1473ede309a13313dea8093034",
"score": "0.7405091",
"text": "def index \n @users = User.all \n json_response(@users)\n end",
"title": ""
},
{
"docid": "d4a5fb8b42d9ce1d4070b77a97be1120",
"score": "0.74037486",
"text": "def index\n @users = User.all\n\n render json: @users\n end",
"title": ""
},
{
"docid": "b7f893411aa0a30a20a26dadbd483df5",
"score": "0.7401923",
"text": "def show_users(**params)\n get('users', params)\n end",
"title": ""
},
{
"docid": "6c06ae91d84c999b50d1830d37605337",
"score": "0.73978853",
"text": "def index\n users = User.all\n render json: users\n end",
"title": ""
},
{
"docid": "6c06ae91d84c999b50d1830d37605337",
"score": "0.73978853",
"text": "def index\n users = User.all\n render json: users\n end",
"title": ""
},
{
"docid": "8dfb48fd6a80c33f0ac0d9e681640dbd",
"score": "0.73914206",
"text": "def index\n @user_service = UsersService.new\n @users = @user_service.get_users\n respond_with(@users) do |format|\n format.html # index.html.erb\n format.json\n end\n end",
"title": ""
},
{
"docid": "bf0919dd85bfe1e319e9a1c96d755cf5",
"score": "0.73894036",
"text": "def user(query={})\n self.class.get(\"/users/show.json\", :query => query)\n end",
"title": ""
},
{
"docid": "21d0100fa8f28b0e5a2ab7431e570c24",
"score": "0.73881793",
"text": "def index\n users = User.all\n render json: {users: users}\n end",
"title": ""
},
{
"docid": "f01ec3a51043a68e5143b1a379740b30",
"score": "0.7387084",
"text": "def index\n user = User.all\n render json: {\n data: { user: user }\n }, status: :ok\n end",
"title": ""
},
{
"docid": "768f1b79678af1fa17252ed99984255f",
"score": "0.73797745",
"text": "def index\n @users = User.all\n render json: {users: @users}, status: :ok\n end",
"title": ""
},
{
"docid": "71bbf5a5c05ef96c138d150f7486a57b",
"score": "0.7371924",
"text": "def index\n @users = User.all\n render json: @users, status: 200\n end",
"title": ""
},
{
"docid": "65844d565c3ece8e3601af3a0042efcb",
"score": "0.7362046",
"text": "def all_users\n response = get(\"#{@config['url']}/api/2.1/rest/users\", {accept: :json, :cookies => cookies})\n JSON.parse(response, :symbolize_names => true)[:users][:user]\n end",
"title": ""
},
{
"docid": "92c38d204173af55357406763326ad78",
"score": "0.7358582",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "92c38d204173af55357406763326ad78",
"score": "0.7358582",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "92c38d204173af55357406763326ad78",
"score": "0.7358582",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "92c38d204173af55357406763326ad78",
"score": "0.7358582",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "92c38d204173af55357406763326ad78",
"score": "0.7358582",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "92c38d204173af55357406763326ad78",
"score": "0.7358582",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "92c38d204173af55357406763326ad78",
"score": "0.7358582",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "92c38d204173af55357406763326ad78",
"score": "0.7358582",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "92c38d204173af55357406763326ad78",
"score": "0.7358582",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "92c38d204173af55357406763326ad78",
"score": "0.7358582",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "92c38d204173af55357406763326ad78",
"score": "0.7358582",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "92c38d204173af55357406763326ad78",
"score": "0.7358582",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "92c38d204173af55357406763326ad78",
"score": "0.7358582",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "92c38d204173af55357406763326ad78",
"score": "0.7358582",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "92c38d204173af55357406763326ad78",
"score": "0.7358582",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "92c38d204173af55357406763326ad78",
"score": "0.7358582",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "88b3ae1730160a096115c73635028df2",
"score": "0.73570585",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "cbdc21cee11cf48ec2414873bcf3b4f8",
"score": "0.7351439",
"text": "def users(options={})\n response = connection.get do |req|\n req.url \"users\", options\n end\n return_error_or_body(response)\n end",
"title": ""
},
{
"docid": "c9be31dad7d323088e84c4adffd9f57a",
"score": "0.7350187",
"text": "def index\n @users = User.all\n\n render json: @users\n end",
"title": ""
},
{
"docid": "c9be31dad7d323088e84c4adffd9f57a",
"score": "0.7350187",
"text": "def index\n @users = User.all\n\n render json: @users\n end",
"title": ""
},
{
"docid": "c9be31dad7d323088e84c4adffd9f57a",
"score": "0.7350187",
"text": "def index\n @users = User.all\n\n render json: @users\n end",
"title": ""
},
{
"docid": "c9be31dad7d323088e84c4adffd9f57a",
"score": "0.7350187",
"text": "def index\n @users = User.all\n\n render json: @users\n end",
"title": ""
},
{
"docid": "c9be31dad7d323088e84c4adffd9f57a",
"score": "0.7350187",
"text": "def index\n @users = User.all\n\n render json: @users\n end",
"title": ""
},
{
"docid": "c9be31dad7d323088e84c4adffd9f57a",
"score": "0.7350187",
"text": "def index\n @users = User.all\n\n render json: @users\n end",
"title": ""
},
{
"docid": "c9be31dad7d323088e84c4adffd9f57a",
"score": "0.7350187",
"text": "def index\n @users = User.all\n\n render json: @users\n end",
"title": ""
},
{
"docid": "c9be31dad7d323088e84c4adffd9f57a",
"score": "0.7350187",
"text": "def index\n @users = User.all\n\n render json: @users\n end",
"title": ""
},
{
"docid": "c9be31dad7d323088e84c4adffd9f57a",
"score": "0.7350187",
"text": "def index\n @users = User.all\n\n render json: @users\n end",
"title": ""
},
{
"docid": "c9be31dad7d323088e84c4adffd9f57a",
"score": "0.7350187",
"text": "def index\n @users = User.all\n\n render json: @users\n end",
"title": ""
},
{
"docid": "8c903d03e45311f48905e2ea9d3bba05",
"score": "0.73497856",
"text": "def users\n oauth_response = access_token.get(\"/api/v1/users.json\")\n JSON.parse(oauth_response.body)\n end",
"title": ""
},
{
"docid": "9910e37b855e76e2f4dc68c02812b65c",
"score": "0.73425883",
"text": "def show\n @users = User.all\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end",
"title": ""
},
{
"docid": "7192ec11ec312baac0d2ac4738bad8a3",
"score": "0.73348075",
"text": "def index\n authorize! :read, User\n @users = User.all\n\n render json: @users\n end",
"title": ""
},
{
"docid": "3a927f940b3bb7a38cec50aef43084c9",
"score": "0.7328958",
"text": "def index\n\t\tusers = User.all\n\t\trender json: users\n\tend",
"title": ""
},
{
"docid": "3a927f940b3bb7a38cec50aef43084c9",
"score": "0.7328958",
"text": "def index\n\t\tusers = User.all\n\t\trender json: users\n\tend",
"title": ""
},
{
"docid": "942e9267d60d38cde812d4eeb9779a93",
"score": "0.73261863",
"text": "def index\n users = apply_pagination User.fetch_and_cache\n\n users = users.as_json(only: [:id, :email])\n render json: users\n end",
"title": ""
},
{
"docid": "e584b8a35cf7ebb98d5533c42b2fec65",
"score": "0.7316376",
"text": "def index\n users = User.all\n\n render json: users.to_json, status: 200\n end",
"title": ""
},
{
"docid": "aaf39c0ee28ba6a3ac81c6d021196720",
"score": "0.73126787",
"text": "def index\n @users = User.all\n render json: @users, status: :ok\n end",
"title": ""
},
{
"docid": "aaf39c0ee28ba6a3ac81c6d021196720",
"score": "0.73126787",
"text": "def index\n @users = User.all\n render json: @users, status: :ok\n end",
"title": ""
},
{
"docid": "aaf39c0ee28ba6a3ac81c6d021196720",
"score": "0.73126787",
"text": "def index\n @users = User.all\n render json: @users, status: :ok\n end",
"title": ""
},
{
"docid": "aaf39c0ee28ba6a3ac81c6d021196720",
"score": "0.73126787",
"text": "def index\n @users = User.all\n render json: @users, status: :ok\n end",
"title": ""
},
{
"docid": "91668c1e35aaa65d080deea8c09126be",
"score": "0.7310774",
"text": "def index\n @users = User.all \n render json: @users\n end",
"title": ""
},
{
"docid": "bf1d3f31b565c7345057c88f25e455cb",
"score": "0.73034644",
"text": "def index\n users = User.all\n render json: users.to_json, status: 200\n end",
"title": ""
},
{
"docid": "bf1d3f31b565c7345057c88f25e455cb",
"score": "0.73034644",
"text": "def index\n users = User.all\n render json: users.to_json, status: 200\n end",
"title": ""
},
{
"docid": "2f190ad36d443d1a902316ac406d8b93",
"score": "0.7302701",
"text": "def get_users\n access_token = get_token\n headers = {:Authorization => \"Bearer #{access_token}\", :accept => 'application/vnd.hoopla.user-list+json'}\n response = HTTP.headers(headers).get(\"#{@@host}/users\")\n users = JSON.parse(response.to_s)\n return users\n end",
"title": ""
},
{
"docid": "3013af5d315bfa480d63f6f328ae2095",
"score": "0.730258",
"text": "def viewusers\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"title": ""
},
{
"docid": "e207204a11515a5ae49c0482b0b8fe1f",
"score": "0.7302499",
"text": "def user\n render :json => User.find(params[:id]).to_json\n end",
"title": ""
},
{
"docid": "5b1e72e2623a8a681dbd625eec26fbe1",
"score": "0.72958165",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
}
] |
ee27b619a9c7700ed5c1520837f0526d
|
Alphabetically Sorted with 'Other' always at the bottom
|
[
{
"docid": "9d209badb2e0e994d8ed2cd3c237b405",
"score": "0.0",
"text": "def <=>(other_category)\n if name == 'Other'\n 1\n elsif other_category.name == 'Other'\n -1\n else\n name <=> other_category.name\n end\n end",
"title": ""
}
] |
[
{
"docid": "b283ff9b329cabdcbb99cc9898e5d307",
"score": "0.70979005",
"text": "def sort_order\n if ministry_or_title == 'Prime Minister'\n 'AAAAA' # force first\n else\n ministry_or_title\n end\n end",
"title": ""
},
{
"docid": "396f2144345bfbcf4f56904d1134de76",
"score": "0.6914048",
"text": "def sort_text; end",
"title": ""
},
{
"docid": "b1e554652cabb72ce1e24bdb9200310b",
"score": "0.6412233",
"text": "def sortByLetter\n \n end",
"title": ""
},
{
"docid": "89900488c7498652f9057aaeaffc813f",
"score": "0.63965464",
"text": "def alphabetize!\n sort! { |a, b| grouped_compare(a, b) }\n end",
"title": ""
},
{
"docid": "da6fd8c26f9ff4292bca2c326e88a814",
"score": "0.6366388",
"text": "def sort_name\n return 'A' if name == 'Opening Monologue'\n return 'ZZZZZZZ' if name == 'Closing Monologue'\n return name\n end",
"title": ""
},
{
"docid": "7b815a1603b21c0051b20102821fd858",
"score": "0.6328844",
"text": "def alphabetic_number_sort_further(numbers)\n numbers.sort { |n1, n2| ENGLISH_WORDS[n1] <=> ENGLISH_WORDS[n2] }\nend",
"title": ""
},
{
"docid": "af66abe2b7242c339001bcba786d0de5",
"score": "0.62864345",
"text": "def alphasort(other)\n 0.upto((self.length < other.length ? self.length : other.length) - 1) do |i|\n next if self[i] == other[i] # Characters the same, skip to next character.\n if self[i] =~ /[a-zA-Z]/ && !(other[i] =~ /[a-zA-Z]/)\n return -1 # Self is alphabetic, other is not, so self is sorted before\n elsif !(self[i] =~ /[a-zA-Z]/) && other[i] =~ /[a-zA-Z]/\n return 1 # Self is not alphabetic, other is, so self is sorted after\n else\n return self[i] <=> other[i] # Simply sort like we would normally\n end\n end\n self.length <=> other.length # Segments are identical, but strings may not be of equal length. Sort short before long.\n end",
"title": ""
},
{
"docid": "fe547da028dc5c2d244bc93f75a7e17b",
"score": "0.628094",
"text": "def sort_name\n if self.name.include? \"k\"\n return \"0\" + self.name.last\n else\n return self.name\n end\n end",
"title": ""
},
{
"docid": "dc2bea2276023f9c5224835f0786cca1",
"score": "0.60948807",
"text": "def word_sort\n result = nil\n result = self.seperate.sort\n result\n end",
"title": ""
},
{
"docid": "541ff9f8e88a169672f44e732697ec2d",
"score": "0.60712856",
"text": "def to_sortable(alphabetic=true)\n \n end",
"title": ""
},
{
"docid": "8b38f731fe5aad77e44ca4728eb0dec0",
"score": "0.60495764",
"text": "def alphabetical_order(str)\n str.split('').sort.join\nend",
"title": ""
},
{
"docid": "8e5847abaa2627cc807148504f02c677",
"score": "0.6048463",
"text": "def jumble_sort(str, alpha = nil)\n alpha ||= (\"a\"..\"z\").to_a\n str.split(\"\").bubble_sort { |a,b| alpha.index(a) <=> alpha.index(b) }.join(\"\")\nend",
"title": ""
},
{
"docid": "5bbbbd3c316933f4585a19ded089132d",
"score": "0.6033767",
"text": "def sort_pilot(destination)\n case destination\n when 'Earth' then 'Fry'\n when 'Mars' then 'Amy'\n when 'Uranus' then 'Bender'\n else 'Leela'\n end\n end",
"title": ""
},
{
"docid": "64c8304d6d0f8b49a05e98499883e208",
"score": "0.6026807",
"text": "def sort_name\n names = [\"John Smith\", \"Dan Boone\", \"Jennifer Jane\", \"Charles Lindy\", \"Jennifer Eight\", \"Rob Roy\"]\n\n names.map!{|i|i.split}.sort_by!{|i| i[1]}.map!{|i| i.join(\" \")}\n\nend",
"title": ""
},
{
"docid": "b66eefef3423b43e3a85240c573376d9",
"score": "0.60246974",
"text": "def sort_entries; end",
"title": ""
},
{
"docid": "8e7a61b185dadcfa94a571b1711c13e3",
"score": "0.6020931",
"text": "def sort(sentence)\n words = sentence.gsub('!','').split(' ')\n lower_case_words = words.select{|word| word!=word.capitalize}.sort\n upper_case_words = words.select{|word| word==word.capitalize}.sort.reverse\n\n lower_case_words.join(' ') + ' ' + upper_case_words.join(' ')\nend",
"title": ""
},
{
"docid": "e784ae7ed6295429093164e7ac2150c4",
"score": "0.6019253",
"text": "def kw_sort\n self.sort do |a, b|\n a = \"@#{KW_ORDER.index(a)}\" if KW_ORDER.include?(a)\n b = \"@#{KW_ORDER.index(b)}\" if KW_ORDER.include?(b)\n a <=> b\n end\n end",
"title": ""
},
{
"docid": "e784ae7ed6295429093164e7ac2150c4",
"score": "0.6019253",
"text": "def kw_sort\n self.sort do |a, b|\n a = \"@#{KW_ORDER.index(a)}\" if KW_ORDER.include?(a)\n b = \"@#{KW_ORDER.index(b)}\" if KW_ORDER.include?(b)\n a <=> b\n end\n end",
"title": ""
},
{
"docid": "77f7d0e9c0de6dc934c0adc52864a665",
"score": "0.60186017",
"text": "def secondary_sort\n # This function is empty as it's a placeholder for custom code...\n end",
"title": ""
},
{
"docid": "5ee7694279aa42fbaf4771d2d9b9e61f",
"score": "0.59982836",
"text": "def sort_key\n ''\n end",
"title": ""
},
{
"docid": "59a404bb3abc99d2b18850d60119863c",
"score": "0.59790224",
"text": "def alphabetic_number_sort(ary)\n ary.sort_by { |num| ENGLISH[num] }\nend",
"title": ""
},
{
"docid": "53bb1ec84030c6690c05b8fce64fed31",
"score": "0.59700906",
"text": "def sort_order\n -100\n end",
"title": ""
},
{
"docid": "05bdae57f2aa0e977503c5b3de100195",
"score": "0.5961613",
"text": "def two_sort(s)\n s.sort[0].gsub(/.{1,1}/, '\\0***').chomp('***')\nend",
"title": ""
},
{
"docid": "b22b3546c20a91573ef3c2c8c18b3a0f",
"score": "0.5958008",
"text": "def main_sort_running_order; end",
"title": ""
},
{
"docid": "b9fb827ed5b02316a2eda70b5b3c235b",
"score": "0.59578747",
"text": "def array_sort_by_last_letter_of_word(array)\n\t#reverse and then sort? or by -1?\nend",
"title": ""
},
{
"docid": "c9d3e8a8160f8fcce42ae61c54ad66af",
"score": "0.5949873",
"text": "def sort_direction\n end",
"title": ""
},
{
"docid": "4e1ec8ef1336b00255fbf50a603ab693",
"score": "0.5949811",
"text": "def alphabetize(recursive=false)\r\n ar = relationships_as_broader_than.sort_by do |rel|\r\n \"#{rel.narrower_than.active ? 0 : 1}__#{rel.narrower_than.name}\"\r\n end\r\n ar.each_index do |i|\r\n ar[i].update_attribute :narrower_than_position, i + 1\r\n ar[i].narrower_than.alphabetize(true) if recursive\r\n end\r\n end",
"title": ""
},
{
"docid": "42a07ac169c3364577549921be4932b3",
"score": "0.59344065",
"text": "def alphabetize(arr, rev=false)\n arr.sort!\nend",
"title": ""
},
{
"docid": "111e46494acf5dd8e92fa636831671c7",
"score": "0.59328246",
"text": "def sort_order(default)\n ###############################################\n #params[:sort_order] == 'abbreviation' ? col = \"royalty_owners.#{params[:sort_order]}\" :\n # col = params[:sort_order]\n \"#{(params[:sort_order] || default.to_s).gsub(/[\\s;'\\\"]/,'')} #{params[:sort_dir] == 'down' ? 'DESC' : 'ASC'}\"\n end",
"title": ""
},
{
"docid": "ca6c4c1adf18638ebbcfa503a8d244e0",
"score": "0.59193975",
"text": "def sort_order\n lft\n end",
"title": ""
},
{
"docid": "46778f943fe712fa84d1e63b29560679",
"score": "0.59188926",
"text": "def alphabetical\n return @lyrics.sort\n end",
"title": ""
},
{
"docid": "a436391b95a7be74c0aa5efacf5f4294",
"score": "0.5918026",
"text": "def jumble_sort(str, alphabet = nil)\n if alphabet == nil\n new_str = str.sort\n else\n letters = str.chars\n new_str = letters.sort_by {|chr| alphabet.index[chr]}\n new_str.join('')\n end\n new_str\nend",
"title": ""
},
{
"docid": "5e7c733e65bcb07baf9ad30501e71948",
"score": "0.59157753",
"text": "def sorter(sortable_word)\n sortable_word.split(\"\").sort\n end",
"title": ""
},
{
"docid": "7fc09a2f937e8b324f4abe32e039a17c",
"score": "0.5911151",
"text": "def alphabetize(arr, rev=false)\r\n if rev\r\n arr.sort { |item1, item2| item2 <=> item1 }\r\n else\r\n arr.sort { |item1, item2| item1 <=> item2 }\r\n end\r\nend",
"title": ""
},
{
"docid": "7f4b7233ed6627dca7b632ca6567d0c9",
"score": "0.5903656",
"text": "def sort_order(default)\r\n \"#{default.to_s.gsub(/[\\s;'\\\"]/,'')} #{params[:d] == 'down' ? 'DESC' : 'ASC'}\"\r\n end",
"title": ""
},
{
"docid": "26e00ec0f8230a7cd9554804cb5123b2",
"score": "0.5900946",
"text": "def jumble_sort(str, alphabet = nil)\n \nend",
"title": ""
},
{
"docid": "0ba0ced39dfd7caa8814a49abc2b553c",
"score": "0.58919036",
"text": "def order_string_alphabetically(string)\n string.downcase.chars.sort(&:casecmp).join.delete(\" \")\nend",
"title": ""
},
{
"docid": "3f72e706834b8c5757c61895536b6d56",
"score": "0.5891248",
"text": "def sort_the_inner_content(words)\n words.split(\" \").map { |word| word.length == 1 ? word : word[0] + word[1..(word.length - 2)].split(\"\").sort.reverse.join + word[word.length - 1] }.join(\" \")\nend",
"title": ""
},
{
"docid": "fb99cb5338d50e55da021d181eddf977",
"score": "0.5875734",
"text": "def jumble_sort(str, alphabet = nil)\n\nend",
"title": ""
},
{
"docid": "fb99cb5338d50e55da021d181eddf977",
"score": "0.5875734",
"text": "def jumble_sort(str, alphabet = nil)\n\nend",
"title": ""
},
{
"docid": "19fb45ee4babd6b8ee557f6e422408a0",
"score": "0.58710045",
"text": "def sort arr\n l = arr.length \n n = 0\n \n while l-1 > n\n if arr[n].downcase > arr[n+1].downcase\n arr << arr[n]\n arr.delete_at(n)\n sort arr\n else\n n += 1\n end\n end\n arr\nend",
"title": ""
},
{
"docid": "c315737dc5cf2c5109b92be0b21f2bab",
"score": "0.5868317",
"text": "def newSort unsorted, sorted\n\tif unsorted.length <= 0\n\t\treturn sorted\n\tend\n\n\tsmall = unsorted.pop\n\tleftUnsorted = []\n\t\n\tunsorted.each do |word|\t\n\t\tif word < small\n\t\t\tleftUnsorted.push small\n\t\t\tsmall = word\n\t\telse\n\t\t\tleftUnsorted.push word\n\t\tend\n\tend\n\n\tsorted.push small\n\tnewSort leftUnsorted, sorted\nend",
"title": ""
},
{
"docid": "b7547e74954a46503cd524a7fc9758ef",
"score": "0.58617467",
"text": "def alphabetize(arr, rev=false)\n if rev\n arr.sort { |item1, item2| item2 <=> item1 }\n else\n arr.sort { |item1, item2| item1 <=> item2 }\n end\nend",
"title": ""
},
{
"docid": "6cbdb128b6473cb319a2862ae87e9d77",
"score": "0.5860566",
"text": "def order\n return if sort_by.to_s.empty?\n [sort_by, sort_direction].join(' ')\n end",
"title": ""
},
{
"docid": "226ddaa350b73a5eeeeb4430275e1b58",
"score": "0.5858779",
"text": "def jumble_sort(str, alphabet = nil)\n alphabet ||= (\"a\"..\"z\").to_a\n str.split(\"\").sort_by do |ltr|\n alphabet.index(ltr)\n end.join\nend",
"title": ""
},
{
"docid": "2d061ed91b7b0ac2412beb22541811cb",
"score": "0.5856374",
"text": "def sort_key\n main = case overall_state\n when :acceptable then\n 0\n when :review then\n 10000 - review_percentage * 100\n when :testing then\n 20000 - testing_percentage * 100\n when :building then\n 30000 - build_progress[:percentage] * 100\n when :failed then\n 40000\n when :unacceptable then\n 50000\n when :empty\n 60000\n else\n Rails.logger.error \"untracked #{overall_state}\"\n return\n end\n main + letter.ord()\n end",
"title": ""
},
{
"docid": "84d2be325e7b64c69ef300970c67c20f",
"score": "0.58558995",
"text": "def jumble_sort(str, alphabet = nil)\nend",
"title": ""
},
{
"docid": "84d2be325e7b64c69ef300970c67c20f",
"score": "0.58558995",
"text": "def jumble_sort(str, alphabet = nil)\nend",
"title": ""
},
{
"docid": "e52bc14247d4f274f525d9d7275627e2",
"score": "0.58556956",
"text": "def jumble_sort(str, alphabet = nil)\n alphabet ||= ('a'..'z').to_a\n\n sorted = false\n until sorted\n sorted = true\n (0...str.length - 1).to_a.my_each do |i|\n if alphabet.index(str[i]) > alphabet.index(str[i + 1])\n str[i], str[i + 1] = str[i + 1], str[i]\n sorted = false\n end\n end\n end\n str\nend",
"title": ""
},
{
"docid": "e42c8b393562f60ae540ebbf457f3264",
"score": "0.58507407",
"text": "def order() @order || 'ascending' ; end",
"title": ""
},
{
"docid": "f76de0b3e582451fc663964b4185d36c",
"score": "0.58471674",
"text": "def kwic_sort(phrase, results, index)\n index -= 1 if index > 0\n\n results.sort_by do |result|\n\n parts = result.sentence.downcase.partition(phrase)\n\n part = index < 0 ? parts.first : parts.last\n\n part.strip.split(/[^[[:word:]]]+/)[index] || 'z'\n end\n end",
"title": ""
},
{
"docid": "79e5725076fd3a0cdebf16240d7a67e4",
"score": "0.58462846",
"text": "def jumble_sort(str, alpha=nil)\nend",
"title": ""
},
{
"docid": "1acd28806eac9d1c7bc73de831cd00f3",
"score": "0.5843578",
"text": "def alphabetize(arr, rev = false)\n arr.sort!\nend",
"title": ""
},
{
"docid": "5c283ca637c957705e3d724800585018",
"score": "0.5830991",
"text": "def smart_title_sort(input)\n input.sort_by { |p| [p['position'] || 0, p['title'].downcase] }\n end",
"title": ""
},
{
"docid": "4f04beb54899e7f27f34299a2d1c220e",
"score": "0.5830097",
"text": "def sorted_labels\n labels.sort_by {|a| a.last.downcase }\n end",
"title": ""
},
{
"docid": "4515cbb8e6f22af9eb66f423f8d5582d",
"score": "0.58299667",
"text": "def sort\n chars.sort.join\n end",
"title": ""
},
{
"docid": "4f04beb54899e7f27f34299a2d1c220e",
"score": "0.58296627",
"text": "def sorted_labels\n labels.sort_by {|a| a.last.downcase }\n end",
"title": ""
},
{
"docid": "a60f86e20914c2dc6bf10f23a37f16e6",
"score": "0.5825519",
"text": "def alpha_sort(ary)\nn = 0\n\n while n < ary.length\n x = n + 1\n while x < ary.length\n if ary[n].downcase > ary[x].downcase\n ary[x] , ary[n] = ary[n] , ary[x]\n end\n x += 1\n end \n n += 1\n end\nend",
"title": ""
},
{
"docid": "46637aecb32f02eeee299c5159492958",
"score": "0.5817211",
"text": "def order\n { NOVICE => novice,\n MENTOR => mentor,\n MEMBER => member,\n CUSTOM => custom }.compact.sort_by(&:last).to_h.keys.reverse\n end",
"title": ""
},
{
"docid": "62fdbea0411592274f7a5ed7631c2a97",
"score": "0.58166957",
"text": "def alpha_sort(ary)\n change_made = true\n\n while change_made\n change_made = false\n sorted_array = ary[0...-1].each_with_index do |supply, index|\n supply.downcase!\n if supply > ary[index+1]\n ary[index], ary[index+1] = ary[index+1], ary[index]\n change_made = true\n end\n end\n end\n sorted_array\nend",
"title": ""
},
{
"docid": "74b7d71e0e093b0e8e7fcf1b456a1a51",
"score": "0.5815866",
"text": "def two_sort(s)\n s.sort[0].chars.join(\"***\")\nend",
"title": ""
},
{
"docid": "f2fd4a25211aa656c272a45cb7adc5c4",
"score": "0.581502",
"text": "def jumble_sort(str, alpha = nil) # 3 times \n alpha ||= (\"a\"..\"z\").to_a \n sorted = false \n\n until sorted \n sorted = true \n\n (0...str.length - 1).to_a.each do |i|\n if alpha.index(str[i]) > alpha.index(str[i + 1])\n str[i], str[i + 1] = str[i + 1], str[i]\n sorted = false \n end \n end \n end \n\n str \nend",
"title": ""
},
{
"docid": "587c6961100882b16a05d253014c3c1a",
"score": "0.5811927",
"text": "def sort_name\n n = \"#{self.last_name}, #{self.first_name}\"\n if self.middle_name.present?\n n += \" #{self.middle_name}\"\n end\n n\n end",
"title": ""
},
{
"docid": "cc2e3d635772d299b96d55ff112133a8",
"score": "0.58041495",
"text": "def sort_sym\n self.sort {|a,b| a.to_s <=> b.to_s }\n end",
"title": ""
},
{
"docid": "98c5c506300da566a6418fc533bb654f",
"score": "0.5802359",
"text": "def jumble_sort(str, alphabet = nil) #equivalent to bubble_sort\n alphabet ||= (\"a\"..\"z\").to_a\n sorted = false\n characters = str.chars\n until sorted\n sorted = true \n characters.each_with_index do |char, idx|\n next if idx == characters.length - 1\n if alphabet.index(char) > alphabet.index(characters[idx+1])\n sorted = false\n characters[idx], characters[idx+1] = characters[idx+1], characters[idx]\n end\n end\n end\n characters.join\nend",
"title": ""
},
{
"docid": "aae21dc09f0c1a9c8a0abbeba4bff503",
"score": "0.5796716",
"text": "def sorted(items)\n items.sort do |a, b|\n if a.abbreviation && b.abbreviation\n a.abbreviation.downcase <=> b.abbreviation.downcase\n else\n a.title.downcase <=> b.abbreviation.try(:downcase)\n end\n a.partner_led.to_s <=> b.partner_led.to_s\n end\n end",
"title": ""
},
{
"docid": "617d3b3b53fd38d3cd5c44e90ed8c335",
"score": "0.57943916",
"text": "def additional_code_sort\n if additional_code && additional_code.code.to_s.include?(\"999\")\n \"A000\"\n else\n additional_code.code.to_s\n end\n end",
"title": ""
},
{
"docid": "fdea8d1c42fb67fe24a6c8ca828dfd32",
"score": "0.5793941",
"text": "def my_sort(vowel_words)\n done = false\n loop_times = vowel_words.size-1\n while !done\n done = true\n loop_times.times do |order|\n if vowel_words[order].size > vowel_words[order+1].size\n vowel_words[order],vowel_words[order+1] =vowel_words[order+1],vowel_words[order]\n done =false\n end\n end \n end\n return vowel_words\nend",
"title": ""
},
{
"docid": "9d4be4be76f670d976eab8851d33662f",
"score": "0.5790219",
"text": "def sorted(word) \n\treturn word.split('').sort { |a, b| a.casecmp(b) } .join\nend",
"title": ""
},
{
"docid": "288975bb654deeb64ce92cc3b5996244",
"score": "0.57829374",
"text": "def match_when_sorted?; end",
"title": ""
},
{
"docid": "11c33c0b3c84902b87cafb9d2ca2a3e5",
"score": "0.578025",
"text": "def array_sort_by_last_letter_of_word(array)\n array.sort{ |x,y| y.reverse <=> x.reverse }.reverse \nend",
"title": ""
},
{
"docid": "746e0c8be13b1a0e74c78c8d11374db8",
"score": "0.5779798",
"text": "def jumble_sort(str, alphabet = nil)\n alphabet ||= ('a'..'z').to_a\n\n sorted = false\n until sorted # or while !sorted\n sorted = true\n (0...str.length - 1).to_a.each do |i| # .to_a not necessary\n if alphabet.index(str[i]) > alphabet.index(str[i + 1])\n str[i], str[i + 1] = str[i + 1], str[i]\n sorted = false\n end\n end\n end\n str\nend",
"title": ""
},
{
"docid": "109058f9501c903f1902eb8cd274fbab",
"score": "0.57774127",
"text": "def alphabetize(arr, rev=false)\n if rev\n arr.sort! { |item1, item2| item2 <=> item1}\n else\n arr.sort! \n end\n end",
"title": ""
},
{
"docid": "d66126312f96ced00f84045c1f071e5e",
"score": "0.57757515",
"text": "def alphabetize(arr, rev=false) \n if rev \n arr.sort!.reverse!\n else \n arr.sort! { |x,y| x <=> y }\n end \nend",
"title": ""
},
{
"docid": "bfc3c0dd302b34ed37d445bcc2960b1a",
"score": "0.5774255",
"text": "def jumble_sort(str, alphabet = nil)\n\n\n\nend",
"title": ""
},
{
"docid": "69c392cb722bdfd54b48677a8154bbc3",
"score": "0.5767823",
"text": "def alphabetize(arr)\n # code here\n\n if arr.length == 1\n return arr\n end\n\n swapped = true\n\n while swapped do\n swapped = false\n 0.upto(arr.size-2) do |arr_index|\n word_index = 0\n\n if arr[arr_index].split(\"\")[word_index] > arr[arr_index+1].split(\"\")[word_index]\n arr[arr_index], arr[arr_index+1] = arr[arr_index+1], arr[arr_index]\n swapped = true\n elsif arr[arr_index].split(\"\")[word_index] == arr[arr_index+1].split(\"\")[word_index]\n word_index += 1\n end\n end\n end\n\n arr\nend",
"title": ""
},
{
"docid": "4068263fdb617dbe7ed560d03b75a54a",
"score": "0.57619774",
"text": "def pairing_order\n @people.sort.reverse\n end",
"title": ""
},
{
"docid": "d1a72a7e5606ace6dd8efbbef7c57224",
"score": "0.57610756",
"text": "def jumble_sort(str, alphabet = nil)\n alphabet ||= ('a'..'z').to_a\n sorted = false\n until sorted\n sorted = true\n str.length.times do |i|\n break if i == (str.length - 1)\n if alphabet.index(str[i]) > alphabet.index(str[i + 1])\n str[i], str[i + 1] = str[i + 1], str[i]\n sorted = false\n end\n end\n end\n str\nend",
"title": ""
},
{
"docid": "6020223ff1aebf4bb091bed19d6819c7",
"score": "0.57599926",
"text": "def getSortedWord(word)\n if(word.is_a?(String))\n word.downcase.chars.to_a.sort.join(\"\")\n end\nend",
"title": ""
},
{
"docid": "9b6abb601066b8b1da21a1bf5fa0cca9",
"score": "0.5759048",
"text": "def alphabetize(arr, rev= true)\nif rev == true\n puts arr.sort! { |first, second| first <=> second }\nelse\n puts arr.sort! { |first, second| second <=> first }\nend\nend",
"title": ""
},
{
"docid": "4348567e17013fba4dc7e275a44c1dcb",
"score": "0.57537353",
"text": "def jumble_sort(str, alphabet = nil)\n alphabet ||= ('a'..'z').to_a\n array = str.chars.sort_by {|char| alphabet.index(char)}\n array.join\nend",
"title": ""
},
{
"docid": "c8dcefa4d7f831743b1b9767ec4b0127",
"score": "0.5751502",
"text": "def sort_string(first, second)\n p first.chars.sort_by{|char| second.index(char) || second.size}.join\nend",
"title": ""
},
{
"docid": "23be9562a16e32cf456d0ef67885a28b",
"score": "0.57504404",
"text": "def alphabetize(arr, rev=false)\n if rev\n arr.sort! {|first, second| second <=> first }\n else\n arr.sort! {|first, second| first <=> second }\n end\nend",
"title": ""
},
{
"docid": "8e456909057b66faa9effbc16da1511f",
"score": "0.5742851",
"text": "def shows_by_alphabetical_order\n\tend",
"title": ""
},
{
"docid": "e16f6cb6f3e31f4800922e5fb8148df3",
"score": "0.57398015",
"text": "def alphabetize(ary, bool)\n if bool\n ary.sort{ |item1, item2| item2 <=> item1}\n else\n ary.sort{ |item1, item2| item1 <=> item2}\n end\nend",
"title": ""
},
{
"docid": "f40bdfd9c6ddfff46b1092ebbce9e903",
"score": "0.5739239",
"text": "def the_sort(array, sorted_array, unsorted_array, capitalized_words)\n # Array for holding the current lowest word\n low_word = []\n # Array for holding the current word\n current_word = []\n\n array.each do |word|\n # Check word for capitalization, and if capitalized push to capitalized words\n capitalized_words.push(word) if capitalized?(word) == true\n # Downcase word to prepare for sort\n word = word.downcase\n # Set the word from the array to be the current word\n current_word.replace([word])\n # Push the word into the low word array if it's empty\n low_word.push(word) if low_word.empty? == true\n\n # If current word is greater than low word, and unsorted array doesn't already include it, push word to it\n if current_word.to_s > low_word.to_s && unsorted_array.include?(word) == false\n unsorted_array.push(word)\n\n # If current word is less than low word, and unsorted array doesn't already include it, push word to it\n elsif current_word.to_s < low_word.to_s && unsorted_array.include?(low_word) == false\n unsorted_array.push(low_word.at(0))\n # Replace the low word with the current |word|\n low_word.replace([word])\n end\n end\n # Put the low word from this iteration in the sorted array\n sorted_array.push(low_word.at(0))\n # Delete the low word from this iteration if unsorted array contains it. It will be removed from the next iteration\n unsorted_array.delete_if { |word| word == low_word.at(0) }\nend",
"title": ""
},
{
"docid": "f40bdfd9c6ddfff46b1092ebbce9e903",
"score": "0.57390535",
"text": "def the_sort(array, sorted_array, unsorted_array, capitalized_words)\n # Array for holding the current lowest word\n low_word = []\n # Array for holding the current word\n current_word = []\n\n array.each do |word|\n # Check word for capitalization, and if capitalized push to capitalized words\n capitalized_words.push(word) if capitalized?(word) == true\n # Downcase word to prepare for sort\n word = word.downcase\n # Set the word from the array to be the current word\n current_word.replace([word])\n # Push the word into the low word array if it's empty\n low_word.push(word) if low_word.empty? == true\n\n # If current word is greater than low word, and unsorted array doesn't already include it, push word to it\n if current_word.to_s > low_word.to_s && unsorted_array.include?(word) == false\n unsorted_array.push(word)\n\n # If current word is less than low word, and unsorted array doesn't already include it, push word to it\n elsif current_word.to_s < low_word.to_s && unsorted_array.include?(low_word) == false\n unsorted_array.push(low_word.at(0))\n # Replace the low word with the current |word|\n low_word.replace([word])\n end\n end\n # Put the low word from this iteration in the sorted array\n sorted_array.push(low_word.at(0))\n # Delete the low word from this iteration if unsorted array contains it. It will be removed from the next iteration\n unsorted_array.delete_if { |word| word == low_word.at(0) }\nend",
"title": ""
},
{
"docid": "f40bdfd9c6ddfff46b1092ebbce9e903",
"score": "0.57390535",
"text": "def the_sort(array, sorted_array, unsorted_array, capitalized_words)\n # Array for holding the current lowest word\n low_word = []\n # Array for holding the current word\n current_word = []\n\n array.each do |word|\n # Check word for capitalization, and if capitalized push to capitalized words\n capitalized_words.push(word) if capitalized?(word) == true\n # Downcase word to prepare for sort\n word = word.downcase\n # Set the word from the array to be the current word\n current_word.replace([word])\n # Push the word into the low word array if it's empty\n low_word.push(word) if low_word.empty? == true\n\n # If current word is greater than low word, and unsorted array doesn't already include it, push word to it\n if current_word.to_s > low_word.to_s && unsorted_array.include?(word) == false\n unsorted_array.push(word)\n\n # If current word is less than low word, and unsorted array doesn't already include it, push word to it\n elsif current_word.to_s < low_word.to_s && unsorted_array.include?(low_word) == false\n unsorted_array.push(low_word.at(0))\n # Replace the low word with the current |word|\n low_word.replace([word])\n end\n end\n # Put the low word from this iteration in the sorted array\n sorted_array.push(low_word.at(0))\n # Delete the low word from this iteration if unsorted array contains it. It will be removed from the next iteration\n unsorted_array.delete_if { |word| word == low_word.at(0) }\nend",
"title": ""
},
{
"docid": "4324303e8044bc321906f51fc4134b58",
"score": "0.5736882",
"text": "def alphabetize arr, rev=false\n\nend",
"title": ""
},
{
"docid": "4dd067afe6b2276bdc69b18d5d012bfd",
"score": "0.5735477",
"text": "def sort!\n @nominations.sort!\n @nominations.reverse!\n return self\n end",
"title": ""
},
{
"docid": "4f69a32669d8460a8b0006e3052e85c2",
"score": "0.57328945",
"text": "def sort_by_unit_letter(results)\n n = results.length\n loop do\n swapped = false\n (n-1).times do |i|\n if results[i][/\\d+/] == results[i+1][/\\d+/]\n if results[i][/[a-z]/i] > results[i+1][/[a-z]/i]\n results[i], results[i+1] = results[i+1], results[i]\n swapped = true\n end\n end\n end\n break unless swapped\n end\n results\n end",
"title": ""
},
{
"docid": "0e617dd1d62cb9ce66558f12ec7aa752",
"score": "0.57326365",
"text": "def order\n @_ordr.join(', ')\n end",
"title": ""
},
{
"docid": "6bbf1bf43623bd2d209394f41944fc24",
"score": "0.57316136",
"text": "def jumble_sort(str, alphabet = nil)\n\n alphabet ||= \"abcdefghijklmnopqrstuvwxyz\"\n\n sorted = false\n i = 0\n while !sorted\n sorted = true\n\n while i < str.length - 1\n if alphabet.index(str[i]) > alphabet.index(str[i + 1])\n str[i], str[i + 1] = str[i + 1], str[i]\n sorted = false\n end\n i += 1\n end\n end\nstr\nend",
"title": ""
},
{
"docid": "bf92f725f6a638ef3ee3191b500768f2",
"score": "0.5727158",
"text": "def ordered_children\n children.sort_by { |c| [c.sort_order, c.string_key] }\n end",
"title": ""
},
{
"docid": "5c6944facf66b814af65c173226ac6ef",
"score": "0.57269293",
"text": "def alphabetize(arr, rev=false)\n arr.sort!\n if rev\n arr.reverse!\n end\nend",
"title": ""
},
{
"docid": "df4387f639b6a583e2097ffc1b542af4",
"score": "0.57206774",
"text": "def sort_words(x, y)\n index = 0\n while index >= 0\n case sort_letters(x[index], y[index])\n when 1\n then return 1\n when -1\n then return -1\n end\n index += 1\n return 0 if x[index] == nil && y[index] == nil\n if x[index] == nil\n return -1\n else\n return 1 if y[index] == nil\n end\n end\nend",
"title": ""
},
{
"docid": "2543f62c4f4b63f1927b0f009af9a1f4",
"score": "0.5719159",
"text": "def sortish\n @sortish ||= real.downcase.normalize\n end",
"title": ""
},
{
"docid": "e0b7009a02bf924fa1f6e8c2b21e7205",
"score": "0.5718805",
"text": "def two_sort(s)\n s = s.sort\n s[0].split(//).join('***')\nend",
"title": ""
},
{
"docid": "8c8d8427b318bf7ecd7a76082af8cdad",
"score": "0.5714128",
"text": "def alphabetize (arr)\n return arr.sort\nend",
"title": ""
},
{
"docid": "543469941181125b8f6f750bbde647eb",
"score": "0.5713768",
"text": "def alphabetize(arr,rev=false)\n if rev\n arr.reverse!\n else\n arr.sort!\n end\nend",
"title": ""
},
{
"docid": "f02872190096161207d74abd002aeb4e",
"score": "0.57129276",
"text": "def sort_by_name_asc\n logger.info 'Sorting by \"Name\" ascending'\n wait_for_update_and_click_js sort_by_name_element\n sort_by_name unless sort_asc?\n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60
|
Never trust parameters from the scary internet, only allow the white list through.
|
[
{
"docid": "e748346e7e90f7fe0b64f4391a48d11e",
"score": "0.0",
"text": "def career_subject_params\n params.fetch(:career_subject, {})\n end",
"title": ""
}
] |
[
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.69792545",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6781151",
"text": "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "1677b416ad07c203256985063859691b",
"score": "0.67419964",
"text": "def allow_params_authentication!; end",
"title": ""
},
{
"docid": "c1f317213d917a1e3cfa584197f82e6c",
"score": "0.674013",
"text": "def allowed_params\n ALLOWED_PARAMS\n end",
"title": ""
},
{
"docid": "547b7ab7c31effd8dcf394d3d38974ff",
"score": "0.6734356",
"text": "def default_param_whitelist\n [\"mode\"]\n end",
"title": ""
},
{
"docid": "a91e9bf1896870368befe529c0e977e2",
"score": "0.6591046",
"text": "def param_whitelist\n [:role, :title]\n end",
"title": ""
},
{
"docid": "b32229655ba2c32ebe754084ef912a1a",
"score": "0.6502396",
"text": "def expected_permitted_parameter_names; end",
"title": ""
},
{
"docid": "3a9a65d2bba924ee9b0f67cb77596482",
"score": "0.6496313",
"text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"title": ""
},
{
"docid": "068f8502695b7c7f6d382f8470180ede",
"score": "0.6480641",
"text": "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.6477825",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "c04a150a23595af2a3d515d0dfc34fdd",
"score": "0.64565",
"text": "def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "9a2a1af8f52169bd818b039ef030f513",
"score": "0.6438387",
"text": "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"title": ""
},
{
"docid": "c5f294dd85260b1f3431a1fbbc1fb214",
"score": "0.63791263",
"text": "def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "631f07548a1913ef9e20ecf7007800e5",
"score": "0.63740575",
"text": "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"title": ""
},
{
"docid": "9735bbaa391eab421b71a4c1436d109e",
"score": "0.6364131",
"text": "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "12fa2760f5d16a1c46a00ddb41e4bce2",
"score": "0.63192815",
"text": "def param_whitelist\n [:rating, :review]\n end",
"title": ""
},
{
"docid": "f12336a181f3c43ac8239e5d0a59b5b4",
"score": "0.62991166",
"text": "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "c25a1ea70011796c8fcd4927846f7a04",
"score": "0.62978333",
"text": "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "822c743e15dd9236d965d12beef67e0c",
"score": "0.6292148",
"text": "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"title": ""
},
{
"docid": "7f0fd756d3ff6be4725a2c0449076c58",
"score": "0.6290449",
"text": "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"title": ""
},
{
"docid": "9d23b31178b8be81fe8f1d20c154336f",
"score": "0.6290076",
"text": "def valid_params_request?; end",
"title": ""
},
{
"docid": "533f1ba4c3ab55e79ed9b259f67a70fb",
"score": "0.62894756",
"text": "def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "5f16bb22cb90bcfdf354975d17e4e329",
"score": "0.6283177",
"text": "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"title": ""
},
{
"docid": "1dfca9e0e667b83a9e2312940f7dc40c",
"score": "0.6242471",
"text": "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"title": ""
},
{
"docid": "a44360e98883e4787a9591c602282c4b",
"score": "0.62382483",
"text": "def allowed_params\n params.require(:allowed).permit(:email)\n end",
"title": ""
},
{
"docid": "4fc36c3400f3d5ca3ad7dc2ed185f213",
"score": "0.6217549",
"text": "def permitted_params\n []\n end",
"title": ""
},
{
"docid": "7a218670e6f6c68ab2283e84c2de7ba8",
"score": "0.6214457",
"text": "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"title": ""
},
{
"docid": "b074031c75c664c39575ac306e13028f",
"score": "0.6209053",
"text": "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"title": ""
},
{
"docid": "0cb77c561c62c78c958664a36507a7c9",
"score": "0.6193042",
"text": "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"title": ""
},
{
"docid": "9892d8126849ccccec9c8726d75ff173",
"score": "0.6177802",
"text": "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e3089e0811fa34ce509d69d488c75306",
"score": "0.6174604",
"text": "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"title": ""
},
{
"docid": "7b7196fbaee9e8777af48e4efcaca764",
"score": "0.61714715",
"text": "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"title": ""
},
{
"docid": "9d589006a5ea3bb58e5649f404ab60fb",
"score": "0.6161512",
"text": "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"title": ""
},
{
"docid": "d578c7096a9ab2d0edfc431732f63e7f",
"score": "0.6151757",
"text": "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "38a9fb6bd1d9ae5933b748c181928a6b",
"score": "0.6150663",
"text": "def safe_params\n params.require(:user).permit(:name)\n end",
"title": ""
},
{
"docid": "7a6fbcc670a51834f69842348595cc79",
"score": "0.61461",
"text": "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"title": ""
},
{
"docid": "fe4025b0dd554f11ce9a4c7a40059912",
"score": "0.61213595",
"text": "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.611406",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "60ccf77b296ed68c1cb5cb262bacf874",
"score": "0.6106206",
"text": "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "3c8ffd5ef92e817f2779a9c56c9fc0e9",
"score": "0.6105114",
"text": "def quote_params\n params.permit!\n end",
"title": ""
},
{
"docid": "86b2d48cb84654e19b91d9d3cbc2ff80",
"score": "0.6089039",
"text": "def valid_params?; end",
"title": ""
},
{
"docid": "34d018968dad9fa791c1df1b3aaeccd1",
"score": "0.6081015",
"text": "def paramunold_params\n params.require(:paramunold).permit!\n end",
"title": ""
},
{
"docid": "6d41ae38c20b78a3c0714db143b6c868",
"score": "0.6071004",
"text": "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"title": ""
},
{
"docid": "c436017f4e8bd819f3d933587dfa070a",
"score": "0.60620916",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "49052f91dd936c0acf416f1b9e46cf8b",
"score": "0.6019971",
"text": "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"title": ""
},
{
"docid": "5eaf08f3ad47cc781c4c1a5453555b9c",
"score": "0.601788",
"text": "def filtering_params\n params.permit(:email, :name)\n end",
"title": ""
},
{
"docid": "5ee931ad3419145387a2dc5a284c6fb6",
"score": "0.6011056",
"text": "def check_params\n true\n end",
"title": ""
},
{
"docid": "3b17d5ad24c17e9a4c352d954737665d",
"score": "0.6010898",
"text": "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.6005122",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.6005122",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "74c092f6d50c271d51256cf52450605f",
"score": "0.6001556",
"text": "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"title": ""
},
{
"docid": "75415bb78d3a2b57d539f03a4afeaefc",
"score": "0.6001049",
"text": "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"title": ""
},
{
"docid": "bb32aa218785dcd548537db61ecc61de",
"score": "0.59943926",
"text": "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"title": ""
},
{
"docid": "65fa57add93316c7c8c6d8a0b4083d0e",
"score": "0.5992201",
"text": "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"title": ""
},
{
"docid": "865a5fdd77ce5687a127e85fc77cd0e7",
"score": "0.59909594",
"text": "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"title": ""
},
{
"docid": "ec609e2fe8d3137398f874bf5ef5dd01",
"score": "0.5990628",
"text": "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"title": ""
},
{
"docid": "423b4bad23126b332e80a303c3518a1e",
"score": "0.5980841",
"text": "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"title": ""
},
{
"docid": "48e86c5f3ec8a8981d8293506350accc",
"score": "0.59669393",
"text": "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"title": ""
},
{
"docid": "9f774a9b74e6cafa3dd7fcc914400b24",
"score": "0.59589154",
"text": "def active_code_params\n params[:active_code].permit\n end",
"title": ""
},
{
"docid": "a573514ae008b7c355d2b7c7f391e4ee",
"score": "0.5958826",
"text": "def filtering_params\n params.permit(:email)\n end",
"title": ""
},
{
"docid": "2202d6d61570af89552803ad144e1fe7",
"score": "0.5957911",
"text": "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"title": ""
},
{
"docid": "8b571e320cf4baff8f6abe62e4143b73",
"score": "0.5957385",
"text": "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"title": ""
},
{
"docid": "d493d59391b220488fdc1f30bd1be261",
"score": "0.5953072",
"text": "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"title": ""
},
{
"docid": "f18c8e1c95a8a21ba8cd6fbc6d4d524a",
"score": "0.59526145",
"text": "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"title": ""
},
{
"docid": "4e6017dd56aab21951f75b1ff822e78a",
"score": "0.5943361",
"text": "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"title": ""
},
{
"docid": "67fe19aa3f1169678aa999df9f0f7e95",
"score": "0.59386164",
"text": "def list_params\n params.permit(:name)\n end",
"title": ""
},
{
"docid": "bd826c318f811361676f5282a9256071",
"score": "0.59375334",
"text": "def filter_parameters; end",
"title": ""
},
{
"docid": "bd826c318f811361676f5282a9256071",
"score": "0.59375334",
"text": "def filter_parameters; end",
"title": ""
},
{
"docid": "5060615f2c808bab2d45f4d281987903",
"score": "0.5933856",
"text": "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"title": ""
},
{
"docid": "7fa620eeb32e576da67f175eea6e6fa0",
"score": "0.59292704",
"text": "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"title": ""
},
{
"docid": "d9483565c400cd4cb1096081599a7afc",
"score": "0.59254247",
"text": "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"title": ""
},
{
"docid": "f7c6dad942d4865bdd100b495b938f50",
"score": "0.5924164",
"text": "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"title": ""
},
{
"docid": "70fa55746056e81854d70a51e822de66",
"score": "0.59167904",
"text": "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"title": ""
},
{
"docid": "3683f6af8fc4e6b9de7dc0c83f88b6aa",
"score": "0.59088355",
"text": "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"title": ""
},
{
"docid": "3eef50b797f6aa8c4def3969457f45dd",
"score": "0.5907542",
"text": "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"title": ""
},
{
"docid": "753b67fc94e3cd8d6ff2024ce39dce9f",
"score": "0.59064597",
"text": "def url_whitelist; end",
"title": ""
},
{
"docid": "f9f0da97f7ea58e1ee2a5600b2b79c8c",
"score": "0.5906243",
"text": "def admin_social_network_params\n params.require(:social_network).permit!\n end",
"title": ""
},
{
"docid": "5bdab99069d741cb3414bbd47400babb",
"score": "0.5898226",
"text": "def filter_params\n params.require(:filters).permit(:letters)\n end",
"title": ""
},
{
"docid": "7c5ee86a81b391c12dc28a6fe333c0a8",
"score": "0.589687",
"text": "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"title": ""
},
{
"docid": "de77f0ab5c853b95989bc97c90c68f68",
"score": "0.5896091",
"text": "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "29d030b36f50179adf03254f7954c362",
"score": "0.5894501",
"text": "def sensitive_params=(params)\n @sensitive_params = params\n end",
"title": ""
},
{
"docid": "bf321f5f57841bb0f8c872ef765f491f",
"score": "0.5894289",
"text": "def permit_request_params\n params.permit(:address)\n end",
"title": ""
},
{
"docid": "5186021506f83eb2f6e244d943b19970",
"score": "0.5891739",
"text": "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"title": ""
},
{
"docid": "b85a12ab41643078cb8da859e342acd5",
"score": "0.58860534",
"text": "def secure_params\n params.require(:location).permit(:name)\n end",
"title": ""
},
{
"docid": "46e104db6a3ac3601fe5904e4d5c425c",
"score": "0.5882406",
"text": "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"title": ""
},
{
"docid": "abca6170eec412a7337563085a3a4af2",
"score": "0.587974",
"text": "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"title": ""
},
{
"docid": "26a35c2ace1a305199189db9e03329f1",
"score": "0.58738774",
"text": "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"title": ""
},
{
"docid": "de49fd084b37115524e08d6e4caf562d",
"score": "0.5869024",
"text": "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"title": ""
},
{
"docid": "7b7ecfcd484357c3ae3897515fd2931d",
"score": "0.58679986",
"text": "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"title": ""
},
{
"docid": "0016f219c5d958f9b730e0824eca9c4a",
"score": "0.5867561",
"text": "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"title": ""
},
{
"docid": "8aa9e548d99691623d72891f5acc5cdb",
"score": "0.5865932",
"text": "def url_params\n params[:url].permit(:full)\n end",
"title": ""
},
{
"docid": "c6a8b768bfdeb3cd9ea388cd41acf2c3",
"score": "0.5864461",
"text": "def backend_user_params\n params.permit!\n end",
"title": ""
},
{
"docid": "be95d72f5776c94cb1a4109682b7b224",
"score": "0.58639693",
"text": "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"title": ""
},
{
"docid": "967c637f06ec2ba8f24e84f6a19f3cf5",
"score": "0.58617616",
"text": "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"title": ""
},
{
"docid": "e4a29797f9bdada732853b2ce3c1d12a",
"score": "0.5861436",
"text": "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"title": ""
},
{
"docid": "d14f33ed4a16a55600c556743366c501",
"score": "0.5860451",
"text": "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"title": ""
},
{
"docid": "46cb58d8f18fe71db8662f81ed404ed8",
"score": "0.58602303",
"text": "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"title": ""
},
{
"docid": "7e9a6d6c90f9973c93c26bcfc373a1b3",
"score": "0.5854586",
"text": "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"title": ""
},
{
"docid": "ad61e41ab347cd815d8a7964a4ed7947",
"score": "0.58537364",
"text": "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"title": ""
},
{
"docid": "8894a3d0d0ad5122c85b0bf4ce4080a6",
"score": "0.5850427",
"text": "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"title": ""
},
{
"docid": "53d84ad5aa2c5124fa307752101aced3",
"score": "0.5850199",
"text": "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end",
"title": ""
}
] |
74a8f7d747be5100921fa66edf31bb93
|
Create a new RDS instance from a pointintime system snapshot. The target database is created from the source database restore point with the same configuration as the original source database, except that the new RDS instance is created with the default security group.
|
[
{
"docid": "7a7ca1d14ea3b9c5d70fdb88361a8584",
"score": "0.5983158",
"text": "def restore_db_instance_to_point_in_time(instance_aws_id, new_instance_aws_id, restore_time)\n request_hash = { 'SourceDBInstanceIdentifier' => instance_aws_id,\n 'TargetDBInstanceIdentifier' => new_instance_aws_id,\n 'RestoreTime' => restore_time}\n link = generate_request('RestoreDBInstanceToPointInTime', request_hash)\n request_info(link, DescribeDbInstancesParser.new(:logger => @logger))[:db_instances].first\n end",
"title": ""
}
] |
[
{
"docid": "05ec74c1f5034f2652882292692a3324",
"score": "0.7770507",
"text": "def create_tmp_rds_from_snapshot\n unless @new_instance\n update_status \"Waiting for snapshot #{@snapshot_id}\"\n @snapshot.wait_for { ready? }\n update_status \"Booting new RDS #{@new_rds_id} from snapshot #{@snapshot.id}\"\n @rds.restore_db_instance_from_db_snapshot(@snapshot.id,\n @new_rds_id, 'DBInstanceClass' => @original_server.flavor_id)\n @new_instance = @rds.servers.get @new_rds_id\n end\n end",
"title": ""
},
{
"docid": "cddfda3118613c8c7ca7a614c5d910e2",
"score": "0.6928143",
"text": "def snapshot_original_rds\n unless @new_instance || @snapshot\n update_status \"Waiting for RDS instance #{@original_server.id}\"\n @original_server.wait_for { ready? }\n update_status \"Creating snapshot #{@snapshot_id} from RDS #{rds_id}\"\n @snapshot = @rds.snapshots.create(id: @snapshot_id, instance_id: rds_id)\n end\n end",
"title": ""
},
{
"docid": "a719b00d2d77166f9fd538266656840b",
"score": "0.68822545",
"text": "def create_snapshot(options = {})\n # If no name is specified, use a simple timestamp appended to the instance identifier\n name = options.key?(:name) ? options[:name] : \"#{id}-#{Time.now.strftime('%Y%m%d-%H%M%S')}\"\n \n aws_client.action do |client|\n # Output some text if we're being verbose\n puts \">> Creating RDS Snapshot #{name}\".green if options[:verbose]\n client.create_db_snapshot(\n db_instance_identifier: id,\n db_snapshot_identifier: name\n )\n end\n end",
"title": ""
},
{
"docid": "3818b93051494c5ccb5c42baf21f8dd2",
"score": "0.6690297",
"text": "def createNewSnapshot\n snap_id = @deploy.getResourceName(@config[\"name\"]) + Time.new.strftime(\"%M%S\").to_s\n src_ref = MU::Config::Ref.get(@config[\"source\"])\n src_ref.kitten(@deploy)\n if !src_ref.id\n raise MuError.new \"#{@mu_name} failed to get an id from reference for creating a snapshot\", details: @config['source']\n end\n params = {\n :tags => @tags.each_key.map { |k| { :key => k, :value => @tags[k] } }\n }\n if @config[\"create_cluster\"]\n params[:db_cluster_snapshot_identifier] = snap_id\n params[:db_cluster_identifier] = src_ref.id\n else\n params[:db_snapshot_identifier] = snap_id\n params[:db_instance_identifier] = src_ref.id\n end\n\n MU.retrier([Aws::RDS::Errors::InvalidDBInstanceState, Aws::RDS::Errors::InvalidDBClusterStateFault], wait: 60, max: 10) {\n MU::Cloud::AWS.rds(region: @region, credentials: @credentials).send(\"create_db_#{@config['create_cluster'] ? \"cluster_\" : \"\"}snapshot\".to_sym, params)\n }\n\n loop_if = Proc.new {\n if @config[\"create_cluster\"]\n MU::Cloud::AWS.rds(region: @region, credentials: @credentials).describe_db_cluster_snapshots(db_cluster_snapshot_identifier: snap_id).db_cluster_snapshots.first.status != \"available\"\n else\n MU::Cloud::AWS.rds(region: @region, credentials: @credentials).describe_db_snapshots(db_snapshot_identifier: snap_id).db_snapshots.first.status != \"available\"\n end\n }\n\n MU.retrier(wait: 15, loop_if: loop_if) { |retries, _wait|\n MU.log \"Waiting for RDS snapshot of #{src_ref.id} to be ready...\", MU::NOTICE if retries % 20 == 0\n }\n\n return snap_id\n end",
"title": ""
},
{
"docid": "d28dc053f1c9dc4ddfb35967e4f3c530",
"score": "0.66181654",
"text": "def createNewSnapshot\n\t\t\tsnap_id = MU::MommaCat.getResourceName(@db[\"name\"]) + Time.new.strftime(\"%M%S\").to_s\n\n\t\t\tattempts = 0\n\t\t\tbegin\n\t\t\t\tsnapshot = MU.rds(@db['region']).create_db_snapshot(\n\t\t\t\t\tdb_snapshot_identifier: snap_id,\n\t\t\t\t\tdb_instance_identifier: @db[\"identifier\"]\n\t\t\t\t)\n\t\t\trescue Aws::RDS::Errors::InvalidDBInstanceState => e\n\t\t\t\traise e if attempts >= 10\n\t\t\t\tattempts += 1\n\t\t\t\tsleep 60\n\t\t\t\tretry\n\t\t\tend\n\n\t\t\taddStandardTags(snap_id, \"snapshot\", region: @db['region'])\n\n\t\t\t\n\t\t\tattempts = 0\n\t\t\tloop do\n\t\t\t\tMU.log \"Waiting for RDS snapshot of #{@db[\"identifier\"];} to be ready...\", MU::NOTICE if attempts % 20 == 0\n\t\t\t\tMU.log \"Waiting for RDS snapshot of #{@db[\"identifier\"];} to be ready...\", MU::DEBUG\n\t\t\t\tsnapshot_resp = MU.rds(@db['region']).describe_db_snapshots(\n\t\t\t\t\tdb_snapshot_identifier: snap_id,\n\t\t\t\t)\n\t\t\t\tattempts += 1\n\t\t\t\tsleep 15\n\t\t\t\tbreak unless snapshot_resp.db_snapshots.first.status != \"available\"\n\t\t\tend\n\n\t\t\treturn snap_id\n\t\tend",
"title": ""
},
{
"docid": "682ad8d4e91a45c50b25d681d4b04566",
"score": "0.6519574",
"text": "def create_snapshot(options)\n db_name = options.fetch(:db_name, 'my-snapshot')\n snapshot_name = get_snapshot_name(db_name)\n rds_client.create_db_snapshot(db_instance_identifier: db_name, db_snapshot_identifier: snapshot_name)\n\n Retryable.retryable(:tries => 15, :sleep => lambda { |n| 2**n }, :on => StandardError) do |retries, exception|\n response = rds_client.describe_db_snapshots(db_snapshot_identifier: snapshot_name)\n\n snapshot = response.db_snapshots.find { |s| s.db_snapshot_identifier == snapshot_name }\n status = snapshot.status\n percent_progress = snapshot.percent_progress\n puts \"RDS Snapshot #{snapshot_name} status: #{status}, progress #{percent_progress}%\"\n raise StandardError if status != AwsPocketknife::Rds::AVAILABLE\n end\n\n end",
"title": ""
},
{
"docid": "74201894d7a78b36c3c35a8b1c75e149",
"score": "0.64420366",
"text": "def create_snapshot(options = {})\n @ec2.create_snapshot id, options\n end",
"title": ""
},
{
"docid": "f3c068cab66c867dee38a256c0ad6400",
"score": "0.6348007",
"text": "def create_snapshot\n return nil if ebs_volume_id.nil?\n ec2.create_snapshot(:volume_id => ebs_volume_id)\n end",
"title": ""
},
{
"docid": "f3c068cab66c867dee38a256c0ad6400",
"score": "0.6348007",
"text": "def create_snapshot\n return nil if ebs_volume_id.nil?\n ec2.create_snapshot(:volume_id => ebs_volume_id)\n end",
"title": ""
},
{
"docid": "f3c068cab66c867dee38a256c0ad6400",
"score": "0.6348007",
"text": "def create_snapshot\n return nil if ebs_volume_id.nil?\n ec2.create_snapshot(:volume_id => ebs_volume_id)\n end",
"title": ""
},
{
"docid": "bbd4fecf001b511f5efb679062778fb6",
"score": "0.6331386",
"text": "def createNewSnapshot\n snap_id = @deploy.getResourceName(@config[\"name\"]) + Time.new.strftime(\"%M%S\").to_s\n\n attempts = 0\n begin\n snapshot = \n if @config[\"create_cluster\"]\n MU::Cloud::AWS.rds(region: @config['region'], credentials: @config['credentials']).create_db_cluster_snapshot(\n db_cluster_snapshot_identifier: snap_id,\n db_cluster_identifier: @config[\"identifier\"],\n tags: allTags\n )\n else\n MU::Cloud::AWS.rds(region: @config['region'], credentials: @config['credentials']).create_db_snapshot(\n db_snapshot_identifier: snap_id,\n db_instance_identifier: @config[\"identifier\"],\n tags: allTags\n )\n end\n rescue Aws::RDS::Errors::InvalidDBInstanceState, Aws::RDS::Errors::InvalidDBClusterStateFault => e\n raise MuError, e.inspect if attempts >= 10\n attempts += 1\n sleep 60\n retry\n end\n\n attempts = 0\n loop do\n MU.log \"Waiting for RDS snapshot of #{@config[\"identifier\"]} to be ready...\", MU::NOTICE if attempts % 20 == 0\n MU.log \"Waiting for RDS snapshot of #{@config[\"identifier\"]} to be ready...\", MU::DEBUG\n snapshot_resp =\n if @config[\"create_cluster\"]\n MU::Cloud::AWS.rds(region: @config['region'], credentials: @config['credentials']).describe_db_cluster_snapshots(db_cluster_snapshot_identifier: snap_id)\n else\n MU::Cloud::AWS.rds(region: @config['region'], credentials: @config['credentials']).describe_db_snapshots(db_snapshot_identifier: snap_id)\n end\n\n if @config[\"create_cluster\"]\n break unless snapshot_resp.db_cluster_snapshots.first.status != \"available\"\n else\n break unless snapshot_resp.db_snapshots.first.status != \"available\"\n end\n attempts += 1\n sleep 15\n end\n\n return snap_id\n end",
"title": ""
},
{
"docid": "666652b0154c8d07c240deb20a2f6eb6",
"score": "0.6270678",
"text": "def create_cluster_snapshot(rds_resource, multi_az_db_cluster)\n cluster = rds_resource.db_cluster(multi_az_db_cluster)\n id = \"snapshot-#{rand(10**6)}\"\n cluster.create_snapshot({\n db_cluster_snapshot_identifier: id\n })\nrescue Aws::Errors::ServiceError => e\n puts \"Couldn't create Multi-AZ DB cluster snapshot #{id}:\\n#{e.message}\"\nend",
"title": ""
},
{
"docid": "10d218e6d88aae47837f31599ca892a6",
"score": "0.6238785",
"text": "def create_snapshot\n return nil if ebs_volume_id.nil?\n # ec2.create_snapshot(:volume_id => ebs_volume_id)\n end",
"title": ""
},
{
"docid": "2c07c1bdc8853e1faa8fd38fb4452ea3",
"score": "0.6212702",
"text": "def restore_db_instance_to_point_in_time(instance_aws_id, new_instance_aws_id, params={})\n request_hash = { 'SourceDBInstanceIdentifier' => instance_aws_id,\n 'TargetDBInstanceIdentifier' => new_instance_aws_id}\n request_hash['UseLatestRestorableTime'] = params[:use_latest_restorable_time].to_s unless params[:use_latest_restorable_time].nil?\n request_hash['RestoreTime'] = params[:restore_time] unless params[:restore_time].right_blank?\n request_hash['DBInstanceClass'] = params[:instance_class] unless params[:instance_class].right_blank?\n request_hash['MultiAZ'] = params[:multi_az] unless params[:multi_az].nil?\n request_hash['Port'] = params[:endpoint_port] unless params[:endpoint_port].right_blank?\n request_hash['AvailabilityZone'] = params[:availability_zone] unless params[:availability_zone].right_blank?\n request_hash['AutoMinorVersionUpgrade'] = params[:auto_minor_version_upgrade] unless params[:auto_minor_version_upgrade].nil?\n link = generate_request('RestoreDBInstanceToPointInTime', request_hash)\n request_info(link, DescribeDbInstancesParser.new(:logger => @logger))[:db_instances].first\n end",
"title": ""
},
{
"docid": "5f4cc9bd73a07455460e25662933ed02",
"score": "0.61516714",
"text": "def restore_db_instance_from_db_snapshot(snapshot_id, db_name, opts={})\n request({\n 'Action' => 'RestoreDBInstanceFromDBSnapshot',\n 'DBSnapshotIdentifier' => snapshot_id,\n 'DBInstanceIdentifier' => db_name,\n :parser => Fog::Parsers::AWS::RDS::RestoreDBInstanceFromDBSnapshot.new,\n }.merge(opts))\n end",
"title": ""
},
{
"docid": "5f4cc9bd73a07455460e25662933ed02",
"score": "0.61516714",
"text": "def restore_db_instance_from_db_snapshot(snapshot_id, db_name, opts={})\n request({\n 'Action' => 'RestoreDBInstanceFromDBSnapshot',\n 'DBSnapshotIdentifier' => snapshot_id,\n 'DBInstanceIdentifier' => db_name,\n :parser => Fog::Parsers::AWS::RDS::RestoreDBInstanceFromDBSnapshot.new,\n }.merge(opts))\n end",
"title": ""
},
{
"docid": "346715332dee88231d91c361a49f82f7",
"score": "0.6094606",
"text": "def create_snapshot\n s = Snapshot.new group: self\n add_snapshot s\n if $simulate\n LOG.info \"Would have created snapshot '#{s.name}'.\"\n else\n ZSnap.execute \"zfs\", \"snapshot\", s.name\n LOG.info \"Created snapshot '#{s.name}'.\"\n end\n return s\n end",
"title": ""
},
{
"docid": "392b9fb6020d53c5345e3bf8736c6fbd",
"score": "0.59857523",
"text": "def create_db_snapshot(identifier, name)\n request({\n 'Action' => 'CreateDBSnapshot',\n 'DBInstanceIdentifier' => identifier,\n 'DBSnapshotIdentifier' => name,\n :parser => Fog::Parsers::AWS::RDS::CreateDBSnapshot.new\n })\n end",
"title": ""
},
{
"docid": "f78f5e0221dc10c6e616a81f0d10f007",
"score": "0.5961995",
"text": "def create_disconnected_rds(new_rds_name = nil)\n @new_rds_id = new_rds_name if new_rds_name\n prepare_backup unless @original_server # in case run as a convenience method\n snapshot_original_rds\n create_tmp_rds_from_snapshot\n configure_tmp_rds\n wait_for_new_security_group\n wait_for_new_parameter_group # (reboots as needed)\n destroy_snapshot\n end",
"title": ""
},
{
"docid": "5563cf607213b4019b68d64851cba56b",
"score": "0.5923543",
"text": "def run_create_snapshot_from_instance_name(region, instance_name)\n if instance_name != nil\n $LOG.info(\"==> about to run create_from_instance_name #{instance_name} #{region} \")\n %x(rake aws:ebs:snapshot:create_from_instance_name[#{region},#{instance_name}])\n end\n end",
"title": ""
},
{
"docid": "687941452c89cb297b90ec46164799e9",
"score": "0.58828586",
"text": "def prepare_backup\n unless @original_server = RDSBackup.get_rds(rds_id)\n names = RDSBackup.rds_accounts.map {|name, account| name }\n raise \"Unable to find RDS #{rds_id} in accounts #{names.join \", \"}\"\n end\n @account_name = @original_server.tracker_account[:name]\n @rds = ::Fog::AWS::RDS.new(\n RDSBackup.rds_accounts[@account_name][:credentials])\n @snapshot = @rds.snapshots.get @snapshot_id\n @new_instance = @rds.servers.get @new_rds_id\n end",
"title": ""
},
{
"docid": "d60a5cc56ac56e84ec6676834d7e5901",
"score": "0.5823938",
"text": "def createDb\n\n if @config['creation_style'] == \"point_in_time\"\n create_point_in_time\n elsif @config['read_replica_of']\n create_read_replica\n else\n create_basic\n end\n\n wait_until_available\n do_naming\n\n # If referencing an existing DB, insert this deploy's DB security group so it can access the thing\n if @config[\"creation_style\"] == 'existing'\n mod_config = {}\n mod_config[:db_instance_identifier] = @cloud_id\n mod_config[:vpc_security_group_ids] = cloud_desc.vpc_security_groups.map { |sg| sg.vpc_security_group_id }\n\n localdeploy_rule = @deploy.findLitterMate(type: \"firewall_rule\", name: \"database\"+@config['name'])\n if localdeploy_rule.nil?\n raise MU::MuError, \"Database #{@config['name']} failed to find its generic security group 'database#{@config['name']}'\"\n end\n mod_config[:vpc_security_group_ids] << localdeploy_rule.cloud_id\n\n MU::Cloud::AWS.rds(region: @region, credentials: @credentials).modify_db_instance(mod_config)\n MU.log \"Modified database #{@cloud_id} with new security groups: #{mod_config}\", MU::NOTICE\n end\n\n # When creating from a snapshot or replicating an existing database,\n # some of the create arguments that we'd want to carry over aren't\n # applicable- but we can apply them after the fact with a modify.\n if %w{existing_snapshot new_snapshot point_in_time}.include?(@config[\"creation_style\"]) or @config[\"read_replica_of\"]\n mod_config = {\n db_instance_identifier: @cloud_id,\n apply_immediately: true\n }\n if !@config[\"read_replica_of\"] or @region == @config['source'].region\n mod_config[:vpc_security_group_ids] = @config[\"vpc_security_group_ids\"]\n end\n\n if !@config[\"read_replica_of\"]\n mod_config[:preferred_backup_window] = @config[\"preferred_backup_window\"]\n mod_config[:backup_retention_period] = @config[\"backup_retention_period\"]\n mod_config[:engine_version] = @config[\"engine_version\"]\n mod_config[:allow_major_version_upgrade] = @config[\"allow_major_version_upgrade\"] if @config['allow_major_version_upgrade']\n mod_config[:db_parameter_group_name] = @config[\"parameter_group_name\"] if @config[\"parameter_group_name\"]\n mod_config[:master_user_password] = @config['password']\n mod_config[:allocated_storage] = @config[\"storage\"] if @config[\"storage\"]\n end\n if @config[\"preferred_maintenance_window\"]\n mod_config[:preferred_maintenance_window] = @config[\"preferred_maintenance_window\"]\n end\n\n MU::Cloud::AWS.rds(region: @region, credentials: @credentials).modify_db_instance(mod_config)\n wait_until_available\n end\n\n # Maybe wait for DB instance to be in available state. DB should still be writeable at this state\n if @config['allow_major_version_upgrade'] && @config[\"creation_style\"] == \"new\"\n MU.log \"Setting major database version upgrade on #{@cloud_id}'\"\n\n MU::Cloud::AWS.rds(region: @region, credentials: @credentials).modify_db_instance(\n db_instance_identifier: @cloud_id,\n apply_immediately: true,\n allow_major_version_upgrade: true\n )\n end\n\n MU.log \"Database #{@config['name']} (#{@mu_name}) is ready to use\"\n @cloud_id\n end",
"title": ""
},
{
"docid": "fa96f2b2b96d5496539ec31c8840c1cf",
"score": "0.5771948",
"text": "def create_db_snapshot(db_identifier, options = {})\n params = db_identifier.merge(snapshot_identifier)\n response = client.create_db_snapshot(params)\n\n printf \"[#{Time.now}] Creating snapshot...\".green\n client.wait_until(:db_snapshot_available, params) do |w|\n w.before_wait do |_attempts, _response|\n printf '.'.green\n end\n end\n puts \"\\n[#{Time.now}] Created snaphot #{snapshot_identifier[:db_snapshot_identifier]}\".green\n\n response.to_h\n end",
"title": ""
},
{
"docid": "010141278a6f76db5bde68e83bbfb6d0",
"score": "0.5748229",
"text": "def create_basic\n params = basicParams\n\n clean_parent_opts = Proc.new {\n [:storage_encrypted, :master_user_password, :engine_version, :allocated_storage, :backup_retention_period, :preferred_backup_window, :master_username, :db_name, :database_name].each { |p| params.delete(p) }\n }\n\n noun = @config[\"create_cluster\"] ? \"cluster\" : \"instance\"\n\n MU.retrier([Aws::RDS::Errors::InvalidParameterValue, Aws::RDS::Errors::DBSubnetGroupNotFoundFault], max: 10, wait: 15) {\n if %w{existing_snapshot new_snapshot}.include?(@config[\"creation_style\"])\n clean_parent_opts.call\n MU.log \"Creating database #{noun} #{@cloud_id} from snapshot #{@config[\"snapshot_id\"]}\"\n MU::Cloud::AWS.rds(region: @region, credentials: @credentials).send(\"restore_db_#{noun}_from_#{noun == \"instance\" ? \"db_\" : \"\"}snapshot\".to_sym, params)\n else\n clean_parent_opts.call if noun == \"instance\" and params[:db_cluster_identifier]\n MU.log \"Creating pristine database #{noun} #{@cloud_id} (#{@config['name']}) in #{@region}\", MU::NOTICE, details: params\n MU::Cloud::AWS.rds(region: @region, credentials: @credentials).send(\"create_db_#{noun}\".to_sym, params)\n end\n }\n end",
"title": ""
},
{
"docid": "27b9a3ea80a2bc0500757f97c22c6e47",
"score": "0.57469594",
"text": "def create_for_rds\n infra_id = params.require(:infra_id)\n physical_id = params.require(:physical_id)\n username = params.require(:username)\n password = params.require(:password)\n database = params[:database]\n database = nil if database.blank?\n\n infra = Infrastructure.find(infra_id)\n rds = RDS.new(infra, physical_id)\n\n Servertest.create_rds(rds, username, password, infra_id, database)\n\n render plain: I18n.t('servertests.msg.generated'), status: :created and return\n end",
"title": ""
},
{
"docid": "799587c5de8df0f27b231b875601a54c",
"score": "0.56829643",
"text": "def create_snap # rubocop:disable Metrics/AbcSize\n attrcheck = {\n 'REST end point' => @options[:rest_endpoint],\n 'Container' => @options[:container]\n }\n @validate.attrvalidate(@options, attrcheck)\n instance = Instance.new(@options[:id_domain], @options[:user_name], @options[:passwd], @options[:rest_endpoint])\n instance.function = '/snapshot/' if @options[:function].downcase == 'inst_snapshot'\n instance.machine_image = @options[:inst] if @options[:inst]\n instancesnap = instance.create_snap\n # error checking response\n @util.response_handler(instancesnap)\n return JSON.pretty_generate(JSON.parse(instancesnap.body))\n end",
"title": ""
},
{
"docid": "9e7f053029c767afd269df917bf6fd0c",
"score": "0.5656891",
"text": "def create_db_instance(db_name, options={})\n if security_groups = options.delete('DBSecurityGroups')\n options.merge!(Fog::AWS.indexed_param('DBSecurityGroups.member.%d', [*security_groups]))\n end\n\n if vpc_security_groups = options.delete('VpcSecurityGroups')\n options.merge!(Fog::AWS.indexed_param('VpcSecurityGroupIds.member.%d', [*vpc_security_groups]))\n end\n\n request({\n 'Action' => 'CreateDBInstance',\n 'DBInstanceIdentifier' => db_name,\n :parser => Fog::Parsers::AWS::RDS::CreateDBInstance.new,\n }.merge(options))\n end",
"title": ""
},
{
"docid": "8c368703ca3aa4a47b96b67365e24e6a",
"score": "0.56346077",
"text": "def create(type: 'single', description: '', user_data: Hash.new)\n user_data = user_data.map { |k,v| \"#{k}=#{v}\" }.join(\",\")\n snapshot_id = IO.popen([\"snapper\", \"-c\", name, \"create\",\n \"--type\", type,\n \"--print-number\",\n \"--description\", description,\n \"--userdata\", user_data]) do |io|\n Integer(io.read.strip)\n end\n Snapshot.new(snapshot_dir + snapshot_id.to_s)\n end",
"title": ""
},
{
"docid": "2cf4219080962d3b300af4991f17cc5d",
"score": "0.5627853",
"text": "def run_create_snapshot_from_instances(region, instance_ids)\n if instance_ids != nil\n $LOG.info(\"==> about to run create_from_instances #{instance_ids} #{region} \")\n %x(rake aws:ebs:snapshot:create_from_instances[#{region},#{instance_ids}])\n end\n end",
"title": ""
},
{
"docid": "e9878afe494b5652fd6e14b9cc98018d",
"score": "0.5615358",
"text": "def run_create_snapshot_from_instances\n region = CONFIG['region'] != nil ? CONFIG['region'] : ENV['AWS_REGION']\n if CONFIG['instance_ids'] != nil\n puts \"==> about to run create_from_instances #{CONFIG['instance_ids']} #{region} \"\n %x(rake aws:ebs:snapshot:create_from_instances[#{region},#{CONFIG['instance_ids']}]) \n end\n \n end",
"title": ""
},
{
"docid": "f07b8a27ac7f0cd8ede03982f38d7ca2",
"score": "0.5583588",
"text": "def restore_or_create_snapshot(snapshot_name)\n if has_snapshot?(snapshot_name)\n logger.info(\"Found desired snapshot #{snapshot_name}\")\n yield true if block_given?\n restore_snapshot(snapshot_name)\n up(provision: false)\n else\n logger.info(\"Could not find desired snapshot #{snapshot_name}\")\n yield false if block_given?\n up(provision: true)\n save_snapshot(snapshot_name)\n end\n end",
"title": ""
},
{
"docid": "2374ecef9229daf293a955e8655e5dd9",
"score": "0.55768174",
"text": "def create\n\n return unless APP[:app][:steps][:ec2]\n\n instance = image.run_instance( \n :key_name => props[:instance][:key_name],\n :security_groups => sec_group,\n :instance_type => props[:instance_type],\n )\n instance\n end",
"title": ""
},
{
"docid": "c7ab923996d03f290e04d0510a919f74",
"score": "0.55651724",
"text": "def create_snapshot\n @snapshot = ec2.volumes[volume_id].\n create_snapshot(\"#{description}\")\n message.info \"Created snapshot \\\"#{snapshot.id}\\\"\"\n tag_snapshot\n return @snapshot\n end",
"title": ""
},
{
"docid": "1f290e3696260500101029bc1816aa0a",
"score": "0.5552568",
"text": "def configure_tmp_rds\n update_status \"Waiting for instance #{@new_instance.id}...\"\n @new_instance.wait_for { ready? }\n update_status \"Modifying RDS attributes for new RDS #{@new_instance.id}\"\n @rds.modify_db_instance(@new_instance.id, true, {\n 'DBParameterGroupName' => @original_server.db_parameter_groups.\n first['DBParameterGroupName'],\n 'DBSecurityGroups' => [ @config['rds_security_group'] ],\n 'MasterUserPassword' => @new_password,\n })\n end",
"title": ""
},
{
"docid": "970819e8aded4521b85b0d01456bc4de",
"score": "0.54757917",
"text": "def create_instance(_instance_alias, _image_name, _image_type, _security_groups, _availability_zone, datacenter)\n instances = db = self.class.load_database(database_file)\n\n if datacenter && datacenter.length > 0\n instances = db.select(&find_by_datacenter(datacenter))\n end\n\n instance = instances.find(&find_by_states(AVAILABLE))\n\n raise StandardError.new(\"No Servers Available\") if instance.nil?\n\n instance.state = ACTIVE\n\n self.class.persist_database(db, database_file)\n\n instance.id\n end",
"title": ""
},
{
"docid": "950aa4685806a70ad181087e4ae9c611",
"score": "0.5462925",
"text": "def create_snapshot(params)\n image_id = params['VolumeId']\n image_id = image_id.split('-')[1]\n\n image = ImageEC2.new(Image.build_xml(image_id.to_i), @client)\n rc = image.info\n if OpenNebula::is_error?(rc) || !image.ebs_volume?\n rc ||= OpenNebula::Error.new()\n rc.ec2_code = \"InvalidVolume.NotFound\"\n return rc\n end\n\n instance_id = image[\"TEMPLATE/EBS/INSTANCE_ID\"]\n\n if instance_id\n # Disk snapshot\n instance_id = instance_id.split('-')[1]\n vm = VirtualMachine.new(\n VirtualMachine.build_xml(instance_id),\n @client)\n\n rc = vm.info\n if OpenNebula::is_error?(rc)\n rc.ec2_code = \"InvalidInstanceID.NotFound\"\n return rc\n end\n\n disk_id = vm[\"TEMPLATE/DISK[IMAGE_ID=#{image_id}]/DISK_ID\"]\n if !disk_id.nil?\n snapshot_id = vm.disk_saveas(disk_id.to_i,\n params[\"Description\"]||ImageEC2.generate_uuid,\n OpenNebula::Image::IMAGE_TYPES[image[\"TYPE\"].to_i])\n\n if OpenNebula::is_error?(snapshot_id)\n return snapshot_id\n end\n end\n end\n\n if snapshot_id.nil?\n # Clone\n snapshot_id = image.clone(params[\"Description\"]||ImageEC2.generate_uuid)\n if OpenNebula::is_error?(snapshot_id)\n return snapshot_id\n end\n end\n\n snapshot = ImageEC2.new(Image.build_xml(snapshot_id.to_i), @client)\n rc = snapshot.info\n if OpenNebula::is_error?(rc)\n return rc\n end\n\n snapshot.delete_element(\"TEMPLATE/EBS_VOLUME\")\n snapshot.add_element('TEMPLATE', {\"EBS_SNAPSHOT\" => \"YES\"})\n snapshot.update\n\n erb_version = params['Version']\n\n response = ERB.new(File.read(@config[:views]+\"/create_snapshot.erb\"))\n return response.result(binding), 200\n end",
"title": ""
},
{
"docid": "25a483d59bf2a6d48ae12a9cab5a180a",
"score": "0.5457966",
"text": "def create_db_cluster_snapshot(identifier, name)\n request(\n 'Action' => 'CreateDBClusterSnapshot',\n 'DBClusterIdentifier' => identifier,\n 'DBClusterSnapshotIdentifier' => name,\n :parser => Fog::Parsers::AWS::RDS::CreateDBClusterSnapshot.new\n )\n end",
"title": ""
},
{
"docid": "97613354e109661b03c35f1cbf7e5f11",
"score": "0.5446321",
"text": "def create_for_rds\n infra_id = params.require(:infra_id)\n physical_id = params.require(:physical_id)\n username = params.require(:username)\n password = params.require(:password)\n database = params[:database]\n database = nil if database.blank?\n\n infra = Infrastructure.find(infra_id)\n rds = RDS.new(infra, physical_id)\n\n Serverspec.create_rds(rds, username, password, infra_id, database)\n\n render text: I18n.t('serverspecs.msg.generated'), status: 201 and return\n end",
"title": ""
},
{
"docid": "264174af700d02da5cba9f3c12f802db",
"score": "0.541823",
"text": "def create_snapshot(env, server_id, snapshot_name)\n instance_exists do\n post(\n env,\n \"#{@session.endpoints[:compute]}/servers/#{server_id}/action\",\n { createImage: {\n name: snapshot_name,\n metadata: { vagrant_snapshot: 'true' }\n } }.to_json)\n end\n end",
"title": ""
},
{
"docid": "c738dfb9bce131cb38d1524b0acb407f",
"score": "0.53914714",
"text": "def createDb\n\t\t\tsnap_id = getExistingSnapshot if @db[\"creation_style\"] == \"existing_snapshot\"\n\t\t\tsnap_id = createNewSnapshot if @db[\"creation_style\"] == \"new_snapshot\" or (@db[\"creation_style\"] == \"existing_snapshot\" and snap_id.nil?)\n\t\t\t@db[\"snapshot_id\"] = snap_id\n\n\t\t\tdb_node_name = MU::MommaCat.getResourceName(@db[\"name\"])\n\n\t\t\t# RDS is picky, we can't just use our regular node names for things like\n\t\t\t# the default schema or username. And it varies from engine to engine.\n\t\t\tbasename = @db[\"name\"]+@deploy.timestamp+MU.seed.downcase\n\t\t\tbasename.gsub!(/[^a-z0-9]/i, \"\")\n\n\t\t\t# Getting engine specific names\n\t\t\tdbname = getName(basename, type: \"dbname\")\n\t\t\t@db['master_user'] = getName(basename, type: \"dbuser\")\n\t\t\t@db['identifier'] = getName(db_node_name, type: \"dbidentifier\")\n\t\t\tMU.log \"Truncated master username for #{@db['identifier']} (db #{dbname}) to #{@db['master_user']}\", MU::WARN if @db['master_user'] != @db[\"name\"] and @db[\"snapshot_id\"].nil?\n\n\t\t\t@db['password'] = Password.pronounceable(10..12) if @db['password'].nil?\n\n\t\t\t# Database instance config\n\t\t\tconfig={\n\t\t\t\tdb_instance_identifier: @db['identifier'],\n\t\t\t\tdb_instance_class: @db[\"size\"],\n\t\t\t\tengine: @db[\"engine\"],\n\t\t\t\tauto_minor_version_upgrade: @db[\"auto_minor_version_upgrade\"],\n\t\t\t\tmulti_az: @db['multi_az_on_create'],\n\t\t\t\tlicense_model: @db[\"license_model\"],\n\t\t\t\tstorage_type: @db['storage_type'],\n\t\t\t\tdb_subnet_group_name: db_node_name,\n\t\t\t\tpublicly_accessible: @db[\"publicly_accessible\"],\n\t\t\t\ttags: []\n\t\t\t}\n\n\t\t\tMU::MommaCat.listStandardTags.each_pair { |name, value|\n\t\t\t\tconfig[:tags] << { key: name, value: value }\n\t\t\t}\n\n\t\t\tconfig[:iops] = @db[\"iops\"] if @db['storage_type'] == \"io1\"\n\n\t\t\t# Lets make sure automatic backups are enabled when DB instance is deployed in Multi-AZ so failover actually works. Maybe default to 1 instead?\n\t\t\tif @db['multi_az_on_create'] or @db['multi_az_on_deploy']\n\t\t\t\tif @db[\"backup_retention_period\"].nil? or @db[\"backup_retention_period\"] == 0\n\t\t\t\t\t@db[\"backup_retention_period\"] = 35\n\t\t\t\t\tMU.log \"Multi-AZ deployment specified but backup retention period disabled or set to 0. Changing to #{@db[\"backup_retention_period\"]} \", MU::WARN\n\t\t\t\tend\n\n\t\t\t\tif @db[\"preferred_backup_window\"].nil?\n\t\t\t\t\t@db[\"preferred_backup_window\"] = \"05:00-05:30\"\n\t\t\t\t\tMU.log \"Multi-AZ deployment specified but no backup window specified. Changing to #{@db[\"preferred_backup_window\"]} \", MU::WARN\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tif @db[\"snapshot_id\"].nil?\n\t\t\t\tconfig[:preferred_backup_window] = @db[\"preferred_backup_window\"]\n\t\t\t\tconfig[:backup_retention_period] = @db[\"backup_retention_period\"]\n\t\t\t\tconfig[:storage_encrypted] = @db[\"storage_encrypted\"]\n\t\t\t\tconfig[:engine_version] = @db[\"engine_version\"]\n\t\t\t\tconfig[:preferred_maintenance_window] = @db[\"preferred_maintenance_window\"] if @db[\"preferred_maintenance_window\"]\n\t\t\t\tconfig[:allocated_storage] = @db[\"storage\"]\n\t\t\t\tconfig[:db_name] = dbname\n\t\t\t\tconfig[:master_username] = @db['master_user']\n\t\t\t\tconfig[:master_user_password] = @db['password']\n\t\t\tend\n\n\t\t\tdb_config = createSubnetGroup(config)\n\n\t\t\t# Creating DB instance\n\t\t\tMU.log \"RDS config: #{db_config}\", MU::DEBUG\n\t\t\tattempts = 0\n\t\t\tbegin\n\t\t\t\tif @db[\"snapshot_id\"]\n\t\t\t\t\tdb_config[:db_snapshot_identifier] = @db[\"snapshot_id\"]\n\t\t\t\t\tMU.log \"Creating database instance #{@db['identifier']} from snapshot #{@db[\"snapshot_id\"]}\", details: db_config\n\t\t\t\t\tresp = MU.rds(@db['region']).restore_db_instance_from_db_snapshot(db_config)\n\t\t\t\telse\n\t\t\t\t\tMU.log \"Creating database instance #{@db['identifier']}\", details: db_config\n\t\t\t\t\tresp = MU.rds(@db['region']).create_db_instance(db_config)\n\t\t\t\tend\n\t\t\trescue Aws::RDS::Errors::InvalidParameterValue => e\n\t\t\t\tif attempts < 5\n\t\t\t\t\tMU.log \"Got #{e.inspect} creating #{@db['identifier']}, will retry a few times in case of transient errors.\", MU::WARN\n\t\t\t\t\tattempts += 1\n\t\t\t\t\tsleep 10\n\t\t\t\t\tretry\n\t\t\t\telse\n\t\t\t\t\tMU.log \"Exhausted retries trying to create database instance #{@db['identifier']}\", MU::ERR, details: e.inspect\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tbegin\n\t\t\t\t# this ends in an ensure block that cleans up if we die\n\t\t\t\tdatabase = MU::Database.getDatabaseById(@db['identifier'], region: @db['region'])\n\t\t\t\t# Calling this a second time after the DB instance is ready or DNS record creation will fail.\n\t\t\t\twait_start_time = Time.now\n\n\t\t\t\tMU.rds(@db['region']).wait_until(:db_instance_available, db_instance_identifier: @db['identifier']) do |waiter|\n\t\t\t\t\t# Does create_db_instance implement wait_until_available ?\n\t\t\t\t\twaiter.max_attempts = nil\n\t\t\t\t\twaiter.before_attempt do |attempts|\n\t\t\t\t\t\tMU.log \"Waiting for RDS database #{@db['identifier'] } to be ready..\", MU::NOTICE if attempts % 10 == 0\n\t\t\t\t\tend\n\t\t\t\t\twaiter.before_wait do |attempts, resp|\n\t\t\t\t\t\tthrow :success if resp.data.db_instances.first.db_instance_status == \"available\"\n\t\t\t\t\t\tthrow :failure if Time.now - wait_start_time > 2400\n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\t\tdatabase = MU::Database.getDatabaseById(@db['identifier'], region: @db['region'])\n\n\t\t\t\tMU::DNSZone.genericDNSEntry(database.db_instance_identifier, \"#{database.endpoint.address}.\", MU::Database, sync_wait: @db['dns_sync_wait'])\n\t\t\t\tif !@db['dns_records'].nil?\n\t\t\t\t\t@db['dns_records'].each { |dnsrec|\n\t\t\t\t\t\tdnsrec['name'] = database.db_instance_identifier.downcase if !dnsrec.has_key?('name')\n\t\t\t\t\t}\n\t\t\t\tend\n\t\t\t\tMU::DNSZone.createRecordsFromConfig(@db['dns_records'], target: database.endpoint.address)\n\n\t\t\t\t# When creating from a snapshot, some of the create arguments aren't\n\t\t\t\t# applicable- but we can apply them after the fact with a modify.\n\t\t\t\tif @db[\"snapshot_id\"]\n\t\t\t\t\tmod_config = Hash.new\n\t\t\t\t\tmod_config[:db_instance_identifier] = database.db_instance_identifier\n\t\t\t\t\tmod_config[:preferred_backup_window] = @db[\"preferred_backup_window\"]\n\t\t\t\t\tmod_config[:backup_retention_period] = @db[\"backup_retention_period\"]\n\t\t\t\t\tmod_config[:preferred_maintenance_window] = @db[\"preferred_maintenance_window\"] if @db[\"preferred_maintenance_window\"]\n\t\t\t\t\tmod_config[:engine_version] = @db[\"engine_version\"]\n\t\t\t\t\tmod_config[:allow_major_version_upgrade] = @db[\"allow_major_version_upgrade\"] if @db['allow_major_version_upgrade']\n\t\t\t\t\tmod_config[:apply_immediately] = true\n\n\t\t\t\t\tif database.db_subnet_group and database.db_subnet_group.subnets and !database.db_subnet_group.subnets.empty?\n\t\t\t\t\t\tif !db_config.nil? and db_config.has_key?(:vpc_security_group_ids)\n\t\t\t\t\t\t\tmod_config[:vpc_security_group_ids] = db_config[:vpc_security_group_ids]\n\t\t\t\t\t\tend\n\t\t\t\t\t\tif @db[\"add_firewall_rules\"] and !@db[\"add_firewall_rules\"].empty?\n\t\t\t\t\t\t\t@db[\"add_firewall_rules\"].each { |acl|\n\t\t\t\t\t\t\t\tsg = MU::FirewallRule.find(sg_id: acl[\"rule_id\"], name: acl[\"rule_name\"], region: @db['region'])\n\t\t\t\t\t\t\t\tif sg and mod_config[:vpc_security_group_ids].nil?\n\t\t\t\t\t\t\t\t\tmod_config[:vpc_security_group_ids] = []\n\t\t\t\t\t\t\t\tend\t\n\t\t\t\t\t\t\t\tmod_config[:vpc_security_group_ids] << sg.group_id if sg\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tend\n\t\t\t\t\t# else\n\t\t\t\t\t\t# This doesn't make sense. we don't have a security group by that name, and we should only create this if we're in classic\n\t\t\t\t\t\t# mod_config[:db_security_groups] = [dbname]\n\t\t\t\t\tend\n\n\t\t\t\t\tmod_config[:master_user_password] = @db['password']\n\t\t\t\t\tMU.rds(@db['region']).modify_db_instance(mod_config)\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tMU.rds(@db['region']).wait_until(:db_instance_available, db_instance_identifier: @db['identifier']) do |waiter|\n\t\t\t\t\t\t# Does create_db_instance implement wait_until_available ?\n\t\t\t\t\t\twaiter.max_attempts = nil\n\t\t\t\t\t\twaiter.before_attempt do |attempts|\n\t\t\t\t\t\t\tMU.log \"Waiting for RDS database #{@db['identifier'] } to be ready..\", MU::NOTICE if attempts % 10 == 0\n\t\t\t\t\t\tend\n\t\t\t\t\t\twaiter.before_wait do |attempts, resp|\n\t\t\t\t\t\t\tthrow :success if resp.data.db_instances.first.db_instance_status == \"available\"\n\t\t\t\t\t\t\tthrow :failure if Time.now - wait_start_time > 2400\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\t\tMU::Database.notifyDeploy(@db[\"name\"], @db['identifier'], @db['password'], @db[\"creation_style\"], region: @db['region'])\n\t\t\t\tMU.log \"Database #{@db['identifier']} is ready to use\"\n\t\t\t\tdone = true\n\t\t\tensure\n\t\t\t\tif !done and database\n\t\t\t\t\tMU::Cleanup.terminate_rds_instance(database, region: @db['region'])\n\t\t\t\tend\n\t\t\tend\n\n\t\t\t# Maybe wait for DB instance to be in available state. DB should still be writeable at this state\n\t\t\tif @db['allow_major_version_upgrade']\n\t\t\t\tMU.log \"Setting major database version upgrade on #{@db['identifier']}'\"\n\t\t\t\tMU.rds(@db['region']).modify_db_instance(\n\t\t\t\t\tdb_instance_identifier: @db['identifier'],\n\t\t\t\t\tapply_immediately: true,\n\t\t\t\t\tallow_major_version_upgrade: true\n\t\t\t\t)\n\t\t\tend\n\t\t\t\n\t\t\tcreateReadReplica if @db['read_replica']\n\n\t\t\treturn @db['identifier']\n\t\tend",
"title": ""
},
{
"docid": "6de53492285b7f476373c0be5f9aba45",
"score": "0.53724986",
"text": "def download_data_from_tmp_rds\n @new_instance.wait_for { ready? }\n db_name = @original_server.db_name\n db_user = @original_server.master_username\n update_status \"Dumping database #{db_name} from #{@new_instance.id}\"\n dump_time = @snapshot ? Time.parse(@snapshot.created_at.to_s) : Time.now\n date_stamp = dump_time.strftime(\"%Y-%m-%d-%H%M%S\")\n @sql_file = \"#{@config['tmp_dir']}/#{@s3_path}/#{db_name}.#{date_stamp}.sql.gz\"\n hostname = @new_instance.endpoint['Address']\n dump_cmd = \"mysqldump -u #{db_user} -h #{hostname} \"+\n \"-p#{@new_password} #{db_name} | gzip >#{@sql_file}\"\n FileUtils.mkpath(File.dirname @sql_file)\n @log.debug \"Executing command: #{dump_cmd}\"\n `#{dump_cmd}`\n end",
"title": ""
},
{
"docid": "d3fbb93bf5b705b495662a1ba4d29ce6",
"score": "0.5362976",
"text": "def clone args\n\t\tif args.size < 2\n\t\t\traise RuntimeError, \"Must specify an exsting instance name and a name for the new instance.\"\n\t\tend\n\n\t\texisting_name = args[0]\n\t\tnew_instance_name = args[1]\n\t\tinstance = $all_instances.get_instance existing_name\n\t\tif instance.nil?\n\t\t\tputs \"Error, bad instance returned.\"\n\t\t\texit 1\n\t\tend\n\t\tsettings = {\n\t\t\t\"zone\" => instance[:aws_availability_zone],\n\t\t\t\"access_groups\" => instance[:aws_groups],\n\t\t\t\"ami\" => instance[:aws_image_id],\n\t\t\t\"key\" => instance[:ssh_key_name]\n\t\t}\n\t\t$all_instances.create(new_instance_name, settings)\n\t\tputs \"Created #{new_instance_name} as a clone of #{existing_name}.\"\n\tend",
"title": ""
},
{
"docid": "826bb7bd63f9dfae82d292df753c9efd",
"score": "0.53587604",
"text": "def create_snapshot(project_id, params = {})\n c_r Lokalise::Resources::Snapshot, :create, project_id, params\n end",
"title": ""
},
{
"docid": "939d63bda48281aec7d99f43b50d755c",
"score": "0.5337163",
"text": "def create_read_replica\n @config[\"source\"].kitten(@deploy)\n if !@config[\"source\"].id\n raise MuError.new \"Database '#{@config['name']}' couldn't resolve cloud id for source database\", details: @config[\"source\"].to_h\n end\n\n params = {\n db_instance_identifier: @cloud_id,\n source_db_instance_identifier: @config[\"source\"].id,\n db_instance_class: @config[\"size\"],\n auto_minor_version_upgrade: @config[\"auto_minor_version_upgrade\"],\n publicly_accessible: @config[\"publicly_accessible\"],\n tags: @tags.each_key.map { |k| { :key => k, :value => @tags[k] } },\n db_subnet_group_name: @config[\"subnet_group_name\"],\n storage_type: @config[\"storage_type\"]\n }\n if @config[\"source\"].region and @region != @config[\"source\"].region\n params[:source_db_instance_identifier] = MU::Cloud::AWS::Database.getARN(@config[\"source\"].id, \"db\", \"rds\", region: @config[\"source\"].region, credentials: @credentials)\n end\n\n params[:port] = @config[\"port\"] if @config[\"port\"]\n params[:iops] = @config[\"iops\"] if @config['storage_type'] == \"io1\"\n\n on_retry = Proc.new { |e|\n if e.class == Aws::RDS::Errors::DBSubnetGroupNotAllowedFault\n MU.log \"Being forced to use source database's subnet group: #{e.message}\", MU::WARN\n params.delete(:db_subnet_group_name)\n end\n }\n\n MU.retrier([Aws::RDS::Errors::InvalidDBInstanceState, Aws::RDS::Errors::InvalidParameterValue, Aws::RDS::Errors::DBSubnetGroupNotAllowedFault], max: 10, wait: 30, on_retry: on_retry) {\n MU.log \"Creating read replica database instance #{@cloud_id} for #{@config['source'].id}\"\n MU::Cloud::AWS.rds(region: @region, credentials: @credentials).create_db_instance_read_replica(params)\n }\n end",
"title": ""
},
{
"docid": "051cd00d0325a508855cbf8a1f0c0b59",
"score": "0.5331104",
"text": "def restore(options = {})\n puts \"WELCOME TO RESTORE FUNCTION\"\n puts \"YOU ARE STARTING TO RESTORE EC2 INSTANCE \" + options.fetch(:instance_id) + \" NOW\"\n region=options.fetch(:region)\n availability_zone = options.fetch(:availability_zone)\n #connect EC2 resource\n ec2_client = Aws::EC2::Client.new(\n region: options.fetch(:region),\n access_key_id: ENV['AWS_API_KEY'],\n secret_access_key: ENV['AWS_SECRET_KEY']\n\n )\n\n resource = Aws::EC2::Resource.new(client: ec2_client)\n instance_id = options.fetch(:instance_id)\n time = options.fetch(:time)\n\n #step1 identify the snapshots from a specific EC2 instance\n puts \"step 1: identify the snapshots from EC2 instance \" + instance_id\n #step1.1: find the boot volume snapshot\n puts \"step 1.1: identify the boot volume snapshot from EC2 instance \" + instance_id\n boot_volume_snapshots = resource.snapshots({\n dry_run: false,\n filters: [\n {\n name: \"tag:EC2-instanceID\",\n values: [instance_id]\n },\n {\n name: \"tag:Volume-type\",\n values: [\"/dev/xvda\"]\n },\n {\n name: \"tag:Time\",\n values: [time]\n },\n\n ],\n })\n\n\n boot_volume_snapshot = nil\n boot_volume_snapshots.each do |snapshot|\n boot_volume_snapshot = snapshot\n end\n\n if boot_volume_snapshot! = nil\n puts \"step 1.1: boot_volume_snapshots from the EC2 instance was \" + boot_volume_snapshot.id\n else puts \"boot_volume not found. Please check your input instance_id paramerter\"\n end\n\n\n #step1.1 find the block volumes snapshots\n puts \"step 1.1: Identify the block volume snapshots from EC2 instance \" + instance_id\n\n block_volume_snapshots=resource.snapshots({\n dry_run: false,\n filters: [\n {\n name: \"tag:EC2-instanceID\",\n values: [instance_id]\n },\n {\n name: \"tag:Volume-type\",\n values: [\"/dev/sdf\"]\n },\n {\n name: \"tag:Time\",\n values: [time]\n },\n ],\n })\n puts \"step 1.1: complete\"\n\n\n\n\n #step2 create a volumeY from that snapshot\n puts \"step 2: create volumes from snapshots\"\n #step2.1 only create boot volume\n puts \"step 2.1: only create boot volume\"\n boot_volume_snapshot.wait_until_completed\n backup_instance_new_boot_volume = resource.create_volume({\n dry_run: false,\n size: 1,\n snapshot_id: boot_volume_snapshot.id,\n availability_zone: availability_zone, # required\n volume_type: \"standard\", # accepts standard, io1, gp2, sc1, st1\n encrypted: false,\n\n })\n # step 2.1.1 creating \\\"Previous root volume attached to EC2 instance\\\" tag on the volume\n puts \"step 2.1.1 creating \\\"Previous root volume attached to EC2 instance\\\" tag on volume \"+backup_instance_new_boot_volume.id\n backup_instance_new_boot_volume.create_tags({\n dry_run: false,\n tags: [ # required\n {\n key: \"Previous root volume attached to EC2 instance\",\n value: instance_id,\n },\n {\n key: \"Type\",\n value: \"Boot_Volume\",\n },\n\n\n {\n key: \"Time\",\n value: Time.now.inspect,\n },\n\n ],\n })\n\n #step2.2 create other volumes except boot volume\n puts \"step 2.2: create block volumes\"\n\n\n backup_instance_new_non_boot_volume_array = []\n block_volume_snapshots.each do |snapshot|\n snapshot.wait_until_completed\n volume = ec2.create_volume({\n dry_run: false,\n size: 1,\n snapshot_id: snapshot.id,\n availability_zone: \"us-east-1a\", # required\n volume_type: \"standard\", # accepts standard, io1, gp2, sc1, st1\n encrypted: false,\n\n })\n backup_instance_new_non_boot_volume_array.push(volume)\n # step 2.2.1 creating \\\"Previous block volume attached to EC2 instance\\\" tag on the volume\n puts \"step 2.2.1 creating \\\"Previous block volume attached to EC2 instance\\\" tag on volume \"+volume.id\n volume.create_tags({\n dry_run: false,\n tags: [ # required\n {\n key: \"Previous block volume attached to EC2 instance\",\n value: instance_id,\n },\n {\n key: \"Type\",\n value: \"Block_Volume\",\n },\n {\n key: \"Time\",\n value: Time.now.inspect,\n },\n ],\n })\n\n end\n\n\n\n\n #step3 \"Launch a new instanceX\" and \"stop it\" and \"detach the root volume\"\n puts \"step 3: \\\"Launch a new instanceX\\\" and \\\"stop it\\\" and \\\"detach the root volume\\\"\"\n\n #step3.1 start create new instance X\n puts \"step 3.1: start to create new instance X\"\n instancesX = resource.create_instances({\n dry_run: false,\n image_id: \"ami-6869aa05\", # amazon Linux\n min_count: 1, # required\n max_count: 1, # required\n instance_type: \"t2.micro\",\n placement: {\n availability_zone: \"us-east-1a\",\n\n }\n\n })\n\n #step3.1.1 creating \\\"Restore from Instance\\\" tag on the instance X\n puts \"step 3.1.1: creating \\\"Restore from Instance\\\" tag\"\n instancesX.create_tags({\n dry_run: false,\n tags: [ # required\n {\n key: \"Restore from Instance\",\n value: instance_id ,\n },\n ],\n })\n\n\n\n\n\n\n instancesX[0].wait_until_running(max_attempts:100,delay:100)\n puts \"instanceX: \" + instancesX[0].id + \" is running\"\n\n\n\n #step 3.2 stop instance\n puts \"step 3.2: stop instance X: \"+instancesX[0].id\n instancesX[0].stop({\n dry_run: false,\n force: false,\n })\n\n\n instancesX[0].wait_until_stopped\n puts \"step 3.2: stop instance X: \" + instancesX[0].id + \"was completed\"\n\n\n\n #step3.3 detach the root volume\n puts \"step 3.3: detach the root volume of instanceX: \"+instancesX[0].volumes.first.id\n instancesX[0].detach_volume({\n dry_run: false,\n volume_id: instancesX[0].volumes.first.id, # required\n device: \"/dev/xvda\", # required/ boot device\n force: false,\n })\n\n sleep(0.5)\n puts \"step 3.3: Root volume of instanceX: \" + instancesX[0].id + \" was detached\"\n\n\n #step4 attach the volume\n puts \"step 4: Attach the volume to restored instanceX: \" + instancesX[0].id\n #step4.1 attach root volume to instanceX\n puts \"step 4.1: Attach root volume to instanceX: \"+instancesX[0].id\n instancesX[0].attach_volume({\n dry_run: false,\n volume_id: backup_instance_new_boot_volume.id, # required\n device: \"/dev/xvda\", # required root device\n })\n puts \"step 4.1: boot volume to restored instance attached\"\n\n #step4.2 attach non block volumes to instanceX\n puts \"step 4.2: Attaching block volume to instanceX: \" + instancesX[0].id\n backup_instance_new_non_boot_volume_array.each do |new_non_boot_volume|\n\n\n instancesX[0].attach_volume({\n dry_run: false,\n volume_id: new_non_boot_volume.id, # required\n device: \"/dev/sdf\", # required\n })\n end\n puts \"step 4.2: All block volumes attached\"\n puts \"Restore completed\"\n puts \"You have successfully restored from EC2 instance:\" + instance_id + \" to EC2 instance: \"+instancesX[0].id\nend",
"title": ""
},
{
"docid": "bf2bae8fce5e807d3a5c784ba21b165f",
"score": "0.5329223",
"text": "def backup(options = {})\n puts \"WELCOME TO BACKINGUP FUNCTION\"\n puts \"YOU ARE STARTING TO BACK UP EC2 INSTANCE \"+ options.fetch(:instance_id)+\" NOW\"\n\n\n region=options.fetch(:region)\n #connect EC2 resource\n # ec2_client = Aws::EC2::Client.new(\n # region: options.fetch(:region),\n # access_key_id: ENV['AWS_API_KEY'],\n # secret_access_key: ENV['AWS_SECRET_KEY']\n #\n # )\n # step 0 connect to aws using connector.rb\n puts \"step 0:step 0 connect to aws using connector.rb\"\n my_aws = {\n region: ENV['AWS_REGION'],\n access_method: 'api_key',\n access_key: ENV['AWS_API_KEY'],\n secret_key: ENV['AWS_SECRET_KEY']\n }\n conn = ::Aws::Connector.new(my_aws)\n ec2_client = conn.ec2 # Aws RDS Client library\n resource = Aws::EC2::Resource.new(client: ec2_client)\n instance_id = options.fetch(:instance_id)\n instance=resource.instance(instance_id)\n\n\n # step1 take a snapshot on some specific volumeXs from backup instance\n puts \"step1:take a snapshot on some specific volumeXs from backup instance\"\n # find boot volume\n bootVolume=nil\n backupInstanceVolumes = instance.volumes\n backupInstanceVolumes.each do |volume|\n if volume.attachments[0].device == \"/dev/xvda\"\n bootVolume=volume\n end\n end\n\n\n # step 1.1 Only take root volumes snapshot\n if bootVolume != nil\n puts \"step 1.1: Only take root volume snapshot\"\n boot_valume_snapshot = resource.create_snapshot({\n dry_run: false,\n volume_id: bootVolume.id, # required\n description: \"snapshot for bootvolume from EC2 instance: \"+instance_id,\n\n })\n # step 1.1.1 creating \"Name\" tag\n puts \"step 1.1.1 creating \\\"Name\\\" tag on snapshot \"+boot_valume_snapshot.id\n boot_valume_snapshot.create_tags({\n dry_run: false,\n tags: [ # required\n {\n key: \"Name\",\n value: \"EC2 Backup Snapshot\"\n },\n ],\n })\n # step 1.1.2 creating \"Time\" tag\n puts \"step 1.1.2 creating \\\"Time\\\" tag on snapshot \"+boot_valume_snapshot.id\n boot_valume_snapshot.create_tags({\n dry_run: false,\n tags: [ # required\n {\n key: \"Time\",\n value: Time.new.inspect\n },\n ],\n })\n # step 1.1.3 creating \"ec2-id\" tag. This tag is for knowing this snapshot is for which instance\n puts \"step 1.1.3 creating \\\"EC2-instanceID\\\" tag on snapshot \"+boot_valume_snapshot.id\n boot_valume_snapshot.create_tags({\n dry_run: false,\n tags: [ # required\n {\n key: \"EC2-instanceID\",\n value: instance_id\n },\n ],\n })\n # step 1.1.4 creating \"EC2-instanceID\" tag.\n puts \"step 1.1.4 creating \\\"EC2-instanceID\\\" tag on snapshot \" + boot_valume_snapshot.id\n boot_valume_snapshot.create_tags({\n dry_run: false,\n tags: [ # required\n {\n key: \"Volume-type\",\n value: \"/dev/xvda\"\n },\n ],\n })\n # step 1.1.5 creating \"volume-type\" tag.\n puts \"step 1.1.5 creating \\\"Snapshot from Volume\\\" tag on snapshot \"+boot_valume_snapshot.id\n boot_valume_snapshot.create_tags({\n dry_run: false,\n tags: [ # required\n {\n key: \"Snapshot from Volume\",\n value: bootVolume.id\n },\n ],\n })\n\n end\n\n\n # step 1.2 Only take block volumes snapshot\n if instance.volumes.count != 0\n puts \"step 1.2: Only take block volumes snapshot\"\n instance.volumes.each do |volume|\n if volume.attachments[0].device != \"/dev/xvda\"\n snapshot =resource.create_snapshot({\n dry_run: false,\n volume_id: volume.id, # required\n description: \"snapshot for blockvolume from EC2 instance: \"+instance_id,\n })\n # step 1.2.1 creating \"Name\" tag\n puts \"step 1.2.1 creating \\\"Name\\\" tag on snapshot \" + snapshot.id\n snapshot.create_tags({\n dry_run: false,\n tags: [ # required\n {\n key: \"Name\",\n value: \"EC2 Backup Snapshot\",\n },\n ],\n\n })\n # step 1.2.2 creating \"Time\" tag\n puts \"step 1.2.2 creating \\\"Time\\\" tag on snapshot \"+snapshot.id\n snapshot.create_tags({\n dry_run: false,\n tags: [ # required\n {\n key: \"Time\",\n value: Time.now.inspect,\n },\n ],\n\n })\n # step 1.2.3 creating \"EC2-instanceID\" tag. This tag is for knowing this snapshot is for which instance\n puts \"step 1.2.3 creating \\\"EC2-instanceID\\\" tag on snapshot \" + snapshot.id\n snapshot.create_tags({\n dry_run: false,\n tags: [ # required\n {\n key: \"EC2-instanceID\",\n value: instance_id\n },\n ],\n })\n # step 1.2.4 creating \"volume-type\" tag.\n puts \"step 1.2.4 creating \\\"volume-type\\\" tag on snapshot \"+snapshot.id\n snapshot.create_tags({\n dry_run: false,\n tags: [ # required\n {\n key: \"Volume-type\",\n value: \"/dev/sdf\"\n },\n ],\n })\n end\n end\n end\n\nend",
"title": ""
},
{
"docid": "ece91f6fdb9e7a43dd8e124cf5c157f8",
"score": "0.528752",
"text": "def initialize opt={}\n opt[:type] = \"AWS::RDS::DBInstance\"\n super opt\n\n @instance_class = opt[:instance_class] || 'db.t2.micro'\n @engine = opt[:engine] || 'postgres'\n @allocated_storage = opt[:allocated_storage] || 5 #5GB minimum\n @username = opt[:username] || 'postgres'\n @password = opt[:password] || 'password'\n add_property :PubliclyAccessible, opt[:publicly_accessible] || false\n add_property :StorageType, opt[:storage_type] || 'gp2'\n end",
"title": ""
},
{
"docid": "fda73ecc221b1bb2b5cc7acaf231d233",
"score": "0.52831495",
"text": "def create(options = {})\n options[:snapshot_name] = options.delete :name if options[:name]\n response = Profitbricks.request :create_snapshot, options\n true\n end",
"title": ""
},
{
"docid": "ca7bcf07aede1f185d901723d3c87245",
"score": "0.52827334",
"text": "def copysnapshot\n announcing 'Copying snapshot to chroot' do\n Athenry::sync(:options => \"--verbose --progress --recursive --links --safe-links --perms\\\n --times --force --whole-file --delete --stats\",\n :uri => \"#{SNAPSHOTCACHE}/portage/\", \n :output => \"#{$chrootdir}/usr/portage/\")\n end\n send_to_state('setup', 'copysnapshot')\n end",
"title": ""
},
{
"docid": "9e4b4cb22e3c09f9a53061156d6b03be",
"score": "0.5259839",
"text": "def create_snapshot(snap_id, snap_name)\n snapshot_hash = {\n :name => snap_id,\n :description => \"OpenNebula Snapshot: #{snap_name}\",\n :memory => true,\n :quiesce => true\n }\n\n vcenter_version = @vi_client.vim.serviceContent.about.apiVersion rescue nil\n\n if vcenter_version != \"5.5\"\n begin\n @item.CreateSnapshot_Task(snapshot_hash).wait_for_completion\n rescue Exception => e\n raise \"Cannot create snapshot for VM: #{e.message}\\n#{e.backtrace.join(\"\\n\")}\"\n end\n else\n # B#5045 - If vcenter is 5.5 the snapshot may take longer than\n # 15 minutes and it does not report that it has finished using\n # wait_for_completion so we use an active wait instead with a\n # timeout of 1440 minutes = 24 hours\n @item.CreateSnapshot_Task(snapshot_hash)\n\n snapshot_created = false\n elapsed_minutes = 0\n\n until snapshot_created || elapsed_minutes == 1440\n if !!@item['snapshot']\n current_snapshot = @item['snapshot.currentSnapshot'] rescue nil\n snapshot_found = find_snapshot_in_list(@item['snapshot.rootSnapshotList'], snap_id)\n snapshot_created = !!snapshot_found && !!current_snapshot && current_snapshot._ref == snapshot_found._ref\n end\n sleep(60)\n elapsed_minutes += 1\n end\n end\n\n return snap_id\n end",
"title": ""
},
{
"docid": "3f6aa0694f3dc74aa83e53d01ac7a9fb",
"score": "0.5247138",
"text": "def snapshot_create(id, drv_message)\n xml_data = decode(drv_message)\n\n host = xml_data.elements['HOST'].text\n deploy_id = xml_data.elements['DEPLOY_ID'].text\n\n snap_id_xpath = \"VM/TEMPLATE/SNAPSHOT[ACTIVE='YES']/SNAPSHOT_ID\"\n snap_id = xml_data.elements[snap_id_xpath].text.to_i\n\n do_action(\"#{deploy_id} #{snap_id}\",\n id,\n host,\n ACTION[:snapshot_create],\n :script_name => 'snapshot_create',\n :stdin => xml_data.to_s)\n end",
"title": ""
},
{
"docid": "448eba03267287302e7f007290fb4105",
"score": "0.5237389",
"text": "def clone(target)\n clone_request = ::Google::Sql::Network::Post.new(\n gsql_instance_clone, @cred, 'application/json', {\n cloneContext: { kind: 'sql#cloneContext',\n destinationInstanceName: target }\n }.to_json\n )\n response = JSON.parse(clone_request.send.body)\n raise Puppet::Error, response['error']['errors'][0]['message'] \\\n if response['error']\n end",
"title": ""
},
{
"docid": "235854a3b670d2605baf2c87ad5ad89d",
"score": "0.5209286",
"text": "def create_db_instance(identifier, instance_class, allocated_storage, master_username, master_password, options={})\n params = {}\n params['DBInstanceIdentifier'] = identifier\n params['DBInstanceClass'] = instance_class\n params['AllocatedStorage'] = allocated_storage\n params['MasterUsername'] = master_username\n params['MasterUserPassword'] = master_password\n\n params['Engine'] = options[:engine] || \"MySQL5.1\"\n params['DBName'] = options[:db_name] if options[:db_name]\n params['AvailabilityZone'] = options[:availability_zone] if options[:availability_zone]\n params['PreferredMaintenanceWindow'] = options[:preferred_maintenance_window] if options[:preferred_maintenance_window]\n params['BackupRetentionPeriod'] = options[:preferred_retention_period] if options[:preferred_retention_period]\n params['PreferredBackupWindow'] = options[:preferred_backup_window] if options[:preferred_backup_window]\n\n @logger.info(\"Creating DB Instance called #{identifier}\")\n\n link = do_request(\"CreateDBInstance\", params, :pull_out_single=>[:create_db_instance_result, :db_instance])\n\n rescue Exception\n on_exception\n end",
"title": ""
},
{
"docid": "e93a8aa19b3deec255cc6f397c65e8cb",
"score": "0.52044666",
"text": "def create_snapshot name, type, kwargs={}\n resource_name = kwargs.arg :resource_name, ''\n\n if type != 'mirror' && type != 'repo' && type != 'empty'\n raise AptlyError.new \"Invalid snapshot type: #{type}\"\n end\n\n if list_snapshots.include? name\n raise AptlyError.new \"Snapshot '#{name}' exists\"\n end\n\n if type == 'mirror' && !list_mirrors.include?(resource_name)\n raise AptlyError.new \"Mirror '#{resource_name}' does not exist\"\n end\n\n if type == 'repo' && !list_repos.include?(resource_name)\n raise AptlyError.new \"Repo '#{resource_name}' does not exist\"\n end\n\n cmd = 'aptly snapshot create'\n cmd += \" #{name.quote}\"\n if type == 'empty'\n cmd += ' empty'\n else\n cmd += \" from #{type} #{resource_name.quote}\"\n end\n\n runcmd cmd\n Snapshot.new name\n end",
"title": ""
},
{
"docid": "ff42e3ad91d24e697fb8976e38a931f4",
"score": "0.51905406",
"text": "def create_db_instance_read_replica(instance_identifier, source_identifier, options={})\n \n \n request({\n 'Action' => 'CreateDBInstanceReadReplica',\n 'DBInstanceIdentifier' => instance_identifier,\n 'SourceDBInstanceIdentifier' => source_identifier,\n :parser => Fog::Parsers::AWS::RDS::CreateDBInstanceReadReplica.new,\n }.merge(options))\n end",
"title": ""
},
{
"docid": "5378d0a2cfde1a0dcc36799f39b8f5bf",
"score": "0.5171865",
"text": "def prepare_ec2(ec2, subnet, vpc, image_ref, ssh_ip, instance_type)\n ec2_new = deep_copy(ec2)\n #ec2_old = deep_copy(ec2['Resources']['MyEC2Instance'])\n\n #assign the values accordingly\n ec2_new['Resources'][\"MyEC2Instance\"][\"Properties\"][\"ImageId\"][\"Ref\"] = image_ref\n ec2_new['Resources'][\"MyEC2Instance\"][\"Properties\"][\"InstanceType\"] = instance_type\n ec2_new['Resources'][\"MyEC2Instance\"][\"Properties\"][\"SubnetId\"][\"Ref\"] = subnet\n ec2_new['Resources'][\"InstanceSecurityGroup\"][\"Properties\"][\"VpcId\"][\"Ref\"] = vpc\n ec2_new['Resources'][\"InstanceSecurityGroup\"][\"Properties\"][\"SecurityGroupIngress\"][0][\"CidrIp\"] = ssh_ip\n\n ec2_new\n end",
"title": ""
},
{
"docid": "952e6771c812a2d989db8ee960af90a5",
"score": "0.5158081",
"text": "def create_snapshot suggestion=Time.now\n name = snapshot_name(suggestion)\n connection.execute(\"CREATE TABLE #{name} AS SELECT * FROM #{table_name}\")\n name\n end",
"title": ""
},
{
"docid": "b66dc8152260c8285b68942cdb371615",
"score": "0.5150335",
"text": "def provision(vdb, group, mount, template, repository, database)\n Delphix.post Delphix.database_url + '/provision',\n container: {\n group: group,\n name: vdb,\n type: 'OracleDatabaseContainer'\n },\n source: {\n type: 'OracleVirtualSource',\n mountBase: mount,\n configTemplate: template,\n },\n sourceConfig: {\n type: 'OracleSIConfig',\n databaseName: vdb,\n uniqueName: vdb,\n repository: repository,\n instance: {\n type: 'OracleInstance',\n instanceName: vdb,\n instanceNumber: 1\n }\n },\n timeflowPointParameters: {\n type: 'TimeflowPointSemantic',\n container: database,\n location: 'LATEST_POINT'\n },\n type: 'OracleProvisionParameters'\n end",
"title": ""
},
{
"docid": "e6ff28eb6504a91bfc16fa1f2e5fa241",
"score": "0.51489073",
"text": "def make_snapshot(server_id,options)\n data = JSON.generate(:createImage => options)\n response = req(\"POST\",svrmgmthost,\"#{@svrmgmtpath}/servers/#{server_id}/action\",svrmgmtport,svrmgmtscheme,{'content-type' => 'application/json'},data)\n OpenStack::Compute::Exception.raise_exception(response) unless response.code.match(/^20.$/)\n end",
"title": ""
},
{
"docid": "bb37c0b544c7a67c91fdecc7215fd1bf",
"score": "0.51249987",
"text": "def create_snapshot(volume_id, description, region)\n ec2 = Aws::EC2::Client.new(region: region)\n resp = ec2.create_snapshot(\n volume_id: volume_id,\n description: \"#{description}-#{Time.now.utc.strftime(\"%Y-%m-%d.%H%M%S\")}\",\n )\n puts \"Created snapshot #{resp[:snapshot_id]} of volume #{volume_id}\"\n end",
"title": ""
},
{
"docid": "b607a7fd6500a203d63c19c9544cf46a",
"score": "0.5119943",
"text": "def CreateSnapshot(args)\n args = deep_copy(args)\n success = Convert.to_boolean(SCR.Execute(path(\".snapper.create\"), args))\n if !success\n err_map = LastSnapperErrorMap()\n type = Ops.get_string(err_map, \"type\", \"\")\n details = _(\"Reason not known.\")\n\n if type == \"wrong_snapshot_type\"\n details = _(\"Wrong snapshot type given.\")\n elsif type == \"pre_not_given\"\n details = _(\"'Pre' snapshot was not given.\")\n elsif type == \"pre_not_found\"\n details = _(\"Given 'Pre' snapshot was not found.\")\n end\n\n Builtins.y2warning(\"creating failed with '%1'\", err_map)\n # error popup\n Report.Error(\n Builtins.sformat(_(\"Failed to create new snapshot:\\n%1\"), details)\n )\n end\n success\n end",
"title": ""
},
{
"docid": "5afb89b757d1db914510d616c679eb03",
"score": "0.51020354",
"text": "def create_volume_from_snapshot(snapshot_id, availability_zone)\n post_message(\"going to create a new EBS volume from the specified snapshot...\")\n @logger.debug \"create volume in zone #{availability_zone}\"\n start_time = Time.new.to_i\n res = ec2_handler().create_volume(:snapshot_id => snapshot_id, :availability_zone => availability_zone)\n volume_id = res['volumeId']\n started = false\n while !started\n sleep(5)\n #TODO: check for timeout?\n res = ec2_handler().describe_volumes(:volume_id => volume_id)\n state = res['volumeSet']['item'][0]['status']\n @logger.debug \"volume state #{state}\"\n if state == 'available'\n started = true\n end\n end\n end_time = Time.new.to_i\n @logger.info \"create volume from snapshot took #{(end_time-start_time)}s\"\n post_message(\"EBS volume #{volume_id} is ready (took #{end_time-start_time}s)\")\n return volume_id\n end",
"title": ""
},
{
"docid": "57f9663978fd772319d454f2d8b919d6",
"score": "0.50980556",
"text": "def deploy\n raise ArgumentError, \"database.name Required\" unless name\n raise ArgumentError, \"database.server Required\" unless server\n raise ArgumentError, \"database.user Required\" unless user\n raise ArgumentError, \"database.password Required\" unless password\n raise ArgumentError, \"database.aws_access_key_id Required\" unless aws_access_key_id\n raise ArgumentError, \"database.aws_secret_access_key Required\" unless aws_secret_access_key\n \n \n @rds = Hugo::Aws::Rds.find_or_create( :name => name,\n :server => server,\n :user => user,\n :password => password,\n :size => size,\n :zone => zone,\n :db_security_group => db_security_group,\n :aws_access_key_id => aws_access_key_id,\n :aws_secret_access_key => aws_secret_access_key\n \n )\n self\n end",
"title": ""
},
{
"docid": "0bf21220358460a8ee1498f9a4824aee",
"score": "0.50892",
"text": "def create_db_instance_read_replica(instance_identifier, source_identifier, options={})\n request({\n 'Action' => 'CreateDBInstanceReadReplica',\n 'DBInstanceIdentifier' => instance_identifier,\n 'SourceDBInstanceIdentifier' => source_identifier,\n :parser => Fog::Parsers::AWS::RDS::CreateDBInstanceReadReplica.new,\n }.merge(options))\n end",
"title": ""
},
{
"docid": "a52999d102a15d848e2a7230775c6ea4",
"score": "0.5075822",
"text": "def create_backup\n run_script(\"backup\", s_one)\n wait_for_snapshots\n end",
"title": ""
},
{
"docid": "d4177c607b0252c2da6627049015a691",
"score": "0.50662583",
"text": "def create_ebs_snapshot(volume_id, snapshot_desc, tags = [])\n snapshot_info = @ec2.create_snapshot(\n volume_id: volume_id,\n description: snapshot_desc\n )\n\n @ec2.wait_until(:snapshot_completed, snapshot_ids: [snapshot_info.snapshot_id]) do |w|\n w.max_attempts = WAITER_MAX_ATTEMPS\n w.delay = WAITER_DELAY\n end\n\n @ec2.create_tags(resources: [snapshot_info.snapshot_id], tags: tags) unless tags.empty?\n\n snapshot_info\n end",
"title": ""
},
{
"docid": "c1604e2def7ba18d01cfb0994655e8ba",
"score": "0.5052937",
"text": "def createDb\n # Shared configuration elements between most database creation styles\n config = {\n db_instance_identifier: @config['identifier'],\n db_instance_class: @config[\"size\"],\n engine: @config[\"engine\"],\n auto_minor_version_upgrade: @config[\"auto_minor_version_upgrade\"],\n license_model: @config[\"license_model\"],\n db_subnet_group_name: @config[\"subnet_group_name\"],\n publicly_accessible: @config[\"publicly_accessible\"],\n copy_tags_to_snapshot: true,\n tags: allTags\n }\n\n unless @config[\"add_cluster_node\"]\n config[:storage_type] = @config[\"storage_type\"] \n config[:port] = @config[\"port\"] if @config[\"port\"]\n config[:iops] = @config[\"iops\"] if @config['storage_type'] == \"io1\"\n config[:multi_az] = @config['multi_az_on_create']\n end\n\n if @config[\"creation_style\"] == \"new\"\n unless @config[\"add_cluster_node\"]\n config[:preferred_backup_window] = @config[\"preferred_backup_window\"]\n config[:backup_retention_period] = @config[\"backup_retention_period\"]\n config[:storage_encrypted] = @config[\"storage_encrypted\"]\n config[:allocated_storage] = @config[\"storage\"]\n config[:db_name] = @config[\"db_name\"]\n config[:master_username] = @config['master_user']\n config[:master_user_password] = @config['password']\n config[:vpc_security_group_ids] = @config[\"vpc_security_group_ids\"]\n end\n\n config[:engine_version] = @config[\"engine_version\"]\n config[:preferred_maintenance_window] = @config[\"preferred_maintenance_window\"] if @config[\"preferred_maintenance_window\"]\n config[:db_parameter_group_name] = @config[\"parameter_group_name\"] if @config[\"parameter_group_name\"]\n config[:db_cluster_identifier] = @config[\"cluster_identifier\"] if @config[\"add_cluster_node\"]\n end\n \n if %w{existing_snapshot new_snapshot}.include?(@config[\"creation_style\"])\n config[:db_snapshot_identifier] = @config[\"snapshot_id\"]\n end\n\n if @config[\"creation_style\"] == \"point_in_time\"\n point_in_time_config = config\n point_in_time_config.delete(:db_instance_identifier)\n point_in_time_config[:source_db_instance_identifier] = @config['source_identifier']\n point_in_time_config[:target_db_instance_identifier] = @config['identifier']\n point_in_time_config[:restore_time] = @config['restore_time'] unless @config[\"restore_time\"] == \"latest\"\n point_in_time_config[:use_latest_restorable_time] = true if @config['restore_time'] == \"latest\"\n end\n\n if @config[\"read_replica_of\"]# || @config[\"create_read_replica\"]\n srcdb = @config['source_identifier']\n if @config[\"read_replica_of\"][\"region\"] and @config['region'] != @config[\"read_replica_of\"][\"region\"]\n srcdb = MU::Cloud::AWS::Database.getARN(@config['source_identifier'], \"db\", \"rds\", region: @config[\"read_replica_of\"][\"region\"], credentials: @config['credentials'])\n end\n read_replica_struct = {\n db_instance_identifier: @config['identifier'],\n source_db_instance_identifier: srcdb,\n db_instance_class: @config[\"size\"],\n auto_minor_version_upgrade: @config[\"auto_minor_version_upgrade\"],\n publicly_accessible: @config[\"publicly_accessible\"],\n tags: allTags,\n db_subnet_group_name: @config[\"subnet_group_name\"],\n storage_type: @config[\"storage_type\"]\n }\n\n read_replica_struct[:port] = @config[\"port\"] if @config[\"port\"]\n read_replica_struct[:iops] = @config[\"iops\"] if @config['storage_type'] == \"io1\"\n end\n\n # Creating DB instance\n attempts = 0\n\n begin\n if %w{existing_snapshot new_snapshot}.include?(@config[\"creation_style\"])\n MU.log \"Creating database instance #{@config['identifier']} from snapshot #{@config[\"snapshot_id\"]}\"\n resp = MU::Cloud::AWS.rds(region: @config['region'], credentials: @config['credentials']).restore_db_instance_from_db_snapshot(config)\n elsif @config[\"creation_style\"] == \"point_in_time\"\n MU.log \"Creating database instance #{@config['identifier']} based on point in time backup #{@config['restore_time']} of #{@config['source_identifier']}\"\n resp = MU::Cloud::AWS.rds(region: @config['region'], credentials: @config['credentials']).restore_db_instance_to_point_in_time(point_in_time_config)\n elsif @config[\"read_replica_of\"]\n MU.log \"Creating read replica database instance #{@config['identifier']} for #{@config['source_identifier']}\"\n begin\n resp = MU::Cloud::AWS.rds(region: @config['region'], credentials: @config['credentials']).create_db_instance_read_replica(read_replica_struct)\n rescue Aws::RDS::Errors::DBSubnetGroupNotAllowedFault => e\n MU.log \"Being forced to use source database's subnet group: #{e.message}\", MU::WARN\n read_replica_struct.delete(:db_subnet_group_name)\n resp = MU::Cloud::AWS.rds(region: @config['region'], credentials: @config['credentials']).create_db_instance_read_replica(read_replica_struct)\n end\n elsif @config[\"creation_style\"] == \"new\"\n MU.log \"Creating pristine database instance #{@config['identifier']} (#{@config['name']}) in #{@config['region']}\"\n resp = MU::Cloud::AWS.rds(region: @config['region'], credentials: @config['credentials']).create_db_instance(config)\n end\n rescue Aws::RDS::Errors::InvalidParameterValue => e\n if attempts < 5\n MU.log \"Got #{e.inspect} creating #{@config['identifier']}, will retry a few times in case of transient errors.\", MU::WARN, details: config\n attempts += 1\n sleep 10\n retry\n else\n raise MuError, \"Exhausted retries trying to create database instance #{@config['identifier']}: #{e.inspect}\"\n end\n end\n\n wait_start_time = Time.now\n retries = 0\n\n begin\n MU::Cloud::AWS.rds(region: @config['region'], credentials: @config['credentials']).wait_until(:db_instance_available, db_instance_identifier: @config['identifier']) do |waiter|\n # Does create_db_instance implement wait_until_available ?\n waiter.max_attempts = nil\n waiter.before_attempt do |attempts|\n MU.log \"Waiting for RDS database #{@config['identifier']} to be ready..\", MU::NOTICE if attempts % 10 == 0\n end\n waiter.before_wait do |attempts, resp|\n throw :success if resp.db_instances.first.db_instance_status == \"available\"\n throw :failure if Time.now - wait_start_time > 3600\n end\n end\n rescue Aws::Waiters::Errors::TooManyAttemptsError => e\n raise MuError, \"Waited #{(Time.now - wait_start_time).round/60*(retries+1)} minutes for #{@config['identifier']} to become available, giving up. #{e}\" if retries > 2\n wait_start_time = Time.now\n retries += 1\n retry\n end\n\n database = MU::Cloud::AWS::Database.getDatabaseById(@config['identifier'], region: @config['region'], credentials: @config['credentials'])\n MU::Cloud::AWS::DNSZone.genericMuDNSEntry(name: database.db_instance_identifier, target: \"#{database.endpoint.address}.\", cloudclass: MU::Cloud::Database, sync_wait: @config['dns_sync_wait'])\n MU.log \"Database #{@config['name']} is at #{database.endpoint.address}\", MU::SUMMARY\n if @config['auth_vault']\n MU.log \"knife vault show #{@config['auth_vault']['vault']} #{@config['auth_vault']['item']} for Database #{@config['name']} credentials\", MU::SUMMARY\n end\n\n # If referencing an existing DB, insert this deploy's DB security group so it can access db\n if @config[\"creation_style\"] == 'existing'\n vpc_sg_ids = []\n database.vpc_security_groups.each { |vpc_sg|\n vpc_sg_ids << vpc_sg.vpc_security_group_id\n }\n\n localdeploy_rule = @deploy.findLitterMate(type: \"firewall_rule\", name: \"database\"+@config['name'])\n if localdeploy_rule.nil?\n raise MU::MuError, \"Database #{@config['name']} failed to find its generic security group 'database#{@config['name']}'\"\n end\n MU.log \"Found this deploy's DB security group: #{localdeploy_rule.cloud_id}\", MU::DEBUG\n vpc_sg_ids << localdeploy_rule.cloud_id\n mod_config = Hash.new\n mod_config[:vpc_security_group_ids] = vpc_sg_ids\n mod_config[:db_instance_identifier] = @config[\"identifier\"]\n\n MU::Cloud::AWS.rds(region: @config['region'], credentials: @config['credentials']).modify_db_instance(mod_config)\n MU.log \"Modified database #{@config['identifier']} with new security groups: #{mod_config}\", MU::NOTICE\n end\n\n # When creating from a snapshot, some of the create arguments aren't\n # applicable- but we can apply them after the fact with a modify.\n if %w{existing_snapshot new_snapshot point_in_time}.include?(@config[\"creation_style\"]) or @config[\"read_replica_of\"]\n mod_config = Hash.new\n if !@config[\"read_replica_of\"]\n mod_config[:preferred_backup_window] = @config[\"preferred_backup_window\"]\n mod_config[:backup_retention_period] = @config[\"backup_retention_period\"]\n mod_config[:engine_version] = @config[\"engine_version\"]\n mod_config[:allow_major_version_upgrade] = @config[\"allow_major_version_upgrade\"] if @config['allow_major_version_upgrade']\n mod_config[:db_parameter_group_name] = @config[\"parameter_group_name\"] if @config[\"parameter_group_name\"]\n mod_config[:master_user_password] = @config['password']\n mod_config[:allocated_storage] = @config[\"storage\"] if @config[\"storage\"]\n end\n mod_config[:db_instance_identifier] = database.db_instance_identifier\n mod_config[:preferred_maintenance_window] = @config[\"preferred_maintenance_window\"] if @config[\"preferred_maintenance_window\"]\n mod_config[:vpc_security_group_ids] = @config[\"vpc_security_group_ids\"]\n mod_config[:apply_immediately] = true\n\n MU::Cloud::AWS.rds(region: @config['region'], credentials: @config['credentials']).modify_db_instance(mod_config)\n wait_start_time = Time.now\n retries = 0\n\n begin\n MU::Cloud::AWS.rds(region: @config['region'], credentials: @config['credentials']).wait_until(:db_instance_available, db_instance_identifier: @config['identifier']) do |waiter|\n # Does create_db_instance implement wait_until_available ?\n waiter.max_attempts = nil\n waiter.before_attempt do |attempts|\n MU.log \"Waiting for RDS database #{@config['identifier'] } to be ready..\", MU::NOTICE if attempts % 10 == 0\n end\n waiter.before_wait do |attempts, resp|\n throw :success if resp.db_instances.first.db_instance_status == \"available\"\n throw :failure if Time.now - wait_start_time > 2400\n end\n end\n rescue Aws::Waiters::Errors::TooManyAttemptsError => e\n raise MuError, \"Waited #{(Time.now - wait_start_time).round/60*(retries+1)} minutes for #{@config['identifier']} to become available, giving up. #{e}\" if retries > 2\n wait_start_time = Time.now\n retries += 1\n retry\n end\n end\n\n # Maybe wait for DB instance to be in available state. DB should still be writeable at this state\n if @config['allow_major_version_upgrade'] && @config[\"creation_style\"] == \"new\"\n MU.log \"Setting major database version upgrade on #{@config['identifier']}'\"\n MU::Cloud::AWS.rds(region: @config['region'], credentials: @config['credentials']).modify_db_instance(\n db_instance_identifier: @config['identifier'],\n apply_immediately: true,\n allow_major_version_upgrade: true\n )\n end\n\n MU.log \"Database #{@config['identifier']} is ready to use\"\n return database.db_instance_identifier\n end",
"title": ""
},
{
"docid": "d075278562b928223a12dfb3585be218",
"score": "0.5047752",
"text": "def create_snapshot_mirror(mirror, prefix)\n snapshot = \"#{prefix}#{@separator}#{@now}\"\n @logger.info \"Creating snapshot from mirror \\\"#{mirror}\\\" at \\\"#{snapshot}\\\"\"\n\n update_mirror(mirror)\n run(@aptly_cmd, 'snapshot', 'create', snapshot,\n 'from', 'mirror', mirror)\n\n snapshot\n end",
"title": ""
},
{
"docid": "cf631c601c6c190693b07fdd8932e0d0",
"score": "0.5043451",
"text": "def psql_db_derivative__sample_full_from_3 psql_db, superuser_psql_db, source_psql_db\n\n superuser_psql_db = array__from(superuser_psql_db)\n source_psql_db = array__from(source_psql_db)\n psql_db = array__from psql_db\n superuser_psql_db = array__from superuser_psql_db\n\n psql_db__superuser = psql_db__name_from(\n superuser_psql_db,\n psql_db\n )\n\n dump_serial_number = string__small_sn_2019\n source_psql_db = array__from(source_psql_db)\n backup_db_dump = \"/tmp/dump__backup_#{psql_db__superuser[0]}_#{dump_serial_number}.sql\"\n source_db_dump = \"/tmp/dump__source_#{source_psql_db[0]}_#{dump_serial_number}.sql\"\n [\n backup_db_dump,\n psql_db__superuser, # psql_db, having database access info\n [\n source_db_dump,\n source_psql_db,\n ],\n # list of dumps to apply is the\n # backup list of another derivative\n \"ON_ERROR_STOP=off\",\n psql_db, # psql_db, having the user to assign the db\n \"reset\", # set reset to true\n ]\n end",
"title": ""
},
{
"docid": "21ffe35a8ab56ee6d181ee2f114b9259",
"score": "0.50368696",
"text": "def getExistingSnapshot\n src_ref = MU::Config::Ref.get(@config[\"source\"])\n resp =\n if @config[\"create_cluster\"]\n MU::Cloud::AWS.rds(region: @region, credentials: @credentials).describe_db_cluster_snapshots(db_cluster_snapshot_identifier: src_ref.id)\n else\n MU::Cloud::AWS.rds(region: @region, credentials: @credentials).describe_db_snapshots(db_snapshot_identifier: src_ref.id)\n end\n\n snapshots = @config[\"create_cluster\"] ? resp.db_cluster_snapshots : resp.db_snapshots\n\n if snapshots.empty?\n nil\n else\n sorted_snapshots = snapshots.sort_by { |snap| snap.snapshot_create_time }\n @config[\"create_cluster\"] ? sorted_snapshots.last.db_cluster_snapshot_identifier : sorted_snapshots.last.db_snapshot_identifier\n end\n end",
"title": ""
},
{
"docid": "5d8fc7e99a116aa830bfa9b850955fd0",
"score": "0.5036491",
"text": "def restore_snapshot(env, server_id, snapshot_id)\n instance_exists do\n post(\n env,\n \"#{@session.endpoints[:compute]}/servers/#{server_id}/action\",\n { rebuild: { imageRef: snapshot_id } }.to_json)\n end\n end",
"title": ""
},
{
"docid": "e2782d2612d22f0df3f742864560e058",
"score": "0.503482",
"text": "def create_db2_database(source)\n ChefSpec::Matchers::ResourceMatcher.new(:db2_database, :create, source)\n end",
"title": ""
},
{
"docid": "5fdbbe36aadcf4fbc6be0aaca92bff46",
"score": "0.50308",
"text": "def latest_rds_snapshot_of(db_instance_id)\n rds = AWS::RDS.new(@task.aws_config)\n candidate = nil\n rds.snapshots.each do |snap|\n next unless snap.db_instance_id == db_instance_id\n\n if candidate.nil? || candidate.created_at < snap.created_at\n candidate = snap\n end\n end\n candidate.nil? ? nil : candidate.id\n end",
"title": ""
},
{
"docid": "46137123996afbb5950afccea6682dd1",
"score": "0.5023156",
"text": "def create_instance(instance)\n node_name = instance['node_name']\n secgroup = instance['secgroup']\n av_zone = instance['av_zone']\n base_subnet = instance['base_subnet']\n term_protect = instance['secure']\n # Override for default size\n if !instance['size'].nil?\n instance_type = instance['size']\n else\n instance_type = instance['instance_type']\n end\n\n # Override for ami\n if !instance['ami'].nil?\n cfg_ami = instance['ami']\n else\n cfg_ami = instance['cfg_ami']\n end\n\n connect = aws_api_connect('EC2_Resource')\n begin\n dest = connect.create_instances({\n :image_id => \"#{cfg_ami}\", # required\n :min_count => 1, # required\n :max_count => 1, # required\n :security_group_ids => [secgroup],\n :placement => {\n :availability_zone => \"#{av_zone}\",\n },\n :instance_type => \"#{instance_type}\",\n :disable_api_termination => \"#{term_protect}\",\n :instance_initiated_shutdown_behavior => 'stop',\n :subnet_id => \"#{base_subnet}\",\n :key_name => \"ngroot\",\n :monitoring => {\n :enabled => false, # required\n }\n })\n rescue Aws::EC2::Errors::InstanceLimitExceeded => e\n logger.error(\"Error: #{e}\")\n abort\n end\n\n # Extract useful info from Instance Resource\n destid = dest.map(&:id)[0]\n destip = dest.map(&:private_ip_address)[0]\n\n # Names the instance in the Aws console\n begin\n dest.batch_create_tags({\n :resources => [\"#{destid}\"],\n :tags => [\n {\n :key => \"Name\",\n :value => \"#{node_name}\",\n },\n ],\n })\n rescue NoMethodError => e\n # Older create_tags method fallback for older Apis (China)\n logger.warn \"Falling back to old Aws api for tag creation\"\n dest.create_tags({\n :resources => [\"#{destid}\"],\n :tags => [\n {\n :key => \"Name\",\n :value => \"#{node_name}\",\n },\n ],\n }) \n end\n\n # Initiate post-instance waiter\n begin\n wait = aws_api_connect('EC2_Client')\n logger.info(\"Instance #{destid} at #{destip} is now being created.\")\n logger.info(\"Waiting for aws to report status ok...\")\n wait.wait_until(:instance_status_ok, instance_ids:[destid])\n rescue Aws::Waiters::Errors::WaiterFailed => e\n logger.fatal(\"Wait failed, please check the instance stats in the Aws console.\\n#{e}\")\n abort\n end\n return destip\n end",
"title": ""
},
{
"docid": "8e068cf7b67f7132623a5ea530710842",
"score": "0.5019169",
"text": "def create opts = {}\n if volume = opts.delete(:volume)\n opts[:volume_id] = volume.id\n end\n resp = client.create_snapshot(opts)\n Snapshot.new(resp.snapshot_id, :config => config)\n end",
"title": ""
},
{
"docid": "95af8e40aed226d37e44696a7e484710",
"score": "0.5003472",
"text": "def snapshot(name=\"snapshot_#{Time.now.strftime(\"%m%d\")}\")\n command = 'snapshot'\n vm_command = %Q{#{@base_command} #{command} \"#{@datastore}\" #{name}}\n log vm_command\n result = system(vm_command)\n result ? log(\"SnapShot successful\") : log(\"Error! VM SnapShot failed.\")\n result\n end",
"title": ""
},
{
"docid": "fe31af78b0c5ba56f6a0e3d4ace966a8",
"score": "0.50029635",
"text": "def restore_sptn_database args = nil\n restore_iptn_database args\n end",
"title": ""
},
{
"docid": "c273d902f99b722be4ff1f26fc7ca65b",
"score": "0.49977383",
"text": "def db_snapshot (sql = 'coder_test_snapshot.sql')\n raise \"db snapshot failed: #{@db_last_result}\" unless sqlcmd(sql, ENV['DATABASE_NAME'], nil, \"sa\", \"password*8\")\n true\nend",
"title": ""
},
{
"docid": "fe9afb57f75e017cb9645cbc8aa401da",
"score": "0.4992008",
"text": "def disk_snapshot_create(id, drv_message)\n xml_data = decode(drv_message)\n action = ACTION[:disk_snapshot_create]\n\n # Check that live snapshot is supported\n vmm_driver_path = 'VM/HISTORY_RECORDS/HISTORY/VM_MAD'\n tm_driver_path = \"VM/TEMPLATE/DISK[DISK_SNAPSHOT_ACTIVE='YES']/TM_MAD\"\n\n vmm_driver = ensure_xpath(xml_data, id, action,\n vmm_driver_path) || return\n tm_driver = ensure_xpath(xml_data, id, action,\n tm_driver_path) || return\n\n if !LIVE_DISK_SNAPSHOTS.include?(\"#{vmm_driver}-#{tm_driver}\")\n send_message(action, RESULT[:failure], id,\n \"Cannot perform a live #{action} operation\")\n return\n end\n\n # Get TM command\n tm_command = ensure_xpath(xml_data, id, action, 'TM_COMMAND') || return\n\n tm_command_split = tm_command.split\n tm_command_split[0].sub!('.', '_LIVE.') \\\n || (tm_command_split[0] += '_LIVE')\n\n action = VmmAction.new(self, id, :disk_snapshot_create, drv_message)\n\n steps = [\n {\n :driver => :tm,\n :action => :tm_snap_create_live,\n :parameters => tm_command_split\n }\n ]\n\n action.run(steps)\n end",
"title": ""
},
{
"docid": "d007ee816b723ec7b81bfabf6d153ce9",
"score": "0.49885297",
"text": "def backup_instance(instance, tenant_id, auth_token)\n timestamp = Time.now.strftime(\"%Y%m%d%H%M%S\")\n \n printf \" %-20s...\", instance.name\n STDOUT.flush\n \n instance.snapshot_name = \"snapshot-#{instance.name}-#{timestamp}\"\n \n # Submit the snapshot request. Save the image location.\n request_body = {\n createImage: {\n name: \"#{instance.snapshot_name}\"\n }\n }.to_json\n image_location_uri = compute_api_action(\"/servers/#{instance.id}/action\", request_body, tenant_id, auth_token)[:location]\n \n # Grab the images id.\n image_id = /.+\\/(\\S+)$/.match(image_location_uri)[1]\n \n # Wait for the job to complete.\n if (poll_for_image(image_location_uri, auth_token))\n puts \"success\"\n instance.image_id = image_id\n else\n puts \"FAILED\"\n end\nend",
"title": ""
},
{
"docid": "ef8090c045d445f7b03738fcb8512352",
"score": "0.49760967",
"text": "def create_storage_snapshot(volume_id, create_opts={})\n create_resource :storage_snapshot, create_opts.merge(:volume_id => volume_id)\n end",
"title": ""
},
{
"docid": "be945e2735066690baf7abb8dfd1c974",
"score": "0.49627498",
"text": "def snapshot!(new_name)\n vm_ref = proxy.snapshot(new_name)\n model_instance(vm_ref, 'VM')\n end",
"title": ""
},
{
"docid": "49f4136231c4680853e0c5fb7df265d9",
"score": "0.49600396",
"text": "def create_backup source_table, backup_id, expire_time\n source_table_id = source_table.respond_to?(:name) ? source_table.name : source_table\n grpc = service.create_backup instance_id: instance_id,\n cluster_id: cluster_id,\n backup_id: backup_id,\n source_table_id: source_table_id,\n expire_time: expire_time\n Backup::Job.from_grpc grpc, service\n end",
"title": ""
},
{
"docid": "456d30fad7bf029aadd7dcbe5e57573d",
"score": "0.4953154",
"text": "def create_managed_disk_from_snapshot(resource_group_name, disk_params, snapshot_name)\n disk_url = rest_api_url(REST_API_PROVIDER_COMPUTE, REST_API_DISKS, resource_group_name: resource_group_name, name: disk_params[:name])\n snapshot_url = rest_api_url(REST_API_PROVIDER_COMPUTE, REST_API_SNAPSHOTS, resource_group_name: resource_group_name, name: snapshot_name)\n disk = {\n 'location' => disk_params[:location],\n 'sku' => {\n 'name' => disk_params[:account_type]\n },\n 'properties' => {\n 'creationData' => {\n 'createOption' => 'Copy',\n 'sourceResourceId' => snapshot_url\n }\n }\n }\n disk['zones'] = [disk_params[:zone]] unless disk_params[:zone].nil?\n disk['tags'] = disk_params[:tags] unless disk_params[:tags].nil?\n http_put(disk_url, disk)\n end",
"title": ""
},
{
"docid": "8942514d1ac43875ff67649c693cb594",
"score": "0.49387556",
"text": "def create_mirror_snapshot name, mirror_name\n create_snapshot name, 'mirror', :resource_name => mirror_name\n end",
"title": ""
},
{
"docid": "5241550ba69ca043fe48fa4b88347ab4",
"score": "0.49281383",
"text": "def new_input_set()\n return RestoreDBInstanceFromDBSnapshotInputSet.new()\n end",
"title": ""
},
{
"docid": "5e0500a28d9f653dfec9876de179f15f",
"score": "0.49086493",
"text": "def copy_snapshot(ec2:, snapshots:)\n log.info \"Copying #{snapshots.keys.join}\"\n new_snapshot_ids = []\n snapshots.each do |snapshot_id, description|\n snapshot = ec2.copy_snapshot(source_region: @region,\n source_snapshot_id: snapshot_id,\n description: \"IR Copy | #{description}\",\n destination_region: @region)\n new_snapshot_ids << snapshot.snapshot_id\n end\n new_snapshot_ids\n end",
"title": ""
},
{
"docid": "b7dbf65f93c1fe8d28eaad7938032117",
"score": "0.4897503",
"text": "def snapshot_create(deploy_id)\n rc, info = do_action(\n \"virsh -c #{@uri} snapshot-create-as #{deploy_id}\")\n\n exit info if rc == false\n\n hypervisor_id = info.split[2]\n\n return hypervisor_id\n end",
"title": ""
},
{
"docid": "c9c8b097d5801383015b1c9bc5182664",
"score": "0.48941252",
"text": "def create_aws_instance(options)\n image_id = options['q_struct']['source_ami'].value\n min_count = options['q_struct']['min_count'].value\n max_count = options['q_struct']['max_count'].value\n dry_run = options['q_struct']['dry_run'].value\n instance_type = options['q_struct']['instance_type'].value\n key_name = options['q_struct']['key_name'].value\n security_groups = options['q_struct']['security_group'].value\n if security_groups.match(/,/)\n security_groups = security_groups.split(/,/)\n else\n security_groups = [ security_groups ]\n end\n if key_name == options['empty']\n handle_output(options,\"Warning:\\tNo key specified\")\n quit(options)\n end\n if not image_id.match(/^ami/)\n old_image_id = image_id\n ec2,image_id = get_aws_image(image_id,options)\n handle_output(options,\"Information:\\tFound Image ID #{image_id} for #{old_image_id}\")\n end\n ec2 = initiate_aws_ec2_client(options)\n instances = []\n begin\n reservations = ec2.run_instances(image_id: image_id, min_count: min_count, max_count: max_count, instance_type: instance_type, dry_run: dry_run, key_name: key_name, security_groups: security_groups,)\n rescue Aws::EC2::Errors::AccessDenied\n handle_output(options,\"Warning:\\tUser needs to be specified appropriate rights in AWS IAM\")\n quit(options)\n end\n reservations['instances'].each do |instance|\n instance_id = instance.instance_id\n instances.push(instance_id)\n end\n instances.each do |id|\n options['instance'] = id\n list_aws_instances(options)\n end\n return options\nend",
"title": ""
},
{
"docid": "3698cae2dbe1326f9ed900a8df78abc2",
"score": "0.48930663",
"text": "def restore_db_from_backup(args = {})\n # We need to get our list of files to restore from based on the database name\n # and the host it was backed up from.\n args[:src_db] = @src_db unless args.has_key?(:src_db)\n args[:src_host] = @src_host unless args.has_key?(:src_host)\n args[:backup_files] = @task_results[args[:src_host]][args[:src_db]][:backup_files] unless args.has_key?(:backup_files)\n args[:per_table] = @task_results[args[:src_host]][args[:src_db]][:type] == :per_table ? true : false\n \n # Set args[:dest_db] to args[:src_db] if we haven't received a name for it\n args[:dest_db] = args[:src_db] unless args.has_key?(:dest_db)\n \n # Return to normal operations\n args.has_key?(:text_filter) ? @text_filter = args[:text_filter] : args[:text_filter] = @text_filter\n args.has_key?(:dest_host) ? @dest_host = args[:dest_host] : args[:dest_host] = @dest_host\n args[:crash_if_exists] = false unless args.has_key?(:crash_if_exists)\n args[:overwrite_if_exists] = false unless args.has_key?(:overwrite_if_exists)\n args[:user] = Mysqladmin::Pool.connections[args[:dest_host]][:user] unless args.has_key?(:user)\n args[:password] = Mysqladmin::Pool.connections[args[:dest_host]][:password] unless args.has_key?(:password)\n args[:dest_ip] = Mysqladmin::Pool.connections[args[:dest_host]][:host] unless args.has_key?(:dest_ip)\n \n # Mandatory options:\n req(:required => [:src_db,\n :src_host,\n :backup_files,\n :per_table,\n :dest_db,\n :dest_host,\n :user,\n :password,\n :dest_ip],\n :args_object => args)\n\n # Delete args[:src_db] and args[:src_host] so we don't have collisions later.\n args.delete(:src_db) if args.has_key?(:src_db)\n args.delete(:src_host) if args.has_key?(:src_host)\n \n # Create our logging space if it doesn't already exist\n @task_results[args[:dest_host]] = {} unless @task_results.has_key?(args[:dest_host])\n @task_results[args[:dest_host]][args[:dest_db]] = {} unless @task_results[args[:dest_host]].has_key?(args[:dest_db])\n @task_results[args[:dest_host]][args[:dest_db]][:restore_files] = [] unless @task_results[args[:dest_host]][args[:dest_db]].has_key?(:restore_files)\n @task_results[args[:dest_host]][args[:dest_db]][:restore_result_log] = {} unless @task_results[args[:dest_host]][args[:dest_db]].has_key?(:restore_result_log)\n \n # If a text filter is provided mangle it into a pipe\n if args[:text_filter]\n args[:text_filter] = \"| #{args[:text_filter]}\"\n end\n \n args[:backup_files].each do |backup_file|\n # Make sure the backup files exist in the path or crash\n unless File.file?(backup_file)\n raise RuntimeError, \"Backup file #{backup_file} is not in path or cwd\"\n end\n # analyze the files and make sure we can figure out how to concatenate\n # them to the mysql command for restoration\n if backup_file[/^.*\\.sql$/]\n args[:backup_file_format] = :text\n elsif backup_file[/^.*\\.[t]*gz$/]\n args[:backup_file_format] = :gzip\n else\n raise RuntimeError, \"No supported backup_file_format matched\"\n end\n end\n \n # Make sure the backup files exist in the path or crash\n \n # See if the target database exists and follow conditions for :crash_if_exists\n # and :overwrite_if_exists\n dbh = Mysqladmin::Exec.new(:connection_name => args[:dest_host],\n :sql => \"SHOW DATABASES LIKE '#{args[:dest_db]}'\")\n dbh.go\n if dbh.rows > 0\n if dbh.fetch_hash[\"Database (#{args[:dest_db]})\"] == args[:dest_db]\n if args[:crash_if_exists] == true\n raise RuntimeError, \"Database #{args[:dest_db]} exists on #{args[:dest_host]}\"\n elsif args[:overwrite_if_exists] == true\n do_restore(args)\n else\n false\n end\n end\n else\n dbh.create_db(args[:dest_db])\n do_restore(args)\n end\n \n # Flush \n args.delete(:crash_if_exists) if args.has_key?(:crash_if_exists)\n args.delete(:overwrite_if_exists) if args.has_key?(:overwrite_if_exists)\n end",
"title": ""
},
{
"docid": "09749209198a6312d7c7a32ac22f17fa",
"score": "0.4891805",
"text": "def getExistingSnapshot\n resp =\n if @config[\"create_cluster\"]\n MU::Cloud::AWS.rds(region: @config['region'], credentials: @config['credentials']).describe_db_cluster_snapshots(db_cluster_snapshot_identifier: @config[\"identifier\"])\n else\n MU::Cloud::AWS.rds(region: @config['region'], credentials: @config['credentials']).describe_db_snapshots(db_snapshot_identifier: @config[\"identifier\"])\n end\n\n snapshots = @config[\"create_cluster\"] ? resp.db_cluster_snapshots : resp.db_snapshots\n\n if snapshots.empty?\n nil\n else\n sorted_snapshots = snapshots.sort_by { |snap| snap.snapshot_create_time }\n @config[\"create_cluster\"] ? sorted_snapshots.last.db_cluster_snapshot_identifier : sorted_snapshots.last.db_snapshot_identifier\n end\n end",
"title": ""
},
{
"docid": "1700ffa84ae228d95c0cb9979b50d8c5",
"score": "0.48822212",
"text": "def create(opts={}, &each_inst)\n raise NoAMI unless opts[:ami]\n raise NoGroup unless opts[:group]\n \n opts = {\n :size => 'm1.small',\n :min => 1,\n :max => nil\n }.merge(opts)\n \n old_opts = {\n :image_id => opts[:ami].to_s,\n :min_count => opts[:min],\n :max_count => opts[:max] || opts[:min],\n :key_name => (opts[:keypair] || '').to_s,\n :security_group => [opts[:group]].flatten.compact,\n #:user_data => opts[:machine_data], # Error: Invalid BASE64 encoding of user data ??\n :availability_zone => opts[:zone].to_s,\n :instance_type => opts[:size].to_s,\n :kernel_id => nil\n }\n \n response = Rudy::AWS::EC2.execute_request({}) { @@ec2.run_instances(old_opts) }\n return nil unless response['instancesSet'].is_a?(Hash)\n instances = response['instancesSet']['item'].collect do |inst|\n self.from_hash(inst)\n end\n instances.each { |inst| \n each_inst.call(inst) \n } if each_inst\n instances\n end",
"title": ""
},
{
"docid": "3271cf71e831d14668cfa2bad8f0162c",
"score": "0.48729184",
"text": "def create_vm_snapshot(vmId, description=\"New Snapshot\")\n create_snapshot_action(vmId, description, :vm)\n end",
"title": ""
},
{
"docid": "e94cc36340805fd1bc7cc76c68fd734c",
"score": "0.48713672",
"text": "def snapshot_instance(name, description)\n bundle_image(name)\n upload_bundle(name)\n cleanup_bundle\n end",
"title": ""
},
{
"docid": "9b9f5eee1d6f9766f4dee8108ae999fd",
"score": "0.48678553",
"text": "def create_ec2\n @logger.info('Creating new EC2 instance.')\n config = File.read(File.join(__dir__, '../../cfg/ec2_conf.json'))\n @logger.debug(\"Configuration loaded: #{config}.\")\n ec2_config = symbolize(JSON.parse(config))\n @logger.debug(\"Configuration symbolized: #{ec2_config}.\")\n @logger.info('Importing keys.')\n import_keypair\n @logger.info('Creating security group.')\n sg_id = create_security_group\n ec2_config[:security_group_ids] = [sg_id]\n ec2_config[:user_data] = retrieve_user_data\n @logger.info('Creating instance.')\n instance = @ec2_resource.create_instances(ec2_config)[0]\n @logger.info('Instance created. Waiting for it to become available.')\n @ec2_resource.client.wait_until(:instance_status_ok,\n instance_ids: [instance.id]) do |w|\n w.before_wait do |_, _|\n @logger << '.'\n end\n end\n @logger.info(\"\\n\")\n @logger.info('Instance in running state.')\n pub_ip = @ec2_resource.instances(instance_ids: [instance.id]).first\n @logger.info('Instance started with ip | id: ' \\\n \"#{pub_ip.public_ip_address} | #{instance.id}.\")\n [pub_ip.public_ip_address, instance.id]\n end",
"title": ""
},
{
"docid": "fe10073200f424da95df29c34a765dca",
"score": "0.48621634",
"text": "def create_join_db(username, password, join_db)\n # Call AWS API to create a new instance, get back the hostname\n connection_info = create_cloud_db(join_db.name)\n\n # Return the host and port\n return connection_info\n\n end",
"title": ""
},
{
"docid": "f40f569c02fc980aaa1e3463df9442ec",
"score": "0.48564005",
"text": "def create(master_established_=false)\n establish_master_connection unless master_established_\n extra_configs_ = {'encoding' => encoding}\n extra_configs_['owner'] = username if has_su?\n connection.create_database(configuration['database'], configuration.merge(extra_configs_))\n setup_gis\n rescue ::ActiveRecord::StatementInvalid => error_\n if /database .* already exists/ === error_.message\n raise ::ActiveRecord::Tasks::DatabaseAlreadyExists\n else\n raise\n end\n end",
"title": ""
},
{
"docid": "9cdd02d66a0d1d45bf00d4199172c3c6",
"score": "0.4849119",
"text": "def bind_security_group_to_rds_instance(rds_client, db_instance_identifier, security_group_id, dry_run)\n existing_rds_instance = db_instance(rds_client, db_instance_identifier)\n if binded_rds_instance?(rds_client, db_instance_identifier, security_group_id)\n puts \"DB instance #{db_instance_identifier} is already bound to #{security_group_id}\"\n return existing_rds_instance\n end\n\n existing_vpc_security_groups = existing_rds_instance.vpc_security_groups.map(&:vpc_security_group_id).reject { |sg| sg == security_group_id }\n\n if dry_run\n puts \"Dryrun: modify_db_instance has not performed really\"\n else\n rds_client.modify_db_instance({\n db_instance_identifier:,\n vpc_security_group_ids: existing_vpc_security_groups << security_group_id,\n apply_immediately: true,\n })\n end\nend",
"title": ""
},
{
"docid": "68282cd93301915c1b3bd1656a1be6e5",
"score": "0.484899",
"text": "def create_volume(params)\n snapshot_id = params['SnapshotId']\n if snapshot_id\n snapshot_id = snapshot_id.split('-')[1]\n\n snapshot = ImageEC2.new(Image.build_xml(snapshot_id.to_i), @client)\n rc = snapshot.info\n if OpenNebula::is_error?(rc) || !snapshot.ebs_snapshot?\n rc ||= OpenNebula::Error.new()\n rc.ec2_code = \"InvalidSnapshot.NotFound\"\n return rc\n end\n\n # Clone\n volume_id = snapshot.clone(ImageEC2.generate_uuid)\n if OpenNebula::is_error?(volume_id)\n return volume_id\n end\n\n volume = ImageEC2.new(Image.build_xml(volume_id.to_i), @client)\n rc = volume.info\n if OpenNebula::is_error?(rc)\n return rc\n end\n\n volume.delete_element(\"TEMPLATE/EBS_SNAPSHOT\")\n volume.add_element('TEMPLATE', {\n \"EBS_VOLUME\" => \"YES\",\n \"EBS_FROM_SNAPSHOT_ID\" => snapshot.ec2_id})\n volume.update\n else\n size = params['Size'].to_i # in GiBs\n size *= 1024\n\n opts = {\n :type => \"DATABLOCK\",\n :size => size,\n :fstype => @config[:ebs_fstype]||DEFAULT_FSTYPE,\n :persistent => \"YES\",\n :ebs_volume => \"YES\"\n }\n\n volume = ImageEC2.new(Image.build_xml, @client, nil, opts)\n template = volume.to_one_template\n\n if OpenNebula.is_error?(template)\n return template\n end\n\n rc = volume.allocate(template, @config[:datastore_id]||1)\n\n if OpenNebula.is_error?(rc)\n return rc\n end\n\n volume.info\n end\n\n erb_version = params['Version']\n response = ERB.new(File.read(@config[:views]+\"/create_volume.erb\"))\n\n return response.result(binding), 200\n end",
"title": ""
},
{
"docid": "7106599e25c51d4811d490b7cef953fa",
"score": "0.4835883",
"text": "def start_machine_from_snapshot(machine, snapshot, opts= {})\n raise ArgumentError unless machine.is_a? String\n raise ArgumentError unless snapshot.is_a? String\n c = @client[\"#{@account}/machines/#{machine}/snapshots/#{snapshot}\"]\n headers = gen_headers(opts)\n attempt(opts[:attempts]) do\n do_post(c, headers, opts)\n end\n\n end",
"title": ""
}
] |
3396e4df9852013a7a475c21852560a5
|
PUT /st_uses/1 PUT /st_uses/1.xml
|
[
{
"docid": "00ff69d14c7046c524f3bd87823ef2b6",
"score": "0.0",
"text": "def update\r\n @st_use = StUse.find(params[:id])\r\n return_url = ''\r\n if params[:arrow]\r\n if params[:arrow] == 'next'\r\n return_url = st_end_of_life_path(@st_use.st_product) \r\n end\r\n if params[:arrow] == 'previous'\r\n return_url = st_distribution_path(@st_use.st_product)\r\n end \r\n end\r\n respond_to do |format|\r\n if @st_use.update_attributes(params[:st_use])\r\n format.html { redirect_to(return_url) }\r\n format.xml { head :ok }\r\n else\r\n format.html { render :action => \"edit\" }\r\n format.xml { render :xml => @st_use.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
}
] |
[
{
"docid": "fbd7c46b15ae2792fd842ba0d764b7d0",
"score": "0.6108941",
"text": "def put uri, args = {}; Request.new(PUT, uri, args).execute; end",
"title": ""
},
{
"docid": "a48b3229e830876ae619b936301400b2",
"score": "0.6105407",
"text": "def put(url, xml, version = nil)\n req = Net::HTTP::Put.new(url)\n req.content_type = 'application/x-ssds+xml'\n \n if(!version.nil?)\n req['if-match'] = version;\n end\n \n req.content_length = xml.to_s.size.to_s\n req.basic_auth @username, @password\n req.body = xml.to_s\n execute_request(req)\n end",
"title": ""
},
{
"docid": "441cb4413842702f6d355be53558fd8b",
"score": "0.5991864",
"text": "def update\n @usesupply = Usesupply.find(params[:id])\n\n respond_to do |format|\n if @usesupply.update_attributes(params[:usesupply])\n flash[:notice] = 'Usesupply was successfully updated.'\n format.html { redirect_to(@usesupply) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @usesupply.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "23b5f5e4dacfb330cb1e0ffd4590ef63",
"score": "0.5907006",
"text": "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post opts.fetch(:path, update_path), opts\n end",
"title": ""
},
{
"docid": "6fd8842ed08fa1572950f3e78514aecf",
"score": "0.5793532",
"text": "def do_PUT(req, res)\n domain, resource, id, format = parse_request_path(req.path_info)\n attributes = from_xml(resource, req.body)\n attributes['updated-at'] = Time.now.iso8601\n logger.debug \"Updating item with attributes: #{attributes.inspect}\"\n sdb_put_item(domain, attributes, true)\n raise WEBrick::HTTPStatus::OK\n end",
"title": ""
},
{
"docid": "e2e55a6ecb4c00b7fe18a670cc021207",
"score": "0.57353365",
"text": "def put_entry(id,summary)\n xml = <<DATA\n <entry xmlns=\"http://purl.org/atom/ns#\">\n <summary type=\"text/plain\"></summary>\n </entry>\nDATA\n\n doc = REXML::Document.new(xml)\n doc.elements['/entry/summary'].add_text(summary)\n\n # REXML -> String\n data=String.new\n doc.write(data)\n\n #make request\n path=\"/atom/edit/#{id}\"\n req=Net::HTTP::Put.new(path)\n req['Accept']= 'application/x.atom+xml,application/xml,text/xml,*/*',\n req['X-WSSE']= @credential_string\n\n #YHAAAA!!!\n res = @http.request(req,data)\n return res\n end",
"title": ""
},
{
"docid": "545dadbe32aa3d9d0edf1d22293783fc",
"score": "0.5699341",
"text": "def test_put_existing\n request = Http::Request.new('PUT', '/file1', {}, 'bar')\n\n response = self.request(request)\n\n assert_equal(204, response.status)\n\n assert_equal(\n 'bar',\n @server.tree.node_for_path('file1').get\n )\n\n assert_equal(\n {\n 'X-Sabre-Version' => [Version::VERSION],\n 'Content-Length' => ['0'],\n 'ETag' => [\"\\\"#{Digest::MD5.hexdigest('bar')}\\\"\"]\n },\n response.headers\n )\n end",
"title": ""
},
{
"docid": "2a883e27d7c2ac9dc7142cf4483f6815",
"score": "0.562931",
"text": "def _update(type, current_name, metadata={})\n type = type.to_s.camelize\n request :update do |soap|\n soap.body = {\n :metadata => {\n :current_name => current_name,\n :metadata => prepare(metadata),\n :attributes! => { :metadata => { 'xsi:type' => \"ins0:#{type}\" } }\n }\n }\n end\n end",
"title": ""
},
{
"docid": "18f0cdf17a0a0f8738a14dc372f53f55",
"score": "0.5537411",
"text": "def put(uri, params = {})\n send_request(uri, :put, params)\n end",
"title": ""
},
{
"docid": "7f65ac6b8c799110ce7d4437c7b741b6",
"score": "0.5529949",
"text": "def create\r\n @st_use = StUse.new(params[:st_use])\r\n\r\n respond_to do |format|\r\n if @st_use.save\r\n format.html { redirect_to(@st_use) }\r\n format.xml { render :xml => @st_use, :status => :created, :location => @st_use }\r\n else\r\n format.html { render :action => \"new\" }\r\n format.xml { render :xml => @st_use.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "38979984bdedacd95706689e25f09f9e",
"score": "0.55094564",
"text": "def put(document, method='')\n @resource[method].put(document.to_s, :content_type => 'text/xml')\n end",
"title": ""
},
{
"docid": "ccfac8f6948648205e3b9cf037ee8e84",
"score": "0.5504268",
"text": "def put(nsc, uri, payload = nil, content_type = CONTENT_TYPE::XML)\n put = Net::HTTP::Put.new(uri)\n put.set_content_type(content_type)\n put.body = payload.to_s if payload\n request(nsc, put)\n end",
"title": ""
},
{
"docid": "608d2f58e93e2a844cba814b363df9ef",
"score": "0.54998875",
"text": "def update(id, name=\"Updated Name\", extension=0000)\n xml_req =\"{\\\"device\\\":{ \\\"id\\\":#{id},\\\"number\\\":\\\"#{number}\\\",\\\"name\\\":\\\"#{name}\\\",\\\"address\\\":\\\"#{address}\\\"}}\"\n \n \n request = Net::HTTP::Put.new(\"#{@url}/#{id}.json\")\n request.add_field \"Content-Type\", \"application/json\"\n request.body = xml_req\n \n http = Net::HTTP.new(@uri.host, @uri.port)\n response = http.request(request)\n \n # no response body will be returned\n case response\n when Net::HTTPSuccess\n return \"#{response.code} OK\"\n else\n return \"#{response.code} ERROR\"\n end\n end",
"title": ""
},
{
"docid": "ad54471b285e5e357d9be959c8ade2d8",
"score": "0.5485171",
"text": "def update\n path = \"/workflow/#{repo}/objects/druid:#{druid}/workflows/#{workflow}/#{step}\"\n conn = Faraday.new(url: config['host'])\n conn.basic_auth(config['user'], config['password'])\n conn.headers['content-type'] = 'application/xml'\n\n conn.put path, payload\n end",
"title": ""
},
{
"docid": "ed6b1e473b7eae92e30c36fba9b61212",
"score": "0.54774153",
"text": "def update\n @external_system = Uid::ExternalSystem.find(params[:id])\n\n respond_to do |format|\n if @external_system.update_attributes(params[:uid_external_system])\n format.html { redirect_to({:action=>\"index\"}, :notice => t(:successfully_updated)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @external_system.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a74284777c126d63377c55dcd3d0bea",
"score": "0.54626685",
"text": "def update\n @address_use = AddressUse.find(params[:id])\n\n respond_to do |format|\n if @address_use.update_attributes(params[:address_use])\n flash[:notice] = 'AddressUse was successfully updated.'\n format.html { redirect_to(@address_use) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @address_use.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c7d3cd0f218c42e01dbd0246ab7b00c9",
"score": "0.5428184",
"text": "def put(path, params={}); make_request(:put, host, port, path, params); end",
"title": ""
},
{
"docid": "8415acb983da3addb269a79e461bba00",
"score": "0.5416452",
"text": "def put(uri, options = {})\n request :put, options\n end",
"title": ""
},
{
"docid": "e00db7b51d0a660faf72a95f14e649ee",
"score": "0.5393004",
"text": "def update\n @version_use = VersionUse.find(params[:id])\n\n respond_to do |format|\n if @version_use.update_attributes(params[:version_use])\n flash[:notice] = 'VersionUse was successfully updated.'\n format.html { redirect_to(@version_use) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @version_use.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8e18db431964c254de53caa41795b702",
"score": "0.5383387",
"text": "def put *args\n make_request :put, *args\n end",
"title": ""
},
{
"docid": "9317485685b087873601b5512379d71f",
"score": "0.5383172",
"text": "def update\n @alias_use = AliasUse.find(params[:id])\n\n respond_to do |format|\n if @alias_use.update_attributes(params[:alias_use])\n flash[:notice] = 'AliasUse was successfully updated.'\n format.html { redirect_to(@alias_use) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @alias_use.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "713161fe04801b44f5b9cdb91a95fe89",
"score": "0.5379657",
"text": "def test_put\n request = Http::Request.new('PUT', '/file2', {}, 'hello')\n\n response = self.request(request)\n\n assert_equal(201, response.status, \"Incorrect status code received. Full response body: #{response.body_as_string}\")\n\n assert_equal(\n 'hello',\n @server.tree.node_for_path('file2').get\n )\n\n assert_equal(\n {\n 'X-Sabre-Version' => [Version::VERSION],\n 'Content-Length' => ['0'],\n 'ETag' => [\"\\\"#{Digest::MD5.hexdigest('hello')}\\\"\"]\n },\n response.headers\n )\n end",
"title": ""
},
{
"docid": "14e63048a6ef404091257192a060af03",
"score": "0.5374488",
"text": "def update\n @stooltest = Stooltest.find(params[:id])\n\n respond_to do |format|\n if @stooltest.update_attributes(params[:stooltest])\n format.html { redirect_to(@stooltest, :notice => 'Stooltest was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @stooltest.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5e7f56eb1e62b28a791b8dded85ac5c5",
"score": "0.5370474",
"text": "def update_rest\n @v1_item_usage = V1ItemUsage.find(params[:id])\n\n respond_to do |format|\n if @v1_item_usage.update_attributes(params[:v1_item_usage])\n flash[:notice] = 'V1ItemUsage was successfully updated.'\n format.html { redirect_to(@v1_item_usage) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @v1_item_usage.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "91e222f5e4ec3e3bdb488c250d77c6dd",
"score": "0.5369167",
"text": "def update\n @component = Component.find(params[:component][:id])\n\n respond_to do |format|\n if @component.update_attributes(params[:component])\n format.xml { head :ok }\n end\n end\n end",
"title": ""
},
{
"docid": "49ccca1b5a9e66a099b2a168504a20e2",
"score": "0.53518546",
"text": "def destroy\r\n @st_use = StUse.find(params[:id])\r\n @st_use.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to(st_uses_url) }\r\n format.xml { head :ok }\r\n end\r\n end",
"title": ""
},
{
"docid": "9ddf960eb3f437e62b9b99d34992bc0f",
"score": "0.5343913",
"text": "def test_should_update_status_post_via_API_XML\r\n get \"/logout\"\r\n put \"/status_posts/1.xml\", :api_key => 'testapikey',\r\n :status_post => {:body => 'API Status Post 1' }\r\n assert_response :success\r\n end",
"title": ""
},
{
"docid": "27096800d14893529f640b6cf4566aba",
"score": "0.53303415",
"text": "def update\n connection.put(\"/todo_lists/#{id}.xml\",\n \"<todo-list>\n <name>#{name}</name>\n <description>#{description}</description>\n <milestone_id>#{milestone_id}</milestone_id>\n </todo-list>\",\n XML_REQUEST_HEADERS)\n end",
"title": ""
},
{
"docid": "5a5833d0277ac13d047da5248461b116",
"score": "0.5322773",
"text": "def on_put(resource_uri, opts)\n debug \"on_put: #{resource_uri}\"\n action, params = parse_uri(resource_uri, opts)\n action = 'reset' if action == 'reboot' || action == \"restart\" \n body, format = parse_body(opts)\n authorizer = opts[:req].session[:authorizer]\n account = authorizer.account\n debug \"action: #{action.inspect} params: #{params.inspect} format: #{format.inspect} account_id: #{account.id} body: #{body.inspect}\"\n\n if account.id != @am_manager._get_nil_account.id\n error \"non root account issued action: '#{action}'\"\n raise OMF::SFA::AM::Rest::NotAuthorizedException.new \"Not Authorized!!\"\n end\n\n response = {}\n case action\n when 'on' , 'off' , 'reset'\n body[:nodes].each do |node|\n response[node.to_sym] = @liaison.change_node_status(node, action)\n end\n when 'save'\n node = body[:node]\n image_name = body[:image_name] || DEFAULT_SAVE_IMAGE_NAME\n response[node.to_sym] = @liaison.save_node_image(node, image_name)\n when 'load'\n nodes = []\n body[:nodes].each do |node|\n nodes << OMF::SFA::Model::Node.first(name: node, account_id: 2)\n end\n sliver_type = OMF::SFA::Model::SliverType.first(name: body[:sliver_type])\n response = @liaison.provision(nodes, sliver_type, authorizer)\n else\n raise OMF::SFA::AM::Rest::UnknownResourceException.new \"Action '#{action}' is not supported by method PUT.\"\n end\n \n ['application/json', \"#{JSON.pretty_generate({resp: response}, :for_rest => true)}\\n\"]\n end",
"title": ""
},
{
"docid": "a6174ef5c57f0350802d9d10f71b4a2e",
"score": "0.53088725",
"text": "def test_finder_put_success\n request = Http::Request.new(\n 'PUT',\n '/file2',\n { 'X-Expected-Entity-Length' => '5' },\n 'hello'\n )\n response = self.request(request)\n\n assert_equal(201, response.status)\n\n assert_equal(\n 'hello',\n @server.tree.node_for_path('file2').get\n )\n\n assert_equal(\n {\n 'X-Sabre-Version' => [Version::VERSION],\n 'Content-Length' => ['0'],\n 'ETag' => [\"\\\"#{Digest::MD5.hexdigest('hello')}\\\"\"]\n },\n response.headers\n )\n end",
"title": ""
},
{
"docid": "d82f7dc07c55ba699155d8a96115fe56",
"score": "0.53008306",
"text": "def put(uri, options = {})\n request :put, uri, options\n end",
"title": ""
},
{
"docid": "d82f7dc07c55ba699155d8a96115fe56",
"score": "0.53008306",
"text": "def put(uri, options = {})\n request :put, uri, options\n end",
"title": ""
},
{
"docid": "5a709be54da030e531e9297b7bde699d",
"score": "0.5280225",
"text": "def check_update_feed\n puts \"\\r\\n\\r\\nUpdate Feed:\"\n uri = URI.parse(\"http://0.0.0.0:8080/feed.json\")\n Net::HTTP.start(uri.host, uri.port) do |http|\n headers = {'Content-Type' => 'application/x-www-form-urlencoded'}\n put_data = \"key=1&uid=1&title=SomethingDifferent\"\n res = http.send_request('PUT', uri.request_uri, put_data, headers) \n puts res.body\n end\nend",
"title": ""
},
{
"docid": "d849c2bc448d5ce0df573d1ab918e8f7",
"score": "0.5269379",
"text": "def put(url, options={}, header={})\n body = options[:body]\n access_token.put(url, body, {'Content-Type' => 'application/xml' })\n end",
"title": ""
},
{
"docid": "45cad7c5aee9fadb2d004ec9f0a14d67",
"score": "0.52681243",
"text": "def update(conn, datahexstr)\n data = hexToBytes(datahexstr)\n resp = conn.put do |req|\n req.url \"/sensor.json\"\n req.headers['Content-Type'] = 'application/json'\n req.headers['Accept'] = 'application/json'\n req.body = DecodeElsysPayload(data).to_json\n end\n puts resp.status\nend",
"title": ""
},
{
"docid": "882c8317370987b86425c0adbf5bfe8c",
"score": "0.5267742",
"text": "def update_aos_version(args = {}) \n put(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"title": ""
},
{
"docid": "23b8fd20c4f863cc9fd1d0f2eeefb2e5",
"score": "0.5261542",
"text": "def update_task\n @user = User.find_by_username(session['user'])\n @access_token = OAuth::AccessToken.new(UsersController.consumer, @user.token, @user.secret)\n @response = UsersController.consumer.request(:put, \"/api/v1/tasks/#{params[:id]}.xml\", @access_token, {:scheme => :query_string},\n {'task[title]' => 'Updated Valid Task'})\n render :xml => @response.body\n end",
"title": ""
},
{
"docid": "07918d5a67562e424f50e841ebcd6a84",
"score": "0.5258931",
"text": "def put(path , params = {})\n request(:put , path , params)\n end",
"title": ""
},
{
"docid": "f6018bfebe02fd19d8e4c850bb2ef58f",
"score": "0.52502775",
"text": "def test_changeset_update_invalid\n basic_authorization create(:user).email, \"test\"\n\n changeset = create(:changeset)\n new_changeset = changeset.to_xml\n new_tag = XML::Node.new \"tag\"\n new_tag[\"k\"] = \"testing\"\n new_tag[\"v\"] = \"testing\"\n new_changeset.find(\"//osm/changeset\").first << new_tag\n\n content new_changeset\n put :update, :params => { :id => changeset.id }\n assert_response :conflict\n end",
"title": ""
},
{
"docid": "ee76d71ab48186dd258d36f6e0292a06",
"score": "0.5244946",
"text": "def update\n @syllabus = Syllabus.find(params[:id])\n\n respond_to do |format|\n if @syllabus.update_attributes(params[:syllabus])\n format.html { redirect_to(@syllabus, :notice => 'Syllabus was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @syllabus.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9e88a495e63ad5e9ffba8fd1f4b1d090",
"score": "0.5244188",
"text": "def update\n @usage = Usage.find(params[:id])\n\n respond_to do |format|\n if @usage.update_attributes(params[:usage])\n flash[:notice] = 'Usage was successfully updated.'\n format.html { redirect_to(@usage) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @usage.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4373bcfe7235b052b1e29f273176207d",
"score": "0.52319413",
"text": "def update\n @usecasecluster = Usecasecluster.find(params[:id])\n\n respond_to do |format|\n if @usecasecluster.update_attributes(params[:usecasecluster])\n format.html { redirect_to(@usecasecluster, :notice => 'Usecasecluster was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @usecasecluster.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aa0b87a16ede7353758305dbbaf57c22",
"score": "0.522932",
"text": "def put(*a) route 'PUT', *a end",
"title": ""
},
{
"docid": "72359a88c0e48b58e21a735966a1bc90",
"score": "0.5224366",
"text": "def update\n @components_stem = Components::Stem.find(params[:id])\n\n respond_to do |format|\n if @components_stem.update_attributes(params[:components_stem])\n format.html { redirect_to(@components_stem, :notice => 'Stem was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @components_stem.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9fc6096ba1d40ef2e785f111ae112d45",
"score": "0.52026045",
"text": "def put(uri, params = {}, env = {}, &block)\n env = env_for(uri, env.merge(:method => \"PUT\", :params => params))\n process_request(uri, env, &block)\n end",
"title": ""
},
{
"docid": "9fc6096ba1d40ef2e785f111ae112d45",
"score": "0.52026045",
"text": "def put(uri, params = {}, env = {}, &block)\n env = env_for(uri, env.merge(:method => \"PUT\", :params => params))\n process_request(uri, env, &block)\n end",
"title": ""
},
{
"docid": "78992a74047c3c20cef2afbb4232252b",
"score": "0.51975703",
"text": "def test_put_existing_if_match_star\n request = Http::Request.new(\n 'PUT',\n '/file1',\n { 'If-Match' => '*' },\n 'hello'\n )\n\n response = self.request(request)\n\n assert_equal(204, response.status)\n\n assert_equal(\n 'hello',\n @server.tree.node_for_path('file1').get\n )\n\n assert_equal(\n {\n 'X-Sabre-Version' => [Version::VERSION],\n 'Content-Length' => ['0'],\n 'ETag' => [\"\\\"#{Digest::MD5.hexdigest('hello')}\\\"\"]\n },\n response.headers\n )\n end",
"title": ""
},
{
"docid": "ed46275f8f6f9727cd9c5632ce04964c",
"score": "0.51905125",
"text": "def update\n # Given the ID and Trend_Name and Comment Text, update\n uuid = params[:uuid]\n topic = params[:topic]\n comment = params[:comment]\n location_id = params[:location_id]\n\n # # to change later\n # uuid = \"91de7ee4-1cde-4aa8-9d0e-e16f46236d2f\"\n # comment = \"this is awesome111111!\"\n # topic = \"soytanrudo\"\n\n url= \"http://localhost:8080\"\n get_str = \"exist/atom/content/4302Collection/\"+location_id+\"/?id=urn:uuid:%s\"%uuid\n r = RestClient::Resource.new url\n res = r[get_str].get\n #puts res\n\n atom_string = res\n user_comment = comment\n\n atom_xml = Nokogiri::XML(atom_string)\n\n comment_ns = \"http://my.superdupertren.ds\"\n\n # assume the item exists and that there's only one of them\n topic_node = atom_xml.xpath(\"//tw:trend[@topic='\"+topic+\"']\", {\"tw\" => \"http://api.twitter.com\"})[0]\n\n puts \"Topic\"\n puts topic\n puts \"Comment\"\n puts user_comment\n\n comment_nodes = topic_node.xpath(\"//tw:trend[@topic='\"+topic+\"']/cm:user_comment\", {\"tw\" => \"http://api.twitter.com\", \"cm\" => comment_ns})\n if (comment_nodes.first)\n # Find user_comment node first and edit it\n comment_nodes.first.content = user_comment\n puts \"we found the comment nodes!!!!\"\n else\n # Create new node and add\n new_node = Nokogiri::XML::Node.new(\"user_comment\", atom_xml)\n new_node.add_namespace(nil, comment_ns)\n new_node.content = user_comment\n topic_node.add_child(new_node)\n end\n\n #update entry\n #puts atom_xml.to_xml\n\n url= \"http://localhost:8080\"\n r = RestClient::Resource.new url\n post_str = \"exist/atom/edit/4302Collection/\"+location_id+\"/?id=urn:uuid:%s\" % uuid\n res = r[post_str].put atom_xml.to_xml, :content_type => \"application/atom+xml\"\n\n #puts res\n render :xml => res\n\n end",
"title": ""
},
{
"docid": "d61a25d69ed10b03601d4f17ba7d9ef3",
"score": "0.5190332",
"text": "def update\n #RAILS_DEFAULT_LOGGER.debug(\"******** REST Call to CRMS: Updating #{self.class.name}:#{self.id}\")\n #RAILS_DEFAULT_LOGGER.debug(caller[0..5].join(\"\\n\")) \n response = connection.put(element_path(prefix_options), to_xml, self.class.headers)\n save_nested\n load_attributes_from_response(response)\n merge_saved_nested_resources_into_attributes\n response\n end",
"title": ""
},
{
"docid": "1988f2ef1f51512708ce4e71d723fb42",
"score": "0.5184989",
"text": "def update\n @stes_e = StesE.find(params[:id])\n\n respond_to do |format|\n if @stes_e.update_attributes(params[:stes_e])\n format.html { redirect_to :controller => :edit, :action => :index }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @stes_e.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "50ea0f88ee2f34ca6ac2a529a5c46d91",
"score": "0.5183704",
"text": "def update\n respond_to do |format|\n if @estatuse.update(estatuse_params)\n format.html { redirect_to @estatuse, notice: 'Estatus was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @estatuse.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "47abb2cddfa1a665018f717cdaaa4164",
"score": "0.51813394",
"text": "def update!(params)\n res = @client.put(path, {}, params, \"Content-Type\" => \"application/json\")\n\n @attributes = res.json if res.status == 201\n end",
"title": ""
},
{
"docid": "7dcf61d28367255f0ec9cea7ade341de",
"score": "0.5178342",
"text": "def update(id, name=\"Updated Name\", published=\"false\", genre=\"movie\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <timeline>\r\n <published type='string'>#{published}</published>\r\n <id type='integer'>#{id}</id>\r\n <description>#{name}</description>\r\n <genre>#{genre}</genre>\r\n </timeline>\"\r\n \r\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n \r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n \r\n # no response body will be returned\r\n case response\r\n when Net::HTTPSuccess\r\n return \"#{response.code} OK\"\r\n else\r\n return \"#{response.code} ERROR\"\r\n end\r\n end",
"title": ""
},
{
"docid": "ca503f9c245ba12b0ddf82b577c9b306",
"score": "0.5176591",
"text": "def put!\n request = Net::HTTP::Put.new(uri)\n request.body = @params.to_json\n\n response = get_response(request)\n GunBroker::Response.new(response)\n end",
"title": ""
},
{
"docid": "6c50b9570ab82e95133977bfc82f5e1e",
"score": "0.5174922",
"text": "def update\n @slit_spec = SlitSpec.find(params[:id])\n\n respond_to do |format|\n if @slit_spec.update_attributes(params[:slit_spec])\n format.html { redirect_to @slit_spec, notice: 'Slit spec was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @slit_spec.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3de25d4db9ac7e8554bc4ac68dcfda28",
"score": "0.51683193",
"text": "def update\n @stethoscope = Stethoscope.find(params[:id])\n \n @stethoscope.routines.each do |routine|\n routine.events << Event.new(:status => 4, :returned => {\"Notice\" => \"server name changed to #{params[:stethoscope][:server]}\"})\n end\n \n respond_to do |format|\n if @stethoscope.update_attributes(params[:stethoscope])\n \n format.html { redirect_to(@stethoscope, :notice => 'Stethoscope was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @stethoscope.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dcebdacde2e8c4d19419d0590440b841",
"score": "0.5166698",
"text": "def test_AAH_put\n Help.empty\n rdf = Help.handle\n rdf.post( \"http://jackrdf/test/urn/1\", Help.root( \"sample/cite/urn_02.json\" ))\n rdf.put( \"http://jackrdf/test/urn/1\", Help.root( \"sample/cite/urn_03.json\" ))\n assert( true )\n end",
"title": ""
},
{
"docid": "fe2c0f3115b879df35baefa6a1659763",
"score": "0.5160291",
"text": "def update\n @location = Location.find(params[:location][:id])\n\n respond_to do |format|\n if @location.update_attributes(params[:location])\n format.xml { head :ok }\n end\n end\n end",
"title": ""
},
{
"docid": "a6eaddde60ad0ad290c11346400ad414",
"score": "0.51505136",
"text": "def put\n request = Net::HTTP::Put.new(endpoint_uri.request_uri)\n request.basic_auth Unfuzzle.username, Unfuzzle.password\n request.content_type = 'application/xml'\n \n Response.new(client.request(request, @payload))\n end",
"title": ""
},
{
"docid": "f258199f9a01a7f2ffb3045648ccbc1b",
"score": "0.5149493",
"text": "def update\n @su = Sus.find(params[:id])\n\n respond_to do |format|\n if @su.update_attributes(params[:su])\n format.html { redirect_to @su, notice: 'Sus was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @su.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c42d959f2bca0e37aa88e049be457780",
"score": "0.5140532",
"text": "def update\n @email_use = EmailUse.find(params[:id])\n\n respond_to do |format|\n if @email_use.update_attributes(params[:email_use])\n flash[:notice] = 'EmailUse was successfully updated.'\n format.html { redirect_to(@email_use) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @email_use.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "32280e59d9a6732389d1494f4884c144",
"score": "0.5139235",
"text": "def update\n @stock_use = StockUse.find(params[:id])\n\n respond_to do |format|\n if @stock_use.update_attributes(params[:stock_use])\n format.html { redirect_to(@stock_use, :notice => 'Stock use was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @stock_use.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ea416b077fa0aa7e84ec3fe2ef9c3772",
"score": "0.5138998",
"text": "def put\n request_method('PUT')\n end",
"title": ""
},
{
"docid": "d55d721f8480443e8ea3a80a37a43aa2",
"score": "0.51260525",
"text": "def update\n @water_use = WaterUse.find(params[:id])\n @title = \"water use\"\n\n respond_to do |format|\n if @water_use.update_attributes(params[:water_use])\n format.html { redirect_to(@water_use, :notice => 'WaterUse was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @water_use.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b067d7a776a3ecebc6e986b406c7dee2",
"score": "0.51143533",
"text": "def on_put(resource_uri, opts)\n debug \"on_put: #{resource_uri}\"\n if @am_manager.kind_of? OMF::SFA::AM::CentralAMManager\n # Central manager just need to pass the request to the respectives subauthorities\n central_result = @am_manager.pass_request(resource_uri, opts, self)\n return show_resource(central_result, opts)\n end\n\n source_type, source_id, target_type, params = parse_uri(resource_uri, opts)\n desc = {\n :or => {\n :uuid => source_id,\n :urn => source_id\n }\n }\n\n authorizer = opts[:req].session[:authorizer]\n source_resource = @am_manager.find_resource(desc, source_type, authorizer)\n\n raise OMF::SFA::AM::InsufficientPrivilegesException unless authorizer.can_modify_resource?(source_resource, source_type)\n\n if params['special_method']\n begin\n self.send(\"put_#{target_type.downcase}_#{source_type.downcase}\", source_resource, opts)\n rescue NoMethodError => ex\n raise OMF::SFA::AM::Rest::BadRequestException.new \"Method #{target_type.downcase}_#{source_type.pluralize.downcase} is not defined for PUT requests.\"\n end\n return show_resource(source_resource, opts)\n end\n\n body, format = parse_body(opts)\n target_resources = self.get_target_resources_from_body(body, target_type, authorizer)\n \n # in those cases we need to use the manager and not the relation between them\n if source_type == 'Lease' && (target_type == 'nodes' || target_type == \"channels\" || target_type == \"e_node_bs\" || target_type == \"wimax_base_stations\") \n scheduler = @am_manager.get_scheduler\n ac_id = source_resource.account.id\n target_resources.each do |target_resource|\n c = scheduler.create_child_resource({uuid: target_resource[:uuid], account_id: ac_id}, target_resource[:type].to_s.split('::').last)\n scheduler.lease_component(source_resource, c)\n end\n else\n if source_resource.class.method_defined?(\"add_#{target_type.singularize}\")\n target_resources.each do |target_resource|\n raise OMF::SFA::AM::Rest::BadRequestException.new \"resources are already associated.\" if source_resource.send(target_type).include?(target_resource)\n source_resource.send(\"add_#{target_type.singularize}\", target_resource)\n end\n elsif source_resource.class.method_defined?(\"#{target_type.singularize}=\")\n raise OMF::SFA::AM::Rest::BadRequestException.new \"cannot associate many resources in a one-to-one relationship between '#{source_type}' and '#{target_type}'.\" if target_resources.size > 1 \n source_resource.send(\"#{target_type.singularize}=\", target_resources.first)\n else\n raise OMF::SFA::AM::Rest::BadRequestException.new \"Invalid URL.\"\n end\n end\n\n if @special_cases.include?([source_type.pluralize.downcase, target_type.pluralize.downcase])\n self.send(\"add_#{target_type.pluralize.downcase}_to_#{source_type.pluralize.downcase}\", target_resources, source_resource)\n end\n source_resource.save\n show_resource(source_resource, opts)\n end",
"title": ""
},
{
"docid": "cfa67a36f9b1cbb6072700692ce3370d",
"score": "0.51060855",
"text": "def update!(params={})\n @client.put(path, params)\n\n @attributes.merge!(params)\n end",
"title": ""
},
{
"docid": "6eccf0cb1ebc7404a9ae8d73fad0c91a",
"score": "0.5095493",
"text": "def put(*args)\n request :put, *args\n end",
"title": ""
},
{
"docid": "ea724bdcc6eaffe5c29506daf99cfa25",
"score": "0.50943565",
"text": "def put(uri, params = T.unsafe(nil), env = T.unsafe(nil), &block); end",
"title": ""
},
{
"docid": "ea724bdcc6eaffe5c29506daf99cfa25",
"score": "0.50943565",
"text": "def put(uri, params = T.unsafe(nil), env = T.unsafe(nil), &block); end",
"title": ""
},
{
"docid": "eb553a12c84b854dce36c4a124e8df74",
"score": "0.50937825",
"text": "def test_put_if_none_match_star\n request = Http::Request.new(\n 'PUT',\n '/file2',\n { 'If-None-Match' => '*' },\n 'hello'\n )\n\n response = self.request(request)\n\n assert_equal(201, response.status)\n\n assert_equal(\n 'hello',\n @server.tree.node_for_path('file2').get\n )\n\n assert_equal(\n {\n 'X-Sabre-Version' => [Version::VERSION],\n 'Content-Length' => ['0'],\n 'ETag' => [\"\\\"#{Digest::MD5.hexdigest('hello')}\\\"\"]\n },\n response.headers\n )\n end",
"title": ""
},
{
"docid": "60ac5cb87a88553836d090b527e927d2",
"score": "0.50912017",
"text": "def update\n @se_use_consumption_data = SeUseConsumptionData.find(params[:id])\n\n respond_to do |format|\n if @se_use_consumption_data.update_attributes(params[:se_use_consumption_data])\n format.html { redirect_to(@se_use_consumption_data, :notice => 'Se use consumption data was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @se_use_consumption_data.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "267bcc6a82b2f553739f55636de3a2a1",
"score": "0.50904346",
"text": "def update\n @sense = Sense.find(params[:id])\n\n respond_to do |format|\n if @sense.update_attributes(params[:sense])\n flash[:notice] = 'Sense was successfully updated.'\n format.html { redirect_to(@sense) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @sense.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "79dfa09c269bd6a791a987f2ab4b96c4",
"score": "0.5088415",
"text": "def put( uri, json = nil )\n \t\t#TODO - make this private\n \t\treq = Net::HTTP::Put.new(uri)\n \t\treq[\"content-type\"] = \"application/json\"\n \t\treq.body = json unless json == nil\n \t\tJSON.parse(request(req).body)\n \tend",
"title": ""
},
{
"docid": "9b544fd2208a2feaa2eeb7e0c10be7b5",
"score": "0.5085585",
"text": "def update\n @st_energy_data = StEnergyData.find(params[:id])\n\n respond_to do |format|\n if @st_energy_data.update_attributes(params[:st_energy_data])\n format.html { redirect_to(@st_energy_data) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @st_energy_data.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b58dcb674745e5d70f3957b6c801fb4a",
"score": "0.5077536",
"text": "def update\n id = params[:id]\n p = {:servernode => {:name => params[:servernode][:name],\n :status=>params[:servernode][:status]}}\n @servernode = Servernode.find(params[:id])\n @servernode.update(servernode_params)\n RestClient.put(\"http://localhost:3000/servernodes/#{id}\",p)\n render :nothing => :true\n end",
"title": ""
},
{
"docid": "96c2c4ca74afa5a26914fb582062f271",
"score": "0.50764173",
"text": "def test_should_update_event_via_API_XML\r\n get \"/logout\"\r\n put \"/events/1.xml\", :event => {:name => 'Test API Event 1',\r\n :start_time => Time.now.to_s(:db),\r\n :end_time => Time.now.to_s(:db),\r\n :user_id => 1,\r\n :description => 'Test API Event 1 Desc',\r\n :event_type => 'API Type',\r\n :location => 'Testville, USA',\r\n :street => 'Testers Rd.',\r\n :city => 'TestTown',\r\n :website => 'http://www.test.com',\r\n :phone => '555-555-5555',\r\n :organized_by => 'API Testers of America'}\r\n assert_response 401\r\n end",
"title": ""
},
{
"docid": "3bf795fcdad95f3219752b841fc7d760",
"score": "0.50700206",
"text": "def put(route, params = nil)\n request(route, \"put\", params)\n end",
"title": ""
},
{
"docid": "e9ee412126dedaabfecfa3bc6536c832",
"score": "0.50676984",
"text": "def update\n @usewr = Usewr.find(params[:id])\n\n respond_to do |format|\n if @usewr.update_attributes(params[:usewr])\n format.html { redirect_to @usewr, notice: 'Usewr was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @usewr.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2cc482818e111af9b01538b4a583e715",
"score": "0.5061267",
"text": "def put(url, params)\n request = HTTPI::Request.new(resource_url(url, query_params(params[:query])))\n request.body = params[:body].to_json\n execute_request(:put, request, params)\n end",
"title": ""
},
{
"docid": "33a4117409b6edad64f22324c6dea05e",
"score": "0.5048605",
"text": "def update\n respond_to do |format|\n if @sylabus.update(sylabus_params)\n format.html { redirect_to @sylabus, notice: 'Sylabus was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @sylabus.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4ee5e29ef62a6e95122a8f5d94e1d50d",
"score": "0.5041974",
"text": "def put(path, params = {})\n request :put, path, params\n end",
"title": ""
},
{
"docid": "889f1117c1410d6e709a3ea58c75d7bf",
"score": "0.5040126",
"text": "def update_all(params={})\n put uri, params\n end",
"title": ""
},
{
"docid": "19ebd2e8c5bdfadcd2fc7fbeaa1fa13e",
"score": "0.50397897",
"text": "def put\n verify_request!\n for uuid, attributes in @request.params.except(\"sign\")\n unless Vidibus::Uuid.validate(uuid)\n raise \"Updating failed: '#{uuid}' is not a valid UUID.\"\n end\n conditions = {:uuid => uuid}\n if realm_uuid = attributes.delete(\"realm_uuid\")\n conditions[:realm_uuid] = realm_uuid\n end\n result = service.where(conditions)\n unless result.any?\n raise \"Updating service #{uuid} failed: This service does not exist!\"\n end\n for _service in result\n _service.attributes = attributes\n unless _service.save\n raise \"Updating service #{uuid} failed: #{_service.errors.full_messages}\"\n end\n end\n end\n response(:success => \"Services updated.\")\n rescue => e\n response(:error => e.message)\n end",
"title": ""
},
{
"docid": "4f4d5014926c5ed92350b68ff19c5bde",
"score": "0.5029309",
"text": "def update\n @st_consumption_data = StConsumptionData.find(params[:id])\n\n respond_to do |format|\n if @st_consumption_data.update_attributes(params[:st_consumption_data])\n format.html { redirect_to(@st_consumption_data) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @st_consumption_data.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c99238efa98a6e05678c5d303dd5515d",
"score": "0.5015433",
"text": "def update_ticket(ticket_num)\n \n url = ['/tickets/',ticket_num,'.xml'].join\n result = @connection.put url, \n (\n xml = Builder::XmlMarkup.new( :indent => 2 )\n xml.instruct! :xml, :encoding => \"UTF-8\"\n xml.ticket do |t|\n t.tag! \"solved-at\", Time.now\n t.tag! \"status-id\", \"3\"\n end\n )\n end",
"title": ""
},
{
"docid": "6eb02f739f61ef06f4d42865071ecad3",
"score": "0.50149703",
"text": "def put_memory(id, memory)\n data = <<EOF\n <Item \n xmlns=\"http://www.vmware.com/vcloud/v1.5\" \n xmlns:rasd=\"http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData\" \n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" \n xmlns:ns12=\"http://www.vmware.com/vcloud/v1.5\" \n ns12:href=\"#{end_point}vApp/#{id}/virtualHardwareSection/memory\" \n ns12:type=\"application/vnd.vmware.vcloud.rasdItem+xml\" \n xsi:schemaLocation=\"http://www.vmware.com/vcloud/v1.5 #{end_point}v1.5/schema/master.xsd http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2.22.0/CIM_ResourceAllocationSettingData.xsd\">\n <rasd:AllocationUnits>byte * 2^20</rasd:AllocationUnits>\n <rasd:Description>Memory Size</rasd:Description>\n <rasd:ElementName>#{memory} MB of memory</rasd:ElementName>\n <rasd:InstanceID>5</rasd:InstanceID>\n <rasd:Reservation>0</rasd:Reservation>\n <rasd:ResourceType>4</rasd:ResourceType>\n <rasd:VirtualQuantity>#{memory}</rasd:VirtualQuantity>\n <rasd:Weight>0</rasd:Weight>\n <Link rel=\"edit\" type=\"application/vnd.vmware.vcloud.rasdItem+xml\" href=\"#{end_point}vApp/#{id}/virtualHardwareSection/memory\"/>\n </Item>\nEOF\n\n request(\n :body => data,\n :expects => 202,\n :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.rasdItem+xml'},\n :method => 'PUT',\n :parser => Fog::ToHashDocument.new,\n :path => \"vApp/#{id}/virtualHardwareSection/memory\"\n )\n end",
"title": ""
},
{
"docid": "0f940842f66dfd5b4275b24695c9ce36",
"score": "0.5010996",
"text": "def update\n respond_to do |format|\n if @system_component.update(system_component_params)\n format.html { redirect_to([:admin, @system], notice: 'System Component was successfully updated.') }\n format.xml { head :ok }\n website.add_log(user: current_user, action: \"Updated spec: #{@system_component.name}\")\n else\n format.html { render action: \"edit\" }\n format.xml { render xml: @system_component.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "23ace0329876c4a18664ececb6d53036",
"score": "0.50090116",
"text": "def spree_put(action, parameters = nil, session = nil, flash = nil)\n process_spree_action(action, parameters, session, flash, \"PUT\")\n end",
"title": ""
},
{
"docid": "4e874f26e50a454878a4fdde0c7af2b0",
"score": "0.5007288",
"text": "def update_location(params)\n @client.put(\"#{path}/location\", nil, params, \"Content-Type\" => \"application/json\")\n end",
"title": ""
},
{
"docid": "6408c22a0112a32d8043137839101e15",
"score": "0.49961048",
"text": "def update\r\n @se_use_consumption = SeUseConsumption.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @se_use_consumption.update_attributes(params[:se_use_consumption])\r\n format.html { redirect_to(se_use_consumption_path(@se_use_consumption.se_product), :notice => 'Electricity consumption of sensor system was successfully updated.') }\r\n format.xml { head :ok }\r\n else\r\n format.html { render :action => \"edit\" }\r\n format.xml { render :xml => @se_use_consumption.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "134df29b31022dec362c1f610016edbd",
"score": "0.49957252",
"text": "def update_rest\n @page_usage = PageUsage.find(params[:id])\n\n respond_to do |format|\n if @page_usage.update_attributes(params[:page_usage])\n flash[:notice] = 'PageUsage was successfully updated.'\n format.html { redirect_to(@page_usage) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @page_usage.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "04c72fd68064d78e74c0a0866c176b72",
"score": "0.49883342",
"text": "def index\r\n @st_uses = StUse.all\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.xml { render :xml => @st_uses }\r\n end\r\n end",
"title": ""
},
{
"docid": "6312e1810547b1f6de4b37730cd58980",
"score": "0.49857906",
"text": "def put(uri, options = {})\n build_response(request.put(uri, build_request_options({:input => options.to_params})))\n end",
"title": ""
},
{
"docid": "bb96bab09259313709de4d5029ee2765",
"score": "0.4985604",
"text": "def put(path, opts = {})\n request(:put, path, opts)\n end",
"title": ""
},
{
"docid": "52042e570c31a7f9f0a6b8c5f037a334",
"score": "0.49851364",
"text": "def update\n @updateDoc = ''\n\n case params[:updateAction]\n when \"compute\"\n action = COMPUTE_SERVICE_PROFILE\n when \"storage\"\n action = STORAGE_SERVICE_PROFILE\n when \"up\"\n action = \"admin-up\"\n when \"down\"\n action = \"admin-down\"\n when \"reboot\"\n action = \"cycle-immediate\"\n else\n logger.warn \"Cisco UCS: update request had invalid action '#{params[:updateAction]}'\"\n redirect_to ucs_edit_path, :notice => 'You must choose an action.'\n return\n end\n\n if action == COMPUTE_SERVICE_PROFILE || action == STORAGE_SERVICE_PROFILE\n match_count = instantiate_service_profile(action)\n else\n match_count = send_power_commands(action)\n end\n\n if match_count == 0\n redirect_to ucs_edit_path, :notice => 'You must select at least one node.'\n return nil\n end\n\n @updateDoc = \\\n \"<configConfMos inHierarchical='false' cookie='#{ucs_session_cookie}'><inConfigs>\" +\n @updateDoc +\n \"</inConfigs></configConfMos>\"\n\n serverResponseDoc = sendXML(@updateDoc)\n redirect_to ucs_edit_path, :notice => 'Your update has been applied.'\n end",
"title": ""
},
{
"docid": "85896eda3e84fb837a1a39eedd04fdde",
"score": "0.49815753",
"text": "def update\n @satelite = Satelite.find(params[:id])\n\n respond_to do |format|\n if @satelite.update_attributes(params[:satelite])\n format.html { redirect_to(@satelite, :notice => 'Satelite was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @satelite.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c7ce258097892d5a25ac06cf5fa6fa33",
"score": "0.4981282",
"text": "def test_put_existing_if_match_correct\n request = Http::Request.new(\n 'PUT',\n '/file1',\n { 'If-Match' => \"\\\"#{Digest::MD5.hexdigest('foo')}\\\"\" },\n 'hello'\n )\n\n response = self.request(request)\n\n assert_equal(204, response.status)\n\n assert_equal(\n 'hello',\n @server.tree.node_for_path('file1').get\n )\n\n assert_equal(\n {\n 'X-Sabre-Version' => [Version::VERSION],\n 'Content-Length' => ['0'],\n 'ETag' => [\"\\\"#{Digest::MD5.hexdigest('hello')}\\\"\"]\n },\n response.headers\n )\n end",
"title": ""
},
{
"docid": "ec01cb4499d7f4b82a18002078576944",
"score": "0.49764362",
"text": "def update\n @solexame = Solexame.find(params[:id])\n\n respond_to do |format|\n if @solexame.update_attributes(params[:solexame])\n flash[:notice] = 'Solexame was successfully updated.'\n format.html { redirect_to(@solexame) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @solexame.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1b973018948b9fda211ffd09aee65941",
"score": "0.49724743",
"text": "def put uri1, uri2=nil, options={}\n retrieve uri1, uri2, options.merge(:http_method => :put)\n end",
"title": ""
},
{
"docid": "1b973018948b9fda211ffd09aee65941",
"score": "0.49724743",
"text": "def put uri1, uri2=nil, options={}\n retrieve uri1, uri2, options.merge(:http_method => :put)\n end",
"title": ""
},
{
"docid": "57acb365af681fbce09e1e23abe0008a",
"score": "0.49701044",
"text": "def put(opts = {})\n http_request(opts, :put)\n end",
"title": ""
}
] |
fa9da7f9df52876e2515cabbbe9f7d13
|
A list of the param names that can be used for filtering the Product list
|
[
{
"docid": "36c306461d723c686f8215d83ae71cbd",
"score": "0.6153985",
"text": "def filtering_params(params)\n params.slice(:status, :location, :starts_with)\n end",
"title": ""
}
] |
[
{
"docid": "e08f0ad73ff66d4583c09b6e0b9c7f7e",
"score": "0.71184033",
"text": "def filtering_params(params)\n\t params.slice(:brand, :grcid, :platform, :environment)\n\tend",
"title": ""
},
{
"docid": "4a8e923066a524dd484235066440d455",
"score": "0.70020515",
"text": "def filtering_params(params)\n params.slice(:shortlist, :client, :category, :updated_at, :costmodel, :state, :prio)\n end",
"title": ""
},
{
"docid": "c196151e01c40a8f125a691eec8b56a1",
"score": "0.69222236",
"text": "def filter_parameters\n @categories = Category.all\n @brands = Brand.all\n @stores = Store.all\n end",
"title": ""
},
{
"docid": "b16bbad82cd34857b231b84fa9c2839e",
"score": "0.687059",
"text": "def filter_products(params)\n if params[:filter] != \"{}\" #TODO: use a more generic conditional\n filter = JSON.parse(params[:filter])\n filter.each do |property, value|\n @products = @products.select do |product|\n product[property].to_s.include? value\n end\n end\n end\n end",
"title": ""
},
{
"docid": "bd826c318f811361676f5282a9256071",
"score": "0.6720072",
"text": "def filter_parameters; end",
"title": ""
},
{
"docid": "a69cea4d350c1c961253ed326f19828d",
"score": "0.67169434",
"text": "def filtering_params(params)\n params.slice(:manufacturer_id)\n end",
"title": ""
},
{
"docid": "394f25acaeedf0c23abe9d4950d4dbe6",
"score": "0.6715516",
"text": "def attribute_filtering_params\n params[:attr] ? params[:attr].map(&:to_sym) : nil\n end",
"title": ""
},
{
"docid": "1f14a714108ab51cf30883a4c2a33c2a",
"score": "0.6703517",
"text": "def attribute_filtering_params\n params[:attr] ? Array(params[:attr]).map(&:to_sym) : nil\n end",
"title": ""
},
{
"docid": "c436017f4e8bd819f3d933587dfa070a",
"score": "0.66959554",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8",
"score": "0.6679812",
"text": "def filter_params\n end",
"title": ""
},
{
"docid": "3747db70c24e179ef8695b003b0a6005",
"score": "0.66736996",
"text": "def filtering_params(params)\n params.slice(:brand, :model, :year)\n end",
"title": ""
},
{
"docid": "bf71f22b6a3d024d9581258c3391dd13",
"score": "0.66496664",
"text": "def filter_params(params); end",
"title": ""
},
{
"docid": "b920ab26ffb578c9a97080e684c32547",
"score": "0.6597644",
"text": "def filtering_params(params)\r\n params.slice(:starts_with, :ends_with, :contains)\r\n end",
"title": ""
},
{
"docid": "9a20ab9c74cde2b2122fa1e3ea049a0d",
"score": "0.6560164",
"text": "def filter_to_search_param(o)\n t = case o\n when ProductCat\n [\"c\", o.id]\n when Manufacturer\n [\"m\", o.id]\n when Supplier\n [\"s\", o.id]\n when Tag\n [\"t\", o.name]\n when ClippingSource\n [\"s\", o.id]\n end\n return t if t && o.id\n end",
"title": ""
},
{
"docid": "521a2588cca46c07d3407db7cac0eb96",
"score": "0.65565205",
"text": "def filtering_params\n params.slice(:type, :min_price, :max_price, \n :min_sq_ft, :max_sq_ft)\n end",
"title": ""
},
{
"docid": "8d2f08bf007cd5d1bdefb45f2bc9d4f8",
"score": "0.65432143",
"text": "def filtering_params(params)\n params.slice(:brand, :price, :mood)\nend",
"title": ""
},
{
"docid": "f49b29e06fbaecd77508caea6df335be",
"score": "0.6445866",
"text": "def filtering_params(params)\n params.slice(:category, :query, :allfilter)\n end",
"title": ""
},
{
"docid": "b248e725f40ba361d6e0529f389090df",
"score": "0.64439255",
"text": "def filter_by_param(params={})\n if (sub_keys = params[\"allowed_keys\"])\n sub_keys.split(',').select do |key|\n self.allowed_keys.any? {|allowed_key| key.start_with?(allowed_key)}\n end\n else\n self.allowed_keys\n end\n end",
"title": ""
},
{
"docid": "b4ac8bc6941a87425ac2dc42a226295f",
"score": "0.64322025",
"text": "def filtered_params_config; end",
"title": ""
},
{
"docid": "b869df4d647151bccdf662ec37c21f7b",
"score": "0.6431128",
"text": "def catalog filter_params\n result = Product\n .catalog_products(filter_params: filter_params,\n category_ids: self_and_descendants.ids)\n result\n end",
"title": ""
},
{
"docid": "79a2128f40e229ff07017cf44c3891eb",
"score": "0.64224875",
"text": "def filtered_params\n params.inject({}) do |hsh, p|\n p_name, p_value = p\n fp = FilteredParam.new(p_name, p_value, self)\n hsh[p_name.to_sym] = fp\n hsh\n end.with_indifferent_access\n end",
"title": ""
},
{
"docid": "4cf94d9cba57e1e5f2138330a4d3d544",
"score": "0.641186",
"text": "def filtering_params(params)\n params.slice(:any_category, :user_recipes, :query)\n end",
"title": ""
},
{
"docid": "56c1c0f1e01e72e7ed193bcc26920020",
"score": "0.6404349",
"text": "def filtering_params(params)\n params.slice(:medicare, :slider, :specialty, :distance)\n end",
"title": ""
},
{
"docid": "d82836ca6bf9a3bce004862ebbfa4514",
"score": "0.6403758",
"text": "def filtering_params(params)\n\t\t\tparams.slice(\n\t\t\t\t:s,\n\t\t\t\t:location,\n\t\t\t\t:starts_with)\n\t\tend",
"title": ""
},
{
"docid": "76c06286658fd17ca2a742c7884add82",
"score": "0.6401165",
"text": "def request_param_list\n @parameters.keys\n end",
"title": ""
},
{
"docid": "bea09f9e69046e4dd0a890dc5cea0958",
"score": "0.6383521",
"text": "def filtering_params(params)\n params.slice(Comaction::ACTION_TYPES_NAMES.values)\n end",
"title": ""
},
{
"docid": "e90170e33ff0123bf2bf7ce4aeb138d4",
"score": "0.6365154",
"text": "def pnames\n @params.keys\n end",
"title": ""
},
{
"docid": "e90170e33ff0123bf2bf7ce4aeb138d4",
"score": "0.6365154",
"text": "def pnames\n @params.keys\n end",
"title": ""
},
{
"docid": "e90170e33ff0123bf2bf7ce4aeb138d4",
"score": "0.6365154",
"text": "def pnames\n @params.keys\n end",
"title": ""
},
{
"docid": "e90170e33ff0123bf2bf7ce4aeb138d4",
"score": "0.6365154",
"text": "def pnames\n @params.keys\n end",
"title": ""
},
{
"docid": "ec71db0877b2b1d504338607a3d1ffb1",
"score": "0.6357567",
"text": "def filtering_params(params)\n params.slice(:order_date, :user_id, :account_manager_id, :customer_id, :currency_id)\n end",
"title": ""
},
{
"docid": "b275e68d657aac7565b7da55922cbcae",
"score": "0.6353064",
"text": "def should_filter_params(*keys)\n ::ActiveSupport::Deprecation.warn(\"use: should filter_param\")\n keys.each do |key|\n should filter_param(key)\n end\n end",
"title": ""
},
{
"docid": "40fa3167ad1d71736f4bec4fe6410c58",
"score": "0.6311309",
"text": "def list_filters\n {\n position_code: \"PositionCode eq VALUE\",\n specialty: \"Specialty eq VALUE\",\n id: \"ID eq VALUE\"\n }\n end",
"title": ""
},
{
"docid": "c2e3e6de7a365bc2ccfb9a09095e2ca3",
"score": "0.6303379",
"text": "def param_names\n @param_names ||=\n if well_formed?\n sample_class.instance_method(method_name)\n .parameters\n .select { |param| [:keyreq, :key].include? param.first }\n .map(&:last)\n else\n []\n end\n end",
"title": ""
},
{
"docid": "709bdfc88c7ca36f37a30f1befbc6fb6",
"score": "0.62977403",
"text": "def filter\n filters_available.each do |filter|\n send(\"filter_by_#{filter}\", @params[filter]) if @params[filter].present?\n end\n filter_price\n merge\n end",
"title": ""
},
{
"docid": "aa89f609e585b786970186dd463c334f",
"score": "0.6284723",
"text": "def filtering_params(params)\n\t\tparams.slice(:category)\n\tend",
"title": ""
},
{
"docid": "8e495b670b7100324ed7a75c2fa9d0ce",
"score": "0.6265439",
"text": "def filtering_params(params)\n\t\tparams.slice(:type_transaction, :date_time, :cpf, :value, :credit_card)\n\tend",
"title": ""
},
{
"docid": "5ae0cb9090b47b38d2526d9759bbb7a4",
"score": "0.623693",
"text": "def filtering_params(params)\n params.slice(:theme, :price, :min_age, :max_age, :am, :weeks)\n end",
"title": ""
},
{
"docid": "d3732ff42abd0a618a006d1f24e31e38",
"score": "0.62354493",
"text": "def add_to_filter_parameters; end",
"title": ""
},
{
"docid": "346c25a14fea820d020dd23c8ea9a090",
"score": "0.62281454",
"text": "def filtering_params\n params.fetch(:filtering, {})\n end",
"title": ""
},
{
"docid": "b465424c0605997d4d6bd6b3245130aa",
"score": "0.62187827",
"text": "def valued_parameters\n @valued_parameters ||= filter_parameters.select do |key,value|\n # :order is special, it must always be excluded\n key.to_sym != :order && valued_parameter?(key,value)\n end\n end",
"title": ""
},
{
"docid": "280fa93b293e4b6a21558853ae2b0009",
"score": "0.6210229",
"text": "def known_parameter_names\n @parameters.keys.map {|name| name.to_s}\n end",
"title": ""
},
{
"docid": "7e12cbedcbe89ed34ebe914085bd7004",
"score": "0.6204359",
"text": "def filter_question_params(params)\n params.select { |k, _| %w(description weight question_type order dependent_question_id).include?(k) }\n end",
"title": ""
},
{
"docid": "61bb42334baa49d3591676a62552647d",
"score": "0.61906266",
"text": "def parameter_names_string\n @parameters.map { |info| info.name }.join(', ')\n end",
"title": ""
},
{
"docid": "b715b62424f069c594246f5f7cbde392",
"score": "0.6175623",
"text": "def filtering_params\n params.slice(:title, :label, :serial, :style, :min_dur, :max_dur,\n :min_tempo, :max_tempo, :instrument)\n end",
"title": ""
},
{
"docid": "ae4ed64011d7e694f7185feac0865100",
"score": "0.61749125",
"text": "def filtering_params(params)\n params.slice(:search,:prof_area,:prof_situation,:locality)\n end",
"title": ""
},
{
"docid": "99bbcc6101a9e521313cf04f280f4583",
"score": "0.6158684",
"text": "def potential_filters\n [:date_filter,:classroom_filter, :sort_by]\n end",
"title": ""
},
{
"docid": "4e65897a08871ed2f9f60aa7220e29dd",
"score": "0.61441934",
"text": "def parameter_names\n @parameters.map { |info| Heroics.ruby_name(info.name) }.join(', ')\n end",
"title": ""
},
{
"docid": "d83a6cf7546ae9666670e6bfe5246a66",
"score": "0.614036",
"text": "def applicable_filters\n fs = []\n #fs << Spree::Core::ProductFilters.taxons_below(self)\n #fs << Spree::Core::ProductFilters.brand_filter if Spree::Core::ProductFilters.respond_to?(:brand_filter)\n #fs << Spree::Core::ProductFilters.selective_brand_filter(self) if Spree::Core::ProductFilters.respond_to?(:selective_brand_filter)\n\n fs << Spree::Core::ProductFilters.sort_scope if Spree::Core::ProductFilters.respond_to?(:sort_scope)\n fs << Spree::Core::ProductFilters.price_range_filter if Spree::Core::ProductFilters.respond_to?(:price_range_filter)\n\n\n Spree::Property.all.each do |p|\n method_any = p.name.downcase + \"_any\"\n if Spree::Core::ProductFilters.respond_to?(\"#{method_any}_filter\")\n fs << Spree::Core::ProductFilters.send(\"#{method_any}_filter\", self)\n end\n end\n fs\n end",
"title": ""
},
{
"docid": "31b115681904f617f40e28239252bdd6",
"score": "0.61393094",
"text": "def filter *names\n names.each do |n|\n instance_eval(&self.filters[n.to_sym])\n end\n end",
"title": ""
},
{
"docid": "a4bf30849c16b0b7f15d7299fd51c8b0",
"score": "0.6130827",
"text": "def filter_params(_sub_object_attribute = nil)\n required = :returns_lbtt_property\n attribute_list = Lbtt::Property.attribute_list\n params.require(required).permit(attribute_list) if params[required]\n end",
"title": ""
},
{
"docid": "00c5b47ee4006a7fc2277d619412281c",
"score": "0.612803",
"text": "def product_visibility_filters\n \"searchCriteria[filter_groups][0][filters][0][field]=status&\" +\n + \"searchCriteria[filter_groups][0][filters][0][value]=1&\" +\n + \"searchCriteria[filter_groups][0][filters][0][conditionType]=eq&\" +\n + \"searchCriteria[filter_groups][1][filters][0][field]=visibility&\" +\n + \"searchCriteria[filter_groups][1][filters][0][value]=2&\" +\n + \"searchCriteria[filter_groups][1][filters][0][value]=3&\" +\n + \"searchCriteria[filter_groups][1][filters][0][value]=4&\" +\n + \"searchCriteria[filter_groups][1][filters][0][conditionType]=qteq&\"\n end",
"title": ""
},
{
"docid": "c561d9c5e61df6cbb2e4192dd4c685db",
"score": "0.6124475",
"text": "def filter(params); end",
"title": ""
},
{
"docid": "310652bd0a99aac9e9f59bec79b0843f",
"score": "0.61200464",
"text": "def for_which_products_are_you_responsible\n productslist = []\n @products.each do |product|\n productslist << product.name\n end\n productslist\n end",
"title": ""
},
{
"docid": "578c8524f99eb7d78e7772312d738297",
"score": "0.6118207",
"text": "def filter_keys_from_params\n filter_hash.keys.map(&:to_sym) - [:not_ids]\n end",
"title": ""
},
{
"docid": "8aa4968e0a5352eff00d5bedb7b4047d",
"score": "0.61070406",
"text": "def merchant_params\n params.select{|key,value| key.in?(Merchant.column_names())}\n end",
"title": ""
},
{
"docid": "2cb3ccbca7de4ec2b6414329485c7c06",
"score": "0.6105195",
"text": "def available_filters\n %w(me type priest_id distance now)\n end",
"title": ""
},
{
"docid": "92a175644a0ab66c0f2441cbb5812f1c",
"score": "0.6104365",
"text": "def params_names\n @params.keys\n end",
"title": ""
},
{
"docid": "6e078287f8ee33ea233142929d9d094c",
"score": "0.60913014",
"text": "def param_list\n ParamSpec.signature(@params, self)\n end",
"title": ""
},
{
"docid": "b63e6e97815a8745ab85cd8f7dd5b4fb",
"score": "0.60889995",
"text": "def excluded_from_filter_parameters; end",
"title": ""
},
{
"docid": "0c03c22d4ad6928d78954feb817ff2e8",
"score": "0.60858667",
"text": "def filtering_params(params)\n params.slice(*valid_params)\n end",
"title": ""
},
{
"docid": "2b0345c0ef3b8d142dc28528b3aaefa2",
"score": "0.6084476",
"text": "def request_filters\n if(self.config_setup[:request_filters])\n @request_filters = (self.config_setup[:request_filters][@product] ? self.config_setup[:request_filters][@product] : {})\n else\n @request_filters = {}\n end\n @request_filters\n end",
"title": ""
},
{
"docid": "3c3eaca75b0e8e19b85893b0715d4f3a",
"score": "0.6064487",
"text": "def producto_params\n \n end",
"title": ""
},
{
"docid": "39df35579dbfde0c3a600cce36439044",
"score": "0.6055283",
"text": "def filtering_params(params)\n params.slice(:status)\n end",
"title": ""
},
{
"docid": "7b0869ad0384fb43afaa59fca71e421e",
"score": "0.6054438",
"text": "def product_params\n if action_name == 'copy_to_branch' and (@current_account.is_admin? or @current_account.is_boss?)\n params.require(:product).permit(:branches=>[], :product_ids=>[])\n elsif ['batch_remove', 'batch_added', 'batch_shelve'].index action_name\n params.require(:product).permit(:product_ids=>[])\n else\n params.require(:product).permit(:name, :description, :image, :price, :stock, :tag_id, :product_unit, :category_ids=>[])\n end\n end",
"title": ""
},
{
"docid": "4df9f8c79ff692450b4850bb1a8e92f5",
"score": "0.6047678",
"text": "def filtering_params(params)\n params.slice(:status, :building, :room_type)\n end",
"title": ""
},
{
"docid": "ee90e849f7ee7c92ba1bc8d2e7b28b1a",
"score": "0.6038735",
"text": "def filtering_params(params)\n params.slice(:environment, :testtype)\n end",
"title": ""
},
{
"docid": "e9315a45846acd899b7a3f9134fc4bfb",
"score": "0.60349095",
"text": "def filter_newrelic_params(params)\n @filters ||= NewRelic::Control.instance['filter_parameters']\n return params if @filters.nil? || @filters.empty?\n duped_params = params.dup\n duped_params.each{|k,v| duped_params[k] = 'FILTERED' if @filters.include?(k) }\n duped_params\n end",
"title": ""
},
{
"docid": "6183ce1316462b99d51a5967b8706130",
"score": "0.60283506",
"text": "def filter_list\n @filter_names ||= self.scopes.map{|s| s.first.to_s}\n end",
"title": ""
},
{
"docid": "94ea6d319a1c46fc6e1f5029b5ae6d9c",
"score": "0.601807",
"text": "def search_params(params)\n params.slice(:company, :product, :slogan, :city, :state, :street_address, :zip)\n end",
"title": ""
},
{
"docid": "03b5fa7de1cacb1c46294286bbf29ae1",
"score": "0.60115016",
"text": "def filter_param(key, value); end",
"title": ""
},
{
"docid": "f4f559de4ed5a9fbb9b2364fd4b03ce2",
"score": "0.6009838",
"text": "def parse_product_filters\n product_filters = {}\n combofilters = params[:combofilters].to_s\n if combofilters.present?\n combofilters.split('-').each_with_index{|id, i|\n #选择任意是 id = 0\n if id.to_i > 0\n product_filters[\"filt#{i}\"] = id.to_i\n end\n }\n end\n product_filters\n end",
"title": ""
},
{
"docid": "c9469528f2e2d29d6560792ed744f48f",
"score": "0.59997994",
"text": "def filter_param\n params[:todo_list].slice(:name, :description, :todo_items_attributes)\n end",
"title": ""
},
{
"docid": "9d4a37b81d05e2b8e4f7d0dec95c3fa1",
"score": "0.59991074",
"text": "def params_names\n params.require(:data).require(:attributes)\n .permit(\n requests: [\n {\n request: self.class.pipeline_const.request_attributes,\n sample: %i[name external_id species],\n tube: :barcode\n }\n ]\n ).to_h[:requests]\n end",
"title": ""
},
{
"docid": "3f16e5efff2dcb3fad7c9d1fa735f246",
"score": "0.5995674",
"text": "def list_filters\n instance_variables.map { |variable| instance_variable_get variable }\n end",
"title": ""
},
{
"docid": "3292edbc682f43cb1d7d5193151863c8",
"score": "0.59938705",
"text": "def includes_param\n if @params[\"display\"]\n return @params[\"display\"].split(\",\").map {|e| e.to_sym}\n end\n Array.new\n end",
"title": ""
},
{
"docid": "5b04edb8b01b189290c02bf5ec41d9b6",
"score": "0.5984859",
"text": "def filter_parameters=(_arg0); end",
"title": ""
},
{
"docid": "eebb7d01c79994302ecd007cfbebffda",
"score": "0.5984033",
"text": "def list_filters() \r\n if (@filters == nil || @filters.empty?)\r\n print \"No filters.\"\r\n return\r\n end\r\n \r\n @filters.each do |k, v|\r\n if (v.respond_to? :name)\r\n name = v.name\r\n else\r\n name = v\r\n end\r\n print \"#{k}: #{name}\\n\"\r\n end\r\n end",
"title": ""
},
{
"docid": "ede01a6ef621b1a7946e65603eb24731",
"score": "0.5975992",
"text": "def filter_params(_sub_object_attribute = nil)\n required = :returns_lbtt_ads\n output = params.require(required).permit(Lbtt::Ads.attribute_list) if params[required]\n output\n end",
"title": ""
},
{
"docid": "2d836da4a398739d9edd3cf6d86b4c01",
"score": "0.59750235",
"text": "def index_filters\n param! :aisle, String, blank: false\n param! :rack, String, blank: false\n param! :slab, String, blank: false\n param! :bin, String, blank: false\n\n params.permit(:aisle, :slab, :bin, :rack)\n end",
"title": ""
},
{
"docid": "72347fd6976387f7c77b74e6440673f0",
"score": "0.5974631",
"text": "def potential_filters\n [:sort_by_filter]\n end",
"title": ""
},
{
"docid": "80321f3050850a5e5b383ed5f82af0fe",
"score": "0.5972341",
"text": "def selected_products ; selected_ids('product' ); end",
"title": ""
},
{
"docid": "066b43f248706bffd03124991c6b2342",
"score": "0.59698373",
"text": "def filter_params\n params[:filter]\n end",
"title": ""
},
{
"docid": "6d6d49737751490ea635d45998b96ee3",
"score": "0.5969498",
"text": "def filtering_params(params)\n params.slice(:state, :county, :starts_with)\n end",
"title": ""
},
{
"docid": "013c4786a44835776f11586070170616",
"score": "0.59653866",
"text": "def filter_list_params(_list_attribute, _sub_object_attribute = nil)\n return unless params[:returns_lbtt_lbtt_return] && params[:returns_lbtt_lbtt_return][:returns_lbtt_relief_claim]\n\n permitted_attributes = [:relief_type_expanded] + Lbtt::ReliefClaim.attribute_list\n params.require(:returns_lbtt_lbtt_return)\n .permit(returns_lbtt_relief_claim: permitted_attributes)[:returns_lbtt_relief_claim].values\n end",
"title": ""
},
{
"docid": "63944d10aa4cde014b8332874db87cb9",
"score": "0.59637016",
"text": "def excluded_from_filter_parameters=(_arg0); end",
"title": ""
},
{
"docid": "9ca8635f8aa312c0a839e6b21f67e2e5",
"score": "0.59610337",
"text": "def available_filters\n unless @available_filters\n initialize_available_filters\n @available_filters.each do |field, options|\n options[:name] ||= l(options[:label] || \"field_#{field}\".gsub(/_id$/, ''))\n end\n end\n @available_filters\n end",
"title": ""
},
{
"docid": "e9756706e33120c5f11678bd9a08ddeb",
"score": "0.59570044",
"text": "def list_params\n params.require(:list).permit(:name, :nb_product)\n end",
"title": ""
},
{
"docid": "673bafd7e0ded73d572538b4c8052f76",
"score": "0.59483635",
"text": "def product_params\n params[:product]\n end",
"title": ""
},
{
"docid": "673bafd7e0ded73d572538b4c8052f76",
"score": "0.5946818",
"text": "def product_params\n params[:product]\n end",
"title": ""
},
{
"docid": "673bafd7e0ded73d572538b4c8052f76",
"score": "0.5946818",
"text": "def product_params\n params[:product]\n end",
"title": ""
},
{
"docid": "673bafd7e0ded73d572538b4c8052f76",
"score": "0.5946818",
"text": "def product_params\n params[:product]\n end",
"title": ""
},
{
"docid": "673bafd7e0ded73d572538b4c8052f76",
"score": "0.5946818",
"text": "def product_params\n params[:product]\n end",
"title": ""
},
{
"docid": "673bafd7e0ded73d572538b4c8052f76",
"score": "0.5946818",
"text": "def product_params\n params[:product]\n end",
"title": ""
},
{
"docid": "7dec72936611c6b4d4868114a8a8e24b",
"score": "0.59442294",
"text": "def jsonapi_filter_params(allowed_fields)\n filtered = {}\n requested = params[:filter] || {}\n allowed_fields = allowed_fields.map(&:to_s)\n\n requested.each_pair do |requested_field, to_filter|\n field_names, predicates = JSONAPI::Filtering\n .extract_attributes_and_predicates(requested_field)\n\n wants_array = predicates.any? && predicates.map(&:wants_array).any?\n\n if to_filter.is_a?(String) && wants_array\n to_filter = to_filter.split(',')\n end\n\n if predicates.any? && (field_names - allowed_fields).empty?\n filtered[requested_field] = to_filter\n end\n end\n\n filtered\n end",
"title": ""
},
{
"docid": "98dcd359e3df4a5a1a4d6ba6b2cc905a",
"score": "0.59434986",
"text": "def cart_item_params\n\t\t\tparams.permit([:product_id, :sub_product_ids, :restaurant_id].concat(params.keys.select { |key| key.to_s.start_with?(\"product_variant_\") }))\n\t\tend",
"title": ""
},
{
"docid": "6076c64c007996250dc5041d2ca7ad0a",
"score": "0.5942694",
"text": "def products(**params)\n filters = params.map {|key, value| \"#{key}=#{value}\"}\n BestBuy::Request.new(api_key: @api_key,\n affiliate_tracking_id: @affiliate_tracking_id,\n endpoint: 'products',\n filters: filters)\n end",
"title": ""
},
{
"docid": "52c6413685e17b0045783358879f6853",
"score": "0.59409535",
"text": "def potential_filters\n [:date_filter, :reward_status_filter, :teachers_filter, :reward_creator_filter, :sort_by]\n end",
"title": ""
}
] |
e9a573d61965d515df83eb8e39dc96b1
|
convenience 3 lines to 1
|
[
{
"docid": "6604144f900f58a69990f30c9882d646",
"score": "0.0",
"text": "def admin_stats_results(opts = {})\n # Actually use Admin::Stats but with canned inputs;\n # We could stub canned results, but we would actually\n # like tests to break if something about Admin::Stats\n # shifts out from underneath this code, so this veers\n # somewhat in the direction of integration testing.\n admin_stats_stubber(@nodes_hash, faux_db_with(@districts, [@region_hash]))\n stats = Admin::Stats::Maker.new(opts)\n stats.gather_statistics\n stats.results\n end",
"title": ""
}
] |
[
{
"docid": "8bbe12182de705bfd88819c4c85c78a4",
"score": "0.64121443",
"text": "def project_to_line\n end",
"title": ""
},
{
"docid": "c16a81bc8344d4e4873df13219eb5974",
"score": "0.6090608",
"text": "def single_line?; end",
"title": ""
},
{
"docid": "c44f719a13703c13e556bc7110cb4bd9",
"score": "0.6015017",
"text": "def line_to_wrap; end",
"title": ""
},
{
"docid": "6468237b51b26c284b1716f0d3a5de04",
"score": "0.57026774",
"text": "def third_line\n \"#{self.state} #{self.postal_code} #{self.country_short_name}\".squeeze(\" \").strip\n end",
"title": ""
},
{
"docid": "b9f7bd8d790c64a6c0ccdaf77256684b",
"score": "0.5658108",
"text": "def tiny\n shorten(4)\n end",
"title": ""
},
{
"docid": "c300a80c6a3c278a6757e1b404eaba5a",
"score": "0.55994403",
"text": "def original_line; end",
"title": ""
},
{
"docid": "bcf854eaf3bc558ddc83c18cb345170b",
"score": "0.5595282",
"text": "def normal_line(text)\n end",
"title": ""
},
{
"docid": "f9067cbb242809991ed4608f44f4643b",
"score": "0.5586151",
"text": "def leading; end",
"title": ""
},
{
"docid": "6c2030577164801a0aad602a723bec70",
"score": "0.55370444",
"text": "def dividing_line; end",
"title": ""
},
{
"docid": "df9038def05be8a54b0388db9b272ebe",
"score": "0.55189055",
"text": "def teardown_to_oneline(line, length = 60)\n lines = []\n line.split(\" \").each {|line|\n if !lines.empty? && lines[-1].size + line.size + 1 <= length\n lines[-1].concat(\" \" + line)\n else\n lines << line\n end\n }\n return lines\n end",
"title": ""
},
{
"docid": "ad00bf704951f608181c2b901b0d2203",
"score": "0.5502769",
"text": "def to_s\n [\n self.line_01,\n self.line_02,\n self.line_03,\n ].join(\"\\n\")\n end",
"title": ""
},
{
"docid": "1e1a0f00ab4cf2c6fec602be2dea15ea",
"score": "0.5496817",
"text": "def singleLine(line, from, to)\n ans = ''\n \n reapet = line.index(from) - line.index(to)\n if reapet > 0 \n steps = reapet\n\n i = line.index(from)\n reapet.times{\n i += 1\n ans += \"#{line[i]}, \"\n }\n else\n\n reapet = line.index(to) - line.index(from)\n steps = reapet\n i = line.index(to)\n reapet.times{\n i -= 1\n ans += \"#{line[i]}, \"\n }\n\n end\n\n return [ans, steps]\n\n end",
"title": ""
},
{
"docid": "7a0c5755e945e3a74fb53bcdee96b99c",
"score": "0.54814094",
"text": "def format; :n3; end",
"title": ""
},
{
"docid": "c2aa98097d74cb52e208bdd51c5938fb",
"score": "0.547979",
"text": "def to_one_line(v)\n if v.is_a?(Array)\n v.each_with_index do |vv,i|\n v[i] = to_one_line(vv)\n end\n v\n else\n v.to_s.gsub(/\\n+|\\t+/, '').gsub(/ +/, ' ').strip\n end\n end",
"title": ""
},
{
"docid": "34923a0bc2808735e0eee0ef223b6ad2",
"score": "0.54623324",
"text": "def convert_one_line_constructions(source)\n for_outstrings_of(source) do |str|\n ShortcutsConverter.convert str\n end\n end",
"title": ""
},
{
"docid": "d085a2460460f0af59aa75fdb7e10d94",
"score": "0.546153",
"text": "def beautify; end",
"title": ""
},
{
"docid": "d085a2460460f0af59aa75fdb7e10d94",
"score": "0.546153",
"text": "def beautify; end",
"title": ""
},
{
"docid": "0ae09e1862ecadbddbc34bf60ee16a25",
"score": "0.5424557",
"text": "def format_lines(lines)\n prev = lines[0]\n slices = lines.slice_before do |e|\n (prev + 1 != e).tap { prev = e }\n end\n slices.map { |slice_first, *, slice_last| slice_last ? (slice_first..slice_last) : slice_first }\n end",
"title": ""
},
{
"docid": "050b5f16eda990820c8422435faf2064",
"score": "0.54044676",
"text": "def first_line_only(range); end",
"title": ""
},
{
"docid": "050b5f16eda990820c8422435faf2064",
"score": "0.54044676",
"text": "def first_line_only(range); end",
"title": ""
},
{
"docid": "050b5f16eda990820c8422435faf2064",
"score": "0.54044676",
"text": "def first_line_only(range); end",
"title": ""
},
{
"docid": "ff9feb12b2bfc0e67bda99a9a4518262",
"score": "0.5373325",
"text": "def first_line; end",
"title": ""
},
{
"docid": "ff9feb12b2bfc0e67bda99a9a4518262",
"score": "0.5373325",
"text": "def first_line; end",
"title": ""
},
{
"docid": "ff9feb12b2bfc0e67bda99a9a4518262",
"score": "0.5373325",
"text": "def first_line; end",
"title": ""
},
{
"docid": "ff9feb12b2bfc0e67bda99a9a4518262",
"score": "0.5373325",
"text": "def first_line; end",
"title": ""
},
{
"docid": "ff9feb12b2bfc0e67bda99a9a4518262",
"score": "0.5373325",
"text": "def first_line; end",
"title": ""
},
{
"docid": "ff9feb12b2bfc0e67bda99a9a4518262",
"score": "0.5373325",
"text": "def first_line; end",
"title": ""
},
{
"docid": "ff9feb12b2bfc0e67bda99a9a4518262",
"score": "0.5373325",
"text": "def first_line; end",
"title": ""
},
{
"docid": "ff9feb12b2bfc0e67bda99a9a4518262",
"score": "0.5373325",
"text": "def first_line; end",
"title": ""
},
{
"docid": "ff9feb12b2bfc0e67bda99a9a4518262",
"score": "0.5373325",
"text": "def first_line; end",
"title": ""
},
{
"docid": "ff9feb12b2bfc0e67bda99a9a4518262",
"score": "0.5373325",
"text": "def first_line; end",
"title": ""
},
{
"docid": "697bd33d4c4954d73c2db5be4ea45c6d",
"score": "0.53575194",
"text": "def sequence_separator; end",
"title": ""
},
{
"docid": "313bf2481cf18ca434aa84aa67af6c54",
"score": "0.53376544",
"text": "def previous_line_to_wrap; end",
"title": ""
},
{
"docid": "dbf45e3afd5e51ab1bd7891c2e2baef8",
"score": "0.5330806",
"text": "def format(lines, cur_no)\n lastno = lines.keys.max\n lines.map do |num, line|\n sign = num + 1 == cur_no ? '=> ' : ' ' * 3\n super('%s%*d: %s', sign, lastno.to_s.size, num + 1, line)\n end.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "14ed96d9fa52fd96c38aad87b6d492d6",
"score": "0.53234506",
"text": "def leading=(_); end",
"title": ""
},
{
"docid": "bab3d902a9051ec09b13d1f705491f60",
"score": "0.5321548",
"text": "def sequence_separator=(_arg0); end",
"title": ""
},
{
"docid": "bab3d902a9051ec09b13d1f705491f60",
"score": "0.5321548",
"text": "def sequence_separator=(_arg0); end",
"title": ""
},
{
"docid": "731bcac6401835a4d33e597baf64dd50",
"score": "0.5307169",
"text": "def transform line\n i = 1\n tortoise = line[i]\n hare = line[i * 2]\n while tortoise != hare\n i += 1\n tortoise = line[i]\n hare = line[i * 2]\n end\n v = i\n\n mu = 0\n tortoise = line[mu]\n hare = line[v * 2 + mu]\n while tortoise != hare\n mu += 1\n tortoise = line[mu]\n hare = line[v * 2 + mu]\n end\n\n lam = 1\n hare = line[mu + lam]\n while tortoise != hare\n lam += 1\n hare = line[mu + lam]\n end\n #puts \"v mu lam %d %d %d\" % [v, mu, lam]\n \n line[mu, lam] \nend",
"title": ""
},
{
"docid": "6703aa917fd3104743655d0292acbf82",
"score": "0.5268815",
"text": "def indent1\n ' ' * 2\n end",
"title": ""
},
{
"docid": "99763bdd4da5626d1eb69b5e2b804436",
"score": "0.5262651",
"text": "def line_a(line, height_headers)\n total_count = height_headers.count\n line = line.split(' ')\n\n if line.count != total_count\n (total_count - line.count).times do\n line.insert(1, '')\n end\n end\n line\n end",
"title": ""
},
{
"docid": "61a7db0d30e586ca824d1a9088fc47a1",
"score": "0.5250444",
"text": "def compact_blank; end",
"title": ""
},
{
"docid": "c4e9e8d40e65d7ecd5861c52b3b2f420",
"score": "0.524775",
"text": "def roll_three_alt\n puts \"...........\n: * :\n: * :\n: * :\n'''''''''''\n\"\nend",
"title": ""
},
{
"docid": "382d41f4f57c355697845069bb0268a7",
"score": "0.52336085",
"text": "def reformat_wrapped(s, width = Config::Gui::MSG_WIDTH - 1)\n \t lines = []\n \t line = \"\"\n \t s.split(/\\s+/).each do |word|\n \t if line.size + word.size >= width\n \t lines << line\n \t line = word\n \t elsif line.empty?\n \t line = word\n \t else\n \t line << \" \" << word\n \t end\n \t end\n \t lines << line if line\n \t return lines\n \tend",
"title": ""
},
{
"docid": "2414d54b4179708a30821fc63e5bc43d",
"score": "0.52229816",
"text": "def join_lines_into_one\n\t\t@complete_letter = Array.new\n\t\t@master = 0\n\t\tmaster_comp = @top_line.length\n\t\tuntil @master == master_comp\n\t\t\ttheory_case\n\t\tend\n\tend",
"title": ""
},
{
"docid": "f602537936151a10d22c21e9675fe578",
"score": "0.5202364",
"text": "def line_ranges=(_); end",
"title": ""
},
{
"docid": "f1ded97a5ce541999d621348ff4b79c5",
"score": "0.5186187",
"text": "def sameLineDivider(n)\n n.times {|x| print \"*\"}\nend",
"title": ""
},
{
"docid": "6da780593bcd30baf001f252a4d19b75",
"score": "0.5182533",
"text": "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",
"title": ""
},
{
"docid": "9776c3da857138e0d79df7f03566543e",
"score": "0.51750773",
"text": "def line_one\n return @line_one\n end",
"title": ""
},
{
"docid": "27f4a30e1c621c35c48433f6971bdcbf",
"score": "0.51724494",
"text": "def roll_three\n puts %Q{...........}\n puts %Q{: * :}\n puts %Q{: * :}\n puts %Q{: * :}\n puts %Q{'''''''''''}\nend",
"title": ""
},
{
"docid": "cebfa12e547ee0e6dfe4d19c81cd60ed",
"score": "0.517084",
"text": "def str3; end",
"title": ""
},
{
"docid": "cebfa12e547ee0e6dfe4d19c81cd60ed",
"score": "0.517084",
"text": "def str3; end",
"title": ""
},
{
"docid": "1c43caa1ab6a5803c5b23f3f9b8de85a",
"score": "0.5156053",
"text": "def line=(_); end",
"title": ""
},
{
"docid": "1c43caa1ab6a5803c5b23f3f9b8de85a",
"score": "0.5156053",
"text": "def line=(_); end",
"title": ""
},
{
"docid": "bc658f9936671408e02baa884ac86390",
"score": "0.5148745",
"text": "def anchored; end",
"title": ""
},
{
"docid": "1e3a43ce0f138a63a6aae086d1cb432d",
"score": "0.5146035",
"text": "def chop!() end",
"title": ""
},
{
"docid": "1e3a43ce0f138a63a6aae086d1cb432d",
"score": "0.5146035",
"text": "def chop!() end",
"title": ""
},
{
"docid": "a092a2fc3df2a6eb510f3cc80114feee",
"score": "0.5139339",
"text": "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",
"title": ""
},
{
"docid": "3861ce7ba201e4b17e7b56aca8ba0d33",
"score": "0.5118222",
"text": "def line; end",
"title": ""
},
{
"docid": "3861ce7ba201e4b17e7b56aca8ba0d33",
"score": "0.5118222",
"text": "def line; end",
"title": ""
},
{
"docid": "3861ce7ba201e4b17e7b56aca8ba0d33",
"score": "0.5118222",
"text": "def line; end",
"title": ""
},
{
"docid": "3861ce7ba201e4b17e7b56aca8ba0d33",
"score": "0.5118222",
"text": "def line; end",
"title": ""
},
{
"docid": "3861ce7ba201e4b17e7b56aca8ba0d33",
"score": "0.5118222",
"text": "def line; end",
"title": ""
},
{
"docid": "3861ce7ba201e4b17e7b56aca8ba0d33",
"score": "0.5118222",
"text": "def line; end",
"title": ""
},
{
"docid": "3861ce7ba201e4b17e7b56aca8ba0d33",
"score": "0.5118222",
"text": "def line; end",
"title": ""
},
{
"docid": "3861ce7ba201e4b17e7b56aca8ba0d33",
"score": "0.5118222",
"text": "def line; end",
"title": ""
},
{
"docid": "3861ce7ba201e4b17e7b56aca8ba0d33",
"score": "0.5118222",
"text": "def line; end",
"title": ""
},
{
"docid": "3861ce7ba201e4b17e7b56aca8ba0d33",
"score": "0.5118222",
"text": "def line; end",
"title": ""
},
{
"docid": "3861ce7ba201e4b17e7b56aca8ba0d33",
"score": "0.5118222",
"text": "def line; end",
"title": ""
},
{
"docid": "3861ce7ba201e4b17e7b56aca8ba0d33",
"score": "0.5118222",
"text": "def line; end",
"title": ""
},
{
"docid": "3861ce7ba201e4b17e7b56aca8ba0d33",
"score": "0.5118222",
"text": "def line; end",
"title": ""
},
{
"docid": "3861ce7ba201e4b17e7b56aca8ba0d33",
"score": "0.5118222",
"text": "def line; end",
"title": ""
},
{
"docid": "3861ce7ba201e4b17e7b56aca8ba0d33",
"score": "0.5118222",
"text": "def line; end",
"title": ""
},
{
"docid": "939545a25521ebc7fb6c115834c755fd",
"score": "0.5109357",
"text": "def fold( value )\n value.gsub( /(^[ \\t]+.*$)|(\\S.{0,#{options(:BestWidth) - 1}})(?:[ \\t]+|(\\n+(?=[ \\t]|\\Z))|$)/ ) do\n $1 || $2 + ( $3 || \"\\n\" )\n end\n\t\tend",
"title": ""
},
{
"docid": "7b9e517f20c8147bab7de105d071adb6",
"score": "0.5108664",
"text": "def chop() end",
"title": ""
},
{
"docid": "7b9e517f20c8147bab7de105d071adb6",
"score": "0.5108664",
"text": "def chop() end",
"title": ""
},
{
"docid": "c7311e722e5bd3b8c08cc553d302dfdb",
"score": "0.51082593",
"text": "def line_one\n @line_one\n end",
"title": ""
},
{
"docid": "2c65a080ac566cd4c5aeb8c7d6ba5d59",
"score": "0.51037085",
"text": "def second_line\n \"#{self.town} #{self.district} #{self.region}\".squeeze(\" \").strip\n end",
"title": ""
},
{
"docid": "87a2afdf4dfe251ec7a3aa54d378255f",
"score": "0.5102337",
"text": "def alignContinuations(theLines)\n\n\tsplitAndAlign(theLines, /^(.*?)\\s+(\\\\)$/, \"\");\n\nend",
"title": ""
},
{
"docid": "438d2fda75b9b6bdd37c94062e2d51e7",
"score": "0.5092032",
"text": "def formatFunction(theLines)\n\n\treplaceVoids(\t\ttheLines);\n\tspaceFirstComment(\ttheLines);\n\nend",
"title": ""
},
{
"docid": "ba0baa7e6043ac8be710f352105f01a4",
"score": "0.50896895",
"text": "def to_internal_row(row, lines)\n # row = (1..23)\n max_row = @gsi.mnr.to_i\n row = row.to_i\n row = 1 if row < 1\n row = 23 if row > 23\n row = max_row if row > max_row\n # drop lines\n lines_to_drop = lines.length-max_row+row-1\n lines.pop(lines_to_drop) if lines_to_drop > 0\n return row\n end",
"title": ""
},
{
"docid": "cc15a4fc27afae19e7ae022b643da98a",
"score": "0.50852394",
"text": "def decoration(number, line_length)\n (\"=\" * number * (line_length+1)) << \"\\n\"\nend",
"title": ""
},
{
"docid": "f35982b50696bea3afed4893e5799007",
"score": "0.50793785",
"text": "def short_long_short(txt1, txt2)\n txt1.length < txt2.length ? (shrt_txt, lng_txt = txt1, txt2) : (shrt_txt, lng_txt = txt2, txt1) \n shrt_txt + lng_txt + shrt_txt\nend",
"title": ""
},
{
"docid": "b0dde447c005cd438050f5fd2b4a00fa",
"score": "0.5078583",
"text": "def indent_text( text, mod, first_line = true )\n\t\t\treturn \"\" if text.to_s.empty?\n spacing = indent( mod )\n text = text.gsub( /\\A([^\\n])/, \"#{ spacing }\\\\1\" ) if first_line\n\t\t\treturn text.gsub( /\\n^([^\\n])/, \"\\n#{spacing}\\\\1\" )\n\t\tend",
"title": ""
},
{
"docid": "380ddcf73aec8ac5ba07d83602ffc25d",
"score": "0.5077741",
"text": "def indent_each_line!(indent_sequence=\"\\t\")\n\t\treturn self.collect!{ |line|\t\"#{indent_sequence}#{line}\" }\n\tend",
"title": ""
},
{
"docid": "e283b300fd56deaf6b1bf2ca76180617",
"score": "0.50668424",
"text": "def short\n shorten(8)\n end",
"title": ""
},
{
"docid": "be93d13143ee4a291c3529f435d5b149",
"score": "0.5054994",
"text": "def unlines\n join $RS\n end",
"title": ""
},
{
"docid": "743fc664333f249866117c7adb250dde",
"score": "0.504494",
"text": "def wrap(s)\n s.split(\"\\n\").map do |t|\n if t =~ /^[>|]/\n t + \"\\n\"\n else\n t.gsub(/(.{1,74})(\\s+|$)/,\"\\\\1\\n\")\n end\n end.join('')\n end",
"title": ""
},
{
"docid": "759ac118165e258a8f890d14878e8ba2",
"score": "0.5038586",
"text": "def compact_blank!; end",
"title": ""
},
{
"docid": "005f339a16f96667f9a6cfbfe2b4241d",
"score": "0.5037448",
"text": "def prev_line=(_arg0); end",
"title": ""
},
{
"docid": "6a2a85a6b0f6e5af820a6ba4a6806266",
"score": "0.5036343",
"text": "def range_by_lines(range); end",
"title": ""
},
{
"docid": "018d66ba436bd0297597fdd3b6a6eff0",
"score": "0.5033789",
"text": "def convert_blank(*)\n NEWLINE\n end",
"title": ""
},
{
"docid": "20ffeee671135b4ac2b9a4a1b6eae4a7",
"score": "0.50319695",
"text": "def break_down(text,line_width=80,replacement=\"\\n\")\r\n if text =~ /\\s/\r\n return text.gsub(/\\n/, \"\\n\\n\").gsub(/(.{1,#{line_width}})(\\s+|$)/, \"\\\\1\\n\").strip \r\n end\r\n return text if text.size <= line_width \r\n return text.gsub(/\\n/, \"\\n\\n\").gsub(/(.{1,#{line_width}})/, \"\\\\1#{replacement}\").strip\r\n end",
"title": ""
},
{
"docid": "27dd9badd0abe9d59489884d8e612fc8",
"score": "0.50314647",
"text": "def shift_left(line)\n new_line = []\n line.each { |line| new_line << line unless line.zero? }\n new_line << 0 until new_line.size == 4\n new_line\n end",
"title": ""
},
{
"docid": "4eacb69849d43496b9516b5db5eba55a",
"score": "0.5031414",
"text": "def staircase n \n (1..n).each do |line|\n (1..n - line).each { |spaces| print \" \" }\n (1..line).each { |hashtags| print \"#\" }\n puts\n end\n end",
"title": ""
},
{
"docid": "d2ef9e534972c83f76584455f9418772",
"score": "0.50308114",
"text": "def divider_line\n lines - 2\n end",
"title": ""
},
{
"docid": "15d53fdb69f2eb0ea6d6b5f443d38714",
"score": "0.5021912",
"text": "def tidy(data)\n indent = 0\n data.split(/\\n/).map do |line|\n line.gsub!(/^\\s*/, '')\n next if line.empty?\n indent -= 1 if line =~ /^\\s*\\}\\s*$/\n line = (' ' * (indent * 2)) + line\n indent += 1 if line =~ /\\{\\s*$/\n line\n end.compact.join(\"\\n\") + \"\\n\"\n end",
"title": ""
},
{
"docid": "5172a01967bb91ef05195f1973c21c39",
"score": "0.5018777",
"text": "def _reduce_542(val, _values, result)\n _, v1 = val\n\n result = s(:dot2, nil, v1).line v1.line\n\n result\nend",
"title": ""
},
{
"docid": "fa639f9b4c2e187899f5268542667186",
"score": "0.5017445",
"text": "def tr_s(p0, p1) end",
"title": ""
},
{
"docid": "e07cde061089780c9e5480ac09f2e70d",
"score": "0.501427",
"text": "def lines\n 2 * @size + 3\n end",
"title": ""
},
{
"docid": "e246845b1829cdcefba7acc65948cda6",
"score": "0.5013368",
"text": "def lines; end",
"title": ""
},
{
"docid": "e246845b1829cdcefba7acc65948cda6",
"score": "0.5013368",
"text": "def lines; end",
"title": ""
}
] |
3364bbcfe8f3dae5cd5b86ed986c870f
|
Uploads previously generated json file to the PhraseApp branch.
|
[
{
"docid": "f1d571872e490b6f342eb2a30731d929",
"score": "0.64958584",
"text": "def push_keys\n project = WdProject.new\n translations_new_path = project.translations_new_path\n translations_path = project.translations_path\n\n if !File.exist?(translations_new_path) || !File.exist?(translations_path)\n @log.fatal('Couldn\\'t find the files.'.red.bright) && exit(1)\n end\n\n begin\n File.rename(translations_new_path, translations_path)\n rescue => e\n @log.error(\"Error while renaming file #{translations_new_path} to #{translations_path}.\")\n @log.debug(e.inspect)\n exit(1)\n end\n\n upload, err = @phraseapp.upload_create(@phraseapp_id, OpenStruct.new({\n :autotranslate => false,\n :branch => branch_name,\n :file => translations_path,\n :file_encoding => 'UTF-8',\n :file_format => 'simple_json',\n :locale_id => @phraseapp_fallback_locale,\n :tags => @phraseapp_tag,\n :update_descriptions => false,\n :update_translations => true,\n }))\n\n if err.nil?\n @log.info('Success! Uploaded to PhraseApp'.green.bright)\n @log.info(upload.summary)\n else\n @log.error('An error occurred while uploading to PhraseApp.'.red.bright)\n @log.debug(err)\n exit(1)\n end\n end",
"title": ""
}
] |
[
{
"docid": "221cc2d6806946a385516f3f2af0456b",
"score": "0.6214727",
"text": "def upload_project_inspec_json_file(file, current_user)\n project_json = JSON.parse(File.read(file.path))\n upload_project_inspec_json(project_json, current_user)\n end",
"title": ""
},
{
"docid": "ac21ac0f48bd90a9f5be7471a970c6c0",
"score": "0.62127775",
"text": "def upload_json! base_path, scope: false\n s = \"data/outsourcing-paradise-parasite/\"\n s << scope << \"/\" if scope\n s << \"erosion-machine-timeline.json\"\n\n json = File.read(s).gsub(\"HOST_NAME\", fetch(:outsourcing_paradise_host_name)).gsub(/\"EROSION_DELAY\"/, fetch(:outsourcing_paradise_erosion_delay).to_s)\n\n d = \"#{base_path}/data/outsourcing-paradise-parasite/\"\n d << scope << \"/\" if scope\n d << \"erosion-machine-timeline.json\"\n\n upload! StringIO.new(json), d\n\n execute :chmod, '644', d\n end",
"title": ""
},
{
"docid": "fd09ab5e551200549a5036aa9ca3c3ce",
"score": "0.6179751",
"text": "def file_save_as\n filename = select_file('Save as a JSON file')\n store_file(filename)\n end",
"title": ""
},
{
"docid": "7de00e06aaaeefa56994919cb1b14128",
"score": "0.615657",
"text": "def bootstrap\r\n unless File.exist?(json_file)\r\n FileUtils.touch(json_file) \r\n File.open(json_file, 'w') { |f| f.write('{}') }\r\n end\r\n end",
"title": ""
},
{
"docid": "dc76c8b0cc40e148c99bc7b1d84c7a56",
"score": "0.6148036",
"text": "def commit_data\n # JSON.dump is to save the data in json format.\n File.open(@file_path, 'w+') { |f| f.write(JSON.dump(@content)) }\n end",
"title": ""
},
{
"docid": "50ff404393409f92ead7665ae8ce06f6",
"score": "0.6110536",
"text": "def upload(filename, args={})\n args['index'] = @name\n args['name'] = filename\n path = 'data/inputs/oneshot'\n @service.context.post(path, args)\n end",
"title": ""
},
{
"docid": "1d045f3a109671c3043d99f4d169b998",
"score": "0.60977465",
"text": "def create\n File.open(file_path, 'w')\n\n render json: { status: :ok }\n end",
"title": ""
},
{
"docid": "dd67668144a7b6bb6cbd1077ef4c530c",
"score": "0.6082157",
"text": "def add_json(key, filename)\n obj = {content_type: \"application/json\"}\n upload_file(key, filename, obj)\n end",
"title": ""
},
{
"docid": "09877a8f2aac24d5a5254d4b06117cf2",
"score": "0.6064009",
"text": "def bootstrap\n return if File.exist?(json_file)\n FileUtils.touch json_file\n File.open(json_file, 'w') {|f| f.write(to_json) }\n save\n end",
"title": ""
},
{
"docid": "ff40db7fda8a4926f0ae8e6ec657e8b8",
"score": "0.60624576",
"text": "def save\n File.open(json_file, 'w') {|f| f.write(to_json) }\n end",
"title": ""
},
{
"docid": "64f6501d40a28a932367400c4754233b",
"score": "0.60014766",
"text": "def upload\n kdi_upload(@output_dir, \"batch-#{millis}.json\", @kenna_connector_id, @kenna_api_host, @kenna_api_key)\n end",
"title": ""
},
{
"docid": "c733dc84991a481bb5a6de783fed52b5",
"score": "0.5999737",
"text": "def json_generate\n @log.info('Generate new translations json file for PhraseApp upload')\n\n source_keys = TranslationBuilder.get_all_keys\n\n translations_file = File.open(translations_path, 'r:utf-8')\n translations_object = JSON.parse(translations_file.read)\n translations_file.close\n\n key_value_object = {}\n\n source_keys.each do |source_key|\n if translations_object.key?(source_key[0])\n key_value_object[source_key[0]] = translations_object[source_key[0]]\n else\n @log.warn(\"New Key found: #{source_key[0]}\".yellow.bright)\n key_value_object[source_key[0]] = ''\n end\n end\n\n new_file = File.open(translations_new_path, 'w:utf-8')\n new_file.puts JSON.pretty_generate(key_value_object)\n new_file.close\n\n true\n end",
"title": ""
},
{
"docid": "1166986caa7fd37866048ebadac1f842",
"score": "0.5999131",
"text": "def save\n data = json_encode(@data)\n FileUtils.mkdir_p File.dirname(@filename)\n PathUtils.atomic_write(@filename) do |f|\n f.write(data)\n end\n end",
"title": ""
},
{
"docid": "041c1675b36e52dacf0b07540159f134",
"score": "0.5989652",
"text": "def upload\n end",
"title": ""
},
{
"docid": "041c1675b36e52dacf0b07540159f134",
"score": "0.5989652",
"text": "def upload\n end",
"title": ""
},
{
"docid": "e9c06bb6d37237f2d7c2b056f3149b06",
"score": "0.59848475",
"text": "def create_remote_json_file(file_path, json_string: \"[]\")\n github_action(bot_user_client) do |client|\n client.contents(repo_shortform, path: file_path)\n end\n rescue Octokit::NotFound\n bot_user_client.create_contents(\n repo_shortform, file_path, \"Add initial #{file_path}\", json_string\n )\n rescue Octokit::UnprocessableEntity\n # rubocop:disable Metrics/LineLength\n logger.debug(\"The file #{file_path} already exists in remote configuration repo: #{repo_shortform}. Not overwriting the file.\")\n # rubocop:enable Metrics/LineLength\n end",
"title": ""
},
{
"docid": "0aa11f470fb10a429d87729868c5180f",
"score": "0.5971705",
"text": "def save\n raise Error::InvalidBuildType.new(type) unless BUILD_TYPES.include?(type)\n\n file = Tempfile.new(\"build.json\")\n file.write(to_json)\n file.rewind\n\n client.put(\"/api/build\", file,\n \"Content-Type\" => \"application/json\")\n true\n ensure\n if file\n file.close\n file.unlink\n end\n end",
"title": ""
},
{
"docid": "9b8baf0fa1e4c630c105552cb33a00a5",
"score": "0.597117",
"text": "def upload\n Oynx_Back.upload(options, config[\"name\"], File.join(Dir.pwd, config[\"name\"]))\n end",
"title": ""
},
{
"docid": "874d4557740e2457472371f287cc1735",
"score": "0.59619087",
"text": "def save\n File.open(filepath, 'w') do |file|\n file.write to_json + \"\\n\"\n end\n end",
"title": ""
},
{
"docid": "d5c630db81ddfd11d81480b65879ec8f",
"score": "0.5938148",
"text": "def upload\n data = request.body.read\n File.open(\"db/temp.txt\", 'wb') { |file| file.write(data) }\n system(\"sed\", \"-i\", \"1,4d;$d\", \"db/temp.txt\")\n setup_repo\n system(\"mv\", \"db/temp.txt\", $path+\"Data/Original/\")\n\n generate_seed\n\n end",
"title": ""
},
{
"docid": "7af64e7d204c18803512d87dcb801f6b",
"score": "0.58610576",
"text": "def upload(payload)\n Humidifier.config.ensure_upload_configured!(payload)\n filename = \"#{Humidifier.config.s3_prefix}#{payload.identifier}.json\"\n upload_object(payload, filename)\n end",
"title": ""
},
{
"docid": "901d72c99a4243bc817550a0c6db0bde",
"score": "0.5845799",
"text": "def upload_files\n storage = Google::CredentialHelper.new\n .for!(Google::Apis::StorageV1::AUTH_DEVSTORAGE_READ_WRITE)\n .from_service_account_json!(@service_account_json)\n .authorize Google::Apis::StorageV1::StorageService.new\n app_yaml_dir = ::File.expand_path(::File.dirname(@app_yaml))\n\n @version_info['handlers'].each do |handler|\n if handler.key?('static_files')\n file_glob = \"#{app_yaml_dir}/#{handler['upload']}\"\n elsif handler.key?('static_dir')\n # TODO(nelsona): Add support to directories\n raise 'Uploading directories is not supported'\n elsif handler.key?('script')\n script = handler['script']\n file_glob = \"#{app_yaml_dir}/#{::File.basename(script, ::File.extname(script))}.*\"\n else\n raise 'Unknown handler type'\n end\n\n Dir.glob(file_glob).select do |e|\n file_name = Pathname.new(e).relative_path_from Pathname.new(app_yaml_dir)\n file_bucket = \"#{@bucket_path}/#{@version_id}/#{file_name}\"\n STDERR.print \"Uploading file to gs://#{@bucket_name}/#{file_bucket}...\"\n storage.insert_object(\n @bucket_name,\n Google::Apis::StorageV1::Object.new(\n :id => file_bucket\n ),\n :name => file_bucket,\n :upload_source => ::File.open(e)\n )\n @uploaded_files[handler] = {\n :filename => file_name,\n :bucket => file_bucket\n }\n STDERR.puts ' done.'\n end\n end\n end",
"title": ""
},
{
"docid": "0e49e4b24a07743958da39fd79d05f55",
"score": "0.58358276",
"text": "def upload_keys\n filename = \"keys.json\"\n keys_hash = TranslationKey.pluck(:name)\n .compact\n .map { |k| [k,k] }\n .to_h\n @aws_uploader.upload_json(keys_hash, \"keys.json\", public: true)\n end",
"title": ""
},
{
"docid": "7db08e93997ccc72936d6b738074bd05",
"score": "0.58339405",
"text": "def create_remote_json_file(file_path, json_string: \"[]\")\n github_action do\n client.contents(repo_shortform, path: file_path)\n end\n rescue Octokit::NotFound\n client.create_contents(\n repo_shortform, file_path, \"Add initial #{file_path}\", json_string\n )\n rescue Octokit::UnprocessableEntity\n # rubocop:disable Metrics/LineLength\n logger.debug(\"The file #{file_path} already exists in remote configuration repo: #{repo_shortform}. Not overwriting the file.\")\n # rubocop:enable Metrics/LineLength\n end",
"title": ""
},
{
"docid": "6c57f216f83d0562f54ae910779e58ea",
"score": "0.5832708",
"text": "def upload_latest_copy\n upload_to_gcs(report_files, prefix)\n end",
"title": ""
},
{
"docid": "ac8f1f9e8d4b29463dc662838ca8d8c8",
"score": "0.5828511",
"text": "def initial_json\n\t\tsend_file(Rails.root+'public/empty_resume.json', disposition: 'attachment')\n\tend",
"title": ""
},
{
"docid": "6dfbab8c394280b0795f80d60aba7cf4",
"score": "0.582274",
"text": "def upload_po(file)\n upload_file(file, PO_FORMAT)\n end",
"title": ""
},
{
"docid": "631c6efc6aed682449bf6ba41a30b40b",
"score": "0.58164835",
"text": "def upload_create(project_id, params)\n path = sprintf(\"/api/v2/projects/%s/uploads\", project_id)\n data_hash = {}\n post_body = nil\n \n if params.present?\n unless params.kind_of?(PhraseApp::RequestParams::UploadParams)\n raise PhraseApp::ParamsHelpers::ParamsError.new(\"Expects params to be kind_of PhraseApp::RequestParams::UploadParams\")\n end\n end\n if params.autotranslate != nil\n data_hash[\"autotranslate\"] = (params.autotranslate == true)\n end\n\n if params.branch != nil\n data_hash[\"branch\"] = params.branch\n end\n\n if params.convert_emoji != nil\n data_hash[\"convert_emoji\"] = (params.convert_emoji == true)\n end\n\n if params.file != nil\n post_body = []\n post_body << \"--#{PhraseApp::MULTIPART_BOUNDARY}\\r\\n\"\n post_body << \"Content-Disposition: form-data; name=\\\"file\\\"; filename=\\\"#{File.basename(params.file )}\\\"\\r\\n\"\n post_body << \"Content-Type: text/plain\\r\\n\"\n post_body << \"\\r\\n\"\n post_body << File.read(params.file)\n post_body << \"\\r\\n\"\n end\n\n if params.file_encoding != nil\n data_hash[\"file_encoding\"] = params.file_encoding\n end\n\n if params.file_format != nil\n data_hash[\"file_format\"] = params.file_format\n end\n\n if params.format_options != nil\n params.format_options.each do |key, value|\n data_hash[\"format_options\"][key] = value\n end\n end\n\n if params.locale_id != nil\n data_hash[\"locale_id\"] = params.locale_id\n end\n\n if params.locale_mapping != nil\n params.locale_mapping.each do |key, value|\n data_hash[\"locale_mapping\"][key] = value\n end\n end\n\n if params.mark_reviewed != nil\n data_hash[\"mark_reviewed\"] = (params.mark_reviewed == true)\n end\n\n if params.skip_unverification != nil\n data_hash[\"skip_unverification\"] = (params.skip_unverification == true)\n end\n\n if params.skip_upload_tags != nil\n data_hash[\"skip_upload_tags\"] = (params.skip_upload_tags == true)\n end\n\n if params.tags != nil\n data_hash[\"tags\"] = params.tags\n end\n\n if params.update_descriptions != nil\n data_hash[\"update_descriptions\"] = (params.update_descriptions == true)\n end\n\n if params.update_translations != nil\n data_hash[\"update_translations\"] = (params.update_translations == true)\n end\n\n \n \n reqHelper = PhraseApp::ParamsHelpers::BodyTypeHelper.new(data_hash, post_body)\n rc, err = PhraseApp.send_request(@credentials, \"POST\", path, reqHelper.ctype, reqHelper.body, 201)\n if err != nil\n return nil, err\n end\n \n return PhraseApp::ResponseObjects::Upload.new(JSON.load(rc.body)), err\n end",
"title": ""
},
{
"docid": "ec1bffa93fdb3048fb5c29e67a402661",
"score": "0.5813671",
"text": "def save(context, filename, hash)\n www_directory = context.dashboard_config['www-directory']\n\n path=\"#{www_directory}/json-data/#{filename}.json\"\n f = open(path, 'w')\n f.puts(JSON.pretty_generate(hash))\n f.close\nend",
"title": ""
},
{
"docid": "0328821fd1aca9e211ec3994cf139562",
"score": "0.58069444",
"text": "def upload\n run_uploads\n end",
"title": ""
},
{
"docid": "a8522f99b2c3dc9ab8f66686d03674a0",
"score": "0.58023864",
"text": "def store_file(path)\n if path\n data = Editor.model2data(@treeview.model.iter_first)\n File.open(path + '.tmp', 'wb') do |output|\n if @options_menu.pretty_item.active?\n output.puts JSON.pretty_generate(data)\n else\n output.write JSON.unparse(data)\n end\n end\n File.rename path + '.tmp', path\n @filename = path\n toplevel.display_status(\"Saved data to '#@filename'.\")\n unchange\n end\n rescue SystemCallError => e\n Editor.error_dialog(self, \"Failed to store JSON file: #{e}!\")\n end",
"title": ""
},
{
"docid": "c42d424ee1dd0db6a7dfe43ffc732a0c",
"score": "0.57966614",
"text": "def sync!\n # bump the timestamp every time we sync\n @timestamp = Time.now.to_i\n\n File.write(path, JSON.pretty_generate(to_h))\n end",
"title": ""
},
{
"docid": "e4c8f62dea0aae144ce34b968ce6c268",
"score": "0.5792408",
"text": "def upload file_name, text_content\n local_file = Tempfile.new \"language-test-file\"\n File.write local_file.path, text_content\n @bucket.create_file local_file.path, file_name\n @uploaded << file_name\n ensure\n local_file.close\n local_file.unlink\n end",
"title": ""
},
{
"docid": "b3914b449225b1d667c0685fd7582331",
"score": "0.5792133",
"text": "def upload_file\n\tproject = self.use_case.project\n\n\tfile = url_path.read\n whole_name = url_path.original_filename\n final_name = self.name + \".v1.0\" + File.extname(whole_name)\n file_path = project.name + \"/UseCases/\" + self.name + \"/\" + final_name\n dbsession = DropboxSession.deserialize(project.dropbox_token)\n client = DropboxClient.new(dbsession)\n response = client.put_file(file_path, file)\n link = client.shares(response[\"path\"])\n self.url_path = link[\"url\"]\n end",
"title": ""
},
{
"docid": "007fe26de390fc2b4632a3a0a570613d",
"score": "0.57622933",
"text": "def upload\n UploadPopulationJob.perform_now(params[:file])\n redirect_to root_path, notice: \"All World Population data added to database\"\n end",
"title": ""
},
{
"docid": "21f223279a26e8ee910d6fd81240002b",
"score": "0.57415307",
"text": "def upload\n validate_document_provided\n validate_documents_content_type\n validate_documents_page_size\n find_poa_by_id\n check_file_number_exists!\n\n @power_of_attorney.set_file_data!(documents.first, params[:doc_type])\n @power_of_attorney.status = ClaimsApi::PowerOfAttorney::SUBMITTED\n @power_of_attorney.save!\n @power_of_attorney.reload\n\n # If upload is successful, then the PoaUpater job is also called to update the code in BGS.\n ClaimsApi::PoaVBMSUploadJob.perform_async(@power_of_attorney.id)\n\n render json: @power_of_attorney, serializer: ClaimsApi::PowerOfAttorneySerializer\n end",
"title": ""
},
{
"docid": "f344f47203c97ef5e3c13cd90724f012",
"score": "0.5731164",
"text": "def create\n app_update = AppUpdate.new(params[:app_update])\n # uploaded_io = params[:person][:picture]\n # File.open(Rails.root.join('public', 'uploads', uploaded_io.original_filename), 'wb') do |file|\n # file.write(uploaded_io.read)\n # end\n if @app_update.save\n render json: @app_update, status: :created, location: @app_update\n else\n render json: @app_update.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "cb12809dc4fd64a54b76e8f870f6d306",
"score": "0.5724766",
"text": "def upload!(file_path)\n git.upload!(file_path)\n end",
"title": ""
},
{
"docid": "b896b3ae5153e8cfa34a0a08345a3252",
"score": "0.5720319",
"text": "def create_request\n create_file file_json, write_json\n end",
"title": ""
},
{
"docid": "b93679ccf88840074e22b251560f5a7a",
"score": "0.57162917",
"text": "def upload_latest_copy\n raise(\"Not implemented!\")\n end",
"title": ""
},
{
"docid": "e1e887dc76c715be530190e8264a6a14",
"score": "0.57144946",
"text": "def save\n forbidden! unless current_user.manage_files?\n obj = JSON.parse(node.elements.first.content)\n file = Upload.find(obj['id'])\n\n unless file\n send_error('item-not-found')\n return\n end\n\n file.name = obj['name']\n file.labels = obj['labels']\n if file.valid?\n file.save\n send_doc(file)\n else\n send_error('not-acceptable')\n end\n end",
"title": ""
},
{
"docid": "381cdf22f082db41b018f89d6118c078",
"score": "0.57116735",
"text": "def upload_post(params, token, file_url)\n # build the json for NationBuilder\n\n img_chunk = file_url.nil? ? '' : \"File: <img src='#{file_url}'/>\"\n\n post = {\n \"blog_post\" => {\n \"name\" => \"New Letter from #{params[:name]}\",\n \"status\" => \"drafted\",\n \"content_before_flip\" => \"Name: #{params[:name]}, Email: #{params[:email]}, Letter: #{params[:letter]} #{img_chunk}\"\n }\n }\n\n # send it off to nation builder to create the post\n response = token.post('/api/v1/sites/berim/pages/blogs/7/posts',\n :headers => {'Accept' => 'application/json', 'Content-Type' => 'application/json'},\n :body => JSON.dump(post)\n )\n\n unless response.status == 200\n logger.info(\"Blog post failed: #{response.body}\")\n raise 'post failed'\n end\n\nend",
"title": ""
},
{
"docid": "5a03de9526a4aa844f25d49d1ef44249",
"score": "0.5704046",
"text": "def commit\n return if !file_path\n\n clean_nil_and_empties\n\n if empty?\n # Delete the file since an empty data store is not useful\n File.delete(file_path) if File.file?(file_path)\n else\n File.open(file_path, \"w\") { |f| f.write(to_json) }\n end\n end",
"title": ""
},
{
"docid": "7ed4223ac5664ee6ae058a113a2e92d6",
"score": "0.57034165",
"text": "def push(file)\n safe_app_access do\n params = {:file => file}\n patient_client['/api/actions/push.json'].post(*processed_params(params, @token))\n end\n end",
"title": ""
},
{
"docid": "b4e29b86aab12c025028f41a7793e952",
"score": "0.5698787",
"text": "def put\n check_config(require_destination: true)\n cartage.display \"Uploading to #{name}...\"\n put_file cartage.final_release_metadata_json\n cartage.plugins.request_map(:build_package, :package_name).each do |name|\n put_file name\n end\n end",
"title": ""
},
{
"docid": "100b5676e812cf3df2acf1e84dc46aab",
"score": "0.56941336",
"text": "def setup_files\n path = File.join(File.dirname(__FILE__), '../data/products.json')\n file = File.read(path)\n $products_hash = JSON.parse(file)\n $report_file = File.new(\"../report.txt\", \"w+\")\nend",
"title": ""
},
{
"docid": "b80dbffce7b6f39035d40a010a655e87",
"score": "0.569053",
"text": "def insertJsonIntoFile(path, map)\r\n\r\n end",
"title": ""
},
{
"docid": "66dda41f86cea6d55900407c43319837",
"score": "0.5666688",
"text": "def save\n File.open(File.join(@dirname, FILENAME), 'w') do |f|\n f << JSON.pretty_generate(@data)\n end\n end",
"title": ""
},
{
"docid": "66dda41f86cea6d55900407c43319837",
"score": "0.5666688",
"text": "def save\n File.open(File.join(@dirname, FILENAME), 'w') do |f|\n f << JSON.pretty_generate(@data)\n end\n end",
"title": ""
},
{
"docid": "172a6b69585cbc7342bc025845c24620",
"score": "0.5653357",
"text": "def create\n create_or_update_release\n perform_teardown_job\n perform_app_web_hook_job\n\n render json: @release,\n serializer: Api::UploadAppSerializer,\n status: :created\n end",
"title": ""
},
{
"docid": "7f10ef49e480e0673e30a9eccf5b3812",
"score": "0.5645219",
"text": "def setup_files\n path = File.join(File.dirname(__FILE__), '../data/products.json')\n file = File.read(path)\n $products_hash = JSON.parse(file)\n $report_file = File.new(\"../report.txt\", \"w+\")\nend",
"title": ""
},
{
"docid": "4664909763e32df782a08e597b6e73c8",
"score": "0.56435037",
"text": "def create\n @upload.attributes = upload_attributes\n hard_code_file\n @upload.save!\n queue_box_download\n end",
"title": ""
},
{
"docid": "7f0165addd1bc72c15381ba99cdb7963",
"score": "0.5642976",
"text": "def setup_files\n path = File.join(File.dirname(__FILE__), '../data/products.json')\n file = File.read(path)\n $products_hash = JSON.parse(file)\n $report_file = File.new(\"report.txt\", \"w+\")\nend",
"title": ""
},
{
"docid": "7f0165addd1bc72c15381ba99cdb7963",
"score": "0.5642976",
"text": "def setup_files\n path = File.join(File.dirname(__FILE__), '../data/products.json')\n file = File.read(path)\n $products_hash = JSON.parse(file)\n $report_file = File.new(\"report.txt\", \"w+\")\nend",
"title": ""
},
{
"docid": "7f0165addd1bc72c15381ba99cdb7963",
"score": "0.5642976",
"text": "def setup_files\n path = File.join(File.dirname(__FILE__), '../data/products.json')\n file = File.read(path)\n $products_hash = JSON.parse(file)\n $report_file = File.new(\"report.txt\", \"w+\")\nend",
"title": ""
},
{
"docid": "c8a93de49d45d4ee086b45e4adb245df",
"score": "0.56383234",
"text": "def save!\n File.open(@filename, 'w') do |file|\n file.write(self.to_json)\n end\n end",
"title": ""
},
{
"docid": "bc1a2c881733b6255afced46976f2b77",
"score": "0.5637834",
"text": "def save\n overwrite @api.put(\"/projects/#{shortcode_url}.json\", 'name' => name)\n end",
"title": ""
},
{
"docid": "3e01d49823adaa9eb6347d0022030e08",
"score": "0.56341445",
"text": "def upload(filename, args={})\n args['index'] = @name\n args['name'] = filename\n @service.request(:method => :POST,\n :resource => [\"data\", \"inputs\", \"oneshot\"],\n :body => args)\n end",
"title": ""
},
{
"docid": "1850a3a40fb2e2bf521789d5776cb108",
"score": "0.5631217",
"text": "def backup_file(uploaded_file)\n uploaded_file(uploaded_file.to_json) do |file|\n file.data[\"storage\"] = backup_storage.to_s\n end\n end",
"title": ""
},
{
"docid": "67bd7fcbdb75a06111f1dd6711d305e4",
"score": "0.5630849",
"text": "def upload_data(data)\n Medication.validate_json(data)\n reset_interactions(data['drug_interactions'])\n upload_related(data)\n data.delete('drug_interactions')\n data.delete('related_questions')\n data.delete('related_searches')\n document.overwrite(data)\n end",
"title": ""
},
{
"docid": "1f451666a6e49ef7ad0e00830ed2505b",
"score": "0.5623058",
"text": "def put_file(filename)\n content = {\n client_id: @client_id,\n client_secret: @client_secret,\n refresh_token: @refresh_token\n }\n File.open(filename, \"w:utf-8\"){|file| file.write(JSON.generate(result))}\n end",
"title": ""
},
{
"docid": "2d0299d7377e89eead78a9f4f268a3a1",
"score": "0.56177956",
"text": "def save_file\n text = to_json\n Dir.mkdir(SAVE_DIR) unless Dir.exist?(SAVE_DIR)\n create_file(text)\n end",
"title": ""
},
{
"docid": "6aa2909f67c7ce6d8ea39b76384b3011",
"score": "0.5615389",
"text": "def upload\n\n \t@user_id = session[:user_cookie]\n \tif @user_id.nil?\n \t\treturn\n \tend\n \t\n \t@upload_file = params[:resource][:file]\n \t\n\tfile = @upload_file.tempfile\n\tbasename = File.basename(@upload_file.original_filename)\n\ttune_id = params[:resource][:tune][:id]\n \t\n \tcreate_with_attachment(file, basename, tune_id)\n\tparams.has_key?(:redirect) ? (redirect_to params[:redirect]) : (render :json => @resource)\n \t \n end",
"title": ""
},
{
"docid": "357dd0483065734cbbf98ef8b3fe77ea",
"score": "0.5615356",
"text": "def upload(file)\n end",
"title": ""
},
{
"docid": "1ea38ee58fb255651e5781504b0cb8fd",
"score": "0.5614864",
"text": "def store_event_data \n filename = 'public/events.json'\n existing_json = JSON.parse(File.read(filename))\n existing_json << self.event_data\n File.open(filename,\"w\") do |f|\n f.write(JSON.pretty_generate(existing_json))\n end\n end",
"title": ""
},
{
"docid": "92eb78be45a3f8dfc6368db035b20915",
"score": "0.5614173",
"text": "def put_msglog_tbl(json_hash) \n\n File.open(GND_MSGLOG_TBL_DUMP_FILE,\"w\") do |f| \n f.write(JSON.pretty_generate(json_hash))\n f.write(\"\\n\") \n end\n \n if (Osk::system.file_transfer.put(GND_MSGLOG_TBL_DUMP_FILE,FLT_MSGLOG_TBL_DUMP_FILE))\n\n Osk::flight.send_cmd(\"OSK_C_DEMO\", \"LOAD_TBL with ID #{OskCDemo::MSGLOG_TBL_ID}, FILENAME #{FLT_MSGLOG_TBL_DUMP_FILE}\")\n\n end\n \nend",
"title": ""
},
{
"docid": "4115d8e5ac563e9e03077543c388bcf7",
"score": "0.5613468",
"text": "def save_json(filename, body)\n File.open(\"#{filename}.json\", \"w\") do |f|\n f.write(body.force_encoding('utf-8'))\n end\nend",
"title": ""
},
{
"docid": "886ca97aee36ca52a3d40405727574a0",
"score": "0.5608862",
"text": "def setup_files\npath = File.join(File.dirname(__FILE__), '../data/products.json')\nfile = File.read(path)\n# Made products_hash a global variable.\n$products_hash = JSON.parse(file)\n# Made report_file a global variable.\n$report_file = File.new(\"report.txt\", \"w+\")\nend",
"title": ""
},
{
"docid": "e9e06593ea08c1ad8e8f14f699782011",
"score": "0.56040835",
"text": "def uploadJson()\n uploadText = \"[{\\\"id\\\":\\\"sectionList\\\",\\\"parentId\\\":\\\"sectionList\\\",\\\"name\\\":null,\\\"type\\\":\\\"TREE\\\"}]\"\n if (@currentProfile == \"section\")\n uploadText = \"[{\\\"id\\\":\\\"listOfStudents\\\",\\\"parentId\\\":\\\"listOfStudents\\\",\\\"name\\\":null,\\\"type\\\":\\\"PANEL\\\"}]\"\n end\n inputBox = @driver.find_element(:id, \"content_json\")\n inputBox.clear\n inputBox.send_keys(uploadText)\n saveDashboardBuilder()\nend",
"title": ""
},
{
"docid": "b5519d25d25f3333840b22dbb031d44c",
"score": "0.5599482",
"text": "def cp_file\n\n data = request.body.read\n\n name = @user.repos[-1].id.to_s + \"_\" + @user.repos[-1].repo_name\n\n dir = 'HER-data/' + name + \"/Data/Original/\"\n file_count = Dir[File.join(dir, '**', '*')].count {|file| File.file?(file)}\n\n Dir.chdir 'HER-data/'\n\n File.open(\"temp\" + file_count.to_s + \".txt\", 'wb') {|file| file.write(data)}\n system(\"sed\", \"-i\", \"1,4d;$d\", \"temp\" + file_count.to_s + \".txt\")\n system(\"mv\", \"temp\" + file_count.to_s + \".txt\", name + \"/Data/Original/\")\n\n Dir.chdir '../'\n\n respond_to do |format|\n\n msg = {:status => true}\n\n format.json {render :json => msg}\n\n end\n\n end",
"title": ""
},
{
"docid": "83468cca16cc64f48e6e0b858b046a25",
"score": "0.5589635",
"text": "def upload(io, path)\n @client.push_file(io, @name, path)\n end",
"title": ""
},
{
"docid": "8a9d0826aa5b6a3a16849b0de6806b97",
"score": "0.5585453",
"text": "def push\n validate_arguments!\n puts \"This will submit your bot and its data for review.\"\n puts \"Are you happy your bot produces valid data (e.g. with `turbot bots:validate`)? [Y/n]\"\n confirmed = ask\n error(\"Aborting push\") if !confirmed.downcase.empty? && confirmed.downcase != \"y\"\n working_dir = Dir.pwd\n manifest = parsed_manifest(working_dir)\n archive = Tempfile.new(bot)\n archive_path = \"#{archive.path}.zip\"\n create_zip_archive(archive_path, working_dir, manifest['files'] + ['manifest.json'])\n\n response = File.open(archive_path) {|file| api.update_code(bot, file)}\n case response\n when Turbot::API::SuccessResponse\n puts \"Your bot has been pushed to Turbot and will be reviewed for inclusion as soon as we can. THANKYOU!\"\n when Turbot::API::FailureResponse\n error(response.message)\n end\n end",
"title": ""
},
{
"docid": "aa87d77c334df9814dbd3cb56237d986",
"score": "0.5585376",
"text": "def postprocess_jot_update\n # Grab the latest version of this upload, instead of using self.\n upload = Upload.find(self.id)\n\n jot = Jot.where('id = ?', upload.jot_id)\n ap \"okay here is the jot [id=#{upload.jot_id}] we just processed:\"\n ap jot\n ap self\n ap upload\n if !jot.empty?\n jot = jot.first\n\n # Get text from upload using Tesseract OCR\n ocr_response = self.get_text\n #ocr_text = \"\"\n ap \"heres da text:\"\n ap ocr_response\n content = JSON.parse(jot.content)\n content['identified_text'] = ocr_response[:text]\n content['annotations_info'] = ocr_response[:annotations_info]\n ap \"saving identified_text to jot\"\n jot.content = content.to_json\n jot.save\n\n # Do jot.touch just in case jot.save (above) did not have any new information to save,\n # so that live sync still detects the changes and removes the processing image state.\n jot.touch\n\n # Tell the topic and folder that they've been updated, so live sync catches the updated jot \n topic = Topic.find(jot.topic_id)\n folder = Folder.find(jot.folder_id)\n folder.touch\n topic.touch\n end\n end",
"title": ""
},
{
"docid": "b224c27a83ae5d992ee1850d328dc345",
"score": "0.5584505",
"text": "def upload_locale(locale=I18n.default_locale)\n @aws_uploader.upload_json(\n build_translations_hash(locale), # Build a hash of all translations for the locale\n \"#{locale}.json\", # Name the file after the locale\n public: true # Make the file publicly readable\n )\n end",
"title": ""
},
{
"docid": "785b4aac44613d81e1470671f24283d5",
"score": "0.55771273",
"text": "def save\n response = RestClient.post(\"#{@base_path}/applications/#{@app_key}/hes_files\", {:hes_file => {:slug => self.slug, :file_type => self.content_type, :parent_model => @parent_model, :file => @file, :folder_path => @folder_path}})\n\n hes_cloud_file = JSON.parse(response)\n\n @path = hes_cloud_file[\"file\"][\"url\"]\n @path.gsub!('http', 'https') if HesCloudStorage.configuration[:use_ssl]\n @id = hes_cloud_file[\"id\"]\n @content_type = hes_cloud_file[\"content_type\"]\n @slug = hes_cloud_file[\"slug\"]\n @parent_model = hes_cloud_file[\"parent_model\"]\n @folder_path = hes_cloud_file[\"folder_path\"]\n @file = nil\n\n true\n # rescue\n # raise HesCloudFileError.new(\"Saving file to HES Cloud was not successful <#{self.inspect}>\")\n end",
"title": ""
},
{
"docid": "4084a193ce7153e46de0acfdc6ced302",
"score": "0.55693334",
"text": "def setup_files\n\tpath = File.join(File.dirname(__FILE__), '../data/products.json')\n\tfile = File.read(path)\n\t$toys_data = JSON.parse(file)\n\t$report_file = File.new(\"report.txt\", \"w+\")\n\nend",
"title": ""
},
{
"docid": "e93a5a198c65438be5fc716087ca0b5f",
"score": "0.5564604",
"text": "def post_upload(file, token = nil)\n contents = File.binread(file)\n self.post(\"/uploads.json?filename=#{File.basename(file)}#{\"&token=#{token}\" if token}\",\n :body => contents,\n :headers => { 'Content-Type' => 'application/binary' }\n ).parsed_response['upload']\n end",
"title": ""
},
{
"docid": "6412fa98de5415dbfbb9aea1312dc9a8",
"score": "0.5560714",
"text": "def update_data website\n dest = get_dest_path website.preview\n data_dir = File.join(dest, \"_data\")\n FileUtils.mkdir_p(data_dir)\n data_file = File.join(data_dir, \"scribae.json\")\n comps = Component.all\n data = {\n \"components\" => comps\n }\n File.open(data_file,'w') do |f| \n f.write data.to_json\n end\n end",
"title": ""
},
{
"docid": "aa84ccb1081c64e5b2613618a8850e49",
"score": "0.5553304",
"text": "def save\n dir = File.dirname(path)\n FileUtils.mkdir_p(dir)\n File.write(path, JSON.pretty_generate(@data))\n end",
"title": ""
},
{
"docid": "ee1741480d47262b98c49d5b2d5b6411",
"score": "0.5546588",
"text": "def test_Json_to_file\n b = Basquet.new\n b.add( 'Aalistair')\n b.add( 'Alistai')\n FlatFileAdapter.new.push_to_file(JsonProducer.new.to_json(b.gimmeAll))\n end",
"title": ""
},
{
"docid": "321e98305ad61aba797f880481c7cd07",
"score": "0.55446273",
"text": "def publish_file(path)\n git_cmd(\"pull -s recursive -X ours\")\n git_cmd(\"add #{path}\")\n git_cmd(\"commit -m'Marketing updated #{path}'\")\n git_cmd(\"push\")\n end",
"title": ""
},
{
"docid": "edf670efcf3c4a178c0995be90234f1f",
"score": "0.55344534",
"text": "def save(data)\n url = data[:url]\n message = data[:message]\n key = message[:key]\n response = data[:response]\n headers = response.headers\n body = response.body\n @base_dir.mkpath\n body_path(url, key).dirname.mkpath\n body_path(url, key).open(\"wb+\") do |file|\n file.write(body)\n end\n headers_path(url, key).open(\"wb+\") do |file|\n file.write(JSON.generate(headers))\n end\n end",
"title": ""
},
{
"docid": "e6ebbbb5c65c98d48294bc77a87cd442",
"score": "0.55319893",
"text": "def setup_files\n path = File.join(File.dirname(__FILE__), '../data/products.json')\n file = File.read(path)\n \n # Dollar sign marks the variables as global so they can be used elsewhere\n $products_hash = JSON.parse(file)\n $report_file = File.new(\"report.txt\", \"w+\")\nend",
"title": ""
},
{
"docid": "7da1532e48844c985496c51a7a7f7166",
"score": "0.5531232",
"text": "def upload\n sh \"#{@sitecopy} --update #{@site}\"\n end",
"title": ""
},
{
"docid": "a88d09b68043a4ce74d54521406ca8e0",
"score": "0.5529229",
"text": "def push(filename)\n src = resolve_path(filename)\n raise \"File not found\" unless File.exist?(src)\n\n info = storage.info(filename)\n upload = info.nil?\n unless upload\n version = info[:version]\n if modified?(src, info)\n upload = true\n else\n stream.puts \"Already up-to-date\"\n end\n end\n\n if upload\n stream.puts \"Pushing #{filename}...\" unless stream.tty?\n resp = storage.upload(src, filename) do |current_size, total_size|\n Utils.progress(stream, filename, current_size, total_size)\n end\n version = resp[:version]\n end\n\n if vcs?\n # add files to yaml if needed\n files = (config[\"files\"] ||= [])\n\n # find file\n file = files.find { |f| f[\"name\"] == filename }\n unless file\n file = {\"name\" => filename}\n files << file\n end\n\n # update version\n file[\"version\"] = version\n\n File.write(\".trove.yml\", config.to_yaml.sub(/\\A---\\n/, \"\"))\n end\n\n {\n version: version\n }\n end",
"title": ""
},
{
"docid": "0139b1d0474643ca978ed5d74a29b674",
"score": "0.55274624",
"text": "def upload_file\n project = self.task.project\n task = self.task\n\n file = url_path.read\n self.original_name = url_path.original_filename\n self.version = DocumentTask.where(:name => self.name).count + 1\n\n final_name = \"#{self.name}.v#{self.version}#{File.extname(original_name)}\"\n file_path = project.name + \"/\" + task.name + \"/\" + final_name\n dbsession = DropboxSession.deserialize(project.dropbox_token)\n client = DropboxClient.new(dbsession)\n response = client.put_file(file_path, file)\n link = client.shares(response[\"path\"])\n self.url_path = link[\"url\"]\n end",
"title": ""
},
{
"docid": "857a8894dfb21bdc8a4a47578f9219c7",
"score": "0.5522078",
"text": "def upload\n @db=Database.find(params[:database_id])\n @files = params[:files]\n puts \"[Telemetry_Controller]Uploading:\\n\"\n \n @files.each do |file|\n name = file.original_filename\n \n directory = \"#{@db.path}/input\"\n path = File.join(directory, name)\n puts \"file:#{directory}/#{name}\\n\"\n File.open(path, \"wb\") { |f| f.write(file.read) }\n end\n flash[:notice] = \"File uploaded\"\n respond_to do |format|\n format.html {redirect_to files_database_url(@db)}\n format.json { render json: @files }\n end\n end",
"title": ""
},
{
"docid": "2d03c4b7e9aa42edf39cf825b7548fce",
"score": "0.55208784",
"text": "def call\n if dependency_files.any?\n client.upload_files(\n dependency_files, project_slug,\n branch_name, commit_sha\n )\n end\n end",
"title": ""
},
{
"docid": "14df0f37a06d85280b1ca1afa01dbe6a",
"score": "0.5519885",
"text": "def write_file\n return unless @file_data || self.payload\n\n path = \"#{SUBMISSIONS_PATH}/#{exercise.id}\"\n filename = \"#{id}.#{extension}\"\n FileUtils.makedirs(path)\n\n File.open(\"#{path}/#{filename}\", \"wb\") do |file|\n if @file_data\n file.write(@file_data.read)\n else\n file.write(self.payload)\n end\n end\n \n Submission.delay.post_process(self.id) # (run_at: 5.seconds.from_now)\n end",
"title": ""
},
{
"docid": "6311cdbc862610f9392722eab55cd478",
"score": "0.5518755",
"text": "def push_a_doc(file, database_url)\n content = IO.binread(file)\n doc = JSON.parse(content)\n if !doc.has_key? '_id'\n puts \"ERROR: Document #{file} missing '_id'\"\n exit 1\n end\n puts \"Push document : #{file} to #{database_url}/#{doc['_id']}\"\n rev = get_revision(database_url, doc['_id'])\n \n # If got a revision in the db, place in back in the doc so we can update\n if rev\n doc['_rev'] = rev\n content = JSON.generate doc\n end\n curl_put(database_url, doc['_id'], content)\nend",
"title": ""
},
{
"docid": "8b6d381db01bba96bb7ba4a9c6bf9b88",
"score": "0.5511013",
"text": "def upload_on_creation(api_params)\n riak = Nilavu::DB::GSRiak.new(SSH_FILES_BUCKET)\n riak.upload(keypub(api_params), api_params[:ssh_public_key], PRIV_CONTENT_TYPE)\n riak.upload(keypriv(api_params), api_params[:ssh_private_key], PUB_CONTENT_TYPE)\n end",
"title": ""
},
{
"docid": "d9d964bfd5aaf91566a67370963a1b63",
"score": "0.5510845",
"text": "def setup_files\n path = File.join(File.dirname(__FILE__), '../data/products.json')\n file = File.read(path)\n $products_hash = JSON.parse(file)\n \nend",
"title": ""
},
{
"docid": "a7cd06bdb2a537cbdafd5b03f2ba1d99",
"score": "0.55049473",
"text": "def write\n return if PictureTag.config['disable_disk_cache']\n\n FileUtils.mkdir_p(File.join(base_directory, sub_directory))\n\n File.open(filename, 'w+') do |f|\n f.write JSON.generate(data)\n end\n end",
"title": ""
},
{
"docid": "8be4d4cabf120483a4b177f6dde1fab1",
"score": "0.5504131",
"text": "def transfer!\n package.filenames.each do |filename|\n src = File.join(Config.tmp_path, filename)\n dest = File.join(remote_path, filename)\n Logger.info \"Storing '#{ dest }'...\"\n\n parent_id = find_id_from_path(remote_path)\n gdrive_upload(src, parent_id)\n end\n end",
"title": ""
},
{
"docid": "482085fef40f4c217d95167d13a4860f",
"score": "0.5503089",
"text": "def upload\n setup_essential_data params\n \n if @errors.empty?\n versions = @project.versions.select { |v| v.open? and version_is_current_build v }\n \n if versions.empty?\n @errors << \"The project has no open version.\"\n end\n \n if versions.size > 1\n @errors << \"The project must have single version marked for build.\"\n end\n end\n\n if @errors.empty?\n version = versions.first\n end\n \n if params[:file].nil?\n @errors << \"The file to store is not sent.\"\n end\n \n if @errors.empty?\n # Duplicates sanitize_filename in attachment.rb\n original_name = params[:file].original_filename\n original_name = original_name.gsub(/^.*(\\\\|\\/)/, '')\n original_name = original_name.gsub(/[^\\w\\.\\-]/,'_')\n version.attachments.each do |a|\n if a.filename == original_name\n @errors << \"The file already exists.\"\n end\n end\n end\n \n if @errors.empty?\n begin\n # There was a comment that Attachment#create might be moved into the model.\n a = Attachment.create(\n :container => version,\n :file => params[:file],\n :description => \"\", # Description is not shown under Files anyway.\n :author => @user)\n \n if a.new_record?\n @errors << \"File was not saved.\"\n end\n rescue Exception => e\n @errors << \"Cannot store file: #{e.message}.\"\n end\n end\n \n if @errors.empty?\n if Setting.notified_events.include?('file_added')\n Mailer.attachments_added([a]).deliver\n end\n render :json => Response.new(nil)\n else\n render :json => Response.new(@errors.join(\" \"))\n end\n end",
"title": ""
},
{
"docid": "e3b9b2d1e9b77e009f983b04de6bfe7a",
"score": "0.5500398",
"text": "def update_json(file, data)\t\t\t\n\tFile.open(file, 'w+') {|f| f.write(JSON.generate(data)) }\nend",
"title": ""
},
{
"docid": "351c1f4dc9a65d606fac331bbb7dd8b3",
"score": "0.5498025",
"text": "def fetch_json_file\n return if json_spec.present?\n\n FetchJsonFile.enqueue(id)\n end",
"title": ""
},
{
"docid": "4bae625f1960bc2c2f6776685dfe96dd",
"score": "0.54949325",
"text": "def send_to_firecloud(file)\n begin\n Rails.logger.info \"#{Time.zone.now}: Uploading #{file.bucket_location}:#{file.id} to FireCloud workspace: #{self.firecloud_workspace}\"\n file_location = file.local_location.to_s\n # determine if file needs to be compressed\n first_two_bytes = File.open(file_location).read(2)\n gzip_signature = StudyFile::GZIP_MAGIC_NUMBER # per IETF\n file_is_gzipped = (first_two_bytes == gzip_signature)\n opts = {}\n if file_is_gzipped or file.upload_file_name.last(4) == '.bam' or file.upload_file_name.last(5) == '.cram'\n # log that file is already compressed\n Rails.logger.info \"#{Time.zone.now}: #{file.upload_file_name}:#{file.id} is already compressed, direct uploading\"\n else\n Rails.logger.info \"#{Time.zone.now}: Performing gzip on #{file.upload_file_name}:#{file.id}\"\n # Compress all uncompressed files before upload.\n # This saves time on upload and download, and money on egress and storage.\n gzip_filepath = file_location + '.tmp.gz'\n Zlib::GzipWriter.open(gzip_filepath) do |gz|\n File.open(file_location, 'rb').each do |line|\n gz.write line\n end\n gz.close\n end\n File.rename gzip_filepath, file_location\n opts.merge!(content_encoding: 'gzip')\n end\n remote_file = Study.firecloud_client.execute_gcloud_method(:create_workspace_file, 0, self.bucket_id, file.upload.path,\n file.bucket_location, opts)\n # store generation tag to know whether a file has been updated in GCP\n Rails.logger.info \"#{Time.zone.now}: Updating #{file.bucket_location}:#{file.id} with generation tag: #{remote_file.generation} after successful upload\"\n file.update(generation: remote_file.generation)\n Rails.logger.info \"#{Time.zone.now}: Upload of #{file.bucket_location}:#{file.id} complete, scheduling cleanup job\"\n # schedule the upload cleanup job to run in two minutes\n run_at = 2.minutes.from_now\n Delayed::Job.enqueue(UploadCleanupJob.new(file.study, file, 0), run_at: run_at)\n Rails.logger.info \"#{Time.zone.now}: cleanup job for #{file.bucket_location}:#{file.id} scheduled for #{run_at}\"\n rescue => e\n error_context = ErrorTracker.format_extra_context(self, file)\n ErrorTracker.report_exception(e, user, error_context)\n # if upload fails, try again using UploadCleanupJob in 2 minutes\n run_at = 2.minutes.from_now\n Rails.logger.error \"#{Time.zone.now}: unable to upload '#{file.bucket_location}:#{file.id} to FireCloud, will retry at #{run_at}; #{e.message}\"\n Delayed::Job.enqueue(UploadCleanupJob.new(file.study, file, 0), run_at: run_at)\n end\n end",
"title": ""
},
{
"docid": "1e321348f25f791c8e408426bdf695cc",
"score": "0.5485546",
"text": "def upload_file\n render :json => FroalaEditorSDK::File.upload(params, \"public/uploads/\")\n end",
"title": ""
},
{
"docid": "a8d17a3936f4dd8081bb92564f7f4d75",
"score": "0.54844975",
"text": "def push_data()\n\t\tif @api_url[4] != \"s\"\n\t\t\t@app =\"https://\"+@application_name+\".run\"+@api_url[17..@api_url.length]\n\t\telse\n\t\t\t@app=\"https://\"+@application_name+\".run\"+@api_url[18..@api_url.length]\n\t\tend\n\t\tDir.chdir @curl_path\n\t\tput_command = system(\"#{@curl_command} -X PUT #{@app}/foo -d \\\"data=Application is UP and RUNNING successfully.\\\"\")\n\t\tif put_command == true\n\t\t\tputs \"\\nSuccessfully uploaded the data to application\".green\n\t\telse\n\t\t\tabort(\"Error occured while uploading data to application\".red)\n\t\tend\n\tend",
"title": ""
}
] |
f94b7a1cd9003b52b5d3263b01a6ecc2
|
Use callback to share commom setup or constrains between actions.
|
[
{
"docid": "4ff571381734dcf825b05a9f39276d5b",
"score": "0.0",
"text": "def set_contact\n @contact = Contact.find(params[:id])\n end",
"title": ""
}
] |
[
{
"docid": "8315debee821f8bfc9718d31b654d2de",
"score": "0.60119045",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "8315debee821f8bfc9718d31b654d2de",
"score": "0.60119045",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "48804b0fa534b64e7885b90cf11bff31",
"score": "0.6008089",
"text": "def execute_callbacks; end",
"title": ""
},
{
"docid": "432f1678bb85edabcf1f6d7150009703",
"score": "0.5995768",
"text": "def target_callbacks() = commands",
"title": ""
},
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.59387624",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "c6352e6eaf17cda8c9d2763f0fbfd99d",
"score": "0.592457",
"text": "def initial_action=(_arg0); end",
"title": ""
},
{
"docid": "2198a9876a6ec535e7dcf0fd476b092f",
"score": "0.5907441",
"text": "def initial_action; end",
"title": ""
},
{
"docid": "b9b75a9e2eab9d7629c38782c0f3b40b",
"score": "0.58953667",
"text": "def setup_intent; end",
"title": ""
},
{
"docid": "bce3e1d1089bf6d6722900bd3cac0f36",
"score": "0.58840024",
"text": "def callback\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.58740497",
"text": "def on_setup_callbacks; end",
"title": ""
},
{
"docid": "0f0df8828d29d38b86967b897de598ca",
"score": "0.5853362",
"text": "def callback; end",
"title": ""
},
{
"docid": "0f0df8828d29d38b86967b897de598ca",
"score": "0.5853362",
"text": "def callback; end",
"title": ""
},
{
"docid": "0f0df8828d29d38b86967b897de598ca",
"score": "0.5853362",
"text": "def callback; end",
"title": ""
},
{
"docid": "0f0df8828d29d38b86967b897de598ca",
"score": "0.5853362",
"text": "def callback; end",
"title": ""
},
{
"docid": "a5ca4679d7b3eab70d3386a5dbaf27e1",
"score": "0.58500093",
"text": "def perform_setup\n end",
"title": ""
},
{
"docid": "a8d7928b0ddac8f0ac73a8dfba37513a",
"score": "0.58085775",
"text": "def callback_call; end",
"title": ""
},
{
"docid": "2c4e5a90aa8efaaa3ed953818a9b30d2",
"score": "0.5735405",
"text": "def execute(setup)\n @action.call(setup)\n end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5700388",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "2aba2d3187e01346918a6557230603c7",
"score": "0.56599855",
"text": "def ac_action(&blk)\n @action = blk\n end",
"title": ""
},
{
"docid": "faddd70d9fef5c9cd1f0d4e673e408b9",
"score": "0.5639677",
"text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"title": ""
},
{
"docid": "352de4abc4d2d9a1df203735ef5f0b86",
"score": "0.55972016",
"text": "def required_action\n # TODO: implement\n end",
"title": ""
},
{
"docid": "7bbfb366d2ee170c855b1d0141bfc2a3",
"score": "0.55903995",
"text": "def proceed_with(action, *arguments)\n self.class.decouplings.each do |decoupler|\n decoupler.run_on(self, action, *arguments)\n end\n end",
"title": ""
},
{
"docid": "e3aadf41537d03bd18cf63a3653e05aa",
"score": "0.55490214",
"text": "def before(action)\n invoke_callbacks *options_for(action).before\n end",
"title": ""
},
{
"docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40",
"score": "0.5535419",
"text": "def on_setup(&block); end",
"title": ""
},
{
"docid": "9cdd954c18453e4467d55d0f52bff7eb",
"score": "0.5531869",
"text": "def before_callback_phase=(_arg0); end",
"title": ""
},
{
"docid": "a38c0228309c9e5d1a9952d6eaa29947",
"score": "0.54997367",
"text": "def nuix_worker_item_callback_init\n\t# Perform some setup here\nend",
"title": ""
},
{
"docid": "468d85305e6de5748477545f889925a7",
"score": "0.54818434",
"text": "def inner_action; end",
"title": ""
},
{
"docid": "471d64903a08e207b57689c9fbae0cf9",
"score": "0.5481683",
"text": "def setup_controllers &proc\n @global_setup = proc\n self\n end",
"title": ""
},
{
"docid": "f099a8475f369ce73a38d665b6ee6877",
"score": "0.5470027",
"text": "def action_run\n end",
"title": ""
},
{
"docid": "3bc1bc202eedfce238ce1c6ecef0e438",
"score": "0.5439932",
"text": "def initialize(*args)\n super\n @action = :sync\nend",
"title": ""
},
{
"docid": "3c104cc54a7dcae34abb6f11274af2c5",
"score": "0.5429106",
"text": "def action(name, callback)\n @callbacks[name] = callback\n end",
"title": ""
},
{
"docid": "6350959a62aa797b89a21eacb3200e75",
"score": "0.54258376",
"text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"title": ""
},
{
"docid": "ec7554018a9b404d942fc0a910ed95d9",
"score": "0.54212785",
"text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end",
"title": ""
},
{
"docid": "35b302dd857a031b95bc0072e3daa707",
"score": "0.54202265",
"text": "def config(action, *args); end",
"title": ""
},
{
"docid": "1423d9efd05fb18fa8b93617a1e7a68c",
"score": "0.5418333",
"text": "def do_action(action)\n case action\n when \"a\"\n @user_manager.user_prompt\n when \"b\"\n @group_manager.group_prompt\n when \"c\"\n system(\"clear\")\n @user_setup.rockandroll!\n when \"quit\", \"exit\"\n bail\n end\n end",
"title": ""
},
{
"docid": "9efbca664902d80a451ef6cff0334fe2",
"score": "0.54081404",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "9efbca664902d80a451ef6cff0334fe2",
"score": "0.54081404",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "3273468e6bf9f0de0c5a65494fade2b2",
"score": "0.5400413",
"text": "def inner_action=(_arg0); end",
"title": ""
},
{
"docid": "9d8dd9837975c444037a2db2c03c602c",
"score": "0.5399618",
"text": "def postprocess(_action)\n end",
"title": ""
},
{
"docid": "691d5a5bcefbef8c08db61094691627c",
"score": "0.5396234",
"text": "def performed(action)\n end",
"title": ""
},
{
"docid": "358a5635e0b13db625e5124f3554ff97",
"score": "0.53949934",
"text": "def defer_action(&action_proc)\n @deferred_actions.push action_proc\n end",
"title": ""
},
{
"docid": "ad33138fb4bd42d9785a8f84821bfd88",
"score": "0.538202",
"text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"title": ""
},
{
"docid": "ad33138fb4bd42d9785a8f84821bfd88",
"score": "0.538202",
"text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"title": ""
},
{
"docid": "22cc0a7588f5ba35a994970ff3aebee0",
"score": "0.5376565",
"text": "def chooseCallback(&callback)\n @chooseCallback = callback\n end",
"title": ""
},
{
"docid": "c85b0efcd2c46a181a229078d8efb4de",
"score": "0.5352978",
"text": "def custom_setup\n\n end",
"title": ""
},
{
"docid": "8df641198c34b17c9aef0b7847f4bc9c",
"score": "0.5352694",
"text": "def init(action, &b)\n define_action(:init, action, &b)\n end",
"title": ""
},
{
"docid": "2be1642826ddbc94388b07ecb760f866",
"score": "0.53413045",
"text": "def initialize( *args )\n super\n @action = :cask\nend",
"title": ""
},
{
"docid": "2be1642826ddbc94388b07ecb760f866",
"score": "0.53413045",
"text": "def initialize( *args )\n super\n @action = :cask\nend",
"title": ""
},
{
"docid": "459a4eaabe5a69f2430bff0705ade303",
"score": "0.5333816",
"text": "def process_hook\n\n puts \"Here =========\"\n r = fetch_client\n return r unless r.success?\n\n r = check_first_time_stake_and_mint\n return r unless r.success?\n\n fetch_property_to_set\n\n r = set_unset_client_properties\n return r unless r.success?\n\n r = update_mile_stone_attributes_for_admins\n return r unless r.success?\n\n notify_devs\n\n success\n end",
"title": ""
},
{
"docid": "5aab98e3f069a87e5ebe77b170eab5b9",
"score": "0.532495",
"text": "def api_action!(*args)\n type = self.class.name.split(\"::\").last.downcase\n run_callbacks_for([\"before_#{type}\", :before], *args)\n result = nil\n begin\n result = yield if block_given?\n run_callbacks_for([\"after_#{type}\", :after], *args)\n result\n rescue => err\n run_callbacks_for([\"failed_#{type}\", :failed], *(args + [err]))\n raise\n end\n end",
"title": ""
},
{
"docid": "916d3c71d3a5db831a5910448835ad82",
"score": "0.5324154",
"text": "def do_action(action)\n case action\n when \"a\"\n @user_manager.create_user\n when \"b\"\n @user_manager.delete_user\n when \"c\"\n @user_manager.get_info\n when \"d\"\n @user_manager.list_all_users\n when \"quit\", \"exit\"\n bail\n end\n end",
"title": ""
},
{
"docid": "85a1fd085134b703d4625d4239236ef6",
"score": "0.5310698",
"text": "def callback_for(action, *args, &block)\n instance_variable_set \"@on_#{action}\", [block, args]\n nil\n end",
"title": ""
},
{
"docid": "9a57deebb94c12cd83a1f395b2edc5ac",
"score": "0.53091",
"text": "def init_action(action_name)\n lambda do |args, options|\n require_environment(options)\n require_geo_files(args)\n throw \"Environment not set\" unless @environment\n\n @environment.execute_lifecycle(:before, action_name.to_sym)\n errs = @environment.errors.flatten.sort\n unless errs.empty?\n print_validation_errors(errs)\n exit 1\n end\n\n yield args, options\n @environment.execute_lifecycle(:after, action_name.to_sym)\n end\n end",
"title": ""
},
{
"docid": "cc260ecb13748eb2fe4e508ebc4a72a7",
"score": "0.5304998",
"text": "def prepareExecution\n # Bypass SlaveClient (executeMarshalled)\n WEACE::Test::Common::changeMethod(\n WEACE::Slave::Client,\n :executeActions,\n :executeActions_Regression\n ) do\n yield\n end\n end",
"title": ""
},
{
"docid": "922cf64abae9ce1f9bef3860022cc068",
"score": "0.529892",
"text": "def manage_state name, options = {}, &block\n @actions = {}\n @events = {}\n @managed_state = ::Collins::SimpleCallback.new(name, options, block)\n end",
"title": ""
},
{
"docid": "6bd37bc223849096c6ea81aeb34c207e",
"score": "0.5298311",
"text": "def post_setup\n end",
"title": ""
},
{
"docid": "b5351c38e386fd3436705a71710b59f1",
"score": "0.5291234",
"text": "def execute(&block)\n use_callback(&block) if block_given?\n action = @prep.execute(@handler)\n return action\n end",
"title": ""
},
{
"docid": "0d1c87e5cf08313c959963934383f5ae",
"score": "0.5289767",
"text": "def on_action(action)\n @action = action\n self\n end",
"title": ""
},
{
"docid": "39c39d6fe940796aadbeaef0ce1c360b",
"score": "0.5283929",
"text": "def setup_phase; end",
"title": ""
},
{
"docid": "00d799cf01f6c2723d29f648e1d5e231",
"score": "0.5283485",
"text": "def setup_convergence(action_handler)\n raise \"setup_convergence not overridden on #{self.class}\"\n end",
"title": ""
},
{
"docid": "311e95e92009c313c8afd74317018994",
"score": "0.526674",
"text": "def setup_actions\n domain = @apps.domain\n path_user = '/a/feeds/'+domain+'/user/2.0'\n path_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n path_email_list = '/a/feeds/'+domain+'/emailList/2.0'\n path_group = '/a/feeds/group/2.0/'+domain\n\n @apps.register_action(:domain_login, {:method => 'POST', :path => '/accounts/ClientLogin' })\n @apps.register_action(:user_create, { :method => 'POST', :path => path_user })\n @apps.register_action(:user_retrieve, { :method => 'GET', :path => path_user+'/' })\n @apps.register_action(:user_retrieve_all, { :method => 'GET', :path => path_user })\n @apps.register_action(:user_update, { :method => 'PUT', :path => path_user +'/' })\n @apps.register_action(:user_delete, { :method => 'DELETE', :path => path_user +'/' })\n @apps.register_action(:nickname_create, { :method => 'POST', :path =>path_nickname })\n @apps.register_action(:nickname_retrieve, { :method => 'GET', :path =>path_nickname+'/' })\n @apps.register_action(:nickname_retrieve_all_for_user, { :method => 'GET', :path =>path_nickname+'?username=' })\n @apps.register_action(:nickname_retrieve_all_in_domain, { :method => 'GET', :path =>path_nickname })\n @apps.register_action(:nickname_delete, { :method => 'DELETE', :path =>path_nickname+'/' })\n @apps.register_action(:group_create, { :method => 'POST', :path => path_group })\n @apps.register_action(:group_update, { :method => 'PUT', :path => path_group })\n @apps.register_action(:group_retrieve, { :method => 'GET', :path => path_group })\n @apps.register_action(:group_delete, { :method => 'DELETE', :path => path_group })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>'' })\n end",
"title": ""
},
{
"docid": "aecd05ed33ed643cbefae1736c416c0b",
"score": "0.52652484",
"text": "def initialize(*args)\n super\n @action = :execute\nend",
"title": ""
},
{
"docid": "aecd05ed33ed643cbefae1736c416c0b",
"score": "0.52652484",
"text": "def initialize(*args)\n super\n @action = :execute\nend",
"title": ""
},
{
"docid": "1d375c9be726f822b2eb9e2a652f91f6",
"score": "0.5252903",
"text": "def before *actions, &proc\n actions = ['*'] if actions.size == 0\n actions.each { |a| @callbacks[:a][a] = proc }\n end",
"title": ""
},
{
"docid": "9358208395c0869021020ae39071eccd",
"score": "0.5248283",
"text": "def post_setup; end",
"title": ""
},
{
"docid": "4fc2facd3f9b9799893fc8b3eb7f369f",
"score": "0.5239494",
"text": "def apply(callback_sequence); end",
"title": ""
},
{
"docid": "abf5931efddcaaf4864da821a1ee0369",
"score": "0.52240676",
"text": "def set_async_action(action, params)\n async_proc = proc do \n action.new(*params)\n \n # load all the required entities\n self.fetch_entities_to_load()\n\n # save changes\n self.save_changes\n end\n \n @async_actions << async_proc\n end",
"title": ""
},
{
"docid": "bb445e7cc46faa4197184b08218d1c6d",
"score": "0.521759",
"text": "def pre_action\n # Override this if necessary.\n end",
"title": ""
},
{
"docid": "840fd79b3cac2338cc9dc6c7456d32ea",
"score": "0.5213271",
"text": "def callback_phase #(*args)\n # This technique copied from OmniAuth::Strategy (this is how they do it for the other omniauth objects).\n env['omniauth.authorize_params'] = session.delete('omniauth.authorize_params')\n \n # This is trying to help move additiona_data definition away from user-action.\n self.class.define_additional_data(options.additional_data)\n \n result = super\n end",
"title": ""
},
{
"docid": "162e62ec00347eda7db3d9a7e76231c9",
"score": "0.52103716",
"text": "def add_callback(action, callable)\n\t\t@callbacks[action] = callable\n\tend",
"title": ""
},
{
"docid": "2159f600cf77fa035934080ff2974b08",
"score": "0.52041197",
"text": "def sync(action, data)\n packet = Replicator.packet.new(action: action, state: data)\n\n run_callbacks :before_produce, packet\n\n data = schema.preparator_proc.call(data) if schema.preparator_proc.present?\n\n run_around_callbacks :around_produce, packet do\n schema.adapter_proc.call(action, data)\n end\n\n run_callbacks :after_produce, packet\n end",
"title": ""
},
{
"docid": "d56f4ec734e3f3bc1ad913b36ff86130",
"score": "0.5199701",
"text": "def create_setup\n \n end",
"title": ""
},
{
"docid": "887a8d01bfc8418f8489d48a07ff039d",
"score": "0.5196792",
"text": "def global_callbacks=(_arg0); end",
"title": ""
},
{
"docid": "887a8d01bfc8418f8489d48a07ff039d",
"score": "0.5196792",
"text": "def global_callbacks=(_arg0); end",
"title": ""
},
{
"docid": "f1a661fa1e984aca6901153085823ca7",
"score": "0.51943004",
"text": "def call\n @actions.next.call\n end",
"title": ""
},
{
"docid": "80834fa3e08bdd7312fbc13c80f89d43",
"score": "0.51890755",
"text": "def callback_phase\n super\n end",
"title": ""
},
{
"docid": "80834fa3e08bdd7312fbc13c80f89d43",
"score": "0.51890755",
"text": "def callback_phase\n super\n end",
"title": ""
},
{
"docid": "61fb486e47690f37839c73b4f129fa66",
"score": "0.5186073",
"text": "def action=(_arg0); end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5180467",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5180467",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5180467",
"text": "def actions; end",
"title": ""
},
{
"docid": "761b99fb9be16eaf104cbdb122108f06",
"score": "0.51660705",
"text": "def sync_action!\n @dynflow_sync_action = true\n end",
"title": ""
},
{
"docid": "32b1de6dac63383688966c6e4a3d5d6b",
"score": "0.5140132",
"text": "def before_prefabrication(&blk)\n before_prefabrication_hook.add_callback(&blk)\n end",
"title": ""
},
{
"docid": "32b1de6dac63383688966c6e4a3d5d6b",
"score": "0.5140132",
"text": "def before_prefabrication(&blk)\n before_prefabrication_hook.add_callback(&blk)\n end",
"title": ""
},
{
"docid": "930a930e57ae15f432a627a277647f2e",
"score": "0.51372886",
"text": "def setup_actions\n domain = @apps.domain\n path_base = '/a/feeds/emailsettings/2.0/'+domain+'/'\n\n @apps.register_action(:create_label, {:method => 'POST', :path => path_base })\n @apps.register_action(:create_filter, { :method => 'POST', :path => path_base })\n @apps.register_action(:create_send_as, { :method => 'POST', :path => path_base })\n @apps.register_action(:update_webclip, { :method => 'PUT', :path => path_base })\n @apps.register_action(:update_forward, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_pop, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_imap, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_vacation, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_signature, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_language, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_general, { :method => 'PUT', :path =>path_base })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>nil })\n end",
"title": ""
},
{
"docid": "75ffb6cfe871cebe3f2d18db57414a4d",
"score": "0.5136155",
"text": "def define_action(symbol_call, threshold, &proc)\n raise AlreadyDefinedAction, \"Action #{symbol_call.inspect} is already defined.\" if @actions.member? symbol_call\n raise NoProcedureGiven, \"No block given to execute.\" unless block_given?\n \n @actions[symbol_call] = { :state => :none, :method => proc, :iterator => 1, :threshold => threshold }\n end",
"title": ""
},
{
"docid": "dd69e14c6d069fa84dee1beb5005234b",
"score": "0.51347315",
"text": "def init_action\n # 0->nothing to do\n # 1->create child claim\n # 2->create child claim & activate not-billable subscriber\n # 3->do no create child claim & activate not-billable subscriber\n # 4->??\n self.action = 0 if action.blank?\n true\n end",
"title": ""
},
{
"docid": "100180fa74cf156333d506496717f587",
"score": "0.51310706",
"text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend",
"title": ""
},
{
"docid": "d96bfd67c9f23b7624ce79d10b385356",
"score": "0.5128156",
"text": "def send_action(*_arg0); end",
"title": ""
},
{
"docid": "715f9bb842d05c17458a7f12b4f27ab3",
"score": "0.51262975",
"text": "def act_upon\n self\n end",
"title": ""
},
{
"docid": "a5d191b8b3c89e53008e599c325ab6e1",
"score": "0.5125483",
"text": "def execute_action\n execute_action_gen(nil)\n end",
"title": ""
},
{
"docid": "6e6099034d5b76774afe550b2b887cd1",
"score": "0.51227057",
"text": "def create_action\n\tend",
"title": ""
},
{
"docid": "340ae187763e8cd752bda82d9c6873f3",
"score": "0.5117916",
"text": "def setup\n @setup_called = true\n end",
"title": ""
},
{
"docid": "a4cab9c831df8ce598bc65a928091b86",
"score": "0.511516",
"text": "def mco_action\n raise RuntimeError, \"Not implemented\"\n end",
"title": ""
},
{
"docid": "f1da8d654daa2cd41cb51abc7ee7898f",
"score": "0.51140773",
"text": "def advice\n end",
"title": ""
},
{
"docid": "e58ff0109b3799a1e2d8bfea2c00377b",
"score": "0.5112321",
"text": "def activate(prompt, callback)\n @callback = callback\n @prompt = prompt\n super()\n end",
"title": ""
},
{
"docid": "342cff274ce1d029d31764d2283c0142",
"score": "0.51118445",
"text": "def execute_state_callbacks(state); end",
"title": ""
},
{
"docid": "014e4ddbc6a4957749be5612fe1daa84",
"score": "0.5110718",
"text": "def callback &block\n super\n end",
"title": ""
},
{
"docid": "014e4ddbc6a4957749be5612fe1daa84",
"score": "0.5110718",
"text": "def callback &block\n super\n end",
"title": ""
},
{
"docid": "118932433a8cfef23bb8a921745d6d37",
"score": "0.5108856",
"text": "def register_action(action); end",
"title": ""
},
{
"docid": "53bea26a6379c1e39bb77c0bd4adbede",
"score": "0.51071924",
"text": "def perform_callback(the_callback)\n self.send(the_callback) if self.respond_to?(the_callback)\n end",
"title": ""
}
] |
3b7c44a68f3a823619e0dd42579770f6
|
Get a reference to an operand by index.
|
[
{
"docid": "264e82534aa86fce9f16e20a641b2ef7",
"score": "0.5878733",
"text": "def [](i)\n ptr = C.LLVMGetOperand(@user, i)\n Value.from_ptr(ptr) unless ptr.null?\n end",
"title": ""
}
] |
[
{
"docid": "8b25ecd4b8966a91851b74d7e17b4a2c",
"score": "0.7836767",
"text": "def operand(index = 0)\n operands[index]\n end",
"title": ""
},
{
"docid": "24693211d2637efea41c613a3628d063",
"score": "0.6604929",
"text": "def []( index )\n reg = to_reg()\n reg[index]\n end",
"title": ""
},
{
"docid": "7923891e03e855f64a9cabdb8dab33dc",
"score": "0.63168275",
"text": "def get_operand(memory)\n op = @operands.pop\n if op.is_a?(Memory::Value) || op.is_a?(VarAccess)\n op\n elsif op.is_a? Memory::Entry\n VarAccess.new addr: op.addr, is_temp: op.is_temp\n else\n entry = memory.get op[:name]\n VarAccess.new addr: entry.addr, index: op[:index]\n end\n end",
"title": ""
},
{
"docid": "291d329d990b2f94002af69e155dc687",
"score": "0.6255174",
"text": "def [](index)\n lookup(index.to_sym)\n end",
"title": ""
},
{
"docid": "d5238b018bc8701ee4c7c4c9709c6b03",
"score": "0.61071724",
"text": "def [](index)\n cast get(index)\n end",
"title": ""
},
{
"docid": "93cff651b8bbfff01ae2bf33554c69a2",
"score": "0.60532224",
"text": "def [](index)\n return get(index)\n end",
"title": ""
},
{
"docid": "a27d56617971d3ae7377970fc1071eec",
"score": "0.6034854",
"text": "def operand(n) # rubocop:disable Naming/MethodParameterName\n @operands[n]\n end",
"title": ""
},
{
"docid": "eed9bb53b791a57fa1addde978a4fadc",
"score": "0.5938955",
"text": "def get_index(index)\n return self.at(index)\n end",
"title": ""
},
{
"docid": "4628c15f19907f69cf985d9211b1e6fd",
"score": "0.5895853",
"text": "def at(index)\n self[index]\n end",
"title": ""
},
{
"docid": "c1e91ede8ea8a7f194faeb34afeb684c",
"score": "0.58911055",
"text": "def get(index)\n raise \"Only positive indexes, #{index}\" if index <= 0\n if index > self.get_length\n return nil\n else\n return internal_object_get(index + 1)\n end\n end",
"title": ""
},
{
"docid": "2b97c7883277b226268572aeacb9f314",
"score": "0.5885112",
"text": "def get(index = nil)\n @local_index.get(index)\n end",
"title": ""
},
{
"docid": "44bb9f78b8c11c8568ead3bfbe01a23d",
"score": "0.58753026",
"text": "def operand\n operands.first\n end",
"title": ""
},
{
"docid": "a4c8d39dcceb774b8e943305fc392cff",
"score": "0.58628154",
"text": "def [](index) # i.e. array style index lookup.\n end",
"title": ""
},
{
"docid": "2e18386915180ad005936e03a346a8d4",
"score": "0.58412",
"text": "def [](index)\n get(index)\n end",
"title": ""
},
{
"docid": "7fdcf96ff23edc724f28cb55ca6578de",
"score": "0.5773756",
"text": "def compile_index(scope, arr, index)\n source = compile_eval_arg(scope, arr)\n reg = nil #This is needed to retain |reg|\n @e.with_register do |reg|\n @e.movl(source, reg)\n source = compile_eval_arg(scope, index)\n @e.save_result(source)\n @e.sall(2, @e.result_value)\n @e.addl(@e.result_value, reg)\n end\n return [:indirect, reg]\n end",
"title": ""
},
{
"docid": "ad404e7e6caa303151c9f29255fcd019",
"score": "0.57252926",
"text": "def [](index)\n self.__getitem__ index\n end",
"title": ""
},
{
"docid": "a18f8e320307a766f15a912b46330dd4",
"score": "0.57211167",
"text": "def get(index)\n current = get_next\n index.times { current = get_next(current) }\n current\n end",
"title": ""
},
{
"docid": "46c22c2ff84119a45ca7a46e39e0cc2d",
"score": "0.56863797",
"text": "def nth_ref(n)\n if lm = last_match()\n return lm[n]\n end\n\n return nil\n end",
"title": ""
},
{
"docid": "58549e0c5cf76e5d42d5374667c75096",
"score": "0.56829774",
"text": "def query(key, index = 0)\n # Ensure the requested index actually exists\n key = key.to_sym\n return nil if !@node.respond_to?(key)\n ret = @node.send(key)\n\n # Return the queried value\n return ret[index] if ret.is_a?(Array)\n return nil if index != 0\n return ret\n end",
"title": ""
},
{
"docid": "b529ded9201bf105dbafac91a743970c",
"score": "0.56774336",
"text": "def [](loc, idx)\n return loc if immediate?(idx)\n\n sequence[loc]\n end",
"title": ""
},
{
"docid": "728f31a630b956de9b7e28f05a22e81f",
"score": "0.56644326",
"text": "def compile_index(scope, arr, index)\n source = compile_eval_arg(scope, arr)\n r = @e.with_register do |reg|\n @e.movl(source, reg)\n @e.pushl(reg)\n \n source = compile_eval_arg(scope, index)\n @e.save_result(source)\n @e.sall(2, @e.result_value)\n @e.popl(reg)\n @e.addl(@e.result_value, reg)\n end\n return [:indirect, r]\n end",
"title": ""
},
{
"docid": "36983a898298eca4097b1c22aefccf50",
"score": "0.5664364",
"text": "def nth_ref(n)\n if lm = @last_match\n return lm[n]\n end\n\n return nil\n end",
"title": ""
},
{
"docid": "8dc4f3d9273165269bbe82c8ff51131c",
"score": "0.5659053",
"text": "def [](index)\n @index[index]\n end",
"title": ""
},
{
"docid": "26c1daedc493d610d43ad76bcc044c13",
"score": "0.56479967",
"text": "def get(index) \n assert_in_range index\n node, previous = get_node(index)\n node.value\n end",
"title": ""
},
{
"docid": "a153a115c918a7e92b1d3d6479a78458",
"score": "0.56262004",
"text": "def [](*index)\n\n if (index.size != 0)\n @local_index[*index]\n elsif (@local_iterator)\n @local_iterator.get_current\n else\n raise \"No iterator defined! Cannot get element\"\n end\n\n end",
"title": ""
},
{
"docid": "e4acd7d775323e97e674f75ae9d30c3e",
"score": "0.56102467",
"text": "def at_index(index)\n find_by_index(index)\n current\n end",
"title": ""
},
{
"docid": "27cc4b783408ac500385d7f9c853599e",
"score": "0.558482",
"text": "def get(index)\n args[index]\n end",
"title": ""
},
{
"docid": "0cf66791ad2f257a30109bdb18c6b9df",
"score": "0.5573259",
"text": "def [](index)\n ret = get_node_at_index(index)\n return ret.value if ret != nil\n return ret\n end",
"title": ""
},
{
"docid": "1e31c6eafa2c7f05fb488f6b970b879e",
"score": "0.557026",
"text": "def [](index)\n raise AccessorError unless index.is_a? String or index.is_a? Symbol\n @@commands[index.to_sym]\n end",
"title": ""
},
{
"docid": "7b8b75006fa6eb264c8fe57b7aaf6efe",
"score": "0.55607307",
"text": "def [](idx)\n send(idx)\n end",
"title": ""
},
{
"docid": "eb4336ff63241f05e3a5c93f45cbd45f",
"score": "0.55570555",
"text": "def get_gt(index)\n if index == 0\n ref()\n else\n alt[index-1]\n end\n end",
"title": ""
},
{
"docid": "1418dec21e1a625926a163a9de2bef33",
"score": "0.5518988",
"text": "def [](name)\n @index[name]\n end",
"title": ""
},
{
"docid": "a488c61d62270b45b5065c39d55753f7",
"score": "0.5507039",
"text": "def aget(index)\n end",
"title": ""
},
{
"docid": "161115b908fd44f667997c18af0956c9",
"score": "0.54954106",
"text": "def [](index)\n get_subcomposite(index)\n end",
"title": ""
},
{
"docid": "5a15a31bd796292baf6629ed5b41fa29",
"score": "0.5491482",
"text": "def [](index)\n @val[index]\n end",
"title": ""
},
{
"docid": "653ba1fed422e02996aead041614ba11",
"score": "0.5488595",
"text": "def at(idx)\n Ruby.primitive :array_aref\n end",
"title": ""
},
{
"docid": "a1421afd238969a7fbae8edf78194542",
"score": "0.54647416",
"text": "def [](*index)\n if index[0].kind_of?(Array)\n index = index[0]\n end\n return @delegate[index]\n end",
"title": ""
},
{
"docid": "7378f0a313bdaf1dd3d4d997fe766324",
"score": "0.5463066",
"text": "def [](idx)\n return unless addresses[idx]\n\n to_a[idx]\n end",
"title": ""
},
{
"docid": "6a52b2b3beb4bca350210a05eb49aa7f",
"score": "0.5450844",
"text": "def dig(idx,*args)\n n = self[idx]\n if args.size > 0\n n&.dig(*args)\n else\n n\n end\n end",
"title": ""
},
{
"docid": "717e7ef5150913e13062c2750a7d12ab",
"score": "0.54396147",
"text": "def op_fetch(which)\n (operands.detect {|op| op.is_a?(Array) && op[0] == which} || [])[1]\n end",
"title": ""
},
{
"docid": "3a2c9d881d76654e32f07c6a799be4c2",
"score": "0.5434601",
"text": "def retrieve_element_from_index(array, index_number)\n array[index_number]\nend",
"title": ""
},
{
"docid": "3a2c9d881d76654e32f07c6a799be4c2",
"score": "0.5434601",
"text": "def retrieve_element_from_index(array, index_number)\n array[index_number]\nend",
"title": ""
},
{
"docid": "8ff383df5919fa13e0253393cf6206b5",
"score": "0.54224575",
"text": "def [](index)\n i = 0\n each { |x| return x if i == index; i += 1 }\n nil # out of index\n end",
"title": ""
},
{
"docid": "5c0513dd51b351f3d72457c6e0fe2a7e",
"score": "0.541694",
"text": "def [](index)\n raise TypeError unless index.kind_of? Numeric\n raise IndexError if index >= @queries.length\n @queries[index]\n end",
"title": ""
},
{
"docid": "93c1bc9dbcf45136a159f3af3db9b891",
"score": "0.5406289",
"text": "def [](key)\n res = @index[key]\n res\n end",
"title": ""
},
{
"docid": "7fc6f462bca11f1f970df9f0375d9b77",
"score": "0.540508",
"text": "def get_at_index(index)\n raise NotImplementedError, \"Please implement get_at_index\"\n end",
"title": ""
},
{
"docid": "7268492522b58f3654f2a1eb14b828e6",
"score": "0.5402843",
"text": "def [](index = nil)\n to_alloc[index]\n end",
"title": ""
},
{
"docid": "3ec5769da7b7619174bf14d55174b6b6",
"score": "0.539469",
"text": "def []( ref )\n query.query_values[ ref.to_s ]\n end",
"title": ""
},
{
"docid": "c8b09b6deea60162c2d3c85df31b8dc2",
"score": "0.5392297",
"text": "def get(index)\n \n end",
"title": ""
},
{
"docid": "f2249ca479a1a2d4ba564f4e7ef6af06",
"score": "0.5384362",
"text": "def [](index)\n index.zero? ? source : target\n end",
"title": ""
},
{
"docid": "51b2c7343866f33061df83b7cffc7c7b",
"score": "0.5354446",
"text": "def at(expr, &blk)\n search(expr, &blk).first\n end",
"title": ""
},
{
"docid": "8d8e77c79f84f45edb5b5f48703a6243",
"score": "0.5353814",
"text": "def get_item(index_number)\n @chores[index_number]\n end",
"title": ""
},
{
"docid": "e4ea6db1977c4bbeb038b338ec200d3e",
"score": "0.53509676",
"text": "def [](idx)\n Ruby.primitive :array_aref\n end",
"title": ""
},
{
"docid": "88277b2fc8ee36064272356f9a208d5f",
"score": "0.53478074",
"text": "def retrieve_element_from_index(array, index_number)\n return array[index_number]\nend",
"title": ""
},
{
"docid": "18ccea5c87282b7595e8400c1848fbf7",
"score": "0.5346574",
"text": "def at(index)\n each.with_index { |v, i| return v if i == index }\n return nil\n end",
"title": ""
},
{
"docid": "f1710d53063b1438f1210ceb805ac50b",
"score": "0.5332604",
"text": "def [](index)\n get_node(index).element\n end",
"title": ""
},
{
"docid": "6511b4cad657e3c84ecbf08f97309bac",
"score": "0.5327333",
"text": "def get_val_at_index(index)\n if index_valid?(index)\n current_node = @head\n i = 0\n while i < index\n current_node = current_node.next_node\n i += 1\n end\n current_node.val\n end\n end",
"title": ""
},
{
"docid": "65365eb7b05be8a9fcb7531aa519af2e",
"score": "0.53252935",
"text": "def get_instruction(x, y)\n @array[x][y]\n end",
"title": ""
},
{
"docid": "586666c4d3af520a61e05109a0a7fc9c",
"score": "0.5318971",
"text": "def get(index)\n raise(StandardError, 'IndexError') if invalid_index?(index)\n\n find_node_by_index(index).data\n end",
"title": ""
},
{
"docid": "cad82b66ba550bd8d231517821d34ae8",
"score": "0.5316055",
"text": "def [](index)\n all[index]\n end",
"title": ""
},
{
"docid": "6c01739a5f36583fe4e00bbd4813deef",
"score": "0.53117836",
"text": "def get_item(index)\r\n @list[index]\r\n end",
"title": ""
},
{
"docid": "d12b661cee92436f005e993a90cb8470",
"score": "0.52955073",
"text": "def [](index)\n relative_payments[index]\n end",
"title": ""
},
{
"docid": "fe9012b24da7c10cf4f3e58c54d70383",
"score": "0.5291653",
"text": "def get_at_index(index)\n return nil if index > length\n return get_at_index_helper(index, 0, @head)\n end",
"title": ""
},
{
"docid": "f5eb265e99e38d8ef95e72f9fb743703",
"score": "0.5284792",
"text": "def [](index_or_name)\n end",
"title": ""
},
{
"docid": "f5eb265e99e38d8ef95e72f9fb743703",
"score": "0.5284792",
"text": "def [](index_or_name)\n end",
"title": ""
},
{
"docid": "a30f5694bcf437065253b5420f07a678",
"score": "0.5269746",
"text": "def get_at_index(index)\r\n return nil unless @head\r\n return nil if index < 0\r\n cursor = @head\r\n index.times do\r\n return nil unless cursor.next\r\n cursor = cursor.next\r\n end\r\n return cursor.data\r\n end",
"title": ""
},
{
"docid": "ac8516d6e03cc3f04cb43a1681067365",
"score": "0.52652025",
"text": "def [](index)\n execute\n return @result[index]\n end",
"title": ""
},
{
"docid": "7d0239997a270b3daf922b14ea9250f5",
"score": "0.52529633",
"text": "def at(index)\n\t\tlocation = @head.next_node\n\t\t(index).times do\n\t\t\tlocation = location.next_node\n\t\tend\n\t\tlocation\n\tend",
"title": ""
},
{
"docid": "98df3be4a0f5f5a6abc4a64f51f09bd5",
"score": "0.52508116",
"text": "def item(index = self.index)\n @data[index]\n end",
"title": ""
},
{
"docid": "52a66cac47e7472a465dd82bb78225cf",
"score": "0.5242908",
"text": "def get_at_index(index)\r\n \r\n # determine length\r\n if @head.nil?\r\n return nil\r\n else\r\n length = 1\r\n current = @head\r\n until current.next.nil?\r\n current = current.next\r\n length += 1\r\n end\r\n end\r\n \r\n # return nil if index reference is outside of list length\r\n if (index + 1) > length\r\n return nil\r\n end\r\n \r\n # return the value at given index\r\n current = @head\r\n index.times do\r\n current = current.next\r\n end\r\n \r\n return current.data\r\n end",
"title": ""
},
{
"docid": "f8663fb72f724423cf27bdaeaca53cc9",
"score": "0.52404046",
"text": "def [](index)\r\n @library[index]\r\n end",
"title": ""
},
{
"docid": "e69c35273b0a1f244995da363db2d7c8",
"score": "0.5237393",
"text": "def by_index(index)\n @arr[index]\n end",
"title": ""
},
{
"docid": "255e469d2d129e5171a1e9acd7ca2464",
"score": "0.52346885",
"text": "def [](index)\n if @values.include?(index)\n return @values[index]\n else\n return @default\n end\n end",
"title": ""
},
{
"docid": "aedb8b1c5fccf481f175ec2b1a151a62",
"score": "0.5231644",
"text": "def get(index = :all)\n return @relays[1..-1] if index == :all\n index = check_index(index)\n @relays[index]\n end",
"title": ""
},
{
"docid": "9444307c2eb8513bd0305a035e3a8920",
"score": "0.52279377",
"text": "def [](index)\n @values[index]\n end",
"title": ""
},
{
"docid": "d876c527ce7a00732f71eaa221082e0d",
"score": "0.5223961",
"text": "def item(index = self.index)\n return @data[index]\n end",
"title": ""
},
{
"docid": "0b19013eebbb6b8da743bc0777430709",
"score": "0.5223326",
"text": "def at(index)\n return nil if @head.nil? \n return @head if index == 1\n return nil if index > self.size\n self.each_with_index do |current, ind|\n return current if ind == index\n end\n\n end",
"title": ""
},
{
"docid": "91e3ca88471db13c32bdd43078f4f8fe",
"score": "0.5216614",
"text": "def at_index\n return @commands[@index]\n end",
"title": ""
},
{
"docid": "a1553626565ecf81f3df1094c9b8564e",
"score": "0.5205899",
"text": "def get_at_index(index)\n # initialize current to head\n current = @head\n # account for index being greater than list length\n if index + 1 > length\n return nil\n # otherwise, move current to index\n else \n index.times do \n current = current.next\n end\n end\n # return value at indexed node\n return current.data\n end",
"title": ""
},
{
"docid": "9872e4e668ffaaee930afb8d3d41841c",
"score": "0.52056557",
"text": "def get(index)\n @list[index] || -1\n end",
"title": ""
},
{
"docid": "ed0573aecdc92a1b34b10120f8823969",
"score": "0.52038157",
"text": "def at(index)\n\t\tx = @head\n\t\ty = 0\n\t\tuntil x == nil\n\t\t\tif y == index\n\t\t\t\treturn x\n\t\t\tend\n\t\t\ty += 1\n\t\t\tx = x.next\n\t\tend\n\tend",
"title": ""
},
{
"docid": "28a03d4c0f700a590195060ae8e0043c",
"score": "0.52027535",
"text": "def [](index)\r\n @internal_list[index]\r\n end",
"title": ""
},
{
"docid": "ef7d1d265d355706c5843fc6210f9289",
"score": "0.52008605",
"text": "def get_shortcut ix\n return \"<\" if ix < $stact\n ix -= $stact\n i = $IDX[ix]\n return i if i\n return \"->\"\nend",
"title": ""
},
{
"docid": "ef7d1d265d355706c5843fc6210f9289",
"score": "0.52008605",
"text": "def get_shortcut ix\n return \"<\" if ix < $stact\n ix -= $stact\n i = $IDX[ix]\n return i if i\n return \"->\"\nend",
"title": ""
},
{
"docid": "ce23d008aa6c4b622fa48d70ade5eaed",
"score": "0.51996297",
"text": "def [](index)\n @tree[index]\n end",
"title": ""
},
{
"docid": "25beaf6fe5f12d4ea26c8891168c531d",
"score": "0.51935375",
"text": "def [](idx)\n radios[idx]\n end",
"title": ""
},
{
"docid": "d3b0d3f952dc0fdc7f1828dd8b7ab516",
"score": "0.51919925",
"text": "def get_search(index, expression)\n chef_server.search.query(index, expression, rows: 1).rows.first\n end",
"title": ""
},
{
"docid": "738dddf5821e618b3c8ae6af7cd989c2",
"score": "0.5189513",
"text": "def index(tensor, sel, name: nil)\n _op(:index, tensor, sel, name: name)\n end",
"title": ""
},
{
"docid": "227c80e208871a9a9239da14314eb9c3",
"score": "0.51820487",
"text": "def compile_bindex(scope, arr, index)\n source = compile_eval_arg(scope, arr)\n @e.pushl(source)\n source = compile_eval_arg(scope, index)\n r = @e.with_register do |reg|\n @e.popl(reg)\n @e.save_result(source)\n @e.addl(@e.result_value, reg)\n end\n return [:indirect8, r]\n end",
"title": ""
},
{
"docid": "c6ab14320e6a906b6cc88727c9dfb938",
"score": "0.51794",
"text": "def get_item(index)\n # TODO\n end",
"title": ""
},
{
"docid": "c17d8252b28f28ce90cfe6ac74e37368",
"score": "0.5177406",
"text": "def get(index)\n case\n when index < 0 then return -1\n when index == 0 then return @head.val\n when index >= @length then return -1\n else\n current = @head\n for i in 0..(index-1)\n current = current.next\n end\n return -1 if current.nil?\n return current.val\n end\n end",
"title": ""
},
{
"docid": "9a7839eb7ee5ea8cdf3e6ac05aecf258",
"score": "0.51700807",
"text": "def [](idx)\n row(:index, idx)\n end",
"title": ""
},
{
"docid": "1e8063040c0dbd23e0afc9a0293238d7",
"score": "0.5166618",
"text": "def rindex(p0) end",
"title": ""
},
{
"docid": "ae13ea1576a51f48efe010600d2fe935",
"score": "0.51655024",
"text": "def value\n\t\t@operands[-1]\n\tend",
"title": ""
},
{
"docid": "0a964da316eadb9aae4bf71a233f44fe",
"score": "0.51600486",
"text": "def at(index); end",
"title": ""
},
{
"docid": "149c5e9e4b6b8b39832ba5096f44012d",
"score": "0.5156588",
"text": "def at(index)\n return \"Index out of range\" if index > self.size\n node = self.head\n if sign(index) == \"+\"\n (index).times do\n node = node.next\n end\n elsif sign(index) == \"-\"\n (index).times do\n node = node.prev\n end\n end\n node\n end",
"title": ""
},
{
"docid": "1277375451a16655cceef6d797529f03",
"score": "0.5156564",
"text": "def [](index)\n case index\n when Integer\n values[index]\n when self\n values[index.index]\n else\n name = index.to_s\n case name\n when /\\A(\\d+)\\Z/\n return values[$1.to_i]\n when /\\A[a-z]/\n name = name.to_str.gsub(/(?:\\A|_)(.)/) { $1.upcase }\n end\n with_name(name)\n end\n end",
"title": ""
},
{
"docid": "e513fed40432b622e48a0ab3daf0d453",
"score": "0.5148784",
"text": "def do_refs(address, length, operator, operands)\n refs = []\n\n # If it's not a mandatory jump, it references the next address\n if(returns?(operator))\n refs << (address + length)\n end\n\n # If it's a jump of any kind (with an immediate destination), fill in the ref\n if((jump?(operator)) && operands[0] && operands[0][:type] == 'immediate')\n refs << operands[0][:value]\n end\n\n return refs\n end",
"title": ""
},
{
"docid": "22bde6debaf50cefec30dbe18e71fc8c",
"score": "0.5140519",
"text": "def get_pointer_at(index)\n IO.binread(@path, POINTER_SIZE, HEADER_SIZE + POINTER_SIZE * index).unpack(\"N\").first\n end",
"title": ""
},
{
"docid": "c1a3b1bc464f0928065fdd3573193514",
"score": "0.5134097",
"text": "def [](word1)\n @index[word1]\n end",
"title": ""
}
] |
1c3f11476013875364aae71648a84de4
|
DELETE /lovedones/1 DELETE /lovedones/1.json
|
[
{
"docid": "306f2324c9f4850ad24806d314676d65",
"score": "0.7111703",
"text": "def destroy\n @lovedone.destroy\n respond_to do |format|\n #refresh \n format.html { redirect_to lovedones_url, notice: 'Loved one has been successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
[
{
"docid": "689d5a07a403c4b765ba178e4aff08a3",
"score": "0.70906615",
"text": "def delete\n client.delete(\"/#{id}\")\n end",
"title": ""
},
{
"docid": "ad869cabd292370060e08716faad4645",
"score": "0.6996684",
"text": "def destroy\n @lovedone.destroy\n respond_to do |format|\n #refresh \n format.html { redirect_to lovedones_url, notice: 'Lovedone was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "179ff0053e8f4f967cb3d92206094cf0",
"score": "0.68815064",
"text": "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"title": ""
},
{
"docid": "11d673f1867b58a468e883992083ced7",
"score": "0.68604344",
"text": "def destroy\n @pinglun = Pinglun.find(params[:id])\n @pinglun.destroy\n\n respond_to do |format|\n format.html { redirect_to pingluns_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "09fc2820d9479cac0697e20c559268bf",
"score": "0.6828037",
"text": "def delete\n render json: Alien.delete(params[\"id\"])\n end",
"title": ""
},
{
"docid": "f9912a7566edbd02b60f8b5b1ed2f1bf",
"score": "0.6789303",
"text": "def destroy\n @one = One.find(params[:id])\n @one.destroy\n\n respond_to do |format|\n format.html { redirect_to ones_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4c1c164b581dbae14285797e584e8fb7",
"score": "0.6703429",
"text": "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"title": ""
},
{
"docid": "4a438979d5d7a9a4fbe19d273b9eef17",
"score": "0.66893685",
"text": "def destroy\n @lore = Lore.find(params[:id])\n @lore.destroy\n\n respond_to do |format|\n format.html { redirect_to lores_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "33b888c8f2b033bb54789de80c57d692",
"score": "0.66755486",
"text": "def delete\n client.delete(url)\n @deleted = true\nend",
"title": ""
},
{
"docid": "1558f130aa30d908a20a4abe6fc179b5",
"score": "0.6655038",
"text": "def destroy\n @lov.destroy\n respond_to do |format|\n format.html { redirect_to lovs_url, notice: 'Lov was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "426b403eeaaf19f193ef74e292db4270",
"score": "0.6650872",
"text": "def destroy\n @hotele = Hotele.find(params[:id])\n @hotele.destroy\n\n respond_to do |format|\n format.html { redirect_to hoteles_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5bfd08e42ee8788ea933db680674cdb8",
"score": "0.66375095",
"text": "def destroy\n @rayon = Rayon.find(params[:id])\n @rayon.destroy\n\n respond_to do |format|\n format.html { redirect_to rayons_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5b8853ad2f8cc478a7fcd613a6c91867",
"score": "0.6634122",
"text": "def destroy\n @lodging.destroy\n respond_to do |format|\n format.html { redirect_to lodgings_url, notice: \"Lodging was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "705296f5839cc1453f90fdce3ecff655",
"score": "0.6632898",
"text": "def destroy\n @lodging.destroy\n respond_to do |format|\n format.html { redirect_to lodgings_url, notice: 'Lodging was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ec706dff94ced37c2c6e024b99930c99",
"score": "0.66315",
"text": "def destroy\n @orphan.destroy\n respond_to do |format|\n format.html { redirect_to orphans_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c50cd114506945ebd77e601fcc3c726e",
"score": "0.66310096",
"text": "def destroy\n @lode.destroy\n respond_to do |format|\n format.html { redirect_to lodes_url, notice: 'Lode was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0ee724cfa4a82609df7cfc2c6bc4bdd0",
"score": "0.66293275",
"text": "def destroy\n @lounge.destroy\n respond_to do |format|\n format.html { redirect_to lounges_url, notice: 'Lounge was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4816fb95aa8f78636b2d3d5b1afeb251",
"score": "0.66137356",
"text": "def destroy\n @stone = Stone.find(params[:id])\n @stone.destroy\n\n respond_to do |format|\n format.html { redirect_to stones_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2311373e4369fcdec23d826a26863a72",
"score": "0.659332",
"text": "def destroy\n @lob.destroy\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d2938d0d96fc4adb30b185ea6e647cdf",
"score": "0.6589769",
"text": "def delete\n render json: Post.delete(params[\"id\"])\n end",
"title": ""
},
{
"docid": "d1f0a8e8c97a0438790f1ddeeecaca29",
"score": "0.65660524",
"text": "def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end",
"title": ""
},
{
"docid": "b539b98024d629b09912289f9ec60be1",
"score": "0.656423",
"text": "def destroy\n @loo.destroy\n respond_to do |format|\n format.html { redirect_to loos_url, notice: 'Loo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "932c67b8e7aab429836595e4d6a10f60",
"score": "0.65598506",
"text": "def destroy\n @kota_stone.destroy\n respond_to do |format|\n format.html { redirect_to kota_stones_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f234ea901020f8b85c58975f014ea1e6",
"score": "0.6552929",
"text": "def destroy\n @nodo.destroy\n respond_to do |format|\n format.html { redirect_to nodos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e8b43182bb3baf620547c5cf2fbd5aa5",
"score": "0.6541508",
"text": "def destroy\n @orthologue = Orthologue.find(params[:id])\n @orthologue.destroy\n\n respond_to do |format|\n format.html { redirect_to orthologues_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7a5eea7c7a07ce3e7f95fa50802d596e",
"score": "0.6540236",
"text": "def delete path\n make_request(path, \"delete\", {})\n end",
"title": ""
},
{
"docid": "8a5050aa3d1f14e520575c472ecdc640",
"score": "0.6510989",
"text": "def destroy\n @lodge = Lodge.find(params[:id])\n @lodge.destroy\n\n respond_to do |format|\n format.html { redirect_to lodges_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c1178525df30ce287a8cadbe9f7e346c",
"score": "0.6510614",
"text": "def destroy\n @Love = Love.find(params[:id])\n @Love.destroy\n\n respond_to do |format|\n format.html { redirect_to loves_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "53e40719c37334fbac5f815b3cbc464e",
"score": "0.65080196",
"text": "def destroy\n @clonet = Clonet.find(params[:id])\n @clonet.destroy\n\n respond_to do |format|\n format.html { redirect_to clonets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "77a2d5503aca8bdde9bc069510fe752a",
"score": "0.64965767",
"text": "def destroy\n @hoge = Hoge.find(params[:id])\n @hoge.destroy\n\n respond_to do |format|\n format.html { redirect_to hoges_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "692d0973a16206b2d36f4e972a04d2c9",
"score": "0.64892006",
"text": "def destroy\n @lodge.destroy\n respond_to do |format|\n format.html { redirect_to lodges_url, notice: 'Lodge was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "aae12af57ebae0c3e1c2c4171f0ad370",
"score": "0.64853716",
"text": "def destroy\n @livro = Livro.find(params[:id])\n @livro.destroy\n\n respond_to do |format|\n format.html { redirect_to livros_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "297c00ee8979afcdc75363bc75548915",
"score": "0.6480992",
"text": "def destroy\n @liverecord = Liverecord.find(params[:id])\n @liverecord.destroy\n\n respond_to do |format|\n format.html { redirect_to liverecords_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0b60036da479289e75c835b8ff60b5a3",
"score": "0.6472384",
"text": "def destroy\n \n @lancamentorapido = Lancamentorapido.find(params[:id])\n @lancamentorapido.destroy \n\n respond_to do |format|\n format.html { redirect_to lancamentorapidos_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "79181da7ba88fd500e5cc64e80fcccf8",
"score": "0.6456242",
"text": "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",
"title": ""
},
{
"docid": "f1dad81a3dc9e4ab6229d38c42af3ae9",
"score": "0.645366",
"text": "def destroy\n @cephalopod.destroy\n respond_to do |format|\n format.html { redirect_to cephalopods_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "314f9b99cd5c040efebf86e3d3f2c2bd",
"score": "0.6446155",
"text": "def destroy\n @poligono.destroy\n respond_to do |format|\n format.html { redirect_to poligonos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1aafaf479fe6c0d6fdc3ff14dc575e36",
"score": "0.64388776",
"text": "def destroy\n \n @loph.destroy\n respond_to do |format|\n format.html { redirect_to lophs_url, notice: 'Loph was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fa3c20a90ea1419af2232f845e460f8c",
"score": "0.6426109",
"text": "def delete!\n request! :delete\n end",
"title": ""
},
{
"docid": "ffb5428ac493709e48dc5abde8b49986",
"score": "0.6422376",
"text": "def destroy\n @orthodb_best_orthologue = OrthodbBestOrthologue.find(params[:id])\n @orthodb_best_orthologue.destroy\n\n respond_to do |format|\n format.html { redirect_to orthodb_best_orthologues_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ba67ebd85114998e01be10599c8943ca",
"score": "0.6421414",
"text": "def delete(path)\n RestClient.delete request_base+path\n end",
"title": ""
},
{
"docid": "a6660f8f62027412929d7b78d182281c",
"score": "0.6414539",
"text": "def delete endpoint\n do_request :delete, endpoint\n end",
"title": ""
},
{
"docid": "ee014a13224c07cc94fd214a5b46cc2f",
"score": "0.64017415",
"text": "def destroy\n @nudge.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bcbfed8bb9495080c1f52fdece84019c",
"score": "0.63987976",
"text": "def destroy\n @loja = Loja.find(params[:id])\n @loja.destroy\n\n respond_to do |format|\n format.html { redirect_to lojas_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cb582d45f0214e729feb4c591d1078d2",
"score": "0.6393665",
"text": "def destroy\n @lotes = Lote.find(params[:id])\n @lotes.destroy\n\n respond_to do |format|\n format.html { redirect_to(lotes_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "70de2120d84cf4a85dc1ecb486fcd3d5",
"score": "0.6385593",
"text": "def destroy\n @zombie = Zombie.find(params[:id])\n @zombie.destroy\n\n respond_to do |format|\n format.html { redirect_to zombies_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "522e787502895f0a05c9b2c6ca4e5ced",
"score": "0.63820237",
"text": "def delete\n request(:delete)\n end",
"title": ""
},
{
"docid": "a3bee60dfdc051774260b2d4ce1a6848",
"score": "0.6381465",
"text": "def destroy\n @vano = Vano.find(params[:id])\n @vano.destroy\n\n respond_to do |format|\n format.html { redirect_to vanos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7070e4dc3849fac5852c0271c9b6d7cc",
"score": "0.6380093",
"text": "def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end",
"title": ""
},
{
"docid": "854ac71d7ed167a7b7c4f2724bbb534b",
"score": "0.63757265",
"text": "def DeleteView id\n \n APICall(path: \"views/#{id}.json\",method: 'DELETE')\n \n end",
"title": ""
},
{
"docid": "c6798424d46577fa4ffac5eda4ecc0c6",
"score": "0.6373948",
"text": "def delete\n url = prefix + \"delete\" + id_param\n return response(url)\n end",
"title": ""
},
{
"docid": "699a73e1018075bf6f4ec5cf453a3c7d",
"score": "0.63714975",
"text": "def destroy\n @three.destroy\n respond_to do |format|\n format.html { redirect_to threes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2574b050b93347fa2c21521eb5716823",
"score": "0.6371356",
"text": "def destroy\n @leito = Leito.find(params[:id])\n @leito.destroy\n\n respond_to do |format|\n format.html { redirect_to leitos_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "5a0416667933f0b546e4a2a288d003ac",
"score": "0.63662606",
"text": "def destroy\n @moonwalk.destroy\n respond_to do |format|\n format.html { redirect_to moonwalks_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9410f5d5c06a5d4acee3b61e4f080658",
"score": "0.63641745",
"text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"title": ""
},
{
"docid": "9410f5d5c06a5d4acee3b61e4f080658",
"score": "0.63641745",
"text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"title": ""
},
{
"docid": "9410f5d5c06a5d4acee3b61e4f080658",
"score": "0.63641745",
"text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"title": ""
},
{
"docid": "9410f5d5c06a5d4acee3b61e4f080658",
"score": "0.63641745",
"text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"title": ""
},
{
"docid": "8f396bae30e7d7a8a37fe3fac6196094",
"score": "0.6358295",
"text": "def destroy\n @odontologia1 = Odontologia1.find(params[:id])\n @odontologia1.destroy\n\n respond_to do |format|\n format.html { redirect_to odontologia1s_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "053c507bc03b7e21b6534bae57be699b",
"score": "0.6358192",
"text": "def delete(object)\n full_name = extract_full_name object\n post 'api/del', :id => full_name\n end",
"title": ""
},
{
"docid": "b5abbb61147a1428c69c61faf64ead5d",
"score": "0.6356894",
"text": "def destroy\n @telefone = Telefone.find(params[:id])\n @telefone.destroy\n\n respond_to do |format|\n format.html { redirect_to telefones_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "34264605c47edda6ffe32df87c7a7266",
"score": "0.6354846",
"text": "def delete\n delete_from_server single_url\n end",
"title": ""
},
{
"docid": "ca0318c8b69b384d217c411a12cc7ac6",
"score": "0.6353244",
"text": "def destroy\n @hotele.destroy\n respond_to do |format|\n format.html { redirect_to hoteles_url, notice: 'Hotele was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "86faa8c555419d7144a0c7003f760dff",
"score": "0.6352599",
"text": "def delete\n render json: Item.delete(params[\"id\"])\n end",
"title": ""
},
{
"docid": "cd5fda4fb4f20a52d99df5b8aec322ba",
"score": "0.63508713",
"text": "def destroy\n @roof = Roof.find(params[:roof_id])\n @status = @roof.statuses.find(params[:id])\n @status.destroy\n\n respond_to do |format|\n format.html { redirect_to statuseses_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "84fbef80387827bc1bdcee617ee08e95",
"score": "0.63459724",
"text": "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",
"title": ""
},
{
"docid": "11ea59e4ce1803e67b3352fd2eaf9a0d",
"score": "0.6345793",
"text": "def delete(path, params)\n headers = {:Authorization => \"token #{token}\", :content_type => :json, :accept => :json}\n res = RestClient.delete(\"#{github_api_uri}/#{path}\", params.to_json, headers)\n Yajl.load(res)\n end",
"title": ""
},
{
"docid": "17ed320a158948e7e3d7dcd53544f1a0",
"score": "0.6345629",
"text": "def destroy\n @json.destroy\n respond_to do |format|\n format.html { redirect_to jsons_url, notice: 'Json was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "17ed320a158948e7e3d7dcd53544f1a0",
"score": "0.6345629",
"text": "def destroy\n @json.destroy\n respond_to do |format|\n format.html { redirect_to jsons_url, notice: 'Json was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d42d524667fe775a6fd2f8ed58ac62b5",
"score": "0.6344408",
"text": "def delete(*rest) end",
"title": ""
},
{
"docid": "9733f13da7dd4cb3b6922e46d2971bfd",
"score": "0.63416886",
"text": "def destroy\n @platoon.destroy\n respond_to do |format|\n format.html { redirect_to platoons_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "43e16235cb15437856f7b8b9632040ab",
"score": "0.63378865",
"text": "def destroy\n @lot = Lot.find(params[:id])\n @lot.destroy\n\n respond_to do |format|\n format.html { redirect_to myadmin_lots_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3d96c57791843b6508a41d7aeb87e619",
"score": "0.6336042",
"text": "def destroy\n @monel = Monel.find(params[:id])\n @monel.destroy\n\n respond_to do |format|\n format.html { redirect_to monels_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f09c807e4788fe9c7833b6d786838584",
"score": "0.6335142",
"text": "def destroy\n @server1 = Server1.find(params[:id])\n @server1.destroy\n\n respond_to do |format|\n format.html { redirect_to server1s_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f06816171b206e50b9c1e974132bb883",
"score": "0.6333137",
"text": "def destroy\n @ovode = Ovode.find_by_url(params[:id])\n @ovode.destroy\n\n respond_to do |format|\n format.html { redirect_to ovodes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "20fddbe8d782cdddc0d3b8538e00e4a7",
"score": "0.6331292",
"text": "def destroy\n @mote = Mote.find(params[:id])\n @mote.destroy\n\n respond_to do |format|\n format.html { redirect_to motes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5175ff901a9cd9e971b16c89a6b91d69",
"score": "0.63296926",
"text": "def destroy\n @pologeno = Pologeno.find(params[:id])\n @pologeno.destroy\n\n respond_to do |format|\n format.html { redirect_to pologenos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8611e1d96b950ac1ef36f5595a73d938",
"score": "0.632912",
"text": "def destroy\n @lector = Lector.find(params[:id])\n @lector.destroy\n\n respond_to do |format|\n format.html { redirect_to lectores_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c45987409530d0d8e36e16a605ef539b",
"score": "0.6325249",
"text": "def destroy\n @ninja = Ninja.find(params[:id])\n @ninja.destroy\n\n respond_to do |format|\n format.html { redirect_to ninjas_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "56eab79a50ffb3a91ffc14885a311ba1",
"score": "0.63236755",
"text": "def delete\n render json: Location.delete(params[\"id\"])\n end",
"title": ""
},
{
"docid": "5df3cef86bd803a9fdd4d900b5689e7d",
"score": "0.6323023",
"text": "def destroy\n @lomein.destroy\n respond_to do |format|\n format.html { redirect_to lomeins_url, notice: 'Lomein was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "157fe8abaaec5b1279f321e52c86bc71",
"score": "0.63211215",
"text": "def delete!\n Recliner.delete(uri)\n end",
"title": ""
},
{
"docid": "c6d264050952b86e3aa9674d2ca92712",
"score": "0.63211006",
"text": "def destroy\n @prueba_json.destroy\n respond_to do |format|\n format.html { redirect_to prueba_jsons_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8ef9fb46cbb70b2d5426d48f004829bf",
"score": "0.6318428",
"text": "def destroy\n @lore = Lore.find(params[:id])\n @lore.destroy\n\n respond_to do |format|\n format.html { redirect_to(lores_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "1e96e17b5c1dfa1a4f63d9839a23bb84",
"score": "0.63145924",
"text": "def destroy\n @inside.destroy\n respond_to do |format|\n format.html { redirect_to insides_url, notice: 'Inside was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b39a03413d606391c52e7c71e957a049",
"score": "0.63134885",
"text": "def delete\n render json: Company.delete(params[\"id\"])\n end",
"title": ""
},
{
"docid": "acbf60479106e65d230bd2d7f9733e2c",
"score": "0.63081735",
"text": "def destroy\n @octopus.destroy\n respond_to do |format|\n format.html { redirect_to octopi_url, notice: 'Octopus was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6bb5b9e2ce5ab901a05a1d618f90ad4d",
"score": "0.6308133",
"text": "def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"title": ""
},
{
"docid": "6bb5b9e2ce5ab901a05a1d618f90ad4d",
"score": "0.6308133",
"text": "def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"title": ""
},
{
"docid": "3aaef284a52022ac0452c98c379d6166",
"score": "0.6307402",
"text": "def destroy\n @walikela.destroy\n respond_to do |format|\n format.html { redirect_to walikelas_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "61496cc053172164064dfa19f0108bc0",
"score": "0.63056076",
"text": "def destroy\n @line_pet.destroy\n respond_to do |format|\n format.html { redirect_to line_pets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3633e737644dae5f5d8d49f3248f7a12",
"score": "0.63035095",
"text": "def delete\n api(\"Delete\")\n end",
"title": ""
},
{
"docid": "4ea21d62adcdef7c24492538d73740c0",
"score": "0.6294755",
"text": "def destroy\n @floor = Floor.find(params[:id])\n @floor.destroy\n\n respond_to do |format|\n format.html { redirect_to floors_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c9e6e617a1d408121bb1280115b97315",
"score": "0.62922376",
"text": "def destroy\n @trnodo = Trnodo.find(params[:id])\n @trnodo.destroy\n\n respond_to do |format|\n format.html { redirect_to trnodos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "94e4d3956404ae4f189a8b97f0f57aa7",
"score": "0.62922007",
"text": "def destroy\n @lent = Lent.find(params[:id])\n @lent.destroy\n\n respond_to do |format|\n format.html { redirect_to lents_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3903143fcc323a88c3271e8ad2ce1e41",
"score": "0.6292167",
"text": "def destroy\n @dart = Dart.find(params[:id])\n @dart.destroy\n\n respond_to do |format|\n format.html { redirect_to darts_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "11be59ebcce4670dc5bc9dc0cdc10c97",
"score": "0.6284281",
"text": "def destroy\n @photoid = Photoid.find(params[:id])\n @photoid.destroy\n\n respond_to do |format|\n format.html { redirect_to photoids_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fb622696b3cadaef2a0d459cf3572785",
"score": "0.6283787",
"text": "def destroy\n client=Client.find_by_id(params[:id])\n if client != nil\n if client.destroy\n head 204\n end\n else\n head 404\n end\n end",
"title": ""
},
{
"docid": "87600d3ad33220c28a5f837a6a9af614",
"score": "0.62806296",
"text": "def destroy\n @line_item1 = LineItem1.find(params[:id])\n @line_item1.destroy\n\n respond_to do |format|\n format.html { redirect_to line_item1s_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c0acd4a0d9427eb73affbd47e98d3fd5",
"score": "0.62804747",
"text": "def destroy\n @straddle = Straddle.find(params[:id])\n @straddle.destroy\n\n respond_to do |format|\n format.html { redirect_to straddles_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
c65b564513830d8a6b9a4eb3ad3318b6
|
Internal: Outputs the specified argument to the configured stdout object and exits with the specified exit code. s The String to output. exit_code The Integer exit code. Examples ui.output_and_exit 'something went wrong', 99 ui.output_and_exit 'all done', 0 Returns nothing.
|
[
{
"docid": "09519cfb24839a11d5611722992a38a7",
"score": "0.83069754",
"text": "def output_and_exit(s, exit_code)\n output s\n exit exit_code\n end",
"title": ""
}
] |
[
{
"docid": "e0a65f66853f70f6b58e1133cbe16e0b",
"score": "0.5957457",
"text": "def error_and_out(msg)\n puts \"#{msg}\\n\"\n exit\nend",
"title": ""
},
{
"docid": "e0a65f66853f70f6b58e1133cbe16e0b",
"score": "0.5957457",
"text": "def error_and_out(msg)\n puts \"#{msg}\\n\"\n exit\nend",
"title": ""
},
{
"docid": "b33d63479d40aea6f0113c74084ca677",
"score": "0.59410584",
"text": "def exit_with_message(s)\n puts s\n exit\nend",
"title": ""
},
{
"docid": "552967dd981cd128890a87538a24dafd",
"score": "0.5858223",
"text": "def exit_(code)\n if CODES[code]\n puts \"#{CODES[code]}\"\n exit code\n else\n raise \"unknown exit code #{code}\"\n end\n end",
"title": ""
},
{
"docid": "03b280de797634bfc720c1a07f405b1c",
"score": "0.5800373",
"text": "def exit_if_nil arg, exit_code, msg\r\n\t\tif arg.nil? \r\n\t\t\t$stderr.puts msg\r\n\t\t\texit exit_code\r\n\t\tend\t\t\r\n\tend",
"title": ""
},
{
"docid": "ce73e81066fe8ef213599abaa6b6304a",
"score": "0.5751785",
"text": "def error(msg, code)\n STDERR.puts msg\n exit code\nend",
"title": ""
},
{
"docid": "ce73e81066fe8ef213599abaa6b6304a",
"score": "0.5751785",
"text": "def error(msg, code)\n STDERR.puts msg\n exit code\nend",
"title": ""
},
{
"docid": "ce73e81066fe8ef213599abaa6b6304a",
"score": "0.5751785",
"text": "def error(msg, code)\n STDERR.puts msg\n exit code\nend",
"title": ""
},
{
"docid": "ce73e81066fe8ef213599abaa6b6304a",
"score": "0.5751785",
"text": "def error(msg, code)\n STDERR.puts msg\n exit code\nend",
"title": ""
},
{
"docid": "b225a291ed4d76ac6c07beee5c1e1d28",
"score": "0.57409066",
"text": "def error_and_exit(message=nil)\n\t# Exit the script and print the usage instructions, with a given error message if any.\n\tputs \n\tputs message if message\n\tputs @usage\n\texit 1\nend",
"title": ""
},
{
"docid": "69f9c2940037fd95279d9192b17ef710",
"score": "0.573686",
"text": "def errout(message, code=$err_generic)\n STDERR.puts \"Error: \" + message\n if code == $err_cli\n usage\n end\n Kernel.exit code\nend",
"title": ""
},
{
"docid": "42cda2285c7e0395e0eafabd2066977d",
"score": "0.57192266",
"text": "def exit_with(name_or_code = :ok, message = nil, io: $stderr)\n if message == :default\n message = \"ERROR(#{exit_code(name_or_code)}): #{exit_message(name_or_code)}\"\n end\n io.print(message) if message\n ::Kernel.exit(exit_code(name_or_code))\n end",
"title": ""
},
{
"docid": "15b062eddba087d7f34d462f8bdd2896",
"score": "0.57017094",
"text": "def exit_on_status (output, status)\n # Do nothing for proper statuses\n if status.exited? && status.exitstatus == 0\n return output\n end\n\n # If we exited nonzero or abnormally, print debugging info\n # and explode.\n if status.exited?\n puts \"Return code was #{status.exitstatus}\"\n exit status.exitstatus\n end\n puts \"This might be helpful:\\nProcessStatus: #{status.inspect}\\nRaw POSIX Status: #{status.to_i}\\n\"\n exit 1\nend",
"title": ""
},
{
"docid": "34af71839de60777ff8782e5c9d0f270",
"score": "0.56872696",
"text": "def error_and_exit(message)\n error(message)\n exit(1)\nend",
"title": ""
},
{
"docid": "35f9ec5cf61e0958a3348865c7abf281",
"score": "0.56647414",
"text": "def exit_error(message, exit_code = -1)\n puts \"#{message}\\n\\n#{help}\"\n exit(exit_code)\n end",
"title": ""
},
{
"docid": "9e392f068d7b3f6a858c7580c1dd7317",
"score": "0.5643469",
"text": "def ok_exit(message)\n puts message\n exit 0\n end",
"title": ""
},
{
"docid": "39f5c68f5d7c8f114b039b02cb2045fa",
"score": "0.563432",
"text": "def exit(code: nil, matched: [], unmatched: [], depth: 0, **options)\n p EXIT: { code: code, depth: 0 }\n end",
"title": ""
},
{
"docid": "7522845a7c0b2086f59ebcebbd9160f2",
"score": "0.56122243",
"text": "def exit_ok(msg)\n puts msg\n exit 0\nend",
"title": ""
},
{
"docid": "57f2e450af7d126c9b5d6637158b8163",
"score": "0.5578818",
"text": "def shell_out!(*command_args)\n cmd = shell_out(*command_args)\n cmd.error!\n cmd\n end",
"title": ""
},
{
"docid": "8292baacfea3f2f4da4cb89ba74d9d9c",
"score": "0.55775535",
"text": "def test_clean_exit\r\n code = 0\r\n assert_output(\"\") {@init.clean_exit(code, false)}\r\n end",
"title": ""
},
{
"docid": "51e5b820eaf7114ab51efdb1f658dc99",
"score": "0.5570362",
"text": "def exit_with_message(\n message = nil,\n exit_code = 1\n)\n\n handle_message(message, 'ERROR')\n\n exit(exit_code)\n\nend",
"title": ""
},
{
"docid": "2488a9351748ad23fa44fdf453a7f86a",
"score": "0.55700207",
"text": "def exit_with_msg\n msg = []\n status = @ok\n [ @ok, @warning, @critical, @unknown ].each do |level|\n if not level.empty?\n status = level\n msg.unshift level.name.to_s + '(' + level.messages.join(', ') + ')'\n end\n end\n\n msg = [@ok.default_message] if status == @ok and msg.empty?\n\n print status.name.to_s.upcase + ': ' + msg.join(' ')\n print ' | ' + @perfdata.join(' ') if @with_perfdata and not @perfdata.empty?\n puts\n exit status.code\n end",
"title": ""
},
{
"docid": "7617b8f7345340f3d48f490643b9753a",
"score": "0.55619603",
"text": "def exit_with(msg)\n puts msg\n exit\n end",
"title": ""
},
{
"docid": "dbab15af3f77091c5c38f0165c67b234",
"score": "0.55201274",
"text": "def shell_out_wrapper(args)\n o = nil\n begin\n cmd = shell_out(args)\n o = (cmd.stdout.empty? ? cmd.stderr : cmd.stdout).strip\n rescue\n o = \"failed to run #{args.first}\"\n end\n o\n end",
"title": ""
},
{
"docid": "b71bec0f2bb3e3d2a73de0b747c444f3",
"score": "0.55168605",
"text": "def exit!(msg, err = -1)\n Ohai::Log.debug(msg)\n Process.exit err\n end",
"title": ""
},
{
"docid": "19de88d27acc50f528feb850147c3d96",
"score": "0.55165404",
"text": "def exit(arg=0)\n status = 9\n if (arg._equal?(true))\n status = 0\n elsif (arg._isInteger)\n status = arg\n end\n raise SystemExit.new(status)\n end",
"title": ""
},
{
"docid": "4647c14451949127dc46c935907b3138",
"score": "0.5504444",
"text": "def usage_and_exit\n display_usage\n exit(1)\nend",
"title": ""
},
{
"docid": "9b0a5043012edbc4e920ca9adde5276e",
"score": "0.54687554",
"text": "def usage_exit(message = nil)\n error \"Exit with error message: #{message}\" if message.present?\n Kernel.puts(self.class.usage(message))\n exit\n end",
"title": ""
},
{
"docid": "d6f213c0e418564722e7e41975b7932f",
"score": "0.5453843",
"text": "def error_and_exit(msg)\n STDERR.puts \"ERROR: #{msg}\"\n exit\n end",
"title": ""
},
{
"docid": "fd970aa6e2fd8c1a4f921186e17d60aa",
"score": "0.54435486",
"text": "def print_usage_and_exit(exitcode=1)\n usage = <<EOU\nUsage: partybus ACTION\n\nActions:\n init Set the initial migration level\n upgrade Run through the pending upgrades\n help Print this help message\nEOU\n log(usage)\n exit(exitcode)\nend",
"title": ""
},
{
"docid": "5e536ca3f44f8a52368e6be157066b5a",
"score": "0.5441726",
"text": "def exit_with_error(error_message)\n puts error_message\n puts usage\n exit(1)\n end",
"title": ""
},
{
"docid": "565c84bc6eb63ab5643c39aeb098ce54",
"score": "0.54309976",
"text": "def execution_output(output, opts)\n if opts[:shell] == :wql\n return output\n elsif opts[:error_check] && \\\n !opts[:good_exit].include?(output.exitcode)\n raise_execution_error(output, opts)\n end\n output.exitcode\n end",
"title": ""
},
{
"docid": "34994053671c1819d9dae59bce5089c2",
"score": "0.5429581",
"text": "def exit!(arg=0)\n status = 9\n if (arg._equal?(true))\n status = 0\n elsif (arg._isInteger)\n status = arg\n end\n ex = SystemExit.new(status)\n ex.run_at_exit_handlers = false\n raise ex\n end",
"title": ""
},
{
"docid": "b9aed72acc963638d6b532ecc7c1488a",
"score": "0.5427373",
"text": "def exit!( code = 0 )\n end",
"title": ""
},
{
"docid": "f6f7b5d4cb58deb05308659f600cf232",
"score": "0.5413778",
"text": "def failure_exit_with_msg(msg)\n puts 'Failed.'\n puts msg\n exit false\n end",
"title": ""
},
{
"docid": "2241de79f2c13cee8bad5f68984ffe08",
"score": "0.5408909",
"text": "def cmd_exit(args)\n\t\t\t\texit_app\n\t\t\tend",
"title": ""
},
{
"docid": "91cd112937d39bfc0ef7304291dc7a06",
"score": "0.5394186",
"text": "def output_for(*args)\n shell.output_for(svn_command_for(args), :logger => @logger)\n end",
"title": ""
},
{
"docid": "bb429e124abe20854ebfa2d5bfe337b8",
"score": "0.5387573",
"text": "def msys_shell_out!(*args)\n msys_shell_out(*args).tap(&:error!)\n end",
"title": ""
},
{
"docid": "aecf504679ee9ff338aa80bd8c8f045a",
"score": "0.53855824",
"text": "def print_status(exit_status)\n if exit_status == SUCCESS_EXIT_STATUS\n print_success_status\n elsif exit_status == ERROR_EXIT_STATUS\n print_error_status\n end\n end",
"title": ""
},
{
"docid": "95000c85927a5d96a67eff7b2754170c",
"score": "0.53826195",
"text": "def exit(code)\n %s(exit (callm code __get_raw))\n end",
"title": ""
},
{
"docid": "035ad694081d46621dd213056f861c41",
"score": "0.5376371",
"text": "def quit exit_code = 0, message = nil\n warn message if message\n exit exit_code\n end",
"title": ""
},
{
"docid": "3257ec113c54379c9eab83af50f967af",
"score": "0.53753024",
"text": "def exit_with(code = :unknown)\n code = ERROR_CODES[code.to_sym] || ERROR_CODES[:unknown]\n exit code\nend",
"title": ""
},
{
"docid": "829f25134f3ef6cc3ef5a3d22d4dbe15",
"score": "0.53648967",
"text": "def shell_out!(*args)\n # I don't actually use shell_out! in my definitions so this won't\n # cause a recursive loop.\n msys_shell_out!(*args)\n end",
"title": ""
},
{
"docid": "5921569cc2b4e9af420ea2acf5224c6f",
"score": "0.53602844",
"text": "def exit_with_msg( msg )\n print \"\\n\\n!ERROR! #{msg}!\\n\\nexit\\n\\n\"\n exit -1\nend",
"title": ""
},
{
"docid": "5921569cc2b4e9af420ea2acf5224c6f",
"score": "0.53602844",
"text": "def exit_with_msg( msg )\n print \"\\n\\n!ERROR! #{msg}!\\n\\nexit\\n\\n\"\n exit -1\nend",
"title": ""
},
{
"docid": "4b68fabf141c313af050b6aa2af794cc",
"score": "0.5342658",
"text": "def exit!(msg, err = -1)\n Process.exit err\n end",
"title": ""
},
{
"docid": "222d2de186f89274280915f35c639c70",
"score": "0.5342461",
"text": "def do_exit (v, code, msg)\n puts msg unless msg == nil\n if v == true\n exit 3\n else\n exit code\n end\nend",
"title": ""
},
{
"docid": "222d2de186f89274280915f35c639c70",
"score": "0.5342461",
"text": "def do_exit (v, code, msg)\n puts msg unless msg == nil\n if v == true\n exit 3\n else\n exit code\n end\nend",
"title": ""
},
{
"docid": "222d2de186f89274280915f35c639c70",
"score": "0.5342461",
"text": "def do_exit (v, code, msg)\n puts msg unless msg == nil\n if v == true\n exit 3\n else\n exit code\n end\nend",
"title": ""
},
{
"docid": "64edd44ba4f3a9016810ba6563fd28d5",
"score": "0.53374434",
"text": "def message_exit(msg)\n puts msg\n exit 3\nend",
"title": ""
},
{
"docid": "b0550bda11a089ad00032d0981147846",
"score": "0.53149736",
"text": "def run(args)\n if RbConfig::CONFIG['target_os'].start_with?('mingw')\n return @proc.commands['exit'].run(['exit', args])\n end\n unconditional =\n if args.size > 1 && args[-1] == 'unconditionally'\n args.shift\n true\n elsif args[0][-1] == '!'\n true\n else\n false\n end\n unless unconditional || confirm('Really quit?', false)\n msg('Quit not confirmed.')\n return\n end\n\n if (args.size > 1)\n if args[1] =~ /\\d+/\n exitrc = args[1].to_i;\n else\n errmsg \"Bad an Integer return type \\\"#{args[1]}\\\"\";\n return;\n end\n else\n exitrc = 0\n end\n # No graceful way to stop threads...\n @proc.finalize\n @proc.dbgr.intf[-1].finalize\n exit exitrc\n end",
"title": ""
},
{
"docid": "37e13f39049f30fc844158a390c12941",
"score": "0.5298874",
"text": "def error(msg = nil, code = nil)\n STDERR.puts(msg) if msg\n exit(code) if code\n end",
"title": ""
},
{
"docid": "03b1e4e059594e8440b07ce640c2a53e",
"score": "0.52953345",
"text": "def output_error_and_exit(message)\n Puppet.err(message)\n Puppet.err _(\"Rerun this command with '--debug' or '--help' for more information\")\n exit 1\n end",
"title": ""
},
{
"docid": "ad41791a4d00902f68c7b344cbc3ece0",
"score": "0.5291357",
"text": "def shellout!(*args)\n cmd = shellout(*args)\n cmd.error!\n cmd\n rescue Mixlib::ShellOut::ShellCommandFailed\n raise CommandFailed.new(cmd)\n rescue Mixlib::ShellOut::CommandTimeout\n raise CommandTimeout.new(cmd)\n end",
"title": ""
},
{
"docid": "9b8f17626903f9d0697395de378f0d56",
"score": "0.5290333",
"text": "def error(msg, exit_code=nil)\n $stderr.puts \"#{program_name}: #{msg}\"\n usage(exit_code)\nend",
"title": ""
},
{
"docid": "381f85f64f1b8e96d05c09eb5163e108",
"score": "0.5277985",
"text": "def exit_with(msg)\n say (msg)\n exit\nend",
"title": ""
},
{
"docid": "57280ab209b3eba4622194331e0cf88b",
"score": "0.5276106",
"text": "def print_usage_and_exit(exitcode=1)\n usage = <<EOU\nUsage: partybus ACTION\n\nActions:\n init Set the initial migration level\n infer Infer the current migration level\n upgrade Run through the pending upgrades\n help Print this help message\nEOU\n log(usage)\n exit(exitcode)\nend",
"title": ""
},
{
"docid": "1b8764b9154e27576cd54da7aebab9c9",
"score": "0.52539116",
"text": "def exit_on_failure cmd, exitcode=1, message=nil\n \"(#{cmd}) || (echo '#{message}' && exit #{exitcode});\"\n end",
"title": ""
},
{
"docid": "a9c2de7081aa1a12fc5438a5a9d9d011",
"score": "0.5253882",
"text": "def exit_code_msg() ; info[:exit_code_msg] ; end",
"title": ""
},
{
"docid": "3cac129f4996365665b76fd474465947",
"score": "0.523916",
"text": "def exit_now!(message,exit_code=1)\n raise CustomExit.new(message,exit_code)\n end",
"title": ""
},
{
"docid": "bc68bf37291efdc5c6c73b33b7a21066",
"score": "0.5235715",
"text": "def exit_with_error(err)\n puts err\n exit(1)\nend",
"title": ""
},
{
"docid": "c5057df667d27a268c8e0e2c08d7bfb1",
"score": "0.52330697",
"text": "def output_error_and_exit(message)\n Puppet.err(message)\n Puppet.err(\"Rerun this command with '--debug' or '--help' for more information\")\n exit 1\n end",
"title": ""
},
{
"docid": "7c81e9fe6db23a358f7f5e24d97420eb",
"score": "0.52318656",
"text": "def exit(code=0)\n Kernel.exit(code.to_i)\n end",
"title": ""
},
{
"docid": "ce20bd6b11b4e33b71d4ead0cdb1448f",
"score": "0.5230971",
"text": "def exit_code() ; info[:exit_code] ; end",
"title": ""
},
{
"docid": "afa2881b73dae85e3c0ccdb51afbc548",
"score": "0.5218037",
"text": "def fail(message=nil, code=1)\n STDERR.puts(message) if message\n exit code\nend",
"title": ""
},
{
"docid": "57106751e7e5f2dfbe2b30e07a11622a",
"score": "0.52172464",
"text": "def exit(args)\nend",
"title": ""
},
{
"docid": "57106751e7e5f2dfbe2b30e07a11622a",
"score": "0.52172464",
"text": "def exit(args)\nend",
"title": ""
},
{
"docid": "57106751e7e5f2dfbe2b30e07a11622a",
"score": "0.52172464",
"text": "def exit(args)\nend",
"title": ""
},
{
"docid": "57106751e7e5f2dfbe2b30e07a11622a",
"score": "0.52172464",
"text": "def exit(args)\nend",
"title": ""
},
{
"docid": "57106751e7e5f2dfbe2b30e07a11622a",
"score": "0.52172464",
"text": "def exit(args)\nend",
"title": ""
},
{
"docid": "57106751e7e5f2dfbe2b30e07a11622a",
"score": "0.52172464",
"text": "def exit(args)\nend",
"title": ""
},
{
"docid": "57106751e7e5f2dfbe2b30e07a11622a",
"score": "0.52172464",
"text": "def exit(args)\nend",
"title": ""
},
{
"docid": "298ccb549004a5c346fee0ff4a6c6602",
"score": "0.5216973",
"text": "def _run_and_output(*args, **kwargs)\n raise \"Ian needs to implement this in a subclass #{args} #{kwargs}\"\n end",
"title": ""
},
{
"docid": "25c9632202aad3987ffd18fdfdfed746",
"score": "0.5215874",
"text": "def do_at_exit(str1)\n at_exit { print str1 }\nend",
"title": ""
},
{
"docid": "d68ba9d050243b9dea62ba2d5103c54f",
"score": "0.5208148",
"text": "def do_exit code\n if @options[:verbose] == true\n exit(3)\n else\n exit(code)\n end\nend",
"title": ""
},
{
"docid": "d68ba9d050243b9dea62ba2d5103c54f",
"score": "0.5208148",
"text": "def do_exit code\n if @options[:verbose] == true\n exit(3)\n else\n exit(code)\n end\nend",
"title": ""
},
{
"docid": "14e5734ee33ce2ad06949109d4ba5963",
"score": "0.52044016",
"text": "def usage(exit_code=nil)\n $stderr.puts \"Usage: #{program_name} -h | [ -p port ] [ -t { rsa | dss } ] host [...]\"\n exit(exit_code) if exit_code\nend",
"title": ""
},
{
"docid": "b9ce7e260c9fe66fdc3cc1a62dabe469",
"score": "0.5186542",
"text": "def run_command(args = {})\n status, stdout, stderr = run_command_and_return_stdout_stderr(args)\n\n status\n end",
"title": ""
},
{
"docid": "4139ec44d4f54e26a6c50c524333f4b1",
"score": "0.51812494",
"text": "def err(message, exit_code = nil)\n case provide_format\n when :json\n $stderr.puts JSON.pretty_generate(\n error: message\n )\n else\n $stderr.puts message\n end\n\n exit(exit_code) unless exit_code.nil?\n end",
"title": ""
},
{
"docid": "cb12c53fa126ab3fa81a256976a5d096",
"score": "0.5177937",
"text": "def sh(*argv)\n shell.out(*argv)\n end",
"title": ""
},
{
"docid": "a9d442c9db62626ac21c5357920e21b5",
"score": "0.5176129",
"text": "def fail(msg, code=1)\n STDERR.puts msg\n exit code\nend",
"title": ""
},
{
"docid": "a9d442c9db62626ac21c5357920e21b5",
"score": "0.5176129",
"text": "def fail(msg, code=1)\n STDERR.puts msg\n exit code\nend",
"title": ""
},
{
"docid": "6f96e3639ae874fe69fa70e146936b65",
"score": "0.5167898",
"text": "def language_command_shell_out!(name, *command_args)\n send(:\"#{name}_shell_out\", *command_args).tap(&:error!)\n end",
"title": ""
},
{
"docid": "01c7ab87c62146863b453242ecf5feb4",
"score": "0.5159265",
"text": "def shellout!(*args)\n cmd = shellout(*args)\n cmd.error!\n cmd\n end",
"title": ""
},
{
"docid": "902b24e025e10f12ce4e90d368da6fb0",
"score": "0.5158153",
"text": "def error_show_usage_and_exit(message)\n $stderr.puts %[#{message}]\n $stderr.puts %[]\n\n show_usage\n \n exit 1\nend",
"title": ""
},
{
"docid": "ba5615ae75413c0b93146b1704f87f71",
"score": "0.51568943",
"text": "def raise_status(cmd, out, status)\n outmsg = out == '' ? '' : \" with stdout/stderr:\\n#{out}\"\n raise \"#{status.exitstatus} [#{cmd}] returned [#{status}]#{outmsg}\"\n end",
"title": ""
},
{
"docid": "dda302123b08e0b51c20066d0b6f6c10",
"score": "0.5148552",
"text": "def exit(code = 0)\n Context.exit(code)\n end",
"title": ""
},
{
"docid": "0c8603afcd441be3ca711739c09ba402",
"score": "0.51374125",
"text": "def execute(input: $stdin, output: $stdout)\n prompt = TTY::Prompt.new\n\n prompt.say('some cool message')\n prompt.say(Pastel.new.magenta('some cool message pink'))\n \n prompt.ok('OK OK OK')\n prompt.warn('Warning!')\n prompt.error('You really screwed up here')\n\n return :gui\n end",
"title": ""
},
{
"docid": "460eda1f511e5e2b27413bb0a142ae55",
"score": "0.5131131",
"text": "def error_exit_code=(_arg0); end",
"title": ""
},
{
"docid": "a3f207a71630674585d79b9380bf2331",
"score": "0.513094",
"text": "def exit_now!(exit_code,message=nil)\n raise Methadone::Error.new(exit_code,message)\n end",
"title": ""
},
{
"docid": "a3fe903603968fd3ed567dbecacd2e8b",
"score": "0.5125398",
"text": "def error(msg)\r\n STDERR.puts msg\r\n exit(1)\r\nend",
"title": ""
},
{
"docid": "2eb9833f85550fc607b971bc77eeb714",
"score": "0.5105281",
"text": "def printUsageAndExit(numOfArgs)\n puts(\"Expected 2 or 0 arguments but recieved #{numOfArgs}\")\n puts(\"To get the height of the world at the player\")\n puts(\"Usage: ruby script.rb\")\n puts(\"To get the height of the world at a specific coordinate\")\n puts(\"Usage: ruby script.rb x z\")\n puts(\"Example: ruby script.rb 10 15\")\n exit()\nend",
"title": ""
},
{
"docid": "29dd7a25cf2d02b7412bf80e263c2e2c",
"score": "0.51020074",
"text": "def safesystemout(*args)\n if args.size == 1\n args = [ ENV[\"SHELL\"], \"-c\", args[0] ]\n end\n program = args[0]\n\n if !program.include?(\"/\") and !program_in_path?(program)\n raise ExecutableNotFound.new(program)\n end\n\n @logger.debug(\"Running command\", :args => args)\n\n stdout_r, stdout_w = IO.pipe\n stderr_r, stderr_w = IO.pipe\n\n process = ChildProcess.build(*args)\n process.io.stdout = stdout_w\n process.io.stderr = stderr_w\n\n process.start\n stdout_w.close; stderr_w.close\n stdout_r_str = stdout_r.read\n stdout_r.close; stderr_r.close\n @logger.debug(\"Process is running\", :pid => process.pid)\n\n process.wait\n success = (process.exit_code == 0)\n\n if !success\n raise ProcessFailed.new(\"#{program} failed (exit code #{process.exit_code})\" \\\n \". Full command was:#{args.inspect}\")\n end\n\n return stdout_r_str\n end",
"title": ""
},
{
"docid": "16a1706adaf31a62f6be143b71e4e86c",
"score": "0.50967157",
"text": "def usage(s,c)\r\n\t$stderr.puts(s + getusage())\r\n\texit(c)\r\nend",
"title": ""
},
{
"docid": "ea5b8aae7b85e56b8b69f5f84d41924c",
"score": "0.5094271",
"text": "def say_goodbye(exit_code)\n puts \"\\n\\s\\sBreaktime says, \\\"Have a break, have an unbranded chocolate snack.\\\"\"\n exit exit_code\n end",
"title": ""
},
{
"docid": "2d1e3374d06208efd69191fd2818a613",
"score": "0.5093272",
"text": "def error(hn, ut)\n puts 0\n puts 0\n puts ut\n puts hn + \" Unknown Interface: #{interface}\"\n exit(1)\nend",
"title": ""
},
{
"docid": "33079e92f9740c4d3d5aa32d9a405d57",
"score": "0.50917757",
"text": "def quit(mess=nil,exitvalue=0)\n handle = exitvalue == 0 ? STDOUT : STDERR\n handle.puts MYNAME+': '+(exitvalue > 0? mess.err : mess) if mess\n exit(exitvalue)\nend",
"title": ""
},
{
"docid": "5786967ff87f721a202beb75b168dadb",
"score": "0.5089373",
"text": "def stdout=(_arg0); end",
"title": ""
},
{
"docid": "4d29495bc593ecffeab76cf841d16622",
"score": "0.5078241",
"text": "def usage(s,c)\n\t$stderr.puts(s + getusage())\n\texit(c)\nend",
"title": ""
},
{
"docid": "3a6fa8e6ea3cfe7bd4da02e69e532c3a",
"score": "0.50781536",
"text": "def run_and_output(*args, **kwargs)\n _wrap_run((proc { |*a, **k| _run_and_output(*a, **k) }), *args, **kwargs)\n end",
"title": ""
}
] |
934ddc016caadef4f73cbbe0006d6691
|
This challenge took me [.4] hours. Pseudocode Create a method to count each number on the array. Create an empty container to house the results. If the number is divisible by 15, call FIZZ BUZZ!!!! If a number is divisible by 3, call out Fizz! If a number is divisible by 5 then call out Buzz! Else return the number. Initial Solution def super_fizzbuzz(array) array.map! do |x| if x % 15 == 0 x = "FizzBuzz" elsif x % 3 == 0 x = "Fizz" elsif x % 5 == 0 x = "Buzz" else x end end end Refactored Solution
|
[
{
"docid": "5053d07ef5fc2181d1dded5f9dfa938c",
"score": "0.8468858",
"text": "def super_fizzbuzz(array)\n array.map! {|num| puts \"#{'Fizz' if num % 3 == 0}#{'Buzz' if num % 5 == 0}#{num if num % 5 != 0 && num % 3 != 0}\"}\nend",
"title": ""
}
] |
[
{
"docid": "97c7b4b49f2d2e38f8c0c3714971f371",
"score": "0.9032904",
"text": "def super_fizzbuzz(array)\n array.map! do |num|\n if (num % 3 == 0 && num % 5 == 0 && num % 15 == 0)\n \"FizzBuzz\"\n elsif (num % 3 == 0)\n \"Fizz\"\n elsif (num % 5 == 0)\n \"Buzz\"\n else\n num\n end\n end\n array\nend",
"title": ""
},
{
"docid": "597ad3c89a94d422fd56fa7b35d779ed",
"score": "0.88832325",
"text": "def super_fizzbuzz(array)\n\tarray.map do |num| #got rid of the ! that I had in the original solution. There's no need to alter the underlying array here.\n\t\tif num % 15 == 0\n\t\t\t\"FizzBuzz\"\n\t\telsif num % 5 == 0\n\t\t\t\"Buzz\"\n\t\telsif num % 3 == 0\n\t\t\t\"Fizz\"\n\t\telse\n\t\t\tnum\n\t\tend\n\tend\nend",
"title": ""
},
{
"docid": "b5c2532e83e1b0d5102416c8137c839c",
"score": "0.88820934",
"text": "def super_fizzbuzz(array)\n array.map! do |x|\n if x % 15 == 0\n \"FizzBuzz\"\n elsif x % 5 == 0\n \"Buzz\"\n elsif x % 3 == 0\n \"Fizz\"\n else\n x\n end\n end\nend",
"title": ""
},
{
"docid": "d11381e61a541a5ae42379972290e9f9",
"score": "0.883199",
"text": "def super_fizzbuzz(array)\n array.map {|x|\n if x % 15 == 0\n \"FizzBuzz\"\n elsif x % 3 == 0\n \"Fizz\"\n elsif x % 5 == 0\n \"Buzz\"\n else\n x\n end\n }\nend",
"title": ""
},
{
"docid": "af5b12d36b4e76f427b6273ea905a69f",
"score": "0.87782574",
"text": "def super_fizzbuzz(array)\n\tarray.map! do |num|\n\t\tif num % 15 == 0\n\t\t\t\"FizzBuzz\"\n\t\telsif num % 3 == 0\n\t\t\t\"Fizz\"\n\t\telsif num % 5 == 0\n\t\t\t\"Buzz\"\n\t\telse\n\t\t\tnum\n\t\tend\n\tend\nreturn array\t\t\nend",
"title": ""
},
{
"docid": "b34631c2a4af91481112ad56412c373d",
"score": "0.8750243",
"text": "def super_fizzbuzz(array)\nbuzz_array=[]\narray.map { |number| \n if number % 15 == 0\n \tbuzz_array << \"FizzBuzz\"\n elsif number % 3 == 0\n \tbuzz_array << \"Fizz\"\n elsif number % 5 == 0\n \tbuzz_array << \"Buzz\" \n else\n \tbuzz_array << number\n end\n}\nreturn buzz_array\nend",
"title": ""
},
{
"docid": "5b244a9f39d8e82261ee568ac16c2dec",
"score": "0.8745403",
"text": "def super_fizzbuzz(array)\n array.map do |num|\n if num % 15 == 0\n num = 'FizzBuzz'\n elsif num % 5 == 0\n num = 'Buzz'\n elsif num % 3 == 0\n num = 'Fizz'\n else\n num\n end\n end\nend",
"title": ""
},
{
"docid": "307a19d880c4c72ae36ad69606283f54",
"score": "0.8738702",
"text": "def super_fizzbuzz(array)\n array.map do |i| \n if i % 15 == 0 then 'FizzBuzz'\n elsif i % 3 == 0 then 'Fizz' \n elsif i % 5 == 0 then 'Buzz'\n else i\n end\n end\nend",
"title": ""
},
{
"docid": "76d9b077f75401bf98e6c9357e1952d2",
"score": "0.872392",
"text": "def super_fizzbuzz(array)\n array.map! do |x|\n if x % 3 == 0 \n x = \"Fizz\"\n elsif x % 5 == 0 \n x = \"Buzz\"\n elsif x % 15 == 0 \n x = \"FizzBuzz\"\n else x % 3 == 0 || x % 5 == 0 || x % 15 == 0\n p x\n end\n end\nend",
"title": ""
},
{
"docid": "c72aef40180a6bd1ef2b98b22232a517",
"score": "0.87165487",
"text": "def super_fizzbuzz(array)\n array.map! do |num|\n num =\n \t\tif (num % 3 == 0 && num % 5 == 0)\n \t \"FizzBuzz\"\n \t\telsif (num % 3 == 0)\n \t\"Fizz\"\n \telsif (num % 5 == 0)\n \t\"Buzz\"\n \telse \n \tnum\n \tend\n \tend\n p array\nend",
"title": ""
},
{
"docid": "8e07528fd3970c0ba3befe90e84f5efa",
"score": "0.87079275",
"text": "def super_fizzbuzz(array)\n array.map! do |x| \n if x % 3 == 0 && x % 5 != 0\n x = \"Fizz\"\n elsif x % 5 == 0 && x % 3 != 0\n x = \"Buzz\"\n elsif x % 15 == 0\n x = \"FizzBuzz\"\n else x = x\n end\n end\nend",
"title": ""
},
{
"docid": "28f383f4d6b72d07b501c55013388838",
"score": "0.8687465",
"text": "def super_fizzbuzz(array)\n array.map do |num|\n if (num % 15 == 0)\n num = \"FizzBuzz\"\n elsif (num % 3 == 0)\n num = \"Fizz\"\n elsif (num % 5 == 0)\n num = \"Buzz\"\n else\n num\n end\n end\nend",
"title": ""
},
{
"docid": "63190169562f520299be09e463e270d4",
"score": "0.86780286",
"text": "def super_fizzbuzz(array)\n # Your code goes here!\n array.map do |x|\n if x % 15 == 0 \n \"FizzBuzz\"\n elsif\n x % 3 == 0\n \"Fizz\"\n elsif \n x % 5 == 0\n \"Buzz\"\n else\n x \n end\n end\nend",
"title": ""
},
{
"docid": "427bc96437b9037d9afd5993b6c44f9e",
"score": "0.8675796",
"text": "def super_fizzbuzz(array)\n\tarray.map! do |num|\n\t\tif num % 15 == 0\n\t\t\tnum = 'FizzBuzz'\n\t\telsif num % 5 == 0\n\t\t\tnum = 'Buzz'\n\t\telsif num % 3 == 0\n\t\t\tnum = 'Fizz'\n\t\telse num\n\t\tend\n\tend\n\tp array\nend",
"title": ""
},
{
"docid": "fde32cb7fbdde740b9e358b17565bc5b",
"score": "0.86610603",
"text": "def super_fizzbuzz(array)\n array.map do |i|\n if i%15 == 0\n i = 'FizzBuzz'\n elsif i%5 == 0\n i = 'Buzz'\n elsif i%3 == 0\n i = 'Fizz'\n else \n i\n end\n end\nend",
"title": ""
},
{
"docid": "72c32a5944913adfa4f59470f18632fb",
"score": "0.8651574",
"text": "def super_fizzbuzz(array)\n array.map do |number|\n if number % 15 == 0\n number = \"FizzBuzz\"\n elsif number % 3 == 0\n number = \"Fizz\" \n elsif number % 5 == 0\n number = \"Buzz\"\n else\n number = number\n end \n end\nend",
"title": ""
},
{
"docid": "0a116b9dffdafd4d2abfa013f8c79354",
"score": "0.8643174",
"text": "def super_fizzbuzz(array)\n array.map! do |x|\n if x % 3 == 0 && x % 5 != 0\n x = \"Fizz\"\n elsif x % 3 != 0 && x % 5 == 0\n x = \"Buzz\"\n elsif x % 3 == 0 && x % 5 == 0\n x = \"FizzBuzz\"\n else\n x\n end\n end\n p array\nend",
"title": ""
},
{
"docid": "ca5a2dc0cc6cf65df961ac474bc590b5",
"score": "0.86341524",
"text": "def super_fizzbuzz (array)\n array.map do |num|\n if num % 15 == 0 then num = \"FizzBuzz\"\n elsif num % 3 == 0 then num = \"Fizz\"\n elsif num % 5 == 0 then num = \"Buzz\"\n else num = num\n end\n end\nend",
"title": ""
},
{
"docid": "3a206551fb8f8dc1c098cb54953d5bd6",
"score": "0.86337",
"text": "def super_fizzbuzz(array)\n\narray.map! { |element| \n if(element % 15 == 0) \n \"FizzBuzz\" \n elsif (element % 3 == 0) \n \"Fizz\" \n elsif (element % 5 == 0) \n \"Buzz\" \n else \n element \n end\n}\n\np array\n\nend",
"title": ""
},
{
"docid": "dd7e6ace5ea81289d39c8ae42b551dc6",
"score": "0.8632518",
"text": "def super_fizzbuzz(array)\n\n array.map do |number|\n \n case\n when number % 15 === 0 then 'FizzBuzz'\n when number % 3 === 0 then 'Fizz'\n when number % 5 === 0 then 'Buzz'\n else number\n end\n end\n\nend",
"title": ""
},
{
"docid": "50d43f0e2640b9ea7cd81e11a6e2f27e",
"score": "0.8627002",
"text": "def super_fizzbuzz(array)\n\tarray.collect do |i|\n \tif i % 15 == 0\n \t\t\"FizzBuzz\"\n \telsif i % 5 == 0\n \t\t\"Buzz\"\n \telsif i % 3 == 0\n \t\t\"Fizz\"\n \telse\n \t\ti\n \tend\n \tend\nend",
"title": ""
},
{
"docid": "7a15a0733e08b169c69c42ad7099cec1",
"score": "0.8624489",
"text": "def super_fizzbuzz(array)\n array.map do |x|\n if (x % 15 ==0)\n x = \"FizzBuzz\"\n elsif (x % 5 ==0)\n x = \"Buzz\"\n elsif (x % 3 ==0)\n x = \"Fizz\"\n else\n x\n end\n end\nend",
"title": ""
},
{
"docid": "ed80901a94e0002d25439cc7fb34aca8",
"score": "0.85996664",
"text": "def super_fizzbuzz(array)\n fizz_ary = array\n\n fizz_ary.map! { |x|\n if x % 15 == 0\n x = \"FizzBuzz\"\n elsif x % 5 == 0\n x = \"Buzz\"\n elsif x % 3 == 0\n x = \"Fizz\"\n else\n x\n end }\n fizz_ary\nend",
"title": ""
},
{
"docid": "7ed43d7e40a053f37985aa6124bf46dc",
"score": "0.85969377",
"text": "def super_fizzbuzz(array)\n array.map! { |num|\n if num % 3 == 0 && num % 5 == 0\n num = \"FizzBuzz\"\n elsif num % 3 == 0\n num = \"Fizz\"\n elsif num % 5 == 0\n num = \"Buzz\"\n else\n num\n end\n }\n array\nend",
"title": ""
},
{
"docid": "c1c5ba58799b169d3c9625849d5667eb",
"score": "0.8594646",
"text": "def super_fizzbuzz(array)\n array.map do |value|\n if (value % 3 == 0 && value % 5 == 0)\n 'FizzBuzz'\n elsif (value % 3 == 0)\n 'Fizz'\n elsif (value % 5 == 0)\n 'Buzz'\n else\n value\n end\n end\nend",
"title": ""
},
{
"docid": "1d429c835786e1a160c7a164932aaf9f",
"score": "0.857648",
"text": "def super_fizzbuzz(array)\n array.map do |x|\n if x % 15 ==0\n x = \"FizzBuzz\"\n elsif x % 5 == 0\n x = \"Buzz\"\n elsif x % 3 == 0\n x = \"Fizz\"\n else\n x = x\n end\n end\n\nend",
"title": ""
},
{
"docid": "6a2781c190a9a4359523c3dbe48657d7",
"score": "0.85612065",
"text": "def super_fizbuzz(array)\n array.map! do |value|\n if value % 15 == 0\n value = \"FizzBuzz\"\n elsif value % 5 == 0\n value = \"Buzz\"\n elsif value % 3 == 0\n value = \"Fizz\"\n else\n value\n end\n end\n p array\nend",
"title": ""
},
{
"docid": "ea03f337ba04ab8ff49f9ccd3b01d8ef",
"score": "0.85293084",
"text": "def super_fizzbuzz(array)\n\tarray.map do |x|\n\t\tif (x % 15 == 0)\n\t\t\tx = \"FizzBuzz\"\n\t\telsif (x % 5 == 0)\n\t\t\tx = \"Buzz\"\n\t\telsif (x % 3 == 0)\n\t\t\tx = \"Fizz\"\n\t\telse \n\t\t\tx\n\t\tend\n\tend\nend",
"title": ""
},
{
"docid": "d75ed35c7d1effc8beeb448c9e4efb45",
"score": "0.8477742",
"text": "def super_fizzbuzz(array)\n array.map! do |element|\n if element % 15 == 0\n element = \"FizzBuzz\"\n elsif element % 5 == 0\n element = \"Buzz\"\n elsif element % 3 == 0\n element = \"Fizz\"\n else\n element = element\n end\n end\nend",
"title": ""
},
{
"docid": "b3444b6cd1c4f68365ccdd3a934986de",
"score": "0.84773856",
"text": "def super_fizzbuzz(array)\n array.map! {|variable|\n if variable % 15 == 0\n variable = \"FizzBuzz\"\n elsif variable % 5 == 0\n variable = \"Buzz\"\n elsif variable % 3 == 0\n variable = \"Fizz\"\n else\n variable = variable\n end\n }\n\n return array\n\nend",
"title": ""
},
{
"docid": "8a645022fe413ad74afb7d24a81bd7bd",
"score": "0.8470052",
"text": "def super_fizzbuzz(array)\n\narray.map! do |e|\n if e % 15 == 0\n e = \"FizzBuzz\"\n elsif e % 3 == 0\n e = \"Fizz\"\n elsif e % 5 == 0\n e = \"Buzz\"\n else\n e\n end\n end\np array\n\nend",
"title": ""
},
{
"docid": "75a7feea976becc8bc22e30259d9b8cf",
"score": "0.84471864",
"text": "def super_fizzbuzz(array)\r\n\r\n\treturn array.map do |number|\r\n\t\tif number % 3 == 0 && number % 5 == 0\r\n\t\t\tnumber = \"FizzBuzz\"\r\n\t\telsif number % 3 == 0 \r\n\t\t\tnumber = \"Fizz\"\r\n\t\telsif number % 5 == 0\r\n\t\t\tnumber = \"Buzz\"\r\n\t\telse\r\n\t\t\tnumber = number\r\n\t\tend\r\n\tend\r\n\r\nend",
"title": ""
},
{
"docid": "890fdcccd297ea7ab17120dcc3c02736",
"score": "0.8435094",
"text": "def super_fizzbuzz(array)\n\tarray.map.with_index do |num, index|\n\t\tif array[index] % 15 == 0\n\t\t\tarray[index] = \"FizzBuzz\"\n\t\telsif array[index] % 3 == 0\n\t\t\tarray[index] = \"Fizz\"\n\t\telsif array[index] % 5 == 0\n\t\t\tarray[index] = \"Buzz\"\n\t\tend\n\tend\n\treturn array\nend",
"title": ""
},
{
"docid": "8c9e38041f3240e898cf7849033ef40a",
"score": "0.8427798",
"text": "def super_fizzbuzz(array)\n array.map do |x|\n if x % 15 == 0\n x = x.to_s.replace(\"FizzBuzz\")\n elsif x % 5 == 0\n x = x.to_s.replace(\"Buzz\")\n elsif x % 3 == 0\n x = x.to_s.replace(\"Fizz\")\n else\n x = x\n end\nend\nend",
"title": ""
},
{
"docid": "6b1268484e88459dff88ea60ada292c0",
"score": "0.8371877",
"text": "def super_fizzbuzz(array)\n fb_arr = []\n array.map do |digit|\n case\n when digit % 15 == 0\n fb_arr.push(\"FizzBuzz\")\n when digit % 3 == 0\n fb_arr.push(\"Fizz\")\n when digit % 5 == 0\n fb_arr.push(\"Buzz\")\n else\n fb_arr.push(digit)\n end #end case\n end #end iterator\n return fb_arr\nend",
"title": ""
},
{
"docid": "9e0ef594a69e037135657b3497a43f4a",
"score": "0.835425",
"text": "def fizzbuzz\n (1..100).map do |i|\n\tif (i % 15).zero?\n\t 'FizzBuzz'\n\telsif (i % 3).zero?\n\t 'Fizz'\n\telsif (i % 5).zero?\n\t 'Buzz'\n\telse\n\t i\n\tend\n end\nend",
"title": ""
},
{
"docid": "983d1118bdc0af00f13a64d418dc10b9",
"score": "0.83136046",
"text": "def super_fizzbuzz(array)\n\tarray.map! {|i|\n\t\tif i % 3 == 0 && i % 5 == 0\n\t\t\ti = \"FizzBuzz\"\n\t\telsif i % 3 == 0\n\t\t\ti = \"Fizz\"\n\t\telsif i % 5 == 0\n\t\t\ti = \"Buzz\"\n\t\telse i = i\n\t\tend\n\t\t}\t\t\n\treturn array\nend",
"title": ""
},
{
"docid": "49d1e62cc34d3c9011e08415a36d1a17",
"score": "0.83024275",
"text": "def super_fizzbuzz(array)\n array.map do |element|\n if (element % 3 == 0 && element % 5 == 0)\n element = \"FizzBuzz\"\n elsif (element % 3 == 0)\n element = \"Fizz\"\n elsif (element % 5 == 0)\n element = \"Buzz\"\n else\n element\n end\n end \nend",
"title": ""
},
{
"docid": "d1298e2ec8585856a321e0a011f5da74",
"score": "0.82985175",
"text": "def fizz_buzz\n [*1..100].map do |num|\n if num % 5 == 0 && num % 3 == 0\n 'FizzBuzz'\n elsif num % 5 == 0\n 'Buzz'\n elsif num % 3 == 0\n 'Fizz'\n else\n num\n end\n end\nend",
"title": ""
},
{
"docid": "bee5acc9f833ba3dd27b0449e348caaa",
"score": "0.8284855",
"text": "def super_fizzbuzz(array)\n\n if !(array.is_a? Array)\n raise Argumenterror, \"That is not a valid array\"\n end\n\n result = array.map do |x|\n if (x % 5 == 0) && (x % 3 == 0)\n x = \"FizzBuzz\"\n elsif (x % 5 == 0)\n x = \"Buzz\"\n elsif (x % 3 == 0)\n x = \"Fizz\"\n else\n x = x\n end\n end\n\n return result\n\nend",
"title": ""
},
{
"docid": "249243cd71ce7c15b1f4ce7f04cf266a",
"score": "0.82839",
"text": "def super_fizzbuzz(array)\n\tnew_array = []\n\tarray.each do |num| \n\t\tif num % 15 == 0\n\t\t\tnew_array << \"FizzBuzz\"\n\t\telsif num % 3 == 0\n\t\t\tnew_array << \"Fizz\"\n\t\telsif num % 5 == 0\n\t\t\tnew_array << \"Buzz\"\n\t\telse \n\t\t\tnew_array << num\n\t\tend\n\tend\n\tnew_array\nend",
"title": ""
},
{
"docid": "50e4dffd5e23bcb49cbad9aa5fa155c9",
"score": "0.8244791",
"text": "def fizzbuzz(n)\n array = (1..n).to_a\n answer = []\n for i in array do\n if (i % 15 == 0)\n answer.push('FizzBuzz')\n elsif (i % 3 == 0)\n answer.push('Fizz')\n elsif (i % 5 == 0)\n answer.push('Buzz')\n else \n answer.push(i)\n end\n end\n answer\nend",
"title": ""
},
{
"docid": "faa390dc778516e0ae4f88e7081d37bc",
"score": "0.8241431",
"text": "def super_fizzbuzz(array)\n buzz_array = []\n array.each do |x|\n if x % 3 == 0 && x % 5 != 0\n buzz_array.push(\"Fizz\")\n elsif x % 3 != 0 && x % 5 == 0\n buzz_array.push(\"Buzz\")\n elsif x % 3 == 0 && x % 5 == 0\n buzz_array.push(\"FizzBuzz\")\n else\n buzz_array.push(x)\n end\n end\n p buzz_array\nend",
"title": ""
},
{
"docid": "b97453d65500e3115e421621f0e05dd3",
"score": "0.82260275",
"text": "def super_fizzbuzz(array)\narray.map!{|item|\n if item % 3 == 0 && item % 5 == 0\n item = \"FizzBuzz\"\n elsif item % 3 == 0\n item = \"Fizz\"\n elsif item % 5 == 0\n item = \"Buzz\"\n else item = item\n end\n}\n\nend",
"title": ""
},
{
"docid": "aa9b3fd4cc35af16370dd5a79194fa2b",
"score": "0.82254267",
"text": "def fizzbuzz(array)\n\tfor num in array\n\t\tif num % 15 == 0\n\t\t\tputs \"fizzbuzz\"\n\t\telsif num % 3 == 0\n\t\t\tputs \"fizz\"\n\t\telsif num % 5 == 0\n\t\t\tputs \"buzz\"\n\t\telse \n\t\t\tputs num.to_s\n\t\tend\n\tend\nend",
"title": ""
},
{
"docid": "f66811f2146c7fe41280b1bef6ef64e6",
"score": "0.82221675",
"text": "def super_fizzbuzz(array)\n new_array = []\n array.each do |i|\n if i % 15 == 0\n new_array << \"FizzBuzz\"\n elsif i % 3 == 0\n new_array << \"Fizz\"\n elsif i % 5 == 0\n new_array << \"Buzz\"\n else\n new_array << i\n end\n end\n\nreturn new_array\nend",
"title": ""
},
{
"docid": "f66811f2146c7fe41280b1bef6ef64e6",
"score": "0.82221675",
"text": "def super_fizzbuzz(array)\n new_array = []\n array.each do |i|\n if i % 15 == 0\n new_array << \"FizzBuzz\"\n elsif i % 3 == 0\n new_array << \"Fizz\"\n elsif i % 5 == 0\n new_array << \"Buzz\"\n else\n new_array << i\n end\n end\n\nreturn new_array\nend",
"title": ""
},
{
"docid": "8266473f7a02069cae968ae7d9623f43",
"score": "0.82032025",
"text": "def super_fizzbuzz(array)\n fizzy=[]\n\tarray.each do |x| \n\t if x%3==0 && x%5==0\n\t\t fizzy << \"FizzBuzz\"\n\t elsif x%5==0\n\t\t fizzy << \"Buzz\"\n\t elsif x%3==0\n\t\t fizzy << \"Fizz\"\n\t else\n\t\t fizzy << x\n\t end\n\tend\nreturn fizzy\nend",
"title": ""
},
{
"docid": "6430890f8a9d3b3c16cc3082920d7d31",
"score": "0.8201198",
"text": "def super_fizzbuzz(array)\n\tfizzbuzzed_array = []\n\tarray.each do |element|\n\t\tif element % 15 == 0\n\t\t\tfizzbuzzed_array << \"FizzBuzz\"\n\t\telsif element % 3 == 0\n\t\t\tfizzbuzzed_array << \"Fizz\"\n\t\telsif element % 5 == 0\n\t\t\tfizzbuzzed_array << \"Buzz\"\n\t\telse\n\t\t\tfizzbuzzed_array << element\n\t\tend\n\tend\n\tfizzbuzzed_array\nend",
"title": ""
},
{
"docid": "7eb19591c015777a0a2137473168453d",
"score": "0.81853294",
"text": "def super_fizzbuzz(array)\n\tnew_arr = []\n\tarray.each do |x|\n\t\tif x % 3 == 0 && x % 5 == 0\n\t\t\tnew_arr << \"FizzBuzz\"\n\t\telsif x % 5 == 0\n\t\t\tnew_arr << \"Buzz\"\n\t\telsif x % 3 == 0\n\t\t\tnew_arr << \"Fizz\"\n\t\telse\n\t\t\tnew_arr << x\n\t\tend\n\tend\n\treturn new_arr\n\nend",
"title": ""
},
{
"docid": "9e3f1b7e4b49d6923ff549a1bfdece30",
"score": "0.8172652",
"text": "def super_fizzbuzz(array)\n new_array = []\n array.each do |x|\n if x % 3 == 0 && x % 5 == 0\n new_array << \"FizzBuzz\"\n elsif x % 3 == 0\n new_array << \"Fizz\"\n elsif x % 5 == 0\n new_array << \"Buzz\"\n else\n new_array << x\n end\n end\n new_array\nend",
"title": ""
},
{
"docid": "a4a673e09ba3cd4f9318bd349fa18399",
"score": "0.8131285",
"text": "def super_fizzbuzz(array)\n fizzbuzz_array = []\n counter = 0\n while counter < array.length\n if array[counter] % 3 == 0 && array[counter] % 5 != 0\n fizzbuzz_array << \"Fizz\"\n elsif array[counter] % 5 == 0 && array[counter] % 3 != 0\n fizzbuzz_array << \"Buzz\"\n elsif array[counter] % 3 == 0 && array[counter] % 5 == 0\n fizzbuzz_array << \"FizzBuzz\"\n else\n fizzbuzz_array << array[counter]\n end\n counter += 1\n end\n p fizzbuzz_array\nend",
"title": ""
},
{
"docid": "274f3f55e7131fdc2e713dafff7c4ebb",
"score": "0.81223464",
"text": "def fizzbuzz(n)\n (1..n).map do |num|\n if num % 3 == 0 && num % 5 == 0\n 'FizzBuzz'\n elsif num % 3 == 0\n 'Fizz'\n elsif num % 5 == 0\n 'Buzz'\n else\n num\n end\n end\nend",
"title": ""
},
{
"docid": "3044aac99dd420c5082744c2954a0317",
"score": "0.81064093",
"text": "def fizzbuzz(num1, num2)\n array = (num1..num2).to_a\n fizzbuzz = array.map do |n|\n if n % 3 == 0 && n % 5 == 0\n 'FizzBuzz'\n elsif n % 5 == 0\n 'Buzz'\n elsif n % 3 == 0\n 'Fizz'\n else \n n\n end\n end\n fizzbuzz.join(' ')\nend",
"title": ""
},
{
"docid": "28770fe4c4acfe11fdb9e1442f54107d",
"score": "0.8104703",
"text": "def fizzbuzz(n)\n numbers = (1..n).to_a\n numbers.map do |num|\n if (num % 15 == 0)\n \"FizzBuzz\"\n elsif (num % 5 == 0)\n \"Buzz\"\n elsif (num % 3 == 0)\n \"Fizz\"\n else num\n end\n end\n end",
"title": ""
},
{
"docid": "be2bffbf54f077ca77c8fee75b6d5a31",
"score": "0.8088765",
"text": "def super_fizzbuzz(array)\n\t# this iterator will keep track of the location of the current element\n\ti = 0 \n\n\t# go through each item in the array\n\tarray.each do |x| \n\t\t# see if it is divisible by 3 \t\t\n\t\tif (x % 3 == 0)\n\t\t\t# see if it is divisible by 15\n\t\t\tif (x % 15 == 0)\n\t\t\t\tarray[i] = \"FizzBuzz\"\n\t\t\telse\n\t\t\t\tarray[i] = \"Fizz\"\n\t\t\tend\n\t\t# if no divisible by 3, see if \n\t\t# divisible by 5\n\t\telsif (x % 5 == 0)\n\t\t\tarray[i] = \"Buzz\" \t\t\n\t\tend\n\n\t\ti +=1\n\tend \nend",
"title": ""
},
{
"docid": "6e79628a8aa8fba4d0bceaabf736ea7c",
"score": "0.80623955",
"text": "def fizzbuzz(arr)\n arr.map do |num|\n # binding.pry\n if num % 5 == 0 && num % 3 == 0\n 'FizzBuzz'\n elsif num % 5 == 0\n 'Buzz'\n elsif num % 3 == 0\n 'Fizz'\n else\n num\n end\n end\nend",
"title": ""
},
{
"docid": "ce19edaa3318a394d6ba5b98857dab57",
"score": "0.80370706",
"text": "def fizzbuzz(n)\n (1..n).map do |n|\n if n%3==0 && n%5==0\n \"fizzbuzz\"\n elsif n%3==0\n \"fizz\"\n elsif n%5==0\n \"buzz\"\n else\n n\n end\n end\nend",
"title": ""
},
{
"docid": "92c4ba7162b9804739cd1477f2069930",
"score": "0.80361426",
"text": "def super_fizzbuzz(array)\n\tarray = [1..100]\n\tarray.each do |num|\n\t\tif num % 3 == 0 \n\t\t\tprint \"Fizz\"\n\t\tend \n\t\tif num % 5 == 0 \n\t\t\tprint \"Buzz\"\n\t\tend \n\t\tif num % 15 == 0 \n\t\t\tprint \"FizzBuzz\"\n\t\tend \n\tend \nend",
"title": ""
},
{
"docid": "ffe6b2128bc37832b62fe89081e257a8",
"score": "0.80098474",
"text": "def fizzbuzz(n)\n array = []\n (1..n).each do |num|\n if num % 15 == 0\n array << \"fizzbuzz\"\n elsif num % 3 == 0\n array << \"fizz\"\n elsif num % 5 == 0\n array << \"buzz\"\n else\n array << num\n end\n end\n return array\nend",
"title": ""
},
{
"docid": "45b92a1827245c1300003fd6e0c52ce3",
"score": "0.7946093",
"text": "def super_fizzbuzz(array)\n\ti = 0\n\tarray.each do |num|\n\t\t\tarray[i] = \"Fizz\" if num % 3 == 0 && num % 5 != 0\n\t\t array[i] = \"Buzz\" if num % 5 == 0 && num % 3 != 0\n\t\t\tarray[i] = \"FizzBuzz\" if num % 3 == 0 && num % 5 == 0\n\t\t\ti += 1\n\t end\nend",
"title": ""
},
{
"docid": "717834bebdd236ca9ca24ac7de6d24d6",
"score": "0.79255974",
"text": "def fizzbuzz\narray = []\n\tfor i in 1..100\n\t\tif i%3 == 0 && i%5 == 0\n\t\t\tarray << 'FizzBuzz'\n\t\telsif i%3 == 0\n\t\t\tarray << 'Fizz'\n\t\telsif i%5 == 0 \n\t\t\tarray << 'Buzz'\n\t\telse\n\t\t\tarray << i\n \t\t\ti+= 1\n\t\tend\n\tend\n\t\t\treturn array\nend",
"title": ""
},
{
"docid": "98c4d505e54b50fbd7df33d70aa6ae94",
"score": "0.79116535",
"text": "def fizzbuzz(n)\n range = [*1..n]\n range.map! do |num|\n if num % 3 == 0 && num % 5 == 0\n num = \"fizzbuzz\"\n elsif num % 5 == 0\n num = \"buzz\"\n elsif num % 3 == 0\n num = \"fizz\"\n else\n num\n end\n end\nend",
"title": ""
},
{
"docid": "2ae81983b7acdafa324804fe581d84ca",
"score": "0.7907124",
"text": "def super_fizzbuzz(array)\ni=0\nwhile i < array.length\n if array[i]%5==0 && array[i]%3==0\n array[i]= 'FizzBuzz'\n elsif array[i]%3==0\n array[i]= 'Fizz'\n elsif array[i]%5==0\n array[i]= 'Buzz'\n end\ni+=1\nend\np array\nend",
"title": ""
},
{
"docid": "ef3d09145260f78b3682ed1f14170d30",
"score": "0.78931427",
"text": "def fizz_buzz_check\n @numbers.collect do |x|\n if multiple_of(15, x)\n 'FizzBuzz'\n elsif multiple_of(3, x)\n 'Fizz'\n elsif multiple_of(5, x)\n 'Buzz'\n else\n x\n end\n end\n end",
"title": ""
},
{
"docid": "2fab8eb3cc4291ff4e980d50183f6fcb",
"score": "0.7867629",
"text": "def super_fizzbuzz(array)\n length = array.length\n # print length\n i = 0\n while i < length\n if (array[i] % 3 == 0 && array[i] % 5 != 0)\n array[i] = \"Fizz\"\n elsif (array[i] % 5 == 0) && (array[i] % 3 != 0)\n array[i] = \"Buzz\"\n elsif (array[i] % 3 == 0) && (array[i] % 5 == 0)\n array[i] = \"FizzBuzz\"\n\n end\n i += 1\n end\n\n return array\n\nend",
"title": ""
},
{
"docid": "349518c61c8b596f9b9bd49ce1d3a35a",
"score": "0.78541535",
"text": "def fizzbuzz\n zz_array = []\n 1.upto(100) do |num|\n if num % 3 == 0 && num % 5 == 0\n zz_array << 'FizzBuzz'\n elsif num % 3 == 0\n zz_array << 'Fizz'\n elsif num % 5 == 0\n zz_array << 'Buzz'\n else\n zz_array << num\n end\n end\n return zz_array\nend",
"title": ""
},
{
"docid": "eeb70bca432472e4195987205b1a0915",
"score": "0.7847522",
"text": "def fizzbuzz(start, last)\n array = (start..last).map do |num|\n if (num % 3 == 0 && num % 5 == 0)\n 'FizzBuzz'\n elsif (num % 3 == 0)\n 'Fizz'\n elsif (num % 5 == 0)\n 'Buzz'\n else\n num.to_s \n end\n end\n puts array.join(', ')\nend",
"title": ""
},
{
"docid": "19a998258c99fb3d8dc494d3d58cf644",
"score": "0.784469",
"text": "def fizzbuzz(num1, num2)\n arr = Array(num1..num2).map! do |num|\n if num % 3 == 0 && num % 5 == 0\n 'FizzBuzz'\n elsif num % 3 == 0\n 'Fizz'\n elsif num % 5 == 0\n 'Buzz'\n else\n num\n end\n end.join(', ')\n print arr\nend",
"title": ""
},
{
"docid": "701ea671c53fd3d60d57305436944664",
"score": "0.784412",
"text": "def fizzbuzz\n\tnum_arr = Array.new(100) {|index| index+1}\n\tarr = Array.new(100) {''}\n\tnum_arr.each do |i|\n\n\t \tif i%3 == 0\n\t \t\tif i%5 == 0\n\t \t\t\tarr[i-1] = 'FizzBuzz'\n\t \t\telse\n\t \t\t\tarr[i-1] = 'Fizz'\n\t \t\tend\n\t \telsif i%5 == 0\n\t \t\tarr[i-1] = 'Buzz'\n\t \telse\n\t \t\tarr[i-1] = i.to_s\n\t \tend\n\t end\n \tarr\nend",
"title": ""
},
{
"docid": "578d93a370af3bcbb0f03496e2088038",
"score": "0.7833201",
"text": "def fizzbuzz\n # TODO write your code here\n fizz_array = []\n\n for count in 1..100\n if (count%3 == 0 && count%5 == 0)\n fizz_array[count] = 'FizzBuzz'\n elsif count%3 == 0\n fizz_array[count] = 'Fizz'\n elsif count%5 == 0\n fizz_array[count] = 'Buzz'\n else\n fizz_array[count] = count\n end\n end\n\n fizz_array\nend",
"title": ""
},
{
"docid": "e86b661bcd2656861d880230db9b0798",
"score": "0.78240657",
"text": "def fizzbuzz(n)\n\t(1..n).map do |n|\n\t\tif n % 15 == 0\n\t\t\t\"fizzbuzz\"\n\t\telsif n % 3 == 0\n\t\t\t\"fizz\"\n\t\telsif n % 5 == 0\n\t\t\t\"buzz\"\n\t\telse\n\t\t\tn\n\t\tend\n\tend\nend",
"title": ""
},
{
"docid": "bc08edf594bb0ee39ae42b862073ec94",
"score": "0.7799393",
"text": "def fizzbuzz(n)\n output_arr = []\n\n (1..n).each do |num|\n if num % 5 == 0 && num % 3 == 0\n output_arr << 'fizzbuzz'\n elsif num % 5 == 0\n output_arr << 'buzz'\n elsif num % 3 == 0\n output_arr << 'fizz'\n else\n output_arr << num\n end\n end\n\n output_arr\nend",
"title": ""
},
{
"docid": "9c93a646552e9addea8c7105943c2871",
"score": "0.77478075",
"text": "def fizzbuzz\n fizzBuzzArray = Array.new\n for num in 1..100\n if num.to_f / 3.to_f == num/3 && num.to_f / 5.to_f == num/5 then\n\tfizzBuzzArray << 'FizzBuzz'\n elsif num.to_f / 3.to_f == num/3 then\n\tfizzBuzzArray << 'Fizz'\n elsif num.to_f / 5.to_f == num/5 then\n\tfizzBuzzArray << 'Buzz'\n else\n fizzBuzzArray << num\n end\n end\n fizzBuzzArray\nend",
"title": ""
},
{
"docid": "599e016a5c86448dd0806fe79c7d000d",
"score": "0.7741599",
"text": "def fizzbuzz\n\tcount = 0\n\tan_array = []\n\twhile count <100\n\t\tan_array[count] = count\n\t\tif count%5 == 0\n\t\t\tan_array[count] = 'Buzz'\n\t\tend\n\t\tif count%3 == 0\n\t\t\tif count%5 == 0\n\t\t\t\tan_array[count] = 'FizzBuzz'\n\t\t\telse\n\t\t\t\tan_array[count] = 'Fizz'\n\t\t\tend\n\t\tend\n\t\tcount +=1\n\tend\n\treturn an_array\nend",
"title": ""
},
{
"docid": "7cc222f3356d00954764e8207551fbc2",
"score": "0.77296245",
"text": "def fizzbuzz()\n numbers = Array(1..100)\n numbers.each do |num|\n if num % 15 == 0\n puts \"FizzBuzz\" \n elsif num % 3 == 0\n puts \"Fizz\"\n elsif num % 5 == 0\n puts \"Buzz\"\n else\n puts num\n end\n end\nend",
"title": ""
},
{
"docid": "3556978725be5ec1a93f311921ea5c5b",
"score": "0.7721365",
"text": "def fizzbuzz\r\n # your code goes here\r\n arr = []\r\n\r\n for i in 1 .. 30\r\n if i % 5 == 0 && i % 3 == 0\r\n arr << \"fizzbuzz\"\r\n\r\n elsif i % 3 == 0\r\n arr << \"fizz\"\r\n\r\n elsif i % 5 == 0\r\n arr << \"buzz\"\r\n\r\n else arr << i\r\n end\r\n end\r\n arr\r\nend",
"title": ""
},
{
"docid": "510f44d49afb25db9d0e6089d3c8ca10",
"score": "0.77186453",
"text": "def fizzbuzz(start_num, end_num)\n (start_num..end_num).map do |n|\n if n % 3 == 0 && n % 5 == 0\n 'FizzBuzz'\n elsif n % 3 == 0\n 'Fizz'\n elsif n % 5 == 0\n 'Buzz'\n else\n n\n end\n end\nend",
"title": ""
},
{
"docid": "45b43ed6a0c5ad6303f58ab654d0a58f",
"score": "0.77048457",
"text": "def fizzbuzz\n an_array = Array.new(100)\n for cnt in 1..100\n l3_rem = cnt%3\n l5_rem = cnt%5\n if l3_rem == 0 && l5_rem != 0\n an_array[cnt -1 ] = 'Fizz'\n elsif l3_rem != 0 && l5_rem == 0\n an_array[ cnt -1 ] = 'Buzz'\n elsif l3_rem == 0 && l5_rem == 0\n an_array[ cnt - 1] = 'FizzBuzz'\n else\n an_array[ cnt - 1] = cnt\n end\n end\n return an_array\nend",
"title": ""
},
{
"docid": "747d8cab260b0226976f799933ea745a",
"score": "0.7690172",
"text": "def fizzbuzz(n)\n arr = []\n (1..n).each do |num|\n mod3 = (num % 3).zero?\n mod5 = (num % 5).zero?\n result = ''\n result += 'fizz' if mod3\n result += 'buzz' if mod5\n result.empty? ? arr.push(num) : arr.push(result)\n end\n arr\nend",
"title": ""
},
{
"docid": "51eba56ffb68601079eb8166d561e1dc",
"score": "0.7661082",
"text": "def fizzbuzz(max)\n arr =[]\n (1..max).each do |n|\n if n % 3 != 0 && n % 5 != 0\n arr.push n\n else\n val = ''\n if n % 3 == 0\n val = \"fizz\"\n end\n if n % 5 == 0\n val += \"buzz\"\n end\n arr.push val\n end\n end\n arr\nend",
"title": ""
},
{
"docid": "cda18bd2c09f7265b14da5372819026c",
"score": "0.76235104",
"text": "def fizzBuzz\n array = [*1..100]\n array.each { |num|\n if ((num % 3) == 0) && ((num % 5) == 0)\n puts \"FizBuzz\"\n elsif num % 5 == 0\n puts \"Buzz\"\n elsif num % 3 == 0\n puts \"Fizz\"\n else \n puts num\n end\n }\nend",
"title": ""
},
{
"docid": "4cdb79a82f06b286596f80d9eece2d35",
"score": "0.76201254",
"text": "def fizzbuzz(n)\n result = []\n (1..n).each do |num|\n if num % 3 == 0 && num % 5 == 0\n result << \"fizzbuzz\"\n elsif num % 3 == 0\n result << \"fizz\"\n elsif num % 5 == 0\n result << \"buzz\"\n else\n result << num\n end\n end\n result\nend",
"title": ""
},
{
"docid": "21e273dad60d487cac19087593dd989c",
"score": "0.7618825",
"text": "def fizzbuzz\n i =0\n arr=[]\n while i<=100 do\n if i%3 ==0 && i%5==0\n\t arr.push \"FizzBuzz\"\n\n\t elsif i%3==0\n\t arr.push \"Fizz\"\n\n\t elsif i%5==0\n\t arr.push \"Buzz\"\n\t else\n\t arr.push i\n\t end\n i+=1\n end\n return arr\nend",
"title": ""
},
{
"docid": "bb993337694de434bea91a3b1df35462",
"score": "0.76108325",
"text": "def fizzbuzz(n)\n myary = []\n myn = 1\n (0...n).each do\n if myn % 15 == 0\n myary << \"FizzBuzz\"\n myn += 1\n elsif myn % 5 == 0\n myary << \"Buzz\"\n myn += 1\n elsif myn % 3 == 0\n myary << \"Fizz\"\n myn += 1\n else\n myary << myn\n myn += 1\n end\n end\n myary\nend",
"title": ""
},
{
"docid": "93cb1dd52e3ed4650c68e873bb748445",
"score": "0.76006156",
"text": "def fizzbuzz\n\n fb_array = (1..100).to_a\n for i in fb_array\n if i % 3 == 0\n if i % 5 == 0\n fb_array[i-1] = 'FizzBuzz'\n else \n fb_array[i-1] = 'Fizz'\n end\n elsif i % 5 == 0\n fb_array[i-1] = 'Buzz'\n end\n end\n\nend",
"title": ""
},
{
"docid": "e09bb93e0294b0d410427e632c5cebba",
"score": "0.75966156",
"text": "def fizzbuzz(n)\n numbers = []\n (1..n).each do |num|\n if num % 3 == 0\n value = (num % 5 == 0) ? \"fizzbuzz\" : \"fizz\"\n numbers << value\n elsif num % 5 == 0\n numbers << \"buzz\"\n else\n numbers << num\n end\n end\n numbers\nend",
"title": ""
},
{
"docid": "086f1c04939f7b05914ff59e7c2c3b60",
"score": "0.75958824",
"text": "def fizzbuzz(number)\n (1..number).each do |num|\n if (num % 15).zero?\n puts 'FizzBuzz'\n elsif (num % 3).zero?\n puts 'Fizz'\n elsif (num % 5).zero?\n puts 'Buzz'\n else\n puts num\n end\n end\nend",
"title": ""
},
{
"docid": "ed393ded37192e545ea0affe7131ba46",
"score": "0.75844145",
"text": "def super_fizzbuzz(array)\n array.each_with_index do |element, index|\n if element % 15 == 0\n array.delete_at(index)\n array.insert(index, \"FizzBuzz\")\n \n elsif element % 5 == 0\n array.delete_at(index)\n array.insert(index, \"Buzz\")\n \n elsif element % 3 == 0\n array.delete_at(index)\n array.insert(index, \"Fizz\") \n \n end\n end\n return array\nend",
"title": ""
},
{
"docid": "18f58b871b8ccb4a1167e8f39104dc27",
"score": "0.75274885",
"text": "def fizzbuzz\n # TODO write your code here\n fbArray = Array.new\n i = 1\n #fbArray[0] = 0\n while i <= 100 do\n if i % 15 == 0\n fbArray[i] = \"FizzBuzz\"\n elsif i % 3 == 0\n fbArray[i] = \"Fizz\"\n elsif i % 5 == 0\n fbArray[i] = \"Buzz\"\n else\n fbArray[i] = i\n end\n i += 1\n end\n fizzbuzz = fbArray\nend",
"title": ""
},
{
"docid": "ee6dd580fe58d3c2e7fd795e482a3b5f",
"score": "0.7500982",
"text": "def fizzbuzz(n)\n arr = []\n (1..n).each do |i|\n case\n when (i % 3 == 0) && (i % 5 == 0) then arr << \"fizzbuzz\"\n when i % 3 == 0 then arr << \"fizz\"\n when i % 5 == 0 then arr << \"buzz\"\n else arr << i\n end\n end\n arr\nend",
"title": ""
},
{
"docid": "f397260649615183e8a023dc02eb4d69",
"score": "0.7485369",
"text": "def fizzbuzz(num1, num2)\n arr = num1.upto(num2).map do |num|\n if num % 3 == 0 && num % 5 == 0\n 'Fizzbuzz'\n elsif num % 5 == 0\n 'Buzz'\n elsif num % 3 == 0\n 'Fizz'\n else\n num\n end\n end\n arr.join(', ')\nend",
"title": ""
},
{
"docid": "3c555f8f6d8ab2b737fff9516690db64",
"score": "0.74590313",
"text": "def super_fizzbuzz(array)\n newarray = []\n array.each do |x|\n \tif x % 15 == 0\n \t\t newarray << \"Fizzbuzz\"\n \telsif x % 5 == 0\n \t newarray << \"Buzz\"\n\telsif x % 3 == 0\n\t\tnewarray << \"Fizz\"\n\telse\n\tnewarray << x\n\tend\nend\nputs newarray\nputs array\narray.replace(newarray)\nputs array\nend",
"title": ""
},
{
"docid": "5027644fe815302df29070514271264d",
"score": "0.7455905",
"text": "def fizzbuzz\n drink = Array.new(100)\n for i in 1..100\n if i % 15 == 0\n drink[i] = 'FizzBuzz'\n elsif i % 3 == 0\n drink[i] = 'Fizz'\n elsif i % 5 == 0\n drink[i] = 'Buzz'\n else\n drink[i] = i\n end\n end\n drink\nend",
"title": ""
},
{
"docid": "2510a848e890959e329b475fdb370e25",
"score": "0.74223065",
"text": "def fizzbuzz(num)\n collection = (1..num).to_a\n collection.each do |num|\n if (num % 3 == 0) && (num % 5 != 0)\n puts \"Fizz #{num}\"\n elsif (num % 5 == 0) && (num % 3 != 0)\n puts \"Buzz #{num}\"\n elsif (num % 3 == 0) && (num % 5 == 0)\n puts \"FizzBuzz #{num}\"\n end\n end\nend",
"title": ""
},
{
"docid": "9633143e057d9e6e0848883ed5187f06",
"score": "0.73964345",
"text": "def fizzbuzz(n)\n new_sent = []\n(1..n).each do |x|\n if x % 15 == 0\n new_sent << \"fizzbuzz\"\n elsif x % 5 == 0\n new_sent << \"buzz\"\n elsif x % 3 == 0\n new_sent << \"fizz\"\n else\n new_sent << x\n end\n end\n new_sent\nend",
"title": ""
},
{
"docid": "7fda19f49956f2035e57060b40d726e9",
"score": "0.73933816",
"text": "def fizzbuzz(start_num, end_num)\n new_arr = []\n (start_num..end_num).each do |num|\n case \n when (num % 3 == 0) && (num % 5 == 0)\n new_arr << \"FizzBuzz\"\n when num % 5 == 0\n new_arr << \"Buzz\"\n when num % 3 == 0 \n new_arr << \"Fizz\" \n else\n new_arr << num\n end\n end\n puts new_arr.join(', ')\nend",
"title": ""
},
{
"docid": "1631d01305b4c3b28744ba24d098ea49",
"score": "0.7385251",
"text": "def fizzbuzz(num1, num2)\n numbers = num1..num2\n fizzbuzz_array = []\n numbers.each do |x|\n case\n when x % 3 == 0 && x % 5 == 0\n fizzbuzz_array << \"FizzBuzz\"\n when x % 3 == 0\n fizzbuzz_array << \"Fizz\"\n when x % 5 == 0\n fizzbuzz_array << \"Buzz\"\n else\n fizzbuzz_array << x\n end\n end\n\n p fizzbuzz_array.join(\", \")\nend",
"title": ""
},
{
"docid": "e8f31014a6b2367c8cc9ca864fabc0d5",
"score": "0.738372",
"text": "def fizzBuzz\n (1..100).each do |x|\n a = []\n a << \"FizzBuzz\" if x % 15 == 0 \n a << \"Fizz\" if x % 3 == 0 \n a << \"Buzz\" if x % 5 == 0\n a << x\n puts a\n end\nend",
"title": ""
},
{
"docid": "f7a6e2588460259b1eee89e32fd435b3",
"score": "0.7373361",
"text": "def fizzBuzz (number)\n for i in 1..number\n if (i % 15 == 0)\n puts \"fizzbuzz\"\n elsif (i % 3 ==0)\n puts \"fizz\"\n elsif (i % 5 ==0)\n puts \"buzz\"\n else\n puts i\n end\n end\nend",
"title": ""
}
] |
e062217f132006294c8346a412287df6
|
returns Array of dates
|
[
{
"docid": "233e973a9e788f17e628ab077c1e97c4",
"score": "0.0",
"text": "def required_dates\n required_dates_count.keys.select { |d| required_dates_count[d] == marks.required.count }.uniq\n end",
"title": ""
}
] |
[
{
"docid": "14622224e2454f0ce6f5107b8a20feff",
"score": "0.8462983",
"text": "def dates_array\n start_date = self.start_date.to_date\n end_date = self.end_date.to_date\n array = Array.new\n return array if end_date<start_date\n (start_date..end_date).each do |i|\n array << i if self.days_int.include? i.wday\n end\n array\n end",
"title": ""
},
{
"docid": "7677a9f1aeea61d5417dc00c9d17e818",
"score": "0.83174443",
"text": "def dates\n res = Array.new\n @debut.upto(@fin) { |x| res << x }\n res.pop\n res\n end",
"title": ""
},
{
"docid": "1ad90e24c1f8a414728cc0d99492be78",
"score": "0.8273158",
"text": "def array_of_dates\n result ||= []\n Event.find(:all).each do |e|\n ends = Date.parse(e.ends.to_s)\n start = Date.parse(e.start.to_s)\n start.step(ends, 1){ |o| result << o }\n end\n result\n end",
"title": ""
},
{
"docid": "0c4be243466e29f4a2f37f04e90d7b01",
"score": "0.81682044",
"text": "def createDateArray\n @date_array = (@start_date...@end_date).to_a\n return @date_array\n end",
"title": ""
},
{
"docid": "fec823b8071dfbe44d7e8a9019258717",
"score": "0.8067124",
"text": "def _rdates\n Array(rdate).flatten\n rescue StandardError\n []\n end",
"title": ""
},
{
"docid": "8b93ed6e2143414ab56c572d51b1982d",
"score": "0.8022623",
"text": "def create_array_of_dates(start_date, end_date)\n dates = []\n difference = end_date - start_date\n difference = difference/86400\n difference.to_i.times do |i|\n dates << start_date + (1+i)\n end\n return dates\n end",
"title": ""
},
{
"docid": "6bd47e34201fd7e71269ecd377f2a45c",
"score": "0.79367447",
"text": "def _exdates\n Array(exdate).flatten\n rescue StandardError\n []\n end",
"title": ""
},
{
"docid": "c4000197d7d8980361e80a3ba77c5654",
"score": "0.7911869",
"text": "def dates\n if self.start_date.nil? || self.end_date.nil?\n return []\n else\n return (self.start_date.to_date .. self.end_date.to_date).to_a\n end\n end",
"title": ""
},
{
"docid": "41daf9b7fb6913cce2fa681b4a53e4c8",
"score": "0.7901526",
"text": "def date_array\n return [self.year, self.month, self.day]\n end",
"title": ""
},
{
"docid": "41daf9b7fb6913cce2fa681b4a53e4c8",
"score": "0.7901526",
"text": "def date_array\n return [self.year, self.month, self.day]\n end",
"title": ""
},
{
"docid": "41daf9b7fb6913cce2fa681b4a53e4c8",
"score": "0.7901526",
"text": "def date_array\n return [self.year, self.month, self.day]\n end",
"title": ""
},
{
"docid": "703f2df7a92beee472150aac40de83fc",
"score": "0.7759603",
"text": "def dates\n [].tap do |dates|\n dates << submitted_date if submitted_date.present?\n dates << available_date if available_date.present?\n dates << issued_date if issued_date.present?\n dates << created_date if created_date.present?\n end\n end",
"title": ""
},
{
"docid": "ea75179af17c8af60922079fb058e32a",
"score": "0.7747781",
"text": "def return_array_of_dates(input_dates, future=true)\n return [] if input_dates.nil? || input_dates.empty?\n \n input_dates = filter_future(input_dates) if future\n input_dates\n end",
"title": ""
},
{
"docid": "df3df4526859644b73d9b03bb1b5ca23",
"score": "0.77309966",
"text": "def dates_array\n dates_in_array = self.dates.split(',')\n end",
"title": ""
},
{
"docid": "bfb8b0e18500f48a79d4b95920732bb9",
"score": "0.76856315",
"text": "def return_array_of_dates(input_dates, future)\n return [] if input_dates.nil? || input_dates.empty?\n \n input_dates = filter_future(input_dates) if future\n input_dates\n end",
"title": ""
},
{
"docid": "ba39a6c7d79888d12ec6c775df271cce",
"score": "0.76727325",
"text": "def dates\n\t\t(startdate..enddate).to_a\n\tend",
"title": ""
},
{
"docid": "ebfe5aec04436cdade6944d589e962ff",
"score": "0.7633299",
"text": "def get_date_range_arr\n (@rsv_start...@rsv_end).to_a.map { |day| day.to_s }\n end",
"title": ""
},
{
"docid": "9103d177679b8d8bf43eb038f4d6124f",
"score": "0.7606007",
"text": "def dates\n @datapoints.collect { |point| point[0] }\n end",
"title": ""
},
{
"docid": "54396c14cc1c32a7917252d421e919a4",
"score": "0.7586624",
"text": "def cal_array\n date_array = Array.new(35, \"\")\n position = @date.beginning_of_month.wday\n @date.beginning_of_month.upto @date.end_of_month do |next_date|\n date_array[position] = next_date\n position += 1\n end\n date_array\n end",
"title": ""
},
{
"docid": "9ffcafea67523c7f0d4714d5659f066a",
"score": "0.7510633",
"text": "def dates\n ([date] + event_dates.pluck(:date)).compact.sort\n end",
"title": ""
},
{
"docid": "9d50cfb825da5dd436f2d5214888ede7",
"score": "0.74160635",
"text": "def dates(date_range)\n result = []\n date_range.each do |date|\n result << date if self.include? date\n end\n result\n end",
"title": ""
},
{
"docid": "74cc7ed3c55ccd7cfb29436a273a994a",
"score": "0.73815274",
"text": "def find_dates\n rgx = %r{([0]?[1-9]|[1|2][0-9]|[3][0|1])[./-]([0]?[1-9]|[1][0-2])[./-]([0-9]{4}|[0-9]{2})}\n @dates = []\n\n find @dates, @date_rgx, rgx\n end",
"title": ""
},
{
"docid": "db6670526721ddb2dff70f513a956251",
"score": "0.7372799",
"text": "def dates\n @dates ||= date_from.to(no_of_days)\n end",
"title": ""
},
{
"docid": "acf84602b4339ca194f7487e82225a7f",
"score": "0.7355561",
"text": "def dates_booked\n result = []\n date_enter = @start_date\n while date_enter < @end_date\n result << date_enter\n date_enter += 1\n end\n return result\n end",
"title": ""
},
{
"docid": "a74d3a4332c1f1cc5ee5a9341cd26037",
"score": "0.73405296",
"text": "def dates(event, date_range)\n result = Array.new\n date_range.each do |date|\n result.push date if include?(event,date)\n end\n result\n end",
"title": ""
},
{
"docid": "f54fdc0968a19ad1261ccefac0ea4611",
"score": "0.7307113",
"text": "def calculated_dates\n [period1_from_date,period1_end_date,\n period2_from_date, period2_end_date] \n end",
"title": ""
},
{
"docid": "e68a4507ffce5eab6b17b1e534a73725",
"score": "0.7295994",
"text": "def dates(range)\n dates = []\n \n if @count <= 0\n dates << self.expression.dates(range)\n else\n temp_range = (self.event.start.send :to_date)..(range.last)\n temp_dates = self.expression.dates(temp_range, @count)\n dates << temp_dates.select do |date|\n range.include?(date)\n end\n end\n \n # Put original date back in if recurrence rule doesn't define it.\n start_date = self.event.start.send(:to_date)\n dates << start_date if range.include?(start_date)\n \n dates.flatten.uniq - self.exceptions\n end",
"title": ""
},
{
"docid": "8cbd0a24750ca7a6da9496a1043a96d2",
"score": "0.7289407",
"text": "def dates\n swing_dates.order(\"date ASC\").collect{|sd| sd.date}\n end",
"title": ""
},
{
"docid": "1d24d535a4230b90578007e10984f5a8",
"score": "0.72815937",
"text": "def dates\n dates = []\n for d in 0..6\n dates << self.weekof.to_date + d.days\n end\n return dates\n end",
"title": ""
},
{
"docid": "1d24d535a4230b90578007e10984f5a8",
"score": "0.72815937",
"text": "def dates\n dates = []\n for d in 0..6\n dates << self.weekof.to_date + d.days\n end\n return dates\n end",
"title": ""
},
{
"docid": "84c36556c395274278c819ab649586a0",
"score": "0.72405076",
"text": "def days_array\n day = self.beginning_of_month.wday\n day = 7 if day == 0 #mimics cwday\n array = []\n array[day - 1] = 1\n (2..self.end_of_month.mday).each {|i| array << i }\n array\n end",
"title": ""
},
{
"docid": "79c1c6b4cce74e8bb1656f3bfbcbd7e4",
"score": "0.723795",
"text": "def dates(start_date=from,stop_date=till)\n # change start_date if from is later\n start_date = [from.to_date,start_date.to_date].max\n stop_date = [till.to_date,stop_date.to_date].min \n dates = []\n start_date.upto(stop_date) do |date|\n dates << date if fly_on_date?(date)\n end\n return dates\n end",
"title": ""
},
{
"docid": "8dc8f55e84b05ddf64a0ab2a8d45d42c",
"score": "0.7235928",
"text": "def dates_for_select\n return [['','']] + self.dates.map{|date| [date.strftime(\"%B %d, %Y\"), date.strftime(\"%Y-%m-%d\")]}\n end",
"title": ""
},
{
"docid": "22e8a867a8d40fdef4a638fc1bf84076",
"score": "0.7203166",
"text": "def view_dates\n dates_in_array = self.dates.split(',').join(\" \")\n end",
"title": ""
},
{
"docid": "3fdc32b2107eff9c2528c56a49a42ebc",
"score": "0.7201365",
"text": "def find_dates_list\n dates = if story_params.key?(:due_date)\n [story_params[:due_date]]\n elsif story_params.key?(:due_dates)\n story_params[:due_dates]\n else\n []\n end\n\n dates.map(&:to_date)\n end",
"title": ""
},
{
"docid": "b15fbe722dbd20e9abfeee9b689f4da9",
"score": "0.7194162",
"text": "def check_in_dates\n dates = []\n today = Date.today\n (0..365).each do |days|\n date = today + days.days\n dates << date if check_in_on?(date)\n end\n dates\n end",
"title": ""
},
{
"docid": "f23b60f87822045e5c57d99173e3fd13",
"score": "0.71849906",
"text": "def getDates()\n url=\"http://api.tradingphysics.com/getdates?type=orderflow\"\n return(Net::HTTP.get(URI.parse(url)).gsub(\"-\").split(\"\\r\\n\"));\n end",
"title": ""
},
{
"docid": "734a70a8f1ef35639d75d2be71912156",
"score": "0.71702915",
"text": "def get_entry_date_array(id)\n\n begin\n\n date_array = []\n query = SolrQuery.new\n q = 'entryDateFor_ssim:' + id\n\n unless id.nil?\n num = query.solr_query(q, 'id', 0)['response']['numFound'].to_i\n query.solr_query(q, 'id', num)['response']['docs'].map do |result|\n query.solr_query('dateFor_ssim:' + result['id'], 'date_tesim', 1)['response']['docs'].map do |result2|\n unless result2['date_tesim'].nil?\n result2['date_tesim'].each do |date_tesim|\n # get year only\n date = date_tesim.gsub('[', '').gsub(']', '')\n begin\n # get the first four chars; if these are a valid number over 1000 add them\n if date[0..3].to_i >= 1000\n date_array << date[0..3].to_i\n end\n rescue\n # if the value isn't a number, skip\n end\n end\n end\n end\n end\n end\n date_array\n\n rescue => error\n log_error(__method__, __FILE__, error)\n raise\n end\n\n end",
"title": ""
},
{
"docid": "401f0bd0479e7f69a3eb4bc865e347c6",
"score": "0.7168703",
"text": "def included_dates\n array = []\n begin_time.to_date.upto(end_time.to_date) do |date|\n array << date if date.working_day?\n end\n array\n end",
"title": ""
},
{
"docid": "4163643f71ee416b5c174779339a097c",
"score": "0.71234614",
"text": "def dates(event, date_range)\n result=[]\n date_range.each do |date|\n result.push date if include?(event,date)\n end\n result\n end",
"title": ""
},
{
"docid": "b7e4017c836d4ecda037c5766f31518e",
"score": "0.7103138",
"text": "def dates(start = DateTime.now)\n included_dates = []\n current = start.clone\n\n while current < end_date\n included_dates<< current if included_date?(current)\n\n current = next_date(current)\n end\n\n included_dates\n end",
"title": ""
},
{
"docid": "680b4d1c6b8b5cdd078b4e9e46eb9694",
"score": "0.7072375",
"text": "def datetimes\n data = JSON.parse(rdate || \"[]\")\n data.map { |pair| pair.map { |str| DateTime.parse(str) } }\n end",
"title": ""
},
{
"docid": "a09f159cf9b2be334323345bcb6eac6e",
"score": "0.7066796",
"text": "def booked_dates\n dates = []\n\n bookings.each { |booking|\n from = booking.date_from.strftime(\"%d/%m/%Y\") \n to = booking.date_to.strftime(\"%d/%m/%Y\")\n\n dates << [from, to]\n }\n\n dates\n end",
"title": ""
},
{
"docid": "d11bbde854963f2e008c998acbeb7185",
"score": "0.7051651",
"text": "def dates_to_be_updated\n result = Array.new\n start_date = Date.strptime(date_from)\n end_date = Date.strptime(date_to)\n\n # include the dates according to day specified\n while start_date <= end_date\n result << start_date.strftime(Constant::GRID_DATE_FORMAT) if days.include?(start_date.wday.to_s)\n start_date = start_date + 1.day\n end\n result\n end",
"title": ""
},
{
"docid": "069de2ffa271ecccf912de2f0837b429",
"score": "0.69996357",
"text": "def credits_date_array\n data_array = []\n self.credits.each do |credit|\n data_array.push([(credit.date.to_datetime.to_i * 1000).to_s, credit.amount.to_s.to_f])\n end\n\n return data_array\n end",
"title": ""
},
{
"docid": "1dd3e850d195b27d62b77f133f4d2067",
"score": "0.69991815",
"text": "def chart_dates\n @chart_dates ||= charts.map {|cd| cd.from..cd.to }.reverse\n end",
"title": ""
},
{
"docid": "4c1a21b3f5741582ebaa60a8f44ac1c0",
"score": "0.6998151",
"text": "def build_date_array(year, month)\n date_array = Array.new\n # cycle through days in month creating one key in the array for each day\n for d in (1..self.days_in_month(year, month))\n if d < 10 then\n # if date is 1-9 make sure it is 01-09\n d = \"0#{d}\"\n end\n if year == Time.now.year && month == Time.now.month && d == Time.now.day && configurableValue(:Line_Calendar, :colordate) == \"yes\" then\n configurableValue(:Line_Calendar, :hicolor) == \"yes\" ? date_array[d] = HI_COLOR : date_array[d] = \"\"\n date_array[d.to_i] += Line_Calendar::COLORS[configurableValue(:Line_Calendar, :color)] + d.to_s + Line_Calendar::END_COLOR\n else\n date_array[d.to_i] = d\n end\n end\n # remove 0 key for 1 to 1 mapping in array\n date_array.shift\n # make sure all dates are two digits\n date_array.each do |d|\n end\n return date_array\n end",
"title": ""
},
{
"docid": "6b67fe760b4c43563a503bf14a4ebd92",
"score": "0.699342",
"text": "def getAllDays()\n array = [];\n\n (0..6).each do |d|\n array.push([getDay(d), d])\n end\n\n return array\n end",
"title": ""
},
{
"docid": "76fa7b24eb4161a0e0374d12037b1c9f",
"score": "0.6987796",
"text": "def reading_dates\n self.hand_cards.map do |hand_card|\n hand_card.date\n end.uniq #=> returns an array of dates as datetime\n end",
"title": ""
},
{
"docid": "56400e6a063287b917c7d67d87f8913c",
"score": "0.6967184",
"text": "def all_dates(between = nil)\n days = ((last_date - first_date) / DAY).round + 1\n dates = Array(0..days).map do |day|\n first_date - DAY + day * DAY\n end\n\n return dates unless between\n\n date_between(dates, between)\n end",
"title": ""
},
{
"docid": "7f6065a32bc369b5c4d4d6be8f464369",
"score": "0.69601405",
"text": "def date_fragments\n []\n end",
"title": ""
},
{
"docid": "25bc3fff22585827e7067b803c8c5e97",
"score": "0.6940228",
"text": "def dates\n self.all.map { |expense| expense.created_at.to_date }\n end",
"title": ""
},
{
"docid": "d9900290e27f1a771ede62dd1805438f",
"score": "0.6917646",
"text": "def dates_between(start_date, end_date)\n start_date > end_date ? [start_date] : (start_date..end_date).step(7).to_a\n end",
"title": ""
},
{
"docid": "dc3b0e0bb003048693abf39bf927f4ad",
"score": "0.69063663",
"text": "def to_days\n return if first > last\n arr = []\n time = first\n while time <= last\n arr << time\n time += 1.day\n end\n return arr\n end",
"title": ""
},
{
"docid": "37fd4dd9f44188c36189199e4d6e8598",
"score": "0.68950135",
"text": "def all_session_dates\n each_session_date.to_a\n end",
"title": ""
},
{
"docid": "d7e74880d3f5365dcf39db51eb2bfe5b",
"score": "0.68799037",
"text": "def dates\n b_date = Date.civil(self.begin.year, self.begin.month, self.begin.day)\n e_date = Date.civil(max.year, max.month, max.day)\n\n b_date..e_date\n end",
"title": ""
},
{
"docid": "25670db355fc2e21fd0b9fc3b16e8209",
"score": "0.6878414",
"text": "def get_invoice_end_date_array\n if self.created_at > Time.new - 1.month\n return [\"Restaurant is less than one month old. Cannot create invoice\"]\n else\n date_array = []\n start_date = self.get_invoice_start_date\n #get date of last day of last month\n last_month_end_date = Time.new.prev_month.end_of_month #eg: 2015-03-31 23:59:59 +0200\n #loop through months adding each one to array and then going back \n #another month until reaching starting month\n current_date = last_month_end_date\n while current_date >= start_date\n date_array << current_date.end_of_month.to_date\n current_date -= 1.month \n current_date = current_date.end_of_month\n end\n return date_array\n end\n end",
"title": ""
},
{
"docid": "62b34a6c2bb9781f0f86357c76a1ec26",
"score": "0.686363",
"text": "def datetime_array\n return [self.year, self.month, self.day, self.hour, self.min, self.sec]\n end",
"title": ""
},
{
"docid": "62b34a6c2bb9781f0f86357c76a1ec26",
"score": "0.686363",
"text": "def datetime_array\n return [self.year, self.month, self.day, self.hour, self.min, self.sec]\n end",
"title": ""
},
{
"docid": "62b34a6c2bb9781f0f86357c76a1ec26",
"score": "0.686363",
"text": "def datetime_array\n return [self.year, self.month, self.day, self.hour, self.min, self.sec]\n end",
"title": ""
},
{
"docid": "f376493e09f8d0f2b11f67e440359c5e",
"score": "0.6840486",
"text": "def booking_dates\n result = []\n self.bookings.each do |booking|\n if booking.state == \"paid\"\n demand = (booking.start_datetime..booking.end_datetime).to_a\n result += demand\n end\n end\n result\n end",
"title": ""
},
{
"docid": "2dbc970be78f27e0127f834e02265af7",
"score": "0.6840461",
"text": "def get_scrape_date\n\t\tdates = []\n\t\tfor i in -2..6 do\n\t\t dates << (Time.now + i.day).strftime(\"%Y-%m-%d\")\n\t\tend\n\t\tdates\n\tend",
"title": ""
},
{
"docid": "db9547edb0270803077bfdf4c45f696a",
"score": "0.682935",
"text": "def date_array(dates)\n # Validate required parameters.\n validate_parameters(\n 'dates' => dates\n )\n # Prepare query url.\n _query_builder = config.get_base_uri\n _query_builder << '/query/datearray'\n _query_builder = APIHelper.append_url_with_query_parameters(\n _query_builder,\n 'dates' => dates\n )\n _query_url = APIHelper.clean_url _query_builder\n\n # Prepare headers.\n _headers = {\n 'accept' => 'application/json'\n }\n\n # Prepare and execute HttpRequest.\n _request = config.http_client.get(\n _query_url,\n headers: _headers\n )\n _response = execute_request(_request)\n\n # Validate response against endpoint and global error codes.\n return nil if _response.status_code == 404\n validate_response(_response)\n\n # Return appropriate response type.\n decoded = APIHelper.json_deserialize(_response.raw_body)\n ServerResponse.from_hash(decoded)\n end",
"title": ""
},
{
"docid": "febcd9dc1a31fedd6916893901c970f2",
"score": "0.68263805",
"text": "def parse_dd_mult_dates(p)\n [\n date_for(p['start_date'],Date.civil(Date.today.year,1,1)),\n date_for(p['end_date'],Date.today)\n ]\n end",
"title": ""
},
{
"docid": "7813e5b7df621d0792335f7092e754f4",
"score": "0.6824361",
"text": "def dates_needing_data\n today = today_in_user_tz\n last_known = last_known_calorie_date\n dates = [last_known]\n while dates.last < today\n dates << dates.last.tomorrow\n end\n dates\n end",
"title": ""
},
{
"docid": "c776a797fa3a2e48919dcb81f416ba0b",
"score": "0.6821768",
"text": "def get_start_and_end_dates(n)\n [nil, nil]\n end",
"title": ""
},
{
"docid": "2154d87fba6374ee33812275cacb903d",
"score": "0.68025357",
"text": "def dates(reference) # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize\n date = reference.at \"./front/date\"\n return [] if date.nil? || date[:year].nil? || date[:year].empty?\n\n d = date[:year]\n d += \"-#{month(date[:month])}\" if date[:month] && !date[:month].empty?\n d += \"-#{date[:day]}\" if date[:day]\n # date = Time.parse(d).strftime \"%Y-%m-%d\"\n [BibliographicDate.new(type: \"published\", on: d)]\n end",
"title": ""
},
{
"docid": "dc50bfd385a64bd3fea7d4930cd7a89c",
"score": "0.67865664",
"text": "def dct_temporal_dates\n items = @resource.datacite_dates.map(&:date).reject(&:blank?)\n items.map! do |dt|\n\n Date.iso8601(dt)&.strftime('%Y-%m-%d')\n rescue ArgumentError\n nil\n\n end\n items.compact\n\n # the below is the old stuff. We don't have ranges in our dates.\n # items = dates.map(&:to_s).compact\n # year_range_items = dates.map do |i|\n # (i.range_start.year..i.range_end.year).to_a.map(&:to_s) if i.range_start && i.range_end && i.range_start.year && i.range_end.year\n # end\n # (items + year_range_items).compact.flatten.uniq\n end",
"title": ""
},
{
"docid": "7b2128c74a63c8ce30b87a0aebf74408",
"score": "0.677243",
"text": "def to_events\n dates.inject([]) do |array, node|\n day = node.css('th.day').text[/\\d+/].to_i\n events = node.css('td.event_box > div.event')\n\n events.each do |event|\n array << Event.new(2014, 10, day, event)\n end\n\n array\n end\n end",
"title": ""
},
{
"docid": "4f94d63bc76c0420eb9cca9098b2d950",
"score": "0.67702657",
"text": "def period_with_data(sdate,edate,agent,settings)\n \n #we only retrieve data for whole months, so change start date to first of month\n nsdate = sdate\n nsdate -= ( sdate.day + 1 ) if sdate.day > 1\n\n days = []\n ((nsdate..edate).select { |d| d.day == 1 }).map do |d|\n days << days_with_data(d,agent,settings)\n end\n days.flatten!(1) \n days.map! { |a| DateTime.new(*a) }\n days.reject! { |d| d < sdate or d > edate }\n\n return days\nend",
"title": ""
},
{
"docid": "2a88afa8f6a62e40f6d853a887e85396",
"score": "0.6765358",
"text": "def dates(date_range, limit=0)\n result = []\n date_range.each do |date|\n result << date if self.include? date\n if limit > 0 and result.size == limit\n break\n end\n end\n result\n end",
"title": ""
},
{
"docid": "694d17194fdedf94ace2f47f46edf419",
"score": "0.6763936",
"text": "def dates_in(date_range)\n return [] if blank?\n date_range.to_a.select { |date| self[date.wday] }\n end",
"title": ""
},
{
"docid": "33259c47d620ea02502656826dd362ec",
"score": "0.6746018",
"text": "def calcDates (startDate, endDate, interval)\n arr = []\n while (startDate < endDate) do\n arr.push(startDate)\n case interval\n when \"DAILY\"\n startDate = startDate.next_day\n when \"WEEKLY\"\n startDate = startDate.next_day(7)\n when \"MONTHLY\"\n startDate = startDate.next_month\n else\n startDate = startDate.next_year\n end\n end\n arr.push(endDate)\n return arr\n end",
"title": ""
},
{
"docid": "c93c1f1dc0a98c6b1822d4d33fc4df42",
"score": "0.67109185",
"text": "def get_date_options\n date_range = (1..31)\n date_options = [];\n date_range.each do |d| \n item = [d, d]\n date_options.push item\n end\n date_options\n end",
"title": ""
},
{
"docid": "c93c1f1dc0a98c6b1822d4d33fc4df42",
"score": "0.67109185",
"text": "def get_date_options\n date_range = (1..31)\n date_options = [];\n date_range.each do |d| \n item = [d, d]\n date_options.push item\n end\n date_options\n end",
"title": ""
},
{
"docid": "a2736f19ad2f1a5284a9824773b89bb7",
"score": "0.6673777",
"text": "def days\n list = []\n n = 0\n d = 7\n d = @rate_search_container.nights if @rate_search_container.nights > 7 \n \n while n < d\n list << @rate_search_container.arrival_date.to_date + n rescue Time.now\n n += 1\n end\n list\n end",
"title": ""
},
{
"docid": "3bb830d92d2afcb67328046659297d19",
"score": "0.66732365",
"text": "def generate_dates(end_date=DateHelper.now)\n check_in = goal.check_ins.last\n dates = []\n\n if check_in\n start_date = DateHelper.date_in_timezone(check_in.date)\n prev_date = DateHelper.date_in_timezone(end_date) - 1\n\n dates = prev_date.downto(start_date).select do |date|\n date if days.include?(date.wday)\n end\n end\n\n dates\n end",
"title": ""
},
{
"docid": "27376bfd4ad23abd85dd2d833339066e",
"score": "0.6672329",
"text": "def date_range(start, nights)\n array = Array.new\n nights.times {|i| array << start + i}\n return array\n end",
"title": ""
},
{
"docid": "7e3aac64f7ce0443b795b1807cc0168a",
"score": "0.66715455",
"text": "def ydays\n @rrule.getByYearDay.to_a\n end",
"title": ""
},
{
"docid": "13ce16b56e444794219ec5ad74993f51",
"score": "0.66699696",
"text": "def get_matter_access_period_dates\n #previous_period = self.matter_access_periods.find(:first,:order => \"start_date\")\n access_periods = self.matter_access_periods.all\n previous_period = access_periods.first\n prev_start_date, prev_end_date = previous_period.start_date, previous_period.end_date \n current_time = Time.zone.now.to_date\n access_periods.each do|ap|\n if ap.start_date.blank? || ap.end_date.blank?\n return [ap.start_date,ap.end_date]\n end\n if ap.start_date <= current_time && ap.end_date.blank?\n return [ap.start_date,ap.end_date]\n elsif ap.end_date >= current_time\n if(ap.start_date == prev_end_date || ap.start_date < prev_end_date) && ap.end_date >= prev_end_date\n prev_end_date = ap.end_date \n end \n end \n end\n\n [prev_start_date, prev_end_date]\n end",
"title": ""
},
{
"docid": "d1d3b5dc6d00b204717682c3e846472c",
"score": "0.66697574",
"text": "def getDatesStartFinish()\n dates = getDates(self.start, self.end)\n prettyDates = Array.new\n dates.each do |dateToPrettyfy|\n newPrettyDate = pretty_date(dateToPrettyfy.to_time.to_date)\n prettyDates.push newPrettyDate\n end\n return prettyDates\n\n end",
"title": ""
},
{
"docid": "6c081389e0193af7a1649b4d539f79b3",
"score": "0.66666776",
"text": "def delivery_dates\n dispatch_delivery_dates.map(&:delivery_date)\n end",
"title": ""
},
{
"docid": "21f71c359958b2af9f89bf2401a7cdf6",
"score": "0.66661716",
"text": "def collect_period_dates(query, date_from, date_to)\n dates = []\n periods = query.between_dates(date_from, date_to).all.to_a\n periods.each do |period|\n (period.from .. period.to).each do |date|\n dates.push(date) if date >= date_from && date <= date_to\n end\n end\n\n dates\n end",
"title": ""
},
{
"docid": "31536ec8985da609bdc42fb2fec34e95",
"score": "0.66643685",
"text": "def unavailable_dates\n booking_dates = []\n start = (start_time + 1.days).to_datetime\n finish = (end_time + 1.days).to_datetime\n (start..finish).each do |d|\n booking_dates << d.to_s\n end\n return booking_dates\n end",
"title": ""
},
{
"docid": "25e1033833ca5660cf1c2e0b433b1049",
"score": "0.6662473",
"text": "def days\n r = (self.esdate.to_date..self.eedate.to_date).to_a\n end",
"title": ""
},
{
"docid": "59b56a9f9ccecb6018033a14e5dc482a",
"score": "0.664012",
"text": "def reserved_dates\n days = reservations.all.map do |x|\n if x.aasm_state != \"canceled\"\n (x.checkin_date...x.checkout_date).map{|d| d}\n end\n end\n days.compact.flatten\n end",
"title": ""
},
{
"docid": "9350f5c3e54e5ccebca435e9388759b2",
"score": "0.6620314",
"text": "def get_release_dates()\n release_dates = Array.new\n appointment_page = open_sub_page('Termine', 3, 2)\n tag_set = appointment_page.parser().xpath(\"//h2[contains(.,'vergangene Termine')]/../following-sibling::div//tr[position() > 1]\")\n if tag_set == nil || tag_set.size() < 1\n raise DataMiningError.new(\"Reaktion auf Quartalszahlen\", \"Could no extract release dates of quarterly figures\")\n return\n end\n tag_set.each do |tr|\n td_list = tr.xpath('.//td')\n if td_list.size == 4\n if td_list[0].content() == 'Quartalszahlen'\n quartal = td_list[1].content()\n raw_date = td_list[2].content().strip\n date = Util.add_millennium(raw_date)\n release_dates << Util.to_date_time(date)\n elsif td_list[0].content() == 'Jahresabschluss'\n raw_date = td_list[2].content().strip\n date = Util.add_millennium(raw_date)\n release_dates << Util.to_date_time(date)\n end\n end\n end\n return release_dates\n end",
"title": ""
},
{
"docid": "ac046cb15bae81cb47d6e9cad41dd5eb",
"score": "0.661235",
"text": "def create_active_date_array(began, ended)\n active_date_array = []\n i = 0\n weeks_repo_has_been_active = ((ended - began ) / (60*60*24*1)).ceil\n while i <= weeks_repo_has_been_active\n active_date_array << began.strftime(\"%U %Y\")\n began += (60*60*24*1)\n i += 1\n end\n active_date_array.uniq\n end",
"title": ""
},
{
"docid": "177fe3311ebcf07c9b6ad4ab405bf927",
"score": "0.65937847",
"text": "def calendar_dates\n # Go two hours back because of late games\n now = Time.now - 7200\n\n # Account for up to 5 off days\n days = (past? ? -1 : 1) * (@number + 5)\n\n [now, now + (days * 24 * 3600)].sort\n end",
"title": ""
},
{
"docid": "8d9111aa9f4402e53ab281f3d30c774b",
"score": "0.6593093",
"text": "def event_dates\n date = @event.xpath('upcoming_dates')\n result = []\n date.search(:event_date).each do |event_date|\n date_id = event_date.to_s.match(/\"([^\"]+)\"/)[1].to_i\n time_note = event_date.xpath('time_note').inner_html\n if time_note.include?('TBA')\n time_note = \"\"\n end\n time_str = event_date.xpath('date').inner_html + \" \" + time_note\n result << [date_id, time_str]\n end\n return result\n end",
"title": ""
},
{
"docid": "39540c747816455074f933926e010b25",
"score": "0.6589084",
"text": "def dates(start_date, end_date)\n (start_date.year..end_date.year).map do |year|\n (1..12).filter do |month|\n date = Time.new(year, month, 1)\n date >= start_date && date <= end_date\n end.flat_map do |month|\n Time.new(year, month, 1)\n end\n end\nend",
"title": ""
},
{
"docid": "8fb60c02bab5b2f20cb186e6c8465b1c",
"score": "0.6588014",
"text": "def range_array(context, first_year, last_year)\n ParseDate.range_array(first_year, last_year)\n rescue ParseDate::Error => e\n collect_exception!(context, e)\n []\n end",
"title": ""
},
{
"docid": "54b6f7799bd626c42fa723713edd1e91",
"score": "0.65843767",
"text": "def load_dates(doc)\n result = []\n\n # 245 contains creation dates\n [[\"f\", \"inclusive\"], [\"g\", \"bulk\"]].each do |code, date_type|\n field = doc.css('datafield[tag=\"245\"] subfield[code=\"%s\"]' % [code]).text\n\n next if field.empty?\n\n result << string_to_date(field, 'date_label' => 'creation', 'date_type' => date_type)\n end\n\n # 260 contains publication dates\n [\"e\", \"c\"].each do |code|\n field = doc.css('datafield[tag=\"260\"]').first_or_empty.css('subfield[code=\"%s\"]' % [code]).text\n\n next if field.empty?\n\n result << string_to_date(field,\n 'date_type' => 'single',\n 'date_label' => 'publication')\n end\n\n result\n end",
"title": ""
},
{
"docid": "70fe392c70f3d48c22c39cccbf4e1f5e",
"score": "0.6584153",
"text": "def mdays\n @rrule.getByMonthDay.to_a\n end",
"title": ""
},
{
"docid": "db8a28cbd91142e36718331805ee88d0",
"score": "0.65722936",
"text": "def convert_to_date_arrays(readings)\n data = {}\n readings.each_slice(48) do |one_day|\n date = one_day.first[0].to_date\n data[date] = []\n one_day.each do |carbon|\n data[date].push(carbon[1])\n end\n end\n data\n end",
"title": ""
},
{
"docid": "c25828a5260461144dcffed6d36dbe68",
"score": "0.65676373",
"text": "def yearly_dates\n date_value ? clean_years : []\n end",
"title": ""
},
{
"docid": "b86deb2f9e501d84e8b953f97644f8d6",
"score": "0.65661436",
"text": "def last_14_iso_dates\n last_14_days.map{ |date| date.iso8601 }\n end",
"title": ""
},
{
"docid": "c0543102d8f4c0b6d3630a4ca84c7ae3",
"score": "0.6549227",
"text": "def parse_date(stock_data)\n dates = []\n\n stock_data.each do |date|\n dates << date.trade_date\n end\n\n return dates\n end",
"title": ""
},
{
"docid": "7820088c21e99df457778b38b7c73c08",
"score": "0.6542352",
"text": "def getReservedDates\n reserved_dates = []\n if(Reservation.count != 0 )\n reservations = Reservation.pluck(:start_date)\n reservations.each {|date|\n #mark days unavailable\n (date-3.days..date+3.days).each {|d| \n reserved_dates.push(d.strftime(\"%d-%m-%Y\")).uniq!\n }\n }\n end \n if (Time.now.hour >= 21)\n today = Date.today\n reserved_dates.push(today.strftime(\"%d-%m-%Y\")).uniq!\n end\n render json: reserved_dates\n end",
"title": ""
},
{
"docid": "6b3a8bc5f7d3f20fd49320e0dca15507",
"score": "0.6539531",
"text": "def get_dates_for_graph(play_data)\n dates = Array.new\n index = 0\n play_data.keys.each do |key| \n dates[index] = Time.at(key).strftime(\"%m-%d-%Y\")\n index += 1\n end\n dates\n end",
"title": ""
},
{
"docid": "9daf9520336c6e32cfeec8870999e3c0",
"score": "0.65366286",
"text": "def dense_dates_for(state)\n source_rows = get_original_state_rows_for(state)\n dates.map do |date|\n row = source_rows.detect do |r|\n r[COL_Date] == date\n end\n if row\n row\n else\n [nil, date, state, 0, 0, 0, 0, 0]\n end\n end\n end",
"title": ""
}
] |
41658fa46e6a15b8ae1d0d30ae4f67c5
|
prints order, gets passed an array of instances of class lunch_item
|
[
{
"docid": "ce45c8dee5ddba5d6ddbc359380d3a91",
"score": "0.71692836",
"text": "def print_order(order)\n\tputs \"Here are the items you've ordered:\"\n\torder.each {|food| puts \"#{food.item}: $#{food.price}\\n\\tcalories: #{food.calories}\\tfat: #{food.fat} g\\tcarbs: #{food.carbs} g\"}\nend",
"title": ""
}
] |
[
{
"docid": "1fb5a6f70b4699814787c80dd2ded2b0",
"score": "0.6545576",
"text": "def print_lunch_orders\n @restaurants_used.collect{ |restaurant| restaurant.filled_orders_sentence }.join(', ')\n end",
"title": ""
},
{
"docid": "9a936f073ec0738ef1cdce3df92a78af",
"score": "0.650756",
"text": "def print_items\n @items.each do |item|\n puts item.name + \" (#{item.price} gold)\"\n end\n print \"\\n\"\n end",
"title": ""
},
{
"docid": "ec7e20ec8604dfd90ac6dcd6f323f744",
"score": "0.65043724",
"text": "def print_items\n puts print_line\n puts print_date\n puts print_title\n puts print_line\n puts print_header\n puts print_line\n items.each_with_index do |item, index_no|\n puts item.print_item_details(index_no)\n end\n puts print_line\n end",
"title": ""
},
{
"docid": "054dc6c5bd634d4fe75428b899023f49",
"score": "0.64691085",
"text": "def print_list\n @list.each { |item, qty| puts \"#{qty} #{item}\" }\n end",
"title": ""
},
{
"docid": "054dc6c5bd634d4fe75428b899023f49",
"score": "0.64691085",
"text": "def print_list\n @list.each { |item, qty| puts \"#{qty} #{item}\" }\n end",
"title": ""
},
{
"docid": "bd7feb9be4b736ceaa852cf572a03011",
"score": "0.64538914",
"text": "def print_items\n @items.each { |item| print \"#{item} \"}\n puts \"\\n\"\n end",
"title": ""
},
{
"docid": "c87f5523bd2f2ff57ac7945c18624105",
"score": "0.6413948",
"text": "def format_order(items)\n\n format_lock = items.map do |x|\n\n summery = x.first[:summery]\n puts \"#{summery[:qty]} #{summery[:sku_number]} $#{summery[:total]}\\n\"\n\n x.first[:line_items].each do |line_item|\n puts \"\\t#{line_item[:qty]} X #{line_item[:pack]} $#{line_item[:each_pack]}\\n\"\n end\n\n puts '---'* 5\n\n end\n\n return format_lock\n\n end",
"title": ""
},
{
"docid": "9e1998d70e43f67b0cd63ddf7d0908ff",
"score": "0.64121985",
"text": "def print_item_list(item_list)\r\n item_list.each { |item, qty| puts \"- #{item} : #{qty}\" }\r\nend",
"title": ""
},
{
"docid": "a78b2a1658f3e9a82c58b3d0e633b3d6",
"score": "0.63506824",
"text": "def pretty_in_print(list)\n puts \"---------------------------------------\"\n puts \"These are the items we are gonna buy\"\n list.each {|item, qty| puts \"#{qty} pieces of #{item}\" }\nend",
"title": ""
},
{
"docid": "645f458abcde20bac4d81afdd5eab98c",
"score": "0.6321488",
"text": "def print(list)\n puts \"***This is your grocery list:***\"\n list.each do |item,quantity|\n puts \"-#{quantity} #{item}\"\n end\nend",
"title": ""
},
{
"docid": "e61e6cd115f8f1fb0ba965d8d8b89bb3",
"score": "0.6297643",
"text": "def print_pretty(grocery_list)\r\n\tgrocery_list.each do |item, quantity| \r\n\t\tputs \"you bought #{quantity} #{item}\"\r\n\tend\r\nend",
"title": ""
},
{
"docid": "783d3f2ecaccd4549b1d16bf6e40f68c",
"score": "0.6293601",
"text": "def printed_list(grocery_list)\n grocery_list.each {|item, quantity|\n puts \"#{item}: #{quantity}\" }\nend",
"title": ""
},
{
"docid": "323b0656ad4144052d9b9e71f2da7687",
"score": "0.62690866",
"text": "def print_item_list\n @current_items.each_with_index do |item, item_no|\n puts \"Item #{item_no+1}\"\n puts \"----------------\"\n puts \"Item Name: #{item.name}\"\n puts \"----------------\"\n end\n end",
"title": ""
},
{
"docid": "4280a81fc947135c5280e91a221fc2d1",
"score": "0.6265399",
"text": "def print_backpack_list\n output = []\n output << \"Melinda, here's your packing list!\"\n output << \"Day: #{@attributes[:day_of_week]}, Weather: #{@attributes[:weather]}\"\n output << \"\"\n\n @items.each do |item|\n output << \"- #{item}\"\n end\n output.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "db644dc121de37ff834d4e85e66fae1b",
"score": "0.626003",
"text": "def display_list_of_items_packed\n output = []\n output << \"Melinda, here's your packing list!\"\n output << \"Day: #{@attributes[:day_of_week]}, Weather: #{@attributes[:weather]}\"\n output << \"\"\n\n @items.each do |item|\n output << \"- #{item}\"\n end\n output.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "5b89d2e7af9c5ab5cb59ec851329dc8b",
"score": "0.6218527",
"text": "def print(groceries_list)\n puts \"---------------------------------------------\"\n groceries_list.each do |item, quantity|\n puts \"#{item}: #{quantity}\"\n end\n puts \"---------------------------------------------\"\nend",
"title": ""
},
{
"docid": "3886a8ad1150dd4b4d91e8ba08f7160e",
"score": "0.6209992",
"text": "def display_order_contents\n\t\t@orders.each {|item| print item, \" -- \"}\n\tend",
"title": ""
},
{
"docid": "4fccb1f2a304d46fcc515fbe18831821",
"score": "0.6195789",
"text": "def pretty_list(grocery_list)\r\n puts \"Your Grocery List for next week!\"\r\n grocery_list.each do |item, num|\r\n puts \"#{item} qty #{num}\"\r\n end\r\n \r\nend",
"title": ""
},
{
"docid": "d02386d97f4463846622712dfc76f247",
"score": "0.61885166",
"text": "def print_list(grocery_list)\n grocery_list.each do |item, qty|\n p \"#{item}: #{qty}\"\n end\nend",
"title": ""
},
{
"docid": "3e0f250b9d9fba9e0083016ad377d503",
"score": "0.61824816",
"text": "def print_list(grocery_list)\n grocery_list.each do |item,quantity|\n puts \" #{item} #{quantity}\"\n end\n end",
"title": ""
},
{
"docid": "c2e4c6671279d9edab15e8c05307568c",
"score": "0.6165884",
"text": "def print_list(list)\r\n# input: completed list\r\n# steps:\r\n # iterate over list and print formatted list\r\n puts \"Your Grocery List\"\r\n list.each do |item, quantity|\r\n puts \"#{item}, qty: #{quantity}\"\r\n end\r\n # format: each item with its own line\r\n # \"item - quantity\"\r\n# output: implicit return of list\r\nend",
"title": ""
},
{
"docid": "1385eea34cdde63bc03cd34ef284246d",
"score": "0.6156117",
"text": "def pretty_list(grocery_list)\n grocery_list.each do |item, quantity|\n puts \"#{quantity} #{item}\"\n end\nend",
"title": ""
},
{
"docid": "1385eea34cdde63bc03cd34ef284246d",
"score": "0.6156117",
"text": "def pretty_list(grocery_list)\n grocery_list.each do |item, quantity|\n puts \"#{quantity} #{item}\"\n end\nend",
"title": ""
},
{
"docid": "a49b9a0c8c7e33e73b8dfe48bfa78bfa",
"score": "0.6151363",
"text": "def print(groceries_list)\n\tputs \"---------------------------------------------\"\n\tgroceries_list.each do |item, quantity|\n\t\tputs \"#{item}: #{quantity}\"\n\tend\n\tputs \"---------------------------------------------\"\nend",
"title": ""
},
{
"docid": "c45c5839277871b86c25c0d180343944",
"score": "0.61468905",
"text": "def print_list(grocery_list)\n grocery_list.each do |x,y|\n puts \"Item: #{x}-- ##{y}\"\n end\nend",
"title": ""
},
{
"docid": "c1c3ba65a61334267c31a7593e4d479f",
"score": "0.61316186",
"text": "def list_items(grocery_list)\n grocery_list.sort!\n grocery_list.each do |item|\n puts \"* #{item}\"\n end\n puts \"#{grocery_list.length} items on the list right now\"\nend",
"title": ""
},
{
"docid": "d750a92a2d36abd0cb563ebba2d67f6e",
"score": "0.6116819",
"text": "def print_list(grocery_list)\n grocery_list.each do |item, quantity|\n puts \"#{item}, qty: #{quantity}\"\n end\nend",
"title": ""
},
{
"docid": "7209ecb60330dfa22711dfa88017b212",
"score": "0.61164296",
"text": "def report_print_items\n $report_file.puts print_line\n $report_file.puts print_date\n $report_file.puts print_title\n $report_file.puts print_line\n $report_file.puts print_header\n $report_file.puts print_line\n items.each_with_index do |item, index_no|\n $report_file.puts item.print_item_details(index_no)\n end\n $report_file.puts print_line\n end",
"title": ""
},
{
"docid": "f4daea186cc9b35d0500699aece2c12f",
"score": "0.6103917",
"text": "def print_inventory\n @inventory.each do |couple|\n puts couple.first.name + \" (#{couple.second})\"\n end\n print \"\\n\"\n end",
"title": ""
},
{
"docid": "64d85406c984d1e83814a5656a0014f0",
"score": "0.6091046",
"text": "def print_list(list)\n puts \"Grocery List\"\n list.each { |item, qty| puts \"#{item}: #{qty}\" }\nend",
"title": ""
},
{
"docid": "bd03c3322037a2ca64cab77ad544291d",
"score": "0.60906976",
"text": "def look_pretty(list)\n puts \"Here is your grocery list:\"\n list.each { |item, quantity| puts \"#{item}: #{quantity}\" }\nend",
"title": ""
},
{
"docid": "40a4bdd908cccc07e650f3a4813a69d9",
"score": "0.6087264",
"text": "def print_grocery_list(grocery_list)\n # steps: print \"Grocery List\"\n puts \"Grocery List:\"\n # for each item, print \"item name: quantity\"\n grocery_list.each do |item_name, quantity|\n puts \"#{item_name.to_s}: #{quantity}\"\n # output:\n end\nend",
"title": ""
},
{
"docid": "29260e83c69de61223a776e48fff9fae",
"score": "0.60843813",
"text": "def print_list(list_name)\n# for each array element, print the item name and quantity\n list_name.each { |list_item| puts \"#{list_item[:item_name]}\" + ': ' + \"#{list_item[:quantity]}\"}\n# Wish the shopper good luck.\n puts \"Happy Shopping!\"\n list_name\nend",
"title": ""
},
{
"docid": "b07e4cd52e7f4171f5ff2b3603cc4192",
"score": "0.6082786",
"text": "def print_out(list)\n\tlist.each {|item, qty| puts \"#{item}; #{qty}\"}\nend",
"title": ""
},
{
"docid": "45762ee0d30d55bfa63077cec0be8092",
"score": "0.60707283",
"text": "def print_list(grocery_list)\n\tgrocery_list.each do |item_name, quantity|\n\t\tputs \"#{item_name} => #{quantity}\"\n\tend\nend",
"title": ""
},
{
"docid": "b70eeb5839b2da7f374737f99519f36e",
"score": "0.6068276",
"text": "def pretty_list(list)\n list.each do |grocery_item, qty|\n puts \"#{grocery_item}, quantity: #{qty}\"\n end\nend",
"title": ""
},
{
"docid": "e4457b6ac293ec8aac669d43a677428d",
"score": "0.60627264",
"text": "def all\n resort_array\n puts '-' * @title.length\n puts @title\n puts '-' * @title.length\n\n print_group(TodoItem, ['', 'Todo', 'Due', 'Priority'])\n print_group(EventItem, ['', 'Event', 'Start', 'End'])\n print_group(LinkItem, ['', 'Link', 'Site Name'])\n end",
"title": ""
},
{
"docid": "f5b7dff1fc229dc7bf5901bdd6fe043c",
"score": "0.6056529",
"text": "def print_list(list)\r\n # steps:\r\n # use each method to print the following: \"You have #{quantity} #{item_name}\"\r\n list.each do |name, quantity|\r\n puts \"You have #{quantity} of #{name}!\"\r\n end\r\n # output: -no output-\r\nend",
"title": ""
},
{
"docid": "e90cdd9d656b886626232a244ca59a0c",
"score": "0.60539913",
"text": "def pretty_list(list)\n\tlist.each { |item_name, item_quantity|\n\t\tputs \"You will need to purchase #{item_quantity} of #{item_name}.\"\n\t}\nend",
"title": ""
},
{
"docid": "4b01ca2beb23257b3c035b8698ac19ba",
"score": "0.6050257",
"text": "def print(list)\n list.each do |food, qty|\n puts \"#{food} with qty: #{qty}\"\n end\nend",
"title": ""
},
{
"docid": "da69e2c73f689ed40eb632b49c859009",
"score": "0.6048467",
"text": "def print_list(grocery_list)\r\n grocery_list.each do |item, quantity|\r\n puts \"#{item}: #{quantity}\"\r\n end\r\nend",
"title": ""
},
{
"docid": "c9fafd6aa3212c5e5c824531699ea367",
"score": "0.60472697",
"text": "def print_list(my_groceries)\n puts \"----------\"\n puts \"Our grocery list contains:\" \n my_groceries.each { |item, quantity| puts \"#{item}: #{quantity}\"}\n puts \"----------\"\nend",
"title": ""
},
{
"docid": "9d2f44c0162d99af38c58b8984bb7ee6",
"score": "0.6045804",
"text": "def print_list(grocery_list)\n grocery_list.each do |item, quantity|\n puts \"#{item}: #{quantity}\"\n end\nend",
"title": ""
},
{
"docid": "9d2f44c0162d99af38c58b8984bb7ee6",
"score": "0.6045804",
"text": "def print_list(grocery_list)\n grocery_list.each do |item, quantity|\n puts \"#{item}: #{quantity}\"\n end\nend",
"title": ""
},
{
"docid": "a269257c0061bd6668f8edca5fc5a8cf",
"score": "0.60416085",
"text": "def print_list(my_list)\r\n# input: \r\n \r\n# steps:\r\n# print to screen: iterate through hash item - quantity\r\n puts '------'\r\n puts \"Grocery list:\"\r\n my_list.each do |item, qty|\r\n puts \"#{item} - #{qty}\"\r\n end\r\n puts '-------'\r\n# output: each k,v pair printed surrounded by dashes\r\nend",
"title": ""
},
{
"docid": "d0faa8222d0fe582ad5eeef8dd06b038",
"score": "0.60388744",
"text": "def output_for items\n output = \"\"\n items.each_with_index do |item, position|\n output += \"#{position + 1}) #{item.type.capitalize}: #{item.details}\\n\"\n end\n output # Return the output to print (well, put) it\n end",
"title": ""
},
{
"docid": "19169da56eaa3b7b7b45831040887ed0",
"score": "0.60387367",
"text": "def printer(array)\n\tbatch_badge_creator(array).each do |badge_list|\n\t\tputs badge_list\n\tend\n\n\tassign_rooms(array).each do |rooms|\n\t\tputs rooms\n\tend\nend",
"title": ""
},
{
"docid": "cac3634723ffeaab1fb53ae6b34a6713",
"score": "0.6037478",
"text": "def print_list(grocery_list)\n grocery_list.each { |grocery_item, quantity| puts \"#{grocery_item} : #{quantity}\"}\nend",
"title": ""
},
{
"docid": "56c02fdbf3582807d337b57286d33a9e",
"score": "0.6035192",
"text": "def print_list(list)\n puts \"This week's grocery list:\"\n list.each do |item, quantity|\n puts \"#{item}: #{quantity}\"\n end\nend",
"title": ""
},
{
"docid": "cffd67ea0adf3f04e50f429b7b8683bf",
"score": "0.6028368",
"text": "def print_list(list)\n\tlist.each do |item,quantity|\n\t\tp \"#{quantity} #{item}\"\n\tend\nend",
"title": ""
},
{
"docid": "2a41d90f63396cbdb36e4a0c71d7a129",
"score": "0.6025271",
"text": "def print_list(grocery_list)\n puts \" GROCERY LIST \".center(50, \"=\")\n puts\n grocery_list.each { |item,qty| puts \"#{item} qty: #{qty}\" }\n puts\n puts \"=\".center(50, \"=\")\nend",
"title": ""
},
{
"docid": "6765e1b893faa4366ec7f46115ca6ed2",
"score": "0.6021278",
"text": "def print(list)\n list.each do |item, number|\n puts \"Need to purchase: #{item} -- #{number}\"\n end\nend",
"title": ""
},
{
"docid": "5098396d870370fbf150f19c1e5cd9ea",
"score": "0.6020283",
"text": "def print_list\n $list.each {|list_item| puts \"#{list_item[:quantity]} #{list_item[:item]}\"}\nend",
"title": ""
},
{
"docid": "3e05307a43846ea760374dcd289621cf",
"score": "0.60044146",
"text": "def wrap_items(print_items)\n ans = []\n print_items.group_by{ |x| x.order_item.order }.each do |_, pitems|\n pitems.group_by(&:order_item).each_with_index do |(_, items), order_item_index|\n items.each_with_index do |item, quantity_index|\n item = item.becomes(SerialItem)\n item.order_item_serial = order_item_index.succ\n item.quantity_serial = quantity_index.succ\n ans << item\n end\n end\n end\n ans\n end",
"title": ""
},
{
"docid": "f2b1fb6e1feffa30f36d540c0db8ee9d",
"score": "0.6004062",
"text": "def print_items\n if @items.empty?\n print NO_ITEMS_MESSAGE\n else\n print WARES_MESSAGE\n @items.each { |item| puts \"#{item.name} (#{item.price} gold)\" }\n print \"\\n\"\n end\n end",
"title": ""
},
{
"docid": "e24fdfb34e8c69d30f78c13d3bc792ed",
"score": "0.60035884",
"text": "def print_list(list)\n\tlist.each do |iterator|\n\tputs \"#{iterator[:item].split.map(&:capitalize).join(' ')} - QTY #{iterator[:qty]}\"\n\tend\n\nend",
"title": ""
},
{
"docid": "39c994f27650168d6c495ef9c57b8ddb",
"score": "0.6003407",
"text": "def print_list(shopping_list)\n puts \"SHOPPING LIST:\"\n shopping_list.each do |item, qty|\n puts \"-#{item} ---> #{qty}\"\n end\n\nend",
"title": ""
},
{
"docid": "28218836fec05a2976c6c3a20d5fc8c6",
"score": "0.60030377",
"text": "def print_list(food_list)\n food_list.each do |item_name, quantity|\n puts \"You have the following item #{item_name}, qty: #{quantity}.\"\n end\nend",
"title": ""
},
{
"docid": "daa3971ac0d5654c403b234a6a4077da",
"score": "0.600107",
"text": "def print_list(grocery_list)\n puts \" Grocery List\"\n grocery_list.each do |item, quantity|\n puts \"#{item.capitalize} --> #{quantity}\"\n end\nend",
"title": ""
},
{
"docid": "daa3971ac0d5654c403b234a6a4077da",
"score": "0.600107",
"text": "def print_list(grocery_list)\n puts \" Grocery List\"\n grocery_list.each do |item, quantity|\n puts \"#{item.capitalize} --> #{quantity}\"\n end\nend",
"title": ""
},
{
"docid": "cdecf1f733900274bbf52236e7af2171",
"score": "0.5986716",
"text": "def grocery_printer(list)\n\tlist.each do |list_item|\n\t\tputs \"* #{list_item}\"\n\n\tend \nend",
"title": ""
},
{
"docid": "409f63e3523abadd9601b9ee104567d5",
"score": "0.59857774",
"text": "def print_order\n puts \"This #{dog.choice} hot dog with a #{bun.choice} bun, and #{condiment.choice} is beautiful. You should go into hot dog art.\"\n end",
"title": ""
},
{
"docid": "36c97ac509cefc0d29c1649947435d6d",
"score": "0.59816456",
"text": "def print_do(groceries_list)\n groceries_list.each {|item, quantity| puts \"#{item} : #{quantity}\" }\nend",
"title": ""
},
{
"docid": "88b25ce68a61d267c34a0b6faa52ceb5",
"score": "0.59802866",
"text": "def printout (list)\n\tlist.each { |item, quantity| puts \"#{item} is #{quantity} \" } \nend",
"title": ""
},
{
"docid": "96fd163d14da4e3a4068062fcd4d3309",
"score": "0.59794754",
"text": "def print_list\n\t puts \"\"\n\t puts \"\"\n\t\tputs \"#{@list_name}\"\n\t\tprint \"-\" * 40\n\t\t@grocery_list.each {|k, v| puts \"#{k} #{v}\"}\n\t\tputs \"\"\n\t\tget_item\n\tend",
"title": ""
},
{
"docid": "40361617912b73eb8ac2fc0fcd174289",
"score": "0.5977463",
"text": "def print_list(list)\n\tputs \"Grocery List\"\n\tlist.each{|item, quantity|\n\t\tputs \"#{item} : #{quantity}\"\n\t}\nend",
"title": ""
},
{
"docid": "d27e852b804c84aa6f7c9f70520af8ab",
"score": "0.597487",
"text": "def printer(array)\n batch_badge_creator(array).each do |line|\n puts line\n end\n assign_rooms(attendees).each do |room|\n puts room\n end\nend",
"title": ""
},
{
"docid": "1c5441a2ce216e66299819ec5d1f1451",
"score": "0.59741825",
"text": "def print_pretty(new_list)\n puts \"Grocery List:\"\n new_list.each do |item, amount|\n \n puts \"#{item}: #{amount}\"\n end\nend",
"title": ""
},
{
"docid": "53e0a71226218bc1e091fc60383d82b1",
"score": "0.5974093",
"text": "def nice_print(grocery_list)\n\tgrocery_list.each { |food, quantity| puts \"We need #{quantity}, of #{food}.\"}\nend",
"title": ""
},
{
"docid": "7233270bac961fa84202814eeacd0a85",
"score": "0.5973381",
"text": "def print_list(list)\r\n puts \"-\"*20\r\n list.each do |item,quantity|\r\n puts \"Item:#{item} quantity:#{quantity}\"\r\n end\r\n puts \"-\"*20\r\n list\r\nend",
"title": ""
},
{
"docid": "8a09b5f93cae6f2bb7efe88e38d8c6de",
"score": "0.5973052",
"text": "def print_list(list)\n puts \"List: #{list['name']}\"\n print_separator\n\n list[\"items\"].each do |item|\n puts \"\\tItem: \" + item['name'] + \"\\t\\t\\t\" +\n \"quantity: \" + item['quantity'].to_s\n end\n\n print_separator\nend",
"title": ""
},
{
"docid": "38b2b29507973b7ac4463f370b08f3b0",
"score": "0.59695303",
"text": "def printItem\n print @category,\", \"\n print @batteryLife,\", \"\n print @modelNum,\", \"\n print @color,\", \"\n print @manufacturer,\", \"\n print @status,\", \"\n print @yearBuilt,\", \"\n print @price,\", \"\n print @features\n end",
"title": ""
},
{
"docid": "5a9a6795c8e0ff79b69ec964caf749f2",
"score": "0.5969137",
"text": "def print_list(grocery_list)\n puts \"*\" * 40 + \"Grocery List\" + \"*\" * 40 \n grocery_list.each do |item, quantity|\n puts \"#{item.capitalize}\".ljust(30) + \"#{quantity}\".rjust(10)\n\n end\n end",
"title": ""
},
{
"docid": "325a9b31f51ca308d0492b4b859b3c28",
"score": "0.59654665",
"text": "def print_list(list)\r\n puts \"Your current grocery list\"\r\n puts \"---------------------------\"\r\n list.each do |item, quantity|\r\n puts \"#{item}: #{quantity}\"\r\n end \r\nend",
"title": ""
},
{
"docid": "fb5efd597ab95af073b681d24b130a4c",
"score": "0.59590256",
"text": "def print_list(grocery_list)\n line_width = 30\n puts\n puts ('Grocery List'.center(line_width))\n puts\n puts (\"ITEMS\".ljust(line_width/2)) + \"QTY\".rjust(line_width/2)\n puts (\"------------------------------\").center(line_width)\n grocery_list.each { |item, quantity| \n puts (item.ljust(line_width/2)) + quantity.to_s.rjust(line_width/2)\n puts (\"------------------------------\") }\nend",
"title": ""
},
{
"docid": "5a0c9c883e021d73f263033faa81f4e1",
"score": "0.5947799",
"text": "def print_list(list, item_name, quantity)\n list.each do |item|\n puts \"We need #{quantity} #{item_name}\"\n end\nend",
"title": ""
},
{
"docid": "3dc3bdcc7678d85bfd00169b4c085dfe",
"score": "0.59417003",
"text": "def display_list(list_items)\n title = \"Shopping List:\"\n puts title\n puts \"-\" * title.length\n list_items.each do |item_name, item_qty|\n puts \"#{item_qty}x - #{item_name}\"\n end\n\nend",
"title": ""
},
{
"docid": "4c31f85af5f4dfc104756b23026dae20",
"score": "0.5932614",
"text": "def print_list(list)\n\tlist.each do |item, quantity|\n\t\tputs \"#{item.capitalize}: #{quantity}\"\n\tend\nend",
"title": ""
},
{
"docid": "42e7ed32febf368a520597828f5d5933",
"score": "0.5932413",
"text": "def pretty_list(grocery_list)\n puts \"Shopping List\"\n grocery_list.each do |item, quantity|\n puts \"#{item}: #{quantity}\"\n end\n puts \"Happy Shopping!\"\nend",
"title": ""
},
{
"docid": "b853e7af2ba90e23460722d86c16f6ce",
"score": "0.5931844",
"text": "def pretty_print(list)\n list.each {|item, quantity| puts \"#{item} : #{quantity}\"}\nend",
"title": ""
},
{
"docid": "8580b4010c242fc117db68931c60eaf0",
"score": "0.5928241",
"text": "def print_list(grocery_list)\n grocery_list.each do |item,quantity|\n puts \"Buy: #{quantity} #{item}\"\n end\nend",
"title": ""
},
{
"docid": "03457e3789b9dd7c80eaa17892f252b3",
"score": "0.5922829",
"text": "def print_drinks(drinks) # the argument here is the drink objects array. which has drink_id and drink_name\n puts \" \"\n puts \"Here are the drinks made with #{@ingredient}: \"\n drinks.each.with_index(1) {|drink, index| puts \"#{index}. #{drink.name}\" } # each.with_index(1) allows the index to start at 1 \n end",
"title": ""
},
{
"docid": "b5da21b1d4d18b4a82c728167d30b92a",
"score": "0.59189117",
"text": "def print_list(grocery_list)\n grocery_list.each do |item, quantity|\n puts \"Buy: #{quantity} #{item}\"\n end\nend",
"title": ""
},
{
"docid": "9c6b0caa4aff71192c277bcad1326658",
"score": "0.5913309",
"text": "def print_list(list)\n puts \"Here's your grocery list:\"\n list.each { |item, quantity| puts \"#{item}: #{quantity}\" }\nend",
"title": ""
},
{
"docid": "fe16cf6465eee9659d084ad6eff02230",
"score": "0.5910129",
"text": "def print_list(older_list)\r\n puts \"You grocery list: \"\r\n older_list.each do |item, qty|\r\n puts \"#{item.capitalize} - Qty: #{qty}\"\r\n end\r\nend",
"title": ""
},
{
"docid": "da3b2feb24dc210f50001357fb257eb4",
"score": "0.59092546",
"text": "def pretty_list(hash)\r\n puts \"Grocery List:\"\r\n puts \" \"\r\n hash.each do |item_name, quantity|\r\n puts \"#{item_name}: #{quantity}\"\r\n end\r\nend",
"title": ""
},
{
"docid": "10421cd609835ac6f2186266d83b89d3",
"score": "0.5894321",
"text": "def print_list\n \t\tputs \"\\n----------------------------\"\n \t\tputs \"#{@date_created.month}/#{@date_created.day}/#{date_created.year}\"\n \t\tputs \"Your Grocery List:\\n\\n\" \t\t\n \t\tif @list.empty?\n \t\t\tputs \"The List Is Empty!\"\n \t\telse\n\n \t@list.each_with_index { |item, index| puts \"#{index+1}. #{item.qty} #{item.name}\" }\n end\n puts \"\\n----------------------------\"\n end",
"title": ""
},
{
"docid": "1e076958452a777064fc640e9cfee496",
"score": "0.58751035",
"text": "def pretty_list(list)\n\tlist.each do |item, quantity|\n\t\tputs \"There are #{quantity} #{item} on the grocery list.\"\n\tend\nend",
"title": ""
},
{
"docid": "cd812aa7dc898d80c7f07e55fe8d1949",
"score": "0.58745855",
"text": "def print_list(list)\r\n puts \"_-\" *25 + \"\\n\\n\"\r\n puts \"Here is your Grocery List: \\n\\n\"\r\n list.each do |item, quantity|\r\n puts \"\\tItem: #{item} \\tAmount: #{quantity}\"\r\n end\r\n puts \"_-\" *25\r\nend",
"title": ""
},
{
"docid": "62ce5392376e54ac945fc151af73534b",
"score": "0.5872241",
"text": "def print_list(type='all')\n\n\t\tputs \"{#name} List - #{type} items\"\n\t\tprint '-' * 30 + \"\\n\"\n\n\n\n\t\ttodo_items.each do |item|\n\t\t\tcase type\n\t\t\twhen 'all'\n\t\t\tputs item\n\t\twhen 'complete'\n\t\t\tputs item if item.complete?\n\t\twhen 'incomplete'\n\t\t\tputs item unless item.complete?\n\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "d300ddd7a275cc6d1bbc1c3db9e09434",
"score": "0.58668154",
"text": "def format_output(orders)\n orders.each do |order_item|\n puts \"#{order_item[:requested_flower]} #{order_item[:flower_code]} $#{order_item[:total_price]}\"\n order_item[:order_bundles].each do |bundle|\n puts \" #{bundle[:number_of_flowers]} X #{bundle[:number_needed]} $#{bundle[:price]}\"\n end\n end\n end",
"title": ""
},
{
"docid": "b5bb3ea8ca9c4eafcb2304ad33867454",
"score": "0.5865211",
"text": "def output\n puts \"\\n\"\n 0.upto(@order - 1) do |r|\n row_for(@order, r)\n puts \"\\n\\n\"\n end\n end",
"title": ""
},
{
"docid": "4695cfe897b7573f415fafcb0da4d458",
"score": "0.5860486",
"text": "def print_list(list)\r\n puts \"GROCERY LIST\"\r\n list.each do | item, quantity |\r\n puts \"#{item.capitalize}: #{quantity}\"\r\n end\r\nend",
"title": ""
},
{
"docid": "1d14e5d40e5bdf8d4681bcea7fffacd3",
"score": "0.58591074",
"text": "def print_list(list)\n\tlist.each do |item, quantity|\n\t\tputs \"There are #{quantity} #{item} on the grocery list!!\"\n\tend\nend",
"title": ""
},
{
"docid": "c5ddb145f8e7116131f75b12027d2b66",
"score": "0.5858828",
"text": "def print_list(list)\n\tlist.each do |item, quantity| puts \"#{item}: #{quantity}\"\n\t\t\n\tend\nend",
"title": ""
},
{
"docid": "b377b65d81288829969898073de65fc7",
"score": "0.58554924",
"text": "def print_list(grocery_list)\n grocery_list.each { |item, quantity| puts \"You need #{quantity} #{item}\"}\nend",
"title": ""
},
{
"docid": "3843e3796520681f6fdf819a9c6aaf51",
"score": "0.5846212",
"text": "def print_list(shopping_list)\n puts shopping_list.each {|item, quantity| puts \"#{item}: #{quantity}\"}\nend",
"title": ""
},
{
"docid": "deeefc6bf7014ce11daac4e08c50aead",
"score": "0.5843955",
"text": "def order_print_out\n puts \"Your order is #{@the_order[0][:item_name]} with a side of #{@the_order[1][:item_name]} and #{@the_order[2][:item_name]}.\"\n puts \"Your total is $#{@the_order[0][:price] + @the_order[1][:price] + @the_order[2][:price]}.\"\n puts \"Thank you for your order.\"\n exit\nend",
"title": ""
},
{
"docid": "e12d65c3e32c837426da2a0265c71c21",
"score": "0.5842337",
"text": "def print_grocery_list(grocery_list) \n\t# create title and line break\n\tputs \"Current grocery list:\"\n\tputs \"----------\"\n\t# iterate through hash\n\tgrocery_list.each do |item, quantity|\n\t\t# print each item with its quantity\n\t\tputs \"#{item}: #{quantity}\"\n\tend\n\t# create line break for readability\n\tputs \"----------\"\nend",
"title": ""
},
{
"docid": "5e53f45c524cc94b12daca18a0a894e5",
"score": "0.58382237",
"text": "def print_list(list)\n\tlist.each do |item, quantity|\n\t\tputs \"#{item}, amount: #{quantity}\"\n\tend\nend",
"title": ""
}
] |
d74499e356da3f5afe0282365011e760
|
Returns the parameters for the search.
|
[
{
"docid": "a61b63f09178720be4359b8f54f7fe0c",
"score": "0.0",
"text": "def search_params\n params.permit(:title, :description, :page, :filter)\n end",
"title": ""
}
] |
[
{
"docid": "7d93f3ef672c19be3de25af2ef794f24",
"score": "0.8044792",
"text": "def search_params\n # TODO Configurar acá la variable params\n params[:query_name]\n end",
"title": ""
},
{
"docid": "60a6864b685162aff39c45d77403cda2",
"score": "0.78738123",
"text": "def search_params\n params[:search]\n end",
"title": ""
},
{
"docid": "55332ef0215b65bd722be17cf56a2888",
"score": "0.7804671",
"text": "def get_params\n @search = params[:search]\n @column = params[:column]\n @direction = params[:direction]\n @sort = params[:sort]\n end",
"title": ""
},
{
"docid": "6f81a771791fd0ba75f8b02502988eb0",
"score": "0.7519321",
"text": "def query_parameters\n end",
"title": ""
},
{
"docid": "d7b699f5c25df244d15820b8b7cb83e5",
"score": "0.74923223",
"text": "def params\n assemble_criteria || {}\n end",
"title": ""
},
{
"docid": "226a50f4d7f7e5ae2b3a4f4b82161bfe",
"score": "0.73954356",
"text": "def search_params\n params[:search]\n end",
"title": ""
},
{
"docid": "226a50f4d7f7e5ae2b3a4f4b82161bfe",
"score": "0.73954356",
"text": "def search_params\n params[:search]\n end",
"title": ""
},
{
"docid": "226a50f4d7f7e5ae2b3a4f4b82161bfe",
"score": "0.73954356",
"text": "def search_params\n params[:search]\n end",
"title": ""
},
{
"docid": "1b2e9b3756333b4751d31f1b4b832ce0",
"score": "0.73823345",
"text": "def set_search_params\n\n\t\t\t# Initialise an empty hash\n\t\t\t@search_parameters = Hash.new\n\n\t\t\t# Set the Query Value\n\t\t\t# TODO: Remove duplicate queries because the system isn't smart enough yet\n\t\t\t# \t\tuse the 'uniq' function\n\t\t\t@search_parameters['query'] = params[:q].split unless params[:q].blank?\n\n\t\t\t# Set the First SDG Filter Value\n\t\t\t@search_parameters['primary_sdg'] = params[:a].split unless params[:a].blank?\n\n\t\t\t# Set the Sector IDs\n\t\t\t@search_parameters['sector_ids'] = params[:b] unless params[:b].blank?\n\n\t\t\t# Set the Demographic IDs\n\t\t\t@search_parameters['demographic_ids'] = params[:c] unless params[:c].blank?\n\n\t\t\t# Set the Development Actors IDs\n\t\t\t@search_parameters['development_actor_ids'] = params[:d] unless params[:d].blank?\n\n\t\t\t# Set the Country IDs\n\t\t\t@search_parameters['country_ids'] = params[:e] unless params[:e].blank?\n\n\t\t\t# Set the Region IDs\n\t\t\t@search_parameters['region_ids'] = params[:f] unless params[:f].blank?\n\n\t\t\t# Set the Subregion IDs\n\t\t\t@search_parameters['subregion_ids'] = params[:g] unless params[:g].blank?\n\n\t\t\t# Set the Research Method IDs\n\t\t\t@search_parameters['research_method_ids'] = params[:h] unless params[:h].blank?\n\n\t\t\t# Set the Organisations\n\t\t\t@search_parameters['organisation_ids'] = params[:i] unless params[:i].blank?\n\n\t\t\t# Set the Organisation TYpes\n\t\t\t@search_parameters['organisation_type_ids'] = params[:j] unless params[:j].blank?\n\n\t\t\t# Set the Province\n\t\t\t@search_parameters['province_ids'] = params[:k] unless params[:k].blank?\n\n\t\t\t# Set the Advanced Search Flag\n\t\t\t@search_parameters['advanced_search_flag'] = params[:z] unless params[:z].blank?\n\n\t\tend",
"title": ""
},
{
"docid": "79d409f718702d20696e98be0158e73b",
"score": "0.7381113",
"text": "def search_params\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "64345a65f73f4b3b42f8bb1dcbe08032",
"score": "0.731869",
"text": "def search_params\n params.fetch(:search, {})\n end",
"title": ""
},
{
"docid": "d82a341a1a7c1799c87db533c594ae8f",
"score": "0.7313303",
"text": "def params_for_query\n params.merge(search_field: 'all_fields', q: params[:cq])\n end",
"title": ""
},
{
"docid": "8274cbab80a5efcf8aaabf20d3be6354",
"score": "0.7273714",
"text": "def search_params\n params[:name]\n end",
"title": ""
},
{
"docid": "751da205aa20f9dd37857f5089725e14",
"score": "0.7250599",
"text": "def search_params\n @search_params = whitelisted_params. \n to_h.\n except(:format, :action, :controller, :page, :per_page)\n end",
"title": ""
},
{
"docid": "bd9ef582b73bb424ca9028d3644836e8",
"score": "0.7240442",
"text": "def search_params\n unless @search_params\n @search_params = {}.with_indifferent_access\n [:warehouse_id, :user_id, :invoice_number].map do |key|\n @search_params[key] = (!params[key].blank?) ? params[key].to_s : nil\n end\n end\n @search_params\n end",
"title": ""
},
{
"docid": "bda040fc8295661c75f302a6d6f2fcb2",
"score": "0.72291553",
"text": "def search_params\n search_params = {}\n unless (@issn.nil? or @issn.empty?) and (@isbn.nil? or @isbn.empty?)\n search_params[:isbn] = @isbn unless @isbn.nil?\n search_params[:issn] = @issn if search_params.empty?\n else\n search_params[:title] = @title unless @title.nil?\n search_params[:author] = @author unless @title.nil? or @author.nil?\n search_params[:genre] = @genre unless @title.nil? or @author.nil? or @genre.nil?\n end\n return search_params\n end",
"title": ""
},
{
"docid": "a4c3464cdc0441e1f31606778cdd2ac5",
"score": "0.7222821",
"text": "def as_search_parameters\n h = JSON_COLUMNS.map { |c| [c, (self[c] || {})] }.to_h\n {\n identifier: h.dig(:query, :identifier),\n title: h.dig(:query, :title),\n creator: h.dig(:query, :creator),\n publisher: h.dig(:query, :publisher),\n q: h.dig(:query, :q),\n sortOrder: h.dig(:sort, :order),\n direction: h.dig(:sort, :direction),\n limit: h.dig(:page, :limit),\n start: h.dig(:page, :start),\n offset: h.dig(:page, :offset),\n accessibilityFeature: h.dig(:filter, :a11y_feature),\n braille: h.dig(:filter, :braille),\n contentType: h.dig(:filter, :content_type),\n country: h.dig(:filter, :country),\n fmt: h.dig(:filter, :format),\n formatFeature: h.dig(:filter, :format_feature),\n language: h.dig(:filter, :language),\n repository: h.dig(:filter, :repository),\n }.compact\n end",
"title": ""
},
{
"docid": "44db887b4b6f91155d9fb566ff389f3c",
"score": "0.7211701",
"text": "def get_search_params(params)\n search_params = {}\n search_params[:search] = params[:search] unless params[:search].blank?\n search_params[:sort] = params[:sort] unless params[:sort].blank?\n search_params[:authors] = params[:authors] unless params[:authors].blank?\n search_params[:categories] = params[:categories] unless params[:categories].blank?\n search_params[:document_type] = params[:document_type] unless params[:document_type].blank?\n search_params[:publisher] = params[:publisher] unless params[:publisher].blank?\n search_params[:city] = params[:city] unless params[:city].blank?\n search_params[:published] = params[:published] unless params[:published].blank?\n search_params[:page] = params[:page] unless params[:page].blank?\n return search_params\n end",
"title": ""
},
{
"docid": "e70e0792f7ba16911e88b30cbd3f0966",
"score": "0.72021484",
"text": "def search_params search\n search = Hash.new\n [:writing, :kana, :romaji, :def_de, :def_en, :def_fr].each do |field|\n search[field] = \"%#{params[:search]}%\"\n end\n search\n end",
"title": ""
},
{
"docid": "937972b53ec15ef42b560560de5f8a77",
"score": "0.71604776",
"text": "def aml_search_params\n {\n \"first_name\" => @user_extended_detail.first_name,\n \"last_name\" => @user_extended_detail.last_name,\n \"birthdate\" => @local_cipher_obj.decrypt(@user_extended_detail.birthdate).data[:plaintext],\n \"country\" => @local_cipher_obj.decrypt(@user_extended_detail.country).data[:plaintext]\n }\n end",
"title": ""
},
{
"docid": "b18e483c29fd64d32572dea01f5113f0",
"score": "0.71596235",
"text": "def params_search\n { order: 'name', return: 100, search: initial.downcase }\n end",
"title": ""
},
{
"docid": "94ea6d319a1c46fc6e1f5029b5ae6d9c",
"score": "0.7108069",
"text": "def search_params(params)\n params.slice(:company, :product, :slogan, :city, :state, :street_address, :zip)\n end",
"title": ""
},
{
"docid": "8cec4c94b432b252ec8cdede732b9b2f",
"score": "0.70788974",
"text": "def current_search_parameters\n return if on_the_dashboard?\n params[:q]\n end",
"title": ""
},
{
"docid": "c0ab6934849eeb7b1bdac7351e2452b3",
"score": "0.70703095",
"text": "def search_query\n params[:search_query]\n end",
"title": ""
},
{
"docid": "b9ba53b21305d5664610439b54fc603f",
"score": "0.7064811",
"text": "def base_search_params\n params.fetch(:base_search, {})\n end",
"title": ""
},
{
"docid": "33ef7d38728be970f9cfcc6423b37fef",
"score": "0.7052985",
"text": "def search_params\n params.require(:search_string)\n end",
"title": ""
},
{
"docid": "438db97cd72f075862dacf2501e738c3",
"score": "0.7052093",
"text": "def params\n {\n text_name: @text_name,\n search_name: @search_name,\n sort_name: @sort_name,\n display_name: @display_name,\n author: @author,\n rank: @rank\n }\n end",
"title": ""
},
{
"docid": "6de7a6312ec21facc1b0624653596a86",
"score": "0.7036889",
"text": "def query_parameters\n end",
"title": ""
},
{
"docid": "0432e381c2e1464261a2e270ad0beb1d",
"score": "0.7022211",
"text": "def obtain\n @params\n end",
"title": ""
},
{
"docid": "0eff399d3b9d213111ea58863cc571cd",
"score": "0.70141923",
"text": "def search_action_params\n Rack::Utils.parse_query URI(search_action_url).query\n end",
"title": ""
},
{
"docid": "23724a2349d14eaa17322d7f9c9a2017",
"score": "0.7010585",
"text": "def search_context_params\n search_state.params_for_search.except(:q, :qt, :page, :utf8)\n end",
"title": ""
},
{
"docid": "312b520ef3588613aa757735b6868d2c",
"score": "0.70066214",
"text": "def current_search_parameters\n if on_the_dashboard?\n return nil\n else\n return params[:q]\n end\n end",
"title": ""
},
{
"docid": "afe9f2a85f083bfaa9b006821e64c93b",
"score": "0.7001489",
"text": "def query\n params[:search][:query]\n end",
"title": ""
},
{
"docid": "e1604589d7fa79d339f09d04bff74c0a",
"score": "0.69959575",
"text": "def search_params\n unless params[:search].nil? || params[:search] == '' || params[:search] == ' '\n @search = params.require(:search)\n end\n end",
"title": ""
},
{
"docid": "3ce637aedcd9a59daa9b803f21abac9f",
"score": "0.6993666",
"text": "def parameters\n request.query_parameters\n end",
"title": ""
},
{
"docid": "ba80ff2ea4cd67d5f58607affee123e7",
"score": "0.6992488",
"text": "def parameters\n FormUrlencodedParams.parse(query) if query\n end",
"title": ""
},
{
"docid": "9601250f987a1d6cccf75a215af00a95",
"score": "0.69838816",
"text": "def search_params(params)\n params.slice(:first_name, \n :last_name, \n :full_name, \n :on_this_date, \n :end_time, \n :start_time, \n :comments, \n :day, \n :id,\n :within_month,\n :within_decade,\n :within_year)\n end",
"title": ""
},
{
"docid": "130ab5c4aab60ee34a3e5b7ac65ff710",
"score": "0.69793296",
"text": "def query_params\n request.query_parameters\n end",
"title": ""
},
{
"docid": "130ab5c4aab60ee34a3e5b7ac65ff710",
"score": "0.69793296",
"text": "def query_params\n request.query_parameters\n end",
"title": ""
},
{
"docid": "1678230f09f2740795853f488a14fe58",
"score": "0.6964905",
"text": "def current_search_params(search_params = nil)\n search_params ||= params\n h = {}\n h[:query] = search_params[:query].strip if search_params[:query].present?\n h[:category_id] = search_params[:category_id] if search_params[:category_id].to_i > 0\n h[:school_id] = search_params[:school_id] if search_params[:school_id].to_i > 0\n h[:near_by_school_ids] = search_params[:near_by_school_ids] if search_params[:near_by_school_ids].present?\n h[:sort] = search_params[:sort] if ::ItemsHelper.valid_sort?(search_params[:sort] )\n h\n end",
"title": ""
},
{
"docid": "691ec3960cb9005cbbddf16d3c8b611d",
"score": "0.696342",
"text": "def get_params_to_search(context)\n if params[:saved_search].present?\n @saved_search = SavedSearch.find_by(id: params[:saved_search], context: context)\n end\n return params[:q] if params[:use_search_params].present?\n params[:q] = @saved_search.try(:search_params) || params[:q]\n end",
"title": ""
},
{
"docid": "62ee4e76e7e6b00353ce76a97be8794e",
"score": "0.6899318",
"text": "def search_params( parameters = nil )\n if parameters.nil?\n parameters = params.dup\n end\n \n # Remove non-Searchlogic elements\n search_keys = SEARCH_PARAMS_MAP.map { |param| param[:key] }\n parameters.delete_if {\n |key, value| ! search_keys.include?( key.to_sym ) }\n \n return sanitize_search_params( parameters )\n end",
"title": ""
},
{
"docid": "fa0359d9be5c3e593c3962765400e0db",
"score": "0.68986994",
"text": "def search_qry\n {\n location: @attribs[:loc],\n keywords: @attribs[:q]\n }.merge(default_params).compact.to_query\n end",
"title": ""
},
{
"docid": "0ce60edbdca90f3a5ebc399539847e06",
"score": "0.68912655",
"text": "def index\n puts \"--> ParamSets#index\"\n #@param_sets = ParamSet.all\n\n puts \"YAML::: \" + params.to_yaml\n if params[:search_param_sets].present?\n puts \"Received Query: \" + params[:search_param_sets][:query]\n #@current_page = (search_params[:page] || 1).to_i\n #@total_pages = (RubyGem.count / PAGE_SIZE.to_f).ceil\n #page_offset = (@current_page - 1) * PAGE_SIZE\n #@search_results = RubyGem.order(:created_at).limit(PAGE_SIZE).offset(page_offset)\n search()\n end\n end",
"title": ""
},
{
"docid": "3c39d545f1af86e519f83831715e473c",
"score": "0.6886461",
"text": "def query_parameters; end",
"title": ""
},
{
"docid": "61c1704905baaa20a1f6bb0954b02761",
"score": "0.6883837",
"text": "def setting_searching_params(*args)\n\t\toptions = args.extract_options!\n\t\tif options[:from_params]\n\t\t\toptions = options[:from_params]#.merge({ :cat => nil, :models => nil })\n\t\tend\n\t\tmodels =\n\t\t\tif options[:cat]\n\t\t\t\tif options[:cat] == 'item'\n\t\t\t\t\tavailable_items_list\n\t\t\t\telsif options[:cat] == 'container'\n\t\t\t\t\tavailable_containers\n\t#\t\t\telsif options[:cat] == 'profile'\n\t#\t\t\t\tavailable_profile\n\t\t\t\tend\n\t\t\telse\n\t\t\t\t(available_items_list+available_containers)\n\t\t\tend\n\t\t#raise models.inspect\n\t\treturn {\n\t\t\t:user => @current_user,\n\t\t\t:permission => 'show',\n\t\t\t:category => options[:cat],\n\t\t\t:models => options[:m] || models || [],\n :containers => options[:containers] || current_container ? [current_container.class.to_s.underscore+'-'+current_container.id.to_s] : nil,\n\t\t\t:full_text => (options[:q] && !options[:q].blank? && options[:q] != I18n.t('layout.search.search_label')) ? options[:q] : nil,\n\t\t\t:conditions => options[:cond],\n\t\t\t:filter => { :field => options[:by] ? options[:by].split('-').first : 'created_at', :way => options[:by] ? options[:by].split('-').last : 'desc' },\n\t\t\t:pagination => { :page => options[:page] || 1, :per_page => options[:per_page] || get_per_page_value },\n\t\t\t:opti => options[:opti] ? options[:opti] : 'skip_pag_but_filter'\n\t\t\t}\n\tend",
"title": ""
},
{
"docid": "45e9e55a4ad3bacfc2973631c1db9642",
"score": "0.68828845",
"text": "def params_search(query: [], artist: nil, genres: [],\n excluded_artists: [], excluded_genres: [])\n { action: 'exploreLoad',\n artist: artist.to_s,\n style: genres,\n exartist: excluded_artists,\n exstyle: excluded_genres,\n searchQuery: query,\n orderType: 'downloads',\n orderDate: 'all',\n orderDateMagnitude: '', # wut\n onlyShowBroken: false\n }\n end",
"title": ""
},
{
"docid": "1f9351ac63df54e66e0e953e3b81d5f1",
"score": "0.68769157",
"text": "def params\n request.GET\n end",
"title": ""
},
{
"docid": "c42eb2b1ea98fe910b492f771f93cad7",
"score": "0.68561006",
"text": "def search_options(options)\n {\n search: {\n parameters: options\n }\n }\n end",
"title": ""
},
{
"docid": "8c3856f8caa24fc9dde48431ba643459",
"score": "0.68455374",
"text": "def search_params\n params.permit(%i[\n description\n gis_identifier\n condition\n evaluated\n type_id\n division_id\n suburb_id\n model_id\n query\n sort_by\n sort_dir\n ])\n end",
"title": ""
},
{
"docid": "be780128ae9e2770373a3ab3d0a6d59e",
"score": "0.6842905",
"text": "def search_params\n params.fetch(:search, {})\n end",
"title": ""
},
{
"docid": "fcb1bcf4c2bd4356d74318b2e0bdeed2",
"score": "0.6838271",
"text": "def build_params #(params={})\n params = { session_id: @session.id }\n params[:search_value] = @search_phrase if @search_phrase\n params[:item_ids] = @item_ids if @item_ids\n params.merge!({ page_size: GET_ITEMS_PAGE_SIZE, page_number: @page.to_i }) unless @item_ids\n params\n end",
"title": ""
},
{
"docid": "d533cb358d616e19627261fea5228879",
"score": "0.68368715",
"text": "def build_search_params\n {\n keyword: '',\n skills: '',\n locations: '',\n company_names: '',\n titles: '',\n schools: '',\n degrees: '',\n names: '',\n phone_number_available: '0',\n active: '0',\n top_company: '0',\n top_school: '0',\n emails: '',\n tags: ''\n }\nend",
"title": ""
},
{
"docid": "0c6e8c665610304eaa73ef7493de7628",
"score": "0.6827776",
"text": "def params\n @params\n end",
"title": ""
},
{
"docid": "e763dabaaef8ace59c46895f9fdedeec",
"score": "0.6826752",
"text": "def query_params\n @query_params ||= queries.map { |q| q[:data] }\n .flatten(1)\n .select { |d| data_has_value?(d) }\n .map { |d| [d.first, d.last[:value]] }\n end",
"title": ""
},
{
"docid": "7006a594bdb54da50dda6b1b9875e05d",
"score": "0.68262744",
"text": "def public_settable_search_args\n [:query, :search_field, :semantic_search_field, :sort, :page, :start, :per_page]\n end",
"title": ""
},
{
"docid": "4f40440c7ba7e7ad7c6638dabfab395e",
"score": "0.6825405",
"text": "def params\n request.parameters\n end",
"title": ""
},
{
"docid": "19b6c69cfb1a2bee469126e6b4765ee1",
"score": "0.6820615",
"text": "def parameters\n # Earliest time we should look for events; defaults to 7 days ago.\n earliest_time = Config.config['splunk']['earliest_time'] ?\n Config.config['splunk']['earliest_time'] :\n '7d'\n\n # Latest time we should look for events; defaults to now.\n latest_time = Config.config['splunk']['latest_time'] ?\n Config.config['splunk']['latest_time'] :\n 'now'\n\n # Maximum results returned; defaults to 100.\n max_results = Config.config['splunk']['max_results'] ?\n Config.config['splunk']['max_results'] :\n 100\n\n params = {\n 'exec_mode' => 'oneshot',\n 'earliest_time' => \"-#{earliest_time}\",\n 'latest_time' => latest_time,\n 'output_mode' => @splunk_output,\n 'count' => max_results\n }\n if @splunk_index.nil?\n params['search'] = \"search #{@splunk_query}\"\n else\n params['search'] = \"search index=#{@splunk_index} \" + @splunk_query\n end\n\n params\n end",
"title": ""
},
{
"docid": "fba793c09262beb8c561d7730459f555",
"score": "0.6816656",
"text": "def search_params\n params.permit(:i, :t, :y, :s, :list_id, :source_page)\n end",
"title": ""
},
{
"docid": "859713a05bd256163715659dd7854404",
"score": "0.68110746",
"text": "def get_query_params\n @sorters = permit_sort_params\n @page = permit_p_param\n @num = permit_n_param\n end",
"title": ""
},
{
"docid": "e28fa3f5759b21680f3a7b53b392f547",
"score": "0.6805805",
"text": "def searchbyloc_params\n params.fetch(:searchbyloc, {})\n end",
"title": ""
},
{
"docid": "1105a2feae212fb2b2aa23ca2212a6e5",
"score": "0.6805573",
"text": "def setup_search_options\n params[:search] ||= \"\"\n params.keys.each do |param|\n if param =~ /(\\w+)_id$/\n unless params[param].blank?\n query = \" #{$1} = #{params[param]}\"\n params[:search] += query unless params[:search].include? query\n end\n end\n end\n end",
"title": ""
},
{
"docid": "d716491d58bfcd11917b126c1c4ed0c3",
"score": "0.6801306",
"text": "def getParamValues(field)\n if !field.nil?\n return params.require(:search_query).permit(field)[field]\n end\n end",
"title": ""
},
{
"docid": "d716491d58bfcd11917b126c1c4ed0c3",
"score": "0.6801306",
"text": "def getParamValues(field)\n if !field.nil?\n return params.require(:search_query).permit(field)[field]\n end\n end",
"title": ""
},
{
"docid": "d44114088eddaf6b906a0e0fb704627d",
"score": "0.6800085",
"text": "def api_v1_base_search_params\n params.fetch(:api_v1_base_search, {})\n end",
"title": ""
},
{
"docid": "e6bae7f787062351973fe010b925e835",
"score": "0.67990994",
"text": "def get_search_args_from_params(params)\n options = {}\n %w(metrics sort fields zip distance page per_page debug).each do |opt|\n options[opt.to_sym] = params.delete(\"_#{opt}\")\n # TODO: remove next line to end support for un-prefixed option parameters\n options[opt.to_sym] ||= params.delete(opt)\n end\n options[:endpoint] = params.delete(\"endpoint\") # these two params are\n options[:format] = params.delete(\"format\") # supplied by Padrino\n options[:fields] = (options[:fields] || \"\").split(',')\n options[:command] = params.delete(\"command\")\n\n options[:metrics] = options[:metrics].split(/\\s*,\\s*/) if options[:metrics]\n options\nend",
"title": ""
},
{
"docid": "bbd5be59608b0cff97b591d5f8e23f5a",
"score": "0.6777357",
"text": "def to_params\n params = {}\n if @keywords\n params[:q] = @keywords\n params[:fl] = '* score'\n params[:fq] = types_phrase\n params[:qf] = text_field_names.join(' ')\n params[:defType] = 'dismax'\n else\n params[:q] = types_phrase\n end\n params\n end",
"title": ""
},
{
"docid": "5541d2557713d9456ee29dbb2ae3e14e",
"score": "0.67746323",
"text": "def search_params\n params.require(:search, :page, :art_id, :art_type)#.permit(:user_id, :art_id, :art_type, :text, :anonymous)\n end",
"title": ""
},
{
"docid": "c2a3ff4eecd8b83d3a03af3ec056749a",
"score": "0.6764681",
"text": "def to_params\n params = { :q => @keywords }\n params[:fl] = '* score'\n params[:qf] = @fulltext_fields.values.map { |field| field.to_boosted_field }.join(' ')\n params[:defType] = 'join'\n params[:mm] = @minimum_match if @minimum_match\n\n params\n end",
"title": ""
},
{
"docid": "7b38689dda888509e7a86a9288944a97",
"score": "0.6764293",
"text": "def search(query, params={})\n end",
"title": ""
},
{
"docid": "e9851bdbd66287e7be93fd658a3b9b1d",
"score": "0.6759076",
"text": "def current_query_params\n values = current_search_session.try(:query_params)\n values.to_h\n end",
"title": ""
},
{
"docid": "3741a97957fc46edf5f030adfb24d014",
"score": "0.67527133",
"text": "def to_params\n { :q => types_phrase }\n end",
"title": ""
},
{
"docid": "d471200beea84befc865829e3097d534",
"score": "0.67487675",
"text": "def default_search_params\n {\n content_cont: '',\n user_kind_in: [],\n user_looking_for: [],\n city_eq: '',\n within_range: [0, nil],\n user_id_eq: nil,\n user_is_verified_eq: nil,\n user_is_drinker_eq: nil,\n user_is_smoker_eq: nil,\n user_with_photos: nil,\n user_without_photos: nil,\n user_birth_year_or_user_birth_year_second_person_lteq: Time.now.year - 18,\n user_birth_year_or_user_birth_year_second_person_gteq: Time.now.year - 50,\n height: '',\n user_height_lteq: nil,\n user_height_gteq: nil,\n user_body_in: [],\n user_interests_id_in: [],\n sorts: sort_options[0][:value]\n }\n end",
"title": ""
},
{
"docid": "90e7e5f3cd01b31ab67bed5bfa59101e",
"score": "0.6746664",
"text": "def search_values\n searching_text = \"%#{query_params[:search_query]}%\"\n Array.new(number_of_search_fields, searching_text)\n end",
"title": ""
},
{
"docid": "6f53f8bb5e16d66843eac3126b525a61",
"score": "0.6746648",
"text": "def dspace_item_search_params\n unless params[:q].nil?\n params.require(:q)\n # .permit(\n # :limit, :offset, expand: [],\n # collection: [], filters: [],\n # query_field: [], query_op: [], query_val: []\n # )\n params['q']\n end\n end",
"title": ""
},
{
"docid": "e34ea828c0b5e0f0cbb9fa4e6c94115f",
"score": "0.67465836",
"text": "def grab_search_params(location)\n\n params = {}\n\n params[:'search-text'] = \"Web Developer\"\n params[:'search-location'] = location\n params[:'start_date'] = Date.today\n\n verify_search(params, location)\n\n end",
"title": ""
},
{
"docid": "091e3495e77a162e1af1ace3e1274fb7",
"score": "0.6745221",
"text": "def search_params\n if params[:q] == nil\n params[:q] = session[search_key]\n end\n if params[:q]\n session[search_key] = params[:q]\n end\n params[:q]\n end",
"title": ""
},
{
"docid": "c7386051d760980f91789845a634ec20",
"score": "0.67413074",
"text": "def params\n @params\n end",
"title": ""
},
{
"docid": "c7386051d760980f91789845a634ec20",
"score": "0.67413074",
"text": "def params\n @params\n end",
"title": ""
},
{
"docid": "6528e9aacbc01181f7743129898dfabb",
"score": "0.67298937",
"text": "def search_query(params)\n search_data = {}.tap do |data|\n data[:term] = params[\"term\"] if params[\"term\"]\n data[:location] = params[\"location\"] if params[\"location\"]\n data[:latitude] = params[\"latitude\"] if params[\"latitude\"]\n data[:longitude] = params[\"longitude\"] if params[\"longitude\"]\n data[:radius] = params[\"radius\"] if params[\"radius\"]\n data[:categories] = params[\"categories\"] if params[\"categories\"]\n data[:limit] = params[\"limit\"] if params[\"limit\"] ||= \"100\"\n data[:sort_by] = params[\"sort_by\"] if params[\"sort_by\"]\n data[:price] = params[\"price\"] if params[\"price\"]\n data[:open_now] = params[\"open_now\"] if params[\"open_now\"]\n data[:open_at] = params[\"open_at\"] if params[\"open_at\"]\n data[:attributes] = params[\"attributes\"] if params[\"attributes\"]\n end\n end",
"title": ""
},
{
"docid": "1e2bb4f9d5e5fd0d9658d4a3617060f6",
"score": "0.6729011",
"text": "def search(parameters = {})\n Array.load(search_path(parameters))\n end",
"title": ""
},
{
"docid": "c7fddc382b357e70bd6d6a80e4a23d85",
"score": "0.67263335",
"text": "def query_params\n {}\n end",
"title": ""
},
{
"docid": "c7fddc382b357e70bd6d6a80e4a23d85",
"score": "0.67263335",
"text": "def query_params\n {}\n end",
"title": ""
},
{
"docid": "6c0cfaa8b6d2ea99f0cc12be17705431",
"score": "0.6726039",
"text": "def search_params\n\t\tparams.permit(\"title_string\", \"artist\", \"year\", \"festival_string\")\n\tend",
"title": ""
},
{
"docid": "5a4bdaa87bbf81380202273c8721b181",
"score": "0.67258644",
"text": "def params_for_query\n params.merge(q: params[:cq])\n end",
"title": ""
},
{
"docid": "5a4bdaa87bbf81380202273c8721b181",
"score": "0.67258644",
"text": "def params_for_query\n params.merge(q: params[:cq])\n end",
"title": ""
},
{
"docid": "d6a0c7c69195f5f11094e641fe4c487d",
"score": "0.67252636",
"text": "def params\n @params.keys\n end",
"title": ""
},
{
"docid": "eb803e464dcc90b4c48424a1b348973f",
"score": "0.67250645",
"text": "def build_search_params\n {\n keyword: '',\n skills: '',\n locations: '',\n company_names: '',\n titles: '',\n schools: '',\n degrees: '',\n names: '',\n phone_number_available: false,\n active: false,\n top_company: false,\n top_school: false,\n emails: '',\n tags: ''\n }\nend",
"title": ""
},
{
"docid": "5023da5c5efbabdc72823625e880c0a1",
"score": "0.672365",
"text": "def params\n @params ||= {}\n end",
"title": ""
},
{
"docid": "d1f95b5fbc36f9c8ee96df90a337a39e",
"score": "0.67216855",
"text": "def fetch_finder_params\n return nil if params.blank? # trivial case\n f_params = {}\n FIND_PARAMS.each {|key| f_params[key] = params[key] if params.has_key?(key) && params[key].present? }\n\n f_params\n end",
"title": ""
},
{
"docid": "8b2183bb74a409538718b0638a917635",
"score": "0.67187047",
"text": "def get_params()\n return self.params.keys\n end",
"title": ""
},
{
"docid": "da9baea77a35dfdd2391bf0cb57ce949",
"score": "0.6714838",
"text": "def search(_params = {})\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "8106704ddb39dc0f70b3ee168c42c200",
"score": "0.6713785",
"text": "def search_query\n sequence_details[:search]\n end",
"title": ""
},
{
"docid": "8565da3160a36ce33d6594983d59e2d0",
"score": "0.671221",
"text": "def parameters()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "156d2a8aeb55c3a0834bb11e1331f122",
"score": "0.6695258",
"text": "def search(param) \n end",
"title": ""
},
{
"docid": "ff35aa512e4a655af07ed012f5f3a715",
"score": "0.6694199",
"text": "def search\n #depends on what to search\n search_by = Hash.new\n\n if not params[:name].blank?\n search_by[:name] = params[:name]\n end\n\n end",
"title": ""
},
{
"docid": "f9e4fa2e6f273f78fe6955d4c368476d",
"score": "0.66939366",
"text": "def params\n @params ||= {}\n end",
"title": ""
},
{
"docid": "0b8d3cef97ea40628cf330bcddc00dd2",
"score": "0.6676531",
"text": "def params\n return @params\n end",
"title": ""
},
{
"docid": "cb3e07801cd47054bb52568a80150e6b",
"score": "0.66739345",
"text": "def query_params\n { token: Adknowledge.token,\n idomain: idomain,\n cdomain: cdomain,\n request: request,\n subid: subid,\n test: test ? 1 : 0\n }\n end",
"title": ""
},
{
"docid": "167094a1b6ea3ff9f94b685f959429ce",
"score": "0.6671175",
"text": "def get_query\n kvs = []\n @params.each do |k,v|\n kvs.push(k.to_s+\"=\"+v.to_s)\n end\n return \"?#{kvs.join('&')}\"\n end",
"title": ""
},
{
"docid": "5d3ffd95655d4c5e7b0a5a25fc31b473",
"score": "0.66622895",
"text": "def get_query_params\n # return {key: value[0] for key, value in @query.items()}\n return Hash[@query.map{ |k, v| [k, v[0]] }]\n end",
"title": ""
}
] |
5d5f8c98bf8f3a65886cee8682f15085
|
UNIT TEST FOR METHOD print_output Method uses prospector_num as the Rubyist when printing
|
[
{
"docid": "8c7cdb640ba76827f20a66d0a3a61d13",
"score": "0.8271048",
"text": "def test_print_output\n p = Prospector.new(1, 1, 1)\n p.initial_vals\n p.days = 10\n p.real_ruby_count = 4\n p.fake_ruby_count = 2\n def p.day_form(num); 'days'; end\n def p.ruby_form(num); 'rubies'; end\n def p.mood(real_ruby_count); 1; end\n assert_output (\"After 10 days, Rubyist 42 found:\\n\\t4 rubies.\\n\\t2 fake rubies.\\n\") {p.print_output(42) }\n end",
"title": ""
}
] |
[
{
"docid": "762b7441b4594db2c3144c29f62213d6",
"score": "0.7053623",
"text": "def test_print_results\n @d.books = 6\n @d.dinos = 11\n @d.classes = 4\n assert_output(\"Driver 1 obtained 6 books!\\nDriver 1 obtained 11 dinosaur toys!\\nDriver 1 attended 4 classes!\\n\") { @d.print_results }\n end",
"title": ""
},
{
"docid": "0d95d6b5b408ee917b833218fda4f172",
"score": "0.6784311",
"text": "def test_see_results_valid_output\n mock_map = Minitest::Mock.new('Mock Map')\n mock_map_finder = Minitest::Mock.new('Mock Map Finder')\n pete = Prospector.new(mock_map, mock_map_finder)\n out_put = \"\\n\\nAfter 0 days prospector #4 returned to San Francisco with:\\n\"\n out_put += \" 0 ounces of silver\\n 0 ounces of gold\\n Heading home with $0.00\\n\\n\\n\"\n assert_output(out_put) { pete.see_results(4) }\n end",
"title": ""
},
{
"docid": "d57a80cd47eff986feb3b849720d025e",
"score": "0.6767852",
"text": "def test_print_end_valid_output2\n test_map = Minitest::Mock.new('Mock Map')\n test_map_graph = Minitest::Mock.new('Mock Map')\n search = Prospector.new(test_map, test_map_graph)\n out_put = \"After 0 days Rubyist #4 found:\\n\"\n out_put += \" 5 rubies\\n 0 fake rubies\\nGoing home sad.\\n\\n\\n\"\n assert_output(nil) { search.print_end(4) }\n end",
"title": ""
},
{
"docid": "730a23f09cad8b52b28a2939f4a0382d",
"score": "0.67668915",
"text": "def test_print_end_valid_output1\n test_map = Minitest::Mock.new('Mock Map')\n test_map_graph = Minitest::Mock.new('Mock Map')\n search = Prospector.new(test_map, test_map_graph)\n out_put = \"After 1 days Rubyist #4 found:\\n\"\n out_put += \" 10 rubies\\n 0 fake rubies\\nGoing home victorious.\\n\\n\\n\"\n assert_output(nil) { search.print_end(4) }\n end",
"title": ""
},
{
"docid": "4bc83b670ef0a59303dc464b54ee5204",
"score": "0.6743847",
"text": "def test_print_end_valid_output\n test_map = Minitest::Mock.new('Mock Map')\n test_map_graph = Minitest::Mock.new('Mock Map')\n search = Prospector.new(test_map, test_map_graph)\n out_put = \"After 0 days Rubyist #4 found:\\n\"\n out_put += \" 0 rubies\\n 0 fake rubies\\nGoing home empty-handed.\\n\\n\\n\"\n assert_output(out_put) { search.print_end(4) }\n end",
"title": ""
},
{
"docid": "9b4aae9d0117f2dac3322934bda88c81",
"score": "0.67062634",
"text": "def test_print_stats\n assert_output(/Rubyist 1/) {@game.print_final_stats(0)}\n end",
"title": ""
},
{
"docid": "11c348206867c208d009a68837236999",
"score": "0.6568",
"text": "def test_display_results\n assert_output(\"After 527 days Prospector #667 returned to San Fransisco with:\\n\\t0 ounces of gold.\\n\\t0 ounces of silver.\\n\\tHeading home with $0.00\\n\") {@p.display_results 667, 527, 0, 0}\n \n end",
"title": ""
},
{
"docid": "a0a6097a3d8790afce53520fd8770c09",
"score": "0.6550994",
"text": "def print\n print_header\n @pairs.each { |name, path| print_line name, @statistics[name] }\n print_splitter\n\n if @total\n print_line 'Total', @total\n print_splitter\n end\n\n print_code_test_stats\n end",
"title": ""
},
{
"docid": "e2de288e726d2ee44b3b36d08fbf22f2",
"score": "0.65290976",
"text": "def test_rubies_and_fakes_output\n mixed_miner = Prospector.new(0, @dummy_location, 0, rubies = 2, fakes = 2)\n assert_equal \"\\tFound 2 rubies and 2 fake rubies in #{@dummy_location.name}.\",\n mixed_miner.format_output(mixed_miner.rubies, mixed_miner.fakes)\n end",
"title": ""
},
{
"docid": "b37037fcdbf2daaaebcaa4fe29f082d3",
"score": "0.65182596",
"text": "def inspect_output; end",
"title": ""
},
{
"docid": "65e6c90957c02dda0c885db152f9b622",
"score": "0.6511867",
"text": "def print\n puts @output\n end",
"title": ""
},
{
"docid": "341844ee099acf1061bc5dd7057f73a3",
"score": "0.65115064",
"text": "def test_print_final_results_ounce_one\n test_prospector = Prospector.new 'Prospector 1'\n test_prospector.days = 30\n test_prospector.holdings['gold'] = 1\n test_prospector.holdings['silver'] = 1\n message = \"After 30 days, Prospector #1 returned to San Francisco with: \\n\" \\\n \"\\t 1 ounce of gold\\n\" \\\n \"\\t 1 ounce of silver\\n\" \\\n\t\"\\t Heading home with $21.98.\\n\\n\\n\"\n assert_output(message) { test_prospector.print_final_results }\n end",
"title": ""
},
{
"docid": "228bf0fe37a9e91f7fd6f4464a7f7b18",
"score": "0.6483002",
"text": "def print_output output\n puts output\n end",
"title": ""
},
{
"docid": "4bff4de555348b968d63be26e297632d",
"score": "0.6474036",
"text": "def test_print_ruby\n test = Simulator.new(0)\n test.totalr = 1\n assert_output(/\\tFound 1 ruby in Enumerable Canyon. /) {test.print_rubies(test.totalr, test.totalf)}\n end",
"title": ""
},
{
"docid": "cdf78077d1493bd9afc879f054a75dcd",
"score": "0.6410769",
"text": "def print\n puts self.output\n end",
"title": ""
},
{
"docid": "d7a7fb941be82b605c255d3ab5dc5a27",
"score": "0.64070237",
"text": "def test_print_rubies_one_zero\n p = Prospector.new(1, 1, 1)\n def p.ruby_form(num); 'ruby'; end\n assert_output (\"\\tFound 1 ruby in Pitt.\\n\") {p.print_rubies(1, 0, 'Pitt') }\n end",
"title": ""
},
{
"docid": "5b12b3176ad03a3bde1b7b6cb1da50bf",
"score": "0.63766205",
"text": "def test_print_final_results_ounces_greater_than_zero\n test_prospector = Prospector.new 'Prospector 1'\n test_prospector.days = 30\n test_prospector.holdings['gold'] = 3\n test_prospector.holdings['silver'] = 4\n message = \"After 30 days, Prospector #1 returned to San Francisco with: \\n\" \\\n \"\\t 3 ounces of gold\\n\" \\\n \"\\t 4 ounces of silver\\n\" \\\n\t\"\\t Heading home with $67.25.\\n\\n\\n\"\n assert_output(message) { test_prospector.print_final_results }\n end",
"title": ""
},
{
"docid": "fc352cd04b2bcc93b151411743642e98",
"score": "0.63530993",
"text": "def test_mood_ten\n p = Prospector.new(1, 1, 1)\n assert_output (\"Going home victorious!\\n\") {p.mood(10) }\n end",
"title": ""
},
{
"docid": "75522272e4704b8f65097d1ced69d245",
"score": "0.635082",
"text": "def test_only_rubies_output\n lucky_miner = Prospector.new(0, @dummy_location, 0, rubies = 2, fakes = 0)\n assert_equal \"\\tFound 2 rubies in #{@dummy_location.name}.\",\n lucky_miner.format_output(lucky_miner.rubies, lucky_miner.fakes)\n end",
"title": ""
},
{
"docid": "2efed621313356a105e985add79fe4d6",
"score": "0.6341577",
"text": "def test_print_final_results_ounces_zero\n test_prospector = Prospector.new 'Prospector 1'\n test_prospector.days = 30\n test_prospector.holdings['gold'] = 0\n test_prospector.holdings['silver'] = 0\n message = \"After 30 days, Prospector #1 returned to San Francisco with: \\n\" \\\n \"\\t 0 ounces of gold\\n\" \\\n \"\\t 0 ounces of silver\\n\" \\\n\t\"\\t Heading home with $0.00.\\n\\n\\n\"\n assert_output(message) { test_prospector.print_final_results }\n end",
"title": ""
},
{
"docid": "5e87687ce47ca21634b6d6832b4e78a0",
"score": "0.6341076",
"text": "def test_print_rubies # Failure\n test = Simulator.new(0)\n test.totalr = 3\n assert_output(/\\tFound 2 rubies in Enumerable Canyon. /) {test.print_rubies(test.totalr, test.totalf)}\n end",
"title": ""
},
{
"docid": "54d29fd5496cd795390854048015223f",
"score": "0.63206804",
"text": "def test_print_rubies_four_two\n p = Prospector.new(1, 1, 1)\n def p.ruby_form(num); 'rubies'; end\n assert_output (\"\\tFound 4 rubies and 2 fake rubies in Pitt.\\n\") {p.print_rubies(4, 2, 'Pitt') }\n end",
"title": ""
},
{
"docid": "3f3cbfae1c27847a24d6228e29e86423",
"score": "0.6315495",
"text": "def test_print_rubies_zero_one\n p = Prospector.new(1, 1, 1)\n def p.ruby_form(num); 'ruby'; end\n assert_output (\"\\tFound 1 fake ruby in Pitt.\\n\") {p.print_rubies(0, 1, 'Pitt') }\n end",
"title": ""
},
{
"docid": "ff0a8e14fc97010a76d81126a585ebfb",
"score": "0.6288305",
"text": "def test_print_stats\n\t\tgame = Game::new\n\t\tdriver = Minitest::Mock.new(\"test driver\")\n\t\tdef driver.books; 1; end\n\t\tdef driver.classes; 1; end\n\t\tdef driver.toys; 1; end\n\t\tassert_output(\"Driver 1 obtained 1 book!\\nDriver 1 obtained 1 dinosaur toy!\\nDriver 1 attended 1 class!\\n\",nil) { game.print_stats(driver, 1) }\n\tend",
"title": ""
},
{
"docid": "9cc80f149c6a48d83a254129bfdf796a",
"score": "0.62691635",
"text": "def print(str); @output.print(str); end",
"title": ""
},
{
"docid": "eaffeff8261b114d4813f66892400a8a",
"score": "0.6248905",
"text": "def print output_formatter\n output_formatter.print({ \"Commits:\" => @commits, \"Affected lines churn:\" => @result})\n end",
"title": ""
},
{
"docid": "65eb28319888c92a612488bd183d55c2",
"score": "0.6234012",
"text": "def status io = self.output\n format = \"%d tests, %d assertions, %d failures, %d errors, %d skips\"\n io.puts format % [test_count, assertion_count, failures, errors, skips]\n end",
"title": ""
},
{
"docid": "2a6fd758ab3601934e1944abeed6fd3d",
"score": "0.62313014",
"text": "def output\n test.output\n end",
"title": ""
},
{
"docid": "f01a2e38d3fc64f7755d26e6f3b8adf1",
"score": "0.6229922",
"text": "def _print_num # print_num value\r\n text = @operands[0]\r\n\r\n @screen.print text.to_s\r\n\r\n dbg :print { text }\r\n end",
"title": ""
},
{
"docid": "3018aecf7ee14596a99354018035864d",
"score": "0.62237257",
"text": "def output_sums(person,output)\n puts \"#{person.number} #{person.genotype_sum()} #{person.num_no_calls} #{person.num_calls}\"\n #flush\n end",
"title": ""
},
{
"docid": "07d8be0291634a53b9717fe2eba61061",
"score": "0.6220736",
"text": "def test_print_rubies_zero_zero\n p = Prospector.new(1, 1, 1)\n assert_output (\"\\tFound no rubies or fake rubies in Pitt.\\n\") {p.print_rubies(0, 0, 'Pitt') }\n end",
"title": ""
},
{
"docid": "46d53942f918f7c7b8a139d1c16b766f",
"score": "0.6220084",
"text": "def test_empty_handed_output\n empty_handed_miner = Prospector.new(0, @dummy_location, 0, rubies = 0, fakes = 0)\n assert_equal \"\\tFound no rubies or fake rubies in #{@dummy_location.name}.\",\n empty_handed_miner.format_output(empty_handed_miner.rubies, empty_handed_miner.fakes)\n end",
"title": ""
},
{
"docid": "8ce1594839450c19e52b7f1456bebaa4",
"score": "0.6214472",
"text": "def test_print_total_0_real_0_fake\n game1 = Game.new\n assert_output (\"\\t0 rubies\\n\\t0 fake rubies\\n\") { game1.print_total([0, 0, 0]) }\n end",
"title": ""
},
{
"docid": "fbe385ca7afcf9609ab1868d989cf0e0",
"score": "0.6209729",
"text": "def print(_output = nil)\n #This is a stub, used for indexing\nend",
"title": ""
},
{
"docid": "a06dabbdf77cf221f12c544ddc4aed18",
"score": "0.62072325",
"text": "def print(out); puts out; end",
"title": ""
},
{
"docid": "4bc4e688853a85c09c689f35fadcf072",
"score": "0.6198801",
"text": "def print_result(result, description)\n printer = RubyProf::FlatPrinter.new(result)\n print \"#{'-' * 50} #{description}\\n\"\n printer.print($stdout)\nend",
"title": ""
},
{
"docid": "1a23672677f850d70e56d5ad64a6ab23",
"score": "0.61962783",
"text": "def see_results(prospector)\n prospector = prospector.to_i\n return nil if prospector <= 0\n\n puts \"After #{@days_mined} days, Rubyist #{prospector} found:\"\n if @ruby_total == 1\n puts \" #{@ruby_total} ruby.\"\n else\n puts \" #{@ruby_total} rubies.\"\n end\n if @fake_ruby_total == 1\n puts \" #{@fake_ruby_total} fake ruby.\"\n else\n puts \" #{@fake_ruby_total} fake rubies.\"\n end\n if @ruby_total >= 10\n puts 'Going home victorious!'\n elsif @ruby_total > 0 && @ruby_total < 10\n puts 'Going home sad.'\n elsif @ruby_total.zero?\n puts 'Going home empty-handed.'\n end\n 1\n end",
"title": ""
},
{
"docid": "b7f3c376ceb98c4107eb9b34087b0c80",
"score": "0.6178211",
"text": "def test_print_gold_one\n\t assert_output(/Found 1 ounce of gold/) {@p.print_gold(1)}\n\tend",
"title": ""
},
{
"docid": "88bf9266f70bf59a0df39bcff885d337",
"score": "0.6144361",
"text": "def test_print_gold_zero\n\t assert_output(//) {@p.print_gold(0)}\n\tend",
"title": ""
},
{
"docid": "a397493244ab71669791f6dec3573da5",
"score": "0.61355835",
"text": "def test_print_iteration\r\n\t\t@my_sim.driver.location = @my_sim.hillman\r\n\t\tassert_output(/test_driver heading from Museum to Hillman via Fifth Ave./) {@my_sim.print_iteration(\"Fifth Ave.\", 0)}\r\n\tend",
"title": ""
},
{
"docid": "e368de1c17af87dd3f03a3756e9c0e86",
"score": "0.6106643",
"text": "def print output_formatter\n output_formatter.print({ \"Commits:\" => @commits, \"Interactive churn:\" => @result, \"Self churn:\" => @self_churn, \"Authors affected:\" => @authors_affected })\n end",
"title": ""
},
{
"docid": "20ef1f46672e1246b8dc6b50bbd68afd",
"score": "0.61049813",
"text": "def report_stdout\n printf(\"%s results\\n\", @name)\n printf(\"Sum of ranks r1 %0.3f\\n\", @r1)\n printf(\"Sum of ranks r2 %0.3f\\n\", @r2)\n printf(\"U Value %0.3f\\n\", @u)\n printf(\"Z %0.3f (p: %0.3f)\\n\", z, probability_z)\n if @n1*@n2<MAX_MN_EXACT\n printf(\"Exact p (Dinneen & Blakesley, 1973): %0.3f\", probability_exact)\n end\n end",
"title": ""
},
{
"docid": "e42927c7569e30516813e0d6215cdc71",
"score": "0.61029696",
"text": "def test_print_gold_positive\n\t assert_output(/Found 6 ounces of gold/) {@p.print_gold(6)}\n\tend",
"title": ""
},
{
"docid": "42ce0845782c38ffa39ee39b28bc7271",
"score": "0.60870874",
"text": "def test_10_or_greater_rubies_victory_msg\n prosperous_miner = Prospector.new(0, @dummy_location, 0, rubies = 100, fakes = 0)\n assert_output (\"Going home victorious!\\n\") {\n prosperous_miner.declare_victory?\n }\n end",
"title": ""
},
{
"docid": "ee95a1b86d040d9a9d94148de2a54eef",
"score": "0.60764056",
"text": "def print output\n self.class.stdout.print output\n end",
"title": ""
},
{
"docid": "61e6e51b028079e0d81bfcf9efe5ccc3",
"score": "0.6061859",
"text": "def dump\r\n @debug_formatter.dump\r\n @report_formatter.dump\r\n# @progress_formatter.dump\r\n output = ''\r\n MODULES.each do |m|\r\n next if eval(\"@#{m}_features.empty?\")\r\n both_puts \"\\nModule #{m.upcase}\"\r\n both_puts \"=================\"\r\n ['feature','scenario','step'].each{|type|\r\n counters = {}\r\n STATUSES.each{|s| counters[s] = 0}\r\n eval \"@#{m}_#{type}s.each{|obj,status| counters[status] += 1}\"\r\n @io.puts(\"#{type}s:\".ljust(12) <<\r\n \"#{(STATUSES.map{|status| eval(\"#{status}(counters[status].to_s + ' ' + status)\")} <<\r\n \"#{counters.values.inject(0){|sum,item| sum + item}} total\").map{|s| s.rjust(12)}.join(', ')}\" )\r\n @email_io.puts(\"#{type}s:\".ljust(12) <<\r\n \"#{(STATUSES.map{|status| eval(\"counters[status].to_s + ' ' + status\")} <<\r\n \"#{counters.values.inject(0){|sum,item| sum + item}} total\").map{|s| s.rjust(12)}.join(', ')}\" )\r\n }\r\n both_puts\r\n end\r\n end",
"title": ""
},
{
"docid": "2320054e944699d2337175a232606ee2",
"score": "0.6053967",
"text": "def test_repl_print\r\n input = 'PRINT 1 1 +'\r\n assert_output(\"2\\n\") {@arg_checker.handle_input(input)}\r\n input = '1 1 +'\r\n assert_output(\"2\\n\") {@arg_checker.handle_input(input)}\r\n end",
"title": ""
},
{
"docid": "d28b97d1a17b8539b6973f3bf0b07862",
"score": "0.6040796",
"text": "def test_print_int\n out, err = capture_io do\n @rpn.print_line \"PRINT 30 30 +\"\n end\n assert_match %r%60%, out\n end",
"title": ""
},
{
"docid": "002393c7d3f15a90a0d84a1551c8542d",
"score": "0.60336584",
"text": "def print_result(result, description)\n printer = RubyProf::FlatPrinter.new(result)\n print \"#{'-' * 50} #{description}\\n\"\n printer.print(STDOUT)\nend",
"title": ""
},
{
"docid": "46cdc731bcb1b0d7973a55e30a34fd2a",
"score": "0.6033388",
"text": "def test_report_haul\n miner = Prospector.new(1, @dummy_location, 0, rubies = 2, fakes = 2)\n assert_output \"After 0 days, Rubyist #1 found:\\n\\t2 rubies.\\n\\t2 fake rubies.\\n\" do\n miner.report_haul\n end\n end",
"title": ""
},
{
"docid": "359626ce59909f1db6be47da075290ad",
"score": "0.60199666",
"text": "def should_print?; end",
"title": ""
},
{
"docid": "359626ce59909f1db6be47da075290ad",
"score": "0.60199666",
"text": "def should_print?; end",
"title": ""
},
{
"docid": "5d22cfccaf6c5850a2ecac61d3bf999a",
"score": "0.6005803",
"text": "def test_print_fakes # Failure\n test = Simulator.new(0)\n test.totalf = 0\n assert_output(/\\tFound 0 fake rubies in Enumerable Canyon. /) {test.print_rubies(test.totalr, test.totalf)}\n end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.5993374",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.59933543",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.59933543",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.59933543",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.59933543",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.59933543",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.59933543",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.59933543",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.59933543",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.59933543",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.59933543",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.59933543",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.59933543",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.59933543",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.59933543",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.59933543",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.59933543",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.59933543",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.59933543",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.59933543",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.59933543",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.59933543",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.59933543",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.59933543",
"text": "def output; end",
"title": ""
},
{
"docid": "1d0ad7952f82805ecfc5f402a623067b",
"score": "0.59796864",
"text": "def output_1\n puts @@output_1\n end",
"title": ""
},
{
"docid": "f9fa629da8ebe8146c35aaffcb59419a",
"score": "0.5978651",
"text": "def testcase_output(str, newline=true)\n @testcase.output(str, newline) if @testcase\n end",
"title": ""
},
{
"docid": "ce1b0392dce8ebda9bfbb624809b3248",
"score": "0.59778416",
"text": "def test_print_out_gains\r\n ruby_rush=RubyRush.new(1, 2, 3)\r\n ruby_rush.days=10\r\n ruby_rush.real_rb=10\r\n ruby_rush.fake_rb=10\r\n ruby_rush.prospector=1\r\n assert_output(\"After 10 days, Rubyist 1 found:\\n\\t10 rubies.\\n\\t10 fake rubies.\\n\") {ruby_rush.print_out_gains}\r\n end",
"title": ""
},
{
"docid": "c19075d3e5ca12d31c877176f45f3251",
"score": "0.5968032",
"text": "def puts(_output = nil)\n #This is a stub, used for indexing\nend",
"title": ""
},
{
"docid": "98ab1041d98696045aa8a2e7bb4ef1a7",
"score": "0.59658253",
"text": "def test_main\n #Redirect $stdout to a variable\n strIO_cap = StringIO.new\n $stdout = strIO_cap\n #Capture the output of main\n main\n #Return $stdout to normal\n $stdout = STDOUT\n assert_equal \"The number is 0 and the string is FizzBuzz\\nThe number is 1 and the string is 1\\nThe number is 2 \" \\\n \"and the string is 2\\nThe number is 3 and the string is Fizz\\nThe number is 4 and the string is 4\\n\" \\\n \"The number is 5 and the string is Buzz\\nThe number is 6 and the string is Fizz\\nThe number is 7 and\" \\\n \" the string is 7\\nThe number is 8 and the string is 8\\nThe number is 9 and the string is Fizz\\nThe \" \\\n \"number is 10 and the string is Buzz\\nThe number is 11 and the string is 11\\nThe number is 12 and \" \\\n \"the string is Fizz\\nThe number is 13 and the string is 13\\nThe number is 14 and the string is 14\\n\" \\\n \"The number is 15 and the string is FizzBuzz\\nThe number is 16 and the string is 16\\nThe number is \" \\\n \"17 and the string is 17\\nThe number is 18 and the string is Fizz\\nThe number is 19 and the string \" \\\n \"is 19\\nThe number is 20 and the string is Buzz\\nThe number is 21 and the string is Fizz\\nThe number\" \\\n \" is 22 and the string is 22\\nThe number is 23 and the string is 23\\nThe number is 24 and the string\" \\\n \" is Fizz\\nThe number is 25 and the string is Buzz\\nThe number is 26 and the string is 26\\nThe \" \\\n \"number is 27 and the string is Fizz\\nThe number is 28 and the string is 28\\nThe number is 29 and \" \\\n \"the string is 29\\nThe number is 30 and the string is FizzBuzz\\nThe number is 31 and the string is \" \\\n \"31\\nThe number is 32 and the string is 32\\nThe number is 33 and the string is Fizz\\nThe number is \" \\\n \"34 and the string is 34\\nThe number is 35 and the string is Buzz\\nThe number is 36 and the string \" \\\n \"is Fizz\\nThe number is 37 and the string is 37\\nThe number is 38 and the string is 38\\nThe number \" \\\n \"is 39 and the string is Fizz\\nThe number is 40 and the string is Buzz\\nThe number is 41 and the \" \\\n \"string is 41\\nThe number is 42 and the string is Fizz\\nThe number is 43 and the string is 43\\nThe \" \\\n \"number is 44 and the string is 44\\nThe number is 45 and the string is FizzBuzz\\nThe number is 46 \" \\\n \"and the string is 46\\nThe number is 47 and the string is 47\\nThe number is 48 and the string is \" \\\n \"Fizz\\nThe number is 49 and the string is 49\\nThe number is 50 and the string is Buzz\\n\",\n strIO_cap.string\n end",
"title": ""
},
{
"docid": "a29b71cd06bd5f2959c4dd42daec311f",
"score": "0.5960115",
"text": "def testoutput(cfg)\n #puts default.class\n cfg.each do |key, value|\n puts key\n cfg[key].each do |ext|\n puts \"\\t#{ext}\"\n end\n end\n end",
"title": ""
},
{
"docid": "7d614fa35bff5a67c965caa5ecb7b645",
"score": "0.59566134",
"text": "def output(int)\n puts int\n end",
"title": ""
},
{
"docid": "bdbb928ed6e7f361be503de004528076",
"score": "0.593492",
"text": "def summary_output(notification, seed)\n return if @bailed_out\n\n @output.puts(\"1..#{notification.examples.size}\")\n\n return if notification.examples.size.zero?\n\n execution_stats_output(notification)\n\n @output.puts(\"# seed: #{seed}\") if seed\n\n dump_failed_examples_summary if @failed_examples.present?\n dump_pending_examples_summary if @pending_examples.present?\n end",
"title": ""
},
{
"docid": "7f16417ba207a57cbb460ae24943a033",
"score": "0.5933823",
"text": "def printResult\n\tputs(\"Hello \" + $inputName)\n\tprintNumberSequence\nend",
"title": ""
},
{
"docid": "659d3531cfab52ab2e5a22b9c81e9053",
"score": "0.592424",
"text": "def output(pattern)\n expect(@pry.output.string.chomp).to match pattern\n end",
"title": ""
},
{
"docid": "32c0ac7a2f9885664c47ef30c29651c4",
"score": "0.59171",
"text": "def bailed_out_report_output\n @output.puts('TAP version 13')\n @output.puts('1..0')\n @output.puts('Bail out!')\n end",
"title": ""
},
{
"docid": "678d100bce55cb81da7f033b7c42c343",
"score": "0.5913875",
"text": "def test_valid_print\n e1 = Minitest::Mock::new 'evaluator 1'\n e1.expect(:evaluate, [15, 'valid'], [15])\n assert_equal 0, @process.print([15])\n end",
"title": ""
},
{
"docid": "2c6c9b75bd634382017706a4beeab5b3",
"score": "0.59001946",
"text": "def test_print_int\n out, err = capture_io do\n @rpn.print_line \"PRINT 30\"\n end\n assert_match %r%30%, out\n end",
"title": ""
},
{
"docid": "41e0a14bfbeb0410ca6baf18aacb50b0",
"score": "0.5875627",
"text": "def print\n puts\n puts\n \n puts \"Files: #{@num_files}\"\n puts \"Total Classes: #{@num_classes}\"\n puts \"Total Modules: #{@num_modules}\"\n puts \"Total Methods: #{@num_methods}\"\n \n puts\n end",
"title": ""
},
{
"docid": "a02144b9b860eac2697ec3752c4a4292",
"score": "0.5875071",
"text": "def test_result\n assert_equal 102, @object.print_suma_lyginiu\n end",
"title": ""
},
{
"docid": "1357eea449ee0f198e91c11f992314a0",
"score": "0.5874026",
"text": "def test_print_out_mood\r\n ruby_rush=RubyRush.new(1, 2, 3)\r\n ruby_rush.real_rb=10\r\n assert_output(\"Going home victorious!\\n\") {ruby_rush.print_out_mood}\r\n ruby_rush.real_rb=9\r\n assert_output(\"Going home sad.\\n\") {ruby_rush.print_out_mood}\r\n ruby_rush.real_rb=0\r\n assert_output(\"Going home empty-handed.\\n\") {ruby_rush.print_out_mood}\r\n end",
"title": ""
},
{
"docid": "3cf6aa56b28111208312907549875ab1",
"score": "0.58704555",
"text": "def test_prospector_go_zero\n prng_mock = Minitest::Mock.new(\"mocked prng\")\n\tassert_equal @p1.prospector_go(0, 0, prng_mock), [0, 0]\n\tassert_equal @p1.total_rubies, 0\n end",
"title": ""
},
{
"docid": "41d054eb43723bf70ae620ef570bbf5d",
"score": "0.5847963",
"text": "def print\n puts \"Total de primos: #{@ps.count}\"\n puts \"Hasta el número: #{@number}\"\n end",
"title": ""
},
{
"docid": "8857b72b52ce515f0078c6b76e0e264e",
"score": "0.58464795",
"text": "def to_stdout; end",
"title": ""
},
{
"docid": "a7da96cd6bedb53d7c1010ebe4d78c29",
"score": "0.58329093",
"text": "def test_print_final_plur_sing\n testarr = [1, 2]\n testgame = Game.new(testarr)\n mockboy = Minitest::Mock.new('Mock Prospector')\n def mockboy.haul\n 0\n end\n teststr = \"After 5 days, Prospector #1 returned to San Francisco with:\\n\"\n teststr += \"\\t0 ounces of gold.\\n\\t1 ounce of silver.\\n\\tHeading home with $0\"\n str = testgame.print_final(5, 1, mockboy, 0, 1)\n assert_equal str, teststr\n end",
"title": ""
},
{
"docid": "58c3db585a017c6478a98d8e2e7ccd51",
"score": "0.583205",
"text": "def test_print_start\r\n\t\tassert_output (\"Rubyist #1 starting in Mock Town.\\n\") {@p.print_start}\r\n\tend",
"title": ""
},
{
"docid": "87321d67d92ced188d2305ef32536913",
"score": "0.5827086",
"text": "def printingOutput(obj, x)\n\t\t\t#some additional space in console output\n\t\t\tputs \"\"\n\t\t\tputs \"Name\\t\\t\" + x\n\t\t\tobj.each do |(name, counter)|\n\t\t\t\tputs name.ljust(16) + counter.to_s\n\t\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "2da14c96e0855de0f8e13cec1ddcf307",
"score": "0.582483",
"text": "def test_print_fake\n test = Simulator.new(0)\n test.totalf = 1\n assert_output(/\\tFound 1 fake ruby in Enumerable Canyon. /) {test.print_rubies(test.totalr, test.totalf)}\n end",
"title": ""
}
] |
2a7fd334df98c9424e70bc43b7358894
|
GET /day_of_weeks GET /day_of_weeks.json
|
[
{
"docid": "774baa3493f1745565fc51b00d8433fb",
"score": "0.7144042",
"text": "def index\n @day_of_weeks = DayOfWeek.all\n end",
"title": ""
}
] |
[
{
"docid": "3da85f29df1dc5f725acc21329064903",
"score": "0.70251",
"text": "def index\n @day_weeks = DayWeek.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @day_weeks }\n end\n end",
"title": ""
},
{
"docid": "61bf5c467ee5b8712fe884aa84cc2310",
"score": "0.6905642",
"text": "def index\n @day_weeks = DayWeek.all\n end",
"title": ""
},
{
"docid": "1cd0149601367371e19ed75395d07c32",
"score": "0.6580393",
"text": "def index\n @weeks = Week.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @weeks }\n end\n end",
"title": ""
},
{
"docid": "8f5a9d74d5a44b01152687a04577c881",
"score": "0.65432334",
"text": "def weeks_on_list\n @data['weeks_on_list']\n end",
"title": ""
},
{
"docid": "3b4e4a06eaa54cdce793e8e277bcd77a",
"score": "0.6406801",
"text": "def weeks() 7 * days end",
"title": ""
},
{
"docid": "1dcce7513fa7acecba706985244dab4f",
"score": "0.64053065",
"text": "def weekday()\n return MicrosoftGraph::Drives::Item::Items::Item::Workbook::Functions::Weekday::WeekdayRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"title": ""
},
{
"docid": "4eb98c41c3f8a6369f5b080c77156633",
"score": "0.63972056",
"text": "def index\n @week_days = WeekDay.all\n end",
"title": ""
},
{
"docid": "a3de9d31e07127a23beac2f6c383ad6b",
"score": "0.63429195",
"text": "def week\n first_day_of_week = @date.monday\n \n days_of_week = []\n 7.times do |time|\n days_of_week << day_and_types(first_day_of_week + time.days)\n end \n \n days_of_week\n end",
"title": ""
},
{
"docid": "6d3b3679323bb1ca22a2ebfe76f535a0",
"score": "0.6318249",
"text": "def week(date = Date.today)\n day = monday(date)\n (day..day + 6)\n end",
"title": ""
},
{
"docid": "a1b44ebe73006b8b6235df0ab4635f25",
"score": "0.63108665",
"text": "def days_in_week(*days)\n @test_time = @time if @test_time.nil?\n x_in_list_of_y(@test_time.wday, Configuration.parse_range(days,0...7).flatten)\n end",
"title": ""
},
{
"docid": "04bc31d0c32bbb3cb621bcb7879acf4b",
"score": "0.6290377",
"text": "def weeks\n @weeks ||= days.slice_when do |day|\n Date::DAYNAMES[day.wday] == LAST_DAY_OF_THE_WEEK\n end.to_a\n end",
"title": ""
},
{
"docid": "22f0d3901ff93b0bd23d78cff581c893",
"score": "0.62877184",
"text": "def weekly(workspace_id, params={})\n get_report('weekly', workspace_id, params)\n end",
"title": ""
},
{
"docid": "db1f7ac836b90037bce6e1ba6605a1ca",
"score": "0.6262611",
"text": "def index\n @day_of_week = event_days\n end",
"title": ""
},
{
"docid": "4b036ecdbadb0ff50c1ffd89cbb9e3fc",
"score": "0.6237162",
"text": "def week\n @year = params[:year].to_i\n @month = params[:month].to_i\n @day = params[:day].to_i\n @date = Date.new(@year, @month, @day)\n @work_times = WorkTime.find_by_start_date(@date)\n end",
"title": ""
},
{
"docid": "de60978014fea051c73fdccb051aa329",
"score": "0.62140936",
"text": "def weekly_goals\n get(\"/user/#{@user_id}/activities/goals/weekly.json\")\n end",
"title": ""
},
{
"docid": "5223d732bd17fef93f7ed49038ccadbf",
"score": "0.6195352",
"text": "def weekly\n render json: Question.active.weekly.not_seen(@api_current_user.id).first\n end",
"title": ""
},
{
"docid": "7fa3ddae017ef6cb2a131db7c1499ec5",
"score": "0.6188279",
"text": "def show\n respond_to do |format|\n format.html { }\n format.json {\n render :json => @week, :methods => [:monday, :tuesday, :wednesday, :friday, :thursday, :saturday, :sunday, :image ] }\n end\n end",
"title": ""
},
{
"docid": "6b46f4b79f1800581dfacb8b712d9ef2",
"score": "0.61643565",
"text": "def index\n if params[:league_id]\n league = League.find(params[:league_id])\n start_week = league.start_week\n @weeks = @season.weeks.started.where('starts_at >= ?', start_week[:starts_at]).includes(:week_type, :season).order(starts_at: :asc)\n else\n @weeks = @season.weeks.order(starts_at: :asc)\n end\n @weeks = @weeks.map { |week| WeekDecorator.decorate(week) }\n respond_with @weeks # rendered via app/views/api/weeks/index.json.rabl\n end",
"title": ""
},
{
"docid": "87f9da2768a36155c5c9f8b7e2a2fb51",
"score": "0.61197656",
"text": "def show\n @day_week = DayWeek.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @day_week }\n end\n end",
"title": ""
},
{
"docid": "27f1009153671dd26c16560943f24517",
"score": "0.61187106",
"text": "def week_days\n {\n \"1\" => 'mon',\n \"2\" => 'tue',\n \"3\" => 'wed',\n \"4\" => 'thu',\n \"5\" => 'fri',\n \"6\" => 'sat',\n \"7\" => 'sun'\n }\n end",
"title": ""
},
{
"docid": "ba9d212afa6a3ece9e1d8ef285d59b29",
"score": "0.6109552",
"text": "def weeks\n\t\tk = offset( first_day.cwday )\n\n [ first_week( k ) ] + middle_weeks( DPW - k )\n end",
"title": ""
},
{
"docid": "386655736d6eaad3ccfe686a33310245",
"score": "0.6026918",
"text": "def index\n @thursdays = Thursday.all\n end",
"title": ""
},
{
"docid": "4c22ced6f7e305c8b2725a3991cefad0",
"score": "0.60089463",
"text": "def weekIndex\n render json: Restaurant.restaurantsWeek\n end",
"title": ""
},
{
"docid": "13e0b2e66c44a1d747778f96eda9b121",
"score": "0.599894",
"text": "def index\n @wednesdays = Wednesday.all\n end",
"title": ""
},
{
"docid": "fc03a9915624d43b8a0f49e4c89503fa",
"score": "0.59735876",
"text": "def day_of_week(date)\n 7 - date.cwday\n end",
"title": ""
},
{
"docid": "05d7d5f703ac6f97f6f56061984f3ddf",
"score": "0.59540766",
"text": "def index\n @games_of_weeks = GamesOfWeek.all\n end",
"title": ""
},
{
"docid": "8a50f10f9d780efcf77761c6ba493ad9",
"score": "0.59532076",
"text": "def day_of_week(day)\n query_filters << \"day_of_week:#{day}\"\n self\n end",
"title": ""
},
{
"docid": "8b6bed3fa2cafa62a6ea3820ff8e6bcb",
"score": "0.5951835",
"text": "def nth_wday(nth, wday_name)\n raise Koyomi::WrongRangeError if nth > weeks.size\n self.weeks[nth - 1].wday(wday_name)\n end",
"title": ""
},
{
"docid": "f2cb3a06f55e1a77697325a02da87141",
"score": "0.59445626",
"text": "def week; end",
"title": ""
},
{
"docid": "b04d5d657446cb5235f51a20076d5fce",
"score": "0.5913945",
"text": "def week\n published_at.strftime('%W')\n end",
"title": ""
},
{
"docid": "a6702215c9aba81b7e9dd1a9e649b69b",
"score": "0.59113824",
"text": "def wednesday\n day(:wednesday)\n end",
"title": ""
},
{
"docid": "e6db36a2111944c75c846a7f984757c7",
"score": "0.5889344",
"text": "def index\n @weeks = Week.all.order(:season_id, :week_number)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @weeks }\n end\n end",
"title": ""
},
{
"docid": "adf021f577d019a626955e99cc76fbc5",
"score": "0.5880861",
"text": "def week\n @obj.date.strftime(\"%V\")\n end",
"title": ""
},
{
"docid": "fef872bc9bcc101e113043dc789be84b",
"score": "0.5878849",
"text": "def calendar_wdays(starting_day = 0)\n start_week = Date.today.beginning_of_week + (starting_day - 1).days # In rails week start in monday and monday.wday is 1\n (start_week...start_week+7.days).collect { |day| I18n.l(day, :format => '%A') }\n end",
"title": ""
},
{
"docid": "fd549bc770002b91cc0c822d4cd5aea8",
"score": "0.5866331",
"text": "def wday() end",
"title": ""
},
{
"docid": "5911e79b9f833116665cb96ed2709bc3",
"score": "0.5847771",
"text": "def index\n @day_availabilities = DayAvailability.all\n\n respond_to do |format|\n format.html {redirect_to @day_availabilities.week_availability}\n # format.json { render json: @day_availability }\n end\n end",
"title": ""
},
{
"docid": "f7e7c408133a757b61a96af8751e56a8",
"score": "0.5836825",
"text": "def week_num()\n return MicrosoftGraph::Drives::Item::Items::Item::Workbook::Functions::WeekNum::WeekNumRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"title": ""
},
{
"docid": "6e7438cb27b688c13da4907f2ce4d2d1",
"score": "0.5828438",
"text": "def weeks ; self * 7.days ; end",
"title": ""
},
{
"docid": "b64b97696a2e5f9f675336b9b8d931c1",
"score": "0.57917166",
"text": "def show\n @weekday = Weekday.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @weekday }\n end\n end",
"title": ""
},
{
"docid": "9eebabd78b5dbe5f6782afd24c89d49c",
"score": "0.5791271",
"text": "def weekly_chart_list(user)\n get(:standard, {:method => \"user.getWeeklyChartList\", :user => user})\n end",
"title": ""
},
{
"docid": "ec3b446d40bcacd7df8bed3c5606994e",
"score": "0.57877064",
"text": "def week\n @date.cweek\n end",
"title": ""
},
{
"docid": "8521e591c0715abf182f4feb8af76c6c",
"score": "0.5786811",
"text": "def day_of_week\n dnum = day\n dnum -= 10 if dnum > 20\n dnum -= 10 if dnum > 10\n dnum -= 1\n dnum\n end",
"title": ""
},
{
"docid": "b2ea70a87caac8fe0af491ce2aac99ee",
"score": "0.5785947",
"text": "def index\n @mondays = Monday.all\n end",
"title": ""
},
{
"docid": "f70f7a30c26c1608c87ca46b1e963f86",
"score": "0.57832456",
"text": "def next_week_in weeks\n Week.find_by(initial_day: initial_day+( weeks * 7.days))\n end",
"title": ""
},
{
"docid": "416370a9da710b9217674df94a79ca82",
"score": "0.57830745",
"text": "def index\n @week_data = WeekDatum.all\n end",
"title": ""
},
{
"docid": "a1041d651a10f722e8e04e3fdce196fe",
"score": "0.57781047",
"text": "def weeks\n self.to_i * 604_800\n end",
"title": ""
},
{
"docid": "52c28d5c754411c957c851d3243f1b6c",
"score": "0.5754705",
"text": "def day_of_the_week(time)\n Date::DAYNAMES[time.wday]\nend",
"title": ""
},
{
"docid": "c7d967337da7870cc800ee329b975b33",
"score": "0.5748448",
"text": "def select_wday(day = nil)\n day = Date.today.wday if day.nil?\n\n wday_symbol = if day.kind_of?(Integer)\n wday_symbol = case day\n when 0\n 'Su'\n when 1\n 'M'\n when 2\n 'T'\n when 3\n 'W'\n when 4\n 'R'\n when 5\n 'F'\n when 6\n 'Sa'\n end\n else\n day\n end\n\n @config['comics'].select {|c| c['update_schedule'].include?(wday_symbol)}\n end",
"title": ""
},
{
"docid": "638c4b5679a97954146c9950092a366a",
"score": "0.5738111",
"text": "def week\n self.range('week')\n end",
"title": ""
},
{
"docid": "3e2449e921cb4ad8dd4b8e67919b8711",
"score": "0.57319677",
"text": "def daily\n object # Initializing to make sure that the passed in day is\n # acceptable. Else a 404 will be raised.\n render :template => \"weekly_digests/show\"\n rescue ActiveRecord::RecordNotFound\n rescue_404\n end",
"title": ""
},
{
"docid": "52aa7db01507903dcfbf01f0034e1568",
"score": "0.57303476",
"text": "def day_of_the_week(day)\n @dias = {1 => \"LUNES\", 2 => \"MARTES\", 3 => \"MIERCOLES\", 4 => \"JUEVES\", 5 => \"VIERNES\", 6 => \"SÁBADO\", 7 => \"DOMINGO\"}\n return @dias[day]\n end",
"title": ""
},
{
"docid": "673da34fc6924883eb64c99e87722c06",
"score": "0.57180977",
"text": "def week_index\n @week_index ||= date.wday\n end",
"title": ""
},
{
"docid": "4e6ecd46df9b73b6ce7e927f5a4803d6",
"score": "0.5717016",
"text": "def weekly_hours\n worked_hours\n end",
"title": ""
},
{
"docid": "79d85d729bef353e7968a242057e5a3c",
"score": "0.57034284",
"text": "def day_of_week\n # Zellers: 0 = Saturday, 1 = Sunday, 2 = Monday, ..., 6 = Friday\n # day_of_week: 1 = Sunday, 7 = Saturday\n (zellers_congruence + 6) % 7\n end",
"title": ""
},
{
"docid": "aa7f783369f6c23c8b9a97561c3d49f9",
"score": "0.56974775",
"text": "def index\n # @weekdays = Weekday.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: Oj.dump(@weekdays, mode: :compat) }\n end\n end",
"title": ""
},
{
"docid": "cef43d129fc1f76aab166aef9beda7ea",
"score": "0.56964415",
"text": "def each_days_of_week(*wdays)\n if wdays.empty?\n each_days\n else\n each_days.except {|dt| !wdays.include?(dt.wday) }\n end\n end",
"title": ""
},
{
"docid": "b913d934837410deb49a31e9d00d7b52",
"score": "0.56856036",
"text": "def select_week_of date\n monday = date - date.wday + 1\n friday = monday + 4\n select_range(monday, friday)\n end",
"title": ""
},
{
"docid": "51a1d42150bc56b3abf561ed7c786114",
"score": "0.5683659",
"text": "def by_week\n @device = params[:device]\n @pf_by_week = Measure.where('created_at BETWEEN ? AND ? AND device_id = ?', DateTime.now.beginning_of_week, DateTime.now.end_of_week, @device).group_by_day_of_week(:created_at, format: \"%a\", week_start: :monday).minimum(:pf)\n render json: @pf_by_week\n end",
"title": ""
},
{
"docid": "e55e65bb736248f1fc23c73247ad2f09",
"score": "0.56790644",
"text": "def days_of_the_week_params\n params.require(:days_of_the_week).permit(:monday, :tuesday, :wednesday, :thursday, :friday, :saturday, :sunday, :chore_id)\n end",
"title": ""
},
{
"docid": "ca3aee980aaef7c4d08bb3e7f6b26439",
"score": "0.5656071",
"text": "def mweek; (5 - wday + day) / 7 end",
"title": ""
},
{
"docid": "06f39048d287264cda295c7b5ea39eb5",
"score": "0.5655959",
"text": "def show\n @week = Week.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @week }\n end\n end",
"title": ""
},
{
"docid": "9dbaad7c1a9e2c6e8ddef74fbb48ceb0",
"score": "0.5648556",
"text": "def get_week(year, month, day)\n weeks = [\"月\",\"火\",\"水\",\"木\",\"金\",\"土\",\"日\"]\n\n days = 0\n month_index = month - 1\n while month_index > 0 do\n month_days = get_days(year, month_index)\n days = days + month_days\n month_index = month_index - 1\n end\n\n year_days = 0\n year_index = year -1\n # while year_index > 0 do\n # year_days = get_year_days(year_index)\n # days = days + year_days\n # year_index = year_index - 1\n # end\n while year_index > 0 do\n if get_days(year_index, 2) == 29\n days = days + 366\n else\n days = days + 365\n end\n year_index = year_index - 1\n end\n \n days = days + day\n\n return weeks[(days-1) % 7]\nend",
"title": ""
},
{
"docid": "164081b5a34ad505224f97f54c8148c4",
"score": "0.5646982",
"text": "def day_of_week\n to_time.wday\n end",
"title": ""
},
{
"docid": "66f6f4e5684544763b5de2c8bd8abe17",
"score": "0.5645745",
"text": "def set_days_of_the_week\n days_of_the_week = DaysOfTheWeek.find(params[:id])\n end",
"title": ""
},
{
"docid": "3171549bb2e58288dd9ef3d74edc0d54",
"score": "0.5643172",
"text": "def get_remaining_days(view_id, sprint_id)\n\thttp = create_http\n\trequest = create_request(\"/rest/greenhopper/1.0/gadgets/sprints/remainingdays?rapidViewId=#{view_id}&sprintId=#{sprint_id}\")\n\tresponse = http.request(request)\n\tJSON.parse(response.body)\nend",
"title": ""
},
{
"docid": "e3378cf731cb6a7eb6f914f7ada2fdba",
"score": "0.56358117",
"text": "def days_of_week_string\n dow = days_of_week_hash\n\n @days_of_week_string ||=\n (dow[:sunday] ? \"Su\" : \"\") +\n (dow[:monday] ? \"M\" : \"\") +\n (dow[:tuesday] ? \"Tu\" : \"\") +\n (dow[:wednesday] ? \"W\" : \"\") +\n (dow[:thursday] ? \"Th\" : \"\") +\n (dow[:friday] ? \"F\" : \"\") +\n (dow[:saturday] ? \"Sa\" : \"\")\n end",
"title": ""
},
{
"docid": "e7bf6a392619642dfd8d483aabc12a25",
"score": "0.5634077",
"text": "def weeks\n result = end_week - start_week + 1\n weeks = Date.new(start_date.year, 12, 31).strftime('%W').to_i\n result < 0 ? result + weeks : result\n end",
"title": ""
},
{
"docid": "098f113044c559a4d9c9fcafe890bdd1",
"score": "0.5633785",
"text": "def showtimes_json(day)\n showtimes_by_cinemas_json(CONST::WORD_DAY_HASH[day]).to_json\n end",
"title": ""
},
{
"docid": "38d0dff86ad2caeff44068f9450d78fe",
"score": "0.56321234",
"text": "def day_of_week\n # Date.wday returns 0-6 for Sunday,...Saturday\n return @day.wday\n end",
"title": ""
},
{
"docid": "3a840fe6957ce0c7f83ccec9bba1791a",
"score": "0.56316555",
"text": "def destroy\n @day_week.destroy\n respond_to do |format|\n format.html { redirect_to day_weeks_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e604feff62f88a30bf60a5d7355f91ae",
"score": "0.5627162",
"text": "def week\n stamp = params[:stamp].to_i\n interval = (params[:interval] || 10).to_i\n plus_weeks = (params[:plus_weeks] || 0).to_i\n context = (params[:context] || 0).to_i == 1 ? true : false\n time = Time.at(stamp).utc\n\n # Calculate monday from given date\n wday = time.wday\n # Adjust for sunday when we want to start on a monday\n wday = 7 if wday == 0\n\n date = time - (wday.days - 1.days)\n\n date = date + plus_weeks.weeks\n\n # Number of days in week range if we add context, we add the surrounding weeks as well\n days = context ? (7 * 3) - 1 : 6\n\n # If context we'll start at the monday before\n if context\n date -= 7.days\n end\n\n\n\n week_data = []\n week_dates = []\n\n buckets = 0.step((60 * 24) - 1, interval).to_a\n\n (0..days).each do |day|\n interval_data = Hash.new { |h, k| h[k] = [] }\n\n data = GlucoseSensorData.by_day(date.to_date, :field => :timestamp)\n\n data.each do |datum|\n minutes = datum.timestamp.min + (datum.timestamp.hour * 60)\n # At first seems like a no op but this actually buckets minutes into intervals\n bucket = (minutes / interval) * interval\n\n interval_data[bucket] << datum\n end\n\n week_context = nil\n\n if context\n week_number = day / 7\n if week_number == 0\n week_context = \"before\"\n elsif week_number == 1\n week_context = \"current\"\n else\n week_context = \"after\"\n end\n else\n week_context = \"current\"\n end\n\n buckets.each do |bucket|\n datum = {}\n\n datums = interval_data[bucket]\n # Averages glucose values if there are more than one datum for that bucket\n if datums.length > 0\n datum[:glucose] = datums.inject(0.0) { |sum, d| sum + d.glucose } / datums.size\n #datum[:timestamp] = datums[0].timestamp.to_i\n end\n datum[:timestamp] = (date + bucket.minutes).to_i\n datum[:week_context] = week_context\n\n\n datum[:time] = bucket\n datum[:day] = date.strftime(\"%A\").downcase\n datum[:date] = date.to_i\n week_data << datum\n end\n\n week_dates.push({ :week_context => week_context, :day => date.strftime(\"%A\").downcase, :date => date.to_i })\n date += 1.days\n end\n\n render :json => { :data => week_data, :interval => interval, :week_dates => week_dates }\n end",
"title": ""
},
{
"docid": "d3e64fc88385dcc4b01ebaac3b0065c2",
"score": "0.5625056",
"text": "def weeks\n lines[2..-1]\n end",
"title": ""
},
{
"docid": "a93a83e51d00fdd01d595fa68c405138",
"score": "0.56119937",
"text": "def each_wednesday(n=1, offset=0, dur=1); each_wdays(self.Wed,n,offset,dur); end",
"title": ""
},
{
"docid": "ff5fc20b202a51602c3fce6dd70f72cb",
"score": "0.56085545",
"text": "def weeks\n days_in_month = Time.days_in_month(month, year)\n starting_day = date.beginning_of_week() -1.day + beginning_of_week.days\n ending_day = (date + days_in_month).end_of_week() -1.day + beginning_of_week.days\n (starting_day..ending_day).to_a.in_groups_of(7).collect { |week| Week.new(week, events) }\n end",
"title": ""
},
{
"docid": "17c7ab32adf90fdc7682cf805cca7627",
"score": "0.560506",
"text": "def nth_wday; (day - 1) / 7 end",
"title": ""
},
{
"docid": "d6c121149eb85d2402bc0422c38630bb",
"score": "0.5597502",
"text": "def day_of_week(date)\n date.cwday # cwday returns the day of calendar week (1-7, Monday is 1).\nend",
"title": ""
},
{
"docid": "41e1797b8ac7cbb4f67242d75136e20d",
"score": "0.55944425",
"text": "def stats_by_day_of_week(day, season = nil)\n day = convert_day(day) if day.is_a?(String)\n data = stats_request(\"byDayOfWeek\", season)\n data.find do |s| s[\"dayOfWeek\"] == day end\n end",
"title": ""
},
{
"docid": "07fd1c2df104a7377cbb3af34588e846",
"score": "0.55943644",
"text": "def week\n\t\t@@week\n\tend",
"title": ""
},
{
"docid": "c17f21a170b8330b65ec98690611bc63",
"score": "0.55916286",
"text": "def index\n @workout_days = WorkoutDay.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @workout_days }\n end\n end",
"title": ""
},
{
"docid": "003da62e3a99b1982119ee2a00927576",
"score": "0.5590586",
"text": "def show\n @week = Week.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @week }\n end\n end",
"title": ""
},
{
"docid": "705623a8f3d8197606681125ab5f6a16",
"score": "0.5588761",
"text": "def wday\n @date_time_value.wday\n end",
"title": ""
},
{
"docid": "1f188794535baaeb18f3c4dc49ee0c68",
"score": "0.55854005",
"text": "def w_day; end",
"title": ""
},
{
"docid": "681e8f41ab6ab6498ee299ec7acda052",
"score": "0.5580765",
"text": "def current_game_week\n url = \"/service/weather/json/#{api_key}/\"\n response = conn.get(url)\n result = JSON.parse(response.body, symbolize_names: true)\n weather_data = result[:Games].map do |home_team, weather_data|\n GameWeather.new(weather_data)\n end\n return result[:Week], weather_data\n end",
"title": ""
},
{
"docid": "d5ddf48ef18f2750d8094ab6b435cac1",
"score": "0.5577739",
"text": "def each_weeks(n=1, offset=0, dur=1)\n each_days(n*7, offset*7, dur*7)\n end",
"title": ""
},
{
"docid": "64b84bbf63e074d219370cac68079f22",
"score": "0.5569969",
"text": "def iso_week_num()\n return MicrosoftGraph::Drives::Item::Items::Item::Workbook::Functions::IsoWeekNum::IsoWeekNumRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"title": ""
},
{
"docid": "149239c9263e72d909f6fa75e69e1b9d",
"score": "0.5569709",
"text": "def show\n @shifts = Person.find(params[:id]).shifts.order(start: :asc)\n @weeks = build_shifts\n end",
"title": ""
},
{
"docid": "f490911c35e6645837b9517e37a0b62b",
"score": "0.5561997",
"text": "def wday\n return self.to_a[IDX_WDAY]\n end",
"title": ""
},
{
"docid": "3cabcc7af0fd43953ec2fa294622c089",
"score": "0.5558544",
"text": "def weeks ; Duration[self * 604800] ; end",
"title": ""
},
{
"docid": "8a295f4202572d85fc8226006e176bb0",
"score": "0.5554821",
"text": "def weeks\n\t\treturn self * 7.days\n\tend",
"title": ""
},
{
"docid": "8a295f4202572d85fc8226006e176bb0",
"score": "0.5554821",
"text": "def weeks\n\t\treturn self * 7.days\n\tend",
"title": ""
},
{
"docid": "1862534bc06ca1e5a68db0f05e08b434",
"score": "0.55511105",
"text": "def day_of_week\n\tif @current_time.wday == 0 || @current_time.wday == 6\n\t\tweek_period = \"Weekends\"\n\telse\n\t\tweek_period = \"Weekdays\"\n\tend\nend",
"title": ""
},
{
"docid": "c2a67d936f1446f7fd76c46b2717866c",
"score": "0.55500096",
"text": "def index\n @sundays = Sunday.all\n end",
"title": ""
},
{
"docid": "c9dbb2022597c6667e1f6170a52b1c58",
"score": "0.55482733",
"text": "def _week_day_numbers\n week_day_start = self.week_day_start\n week_day_start.capitalize if week_day_start.is_a? String\n [0, 1, 2, 3, 4, 5, 6].partition {|on| on >= day_names.index(week_day_start)%7 }.flatten\n end",
"title": ""
},
{
"docid": "64f799704b138a889674568e8840767c",
"score": "0.5546456",
"text": "def index\n if params[:date]\n redirect_date(params[:date])\n else\n @school_days = SchoolDay.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @school_days }\n end\n end\n end",
"title": ""
},
{
"docid": "7b9884edd5fe1e37bdeaa60bd9a452c0",
"score": "0.55432546",
"text": "def index\r\n @classdays = Classday.all\r\n\r\n render json: @classdays\r\n end",
"title": ""
},
{
"docid": "833d20f461933c4ab1fdf43f73c4abfc",
"score": "0.55426717",
"text": "def index\n @reading_weeks = ReadingWeek.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @reading_weeks }\n end\n end",
"title": ""
},
{
"docid": "00789c2ae8713b174935bc345d9f89a6",
"score": "0.55382246",
"text": "def wday\n to_g.wday\n end",
"title": ""
},
{
"docid": "dd983119100fa359e12d92d115a503c2",
"score": "0.5534295",
"text": "def day_of_week(*weekdays)\n merge(day: weekdays)\n end",
"title": ""
},
{
"docid": "e506227099369b91fb3c8d764ee0ff15",
"score": "0.5533409",
"text": "def wday\n components.weekday - 1\n end",
"title": ""
},
{
"docid": "aae66393553f8d0b0a5fe517061b10a4",
"score": "0.5521031",
"text": "def get_week_daily_loads(weeks_surveys)\n daily_hash = {\"Monday\":0, \"Tuesday\":0, \"Wednesday\":0, \"Thursday\":0, \"Friday\":0, \"Saturday\":0, \"Sunday\":0}\n weeks_surveys.each do |survey|\n survey_day_key = get_day_of_week(survey.completed_time)\n daily_hash[survey_day_key] += survey.session_load\n end\n return daily_hash.values\n end",
"title": ""
}
] |
5026a40338581b26a8118487c3bc305e
|
Indicate whether the value could be a valid id_column value.
|
[
{
"docid": "3d8ae4fc2f357d9cb75d611d9eaf4abc",
"score": "0.6816705",
"text": "def valid_id?(value)\n value.is_a?(String) && value.match?(UUID_PATTERN)\n end",
"title": ""
}
] |
[
{
"docid": "83832a224a63a33c8236dd8ebceb8fcf",
"score": "0.7906277",
"text": "def valid_id?(value)\n digits_only?(value)\n end",
"title": ""
},
{
"docid": "b56dfb8c1e01ce51c14d9ac3de0c3d67",
"score": "0.6979682",
"text": "def is_id?(key)\n key =~ /^[A-Z0-9]+$/\n end",
"title": ""
},
{
"docid": "769fa8237db07a2ee6b530cf2b4c5e32",
"score": "0.6967405",
"text": "def valid_id?(id)\r\n raise CLXException, 'Id must be integer' unless id.is_a? Integer\r\n raise CLXException, 'Id must be greater than zero' unless id > 0\r\n end",
"title": ""
},
{
"docid": "91bdc5c8252364f425fd532d49b06786",
"score": "0.68918836",
"text": "def validate_dtop_id(value)\n return false if(!validate_str_is_integer(value) or\n value.to_s.length >= DTOP_ID_MAX_LENGTH )\n return true\n end",
"title": ""
},
{
"docid": "acdb5e4a792cd7d6a9e64960a0edb86e",
"score": "0.6858774",
"text": "def validate_dtop_id(value)\n return false if value.to_s.length == 0\n return false if(!validate_str_is_integer(value) or\n value.to_s.length >= DTOP_ID_MAX_LENGTH or\n value.to_s.length < DTOP_ID_MIN_LENGTH)\n return true\n end",
"title": ""
},
{
"docid": "79adaef5a34b2a27362ab21b79356d56",
"score": "0.6797449",
"text": "def id_valid?(id)\n return id.between?(0, @data.size - 1)\n end",
"title": ""
},
{
"docid": "630c509eeb08e9e1c2753c49acbcdda6",
"score": "0.6783297",
"text": "def db_id?(key)\n key.is_a?(Fixnum) or key.is_a?(Integer) or key =~ /^[0-9]+$/\n end",
"title": ""
},
{
"docid": "f7393c74ef6c31cc60912c022150b511",
"score": "0.6746854",
"text": "def valid?\n %w(none set).include?(db.type(id))\n end",
"title": ""
},
{
"docid": "354de3ae01c948e54b6a3f6db642ba08",
"score": "0.674543",
"text": "def id_valid?(id)\n return id.between?(1, LAST_ID)\n end",
"title": ""
},
{
"docid": "354de3ae01c948e54b6a3f6db642ba08",
"score": "0.674543",
"text": "def id_valid?(id)\n return id.between?(1, LAST_ID)\n end",
"title": ""
},
{
"docid": "46fe71db4255133a5c7ad717cfab3aa7",
"score": "0.6744302",
"text": "def valid_id_number; end",
"title": ""
},
{
"docid": "41c81779c6485c51172770aa7ee0901b",
"score": "0.6658728",
"text": "def valid?\n return false if @id.nil?\n true\n end",
"title": ""
},
{
"docid": "edf2e6fb596fffe1fa3fd51c650f6e36",
"score": "0.6439769",
"text": "def valid_south_african_id_number; end",
"title": ""
},
{
"docid": "8ee7b842c1383375b2dc0903f155d9fa",
"score": "0.6389627",
"text": "def invalid_id_number; end",
"title": ""
},
{
"docid": "af22de84e114bce6e45491df543f550d",
"score": "0.6388982",
"text": "def valid_id?(id)\n return false if (id || \"\").length == 0\n match = /[[:alnum:]\\-\\_\\.]*/.match(id)\n # If the resulting match is identical to the received id it means\n # the id includes only valid characters.\n return match[0] == id\n end",
"title": ""
},
{
"docid": "79ca9e869660589034e0617f03f14140",
"score": "0.6282453",
"text": "def column_valid?(column)\n is_valid = true\n if ((column.to_i < 1) || (column.to_i > @max_width))\n puts \"Well, there went something wrong with your input: #{column}. Please try again:\"\n is_valid = false\n end\n is_valid\n end",
"title": ""
},
{
"docid": "fca9ceecd85d5883e523e2a48173d3af",
"score": "0.6272187",
"text": "def valid?\n ids.include?(@id)\n end",
"title": ""
},
{
"docid": "4c714f002b413ca22d5bfef86bb35090",
"score": "0.6262031",
"text": "def is_valid_id id\n\t\tCompany.all.each do |c|\n\t\t\tif c.id == id\n\t\t\t\treturn true\n\t\t\tend\n\t\tend\n\t\treturn false\n \tend",
"title": ""
},
{
"docid": "f285ffc6e7f0d6d5d80ab79657ec64e3",
"score": "0.62575245",
"text": "def valid_identifiers?(value)\n ids = PublicationIdentifier.objects(value)\n ids.present? && ids.all? { |id| id&.valid? }\n end",
"title": ""
},
{
"docid": "64ec4deefaced253951896a773e1c980",
"score": "0.62472767",
"text": "def id?\n !id.nil? && !id.empty?\n end",
"title": ""
},
{
"docid": "0c8e663d487a2ca2d209a254bba479ea",
"score": "0.6245638",
"text": "def valid_column? col\n !!(col <= @col)\n end",
"title": ""
},
{
"docid": "6df0bf59b2a4adde8c8358df67aafb0b",
"score": "0.623794",
"text": "def is_column_the_rowid?(field, column_definitions)\n return false unless INTEGER_REGEX.match?(field[\"type\"]) && field[\"pk\"] == 1\n # is the primary key a single column?\n column_definitions.one? { |c| c[\"pk\"] > 0 }\n end",
"title": ""
},
{
"docid": "598d0866f438ec91545290b952bfc216",
"score": "0.61873144",
"text": "def check_id\n gene_id_format = Regexp.new(/A[Tt]\\d[Gg]\\d\\d\\d\\d\\d/)\n return false if gene_id_format.match(@gene_id).nil?\n end",
"title": ""
},
{
"docid": "d6becde536a908223bc0903c99c851e9",
"score": "0.6178302",
"text": "def check!\n super()\n \n if not [Symbol, String, Integer, NilClass].any?{ |cl| @id.kind_of?(cl) }\n raise Exception::new(\"ID must contain Symbol, String, Number or nil if included.\")\n end\n end",
"title": ""
},
{
"docid": "ae5c8ea9e0abd4859eeebb042016420c",
"score": "0.61771995",
"text": "def sequential_id_is_unique?\n scope = self.class.sequenced_options[:scope]\n column = self.class.sequenced_options[:column]\n return false unless self.send(column).is_a?(Integer)\n \n q = self.class.unscoped.where(column => self.send(column))\n \n if scope.is_a?(Symbol)\n q = q.where(scope => self.send(scope))\n elsif scope.is_a?(Array)\n scope.each { |s| q = q.where(s => self.send(s)) }\n end\n\n q = q.where(\"NOT id = ?\", self.id) if self.persisted?\n q.count > 0 ? false : true\n end",
"title": ""
},
{
"docid": "f5149d3e4f2316e70588c5316f62df66",
"score": "0.6168676",
"text": "def binds_have_identity_column?(binds)\n binds.any? do |column_value|\n column, value = column_value\n SQLServerColumn === column && column.is_identity?\n end\n end",
"title": ""
},
{
"docid": "13040fe0872610459c798db86d1b8dac",
"score": "0.6128123",
"text": "def id?\n @kind == :id\n end",
"title": ""
},
{
"docid": "be46d6226efc217744e0bdbf4705327d",
"score": "0.61247915",
"text": "def id\n\t\tif(@tokens[@counter].type == @ID || @tokens[@counter].type == @INT || @tokens[@counter].type == @STRING )\n\t\t\treturn true \n\t\telse \n\t\t\treturn false \n\t\tend \n\tend",
"title": ""
},
{
"docid": "d74907d091ae576882a2da96d2610361",
"score": "0.61207896",
"text": "def id?\n query_attribute(self.class.primary_key)\n end",
"title": ""
},
{
"docid": "1f1da2791d71e416903aa481110037be",
"score": "0.60824114",
"text": "def error_id_present?(error_id)\n error_id.present? && error_id != true\n end",
"title": ""
},
{
"docid": "4d77cf9dbce0699b63f651f14a02995e",
"score": "0.6081254",
"text": "def check_column_id( id )\n case id\n when Fixnum\n return id\n when String\n return @headers.index( id )\n else\n raise ArgumentError\n end\n end",
"title": ""
},
{
"docid": "c1d876afaa4dd8cd8e6c6339a772f9bd",
"score": "0.6067579",
"text": "def exists?\n return id.to_s =~ /\\d+/\n end",
"title": ""
},
{
"docid": "62a2e0aefb415fd511b43795943f86a4",
"score": "0.604999",
"text": "def id?\n `#@native.isId`\n end",
"title": ""
},
{
"docid": "c4d7c0d5418483cf7393f2ca70522683",
"score": "0.6030364",
"text": "def acceptable_id?\n id = extracted_id\n existing._id == id || id.nil? || (existing._id != id && update_only?)\n end",
"title": ""
},
{
"docid": "50ab2066febb7495841758ee9fe470f4",
"score": "0.6020922",
"text": "def identity_validity\n handle.errors[:_id].each { |error| errors.add(identity_field, error) } if handle? && !handle.valid?\n end",
"title": ""
},
{
"docid": "8ff6d650ce28dfad2eacc8afadbf343e",
"score": "0.59883404",
"text": "def valid_column(column)\n bits = 0\n\n @size.times { |i|\n if @state[(@size *i) + column]\n bits += 1\n if bits > 1\n return false\n end\n end\n }\n\n return true\n end",
"title": ""
},
{
"docid": "554aad7492add8350ab4ffa5e27ccfea",
"score": "0.5974434",
"text": "def id?(str); end",
"title": ""
},
{
"docid": "6c102cbbfa5faef151a2f8ea362b7355",
"score": "0.5965017",
"text": "def valid?\n return false if !@item_id.nil? && @item_id.to_s.length > 6\n return false if !@item_id.nil? && @item_id.to_s.length < 1\n true\n end",
"title": ""
},
{
"docid": "a253c64c62a336ab95710d8bc9858b5a",
"score": "0.59649765",
"text": "def check_id_or_raise(id)\n id_number = Integer(id, 10)\n raise \"'id' parameter with value '#{id}' should be a positive integer\" if id_number < 0\n end",
"title": ""
},
{
"docid": "3629c4381550eddc161995e33a59c47f",
"score": "0.59301883",
"text": "def valid?\n return false if !@id.nil? && @id.to_s.length < 1\n return false if !@updated_date.nil? && @updated_date.to_s.length < 1\n return false if !@issued_date.nil? && @issued_date.to_s.length < 1\n true\n end",
"title": ""
},
{
"docid": "51eefa6242f9c0a62c3aa8d92bfc7c22",
"score": "0.59195673",
"text": "def term_id_expects_id?\n return false if term_config.nil? || !(term_config.key? :term_id)\n term_config[:term_id] == \"ID\"\n end",
"title": ""
},
{
"docid": "bc39569d8a41e6e9daafae02303a2b84",
"score": "0.5914824",
"text": "def invalid_south_african_id_number; end",
"title": ""
},
{
"docid": "16ce7c02f5e0cb4c6d8931ad7aa8eb91",
"score": "0.58629775",
"text": "def id?\n @id\n end",
"title": ""
},
{
"docid": "9bcb18b587836e53a23efc3d40cc9fa0",
"score": "0.58422935",
"text": "def valid?\n metadata && id && name rescue false\n end",
"title": ""
},
{
"docid": "ec33d038cb49fd17ee03e64afa2cdf1c",
"score": "0.58407676",
"text": "def valid?\n (rows.all? &method(:valid_sequence?)) && (columns.all? &method(:valid_sequence?)) && (field_groups.all? &method(:valid_sequence?))\n end",
"title": ""
},
{
"docid": "9f73190df697ed8b1b15f352ea9d7931",
"score": "0.58248323",
"text": "def mongoid_id?\n to_s =~ /^(|_)id$/\n end",
"title": ""
},
{
"docid": "45b31e91aee7b8429672076069bd823e",
"score": "0.582333",
"text": "def is_column_rowid?( table_name, column_name )\n table_schema = @db.schema.tables[table_name]\n return false unless table_schema\n\n column_schema = table_schema.columns[column_name]\n if column_schema then\n if column_schema.primary_key? and column_schema.declared_data_type and column_schema.declared_data_type.upcase == \"INTEGER\" then\n return true\n end\n else\n return true if Statement.rowid_column_names.include?( column_name.upcase )\n end\n return false\n end",
"title": ""
},
{
"docid": "623d11b47308df06d94923f62b528a53",
"score": "0.58157724",
"text": "def valid_value?(row, column)\n return false unless %w[A B C].include?(row)\n return false unless [1,2,3].include?(column)\n true\n end",
"title": ""
},
{
"docid": "48ad20ead2f351704ab18a0e5c0b7746",
"score": "0.581195",
"text": "def id?\n true\n end",
"title": ""
},
{
"docid": "e55c47a88157dd5d64b5f0cc23076d69",
"score": "0.5807064",
"text": "def valid?\n @errors = []\n if id.blank?\n @errors << {message: \"#{class_name} id cannot be blank.\", variable: \"id\"}\n elsif !possible_values.include?(id)\n @errors << {message: \"#{class_name} id must be included in the table.\", variable: \"id\"}\n end\n \n if class_name.blank?\n @errors << {message: \"Class cannot be blank.\", variable: \"class\"}\n end\n \n @errors.empty?\n end",
"title": ""
},
{
"docid": "1b443b121087a66a246e17ffed0c4056",
"score": "0.5804976",
"text": "def valid_orcid_id?(id)\n if id =~ /[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9,X]{4}/\n id = id.delete('-')\n id[15] == orcid_checksum(id)\n else\n false\n end\n end",
"title": ""
},
{
"docid": "3d1ea79595d39cbc397cc4cbc021d713",
"score": "0.5765515",
"text": "def primary_key?\n false\n end",
"title": ""
},
{
"docid": "b5b93401c23cacd6ffc779f3e7c3e427",
"score": "0.5759557",
"text": "def is_id?(id, type: 'uuid')\r\n\r\n is_id = false\r\n\r\n # TODO - add support for other id types\r\n if type == 'uuid'\r\n is_id = id.to_s.match(/[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}/) != nil\r\n end\r\n\r\n return is_id\r\n end",
"title": ""
},
{
"docid": "c98f1835d4e82ef2c05d1f4ff925c3f0",
"score": "0.57532465",
"text": "def integer?\n primary_key_attribute = klass.attribute_types.select { |name, _| name == User.primary_key }\n if primary_key_attribute.key?(klass.primary_key.to_s)\n primary_key_attribute[klass.primary_key].type == :integer\n else\n true\n end\n end",
"title": ""
},
{
"docid": "0b1a7827d7a506b5536838e9609ffb80",
"score": "0.574259",
"text": "def should_be_integer?(field_info, field)\n field_info[\"type\"] == \"INTEGER\"\n end",
"title": ""
},
{
"docid": "7c5cd1575d655ce2d39655732d247985",
"score": "0.5732982",
"text": "def valid?\n return false if @type.nil?\n type_validator = EnumAttributeValidator.new('String', [\"ITEM\", \"CATEGORY\", \"ITEM_VARIATION\", \"TAX\", \"DISCOUNT\", \"MODIFIER_LIST\", \"MODIFIER\"])\n return false unless type_validator.valid?(@type)\n return false if @id.nil?\n return false if @id.to_s.length < 1\n return true\n end",
"title": ""
},
{
"docid": "caaf001cd1ea8be7eab55b7115523672",
"score": "0.57252747",
"text": "def is_id?(id, type: 'uuid')\n\n is_id = false\n\n # TODO - add support for other id types\n if type == 'uuid'\n is_id = id.to_s.match(/[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}/) != nil\n end\n\n return is_id\n end",
"title": ""
},
{
"docid": "99635b1e1c4ec67b6366be39628e3b19",
"score": "0.5723528",
"text": "def identifier_valid?(key)\n key = key.to_s\n ForbiddenChars.each_char do |char|\n return false if key.include?(char)\n end\n end",
"title": ""
},
{
"docid": "bd9ac9a5ed2912b3efc5da0282a263b2",
"score": "0.5717935",
"text": "def valid?(id)\n store = new\n store.send(:ids).include?(id.to_i)\n end",
"title": ""
},
{
"docid": "c9c74e11ce00d94d2b4dea00452ee430",
"score": "0.5703615",
"text": "def valid?\n value\n end",
"title": ""
},
{
"docid": "e66381e2c88ee52b43925c2a0bd1dab5",
"score": "0.57034796",
"text": "def valid_column?(index)\n column_values = column(index).compact\n column_values == column_values.uniq\n end",
"title": ""
},
{
"docid": "7954f6e7450c94bb1dc1d62ef079adfb",
"score": "0.5698015",
"text": "def stable_id?\n false\n end",
"title": ""
},
{
"docid": "43dffeeee828a6fa3ac400768be53f72",
"score": "0.5694029",
"text": "def is_id?\n get_classes.any? { |e| e =~ /\\Aid_/ }\n end",
"title": ""
},
{
"docid": "3a22ca26d02f380a92515ed989478ed9",
"score": "0.5688588",
"text": "def valid?\n return page_identifier?\n end",
"title": ""
},
{
"docid": "2410e9200db6ce22617e4da619748117",
"score": "0.5685566",
"text": "def validate_id( id )\n\t\tself.log.debug \"validating ID %p\" % [ id ]\n\t\tfinish_with Apache::BAD_REQUEST, \"missing ID\" if id.nil?\n\t\tfinish_with Apache::BAD_REQUEST, \"malformed or invalid ID: #{id}\" unless\n\t\t\tid =~ /^\\d+$/\n\n\t\tid.untaint\n\t\treturn Integer( id )\n\tend",
"title": ""
},
{
"docid": "b775ea848293163fea73041c6f50b0db",
"score": "0.5667357",
"text": "def is_id? str\n match = [KVP,DELIM]\n return false if match.any? {|w| str.include? w}\n return true\n end",
"title": ""
},
{
"docid": "d6ed9ee35bf62d98692a3855354a9f38",
"score": "0.56610274",
"text": "def attribute_is_id_or_foreign_key(attr_name)\n attr_name == 'id' || attr_name.to_s.end_with?('_id')\n end",
"title": ""
},
{
"docid": "cbd6d8004c49b0d7ef703e4b3ce5399f",
"score": "0.56582236",
"text": "def cast_tinyint_integer?(field)\n field.length != 1\n end",
"title": ""
},
{
"docid": "db7201a695772216a6bedbb620650237",
"score": "0.5652944",
"text": "def valid?(value)\n true\n end",
"title": ""
},
{
"docid": "7772886237f9dff75a565955252cc237",
"score": "0.56435764",
"text": "def to_valid_id(id)\n Integer(id)\n rescue TypeError, ArgumentError, RangeError\n id.to_s.to_sym\n end",
"title": ""
},
{
"docid": "d1b2bd8cde351ab52036f3ed8d2bf4cb",
"score": "0.5638194",
"text": "def valid?\n not @local_id.nil?\n end",
"title": ""
},
{
"docid": "f105eb4c0b88865d441ff9f81c25c7b3",
"score": "0.56337947",
"text": "def must_have_value?()\n return @df_int == nil\n end",
"title": ""
},
{
"docid": "224f2acd62cabb05412a00e0a02a5eab",
"score": "0.5619949",
"text": "def contains_valid_transaction_id?()\n\t\treturn (!self.auth_transaction_id.blank? && self.auth_transaction_id != 0)\n\tend",
"title": ""
},
{
"docid": "d0da471aa467b553a0c8a0181f48030d",
"score": "0.56187445",
"text": "def valid?\n @x.is_a?(Integer) &&\n @y.is_a?(Integer) &&\n orientation_set?\n end",
"title": ""
},
{
"docid": "8d00cff66da2d4999bacb28202000578",
"score": "0.5597306",
"text": "def valid_column?(column_name)\n column_name && self.class.sortable_attributes.include?(column_name)\n end",
"title": ""
},
{
"docid": "2211b15fb5e4ddb2352918625f137bd0",
"score": "0.5597229",
"text": "def valid_for_deletion?\n return false if id.nil? || sync_token.nil?\n id.value.to_i > 0 && !sync_token.to_s.empty? && sync_token.to_i >= 0\n end",
"title": ""
},
{
"docid": "1e751c1b4802b458434ad8d62ee3705b",
"score": "0.55868757",
"text": "def valid_id?(thor_command_name,value, override_context_params=nil, active_context_copy=nil)\n\n command_clazz = Context.get_command_class(thor_command_name)\n if command_clazz.list_method_supported?\n if override_context_params\n context_params = override_context_params\n else\n context_params = get_command_parameters(thor_command_name, [], active_context_copy)[2]\n end\n\n tmp = command_clazz.valid_id?(value, @conn, context_params)\n return tmp\n end\n\n return nil\n end",
"title": ""
},
{
"docid": "3c5b38ed02263b11bab1b6c306d592eb",
"score": "0.5586067",
"text": "def invalid?\n tmdb_id.nil?\n end",
"title": ""
},
{
"docid": "c3f42453d2c8a05c37dbf9960de9b7ef",
"score": "0.55810213",
"text": "def valid_sid?(value)\n value.is_a?(String) && value.match?(SID_PATTERN)\n end",
"title": ""
},
{
"docid": "2ecfab95140f006ae041213f6d622c9e",
"score": "0.5578852",
"text": "def valid_input?(id_list)\n return false if id_list.empty?\n id_list.each do |id, quan|\n return false unless Product.where(\"id =?\", id).first\n return false if (quan.nil? || quan <=0)\n end\n end",
"title": ""
},
{
"docid": "42526b257a6806245011ce68503004ab",
"score": "0.55765545",
"text": "def has_primary_key_column?\n @has_primary_key_column ||= !primary_key_name.nil?\n end",
"title": ""
},
{
"docid": "daa365eb36fe0e6990bc6c02f42851d4",
"score": "0.5574899",
"text": "def exists?\n rec = run_sql(\"SELECT * FROM #{table} WHERE id = #{@id};\")\n if rec.empty?\n @errors << \"That id does not exist in the table.\"\n false\n else\n true\n end\n end",
"title": ""
},
{
"docid": "a939bc3ec5e6dd37540f05debd9c1695",
"score": "0.5565066",
"text": "def test_uniqueness(column, value)\n if committed?\n (self.class.where(column.to_sym, value) - self).empty?\n else\n list = self.class.where(column.to_sym, value)\n if list.size == 1\n list.first.id == id\n else\n true\n end\n end\n end",
"title": ""
},
{
"docid": "1f3fe11bf4842824faba8031b1fe750f",
"score": "0.55609316",
"text": "def integer_exception?(field)\n foreign_key?(field) || self.send(field).blank?\n end",
"title": ""
},
{
"docid": "269b179edae7b11fa7904a5ad07ffbba",
"score": "0.5553909",
"text": "def id_truncated?\n !@trace_id_upper64.nil?\n end",
"title": ""
},
{
"docid": "b8cb9eeecb364bcff8ba0a2571c122a2",
"score": "0.55460495",
"text": "def valid_email_id?(email_id)\n is_valid_data_with_format?(email_id, /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}$/, \"Email\")\nend",
"title": ""
},
{
"docid": "1d71c1e01365187d60f0fa9e7c2b1295",
"score": "0.5543894",
"text": "def valid?(value)\n result = underlying_schema.call(value, Options.fail_fast)\n result.valid?\n end",
"title": ""
},
{
"docid": "63dc411bb62e034a489e4c6c9386ba6d",
"score": "0.55428725",
"text": "def validate_id( uid )\n\t\tself.log.debug \"validating userid (UID) %p\" % [ uid ]\n\t\tfinish_with Apache::BAD_REQUEST, \"missing ID\" if uid.nil?\n\t\tfinish_with Apache::BAD_REQUEST, \"malformed or invalid ID: #{uid}\" unless\n\t\t\tuid =~ /^\\w{3,16}$/\n\n\t\tuid.untaint\n\t\treturn uid\n\tend",
"title": ""
},
{
"docid": "954ddcd2f475ebdd7aefd9028a6d0d2a",
"score": "0.5540917",
"text": "def matches_column?(c)\n if (value = self[c.name])\n return c.allows_value?(value)\n else\n return true\n end\n end",
"title": ""
},
{
"docid": "2cf4483823781403f3316fdb413b95ba",
"score": "0.5537364",
"text": "def found_using_numeric_id?\n !found_using_friendly_id?\n end",
"title": ""
},
{
"docid": "0d2d9afa5de332bc6e4bf470bff243c7",
"score": "0.55329174",
"text": "def has_content_id?\n !fields.select { |f| f.responsible_for?('Content-ID') }.empty?\n end",
"title": ""
},
{
"docid": "0574d45eeaa34fedd5ce0fc543d37304",
"score": "0.5530622",
"text": "def valid_id(text)\n\t NinjaGen.id_filter.match(text)\n end",
"title": ""
},
{
"docid": "576245494c4366bde807efac415c88e5",
"score": "0.55106336",
"text": "def value_valid?\n return true\n end",
"title": ""
},
{
"docid": "29ee5cb2ee270043aa25722f9e39b946",
"score": "0.55077237",
"text": "def schema_array?(value, id, uniqueness_check = true)\n non_empty_array?(value, uniqueness_check) &&\n value.to_enum.with_index.all? do |schema, index|\n full_id = [id, index].join('/')\n valid_schema? schema, full_id\n end\n end",
"title": ""
},
{
"docid": "860d19a351d3cf30cb6310d070fd2f18",
"score": "0.5507057",
"text": "def validate_integer_type(field)\n if field.is_a?(Integer)\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "62772914e32da8cfc7dd07e9d31e6612",
"score": "0.5502581",
"text": "def valid?\n @value ? true : false\n end",
"title": ""
},
{
"docid": "365261b6277a07e2714a641b92665bef",
"score": "0.5493417",
"text": "def id(data)\n true\n end",
"title": ""
},
{
"docid": "34d06f2ccc9926c02db5ce16cfaa2cc5",
"score": "0.54909486",
"text": "def valid_id(major)\n unless major =~ /^[a-zA-Z0-9]*$/\n puts \"#{major} is not a valid imgur ID or URL\"\n return false\n end\n return true\n end",
"title": ""
},
{
"docid": "5f824c5e845ab8f60067788859715b7b",
"score": "0.5486305",
"text": "def validate\n validate_presence_of(:id).map do |e|\n { type: :error, message: \"Field \\\"#{e}\\\" is not defined or empty for attribute \\\"#{id}\\\"\" }\n end\n end",
"title": ""
},
{
"docid": "a6477b8ff37e0819e69ee219a4f2092d",
"score": "0.5478514",
"text": "def object_id_field?\n @object_id_field ||= (type == BSON::ObjectId)\n end",
"title": ""
}
] |
709feee374a53b5e7af9fc415c17d513
|
GET /job_scope_additions GET /job_scope_additions.xml
|
[
{
"docid": "93cde45eb7266e22697125e0db8e7cfd",
"score": "0.64164305",
"text": "def index\n @job = Job.find(params[:jid]) if params[:jid] and Job.exists?(params[:jid])\n redirect_to jobs_path unless @job\n @job = Job.find(params[:jid]) if params[:jid] and Job.exists?(params[:jid])\n redirect_to jobs_path unless @job\n @job_scope_additions = JobScopeAddition.find_all_by_jobs_id(@job.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @job_scope_additions }\n end\n end",
"title": ""
}
] |
[
{
"docid": "d425d04fe7e60bc15f7cc6e9f9edd9d3",
"score": "0.5893007",
"text": "def show\n @job_scope_addition = JobScopeAddition.find(params[:id])\n @job = Job.find(@job_scope_addition.jobs_id) if @job_scope_addition.jobs_id and Job.exists?(@job_scope_addition.jobs_id)\n redirect_to jobs_path unless @job\n @scope_type = ScopeType.find_all_by_ProjectTypeID(@job.ProjectTypeID)\n session[:job_extra_id] = params[:id]\n session[:scope_type] = @job_scope_addition.ScopeTypeID \n set_milestone_records(@job_scope_addition.ScopeTypeID)\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @job_scope_addition }\n end\n end",
"title": ""
},
{
"docid": "312069fe1e8af22759b8775433fbd473",
"score": "0.5624787",
"text": "def update\n @job_scope_addition = JobScopeAddition.find(params[:id])\n\n respond_to do |format|\n if @job_scope_addition.update_attributes(params[:job_scope_addition])\n format.html { redirect_to(:action => :show, :jid => @job_scope_addition.jobs_id, :notice => 'Job scope addition was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { redirect_to :action => :show, :jid => @job_scope_addition.jobs_id, :alert => \"Failed to save\" }\n format.xml { render :xml => @job_scope_addition.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "31774fc5aa527f3998abf46bf864fb3d",
"score": "0.5545263",
"text": "def create\n @job_scope_addition = JobScopeAddition.new(params[:job_scope_addition])\n\n respond_to do |format|\n if @job_scope_addition.save\n format.html { redirect_to(:action => :show,:id => @job_scope_addition.id, :jid => @job_scope_addition.jobs_id, :notice => 'Extra Scope was successfully created.') }\n format.xml { render :xml => @job_scope_addition, :status => :created, :location => @job_scope_addition }\n else\n format.html { redirect_to :action => \"new\", :jid => @job_scope_addition.jobs_id, :alert => \"Failed to save\" }\n format.xml { render :xml => @job_scope_addition.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a51d7dd27fa8dbb52f876395e28e1e4a",
"score": "0.5392202",
"text": "def index\n @job_applications = @job_applications_active\n end",
"title": ""
},
{
"docid": "8c03d18ed255e06f21d749ae4dfa02e2",
"score": "0.5364222",
"text": "def requests(job)\r\n {\r\n :journal_entry_query_rq => {\r\n # :max_returned => 100,\r\n # :xml_attributes => { \"requestID\" =>\"1\", 'iterator' => \"Start\" },\r\n :modified_date_range_filter => {\"from_modified_date\" => qbwc_log_init(WorkerName), \"to_modified_date\" => qbwc_log_end()},\r\n :include_line_items => true\r\n }\r\n }\r\n end",
"title": ""
},
{
"docid": "89ce305a096832e8440e2bbf1681f2da",
"score": "0.5354238",
"text": "def new\n session[:scope_type] = nil\n @job_scope_addition = JobScopeAddition.new\n @job = Job.find(params[:jid]) if params[:jid] and Job.exists?(params[:jid])\n redirect_to jobs_path unless @job\n @scope_type = ScopeType.find_all_by_ProjectTypeID(@job.ProjectTypeID)\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @job_scope_addition }\n end\n end",
"title": ""
},
{
"docid": "36dba15632aa7b78fec878a7143a1397",
"score": "0.5271394",
"text": "def sample_list_jobs project_id, tenant_id, filter\n # [START job_search_list_jobs]\n require \"google/cloud/talent\"\n\n # Instantiate a client\n job_service = Google::Cloud::Talent.job_service\n\n # project_id = \"Your Google Cloud Project ID\"\n # tenant_id = \"Your Tenant ID (using tenancy is required)\"\n formatted_parent = job_service.tenant_path project: project_id, tenant: tenant_id\n\n # Iterate over all results.\n # filter = \"companyName=\\\"projects/my-project/companies/company-id\\\"\"\n job_service.list_jobs(parent: formatted_parent, filter: filter).each do |element|\n puts \"Job name: #{element.name}\"\n puts \"Job requisition ID: #{element.requisition_id}\"\n puts \"Job title: #{element.title}\"\n puts \"Job description: #{element.description}\"\n end\n # [END job_search_list_jobs]\nend",
"title": ""
},
{
"docid": "41942662bb094616583742f21293dacf",
"score": "0.5195498",
"text": "def index\n authorize Job\n #\n @jobs = policy_scope(Job)\n end",
"title": ""
},
{
"docid": "bc328c7ac786874624bc47228913bfe8",
"score": "0.5173714",
"text": "def get_editions(params = {})\n get_json(get_editions_url(params))\n end",
"title": ""
},
{
"docid": "017cba59f1d59e2468c12842a4b90544",
"score": "0.5165828",
"text": "def index\n @applied_jobs = current_user.applied_jobs #AppliedJob.all\n end",
"title": ""
},
{
"docid": "e15fca200174a2d1c185480ba48e4e11",
"score": "0.51532435",
"text": "def execution_scope()\n return MicrosoftGraph::IdentityGovernance::LifecycleWorkflows::Workflows::Item::ExecutionScope::ExecutionScopeRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"title": ""
},
{
"docid": "8d77fcc9915e33d0ba7bed1e5cad32b6",
"score": "0.5141867",
"text": "def index\n @job_requests = JobRequest.all\n end",
"title": ""
},
{
"docid": "e45141d6e5cd705e1b48553b3f08a545",
"score": "0.5134245",
"text": "def getCurrentJobs\n getJobs('0/')\n end",
"title": ""
},
{
"docid": "e917895b92007da3f2679e4861e946cd",
"score": "0.512671",
"text": "def index\n\n @requisitions = Requisition.all\n end",
"title": ""
},
{
"docid": "6a761333fb245a7345636943acc58bcf",
"score": "0.5106236",
"text": "def index\n @requisitions = current_user.requisitions.length\n end",
"title": ""
},
{
"docid": "f4924a04c55cb04547eef2c3b7297d77",
"score": "0.50795305",
"text": "def index\n @user=current_user\n @jobapplications = @user.jobapplications\n end",
"title": ""
},
{
"docid": "26b7c571935bf41e6a8c10a33d122afa",
"score": "0.503442",
"text": "def getJobApi (options)\n uri = options[:job] + \"?depth=\" + options[:depth].to_s\n job_uri = URI.parse(uri)\n http = Net::HTTP.new(job_uri.host, job_uri.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Get.new(job_uri.request_uri)\n request.basic_auth @username, @password\n response = http.request(request)\n job_xml=XmlSimple.xml_in(response.body)\n return job_xml\n end",
"title": ""
},
{
"docid": "143400298b428564d0903dcb0ecc7ef7",
"score": "0.49955016",
"text": "def index\n @applications = @application_scope\n end",
"title": ""
},
{
"docid": "f078777ff75a1dedf09a28f2cb4a7d4e",
"score": "0.4966417",
"text": "def index\n @applicant_jobs = ApplicantJob.all\n end",
"title": ""
},
{
"docid": "2996f64edd26f79ed1dbec8089271e16",
"score": "0.4933404",
"text": "def index\n @additions = Addition.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @additions }\n end\n end",
"title": ""
},
{
"docid": "fb22df73981bdd9a2c85b9b9bc8b333e",
"score": "0.49291092",
"text": "def show\n @applied_job = AppliedJob.find(params[:id])\n end",
"title": ""
},
{
"docid": "c9ab3a23e1521c451bdd7a6d06be30c4",
"score": "0.49247",
"text": "def get_jobs_sample(client)\n response = client['jobs'].get\n\n p ''\n p 'Get jobs'\n p response\nend",
"title": ""
},
{
"docid": "f7491484c92dbec112e4de51d584c8d7",
"score": "0.49217176",
"text": "def allocations(id)\n connection.get do |req|\n req.url \"job/#{id}/allocations\"\n end\n end",
"title": ""
},
{
"docid": "be0580704e8e2bf9ed2e6c0d7372c642",
"score": "0.49153316",
"text": "def available_jobs\n active_jobs + eligible_jobs\n end",
"title": ""
},
{
"docid": "89978e5a1ff286e3a7999c575115c80c",
"score": "0.49075457",
"text": "def jobs\n JobPolicy::Scope.new(self, Job).resolve\n end",
"title": ""
},
{
"docid": "902fc9335285f85f00eeb96a159c90d5",
"score": "0.48907277",
"text": "def index\n @training_active_jobs = Training::ActiveJob.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @training_active_jobs }\n end\n end",
"title": ""
},
{
"docid": "c25549cd22454783ac4340709c3cf3dd",
"score": "0.48821783",
"text": "def index\n @requisitions = Requisition.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @requisitions }\n end\n end",
"title": ""
},
{
"docid": "b915ee37797dcc9fc0b72113833840b7",
"score": "0.48550138",
"text": "def show\n allow :get, :delete; vary_on :accept\n job = OAR::Job.expanded.find(\n params[:id],\n :include => [:job_types, :job_events, :gantt]\n )\n job.links = links_for_item(job)\n\n render_opts = {:methods => [:resources_by_type, :assigned_nodes]}\n respond_to do |format|\n format.g5kitemjson { render render_opts.merge(:json => job) }\n format.json { render render_opts.merge(:json => job) }\n end\n end",
"title": ""
},
{
"docid": "4d3c9745c4dea5735e1c85697a4c638a",
"score": "0.48443356",
"text": "def show\n allow :get, :delete; vary_on :accept\n job = OAR::Job.expanded.includes(:job_types, :job_events, :gantt).find(\n params[:id]\n )\n job.links = links_for_item(job)\n\n render_opts = { methods: %i[resources_by_type assigned_nodes] }\n render_result(job, render_opts)\n end",
"title": ""
},
{
"docid": "d81a759b6fd13c51e295c8ca5a8de3d8",
"score": "0.4838298",
"text": "def destroy\n @job_scope_addition = JobScopeAddition.find(params[:id])\n jid = @job_scope_addition.jobs_id\n jsa_id = params[:id]\n recs = AdditionTaskRecord.find_all_by_jobs_id(jsa_id)\n delete_records(recs)\n @job_scope_addition.destroy\n\n respond_to do |format|\n format.html { redirect_to(\"#{job_scope_additions_url}?jid=#{jid}\") }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "aa5a18ce3cb8b749c4db4fda7fd5f057",
"score": "0.48344767",
"text": "def index\n @jobs = Job.by_company_id(current_user.company_id).published_and_closed_jobs\n @applicants = Applicant.total_applicant(current_user.company.id, @jobs) \n @schedules = current_user.get_schedules\n end",
"title": ""
},
{
"docid": "6360b4a07488acd6efa8dfe93f29220c",
"score": "0.48338738",
"text": "def index\n if current_user.role == 'employee'\n @job_applications_made = current_user.employee.job_applications\n else\n @job_applications = JobApplication.all\n end\n end",
"title": ""
},
{
"docid": "70c82b7fe41847d56a3584853a53bb34",
"score": "0.4820316",
"text": "def index\n @job_applications = JobApplication.all\n end",
"title": ""
},
{
"docid": "06685724904bc73938ddd92b0132d838",
"score": "0.48014182",
"text": "def requests(job)\r\n {\r\n :account_query_rq => {\r\n :active_status => \"ActiveOnly\",\r\n :from_modified_date => qbwc_log_init(WorkerName),\r\n :to_modified_date => qbwc_log_end()\r\n }\r\n }\r\n end",
"title": ""
},
{
"docid": "f8446e9082b91f9e2f0a0ab1e36e0708",
"score": "0.47731966",
"text": "def show\r\n @org = Org.from_param(params[:abbr])\r\n # @jobs = Job.find(Curation.where(:org_id => @org.id).pluck(:job_id))\r\n @jobs = @org.jobs\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @org }\r\n end\r\n end",
"title": ""
},
{
"docid": "344cc5a36b9e716d2180aa7fff7591df",
"score": "0.47385365",
"text": "def job_service\n job_arguments(0)\n end",
"title": ""
},
{
"docid": "8cb857e18c3e44405f0f01e89c2fdcdd",
"score": "0.4736534",
"text": "def index\n @jobapplications = Jobapplication.all\n end",
"title": ""
},
{
"docid": "e85582e04be15325e05bb1d0f0758cbc",
"score": "0.47318295",
"text": "def available_agents\n @job = Job.find(params[:id])\n @jhooks = Jhook.where(job_id: @job.id)\n end",
"title": ""
},
{
"docid": "f6e93d7233884b9f5149dcb42ebe23c6",
"score": "0.47227973",
"text": "def iteration_backlog(project_id, options = {})\n get(\"projects/#{project_id}/iterations/backlog\", options).iterations\n end",
"title": ""
},
{
"docid": "24c58e944c0479449f68f17c8caa62a8",
"score": "0.471844",
"text": "def iteration_current_and_backlog(project_id, options = {})\n get(\"projects/#{project_id}/iterations/current_backlog\", options).iterations\n end",
"title": ""
},
{
"docid": "ae7d0595f878464dcd714cf4c3e4b0f8",
"score": "0.47176182",
"text": "def getExecutionsForAJob(job_id)\n uri = URI(RUNDECKSERVER + ':' + RUNDECKPORT + '/api/1/job/' + job_id + '/executions')\n http = Net::HTTP.new(uri.host, uri.port)\n headers = {\n 'Content-Type'=> 'application/json',\n 'X-RunDeck-Auth-Token'=> API_KEY \n}\n r = http.get(uri.path, headers)\n return r.body.force_encoding(\"UTF-8\")\nend",
"title": ""
},
{
"docid": "42a25a2b4e17b182cf377ab3d05d3a88",
"score": "0.47153753",
"text": "def index\n @acquisitions = Acquisition.all\n end",
"title": ""
},
{
"docid": "acdfc97d1088b62f5bdfb227a9b8aefb",
"score": "0.46666685",
"text": "def index\n @training_approvals = TrainingApproval.all\n end",
"title": ""
},
{
"docid": "d8e641c5ab1efe5121c9e52e2831d3dd",
"score": "0.46660244",
"text": "def requests(job)\r\n {\r\n :list_deleted_query_rq => {\r\n :xml_attributes => { \"requestID\" =>\"1\"},\r\n :list_del_type => [\"Account\", \"Customer\", \"InventorySite\", \"ItemDiscount\", \"ItemFixedAsset\", \"ItemGroup\", \"ItemInventory\", \"ItemInventoryAssembly\", \"ItemNonInventory\", \"ItemOtherCharge\", \"ItemPayment\", \"ItemService\", \"ItemSubtotal\", \"Vendor\"],\r\n :deleted_date_range_filter => {\"from_deleted_date\" => qbwc_log_init(WorkerName), \"to_deleted_date\" => qbwc_log_end()}\r\n }\r\n }\r\n end",
"title": ""
},
{
"docid": "12d5abb094d9576d5aa590c8022e9e72",
"score": "0.46610132",
"text": "def index\n @training_requests = if params[:q].blank?\n TrainingRequest.order(start_date: :desc)\n .includes(:assigned_to_user, :requested_by_user)\n .page params[:page]\n else\n elastic_search_results(TrainingRequest)\n end\n end",
"title": ""
},
{
"docid": "fa097c85d927819d9a94981eecb8c086",
"score": "0.46555966",
"text": "def job_discovery_job_title_auto_complete project_id:, company_name:, query:\n # [START job_discovery_job_title_auto_complete]\n # project_id = \"Project id required\"\n # company_name = \"The resource name of the company listing the job. The format is \"projects/{project_id}/companies/{company_id}\"\"\n # query = \"Job title prefix as auto complete query\"\n\n require \"google/apis/jobs_v3\"\n\n jobs = Google::Apis::JobsV3\n talent_solution_client = jobs::CloudTalentSolutionService.new\n talent_solution_client.authorization = Google::Auth.get_application_default(\n \"https://www.googleapis.com/auth/jobs\"\n )\n\n page_size = 10\n type = \"JOB_TITLE\"\n language_code = \"en-US\"\n talent_solution_client.complete_project(\n project_id, company_name: company_name, page_size: page_size, query: query,\n language_code: language_code, type: type\n ) do |result, err|\n if err.nil?\n puts \"Job title auto complete result: #{result.to_json}\"\n else\n puts \"Error when auto completing job title. Error message: #{err.to_json}\"\n end\n end\n # [END job_discovery_job_title_auto_complete]\nend",
"title": ""
},
{
"docid": "fd502ac918b599445de63a9768d2895a",
"score": "0.46537867",
"text": "def getApplications(ak)\n uri='https://api.newrelic.com/v2/applications.json'\n parseUrl=URI.parse(uri)\n host=parseUrl.host\n path=parseUrl.path\n getRequest(ak,uri,host,path)\nend",
"title": ""
},
{
"docid": "7b369ff232963a2aa99c9b755ad4b2ad",
"score": "0.46527624",
"text": "def show\n # @applicant_job_history = ApplicantJobHistory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @applicant_job_history }\n end\n end",
"title": ""
},
{
"docid": "80e5d37a118563c59da41bf6dfbe415d",
"score": "0.46521378",
"text": "def index\n iterations = policy_scope(Iteration)\n render json: iterations\n end",
"title": ""
},
{
"docid": "3c680a7b3a68b8ccf835d2d42296e4b6",
"score": "0.46498793",
"text": "def get_ingest_run\n ApplicationController.life_sciences_api_client.get_pipeline(name: pipeline_name)\n end",
"title": ""
},
{
"docid": "d287e4ff9586680a4bf13a2de3765d97",
"score": "0.46413895",
"text": "def requests\n @requests = @startup.requests.startup_related_requests(current_user.brand_id)\n .order(created_at: :desc)\n end",
"title": ""
},
{
"docid": "9eb7ad15dff344068212b9b1b47e8999",
"score": "0.46377364",
"text": "def jobs\n ApplicationJob.descendants\nend",
"title": ""
},
{
"docid": "d434c92899b385aea685d66bd4ee526f",
"score": "0.4633738",
"text": "def list\n admin_check\n @page_hdr = \"Job Definition Listing\"\n @job_metadatas = JobEngine.instance.get_job_meta_datas\n @time_zone_string = TimeUtils.offset_to_zone(session[:tzOffset])\n @offset = session[:tzOffset]\n respond_to do |format|\n format.html #list.html.erb\n format.xml { render :xml => @job_metadatas }\n end\n end",
"title": ""
},
{
"docid": "788e1b63e9a81894a731a83532fbba61",
"score": "0.46305212",
"text": "def index\n @job_histories = JobHistory.all\n end",
"title": ""
},
{
"docid": "98c9bbd0365acc973a8717e82ccb7f41",
"score": "0.4629647",
"text": "def index\n @pending_jobs = PendingJob.all\n end",
"title": ""
},
{
"docid": "5e0162b7b73cf9daff6b2f0841664146",
"score": "0.4626084",
"text": "def index\n @nodes = @job.nodes.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @nodes }\n format.json { render :json => @nodes }\n end\n end",
"title": ""
},
{
"docid": "ac4c68423c0bfcb13e611951ecb2a510",
"score": "0.462173",
"text": "def activities\n @activities = if @project\n @project.activities\n else\n User.current.projects.all(:include => :time_entry_activities).map(&:time_entry_activities).flatten + TimeEntryActivity.shared.active\n end\n\n respond_to do |format|\n format.xml\n end\n end",
"title": ""
},
{
"docid": "03dd5c2e19c6da4a396a35a27d773e01",
"score": "0.46184915",
"text": "def index\n @reqpriorities = Reqpriority.all\n end",
"title": ""
},
{
"docid": "9324a3acfa770ff2cbbc88a19987a6b9",
"score": "0.46162334",
"text": "def index\n @job_items = @job.job_items.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @job_items }\n end\n end",
"title": ""
},
{
"docid": "a67ed3f3cd1b5382aa3726c06da6db89",
"score": "0.461337",
"text": "def index\n @resource_allocations = ResourceAllocation.scoped\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @resource_allocations }\n end\n end",
"title": ""
},
{
"docid": "bee076e74b8fb4099f324f125c330784",
"score": "0.4599128",
"text": "def index\n jobs = current_user.hr.jobs\n @applications = Array.new\n jobs.each do |job|\n job_faculties_map = Hash.new\n job_faculties_map[job] = Array.new\n if job.faculties.length > 0\n job.faculties.each do |faculty|\n job_faculties_map[job] << faculty\n end\n @applications << job_faculties_map\n end\n end\n @applications\n end",
"title": ""
},
{
"docid": "a2b09fd987e2521e49850a137a1b668d",
"score": "0.45977306",
"text": "def job_discovery_batch_create_jobs project_id:, company_name:\n # [START job_discovery_batch_create_jobs]\n # project_id = \"Id of the project\"\n # company_name = \"The resource name of the company listing the job. The format is \"projects/{project_id}/companies/{company_id}\"\"\n\n require \"google/apis/jobs_v3\"\n\n jobs = Google::Apis::JobsV3\n talent_solution_client = jobs::CloudTalentSolutionService.new\n # @see https://developers.google.com/identity/protocols/application-default-credentials#callingruby\n talent_solution_client.authorization = Google::Auth.get_application_default(\n \"https://www.googleapis.com/auth/jobs\"\n )\n\n jobs_created = []\n job_generated1 = jobs::Job.new requisition_id: \"Job: #{company_name} 1\",\n title: \" Lab Technician\",\n company_name: company_name,\n employment_types: [\"FULL_TIME\"],\n language_code: \"en-US\",\n application_info:\n (jobs::ApplicationInfo.new uris: [\"http://careers.google.com\"]),\n description: \"Design and improve software.\"\n job_generated2 = jobs::Job.new requisition_id: \"Job: #{company_name} 2\",\n title: \"Systems Administrator\",\n company_name: company_name,\n employment_types: [\"FULL_TIME\"],\n language_code: \"en-US\",\n application_info:\n (jobs::ApplicationInfo.new uris: [\"http://careers.google.com\"]),\n description: \"System Administrator for software.\"\n\n create_job_request1 = jobs::CreateJobRequest.new job: job_generated1\n create_job_request2 = jobs::CreateJobRequest.new job: job_generated2\n\n talent_solution_client.batch do |client|\n client.create_job project_id, create_job_request1 do |job, err|\n if err.nil?\n jobs_created.push job\n else\n puts \"Batch job create error message: #{err.message}\"\n end\n end\n client.create_job project_id, create_job_request2 do |job, err|\n if err.nil?\n jobs_created.push job\n else\n puts \"Batch job create error message: #{err.message}\"\n end\n end\n end\n # jobCreated = batchCreate.create_job(project_id, create_job_request1)\n puts \"Batch job created: #{jobs_created.to_json}\"\n jobs_created\n # [END job_discovery_batch_create_jobs]\nend",
"title": ""
},
{
"docid": "c7bd81854d5f4f4652bb04ae2d3fcf34",
"score": "0.4595723",
"text": "def index\n @job_site_applications = JobSiteApplication.all\n end",
"title": ""
},
{
"docid": "d8dd048804ca6bc92a5e4bb46608a0b1",
"score": "0.45944896",
"text": "def index\n @jobsites = Jobsite.all\n end",
"title": ""
},
{
"docid": "d8dd048804ca6bc92a5e4bb46608a0b1",
"score": "0.45944896",
"text": "def index\n @jobsites = Jobsite.all\n end",
"title": ""
},
{
"docid": "21b623c965d25101ab1fde88c8821fca",
"score": "0.45915717",
"text": "def activities\n get_call(\"1/activities.json\")\n end",
"title": ""
},
{
"docid": "2bb7488c764957dfdbe4eef8aba0ac36",
"score": "0.45903954",
"text": "def job_discovery_generate_featured_job company_name:, requisition_id:\n # [START job_discovery_generate_featured_job]\n # company_name = \"The resource name of the company listing the job. The format is \"projects/{project_id}/companies/{company_id}\"\"\n # requisition_id = \"The posting ID, assigned by the client to identify a job\"\n\n require \"google/apis/jobs_v3\"\n require \"securerandom\"\n # Instantiate the client\n jobs = Google::Apis::JobsV3\n\n talent_solution_client = jobs::CloudTalentSolutionService.new\n # @see\n # https://developers.google.com/identity/protocols/application-default-credentials#callingruby\n talent_solution_client.authorization = Google::Auth.get_application_default(\n \"https://www.googleapis.com/auth/jobs\"\n )\n\n application_info = jobs::ApplicationInfo.new uris: [\"http://careers.google.com\"]\n job_generated = jobs::Job.new requisition_id: requisition_id,\n title: \" Lab Technician\",\n company_name: company_name,\n application_info: application_info,\n description: \"Design, develop, test, deploy, \" +\n \"maintain and improve software.\"\n # Featured job is the job with positive promotion value\n job_generated.promotion_value = 2\n puts \"Featured Job generated: #{job_generated.to_json}\"\n job_generated\n # [END job_discovery_generate_featured_job]\nend",
"title": ""
},
{
"docid": "fc61430c3c230e926ea35a6b3f8261f1",
"score": "0.4587367",
"text": "def get_single_job_sample(client)\n response = client[\"jobs/#{$job_id}\"].get\n\n p ''\n p 'Get single job'\n p response\nend",
"title": ""
},
{
"docid": "57e7c22ceb666064d32f8d5dc3a93e39",
"score": "0.45869675",
"text": "def job_items\n job_arguments(1)\n end",
"title": ""
},
{
"docid": "c99b04882ccce5965f6dc97de345db91",
"score": "0.4580674",
"text": "def stages()\n return MicrosoftGraph::IdentityGovernance::AccessReviews::Definitions::Item::Instances::Item::Stages::StagesRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"title": ""
},
{
"docid": "62f988c4da068628142e45d91c19f0a4",
"score": "0.4575402",
"text": "def index\n @jobs = Job.all\n # @jobs = ScriptedClient::Job.all\n end",
"title": ""
},
{
"docid": "b22e93cf69c7e8d62c229b17d4b15b7d",
"score": "0.45712334",
"text": "def show\n @job = Job.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @job.to_xml(:include => { :job_parameters => { :include => :data_set } }) }\n end\n end",
"title": ""
},
{
"docid": "0088af75ca4aada8051b57f418a2d0d2",
"score": "0.4569805",
"text": "def start_job\n associate(Wesabe::Job.from_xml(Hpricot::XML(post(:url => \"/credentials/#{id}/jobs.xml\")) / :job))\n end",
"title": ""
},
{
"docid": "0226a20e8c4bc030c0607eaab0cc39ae",
"score": "0.45628718",
"text": "def index\n @requisitions = Requisition.all.order(id: :desc)\n end",
"title": ""
},
{
"docid": "4adc296f1c65fe2195946334f2973f79",
"score": "0.45595902",
"text": "def index\n @inventories = current_company.inventories.find_all_by_job_id(params[:job_id])\n respond_to do |format|\n format.xml{ render :xml => @inventories }\n format.json{ render :json => @inventories }\n end\n end",
"title": ""
},
{
"docid": "bcde924b6a39c4a4e64b02820c67ba57",
"score": "0.45591155",
"text": "def index\n @applied_lines = AppliedLine.all\n end",
"title": ""
},
{
"docid": "49419ebacdb9be6789e61127c6992af2",
"score": "0.4544734",
"text": "def index\n @job_progresses = JobProgress.all\n end",
"title": ""
},
{
"docid": "4316e9b0a196d67bfda7b66c24a7c23e",
"score": "0.45431516",
"text": "def accr_int()\n return MicrosoftGraph::Drives::Item::Items::Item::Workbook::Functions::AccrInt::AccrIntRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"title": ""
},
{
"docid": "60aa49f8948663032f1d3d152401187c",
"score": "0.45391318",
"text": "def index\n @jobs = PeriodicJob.list params[:page], current_user.row_limit\n end",
"title": ""
},
{
"docid": "f086d2fcaeffc48f6792630f779a6317",
"score": "0.4539018",
"text": "def editions\n works.map {|work| work.editions}.flatten.map\n end",
"title": ""
},
{
"docid": "b66d100d9a724a33a2284a72954b9d15",
"score": "0.4538237",
"text": "def index\n @early_access_requests = EarlyAccessRequest.all\n end",
"title": ""
},
{
"docid": "9c83b732cbb516b22cae3cb375a4ed6a",
"score": "0.4535304",
"text": "def index\n @act_jobs = ActJob.all\n end",
"title": ""
},
{
"docid": "159dabebfc0869ce11af9bfeeb6c8991",
"score": "0.45300847",
"text": "def additions\n commit_summary(:additions)\n end",
"title": ""
},
{
"docid": "e4109bea7d8b082d32718c179f26ed88",
"score": "0.45298237",
"text": "def active_job_requests\n self.job_requests.joins(:project).where( :is_canceled => false, :project => {\n :is_finished => false ,\n :is_deleted => false \n } ).order(\"deadline_date ASC, is_finished ASC, created_at DESC\")\n end",
"title": ""
},
{
"docid": "34ab96343acbc265f027279914028e87",
"score": "0.4527383",
"text": "def show\n @training_active_job = Training::ActiveJob.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @training_active_job }\n end\n end",
"title": ""
},
{
"docid": "2c2b6c7f2d0ebb4fa7c79724f6e80dae",
"score": "0.45264074",
"text": "def evaluations(id)\n connection.get do |req|\n req.url \"job/#{id}/evaluations\"\n end\n end",
"title": ""
},
{
"docid": "4bafbe6e3489505a4e69eb0ad193aa18",
"score": "0.4522705",
"text": "def index\n @job_applications = JobApplication.for_status params[:status_type]\n end",
"title": ""
},
{
"docid": "15a82eca9999b8e71cf352010190f7f8",
"score": "0.452078",
"text": "def get_req_qualifications(page)\n page.css(WebScraper::JOB_DETAILS_SELECTOR)[WebScraper::JOB_REQ_QUAL_POS].content.strip\n end",
"title": ""
},
{
"docid": "e10b8637ef8826aa3280f73d7d15f55a",
"score": "0.4518157",
"text": "def build_jobs_url\n \"http://#{host_name}:#{port}/jobs\"\n end",
"title": ""
},
{
"docid": "e37c402158868fb34add543ed27b86e2",
"score": "0.45145053",
"text": "def index\n do_authorize_class\n do_get_opts\n\n do_get_analysis_job\n @analysis_jobs_items, opts = Settings.api_response.response_advanced(\n api_filter_params,\n get_query,\n AnalysisJobsItem,\n AnalysisJobsItem.filter_settings(@is_system_job)\n )\n\n respond_index(opts)\n end",
"title": ""
},
{
"docid": "04221864fe229aef9c6171d4899c2851",
"score": "0.45060703",
"text": "def get_requests\n @requests\n end",
"title": ""
},
{
"docid": "444df947ad121a813e2f0f08800696a8",
"score": "0.45012012",
"text": "def jobs\n\t\t# ...\n\tend",
"title": ""
},
{
"docid": "8323dc3abbf50e6442a7546826c902df",
"score": "0.4494434",
"text": "def index\n $lmc_left_menu = \"lmw_all_jobs\"\n $lmc_subleft_menu = \"lmw_job_applications\"\n @user = current_user\n @job_applications_ids = current_user.job_applications.pluck(:job_id)\n @job_applications = Job.where(id: @job_applications_ids).text_search(params[:query], params[:town], params[:status])\n end",
"title": ""
},
{
"docid": "0e7ca5e6244a1261110fb49f6c40b476",
"score": "0.44877797",
"text": "def index\n if params[:q].blank?\n @assignment_queues = AssignmentQueue.order(id: :desc).includes(:user, :training_request).page params[:page]\n else\n @assignment_queues = AssignmentQueue.search(params[:q]).page(params[:page]).records\n end\n end",
"title": ""
},
{
"docid": "ebb8a8614925e07473e399e94fcc5641",
"score": "0.44868577",
"text": "def index\n @jobs = Job.published.desc\n end",
"title": ""
},
{
"docid": "66b522d0dd79efac93851d727f5c37fd",
"score": "0.4485664",
"text": "def index #method for index.html.erb\n @jobs = Job.all#fetch all jobs from controllers/jobs.rb\n #@jobs = Job.where :approve => true#fetch jobs that the admin approved from controllers/jobs.rb\n end",
"title": ""
},
{
"docid": "eacd9355de9140623bfd73c9b098c3f8",
"score": "0.44809687",
"text": "def index\n \n @meeting_threads = @current_user.available_jobs\n \n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @meeting_threads }\n end\n end",
"title": ""
},
{
"docid": "e6cd5f766c24f2e971005d94ac285fbd",
"score": "0.44776756",
"text": "def show\n @step = TaskrequestsStep.find(params[:taskrequests_step_id])\n @absence_request = @step.absence_requests.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @absence_request }\n end\n end",
"title": ""
},
{
"docid": "a1ef9ecb09ed40734cb61afafd4a15c9",
"score": "0.44704053",
"text": "def index\n @job_products = @job.job_products\n end",
"title": ""
},
{
"docid": "03ce88d1c186a7deccd97409d8ac8f92",
"score": "0.4470247",
"text": "def index\n gon.areas = Area.all\n gon.companies = Company.all\n @training_executions = TrainingExecution.filter_training_executions(params)\n @training_executions = @training_executions.paginate(page: params[:page])\n end",
"title": ""
}
] |
e09c4d358c5f01e26296a14430186343
|
Sat Dec 4 01:40:54 IST 2010, ramonrails TODO: DRY this up
|
[
{
"docid": "95b21b1a4fc081edeae0bd890de4340b",
"score": "0.0",
"text": "def create_caregiver_profile\n @user = User.new(params[:user])\n @profile = Profile.new(params[:profile])\n @user.profile = @profile\n @senior = User.find(params[:patient_id].to_i) # senior variable is used in view\n\n User.transaction do \n @user.email = params[:email]\n @user.is_new_caregiver = true\n @user[:is_caregiver] = true\n @user.skip_validation = true # skip validation, just save user data\n # \n # Wed Nov 24 03:31:20 IST 2010, ramonrails\n # * caregiver role is lazy load now\n # * this is required to set the role and send emails\n @user.lazy_roles[:caregiver] = @senior\n\n if @user.save\n # @user\n @user.activate #this call differentiates this method UsersController.populate_caregiver \n # \n # Tue Dec 21 01:17:33 IST 2010, ramonrails\n # * verbal discussion with chirag. no ticket\n # * Make the caregiver \"active for senior\" when created from caregivers list\n # @user.options_for_senior( @senior, {:active => true}) # the latter syntax also works equally\n @user.options_attribute_for_senior( @senior, :active, true) # the former syntax also works equally\n \n @profile.user_id = @user.id\n @profile[:is_new_caregiver] = true\n if @profile.save!\n patient = User.find(params[:patient_id].to_i)\n # \n # Sat Dec 4 01:41:51 IST 2010, ramonrails\n # * use the easier and better method\n @user.is_caregiver_for( patient) # create the role if not already exists\n @user.options_for_senior( patient, { :position => params[:position] })\n # OBSOLETE: old technoque\n #\n # role = @user.has_role 'caregiver', patient\n # caregiver = @user\n # @roles_user = patient.roles_user_by_caregiver(caregiver)\n # update_from_position(params[:position], @roles_user.role_id, caregiver.id) unless @roles_user.blank?\n # unless role.blank? || @roles_user.blank?\n # # a few attributes were removed from the form. this was causing Exception and user data not saved\n # RolesUsersOption.create(:roles_user_id => @roles_user.id, :position => params[:position], :active => true) # ,:relationship => params[:relationship],:is_keyholder => params[:key_holder][:is_keyholder])\n # end\n redirect_to :controller => 'call_list',:action => 'show',:id => params[:patient_id]\n else\n render :action => 'new_caregiver_profile',:user_id => current_user\n # raise \"Invalid Profile\"\n end\n else\n render :action => 'new_caregiver_profile',:user_id => current_user\n # raise \"Invalid User\"\n end\n # redirect_to :controller => 'call_list',:action => 'show',:id => params[:patient_id]\n\n # rescue Exception => e\n # RAILS_DEFAULT_LOGGER.warn(\"ERROR signing up, #{e}\")\n # render :action => 'new_caregiver_profile'\n end\n end",
"title": ""
}
] |
[
{
"docid": "b29effc1dbbc52c623e184beb9360927",
"score": "0.5363124",
"text": "def date; end",
"title": ""
},
{
"docid": "b29effc1dbbc52c623e184beb9360927",
"score": "0.5363124",
"text": "def date; end",
"title": ""
},
{
"docid": "b29effc1dbbc52c623e184beb9360927",
"score": "0.5363124",
"text": "def date; end",
"title": ""
},
{
"docid": "b29effc1dbbc52c623e184beb9360927",
"score": "0.5363124",
"text": "def date; end",
"title": ""
},
{
"docid": "26f5702d8162cea97c8fec5db01103f6",
"score": "0.53582734",
"text": "def extendbyfourteendays\n updated_at = Time.now\n end",
"title": ""
},
{
"docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1",
"score": "0.5304607",
"text": "def private; end",
"title": ""
},
{
"docid": "3ec1ca9a50d2782524f8818e15b2748b",
"score": "0.52589375",
"text": "def pretty_created_at(clock=Time.now)\n a = (clock-self.created_at).to_i\n\n return 'just now' if a == 0\n return 'a second ago' if a == 1\n return a.to_s+' seconds ago' if a >= 2 && a <= 59\n return 'a minute ago' if a >= 60 && a <= 119 #120 = 2 minutes\n return (a/60).to_i.to_s+' minutes ago' if a >= 120 && a <= 3540\n return 'an hour ago' if a >= 3541 && a <= 7100 # 3600 = 1 hour\n return \"Today at#{self.created_at.strftime(\"%l:%M%p\")}\" if a >= 7101 && a <= 82800\n return \"Yesterday at#{self.created_at.strftime(\"%l:%M%p\")}\" if a >= 82801 && a <= 165600\n if clock.strftime(\"%A\") == \"Sunday\"\n return \"This #{self.created_at.strftime(\"%A\")} at #{self.created_at.strftime(\"%l:%M%p\")}\" if a >= 165601 && a <= 579600\n return \"#{self.created_at.strftime(\"%A %B %e\")} at #{self.created_at.strftime(\"%l:%M%p\")}\" if a >= 579601\n elsif clock.strftime(\"%A\") == \"Saturday\"\n return \"This #{self.created_at.strftime(\"%A\")} at#{self.created_at.strftime(\"%l:%M%p\")}\" if a >= 165601 && a <= 496800\n return \"#{self.created_at.strftime(\"%A %B %e\")} at#{self.created_at.strftime(\"%l:%M%p\")}\" if a >= 496801\n elsif clock.strftime(\"%A\") == \"Friday\"\n return \"This #{self.created_at.strftime(\"%A\")} at#{self.created_at.strftime(\"%l:%M%p\")}\" if a >= 165601 && a <= 414000\n return \"#{self.created_at.strftime(\"%A %B %e\")} at#{self.created_at.strftime(\"%l:%M%p\")}\" if a >= 414001\n elsif clock.strftime(\"%A\") == \"Thursday\"\n return \"This #{self.created_at.strftime(\"%A\")} at#{self.created_at.strftime(\"%l:%M%p\")}\" if a >= 165601 && a <= 331200\n return \"#{self.created_at.strftime(\"%A %B %e\")} at#{self.created_at.strftime(\"%l:%M%p\")}\" if a >= 331201\n elsif clock.strftime(\"%A\") == \"Wednesday\"\n return \"This #{self.created_at.strftime(\"%A\")} at#{self.created_at.strftime(\"%l:%M%p\")}\" if a >= 165601 && a <= 248400\n return \"#{self.created_at.strftime(\"%A %B %e\")} at#{self.created_at.strftime(\"%l:%M%p\")}\" if a >= 248401\n else\n return \"#{self.created_at.strftime(\"%A %B %e\")} at#{self.created_at.strftime(\"%l:%M%p\")}\" if a >= 165600\n end\n end",
"title": ""
},
{
"docid": "9d0ee356f46843f22f932f8f29002474",
"score": "0.5250314",
"text": "def timestamp; end",
"title": ""
},
{
"docid": "9d0ee356f46843f22f932f8f29002474",
"score": "0.5250314",
"text": "def timestamp; end",
"title": ""
},
{
"docid": "9d0ee356f46843f22f932f8f29002474",
"score": "0.5250314",
"text": "def timestamp; end",
"title": ""
},
{
"docid": "9d0ee356f46843f22f932f8f29002474",
"score": "0.5250314",
"text": "def timestamp; end",
"title": ""
},
{
"docid": "9d0ee356f46843f22f932f8f29002474",
"score": "0.5250314",
"text": "def timestamp; end",
"title": ""
},
{
"docid": "9d0ee356f46843f22f932f8f29002474",
"score": "0.5250314",
"text": "def timestamp; end",
"title": ""
},
{
"docid": "fa941eaf9a9b9bdfeeb70985886cf6d0",
"score": "0.52466035",
"text": "def view\n\n#READ a specific attribute from all entries (so, the attribute will be the argument)\n\n\n#method to show the day and date. Could this be the name that the user sees onscreen?\n\n #FINAL END\nend",
"title": ""
},
{
"docid": "a21b2e67f23bc8d0fed524807abab2fa",
"score": "0.5235159",
"text": "def creation_date=(_); end",
"title": ""
},
{
"docid": "65ffca17e416f77c52ce148aeafbd826",
"score": "0.51918423",
"text": "def schubert; end",
"title": ""
},
{
"docid": "0af4d88afefc7e5f41caf8eb05f43eda",
"score": "0.51485914",
"text": "def time_category\n # ActionController::Base.helpers.time_ago_in_words Groupify.groupify([self], Proc.new {|ep| ep.aired_at || ep.phile.file_created_at })[0][0]\n ActionController::Base.helpers.time_ago_in_words self.aired_at\n end",
"title": ""
},
{
"docid": "e16be4cd3690b2ec40635ff78c0b2e7a",
"score": "0.5134374",
"text": "def date() updated; end",
"title": ""
},
{
"docid": "ebaa706ded81cdaba7d8328abfb6e1cf",
"score": "0.5131126",
"text": "def created_at=(_arg0); end",
"title": ""
},
{
"docid": "cdd16ea92eae0350ca313fc870e10526",
"score": "0.5117106",
"text": "def who_we_are\r\n end",
"title": ""
},
{
"docid": "c99575ba731dc263efa6e79b9d0a4e15",
"score": "0.5113722",
"text": "def pro_rata_start_date\n # \n # Tue Nov 23 00:53:04 IST 2010, ramonrails\n # * we will never use \"installation_datetime\"\n # * installation_datetime is the \"desired\" installation datetime\n # * Pro-rata is charged from the date a panic button is received making user ready to install\n #\n # * check panic button press\n _date = panic_received_at\n # * no panic? check shipping date\n _date ||= (shipped_at + 7.days) unless shipped_at.blank? # if ( _date.blank? && !shipped_at.blank? )\n # * no panic or shipping? nothing returned\n # # \n # # Wed Mar 30 03:46:04 IST 2011, ramonrails\n # # * https://redmine.corp.halomonitor.com/issues/4253\n # # * pick local values that were copied\n # # * when missing?, pick from device_model_prices\n # unless (order.blank? || order.product_cost.blank? || _date.blank?)\n # _date += ( order.cc_monthly_recurring || order.product_cost.recurring_delay).to_i.months\n # end\n # # \n # # Tue May 24 20:07:41 IST 2011, ramonrails\n # # * https://redmine.corp.halomonitor.com/issues/4486\n # # * https://redmine.corp.halomonitor.com/attachments/3294/invalid_prorate_start_dates.jpg\n # _date ||= Date.today\n # _date = Date.today if _date > Date.today\n # \n # Thu May 26 19:32:15 IST 2011, ramonrails\n # * https://redmine.corp.halomonitor.com/issues/4486#note-47\n _date = _date.to_date unless _date.blank?\n _date\n end",
"title": ""
},
{
"docid": "48c4313939eaf90395676f048533e747",
"score": "0.5083704",
"text": "def date\n self.publicized_or_packaged || super\n end",
"title": ""
},
{
"docid": "48c4313939eaf90395676f048533e747",
"score": "0.5083704",
"text": "def date\n self.publicized_or_packaged || super\n end",
"title": ""
},
{
"docid": "125e1f2a8ff3cccf485024eafeff84c9",
"score": "0.50553375",
"text": "def all_day ; true ; end",
"title": ""
},
{
"docid": "1f188794535baaeb18f3c4dc49ee0c68",
"score": "0.5050371",
"text": "def w_day; end",
"title": ""
},
{
"docid": "2d775e07d066fa8784588baaa47e3c78",
"score": "0.5047042",
"text": "def date_formats\n now = Time.now\n [:to_date, :to_datetime, :to_time].each do |conv_meth|\n obj = now.send(conv_meth)\n puts obj.class.name\n puts \"=\" * obj.class.name.length\n name_and_fmts = obj.class::DATE_FORMATS.map { |k, v| [k, %Q('#{String === v ? v : '&proc'}')] }\n max_name_size = name_and_fmts.map { |k, _| k.to_s.length }.max + 2\n max_fmt_size = name_and_fmts.map { |_, v| v.length }.max + 1\n name_and_fmts.each do |format_name, format_str|\n puts sprintf(\"%#{max_name_size}s:%-#{max_fmt_size}s %s\", format_name, format_str, obj.to_s(format_name))\n end\n puts\n end\nend",
"title": ""
},
{
"docid": "ab755afc5ed6456abb95d0f4b37aab0f",
"score": "0.5026796",
"text": "def modification_date=(_); end",
"title": ""
},
{
"docid": "75994e35310a9b303aa9960759190077",
"score": "0.5019008",
"text": "def dates\n end",
"title": ""
},
{
"docid": "d2ab735fcf8f963fe4a4d3174950adb5",
"score": "0.49982077",
"text": "def created_at; end",
"title": ""
},
{
"docid": "3320dbe90194562b71bd89dea099a05d",
"score": "0.4993652",
"text": "def created_at; super; end",
"title": ""
},
{
"docid": "df1e8f5d7a0e45466263fe8ef2941310",
"score": "0.49804276",
"text": "def time_class; end",
"title": ""
},
{
"docid": "2233f48aef65e40314e26d1de54a293f",
"score": "0.49690843",
"text": "def listing_date() self.created_at.strftime('%a %b %d, %Y') end",
"title": ""
},
{
"docid": "0f9083e0fc0f8e68e417584f6fdd5177",
"score": "0.49595898",
"text": "def publish_date_and_explanation(errata)\n bold = errata.publish_date_explanation == 'custom'\n # This is very ugly, sorry! (fixme)\n html = ''\n html << '<div class=\"compact\">'\n html << '<b>' if bold\n html << [h(errata.publish_date_for_display),\"<small style='color:#888'>(#{errata.publish_date_explanation})</small>\"].compact.join('<br/>')\n html << '</b>' if bold\n html << '<br/>'\n html << \"<small>#{time_ago_future_or_past(errata.publish_or_ship_date_if_available)}</small>\" if errata.publish_or_ship_date_if_available\n html << '</div>'\n html.html_safe\n end",
"title": ""
},
{
"docid": "503e196ffd7c89d6193567873b3419be",
"score": "0.49566036",
"text": "def generated_on\n\t\t\n\tend",
"title": ""
},
{
"docid": "c92d3fe335583efab2a56bde59f0c8fc",
"score": "0.4936336",
"text": "def modification_date; end",
"title": ""
},
{
"docid": "83f2434f885d851fc27ba4fd2a3b4b43",
"score": "0.4933712",
"text": "def create_date(post)\n \" created at: \" + post.created_at.strftime(\"%d %b. %Y\") + \" - \" + post.created_at.strftime(\"%H:%M\") \n end",
"title": ""
},
{
"docid": "94a7d66f0406c4eb73c0e0cec1593d39",
"score": "0.4933611",
"text": "def bootstrap_datetime_format\n datetime = object.start ? object.start : DateTime.now\n datetime.strftime(\"%m/%d/%Y %l:%M %p\")\n end",
"title": ""
},
{
"docid": "991b6f12a63ef51664b84eb729f67eed",
"score": "0.49310985",
"text": "def formation; end",
"title": ""
},
{
"docid": "716b5b021733fe218de0a4aca3da4358",
"score": "0.49195006",
"text": "def human_event; end",
"title": ""
},
{
"docid": "0f006281ab647b5518e068e8a0af5d3b",
"score": "0.49117333",
"text": "def start_date\n @start_date ||= Date.today - Date.today.wday - 7 * 52\nend",
"title": ""
},
{
"docid": "eabe3efd0793e4af283269301f752a3d",
"score": "0.49097034",
"text": "def now; end",
"title": ""
},
{
"docid": "eabe3efd0793e4af283269301f752a3d",
"score": "0.49097034",
"text": "def now; end",
"title": ""
},
{
"docid": "ba8f75d96549662b9850bba8e54bbac2",
"score": "0.4903956",
"text": "def coming_soon\n end",
"title": ""
},
{
"docid": "ba8f75d96549662b9850bba8e54bbac2",
"score": "0.4903956",
"text": "def coming_soon\n end",
"title": ""
},
{
"docid": "5d63f58b944bfb262f1cb8b189f785e0",
"score": "0.4891632",
"text": "def more_advanced_date\n \tnil\n end",
"title": ""
},
{
"docid": "94e7897ac5abe9f7ba69f6d2b1cb80f0",
"score": "0.48826718",
"text": "def arrival_date; return \"\"; end",
"title": ""
},
{
"docid": "37bef51ed6c5d39277b92e8b468010bd",
"score": "0.48763043",
"text": "def interesting_date\n marked_as_fast_growing_at\n end",
"title": ""
},
{
"docid": "d2b919c14a14af5ce67e69dfc370fde5",
"score": "0.48740974",
"text": "def romeo_and_juliet; end",
"title": ""
},
{
"docid": "e47929fb5103b1b579eeeda94ce85ced",
"score": "0.48645437",
"text": "def human_date() # for Date object\n # return 'tomorrow' if tomorrow?\n # return 'today' if today?\n # return 'yesterday' if yesterday?\n # return \"HumanDateBoh(#{to_s})\" # TBD\n cool_date2()\n end",
"title": ""
},
{
"docid": "d88aeca0eb7d8aa34789deeabc5063cf",
"score": "0.48632595",
"text": "def offences_by; end",
"title": ""
},
{
"docid": "b92a0996519bd6ddb0de3d04d476fde9",
"score": "0.4862927",
"text": "def start_time; end",
"title": ""
},
{
"docid": "a02f7382c73eef08b14f38d122f7bdb9",
"score": "0.48612955",
"text": "def custom; end",
"title": ""
},
{
"docid": "a02f7382c73eef08b14f38d122f7bdb9",
"score": "0.48612955",
"text": "def custom; end",
"title": ""
},
{
"docid": "5971f871580b6a6e5171c35946a30c95",
"score": "0.48589754",
"text": "def stderrs; end",
"title": ""
},
{
"docid": "b85d10b8bcd7006d8fc80377a9e3fd06",
"score": "0.4851196",
"text": "def date_published_human\n date_published.strftime(\"on %B %d, %Y at %H:%M\")\n end",
"title": ""
},
{
"docid": "655efe972e091dd9e06772a79df356c0",
"score": "0.48448214",
"text": "def statement_to_date\n end",
"title": ""
},
{
"docid": "655efe972e091dd9e06772a79df356c0",
"score": "0.48448214",
"text": "def statement_to_date\n end",
"title": ""
},
{
"docid": "655efe972e091dd9e06772a79df356c0",
"score": "0.48448214",
"text": "def statement_to_date\n end",
"title": ""
},
{
"docid": "f1b5ab97eeecc51d77ccd8bafa053222",
"score": "0.48431468",
"text": "def check_dates\n if(self.d_publish.nil?) && (self.d_remove.nil?)\n self.d_remove = \"2094-03-25\"\n self.d_publish = Time.zone.today\n elsif(self.d_publish?)\n self.d_remove = \"2094-03-25\"\n elsif(self.d_remove?)\n self.d_publish = Time.zone.today\n end\n end",
"title": ""
},
{
"docid": "2b8546ebac55b2f2e16e77a2e31ae03f",
"score": "0.48422876",
"text": "def formats; end",
"title": ""
},
{
"docid": "2b8546ebac55b2f2e16e77a2e31ae03f",
"score": "0.48422876",
"text": "def formats; end",
"title": ""
},
{
"docid": "d0a663efda4c2c3a9d64b79a35310ccb",
"score": "0.48347074",
"text": "def GET_by_date raw_year, raw_month\n year = raw_year.to_i\n month = raw_month.to_i\n year += 2000 if year < 100\n month = 1 if month < 1\n case month\n when 1\n @prev_month = Time.utc(year - 1, 12)\n @next_month = Time.utc(year + 1, 2)\n when 12\n @prev_month = Time.utc(year, 11)\n @next_month = Time.utc(year, 1)\n else\n @prev_month = Time.utc(year, month-1)\n @next_month = Time.utc(year, month+1) \n end\n @date = Time.utc(year, month)\n @news = News.by_published_at(:descending=>true, :startkey=>@next_month, :endkey=>@prev_month)\n render_html_template\n end",
"title": ""
},
{
"docid": "c437e89e882057d4aff88b96d4be7445",
"score": "0.48315507",
"text": "def timeRecordsForDate(brick, date)\n end",
"title": ""
},
{
"docid": "1e623ba9f6877159df87f79b7237cd98",
"score": "0.48180658",
"text": "def publication_date\n end",
"title": ""
},
{
"docid": "f3637df508a4260108156ec8e7c29da3",
"score": "0.48141298",
"text": "def get_time_placed\n self.created_at.strftime(\"%m/%d/%Y at %l:%M%p\")\n end",
"title": ""
},
{
"docid": "1800afb7990c188712c4f964ed83d6a7",
"score": "0.48095074",
"text": "def get_updated_times\n @last_updated_time = Event.last_updated_datetime.to_s(:timepart)\n @last_updated_date = Event.last_updated_datetime.to_s(:listing_date)\n @last_updated_datetime = Event.last_updated_datetime\n end",
"title": ""
},
{
"docid": "5d528fbc5ef0e258a22bdcf0cca3e090",
"score": "0.4807651",
"text": "def add_dynamic_timestamp(text)\nend",
"title": ""
},
{
"docid": "253afcfb5bc144171b00682327288532",
"score": "0.480755",
"text": "def timestamp=(_arg0); end",
"title": ""
},
{
"docid": "253afcfb5bc144171b00682327288532",
"score": "0.480755",
"text": "def timestamp=(_arg0); end",
"title": ""
},
{
"docid": "253afcfb5bc144171b00682327288532",
"score": "0.480755",
"text": "def timestamp=(_arg0); end",
"title": ""
},
{
"docid": "253afcfb5bc144171b00682327288532",
"score": "0.480755",
"text": "def timestamp=(_arg0); end",
"title": ""
},
{
"docid": "e43c351ab5e942c121a02a6b2c401034",
"score": "0.4807341",
"text": "def posted_on\n \"Posted on \" + self.created_at.strftime(\"%A %m/%d/%Y\")\n end",
"title": ""
},
{
"docid": "5636273e868aeb434afccfe48b9a11fa",
"score": "0.48068357",
"text": "def published_conditions\r\n \"(#{table_name}.publish_at IS NULL OR #{table_name}.publish_at <= '#{Time.now.to_s(:db)}') AND (#{table_name}.unpublish_at IS NULL OR #{table_name}.unpublish_at > '#{Time.now.to_s(:db)}')\"\r\n end",
"title": ""
},
{
"docid": "e1070d4ae90f68c4b25c9ed52a9dda75",
"score": "0.4795936",
"text": "def time_to_show\n \n end",
"title": ""
},
{
"docid": "a2c1786d5f3ddb9f62763626841d2129",
"score": "0.47924492",
"text": "def convert_datetime_to_db_format_in_params(submitted_params, model, method_name)\n logger.debug \"==== CONVERTING DATE TIME ====\"\n show_params(submitted_params)\n date_field_name = method_name+'_date'\n time_field_name = method_name+'_time'\n\n\n timestamp_field = method_name\n\n logger.debug \"DEBUG: submitted_params[#{model}][#{date_field_name}]\"\n submitted_date_field = submitted_params[model][date_field_name]\n submitted_time_field = submitted_params[model][time_field_name]\n logger.debug \"DEBUG: Submitted date field: #{submitted_date_field}\"\n logger.debug \"DEBUG: Submitted time field: #{submitted_time_field}\"\n\n\n #Avoid nil fields and do nothing\n if !submitted_date_field.blank?# and submitted_time_field != nil\n #Try and parse the values entered\n begin\n \tsubmitted_time_field = Time.now.strftime('%H:%M') if submitted_time_field.blank?\n postgres_timestamp = date_time_to_db_format(submitted_date_field,submitted_time_field)\n logger.debug \"DEBUG: Postgres timestamp is #{postgres_timestamp}\"\n\n #And add a happy one for updating the date\n submitted_params[model][timestamp_field] = postgres_timestamp\n\n rescue\n #Throw a nice exception\n raise TimeParseException.new('The datestring \\\"'+submitted_date_field+\" \" +submitted_time_field+'\\\" was not parseable')\n end\n\n show_params(submitted_params)\n\n\n end\n\t#Remove the field names that active record wont like\n\tsubmitted_params[model].delete(date_field_name)\n\tsubmitted_params[model].delete(time_field_name)\n\n\tlogger.debug \"==== /CONVERTING DATE TIME ====\"\n\n\treturn submitted_params\n end",
"title": ""
},
{
"docid": "c63e3a692cac8267828b43d828d8ab22",
"score": "0.47833493",
"text": "def created_at # overwriting what this method returns\n object.created_at.strftime('%B %d, %Y') # Object represents the instance\n end",
"title": ""
},
{
"docid": "3592c9e2829ee9964b40a277a1c31231",
"score": "0.47826514",
"text": "def create_time(); @create_time; end",
"title": ""
},
{
"docid": "2383d9e52c9ae2173ab3615474251a61",
"score": "0.47814822",
"text": "def relative_date_and_time_format_for(datetime)\n result = ''\n result << datetime.strftime('%m/%e/%Y at %l:%M %p') # 1/16/2012 at 1:35 PM\n result << \" (#{time_ago_in_words(datetime)})\"\n end",
"title": ""
},
{
"docid": "0551b9a0d34edac4868d6ab71885c62e",
"score": "0.47797668",
"text": "def format_date_nicely(date)\nend",
"title": ""
},
{
"docid": "7fabcee7e6a4db0c79d052aac6a7987c",
"score": "0.47771415",
"text": "def date_of_application?(d)\n d[:date_applied] >= 15.days.ago.to_date\n #RIDICULOUSE BRAIN WARPING ONE! AHH!!!\n #what I'm really asking is April 24th less than April 15th on a plotted line from left to right? Nope! \n\nend",
"title": ""
},
{
"docid": "89c9c34ca5f7205adc8a4a0876a51c50",
"score": "0.47668937",
"text": "def get_date_scraped\n\n return Date.today.to_s\n\nend",
"title": ""
},
{
"docid": "89c9c34ca5f7205adc8a4a0876a51c50",
"score": "0.47668937",
"text": "def get_date_scraped\n\n return Date.today.to_s\n\nend",
"title": ""
},
{
"docid": "b67a532f583e35ab627f5e50480830c7",
"score": "0.47648275",
"text": "def update_model_with_params(model_obj)\n\n variable = own_time_zones\n \n if variable[current_customer.time_zone]\n hour_off_set = variable[current_customer.time_zone][0]\n mins_off_set = variable[current_customer.time_zone][1]\n offset = hour_off_set.hour + mins_off_set.minutes\n else\n Time.zone = current_customer.time_zone\n \n z = Time.zone.now.to_s\n hou = z[-5] + z[-4] + z[-3]\n min = z[0] + z[1]\n offset = min.to_i.minutes\n end\n \n update_params = params[:reminder_email]\n model_obj.time = DateTime.strptime(\"2009-09-10 #{ update_params['time(4i)'] }:#{ update_params['time(5i)'] }\", '%Y-%m-%d %H:%M').to_time - offset\n\n\n now_wday = DateTime.strptime(\"2009-09-10 #{ update_params['time(4i)'] }:#{ update_params['time(5i)'] }\", '%Y-%m-%d %H:%M').to_time.wday\n cur_wday = (DateTime.strptime(\"2009-09-10 #{ update_params['time(4i)'] }:#{ update_params['time(5i)'] }\", '%Y-%m-%d %H:%M').to_time - offset).wday\n\n \n if now_wday > cur_wday\n str_with_dates = update_params[:days_of_week_input].reject(&:blank?)\n str_with_dates = str_with_dates.map do |x|\n x = x.to_i - 1\n x = 6 if x < 0\n x\n end\n str_with_dates = str_with_dates.join(',')\n\n elsif now_wday < cur_wday\n str_with_dates = update_params[:days_of_week_input].reject(&:blank?)\n str_with_dates = str_with_dates.map do |x|\n x = x.to_i + 1\n x = 0 if x > 6\n x\n end\n str_with_dates = str_with_dates.join(',')\n \n else\n str_with_dates = update_params[:days_of_week_input].reject(&:blank?).join(',') \n end\n\n model_obj.days_of_week = str_with_dates\n\n model_obj\n end",
"title": ""
},
{
"docid": "b65091f7df4cbd5fd882f3225e61f156",
"score": "0.47635186",
"text": "def sub_wf_launched_at; h.sub_wf_launched_at; end",
"title": ""
},
{
"docid": "e51db4979afc41cfa69f2cd3f1edb8a8",
"score": "0.47619027",
"text": "def created; BoxesConsoleHelpers.simple_time(created_at) rescue \"nil\"; end",
"title": ""
},
{
"docid": "0b8b7b9666e4ed32bfd448198778e4e9",
"score": "0.4757824",
"text": "def probers; end",
"title": ""
},
{
"docid": "21a113ec668ad102fb3e2d659613325a",
"score": "0.47532076",
"text": "def wf_launched_at; h.wf_launched_at; end",
"title": ""
},
{
"docid": "42cb0aa0cae6987ceab1d2f9e5a1146d",
"score": "0.4751491",
"text": "def past_participle; end",
"title": ""
},
{
"docid": "8ed701f331a977cda5968e154d9e34f1",
"score": "0.47487372",
"text": "def enter_created; end",
"title": ""
},
{
"docid": "4918e6940414bfa39410749fa5ccc2a9",
"score": "0.473452",
"text": "def calc_content_updated_on\n time = created_on\n unless photos.empty? \n time = photos.last.created_on\n photos.each do |photo|\n unless photo.comments.empty?\n time = photo.comments.last.created_on if photo.comments.last.created_on > time\n end\n unless photo.likes.empty?\n time = photo.likes.last.created_on if photo.likes.last.created_on > time\n end\n end\n\n end\n invites.last.created_on > time ? invites.last.created_on : time\n end",
"title": ""
},
{
"docid": "b29b15eb516fd19bc829edf2b66332b5",
"score": "0.47318622",
"text": "def user_news_by_date\n end",
"title": ""
},
{
"docid": "57bb9107b63be4177f8252186008ca0e",
"score": "0.4728768",
"text": "def date_published\n created_at.strftime(\"%b %d, %Y\")\n end",
"title": ""
},
{
"docid": "cc0d3b0b40b6b96832ce55c8bd0f0c28",
"score": "0.47265714",
"text": "def default_ordered_on; 'published_at' end",
"title": ""
},
{
"docid": "af5764d9699d9c7467c642c8482fa621",
"score": "0.47211394",
"text": "def humanize_date(date)\n current = Date.today\n case\n when (3..6).include?(date.yday - current.yday)\n date.strftime(\"This %A\")\n when date.yday == (current.yday + 2)\n \"In two days\"\n when date.yday == (current.yday + 1)\n \"Tomorrow\"\n when date.yday == current.yday\n \"Today\"\n when date.yday == (current.yday - 1)\n \"Yesterday\"\n when date.yday == (current.yday - 2)\n \"Two days ago\"\n when (3..6).include?((current.yday - date.yday).abs)\n date.strftime(\"%A\")\n when date.year != current.year\n date.strftime(\"%m/%d/%Y\")\n when date.cweek == (current.cweek + 2)\n date.strftime(\"%A in two weeks\")\n when date.cweek == (current.cweek + 1)\n date.strftime(\"Next %A\")\n when date.cweek == (current.cweek - 1)\n date.strftime(\"Last %A\")\n when date.cweek == (current.cweek - 2)\n date.strftime(\"%A two weeks ago\")\n else\n date.strftime(\"%b %d\")\n end\n end",
"title": ""
},
{
"docid": "b5ffc258b31c8490c8b65dcb390f63b0",
"score": "0.47183263",
"text": "def customer_created; end",
"title": ""
},
{
"docid": "63e7c1e8644ed862e20f0a6d9a017b44",
"score": "0.47175062",
"text": "def list_events(calendar, how, month_to_view=false)\n puts \" Here are your events...(#{how})\"\n events = Event.where(calender_id: calendar.id).order('start_time')\n events.each_with_index do |event, index|\n begin\n case how\n when \"today\"\n if DateTime.now.to_date == event.start_time.to_date\n puts \" #{index+1}. #{event.name}\"\n end\n when \"week\"\n if DateTime.now.to_date <= event.start_time.to_date && event.start_time.to_date <= DateTime.now.to_date + 7.days\n puts \" #{index+1}. #{event.name}\"\n end\n when \"month\"\n if month_to_view\n if month_to_view == event.start_time.to_s[5..6]\n puts \" #{index+1}. #{event.name}\"\n end\n else\n if DateTime.now.to_s[5..6] == event.start_time.to_s[5..6]\n puts \" #{index+1}. #{event.name}\"\n end\n end\n else\n puts \" #{index+1}. #{event.name}\"\n end\n rescue\n error\n end\n end\nend",
"title": ""
},
{
"docid": "18e75099cbd495077c1a45908ee6171d",
"score": "0.47165453",
"text": "def do_before_save\n self.display_on = Date.today unless self.display_on\n end",
"title": ""
},
{
"docid": "175fcf3e66ca00e31fec7de37ff7d31c",
"score": "0.47068483",
"text": "def day=(_arg0); end",
"title": ""
},
{
"docid": "3979b8d898208d4bc3f1e09520e44445",
"score": "0.47065738",
"text": "def past; end",
"title": ""
},
{
"docid": "eee8a43d4a42593029d1415a29eeb024",
"score": "0.46989825",
"text": "def index\n if Date.valid_date? params[:year].to_i, params[:month].to_i, params[:day].to_i\n event_date = Date.parse(\"#{params[:year]}.#{params[:month]}.#{params[:day]}\")\n end\n unless event_date.nil?\n @events = Event.paginate(:page => params[:page],:per_page => 8).where(\"publish=true and date(start_at)=?\",event_date).order('start_at Desc')\n else\n @events = Event.paginate(:page => params[:page],:per_page =>8 ).where(\"publish=true \", params[:id]).order('start_at DESC')\n end\n end",
"title": ""
},
{
"docid": "17a9189fb8cb09da0fecb88d340fba80",
"score": "0.4697566",
"text": "def index\n @user = current_user\n @news_items = NewsItem.find(:all,:conditions=>\"created_at > '#{1.week.ago}'\", :order=>\"created_at desc\")\n @recent_tickets = Ticket.find(:all, :conditions=>\"status != 'closed' and status != 'resolved' and created_at > '#{5.days.ago}'\",:limit=>10)\n end",
"title": ""
}
] |
61c89fe86fa279e1cc341a74a40b358d
|
Deserializes the data based on type
|
[
{
"docid": "066e02b1b508e031c4498718d5f0b7af",
"score": "0.0",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n value\n when :Date\n value\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = ProtonApi.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
}
] |
[
{
"docid": "36a7ecd8f09e91284f3ff814815f745d",
"score": "0.8231654",
"text": "def deserialize(data, type = nil)\n serializer(type).deserialize(data)\n end",
"title": ""
},
{
"docid": "36a7ecd8f09e91284f3ff814815f745d",
"score": "0.8231654",
"text": "def deserialize(data, type = nil)\n serializer(type).deserialize(data)\n end",
"title": ""
},
{
"docid": "f5fd9871702eeb0e840a41b6d80471ce",
"score": "0.75629336",
"text": "def deserialize( data )\n self.class.deserialize( data )\n end",
"title": ""
},
{
"docid": "95dac5a8296c8335621e594db07e3817",
"score": "0.7477285",
"text": "def deserialize data\n Marshal.load data\n end",
"title": ""
},
{
"docid": "56463ee7882f841add10426ea6194705",
"score": "0.73643094",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = BackscatterIO.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "001ab617bba4cfc88b7c1bcb9e34cfa7",
"score": "0.7323302",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n InfluxDB2::API.const_get(type).build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "9487ff034d72699f5b43e1902cde6d39",
"score": "0.72826344",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = TelestreamCloud::Flip.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "9487ff034d72699f5b43e1902cde6d39",
"score": "0.72826344",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = TelestreamCloud::Flip.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "c2aebeba61fe74783e54da395db4e163",
"score": "0.7274019",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = FattureInCloud.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "3f8c980c677776776a53e110fe09f877",
"score": "0.72504056",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = IFClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "3f8c980c677776776a53e110fe09f877",
"score": "0.72504056",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = IFClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.72291344",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.72291344",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.72291344",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.72291344",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.72291344",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.72291344",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.72291344",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.72291344",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.72291344",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.72291344",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.72291344",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.72291344",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.72291344",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.72291344",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.72291344",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.72291344",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.72291344",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.72291344",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.72291344",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.72291344",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.72291344",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.72291344",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.72291344",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.72291344",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.72291344",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.72291344",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.72291344",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.72291344",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.72291344",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.72291344",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.72291344",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.72291344",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.72291344",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.72291344",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.72291344",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.72291344",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "0e9a331de50cc04991762af5699bf8b7",
"score": "0.7218884",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n DearInventoryRuby.const_get(type).build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "0e9a331de50cc04991762af5699bf8b7",
"score": "0.7218884",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n DearInventoryRuby.const_get(type).build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "0e9a331de50cc04991762af5699bf8b7",
"score": "0.7218884",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n DearInventoryRuby.const_get(type).build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "3036f4c83bf9024594868e4ae0dd7865",
"score": "0.7213926",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Mooncard.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "3036f4c83bf9024594868e4ae0dd7865",
"score": "0.7213926",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Mooncard.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "41d25697d9b90c8eaac76dc234ee36f7",
"score": "0.71925604",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = ColorMeShop.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "06217f9463cb409084e7ce7557a3525e",
"score": "0.7181113",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n (value)\n when :Date\n (value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = NucleusApi.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "45773370428c40dc36106f1fc283519d",
"score": "0.71796805",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Intrinio.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "45773370428c40dc36106f1fc283519d",
"score": "0.71796805",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Intrinio.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "45773370428c40dc36106f1fc283519d",
"score": "0.71796805",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Intrinio.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "45773370428c40dc36106f1fc283519d",
"score": "0.71796805",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Intrinio.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "45773370428c40dc36106f1fc283519d",
"score": "0.71796805",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Intrinio.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "45773370428c40dc36106f1fc283519d",
"score": "0.71796805",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Intrinio.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "45773370428c40dc36106f1fc283519d",
"score": "0.71796805",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Intrinio.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "919dafd3dedce1c5d6a16086a274d709",
"score": "0.71791923",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /^(true|t|yes|y|1)$/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Pier.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "919dafd3dedce1c5d6a16086a274d709",
"score": "0.71791923",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /^(true|t|yes|y|1)$/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Pier.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "919dafd3dedce1c5d6a16086a274d709",
"score": "0.71791923",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /^(true|t|yes|y|1)$/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Pier.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "919dafd3dedce1c5d6a16086a274d709",
"score": "0.71791923",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /^(true|t|yes|y|1)$/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Pier.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "919dafd3dedce1c5d6a16086a274d709",
"score": "0.71791923",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /^(true|t|yes|y|1)$/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Pier.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "919dafd3dedce1c5d6a16086a274d709",
"score": "0.71791923",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /^(true|t|yes|y|1)$/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Pier.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "919dafd3dedce1c5d6a16086a274d709",
"score": "0.71790355",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /^(true|t|yes|y|1)$/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Pier.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "bcc50d57ab1667af7285f5c62da0be5b",
"score": "0.71785265",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = Hubspot::Crm::Extensions::Accounting.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "2f3b5300aa69bf87b4ce18745ee69158",
"score": "0.7178339",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = ReliefWebAPI.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "cafa16826237c7c6cd554da2359c1c04",
"score": "0.71760035",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = JCAPIv1.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "f7399a64586ca76ee18a97535738006a",
"score": "0.71712995",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = CrelateClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "f7399a64586ca76ee18a97535738006a",
"score": "0.71712995",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = CrelateClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "f7399a64586ca76ee18a97535738006a",
"score": "0.71712995",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = CrelateClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "3e3c00a8309b42cbf9ec35f30ada53ac",
"score": "0.71674204",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = Hubspot::Cms::Domains.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "464701ff71f7c633f89d682db4651882",
"score": "0.71632504",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = WellsFargoAchClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "464701ff71f7c633f89d682db4651882",
"score": "0.71632504",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = WellsFargoAchClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "d262d1dd65381bf9fe16cc51d8b588d4",
"score": "0.71570754",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /^(true|t|yes|y|1)$/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = PaceFunding.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "2937c75236bbef7a41b887a8655e24a5",
"score": "0.71549904",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = ArtikCloud.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "4da1c9caef0d46acd87f4f1efa4bd842",
"score": "0.7154313",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n Radarbox.const_get(type).build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "4da1c9caef0d46acd87f4f1efa4bd842",
"score": "0.7154313",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n Radarbox.const_get(type).build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "3eef52a2bc84f756e79fa29ecaaa98b7",
"score": "0.7152904",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = RusticiSoftwareCloudV2.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "db6ede8a72980d81a84e5e3093c5b291",
"score": "0.71507627",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /^(true|t|yes|y|1)$/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = NfeClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "0816deffeb37c7c4df5acb55edb7449f",
"score": "0.7149659",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(parse_date(value))\n when :Date\n Date.parse(parse_date(value))\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BigDecimal\n BigDecimal(value.to_s)\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n XeroRuby::Finance.const_get(type).build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "0816deffeb37c7c4df5acb55edb7449f",
"score": "0.7149659",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(parse_date(value))\n when :Date\n Date.parse(parse_date(value))\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BigDecimal\n BigDecimal(value.to_s)\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n XeroRuby::Finance.const_get(type).build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "e0c33bea19e2a2d62a266ace7688cbd1",
"score": "0.7149319",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Zuora.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "7a8de1c49931c217b5ac5c548fa82b3c",
"score": "0.7146891",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = Hubspot::Cms::Blogs::Tags.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "d2f3388dbcb1f4c68a89f1c7546a9f3f",
"score": "0.7144633",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(parse_date(value))\n when :Date\n Date.parse(parse_date(value))\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BigDecimal\n BigDecimal(value.to_s)\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n XeroRuby::Accounting.const_get(type).build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "d2f3388dbcb1f4c68a89f1c7546a9f3f",
"score": "0.7144633",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(parse_date(value))\n when :Date\n Date.parse(parse_date(value))\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BigDecimal\n BigDecimal(value.to_s)\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n XeroRuby::Accounting.const_get(type).build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "d2f3388dbcb1f4c68a89f1c7546a9f3f",
"score": "0.7144633",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(parse_date(value))\n when :Date\n Date.parse(parse_date(value))\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BigDecimal\n BigDecimal(value.to_s)\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n XeroRuby::Accounting.const_get(type).build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "d2f3388dbcb1f4c68a89f1c7546a9f3f",
"score": "0.71444714",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(parse_date(value))\n when :Date\n Date.parse(parse_date(value))\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BigDecimal\n BigDecimal(value.to_s)\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n XeroRuby::Accounting.const_get(type).build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "b5be27a945d64a868f639a782fa8dae1",
"score": "0.71413666",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n MailSlurpClient.const_get(type).build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "b5be27a945d64a868f639a782fa8dae1",
"score": "0.71413666",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n MailSlurpClient.const_get(type).build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "c2526714311670c5b315dbed34cb359a",
"score": "0.7141116",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Esi.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ccb7ff760bcdebd1528420a816e34f7c",
"score": "0.71350193",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = ZenodoClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "47508d2bb1f32ccf495ab3b842da1934",
"score": "0.71346545",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = BombBomb.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "47508d2bb1f32ccf495ab3b842da1934",
"score": "0.71346545",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = BombBomb.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "47508d2bb1f32ccf495ab3b842da1934",
"score": "0.71346545",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = BombBomb.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "dfbee1680b3927a3066a25ab20bcca06",
"score": "0.7133874",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = Fastly.const_get(type)\n klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "dfbee1680b3927a3066a25ab20bcca06",
"score": "0.7133874",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = Fastly.const_get(type)\n klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "dfbee1680b3927a3066a25ab20bcca06",
"score": "0.7133874",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = Fastly.const_get(type)\n klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end",
"title": ""
}
] |
315373109b4331bc88b9f38688760ceb
|
Returns the value of the `display` attribute.
|
[
{
"docid": "40cada2e53dcaf8c629e510a3b1917c2",
"score": "0.7034402",
"text": "def display\n @display\n end",
"title": ""
}
] |
[
{
"docid": "ae027ea93cd05f397b1effc705590a0c",
"score": "0.89460725",
"text": "def display\n @attributes[:display]\n end",
"title": ""
},
{
"docid": "ae027ea93cd05f397b1effc705590a0c",
"score": "0.89460725",
"text": "def display\n @attributes[:display]\n end",
"title": ""
},
{
"docid": "c52dc7d061222534f6db1db7cec895cf",
"score": "0.7668982",
"text": "def display=(value)\n @display = value\n end",
"title": ""
},
{
"docid": "94b600ce1309a96a59534afe13efa709",
"score": "0.7400199",
"text": "def display\n to_h.fetch(:display)\n end",
"title": ""
},
{
"docid": "e7f51d531260bbf49c3d1fd1f60c0a31",
"score": "0.73589724",
"text": "def defines_display?(attribute)\n self.class.defines_display?( attribute )\n end",
"title": ""
},
{
"docid": "ef0f226c331d82c4e677017b018bb6bf",
"score": "0.73252964",
"text": "def defines_display?(attribute)\n return false if read_inheritable_attribute(:display).nil?\n read_inheritable_attribute(:display).has_key?( attribute.to_s.to_sym ).nil? ? false : true\n end",
"title": ""
},
{
"docid": "84581a61e7b206b9923691e4fd7a08ff",
"score": "0.7271618",
"text": "def display_name\n attributes[:display_name]\n end",
"title": ""
},
{
"docid": "d8d2094d17a671de0038c1fabbdcb48a",
"score": "0.7224243",
"text": "def display_name\n @attributes[:display_name]\n end",
"title": ""
},
{
"docid": "cb6877f49429bade7e446488f4c2bebb",
"score": "0.71959925",
"text": "def display\n to_h.fetch(:display)\n end",
"title": ""
},
{
"docid": "fcb2025827c799913c31e562adcd3ac2",
"score": "0.7126714",
"text": "def display_status\n @attributes[:display_status]\n end",
"title": ""
},
{
"docid": "de814479947b0f89681d924e9c0e124a",
"score": "0.70683277",
"text": "def display_as\n return @display_as\n end",
"title": ""
},
{
"docid": "558c0d2eec7cc078795bf561372d882e",
"score": "0.7056228",
"text": "def display_value()\n @value.to_s\n end",
"title": ""
},
{
"docid": "cc2f52954a4b955230a33bbf56c32b23",
"score": "0.69932246",
"text": "def display\n return \"#{@type} (#{@value})\"\n end",
"title": ""
},
{
"docid": "73186cb74db031965a44d25ce6ebd9a7",
"score": "0.6991548",
"text": "def display_name\n return @children['display-name'][:value]\n end",
"title": ""
},
{
"docid": "80843c1ebf41c9c9192e1a01484fc258",
"score": "0.69874245",
"text": "def display_name\n @data['display_name']\n end",
"title": ""
},
{
"docid": "60ee504ab52a0d562452a488189424af",
"score": "0.69767565",
"text": "def getDisplayFormat\r\n\t\t\t\t\treturn @displayFormat\r\n\t\t\t\tend",
"title": ""
},
{
"docid": "64e55a8cc54535abd8fc114a047197a4",
"score": "0.67620885",
"text": "def display_as=(value)\n @display_as = value\n end",
"title": ""
},
{
"docid": "8f456b1df25a52efe99d95a70552065b",
"score": "0.67532647",
"text": "def to_s\n @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.6751123",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
},
{
"docid": "4fb480c6458d4a1cc9a882721688c52f",
"score": "0.67506856",
"text": "def display_name\n return @display_name\n end",
"title": ""
}
] |
f7e687125f48f4ee3a9a0dfd809f97f1
|
Responds to `GET /units`
|
[
{
"docid": "b79eb4cc45de19af4424066eb9a4e669",
"score": "0.593217",
"text": "def index\n @units = Unit.search.\n institution(current_institution).\n include_children(false).\n order(\"#{Unit::IndexFields::TITLE}.sort\").\n limit(9999)\n end",
"title": ""
}
] |
[
{
"docid": "fc7c68e5bca78316e4acf7a60b0eb56f",
"score": "0.8063973",
"text": "def foods_units\n get('/foods/units.json')\n end",
"title": ""
},
{
"docid": "78d2ec54867c1fe4cc267fbdfd791a1f",
"score": "0.7458431",
"text": "def index\n response = HTTParty.get(\"https://casa-core.herokuapp.com/api/units\", :headers => { \"Authorization\" => AUTH, \"Host\" => HOST})\n @units = JSON.parse(response.body)\n return @units\n end",
"title": ""
},
{
"docid": "92ad51451b7e19af505a11f53a8fe14b",
"score": "0.7072488",
"text": "def units\n @units = Item.select(\"DISTINCT unit\").where(\"unit like ?\", \"%#{params[:q]}%\").limit(20).map(&:unit)\n @units += Detail.select(\"DISTINCT unit\").where(\"unit like ?\", \"%#{params[:q]}%\").limit(20).map(&:unit)\n @units = @units.uniq\n respond_to do |format|\n format.json { render json: @units }\n end\n end",
"title": ""
},
{
"docid": "ca0a64d8a7ad9cd5755a7620ebb6a9ad",
"score": "0.70169824",
"text": "def units(units=nil)\n cur_page.units(units)\n end",
"title": ""
},
{
"docid": "01957b462671a5d3aaae894b14c56f65",
"score": "0.6952454",
"text": "def units\n attribute('yweather:units')\n end",
"title": ""
},
{
"docid": "27977c62eda22bd5e8f0aaf74092fc2c",
"score": "0.6934599",
"text": "def units\n @formulation = (params[:formulation] || '').upcase\n drug = Drug.find_by_name(@formulation) rescue nil\n render plain: \"per dose\" and return unless drug && !drug.units.blank?\n render plain: drug.units\n end",
"title": ""
},
{
"docid": "95ef0b41152e3f1c82bb11470a862a90",
"score": "0.67839456",
"text": "def units\n return @units\n end",
"title": ""
},
{
"docid": "75a987569695db8fade783e61d631ffa",
"score": "0.6752639",
"text": "def units=(value)\n @units = value\n end",
"title": ""
},
{
"docid": "2de987180bb1c8079299048e7ec380b6",
"score": "0.67442524",
"text": "def get_units\n @agency, @depts = params[:agency], params[:dept]\n render :layout => false\n end",
"title": ""
},
{
"docid": "8d5d3ac47abc42f5d0f25abdaf849dba",
"score": "0.6635647",
"text": "def index\n @units = Unit.all\n end",
"title": ""
},
{
"docid": "8d5d3ac47abc42f5d0f25abdaf849dba",
"score": "0.6635647",
"text": "def index\n @units = Unit.all\n end",
"title": ""
},
{
"docid": "8d5d3ac47abc42f5d0f25abdaf849dba",
"score": "0.6635647",
"text": "def index\n @units = Unit.all\n end",
"title": ""
},
{
"docid": "8d5d3ac47abc42f5d0f25abdaf849dba",
"score": "0.6635647",
"text": "def index\n @units = Unit.all\n end",
"title": ""
},
{
"docid": "8d5d3ac47abc42f5d0f25abdaf849dba",
"score": "0.6635647",
"text": "def index\n @units = Unit.all\n end",
"title": ""
},
{
"docid": "8d5d3ac47abc42f5d0f25abdaf849dba",
"score": "0.6635647",
"text": "def index\n @units = Unit.all\n end",
"title": ""
},
{
"docid": "293d3bfbb2de3bcea14d2cd6ace94178",
"score": "0.66315114",
"text": "def show\n query = {\n 'id' => unit_params[:id]\n }\n response = HTTParty.get(\"https://casa-core.herokuapp.com/api/units/?id\", :query => query, :headers => { \"Authorization\" => AUTH, \"Host\" => HOST})\n\n if response.code == 200\n @unit = JSON.parse(response.body)\n else\n redirect_to unit_path(params[:id]), notice: 'Hmm...thats strange...try that again.'\n end\n end",
"title": ""
},
{
"docid": "f448dfc0e72a21f57dfff5de669db342",
"score": "0.65824956",
"text": "def unit_of_measurement_find_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UnitOfMeasurementApi.unit_of_measurement_find ...\"\n end\n # resource path\n local_var_path = \"/UnitsOfMeasurement\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\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<UnitOfMeasurement>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UnitOfMeasurementApi#unit_of_measurement_find\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "e8d3e1d1d5233e73884fc12ada3e2a73",
"score": "0.6518254",
"text": "def units\n @units = SQF.units @this\n @units\n end",
"title": ""
},
{
"docid": "fb237c768deb2b29e463b6ab26a44dbe",
"score": "0.64755017",
"text": "def units\n self.ListUnits.first.map { |u| map_unit(u) }\n end",
"title": ""
},
{
"docid": "aa17735f8a215988ca8472f5fe28b60e",
"score": "0.6430868",
"text": "def show\n @unit = Unit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unit }\n end\n end",
"title": ""
},
{
"docid": "aa17735f8a215988ca8472f5fe28b60e",
"score": "0.6430868",
"text": "def show\n @unit = Unit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unit }\n end\n end",
"title": ""
},
{
"docid": "aa17735f8a215988ca8472f5fe28b60e",
"score": "0.6430868",
"text": "def show\n @unit = Unit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unit }\n end\n end",
"title": ""
},
{
"docid": "43ef1b0316e9a10e7022af580728f70a",
"score": "0.6429036",
"text": "def index\n authorize Unit\n @units_version = Unit.version\n @units = Unit.all\n render\n end",
"title": ""
},
{
"docid": "fad924cbac65a4a9f7fa1357be1395d4",
"score": "0.6401748",
"text": "def show\n @unit = Unit.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unit }\n end\n end",
"title": ""
},
{
"docid": "c9a6c933f9705d8081a7cfb37e43d89c",
"score": "0.6371897",
"text": "def all_units\n services.map{|el| el[:units]} \n end",
"title": ""
},
{
"docid": "cdeb7faa49bd833f42e06c5f954216f3",
"score": "0.6355242",
"text": "def index\n @unit_type = UnitType.all\n\n respond_to do |format|\n format.json { render json: @unit_type }\n format.xml { render xml: @unit_type }\n end\n end",
"title": ""
},
{
"docid": "164cd675666d0fed2f702756e7af4e56",
"score": "0.6348768",
"text": "def user_units\n @user.units\n end",
"title": ""
},
{
"docid": "7a103293be91c6ee7a8d9cac0830323a",
"score": "0.633435",
"text": "def show\n @unit_of_measure = UnitOfMeasure.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unit_of_measure }\n end\n end",
"title": ""
},
{
"docid": "2b064baf8c7a671e1b0cd2a58d8cef3e",
"score": "0.63312167",
"text": "def index\n @units = if params[:order] == 'updated'\n Unit.order('updated_at ' + params[:updated_direction])\n elsif params[:order] == 'created'\n Unit.order('created_at ' + params[:created_direction])\n elsif params[:order] == 'note_updated'\n Unit.order('note_updated_at ' + params[:note_updated_direction])\n elsif params[:order] == 'first_name'\n Unit.joins(:resident).order('residents.first_name ' + params[:first_name_direction])\n elsif params[:order] == 'last_name'\n Unit.joins(:resident).order('residents.last_name ' + params[:last_name_direction])\n elsif params[:order] == 'name'\n Unit.order('name ' + params[:name_direction])\n elsif params[:order] == 'address'\n Kaminari.paginate_array(Address.joins(:street, :units).order(\"streets.name #{params[:address_direction]}\").order(\"addresses.street_number #{params[:address_direction]}\").map(&:units).flatten)\n else\n Unit.order('created_at desc')\n end.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @units }\n end\n end",
"title": ""
},
{
"docid": "74c93d89cf5cbe9297ae584326b6813f",
"score": "0.6298975",
"text": "def get_usage_rum_units_with_http_info(start_hr, opts = {})\n\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_rum_units ...'\n end\n # verify the required parameter 'start_hr' is set\n if @api_client.config.client_side_validation && start_hr.nil?\n fail ArgumentError, \"Missing the required parameter 'start_hr' when calling UsageMeteringAPI.get_usage_rum_units\"\n end\n # resource path\n local_var_path = '/api/v1/usage/rum'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'start_hr'] = start_hr\n query_params[:'end_hr'] = opts[:'end_hr'] if !opts[:'end_hr'].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;datetime-format=rfc3339'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'UsageRumUnitsResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]\n\n new_options = opts.merge(\n :operation => :get_usage_rum_units,\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 :api_version => \"V1\"\n )\n\n data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UsageMeteringAPI#get_usage_rum_units\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "f83ed69d8178d7b9bb7ae536dc7a0a52",
"score": "0.6283334",
"text": "def unit_of_measurement_count_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UnitOfMeasurementApi.unit_of_measurement_count ...\"\n end\n # resource path\n local_var_path = \"/UnitsOfMeasurement/count\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil?\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\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 => 'InlineResponse200')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UnitOfMeasurementApi#unit_of_measurement_count\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "46f1af66319cd704b4a16e94f0fad00c",
"score": "0.6243082",
"text": "def show\n @item_unit = ItemUnit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item_unit }\n end\n end",
"title": ""
},
{
"docid": "538ffe3cdba533ed367ee554387afcbc",
"score": "0.62374437",
"text": "def transfer_unit\n if !params[:ic_number].nil?\n user = User.find_by_ic_number(params[:ic_number])\n departments = user.units.active.collect(&:name)\n render :json=>[departments] if departments\n end\n end",
"title": ""
},
{
"docid": "5d4fbef90a28271426f8ce973a235567",
"score": "0.61533046",
"text": "def index\n @quantity_units = QuantityUnit.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @quantity_units }\n end\n end",
"title": ""
},
{
"docid": "ce4cad4095be35dc2288c9352e24dc0b",
"score": "0.61511344",
"text": "def units _args\n \"units _args;\" \n end",
"title": ""
},
{
"docid": "50ab07f1af75dafa980f6b6612460752",
"score": "0.6146453",
"text": "def show\n @extent_unit = ExtentUnit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @extent_unit }\n end\n end",
"title": ""
},
{
"docid": "d88ebf89c7988241228045155b4c3e07",
"score": "0.61211956",
"text": "def index\n @base_units = BaseUnit.all\n end",
"title": ""
},
{
"docid": "dd31438bee2543f62591db37a6bd8fae",
"score": "0.6121107",
"text": "def index\n hash = cookies[:city_hash]\n @city = City.find_by(city_hash: hash)\n @units = @city.units\n\n render json: @units, status: :ok\n end",
"title": ""
},
{
"docid": "0327117108c851eac97dbbd1c35c443a",
"score": "0.6115194",
"text": "def index\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @account_units }\n end\n end",
"title": ""
},
{
"docid": "45981fa3f7d04174aec4a68cf922fd40",
"score": "0.609838",
"text": "def allowed_units\n @converter.list_units(true)\n end",
"title": ""
},
{
"docid": "38ccf3e2bf59b04bfd534966e56bf6a3",
"score": "0.6095478",
"text": "def units\n\t\tret = []\n\t\t@db.smembers('sgt-structure:' + @id + ':units').each do |uid|\n\t\t\tret.push(getUnit(@db, uid))\n\t\tend\n\t\tret\n\tend",
"title": ""
},
{
"docid": "efc42d688358933a83925baaf3e5c839",
"score": "0.6094792",
"text": "def show\n @unit_type = UnitType.find(params[:id])\n respond_to do |format|\n format.json { render json: @unit_type }\n format.xml { render xml: @unit_type }\n end\n end",
"title": ""
},
{
"docid": "351d174e40356a0a93378aa13093f7d2",
"score": "0.6087439",
"text": "def index\n @german_units = GermanUnit.all\n end",
"title": ""
},
{
"docid": "98bbd50a94f435e85bbd48c1200087f4",
"score": "0.60818994",
"text": "def emission_units\n data['emission_units']\n end",
"title": ""
},
{
"docid": "8f1aeb83f9b2929702b6940976c6e3e1",
"score": "0.60730183",
"text": "def get_upgrade_units_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UpgradeApi.get_upgrade_units ...\"\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 UpgradeApi.get_upgrade_units, 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 UpgradeApi.get_upgrade_units, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = \"/upgrade/upgrade-units\"\n\n # query parameters\n query_params = {}\n query_params[:'component_type'] = opts[:'component_type'] if !opts[:'component_type'].nil?\n query_params[:'current_version'] = opts[:'current_version'] if !opts[:'current_version'].nil?\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'group_id'] = opts[:'group_id'] if !opts[:'group_id'].nil?\n query_params[:'has_warnings'] = opts[:'has_warnings'] if !opts[:'has_warnings'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'metadata'] = opts[:'metadata'] if !opts[:'metadata'].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 query_params[:'upgrade_unit_type'] = opts[:'upgrade_unit_type'] if !opts[:'upgrade_unit_type'].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 => 'UpgradeUnitListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UpgradeApi#get_upgrade_units\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "5e830aa445086024db731b4287c19fba",
"score": "0.6057462",
"text": "def show\n @resource = Resource.find(params[:resource_id])\n @incident = Incident.find(@resource.incident_id)\n @demob = Demob.find(params[:id])\n @logistics_units = @demob.units[0..5]\n @finance_units = @demob.units[6..8]\n @other_units = @demob.units[9..10]\n @plans_units = @demob.units[11..13]\n end",
"title": ""
},
{
"docid": "4e76c7979bd592421218b14502f43c96",
"score": "0.60556465",
"text": "def find_units(modids)\n # TODO: Rename unit_search?\n units = connection.get(connection.build_url(\"units/search\", :modids => modids)).body\n units.map!{|hash| hash.values.first}\n units.each{|u| u.extend UnitMethods; u._cloud_connect = self;}\n end",
"title": ""
},
{
"docid": "2328f0ce59a2483d9edc84ad79296f19",
"score": "0.60411674",
"text": "def total_units\n return @total_units\n end",
"title": ""
},
{
"docid": "3f7c9eb5930664cf14ca6a482e9a6fa5",
"score": "0.603903",
"text": "def show\n @unit = Unit.find(params[:id])\n @item = Item.find(@unit.item_id)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unit }\n end\n end",
"title": ""
},
{
"docid": "5860b65b6b5da402ab5432bda1cdbe56",
"score": "0.6035025",
"text": "def available_units\n return 0 if status == NO_SPACE\n\n 999\n end",
"title": ""
},
{
"docid": "4cab6f70c27b6726e6959039fd763f4e",
"score": "0.60230744",
"text": "def total_units=(value)\n @total_units = value\n end",
"title": ""
},
{
"docid": "572bcbead72d310403a187e3d445438e",
"score": "0.6015415",
"text": "def index\n @units = @gang.units.order( :id )\n @can_add_units = can_add_units\n end",
"title": ""
},
{
"docid": "013261cd91e8865e031a9ba0732b7662",
"score": "0.6005992",
"text": "def unit(unit_id=nil, opts = {})\n units = connection.get(connection.build_url(\"units\", opts.merge(:unitids => unit_id))).body\n units.map!{|hash| hash.values.first}\n units.each{|u| u.extend UnitMethods; u._cloud_connect = self;}\n units.first\n end",
"title": ""
},
{
"docid": "4e71a01be061169a240ebbc41756bb68",
"score": "0.6002545",
"text": "def index\n @display_units = DisplayUnit.all\n end",
"title": ""
},
{
"docid": "b55d65fa135dc6b68ec665cb8a31914c",
"score": "0.59978956",
"text": "def show\n @units = @commercial_lead.units\n end",
"title": ""
},
{
"docid": "2e2ff98d95497b3e83d3b08aab183751",
"score": "0.59935415",
"text": "def single_usage\r\n meter = get_meters[3]\r\n date_ranges = get_date_ranges\r\n dtps = Meter.get_daily_time_periods [meter]\r\n\r\n# usage = meter.usage_by_meter(date_ranges, dtps)\r\n# usage = meter.usage_by_time(date_ranges, dtps)\r\n usage = meter.detailed_usage_by_meter(date_ranges, dtps)\r\n# usage = meter.detailed_usage_by_time(date_ranges, dtps)\r\n\r\n render :json => usage\r\n\r\n# redirect_to action: 'index'\r\n end",
"title": ""
},
{
"docid": "919a1e96e91732a388467a7a1feef6c7",
"score": "0.59899896",
"text": "def units\n q = \"select distinct unit_id from master_files m inner join master_file_locations l on l.master_file_id=m.id\"\n q << \" where location_id = #{id}\"\n return Location.connection.query(q).flatten\n end",
"title": ""
},
{
"docid": "bdb6dfc5806cce330f50d391a4d08dcd",
"score": "0.59632427",
"text": "def index\n @org_units = OrgUnit.all\n end",
"title": ""
},
{
"docid": "9bf042eab798f493cd801958ffdc84ce",
"score": "0.59512097",
"text": "def index\n @standard_units = StandardUnit.all\n end",
"title": ""
},
{
"docid": "8eceabb8330f5f05a58c1c487d11f8cd",
"score": "0.5949552",
"text": "def unit_mappings\n {\n ApiUnitSystem.US => { :duration => \"milliseconds\", :distance => \"miles\", :elevation => \"feet\", :height => \"inches\", :weight => \"pounds\", :measurements => \"inches\", :liquids => \"fl oz\", :blood_glucose => \"mg/dL\" },\n ApiUnitSystem.UK => { :duration => \"milliseconds\", :distance => \"kilometers\", :elevation => \"meters\", :height => \"centimeters\", :weight => \"stone\", :measurements => \"centimeters\", :liquids => \"mL\", :blood_glucose => \"mmol/l\" },\n ApiUnitSystem.METRIC => { :duration => \"milliseconds\", :distance => \"kilometers\", :elevation => \"meters\", :height => \"centimeters\", :weight => \"kilograms\", :measurements => \"centimeters\", :liquids => \"mL\", :blood_glucose => \"mmol/l\" }\n }\n end",
"title": ""
},
{
"docid": "8330239346eb17e8088d5d5de030830b",
"score": "0.59389895",
"text": "def get_measurements\n render json: @data_source.measurements\n end",
"title": ""
},
{
"docid": "4774747f8a1926b6ddba30175a3ce843",
"score": "0.59231174",
"text": "def unit\n return @units[@index]\n end",
"title": ""
},
{
"docid": "4774747f8a1926b6ddba30175a3ce843",
"score": "0.59231174",
"text": "def unit\n return @units[@index]\n end",
"title": ""
},
{
"docid": "1739b997b95e9fc1a4c167ab6b106423",
"score": "0.5922607",
"text": "def show\n @unit = Unit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @unit }\n end\n end",
"title": ""
},
{
"docid": "c1f1edd5eeafc52d516e25d05856e0e0",
"score": "0.5921192",
"text": "def getTotal\n total = 0\n $details.each do |detail|\n total+=(detail.unit_price * detail.amount)\n end\n respond_to do |format|\n format.html \n format.json { render json: total.to_i}\n end\n end",
"title": ""
},
{
"docid": "d82deb35b76b96b37e461ba3574869e7",
"score": "0.59195983",
"text": "def getuom\n @deliverable_type = DeliverableType.find(params[:id])\n respond_to do |format|\n format.json { render :json => @deliverable_type.uom}\n end\n end",
"title": ""
},
{
"docid": "58347f0725f41b1125cc584c30841517",
"score": "0.5895654",
"text": "def index\n @army_units = ArmyUnit.all\n end",
"title": ""
},
{
"docid": "2624e1f7b1d27a5ce01e374e1bdf03eb",
"score": "0.58942527",
"text": "def index\n @unit_measures = UnitMeasure.all\n end",
"title": ""
},
{
"docid": "17f289db099cb31fbea43ee057c520d5",
"score": "0.5875454",
"text": "def report_unit_statuses\n u_times = Unit.all.map do |u|\n { :id => u.id, :state => u.state, :duration => u.duration, :time_available => u.time_available }\n end\n respond_to do |format|\n format.html { render nothing: true }\n format.js { respond_with(u_times) }\n end\n end",
"title": ""
},
{
"docid": "c11eb20386bb7ee3aea431ed456a82cb",
"score": "0.5873903",
"text": "def index\n @police_units = PoliceUnit.all\n end",
"title": ""
},
{
"docid": "5cdb25dd4fec1ac4b472d2edadd361c2",
"score": "0.5873652",
"text": "def units(*list)\n @units.concat(makelist(list)) unless list.empty?\n @units\n end",
"title": ""
},
{
"docid": "c91b776a2371455d98572d9c0d7ec180",
"score": "0.586498",
"text": "def set_Units(value)\n set_input(\"Units\", value)\n end",
"title": ""
},
{
"docid": "c91b776a2371455d98572d9c0d7ec180",
"score": "0.586498",
"text": "def set_Units(value)\n set_input(\"Units\", value)\n end",
"title": ""
},
{
"docid": "cac4d5d31faf45ccfbe86a7fb44688cc",
"score": "0.58488816",
"text": "def index\n @handbook_structual_units = HandbookStructualUnit.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @handbook_structual_units }\n end\n end",
"title": ""
},
{
"docid": "86f2204ce73e945db5ed995fc9115098",
"score": "0.5848861",
"text": "def unit_of_measurement_find_one_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UnitOfMeasurementApi.unit_of_measurement_find_one ...\"\n end\n # resource path\n local_var_path = \"/UnitsOfMeasurement/findOne\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\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 => 'UnitOfMeasurement')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UnitOfMeasurementApi#unit_of_measurement_find_one\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "a602ba28e68d7833f336dda31984f892",
"score": "0.58292645",
"text": "def show\n @quantity_unit = QuantityUnit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @quantity_unit }\n end\n end",
"title": ""
},
{
"docid": "f84e2e029953d497d72389a3f40fd856",
"score": "0.582847",
"text": "def getTotalIva10\n total = 0\n $details.each do |detail|\n total+=(detail.unit_price / 10)\n end\n respond_to do |format|\n format.html \n format.json { render json: total.to_i}\n end\n end",
"title": ""
},
{
"docid": "f333161727f687d2f23b81b7c0d4ab48",
"score": "0.58279806",
"text": "def show\n @retail_unit = RetailUnit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @retail_unit }\n end\n end",
"title": ""
},
{
"docid": "e1654eed53358cf27df4bbd208526bca",
"score": "0.5813083",
"text": "def get_units(dimension)\n nil\n end",
"title": ""
},
{
"docid": "2b6251e5eeb1d443398b83c2c51f8793",
"score": "0.58025074",
"text": "def index\n @storage_units = StorageUnit.all\n end",
"title": ""
},
{
"docid": "98809f5e2e4a5a48145e8298212ed469",
"score": "0.5797837",
"text": "def index\n @breadcrumbs = [[t(:units)]]\n @units = @units.order(:name).page(params[:page])\n end",
"title": ""
},
{
"docid": "dca29664b9a55954351e407097942d15",
"score": "0.5796935",
"text": "def show\n @electoral_unit = ElectoralUnit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @electoral_unit }\n end\n end",
"title": ""
},
{
"docid": "2acfd4a0a6163bda3b3e976520785950",
"score": "0.5780908",
"text": "def playableUnits \n \"playableUnits\" \n end",
"title": ""
},
{
"docid": "72d4f7dd1317bb2719311d231e325030",
"score": "0.57780313",
"text": "def index\n @study_units = StudyUnit.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @study_units }\n end\n end",
"title": ""
},
{
"docid": "8fb8341f80d1b58ddbc67b9fcc624404",
"score": "0.5764298",
"text": "def archival_units\n init_au_states(:all)\n # @collections = @archive.collections_filter_by_states(@states); \n @archival_units = @archive.archival_units_filter_by_states(@states); \n respond_to do |format|\n format.html { @archival_units = @archival_units} \n format.json { render :json=> @archival_units }\n format.xml { render :xml => ArchivalUnit.to_xml(:au_list => @archival_units, :skip_instruct => true) }\n end\n end",
"title": ""
},
{
"docid": "54243dd4f099f128ffe8793d7ef2e41f",
"score": "0.5762103",
"text": "def index\n @order_units = OrderUnit.all\n end",
"title": ""
},
{
"docid": "35c52da3d77eadc3c9625d4a81b2980b",
"score": "0.57596654",
"text": "def archival_units\n init_au_states(:all);\n @archival_units = @content_provider.archival_units_filter_by_states(@states)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json=> @archival_units }\n format.xml { render :xml => ArchivalUnit.to_xml(:au_list => @archival_units, :skip_instruct => true) }\n end\n end",
"title": ""
},
{
"docid": "c753345390acead5b61f84421708ae7c",
"score": "0.57591885",
"text": "def units=(list)\n @units = makelist(list)\n end",
"title": ""
},
{
"docid": "f4a254ebe51f344f049baf03664b524a",
"score": "0.5758864",
"text": "def world_totals\n json_response('/totals')\n end",
"title": ""
},
{
"docid": "0b1d7744bf03fad536408f2a30989e11",
"score": "0.57532173",
"text": "def node_helper_to_units(path: 'status', type:, value: 'used', output_msg:, unit: 'gb', perf_label: 'Usage')\n http_connect(path: \"api2/json/nodes/#{@options[:node]}/#{path}\")\n data = JSON.parse(@response.body)['data'][type][value]\n convert_bytes_to_unit(data: data, unit: unit)\n build_output(msg: \"#{output_msg}: #{@usage}#{unit.upcase}\")\n build_perfdata(perfdata: \"#{perf_label}=#{@usage}#{unit.upcase}\")\n check_thresholds(data: @usage)\n end",
"title": ""
},
{
"docid": "afd1e4c250f2b8e29bcb6dcff8a818bf",
"score": "0.57512534",
"text": "def get_upgrade_units_stats_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UpgradeApi.get_upgrade_units_stats ...\"\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 UpgradeApi.get_upgrade_units_stats, 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 UpgradeApi.get_upgrade_units_stats, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = \"/upgrade/upgrade-units-stats\"\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n query_params[:'sync'] = opts[:'sync'] if !opts[:'sync'].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 => 'UpgradeUnitTypeStatsList')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UpgradeApi#get_upgrade_units_stats\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "c8f4ddf0cc8a2fd841babcb52aded23d",
"score": "0.57426745",
"text": "def index\n @rent_units = RentUnit.all\n end",
"title": ""
},
{
"docid": "88e640f77b0968841faa0c5b58d7b4df",
"score": "0.573528",
"text": "def index\n @usages = get_usages\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @usages }\n end\n end",
"title": ""
},
{
"docid": "e4e1c677874dd8184c5d5a37273c5e33",
"score": "0.5735138",
"text": "def index\n @quotation_units = QuotationUnit.all\n end",
"title": ""
},
{
"docid": "4522cf8448c0d86dd1697fdbb6d7ec22",
"score": "0.5709878",
"text": "def stats\n request :get, \"_stats\"\n end",
"title": ""
},
{
"docid": "4522cf8448c0d86dd1697fdbb6d7ec22",
"score": "0.5709878",
"text": "def stats\n request :get, \"_stats\"\n end",
"title": ""
},
{
"docid": "d144603e6f3c737c7e1cee9b2167ad48",
"score": "0.57004577",
"text": "def update\n params.require(%i[id units])\n retrieve_and_validate_put.update!(units: params[:units])\n head :no_content\n end",
"title": ""
},
{
"docid": "83a92316b002fdc9bbfc95b0ea2a2fb9",
"score": "0.56954944",
"text": "def index\n get_data\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @unit_of_measures }\n format.js\n end\n end",
"title": ""
},
{
"docid": "b7bed0e7968c37d3c3bea7a39d4cd38b",
"score": "0.56825286",
"text": "def unit_params\n params.fetch(:unit, {})\n end",
"title": ""
},
{
"docid": "e704647536d66557b3288f0ff8c0e279",
"score": "0.5677658",
"text": "def show\n @log_unit = LogUnit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @log_unit }\n end\n end",
"title": ""
}
] |
7bf0429c4fec1cedee83ee268e3f479d
|
POST /awards POST /awards.json
|
[
{
"docid": "6e1233bdb98d9a17cb1bffb072537add",
"score": "0.6204529",
"text": "def create\n @award = Award.new(award_params)\n\n respond_to do |format|\n if @award.save\n format.js { render json: @award }\n else\n format.js { render json: { error: @award.errors } }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "a63a937795bdb94343290d5157dcf5f6",
"score": "0.6676492",
"text": "def create\n @award = Award.new(params[:award])\n\n respond_to do |format|\n if @award.save\n format.html { redirect_to @award, notice: 'Award was successfully created.' }\n format.json { render json: @award, status: :created, location: @award }\n else\n format.html { render action: \"new\" }\n format.json { render json: @award.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6ad0ed93b84b4ea95c132695429801c7",
"score": "0.6608625",
"text": "def create\n @award = @student.awards.build(params[:award])\n # was @award = Award.new(params[:award])\n\n respond_to do |format|\n if @award.save\n format.html { redirect_to student_awards_url(@student), notice:\n 'Award was successfully created.' }\n # was redirect_to(@award)\n format.json { render json: @award, status: :created, location: @award }\n else\n format.html { render action: \"new\" }\n format.json { render json: @award.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3c4af8aa19ca4527da66ebf2c049cd31",
"score": "0.6541227",
"text": "def create\n @award = Award.new(award_params)\n\n respond_to do |format|\n if @award.save\n format.html { redirect_to @award, notice: 'Award was successfully created.' }\n format.json { render :show, status: :created, location: @award }\n else\n format.html { render :new }\n format.json { render json: @award.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3c4af8aa19ca4527da66ebf2c049cd31",
"score": "0.6541227",
"text": "def create\n @award = Award.new(award_params)\n\n respond_to do |format|\n if @award.save\n format.html { redirect_to @award, notice: 'Award was successfully created.' }\n format.json { render :show, status: :created, location: @award }\n else\n format.html { render :new }\n format.json { render json: @award.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3c4af8aa19ca4527da66ebf2c049cd31",
"score": "0.6541227",
"text": "def create\n @award = Award.new(award_params)\n\n respond_to do |format|\n if @award.save\n format.html { redirect_to @award, notice: 'Award was successfully created.' }\n format.json { render :show, status: :created, location: @award }\n else\n format.html { render :new }\n format.json { render json: @award.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c7aa99fe72c5631355575485a41ca0cc",
"score": "0.6508849",
"text": "def create\n @award = Award.new(award_params)\n\n if @award.save\n flash[:success] = \"Award successfully created\"\n redirect_to action: \"index\"\n else\n @awards = Award.all\n render 'new', locals: {award: @award, awards:@awards}\n end\n end",
"title": ""
},
{
"docid": "93a25bfc50c5b540c378c6f04973c72d",
"score": "0.64628565",
"text": "def create\n @awards_ceremony = AwardsCeremony.new(awards_ceremony_params)\n\n respond_to do |format|\n if @awards_ceremony.save\n format.html { redirect_to @awards_ceremony, notice: 'Awards ceremony was successfully created.' }\n format.json { render :show, status: :created, location: @awards_ceremony }\n else\n format.html { render :new }\n format.json { render json: @awards_ceremony.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f177aaf97dd482dd00839ea15e4c70e4",
"score": "0.63428736",
"text": "def index\n @awards = Award.all\n @award = Award.new\n end",
"title": ""
},
{
"docid": "8101e0925491547e3f12ee0120686aef",
"score": "0.6303547",
"text": "def create\n @player_award = PlayerAward.new(params[:player_award])\n\n respond_to do |format|\n if @player_award.save\n format.html { redirect_to @player_award, notice: 'Player award was successfully created.' }\n format.json { render json: @player_award, status: :created, location: @player_award }\n else\n format.html { render action: \"new\" }\n format.json { render json: @player_award.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "19291d7fac816589aaf56b0be0ecbe2c",
"score": "0.6296384",
"text": "def create\n @user_award = UserAward.new(user_award_params)\n\n respond_to do |format|\n if @user_award.save\n format.html { redirect_to @user_award, notice: \"User award was successfully created.\" }\n format.json { render :show, status: :created, location: @user_award }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @user_award.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "968447184806129b1297e534327bf730",
"score": "0.62239486",
"text": "def new\n @student = Student.find(params[:student_id])\n @award = @student.awards.build\n # was @award = Award.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @award }\n end\n end",
"title": ""
},
{
"docid": "adc2ab53550774425a06028a43182295",
"score": "0.6204801",
"text": "def create\n @game_award = GameAward.new(game_award_params)\n\n respond_to do |format|\n if @game_award.save\n format.html { redirect_to @game_award, notice: 'Game award was successfully created.' }\n format.json { render :show, status: :created, location: @game_award }\n else\n format.html { render :new }\n format.json { render json: @game_award.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d85719890e8fe4a9f52f9b36040aa709",
"score": "0.61956745",
"text": "def award_params\n params.require(:award).permit(:name, :description, :points, :type)\n end",
"title": ""
},
{
"docid": "36bd600819b0ff8a386b7756766ca48e",
"score": "0.6144959",
"text": "def award_params\n params.require(:award).permit(:name, :employee_id, :gift_item, :cash_price, :month, :year)\n end",
"title": ""
},
{
"docid": "a29d1ef48d943bafe6c456edf06e991f",
"score": "0.6144088",
"text": "def index\n @awards = @student.awards\n # was @awards = Award.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @awards }\n end\n end",
"title": ""
},
{
"docid": "4e442a9e88fb7711daeeb85393bbf318",
"score": "0.6119187",
"text": "def create\n @award = Award.new(params[:award])\n\n respond_to do |format|\n if @award.save\n flash[:notice] = 'Award was successfully created.'\n format.html { redirect_to awards_path }\n format.xml { render :xml => @award, :status => :created, :location => @award }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @award.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "034f1e043c484540d3346f646b4d6da4",
"score": "0.6096593",
"text": "def create\n @person_award = PersonAward.new(params[:person_award])\n\n respond_to do |format|\n if @person_award.save\n format.html { redirect_to @person_award, notice: 'Person award was successfully created.' }\n format.json { render json: @person_award, status: :created, location: @person_award }\n else\n format.html { render action: \"new\" }\n format.json { render json: @person_award.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "93c0b81dc81746444c24992f5a95abe4",
"score": "0.60901606",
"text": "def awards\n @artist = Artist.find(params[:id])\n @awards = @artist.active_awards(current_user)\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @artist }\n end\n end",
"title": ""
},
{
"docid": "5553fdc820a5a4da2f23e2a24cb2c6ff",
"score": "0.6087581",
"text": "def create\n @player_award = PlayerAward.new(player_award_params)\n\n respond_to do |format|\n if @player_award.save\n format.html { redirect_to @player_award, notice: 'Player award was successfully created.' }\n format.json { render :show, status: :created, location: @player_award }\n else\n format.html { render :new }\n format.json { render json: @player_award.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2842e9a070daaec1db296a125a41ce30",
"score": "0.6052611",
"text": "def set_awards\n @awards = Award.all\n end",
"title": ""
},
{
"docid": "2efc87268ea870b9115ccb9d1f2b5ace",
"score": "0.6043627",
"text": "def index\n @awards = Award.all\n end",
"title": ""
},
{
"docid": "2efc87268ea870b9115ccb9d1f2b5ace",
"score": "0.6043627",
"text": "def index\n @awards = Award.all\n end",
"title": ""
},
{
"docid": "2efc87268ea870b9115ccb9d1f2b5ace",
"score": "0.6043627",
"text": "def index\n @awards = Award.all\n end",
"title": ""
},
{
"docid": "2efc87268ea870b9115ccb9d1f2b5ace",
"score": "0.6043627",
"text": "def index\n @awards = Award.all\n end",
"title": ""
},
{
"docid": "06c95b5bda8ab632dab2efdef8023759",
"score": "0.6040858",
"text": "def new\n @hazard = @task.hazards.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @hazard }\n end\n end",
"title": ""
},
{
"docid": "7a02fee11d62a308ef300ce9bb439e69",
"score": "0.6034505",
"text": "def create\n @reward = current_user.rewards.new(params[:reward])\n\n respond_to do |format|\n if @reward.save\n format.html { redirect_to @reward, notice: 'Reward was successfully created.' }\n format.json { render json: @reward, status: :created, location: @reward }\n else\n format.html { render action: \"new\" }\n format.json { render json: @reward.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6aa7313e5bb2ff54eba297e367acaede",
"score": "0.6026598",
"text": "def create\n @cms_award = Cms::Award.new(cms_award_params)\n\n respond_to do |format|\n if @cms_award.save\n format.html { redirect_to @cms_award, notice: 'Award was successfully created.' }\n format.json { render :show, status: :created, location: @cms_award }\n else\n format.html { render :new }\n format.json { render json: @cms_award.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7dd18d3c7845b83c75c0d4f073fd6c92",
"score": "0.6020697",
"text": "def index\n AnalyticsEvent.create(remote_ip, request.remote_ip,\n device: @device,\n type: :request_award,\n timestamp: Time.now,\n app_id: params[:app_id],\n event_id: params[:event_id],\n device_token_id: params[:security_token],\n player_id: params[:player_id],\n award_name: params[:name])\n\n # attempt to insert into awards table\n # table rules will reject insertion if there is an existing row with the same player_id, event_id, name\n\n # works for a particular milestone and associated reward, where for small events there can be 3 - 8\n award = Award.where({:event_id => params[:event_id], :player_id => params[:player_id], :name => params[:name], \n :milestone => params[:milestone], :reward => params[:reward]}).first\n if award.nil?\n award = Award.create(event_id: params[:event_id],\n player_id: params[:player_id],\n device_id: @device.id,\n name: params[:name],\n milestone: params[:milestone],\n reward: params[:reward],\n timestamp: Time.now)\n # return ok only if no entry exists\n render :json => {\"status\" => \"OK\"}\n else\n render :json => {\"status\" => \"Already awarded\"}\n end\n end",
"title": ""
},
{
"docid": "f37e66224301946971d707e40c0a720c",
"score": "0.598564",
"text": "def award_params\n params.require(:award).permit(:award_type, :granted, :name)\n end",
"title": ""
},
{
"docid": "726b96b9fe5f448f97f119ea401b419a",
"score": "0.5983193",
"text": "def award_params\n params.require(:award).permit(:name, :description, :precedence, :heraldry, :heraldry_blazon)\n end",
"title": ""
},
{
"docid": "2b3464a631b0e3d30535bcae8fba6e16",
"score": "0.59645665",
"text": "def create\n @honors_and_award = HonorsAndAward.new(honors_and_award_params)\n@honors_and_awards = HonorsAndAward.all\n respond_to do |format|\n if @honors_and_award.save\n format.html { redirect_to @honors_and_award, notice: 'Honors and award was successfully created.' }\n format.json { render :show, status: :created, location: @honors_and_award }\n else\n format.html { render :new }\n format.json { render json: @honors_and_award.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4359ee08d7cbcc3d28527453c432b988",
"score": "0.5948151",
"text": "def award_params\n params.require(:award).permit(:user_id, :hearts)\n end",
"title": ""
},
{
"docid": "7289400767b8a3e6c03b48f92744fc00",
"score": "0.5901537",
"text": "def create\n @award_type = AwardType.new(params[:award_type])\n\n respond_to do |format|\n if @award_type.save\n format.html { redirect_to @award_type, notice: 'Award type was successfully created.' }\n format.json { render json: @award_type, status: :created, location: @award_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @award_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0580b168b107491e4624bea7730b6601",
"score": "0.58782405",
"text": "def create\n @award = Award.new(award_params)\n\n respond_to do |format|\n if @award.save\n format.html { redirect_to people_path, notice: \"#{@award.person.display_name} was promoted to #{@award.rank.name} in #{@award.style.description}.\" }\n format.json { render :show, status: :created, location: @award }\n else\n format.html { render :new }\n format.json { render json: @award.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7cd0f17e81391cacfac318ecf8e7c122",
"score": "0.5849635",
"text": "def create\n @ambulance = Ambulance.new(params[:ambulance])\n\n respond_to do |format|\n if @ambulance.save\n format.html { redirect_to @ambulance, notice: 'Ambulance was successfully created.' }\n format.json { render json: @ambulance, status: :created, location: @ambulance }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ambulance.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9c076cfc3a2ba505cce75b098b397b31",
"score": "0.58411175",
"text": "def award_params\n params.require(:award).permit(:contents, :day, :giver_id, :given_id)\n end",
"title": ""
},
{
"docid": "8f6cfa5c799638b971e1aab2a55b8803",
"score": "0.58410627",
"text": "def new\n @award = Award.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @award }\n end\n end",
"title": ""
},
{
"docid": "5039ce6ed0d564d81340886523c94823",
"score": "0.58148724",
"text": "def create\n @miscaward = Miscaward.new(miscaward_params)\n\n respond_to do |format|\n if @miscaward.save\n format.html { redirect_to @miscaward, notice: 'Miscaward was successfully created.' }\n format.json { render :show, status: :created, location: @miscaward }\n else\n format.html { render :new }\n format.json { render json: @miscaward.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "568e09a6dd937e70e499c39d55307b29",
"score": "0.58117753",
"text": "def create\n @ambulance = Ambulance.new(ambulance_params)\n respond_to do |format|\n if @ambulance.save\n format.html { redirect_to @ambulance, notice: 'Ambulance was successfully created.' }\n format.json { render action: 'show', status: :created, location: @ambulance }\n else\n format.html { render action: 'new' }\n format.json { render json: @ambulance.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "27c14e87213c38701582dc41a2003d5e",
"score": "0.5808876",
"text": "def create\n megam_rest.post_billedhistories(to_hash)\n end",
"title": ""
},
{
"docid": "04048b667f307144d33d322c206084f6",
"score": "0.57973313",
"text": "def create\n @reward = Reward.new(params[:reward])\n @reward.creator = current_user\n respond_to do |format|\n if @reward.save\n format.html { redirect_to @reward, :notice => 'Reward was successfully created.' }\n format.json { render :json => @reward, :status => :created, :location => @reward }\n else\n @point_kinds = PointKind.all.collect {|p| [p.name, p.id] }\n @users = User.all.collect {|p| [p.login, p.id] }\n format.html { render :action => \"new\" }\n format.json { render :json => @reward.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1bfec13ef66935d9d8a6f83f0c93923f",
"score": "0.5789755",
"text": "def create\n params_armors = params[:suit].delete(:armors)\n @suit = Suit.create(params[:suit]) do |suit|\n hydrate_children!(suit, params_armors, :armors, Armor)\n end\n\n respond_with @suit\n end",
"title": ""
},
{
"docid": "b2ca4fe08ac43561b1353efca4403cb5",
"score": "0.5788189",
"text": "def index\n @awards = Award.all(:order => 'year desc')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @awards }\n end\n end",
"title": ""
},
{
"docid": "cd17f00711fc9a031f38ad5e0c7cde88",
"score": "0.57702374",
"text": "def create\n @reward = Reward.new(reward_params)\n\n respond_to do |format|\n if @reward.save\n format.html { redirect_to rewards_path }\n format.json { render :show, status: :created, location: @reward }\n flash[:success] = \"Criado com sucesso!\"\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @reward.errors, status: :unprocessable_entity }\n flash[:error] = \"Não foi possível criar o registro!\"\n end\n end\n end",
"title": ""
},
{
"docid": "df6565ef0f1cfc7b9268486c8ecd8918",
"score": "0.57701546",
"text": "def award_params\n params.require(:award).permit(:type, :dispute_month_id, :team_id, :position, :season_id)\n end",
"title": ""
},
{
"docid": "ce42c93b4b4e040e463989780d59bc5c",
"score": "0.57556564",
"text": "def create\n @awards_competition = AwardsCompetition.new(awards_competition_params)\n\n respond_to do |format|\n if @awards_competition.save\n format.html { redirect_to @awards_competition, notice: 'Awards competition was successfully created.' }\n format.json { render :show, status: :created, location: @awards_competition }\n else\n format.html { render :new }\n format.json { render json: @awards_competition.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fada80d1135d702967db25219b8ef2bf",
"score": "0.5750661",
"text": "def postFlashcard\n @deck = Deck.find(params[:deck_id]) \n @flashcard = Flashcard.new\n @flashcard.deck = @deck\n @flashcard.side_a = params[:side_a]\n @flashcard.side_b = params[:side_b]\n respond_to do |format|\n if @flashcard.save\n format.json { render json: @flashcard.api(current_user.id).to_json}\n else\n format.json { render json: @flashcard.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "52b491c7e260f51ba701b308e3a486b4",
"score": "0.5736325",
"text": "def get_event_awards_with_http_info(event_key, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: EventApi.get_event_awards ...'\n end\n # verify the required parameter 'event_key' is set\n if @api_client.config.client_side_validation && event_key.nil?\n fail ArgumentError, \"Missing the required parameter 'event_key' when calling EventApi.get_event_awards\"\n end\n # resource path\n local_var_path = '/event/{event_key}/awards'.sub('{' + 'event_key' + '}', CGI.escape(event_key.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 header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].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<Award>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['apiKey']\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: EventApi#get_event_awards\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "d2c2bfd334ec8120ad431fd2b7979885",
"score": "0.5733527",
"text": "def create\n @ca_reward = CaReward.new(params[:ca_reward])\n\n respond_to do |format|\n if @ca_reward.save\n format.html { redirect_to @ca_reward, :notice => 'Ca reward was successfully created.' }\n format.json { render :json => @ca_reward, :status => :created, :location => @ca_reward }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @ca_reward.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eba679212e58b5f0f73382468c6a239a",
"score": "0.5709462",
"text": "def award_params\n params.require(:award).permit(:employee_id, :award_name, :year_id, :award_from, :description)\n end",
"title": ""
},
{
"docid": "58c00c8eb90774c998e18511fc70dfc1",
"score": "0.5698692",
"text": "def create\n @agama = Agama.new(agama_params)\n\n respond_to do |format|\n if @agama.save\n format.html { redirect_to @agama, notice: 'Agama was successfully created.' }\n format.json { render :show, status: :created, location: @agama }\n else\n format.html { render :new }\n format.json { render json: @agama.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "25736b3d5b6766182845e37fa51f41dd",
"score": "0.56860405",
"text": "def create\n @civilian_military_award = CivilianMilitaryAward.new(params[:civilian_military_award])\n\n respond_to do |format|\n if @civilian_military_award.save\n format.html { redirect_to @civilian_military_award.rid, notice: 'Civilian military award was successfully created.' }\n format.json { render json: @civilian_military_award, status: :created, location: @civilian_military_award }\n else\n format.html { render action: \"new\" }\n format.json { render json: @civilian_military_award.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "95837876c2cff8217e68638283747405",
"score": "0.5684431",
"text": "def create\n megam_rest.post_billings(to_hash)\n end",
"title": ""
},
{
"docid": "6b7b14d990581f5d926710b7efe1540f",
"score": "0.5683923",
"text": "def awards_ceremony_params\n params.require(:awards_ceremony).permit(:name, :description, :image)\n end",
"title": ""
},
{
"docid": "45b5965e76384de1faef551a30fe25b6",
"score": "0.5674331",
"text": "def award_params\n params.require(:award).permit(:index)\n end",
"title": ""
},
{
"docid": "09f63e28319983974d7a563297395e73",
"score": "0.56588537",
"text": "def index\n @user_awards = UserAward.all\n end",
"title": ""
},
{
"docid": "918e0ba678b5d3cea5d91b9988d97df4",
"score": "0.5652949",
"text": "def create\n @bonus = Bonus.new()\n @bonus.quiz = @quiz\n @bonus.user = @user\n\n respond_to do |format|\n if @bonus.save\n @award = Award.new\n\t@award.source = @bonus\n\t@award.save!\n\t@user.hearts = @user.hearts + @quiz.points\n\t@user.save!\n\n format.json { render json: @bonus.to_json(:include => :user), status: :created }\n else\n format.json { render json: nil, status: :not_acceptable }\n end\n end\n end",
"title": ""
},
{
"docid": "9a74c7df439902e61f19d097f1e28971",
"score": "0.56528944",
"text": "def create\n begin\n @award = Award.new(award_params)\n respond_to do |format|\n if params[:back]\n format.html { render :new }\n else\n @award.create_with_upload!(@giver_id, @given_id)\n format.html { redirect_to @award, notice: 'Award was successfully created.' }\n format.json { render :show, status: :created, location: @award }\n end\n end\n rescue Aws::S3::MultipartUploadError => e\n flash.now[:notice] = '社外システムとの連携に失敗しました。時間を置いてもう一度お試しください。'\n render :new\n end\n end",
"title": ""
},
{
"docid": "eecaf128b341af201537d7cb5bd23958",
"score": "0.56455576",
"text": "def create\n @ambulance = Ambulance.new(ambulance_params)\n\n respond_to do |format|\n if @ambulance.save\n format.html { redirect_to [:admin, @ambulance], notice: 'Ambulance was successfully created.' }\n format.json { render :show, status: :created, location: @ambulance }\n else\n format.html { render :new }\n format.json { render json: @ambulance.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "35d1fa40a765757abc27d0463d4a5b63",
"score": "0.5641246",
"text": "def create\n @arena = Arena.new(arena_params)\n @arena.updated_by = account_id\n @arena.created_by = account_id \n\n return head(:internal_server_error) unless @arena.save\n\n respond_with @arena\n end",
"title": ""
},
{
"docid": "bccd594c51fa9c0065d80b8b6a0f27cc",
"score": "0.56274945",
"text": "def create\n @abeyance = Abeyance.new(abeyance_params)\n\n respond_to do |format|\n if @abeyance.save\n format.html { redirect_to @abeyance, notice: 'Abeyance was successfully created.' }\n format.json { render :show, status: :created, location: @abeyance }\n else\n format.html { render :new }\n format.json { render json: @abeyance.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6ae26de60d9072d1ea94e2a59a7c7864",
"score": "0.56268",
"text": "def create\n @api_v1_reward_action = Api::V1::RewardAction.new(api_v1_reward_action_params)\n\n respond_to do |format|\n if @api_v1_reward_action.save\n format.html { redirect_to @api_v1_reward_action, notice: 'Reward action was successfully created.' }\n format.json { render :show, status: :created, location: @api_v1_reward_action }\n else\n format.html { render :new }\n format.json { render json: @api_v1_reward_action.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8dec5e8a380ffd99948384bb2eb64e28",
"score": "0.56254584",
"text": "def create\n @hazard = @task.hazards.new(params[:hazard])\n\n respond_to do |format|\n if @hazard.save\n format.html { redirect_to [@department,@task], notice: 'Hazard was successfully created.' }\n format.json { render json: @task, status: :created, location: @hazard }\n else\n format.html { render action: \"new\" }\n format.json { render json: @hazard.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6fa41d673bb186e0a4836f9299ecf0ae",
"score": "0.5614007",
"text": "def award_params\n params.require(:award).permit(:title, :description, :photo)\n end",
"title": ""
},
{
"docid": "f338187c5c42138ce5b4bb2bb53f9763",
"score": "0.560042",
"text": "def award_params\n params.require(:award).permit(:ein, :name, :address, :city, :state, :zip, :amount, :purpose, :filename)\n end",
"title": ""
},
{
"docid": "a833d5a128bb293b8bd7b9ea12dd8d6e",
"score": "0.5587734",
"text": "def create\n @paw = Paw.new(paw_params)\n respond_to do |format|\n if @paw.save\n format.html { redirect_to @paw, notice: 'Paw was successfully created.' }\n format.json { render :show, status: :created, location: @paw }\n \n else\n format.html { render :new }\n format.json { render json: @paw.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f6ebf9b34ca12103c4ecd3f8c29ad650",
"score": "0.5577274",
"text": "def create\n @overheard = Overheard.new(overheard_params)\n\n respond_to do |format|\n if @overheard.save\n format.html { redirect_to @overheard, notice: 'Overheard was successfully created.' }\n format.json { render :show, status: :created, location: @overheard }\n else\n format.html { render :new }\n format.json { render json: @overheard.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "37ff330c36932deceb191bc78e7a3b70",
"score": "0.55684114",
"text": "def create\n @api_v1_user_reward = Api::V1::UserReward.new(api_v1_user_reward_params)\n\n respond_to do |format|\n if @api_v1_user_reward.save\n format.html { redirect_to @api_v1_user_reward, notice: 'User reward was successfully created.' }\n format.json { render :show, status: :created, location: @api_v1_user_reward }\n else\n format.html { render :new }\n format.json { render json: @api_v1_user_reward.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "de3519996d11acf6dd03b3d7532cb09b",
"score": "0.5566085",
"text": "def create\n @aradah_tank = current_user.aradah_tanks.build(aradah_tank_params)\n\n respond_to do |format|\n if @aradah_tank.save\n format.html { redirect_to @aradah_tank, notice: 'Aradah tank was successfully created.' }\n format.json { render :show, status: :created, location: @aradah_tank }\n else\n format.html { render :new }\n format.json { render json: @aradah_tank.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f68a82b08e154600ff970b709df4a321",
"score": "0.55645543",
"text": "def create\n @reward = Reward.new(params[:reward])\n\n respond_to do |format|\n if @reward.save\n format.html { redirect_to(rewards_path, :notice => 'Nagroda dodana.') }\n format.xml { render :xml => @reward, :status => :created, :location => @reward }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @reward.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "700c9948d7f8489212e9c3e4c8b98162",
"score": "0.5564532",
"text": "def award_params\n p = params.require(:award).permit(:date, :person_id, :rank_id)\n # handle the date format rendered by the JS date picker.\n p[:date] = Date.strptime(p[:date], '%m/%d/%Y')\n p\n end",
"title": ""
},
{
"docid": "1495343551a4487e632ba532ccd2aeff",
"score": "0.5558581",
"text": "def create\n @reward = Reward.new(reward_params)\n \n respond_to do |format|\n if @reward.save\n format.html { redirect_to [:admin, @reward], notice: 'Reward was successfully created.' }\n format.json { render json: @reward, status: :created, location: @reward }\n else\n format.html { render action: \"new\" }\n format.json { render json: @reward.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0cf0ec78de46ca80dc722f2b33213d91",
"score": "0.5550484",
"text": "def create\n @external_award = ExternalAward.new(external_award_params)\n\n respond_to do |format|\n if @external_award.save\n format.html { redirect_to @external_award, notice: 'Record was successfully created.' }\n format.json { render :show, status: :created, location: @external_award }\n else\n format.html { render :new }\n format.json { render json: @external_award.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "74704c1d35f9c34a125bcdf0d7db511e",
"score": "0.5540884",
"text": "def updateawards\n @movie = Movie.find(params[:id])\n movie_param = params[:movies] \n @selected_awards = Array.new\n movie_param[:award_ids].each do |award_id| \n @selected_awards << Award.find(award_id) \n end \n @movie.awards = @selected_awards \n respond_to do |format|\n format.html { redirect_to(:action => :awards) }\n format.xml { head :ok }\n end \n end",
"title": ""
},
{
"docid": "d4f129332c2e5103e12602642a4558af",
"score": "0.5536377",
"text": "def create\n @anketum = Anketum.new(params[:anketum])\n\n respond_to do |format|\n if @anketum.save\n format.html { redirect_to @anketum, notice: 'Anketum was successfully created.' }\n format.json { render json: @anketum, status: :created, location: @anketum }\n else\n format.html { render action: \"new\" }\n format.json { render json: @anketum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6be241587a3edce6f7f34238ee73c42f",
"score": "0.5534622",
"text": "def index\n\n @rewards = Reward.all\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rewards }\n end\n end",
"title": ""
},
{
"docid": "83740e899dc647a10f5dc13149182ed2",
"score": "0.55318844",
"text": "def create\n @arcade = Arcade.new(arcade_params)\n\n respond_to do |format|\n if @arcade.save\n format.html { redirect_to @arcade, notice: 'Arcade was successfully created.' }\n format.json { render :show, status: :created, location: @arcade }\n else\n format.html { render :new }\n format.json { render json: @arcade.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4360504519631716cfed1924377fdbb1",
"score": "0.5530961",
"text": "def new\n @player_award = PlayerAward.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @player_award }\n end\n end",
"title": ""
},
{
"docid": "3d090ae9c716220391b74be7a3b1a428",
"score": "0.55301565",
"text": "def create\n @army = Army.new(army_params)\n\n @army.user.games << @army.game\n\n @army.turn_count = 0\n\n #@army.game.armies.each do |army|\n # army.turn_count += 1 if army.turn_count != 0\n # army.save\n #end\n\n respond_to do |format|\n if @army.save\n format.html { redirect_to @army.game, notice: 'Army was successfully created.' }\n format.json { render action: 'show', status: :created, location: @army }\n else\n format.html { render action: 'new' }\n format.json { render json: @army.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "76cf26928a17e1bbb13c553f6a76fb9a",
"score": "0.5530089",
"text": "def create\n pledgerID = params[:reward].delete(:pledger_id)\n pledger = Pledger.find(pledgerID)\n item = params[:reward][:item] = Item.find(params[:reward][:item])\n @reward = pledger.rewards.create(params[:reward])\n\n respond_to do |format|\n if @reward.save\n item.update_attributes(stock: item.stock - 1) if @reward.premia_sent\n format.html { redirect_to @reward, notice: 'Reward was successfully created.' }\n format.json { render json: @reward, status: :created, location: @reward }\n format.js\n else\n format.html { render action: 'new' }\n format.json { render json: @reward.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end",
"title": ""
},
{
"docid": "69bbf2f31e607d82a4d23c611af74b37",
"score": "0.55293375",
"text": "def index\n @person = Person.find(params[:person_id])\n @award = Award.new\n end",
"title": ""
},
{
"docid": "65128ae9126011c846af55ccfa9786f2",
"score": "0.55186474",
"text": "def create\n @accessory = Accessory.new(accessory_params)\n\n if @accessory.save\n render json: @accessory, status: :created\n else\n render json: @accessory.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "fcd43d104663430c9e1e13721f7fff9d",
"score": "0.5512807",
"text": "def index\n @game_awards = GameAward.all\n end",
"title": ""
},
{
"docid": "af6f6b7fe422ba9225414624d6fc362c",
"score": "0.5509999",
"text": "def new\n @reward = current_user.rewards.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reward }\n end\n end",
"title": ""
},
{
"docid": "3ae34adb6122fc4a68f330692f9b1f0c",
"score": "0.5504145",
"text": "def create\n @away_rating = AwayRating.new(away_rating_params)\n\n respond_to do |format|\n if @away_rating.save\n format.html { redirect_to @away_rating, notice: 'Away rating was successfully created.' }\n format.json { render :show, status: :created, location: @away_rating }\n else\n format.html { render :new }\n format.json { render json: @away_rating.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3df66d4a8c168f38bf9b83f980596491",
"score": "0.5503303",
"text": "def create\n @daw_mate_acad = DawMateAcad.new(daw_mate_acad_params)\n\n respond_to do |format|\n if @daw_mate_acad.save\n format.html { redirect_to @daw_mate_acad, notice: 'Daw mate acad was successfully created.' }\n format.json { render :show, status: :created, location: @daw_mate_acad }\n else\n format.html { render :new }\n format.json { render json: @daw_mate_acad.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "485dc5ecb6f8ae7217f5a9d9ecc8eb72",
"score": "0.5502214",
"text": "def create\n @card = Card.create(card_params)\n render json: @card\n end",
"title": ""
},
{
"docid": "79fb84cf71be5bf52da68ddc1e2d439c",
"score": "0.5497502",
"text": "def create\n @award_organization = AwardOrganization.new(params[:award_organization])\n\n respond_to do |format|\n if @award_organization.save\n format.html { redirect_to @award_organization, notice: 'Award organization was successfully created.' }\n format.json { render json: @award_organization, status: :created, location: @award_organization }\n else\n format.html { render action: \"new\" }\n format.json { render json: @award_organization.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d2fac5b488f3ff986df0a519cf665b10",
"score": "0.54954034",
"text": "def addAward\n award_cat = AwardCategories.find(params[:movie_award][:id])\n artist = Artist.find(params[:movie_award][:artist])\n movie = Movie.find(params[:movie_award][:movie]) \n award = MovieAward.new(:movie => movie,\n \t :artist => artist,\n \t :categories => award_cat,\n \t :year => Date.strptime(params[:movie_award]['year(1i)'],'%Y'),\n \t :location => params[:movie_award][:location] )\n award.save\n respond_to do |format|\n format.html { redirect_to(movie) }\n format.xml { head :ok }\n end \n end",
"title": ""
},
{
"docid": "dd62d6720cea51f5cd81a98c134c4489",
"score": "0.5493512",
"text": "def create\n @army = Army.new(army_params)\n\n respond_to do |format|\n if @army.save\n format.html { redirect_to @army, notice: 'Army was successfully created.' }\n format.json { render :show, status: :created, location: @army }\n else\n format.html { render :new }\n format.json { render json: @army.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "35da796a4dba2e47471e69d8916381bb",
"score": "0.5485605",
"text": "def create\n authorize! :create, Ward\n hospital = Hospital.find(params[:hospital_id])\n @ward = hospital.wards.create(ward_params)\n\n respond_to do |format|\n if @ward.save\n format.html { redirect_to hospital_path(hospital.id), notice: 'Ward was successfully created.' }\n format.json { render :show, status: :created, location: @ward }\n else\n format.html { render :new }\n format.json { render json: @ward.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "65c44e4e409b5da3a021f0a1731a1191",
"score": "0.54836524",
"text": "def create\n @amnesty = Amnesty.new(params[:amnesty])\n\n respond_to do |format|\n if @amnesty.save\n format.html { redirect_to @amnesty, notice: 'Amnesty was successfully created.' }\n format.json { render json: @amnesty, status: :created, location: @amnesty }\n else\n format.html { render action: \"new\" }\n format.json { render json: @amnesty.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3d74a92e480c6be24f8e8e45d0461b90",
"score": "0.5476846",
"text": "def set_award\n @award = Award.find(params[:id])\n end",
"title": ""
},
{
"docid": "3d74a92e480c6be24f8e8e45d0461b90",
"score": "0.5476846",
"text": "def set_award\n @award = Award.find(params[:id])\n end",
"title": ""
},
{
"docid": "3d74a92e480c6be24f8e8e45d0461b90",
"score": "0.5476846",
"text": "def set_award\n @award = Award.find(params[:id])\n end",
"title": ""
},
{
"docid": "fc8abbef569b9987b26ea7e8cd01c6fb",
"score": "0.5476524",
"text": "def postCard(name, desc, pos, idList, idCardSource, keepFromSource)\n\n\thash = Hash.new\n\thash[:name] = name\n\thash[:desc] = desc if !desc.nil?\n\thash[:pos] = pos if !pos.nil?\t\n\thash[:idList] = idList if !idList.nil?\t\n\thash[:idCardSource] = idCardSource if !idCardSource.nil?\n\thash[:keepFromSource] = keepFromSource if !keepFromSource.nil?\t\n\thash[:key] = $key\n\thash[:token] = $token\t\n\n\tresponse = RestClient.post 'https://api.trello.com/1/cards', hash\n\tresponse = JSON.parse(response)\nend",
"title": ""
},
{
"docid": "7e3ab5210f703dd2e88d6bc0bd5af173",
"score": "0.54696476",
"text": "def create\n @babycard = Babycard.new(params[:babycard])\n\n respond_to do |format|\n if @babycard.save\n format.html { redirect_to @babycard, notice: 'Babycard was successfully created.' }\n format.json { render json: @babycard, status: :created, location: @babycard }\n else\n format.html { render action: \"new\" }\n format.json { render json: @babycard.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5e7be2cc06f2152abcd847df8623cf2d",
"score": "0.5469484",
"text": "def create\n @card_ace = CardAce.new(card_ace_params)\n\n respond_to do |format|\n if @card_ace.save\n format.html { redirect_to @card_ace, notice: 'CardAce was successfully created.' }\n format.json { render :show, status: :created, location: @card_ace }\n else\n format.html { render :new }\n format.json { render json: @card_ace.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bcd66c1557aa6f4b967f30603c5f5624",
"score": "0.5460451",
"text": "def create\n @game_award_player = GameAwardPlayer.new(game_award_player_params)\n\n respond_to do |format|\n if @game_award_player.save\n format.json { render :show, status: :created, location: @game_award_player }\n else\n format.json { render json: @game_award_player.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "97ecfe90d973cd4ac5d3f0197c915aef",
"score": "0.5458587",
"text": "def index\n @player_awards = PlayerAward.all\n end",
"title": ""
}
] |
00b928889e2f1ca57a145715eddf389b
|
intenta ingresar al sistema con el usuario y la clave enviados
|
[
{
"docid": "8c4957d8c9b0453f7401300afdab3625",
"score": "0.66081196",
"text": "def ingresar(usuario, clave)\n\t\t@manejador.ingresar(usuario, clave)\n\tend",
"title": ""
}
] |
[
{
"docid": "2ede030cd6875193024a092b02c2aba1",
"score": "0.6271733",
"text": "def almacenarUsuario(usuario,nombreContenedor)\n\tsystem(\"sudo mysql -u root -p password\")\n\tsystem(\"insert into usuarios values(\"+usuario.to_s+\",\"+nombreContenedor.to_s)\n\tsystem(\"exit\")\t\t\nend",
"title": ""
},
{
"docid": "0f3d3b1573243917dd07977fb78bdbab",
"score": "0.60284126",
"text": "def antes_salvar\n\t\t\n\t\t# Chama metodo para criptografar a senha\n\t\tif !self.senha_salt\n\t\t\tencrypt_password\n\t\tend\n\t\t\n\t\t# Configura alguns atributos\n\t\t#self.nomeUsuario = nomeUsuario.downcase\n\t\tself.email = email.downcase\n\t\tself.status_ace ||= 'false'\n\t\tself.permissao ||= nil\n\t\t\n\tend",
"title": ""
},
{
"docid": "309c97b5837f42a185b5f9c6c8f2a004",
"score": "0.5958595",
"text": "def crear_usuario(usuario, clave)\n\t\t@manejador.agregar_usuario(usuario, clave)\n\tend",
"title": ""
},
{
"docid": "9d27f0a5e0c01b808c97bac497f157c1",
"score": "0.57256794",
"text": "def almacenarUsuario(usuario,nombreContenedor)\n\t@usuarioN=usuario\n\t@nombreContenedorN=nombreContenedor\n\t@sql_host=\"localhost\"\n\t@slq_usuario=\"root\"\n\t@sql_password=\"password\"\n\t@sql_database=\"usuarios\"\n\t@sql_args=\"-h\"+ @sql_host.to_s+\" -u\"+ @slq_usuario.to_s+\" -p\"+@sql_password.to_s+\" -D\"+ @sql_database.to_s+\" -s -e\"\n \tsystem(\"mysql @sql_args insert into usuario(nombreUsuario,nombreContenedor) values('\"+@usuarioN.to_s+\"','\"+@nombreContenedorN.to_s+\"');\")\nend",
"title": ""
},
{
"docid": "bc8a8c88e1587006745661f53eb2cad0",
"score": "0.5668447",
"text": "def activate\n @activated = true\n activated_at = Time.now\n activation_code = nil\n logger.info \"Activando el usuario\"\n save\n end",
"title": ""
},
{
"docid": "b52ac5e4b13b70f1bc879b571cc853ce",
"score": "0.5629976",
"text": "def adicionar_usuario\n self.usuario_id = current_user.id\n end",
"title": ""
},
{
"docid": "b52ac5e4b13b70f1bc879b571cc853ce",
"score": "0.5629976",
"text": "def adicionar_usuario\n self.usuario_id = current_user.id\n end",
"title": ""
},
{
"docid": "d2b1cd998f15704b44e4c2a32e51e376",
"score": "0.56138504",
"text": "def envia_a_login(mensaje)\n true\n end",
"title": ""
},
{
"docid": "daca775f36d526e8985a45ed089a7174",
"score": "0.5554696",
"text": "def registro_login_ventas\n\n #consierar que no si no es nadie (cualquier cosa diferente de supervisor, admin, ventas, por ejemplo nil u otro valor desconocido, ok ted.) sea ventas el acceso.\n if( (session[:current_user].to_s != \"ventas\") && ( session[:current_user].to_s != \"supervisor\") && (session[:current_user].to_s != \"admin\") )\n session[:current_user] = \"ventas\"\n @accesot = Accesot.new\n @accesot.usuario = \"ventas\"\n @accesot.tipoacceso = \"login\"\n @accesot.fechayhora = Time.now\n @accesot.ip = request.env['action_dispatch.remote_ip'].to_s # registro la ip desde donde se hace el request. ok.\n @accesot.save\n \n end \n\n if( (session[:current_user].to_s == \"admin\") || (session[:current_user].to_s == \"supervisor\") )\n\n #registrar LOGOUT de admin o de supervisor, dependiendo valor de la session ok: \n @accesot = Accesot.new\n @accesot.usuario = session[:current_user].to_s # selecciono el usuario a hacer logout. ok. (puede contener \"admin\" o \"supervisor\" solamente porque esta dentro del if condition ok ted.)\n @accesot.tipoacceso = \"logout\"\n @accesot.fechayhora = Time.now\n @accesot.ip = request.env['action_dispatch.remote_ip'].to_s # registro la ip desde donde se hace el request. ok.\n @accesot.save\n\n #registrar login ventas:\n session[:current_user] = \"ventas\"\n @accesot = Accesot.new\n @accesot.usuario = \"ventas\"\n @accesot.tipoacceso = \"login\"\n @accesot.fechayhora = Time.now\n @accesot.ip = request.env['action_dispatch.remote_ip'].to_s # registro la ip desde donde se hace el request. ok.\n @accesot.save\n\n #crear el scaffold de este modelo.\n #ver lo del after_filter action ok.\n #probarlo.\n #continuar lo mismo pero para admin, en los controladores requeridos.\n \n end \n\n # if session[:current_user] == nil, asignar \"ventas\" a session[:current_user] y registrar nuevo login\n # if session[:current_user] == admin, asignar \"ventas\" a session[:current_user] y registrar nuevo login de usuario ventas y registrar como salida de usuario admin.\n # if session[:current_user] == supervisor, asignar \"ventas\" a session[:current_user] y registrar nuevo login de usuario ventas y registrar como salida de usuario supervisor.\n # if session[:current_user] == ventas, no hacer nada, ya estaba logeado ok.\n # if session[:current_user] != admin, supervisor, ventas, asignar \"ventas\" a session[:current_user] y registrar nuevo login usuario ventas.\n\n\n\n end",
"title": ""
},
{
"docid": "c4ad761bb22532fdc400a8f9be1c6650",
"score": "0.5494122",
"text": "def set_usuario\n\t end",
"title": ""
},
{
"docid": "f4426f3902561ad5ed5dd994ce34601e",
"score": "0.5451311",
"text": "def user_activate\n users = User.where(id: params[:id], account_status: \"inactive\").exists?(conditions = :none)\n name = User.where(id: params[:id]).pluck(:email)\n name = name[0].split('@')[0]\n\n if users\n User.update(params[:id], account_status: \"active\")\n # Need to add full path of script\n # add_ovpn_user = `/bin/sh cmd_and_control.sh add #{name}`\n puts add_ovpn_user\n else\n User.update(params[:id], account_status: \"inactive\")\n # Need to add full path of script\n # remove_ovpn_user = `/bin/sh cmd_and_control.sh remove #{name}`\n puts remove_ovpn_user\n end\n\n redirect_to admins_show_path\n end",
"title": ""
},
{
"docid": "4f570d761ac0079433fca6c818b275c6",
"score": "0.544928",
"text": "def seguir(otro_usuaria)\n\t\tsiguiendo << otro_usuaria\n\tend",
"title": ""
},
{
"docid": "129d48b4f64b251e253cf9ff12159b13",
"score": "0.5433672",
"text": "def envia_produto\n # Marca dia/hora do envio\n self.data_envio = Time.now.utc\n self.save(false)\n # Email para cliente\n self.notifica_envio_produto\n end",
"title": ""
},
{
"docid": "b33f3d88e9faf63d2a84cbd14e4d82d9",
"score": "0.54333216",
"text": "def user_present(host, username)\n case host['platform']\n when %r{eos}\n on(host, \"useradd #{username}\")\n else\n host.user_present(username)\n end\nend",
"title": ""
},
{
"docid": "e33812d8ccc10653a0931cb0cbd61ee6",
"score": "0.5429988",
"text": "def registrar(password)\n if Rails.env.staging? #Staging de prueba cambiar a env.production quitar elsif\n endpoint = \"/FNZA-Mobile/registerwhite\" #Produccion\n elsif Rails.env.development?\n endpoint = \"/FNZA-Mobile/registerwhite\" #Produccion\n else\n endpoint = \"/mobile/registerwhite\" #Pruebas\n end\n key = self.request_key\n iv = self.request_iv\n sign_key = self.request_signature_key\n sign_iv = self.request_signature_iv\n\n json = {\n userId: usuario,\n email: email,\n password: Feenicia::encrypt(password, key, iv),\n appType: \"FNZA_SITE\",\n aplic: \"docDigi\"\n }\n\n json_encrypted = Feenicia::encrypt(json, sign_key, sign_iv, true)\n \n response = Feenicia::send_request(endpoint, json.to_json, json_encrypted, \"FNZA_SSO\")\n #Registrar el log\n respuesta = JSON.parse(response[:response])\n host = ENV[\"feenicia_host\"]\n feenicia_log(\"registrar_usuario/#{usuario}\", json.to_json, respuesta, host, endpoint, \"FNZA_SSO\", json_encrypted)\n #Procesar Respuesta\n respuesta_procesada = procesar_respuesta(response)\n return respuesta_procesada\n end",
"title": ""
},
{
"docid": "734ad6c36a1ed58c610047ce43e5adb0",
"score": "0.54188704",
"text": "def procesar\n \n end",
"title": ""
},
{
"docid": "695a6f8aaf52dd00f6d00153de66986e",
"score": "0.54065114",
"text": "def inicia_observador\n current_usuario = Usuario.create!(PRUEBA_USUARIO_AN)\n current_usuario.grupo_ids = [21]\n current_usuario.save\n return current_usuario\n end",
"title": ""
},
{
"docid": "336124424c0b29f941a4ecaa509ad87f",
"score": "0.53976566",
"text": "def gestor_usr_required\n unless soy_gestor_usr?\n envia_a_login(\"Debe identificarse como gestor de usuarios para acceder\")\n end\n end",
"title": ""
},
{
"docid": "33138b137e5701d5886cff4113232446",
"score": "0.53966725",
"text": "def setUsingEnviro\r\n @@usingEnviro = 1\r\n end",
"title": ""
},
{
"docid": "9f8814e330c9a81bbcf72ccef8f8acd1",
"score": "0.5394291",
"text": "def activate\n #domthu redirect_to(home_url) && return unless Setting.self_registration? && params[:token]\n redirect_to(editorial_url) && return unless Setting.self_registration? && params[:token]\n token = Token.find_by_action_and_value('register', params[:token])\n if token && token.user\n user = token.user\n #domthu redirect_to(home_url) && return unless user.registered?\n redirect_to(editorial_url) && return unless user.registered?\n user.activate\n if user.save\n token.destroy\n send_notice l(:notice_account_activated)\n #in caso di prova gratis inviare dati di accesso\n if (user.pwd && !user.pwd.blank?) || user.isregistered?\n Mailer.deliver_account_information(user, user.pwd)\n #Non è questo il messaggio. deve essere quello di prova che definisce la scadenza ed invita all'abbonamento\n #tmail = Mailer.deliver_fee(user, 'thanks', Setting.template_fee_thanks)\n end\n end\n else\n send_notice(\"La conferma è gia avvenuta. <br />Se non riccordi le tue credentiali usi la gestione recupero password.\")\n end\n #redirect_to :action => 'login'\n redirect_to editorial_url\n end",
"title": ""
},
{
"docid": "14495e65dccd70f89cf186a31512ef00",
"score": "0.53887683",
"text": "def opram_system\n temp = current_user.name + \" \" + Time.now.to_s\n key = ActiveSupport::KeyGenerator.new('token').generate_key(\"UNL-cse-ilab\")\n crypt = ActiveSupport::MessageEncryptor.new(key)\n encrypted_data = crypt.encrypt_and_sign(temp)\n AuthToken.create(:token => encrypted_data)\n url = opram_url + \"?token=#{encrypted_data}\"\n redirect_to url\n end",
"title": ""
},
{
"docid": "ef02fbad0e76a2345051633af543bdc8",
"score": "0.5386516",
"text": "def SetDatosIngreso(usu, pass)\n\t\t@Usuario = usu\n\t\t@Contrasenia = pass\n\tend",
"title": ""
},
{
"docid": "ef02fbad0e76a2345051633af543bdc8",
"score": "0.5386516",
"text": "def SetDatosIngreso(usu, pass)\n\t\t@Usuario = usu\n\t\t@Contrasenia = pass\n\tend",
"title": ""
},
{
"docid": "d9bc3de06649e7006c6b87e587d8342f",
"score": "0.53721267",
"text": "def registrar_envio(tipo,*arg)\n envio = Factory.dame_objeto(tipo,*arg)\n modelo.registrar(envio)\n vista.mostrar(\"Envio registrado\")\n end",
"title": ""
},
{
"docid": "e8cb6d99f4e84dbcb932339aa79d2951",
"score": "0.5358383",
"text": "def vkontakte\n auth = request.env[\"omniauth.auth\"]\n #try to find user by provider and unique number\n user = User.where(:provider => auth.provider, :url => auth.uid).first\n if user.nil?\n user = User.new(username:auth.extra.raw_info.name,\n provider:auth.provider,\n url:auth.uid,\n email: \"#{auth.extra.raw_info.name}@vk.com\",\n password:Devise.friendly_token[0,20])\n user.skip_confirmation!\n user.save!\n end\n #if user has bee saved in database\n #then we sign it to application\n if user.persisted?\n sign_in user, :bypass => true\n end\n #redirect to application main page\n redirect_to root_path\n end",
"title": ""
},
{
"docid": "eb7a922ae0b510898c886d712a0f389d",
"score": "0.5346263",
"text": "def user_parames\n params.require(:user).permit(:email, :privilegio, :nombre, :meta, :password, :password_confirmation,:firma)\n end",
"title": ""
},
{
"docid": "5ad9b162e692b2140f4d65d9d7fb677e",
"score": "0.53361464",
"text": "def autorizar\n unless self.usuario_en_sesion\n flash[:error] = \"Debe ingresar al sistema para tener acceso a esta sección\"\n redirect_to :controller => 'clientes', :action => 'ingreso'\n return false\n end\n return true\n end",
"title": ""
},
{
"docid": "ddf02d4c7a328c7c9b968c4d73b1c8b1",
"score": "0.5326789",
"text": "def registrar_usuario\n customer_user = User.new\n customer_user.email = self.people.email\n customer_user.password = customer_user.generar_password\n customer_user.client_type = 'persona'\n customer_user.save\n update(user_id: customer_user.id, user_created_id: customer_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_customer = HistoryPassword.new\n password_customer.password = customer_user.password\n password_customer.user_id = customer_user.id\n password_customer.save\n end",
"title": ""
},
{
"docid": "1408d7a63804f270a992ab49ab9fe5cd",
"score": "0.5304581",
"text": "def create\n \n # Verifica se o usuario pode entrar no sistema\n if User.validarLogin(params[:nomeUsuario])\n \n # Utiliza o metodo autenticar do Usuario\n user = User.authenticate(params[:nomeUsuario], params[:senha])\n \n if user\n \n # Sucesso: usuario sera redirecionado para a home de novo\n session[:user_id] = user.id\n redirect_to root_url, :notice => \"Welcome! #{user.nomeExibicao}\"\n \n else\n \n # Erro: nova tentativa\n redirect_to root_url, :notice => \"Invalid username or password combination, please try again...\"\n \n end\n \n else\n \n redirect_to root_url, :notice => \"User account is suspended or not yet approved\"\n \n end\n \n end",
"title": ""
},
{
"docid": "3a694d76ec524a14468adb240ab1eadf",
"score": "0.52977836",
"text": "def change_existing_user\n mem = @data.mem\n creator = mem.creator\n email = creator.contact.con_email\n need_email = email && !email.empty?\n\n @session.push(self.class, :continue_to_renew)\n @session.dispatch(Login,\n :handle_update_details_for_third_party, \n [ creator, need_email ])\n end",
"title": ""
},
{
"docid": "707c0f66e34b5ba16788f54acdb253ca",
"score": "0.5295769",
"text": "def consultarAnalisisClave(clave) @db.consultarAnalisisClave(clave) end",
"title": ""
},
{
"docid": "f7d908f2f8f2435641240af6939b74e8",
"score": "0.52738005",
"text": "def set_user\n auths = request.headers[:Authorization].split(':')\n\n user_id = Base64.decode64(auths[0])\n password = Base64.decode64(auths[1])\n\n #認証未実装\n @user = User.find_by_id(params[:id])\n end",
"title": ""
},
{
"docid": "ba8bad61dde11dbd2f666bd66213a6da",
"score": "0.52695394",
"text": "def accionIdentify(comando,usuariosLista,socketUsuario)\n orden=comando.split(\" \")\n username=orden[1]\n if(username==nil)\n socketUsuario.puts \"Necesitas ingresar un nombre\"\n elsif (nombreExiste?(username,usuariosLista))\n socketUsuario.puts \"Este usuario ya esta ocupado\"\n else\n status=\"ACTIVE\"\n usuario=Usuario.new(username,socketUsuario,status)\n usuariosLista.push(usuario)\n socketUsuario.puts \"Ahora esta identificado como #{username}\"\n s=\"_ Se a conectado\"\n accionPublicMessage(s,usuariosLista,socketUsuario)\n end\n end",
"title": ""
},
{
"docid": "cba42c8b16d99b9396760ac6dc1b653e",
"score": "0.5260246",
"text": "def dar_acceso_como\n \tsession[:id_usuario] = usuario.id\n cookies.signed[:chat] = usuario.id\n end",
"title": ""
},
{
"docid": "65f8b4807c647e9e3e82ddefc130ca71",
"score": "0.52577144",
"text": "def ver_in_system\n if current_user\n redirect_to(root_path, :notice => \"Вы уже в системе\")\n end\n end",
"title": ""
},
{
"docid": "2ff5ce45e59cd4e32c3b94ea0d75d379",
"score": "0.5256362",
"text": "def create\n @usuario = Usuario.new(usuario_params)\n @usuario.usr_contrasena = \"12345\"#SecureRandom.urlsafe_base64\n contrasena_bkp = @usuario.usr_contrasena\n @usuario.usr_tipo_contrasena = \"TMP\" # contraseña provisional, un solo ingreso\n \n respond_to do |format|\n if @usuario.save\n #Notificacion de bienvenida al usuario\n @usuario.usr_contrasena = contrasena_bkp\n MailerUsuario.bienvenida_usuario(@usuario).deliver\n #==============\n \n format.html { redirect_to @usuario, notice: 'Usuario creado exitosamente.' }\n format.json { render action: 'show', status: :created, location: @usuario }\n else\n format.html { render action: 'new' }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "13c4feb7dd6d02b9ed8328f53e3bf824",
"score": "0.5255422",
"text": "def enviar\n\t\t@archivo = Archivo.new(secure_params)\n\t\tif @archivo.valid?\n\t\t\t@archivo.subir(session['materiaDocente'])\n\t\t\t#UsuarioCorreo.contacto_email(@contacto).deliver\n\t\t\tflash[:notice] = \"La carga se realizo exitosamente!!! :)\"\n\t\t\trender 'archivos/guardar'\n\t\telse\n\t\t\trender :new\n\t\tend\n\tend",
"title": ""
},
{
"docid": "c7419a13490b22f07e68fa0a3583739c",
"score": "0.5240355",
"text": "def aguardando_confirmacao\n @user = User.find(params[:id])\n @link_ativacao = \"#{@user.activation_code}\"\n end",
"title": ""
},
{
"docid": "8aaf40f8d0885b37758ba91a0eec5640",
"score": "0.5236189",
"text": "def has_senha?(enviada)\n encrypted_senha == encrypt(enviada)\n end",
"title": ""
},
{
"docid": "267497795f5ad8a8b37583b1d80752b2",
"score": "0.521518",
"text": "def usuario_params\n params[:activo]=true\n params.require(:usuario).permit(:email, :password, :alias, :nombre, :apellido, :activo ,:f_nac, :email_confirmation, :password_confirmation)\n end",
"title": ""
},
{
"docid": "2da4d6d58e3175f1b03555feff8b2ac0",
"score": "0.52127945",
"text": "def grantAllToRootUser\n passwd3File=\"#{ENV['HOME']}/passwd3.tmp\"\n puts passwd3File\n pwFile = File.open(passwd3File, 'w+')\n pwFile.puts ROOT_PW\n pwFile.puts ROOT_PW\n pwFile.puts ROOT_PW\n pwFile.close\n cmd = \"yus_add_user #{ROOT_USER} login org.oddb.RootUser <#{passwd3File}\"\n puts cmd\n exit 1 unless system(cmd) \n\n passwdFile=\"#{ENV['HOME']}/passwd2.tmp\"\n pwFile = File.open(passwdFile, 'w+')\n pwFile.puts ROOT_PW\n pwFile.close\n\n # yus_add_user #{ROOT_USER} login org.oddb.#{ROOT_USER} <#{passwdFile}\n setupUser = %(echo #{ROOT_PW} | yus_grant #{ROOT_USER} grant login \necho #{ROOT_PW} | yus_grant #{ROOT_USER} grant view \necho #{ROOT_PW} | yus_grant #{ROOT_USER} grant create \necho #{ROOT_PW} | yus_grant #{ROOT_USER} grant edit \necho #{ROOT_PW} | yus_grant #{ROOT_USER} grant credit \necho #{ROOT_PW} | yus_grant #{ROOT_USER} edit yus.entities \necho #{ROOT_PW} | yus_grant #{ROOT_USER} edit org.oddb.drugs \necho #{ROOT_PW} | yus_grant #{ROOT_USER} edit 'org.oddb.model.!company.*' \necho #{ROOT_PW} | yus_grant #{ROOT_USER} edit 'org.oddb.model.!sponsor.*' \necho #{ROOT_PW} | yus_grant #{ROOT_USER} edit 'org.oddb.model.!indication.*' \necho #{ROOT_PW} | yus_grant #{ROOT_USER} edit 'org.oddb.model.!galenic_group.*' \necho #{ROOT_PW} | yus_grant #{ROOT_USER} edit 'org.oddb.model.!address.*' \necho #{ROOT_PW} | yus_grant #{ROOT_USER} edit 'org.oddb.model.!atc_class.*' \necho #{ROOT_PW} | yus_grant #{ROOT_USER} create org.oddb.registration \necho #{ROOT_PW} | yus_grant #{ROOT_USER} create org.oddb.task.background \necho #{ROOT_PW} | yus_grant #{ROOT_USER} view org.oddb.patinfo_stats \necho #{ROOT_PW} | yus_grant #{ROOT_USER} credit org.oddb.download \n)\n\ncmdsForOtherUser = %(\necho #{ROOT_PW} | yus_add_user AdminUser login org.oddb.AdminUser \necho #{ROOT_PW} | yus_grant AdminUser edit org.oddb.drugs \necho #{ROOT_PW} | yus_grant AdminUser create org.oddb.registration \necho #{ROOT_PW} | yus_grant AdminUser edit 'org.oddb.model.!galenic_group.*' \necho #{ROOT_PW} | yus_add_user CompanyUser login org.oddb.CompanyUser \necho #{ROOT_PW} | yus_grant CompanyUser edit org.oddb.drugs \necho #{ROOT_PW} | yus_grant CompanyUser create org.oddb.registration \necho #{ROOT_PW} | yus_grant CompanyUser edit 'org.oddb.model.!galenic_group.*' \necho #{ROOT_PW} | yus_grant CompanyUser view org.oddb.patinfo_stats.associated \necho #{ROOT_PW} | yus_add_user PowerLinkUser login org.oddb.PowerLinkUser \necho #{ROOT_PW} | yus_grant PowerLinkUser edit org.oddb.drugs \necho #{ROOT_PW} | yus_grant PowerLinkUser edit org.oddb.powerlinks \necho #{ROOT_PW} | yus_add_user PowerUser login org.oddb.PowerUser \necho #{ROOT_PW} | yus_add_user DownloadUser \n)\n# FileUtils.rm_f(passwdFile, :verbose => true)\n\n setupUser.split(\"\\n\").each{\n |line|\n puts \"Running: \" + line\n res = system(line)\n unless res\n puts \"running '#{line}' failed res #{res.inspect}\"\n exit 1\n end\n }\nend",
"title": ""
},
{
"docid": "0321212c694bdfca4b32cfd16128bae6",
"score": "0.5204343",
"text": "def setup_auth\n if @new_resource.user \n target_update(\"node.session.auth.authmethod\", \"CHAP\")\n target_update(\"node.session.auth.username\", @new_resource.user)\n target_update(\"node.session.auth.password\", @new_resource.pass)\n else\n target_update(\"node.session.auth.authmethod\", \"None\") \n end\n end",
"title": ""
},
{
"docid": "eb82770f94cffe3e4145be111fbe8c18",
"score": "0.5177618",
"text": "def asignar_userc\n \n @fcomite = Fcomite.find(params[:fcomite_id])\n @comite_id = params[:comite_id]\n @nombres = params[:names]\n @emails = params[:emails]\n Usercomite.create(:nombre => @nombres, :emails => @emails,:comite_id => @comite_id)\n @comites = Comite.all\n redirect_to fcomite_comites_path(@fcomite.id)\n end",
"title": ""
},
{
"docid": "9f93a3dfbb4e5c14c41f14a82be0a4e7",
"score": "0.51772964",
"text": "def omnistack_user\n host = Net::Telnet.new(@connection)\n host.login('Name' => @options[:user], 'Password' => @options[:pswd], 'LoginPrompt' => /User Name:\\z/n)\n host.cmd('terminal datadump')\n res = host.cmd('show running-config')\n host.close\n res\n end",
"title": ""
},
{
"docid": "f8e909794682bb947d65fa09baf8085d",
"score": "0.51736504",
"text": "def login_initiate\n request(Codes::System::SET_BINARY_MODE)\n end",
"title": ""
},
{
"docid": "918db23f1703fbb0fdf5c711df9e0d9c",
"score": "0.5172626",
"text": "def activate!(params)\n self.active = true\n self.password = params[:user][:password]\n self.password_confirmation = params[:user][:password_confirmation]\n \n save\n end",
"title": ""
},
{
"docid": "bffbe1c6d6cda9489fead97d2c4a9bc9",
"score": "0.51599896",
"text": "def accionStatus(comando,usuariosLista,socketUsuario)\n orden=comando.split(\" \")\n status=orden[1]\n usr=buscaUsuarioPorSocket(usuariosLista,socketUsuario)\n if(usr == nil)\n return \"Debe identificarse primero con IDENTIFY -Username-\"\n elsif(status==nil)\n socketUsuario.puts \"Debe ingresar un estado (ACTIVE,AWAY,BUSY)\"\n elsif(status!=\"ACTIVE\" and status!=\"AWAY\" and status!=\"BUSY\")\n socketUsuario.puts \"Estado no valido\"\n socketUsuario.puts \"Debe ingresar un estado (ACTIVE,AWAY,BUSY)\"\n elsif (status == usr.status)\n socketUsuario.puts \"Su estado actual es ese\"\n else\n usr.setStatus(status)\n socketUsuario.puts \"Su estado a cambiado a #{usr.status}\"\n end\n end",
"title": ""
},
{
"docid": "cafc3cd507d5dafcb7c09bc81990f7ea",
"score": "0.51590115",
"text": "def make_userinstall \n end",
"title": ""
},
{
"docid": "2afee346966206401da8ee800f5fa287",
"score": "0.514745",
"text": "def accionInvite(comando,usuariosLista,socketUsuario)\n orden=comando.split(\" \")\n nombreSala=orden[1]\n sala=getSala(nombreSala)\n admin=buscaUsuarioPorSocket(usuariosLista,socketUsuario)\n usuariosChat=nil\n if(sala.respond_to? \"lista\")\n usuariosChat=sala.lista\n end\n if(sala == nil)\n socketUsuario.puts \"La sala #{nombreSala} no existe.\"\n elsif (usuariosChat[0].== admin)\n socketUsuario.puts \"No eres el dueño de la sala\"\n elsif (orden[2] == nil)\n socketUsuario.puts \"Debes escribir el nombre de un usuario conectado\"\n else\n i=2\n usuariosOff=\"Estos usuarios no se encontraron: \\n\"\n while i < orden.length\n usr=buscaUsuarioPorNombre(usuariosLista,orden[i])\n if(usr == nil)\n usuariosOff=usuariosOff+ \"#{orden[i]}\"\n else\n invitado=buscaUsuarioPorNombre(usuariosLista,orden[i])\n invitado.socket.puts \"#{usuariosChat[0].name} te a invitado a la sala [#{sala.name}]\"\n usuariosChat.push (orden[i])\n end\n i=i+1\n end\n if(\"Estos usuarios no se encontraron: \\n\" != usuariosOff)\n socketUsuario.puts usuariosOff\n end\n end\n end",
"title": ""
},
{
"docid": "34a2fb60eb1153c01e6a83fb8cd9891e",
"score": "0.51471585",
"text": "def reencriptar(nick, password)\n usuario = buscar(nick)\n # Reasigna Codificador\n usuario.codificador = @codificador_asignado\n usuario.password = @codificador_asignado.encriptar(password)\n end",
"title": ""
},
{
"docid": "7d198c45af1fec8c5e70ffbfc071f6fb",
"score": "0.5138723",
"text": "def temporarily_as_user(setenv:true, &procobj)\n return _set_uids(false, false, setenv:setenv, &procobj)\n end",
"title": ""
},
{
"docid": "530b995d005d82be6ccd9587ea873251",
"score": "0.5134474",
"text": "def consultarDoctorClave(clave) @db.consultarDoctorClave(clave) end",
"title": ""
},
{
"docid": "45622ede5563b53f88ff442b2deefa8d",
"score": "0.5129843",
"text": "def cmd_user(param)\n if enforce_secure_command_channel? && !command_channel_secure?\n send_response(\"521 This server enforces the use of AUTH TLS before log in\")\n else\n super\n end\n end",
"title": ""
},
{
"docid": "28ead7e99b89b0bb637f8612945ba3ec",
"score": "0.51225984",
"text": "def mobile_create\n logout_keeping_session!\n # 簡単ログインによる認証\n mobile_authentication\n end",
"title": ""
},
{
"docid": "608708df16eda92b5f945f0d0c074ff8",
"score": "0.5117943",
"text": "def crear_activacion_digest\n\t\t\tself.token_activacion = Usuario.nuevo_token\n\t\t\tself.activacion_digest = Usuario.digestion(token_activacion)\n\t\tend",
"title": ""
},
{
"docid": "0585f801696890a6185b3b2a8466d74a",
"score": "0.5112699",
"text": "def set_usuario\n\n if usuario_logado && user.cadastro_id == 1\n @usuario = Usuario.find(params[:id])\n else\n params[:id] = user.id\n @usuario = Usuario.find(params[:id])\n end\n \n end",
"title": ""
},
{
"docid": "b408df5088c86ec7eea830538e224ede",
"score": "0.51123",
"text": "def permisos_usuario_edit\n\n end",
"title": ""
},
{
"docid": "4e3ae377be1dfb79af74564908a61589",
"score": "0.51118976",
"text": "def utilisateur\n\n end",
"title": ""
},
{
"docid": "552c97d62f20bde7969cfba15d8f83be",
"score": "0.5109961",
"text": "def create\n usuario = User.find_by(correo: params[:correo])\n # if the user exists AND the password entered is correct\n if usuario && usuario.authenticate(params[:password])\n # save the user id inside the browser cookie. This is how we keep the user logged in when they navigate around our website.\n if usuario.activated?\n session[:user_id] = usuario.id\n #params[:remember_me] == '1' ? remember(usuario) : forget(usuario)\n #redirect_back_or usuario\n #flash[:alert] = \"Bienvenido has ingresado exitosamente.\"\n \n \n redirect_to '/inicio', flash: {notice: \"Bienvenido has ingresado exitosamente.\"}\n else\n message = \"Cuenta no activada. \"\n message += \"Revisa tu correo y has click en el link de activacion de tu cuenta.\"\n flash[:warning] = message\n \n redirect_to root_url\n end\n\n else\n flash[:notice] = \"Datos introducidos incorrectos.\"\n render 'new', notice: \"Datos introducidos incorrectos.\"\n\n end\n end",
"title": ""
},
{
"docid": "caa7e38cb21b58c332324852b16bd5fd",
"score": "0.5105653",
"text": "def accionJoinRoom(comando,usuariosLista,socketUsuario)\n orden=comando.split(\" \")\n nombreSala=orden[1]\n usuario=buscaUsuarioPorSocket(usuariosLista,socketUsuario)\n sala=getSala(nombreSala)\n salaLista=sala.lista\n if (sala == nil)\n socketUsuario.puts \"Esta sala no existe\"\n elsif (!salaLista.include?(usuario.name))\n socketUsuario.puts \"No fuiste invitado a la sala\"\n else\n salaLista.delete(usuario.name)\n accionIdentify(\"_ [#{nombreSala}]#{usuario.name}\",salaLista,socketUsuario)\n end\n end",
"title": ""
},
{
"docid": "1d9e079c57c4d81eb1b19a8d1245673f",
"score": "0.5103386",
"text": "def tour\n authenticate({:email => Nilavu::Constants::MEGAM_TOUR_EMAIL,\n :password => Nilavu::Constants::MEGAM_TOUR_PASSWORD})\n end",
"title": ""
},
{
"docid": "f9c53fc2613e500572c900069e0529b3",
"score": "0.5102993",
"text": "def confere_perfil\n\n if @usuario.perfis.empty? || @usuario.perfil_ids.include? Perfil::ALUNO\n # Se o usuario nao tiver perfil ou o perfil for de aluno, salva como aluno\n @usuario.cria_aluno\n elsif @usuario.perfil_ids.include? Perfil::PROFESSOR\n # Se o usuario for um professor, salva como professor\n @usuario.cria_professor(params[:avaliador])\n end\n\n end",
"title": ""
},
{
"docid": "57afb58434c3d9052d2185a2cc32b155",
"score": "0.51011825",
"text": "def trocar_senha\n @user = current_user\n @user.crypted_password = nil\n # se chegaram dados do form...\n if request.post?\n if (@user == User.authenticate(@user.email, params[:user][:old_password]))\n @user.password = params[:user][:password]\n @user.password_confirmation = params[:user][:password_confirmation]\n if @user.valid?\n @user.save\n flash[:notice] = \"Senha alterada com sucesso.\"\n redirect_to perfil_url(@user.id)\n else\n @user.password = nil\n @user.password_confirmation = nil\n end\n else\n @user.password = nil\n @user.password_confirmation = nil\n flash[:error] = \"Senha atual inválida.\"\n end\n end\n end",
"title": ""
},
{
"docid": "1d5d1fbb40ec247cb354442ee485d89f",
"score": "0.51006466",
"text": "def create\n use\n login('root', '')\n Cmd.new(\"devpi user -c '#{new_resource.name}' \\\n password='#{new_resource.password}'\").run_command\n logoff\n end",
"title": ""
},
{
"docid": "3c2512e6877a7f058820fbd96af71742",
"score": "0.5099955",
"text": "def provision(user, password, action)\n if action == \"user_add\"\n raise 'You entered an incorrect password' if !self.valid_passwd?\n end\n\n param_list = {\n 'uid' => user,\n 'homedirectory' => \"/home/#{user.each_char.first.downcase}/#{user.downcase}\",\n 'userpassword' => password\n }\n\n Rails.logger.debug \"provision() => Current fields: \" + @@fields[User.current.login].to_s\n\n param_list.merge!({ 'uidnumber' => self.namsid }) if self.namsid != nil\n param_list.merge!({ 'givenname' => User.current.firstname })\n param_list.merge!({ 'sn' => User.current.lastname })\n\n Rails.logger.debug param_list.to_s\n\n # Add the account to IPA\n begin\n r = CwaRest.client({\n :verb => :POST,\n :url => \"https://\" + Redmine::Cwa.ipa_server + \"/ipa/json\",\n :user => Redmine::Cwa.ipa_account,\n :password => Redmine::Cwa.ipa_password,\n :json => { 'method' => action, 'params' => [ [], param_list ] }\n })\n rescue Exception => e\n raise e.message\n end\n\n # Force password expiry update\n pwexp = `/var/lib/redmine/plugins/cwa/support/pwexpupdate.sh #{user}`\n if $?.success?\n Rails.logger.info \"User password expiry updated. \" + pwexp\n else\n Rails.logger.info \"Failed to update user password expiry! \" + pwexp\n end\n\n # TODO: parse out the details and return appropriate messages \n if r['error'] != nil\n raise r['error']['message']\n end\n\n # Let NAMS know this is now an RC.USF.EDU user\n begin \n r = CwaRest.client({\n :verb => :POST,\n :url => Redmine::Cwa.msg_url,\n :user => Redmine::Cwa.msg_user,\n :password => Redmine::Cwa.msg_password,\n :json => { \n 'apiVersion' => '1',\n 'createProg' => 'EDU:USF:RC:cwa',\n 'messageData' => {\n 'host' => 'rc.usf.edu',\n 'username' => User.current.login,\n 'accountStatus' => action == \"user_add\" ? 'active' : 'disabled',\n 'accountType' => 'Unix'\n }\n }\n })\n rescue Exception => e\n raise e.message\n end\n Rails.logger.debug r.to_s\n end",
"title": ""
},
{
"docid": "057f9a848ae3ea1c96b903e72e3bed30",
"score": "0.50954616",
"text": "def management_console_password; end",
"title": ""
},
{
"docid": "2853fbe18578ded1ffe18d977e820258",
"score": "0.50944084",
"text": "def provision_okta_user\n\n first = params[:firstname]\n last = params[:lastname]\n email = params[:username]\n pass = params[:password]\n\n # create new okta user\n okta_client = HTTPClient.new\n headers = {\"Authorization\" => \"SSWS #{ENV['OKTA_TOKEN']}\",\n \"Content-Type\" => \"application/json\",\n \"Accept\" => \"application/json\"}\n\n # create user in Okta\n uri = \"#{ENV['OKTA_DOMAIN']}/api/v1/users?activate=true\"\n userQuery = {}\n userQuery[:profile] = {'firstName' => first,\n 'lastName' => last,\n 'email' => email,\n 'login' => email,\n 'mobilePhone' => \"\"}\n userQuery[:credentials] = {'password' => pass}\n res = okta_client.post(uri, body: Oj.dump(userQuery), header: headers)\n json = Oj.load(res.body)\n\n # did we receive an error creating the okta user?\n if (!json['errorCode'].nil?)\n flash[:notice] = \"Error #{json['errorCauses'][0]['errorSummary']}\"\n else\n # create box app user\n box_user = Box.admin_client.create_user(email, is_platform_access_only: true)\n\n # store the box id in Okta as metadata\n uri = \"#{ENV['OKTA_DOMAIN']}/api/v1/users/#{json['id']}\"\n query = {}\n query[:profile] = {}\n query[:profile][:boxId] = box_user.id\n res = okta_client.post(uri, body: Oj.dump(query), header: headers)\n setup_box_account(email, box_user.id)\n send_grid(email, pass, first)\n flash[:notice] = \"Provisioned new account. Email sent to #{email}\"\n end\n\n redirect_to user_management_path\n end",
"title": ""
},
{
"docid": "27b658e20251ff58b51aa53fb1fcf1f2",
"score": "0.50941586",
"text": "def registrar_basico(nombre, password = 'p455w0rd')\n\t\tfill_in(\"nombre\", with: nombre)\n\t\tfill_in(\"Elige una contraseña con letras y números:\",with: password)\n\t\tfill_in(\"Repite la contraseña\", with: password)\n\n\t\tclick_on \"Crear perfil\"\n\tend",
"title": ""
},
{
"docid": "4f1a6cc4e2b5dab7204bbab534800c10",
"score": "0.50941527",
"text": "def activate!(params)\n self.active = true\n self.password = params[:user][:password]\n self.password_confirmation = params[:user][:password_confirmation]\n save\n end",
"title": ""
},
{
"docid": "2a7a3f7799eceb3d9e3ab42ea2bdc75a",
"score": "0.50899357",
"text": "def create\n @usuario = Usuario.new(usuario_params)\n if (current_user) #Quien lo está creando es un admin? -> el usuario que va a crear también lo es.\n @usuario.usuar_tipo_cod = 'A'\n end\n respond_to do |format|\n if @usuario.save\n if (current_user) #Ya esta dentro del sistema?\n else\n session[:usuarios_id] = @usuario.id #si no lo esta ingresarlo. \n end\n \n format.html { redirect_to @usuario, notice: 'Usuario creado con exito.' }\n format.json { render :show, status: :created, location: @usuario }\n else\n format.html { render :new }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "17c7b519b7fac55a055bb36e2992f50d",
"score": "0.5089896",
"text": "def set_user\n #User.user = session[:user_id]\n #User.password = session[:passwd]\n Api::Base.user = session[:user_id]\n Api::Base.password = session[:passwd]\n\n begin\n @user = User.find(current_user.username)\n rescue ActiveResource::ResourceNotFound\n flash[:error] = 'No user found'\n redirect_to users_path\n rescue ActiveResource::ResourceConflict, ActiveResource::ResourceInvalid\n redirect_to new_user_path\n end\n end",
"title": ""
},
{
"docid": "5c1d51111cf4f2fe5110fb4323f6349f",
"score": "0.50696206",
"text": "def passwd\n end",
"title": ""
},
{
"docid": "1f314256e7a20db65b41f806d1a8fbc2",
"score": "0.50585157",
"text": "def inicializar\n\t\t\n\t\t# 3 (usuario) Comum \n\t\tself.user_role_id ||= '3' \n\t\t\n\tend",
"title": ""
},
{
"docid": "e3d4be8aa3fed49a81a7dccb8141a07f",
"score": "0.50565416",
"text": "def set_usuariocompleto\n @usuariocompleto = Usuario.find(params[:id])\n end",
"title": ""
},
{
"docid": "c4289547419d12378290b05585ebd199",
"score": "0.5055544",
"text": "def comandos(comando,usuariosLista,socketUsuario)\n begin\n orden=comando.split(\" \")\n case orden[0]\n when \"HELP\"\n s=Instrucciones.new.instruccionesAyuda()\n socketUsuario.puts s\n when \"IDENTIFY\"\n accionIdentify(comando,usuariosLista,socketUsuario)\n when \"STATUS\"\n accionStatus(comando,usuariosLista,socketUsuario)\n when \"USERS\"\n accionUsers(usuariosLista,socketUsuario)\n when \"MESSAGE\"\n accionMessage(comando,usuariosLista,socketUsuario)\n when \"PUBLICMESSAGE\"\n accionPublicMessage(comando,usuariosLista,socketUsuario)\n when \"CREATEROOM\"\n accionCreateRoom(comando,usuariosLista,socketUsuario)\n when \"INVITE\"\n accionInvite(comando,usuariosLista,socketUsuario)\n when \"JOINROOM\"\n accionJoinRoom(comando,usuariosLista,socketUsuario)\n when \"ROOMESSAGE\"\n accionRoomMessage(comando,usuariosLista,socketUsuario)\n when \"DISCONNECT\"\n accionDisconnect(usuariosLista,socketUsuario)\n else\n socketUsuario.puts \"Comando no identificado, use HELP para mostrar los comandos\"\n end\n rescue IOError\n puts \"Un usuario se a desconectado\"\n end\n end",
"title": ""
},
{
"docid": "ad5bbe8a8c2e8be37991f5a889ff8f6c",
"score": "0.50529814",
"text": "def procesar\n if inactiva? then\n tomarInsumos\n elsif llena? then\n @estado = 'procesando'\n end\n\n if procesando? then\n if @cicloActual < @ciclosProcesamiento then\n @cicloActual = @cicloActual.succ\n else\n @cicloActual = 0\n @cantidadProducida = 0\n @cantidadProducida = @cantidadMaxima * (1 - @desecho)\n eliminarInsumos unless self.is_a? Silos_de_Cebada\n @estado = 'en espera'\n enviar\n end\n elsif en_espera? then\n if @siguiente.inactiva? then\n enviar\n end\n end\n end",
"title": ""
},
{
"docid": "1a360c9047852447880a9b540a5ac310",
"score": "0.50517017",
"text": "def auth_user!\n if ENV['TG_HOST_IDS']&.split(',')&.include?(from['id'].to_s)\n yield\n else\n respond_with :message, text: '喵鸣~ 我只接受铲屎哒的命令 (●・̆⍛・̆●) '\n end\n end",
"title": ""
},
{
"docid": "b6e8d503b0c0efd2b10b573428c9b9a8",
"score": "0.5049768",
"text": "def user!\n if conflict? # Aozora & Kitsu\n # Update the User's ao_id and status to mark them as needing reonboarding\n kitsu_user.update!(\n ao_id: aozora_user['_id'],\n ao_password: aozora_user['_hashed_password'],\n ao_facebook_id: aozora_user.dig('_auth_data_facebook', 'id'),\n status: :aozora\n )\n kitsu_user\n elsif aozora_user.present? # Aozora-only\n imported_aozora_user || import_aozora_user!\n else # Kitsu-Only\n kitsu_user\n end\n end",
"title": ""
},
{
"docid": "756f913b2b90b70dc7f63160cd22fcb5",
"score": "0.50435793",
"text": "def create_user\n @user_password = generate_password\n run \"useradd #{project_name} -p #{@user_password.crypt(project_name)} -s /bin/bash\"\n end",
"title": ""
},
{
"docid": "96c5530850bce4f6fcd5caa53ccbef10",
"score": "0.5040426",
"text": "def update_and_activate!(params)\n self.password = params[:password]\n self.password_confirmation = params[:password_confirmation]\n self.activate\n end",
"title": ""
},
{
"docid": "b43fef4cd6a793764a77bccea0cb8c24",
"score": "0.50370306",
"text": "def set_usuario\n if current_user.permissao != \"ADMINISTRADOR\"\n @usuario = User.da_empresa(current_user.empresa.id).find(params[:id])\n else\n @usuario = User.find(params[:id])\n end\n end",
"title": ""
},
{
"docid": "e89784bd25746be137038d8431c479b9",
"score": "0.50355554",
"text": "def enviar envio, usuario\n @envio = envio\n @menus = Menu.where(fecha: envio.desde.to_date..envio.hasta.to_date).order('fecha ASC')\n mail to: envio.email, bcc: usuario.email, from: usuario.email, subject: 'Envío de menús'\n end",
"title": ""
},
{
"docid": "c9de2e69803d0057f8331a933dbd6b10",
"score": "0.5033105",
"text": "def consultarPacienteClave(clave) @db.consultarPacienteClave(clave) end",
"title": ""
},
{
"docid": "43d6a0cfe129b3218896b73e0ed9d01f",
"score": "0.5031743",
"text": "def activate_invited\n # users who have logged in aren't asked to activate their account again\n # so we'll pretend \n if params[:user] and user = current_user\n user.sign_up\n user.attributes = params[:user]\n\n if user.remember_me\n current_user_session.remember_me = true \n user_session = current_user_session\n user_session.send :save_cookie\n end\n user.save and flash[:notice] = \"Welcome aboard, #{user}.\"\n Notifications.deliver_welcome user\n end\n if order_id = params[:order_id]\n redirect_to order_path(order_id)\n else\n redirect_to root_path\n end\n end",
"title": ""
},
{
"docid": "e6e4ee3bf3afb3fa0f186e1ac59f9bde",
"score": "0.50270015",
"text": "def grant; end",
"title": ""
},
{
"docid": "10189d0337a347a499d51eaeab2a6eb0",
"score": "0.50222296",
"text": "def do_omniauth\n begin\n aut_data = get_auth_data(request.env['omniauth.auth'], action_name)\n service = Service.find_by_provider_and_uid(aut_data[:provider], aut_data[:uid])\n\n\n if user_signed_in? # Если пользователь уже вошёл под EMail (Например)\n create_service_and_redirect(service, aut_data)\n return\n end\n\n unless service.nil?\n # Войти на основании найденного сервиса\n sign_in_and_redirect(service)\n return\n end\n\n session[:aut_data] = aut_data\n redirect_to service_sign_up_users_path # Переходим на ввод дополнительных параметров\n\n rescue Auth::OmniAuthBadProviderData, Auth::OmniAuthError => e\n flash[:error] = e.message\n redirect_to new_user_session_path\n end\n end",
"title": ""
},
{
"docid": "6b2702b557cce56351192b92094e539f",
"score": "0.50194746",
"text": "def update\n @user = Usuario.find(params[:id])\n @orgaos=Orgao.order(:sigla).collect{|o|[o.sigla,o.id]}\n if params[:usuario][:password].blank?\n params[:usuario].delete(:password)\n params[:usuario].delete(:password_confirmation)\n end\n\n respond_to do |format|\n if @user.update_attributes(params[:usuario])\n format.html { redirect_to(@user, :notice => \"Usuario #{@user.username} atualizado com sucesso.\") }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2597b8114117c339059ecb3e83f54e4f",
"score": "0.5018271",
"text": "def send_password_to_user(args = {}) \n put(\"/guestaccess.json/#{args[:guestId]}/sendpassword\", args)\nend",
"title": ""
},
{
"docid": "2597b8114117c339059ecb3e83f54e4f",
"score": "0.5018271",
"text": "def send_password_to_user(args = {}) \n put(\"/guestaccess.json/#{args[:guestId]}/sendpassword\", args)\nend",
"title": ""
},
{
"docid": "24e22cea0ad49a6d49d93e49830b1d99",
"score": "0.50154006",
"text": "def switch_user(name=nil)\n if name == nil && @switch_user_previous\n @@global.user = @switch_user_previous\n elsif @@global.user != name\n raise \"No root keypair defined for #{name}!\" unless has_keypair?(name)\n @@logger.puts \"Remote commands will be run as #{name} user\"\n @switch_user_previous = @@global.user\n @@global.user = name\n end\n end",
"title": ""
},
{
"docid": "812a5a7ff35bf568c60052bd45f0cce9",
"score": "0.50151396",
"text": "def create_engine_user\n\t\tusername = self.config[:mq_user]\n\t\tcurrent_users = self.get_current_userlist\n\n\t\tif current_users.include?( username )\n\t\t\tlog \"Excellent, we already have a #{username} user. Ensuring the password is correct.\"\n\t\t\trun self.rabbitmqctl, 'change_password', username, self.config[:mq_pass]\n\t\telse\n\t\t\trun self.rabbitmqctl, 'add_user', username, self.config[:mq_pass]\n\t\tend\n\n\t\tself.config.values_at( :players_vhost, :env_vhost ).each do |vhost|\n\t\t\tlog \" setting permissions for the %s vhost to: %p\" % [ vhost, '.*' ]\n\t\t\trun self.rabbitmqctl, 'set_permissions',\n\t\t\t\t'-p', vhost,\n\t\t\t\tusername, '.*', '.*', '.*'\n\t\tend\n\tend",
"title": ""
},
{
"docid": "e15010f091e2a8e362ef35e13c909112",
"score": "0.5014486",
"text": "def usuariopregao_params\n params.require(:usuariopregao).permit(:usuario, :pregoestitulo_id, :indicadorsetup_id, :checkpoint, :resultado, :flagfinalizado)\n end",
"title": ""
},
{
"docid": "f59348bc45e22ec5881176dcafd36546",
"score": "0.50095165",
"text": "def change_user_to_host\n self.host.update(host: true)\n end",
"title": ""
},
{
"docid": "df3de286abd5f2816c5312357ad67bac",
"score": "0.50075555",
"text": "def initialize(usuario)\n # Sin autenticación puede consultarse información geográfica \n can :read, [Sip::Pais, Sip::Departamento, Sip::Municipio, Sip::Clase]\n if !usuario || usuario.fechadeshabilitacion\n return\n end\n can :contar, Sivel2Gen::Caso\n can :contar, Sip::Ubicacion\n can :buscar, Sivel2Gen::Caso\n can :lista, Sivel2Gen::Caso\n can :descarga_anexo, Sip::Anexo\n can :nuevo, Sivel2Sjr::Desplazamiento\n can :nuevo, Sivel2Sjr::Respuesta\n can :nuevo, Sip::Ubicacion\n can :nuevo, Sivel2Gen::Presponsable\n can :nuevo, Sivel2Gen::Victima\n if !usuario.nil? && !usuario.rol.nil? then\n case usuario.rol \n when Ability::ROLSIST\n can :read, Sivel2Gen::Caso, casosjr: { oficina_id: usuario.oficina_id }\n can [:update, :create, :destroy], Sivel2Gen::Caso, \n casosjr: { asesor: usuario.id, oficina_id:usuario.oficina_id }\n can [:read, :new], Cor1440Gen::Actividad\n can :new, Sivel2Gen::Caso \n can [:update, :create, :destroy], Cor1440Gen::Actividad, \n oficina: { id: usuario.oficina_id}\n can :manage, Sivel2Gen::Acto\n can :manage, Sip::Persona\n when Ability::ROLANALI\n can :read, Sivel2Gen::Caso\n can :new, Sivel2Gen::Caso\n can [:update, :create, :destroy], Sivel2Gen::Caso, \n casosjr: { oficina_id: usuario.oficina_id }\n can :read, Cor1440Gen::Informe\n can :read, Cor1440Gen::Actividad\n can :new, Cor1440Gen::Actividad\n can [:update, :create, :destroy], Cor1440Gen::Actividad, \n oficina: { id: usuario.oficina_id}\n can :manage, Sivel2Gen::Acto\n can :manage, Sip::Persona\n when Ability::ROLCOOR\n can :read, Sivel2Gen::Caso\n can :new, Sivel2Gen::Caso\n can [:update, :create, :destroy, :poneretcomp], Sivel2Gen::Caso, \n casosjr: { oficina_id: usuario.oficina_id }\n can :manage, Cor1440Gen::Informe\n can :read, Cor1440Gen::Actividad\n can :new, Cor1440Gen::Actividad\n can [:update, :create, :destroy], Cor1440Gen::Actividad, \n oficina: { id: usuario.oficina_id}\n can :manage, Sivel2Gen::Acto\n can :manage, Sip::Persona\n can :new, Usuario\n can [:read, :manage], Usuario, oficina: { id: usuario.oficina_id}\n when Ability::ROLINV\n cannot :buscar, Sivel2Gen::Caso\n can :read, Sivel2Gen::Caso \n when Ability::ROLADMIN, Ability::ROLDIR\n can :manage, Sivel2Gen::Caso\n can :manage, Cor1440Gen::Actividad\n can :manage, Cor1440Gen::Informe\n can :manage, Sivel2Gen::Acto\n can :manage, Sip::Persona\n can :manage, Usuario\n can :manage, :tablasbasicas\n @@tablasbasicas.each do |t|\n c = Ability.tb_clase(t)\n can :manage, c\n end\n end\n end\n end",
"title": ""
},
{
"docid": "368ff743771b8406983afd951a317c07",
"score": "0.5006857",
"text": "def verificar_autenticado\n\n if params[:controller] != 'users' && params[:action] != 'cadastrar'\n\n end\n\n\n if action_name == 'login'\n autenticar_usuario\n end\n\n if action_name == 'logout'\n session.delete(:user)\n\n # Se o usuário não estiver logado, então redireciona para a tela de login\n elsif session[:user].nil?\n respond_to do |format|\n\n if params[:action] == 'login'\n format.html {redirect_to '/', notice: \"Nome de usuário ou senha inválida\"}\n else\n format.html {render '/users/login'}\n end\n end\n\n # Se o usuário estiver logado\n elsif !session[:user].nil?\n\n # E se a id do usuário for nula\n # TODO Revisar essa parte para não precisar setar se é como string ou como chave\n if session[:user][\"id\"].nil?\n usuario_atual = session[:user][:id]\n elsif session[:user][:id].nil?\n usuario_atual = session[:user][\"id\"]\n end\n\n # Se o perfil do usuário for diferente de Administrador e o nome do controlador que tiver acessando for diferente\n # de condominio\n if session[:user][\"perfil\"] != 'Administrador' && controller_name != 'condominios'\n\n # Abre o dashboard\n return dashboard_system_index_path\n else\n\n if Modulo.where(\"users_id = #{usuario_atual} and modulo_nome = '#{controller_name.singularize}'\").size == 0\n if session[:user][\"perfil\"] != 'Administrador' && session[:user].nil?\n respond_to do |format|\n format.html {render :template => \"users/login\"}\n end\n end\n end\n end\n end\n\n\n end",
"title": ""
},
{
"docid": "551d8ba2f0c29ee064cd5dcff40c5873",
"score": "0.50061053",
"text": "def menu_escuela\n @user = User.find(params[:id])\n @escuela = @user.escuela if @user\n @diagnostico = Diagnostico.find_by_user_id(@user.id) if @user\n @proyecto = Proyecto.find_by_diagnostico_id(@diagnostico.id) if @diagnostico\n \n end",
"title": ""
},
{
"docid": "e9f5d7a41462ad5052c997d4ef62ddda",
"score": "0.4997983",
"text": "def refresh_from_env\n if ENV['projectnimbus_account_key'] || ENV['projectnimbus_unique_user_id']\n @credentialsets['projectnimbus'] ||= {}\n @credentialsets['projectnimbus'].merge!({'AccountKey'=> ENV['projectnimbus_account_key']}) if ENV['projectnimbus_account_key']\n @credentialsets['projectnimbus'].merge!({'UniqueUserID'=> ENV['projectnimbus_unique_user_id']}) if ENV['projectnimbus_unique_user_id']\n end\n if ENV['rgovdata_username'] || ENV['rgovdata_password']\n @credentialsets['basic'] ||= {}\n @credentialsets['basic'].merge!({'username'=> ENV['rgovdata_username']}) if ENV['rgovdata_username']\n @credentialsets['basic'].merge!({'password'=> ENV['rgovdata_password']}) if ENV['rgovdata_password']\n end\n end",
"title": ""
},
{
"docid": "9d1bd497dde4b363bfec08603f6e1503",
"score": "0.49959576",
"text": "def sucesso\n \n end",
"title": ""
},
{
"docid": "9a6a8bf66282a8b4a05a9832ed362f8b",
"score": "0.49955407",
"text": "def sign_in(usuario)\n cookies.permanent[:remember_token] = usuario.remember_token\n #Current User accesible en la vista y los controladores\n self.current_user = usuario\n end",
"title": ""
},
{
"docid": "8e9fbf346b8fc183c8cf2f08cb03c6c4",
"score": "0.49954376",
"text": "def user_params\n params.permit( :email, :primer_nombre, :segundo_nombre, :primer_apellido, :segundo_apellido )\n end",
"title": ""
}
] |
15b3c16715595195e7ad8b0c4bd94669
|
Relative right xcoordinate of the bounding box. (Equal to the box width) Example, position some text 3 pts from the right of the containing box: draw_text('hello', :at => [(bounds.right 3), 0])
|
[
{
"docid": "83d3cc30ab19d89ceb48762e1deef232",
"score": "0.5822345",
"text": "def right\n @width\n end",
"title": ""
}
] |
[
{
"docid": "6c60af0de351e18a0a34dd7c6ce26854",
"score": "0.73517346",
"text": "def absolute_right\n @x + width\n end",
"title": ""
},
{
"docid": "6e47ccae4f3f500dc34db929d53f1b0b",
"score": "0.7190032",
"text": "def right\n `#{client_rect}.right` + Window.scroll_x\n end",
"title": ""
},
{
"docid": "c526bdea22fddcf7161fb95d8ef7f5bd",
"score": "0.69928557",
"text": "def right_x\n self.x - self.ox + self.width;\n end",
"title": ""
},
{
"docid": "8ef69d977209636dc06a914f169b55fd",
"score": "0.6887522",
"text": "def right\n Vedeu::Geometry::Position.new(y, x + 1)\n end",
"title": ""
},
{
"docid": "56dc7355ae194729cd0bdfb1eb07f320",
"score": "0.6861295",
"text": "def right_x\n x_px + w_px\n end",
"title": ""
},
{
"docid": "fe29a061c10efdbc1449ff6e0762c90b",
"score": "0.67879725",
"text": "def right\n Vedeu::Geometries::Position.new(y, x + 1)\n end",
"title": ""
},
{
"docid": "5d4a55f102b1880c5edb9cf4571f7059",
"score": "0.6649275",
"text": "def right_corner\n self.x + self.width;\n end",
"title": ""
},
{
"docid": "f7bdc132b008c1eaf1b76f668c7912cd",
"score": "0.66296",
"text": "def getRight\n return @x + @width\n end",
"title": ""
},
{
"docid": "736a364bdd336e2fd682d33e023cea07",
"score": "0.6611795",
"text": "def getRightBound()\n return @board_start_x + @board_width\n end",
"title": ""
},
{
"docid": "ac4bf80ac824f230dbc2415ba4ad3b86",
"score": "0.65583414",
"text": "def move_right\n if xn + 1 > Vedeu.width\n dx = x\n dxn = xn\n else\n dx = x + 1\n dxn = xn + 1\n end\n\n @attributes = attributes.merge(\n centred: false,\n maximised: false,\n x: dx,\n xn: dxn,\n y: y,\n yn: yn,\n )\n Vedeu::Geometry::Geometry.new(@attributes).store\n end",
"title": ""
},
{
"docid": "70050032c9f26757fa746a1ca52c5ec1",
"score": "0.6551818",
"text": "def right\n x + width\n end",
"title": ""
},
{
"docid": "596d3a2e8f63f49dbb62d0ab59b264c2",
"score": "0.6490176",
"text": "def right\n ((@node[:position] + 1) % @width).zero? ? nil : @node[:position] + 1\n end",
"title": ""
},
{
"docid": "364de93b1861c637ce990b88047a8d20",
"score": "0.6397927",
"text": "def right_side\n absolute_right\n end",
"title": ""
},
{
"docid": "7f3d9c41ad5a0e065985a561da8f98b6",
"score": "0.639608",
"text": "def bottomRight\n CGPointMake(right, bottom)\n end",
"title": ""
},
{
"docid": "5dc007ce68f627046e42dd7b3c9f0a99",
"score": "0.6390755",
"text": "def right\n @center.x + @half_dimension\n end",
"title": ""
},
{
"docid": "5b037bdf4ffa4c66462d3421f01022eb",
"score": "0.63329434",
"text": "def topRight\n CGPointMake(right, top)\n end",
"title": ""
},
{
"docid": "029ee52ad99872f087f5c151a2c0603d",
"score": "0.6327171",
"text": "def bounds_margin_right\n page.dimensions[2] - bounds.absolute_right\n end",
"title": ""
},
{
"docid": "ca0f049d0afdad83f6094b4a5daf701d",
"score": "0.63054186",
"text": "def right()\n return @left + @width\n end",
"title": ""
},
{
"docid": "7153f343746a520f787d6309073380d1",
"score": "0.62906736",
"text": "def bounds_margin_right\n page.dimensions[2] - bounds.absolute_right\n end",
"title": ""
},
{
"docid": "5dc48553edd8a755d1e016c1979278b4",
"score": "0.6198462",
"text": "def boxed_text\n left, right = x_boundaries\n super(to_s, right - left - 2 * (margin + padding))\n end",
"title": ""
},
{
"docid": "bc3a67a70111f0c9801916755f269089",
"score": "0.6189784",
"text": "def move_right\n # Shift x position right by 2\n @position[:x] += 2\n\n # Reset x position if the new position isnt valid\n @position[:x] -= 2 unless is_valid_position?\n end",
"title": ""
},
{
"docid": "90b2af0c6585b29c6d3712c8935a1e60",
"score": "0.61667496",
"text": "def inner_x\n @side == :left ? @x+width : @x-width\n end",
"title": ""
},
{
"docid": "bd06b427cd0b28e2021fbac9c0bedf02",
"score": "0.61336106",
"text": "def width\n bounds.right\n end",
"title": ""
},
{
"docid": "4fa959751e3396a2209d5aa3d62f70be",
"score": "0.6107191",
"text": "def right\n left + width\n end",
"title": ""
},
{
"docid": "de94d4c1507696b22ab9a286793b664c",
"score": "0.6100312",
"text": "def pos_x\n x + @font.text_width(text[0...caret_pos])\n end",
"title": ""
},
{
"docid": "1471b429271808b32b1c9e3e11e12781",
"score": "0.6052183",
"text": "def bounds_margin_left\n bounds.absolute_left\n end",
"title": ""
},
{
"docid": "b142003ed3eea6098af66d0fb4e45d1d",
"score": "0.6035608",
"text": "def bottom_righti(offset=nil) bottom_right(offset) end",
"title": ""
},
{
"docid": "796eb8b78d941eda051b35f851a9f484",
"score": "0.602887",
"text": "def right_edge\n @x + @width - 1\n end",
"title": ""
},
{
"docid": "314490c2f204e315551a2c187d5313ee",
"score": "0.60148835",
"text": "def end_x\n return @side%2 == 0 ? @viewport.width + 10 : -10\n end",
"title": ""
},
{
"docid": "47b9662e3f1205818350750c72a108d7",
"score": "0.6001819",
"text": "def bounds_margin_left\n bounds.absolute_left\n end",
"title": ""
},
{
"docid": "ad7f48ede99f496316c3e0296e6d430f",
"score": "0.59824866",
"text": "def centerRight\n CGPointMake(right, centerY)\n end",
"title": ""
},
{
"docid": "903a5fd686d04e30cf340f0ee3d44f73",
"score": "0.59743565",
"text": "def right_side\n columns_from_right = @columns - (1 + @current_column)\n absolute_right - (width_of_column * columns_from_right)\n end",
"title": ""
},
{
"docid": "3d279f05bf988dcbfab225ef67aebd87",
"score": "0.59720355",
"text": "def text_x\n text_input_rect.x + @line_x[@current_line]\n end",
"title": ""
},
{
"docid": "0eeadc8caf96642d12656a5fb1399178",
"score": "0.595703",
"text": "def bottom_righti(offset=nil) top_right(offset) end",
"title": ""
},
{
"docid": "cc692d6043e60ec20c0614566888a8bb",
"score": "0.59399503",
"text": "def left\n `#{client_rect}.left` + Window.scroll_x\n end",
"title": ""
},
{
"docid": "99881b67cb99c7b2731980e693cc7901",
"score": "0.59237695",
"text": "def right_of(i)\n if i >= @visible_msb\n @fig_left\n elsif i >= @visible_lsb\n @fig_left + @cell_width * (@visible_msb - i)\n elsif i >= 0\n @fig_left + @cell_width * (@visible_msb - @visible_lsb)\n else\n @fig_left + @cell_width * (@visible_msb - @visible_lsb - i + 1)\n end\n end",
"title": ""
},
{
"docid": "60500d598a8fb8955bd7176acdc7acb3",
"score": "0.592228",
"text": "def right; move_cursor(1); end",
"title": ""
},
{
"docid": "60500d598a8fb8955bd7176acdc7acb3",
"score": "0.592228",
"text": "def right; move_cursor(1); end",
"title": ""
},
{
"docid": "6e818c93f00f7f99165c76a07439d834",
"score": "0.5908034",
"text": "def fully_right_of(rect)\n @top_left.x > rect.bottom_right.x\n end",
"title": ""
},
{
"docid": "83b72b1d19460c83316e49cc06394967",
"score": "0.59067607",
"text": "def right\n Point.new(@x + 1, @y)\n end",
"title": ""
},
{
"docid": "03f979478da1c4cd4cf7104c3e8b5f1b",
"score": "0.589953",
"text": "def move_right\n @ox += 1\n @x = coordinate(ox, :x).x\n\n store_and_refresh\n end",
"title": ""
},
{
"docid": "beca539a735ee7456611fabccf840555",
"score": "0.5885459",
"text": "def cursor_x\n # x is \"0\" if cursor position at 0\n return -self.src_rect.x if !self.cursor_can_move_left?\n # find cursor position from text left from it\n display_text = get_display_text.scan(/./m)[0, @cursor_position].join\n return self.bitmap.text_size(display_text).width - self.src_rect.x\n end",
"title": ""
},
{
"docid": "826f9443cbf9d44fbc819a236262ac01",
"score": "0.58840686",
"text": "def move_right\n return self if xn + 1 > Vedeu.width\n\n move(x: x + 1, xn: xn + 1)\n end",
"title": ""
},
{
"docid": "9c9e67b36834880a65363524ac6670df",
"score": "0.5878023",
"text": "def bottom_right\n Point[@x + width, @y + height]\n end",
"title": ""
},
{
"docid": "d6267ff03463fc567c5600d2d50e8841",
"score": "0.58486015",
"text": "def absolute_left\n @x\n end",
"title": ""
},
{
"docid": "e26dbb468ea458703e62c640381c5f37",
"score": "0.5835615",
"text": "def item_rect_for_text(index)\n rect = item_rect(index)\n rect.x += 4\n rect.width -= 8\n rect\n end",
"title": ""
},
{
"docid": "fa50135e775093173ee83fd33b0d29e9",
"score": "0.5833037",
"text": "def rel_x\n return x - Graphics.width/2\n end",
"title": ""
},
{
"docid": "e6516a29d32f58df1915cf4326d0290f",
"score": "0.58311737",
"text": "def right\n @right ||= left + width\n end",
"title": ""
},
{
"docid": "b2a35c6006bb9ce64c56da5b2be423c5",
"score": "0.5827447",
"text": "def cursor_right(n = 1)\n cn = [ @chars.length - @idx, n ].min\n\n\t\tif @idx < @chars.length\n\t\t\t@idx += cn\n\t\t\treturn CHAR_RIGHT * cn\n\t\tend\n \"\"\n\tend",
"title": ""
},
{
"docid": "f55fe81f2372c73eba1092bf64a4da59",
"score": "0.5818667",
"text": "def upper_right\n if defined?(@upper_right)\n @upper_right\n else\n cs = self.envelope.exterior_ring.coord_seq\n @upper_right = Geos::wkt_reader_singleton.read(\"POINT(#{cs.get_x(2)} #{cs.get_y(2)})\")\n end\n end",
"title": ""
},
{
"docid": "f55fe81f2372c73eba1092bf64a4da59",
"score": "0.5818667",
"text": "def upper_right\n if defined?(@upper_right)\n @upper_right\n else\n cs = self.envelope.exterior_ring.coord_seq\n @upper_right = Geos::wkt_reader_singleton.read(\"POINT(#{cs.get_x(2)} #{cs.get_y(2)})\")\n end\n end",
"title": ""
},
{
"docid": "c665a46b78b0f3846e530e6fe90df398",
"score": "0.58090913",
"text": "def right(offset=1)\n @position += offset\n end",
"title": ""
},
{
"docid": "0c467bae369b30e3d2fa6babd39786ac",
"score": "0.57917905",
"text": "def item_rect_for_text(index)\r\n rect = item_rect(index)\r\n rect.x += 4\r\n rect.width -= 8\r\n rect\r\n end",
"title": ""
},
{
"docid": "1780fba14031e27a164ac86f300bf1c7",
"score": "0.5777712",
"text": "def right\n @right ||= left + width\n end",
"title": ""
},
{
"docid": "98996baaba78861df5e0dc1107e39e39",
"score": "0.5771639",
"text": "def move_right\n @ox += 1\n\n @attributes = attributes.merge!(x: coordinate.x_position,\n y: y,\n ox: ox,\n oy: oy)\n\n Vedeu::Cursors::Cursor.new(@attributes).store\n end",
"title": ""
},
{
"docid": "5090342a20180ba24d101cac96681e73",
"score": "0.5761745",
"text": "def move_right!\n @posy += 1\n end",
"title": ""
},
{
"docid": "32bc894ab5160d871a6d99d751c47465",
"score": "0.5749836",
"text": "def bottom_right\n [@right, @bottom].point\n end",
"title": ""
},
{
"docid": "5bf01d1e8dd4883a65a23bfe55ba850f",
"score": "0.5745392",
"text": "def rightx\n return 0.0 if AMS::IS_PLATFORM_WINDOWS && !AMS::Sketchup.is_main_window_active?\n v = AMS::Keyboard.key('right') - AMS::Keyboard.key('left')\n return v.to_f if v != 0\n v = MSPhysics::Simulation.instance.joystick_data['rightx']\n v ? v : 0.0\n end",
"title": ""
},
{
"docid": "137666a41163079acf023ca7a5d03d5d",
"score": "0.5742101",
"text": "def draw_text_positions(*args)\r\n if (r = args[0]).is_a?(Rect)\r\n x, y, w, h, t = r.x, r.y, r.width, r.height, args[1]\r\n a = args.size == 3 ? args[2] : 0\r\n else\r\n x, y, w, h, t = args[0], args[1], args[2], args[3], args[4]\r\n a = args.size == 6 ? args[5] : 0\r\n end\r\n return x, y, w, h, t, a\r\n end",
"title": ""
},
{
"docid": "1a482ef1d52ecd021c5e3458e5a4503c",
"score": "0.5729345",
"text": "def bottom_right\n @place = \"lrt\"\n self\n end",
"title": ""
},
{
"docid": "790a984bad016e17d437943a12d509ee",
"score": "0.57140666",
"text": "def scroll_right(distance)\n @display_x = [@display_x + distance, (self.width - 20) * 128].min\n end",
"title": ""
},
{
"docid": "790a984bad016e17d437943a12d509ee",
"score": "0.57140666",
"text": "def scroll_right(distance)\n @display_x = [@display_x + distance, (self.width - 20) * 128].min\n end",
"title": ""
},
{
"docid": "790a984bad016e17d437943a12d509ee",
"score": "0.57140666",
"text": "def scroll_right(distance)\n @display_x = [@display_x + distance, (self.width - 20) * 128].min\n end",
"title": ""
},
{
"docid": "b118ffda3f866fd19d51dfef4a0c60ec",
"score": "0.5708012",
"text": "def left\n Vedeu::Geometry::Position.new(y, x - 1)\n end",
"title": ""
},
{
"docid": "8898186ea32e6a61c562dab0dec9e317",
"score": "0.57048965",
"text": "def right\n if placed?\n self.current_position = Position.new({x: current_position.x,\n y: current_position.y,\n direction: current_position.direction_right})\n else\n \"Please place your robot first!\"\n end\n end",
"title": ""
},
{
"docid": "77bbf1659bf167d6d542fd7d6ce7f0e9",
"score": "0.5686549",
"text": "def flow_bounding_box left = 0, opts = {}\n original_y = self.y\n # QUESTION should preserving original_x be an option?\n original_x = bounds.absolute_left - margin_box.absolute_left\n canvas do\n bounding_box [margin_box.absolute_left + original_x + left, margin_box.absolute_top], opts do\n self.y = original_y\n yield\n end\n end\n end",
"title": ""
},
{
"docid": "fc4e7aa50d3aa45a161ff2024547e9dd",
"score": "0.5675335",
"text": "def left\n if centred\n Terminal.centre_x - (width / 2)\n\n else\n x\n\n end\n end",
"title": ""
},
{
"docid": "c7c042451dc5a83d7a62a51ae1295c5a",
"score": "0.56735194",
"text": "def rightx\n if RUBY_PLATFORM =~ /mswin|mingw/i\n v = AMS::Sketchup.is_main_window_active? ? AMS::Keyboard.key('right') - AMS::Keyboard.key('left') : 0\n return v.to_f if v != 0\n end\n v2 = MSPhysics::Simulation.instance.joystick_data['rightx']\n v2 ? v2 : 0.0\n end",
"title": ""
},
{
"docid": "6891c74da797301209d8a791cc3298a6",
"score": "0.56669396",
"text": "def get_x\n if DEBUG_COORDS\n logger.debug \"get_x(), %s %s ## %s\" % [get_class(), get_id(), get_unique_id()]\n end\n x = 0\n if @use_uiautomator\n x = @attributes['bounds'][0][0]\n else\n begin\n if @attributes.has_key?(GET_VISIBILITY_PROPERTY) and @attributes[GET_VISIBILITY_PROPERTY] == 'VISIBLIE'\n left = @attributes[@left_property].to_i\n x += left\n if DEBUG_COORDS\n logger.debug \"get_x(), VISIBLE adding #{left}\"\n end\n end\n end\n end\n if DEBUG_COORDS\n logger.debug \"get_x() return #{x}\"\n end\n return x\n end",
"title": ""
},
{
"docid": "0fad8495472cd8e65676b6e994fc33a0",
"score": "0.56656325",
"text": "def right\n string.rjust(width, pad)\n end",
"title": ""
},
{
"docid": "38899619d8bdefd72a2b13bc4ed713ba",
"score": "0.5664175",
"text": "def redraw_left\n return 0 unless element_left\n element_left - width * 0.5 - style[:strokewidth].to_i\n end",
"title": ""
},
{
"docid": "d7f4463068e57def696de9bbca96a929",
"score": "0.5663572",
"text": "def lower_right\n if defined?(@lower_right)\n @lower_right\n else\n cs = self.envelope.exterior_ring.coord_seq\n @lower_right = Geos::wkt_reader_singleton.read(\"POINT(#{cs.get_x(1)} #{cs.get_y(1)})\")\n end\n end",
"title": ""
},
{
"docid": "d7f4463068e57def696de9bbca96a929",
"score": "0.5663572",
"text": "def lower_right\n if defined?(@lower_right)\n @lower_right\n else\n cs = self.envelope.exterior_ring.coord_seq\n @lower_right = Geos::wkt_reader_singleton.read(\"POINT(#{cs.get_x(1)} #{cs.get_y(1)})\")\n end\n end",
"title": ""
},
{
"docid": "7aded9d2a1332a6c49c57cd49901b67d",
"score": "0.56583166",
"text": "def alignRight\n puts \"align to right\"\n my_window = @window.frame.size\n left_align = OSX::NSRect.new(@screen.width - my_window.width, @screen.height - my_window.height, my_window.width, my_window.height)\n @window.setFrame_display_animate(left_align, true, true)\n \n isight = @scanner.iSightWindow.frame.size\n is_left_align = OSX::NSRect.new(@screen.width - isight.width, 0, isight.width, isight.height)\n @scanner.iSightWindow.setFrame_display_animate(is_left_align, true, false);\n end",
"title": ""
},
{
"docid": "0b9ff8b734a757fef44e5874d0064b12",
"score": "0.56579673",
"text": "def right\n @place = \"rt\"\n self\n end",
"title": ""
},
{
"docid": "30f2e2829105649f3d11bf4515dfcc10",
"score": "0.56508166",
"text": "def racquetLeft(racquet)\n #the racquet won't go left if it is out of bounds\n if (racquet - 3) > 0\n print \"\\e[#{SCREEN_Y};#{racquet-2}H\"\n print \"=\" *RACQUET_SIZE\n print SC_H \n racquet=racquet-1\n else\n racquet\n end\nend",
"title": ""
},
{
"docid": "06666ceaf5960ecc48505bf85664a925",
"score": "0.5644408",
"text": "def left\n Vedeu::Geometries::Position.new(y, x - 1)\n end",
"title": ""
},
{
"docid": "c181ef356661cc4d3c2a1fa2d3486fa6",
"score": "0.5642608",
"text": "def cursor_right(wrap)\n if @index % 10 < 9\n @index += 1\n elsif wrap\n @index -= 9\n end\n end",
"title": ""
},
{
"docid": "c181ef356661cc4d3c2a1fa2d3486fa6",
"score": "0.5642608",
"text": "def cursor_right(wrap)\n if @index % 10 < 9\n @index += 1\n elsif wrap\n @index -= 9\n end\n end",
"title": ""
},
{
"docid": "ea1c4271bcc2f2c4db79df1e7f17ba9e",
"score": "0.5630189",
"text": "def move_right\n @box.x += @x_vel\n @box.y += @y_vel\n end",
"title": ""
},
{
"docid": "ad9e5ce39888a786431bc413864ef55a",
"score": "0.5628456",
"text": "def align_right(*args)\n Align.align_right(*args)\n end",
"title": ""
},
{
"docid": "d1449f8acd711b7e7394ce873e5472c1",
"score": "0.5624446",
"text": "def write_right(line, text, opt={})\n buffer = (@columns-text.size)\n write_line(line, text, opt.merge({:start=>buffer}))\n end",
"title": ""
},
{
"docid": "7fa985032b5cbe2f5a8d6ec06bf94e23",
"score": "0.5621706",
"text": "def cursor_right(wrap)\r\n if @index % 10 < 9\r\n @index += 1\r\n elsif wrap\r\n @index -= 9\r\n end\r\n end",
"title": ""
},
{
"docid": "73f9c6b646a99678c98ad12aacd07650",
"score": "0.5617084",
"text": "def right\n if_placed do\n location.rotate_cw\n end\n end",
"title": ""
},
{
"docid": "81f23d8c548cc1bd4ea01e709fe1f49e",
"score": "0.56026053",
"text": "def left\n Coordinates.new(x-1, y)\n end",
"title": ""
},
{
"docid": "77d217f390992f34ea563f8e9c23099b",
"score": "0.55999607",
"text": "def move_right\n @shape.body.apply_force -(@shape.body.a.radians_to_vec2*100),\n CP::Vec2.new(0.0, 0.0)\n end",
"title": ""
},
{
"docid": "58d2fcd2c42c39f9e1a1ec89a43d509c",
"score": "0.55856675",
"text": "def move_right\n @position[0] += 1\n end",
"title": ""
},
{
"docid": "84752e9b222bb4313881b65cd5546f3a",
"score": "0.55848145",
"text": "def bottomLeft\n CGPointMake(left, bottom)\n end",
"title": ""
},
{
"docid": "8e2130c213d9bbe6d8730a63f8d36e4d",
"score": "0.5573177",
"text": "def close_right\n smooth_move(Graphics.width, self.y);\n end",
"title": ""
},
{
"docid": "5be286d9bf7f7f5200b6f244de2f5d69",
"score": "0.55668914",
"text": "def edges_text(left_aligned_text, right_aligned_text)\n y = cursor\n text left_aligned_text, :align => :left\n move_cursor_to y\n text right_aligned_text, :align => :right\n end",
"title": ""
},
{
"docid": "55873c343f013eadc10611d8420e95b0",
"score": "0.55640656",
"text": "def right\n return if cursor.position.x + 1 > @content.length\n @cursor.advance\n end",
"title": ""
},
{
"docid": "fbd55efcbaaa9d385a5847fe44dcb40d",
"score": "0.5544138",
"text": "def cursor_x\r\n contents_width - cursor_width - 4\r\n end",
"title": ""
},
{
"docid": "dab4b3ff5bc4b06de57e1f92710574a2",
"score": "0.55390865",
"text": "def get_absolute_rect(index = self.index)\n rect = item_rect(index)\n rect.x += self.x + self.padding - self.ox\n rect.y += self.y + self.padding - self.oy\n rect\n end",
"title": ""
},
{
"docid": "aeaf706825a46703e4b0d6f72733662f",
"score": "0.552925",
"text": "def right\n move(0, 1)\n end",
"title": ""
},
{
"docid": "aeaf706825a46703e4b0d6f72733662f",
"score": "0.552925",
"text": "def right\n move(0, 1)\n end",
"title": ""
},
{
"docid": "8a391f241c58d88ac32b6f92fbcd6493",
"score": "0.5528861",
"text": "def margin_left= length\n self.move_text_pos(-self.get_current_text_pos[0] + length.to_points.to_f, 0)\n end",
"title": ""
},
{
"docid": "f32adae0eb69a5d823f5f1ba4d19aa32",
"score": "0.5500072",
"text": "def move_cursor_to_required_coordinates(text)\n x = (@size[1] - text.length) / 2\n y = (@size[0]) / 2\n print @cursor.move_to(x, y)\n end",
"title": ""
},
{
"docid": "e7f3dd84f6513942d7459d755b5e04a7",
"score": "0.54936343",
"text": "def moveRight\n if @x\n call Screen.setColor(@x)\n call Screen.drawRectangle(@x, @y, @x, @y)\n let @x = @x\n call Screen.setColor(@x)\n call Screen.drawRectangle(@x, @y, @x, @y)\n end\n end",
"title": ""
},
{
"docid": "c627d945d99266240a252e6ea2bec389",
"score": "0.5486628",
"text": "def right_side\n right = self.width + self.x\n @states.each_value do |state|\n right = state.x if state.x < right\n end\n right\n end",
"title": ""
},
{
"docid": "bfcaacec0751e6c9132d453ab1eee3cd",
"score": "0.5476941",
"text": "def border_right()\n return get_border(:right)\n end",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2
|
Use callbacks to share common setup or constraints between actions.
|
[
{
"docid": "568106d992a6dbc73d3be8ee4c321df2",
"score": "0.0",
"text": "def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"title": ""
}
] |
[
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60339177",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.60135007",
"text": "def on_setup_callbacks; end",
"title": ""
},
{
"docid": "311e95e92009c313c8afd74317018994",
"score": "0.59219855",
"text": "def setup_actions\n domain = @apps.domain\n path_user = '/a/feeds/'+domain+'/user/2.0'\n path_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n path_email_list = '/a/feeds/'+domain+'/emailList/2.0'\n path_group = '/a/feeds/group/2.0/'+domain\n\n @apps.register_action(:domain_login, {:method => 'POST', :path => '/accounts/ClientLogin' })\n @apps.register_action(:user_create, { :method => 'POST', :path => path_user })\n @apps.register_action(:user_retrieve, { :method => 'GET', :path => path_user+'/' })\n @apps.register_action(:user_retrieve_all, { :method => 'GET', :path => path_user })\n @apps.register_action(:user_update, { :method => 'PUT', :path => path_user +'/' })\n @apps.register_action(:user_delete, { :method => 'DELETE', :path => path_user +'/' })\n @apps.register_action(:nickname_create, { :method => 'POST', :path =>path_nickname })\n @apps.register_action(:nickname_retrieve, { :method => 'GET', :path =>path_nickname+'/' })\n @apps.register_action(:nickname_retrieve_all_for_user, { :method => 'GET', :path =>path_nickname+'?username=' })\n @apps.register_action(:nickname_retrieve_all_in_domain, { :method => 'GET', :path =>path_nickname })\n @apps.register_action(:nickname_delete, { :method => 'DELETE', :path =>path_nickname+'/' })\n @apps.register_action(:group_create, { :method => 'POST', :path => path_group })\n @apps.register_action(:group_update, { :method => 'PUT', :path => path_group })\n @apps.register_action(:group_retrieve, { :method => 'GET', :path => path_group })\n @apps.register_action(:group_delete, { :method => 'DELETE', :path => path_group })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>'' })\n end",
"title": ""
},
{
"docid": "8315debee821f8bfc9718d31b654d2de",
"score": "0.5913137",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "8315debee821f8bfc9718d31b654d2de",
"score": "0.5913137",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "bfea4d21895187a799525503ef403d16",
"score": "0.589884",
"text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5890051",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5890051",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5890051",
"text": "def actions; end",
"title": ""
},
{
"docid": "352de4abc4d2d9a1df203735ef5f0b86",
"score": "0.5889191",
"text": "def required_action\n # TODO: implement\n end",
"title": ""
},
{
"docid": "8713cb2364ff3f2018b0d52ab32dbf37",
"score": "0.58780754",
"text": "def define_action_helpers\n if action == :save\n if super(:create_or_update)\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n else\n super\n end\n end",
"title": ""
},
{
"docid": "a80b33627067efa06c6204bee0f5890e",
"score": "0.5863248",
"text": "def actions\n\n end",
"title": ""
},
{
"docid": "930a930e57ae15f432a627a277647f2e",
"score": "0.58094144",
"text": "def setup_actions\n domain = @apps.domain\n path_base = '/a/feeds/emailsettings/2.0/'+domain+'/'\n\n @apps.register_action(:create_label, {:method => 'POST', :path => path_base })\n @apps.register_action(:create_filter, { :method => 'POST', :path => path_base })\n @apps.register_action(:create_send_as, { :method => 'POST', :path => path_base })\n @apps.register_action(:update_webclip, { :method => 'PUT', :path => path_base })\n @apps.register_action(:update_forward, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_pop, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_imap, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_vacation, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_signature, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_language, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_general, { :method => 'PUT', :path =>path_base })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>nil })\n end",
"title": ""
},
{
"docid": "33ff963edc7c4c98d1b90e341e7c5d61",
"score": "0.57375425",
"text": "def setup\n common_setup\n end",
"title": ""
},
{
"docid": "a5ca4679d7b3eab70d3386a5dbaf27e1",
"score": "0.57285565",
"text": "def perform_setup\n end",
"title": ""
},
{
"docid": "ec7554018a9b404d942fc0a910ed95d9",
"score": "0.57149214",
"text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5703237",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "c85b0efcd2c46a181a229078d8efb4de",
"score": "0.56900954",
"text": "def custom_setup\n\n end",
"title": ""
},
{
"docid": "100180fa74cf156333d506496717f587",
"score": "0.56665677",
"text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend",
"title": ""
},
{
"docid": "2198a9876a6ec535e7dcf0fd476b092f",
"score": "0.5651118",
"text": "def initial_action; end",
"title": ""
},
{
"docid": "b9b75a9e2eab9d7629c38782c0f3b40b",
"score": "0.5648135",
"text": "def setup_intent; end",
"title": ""
},
{
"docid": "471d64903a08e207b57689c9fbae0cf9",
"score": "0.56357735",
"text": "def setup_controllers &proc\n @global_setup = proc\n self\n end",
"title": ""
},
{
"docid": "468d85305e6de5748477545f889925a7",
"score": "0.5627078",
"text": "def inner_action; end",
"title": ""
},
{
"docid": "bb445e7cc46faa4197184b08218d1c6d",
"score": "0.5608873",
"text": "def pre_action\n # Override this if necessary.\n end",
"title": ""
},
{
"docid": "432f1678bb85edabcf1f6d7150009703",
"score": "0.5598699",
"text": "def target_callbacks() = commands",
"title": ""
},
{
"docid": "48804b0fa534b64e7885b90cf11bff31",
"score": "0.5598419",
"text": "def execute_callbacks; end",
"title": ""
},
{
"docid": "5aab98e3f069a87e5ebe77b170eab5b9",
"score": "0.5589822",
"text": "def api_action!(*args)\n type = self.class.name.split(\"::\").last.downcase\n run_callbacks_for([\"before_#{type}\", :before], *args)\n result = nil\n begin\n result = yield if block_given?\n run_callbacks_for([\"after_#{type}\", :after], *args)\n result\n rescue => err\n run_callbacks_for([\"failed_#{type}\", :failed], *(args + [err]))\n raise\n end\n end",
"title": ""
},
{
"docid": "9efbca664902d80a451ef6cff0334fe2",
"score": "0.5558845",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "9efbca664902d80a451ef6cff0334fe2",
"score": "0.5558845",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "482481e8cf2720193f1cdcf32ad1c31c",
"score": "0.55084664",
"text": "def required_keys(action)\n\n end",
"title": ""
},
{
"docid": "353fd7d7cf28caafe16d2234bfbd3d16",
"score": "0.5504379",
"text": "def assign_default_callbacks(action_name, is_member=false)\n if ResourceController::DEFAULT_ACTIONS.include?(action_name)\n DefaultActions.send(action_name, self)\n elsif is_member\n send(action_name).build { load_object }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => object }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { render :xml => object.errors }\n else\n send(action_name).build { load_collection }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => collection }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { head 500 }\n end\n end",
"title": ""
},
{
"docid": "dcf95c552669536111d95309d8f4aafd",
"score": "0.5465574",
"text": "def layout_actions\n \n end",
"title": ""
},
{
"docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40",
"score": "0.5464707",
"text": "def on_setup(&block); end",
"title": ""
},
{
"docid": "8ab2a5ea108f779c746016b6f4a7c4a8",
"score": "0.54471064",
"text": "def testCase_001\n test_case_title # fw3_actions.rb\n setup # fw3_global_methods.rb\n \n get_page_url # fw3_actions.rb\n validate_page_title # fw3_actions.rb\n validate_page_link_set # fw3_actions.rb\n \n teardown # fw3_global_methods.rb\nend",
"title": ""
},
{
"docid": "e3aadf41537d03bd18cf63a3653e05aa",
"score": "0.54455084",
"text": "def before(action)\n invoke_callbacks *options_for(action).before\n end",
"title": ""
},
{
"docid": "6bd37bc223849096c6ea81aeb34c207e",
"score": "0.5437386",
"text": "def post_setup\n end",
"title": ""
},
{
"docid": "07fd9aded4aa07cbbba2a60fda726efe",
"score": "0.54160327",
"text": "def testCase_001\n testTitle # fw2_actions.rb\n setup # fw2_global_methods.rb\n get_page_url # fw2_actions.rb\n validate_title # fw2_actions.rb\n teardown # fw2_global_methods.rb\nend",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411113",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411113",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "9358208395c0869021020ae39071eccd",
"score": "0.5397424",
"text": "def post_setup; end",
"title": ""
},
{
"docid": "cb5bad618fb39e01c8ba64257531d610",
"score": "0.5392518",
"text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5391541",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5391541",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "a468b256a999961df3957e843fd9bdf4",
"score": "0.5385411",
"text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end",
"title": ""
},
{
"docid": "f099a8475f369ce73a38d665b6ee6877",
"score": "0.53794575",
"text": "def action_run\n end",
"title": ""
},
{
"docid": "2c4e5a90aa8efaaa3ed953818a9b30d2",
"score": "0.5357573",
"text": "def execute(setup)\n @action.call(setup)\n end",
"title": ""
},
{
"docid": "118932433a8cfef23bb8a921745d6d37",
"score": "0.53487605",
"text": "def register_action(action); end",
"title": ""
},
{
"docid": "725216eb875e8fa116cd55eac7917421",
"score": "0.5346655",
"text": "def setup\n @controller.setup\n end",
"title": ""
},
{
"docid": "39c39d6fe940796aadbeaef0ce1c360b",
"score": "0.53448105",
"text": "def setup_phase; end",
"title": ""
},
{
"docid": "bd03e961c8be41f20d057972c496018c",
"score": "0.5342072",
"text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end",
"title": ""
},
{
"docid": "c6352e6eaf17cda8c9d2763f0fbfd99d",
"score": "0.5341318",
"text": "def initial_action=(_arg0); end",
"title": ""
},
{
"docid": "207a668c9bce9906f5ec79b75b4d8ad7",
"score": "0.53243506",
"text": "def before_setup\n\n end",
"title": ""
},
{
"docid": "669ee5153c4dc8ee81ff32c4cefdd088",
"score": "0.53025913",
"text": "def ensure_before_and_after; end",
"title": ""
},
{
"docid": "c77ece7b01773fb7f9f9c0f1e8c70332",
"score": "0.5283114",
"text": "def setup!\n adding_handlers do\n check_arity\n apply_casting\n check_validation\n end\n end",
"title": ""
},
{
"docid": "1e1e48767a7ac23eb33df770784fec61",
"score": "0.5282289",
"text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"title": ""
},
{
"docid": "4ad1208a9b6d80ab0dd5dccf8157af63",
"score": "0.52585614",
"text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end",
"title": ""
},
{
"docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7",
"score": "0.52571374",
"text": "def define_callbacks(*args)\n if abstract_class\n all_shards.each do |model|\n model.define_callbacks(*args)\n end\n end\n\n super\n end",
"title": ""
},
{
"docid": "fc88422a7a885bac1df28883547362a7",
"score": "0.52483684",
"text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end",
"title": ""
},
{
"docid": "8945e9135e140a6ae6db8d7c3490a645",
"score": "0.5244467",
"text": "def action_awareness\n if action_aware?\n if !@options.key?(:allow_nil)\n if @required\n @allow_nil = false\n else\n @allow_nil = true\n end\n end\n if as_action != \"create\"\n @required = false\n end\n end\n end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "7b3954deb2995cf68646c7333c15087b",
"score": "0.5236853",
"text": "def after_setup\n end",
"title": ""
},
{
"docid": "1dddf3ac307b09142d0ad9ebc9c4dba9",
"score": "0.52330637",
"text": "def external_action\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "5772d1543808c2752c186db7ce2c2ad5",
"score": "0.52300817",
"text": "def actions(state:)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "64a6d16e05dd7087024d5170f58dfeae",
"score": "0.522413",
"text": "def setup_actions(domain)\n\t\t\tpath_user = '/a/feeds/'+domain+'/user/2.0'\n\t\t\tpath_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n\t\t\tpath_group = '/a/feeds/group/2.0/'+domain # path for Google groups\n\n\t\t\taction = Hash.new\n\t\t\taction[:domain_login] = {:method => 'POST', :path => '/accounts/ClientLogin' }\n\t\t\taction[:user_create] = { :method => 'POST', :path => path_user }\n\t\t\taction[:user_retrieve] = { :method => 'GET', :path => path_user+'/' }\n\t\t\taction[:user_retrieve_all] = { :method => 'GET', :path => path_user } \n\t\t\taction[:user_update] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_rename] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_delete] = { :method => 'DELETE', :path => path_user +'/' }\n\t\t\taction[:nickname_create] = { :method => 'POST', :path =>path_nickname }\n\t\t\taction[:nickname_retrieve] = { :method => 'GET', :path =>path_nickname+'/' }\n\t\t\taction[:nickname_retrieve_all_for_user] = { :method => 'GET', :path =>path_nickname+'?username=' }\n\t\t\taction[:nickname_retrieve_all_in_domain] = { :method => 'GET', :path =>path_nickname }\n\t\t\taction[:nickname_delete] = { :method => 'DELETE', :path =>path_nickname+'/' }\n\t\t\taction[:group_create] = { :method => 'POST', :path =>path_group }\n\t\t\taction[:group_update] = { :method => 'PUT', :path =>path_group+'/' }\n\t\t\taction[:group_delete] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:groups_retrieve] = { :method => 'GET', :path =>path_group+'?member=' }\n\t\t\taction[:all_groups_retrieve] = { :method => 'GET', :path =>path_group }\n\t\t\taction[:membership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:membership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:membership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_members_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:ownership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:ownership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:ownership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_owners_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\n\t\t\t# special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n\t\t\taction[:next] = {:method => 'GET', :path =>nil }\n\t\t\treturn action \t\n\t\tend",
"title": ""
},
{
"docid": "6350959a62aa797b89a21eacb3200e75",
"score": "0.52226824",
"text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"title": ""
},
{
"docid": "db0cb7d7727f626ba2dca5bc72cea5a6",
"score": "0.521999",
"text": "def process_params\n set_params_authable if process_params_authable?\n set_params_ownerable if process_params_ownerable?\n set_params_sub_action\n end",
"title": ""
},
{
"docid": "8d7ed2ff3920c2016c75f4f9d8b5a870",
"score": "0.5215832",
"text": "def pick_action; end",
"title": ""
},
{
"docid": "7bbfb366d2ee170c855b1d0141bfc2a3",
"score": "0.5213786",
"text": "def proceed_with(action, *arguments)\n self.class.decouplings.each do |decoupler|\n decoupler.run_on(self, action, *arguments)\n end\n end",
"title": ""
},
{
"docid": "78ecc6a2dfbf08166a7a1360bc9c35ef",
"score": "0.52100146",
"text": "def define_action_helpers\n if action_hook\n @action_hook_defined = true\n define_action_hook\n end\n end",
"title": ""
},
{
"docid": "2aba2d3187e01346918a6557230603c7",
"score": "0.52085197",
"text": "def ac_action(&blk)\n @action = blk\n end",
"title": ""
},
{
"docid": "4c23552739b40c7886414af61210d31c",
"score": "0.5203262",
"text": "def execute_pre_setup_actions(test_instance,runner=nil)\n self.class.pre_setup_actions.each do |action|\n action.call test_instance\n end\n end",
"title": ""
},
{
"docid": "691d5a5bcefbef8c08db61094691627c",
"score": "0.5202406",
"text": "def performed(action)\n end",
"title": ""
},
{
"docid": "6a98e12d6f15af80f63556fcdd01e472",
"score": "0.520174",
"text": "def perform_setup\n ## Run global setup before example\n Alfred.configuration.setup.each do |setup|\n @request.perform_setup(&setup)\n end\n\n ## Run setup blocks for scenario\n setups.each { |setup| @request.perform_setup(&setup) }\n end",
"title": ""
},
{
"docid": "d56f4ec734e3f3bc1ad913b36ff86130",
"score": "0.5201504",
"text": "def create_setup\n \n end",
"title": ""
},
{
"docid": "ad33138fb4bd42d9785a8f84821bfd88",
"score": "0.51963276",
"text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"title": ""
},
{
"docid": "ad33138fb4bd42d9785a8f84821bfd88",
"score": "0.51963276",
"text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"title": ""
},
{
"docid": "7fca702f2da4dbdc9b39e5107a2ab87d",
"score": "0.5191404",
"text": "def add_transition_callbacks\n %w(before after).each {|type| owner_class.define_callbacks(\"#{type}_transition_#{attribute}\") }\n end",
"title": ""
},
{
"docid": "063b82c93b47d702ef6bddadb6f0c76e",
"score": "0.5178325",
"text": "def setup(instance)\n action(:setup, instance)\n end",
"title": ""
},
{
"docid": "9f1f73ee40d23f6b808bb3fbbf6af931",
"score": "0.51765746",
"text": "def setup( *args )\n\t\t\tself.class.setupMethods.each {|sblock|\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\tend",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51710224",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51710224",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51710224",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "7a0c9d839516dc9d0014e160b6e625a8",
"score": "0.5162045",
"text": "def setup(request)\n end",
"title": ""
},
{
"docid": "e441ee807f2820bf3655ff2b7cf397fc",
"score": "0.5150735",
"text": "def after_setup; end",
"title": ""
},
{
"docid": "1d375c9be726f822b2eb9e2a652f91f6",
"score": "0.5143402",
"text": "def before *actions, &proc\n actions = ['*'] if actions.size == 0\n actions.each { |a| @callbacks[:a][a] = proc }\n end",
"title": ""
},
{
"docid": "c594a0d7b6ae00511d223b0533636c9c",
"score": "0.51415485",
"text": "def code_action_provider; end",
"title": ""
},
{
"docid": "faddd70d9fef5c9cd1f0d4e673e408b9",
"score": "0.51398855",
"text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"title": ""
},
{
"docid": "2fcff037e3c18a5eb8d964f8f0a62ebe",
"score": "0.51376045",
"text": "def setup(params)\n end",
"title": ""
},
{
"docid": "111fd47abd953b35a427ff0b098a800a",
"score": "0.51318985",
"text": "def setup\n make_notification_owner\n load_superusers\n admin_sets.each do |as|\n @logger.debug \"Attempting to make admin set for #{as}\"\n make_admin_set_from_config(as)\n end\n load_workflows\n everyone_can_deposit_everywhere\n give_superusers_superpowers\n end",
"title": ""
},
{
"docid": "f2ac709e70364fce188bb24e414340ea",
"score": "0.5115387",
"text": "def setup_defaults\n add_help\n @handler = Cliqr::Util.forward_to_help_handler if @handler.nil? && help? && actions?\n @actions.each(&:setup_defaults)\n end",
"title": ""
},
{
"docid": "3b4fb29fa45f95d436fd3a8987f12de7",
"score": "0.5111866",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110294",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110294",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110294",
"text": "def action\n end",
"title": ""
},
{
"docid": "4c7a1503a86fb26f1e4b4111925949a2",
"score": "0.5109771",
"text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end",
"title": ""
},
{
"docid": "63849e121dcfb8a1b963f040d0fe3c28",
"score": "0.5107364",
"text": "def perform_action(action, item)\n if action == :approve\n approve(item.fullid)\n elsif action == :remove\n remove(item.fullid)\n elsif action == :alert\n #perform_alert() check condition alert params and proceed\n else\n #something isn't cool, pass or error \n end\nend",
"title": ""
},
{
"docid": "f04fd745d027fc758dac7a4ca6440871",
"score": "0.5106081",
"text": "def block_actions options ; end",
"title": ""
},
{
"docid": "0d1c87e5cf08313c959963934383f5ae",
"score": "0.51001656",
"text": "def on_action(action)\n @action = action\n self\n end",
"title": ""
},
{
"docid": "916d3c71d3a5db831a5910448835ad82",
"score": "0.50964546",
"text": "def do_action(action)\n case action\n when \"a\"\n @user_manager.create_user\n when \"b\"\n @user_manager.delete_user\n when \"c\"\n @user_manager.get_info\n when \"d\"\n @user_manager.list_all_users\n when \"quit\", \"exit\"\n bail\n end\n end",
"title": ""
},
{
"docid": "076c761e1e84b581a65903c7c253aa62",
"score": "0.5093199",
"text": "def add_callbacks(base); end",
"title": ""
}
] |
0af764cf9f02f766a96d26c35f4e9a58
|
Subject can be set in your I18n file at config/locales/en.yml with the following lookup: en.request_notifier.new.subject
|
[
{
"docid": "d9fa38fc841bf30cfc1c9bef785e71b5",
"score": "0.0",
"text": "def new(request)\n @request = request\n mail to: \"makcyxa-k@yandex.ru\", subject: 'Новая заявка на курсы'\n end",
"title": ""
}
] |
[
{
"docid": "8928fe4f050d7ebd3e9aa992b07e320a",
"score": "0.7627524",
"text": "def subject_for\n ActiveSupport::Deprecation.warn \"subject_for\"\n I18n.t(:\"subject\", scope: [:notifications, :mailer],\n default: [:subject])\n end",
"title": ""
},
{
"docid": "ea740e704e8f1173fb87b45dfcaaf989",
"score": "0.72713643",
"text": "def subject_for(key)\n I18n.t(:subject, scope: [:mailer, key])\n end",
"title": ""
},
{
"docid": "75e4ae88ce617fd153e0a7564934bd04",
"score": "0.7057538",
"text": "def default_subject\n DEFAULT_SUBJECT\n end",
"title": ""
},
{
"docid": "c4a674d85e621eef1f1b8d2584c5ccf4",
"score": "0.68948853",
"text": "def subject\n I18n.t('flowdock.inbox_message.subject', message_type: I18n.t(\"flowdock.inbox_message.type.#{@type}\"), store_name: current_store.name)\n end",
"title": ""
},
{
"docid": "0057005be13d2471732baf09ab7f3e03",
"score": "0.6864566",
"text": "def subject\n \"[#{I18n.t('app_name')} #{Rails.env.upcase}] #{message.subject}\"\n end",
"title": ""
},
{
"docid": "65bc93ce070dc297b0749b44e859fbe2",
"score": "0.67867166",
"text": "def default_i18n_subject(interpolations = {})\n I18n.t(:subject, interpolations.merge(i18n_default_params))\n end",
"title": ""
},
{
"docid": "542885bb44aabef24a05ce9d9749449c",
"score": "0.67627704",
"text": "def subject_for(key)\n I18n.t(:\"#{devise_mapping.name}_subject\", scope: [:devise, :mailer, key],\n default: [:subject, key.to_s.humanize])\n end",
"title": ""
},
{
"docid": "20e4267b6397ef5409d8d48a8cdac18d",
"score": "0.67119306",
"text": "def add_default_subject\n self.subject = 'IMPORTANT!!!'\n end",
"title": ""
},
{
"docid": "c99eda28be9b3fe1f10546bb5e4340fb",
"score": "0.6631891",
"text": "def digest_email_subject(digest_group = nil)\n if digest_group\n translate_path = \"digest_notifier.#{digest_group.i18n_name_space}.email_subjsct\"\n \"#{DigestNotifier.app_name} #{I18n::t(translate_path, :default => 'todays updates')}\"\n else\n \"#{DigestNotifier.app_name} #{I18n::t('digest_notifier.email_subject', :default => 'todays updates')}\"\n end\n end",
"title": ""
},
{
"docid": "dc7d12811f6d234ea98ad06ca7ef51d8",
"score": "0.66038084",
"text": "def default_i18n_subject(interpolations = {}) # :doc:\n mailer_scope = self.class.mailer_name.tr(\"/\", \".\")\n I18n.t(:subject, **interpolations.merge(scope: [mailer_scope, action_name], default: action_name.humanize))\n end",
"title": ""
},
{
"docid": "a88f0f72dc91909c2d67b95574182c34",
"score": "0.65897775",
"text": "def subject\n @msg['Subject']\n end",
"title": ""
},
{
"docid": "a88f0f72dc91909c2d67b95574182c34",
"score": "0.65897775",
"text": "def subject\n @msg['Subject']\n end",
"title": ""
},
{
"docid": "1ed364e3ab9abb0823f0d98e397e066d",
"score": "0.6554425",
"text": "def email_subject_request\n # XXX pull out this general_register_office specialisation\n # into some sort of separate jurisdiction dependent file\n if self.public_body.url_name == 'general_register_office'\n # without GQ in the subject, you just get an auto response\n _('{{law_used_full}} request GQ - {{title}}',:law_used_full=>self.law_used_full,:title=>self.title)\n else\n _('{{law_used_full}} request - {{title}}',:law_used_full=>self.law_used_full,:title=>self.title)\n end\n end",
"title": ""
},
{
"docid": "23eff6c61a6c900432383b9130c65add",
"score": "0.6523832",
"text": "def subject=(value)\n @subject = value\n end",
"title": ""
},
{
"docid": "d2f26cb27e81ae8b03fd141a0f231955",
"score": "0.6513046",
"text": "def subject=(subject); @message_impl.setSubject subject; end",
"title": ""
},
{
"docid": "01df34cad757e9ffe18fd8399921934c",
"score": "0.6491882",
"text": "def subject\n @config[\"subject\"]\n end",
"title": ""
},
{
"docid": "6e74d38982d77ab2d4f1247a232115b0",
"score": "0.6479352",
"text": "def subject=(value)\n @subject = value\n end",
"title": ""
},
{
"docid": "09fd44300aaaa367f6fa38dd31fcbb56",
"score": "0.6416693",
"text": "def subject=(value)\n @subject = value\n end",
"title": ""
},
{
"docid": "09fd44300aaaa367f6fa38dd31fcbb56",
"score": "0.6416693",
"text": "def subject=(value)\n @subject = value\n end",
"title": ""
},
{
"docid": "09fd44300aaaa367f6fa38dd31fcbb56",
"score": "0.6416693",
"text": "def subject=(value)\n @subject = value\n end",
"title": ""
},
{
"docid": "09fd44300aaaa367f6fa38dd31fcbb56",
"score": "0.6416693",
"text": "def subject=(value)\n @subject = value\n end",
"title": ""
},
{
"docid": "09fd44300aaaa367f6fa38dd31fcbb56",
"score": "0.6416693",
"text": "def subject=(value)\n @subject = value\n end",
"title": ""
},
{
"docid": "09fd44300aaaa367f6fa38dd31fcbb56",
"score": "0.6416693",
"text": "def subject=(value)\n @subject = value\n end",
"title": ""
},
{
"docid": "09fd44300aaaa367f6fa38dd31fcbb56",
"score": "0.6416693",
"text": "def subject=(value)\n @subject = value\n end",
"title": ""
},
{
"docid": "6140e73ee355af7cdcaa1bec13316266",
"score": "0.64105",
"text": "def subject\n @subject ||= @email.subject.to_s\n end",
"title": ""
},
{
"docid": "01135c890b85dbc9c9f897f87df4fe98",
"score": "0.63651395",
"text": "def subject=(s)\n raise ArgumentError, \"subject must be a String, or respond to to_s\" unless s.is_a?(String) or s.respond_to?(\"to_s\")\n\n @alert.subject = s\n end",
"title": ""
},
{
"docid": "d7d5a9a0a42ea8916b34a3e34963e03c",
"score": "0.633887",
"text": "def generate_subject\n hostname = get_nagios_var(\"NAGIOS_HOSTNAME\")\n service_desc = get_nagios_var(\"NAGIOS_SERVICEDESC\")\n notification_type = get_nagios_var(\"NAGIOS_NOTIFICATIONTYPE\")\n state = get_nagios_var(\"NAGIOS_#{@state_type}STATE\")\n\n subject=\"#{hostname}\"\n subject += \"/#{service_desc}\" if service_desc != \"\"\n\n if @state_type == \"SERVICE\"\n long_subject=\"#{notification_type} Service #{subject} is #{state}\"\n else\n long_subject=\"#{notification_type} Host #{subject} is #{state}\"\n end\n\n @content[:subject] = long_subject\n @content[:short_subject] = \"\"\n end",
"title": ""
},
{
"docid": "086f3cabbe22eb51f456ff15266621f2",
"score": "0.6320935",
"text": "def subject=(s)\n msg = Message.new\n msg.subject = s\n send(msg)\n end",
"title": ""
},
{
"docid": "acf6d147f72804aba88819156ef816a8",
"score": "0.63069916",
"text": "def subject=(subject)\n @subject=subject\n end",
"title": ""
},
{
"docid": "00b6a5821d086aac53df53d687eee6bd",
"score": "0.6286907",
"text": "def subject=(subject)\n Cproton.pn_message_set_subject(@impl, subject)\n end",
"title": ""
},
{
"docid": "cb3903bb72c279531d812f561910449a",
"score": "0.62836057",
"text": "def email_changed(record, opts = {})\n opts[:subject] = \"#{default_title}: #{t(:email_changed)}\"\n super\n end",
"title": ""
},
{
"docid": "25da83c993ce4cf1f7b9941e027ed63a",
"score": "0.6274167",
"text": "def subject\n email_message.subject\n end",
"title": ""
},
{
"docid": "dc0e2948b8652d7848b464a5ec15a020",
"score": "0.62740135",
"text": "def subject(string)\n self << \"SUBJECT\" << string\n end",
"title": ""
},
{
"docid": "fa33adbf1eecc39bcd457b78590d6d3f",
"score": "0.62424195",
"text": "def subject=(s)\n\t\t@subject = s\n\tend",
"title": ""
},
{
"docid": "8e5e8a32e59042d47143922abe60d271",
"score": "0.62336725",
"text": "def get_subject(params = {}, alternate_text = '')\n\n # set the subject to the default if nothing else better comes along\n subject = alternate_text\n\n # we have to guard against templates not being loaded\n if @notification_template && @notification_template.subject\n subj_template = Liquid::Template.parse(@notification_template.subject) rescue nil\n subject = subj_template.render({'params' => params})\n end\n subject\n end",
"title": ""
},
{
"docid": "98da9102c01851fa213c08ba869b9856",
"score": "0.62278694",
"text": "def subject=(subject)\n @subject = subject\n end",
"title": ""
},
{
"docid": "8a5f0f8f2669885dc872baa7143b45c7",
"score": "0.62217283",
"text": "def subject_label=(label)\n @subject_label = label\n @subject_label_customized = true\n end",
"title": ""
},
{
"docid": "3595e96093bf4fdb3c90ed70810c54bc",
"score": "0.6213454",
"text": "def subject(string)\n return add_params(SUBJECT, string)\n end",
"title": ""
},
{
"docid": "cf2a25634b64117bc458dafa8c7f8602",
"score": "0.62046087",
"text": "def subject=(s)\n self.cached_alert_group = nil\n attribute_set(:subject, s)\n end",
"title": ""
},
{
"docid": "04d66d37c2ce274a1ec268fbe6d36c6e",
"score": "0.6197995",
"text": "def set_default_subject\n self.subject = self.default_subject\n end",
"title": ""
},
{
"docid": "dfa4ecb662f4081560f4e222e22056ef",
"score": "0.6129457",
"text": "def define_subject(subject)\n if subject =~ /^Re: /\n subject\n else\n \"Re: #{subject}\"\n end\n end",
"title": ""
},
{
"docid": "d8decc4e6f01660c7e8f4bb726fe5ad1",
"score": "0.61174196",
"text": "def set_subject(s)\n self.subject = s\n self\n end",
"title": ""
},
{
"docid": "adc4d6f399275aa030fdd9d865497b26",
"score": "0.6114888",
"text": "def subject(subj)\n if not subj.instance_of? String\n STDERR.puts \"ELTmail::Mail: subject ERROR: requires a String\"\n exit 1\n end\n @subject=subj\n @message.header.subject=@subject\n end",
"title": ""
},
{
"docid": "5e20459416b05c260bbe668d4a007434",
"score": "0.6114524",
"text": "def subject\n @subject\n end",
"title": ""
},
{
"docid": "e9b144cd8d1534f9724e54c92daf43ad",
"score": "0.61032575",
"text": "def subject\n @subject\n end",
"title": ""
},
{
"docid": "e9b144cd8d1534f9724e54c92daf43ad",
"score": "0.61032575",
"text": "def subject\n @subject\n end",
"title": ""
},
{
"docid": "921402b07818538548f360485f1dbec4",
"score": "0.6090903",
"text": "def subject_request=(p0) end",
"title": ""
},
{
"docid": "f2fecd58a29b9acf94ad3b95a78dc2e7",
"score": "0.6080274",
"text": "def welcome_email_subject\n @attributes[:welcome_email_subject]\n end",
"title": ""
},
{
"docid": "3ced77486c3fe9f91298bd4216254c91",
"score": "0.60738194",
"text": "def subject_name\n nil unless @subject\n if subject_class.respond_to?(:human_name)\n subject_class.human_name(:locale => Remarkable.locale)\n else\n subject_class.name\n end\n end",
"title": ""
},
{
"docid": "190bdcff217cfefbc27387332c594083",
"score": "0.6073203",
"text": "def subject_request(*) end",
"title": ""
},
{
"docid": "4784ad2933072ef1e4d87d71789a30cd",
"score": "0.60659724",
"text": "def service_now_subject_matcher\n \"#{t('sufia.product_name')}: Help Request\"\n end",
"title": ""
},
{
"docid": "0d214ce6c70e5f2f96c759e4cff712c7",
"score": "0.6065948",
"text": "def subject\n fetch('educator.subject')\n end",
"title": ""
},
{
"docid": "79c4a42d5ae41a1908ad22f8edf441f8",
"score": "0.6065551",
"text": "def subject=(subject)\n @subject = subject\n super\n end",
"title": ""
},
{
"docid": "d20b88031f5a771c6b15b801e4f55f19",
"score": "0.606209",
"text": "def subject\n @subject\n end",
"title": ""
},
{
"docid": "8ce192cb0eeac1cca7c1d5f1295be992",
"score": "0.60398734",
"text": "def subject\n @subject ||= convert(Mail::Encodings.decode_encode(message.subject || '', :decode))\n end",
"title": ""
},
{
"docid": "d559f396e2aaf6d814c15d1286fe3fa4",
"score": "0.602657",
"text": "def translate(mapping, key)\n I18n.t(:\"#{mapping.name}_subject\", :scope => [:devise, :mailer, key],\n :default => [:subject, key.to_s.humanize])\n end",
"title": ""
},
{
"docid": "1117fdba834d3a1af2cdb19084b1bec2",
"score": "0.6010127",
"text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end",
"title": ""
},
{
"docid": "18b111f45ada5085dece93ef7fd198d8",
"score": "0.6009316",
"text": "def topic_subject\n \"#{subject_topic} - #{name}\"\n end",
"title": ""
},
{
"docid": "1117fdba834d3a1af2cdb19084b1bec2",
"score": "0.60084265",
"text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end",
"title": ""
},
{
"docid": "1117fdba834d3a1af2cdb19084b1bec2",
"score": "0.60084265",
"text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end",
"title": ""
},
{
"docid": "1117fdba834d3a1af2cdb19084b1bec2",
"score": "0.60084265",
"text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end",
"title": ""
},
{
"docid": "1117fdba834d3a1af2cdb19084b1bec2",
"score": "0.60084265",
"text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end",
"title": ""
},
{
"docid": "1117fdba834d3a1af2cdb19084b1bec2",
"score": "0.60084265",
"text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end",
"title": ""
},
{
"docid": "1117fdba834d3a1af2cdb19084b1bec2",
"score": "0.60084265",
"text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end",
"title": ""
},
{
"docid": "1117fdba834d3a1af2cdb19084b1bec2",
"score": "0.60084265",
"text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end",
"title": ""
},
{
"docid": "1117fdba834d3a1af2cdb19084b1bec2",
"score": "0.60084265",
"text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end",
"title": ""
},
{
"docid": "1117fdba834d3a1af2cdb19084b1bec2",
"score": "0.60084265",
"text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end",
"title": ""
},
{
"docid": "0aa1cc7584224f23051efac49931c5e7",
"score": "0.6004433",
"text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end",
"title": ""
},
{
"docid": "0aa1cc7584224f23051efac49931c5e7",
"score": "0.6004433",
"text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end",
"title": ""
},
{
"docid": "0aa1cc7584224f23051efac49931c5e7",
"score": "0.6004433",
"text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end",
"title": ""
},
{
"docid": "592a4cdad3b2f1f9377bb8994ad24ca8",
"score": "0.5996205",
"text": "def default_subject_prefix\n @default_subject_prefix || \"[VALIDATION ERROR]\"\n end",
"title": ""
},
{
"docid": "5fb60ea7315445d7605e1eead17dd1e9",
"score": "0.5989045",
"text": "def subject\n env['trinity.subject']\n end",
"title": ""
},
{
"docid": "50f888854f638edf42618d35300fb025",
"score": "0.5964822",
"text": "def subject=( str )\n set_string_attr 'Subject', str\n end",
"title": ""
},
{
"docid": "d0e1de61fdd3b17c2381046c60ded7bd",
"score": "0.59612614",
"text": "def subject_name\n subject_full_name\n end",
"title": ""
},
{
"docid": "c467d463e8e174d4b909bb1a9e466b55",
"score": "0.5960708",
"text": "def subject\n envelope[:subject]\n end",
"title": ""
},
{
"docid": "0c3396cb0dae322e35cdf4231cd444d6",
"score": "0.5949744",
"text": "def formatted_subject(text)\n name = PersonMailer.global_prefs.app_name\n label = name.blank? ? \"\" : \"[#{name}] \"\n \"#{label}#{text}\"\n end",
"title": ""
},
{
"docid": "adab5fbcef94747391c4ce52e337047e",
"score": "0.59263164",
"text": "def subject=(subject)\n set_content_for :subject, subject\n end",
"title": ""
},
{
"docid": "441e62b981d3668556119f56fbc674a3",
"score": "0.5907723",
"text": "def set_subject(default_subject)\n Rails.env.production? ? default_subject : \"TEST-#{default_subject}\"\n end",
"title": ""
},
{
"docid": "6a26cb28e002fcdcabff93f31a7d3216",
"score": "0.5899608",
"text": "def subject=(subject)\n @content[pn(:Subject)] = pl(subject)\n end",
"title": ""
},
{
"docid": "e1868e2443c3bb472509c46df7e595f2",
"score": "0.58991987",
"text": "def i18n_scope\n :notifications\n end",
"title": ""
},
{
"docid": "3017141db42381c7cc5da401735d5c9e",
"score": "0.5892835",
"text": "def subject\n read_content :subject\n end",
"title": ""
},
{
"docid": "60a2d908c8044990c844333ae54c7235",
"score": "0.5890475",
"text": "def SetSubject(subject)\n #Subject of document\n @subject = subject\n end",
"title": ""
},
{
"docid": "d4c090c94d919272e4b7fccdba1bd324",
"score": "0.5889531",
"text": "def _subject\n \"#{self.class.name}-#{self.id}\"\n end",
"title": ""
},
{
"docid": "13c39e9cab8344fbdd8f2c75a0f7d78c",
"score": "0.5882479",
"text": "def subject; end",
"title": ""
},
{
"docid": "13c39e9cab8344fbdd8f2c75a0f7d78c",
"score": "0.5882479",
"text": "def subject; end",
"title": ""
},
{
"docid": "13c39e9cab8344fbdd8f2c75a0f7d78c",
"score": "0.5882479",
"text": "def subject; end",
"title": ""
},
{
"docid": "13c39e9cab8344fbdd8f2c75a0f7d78c",
"score": "0.5882479",
"text": "def subject; end",
"title": ""
},
{
"docid": "13c39e9cab8344fbdd8f2c75a0f7d78c",
"score": "0.5882479",
"text": "def subject; end",
"title": ""
},
{
"docid": "2d6331689dbede789150dacf78dbe51f",
"score": "0.587962",
"text": "def subject( default = nil )\n if h = @header['subject']\n h.body\n else\n default\n end\n end",
"title": ""
},
{
"docid": "5b97accc2422140e68c3765af2839e19",
"score": "0.5878328",
"text": "def subject\n\n unless @subject\n subject = mail.subject.strip rescue \"\"\n ignores = config['ignore']['text/plain']\n if ignores && ignores.detect{|s| s == subject}\n @subject = \"\"\n else\n @subject = transform_text('text/plain', subject).last\n end\n end\n\n @subject\n end",
"title": ""
},
{
"docid": "0696bb636c8b03c2bc5127fcc5ed9171",
"score": "0.5873197",
"text": "def subject\n return @subject\n end",
"title": ""
},
{
"docid": "1c048bf5c6ae84e3838ee01973ffb696",
"score": "0.5868439",
"text": "def __subject__\n @subject\n end",
"title": ""
},
{
"docid": "a22c7cb25bd52cd111ce0adc2a3620e2",
"score": "0.58533067",
"text": "def alert_subject\n \"Edmonton City Election Update!\"\n end",
"title": ""
},
{
"docid": "e2ce42004cc203ca0172d591bc0d47d0",
"score": "0.5842655",
"text": "def subject\n\t\t\tnil\n\t\tend",
"title": ""
},
{
"docid": "c14d27c2cd6a2119b115cff14268ed66",
"score": "0.5842129",
"text": "def subject\n @attributes[:subject]\n end",
"title": ""
},
{
"docid": "c14d27c2cd6a2119b115cff14268ed66",
"score": "0.5842129",
"text": "def subject\n @attributes[:subject]\n end",
"title": ""
},
{
"docid": "c14d27c2cd6a2119b115cff14268ed66",
"score": "0.5842129",
"text": "def subject\n @attributes[:subject]\n end",
"title": ""
},
{
"docid": "5ba2b3b212f9ab9d11eb2acf3c8bad0c",
"score": "0.58310294",
"text": "def new_request_notifier(request)\n @request = request\n mail(to: 'admin@compassionforhumanity.org', bcc: \"wil@wilhelser.com\", subject: \"New Beta Request.\")\n end",
"title": ""
},
{
"docid": "ab155e65d0a7fb6e58826542bee8d360",
"score": "0.58240056",
"text": "def auto_reply_subject(enquiry)\n I18n.t('integral.contact_mailer.auto_reply.subject', reference: enquiry.reference)\n end",
"title": ""
},
{
"docid": "53732f74790b6b444ae44583691fa9bd",
"score": "0.582244",
"text": "def headers\n {\n :subject => I18n.t('ecm.contact_form.attributes.subscription_request.subject'),\n :to => \"recipient@your-site.com\",\n :from => %(\"#{fullname}\" <#{email}>)\n }\n end",
"title": ""
},
{
"docid": "b8f75954c05bfd0f2533dd1f8c604b1a",
"score": "0.58182865",
"text": "def subject(*) end",
"title": ""
}
] |
f21c2525d67838b044e03113d95caf71
|
PATCH/PUT /stekkers/1 PATCH/PUT /stekkers/1.json
|
[
{
"docid": "4f218fa3564eafef9d18d450a63cf1b6",
"score": "0.66942555",
"text": "def update\n respond_to do |format|\n if @stekker.update(stekker_params)\n format.html { redirect_to @stekker, notice: 'Stekker was successfully updated.' }\n format.json { render :show, status: :ok, location: @stekker }\n else\n format.html { render :edit }\n format.json { render json: @stekker.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "9c2cbbd30376aa32e597de89481e9a1a",
"score": "0.643386",
"text": "def update\n @stiker = Stiker.find(params[:id])\n\n respond_to do |format|\n if @stiker.update_attributes(params[:stiker])\n format.html { redirect_to @stiker, notice: 'Stiker was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @stiker.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7633643dafcd2a9732af1a3c891a105f",
"score": "0.6383695",
"text": "def update\n respond_to do |format|\n if @sprayer.update(sprayer_params)\n format.html { redirect_to @sprayer, notice: 'Sprayer was successfully updated.' }\n format.json { render :show, status: :ok, location: @sprayer }\n else\n format.html { render :edit }\n format.json { render json: @sprayer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3855dfa00ba33f2f0275c3a05c877ff6",
"score": "0.6264972",
"text": "def update\n @singer = Singer.find(params[:id])\n\n respond_to do |format|\n if @singer.update_attributes(params[:singer])\n format.html { redirect_to @singer, :notice => 'Singer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @singer.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b4cc3ee2207b39abaf779a6078bbaf3a",
"score": "0.62435925",
"text": "def patch\n PATCH\n end",
"title": ""
},
{
"docid": "b4cc3ee2207b39abaf779a6078bbaf3a",
"score": "0.62435925",
"text": "def patch\n PATCH\n end",
"title": ""
},
{
"docid": "97359e4a2671a10fff905d331222f966",
"score": "0.6227711",
"text": "def update\n respond_to do |format|\n if @stiffener.update(stiffener_params)\n format.html { redirect_to @stiffener, notice: 'Stiffener was successfully updated.' }\n format.json { render :show, status: :ok, location: @stiffener }\n else\n format.html { render :edit }\n format.json { render json: @stiffener.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6fa47f0558c64a625d3b22e0ec748983",
"score": "0.6221374",
"text": "def update\n @serie = resource_params\n if @serie.save\n render json: @serie\n else\n render json: @serie.errors, status: :unprocessable_entity \n end\n end",
"title": ""
},
{
"docid": "0c1a09a9d20ee815b5c9f998eda70b44",
"score": "0.6200189",
"text": "def patch(path, params = {}, options = {})\n options[:content_type] ||= :json\n options[:Authorization] = \"simple-token #{self.access_token}\"\n RestClient.patch(request_url(path), params.to_json, options)\n end",
"title": ""
},
{
"docid": "15a6bae36728923decaac7d880477957",
"score": "0.6183696",
"text": "def update\n respond_to do |format|\n if @skull.update(skull_params)\n format.html { redirect_to @skull, notice: 'Skull was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @skull.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a517b9ebe6b4387e2d0882a4307dad06",
"score": "0.6162924",
"text": "def update\n #authorize @singer\n skip_authorization\n respond_to do |format|\n if @singer.update(singer_params)\n format.html { redirect_to @singer, notice: 'Singer was successfully updated.' }\n format.json { render :show, status: :ok, location: @singer }\n else\n format.html { render :edit }\n format.json { render json: @singer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4f9c6c73e7a1edc1d1e062a0c7920c56",
"score": "0.6141316",
"text": "def update\n respond_to do |format|\n if @konsulter.update(konsulter_params)\n format.html { redirect_to @konsulter, notice: 'Konsulter was successfully updated.' }\n format.json { render :show, status: :ok, location: @konsulter }\n else\n format.html { render :edit }\n format.json { render json: @konsulter.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9ba8d433c924c006c78ae8ffefe56185",
"score": "0.6138588",
"text": "def update\n respond_to do |format|\n if @shelf.update_attributes(params[:shelf])\n format.html { redirect_to @shelf, :notice => t('controller.successfully_updated', :model => t('activerecord.models.shelf')) }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @shelf.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fa16209f5ac39ae638cdf45c17fd5f18",
"score": "0.6137065",
"text": "def rest_patch(path, options = {}, api_ver = @api_version)\n rest_api(:patch, path, options, api_ver)\n end",
"title": ""
},
{
"docid": "fa16209f5ac39ae638cdf45c17fd5f18",
"score": "0.6137065",
"text": "def rest_patch(path, options = {}, api_ver = @api_version)\n rest_api(:patch, path, options, api_ver)\n end",
"title": ""
},
{
"docid": "1b43604bd409d8c4644421c395d71320",
"score": "0.61344814",
"text": "def update\n\t\t\t\trender json: {}, status: 405\n\t\t\tend",
"title": ""
},
{
"docid": "26f21c7d38b2d4d9cffd83f9854372d8",
"score": "0.61201435",
"text": "def update\n beer = Beer.find(params[:id])\n beer.update(beer_params)\n render json: beer\n end",
"title": ""
},
{
"docid": "f2e90cdfee98dd837a3bd690783ad838",
"score": "0.6116779",
"text": "def update\n respond_to do |format|\n if @skater.update(skater_params)\n format.html { redirect_to @skater, notice: 'Skater was successfully updated.' }\n format.json { render :show, status: :ok, location: @skater }\n else\n format.html { render :edit }\n format.json { render json: @skater.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ab5867276551b0bae92a25c88776f605",
"score": "0.61118555",
"text": "def update\n respond_to do |format|\n if @seam_stitch.update(seam_stitch_params)\n format.html { redirect_to @seam_stitch, notice: 'Seam stitch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @seam_stitch.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ed2e15f6ba8fd29b75bf51f1632c34ed",
"score": "0.6111035",
"text": "def update\n #@shelf = Shelf.find(params[:id])\n\n respond_to do |format|\n if @shelf.update_attributes(params[:shelf])\n format.html { redirect_to @shelf, notice: 'Shelf was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @shelf.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d5eaea298e64625a71a15a970f3b75ed",
"score": "0.61085284",
"text": "def patch *args\n make_request :patch, *args\n end",
"title": ""
},
{
"docid": "ceb55f5374e5f40b71e2ab8b45e9c14a",
"score": "0.61076754",
"text": "def update\n respond_to do |format|\n if @stipe.update(stipe_params)\n format.html { redirect_to authors_stipe_path(@stipe), notice: 'Stipe was successfully updated.' }\n format.json { render :show, status: :ok, location: @stipe }\n else\n format.html { render :edit }\n format.json { render json: @stipe.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f223b268167b5ad6e18dde947e2dae4b",
"score": "0.61059505",
"text": "def update\n respond_to do |format|\n if @astek.update(astek_params)\n format.html { redirect_to @astek, notice: 'Astek was successfully updated.' }\n format.json { render :show, status: :ok, location: @astek }\n else\n format.html { render :edit }\n format.json { render json: @astek.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "258322729e0c8aa790119372632c1333",
"score": "0.6103826",
"text": "def update\n respond_to do |format|\n if @sleefe.update(sleefe_params)\n format.html { redirect_to @sleefe, notice: 'Sleeve was successfully updated.' }\n format.json { render :show, status: :ok, location: @sleefe }\n else\n format.html { render :edit }\n format.json { render json: @sleefe.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dc265f389d4563380dc76e164e701cea",
"score": "0.6099988",
"text": "def update\n @sjt = Sjt.find(params[:id])\n\n respond_to do |format|\n if @sjt.update_attributes(params[:sjt])\n format.html { redirect_to @sjt, notice: 'Sjt was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sjt.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1ea528f1bd39816161e2b0324e3adf7f",
"score": "0.60949856",
"text": "def update\n respond_to do |format|\n if @stok.update(stok_params)\n format.html { redirect_to @stok, notice: 'Stok was successfully updated.' }\n format.json { render :show, status: :ok, location: @stok }\n else\n format.html { render :edit }\n format.json { render json: @stok.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bd4a96f438d4d5fa07981667faa157a5",
"score": "0.6089159",
"text": "def update\n respond_to do |format|\n if @sweet.update(sweet_params)\n format.html { redirect_to swits_path, notice: 'Sweet <3.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @sweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e7f15b30eae63f6c290ea6bcf2ba31c1",
"score": "0.60871154",
"text": "def update\n @serie = Serie.find(params[:id])\n\n respond_to do |format|\n if @serie.update_attributes(params[:serie])\n format.html { redirect_to @serie, notice: 'Serie was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render \"edit\" }\n format.json { render json: @serie.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8773cda0612b69747768413ed36aa7ff",
"score": "0.60848284",
"text": "def update\n respond_to do |format|\n if @sticker.update(sticker_params)\n format.html { redirect_to @sticker, notice: 'Sticker was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @sticker.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ea416b077fa0aa7e84ec3fe2ef9c3772",
"score": "0.60800207",
"text": "def put\n request_method('PUT')\n end",
"title": ""
},
{
"docid": "57dc6ba22c7f0772c33bdace35643093",
"score": "0.6062211",
"text": "def update\n respond_to do |format|\n if @stugen.update(stugen_params)\n format.html { redirect_to @stugen, notice: 'Stuga was successfully updated.' }\n format.json { render :show, status: :ok, location: @stugen }\n else\n format.html { render :edit }\n format.json { render json: @stugen.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e441e4102e21ef60d181809c627e36a1",
"score": "0.60587627",
"text": "def update\n respond_to do |format|\n if @skier.update(skier_params)\n format.html { redirect_to @skier, notice: 'Skier was successfully updated.' }\n format.json { render :show, status: :ok, location: @skier }\n else\n format.html { render :edit }\n format.json { render json: @skier.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e441e4102e21ef60d181809c627e36a1",
"score": "0.60587627",
"text": "def update\n respond_to do |format|\n if @skier.update(skier_params)\n format.html { redirect_to @skier, notice: 'Skier was successfully updated.' }\n format.json { render :show, status: :ok, location: @skier }\n else\n format.html { render :edit }\n format.json { render json: @skier.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2572fb900123dab962d92dfd5cd31505",
"score": "0.6054681",
"text": "def update\n spice = Spice.find_by(id: params[:id])\n spice.update(spice_params)\n render json: spice\nend",
"title": ""
},
{
"docid": "dad58a5fdcd909f1c50e79231fef5458",
"score": "0.60440683",
"text": "def update\n @snipet = Snipet.find(params[:id])\n\n respond_to do |format|\n if @snipet.update_attributes(params[:snipet])\n format.html { redirect_to @snipet, notice: 'Snipet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @snipet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bd1588f7da12a1d31f5545e08d9921ff",
"score": "0.60439575",
"text": "def update\n @shelter = Shelter.find(params[:id])\n\n respond_to do |format|\n if @shelter.update_attributes(params[:shelter])\n format.html { redirect_to @shelter, notice: 'Shelter was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @shelter.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a87346ddd69afb8d918a441b6ead7d8c",
"score": "0.6037727",
"text": "def update\n @shelf = Shelf.find(params[:id])\n\n respond_to do |format|\n if @shelf.update_attributes(params[:shelf])\n format.html { redirect_to @shelf, notice: 'Shelf was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @shelf.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "77ce27989a6eb1263af612ecffa00850",
"score": "0.6032845",
"text": "def update\n update! do |success, failure|\n success.json { render :json => resource }\n end\n end",
"title": ""
},
{
"docid": "dbda59778557bf7b4b8464da86512cba",
"score": "0.6019388",
"text": "def update\n respond_to do |format|\n if @restaurent.update(restaurent_params)\n format.html { redirect_to @restaurent, notice: 'Restaurent was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @restaurent.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5fd5f00640bdb0c785bcac4689a46f3c",
"score": "0.6015079",
"text": "def patch(data, options={})\n raise NotImplementedError, \"We only patchs to singular resources.\" if count > 1\n first.patch(data, options)\n end",
"title": ""
},
{
"docid": "fca6bf337e68118321bbc7282c79d654",
"score": "0.6014365",
"text": "def update\n respond_to do |format|\n if @staffer.update(staffer_params)\n format.html { redirect_to @staffer, notice: 'Staffer was successfully updated.' }\n format.json { render :show, status: :ok, location: @staffer }\n else\n format.html { render :edit }\n format.json { render json: @staffer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "06c36c76b815cf70706539aedebbdbce",
"score": "0.60133165",
"text": "def update\n respond_to do |format|\n if @stake.update(stake_params)\n format.html { redirect_to @stake, notice: 'Stake was successfully updated.' }\n format.json { render :show, status: :ok, location: @stake }\n else\n format.html { render :edit }\n format.json { render json: @stake.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3adbb5fea00275a9770bfcaddfd6c0ea",
"score": "0.6006618",
"text": "def update\n respond_to do |format|\n if @singer.update(singer_params)\n format.html { redirect_to @singer, notice: 'Singer was successfully updated.' }\n format.json { render :show, status: :ok, location: @singer }\n else\n format.html { render :edit }\n format.json { render json: @singer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ed1a054b962de786c0cdec122230872d",
"score": "0.6003778",
"text": "def update\n respond_to do |format|\n if @json_datum.update(json_datum_params)\n format.html { redirect_to @json_datum, notice: 'Json datum was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @json_datum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fe34f93da0751ad55cc5052cfdd2366c",
"score": "0.6003415",
"text": "def update\n render json: Person.update(params[\"id\"], params[\"person\"])\n end",
"title": ""
},
{
"docid": "77712aad54c1258050256f2ddef6ad83",
"score": "0.60034025",
"text": "def update\n respond_to do |format|\n if @servey.update(servey_params)\n format.html { redirect_to @servey, notice: 'Servey was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @servey.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7f7c16b9e14f1352bb07fd27f83679a7",
"score": "0.60018355",
"text": "def patch(path, params: {}, headers: {})\n request_json :patch, path, params, headers\n end",
"title": ""
},
{
"docid": "3f9ffcc73e3988721555050cfa7be991",
"score": "0.5997683",
"text": "def update\n respond_to do |format|\n if @sneaker.update(sneaker_params)\n\n format.html { redirect_to @sneaker, notice: 'Sneaker was successfully updated.' }\n format.json { render :show, status: :ok, location: @sneaker }\n else\n format.html { render :edit }\n format.json { render json: @sneaker.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fd56dbcac6666cd7d4fc6e01122b1607",
"score": "0.5996474",
"text": "def update\n respond_to do |format|\n if @sith.update(sith_params)\n format.html { redirect_to @sith, notice: 'Sith was successfully updated.' }\n format.json { render :show, status: :ok, location: @sith }\n else\n format.html { render :edit }\n format.json { render json: @sith.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "13a3421a78a99b043171300b63f9cbb2",
"score": "0.5982136",
"text": "def update\n @stck_request = StckRequest.find(params[:id])\n\n respond_to do |format|\n if @stck_request.update_attributes(params[:stck_request])\n format.html { redirect_to stck_requests_path, notice: 'Stck request was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @stck_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6823ca2eb6b168572557c700ad11a10f",
"score": "0.5981932",
"text": "def update\n respond_to do |format|\n if @j_datum.update(j_datum_params)\n format.html { redirect_to @j_datum, notice: 'JSON file was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @j_datum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3d25e4c3226d7a9d46806fd70442b1ce",
"score": "0.5979187",
"text": "def update\n @konten = Konten.find(params[:id])\n\n respond_to do |format|\n if @konten.update_attributes(params[:konten])\n format.html { redirect_to @konten, notice: 'Konten was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @konten.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fd3c73b7c0c28e7f317f83010a70ca58",
"score": "0.5978744",
"text": "def update\n @sick = Sick.find(params[:id])\n\n respond_to do |format|\n if @sick.update_attributes(params[:sick])\n format.html { redirect_to sicks_path, notice: 'Enfermedad Editada Correctamente' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sick.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6b12ba30793bfaa4e06bfae3dcadb15c",
"score": "0.59751284",
"text": "def update\n respond_to do |format|\n if @retail_shelf.update(retail_shelf_params)\n format.html { redirect_to @retail_shelf, notice: 'Retail shelf was successfully updated.' }\n format.json { render :show, status: :ok, location: @retail_shelf }\n else\n format.html { render :edit }\n format.json { render json: @retail_shelf.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "63d3a7f0a9942a69debc3a53693dbe49",
"score": "0.5974833",
"text": "def update\n respond_to do |format|\n if @squeek.update(squeek_params)\n format.html { redirect_to @squeek, notice: 'Squeek was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @squeek.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "56046090275ab457e8e4fcf2f5e5dbc5",
"score": "0.59675556",
"text": "def update\n respond_to do |format|\n if @shelf.update(shelf_params)\n format.html { redirect_to @shelf, notice: 'Shelf was successfully updated.' }\n format.json { render :show, status: :ok, location: @shelf }\n else\n format.html { render :edit }\n format.json { render json: @shelf.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d289087c03b0bbc1927a972b59be7f18",
"score": "0.5958205",
"text": "def update\n respond_to do |format|\n if @sneaker.update(sneaker_params)\n format.html { redirect_to @sneaker, notice: \"Sneaker was successfully updated.\" }\n format.json { render :show, status: :ok, location: @sneaker }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @sneaker.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "04454e977ec333786bee595fb383d930",
"score": "0.59540874",
"text": "def update\n respond_to do |format|\n if @systatik.update(systatik_params)\n format.html { redirect_to @systatik, notice: 'Systatik was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @systatik.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2c52a862b22ef30c2734e9b6dc0eb31c",
"score": "0.59510964",
"text": "def update\n respond_to do |format|\n if @seventeen.update(seventeen_params)\n format.html { redirect_to @seventeen, notice: 'Seventeen was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @seventeen.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "42e4d81ce0f91ce996dcbc347df2958d",
"score": "0.59411377",
"text": "def update\n @response = self.class.put(\"#{@server_uri}/resource_name/#{@opts[:id]}.json\", :body => \"{'resource_form_name':#{JSON.generate(@opts)}}\")\n end",
"title": ""
},
{
"docid": "b5b86fd856ff5e23279f7508f2f1d918",
"score": "0.593104",
"text": "def update\n respond_to do |format|\n if @shelter.update(shelter_params)\n format.html { redirect_to @shelter, notice: 'Shelter was successfully updated.' }\n format.json { render :show, status: :ok, location: @shelter }\n else\n format.html { render :edit }\n format.json { render json: @shelter.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6c50b9570ab82e95133977bfc82f5e1e",
"score": "0.5930817",
"text": "def update\n @slit_spec = SlitSpec.find(params[:id])\n\n respond_to do |format|\n if @slit_spec.update_attributes(params[:slit_spec])\n format.html { redirect_to @slit_spec, notice: 'Slit spec was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @slit_spec.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "af9aedd4f428a2c26c3fd57798526020",
"score": "0.5930493",
"text": "def put(path, data = {}, header = {})\n _send(json_request(Net::HTTP::Patch, path, data, header))\n end",
"title": ""
},
{
"docid": "f98ac6ad69dec19926ecaf0377efb83d",
"score": "0.59143764",
"text": "def update\n if @rest.update(rest_params)\n render :show, status: :ok, location: @rest\n else\n render json: @rest.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "abce1dfbfa7adc8a127622108f732a95",
"score": "0.59124357",
"text": "def update_person(api, cookie, perstoupdate, person)\n pers_id = perstoupdate['id']\n option_hash = { content_type: :json, accept: :json, cookies: cookie }\n pers = nil\n res = api[\"people/#{pers_id}\"].patch person.to_json, option_hash unless $dryrun\n if res&.code == 201\n pers = JSON.parse(res.body)\n end\n pers\nend",
"title": ""
},
{
"docid": "ed0826bfec77d499b10e6b0e6ded59c9",
"score": "0.59090626",
"text": "def patch?; request_method == \"PATCH\" end",
"title": ""
},
{
"docid": "b2d5fc83a907f25e5176864fa6beb3d0",
"score": "0.590507",
"text": "def put_rest(path, json) \n run_request(:PUT, create_url(path), json)\n end",
"title": ""
},
{
"docid": "d756501b6fa909f66b446c29f9a1851d",
"score": "0.5899897",
"text": "def update\n respond_to do |format|\n if @stanowisko.update(stanowisko_params)\n format.html { redirect_to @stanowisko, notice: 'Edycja zakończyła się sukcesem.' }\n format.json { render :show, status: :ok, location: @stanowisko }\n else\n format.html { render :edit }\n format.json { render json: @stanowisko.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8a1fcbdae3046e2102f533f681b61c66",
"score": "0.5897351",
"text": "def update_contact\n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/contacts/3'\n ).to_s\n\n puts RestClient.patch(\n url, {contact: {name: \"Josh\", email: \"josh@gmail.com\"}} )\nend",
"title": ""
},
{
"docid": "ab0586b09fcae5f9d800fa8663170c4b",
"score": "0.58966744",
"text": "def update\n @sorvete = Sorvete.find(params[:id])\n\n respond_to do |format|\n if @sorvete.update_attributes(params[:sorvete])\n format.html { redirect_to @sorvete, notice: 'Sorvete was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sorvete.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "75405ee915084f9674b1b8d4eb6539bf",
"score": "0.58908486",
"text": "def update\n # raise params.to_s\n respond_to do |format|\n if @shelf.update(shelf_params)\n format.html { redirect_to @shelf, notice: t('notice.shelf.update') }\n format.json { render :show, status: :ok, location: @shelf }\n else\n format.html { render :edit }\n format.json { render json: @shelf.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6df371222eb48c1e0308fba3fae0c0e0",
"score": "0.58851343",
"text": "def update\n respond_to do |format|\n if @restroom.update(restroom_params)\n format.html { redirect_to @restroom, notice: 'Restroom was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @restroom.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d61c0aeb123e4c5cfcb2ba019dd903a0",
"score": "0.5884528",
"text": "def patch(options = {})\n request :patch, options\n end",
"title": ""
},
{
"docid": "2373701e148deeeb1e66c86c47859328",
"score": "0.5880943",
"text": "def update\n respond_to do |format|\n if @task_seeker.update(task_seeker_params)\n format.html { redirect_to @task_seeker, notice: 'Task seeker was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @task_seeker.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3e360bf2afd246c1ae7096e94c83fa32",
"score": "0.5879084",
"text": "def update\n @stitch = Stitch.find(params[:id])\n\n respond_to do |format|\n if @stitch.update_attributes(params[:stitch])\n format.html { redirect_to @stitch, notice: 'Stitch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @stitch.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3d56cdc6f9bafa36933a674d1e9253b0",
"score": "0.5877271",
"text": "def update\n respond_to do |format|\n if @said_zekr.update(said_zekr_params)\n format.html { redirect_to @said_zekr, notice: 'Said zekr was successfully updated.' }\n format.json { render :show, status: :ok, location: @said_zekr }\n else\n format.html { render :edit }\n format.json { render json: @said_zekr.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "542b3449b5c93b79aba406de3adf0dda",
"score": "0.5873973",
"text": "def update\n @stake = Stake.find(params[:id])\n\n respond_to do |format|\n if @stake.update_attributes(params[:stake])\n format.html { redirect_to @stake, notice: 'Stake was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @stake.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f5f9cbcd358def568606a9c644b4f061",
"score": "0.58737993",
"text": "def update\n respond_to do |format|\n if @stitch.update(stitch_params)\n format.html { redirect_to @stitch, notice: 'Stitch was successfully updated.' }\n format.xml { head :no_content }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.xml { render xml: @stitch.errors, status: :unprocessable_entity }\n format.json { render json: @stitch.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e8e4f0bacaaa4841b55692895f2b92f7",
"score": "0.58728266",
"text": "def update\n @stepten = Stepten.find(params[:id])\n\n respond_to do |format|\n if @stepten.update_attributes(params[:stepten])\n format.html { redirect_to(root_path, :notice => 'Stepten was successfully updated.') }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @stepten.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "48caea7f947139daf06cc771b832a3c6",
"score": "0.58724976",
"text": "def update\n @sticker = Sticker.find(params[:id])\n\n respond_to do |format|\n if @sticker.update_attributes(params[:sticker])\n format.html { redirect_to @sticker, notice: 'Sticker was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sticker.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "71d0a5471bae6eab157cd4f9efc3e175",
"score": "0.587239",
"text": "def update\n respond_to do |format|\n if @sermon.update(sermon_params)\n format.html { redirect_to @sermon, notice: 'Sermon was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @sermon.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d2226eab5ec88e4d5fd840aae16ec244",
"score": "0.5868099",
"text": "def update\n @seat = Seat.find(params[:id])\n\n if @seat.update(seat_params)\n head :no_content\n else\n render json: @seat.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "4bf5b27699f99402da7a783a02a8e05e",
"score": "0.58614755",
"text": "def update\n respond_to do |format|\n if @stre.update(stre_params)\n format.html { redirect_to @stre, notice: 'Stre was successfully updated.' }\n format.json { render :show, status: :ok, location: @stre }\n else\n format.html { render :edit }\n format.json { render json: @stre.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0a565cef00d6874eb6d07052cd70dfab",
"score": "0.5861046",
"text": "def update(json_resource)\n jsonapi_request(:patch, \"#{@route}/#{json_resource['id']}\", \"data\"=> json_resource)\n end",
"title": ""
},
{
"docid": "6cc77dca7a62eb0d14a7fa289d359d98",
"score": "0.58534724",
"text": "def update\n respond_to do |format|\n if @serasa.update(serasa_params)\n format.html { redirect_to :back }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @serasa.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9959057092fdb1f8bdfeab7573246e56",
"score": "0.584991",
"text": "def update\n respond_to do |format|\n if @ksiazka.update(ksiazka_params)\n format.html { redirect_to @ksiazka, notice: '' }\n format.json { render :show, status: :ok, location: @ksiazka }\n else\n format.html { render :edit }\n format.json { render json: @ksiazka.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "72a7afd69675f6ddf72d77527f471dc8",
"score": "0.5847686",
"text": "def update\n respond_to do |format|\n if @sticker.update(sticker_params)\n format.html { redirect_to @sticker, notice: 'Sticker was successfully updated.' }\n format.json { render :show, status: :ok, location: @sticker }\n else\n format.html { render :edit }\n format.json { render json: @sticker.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9dfeff265c107e452124edbb787bb2f0",
"score": "0.58474576",
"text": "def update\n respond_to do |format|\n if @sklad.update(sklad_params)\n format.html { redirect_to @sklad, notice: 'Sklad was successfully updated.' }\n format.json { render :show, status: :ok, location: @sklad }\n else\n format.html { render :edit }\n format.json { render json: @sklad.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ac774b9a087ff804750c7ee7e7335002",
"score": "0.5847093",
"text": "def update\n respond_to do |format|\n if @jinete.update(jinete_params)\n format.html { redirect_to @jinete, notice: 'Jinete was successfully updated.' }\n format.json { render :show, status: :ok, location: @jinete }\n else\n format.html { render :edit }\n format.json { render json: @jinete.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9d15314c28aa9c74c7bd372046bb9b51",
"score": "0.58402175",
"text": "def update\n respond_to do |format|\n if @superset.update(superset_params)\n format.html { redirect_to @superset, notice: 'Superset was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @superset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c69353507f8af9f1dd63fcb1bff74b44",
"score": "0.5839132",
"text": "def update\n respond_to do |format|\n if @semestre.update(semestre_params)\n format.html { redirect_to @semestre, notice: t('.update', default: t('helpers.messages.update')) }\n format.json { render :show, status: :ok, location: @semestre }\n else\n format.html { render :edit }\n format.json { render json: @semestre.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "95946874248f8f682395810bab0adc4f",
"score": "0.5838674",
"text": "def update\n @restuarant = Restuarant.find(params[:id])\n\n respond_to do |format|\n if @restuarant.update_attributes(params[:restuarant])\n format.html { redirect_to @restuarant, notice: 'Restuarant was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @restuarant.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6ff8ab80bc0c4337d83a19b9c95929e9",
"score": "0.5837635",
"text": "def update\n respond_to do |format|\n if @kitten.update(kitten_params)\n format.html { redirect_to @kitten, notice: 'Kitten was successfully updated.' }\n format.json { render :show, status: :ok, location: @kitten }\n else\n format.html { render :edit }\n format.json { render json: @kitten.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2c5ad134dbb46aece629e72c5bb58c31",
"score": "0.5836732",
"text": "def update\n @seminar = Seminar.find(params[:id])\n\n respond_to do |format|\n if @seminar.update_attributes(params[:seminar])\n format.html { redirect_to @seminar, notice: 'Seminar was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @seminar.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5dc8f6f4f813036f684520363c6fddc9",
"score": "0.58366895",
"text": "def update\n respond_to do |format|\n if @create_fnss_simple_ring.update(create_fnss_simple_ring_params)\n format.html { redirect_to @create_fnss_simple_ring, notice: 'Create fnss simple ring was successfully updated.' }\n format.json { render :show, status: :ok, location: @create_fnss_simple_ring }\n else\n format.html { render :edit }\n format.json { render json: @create_fnss_simple_ring.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0d73c94ed7583a262193b01adf709267",
"score": "0.5835323",
"text": "def update\n @seminar = Seminar.find(params[:id])\n\n respond_to do |format|\n if @seminar.update_attributes(params[:seminar])\n format.html { redirect_to seminars_path, notice: 'Seminar was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @seminar.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a7bd22c955d9e162b8102d13f0c00bcf",
"score": "0.5834107",
"text": "def update\n respond_to do |format|\n if @st.update(st_params)\n format.html { redirect_to @st, notice: 'St was successfully updated.' }\n format.json { render :show, status: :ok, location: @st }\n else\n format.html { render :edit }\n format.json { render json: @st.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b4d70c6bf0d58caa1907ba67d7c6c220",
"score": "0.58319825",
"text": "def update\n respond_to do |format|\n if @sermon.update(sermon_params)\n format.html { redirect_to @sermon, notice: 'Sermon was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: 'edit' }\n format.json { render json: @sermon.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6b4c0e643b3f8601cd6dbd2c761ba5c2",
"score": "0.58305967",
"text": "def update\n respond_to do |format|\n if @resturant.update_attributes(params[:resturant])\n format.html {redirect_to @resturant, notice: 'Resturant was successfully updated.'}\n format.json {head :no_content}\n else\n format.html {render action: \"edit\"}\n format.json {render json: @resturant.errors, status: :unprocessable_entity}\n end\n end\n end",
"title": ""
},
{
"docid": "d1d2c89d22549b4cf2a0b90274e64c23",
"score": "0.5830243",
"text": "def update\n @spread = Spread.find(params[:id])\n @spread.client = Client.find_by_id(params[:spread][:client_id])\n respond_to do |format|\n if @spread.update_attributes(params[:spread])\n format.html { redirect_to @spread, notice: \"Расклад \\\"#{@spread.name}\\\" успешно отредактирован\" }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @spread.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0f8872308cd71e90aed963baf02fd23e",
"score": "0.58302057",
"text": "def update\n request = RestClient.put File.join(API_SERVER,\"rest-api/departments\"), { \n 'id' => params['id'], \n 'name' => params['department']['name'], \n 'description' => params['department']['description'] }.to_json, :content_type => :json, :accept => :json\n\n redirect_to :action => :index\n end",
"title": ""
}
] |
3a451ed0b10b2ef655b66fcdf05972bc
|
GET /psp_diagrams_to_ps_perimeters GET /psp_diagrams_to_ps_perimeters.json
|
[
{
"docid": "23e894175d300d1bb83612da4e84a9b4",
"score": "0.6025304",
"text": "def index\n if current_user.admin\n @psp_diagrams_to_ps_perimeters = PspDiagramsToPsPerimeter.all\n else \n redirect_to \"/ps_perimeters\", notice: 'Page not available.'\n end\n end",
"title": ""
}
] |
[
{
"docid": "a8ff7e8f76b0cbf6df67fac749de68c7",
"score": "0.621965",
"text": "def set_psp_diagrams_to_ps_perimeter\n @psp_diagrams_to_ps_perimeter = PspDiagramsToPsPerimeter.find(params[:id])\n end",
"title": ""
},
{
"docid": "afc3c9c96c5418034d330ce8af720d5b",
"score": "0.5715613",
"text": "def psp_diagrams_to_ps_perimeter_params\n params.require(:psp_diagrams_to_ps_perimeter).permit(:ps_pproof,:remove_ps_pproof,:psp_dia_file_name, :psp_dia_psp_id)\n end",
"title": ""
},
{
"docid": "778e2248e0cc6dce9c14d1376e26243c",
"score": "0.5289849",
"text": "def entry_path_to_sw p\n puts \"P = #{p}\"\n p.each do | map |\n sw = map[:dpid]\n out_port = map[:out_port].to_i\n @outPorts[sw] = [] unless @outPorts.key?(sw)\n @outPorts[sw] << out_port unless @outPorts[sw].include?(out_port)\n end\n end",
"title": ""
},
{
"docid": "da5f5500a59a360f6a8604f16e4bbcec",
"score": "0.5220673",
"text": "def update\n respond_to do |format|\n if @psp_diagrams_to_ps_perimeter.update(psp_diagrams_to_ps_perimeter_params)\n format.html { redirect_to @psp_diagrams_to_ps_perimeter, notice: 'Psp diagrams to ps perimeter was successfully updated.' }\n format.json { render :show, status: :ok, location: @psp_diagrams_to_ps_perimeter }\n else\n format.html { render :edit }\n format.json { render json: @psp_diagrams_to_ps_perimeter.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "63a9f4b29022c81908a1830fcbdcfb43",
"score": "0.5151044",
"text": "def index\n @padiddle_points = PadiddlePoint.all\n end",
"title": ""
},
{
"docid": "f8961a8e19e8d159bc2d04e819a5a9e9",
"score": "0.50751245",
"text": "def create\n @psp_diagrams_to_ps_perimeter = PspDiagramsToPsPerimeter.new(psp_diagrams_to_ps_perimeter_params)\n\n respond_to do |format|\n if @psp_diagrams_to_ps_perimeter.save\n\n @psp_diagrams_to_ps_perimeter.ps_pproof.url # => '/url/to/file.png'\n @psp_diagrams_to_ps_perimeter.ps_pproof.current_path # => 'path/to/file.png'\n @psp_diagrams_to_ps_perimeter.ps_pproof_identifier # => 'file.png'\n\n format.html { redirect_to \"/ps_perimeters\", notice: 'Document has been uploaded.' }\n #format.html { redirect_to @psp_diagrams_to_ps_perimeter, notice: 'Psp diagrams to ps perimeter was successfully created.' }\n format.json { render :show, status: :created, location: @psp_diagrams_to_ps_perimeter }\n else\n format.html { render :new }\n format.json { render json: @psp_diagrams_to_ps_perimeter.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "73d96a4f796b929a58cc2f6b80897294",
"score": "0.49894786",
"text": "def index\n @pugs = Pug.all\n\n render json: @pugs\n end",
"title": ""
},
{
"docid": "d89c2393d2ad8c69388b502756ff8463",
"score": "0.49797687",
"text": "def ps(app_name)\n deprecate # 07/31/2012\n json_decode get(\"/apps/#{app_name}/ps\", :accept => 'application/json').to_s\n end",
"title": ""
},
{
"docid": "443256bb44897b0e7908d021a2b2d924",
"score": "0.48830593",
"text": "def index\n @pitches = Pitch.page(params[:page]).order(id: :desc)\n rv = {\n items: @pitches.map {|pitch| pitch.as_json},\n total_pages: @pitches.total_pages,\n }\n api_success rv\n end",
"title": ""
},
{
"docid": "debbd6ac8102cf580f817e3180f3e363",
"score": "0.48440668",
"text": "def index\n @papers = Paper.all\n\n render json: @papers\n end",
"title": ""
},
{
"docid": "ab5bcf6db915cc5379342ea388698718",
"score": "0.48091397",
"text": "def json_responses_for_presentation(p, exclude_paths)\n @counter ||= 0 # We want to restrict the number of presentations\n # downloaded per go.\n return nil if @counter > MAXIMUM_NUMBER_OF_PRESENTATIONS_PER_BATCH\n fragments = {}\n # We only batch load for the current locale.\n # We are seeing people with hundreds of likes, so this makes sense.\n #\n # Same as PresentationContrller#show\n @presentation = p\n @menu = @presentation.is_poster? ? :posters : :sessions\n restrict_disclosure(@presentation)\n\n path = presentation_path(@presentation, :locale => locale)\n unless exclude_paths.include?(path)\n fragments[path] = render_to_string(\"show#{\".s\" if smartphone?}\", :formats => [:html], :layout => false)\n end\n @counter += 1\n fragments\n end",
"title": ""
},
{
"docid": "65d7d09d6a45ff88f82f08deec16650f",
"score": "0.4805196",
"text": "def pps(pp)\n [\n pp[:tl][:x], pp[:tl][:y], 0, 0,\n pp[:tr][:x], pp[:tr][:y], width, 0,\n pp[:br][:x], pp[:br][:y], width, height,\n pp[:bl][:x], pp[:bl][:y], 0, height\n ].join ' '\n end",
"title": ""
},
{
"docid": "a63b8041fd5fb166fb4464d10c9d8ac0",
"score": "0.4804944",
"text": "def index\n @psses = Pss.all\n end",
"title": ""
},
{
"docid": "1c95886544c9605a8945b848aafada58",
"score": "0.47747028",
"text": "def index\n @tunning_diagrams = TunningDiagram.accessible_by(current_ability).search(params[:search]).page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tunning_diagrams }\n format.xml { render xml: @tunning_diagrams }\n end\n end",
"title": ""
},
{
"docid": "0c55f419d83bb618ef44845f0c76b2e6",
"score": "0.47597829",
"text": "def pds_meters_digitals\n @data_list = PdsMetersDigital.where(Project: project.ProjectID)\n .includes({ hw_ic: [:hw_ped, pds_project_unit: :unit] }, :system,\n :pds_section_assembler)\n .pluck(:MetDigID,\n 'hw_ic.icID', 'hw_ic.ref', 'hw_ic.tag_no', 'hw_ic.Description',\n 'hw_peds.ped_N', 'hw_peds.ped',\n 'pds_syslist.SystemID', 'pds_syslist.System',\n 'pds_section_assembler.section_N', 'pds_section_assembler.section_name',\n 'hw_ic.scaleMin', 'hw_ic.scaleMax',\n 'pds_project_unit.ProjUnitID', 'pds_unit.UnitID', 'pds_unit.Unit_RU').each.map do |e|\n e1 = {}\n e1['id'] = e[0]\n e1['hw_ic'] = { id: e[1], ref: e[2], tag_no: e[3], Description: e[4],\n hw_ped: { id: e[5], ped: e[6] }, scaleMin: e[11], scaleMax: e[12],\n pds_project_unit: { id: e[13], unit: { id: e[14], Unit_RU: e[15] } } }\n e1['system'] = { id: e[7], System: e[8] }\n e1['pds_section_assembler'] = { id: e[9], section_name: e[10] }\n e = e1\n end\n end",
"title": ""
},
{
"docid": "9cf03ce18a9fd5444098988825c33e18",
"score": "0.4752903",
"text": "def index\n @mdps = Mdp.all\n end",
"title": ""
},
{
"docid": "4ea2d65e97ad35aeffd5849295fbcbd9",
"score": "0.474673",
"text": "def jurisdiction_paths(patients)\n jurisdiction_paths = Hash[Jurisdiction.find(patients.pluck(:jurisdiction_id).uniq).pluck(:id, :path).map { |id, path| [id, path] }]\n patients_jurisdiction_paths = {}\n patients.each do |patient|\n patients_jurisdiction_paths[patient.id] = jurisdiction_paths[patient.jurisdiction_id]\n end\n patients_jurisdiction_paths\n end",
"title": ""
},
{
"docid": "6d952359aff693d910da9b3ec4a35e6c",
"score": "0.47430137",
"text": "def index\n @distortion_patterns = DistortionPattern.all\n end",
"title": ""
},
{
"docid": "e6fe1601ab639b6c8e0cff4f7df00c96",
"score": "0.4727095",
"text": "def get_pokemon_JSON\n r = \n {\n :p1 => JSON.parse(self.pokeserver(self.p1)), \n :p2 => JSON.parse(self.pokeserver(self.p2)), \n :p3 => JSON.parse(self.pokeserver(self.p3)), \n :p4 => JSON.parse(self.pokeserver(self.p4)), \n :p5 => JSON.parse(self.pokeserver(self.p5)), \n :p6 => JSON.parse(self.pokeserver(self.p6)) \n }\n \n JSON.generate(r)\n end",
"title": ""
},
{
"docid": "a83a29c4e1a5ac7f408bee211fe36f41",
"score": "0.47205827",
"text": "def index\n @pictures = Picture.where(foodscape_id: params[:foodscape_id])\n render json: @pictures\n end",
"title": ""
},
{
"docid": "9d5380bfd9f7e4f254f97bbebc74fd5f",
"score": "0.47109523",
"text": "def patina\n sectors = Sector.where(user: current_user).load\n subsectors = Subsector.where(sector_id: sectors.map(&:id)).group_by(&:sector_id)\n activities = Activity.where(subsector_id: subsectors.values.flatten.map(&:id)).group_by(&:subsector_id)\n\n @json_locals = { sectors: sectors, subsectors: subsectors, activities: activities }\n\n respond_to do |format|\n format.html { render 'patina' }\n format.json { render partial: 'patina', locals: @json_locals, status: :ok }\n end\n end",
"title": ""
},
{
"docid": "ce0421c4d4283383c18edbb77c259b7d",
"score": "0.4671388",
"text": "def pds_meters\n @data_list = PdsMeter.where(Project: project.ProjectID)\n .includes({ hw_ic: [:hw_ped, pds_project_unit: :unit] }, :system, :pds_section_assembler)\n end",
"title": ""
},
{
"docid": "8a06af5bf074f96ffada284de2e18aa8",
"score": "0.46699396",
"text": "def index\n @paradigm_praats = ParadigmPraat.all\n end",
"title": ""
},
{
"docid": "c73ca58336ff08dfdb5c3fbbf0461395",
"score": "0.4602648",
"text": "def index\n @pmprizes = Pmprize.all\n end",
"title": ""
},
{
"docid": "4e026a2bb524018545c8e6accb6d5ed8",
"score": "0.4600512",
"text": "def show\n if current_user.admin\n @ps_perimeters = PsPerimeter.all\n else \n redirect_to \"/ps_perimeters\", notice: 'Cannot edit uploaded document.'\n end\n end",
"title": ""
},
{
"docid": "d384624fe200a2847b3dd715dd7a82dc",
"score": "0.46000922",
"text": "def index\n @primeminesters = Primeminester.all\n end",
"title": ""
},
{
"docid": "b891d44310e9c4e876380bb4c48b112e",
"score": "0.45902163",
"text": "def index\n @players_prizes = PlayersPrize.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @players_prizes }\n end\n end",
"title": ""
},
{
"docid": "49ff4487a07cfb972fdee5443358e9c1",
"score": "0.45699283",
"text": "def puzzles\n render json: {\n puzzles: @level.repetition_puzzles\n }\n end",
"title": ""
},
{
"docid": "298ea617d49e9ce10eb6df6525df4ffd",
"score": "0.45628887",
"text": "def index\n @life_pulses_pictures = LifePulsesPicture.all\n end",
"title": ""
},
{
"docid": "3e8d8c00a11198774813cf8bc660c989",
"score": "0.45579445",
"text": "def patients\n patients = User.patients\n render json: { status: 200, data: patients }\n end",
"title": ""
},
{
"docid": "8ed8825969451e01a675e827fa86d30c",
"score": "0.45421618",
"text": "def index\n @powerchips = Powerchip.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @powerchips }\n end\n end",
"title": ""
},
{
"docid": "7d9a994476c40c0b5a7c0646b8dd9c93",
"score": "0.45397466",
"text": "def index\n @pupil_measurements = PupilMeasurement.all\n end",
"title": ""
},
{
"docid": "f76894197aee9d83e8024dc6b3d9a641",
"score": "0.45337024",
"text": "def perimeter_params\n params.permit(perimeters: %i[\n id top_left_y top_left_x bottom_right_y bottom_right_x price\n identifier description perimeter_type lat lng section_id\n rules_expression user_id],\n sensors: %i[id top_left_y top_left_x section_id]\n )\n end",
"title": ""
},
{
"docid": "2601d3dcb815790e51647c080116aaca",
"score": "0.45318994",
"text": "def index\n @puntuations = Puntuation.all\n end",
"title": ""
},
{
"docid": "945ea9b30f49f9262cedc7568f952ad4",
"score": "0.45211077",
"text": "def list\n @gp40s = Machine.find(params[:machine_id]).gp40s.order(:date)\n @gp40s = duration(@gp40s, params)\n\n sort_ad()\n set_graph()\n\n if 0 == @gp40s.size\n @last = Machine.find(params[:machine_id]).gp40s.order(:date).last\n end\n end",
"title": ""
},
{
"docid": "889cebf959681e56ff504b29103cff99",
"score": "0.44863093",
"text": "def get_hidratos\n @_100=((@hidratos*100)/@peso)\n @ir_100=(@_100/260)*100\n @porcion=((@hidratos*@gramos_porciones)/@peso)\n @ir_porcion=(@porcion/260)*100\n [ @hidratos , @_100 , @ir_100.round(1) , @porcion , @ir_porcion.round(1) ]\n end",
"title": ""
},
{
"docid": "b3a80731262938e27bd41a476fc778dc",
"score": "0.44861677",
"text": "def all_parks\n response_string = RestClient.get(\"https://developer.nps.gov/api/v1/parks?api_key=#{KEY}&limit=1000\")\n query_hash_to_array(response_string)\n end",
"title": ""
},
{
"docid": "394fe278fe003b01155cd4cd7bc2b1fc",
"score": "0.44759125",
"text": "def index\n @strokes = Stroke.all\n end",
"title": ""
},
{
"docid": "ab0983885006924ebca208ff1af4706f",
"score": "0.44754207",
"text": "def index\n @gpsds = Gpsd.all\n #respond_to do |format|\n # format.json { render }\n #end\n end",
"title": ""
},
{
"docid": "85bc5a7122b83f29715dba0bd1ee179e",
"score": "0.44688088",
"text": "def to_json(persp)\n to_serialized_hash(persp).to_json\n end",
"title": ""
},
{
"docid": "0b5c5168f9fa6457e62f8a4d0a9a9f6c",
"score": "0.44585449",
"text": "def index\n @pic_spaces = PicSpace.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pic_spaces }\n end\n end",
"title": ""
},
{
"docid": "d85c6c1425e7c6f841169ee88154843b",
"score": "0.4455911",
"text": "def index\n @pmmatches = Pmmatch.all\n end",
"title": ""
},
{
"docid": "6833e327c250232f0e054bfcfe06cb0b",
"score": "0.44315505",
"text": "def index\n @permisos = Permiso.all\n end",
"title": ""
},
{
"docid": "5e0866782cefb5533cf9b53d915c8345",
"score": "0.44310185",
"text": "def index\n @punchcards = Punchcard.all\n end",
"title": ""
},
{
"docid": "985a4a7a3c0f0b3defe6b7d03e37a530",
"score": "0.4430986",
"text": "def index\n @pledges = if current_admin?\n User.find(params[:user_id]).pledges\n else\n current_user.pledges\n end\n respond_to do |format|\n format.html\n format.json { render json: @pledges }\n end\n end",
"title": ""
},
{
"docid": "b0ba38dea3ddf0173c8dcb24267bca8f",
"score": "0.44309613",
"text": "def index\n @protectoras = Protectora.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @protectoras }\n end\n end",
"title": ""
},
{
"docid": "af6008c84c8a3ae174f09982028dd66c",
"score": "0.44308802",
"text": "def image_path_for_psd(psd_path)\n \"#{psd_path}.png\" # that wasn't very hard now was it?\nend",
"title": ""
},
{
"docid": "3d8106c61750ea4bcb1e612f56022c08",
"score": "0.44203436",
"text": "def index\n @dpm = Dpm.all\n end",
"title": ""
},
{
"docid": "de956c7156ce6a7ad46fb0033eaac853",
"score": "0.44165137",
"text": "def index\n @pacientes = Pacientes.all\n render json: @pacientes\n end",
"title": ""
},
{
"docid": "7d8a1b2ee7ff8ede7bbb5850a67b9022",
"score": "0.44123638",
"text": "def index\n @medical_practitioners_profiles = MedicalPractitionersProfile.all\n render json: @medical_practitioners_profiles\n end",
"title": ""
},
{
"docid": "19193303c25d515adc4beb6dee7c81bd",
"score": "0.43977073",
"text": "def index\n @perks = Perk.all\n end",
"title": ""
},
{
"docid": "620dc9a3bf556a55db616c5677b7daff",
"score": "0.4397672",
"text": "def destroy\n if current_user.admin\n @psp_diagrams_to_ps_perimeter.destroy\n respond_to do |format|\n format.html { redirect_to psp_diagrams_to_ps_perimeters_url, notice: 'Psp diagrams to ps perimeter was successfully destroyed.' }\n format.json { head :no_content }\n end\n else \n redirect_to \"/ps_perimeters\", notice: 'Cannot delete uploaded document.'\n end\n end",
"title": ""
},
{
"docid": "a15cf78aa220b3ac58d61d02aeb2bfe8",
"score": "0.43956003",
"text": "def index\n @plane_pictures = PlanePicture.all\n end",
"title": ""
},
{
"docid": "e3f60ffb040d143eaff770a48822fa3f",
"score": "0.4393066",
"text": "def show\n render json: @gpsd\n end",
"title": ""
},
{
"docid": "f5145b272aa2e076d25c4b2e69cacd03",
"score": "0.43855223",
"text": "def index\n @painters = Painter.all\n end",
"title": ""
},
{
"docid": "298ed83dfd163acce1c97aa3eac4cd2d",
"score": "0.43838876",
"text": "def index\n @p_times = PTime.all\n end",
"title": ""
},
{
"docid": "19f23b7eab13609528524f59def86999",
"score": "0.4381313",
"text": "def index\n @patrimonies = Patrimony.all.paginate(page: params[:page])\n end",
"title": ""
},
{
"docid": "fb3f09d527696c561cdb45187b430153",
"score": "0.43760765",
"text": "def splatts \n\t@user = User.find(params[:id])\n\n\trender json: @user.splatts\n\tend",
"title": ""
},
{
"docid": "21788865a38065ab459d21ff08b069fa",
"score": "0.4372413",
"text": "def show\r\n\r\n @pdv = Pdv.find(params[:id])\r\n @pdv.asegurar\r\n @json = @pdv.to_gmaps4rails\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @pdv }\r\n\r\n end\r\n end",
"title": ""
},
{
"docid": "f27fc4adf9236228504b1eedbd122c42",
"score": "0.43691203",
"text": "def index\n @patrocinios = Patrocinio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @patrocinios }\n end\n end",
"title": ""
},
{
"docid": "0fb6ebbe949a844722497d4aa1730541",
"score": "0.43635863",
"text": "def index\n @precincts = Precinct.all(:order => \"number\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @precincts }\n end\n end",
"title": ""
},
{
"docid": "c2f6d2d39ae3624dabadb6fe0ede5566",
"score": "0.43634737",
"text": "def panoramics(landmarks)\n result = []\n landmarks.each_with_index do |landmark, idx|\n next_landmark = landmarks[idx + 1] || landmarks[0]\n result << [landmark, next_landmark]\n end\n result\nend",
"title": ""
},
{
"docid": "80eb38bce5a2c830088ea42e9db904fe",
"score": "0.43629813",
"text": "def show\n @portion = Portion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @portion }\n end\n end",
"title": ""
},
{
"docid": "7c998db591da6f4255db860549d87761",
"score": "0.43623123",
"text": "def index\n @expertises = current_user.expertises.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @expertises }\n format.js { render :json => @expertises.collect(&:to_sparkline) }\n end\n end",
"title": ""
},
{
"docid": "9f157c0140ee46feabc71dae5a7379b6",
"score": "0.43618375",
"text": "def URSI2PPI(thisURSI)\r\n\t$logger.debug { \"URSI2PPI: looking for PPI for URSI: \" + thisURSI }\r\n\r\n\tsubject = $piggybank.get_demographics_by_ursi thisURSI\r\n\tif subject.first_name == nil\r\n\t\t$logger.warn { \" Couldn't find URSI '\" + thisURSI +\r\n\t\t\t\"' demographics data in COINS!\" }\r\n\t \treturn [nil, nil]\r\n\tend\r\n \tdob = convertStringToTime(subject.birth_date)\r\n\r\n\treturn [dob, subject.gender]\r\nend",
"title": ""
},
{
"docid": "baa7943ff007cb226c5fa93fffab0ea7",
"score": "0.4361455",
"text": "def set_panier\n @panier = @farm.paniers.find(params[:id])\n @portions = @panier.portions.all\n end",
"title": ""
},
{
"docid": "65b27e8f5c63ac06261cf328e570ee2a",
"score": "0.435971",
"text": "def index\n @chord_diagrams = ChordDiagram.all\n end",
"title": ""
},
{
"docid": "4f0db12dbbc41a37a79859f8f50631a7",
"score": "0.43590215",
"text": "def puzzles\n speedrun_level = SpeedrunLevel.todays_level || SpeedrunLevel.first_level\n render json: {\n level_name: speedrun_level.name,\n puzzles: speedrun_level.puzzles\n }\n end",
"title": ""
},
{
"docid": "09f7f3fb02ec8c314fa971e37abc2ce8",
"score": "0.43574944",
"text": "def player_points_by_game\n player = Player.find(params[:id])\n stats = Statline.where(player: player).order(date: :asc)\n data = Array.new\n labels = Array.new\n stats.each do |line|\n labels << line.opponent.name\n data << line.points\n end\n json = { data: data, labels: labels }\n\n render json: json\n end",
"title": ""
},
{
"docid": "815107636912d0a63bd598db22de550f",
"score": "0.43533486",
"text": "def index\n @panlists = Panlist.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @panlists }\n end\n end",
"title": ""
},
{
"docid": "677cc23a1eb8ca5f4da1971995b47c53",
"score": "0.43526608",
"text": "def panoramic_pairs(landmarks)\n\nend",
"title": ""
},
{
"docid": "1ec55640eb2020a2f6dfaabacf968d84",
"score": "0.4348582",
"text": "def index\n @panoramas = current_user.panoramas\n end",
"title": ""
},
{
"docid": "c0abaecb58f97c7aa065618f6a6b26b2",
"score": "0.43391246",
"text": "def convert_all_pokemon\n pokemon_json = []\n @data.each_with_index do |pokemons, id|\n forms = []\n pokemon_json << {\n regionalId: pokemons.first.id_bis,\n db_symbol: pokemons.first.db_symbol || :__undef__,\n id: id,\n forms: forms\n }\n pokemons.each { |pokemon| forms << convert_single_pokemon(pokemon) if pokemon }\n end\n return pokemon_json\n end",
"title": ""
},
{
"docid": "df5ba3033c77f19b873af42d89579dc8",
"score": "0.4337234",
"text": "def splatts\n \t@user = User.find(params[:id])\n \t\n \trender json: @user.splatts\n end",
"title": ""
},
{
"docid": "625eb34531338ee288c53422105b0918",
"score": "0.433577",
"text": "def get_all_time_sampling_profile\n {\n method: \"Memory.getAllTimeSamplingProfile\"\n }\n end",
"title": ""
},
{
"docid": "99aaba96abce1b2cf406eb8587adab16",
"score": "0.43250608",
"text": "def get_probs(mps)\n result = []\n mps.each_with_index do |mp,i|\n mp[1].each_with_index do |e,j|\n result << [[mp[0], e[0]].join(\".\"), e[1]]\n end\n end\n result\n end",
"title": ""
},
{
"docid": "cfc0337c58a34e6b82ff349eb34cdbf9",
"score": "0.43246204",
"text": "def index\n @deductions = @painter.deductions.all\n end",
"title": ""
},
{
"docid": "54b851b928f432c0986e73f9dd490217",
"score": "0.4323456",
"text": "def index\n @selection_printing_sizes = SelectionPrintingSize.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @selection_printing_sizes }\n end\n end",
"title": ""
},
{
"docid": "1817321ed29122826cc00e5ddd3ddda6",
"score": "0.43144348",
"text": "def taken_promos\n respond_to do |format|\n @promos = Promo.get_taken_promos_for_user current_user\n format.html { render \"promos/content\" }\n end\n end",
"title": ""
},
{
"docid": "2ac8d80c8d7728b20a8e17a8aab4351a",
"score": "0.4312614",
"text": "def index\n @paies = @periode.paies.all\n end",
"title": ""
},
{
"docid": "ccb431122a4bf85e65fab81da6082cb9",
"score": "0.43115625",
"text": "def doctor_pds\r\n \r\n if current_user.role.name == 'Doctor'\r\n @doctor_id = current_user.person_info.id\r\n logger.info \"Doctor id is #{@doctor_id.inspect}\"\r\n @doctor_personal_patients = ConfirmedAppointment.joins(:pre_appointment).where('confirmed_appointments.doctor_id =? AND confirmed_appointments.active_status =? AND (pre_appointments.appointment_type_id =? ) ', @doctor_id, true, 'PD' ).order(\"created_at desc\")\r\n \r\n logger.info \"this is the personal patients of the doctor #{@doctor_personal_patients.inspect}\"\r\n \r\n # if @doctor_video_appointments.blank?\r\n # flash.now[:notice] = \"Sorry you do not have any appointment\"\r\n # end\r\n \r\n respond_to do |format| \r\n format.js \r\n format.html { \"<script type='text/javascript'> window.location.href='/comfirmed_appointments/index'</script>\" }\r\n format.json { render :show, status: :created, location: @doctor_personal_patients }\r\n end\r\n \r\n end\r\n \r\n end",
"title": ""
},
{
"docid": "dc7299eafb66b9143f6d80f2d60ed0ac",
"score": "0.43109933",
"text": "def index\n @pithchers = Pithcher.all\n end",
"title": ""
},
{
"docid": "dd94cae6ae4336fdd2fccae8c9f6fc96",
"score": "0.43109754",
"text": "def index\n @pitchings = Pitching.all\n end",
"title": ""
},
{
"docid": "ddb5b45d8bc8d50c503ff9345658ab9e",
"score": "0.43058375",
"text": "def index\n @pitches = Pitch.all\n end",
"title": ""
},
{
"docid": "9cdfa5216f7973065ef4e9d574a47d6c",
"score": "0.43041447",
"text": "def puzzles\n render json: {\n # This uses the same puzzle pool as Haste mode\n puzzles: HastePuzzle.random_level(100).as_json(lichess_puzzle_id: true)\n }\n end",
"title": ""
},
{
"docid": "58decfd90a9b7e90daf919bfa97868de",
"score": "0.43034708",
"text": "def index\n @mugshots = Mugshot.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mugshots }\n end\n end",
"title": ""
},
{
"docid": "8a156b4e0e027e511fdd8b56e360d354",
"score": "0.43034607",
"text": "def drips\n drip_collection.values\n end",
"title": ""
},
{
"docid": "bfe36bd765719453f7315fc04e8b7b67",
"score": "0.42931387",
"text": "def current_swimmers\n team = Team.find_by_id( params[:id] )\n if team\n render( json: team.swimmers.uniq.to_a )\n else\n render( json: [] )\n end\n end",
"title": ""
},
{
"docid": "983e7ad56fb65711405c23e7baec2a35",
"score": "0.42921388",
"text": "def show\n @pinit = Pinit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pinit }\n end\n end",
"title": ""
},
{
"docid": "4309486f028b3c82799af3b2348a96e4",
"score": "0.4288502",
"text": "def index\n @pitches = Pitch.all\n end",
"title": ""
},
{
"docid": "61471082dd742ec5c33810dad6866ca8",
"score": "0.42855626",
"text": "def get_scale\n scale = \"Moods:\\n\"\n @moods.each do |k,v| \n scale << \"#{k} = #{v}\\n\"\n end\n scale \n\tend",
"title": ""
},
{
"docid": "1450868a386728fdac5d307e8365960a",
"score": "0.42827317",
"text": "def get_peptides_for_protein(protein_node)\n\t\tself.find(protein_node,\"PeptideHypothesis\")\n\tend",
"title": ""
},
{
"docid": "063db0fce84481f58478a76a992a867c",
"score": "0.42811581",
"text": "def index\n @plasmid_probes = PlasmidProbe.all\n end",
"title": ""
},
{
"docid": "3efeb0eab86106367251fc16affaeda2",
"score": "0.42807686",
"text": "def sparkline_data\n @p = live_problems\n data = @p.where(:difficulty => ['V0', 'V0+', 'V0-']).count.to_s\n (1..16).each do |n|\n data << \",\" << @p.where(:difficulty => [\"V#{n}\", \"V#{n}+\", \"V#{n}-\"]).count.to_s\n end\n return data\n end",
"title": ""
},
{
"docid": "8eb58c6ebfc859a3edfc50c739fadbc1",
"score": "0.42799175",
"text": "def get_proteinas\n @_100=((@proteinas*100)/@peso)\n @ir_100=(@_100/50)*100\n @porcion=((@proteinas*@gramos_porciones)/@peso)\n @ir_porcion=(@porcion/50)*100\n\t\t#p\"| #{@proteinas} | #{@_100} | #{@ir_100.round(1)}% | #{@porcion} | #{@ir_porcion.round(1)}% |\"\n [ @proteinas , @_100 , @ir_100.round(1) , @porcion , @ir_porcion.round(1) ]\n end",
"title": ""
},
{
"docid": "ca2cf0f4f337615f151d8104c11c4d92",
"score": "0.42793345",
"text": "def dumpPpms()\r\n 79.times {print \"=\"}\r\n puts\r\n puts \"PPM DUMP\".center(80)\r\n 79.times {print \"=\"}\r\n puts\r\n\r\n if(@ppms.length > 0)\r\n ppms = @ppms.sort\r\n ppms.each do |key, ppm|\r\n puts \"#{ppm.name}\\t(#{ppm.alias})\"\r\n end\r\n\r\n else\r\n puts \"No PPM variables to dump.\"\r\n end\r\n\r\n puts \"\"\r\n\r\n end",
"title": ""
},
{
"docid": "495568548272270815ce58ce0fb60653",
"score": "0.42762235",
"text": "def galleries\n paintings.map do |p|\n p.gallery\n end\n end",
"title": ""
},
{
"docid": "e6d2c0c1761df2aec566d4728044edd2",
"score": "0.42729238",
"text": "def access_decisions_by_barcodes\n render json: Recording.all.pluck(:mdpi_barcode, :access_determination).as_json\n end",
"title": ""
},
{
"docid": "be86e7bdabacf6d2678b62b3d5a291f8",
"score": "0.4271024",
"text": "def index\n @gppts = Gppt.all\n end",
"title": ""
},
{
"docid": "66ac477c285a5c4eceec65299601fb94",
"score": "0.42696795",
"text": "def index\n\n @ipranges = Iprange.all\n\n render json: @ipranges\n\n end",
"title": ""
}
] |
8eaee9de6e04ca5f39406a54ba7ba7cc
|
GET /group_user_rels/new GET /group_user_rels/new.json
|
[
{
"docid": "3773d554cdade82abe9d53c1707a51c5",
"score": "0.772877",
"text": "def new\n @group_user_rel = GroupUserRel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group_user_rel }\n end\n end",
"title": ""
}
] |
[
{
"docid": "2a54e4deda9c1b8dfce97f6a2d53976d",
"score": "0.709764",
"text": "def new\n @user = User.find(params[:user_id])\n @groups = @user.groups.new\n\n #@group = Group.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group }\n end\n end",
"title": ""
},
{
"docid": "4de3979b872ead1bb09f6c79c32192d1",
"score": "0.7009889",
"text": "def new\n @add_group_to_user = AddGroupToUser.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @add_group_to_user }\n end\n end",
"title": ""
},
{
"docid": "836c340e25744926cb13ed2af86bb718",
"score": "0.69674253",
"text": "def new\n @user_group = UserGroup.new\n @users = User.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user_group }\n end\n end",
"title": ""
},
{
"docid": "4a18e9922f1bb166a0d5f97da55789ff",
"score": "0.69439286",
"text": "def create\n @group_user_rel = GroupUserRel.new(params[:group_user_rel])\n\n respond_to do |format|\n if @group_user_rel.save\n format.html { redirect_to edit_user_path(@group_user_rel.user), notice: \"#{@group_user_rel.user.name} has been added to the '#{@group_user_rel.group.name}' group\" }\n format.json { render json: @group_user_rel, status: :created, location: @group_user_rel }\n else\n format.html { render action: \"new\" }\n format.json { render json: @group_user_rel.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e6a66ac1bb736515d76cc54dd7ef7869",
"score": "0.68133426",
"text": "def new\n @group = Group.new\n # @group_user = @current_user.join_group(@group)\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group_user }\n end\n end",
"title": ""
},
{
"docid": "f3d98c59014924cdc2ec937b1cd3a07f",
"score": "0.6790851",
"text": "def new\n @user_group = UserGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user_group }\n end\n end",
"title": ""
},
{
"docid": "04c538010afd620825066099531f93dd",
"score": "0.6771671",
"text": "def new\n\t\t#\tget business rules for each account type\n\t #if this new user is assigned to an existing group it should be in the params.\n\t\t@group = params[:group].blank? ? Group.new() : Group.find_by_id(params[:group][:id])\n @group.name ||= \"MyGroup\"\n\t\t@user = User.new()\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "158b9e2e798d16be3db5a8640bf84779",
"score": "0.65974724",
"text": "def new\n #@user = User.new\n @user.active = true\n @user.role_ids = [1]\n @user.groupings << current_user.root_grouping\n #@assigned_roles = []\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "bb868eff7e5520ca5cf962abf2a4864c",
"score": "0.64485806",
"text": "def new\n Group.rebuild! if nil.|Group.find(:first).rgt\n\t @group = Group.new\n\t @groups = current_user.get_unique_group_branches.map {|g| g.get_self_and_children?}.flatten\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n end\n end",
"title": ""
},
{
"docid": "fb5ef1ad5c2812dfc9821afab4f13b20",
"score": "0.6390404",
"text": "def new_nodegroup(nodegroup_json)\n nodemgr_rest_call(\"POST\", \"classifier\", \"groups\", $credentials, id=\"\", nodegroup_json)\nend",
"title": ""
},
{
"docid": "843af27deb98de388d971ac759db91f1",
"score": "0.6334738",
"text": "def new\n @user = User.new\n @groups = Group.all(:order => [:name.desc])\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "8e4be7b7769d1595017edb6fa5da8725",
"score": "0.6325432",
"text": "def new\n @groupaddrobj = Groupaddrobj.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @groupaddrobj }\n end\n end",
"title": ""
},
{
"docid": "72cc3fb0427d240d865509a11f704037",
"score": "0.6285115",
"text": "def new\n UserGroup.new\n @cta = Cta.create({workflow_status: 0, pi_id: current_user.id})\n ci_relation = CtaRelation.new(name: 'ci', group_type: 2, cta_id: @cta.id)\n cci_relation = CtaRelation.new(name: 'cci', group_type: 2, cta_id: @cta.id)\n ci_relation.save\n cci_relation.save\n ci_relation.users << current_user\n ci_relation.save\n cci_relation.save\n redirect_to (@cta.add_form 'A'), action: :edit\n end",
"title": ""
},
{
"docid": "48bafc5ce78efba976a67f7624570b0c",
"score": "0.62750554",
"text": "def new\n @jido_grp_rel = JidoGrpRel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @jido_grp_rel }\n end\n end",
"title": ""
},
{
"docid": "f87f0fcfe7aab538462468c3a01def99",
"score": "0.627074",
"text": "def new\n @group = Group.new\n render json: @group\n end",
"title": ""
},
{
"docid": "7e3e82489fe9c5d1f6355549ac3e6b9c",
"score": "0.626205",
"text": "def new\n @relation = Relation.new(user_id: session[:user_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @relation }\n end\n end",
"title": ""
},
{
"docid": "10579c3d3cc989fec15a1ace9f9c505e",
"score": "0.6259225",
"text": "def new\n @newuser = Newuser.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newuser }\n end\n end",
"title": ""
},
{
"docid": "9f640e042b091bfd7159f1be78fc0a8f",
"score": "0.6241359",
"text": "def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group }\n end\n end",
"title": ""
},
{
"docid": "9f640e042b091bfd7159f1be78fc0a8f",
"score": "0.6241359",
"text": "def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group }\n end\n end",
"title": ""
},
{
"docid": "9f640e042b091bfd7159f1be78fc0a8f",
"score": "0.6241359",
"text": "def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group }\n end\n end",
"title": ""
},
{
"docid": "9f640e042b091bfd7159f1be78fc0a8f",
"score": "0.6241359",
"text": "def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group }\n end\n end",
"title": ""
},
{
"docid": "9f640e042b091bfd7159f1be78fc0a8f",
"score": "0.6241359",
"text": "def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group }\n end\n end",
"title": ""
},
{
"docid": "9f640e042b091bfd7159f1be78fc0a8f",
"score": "0.6241359",
"text": "def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group }\n end\n end",
"title": ""
},
{
"docid": "9f640e042b091bfd7159f1be78fc0a8f",
"score": "0.6241359",
"text": "def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group }\n end\n end",
"title": ""
},
{
"docid": "9f640e042b091bfd7159f1be78fc0a8f",
"score": "0.6241359",
"text": "def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group }\n end\n end",
"title": ""
},
{
"docid": "17fb254233bcd1a3b38da5d638c8a6bf",
"score": "0.6240411",
"text": "def new\n @group = Group.new\n\n render json: @group\n end",
"title": ""
},
{
"docid": "3a984dc46b228b8fab27a006cff4fee2",
"score": "0.62349856",
"text": "def new\n @user_group = UserGroup.new\n\t\t@all_permissions = Lockdown::System.permissions_assignable_for_user(current_user)\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user_group }\n end\n end",
"title": ""
},
{
"docid": "14d48c30451f8afa609eaced8133477a",
"score": "0.62301505",
"text": "def new\n @group = Group.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group }\n end\n end",
"title": ""
},
{
"docid": "73820fd25d5753d98b024030c50d7e3a",
"score": "0.6222219",
"text": "def new\n @group_member = GroupMember.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group_member }\n end\n end",
"title": ""
},
{
"docid": "129dfe7ddac804507626d4f738b13097",
"score": "0.6216719",
"text": "def new\n @user = User.find_by_id(current_user.id)\n @group = Group.find_by_id(@user.currentgroupid)\n @account = Account.new\n \n \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @account }\n end\n end",
"title": ""
},
{
"docid": "5ddc98d82e6a841358618e1bbbb8b766",
"score": "0.6207891",
"text": "def new\n @groupc_user = GroupcUser.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @groupc_user }\n end\n end",
"title": ""
},
{
"docid": "f10db825bcc9a0bb69adcc52f6c98ed2",
"score": "0.6206635",
"text": "def new2\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"title": ""
},
{
"docid": "25d42d051ca084b66aacb6bfd85aa6e5",
"score": "0.62025875",
"text": "def new\n @user = User.new\n @user.pending_memberships.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"title": ""
},
{
"docid": "6ee8a3ca84930e7767f3af61431514c8",
"score": "0.6200398",
"text": "def new\n @user_group = UserGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user_group }\n end\n end",
"title": ""
},
{
"docid": "4e4b24e3210b5e18070927418dd61aa7",
"score": "0.61971253",
"text": "def new\n @usernew = Usernew.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @usernew }\n end\n end",
"title": ""
},
{
"docid": "281954b7cf0d5e181e3f3d8461e68776",
"score": "0.6193653",
"text": "def new\n @users = User.all\n @groups = Group.all\n @message = Message.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "6791a8f0208cd4bff5a4335c9c5b8edd",
"score": "0.61916584",
"text": "def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @group }\n end\n end",
"title": ""
},
{
"docid": "6791a8f0208cd4bff5a4335c9c5b8edd",
"score": "0.61916584",
"text": "def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @group }\n end\n end",
"title": ""
},
{
"docid": "66e89809aeffb8938c88cd518ef01105",
"score": "0.6180205",
"text": "def new\n @group = Group.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @group }\n end\n end",
"title": ""
},
{
"docid": "42539d0ab5f2974facb6920ab468bf7e",
"score": "0.61741114",
"text": "def create\n #logger.info \"Post parameters: #{params}\"\n @group = Group.new(name: params[:group][:name], expiration: params[:group][:expiration])\n if @group.save\n params[:group][:users].each do |u|\n Membership.create(group: @group, user: User.where(\"id = ? OR email = ?\", u[:id], u[:email]).first, admin:u[:admin])\n end\n render json: @group, status: :created, location: @group\n else\n render json: @group.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "c45718ece36f6ee44f94a14b71cc88df",
"score": "0.6166859",
"text": "def new\n @roles = current_user.pass_on_roles.to_a || [] # logged-in user can give his own roles to new user\n @user = User.new\n \n params[:id] = current_user.center if params[:id] == \"0\"\n \n if !params[:id].nil? # create new user for specific center/team\n @groups = Group.this_or_parent(params[:id])\n @group = Group.find(params[:id])\n @user.groups += @groups\n else\n @groups = if current_user.has_role?(:centeradmin)\n \tGroup.where(:center_id => current_user.center_id)\n \telse\t\n \t current_user.center_and_teams\n\t end\n end\n\n if current_user.has_role?(:superadmin) # superadmin can create users in all groups\n @groups = (Center.all + current_user.center.teams).sort_by { |c| c.title }\n end\n\n end",
"title": ""
},
{
"docid": "0b4236a27a4152e777a2e87e8104d52e",
"score": "0.6165505",
"text": "def new\n @user = User.new\n @action = \"new\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"title": ""
},
{
"docid": "853a0ff14b6a3304556cec49773147cc",
"score": "0.61532694",
"text": "def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @group }\n end\n end",
"title": ""
},
{
"docid": "12673fb03395182abe590a2bdc04b7f7",
"score": "0.61419237",
"text": "def create\n # @group_user = GroupUser.new(params[:group_user])\n @group_user = @current_user.join_group(@group)\n respond_to do |format|\n if @group_user\n format.html { redirect_to @group, notice: 'Group user was successfully created.' }\n format.json { render json: @group_user, status: :created, location: @group_user }\n else\n format.html { render action: \"new\" }\n format.json { render json: @group_user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8db28f8759e20bf36ad509852b632c6d",
"score": "0.6126586",
"text": "def new\n @group = @authorized_group\n @user = User.new\n @role_mapping = RoleMapping.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "426826d527b7826dec06f7f54dbbab01",
"score": "0.61227983",
"text": "def create\n #logger.info \"Post parameters: #{params}\"\n @group = Group.new(name: params[:group][:name], expiration: params[:group][:expiration], owner: current_user)\n if @group.save\n @group.memberships.create!(user: current_user, admin: true)\n if params[:group][:users]\n params[:group][:users].each do |u|\n @group.memberships.create!(user: User.where(\"id = ? OR email = ?\", u[:id], u[:email]).first, admin:u[:admin])\n end\n end\n render json: @group, status: :created, location: @group\n else\n render json: @group.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "e3ca3eeb119d27308acf7d4eba4e276b",
"score": "0.6114845",
"text": "def new\n @user = user.new\n\t\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"title": ""
},
{
"docid": "8b6c880978f4c4b1ddf93133c409b7db",
"score": "0.6111835",
"text": "def new\n @user = User.new(:organization_id => current_org.id)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"title": ""
},
{
"docid": "c4e7000d968b6b489367c408e3ecc2aa",
"score": "0.61059636",
"text": "def new\n @user_group = UserGroup.new\n @permissions = {}\n @group_permissions = Permission.get_group_permissions\n @group_permissions.each do |g|\n @permissions[g.group_permission_name] = Permission.get_permission_in_group_permission(g.group_permission_name)\n end\n end",
"title": ""
},
{
"docid": "dfc1533ef95e3dc60d6fec569112281f",
"score": "0.6087152",
"text": "def create\n @user = User.find(params[:user_id])\n if @user.is_member?(@group)\n render_error(404, request.path, 20100, \"User is already a member.\")\n else\n if @user.join!(@group)\n render json: { result: 1,\n group_id: @group.id,\n group_name: @group.name,\n user_count: @group.users.count }\n else\n render json: {result: 0}\n end\n end\n end",
"title": ""
},
{
"docid": "0a511a6344f6faa0f0470c14cd002f6d",
"score": "0.60792726",
"text": "def new\n @reagent_group = ReagentGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reagent_group }\n end\n end",
"title": ""
},
{
"docid": "52c4b7546664200b4f9c3c6b6fd0801c",
"score": "0.60437083",
"text": "def new\n @group_user = GroupUser.new(params[:group_user])\n\n respond_to do |format|\n format.html\n format.xml { render :xml => @group_user.to_xml }\n end\n end",
"title": ""
},
{
"docid": "72c91b23099f91a28b5b59fba0a53636",
"score": "0.6040128",
"text": "def new\n @groupon = Groupon.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @groupon }\n end\n end",
"title": ""
},
{
"docid": "9b4c43c8e8c0c2814a15d2af17113a0c",
"score": "0.6037959",
"text": "def new\n \n @mostkhdmeen_user = User.new \n @groups = Group.all\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mostkhdmeen_user }\n end\n end",
"title": ""
},
{
"docid": "3a757b5359bf757c7e51de471bc587c8",
"score": "0.60284466",
"text": "def create\n @reagent_group = ReagentGroup.new(params[:reagent_group])\n unless @reagent_group.users.include? current_user\n @reagent_group.users << current_user\n end\n respond_to do |format|\n if @reagent_group.save\n format.html { redirect_to @reagent_group, notice: 'Reagent group was successfully created.' }\n format.json { render json: @reagent_group, status: :created, location: @reagent_group }\n else\n format.html { render action: \"new\" }\n format.json { render json: @reagent_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "066118198869af86b14206e0f4548f78",
"score": "0.6028103",
"text": "def new\n @user_resource = @user.user_resource.new()\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user_resource }\n end\n end",
"title": ""
},
{
"docid": "889759c0b82c46fcf24f3381aa58937f",
"score": "0.6026362",
"text": "def new\n @group = Group.new(:owner => current_user)\n authorize @group, :new?\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n end\n end",
"title": ""
},
{
"docid": "23344b5c33b1b02302c49e05468b4317",
"score": "0.60168093",
"text": "def create\n @group = @current_user.create_group(params[:group])\n # @group = @current_user.groups.build(params[:group])\n # @group = Group.new(params[:group])\n\n respond_to do |format|\n if @group.valid?\n format.html { redirect_to circle_groups_path, notice: 'Group was successfully created.' }\n format.json { render json: @group, status: :created, location: @group }\n else\n format.html { render action: \"new\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "667e3d2a4fb025bdb580af640fbb7ca7",
"score": "0.6010553",
"text": "def create\n @group = Group.new(group_params)\n @group.owner = current_user\n\n if @group.save\n @group.add!(current_user)\n \n render json: @group, status: :created, location: @group\n else\n render json: @group.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "a5c40152540ebf491f8172a2b8e61d92",
"score": "0.6007116",
"text": "def create\n ip = request.location\n @user = current_user\n @group = @user.groups_as_owner.new(params[:group])\n params[:group][:member_ids] = (params[:group][:member_ids] << @group.member_ids).flatten\n @group.school_id = @user.school_id\n respond_to do |format|\n if @group.save\n format.html { redirect_to @group, notice: 'Group was successfully created.' }\n format.json { render json: @group, status: :created, location: @group }\n else\n format.html { render action: \"new\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1ce763424aa1091db353bf923e1b2caa",
"score": "0.6006224",
"text": "def new\n @title = \"New User\"\n\n @user = User.new\n @user.user_roles.build\n respond_to do |format|\n format.html #new.html.erb\n format.js\n format.json { render json: @user }\n end\n end",
"title": ""
},
{
"docid": "bfb6aeb0e270ef48723dc03976bdd709",
"score": "0.60035545",
"text": "def new\n @title = \"Добавление группы характеристик\"\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group }\n end\n end",
"title": ""
},
{
"docid": "bcfb7193862fa5eb4122f727e5eb488c",
"score": "0.600138",
"text": "def new\n @grupo_biblico = GrupoBiblico.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @grupo_biblico }\n end\n end",
"title": ""
},
{
"docid": "3bd6f4ff2bf0a16f2574e8e98fe120d6",
"score": "0.59894204",
"text": "def new\n @special_groups_user = SpecialGroupsUser.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @special_groups_user }\n end\n end",
"title": ""
},
{
"docid": "948180cf0306e897e615142208b58c00",
"score": "0.59849036",
"text": "def new\n add_breadcrumb \"Social\", social_path()\n add_breadcrumb \"Create group\"\n \n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n end\n end",
"title": ""
},
{
"docid": "76871cbc48e6eb14a6c49138cb00183e",
"score": "0.5975315",
"text": "def new\n puts params\n new_email = params[:document_group][:email]\n doc_id = params[:document_group][:document_id]\n puts new_email\n puts doc_id\n render json: { status: \"ok\" }\n User.invite!({:email => new_email}, current_user )\n new_user = User.find_by_email(new_email)\n DocumentGroup.create!({document_id: doc_id, user_id: new_user.id })\n render json: { status: \"ok\" }\n # puts \"sent!\"\n # end\n \n end",
"title": ""
},
{
"docid": "4c22e857bd7a85b51f3b9b504fca481d",
"score": "0.59704256",
"text": "def new\n @breadcrumb = 'create'\n @ratio_group = RatioGroup.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ratio_group }\n end\n end",
"title": ""
},
{
"docid": "c328687b103445a8374b2d0a210fbff9",
"score": "0.5968532",
"text": "def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group }\n format.xml { render xml: @group }\n end\n end",
"title": ""
},
{
"docid": "61751f69b6c6952f621a1c5da57de9eb",
"score": "0.5967025",
"text": "def new\n @edited << 'new'\n @expanded << 'new'\n\n respond_to do |format|\n format.html { render template: 'shared/new' }\n format.js { render 'user' }\n format.json { render json: @user }\n end\n end",
"title": ""
},
{
"docid": "401f1dca5c7a4fa7011c7d9dd0bf31eb",
"score": "0.5955011",
"text": "def new\n @manifestation_relationship_type = ManifestationRelationshipType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @manifestation_relationship_type }\n end\n end",
"title": ""
},
{
"docid": "2b14d78a1aafb41f301b9c7e86bc8aa3",
"score": "0.5950802",
"text": "def new\n @store_owner = StoreOwner.new(store_id: @store.id)\n @users = @group.users\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @store_owner }\n end\n end",
"title": ""
},
{
"docid": "72806eb547e31fed878918f91bb300d7",
"score": "0.5932598",
"text": "def new\n @group_request = GroupRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @group_request }\n end\n end",
"title": ""
},
{
"docid": "0eed20f15f411f8ebd94e4632c227700",
"score": "0.5932291",
"text": "def new\n @relation = Relation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @relation }\n end\n end",
"title": ""
},
{
"docid": "86e2bcdc4e383d277ff0e226a8a8a12e",
"score": "0.5931524",
"text": "def new\n @group = Group.new\n respond_to do |format|\n #format.html # new.html.erb\n format.json { render json: @group }\n end\n end",
"title": ""
},
{
"docid": "d034fa37a61c6d82b16cf05987863fe0",
"score": "0.59268516",
"text": "def new\n @group_stat = GroupStat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group_stat }\n end\n end",
"title": ""
},
{
"docid": "cbfbc06c0ebe14dea15d780328c7ab2c",
"score": "0.5924553",
"text": "def new\n @groups = Group.all\n respond_to do |format|\n format.html # new.html.haml\n format.xml { render :xml => @person }\n format.json { render :json => @person }\n end\n end",
"title": ""
},
{
"docid": "6eed2b945d2fb94222ad0c68c64cfbc4",
"score": "0.5922743",
"text": "def create\n @user.create_group!(new_group_params[:group_user_ids], {name: new_group_params[:name]})\n end",
"title": ""
},
{
"docid": "95f6848bfc681ef983b9902f3303da68",
"score": "0.59126025",
"text": "def new\n @goal = @group.goals.new\n # @goal = Goal.new\n # @goal.group = @group\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @goal }\n end\n end",
"title": ""
},
{
"docid": "82bd4b9da90fa17c61558a7cbbeb3f39",
"score": "0.5910772",
"text": "def new\n @message = Message.new\n @people = User.where(:group_id => current_user.group_id)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end",
"title": ""
},
{
"docid": "5f5c13249f5602a0b25265fba2fa9555",
"score": "0.5908467",
"text": "def new\n @user = ::User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"title": ""
},
{
"docid": "b05aa1aa2bf45bad2dc0d0aaff8a9732",
"score": "0.59082234",
"text": "def new\n @graph_membership_graph = GraphMembershipGraph.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @graph_membership_graph }\n end\n end",
"title": ""
},
{
"docid": "36e7dec5bf8d73559037f9536b603213",
"score": "0.58996016",
"text": "def create\n @user_group = UserGroup.new(params[:user_group])\n\n respond_to do |format|\n if @user_group.save\n format.html { redirect_to @user_group, notice: 'User group was successfully created.' }\n format.json { render json: @user_group, status: :created, location: @user_group }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "36e7dec5bf8d73559037f9536b603213",
"score": "0.58996016",
"text": "def create\n @user_group = UserGroup.new(params[:user_group])\n\n respond_to do |format|\n if @user_group.save\n format.html { redirect_to @user_group, notice: 'User group was successfully created.' }\n format.json { render json: @user_group, status: :created, location: @user_group }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7caa3835dfac6c8bfb4bc8ebca9e8019",
"score": "0.5898972",
"text": "def create\n group_ids = params[\"group_id\"]\n org_id = params[:organization_id]\n @user = User.new(full_name: params[:full_name], password: params[:password], password_confirmation: params[:password], email: params[:email], status: params[:status], staff_number: params[:employee_id], career_path: params[:career_path], team_leader_id: nil)\n @user.user_group_ids = group_ids\n @user.organization_id = org_id\n\n respond_to do |format|\n if @user.save\n format.json { render json: @user }\n else\n format.json { render json: @user.errors.messages, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "633a6d87337b8ebc437aeffa523aa966",
"score": "0.5896514",
"text": "def new\n @user = User.new\n\n render json: @user\n end",
"title": ""
},
{
"docid": "688adf562ee1877858ac0580d56d6944",
"score": "0.58959717",
"text": "def new\n @account = Account.new\n @usergroups = get_groups_for_current_user\n if params[:groupid] && @usergroups.find {|grp| grp.id == params[:groupid].to_i}\n @account.group_id = params[:groupid]\n @defaultgroup = Group.find_by_id(params[:groupid]).name\n end \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @account }\n end\n end",
"title": ""
},
{
"docid": "a9157033b9aad827ca2a39bb00bc8bc3",
"score": "0.589382",
"text": "def new\n @register_group = RegisterGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @register_group }\n end\n end",
"title": ""
},
{
"docid": "fa4af7c834c76b185332eccacbf7e990",
"score": "0.58911455",
"text": "def new\n\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n format.json { render :json => @group }\n end\n end",
"title": ""
},
{
"docid": "01a21a975698e1e4b34d4dba284802ed",
"score": "0.5887764",
"text": "def new\n # Make the blank group_user a member of this group (via @parent)\n @group_user = @parent.new\n \n if !current_user or (!current_user.is_admin and !@group.owners.include?(current_user))\n redirect_to @group, :notice => \"You cannot add users to that group.\"\n return\n end\n\n form_prep #the view will need the listing of @users\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group_user }\n end\n end",
"title": ""
},
{
"docid": "d70f373691b47376773d94f11a7b3693",
"score": "0.5887422",
"text": "def create\n group_ids = params[\"user_groups\"]\n org_id = params[:organization_id]\n @user = User.new(params[:user])\n @user.user_group_ids = group_ids\n @user.organization_id = org_id\n\n if @user.save\n redirect_to organization_users_path(org_id)\n else\n flash[:error] = t('users.new.exist')\n @user_groups = UserGroup.all\n render :new\n end\n end",
"title": ""
},
{
"docid": "d70f373691b47376773d94f11a7b3693",
"score": "0.5887422",
"text": "def create\n group_ids = params[\"user_groups\"]\n org_id = params[:organization_id]\n @user = User.new(params[:user])\n @user.user_group_ids = group_ids\n @user.organization_id = org_id\n\n if @user.save\n redirect_to organization_users_path(org_id)\n else\n flash[:error] = t('users.new.exist')\n @user_groups = UserGroup.all\n render :new\n end\n end",
"title": ""
},
{
"docid": "0ca699eb667bda87f00056d0aba2e0f5",
"score": "0.58837426",
"text": "def new\n @group = current_user.created_groups.new\n end",
"title": ""
},
{
"docid": "2d1b18abd92665a2895cd0fb1b72ada0",
"score": "0.588167",
"text": "def new\n @grupo = Grupo.new\n authorize! :create, @grupo\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @grupo }\n end\n end",
"title": ""
},
{
"docid": "e0858f85962ea37c9566954b03c46a44",
"score": "0.587946",
"text": "def new\n @title = t('view.customers_groups.new_title')\n @customers_group = CustomersGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @customers_group }\n end\n end",
"title": ""
},
{
"docid": "e0858f85962ea37c9566954b03c46a44",
"score": "0.587946",
"text": "def new\n @title = t('view.customers_groups.new_title')\n @customers_group = CustomersGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @customers_group }\n end\n end",
"title": ""
},
{
"docid": "b7689524497aedbd88204f814a0259fb",
"score": "0.58781385",
"text": "def create\n @group = Group.new(params[:group])\n @group.users << current_user\n \n respond_to do |format|\n if @group.save\n @group.groups_users.first.update_attribute :level, 2\n flash[:notice] = 'Group was successfully created.'\n format.html { redirect_to(@group) }\n format.xml { render :xml => @group, :status => :created, :location => @group }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e6e601b95f265e9079e109691a20bd3c",
"score": "0.587346",
"text": "def new\n @reachmailgroup = Reachmailgroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reachmailgroup }\n end\n end",
"title": ""
},
{
"docid": "3a9914fde816347ddb2903f5c31300bf",
"score": "0.5869291",
"text": "def new\n @gnode = Gnode.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gnode }\n end\n end",
"title": ""
},
{
"docid": "8e40def3334e9cd3bc7195020643f7a3",
"score": "0.586546",
"text": "def new\n @grm = Grm.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @grm }\n end\n end",
"title": ""
},
{
"docid": "52d3958a6e054396d2ddc881a4c5a962",
"score": "0.5864014",
"text": "def new\n # When a http GET request to '/users/new' is received, have it render:\n # a view file with an empty form to create a new user.\n end",
"title": ""
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.