query
stringlengths 7
9.55k
| document
stringlengths 10
363k
| metadata
dict | negatives
sequencelengths 0
101
| negative_scores
sequencelengths 0
101
| document_score
stringlengths 3
10
| document_rank
stringclasses 102
values |
---|---|---|---|---|---|---|
Sets the current watching status to the specified name. | def watching=(name)
gateway_check
update_status(@status, name, nil, nil, nil, 3)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def competing=(name)\n gateway_check\n update_status(@status, name, nil, nil, nil, 5)\n end",
"def listening=(name)\n gateway_check\n update_status(@status, name, nil, nil, nil, 2)\n end",
"def set_status(val)\n self.status = val\n self\n end",
"def status=(value)\n value = value.to_s.to_sym\n fail Deployment::InvalidArgument, \"#{self}: Invalid task status: #{value}\" unless ALLOWED_STATUSES.include? value\n status_changes_concurrency @status, value\n @status = value\n reset_forward if DEPENDENCY_CHANGING_STATUSES.include? value\n @status\n end",
"def set_status\n self.status = 1\n end",
"def set(name)\n @name = name\n self\n end",
"def set_status(target, status)\n target.status = status\n end",
"def game=(name)\n gateway_check\n update_status(@status, name, nil)\n end",
"def setStatusInfo(name, value)\n @device.setStatusInfo(name,value) ;\n end",
"def status=(val)\n unless [nil, :frozen, :live].include?(val)\n raise ArgumentError.new(\"Status must be :frozen or :live\") \n end\n @status = val\n end",
"def []=(name, value)\n set_namevalue_glob(name,value, :color => 42) # 42 - aqua-marin, 7-green\n end",
"def change_name=(name)\n @name = name\n end",
"def change_status(status)\n unless @status == status\n @status = status\n @start_time = Time.now\n end\n end",
"def set_Status(value)\n set_input(\"Status\", value)\n end",
"def set_Status(value)\n set_input(\"Status\", value)\n end",
"def change_status(object, status)\n object.update_attribute :status, status\n end",
"def name=(name)\n set_if_changed(:name, name.to_s) do\n invalidate_cache!\n end\n end",
"def name_setter(new_name)\n @name = new_name\n end",
"def status=(new_status)\n update_values([:status] => new_status)\n end",
"def watcher(name)\n watchers.find { |watcher| watcher.name == name }\n end",
"def name=(value)\n client.put(path, { :name => value })\n self.data['name'] = value\n end",
"def collins_set_needs_rename!\n state = collins_osc_state\n state.merge!({\n 'running' => false,\n 'finished' => Time.now.to_i,\n 'current_state' => \"needs_rename\",\n 'next_state' => \"can_be_altered\"\n })\n\n self.collins_osc_state = state\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def set_name(name)\n @name = name\n end",
"def status=(newstatus)\n @log.debug(\"New status: '#{newstatus}'.\")\n puts \"Status: '#{newstatus}'.\"\n win_main = Knj::Gtk2::Window.get(\"main\")\n \n if win_main\n win_main.gui[\"statusbar\"].push(0, newstatus)\n end\n end",
"def set_status\n @status= {\n 'Unstarted' => 0,\n 'In Progress' => 1,\n 'Completed' => 2\n }\n end",
"def status=(new_status)\n self.last_status = status\n\n self.setValue new_status, forKey: 'status'\n end",
"def mark_as(status)\n self.status = status\n self.save\n end",
"def active_set_name(name)\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n Native.RunEditor_active_set_name(@handle.ptr, name)\n end",
"def update_status(status)\n @metric_status = status if STATUSES[status] > STATUSES[@metric_status]\n end",
"def set_status status\n self.update(pet_status: status)\n end",
"def name=(name_to_be_set)\n @name = name_to_be_set\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def status=(status)\n @_status = status\n end",
"def status=(status)\n @_status = status\n end",
"def name= (new_name)\n @name = new_name\n end",
"def set_status\n self.status = Status.find_by(code: \"OPEN\")\n end",
"def set_name=(name)\n @name = name\n end",
"def update_status(status)\n @status = status\n @last_status_change = Time.now\n update_statusfile\n end",
"def set_StatusUpdate(value)\n set_input(\"StatusUpdate\", value)\n end",
"def update_status status\n @job.set({\n custom_status: status,\n pinged_at: Time.now\n })\n end",
"def setName(name)\n @name = name\n end",
"def remote_status=(value)\n if value == Status::ON\n switcher.switch_on\n elsif value == Status::OFF\n switcher.switch_off\n end\n end",
"def status=(status)\n check_exists\n oldstatus = SideJob.redis.getset(\"#{redis_key}:status\", status)\n if oldstatus != status && worker_config['status_publish'] != false\n SideJob::Port.group(log: false) do\n publish({status: status})\n end\n end\n end",
"def set_status\n @status ||= Status.find(params[:id])\n end",
"def set_watch\n @watch = Watch.find(params[:id])\n end",
"def setStatus(status)\r\n\t\t\t\t\t@status = status\r\n\t\t\t\tend",
"def set_status!(status)\n ## FIXME_NISH Fix this.\n ## FIXED\n update(status: (status == 'true'))\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def name=(name)\n update_channel_data(name: name)\n end",
"def watch!\n start_watch true\n end",
"def name=(new_name)\n @name = new_name\n end",
"def name=(new_name)\n @name = new_name\n end",
"def setName(name)\r\n\t\t\t\t\t@name = name\r\n\t\t\t\tend",
"def setName(name)\r\n\t\t\t\t\t@name = name\r\n\t\t\t\tend",
"def setName(name)\r\n\t\t\t\t\t@name = name\r\n\t\t\t\tend",
"def setName(name)\r\n\t\t\t\t\t@name = name\r\n\t\t\t\tend",
"def setName(name)\r\n\t\t\t\t\t@name = name\r\n\t\t\t\tend",
"def name=(name)\n set_if_changed(:name, name.to_s) do\n invalidate_cache!(:only_section => true)\n end\n end",
"def status=(v)\n @status = alma_string v\n end",
"def status=(status)\n if status && (status.is_a?(String) || status.is_a?(Symbol))\n @status = status.upcase.to_sym\n end\n end",
"def ensure=(value)\n debug \"Waiting for host '#{@resource[:name]}' to change status to '#{value}'\"\n @resource[:count].times do\n return if status == value\n sleep @resource[:step]\n end\n fail \"Timeout waiting for host '#{@resource[:name]}' status to become '#{value}' after #{@resource[:count] * @resource[:step]} seconds!\"\n end",
"def initialize name = self.class.uniqe_name\n @name = name\n @status = 'stopped'\n @sw_time = 0\n end",
"def on_name_changed(new_name:, **)\n @name = new_name\n end"
] | [
"0.6237716",
"0.6160209",
"0.6081324",
"0.57756966",
"0.5766619",
"0.5755497",
"0.5734069",
"0.5722514",
"0.5708228",
"0.57043225",
"0.56532204",
"0.5630378",
"0.55817467",
"0.5577651",
"0.5577651",
"0.5577372",
"0.5517312",
"0.55101407",
"0.5504092",
"0.54802066",
"0.54723763",
"0.54686284",
"0.54620856",
"0.5461628",
"0.5461628",
"0.5461628",
"0.5461628",
"0.5461628",
"0.5461628",
"0.5461628",
"0.5461628",
"0.5461628",
"0.5461628",
"0.5461628",
"0.5461628",
"0.5461628",
"0.5461628",
"0.5461628",
"0.5461628",
"0.5461628",
"0.5461628",
"0.5461628",
"0.5461628",
"0.5461628",
"0.5461628",
"0.5461628",
"0.5443513",
"0.5441622",
"0.54240304",
"0.5423151",
"0.5422281",
"0.5418059",
"0.539665",
"0.53888535",
"0.5383878",
"0.53479177",
"0.53479177",
"0.53479177",
"0.53479177",
"0.53479177",
"0.53479177",
"0.53479177",
"0.53479177",
"0.53479177",
"0.53479177",
"0.53479177",
"0.53479177",
"0.53479177",
"0.53479177",
"0.53471833",
"0.53471833",
"0.5344916",
"0.53401685",
"0.5325719",
"0.53218234",
"0.5309817",
"0.53075695",
"0.52722037",
"0.5260554",
"0.52596617",
"0.52535295",
"0.52497977",
"0.52492434",
"0.52470505",
"0.524262",
"0.52392167",
"0.52343535",
"0.5219493",
"0.5219493",
"0.5215839",
"0.5215839",
"0.5215839",
"0.5215839",
"0.5215839",
"0.5214884",
"0.5213065",
"0.5211969",
"0.5211718",
"0.5202756",
"0.51976025"
] | 0.85823715 | 0 |
Sets the currently online stream to the specified name and Twitch URL. | def stream(name, url)
gateway_check
update_status(@status, name, url)
name
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stream(name, url)\n gateway_check\n update_status(@idletime, name, url)\n name\n end",
"def update_stream(name, params={})\n stream = ::M2X::Client::Stream.new(@client, self, \"name\" => name)\n\n stream.update!(params)\n end",
"def set_stream\n @stream = current_user.stream\n end",
"def set_stream\n @stream = Stream.friendly.find(params[:id])\n end",
"def set_stream\n @stream = Stream.find(params[:id])\n end",
"def set_stream\n @stream = Stream.find(params[:id])\n end",
"def set_stream\n @stream = Stream.find(params[:id])\n end",
"def set_stream\n @stream = Stream.find(params[:id])\n end",
"def set_stream\n @stream = Stream.find(params[:id])\n end",
"def set_stream\n @stream = Stream.find(params[:id])\n end",
"def set_streaming_site\n @streaming_site = StreamingSite.find(params[:id])\n end",
"def url!(url=nil)\n url.kind_of?(String) ? @session.chanserv.set(self.name, :url, url) : @session.chanserv.set(self.name, :url)\n end",
"def stream(name)\n ::M2X::Client::Stream.fetch(@client, self, name)\n end",
"def set_stream\n @stream = Stream.find(params[:id], _resource_id: @resource.id, _user_id: current_user.id)\n # @stream = @resource.streams.find(params[:id])\n end",
"def name=(name)\n update_channel_data(name: name)\n end",
"def online\n gateway_check\n update_status(:online, @activity, @streamurl)\n end",
"def set_to_live_player\n @to_live_player = ToLive::Player.find(params[:id])\n end",
"def stream_url\n\t\t\"http://www.google.com\"\n\tend",
"def update!(**args)\n @streams = args[:streams] if args.key?(:streams)\n @target_stream = args[:target_stream] if args.key?(:target_stream)\n end",
"def stream(optname, optarg)\n new_auth = Tw::NewAuth.new(@account)\n new_auth.auth()\n requester = Tw::TwitterRequester.new(new_auth)\n followers_cache_option = {\n :permission => FOLLOWERS_CACHE_PERMISSON,\n :interval => FOLLOWERS_CACHE_INTERVAL\n }\n stream = Tw::Stream::Stream.new(requester, followers_cache_option)\n format = @options.format()\n current_user_id = new_auth.user.id\n separator = \"\\n\"\n lastTweet = nil\n is_disconnected = false\n $stderr.puts(\"-- waiting stream...\")\n loop do\n begin\n stream.user_stream do |obj|\n if is_disconnected && lastTweet then\n # ここ以下は作り直した方がいいかも。\n # (ストリームが途切れたときに代わりに home timeline から取るの)\n #timeline = stream.home_timeline(lastTweet.id)\n #self.renderer.display(timeline, @options.format(), separator: separator, current_user_id: current_user_id)\n #self.logger.debug(\n # \"Tw::App::Executor.stream(): Timeline recovery completed.\")\n is_disconnected = false\n end\n if obj.is_a?(Tw::Tweet) then\n lastTweet = obj\n end\n self.display_stream_object(obj, current_user_id)\n end\n ret = 0\n rescue EOFError, SocketError, Timeout::Error => e\n is_disconnected = true\n\n $stderr.puts(\">>> #{e.class} (#{e.message})\")\n $stderr.puts(\">>> Retrying to connect to Twitter stream.\")\n sleep(5)\n next\n rescue => e\n $stderr.puts(experr(__FILE__, __LINE__, e, \"receiving user stream\"))\n $stderr.puts(Tw::BACKTRACE_MSG)\n raise if ENV[\"TWBT\"]\n ret = 1\n end\n end\n return ret\n end",
"def set_player_name(msg, name=nil)\n player = get_player msg\n unless name\n msg.reply player.name\n return\n end\n if player.name\n msg.reply \"The majestic #{player.name} refuses to change his name!\"\n return\n end\n player.name = name\n player.save\n msg.reply \"Welcome, #{player.name}!\"\n end",
"def activity_stream(name, opts = {})\n self.defined_streams ||= {}\n self.defined_streams[name.to_sym] = opts\n return nil\n end",
"def url=(url)\n active_window.url = url\n end",
"def set_sink_to_use(sink_name:)\n {\n method: \"Cast.setSinkToUse\",\n params: { sinkName: sink_name }.compact\n }\n end",
"def set_remote_url(name, url)\n url = url.repo.path if url.is_a?(Git::Base)\n self.lib.remote_set_url(name, url)\n Git::Remote.new(self, name)\n end",
"def setCurrentPlayer(id, name)\n @current_player_id = id\n @current_player = name\nend",
"def set_hitch\n @hitch = Hitch.find(params[:id])\n end",
"def start_cast_desktop_mirroring(name); end",
"def feed_url=(url)\n self.feed_updated_at = nil unless url == feed_url \n super(url)\n end",
"def set_name(player_name)\n @player_name = player_name\n end",
"def start\n if params[:name]\n streaming_user = User.where('stream_key = ?', params[:name]).first\n if streaming_user\n async_confirm_and_set_stream_state(streaming_user)\n # Sending a redirect causes NGINX rtmp module to redirect the stream\n # to the restricted hlsout application. This also effectively translates\n # the users stream key to their username for client-side use.\n redirect_to \"rtmp://127.0.0.1/hlsout/\" + streaming_user.username.downcase\n else\n render status: :not_found\n end\n else\n render status: :not_found\n end\n end",
"def activity_stream(name = :default)\n ActivityStream::Stream.new(name, self, self.class.defined_streams[name])\n end",
"def setURL(url)\r\n\t\t\t\t\t@url = url\r\n\t\t\t\tend",
"def setURL(url)\r\n\t\t\t\t\t@url = url\r\n\t\t\t\tend",
"def setURL(url)\r\n\t\t\t\t\t@url = url\r\n\t\t\t\tend",
"def setURL(url)\r\n\t\t\t\t\t@url = url\r\n\t\t\t\tend",
"def setURL(url)\r\n\t\t\t\t\t@url = url\r\n\t\t\t\tend",
"def set_VideoSyndicated(value)\n set_input(\"VideoSyndicated\", value)\n end",
"def update!(**args)\n @link = args[:link] if args.key?(:link)\n @video = args[:video] if args.key?(:video)\n end",
"def stream_url\n \"https://stream.gitter.im/v1/rooms/#{@config.room_id}/chatMessages\"\n end",
"def set_sitelink\n @sitelink = Sitelink.find(params[:id])\n end",
"def set_mover_url!\n if url = user_reffered?\n current_user.update(mover_url: url) unless current_user.mover_url\n end\n end",
"def set_stream target\n if target.respond_to?(:sysseek)\n @io = target\n else\n @io = SysIOWrapper.new(target)\n end\n @name = \"<stream>\"\n end",
"def set_sock\n @sock = Sock.find(params[:id])\n end",
"def listening=(name)\n gateway_check\n update_status(@status, name, nil, nil, nil, 2)\n end",
"def set_url\n @url = Url.find(params[:id])\n end",
"def set_url\n @url = Url.find(params[:id])\n end",
"def set_url\n @url = Url.find(params[:id])\n end",
"def set_url\n @url = Url.find(params[:id])\n end",
"def set_url\n @url = Url.find(params[:id])\n end",
"def set_url\n @url = Url.find(params[:id])\n end",
"def set_url\n @url = Url.find(params[:id])\n end",
"def set_url\n @url = Url.find(params[:id])\n end",
"def set_url\n @url = Url.find(params[:id])\n end",
"def set_url\n @url = Url.find(params[:id])\n end",
"def set_url\n @url = Url.find(params[:id])\n end",
"def set_url\n @url = Url.find(params[:id])\n end",
"def online\n gateway_check\n update_status(nil, @game, @streamurl)\n end",
"def cast_sink_to_use=(name); end",
"def cmd_twitt_set_source(*args)\n\t\t\t\tif args.length > 0\n\t\t\t\t\tprint_status(\"Setting the source name to #{args[0]}\")\n\t\t\t\t\t@source = args[0]\n\t\t\t\telse\n\t\t\t\t\tprint_error(\"Please provide a value\")\n\t\t\t\tend\n\t\t\tend",
"def set_state(host, realname = nil, channels = nil)\r\n self.fullhost = host\r\n @realname = realname\r\n unless channels.nil?\r\n for i in (0...channels.length)\r\n channels[i] = channels[i].downcase\r\n unless @channels.has_key?(channels[i])\r\n add_channel(channels[i])\r\n end\r\n end\r\n end\r\n @chanlist = channels\r\n @online = true\r\n end",
"def set_live\n @live = Live.find(params[:id])\n end",
"def set_twee\n @twee = Twee.find(params[:id])\n end",
"def set_smpl_chat\n @smpl_chat = SmplChat.find(params[:id])\n end",
"def stream\n Shot.stream\n redirect_to shots_path\n end",
"def set_flink\n @flink = Flink.find(params[:id])\n end",
"def subscribed\n super\n increase_current_users\n stream_from channel\n end",
"def set_streamObj\n @streamObj = @streamObjKlass.find(params[:id])\n end",
"def like_follow_live\n login_streaming\n @client_stream.filter(:track => \"#{@hashtbonjour}\") do |tweet|\n @client.favorite!(tweet)\n @client.follow(tweet.user)\n end\n end",
"def set_feed_url\n @feed_url = FeedUrl.find(params[:id])\n end",
"def stream_callback(name, options = {}, &block)\n if not block\n throw ArgumentError\n end\n\n\n # Set instance variable for original rendering before streaming is established\n instance_variable_set(\"@#{name}\", block.call)\n\n # Check if the request is initial or for streaming content\n #\n # If the request is not for streaming ignore the rest of the code\n unless params[STREAMING_PARAM]\n return false\n else\n\n response.headers['Content-Type'] = 'text/event-stream'\n\n connection = Strwatch::Connection.new(response.stream, name)\n\n lambda { connection.stream(block.call, options) }\n end\n end",
"def set(setting, value)\n setting = setting.to_sym\n if setting == :estream\n self.estream = value\n elsif setting == :ostream\n self.ostream = value\n else\n @settings[setting.to_sym] = value\n end\n end",
"def watching=(name)\n gateway_check\n update_status(@status, name, nil, nil, nil, 3)\n end",
"def set_url\n @url = DEFAULT_URL\n end",
"def spotify_playlist_url=(url)\n if url.present?\n url = url[\"spotify:\"] ? url[url.rindex(\"spotify:\")..-1] : url #\n write_attribute(:spotify_playlist_url, url)\n end\n end",
"def update!\n open(link)\n end",
"def set_tw_stat\n @tw_stat = TwStat.find(params[:id])\n end",
"def name=(name)\n tinycache_adapter.write(:name, name)\n client.api.set_room_name(id, name)\n name\n end",
"def set_swit\n @swit = User.find(session[:user_id])\n end",
"def set_channel\n @channel = Channel.find_by(:name => params[:name])\n end",
"def set_tweeet\n @tweeet = Tweeet.find(params[:tweeet_id])\n end",
"def current_stream_url\n @ole.CurrentStreamURL\n end",
"def twitt\n if PLANETOID_CONF[:twitter][:entries][:send_twitts] && self.published > self.feed.created_at\n twit=Twitter::Base.new(Twitter::HTTPAuth.new(PLANETOID_CONF[:twitter][:user], PLANETOID_CONF[:twitter][:password]))\n twit.update \"#{PLANETOID_CONF[:twitter][:entries][:prefix]} #{self.title[0..150]} #{self.url}\"\n end\n end",
"def update_timeline\n tl = Timeline.where(resource_type: \"Stream\", resource_id: self.id).first\n if tl\n tl.promoted = self.promoted\n tl.status = self.status\n tl.likes = self.likes\n tl.lat = self.lat\n tl.lng = self.lng\n tl.playcount = self.playcount\n tl.save\n end\n end",
"def on_connect(*)\n @mplayer_cmd = \"#{config[:mplayer]} -nosound #{config[:url]}\"\n @twitter_client = Twitter::REST::Client.new do |twitter_config|\n twitter_config.consumer_key = config[:twitter_consumer_key]\n twitter_config.consumer_secret = config[:twitter_consumer_secret]\n twitter_config.access_token = config[:twitter_access_token]\n twitter_config.access_token_secret = config[:twitter_access_token_secret]\n end\n end",
"def movie_thumb_url=(name)\n furl, lurl = self.movie_urls.split(', ') unless movie_urls.nil?\n self.movie_urls = [name.strip, lurl].join(', ') unless furl == name.strip \n end",
"def url=(value)\n value = \"http://#{value}\" unless value.empty? || value =~ %r{^http://} || value =~ %r{^https://}\n write_local(:url, value)\n end",
"def set_player\n\n end",
"def set_socket_url\n \tgon.push({socketUrl: socket_url})\n end",
"def twitt\n if PLANETOID_CONF[:twitter][:users][:send_twitts]\n twit=Twitter::Base.new(Twitter::HTTPAuth.new(PLANETOID_CONF[:twitter][:user], PLANETOID_CONF[:twitter][:password]))\n twit.update \"#{PLANETOID_CONF[:twitter][:users][:prefix]} #{self.name} #{PLANETOID_CONF[:site][:url]}/#{self.slug}\" \n end\n end",
"def start\n configure\n\n @on_startup.call if @on_startup\n\n if not @stream\n log \"not bothering with stream for #@username\"\n return\n end\n\n log \"starting stream for #@username\"\n @stream.on_error do |msg|\n log \"ERROR: #{msg}\"\n end\n\n @stream.on_inited do\n log \"Online!\"\n end\n\n @stream.on_event(:follow) do |event|\n next if event[:source][:screen_name] == @username\n log \"Followed by #{event[:source][:screen_name]}\"\n @on_follow.call(event[:source]) if @on_follow\n end\n\n @stream.on_direct_message do |dm|\n next if dm[:sender][:screen_name] == @username # Don't reply to self\n log \"DM from @#{dm[:sender][:screen_name]}: #{dm[:text]}\"\n @on_message.call(dm) if @on_message\n end\n\n @stream.userstream do |ev|\n next unless ev[:text] # If it's not a text-containing tweet, ignore it\n next if ev[:user][:screen_name] == @username # Ignore our own tweets\n\n meta = {}\n mentions = ev.attrs[:entities][:user_mentions].map { |x| x[:screen_name] }\n\n reply_mentions = mentions.reject { |m| m.downcase == @username.downcase }\n reply_mentions = [ev[:user][:screen_name]] + reply_mentions\n\n meta[:reply_prefix] = reply_mentions.uniq.map { |m| '@'+m }.join(' ') + ' '\n meta[:limit] = 140 - meta[:reply_prefix].length\n\n mless = ev[:text]\n begin\n ev.attrs[:entities][:user_mentions].reverse.each do |entity|\n last = mless[entity[:indices][1]..-1]||''\n mless = mless[0...entity[:indices][0]] + last.strip\n end\n rescue Exception\n p ev.attrs[:entities][:user_mentions]\n p ev[:text]\n raise\n end\n meta[:mentionless] = mless\n\n # To check if this is a mention, ensure:\n # - The tweet mentions list contains our username\n # - The tweet is not being retweeted by somebody else\n # - Or soft-retweeted by somebody else\n if mentions.map(&:downcase).include?(@username.downcase) && !ev[:retweeted_status] && !ev[:text].start_with?('RT ')\n log \"Mention from @#{ev[:user][:screen_name]}: #{ev[:text]}\"\n @on_mention.call(ev, meta) if @on_mention\n else\n @on_timeline.call(ev, meta) if @on_timeline\n end\n end\n end",
"def set_wowolink\n @wowolink = Wowolink.find(params[:id])\n end",
"def send_twitch(event)\n Twitch::update_twitch_streams\n streams = Twitch::active_streams\n\n event << \"Currently active N related Twitch streams #{format_time}:\"\n if streams.map{ |k, v| v.size }.sum == 0\n event << \"None :shrug:\"\n else\n str = \"\"\n streams.each{ |game, list|\n if list.size > 0\n str += \"**#{game}**: #{list.size}\\n\"\n ss = list.take(20).map{ |stream| Twitch::format_stream(stream) }.join(\"\\n\")\n str += format_block(Twitch::table_header + \"\\n\" + ss)\n end\n }\n event << str if !str.empty?\n end\nrescue => e\n lex(e, \"Error getting current Twitch N++ streams.\", event: event)\nend",
"def setLastPlayed(player)\n @lastPlayedBy = player\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @url = args[:url] if args.key?(:url)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @url = args[:url] if args.key?(:url)\n end",
"def set(name)\n @name = name\n self\n end",
"def stream_location(stream_name)\n # V1 of data streaming - use a local file\n return \"log/#{stream_name}\"\n end",
"def register(song_name)\n prior_play = @current_user.listens.select{|listen| listen.name == song_name}.first\n if prior_play\n @current_listen = prior_play\n @current_listen.plays += 1\n else\n @current_listen = Listen.new\n @current_listen.name = song_name\n @current_listen.plays = 1\n @current_user.listens << @current_listen\n end\n end",
"def update!(**args)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n @streams = args[:streams] if args.key?(:streams)\n @unreachable = args[:unreachable] if args.key?(:unreachable)\n end"
] | [
"0.6523595",
"0.6038782",
"0.6007969",
"0.59999794",
"0.58787066",
"0.58787066",
"0.5828698",
"0.5828698",
"0.5828698",
"0.5828698",
"0.57894003",
"0.57769513",
"0.57327384",
"0.5632106",
"0.54159665",
"0.5352153",
"0.53197",
"0.5310819",
"0.52885216",
"0.5268746",
"0.526079",
"0.5226634",
"0.5198999",
"0.51889586",
"0.5162606",
"0.5146134",
"0.5135335",
"0.5114374",
"0.51005346",
"0.5091729",
"0.50871986",
"0.5084445",
"0.5083975",
"0.5083975",
"0.5083975",
"0.5083975",
"0.5083975",
"0.5082372",
"0.50549567",
"0.5032656",
"0.50089914",
"0.5000078",
"0.4996911",
"0.49920073",
"0.49865058",
"0.49631986",
"0.49631986",
"0.49631986",
"0.49631986",
"0.49631986",
"0.49631986",
"0.49631986",
"0.49631986",
"0.49631986",
"0.49631986",
"0.49631986",
"0.49631986",
"0.49624246",
"0.49531782",
"0.4947795",
"0.4946244",
"0.4940067",
"0.49353507",
"0.4934961",
"0.49325848",
"0.49281943",
"0.492558",
"0.49197564",
"0.49113044",
"0.49080038",
"0.49019298",
"0.49006352",
"0.48897657",
"0.4884294",
"0.4879159",
"0.48683938",
"0.48677438",
"0.48661137",
"0.48590332",
"0.48447403",
"0.48411402",
"0.4832021",
"0.48245314",
"0.48204935",
"0.48181522",
"0.48008636",
"0.47923335",
"0.47875342",
"0.47864923",
"0.4780463",
"0.47798595",
"0.47786424",
"0.477268",
"0.47716266",
"0.4769624",
"0.4769624",
"0.47681868",
"0.4759322",
"0.4756546",
"0.47541654"
] | 0.64457554 | 1 |
Sets the currently competing status to the specified name. | def competing=(name)
gateway_check
update_status(@status, name, nil, nil, nil, 5)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def watching=(name)\n gateway_check\n update_status(@status, name, nil, nil, nil, 3)\n end",
"def set_status(val)\n self.status = val\n self\n end",
"def set_status\n self.status = 1\n end",
"def game=(name)\n gateway_check\n update_status(@status, name, nil)\n end",
"def set_status\n self.status = Status.find_by(code: \"OPEN\")\n end",
"def set_status\n @status= {\n 'Unstarted' => 0,\n 'In Progress' => 1,\n 'Completed' => 2\n }\n end",
"def setStatusInfo(name, value)\n @device.setStatusInfo(name,value) ;\n end",
"def set_status status\n self.update(pet_status: status)\n end",
"def status=(value)\n value = value.to_s.to_sym\n fail Deployment::InvalidArgument, \"#{self}: Invalid task status: #{value}\" unless ALLOWED_STATUSES.include? value\n status_changes_concurrency @status, value\n @status = value\n reset_forward if DEPENDENCY_CHANGING_STATUSES.include? value\n @status\n end",
"def set_status(target, status)\n target.status = status\n end",
"def change_status\n\t\tif status.include?(\"available\")\n\t\t\tstatus = \"checked_out\"\n\t\telsif status.include?(\"checked_out\")\n\t\t\tstatus = \"available\"\n\t\tend\n\tend",
"def set_status(name, deliver_emails_now = true, options = {})\n name = name.to_s if name.is_a?(Symbol)\n @type = ApplicationStatusType.find_or_create_by_name(name)\n @status = self.application_statuses.find_by_application_status_type_id(@type, :order => 'updated_at DESC')\n if @status.nil? || @status != self.current_status || options[:force] == true\n @status = self.application_statuses.create :application_status_type_id => @type.id\n @status.update_attribute(:note, options[:note]) unless options[:note].blank?\n self.save; self.reload\n self.send_status_updates(@status, deliver_emails_now)\n end\n update_attribute(:current_application_status_id, @status.id)\n self.status\n end",
"def make_active\n self.status = \"A\"\n end",
"def collins_set_needs_rename!\n state = collins_osc_state\n state.merge!({\n 'running' => false,\n 'finished' => Time.now.to_i,\n 'current_state' => \"needs_rename\",\n 'next_state' => \"can_be_altered\"\n })\n\n self.collins_osc_state = state\n end",
"def status=(val)\n unless [nil, :frozen, :live].include?(val)\n raise ArgumentError.new(\"Status must be :frozen or :live\") \n end\n @status = val\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def listening=(name)\n gateway_check\n update_status(@status, name, nil, nil, nil, 2)\n end",
"def set_status\n if !draft\n self.status = STATUS[get_status]\n end\n end",
"def update_status status\n @job.set({\n custom_status: status,\n pinged_at: Time.now\n })\n end",
"def mark_as(status)\n self.status = status\n self.save\n end",
"def status=(status)\n @_status = status\n end",
"def status=(status)\n @_status = status\n end",
"def setStatus(status)\r\n\t\t\t\t\t@status = status\r\n\t\t\t\tend",
"def set_status_to_pending\n self.status = :pending\n end",
"def assign\n\t\tself.status = :assigned\n\tend",
"def set_initial_status\n \tself.status = \"waiting\"\n end",
"def set_Status(value)\n set_input(\"Status\", value)\n end",
"def set_Status(value)\n set_input(\"Status\", value)\n end",
"def project_status_setter(status)\n if ['Proposed', 'Suspended', 'Postponed',\n 'Cancelled', 'In progress'].include? status\n self.status = status\n save\n else\n false\n end\n end",
"def set_status!(status)\n ## FIXME_NISH Fix this.\n ## FIXED\n update(status: (status == 'true'))\n end",
"def set_status\n @completed = @progress == @number\n end",
"def change_status\n if wait? and challenged_performance and challenger_performance\n self.approval_waiting!\n notify_judges\n end\n end",
"def status=(new_status)\n return if self.status == new_status\n if going_back_to?(new_status)\n revert_to(new_status)\n else\n if jumping_to?(new_status) #if we're skipping one or more statuses\n # fill_in_achievements here\n end\n # add a progression to the user\n if new_status::ID > AddedApplication::ID\n self.progressions << Progression.create(:user => self, :status_id => new_status::ID)\n end\n end\n # now set the status--NEED to reference self.status_id here (.status = infinite loop)\n self.status_id = new_status::ID\n self.check_for_new_achievements\n self.save!\n end",
"def active_set_name(name)\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n Native.RunEditor_active_set_name(@handle.ptr, name)\n end",
"def activate\n self.status = \"Active\"\n end",
"def status=(status); end",
"def change_status(status)\n unless @status == status\n @status = status\n @start_time = Time.now\n end\n end",
"def setName(name)\r\n\t\t\t\t\t@name = name\r\n\t\t\t\tend",
"def setName(name)\r\n\t\t\t\t\t@name = name\r\n\t\t\t\tend",
"def setName(name)\r\n\t\t\t\t\t@name = name\r\n\t\t\t\tend",
"def setName(name)\r\n\t\t\t\t\t@name = name\r\n\t\t\t\tend",
"def setName(name)\r\n\t\t\t\t\t@name = name\r\n\t\t\t\tend",
"def set_status\n @status ||= Status.find(params[:id])\n end",
"def status=(new_status)\n self.last_status = status\n\n self.setValue new_status, forKey: 'status'\n end",
"def status_update(name, dice, saved=nil)\n end",
"def update_status\n @completed_status = !completed_status\n puts \"#{description} Completed\"\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def status=(new_status)\n update_values([:status] => new_status)\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def offer_an_item(item)\r\n item.status = true\r\n end",
"def change_status(object, status)\n object.update_attribute :status, status\n end",
"def setName(name)\n @name = name\n end",
"def advance_status\n self.status = next_status\n end",
"def mark_active\n if ACTIVE_BY_DEFAULT.include? self.name\n self.active = true\n end\n end",
"def update_status(new_status)\n raise ArgumentError.new\"Invalid Status\" unless new_status == :AVAILABLE || new_status == :UNAVAILABLE\n @status = new_status\n end",
"def set_default_status\n self.status ||= :proposed\n end",
"def status=(v)\n @status = alma_string v\n end",
"def change_status(status)\n #not implemented \n end",
"def set(name)\n @name = name\n self\n end",
"def set_name\n self.update(name: \"Large Washer ##{self.id}\") unless self.name\n end",
"def default_status\n\t\tself.status = \"Pending\"\n end",
"def name=(name)\n update_channel_data(name: name)\n end",
"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",
"def status=(int)\n if not STATUSE.select { |k, v| v == int }\n raise Fatal::InvalidArgumentError.code(13002)\n end\n @status = int\n end"
] | [
"0.6564305",
"0.63031274",
"0.62669027",
"0.6218116",
"0.609785",
"0.60911584",
"0.6074275",
"0.6072246",
"0.6011434",
"0.598891",
"0.5974829",
"0.59435505",
"0.59295654",
"0.59258413",
"0.5924069",
"0.59012246",
"0.59011596",
"0.59011596",
"0.59011596",
"0.59011596",
"0.59011596",
"0.59011596",
"0.59011596",
"0.59011596",
"0.59011596",
"0.59011596",
"0.59011596",
"0.59011596",
"0.59011596",
"0.59011596",
"0.59011596",
"0.59011596",
"0.59011596",
"0.59011596",
"0.59011596",
"0.59011596",
"0.59011596",
"0.59011596",
"0.59011596",
"0.58664834",
"0.5866269",
"0.5844287",
"0.58114237",
"0.58112925",
"0.58112925",
"0.5784671",
"0.5781088",
"0.576985",
"0.5760248",
"0.5736806",
"0.5736806",
"0.5687889",
"0.56738824",
"0.5666038",
"0.5644969",
"0.5643727",
"0.56394386",
"0.56350154",
"0.56159174",
"0.56153744",
"0.56146467",
"0.56146467",
"0.56146467",
"0.56146467",
"0.56146467",
"0.5614131",
"0.56132156",
"0.5584122",
"0.55549586",
"0.55449224",
"0.55449224",
"0.55449224",
"0.55449224",
"0.55449224",
"0.55449224",
"0.55449224",
"0.55449224",
"0.55449224",
"0.55449224",
"0.55449224",
"0.55449224",
"0.55449224",
"0.55449224",
"0.55382085",
"0.55274683",
"0.5513659",
"0.55102724",
"0.5493698",
"0.5492138",
"0.5470586",
"0.54698485",
"0.5467936",
"0.5462238",
"0.5455102",
"0.5434481",
"0.54342186",
"0.54305696",
"0.54217654",
"0.5409654",
"0.5394904"
] | 0.82807195 | 0 |
Sets status to online. | def online
gateway_check
update_status(:online, @activity, @streamurl)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_online_status\n self.online_status = \"offline\"\n end",
"def set_online_status(status)\n case status\n when :available, :online\n @notification_server.chg \"NLN\", 0\n when :busy\n @notification_server.chg \"BSY\", 0\n when :idle\n @notification_server.chg \"IDL\", 0\n when :brb, :be_right_back\n @notification_server.chg \"BRB\", 0\n when :away\n @notification_server.chg \"AWY\", 0\n when :phone, :on_the_phone\n @notification_server.chg \"PHN\", 0\n when :lunch, :out_to_lunch\n @notification_server.chg \"LUN\", 0\n else\n raise \"Wrong online status: #{status}\"\n end\n end",
"def offline()\n set_status(\"OFFLINE\")\n end",
"def update_status!\n status = :online\n\n if !is_port_open?(@address, @port)\n status = :offline\n end\n\n if status != @status\n time = Time.now\n if status == :offline\n puts \"Server is currently offline\"\n else\n puts \"Server is currently online\"\n end\n\n @status = status\n if @status == :online\n @last_status_change = @last_launch\n else\n @last_status_change = time\n end\n end\n end",
"def online!\n unless self.admin\n self.online =true\n self.save\n end\n end",
"def online\n gateway_check\n update_status(nil, @game, @streamurl)\n end",
"def set_status\n self.status = Status.find_by(code: \"OPEN\")\n end",
"def set_status\n self.status = 1\n end",
"def online?\n status == :online\n end",
"def set_online\n if @_config_service\n @_config_service.set_online\n else\n @log.warn(3202, \"Client is configured to use the `LOCAL_ONLY` override behavior, thus `set_online()` has no effect.\")\n end\n end",
"def set_status(val)\n self.status = val\n self\n end",
"def online?\n status != :offline\n end",
"def resume\n\t\t@state = STATE_ONLINE\n\tend",
"def set_status\n if !draft\n self.status = STATUS[get_status]\n end\n end",
"def online?\n\t\tstatus == \"online\"\n\tend",
"def setStatus(status)\r\n\t\t\t\t\t@status = status\r\n\t\t\t\tend",
"def set_status!(status)\n ## FIXME_NISH Fix this.\n ## FIXED\n update(status: (status == 'true'))\n end",
"def online\n\n @cloud = fetch_cloud()\n @users = @cloud.online_users\n @users.each { |u| u.instance_variable_set(:@status,:online) }\n\n render :index, status: 200\n\n end",
"def status=(status)\n @_status = status\n end",
"def status=(status)\n @_status = status\n end",
"def set_status\n @status= {\n 'Unstarted' => 0,\n 'In Progress' => 1,\n 'Completed' => 2\n }\n end",
"def set_state(modes = nil)\r\n @modes = modes\r\n @online = true\r\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def change_status(status)\n unless @status == status\n @status = status\n @start_time = Time.now\n end\n end",
"def put_online\n @virtualtest.online = true\n @virtualtest.save\n flash[:success] = \"Test virtuel mis en ligne.\"\n redirect_to virtualtests_path\n end",
"def status=(status); end",
"def start!\n update_attribute(:status, STATUS_ONGOING)\n end",
"def online?\n !!@online\n end",
"def active!\n self.update_attribute(:status, ACTIVE)\n end",
"def check_status!\n events\n if should_be_offline?\n if online?\n events.create!(key: :offline).notify\n update_attribute(:online, false)\n end\n else # should be online\n if offline?\n events.create!(key: :online).notify\n update_attribute(:online, true)\n end\n end\n if low_balance?\n events.create!(key: :low_balance).notify if online?\n end\n end",
"def online?\n !@online.nil? && @online\n end",
"def make_active\n self.status = \"A\"\n end",
"def status=(val)\n unless [nil, :frozen, :live].include?(val)\n raise ArgumentError.new(\"Status must be :frozen or :live\") \n end\n @status = val\n end",
"def inactive!\n self.update_attribute(:status, INACTIVE)\n end",
"def set_initial_status\n \tself.status = \"waiting\"\n end",
"def set_default_status\n\t self.status = 0 \n\tend",
"def action_online\n if current_resource.exists? && current_resource.online?\n Chef::Log.debug(\"#{new_resource} already online - skipping\")\n else\n converge_by(\"Online #{new_resource}\") do\n executor.execute!('online-node', escape(new_resource.slave_name))\n end\n end\n end",
"def initialize(online = false)\n @online = online\n end",
"def start\n if @state == :initializing\n if @mode == :offline\n @state = :running\n else\n @state = :flushing\n flush\n end\n @mode = :online if @mode == :initializing\n end\n true\n end",
"def status=(status)\n validator = EnumAttributeValidator.new('String', [\"not_activated\", \"done\", \"in_progress\", \"error\", \"paused\", \"stopped_by_system\", \"in_queue\", \"finished_with_warnings\", \"calculating\", \"stopped_by_user\"])\n unless validator.valid?(status)\n fail ArgumentError, \"invalid value for \\\"status\\\", must be one of #{validator.allowable_values}.\"\n end\n @status = status\n end",
"def status=(status)\n validator = EnumAttributeValidator.new('String', ['available', 'assigned', 'activated', 'deprecated'])\n unless validator.valid?(status)\n fail ArgumentError, 'invalid value for \"status\", must be one of #{validator.allowable_values}.'\n end\n @status = status\n end",
"def inactivate\n self.status = \"Inactive\"\n end",
"def status=(status)\n validator = EnumAttributeValidator.new('String', [\"active\", \"paused\", \"ready\", \"delivered\", \"cancelled\", \"reverted\"])\n unless validator.valid?(status)\n fail ArgumentError, \"invalid value for 'status', must be one of #{validator.allowable_values}.\"\n end\n @status = status\n end",
"def online?\n get_int(:offline).zero?\n end",
"def status=(status)\n validator = EnumAttributeValidator.new('String', ['new', 'used', 'expired'])\n unless validator.valid?(status)\n fail ArgumentError, 'invalid value for \"status\", must be one of #{validator.allowable_values}.'\n end\n @status = status\n end",
"def change_status(object, status)\n object.update_attribute :status, status\n end",
"def status=(status)\n validator = EnumAttributeValidator.new('String', [\"ACTIVE\", \"INVOICED\", \"LOCKED\"])\n unless validator.valid?(status)\n fail ArgumentError, \"invalid value for \\\"status\\\", must be one of #{validator.allowable_values}.\"\n end\n @status = status\n end",
"def mark_as(status)\n self.status = status\n self.save\n end",
"def push_to_online\n transition_to :online\n end",
"def online\n @technician = Technician.find(params[:lawyer_id])\n @technician.is_online = true\n @technician.save\n render \"update_online\"\n end",
"def initialize\r\n self.status = 'inactive'\r\n end",
"def update_status\n self.status = board.status\n end",
"def update_status(new_status)\n raise ArgumentError.new\"Invalid Status\" unless new_status == :AVAILABLE || new_status == :UNAVAILABLE\n @status = new_status\n end",
"def status=(status)\n check_exists\n oldstatus = SideJob.redis.getset(\"#{redis_key}:status\", status)\n if oldstatus != status && worker_config['status_publish'] != false\n SideJob::Port.group(log: false) do\n publish({status: status})\n end\n end\n end",
"def set_status\n @id=params[:id]\n @client = User.find(@id)\n @status = @client.status\n if @status == true\n @client.update_attributes(status: 'false')\n flash[:success] = \"Status upadated In-Active\"\n else\n @client.update_attributes(status: 'true')\n flash[:success] = \"Status updated Active\"\n end\n redirect_to clients_path\n end",
"def default_status\n\n self.status = \"active\"\n\n end",
"def currently_online\n false\n end",
"def status=(status)\n validator = EnumAttributeValidator.new('String', [\"LIVE\", \"QUARANTINED\", \"REMOVED\"])\n unless validator.valid?(status)\n fail ArgumentError, \"invalid value for 'status', must be one of #{validator.allowable_values}.\"\n end\n @status = status\n end",
"def activate\n self.status = \"Active\"\n end",
"def presence_status\n # Memoize for the life of the instance to help with sorting...\n return @presence_status unless @presence_status.nil?\n redis = Worlize::RedisConnectionPool.get_client(:presence)\n result = redis.get(\"status:#{self.guid}\")\n \n # an 'offline' status is represented by the absense of a key in Redis\n # ... why waste prescious memory on users that aren't online?\n return @presence_status = 'offline' if result.nil?\n \n statuses = [\n 'offline', # 'offline' is also optionally represented by a zero value\n 'online',\n 'idle',\n 'away',\n 'invisible'\n ]\n @presence_status = statuses[result.to_i]\n end",
"def status=(status)\n validator = EnumAttributeValidator.new('String', [\"ACTIVE\", \"INACTIVE\"])\n unless validator.valid?(status)\n fail ArgumentError, \"invalid value for 'status', must be one of #{validator.allowable_values}.\"\n end\n @status = status\n end",
"def idle\n gateway_check\n update_status(:idle, @activity, nil)\n end",
"def make_inactive\n self.status = \"I\"\n end",
"def status=(status)\n validator = EnumAttributeValidator.new('String', ['INACTIVE', 'DISABLED', 'ENABLED'])\n unless validator.valid?(status)\n fail ArgumentError, 'invalid value for \"status\", must be one of #{validator.allowable_values}.'\n end\n @status = status\n end",
"def status_changed status\n # overwrite\n # eg. server.call_start_callback(self) if status == :ready\n end",
"def offline?\n status == :offline\n end",
"def put_online\n @privacypolicy.online = true\n @privacypolicy.publication_time = DateTime.now\n @privacypolicy.save\n User.all.each do |u|\n u.last_policy_read = false\n u.save\n end\n redirect_to @privacypolicy\n end",
"def activate\n @status = true\n end",
"def force_update_status(status) #rails' behaviour when saving a attribute in a background thread is very weird and unpredictable..\n \t\tself.update_attribute(:status , status)\n \t\tself.update_attributes(:status => status)\n \t\tself.status = status\n \t\tself.save\n end",
"def enable\n if offline?\n if @state == :flushing\n # If we were in offline mode then switched back to online but are still in the\n # process of flushing the in-memory queue and are now switching to offline mode\n # again then stop the flushing\n @state = :running\n end\n else\n Log.info(\"[offline] Disconnect from broker detected, entering offline mode\")\n Log.info(\"[offline] Messages will be queued in memory until connection to broker is re-established\")\n @offline_stats.update\n @queue ||= [] # Ensure queue is valid without losing any messages when going offline\n @mode = :offline\n start_timer\n end\n true\n end",
"def change_status\n\t\tif status.include?(\"available\")\n\t\t\tstatus = \"checked_out\"\n\t\telsif status.include?(\"checked_out\")\n\t\t\tstatus = \"available\"\n\t\tend\n\tend",
"def update_status(status)\n @status = status\n @last_status_change = Time.now\n update_statusfile\n end",
"def online?\r\n return @online\r\n end",
"def online?\r\n return @online\r\n end",
"def send_status\n remote_request Net::HTTP::Post, \"api/status/#{self.name}\", { :status => JSON.generate(status) }\n rescue StandardError => e\n log \"Sending status to #{@config[:monitor_url]} failed\"\n log \"Error: #{e}\"\n end",
"def set_status\n\t @id=params[:id]\n\t @state = State.find(@id)\n\t @status = @state.status\n if @status == true\n @state.update_attributes(status: 'false')\n flash[:success] = \"Status upadated In-Active\"\n else\n @state.update_attributes(status: 'true')\n flash[:success] = \"Status updated Active\"\n end\n redirect_to states_path\n end",
"def activate\n self.status = 'current'\n self.save\n end"
] | [
"0.8451545",
"0.7961447",
"0.7636506",
"0.7532946",
"0.7206101",
"0.7009379",
"0.700205",
"0.6955704",
"0.6879258",
"0.684575",
"0.67882293",
"0.6771992",
"0.673311",
"0.67199683",
"0.6675017",
"0.6621805",
"0.66055214",
"0.65308344",
"0.6511109",
"0.6511109",
"0.6486688",
"0.64817363",
"0.6389938",
"0.6389938",
"0.6389938",
"0.6389938",
"0.6389938",
"0.6389938",
"0.6389938",
"0.6389938",
"0.6389938",
"0.6389938",
"0.6389938",
"0.6389938",
"0.6389938",
"0.6389938",
"0.6389938",
"0.6389938",
"0.6389938",
"0.6389938",
"0.6389938",
"0.6389938",
"0.6389938",
"0.6389938",
"0.6389938",
"0.63898104",
"0.6388868",
"0.63639027",
"0.6333707",
"0.62807906",
"0.6224946",
"0.6212986",
"0.6212923",
"0.62121177",
"0.62028646",
"0.61832374",
"0.6135424",
"0.61320937",
"0.61249995",
"0.612114",
"0.61171764",
"0.6115107",
"0.6107058",
"0.609854",
"0.60965866",
"0.6092684",
"0.60879874",
"0.6078172",
"0.6048868",
"0.6029505",
"0.60199046",
"0.6015972",
"0.60055184",
"0.6005307",
"0.6003057",
"0.6000234",
"0.5986542",
"0.5971858",
"0.5970308",
"0.59696656",
"0.5960513",
"0.59531564",
"0.59447855",
"0.59392124",
"0.5932561",
"0.59315354",
"0.5914908",
"0.59138757",
"0.59082055",
"0.5906329",
"0.5899448",
"0.5897211",
"0.5895014",
"0.5894895",
"0.5886805",
"0.5886289",
"0.5886289",
"0.58858347",
"0.58848774",
"0.58696413"
] | 0.74428433 | 4 |
Sets status to idle. | def idle
gateway_check
update_status(:idle, @activity, nil)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def idle\n set_state :idle\n @start_time = nil\n end",
"def idle\n gateway_check\n update_status((Time.now.to_f * 1000), @game, nil)\n end",
"def idle\n return unless ready_to_idle?\n\n @idling = true\n\n imap.idle(@mailbox.idle_timeout, &idle_handler)\n ensure\n @idling = false\n end",
"def make_inactive\n self.status = \"I\"\n end",
"def idle\n sleep(5) while running?\n end",
"def idle?; end",
"def idle_timeout=(idle_timeout); end",
"def inactive!\n self.update_attribute(:status, INACTIVE)\n end",
"def set_status\n self.status = 1\n end",
"def make_active\n self.status = \"A\"\n end",
"def idle_timeout=(timeout); end",
"def setStatus(status)\r\n\t\t\t\t\t@status = status\r\n\t\t\t\tend",
"def initialize\r\n self.status = 'inactive'\r\n end",
"def inactivate\n self.status = \"Inactive\"\n end",
"def set_initial_status\n \tself.status = \"waiting\"\n end",
"def set_status(val)\n self.status = val\n self\n end",
"def set_status\n @status= {\n 'Unstarted' => 0,\n 'In Progress' => 1,\n 'Completed' => 2\n }\n end",
"def set_status\n self.status = Status.find_by(code: \"OPEN\")\n end",
"def idle!(queue)\n active_at queue, Time.now - timeout*2\n end",
"def idle\n handle = Idle.new(@reactor)\n handle.progress &Proc.new if block_given?\n handle\n end",
"def inactive!\n @active.update { |_| false }\n end",
"def set_default_status\n\t self.status = 0 \n\tend",
"def idle?\n @state == :idle\n end",
"def change_status(status)\n unless @status == status\n @status = status\n @start_time = Time.now\n end\n end",
"def idle_timeout= idle_timeout\n @agent.idle_timeout = idle_timeout\n end",
"def idle(callback = nil, &block)\n Idle.new(@loop, callback || block)\n end",
"def deactivate!\n self.status = 'Inactive'\n nil\n end",
"def status=(status); end",
"def status=(status)\n @_status = status\n end",
"def status=(status)\n @_status = status\n end",
"def idle?\n @idle\n end",
"def advance_status\n self.status = next_status\n end",
"def set_online_status(status)\n case status\n when :available, :online\n @notification_server.chg \"NLN\", 0\n when :busy\n @notification_server.chg \"BSY\", 0\n when :idle\n @notification_server.chg \"IDL\", 0\n when :brb, :be_right_back\n @notification_server.chg \"BRB\", 0\n when :away\n @notification_server.chg \"AWY\", 0\n when :phone, :on_the_phone\n @notification_server.chg \"PHN\", 0\n when :lunch, :out_to_lunch\n @notification_server.chg \"LUN\", 0\n else\n raise \"Wrong online status: #{status}\"\n end\n end",
"def active=(active)\n @active = active\n @ucActStates.active = active\n @ucHpStat.active = active\n @cHpStatGauge.active = active\n @ucMpStat.active = active\n @cMpStatGauge.active = active\n @ucAtkStat.active = active\n @ucDefStat.active = active\n @ucSpiStat.active = active\n @ucAgiStat.active = active\n @ucEvaStat.active = active\n @ucHitStat.active = active\n @ucCriStat.active = active\n end",
"def set_default_status\n self['status'] = 'active' if status.blank?\n end",
"def set_status(target, status)\n target.status = status\n end",
"def resume\n\t\t@state = STATE_ONLINE\n\tend",
"def set_status!(status)\n ## FIXME_NISH Fix this.\n ## FIXED\n update(status: (status == 'true'))\n end",
"def activate\n self.status = \"Active\"\n end",
"def default_status\n\n self.status = \"active\"\n\n end",
"def status=(status)\n validator = EnumAttributeValidator.new('String', [\"ACTIVE\", \"INVOICED\", \"LOCKED\"])\n unless validator.valid?(status)\n fail ArgumentError, \"invalid value for \\\"status\\\", must be one of #{validator.allowable_values}.\"\n end\n @status = status\n end",
"def status=(status)\n validator = EnumAttributeValidator.new('String', ['new', 'used', 'expired'])\n unless validator.valid?(status)\n fail ArgumentError, 'invalid value for \"status\", must be one of #{validator.allowable_values}.'\n end\n @status = status\n end",
"def setInactive\n self.update_attribute(:end_active_at, DateTime.now - 1.minute)\n end",
"def idle?\n @idle_time > 0\n end",
"def idle_timeout\n super\n end",
"def idle_timeout\n super\n end",
"def idle_timeout\n super\n end",
"def activate!\n self.status = 'Active'\n nil\n end",
"def closed\n update_attribute(:status, false)\n end",
"def set_state(modes = nil)\r\n @modes = modes\r\n @online = true\r\n end",
"def status=(status)\n validator = EnumAttributeValidator.new('String', [\"ACTIVE\", \"INACTIVE\"])\n unless validator.valid?(status)\n fail ArgumentError, \"invalid value for 'status', must be one of #{validator.allowable_values}.\"\n end\n @status = status\n end",
"def status=(status)\n validator = EnumAttributeValidator.new('String', [\"ACTIVE\", \"EXPIRED\"])\n unless validator.valid?(status)\n fail ArgumentError, \"invalid value for \\\"status\\\", must be one of #{validator.allowable_values}.\"\n end\n @status = status\n end",
"def idle\n self.elevators.reject{|e| !e.idle }\n end",
"def status=(status)\n validator = EnumAttributeValidator.new('String', [\"not_activated\", \"done\", \"in_progress\", \"error\", \"paused\", \"stopped_by_system\", \"in_queue\", \"finished_with_warnings\", \"calculating\", \"stopped_by_user\"])\n unless validator.valid?(status)\n fail ArgumentError, \"invalid value for \\\"status\\\", must be one of #{validator.allowable_values}.\"\n end\n @status = status\n end",
"def set_active\n @active = true\n end",
"def offline()\n set_status(\"OFFLINE\")\n end",
"def active=(value)\n super\n self.reset_cursor_blinking\n update_cursor\n end",
"def reset\n update!({ status: :inactive, stdout: '', stderr: '', error: 0, point: 0, feedback: '' })\n end",
"def set_status\n if !draft\n self.status = STATUS[get_status]\n end\n end",
"def active=(active)\n @active = active\n @ucActStates.active = active\n @cCharImage.active = active\n @cCharName.active = active\n @ucCharLvl.active = active\n @ucHpStat.active = active\n @cHpStatGauge.active = active\n @ucMpStat.active = active\n @cMpStatGauge.active = active\n @ucExp.active = active\n @cExpGauge.active = active\n end",
"def status=(int)\n if not STATUSE.select { |k, v| v == int }\n raise Fatal::InvalidArgumentError.code(13002)\n end\n @status = int\n end",
"def stop_idle_check_thread\n if @idle_check_thread \n logger.debug(\">> Stopping idle objects check thread ...\") if logger\n @idle_check_status = \"Stopping...\"\n @idle_check_thread.kill\n @idle_check_thread = nil\n @idle_check_status = \"Not Running\"\n end\n end",
"def status=(new_status)\n self.last_status = status\n\n self.setValue new_status, forKey: 'status'\n end",
"def idle_timeout; end",
"def idle_timeout; end",
"def on_idle(evt)\n if @cursor_moved\n @cursor_moved=false\n event_handler.process_event( CursorMoveEvent.new(self) )\n end\n\n if @data_changed\n @data_changed=false\n event_handler.process_event( DataChangeEvent.new(self) )\n end\n end",
"def activate\n @status = true\n end",
"def idle_gear(options={})\n return '' if stop_lock? || state.value == State::STOPPED\n\n PathUtils.flock(@gear_lock) do\n frontend = FrontendHttpServer.new(self)\n frontend.idle\n begin\n return stop_gear(force: true, term_delay: 30, init_owned: true)\n ensure\n state.value = State::IDLE\n end\n end\n end",
"def start_check_idle_thread\n @mutex.synchronize {\n return unless @config.idle_check_interval > 0 and @idle_check_thread.nil?\n @idle_check_status = \"Checking...\"\n \n @idle_check_thread = Thread.new do\n loop do\n thread_id = @idle_check_thread.__id__ if @idle_check_thread\n \n begin\n logger.debug(\">> Starting idle objects check (Object ID: #{self.__id__}, Thread ID: #{thread_id})\") if logger\n logger.debug(\"Status: \" + self.status_info.map {|k,v| \"#{k}=#{v}\"}.join(', ')) if logger\n @idle_check_status = \"Checking...\"\n \n check_idle\n \n @idle_check_status = \"Check status: OK. Sleeping now...\"\n rescue Exception => e\n @idle_check_status = \"Check status: Error - #{e.to_s} \\n#{e.backtrace.join(\"\\n\")}. Sleeping...\\n\"\n end\n \n logger.debug(@idle_check_status) if logger\n if @config.idle_check_interval > 0 \n logger.debug(\">> Sleeping (Object ID: #{self.__id__}, Thread ID: #{thread_id}) #{@config.idle_check_interval} seconds ...\\n\\n\") if logger\n sleep @config.idle_check_interval\n else\n logger.debug(\">> Idle check interval is set 0 or less. Thus idle check thread will only be executed once.\") if logger\n end\n end\n end\n }\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def on_timeout\n trigger\n @active = false\n end",
"def inactivate!\n self.update_attribute(:status, \"Inactive\")\n end",
"def set_online_status\n self.online_status = \"offline\"\n end",
"def status=(status)\n validator = EnumAttributeValidator.new('String', ['pending', 'active', 'inactive'])\n unless validator.valid?(status)\n fail ArgumentError, 'invalid value for \"status\", must be one of #{validator.allowable_values}.'\n end\n @status = status\n end",
"def status=(status)\n validator = EnumAttributeValidator.new('String', [\"active\", \"paused\", \"ready\", \"delivered\", \"cancelled\", \"reverted\"])\n unless validator.valid?(status)\n fail ArgumentError, \"invalid value for 'status', must be one of #{validator.allowable_values}.\"\n end\n @status = status\n end",
"def set_inactive state, ios\n return if ios.empty?\n\n state.send do |state|\n # Update state with new object\n SelectorState.new(state.active - ios,\n state.inactive + (ios & state.receivers.keys),\n state.receivers)\n end\n rescue => e\n log(Logger::ERROR, self.to_s + \"#set_inactive\", e.to_s)\n raise e\n end",
"def set_mode newmode\n @mode = newmode\n @view.set_mode newmode\n case newmode\n when :idle\n reset_all_stats\n end\n end"
] | [
"0.77936685",
"0.6972496",
"0.68180937",
"0.65688807",
"0.63946515",
"0.6357286",
"0.624753",
"0.6203768",
"0.61928236",
"0.614327",
"0.6133321",
"0.6114859",
"0.6022177",
"0.59964406",
"0.5974761",
"0.5971599",
"0.596172",
"0.59550965",
"0.5954162",
"0.5929523",
"0.59265023",
"0.5905809",
"0.5894988",
"0.586848",
"0.58270276",
"0.58245325",
"0.58243376",
"0.5817141",
"0.580667",
"0.580667",
"0.5768711",
"0.57125604",
"0.5664102",
"0.5629825",
"0.5627623",
"0.5625498",
"0.56000435",
"0.55926424",
"0.55923843",
"0.55573666",
"0.55555785",
"0.55456454",
"0.5525217",
"0.5520336",
"0.55060077",
"0.55060077",
"0.55060077",
"0.55028707",
"0.5502533",
"0.5500784",
"0.54911715",
"0.547433",
"0.54721045",
"0.5468155",
"0.54540753",
"0.544886",
"0.54332745",
"0.5419633",
"0.5416734",
"0.5407387",
"0.5401084",
"0.54002035",
"0.53982335",
"0.53970647",
"0.53970647",
"0.53934044",
"0.53911495",
"0.5382634",
"0.53815264",
"0.5369726",
"0.5369726",
"0.5369726",
"0.5369726",
"0.5369726",
"0.5369726",
"0.5369726",
"0.5369726",
"0.5369726",
"0.5369726",
"0.5369726",
"0.5369726",
"0.5369726",
"0.5369726",
"0.5369726",
"0.5369726",
"0.5369726",
"0.5369726",
"0.5369726",
"0.5369726",
"0.5369726",
"0.5369726",
"0.5369726",
"0.53693354",
"0.5368138",
"0.5367486",
"0.53645146",
"0.5362246",
"0.53600925",
"0.53550416",
"0.5347266"
] | 0.76704377 | 1 |
Sets the bot's status to DnD (red icon). | def dnd
gateway_check
update_status(:dnd, @activity, nil)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show_status(msg)\n response = \"DJ announcements: #{@dj_state ? 'enabled' : 'disabled'}\"\n\n if @dj_state\n response << \" DJ tweets: #{@dj_tweeting ? 'enabled' : 'disabled'}\"\n end\n\n msg.reply response\n end",
"def set_status!(status)\n ## FIXME_NISH Fix this.\n ## FIXED\n update(status: (status == 'true'))\n end",
"def drb_status!\n Vedeu.bind(:_drb_status_) { Vedeu::Distributed::Server.status }\n end",
"def set_status\n self.status = 1\n end",
"def offline()\n set_status(\"OFFLINE\")\n end",
"def set_status(target, status)\n target.status = status\n end",
"def set_nsds_status(nsds, status)\n not_found = []\n nsds.each do |nsd_td|\n descriptor = Nsd.where({ 'nsd.name' => nsd_td['name'],\n 'nsd.vendor' => nsd_td['vendor'],\n 'nsd.version' => nsd_td['version'] }).first\n if descriptor.nil?\n logger.error 'NSD Descriptor not found ' + nsd_td.to_s\n not_found << nsd_td\n else\n descriptor.update('status' => status)\n end\n end\n not_found\n end",
"def status=(status); end",
"def set_status(val)\n self.status = val\n self\n end",
"def set_default_status\n\t self.status = 0 \n\tend",
"def update_status\n @completed_status = !completed_status\n puts \"#{description} Completed\"\n end",
"def set_status\n if !draft\n self.status = STATUS[get_status]\n end\n end",
"def status(status_id)\n attrset Curses::A_REVERSE\n setpos 0, 0\n addstr ' ' * maxx\n text = Status.text(status_id)\n setpos 0, (maxx - text.length) / 2\n addstr text\n attrset(Curses::A_NORMAL)\n refresh\n end",
"def set_status\n @status= {\n 'Unstarted' => 0,\n 'In Progress' => 1,\n 'Completed' => 2\n }\n end",
"def status_color\n if skipped?\n :yellow\n elsif error?\n :red\n else\n :green\n end\n end",
"def status_enum=(status)\n write_attribute(:status, status)\n end",
"def make_inactive\n self.status = \"I\"\n end",
"def closed\n update_attribute(:status, false)\n end",
"def send_status\n remote_request Net::HTTP::Post, \"api/status/#{self.name}\", { :status => JSON.generate(status) }\n rescue StandardError => e\n log \"Sending status to #{@config[:monitor_url]} failed\"\n log \"Error: #{e}\"\n end",
"def say_status(status, color)\n base.shell.say_status(status, dir, color) if verbose?\n end",
"def status_updated\n display_text = 'Idle'\n \n if @download_queue.length > 0\n display_text = \"#{@download_queue.length} LEFT\"\n end\n \n $autoDL_status_label['textvariable'].value = display_text\n end",
"def set_status(message, percentage)\n return false unless have_lock?\n @handle.rewind\n @handle.truncate 0\n @handle.write(message.to_s.strip + \"\\n\")\n @handle.write(percentage.to_s.strip + \"\\n\")\n @handle.flush\n true\n end",
"def setStatus(status)\r\n\t\t\t\t\t@status = status\r\n\t\t\t\tend",
"def status_png(status)\n status ? 'enabled_icon.png' : 'disabled_icon.png'\n end",
"def update_status\n self.status = board.status\n end",
"def default_status\n\t\tself.status = \"Pending\"\n end",
"def switchDisconnectionON\n send(:SET_DISCONNECT, \"#{Experiment.ID}\", \"#{NodeHandler.instance.expFileURL}\", \"#{OmlApp.getServerAddr}\", \"#{OmlApp.getServerPort}\")\n end",
"def default\n self.status = \"In Progress\"\n end",
"def say_status(status, color)\n base.shell.say_status(status, path, color) if verbose?\n end",
"def white\n self.on\n command Command::WHITE[@group]\n end",
"def lors_status(status)\n @@LORS[status].create\n @w_lors.icon = @@LORS[status]\n end",
"def set_status\n self.status = Status.find_by(code: \"OPEN\")\n end",
"def draft!\n self.update_attribute(:status, DRAFT)\n end",
"def print_status(msg, color)\n cprint RESET + BOLD\n cprint WHITE + \"[ \"\n cprint \"#{ msg } \", color\n cprint WHITE + \"] \" + RESET\n end",
"def print_status(msg, color)\n cprint RESET + BOLD\n cprint WHITE + \"[ \"\n cprint \"#{ msg } \", color\n cprint WHITE + \"] \" + RESET\n end",
"def set_status( statuscode )\n\t\t\tself.log.warn \"Unknown status code %d\" unless CLOSING_STATUS_DESC.key?( statuscode )\n\t\t\tstatus_msg = \"%d %s\" % [ statuscode, CLOSING_STATUS_DESC[statuscode] ]\n\n\t\t\tself.payload.truncate( 0 )\n\t\t\tself.payload.puts( status_msg )\n\t\tend",
"def status_light_enabled=(enabled)\n send_device_message('SetLEDState', enabled ? 'On' : 'Off')\n end",
"def status_update(name, dice, saved=nil)\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def start!\n update_attribute(:status, STATUS_ONGOING)\n end",
"def status=(value)\n @status = value\n end",
"def set_online_status\n self.online_status = \"offline\"\n end",
"def set_default_status\n self[:status] = 'unread' if self[:status].blank?\n end",
"def unread!\n self.update_attribute(:status, UNREAD)\n end",
"def set_SkipStatus(value)\n set_input(\"SkipStatus\", value)\n end",
"def set_SkipStatus(value)\n set_input(\"SkipStatus\", value)\n end",
"def set_SkipStatus(value)\n set_input(\"SkipStatus\", value)\n end",
"def set_SkipStatus(value)\n set_input(\"SkipStatus\", value)\n end",
"def set_SkipStatus(value)\n set_input(\"SkipStatus\", value)\n end",
"def set_SkipStatus(value)\n set_input(\"SkipStatus\", value)\n end",
"def set_SkipStatus(value)\n set_input(\"SkipStatus\", value)\n end",
"def set_SkipStatus(value)\n set_input(\"SkipStatus\", value)\n end",
"def set_SkipStatus(value)\n set_input(\"SkipStatus\", value)\n end",
"def led(on_off, duration_s=0)\n set_state(on_off, duration_s, {on: {on: 0}, off: {off: 0}})\n end",
"def status_message=(val)\n @j_del.setStatusMessage(val)\n end",
"def status=(status)\n @_status = status\n end",
"def status=(status)\n @_status = status\n end",
"def set_Status(value)\n set_input(\"Status\", value)\n end",
"def set_Status(value)\n set_input(\"Status\", value)\n end",
"def report_status(m)\n if @@active\n m.reply \"Google RSS: On\"\n else\n m.reply \"Google RSS: Off\"\n end\n end",
"def knx_update(status)\n # Find widget for actual device\n @widget = self.class.find_by_id(self.id)\n # Update widget status\n @widget.status = if status == :on\n # Extra logic for a special light switch that turns\n # off the light when the light is on and you press\n # the switch again\n @widget.status == 1 ? 0 : 1\n else\n 0\n end\n # Send the update to all running sessions\n unless ActionCable.server.logger.nil?\n ActionCable.server.broadcast 'widgets', {type: \"button\", id: self.id, status: @widget.status}\n end\n\n # Extra logic for a special light switch that turns off two lights with one switch\n if ([\"Deckenlampe 1\", \"Deckenlampe 2\"].include? self.desc) and (status == :off)\n # Send the update to all running sessions\n unless ActionCable.server.logger.nil?\n id = (self.desc == \"Deckenlampe 1\" ? self.id + 1 : self.id - 1)\n self.class.find_by_id(id).status = 0\n ActionCable.server.broadcast 'widgets', {type: \"button\", id: id, status: 0}\n end\n end\n end",
"def update_status!(user, status, in_reply_to_status_id = nil)\n self.twitagent(user.token, user.secret).update_status!(status, in_reply_to_status_id)\n\tend",
"def notify_status(status)\n notify(\"STATUS=#{status}\")\n end",
"def set_discord\n @discord = Discord.find(params[:id])\n end",
"def invisible\n gateway_check\n update_status(:invisible, @activity, nil)\n end",
"def mark!(reason)\n @session.nickserv.mark(self.name, :on, reason)\n end",
"def set_status\n @completed = @progress == @number\n end",
"def virgin!\n write_attribute :status, 'virgin' if persisted?\n self.status = :virgin\n end",
"def display_color\n if @deleted\n return '#FF0000' # Red\n elsif !@enabled\n return '#AAAAAA' # Gray\n end\n \n '#000000'\n end",
"def set_online_status(status)\n case status\n when :available, :online\n @notification_server.chg \"NLN\", 0\n when :busy\n @notification_server.chg \"BSY\", 0\n when :idle\n @notification_server.chg \"IDL\", 0\n when :brb, :be_right_back\n @notification_server.chg \"BRB\", 0\n when :away\n @notification_server.chg \"AWY\", 0\n when :phone, :on_the_phone\n @notification_server.chg \"PHN\", 0\n when :lunch, :out_to_lunch\n @notification_server.chg \"LUN\", 0\n else\n raise \"Wrong online status: #{status}\"\n end\n end",
"def update_status!\n status = :online\n\n if !is_port_open?(@address, @port)\n status = :offline\n end\n\n if status != @status\n time = Time.now\n if status == :offline\n puts \"Server is currently offline\"\n else\n puts \"Server is currently online\"\n end\n\n @status = status\n if @status == :online\n @last_status_change = @last_launch\n else\n @last_status_change = time\n end\n end\n end",
"def set_status_to_pending\n self.status = :pending\n end",
"def draw_status_text\n draw_text(0, 0, contents_width, line_height, status_text, 1)\n end",
"def dim(level)\n @level = level\n if level == 0\n off\n else\n puts \"Light is dimmed to #{@level}%\"\n end\n end",
"def dim(level)\n @level = level\n if level == 0\n off\n else\n puts \"Light is dimmed to #{@level}%\"\n end\n end",
"def set_pd_status(descriptor, status)\n # first find dependencies_mapping\n package_deps = Dependencies_mapping.where('pd.name' => descriptor['pd']['name'],\n 'pd.vendor' => descriptor['pd']['vendor'],\n 'pd.version' => descriptor['pd']['version'])\n descriptor.update('status' => status)\n package_deps.each do |package_dep|\n package_dep.update('status' => status)\n end\n end",
"def send_status_notification\n message = case @state\n when :hungry then \"I'm hungry!!!\"\n when :sick then \"I'm not feeling so well... :(\"\n when :playful then 'Come play with me!'\n end\n\n DesktopNotifications.notify(message) unless message.nil?\n end",
"def set_initial_status\n \tself.status = \"waiting\"\n end"
] | [
"0.5709672",
"0.5703655",
"0.55529743",
"0.5505187",
"0.54807925",
"0.5456211",
"0.52762717",
"0.5274191",
"0.5269922",
"0.52650845",
"0.52071166",
"0.52052397",
"0.51922864",
"0.51752084",
"0.516386",
"0.51199967",
"0.50915986",
"0.5078657",
"0.5074455",
"0.50739443",
"0.506013",
"0.5050958",
"0.5048843",
"0.50372475",
"0.50299275",
"0.50139105",
"0.5000824",
"0.4997454",
"0.49956456",
"0.4991322",
"0.49912313",
"0.49827725",
"0.4982631",
"0.49795312",
"0.49795312",
"0.4970111",
"0.49613693",
"0.4958577",
"0.4922191",
"0.4922191",
"0.4922191",
"0.4922191",
"0.4922191",
"0.4922191",
"0.4922191",
"0.4922191",
"0.4922191",
"0.4922191",
"0.4922191",
"0.4922191",
"0.4922191",
"0.4922191",
"0.4922191",
"0.4922191",
"0.4922191",
"0.4922191",
"0.4922191",
"0.4922191",
"0.4922191",
"0.4922191",
"0.4922191",
"0.49221465",
"0.49218267",
"0.49189568",
"0.49082494",
"0.49064758",
"0.49055803",
"0.49055803",
"0.49053353",
"0.49053353",
"0.49053353",
"0.49053353",
"0.49053353",
"0.49053353",
"0.49051794",
"0.49010137",
"0.4900237",
"0.48989293",
"0.48989293",
"0.48911235",
"0.48911235",
"0.4887442",
"0.48870945",
"0.4885513",
"0.48770925",
"0.4865725",
"0.48600015",
"0.48599178",
"0.48587203",
"0.48523387",
"0.48511145",
"0.4849836",
"0.48435423",
"0.48428735",
"0.48426923",
"0.4840714",
"0.4840714",
"0.48399276",
"0.48398793",
"0.4832321"
] | 0.58063143 | 0 |
Sets the bot's status to invisible (appears offline). | def invisible
gateway_check
update_status(:invisible, @activity, nil)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def offline()\n set_status(\"OFFLINE\")\n end",
"def make_inactive\n self.status = \"I\"\n end",
"def set_online_status\n self.online_status = \"offline\"\n end",
"def set_status!(status)\n ## FIXME_NISH Fix this.\n ## FIXED\n update(status: (status == 'true'))\n end",
"def unhide\n post(\"/api/unhide\", id: fullname)\n end",
"def deactivate!\n update(status: false)\n end",
"def invisible(attribute=nil,users=[])\n hash = generate_hash_for_conditions(attribute)\n visibility = Visibility.find_or_create_by(hash)\n users.each do |user|\n VisibilityAccess.find_by(visibility: visibility, user: user).destroy\n end\n visibility.update_attribute(:is_visible, false) if users.empty?\n end",
"def off!\n set(:on => false)\n end",
"def deactivate!\n self.status = 'Inactive'\n nil\n end",
"def unmark!\n @session.nickserv.mark(self.name, :off)\n end",
"def set_online_status(status)\n case status\n when :available, :online\n @notification_server.chg \"NLN\", 0\n when :busy\n @notification_server.chg \"BSY\", 0\n when :idle\n @notification_server.chg \"IDL\", 0\n when :brb, :be_right_back\n @notification_server.chg \"BRB\", 0\n when :away\n @notification_server.chg \"AWY\", 0\n when :phone, :on_the_phone\n @notification_server.chg \"PHN\", 0\n when :lunch, :out_to_lunch\n @notification_server.chg \"LUN\", 0\n else\n raise \"Wrong online status: #{status}\"\n end\n end",
"def unhide\n client.post('/api/unhide', id: read_attribute(:name))\n end",
"def visible=(vis)\n if vis\n show\n else\n hide\n end\n end",
"def toggle_off\n set_state_to(:off)\n end",
"def invisible?\n false\n end",
"def invisible?\n false\n end",
"def hide!\n visible(false)\n end",
"def hide!\n visible(false)\n end",
"def unhide\n @goal = Mg::Goal.find(params[:id])\n @goal.update_attribute(:is_hidden, false)\n flash[:notice] = \"Goal #{@goal.name} has been restored.\"\n \n respond_to do |format|\n format.html { redirect_to mg_goals_url }\n format.xml { head :ok }\n end\n end",
"def suspend_partner\n wait_until { change_status_link.visible? }\n change_status_link.click\n # wait for edit view\n wait_until { change_status_select.visible? }\n change_status_select.select('Suspended')\n submit_change_status_btn.click\n wait_until{ change_status_link.visible? }\n end",
"def invisible?\n false\n end",
"def hide\n client.post('/api/hide', id: read_attribute(:name))\n end",
"def set_status\n if !draft\n self.status = STATUS[get_status]\n end\n end",
"def is_public?\n !@@hide_status_choices.include?(self.status)\n end",
"def change_force_hide_status\r\n\t\t\tProject.update_force_hide_status params[:id], params[:is_force_hide]\r\n\r\n\t\t\trender json: { status: 0 }\r\n\t\tend",
"def inactive!\n self.update_attribute(:status, INACTIVE)\n end",
"def unmark!\n @session.chanserv.mark(self.name, :off)\n end",
"def unpublished!\n self.update_attribute(:status, UNPUBLISHED)\n end",
"def visible=(visible)\n @visible = visible\n @ucActStates.visible = visible\n @ucHpStat.visible = visible\n @cHpStatGauge.visible = visible\n @ucMpStat.visible = visible\n @cMpStatGauge.visible = visible\n @ucAtkStat.visible = visible\n @ucDefStat.visible = visible\n @ucSpiStat.visible = visible\n @ucAgiStat.visible = visible\n @ucEvaStat.visible = visible\n @ucHitStat.visible = visible\n @ucCriStat.visible = visible\n end",
"def off!\n put '/state', { 'on' => false, 'transitiontime' => 0 }.to_json\n end",
"def ongoing_visibility=(visibility)\n @visibility = visibility\n end",
"def ongoing_visibility=(visibility)\n @visibility = visibility\n end",
"def player_disconnected\n current_user.player.status = 'offline'\n game = current_user.game\n if game\n Player.where(game_id: game.id).update_all(game_id: nil)\n # current_user.game.destroy no longer need to destroy game\n current_user.game.update_attributes(status: 'ended') unless game.status == 'ended'\n end\n current_user.player.save\n end",
"def mark_as_unresponsive\n self.available = STATUS_NONRESPONSIVE\n save!\n end",
"def status_forbidden\n @status = 403\n end",
"def skype_status_offline\n ret = @skype_obj.Invoke(\"SET USERSTATUS OFFLINE\").first\n raise \"Couldnt go offline: '#{ret}'.\" if ret != \"USERSTATUS OFFLINE\"\n nil\n end",
"def offline?\n status == :offline\n end",
"def hide\n set_publish_state(Event::DRAFT_STATE)\n end",
"def switch_visibility(params = {})\n @visible = params[:visible] || !@visible\n reset_visiblility_counters\n end",
"def off\n set_power(\"off\", \"smooth\",1000)\n end",
"def unfreeze\n update_attribute :status, STATUS_NORMAL\n end",
"def visible=(visible)\n @visible = visible\n @ucEncounters.visible = visible\n @ucDefeated.visible = visible\n @ucEscaped.visible = visible\n @ucExp.visible = visible\n @ucGold.visible = visible\n end",
"def initialize\r\n self.status = 'inactive'\r\n end",
"def hide\n \tupdate_attribute(:hidden, true)\n end",
"def invisible?(attribute=nil,current_user=nil)\n !visible?(attribute)\n end",
"def hide_activity\n @activity = Activity.find(params[:id])\n\n #This updates the field \"hidden\" as it is the only field we need to update\n @activity.update_attribute(:hidden, true)\n\n if @activity.save\n flash[:success] = 'Activity hidden successfully!'\n end\n\n end",
"def unhide!\n update_attribute(:hidden_at, nil)\n end",
"def unhide!\n update_attribute(:hidden_at, nil)\n end",
"def unhide!\n update_attribute(:hidden_at, nil)\n end",
"def unsubscribed\n User.find(current_user.id).update(online: false)\n ActionCable.server.broadcast(\n 'appearance_channel',\n user_id: current_user.id,\n is_online: false\n )\n end",
"def reset_view_status\r\n members = conversation.conversation_members\r\n\r\n members = members.where.not(:user_id => user.id) unless user.nil?\r\n\r\n members.update_all :viewed => false\r\n end",
"def set_status\n self.status = 1\n end",
"def visible=(visibility)\n end",
"def prefersStatusBarHidden\n true\n end",
"def hideable?\n @hideable ||= [\"Task deferred\", \"Project deferred\", \"Waiting on\", \"Hanging\"].include?(status)\n end",
"def hide\n @visible = false\n self\n end",
"def turn_off!\n set_power!(:off)\n end",
"def unread!\n self.update_attribute(:status, UNREAD)\n end",
"def status=(val)\n if val.nil?\n delete_element('status')\n else\n replace_element_text('status', val)\n end\n end",
"def deactivate\n update(state: 'inactive')\n end",
"def visible=(visible)\n @visible = visible\n @ucStat.visible = visible\n @ucCompareStat.visible = visible\n end",
"def wait_not_visible!(timeout=@wait)\n wait_for(timeout: timeout, message: \"Element at #{locator} is still visible\") { !visible? }\n end",
"def check_visibility\n set_status\n viewable = begin\n if !logged_in?\n false\n else\n if @status.isshared ||\n current_user.username.casecmp(@status.username) == 0 ||\n current_user.is_admin?\n true\n else\n false\n end\n end\n end\n\n unless viewable\n respond_to do |format|\n format.html {\n redirect_to(\n url_for(\n :controller => 'users',\n :action => 'signin',\n :params => {:redirect_to => request.path }),\n status: :temporary_redirect)\n }\n format.json {\n render status: :forbidden, nothing: true\n }\n end\n return\n end\n end",
"def toggle\n style[:hidden] = !style[:hidden]\n update_visibility\n end",
"def visible(value)\n @ole.Visible = value\n nil\n end",
"def visible(value)\n @ole.Visible = value\n nil\n end",
"def disable(id)\n change_status id, false\n end",
"def unpublish\n self.status = \"Unpublished\"\n end",
"def toggle\n social_network = SocialNetwork.find(params[:id])\n social_network.update!(is_visible: !social_network.is_visible?)\n redirect_to :settings\n end",
"def visible=(visible)\n @visible = visible\n @cEnemyGraphic.visible = visible\n end",
"def block!\n self.update_attribute(:status, ConfigCenter::User::BLOCKED)\n end",
"def hide!\n update_attribute(:hidden_at, Time.now)\n end",
"def hide!\n update_attribute(:hidden_at, Time.now)\n end",
"def network_disable(vid)\n perform_request(action: 'vserver-network-disable', vserverid: vid)\n end",
"def toggle_status # Toggle status method that negates the completed? method above\n @completed_status = !completed?\n end",
"def inactive!\n @active.update { |_| false }\n end",
"def visible=(value)\n @bar.visible = @background.visible = value\n end",
"def visible=(visible)\n @visible = visible\n @cVolumeLabel.visible = visible\n @cMuteLabel.visible = visible\n @ucVolumeBar.visible = visible\n @cVolumeValue.visible = visible\n end",
"def visible=(visible)\n @visible = visible\n @cVolumeLabel.visible = visible\n @cMuteLabel.visible = visible\n @ucVolumeBar.visible = visible\n @cVolumeValue.visible = visible\n end",
"def set_default_status\n self[:status] = 'unread' if self[:status].blank?\n end",
"def toggle_notification(visible)\n @notification_visible = visible\n end",
"def init_visibility\n return if actor? && !@battler.data_battler.dead_key.empty?\n @battler_visible = !@battler.hidden? && (@battler.enemy? ? \n !@battler.collapsed : true)\n self.opacity = 0 unless @battler_visible\n end",
"def disable_offline_mode\n @offline_handler.disable if @options[:offline_queueing]\n end",
"def disable_cobranding\n change_cobranding_status_link.click\n cobranding_status_select.select('No')\n submit_cobranding_status_btn.click\n wait_until{ !submit_cobranding_status_btn.visible? }\n end",
"def set_status_to_pending\n self.status = :pending\n end",
"def hidden!\n @hidden = true\n self\n end",
"def forFriendfunctions\n @status = false\n self.hide\n showElements\n end",
"def set_default_status\n\t self.status = 0 \n\tend",
"def off\n color(:passive)\n end",
"def toggle_status\n @judge = Judge.find(params[:id])\n authorize @judge\n\n if @judge.active?\n @judge.update_attribute(:status, \"removed\")\n else\n @judge.update_attribute(:status, \"active\")\n end\n redirect_back(fallback_location: result_competition_path(@judge.competition))\n end",
"def hide\n call Screen.setColor(false)\n call draw\n end",
"def visible=(bool)\n make_visible !!bool\n end",
"def hide!\n self[:hidden] = true\n self\n end",
"def unhide\n @this_user.update_attributes(:visible => true)\n redirect_to :controller => 'user', :action => 'view', :display_name => params[:display_name]\n end",
"def toggle_host_status\n if !self.host.listings.empty?\n self.host.update(host: true)\n else\n self.host.update(host: false)\n end\n end",
"def online?\n status != :offline\n end",
"def test_invisible\n [@window, @sprite, @bitmap].each{|container|\n uc = UCGraph.new(container, 500, 300, 50, @elements, nil, 100, -100, Font.normal_font,\n Color.hp_gauge_color1, Color.hp_gauge_color2,\n Color.mp_gauge_color1, Color.mp_gauge_color2)\n uc.visible = false\n uc.draw()\n }\n return true\n end",
"def set_PrivacyStatus(value)\n set_input(\"PrivacyStatus\", value)\n end",
"def set_PrivacyStatus(value)\n set_input(\"PrivacyStatus\", value)\n end",
"def suspend!\n self.update_attribute(:status, SUSPENDED)\n self.registration.update_attribute(:status, SUSPENDED) if self.registration\n end"
] | [
"0.68732727",
"0.6253153",
"0.6155522",
"0.5891482",
"0.5834581",
"0.5754021",
"0.57037",
"0.5696002",
"0.5632243",
"0.5585356",
"0.557294",
"0.5570152",
"0.55527866",
"0.5546498",
"0.55411613",
"0.55411613",
"0.5503662",
"0.5503662",
"0.54908526",
"0.5463203",
"0.5454171",
"0.54536074",
"0.5450156",
"0.54451185",
"0.5442712",
"0.5421772",
"0.5421515",
"0.54183203",
"0.541467",
"0.5414625",
"0.5401567",
"0.5401567",
"0.5392414",
"0.53898513",
"0.5387029",
"0.53807926",
"0.53775465",
"0.5374465",
"0.5366452",
"0.5357988",
"0.5355062",
"0.53177947",
"0.5314092",
"0.5305816",
"0.52985966",
"0.5292927",
"0.52846426",
"0.52846426",
"0.52846426",
"0.5275352",
"0.52733064",
"0.5271173",
"0.5260006",
"0.52528167",
"0.5247635",
"0.5247478",
"0.5244664",
"0.52402043",
"0.52388614",
"0.52382576",
"0.52304375",
"0.5227658",
"0.5225717",
"0.52212477",
"0.5221119",
"0.5221119",
"0.52190167",
"0.52138245",
"0.52061594",
"0.520206",
"0.5200286",
"0.5199601",
"0.5199601",
"0.5186644",
"0.5185018",
"0.5181582",
"0.51804507",
"0.51753217",
"0.5175153",
"0.51744366",
"0.51711994",
"0.5168947",
"0.5161125",
"0.51527315",
"0.51441765",
"0.51408577",
"0.5130939",
"0.5109363",
"0.5109346",
"0.5109215",
"0.5107495",
"0.5106876",
"0.5105994",
"0.5098027",
"0.50959796",
"0.5090473",
"0.50879145",
"0.5083806",
"0.5083806",
"0.50764686"
] | 0.78919953 | 0 |
Sets debug mode. If debug mode is on, many things will be outputted to STDOUT. | def debug=(new_debug)
LOGGER.debug = new_debug
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def debug_mode=(debug_mode)\n ConsoleDisplay.debug = debug_mode\n end",
"def debug_mode\n @configuration[:debug_mode] = true\n end",
"def debug_mode=(flag)\r\n self.conf[:debug] = flag\r\n end",
"def debug!\n @client.debug_dev = STDOUT\n end",
"def debug=(_)\n Nitro.mode = :debug\n end",
"def debugging(debug_bool)\n Facter::Options[:debug] = debug_bool\n end",
"def toggle_debug\n @debug = @debug == false ? true : false\n end",
"def debug_on(debug=true)\n ap \"Debugging is ON\"\n @debug = debug\n end",
"def toggle_debug!\n stream = @config[:debug]\n\n if stream.respond_to?(:<<)\n self.class.debug_output(stream)\n else\n self.class.debug_output\n end\n end",
"def debug=(truthy=false)\n\t@debug=truthy\n end",
"def debug=(flag)\n ENV['debug'] = nil\n ENV['DEBUG'] = flag.to_s\n end",
"def debug=(val)\n Handsoap::Service.logger = (val ? $stdout : nil)\n @@debug = val\n end",
"def debugging(bool)\n @@debug = bool\n end",
"def setDebugFlag(flag)\n\t\t\t@_debug_flag = flag\n\t\tend",
"def debug state=true\n @debug = state\n end",
"def with_debug\n @debug = true\n self\n end",
"def force_debug\n self.level = :debug\n @level_frozen = true\n end",
"def debug_mode\n orig = @@debug_mode\n @@debug_mode = true\n yield\n @@debug_mode = orig\n end",
"def debug!\n self.severity = :DEBUG\n end",
"def debug=(value); end",
"def debug!(value = true)\n if options.key?(:trace) && options[:trace] != false\n Vedeu.log(\"Configuration::API debug: true\")\n\n options[:debug] = true\n\n else\n Vedeu.log(\"Configuration::API debug: #{value}\")\n\n options[:debug] = value\n\n end\n end",
"def debug! \n $DEBUG = true\n end",
"def debug\n @@debug ||= false\n end",
"def setDebugLog(value)\n @fields['debug_log'] = value\n self\n end",
"def setDebugLog(value)\n @fields['debug_log'] = value\n self\n end",
"def setDebugLog(value)\n @fields['debug_log'] = value\n self\n end",
"def setDebugLog(value)\n @fields['debug_log'] = value\n self\n end",
"def setDebugLog(value)\n @fields['debug_log'] = value\n self\n end",
"def setDebugLog(value)\n @fields['debug_log'] = value\n self\n end",
"def setDebugLog(value)\n @fields['debug_log'] = value\n self\n end",
"def debug?; run_options[:debug]; end",
"def setDebugStream(stream)\n\t\t\t@_debug_stream = stream\n\t\tend",
"def debug_mode\n @@debug_mode == 1\n end",
"def debug\n usb_set_indicator_as_debug_light wValue: 1\n self\n end",
"def debugging?\n Options[:debug]\n end",
"def debug(*args)\n self.level = DEBUG if $DEBUG\n super\n end",
"def http_debug(http_debug_bool)\n Facter::Options[:http_debug] = http_debug_bool\n end",
"def set_debug\n @debug = Debug.find(params[:id])\n end",
"def debug(msg)\n STDERR.puts msg if options.key? :debug\n end",
"def debug?\n true\n end",
"def debug?\n true\n end",
"def debug\n Puppet::Util::Log.level = :debug\n end",
"def output_debug(string)\n if Command.ui\n Command.ui.debug string\n else\n $stderr.puts \"DEBUG: #{string}\"\n end\n end",
"def debug(info)\n puts(info) if @debug\n end",
"def set_debug(request_path, response_path)\n @debug = true\n @debug_request_path = request_path\n @debug_response_path = response_path\n end",
"def debug(*info)\n puts(info) if debug_mode?\n end",
"def enable_debug(file = nil)\n set_debug_file(file.to_s)\n end",
"def debugger=(type)\n @debugger = case type\n when :puts\n lambda {|msg|\n puts \" - debug :: #{msg}\"\n }\n else\n lambda {|_| }\n end\n debug \"set debug - #{type}\"\n end",
"def do_debug\n # debugging = true\n debugging = false\n puts yield if debugging\n end",
"def debug(*args, &block)\n add_with_options(DEBUG, *args, &block)\n end",
"def debug(dev=$stdout)\n current_logger = Grit.logger\n current_debug = Grit.debug\n begin\n Grit.logger = Logger.new(dev)\n Grit.debug = true\n yield\n ensure\n Grit.logger = current_logger\n Grit.debug = current_debug\n end\n end",
"def debug?\n @debug || to_bool( ENV['LAUNCHY_DEBUG'] )\n end",
"def debug?\n return @debug_mode if defined?(@debug_mode)\n @debug_mode = ENV['MOLINILLO_DEBUG']\n end",
"def set_debug_output(arg); end",
"def debug?\n puts \"Debug mode is #{@shell_debug ? 'ON' : 'OFF'}\\n\\n\"\n nil\nend",
"def debug(message)\n $stderr.puts(message) if @options[:debug]\nend",
"def debug?\n self[:debug] == 'true'\n end",
"def get_cli_debug\n if ENV.include?(\"debug\")\n if ENV[\"debug\"] == \"false\" || ENV[\"debug\"] == \"0\"\n $options[:verbose] = false\n else\n $options[:verbose] = true\n end\n else\n # default is on!\n $options[:verbose] = true\n end\n end",
"def debug_logging=(value)\n if value\n log.level = Logger::DEBUG\n elsif log.is_a?(Datadog::Logger)\n log.level = Logger::WARN\n end\n end",
"def set_debug\n ctrlr = params[:controller]&.to_sym\n ctrlr = nil unless SPECIAL_DEBUG_CONTROLLERS.include?(ctrlr)\n debug_parameters =\n url_parameters.keys.map { |k|\n case k.to_s\n when 'debug' then context = ctrlr\n when 'app.debug' then context = nil\n when /^app\\.([^.]+)\\.debug$/ then context = $1\n else next\n end\n [context, params.delete(k)]\n }.compact.to_h\n return if debug_parameters.empty?\n\n on = true\n off = application_deployed? && !dev_client? && :delete\n\n debug_parameters.each_pair do |context, debug|\n key = context ? \"app.#{context}.debug\" : 'app.debug'\n log = \"#{__method__}: #{key}=#{debug.inspect} -> %s\"\n state =\n if debug.to_s.casecmp?('reset') then Log.info(log % 'RESET') || off\n elsif false?(debug) then Log.info(log % 'OFF') || off\n elsif true?(debug) then Log.info(log % 'ON') || on\n else Log.warn(log % 'UNEXPECTED')\n end\n case state\n when true, false then session[key] = state\n when :delete then session.delete(key)\n else # no change\n end\n end\n\n will_redirect\n end",
"def debug?\n instance.options[:debug]\n end",
"def debug?\n instance.options[:debug]\n end",
"def debug=(d)\n @pdnsdbs.each do |pdnsdb|\n pdnsdb.debug = d\n end\n end",
"def debug?\n false\n end",
"def debug_mode?\n @@debug_mode\n end",
"def debug?\n @debug || ENV['HATCHET_DEBUG'] || false\n end",
"def debug_msg msg\n puts msg if @options[:debug]\n end",
"def debug(msg)\n puts \"[watchr debug] #{msg}\" if options.debug\n end",
"def debug(str)\n $stderr.puts(str) if @debug\n end",
"def debug(options = T.unsafe(nil)); end",
"def debug?\n debugging || !ENV['DEBUG'].nil?\n end",
"def debug(message, options = { })\n unless ENV['GUARD_ENV'] == 'test'\n reset_line if options[:reset]\n STDERR.puts color(\"DEBUG (#{Time.now.strftime('%T')}): \", :yellow) + message if ::Guard.options && ::Guard.options[:debug]\n end\n end",
"def debug status=true\n\t\t@debuggable_status = !!status\n\tend",
"def debug(message)\n stdout.print(\"#{message}\\n\") if ENV['DEBUG']\n end",
"def debug(msg=nil)\n log \"DEBUG: #{msg}\" if $debug\n end",
"def debug\n with_template_factory do |template_factory|\n orig_debug = Graphics.debug\n Graphics.debug = true\n render_screen(template_factory, StringIO.new)\n Graphics.debug = orig_debug\n end\n end",
"def enable_debug(file = nil)\n set_debug_file(file.to_s)\n self\n end",
"def debug?\n $DEBUG\n end",
"def debug(*text)\n if configuration.debug\n channel.write(\"command\" => \"debug\", \"text\" => text.join, \"on\" => on)\n end\n end",
"def debug; end",
"def debug; end",
"def debug; end",
"def debug; end",
"def debug(msg)\n STDERR.puts msg if @debug\n end",
"def debug\n logger.add(Logger::DEBUG, nil, facility) { yield } if logger && logger.debug?\n end",
"def debug?; end",
"def debug?; end",
"def print_debug(msg)\n puts msg if (@debug) \n STDOUT.flush\n end",
"def debug?\n @@debug\n end",
"def set_debug_level(val)\n super\n end",
"def set_debug_level(val)\n super\n end",
"def debug\n\t\t\texec_parsed_action('debug', [], false)\n\t\tend",
"def debug(s) if $DEBUG then $stderr.print(\"#{s}\\n\") end end",
"def debug(message)\n puts message if debug?\n end",
"def debug string\n puts string if $DEBUG\nend",
"def debug?\n level <= DEBUG\n end",
"def read_debug=(value); @debug = value; end",
"def debug(message)\n $stdout.puts \"D #{message}\" if @debug\n end",
"def set_verbosity\n @@option_debug = (options[:debug]) ? true : false\n @@option_verbose = (options[:verbose] || options[:debug]) ? true : false\n end"
] | [
"0.8239631",
"0.8111475",
"0.7848723",
"0.77481574",
"0.7702652",
"0.76977915",
"0.7658898",
"0.7658224",
"0.76164687",
"0.7607557",
"0.7503489",
"0.74618787",
"0.74214375",
"0.74158823",
"0.7399364",
"0.71884894",
"0.71749",
"0.7164863",
"0.7125587",
"0.71206987",
"0.70891464",
"0.70878065",
"0.7043443",
"0.7039744",
"0.7039744",
"0.7039744",
"0.7039744",
"0.7039744",
"0.7039744",
"0.7039744",
"0.6946697",
"0.6864312",
"0.68460155",
"0.67973876",
"0.6728048",
"0.6698148",
"0.66784984",
"0.6624419",
"0.6613903",
"0.6594704",
"0.6594704",
"0.65830123",
"0.6569912",
"0.6541591",
"0.65334874",
"0.65227336",
"0.6518147",
"0.6514221",
"0.65089756",
"0.6500384",
"0.64995164",
"0.6490383",
"0.6473702",
"0.6467247",
"0.6444344",
"0.6441031",
"0.6440286",
"0.64239377",
"0.6410815",
"0.64104277",
"0.63832194",
"0.63832194",
"0.6378096",
"0.63778615",
"0.6375606",
"0.6374967",
"0.6353935",
"0.6351452",
"0.63472956",
"0.6342827",
"0.6338751",
"0.6334983",
"0.62900287",
"0.62897",
"0.62889147",
"0.62756896",
"0.6272244",
"0.62705076",
"0.6256709",
"0.6252231",
"0.6252231",
"0.6252231",
"0.6252231",
"0.62488794",
"0.6242815",
"0.6241137",
"0.6241137",
"0.6233743",
"0.62182355",
"0.62180024",
"0.62180024",
"0.62141204",
"0.6185377",
"0.6181339",
"0.6175574",
"0.6160343",
"0.615712",
"0.6151613",
"0.612178"
] | 0.732655 | 16 |
Sets the logging mode | def mode=(new_mode)
LOGGER.mode = new_mode
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def logging=(value)\n @logging = value ? true : false\n end",
"def logging_enabled=(value)\n @@logging_enabled = value\n end",
"def test_mode!\n @test_mode = true\n # Switch the default logger\n ::Fluent::Logger.open(::Fluent::Logger::TestLogger)\n end",
"def log_level=(val)\n @@log_level = val\n end",
"def configure_logging(loglevel)\n return if loglevel == :none\n if self.options[:log_file].nil?\n\tKitchenplan::Log.init(Kitchenplan::Log::MultiIO.new(STDOUT))\n else\n\tfile = File.open(options[:log_file],\"a\")\n\tKitchenplan::Log.init(Kitchenplan::Log::MultiIO.new(STDOUT,file))\n end\n Kitchenplan::Log.level = loglevel\n end",
"def log_level=(level); end",
"def enable_logging(opts); end",
"def log(filename = '')\n options[:log] = filename\n end",
"def log\n @options[:log] || DEFAULT_LOG_FILE\n end",
"def log_level=(value)\n logger.level = value\n end",
"def log_level=(value)\n logger.level = value\n end",
"def log_level=(value)\n logger.level = value\n end",
"def configure_logging(loglevel=:debug)\n Kitchenplan::Log.init(Logger.new(STDOUT))\n Kitchenplan::Log.level = loglevel\n end",
"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",
"def loglevel=(level)\n @loglevel = logger.level = level\n end",
"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",
"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",
"def loglevel=(level)\n @log.level=level\n end",
"def setlog(level)\n $LOGLEVEL = level\n end",
"def initialize(mode = :normal)\n self.mode = mode\n time = Time.now.strftime(LOG_TIMESTAMP_FORMAT)\n @log_file = \"#{Dir.pwd}/logs/#{time}.log\"\n @log_modes = [:warn, :error]\n end",
"def level=(log_level)\n @@log_level = DEBUG_LEVEL[log_level]\n end",
"def level=(level)\n @level = level\n @log.level = @level\n end",
"def impressionist_log(mode=:error, str)\n Rails.logger.send(mode.to_s, str)\n end",
"def configure_logger\n logger.silent = silent?\n logger.colored = ansi?\n if verbose?\n logger.verbose = verbose?\n log 'Verbose mode is enabled.'\n end\n end",
"def enable_logging\n initialize_logger\n end",
"def set_mode(m)\n @mode = m\n end",
"def option_logging\n block = proc { |level| Logging::Logger.root.level = level; propagate_option('--logging', level) }\n @cl_parser.on('--logging LEVEL', 'Specify the minimum log level that should be logged.', &block)\n end",
"def set_log_level\n logger.level = options[:quiet] ? Logger::FATAL : Logger::WARN\n logger.level = Logger::INFO if options[:verbose]\n logger.info(\"Logger.level set to #{logger.level}\")\n raise OptionsError.new(\"Option mismatch - you can't provide -v and -q at the same time\") if options[:quiet] && options[:verbose]\n end",
"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",
"def set_enable(opts = {})\n cmd = command_builder('logging on', opts)\n configure cmd\n end",
"def debug_logging=(value)\n if value\n log.level = Logger::DEBUG\n elsif log.is_a?(Datadog::Logger)\n log.level = Logger::WARN\n end\n end",
"def fetch_log_level(mode)\n case mode\n when 'verbose'\n Logger::INFO\n when 'debug'\n Logger::DEBUG\n else # silent mode\n Logger::ERROR\n end\n end",
"def log_level=(level)\n logger.level = level\n end",
"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",
"def debug_mode=(flag)\r\n self.conf[:debug] = flag\r\n end",
"def logging_level\n @logging_level\n end",
"def log_level\n @log_level ||= :debug\n end",
"def log_level\n @log_level ||= :debug\n end",
"def level=(level)\n logger.level = level\n end",
"def configure_logger!\n if config[:debug] || !ENV[\"DEBUG\"].to_s.empty?\n Bogo::Logger.logger.level = :debug\n else\n Bogo::Logger.logger.level = config.fetch(:log, :fatal)\n end\n end",
"def set_log_level(flags)\n options = %w{none basic triggers trigger_summary entries exits closures}.map(&:to_sym)\n flags = Array.wrap(flags)\n unless flags.all? { |flag| options.member? flag }\n flags.each do |flag|\n unless options.member? flag\n raise ArgumentError, \"log level :#{flag} is not one of the support options: #{options.join(', ')}\"\n end\n end\n end\n @log_flags = flags\n end",
"def writer_mode(mode)\n raise \"Unknown writer mode #{mode}\" unless [:multiple, :single].include?(mode)\n @writer_mode = mode\n end",
"def test_mode=(test_mode)\n Defender.test_mode = test_mode\n end",
"def mode=(mode)\n @mode = mode ? mode.to_sym : nil\n end",
"def mode=(mode)\n request.mode = mode\n end",
"def log_level=(level)\n @logger.level = level\n end",
"def log_level; end",
"def log_level; end",
"def log_level\n @log_level ||= \"Log4r::#{@options[:log_level].upcase}\".constantize\n end",
"def enable_enhanced_logging=(enable)\n self.enable_debug_logging = enable\n self.aces_level = (enable ? 'full' : 'none')\n end",
"def log_level\n @log_level ||= DEFAULT_LOG_LEVEL\n end",
"def log_level\n @log_level ||= DEFAULT_LOG_LEVEL\n end",
"def log_level=(_arg0); end",
"def log_level=(_arg0); end",
"def log_set (level)\n execute(:log_set, level)\n end",
"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",
"def impressionist_log(str, mode=:error)\n Rails.logger.send(mode.to_s, str)\n end",
"def configure_logging\n @logger = Logging.logger[self]\n end",
"def log_level(value)\n Logger.log_level = value\n return nil\n end",
"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",
"def mode=(new_mode)\n handle_old_mode\n @mode = new_mode\n handle_new_mode\n end",
"def log_level=(log_level)\n @log_level = log_level if [DEBUG, INFO, WARN, ERROR].include?(log_level)\n end",
"def configure_logging\n Chef::Log.logger = AuditLogger.new(sensitive_inputs)\n Chef::Log.logger.level = Log.level_from_sym(Log.level)\n end",
"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",
"def set_mode(new)\n @mode = new\n end",
"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",
"def set_mode(mode)\n send_request(FUNCTION_SET_MODE, [mode], 'C', 0, '')\n end",
"def log\n instance.options[:log]\n end",
"def log\n instance.options[:log]\n end",
"def logging_prefs; end",
"def set_up_logging\n\n if @parameters[:log_to_file] then\n\n @logger = Logger.new(@parameters[:log_to_file])\n\n else\n\n @logger = Logger.new(STDOUT)\n\n end\n\n if @parameters[:log_detailed_messages] then\n \n @logger.sev_threshold = Logger::DEBUG\n\n else\n\n @logger.sev_threshold = Logger::INFO\n\n end\n\n end",
"def handle_loglevel(val)\n\t\tset_log_level(Rex::LogSource, val)\n\t\tset_log_level(Msf::LogSource, val)\n\tend",
"def log_level(value, options = {})\n DuckMap::Logger.log_level = value\n if options.has_key?(:full)\n DuckMap.logger.full_exception = options[:full]\n end\n end",
"def mode=(mode)\n \n write(\"++mode 1\" ) if mode==:Device \n write(\"++mode 0\" ) if mode==:Controller\n @mode = write(\"++mode\",true).to_i==1 ? :Controller : :Device\n end",
"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",
"def level=(value)\n @loggers.each do |logger|\n logger.level = value if logger.respond_to?(:level=)\n end\n end",
"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",
"def level=(value)\n logger_instance.level = self.class.level_from_any(value)\n end",
"def default_level\n ENV.key?(ENV_FLAG) ? ::Logger::DEBUG : ::Logger::WARN\n end",
"def log\n advanced[:log]\n end",
"def set_log(logdev, shift_age = 0, shift_size = 1024000)\n @log = Logger.new(logdev, shift_age, shift_size)\n @log.progname = @appname\n @log.level = @level\n end",
"def setLogger(log_file, level = :info)\n $logger = Lumberjack::Logger.new(log_file.to_s, buffer_size: 0) # Open a new log file with INFO level\n $logger.level = level\n puts \"#{level} logging to #{log_file}\"\nend",
"def configure_logging\n Backdat::Log.init(Backdat::Config[:log_location])\n if ( Backdat::Config[:log_location] != STDOUT ) && STDOUT.tty? &&\n ( !Backdat::Config[:daemonize] )\n stdout_logger = Logger.new(STDOUT)\n STDOUT.sync = true\n stdout_logger.formatter = Backdat::Log.logger.formatter\n Backdat::Log.loggers << stdout_logger\n end\n Backdat::Log.level = Backdat::Config[:log_level]\n end",
"def set_log(log, log_level = nil, delimiter = \" ~ \", auto_flush = false)\n if log_level && Levels[log_level.to_sym]\n @level = Levels[log_level.to_sym]\n else\n @level = Levels[:debug]\n end\n @buffer = []\n @delimiter = delimiter\n @auto_flush = auto_flush\n\n initialize_log(log)\n end",
"def setup_logging( level=Logger::FATAL )\n\n\t\t# Turn symbol-style level config into Logger's expected Fixnum level\n\t\tif Treequel::LOG_LEVELS.key?( level.to_s )\n\t\t\tlevel = Treequel::LOG_LEVELS[ level.to_s ]\n\t\tend\n\n\t\tlogger = Logger.new( $stderr )\n\t\tTreequel.logger = logger\n\t\tTreequel.logger.level = level\n\n\t\t# Only do this when executing from a spec in TextMate\n\t\tif ENV['HTML_LOGGING'] || (ENV['TM_FILENAME'] && ENV['TM_FILENAME'] =~ /_spec\\.rb/)\n\t\t\tThread.current['logger-output'] = []\n\t\t\tlogdevice = ArrayLogger.new( Thread.current['logger-output'] )\n\t\t\tTreequel.logger = Logger.new( logdevice )\n\t\t\t# Treequel.logger.level = level\n\t\t\tTreequel.logger.formatter = Treequel::HtmlLogFormatter.new( logger )\n\t\tend\n\tend",
"def enable_logging(opts)\n opts[:AccessLog] = []\n level = WEBrick::Log.const_get(opts[:BridgetownOptions][\"verbose\"] ? :DEBUG : :WARN)\n opts[:Logger] = WEBrick::Log.new($stdout, level)\n end",
"def reset_config!\n self.log = true\n self.logger = ::Logger.new STDOUT\n self.log_level = :debug\n self.raise_errors = true\n end",
"def log= logger\n @log = logger\n end",
"def log= logger\n @log = logger\n end",
"def setDebugLog(value)\n @fields['debug_log'] = value\n self\n end",
"def setDebugLog(value)\n @fields['debug_log'] = value\n self\n end",
"def setDebugLog(value)\n @fields['debug_log'] = value\n self\n end",
"def setDebugLog(value)\n @fields['debug_log'] = value\n self\n end",
"def setDebugLog(value)\n @fields['debug_log'] = value\n self\n end",
"def setDebugLog(value)\n @fields['debug_log'] = value\n self\n end",
"def setDebugLog(value)\n @fields['debug_log'] = value\n self\n end",
"def log\n @test_mode ? LogHelper::Redirect.instance.file : STDOUT\n end",
"def setup_logging( level=:fatal )\n\n\t\t# Only do this when executing from a spec in TextMate\n\t\tif ENV['HTML_LOGGING'] || (ENV['TM_FILENAME'] && ENV['TM_FILENAME'] =~ /_spec\\.rb/)\n\t\t\tlogarray = []\n\t\t\tThread.current['logger-output'] = logarray\n\t\t\tLoggability.output_to( logarray )\n\t\t\tLoggability.format_as( :html )\n\t\t\tLoggability.level = :debug\n\t\telse\n\t\t\tLoggability.level = level\n\t\tend\n\tend",
"def log=(logger); end"
] | [
"0.70555043",
"0.67728037",
"0.67487997",
"0.6737861",
"0.6694683",
"0.6575507",
"0.6504914",
"0.6463892",
"0.6455526",
"0.6379514",
"0.6379514",
"0.6379088",
"0.63767546",
"0.636815",
"0.63469726",
"0.6336211",
"0.6336211",
"0.6332319",
"0.6306417",
"0.62763315",
"0.6274712",
"0.6247717",
"0.6244963",
"0.6223854",
"0.62065935",
"0.6204619",
"0.6196012",
"0.6188798",
"0.618765",
"0.6175129",
"0.61692166",
"0.61681354",
"0.6155809",
"0.6120663",
"0.6113222",
"0.6097914",
"0.608592",
"0.608592",
"0.6083325",
"0.60737264",
"0.605597",
"0.60510486",
"0.60490924",
"0.6042326",
"0.60315233",
"0.60044545",
"0.59996784",
"0.59996784",
"0.5987674",
"0.5987274",
"0.5969125",
"0.5969125",
"0.5968372",
"0.5968372",
"0.5966271",
"0.5960764",
"0.5943235",
"0.5942323",
"0.5909984",
"0.59096026",
"0.5887969",
"0.5887264",
"0.58865005",
"0.5877311",
"0.5876378",
"0.58729535",
"0.5866385",
"0.5866087",
"0.5866087",
"0.5856462",
"0.58557636",
"0.58520603",
"0.5842194",
"0.584058",
"0.5830026",
"0.5821811",
"0.5818265",
"0.58111393",
"0.58026916",
"0.5800331",
"0.57931155",
"0.5790319",
"0.5784004",
"0.57822216",
"0.57782537",
"0.5754753",
"0.57525814",
"0.57179415",
"0.57179415",
"0.5712943",
"0.5712943",
"0.5712943",
"0.5712943",
"0.5712943",
"0.5712943",
"0.5712943",
"0.57127994",
"0.57056177",
"0.5704798"
] | 0.7741867 | 0 |
Prevents the READY packet from being printed regardless of debug mode. | def suppress_ready_debug
@prevent_ready = true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def blockdev?() end",
"def dump_pending\n end",
"def dump_pending\n end",
"def suppress; @write = false end",
"def maybe_print(message)\n is_status = message[\"payload\"].try(:[], \"message_type\") == \"read_status\"\n STDOUT.puts \"\\n#{message.to_yaml}\\n\" unless is_status\n end",
"def reserved?\n status == Status::RESERVED\n end",
"def silence!\n IO.console.raw!\n end",
"def allow_net_debug=(val)\n\t RequestStore.net_debug = val\n\tend",
"def allow_net_debug=(val)\n\t RequestStore.net_debug = val\n\tend",
"def print_status\n super\n print_battle_commands unless battle_commands.empty?\n end",
"def print_status\n super\n print_battle_commands unless battle_commands.empty?\n end",
"def force_debug\n self.level = :debug\n @level_frozen = true\n end",
"def promiscuous?\n\t\t\treturn false\n\t\tend",
"def print_debug(msg)\n puts msg if (@debug) \n STDOUT.flush\n end",
"def application_guard_allow_print_to_network_printers\n return @application_guard_allow_print_to_network_printers\n end",
"def ready=(_); end",
"def noop(msg); \"200 \"; end",
"def dprint(str)\n if ANSIBLE_DEBUG\n print str\n end\nend",
"def debug_through?\r\n return false\r\n end",
"def debug?\n false\n end",
"def quiet\n true\n end",
"def dump_null machine\n end",
"def print_good(msg='')\n end",
"def noop\n tagged_response(\"NOOP\")\n end",
"def debug status=true\n\t\t@debuggable_status = !!status\n\tend",
"def should_print?\n !@suppress_output\n end",
"def msg_nocr(msg)\n @output.write(msg)\n end",
"def phase3_basic_command_disabled?\r\n return false\r\n end",
"def without_reasoning\n @reasoning = false\n @connection = stardog(@endpoint,@options)\n self\n end",
"def security_disable_usb_debugging\n return @security_disable_usb_debugging\n end",
"def unprocessable?\n dump_type != PROCESSABLE_EVENT_TYPE\n end",
"def print_none(msg)\n tag = ' '\n print_formatted(tag,msg)\n end",
"def incomplete\n log_incomplete\n end",
"def without_proof\n @without_proof ||= \"c=biws,r=#{server_nonce}\"\n end",
"def silence_deprecations; end",
"def do_not_thread\n true\n end",
"def read_postition()\n start_command('F82', false, @status_debug_msg)\n end",
"def disable_approval!\n send(:remove_const, :DRAFT_PUNK_IS_SETUP) if const_defined? :DRAFT_PUNK_IS_SETUP\n send(:remove_const, :DRAFT_NULLIFY_ATTRIBUTES) if const_defined? :DRAFT_NULLIFY_ATTRIBUTES\n fresh_amoeba do\n disable\n end\n end",
"def debug!\n @client.debug_dev = STDOUT\n end",
"def setNoPrint(value)\n @fields['no_print'] = value\n self\n end",
"def setNoPrint(value)\n @fields['no_print'] = value\n self\n end",
"def setNoPrint(value)\n @fields['no_print'] = value\n self\n end",
"def xmit\n if @lag.zero?\n if @to_server\n $fake_server_port.on_packet_receive(CONNECTION_ID, @data, @channel)\n else\n $fake_client_conn.on_packet(@data, @channel)\n end\n true\n else\n @lag -= 1\n false\n end\n end",
"def debug\n @@debug ||= false\n end",
"def noop\n write_noop\n response_processor.consume_all_responses_until_mn\n end",
"def debug?; end",
"def debug?; end",
"def check_router\n # checks if the router is ready for us ?\n out_socket.send( \"READY\\n\", 0 )\n result = out_socket.recv( 100 )\n logger.debug( \"RESP TO READY #{result}\" )\n raise \"The router does not seem ready to receive commands\" unless result == \"YES\\n\" \n end",
"def print_raw(msg = '')\n @sock.write(msg)\n @sock.flush\n\n msg\n end",
"def blocking?\n false\n end",
"def graceful\n @accepting = false\n @outbox.put HaltTransmission\n \n # When the outbox-loop encounters the HaltTransmission,\n # it will break itself and close the connection.\n # See also the end of the #talk method.\n \n end",
"def quiet\n old = Thread.current[::Dalli::QUIET]\n Thread.current[::Dalli::QUIET] = true\n yield\n ensure\n @ring&.pipeline_consume_and_ignore_responses\n Thread.current[::Dalli::QUIET] = old\n end",
"def ready_status\n 'ready' if notification\n end",
"def release_no_delay?\n release_period == RELEASE_TEXT_VALUE_NO_DELAY\n end",
"def do_not_thread\n true\n end",
"def do_not_thread\n true\n end",
"def read_blocked\n end",
"def debug?\n\t\t!!@debuggable_status\n\tend",
"def disabled_rx?; @disabled_rx > 0 end",
"def eth_sw_en; eth_ctrl_bit(0); end",
"def prevent_startup\n return :irb if $0 == 'irb'\n return if sqreen_configuration.nil?\n disable = sqreen_configuration.get(:disable)\n return :config_disable if disable == true || disable.to_s.to_i == 1\n end",
"def do_not_thread\n\n true\n end",
"def disable_netblockdev(dev)\n res = system \"nbd-client -d #{dev}\"\n raise \"Failed to detach image from network block device server\" unless res\n puts \"Detached net block device: #{dev}\"\nend",
"def verbose\n false\n end",
"def assert_silent; end",
"def disable_approval!\n send(:remove_const, :DRAFT_PUNK_IS_SETUP) if const_defined? :DRAFT_PUNK_IS_SETUP\n send(:remove_const, :DRAFT_NULLIFY_ATTRIBUTES) if const_defined? :DRAFT_NULLIFY_ATTRIBUTES\n send(:remove_const, :ALLOW_PREVIOUS_VERSIONS_TO_BE_CHANGED) if const_defined? :ALLOW_PREVIOUS_VERSIONS_TO_BE_CHANGED\n fresh_amoeba do\n disable\n end\n end",
"def puts_debug(msg)\r\n if (self.debug) \r\n puts msg\r\n end # end debug\r\n end",
"def puts_debug(msg)\r\n if (self.debug) \r\n puts msg\r\n end # end debug\r\n end",
"def setnonblocking(enabled)\n\t\tsingleton_class.async_send_api = !enabled\n\t\tself.flush_data = !enabled\n\t\tsync_setnonblocking(true)\n\tend",
"def no_recapture\n @recapture = false\n end",
"def ready?\n return (@delay <= 0)\n end",
"def display_drb packet\n return unless @running\n return unless stream = packet_stream(packet)\n\n source = packet.source\n\n message = DRbDump::Message.from_stream self, packet, stream\n\n message.display\n\n stop if @statistics.drb_messages_sent >= @count\n\n @statistics.drb_packet_count += 1\n @drb_streams[source] = true\n @incomplete_timestamps.delete source\n rescue DRbDump::Loader::TooLarge\n display_drb_too_large packet\n rescue DRbDump::Loader::Premature, DRbDump::Loader::DataError\n @incomplete_streams[source] = stream.string\n @incomplete_timestamps[source] ||= packet.timestamp\n rescue DRbDump::Loader::Error\n @drb_streams[source] = false\n end",
"def raw_no_echo_mode\n end",
"def ready?\n\t\t$stderr.puts \"#{@name}: ready? not overridden!\"\n\tend",
"def toggle_debug\n @debug = @debug == false ? true : false\n end",
"def receive_disabled\n\n wrap_reply('disable' => Flor.true?(payload['ret']))\n end",
"def ready; end",
"def ready; end",
"def print_busted_msg(player)\n puts \"Player #{player.id}: Bust!\"\n end",
"def debug\n usb_set_indicator_as_debug_light wValue: 1\n self\n end",
"def b_rdt_send message\n puts 'B Sending Data Unreliably...'\n packet = Packet.new\n packet.payload = message.data\n b_udt_send packet\nend",
"def application_guard_allow_print_to_network_printers=(value)\n @application_guard_allow_print_to_network_printers = value\n end",
"def suppressed?\n status == 'suppressed'\n end",
"def receive(str)\n puts \"Received '#{str.strip}'\" unless @quiet\n end",
"def quiet; end",
"def debug_print(returnedData, debug=\"false\")\n if debug == \"true\" then\n puts \"\\r\\n[DEBUG]\\r\\n\"\n pp(returnedData) \n end\nend",
"def quiet?\n false\n end",
"def disableSerialization \n \"disableSerialization\" \n end",
"def onquiet\n end",
"def read_postition()\n execute_command('F82', false, @status_debug_msg)\n end",
"def isnonblocking\n\t\tfalse\n\tend",
"def on_has_internal_subset\n STDOUT << \"on_has_internal_subset\\n\"\n STDOUT.flush\n end",
"def send_pending; end",
"def read_nonblock\n begin\n res = @client.recv_nonblock(256)\n rescue IO::WaitReadable\n res = nil\n rescue Errno::ECONNREFUSED, Errno::EADDRNOTAVAIL\n puts \"#{'Error:'.error} Cannot communicate with Drone!\"\n @connected\n end\n end",
"def dispatch_incoming_packets(raise_disconnect_errors: T.unsafe(nil)); end",
"def hide\n set_publish_state(Event::DRAFT_STATE)\n end",
"def skip()\n lines = send_message(\"SKIP\", message)\n end",
"def ready?\n @status == :ready\n end",
"def add_closed_port_guard\n EventBus.subscribe(/.*/) do |event|\n if !@open\n raise \"Send :open_for_traffic before sending messages\"\n end\n end\n end"
] | [
"0.56040066",
"0.5365612",
"0.5365612",
"0.53409",
"0.5231933",
"0.5206627",
"0.5200374",
"0.51980317",
"0.51980317",
"0.51706046",
"0.51706046",
"0.51291233",
"0.5127588",
"0.5122123",
"0.5114263",
"0.5072797",
"0.506431",
"0.5060526",
"0.5028076",
"0.5013429",
"0.50047904",
"0.4995957",
"0.49639457",
"0.49440297",
"0.49347284",
"0.49266738",
"0.4924387",
"0.4920864",
"0.49158722",
"0.49154603",
"0.49071077",
"0.49062824",
"0.49054033",
"0.48985788",
"0.48917744",
"0.4887406",
"0.4882994",
"0.487715",
"0.48716697",
"0.4867709",
"0.4867709",
"0.4867709",
"0.48662198",
"0.48623046",
"0.48619694",
"0.48618665",
"0.48618665",
"0.48603293",
"0.48590073",
"0.48543862",
"0.4848968",
"0.48467535",
"0.48451704",
"0.48442128",
"0.48439252",
"0.48439252",
"0.48436466",
"0.48414308",
"0.48244855",
"0.48180535",
"0.48165545",
"0.48090258",
"0.4802243",
"0.4800007",
"0.47896534",
"0.47888446",
"0.47865778",
"0.47865778",
"0.4781478",
"0.47808075",
"0.4780369",
"0.47753137",
"0.47659424",
"0.47600335",
"0.4757768",
"0.47567767",
"0.47494552",
"0.47494552",
"0.4741143",
"0.47386298",
"0.4736979",
"0.4730357",
"0.47228062",
"0.47226787",
"0.47194958",
"0.47191352",
"0.47120184",
"0.47114858",
"0.47085923",
"0.47071192",
"0.47042918",
"0.46970087",
"0.4695697",
"0.46946552",
"0.4693405",
"0.46911848",
"0.46906587",
"0.46852186",
"0.46846873"
] | 0.73851323 | 0 |
Add a user to the list of ignored users. Those users will be ignored in message events at event processing level. | def ignore_user(user)
@ignored_ids << user.resolve_id
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_user(user)\n self.users << user unless self.users.include?(user)\n end",
"def update_ignores\n @ignore_users |= WhitelistedUser.all.map(&:user_id)\n end",
"def add_user_ids(user_ids) # :nodoc:\n user_ids.each do |id|\n @context.add_user(:id => id) unless @context.users[id]\n end\n end",
"def add_user!( user, update_user = true )\n puts \"add_user\"\n unless @users.include?( user )\n @users << user\n user.add_badge!( self, false ) if update_user\n end\n return @users\n end",
"def addWorkingUser user\n @workingUsers << user\n @workingUsers.uniq!\n end",
"def ignored?(user)\n @ignored_ids.include?(user.resolve_id)\n end",
"def ignored?(user)\n @ignored_ids.include?(user.resolve_id)\n end",
"def add_user(user)\n @users << user\n end",
"def admit_user user_id = nil\n return if is_global\n if (tagtype != 0) || user_id.nil? || (user_id == User.super_id)\n self.is_global = true\n elsif !owner_ids.include?(user_id) && (user = User.find_by id: user_id)\n self.owners << user unless owners.include?(user)\n end\n end",
"def add_user_list(user_list, skip_attribute_update = false)\n\t\tuser_hash = {}\n\t\tuser_list.each do |user_id|\n\t\t\tuser_hash[user_id] = { status: STATUS_NO_RESPONSE, \n\t\t\t\tcondition: NoCondition.new.get_hash }\n\t\tend\n\t\tself.party_list.merge!(user_hash) { |key, old, new| old }\n\t\tself.update_attribute(:party_list, self.party_list) if !skip_attribute_update\n\tend",
"def unignore_user(user)\n @ignored_ids.delete(user.resolve_id)\n end",
"def unignore_user(user)\n @ignored_ids.delete(user.resolve_id)\n end",
"def add_user(user)\n user_hash[user.nick]=user unless user_hash.has_key?(user.nick)\n end",
"def add_users(users)\n users.each do |user|\n @users.push(user)\n end\n end",
"def add_user(user)\n @users[user.name] = user\n end",
"def process_users(users)\n users.each do |element|\n user = User.new(element, @bot)\n @users[user.id] = user\n end\n end",
"def add_tracked_user_invites(user_id, track_type)\n tracker.add([self.user_id, user_id, TrackTypes::USER_INVITES, track_type])\n end",
"def user(*args)\n @users << User.add(*args)\n end",
"def add_to_user_event_lists(user_list)\n\t\tuser_list.each do |users_id| \n\t\t\tuser = User.find(users_id)\n\t\t\tuser.add_event(self.id)\n\t\tend\n\tend",
"def add_user(user)\n comments.each { |c| c.mark_as_read!(for: user) }\n subscribe!(user)\n project.add_user(user)\n end",
"def add_existing_users(users)\n users.map do |user|\n @current_course.course_users.build(user: user[:user], name: user[:name],\n workflow_state: :approved, creator: @current_user,\n updater: @current_user)\n end\n end",
"def add_responsible(responsible)\n users << responsible\n end",
"def process_non_users(non_users,message)\n puts \"NON USER IS = #{non_users}\"\n #message = \"New Clowder event - you've been invited to #{event_record[\"title\"]}\"\n if (!non_users.nil? && !non_users.empty?)\n\n AwsUser.save_non_users(non_users)\n TwillioSms.new\n non_users.each do |non_user|\n TwillioSms.send_sms(non_user.phone_number,message)\n end\n end\n end",
"def addUserToList(username)\n\t\tbegin\n\t\t\tresult = 0\n\t\t\tif !@members.include?(username)\n\t\t\t\tTwitterClient.add_list_member(@selectedList,username)\n\t\t\t\tresult = 1\n\t\t\tend\n\t\t\tresult\n\t\trescue\n\t\t\t-1\t\n\t\tend\n\tend",
"def notify_users before_user_ids\n users_removed = before_user_ids - @roster.users.ids\n users_added = @roster.users.ids - before_user_ids\n\n # users added\n User.find(users_added).each do | u |\n @roster.send_welcome_message u\n i = @roster.invites.find_by :user => u\n NotificationWorker.perform_async(i.id, 'Invite', 'Notifications::EventInviteNotification', 'invited') if i.present?\n end\n\n # users removed\n User.find(users_removed).each do | u |\n @roster.send_removed_message u\n end\n end",
"def add_user(user)\n @usernames[user] = get_color unless @usernames.has_key?(user)\n end",
"def add_participant(_user_ids, _current_user = nil)\n update(new_members: _user_ids.is_a?(Array) ? _user_ids : [_user_ids], updated_by: _current_user)\n end",
"def add_users(users)\n users.each do |user|\n unless @users_by_href.has_key?(user.href)\n @users_by_href[user.href] = RsUserPolicy::User.new(user)\n end\n end\n end",
"def add_users_to_cc_list(user_ids)\n user_ids.each { |id| self.users << User.find(id) }\n self.save\n end",
"def add_member(user)\n members << user unless has_member? user\n end",
"def add_user(user)\r\n\t\tsend(\"ADC\",\"FL N=#{user.name} F=#{user.safenick}\")\r\n\t\tsend(\"ADC\",\"AL N=#{user.name} F=#{user.safenick}\")\r\n\t\t## XXX changes recorded locally by ADD msg back\r\n\t\treturn 1\r\n\tend",
"def add_existing_users(users)\n users.map do |user|\n @current_course.course_users.build(user: user[:user], name: user[:name],\n creator: @current_user,\n updater: @current_user)\n end\n end",
"def add_user(newuser)\n @group_users.push(newuser)\n end",
"def publish_to(*user_ids)\n @users_to_notify += user_ids\n end",
"def skip(other_user)\n skips.create(skipped_id: other_user)\n end",
"def add_user(user)\n self.users.create(id: user.id)\n end",
"def add_user_to_import(canvas_user)\n @sis_user_import << canvas_user\n end",
"def add(user)\n\t\t\tkparams = {}\n\t\t\t# The new user\n\t\t\tclient.add_param(kparams, 'user', user);\n\t\t\tclient.queue_service_action_call('user', 'add', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend",
"def add_user!( user )\n raise TypeError.new('not a user') unless user.is_a?(Ecore::User)\n user.add_group!(self)\n end",
"def add_user(rating)\n @user_list[rating.user_id] ||= User.new\n @user_list[rating.user_id].add(rating)\n end",
"def add_user(jid)\n users << jid.to_s.downcase\n users.sort!\n users.uniq!\n end",
"def add_user(name)\n\t@users << {:name => name}\n end",
"def add_to_group(team, this_user)\n team[:user_ids] << this_user\n end",
"def add_to_queue!(user)\n $redis.lpush(self.class.redis_key_for_user(user), to_redis_object)\n end",
"def add_user(user)\n return false if self.users.include? user.user_id\n self.users = (users || []) + [user.user_id] \n user.databases = (user.databases || []) + [self._id]\n user.save\n self.save\n end",
"def ignore\n users = User.where(username: [params[:username], params[:other_username]])\n raise Discourse::InvalidParameters.new if users.size != 2\n\n DiscourseFingerprint.ignore(users[0], users[1], add: params[:remove].blank?)\n DiscourseFingerprint.ignore(users[1], users[0], add: params[:remove].blank?)\n\n render json: success_json\n end",
"def add_group_users(user_ids)\n raise 'Attempted to add a user to a non-group channel!' unless group?\n\n user_ids = [user_ids] unless user_ids.is_a? Array\n user_ids.each do |user_id|\n API::Channel.add_group_user(@bot.token, @id, user_id.resolve_id)\n end\n self\n end",
"def add_new_users(users)\n user = users.first\n wait_until_bus_section_load\n user_group_select.select(user.user_group) unless user.user_group.nil?\n storage_type_select.select(user.storage_type) unless user.storage_type.nil?\n storage_max_tb.type_text(user.storage_limit) unless user.storage_limit.nil?\n device_tb.type_text(user.devices) unless user.devices.nil?\n\n unless user.enable_stash.nil?\n if user.enable_stash.downcase.eql?('yes')\n enable_stash_cb.check\n else\n enable_stash_cb.uncheck\n end\n end\n\n users.each_index do |index|\n Log.debug \"##########adding the #{index} user\"\n find(:id, \"user#{index+1}_name\").type_text(users[index].name)\n find(:id, \"user#{index+1}_username\").type_text(users[index].email)\n add_user_btn.click if index != users.length-1\n end\n\n unless user.send_email.nil?\n if user.send_email.downcase.eql?('yes')\n send_emails_cb.check\n else\n send_emails_cb.uncheck\n end\n end\n\n submit_btn.click\n wait_until_bus_section_load\n end",
"def enduser_ignored?\n true\n end",
"def add_follower(user)\n @followers.push(user)\n end",
"def block_user!(_user)\n _user = User.find(_user) unless _user.is_a? User\n blocked_users_relationships.where(user_id: _user.id).first_or_create!\n # delete information with blocked user\n friendship_with(_user.id).destroy_all # delete friendship\n ignore_suggested_friend(_user.id) # ignore friends suggestions\n unfollow(_user) # delete following\n unfollowed(_user) # cancel follower\n Conversation.get_single_conversation(id, _user.id).try(:destroy) # remove 1 to 1 conversation\n _user.refresh_cache && refresh_cache\n end",
"def add_user(user)\n super.tap do |org_user|\n class_name = (users.count == 1) ? JudgeTeamLead : DecisionDraftingAttorney\n class_name.create!(organizations_user: org_user)\n end\n end",
"def followUser(userToFollow)\n @followers << userToFollow\n end",
"def add_mention(user)\n @mentions << user unless user.name == self.name or mentions.include?(user)\n self\n end",
"def add_participant(user) # :nodoc:\n id = user.to_s.downcase\n if @participant_ids.include?(id)\n logger.warning(\"Attempted to add a participant who was already in the wavelet(#{@id}): #{id}\")\n return nil\n end\n\n # Allow string names to be used as participant.\n user = if @context.users[id]\n @context.users[id]\n else\n @context.add_user(:id => id)\n end\n\n @context.add_operation(:type => Operation::WAVELET_ADD_PARTICIPANT,\n :wave_id => @wave_id, :wavelet_id => @id, :property => user)\n @participant_ids << id\n \n user\n end",
"def add_subscriber!(user)\n unless self.subscribers.include? user\n self.subscribers << user unless self.subscribers.include? user\n IdeaMailer.new_subscriber_email(user, self).deliver_now\n end\n end",
"def follow!(user)\n\t\tfollowed << user\n\tend",
"def with_ignored(ignored_a)\n @ignored_elements += ignored_a\n self\n end",
"def add_friend(user, destination_user)\n manage_friend user,destination_user, 'added'\n end",
"def add_new_itemized_users(users)\n user = users.first\n\n unless user.user_group.nil?\n user_group_select.type_text(user.user_group)\n page.driver.execute_script(\"document.querySelector('img[alt=\\\"Search-button-icon\\\"]').click()\")\n wait_until { !loading_img.visible? }\n find(:xpath,\"//li[text()='#{user.user_group}']\").click unless user.user_group == ''\n wait_until {!(find(:xpath, \"//li[text()='#{user.user_group}']\").visible?) }\n end\n\n # name/email section\n nu_name_tb.type_text(user.name) unless user.name.nil?\n nu_email_tb.type_text(user.email) unless user.email.nil?\n # quota/device section\n nu_devices_server_tb.type_text(user.devices_server) unless user.devices_server.nil?\n nu_quota_server_tb.type_text(user.quota_server) unless user.quota_server.nil?\n nu_devices_desktop_tb.type_text(user.devices_desktop) unless user.devices_desktop.nil?\n nu_quota_desktop_tb.type_text(user.quota_desktop) unless user.quota_desktop.nil?\n\n unless user.enable_stash.nil?\n if user.enable_stash.downcase.eql?('yes')\n nu_enable_stash_cb.check\n else\n nu_enable_stash_cb.uncheck\n end\n end\n\n # default quota for stash?\n unless user.stash_quota.nil?\n if user.enable_stash.downcase.eql?('yes')\n if user.stash_quota.downcase.eql?('default')\n #its default\n else\n nu_stash_quota_tb.type_text(user.stash_quota) unless user.stash_quota.nil?\n end\n else\n end\n end\n\n # send stash invite emails?\n unless user.send_invite.nil?\n if user.send_invite.downcase.eql?('yes')\n nu_send_stash_inv_cb.check\n else\n nu_send_stash_inv_cb.uncheck\n end\n end\n\n # finishing up\n nu_create_btn.click\n #wait_until_bus_section_load\n end",
"def ignore_enduser\n record_api_supportability_metric(:ignore_enduser)\n NewRelic::Agent::Transaction.tl_current&.ignore_enduser!\n end",
"def add_follower(user)\n followers << user\n end",
"def add_users(ids)\n\t\t self.shared_users = ids.split(\",\").map do |id|\n \t\tUser.where(id: id.strip).first_or_create!\n \tend\n\tend",
"def add_follower(user)\n @followers << user\n end",
"def add_users(resource, users)\n users.each do |u|\n begin\n resource.add_user({ :user_name => u })\n rescue Aws::IAM::Errors::NoSuchEntity\n puts Colors.red(\"\\tNo such user #{u}!\")\n end\n end\n end",
"def notify_users_and_add_it\n return # disabled for now\n return true if remote?\n User.find_all_by_notify_on_new_torrents(true).each do |user|\n Notifier.send_new(user,self) if user.notifiable_via_jabber?\n user.watch(self) unless user.dont_watch_new_torrents?\n end\n end",
"def add_user( user )\n raise TypeError.new('not a user') unless user.is_a?(Ecore::User)\n user.add_group(self)\n end",
"def join(user)\n @mysqlHelper.insertConUser(user.getI,@id)\n @userList.getcontents.each { |users| \n \n users.userChangeFromChannel(\"204\", @id, user.getId)\n }\n @userList.add(user)\n \n end",
"def follow!(user)\n\t\tfollowed << user \n\tend",
"def add_tracked_user_like_membership(user_id, track_type)\n tracker.add([self.user_id, user_id, TrackTypes::USER_LIKE_MEMBERSHIP, track_type])\n end",
"def invite_new_users(users)\n user_email_map = user_email_map(users.map { |user| user[:email] })\n\n users.map do |user|\n course_user = @current_course.course_users.build(name: user[:name], workflow_state: :invited,\n creator: @current_user,\n updater: @current_user)\n user_email = user_email_map[user[:email]] || User::Email.new(email: user[:email])\n user_email.skip_confirmation!\n course_user.build_invitation(user_email: user_email, creator: @current_user,\n updater: @current_user)\n end\n end",
"def notify(new_user)\n self.users.each do |user|\n if user.id != new_user.id\n SocketController.user_joined(user, new_user)\n end\n end\n end",
"def add_user!(user_or_email, recognition=nil, opts={}, &block)\n \n #allow stubs or full emails, but force company domain\n # email = email_stub.split(\"@\")[0]+\"@\"+self.company.domain \n # return User.new() if User.exists?(email: email)\n u = user_or_email.kind_of?(User) ? user_or_email : User.new(email: user_or_email)#self.company.users.build(email: user_or_email)\n\n yield u if block_given?\n \n st = recognition.present? ? \n :invited_from_recognition : \n (opts[:skip_invitation] ? :pending_invite : :invited)\n\n u.company = opts[:company] if opts[:company].kind_of?(Company)\n u.skip_same_domain_check = true if opts[:skip_same_domain_check]\n u.bypass_disable_signups = opts[:bypass_disable_signups]\n u.set_status!(st)\n u.invited_at = Time.now\n u.invited_by = self\n u.skip_name_validation = true unless user_or_email.kind_of?(User)\n # recognition.present? ? u.save : u.save!#(validate: false)\n u.invited_from_recognition? ? u.save! : u.save\n return u\n end",
"def ignore_suggested_following(_user_id)\n follow_suggestions.where(user_id: _user_id).delete_all\n rejected_follow_suggestions.create(user_id: _user_id)\n end",
"def invite_users\n if GroupsController.group_owner? current_user.id, params[:id]\n set_group\n params[:users].each do |email|\n user = User.find_by_email(email) # TODO: only possible because email is unique. Should make magic assist to return user id's\n @group.users << user unless @group.users.include? user or user.nil?\n end unless params[:users].nil?\n respond_to do |format|\n format.html { redirect_to group_path(@group), alert: 'Invited users successfully.' }\n format.json { head :no_content }\n end\n else\n respond_to do |format|\n format.html { redirect_to groups_path, alert: \"Not invited. You are not the group owner\" }\n format.json { render json: \"Only owners can add users to the respective group\", status: :unauthorized}\n end\n end\n end",
"def add_user(user)\n group_members.create(group: self, user: user, accepted: DateTime.now)\n end",
"def ignore_orphan_files_from(paths_to_ignore)\n @ignored_orphan_files_paths << {\n ignored_paths: paths_to_ignore.is_a?(Array) ? paths_to_ignore : [paths_to_ignore],\n nodes_selectors_stack: current_nodes_selectors_stack\n }\n end",
"def add_users(new_users)\n\n return if new_users.nil?\n\n self.users = '|' if self.users.nil? or self.users.empty?\n self.users += new_users.join('|') + '|'\n end",
"def add_member(user)\n if (!self.members.include?(user))\n self.members << user\n else\n raise GroupsManagement::UserIsAlreadyMember, \"The user \" + user.email + \" is already a member of '\" + self.name + \"'.\"\n end\n end",
"def add_attendee!(user, dont_tweet = false)\n # Return true if already a supporter\n return true if self.is_attendee?(user)\n self.attendee_ids ||= []\n # Add supporter id\n self.attendee_ids << user.id\n\n # Tweet from supporter's account - no longer doing this now\n # unless dont_tweet\n # tw = user.twitter_client\n # tw.update(DemoDay.tweet_content) if Rails.env.production? && tw.present?\n # end\n\n save\n end",
"def remove(user)\n if(self.isIn(user))\n @mysqlHelper.deleteDisConUser(user.getI, @id)\n @userList.remove(user)\n @userList.getcontents.each { |users|\n users.userChangeFromChannel(\"205\", @id, user.getId)\n }\n end\n end",
"def like_by user\n likers << user && change_like_count(1)\n end",
"def notify(notification, user_list = nil, skip_admin = true)\n\t\tif not user_list\n\t\t\tparty_list.each_key do |key|\n\t\t\t\tnext if key == admin && skip_admin\n\t\t\t\tbegin \n\t\t\t\t\tuser = User.find(key)\n\t\t\t\trescue ActiveRecord::RecordNotFound\n\t\t\t\t\tnext\n\t\t\t\tend\n\t\t\t\tnotification.send_push(user)\n\t\t\t\tuser.post_notification(notification)\n\t\t\tend\n\t\telse\n\t\t\tuser_list.each do |key|\n\t\t\t\tnext if key == admin && skip_admin\n\t\t\t\tbegin \n\t\t\t\t\tuser = User.find(key)\n\t\t\t\trescue ActiveRecord::RecordNotFound\n\t\t\t\t\tnext\n\t\t\t\tend\n\t\t\t\tnotification.send_push(user)\n\t\t\t\tuser.post_notification(notification)\n\t\t\tend\n\t\tend\n\tend",
"def deny_user(user_id)\n create_entry(user_id, USER, false)\n end",
"def user_update(user_id)\n trade_lines.each do |x|\n if x.inventory_own.user_id != user_id\n x.user_from_accepted = false \n else\n x.user_from_accepted = true\n end\n x.save\n end\n end",
"def send_friend_request(other_user)\n friend_requests << other_user\n end",
"def watch_comment_by_user_ids\n user_ids = watch_comment_by_user_actions.where(\"action_option is null or action_option != ?\", \"ignore\").pluck(:user_id)\n user_ids += repository.watch_by_user_ids\n user_ids.uniq!\n\n user_ids - unwatch_comment_by_user_ids\n end",
"def add_event_subscriber\n\t\tevent = Event.find(params[:id])\n\t\tuser = User.find(params[:user_id])\n\t\tif !event.users.exists?(user.id)\n\t\t\tevent.users << user\n\t\t\t@del = true\n\t\telse\n\t\t\tevent.users.delete(user)\n\t\t\t@del = false\n\t\tend\n\tend",
"def allow_user(user_id)\n create_entry(user_id, USER, true)\n end",
"def add_users(course_id, test_users, user_role)\n users = ''\n test_users.each do |id, user|\n if user['role'] == user_role\n users << \"#{user['uid'].to_s}, \"\n end\n end\n if users.empty?\n logger.warn \"No test users with role #{user_role}\"\n else\n logger.info \"Adding users with role #{user_role}\"\n load_users_page course_id\n WebDriverUtils.wait_for_page_and_click add_people_button_element.when_visible\n user_list_element.when_visible timeout=WebDriverUtils.page_update_wait\n self.user_list = users\n self.user_role = user_role\n next_button\n WebDriverUtils.wait_for_page_and_click add_button_element\n add_users_success_element.when_visible timeout=WebDriverUtils.page_load_wait\n done_button\n end\n end",
"def process_mass_join(message)\n channel = message.channel\n /:(?<user_list>.+)/ =~ message.payload\n user_list.split.each do |user|\n channel.users[user] = User.new user unless channel.users.key? user\n end\n end",
"def add_owner(user)\n user = User.get_user(user, client)\n response = client.post \"/owners/?actor_token=#{CGI.escape client.system_token}\", {:jid => user.jid}\n if response.success?\n true\n else\n raise APIException.new(response.body)\n end\n end",
"def ignore=(ignored_array)\n @ignore = (@ignore + ignored_array).uniq\n end",
"def adduser(email, password, first_name, last_name, slug)\n @user = User.invite!(:email => email, :slug => slug) do |u|\n u.skip_invitation = true\n end\n token = @user.instance_variable_get(:@raw_invitation_token)\n User.accept_invitation!(:invitation_token => token,\n :password => password,\n :password_confirmation => password,\n :first_name => first_name,\n :last_name => last_name,\n :slug => slug)\n\n puts \"Created User #{email} with password #{password}\"\n @user\n end",
"def update_user!(user: nil)\n user_index = nil\n existing_user = nil\n\n users.each.with_index do |old_user, index|\n if old_user.email.casecmp(user.email.downcase).zero?\n user_index = index\n existing_user = old_user\n break\n end\n end\n\n if existing_user.nil?\n logger.debug(\"Couldn't update user #{user.email} because they don't exist\")\n raise \"Couldn't update user #{user.email} because they don't exist\"\n else\n users = self.users\n users[user_index] = user\n self.users = users\n logger.debug(\"Updating user #{existing_user.email}, writing out users.json to #{user_file_path}\")\n return true\n end\n end",
"def ignore\n @ignore ||= []\n end",
"def add_activity_to_friends_notifications(user)\n user.friends_notifications.add(@activity.json_blob, score_key)\n end",
"def add_baptised_members(_user_ids)\n return errors.add(:base, 'Some ids are not members of current user group') && false unless user_relationships.where(user_id: _user_ids).count == _user_ids.count\n user_relationships.where(user_id: _user_ids).update_all(baptised_at: Time.current)\n end",
"def add_users_sub_blocks\n @users.each do |ip|\n if @owner.respond_to? ip\n next\n else\n @owner.sub_block ip\n end\n end\n end"
] | [
"0.72495097",
"0.6920261",
"0.67893726",
"0.6752447",
"0.6710671",
"0.6366166",
"0.6366166",
"0.63495415",
"0.62881213",
"0.6199504",
"0.6164286",
"0.6164286",
"0.6117742",
"0.6079606",
"0.6074576",
"0.59940577",
"0.59710944",
"0.59380716",
"0.58957505",
"0.5882208",
"0.58468664",
"0.57639194",
"0.5759475",
"0.5728321",
"0.5706123",
"0.5688564",
"0.5678194",
"0.565216",
"0.56135565",
"0.56047624",
"0.55762005",
"0.5569394",
"0.55640167",
"0.5561661",
"0.55320424",
"0.55135894",
"0.5508829",
"0.5508597",
"0.54809326",
"0.54570353",
"0.54518366",
"0.54494125",
"0.54468375",
"0.5437631",
"0.5435332",
"0.54345554",
"0.54206234",
"0.5415375",
"0.5393528",
"0.538188",
"0.5353621",
"0.53450125",
"0.5344409",
"0.5342148",
"0.5331174",
"0.53306717",
"0.53230643",
"0.53152955",
"0.53141505",
"0.53134584",
"0.52981454",
"0.5291225",
"0.52882046",
"0.5275907",
"0.5272751",
"0.5272083",
"0.5267919",
"0.5262216",
"0.5253164",
"0.5251924",
"0.525038",
"0.52456146",
"0.5241638",
"0.5233322",
"0.52262276",
"0.5205142",
"0.5192546",
"0.5192253",
"0.51885545",
"0.5186937",
"0.5186293",
"0.51820135",
"0.51799077",
"0.51718575",
"0.51647425",
"0.5162402",
"0.5154945",
"0.5133363",
"0.51324415",
"0.51237357",
"0.50896305",
"0.507964",
"0.50789744",
"0.507869",
"0.5075473",
"0.50736755",
"0.5071604",
"0.50705636",
"0.5063117"
] | 0.76001734 | 0 |
Remove a user from the ignore list. | def unignore_user(user)
@ignored_ids.delete(user.resolve_id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ignore_user(user)\n @ignored_ids << user.resolve_id\n end",
"def ignore_user(user)\n @ignored_ids << user.resolve_id\n end",
"def removeWorkingUser user\n @workingUsers.delete user\n end",
"def remove(user)\n if(self.isIn(user))\n @mysqlHelper.deleteDisConUser(user.getI, @id)\n @userList.remove(user)\n @userList.getcontents.each { |users|\n users.userChangeFromChannel(\"205\", @id, user.getId)\n }\n end\n end",
"def remove_user(jid)\n users.delete(jid.to_s.downcase)\n end",
"def update_ignores\n @ignore_users |= WhitelistedUser.all.map(&:user_id)\n end",
"def remove_user(user)\n @in_room = false if user == @bot\n @users.delete(user)\n end",
"def remove_user(user_id)\n\t\treturn if is_admin?(user_id)\n\t\tparty_list.delete(user_id)\n\t\tself.update_attribute(:party_list, party_list)\n\tend",
"def ignore\n users = User.where(username: [params[:username], params[:other_username]])\n raise Discourse::InvalidParameters.new if users.size != 2\n\n DiscourseFingerprint.ignore(users[0], users[1], add: params[:remove].blank?)\n DiscourseFingerprint.ignore(users[1], users[0], add: params[:remove].blank?)\n\n render json: success_json\n end",
"def remove(opts)\n user = fetch(opts)\n if user\n @data = @data.reject { |u| u == user }\n persist\n end\n user\n end",
"def remove_user(user)\n self.users.destroy(user)\n end",
"def delete_user(user)\n res1 = remove_filtered_grouping_policy(0, user)\n res2 = remove_filtered_policy(0, user)\n res1 || res2\n end",
"def delete_user nick\n $log.debug(\"Users.add_user\") { \"Removing user #{nick} on #{@connection.name}\" }\n\n delete nick\n end",
"def delete nick\n\t\t@users.delete ['nick', nick]\n\tend",
"def unfollow_user(user)\n following.delete(user)\n end",
"def remove_user(user)\n self.users.destroy(id: user.id)\n end",
"def remove_user(user)\n self.users.destroy(id: user.id)\n end",
"def local_remove(body)\n key_hash = _user_keyhash(body)\n raise \"Invalid username\" unless key_hash\n raise \"That user is signed in!\" if @var[:presence][key_hash]\n @connection.comm.rsa_keys.delete(body)\n @connection.comm.names.delete(key_hash)\n @var[:user_keys].delete body\n _save_env\n _notice \"User '#{body}' has been removed from your key repository\"\nend",
"def unliked_by(user)\n self.send(self.class.like_label.tableize.to_sym).find_by_user_id(user.id).destroy rescue false\n end",
"def antiuser(user)\n users.where(['users.id <> ?', user.id]).first\n end",
"def remove_user_by_id(user_id)\n # ........\n end",
"def remove_user(user)\n channels = Set.new\n\n @channels.each do |channel|\n if channel.remove_user(user)\n channels << channel\n end\n end\n\n channels\n end",
"def remove_user(user)\n\t\traise Exceptions::InvalidParameter unless user.kind_of? User\n\t\t$redis.multi do\n\t\t\tusers.delete(user.guid)\n\t\t\tuser.events.delete(@guid)\n\t\t\t$redis.publish(kify(:topic, :user, user.guid), {:notification => :user_left_event, :user => user.guid, :event => @guid }.to_json)\n\t\tend\n\tend",
"def remove_requester(user)\n attempted_interpreter_requests.find_by(user_id: user.id).destroy\n end",
"def excludeuser(value)\n merge(rvexcludeuser: value.to_s)\n end",
"def ignored?(user)\n @ignored_ids.include?(user.resolve_id)\n end",
"def ignored?(user)\n @ignored_ids.include?(user.resolve_id)\n end",
"def remove(*)\n super.tap do\n __debug_sim('USER initiates removal of existing entries.')\n end\n end",
"def remove_user(username)\n if self[SYSTEM_USER_COLLECTION].find_one({:user => username})\n self[SYSTEM_USER_COLLECTION].remove({:user => username}, :w => 1)\n else\n false\n end\n end",
"def delete_user_account\n # delete their favorites before deleting user\n # list_to_delete = Favorite.where(user_id:current_user.id)\n binding.pry\n User.all.destroy(current_user.id)\n puts \"Your account have been removed! I will never tell, xoxo\"\n end",
"def remove_user_ban(data); end",
"def remove_user_ban(data); end",
"def unblock_user(id)\n delete(\"UserBlock/#{id}\")\n end",
"def ignore!()\n self.status = Invite::Status::IGNORED\n invitable.remove_member invitee\n save!\n end",
"def unblock_user!(_user_id)\n blocked_users_relationships.where(user_id: _user_id).destroy_all\n end",
"def unfollow(user)\n self.following.delete(user)\n end",
"def remove_user\n if !params[:user_ids].nil?\n stage = Stage.find(params[:id])\n params[:user_ids].each do |user_id|\n user = AssetUser.find(user_id.to_i)\n stage.asset_users.delete(user)\n end\n if stage.save\n redirect_to :back, :notice => \"Users successfully were removed from #{stage.title}\"\n else\n redirect_to :back, :alert => \"Action could not be completed\"\n end\n else\n redirect_to :back, :alert => \"No users were selected\"\n end\n end",
"def remove_from_queue!(user)\n $redis.lrem(self.class.redis_key_for_user(user), 0, to_redis_object)\n end",
"def unconfirm_user(user)\n confirmed_interpreter_requests.find_by(user_id: user.id).destroy\n end",
"def remove_item(list_item,user_list)\n user_list.delete(list_item)\n user_list\nend",
"def delete_user(username, removehome=false)\n\t\t\tend",
"def remove_user!( user )\n user.remove_group!( self )\n end",
"def remove_user( user )\n raise TypeError.new('not a user') unless user.is_a?(Ecore::User)\n user.remove_group(self)\n end",
"def ignore_suggested_friend(_user_id)\n rejected_friend_suggestions.create!(user_id: _user_id)\n friend_suggestions.where(user_id: _user_id).delete_all\n end",
"def excludeuser(value)\n merge(gadrexcludeuser: value.to_s)\n end",
"def remove(response)\n toggle_membership(response, :remove_user_from_group, \"user_removed\", \"user_not_in\")\n end",
"def remove_removed_user\n begin\n followers = get_followers\n followings = get_followings\n need_to_remove = followings - followers\n rescue\n error_log 'error in remove_removed_user'\n end\n\n log 'need to remove: '\n for id in need_to_remove do\n log \" #{id}\"\n end\n\n for id in need_to_remove do\n remove_user id\n end\n\n return followings.size - need_to_remove.size\n end",
"def remove(name)\n syscmd(\"userdel -f #{name}\")\n syscmd(\"groupdel #{name}\", valid_rcs: [6])\n exclusively { users.delete(name) }\n end",
"def remove_user_with_custom_field()\r\n remove_user_without_custom_field\r\n GroupsUserIndexed.find_by_group_id_and_user_id(@group.id, params[:user_id]).try!(&:destroy)\r\n end",
"def deleteUser(id) \n user_to_remove = getUserByID(id)\n\n if user_to_remove != nil \n @Users.delete(user_to_remove)\n else\n puts \"No such user.\"\n end \n end",
"def ignore_suggested_following(_user_id)\n follow_suggestions.where(user_id: _user_id).delete_all\n rejected_follow_suggestions.create(user_id: _user_id)\n end",
"def excludeuser(value)\n merge(grcexcludeuser: value.to_s)\n end",
"def choose\n @users = User.all.reject{ |user| user == current_user }\n end",
"def remove_item(user, item)\n before = get_item_count\n self.items.delete(item)\n after = get_item_count\n (before-after-1).times do\n user.add_to_list(item)\n end\n end",
"def unfollow(other_user)\n following.delete(other_user)\n end",
"def unfollow(other_user)\n following.delete(other_user)\n end",
"def unfollow(other_user)\n following.delete(other_user)\n end",
"def unfollow(other_user)\n following.delete(other_user)\n end",
"def remove_user\n create_user.tap do |r|\n r.action(:remove)\n end\n end",
"def delete_by_id(user_id)\n Iterable.request(conf, \"/users/byUserId/#{user_id}\").delete\n end",
"def remove_favorite\n\t remove_favorite_of User.current_user\n\tend",
"def add_user(user)\n self.users << user unless self.users.include?(user)\n end",
"def remove_user(username)\n TestLogger.info(\"Remove user #{username}...\")\n user_id = get_user_id(username)\n\n raise(Exception.new(\"User_id for #{username} not found\")) if user_id.nil?\n\n remove_user_by_id(user_id)\n end",
"def remove_readonly_user(opts)\n opts = check_params(opts,[:ro_user_info])\n super(opts)\n end",
"def delete_user_account\n # delete their favorites before deleting user\n User.all.destroy(current_user.id)\n puts \"\n Your account have been removed! I will never tell, xoxo\n \"\n \n end",
"def remove_user_by_handle(handle)\n ct = @handle_keys.key(handle)\n socket = @socket_keys.key(ct)\n @sockets.delete socket\n\n @handles.delete handle\n @handle_keys.delete ct\n @socket_keys.delete socket\n begin\n broadcast_message(socket, \"LEAVE\", [handle])\n rescue\n log \"failed to broadcast LEAVE for clone handle #{handle}\"\n end\n end",
"def return_by(user)\n borrowed_by.map {|user_in_arr|\n if user_in_arr == user\n borrowed_by.delete(user)\n end\n }\n end",
"def remove_assistant(user)\n user = User.find(user) unless user.is_a?(User)\n assistants.delete(user)\n return 1\n\n rescue\n return 0\n end",
"def remove_user\n query_api \"/rest/user\", nil, \"DELETE\"\n end",
"def parse_user_remove(msg_details)\n username = msg_details\n @userlist_table[username] = nil\n return username\n end",
"def unshare!( user )\n save if unshare( user )\n end",
"def remove_participant(user) # :nodoc:\n id = user.to_s.downcase\n unless @participant_ids.include?(id)\n logger.warning(\"Attempted to remove a participant who was not in the wavelet(#{@id}): #{id}\")\n return nil\n end\n\n # Allow string names to be used as participant.\n user = @context.users[id]\n\n unless user.robot?\n logger.warning(\"Attempted to remove a non-robot from wavelet(#{@id}): #{id}\")\n return nil\n end\n\n if user == @context.robot\n return remove_robot\n end\n\n @context.add_operation(:type => Operation::WAVELET_REMOVE_PARTICIPANT,\n :wave_id => @wave_id, :wavelet_id => @id, :property => user)\n @participant_ids.delete id\n \n user\n end",
"def remove_favourite(user_id, favourite_name)\n @favourites_store.destroy(user_id, favourite_name)\n end",
"def remove_member(user)\n members.delete user if has_member? user\n end",
"def unfollow(user)\n user.followers.delete(self)\n end",
"def removerole(userrole)\n userrole.delete if userroles.count > 1\n end",
"def unignore(object)\n true if ignores.where(:ignoreable_id => object.id, :ignoreable_type => object.class.to_s).first.try(:destroy)\n end",
"def destroy\n\t\t@ignore = Friend.where(:user_id => params[:id])\n\t\t@ignore.destroy\n\t\tredirect_to @user\n\tend",
"def empty_users\n user_list = Array.new(self.users)\n user_list.each { |id| remove_user User.find_by_id(id) }\n end",
"def remove_user(user)\n self.users.delete(user.user_id)\n user.databases.delete(self._id)\n self.save\n user.save\n end",
"def delete_user\n client.delete(user)\n end",
"def user_absent(name, &block)\n execute(\"if dscl . -list /Users/#{name}; then dscl . -delete /Users/#{name}; fi\", {}, &block)\n end",
"def remove\n user = User.find_by_username params[:username]\n if @team.name.eql?( Team::A_OWNERS ) && @team.members.count == 1\n flash[:error] = \"There must be at least 1 user at the #{Team::A_OWNERS} team!\"\n else\n @team.remove_member user\n end\n redirect_to organisation_team_path( @organisation, @team )\n end",
"def delete_user(user)\n users = roles\n existing = users[\"cloudant\"]\n \n existing.delete(user) if existing\n update_roles(users)\n end",
"def remove_user_from_mailchimp\n unless self.email.include?('@example.com')\n mailchimp = Hominid::API.new(AppConstants.mailchimp_key)\n list_id = mailchimp.find_list_id_by_name AppConstants.mailchimp_list\n result = mailchimp.list_unsubscribe(list_id, self.email, true, false, true) \n Rails.logger.info(\"Mailchimp unsubscribed for email id #{self.email}\")\n end\n end",
"def remove(user_id, tag_id)\n @_client.delete(\"/users/#{user_id}/tags/#{tag_id}\")\n end",
"def remove(response)\n return unless valid_message?(response)\n\n if Lita::Authorization.remove_user_from_group(\n response.user,\n @user,\n @group\n )\n response.reply \"#{@user.name} was removed from #{@group}.\"\n else\n response.reply \"#{@user.name} was not in #{@group}.\"\n end\n end",
"def delete_follower(user)\n followers.delete(user)\n end",
"def unfollow!(user)\n followings.find_by(following_id: user.id)&.destroy!\n end",
"def remove_member(user)\n update_membership(user, false)\n end",
"def remove_user(user)\n group_members.find_by(group: self, user: user).destroy\n end",
"def stop_sharing_with users\n case users\n when Array #unused functionality for now\n success = self.user_share_ids.reject! {|id| users.include? id.to_s}\n when BSON::ObjectId\n success = self.user_share_ids.reject! {|id| users == id}\n end\n\n self.save if success\n end",
"def modify_image_launch_perm_remove_users(image_id, user_id=[])\n modify_image_attribute(image_id, 'launchPermission', 'remove', :user_id => user_id.to_a)\n end",
"def user_unfollows\n if user_signed_in?\n Rails.logger.debug { \"The user to be unfollowed is #{params[:id]}\" }\n user = User.find(id: params[:id])\n user.follows.delete(current_user)\n end\n \n end",
"def delete_user_route(user)\n self.client.delete(\"gh.storage.user.#{user}\")\n end",
"def remove_user\n query_api '/rest/user', nil, 'DELETE'\n end",
"def check_out_by(user)\n borrowed_by.push(user)\n end",
"def drop\n Statements::DropUser.new(context: self)\n end",
"def drop_friend(user)\n if MuckFriends.configuration.enable_following\n Friend.revert_to_follower(self, user)\n else\n Friend.stop_being_friends(self, user)\n end\n end"
] | [
"0.7124421",
"0.7124421",
"0.678656",
"0.65031415",
"0.64845306",
"0.6445111",
"0.6416952",
"0.6416617",
"0.62982816",
"0.6271644",
"0.6251797",
"0.61972123",
"0.6186429",
"0.61432314",
"0.61270356",
"0.6110375",
"0.6110375",
"0.60872054",
"0.60124785",
"0.59864354",
"0.5986335",
"0.5984393",
"0.595539",
"0.5941748",
"0.5910195",
"0.5866479",
"0.5866479",
"0.5860525",
"0.5836193",
"0.5816996",
"0.5815723",
"0.5815723",
"0.5812939",
"0.5808411",
"0.580812",
"0.57929844",
"0.57883173",
"0.5766415",
"0.5750035",
"0.5737405",
"0.5735037",
"0.5722307",
"0.57222897",
"0.5704132",
"0.5700926",
"0.568506",
"0.56839854",
"0.5681344",
"0.5674711",
"0.56664526",
"0.56656057",
"0.5661081",
"0.5652092",
"0.564733",
"0.56448925",
"0.5644228",
"0.5644228",
"0.5644228",
"0.56428057",
"0.5640384",
"0.5639371",
"0.562846",
"0.56138",
"0.56135285",
"0.56036747",
"0.55879664",
"0.55871767",
"0.55840987",
"0.5583297",
"0.5571694",
"0.5569468",
"0.5568693",
"0.55638564",
"0.556116",
"0.5554972",
"0.5550425",
"0.5542697",
"0.5538541",
"0.5528736",
"0.55254716",
"0.5520812",
"0.551613",
"0.5496351",
"0.5489989",
"0.54871064",
"0.5482343",
"0.54741246",
"0.54587585",
"0.54521686",
"0.5450914",
"0.54376507",
"0.5433222",
"0.5432923",
"0.5420323",
"0.54156727",
"0.54152286",
"0.54118526",
"0.5408557",
"0.5405589"
] | 0.7673168 | 0 |
Checks whether a user is being ignored. | def ignored?(user)
@ignored_ids.include?(user.resolve_id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enduser_ignored?\n true\n end",
"def ignore?\n @should_ignore\n end",
"def ignored?\n !!ignored\n end",
"def i_dont_own?(object)\n if(current_user.present? and object.user.present? and object.user.id.present? and (current_user.id == object.user.id))\n false\n else\n true\n end\n end",
"def ignored?\n @ignored\n end",
"def is_user_specific?\n false\n end",
"def may_not_be_user_required\n\t\tcurrent_user.may_not_be_user?(@user) || access_denied(\n\t\t\t\"You may not be this user to do this\", user_path(current_user))\n\tend",
"def ignore?\n !!@ignore\n end",
"def ignorable_user?(expression, not_match_expression, user)\n @logger.debug(\"ignorable_user? #{user} \" << expression.to_s << not_match_expression.to_s)\n if (expression and not_match_expression)\n inc=!!(expression=~user)\n exc=!!(not_match_expression=~user)\n return ((!inc) or (inc && exc))\n end\n return (!(expression=~user)) if expression\n return (!!(not_match_expression=~user)) if not_match_expression\n\n false # both are nil\n end",
"def not_authenticated(user_id)\n if user_id == nil\n return true\n else\n return false\n end\n end",
"def ignored?(object)\n ignores.exists?(:ignoreable_id => object.id, :ignoreable_type => object.class.to_s)\n end",
"def is_potential_user?\n\t\ttrue\n\tend",
"def blocked?(user)\n blocked.include?(user)\n end",
"def ignored?\r\n infoxml = get_info\r\n \r\n if ignored = infoxml['ignored']\r\n return ignored == '1'\r\n end\r\n \r\n return false\r\n end",
"def user_is_not_owner\n unless @likeable_obj.present? && @likeable_obj.user_id != current_user.id\n redirect_to @likeable_obj, notice: \"You cannot like your own dog... How sad...\"\n end\n end",
"def ignore_enduser\n record_api_supportability_metric(:ignore_enduser)\n NewRelic::Agent::Transaction.tl_current&.ignore_enduser!\n end",
"def user_has_not_verified_other_discord_users?(user, discord_user)\n user.discord_user.nil? || !user.discord_user.verified? || user.discord_user == discord_user\n end",
"def disabled?\n user.nil?\n end",
"def blocked_to?(_user)\n blocked_user_ids.include?(_user.is_a?(User) ? _user.try(:id) : _user.to_i)\n end",
"def ignored?\n self.friendship_status == IGNORED\n end",
"def skip_user_details?\n org_details[:skip_user_details]\n end",
"def not_for_any_user options = nil, &block\n return if Labels.state_check Labels.extract(options), current_user\n yield \n end",
"def is_owner?(user)\n !user.nil? && (self.user_id == user.id)\n end",
"def user_is_not_blocked\n return errors.add(:user, 'You cannot block yourself')\\\n if user_id == blocked_id\n end",
"def userBlocked(userName)\n\n user = loadUser(userName)\n blocked = user[\"BLOCKED\"]\n if(blocked != nil && blocked)\n return true\n else\n return false\n end\n end",
"def ignored?()\n #This is a stub, used for indexing\n end",
"def is_not_global_and_is_owned_by?(user)\n !self.is_global? && self.user_id == user.id\n end",
"def ignore_user(user)\n @ignored_ids << user.resolve_id\n end",
"def ignore_user(user)\n @ignored_ids << user.resolve_id\n end",
"def not_account_owner\n not_account_owner_in_signup && !is_account_owner? \n end",
"def shadow_user?\n return !session[:shadow_user_id].blank?\n end",
"def ignored?(other)\n\trelationship = get_relationship(other)\n\t\n\treturn relationship && relationship.friend_status == \"IGNORED\"\n end",
"def dummy_user?\n (user_id.split('/').first == 'gofreerev')\n end",
"def dummy_user?\n (user_id.split('/').first == 'gofreerev')\n end",
"def ignore!\n @should_ignore = true\n end",
"def admit_user user_id = nil\n return if is_global\n if (tagtype != 0) || user_id.nil? || (user_id == User.super_id)\n self.is_global = true\n elsif !owner_ids.include?(user_id) && (user = User.find_by id: user_id)\n self.owners << user unless owners.include?(user)\n end\n end",
"def bot_user?\n !@email.nil?\n end",
"def user_defined?\n !@user.nil? || !@user['userId'].nil?\n end",
"def user_is_track_owner?(track)\n return false if current_user.nil?\n return true if current_user.has_role?('admin')\n current_user.is_track_owner?(track)\n end",
"def ignored?\n\t\treturn self.status == 'I'\n\tend",
"def check_if_current_user\r\n User.current_user && User.current_user != self\r\n end",
"def mine?\n user && user.username == Codeplane.username\n end",
"def missing_nickname?\n !current_user.nickname\n end",
"def foreign_visitor?\n not user\n end",
"def blocked?\n @ex && @ex.class == Twitter::Error::Unauthorized && @ex.message == \"You have been blocked from viewing this user's profile.\"\n end",
"def user_agent_excluded?\n request.user_agent.to_s.downcase =~ Regexp.union([self.mobylette_options[:skip_user_agents]].flatten.map(&:to_s))\n end",
"def rejected?(user)\n rejecting_interpreters.include?(user)\n end",
"def has_owner? user\n self.account_users.where(user: user, is_owner: true).count > 0\n end",
"def ignore_request(_team, _user)\n # stub\n end",
"def applies_to?(user); false end",
"def voted_on?(user)\n return !self.ratings.find_by_user_id(user.id).nil?\n end",
"def liked_by? user\n not likes.reject { |like| like.created_by != user }.blank?\n end",
"def other_user_profile?\n !is_owner\n end",
"def is_not_visible_gist?\n @gist.user_id != current_user.try(:id) && !@gist.is_public\n end",
"def hide_warnings?(work)\n current_user.is_a?(User) && current_user.preference && current_user.preference.hide_warnings? && !current_user.is_author_of?(work)\n end",
"def isAllowUser(request) \n return httpRequest('check_newuser',request)\n end",
"def owned?\n user.present?\n end",
"def is_owner?(user)\n user.id == self.user_id\n end",
"def test_ignore_enduser_works\n in_transaction do |txn|\n NewRelic::Agent.ignore_enduser\n\n assert_predicate txn, :ignore_enduser?\n end\n end",
"def should_ignore?(path)\n @ignore && @ignore.ignore?(path)\n end",
"def block?(other_user)\n blocks_user.include?(other_user)\n end",
"def is_disabled(user)\n ## check user\n return true if user.nil?\n\n ## check user custom field\n user_cf = UserCustomField.find_by_name(\"Hangouts Chat Disabled\")\n return true if user_cf.nil?\n\n ## check user custom value\n user_cv = user.custom_value_for(user_cf)\n\n ## user_cv is null\n return false if user_cv.nil?\n\n return true if user_cv.value == '1'\n\n return false\n end",
"def is_owner?(this_user)\n user == this_user\n end",
"def current_user? user\n if user == nil\n false\n elsif self.username == user.username\n true\n elsif\n false\n end\n end",
"def check_tweet_for_user\n if @tweet.user_id != current_user.id\n flash[:notice] = \"Not allowed!\"\n redirect_to tweets_url\n return\n end\n end",
"def check_if_able_to_reject\n @user_request = UserRequest.find(params[:id])\n return true if @user_request.user.eql?(current_user) || @user_request.team.team_captain.eql?(current_user)\n\n raise ActiveRecord::RecordNotFound\n end",
"def is_blacklisted_for?(user)\n user && user.id != self.id && self.is_premium? && self.blacklist_ids.include?(user.id)\n end",
"def invited_user_is_not_invited_by_himself\n\t errors[:base] << 'You cannot invite yourself!' if invited_user == invited_by_user\n\t end",
"def accessible_for?(user)\n user_id == user.id && !user.anonimous?\n end",
"def preview_only?(user)\n !listed && !author?(user)\n end",
"def antiuser(user)\n users.where(['users.id <> ?', user.id]).first\n end",
"def check_current_user_owns\n head :not_found unless @user == current_user\n end",
"def is_returning_user\n if cookies[:intervac_user].nil?\n return false\n end\n return true\n end",
"def needs_authenticate_user?\n except_actions = %w[index show print]\n !except_actions.include?(action_name)\n end",
"def already_welcomed?(user)\n notification = Notification.welcomed_by(self.id, user.id)\n !notification.empty?\n end",
"def to_user_not_authenticated?\n return if user_not_authenticated?\n end",
"def should_ignore(event)\n @ignored.any? { |ign| event.summary =~ /#{ign}/i }\n end",
"def thanked_by?(user)\n result = self.notifications.where(:sender_id => user.id)\n !result.empty?\n end",
"def ignored?(exception)\n configuration.ignored?(exception)\n end",
"def can_be_blacklisted_by?(user)\n user && user.id != self.user.id # && !user.all_friend_ids.include?(self.user.id)\n end",
"def is_owner_of?(thing)\n return false unless thing.user == self\n true\n end",
"def by_user?\n !@current_user.admin?\n end",
"def ignore_pacticipant?(pacticipant)\n resolved_ignore_selectors.any? do | s |\n s.pacticipant_id == pacticipant.id && s.only_pacticipant_name_specified?\n end\n end",
"def ignored?(path)\n path_clean = normalize_path(path)\n @ignored_callbacks.any? { |b| b.call(path_clean) }\n end",
"def can_unblock?(user)\n blocked? && self.blocker == user\n end",
"def ignore_passive_login?\n (request.format.js? ||\n request.format.json? ||\n user_signed_in? ||\n action_name == 'account' ||\n cookies[:_nyulibraries_eshelf_passthru])\n end",
"def blocked?\n (status == ConfigCenter::User::BLOCKED)\n end",
"def username_reserved?\n ReservedUsernames.include?(username)\n end",
"def is_require_accepting_user_to_match_invited_user_enabled\n return @is_require_accepting_user_to_match_invited_user_enabled\n end",
"def ignore\n @ignore = true\n end",
"def user_entry?\n !group_entry? && !other_entry?\n end",
"def ignored?\n marking == \"IGNORED\"\n end",
"def job_invalid?(user, user_now)\n user.preference_notify_me_by_email !=\n user_now.preference_notify_me_by_email ||\n user.preference_individual_email_notifications !=\n user_now.preference_individual_email_notifications ||\n user.preference_email_time !=\n user_now.preference_email_time\n end",
"def user_exists?(filter)\n not(user_tuple(filter, false).nil?)\n end",
"def mayView? ( other_user )\n if ( (not other_user.valid?) or ( other_user.is_a?(User) == false ) )\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n # d \"basic check failed\"\n # d other_user.type\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n return false\n end\n user = getUser()\n if ( other_user == user )\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n # d \"same user as owner\"\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n return true\n end\n if ( ( self.public_policy == Dfile::PP_MAYVIEW ) or ( self.public_policy == Dfile::PP_MAYEDIT ) )\n return true\n end\n if self.special_users\n special = self.special_users[other_user.id.to_s]\n if special\n if ( ( special == Dfile::PP_MAYVIEW ) or ( special == Dfile::PP_MAYEDIT ) )\n return true\n else\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n # d \"User has special permission but not right one\"\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\" \n end\n else\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n # d \"User has no special permission\"\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\" \n end\n \n else\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n # d \"no special permissions\"\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\" \n end\n return false\n end",
"def logged_in_normal_user?\n normal_user.present?\n end",
"def is_owner?(username)\n User.get_user(username).eql?(self.owner)\n end",
"def ignore?\n configuration.ignored_errors.each do |error|\n return true if @exception.is_a? error\n end\n\n false\n end",
"def hasNotReviewed(id)\n email_address = current_user.email\n reviews = Review.where(user_email: email_address)\n\n if logged_in?\n reviews.each do |rv|\n if rv.user_id == id\n return false\n end\n end\n else\n return false\n end\n return true\n end"
] | [
"0.7960408",
"0.6888111",
"0.6860321",
"0.6838355",
"0.68343896",
"0.67028886",
"0.6700272",
"0.66743845",
"0.65700126",
"0.6568097",
"0.6554485",
"0.6544706",
"0.65434754",
"0.6489275",
"0.6461445",
"0.64446515",
"0.6424585",
"0.6418858",
"0.6418317",
"0.63756204",
"0.63449216",
"0.6343968",
"0.63205326",
"0.6306456",
"0.63044804",
"0.63022876",
"0.62997276",
"0.6291716",
"0.6291716",
"0.6275888",
"0.62443006",
"0.6243903",
"0.62162626",
"0.62162626",
"0.6202723",
"0.61978763",
"0.619053",
"0.6186439",
"0.6167801",
"0.6147746",
"0.6141902",
"0.61018836",
"0.60938734",
"0.6092212",
"0.6083751",
"0.6078423",
"0.6068332",
"0.60499775",
"0.60497737",
"0.60423976",
"0.6042278",
"0.60421723",
"0.6010531",
"0.5992059",
"0.59863615",
"0.59796464",
"0.597956",
"0.59770215",
"0.5973399",
"0.5968398",
"0.5961034",
"0.5957636",
"0.593749",
"0.59270555",
"0.59225976",
"0.59189314",
"0.591728",
"0.59061104",
"0.59039176",
"0.59034455",
"0.5896013",
"0.5893709",
"0.5889295",
"0.58850616",
"0.5883042",
"0.58725536",
"0.58700436",
"0.58678645",
"0.5867522",
"0.5865683",
"0.58629036",
"0.58621615",
"0.58613753",
"0.585778",
"0.58514816",
"0.58500004",
"0.5848606",
"0.58425903",
"0.5836599",
"0.5829138",
"0.5826182",
"0.58251816",
"0.58212256",
"0.5819081",
"0.5803543",
"0.58010507",
"0.5800009",
"0.5788966",
"0.5785114"
] | 0.79722875 | 0 |
Dispatches an event to this bot. Called by the gateway connection handler used internally. | def dispatch(type, data)
handle_dispatch(type, data)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def call(event)\n client.send_message(queue_url: queue_url, message_body: event)\n end",
"def call(event)\n client.send_message(queue_url: queue_url, message_body: event)\n end",
"def send_event(event)\n @client.send_event(@klass.to_s, @id, event)\n self\n end",
"def send_event(msg, hash)\n client = Dogapi::Client.new(@api_key)\n event = Dogapi::Event.new(msg, hash)\n client.emit_event(event)\n end",
"def handle_event(event)\n\n\t\tend",
"def on_message(event)\n message = JSON.parse(event.data)\n\n if message['id']\n message['command'] = 'response_received'\n elsif message['message']\n command, *args = *message['message']\n message = {'command' => command, 'args' => args}\n end\n\n logger.debug \"Message received: #{message.inspect}\"\n dispatch(message)\n end",
"def handle_event\n event = ChargeBee::Event.retrieve(params[:id]).event\n handle(event)\n head :ok\n rescue ChargebeeRails::UnauthorizedError => e\n log_errors(e)\n head :unauthorized\n end",
"def send(evt)\n @client.send_event(evt) if @client\n end",
"def handle(msg)\n msg_obj = Octo::Message::Message.new(msg)\n msg = msg_obj.to_h\n begin\n eventName = msg[:event_name]\n if (valid_events.include?eventName)\n call_hooks(eventName, msg)\n end\n rescue Exception => e \n puts e.message\n puts e.backtrace.inspect\n end\n end",
"def dispatch_event(data)\n puts \"Event Dispatcher Invoked\"\n \n unless !data.has_key? \"type\"\n puts \"message type #{data['type'].to_s}\"\n \n # switch event action based on message type\n case data['type']\n when \"register\"\n puts \"user wishes to register. check auth_key first\"\n self.register(data)\n when \"subscribe\"\n puts \"user wishes to subscribe to a channel\"\n self.subscribe(data)\n when \"message\"\n # message: to:channel,from:uuid,type:message,text:message,visibility:private\n puts \"user wishes to send a message\"\n end\n \n else\n # if the socket is connected but no post_init data was sent\n # then we want to kill the connection, since this is probably an unauthorized\n # user....\n \n puts \"data doesn't have key type\"\n self.close_connection_after_writing\n end\n \n end",
"def send(evt)\n @client.send(evt) if @client\n end",
"def message(event)\n req = Message.from_wire(event.data)\n\n if req.type == \"rpc\" then\n # Execute the requested method and return the result\n # Do it asynchronously so as not to hold up the EM-loop while the command is running\n @thread_pool.perform do\n json_req = req.json_request\n logger.debug { \"RPC request\\n#{json_req}\" }\n json_response = @handler.new(req).handle(json_req)\n EM.next_tick { ws.send(Response.new(json_response, req.id).to_wire) }\n end\n\n elsif req.type == \"rpc_result\" then\n # Pass the result back to the caller\n res = req.json_response\n logger.debug { \"RPC_RESULT for request id [#{req.id}]\\n#{res}\" }\n @responses[req.id].response = res\n\n elsif req.type == \"connect\" then\n # Agent request to CONNECT to the manager\n # will only be received by the server-end of the channel\n logger.debug { \"CONNECT request #{req.id}\"}\n ret = @handler.new(req).connect(req.json_request, self)\n if ret.kind_of? JsonResponse then\n ws.send(Response.new(ret, req.id).to_wire)\n else\n ws.send(Response.new(JsonResponse.new(\"success\"), req.id).to_wire)\n end\n\n end\n end",
"def handle(event, args={})\n return unless valid_event(event, args)\n\n performed_by = args.delete(:performed_by)\n\n puts \"Received (#{event} event), Performed By: #{performed_by}, Options: #{args.inspect}\"\n game_manager.send(\"handle_#{event}_event\", performed_by, args)\n puts \"Completed (#{event} event)\"\n \n puts \"Status......\"\n game_manager.status\n end",
"def call\n if event.command? && command_aliases.include?(event.command)\n handle_command\n end\n end",
"def call event\n # Instantiate and execute a handler for the event based on its namespace.\n # Handlers are executed with the middleware instance as the receiver.\n namespace, topic = event.topic.split('.')\n self.instance_exec(event, &handler_for(namespace, event.type))\n\n # Pass through the event (with potentially modified arguments) to the next\n # middleware\n fire(event)\n end",
"def send_event(event)\n each { |actor| actor.mailbox.system_event event }\n end",
"def handle_message(event)\n sender = @users[event['sender']]\n timestamp = event['origin_server_ts'] || Time.now.to_i\n content = event['content']\n message = Message.new sender, timestamp, content\n broadcast(:message, @room, message)\n Events.processed event\n end",
"def dispatch(event)\n if ENV.key?('PROM_DEBUG')\n log.debug(\"PROM_DEBUG set, not dispatching event to Sensu: #{event}\")\n return\n end\n\n # :nocov:\n begin\n s = TCPSocket.open(@sensu_address, @sensu_port)\n s.puts(JSON.generate(event))\n s.close\n rescue SystemCallError => e\n log.error(\"Sensu is refusing connections! Error: '#{e}'\")\n raise(\"Sensu is not avilable at '#{@sensu_address}:#{@sensu_port}'\")\n end\n # :nocov:\n end",
"def act(target, message)\n buffer_output Net::YAIL::OutgoingEvent.new(:type => :act, :target => target, :message => message)\n end",
"def send_event(event, middleware: Emittance::Middleware)\n return nil unless enabled?\n\n event = middleware.up(event)\n brokers_in_use.each { |broker| broker.process_event(event) }\n end",
"def handle_redis_event(event)\n #puts \"REDIS HANDLE #{event.inspect}\"\n case event['t']\n when 'msg'\n if has_channel_id?(event['channel_id'])\n send_message(event['channel_id'], event['msg_t'], event['data'])\n end\n when 'refresh_users'\n refresh_users\n when 'refresh_channels'\n refresh_channels\n when 'reset_skips'\n reset_skips(event['channel_id'])\n when 'kick'\n kick(event['user_id'])\n when 'kick_ip'\n kick_ip(event['ip'])\n when 'ban'\n kick(event['user_id'])\n when 'setleader'\n set_channel_leader(event['channel_id'], event['leader_id'])\n\n end\n end",
"def onMessage(event)\n type, client_id = event.getMessageObject().split(':')\n case type\n when 'message'\n @engine.empty_queue(client_id)\n when 'disconnect'\n @engine.server.trigger(:close, client_id)\n else\n @engine.server.debug 'Unknown event ?', type\n end\n end",
"def emit_event(event)\n log.trace \"in_sendgrid_event: emit_event\"\n router.emit(\"#{tag}\", Fluent::EventTime.now, event)\n end",
"def work(raw_event)\n event = JSON.parse(raw_event)\n EventManager.new.handle_event(event)\n end",
"def on_sendable(event)\n Qpid::Proton::Event.dispatch(@delegate, :on_sendable, event) if !@delegate.nil?\n end",
"def handle(msg)\n message = Remote::Message.decode(msg)\n assert_type(message)\n call_route(message)\n end",
"def handle_dispatch(payload)\n LOGGER.debug { \"Emitting #{payload[:t]}\" }\n emit(payload[:t], payload[:d])\n end",
"def dispatch_event(event_name, args)\n @event_message_channels[event_name].each do |message_channel|\n message_channel.send [:event, event_name, args]\n end\n end",
"def send_event\n raise 'send_event must be defined in the child class'\n end",
"def dispatch!\n \n # negotiates initial configuration\n @meta = self.negotiate!\n \n # dispatches hash set to the server\n self.dispatch_hashing!\n self.dispatch_hashset!\n \n # dispatches orders\n self.dispatch_orders!\n \n # dispatches messages\n self.handle_messages!\n \n end",
"def handle_event( event )\n logger.debug \"Got Event #{event.inspect}\"\n evt = Rhouse::EventParser.parse( event )\n Rhouse.logger.debug \"Parsed event #{evt.inspect}\" \n event_type = MyRhouse::Events::EventTypeFactory.create_event( evt )\n\n # fire up rule engine\n engine.evaluate( event_type ) \n end",
"def handle\n case event_key\n when 'specialdeal'\n # it simulate an exchange with the special deal keyword\n SmartExchange::Process.new(user, 'special deal').perform\n when 'offers'\n # it simulate an exchange with the offers keyword\n SmartExchange::Process.new(user, '奖励').perform\n when 'groupchat'\n messenger.image! path: '/images/wechat/group.jpg'\n when 'chatsale'\n messenger.text! data(:chatsale)\n messenger.image! path: '/images/wechat/wechat_support_qr.jpg'\n when 'support'\n # it simulate an exchange with the support keyword\n SmartExchange::Process.new(user, '客服').perform\n when 'ping'\n messenger.text! data(:ping)\n end\n\n return_with(:success)\n end",
"def dispatch(message)\n Turntabler.run { @handler.call(message) } if @handler\n end",
"def on(event, &block) # open, message, close, ping, pong\n @events[event] = block\n end",
"def on_message\n websocket_client.on(:message) do |event|\n websocket_response = websocket_response_data_class.new(\n data: event.data,\n bot_params_class: bot_params_class\n )\n\n bot.handle_data(websocket_response.bot_params) do |message|\n websocket_request = websocket_request_data_class.new(message: message, data: websocket_response.bot_params)\n websocket_client.send(websocket_request.data_to_send)\n end\n end\n end",
"def send_events; end",
"def call event\n fire(event)\n end",
"def trigger_on_message(msg); @app.on_message(msg); end",
"def action(event)\n @neko.send event.target[:action]\n end",
"def dispatch_event(event)\n response = Helpers::HttpUtils.make_request(\n event.url, event.http_verb, event.params.to_json, event.headers, Helpers::Constants::EVENT_DISPATCH_CONFIG[:REQUEST_TIMEOUT], @proxy_config\n )\n\n error_msg = \"Event failed to dispatch with response code: #{response.code}\"\n\n case response.code.to_i\n when 400...500\n @logger.log(Logger::ERROR, error_msg)\n @error_handler.handle_error(HTTPCallError.new(\"HTTP Client Error: #{response.code}\"))\n\n when 500...600\n @logger.log(Logger::ERROR, error_msg)\n @error_handler.handle_error(HTTPCallError.new(\"HTTP Server Error: #{response.code}\"))\n else\n @logger.log(Logger::DEBUG, \"event successfully sent with response code #{response.code}\")\n end\n rescue Timeout::Error => e\n @logger.log(Logger::ERROR, \"Request Timed out. Error: #{e}\")\n @error_handler.handle_error(e)\n\n # Returning Timeout error to retain existing behavior.\n e\n rescue StandardError => e\n @logger.log(Logger::ERROR, \"Event failed to dispatch. Error: #{e}\")\n @error_handler.handle_error(e)\n nil\n end",
"def trigger_event(eventSymbol, *args)\n engine.send(eventSymbol, *args)\n end",
"def process(event)\r\n debug do\r\n carrier = event.payload[:carrier]\r\n action = event.payload[:action]\r\n \"\\n#{carrier}##{action}: processed outbound SMS in #{event.duration.round(1)}ms\"\r\n end\r\n end",
"def handle\n puts \"***************************\"\n puts \"HANDLING EVENT: #{@event.inspect}\"\n puts \"***************************\"\n\n # Pass event off to handlers based on event name/title\n if @event.title == \"Out of range\"\n DeviceOutOfRangeHandler.new(@event).handle\n elsif @event.title == \"In Range\"\n DeviceWithinRangeHandler.new(@event).handle\n end\n end",
"def on_message(event)\n data = event.data\n\n response = data.match(/~m~\\d*~m~(.*)/)[1]\n message =\n case response\n when /no_session/\n {'command' => 'no_session'}\n when /~h~([0-9]+)/\n # Send the heartbeat command back to the server\n @socket.send($1)\n {'command' => 'heartbeat'}\n else\n JSON.parse(response)\n end\n message['command'] = 'response_received' if message['msgid']\n\n logger.debug \"Message received: #{message.inspect}\"\n dispatch(message)\n end",
"def handle(event, klass, attributes)\n # TODO: Remove the following line after grove has been deployed. This skips old messages\n # with no processing.\n return unless ['access_group', 'access_group_membership', 'access_group_subtree'].include?(klass)\n\n event_handler = @handlers[klass.to_sym][event.to_sym]\n return unless event_handler\n case klass\n when 'access_group'\n event_handler.call(:id => attributes['id'], :label => attributes['label'])\n when 'access_group_membership'\n event_handler.call(:access_group_id => attributes['access_group_id'],\n :identity_id => attributes['identity_id'])\n when 'access_group_subtree'\n event_handler.call(:access_group_id => attributes['access_group_id'],\n :location => attributes['location'])\n end\n end",
"def execute(event, obj)\n state_machine.run_callback event.name, obj do |obj|\n execute_action(event, obj)\n end\n end",
"def dispatch(event_type, *params)\n @connection.mutex.synchronize do\n begin\n self.send(\"event_#{event_type}\", *params)\n rescue\n add_error(\"Event #{event_type} raised an exception: #{$!}\")\n end\n end\n end",
"def handle(context)\n \n # Notify all connection listeners by calling their on_server_response method.\n super(context)\n \n # Notify all connection listeners by calling their on_private_message method.\n notify(context) do |connection_listener| \n connection_listener.on_private_message(context, IRC::Models::Channel.is_valid?(target) ? context.lookup_channel(target) : context.lookup_user(target), text)\n end\n\n end",
"def trigger(owner, event, *args); end",
"def on_message_call handler\n @@handler_symbol = handler\n end",
"def trigger event, env\n triggered(event).each do |triggered_event|\n Nark.class_eval 'triggered_event.method_block.call env'\n end\n end",
"def connection\n @_event.connection\n end",
"def send_event(event, hint = nil)\n client.send_event(event, hint)\n end",
"def handle(context)\n \n # Notify all connection listeners by calling their on_server_response method.\n super(context)\n \n # Notify all connection listeners by calling their on_join method.\n notify(context) do |connection_listener| \n connection_listener.on_join(context, context.lookup_channel(channel), context.lookup_user(nick)) \n end\n \n end",
"def register(handler)\n conf = @config\n bot = self\n isaac = @bot\n\n @bot.register{|type, msg|\n begin\n $log.debug \"Received message: #{type} #{msg}\"\n handler.dispatch(type, msg, bot.clone_state(msg)) # TODO: send a binding?\n rescue Exception => e\n $log.warn e.to_s\n $log.debug e.backtrace.join(\"\\n\")\n end\n }\n end",
"def process_action(...)\n send_action(...)\n end",
"def handle_event(event)\n if event.is_a? CommandMessage\n handle_command(event)\n elsif event.is_a? LoginMessage\n player_data = @database.check_password(event.username, event.password)\n if player_data\n puts \"#{player_data[:username]} logs in\"\n body = @world.find_player(event.username) || @world.instantiate_player(event.username)\n p \"#{event.username} is at #{body.location.persistence_key}\"\n response = Response.new\n response.handled = true\n response.message = body.location.long\n response.body = body\n return response\n else\n response = Response.new\n response.handled = true\n response.message = \"Incorrect password\"\n response.quit = true\n return response\n end\n elsif event.is_a? HeartbeatMessage\n @world.heartbeat\n elsif event.is_a? PersistMessage\n return @world.persist\n elsif event.is_a? ResetMessage\n return @world.reset\n else\n puts \"Unhandled event #{event}\"\n Response.new\n end\n end",
"def emit event, *args\n @services.emit event, self, *args\n end",
"def dispatch(event, *args)\n result = nil\n @events[event]&.each { |hdl| result = hdl.call(*args) }\n result\n end",
"def dispatch(message)\n SpotifyWeb.run { @handler.call(message) } if @handler\n end",
"def process_event(event)\n return if Events.processed? event\n name = 'handle_' + event['type'].match(/\\w+$/).to_s\n send(name, event) if respond_to? name, true\n end",
"def on_message(message)\n search_for = message.event.split(\"/\")\n raise InvalidBackendEvent(message.event) if search_for.size < 2\n klass = @handlers[search_for[0]] and handler = klass.method(search_for[1])\n raise UndefinedHandler.new(message.event) unless handler\n logger.info(\"#{message.event}, #{message.inspect}\")\n handler.call(message)\n end",
"def fire_action_event\n require 'canis/core/include/ractionevent'\n fire_handler :PRESS, ActionEvent.new(self, :PRESS, text)\n end",
"def fire_event(event)\n blocks = FastlyNsq.events.fetch(event)\n blocks.each do |block|\n block.call\n rescue => e\n logger.error \"[#{event}] #{e.inspect}\"\n end\n end",
"def call event\n puts \"Transport published `#{event.type}` to \\\"#{event.topic}\\\" (from \\\"#{event.originator}\\\", #{event.args.size} args, #{event.kwargs.size} kwargs).\" if @print_debug\n # Publish the event across the session\n @session.publish(event.topic, event.args, { event: event.type, originator: event.originator }.merge(event.kwargs))\n # This is a pass-through middleware, so proxy the event up.\n fire(event)\n end",
"def on_message client, data\n controller(client).on_message(data)\n end",
"def send_event(event = :push, opts = {})\n payload = build_payload opts\n send_payload event, payload\n end",
"def handle_event(data)\n topic = data[1]\n payload = data[2]\n\n trigger(:event, self, topic, payload)\n end",
"def handle\n unless Parser.valid_json?(event_key)\n raise WechatBot::Error, 'Wrong extra data transmitted'\n end\n\n # db.referrers.find({\"reference_id\": \"okv2022017\"}).sort({ \"_id\": 1}).skip(0).limit(30)\n\n # we are in front of a referrer request\n referrer = Referrer.where(reference_id: reference_id).first\n slack.message \"Referrer is `#{referrer.id}`\", url: admin_referrer_url(referrer)\n\n if user && referrer\n slack.message \"Customer is `#{user.id}`\", url: admin_user_url(user)\n else\n slack.message \"Customer was not resolved : #{wechat_user_solver.error}\"\n raise WechatBot::Error, 'Wrong referrer or/and customer'\n return\n end\n\n # binding the potential user with the referrer\n ReferrerBinding.new(referrer).bind(user)\n\n slack.message \"Referrer user children `#{referrer.children_users.count}`\"\n\n return_with(:success)\n end",
"def event_bus; end",
"def event_bus; end",
"def handle_event(event)\n logger.warn(\"Isimud::EventObserver#handle_event not implemented for #{event_queue_name}\")\n end",
"def dispatch event\n @dispatch_fiber.resume event\n end",
"def process_event(event, session)\n logger = session.logger\n logger.debug \"#{self.class.name} running...\"\n @block.call(event, session) if @block\n end",
"def processEvent( client, user, t_event )\n#\t\tclient.room.say(\"Processing Event #{t_event}\")\n if user.id != client.user.id\n $botData['events'].each { |event|\n if event['event'] == t_event\n if event['delivery_method'].to_i == 1\n if event['include_name'].to_i == 0\n client.room.say(event['pre_text'] + event['post_text'])\n else\n client.room.say(event['pre_text'] + user.name + event['post_text'])\n end\n else\n if event['include_name'].to_i == 0\n user.say(event['pre_text'] + event['post_text'])\n else\n user.say(event['pre_text'] + user.name + event['post_text'])\n end\n end\n end\n }\n end\nend",
"def reply(event)\n msg = event.message['text']\n mk_reply(msg)\nend",
"def run(plugin, args = @_args)\n plugin.call @_event, self.network, *args\n end",
"def dispatch(command, event)\n whole_command, first_word_command = dispatch_method_names(command)\n\n if respond_to?(whole_command)\n send(whole_command, event)\n elsif respond_to?(first_word_command)\n send(first_word_command, event, *command[1..-1])\n elsif event.message.author.id == USERS[:archenoth]\n admin_dispatch(command, event)\n end\n end",
"def handle(context)\n\n # Notify all connection listeners by calling their on_server_response method.\n notify(context) do |connection_listener|\n connection_listener.on_server_response(context, self)\n end\n \n end",
"def post( event )\n if @thread && @conditions[ event.event_class ]\n set_event_status(event, :pending )\n @event_queue.push event\n CFSM.logger.info \"Event #{event.inspect} posted to #{namespace}\"\n process_event if @thread==true\n end\n end",
"def dispatch\n self.class.dispatch_connection.call self\n self\n end",
"def handle_inbound(event_payload)\n head(:ok)\n end",
"def message(event)\n msg = JSON.parse(event.data, :symbolize_names => true) rescue {}\n seq = msg[:message_sequence]\n if msg[:ping] == 'PING'\n Firehose.logger.debug \"WS ping received, sending pong\"\n @ws.send JSON.generate :pong => 'PONG'\n elsif !@subscribed && seq.kind_of?(Integer)\n Firehose.logger.debug \"Subscribing at message_sequence #{seq}\"\n subscribe seq\n end\n end",
"def answer(evt , vote)\n puts \"Eviando dados ...\"\n payload = \"{\\\"ANS\\\":\\\"%s\\\",\\\"VOTE\\\":%d }\" % [evt,vote]\n puts \"PAYLOAD: \" + payload\n @carrier.send( payload )\n end",
"def handle(context)\n \n # Notify all connection listeners by calling their on_server_response method.\n super(context)\n \n # Notify all connection listeners by calling their on_notice method.\n notify(context) do |connection_listener| \n connection_listener.on_notice(context, context.lookup_user(nick), message)\n end\n\n end",
"def emit event, *args\n if @callbacks.key?(event)\n @callbacks[event].call(*args)\n end\n end",
"def issueEvent\n loop do\n event=@eventQueue.pop\n changed\n notify_observers(event[0],event[1],event[2],event[3])\n end\n end",
"def send_pusher_event\n pusher_client.trigger(\"auctions\", \"new_bid_in_room_#{self.room_id}\", self.to_json)\n end",
"def emit(event, data = nil)\n self.process_event(event, data)\n end",
"def buyEvent\n client.arecord_user_action_on_item('buy', getUser, getCart) \n end",
"def handle(event)\n return unless event.name == @subscribed_event_name\n @listener.call(*event.args)\n end",
"def events\n # ignore messages from bots!\n\n case params[:type]\n when 'url_verification'\n logger.info \"verifying url\"\n render json: { challenge: params[:challenge] }\n when 'event_callback'\n return unless event_params[:bot_id].nil?\n\n render json: nil\n ProcessSlackMessageJob.perform_later(event_params.as_json)\n\n else\n logger.info '*'*10\n logger.info \"Unknown event type: #{params[:type]}\"\n logger.info params.inspect\n end\n end",
"def event_handler(msg = {})\n event, element = msg[:event], msg[:element]\n @logger.info { \"[Domotics] event [#{event}] element [#{element}] state [#{element.state}]\" }\n Domotics::Core::WsServer.publish \"#{element.room.name}/#{element.name}\"\n end",
"def run!\n broadcast!\n super\n end",
"def call(message)\n if message.command == 'MESSAGE'\n handler.call(JSON.parse(message.body, symbolize_names: true))\n end\n rescue => e\n log.error(e.message) { \"\\n#{e.backtrace.inspect}\" }\n ensure\n ack(message)\n log.info('Processed') { %(#{message.headers['message-id']} from \"#{message.headers['destination']}\") }\n end",
"def dispatch_message(connection, context, options = {})\n message = build_message(connection, context)\n message = message.maybe_encrypt(connection, context)\n reply = connection.dispatch([ message ], context, options)\n [reply, connection.description, connection.global_id]\n end",
"def handle_update\n navdata = connection.receive_data\n publish(event_topic_name(\"update\"), navdata)\n end",
"def on(name, &block)\n define_sending_method(name)\n define_receiving_method(name, &block)\n end",
"def on_message(msg); @parent.on_message(@env, msg); end",
"def process\n send_request @action\n end",
"def dispatch(type, msg, bot)\n $log.debug \"Received a message of type #{type}\"\n\n type = type.to_s\n if(msg and msg.message =~ COMMAND_RX) then\n dispatch_command(msg, type, bot)\n else\n dispatch_hooks(msg, type, bot)\n end\n end"
] | [
"0.6827179",
"0.6827179",
"0.6307242",
"0.6190496",
"0.6117292",
"0.61035854",
"0.60860616",
"0.60807097",
"0.60442585",
"0.60355425",
"0.6023239",
"0.6005803",
"0.5994768",
"0.5989069",
"0.59779227",
"0.59429127",
"0.5922048",
"0.58963144",
"0.58795875",
"0.5819147",
"0.58066285",
"0.5800639",
"0.576778",
"0.57587624",
"0.5742461",
"0.5740247",
"0.5726223",
"0.57253414",
"0.5713625",
"0.5709867",
"0.57030797",
"0.56875944",
"0.5685424",
"0.56751496",
"0.56669635",
"0.56625795",
"0.56579614",
"0.56433755",
"0.5636154",
"0.56350076",
"0.56141764",
"0.56068045",
"0.5598275",
"0.5588051",
"0.55878645",
"0.5565995",
"0.55592924",
"0.55371046",
"0.55357045",
"0.5523248",
"0.55223197",
"0.55217427",
"0.55090827",
"0.5503413",
"0.5497762",
"0.5472854",
"0.54699546",
"0.54682213",
"0.5446729",
"0.5437268",
"0.53973484",
"0.5392886",
"0.5392032",
"0.5389984",
"0.5381759",
"0.5380217",
"0.5377664",
"0.5374594",
"0.5363884",
"0.53621155",
"0.53621155",
"0.5359695",
"0.53581506",
"0.5354865",
"0.5329589",
"0.53245807",
"0.53197384",
"0.5316458",
"0.5313434",
"0.531217",
"0.53075194",
"0.5300512",
"0.52804464",
"0.52798027",
"0.5273517",
"0.5272529",
"0.5267807",
"0.52676207",
"0.52654207",
"0.5263655",
"0.5263562",
"0.5252748",
"0.52423763",
"0.52329046",
"0.52284694",
"0.5227939",
"0.5224761",
"0.52058405",
"0.52057433",
"0.5200931",
"0.52008814"
] | 0.0 | -1 |
Raises a heartbeat event. Called by the gateway connection handler used internally. | def raise_heartbeat_event
raise_event(HeartbeatEvent.new(self))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def handle_heartbeat(_payload)\n send_packet(OPCODES[:HEARTBEAT], @session.seq)\n end",
"def handle_heartbeat_ack(_payload)\n @heartbeat_acked = true\n end",
"def poll_heartbeat_timeout\n now = Hastur::Util.timestamp\n delta = now - @last_heartbeat\n\n # perform heartbeat check\n if delta > @heartbeat\n @logger.debug \"Sending heartbeat\"\n\n msg = Hastur::Message::HB::Agent.new(\n :from => @uuid,\n :data => {\n :name => \"hastur.agent.heartbeat\",\n :value => delta,\n :timestamp => now,\n :labels => {\n :version => Hastur::SERVER_VERSION,\n :period => @heartbeat,\n }\n }\n )\n _send(msg)\n\n @last_heartbeat = now\n end\n end",
"def handle_heartbeat(packet)\n end",
"def heartbeat\n if check_heartbeat_acks\n unless @last_heartbeat_acked\n # We're in a bad situation - apparently the last heartbeat wasn't ACK'd, which means the connection is likely\n # a zombie. Reconnect\n LOGGER.warn('Last heartbeat was not acked, so this is a zombie connection! Reconnecting')\n\n # We can't send anything on zombie connections\n @pipe_broken = true\n reconnect\n return\n end\n\n @last_heartbeat_acked = false\n end\n\n send_heartbeat(@session ? @session.sequence : 0)\n end",
"def process_heartbeat(message)\n @reactor.log(:debug, \"#{@klass_name}, Worker [#{@service_name}] received HB from broker at [#{@hb_received_at}].\")\n end",
"def start_heartbeat\n @hb_received_at = Time.now\n send_heartbeat\n @heartbeat_timer = @reactor.periodical_timer(@heartbeat_interval) { send_heartbeat }\n end",
"def heartbeat\n end",
"def heartbeat\n request(Resources::RESOURCE_HEARTBEAT, HTTP_METHOD_POST)\n end",
"def heartbeat_command\n logger.debug(\"heartbeat_command: enter \")\n logger.debug(client.observers_overview.join(\", \"))\n begin\n client.refresh_observers_if_needed\n client.update_cluster if client.status == :down\n client.get(\"foo\")\n rescue Exception => e\n client.status = :down\n logger.debug \"heartbeat - #{e.message} #{e.backtrace}\"\n end\n sleep freq\n end",
"def set_heartbeat_timer(buffer)\n # Cancel @disconnect_timer.\n SockJS.debug \"Cancelling @disconnect_timer as we're about to send a heartbeat frame in 25s.\"\n @disconnect_timer.cancel if @disconnect_timer\n @disconnect_timer = nil\n\n @alive_checker.cancel if @alive_checker\n\n # Send heartbeat frame after 25s.\n @heartbeat_timer ||= EM::Timer.new(25) do\n # It's better as we know for sure that\n # clearing the buffer won't change it.\n SockJS.debug \"Sending heartbeat frame.\"\n begin\n self.finish\n rescue Exception => error\n # Nah these exceptions are OK ... let's figure out when they occur\n # and let's just not set the timer for such cases in the first place.\n SockJS.debug \"Exception when sending heartbeat frame: #{error.inspect}\"\n end\n end\n end",
"def subscribe_to_heartbeat\n @logger.trace \"setting up 'HEARTBEAT' subscriber\"\n subscribe(\"MOL.HEARTBEAT\") do |packet|\n node = @registry.safe_fetch_node(packet.sender)\n if node\n node.beat\n else\n # because the node is not registered with the broker, we have to assume that something broke down. we need to\n # force a publish to the node we just received the heartbeat from\n publish_discover_to_node_id(packet.sender)\n end\n end\n end",
"def setup_heartbeat_timer\n @heartbeat_timer ||= event_loop.timer(BEAT_INTERVAL) do\n event_loop.post { connections.each(&:beat) }\n end\n end",
"def beat\n Logger.trace \"beat heart #{Zensu.node.id} #{Time.now.to_i}\"\n remote_publish(\"zensu.heartbeat\", Zensu.node.id, Zensu.config.router_endpoint, Time.now.to_i.to_s)\n end",
"def send_heartbeat(sequence)\n send_packet(Opcodes::HEARTBEAT, sequence)\n end",
"def cancel_heartbeat(&blk)\n raise 'This API endpoint cannot be used over HTTP.' unless block_given?\n\n websocket.subscribe :cancelheartbeat, &blk\n end",
"def handle_hello(payload)\n LOGGER.info { 'Connected' }\n @heartbeat_interval = payload[:d][:heartbeat_interval] / 1000\n @heartbeat_thread = Thread.new { heartbeat_loop }\n if @session.seq\n send_resume\n else\n send_identify\n end\n end",
"def heartbeat_loop\n loop do\n send_heartbeat\n sleep @heartbeat_interval\n next if @heartbeat_acked\n\n LOGGER.error { 'Heartbeat was not acked, reconnecting.' }\n @websocket.close\n break\n end\n end",
"def enable_heartbeat(interval = 60, &blk)\n raise 'This API endpoint cannot be used over HTTP.' unless block_given?\n\n websocket.subscribe :setheartbeat, params: { interval: interval }, &blk\n end",
"def start_heartbeat\n\t\tself.log.info \"Starting heartbeat timer.\"\n\t\t@heartbeat_timer = self.reactor.add_periodic_timer( self.class.heartbeat_rate ) do\n\t\t\tself.cull_idle_sockets\n\t\t\tself.ping_all_sockets\n\t\tend\n\tend",
"def setup_heartbeat_timer; end",
"def heartbeat(dsaddr, rsrc_tag)\n\t\tdsaddr = MessagePack::RPC::Address.load(dsaddr)\n\t\t$log.TRACE \"RPC heartbeat dsaddr=#{dsaddr} rsrc_tag=#{rsrc_tag}\"\n\t\t$rs.mod_alive.heartbeat(rsrc_tag, dsaddr)\n\tend",
"def heartbeat\n me = WORKER_TEMPLATE.dup\n me['name'] = id\n @heartbeat_entry ||= write(me, @heartbeat_refresh + 10)\n @heartbeat_entry.renew(@heartbeat_refresh) unless @heartbeat_entry.canceled?\n end",
"def heartbeat_timeout; Float::INFINITY; end",
"def shutdown\n\t\tself.stop_heartbeat\n\t\tsuper\n\tend",
"def broker_check\n unless ((Time.now - @hb_received_at) * 1_000) <= (@heartbeat_interval * @heartbeat_retries)\n @reactor.log(:warn, \"#{@klass_name}, Worker [#{@service_name}] has expiring broker, last saw a heartbeat at [#{@hb_received_at}] and is now [#{Time.now}]\")\n reconnect_broker\n else\n @reactor.log(:info, \"#{@klass_name}, Worker [#{@service_name}] has healthy broker, last saw a heartbeat at [#{@hb_received_at}] and is now [#{Time.now}]\")\n end\n end",
"def restart\n\t\tself.stop_heartbeat\n\t\tsuper\n\t\tself.start_heartbeat\n\tend",
"def save_heartbeat\n timestamp = Time.now.to_i\n store.zadd(\"hb:#{@client.uid}\", timestamp, [Time.now.to_s(:db), @payload].to_json)\n end",
"def heartbeat_frame\n OnStomp::Components::Frame.new\n end",
"def start_heartbeat_if_needed\n logger.debug(\"start_heartbeat_if_needed - enter\")\n return if freq == 0\n return if @heartbeat_thread\n @heartbeat_thread = Thread.new do\n while true do\n heartbeat_command\n end\n end\n end",
"def heartbeat_timeout\n data.heartbeat_timeout\n end",
"def stop_heartbeat\n\t\tself.reactor.remove_timer( @heartbeat_timer )\n\tend",
"def beat\n Logger.trace \"beat heart #{Node.id} #{Time.now.to_i}\"\n notifier.async.publish(config.topic, Node.id, Router.endpoint, Time.now.to_i.to_s)\n end",
"def event_timer\n if @connection.comm.connected? and Time.now - @var[:last_ping] >= 60\n begin\n _server_control(\"keepalive\")\n rescue\n _notice(\"The connection to the server has been lost\", :global)\n @connection.disconnect\n end\n end\nend",
"def run\n unless @heartbeat_type == :none\n super\n end\n end",
"def send_worker_heartbeat(worker)\n @reactor.log(:debug, \"#{@klass_name}, Heartbeat for worker [#{worker.identity}] on thread [#{Thread.current['reactor-name']}]\")\n @router.write(worker.return_address + @heartbeat_msg_klass.new.to_msgs)\n end",
"def process_heartbeats(data, reply, subject)\n # No payload assumed, just reply to the heartbeat.\n nats.publish(reply, '')\n end",
"def send_keepalive\n# rt_debug \"* sending keepalive!\"\n queue_message(:keepalive)\n end",
"def heartbeat\n @publisher.broadcast(:heartbeat)\n @sessions.expire\n rescue => e\n log.error(\"Cluster session cleanup failed: #{e}\")\n end",
"def heartbeat(service_name, interval=60)\n\n # kill the existing thread\n unless @@heartbeats[service_name].nil?\n ServiceDiscovery.logger.debug 'killing an existing heartbeat thread'\n Thread.kill @@heartbeats[service_name]\n end\n\n # create a new thread that is going to run forever\n @@heartbeats[service_name] = Thread.new{\n while true\n # TODO: how to handle errors in the thread?\n ServiceDiscovery.logger.debug 'sending heartbeat'\n self.renew(service_name)\n sleep interval\n end\n }\n\n # # something happened?\n # true\n end",
"def unaway\n @socket << \"AWAY\"\n end",
"def add_heartbeat(event)\n Record.with(collection: \"#{self.class.name.demodulize.downcase}_heartbeat\") do |m|\n m.make!(event.merge(proprietor: { \"#{self.class.name.demodulize.downcase}_id\".to_sym => id }))\n end\n end",
"def on_hangup_signal( signo )\n\t\tself.log.warn \"Hangup (%p)\" % [ signo ]\n\t\tself.restart\n\tend",
"def handle_hangup\n system \"SIGHUP received, starting shutdown\"\n @shutdown = true\n end",
"def handle_connection_response(response)\n handle_response(response.body)\n light_sleep(self.class.poll_interval)\n end",
"def setup_heartbeat\n EM.add_periodic_timer(@options[:ping_time]) do\n @amq.fanout('heartbeat', :no_declare => @options[:secure]).publish(@serializer.dump(Ping.new(@identity, status_proc.call)))\n end\n true\n end",
"def hbsend_interval\n @connection.hbsend_interval\n end",
"def heartbeat(task_token, options={})\n alive_time = options[:alive_time] || @alive_time\n\n @backend.heartbeat(task_token, alive_time, options)\n end",
"def deadletter(exception)\n error \"Deadletter: #{payload}\"\n error exception.message\n main_exchange.nack(delivery_tag)\n end",
"def now(&callback)\n connection = nil\n connection = new_connection\n callback.call(connection)\n rescue\n @healthy = false\n raise\n ensure\n connection.disconnect! unless connection.nil?\n end",
"def client_disconnected\n end",
"def hangup cause=\"\", &block\n application \"hangup\", cause, &block\n end",
"def connection_completed\n ## start sending KEEP_ALIVE_MESSAGE\n puts 'sending keep_alive sending ...'\n EM::PeriodicTimer.new(KEEP_ALIVE_INTERVAL) { send_data KEEP_ALIVE_MESSAGE }\n end",
"def on_goaway *args\n on :goaway, *args\n close\n end",
"def heartbeat_frequency\n server.cluster.heartbeat_interval\n end",
"def connection_completed\n# @keepalive = EM::PeriodicTimer.new(60) { send_data ' ' }\n start\n end",
"def process_worker_heartbeat(message)\n worker_identity = message.envelope_identity\n if worker = @services.find_worker(worker_identity)\n worker.process_heartbeat(message)\n end\n end",
"def hbrecv_interval\n @connection.hbrecv_interval\n end",
"def send\n # discard if sampling rate says so\n if @libhoney.should_drop(self.sample_rate)\n @libhoney.send_dropped_response(self, \"event dropped due to sampling\")\n return\n end\n\n self.send_presampled()\n end",
"def alive\n @heartbeat = Heartbeat.create(heartbeats_params)\n if @heartbeat.valid?\n render json: {}, status: :created\n else\n render json: { error: 'failed to create heartbeat' }, status: :internal_server_error\n end\n end",
"def heartbeat_entry\n \"#{name} #{ip} #{Application.managed_services}\"\n end",
"def start_accepting_requests\n\t\tself.start_heartbeat\n\t\tsuper\n\tend",
"def on_helo_event(ctx, helo_data); end",
"def test_conn_1p_0070\n @conn.disconnect\n #\n cha = get_conn_headers() \n cha[\"heart-beat\"] = \"500,1000\" # Valid heart beat headers\n conn = nil\n assert_nothing_raised do\n conn = Stomp::Connection.open(user, passcode, host, port, false, 5, cha)\n conn.disconnect\n end\n assert conn.hbsend_interval > 0\n assert conn.hbrecv_interval > 0\n end",
"def away(m=nil)\n @socket << \"AWAY :#{m}\"\n end",
"def send_ack\n sock.put('+')\n vprint_status('Sending ack...')\n end",
"def send\n # discard if sampling rate says so\n if @libhoney.should_drop(sample_rate)\n @libhoney.send_dropped_response(self, 'event dropped due to sampling')\n return\n end\n\n send_presampled\n end",
"def update\n @heartbeat = Heartbeat.find(params[:id])\n\n if @heartbeat.update(heartbeat_params)\n head :no_content\n else\n render json: @heartbeat.errors, status: :unprocessable_entity\n end\n end",
"def on_helo_event(ctx, helo_data) end",
"def on_trap &block\n @socket.callbacks << block\n end",
"def call(env)\n # trace __FILE__, __LINE__, self, __method__, \"env=#{env}\"\n protocols = nil\n options = { ping: 5 } # keep socket alive : Chrome seems to time out in about 10?\n socket = Faye::WebSocket.new(env, protocols, options)\n connect!(socket)\n # trace __FILE__, __LINE__, self, __method__\n socket.rack_response\n end",
"def close(event)\n if event && !event.target.kind_of?(Faye::WebSocket::Client) then\n logger.debug { \"closed connection from #{event.target.env[\"REMOTE_ADDR\"]} (code=#{event.code}; reason=\\\"#{event.reason}\\\")\" }\n end\n if @connected then\n @connected = false\n @handler.new(nil).disconnect(self)\n end\n end",
"def call_get_heartbeat(os_conf_file_path, agent_install_conf_file_path)\n @@heartbeat_lib.get_heartbeat_data_item(Time.now, os_conf_file_path, agent_install_conf_file_path)\n end",
"def on_message(event)\n data = event.data\n\n response = data.match(/~m~\\d*~m~(.*)/)[1]\n message =\n case response\n when /no_session/\n {'command' => 'no_session'}\n when /~h~([0-9]+)/\n # Send the heartbeat command back to the server\n @socket.send($1)\n {'command' => 'heartbeat'}\n else\n JSON.parse(response)\n end\n message['command'] = 'response_received' if message['msgid']\n\n logger.debug \"Message received: #{message.inspect}\"\n dispatch(message)\n end",
"def test_conn_11h_0060\n @conn.disconnect\n #\n cha = get_conn_headers()\n cha[\"heart-beat\"] = \"a,10\" # Bad header Heartbeats\n conn = nil\n assert_raise Stomp::Error::InvalidHeartBeatHeaderError do\n conn = Stomp::Connection.open(user, passcode, host, port, false, 5, cha)\n end\n end",
"def wait_for_hangup(opts = {})\n receive_bye(opts)\n ack_bye(opts)\n end",
"def test_conn_1p_0050\n @conn.disconnect\n #\n cha = get_conn_headers() \n cha[\"heart-beat\"] = \"10,10,20\" # Bad header Heartbeats\n conn = nil\n assert_raise Stomp::Error::InvalidHeartBeatHeaderError do\n conn = Stomp::Connection.open(user, passcode, host, port, false, 5, cha)\n end\n end",
"def goaway!\n goaway block: true\n end",
"def on_connection_interruption(&block)\n self.redefine_callback(:after_connection_interruption, &block)\n end",
"def signal\r\n Ragweed::Wrap32::set_event(@h)\r\n end",
"def delete_heartbeat(id)\n Record.with(collection: \"#{self.class.name.demodulize.downcase}_heartbeat\") do |m|\n m.where(id: id).delete\n end\n end",
"def close(event)\n if @deferrable\n @deferrable.fail :disconnect\n @channel.unsubscribe(@deferrable) if @channel\n end\n Firehose.logger.debug \"WS connection `#{@req.path}` closing. Code: #{event.code.inspect}; Reason #{event.reason.inspect}\"\n end",
"def heartbeat_rate( new_rate=nil )\n\t\t\t@heartbeat_rate = new_rate.to_f if new_rate\n\t\t\treturn @heartbeat_rate\n\t\tend",
"def connection_ended\n end",
"def connection_ended\n end",
"def heartbeat\n not_found if be_attacking?\n \n @host.ip = request.remote_ip\n @host.updated_at = Time.now.to_time\n\n @ret = (@host.token == params[:token] && @host.save) ? @host.ip : 'false'\n end",
"def ping\n return true unless active && heartbeat_path.present?\n\n resp = http_get(uri: \"#{api_base_url}#{heartbeat_path}\")\n resp.present? && resp.code == 200\n end",
"def magic_ping(event); @socket.puts \"PONG :#{event.message}\"; end",
"def heartbeat\n until @stop\n @empty.each(&:wakeup)\n @full.each(&:wakeup)\n sleep 0.1\n end\n end",
"def event_epoch()\n # Flush out idle clients, if any\n @clients.each do |_,client|\n if Time.now - client.var[:last_ping] > 300\n client.socket.close\n client = @clients.delete(client.socket)\n dispatch :connection_reset, client, \"ping timeout\"\n end\n end\nend",
"def initialize\n super\n\n @destination = nil\n @summary = \"Mauve alert server heartbeat failed\"\n @detail = \"The Mauve server at #{Server.instance.hostname} has failed to send a heartbeat.\"\n @raise_after = 310\n @send_every = 60\n end",
"def ping\n return true unless active? && heartbeat_path.present?\n\n resp = http_get(uri: \"#{api_base_url}#{heartbeat_path}\")\n resp.present? && resp.code == 200\n end",
"def signal_server_down\n interrupt_server_polling_sleep\n nil\n end",
"def remote_keepalive(sender, body)\nend",
"def heartbeat(time)\n Thread.new do\n loop do\n puts \"[INFORMATIONAL: #{Time.now}]: Salus is running.\"\n sleep time\n end\n end\n end",
"def on_refresh(&block)\n @connection.on_refresh_cb = block\n end",
"def socket_disconnected\n end",
"def handle_close(request, event)\n SockJS.debug \"WebSocket#handle_close\"\n # SockJS.debug \"Closing WS connection.\"\n #\n # # If it's the user app who closed\n # # the response, we won't ever get\n # # to pass this point as we'll get\n # # SessionUnavailableError.\n # self.get_session(request.path_info)\n # rescue SockJS::SessionUnavailableError => error\n # # TODO: Set status is necessary(?)\n # # error.session\n end",
"def ack msgid\n send_frame \"ACK\", 'message-id'=> msgid\n end",
"def onping(&blk); super; end"
] | [
"0.7392785",
"0.6951944",
"0.6945434",
"0.6934182",
"0.6844225",
"0.67835087",
"0.6558897",
"0.6490727",
"0.6415971",
"0.62849027",
"0.625128",
"0.62399256",
"0.6195762",
"0.6161104",
"0.61512244",
"0.61342454",
"0.6120736",
"0.6112991",
"0.61104536",
"0.603179",
"0.5851655",
"0.5834784",
"0.5793474",
"0.5751952",
"0.57394415",
"0.5656609",
"0.562984",
"0.5601025",
"0.55595976",
"0.5557314",
"0.5540386",
"0.5526237",
"0.5526157",
"0.549335",
"0.5447576",
"0.5444357",
"0.54313064",
"0.5428997",
"0.5402379",
"0.53455",
"0.5329195",
"0.53264093",
"0.5314868",
"0.53138876",
"0.53119075",
"0.5310801",
"0.52999383",
"0.5296282",
"0.51702315",
"0.5160992",
"0.51555973",
"0.51512486",
"0.5136793",
"0.5135983",
"0.5131749",
"0.50552815",
"0.5052281",
"0.5033306",
"0.5014889",
"0.49970183",
"0.49788558",
"0.49763635",
"0.4973478",
"0.49622986",
"0.49620488",
"0.49582174",
"0.49508634",
"0.49495584",
"0.49452803",
"0.4934894",
"0.49346015",
"0.49345264",
"0.49337742",
"0.49167904",
"0.4911444",
"0.48817137",
"0.48635313",
"0.48575535",
"0.4843795",
"0.48291183",
"0.48265478",
"0.4809976",
"0.47888502",
"0.47809014",
"0.47809014",
"0.47694358",
"0.47608718",
"0.47492415",
"0.4736545",
"0.4730145",
"0.47300565",
"0.47222725",
"0.47040647",
"0.4687375",
"0.46853384",
"0.4680057",
"0.46714815",
"0.46689096",
"0.4668433",
"0.46650547"
] | 0.82131034 | 0 |
Makes the bot leave any groups with no recipients remaining | def prune_empty_groups
@channels.each_value do |channel|
channel.leave_group if channel.group? && channel.recipients.empty?
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def group_leave\n GroupMailer.group_leave\n end",
"def disown_all!\n self.groups.each do |group|\n self.disown!(group)\n end\n end",
"def leave(group)\n group_membership_ids.include? group.id\n groups.destroy(group)\n end",
"def delete_group_memberships_for_end_users\n self.group_memberships.delete_all if self.end_user?\n end",
"def empty_group\n self.group_memberships.each {|m| m.destroy}\n end",
"def remove_role_assignments_from_group_members_if_needed\n return unless entity.type == 'Group'\n\n Rails.logger.tagged \"RoleAssignment #{id}\" do\n entity.members.each do |m|\n logger.info \"Removing role (#{role.id}, #{role.token}, #{role.application.name}) about to be removed from group (#{entity.id}/#{entity.name} from its member #{m.id}/#{m.name})\"\n ra = RoleAssignment.find_by_role_id_and_entity_id_and_parent_id(role.id, m.id, self.id)\n if ra\n ra.destroy!\n else\n logger.warn \"Failed to remove role (#{role.id}, #{role.token}, #{role.application.name}) assigned to group member (#{m.id}/#{m.name}) which needs to be removed as the group (#{entity.id}/#{entity.name}) is losing that role.\"\n end\n end\n end\n end",
"def mentor_quit_group\n GroupquitMailer.mentor_quit_group\n end",
"def do_leave\n flash.keep\n user = if params[:user_id]\n User.find(params[:user_id])\n else\n current_user\n end\n group = Group.find_by(id: params[:id]) || not_found\n if user != current_user && !group.admin?(current_user)\n flash[:error] = 'You do not have permission to remove other users.'\n redirect_to(action: 'show', id: group.id) && return\n end\n group.leave_group(user)\n flash[:notice] = if user == current_user\n \"You have left #{group.group_name}\"\n else\n \"#{user.display_name} has been removed\"\n end\n if group.admin?(current_user)\n redirect_to(action: 'edit', id: group.id) && return\n else\n redirect_to(controller: 'groups', action: 'index') && return\n end\n end",
"def remove_from_all_groups\n self.group_memberships.each {|m| m.destroy}\n end",
"def leave\n @chat.members.delete(current_user)\n render json: { status: 'done' }, status: :ok\n ChatChannel.send_notification_to_chat(@chat.id, user_left_the_chat_msg)\n end",
"def dissolve_groups\n groups.destroy_all\n end",
"def receive_email\n \n \n #if one of the to addresses matches us, use that one. todo - correctly handle mulitple emails, or correctly fail\n if params[:to].match(/group\\+(\\d+)@/) && @group = Group.find($1)\n from = params[:from]\n body = params[:plain].gsub(/^On .* wrote:$\\s*(^>.*$\\s*)+/,'') #strip out replies and whatnot\n\n if @sender = @group.students.find_by_email(from)\n @group.send_message(@sender.name+\": \"+body,@sender,[@group.user])\n elsif @group.user.email==from\n @group.send_message(@group.user.display_name+\": \"+body,@group.user)\n end\n end\n render :text => 'success', :status => 200\n end",
"def prevent_zero_group_admins\n @membership = Membership.find(params[:id])\n @group = @membership.group\n if @group.has_one_admin? && (@membership.user == current_user)\n flash[:danger] = \"You cannot quit unless there are other group admins.\"\n redirect_to @group\n end\n end",
"def check_out_group(group)\n @guests_in_room.pop(group.length)\n\n return group\n end",
"def leave\n @group = Group.find_by(id: params[:id]) || not_found\n redirect_to(action: 'show', id: @group.id) && return \\\n if @group.admin?(current_user)\n end",
"def leave_group(group_or_id, send_message = false)\n Ecircle.client.\n unsubscribe_member_by_email(:groupId => Ecircle::User.group_id(group_or_id),\n :email => email,\n :sendMessage => send_message)\n end",
"def remove_role_assignments_from_group_members_if_needed\n if entity.type == 'Group'\n Rails.logger.tagged \"RoleAssignment #{id}\" do\n # Tell trigger_sync! to ignore any requests it receives - we'll just put in one\n # sync request after all the new RoleAssignments exist.\n Thread.current[:will_sync_role] = [] unless Thread.current[:will_sync_role]\n Thread.current[:will_sync_role] << role.id\n \n entity.members.each do |m|\n logger.info \"Removing role (#{role.id}, #{role.token}, #{role.application.name}) about to be removed from group (#{entity.id}/#{entity.name} from its member #{m.id}/#{m.name})\"\n ra = RoleAssignment.find_by_role_id_and_entity_id_and_parent_id(role.id, m.id, entity.id)\n if ra\n destroying_calculated_role_assignment do\n ra.destroy\n end\n else\n logger.warn \"Failed to remove role (#{role.id}, #{role.token}, #{role.application.name}) assigned to group member (#{m.id}/#{m.name}) which needs to be removed as the group (#{entity.id}/#{entity.name}) is losing that role.\"\n end\n end\n \n Thread.current[:will_sync_role].delete(role.id)\n role.trigger_sync!\n end\n end\n end",
"def leave_group(user = nil)\n membership = Membership.find_by user_id: user.id, group_id: id\n raise 'AdminUserCannotLeave' if membership.role == 'admin'\n\n Ticket.where(group_id: id, owner_id: user.id).delete_all\n Ticket.where(group_id: id, user_id: user.id).find_each(&:unassign)\n Membership.where(group_id: id, user_id: user.id).delete_all\n end",
"def leave\n @person = Person.find(params[:person_id])\n @group = Group.find(params[:id])\n @person.leave_group(@group.id, session[:cookie])\n group_title = @group.title(session[:cookie])\n if group_title == \"Not found!\"\n #This happens when the last user leaves a group and the group dies\n group_title = \"\"\n end\n flash[:notice] = [ :you_have_left_group, @group.title(session[:cookie]), group_path(@group) ]\n redirect_to groups_path\n end",
"def deny(reason)\n user = self.adult_sponsor\n if self.destroy && reason.is_a?(Hash)\n user.group = nil\n user.save\n GroupMailer.send_denied_notice(user, self, reason['email_text']).deliver\n true\n else\n false\n end\n end",
"def groups_leave(params = {})\n fail ArgumentError, \"Required arguments 'channel' missing\" if params['channel'].nil?\n response = @session.do_post \"#{SCOPE}.leave\", params\n Slack.parse_response(response)\n end",
"def group_recipients # :nodoc:\n @group_recipients ||= @address_nodes.select { |an| an.respond_to?(:group_name) }\n end",
"def leave\n @group_user = GroupUser.find(params[:id])\n @group_user.leave!\n respond_to do |format|\n flash[:notice] = 'Membership was cancelled.'\n format.html { redirect_to @group_user.group }\n format.xml { head :ok }\n end\n end",
"def any_recipients_left?\n return true if @counters[:recipients][:to] > 0\n return true if @counters[:recipients][:cc] > 0\n return true if @counters[:recipients][:bcc] > 0\n false\n end",
"def unfollowed\n FollowMailer.unfollowed\n end",
"def ListView_RemoveAllGroups(hwnd) send_listview_message(hwnd, :REMOVEALLGROUPS) end",
"def leave\n @guser= GroupUser.where(:group_id => params[:id], :user_id => current_user.id)\n @guser.destroy_all\n redirect_to(:controller => 'groups', :action => 'show', :id => params[:id])\n end",
"def remove\n recipient_list_members.destroy_all\n if message_recipients.count.zero?\n destroy\n else\n self.removed = true\n save!\n end\n end",
"def refuse_group group\n group_invitations.where(group: group).first.destroy\n end",
"def leave_group(group_id)\n\t\tGroupUser.destroy(user_id: user_id, group_id: group_id) unless Group.find(group_id).created_by == id\n\tend",
"def deliver_email\n#puts \"**** deliver_email: emails=#{emails}\"\n emails = @contact_info.map {|c| c[:email]}.compact.uniq\n self.subject ||= 'Message from SIM Nigeria'\n id_for_reply = self.following_up || id # a follow-up message uses id of the original msg\n#puts \"**** Messages#deliver_email response_time_limit=#{response_time_limit}\"\n outgoing = Notifier.send_group_message(:recipients=>emails, :content=>self.body, \n :subject => subject, :id => id_for_reply , :response_time_limit => response_time_limit, \n :bcc => true, :following_up => following_up) # send using bcc:, not to:\nraise \"send_email with nil email produced\" if outgoing.nil?\n outgoing.deliver\n # Mark all as being sent, but only if they have an email address\n # This is terribly inefficient ... need to find a way to use a single SQL statement\n sent_messages.each do |sm| \n sm.update_attributes(:msg_status => MsgSentToGateway) if sm.member.primary_email\n end\n end",
"def clear_emails\n ActionMailer::Base.deliveries = []\n end",
"def leave!\n leave(as: 'member')\n leave(as: 'guest')\n leave(as: 'power')\n\n remove_membership_associations\n end",
"def may_destroy_group_announcements?(group)\n\t\t\tmay_administrate? || is_group_moderator?(group)\n\t\tend",
"def other_participants(user)\n all = recipients\n all.delete(user)\n all.delete(nil) # nil will appear when any of the user in the coversation is deleted later.\n all\n end",
"def channel_leave(m, channel)\r\n if_admin(m) { @bot.part(channel, \"#{m.user.nick} requested I leave\") }\r\n end",
"def group\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end",
"def destroy\n redirect_to :action => :index and return unless is_owner?\n for member in @group.members\n member.destroy\n end\n @group.destroy\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n network_id = @membership.network_id\n from = current_user\n \n # a notification message will be delivered to the the requestor anyway;\n # it may contain a personal note, if any was supplied\n group = Network.find(network_id)\n invite = @membership.is_invite?\n rejection = (@membership.network_established_at.nil? || @membership.user_established_at.nil?) ? true : false\n\n personal_message = \"NONE\"\n if params[:reject_msg] && !params[:reject_msg].blank?\n personal_message = ae_some_html(params[:reject_msg])\n end\n \n # the same method ('destroy') works when membership is rejected\n # or removed after being accepted previously\n if rejection\n # if this is rejection, then just group admin can do this action, so\n # the message would go from group admin to the requesting-user\n if invite\n subject = \"Invitation to '\" + group.title + \"' rejected\"\n body = render_to_string :locals => { :from => from, :group => group, :msg => personal_message },\n :inline => <<EOM\n<%= name(from) %> has rejected an invitation to join <%= title(group) %> group.\n<br/>\n<br/>\n<strong><i>Personal message from <%= name(from) %> to user:</i></strong><hr/>\n<%= msg %>\n<hr/>\nEOM\n\n group.administrators(true).each {|to| \n send_action_message(from.id, to.id, subject, body)\n }\n else\n to_id = @membership.user_id\n\n subject = \"Membership to '\" + group.title + \"' rejected\"\n body = render_to_string :locals => { :from => from, :group => group, :msg => personal_message },\n :inline => <<EOM\n<%= name(from) %> has rejected your request to join <%= title(group) %> group.\n<br/>\n<br/>\n<strong><i>Personal message from <%= name(from) %> to user:</i></strong><hr/>\n<%= msg %>\n<hr/>\nEOM\n\n send_action_message(from.id, to_id, subject, body)\n\n subject = \"Membership to '\" + group.title + \"' rejected\"\n body = render_to_string :locals => { :from => from, :other => @membership.user_id, :group => group, :msg => personal_message },\n :inline => <<EOM\n<%= name(from) %> has rejected the request by <%= name(other) %> to join <%= title(group) %> group.\"\n<br/>\n<strong><i>Personal message from <%= name(from) %> to user:</i></strong><hr/>\n<%= msg %>\n<hr/>\nEOM\n\n group.administrators(true).select{|admin| admin.id != from.id}.each {|to|\n send_action_message(from.id, to.id, subject, body)\n }\n end\n \n else\n # membership was cancelled, so the message goes from the current user\n # (who can be either admin or a former group member) to the 'other side' of the membership;\n # NB! subject and body should change accordingly!\n \n if current_user.id == @membership.user_id\n subject = from.name + \" has left the '\" + group.title + \"' group\"\n body = render_to_string :locals => { :from => from, :group => group, :msg => personal_message },\n :inline => <<EOM\nUser <%= name(from) %> has left <%= title(group) %> group.\n<br/>\n<br/>\nIf you want to contact this user directly, just reply to this message.\nEOM\n\n group.administrators(true).each {|to| \n send_action_message(from.id, to.id, subject, body)\n }\n else \n subject = \"You have been removed from '\" + group.title + \"' group\"\n body = render_to_string :locals => { :from => from, :group => group, :msg => personal_message },\n :inline => <<EOM\n<%= name(from) %> has removed you from <%= title(group) %> group.\n<br/>\n<br/>\nIf you want to contact the administrator directly, just reply to this message.\nEOM\n\n send_action_message(from.id, @membership.user_id, subject, body)\n\n subject = \"User removed from '\" + group.title + \"' group\"\n body = render_to_string :locals => { :from => from, :other => @membership.user_id, :group => group, :msg => personal_message },\n :inline => \"<%= name(from) %> has removed <%= name(other) %> from <%= title(group) %> group.\"\n\n group.administrators(true).select{|admin| admin.id != current_user.id}.each {|to|\n send_action_message(from.id, to.id, subject, body)\n }\n end\n end\n \n @membership.destroy\n\n respond_to do |format|\n flash[:notice] = \"Membership successfully deleted\"\n format.html { redirect_to(params[:return_to] ? params[:return_to] : network_path(network_id)) }\n end\n end",
"def student_leave_grp(course, group)\n load_course_grps course\n logger.info \"Leaving group '#{group.title}'\"\n wait_for_update_and_click link_element(xpath: \"//a[contains(@aria-label,'Leave group #{group.title}')]\")\n list_item_element(xpath: '//li[contains(.,\"Left Group\")]').when_present Utils.short_wait\n end",
"def reply_to_all(delivery, reply_body, subject = nil)\n msg = delivery.message\n recipients = msg.recipients.clone()\n if(msg.sender != self)\n recipients.delete(self)\n if(!recipients.include?(msg.sender))\n recipients << msg.sender\n end\n end\n return reply(delivery.conversation, recipients, reply_body, subject)\n end",
"def send_to_admins\n @all_recipients = User.where(:receive_admin_email => true)\n raise NoRecipients if @all_recipients.blank?\n @all_recipients.group_by(&:language).each do |lang, users|\n @recipients = users\n mail_with_locale users, lang\n end\n end",
"def leave_joined_group\n @disc_group = DiscussionGroup.find(params[:id])\n @unjoin = DiscussionGroupUser.find(:last, :conditions =>[\"discussion_group_id=? AND user_id=? AND is_member=?\", @disc_group.id, @login_user.id, 1])\n if @unjoin.destroy\n respond_to do |format|\n format.js\n end\n else\n render :text=>\"Fail\"\n end\n end",
"def unsend!\n @_sended = false\n end",
"def disband_group\n destroy_collection({:table=>'groups', :on_success=>'You disbanded the group.'})\n rescue\n flash[:notice] = \"Could not find group.\"\n redirect_to :action=>'groups'\n end",
"def remove_group(group)\r\n\t\tsend('RMG', group.info[:guid])\r\n\t\t## XXX save changes locally?\r\n\t\treturn 1\r\n\tend",
"def remove_from_allowed_list(email)\n send_contact_command email, 'RML', '2'\n end",
"def update_groups\n unless group_ids.nil?\n self.groups_members.each do |m|\n m.destroy unless group_ids.include?(m.group_id.to_s)\n group_ids.delete(m.group_id.to_s)\n end\n group_ids.each do |g|\n self.groups_members.create(:group_id => g) unless g.blank?\n end\n reload\n self.group_ids = nil\n end\n end",
"def local_leave(body)\n room = body.dup\n room = @var[:room] unless room.length >= 1\n room_hash = MD5::digest(room)[0,8]\n room_hash = EMPTY_ROOM if room == 'chat'\n unless room == 'chat'\n @connection.room_names.delete(room_hash)\n @connection.room_ids.delete(room)\n end\n _server_control('leave', room_hash)\n local_switch('chat')\nend",
"def reject_invalid_messages(email_body, last_email_id)\n return true if email_body.id == last_email_id || email_body.label_ids.include?('CHAT')\n false\n end",
"def unsubscribe\n if (!GroupsController.group_owner? current_user.id, params[:id]) && (GroupsController.group_member? current_user.id, params[:id])\n set_group\n current_user.groups.delete(@group)\n respond_to do |format|\n format.html { redirect_to groups_path, alert: 'Unsubscribed successfully.' }\n format.json { head :no_content }\n end\n else\n respond_to do |format|\n format.html { redirect_to groups_path, alert: \"Not Unsubscribed. You are not a member of the group or you are the owner of the group\" }\n format.json { render json: \"Only members of a group can unsubscribe from the group. The group owner cannot subscribe from the group\", status: :method_not_allowed }\n end\n end\n end",
"def remove_from_friends_list(email)\n send_contact_command email, 'RML', '1'\n end",
"def group_absent(name, &block)\n execute(\"if dscl . -list /Groups/#{name}; then dscl . -delete /Groups/#{name}; fi\", {}, &block)\n end",
"def destroy_as_sender\n participants = Participant.for_message(self).uniq\n participants.each do |participant| \n Event.make(:event_type_name => EvType.find(2).name, :participant => participant, :message => self)\n end if ressource.events\n MembershipMessage.delete_relations(self)\n destroy_or_tag_as_removed\n end",
"def remove_from_general\n # Get general committees (may be more than one)\n general = Committee.where(\n committee_type_id: CommitteeType.general.id\n )\n\n # If this member is in the general members group (tested using set difference)\n if (general - self.committees).empty?\n general.each do |committee|\n self.committees.delete(general)\n end\n end\n end",
"def check_flood_limit(users)\n flood_limit = ConfigurationSetting.get_setting( 'PrivateMessageRecipientLimit' ).to_i\n @private_message.errors.add(\"recipients\", \" may have no more than \" + flood_limit.to_s + \" recipients on one message\" ) if users.size > flood_limit\n end",
"def do_reject\n InviteRequest.clear_pending_request_activities(self.user, self.wants_to_join)\n end",
"def reset_message\n @recipient_variables = {}\n @message.delete('recipient-variables')\n @message.delete(:to)\n @message.delete(:cc)\n @message.delete(:bcc)\n @counters[:recipients][:to] = 0\n @counters[:recipients][:cc] = 0\n @counters[:recipients][:bcc] = 0\n end",
"def receive_message\n params[:incoming_number] = $1 if params[:incoming_number]=~/^1(\\d{10})$/\n params[:origin_number] = $1 if params[:origin_number]=~/^1(\\d{10})$/\n @group=Group.find_by_phone_number(params[:incoming_number])\n \n if @group\n sent_by_admin=@group.user.phone_number==params[:origin_number]\n @sending_student = @group.students.find_by_phone_number(params[:origin_number])\n @sending_person = sent_by_admin ? @group.user : @sending_student\n \n #handle the #removeme command. it's a hard-coded single test for now. if we implement more commands, we should probably generalize this\n if params[:message].match(/^\\s*#remove[\\s_]*me/) && @sending_student.present?\n @group.send_message(\"You will no longer receive messages from #{@group.title}. Sorry to see you go!\",nil,[@sending_student])\n @sending_student.update_attribute(:phone_number,nil)\n elsif @sending_person\n message = (sent_by_admin ? @group.user.display_name : @sending_student.name)+\": \"+params[:message]\n @group.send_message(message,@sending_person, sent_by_admin ? @group.students : [@group.user]) #if a student sent it, just send it to teacher. if teacher sent it, push to group\n end\n end\n \n render :text=>\"sent\", :status=>202\n #needs to return something API-like, yo\n end",
"def groupChat _obj, _args\n \"_obj groupChat _args;\" \n end",
"def may_destroy_group?(group)\n\t\t\tmay_administrate?\n\t\tend",
"def destroy\n @group = Group.find(params[:id])\n users = @group.users \n users.each do |user|\n if user.groups.length == 1\n events = Event.where(:organizer => user.id)\n events.each do |event|\n event.destroy\n end\n user.destroy\n end\n end \n \n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url, notice: 'Group was successfully deleted' }\n format.json { head :no_content }\n end\n end",
"def configure_membership(*args)\n new_membership = [args[0]].flatten\n new_membership.each do |n_m|\n @membership << n_m unless @membership.include?(n_m)\n end\n @membership.each do |m|\n @comm.subscribe(m) do |stanza|\n if stanza.error?\n warn \"Group #{m} disappeared\"\n EM.next_tick do\n @membership.delete(m)\n end\n end\n end\n end\n @membership\n end",
"def mark_dead_group(stone)\n group = self.search(stone).first.group\n @dead_groups << group\n end",
"def remove_from_acl(group_ids)\n # filter out the owning user so never accidentally removed\n group_ids = filter_owner(group_ids)\n acl.remove_groups(group_ids)\n end",
"def send_message\n send unless SuppressionList.include?(receiver)\n end",
"def remove_agent_group_id(opts)\n opts = check_params(opts,[:group_id])\n super(opts)\n end",
"def destroy\n @group = Group.find(params[:group_id])\n @referred_user = User.find(params[:user_id])\n if @referred_user.is_admin?(@group)\n render_error(404, request.path, 20110, \"Admin cannot leave group.\") and return\n end\n # self or admin\n if current_user?(@referred_user) || @current_user.is_admin?(@group)\n @referred_user.is_member?(@group)\n if @referred_user.leave!(@group)\n render json: {result: 1}\n else\n render json: {result: 0}\n end\n else\n render_error(404, request.path, 20110, \"User is not group member.\")\n end\n end",
"def empty_mailing_lists\n\tbegin\n\t\tmailing_lists.each do |list_name|\n\t\t\tlist_id = Rails.configuration.mailing_lists[:mailchimp_list_ids][list_name.to_sym]\n\t\t\tr = Gibbon::Request.lists(list_id).members.retrieve params: {fields: 'members.email_address'}\n\t\t\tr['members'].try(:each) do |member|\n\t\t\t\temail = member['email_address']\n\t\t\t\tGibbon::Request.lists(list_id).members(email_md5_hash(email)).delete\n\t\t\tend\n\t\tend\n\trescue Gibbon::MailChimpError => e\n\t\tputs \"MailChimp error while deleting: #{e.title}; #{e.detail}; status: #{e.status_code}\"\n\tend\nend",
"def create\n\n @message = Message.new(message_params)\n @message.sender = current_user\n @message.recipients << current_user\n to = params[:to]\n if to.nil?\n group = Group.find_by(id: params[:group_id])\n @message.groups << group\n to = []\n unless group.nil?\n group.users.each do |user|\n to << user.username\n end\n end\n else\n to = to.split(/\\s*,\\s*/)\n end\n to.each do |user_str|\n user = User.find_by(username: user_str)\n if user.nil?\n user = User.find_by(email: user_str)\n end\n unless user.nil?\n unless @message.recipients.include?(user)\n @message.recipients << user\n end\n end\n end\n\n respond_to do |format|\n if @message.save\n if group.nil?\n format.html { redirect_to messages_url, notice: 'Message was successfully created.' }\n else\n format.html { redirect_to group, notice: 'Message was successfully created.' }\n end\n format.json { render :show, status: :created, location: @message }\n else\n format.html { redirect_to messages_url }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def unjoin(group)\n\t\t\treturn false unless group.is_a?(Group)\n\t\t\tgroup.remove(self)\n\t\tend",
"def admin_conversations_restrictAccess_removeGroup(options = {})\n raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil?\n raise ArgumentError, 'Required arguments :group_id missing' if options[:group_id].nil?\n raise ArgumentError, 'Required arguments :team_id missing' if options[:team_id].nil?\n post('admin.conversations.restrictAccess.removeGroup', options)\n end",
"def recipients(sender)\n participants.reject { |p| p.id == sender.id }\n end",
"def process_groups(gateway_name, phone, body)\n if !(from_user = is_sender_registered?(phone))\n return reply_to_sender_with_error(phone, REPLY_PHONE_NOT_REGISTERED)\n end\n groups = from_user.groups.collect { |g| g.name }.sort\n result = sprintf(REPLY_YOUR_GROUP_LIST, groups.length, groups.join(','))\n reply_to_sender(phone, result)\n return result, false\n end",
"def destroy_if_no_non_spam_email?\n mails.all? { |mail| mail.spam }\n end",
"def do_message\n group = Group.find(params[:id]) || not_found\n flash.keep\n if params[:message][:recipients].blank?\n flash[:error] = 'You must select at least one recipient.'\n redirect_to(action: 'message', id: group.id) && return\n end\n subject = params[:message][:subject]\n message = params[:message][:message]\n recipients = User.find(params[:message][:recipients])\n email = GroupNotifier.send_group_message(\n group, current_user, recipients, subject, message\n ).deliver_now\n flash.keep\n if email\n flash[:notice] = 'Message sent!'\n redirect_to(action: 'show', id: group.id) && return\n else\n flash[:error] = 'Message delivery failed.'\n redirect_to(action: 'message', id: group.id) && return\n end\n end",
"def delete\n @groups = CwaGroups.new\n\n if params[:user_name]\n if @groups.delete_from_my_group(params[:user_name], params[:group_name])\n CwaMailer.group_remove_member(User.find_by_login(params[:user_name]), params[:group_name]).deliver\n flash[:notice] = \"\\\"#{params[:user_name]}\\\" has been removed from \\\"#{params[:group_name]}\\\"\"\n else\n flash[:error] = \"There was a problem removing \\\"#{params[:user_name]}\\\" from \\\"#{params[:group_name]}\\\"\"\n end\n else\n if @groups.delete_me_from_group params[:group_name]\n flash[:notice] = \"You have been removed from group \\\"#{params[:group_name]}\\\"\"\n else\n flash[:error] = \"There was a problem removing you from group \\\"#{params[:group_name]}\\\"\"\n end\n end\n redirect_to :action => :show, :group_name => params[:group_name]\n end",
"def disable_group(group)\n @event_groups[group] = false\n end",
"def remove(response)\n return unless valid_message?(response)\n\n if Lita::Authorization.remove_user_from_group(\n response.user,\n @user,\n @group\n )\n response.reply \"#{@user.name} was removed from #{@group}.\"\n else\n response.reply \"#{@user.name} was not in #{@group}.\"\n end\n end",
"def send_mails_to_non_site_crowd_user(login_user, host_port)\n crowds = SharedTab.select('group_id').where([\"shareable_id=? AND shareable_type =?\", self.id, 'Discussion'])\n groups = crowds.present? ? Group.find(:all, :conditions=>[\"id in (?)\", crowds.map(&:group_id)]) : []\n for group in groups \n for group_user in group.group_users\n user = group_user.user\n Notifier.delay.mail_to_crowd_user(user.email,login_user.username, self, host_port)\n end\n for non_site in group.non_site_members\n Notifier.delay.mail_to_nsu_on_disc(non_site.email, login_user.username, host_port, self,non_site.id)\n end\n end if groups.present?\n end",
"def destroy_all\n @course.groups.each(&:destroy)\n @course.update(has_group: false, state: \"choose_algo\")\n respond_to do |format|\n format.html { redirect_to grouping_course_path(@course) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @group.destroy\n msg = [\"Destroyed group.\", rebuild_configs].join(\" \")\n redirect_to groups_url, notice: msg\n end",
"def destroy\n contact_group = ContactGroup.find(@share_invite.contact_group_id)\n #logger.debug \"Grabbed the contact group #{contact_group} with a list of users of #{contact_group.users}\"\n contact_group.users.delete(current_user)\n @share_invite.destroy\n respond_to do |format|\n format.html { redirect_to homes_url, notice: \"#{contact_group.group_name} has been removed from your Groups list\" }\n format.json { head :no_content }\n end\n end",
"def non_member_groups\n Group.joins(\"LEFT OUTER JOIN ( SELECT * FROM group_memberships WHERE person_id = #{self.id} ) AS gm ON groups.id = gm.group_id\").where('gm.person_id IS NULL').where('groups.active')\n end",
"def disown!(group)\n return if group.class != Group\n e = Entity.find_by(id: self.id)\n return if e.nil?\n relationship = EntityGroupRelationship.find_by(entity_id: self.id, group_id: group.id)\n return if relationship.nil?\n if relationship.position.nil?\n return relationship.destroy\n end\n index = relationship.position\n relationship.destroy\n # self.update_position(index)\n end",
"def delete_group\n @mailing_list_group.destroy if @ok\n render 'update_list'\n end",
"def unboarded_loans(loans)\n return unless Rails.env == 'production'\n to_email = 'MB Servicing <MBservicing@mbmortgage.com>'\n subject = (Rails.env == 'development') ? 'TESTING -- MBWEB/TSS: Boarded Loans Notification' : 'MBWEB/TSS: Boarded Loans Notification'\n @loan_count = loans.count\n return if @loan_count <= 0\n mail(:to => to_email, :subject => subject) do |format|\n format.text\n end\n end",
"def leave_conversation(_user_id)\n _updated_by = updated_by\n self.updated_by = nil\n conversation_members.where(user_id: _user_id).take.destroy!\n self.updated_by = _updated_by\n end",
"def server_leave(client, body)\n return nil unless @rooms[body]\n return nil unless @rooms[body].include?(client.name)\n select_send(MSG_SERVER, EMPTY_ROOM, @keyring.default.iv,\n server_encrypt(\"presence leave #{client.name}#{body}\")\n ) { |x| @rooms[body].include?(x.name) }\n @rooms[body].delete client.name\n if @rooms[body].empty?\n @rooms.delete body\n @motd.delete body\n end\nend",
"def remove_all_members_from_group(id, params = {})\n delete(\"/groups/#{id}/members\", params)\n end",
"def members_not_responding\n memb = sent_messages.map { |sm| (sm.msg_status || -1) < MessagesHelper::MsgDelivered ? sm.member : nil }.compact\n end",
"def want_to_leave!(team)\n self.teams.delete(team) if is_member_of?(team)\n end",
"def approver_group_notified\n return unless request.group_name\n\n send_event(EVENT_APPROVER_GROUP_NOTIFIED,\n :request_id => request.root.id,\n :group_name => request.group_name)\n end",
"def remove_user_from_group(user, group)\n\t\t\tend",
"def send_reminder_no_activity(options)\n mailer_content = options['mailer_content']\n MemberMailer.send_reminder_no_activity(mailer_content).deliver if mailer_content.present?\n end",
"def purge (group)\n ensure_group(group).purge\n end",
"def accept\n self.status = :accepted\n self.group.add_members(self.receiver, self.role, :was_invited, self.sender)\n self.save\n end",
"def modify_group\n group = Group.find_by_id params[:group_id]\n current_maillist = get_maillist_for_space(group.id)\n\n if params[:join_type]\n params[:join_level] = convert_join_type_to_join_level(params[:join_type])\n end\n\n if params[:leader_id] && params[:leader_id] != group.leader_id\n membership = group.group_memberships.where(user_id: params[:leader_id]).first\n return render :json => {}, :status => :bad_request unless membership\n params[:leader] = membership.user\n end\n\n if params[:maillist] != current_maillist\n render json: { valid_maillist: false }, status: :ok unless params[:maillist].empty? || maillist_is_valid?(params[:maillist])\n # params[:new_membership] = maillist_members(params[:maillist]).map { |member| Pseudonym.find_by_unique_id(member).user rescue nil}.compact\n params[:new_membership] = maillist_members(params[:maillist]).map do |member|\n pseudonym = Pseudonym.active.by_unique_id member\n pseudonym.first.user unless pseudonym.empty?\n end\n params[:new_membership].compact!\n params[:new_membership].uniq!\n end\n\n if authorized_action(group, @current_user, :update)\n respond_to do |format|\n group.transaction do\n group.update_attributes(params.permit(*SETTABLE_GROUP_ATTRIBUTES))\n if params.has_key?(:leader)\n group.leader = params[:leader]\n end\n if params.has_key?(:new_membership) && params[:new_membership].empty?\n group.group_memberships.where(\"user_id NOT IN (?)\", [group.leader]).destroy_all\n delete_maillist_for_space(group.id)\n end\n group.set_users(params[:new_membership]) if params.has_key?(:new_membership)\n set_maillist_for_space(group.id, params[:maillist]) unless params[:maillist].nil? || params[:maillist].empty?\n end\n\n if !group.errors.any?\n format.json { render :json => group_formatter(group, { include: ['users'] }), :status => :ok }\n else\n format.json { render :json => @group.errors, :status => :bad_request }\n end\n end\n end\n end",
"def join\n if request.post?\n if !@group.users.include?(current_user)\n @group.users << current_user\n flash[:success] = \"Thanks! Your membership must now be approved by an admin of #{@group.name}.\"\n\n #SEND OUT NOTIFICATION EMAILS\n @group.admins.each do |admin|\n Notifier.pending_user(admin, @group, current_user).deliver\n end\n\n redirect_to @group\n else\n flash[:error] = \"Error requesting to join #{@group.name}. Please try again.\"\n redirect_to @group\n end\n else #it fell back to GET (no js)\n flash[:error] = \"Please enable javascript to join.\"\n redirect_to @group\n end\n end",
"def message_to_group(message, group, member, sender)\n setup_email(message, group, member, sender)\n \n @subject += I18n.t 'mailer.group_notify.subject', :title=>group.title, :from=>sender.login \n #@subject += 'Message to group '+group.title+' from '+sender.login\n \n @body[:url] = \"http://www.dripplet.com/#{@locale}/groups/#{group.id}\"\n \n end"
] | [
"0.6297581",
"0.62445325",
"0.6044387",
"0.59665316",
"0.588507",
"0.58644235",
"0.5847096",
"0.58466744",
"0.583669",
"0.582041",
"0.58101285",
"0.5782278",
"0.5781081",
"0.5780202",
"0.5775733",
"0.57469773",
"0.57240504",
"0.5694992",
"0.5690972",
"0.5666579",
"0.5661589",
"0.5608448",
"0.56043583",
"0.5576668",
"0.5528484",
"0.5508288",
"0.5506927",
"0.54929984",
"0.54780734",
"0.54569316",
"0.54563695",
"0.54553175",
"0.54382366",
"0.54270303",
"0.54211056",
"0.54139596",
"0.5398448",
"0.5367621",
"0.5362156",
"0.53523135",
"0.5338997",
"0.5331254",
"0.53240156",
"0.53107536",
"0.5303117",
"0.5299762",
"0.528972",
"0.5289146",
"0.5287563",
"0.5286348",
"0.52862877",
"0.5272113",
"0.5260974",
"0.52590656",
"0.52586657",
"0.5247148",
"0.52397984",
"0.52335334",
"0.5232578",
"0.52298254",
"0.5226235",
"0.5219837",
"0.52183414",
"0.5214424",
"0.5203509",
"0.5199658",
"0.5195687",
"0.5184971",
"0.5183825",
"0.51836133",
"0.5178218",
"0.51744086",
"0.5172634",
"0.51663107",
"0.5158027",
"0.5156731",
"0.5154522",
"0.5154039",
"0.51532704",
"0.5151516",
"0.5150385",
"0.51339275",
"0.5130227",
"0.5123331",
"0.51191723",
"0.5103174",
"0.5102204",
"0.50925404",
"0.50847197",
"0.5084437",
"0.5083472",
"0.508185",
"0.5073423",
"0.50701094",
"0.50680894",
"0.5062491",
"0.5062486",
"0.50540906",
"0.50533706",
"0.504783"
] | 0.70148003 | 0 |
Get all application commands. | def get_application_commands(server_id: nil)
resp = if server_id
API::Application.get_guild_commands(@token, profile.id, server_id)
else
API::Application.get_global_commands(@token, profile.id)
end
JSON.parse(resp).map do |command_data|
ApplicationCommand.new(command_data, self, server_id)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def commands\n unless defined? @commands\n @commands = []\n end\n return @commands\n end",
"def all_commands\n [client_commands, server_commands].flatten\n end",
"def list_commands\n puts template(:all, {\n app: File.basename(@app),\n\n cmds: ::WeatherSage::CLI::Help::COMMANDS.values.map { |cmd|\n template(:cmd, cmd)\n }.join(\"\\n\"),\n\n envs: ::WeatherSage::CLI::Env::VARS.map { |row|\n template(:env, row)\n }.join(\"\\n\\n\"),\n })\n end",
"def commands\n COMMANDS\n end",
"def get_commands\n return nil\n end",
"def commands\n @commands ||= []\n end",
"def commands\n @commands ||= [].tap do |c|\n commands_list.each do |command|\n if command.instance_of? String\n c << standard_commands[command].new\n else\n ret_command = send(command)\n c << (ret_command.instance_of?(Hash) ? ret_command.values : ret_command)\n end\n end\n end.flatten\n end",
"def commands\n load_commands unless @commands\n @commands\n end",
"def commands\n self.class.command_classes\n end",
"def commands\n\t\tall = {\n\t\t\t\"webcam_list\" => \"List webcams\",\n\t\t\t\"webcam_snap\" => \"Take a snapshot from the specified webcam\",\n\t\t\t\"record_mic\" => \"Record audio from the default microphone for X seconds\"\n\t\t}\n\t\treqs = {\n\t\t\t\"webcam_list\" => [ \"webcam_list\" ],\n\t\t\t\"webcam_snap\" => [ \"webcam_start\", \"webcam_get_frame\", \"webcam_stop\" ],\n\t\t\t\"record_mic\" => [ \"webcam_record_audio\" ],\n\t\t}\n\n\t\tall.delete_if do |cmd, desc|\n\t\t\tdel = false\n\t\t\treqs[cmd].each do |req|\n\t\t\t\tnext if client.commands.include? req\n\t\t\t\tdel = true\n\t\t\t\tbreak\n\t\t\tend\n\n\t\t\tdel\n\t\tend\n\n\t\tall\n\tend",
"def find_all_commands (sCOMMAND)\n array = Array.new()\n @commands.each do |command|\n if (command.commandName == sCOMMAND)\n array.push(command)\n end\n end\n return array\n end",
"def commands\n @commands.keys.sort\n end",
"def index\n @commands = Command.all\n end",
"def index\n @commands = Command.all\n end",
"def invoke_all #:nodoc:\n self.class.all_commands.map { |_, command| invoke_command(command) }\n end",
"def supported_commands\n commands.keys\n end",
"def commands\n @@commands.dup\n end",
"def commands(params = {})\n res = @client.get(\"#{path}/commands\", params)\n\n res.json[\"commands\"].map { |atts| M2X::Client::Command.new(@client, atts) } if res.success?\n end",
"def commands\n self.class.commands\n end",
"def commands\n ensure_cache_up_to_date\n commands = self.redis.keys(\"bluster:objects:command:*\")\n commands.map! { |r| r.split(\":\")[3] }\n commands.uniq\n end",
"def commands\n return [] unless options[\"commands\"]\n options[\"commands\"].map do |options|\n options['parents'] = parents + [name]\n Command.new options\n end\n end",
"def commands\n {}\n end",
"def client_commands\n @client_commands ||= []\n end",
"def commands\n cmds = []\n command_groups = self.template.command_groups\n command_groups.each do |c|\n commands = c.command_group_commands\n commands.each do |cmd|\n cmds << OpenStruct.new( :cmd_id => cmd.id, :name => cmd.Description, :params => cmd.parameters )\n end\n end\n cmds\n end",
"def commands\n @commands ||=\n if superclass.respond_to? :commands\n superclass.commands.clone\n else\n {}\n end\n end",
"def commands\r\n @help_commands\r\n end",
"def commands\n @aliases\n end",
"def index\n @commands = Command.find(:all)\n display @commands\n end",
"def command_list\n collect_do - subcommand_list\n end",
"def commands_list\n out = \"\"\n # If there are no commands set\n if COMMANDS.empty?\n out << \" ooops! commands are not here!\"\n else\n # Get the longest command's name, so we can output it nice 'n' clean\n # This '+ int' at the end is a distance (in spaces) from the longest\n # command to descriptions\n longest = COMMANDS.max_by(&:size).size + 8\n COMMANDS.each do |cmd|\n # Calc, calc.\n spaces = longest - cmd.size\n # Check if there is a 'desc' method\n desc = if eval \"Command::#{cmd}.new.respond_to? 'desc'\"\n # If there is - execute it\n eval \"Command::#{cmd}.new.desc\"\n else\n # If there is not\n \"---\"\n end\n out << \" \" << cmd.downcase.to_s << \" \" * spaces << desc\n # If this command is the last one, don't make a new line\n unless cmd == COMMANDS.last\n out << \"\\n\"\n end\n end\n end\n out\n end",
"def command_list\n options[:commands] || SimpleFormWysihtml::WysihtmlInput.configuration.commands\n end",
"def commands\n args.commands.map do |cmd|\n if cmd.respond_to?(:join)\n cmd.map { |c| c.index(' ') ? \"'#{c}'\" : c }.join(' ')\n else\n cmd.to_s\n end\n end\n end",
"def command_names\n commands.map &:name\n end",
"def list_commands\n Invoker::ProcessPrinter.to_json(workers)\n end",
"def commands\n all = {\n 'clearev' => 'Clear the event log',\n 'drop_token' => 'Relinquishes any active impersonation token.',\n 'execute' => 'Execute a command',\n 'getpid' => 'Get the current process identifier',\n 'getprivs' => 'Attempt to enable all privileges available to the current process',\n 'getuid' => 'Get the user that the server is running as',\n 'getsid' => 'Get the SID of the user that the server is running as',\n 'getenv' => 'Get one or more environment variable values',\n 'kill' => 'Terminate a process',\n 'pkill' => 'Terminate processes by name',\n 'pgrep' => 'Filter processes by name',\n 'ps' => 'List running processes',\n 'reboot' => 'Reboots the remote computer',\n 'reg' => 'Modify and interact with the remote registry',\n 'rev2self' => 'Calls RevertToSelf() on the remote machine',\n 'shell' => 'Drop into a system command shell',\n 'shutdown' => 'Shuts down the remote computer',\n 'steal_token' => 'Attempts to steal an impersonation token from the target process',\n 'suspend' => 'Suspends or resumes a list of processes',\n 'sysinfo' => 'Gets information about the remote system, such as OS',\n 'localtime' => 'Displays the target system local date and time',\n }\n reqs = {\n 'clearev' => [\n COMMAND_ID_STDAPI_SYS_EVENTLOG_OPEN,\n COMMAND_ID_STDAPI_SYS_EVENTLOG_CLEAR\n ],\n 'drop_token' => [COMMAND_ID_STDAPI_SYS_CONFIG_DROP_TOKEN],\n 'execute' => [COMMAND_ID_STDAPI_SYS_PROCESS_EXECUTE],\n 'getpid' => [COMMAND_ID_STDAPI_SYS_PROCESS_GETPID],\n 'getprivs' => [COMMAND_ID_STDAPI_SYS_CONFIG_GETPRIVS],\n 'getuid' => [COMMAND_ID_STDAPI_SYS_CONFIG_GETUID],\n 'getsid' => [COMMAND_ID_STDAPI_SYS_CONFIG_GETSID],\n 'getenv' => [COMMAND_ID_STDAPI_SYS_CONFIG_GETENV],\n 'kill' => [COMMAND_ID_STDAPI_SYS_PROCESS_KILL],\n 'pkill' => [\n COMMAND_ID_STDAPI_SYS_PROCESS_KILL,\n COMMAND_ID_STDAPI_SYS_PROCESS_GET_PROCESSES\n ],\n 'pgrep' => [COMMAND_ID_STDAPI_SYS_PROCESS_GET_PROCESSES],\n 'ps' => [COMMAND_ID_STDAPI_SYS_PROCESS_GET_PROCESSES],\n 'reboot' => [COMMAND_ID_STDAPI_SYS_POWER_EXITWINDOWS],\n 'reg'\t => [\n COMMAND_ID_STDAPI_REGISTRY_LOAD_KEY,\n COMMAND_ID_STDAPI_REGISTRY_UNLOAD_KEY,\n COMMAND_ID_STDAPI_REGISTRY_OPEN_KEY,\n COMMAND_ID_STDAPI_REGISTRY_OPEN_REMOTE_KEY,\n COMMAND_ID_STDAPI_REGISTRY_CREATE_KEY,\n COMMAND_ID_STDAPI_REGISTRY_DELETE_KEY,\n COMMAND_ID_STDAPI_REGISTRY_CLOSE_KEY,\n COMMAND_ID_STDAPI_REGISTRY_ENUM_KEY,\n COMMAND_ID_STDAPI_REGISTRY_SET_VALUE,\n COMMAND_ID_STDAPI_REGISTRY_QUERY_VALUE,\n COMMAND_ID_STDAPI_REGISTRY_DELETE_VALUE,\n COMMAND_ID_STDAPI_REGISTRY_QUERY_CLASS,\n COMMAND_ID_STDAPI_REGISTRY_ENUM_VALUE,\n ],\n 'rev2self' => [COMMAND_ID_STDAPI_SYS_CONFIG_REV2SELF],\n 'shell' => [COMMAND_ID_STDAPI_SYS_PROCESS_EXECUTE],\n 'shutdown' => [COMMAND_ID_STDAPI_SYS_POWER_EXITWINDOWS],\n 'steal_token' => [COMMAND_ID_STDAPI_SYS_CONFIG_STEAL_TOKEN],\n 'suspend' => [COMMAND_ID_STDAPI_SYS_PROCESS_ATTACH],\n 'sysinfo' => [COMMAND_ID_STDAPI_SYS_CONFIG_SYSINFO],\n 'localtime' => [COMMAND_ID_STDAPI_SYS_CONFIG_LOCALTIME],\n }\n filter_commands(all, reqs)\n end",
"def subcommands\n Properties[self.class] ||= {}\n return Properties[self.class][:subcmds] || []\n end",
"def command_list\n options[:commands] || SimpleFormEpicEditor::EpicEditorInput.configuration.commands\n end",
"def get_commands(module_id)\n Db.transaction { Db[:modules][module_id][:commands] }.map do |cmd_id|\n Db.transaction { Db[:commands][cmd_id] }\n end\n end",
"def commands\n help_list = {}\n @commands.map do |cmd|\n info = Commands.const_get(\"#{cmd}\".capitalize!).info #=> {cmd => \"Description\"}\n help_list[info.keys.first] = info.values.first\n end\n\n return help_list\n end",
"def server_commands\n @server_commands ||= []\n end",
"def commands\n @commands.reject { |_, v| v.is_a? CommandLion::Option }\n end",
"def get_commands\n %w{ testchoosedir testchoosefile testnumberedmenu testdisplay_list testdisplay_text testdir }\n end",
"def cmd_cmds\n puts self.methods.grep(/^cmd_/).map {|m| m[4..-1]} * \" \"\n end",
"def index\n @command_items = CommandItem.all\n end",
"def commands\n\t\t{\n\t\t\t\"execute\" => \"Execute a command\",\n\t\t\t\"shell\" => \"Drop into a system command shell\",\n\t\t}\n\tend",
"def command_list m\n get_list escape m.channel.to_s #logic/pug\n end",
"def select_all_command_modules\n @body = command_modules2json(BeEF::Modules.get_enabled.keys)\n end",
"def subcommands\n @subcommands ||= []\n end",
"def subcommands\n @subcommands ||= []\n end",
"def available_subcommands\n self.class.available_subcommands\n end",
"def available_subcommands\n self.class.available_subcommands\n end",
"def commands(*args, &block)\n boot.commands(*args, &block)\n end",
"def ostack_bootstrap (commands)\n self.ostack_connect\n commands = (commands.is_a?(Array)) ? commands : [ commands ]\n output = Array.new\n\n commands.each do |command|\n output << self.run(command)\n end\n\n return output\n end",
"def load_commands\n Dir[\"#{Scarlet.root}/commands/**/*.rb\"].each {|path| load path and Command.parse_help path}\n end",
"def commands\n raise NotImplementedError, \"`command' is not implemented by #{self.class.name}\"\n end",
"def commands\n {\n 'help' => 'Help menu',\n 'background' => 'Backgrounds the current shell session',\n 'sessions' => 'Quickly switch to another session',\n 'resource' => 'Run a meta commands script stored in a local file',\n 'shell' => 'Spawn an interactive shell (*NIX Only)',\n 'download' => 'Download files (*NIX Only)',\n 'upload' => 'Upload files (*NIX Only)',\n 'source' => 'Run a shell script on remote machine (*NIX Only)',\n 'irb' => 'Open an interactive Ruby shell on the current session',\n 'pry' => 'Open the Pry debugger on the current session'\n }\n end",
"def index\n @controlcommands = Controlcommand.all\n end",
"def undocumented_commands\n command_list - documented_commands\n end",
"def commands(aspect=:default)\n (@commands ||= begin\n @to = :default\n Hash.new { |h, k| h[k] = Array.new }\n end)[aspect]\n end",
"def index\n @commands = Command.order(created_at: :desc).page(params[:page])\n end",
"def applications\n Application.from session.get 'operations/application', API_V1\n end",
"def docker_commands\n []\n end",
"def load_commands\n @commands = Debugger::Command.available_commands.map do |cmd_class|\n cmd_class.new\n end\n @commands.sort!\n end",
"def commands\n\t\t{\n\t\t\t\"?\" => \"Help menu\",\n\t\t\t\"background\" => \"Backgrounds the current session\",\n\t\t\t\"close\" => \"Closes a channel\",\n\t\t\t\"channel\" => \"Displays information about active channels\",\n\t\t\t\"exit\" => \"Terminate the meterpreter session\",\n\t\t\t\"help\" => \"Help menu\",\n\t\t\t\"interact\" => \"Interacts with a channel\",\n\t\t\t\"irb\" => \"Drop into irb scripting mode\",\n\t\t\t\"migrate\" => \"Migrate the server to another process\",\n\t\t\t\"use\" => \"Load a one or more meterpreter extensions\",\n\t\t\t\"quit\" => \"Terminate the meterpreter session\",\n\t\t\t\"read\" => \"Reads data from a channel\",\n\t\t\t\"run\" => \"Executes a meterpreter script\",\n\t\t\t\"bgrun\" => \"Executes a meterpreter script as a background thread\",\n\t\t\t\"bgkill\" => \"Kills a background meterpreter script\",\n\t\t\t\"bglist\" => \"Lists running background scripts\",\n\t\t\t\"write\" => \"Writes data to a channel\",\n\t\t}\n\tend",
"def deep_commands\n result = []\n commands.each do |command|\n result << command\n if command.commands.any?\n result += command.deep_commands\n end\n end\n result\n end",
"def available_commands(options)\n commands = %w[/start /checkin /checkout]\n response_to_user(options, commands.to_s)\n end",
"def all\n request_model = @request_model_factory.all_apps_request_model\n response = @network_client.perform_request(request_model)\n JSON.parse(response.body).map do |app_hash|\n Fabricio::Model::App.new(app_hash)\n end\n end",
"def make_command_list\n add_command(Vocab::SKILLS, :skills, main_commands_enabled)\n add_command(Vocab::CAPACITIES, :capacities, main_commands_enabled)\n add_command(Vocab::EQUIP, :equip, main_commands_enabled)\n add_command(Vocab::LEARNING, :learning, main_commands_enabled)\n add_command(Vocab::LIBRAIRIES, :librairies, main_commands_enabled)\n add_command(Vocab::ITEM, :item, main_commands_enabled)\n add_command(Vocab::CRAFTING, :crafting, main_commands_enabled)\n add_command(Vocab::STRATEGY, :strategy, main_commands_enabled)\n add_command(Vocab::COOKING, :cooking, main_commands_enabled)\n add_command(Vocab::SYSTEM, :system, main_commands_enabled)\n end",
"def get_events\n ConsoleDisplay.events_to_command\n end",
"def get_commands\n %w{ testchoose testnumberedmenu testdisplay_list testdisplay_text testdir saveas1 }\n end",
"def index\n @commands = Command.all\n render :json => @commands\n end",
"def battle_commands\n @battle_commands ||= []\n @battle_commands\n end",
"def list\n $stdout.puts \"The following POW applications are available:\\n\\n\"\n Dir[\"#{POWPATH}/*\"].each do |a|\n if File.symlink?(a)\n $stdout.puts \" #{File.basename(a)} -> #{File.readlink(a)}\"\n else\n port = File.open(a) { |f| f.readline.to_i }\n info = _extract_forward_info(port)\n $stdout.puts \" #{File.basename(a)} -> forwarding to :#{port} for\" +\n \" #{info.fetch(:command, 'Unknown')}[#{info.fetch(:pid, '???')}]\"\n end\n end\n $stdout.puts \"\\nRun `powify open [APP_NAME]` to browse an app\"\n end",
"def commands\n\t\t\t{\n\t\t\t\t\"wmap_website\" => \"List website structure\",\n\t\t\t\t\"wmap_targets\" => \"Targets in the database\",\n\t\t\t\t\"wmap_sql\" => \"Query the database\",\n\t\t\t\t\"wmap_run\" => \"Automatically test/exploit everything\",\n\t\t\t\t\"wmap_proxy\" => \"Run mitm proxy\",\n\t\t\t\t\"wmap_crawl\" => \"Crawl website\",\n\t\t\t\t\"wmap_attack\" => \"Crawl and Test\",\n\t\t\t}\n\t\tend",
"def commands\n c = {\n \"?\" => \"Help menu\",\n \"background\" => \"Backgrounds the current session\",\n \"exit\" => \"Terminate the hardware bridge session\",\n \"help\" => \"Help menu\",\n \"irb\" => \"Drop into irb scripting mode\",\n \"load\" => \"Load one or more meterpreter extensions\",\n \"run\" => \"Executes a meterpreter script or Post module\",\n \"bgrun\" => \"Executes a meterpreter script as a background thread\",\n \"bgkill\" => \"Kills a background meterpreter script\",\n \"bglist\" => \"Lists running background scripts\",\n \"sessions\" => \"Quickly switch to another session\",\n \"status\" => \"Fetch bridge status information\",\n \"specialty\" => \"Hardware devices specialty\",\n \"reset\" => \"Resets the device (NOTE: on some devices this is a FULL FACTORY RESET)\",\n \"reboot\" => \"Reboots the device (usually only supported by stand-alone devices)\",\n \"load_custom_methods\" => \"Loads custom HW commands if any\"\n }\n\n if msf_loaded?\n c[\"info\"] = \"Displays information about a Post module\"\n end\n\n c\n end",
"def valid_commands\n methods.grep(/_command$/).map {|c| c.to_s.gsub(\"_command\", \"\")}\n end",
"def valid_commands\n methods.grep(/_command$/).map {|c| c.to_s.gsub(\"_command\", \"\")}\n end",
"def commands\n @commands ||= source.checkout(revision, configuration[:deploy_release])\n end",
"def commands\n\t\t{ }\n\tend",
"def commands_command(stem, sender, reply_to, msg)\n commands = self.class.instance_methods.select { |m| m =~ /^\\w+_command$/ }\n commands.map! { |m| m.to_s.match(/^(\\w+)_command$/)[1] }\n commands.reject! { |m| UNADVERTISED_COMMANDS.include? m }\n return if commands.empty?\n commands.map! { |c| \"#{options[:command_prefix]}#{c}\" }\n \"Commands for #{leaf_name}: #{commands.sort.join(', ')}\"\n end",
"def commands\n abstract!\n end",
"def cmds(*commands, **opts)\n commands.flatten.map { |command| [command, cmd(command, **opts)] }\n end",
"def list\n @redis.hgetall(STORE_KEY).sort.map do |name, command|\n AliasedCommand.new(name, command)\n end\n end",
"def get_applications\n http_get_request(Scalarium.applications_url)\n end",
"def commands\n\t\t{\n\t\t\t\"idletime\" => \"Returns the number of seconds the remote user has been idle\",\n\t\t\t\"uictl\" => \"Control some of the user interface components\",\n\t\t\t\"enumdesktops\" => \"List all accessible desktops and window stations\",\n\t\t\t\"getdesktop\" => \"Get the current meterpreter desktop\",\n\t\t\t\"setdesktop\" => \"Change the meterpreters current desktop\",\n\t\t\t\"keyscan_start\" => \"Start capturing keystrokes\",\n\t\t\t\"keyscan_stop\" => \"Stop capturing keystrokes\",\n\t\t\t\"keyscan_dump\" => \"Dump the keystroke buffer\",\n\t\t\t\"screenshot\" => \"Grab a screenshot of the interactive desktop\",\n\n\t\t\t# not working yet\n\t\t\t# \"unlockdesktop\" => \"Unlock or lock the workstation (must be inside winlogon.exe)\",\n\t\t}\n\tend",
"def get_commands(pattern)\n commands = []\n Dir.chdir(@dev.log_dir) do\n Dir.glob(\"*#{pattern.gsub(\"/\", \"-\")}*.*\").each do |logfile|\n commands << Command.new(JSON.parse(IO.read(logfile)))\n end\n end\n commands\n end",
"def requestCommands\n # Request input in a loop until QUIT is read\n quit = false\n until quit do\n input = @view.captureInput\n # Check if input is QUIT\n quit = input =~ /^#{Command::Q}$/i\n unless quit\n processCommand(input)\n end\n end\n end",
"def cmds(pool)\n cmds = \"\"\n pool.keys.each do |cmd|\n unless cmds == \"\"\n cmds += ', ' + cmd.to_s \n else\n cmds += cmd.to_s \n end\n end\n cmds += \" and quit!\" if pool == @cli_cmds\n result = \" > Available commands: \" + cmds\n end",
"def get_loaded_extension_commands(extension_name)\n request = Packet.create_request(COMMAND_ID_CORE_ENUMEXTCMD)\n\n start = Rex::Post::Meterpreter::ExtensionMapper.get_extension_id(extension_name)\n request.add_tlv(TLV_TYPE_UINT, start)\n request.add_tlv(TLV_TYPE_LENGTH, COMMAND_ID_RANGE)\n\n begin\n response = self.client.send_packet_wait_response(request, self.client.response_timeout)\n rescue\n # In the case where orphaned shells call back with OLD copies of the meterpreter\n # binaries, we end up with a case where this fails. So here we just return the\n # empty list of supported commands.\n return []\n end\n\n # No response?\n if response.nil?\n raise RuntimeError, 'No response was received to the core_enumextcmd request.', caller\n elsif response.result != 0\n # This case happens when the target doesn't support the core_enumextcmd message.\n # If this is the case, then we just want to ignore the error and return an empty\n # list. This will force the caller to load any required modules.\n return []\n end\n\n commands = []\n response.each(TLV_TYPE_UINT) { |c|\n commands << c.value\n }\n\n commands\n end",
"def commands\n\t\t{\n\t\t\t\"idletime\" => \"Returns the number of seconds the remote user has been idle\",\n\t\t\t\"uictl\" => \"Control some of the user interface components\",\n\t\t\t\"enumdesktops\" => \"List all accessible desktops and window stations\",\n\t\t\t\"setdesktop\" => \"Move to a different workstation and desktop\",\n\t\t\t\"keyscan_start\" => \"Start capturing keystrokes\",\n\t\t\t\"keyscan_stop\" => \"Stop capturing keystrokes\",\n\t\t\t\"keyscan_dump\" => \"Dump they keystroke buffer\",\n\t\t\t\n\t\t\t# no longer needed with setdesktop\n\t\t\t# \"grabinputdesktop\" => \"Take over the active input desktop\",\n\t\t\t\n\t\t\t# not working yet\n\t\t\t# \"unlockdesktop\" => \"Unlock or lock the workstation (must be inside winlogon.exe)\",\n\t\t}\n\tend",
"def api_v11_cm_commands_get(opts = {})\n api_v11_cm_commands_get_with_http_info(opts)\n return nil\n end",
"def list\n ridley.environment.all\n end",
"def battle_commands\n @battle_commands ||= []\n end",
"def app_list\n host_os_family.app_list( self )\n end",
"def all_apps\n json = ENV[\"OOD_APPS\"] || File.read(ENV[\"OOD_CONFIG\"] || File.expand_path(\"../config.json\", __FILE__))\n JSON.parse(json).map { |app| App.new(app.to_h) }\nend",
"def commands\n {\n \"power_shell\" => \"Execute a powershell command.\",\n \"power_view\" => \"Download and execute Veil's PowerView Framework\",\n \"power_up\" => \"Download and execute the PowerUp Framework\",\n \"power_katz\" => \"Invoke-Mimikatz into memory using PowerShell\",\n \"power_scan\" => \"Invoke-PortScan from meterpreter using PowerShell\"\n }\n end",
"def commands; end",
"def command_namespace\n self.class.const_get(:Commands)\n end",
"def list_commands(character, input=nil)\n \t\tcommands = COMMANDS.keys\n \t\t\n\t\tprint_line commands.join(?\\s)\n\t\tprint_line\n\tend",
"def commands\n\n {\n 'TODO' => \"This one shout take its sub commands from current(headers/body) variables and the key value should be the command description\n This one should depend on current context\"\n }\n\n end"
] | [
"0.7503003",
"0.74731416",
"0.7411596",
"0.72424257",
"0.7220817",
"0.7174554",
"0.7140143",
"0.700237",
"0.6978414",
"0.6858803",
"0.67535424",
"0.6730534",
"0.67279255",
"0.67279255",
"0.67157304",
"0.6712434",
"0.66891",
"0.66485935",
"0.66239893",
"0.66227156",
"0.66107565",
"0.65229934",
"0.64398646",
"0.64392716",
"0.6427454",
"0.64115226",
"0.637621",
"0.6372368",
"0.6367666",
"0.6363394",
"0.6362824",
"0.6294098",
"0.6270791",
"0.62621653",
"0.62614185",
"0.6254175",
"0.6235798",
"0.6233247",
"0.6219455",
"0.6212079",
"0.62003845",
"0.6185882",
"0.6180976",
"0.6165632",
"0.61654955",
"0.61333305",
"0.6117884",
"0.6109031",
"0.6109031",
"0.61059004",
"0.61059004",
"0.61047935",
"0.6093119",
"0.6088316",
"0.6083936",
"0.6078045",
"0.60488844",
"0.6010083",
"0.60018116",
"0.6000852",
"0.5988402",
"0.59800684",
"0.59602356",
"0.5954929",
"0.59426934",
"0.58989537",
"0.58706665",
"0.58652955",
"0.58463967",
"0.5843267",
"0.58338004",
"0.5818766",
"0.58186686",
"0.58182895",
"0.5817193",
"0.58159196",
"0.58159196",
"0.5815293",
"0.58096135",
"0.5805579",
"0.5798748",
"0.57973295",
"0.57922745",
"0.57782316",
"0.5770792",
"0.5756698",
"0.5745871",
"0.57439804",
"0.57433313",
"0.5724202",
"0.57239795",
"0.57172376",
"0.57057154",
"0.57036954",
"0.56999135",
"0.5698355",
"0.56982315",
"0.56959844",
"0.5688025",
"0.567752"
] | 0.7699006 | 0 |
Get an application command by ID. | def get_application_command(command_id, server_id: nil)
resp = if server_id
API::Application.get_guild_command(@token, profile.id, server_id, command_id)
else
API::Application.get_global_command(@token, profile.id, command_id)
end
ApplicationCommand.new(JSON.parse(resp), self, server_id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def command(id)\n res = @client.get(\"#{path}/commands/#{id}\")\n\n M2X::Client::Command.new(@client, res.json) if res.success?\n end",
"def app_by_id(id)\n get(\"/apps/#{id}\")\n end",
"def command(name)\n commands.find { |command| command.name == name.to_s }\n end",
"def get id\n apps.select do |app|\n app.id == id\n end.first\n end",
"def get_custom_command_by_item_entry_id(item_entry_id)\n command = USER_CUSTOM_COMMANDS[item_entry_id: item_entry_id]\n return nil if command == nil\n\n # create custom command\n return CustomCommand.new(command)\n end",
"def get_command_id()\n @query['command_id'] || nil\n end",
"def get_application_commands(server_id: nil)\n resp = if server_id\n API::Application.get_guild_commands(@token, profile.id, server_id)\n else\n API::Application.get_global_commands(@token, profile.id)\n end\n\n JSON.parse(resp).map do |command_data|\n ApplicationCommand.new(command_data, self, server_id)\n end\n end",
"def command(name)\n return @commands[name]\n end",
"def get_command(name)\n @commands.select {|c| c.invokers.include? name}.compact[0]\n end",
"def get(id)\n response = Network.get(['Applications', id])\n Application.new(response)\n end",
"def command command_string\n connection.command self.id, nil, command_string\n end",
"def command(name)\n commands[name]\n end",
"def command(name)\n commands[name]\n end",
"def command(name)\n commands[name]\n end",
"def program(id)\n get(\"/catalog/titles/programs/#{id.to_s}\")\n end",
"def getCommand()\n raise \"Missing implementation of 'getCommand'\"\n end",
"def command; datastore['COMMAND']; end",
"def set_command\n @command = Command.find_by(id: params[:id])\n end",
"def find_command( name )\n commands.each { |cmd| return cmd if cmd.name == name }\n nil\n end",
"def get(id = nil)\n super.extend(CmdDic)\n end",
"def set_command\n @command = Command.find(params[:id])\n end",
"def set_command\n @command = Command.find(params[:id])\n end",
"def set_command\n @command = Command.find(params[:id])\n end",
"def set_command\n @command = Command.find(params[:id])\n end",
"def set_command\n @command = Command.find(params[:id])\n end",
"def set_command\n @command = Command.find(params[:id])\n end",
"def get_command( cmd_name )\n begin\n # 1. Try all normal commands\n Bgo::Application::Command.load_single(cmd_name)\n\n rescue Bgo::Application::CommandNotFoundError => e\n if ! @plugins_loaded\n # 2. Load plugins & retry (allows plugins to define commands)\n load_plugins\n get_command cmd_name\n\n else\n # Error: Command really not found!\n puts \"Command '#{cmd_name}' not found: #{e}. Try `#{$0} help`.\"\n nil\n end\n end\n end",
"def fetch_app_by_id(id)\n page = request(app_url,{:id => id})\n raise StoreRequestError unless page.code == \"200\"\n plist = Plist::parse_xml(page.body)\n return nil if plist[\"status-code\"]\n app = App.new(plist[\"item-metadata\"])\n end",
"def command name\n @commands[name]\n end",
"def api_v11_commands_command_id_get(command_id, opts = {})\n api_v11_commands_command_id_get_with_http_info(command_id, opts)\n return nil\n end",
"def command\n @command ||= command_for(:query)\n end",
"def command\n @command ||= command_for(:query)\n end",
"def find_command(pk_hash)\n pk_hash.is_a?(Hash) or\n raise MessageViolatesConsistencyChecks, _(\"command ID is %{pk}, when Hash was expected\") % {pk: pk_hash.nil? ? 'nil' : pk_hash.class.name}\n pk_hash.empty? and\n raise MessageViolatesConsistencyChecks, _(\"command ID must be a nonempty Hash but is an empty Hash\")\n command = Razor::Data::Command[pk_hash]\n command.nil? and\n raise MessageViolatesConsistencyChecks, _(\"Unable to find Razor::Data::Command with pk %{pk}\") % {pk: pk_hash.inspect}\n return command\n end",
"def app(id_or_name_or_package_id)\n all_available_apps.find do |app|\n [app.name, app.id, app.package_id].include?(id_or_name_or_package_id)\n end\n end",
"def replace_command(command)\n return @apps[command] if @apps.has_key?(command)\n return command\n end",
"def command\n console.gets.chomp\n end",
"def fetch_app_by_id(id, store='143441')\n page = request(app_url,{:id => id}, store)\n raise StoreRequestError unless page.code == \"200\"\n plist = Plist::parse_xml(page.body)\n return nil if plist[\"status-code\"]\n app = App.new(plist[\"item-metadata\"])\n end",
"def get(id)\n Conversation.from_id(@client, id)\n end",
"def command(name)\n load_commands.select { |lc| lc.type == name.to_sym }\n end",
"def api_v11_commands_command_id_get_with_http_info(command_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DefaultApi#api_v11_commands_command_id_get ...\"\n end\n \n # verify the required parameter 'command_id' is set\n fail \"Missing the required parameter 'command_id' when calling api_v11_commands_command_id_get\" if command_id.nil?\n \n # resource path\n path = \"/api/v11/commands/{commandId}\".sub('{format}','json').sub('{' + 'commandId' + '}', command_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = []\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = []\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#api_v11_commands_command_id_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def command\n @command ||= Class.new.send(:include, Command)\n end",
"def get(id)\n data = @app.client.input id\n Clarinet::Input.new @app, data[:input]\n end",
"def delete_application_command(command_id, server_id: nil)\n if server_id\n API::Application.delete_guild_command(@token, profile.id, server_id, command_id)\n else\n API::Application.delete_global_command(@token, profile.id, command_id)\n end\n end",
"def [](cmd_val)\n k = Argument.to_key(cmd_val)\n @commands[k]\n end",
"def command\n attributes.fetch(:command)\n end",
"def command\n attributes.fetch(:command)\n end",
"def command(key)\n keys = configuration.instance.keys\n cmd = eval \"#{keys}.#{key}\"\n cmd.capitalize! << \"Command\"\n case cmd\n when /QuitCommand/\n QuitCommand.new(@terminal)\n else\n NoOpCommand.new\n end\n end",
"def command\n @attributes['command']\n end",
"def find( name )\n @commands.find { |klass| klass.command_name == name }\n end",
"def find_command(commandline)\n aruba.command_monitor.find(commandline)\n end",
"def get_action(action_id, options={})\n return send_message(SkyDB::Message::GetAction.new(action_id, options))\n end",
"def adb_cmd(command)\n begin\n IO.popen(command) { |f| f.read }\n rescue Exception => e\n puts \"Tried to send command: #{command} but got an exception:\\n#{e}, Backtrace #{e.backtrace}\"\n end\n end",
"def command\n return @raw_command\n end",
"def get_command(command)\n ensure_cache_up_to_date\n namespace = \"bluster:objects:command:#{command}\"\n keys = self.redis.keys(\"#{namespace}:*\")\n data = {}\n keys.each { |key|\n short_key = key.split(\":\")[4]\n data[short_key] = self.redis.get(\"#{namespace}:#{short_key}\")\n }\n data\n end",
"def command!(name)\n found = command(name)\n\n if found.nil?\n raise CommandNotFound.new(name, self)\n end\n\n found\n end",
"def find(id)\n where({'id' => \"#{id}\"}).first\n end",
"def command(id)\n stack(id)\n end",
"def get_command(command_name, props = { :boolean => false })\n if props[:boolean]\n return true if AcnhBot::Commands.respond_to?(command_name)\n return false unless AcnhBot::Commands.respond_to?(command_name)\n elsif AcnhBot::Commands.respond_to?(command_name)\n AcnhBot::Commands.method(command_name).call\n end\n end",
"def get_atom(id)\n @hive_party.get(\"/atoms/#{id}\") \n end",
"def delete\n @bot.delete_application_command(@id, server_id: @server_id)\n end",
"def command_name_to_command(name, command_zone = nil)\n if command_zone.nil?\n\n @zones.each do |zone|\n @commands[zone].each_pair do |command, attrs|\n return command if attrs[:name] == name\n end\n end\n nil\n\n else\n\n @commands[command_zone].each_pair do |command, attrs|\n return command if attrs[:name] == name\n end\n nil\n\n end\n end",
"def get(id)\n Basuco::Resource.get(id)\n end",
"def alias2cmd(cmd_alias)\n Commands::CMDS.find { |_, v| v[:alias] == cmd_alias }.first\n end",
"def get_key_from_command(argv)\n case argv[0].to_s.downcase\n when \"info\",\"multi\",\"exec\",\"slaveof\",\"config\",\"shutdown\",\"select\"\n nil\n else\n # Unknown commands, and all the commands having the key\n # as first argument are handled here:\n # set, get, ...\n argv[1]\n end\n end",
"def get_key_from_command(argv)\n case argv[0].to_s.downcase\n when \"info\",\"multi\",\"exec\",\"slaveof\",\"config\",\"shutdown\"\n return nil\n when \"bitop\"\n return argv[2]\n else\n # Unknown commands, and all the commands having the key\n # as first argument are handled here:\n # set, get, ...\n return argv[1]\n end\n end",
"def get_key_from_command(argv)\n case argv[0].to_s.downcase\n when \"info\",\"multi\",\"exec\",\"slaveof\",\"config\",\"shutdown\"\n return nil\n when \"bitop\"\n return argv[2]\n else\n # Unknown commands, and all the commands having the key\n # as first argument are handled here:\n # set, get, ...\n return argv[1]\n end\n end",
"def get_custom_command(command_name, owner_user_id)\n command = USER_CUSTOM_COMMANDS[command_name: command_name, owner_user_id: owner_user_id]\n return nil if command == nil\n\n # create custom command\n return CustomCommand.new(command)\n end",
"def get_commands(module_id)\n Db.transaction { Db[:modules][module_id][:commands] }.map do |cmd_id|\n Db.transaction { Db[:commands][cmd_id] }\n end\n end",
"def id\n return @args[:id]\n end",
"def get(id)\n server.get(\"#{name}/#{CGI.escape(id)}\")\n end",
"def retrieve_command_name(args) #:nodoc:\n meth = args.first.to_s unless args.empty?\n args.shift if meth && (map[meth] || meth !~ /^\\-/)\n end",
"def read_command\n return nil unless @ui_mode == ConsoleMode::Command\n char = getch\n if char && char[0].ord > 30 # received a non-control character\n # convert the char to the Command\n logger.debug { \"console: received command key #{char}\" }\n cmd = Command.from_key(char)\n if !cmd.nil? && @current_commands.include?(cmd)\n @ui_mode = ConsoleMode::None\n logger.debug { \"console: command received was #{cmd}\" }\n cmd\n else\n logger.debug { 'console: command received was not valid' }\n nil\n end\n end\n end",
"def find(id:)\n client.execute(method: :get, path: \"/manifest/#{id}.m3u8\")\n end",
"def show\n @command = Command.accessible_by(current_ability).find(params[:id])\n\n respond_to do |format|\n format.html\n format.xml { render :xml => @command }\n end\n end",
"def select_command\n \n # get params\n command_id = @params['command_id'] || nil\n (print_error \"Command id is nil\";return) if command_id.nil?\n command = BeEF::Core::Models::Command.first(:id => command_id.to_i) || nil\n (print_error \"Command is nil\";return) if command.nil?\n\n command_module = BeEF::Core::Models::CommandModule.get(command.command_module_id)\n (print_error \"command_module is nil\";return) if command_module.nil?\n\n if(command_module.path.split('/').first.match(/^Dynamic/))\n dyn_mod_name = command_module.path.split('/').last\n e = BeEF::Modules::Commands.const_get(dyn_mod_name.capitalize).new\n else\n command_module_name = command_module.name\n e = BeEF::Core::Command.const_get(command_module_name.capitalize).new(command_module_name)\n end\n \n @body = {\n 'success' => 'true', \n 'command_module_name' => command_module_name,\n 'command_module_id' => command_module.id,\n 'data' => BeEF::Module.get_options(command_module_name),\n 'definition' => JSON.parse(e.to_json)\n }.to_json\n\n end",
"def cmd_from_pid(pid)\n\tcmd = File.open(\"/proc/#{pid}/cmdline\") { |i| i.read }.split(/\\0/)\nend",
"def get(id)\n klass.find(:first, params: { klass.primary_key => wrap_key(id) })\n end",
"def set_command_item\n @command_item = CommandItem.find(params[:id])\n end",
"def find_by_id(id)\n hash = Backlogjp.base._command \"getProject\", id\n\n Project.new(hash) unless hash.empty?\n end",
"def get_vapp(id)\n fog_service_interface.get_vapp(id)\n end",
"def get(id)\n self.class.get(\"/paste/#{id}\").parsed_response\n end",
"def delete(id)\n response = Network.delete(['Applications', id])\n Application.new(response)\n end",
"def command\n\n h.fields['__command__']\n end",
"def get(id)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'id', id)\n\t\t\tclient.queue_service_action_call('apptoken', 'get', 'KalturaAppToken', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend",
"def read_parameter_from_device(id)\n execute_command(\"F21 P#{id}\", false, false)\n end",
"def search_for_command(command)\n @command_map[ command ]\n end",
"def command\n if args.skip?\n ''\n else\n commands.join('; ')\n end\n end",
"def cmd(command, *arguments) Command.send(command.to_sym, *arguments) end",
"def getCommand\n\t\tmkWins if ! defined?(@apListBox)\n\t\tupdateCommandRow \"Commands==> (I)nfo (C)lients (Q)uit exec-(l)ocal exec-(r)emote (B)uild-config\"\n\t\trefreshAps;\n\t\tfinished=false; processed=false\n\t\twhile (true)\n\t\t\trefreshAps;\n\t\t\tbreak if finished\n\t\t\tprocessed=false\n\t\t\t#updateStatusRow(@active.key)\n\t\t\tc=@active.getch\n\t\t\tc,processed,finished=global_hook_keypressed(c) if defined?(global_hook_keypressed)\n\t\t\tbreak if finished\n\t\t\tnext if processed\n\t\t\tprocessed=navigate(@active,c)\n\t\t\tnext if processed\n\t\t\tcase c\n\t\t\twhen ?\\C-L # ^L\n\t\t\t\trefreshUI; next\n\t\t\twhen ?q, ?Q\n\t\t\t\tfinished=true; next\n\t\t\tend\n\t\t\tif (@active==@apListBox)\n\t\t\t\t# Directory\n\t\t\t\tcase c\n\t\t\t\twhen 9 # TAB\n\t\t\t\t\tnext if @entryListBox.items.length==0\n\t\t\t\t\tselectListBox(@entryListBox)\n\t\t\t\twhen ?i, ?I\n\t\t\t\t\tshowAPInfo; \n\t\t\t\twhen ?l\n\t\t\t\t\texecute_local\n\t\t\t\twhen ?L\n\t\t\t\t\texecute_local_all\n\t\t\t\twhen ?r \n\t\t\t\t\texecute_remote\n\t\t\t\twhen ?R \n\t\t\t\t\texecute_remote_all\n\t\t\t\twhen ?e\n\t\t\t\t\t@apListBox.value.enable( !@apListBox.value.enabled? );\n\t\t\t\t\t#puts \"Enabled: #{@apListBox.value.enabled?}\"\n\t\t\t\twhen ?b, ?B\n\t\t\t\t\tbuild_config_tgz\n\t\t\t\t\trefreshAps\n\t\t\t\twhen KEY_ENTER, 13 # Enter\n\t\t\t\t\tdebug(\"Enter. Selected==#{@apListBox.selected}\")\n\t\t\t\tend\n\t\t\t\trefreshUI\n\t\t\telse (@active==@entryListBox)\n\t\t\t\tcase c\n\t\t\t\twhen 9 # TAB \n\t\t\t\t\tnext if @apListBox.items.length==0\n\t\t\t\t\tselectListBox(@apListBox)\n\t\t\t\twhen KEY_ENTER, 13 # Enter\n\t\t\t\t\tdebug(\"Enter. Selected==#{@apListBox.selected}\")\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\tNcurses.endwin\n\t\texit(0)\n\tend",
"def add_command(id, &command)\n\t\tif @config['Commands'].nil? || @config['Commands'][id].nil?\n\t\t\tputs \"Plugin Manager: No command '#{id}' defined for #{@config['General']['Title']}\"\n\t\t\treturn nil\n\t\tend\n\t\tcmd = @config['Commands'][id]\n\t\t@procs[id] = UI::Command.new(cmd['Label'], &command)\n\t\t# Tooltips\n\t\t@procs[id].tooltip = cmd['Label']\n\t\t@procs[id].status_bar_text = cmd['Description'] if cmd.key?('Description')\n\t\t# Add Icons\n\t\ticon_path = @config['General']['ConfigPath'] + @config['General']['IconPath']\n\t\t@procs[id].small_icon = icon_path + cmd['SmallIcon'] if cmd.key?('SmallIcon')\n\t\t@procs[id].large_icon = icon_path + cmd['LargeIcon'] if cmd.key?('LargeIcon')\n\t\t#puts \"> Command '#{id}' registered!\"\n\t\treturn @procs[id]\n\tend",
"def command\n # We could use the second return from reader.command to skip an\n # unknown message, but BAPS is quite dodgy at implementing this in\n # places, so we don't do it in practice.\n @reader.command do |code|\n parse_command(CommandWord.new(code))\n word\n end\n end",
"def read(id)\n perform(:get, \"#{@resource_type}/#{id}\")\n end",
"def get(command, options)\n @client.get(command, options)\n end",
"def get id\n doc = database.get id\n new(doc)\n end",
"def by_id(id)\n @client.request(:get, \"/system/inputs/#{id}\")\n end",
"def extractCommandID(msgID)\n retVal = \"000\"\n\n # Check if the ID is a hexadecimal number\n if msgID =~ /(0x)?[0-9a-fA-F]+/\n # Convert the message ID from a string to a value\n val = msgID.to_i(16)\n\n # Strip off all but the last 12 bits and convert the value to a\n # hexadecimal string\n retVal = \"%03x\" % (val & 0x7ff)\n end\n\n return \"0x\" + retVal\nend",
"def get_device_code(id:)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::GET,\n '/v2/devices/codes/{id}',\n 'default')\n .template_param(new_parameter(id, key: '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",
"def command_for(name, *args)\n command_str_for(*(COMMANDS[name] + args))\n end",
"def to_command(symbol)\n command_class_name = symbol.to_s.path_to_name.tr(' ', '')\n Kernel.const_get(\"#{command_class_name}Command\")\n end",
"def command\n case first\n when '\\?' then Command::HelpCommand\n when '\\config' then Command::PrintConfigCommand\n else\n puts \"Unknown command: #{buffer}\"\n end\n end"
] | [
"0.73590213",
"0.64247155",
"0.6362859",
"0.6346973",
"0.6345813",
"0.6258138",
"0.6243382",
"0.62079227",
"0.6093267",
"0.5981358",
"0.59109575",
"0.58858705",
"0.58858705",
"0.58858705",
"0.58473945",
"0.58238953",
"0.58137655",
"0.5751888",
"0.575023",
"0.574087",
"0.57311946",
"0.57311946",
"0.57311946",
"0.57286525",
"0.57286525",
"0.5710936",
"0.5676556",
"0.5655984",
"0.5627437",
"0.56254184",
"0.5608629",
"0.5579249",
"0.556333",
"0.54787314",
"0.54495275",
"0.5434819",
"0.5424537",
"0.5411129",
"0.539245",
"0.53717315",
"0.53705156",
"0.53653514",
"0.5350276",
"0.53369457",
"0.53369105",
"0.53369105",
"0.53128636",
"0.531069",
"0.5305751",
"0.5289494",
"0.52840865",
"0.52813965",
"0.5250532",
"0.5246036",
"0.52243364",
"0.5224128",
"0.51940525",
"0.5192993",
"0.51881695",
"0.51836514",
"0.51815236",
"0.5175382",
"0.5161247",
"0.5159194",
"0.5157844",
"0.5150874",
"0.51397586",
"0.5137916",
"0.51226157",
"0.5118358",
"0.51115155",
"0.51097715",
"0.50836617",
"0.5074064",
"0.50655293",
"0.50621665",
"0.5061151",
"0.5060964",
"0.50551397",
"0.50505227",
"0.5046159",
"0.5044348",
"0.5039336",
"0.50308895",
"0.5026162",
"0.5017667",
"0.5010915",
"0.50076616",
"0.5003453",
"0.5001168",
"0.4994581",
"0.49940494",
"0.49911612",
"0.4970958",
"0.49606723",
"0.4955095",
"0.49487105",
"0.4948265",
"0.4943238",
"0.4939668"
] | 0.76984763 | 0 |
Remove an application command from the commands registered with discord. | def delete_application_command(command_id, server_id: nil)
if server_id
API::Application.delete_guild_command(@token, profile.id, server_id, command_id)
else
API::Application.delete_global_command(@token, profile.id, command_id)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete\n @bot.delete_application_command(@id, server_id: @server_id)\n end",
"def remove_command\n return if !has_manage_messages_permission?\n command.event.message.delete\n end",
"def unregister_commands\n Bot::Commands.delete_for self\n end",
"def remove_command(name)\n @commands ||= {}\n @commands.delete name\n end",
"def remove\n return unless confirm_command\n\n args.each do |name|\n messages = nil\n if name.start_with? \"HEROKU_POSTGRESQL_\"\n name = name.chomp(\"_URL\").freeze\n end\n action(\"Removing #{name} on #{app}\") do\n messages = addon_run { heroku.uninstall_addon(app, name, :confirm => app) }\n end\n display(messages[:attachment]) if messages[:attachment]\n display(messages[:message]) if messages[:message]\n end\n end",
"def remove\n args.each do |name|\n messages = nil\n action(\"Removing #{name} from #{app}\") do\n messages = addon_run { heroku.uninstall_addon(app, name, :confirm => options[:confirm]) }\n end\n output messages[:attachment] if messages[:attachment]\n output messages[:message]\n end\n end",
"def remove_command(command, resize=true)\n @commands.delete(command)\n @item_max = @commands.size\n refresh_command(resize)\n end",
"def remove_battle_command(command)\n index = has_battle_command(command)\n battle_commands.delete_at(index) if index\n end",
"def remove_battle_command(command)\n index = has_battle_command_by_object(command)\n if (index >= 0)\n @battle_commands.delete_at(index)\n end\n end",
"def remove_battle_command(command)\n battle_commands.delete_if { |cmd| cmd.name.casecmp?(command.to_s) }\n end",
"def destroy\n @command.destroy\n end",
"def remove_custom_command(command_name, owner_user_id)\n commands = USER_CUSTOM_COMMANDS.where{Sequel.&({command_name: command_name}, {owner_user_id: owner_user_id})}\n return false if commands.count() <= 0\n\n commands.delete\n return true\n end",
"def destroy\n app = extract_app\n info = heroku.info(app)\n url = info[:domain_name] || \"http://#{info[:name]}.#{heroku.host}/\"\n\n if confirm_command(app)\n redisplay \"Destroying #{app} (including all add-ons)... \"\n heroku.destroy(app)\n if remotes = git_remotes(Dir.pwd)\n remotes.each do |remote_name, remote_app|\n next if app != remote_app\n git \"remote rm #{remote_name}\"\n end\n end\n display \"done\"\n end\n end",
"def remove_command(command_label, rest_args)\n worker = workers[command_label]\n return false unless worker\n signal_to_use = rest_args ? Array(rest_args).first : 'INT'\n\n Invoker::Logger.puts(\"Removing #{command_label} with signal #{signal_to_use}\".color(:red))\n kill_or_remove_process(worker.pid, signal_to_use, command_label)\n end",
"def remove_custom_command_by_item_entry_id(item_entry_id)\n commands = USER_CUSTOM_COMMANDS.where(item_entry_id: item_entry_id)\n return false if commands == nil || commands.count <= 0\n\n commands.delete\n return true\n end",
"def replace_command(command)\n return @apps[command] if @apps.has_key?(command)\n return command\n end",
"def clean_command\n build_command(\"clean\")\n end",
"def clear\n @commands.clear\n nil\n end",
"def remove_bot(key)\n @queue.push([:remove_bot, key])\n end",
"def uninstall(app_id)\n runcmd 'uninstall', app_id\n end",
"def hide_command!\n Rails::Command.hidden_commands << self\n end",
"def clear\r\n @commands.clear\r\n nil\r\n end",
"def delete_application\n node.rm(new_resource.node_attribute, new_resource.resource_name, new_resource.name)\n end",
"def remove\n uninstall_yri\n uninstall_yard\n end",
"def cleanup_commands\n @cleanup_commands ||= []\n end",
"def delete(*names)\n names.each { |name| commands.delete name }\n end",
"def uninstall\n command = resource_or_provider_command\n self.class.validate_command(command)\n\n command_options = [\"uninstall\", \"-y\", \"-q\", @resource[:name]]\n\n execute([command, command_options])\n end",
"def clear\n registered_commands.each(&:terminate)\n registered_commands.clear\n\n self\n end",
"def clean!\n for duplicate in duplicates.map{|duplicate| duplicate[0]}\n @commands.delete_if{ |i| i[0] == duplicate}\n @commands << [duplicate, ENV[duplicate]]\n end\n end",
"def remove\n get_credentials\n begin\n response = resource[\"/remove/#{app}\"].post(:apikey => @credentials[1])\n rescue RestClient::InternalServerError\n display \"An error has occurred.\"\n end\n display response.to_s\n end",
"def clear_commands\n @@commands = HELP_COMMAND.dup\n end",
"def delete\n @exists = apps.include?(params[:app])\n @app = params[:app] unless @exists == false\n\n if @exists\n `rm #{File.expand_path(\"~/.pow/#{@app}\")}`\n redirect_to root_path, :notice => \"Pow app deleted\"\n else\n render :text => \"Given app is not a Pow app\"\n end\n end",
"def remove!\n package('skype') { action :remove }\n end",
"def unset_command\n [grep_cmd, '&&', unset_cmd].join(' ')\n end",
"def action_remove\n app_dir = Chef::Resource::Directory.new(\"#{@current_resource.apps_dir}/#{@current_resource.app}\", run_context)\n app_dir.path(\"#{@current_resource.apps_dir}/#{@current_resource.app}\")\n app_dir.recursive(true)\n app_dir.run_action(:delete)\n new_resource.updated_by_last_action(app_dir.updated_by_last_action?)\n end",
"def remove\n heroku.remove_key(args.first)\n display \"Key #{args.first} removed.\"\n end",
"def remove\n heroku.remove_key(args.first)\n display \"Key #{args.first} removed.\"\n end",
"def remove\n deprecation_notice!\n downstream = shift_argument\n verify_downstream! downstream\n @cisauraus.removeDownstream(app, downstream)\n display \"Removed downstream app: #{downstream}\"\n end",
"def remove_bot(key)\n if (bot = bot(key))\n bot.stop\n @bots.delete(key)\n end\n rescue => e\n log_error(e, \"Attempting to remove bot with key #{key}\")\n end",
"def commands\n @commands.reject { |_, v| v.is_a? CommandLion::Option }\n end",
"def remove\n if url = args.shift\n puts heroku.remove_drain(app, url)\n return\n else\n raise(CommandFailed, \"usage: heroku drains remove URL\")\n end\n end",
"def delete(command)\n pp @client.files.delete(clean_up(command[1]))\n end",
"def delete_application(client, options)\n if !options[:application].nil?\n application = client.applications.get options[:application]\n application.delete\n puts \"Application deleted.\"\n return\n else\n puts \"Missing arguments\"\n return\n end \nend",
"def unbind_meta_app key, &block\n application \"unbind_meta_app\", key.to_s, &block\n end",
"def remove\n system(\"qconf -duser #{name}\")\n end",
"def destroy_chain\n if application.respond_to?(:application)\n application.destroy\n end\n end",
"def uninstall_app(app_name)\n @apps.delete(app_name) if @apps[app_name]\n end",
"def delete_command\n name = get_param(\"name=\", \"([a-zA-Z]+)\")\n\n deleted = false\n\n if name\n @app.delete_animal(name)\n else\n puts \"Error!: A name is required to delete an animal\"\n delete_command_help()\n end\n end",
"def remove(*pkgs)\n opts = pkgs.last.is_a?(Hash) ? pkgs.pop : {}\n project.run \"apk del #{pkgs.join(' ')}\", opts\n end",
"def delete!\n execute_as_user(\"rm -rf #{app_dir}\")\n end",
"def remove\n unless domain = shift_argument\n error(\"Usage: heroku domains:remove DOMAIN\\nMust specify DOMAIN to remove.\")\n end\n validate_arguments!\n action(\"Removing #{domain} from #{app}\") do\n api.delete_domain(app, domain)\n end\n end",
"def remove_repo!\n chocolatey_package('chefdk') { action :remove }\n end",
"def call_without_reply(command)\n @commands.push command\n nil\n end",
"def remove_app\n Object.send :remove_const, @klass.name if @klass\n @klass = nil\n end",
"def rm(path)\n cmd 'rm', path\nend",
"def uninstall_app(*args)\n # remove files based on pkg info (boms)\n # or\n # just remove the app directory\n # check munki for tips on how to do this cleanly.\n # i'm inclined to skip this for now.\n end",
"def delete_application(opts)\n opts = check_params(opts,[:applications])\n super(opts)\n end",
"def remove!\n windows_package 'Chef Development Kit' do\n action :remove\n end\n end",
"def uninstall cmd=nil, &block\n @uninstall = cmd || block\n end",
"def remove_game(channel)\n @games.delete(channel)\n end",
"def delete_application(application_aid)\n select_application gp_card_manager_aid\n secure_channel\n \n files = gp_get_status :files_modules\n app_file_aid = nil\n files.each do |file|\n next unless modules = file[:modules]\n next unless modules.any? { |m| m[:aid] == application_aid }\n gp_delete_file file[:aid]\n app_file_aid = file[:aid]\n end \n app_file_aid\n end",
"def mina_cleanup!\n run! if commands.any?\n end",
"def uninstall\n pacman \"--noconfirm\", \"--noprogressbar\", \"-R\", @resource[:name]\n end",
"def snmp_notification_receiver_remove(opts = {})\n cmd = 'no ' << snmp_notification_receiver_cmd(opts)\n configure cmd\n end",
"def reset_commands\n @commands = {}\n end",
"def remove(name)\n sudo \"rm -rf #{god_confd}/#{name}\"\n end",
"def unmute_command(message)\n muted_chats[message.chat.id] = nil\n api_send_message(chat_id: message.chat.id,\n text: \"Ok\")\n end",
"def delete_original_interaction_response(interaction_token, application_id)\n Discordrb::API::Webhook.token_delete_message(interaction_token, application_id, '@original')\n end",
"def uninstall\n cmd = %w{--noconfirm --noprogressbar}\n cmd += uninstall_options if @resource[:uninstall_options]\n cmd << \"-R\"\n cmd << @resource[:name]\n\n pacman(*cmd)\n end",
"def command\n if args.skip?\n ''\n else\n commands.join('; ')\n end\n end",
"def remove_from_gamespace\n # remove it from the room it's in.\n self.from_room \n self.recycle \n # Possibly in the future return all switches. I.e. an admin taking over an NPC body.\n end",
"def destroy\n @application.destroy\n end",
"def destroy\n @application.destroy\n end",
"def command!(name)\n found = command(name)\n\n if found.nil?\n raise CommandNotFound.new(name, self)\n end\n\n found\n end",
"def admin_emoji_remove(options = {})\n raise ArgumentError, 'Required arguments :name missing' if options[:name].nil?\n post('admin.emoji.remove', options)\n end",
"def uninstall!(database)\n drop_extension(database)\n make_uninstall(database)\n end",
"def remove(conf, package_name, version = nil)\n raise NoMethodError.new \"Not implemented\"\n end",
"def call\n guild_role = GuildRole.find_by(guild: context.guild, character: context.character)\n guild_role.destroy if guild_role.present?\n context.character.update(guild_id: nil)\n end",
"def cmd!(command)\n self << command\n end",
"def remove_app_target_from_app_admin_role(user_id, role_id, app_name, options = {})\n delete(\"/users/#{user_id}/roles/#{role_id}/targets/catalog/apps/#{app_name}\", options)\n end",
"def remove_worker(command_label, trigger_event = true)\n worker = @workers[command_label]\n if worker\n @open_pipes.delete(worker.pipe_end.fileno)\n @workers.delete(command_label)\n end\n if trigger_event\n event_manager.trigger(command_label, :worker_removed)\n end\n end",
"def uninstallApp\n \tresult =`ideviceinstaller --udid #{$firstDeviceUDID} --uninstall com.woow.woowapp`\n \tif ($?.exitstatus != 0)\n \treturn \"not removed\"\n end\nend",
"def removeBackpack _args\n \"removeBackpack _args;\" \n end",
"def remove_worker(command_label)\n @worker_mutex.synchronize do\n worker = @workers[command_label]\n if worker\n @open_pipes.delete(worker.pipe_end.fileno)\n @reactor.remove_from_monitoring(worker.pipe_end)\n @workers.delete(command_label)\n end\n end\n end",
"def undo(times = 1)\n @commands.pop(times)\n self\n end",
"def delete_response\n Discordrb::API::Interaction.delete_original_interaction_response(@token, @application_id)\n end",
"def stop_xmpp_for_app(app)\n Djinn.log_info(\"Shutting down xmpp receiver for app: #{app}\")\n MonitInterface.remove(\"xmpp-#{app}\")\n Djinn.log_info(\"Done shutting down xmpp receiver for app: #{app}\")\n end",
"def remove_repo!\n homebrew_cask('chefdk') { action :uninstall }\n end",
"def clean(options={})\n send(run_method, \"#{YUM_COMMAND} -qy clean\", options)\n end",
"def remove\n key = shift_argument\n if key.nil? || key.empty?\n error(\"Usage: heroku keys:remove KEY\\nMust specify KEY to remove.\")\n end\n validate_arguments!\n\n action(\"Removing #{key} SSH key\") do\n api.delete_key(key)\n end\n end",
"def perform_!\n message \"Are you sure you wish to delete #{y(c.application)} from the #{y(e.name)} environment (#{y(c.ip)})?\"\n if yes?\n message \"Deleting #{y(c.application)}.\"\n e.delete!\n end\n end",
"def removeCommandAliases(repo)\n config = repo.config(true, '--list').lines.each do |line|\n next unless line.start_with? 'alias.' and line.match /\\!_git\\-bpf/\n a = /alias\\.([a-zA-Z0-9\\-_]+)\\=(.)*/.match(line)[1]\n repo.config(true, '--unset', \"alias.#{a}\")\n end\n end",
"def uninstall(packagename)\n\t\t\t\tpacakgename.strip!()\n\n\t\t\t\tCfruby.controller.attempt(\"Uninstalling \\\"#{packagename}\\\"\", 'destructive', 'unknown') {\n\t\t\t\t\t`#{finkbin} remove '#{packagename.gsub(/(\\')/, \"\\\\\\1\")}'`\n\t\t\t\t}\n\t\t\tend",
"def bring_down(typename, cmd)\n execute_with_fail(typename, cmd, 'to remove')\n end",
"def remove message\n @events.delete message.sequence\n end",
"def drop\n Aptly::runcmd \"aptly mirror drop #{@name.quote}\"\n end",
"def destroy\n display\n if confirm [\"Are you totally completely sure you want to delete #{app} forever and ever?\", \"THIS CANNOT BE UNDONE! (y/n)\"]\n display \"+> Destroying #{app}\"\n client.app_destroy(app)\n display \"+> #{app} has been successfully destroyed. RIP #{app}.\"\n remove_app(app)\n end\n display\n end",
"def removeHeadgear _args\n \"removeHeadgear _args;\" \n end",
"def clean(options={})\n send(run_method, %{sh -c \"#{APT_GET} -qy clean\"}, options)\n end",
"def remove(entry_point)\n entry_point = entry_point.name if entry_point.kind_of? Borges::Application\n val = @entry_points.delete(entry_point)\n end"
] | [
"0.7376783",
"0.7259488",
"0.7099469",
"0.7004282",
"0.6860014",
"0.67703646",
"0.65656316",
"0.65062183",
"0.6474784",
"0.6474626",
"0.6402586",
"0.61848885",
"0.6147852",
"0.6028535",
"0.60203433",
"0.6004277",
"0.5973524",
"0.5967581",
"0.591945",
"0.59167707",
"0.58636105",
"0.5836512",
"0.5830546",
"0.57936954",
"0.57921827",
"0.5779621",
"0.5777666",
"0.5774466",
"0.5728404",
"0.57276624",
"0.57172346",
"0.5717141",
"0.56795263",
"0.56777024",
"0.5669337",
"0.5657873",
"0.5657873",
"0.5633453",
"0.5626458",
"0.5621875",
"0.56172734",
"0.560568",
"0.5602677",
"0.5575948",
"0.5571788",
"0.557011",
"0.55575204",
"0.5551856",
"0.55483323",
"0.5538597",
"0.5527346",
"0.5525675",
"0.55157864",
"0.5513788",
"0.55042505",
"0.54951984",
"0.5489055",
"0.5488019",
"0.54875046",
"0.54736674",
"0.54531157",
"0.544955",
"0.5408606",
"0.5389153",
"0.5341044",
"0.53370166",
"0.53332955",
"0.53297985",
"0.53270257",
"0.53098655",
"0.52939665",
"0.52790207",
"0.52790207",
"0.5278708",
"0.5267673",
"0.52605975",
"0.5259376",
"0.52552986",
"0.5255028",
"0.5252458",
"0.52495456",
"0.52444404",
"0.52429354",
"0.5238267",
"0.5228064",
"0.52200043",
"0.5211457",
"0.52094716",
"0.52020305",
"0.51847667",
"0.51841736",
"0.5178806",
"0.5159578",
"0.5159045",
"0.5153154",
"0.5147049",
"0.5145926",
"0.5145115",
"0.5136725",
"0.5133454"
] | 0.6934519 | 4 |
Throws a useful exception if there's currently no gateway connection. | def gateway_check
raise "A gateway connection is necessary to call this method! You'll have to do it inside any event (e.g. `ready`) or after `bot.run :async`." unless connected?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gateway_check\n return if connected?\n\n raise \"A gateway connection is necessary to call this method! You'll have to do it inside any event (e.g. `ready`) or after `bot.run :async`.\"\n end",
"def gateway_error_code\n nil\n end",
"def gateway_error\n message\n end",
"def gateway(*args)\n begin\n @gateway ||= self.class.gateway(*args)\n rescue Exception => x\n payment_errors[:gateway] = x.message\n public_payment_errors[:gateway] = 'failed to initialize'\n end\n end",
"def raise_unless_connected!\n begin \n @connection.stats\n rescue\n raise Workling::StarlingNotFoundError.new\n end\n end",
"def gateway?\n context.transport_manager.gateways.include?(self)\n end",
"def lint_gateway_setup\n return if gateway_instance.instance_of? gateway\n\n complain <<-STRING\n #{gateway}.setup must return a gateway instance but\n returned #{gateway_instance.inspect}\n STRING\n end",
"def gateway_type\n fail 'unimplemented method gateway_type'\n end",
"def gateway\n begin\n \"#{self.service_name}Gateway\".classify.gateway(self.config_file_name)\n rescue\n self.class.gateway(self.config_file_name)\n end\n end",
"def gateway\n raise 'No Gateway secret configured' unless ENV['GATEWAY_SECRET_KEY']\n ChargeIO::Gateway.new(\n :site => ENV['GATEWAY_URI'],\n :secret_key => ENV['GATEWAY_SECRET_KEY']\n )\n end",
"def rescue_gateway_error\n yield\n rescue Spree::Core::GatewayError => e\n @settlement_results[\"errors\"] << e.message\n ensure\n @order.reload\n end",
"def connection_refused\n @connection_refused || code == 0\n end",
"def checkConnection\n unless connected?\n raise DictError.new(), \"Not connected.\"\n end\n end",
"def checkConnection\n unless connected?\n raise DictError.new(), \"Not connected.\"\n end\n end",
"def check_server\n raise Exception.new(\"Could not reach Apocalypse server please check the address and port and try again.\") unless server_reachable?\n end",
"def request_public_gateway(network_options, interface, env)\n subnet = IPAddr.new(network_options[:subnet])\n gateway = nil\n while !gateway\n gateway = env[:ui].ask(I18n.t(\n \"docker_provider.network_bridge_gateway_request\",\n interface: interface,\n default_gateway: network_options[:gateway]) + \" \",\n prefix: false\n ).strip\n if gateway.empty?\n gateway = network_options[:gateway]\n end\n begin\n gateway = IPAddr.new(gateway)\n if !subnet.include?(gateway)\n env[:ui].warn(I18n.t(\"docker_provider.network_bridge_gateway_outofbounds\",\n gateway: gateway,\n subnet: network_options[:subnet]) + \"\\n\", prefix: false)\n end\n rescue IPAddr::InvalidAddressError\n env[:ui].warn(I18n.t(\"docker_provider.network_bridge_gateway_invalid\",\n gateway: gateway) + \"\\n\", prefix: false)\n gateway = nil\n end\n end\n gateway.to_s\n end",
"def gateway\n @config[:gateway]\n end",
"def gateway\n self.class.gateway\n end",
"def ensure_service!\n raise \"Must have active connection\" unless zone&.service\n end",
"def gateway\n @attributes.fetch('gateway', nil)\n end",
"def ensure_zone!\n raise \"Must have active connection\" unless @zone\n end",
"def ensure_zone!\n fail \"Must have active connection\" unless @zone\n end",
"def ensure_connection!\n fail \"Must have active connection\" unless connection\n end",
"def ensure_connection!\n fail \"Must have active connection\" unless connection\n end",
"def ensure_connection!\n fail \"Must have active connection\" unless connection\n end",
"def ensure_connection!\n fail \"Must have active connection\" unless connection\n end",
"def ensure_connection!\n fail \"Must have active connection\" unless connection\n end",
"def ensure_connection!\n fail \"Must have active connection\" unless connection\n end",
"def connected?\n start_ssh {|ssh| } # do nothing\n rescue *CONNECTION_EXCEPTIONS => ex\n @connection_error = ex\n return false\n else\n return true\n end",
"def connection_check\n handle_action_exceptions(__method__) do\n check_connection\n end\n rescue RToolsHCKConnectionError => e\n if @json\n { 'result' => 'Failure', 'message' => e.message }\n else\n puts \"WARNING: #{e.message}\"\n false\n end\n end",
"def check_connection\n return\n check = HTTParty.get(\"#{@host}/api/process/check_connection?api_key=#{@api_key}\")\n if check.nil? || check[\"status\"][\"code\"] < 0\n @helper.terminate(\"Script was unable to establish connection with dFlow at #{@host}\")\n end\n end",
"def ping\n if god?\n tries = 3\n begin\n @server.ping\n rescue Exception => e\n retry if (tries -= 1) > 1\n raise e, \"The server is not available (or you do not have permissions to access it)\"\n end\n end\n end",
"def gateway_client\n @gateway_client ||= get_gateway_client({client_id: @client_id, gateway_type: gateway_type})\n end",
"def reachable?\n ping\n true\n rescue Orocos::ComError\n false\n end",
"def checkCxn(conn)\n res = conn.request(:method=>:get,:path=>\"/wapi/v1.0/network\")\n if(res.status != 200)\n raise res.body\n end\nend",
"def gateway(token)\n request(\n __method__,\n :get,\n \"#{api_base}/gateway\",\n Authorization: token\n )\n end",
"def gateway(token)\n request(\n __method__,\n :get,\n \"#{api_base}/gateway\",\n Authorization: token\n )\n end",
"def validate_gateway_type\n return error_with_identifier('invalid_api_params',\n 'w_f_g_b_vgt_1',\n ['invalid_gateway_type']\n ) unless GlobalConstant::GatewayType.is_valid_gateway_type?(@gateway_type)\n\n success\n end",
"def connect_error?\n @connerror || false\n end",
"def allow_net_connect?\n allow_net_connect\n end",
"def host_unreachable_exceptions\n [::Faraday::Error::ConnectionFailed, ::Faraday::Error::TimeoutError]\n end",
"def host_unreachable_exceptions\n [::Faraday::Error::ConnectionFailed, ::Faraday::Error::TimeoutError]\n end",
"def test_query_with_broken_network_connection\n Net::HTTP.stubs(:get_response).raises(Net::HTTPRequestTimeOut)\n\n coder = Google4R::Maps::Geocoder.new(GOOGLE_MAPS_KEY)\n \n assert_raises(Google4R::Maps::ConnectionException) do\n coder.query(@test_adress)\n end\n end",
"def attempt_connection\n begin\n response = Net::HTTP.get_response(uri)\n unless response.code == \"200\"\n Puppet.notice \"HTTP request (#{uri}) failed: (#{response.code} #{response.body})\"\n return false\n end\n return true\n rescue Errno::ECONNREFUSED => e\n Puppet.notice \"Unable to establish HTTP connection to '#{uri}'; #{e}\"\n return false\n end\n end",
"def ensure_service!\n raise \"Must have active connection\" unless @service\n end",
"def ensure_service!\n raise \"Must have active connection\" unless @service\n end",
"def ensure_service!\n raise \"Must have active connection\" unless @service\n end",
"def ensure_service!\n raise \"Must have active connection\" unless @service\n end",
"def service_unavailable\n\n end",
"def prepare_gateway\n ActiveMerchant::Billing::Base.mode = gateway_mode\n begin\n @gateway = ActiveMerchant::Billing.const_get(\"#{gateway_name}Gateway\").new(gateway_credentials)\n @result[:gateway] = true\n end\n @result[:gateway]\n end",
"def find_connection host_info\n conn = @backend_connections.detect { |x| x.server_info == host_info }\n raise NoServerAvailable.new(\"BackgrounDRb server is not found running on #{host_info}\") unless conn\n return conn\n end",
"def ping\n tries = 3\n begin\n # @server.ping\n rescue Exception => e\n retry if (tries -= 1) > 1\n raise e, \"The server is not available (or you do not have permissions to access it)\"\n end\n end",
"def gateway\n if @@gateway\n return @@gateway if @@gateway.is_a? ActiveMerchant::Billing::Gateway\n @@gateway = @@gateway.to_s.classify.constantize.gateway\n else\n Gateway.default_gateway\n end\n end",
"def gateway\n @gateway ||= PAYMENT_CLASS.new(\n :login => PAYMENT_LOGIN,\n :password => PAYMENT_PASSWORD,\n :signature => PAYMENT_SIGNATURE # Ignored for some gateway types; see \"config/payment_gateway.yml\"\n )\n end",
"def reachable?\n !!client\n end",
"def reachable?\n !!client\n end",
"def gateway_retry_limit\n limit = @options &&\n (\n @options[:gateway_retry_limit] ||\n @options['gateway_retry_limit']\n )\n limit.nil? ? -1 : limit.to_i\n end",
"def gateway_retry_limit\n limit = @options &&\n (\n @options[:gateway_retry_limit] ||\n @options['gateway_retry_limit']\n )\n limit.nil? ? -1 : limit.to_i\n end",
"def inspect; 'GATEWAY'; end",
"def tunnel\n if gw\n # We have a gateway host.\n @tunnel ||= gw.gateway_tunnel\n end\n end",
"def ensure_service!\n raise \"Must have active connection\" unless service\n end",
"def check_connection\n return\n check = HTTParty.get(\"#{@host}/api/check_connection?api_key=#{@api_key}\")\n if check.nil? || check[\"status\"][\"code\"] < 0\n @helper.terminate(\"Script was unable to establish connection with dFile at #{@host}\")\n end\n end",
"def ensure_service!\n raise \"Must have active connection\" unless service\n end",
"def ensure_service!\n raise \"Must have active connection\" unless service\n end",
"def connected?()\n (self.remote_address rescue nil) ? true : false\n end",
"def test!\n begin\n send_message!(:recipient_number => '_', :body => '')\n rescue Excon::Errors::Error\n false\n rescue MessageRejectedError\n true\n else\n false # Gateway is being weird, should never accept that message\n end\n end",
"def ensure_service!\n raise \"Must have active connection\" unless @client.service\n end",
"def gateway_url\n if sandbox?\n GATEWAY_SANDBOX_URL\n else\n GATEWAY_URL\n end\n end",
"def connect_reset_safe\n\t\tbegin\n\t\t\tconnect\n\t\trescue Rex::ConnectionRefused\n\t\t\treturn :refused\n\t\tend\n\t\treturn :connected\n\tend",
"def rescue_connection_reset\n redirect_to(:action => \"index\")\n flash[:notice] = \"Sorry, something went wrong (connection reset). \" +\n \"Please try again.\"\n end",
"def ping?\n false unless connected?\n false|stat('/')\n rescue ZK::Exceptions::KeeperException\n false\n end",
"def check_connection\n one_wait = 5\n max_wait = 5\n request = Net::HTTP::Get.new('/')\n wait = 0;\n while (wait < max_wait)\n begin\n response = Net::HTTP.start(@url.host, @url.port) {|http|\n http.request(request)\n }\n break if Net::HTTPForbidden === response\n break if Net::HTTPNotFound === response\n break if Net::HTTPSuccess === response\n # When we try to connect to a down server with an Apache proxy, \n # we'll get Net::HTTPBadGateway and get here\n rescue Errno::ECONNREFUSED\n # When we try to connect to a down server without an Apache proxy, \n # such as a dev instance, we'll get here\n end\n sleep one_wait;\n wait += one_wait\n end\n if (wait == max_wait)\n puts(\"-- ERROR: couldn't connect to test host on \" + @url.host.to_s)\n return false\n end\n puts(\"-- SUCCESS: test host is alive !\\n\")\n return true\nend",
"def default_gw_ipaddr\n ip = case `/bin/uname -s`.rstrip\n when 'Linux'\n `/sbin/ip route get 8.8.8.8`.split(\"\\n\")[0].split.last\n when 'SunOS'\n `/sbin/ifconfig $(/usr/sbin/route -n get 1.1.1.1 | awk '$1 == \"interface:\" {print $2}') | awk '$1 == \"inet\" { print $2 }'`\n else\n raise \"Unsupported platform to detect gateway IP address: #{`/bin/uname`}\"\n end\n ip = ip.rstrip\n raise \"Failed to run command lines or empty result\" if ip == '' || $?.exitstatus != 0\n ip\n end",
"def gateway(arg=nil)\n set_or_return(:gateway, arg, :kind_of => String)\n end",
"def ensure_service!\n fail \"Must have active connection\" unless service\n end",
"def ensure_service!\n fail \"Must have active connection\" unless service\n end",
"def delivery_gateway\n super ||\n static_gateway && \"::StaticGateway::#{static_gateway}\".safe_constantize&.new\n end",
"def no_internet\n puts 'An Internet connection is required to use this command.'\n end",
"def connectable?\n begin; ping; rescue; false; end\n end",
"def connect\n force_connect unless @handler\n end",
"def check_connected\n raise NotConnected unless @session_id && @sso && @provider\n end",
"def connect\n @retries_left = RETRY_COUNT\n require 'mindset' unless defined?(::Mindset)\n begin\n @neurosky = ::Mindset.connect(connect_to)\n super\n return true\n rescue Errno::EBUSY, Errno::ECONNREFUSED => e\n @retries_left -= 1\n if @retries_left > 0\n retry\n else\n Logger.error e.message\n Logger.error e.backtrace.inspect\n return false\n end\n end\n end",
"def connection_valid?\n client('v1').api_valid?\n rescue StandardError\n false\n end",
"def payment_gateway\n return Spree::BogusGateway.new if ENV['RAILS_ENV'] == \"development\" and Spree::Gateway::Config[:use_bogus]\n\n # retrieve gateway configuration from the database\n gateway_config = GatewayConfiguration.find :first\n config_options = {}\n gateway_config.gateway_option_values.each do |option_value|\n key = option_value.gateway_option.name.to_sym\n config_options[key] = option_value.value\n end\n gateway = gateway_config.gateway.clazz.constantize.new(config_options)\n\n return gateway\n end",
"def ensure_connected\n client = @connection.client(self)\n \n # If this connection has expired somehow, try to get another one.\n unless connected?(client)\n @connection.drop(self)\n client = @connection.client(self)\n end\n\n fail \"Bad Connection\" unless connected?(client)\n\n client\n end",
"def check_connection\n one_wait = 5\n max_wait = 15\n request = Net::HTTP::Get.new('/selenium-server/')\n wait = 0;\n while (wait < max_wait)\n begin\n response = Net::HTTP.start(@host, @port) {|http|\n http.request(request)\n }\n break if Net::HTTPForbidden === response\n break if Net::HTTPNotFound === response\n break if Net::HTTPSuccess === response\n # When we try to connect to a down server with an Apache proxy,\n # we'll get Net::HTTPBadGateway and get here\n rescue Errno::ECONNREFUSED\n # When we try to connect to a down server without an Apache proxy,\n # such as a dev instance, we'll get here\n end\n sleep one_wait;\n wait += one_wait\n end\n if (wait == max_wait)\n p(\"-- ERROR: couldn't connect to Selenium RC on \" + @host)\n return false\n end\n return true\n end",
"def eaddrnotavail?() EADDRNOTAVAIL == @error_code; end",
"def selfconnected?\n !selfconnection.weight.zero?\n end",
"def raise_if_transaction_running\n raise Agent::Error.new(Agent::Error::TRNS_IPRG) if check_for_running_transaction\n end",
"def connection_factory\n @connection_factory ||= begin\n if exists?(:gateway)\n logger.debug \"establishing connection to gateway `#{fetch(:gateway).inspect}'\"\n GatewayConnectionFactory.new(fetch(:gateway), self)\n else\n DefaultConnectionFactory.new(self)\n end\n end\n end",
"def method_missing(meth, *args, &block)\n begin\n @proxy.send(meth, *args, &block)\n rescue\n establish\n puts 'connect reestablished'\n @proxy.send(meth, *args, &block)\n end\n end",
"def ogonegateway\n @gateway ||= ActiveMerchant::Billing::OgoneGateway.new(\n :login => opts[:pspid],\n :user => opts[:user],\n :password => opts[:pass],\n # :signature => \"\", # SHA-IN - must match ePDQ account configuration\n :signature_encryptor => \"none\" # Can be \"none\" (default), \"sha1\", \"sha256\" or \"sha512\".\n # Must be the same as the one configured in your Ogone account.\n )\n end",
"def check_client\n unless client\n raise ClientNotSetup\n end\n unless client.connected?\n if raise_on_error\n raise ClientNotConnected\n else\n @logger.error 'Client not connected! Check internet connection'\n return false\n end\n end\n true\n end",
"def connection_opening_failed(error)\n if error.kind_of?(Ably::Exceptions::BaseAblyException)\n # Authentication errors that indicate the authentication failure is terminal should move to the failed state\n if ([401, 403].include?(error.status) && !RESOLVABLE_ERROR_CODES.fetch(:token_expired).include?(error.code)) ||\n (error.code == Ably::Exceptions::Codes::INVALID_CLIENT_ID)\n connection.transition_state_machine :failed, reason: error\n return\n end\n end\n\n logger.warn { \"ConnectionManager: Connection to #{connection.current_host}:#{connection.port} failed; #{error.message}\" }\n next_state = get_next_retry_state_info\n\n if connection.state == next_state.fetch(:state)\n logger.error { \"ConnectionManager: Skipping next retry state after connection opening failed as already in state #{next_state}\\n#{caller[0..20].join(\"\\n\")}\" }\n else\n connection.transition_state_machine next_state.fetch(:state), retry_in: next_state.fetch(:pause), reason: Ably::Exceptions::ConnectionError.new(\"Connection failed: #{error.message}\", nil, Ably::Exceptions::Codes::CONNECTION_FAILED, error)\n end\n end",
"def next_available\n case @connection_handling\n when :stack\n @available_connections.pop\n else\n @available_connections.shift\n end\n end",
"def next_available\n case @connection_handling\n when :stack\n @available_connections.pop\n else\n @available_connections.shift\n end\n end",
"def host\n raise MethodMissingError\n end",
"def gateway_has_express_support\n gateway().respond_to?( :express )\n end",
"def gateway_name\n gateway[:name]\n end",
"def eaddrinuse?() EADDRINUSE == @error_code; end"
] | [
"0.7751847",
"0.65875864",
"0.6534818",
"0.651003",
"0.6309331",
"0.5974415",
"0.595532",
"0.5945726",
"0.57716304",
"0.5750861",
"0.57480955",
"0.566896",
"0.55939406",
"0.55939406",
"0.55601287",
"0.55475944",
"0.5541724",
"0.54064506",
"0.54039925",
"0.5363154",
"0.5354816",
"0.5330252",
"0.53169847",
"0.53169847",
"0.53169847",
"0.53169847",
"0.53169847",
"0.53169847",
"0.53133947",
"0.53099257",
"0.52841115",
"0.5266961",
"0.524391",
"0.5236069",
"0.521438",
"0.52045447",
"0.52045447",
"0.5184165",
"0.5164362",
"0.5163861",
"0.51558536",
"0.51558536",
"0.5150768",
"0.51477337",
"0.5140511",
"0.5140511",
"0.5140511",
"0.5140511",
"0.51394284",
"0.51377046",
"0.5113838",
"0.5094086",
"0.5093909",
"0.50908244",
"0.5083701",
"0.5083701",
"0.50791967",
"0.50791967",
"0.50750196",
"0.5065669",
"0.50632393",
"0.50628376",
"0.50624615",
"0.50624615",
"0.5060407",
"0.5056088",
"0.5051591",
"0.50404805",
"0.5039317",
"0.50360894",
"0.50341725",
"0.50336075",
"0.5012278",
"0.5007575",
"0.50062406",
"0.50062406",
"0.50061893",
"0.49998087",
"0.49991167",
"0.49937958",
"0.49921584",
"0.49696192",
"0.49670583",
"0.4959897",
"0.49385673",
"0.49148753",
"0.4904782",
"0.48947585",
"0.48884356",
"0.4878158",
"0.4875872",
"0.48751107",
"0.48694906",
"0.4866437",
"0.4865079",
"0.4865079",
"0.48648122",
"0.48576626",
"0.4855692",
"0.48337778"
] | 0.7690634 | 1 |
Logs a warning if there are servers which are still unavailable. e.g. due to a Discord outage or because the servers are large and taking a while to load. | def unavailable_servers_check
# Return unless there are servers that are unavailable.
return unless @unavailable_servers&.positive?
LOGGER.warn("#{@unavailable_servers} servers haven't been cached yet.")
LOGGER.warn('Servers may be unavailable due to an outage, or your bot is on very large servers that are taking a while to load.')
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def warning_webmin\n unless @info[:processes].to_a.grep(/cpanel/i).empty?\n @warnings << \"Server likely to be running cPanel\"\n end\n end",
"def warning_plesk\n unless @info[:processes].to_a.grep(/psa/i).empty?\n @warnings << \"Server likely to be running Plesk\"\n end\n end",
"def check_monitoring\n @servers.each do |server|\n obj_behavior(server, :settings)\n response = nil\n count = 0\n until response || count > 20 do\n begin\n response = obj_behavior(server, :monitoring)\n rescue\n response = nil\n count += 1\n sleep 10\n end\n end\n raise \"Fatal: Failed to verify that monitoring is operational\" unless response\n#TODO: pass in some list of plugin info to check multiple values. For now just\n# hardcoding the cpu check\n unless server.multicloud\n sleep 180 # This is to allow monitoring data to accumulate\n monitor = obj_behavior(server, :get_sketchy_data, {'start' => -60,\n 'end' => -20,\n 'plugin_name' => \"cpu-0\",\n 'plugin_type' => \"cpu-idle\"})\n idle_values = monitor['data']['value']\n raise \"No cpu idle data\" unless idle_values.length > 0\n raise \"CPU idle time is < 0: #{idle_values}\" unless idle_values[0] > 0\n puts \"Monitoring is OK for #{server.nickname}\"\n end\n end\n end",
"def check_monitoring\n @servers.each do |server|\n server.settings\n response = nil\n count = 0\n until response || count > 20 do\n begin\n response = server.monitoring\n rescue\n response = nil\n count += 1\n sleep 10\n end\n end\n raise \"Fatal: Failed to verify that monitoring is operational\" unless response\n#TODO: pass in some list of plugin info to check multiple values. For now just\n# hardcoding the cpu check\n sleep 60 # This is to allow monitoring data to accumulate\n monitor=server.get_sketchy_data({'start'=>-60,'end'=>-20,'plugin_name'=>\"cpu-0\",'plugin_type'=>\"cpu-idle\"})\n idle_values = monitor['data']['value']\n raise \"No cpu idle data\" unless idle_values.length > 0\n raise \"No idle time\" unless idle_values[0] > 0\n puts \"Monitoring is OK for #{server.nickname}\"\n end\n end",
"def foreign_server_failure\n [ 503, {'Content-Type'=>'text/plain', 'Content-Length' => '23'},\n ['Foreign server failure.'] ]\n end",
"def handle_warnings(response)\n warnings = response.warnings\n\n if warnings and warnings.size > 0\n puts \"Warning(s) when performing request:\"\n warnings.each do |warning|\n puts \" - [#{warning.reason}] #{warning.message}\"\n end\n end\nend",
"def check_server\n raise Exception.new(\"Could not reach Apocalypse server please check the address and port and try again.\") unless server_reachable?\n end",
"def detect_failure\n time = Time.now\n server = server_structs.detect do |server|\n server.next_retry > time\n end\n inspect_server(server) if server\n end",
"def gem_warning(server)\n if(!server.command_available?)\n puts \"WARNING: The #{server.server} gem does not appear to be installed\"\n end\n end",
"def ping\n tries = 3\n begin\n # @server.ping\n rescue Exception => e\n retry if (tries -= 1) > 1\n raise e, \"The server is not available (or you do not have permissions to access it)\"\n end\n end",
"def service_unavailable\n\n end",
"def server_connection_failed\n @server_side = nil\n if @connected\n LOGGER.error \"Connection with #{@remote.join(':')} was terminated prematurely.\"\n close_connection\n BeanstalkProxy.connect_error_callback.call(@remote.join(':'))\n elsif @tries < 10\n @tries += 1\n LOGGER.warn \"Retrying connection with #{@remote.join(':')} (##{@tries})\"\n EM.add_timer(0.1) { connect_to_server }\n else\n LOGGER.error \"Connect #{@remote.join(':')} failed after ten attempts.\"\n close_connection\n BeanstalkProxy.connect_error_callback.call(@remote.join(':'))\n end\n end",
"def raise_unless_connected!\n begin \n @connection.stats\n rescue\n raise Workling::StarlingNotFoundError.new\n end\n end",
"def response_unavailable?\n !!(content_for_scanner =~ /Server too busy, try again later/)\n end",
"def server_lost(srv)\n @servers.delete(srv) if @servers.include?(srv)\n end",
"def list_unknownservers\n @admin.listUnknownServers.to_a\n end",
"def global_warning\n # using SiteConfigutation over an environment constant DOES require a query for EVERY REQUEST\n # but the table is tiny (<5 rows right now) and the coloumn is indexed. But it also gives us the flexibility\n # to display or remove a message within seconds which I think is worth it\n warning = $CACHE.fetch(\"application/global_warning\", :expires_in => 10.minutes) do\n parameter = SiteConfigurationOption.find_by_parameter('global_site_warning')\n if parameter && parameter.value\n parameter.value\n else\n 1\n end\n end\n if warning && warning.class == String\n flash.now[:error] = warning\n end\n end",
"def check_idle_servers!\n\t\tmust_not_be_in_synchronize_block\n\t\t@lock.synchronize do\n\t\t\t@next_cleaning_time = Time.now - 60 * 60\n\t\t\t@cond.signal\n\t\tend\n\tend",
"def unavailable\n render \"errors/503\", :status => 503 \n\tend",
"def ping\n if god?\n tries = 3\n begin\n @server.ping\n rescue Exception => e\n retry if (tries -= 1) > 1\n raise e, \"The server is not available (or you do not have permissions to access it)\"\n end\n end\n end",
"def list_deadservers\n @admin.listDeadServers.to_a\n end",
"def logWarning(message)\n found = false\n if ($logMessages)\n\tlogServer = get($serverPath+'log')\n\tif (logServer != nil)\n\t\tlogServer.warning(message)\n\t\tfound = true\n\tend\n end\n if (!found or !$logMessages or $printAllMessages)\n\tprint(message)\n end\n\nend",
"def logstats\n\t\tu = sec2dhms(Time.new - @@starttime)\n\n\t\tSyslog.info(\"Had #{@@totalclients} clients of which #{@@bogusclients} were bogus. Uptime #{u[0]} days #{u[1]} hours #{u[2]} min. #{connections} connection(s) in use now.\")\n\tend",
"def servers\n gateway_check\n unavailable_servers_check\n @servers\n end",
"def monitor_system\n if @is_fire || @is_power_outage || @is_mechanical_failure\n \n @status = \"offline\"\n for column in @column_list do\n column.status = \"offline\"\n for elevator in column.elevator_list do\n elevator.status = \"offline\"\n end\n end\n puts \"Battery #{@id} has been shut down for maintenance. Sorry for the inconvenience\"\n exit()\n end\n end",
"def storage_server_disruption(host)\n return if !self.storage_server_online?(host)\n key = \"gh.storage.server.disrupt.#{host}\"\n if counter_suffix = self.client.get(key)\n count = self.client.incr(\"#{key}.#{counter_suffix}\")\n if count > DISRUPTION_THRESHOLD\n if self.set_storage_server_offline(host, 30)\n self.client.del(key, \"#{key}.#{counter_suffix}\")\n -1\n end\n else\n count\n end\n else\n if self.client.set_unless_exists(key, Time.now.to_f * 1000)\n self.client.expire(key, DISRUPTION_WINDOW)\n self.storage_server_disruption(host)\n else\n # we raced to set first and lost, wrap around and try again\n self.storage_server_disruption(host)\n end\n end\n end",
"def add_server_diagnostics(server)\n yield\n rescue Mongo::Error, Mongo::Error::AuthError => e\n e.add_note(\"on #{server.address.seed}\")\n raise e\n end",
"def server_error\n messages = [\"Captain!\", \"Man overboard!\", \"Ekk!\"]\n MsteamsNotifier::Message.quick_message \"#{messages.sample} We've had a 500 error at #{request.referrer}\"\n render status: 500, layout: \"dash/error\"\n end",
"def loop_until_server_online\n\t\tcs_conn=self.cloud_server_init\n\n\t\terror_message=\"Failed to build server.\"\n\n\t\ttimeout=self.server_online_timeout-(Time.now-self.updated_at).to_i\n\t\ttimeout = 120 if timeout < 120\n\n\t\tbegin\n\t\t\tTimeout::timeout(timeout) do\n\n\t\t\t\t# poll the server until progress is 100%\n\t\t\t\tcs=cs_conn.find_server(\"#{self.cloud_server_id_number}\")\n\t\t\t\tuntil cs.progress == 100 and cs.status == \"ACTIVE\" do\n\t\t\t\t\tcs=cs_conn.find_server(\"#{self.cloud_server_id_number}\")\n\t\t\t\t\tsleep 1\n\t\t\t\tend\n\n\t\t\t\terror_message=\"Failed to ssh to the node.\"\t\n\n\t\t\t\tif ! system(%{\n\n\t\t\t\t\t\tCOUNT=0\n\t\t\t\t\t\twhile ! ssh -o \"StrictHostKeyChecking no\" -T -i #{self.server_group.ssh_key_basepath} root@#{cs.addresses[:public][0]} /bin/true > /dev/null 2>&1; do\n\t\t\t\t\t\t\tif (($COUNT > 23)); then\n\t\t\t\t\t\t\t\texit 1\n\t\t\t\t\t\t\tfi\n\t\t\t\t\t\t\t((COUNT++))\n\t\t\t\t\t\t\tsleep 15\n\t\t\t\t\t\tdone\n\t\t\t\t\t\texit 0\n\n\t\t\t\t}) then\n\t\t\t\t\tfail_and_raise error_message\n\t\t\t\tend\n\n\t\t\tend\n\t\trescue Exception => e\n\t\t\tfail_and_raise error_message\n\t\tend\n\n\tend",
"def check_warnings\n @messages = {}\n @messages[:expired_card] = MESSAGES[:expired_card] if cards.any?(&:expired?) # { |card| card.expired? }\n @messages[:empty_wallet] = MESSAGES[:empty_wallet] if @cards.length < 1\n @messages.length > 0\n end",
"def server_available?\n !in_latency_window.empty?\n end",
"def wait_until_unhealthy!\n agent = consul.get(\"/agent/self\")[\"Member\"][\"Name\"]\n consul.get_while(\"/health/node/#{agent}\") do |data|\n status = data.detect {|x| x[\"CheckID\"] == \"service:#{name}\" }[\"Status\"]\n status == 'passing'\n end\n end",
"def graceful_shutdown\n while reap_dead_workers(\"shutdown\") > 0\n logger.error \"Waiting for #{@workers.list.length} requests to finish, could take #{@timeout + @throttle} seconds.\"\n sleep @timeout / 10\n end\n end",
"def check_passenger_monitoring\n passenger_plugins = [\n {\"plugin_name\"=>\"passenger\", \"plugin_type\"=>\"passenger_instances\",\"field\"=>\"value\"},\n {\"plugin_name\"=>\"passenger\", \"plugin_type\"=>\"passenger_processes\",\"field\"=>\"max\"},\n {\"plugin_name\"=>\"passenger\", \"plugin_type\"=>\"passenger_queued\",\"field\"=>\"value\"},\n {\"plugin_name\"=>\"passenger\", \"plugin_type\"=>\"passenger_requests\",\"field\"=>\"value\"}\n ]\n sleep 60 # wait for some data to be available\n @servers.each do |server|\n unless server.multicloud\n#passenger commands to generate data for collectd to return\n# for ii in 1...100\n# # how do we force there to be data?? For now just check that the graph exists - cause the\n# # bug was missing graphs.\n# end\n passenger_plugins.each do |plugin|\n monitor = obj_behavior(server, :get_sketchy_data, {'start' => -60,\n 'end' => -20,\n 'plugin_name' => plugin['plugin_name'],\n 'plugin_type' => plugin['plugin_type']})\n value = monitor['data'][\"#{plugin['field']}\"]\n puts \"Checking #{plugin['plugin_name']}-#{plugin['plugin_type']}: value #{value}\"\n raise \"No #{plugin['plugin_name']}-#{plugin['plugin_type']} data\" unless value.length > 0\n# # Need to check for that there is at least one non 0 value returned.\n# for nn in 0...value.length\n# if value[nn] > 0\n# break\n# end\n# end\n# raise \"No #{plugin['plugin_name']}-#{plugin['plugin_type']} time\" unless nn < value.length\n puts \"Monitoring is OK for #{plugin['plugin_name']}-#{plugin['plugin_type']}\"\n end\n end\n end\n end",
"def doi_server_reachable?\n Ezid::Client.new.server_status.up? rescue false\n end",
"def doi_server_reachable?\n Ezid::Client.new.server_status.up? rescue false\n end",
"def doi_server_reachable?\n Ezid::Client.new.server_status.up? rescue false\n end",
"def clear_slowlog_responses(server_names)\n unless server_names.nil? || server_names.is_a?(Array) || server_names.is_a?(String)\n raise(ArgumentError,\n \"#{server_names.class} of #{server_names.inspect} is not of correct type\")\n end\n if server_names.nil?\n server_names = getServerNames([], true)\n else\n server_names_list = to_server_names(server_names)\n server_names = getServerNames(server_names_list, false)\n end\n clear_log_responses = @admin.clearSlowLogResponses(java.util.HashSet.new(server_names))\n clear_log_success_count = 0\n clear_log_responses.each do |response|\n if response\n clear_log_success_count += 1\n end\n end\n puts 'Cleared Slowlog responses from ' \\\n \"#{clear_log_success_count}/#{clear_log_responses.size} RegionServers\"\n end",
"def offline?\n return (Time.now - self.time_of_last_connection) > threshold_for_offline\n end",
"def storage_server_online?(host)\n !self.client.exists(\"gh.storage.server.offline.#{host}\")\n rescue Errno::ECONNREFUSED\n # If we can't connect to Redis, check to see if the BERTRPC\n # server is alive manually.\n begin\n smoke(host).alive?\n rescue BERTRPC::ReadTimeoutError\n false\n end\n end",
"def silence_single_worker_warning; end",
"def run_warned; end",
"def warn(check)\n update_check_status(check, 'warn')\n end",
"def emergency(msg) log(0, msg); end",
"def update_job_servers\n # Check if it's been > TIME_BETWEEN_CHECKS or we have no good servers\n return unless time_to_check_connections || @job_servers.empty?\n\n logger.debug \"Found #{@bad_servers.size} zombie connections, checking pulse.\"\n @servers_mutex.synchronize do\n @bad_servers.each do |connection|\n begin\n message = \"Testing server #{connection}...\"\n if connection.is_healthy?\n logger.debug \"#{message} Connection is healthy, putting back into service\"\n activate_connection(connection)\n else\n logger.debug \"#{message} Still down.\"\n end\n end\n end\n end\n\n # Sleep for a few to allow a chance for the world to become sane\n if @job_servers.empty?\n logger.warn \"No job servers available, sleeping for #{SLEEP_TIME} seconds\"\n sleep(SLEEP_TIME)\n end\n\n @last_check_time = Time.now\n end",
"def disabled_warnings; end",
"def server_error\n\n end",
"def warn_packet_overtime packet_id; end",
"def server_found!\n @not_found = false\n @requests.keys.each do |request_id|\n msg, blk = @requests.delete request_id\n @client.aquire_connection.send_command(msg, request_id, &blk)\n end\n end",
"def maintenance_mode?\n if ENV[\"MAINTENANCE_MODE\"] == \"true\"\n render \"errors/greenlight_error\", status: 503, formats: :html,\n locals: {\n status_code: 503,\n message: I18n.t(\"errors.maintenance.message\"),\n help: I18n.t(\"errors.maintenance.help\"),\n }\n end\n\n maintenance_string = @settings.get_value(\"Maintenance Banner\").presence || Rails.configuration.maintenance_window\n if maintenance_string.present?\n flash.now[:maintenance] = maintenance_string unless cookies[:maintenance_window] == maintenance_string\n end\n end",
"def pending_decommission(proxy)\n server = server_by_proxy(proxy)\n recent_decommissions << server.name\n end",
"def dwp_make_unavailable\n @dwp_runner.make_worker_unavailable(self)\n dwp_run_callback 'on_unavailable'\n dwp_log{ \"Unavailable\" }\n end",
"def do_alive_check(id, auth, info_url)\n response = HTTParty.get(info_url, timeout: TIMEOUT, basic_auth: auth)\n send_service_response(id, response)\nrescue HTTParty::ResponseError, Errno::ECONNREFUSED => e\n send_text_status(id, 'Dead', moreinfo: e.message, danger: true)\n [false, e]\nrescue StandardError => e\n send_text_status(id, 'Indeterminate', moreinfo: e.message, fatal: true)\n [false, e]\nend",
"def warn?; @loggers.first.level <= WARN; end",
"def report_ready\n write_verbose_log(\"Notifier #{VERSION} ready to catch errors\", :info)\n end",
"def event_timer\n if @connection.comm.connected? and Time.now - @var[:last_ping] >= 60\n begin\n _server_control(\"keepalive\")\n rescue\n _notice(\"The connection to the server has been lost\", :global)\n @connection.disconnect\n end\n end\nend",
"def log_unavailable(node, snapshot)\n logger.info(\"#{self.class} marking #{node} as unavailable. Snapshot: #{snapshot}\")\n end",
"def has_failed?(server)\n Thread.current[:failed_sessions].include?(server)\n end",
"def unavailable?\n status.to_s.start_with? Status::UNAVAILABLE\n end",
"def run_reboot_checks\n # one simple check we can do is the backup. Backup can fail if anything is amiss\n @servers.each do |server|\n run_script(\"do_backup\", server)\n end\n end",
"def run_mysqlslap_check\n @servers.each do |server|\n result = server.spot_check_command(\"mysqlslap --concurrency=5000 --iterations=10 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --csv=/tmp/mysqlslap_q1000_innodb.csv --engine=innodb --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=mixed --number-of-queries=1000 --user=root\")\n raise \"FATAL: mysqlslap check failed\" unless result[:output].empty?\n end\n end",
"def servers\n server_structs.each do |server|\n def server.alive?\n next_retry <= Time.now\n end\n end\n end",
"def silence_warnings\n UnionStationHooks::Log.warn_callback = lambda { |_message| }\n end",
"def getwarnings(hostn, ipadr)\n\n\t\t\t#Getting Warning lines from actual SSLlabs web page since this info is not available through api yet\n\t\t\tdoc = Nokogiri::HTML(open(\"https://www.ssllabs.com/ssltest/analyze.html?d=#{hostn}&s=#{ipadr}&hideResults=on\"))\n\t\t\t#Printing warnings messages\n\t\t\t#doc.xpath(\"//div[contains(@class,'warningBox')]\").each { |node| puts node.text}\n\t\t\tdoc.xpath(\"//div[contains(@class,'warningBox')]\").each { |node| puts node}\nend",
"def server_probably_launched?\n success? || server_error?\n end",
"def server_status_alerts\n require 'rubygems'\n\n alerts = []\n\n if check_json_ext?\n msg = <<-MSG.strip.gsub(/\\s+/, \" \")\n <h4>JSON C extension not found.</h4>\n Falling back to the pure Ruby variant. <code>gem install json</code> for better performance.\n MSG\n alerts << {:level => 'warning', :msg => msg}\n end\n\n # It would be awesome if we didn't have to resort to this :)\n if Gem::Specification.respond_to? :find_all\n\n if check_bson_ext?\n Gem.refresh\n\n installed = Gem::Specification.find_all { |s| s.name == 'mongo' }.map { |s| s.version }.sort.last\n if Gem::Specification.find_all { |s| s.name == 'bson_ext' && s.version == installed }.empty?\n msg = <<-MSG.strip.gsub(/\\s+/, \" \")\n <h4>MongoDB driver C extension not found.</h4>\n Install this extension for better performance: <code>gem install bson_ext -v #{installed}</code>\n MSG\n alerts << {:level => 'warning', :msg => msg}\n else\n msg = <<-MSG.strip.gsub(/\\s+/, \" \")\n <h4>Restart required</h4>\n You have recently installed the <tt>bson_ext</tt> extension.\n Run <code>genghisapp --kill</code> then restart <code>genghisapp</code> to use it.\n MSG\n alerts << {:level => 'info', :msg => msg}\n end\n end\n\n unless ENV['GENGHIS_NO_UPDATE_CHECK']\n require 'open-uri'\n\n Gem.refresh\n\n latest = nil\n installed = Gem::Specification.find_all { |s| s.name == 'genghisapp' }.map { |s| s.version }.sort.last\n running = Gem::Version.new(Genghis::VERSION.gsub(/[\\+_-]/, '.'))\n\n begin\n open('https://raw.github.com/bobthecow/genghis/master/VERSION') do |f|\n latest = Gem::Version.new(f.read.gsub(/[\\+_-]/, '.'))\n end\n rescue\n # do nothing...\n end\n\n if latest && (installed || running) < latest\n msg = <<-MSG.strip.gsub(/\\s+/, \" \")\n <h4>A Genghis update is available</h4>\n You are running Genghis version <tt>#{Genghis::VERSION}</tt>. The current version is <tt>#{latest}</tt>.\n Visit <a href=\"http://genghisapp.com\">genghisapp.com</a> for more information.\n MSG\n alerts << {:level => 'warning', :msg => msg}\n elsif installed && running < installed\n msg = <<-MSG.strip.gsub(/\\s+/, \" \")\n <h4>Restart required</h4>\n You have installed Genghis version <tt>#{installed}</tt> but are still running <tt>#{Genghis::VERSION}</tt>.\n Run <code>genghisapp --kill</code> then restart <code>genghisapp</code>.\n MSG\n alerts << {:level => 'info', :msg => msg}\n end\n end\n\n end\n\n alerts\n end",
"def server_status_alerts\n require 'rubygems'\n\n alerts = []\n\n if check_json_ext?\n msg = <<-MSG.strip.gsub(/\\s+/, \" \")\n <h4>JSON C extension not found.</h4>\n Falling back to the pure Ruby variant. <code>gem install json</code> for better performance.\n MSG\n alerts << {:level => 'warning', :msg => msg}\n end\n\n # It would be awesome if we didn't have to resort to this :)\n if Gem::Specification.respond_to? :find_all\n\n if check_bson_ext?\n Gem.refresh\n\n installed = Gem::Specification.find_all { |s| s.name == 'mongo' }.map { |s| s.version }.sort.last\n if Gem::Specification.find_all { |s| s.name == 'bson_ext' && s.version == installed }.empty?\n msg = <<-MSG.strip.gsub(/\\s+/, \" \")\n <h4>MongoDB driver C extension not found.</h4>\n Install this extension for better performance: <code>gem install bson_ext -v #{installed}</code>\n MSG\n alerts << {:level => 'warning', :msg => msg}\n else\n msg = <<-MSG.strip.gsub(/\\s+/, \" \")\n <h4>Restart required</h4>\n You have recently installed the <tt>bson_ext</tt> extension.\n Run <code>genghisapp --kill</code> then restart <code>genghisapp</code> to use it.\n MSG\n alerts << {:level => 'info', :msg => msg}\n end\n end\n\n unless ENV['GENGHIS_NO_UPDATE_CHECK']\n require 'open-uri'\n\n Gem.refresh\n\n latest = nil\n installed = Gem::Specification.find_all { |s| s.name == 'genghisapp' }.map { |s| s.version }.sort.last\n running = Gem::Version.new(Genghis::VERSION.gsub(/[\\+_-]/, '.'))\n\n begin\n open('https://raw.github.com/bobthecow/genghis/master/VERSION') do |f|\n latest = Gem::Version.new(f.read.gsub(/[\\+_-]/, '.'))\n end\n rescue\n # do nothing...\n end\n\n if latest && (installed || running) < latest\n msg = <<-MSG.strip.gsub(/\\s+/, \" \")\n <h4>A Genghis update is available</h4>\n You are running Genghis version <tt>#{Genghis::VERSION}</tt>. The current version is <tt>#{latest}</tt>.\n Visit <a href=\"http://genghisapp.com\">genghisapp.com</a> for more information.\n MSG\n alerts << {:level => 'warning', :msg => msg}\n elsif installed && running < installed\n msg = <<-MSG.strip.gsub(/\\s+/, \" \")\n <h4>Restart required</h4>\n You have installed Genghis version <tt>#{installed}</tt> but are still running <tt>#{Genghis::VERSION}</tt>.\n Run <code>genghisapp --kill</code> then restart <code>genghisapp</code>.\n MSG\n alerts << {:level => 'info', :msg => msg}\n end\n end\n\n end\n\n alerts\n end",
"def warning\n state(\"warning\")\n end",
"def warn\n\n end",
"def safe(quiet = false)\n begin\n yield\n rescue NoFreeConnectionError => e\n disable!\n custom_data['disabled_reason'] = :no_free_connections\n custom_data['disabled_description'] = 'Cannot find free connection or create new one'\n logger.error \"#{e}\\n#{e.backtrace}\" \n rescue => e\n unless quiet\n disable!\n custom_data['disabled_reason'] = :uncaught_error\n custom_data['disabled_description'] = \"Uncaught error #{e}. See logs for details\"\n end\n logger.error \"Unspecified error #{e}\\n#{e.backtrace}\" \n end\n end",
"def server_errors; end",
"def has_failed?(server)\n Thread.current[:failed_sessions].include?(server)\n end",
"def eligable_for_cleanup?(server)\n\t\treturn server.max_idle_time && server.max_idle_time != 0\n\tend",
"def accounts_not_available\n flash[:warning] = I18n.t(:user_system_down)\n redirect_to root_url\n end",
"def check_host\n # rubocop:disable Style/GuardClause\n if config[:host] == '0.0.0.0'\n logger.warn 'Will listen on all interfaces (0.0.0.0).' \\\n ' Consider using 127.0.0.1 (--host option).'\n end\n # rubocop:enable Style/GuardClause\n end",
"def check_host\n # rubocop:disable Style/GuardClause\n if config[:host] == '0.0.0.0'\n logger.warn 'Will listen on all interfaces (0.0.0.0).' \\\n ' Consider using 127.0.0.1 (--host option).'\n end\n # rubocop:enable Style/GuardClause\n end",
"def alert\n unless self.healthy?\n # Do not send the alert when there are name resolution problems. Most of\n # the time, this is simply due to the DNS server being unavailable.\n unless self.error =~ /Couldn't resolve host name/i\n ip_relay.alert({\n :environment => {\n :id => self.environment.id,\n :name => self.environment.name,\n :url => self.environment.url\n },\n :site => self.environment.site.name,\n :commands => self.environment.ip_relay_commands,\n :url => \"#{Settings.checkups[:url]}#{self.id}\"\n })\n end\n end\n end",
"def online_problem\n return if check_offline_object(@problem)\n end",
"def check_wallet_warnings\n @messages = {}\n # do we have cards?\n @messages[:expired_card] = MESSAGES[:expired_card] if cards.any?(&:expired?)\n @messages[:empty_wallet] = MESSAGES[:empty_wallet] if @cards.length < 1\n # always true, dont stop other callbacks\n true\n end",
"def disabled_warnings\n Dynamic[:disabled_warnings]\n end",
"def warning(text)\n GitPusshuTen::Log.warning(text)\n end",
"def log_license_deprecation_warn(url)\n @logger.warn(\"DEPRECATION WARNING: Connecting to an OSS distribution of Elasticsearch using the default distribution of Logstash will stop working in Logstash 8.0.0. Please upgrade to the default distribution of Elasticsearch, or use the OSS distribution of Logstash\", :url => url.sanitized.to_s)\n end",
"def print_seats_unavailable\n puts \"#{@unavailable_seats} Not available, Please select different seats \"\n end",
"def status_is_servererror?\n\t\treturn self.status_category == 5\n\tend",
"def instagram_rate_limit_warning(rate_limit_remaining, url)\n # Key-based expiration\n @rate_limit_remaining = rate_limit_remaining\n @url = url\n cache_key = [\"instagram_rate_limit_warning\", Time.now.hour]\n return nil if Rails.cache.fetch cache_key\n Rails.cache.write cache_key, true\n mail subject: \"[#{AppConfig.app_name}] WARNING: Instagram rate limit low\"\n end",
"def availability_check_timeout(msg_id)\n logger.availability_check(\"Receptor doesn't respond for Source (ID #{source_id}) | (message id: #{msg_id})\", :error)\n update_source_and_subresources(STATUS_UNAVAILABLE, ERROR_MESSAGES[:receptor_not_responding])\n metrics&.record_operation(operation.sub('#', '.'), :status => operation_status[:error])\n end",
"def warning(msg) log(4, msg); end",
"def check_server_status\n @server_status_array = Array.new(@lpar_id_array)\n until @server_status_array.empty?\n @server_status_array.each do |lpar|\n lpar_name_index = @server_status_array.find_index(lpar)\n @lpar_name_deployed = @lpar_name_array[lpar_name_index]\n puts \"Checking status of #{@lpar_name_deployed}\"\n get_url('compute')\n @server_status = rest_get(\"#{@resource_url}/servers/#{lpar}\", @token_id)\n @server_id_status = JSON.parse(@server_status)['server']['status']\n puts \"Status of #{@lpar_name_deployed} is #{@server_id_status}\"\n if @server_id_status =~ /ACTIVE/ || @server_id_status =~ /ERROR/\n @server_status_array.delete(lpar)\n else\n puts 'Waiting for 20 seconds'\n sleep 20\n end\n end\n end\n puts 'All LPARs have been deployed, proceed to login to the LPARs.'\n end",
"def warnings\n @tracker.warnings\n end",
"def server_error?\n @status.between?(500, 599) if @status\n end",
"def error\n\tyield\n\tif @changedConfigDir or @changedConfigFile\n\t\tif @opts[:stealth]\n\t\t\tstealth\n\t\telse\n\t\t\tLog.warn \"Permanent changes to the servers configuration have been made, these will have to be undone to stay hidden\"\n\t\tend\n\tend\n\texit 1\nend",
"def alert_all(message = \"<important>Server is shutting down, sorry!</important>\", ignore_lost = true)\n @game_objects.find_all('class', Player).each do |object|\n begin\n unless ignore_lost and object.container.nil?\n object.output message\n end\n rescue\n end\n end\n end",
"def warn(msg)\n Chef::Log.warn(msg)\n end",
"def host_unreachable_exceptions\n [::Faraday::Error::ConnectionFailed, ::Faraday::Error::TimeoutError]\n end",
"def host_unreachable_exceptions\n [::Faraday::Error::ConnectionFailed, ::Faraday::Error::TimeoutError]\n end",
"def render_503(message = nil)\n errors = JsonApiServer.errors(\n status: 500,\n title: I18n.t('json_api_server.render_503.title'),\n detail: message || I18n.t('json_api_server.render_503.detail')\n )\n render json: errors.to_json, status: 503\n end",
"def ulimit_check\n @servers.each do |server|\n result = server.spot_check_command(\"su - mysql -s /bin/bash -c \\\"ulimit -n\\\"\")\n raise \"FATAL: ulimit wasn't set correctly\" unless result[:output].to_i >= 1024\n end\n end",
"def failed!(server)\n Thread.current[:failed_sessions] << server\n end",
"def acquire_maintenance_data\n result = Diplomat::Health.node(config[:node]).select do |check|\n check['CheckID'] == '_node_maintenance'\n end\n if !result.empty?\n { enabled: true, reason: result.first['Notes'] }\n else\n { enabled: false, reason: nil }\n end\n rescue Faraday::ConnectionFailed => e\n warning \"Connection error occurred: #{e}\"\n rescue Faraday::ClientError => e\n if e.response[:status] == 403\n critical %(ACL token is not authorized to access resource: #{e.response[:body]})\n else\n unknown \"Exception occurred when checking consul service: #{e}\"\n end\n rescue StandardError => e\n unknown \"Exception occurred when checking consul node maintenance: #{e}\"\n end",
"def warning(context, options = nil)\n options = options.merge(level: 'warning')\n log(context, options)\n end"
] | [
"0.6361353",
"0.6191853",
"0.61414224",
"0.60870624",
"0.60433996",
"0.5995705",
"0.59831613",
"0.59126437",
"0.5882191",
"0.57987726",
"0.57576466",
"0.57331866",
"0.57167315",
"0.5689741",
"0.56821626",
"0.5672402",
"0.5661423",
"0.5656712",
"0.56450856",
"0.5639436",
"0.5639063",
"0.561942",
"0.55596185",
"0.54929423",
"0.54825366",
"0.5446531",
"0.5442765",
"0.5442586",
"0.544221",
"0.54177284",
"0.539767",
"0.5397595",
"0.53665954",
"0.5358566",
"0.5345241",
"0.5345241",
"0.5345241",
"0.53274673",
"0.53263223",
"0.5321682",
"0.5317684",
"0.53052574",
"0.53049725",
"0.5299409",
"0.5298738",
"0.52956617",
"0.52892447",
"0.5286035",
"0.5268026",
"0.5260707",
"0.5257437",
"0.52482206",
"0.52450335",
"0.52376395",
"0.5237598",
"0.5229582",
"0.5221954",
"0.5221564",
"0.52173287",
"0.520108",
"0.5200488",
"0.51901513",
"0.5189933",
"0.518605",
"0.5185873",
"0.51846325",
"0.51846325",
"0.5182443",
"0.5180011",
"0.5174163",
"0.51713455",
"0.5167189",
"0.5159311",
"0.5158409",
"0.51541585",
"0.51541585",
"0.5149519",
"0.51342285",
"0.51305413",
"0.5130339",
"0.51238406",
"0.51210266",
"0.51196295",
"0.51149696",
"0.51040643",
"0.51022774",
"0.5102273",
"0.50907564",
"0.5090195",
"0.50889003",
"0.5088396",
"0.50873435",
"0.5080011",
"0.506768",
"0.506768",
"0.5057436",
"0.505663",
"0.5053631",
"0.5052524",
"0.504502"
] | 0.827108 | 0 |
Internal handler for PRESENCE_UPDATE | def update_presence(data)
# Friends list presences have no server ID so ignore these to not cause an error
return unless data['guild_id']
user_id = data['user']['id'].to_i
server_id = data['guild_id'].to_i
server = server(server_id)
return unless server
member_is_new = false
if server.member_cached?(user_id)
member = server.member(user_id)
else
# If the member is not cached yet, it means that it just came online from not being cached at all
# due to large_threshold. Fortunately, Discord sends the entire member object in this case, and
# not just a part of it - we can just cache this member directly
member = Member.new(data, server, self)
debug("Implicitly adding presence-obtained member #{user_id} to #{server_id} cache")
member_is_new = true
end
username = data['user']['username']
if username && !member_is_new # Don't set the username for newly-cached members
debug "Implicitly updating presence-obtained information for member #{user_id}"
member.update_username(username)
end
member.update_presence(data)
member.avatar_id = data['user']['avatar'] if data['user']['avatar']
server.cache_member(member)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_resume\n\n end",
"def update_resume\n\n end",
"def update\n\t\t# Left empty intentionally.\n\tend",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update\n \n end",
"def update ; end",
"def update\n # Not generally used\n end",
"def update\n # Not generally used\n end",
"def update\n \t\n end",
"def update\n \t\n end",
"def update\n @isCreation = false\n respond_to do |format|\n if @passage.update(passage_params.except(:annotation_code))\n @proceed = true\n format.html { redirect_to @passage, notice: 'Passage was successfully updated.' }\n format.json { render :show, status: :ok, location: @passage }\n else\n format.html { render :edit }\n format.json { render json: @passage.errors, status: :unprocessable_entity }\n end\n end\n\n if @proceed\n UpdateTrack.create!(last_user_id: current_user.id, passage_id: @passage.id, nature: 'edited passage', annotation_code: passage_params[:annotation_code], main_content: @passage.content)\n end\n end",
"def update!(**args)\n @extended_verdict_reasons = args[:extended_verdict_reasons] if args.key?(:extended_verdict_reasons)\n @reasons = args[:reasons] if args.key?(:reasons)\n @score = args[:score] if args.key?(:score)\n end",
"def on_update; end",
"def update\n \n end",
"def update\n \n end",
"def update\n \n end",
"def update\n \n end",
"def update\n \n end",
"def update\n \n end",
"def update\n \n end",
"def update\n \n end",
"def update\n \n end",
"def update\n \n end",
"def update; end",
"def update!(**args)\n @book_confidence = args[:book_confidence] if args.key?(:book_confidence)\n @is_video_game = args[:is_video_game] if args.key?(:is_video_game)\n @movie_confidence = args[:movie_confidence] if args.key?(:movie_confidence)\n @video_game_confidence = args[:video_game_confidence] if args.key?(:video_game_confidence)\n end",
"def update(...)\n end",
"def update \n end",
"def update \n end",
"def update!(**args)\n @provenance = args[:provenance] if args.key?(:provenance)\n end",
"def update\n \n end",
"def update\n handle_orcamento_update\n end",
"def update;end",
"def update\n\n end",
"def update\n\n end",
"def update\n\n end",
"def update\n\n end",
"def update\n\n end",
"def update\n\n end",
"def update\n\n end",
"def update\n\n end",
"def update\n\n end",
"def update\n\n end",
"def update\n\n end",
"def update\n\n end",
"def update\n\n end",
"def update\n\n end",
"def update\n\n end",
"def update\n\n end",
"def update\n\n end",
"def update\n\n end",
"def update\n\n end",
"def update\n\n end",
"def update\n\n end",
"def update\n\n end",
"def update\n\n end",
"def update\n\n end",
"def update\n\n end",
"def update\n\n end",
"def update\n\n end",
"def update\n\n end",
"def update\n\n end",
"def update\n\n end",
"def update\n\n end",
"def update\n\n end",
"def update\n\n end",
"def update\n\n end",
"def update!(**args)\n @field_provenance = args[:field_provenance] if args.key?(:field_provenance)\n end",
"def update\r\n end",
"def before_update; end",
"def update\n \n end",
"def update\n \n end",
"def update\n \n end",
"def update\n \n end",
"def update\n \n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end"
] | [
"0.61999214",
"0.61999214",
"0.6170997",
"0.61203206",
"0.61203206",
"0.61203206",
"0.61203206",
"0.61203206",
"0.61203206",
"0.61203206",
"0.61203206",
"0.60825586",
"0.6077589",
"0.60676974",
"0.60676974",
"0.60549814",
"0.60549814",
"0.60369676",
"0.60238826",
"0.6018666",
"0.60054535",
"0.60054535",
"0.60054535",
"0.60054535",
"0.60054535",
"0.60054535",
"0.60054535",
"0.60054535",
"0.60054535",
"0.60054535",
"0.60030544",
"0.5999121",
"0.59942573",
"0.59939164",
"0.5986473",
"0.5945047",
"0.59413815",
"0.59408003",
"0.5933857",
"0.5928426",
"0.5928426",
"0.5928426",
"0.5928426",
"0.5928426",
"0.5928426",
"0.5928426",
"0.5928426",
"0.5928426",
"0.5928426",
"0.5928426",
"0.5928426",
"0.5928426",
"0.5928426",
"0.5928426",
"0.5928426",
"0.5928426",
"0.5928426",
"0.5928426",
"0.5928426",
"0.5928426",
"0.5928426",
"0.5928426",
"0.5928426",
"0.5928426",
"0.5928426",
"0.5928426",
"0.5928426",
"0.5928426",
"0.5928426",
"0.5928426",
"0.5928426",
"0.5928426",
"0.5928426",
"0.59167",
"0.59156865",
"0.59142447",
"0.5897047",
"0.5897047",
"0.5897047",
"0.5897047",
"0.5897047",
"0.58816916",
"0.58816916",
"0.58816916",
"0.58816916",
"0.58816916",
"0.58816916",
"0.58816916",
"0.58816916",
"0.58816916",
"0.58816916",
"0.58816916",
"0.58816916",
"0.58816916",
"0.58816916",
"0.58816916",
"0.58816916",
"0.58816916",
"0.58816916",
"0.58816916",
"0.58816916"
] | 0.0 | -1 |
Internal handler for VOICE_STATE_UPDATE | def update_voice_state(data)
@session_id = data['session_id']
server_id = data['guild_id'].to_i
server = server(server_id)
return unless server
user_id = data['user_id'].to_i
old_voice_state = server.voice_states[user_id]
old_channel_id = old_voice_state.voice_channel&.id if old_voice_state
server.update_voice_state(data)
existing_voice = @voices[server_id]
if user_id == @profile.id && existing_voice
new_channel_id = data['channel_id']
if new_channel_id
new_channel = channel(new_channel_id)
existing_voice.channel = new_channel
else
voice_destroy(server_id)
end
end
old_channel_id
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def voice_state_update(attributes = {}, &block)\n register_event(VoiceStateUpdateEvent, attributes, block)\n end",
"def update_voice_state(data)\n server_id = data['guild_id'].to_i\n server = server(server_id)\n return unless server\n\n server.update_voice_state(data)\n\n @session_id = data['session_id']\n end",
"def sdk_update_status(instance)\n if raw_power_state != instance.status\n update!(:raw_power_state => instance.status) if raw_power_state != instance.status\n $ibm_cloud_log.info(\"VM instance #{instance.id} state is #{raw_power_state}\")\n end\n end",
"def sdk_update_status(instance)\n if raw_power_state != instance.status\n update!(:raw_power_state => instance.status) if raw_power_state != instance.status\n $ibm_cloud_log.info(\"VM instance #{instance.id} state is #{raw_power_state}\")\n end\n end",
"def update!(**args)\n @required_state_values = args[:required_state_values] if args.key?(:required_state_values)\n @simple_tts = args[:simple_tts] if args.key?(:simple_tts)\n @status = args[:status] if args.key?(:status)\n end",
"def update\n \t@currentState.update\n\tend",
"def update\n super\n if BattleManager.in_turn?\n process_event\n process_action\n end\n BattleManager.judge_win_loss unless BattleManager.victory_phase?\n if BattleManager.victory_phase?\n if @victory_score.done and @victory_score.active\n sfx = CP::VICTORY::IMAGE_SFX\n vol = CP::VICTORY::SFX_VOL\n pit = CP::VICTORY::SFX_PIT\n RPG::SE.new(sfx, vol, pit).play unless sfx.nil?\n @victory_score.active = false\n @victory_item.active = true\n end\n end\n end",
"def voice_state_update(guild_id, channel_id, self_mute: false, self_deaf: false)\n opts = {\n guild_id: guild_id, channel_id: channel_id, self_mute: self_mute,\n self_deaf: self_deaf\n }.compact\n\n send_packet(OPCODES[:VOICE_STATE_UPDATE], opts)\n end",
"def update!(**args)\n @state = args[:state] if args.key?(:state)\n @status_events = args[:status_events] if args.key?(:status_events)\n end",
"def update_appeal_state_on_status_change\n update_appeal_state_when_ihp_cancelled\n update_appeal_state_when_ihp_completed\n update_appeal_state_when_privacy_act_cancelled\n update_appeal_state_when_privacy_act_complete\n update_appeal_state_when_appeal_cancelled\n end",
"def update_state\r\n case @state\r\n when STATE_PICK\r\n @ip1.copy! @ip\r\n Sketchup::set_status_text \"[WALL] Click for end of wall\"\r\n Sketchup::set_status_text \"Length\", SB_VCB_LABEL\r\n Sketchup::set_status_text \"\", SB_VCB_VALUE\r\n @state = STATE_PICK_NEXT\r\n\twhen STATE_PICK_NEXT\r\n\t\tself.draw_wall\r\n\t\treset\r\n end\r\nend",
"def on_update; end",
"def update\n @saving_allowed = false\n update_state\n update_dialog\n end",
"def send_voice_state_update(server_id, channel_id, self_mute, self_deaf)\n data = {\n guild_id: server_id,\n channel_id: channel_id,\n self_mute: self_mute,\n self_deaf: self_deaf\n }\n\n send_packet(Opcodes::VOICE_STATE, data)\n end",
"def update(state_manager, game)\n\n end",
"def update\n super\n @ucCharStatus.ucActStates.update()\n end",
"def update_state\n raise \"Nothing to do\"\n end",
"def update!(**args)\n @state = args[:state] if args.key?(:state)\n @state_message = args[:state_message] if args.key?(:state_message)\n end",
"def change_status(status)\n #not implemented \n end",
"def state_on_updateclient\n @log.debug(\"Net_state: change to state state_on_updateclient\")\n @network_state = :state_on_updateclient\n make_state_change_ntfy(:ntfy_state_onupdate)\n end",
"def status_update(name, dice, saved=nil)\n end",
"def update(arg)\n state = arg[:state]\n case state\n when :stop\n nextTrack\n end\n end",
"def update(arg)\n state = arg[:state]\n case state\n when :stop\n nextTrack\n end\n end",
"def update_state\n puts \"******* update_state *******\"\n puts \"** params.inspect: #{params.inspect}\"\n puts \"** params[:event]: #{params[:event]}\"\n # events: submit process ship deliver confirm cancel\n @msg = \"result state: \"\n\n if params[:event] == \"submit\"\n if @@ORDER_STATE == nil\n @state = 1\n update_order(@msg)\n else\n @msg = \"previous status: #{@@ORDER_STATE}\"\n flash[:notice] = @msg\n end\n elsif params[:event] == \"process\"\n if @@ORDER_STATE == \"ordered\"\n @state = 2\n update_order(@msg)\n else\n @msg = \"previous status: #{@@ORDER_STATE}\"\n flash[:notice] = @msg\n end\n elsif params[:event] == \"ship\"\n if @@ORDER_STATE == \"processing\"\n @state = 3\n update_order(@msg)\n else\n @msg = \"previous status: #{@@ORDER_STATE}\"\n flash[:notice] = @msg\n end\n elsif params[:event] == \"deliver\"\n if @@ORDER_STATE == \"shipping\"\n @state = 4\n update_order(@msg)\n else\n @msg = \"previous status: #{@@ORDER_STATE}\"\n flash[:notice] = @msg\n end\n elsif params[:event] == \"confirm\"\n if @@ORDER_STATE == \"delivered\"\n @state = 5\n update_order(@msg)\n else\n @msg = \"previous status: #{@@ORDER_STATE}\"\n flash[:notice] = @msg\n end\n elsif params[:event] == \"cancel\"\n @state = 6\n update_order(@msg)\n else\n @state = 0\n update_order(@msg)\n end\n # logs the current state\n # print_state\n puts \"** @state: #{@state}\"\n end",
"def update!(**args)\n @state = args[:state] if args.key?(:state)\n end",
"def update!(**args)\n @state = args[:state] if args.key?(:state)\n end",
"def update!(**args)\n @state = args[:state] if args.key?(:state)\n end",
"def update!(**args)\n @state = args[:state] if args.key?(:state)\n end",
"def update!(**args)\n @state = args[:state] if args.key?(:state)\n end",
"def update!(**args)\n @state = args[:state] if args.key?(:state)\n end",
"def update!(**args)\n @state = args[:state] if args.key?(:state)\n end",
"def on_state_timeup(state_id)\n end",
"def after_updation\n \n @card = CardDetail.find_by_card_id(session[:card_id]) \n @card.status = params[:status]\n @card.save\n end",
"def update\n handle_orcamento_update\n end",
"def game_state\n end",
"def update_status_on_inventory_change\n if self.inventory_changed?\n if self.inventory.zero?\n self.status = :out_of_stock\n else\n self.status = :in_stock\n end\n end\n end",
"def update\n super\n @ucActStates.update()\n end",
"def update!(**args)\n @state = args[:state] if args.key?(:state)\n @time_completed = args[:time_completed] if args.key?(:time_completed)\n end",
"def updatestate\n @attributes.fetch('updatestate', 0)\n end",
"def update\n update_phase\n end",
"def update\n respond_to do |format|\n if @event_state.update(event_state_params)\n format.html { redirect_to @event_state, notice: 'Event state was successfully updated.' }\n format.json { render :show, status: :ok, location: @event_state }\n else\n format.html { render :edit }\n format.json { render json: @event_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n return if $BTEST\r\n @time = $game_variables[LTS::TIME_VARIABLE_ID]\r\n if @time >= 1440\r\n @time %= 1440\r\n end\r\n @hour = @time/60\r\n @minute = @time%60\r\n $game_variables[LTS::HOUR_VARIABLE_ID] = @hour unless LTS::HOUR_VARIABLE_ID == nil\r\n $lts_time = sprintf(\"%02d:%02d\", @hour, @minute)\r\n if $lts_event_tone\r\n update_tone(0) if $lts_map_data[$game_map.map_id].part_outside?\r\n else\r\n $game_map.screen.start_tone_change(Tone.new(0,0,0,0),0)\r\n update_tone(0) if $lts_map_data[$game_map.map_id].outside?\r\n end\r\n end",
"def invoice_status_changed(data)\n @subscription = ::Subscription.find_by(iugu_id: data[:subscription_id])\n @subscription.update(iugu_payment_status: data[:status])\n end",
"def update\r\n handle_venda_update\r\n end",
"def on?; self.refresh!['state']['on']; end",
"def update() end",
"def update_status\r\n # If B button was pressed\r\n if Input.trigger?(Input::B)\r\n # Play cancel SE\r\n $game_system.se_play($data_system.cancel_se)\r\n # Make command window active\r\n @command_window.active = true\r\n @status_window.active = false\r\n @status_window.index = -1\r\n return\r\n end\r\n # If C button was pressed\r\n if Input.trigger?(Input::C)\r\n # Branch by command window cursor position\r\n case @command_window.index\r\n when 1 # skill\r\n # If this actor's action limit is 2 or more\r\n if $game_party.actors[@status_window.index].restriction >= 2\r\n # Play buzzer SE\r\n $game_system.se_play($data_system.buzzer_se)\r\n return\r\n end\r\n # Play decision SE\r\n $game_system.se_play($data_system.decision_se)\r\n # Switch to skill screen\r\n $scene = Scene_Skill.new(@status_window.index)\r\n when 2 # equipment\r\n # Play decision SE\r\n $game_system.se_play($data_system.decision_se)\r\n # Switch to equipment screen\r\n $scene = Scene_Equip.new(@status_window.index)\r\n when 3 # status\r\n # Play decision SE\r\n $game_system.se_play($data_system.decision_se)\r\n # Switch to status screen\r\n $scene = Scene_Status.new(@status_window.index)\r\n end\r\n return\r\n end\r\n end",
"def update_status(type, state)\n if [:auth, :api, :router, :broker].include?(type)\n case state\n when :connected\n if @agent.mode == :http\n # Require connectivity to both API and router to be considered fully connected\n status = @agent.client.status\n if status[:api] == :connected && status[:router] == :connected\n RightScale::Sender.instance.disable_offline_mode\n end\n else\n RightScale::Sender.instance.disable_offline_mode\n end\n when :disconnected\n RightScale::Sender.instance.enable_offline_mode\n when :failed\n RightScale::Log.error(\"RightNet connectivity failure for #{type}, need to re-enroll\")\n # Randomize when re-enroll to prevent possibly having multiple instances do so simultaneously\n EM.add_timer(rand(MAX_REENROLL_DELAY)) { RightScale::ReenrollManager.reenroll! }\n when :authorized, :unauthorized, :expired, :closing\n else\n RightScale::Log.error(\"Unrecognized state for #{type}: #{state}\")\n end\n end\n true\n end",
"def state\n end",
"def update\n respond_to do |format|\n if @call_status.update(call_status_params)\n format.html { redirect_to @call_status, notice: 'Call status was successfully updated.' }\n format.json { render :show, status: :ok, location: @call_status }\n else\n format.html { render :edit }\n format.json { render json: @call_status.errors, status: :unprocessable_entity }\n end\n end\n end",
"def answer_on_incoming()\n update({:state => 'active'})\n reload()\n end",
"def voting!\n update_attributes(:state_name => \"voting\")\n end",
"def set_StatusUpdate(value)\n set_input(\"StatusUpdate\", value)\n end",
"def update_status\n # Get save data status\n if save_data?\n @info_window.lines[2].replace(_INTL('Found '), 2)\n elsif save_backup?\n @info_window.lines[2].replace(_INTL('Can restore '), 2)\n else\n @info_window.lines[2].replace(_INTL('Not found '), 2)\n end\n # Get backup status\n if save_backup?\n @info_window.lines[4].replace(_INTL('Found '), 2)\n else\n @info_window.lines[4].replace(_INTL('Not found '), 2)\n end\n # Check whether the game should be restarted\n if @restart\n @info_window.lines[5].replace(_INTL(' Type \\'exit\\' to restart'))\n end\n end",
"def update_status\n # If B button was pressed\n if Input.trigger?(Input::B)\n # Play cancel SE\n $game_system.se_play($data_system.cancel_se)\n # Make command sprite active\n @command_window.active = true\n @status_window.active = false\n @status_window.index = -1\n return\n end\n # If C button was pressed\n if Input.trigger?(Input::C)\n # Branch by command sprite cursor position\n case @command_window.index\n when 1 # skill\n # If this actor's action limit is 2 or more\n if $game_party.actors[@status_window.index].restriction >= 2\n # Play buzzer SE\n $game_system.se_play($data_system.buzzer_se)\n return\n end\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Switch to skill screen\n $scene = Scene_Skill.new(@status_window.index)\n when 2 # equipment\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Switch to equipment screen\n $scene = Scene_Equip.new(@status_window.index)\n when 3 # status\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Switch to status screen\n $scene = Scene_Status.new(@status_window.index)\n end\n return\n end\n end",
"def update!(**args)\n @feedback_chip_type = args[:feedback_chip_type] if args.key?(:feedback_chip_type)\n @state = args[:state] if args.key?(:state)\n end",
"def update\n if @state.update(state_params)\n render json: @state\n # 'State was successfully updated.'\n else\n render json: @state.errors, status: :unprocessable_entity\n end\n end",
"def update\n # update_move\n # update_tone_change\n update_rotate\n end",
"def update\n case @game_settings.current_screen\n when \"start\"\n start_screen_inputs\n when \"levels\"\n levels_screen_inputs\n when \"game\"\n if @deck.deck_count == 0 || valid_table(@playing_cards).length == 0\n @game_settings.current_screen = \"gameover\"\n end\n\n if @game_settings.is_cpu_player_enabled\n @mes = computer_move @p1 if @computer_signal.update?\n @true_mes = (@mes == 1) && @computer_signal.display_message?\n @false_mes = (@mes == 0) && @computer_signal.display_message?\n @trying_mes = (@mes == 2) && @computer_signal.display_message?\n end\n\n if @game_settings.p1_init\n game_screen_inputs @p1\n @p2.clean_slate if @game_settings.p2_init && @p1.set_found\n @p1.set_found = false #reset\n end\n\n if @game_settings.p2_init\n game_screen_inputs @p2\n @p1.clean_slate if @game_settings.p1_init && @p2.set_found\n @p2.set_found = false\n end\n\n when \"gameover\"\n game_over_screen_inputs\n end\n end",
"def refresh_basic_state\n get_source\n get_volume\n end",
"def game_state_update(parsed_state)\n\t\tgame_state = nil\n\t\t@mutex.synchronize do\n\t\t\t@seat_number = parsed_state['seat_number']\n\t\t\t@bankroll = parsed_state['player']['bankroll']\n\t\t\tgame_state = GameState.new(parsed_state, @player_id, parsed_state['hand'])\n\t\tend\n\t\t@mutex.synchronize do\n\t\t\tself.display_game_state(game_state) if self.respond_to?(:display_game_state)\n\t\t\tif game_state.is_acting_player? and game_state.hand\n\t\t\t\tbegin\n\t\t\t\t\tTimeout.timeout(game_state.timelimit) do\n\t\t\t\t\t\tmove = ask_for_move(game_state)\n\t\t\t\t\t\t@player_channel.publish({'table_id' => game_state.table_id,\n\t\t\t\t\t\t'command' => 'action', 'action' => move}.to_json)\n\t\t\t\t\tend\n\t\t\t\trescue Timeout::Error\n\t\t\t\t\tputs \"Took too long to make a move, folding\"\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend",
"def live\r\n @state=1\r\n end",
"def changed\n @status = true\n end",
"def on_state(state, &block)\n end",
"def state=(state)\n if not STATES.include? state\n raise PreconditionError, \"Invalid game victory state.\"\n end\n super\n changed(true)\n notify_observers U_COMPLETED, state, self.currentPlayer\n if not self.state == state\n raise PostconditionError, \"State not set correctly.\"\n end\n self.state\n end",
"def handle_status_change\n return nil unless self.new_status.present?\n self.status = self.new_status\n if self.new_status == 'active'\n # the user wants to make the ad active now so push out the inactive and deletion dates\n self.inactive_date = Time.now + 2.months\n self.delete_date = Time.now + 4.months\n elsif self.new_status == 'inactive'\n # the user wants to make the ad inactive now so make the inactive date to day and deletion in 2 months\n self.inactive_date = Time.now\n self.delete_date = Time.now + 2.months\n end\n end",
"def update!(**args)\n @contact_active_state = args[:contact_active_state] if args.key?(:contact_active_state)\n end",
"def state; end",
"def state; end",
"def state; end",
"def state; end",
"def state; end",
"def state; end",
"def state; end",
"def state; end",
"def update_status_for_the_table(game_status)\n dealer = game_status[:dealer_hand]\n player = game_status[:player_hand]\n player_stayed = game_status[:player_staying_on_hand]\n\n if dealer == player && player_stayed && dealer <= MAX_HAND_VALUE\n game_status[:current_game_status] = \"Hands are even!\"\n elsif player_stayed && (dealer > player) && dealer <= MAX_HAND_VALUE\n game_status[:current_game_status] = \"Game-over, Dealer won!\"\n elsif dealer > MAX_HAND_VALUE && player <= MAX_HAND_VALUE\n game_status[:current_game_status] = \"Game-over, Dealer busted - Player won!\"\n elsif player > MAX_HAND_VALUE && dealer <= MAX_HAND_VALUE\n game_status[:current_game_status] = \"Game-over, Player busted - Dealer won!\"\n else\n game_status[:current_game_status] = \"Game is live! Players turn\"\n end\n game_status\nend",
"def update_status_for_the_table(game_status)\n dealer = game_status[:dealer_hand]\n player = game_status[:player_hand]\n player_stayed = game_status[:player_staying_on_hand]\n\n if dealer == player && player_stayed && dealer <= MAX_HAND_VALUE\n game_status[:current_game_status] = \"Hands are even!\"\n elsif player_stayed && (dealer > player) && dealer <= MAX_HAND_VALUE\n game_status[:current_game_status] = \"Game-over, Dealer won!\"\n elsif dealer > MAX_HAND_VALUE && player <= MAX_HAND_VALUE\n game_status[:current_game_status] = \"Game-over, Dealer busted - Player won!\"\n elsif player > MAX_HAND_VALUE && dealer <= MAX_HAND_VALUE\n game_status[:current_game_status] = \"Game-over, Player busted - Dealer won!\"\n else\n game_status[:current_game_status] = \"Game is live! Players turn\"\n end\n game_status\nend",
"def update\n thing_name = params[:id]\n is_on = params[:on].to_i\n client = Broker::Wrapper.new(current_user, thing_name)\n result = client.set_state(is_on)\n\n result_hash = result.as_json\n render json: result_hash, status: 200\n end",
"def status_update(_event)\n @submitted = false\n @filed = false\n end",
"def update\n respond_to do |format|\n if @state_prov.update(state_prov_params)\n format.html { redirect_to @state_prov, notice: 'State prov was successfully updated.' }\n format.json { render :show, status: :ok, location: @state_prov }\n else\n format.html { render :edit }\n format.json { render json: @state_prov.errors, status: :unprocessable_entity }\n end\n end\n end",
"def knx_update(status)\n # Find widget for actual device\n @widget = self.class.find_by_id(self.id)\n # Update widget status\n if status.class == KNX4R::Status_of_Slider\n @widget.status = status.position.to_i\n else\n @widget.status = status\n end\n # Send the update to all running sessions\n unless ActionCable.server.logger.nil?\n ActionCable.server.broadcast 'widgets', {type: \"slider\", id: self.id, status: @widget.status}\n end\n end",
"def update\n \t\n end",
"def update\n \t\n end",
"def update_status\n # If B button was pressed\n if Input.trigger?(Input::B)\n # Play cancel SE\n $game_system.se_play($data_system.cancel_se)\n # Make command window active\n @command_window.active = true\n @status_window.active = false\n @status_window.index = -1\n return\n end\n # If C button was pressed\n if Input.trigger?(Input::C)\n # Branch by command window cursor position\n case @command_window.index\n when 1 # skill\n # If this actor's action limit is 2 or more\n if $game_party.actors[@status_window.index].restriction >= 2\n # Play buzzer SE\n $game_system.se_play($data_system.buzzer_se)\n return\n end\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Switch to skill screen\n $scene = Scene_Skill.new(@status_window.index)\n when 2 # equipment\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Switch to equipment screen\n $scene = Scene_Equip.new(@status_window.index)\n when 3 # piercings\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Switch to piercings screen\n $scene = Scene_Piercings.new(@status_window.index)\n when 5 # status\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Switch to status screen\n $scene = Scene_Status.new(@status_window.index)\n end\n return\n end\n end",
"def update\n run_callbacks :update do\n true\n end\n end",
"def update\n \n end",
"def game_state(game_id)\n\n end",
"def update!(**args)\n @application = args[:application] if args.key?(:application)\n @state_status = args[:state_status] if args.key?(:state_status)\n end",
"def update!(**args)\n @state_fetch_error = args[:state_fetch_error] if args.key?(:state_fetch_error)\n @timers = args[:timers] if args.key?(:timers)\n end",
"def update!(**args)\n @category_state = args[:category_state] if args.key?(:category_state)\n @channel_state = args[:channel_state] if args.key?(:channel_state)\n @notification_capabilities = args[:notification_capabilities] if args.key?(:notification_capabilities)\n end",
"def status_update\n @profile.update_attribute(\"status_message\", params[:value])\n render :text => @profile.send(\"status_message\") \n end",
"def passive_state_change!(state_details)\n api.state_change.create!(state_details)\n end",
"def state_changed\n @state_condition.signal @state\n end",
"def update_status\n case @part.status\n when 'Unstarted'\n @part.status = 'Started'\n @part.user = current_user\n @part.bitbucket.post_user(current_user.email) if @part.name == 'Prototype'\n @part.create_activity key: 'part.started', owner: current_user\n @part.start_rep_points\n when 'Started'\n @part.status = 'Finished'\n @part.create_activity key: 'part.finished', owner: current_user\n when 'Finished' \n @part.status = 'In Review'\n @part.create_activity key: 'part.in_review', owner: current_user\n when 'In Review'\n @part.status = 'Accepted'\n @part.accepted_rep_points\n @part.create_activity key: 'part.accepted', owner: current_user\n end\n @part.save\n redirect_to :back\n end",
"def machine_state_updated( machine_state )\n\t\t# update the display on the main queue\n\t\tXAL::DispatchQueue.getMainQueue().dispatchAsync( lambda {|| self.refresh_live_display } )\n\tend",
"def update ; end",
"def update_authorizationstate(update)\n case update.authorization_state\n when TD::Types::AuthorizationState::WaitPhoneNumber # stage 0: set login \n @logger.warn 'Logging in..'\n @telegram.set_authentication_phone_number(@session[:login], PERMISSIONS[:login]) if @session[:login]\n @xmpp.send_message(@jid, nil, 'Please, enter your Telegram login via /login 12345') if not @session[:login]\n when TD::Types::AuthorizationState::WaitCode # stage 1: wait for auth code \n @logger.warn 'Waiting for authorization code..'\n @xmpp.send_message(@jid, nil, 'Please, enter authorization code via /code 12345')\n when TD::Types::AuthorizationState::WaitPassword # stage 2: wait for 2fa\n @logger.warn 'Waiting for 2FA password..'\n @xmpp.send_message(@jid, nil, 'Please, enter 2FA passphrase via /password 12345')\n when TD::Types::AuthorizationState::Ready # stage 3: auth completed\n @session[:login] ||= @me.phone_number \n @logger.warn 'Authorization successful!'\n @telegram.get_me.then{|me| @me = me}.wait\n @telegram.get_chats(TD::Types::ChatList::Main.new, 9223372036854775807, 0, 999).wait\n @xmpp.send_presence(@jid, nil, :subscribe, nil, nil)\n @xmpp.send_presence(@jid, nil, :subscribed, nil, nil)\n @xmpp.send_presence(@jid, nil, nil, nil, \"Logged in as: %s\" % @session[:login])\n end\n end",
"def update_event_status\n event = wattball_match.event\n\n if event.status != \"played\"\n # If adding scores, then the match can be assumed to have been played\n event.status = \"played\"\n event.save\n end\n end",
"def update_controller_connection\n if @connected != Input.controller_connected?\n @connected = Input.controller_connected?\n @old_battery_state = Input.battery_level\n @option_window.refresh\n end\n if Input.battery_level != @old_battery_state\n @option_window.refresh\n @old_battery_state = Input.battery_level\n end\n end",
"def game_state_update(parsed_state)\n\t\tgame_state = nil\n\t\t@mutex.synchronize do\n\t\t\tif parsed_state['player_data'] and my_data = parsed_state['player_data'][@player_id.to_s]\n\t\t\t\thand = decrypt_hand(my_data['hand'])\n\t\t\t\t@hand_hash[parsed_state['hand_number']] = hand\n\t\t\t\t@seat_number = my_data['seat_number']\n\t\t\t\t@bankroll = my_data['player']['bankroll']\n\t\t\telse\n\t\t\t\thand = @hand_hash[parsed_state['hand_number']]\n\t\t\tend\n\t\t\tgame_state = GameState.new(parsed_state, @player_id, hand)\n\t\tend\n\t\t@mutex.synchronize do\n\t\t\tself.display_game_state(game_state) if self.respond_to?(:display_game_state)\n\t\t\tif game_state.is_acting_player? and game_state.hand\n\t\t\t\tbegin\n\t\t\t\t\t#Timeout.timeout(game_state.timelimit) do\n\t\t\t\t\t\tmove = ask_for_move(game_state)\n\t\t\t\t\t\tmove = 'fold' unless move\n\t\t\t\t\t\tmake_move(game_state, move)\n\t\t\t\t\t#end\n\t\t\t\t#rescue Timeout::Error\n\t\t\t\t\t#puts \"Took too long to make a move, folding\"\n\t\t\t\trescue\n\t\t\t\t\tputs \"Error: #{$!.inspect}\"\n\t\t\t\t\tpp $!.backtrace\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend"
] | [
"0.66678077",
"0.6266998",
"0.6186738",
"0.6186738",
"0.6149403",
"0.61267304",
"0.60902643",
"0.6052997",
"0.60195696",
"0.59829587",
"0.5965124",
"0.595698",
"0.5882775",
"0.5864108",
"0.58582145",
"0.58407634",
"0.58398664",
"0.5775996",
"0.5771805",
"0.57627153",
"0.57622576",
"0.5751369",
"0.5751369",
"0.5750034",
"0.5715891",
"0.5715891",
"0.5715891",
"0.5715891",
"0.5715891",
"0.5715891",
"0.5715891",
"0.56876326",
"0.56838727",
"0.56642705",
"0.5656059",
"0.56234336",
"0.5606617",
"0.559145",
"0.55869937",
"0.5584693",
"0.5583236",
"0.5579015",
"0.5576314",
"0.55373365",
"0.55264765",
"0.54974115",
"0.54969174",
"0.5495781",
"0.54874974",
"0.54844636",
"0.5481635",
"0.54732955",
"0.5468484",
"0.54603976",
"0.5457274",
"0.54508865",
"0.54475516",
"0.544671",
"0.5445228",
"0.5443973",
"0.5439308",
"0.54323685",
"0.5427526",
"0.5424516",
"0.5419303",
"0.5409896",
"0.540948",
"0.5387782",
"0.5387782",
"0.5387782",
"0.5387782",
"0.5387782",
"0.5387782",
"0.5387782",
"0.5387782",
"0.538113",
"0.538113",
"0.53792524",
"0.53786063",
"0.5376942",
"0.5374688",
"0.5366098",
"0.5366098",
"0.53653693",
"0.53632647",
"0.5357397",
"0.5355936",
"0.5353064",
"0.5347988",
"0.534093",
"0.53399265",
"0.53320324",
"0.5321758",
"0.5314916",
"0.5314875",
"0.53148717",
"0.53128",
"0.53111553",
"0.53088874",
"0.5308291"
] | 0.6511533 | 1 |
Internal handler for VOICE_SERVER_UPDATE | def update_voice_server(data)
server_id = data['guild_id'].to_i
channel = @should_connect_to_voice[server_id]
debug("Voice server update received! chan: #{channel.inspect}")
return unless channel
@should_connect_to_voice.delete(server_id)
debug('Updating voice server!')
token = data['token']
endpoint = data['endpoint']
unless endpoint
debug('VOICE_SERVER_UPDATE sent with nil endpoint! Ignoring')
return
end
debug('Got data, now creating the bot.')
@voices[server_id] = Discordrb::Voice::VoiceBot.new(channel, self, token, @session_id, endpoint)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def on_server_update(ev)\n\t\tif(cookies_are_tasty(ev.client,ev.cookie))\n\t\t\tev.client.is_nice=true\n\t\t\tmunch_on(ev.cookie)\n\t\tend\n\t\tif(not ev.client.is_nice)\n\t\t\tpost_event UnauthorizedConnectionEvent.new(ev.src)\n\t\t\treturn\n\t\tend\n\t\tif(ev.build_date!=SUPPORTED_VERSION)\n\t\t\tclient.post_event WrongVersionEvent.new(self,ev.build_date)\n\t\t\treturn\n\t\tend\n\t\tif(false==client.serialize_from_db())\n\t\t\tpost_event DbErrEvent.new(ev.src)\n\t\telse\n\t\t\tclient.post_event SlotListEvent.new(self,client)\n\t\tend\n\tend",
"def update_voice_server(data)\n server_id = data['guild_id'].to_i\n channel = @should_connect_to_voice[server_id]\n\n debug(\"Voice server update received! chan: #{channel.inspect}\")\n return unless channel\n @should_connect_to_voice.delete(server_id)\n debug('Updating voice server!')\n\n token = data['token']\n endpoint = data['endpoint']\n\n unless endpoint\n debug('VOICE_SERVER_UPDATE sent with nil endpoint! Ignoring')\n return\n end\n\n debug('Got data, now creating the bot.')\n @voices[server_id] = Discordrb::Voice::VoiceBot.new(channel, self, token, @session_id, endpoint, @should_encrypt_voice)\n end",
"def on_update; end",
"def cmdh_update_resp2(msg_details)\n @log.debug \"UPDATERESPTWO handler\"\n info = YAML::load(msg_details)\n case info[:type] \n when :platf_update\n # need a platform update\n @log.debug \"Platform update is needed\"\n str = \"ATTENZIONE: questo client necessita di un aggiornamento manuale per giocare in internet.\\n\"\n str += \" Vai su cuperativa.invido.it per maggiorni informazioni.\\n\"\n str += \" Senza una versione recente, il gioco in rete non funziona.\\n\"\n str += \" *********** L'ultima versione aggiornata di cuperativa si scarica da: **************\\n\"\n str += \" #{info[:link_platf]}\\n\"\n str += \" *********************************************************\\n\"\n @cup_gui.log_sometext(str) \n #close connection\n @socket_srv.close if @socket_srv\n return\n when :nothing\n # no update, client is OK\n @log.debug \"Client already updated\"\n strtext = u\"Il programma U+00e8 giU+00e0 all'ultima versione.\\n\"\n @cup_gui.log_sometext(strtext)\n return\n when :appli_update\n # need to update the application\n server_name = info[:server].gsub('http://', \"\")\n package_name = info[:file ]\n updater = ClientUpdaterCtrl.new\n updater.set_package_src(server_name, package_name)\n updater.gui_progress = @cup_gui\n updater.net_controller = self\n updater.info_package = info\n begin \n #updater.install_package\n @model_net_data.event_cupe_raised(:ev_startupdate)\n updater.install_package_question(@model_net_data)\n rescue\n @cup_gui.log_sometext(\"ERRORE: Update non riuscito\\n\")\n @cup_gui.log_sometext(\"Riprova l'update, oppure installa la versione completa aggiornata di cuperativa (www.invido.it).\\n\")\n @socket_srv.close if @socket_srv\n end\n else\n @log.error 'Update type not recognized'\n end#case\n end",
"def update\n @server = Server.find(params[:id])\n checkaccountobject(\"servers\",@server)\n respond_to do |format|\n if @server.update_attributes(params[:server])\n @server.send_update\n format.html { redirect_to @server, notice: 'Server was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @server.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update update\n case update.type.to_sym\n when :update_snakes\n snakes = update.msg \n if @client\n begin\n stonedSnakes = snakes.map { |s| {\"name\" => s.get_name, \"tail\" => s.get_tail.to_json} }\n stoneColdKilledSnakes = JSON.dump(stonedSnakes)\n msg = Message.new(\"update_snakes\", stoneColdKilledSnakes)\n @client.puts(JSON.dump(msg))\n rescue Exception => myException\n @log.info \"Exception rescued: #{myException}\"\n @client = nil\n @isBot = true\n end \n end\n when :update_colors\n if @client\n @client.puts(JSON.dump(update))\n end\n when :identity\n if @client\n# @client.puts(JSON.dump(update));\n end\n end\n end",
"def mte_prepare_updating; send_request_to_mite(\"update\"); end",
"def update\r\n handle_venda_update\r\n end",
"def update!(**args)\n @server_info = args[:server_info] if args.key?(:server_info)\n @server_trace_info = args[:server_trace_info] if args.key?(:server_trace_info)\n @service_url = args[:service_url] if args.key?(:service_url)\n end",
"def update\n @server.make_json_request('show.update', tvdbid: @tvdbid)['message']\n end",
"def update\n respond_to do |format|\n if @bot_server.update(bot_server_params)\n format.html { redirect_to bot_servers_path, notice: 'Bot server was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bot_server.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n handle_orcamento_update\n end",
"def remote_update(*)\n super(changed)\n end",
"def update() end",
"def update ; end",
"def check_update_forclient(nomeprog, ver_prog)\n @log.debug(\"Controller: check_update_forclient\")\n net_prot_ver = [SUPP_SERV_VER_MAJ, SUPP_SERV_VER_MIN ]\n info_client = [nomeprog, ver_prog, net_prot_ver ]\n msg_details = YAML.dump(info_client)\n @log.debug \"update_req: #{info_client}\"\n cmd_to_send = build_cmd(:update_req, msg_details)\n send_data_to_server(cmd_to_send)\n @cup_gui.log_sometext(\"UPDATE: controlla se esiste una nuova versione\\n\")\n end",
"def update\r\n respond_to do |format|\r\n if @server.update(server_params)\r\n format.html { redirect_to @server, notice: 'Server was successfully updated.' }\r\n format.json { render :show, status: :ok, location: @server }\r\n else\r\n format.html { render :edit }\r\n format.json { render json: @server.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update(msg)\n case msg\n # Handle disconnection from server\n # Note that publishing a :quit event (see #disconnect) will return a\n # :disconnected event when server has closed the connection.\n # Guest accounts and characters are deleted here.\n when :disconnected\n @conn = nil\n unsubscribe_all\n Engine.instance.db.makeswap(id)\n if @character\n world.connected_characters.delete(@character.id)\n world.connected_characters.each do |pid|\n add_event(@character.id,pid,:show,\"#{name} has disconnected.\")\n end\n Engine.instance.db.makeswap(@character.id)\n @character.account = nil\n if @character.name =~ /Guest/i\n world.all_characters.delete(@character.id)\n delete_object(@character.id)\n end\n @character = nil\n end\n if name =~ /Guest/i\n world.all_accounts.delete(id)\n delete_object(id)\n end\n # Issued when a NAWS event occurs\n # Currently this clears and resets the screen. Ideally it should attempt\n # to redraw it.\n when :termsize\n @termsize = @conn.query(:termsize)\n if vtsupport?\n publish(\"[home #{@termsize[1]},1][clearline][cursave]\" +\n \"[home 1,1][scrreset][clear][scrreg 1,#{@termsize[1]-3}][currest]\")\n end\n # Negotiation with client done. Start talking to it.\n when :initdone\n @echo = @conn.query(:echo)\n @termsize = @conn.query(:termsize)\n @terminal = @conn.query(:terminal)\n if vtsupport?\n publish(\"[home #{@termsize[1]},1][clearline][cursave]\" +\n \"[home 1,1][scrreset][clear][scrreg 1,#{@termsize[1]-3}][currest]\")\n sendmsg(LOGO)\n end\n sendmsg(BANNER)\n sendmsg(append_echo(\"login> \"))\n @mode = :name\n # This is a message from our user\n when String\n parse_messages(msg)\n else\n log.error \"Account#update unknown message - #{msg.inspect}\"\n end\n rescue\n # We squash and print out all exceptions here. There is no reason to\n # throw these back at the Connection.\n log.error $!\n end",
"def update_server_info\n @adapter.update_server_info(repository_path.to_s)\n end",
"def update\n respond_to do |format|\n if @server.update(server_params)\n format.html { redirect_to @server, notice: 'Server was successfully updated.' }\n format.json { render :show, status: :ok, location: @server }\n else\n format.html { render :edit }\n format.json { render json: @server.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @server.update(server_params)\n format.html { redirect_to @server, notice: 'Server was successfully updated.' }\n format.json { render :show, status: :ok, location: @server }\n else\n format.html { render :edit }\n format.json { render json: @server.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @server.update(server_params)\n format.html { redirect_to @server, notice: 'Server was successfully updated.' }\n format.json { render :show, status: :ok, location: @server }\n else\n format.html { render :edit }\n format.json { render json: @server.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_remote\n # TODO\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def app_update\n \tapi_detail = ApiDetail.find_by(api_version: 'v1', device_type: 0)\n render_success(api_detail_result(api_detail)) \n end",
"def update\n respond_to do |format|\n if @server.update(server_params)\n format.html { redirect_to [:admin, @site], notice: 'Server was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @server.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @app_server.update(app_server_params)\n format.html { redirect_to @app_server, notice: 'App server was successfully updated.' }\n format.json { render :show, status: :ok, location: @app_server }\n else\n format.html { render :edit }\n format.json { render json: @app_server.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n authenticate_user!\n @server = Server.find(params[:id])\n\n respond_to do |format|\n if @server.update_attributes(params[:server])\n format.html { redirect_to @server, notice: 'Server was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @server.errors, status: :unprocessable_entity }\n end\n end\n end",
"def app_update\n \tapi_detail = ApiDetail.find_by(api_version: 'v1', device_type: 0)\n render_success(api_detail_result(api_detail)) \n end",
"def update\n respond_to do |format|\n if @slider_serv.update(slider_serv_params)\n format.html { redirect_to @slider_serv, notice: 'Slider serv was successfully updated.' }\n format.json { render :show, status: :ok, location: @slider_serv }\n else\n format.html { render :edit }\n format.json { render json: @slider_serv.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update(options={})\n param = { :uniq_id => @uniq_id }.merge options\n data = Storm::Base::SODServer.remote_call '/Server/update', param\n self.from_hash data\n end",
"def update_voice_state(data)\n server_id = data['guild_id'].to_i\n server = server(server_id)\n return unless server\n\n server.update_voice_state(data)\n\n @session_id = data['session_id']\n end",
"def after_update; end",
"def after_update; end",
"def update\n respond_to do |format|\n if @gameserver.update(server_params)\n format.html { redirect_to @gameserver, notice: 'Server was successfully updated.' }\n format.json { render :show, status: :ok, location: @gameserver }\n else\n format.html { render :edit }\n format.json { render json: @gameserver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @gameserver.update(server_params)\n format.html { redirect_to @gameserver, notice: 'Server was successfully updated.' }\n format.json { render :show, status: :ok, location: @gameserver }\n else\n format.html { render :edit }\n format.json { render json: @gameserver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n\r\n end",
"def update\n respond_to do |format|\n if @server.update(server_params)\n format.html { redirect_to servers_url, notice: 'Server was successfully updated.' }\n format.json { render :show, status: :ok, location: @server }\n else\n format.html { render :edit }\n format.json { render json: @server.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @server.update(server_params)\n format.html { redirect_to @server, notice: 'Server was successfully updated.' }\n else\n format.html { render action: 'edit' }\n end\n end\n end",
"def update\n\t\t# Left empty intentionally.\n\tend",
"def updateServer(server, serverID)\n paramHash = {}\n paramHash[\"description\"] = server.description\n paramHash[\"dnsName\"] = server.dns\n paramHash[\"domainName\"] = server.domainName\n paramHash[\"emailID\"] = server.emailID\n paramHash[\"CI\"] = server.CI ? \"y\" : \"n\"\n paramHash[\"deploymentStatus\"] = server.deploymentStatus\n paramHash[\"instanceId\"] = server.instanceId\n paramHash[\"amiID\"] = server.imageID\n paramHash[\"username\"] = server.username\n paramHash[\"build\"] = server.build\n paramHash[\"appName\"] = server.appName\n paramHash[\"deployTempLoc\"] = server.deployTempLoc\n paramHash[\"buildLoc\"] = server.buildLocation\n paramHash[\"privateKeyLoc\"] = server.privateKeyLoc\n paramHash[\"publicKeyLoc\"] = server.publicKeyLoc\n paramHash[\"loginUser\"] = server.loginUser\n paramHash[\"serverType\"] = server.serverType\n paramHash[\"type\"] = \"server\"\n paramHash[\"status\"] = server.status\n paramHash[\"starttime\"] = server.startTime\n paramHash[\"provider\"] = server.provider\n paramHash[\"region\"] = server.region\n paramHash[\"cmserver\"] = server.cmserver\n paramHash[\"name\"] = server.serverName\n paramHash[\"instancesize\"] = server.instanceSize\n paramHash[\"password\"] = server.password\n paramHash[\"sshport\"] = server.sshport\n paramHash[\"tier\"] = server.tier\n\n serverUrl = @appContext.getMasterURL() + \"/applications/\" + @appContext.getProject() + \"/assets/\" + serverID \n return @cloudmunchDataService.updateDataForContext(serverUrl, @appContext.getAPIKey(), paramHash) \n end",
"def update\r\n end",
"def update\r\n end",
"def update\r\n end",
"def update\r\n end",
"def update\n log_output(\"Starting #{provider} update\", :info)\n validate_provision_fields\n connection = connect\n \n id = get_field('id') || (get_field(\"#{provider}_ids\") || []).first\n raise ConfigError, \"Missing fields: id\" if id.nil?\n\n server = connection.servers.get(id)\n log_output(\"#{provider} updating server #{id}: #{server.nil? ? 'not found' : 'found' }\")\n\n # attributes to update in the server\n new_attributes = {}\n updatable_attributes.each do |attribute|\n new_attributes[attribute] = get_field(attribute.to_s)\n end\n\n new_attributes.delete_if { |k, v| v.nil? or v.empty? }\n new_attributes.each do |k,v|\n if server.respond_to?(k)\n server.send(\"#{k}=\",v)\n else\n raise PluginError, \"Provider #{provider} does not support #{k} attribute\"\n end\n end\n server.update unless new_attributes.empty?\n populate_meta([server], 'update')\n\n log_output(\"#{provider} server #{id} updated with: #{new_attributes}\", :info)\n end",
"def update(...)\n end",
"def update\r\n # write some gangsta code here\r\n end",
"def update \n end",
"def update; end",
"def update\n \t\n end",
"def update\n \t\n end",
"def update\n @server_info = ServerInfo.find(params[:id])\n\n respond_to do |format|\n if @server_info.update_attributes(params[:server_info])\n format.html { redirect_to @server_info, notice: 'Server info was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @server_info.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @mock_server.update(mock_server_params)\n format.html { redirect_to @mock_server, notice: 'Mock server was successfully updated.' }\n format.json { render :show, status: :ok, location: @mock_server }\n else\n format.html { render :edit }\n format.json { render json: @mock_server.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def engine_notify_datas_updated(datas_updated)\n end",
"def update\n \n end",
"def update\r\n end",
"def update\n @server = Server.find(params[:id])\n\n respond_to do |format|\n if @server.update_attributes(params[:server])\n format.html {redirect_to servers_url, flash[:info]='Server was successfully updated.' }\n format.js { flash[:info]='Server was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @server.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @method_match = args[:method_match] if args.key?(:method_match)\n @polling_options = args[:polling_options] if args.key?(:polling_options)\n end",
"def update;end",
"def update!(**args)\n @partial_vsi = args[:partial_vsi] if args.key?(:partial_vsi)\n @vsi_time = args[:vsi_time] if args.key?(:vsi_time)\n end",
"def update \n end",
"def update\n # Not generally used\n end",
"def update\n # Not generally used\n end",
"def update\n @game_server = Game::Server.find(params[:id])\n\n respond_to do |format|\n if @game_server.update_attributes(params[:game_server])\n format.html { redirect_to @game_server, notice: 'Server was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game_server.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update()\n end",
"def update\n @server = Server.find(params[:id])\n\n respond_to do |format|\n if @server.update_attributes(params[:server])\n format.html { redirect_to @server, notice: 'Server was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @server.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @egc_server_type.update(egc_server_type_params)\n format.html { redirect_to @egc_server_type, notice: 'Egc server type was successfully updated.' }\n format.json { render :show, status: :ok, location: @egc_server_type }\n else\n format.html { render :edit }\n format.json { render json: @egc_server_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n #Nothing necessary\n end",
"def update_server(server, ec2_info)\n server[0] = ec2_info[1] # ec2_id\n server[3] = ec2_info[3] # public host\n server[4] = ec2_info[16] # public ip\n server[5] = ec2_info[4] # private host\n server[6] = ec2_info[17] # private ip\nend",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end"
] | [
"0.7318484",
"0.6757797",
"0.6548655",
"0.6486446",
"0.6475725",
"0.6355513",
"0.63385504",
"0.6288361",
"0.6238096",
"0.6224254",
"0.62186927",
"0.6153474",
"0.61312884",
"0.61072624",
"0.6084803",
"0.60821885",
"0.60772467",
"0.60741854",
"0.6069963",
"0.6065875",
"0.6065875",
"0.6065875",
"0.6054707",
"0.60337937",
"0.60337937",
"0.60337937",
"0.60337937",
"0.60337937",
"0.60337937",
"0.60337937",
"0.60337937",
"0.5995877",
"0.5995826",
"0.5991",
"0.59893364",
"0.5982863",
"0.5973666",
"0.596293",
"0.59566617",
"0.59408355",
"0.59408355",
"0.59334356",
"0.59334356",
"0.5924811",
"0.59245455",
"0.59012485",
"0.5900548",
"0.58968115",
"0.5895242",
"0.5895242",
"0.5895242",
"0.5895242",
"0.5889549",
"0.58717644",
"0.58585024",
"0.58540374",
"0.5852778",
"0.5849488",
"0.5849488",
"0.58409965",
"0.583172",
"0.58312243",
"0.58312243",
"0.58312243",
"0.58312243",
"0.58312243",
"0.58312243",
"0.58312243",
"0.58312243",
"0.58312243",
"0.58312243",
"0.58312243",
"0.58306336",
"0.5827848",
"0.5816887",
"0.5816651",
"0.58150595",
"0.5812094",
"0.5809189",
"0.5800908",
"0.58004093",
"0.58004093",
"0.5786998",
"0.57839537",
"0.57652235",
"0.5761224",
"0.57529384",
"0.5749549",
"0.57487047",
"0.57487047",
"0.57487047",
"0.57487047",
"0.57487047",
"0.57487047",
"0.57487047",
"0.57487047",
"0.57487047",
"0.57487047",
"0.57487047",
"0.57487047"
] | 0.678757 | 1 |
Internal handler for CHANNEL_CREATE | def create_channel(data)
channel = data.is_a?(Discordrb::Channel) ? data : Channel.new(data, self)
server = channel.server
# Handle normal and private channels separately
if server
server.add_channel(channel)
@channels[channel.id] = channel
elsif channel.private?
@pm_channels[channel.recipient.id] = channel
elsif channel.group?
@channels[channel.id] = channel
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def channel_create(attributes = {}, &block)\n register_event(ChannelCreateEvent, attributes, block)\n end",
"def create_channel(data)\n channel = Channel.new(data, self)\n server = channel.server\n\n # Handle normal and private channels separately\n if server\n server.channels << channel\n @channels[channel.id] = channel\n else\n @private_channels[channel.id] = channel\n end\n end",
"def create_channel\n AMQP::Channel.new(@amqp_client)\n end",
"def radioChannelCreate _args\n \"radioChannelCreate _args;\" \n end",
"def open_channel(type = T.unsafe(nil), *extra, &on_confirm); end",
"def create_channel\n Channel.new @grpc_stub_class, endpoint: @endpoint, credentials: @credentials, channel_args: @channel_args,\n interceptors: @interceptors, on_channel_create: @config.on_channel_create\n end",
"def channel_create_format\n if private?\n {\n id: @id.to_s,\n is_private: true,\n recipient: @recipient.compact\n }\n else\n {\n guild_id: @server.id.to_s,\n id: @id.to_s,\n is_private: false,\n name: @name,\n permission_overwrites: permission_overwrites_format,\n position: @position,\n topic: @topic,\n type: @type,\n bitrate: @bitrate\n }\n end\n end",
"def create\n @channel = Channel.new(params[:channel])\n @channel.user = current_user\n flash[:notice] = t('controllers.channels.channel_was_successfully_created') if @channel.save\n\n respond_with @channel\n end",
"def create\n if @chatty_crow_channel.save\n flash[:notice] = l(:notice_successful_create)\n redirect_to_plugin_settings\n else\n render action: :new\n end\n end",
"def channel\n @channel ||= Proletariat.connection.create_channel\n end",
"def channel\n @channel ||= Proletariat.connection.create_channel\n end",
"def create_guild_channel(guild_id, name:, reason: nil, type: nil, topic: nil, bitrate: nil, user_limit: nil,\n rate_limit_per_user: nil, position: nil, permission_overwrites: nil, parent_id: nil,\n nsfw: nil)\n response = request(\n :guilds_gid_channels, guild_id,\n :post,\n \"guilds/#{guild_id}/channels\",\n {name: name, type: type, topic: topic, bitrate: bitrate, user_limit: user_limit,\n rate_limit_per_user: rate_limit_per_user, position: position,\n permission_overwrites: permission_overwrites, parent_id: parent_id, nsfw: nsfw},\n 'X-Audit-Log-Reason': reason,\n )\n Rapture::Channel.from_json(response.body)\n end",
"def create_channel!(name)\n resp = sns.create_topic(name: name)\n Channel.new(nil, resp.topic_arn)\n end",
"def subscribe_to_channel; end",
"def create\n @channel = Channel.new(channel_params)\n respond_to do |format|\n if @channel.save\n format.json { render :show, status: :created, location: @channel}\n else\n format.json { render json: @channel.errors, status: :unprocessable_entity}\n end\n end\n end",
"def create\n @channel = Channel.new(channel_params)\n\n respond_to do |format|\n if @channel.save\n format.html { redirect_to @channel, notice: 'Channel was successfully created.' }\n format.json { render action: 'show', status: :created, location: @channel }\n else\n format.html { render action: 'new' }\n format.json { render json: @channel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @channel = Channel.new(channel_params)\n\n respond_to do |format|\n if @channel.save\n format.html { redirect_to @channel, notice: 'Channel was successfully created.' }\n format.json { render action: 'show', status: :created, location: @channel }\n else\n format.html { render action: 'new' }\n format.json { render json: @channel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create( params )\n\t\tres = nil\n\n\t\tif( params.tcp? )\n\t\t\tif( params.server? )\n\t\t\t\tres = create_tcp_server_channel( params )\n\t\t\telse\n\t\t\t\tres = create_tcp_client_channel( params )\n\t\t\tend\n\t\telsif( params.udp? )\n\t\t\tres = create_udp_channel( params )\n\t\tend\n\n\t\treturn res\n\tend",
"def channel\n # Create new channel if closed\n if @channel.nil? || @channel.closed?\n @channel = connection.create_channel\n end\n @channel\n end",
"def create\n @channel = Channel.new(params[:channel])\n\n respond_to do |format|\n if @channel.save\n format.html { redirect_to @channel, notice: 'Channel was successfully created.' }\n format.json { render json: @channel, status: :created, location: @channel }\n else\n format.html { render action: \"new\" }\n format.json { render json: @channel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\r\n @channel = Channel.new(channel_params)\r\n\r\n respond_to do |format|\r\n if @channel.save\r\n format.html { redirect_to user_channels_path(current_user)}\r\n else\r\n format.html { render :new, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def createNotificationChannel(channel_type, content_type, version=1.0)\n url = \"#{@fqdn}#{NOTIFICATION_RESOURCE}\"\n headers = { \n :accept => 'application/json', \n :content_type => \"application/json\",\n }\n body = Webhooks.createChannel(channel_type, content_type, version)\n\n begin\n r = self.post(url, body.to_json, headers)\n rescue RestClient::Exception => e\n raise(ServiceException, e.response || e.message, e.backtrace)\n end\n Model::NotificationChannel.from_response(r)\n end",
"def channel_open_handlers; end",
"def create\n conversation = Conversation.new(conversation_params)\n # If the converstation is created and saved, then it will\n # broadcast the channel to the front end\n if conversation.save\n serialized_data = ActiveModelSerializers::Adapter::Json.new(\n ConversationSerializer.new(conversation)\n ).serializable_hash\n ActionCable.server.broadcast 'conversations_channel', serialized_data\n head :ok\n end\n end",
"def create_channel(opts = {})\n data, _status_code, _headers = create_channel_with_http_info(opts)\n data\n end",
"def create\n channel = Channel.create!(channel_params)\n joined = ChannelJoined.create!(user_id: params[:user_id], channel_id: channel.id)\n json_response(channel)\n end",
"def create\n if is_number?(params[:name])\n redirect_to :action => \"new\" and flash[:notice] = 'Channel name cannot be a number!'\n elsif params[:name] == \"\"\n redirect_to :action => \"new\" and flash[:notice] = 'Channel name cannot be empty!'\n elsif params[:description] == \"\"\n redirect_to :action => \"new\" and flash[:notice] = 'Channel description cannot be empty!'\n elsif params[:name] == 'create'\n else\n @channel = Channel.new(:name => params[:name], :description => params[:description])\n respond_to do |format|\n if @channel.save\n format.html { redirect_to(@channel)}\n format.xml { render :xml => @channel, :status => :created, :location => @channel }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @channel.errors, :status => :unprocessable_entity }\n end\n end\n end\n end",
"def create\n @channel = Channel.new(params[:channel])\n\n respond_to do |format|\n if @channel.save\n flash[:notice] = 'Channel was successfully created.'\n format.html { redirect_to(@channel) }\n format.xml { render :xml => @channel, :status => :created, :location => @channel }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @channel.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create(params)\n res = nil\n\n if params.tcp?\n if params.server?\n res = create_tcp_server_channel(params)\n else\n res = create_tcp_client_channel(params)\n end\n elsif params.udp?\n res = create_udp_channel(params)\n end\n\n return res\n end",
"def get_channel(name, create)\n channel = @channels[name]\n if not channel and create\n channel = Channel.new(name)\n @channels[name] = channel\n @logger.debug(\"Created channel #{name}\")\n end\n channel\n end",
"def prepare_client(client, channel, type); end",
"def create\n @channel_class = ChannelClass.new(channel_class_params)\n\n respond_to do |format|\n if @channel_class.save\n format.html { redirect_to @channel_class, notice: '频道创建成功.' }\n format.json { render :show, status: :created, location: @channel_class }\n else\n format.html { render :new }\n format.json { render json: @channel_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @channel = Channel.new(params[:channel])\n\n respond_to do |format|\n if @channel.save\n @channel.users << @user\n @channel.save\n flash[:notice] = 'Channel was successfully created.'\n format.html { redirect_to(@channel) }\n format.xml { render :xml => @channel, :status => :created, :location => @channel }\n else\n flash[:warning] = 'Could not create channel'\n logger.debug @channel.errors.full_messages\n format.html { render :action => \"new\" }\n format.xml { render :xml => @channel.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @channel = Channel.find(params[:channel_id])\n rescue ActiveRecord::RecordNotFound => e\n respond_to do |format|\n format.html { redirect_to :back, notice: I18n.t('general.failed_to_subscribe') }\n format.json { render json: e, status: :unprocessable_entity }\n end\n else\n message = if current_user.max_channels_reached?\n I18n.t('maximum_channels_reached')\n elsif current_user.channels.include?(@channel)\n I18n.t('already_subscribed')\n end\n\n if (!current_user.channels.include?(@channel) && !current_user.max_channels_reached?)\n current_user.channels << @channel\n respond_to do |format|\n format.html { redirect_to @channel, notice: I18n.t('general.subscribed') }\n format.json { render json: @channel, status: :created, location: @channel }\n end\n else\n respond_to do |format|\n format.html { redirect_to @channel, notice: I18n.t('general.unable_to_subscribe') }\n format.json { render json: message, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @channel = Channel.new(params[:channel])\n respond_to do |format|\n if @channel.save\n flash[:notice] = 'Canal créé.'\n format.html { redirect_to :action=>:show, :id=>@channel.id }\n format.xml { render :xml => @channel, :status => :created, :location => @channel }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @channel.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create_channels(client_id, channel_symbols, options = {})\n channel_symbols = [channel_symbols] unless channel_symbols.is_a? Array\n channel_symbols.each do |channel_symbol|\n channel_symbol = channel_symbol.to_sym\n if INVALID_CHANNEL_NAMES_FOR_CREATION_AND_DESTRUCTION.include?(channel_symbol)\n notify(:type => :error, :code => 2054, :receivers => @qsif[:client_manager].web_socket(:client_id => client_id), :params => {:client_id => client_id, :channel_symbol => channel_symbol})\n next\n end\n if @channels[channel_symbol].nil?\n @channels[channel_symbol] = EM::Channel.new\n notify(:type => :debug, :code => 2040, :receivers => @qsif[:client_manager].web_socket(:client_id => client_id), :params => {:client_id => client_id, :channel_symbol => channel_symbol})\n else\n notify(:type => :error, :code => 2053, :receivers => @qsif[:client_manager].web_socket(:client_id => client_id), :params => {:client_id => client_id, :channel_symbol => channel_symbol})\n end\n end\n end",
"def create\n @raw_channel = RawChannel.new(params[:raw_channel])\n\n respond_to do |format|\n if @raw_channel.save\n format.html { redirect_to @raw_channel, notice: 'Raw channel was successfully created.' }\n format.json { render json: @raw_channel, status: :created, location: @raw_channel }\n else\n format.html { render action: \"new\" }\n format.json { render json: @raw_channel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n render(status: :forbidden, text: 'Invalid message') and return if params[:message].blank? or params[:message][:content].blank?\n @channel = Channel.find(params[:channel_id])\n @message = @channel.messages.create(params.require(:message).permit(:content))\n @message.user_name = session[:user_name]\n\n if @message.save\n Pusher['presence-channel-' + params[:channel_id]].trigger('message_added', {message: {user_name: h(@message.user_name), content: view_context.auto_link(@message.content)}, time: @message.created_at.localtime.strftime('%H:%M')})\n render status: :created, body: nil\n else\n render status: :forbiden, text: 'The message can\\'t save'\n end\n end",
"def create\n\t\tchannel_sid = params[:channel_sid]\n\t\t@client = Twilio::REST::Client.new(ENV['account_sid'], ENV['auth_token'])\n\t\t# Add the member\n\t\tservice = @client.chat.v2.services(ENV['service_sid'])\n\t\tchannel = service.channels(channel_sid)\n\t\tmessage = channel.messages.create(body: params[:body])\n\t\tputs message\n\t\tresponse = \"{\\n\\\"message\\\": \\\"Message sent\\\"\\n}\"\n\t\tjson_response(response)\n\tend",
"def create\n @universal_channel = UniversalChannel.new(universal_channel_params)\n\n respond_to do |format|\n if @universal_channel.save\n format.html { redirect_to @universal_channel, notice: 'Universal channel was successfully created.' }\n format.json { render :show, status: :created, location: @universal_channel }\n else\n format.html { render :new }\n format.json { render json: @universal_channel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @channel = Channel.find(params[:channel_id])\n @message = @channel.messages.build(message_params)\n\n respond_to do |format|\n if @message.save\n format.json { render json: @message, status: :created }\n else\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def make_channel chan\n @logger.debug \"In make_channel, got #{chan}\"\n # If we are DMing a user (chan looks like @username), do nothing\n # otherwise, make sure chan starts with a '#', if it doesn't already\n\n # channel names must be lowercase, and not contain spaces or periods\n # I'm going to assume that usernames need the same requirements\n chan.sub(/^(?!#|@)/,'#').downcase.gsub(/ |\\./, '_')\n end",
"def create\n message = Message.new(message_params)\n conversation = Conversation.find(message_params[:conversation_id])\n message.username = message.user.username\n if message.save\n serialized_data = ActiveModelSerializers::Adapter::Json.new(\n MessageSerializer.new(message)).serializable_hash\n MessagesChannel.broadcast_to(conversation, serialized_data)\n # ActionCable.server.broadcast 'conversations_channel', serialized_data\n head :ok\n # binding.pry\n end\n end",
"def channels_create(params = {}, opts = {})\n log.info { \"out_slack: channels_create #{params.dup.tap {|p| p[:token] = '[FILTERED]' if p[:token] }}\" }\n post(channels_create_endpoint, params)\n end",
"def create\n @message = Message.create(message_params)\n ActionCable.server.broadcast(\"chatting_channel\", {\n data_type: \"message\",\n user_id: @message.user_id, \n content: @message.content,\n created_at: (@message.created_at.strftime(\"%m/%d %H:%M\")),\n }) if @message.present?\n head :ok\n\n end",
"def create\n @admin_channel = Admin::Channel.new(admin_channel_params)\n @admin_channel.user_id = current_user.id\n @admin_channel.short_title = get_short_title('channel', @admin_channel.title) if @admin_channel.short_title.blank?\n\n respond_to do |format|\n if @admin_channel.save\n update_tag(@admin_channel)\n format.html { redirect_to @admin_channel, notice: '栏目添加成功.' }\n format.json { render action: 'show', status: :created, location: @admin_channel }\n else\n format.html { render action: 'new' }\n format.json { render json: @admin_channel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n message = msg_params\n @msg = Msg.new(msg_params)\n thesender = @msg.sender\n thesentdate = @msg.sent\n theservertime = DateTime.now\n unless @msg.content.empty? || @msg.sender.empty?\n ActionCable.server.broadcast 'room_channel',\n content: @msg.content,\n sender: thesender,\n servertime: theservertime\n end\n end",
"def initialize(name)\n logger.debug \"Creating channel '#{name}'\"\n @name = name\n @clients = {}\n self.class.register_channel(self)\n end",
"def channel_open(packet); end",
"def create_tcp_server_channel(params)\n\t\t\treturn SocketSubsystem::TcpServerChannel.open(client, params)\n\tend",
"def create_default_channels\n private_chan = Channel.new\n private_chan.user_id = self.id\n private_chan.title = \"Private Videos\"\n private_chan.private = true\n private_chan.save\n \n public_chan = Channel.new\n public_chan.user_id = self.id\n public_chan.title = \"Public Videos\"\n public_chan.save\n \n featured_chan = Channel.new\n featured_chan.user_id = self.id\n featured_chan.title = \"Featured Videos\"\n featured_chan.featured = true\n featured_chan.save\n end",
"def create\n @channel = Channel.new(channel_params)\n @listener = Listener.create(dj: true)\n session[:current_listener_id] = @listener.id\n #gon.dj= @listener.dj\n\n respond_to do |format|\n if @channel.save\n format.html { redirect_to @channel, notice: 'Channel was successfully created.' }\n format.json { render :show, status: :created, location: @channel }\n else\n format.html { render :new }\n format.json { render json: @channel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_ad(umsg,sock)\n channel = umsg[1]\n msg = umsg - umsg[0..2]\n if @channels.include? channel\n msg = {:id => 0 ,:channel => channel, :ad => msg.join(\" \"), :time => Time.now}\n ad_id = @@connection.insert_advice(msg[:ad],msg[:channel])\n msg[:id] = ad_id\n @msg_queue.push(msg)\n sock.write(\"Message successfully created. Channel => #{channel}\\n\")\n send_channel_msg(msg)\n else\n sock.write(\"Channel doesnt exist\\n\")\n end\n end",
"def create\n @channel_type = ChannelType.new(channel_type_params)\n\n respond_to do |format|\n if @channel_type.save\n format.html { redirect_to channel_types_path, notice: 'Channel type was successfully created.' }\n format.json { render :show, status: :created, location: @channel_type }\n else\n format.html { render :new }\n format.json { render json: @channel_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_message(data); end",
"def create_message(data); end",
"def create_channel_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ChatChannelsApi.create_channel ...'\n end\n # resource path\n local_var_path = '/chat/users/me/channels'\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', 'application/xml'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'multipart/form-data'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(opts[:'body'])\n auth_names = ['OAuth']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'InlineResponse2012')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ChatChannelsApi#create_channel\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def prepare_simple_client(client, channel, type); end",
"def on_open_channel(type, &block); end",
"def create\n @main_thread = MessageThread.new\n @channel = PublicChannel.new(channel_params.merge main_thread: @main_thread)\n @memebership = ChannelMembership.new(user: current_user, channel: @channel)\n ThreadMembership.create message_thread: @main_thread, channel: @channel\n\n respond_to do |format|\n if @main_thread.save and @channel.save and @memebership.save\n format.html { redirect_to @channel }\n format.json { render :show, status: :created, location: @channel }\n else\n format.html { render :new }\n format.json { render json: @channel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def ensure_channel(data, server = nil)\n if @channels.include?(data['id'].to_i)\n @channels[data['id'].to_i]\n else\n @channels[data['id'].to_i] = Channel.new(data, self, server)\n end\n end",
"def create(args = nil)\n # Connects to the xmpp-client that is used for sending xmpp-messages\n @send_client = connect(@@send_client_info)\n \n # Connect to xmpp-client that is used for receiving messages that are then turn into http-requests\n @receive_client = connect(@@receive_client_info)\n runMessageReceiver\n \n # Ensures that xmpp-server has node: home/host/<host>/<node_account>/contexts\n XmppHelper::createContextGeneralNode\n\n end",
"def set_up_channel\n amqp_conn = Bunny.new\n amqp_conn.start\n channel = amqp_conn.create_channel\nend",
"def radioChannelAdd _obj, _args\n \"_obj radioChannelAdd _args;\" \n end",
"def create_channel(channel)\n puts \"running create_channel, channel = #{channel.inspect}\"\n key_check = RestClient.get \"#{$base_url}/channels/#{channel[\"key\"]}\" #space should be escaped :)\n if key_check.nil? || key_check['key'].nil?\n #params = { 'key' => channel[\"key\"], 'name' => channel[\"name\"], 'description' => channel[\"description\"] },\n result = RestClient.post \"#{$base_url}/channels/create\", channel.to_json, :content_type => :json\n puts result.inspect # Test for checking that request is valid\n else \n puts \"Error, Channel is already exsists - #{key_check.inspect}\"\n end\nend",
"def create(phone_number_sid: nil)\n data = Twilio::Values.of({'PhoneNumberSid' => phone_number_sid, })\n\n payload = @version.create(\n 'POST',\n @uri,\n data: data\n )\n\n ChannelInstance.new(\n @version,\n payload,\n business_sid: @solution[:business_sid],\n brand_sid: @solution[:brand_sid],\n branded_channel_sid: @solution[:branded_channel_sid],\n )\n end",
"def create_level_channel(project_name, optional={})\n\t\targs = self.class.new_params\n\t\targs[:method] = 'POST'\n\t\targs[:path]['ProjectName'] = project_name\n\t\targs[:pattern] = '/projects/[ProjectName]/level_channels'\n\t\targs[:query]['Action'] = 'CreateLevelChannel'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'http'\n\t\tif optional.key? :level_channel_setting\n\t\t\targs[:body]['LevelChannelSetting'] = optional[:level_channel_setting]\n\t\tend\n\t\tself.run(args)\n\tend",
"def add_channel_open_handler( type, &block )\n ( @channel_open_handlers[ type ] ||= Array.new ).push block\n @channel_open_handlers.length\n end",
"def create_chat_for_event\n chat = Chat.find_or_create_by_event_id id\n # raise 'Chat event found when should be nil' unless chat.event.blank?\n chat.event_id = id\n if chat.save\n chat_tiny = Tiny::tiny(chat.id)\n chat.channel = \"message_channel_\" + chat.id.to_s\n chat.save\n end\n end",
"def new\n @channel = Channel.new\n\n respond_with @channel\n end",
"def open_channel( type, extra_data=nil, &on_confirm )\n channel = @factories[:open].call( type, extra_data )\n channel.on_confirm_open(&on_confirm)\n @channel_map[ channel.local_id ] = channel\n end",
"def create\n @message = Message.new(message_params)\n\n if @message.save\n ActionCable.server.broadcast 'room_channel', content: @message.content, user_name: @message.user.name\n # head :ok\n end\n end",
"def create_facebook_channel(project_id, opts = {})\n post \"projects/#{project_id}/facebookchannels\", opts\n end",
"def channel\n\n Thread.current['_boss_amqp_channel'] ||= amqp_connect.create_channel\n end",
"def create\n room_id = params[:chat][:room_id]\n @chat = current_user.chats.build({message: params[:chat][:message],\n room_id: params[:chat][:room_id],\n receiver_id: params[:chat][:receiver_id]})\n\n if @chat.isSendToRoom?\n if current_user.rooms.find(room_id)\n response = \"ok\"\n\n else\n response = 'You have not join the room' + room_id\n end\n elsif @chat.isSendToPerson?\n response = 'Send to ' + @chat.to_user_id\n else # Broadcast to all users\n response = \"ok\"\n end\n\n chat_attrs = @chat.attributes\n chat_attrs['current_user'] = current_user\n chat_attrs['response'] = response\n if params[:chat][:room_id] == nil\n channel = \"server_channel\"\n else\n channel = room_id\n end\n\n self.broadcast_message_to_channel(channel, CHAT_EVENT_NAME, chat_attrs)\n render json: chat_attrs.to_json\n end",
"def create_dm(recipient_id)\n request(Route.new(:POST, '/users/@me/channels'), json: { recipient_id: recipient_id })\n end",
"def create\n @slack_channel = SlackChannel.new(slack_channel_params)\n\n respond_to do |format|\n if @slack_channel.save\n format.html { redirect_to @slack_channel, notice: 'Slack channel was successfully created.' }\n format.json { render :show, status: :created, location: @slack_channel }\n else\n format.html { render :new }\n format.json { render json: @slack_channel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def channel\n return @channel if @channel && !@channel.closed?\n @channel = connect.create_channel\n rescue Bunny::ChannelAlreadyClosed => e\n reconnect\n end",
"def create\n @message = Message.new(message_params)\n # require authentication + channel membership\n @message.author_id = @current_user.id;\n @message.channel_id = @channel.id;\n\n if @message.save\n # later we can require only broadcasting to 'live' users\n @channel.users.each do |user|\n UserChannel.broadcast_to(user, {message: @message})\n end\n render json: {ok: true}, status: :created\n else\n errors = {}\n @message.errors.each { |err| errors[err] = @message.errors.full_messages_for(err) }\n render json: errors, status: :unprocessable_entity\n end\n end",
"def create\n @channel = Channel.new(channel_params)\n @tags = params[:tags].split(',')\n @tagged = []\n if !current_user.id.blank?\n @channel.user_id = current_user.id\n end\n respond_to do |format|\n if @channel.save\n @activity = Activity.create(user_id: current_user.id, activity_type: 'Create', target_type: 'Channel', target_id: @channel.id)\n for tag in @tags\n if !tag.blank?\n @tag = Tag.where(title: tag).first\n if @tag.blank?\n @tag = Tag.create(title: tag, user_id: current_user.id)\n end\n @tagging = Tagging.create(taggable_id: @channel.id, taggable_type: 'Channel', tag_id: @tag.id)\n end\n end\n if params[:channel][:avatar].blank?\n format.html { redirect_to '/channels?channel_id='+@channel.id.to_s, notice: :channel_was_successfully_created }\n else\n format.html { redirect_to '/channels/cropper/'+@channel.id.to_s}\n end\n format.json { render :show, status: :created, location: @channel }\n else\n format.html { render :new }\n format.json { render json: @channel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @channel_user = ChannelUser.new(channel_user_params)\n\n respond_to do |format|\n if @channel_user.save\n format.html { redirect_to @channel_user, notice: 'Channel user was successfully created.' }\n format.json { render :show, status: :created, location: @channel_user }\n else\n format.html { render :new }\n format.json { render json: @channel_user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def data_channel_open\n puts \"Data channel open!\"\n data_channel = $$.data_channel\n # send_message(\"ALIVE\")\nend",
"def create_notification; end",
"def method_missing(name, *args, &block)\n if name =~ /(.*)_channel/\n self.class.send(\"define_method\",name) do |arg|\n msg = \"#{$1.upcase} \"\n msg += \"#{arg[:dest]} \" unless arg[:dest].nil?\n msg += \"#{arg[:who]} \" unless arg[:who].nil?\n msg += \"#{arg[:what]} \" unless arg[:what].nil?\n msg += \"#{arg[:args]} \" unless arg[:args].nil?\n msg += \":#{arg[:msg]} \" unless arg[:msg].nil?\n puts \">>> #{msg}\".blue\n IRC::send_msg msg\n end \n return self.send name,args[0]\n end\n super\n end",
"def presence_message_generate(channel_name, action, subscriptor)\n presence_channel = \"#{channel_name}-presence\"\n a = { :channel => presence_channel,\n :data => {\n :user_id => subscriptor[:user_id],\n :action => action,\n :data => subscriptor[:data]\n }\n }\n end",
"def set_channel_id\n @channel_id = SecureRandom.alphanumeric(8)\n end",
"def create_communication_channel(user_id,communication_channel__address__,communication_channel__type__,opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n :communication_channel__address__,\n :communication_channel__type__,\n :skip_confirmation,\n \n ]\n\n # verify existence of params\n raise \"user_id is required\" if user_id.nil?\n raise \"communication_channel__address__ is required\" if communication_channel__address__.nil?\n raise \"communication_channel__type__ is required\" if communication_channel__type__.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :user_id => user_id,\n :communication_channel__address__ => communication_channel__address__,\n :communication_channel__type__ => communication_channel__type__\n )\n\n # resource path\n path = path_replace(\"/v1/users/{user_id}/communication_channels\",\n :user_id => user_id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_params(options, query_param_keys)\n if opts[:next_page]\n pagination_params = page_params_load(:post, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:post, path, query_params, form_params, headers)\n page_params_store(:post, path)\n CommunicationChannel.new(response)\n end",
"def create\n user = User.find_by(token: params[:token])\n new_message_params = {\n text: message_params[:text],\n conversation_id: message_params[:conversation_id],\n user_id: user.id,\n username: user.username\n }\n @message = Message.new(new_message_params)\n conversation = Conversation.find(message_params[:conversation_id])\n\n if @message.save\n # render json: @message, status: :created, location: @message\n serialized_data = ActiveModelSerializers::Adapter::Json.new(\n MessageSerializer.new(@message)\n ).serializable_hash\n MessagesChannel.broadcast_to conversation, serialized_data\n head :ok\n else\n render json: @message.errors, status: :unprocessable_entity\n end\n end",
"def request_channel\n if channel.nil?\n begin\n transaction do\n channel = Channel.new\n channel.save!\n self.channel_id = channel.id\n self.save!\n end\n rescue ActiveRecord::RecordInvalid\n false\n end\n else\n false\n end\n end",
"def create\n byebug\n @tv_channel = TvChannel.new(tv_channel_params)\n\n respond_to do |format|\n if @tv_channel.save\n format.html { redirect_to @tv_channel, notice: 'Tv channel was successfully created.' }\n format.json { render :show, status: :created, location: @tv_channel }\n else\n format.html { render :new }\n format.json { render json: @tv_channel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n message = Message.new(message_params)\n message.user = current_user\n if message.save\n # 'messages' is name of channel we are broadcasting to\n ActionCable.server.broadcast 'messages',\n # Set message and user\n message: message.content,\n user: message.user.first_name\n head :ok\n end\n end",
"def method_missing(name, *args, &block)\n if name =~ /(.*)_channel/\n define_send(name, $1)\n return self.send(name, args[0], args[1])\n end\n super\n end",
"def creating( msg )\n @log.info \"creating #{msg}\"\n end",
"def create\n create_message(params)\n end",
"def create\n # if params[:user_id].to_i == current_user[:id]\n # return\n # end\n @message = Message.new(message_params)\n @message.user = current_user\n @message.room_id = params[:room_id]\n @messages = Message.all\n ActionCable.server.broadcast \"room_channel_#{@message.room_id}\", message: @message\n\n if @message.save\n render json: @message\n else\n render plain: \"Failed to create a message\", status: :unprocessable_entity\n end\n end",
"def create\n @channel_info = ChannelInfo.new(params[:channel_info])\n\n respond_to do |format|\n if @channel_info.save\n format.html { redirect_to marketing_channel_info_path(@channel_info), notice: 'Channel info was successfully created.' }\n format.json { render json: marketing_channel_info_path(@channel_info), status: :created, location: @channel_info }\n end\n end\n end",
"def channels; end",
"def initialize( options = {} )\n raise ArgumentError.new \"You need to supply a channel id\" unless options[ :id ] and !options[ :id ].empty?\n @id, @role, @items = options[ :id ], options.fetch( :role, nil ), options.fetch( :items, parse( options[ :id ] ) )\n @def_callback = lambda { |channel, val| self._broadcast channel, val }\n @format_proc = lambda { |msg| msg.respond_to?(options[:format_method].to_sym) ? msg.send( options[:format_method].to_sym, options[:format] ): msg } if options[:format] and options[:format_method]\n send @role.to_sym if _has_role? # activate the channel\n end",
"def channel_request( type )\n writer = @buffers.writer\n writer.write_byte CHANNEL_REQUEST\n writer.write_long 0 # channel id\n writer.write_string type\n writer.write_byte 0 # want_confirm\n \n @session.send_message writer\n end",
"def create\n @channel_status = ChannelStatus.new(params[:channel_status])\n\n respond_to do |format|\n if @channel_status.save\n format.html { redirect_to @channel_status, notice: 'Channel status was successfully created.' }\n format.json { render json: @channel_status, status: :created, location: @channel_status }\n else\n format.html { render action: \"new\" }\n format.json { render json: @channel_status.errors, status: :unprocessable_entity }\n end\n end\n end"
] | [
"0.7314882",
"0.71098524",
"0.7033836",
"0.6868919",
"0.681347",
"0.6757599",
"0.6727253",
"0.6645563",
"0.65945053",
"0.6563238",
"0.6563238",
"0.65439284",
"0.65344584",
"0.6502589",
"0.65021276",
"0.6493995",
"0.6493995",
"0.6492331",
"0.64906824",
"0.6485189",
"0.6481412",
"0.6474707",
"0.6473269",
"0.6455648",
"0.64344025",
"0.64153427",
"0.63964605",
"0.63951313",
"0.63826907",
"0.6375763",
"0.63721657",
"0.6347683",
"0.6331531",
"0.6321668",
"0.62957364",
"0.6293076",
"0.62745667",
"0.623637",
"0.6226729",
"0.62238055",
"0.6196663",
"0.61834735",
"0.61594534",
"0.61587435",
"0.6145191",
"0.61379236",
"0.6110372",
"0.6084794",
"0.6083542",
"0.607404",
"0.6069959",
"0.6045784",
"0.60450596",
"0.60253096",
"0.60179466",
"0.60179466",
"0.6009819",
"0.600266",
"0.60001516",
"0.59789205",
"0.5962813",
"0.5951987",
"0.59221834",
"0.59080887",
"0.5903508",
"0.5886952",
"0.5857317",
"0.58388025",
"0.58383375",
"0.5821249",
"0.5803845",
"0.5792563",
"0.57911646",
"0.57801664",
"0.57794607",
"0.57753956",
"0.5756943",
"0.57459193",
"0.57216406",
"0.5702811",
"0.5699684",
"0.56947994",
"0.5694701",
"0.5676444",
"0.567568",
"0.56667995",
"0.5648877",
"0.5648313",
"0.56445366",
"0.56423134",
"0.5631753",
"0.56317425",
"0.5614691",
"0.56071293",
"0.560071",
"0.5579095",
"0.55779356",
"0.5575055",
"0.5567049",
"0.5544018"
] | 0.7042559 | 2 |
Internal handler for CHANNEL_UPDATE | def update_channel(data)
channel = Channel.new(data, self)
old_channel = @channels[channel.id]
return unless old_channel
old_channel.update_from(channel)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n Channel.channels_to_update\n end",
"def update!(**args)\n @channel = args[:channel] if args.key?(:channel)\n end",
"def update_channel(data)\n channel = Channel.new(data, self)\n old_channel = @channels[channel.id]\n return unless old_channel\n old_channel.update_from(channel)\n end",
"def update\r\n respond_to do |format|\r\n if @channel.update(channel_params)\r\n format.html { redirect_to user_channels_path(current_user)}\r\n else\r\n format.html { render :edit, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update!(**args)\n @channel_data = args[:channel_data] if args.key?(:channel_data)\n @failure = args[:failure] if args.key?(:failure)\n end",
"def update\n respond_to do |format|\n if @channel.update(channel_params)\n format.html { redirect_to @channel, notice: 'Channel was successfully updated.' }\n format.json { render :show, status: :ok, location: @channel }\n else\n format.html { render :edit }\n format.json { render json: @channel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @channel.update(channel_params)\n format.html { redirect_to @channel, notice: 'Channel was successfully updated.' }\n format.json { render :show, status: :ok, location: @channel }\n else\n format.html { render :edit }\n format.json { render json: @channel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def channel_update(attributes = {}, &block)\n register_event(ChannelUpdateEvent, attributes, block)\n end",
"def update\n if @chatty_crow_channel.update_attributes(params[:chatty_crow_channel])\n flash[:notice] = l(:notice_successful_create)\n redirect_to_plugin_settings\n else\n render action: :edit\n end\n end",
"def update\r\n channel = Channel.where(service: channel_params[:service], channel: channel_params[:channel]).first\r\n if channel.nil?\r\n render json: {error: true, message: \"Channel not found\"}\r\n else\r\n if channel.update(chanmod_params)\r\n render json: channel\r\n else\r\n render json: {error: true, message: channel.errors}\r\n end\r\n end\r\n end",
"def update\n respond_to do |format|\n if @channel.update(channel_params)\n format.html { redirect_to @channel, notice: 'Channel was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @channel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @channel.update(channel_params)\n format.html { redirect_to @channel, notice: 'Channel was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @channel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @channel.update_attributes(params[:channel])\n flash[:notice] = 'Channel was successfully updated.'\n format.html { redirect_to(@channel) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @channel.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @universal_channel.update(universal_channel_params)\n format.html { redirect_to @universal_channel, notice: 'Universal channel was successfully updated.' }\n format.json { render :show, status: :ok, location: @universal_channel }\n else\n format.html { render :edit }\n format.json { render json: @universal_channel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @channel = Channel.find(params[:id])\n flash[:notice] = t('controllers.channels.channel_was_successfully_updated') if @channel.update_attributes(params[:channel])\n\n respond_with @channel\n end",
"def update!(**args)\n @channel_type = args[:channel_type] if args.key?(:channel_type)\n @enabled = args[:enabled] if args.key?(:enabled)\n end",
"def update\n @raw_channel = RawChannel.find(params[:id])\n\n respond_to do |format|\n if @raw_channel.update_attributes(params[:raw_channel])\n format.html { redirect_to @raw_channel, notice: 'Raw channel was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @raw_channel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @channel = Channel.find(params[:id])\n\n respond_to do |format|\n if @channel.update_attributes(params[:channel])\n format.html { redirect_to @channel, notice: 'Channel was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @channel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @channel_class.update(channel_class_params)\n format.html { redirect_to @channel_class, notice: '频道修改成功.' }\n format.json { render :show, status: :ok, location: @channel_class }\n else\n format.html { render :edit }\n format.json { render json: @channel_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @channel = Channel.find(params[:id])\n\n respond_to do |format|\n if @channel.update_attributes(params[:channel])\n flash[:notice] = 'Channel was successfully updated.'\n format.html { redirect_to(@channel) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @channel.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update_message(data); end",
"def update_message(data); end",
"def update!(**args)\n @agent_channel = args[:agent_channel] if args.key?(:agent_channel)\n @customer_channel = args[:customer_channel] if args.key?(:customer_channel)\n end",
"def update!(**args)\n @agent_channel = args[:agent_channel] if args.key?(:agent_channel)\n @customer_channel = args[:customer_channel] if args.key?(:customer_channel)\n end",
"def update\n @channel = Channel.find(params[:id])\n\n respond_to do |format|\n if @channel.update_attributes(params[:channel])\n flash[:notice] = 'Canal modifié.'\n format.html { redirect_to :action=>:show, :id=>@channel.id }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @channel.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update_channel\n @channel = Channel.find(params[:id])\n @channel.update(params[:channel])\n redirect \"/channels/#{@channel.id}\"\n end",
"def update\n\t\t# channel_sid = params[:channel_sid]\n\t\t# message_sid = params[:id]\n\t\t# @client = Twilio::REST::Client.new(ENV['account_sid'], ENV['auth_token'])\n\n\t\t# # Update the message\n\t\t# service = @client.chat.v2.services(ENV['service_sid'])\n\t\t# channel = service.channels(channel_sid).fetch\n\t\t# message = channel.messages(message_sid).fetch\n\t\t# message_updated = message.update(body: params[:body])\n\t\t# puts \"#{message_updated.sid} #{message_updated.body}\"\n\t\t# new_message = \"Message was changed\"\n\t\t# json_response(new_message)\n\tend",
"def update\n #only user can modify \n unless current_user.has_role?(:admin) || current_user.has_role?(:user)\n redirect_to admin_channels_path, alert: \"没有权限\"\n return\n end\n\n admin_channel_params[:user_id] = current_user.id\n\n respond_to do |format|\n if @admin_channel.update(admin_channel_params)\n update_tag(@admin_channel)\n if @admin_channel.short_title.blank?\n @admin_channel.short_title = get_short_title('channel', @admin_channel.title)\n @admin_channel.save!\n end\n\n format.html { redirect_to @admin_channel, notice: '栏目更新成功.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @admin_channel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def updated(message)\n end",
"def update\n respond_to do |format|\n if @channel_type.update(channel_type_params)\n format.html { redirect_to channel_types_path, notice: 'Channel type was successfully updated.' }\n format.json { render :show, status: :ok, location: @channel_type }\n else\n format.html { render :edit }\n format.json { render json: @channel_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update(msg)\n case msg\n # Handle disconnection from server\n # Note that publishing a :quit event (see #disconnect) will return a\n # :disconnected event when server has closed the connection.\n # Guest accounts and characters are deleted here.\n when :disconnected\n @conn = nil\n unsubscribe_all\n Engine.instance.db.makeswap(id)\n if @character\n world.connected_characters.delete(@character.id)\n world.connected_characters.each do |pid|\n add_event(@character.id,pid,:show,\"#{name} has disconnected.\")\n end\n Engine.instance.db.makeswap(@character.id)\n @character.account = nil\n if @character.name =~ /Guest/i\n world.all_characters.delete(@character.id)\n delete_object(@character.id)\n end\n @character = nil\n end\n if name =~ /Guest/i\n world.all_accounts.delete(id)\n delete_object(id)\n end\n # Issued when a NAWS event occurs\n # Currently this clears and resets the screen. Ideally it should attempt\n # to redraw it.\n when :termsize\n @termsize = @conn.query(:termsize)\n if vtsupport?\n publish(\"[home #{@termsize[1]},1][clearline][cursave]\" +\n \"[home 1,1][scrreset][clear][scrreg 1,#{@termsize[1]-3}][currest]\")\n end\n # Negotiation with client done. Start talking to it.\n when :initdone\n @echo = @conn.query(:echo)\n @termsize = @conn.query(:termsize)\n @terminal = @conn.query(:terminal)\n if vtsupport?\n publish(\"[home #{@termsize[1]},1][clearline][cursave]\" +\n \"[home 1,1][scrreset][clear][scrreg 1,#{@termsize[1]-3}][currest]\")\n sendmsg(LOGO)\n end\n sendmsg(BANNER)\n sendmsg(append_echo(\"login> \"))\n @mode = :name\n # This is a message from our user\n when String\n parse_messages(msg)\n else\n log.error \"Account#update unknown message - #{msg.inspect}\"\n end\n rescue\n # We squash and print out all exceptions here. There is no reason to\n # throw these back at the Connection.\n log.error $!\n end",
"def update(channel, mute, deaf, self_mute, self_deaf)\n @voice_channel = channel\n @mute = mute\n @deaf = deaf\n @self_mute = self_mute\n @self_deaf = self_deaf\n end",
"def update\n respond_to do |format|\n if @slack_channel.update(slack_channel_params)\n format.html { redirect_to @slack_channel, notice: 'Slack channel was successfully updated.' }\n format.json { render :show, status: :ok, location: @slack_channel }\n else\n format.html { render :edit }\n format.json { render json: @slack_channel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @channels_by_provider = args[:channels_by_provider] if args.key?(:channels_by_provider)\n end",
"def update!(**args)\n @channel_id = args[:channel_id] if args.key?(:channel_id)\n @channel_name = args[:channel_name] if args.key?(:channel_name)\n @channel_number = args[:channel_number] if args.key?(:channel_number)\n @deeplink = args[:deeplink] if args.key?(:deeplink)\n @mid = args[:mid] if args.key?(:mid)\n @network_mid = args[:network_mid] if args.key?(:network_mid)\n end",
"def update\n @channel_status = ChannelStatus.find(params[:id])\n\n respond_to do |format|\n if @channel_status.update_attributes(params[:channel_status])\n format.html { redirect_to @channel_status, notice: 'Channel status was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @channel_status.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # find and update a specific message\n end",
"def update\n # find and update a specific message\n end",
"def update!(**args)\n @received_messages = args[:received_messages] unless args[:received_messages].nil?\n end",
"def update\n respond_to do |format|\n if update = @incident.add_update(change: incident_params, comment: params[:comment])\n notified_channels.each do |ch|\n ch.notify(update)\n end\n\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",
"def update!(**args)\n @channel = args[:channel] if args.key?(:channel)\n @count = args[:count] if args.key?(:count)\n @device_os_version = args[:device_os_version] if args.key?(:device_os_version)\n @system = args[:system] if args.key?(:system)\n @version = args[:version] if args.key?(:version)\n end",
"def update\n @channel_info = ChannelInfo.find(params[:id])\n\n respond_to do |format|\n if @channel_info.update_attributes(params[:channel_info])\n format.html { redirect_to marketing_channel_info_path(@channel_info), notice: 'Channel info was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @channel_info.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tv_channel.update(tv_channel_params)\n format.html { redirect_to @tv_channel, notice: 'Tv channel was successfully updated.' }\n format.json { render :show, status: :ok, location: @tv_channel }\n else\n format.html { render :edit }\n format.json { render json: @tv_channel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update(event,timestamp,nick,server)\n case event\n when Event::LINK_ESTABLISHED\n #\n # when connect to server, do login\n #\n login(server)\n changed\n notify_observers(Message.new(event,\n timestamp,nick,server))\n \n when Event::LINK_CLOSED,Event::LINK_FAILED\n changed\n notify_observers(Message.new(event,\n timestamp,nick,server))\n \n when Event::RECV_MESSAGE\n\n #\n # message capcellized\n #\n msg=Message.new(@connector.read,\n timestamp,nick,server)\n #\n # handle some message\n #\n if(process(msg))\n changed\n notify_observers(msg)\n end\n end\n end",
"def update\n TDirmessage.where(\"receiver_user_id=? and dirworkspace_id=?\", session[:user_id], session[:workspace_id]).update_all(is_read: false)\n TChunreadMessage.joins(\"join t_channel_messages on t_channel_messages.chmsg_id=t_chunread_messages.chmsg_id\")\n .where(\"chuser_id=? \", session[:user_id]).update_all(is_read: false)\n redirect_back(fallback_location: update_path)\n end",
"def update\n respond_to do |format|\n if @channel_statistic.update(channel_statistic_params)\n format.html { redirect_to @channel_statistic, notice: 'Channel statistic was successfully updated.' }\n format.json { render :show, status: :ok, location: @channel_statistic }\n else\n format.html { render :edit }\n format.json { render json: @channel_statistic.errors, status: :unprocessable_entity }\n end\n end\n end",
"def subscribe_to_channel; end",
"def update\n # find and update a specific message\n end",
"def did_receive_channel_message(stem, sender, channel, msg)\n end",
"def update\n respond_to do |format|\n if @channel_user.update(channel_user_params)\n format.html { redirect_to @channel_user, notice: 'Channel user was successfully updated.' }\n format.json { render :show, status: :ok, location: @channel_user }\n else\n format.html { render :edit }\n format.json { render json: @channel_user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def on_receive(message)\n update\n end",
"def update_channel(token, channel_id, name, topic, position = 0)\n request(\n __method__,\n :patch,\n \"#{api_base}/channels/#{channel_id}\",\n { name: name, position: position, topic: topic }.to_json,\n Authorization: token,\n content_type: :json\n )\n end",
"def update!(**args)\n @broadcast_id = args[:broadcast_id] if args.key?(:broadcast_id)\n @channel_id = args[:channel_id] if args.key?(:channel_id)\n @view_url = args[:view_url] if args.key?(:view_url)\n end",
"def update!(**args)\n @category_state = args[:category_state] if args.key?(:category_state)\n @channel_state = args[:channel_state] if args.key?(:channel_state)\n @notification_capabilities = args[:notification_capabilities] if args.key?(:notification_capabilities)\n end",
"def handle_update\n navdata = connection.receive_data\n publish(event_topic_name(\"update\"), navdata)\n end",
"def notify_game_change\n connection.execute \"NOTIFY #{channel}, #{connection.quote self.to_s}\"\n end",
"def update!(**args)\n @event = args[:event] if args.key?(:event)\n @id = args[:id] if args.key?(:id)\n @kind = args[:kind] if args.key?(:kind)\n @uploader_channel_id = args[:uploader_channel_id] if args.key?(:uploader_channel_id)\n end",
"def update_channel_position(auth, server_id, channel_id, position, reason = nil)\n MijDiscord::Core::API.request(\n :guilds_sid_channels,\n server_id,\n :patch,\n \"#{MijDiscord::Core::API::APIBASE_URL}/guilds/#{server_id}/channels\",\n { id: channel_id, position: position }.to_json,\n Authorization: auth,\n content_type: :json,\n 'X-Audit-Log-Reason': reason\n )\n end",
"def update(event,timestamp,nick,server)\n\n @mutex.lock\n case event\n when Event::LINK_CLOSED,Event::LINK_FAILED\n \n #\n # When link close or failed, remove server from table\n #\n if(@quited.include?(server))\n @connectors.delete(server)\n @connectors.rehash\n @quited.delete(server)\n end\n \n when Event::RECV_MESSAGE\n \n #\n # get one message from server and forward\n #\n if(@connectors.has_key?(server))\n msg=@connectors[server].read\n unless(msg.nil?)\n @msgQueue.push(msg)\n end\n end\n end\n\n #\n # call MessageDistributer#update NOT directory,\n # but gather to one thread.\n #\n @eventQueue.push([event,timestamp,nick,server])\n\n @mutex.unlock\n end",
"def update!(**args)\n @message = args[:message] if args.key?(:message)\n end",
"def update!(**args)\n @message = args[:message] if args.key?(:message)\n end",
"def update!(**args)\n @message = args[:message] if args.key?(:message)\n @state = args[:state] if args.key?(:state)\n end",
"def update!(**args)\n @message = args[:message] if args.key?(:message)\n @state = args[:state] if args.key?(:state)\n end",
"def update!(**args)\n @message = args[:message] if args.key?(:message)\n @state = args[:state] if args.key?(:state)\n end",
"def update!(**args)\n @message = args[:message] if args.key?(:message)\n @state = args[:state] if args.key?(:state)\n end",
"def update!(**args)\n @message = args[:message] if args.key?(:message)\n @state = args[:state] if args.key?(:state)\n end",
"def update(options)\n message = symbolize_keys(options)\n\n debug \"Sending via Web API\", message\n client.web_client.chat_update(message)\n end",
"def update update\n case update.type.to_sym\n when :update_snakes\n snakes = update.msg \n if @client\n begin\n stonedSnakes = snakes.map { |s| {\"name\" => s.get_name, \"tail\" => s.get_tail.to_json} }\n stoneColdKilledSnakes = JSON.dump(stonedSnakes)\n msg = Message.new(\"update_snakes\", stoneColdKilledSnakes)\n @client.puts(JSON.dump(msg))\n rescue Exception => myException\n @log.info \"Exception rescued: #{myException}\"\n @client = nil\n @isBot = true\n end \n end\n when :update_colors\n if @client\n @client.puts(JSON.dump(update))\n end\n when :identity\n if @client\n# @client.puts(JSON.dump(update));\n end\n end\n end",
"def update!(**args)\n @message = args[:message] if args.key?(:message)\n @state = args[:state] if args.key?(:state)\n @update_time = args[:update_time] if args.key?(:update_time)\n end",
"def update\n @subscription = Subscription.by_user_channel_ids(current_user.id, params[:channel_id])\n\n respond_to do |format|\n if @subscription and @subscription.update_attributes(params[:subscription])\n @channel = Channel.find(params[:channel_id])\n format.html { redirect_to @subscription, notice: I18n.t('subscription_updated') }\n format.json { render json: { name: @channel.subscription_name(current_user) }, status: :ok}\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update(channel_id, channel)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'channelId', channel_id)\n\t\t\tclient.add_param(kparams, 'channel', channel)\n\t\t\tclient.queue_service_action_call('channel', 'update', 'KalturaChannel', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend",
"def update\n respond_to do |format|\n if @user_to_channel_subscription.update(user_to_channel_subscription_params)\n format.html { redirect_to @user_to_channel_subscription, notice: 'User to channel subscription was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_to_channel_subscription }\n else\n format.html { render :edit }\n format.json { render json: @user_to_channel_subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @channels = args[:channels] if args.key?(:channels)\n @input_id = args[:input_id] if args.key?(:input_id)\n @provider_type = args[:provider_type] if args.key?(:provider_type)\n end",
"def update!(**args)\n @hl7_ack = args[:hl7_ack] if args.key?(:hl7_ack)\n @message = args[:message] if args.key?(:message)\n end",
"def update!(**args)\n @channel_map = args[:channel_map] if args.key?(:channel_map)\n @channel_ordering = args[:channel_ordering] if args.key?(:channel_ordering)\n @non_diegetic_stereo = args[:non_diegetic_stereo] if args.key?(:non_diegetic_stereo)\n @normalization = args[:normalization] if args.key?(:normalization)\n @num_channels = args[:num_channels] if args.key?(:num_channels)\n @order = args[:order] if args.key?(:order)\n @type = args[:type] if args.key?(:type)\n @version = args[:version] if args.key?(:version)\n end",
"def set_channel\n @channel = Channel.find(params[:id])\n end",
"def update!(**args)\n @message_id = args[:message_id] if args.key?(:message_id)\n @message_type = args[:message_type] if args.key?(:message_type)\n @topic_read_time_usec = args[:topic_read_time_usec] if args.key?(:topic_read_time_usec)\n end",
"def update_facebook_channel(project_id, query_id, opts = {})\n put \"projects/#{project_id}/facebookchannels/#{query_id}\", opts\n end",
"def set_channel\n @channel = ::Channel.find(params[:id])\n end",
"def set_channel\r\n @channel = Channel.find(params[:id])\r\n end",
"def update!(**args)\n @message = args[:message] if args.key?(:message)\n @status = args[:status] if args.key?(:status)\n end",
"def connected_update(protocol_message)\n # ClientID validity is already checked as part of the incoming message processing\n client.auth.configure_client_id protocol_message.connection_details.client_id\n\n # Update the connection details and any associated defaults\n connection.set_connection_details protocol_message.connection_details\n\n connection.configure_new protocol_message.connection_id, protocol_message.connection_details.connection_key, protocol_message.connection_serial\n\n state_change = Ably::Models::ConnectionStateChange.new(\n current: connection.state,\n previous: connection.state,\n event: Ably::Realtime::Connection::EVENT(:update),\n reason: protocol_message.error,\n protocol_message: protocol_message\n )\n connection.emit :update, state_change\n end",
"def notify_change(input_channel)\n\n $test_logger.log(\"Notify change #{input_channel}\")\n\n case input_channel\n\n #If XML is changed\n when InputChannel::XML\n\n if @is_reply_ilv == true\n $test_logger.log(\"XML to hex/raw not processed as current ILV is reply ILV!\")\n else\n @ilv_hex_str = xml_to_hex(@xml_ilv_node)\n @ilv_raw_str = ILVMessage.hex_to_raw(@ilv_hex_str)\n end\n\n #If HEX string is changed\n when InputChannel::HEX\n @ilv_raw_str = ILVMessage.hex_to_raw(@ilv_hex_str)\n raw_to_xml(@xml_ilv_node, @ilv_raw_str)\n\n #If RAW string is changed\n when InputChannel::RAW\n @ilv_hex_str = ILVMessage.raw_to_hex(@ilv_raw_str)\n raw_to_xml(@xml_ilv_node, @ilv_raw_str)\n\n else\n raise \"Invalid channel specified '#{input_channel}'!\"\n end\n end",
"def update!(**args)\n @message = args[:message] if args.key?(:message)\n @release = args[:release] if args.key?(:release)\n @type = args[:type] if args.key?(:type)\n end",
"def send_update\n changed\n notify_observers(self)\n end",
"def update!(**args)\n @message = args[:message] unless args[:message].nil?\n end",
"def update!(**args)\n @message = args[:message] unless args[:message].nil?\n end",
"def set_channel\n @channel = Channel.find(params[:id])\n end",
"def set_channel\n @channel = Channel.find(params[:id])\n end",
"def set_channel\n @channel = Channel.find(params[:id])\n end",
"def set_channel\n @channel = Channel.find(params[:id])\n end",
"def set_channel\n @channel = Channel.find(params[:id])\n end",
"def set_channel\n @channel = Channel.find(params[:id])\n end",
"def set_channel\n @channel = Channel.find(params[:id])\n end",
"def set_channel\n @channel = Channel.find(params[:id])\n end",
"def set_channel\n @channel = Channel.find(params[:id])\n end",
"def set_channel\n @channel = Channel.find(params[:id])\n end",
"def update!(**args)\n @supports_conversation_protocol = args[:supports_conversation_protocol] if args.key?(:supports_conversation_protocol)\n @version = args[:version] if args.key?(:version)\n end",
"def edit_channel(channel, status, game)\n return false unless @access_token\n\n path = \"/channels/#{channel}/?oauth_token=#{@access_token}\"\n url = @base_url + path\n data = {\n :channel =>{\n :game => game,\n :status => status\n }\n }\n put(url, data)\n end",
"def update(**options)\n\t\t\tjson = put_request(options.merge(:channel_key => @key))\n\t\t\tres = JSON.parse(json.body)\n\n\t\t\tif json.status == 200\n\t\t\t\tprocess_update_response(res, options)\n\t\t\telse\n\t\t\t\traise \"HTTP Error #{json.status}: #{json.body}\"\n\t\t\tend\n\n\t\t\treturn self\n\t\tend"
] | [
"0.7691809",
"0.73157984",
"0.7256416",
"0.6996448",
"0.6993422",
"0.69134665",
"0.69134665",
"0.6874695",
"0.6865345",
"0.68566614",
"0.68542105",
"0.68542105",
"0.68155867",
"0.66716224",
"0.6664757",
"0.6655276",
"0.6610942",
"0.65946025",
"0.6572071",
"0.65672153",
"0.65490174",
"0.65490174",
"0.6497751",
"0.6497751",
"0.6459729",
"0.6451076",
"0.64347154",
"0.64044607",
"0.6359097",
"0.62628174",
"0.62490165",
"0.6238572",
"0.6231824",
"0.6197974",
"0.6173743",
"0.61537987",
"0.61463916",
"0.61463916",
"0.61410356",
"0.61228484",
"0.6110383",
"0.6093946",
"0.6071043",
"0.6059158",
"0.6047306",
"0.6036666",
"0.60265654",
"0.6019551",
"0.6017412",
"0.60095143",
"0.6003681",
"0.598299",
"0.59659666",
"0.596374",
"0.59481364",
"0.5943032",
"0.5940281",
"0.5931559",
"0.59125227",
"0.58921206",
"0.58921206",
"0.58899045",
"0.58899045",
"0.58899045",
"0.58899045",
"0.58899045",
"0.5888649",
"0.5874782",
"0.58747244",
"0.58689594",
"0.58563274",
"0.58540356",
"0.58441234",
"0.57916284",
"0.57846874",
"0.5775316",
"0.57718384",
"0.5770183",
"0.5767628",
"0.57487714",
"0.57474107",
"0.573253",
"0.57307947",
"0.5716419",
"0.571525",
"0.5715177",
"0.5715177",
"0.5711674",
"0.5711674",
"0.5711674",
"0.5711674",
"0.5711674",
"0.5711674",
"0.5711674",
"0.5711674",
"0.5711674",
"0.5711674",
"0.57102567",
"0.57012695",
"0.5700996"
] | 0.7251911 | 3 |
Internal handler for CHANNEL_DELETE | def delete_channel(data)
channel = Channel.new(data, self)
server = channel.server
# Handle normal and private channels separately
if server
@channels.delete(channel.id)
server.delete_channel(channel.id)
elsif channel.pm?
@pm_channels.delete(channel.recipient.id)
elsif channel.group?
@channels.delete(channel.id)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n \n @channel = @channel || ChannelClass.find(params[:id])\n @channel.destroy\n respond_to do |format|\n format.html { redirect_to channel_classes_url, notice: '频道删除成功.' }\n format.json { head :no_content }\n end\n \n end",
"def destroy\n @chatty_crow_channel.destroy\n flash[:notice] = l(:notice_successful_delete)\n redirect_to_plugin_settings\n end",
"def delete\n @channel_control.delete\n end",
"def delete_channel(data)\n channel = Channel.new(data, self)\n server = channel.server\n\n # Handle normal and private channels separately\n if server\n @channels.delete(channel.id)\n server.channels.reject! { |c| c.id == channel.id }\n else\n @private_channels.delete(channel.id)\n end\n end",
"def delete(reason = nil)\n API::Channel.delete(@bot.token, @id, reason)\n end",
"def destroy\n @raw_channel = RawChannel.find(params[:id])\n @raw_channel.destroy\n\n respond_to do |format|\n format.html { redirect_to raw_channels_url }\n format.json { head :no_content }\n end\n end",
"def channel_delete(attributes = {}, &block)\n register_event(ChannelDeleteEvent, attributes, block)\n end",
"def destroy\r\n @channel.destroy\r\n respond_to do |format|\r\n format.html { redirect_to user_channels_path(current_user)}\r\n end\r\n end",
"def destroy\n @channel = Channel.find(params[:id])\n @channel.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_channels_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n @channel = Channel.find(params[:channel_id])\n rescue ActiveRecord::RecordNotFound => e\n respond_to do |format|\n format.html { redirect_to :back, notice: I18n.t('general.failed_to_unsubscribe') }\n format.json { render json: e, status: :unprocessable_entity }\n end\n else\n current_user.channels.delete(@channel) if current_user.channels.include? @channel\n respond_to do |format|\n format.html { redirect_to @channel, notice: I18n.t('general.unsubscribed') }\n format.json { head :no_content }\n end\n end",
"def destroy\n @channel.destroy\n respond_to do |format|\n format.html { redirect_to channels_url, notice: 'Channel was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @channel.destroy\n respond_to do |format|\n format.html { redirect_to channels_url, notice: 'Channel was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @channel.destroy\n respond_to do |format|\n format.html { redirect_to channels_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @channel.destroy\n\n respond_to do |format|\n format.html { redirect_to(channels_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @channel = Channel.find(params[:id])\n @channel.destroy\n\n respond_to do |format|\n format.html { redirect_to(channels_url) }\n format.xml { head :ok }\n end\n end",
"def unsubscribe_from_channel; end",
"def destroy\n @channel = Channel.find(params[:id])\n @channel.destroy\n\n respond_to do |format|\n format.html { redirect_to channels_url }\n format.json { head :ok }\n end\n end",
"def delete_message(data); end",
"def delete_message(data); end",
"def destroy\n @channel = Channel.find(params[:id])\n @channel.destroy\n\n respond_with @channel\n end",
"def destroy\n @channel.destroy\n respond_to do |format|\n format.html { redirect_to user_path(current_user.id) }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n push_notification :remove\r\n @message.destroy\r\n respond_to do |format|\r\n format.html { redirect_to channel_messages_url(@channel) }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @universal_channel.destroy\n respond_to do |format|\n format.html { redirect_to universal_channels_url, notice: 'Universal channel was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_msg()\n MsgUtil.delete_msg(params[:ch])\n end",
"def delete(opts = {}, &block)\n @channel.once_open do\n exchange_delete(opts.fetch(:if_unused, false), opts.fetch(:nowait, false), &block)\n end\n\n # backwards compatibility\n nil\n end",
"def destroy_channel_request\n channel_request = ChannelRequest.where(:user_id => self.subscriber_id, :channel_id => self.channel_id).first\n channel_request.destroy unless channel_request.blank?\n end",
"def destroy\n @channel_type.destroy\n respond_to do |format|\n format.html { redirect_to channel_types_url, notice: 'Channel type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @fav_channel = WatchChannel.find(params[:id])\n @fav_channel.delete\n flash.now[:notice] = \"#{@fav_channel.channel.channel_or_cug} #{@fav_channel.channel.name} has been removed from your favorite list\"\n end",
"def delete_channel!(channel)\n sns.delete_topic(topic_arn: channel.arn)\n end",
"def destroy\n get_message().delete\n end",
"def destroy\n # delete a specific message\n end",
"def delete_facebook_channel(project_id, query_id)\n delete \"/projects/#{project_id}/facebookchannels/#{query_id}\"\n end",
"def destroy\n # delete a specific message\n end",
"def delete(id)\n\t\t\tkparams = {}\n\t\t\t# Live channel id to delete\n\t\t\tclient.add_param(kparams, 'id', id);\n\t\t\tclient.queue_service_action_call('livechannel', 'delete', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend",
"def cleanup\n @channel.close if @channel\n\n nil\n end",
"def destroy\n @tv_channel.destroy\n respond_to do |format|\n format.html { redirect_to tv_channels_url, notice: 'Tv channel was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def deleteChannel(channelInfo)\r\n\t\tnum = 0\r\n\t\tchannel_id = 0\r\n\t\tchannelInfo.each_pair { | name, value |\r\n\t\t\tif(name == \"channel_id\")\r\n\t\t\t\tchannel_id = value\r\n\t\t\telse\r\n\t\t\t\tputs \"wrong parameter: #{name}\"\r\n\t\t\t\treturn \"wrong parameter: #{name}\"\r\n\t\t\tend\t\t\t\t\r\n\t\t}\r\n\r\n\t\tputs \"Connecting to database...\"\r\n\t\tbegin\r\n\t\t\t# connect to the MySQL server\r\n\t\t\tdbh = DBI.connect(\"DBI:Mysql:#{$db}:#{$db_ip}\",\"#{$user}\", \"#{$pass}\")\r\n\t\t\r\n\t\t\tnum = dbh.do(\"DELETE FROM spectrum WHERE id = '#{channel_id}'\")\r\n\t\t\tif (num == 1)\r\n\t\t\t\tputs \"Channel deleted...\"\r\n\t\t\t\treturn 0\r\n\t\t\tend\r\n\t\t\t\r\n\t\trescue DBI::DatabaseError => e\r\n\t\t\tputs \"An error occurred\"\r\n\t\t\tputs \"Error code: #{e.err}\"\r\n\t\t\tputs \"Error message: #{e.errstr}\"\r\n\t\tensure\r\n\t\t\t# disconnect from server\r\n\t\t\tdbh.disconnect if dbh\r\n\t\tend\r\n\t\t\t\r\n\t\treturn -1\r\n\tend",
"def destroy\n @channel_status = ChannelStatus.find(params[:id])\n @channel_status.destroy\n\n respond_to do |format|\n format.html { redirect_to channel_statuses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n # delete a specific message\n end",
"def destroy\n\t\tchannel_sid = params[:channel_sid]\n\t\tmessage_sid = params[:id]\n\t\tputs message_sid\n\t\t@client = Twilio::REST::Client.new(ENV['account_sid'], ENV['auth_token'])\n\t\t# Remove the member\n\t\tservice = @client.chat.v2.services(ENV['service_sid'])\n\t\tchannel = service.channels(channel_sid)\n\t\tresponse = channel.messages(message_sid).delete\n\t\tputs response\n\t\tmessages_response= \"{\\n\\\"message\\\": \\\"Message was deleted\\\"\\n}\"\n\t\tjson_response(messages_response)\n\tend",
"def delete(channel_id)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'channelId', channel_id)\n\t\t\tclient.queue_service_action_call('channel', 'delete', 'bool', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend",
"def destroy\n @slack_channel.destroy\n respond_to do |format|\n format.html { redirect_to slack_channels_url, notice: 'Slack channel was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def remove_channel\n channel = Channel.find(params[:channel_id])\n @bss_title_id = BssTitleId.find(params[:id])\n \t@bss_title_id.channels.delete(channel)\n \trespond_to do |format|\n format.html {\n if params[:source] == 'episode_show'\n redirect_to episode_path(@bss_title_id.episode, show_details(:channel, params)), notice: 'Channel: ' + channel.name + ' removed'\n else\n redirect_to bss_title_id_path(@bss_title_id, show_details(:channel, params)), notice: 'Channel: ' + channel.name + ' removed'\n end\n }\n\t \tformat.json {render :show, status: :removed, location: @bss_title_id}\n \tend\n end",
"def delete\n if ensure_same_as_logged_person(@message.poster.guid)\n @message.delete\n render :status => :ok and return\n elsif ensure_same_as_logged_person(@channel.owner.guid)\n @message.delete\n render :status => :ok and return\n end\n render :status => :forbidden and return\n end",
"def destroy\n @channel_user.destroy\n respond_to do |format|\n format.html { redirect_to channel_users_url, notice: 'Channel user was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete *args, &block\n res = @conn.delete *args, &block\n handle res, parse: false\n end",
"def delete(opts = {}, &block)\n @channel.once_open do\n self.once_name_is_available do\n queue_delete(opts.fetch(:if_unused, false), opts.fetch(:if_empty, false), opts.fetch(:nowait, false), &block)\n end\n end\n\n # backwards compatibility\n nil\n end",
"def destroy\n #only user can modify \n unless current_user.has_role?(:admin) || current_user.has_role?(:user)\n redirect_to admin_channels_path, alert: \"没有权限\"\n return\n end\n @admin_channel.destroy\n respond_to do |format|\n format.html { redirect_to admin_channels_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @fdn_received_message = Fdn::ReceivedMessage.find(params[:id])\n #@fdn_received_message.destroy\n @fdn_received_message.be_trashed(current_user)\n\n respond_to do |format|\n format.html { redirect_to fdn_messages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @activity = Activity.create(user_id: current_user.id, activity_type: 'Destroy', target_type: 'Channel', target_id: @channel.id)\n @channel.destroy\n respond_to do |format|\n format.html { redirect_to channels_url, notice: 'Channel was successfully destroyed.' }\n format.json { head :no_content }\n format.js\n end\n end",
"def delete\n @client.post('/api/del_msg', id: get_attribute(:name))\n end",
"def destroy\n @channel_info = ChannelInfo.find(params[:id])\n @channel_info.destroy\n\n respond_to do |format|\n format.html { redirect_to marketing_channel_infos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sales_channel = SalesChannel.find(params[:id])\n @sales_channel.destroy\n\n respond_to do |format|\n format.html { redirect_to sales_channels_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @channel_statistic.destroy\n respond_to do |format|\n format.html { redirect_to channel_statistics_url, notice: 'Channel statistic was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete(channels)\n\treturn if not channels.is_a? Array #meh\n\tcurChannels = readCurrentChannels()\n\tcurChannels.reject! { |e| channels.include? e.downcase }\n\twriteChannels(curChannels)\nend",
"def destroy\n @youtube_channel.destroy\n respond_to do |format|\n format.html { redirect_to youtube_channels_url, notice: 'Youtube channel was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @channel_category = ChannelCategory.find(params[:id])\n @channel_category.destroy\n\n respond_to do |format|\n format.html { redirect_to marketing_channel_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @conversation = Conversation.find(params[:id])\n\n desc = @conversation.topic\n add_event( EVENT_DELETE_CONVERSATION, desc[0,150], EVENTSOURCE_USER, session[:user_id], session[:user_name], nil)\n\n @conversation.destroy\n\n respond_to do |format|\n format.html { redirect_to(pad_conversations_path(@pad)) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user_to_channel_subscription.destroy\n respond_to do |format|\n format.html { redirect_to user_to_channel_subscriptions_url, notice: 'User to channel subscription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def remove_channel_open_handler( type, id )\n @channel_open_handlers[ type ][ id-1 ] = nil\n end",
"def destroy\n @youtubechannel.destroy\n respond_to do |format|\n format.html { redirect_to youtubechannels_url, notice: 'Youtubechannel was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_level_channel(level, project_name, optional={})\n\t\targs = self.class.new_params\n\t\targs[:method] = 'DELETE'\n\t\targs[:path]['Level'] = level\n\t\targs[:path]['ProjectName'] = project_name\n\t\targs[:pattern] = '/projects/[ProjectName]/level_channels/[Level]'\n\t\targs[:query]['Action'] = 'DeleteLevelChannel'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'http'\n\t\tself.run(args)\n\tend",
"def irc_part_event(stem, sender, arguments) # :nodoc:\n @chan_mutex.synchronize do\n if sender[:nick] == @nick then\n drop_channel arguments[:channel]\n else\n @channel_members[arguments[:channel]].delete sender[:nick]\n end\n #TODO what should we do if we are in the middle of receiving NAMES replies?\n end\n end",
"def delete_communication_channel_id(user_id,id,opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n \n ]\n\n # verify existence of params\n raise \"user_id is required\" if user_id.nil?\n raise \"id is required\" if id.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :user_id => user_id,\n :id => id\n )\n\n # resource path\n path = path_replace(\"/v1/users/{user_id}/communication_channels/{id}\",\n :user_id => user_id,\n :id => id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_params(options, query_param_keys)\n if opts[:next_page]\n pagination_params = page_params_load(:delete, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:delete, path, query_params, form_params, headers)\n page_params_store(:delete, path)\n CommunicationChannel.new(response)\n end",
"def delete(label)\n @connection.call('channel.software.delete', @sid, label)\n end",
"def delete_channel_with_http_info(channel_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ChatChannelsApi.delete_channel ...'\n end\n # verify the required parameter 'channel_id' is set\n if @api_client.config.client_side_validation && channel_id.nil?\n fail ArgumentError, \"Missing the required parameter 'channel_id' when calling ChatChannelsApi.delete_channel\"\n end\n # resource path\n local_var_path = '/chat/channels/{channelId}'.sub('{' + 'channelId' + '}', channel_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', 'application/xml'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'multipart/form-data'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['OAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, 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 => 'Object')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ChatChannelsApi#delete_channel\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def delete_communication_channel_type(user_id,type,address,opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n \n ]\n\n # verify existence of params\n raise \"user_id is required\" if user_id.nil?\n raise \"type is required\" if type.nil?\n raise \"address is required\" if address.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :user_id => user_id,\n :type => type,\n :address => address\n )\n\n # resource path\n path = path_replace(\"/v1/users/{user_id}/communication_channels/{type}/{address}\",\n :user_id => user_id,\n :type => type,\n :address => address)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_params(options, query_param_keys)\n if opts[:next_page]\n pagination_params = page_params_load(:delete, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:delete, path, query_params, form_params, headers)\n page_params_store(:delete, path)\n CommunicationChannel.new(response)\n end",
"def delete_message(id)\n record \"/msg/delete/#{id}\"\n end",
"def destroy\n @category_of_playlists_channel.destroy\n respond_to do |format|\n format.html { redirect_to category_of_playlists_channels_url, notice: 'Category of playlists channel was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sales_channel_api = SalesChannelApi.find(params[:id])\n @sales_channel_api.destroy\n\n respond_to do |format|\n format.html { redirect_to sales_channel_apis_url }\n format.json { head :no_content }\n end\n end",
"def remove_channel(channel_name)\r\n @channels.delete(channel_name.downcase)\r\n end",
"def remove_channel_handler(channel, handler)\n handlers = @channels[channel]\n handlers.delete(handler) unless handlers.nil?\n end",
"def destroy\n destroy_q(@message, messages_url)\n end",
"def disconnect\n @thread.exit\n @client.disconnect\n @channels.clear\n end",
"def destroy\n @reply.destroy\n head :no_content\n end",
"def cleanup_after_unsubscribe(channel)\n return if channel.listeners_count > 0\n logger.debug \"destroying channel #{channel.name}\"\n @channels.delete channel.name\n stat_channel_destroyed channel.name\n destroy if @channels.size == 0\n end",
"def destroy\n @reply.destroy\n\n head :no_content\n end",
"def destroy\n @channel_customer.destroy\n respond_to do |format|\n format.html { redirect_to channel_customers_url, notice: 'Channel customer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def channel\n params.detect { |param| param.start_with?(\"#\") }&.delete(\"#\")\n end",
"def delete_user\n \tputs 'Delete user action'\n users = connection_store.collect_all(:chat_users)\n WebsocketRails[:chatroom].trigger(:client_disconnected, users.to_json) \n end",
"def destroy\n @channel_group.destroy\n respond_to do |format|\n format.html { redirect_to channel_groups_url, notice: 'Channel group was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def part(channel)\n if channel.is_a?(Channel)\n @channels.delete(channel)\n else\n @channels.delete(Channel.find(channel))\n end\n end",
"def delete\n membership = Membership.find_by(uuid: conversation_params[:uuid])\n convo = membership.conversation\n leave_message = convo.messages.create(text: \"Conversation has ended\", user_index: -1)\n MessagesChannel.broadcast_to convo, MessageSerializer.new(leave_message)\n membership.update(is_active: false) if membership\n create_or_join\n end",
"def delete_round(server)\n # Creates a hash channel_id => Array of message IDs in that channel.\n del = @messages[server.id].group_by { |h| h[:channel] }.each_value { |e| e.map! { |h| h[:id] } }\n @messages[server.id] = []\n sleep 2\n del.each_pair do |channel, msgs|\n if msgs.size == 1\n SHRK.channel(channel)&.delete_message(msgs.first)\n else\n SHRK.channel(channel)&.delete_messages(msgs)\n end\n end\n end",
"def did_receive_channel_message(stem, sender, channel, msg)\n end",
"def destroy\n @message.destroy\n end",
"def destroy\n @direct_chat.destroy\n respond_to do |format|\n format.html { redirect_to direct_chats_url, notice: 'Direct chat was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @conversation.destroy\n\n head :no_content\n end",
"def destroy\n @conversation.destroy\n\n head :no_content\n end",
"def delete\n @service.delete_message(self)\n end",
"def delete(params = {})\n http_helper.send_delete_request(\"#{@url_prefix}/#{get_webhook_id!(params)}\", params)\n end",
"def open_channel\n @@game_channels.delete(@event.channel)\n nil\n end",
"def irc_quit_event(stem, sender, arguments) # :nodoc:\n @chan_mutex.synchronize do\n @channel_members.each { |chan, members| members.delete sender[:nick] }\n #TODO what should we do if we are in the middle of receiving NAMES replies?\n end\n end",
"def del\n channel = params['channel_id']\n existing = Board.find_by(:channel => channel)\n if existing then\n existing.destroy\n return render json: { :response_type => 'in_channel',\n :text => 'Removed the current game for the channel. It was between *' + existing.player1 + '* and *' + existing.player2 + '*' }\n end\n\n return render json: { :text => 'No ongoing game in the current channel' }\n end",
"def destroy_all\r\n Message.destroy_all(channel: @channel)\r\n respond_to do |format|\r\n format.html { redirect_to channel_messages_url(@channel), notice: 'Chat erfolgreich geleert.' }\r\n format.json { head :no_content }\r\n end\r\n end",
"def unsubscribe( channel, callback )\n if @channels.include? channel\n @channels[channel].delete(callback)\n end\n if @channels[channel].empty?\n @client.unsubscribe channel\n @channels.delete(channel)\n end\n end",
"def unsubscribe_webhook\n if @redis\n @redis.pubsub.unsubscribe(subscribed_channel)\n @redis.close_connection\n end\n end",
"def messagedelete\n TDirmessage.find_by(\"dirmsg_id=?\", params[:messagedelete]).delete\n redirect_back(fallback_location: dirmsgcreate_path)\n end",
"def destroy\n @msg.destroy\n respond_to do |format|\n format.html { redirect_to msgs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @channel_rate.destroy\n respond_to do |format|\n format.html { redirect_to channel_rates_url, notice: 'Channel rate was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"
] | [
"0.7274665",
"0.7253049",
"0.7142875",
"0.709312",
"0.7065909",
"0.7039059",
"0.70167065",
"0.7006301",
"0.69271034",
"0.6921449",
"0.6920747",
"0.6920747",
"0.6898756",
"0.6886372",
"0.6883147",
"0.6870261",
"0.68574566",
"0.6840838",
"0.6840838",
"0.6813838",
"0.6800069",
"0.6754322",
"0.67520565",
"0.669795",
"0.65695167",
"0.65252155",
"0.64304954",
"0.6423066",
"0.64165133",
"0.63924783",
"0.63737005",
"0.63621753",
"0.63373077",
"0.63369966",
"0.63225955",
"0.63125396",
"0.6299377",
"0.62946373",
"0.62934786",
"0.6263557",
"0.62592876",
"0.62542325",
"0.6245376",
"0.6222582",
"0.62203336",
"0.62118286",
"0.6195628",
"0.6186465",
"0.6180847",
"0.6175521",
"0.6160139",
"0.6157282",
"0.61408836",
"0.61324203",
"0.6132109",
"0.61003983",
"0.6089953",
"0.608743",
"0.60808325",
"0.6023181",
"0.6008212",
"0.59924304",
"0.5985961",
"0.59794",
"0.5973095",
"0.5970704",
"0.5966299",
"0.5964005",
"0.5955833",
"0.594183",
"0.5931261",
"0.59240854",
"0.5922409",
"0.5901175",
"0.5899043",
"0.5897833",
"0.58928406",
"0.58806676",
"0.58798337",
"0.58677197",
"0.58531773",
"0.5844039",
"0.5828372",
"0.5823781",
"0.5822197",
"0.58190227",
"0.5816906",
"0.58055294",
"0.58055294",
"0.5754928",
"0.5745774",
"0.5732461",
"0.5729342",
"0.5721881",
"0.5709105",
"0.57048464",
"0.56963587",
"0.5690802",
"0.5688442",
"0.5680914"
] | 0.7207992 | 2 |
Internal handler for CHANNEL_RECIPIENT_ADD | def add_recipient(data)
channel_id = data['channel_id'].to_i
channel = self.channel(channel_id)
recipient_user = ensure_user(data['user'])
recipient = Recipient.new(recipient_user, channel, self)
channel.add_recipient(recipient)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def radioChannelAdd _obj, _args\n \"_obj radioChannelAdd _args;\" \n end",
"def add_message_reaction(data); end",
"def handle_incoming_invite(*args); false; end",
"def accept\n self.status = :accepted\n self.group.add_members(self.receiver, self.role, :was_invited, self.sender)\n self.save\n end",
"def add_record(channel_name, identifier)\n raise NotImplementedError\n end",
"def add_recipient (args)\n last_log_recipient_list.add_recipient(args)\n add_list! if last_log_recipient_list.recipients_count == mail_log.class::MAX_RECIPIENTS_COUNT_PER_LIST\n end",
"def add_user_to_mailchimp \n Rails.logger.info(\"Mailchimp subscribe request being made\")\n unless self.email.include?('@example.com')\n mailchimp = Hominid::API.new(AppConstants.mailchimp_key) \n list_id = mailchimp.find_list_id_by_name AppConstants.mailchimp_list \n info = { }\n result = mailchimp.list_subscribe(list_id, self.email, info, 'html', false, true, false, true)\n Rails.logger.info(\"Mailchimp subscribed for the email id #{self.email} to #{AppConstants.mailchimp_list}\")\n end\n end",
"def add_msg(msg, sender)\n\n @chatters.each do |chatter_id, chatter|\n if chatter_id != sender.id\n chatter.client_socket.puts \"#{sender.id} said: #{msg}\"\n end\n end\n\n end",
"def recipient; end",
"def addmember(user)\n\t\t#generate random leid for mailchimp\n\t\tuser.euid = rand(1 .. 500000000).to_s\n\t\tuser.save\n\t\t#assuming LEID is our user id and EUID is mailchimp's unique one\n\t\t#taken from here https://bitbucket.org/mailchimp/mailchimp-api-ruby/\n\t\tsubscribers = [{ \"EMAIL\" => { \"email\" => user.email,\n \"LEID\" => user.id.to_s,\n \"EUID\" => user.euid\n },\n\n :EMAIL_TYPE => 'html',\n :merge_vars => { \"FNAME\" => user.first_name,\n \"LNAME\" => user.last_name,\n \"STATUS\" => \"Subscribed\"\n }\n }]\n\n #batch-subscribe(string apikey, string id, array batch, boolean double_optin, boolean update_existing, boolean replace_interests)\n \t@mc.lists.batch_subscribe(@mli, subscribers, false, true, false)\n\tend",
"def subscribe_to_channel; end",
"def remote_invite(sender, body)\n room_hash = MD5::digest(body)[0,8]\n @connection.room_names[room_hash] = body\n @connection.room_ids[body] = room_hash\n if _user_keyhash(sender) != @connection.comm.our_keyhash\n _notice \"You have been invited by #{sender} to join #{body}.\", :notice\n end\nend",
"def someone_did_invite(stem, inviter, invitee, channel)\n end",
"def subscribe_author\n self.subscriptions.create user_id: self.user.id\n end",
"def add_participant\n user = User.find(params[:user_id])\n\n unless user_is_initiator(current_user, @chat)\n return fail_response(['You are not an author of the conversation'], 403)\n end\n\n if user_related_to_chat(@chat, user)\n return fail_response(['User is already in chat'], 403)\n end\n\n @chat.add_participant(user)\n\n render json: { message: 'success' }, status: :ok\n end",
"def add_origin msg\n return if msg.connection != @connection\n\n msg.origin =~ /(.+)!(.+)@(.+)/\n\n add_user msg.connection.canonize($1), $2, $3\n end",
"def add_notification_for_recipient\n # add to notifications\n @activity.recipient_user.friends_notifications.add(@activity.json_blob, score_key)\n # Increment counter\n @activity.recipient_user.notifications_counter.increment\n if @activity.recipient_user != @activity.user\n SendNotificationService.new(@activity.recipient_user, @activity.json_blob).user_notification\n SendNotificationService.new(@activity.recipient_user, @activity.json_blob).friend_notification\n end\n end",
"def add_channel( channel )\n\t\tserver = @servers[channel.server_name]\n\t\t@channels[channel.name] = channel\n\t\tserver.add_channel( channel )\n\t\tshift_server_pos( server.number, 1 )\n\t\t@length += 1\n\tend",
"def add_to_community_channel\n if community_channel_user = User.find(Settings::Channels.community_channel_user_id)\n GT::Framer.create_dashboard_entry(self, ::DashboardEntry::ENTRY_TYPE[:new_community_frame], community_channel_user)\n end\n end",
"def func_add(sender, dest, args)\r\n\t\tif args.size() >= 1\r\n\t\t\tuser= sender.nick\r\n\t\t\tmatchid= args[0].to_i()\r\n\t\t\tres= @db.query(\"SELECT * FROM `users` WHERE account='#{sender.account_name}'\")\r\n\t\t\tif res.num_rows() > 0\r\n\t\t\t\tu= res.fetch_hash()\r\n\t\t\t\tuserid= u['id'].to_i()\r\n\t\t\t\terr= false\r\n\r\n\t\t\t\t# user don' want to add himself\r\n\t\t\t\t# !add <match_id> <user>\r\n\t\t\t\tif (u['level'].to_i() <= 1) and (args.size() == 2)\r\n\t\t\t\t\ttarg_account= args[1].to_s()\r\n\r\n\t\t\t\t\tres2= @db.query(\"SELECT * FROM `users` WHERE account=\\\"#{targ_account}\\\"\")\r\n\t\t\t\t\tif res2.num_rows() > 0\r\n\t\t\t\t\t\tt= res2.fetch_hash()\r\n\t\t\t\t\t\tuserid= t['id'].to_i()\r\n\t\t\t\t\t\tuser= targ_account\r\n\t\t\t\t\t# user not found, maybe his current nick was given instead of his account\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\ttarg= getUserObj(targ_account)\r\n\t\t\t\t\t\tif targ != nil\r\n\t\t\t\t\t\t\tres3= @db.query(\"SELECT * FROM `users` WHERE account=\\\"#{targ.account_name}\\\"\")\r\n\t\t\t\t\t\t\tif res3.num_rows() > 0\r\n\t\t\t\t\t\t\t\tt= res3.fetch_hash()\r\n\t\t\t\t\t\t\t\tuserid= t['id'].to_i()\r\n\t\t\t\t\t\t\t\tuser= targ.nick\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\terr= true\r\n\t\t\t\t\t\t\tend\r\n\t\t\t\t\t\t\tres3.free()\r\n\t\t\t\t\t\tend\r\n\t\t\t\t\tend\r\n\t\t\t\t\tres2.free()\r\n\t\t\t\t\tsender.notice(\"unknow user: #{targ_account}\") if err\r\n\t\t\t\tend\r\n\r\n\t\t\t\tif !err\r\n\t\t\t\t\t# check if match exists\r\n\t\t\t\t\tif matchid == 0\r\n\t\t\t\t\t\tres2= @db.query(\"SELECT * FROM `matchs` WHERE Date LIKE CONCAT(CURDATE(),'%%')\");\r\n\t\r\n\t\t\t\t\t\t# if no match found, create one\r\n\t\t\t\t\t\tif res2.num_rows() == 0\r\n\t\t\t\t\t\t\t@db.query(\"INSERT INTO matchs(Adversaires,Type,Type_Comment,Date,Etat,Maps,Server,Comments) VALUES('?','m','pcw',CONCAT(CURDATE(), ' 21:00:00'),'c','?/?','','')\");\r\n\t\t\t\t\t\t\tres2= @db.query(\"SELECT MAX(id) FROM matchs\");\r\n\t\t\t\t\t\t\t# mysql_get_field(res, 0, \"MAX(id)\", num);\r\n\t\t\t\t\t\t\tm= res2.fetch_hash()\r\n\t\t\t\t\t\t\tmatchid= m['MAX(id)']\r\n\t\t\t\t\t\tend\r\n\t\t\t\t\tend\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tres2= @db.query(\"SELECT * FROM matchs WHERE id=\\\"#{matchid}\\\" AND Etat='c'\")\r\n\t\t\t\t\tif res2.num_rows() > 0\r\n\t\t\t\t\t\tm= res2.fetch_hash()\r\n\t\t\t\t\t\t# check if user is not already registered\r\n\t\t\t\t\t\tres3= @db.query(\"SELECT * FROM link WHERE link.user='#{userid}' AND link.match='#{matchid}'\")\r\n\t\t\t\t\t\tif res3.num_rows() > 0\r\n\t\t\t\t\t\t\tsender.notice(\"#{user} already registered in match #{matchid} vs #{m['Adversaires']}\")\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t@db.query(\"INSERT INTO link(link.user,link.match) VALUES('#{userid}','#{matchid}')\")\r\n\t\t\t\t\t\t\tsender.notice(\"'#{user}' added to match #{matchid} vs #{m['Adversaires']}\")\r\n\t\t\t\t\t\t\tupdateTopic()\r\n\t\t\t\t\t\tend\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tsender.notice(\"unknow match id: #{matchid}\")\r\n\t\t\t\t\tend\r\n\t\t\t\t\tres2.free()\r\n\t\t\t\tend\r\n\r\n\t\t\telse\r\n\t\t\t\tsender.notice(\"no account in db, tell bot owner\")\r\n\t\t\tend\r\n\t\t\tres.free()\r\n\t\telse\r\n\r\n\t\tend\r\n\tend",
"def new_message\n end",
"def add_channel(channel)\n return if @attributes[:channels].find { |c| channel.resolve_id == c.resolve_id }\n\n @attributes[:channels] << channel\n end",
"def incoming(msg, cb)\n\n case msg['channel']\n when '/meta/subscribe'\n channel = ::Pathname.new(msg['subscription']).basename.to_s\n return deny(msg, cb) unless is_authorized? msg, channel\n @reaction.registry.add(channel, msg['clientId'])\n info { \"Subscribe request from #{msg['clientId']} approved.\"}\n when %r{^/meta/}\n else return app_push msg, cb\n end\n\n cb.call(msg)\n\n end",
"def add_friend(sender_id)\n Logger.d(\"Got install referrer : sender_id:#{sender_id}\")\n \n return if sender_id.nil? or sender_id.length == 0\n\n json = {\n :id => sender_id,\n :auth_token => get(:auth_token)\n }.to_json\n\n network_post(CONFIG.get(:add_friend), nil, json, @on_api_call_failed) do |user_object|\n if is_valid_network_user_object?(user_object)\n @data = user_object\n Logger.d(\"Success in @user.add_friend => \" + user_object.to_s)\n serialiaze() # Write the object to persistent storage\n request_ui_refresh \n end\n end \n end",
"def someone_did_join_channel(stem, person, channel)\n end",
"def _in_invited(event)\n join event.channel\n end",
"def handle_add_reply( m, params )\n # lame auth check\n # TODO: need to get a look into new auth system\n\n name = params[:name].downcase\n reply = params[:reply].to_s\n\n # check whether good is in database\n# status( name, @stock )\n# if @inreg == false\n# m.reply( \"#{name} does not exist.\" ); return\n# end\n\n # Put data into database, should be understandable ^^\n reply = Reply.new( @replyversion, reply )\n @reply[name] = reply\n\n # save dataset in case the bot crashes an got no chance to do so\n save\n\n m.reply( \"done\" )\n end",
"def add_other(instance)\n # Throw error when instance has empty channel\n fail ::ArgumentError, 'Channel is required' unless instance.channel\n\n # Add\n requests << instance\n end",
"def process_join(message)\n channel = message.channel\n /:(?<user>\\w+)/ =~ message.raw\n channel.users[user] = User.new user unless channel.users.key? user\n end",
"def create\n @channel = Channel.new(params[:channel])\n\n respond_to do |format|\n if @channel.save\n @channel.users << @user\n @channel.save\n flash[:notice] = 'Channel was successfully created.'\n format.html { redirect_to(@channel) }\n format.xml { render :xml => @channel, :status => :created, :location => @channel }\n else\n flash[:warning] = 'Could not create channel'\n logger.debug @channel.errors.full_messages\n format.html { render :action => \"new\" }\n format.xml { render :xml => @channel.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def channel_account_for(channel)\n ca = ChannelAccount.new(:user_id => id, :channel_id => channel.id)\n ca.save\n self.channel_accounts << ca\n end",
"def add_recipient(recipient_type, address, variables = nil)\n # send the message when we have 1000, not before\n send_message if @counters[:recipients][recipient_type] == Mailgun::Chains::MAX_RECIPIENTS\n\n compiled_address = parse_address(address, variables)\n set_multi_complex(recipient_type, compiled_address)\n\n store_recipient_variables(recipient_type, address, variables) if recipient_type != :from\n\n @counters[:recipients][recipient_type] += 1 if @counters[:recipients].key?(recipient_type)\n end",
"def addrecipient(msgid, recipient)\n req(\"addrecipient\", recipient, \"\", msgid, \"\")\n end",
"def add_actor(actor_id)\n # Original method\n large_party_add_actor(actor_id)\n # Get actor\n actor = $game_actors[actor_id]\n # If the party has less than 4 members and this actor is not in the party\n if @actors.size < @max_size and not @actors.include?(actor)\n # Add actor\n @actors.push(actor)\n # Refresh player\n $game_player.refresh\n end\n end",
"def add_contact(ownnick, person)\n return ret_fail('can not add yourself') if person == ownnick #you cant add yourself !\n\n usr = User.first(:nickname=>person)\n return ret_fail('no such user') if usr == nil #user does not exist !\n\n ownusr = User.first(:nickname => ownnick) #get own record to get the contact list\n return ret_fail('already in list') if ownusr.contacts.first(:userid => usr.id) != nil\n\n c = ownusr.contacts.new\n c.userid = usr.id\n puts usr.id\n puts c.userid\n c.authgiven = 'f'\n c.save\n\n return ret_success\nend",
"def add_message(name, message)\n\t\tend",
"def on_newmessage(time, userid, username, msg)\n end",
"def addRecipient(recipient)\n\t\t@recipients.push(recipient)\n\tend",
"def create\n @invite = Invite.new(invite_params)\n @invite.sender_id = current_user.id\n if @invite.save\n\n #if the user already exists\n if @invite.recipient != nil \n\n #send a notification email\n InviteMailer.existing_user_invite(@invite).deliver \n\n #Add the user to the user group\n @invite.recipient.user_groups.push(@invite.user_group)\n else\n InviteMailer.new_user_invite(@invite, new_user_registration_path(:invite_token => @invite.token)).deliver\n end\n \n else\n format.html { render action: 'new' }\n format.json { render json: @invite.errors, status: :unprocessable_entity }\n end\n end",
"def after_invite_new_user(invite)\n end",
"def subscribe_owner\n\t subscription = owner.subscribe_to(activity_feed)\n\t subscription.save\n\t end",
"def create\n message = Message.new(message_params)\n conversation = Conversation.find(message_params[:conversation_id])\n message.username = message.user.username\n if message.save\n serialized_data = ActiveModelSerializers::Adapter::Json.new(\n MessageSerializer.new(message)).serializable_hash\n MessagesChannel.broadcast_to(conversation, serialized_data)\n # ActionCable.server.broadcast 'conversations_channel', serialized_data\n head :ok\n # binding.pry\n end\n end",
"def after_invite_existing_user(invite)\n # Add the user to the invitable resource/organization\n invite.invitable.add_invited_user(invite.recipient)\n end",
"def addrole(event, role)\n if @assignable_roles.include? role then\n if event.message.author.roles.find {|r| r.name == role}\n event.send_message(\"but you already have that role sweetie\")\n else\n event.message.author.add_role get_role(event, role)\n event.send_message(\"mhm! role added, you're now #{role}\")\n end\n else\n event.send_message(\"i'm sorry honey, but i can't give you that role\")\n end\n end",
"def addlevel(msg, log_entry)\n player = verify_player msg\n return unless player\n player.level_log << log_entry\n msg.reply \"Congratulations! #{player.name} has ascended to level #{player.level}.\"\n player.save\n end",
"def create\n @channel = Channel.find(params[:channel_id])\n rescue ActiveRecord::RecordNotFound => e\n respond_to do |format|\n format.html { redirect_to :back, notice: I18n.t('general.failed_to_subscribe') }\n format.json { render json: e, status: :unprocessable_entity }\n end\n else\n message = if current_user.max_channels_reached?\n I18n.t('maximum_channels_reached')\n elsif current_user.channels.include?(@channel)\n I18n.t('already_subscribed')\n end\n\n if (!current_user.channels.include?(@channel) && !current_user.max_channels_reached?)\n current_user.channels << @channel\n respond_to do |format|\n format.html { redirect_to @channel, notice: I18n.t('general.subscribed') }\n format.json { render json: @channel, status: :created, location: @channel }\n end\n else\n respond_to do |format|\n format.html { redirect_to @channel, notice: I18n.t('general.unable_to_subscribe') }\n format.json { render json: message, status: :unprocessable_entity }\n end\n end\n end",
"def add_member(member)\n Rails.logger.info(\"------------adding #{member} to circle\")\n if !self.circle.users.include?( member )\n member.memberships.create(:circle => self.circle)\n UserMailer.notify_added_to_circle(self,member).deliver\n #send email\n else\n Rails.logger.info(\"--------------already a member!\") \n end\n end",
"def invite\n \n end",
"def check_existing_channel\n return unless channel!.new_record?\n\n existing_channel =\n Channel.\n where(:author_id => author_id,\n :owner_id => owner_id,\n :user_author_id => user_author_id).\n first\n\n return if existing_channel.blank?\n\n self.channel = existing_channel\n end",
"def on_part(connection, channel, user)\n end",
"def create\n channel = Channel.create!(channel_params)\n joined = ChannelJoined.create!(user_id: params[:user_id], channel_id: channel.id)\n json_response(channel)\n end",
"def send_channel_msg( msg)\n @descriptors.each do |sock|\n if sock != @serverSocket\n user = @user_info[@descriptors.index(sock)-1] \n if user[:role] == \"client\" and user[:mode] == \"push\"\n str = \"Advice from channel #{msg[:channel]} : #{msg[:ad]}\\n\"\n sock.write(str) if user[:channels].include? msg[:channel]\n @@connection.register_sent_ad(user[:nickname],msg[:id],msg[:time])\n end\n end\n end\n end",
"def add_channel(channel_name, stateonly = true, power = 0, *flags)\r\n access = nil\r\n channel_name = channel_name.downcase\r\n if power != 0 || flags.length != 0\r\n access = Access.new(power, *flags)\r\n end\r\n @channels[channel_name] = ChannelUser.new(channel_name, stateonly, access)\r\n end",
"def set_recipient\n end",
"def __add__(receiver)\n\t\t\t\t@receivers << receiver\n\t\t\tend",
"def handle_existing_chatroom_member\n validate_ownership_and_membership_status; return if performed?\n @chatroom_member.update(has_left: false)\n save_chatroom_member\n end",
"def send_add\n Rails.logger.info \"Sending a message to #{rhizome.name}/add of: \" <<\n to_add_args_str\n\n result = -1\n begin\n result = rhizome.particle\n .function 'add',\n to_add_args_str\n rescue Particle::BadRequest\n msg = 'Lost contact with Rhizome or the Rhizome doesn\\'t support ' <<\n 'the \"add\" function! Check your equipment!'\n Rails.logger.error msg\n return false\n end\n\n # If the function returned the ID we provided, it was successful\n unless result.to_i == rhizome_eid.to_i\n raise RhizomeInterfaces::Errors::RhizomeArgumentError.new('add', result)\n end\n\n true\n end",
"def msg_add(c)\n\t@msg_buf << c\n end",
"def add_member(entity, role_id = IdeasUsers::MENTOR)\n return false if self.users.include?(entity)\n IdeasUsers.create(:user_id => entity.id, :idea_id => self.id, :role_id => role_id)\n NotificationWorker.added_member(entity, self)\n end",
"def handle_new_chatroom_member\n @chatroom_member = ChatroomMember.new(chatroom_member_params)\n save_chatroom_member\n end",
"def subscribe(data)\n # @channels (local tracker)\n # push channel name into subscribe list, if and only if not already in subscribe list\n end",
"def add(channel, client)\n @lock.synchronize do\n _remove(client) if @clients.include? client and @clients[client] != channel\n debug { \"Adding #{client} to #{channel}.\" }\n @clients[client] = channel\n @channels[channel] = @channels[channel] ? @channels[channel] + 1 : 1\n end\n end",
"def create_channel(data)\n channel = data.is_a?(Discordrb::Channel) ? data : Channel.new(data, self)\n server = channel.server\n\n # Handle normal and private channels separately\n if server\n server.add_channel(channel)\n @channels[channel.id] = channel\n elsif channel.private?\n @pm_channels[channel.recipient.id] = channel\n elsif channel.group?\n @channels[channel.id] = channel\n end\n end",
"def add_to_channel \n new_shared_video ||= Video.add_video_to_channel!(current_user, \n params[:video_id],\n params[:channel_id], \n params[:channel_name],\n params[:channel_is_private])\n \n if new_shared_video.errors.any?\n render :json => { :error => get_errors_for_class(new_shared_video).to_sentence },\n :status => :unprocessable_entity\n else\n render :nothing => true, :status => :created\n end\n end",
"def add(new_player)\n\t\tif @state == :OPEN\n\t\t\t@players << new_player\n\t\t\t@active_players << new_player\n\t\t\t@accepted_invites += 1\n\t\t\tif @accepted_invites == @num_invites\n\t\t\t\tself.invite_timeout\n\t\t\tend\t\n\t\tend\n\tend",
"def add_participant(participant)\n messages.each do |message|\n Mailboxer::ReceiptBuilder.new({\n :notification => message,\n :receiver => participant,\n :updated_at => message.updated_at,\n :created_at => message.created_at\n }).build.save\n end\n end",
"def add_via_received_rport\n # - If ;rport is present ;received MUST also be set (RFC 3581).\n # - If not add ;received according to RFC 3261 rules.\n if @msg.via_rport?\n via_received = @msg.source_ip\n @msg.via_rport = @msg.source_port\n else\n via_received = (::OverSIP::Utils.compare_ips(@msg.via_sent_by_host, @msg.source_ip) ? nil : @msg.source_ip)\n end\n\n if via_received\n via_params = \";branch=\" << @msg.via_branch if @msg.via_branch\n via_params << \";received=\" << via_received if via_received\n via_params << \";rport=\" << @msg.via_rport.to_s if @msg.via_rport\n via_params << \";alias\" if @msg.via_alias?\n\n if @msg.via_params\n @msg.via_params.each { |k,v| via_params << ( v ? \";#{k}=#{v}\" : \";#{k}\" ) }\n end\n\n @msg.hdr_via[0] = \"#{@msg.via_core_value}#{via_params}\"\n end\n end",
"def new_invite_notification (notifier, to_id, session)\n\n result = nil\n\n message = NotificationsHelper.get_message(notifier,NotificationsHelper::INVITES,session)\n\n notification = new_notify(to_id)\n\n\n lactic_uid = \"invite-#{session.creator_fb_id}\"\n url = \"/lactic_sessions/#{lactic_uid}-#{session.id}-#{(session.start_date_time.to_f * 1000).to_i}\"\n\n result = (notification)? notification.new_notification(notifier,message,NotificationsHelper::INVITES, url) : nil\n\n\n ### Send notification alert....\n send_notification(to_id,\"New invite from #{notifier.name}\",result,\"invites\")\n\n result\n end",
"def create_dm(recipient_id)\n request(Route.new(:POST, '/users/@me/channels'), json: { recipient_id: recipient_id })\n end",
"def on_join(connection, channel, user)\n end",
"def forward_message_id=(*args); end",
"def add_recipient(recipient, params = {})\n @api.post(\"#{@api.path}/Group/#{@id}/Recipient\", body: recipient, params: params)\n end",
"def add_member_to_card\n @trello.add_commander_to_card(find_member, @card)\n end",
"def notify_on_mention?; true; end",
"def create\n @mail_user = MailUser.find_by(name_params)\n\n if !['included', 'excluded'].include?(@type)\n redirect_to @recipient_list, alert: '指定のリストにユーザーは追加できません。'\n elsif @mail_user\n @recipient = Recipient.find_or_create_by(recipient_list: @recipient_list, mail_user: @mail_user)\n @recipient.update_column(@type, true)\n\n redirect_to @recipient_list, notice: '指定のリストにユーザーを追加しました。'\n else\n redirect_to @recipient_list, alert: '該当する名前のユーザーはいません。'\n end\n end",
"def subscribe\n @board.subscribers << current_user\n redirect_to board_path(@board), notice: \"Boarda abone oldunuz.\"\n end",
"def message_received(type, from, text, time = nil)\n msg = message_db.add(\n type: type,\n to: type == :message ? username : nil,\n from: from,\n text: text,\n time: time\n )\n signal_change(type, msg)\n end",
"def send_im(fromnick,tonick,message)\n return ret_fail('can not send IM to yourself') if fromnick==tonick #self-explainatory\n\n usr = User.first(:nickname=>fromnick) #find own record\n return ret_fail('own user not found') if usr == nil #must be error\n\n tousr = User.first(:nickname=>tonick)\n return ret_fail('addressee not found') if tousr == nil #must be error\n\n contact = usr.contacts.first(:userid => tousr.id)\n return ret_fail('not in list') if contact == nil #that nick is not in contact list!\n\n\n if message['type'] != 'auth_request' #Normal message\n return ret_fail('not authorized') if contact.authgiven != 't' #failure: not authorized!\n else #its an authorization request!\n return ret_fail('already given') if contact.authgiven == 't' #already has permission!\n return ret_fail('already sent') if contact.authgiven == 'p' #already sent a request!\n\n #ok... its a valid auth request... so set state to 'p' and update db record\n contact.authgiven = 'p' #awaiting to be answered\n contact.save\n end\n\n #append message to addressees message queue, update database record\n msg = tousr.messages.new\n msg.data = JSON.generate({'from'=>fromnick, 'message'=>message})\n msg.save\n\n return ret_success\nend",
"def send_new_chat(data)\n stream_from \"Chat:#{data['chat']['id']}\"\n recipient = User.find(data['chat']['recipient_id'])\n unless current_user.id == recipient.id\n ActionCable.server.broadcast \"user_#{recipient.id}_chats\", chat: data['chat'], type: 'new_chat'\n end\n end",
"def add_client(person)\n @clients << person\n end",
"def add_client(person)\n @clients << person\n end",
"def irc_join_event(stem, sender, arguments) # :nodoc:\n if sender[:nick] == @nick then\n should_broadcast = false\n @chan_mutex.synchronize do\n @channels << arguments[:channel]\n @channel_members[arguments[:channel]] ||= Hash.new\n @channel_members[arguments[:channel]][sender[:nick]] = :unvoiced\n #TODO what should we do if we are in the middle of receiving NAMES replies?\n #TODO can we assume that all new channel members are unvoiced?\n end\n @join_mutex.synchronize do\n if @channels_to_join then\n @channels_to_join.delete arguments[:channel]\n if @channels_to_join.empty? then\n should_broadcast = true unless @ready\n @ready = true\n @channels_to_join = nil\n end\n end\n end\n # The ready_thread is also looking to set ready to true and broadcast,\n # so to prevent us both from doing it, we enter a critical section and\n # record whether the broadcast has been made already. We set @ready to\n # true and record if it was already set to true. If it wasn't already\n # set to true, we know the broadcast hasn't gone out, so we send it out.\n broadcast :stem_ready, self if should_broadcast\n else\n @chan_mutex.synchronize do\n @channel_members[arguments[:channel]][sender[:nick]] = :unvoiced\n #TODO what should we do if we are in the middle of receiving NAMES replies?\n #TODO can we assume that all new channel members are unvoiced?\n end\n end\n end",
"def create\n @channel = Channel.new(params[:channel])\n @channel.user = current_user\n flash[:notice] = t('controllers.channels.channel_was_successfully_created') if @channel.save\n\n respond_with @channel\n end",
"def add_collaborator\n @project = current_user.projects.find(params[:id])\n @collaborator = User.find_by_email(params[:collaborator])\n @project.users << @collaborator\n\n if @project.save\n record_activity(\"added supervisor \" + params[:collaborator])\n redirect_to project_path(@project), :notice => \"Supervisor is added successfully\"\n else\n record_activity(\"error occured when added supervisor \" + params[:collaborator])\n redirect_to project_path(@project), :alert => \"Supervisor is already added\"\n end\n end",
"def add_owner_to_participants\n EventParticipant.create(user_id: self.user_id, event_id: self.id)\n end",
"def create\n @channel = Channel.new(channel_params)\n @listener = Listener.create(dj: true)\n session[:current_listener_id] = @listener.id\n #gon.dj= @listener.dj\n\n respond_to do |format|\n if @channel.save\n format.html { redirect_to @channel, notice: 'Channel was successfully created.' }\n format.json { render :show, status: :created, location: @channel }\n else\n format.html { render :new }\n format.json { render json: @channel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def notify_adding_emoji(emoji_name)\n @websocket_connection.send(\n {\n type: 'message',\n text: \"New Emojis Published! :#{emoji_name}:\",\n channel: @bot_notification_channel\n }.to_json\n )\n end",
"def create\n render(status: :forbidden, text: 'Invalid message') and return if params[:message].blank? or params[:message][:content].blank?\n @channel = Channel.find(params[:channel_id])\n @message = @channel.messages.create(params.require(:message).permit(:content))\n @message.user_name = session[:user_name]\n\n if @message.save\n Pusher['presence-channel-' + params[:channel_id]].trigger('message_added', {message: {user_name: h(@message.user_name), content: view_context.auto_link(@message.content)}, time: @message.created_at.localtime.strftime('%H:%M')})\n render status: :created, body: nil\n else\n render status: :forbiden, text: 'The message can\\'t save'\n end\n end",
"def add_responsible(responsible)\n users << responsible\n end",
"def after_update_actions\n if is_newbie_changed? && is_newbie == false # registration completed\n if Date.today.to_s == \"2017-03-03\" || Date.today.to_s == \"2017-03-04\"\n conv = Conversation.where(key: 'event_intellect').first\n unless conv.present?\n User.bot.conversations.create!(key: 'event_intellect', group_title: 'Intellect', new_members: [id])\n else\n conv.add_participant(id)\n end\n end\n end\n end",
"def inject_message(msg, channel, origin_channel = default_origin_channel)\n begin\n PUNK.start('injectmsg','inject message in cloud ...')\n\n out_id = 00000\n\n user_api.mdi.dialog.protogen.protogen_encode(msg).each do |message|\n out_id = CC.indigen_next_id(message.asset)\n inject_hash = {\n \"meta\" => {\n \"account\" => message.account,\n \"cookies\" => message.cookies\n },\n \"payload\" => {\n \"id\" => out_id, # Indigen integer\n \"asset\" => \"ragent\",\n \"sender\" => send_channel, # Sender identifier (can be the same as the asset)\n \"recipient\" => \"@@server@@\", # Recipient identifier (can be the same as the asset)\n \"type\" => \"message\",\n \"received_at\" => Time.now.to_i, # timestamp integer in seconds\n \"channel\" => channel,\n \"payload\" => message.content,\n \"parent_id\" => nil, # nil | message_identifier\n \"timeout\" => 0 # -1 | 0 | timeout integer. 0 -> instant\n }\n }\n\n inject_hash['meta'].delete_if { |k, v| v.nil? }\n inject_hash['payload'].delete_if { |k, v| v.nil? }\n\n # todo: put some limitation\n CC.push(inject_hash,'messages')\n end\n\n # success !\n PUNK.end('injectmsg','ok','out',\"SERVER <- SERVER MSG[#{crop_ref(out_id,4)}]\")\n\n SDK_STATS.stats['agents'][user_api.user_class.agent_name]['inject_to_cloud'] += 1\n SDK_STATS.stats['agents'][user_api.user_class.agent_name]['total_sent'] += 1\n rescue Exception => e\n user_api.mdi.tools.log.error(\"Error on inject message\")\n user_api.mdi.tools.print_ruby_exception(e)\n PUNK.end('injectmsg','ko','out',\"SERVER <- SERVER MSG\")\n # stats:\n SDK_STATS.stats['agents'][user_api.user_class.agent_name]['err_on_inject'] += 1\n SDK_STATS.stats['agents'][user_api.user_class.agent_name]['total_error'] += 1\n end\n end",
"def create_notification(chatroom)\n last_message = chatroom.messages.last\n user = last_message.user\n other_user = chatroom.other_user user.id\n n = other_user.notification || Notification.create(user_id: other_user.id)\n n.count += 1\n n.save\n last_message.notification_id = n.id\n last_message.save\n NotificationsChannel.broadcast_to other_user,\n user: last_message.user.name,\n content: last_message.content,\n picture: last_message.user.picture,\n topic: self.topic,\n id: last_message.id\n end",
"def contact_to!(actor)\n contact_to(actor) || sent_contacts.create!(receiver: actor)\n end",
"def on_request( channel, request, want_reply, data )\n end",
"def handle_subscribe(command) # rubocop:todo Metrics/CyclomaticComplexity\n @ongoing_subscribe = true\n if @user_details[:chat_id].nil?\n @user_details = { chat_id: message.chat.id }\n @proceed = true\n @previous_command = command\n end\n if @user_details[:birthday].nil?\n @proceed = false\n prompt_user '/add_my_birthday', false, false, true\n elsif @sex.empty?\n add_sex\n elsif user_details[:birthdays].nil?\n send_message 'Please add at least one birthday to be reminded of'\n @proceed = false\n prompt_user '/add_birthday', true, false, false\n\n unless message.text.nil?\n @name = message.text\n @proceed = false\n prompt_user '/add_birthday', false, true, true\n end\n\n elsif user_details[:anniversaries].nil?\n send_message 'Please add at least one anniversary to be reminded of'\n\n prompt_user '/add_anniversary', true, false, false\n\n unless message.text.nil?\n @done = true\n @proceed = false\n @name = message.text\n @proceed = false\n prompt_user '/add_anniversary', false, true, true\n end\n\n else\n @proceed = false\n @previous_command = ''\n @name = ''\n @name_set = false\n @sex = ''\n @ongoing_subscribe = false\n subscribe_user\n end\n end",
"def add_to_base(msg)\n add(:base, msg)\n end",
"def initialize()\n super\n @odata_type = \"#microsoft.graph.chatMembersNotificationRecipient\"\n end",
"def add( env, id, current_user )\n member = ActiveFedora::Base.find( id )\n return unless env.current_ability.can?( :edit, member )\n env.curation_concern.provenance_child_add( current_user: current_user, child_id: id, event_note: 'BeforeAttachMembersActor' )\n end",
"def add_follower(user)\n followers << user\n end",
"def target_channel\n name = case self.command\n when :invite then self.params[1]\n when RPL_NAMREPLY then self.params[2]\n when ERR_USERNOTINCHANNEL then self.params[2]\n when ERR_USERONCHANNEL then self.params[2]\n when ERR_UNKNOWNMODE then self.trail[/\\S+$/]\n else self.params.fetch(numeric? ? 1 : 0, \"\")\n end\n\n if name.start_with?('&', '#', '+', '!')\n return name\n end\n\n return nil\n end"
] | [
"0.59188515",
"0.5910316",
"0.57202965",
"0.56902367",
"0.5667978",
"0.5640804",
"0.5635768",
"0.55883616",
"0.5489959",
"0.5487487",
"0.5483835",
"0.5474196",
"0.54579836",
"0.5457606",
"0.5451404",
"0.5431891",
"0.5422748",
"0.5416657",
"0.54128456",
"0.541247",
"0.5369983",
"0.5369692",
"0.5345849",
"0.53358966",
"0.5333535",
"0.53216803",
"0.5306248",
"0.5299478",
"0.52764887",
"0.527398",
"0.52661264",
"0.5264707",
"0.52595794",
"0.52588475",
"0.52442086",
"0.5241676",
"0.5236585",
"0.52354693",
"0.5229233",
"0.52212536",
"0.5205829",
"0.5204501",
"0.5201768",
"0.51823866",
"0.5181788",
"0.51796055",
"0.5178887",
"0.51772916",
"0.5169254",
"0.5167172",
"0.51649475",
"0.51576144",
"0.51548445",
"0.51536846",
"0.5132151",
"0.51317096",
"0.51252353",
"0.51223",
"0.5119726",
"0.51149815",
"0.51120275",
"0.5108915",
"0.50988936",
"0.50859773",
"0.5077508",
"0.50698876",
"0.50594276",
"0.5053262",
"0.50390506",
"0.50244224",
"0.50168085",
"0.50087094",
"0.50080156",
"0.50077903",
"0.49947163",
"0.49935657",
"0.4990599",
"0.49804544",
"0.49786633",
"0.49708605",
"0.49708605",
"0.49688405",
"0.49672103",
"0.49671608",
"0.49669826",
"0.4966604",
"0.4966556",
"0.49589202",
"0.4954692",
"0.4952693",
"0.4943685",
"0.4941668",
"0.49403787",
"0.49386522",
"0.49360424",
"0.4932791",
"0.49306762",
"0.49288088",
"0.49260715",
"0.49252906"
] | 0.63274175 | 0 |
Internal handler for CHANNEL_RECIPIENT_REMOVE | def remove_recipient(data)
channel_id = data['channel_id'].to_i
channel = self.channel(channel_id)
recipient_user = ensure_user(data['user'])
recipient = Recipient.new(recipient_user, channel, self)
channel.remove_recipient(recipient)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def irc_part_event(stem, sender, arguments) # :nodoc:\n @chan_mutex.synchronize do\n if sender[:nick] == @nick then\n drop_channel arguments[:channel]\n else\n @channel_members[arguments[:channel]].delete sender[:nick]\n end\n #TODO what should we do if we are in the middle of receiving NAMES replies?\n end\n end",
"def remove_message_reaction(data); end",
"def channel_ids_to_remove\n @channel_ids_to_remove ||= begin\n cids = []\n if self.respond_to?(:message)\n cids << self.try(:message).try(:channel).try(:id)\n Array(self.message&.channel&.sibling_channel_ids).each do |cid|\n cids << cid unless channel_ids_to_add.include?(cid)\n end\n end\n cids\n end\n end",
"def unsubscribe_from_channel; end",
"def process_part(message)\n channel = message.channel\n /:(?<user>\\w+)/ =~ message.raw\n channel.users.delete user if channel.users.key? user\n end",
"def remove_conv conv, user \n if user.id == conv.user_id\n return update_status(conv, user, 'status')\n elsif user.id == conv.recipient_id \n return update_status(conv, user, 'recipient_status')\n end\n false\n end",
"def func_remove(sender, dest, args)\r\n\t\tif args.size() >= 1\r\n\t\t\tuser= sender.nick\r\n\t\t\tmatchid= args[0].to_i()\r\n\t\t\tres= @db.query(\"SELECT * FROM `users` WHERE account='#{sender.account_name}'\")\r\n\t\t\tif res.num_rows() > 0\r\n\t\t\t\tu= res.fetch_hash()\r\n\t\t\t\tuserid= u['id'].to_i()\r\n\t\t\t\terr= false\r\n\r\n\t\t\t\t# user don' want to remove himself\r\n\t\t\t\t# !remove <match_id> <user>\r\n\t\t\t\tif (u['level'].to_i() <= 1) and (args.size() == 2)\r\n\t\t\t\t\ttarg_account= args[1].to_s()\r\n\r\n\t\t\t\t\tres2= @db.query(\"SELECT * FROM `users` WHERE account=\\\"#{targ_account}\\\"\")\r\n\t\t\t\t\tif res2.num_rows() > 0\r\n\t\t\t\t\t\tt= res2.fetch_hash()\r\n\t\t\t\t\t\tuserid= t['id'].to_i()\r\n\t\t\t\t\t\tuser= targ_account\r\n\t\t\t\t\t# user not found, maybe his current nick was given instead of his account\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\ttarg= getUserObj(targ_account)\r\n\t\t\t\t\t\tif targ != nil\r\n\t\t\t\t\t\t\tres3= @db.query(\"SELECT * FROM `users` WHERE account=\\\"#{targ.account_name}\\\"\")\r\n\t\t\t\t\t\t\tif res3.num_rows() > 0\r\n\t\t\t\t\t\t\t\tt= res3.fetch_hash()\r\n\t\t\t\t\t\t\t\tuserid= t['id'].to_i()\r\n\t\t\t\t\t\t\t\tuser= targ.nick\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\terr= true\r\n\t\t\t\t\t\t\tend\r\n\t\t\t\t\t\t\tres3.free()\r\n\t\t\t\t\t\tend\r\n\t\t\t\t\tend\r\n\t\t\t\t\tres2.free()\r\n\t\t\t\t\tsender.notice(\"unknow user: #{targ_account}\") if err\r\n\t\t\t\tend\r\n\r\n\t\t\t\tif !err\r\n\t\t\t\t\tres2= @db.query(\"SELECT * FROM matchs WHERE id=\\\"#{matchid}\\\" AND Etat='c'\")\r\n\t\t\t\t\tif res2.num_rows() > 0\r\n\t\t\t\t\t\tm= res2.fetch_hash()\r\n\t\t\t\t\t\t@db.query(\"DELETE FROM link WHERE user='#{userid}' AND `match`='#{matchid}'\")\r\n\t\t\t\t\t\tsender.notice(\"'#{user}' removed from match #{matchid} vs #{m['Adversaires']}\")\r\n\t\t\t\t\t\tupdateTopic()\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tsender.notice(\"unknow match id: #{matchid}\")\r\n\t\t\t\t\tend\r\n\t\t\t\t\tres2.free()\r\n\t\t\t\tend\r\n\r\n\t\t\telse\r\n\t\t\t\tsender.notice(\"no account in db, tell bot owner\")\r\n\t\t\tend\r\n\t\t\tres.free()\r\n\t\telse\r\n\r\n\t\tend\r\n\tend",
"def irc_quit_event(stem, sender, arguments) # :nodoc:\n @chan_mutex.synchronize do\n @channel_members.each { |chan, members| members.delete sender[:nick] }\n #TODO what should we do if we are in the middle of receiving NAMES replies?\n end\n end",
"def remove_channel( channel )\n @channel_map.delete channel.local_id\n end",
"def remove_message(name)\n\t\tend",
"def remove_notification_message parrent, user_id\n #ap 'NotificationModule#remove_notification_message'\n #ap user_id\n #ap parrent.id\n #ap parrent.class.name\n if notification_message = NotificationMessage.find_by(\n user_id: user_id,\n asset_id: parrent.id,\n asset_type: parrent.class.name\n )\n notification_message.destroy\n end\n end",
"def part msg\n msg.connection.channels.each_value do |chan|\n unless chan.get_user(msg.nick_canon) == nil\n return\n end\n end\n\n delete_user msg.nick_canon\n end",
"def remove_user_from_mailchimp\n unless self.email.include?('@example.com')\n mailchimp = Hominid::API.new(AppConstants.mailchimp_key)\n list_id = mailchimp.find_list_id_by_name AppConstants.mailchimp_list\n result = mailchimp.list_unsubscribe(list_id, self.email, true, false, true) \n Rails.logger.info(\"Mailchimp unsubscribed for email id #{self.email}\")\n end\n end",
"def destroy\n @channel = Channel.find(params[:channel_id])\n rescue ActiveRecord::RecordNotFound => e\n respond_to do |format|\n format.html { redirect_to :back, notice: I18n.t('general.failed_to_unsubscribe') }\n format.json { render json: e, status: :unprocessable_entity }\n end\n else\n current_user.channels.delete(@channel) if current_user.channels.include? @channel\n respond_to do |format|\n format.html { redirect_to @channel, notice: I18n.t('general.unsubscribed') }\n format.json { head :no_content }\n end\n end",
"def send_remove\n Rails.logger.info \"Sending a message to #{rhizome.name}/remove of: \" <<\n rhizome_unique_id\n\n result = -1\n begin\n result = rhizome.particle\n .function 'remove',\n rhizome_unique_id\n rescue Particle::BadRequest\n msg = 'Lost contact with Rhizome or the Rhizome doesn\\'t support ' <<\n 'the \"remove\" function! Check your equipment!'\n Rails.logger.error msg\n return false\n end\n\n # If the function returned the ID we provided, it was successful\n unless result.to_i == rhizome_eid.to_i\n raise RhizomeInterfaces::Errors::RhizomeArgumentError.new('remove', result)\n end\n\n true\n end",
"def delete_message(data); end",
"def delete_message(data); end",
"def destroy_channel_request\n channel_request = ChannelRequest.where(:user_id => self.subscriber_id, :channel_id => self.channel_id).first\n channel_request.destroy unless channel_request.blank?\n end",
"def delete_channel(data)\n channel = Channel.new(data, self)\n server = channel.server\n\n # Handle normal and private channels separately\n if server\n @channels.delete(channel.id)\n server.delete_channel(channel.id)\n elsif channel.pm?\n @pm_channels.delete(channel.recipient.id)\n elsif channel.group?\n @channels.delete(channel.id)\n end\n end",
"def delete_channel(data)\n channel = Channel.new(data, self)\n server = channel.server\n\n # Handle normal and private channels separately\n if server\n @channels.delete(channel.id)\n server.channels.reject! { |c| c.id == channel.id }\n else\n @private_channels.delete(channel.id)\n end\n end",
"def remove_all_message_reactions(data); end",
"def someone_did_leave_channel(stem, person, channel)\n end",
"def chimp_remove(options, delete_user=true, send_goodbye=false, send_notify=false)\n begin\n raise MailChimpAPI::DeleteError, \"Email and Mailing List Id can't be nil\" if (options[:email].nil? || options[:mailing_list_id].nil?)\n @client.call(\"listUnsubscribe\", @api_key, options[:mailing_list_id], options[:email], delete_user, send_goodbye, send_notify) \n rescue XMLRPC::FaultException => e\n raise MailChimpAPI::DeleteError, e.faultString\n end \n end",
"def destroy\r\n push_notification :remove\r\n @message.destroy\r\n respond_to do |format|\r\n format.html { redirect_to channel_messages_url(@channel) }\r\n format.json { head :no_content }\r\n end\r\n end",
"def remove\n recipient_list_members.destroy_all\n if message_recipients.count.zero?\n destroy\n else\n self.removed = true\n save!\n end\n end",
"def remove_channel_handler(channel, handler)\n handlers = @channels[channel]\n handlers.delete(handler) unless handlers.nil?\n end",
"def destroy_as_receiver(participant=nil)\n memberships= Membership.receiver(participant.id, self.id)\n if memberships.empty?\n raise Ecs::NoReceiverOfMessageException,\n \"you are not a receiver of \" +\n \"\\\"#{self.ressource.namespace}/#{self.ressource.ressource}/#{self.id.to_s}\\\"\"\n end\n if participant\n MembershipMessage.delete_relations(self, memberships)\n end\n destroy_or_tag_as_removed if membership_messages.blank? and !ressource.postroute\n end",
"def parse_user_remove(msg_details)\n username = msg_details\n @userlist_table[username] = nil\n return username\n end",
"def remove_notification\n \n @ac = AttachContact.find(params[:user_id])\n RecentActivity.create(:transaction_id => @transaction.id, \n :user_id => current_user.id, \n :message => \"Removed Contact: #{@ac.user.fullname} as #{@ac.role.name if @ac.role}\")\n \n render :nothing => true\n end",
"def unsubscribed\n # This will broadcast that user unsubscribed but the frontend will not receive the final broadcast\n p '**** ChatChannel unsubscribed'\n notification = {notification: 'User X has dropped off'}\n # ActionCable.server.broadcast(params[:room], notification)\n send_broadcast(params[:room], notification)\n end",
"def destroy\r\n @channel.destroy\r\n respond_to do |format|\r\n format.html { redirect_to user_channels_path(current_user)}\r\n end\r\n end",
"def destroy_as_sender\n participants = Participant.for_message(self).uniq\n participants.each do |participant| \n Event.make(:event_type_name => EvType.find(2).name, :participant => participant, :message => self)\n end if ressource.events\n MembershipMessage.delete_relations(self)\n destroy_or_tag_as_removed\n end",
"def remove_channel(channel_name)\r\n @channels.delete(channel_name.downcase)\r\n end",
"def delete\n if ensure_same_as_logged_person(@message.poster.guid)\n @message.delete\n render :status => :ok and return\n elsif ensure_same_as_logged_person(@channel.owner.guid)\n @message.delete\n render :status => :ok and return\n end\n render :status => :forbidden and return\n end",
"def remove_channel(channel)\n @attributes[:channels].delete_if { |c| channel.resolve_id == c.resolve_id }\n end",
"def remove_pending(*args)\n\n\t\t# Redirect to remove connection since it is an unbiased connection removed and would do this anyway\n\t\tself.send('remove_connection', *args)\n\tend",
"def delete_from_received(message)\r\n if message.receiver_id == self.id\r\n message.update_attribute :receiver_deleted, true\r\n return true\r\n else\r\n return false\r\n end\r\n end",
"def delete_from_received(message)\r\n if message.receiver_id == self.id\r\n message.update_attribute :receiver_deleted, true\r\n return true\r\n else\r\n return false\r\n end\r\n end",
"def remove(channel_name, stream_name, connection)\n @mutex.synchronize do\n subscribers[channel_name][stream_name].delete(connection)\n subscribers[channel_name].delete(stream_name) if subscribers[channel_name][stream_name].empty?\n connection\n end\n end",
"def did_receive_channel_message(stem, sender, channel, msg)\n end",
"def destroy\n @channel.destroy\n respond_to do |format|\n format.html { redirect_to user_path(current_user.id) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @raw_channel = RawChannel.find(params[:id])\n @raw_channel.destroy\n\n respond_to do |format|\n format.html { redirect_to raw_channels_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n \n @channel = @channel || ChannelClass.find(params[:id])\n @channel.destroy\n respond_to do |format|\n format.html { redirect_to channel_classes_url, notice: '频道删除成功.' }\n format.json { head :no_content }\n end\n \n end",
"def destroy\n @chatty_crow_channel.destroy\n flash[:notice] = l(:notice_successful_delete)\n redirect_to_plugin_settings\n end",
"def part(channel)\n if channel.is_a?(Channel)\n @channels.delete(channel)\n else\n @channels.delete(Channel.find(channel))\n end\n end",
"def cleanup_after_unsubscribe(channel)\n return if channel.listeners_count > 0\n logger.debug \"destroying channel #{channel.name}\"\n @channels.delete channel.name\n stat_channel_destroyed channel.name\n destroy if @channels.size == 0\n end",
"def destroy\n @fdn_received_message = Fdn::ReceivedMessage.find(params[:id])\n #@fdn_received_message.destroy\n @fdn_received_message.be_trashed(current_user)\n\n respond_to do |format|\n format.html { redirect_to fdn_messages_url }\n format.json { head :no_content }\n end\n end",
"def receive(channel = mailbox)\n channel.pop_op\n end",
"def destroy\n @universal_channel.destroy\n respond_to do |format|\n format.html { redirect_to universal_channels_url, notice: 'Universal channel was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message = Message.find(params[:id])\n if current_user.received_messages.find(@message)\n MessageRecipient.find_by_user_id_and_message_id(current_user, @message.id).destroy\n\n else\n @message.destroy\n end\n \n\n respond_to do |format|\n format.html { redirect_to account_messages_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n get_message().delete\n end",
"def remove_channel\n channel = Channel.find(params[:channel_id])\n @bss_title_id = BssTitleId.find(params[:id])\n \t@bss_title_id.channels.delete(channel)\n \trespond_to do |format|\n format.html {\n if params[:source] == 'episode_show'\n redirect_to episode_path(@bss_title_id.episode, show_details(:channel, params)), notice: 'Channel: ' + channel.name + ' removed'\n else\n redirect_to bss_title_id_path(@bss_title_id, show_details(:channel, params)), notice: 'Channel: ' + channel.name + ' removed'\n end\n }\n\t \tformat.json {render :show, status: :removed, location: @bss_title_id}\n \tend\n end",
"def api_remove\n data_hash = make_hash\n delete_hash = { division: data_hash[:division][:value] }\n handler.remove(delete_hash, path, subscriber_id)\n end",
"def on_remove(args)\n event, ele, ele_id = args[:args][:event].to_sym, args[:args][:element].to_s, args[:args][:element_id].to_i\n \n if ele == \"sink\"\n tv = @tv_sinks\n elsif ele == \"source\"\n tv = @tv_sources\n else\n return nil\n end\n \n tv.rows_remove do |data|\n if data[:data][:id].to_i == ele_id\n true\n else\n false\n end\n end\n end",
"def remove!; end",
"def unsubscribed\n if current_user.is_a?(User)\n\n # if @userType == \"known\"\n ActionCable.server.broadcast \"AppearanceChannel\", { user: current_user.email, user_id: current_user.id, online: :off }\n # else\n # reject\n end\n # stop_all_streams\n # Any cleanup needed when channel is unsubscribed\n end",
"def remove_from_mailchimp(list_name)\n apikey ||= chimpLogin(monkeybrains[:username], monkeybrains[:password])\n list_id ||= find_mailing_list(apikey, list_name)\n chimpUnsubscribe(apikey, list_id[\"id\"], self[email_column])\n rescue XMLRPC::FaultException\n end",
"def remove_channel_open_handler( type, id )\n @channel_open_handlers[ type ][ id-1 ] = nil\n end",
"def delete_msg()\n MsgUtil.delete_msg(params[:ch])\n end",
"def punsubscribe(*channels); end",
"def delete_user\n \tputs 'Delete user action'\n users = connection_store.collect_all(:chat_users)\n WebsocketRails[:chatroom].trigger(:client_disconnected, users.to_json) \n end",
"def del_msg_listener( msgName, object )\n @msgNames[msgName].delete object if defined? @msgNames\n end",
"def remove_command\n return if !has_manage_messages_permission?\n command.event.message.delete\n end",
"def exit_channel(channel_id, user_id)\n\t # clean up inuse channels\n\t if InuseChannel.find_by_name(channel_id) != nil\n\t inuse_channel = InuseChannel.find_by_name(channel_id)\n\t user1 = inuse_channel.user1\n\t user2 = inuse_channel.user2\n\t if user1 == user_id\n\t User.find_by_id(user1)\n\t else\n\t User.find_by_id(user2)\n\t end\n\t inuse_channel.destroy \n\t else\n\t free_channel = FreeChannel.find_by_id(free_channel_id)\n\t user = free_channel.user1\n\t User.find_by_name(user).destroy\n\t free_channel.destroy\n\t end\n\t \n\tend",
"def msg_PART(source, args)\n # :UID PART #channel1,#channel2,... :optional message\n u = User.find_by_uid(source)\n args[0].split(' ').each do |cname|\n c = Channel.find_by_name(cname)\n next unless c\n\n c.del_user(u)\n u.part(c)\n\n if c.get_user_count() == 0 && !c.is_permanent?()\n c.obliterate()\n end\n end\n\n return nil\n end",
"def destroy\n\t\tchannel_sid = params[:channel_sid]\n\t\tmessage_sid = params[:id]\n\t\tputs message_sid\n\t\t@client = Twilio::REST::Client.new(ENV['account_sid'], ENV['auth_token'])\n\t\t# Remove the member\n\t\tservice = @client.chat.v2.services(ENV['service_sid'])\n\t\tchannel = service.channels(channel_sid)\n\t\tresponse = channel.messages(message_sid).delete\n\t\tputs response\n\t\tmessages_response= \"{\\n\\\"message\\\": \\\"Message was deleted\\\"\\n}\"\n\t\tjson_response(messages_response)\n\tend",
"def remove_from_notification (n)\n logger.debug2 \"comment id #{id}. Notification id #{n.id}. notification key #{n.noti_key}\" if debug_notifications\n # only modify unread notifications\n return unless n.noti_read == 'N'\n cn = notifications.where(\"notification_id = ?\", n.id).first\n logger.debug2 \"cn.class = #{cn.class}\" if debug_notifications\n logger.debug2 \"cn.id = #{cn.id}\" if cn and debug_notifications\n logger.debug2 \"cn.noti_key = #{cn.noti_key}\" if cn and debug_notifications\n logger.debug2 \"cn.from_user.short_user_name = #{cn.from_user.short_user_name}\" if cn and cn.from_user and debug_notifications\n logger.debug2 \"cn.to_user.short_user_name = #{cn.to_user.short_user_name}\" if cn and cn.to_user and debug_notifications\n # find no users before and after removing this comment from notification\n old_no_users = n.api_comments.collect { |c| c.user_id }.uniq.size\n new_users = n.api_comments.find_all { |ac| ac.id != id }.collect { |ac| ac.user }.uniq\n new_no_users = new_users.size\n if new_no_users == 0\n # last user for this unread notification has been removed\n logger.debug2 \"last user for this unread notification has been removed\" if debug_notifications\n n.destroy!\n return\n end\n return if old_no_users == new_no_users # unchanged number of users => unchanged notification\n if new_no_users > 3\n # unchanged noti_key and username array. Just change number of users\n logger.debug2 \"unchanged noti_key and username array. Just change number of users\" if debug_notifications\n notifications.delete(cn) if cn\n noti_options = n.noti_options\n noti_options[:no_users] = new_no_users\n noti_options[:no_other_users] = new_no_users - 2\n n.noti_options = noti_options\n n.save!\n return\n end\n # change noti_key, username array and number of users\n if n.noti_key !~ /^([a-z_]+)_(\\d)_v(\\d+)$/\n logger.debug2 \"invalid noti key format. noti key = #{noti_key}\"\n return\n end\n logger.debug2 \"change noti_key, username array and number of users\" if debug_notifications\n noti_key_prefix, noti_key_no_users, noti_key_version = $1, $2, $3\n noti_options = n.noti_options\n (1..3).each { |i| noti_options[\"username#{i}\".to_sym] = nil }\n usernames = new_users.collect { |u| u.short_user_name }\n 0.upto(usernames.size-1).each do |i|\n noti_options[\"username#{i+1}\".to_sym] = usernames[i]\n end\n noti_options[:no_users] = new_no_users\n noti_options[:no_other_users] = new_no_users - 2\n n.noti_key = \"#{noti_key_prefix}_#{new_no_users}_v#{noti_key_version}\"\n logger.debug2 \"noti_key: old = #{n.noti_key_was}, new = #{n.noti_key}\" if debug_notifications\n n.noti_options = noti_options\n notifications.delete(cn) if cn\n n.save!\n end",
"def unsubscribe(msg)\n false\n end",
"def delete\n membership = Membership.find_by(uuid: conversation_params[:uuid])\n convo = membership.conversation\n leave_message = convo.messages.create(text: \"Conversation has ended\", user_index: -1)\n MessagesChannel.broadcast_to convo, MessageSerializer.new(leave_message)\n membership.update(is_active: false) if membership\n create_or_join\n end",
"def remove_friend\n end",
"def destroy\n @channel_user.destroy\n respond_to do |format|\n format.html { redirect_to channel_users_url, notice: 'Channel user was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def unsubscribe(&blk)\n pres = connection.presence_stanza('to'=>jid.bare, 'type' => 'unsubscribe')\n connection.send_stanza pres, &blk\n end",
"def remove_ignored_client_channel_uids\n remove_ignored_uid_fields!(params[:client][:client_channels_attributes]) if params[:client]\n true\n end",
"def remove\r\n session_user.details.select { |d| d.key =~ /^cc_/ }.each { |d| d.destroy }\r\n render :text => \"Craftsman Club details wiped clean.\"\r\n end",
"def unreceive message, headers={}\n end",
"def local_remove(body)\n key_hash = _user_keyhash(body)\n raise \"Invalid username\" unless key_hash\n raise \"That user is signed in!\" if @var[:presence][key_hash]\n @connection.comm.rsa_keys.delete(body)\n @connection.comm.names.delete(key_hash)\n @var[:user_keys].delete body\n _save_env\n _notice \"User '#{body}' has been removed from your key repository\"\nend",
"def channel_delete(attributes = {}, &block)\n register_event(ChannelDeleteEvent, attributes, block)\n end",
"def destroy\n\n @invitation.destroy\n if (@invitation.recipient != nil) && (!@invitation.active)\n @collaboration = Collaboration.find_by(user_id: @invitation.recipient.id, list_id: @invitation.list_id)\n @collaboration.destroy if @collaboration.blank?\n end\n ActionCable.server.broadcast 'invitation_channel', status: 'deleted', id: @invitation.id, list_id: @invitation.list_id,recipient: @invitation.recipient_id, owner: @list.owner.id\n flash[:notice] = 'Invitation was successfully destroyed.'\n respond_to do |format|\n format.json { head :no_content }\n format.js\n end\n end",
"def remove; end",
"def remove; end",
"def remove; end",
"def remove; end",
"def remove_registration\n reg = Iq.new_register\n reg.to = jid.domain\n reg.query.add(REXML::Element.new('remove'))\n send_with_id(reg)\n end",
"def on_remove(&block)\n @onRemoveBlock = block\n end",
"def removed(member)\n return unless member.idea.owner # => prevents sending when idea is deleted\n\n @member = member\n mail(:to => member.user.email, :subject => \"You have been removed from the \\\"#{member.idea.name}\\\" idea\", :tag => 'member-removed') \n end",
"def remove message\n @events.delete message.sequence\n end",
"def irc_kick_event(stem, sender, arguments) # :nodoc:\n if arguments[:recipient] == @nick then\n old_pass = @channel_passwords[arguments[:channel]]\n @chan_mutex.synchronize do\n drop_channel arguments[:channel]\n #TODO what should we do if we are in the middle of receiving NAMES replies?\n end\n join_channel arguments[:channel], old_pass if options[:rejoin]\n else\n @chan_mutex.synchronize do\n @channel_members[arguments[:channel]].delete arguments[:recipient]\n #TODO what should we do if we are in the middle of receiving NAMES replies?\n end\n end\n end",
"def sub_remove _value=0\n send_cmd(\"sub_remove #{_value}\")\n end",
"def unsubscribe_from_channel # :nodoc:\n run_callbacks :unsubscribe do\n unsubscribed\n end\n end",
"def destroy\n # delete a specific message\n end",
"def channel\n params.detect { |param| param.start_with?(\"#\") }&.delete(\"#\")\n end",
"def delrole(event, role)\n if @assignable_roles.include? role then\n if event.message.author.roles.find {|r| r.name == role}\n event.message.author.remove_role get_role(event, role)\n event.send_message(\"alright hun, #{role} removed\")\n else\n event.send_message(\"i don't see that role, you sure have an imagination sometimes, hun\")\n end\n else\n if event.message.author.roles.find {|r| r.name == role}\n event.send_message(\"only big kids can touch that role, cutie pie\")\n else\n event.send_message(\"tsk tsk tsk!\")\n end\n end\n end",
"def unsubscribe\n mailchimp = Gibbon::API.new\n result = mailchimp.lists.unsubscribe({\n :id => ENV[\"MAILCHIMP_LIST_ID\"],\n :email => {:email => self.email},\n :delete_member => true, # this is NOT the default value\n :send_notify => true,\n :send_goodbye => true\n })\n Rails.logger.info(\"Unsubscribed #{self.email} from MailChimp\") if result\n end",
"def unsubscribe; end",
"def cleanup\n @channel.close if @channel\n\n nil\n end",
"def remove_notification\n if followable_type == \"User\"\n notice = Notification.where({\n target_id: followable_id,\n target_type: \"User\",\n notice_id: id,\n notice_type: \"Follow\",\n user_id: followable_id,\n notifier_id: follower_id\n }).first\n notice.blank? ? true : notice.destroy\n end\n end",
"def unsubscribe\n @conn.send_data :opcode => UNSUBSCRIBE, :channel => @name\n end",
"def remove_user_by_handle(handle)\n ct = @handle_keys.key(handle)\n socket = @socket_keys.key(ct)\n @sockets.delete socket\n\n @handles.delete handle\n @handle_keys.delete ct\n @socket_keys.delete socket\n begin\n broadcast_message(socket, \"LEAVE\", [handle])\n rescue\n log \"failed to broadcast LEAVE for clone handle #{handle}\"\n end\n end",
"def destroy\n @user_to_channel_subscription.destroy\n respond_to do |format|\n format.html { redirect_to user_to_channel_subscriptions_url, notice: 'User to channel subscription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def unsubscribe\n @entry.subscribers.delete(current_user)\n end"
] | [
"0.67463094",
"0.66882",
"0.6494119",
"0.6476184",
"0.64005417",
"0.6232816",
"0.6104394",
"0.6089027",
"0.6069224",
"0.60441095",
"0.6012108",
"0.5985949",
"0.5978697",
"0.5976731",
"0.59377664",
"0.58905846",
"0.58905846",
"0.58563626",
"0.58173764",
"0.579825",
"0.5784963",
"0.57617635",
"0.5760459",
"0.5760153",
"0.57598025",
"0.5734236",
"0.5727041",
"0.56826496",
"0.5672308",
"0.56615084",
"0.56607616",
"0.56606466",
"0.5654071",
"0.56506735",
"0.5643662",
"0.5641353",
"0.56173927",
"0.56173927",
"0.5614027",
"0.5571877",
"0.55626005",
"0.5561598",
"0.555355",
"0.5544745",
"0.55282485",
"0.5521179",
"0.55165005",
"0.55125535",
"0.5512502",
"0.55116194",
"0.551035",
"0.55081564",
"0.55007184",
"0.5500546",
"0.54972",
"0.5485994",
"0.5477085",
"0.5466078",
"0.5464387",
"0.5461444",
"0.5452075",
"0.54482216",
"0.54359174",
"0.5430456",
"0.54298633",
"0.54163456",
"0.5410285",
"0.54052126",
"0.53958255",
"0.5395733",
"0.5390088",
"0.5383901",
"0.5380756",
"0.5379461",
"0.5378852",
"0.5375988",
"0.5373301",
"0.5368585",
"0.5364726",
"0.5364726",
"0.5364726",
"0.5364726",
"0.53591865",
"0.5356584",
"0.5348991",
"0.53475887",
"0.53456914",
"0.5335195",
"0.53302807",
"0.5315377",
"0.5313653",
"0.52957124",
"0.52929384",
"0.52900654",
"0.5287459",
"0.5285397",
"0.52794385",
"0.52783865",
"0.52769846",
"0.52756274"
] | 0.65926135 | 2 |
Internal handler for GUILD_MEMBER_ADD | def add_guild_member(data)
server_id = data['guild_id'].to_i
server = self.server(server_id)
member = Member.new(data, server, self)
server.add_member(member)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_member(opts)\n opts = check_params(opts,[:members])\n super(opts)\n end",
"def add_member\n become_member = $browser.element(@selector).link(text: 'Become a Member')\n become_member.click if become_member.exist?\n\n add_new = $browser.element(@selector).link(text: 'Add New')\n add_new.click if add_new.exist?\n end",
"def add_member(node_info)\n @cluster_members << node_info\n end",
"def addmember\n\t\t@member=User.new\n\t\tend",
"def add_member(name, member)\n lacp = parse_lacp_mode(name)[:lacp_mode]\n grpid = /(\\d+)/.match(name)[0]\n configure_interface(member, \"channel-group #{grpid} mode #{lacp}\")\n end",
"def add( env, id, current_user )\n member = ActiveFedora::Base.find( id )\n return unless env.current_ability.can?( :edit, member )\n env.curation_concern.provenance_child_add( current_user: current_user, child_id: id, event_note: 'BeforeAttachMembersActor' )\n end",
"def add_creator_as_member\n Membership.add_membership(created_by_id, id)\n end",
"def add_user(member)\n user = @member_class.new :name => member, :node => self.node\n raise unless user.exists?\n self[:users] << member\n self[:users].uniq!\n end",
"def add_member_name(name)\n\n end",
"def add2(env, id)\n member = ActiveFedora::Base.find(id)\n return unless env.current_ability.can?(:edit, member)\n env.curation_concern.ordered_members << member\n end",
"def add_member(user)\n user.add_role(:member, self)\n end",
"def add_groupmember(member)\n group = @group_class.new :name => member, :node => self.node\n raise unless group.exists?\n self[:groupmembers] << group.generateduid.first \n self[:groupmembers].uniq!\n end",
"def add_member(params)\n room_id = self.room_id || params.delete(:room_id)\n raise ArgumentError.new(\"room_id required\") unless room_id\n\n user_name = user_name_from_params(params)\n raise ArgumentError.new(\"user_id or user_mention or user_email required\") unless user_name\n\n call_api(:method => :put, :uri => @api_base.merge(\"room/#{room_id}/member/#{user_name}\"), :body_params => params)\n end",
"def add(env, id)\n member = ActiveFedora::Base.find(id)\n return unless env.current_ability.can?(:edit, member)\n env.curation_concern.ordered_members << member\n end",
"def add_member(member)\n Rails.logger.info(\"------------adding #{member} to circle\")\n if !self.circle.users.include?( member )\n member.memberships.create(:circle => self.circle)\n UserMailer.notify_added_to_circle(self,member).deliver\n #send email\n else\n Rails.logger.info(\"--------------already a member!\") \n end\n end",
"def add_member(user)\n if (!self.members.include?(user))\n self.members << user\n else\n raise GroupsManagement::UserIsAlreadyMember, \"The user \" + user.email + \" is already a member of '\" + self.name + \"'.\"\n end\n end",
"def add_member(_team, _user, _role: :reader, _email: false)\n # stub\n end",
"def add_member(user)\n update_membership(user, true)\n end",
"def add_guild_member(guild_id, user_id, access_token:, nick: nil, roles: nil, mute: nil, deaf: nil)\n response = request(\n :guilds_gid_members_uid, guild_id,\n :put,\n \"guilds/#{guild_id}/members/#{user_id}\",\n access_token: access_token, nick: nick, roles: roles, mute: mute, deaf: deaf,\n )\n\n return nil if response.status == 204\n\n Rapture::Member.from_json(response.body)\n end",
"def handle_existing_chatroom_member\n validate_ownership_and_membership_status; return if performed?\n @chatroom_member.update(has_left: false)\n save_chatroom_member\n end",
"def handle_new_chatroom_member\n @chatroom_member = ChatroomMember.new(chatroom_member_params)\n save_chatroom_member\n end",
"def can_add_member?(team_name,member)\n true\n end",
"def add_member\n result=@cabal.add_member(params[:username])\n member = \"\"\n if result==0\n notice = \"User does not exist. \"\n elsif result==-1\n notice = \"User already in cabal. \"\n else\n notice = \"Successfully added user to cabal. \"\n member = \", \" + params[:username]\n end\n @response = notice\n @member = member\n respond_to do |format|\n format.js {}\n end\n end",
"def add_member(entity, role_id = IdeasUsers::MENTOR)\n return false if self.users.include?(entity)\n IdeasUsers.create(:user_id => entity.id, :idea_id => self.id, :role_id => role_id)\n NotificationWorker.added_member(entity, self)\n end",
"def add_member( member )\n @members[member] = Person.new ( member )\n @members\n end",
"def add_member(user)\n members << user unless has_member? user\n end",
"def addTeamMember _obj, _args\n \"_obj addTeamMember _args;\" \n end",
"def create_member(data)\n headers = @client.make_request(:post, @client.concat_user_path(\"#{CONFERENCE_PATH}/#{id}/members\"), data)[1]\n id = Client.get_id_from_location_header(headers[:location])\n get_member(id)\n end",
"def add_group_members(members)\n logger.debug(\"#{new_resource} adding members #{members.join(\", \")}\") unless members.empty?\n members.each do |user|\n shell_out!(\"user\", \"mod\", \"-G\", new_resource.group_name, user)\n end\n end",
"def add username\n @members.add username\n end",
"def add_member_data(lb, member)\n begin\n obj = JSON.parse(lb.member_data_for(member[:handle]))\n obj.each { |key, value| member[key] = value }\n rescue\n # fail silently if no data exists\n end\n member\nend",
"def add_member(member_name, klass, options = T.unsafe(nil)); end",
"def add_member\n members << mainfile.first unless mainfile.empty? || members.include?(mainfile.first)\n end",
"def create\n @member = @space.members.new(member_params)\n @member.user = current_user\n\n respond_to do |format| \n if @member.save\n @space.members << @member\n\n format.html { redirect_to space_member_url(@space, @member), notice: 'Member was successfully created.' }\n format.json { render :show, status: :created, location: [@space, @member] }\n else\n format.html { render :new }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def member(jid,reason=nil,&blk)\n set_affiliation 'member', jid, reason, &blk\n end",
"def pfadd(key, member); end",
"def generate_add_member_internal_event adder_id, role_id\n InternalEvent.create({\n subject: :project_member_added,\n klass: :role,\n user_id: adder_id,\n subject_id: role_id,\n project_id: self.id\n })\n end",
"def addmember(user)\n\t\t#generate random leid for mailchimp\n\t\tuser.euid = rand(1 .. 500000000).to_s\n\t\tuser.save\n\t\t#assuming LEID is our user id and EUID is mailchimp's unique one\n\t\t#taken from here https://bitbucket.org/mailchimp/mailchimp-api-ruby/\n\t\tsubscribers = [{ \"EMAIL\" => { \"email\" => user.email,\n \"LEID\" => user.id.to_s,\n \"EUID\" => user.euid\n },\n\n :EMAIL_TYPE => 'html',\n :merge_vars => { \"FNAME\" => user.first_name,\n \"LNAME\" => user.last_name,\n \"STATUS\" => \"Subscribed\"\n }\n }]\n\n #batch-subscribe(string apikey, string id, array batch, boolean double_optin, boolean update_existing, boolean replace_interests)\n \t@mc.lists.batch_subscribe(@mli, subscribers, false, true, false)\n\tend",
"def add_member path\n rewrite_members member_paths.add(path)\n end",
"def add_member\n @group = Group.find(params[:id])\n @user = User.find_by_username(params[:username])\n\n unless @user.nil? || @group.users.include?(@user)\n @group.users << @user\n flash[:notice] = \"Miembro añadido exitosamente.\" if @group.save\n else\n flash[:error] = \"No se pudo añadir a este usuario. Verifique que el usuario a añadir sea el correcto.\"\n end\n\n redirect_to group_path(@group)\n end",
"def insert_member(fedora_object)\n if (fedora_object.instance_of?(Bplmodels::ObjectBase))\n\n #add to the members ds\n #members.insert_member(:member_id=>fedora_object.pid, :member_title=>fedora_object.titleSet_display, :member_type=>fedora_object.fedora_name\n\n #add to the rels-ext ds\n #fedora_object.collections << self\n #self.objects << fedora_object\n #self.add_relationship(:has_image, \"info:fedora/#{fedora_object.pid}\")\n elsif (fedora_object.instance_of?(Bplmodels::Institution))\n #add to the members ds\n members.insert_member(:member_id=>fedora_object.pid, :member_title=>fedora_object.titleSet_display, :member_type=>fedora_object.fedora_name)\n\n #add to the rels-ext ds\n fedora_object.collections << self\n self.institutions << fedora_object\n\n end\n\n fedora_object.save!\n self.save!\n\n end",
"def add_member(str, project)\n if (user = find_member(str))\n set_status(project, :member, user, :add)\n @candidate = nil\n else\n flash_error(:add_members_not_found.t(str))\n end\n redirect_to(project_path(project.id, q: get_query_param))\n end",
"def add_member_to_list(user, list, member_id, options={})\n post(\"/#{user}/#{list}/members.json\", options.merge(:id => member_id))\n end",
"def member\n end",
"def add_member(user)\r\n fail \"missing user\" if user.nil?\r\n\r\n @member_limits.store(user.email, Limit.create(user, self))\r\n self.members.store(user.email, user)\r\n end",
"def addMembers (group_id, user_id)\n \tm = GroupUser.new(:group_id => group_id, :user_id => user_id)\n \tm.save\n end",
"def member; end",
"def member; end",
"def member; end",
"def member; end",
"def member; end",
"def add_group_as_member(group)\n self.groups.push group\n end",
"def obj_add(obj,klass,member)\n obj_manipulate obj,klass do |man|\n man.checks do \n raise_if_member_is_not_valid_for klass, member\n end \n man.in_session do \n raise_if_obj_do_not_exist obj\n raise_if_obj_do_not_exist member \n get_response_and_validate_for(obj,klass,\"add\",member)\n end\n end\n end",
"def add_member(user, send_invite = false, send_message = false)\n member_id = Ecircle.client.\n create_member(:userId => user.id, :groupId => @id,\n :invite => send_invite, :sendMessage => send_message)\n Ecircle::Member.find_by_id(member_id)\n end",
"def make_member!\n make_role!(MemberRole)\n end",
"def add_member\n return unless (request.post? && params[:student_user_name])\n # add member to the group with status depending if group is empty or not\n grouping = Grouping.find(params[:grouping_id])\n @assignment = Assignment.find(params[:id], include: [{groupings: [{student_memberships: :user, ta_memberships: :user}, :group]}])\n student = Student.find_by_user_name(params[:student_user_name])\n if student.nil?\n @error = \"Could not find student with user name #{params[:student_user_name]}\"\n render :error_single\n return\n end\n set_membership_status = grouping.student_memberships.empty? ?\n StudentMembership::STATUSES[:inviter] :\n StudentMembership::STATUSES[:accepted]\n grouping.invite(params[:student_user_name], set_membership_status)\n grouping.reload\n @grouping = construct_table_row(grouping, @assignment)\n end",
"def add_member_phone(phone)\n\n end",
"def insert_group_member(**args)\n\t\t\tnew_member = @api.members.insert.request_schema.new({\n\t\t\t\t'email' => args[:email],\n\t\t\t\t'role' => 'MEMBER'\n\t\t\t\t})\n\t\t\tres = @client.execute(\n\t\t\t\t:api_method => @api.members.insert,\n\t\t\t\t:parameters => {'groupKey' => args[:group_email]},\n\t\t\t\t:body_object => new_member\n\t\t\t\t)\n\t\t\treturn unJSON(res.body)\n\t\tend",
"def add_member(input_jury)\n\t\t@members << input_jury\n\tend",
"def associate_member_with_community\n self.community.members << self.member unless self.community.members.include? self.member\n end",
"def add_member_to_card(card_id, member_id)\n create_card_resource(card_id, \"idMembers\", value: resource_id(member_id))\n end",
"def addMembers (group_id, user_id)\n \tm = GroupUser.new(:group_id => @group_id, :user_id => @user_id)\n \tm.save\n end",
"def add_member_to_card\n @trello.add_commander_to_card(find_member, @card)\n end",
"def add_item(item)\n if member_labels.include?(item.pref_label)\n errors.add :members, \"must be unique\"\n else\n members << item\n end\n end",
"def add_member(user, _assignment_id = nil)\n raise \"The user #{user.name} is already a member of the team #{self.name}\" if user?(user)\n can_add_member = false\n unless full?\n can_add_member = true\n t_user = TeamsUser.create(user_id: user.id, team_id: self.id)\n parent = TeamNode.find_by(node_object_id: self.id)\n TeamUserNode.create(parent_id: parent.id, node_object_id: t_user.id)\n add_participant(self.parent_id, user)\n ExpertizaLogger.info LoggerMessage.new('Model:Team', user.name, \"Added member to the team #{self.id}\")\n end\n can_add_member\n end",
"def ldap_add_members!\n Rails.logger.tagged(:ldap) { Rails.logger.info \"Looking up an LDAP group matching '#{name}'\" }\n\n portus_user = User.portus\n usernames = users.map(&:username)\n\n ::Portus::LDAP::Search.new.find_group_and_members(name).each do |member|\n next if usernames.include?(member)\n next unless User.exists?(username: member)\n\n add_team_member!(portus_user, member)\n end\n\n update!(ldap_group_checked: Team.ldap_statuses[:checked], checked_at: Time.zone.now)\n end",
"def add!(child)\n #should add defensive check here: is the child a Permission or a Command?\n self.children.add(child)\n end",
"def add_guest(actor_id)\n @max_battle_member_count += 1 if battle_members.size >= max_battle_members\n fix_actor(actor_id)\n end",
"def handle_member_event(payload, metadata = nil)\n apply payload, metadata\n end",
"def do_add_team_member(a_team_member)\n @team_member = a_team_member\n end",
"def add_member(opts)\n opts = check_params(opts,[:member_vlans])\n super(opts)\n end",
"def add_member(user, id = nil)\n raise \"The user \\\"#{user.name}\\\" is already a member of the team, \\\"#{self.name}\\\"\" if user?(user)\n t_user = TeamsUser.create(user_id: user.id, team_id: self.id)\n parent = TeamNode.find_by(node_object_id: self.id)\n TeamUserNode.create(parent_id: parent.id, node_object_id: t_user.id)\n add_participant(self.parent_id, user)\n end",
"def add_member_email(email)\n\n end",
"def add_membership(entity, args = {})\n\t\ta = add_association(entity, \"membership\", \"joinable\", \"joined\")\n\t\tif a\n\t\t\targs.each do |k,v|\n\t\t\t\teval \"a.#{k.to_s.downcase} = #{v}\"\n\t\t\tend\n\t\t\ta.save\n\t\tend\n\t\ta\n\tend",
"def add_member_add_member(resource_reference, opts = {})\n data, _status_code, _headers = add_member_add_member_with_http_info(resource_reference, opts)\n data\n end",
"def add_group_member\n @group_member = RockGroupMember.find_or_initialize_by({\n GroupId: @group_id,\n PersonId: person.mapped_record.person_alias.PersonId\n })\n @group_member.IsSystem = false\n @group_member.GroupRoleId = 266 # member for worship services\n @group_member.GroupMemberStatus = 1 #\n @group_member.Guid = SecureRandom.uuid\n @group_member.CreatedDateTime = Time.new\n @group_member.Note = 'Imported From Arena'\n\n @group_member.save!\n end",
"def func_add(sender, dest, args)\r\n\t\tif args.size() >= 1\r\n\t\t\tuser= sender.nick\r\n\t\t\tmatchid= args[0].to_i()\r\n\t\t\tres= @db.query(\"SELECT * FROM `users` WHERE account='#{sender.account_name}'\")\r\n\t\t\tif res.num_rows() > 0\r\n\t\t\t\tu= res.fetch_hash()\r\n\t\t\t\tuserid= u['id'].to_i()\r\n\t\t\t\terr= false\r\n\r\n\t\t\t\t# user don' want to add himself\r\n\t\t\t\t# !add <match_id> <user>\r\n\t\t\t\tif (u['level'].to_i() <= 1) and (args.size() == 2)\r\n\t\t\t\t\ttarg_account= args[1].to_s()\r\n\r\n\t\t\t\t\tres2= @db.query(\"SELECT * FROM `users` WHERE account=\\\"#{targ_account}\\\"\")\r\n\t\t\t\t\tif res2.num_rows() > 0\r\n\t\t\t\t\t\tt= res2.fetch_hash()\r\n\t\t\t\t\t\tuserid= t['id'].to_i()\r\n\t\t\t\t\t\tuser= targ_account\r\n\t\t\t\t\t# user not found, maybe his current nick was given instead of his account\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\ttarg= getUserObj(targ_account)\r\n\t\t\t\t\t\tif targ != nil\r\n\t\t\t\t\t\t\tres3= @db.query(\"SELECT * FROM `users` WHERE account=\\\"#{targ.account_name}\\\"\")\r\n\t\t\t\t\t\t\tif res3.num_rows() > 0\r\n\t\t\t\t\t\t\t\tt= res3.fetch_hash()\r\n\t\t\t\t\t\t\t\tuserid= t['id'].to_i()\r\n\t\t\t\t\t\t\t\tuser= targ.nick\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\terr= true\r\n\t\t\t\t\t\t\tend\r\n\t\t\t\t\t\t\tres3.free()\r\n\t\t\t\t\t\tend\r\n\t\t\t\t\tend\r\n\t\t\t\t\tres2.free()\r\n\t\t\t\t\tsender.notice(\"unknow user: #{targ_account}\") if err\r\n\t\t\t\tend\r\n\r\n\t\t\t\tif !err\r\n\t\t\t\t\t# check if match exists\r\n\t\t\t\t\tif matchid == 0\r\n\t\t\t\t\t\tres2= @db.query(\"SELECT * FROM `matchs` WHERE Date LIKE CONCAT(CURDATE(),'%%')\");\r\n\t\r\n\t\t\t\t\t\t# if no match found, create one\r\n\t\t\t\t\t\tif res2.num_rows() == 0\r\n\t\t\t\t\t\t\t@db.query(\"INSERT INTO matchs(Adversaires,Type,Type_Comment,Date,Etat,Maps,Server,Comments) VALUES('?','m','pcw',CONCAT(CURDATE(), ' 21:00:00'),'c','?/?','','')\");\r\n\t\t\t\t\t\t\tres2= @db.query(\"SELECT MAX(id) FROM matchs\");\r\n\t\t\t\t\t\t\t# mysql_get_field(res, 0, \"MAX(id)\", num);\r\n\t\t\t\t\t\t\tm= res2.fetch_hash()\r\n\t\t\t\t\t\t\tmatchid= m['MAX(id)']\r\n\t\t\t\t\t\tend\r\n\t\t\t\t\tend\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tres2= @db.query(\"SELECT * FROM matchs WHERE id=\\\"#{matchid}\\\" AND Etat='c'\")\r\n\t\t\t\t\tif res2.num_rows() > 0\r\n\t\t\t\t\t\tm= res2.fetch_hash()\r\n\t\t\t\t\t\t# check if user is not already registered\r\n\t\t\t\t\t\tres3= @db.query(\"SELECT * FROM link WHERE link.user='#{userid}' AND link.match='#{matchid}'\")\r\n\t\t\t\t\t\tif res3.num_rows() > 0\r\n\t\t\t\t\t\t\tsender.notice(\"#{user} already registered in match #{matchid} vs #{m['Adversaires']}\")\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t@db.query(\"INSERT INTO link(link.user,link.match) VALUES('#{userid}','#{matchid}')\")\r\n\t\t\t\t\t\t\tsender.notice(\"'#{user}' added to match #{matchid} vs #{m['Adversaires']}\")\r\n\t\t\t\t\t\t\tupdateTopic()\r\n\t\t\t\t\t\tend\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tsender.notice(\"unknow match id: #{matchid}\")\r\n\t\t\t\t\tend\r\n\t\t\t\t\tres2.free()\r\n\t\t\t\tend\r\n\r\n\t\t\telse\r\n\t\t\t\tsender.notice(\"no account in db, tell bot owner\")\r\n\t\t\tend\r\n\t\t\tres.free()\r\n\t\telse\r\n\r\n\t\tend\r\n\tend",
"def add_group_member(team_id, user_id, access_level)\n post(\"/groups/#{team_id}/members\", :body => {:user_id => user_id, :access_level => access_level})\n end",
"def update_guild_member(data)\n server_id = data['guild_id'].to_i\n server = self.server(server_id)\n\n member = server.member(data['user']['id'].to_i)\n member.update_roles(data['roles'])\n member.update_nick(data['nick'])\n end",
"def add(response)\n toggle_membership(response, :add_user_to_group, \"user_added\", \"user_already_in\")\n end",
"def add_members(memberIDs, startOrder, save=true)\n if self.memberIDs.length==0 \n self.memberIDs = memberIDs\n elsif\n self.memberIDs.insert(startOrder-1, *memberIDs)\n end\n if save\n self.save\n end\n return self\n end",
"def add_team_member!(author, username)\n role = APP_CONFIG[\"ldap\"][\"group_sync\"][\"default_role\"]\n params = { id: id, role: TeamUser.roles[role], user: username }\n\n team_user = ::TeamUsers::BuildService.new(author, params).execute\n team_user = ::TeamUsers::CreateService.new(author, team_user).execute\n return true if team_user.valid? && team_user.persisted?\n\n Rails.logger.tagged(:ldap) do\n Rails.logger.warn \"Could not add team member: #{team_user.errors.full_messages.join(\", \")}\"\n end\n false\n end",
"def create_membership\n member = Member.new(squad: @squad, user: current_user, membership: 'owner')\n member.save(validate: false)\n end",
"def add_battle_member(actor_id, index = nil)\n return unless @actors.include?(actor_id)\n if index.nil?\n return if battle_members.include?($game_actors[actor_id])\n return if battle_members.size >= max_battle_members # non serve granché\n index = battle_members.size\n end\n\n @actors.delete(actor_id)\n @actors.insert(index, actor_id)\n end",
"def add_members(members)\n @members.merge!(members)\n end",
"def min_up_members_action\n super\n end",
"def add_members # :norobots:\n pass_query_params\n if @project = find_or_goto_index(Project, params[:id].to_s)\n @users = User.all(:order => \"login, name\")\n if !@project.is_admin?(@user)\n redirect_to(:action => 'show_project', :id => @project.id,\n :params => query_params)\n elsif !params[:candidate].blank?\n @candidate = User.find(params[:candidate])\n set_status(@project, :member, @candidate, :add)\n end\n end\n end",
"def pfadd(key, member)\n node_for(key).pfadd(key, member)\n end",
"def create\n user = User.find_user(params[:member][:user_id])\n @board = Board.find_board(params[:member][:board_id])\n @action = 'join'\n if ( !user.nil? && !@board.nil? )\n logger.debug \"----------------Member.new-------------------------------------\"\n @member = Member.new(params[:member])\n @member.user_id = user.id\n if params[:commit] == Member::Commit::FOLLOW\n logger.debug \"----------------Adding a follower #{user.full_name}-------------------------------------\"\n @member.user_id = current_user.id # follower could be only the current user\n @member.member_type = Member::MemberType::FOLLOWER\n # follower? is true if a user is a follower, member or owner\n if !current_user.follower?(@board)\n logger.debug \"----------------Saving follower #{user.full_name}-------------------------------------\"\n @action = 'follow'\n @member.save\n flash.now[:success] = \"Board \\\"#{@board.title}\\\" was linked to your profile.\"\n else\n flash.now[:warning] = \"Your profile already linked to \\\"#{@board.title}\\\".\"\n end\n else\n logger.debug \"----------------Adding a member #{user.full_name}-------------------------------------\"\n if !user.member?(@board)\n logger.debug \"----------------User #{user.full_name} is not a member-------------------------------------\"\n follower = user.follower?(@board)\n if follower\n logger.debug \"----------------Updating follower #{user.full_name} to become a member-------------------------------------\"\n follower.update_attribute(:member_type, Member::MemberType::MEMBER)\n else\n logger.debug \"----------------Saving #{user.full_name} as a member-------------------------------------\"\n @member.member_type = Member::MemberType::MEMBER\n @member.save\n end\n else\n logger.debug \"----------------Saving a follower #{user.full_name}-------------------------------------\"\n @member.member_type = Member::MemberType::MEMBER\n @member.save\n end\n flash.now[:success] = \"#{user.full_name} was added to your Board \\\"#{@board.title}\\\".\"\n end\n end\n\n if params[:commit] == Message::Commit::CONFIRM\n msg_id = params[:member][:message]\n unless ( msg_id.nil? )\n message = Message.find(msg_id)\n unless ( message.nil? )\n message.update_attribute(:msg_state, Message::State::CONFIRMED)\n end\n end\n end\n \n params[:act] = 'board_search'\n params[:search] = params[:member][:search] if !params[:member][:search].nil?\n\n respond_to do |format|\n #if @member.save\n format.html { redirect_to home_path }\n format.js\n format.json { render json: home_path, status: :created, location: home_path }\n #else\n # format.html { render action: \"new\" }\n # format.json { render json: @member.errors, status: :unprocessable_entity }\n #end\n end\n end",
"def create\n #TODO validate that the params[:id] is a legal value for user\n @group = Group.find(params[:group_id])\n authorize! :edit, @group\n Hydra::LDAP.add_users_to_group(@group.code, [params[:id]])\n redirect_to edit_group_path(@group), :notice=>\"Added member #{params[:id]}\"\n end",
"def add_member_role(auth, server_id, user_id, role_id, reason = nil)\n MijDiscord::Core::API.request(\n :guilds_sid_members_uid_roles_rid,\n server_id,\n :put,\n \"#{MijDiscord::Core::API::APIBASE_URL}/guilds/#{server_id}/members/#{user_id}/roles/#{role_id}\",\n nil,\n Authorization: auth,\n 'X-Audit-Log-Reason': reason\n )\n end",
"def add(child); end",
"def click_become_a_member\n add_new = $browser.element(@selector).link(text: 'Become a Member')\n add_new.click\n end",
"def create\n @member = GroupMember.new(params[:member])\n if @current_member.group.add_member @member\n render :json=>{success:true, new_id:@member.id}\n UserMailer.invite_email(@member.email).deliver\n else\n render :json=>{success:false, errors:@member.errors}\n end\n end",
"def addMember(group_or_eperson)\n raise 'must give non nil group_or_eperson' if group_or_eperson.nil?\n\n @model.addMember(group_or_eperson)\n @model.update\n @model\n end",
"def create_lbpool_member(lbpool, body)\n validate([:name, :description, :ip, :port], body)\n post(:uri => lbpool_members_uri(lbpool),\n :body => body,\n :accept => MESSAGE_TYPE,\n :content_type => LBPOOL_MEMBER_TYPE)\n end",
"def add_member\n email = params[:camp]['member_email'].downcase\n member = User.where(email: email).first\n if member == @camp.creator\n flash[:notice] = 'That person is already in your crew. Way to go!'\n else\n @camp.users << member\n flash[:notice] = 'You added a new crewmember, and they can now edit your shared dream. Praise be!'\n end\n redirect_to @camp\n rescue ActiveRecord::RecordInvalid => e\n flash[:notice] = 'That person is already in your crew. Way to go!'\n redirect_to @camp\n rescue ActiveRecord::AssociationTypeMismatch => e\n flash[:alert] = 'Could not find that email. Maybe your crewmate is not a member yet? Make sure he first Register to the dreams platform'\n redirect_to @camp\n end",
"def members(*) end",
"def add_del_member\n id = Base64.decode64(params[:id]) \n if params[:type] =='add' \n status = params[:gtype] == 'Private' ? 0 : 1 ; #0 means admin needs to accept, 1 directly join public group\n member = GroupMember.create(:group_id=> id,:account_id =>current_user.id, :status => status)\t\t\n\t\t\t if member.save\n\t\t\t\trender :json => 1 and return \n\t\t\t else\n\t\t\t\trender :json => 0 and return \n\t\t\t end \t\n else\n member = GroupMember.where(:group_id=> id,:account_id =>current_user.id).first\n if member.present? && member.delete\n render :json => 1 and return \n else\n\t\trender :json => 0 and return \n end \t\n end\n \n \n end"
] | [
"0.6990879",
"0.6517435",
"0.63937503",
"0.6382706",
"0.6357182",
"0.6316856",
"0.6296525",
"0.6237053",
"0.619828",
"0.61930937",
"0.6181279",
"0.61642915",
"0.6146942",
"0.6142383",
"0.61372334",
"0.612659",
"0.610743",
"0.6082429",
"0.6075876",
"0.6058043",
"0.6053159",
"0.60480696",
"0.60423523",
"0.6026807",
"0.60162175",
"0.59974253",
"0.5983376",
"0.59791493",
"0.59706855",
"0.5966821",
"0.58704835",
"0.5869141",
"0.5850016",
"0.5834499",
"0.58258426",
"0.58112794",
"0.58085126",
"0.57678056",
"0.5726596",
"0.571883",
"0.5717782",
"0.57085615",
"0.5677442",
"0.5671096",
"0.5652608",
"0.5649681",
"0.5643371",
"0.5643371",
"0.5643371",
"0.5643371",
"0.5643371",
"0.5634726",
"0.5633428",
"0.5631854",
"0.5615492",
"0.56131905",
"0.5611708",
"0.5611164",
"0.5610428",
"0.5606833",
"0.5601343",
"0.5599083",
"0.559852",
"0.55935866",
"0.55900794",
"0.55775255",
"0.5567944",
"0.5564501",
"0.55596185",
"0.5553639",
"0.5547293",
"0.5537706",
"0.55276746",
"0.5525062",
"0.5503663",
"0.54920316",
"0.5485751",
"0.54841846",
"0.54736066",
"0.5468464",
"0.5460003",
"0.54509974",
"0.54484785",
"0.54483646",
"0.5434127",
"0.54307956",
"0.5426753",
"0.54235107",
"0.5403503",
"0.54024184",
"0.5396802",
"0.5390812",
"0.53874654",
"0.53849304",
"0.53816646",
"0.5371517",
"0.53711903",
"0.53671473",
"0.5360392"
] | 0.67713344 | 1 |
Internal handler for GUILD_MEMBER_UPDATE | def update_guild_member(data)
server_id = data['guild_id'].to_i
server = self.server(server_id)
member = server.member(data['user']['id'].to_i)
member.update_roles(data['roles'])
member.update_nick(data['nick'])
member.update_boosting_since(data['premium_since'])
member.update_communication_disabled_until(data['communication_disabled_until'])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_guild_member(data)\n server_id = data['guild_id'].to_i\n server = self.server(server_id)\n\n member = server.member(data['user']['id'].to_i)\n member.update_roles(data['roles'])\n member.update_nick(data['nick'])\n end",
"def update!(**args)\n @chat_id = args[:chat_id] if args.key?(:chat_id)\n @member_type = args[:member_type] if args.key?(:member_type)\n end",
"def update!(**args)\n @chat_id = args[:chat_id] if args.key?(:chat_id)\n @member_type = args[:member_type] if args.key?(:member_type)\n end",
"def update!(**args)\n @member_type = args[:member_type] if args.key?(:member_type)\n @membership_count = args[:membership_count] if args.key?(:membership_count)\n @membership_state = args[:membership_state] if args.key?(:membership_state)\n end",
"def update!(**args)\n @member_type = args[:member_type] if args.key?(:member_type)\n @membership_count = args[:membership_count] if args.key?(:membership_count)\n @membership_state = args[:membership_state] if args.key?(:membership_state)\n end",
"def update_inherited_members\n if parent\n if inherit_members? && !inherit_members_before_last_save\n remove_inherited_member_roles\n remove_inherited_member_functions # PATCH\n add_inherited_member_roles\n add_inherited_member_functions # PATCH\n elsif !inherit_members? && inherit_members_before_last_save\n remove_inherited_member_roles\n remove_inherited_member_functions # PATCH\n end\n end\n end",
"def update_members\n unless self.list_members.blank?\n #create new members\n self.list_members.each do |api_member|\n member_params = {}\n api_member.each_pair do |key, value|\n unless key == \"id\"\n if Member.attribute_names.include? key\n member_params[key] = value\n end\n end\n end\n #member already exists\n temp = Member.find_by guid: member_params[\"guid\"]\n if !!temp\n temp.attributes = member_params\n if temp.valid? \n temp.save\n else\n return \"problem updating existing member\"\n end\n else\n member = Member.new(member_params)\n if member.valid?\n member.save\n else\n return \"problem with member params\"\n end\n end\n #delete denied members\n if api_member[\"connection_status\"] != \"CONNECTED\"\n Member.find_by(guid: member_params[\"guid\"]).delete\n Member.delete_member(self.guid, member_params[\"guid\"])\n end\n end\n end\n end",
"def update_member(auth, server_id, user_id, reason = nil, nick: nil, roles: nil, mute: nil, deaf: nil, channel_id: nil)\n MijDiscord::Core::API.request(\n :guilds_sid_members_uid,\n server_id,\n :patch,\n \"#{MijDiscord::Core::API::APIBASE_URL}/guilds/#{server_id}/members/#{user_id}\",\n { roles: roles, nick: nick, mute: mute, deaf: deaf, channel_id: channel_id }.delete_if {|_,v| v.nil? }.to_json,\n Authorization: auth,\n content_type: :json,\n 'X-Audit-Log-Reason': reason\n )\n end",
"def update!(**args)\n @member_type = args[:member_type] if args.key?(:member_type)\n @person_id = args[:person_id] if args.key?(:person_id)\n end",
"def handle_existing_chatroom_member\n validate_ownership_and_membership_status; return if performed?\n @chatroom_member.update(has_left: false)\n save_chatroom_member\n end",
"def update!(**args)\n @affected_member = args[:affected_member] if args.key?(:affected_member)\n @prior_membership_role = args[:prior_membership_role] if args.key?(:prior_membership_role)\n @prior_membership_state = args[:prior_membership_state] if args.key?(:prior_membership_state)\n @target_membership_role = args[:target_membership_role] if args.key?(:target_membership_role)\n end",
"def update!(**args)\n @member_type = args[:member_type] if args.key?(:member_type)\n @square_id = args[:square_id] if args.key?(:square_id)\n end",
"def update!(**args)\n @member_type = args[:member_type] if args.key?(:member_type)\n @square_id = args[:square_id] if args.key?(:square_id)\n end",
"def update!(**args)\n @event_id = args[:event_id] if args.key?(:event_id)\n @member_type = args[:member_type] if args.key?(:member_type)\n end",
"def update!(**args)\n @event_id = args[:event_id] if args.key?(:event_id)\n @member_type = args[:member_type] if args.key?(:member_type)\n end",
"def update_presence(data)\n # Friends list presences have no server ID so ignore these to not cause an error\n return unless data['guild_id']\n\n user_id = data['user']['id'].to_i\n server_id = data['guild_id'].to_i\n server = server(server_id)\n return unless server\n\n member_is_new = false\n\n if server.member_cached?(user_id)\n member = server.member(user_id)\n else\n # If the member is not cached yet, it means that it just came online from not being cached at all\n # due to large_threshold. Fortunately, Discord sends the entire member object in this case, and\n # not just a part of it - we can just cache this member directly\n member = Member.new(data, server, self)\n debug(\"Implicitly adding presence-obtained member #{user_id} to #{server_id} cache\")\n\n member_is_new = true\n end\n\n username = data['user']['username']\n if username && !member_is_new # Don't set the username for newly-cached members\n debug \"Implicitly updating presence-obtained information for member #{user_id}\"\n member.update_username(username)\n end\n\n member.update_presence(data)\n\n member.avatar_id = data['user']['avatar'] if data['user']['avatar']\n\n server.cache_member(member)\n end",
"def update_nickname(member)\n nickname = get_nickname(member)\n if member.display_name != nickname\n member.set_nick nickname\n end\n end",
"def update_from_old_member\n if self.old_member\n old_member = self.old_member\n\n # If this member is a committee member\n if old_member.tier_id == 3\n\n name = old_member.position.chomp(\"Committee Member\").strip\n committee_type = CommitteeType.committee\n cm_type = CommitteeMemberType.cm\n\n # If this member is a committee chair\n elsif old_member.tier_id == 4\n\n name = old_member.position.chomp(\"Chair\").strip\n committee_type = CommitteeType.committee\n cm_type = CommitteeMemberType.chair\n\n # If this member is an executive\n elsif old_member.tier_id == 5\n\n name = \"Executive\"\n committee_type = CommitteeType.admin\n cm_type = CommitteeMemberType.exec(old_member.position)\n\n # Exit with nil if the correct cm_type was not found\n return nil if cm_type.nil?\n\n # If this member is a general member\n elsif old_member.tier_id == 2\n\n name = \"General Members\"\n committee_type = CommitteeType.general\n cm_type = CommitteeMemberType.gm\n\n end\n\n self.add_to_committee(name, committee_type, cm_type)\n\n # Remove from any general committees unless the member belongs there\n self.remove_from_general unless old_member.tier_id == 2\n\n return self.save\n end\n end",
"def update!(**args)\n @membership = args[:membership] if args.key?(:membership)\n end",
"def update!(**args)\n @membership = args[:membership] if args.key?(:membership)\n end",
"def update\n @member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n unless @member.err\n @member.get_member_uuid\n end\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n unless @member.err\n @member.get_member_uuid\n end\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def modify_guild_member(guild_id, user_id, reason: nil, nick: nil, roles: nil, mute: nil, deaf: nil, channel_id: nil)\n request(\n :guilds_gid_members_uid, guild_id,\n :patch,\n \"guilds/#{guild_id}/members/#{user_id}\",\n {nick: nick, roles: roles, mute: mute, deaf: deaf, channel_id: channel_id},\n 'X-Audit-Log-Reason': reason,\n )\n end",
"def update!(**args)\n @members = args[:members] if args.key?(:members)\n @role = args[:role] if args.key?(:role)\n end",
"def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n @uplines = Member.where.not(id: @member.self_and_descendants.collect(&:id)).order(\"fullname\")\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n add_abo_types_to_member(@member)\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to members_url, notice: t('flash.notice.updating_member') }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit, alert: t('flash.alert.updating_member') }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @member.update(member_params)\n logger.info(\"User #{current_user.email} updated Member '#{@member.first_name} #{@member.last_name}' in properties \n '#{@member.audits.last.audited_changes}' on #{@member.updated_at}\")\n format.html { redirect_to organization_path(@organization), notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_presence(data)\n # Friends list presences have no guild ID so ignore these to not cause an error\n return unless data['guild_id']\n\n user_id = data['user']['id'].to_i\n server_id = data['guild_id'].to_i\n server = server(server_id)\n return unless server\n\n member_is_new = false\n\n if server.member_cached?(user_id)\n member = server.member(user_id)\n else\n # If the member is not cached yet, it means that it just came online from not being cached at all\n # due to large_threshold. Fortunately, Discord sends the entire member object in this case, and\n # not just a part of it - we can just cache this member directly\n member = Member.new(data, server, self)\n debug(\"Implicitly adding presence-obtained member #{user_id} to #{server_id} cache\")\n\n member_is_new = true\n end\n\n username = data['user']['username']\n if username && !member_is_new # Don't set the username for newly-cached members\n debug \"Implicitly updating presence-obtained information for member #{user_id}\"\n member.update_username(username)\n end\n\n member.status = data['status'].to_sym\n member.game = data['game'] ? data['game']['name'] : nil\n\n server.cache_member(member)\n end",
"def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to space_member_url(@space, @member), notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: [@space, @member] }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\tif !checkme? then return end\n\n @member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to admin_member_path(@member), notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # byebug \n respond_to do |format|\n if self.current_member && self.current_member.id == params[:id].to_i\n if @member.update(member_params)\n format.json { render :show, status: :ok, location: @member }\n else\n return api_error(status: :unprocessable_entity, message: @member.errors)\n end\n else\n return api_error(status: 401, message: '没有操作权限')\n end\n end\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @member = args[:member] if args.key?(:member)\n @name = args[:name] if args.key?(:name)\n @role = args[:role] if args.key?(:role)\n @state = args[:state] if args.key?(:state)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @member = args[:member] if args.key?(:member)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def members_changed(added, removed, changed_roles, parent_op)\n Rails.logger.error \"The members_changed method needs to be implemented in the specific classes\\n #{caller.join(\"\\n \")}\"\n raise \"Membership changes not implemented\"\n end",
"def update\r\n \tsuper\r\n \tcheck_visible\r\n \tif @party_size != $game_party.all_members.size\r\n \t refresh\r\n \tend\r\n i = 0\r\n while i < @party_size\r\n if $game_party.members[i].hp != @actor_hp[i] or $game_party.members[i].mp != @actor_mp[i]\r\n\t refresh\r\n\t end\r\n i += 1\r\n end\r\n end",
"def update_sms_profile \n logger.info \"Loading MemberUser update_sms_profile action\"\n @member = current_resource\n logger.debug \"Member attributes hash: #{@member.attributes.inspect}\" \n if @member.update_attributes(params[:member])\n logger.debug \"Member saved and updated successfully - attributes hash: #{@member.attributes.inspect}\"\n logger.debug \"Sending delayed welcome email to new member...\"\n MemberMailer.delay.welcome_mail_new_member(@member.id)\n logger.debug \"Member email has been sent successfully\"\n flash[:success] = t(:success, :scope => [:business_messages, :web_profile])\n redirect_to root_path\n else\n logger.debug \"Validation errors. Loading complete_sms_profile with errors\"\n render 'complete_sms_profile' \n end\n end",
"def update\n respond_to do |format|\n if @member == current_member && @member.update(member_params)\n format.html { redirect_to @member, notice: 'Profile updated.' }\n else\n format.html { render :edit }\n end\n end\n end",
"def update\n @position_member = PositionMember.find(params[:id])\n\n if position_member_params[:member_id] and !position_member_params[:member_id].empty?\n @member = Member.find(position_member_params[:member_id])\n if params[:avatar]\n @user = @member.user\n if @user and !@user.avatar_url\n @user.skip_password_validation = true\n @user.avatar = params[:avatar]\n @user.save!\n end\n end\n end\n\n @position_member.name = @position_member.get_name\n\n respond_to do |format|\n if @position_member.update(position_member_params)\n format.html { redirect_to '/board_members_and_positions', notice: \"Virkailijaa muokattu\" }\n else\n @alert = @position_member.errors\n @members = Member.all.order(:firstname, :lastname)\n if admin\n @positions = Position.all.order(:name)\n else\n @positions = Position.where('admin is null or admin = ?', false).order(:name)\n end\n format.html { render :new, status: :unprocessable_entity, location: edit_board_member_path }\n end\n end\n end",
"def update\n # save the new value to a member object\n @member = Member.find(params[:id])\n @member.attributes = params[:member]\n @member.skip_password_validation = true\n @member.disabled = @member.enabled ? false : true\n @member.disabled = false if @member.super_member?\n\n if @member.valid?\n \n @member.save\n\n # if member becomes super then remove all property access\n if @member.super_member?\n MemberPropertyAccess.where(:member_id => @member.id).destroy_all\n else\n # add new access\n @member.assigned_properties.each do |prop_id|\n prop = Property.active_only.find(prop_id)\n puts \"#{prop} #{prop.account == @member.account} #{MemberPropertyAccess.find_by_member_id_and_property_id(@member.id, prop.id).blank?}\"\n if prop.account == @member.account and MemberPropertyAccess.find_by_member_id_and_property_id(@member.id, prop.id).blank?\n MemberPropertyAccess.create(:member_id => @member.id, :property_id => prop.id)\n end\n end\n\n # remove access\n MemberPropertyAccess.find_all_by_member_id(@member.id).each do |mpa|\n if !@member.assigned_properties.include?(mpa.property_id.to_s)\n mpa.destroy\n end\n end\n end\n\n flash[:notice] = t('members.update.message.success')\n redirect_to members_path\n else\n put_model_errors_to_flash(@member.errors)\n render 'edit'\n end\n end",
"def member_finished\n ## Check to see if all children are finished.\n if count_children_with_status(['READY', 'PROCESSING', 'ENQUEUE']) > 0\n self.update_attributes(:status => \"PROCESSING\") if status != 'PROCESSING'\n return\n end\n if count_children_with_status(['FAILED']) > 0\n self.update_attributes(:status => \"FAILED\") \n else\n self.update_attributes(:status => \"SUCCESS\") \n end\n \n end",
"def update\n if current_member.can_admin_members?\n # this if statement allows devise to accept record when password is not filled in\n if params[:member][:password].blank?\n params[:member].delete(:password)\n params[:member].delete(:password_confirmation)\n end\n \n @member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n else\n render_forbidden\n end\n end",
"def update\n if current_user.admin?\n @member.admin = params[:member][:admin]\n end\n\n unless params[:member_password].blank?\n if params[:member_password] == params[:member_verify_password]\n @member.password = params[:member_password]\n else\n flash[:error] = \"Passwords were not the same.\"\n render :action => \"edit\"\n return\n end\n end\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n flash[:notice] = 'Member was successfully updated.'\n format.html { redirect_to(member_path(@member)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @member.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n if current_user.admin?\n @member.admin = params[:member][:admin]\n end\n\n unless params[:member_password].blank?\n if params[:member_password] == params[:member_verify_password]\n @member.password = params[:member_password]\n else\n flash[:notice] = \"ERROR: Passwords were not the same.\"\n render :action => \"edit\"\n return\n end\n end\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n flash[:notice] = 'Member was successfully updated.'\n format.html { redirect_to(member_path(@member)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @member.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update \n @member = Member.find_by(user_name: params[:user_name]) \n check_existence(@member, root_url, \"Member Not Found\", true)\n check_expiration(@member, true)\n if params[:member][:password].empty? \n @member.errors.add(:password, \"can't be empty\") \n render 'admin/account_activations/edit' \n elsif @member.update(member_params) \n log_in @member\n #Clearing the reset digest on a successful password reset\n @member.update_attributes({reset_digest: nil, activated: true})\n flash[:success] = \"Account Activated successfully with new password.\"\n redirect_to @member \n else \n flash.now[:danger] = \"An error occurred activating the account\"\n render 'admin/account_activations/edit'\n end \n end",
"def update\n respond_to do |format|\n if @member == current_member && @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member updated.' }\n else\n format.html { render :edit }\n end\n end\n end",
"def member(jid,reason=nil,&blk)\n set_affiliation 'member', jid, reason, &blk\n end",
"def update!(**args)\n @role = args[:role] unless args[:role].nil?\n @members = args[:members] unless args[:members].nil?\n end",
"def update_memberinfo(st, member_id, email)\n # No email - should roll back the entire transaction. Check prior.\n st.execute(member_id, @email_data_key, email)\n end",
"def update(current_email, user_info, email_type = 'html')\n begin\n @api.call(\"listUpdateMember\", @api_key, @list_id, current_email, user_info, email_type, true)\n rescue\n false\n end\n end",
"def update_member_status(project, candidate)\n admin = member = :remove\n case params[:commit]\n when :change_member_status_make_admin.l\n admin = member = :add\n when :change_member_status_make_member.l\n member = :add\n end\n set_status(project, :admin, candidate, admin)\n set_status(project, :member, candidate, member)\n redirect_to(project_path(project.id, q: get_query_param))\n end",
"def update\n $lovedone = nil\n @family_member = User.find(params[:id])\n params = family_member_params\n profile_params = params[:profile_attributes]\n\n profile = Profile.find(@family_member.profile.id)\n params[:profile_attributes][:user_type] = '1'\n\n respond_to do |format|\n if profile.update(profile_params)\n\n # check if lovedone_id is changed now...\n if request.params[:prev_lovedone_id]!=family_member_params_for_lovedone[:lovedones]\n follower = Follower.find_by(user_id: @family_member.id,\n lovedone_id: request.params[:prev_lovedone_id])\n follower.destroy unless follower.nil?\n\n unless family_member_params_for_lovedone[:lovedones].blank?\n follower = Follower.new user_id: @family_member.id, request_status: \"invited\", \n lovedone_id: family_member_params_for_lovedone[:lovedones]\n follower.save\n end\n end\n\n if params.include?(:email)\n @family_member.skip_confirmation!\n @family_member.skip_confirmation_notification!\n @family_member.confirm!\n @family_member.update_attribute(:email, params[:email])\n @family_member.save\n end\n\n\n\n format.html { redirect_to familymembers_path, notice: 'Family member was successfully updated.' }\n format.json { render :show, status: :ok, location: @family_member }\n else\n format.html { render :edit }\n format.json { render json: @family_member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @role = args[:role] if args.key?(:role)\n @members = args[:members] if args.key?(:members)\n end",
"def update\n @member = Member.find(params[:id])\n\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n Emailer.welcome_email(@member).deliver\n format.html { redirect_to(@member, :notice => 'Member was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @member.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @affected_member_profiles = args[:affected_member_profiles] if args.key?(:affected_member_profiles)\n @affected_members = args[:affected_members] if args.key?(:affected_members)\n @affected_memberships = args[:affected_memberships] if args.key?(:affected_memberships)\n @initiator = args[:initiator] if args.key?(:initiator)\n @initiator_profile = args[:initiator_profile] if args.key?(:initiator_profile)\n @initiator_type = args[:initiator_type] if args.key?(:initiator_type)\n @type = args[:type] if args.key?(:type)\n end",
"def min_up_members_state\n super\n end",
"def update_group_member_set(principal, members)\n end",
"def set_membership_changed_info\n @membership_changed_info = \"membership status changed from #{aasm.from_state} to #{aasm.to_state} (event: #{aasm.current_event})\"\n end",
"def update\n @creating_member = false\n\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'El miembro ha sido actualizado' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_member\n @member = @space.members.friendly.find(params[:id])\n end",
"def update_memberships\n update_children\n update_parents\n end",
"def update!(**args)\n @members = args[:members] if args.key?(:members)\n @resource = args[:resource] if args.key?(:resource)\n @resource_type = args[:resource_type] if args.key?(:resource_type)\n @role = args[:role] if args.key?(:role)\n end",
"def update\n @member = Member.find(params[:id])\n @member.new = false\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n flash[:notice] = 'Member was successfully updated.'\n format.html { redirect_to members_url }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @member.errors.to_xml }\n end\n end\n end",
"def handle_member_event(payload, metadata = nil)\n apply payload, metadata\n end",
"def set_group_member_attribute(opts)\n opts = check_params(opts,[:member_attrs])\n super(opts)\n end",
"def update\n @group_member = GroupMember.find(params[:id])\n\n if @group_member.group.owner != current_user\n respond_to do |format|\n format.html { redirect_to @group_member.group, notice: 'User not authorized.' }\n format.json { render json: @group_member, status: :not_authorized, location: @group_member }\n end\n return\n end\n \n respond_to do |format|\n if @group_member.update_attributes(params[:group_member])\n format.html { redirect_to @group_member, notice: 'Group member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group_member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @bare_metal_admin_cluster_id = args[:bare_metal_admin_cluster_id] if args.key?(:bare_metal_admin_cluster_id)\n @membership = args[:membership] if args.key?(:membership)\n end",
"def update!(**args)\n @avatar_info = args[:avatar_info] if args.key?(:avatar_info)\n @avatar_url = args[:avatar_url] if args.key?(:avatar_url)\n @description = args[:description] if args.key?(:description)\n @group_id = args[:group_id] if args.key?(:group_id)\n @inviter_email = args[:inviter_email] if args.key?(:inviter_email)\n @is_external = args[:is_external] if args.key?(:is_external)\n @name = args[:name] if args.key?(:name)\n @num_members = args[:num_members] if args.key?(:num_members)\n @user_membership_state = args[:user_membership_state] if args.key?(:user_membership_state)\n end",
"def update\n @who_member = WhoMember.find(params[:id])\n\n respond_to do |format|\n if @who_member.update_attributes(params[:who_member])\n format.html { redirect_to(@who_member, :notice => 'WhoMember was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @who_member.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def change_info(new_name)\n self.nickname = new_name \n end",
"def update\n params[:member].delete(:site_user) if params[:member][:site_user].blank?\n\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_member\n @member = @current_enterprise.members.find(params[:id])\n end",
"def update!(**args)\n @avatar_url = args[:avatar_url] if args.key?(:avatar_url)\n @id = args[:id] if args.key?(:id)\n @is_membership_visible_to_caller = args[:is_membership_visible_to_caller] if args.key?(:is_membership_visible_to_caller)\n @membership_count = args[:membership_count] if args.key?(:membership_count)\n @name = args[:name] if args.key?(:name)\n @roster_gaia_key = args[:roster_gaia_key] if args.key?(:roster_gaia_key)\n @roster_state = args[:roster_state] if args.key?(:roster_state)\n @segmented_membership_counts = args[:segmented_membership_counts] if args.key?(:segmented_membership_counts)\n end",
"def on_update; end",
"def name_owner_changed(msg)\n raise \"Skype has stopped running.\" if msg.params.first == \"com.Skype.API\" and msg.params[1].to_s.match(/^:\\d\\.\\d+$/)\n end",
"def update!(**args)\n @message = args[:message] if args.key?(:message)\n @searcher_membership_state = args[:searcher_membership_state] if args.key?(:searcher_membership_state)\n end",
"def update\n respond_to do |format|\n if @member.update(member_params)\n @member.avatar.attach(member_params[:avatar]) unless member_params[:avatar].nil?\n format.html { redirect_to my_profile_path, notice: 'Member was successfully updated.' }\n format.json {}\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_user\n end",
"def update\n @membership = Membership.find(params[:id])\n auth!\n respond_to do |format|\n if (@membership.can_resign_leadership?(membership_params['level'])) && (@membership.update_attributes(membership_params))\n format.html { redirect_to(edit_group_path(@group), :notice => t(:membership_updated)) }\n format.xml { head :ok }\n else\n format.html { redirect_to @group, :notice => @group.errors }\n format.xml { render :xml => @membership.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @child = args[:child] if args.key?(:child)\n end",
"def update!(**args)\n @child = args[:child] if args.key?(:child)\n end",
"def update!(**args)\n @child = args[:child] if args.key?(:child)\n end",
"def min_up_members_action\n super\n end",
"def update!(**args)\n @membership = args[:membership] if args.key?(:membership)\n @vmware_admin_cluster_id = args[:vmware_admin_cluster_id] if args.key?(:vmware_admin_cluster_id)\n end",
"def remote_update(*)\n super(changed)\n end",
"def update!(**args)\n @abridged_roster_memberships = args[:abridged_roster_memberships] if args.key?(:abridged_roster_memberships)\n @metadata = args[:metadata] if args.key?(:metadata)\n @roster_member_count = args[:roster_member_count] if args.key?(:roster_member_count)\n end",
"def update\n @group_member = GroupMember.find(params[:id])\n\n respond_to do |format|\n if @group_member.update_attributes(params[:group_member])\n format.html { redirect_to @group_member, notice: 'Group member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: { errors: @group_member.errors, status: :unprocessable_entity }}\n end\n end\n end",
"def update_sy_club_member\n unless self.sy_club_member.update(transferred_to_club_id: self.to_club_id)\n errors.add(:there, \"is some error while processing your transfer request. Please try again.\")\n logger.info(\"sy_club_member: #{sy_club_member.as_json}\")\n logger.info(\"sy_club_member_transfer: #{self.as_json}\")\n end\n errors.empty?\n end",
"def process_ok\r\n super\r\n $game_party.menu_actor = $game_party.members[index]\r\n end",
"def update_existing_members hash\n hash.each_pair do |key, value|\n send \"#{key}=\", value if respond_to? \"#{key}=\".to_sym\n end\n self\n end",
"def update_message(data); end",
"def update_message(data); end",
"def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @member.update!(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # prevent spoofs\n #TODO this is bullshit code; add filters, :before_update\n if !(request.post? || request.put?) || !user_signed_in? ||\n !(self.current_user.user_id == params[:id].to_i || self.current_user.admin_flag == 1)\n flash[:notice] = 'EPIC FAIL. You\\'re not logged in or you\\'re trying to update someone else\\'s account.'\n redirect_to(:controller => '/members', :action => 'index', :id=>params[:id])\n return\n end\n\n serviceable = MemberServiceable.new(params, session)\n @user = serviceable.update\n\n flash[:message]='Account Updated.'\n redirect_to(:controller => '/members', :action => 'profile', :id=>params[:id])\n\n end",
"def update\n respond_to do |format|\n if @group_member.update(group_member_params)\n format.html { redirect_to @group_member, notice: 'Group member was successfully updated.' }\n format.json { render :show, status: :ok, location: @group_member }\n else\n format.html { render :edit }\n format.json { render json: @group_member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @member = Member.find(params[:id])\n\n if @member.vend_total.nil?\n @member.vend_total = 0\n end\n\n if @member.vend_credits.nil?\n @member.vend_credits = 1\n end\n \n if @member.door_count.nil?\n @member.door_count = 0\n end\n \n\n raise CanCan::AccessDenied if cannot? :edit, @member\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n params.require(:member).permit(:name)\n if @member.update(member_params)\n format.html { redirect_to @member, notice: '更新しました' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_user_deafen(token, server_id, user_id, state)\n request(\n __method__,\n :patch,\n \"#{api_base}/guilds/#{server_id}/members/#{user_id}\",\n { deaf: state }.to_json,\n Authorization: token,\n content_type: :json\n )\n end"
] | [
"0.686198",
"0.6295523",
"0.6295523",
"0.62874967",
"0.62874967",
"0.6120318",
"0.6106171",
"0.61046755",
"0.60249734",
"0.60185605",
"0.58947945",
"0.58920157",
"0.58920157",
"0.58077675",
"0.58077675",
"0.5753472",
"0.5750578",
"0.5750022",
"0.5727764",
"0.5727764",
"0.570252",
"0.570252",
"0.5684357",
"0.568413",
"0.56665677",
"0.56635284",
"0.56606567",
"0.56206113",
"0.56131566",
"0.56030035",
"0.56024694",
"0.5595964",
"0.55903023",
"0.55813205",
"0.55598253",
"0.5545755",
"0.55243397",
"0.5513805",
"0.55023134",
"0.5501927",
"0.54840606",
"0.54799175",
"0.54771405",
"0.54760385",
"0.5465264",
"0.5442404",
"0.54324317",
"0.542196",
"0.5415902",
"0.5387903",
"0.53746516",
"0.5369022",
"0.53659934",
"0.5362693",
"0.5359954",
"0.5343841",
"0.53390896",
"0.5335897",
"0.5334176",
"0.53302324",
"0.53293806",
"0.531388",
"0.5312585",
"0.53125316",
"0.53100353",
"0.5308718",
"0.53059167",
"0.5305594",
"0.53028697",
"0.52957714",
"0.5295383",
"0.5291434",
"0.5288668",
"0.52759296",
"0.52634645",
"0.5259625",
"0.5254718",
"0.5247933",
"0.5246421",
"0.52394754",
"0.52376556",
"0.52376556",
"0.52376556",
"0.5229752",
"0.5229201",
"0.5226603",
"0.5222542",
"0.5221685",
"0.5220986",
"0.52168775",
"0.52167344",
"0.5213526",
"0.5213526",
"0.521289",
"0.5203965",
"0.5202562",
"0.5199242",
"0.5198368",
"0.519654",
"0.51838243"
] | 0.6854867 | 1 |
Internal handler for GUILD_MEMBER_DELETE | def delete_guild_member(data)
server_id = data['guild_id'].to_i
server = self.server(server_id)
return unless server
user_id = data['user']['id'].to_i
server.delete_member(user_id)
rescue Discordrb::Errors::NoPermission
Discordrb::LOGGER.warn("delete_guild_member attempted to access a server for which the bot doesn't have permission! Not sure what happened here, ignoring")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_guild_member(data)\n server_id = data['guild_id'].to_i\n server = self.server(server_id)\n\n user_id = data['user']['id'].to_i\n server.delete_member(user_id)\n rescue Discordrb::Errors::NoPermission\n Discordrb::LOGGER.warn(\"delete_guild_member attempted to access a server for which the bot doesn't have permission! Not sure what happened here, ignoring\")\n end",
"def destroy\n if !current_member.the_admin?\n redirect_to \"/\", notice: \"Access denied\"\n return\n end\n\n @member.destroy unless @member.core_member?\n respond_to do |format|\n format.html { redirect_to members_url, notice: \"Member was#{@member.core_member? ? ' not' : ''} successfully destroyed.\"}\n format.json { head :no_content }\n end\n end",
"def destroy\n\t\t@room.members.destroy(params[:id])\n\t\trespond_to do |format|\n\t\t\tback_page = room_members_url\n\t\t\tback_page = URI(request.referer).path if params[:back]\n\t\t\tback_page = params[:redirect] if params[:redirect]\n\t\t\tformat.html { redirect_to back_page, notice: 'Member was successfully destroyed.' }\n\t\t\tformat.json { head :no_content }\n\t\tend\n\tend",
"def destroy\n if @member.email == \"admin@admin.com\"\n redirect_to logged_in_user, notice: \"Cannot Delete SuperUser.\"\n else\n Booking.where(member_id: @member.id).destroy_all\n @member.destroy\n respond_to do |format|\n format.html { redirect_to members_url, notice: 'Member was successfully destroyed.' }\n format.json { head :no_content }\n end\n end\n end",
"def destroy\n @membership = Membership.find(params[:id])\n auth!\n respond_to do |format|\n process_notification(@membership, {}, process_notification_options({\n params: {\n level: @membership.level_name,\n member_id: @membership.user.id,\n member_name: @membership.user.name,\n group_id: @membership.group.id,\n group_name: @membership.group.name\n },\n recipient: @membership.user}))\n\n if @membership.destroy\n format.html { redirect_to manage_members_group_path(@group), notice: t(:member_removed) }\n format.xml { head :ok }\n else\n format.html { redirect_to manage_members_group_path(@group), notice: t(:membership_denied) }\n format.xml { render xml: @membership.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @membership = Membership.find(params[:id])\n auth!\n respond_to do |format|\n #throw a negative one at a function expecting a membership level to indicate deletion\n if @membership.can_resign_leadership?(-1)\n process_notification(@membership, {:group_name => @membership.group.name}, :action => 'destroy', :owner => current_user, :recipient => @membership.user)\n if @membership.destroy\n format.html { redirect_to({:controller => :groups, :action => :edit, :id => @group}, :notice => t(:member_removed)) }\n format.xml { head :ok }\n else\n format.html { redirect_to @group, :notice => t(:membership_denied) }\n format.xml { render :xml => @membership.errors, :status => :unprocessable_entity }\n end\n end\n end\n end",
"def destroy\n\tif !checkadmin? then return end\n\n @member = Member.find(params[:id])\n @member.destroy\n\n respond_to do |format|\n format.html { redirect_to members_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @member.destroy\n respond_to do |format|\n format.html { redirect_to admin_member_members_path, notice: 'Member was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n instance_variable_set \"@#{resource_singular}\", find_member\n if current_user.role==User::ROOT || current_member.user_id == current_user.id\n if current_member.destroy\n flash[:success] = \"#{resource_singular.humanize} removido com sucesso.\"\n response_for :destroy\n else\n flash[:failure] = \"#{resource_singular.humanize} could not be deleted.\"\n response_for :destroy_failed\n end\n end\n end",
"def del_member(_user_id)\n update!(del_members: [_user_id])\n end",
"def delete_member_by_id(pid)\n if posn = member_ids.index(pid)\n delete_member_at(posn)\n end\n end",
"def destroy\n @member.destroy\n\n respond_to do |format|\n flash[:notice] = \"Destroyed user\"\n format.html { redirect_to(members_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @member.destroy\n\n respond_to do |format|\n flash[:notice] = \"Destroyed user\"\n format.html { redirect_to(members_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @member.destroy\n respond_to do |format|\n format.html { redirect_to space_members_url(@space), notice: 'Member was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def remove_member(opts)\n opts = check_params(opts,[:members])\n super(opts)\n end",
"def delete_member(id)\n @m = Member.find_by_society_id_and_user_id(self.id, id) #not using .where method as just 1 record is expected to be found\n if @m != nil and !@m.admin\n @m.destroy\n\t\t\tadd_post(id, \"Left the society\")\n end\n end",
"def destroy\n @dc_member = DcMember.find(params[:id])\n @dc_member.destroy\n\n respond_to do |format|\n format.html { redirect_to dc_members_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n session[:member_id] = nil\n @member.destroy\n respond_to do |format|\n format.html { redirect_to members_url }\n format.json { head :no_content }\n end\n end",
"def remove_member(name, member)\n grpid = /(\\d+)/.match(name)[0]\n configure_interface(member, \"no channel-group #{grpid}\")\n end",
"def destroy\n @member = Member.find(params[:id])\n @member.destroy\n logger.info(\"#{Time.now} Se elimina el miembro ##{@member.id}!\")\n respond_to do |format|\n format.html { redirect_to(members_url) }\n format.xml { head :ok }\n end\n end",
"def delete_member_link(name, member_id)\n\t\tlink_to_function name, \"deleteMember(#{member_id});\", :confirm => \"Are you sure you want to delete this record? This action can not be undone.\"\n\tend",
"def destroy\n @member = Member.find(params[:id])\n @member.destroy\n\n \n respond_to do |format|\n format.html { redirect_to members_url }\n format.json { head :no_content }\n end\n end",
"def delete_unused_members\n if !member.nil? && !member.is_a?(User) and \nmember.roles(:true).empty?\n member.destroy\n end\n end",
"def remove_member(auth, server_id, user_id, reason = nil)\n MijDiscord::Core::API.request(\n :guilds_sid_members_uid,\n server_id,\n :delete,\n \"#{MijDiscord::Core::API::APIBASE_URL}/guilds/#{server_id}/members/#{user_id}\",\n Authorization: auth,\n content_type: :json,\n 'X-Audit-Log-Reason': reason\n )\n end",
"def destroy\n @clnmember = Clnmember.find(params[:id])\n @clnmember.destroy\n\n respond_to do |format|\n format.html { redirect_to clnmembers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @member.destroy\n respond_to do |format|\n format.html { redirect_to members_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @member.destroy\n respond_to do |format|\n format.html { redirect_to members_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n if current_member.can_admin_admins?\n @member = Member.find(params[:id])\n @member.destroy\n\n respond_to do |format|\n format.html { redirect_to members_url }\n format.json { head :ok }\n end\n else\n render_forbidden\n end\n end",
"def destroy\n #@member = Member.find(params[:id])\n @member.destroy\n\n redirect_back_or_default(root_path)\n end",
"def destroy\n @member.destroy\n\n respond_to do |format|\n format.html { redirect_to members_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @member.destroy\n\n respond_to do |format|\n format.html { redirect_to members_url }\n format.json { head :no_content }\n end\n end",
"def delete\n super do\n @members.each do |member|\n Strand.redis.hdel LOOKUP, member.typed_id\n end\n Strand.redis.hdel TOPICS, @id\n end\n end",
"def destroy\n @member = Member.find(params[:id])\n @member.deleted = true\n @member.save\n\n respond_to do |format|\n format.html { redirect_to members_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n @membership = Membership.find(params[:id])\n @membership.destroy\n if @membership.user == current_user\n flash[:success] = \"Quit #{@group.name} successfully.\"\n redirect_to @membership.group\n else\n flash[:success] = \"Removed member successfully.\"\n redirect_to group_members_url(@membership.group)\n end\n end",
"def destroy\n @member = Member.find(params[:id])\n @member.destroy\n \n \n respond_to do |format|\n format.html { redirect_to(members_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @member.destroy\n respond_to do |format|\n format.html { redirect_to members_url, notice: 'El miembro ha sido eliminado' }\n format.json { head :no_content }\n end\n end",
"def remove( env, id, current_user )\n env.curation_concern.provenance_child_remove( current_user: current_user, child_id: id, event_note: 'BeforeAttachMembersActor' )\n end",
"def remove_member(mbr_id)\n member = student_memberships.find(mbr_id)\n if member\n # Remove repository permissions first\n member.destroy\n if member.membership_status == StudentMembership::STATUSES[:inviter] &&\n (member.grouping.accepted_student_memberships.length > 0)\n membership = member.grouping.accepted_student_memberships.first\n membership.membership_status = StudentMembership::STATUSES[:inviter]\n membership.save\n end\n end\n end",
"def \n \n\n # ADMIN ONLY:\n # Deleting a Member\n # delete /members/:id\n def destroy\n # Maybe this shouldn't be allowed if member has transactions?\n # Since calculations are based on all transactions from the\n # beginning of time, deleting a member's transactions would\n # impact the other members' debts...\n Member.find(params[:id]).destroy\n flash[:success] = \"Deleted\"\n redirect_to members_path\n end",
"def remove_member\n member_id = params[:format]\n @member = Membership.find(member_id)\n @member.destroy\n flash[:notice] = 'You removed a member of your crew. And so it goes.'\n redirect_to @camp\n end",
"def destroy\n @member.destroy!\n respond_to do |format|\n format.html { redirect_to members_url, notice: 'Member was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @member.destroy\n respond_to do |format|\n format.html do\n redirect_to members_url,\n notice: 'Profile was successfully deleted.'\n end\n format.json { head :no_content }\n end\n end",
"def destroy \n @oc_member = OcMember.find(params[:id])\n @oc_member.destroy\n\n respond_to do |format|\n format.html { redirect_to oc_members_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n\t\t@member = Member.find(params[:id])\n\t\t@member.destroy\n\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to(members_url) }\n\t\t\tformat.xml\t{ head :ok }\n\t\tend\n\tend",
"def destroy\n @member = Member.find(params[:id])\n raise CanCan::AccessDenied if cannot? :delete, @member\n @member.destroy\n\n respond_to do |format|\n format.html { redirect_to members_url }\n format.json { head :no_content }\n end\n end",
"def remove_member(params)\n room_id = self.room_id || params.delete(:room_id)\n raise ArgumentError.new(\"room_id required\") unless room_id\n\n user_name = user_name_from_params(params)\n raise ArgumentError.new(\"user_id or user_mention or user_email required\") unless user_name\n\n call_api(:method => :delete, :uri => @api_base.merge(\"room/#{room_id}/member/#{user_name}\"), :body_params => params)\n end",
"def delete_member path\n rewrite_members member_paths.delete(path)\n end",
"def destroy\n @member.destroy\n respond_to do |format|\n format.html { redirect_to members_url, notice: 'Member was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @member.destroy\n respond_to do |format|\n format.html { redirect_to members_url, notice: 'Member was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @member.destroy\n respond_to do |format|\n format.html { redirect_to members_url, notice: 'Member was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @member.destroy\n respond_to do |format|\n format.html { redirect_to members_url, notice: 'Member was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @member.destroy\n respond_to do |format|\n format.html { redirect_to members_url, notice: 'Member was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @member.destroy\n respond_to do |format|\n format.html { redirect_to members_url, notice: 'Member was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @member.destroy\n respond_to do |format|\n format.html { redirect_to members_url, notice: 'Member was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @member.destroy\n respond_to do |format|\n format.html { redirect_to members_url, notice: 'Member was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @member.destroy\n respond_to do |format|\n format.html { redirect_to members_url, notice: 'Member was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @member.destroy\n respond_to do |format|\n format.html { redirect_to members_url, notice: 'Member was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @who_member = WhoMember.find(params[:id])\n @who_member.destroy\n\n respond_to do |format|\n format.html { redirect_to(who_members_url) }\n format.xml { head :ok }\n format.json { head :ok }\n end\n end",
"def destroy\n @member.destroy\n respond_to do |format|\n format.html do\n redirect_to members_url,\n notice: 'Member was successfully destroyed.'\n end\n format.json { head :no_content }\n end\n end",
"def journalized_member_deletion\n project = @member.project\n project.init_journal(User.current)\n # key = (added_or_removed == :removed ? :old_value : :value)\n project.current_journal.details << JournalDetail.new(\n :property => 'members',\n :prop_key => 'members',\n :old_value => @member.principal\n )\n project.current_journal.save\n end",
"def destroy\n organization = @member.organization \n\n @member.destroy\n logger.info(\"User #{current_user.email} destroyed Member '#{@member.first_name} #{@member.last_name}' on #{@member.updated_at}\")\n respond_to do |format|\n format.html { redirect_to organization, notice: 'Member was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @member = Member.find(params[:id])\n @member.destroy\n respond_to do |format|\n format.html { redirect_to members_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n @membership.destroy\n respond_to do |format|\n format.html { redirect_to member_url(@membership.member), notice: 'Membership was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @group_member = GroupMember.find(params[:id])\n @group_member.destroy\n\n respond_to do |format|\n format.html { redirect_to group_members_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @member = Member.find(params[:id])\n @member.destroy\n\n respond_to do |format|\n format.html { redirect_to members_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @member = Member.find(params[:id])\n @member.destroy\n\n respond_to do |format|\n format.html { redirect_to members_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @member = Member.find(params[:id])\n @member.destroy\n\n respond_to do |format|\n format.html { redirect_to members_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @member = Member.find(params[:id])\n @member.destroy\n\n respond_to do |format|\n format.html { redirect_to members_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @member = Member.find(params[:id])\n @member.destroy\n\n respond_to do |format|\n format.html { redirect_to members_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @member = Member.find(params[:id])\n @member.destroy\n\n respond_to do |format|\n format.html { redirect_to members_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @member = Member.find(params[:id])\n @member.destroy\n\n respond_to do |format|\n format.html { redirect_to members_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @member = Member.find(params[:id])\n @member.destroy\n\n respond_to do |format|\n format.html { redirect_to members_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @member = Member.find(params[:id])\n @member.destroy\n\n respond_to do |format|\n format.html { redirect_to members_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @member = Member.find(params[:id])\n @member.destroy\n\n respond_to do |format|\n format.html { redirect_to(members_url) }\n format.json { head :ok }\n end\n end",
"def delete_member_path(member)\n polymorphic_url(\n controller_namespace.empty? ? member : controller_namespace << member,\n :action => 'delete', :routing_type => :path\n )\n end",
"def destroy\n @member = Member.find(params[:id])\n @member.destroy\n\n respond_to do |format|\n format.html { redirect_to(members_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @member = Member.find(params[:id])\n @member.destroy\n\n respond_to do |format|\n format.html { redirect_to(members_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @member = Member.find(params[:id])\n @member.destroy\n\n respond_to do |format|\n format.html { redirect_to(members_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @member = Member.find(params[:id])\n @member.destroy\n\n respond_to do |format|\n format.html { redirect_to(members_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @elder_member.destroy\n respond_to do |format|\n format.html { redirect_to elder_members_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tenant_family_member.destroy\n respond_to do |format|\n format.html { redirect_to :back, notice: 'Tenant family member was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def removeTeamMember _obj, _args\n \"_obj removeTeamMember _args;\" \n end",
"def destroy\n @group_member.destroy\n respond_to do |format|\n format.html { redirect_to client_group_members_url, notice: 'Group member was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n membership = Membership.find_by(uuid: conversation_params[:uuid])\n convo = membership.conversation\n leave_message = convo.messages.create(text: \"Conversation has ended\", user_index: -1)\n MessagesChannel.broadcast_to convo, MessageSerializer.new(leave_message)\n membership.update(is_active: false) if membership\n create_or_join\n end",
"def remove_member(_team, _user)\n # stub\n end",
"def destroy\n @member.destroy\n respond_to do |format|\n format.html { redirect_to members_url, notice: '削除しました' }\n format.json { head :no_content }\n end\n end",
"def remove_member_from_list(user, list, member_id)\n delete(\"/#{user}/#{list}/members.json?id=#{member_id}\")\n end",
"def remove_member\n Member.find_by(band_id: params[:id], user_id: params[:user_id]).destroy\n\n flash[:success] = \"The user is no longer part of the band!\"\n\n redirect_to band_url(params[:id])\n end",
"def destroy\n @member.abo_types.delete_all\n respond_to do |format|\n if @member.destroy\n format.html { redirect_to members_url, notice: t('flash.notice.deleting_member') }\n format.json { head :no_content }\n else\n format.html { render :show, alert: t('flash.alert.deleting_member') }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def leave(person)\n members.delete(person);\n end",
"def destroy\n @member = Member.find_by_url_or_id(params[:id])\n @member.destroy\n\n redirect_to(members_url)\n end",
"def remove( curation_concern, id )\n # ::Deepblue::LoggingHelper.bold_debug \"AttachMembersActor.remove: id = #{id}\"\n return if id.blank?\n member = ActiveFedora::Base.find(id)\n curation_concern.ordered_members.delete(member)\n curation_concern.members.delete(member)\n return unless curation_concern.respond_to? :provenance_child_remove\n curation_concern.provenance_child_remove( current_user: current_user,\n child_id: id,\n event_note: \"AttachMembersActor\" )\n end",
"def destroy\n @membership = Membership.find(params[:id])\n @membership.destroy\n\n redirect_to(chat_rooms_url)\n end",
"def destroy\n @family_member = User.find(params[:id])\n @family_member.destroy\n respond_to do |format|\n format.html { redirect_to familymembers_path, notice: 'Family member was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n member_id = @entry.member_id\n @entry.destroy\n respond_to do |format|\n format.html { redirect_to Member.find(member_id), notice: 'Entry was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @family_member = FamilyMember.find(params[:id])\n @family_member.destroy\n\n respond_to do |format|\n format.html { redirect_to(family_family_members_url(@current_family)) }\n format.xml { head :ok }\n end\n end",
"def func_remove(sender, dest, args)\r\n\t\tif args.size() >= 1\r\n\t\t\tuser= sender.nick\r\n\t\t\tmatchid= args[0].to_i()\r\n\t\t\tres= @db.query(\"SELECT * FROM `users` WHERE account='#{sender.account_name}'\")\r\n\t\t\tif res.num_rows() > 0\r\n\t\t\t\tu= res.fetch_hash()\r\n\t\t\t\tuserid= u['id'].to_i()\r\n\t\t\t\terr= false\r\n\r\n\t\t\t\t# user don' want to remove himself\r\n\t\t\t\t# !remove <match_id> <user>\r\n\t\t\t\tif (u['level'].to_i() <= 1) and (args.size() == 2)\r\n\t\t\t\t\ttarg_account= args[1].to_s()\r\n\r\n\t\t\t\t\tres2= @db.query(\"SELECT * FROM `users` WHERE account=\\\"#{targ_account}\\\"\")\r\n\t\t\t\t\tif res2.num_rows() > 0\r\n\t\t\t\t\t\tt= res2.fetch_hash()\r\n\t\t\t\t\t\tuserid= t['id'].to_i()\r\n\t\t\t\t\t\tuser= targ_account\r\n\t\t\t\t\t# user not found, maybe his current nick was given instead of his account\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\ttarg= getUserObj(targ_account)\r\n\t\t\t\t\t\tif targ != nil\r\n\t\t\t\t\t\t\tres3= @db.query(\"SELECT * FROM `users` WHERE account=\\\"#{targ.account_name}\\\"\")\r\n\t\t\t\t\t\t\tif res3.num_rows() > 0\r\n\t\t\t\t\t\t\t\tt= res3.fetch_hash()\r\n\t\t\t\t\t\t\t\tuserid= t['id'].to_i()\r\n\t\t\t\t\t\t\t\tuser= targ.nick\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\terr= true\r\n\t\t\t\t\t\t\tend\r\n\t\t\t\t\t\t\tres3.free()\r\n\t\t\t\t\t\tend\r\n\t\t\t\t\tend\r\n\t\t\t\t\tres2.free()\r\n\t\t\t\t\tsender.notice(\"unknow user: #{targ_account}\") if err\r\n\t\t\t\tend\r\n\r\n\t\t\t\tif !err\r\n\t\t\t\t\tres2= @db.query(\"SELECT * FROM matchs WHERE id=\\\"#{matchid}\\\" AND Etat='c'\")\r\n\t\t\t\t\tif res2.num_rows() > 0\r\n\t\t\t\t\t\tm= res2.fetch_hash()\r\n\t\t\t\t\t\t@db.query(\"DELETE FROM link WHERE user='#{userid}' AND `match`='#{matchid}'\")\r\n\t\t\t\t\t\tsender.notice(\"'#{user}' removed from match #{matchid} vs #{m['Adversaires']}\")\r\n\t\t\t\t\t\tupdateTopic()\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tsender.notice(\"unknow match id: #{matchid}\")\r\n\t\t\t\t\tend\r\n\t\t\t\t\tres2.free()\r\n\t\t\t\tend\r\n\r\n\t\t\telse\r\n\t\t\t\tsender.notice(\"no account in db, tell bot owner\")\r\n\t\t\tend\r\n\t\t\tres.free()\r\n\t\telse\r\n\r\n\t\tend\r\n\tend",
"def add_del_member\n id = Base64.decode64(params[:id]) \n if params[:type] =='add' \n status = params[:gtype] == 'Private' ? 0 : 1 ; #0 means admin needs to accept, 1 directly join public group\n member = GroupMember.create(:group_id=> id,:account_id =>current_user.id, :status => status)\t\t\n\t\t\t if member.save\n\t\t\t\trender :json => 1 and return \n\t\t\t else\n\t\t\t\trender :json => 0 and return \n\t\t\t end \t\n else\n member = GroupMember.where(:group_id=> id,:account_id =>current_user.id).first\n if member.present? && member.delete\n render :json => 1 and return \n else\n\t\trender :json => 0 and return \n end \t\n end\n \n \n end",
"def destroy\n @member = Member.find(params[:id])\n if @member\n params[:board_id] = @member.board\n # we can't destroy the member right away because it opens security hole,\n # so let's get the board first\n board = @member.board\n # if the current_user is the owner of the board let's ban the member\n if current_user.owner?(board)\n @member.destroy\n else # otherwise let the user destroy only it's own membership\n @member = current_user.members.find(params[:id])\n @member.destroy\n end\n end\n\n respond_to do |format|\n format.html { redirect_back_or user_path(params[:id]) }\n format.js\n format.json { head :ok }\n end\n end",
"def remove_friend\n end"
] | [
"0.68046767",
"0.66562814",
"0.6413304",
"0.63841766",
"0.6382879",
"0.6368897",
"0.6367947",
"0.63541365",
"0.63065517",
"0.62851495",
"0.6280644",
"0.6247861",
"0.6247861",
"0.62163174",
"0.6194904",
"0.61747086",
"0.61665314",
"0.6142755",
"0.612855",
"0.61100346",
"0.61005133",
"0.60957015",
"0.6083776",
"0.60790473",
"0.60718",
"0.6068577",
"0.6068577",
"0.60649854",
"0.60597855",
"0.6057464",
"0.6057464",
"0.6051754",
"0.6045306",
"0.6043809",
"0.6041614",
"0.6035743",
"0.60344034",
"0.60334873",
"0.60292375",
"0.6029074",
"0.60234916",
"0.601572",
"0.6012621",
"0.6009305",
"0.600879",
"0.6004657",
"0.6003149",
"0.6002177",
"0.6002177",
"0.6002177",
"0.6002177",
"0.6002177",
"0.6002177",
"0.6002177",
"0.6002177",
"0.6002177",
"0.6002177",
"0.5990138",
"0.5985781",
"0.5984545",
"0.5973825",
"0.5972286",
"0.59708613",
"0.5948788",
"0.59454644",
"0.59454644",
"0.59454644",
"0.59454644",
"0.59454644",
"0.59454644",
"0.59454644",
"0.59435236",
"0.59435236",
"0.59360874",
"0.59355164",
"0.5935251",
"0.5935251",
"0.5935251",
"0.5935251",
"0.59237194",
"0.59224695",
"0.59152716",
"0.59128433",
"0.5902359",
"0.5899153",
"0.5895145",
"0.58903426",
"0.5883317",
"0.58760035",
"0.58754647",
"0.5869832",
"0.58660185",
"0.58655125",
"0.58644235",
"0.5855465",
"0.5849922",
"0.58436894",
"0.5825349",
"0.5822248",
"0.58191127"
] | 0.67568505 | 1 |
Internal handler for GUILD_CREATE | def create_guild(data)
ensure_server(data, true)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new_child\n nil\n end",
"def crew _args\n \"crew _args;\" \n end",
"def createMenu _obj, _args\n \"_obj createMenu _args;\" \n end",
"def host_child_new(host_name, pub_name, prefix, website, email)\n send_req({\n act: :host_child_new,\n pub_name: pub_name,\n prefix: prefix,\n website: website,\n email: email\n })\n end",
"def create(args = nil)\n # Connects to the xmpp-client that is used for sending xmpp-messages\n @send_client = connect(@@send_client_info)\n \n # Connect to xmpp-client that is used for receiving messages that are then turn into http-requests\n @receive_client = connect(@@receive_client_info)\n runMessageReceiver\n \n # Ensures that xmpp-server has node: home/host/<host>/<node_account>/contexts\n XmppHelper::createContextGeneralNode\n\n end",
"def create_command_window\n end",
"def create_child( name )\n account = build_child( name )\n attach_child( account )\n return account\n end",
"def createWindow\r\n \r\n end",
"def onCmdNew( obj, sig, par )\n\t\t\twin = TicketEditWindow.new( getApp(), @mdimenu, @mdiclient )\n\t\t\twin.create\n\t\t\twin.show\n\t\t\t@mdiclient.setActiveChild( win )\n\t\t\treturn 1\n\t\tend",
"def groups_create_child(params = {})\n fail ArgumentError, \"Required arguments 'channel' missing\" if params['channel'].nil?\n response = @session.do_post \"#{SCOPE}.createChild\", params\n Slack.parse_response(response)\n end",
"def create\n @child = Child.new_with_user_name(current_user_name, params[:child])\n respond_to do |format|\n if @child.save\n flash[:notice] = 'Child record successfully created.'\n format.html { redirect_to(@child) }\n format.xml { render :xml => @child, :status => :created, :location => @child }\n else\n format.html {\n @form_sections = get_form_sections_for_child @child\n render :action => \"new\"\n }\n format.xml { render :xml => @child.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create_guild(data)\n ensure_server(data)\n end",
"def create_command_window\n @command_window = Window_RegistrationCommand.new(0, @help_window.bottom_corner)\n @command_window.help_window = @help_window\n @command_window.set_handler(:name, method(:set_name))\n @command_window.set_handler(:avatar, method(:set_avatar))\n @command_window.set_handler(:title, method(:select_title))\n @command_window.set_handler(:register, method(:register))\n @command_window.set_handler(:cancel, method(:back))\n @command_window.openness = 0\n @command_window.deactivate\n if $game_temp.registration_step == 1\n @command_window.open\n @command_window.activate\n end\n end",
"def create_backgrounds\n create_over\n create_hud_bg\n create_under\n create_flow\n end",
"def createGroup _args\n \"createGroup _args;\" \n end",
"def start\n super\n create_menu_background()\n if MENU_CONFIG::IMAGE_BG != \"\"\n @bg = Sprite.new\n @bg.bitmap = Cache.picture(MENU_CONFIG::IMAGE_BG)\n @bg.opacity = MENU_CONFIG::IMAGE_BG_OPACITY\n end\n \n create_command_window()\n @status_window = Window_Party_Status.new(0, 0, 480,424, $game_party.members)\n @menu_info_window = Window_Menu_Info.new(0,424,640,56)\n end",
"def create_menu\n @tk_root.tk_item.native_item.bind('Command-r', -> { main_component.execute_sql(nil) })\n end",
"def camCreate _obj, _args\n \"_obj camCreate _args;\" \n end",
"def create\n cp = child_params\n cp[:code] = cp[:code].strip\n @child = Child.new(cp)\n\n respond_to do |format|\n begin\n saved = @child.save\n rescue ActiveRecord::RecordNotUnique => e\n @child.errors[:base] << e.message\n saved = false\n rescue => e\n @child.errors[:base] << e.message\n saved = false\n end\n if saved\n format.html { redirect_to @child, notice: tr('child_created') }\n else\n format.html { render :new }\n end\n end\n end",
"def new\n # build a 'temporary' post which is written to DB later (create-method)\n @subsystem = Subsystem.new\n end",
"def action_create\n notifying_block do\n create_group if new_resource.group\n create_user\n end\n end",
"def start\n super\n create_menu_background()\n if MENU_CONFIG::IMAGE_BG != \"\"\n @bg = Sprite.new\n @bg.bitmap = Cache.picture(MENU_CONFIG::IMAGE_BG)\n @bg.opacity = MENU_CONFIG::IMAGE_BG_OPACITY\n end\n \n @title_window = Window_Outline_Title.new(0, 0, 640, 56)\n @content_window = Window_Outline.new(0, 56, 640, 424)\n \n # Create Window \n @list_window = Window_Outline_List.new(0, 0, 400, 400, Vocab::tutorials_strings)\n width_remain = (640 - @list_window.width)/2\n @list_window.x = width_remain.floor\n height_remain = (480 - @list_window.height)/2\n @list_window.y = height_remain.floor\n end",
"def createDisplay _obj, _args\n \"_obj createDisplay _args;\" \n end",
"def CreateNewDatabaseClicked\n unless getDBConn\n msgbox(_(\"Warning\"), _(\"Please open a database-profile first.\"), \"warning\")\n return false\n end\n\n type = getDBConn.getType\n if type != \"mysql\" && type != \"pgsql\"\n msgbox(_(\"Warning\"), sprintf(_(\"You cant create databases.new of af the current dbtype: %s.\"), type), \"warning\")\n return false\n end\n\n name = knj_input(_(\"New database name\"), _(\"Please enter the name of the database.new-type:\"))\n return false if name == false\n\n # Create and choose the database.new.\n begin\n getDBConn.dbs.createDB(\"name\" => name)\n db = getDBConn.dbs.getDB(name)\n getDBConn.dbs.chooseDB(db)\n dbpage.tablesUpdate\n rescue => e\n msgbox(_(\"Warning\"), e.getMessage, \"warning\")\n return false\n end\n end",
"def create(*args)\n self.exec(\"lxc-create\", *args)\n self.state\n end",
"def spawned; end",
"def spawned; end",
"def creating( msg )\n @log.info \"creating #{msg}\"\n end",
"def begin_create\n create_stack.push(true)\n end",
"def create_entry!(*args)\n delegate_to_entry('create!', args)\n end",
"def creating( msg )\n @log.info \"creating #{msg}\"\n end",
"def handle_create_message(message, obj, response)\n new_name = message[:name] || message[:hrn]\n msg_props = message.properties.merge({ hrn: new_name })\n\n obj.create(message[:type], msg_props, &lambda do |new_obj|\n begin\n response[:res_id] = new_obj.resource_address\n response[:uid] = new_obj.uid\n\n # Getting property status, for preparing inform msg\n add_prop_status_to_response(new_obj, msg_props.keys, response)\n\n if (cred = new_obj.certificate)\n response[:cert] = cred.to_pem_compact\n end\n # self here is the parent\n self.inform(:creation_ok, response)\n rescue => ex\n err_resp = message.create_inform_reply_message(nil, {}, src: resource_address)\n err_resp[:reason] = ex.to_s\n error \"Encountered exception, returning ERROR message\"\n debug ex.message\n debug ex.backtrace.join(\"\\n\")\n return self.inform(:error, err_resp)\n end\n end)\n end",
"def create_active_members_window\n y = @left_window.bottom_corner\n @active_members_window = Window_ActiveMembers.new(0, y)\n @active_members_window.set_handler(:right, method(:pass_on_right))\n @active_members_window.set_handler(:cancel, method(:on_cancel))\n @active_members_window.set_handler(:ok, method(:on_actor_selection))\n @active_members_window.y = Graphics.height - @active_members_window.height\n @active_members_window.activate\n end",
"def create\n welcome_message\n super\n end",
"def create_enemy_window() end",
"def start\n super\n create_menu_background()\n if MENU_CONFIG::IMAGE_BG != \"\"\n @bg = Sprite.new\n @bg.bitmap = Cache.picture(MENU_CONFIG::IMAGE_BG)\n @bg.opacity = MENU_CONFIG::IMAGE_BG_OPACITY\n end\n \n @actor = $game_party.members[@actor_index]\n \n @char_image_window = Window_Char_Image.new(-16, 56+16, 640, 424, @actor)\n @char_image_window.opacity = 0\n \n @help_window = Window_Info_Help.new(0, 384, 640, 96, nil)\n \n @skill_back_window = Window_Base.new(200, 56, 440, 328)\n @dataviews_window = Window_Dataviews.new(200, 56, 440, 56, MENU_CONFIG::SKILL_DATAVIEWS)\n @dataviews_window.active = false\n @dataviews_window.opacity = 0\n \n @status_window = Window_Skill_Status.new(0, 0, 200, 128, @actor)\n \n @skill_window = Window_Skill.new(200, 96, 440, 272, @actor, @dataviews_window.selected_view)\n @skill_window.opacity = 0\n @skill_window.help_window = @help_window\n \n @skill_details_window = Window_SkillDetails.new(0,384,640,96,nil)\n @skill_details_window.visible = false\n @skill_window.detail_window = @skill_details_window\n \n @target_window = Window_Party_Status.new(140, 0, 480, 424, $game_party.members)\n hide_target_window\n end",
"def start\n super\n create_menu_background()\n if MENU_CONFIG::IMAGE_BG != \"\"\n @bg = Sprite.new\n @bg.bitmap = Cache.picture(MENU_CONFIG::IMAGE_BG)\n @bg.opacity = MENU_CONFIG::IMAGE_BG_OPACITY\n end\n \n @actor = $game_party.members[@actor_index]\n \n @char_image_window = Window_Char_Image.new(-16, 56+16, 640, 424, @actor)\n @char_image_window.opacity = 0\n \n @help_window = Window_Info_Help.new(0, 384, 640, 96, nil)\n \n @skill_back_window = Window_Base.new(200, 56, 440, 328)\n @dataviews_window = Window_Dataviews.new(200, 56, 440, 56, MENU_CONFIG::SKILL_DATAVIEWS)\n @dataviews_window.active = false\n @dataviews_window.opacity = 0\n \n @status_window = Window_Skill_Status.new(0, 0, 200, 128, @actor)\n \n @skill_window = Window_Skill.new(200, 96, 440, 272, @actor, @dataviews_window.selected_view)\n @skill_window.opacity = 0\n @skill_window.help_window = @help_window\n \n @skill_details_window = Window_SkillDetails.new(0,384,640,96,nil)\n @skill_details_window.visible = false\n @skill_window.detail_window = @skill_details_window\n \n @target_window = Window_Party_Status.new(140, 0, 480, 424, $game_party.members)\n hide_target_window\n end",
"def enter_created; end",
"def spawn_detached(args); end",
"def on_create(&block)\n @on_create_hook = block\n self\n end",
"def create\r\n super # Create the windows\r\n show(PLACEMENT_SCREEN) # Make the main window appear\r\n end",
"def start\n super\n create_menu_background\n if MENU_CONFIG::IMAGE_BG != \"\"\n @bg = Sprite.new\n @bg.bitmap = Cache.picture(MENU_CONFIG::IMAGE_BG)\n @bg.opacity = MENU_CONFIG::IMAGE_BG_OPACITY\n end\n \n @help_window = Window_Info_Help.new(0, 384, 640, 96, nil)\n \n @item_back_window = Window_Base.new(0, 56, 640, 328)\n @dataviews_window = Window_Dataviews.new(0, 56, 640, 56, MENU_CONFIG::ITEM_DATAVIEWS)\n @dataviews_window.active = false\n @dataviews_window.opacity = 0\n \n @item_window = Window_Item.new(0, 96, 640, 272, $game_party.items, @dataviews_window.selected_view)\n @item_window.opacity = 0\n @item_window.help_window = @help_window\n \n @equip_details_window = Window_EquipDetails.new(0,384,640,96,nil)\n @equip_details_window.visible = false\n @item_details_window = Window_ItemDetails.new(0,384,640,96,nil)\n @item_details_window.visible = false\n update_detail_window(@item_window.selected_item)\n \n @target_window = Window_Party_Status.new(0, 0, 480, 424, $game_party.members)\n hide_target_window\n end",
"def start\n super\n create_menu_background\n if MENU_CONFIG::IMAGE_BG != \"\"\n @bg = Sprite.new\n @bg.bitmap = Cache.picture(MENU_CONFIG::IMAGE_BG)\n @bg.opacity = MENU_CONFIG::IMAGE_BG_OPACITY\n end\n \n @help_window = Window_Info_Help.new(0, 384, 640, 96, nil)\n \n @item_back_window = Window_Base.new(0, 56, 640, 328)\n @dataviews_window = Window_Dataviews.new(0, 56, 640, 56, MENU_CONFIG::ITEM_DATAVIEWS)\n @dataviews_window.active = false\n @dataviews_window.opacity = 0\n \n @item_window = Window_Item.new(0, 96, 640, 272, $game_party.items, @dataviews_window.selected_view)\n @item_window.opacity = 0\n @item_window.help_window = @help_window\n \n @equip_details_window = Window_EquipDetails.new(0,384,640,96,nil)\n @equip_details_window.visible = false\n @item_details_window = Window_ItemDetails.new(0,384,640,96,nil)\n @item_details_window.visible = false\n update_detail_window(@item_window.selected_item)\n \n @target_window = Window_Party_Status.new(0, 0, 480, 424, $game_party.members)\n hide_target_window\n end",
"def create_server\n\n end",
"def create\n @child = Child.new(params[:child])\n @child_crud = true\n\n respond_to do |format|\n if @child.save\n format.html { redirect_to children_url, notice: 'Child was successfully created.' }\n format.js { @current_child = @child}\n format.json { render json: @child, status: :created, location: @child }\n else\n format.html { render :layout => false, action: \"new\"}\n format.json { render json: @child.errors, status: :unprocessable_entity }\n end\n end\n end",
"def radioChannelCreate _args\n \"radioChannelCreate _args;\" \n end",
"def create_new_wrap\n\t\t# This method is in CommonElements\n\t\twait_loading\n\t\tself.create_new_wrap_button\n\tend",
"def OnCreateUICommand(*args)\r\n\t\tuich.QueryInterface(uich.class::IID, args[-1])\r\n\r\n\t\tS_OK\r\n\tend",
"def create( mods )\n\t\tself.log.debug \" entry doesn't exist: creating...\"\n\t\tself.before_create( mods ) or\n\t\t\traise Treequel::BeforeHookFailed, :create\n\t\tsuper( mods )\n\t\tself.after_create( mods )\n\tend",
"def create\n Puppet.debug( \"#{self.resource.type}: CREATE #{resource[:name]}\" ) \n end",
"def on_create\n #of course, menu options are also addable programmatically:\n add_menu(\"Execute\", drawable_ic_menu_play) do\n #some business logic here\n end \n end",
"def create(args = {})\n end",
"def create_container\n\t\t\t\t@command.container_class.new\n\t\t\tend",
"def create_title_window\n @title_window = Window_TitleList.new(TITLE_WINDOW_X, TITLE_WINDOW_Y)\n @title_window.actor = @actor\n @title_window.set_handler(:ok, method(:on_title_ok))\n @title_window.set_handler(:cancel, method(:on_title_cancel))\n @title_window.set_handler(:start, method(:toggle_help))\n @title_window.help_window = @help_window\n @title_window.hide\n end",
"def initialize(win, game, uiManager)\n super(win,\"/../../../Assets/Backgrounds/fond-naturel.png\")\n\n @nicknameInput = false\n @game = game\n @uiManager = uiManager\n\n screen=Gdk::Screen.default\n pathAssets=File.dirname(__FILE__) + \"/../../../Assets/\"\n\n menuTitle=Titre.new(label:\"Victoire\", width:screen.width*0.2, height:screen.height*0.05)\n\n # Nickname input\n @entry = Gtk::Entry.new\n @entry.set_placeholder_text(\"Saisir votre pseudo\")\n @entry.set_max_length(7)\n\n # Nickname validation\n nicknameValidateBtn = Button.new(image: pathAssets + \"Button/validate.png\", width: screen.height * 0.1, height: screen.height * 0.1, padding: 0)\n nicknameValidateBtn.resizeImage(screen.height * 0.1, screen.height * 0.1)\n nicknameValidateBtn.onClick(){\n saveNickname(uiManager.rankedLevel)\n }\n\n #creation du texte avant la zone d'affichage du chrono\n chronoText=Text.new(label:\"Votre temps :\", width:screen.width*0.2, height:screen.height*0.05)\n chronoText.setBackgroundSize(screen.width*0.2,screen.height*0.05)\n chronoText.setBackground(1,1,1,1)\n #creation de la zone d'affichage du chrono\n @chronoUi=ChronoUi.new(game.getTimer)\n # chronoZone=Text.new(width:screen.width*0.2, height:screen.height*0.05)\n\n #creation du bouton menuPrincipal\n menuButton=Button.new(image:pathAssets + \"Button/menu.png\", width: screen.width*0.1,height: screen.height*0.08)\n menuButton.resizeImage(40,40)\n menuButton.onClick(){\n if(@nicknameInput)\n #aller au menu principal\n uiManager.rankScreen.applyOn(win)\n uiManager.victoryScreenType = :normal\n end\n }\n\n #creation du bouton recommencer\n replayButton=Button.new(image:pathAssets + \"Button/replay.png\", width: screen.width*0.1,height: screen.height*0.08)\n replayButton.resizeImage(40,40)\n replayButton.onClick(){\n if(@nicknameInput)\n #recharger le niveau sur lequel on etait\n game.restart\n gameScreen = GameScreen.new(win,game,uiManager, lambda { uiManager.rankScreen.applyOn(win) },)\n gameScreen.applyOn(win)\n end\n }\n\n\n nicknameInputBox = Gtk::Grid.new\n nicknameInputBox.set_halign(Gtk::Align::CENTER)\n nicknameInputBox.attach(@entry, 0, 0, 3, 1)\n nicknameInputBox.attach(nicknameValidateBtn.gtkObject, 3, 0, 1, 1)\n\n chronoBox = Gtk::Box.new(:horizontal)\n chronoBox.pack_start(chronoText.gtkObject, expand: true, fill: false, padding: 20)\n chronoBox.pack_start(@chronoUi.gtkObject, expand: true, fill: false, padding: 20)\n\n buttonBox = Gtk::Box.new(:horizontal)\n buttonBox.pack_start(menuButton.gtkObject, expand: true, fill: false, padding: 0)\n buttonBox.pack_start(replayButton.gtkObject, expand: true, fill: false, padding: 0)\n\n globalBox = Gtk::Box.new(:vertical)\n globalBox.pack_start(menuTitle.gtkObject, expand: true, fill: false, padding: 10)\n globalBox.pack_start(nicknameInputBox, expand: false, fill: false, padding: 10)\n globalBox.pack_start(chronoBox, expand: true, fill: false, padding: 10)\n globalBox.pack_start(buttonBox, expand: true, fill: false, padding: 10)\n\n @gtkObject = Gtk::Table.new(4,4)\n @gtkObject.attach(globalBox,0,4,0,4)\n @gtkObject.attach(Gtk::Image.new(pixbuf: @buffer),0,4,0,4)\n\n end",
"def create\n \t\n end",
"def createMine _args\n \"createMine _args;\" \n end",
"def create_menu_command\n\t @command_window = Window_MenuCommand.new\n\t @command_window.set_handler(:item, method(:command_item))\n\t @command_window.set_handler(:skill, method(:command_personal))\n\t @command_window.set_handler(:equip, method(:command_personal))\n\t @command_window.set_handler(:status, method(:command_personal))\n\t @command_window.set_handler(:save, method(:command_save))\n\t @command_window.set_handler(:game_end, method(:command_game_end))\n\t @command_window.set_handler(:cancel, method(:return_scene))\t\n\tend",
"def build_child( name )\n Account.new( :name => name, :type => type, :parent => self )\n end",
"def after_create_hook\n execute_hooks_for(:after, :create)\n end",
"def create_bucket_window\n $add_bucket_window = TkToplevel.new() { title 'Create Bucket' }\n $txt_input_bucket_name = TkEntry.new($add_bucket_window)\n $txt_input_bucket_name.pack('side' => 'top', 'padx' => '10', 'pady' => '10')\n TkButton.new($add_bucket_window) {\n text 'Create Bucket'\n command(proc { create_bucket() })\n pack('side' => 'bottom', 'padx' => '5', 'pady' => '5')\n }\n end",
"def createTrigger _args\n \"createTrigger _args;\" \n end",
"def create_avatar_window\n @avatar_window = Window_AvatarList.new(0, 0, Graphics.width)\n @avatar_window.y = Graphics.height - @avatar_window.height\n @avatar_window.visible = false\n @avatar_window.active = false\n @avatar_window.set_handler(:ok, method(:avatar_selected))\n @avatar_window.set_handler(:cancel, method(:close_avatar))\n end",
"def handle_new_chatroom_member\n @chatroom_member = ChatroomMember.new(chatroom_member_params)\n save_chatroom_member\n end",
"def create_quest_category_window\n @quest_category_window = Window_QuestCategory.new(0, 0, $game_system.quest_categories)\n @quest_category_window.category = @init_category if @init_category\n @quest_category_window.set_handler(:cancel, method(:on_category_cancel))\n @quest_category_window.set_handler(:ok, method(:on_category_ok)) \n end",
"def create\n super\n push_binding(instance_eval(\"#{name.to_s}\"))\n end",
"def add(child, left, right, top, bottom, &block)\n super(child, false, &block)\n\n gtk_instance.attach(child.gtk_instance, left, right, top, bottom)\n end",
"def createAgent _args\n \"createAgent _args;\" \n end",
"def creation #wizard will be able to create objects, his proficiency is based on the skill level he has in this type of magic\r\n \r\n end",
"def start\n super\n create_menu_background()\n if MENU_CONFIG::IMAGE_BG != \"\"\n @bg = Sprite.new\n @bg.bitmap = Cache.picture(MENU_CONFIG::IMAGE_BG)\n @bg.opacity = MENU_CONFIG::IMAGE_BG_OPACITY\n end\n \n @actor = $game_party.members[@actor_index]\n @char_image_window = Window_Char_Image.new(-16, 56+16, 640, 424, @actor)\n @char_image_window.opacity = 0\n @char_info_window = Window_Char_Info.new(0, 0, 200, 128, @actor)\n \n @status_window = Window_Status.new(200, 40, 440, 440, @actor)\n \n @status_equip_window = Window_Status_Equip.new(415, 40, 225, 272, @actor)\n @status_equip_window.active = false\n \n @equip_details_window = Window_EquipDetails.new(0,384,640,96,nil)\n @equip_details_window.visible = false\n @item_details_window = Window_ItemDetails.new(0,384,640,96,nil)\n @item_details_window.visible = false\n \n positions = []\n positions.push(CursorPosition.new(Rect.new(@status_equip_window.x,\n @status_equip_window.y, \n @status_equip_window.width-32, \n @status_equip_window.height-32)))\n \n @command_window = Window_Custom_Selectable.new(0, 0, 640, 480, positions)\n @command_window.opacity = 0\n @command_window.visible = true\n @command_window.active = true\n @command_window.index = 0\n \n @help_window = Window_Info_Help.new(0, 384, 640, 96, nil)\n @help_window.visible = false\n \n @status_equip_window.help_window = @help_window\n end",
"def create_browse_form\n\t\n\t\t\t# Create child form if not present\n\t\t\tif @dir_browse_form.nil?\n\t\t\t\n\t\t\t\t# Call GUI Utility Method to handle child form creation\n\t\t\t\tresult = GuiUtils.create_child_form({\n\t\t\t\t\t:class => Ui_DirBrowseForm,\n\t\t\t\t\t:flags => Qt::Tool | Qt::MSWindowsFixedSizeDialogHint, #| Qt::WindowTitleHint | Qt::CustomizeWindowHint, # << no close button\n\t\t\t\t\t:base_widget => CustomFontWidget.new(self),\n\t\t\t\t\t:show => false\n\t\t\t\t})\n\n\t\t\t\t# Center the newly created form relative to the parent form\n\t\t\t\t@dir_browse_form = result[:form]\n\t\t\t\tGuiUtils.center_relative_to({\n :widget => @dir_browse_form,\n :parent => @parent\n })\n\n\t\t\t\t# Set closed callbacks for the actual form and its dummy form\n\t\t\t\tui = result[:ui]\n\t\t\t\thandler = lambda { dir_browse_closed }\n\t\t\t\tui.closed_callback = handler\n\t\t\t\t@dir_browse_ui = ui.extension\n\t\t\t\t@dir_browse_ui.closed_callback = handler\n\t\t\tend\t\n\t\n\t\tend",
"def create_new\n Rails.logger.debug(\"CREATE_NEW\")\n @uid = get_new_uid\n Rails.logger.debug(@uid)\n create_default_docs\n if @super_user\n add_super_user(@uid)\n end\n end",
"def create\n @child = Child.new(child_params)\n \n respond_to do |format|\n if @child.save\n format.html { redirect_to @child, notice: 'Child was successfully created.' }\n format.json { render action: 'show', status: :created, location: @child }\n else\n format.html { render action: 'new' }\n format.json { render json: @child.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"def new\n # Use the Template class so that we can use the same object in forms which need the Template properties.\n @node = @parent.new_child(:class => Template)\n \n respond_to do |format|\n format.html\n end\n end",
"def create params\n raise_start_server unless Server::node\n new params\n end",
"def create\n @condominium_child = CondominiumChild.new(condominium_child_params)\n respond_to do |format|\n if @condominium_child.save\n format.json { render :show, status: :created, object: @condominium_child }\n else\n format.json { render json: @condominium_child.errors, status: :unprocessable_entity }\n end\n end\n end",
"def admin_create\n # Ensure that the user can only create GuidanceGroups for their Org\n args = guidance_group_params.to_h.merge({ org_id: current_user.org.id })\n @guidance_groups = GuidanceGroup.where(org_id: current_user.org.id)\n @guidance_group = GuidanceGroup.new(args)\n authorize @guidance_group\n\n if @guidance_group.save\n flash.now[:notice] = success_message(@guidance_group, _('created'))\n render :admin_edit\n else\n flash.now[:alert] = failure_message(@guidance_group, _('create'))\n render :admin_new\n end\n end",
"def create\n \n end",
"def create\n\t\tsuper\n\tend",
"def domain_create(args)\n response = send_request(domain_create_xml(args))\n\n get_result(:xml => response, :callback => :domain_create_process)\n end",
"def run\n sanity_check\n\n ui.info(\"Creating new client for #{node_name}\")\n\n @client = create_client!\n\n ui.info(\"Creating new node for #{node_name}\")\n\n create_node!\n end",
"def create\n @child = Child.new(child_params)\n\n respond_to do |format|\n if @child.save\n format.html { redirect_to @child, notice: 'Child was successfully created.' }\n format.json { render :show, status: :created, location: @child }\n else\n format.html { render :new }\n format.json { render json: @child.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create!\n end",
"def create(name, type)\n configure [\"aaa group server #{type} #{name}\", 'exit']\n end",
"def create\n run_callbacks :create do\n true\n end\n end",
"def new\n @child =Child.new \n end",
"def get_child(name, args)\n child_location = location + \"[#{name}]\"\n\n args.fetch(:interface).new(driver,\n blue_prints.send(name),\n name, self, child_location)\n end",
"def children_for page, title\n page.children.create({\n :title => title,\n :deletable => true,\n :status => 'live',\n :show_in_menu => true,\n :parent_id => page.id\n })\nend",
"def create_graphics\n create_viewport\n create_base\n create_ui\n end",
"def create(context, name, klass, *args)\n child = component(klass).new(*args)\n c_name = klass.component || klass.name.split('::').last.underscore.to_sym\n\n child.context = context.clone\n child.context[c_name] = child\n child.context.file_path << name.to_s if name\n child.setup\n child\n end",
"def create_children(&block)\n if respond_to?(:response)\n self.response &block\n else\n block.call if block_given?\n end\n end",
"def create_category_window\n @category_window = Window_EnemyCategory.new(0, 0)\n end",
"def build(*args)\n @instance = @obj.send(PolyBelongsTo::Pbt::BuildCmd[@obj, @child], *args)\n self\n end",
"def post_initialize(args)\n begin\n specify_children()\n specify_attributes()\n if(!args.nil?)\n if(args.is_a?(Hash))\n if(args.has_key? :children)\n bulk_children(args[:children])\n end\n if(args.has_key? :attributes)\n #puts \"Has attributes\"\n args[:attributes].keys.each do |a|\n #puts \"Writing attribute:\", a\n @attributes[a] = args[:attributes][a] #TODO, this should have better error checking in it, like is a field required but is passed nil?\n end\n end\n if(args.has_key? :text)\n #puts \"Added text\", args[:text]\n @text = args[:text]\n else\n #TODO #put error that the proper hash keys were not identified.\n end\n end\n else\n #TODO give some indication that no arguments were provided\n end\n #TODO - make this active only on a boolean, possibly filter\n delete_unwanted_children()\n rescue => error\n puts \"Could not create the BuildingSync element properly.\"\n puts error.inspect, error.backtrace\n end\n end",
"def create\n world_name = params[\"name\"]\n superclass_uri = params[\"type-parent\"]\n container_uri = params[\"location-parent\"]\n description = params[\"description\"]\n if params.has_key?(:options)\n options = {protected: false, locked: false}\n options[:protected] = true if (params[\"options\"].include?(\"protected\"))\n options[:locked] = true if (params[\"options\"].include?(\"locked\"))\n end\n host_port = request.host_with_port\n hostname = host_port.split(\":\").first\n port = host_port.split(\":\").last\n\n if (WorldAdmin.has_visibility_privilege?(superclass_uri, session[:user_uri]) && WorldAdmin.has_frame_level_privilege?(container_uri, session[:user_uri]))\n w = WorldInstance.create_world_instance_with_uri(world_name, superclass_uri, container_uri, description, nil, options, nil, nil, nil, hostname, port)\n\n puts w.world_instance_uri\n redirect_to w.world_instance_uri\n else\n head(status=401)\n end\n\n # @world_instance = WorldInstance.new(world_instance_params)\n #\n # respond_to do |format|\n # if @world_instance.save\n # format.html { redirect_to @world_instance, notice: 'World instance was successfully created.' }\n # format.json { render :show, status: :created, location: @world_instance }\n # else\n # format.html { render :new }\n # format.json { render json: @world_instance.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"def create_child\n Walker.new(x, y, direction + 2*rand(2) - 1)\n end",
"def create_child_logger(child_name)\n # add child_prefix + child_id\n instance_name = [\n @options[:_instance], self.class.child_prefix, child_name\n ].compact.join(self.class.separator)\n\n self.class.new(*@args, @options.merge(_instance: instance_name))\n end",
"def setup_child\n log(:at => \"setup_child\")\n end",
"def create_child(child_name, constant, requires)\n TestCase.create(\n parent_id: id,\n root: false,\n dangles: dangles,\n name: child_name,\n requires: requires,\n runs_per_port: constant.method_defined?(:attack_on_port),\n protocol: constant.protocol,\n description: constant.description,\n author: constant.author\n )\n end",
"def create_post!(params)\n @children.create! params\n end"
] | [
"0.6128622",
"0.5899525",
"0.5891158",
"0.58861685",
"0.5768698",
"0.56993145",
"0.5674157",
"0.56266534",
"0.56181115",
"0.56168574",
"0.56008",
"0.55963975",
"0.5591144",
"0.55399203",
"0.547829",
"0.54654324",
"0.544472",
"0.5438036",
"0.54375863",
"0.5391729",
"0.538545",
"0.53852",
"0.53787535",
"0.5370881",
"0.5367243",
"0.535228",
"0.535228",
"0.5343073",
"0.53233",
"0.53179145",
"0.5315639",
"0.5309584",
"0.5301079",
"0.5295993",
"0.52903664",
"0.52832913",
"0.52832913",
"0.52754295",
"0.5259236",
"0.5251533",
"0.52409923",
"0.52384555",
"0.52384555",
"0.5235169",
"0.5226205",
"0.52248484",
"0.5206486",
"0.5204529",
"0.5202894",
"0.5200096",
"0.5197076",
"0.51969546",
"0.51815057",
"0.5172997",
"0.5171471",
"0.5170543",
"0.51701236",
"0.5164382",
"0.51609117",
"0.5160439",
"0.51596916",
"0.5154364",
"0.51472646",
"0.51431286",
"0.51422215",
"0.5141916",
"0.51310325",
"0.512916",
"0.5113465",
"0.51103383",
"0.5104732",
"0.5097688",
"0.5085406",
"0.50818235",
"0.50802314",
"0.50776374",
"0.5071414",
"0.5065536",
"0.50639576",
"0.5052502",
"0.50482297",
"0.5046335",
"0.50424355",
"0.5041592",
"0.504005",
"0.5037415",
"0.5033157",
"0.5026266",
"0.5025228",
"0.502506",
"0.5022748",
"0.50193894",
"0.5014757",
"0.5012585",
"0.50046927",
"0.5001254",
"0.4999275",
"0.4996637",
"0.49948677",
"0.49942273"
] | 0.55182946 | 14 |
Internal handler for GUILD_UPDATE | def update_guild(data)
@servers[data['id'].to_i].update_data(data)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def on_update; end",
"def update!(**args)\n @child = args[:child] if args.key?(:child)\n end",
"def update!(**args)\n @child = args[:child] if args.key?(:child)\n end",
"def update!(**args)\n @child = args[:child] if args.key?(:child)\n end",
"def update\n handle_orcamento_update\n end",
"def after_update; end",
"def after_update; end",
"def remote_update(*)\n super(changed)\n end",
"def update\n super\n update_menu_background\n @command_window.update\n @gold_window.update\n @status_window.update\n if @submenu_window\n @submenu_window.update\n @submenu_window.dispose if @submenu_window.openness == 0\n @submenu_window = nil if @submenu_window.disposed?\n end\n if @command_window.active\n update_command_selection\n elsif @status_window.active\n update_actor_selection\n elsif @submenu_window.active\n update_submenu_selection\n end\n end",
"def update!(**args)\n @child_type = args[:child_type] if args.key?(:child_type)\n end",
"def update() end",
"def update ; end",
"def after_update\n end",
"def after_update\n end",
"def update\n # Not generally used\n end",
"def update\n # Not generally used\n end",
"def update\n \n end",
"def update\n\t\t# Left empty intentionally.\n\tend",
"def update\n \t\n end",
"def update\n \t\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def _child_updated\n render :js => update_recordset_js(false)\n end",
"def update!(**args)\n @idle_shutdown_message = args[:idle_shutdown_message] if args.key?(:idle_shutdown_message)\n end",
"def update\r\n end",
"def update\r\n end",
"def update\r\n end",
"def update\r\n end",
"def update!(**args)\n @bot = args[:bot] if args.key?(:bot)\n @command_id = args[:command_id] if args.key?(:command_id)\n @command_name = args[:command_name] if args.key?(:command_name)\n @triggers_dialog = args[:triggers_dialog] if args.key?(:triggers_dialog)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @bot = args[:bot] if args.key?(:bot)\n @command_id = args[:command_id] if args.key?(:command_id)\n @command_name = args[:command_name] if args.key?(:command_name)\n @triggers_dialog = args[:triggers_dialog] if args.key?(:triggers_dialog)\n @type = args[:type] if args.key?(:type)\n end",
"def update\r\n\r\n end",
"def update(msg)\n case msg\n # Handle disconnection from server\n # Note that publishing a :quit event (see #disconnect) will return a\n # :disconnected event when server has closed the connection.\n # Guest accounts and characters are deleted here.\n when :disconnected\n @conn = nil\n unsubscribe_all\n Engine.instance.db.makeswap(id)\n if @character\n world.connected_characters.delete(@character.id)\n world.connected_characters.each do |pid|\n add_event(@character.id,pid,:show,\"#{name} has disconnected.\")\n end\n Engine.instance.db.makeswap(@character.id)\n @character.account = nil\n if @character.name =~ /Guest/i\n world.all_characters.delete(@character.id)\n delete_object(@character.id)\n end\n @character = nil\n end\n if name =~ /Guest/i\n world.all_accounts.delete(id)\n delete_object(id)\n end\n # Issued when a NAWS event occurs\n # Currently this clears and resets the screen. Ideally it should attempt\n # to redraw it.\n when :termsize\n @termsize = @conn.query(:termsize)\n if vtsupport?\n publish(\"[home #{@termsize[1]},1][clearline][cursave]\" +\n \"[home 1,1][scrreset][clear][scrreg 1,#{@termsize[1]-3}][currest]\")\n end\n # Negotiation with client done. Start talking to it.\n when :initdone\n @echo = @conn.query(:echo)\n @termsize = @conn.query(:termsize)\n @terminal = @conn.query(:terminal)\n if vtsupport?\n publish(\"[home #{@termsize[1]},1][clearline][cursave]\" +\n \"[home 1,1][scrreset][clear][scrreg 1,#{@termsize[1]-3}][currest]\")\n sendmsg(LOGO)\n end\n sendmsg(BANNER)\n sendmsg(append_echo(\"login> \"))\n @mode = :name\n # This is a message from our user\n when String\n parse_messages(msg)\n else\n log.error \"Account#update unknown message - #{msg.inspect}\"\n end\n rescue\n # We squash and print out all exceptions here. There is no reason to\n # throw these back at the Connection.\n log.error $!\n end",
"def updateMenuItem _obj, _args\n \"_obj updateMenuItem _args;\" \n end",
"def update()\n end",
"def update\n #Nothing necessary\n end",
"def update_command *args, &block\n $log.debug \"Variable: update command set \" # #{args}\"\n @update_command << block\n @args << args\n end",
"def update!(**args)\n @bottom_label = args[:bottom_label] if args.key?(:bottom_label)\n @button = args[:button] if args.key?(:button)\n @content = args[:content] if args.key?(:content)\n @content_multiline = args[:content_multiline] if args.key?(:content_multiline)\n @end_icon = args[:end_icon] if args.key?(:end_icon)\n @icon = args[:icon] if args.key?(:icon)\n @icon_alt_text = args[:icon_alt_text] if args.key?(:icon_alt_text)\n @icon_url = args[:icon_url] if args.key?(:icon_url)\n @image_style = args[:image_style] if args.key?(:image_style)\n @on_click = args[:on_click] if args.key?(:on_click)\n @start_icon = args[:start_icon] if args.key?(:start_icon)\n @switch_widget = args[:switch_widget] if args.key?(:switch_widget)\n @top_label = args[:top_label] if args.key?(:top_label)\n end",
"def update \n end",
"def update!(**args)\n @child_link = args[:child_link] if args.key?(:child_link)\n @created = args[:created] if args.key?(:created)\n @id = args[:id] if args.key?(:id)\n @kind = args[:kind] if args.key?(:kind)\n @name = args[:name] if args.key?(:name)\n @permissions = args[:permissions] if args.key?(:permissions)\n @self_link = args[:self_link] if args.key?(:self_link)\n @starred = args[:starred] if args.key?(:starred)\n @updated = args[:updated] if args.key?(:updated)\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\r\n end",
"def update\n \n end",
"def update; end",
"def update \n end",
"def update(...)\n end",
"def mte_prepare_updating; send_request_to_mite(\"update\"); end",
"def window_update(actor)\n if actor != nil\n @cCharName.text = actor.name\n @ucCharLvl.cValue.text = actor.level\n \n @ucHpStat.cValue.text = sprintf(MENU_CONFIG::GAUGE_PATTERN, actor.hp, actor.maxhp)\n @ucHpStatGauge.value = actor.hp\n @ucHpStatGauge.max_value = actor.maxhp\n \n if actor.hp == 0\n @ucHpStat.cValue.font.color = Color.knockout_color\n elsif actor.hp < actor.maxhp / 4\n @ucHpStat.cValue.font.color = Color.crisis_color\n else\n @ucHpStat.cValue.font.color = Color.normal_color\n end\n \n @ucMpStat.cValue.text = sprintf(MENU_CONFIG::GAUGE_PATTERN, actor.mp, actor.maxmp)\n @cMpStatGauge.value = actor.mp\n @cMpStatGauge.max_value = actor.maxmp\n \n if actor.mp < actor.maxmp / 4\n @ucMpStat.cValue.font.color = Color.crisis_color\n else\n @ucMpStat.cValue.font.color = Color.normal_color\n end\n \n end\n refresh()\n end",
"def window_update(actor)\n if actor != nil\n @cCharName.text = actor.name\n @ucCharLvl.cValue.text = actor.level\n \n @ucHpStat.cValue.text = sprintf(MENU_CONFIG::GAUGE_PATTERN, actor.hp, actor.maxhp)\n @ucHpStatGauge.value = actor.hp\n @ucHpStatGauge.max_value = actor.maxhp\n \n if actor.hp == 0\n @ucHpStat.cValue.font.color = Color.knockout_color\n elsif actor.hp < actor.maxhp / 4\n @ucHpStat.cValue.font.color = Color.crisis_color\n else\n @ucHpStat.cValue.font.color = Color.normal_color\n end\n \n @ucMpStat.cValue.text = sprintf(MENU_CONFIG::GAUGE_PATTERN, actor.mp, actor.maxmp)\n @cMpStatGauge.value = actor.mp\n @cMpStatGauge.max_value = actor.maxmp\n \n if actor.mp < actor.maxmp / 4\n @ucMpStat.cValue.font.color = Color.crisis_color\n else\n @ucMpStat.cValue.font.color = Color.normal_color\n end\n \n end\n refresh()\n end",
"def update!(**args)\n @action_status = args[:action_status] if args.key?(:action_status)\n @dialog = args[:dialog] if args.key?(:dialog)\n end",
"def update!(**args)\n @action_status = args[:action_status] if args.key?(:action_status)\n @dialog = args[:dialog] if args.key?(:dialog)\n end",
"def window_update(actor)\n if actor != nil\n bodyImg = MENU_CONFIG::BODY_IMAGES[actor.id]\n bitmap = Cache.picture(bodyImg.filename)\n @cBackCharImage.img_bitmap = bitmap\n @cBackCharImage.src_rect = Rect.new(bodyImg.src_rect.x, bodyImg.src_rect.y, \n bitmap.width, bitmap.height)\n end\n refresh()\n end",
"def update;end",
"def after_update_callback\n puts('----------after_updateをコール----------')\n end",
"def update_basic(main = false)\n super()\n $game_troop.update # Update enemy group\n $game_map.update(false) # Update map data\n @spriteset.update # Update sprite set\n update_win_visible\n update_battlers\n if @message_window.visible != $game_message.visible\n @message_window.visible = $game_message.visible\n @message_window.update # Update message window\n end\n end",
"def update!(**args)\n @arguments_hint = args[:arguments_hint] if args.key?(:arguments_hint)\n @command_id = args[:command_id] if args.key?(:command_id)\n @command_name = args[:command_name] if args.key?(:command_name)\n @id = args[:id] if args.key?(:id)\n @triggers_dialog = args[:triggers_dialog] if args.key?(:triggers_dialog)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @child = args[:child] if args.key?(:child)\n @label = args[:label] if args.key?(:label)\n @phrase = args[:phrase] if args.key?(:phrase)\n end",
"def after_update(updated)\n # not required\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end"
] | [
"0.623351",
"0.62005323",
"0.62005323",
"0.62005323",
"0.6191177",
"0.6037577",
"0.6037577",
"0.6036744",
"0.60331976",
"0.59629935",
"0.59279335",
"0.58606535",
"0.5816543",
"0.5816543",
"0.57478344",
"0.57478344",
"0.57396024",
"0.5732423",
"0.57224035",
"0.57224035",
"0.57199967",
"0.57199967",
"0.57199967",
"0.57199967",
"0.57199967",
"0.57199967",
"0.57199967",
"0.57199967",
"0.5715135",
"0.57108027",
"0.566613",
"0.566613",
"0.566613",
"0.566613",
"0.5662254",
"0.5662254",
"0.5659833",
"0.5657065",
"0.56554264",
"0.5645547",
"0.56094116",
"0.56072295",
"0.55946666",
"0.5585791",
"0.55811864",
"0.5580886",
"0.5580886",
"0.5580886",
"0.5580886",
"0.5580886",
"0.5580886",
"0.5580886",
"0.5580886",
"0.5580886",
"0.5580886",
"0.5580886",
"0.55597895",
"0.555504",
"0.5545221",
"0.5535872",
"0.55340546",
"0.5530776",
"0.55298626",
"0.55298626",
"0.5527332",
"0.5527332",
"0.5526051",
"0.5520803",
"0.55198354",
"0.5515887",
"0.5504738",
"0.5503939",
"0.5503804",
"0.5498431",
"0.5498431",
"0.5498431",
"0.5498431",
"0.5498431",
"0.5498431",
"0.5498431",
"0.5498431",
"0.5498431",
"0.5498431",
"0.5498431",
"0.5498431",
"0.5498431",
"0.5498431",
"0.5498431",
"0.5498431",
"0.5498431",
"0.5498431",
"0.5498431",
"0.5498431",
"0.5498431",
"0.5498431",
"0.5498431",
"0.5498431",
"0.5498431",
"0.5498431",
"0.5498431",
"0.5498431"
] | 0.0 | -1 |
Internal handler for GUILD_DELETE | def delete_guild(data)
id = data['id'].to_i
@servers.delete(id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def child_post_delete_hook( key, object, parent_hash = nil )\n \n return object\n \n end",
"def destroy\n @condominium_child.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @child.destroy\n respond_to do |format|\n format.html { redirect_to :back, notice: 'Child was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n family = @child.family\n @child.destroy\n respond_to do |format|\n format.html { redirect_to family, notice: tr(\"child_deleted\") }\n end\n end",
"def destroy!; end",
"def destroy\n @child.destroy\n respond_to do |format|\n format.html { redirect_to children_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @child.destroy\n respond_to do |format|\n format.html { redirect_to children_url, notice: 'Child was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @child.destroy\n respond_to do |format|\n format.html { redirect_to children_url, notice: 'Child was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def child_post_delete_hook( index, object, parent_array = nil )\n \n return object\n \n end",
"def destroy\n @child.destroy\n respond_to do |format|\n format.html { redirect_to children_url, notice: \"Child was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @child.destroy\n respond_to do |format|\n format.html { redirect_to children_url, notice: \"Child was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def delete_message(data); end",
"def delete_message(data); end",
"def delete\n \n end",
"def destroy\n @traumatized_child.destroy\n respond_to do |format|\n format.html { redirect_to traumatized_children_url, notice: \"Traumatized child was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy; delete end",
"def destroy; end",
"def destroy; end",
"def destroy; end",
"def destroy; end",
"def destroy; end",
"def destroy; end",
"def destroy; end",
"def destroy; end",
"def destroy; end",
"def destroy; end",
"def destroy\n\t\trun_callbacks(:destroy) { delete } \n\tend",
"def quit_on_delete!\n on_delete do\n quit\n end\n end",
"def destroy\n \n end",
"def destroy\n \n end",
"def lbDelete _obj, _args\n \"_obj lbDelete _args;\" \n end",
"def destroy(context={})\n self.class.rpc_execute('unlink', self.id, context)\n end",
"def destroy\n admin_only do\n @browsertype.destroy\n log_action('Delete', current_user ? current_user.username : 'Anonymous', params[:id], 'BrowserType')\n respond_to do |format|\n format.html { redirect_to browsertypes_url, notice: 'Browsertype was successfully destroyed.' }\n format.json { head :no_content }\n end\n end\n end",
"def delete(uid)\n super uid\n end",
"def delete(uid)\n super uid\n end",
"def delete(uid)\n super uid\n end",
"def delete(uid)\n super uid\n end",
"def destroy\n @child = Child.find(params[:id])\n @child.destroy\n\n respond_to do |format|\n format.html { redirect_to children_url }\n format.json { head :ok }\n end\n end",
"def destroy\n\t\t@parent_child.destroy\n\t\trespond_to do |format|\n\t \t\tformat.html { redirect_to parent_children_url, notice: 'Parent child was successfully destroyed.' }\n\t \t\tformat.json { head :no_content }\n\t\tend\n \tend",
"def destroy\n\t\t\n\tend",
"def delete(action, **args); end",
"def destroy\n @child_actor.destroy\n respond_to do |format|\n format.html { redirect_to child_actors_url, notice: \"Child actor was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n end",
"def destroy\r\n end",
"def destroy\n log_failure do\n handler.destroy\n end\n end",
"def destroy\n @ministry_child.destroy\n respond_to do |format|\n format.html { redirect_to ministry_children_url, notice: 'Ministry child was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @key_donor_child.destroy\n respond_to do |format|\n format.html { redirect_to key_donor_children_url, notice: 'Key donor child was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete; rest_delete(link('self')); end",
"def delete; rest_delete(link('self')); end",
"def destroy\n @child = Child.find(params[:id])\n @child.destroy\n\n respond_to do |format|\n format.html { redirect_to(children_url) }\n format.xml { head :ok }\n end\n end",
"def delete_server\n super\n end",
"def remove_child_link(name, f)\n # name = delete_no_alt_icon + \" \" + name\n # deprecated _delete, use _destroy instead\n # f.hidden_field(:_delete) + link_to_function(name, \"remove_fields(this)\")\n f.hidden_field(:_destroy) + link_to_function(name, \"remove_fields(this)\")\n end",
"def destroy\n output = \"oneimage delete #{resource[:name]} \", self.class.login\n `#{output}`\n end",
"def delete *args, &block\n res = @conn.delete *args, &block\n handle res, parse: false\n end",
"def delete_msg()\n MsgUtil.delete_msg(params[:ch])\n end",
"def destroy\n # delete a specific message\n end",
"def destroy\r\n\r\n end",
"def delete_child(widget)\n delete_child_at( @children.index(widget) )\n end",
"def destroy\n @verb.destroy\n\n head :no_content\n end",
"def destroy\n @child_fatality.destroy\n respond_to do |format|\n format.html { redirect_to child_fatalities_url, notice: 'Child fatality was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n end",
"def destroy\n end",
"def destroy\n end",
"def destroy\n end",
"def destroy\n end",
"def destroy(context={})\n rpc_execute('unlink', [self.id], context)\n end",
"def destroy\n orchio_delete\n end",
"def destroy \r\n\r\n end",
"def TreeView_DeleteItem(hwnd, hitem) send_treeview_message(hwnd, :DELETEITEM, lparam: hitem) end",
"def destroy\n # delete a specific message\n end",
"def delete_post\n\t \n \tend",
"def orchio_delete\n response = client.send_request :delete, inst_args\n orchio_status response, 204\n end",
"def delete!\n\t\t\tClient.delete @root\n\t\tend",
"def on_mainWindow_delete_event(widget, arg0)\n @db.close unless @db.nil?\n Gtk.main_quit\n end",
"def destroy\n @chatty_crow_channel.destroy\n flash[:notice] = l(:notice_successful_delete)\n redirect_to_plugin_settings\n end",
"def destroy_and_respond(thing, parent)\n thing.destroy\n if request.format.html? || request.format.js?\n redirect_to(parent,\n notice: t(:delete_success, thing: thing.model_name.human))\n else\n head :no_content\n end\n end",
"def remove_child_link(name, url, f)\n f.hidden_field(:_destroy) + link_to(name, url, :class => \"remove_child\")\n end",
"def on_delete(&block)\n on('delete-event', &block)\n end",
"def delete\n begin \n # file_assets\n file_assets.each do |file_asset|\n file_asset.delete\n end\n # We now reload the self to update that the child assets have been removed...\n reload()\n # Call ActiveFedora Deleted via super \n super()\n rescue Exception => e\n raise \"There was an error deleting the resource: \" + e.message\n end\n end",
"def destroy\n @admin_father.destroy\n respond_to do |format|\n format.html { redirect_to admin_fathers_url, notice: 'Father was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n get_message().delete\n end",
"def destroy\n @miscellaneous_child = MiscellaneousChild.find(params[:id])\n @miscellaneous_child.destroy\n\n respond_to do |format|\n format.html { redirect_to(miscellaneous_children_url) }\n format.xml { head :ok }\n end\n end",
"def delete\n \n end",
"def destroy\r\n end",
"def destroy \n \n end",
"def _destroy_delete\n delete\n end",
"def _destroy_delete\n delete\n end",
"def delete\n end",
"def destroy\n @three_child_history.destroy\n respond_to do |format|\n format.html { redirect_to three_child_histories_url, notice: 'Three child history was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ministry_picture_child = MinistryPictureChild.find(params[:id])\n redirect_id = @ministry_picture_child.ministry_id\n @ministry_picture_child.destroy\n\n \n respond_to do |format|\n format.html { redirect_to ministry_child_path(redirect_id), notice: 'The picture has been removed.' }\n format.json { head :no_content }\n end\n end",
"def reply\n reply = super\n reply.remove_children :open\n reply.remove_children :close\n reply.remove_children :data\n reply\n end",
"def destroy\n @fact = Fact.find(params[:id])\n\t\t@parent = @fact.parent\n @fact.destroy\n\n respond_to do |format|\n format.html { redirect_to \"/nuniverse-of/#{@parent.unique_name}\" }\n format.xml { head :ok }\n end\n end",
"def destroy\n end",
"def destroy\n \n end",
"def destroy\n \n end",
"def destroy\n \n end",
"def destroy\n \n end",
"def destroy\n \n end",
"def destroy\n \n end",
"def destroy\n end",
"def destroy\n end"
] | [
"0.62881494",
"0.6238443",
"0.61743945",
"0.61639905",
"0.6120463",
"0.6096221",
"0.60895956",
"0.60895956",
"0.6085373",
"0.6080045",
"0.6080045",
"0.6077248",
"0.6077248",
"0.60456216",
"0.60021025",
"0.5979875",
"0.59796023",
"0.59796023",
"0.59796023",
"0.59796023",
"0.59796023",
"0.59796023",
"0.59796023",
"0.59796023",
"0.59796023",
"0.59796023",
"0.59754115",
"0.5971651",
"0.59692127",
"0.59692127",
"0.595018",
"0.5947186",
"0.59450144",
"0.59430975",
"0.59430975",
"0.59430975",
"0.59430975",
"0.59278405",
"0.5906227",
"0.59061754",
"0.5878572",
"0.587593",
"0.58725953",
"0.58725953",
"0.5863536",
"0.5850775",
"0.58496445",
"0.5847985",
"0.5847985",
"0.58474064",
"0.5846088",
"0.5840757",
"0.5839478",
"0.58329",
"0.5818657",
"0.5817766",
"0.58094317",
"0.58070546",
"0.5794236",
"0.5786722",
"0.5786121",
"0.5786121",
"0.5786121",
"0.5786121",
"0.5786121",
"0.5785222",
"0.5782304",
"0.5779342",
"0.57628524",
"0.5761538",
"0.5760786",
"0.5751778",
"0.5748661",
"0.5741975",
"0.5737709",
"0.5734436",
"0.57281584",
"0.5727365",
"0.57273626",
"0.5726325",
"0.5718027",
"0.5714795",
"0.57142293",
"0.5713884",
"0.5712173",
"0.5708962",
"0.5708962",
"0.56980807",
"0.56941885",
"0.5691384",
"0.56912667",
"0.5686101",
"0.5678409",
"0.5676814",
"0.5676814",
"0.5676814",
"0.5676814",
"0.5676814",
"0.5676814",
"0.5676528",
"0.5676528"
] | 0.0 | -1 |
Internal handler for GUILD_ROLE_UPDATE | def update_guild_role(data)
role_data = data['role']
server_id = data['guild_id'].to_i
server = @servers[server_id]
new_role = Role.new(role_data, self, server)
role_id = role_data['id'].to_i
old_role = server.roles.find { |r| r.id == role_id }
old_role.update_from(new_role)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n # this action is not provided for partyroles\n end",
"def update\n @user = User.find(params[:id])\n unless changing_his_own_role?(@user)\n User.update_all(params[:user], {:id => @user.id})\n # if @user.update_attribute(:role, params[:user][:role])\n # if @user.send(:attributes=, {:role => params[:user][:role]})\n flash[:notice] = \"User role updated!\"\n redirect_to admin_users_path\n # else\n # flash[:notice] = \"didn`t work\"\n # redirect_to admin_users_path\n # end\n else\n flash[:notice] = \"Can`t overwrite your own rights!\"\n redirect_to admin_users_path\n end\n end",
"def update\n \n if request.get?\n @role = Role.find(params[:id].to_i)\n else\n @role = Role.find(params[:id].to_i)\n\n # set parent role\n if not params[:role][:parent].to_s.empty?\n @role.parent = Role.find(params[:role][:parent])\n else\n @role.parent = nil\n end\n\n # get an array of static permissions and set the permission associations\n params[:role][:static_permissions] = [] if params[:role][:static_permissions].nil?\n permissions = params[:role][:static_permissions].collect { |i| StaticPermission.find(i) }\n @role.static_permissions = permissions\n\n if @role.update_attributes(params[:role])\n flash[:success] = 'Role has been updated successfully.'\n redirect_to :action => 'show', :id => @role\n else\n render :action => 'update'\n end\n end\n \n rescue RecursionInTree\n @role.errors.add :parent, \"must not be a descendant of itself\"\n render :action => 'update'\n rescue ActiveRecord::RecordNotFound\n flash[:error] = 'You sent an invalid request.'\n redirect_to :action => 'list'\n end",
"def update\n # add a blank set of ids, so that we can actually remove roles\n user_hash = {:role_ids => []}\n # merge in what the user has selected\n user_hash = (params[:user].has_key?(:role_ids) ? params[:user] : params[:user].merge({:role_ids => []})) if params[:user]\n # locate the admin role id\n admin_role_id = Role.find_by_title('administrator').id\n # don't let the current user remove their administrative role\n if @object == current_user && @object.is_administrator? && !user_hash[:role_ids].include?(admin_role_id.to_s)\n user_hash[:role_ids] = user_hash[:role_ids] << admin_role_id\n flash[:warning] = 'You cannot remove the administrator role from yourself.'\n end\n # check for new email\n if !params[:user][:new_email].blank? && !params[:user][:email].eql?(params[:user][:new_email])\n params[:user][:email] = params[:user][:new_email]\n params[:user][:new_email] = nil\n end\n # execute the standard CrudController update\n super\n end",
"def update\n @user = User.find(params[:user_id])\n @roles = Role.all\n \n if current_user.is_admin?\n @user.roles.clear\n @roles.each do |role|\n if (params[:role][:role][role.rolename][:hasrole].to_s == 1.to_s)\n @user.roles << role\n end\n end\n else\n @roles.each do |role|\n if !role.admin_only\n if @user.has_role?(role.rolename)\n @user.roles.destroy(role)\n end\n if (params[:role][:role][role.rolename][:hasrole].to_s == 1.to_s)\n @user.roles << role\n end\n end\n end\n end\n \n flash[:notice] = I18n.t(\"user.success.roles_updated\")\n reload_page\n \n end",
"def update\n respond_to do |format|\n if role.update(role_params) && update_users_roles\n format.html { redirect_to admin_role_path(role), notice: 'Role was successfully updated.' }\n format.json { render :show, status: :ok, location: role }\n else\n format.html { render :edit }\n format.json { render json: role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def handle_role_change role:\n membership = @project.memberships.where(user_id: @user.id).first\n\n if membership\n previous_role = membership.role\n\n if membership.update(role: role)\n AuditService.log(\n context: audit_context,\n action: action_name,\n auditable: @project,\n associated: membership.user,\n data: {\n previous_role: previous_role,\n new_role: role,\n member_id: membership.user.id,\n member_name: membership.user.name,\n member_email: membership.user.email\n }\n )\n\n render json: membership, serializer: ProjectMembershipSerializer\n else\n render_model_errors membership.errors\n end\n else\n render_error 'User is not a team member of the project', :bad_request\n end\n end",
"def update\n\t\t@role = Role.find(params[:id])\n\t\t@role.update_accessor(current_user)\n\t\trespond_to do |format|\n\t\t\tif @role.update_attributes(params[:role])\n\t\t\t\tflash[:notice] = t(:ctrl_object_updated,:typeobj =>t(:ctrl_role),:ident=>@role.title)\n\t\t\t\tshow_\n\t\t\t\tformat.html { render :action => \"show\" }\n\t\t\t\tformat.xml { head :ok }\n\t\t\telse\n\t\t\t\tflash[:error] = t(:ctrl_object_not_updated,:typeobj =>t(:ctrl_role),:ident=>@role.title, :error => @role.errors.full_messages)\n\t\t\t\tformat.html { render :action => \"edit\" }\n\t\t\t\tformat.xml { render :xml => @role.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def update\n if !grant_access(\"alter_roles\", current_user)\n head(403)\n end\n @role.user_id = current_user.id\n @role.start_point = false if !params[:role][:start_point]\n respond_to do |format|\n if @role.update(role_params)\n format.html { redirect_to @role, notice: 'Role was successfully updated.' }\n format.json { render :show, status: :ok, location: @role }\n else\n format.html { render :edit }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n load_user\n build_user\n assign_roles\n save_user or render :edit\n end",
"def update\n authorize(current_user)\n role = params[:user][:role_ids]\n roleModel =Role.find( role)\n if @user.setRole roleModel.name\n @user.save\n redirect_to users_path, :notice => \"Rolle geändert\"\n else\n redirect_to users_path, :notice => \"Rolle nicht geändert\"\n end\n end",
"def update\n authorize! :update, @user, :message => \"No puedes tienes acceso a esta opcion.\"\n if @user.is_admin? \n @user.remove_role :admin\n end\n if @user.is_adminInv?\n @user.remove_role :adminInv \n end\n if @user.is_adminExt?\n @user.remove_role :adminExt\n end\n if @user.is_investigador?\n @user.remove_role :Investigador\n end\n \n @user.add_role(params[:role])\n @user.update(user_params)\n redirect_to usuarios_path, notice: 'Usuario fue actualizado.'\n end",
"def update\n authorize! :assign_roles, @user if params[:user][:assign_roles]\n if @user.update_attributes(params[:user])\n redirect_to @user, notice: 'User was successfully updated.'\n else\n render \"edit\"\n end\n end",
"def update\n ActiveRecord::Base.transaction do\n @role, hash = fill_role(Role.find(params[:id]), params[:role])\n\n respond_to do |format|\n if @role.update_attributes(hash) && @role.save\n flash[:notice] = 'Role was successfully updated.'\n format.html { redirect_to(@role) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @role.errors, :status => :unprocessable_entity }\n end\n end\n end\n end",
"def update\n respond_to do |format|\n if @role.update_attributes(params[:role])\n format.html { redirect_to admin_roles_path, notice: 'Role was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_role\n\t\t@role = Role.find(params[:id])\n\n\t \trespond_to do |format|\n\t\t if @role.update_attributes(role_update_params)\n\t\t format.html { redirect_to(@role, :notice => 'Entry was successfully updated.') }\n\t\t format.json { respond_with_bip(@role) }\n\t\t else\n\t\t format.html { render :action => \"edit\" }\n\t\t format.json { respond_with_bip(@role) }\n\t\t end\n\n \t end\n\tend",
"def update\n @role = get_role\n if @role.update_attributes(get_attributes) and not request.xhr?\n flash[:notice] = t(@current_role == @role ?\n 'update.alt_success' :\n 'update.success',\n :scope => get_i18n_scope)\n end\n respond_with @event, @role, :location => @current_user.role == 'user' ?\n @event :\n {:action => 'index'}\n end",
"def update\n return unless check_permission\n\n respond_to do |format|\n if @role.update(role_params)\n format.html { redirect_to @role, notice: 'Role was successfully updated.' }\n else\n @users = User.all\n format.html { render :edit }\n end\n end\n end",
"def update_role\n @user = User.find(params[:id])\n\n # Limit access to authorized users\n authorize! :manage, @user\n\n @user.admin = params[:admin_role]\n respond_to do |format|\n if @user.save\n format.json { head :no_content }\n else\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @role.update_attributes params_for_role\n flash[:notice] = \"Role successfully updated.\"\n\n redirect_to(role_path @role)\n else\n flash[:error] = \"Unable to update role.\"\n\n render(:edit)\n end # if-else\n end",
"def update_role\n role = Role.find(params[:role_id])\n flash[:alert] = I18n.t(\"administrator.roles.invalid_update\") unless update_permissions(role)\n redirect_to admin_roles_path(selected_role: role.id)\n end",
"def update\n @admin_role = Role.find(params[:id])\n\n respond_to do |format|\n if @admin_role.update_attributes(params[:admin_role])\n format.html { redirect_to @admin_role, notice: 'Role was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @role = Role.find(params[:id])\n authorize @role\n\n if @role.update(access: role_params[:access])\n deliver_if(recipients: @role.user, key: 'users.added_as_coowner') do |_r|\n UserMailer.permissions_change_notification(@role, current_user).deliver_now\n end\n render json: {\n code: 1,\n msg: format(_('Successfully changed the permissions for %{email}. They have been\n notified via email.'), email: @role.user.email)\n }\n else\n render json: { code: 0, msg: flash[:alert] }\n end\n end",
"def update\n @user_role = UserRole.find(params[:id])\n\n respond_to do |format|\n if @user_role.update_attributes(params[:user_role])\n flash[:notice] = 'UserRole was successfully updated.'\n format.html { redirect_to([:admin, @user_role]) }\n else\n format.html { render :action => \"edit\" }\n end\n end\n end",
"def update\n @role = Role.find(params[:id])\n\n if @role.update_attributes(params[:role])\n redirect_to admin_roles_url\n else\n render :action => \"edit\"\n end\n end",
"def update\n respond_to do |format|\n if @role.update(safe_params)\n format.html { redirect_to [@company, @role], notice: 'Role was successfully updated.' }\n format.json { render :show, status: :ok, location: @role }\n else\n format.html { render :edit }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n authorize! :update, @user\n authorize! :update, (user_params[:role_id].present? ? Role.find(user_params[:role_id]) : Role)\n\n respond_to do |format|\n if @user.update(user_params)\n format.html { redirect_to @user, notice: I18n.translate('users.flash.update.success', user: @user.fullname) }\n format.json { render :show, status: :ok, location: @user }\n else\n format.html { render :edit, notice: I18n.translate('users.flash.update.fail', user: @user.fullname) , status: :unprocessable_entity}\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"def update_role(auth, server_id, role_id, name, color, hoist, mentionable, permissions, reason = nil)\n MijDiscord::Core::API.request(\n :guilds_sid_roles_rid,\n server_id,\n :patch,\n \"#{MijDiscord::Core::API::APIBASE_URL}/guilds/#{server_id}/roles/#{role_id}\",\n {\n color: color, name: name, hoist: hoist,\n mentionable: mentionable, permissions: permissions\n }.delete_if {|_, v| v.nil? }.to_json,\n Authorization: auth,\n content_type: :json,\n 'X-Audit-Log-Reason': reason\n )\n end",
"def update!(**args)\n @role = args[:role] if args.key?(:role)\n @role_id = args[:role_id] if args.key?(:role_id)\n end",
"def update # for changing user's role\n @user = User.find(params[:id])\n if @user.update_attributes(params[:user]) # , :as => :admin)\n @user.update_role(role) unless role.nil?\n redirect_to users_path, :notice => \"User updated.\"\n else\n redirect_to users_path, :alsert => \"Unable to update user.\"\n end\n end",
"def update\n @str = nil\n @alert = nil\n @rolid = @role.id\n\n if @role.update(role_params)\n @str = 'Role was successfully updated'\n @alert = 'panel-success'\n else\n @str = @role.errors.full_messages\n @alert = 'panel-danger'\n @role = nil\n end\n end",
"def update\n respond_to do |format|\n if @manage_admin.update(manage_admin_params)\n\n # 保存角色信息\n roles_id=params[:roles]\n @manage_admin.roles_in_id=roles_id\n\n format.html { redirect_to @manage_admin, notice: '管理员信息更新成功.' }\n\n format.json { render :show, status: :ok, location: @manage_admin }\n else\n format.html { render :edit,notice:'修改失败'}\n format.json { render json: @manage_admin.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n @role = Role.find(params[:id])\r\n \r\n if @role.update_attributes(params[:role])\r\n msg= \"Role updated successfully!\"\r\n else\r\n msg= \"Role update failed!\"\r\n end\r\n redirect_to roles_path, :flash => { :notice => msg }\r\n end",
"def upgrade_to_main_user\n self.is_main_user = true \n self.save \n \n admin_role = Role.find_by_name(USER_ROLE[:admin]) \n self.add_role_if_not_exists(admin_role ) \n end",
"def update\n @role = Role.find(params[:id])\n \n @perms = params[:permissions[\"permissions\"]]\n if @perms != nil\n @permissions = @perms[\"permissions\"]\n end\n #logger.debug \"PERMISSIONS: #{@permissions.inspect}\"\n if @permissions == nil\n @role.read = 0\n @role.write = 0\n @role.execute = 0\n end\n if @permissions != nil\n if @permissions.include?(\"read\")\n @role.read = 1\n else\n @role.read = 0\n end\n if @permissions.include?(\"write\")\n @role.write = 1\n else\n @role.write = 0\n end\n if @permissions.include?(\"execute\")\n @role.execute = 1\n else\n @role.execute = 0\n end\n end\n\n respond_to do |format|\n if @role.update_attributes(params[:role])\n format.html { redirect_to @role, notice: t(:role_updated) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @sulabh_user_role.update(sulabh_user_role_params)\n format.html { redirect_to @sulabh_user_role, notice: 'Sulabh user role was successfully updated.' }\n format.json { render :show, status: :ok, location: @sulabh_user_role }\n else\n format.html { render :edit }\n format.json { render json: @sulabh_user_role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @screen = session.active_screen\n @form_content_reuse = params[:form_content_reuse]\n \n @role = Role.find(params[:id]) \n @role.user_ids.each{|u_id| User.find(u_id).update_attributes( :updated_at => Time.now ) }\n @role.users.clear\n @role.users = User.find(params[:role][:user_ids]) unless params[:role][:user_ids].nil?\n @role.user_ids.each{|u_id| User.find(u_id).update_attributes( :updated_at => Time.now ) }\n \n @role.update_attributes(params[:role])\n\n respond_to do |format|\n format.html # create.html.erb\n format.xml { render :xml => @role }\n end\n end",
"def update\n @role = Role.find(params[:id])\n\n respond_to do |format|\n if @role.update_attributes(params[:role])\n format.html { redirect_to edit_role_path(@role), :notice => t('hurricane.notice.update_record_success', :type => t_type)}\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @role.update(system_role_params)\n format.html { redirect_to system_roles_url, notice: '更新角色成功.' }\n format.json { render :index, status: :ok, location: @role }\n else\n format.html { render :edit }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n params[:user][:role_ids] ||= []\n @user = User.find(params[:id])\n # @user.roles = Role.find(params[:role_ids]) if params[:role_ids]\n @session_user = session[:user]\n if @session_user.is_super_admin\n @roles = Role.find(:all)\n else\n @roles = Role.find(:all, :conditions => [\"id <> 1\"])\n end\n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:notice] = 'User was successfully updated.'\n if permitted_to? :index, User.new\n format.html { redirect_to(@user) }\n else\n format.html { redirect_to(:root) }\n end\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @role.update(role_params)\n format.html {\n redirect_to dashboard_path\n flash[:success] = @role.name+' was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n #@user = current_user\n ### Save the user roles when saving the user\n #@user.attributes = params[:user]\n check_and_set_role && @user.attributes = params[:user]\n @user.save do |result|\n respond_to do |format|\n if result\n flash[:notice] = \"User #{@user.username} profile was successfully updated.\"\n format.html { redirect_to(@user) } \n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end\n end",
"def update\n @user.roles=params[\"user\"][\"roles\"]\n respond_to do |format|\n if @user.update(event_params)\n format.html { redirect_to users_path, notice: 'User roles change successfully' }\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",
"def update\n @user = User.find(params[:id])\n if @user.update_attributes(params[\"#{@user.role}\"].merge(:role =>params[\"#{@user.role}\"][:type].blank? ? '':(params[\"#{@user.role}\"][:type].split(/([[:upper:]][[:lower:]]*)/).delete_if(&:empty?).join(\"_\").downcase)))\n flash[:notice] = 'Updated Successfully!'\n redirect_to admin_users_path\n else\n puts @user.errors.inspect\n flash[:error] = 'Updation Failed!'\n render :action => 'edit'\n end\n end",
"def update!(**args)\n @iam_check_required = args[:iam_check_required] if args.key?(:iam_check_required)\n @role_type = args[:role_type] if args.key?(:role_type)\n end",
"def update\n respond_to do |format|\n if @entity_role.update(entity_role_params)\n format.html { redirect_to @entity_role, notice: 'Entity role was successfully updated.' }\n format.json { render :show, status: :ok, location: @entity_role }\n else\n format.html { render :edit }\n format.json { render json: @entity_role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_role\n @user = User.find( params[:id] )\n @user.update_attributes(params[:user])\n redirect_to users_path\n end",
"def update\n @user_space_role = UserSpaceRole.find(params[:id])\n\n respond_to do |format|\n if @user_space_role.update_attributes(params[:user_space_role])\n flash[:notice] = 'UserSpaceRole was successfully updated.'\n format.html { redirect_to(@user_space_role) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user_space_role.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @user.update(user_params)\n @user.role = Role.find(params[:role][:id]) if current_user.can_write?\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if current_user.isAdmin? and User.where(:role => \"admin\").count == 1 and user_params[:role]==\"user\" and current_user.id == @user.id\n redirect_to user_path, notice: \"It is not possible to update the role while being the only admin.\"\n else\n respond_to do |format|\n if @user.update(user_params)\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\n end",
"def update\n flash.now[:notice] = 'Role was successfully updated.' if @role.update role_params\n respond_with @role\n end",
"def update_role\n organisation_change_notice = nil\n @role = Role.find(params[:id])\n \n\tprev_organisation = @role.organisation\n \n\t# if the editing user does have permission to publish CRM, set the role status to 'Pending'\n\t@role.status_id = Status::PENDING.status_id if !PrivilegesHelper.has_permission?(@login, 'CAN_PUBLISH_CRM')\n\t\n\tis_contributor = @role.is_contributor\n\tis_contributor = params[:role][:is_contributor] if (@role.contributor.blank? && !params[:role][:is_contributor].blank?) || (! @role.contributor.blank? && @role.contributor_info_empty?)\n\t\n\t@role.send('is_contributor=', is_contributor)\n\tparams[:role][:is_contributor] = is_contributor\n\t\n\tif !params[:role][:role_type_id].blank? && @role.is_a_contributor? && !RoleType.contributor_role_types.include?(RoleType.find(params[:role][:role_type_id]))\n \n\t flash[:error] = \"An error has occured. You cannot change the role type to a non-contributor type if 'Contributor' field is checked.\"\n\t \n\t redirect_to :action => 'edit', :id => @role\n\t\n\telse\n\t\t\t\n\t if @role.update_attributes(params[:role])\n\n\t if ! @role.person_id.blank? && !params[:role][:organisation_id].blank?\n\t\t # create default_contactinfos\n\t\t # for every person's contactinfo and appropriate\n\t\t # organisation contactinfo\n\t\t @role.default_contactinfos_update\n\t end \n\t \t \n organisation_change_notice=\"\"\n # role has been assigned an organisation\n if ! @role.person_id.blank? && !params[:role][:organisation_id].blank?\n\t \n\t # destroy marketing categorisation of the person from the db\n\t # as person gets marketing categorisation of the organisation\n\t @role.role_categorizations.each do |rc|\n\t \t rc.destroy\n\t end\n\t \n organisation_change_notice = \"<br/> The organisation has been changed. Please check and update the contact information and make sure that it is consistent.\"\n end\n \n # delete default_contactinfo if organisation was previously\n # assigned to a role together with person but has been deleted\n if @role.organisation_id.blank? && !@role.person_id.blank? && !prev_organisation.blank?\n # do we need to default it to 'Person' or 'preferred' contact infos????\n \t # if yes, just call @role.default_contactinfos_update instead of the line below\n\t\t @role.delete_default_contactinfos(prev_organisation.organisation_id)\n end\n \n # update all role role_contactinfos for\n # solr indexing\n RoleContactinfo.index_objects(@role.role_contactinfos)\n \n # update all communications for\n # solr indexing\n Communication.index_objects(@role.communications)\n \n # update appropriate person if any\n # for solr idexing\n if ! @role.person.blank?\n @role.person.save\n end\n\n # destroy contributor record if 'is_contributor' of the role set to false\n @role.contributor.destroy_self if ! @role.contributor.blank? && ! @role.is_a_contributor?\n\n flash[:notice] = 'Role was successfully updated.' + organisation_change_notice\n redirect_to :action => 'edit', :id => @role\n else\n @person = @role.person\n @organisation = @role.organisation unless @role.organisation.blank?\n render :action => 'edit', :id => @role\n end\n \n\tend\n \n end",
"def update\n @group = @authorized_group\n @user = User.find(params[:id])\n if @user.id != @current_user.id\n role_mapping = RoleMapping.find_by_group_id_and_user_id(@group.id, @user.id)\n role_mapping_attr = Hash.new\n role_mapping_attr['group_id'] = @group.id\n role_mapping_attr['user_id'] = @user.id\n role_mapping_attr['role_by_array'] = params[:role_by_array]\n end\n\n respond_to do |format|\n if role_mapping\n role_mapping.role = \"\"\n result = @user.update_attributes(params[:user]) && role_mapping.update_attributes(role_mapping_attr)\n else\n result = @user.update_attributes(params[:user])\n end\n if result\n flash[:notice] = \"ユーザ #{@user.login_name} の情報を更新しました\"\n format.html { redirect_to group_users_url(@group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @security_role_type.user_updated_id = current_user.id\n respond_to do |format|\n if @security_role_type.update(security_role_type_params)\n format.html { redirect_to @security_role_type, notice: I18n.t('role_types.controller.update') }\n format.json { render :show, status: :ok, location: @security_role_type }\n else\n format.html { render :edit }\n format.json { render json: @security_role_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @role_user = RolesUser.find(params[:id])\n @role_user.role_id = $new_role_id\n respond_to do |format|\n if @role_user.update_attributes(params[:role_user])\n flash[:notice] = 'CADASTRADO COM SUCESSO.'\n format.html { redirect_to(@role_user) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @role_user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @sys_role.update(sys_role_params)\n format.html { redirect_to @sys_role, notice: 'Sys role was successfully updated.' }\n format.json { render :show, status: :ok, location: @sys_role }\n else\n format.html { render :edit }\n format.json { render json: @sys_role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def UpdateRole params = {}\n \n APICall(path: 'custom_roles.json',method: 'PUT',payload: params.to_json)\n \n end",
"def update\n flash[:success] = \"%s (%s) roles were updated successfully.\" % [ @user_role.user.nickname, @user_role.user.email ] if @user_role.update_attributes(user_role_params)\n redirect_to organization_users_path( @organization )\n end",
"def update\n @previous_login = @user.login\n @previous_role = @user.role\n @user.update_attributes(params[:user])\n if @user.errors.empty?\n redirect_to ucs_path(@user)\n else\n \"edit\"\n end\n end",
"def check_role_update\n unless current_user.is_admin?\n params[:user][:is_admin] = \"0\"\n params[:user][:is_moderator] = \"0\"\n params[:user][:is_sales] = \"0\"\n end\n end",
"def update_super_admin_role\n service_response = ManagerManagement::Team::UpdateSuperAdminRole.new(params).perform\n return render_api_response(service_response)\n end",
"def update\n @user = User.find_by_username params[:username]\n raise ActiveRecord::RecordNotFound unless @user\n @user_role = Role.find_by_name('User')\n @roles = Role.all.order(:name)\n\n if params[:user][:current_password] # the user is changing their password\n command = ChangePasswordCommand.new(\n @user, params[:user][:current_password],\n params[:user][:password],\n params[:user][:password_confirmation],\n current_user,\n request.remote_ip)\n begin\n command.execute\n rescue ValidationError\n render 'edit'\n rescue => e\n flash['error'] = \"#{e}\"\n render 'edit'\n else\n flash['success'] = @user == current_user ?\n 'Your password has been changed.' :\n \"#{@user.username}'s password has been changed.\"\n keep_flash\n redirect_to edit_user_url(@user)\n end\n elsif params[:user][:desired_institution_id] # the user is changing their institution\n new_institution = Institution.find(params[:user][:desired_institution_id])\n command = JoinInstitutionCommand.new(@user, new_institution,\n current_user, request.remote_ip)\n begin\n command.execute\n rescue ValidationError\n render 'edit'\n rescue => e\n flash['error'] = \"#{e}\"\n render 'edit'\n else\n if @user.institution == new_institution # already joined, which means an admin did it\n flash['success'] = \"#{@user.username} is already a member of \"\\\n \"#{new_institution.name}.\"\n else\n flash['success'] = \"An administrator has been notified and will \"\\\n \"review your request to join #{new_institution.name} momentarily,\"\n end\n keep_flash\n redirect_to dashboard_path\n end\n else # the user is changing their basic info\n command = UpdateUserCommand.new(@user, user_update_params, current_user,\n request.remote_ip)\n begin\n command.execute\n rescue ValidationError\n # Gather institutions for the institution select menu.\n set_institutions_ivar\n render 'edit'\n rescue => e\n flash['error'] = \"#{e}\"\n\n # Gather institutions for the institution select menu.\n set_institutions_ivar\n render 'edit'\n else\n flash['success'] = @user == current_user ?\n 'Your profile has been updated.' :\n \"#{@user.username}'s profile has been updated.\"\n keep_flash\n redirect_to edit_user_url(@user)\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n params[:user].delete(:id)\n if params[:user][:password].blank? or params[:user][:password_confirmation].blank?\n sign_in_user = true\n else\n sign_in_user = false\n end\n params[:user].delete(:password) if params[:user][:password].blank?\n params[:user].delete(:password_confirmation) if params[:user][:password_confirmation].blank?\n params[:user].delete(:avatar) if params[:user][:avatar].blank?\n if can? :update, Userrole\n params[:foo] = params[:user][:userrole_ids]\n params[:user][:userrole_ids].each do |new_userrole_id|\n unless new_userrole_id.blank?\n new_userrole = Userrole.find(new_userrole_id)\n @user.userroles << new_userrole unless @user.userroles.include?(new_userrole)\n end\n end\n @user.save\n params[:user].delete(:userrole_ids)\n end\n respond_to do |format|\n if @user.update_attributes(params[:user])\n pronoun = ' ' + @user.username\n pronoun_possessive = @user.username + \"'s'\"\n redirect_notice = ' will need to log in again.'\n if current_user?(@user)\n pronoun = ' You'\n pronoun_possessive = \"Your\"\n end\n if sign_in_user\n sign_in @user if current_user?(@user)\n pronoun = ''\n redirect_notice = ''\n end\n format.html { redirect_to(@user, :notice => pronoun_possessive + ' information has been updated.' + pronoun + redirect_notice) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @role.update_attributes(params[:role])\n flash[:notice] = 'Role was successfully updated.'\n format.html { redirect_to(role_path(@role.slug)) }\n format.xml { head :ok }\n else\n format.html { render \"edit\" }\n format.xml { render :xml => @role.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @company = Company.find(params[:company_id])\n @role = Role.find(params[:id])\n \n respond_to do |format|\n if @role.update_attributes(params[:role])\n format.html { redirect_to company_role_path(@company, @role), notice: 'El rol fue editado exitosamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n resource.update_attributes params[params_key], as: current_role\n respond_with resource\n end",
"def update\n respond_to do |format|\n if params[:btn_cancel].present?\n format.html { redirect_to @core_user_role}\n format.json { head :no_content }\n elsif @core_user_role.update(core_user_role_params)\n format.html { redirect_to @core_user_role, notice: 'User role was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @core_user_role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @user_to_role.update(user_to_role_params)\n format.html { redirect_to @user_to_role, notice: 'User to role was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_to_role }\n else\n format.html { render :edit }\n format.json { render json: @user_to_role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n \n # this dirty check does not work\n \n #if @role.pool_display_name != params[:role][:pool_display_name]\n # @person = Person.find(1000000 + params[:id].to_i)\n # @person.first_name = @role.pool_display_name\n # @person.save\n #end\n \n respond_to do |format|\n if @role.update(role_params)\n format.html { redirect_to @role, notice: 'Role was successfully updated.' }\n format.json { render :show, status: :ok, location: @role }\n else\n format.html { render :edit }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @security_agent_role.update(security_agent_role_params)\n format.html { redirect_to @security_agent_role, notice: 'Security agent role was successfully updated.' }\n format.json { render :show, status: :ok, location: @security_agent_role }\n else\n format.html { render :edit }\n format.json { render json: @security_agent_role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @role.update_attributes(role_params)\n flash[:notice] = 'Role was successfully updated.'\n format.html { redirect_to(role_path(@role.slug)) }\n format.xml { head :ok }\n else\n format.html { render \"edit\" }\n format.xml { render :xml => @role.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @roles_privilege.update(roles_privilege_params)\n format.html { redirect_to @roles_privilege, notice: 'Roles privilege was successfully updated.' }\n format.json { render :show, status: :ok, location: @roles_privilege }\n else\n format.html { render :edit }\n format.json { render json: @roles_privilege.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @role = Role.find(params[:role][:id])\n\n if @role.update_attributes(params[:role])\n flash['notice'] = 'Role was successfully updated.'\n redirect_to :action => 'edit', \n :id => params[:role][:id]\n else\n flash['notice'] = 'Role not updated'\n redirect_to :action => 'edit', \n :id => params[:role][:id]\n end\n \n\n end",
"def update\n @role = Role.find_by_name(params[:name])\n \n respond_to do |format|\n @role.authorities = Authority.find_by_name(params[:authority_names])\n format.html { redirect_to(my_gem_role_path(@role.name),\n :notice => 'Role was successfully updated.') }\n format.xml { head :ok }\n end\n end",
"def update\n @member = Member.find(params[:id])\n\n @roles = Role.find(:all)\n\n\t\tif params[:commit] == \"Update Member\"\n\t\t\tchecked_roles = []\n\t\t\tchecked_params = params[:role_list] || []\n\t\t\t\tfor check_box_id in checked_params\n\t\t\t\t\trole = Role.find(check_box_id)\n\t\t\t\tif not @member.user.roles.include?(role)\n\t\t\t\t\t@member.user.roles << role\n\t\t\t\tend\n\t\t\tchecked_roles << role\n\t\t\tend\n\t\t\tmissing_roles = @roles - checked_roles\n\t\t\tfor role in missing_roles\n\t\t\t\tif @member.user.roles.include?(role)\n\t\t\t\t@member.user.roles.delete(role)\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to @member, :notice => 'Member was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @member.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @role.update_attributes(params[:role])\n flash[:notice] = 'Role was successfully updated.'\n format.html { redirect_to(@role) }\n format.xml { head :ok }\n format.js\n else\n @possible_permissions = Permission.by_category(@role.category)\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @role.errors, :status => :unprocessable_entity }\n format.js\n end\n end\n end",
"def update\n respond_to do |format|\n if @role.update(role_params)\n format.html { redirect_to @role, notice: 'Role was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def change_role\n #originally copied from:\n #https://git.thm.de/thsg47/gamification/blob/master/app/controllers/course/members_controller.rb\n\n role = params[:member][:role]\n\n if @member == @current_member\n flash[:error] = 'Du darfst deine eigene Rolle nicht ändern!'\n elsif @member.role_greater_than? @current_member.role\n flash[:error] = 'Das Team Mitglied hat mehr Rechte als du!'\n elsif @current_member.role_less_than? role\n flash[:error] = 'Du willst dem Mitglied mehr Rechte geben als du hast!'\n elsif @member.role != role\n role_was = @member.role\n @member.role = role.to_sym\n if @member.save\n flash[:notice] = \"Die Rolle von #{@member.user.name} wurde von #{role_was} zu #{@member.role} geändert.\"\n else\n flash[:error] = 'Etwas ist beim speichern schief gegangen....'\n end\n end\n redirect_to team_members_path(@member.team)\n end",
"def update\n @user = User.find(params[:id])\n @user.person.attributes = (params[:person])\n @roles = [Role.find_by_name(params[:user]['role'])]\n @user.roles = @roles\n respond_to do |format|\n if @user.update_attributes(params[:user]) && @user.person.save\n if params[:user][:password].length > 0\n UserNotifier.deliver_password_changed(@user, params[:user][:password]) \n end\n flash[:notice] = 'User was successfully updated.'\n format.html { redirect_to admin_users_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",
"def edit_roles\n if (@user = find_user(params[:id]))\n begin\n User.transaction(@user) do\n \n roles = params[:user][:roles].collect { |role_id| Role.find(role_id) }\n # add any new roles & remove any missing roles\n roles.each { |role| @user.roles << role if !@user.roles.include?(role) }\n @user.roles.each { |role| @user.roles.delete(role) if !roles.include?(role) }\n\n @user.save\n flash[:notice] = \"Roles updated for user '#{@user.login}'.\"\n end\n rescue\n flash[:warning] = 'Roles could not be edited at this time. Please retry.'\n ensure\n redirect_to :back\n end\n else\n redirect_back_or_default :action => 'list'\n end\n end",
"def update\n @role = Role.find(params[:id])\n \n respond_to do |format|\n if @role.update_attributes(params[:role])\n format.html { redirect_to @role, notice: 'Role was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def edit\n @role = current_user.role.name\n super\n end",
"def update\n @role = Role.find(params[:id])\n \n respond_to do |format|\n if @role.update_attributes(params[:role])\n format.html { redirect_to @role, notice: 'Role was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @role_privilege.update(role_privilege_params)\n format.html { redirect_to role_privileges_url, notice: 'Uloga i privilegija su uspješno povezane.' }\n format.json { render :show, status: :ok, location: @role_privilege }\n else\n format.html { render :edit }\n format.json { render json: @role_privilege.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @role_auth_ref.update(role_auth_ref_params)\n format.html { redirect_to @role_auth_ref, notice: 'Role auth ref was successfully updated.' }\n format.json { render :show, status: :ok, location: @role_auth_ref }\n else\n format.html { render :edit }\n format.json { render json: @role_auth_ref.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user_role = UserRole.find(params[:id])\n\n respond_to do |format|\n if @user_role.update_attributes(params[:user_role])\n flash[:notice] = 'UserRole was successfully updated.'\n format.html { redirect_to(@user_role) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user_role.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def change_role(role)\n role_list.each do |old_role|\n remove_role old_role\n end\n puts role\n add_role role\n puts roles\n end",
"def update\n respond_to do |format|\n if @role.update(role_params)\n format.html { redirect_to @role, notice: t('success_update') }\n format.json { render :show, status: :ok, location: @role }\n else\n format.html { render :edit }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @cms_role.update(cms_role_params)\n format.html { redirect_to @cms_role, notice: 'Role was successfully updated.' }\n format.json { render :show, status: :ok, location: @cms_role }\n else\n format.html { render :edit }\n format.json { render json: @cms_role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @company = Company.find(params[:company_id])\n if !can?(:manage, @company)\n raise CanCan::AccessDenied.new(\"Usted no puede administrar otra compañia\", :manage, @company)\n end\n @user = User.find(params[:id])\n @roles = Role.all\n if !params.has_key?(:password_only)\n role_ids = params[:role_ids] if params[:role_ids]\n role_ids ||= []\n @user.role_ids = role_ids\n end\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n if params.has_key?(:password_only)\n format.html { redirect_to show_user_profile_path(@company, @user), notice: 'El perfil fue editado exitosamente.' }\n format.json { head :no_content }\n else \n format.html { redirect_to company_user_path(@company, @user), notice: 'El usuario fue editado exitosamente.' }\n format.json { head :no_content }\n end\n else\n if !params.has_key?(:password_only)\n format.html { render action: \"edit\" }\n else\n format.html { render action: \"edit_password\" }\n end\n \n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @role.update(role_params)\n format.html { redirect_to @role, notice: 'Role was successfully updated.' }\n format.json { render :show, status: :ok, location: @role }\n else\n format.html { render :edit }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_user_role(params)\n self.link.update_attributes(role: params[:rolname], active: params[:active_link])\n end",
"def update\n @user.update(role_id: params[:role])\n @user.save\n redirect_to users_url, notice: 'User was successfully updated.'\n end",
"def update\n respond_to do |format|\n if @role.update(role_params)\n format.html { redirect_to @role, notice: 'Role was successfully updated.' }\n format.json { render :show, status: :ok, location: @role }\n else\n format.html { render :edit }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @role.update(role_params)\n format.html { redirect_to @role, notice: 'Role was successfully updated.' }\n format.json { render :show, status: :ok, location: @role }\n else\n format.html { render :edit }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @fundamental_alliance = Fundamental::Alliance.find(params[:id])\n role = determine_access_role(@fundamental_alliance.leader_id, @fundamental_alliance.id) \n logger.debug \"ROLE: \" + role.to_s\n\n if staff? && !params[:fundamental_alliance][:color_nil].nil?\n @fundamental_alliance.set_color(params[:fundamental_alliance])\n end\n\n raise ForbiddenError.new 'tried to update an alliance without permission.' unless staff? || role == :owner\n\n respond_to do |format|\n if @fundamental_alliance.update_attributes(params[:fundamental_alliance], :as => role)\n format.html { redirect_to @fundamental_alliance, notice: 'Alliance was successfully updated.' }\n format.json { render json: {}, status: :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fundamental_alliance.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n @user.update_roles(params[:selected_roles])\n if @user.update_attributes(params[:user])\n flash[:notice] = 'User was successfully updated.'\n redirect_to(@user)\n else\n #flash[:error] = 'User was not updated. Please try again'\n render :action => \"edit\"\n end\n \n end",
"def update\n @role.attributes = params[:role]\n respond_to do |format|\n if @role.save\n flash[:notice] = 'Role was successfully updated.'\n format.html { redirect_to role_url(@role.code) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @role.errors.to_xml }\n end\n end\n end",
"def update\n flash[:notice] = 'Role was successfully updated.' if @role.update_attributes role_params\n respond_with @role\n end"
] | [
"0.6923584",
"0.6847488",
"0.6814899",
"0.67430526",
"0.6677443",
"0.6673432",
"0.6622177",
"0.661937",
"0.6526311",
"0.651197",
"0.650364",
"0.64796466",
"0.6464701",
"0.6447708",
"0.64433545",
"0.64316726",
"0.63907593",
"0.6352228",
"0.63425064",
"0.6328062",
"0.6317582",
"0.63037676",
"0.63031423",
"0.6284861",
"0.6277492",
"0.6275889",
"0.6272249",
"0.62708205",
"0.6267983",
"0.6265507",
"0.6263933",
"0.6253468",
"0.6245454",
"0.623723",
"0.6234643",
"0.6223936",
"0.62190557",
"0.62164843",
"0.62157565",
"0.6209897",
"0.62043566",
"0.61866426",
"0.61850685",
"0.6184912",
"0.6181654",
"0.6180778",
"0.6173583",
"0.616839",
"0.61627865",
"0.6161377",
"0.61571044",
"0.61565083",
"0.61564577",
"0.615278",
"0.61516225",
"0.61463803",
"0.6145954",
"0.61324495",
"0.61203676",
"0.6118815",
"0.6118756",
"0.61078155",
"0.6101243",
"0.6094351",
"0.60841656",
"0.6080313",
"0.60766065",
"0.60734487",
"0.60647565",
"0.6059837",
"0.60460776",
"0.6044977",
"0.60420156",
"0.60339355",
"0.6029965",
"0.6027113",
"0.60242873",
"0.6022372",
"0.6017348",
"0.601224",
"0.60084647",
"0.60066867",
"0.60061926",
"0.6001619",
"0.59923005",
"0.59902084",
"0.5990145",
"0.5985746",
"0.5983933",
"0.5980332",
"0.59788775",
"0.59674215",
"0.59592736",
"0.59565204",
"0.59565204",
"0.59564835",
"0.5955541",
"0.59422916",
"0.59416497"
] | 0.6409637 | 16 |
Internal handler for GUILD_ROLE_CREATE | def create_guild_role(data)
role_data = data['role']
server_id = data['guild_id'].to_i
server = @servers[server_id]
new_role = Role.new(role_data, self, server)
existing_role = server.role(new_role.id)
if existing_role
existing_role.update_from(new_role)
else
server.add_role(new_role)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n chef_server_rest.post(\"roles\", self)\n self\n end",
"def create\n Statements::CreateRole.new(context: self)\n end",
"def create_user_role\n if self.role.blank?\n id = Role.select{|role| role.role_type == $roles[:user]}.map(&:id)\n self.update_attributes(:role_id => id[0])\n end\n end",
"def create\n if !grant_access(\"edit_roles\", current_user)\n head(403)\n end\n @role = Role.new(role_params)\n @role.user_id = current_user.id\n respond_to do |format|\n if @role.save\n format.html { redirect_to @role, notice: 'Role was successfully created.' }\n format.json { render :show, status: :created, location: @role }\n else\n format.html { render :new }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_role(auth, server_id, name, color, hoist, mentionable, permissions, reason = nil)\n MijDiscord::Core::API.request(\n :guilds_sid_roles,\n server_id,\n :post,\n \"#{MijDiscord::Core::API::APIBASE_URL}/guilds/#{server_id}/roles\",\n { color: color, name: name, hoist: hoist, mentionable: mentionable, permissions: permissions }.to_json,\n Authorization: auth,\n content_type: :json,\n 'X-Audit-Log-Reason': reason\n )\n end",
"def after_create\n super\n check_roles\n end",
"def create_roles\n Role.create_roles(self)\n end",
"def create\n submenu_item 'role_new'\n load_permissions\n ids=params[:permissions].select{|k,v| v=='1'}.map { |k,v| k.to_i } unless params[:permissions].nil?\n if ids.length > 0\n permissions=Permission.find(:all, :conditions => [\"id in (#{ids.join(',')})\"])\n params[:role][:permissions] = permissions\n @role = Role.new(params[:role])\n if @role.save\n flash[:notice] = \"创建角色成功\"\n redirect_to :action => 'index'\n else\n flash[:error] = \"创建角色失败\"\n render :action => 'new'\n end\n else\n flash[:error] = \"角色名或权限不能为空\"\n redirect_to :action => 'new'\n end\n\n end",
"def create_guild_role(data)\n role_data = data['role']\n server_id = data['guild_id'].to_i\n server = @servers[server_id]\n new_role = Role.new(role_data, self, server)\n server.add_role(new_role)\n end",
"def registerRoleByFullname\n if (@role.nil? or @role_level != 'admin') and !current_actor.superadmin\n json_response({ message: \"You don't have permission to create roles for this project\" }, :unauthorized)\n return\n end\n if params[\"fullname\"].nil?\n json_response({ message: \"No fullname provided\" }, :forbidden)\n return\n end\n actor = Actor.find_by fullname: params[\"fullname\"]\n if actor.nil?\n json_response({ message: \"No actor found with that fullname\" }, 404)\n return\n end\n @created_role = Role.create(project_id: @project.id, actor_id: actor.id, role_level_id: \"2\", clusters_permissions: true, services_permissions: true, subscriptions_permissions: true)\n json_response(@created_role, :created)\n end",
"def new\n @role = System::Role.new\n end",
"def create\n \n if request.get?\n @role = Role.new\n else\n @role = Role.new(params[:role])\n\n # assign parent role\n if not params[:role][:parent].to_s.empty?\n @role.parent = Role.find(params[:role][:parent].to_i)\n end\n\n if @role.save\n # set the roles's static permissions to the static permission from the parameters \n params[:role][:static_permissions] = [] if params[:role][:static_permissions].nil?\n @role.static_permissions = params[:role][:static_permissions].collect { |i| StaticPermission.find(i) }\n\n # the above should be successful if we reach here; otherwise we \n # have an exception and reach the rescue block below\n flash[:success] = 'Role has been created successfully.'\n redirect_to :action => 'show', :id => @role.id\n else\n render :action => 'create'\n end\n end\n \n rescue ActiveRecord::RecordNotFound\n flash[:error] = 'You sent an invalid request.'\n redirect_to :action => 'list'\n end",
"def create\n authorize! :create, @user, :message => \"No puedes tienes acceso a esta opcion.\"\n @user = User.new(user_params)\n @user.add_role(params[:role])\n @user.save\n redirect_to usuarios_path, notice: 'Usuario fue creado'\n \n end",
"def create_from_current_user\n @role = create_role(:person => @current_user, :verified => true)\n @role.save\n redirect_to event_url(@event), :notice => \"You have joined the event as a #{@role.class.name}\"\n end",
"def create\n @role = Role.new role_params\n authorize @role\n flash.now[:notice] = 'Role was successfully created.' if @role.save\n respond_with @role\n end",
"def create\n super do\n resource.role_id = 1\n resource.save\n end\n end",
"def create\n\t\t@role = Role.new(params[:role])\n\t\trespond_to do |format|\n\t\t\tif fonct_new_dup?\n\t\t\t\tobject_orig=Role.find(params[:object_orig_id])\n\t\t\tst = @role.create_duplicate(object_orig)\n\t\t\telse\n\t\t\tst = @role.save\n\t\t\tend\n\t\t\tif st\n\t\t\t\tflash[:notice] = t(:ctrl_object_created,:typeobj =>t(:ctrl_role),:ident=>@role.title)\n\t\t\t\tparams[:id]=@role.id\n\t\t\t\tshow_\n\t\t\t\tformat.html { render :action => \"show\" }\n\t\t\t\tformat.xml { render :xml => @role, :status => :created, :location => @role }\n\t\t\telse\n\t\t\t\tflash[:error] = t(:ctrl_object_not_created,:typeobj =>t(:ctrl_role),:ident=>@role.title, :msg => nil)\n\t\t\t\tformat.html { render :action => \"new\" }\n\t\t\t\tformat.xml { render :xml => @role.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def create\n logger.debug(\"Role create\")\n if params[:from] == 'organisation'\n @organisation = Organisation.find(params[:id])\n @role = Role.new(params[:role])\n @role.organisation_id = @organisation.organisation_id\n @from='organisation'\n else\n @person = Person.find(params[:id])\n @role = Role.new(params[:role])\n @role.person_id = @person.person_id\n @from='person'\n end\n \n @role.updated_by = get_user.login_id\n \n\t# if the editing user does have permission to publish CRM, set the role status to 'Pending'\n\t@role.status_id = Status::PENDING.status_id if !PrivilegesHelper.has_permission?(@login, 'CAN_PUBLISH_CRM')\n\t \n if @role.create_self(@login)\n \n\t # Role.crm_privileges_check(@login, @role)\n\t \n\t contact_name = ''\n # name of the contact\n if !@role.person.blank?\n contact_name = ' for ' + @role.person.full_name\n else\n contact_name = ' for ' + @role.organisation.organisation_list_name(true) unless @role.organisation.blank?\n end\n \n flash[:notice] = 'Role' + contact_name + ' was successfully created.'\n redirect_to :controller => 'role_contactinfos', :action => 'edit', :id => @role\n else\n render :action => 'new', :locals => {@from => params[:from]}\n end\n end",
"def create\n return unless check_permission\n\n @role = Role.new(role_params)\n respond_to do |format|\n if @role.save\n format.html { redirect_to @role, notice: 'Role was successfully created.' }\n else\n @users = User.all\n format.html { render :new }\n end\n end\n end",
"def create_role(name, owner_key, access_type)\n name ||= random_string 'test_role'\n perms = [{\n :owner => {:key => owner_key},\n :access => access_type,\n }]\n role = @cp.create_role(name, perms)\n\n # Only append to the list of things to clean up if the @roles exists.\n # This is so the method can be used in before(:all) blocks.\n @roles << role if not @roles.nil?\n return role\n end",
"def create\n @role = @company.roles.new(safe_params)\n\n respond_to do |format|\n if @role.save\n format.html { redirect_to [@company, @role], notice: 'Role was successfully created.' }\n format.json { render :show, status: :created, location: @role }\n else\n format.html { render :new }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @role = Role.new(role_params)\n\n respond_to do |format|\n if role.save\n current_user.add_role :admin, role\n format.html { redirect_to admin_role_path(role), notice: 'Role was successfully created.' }\n format.json { render :show, status: :created, location: role }\n else\n format.html { render :new }\n format.json { render json: role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_role(client:, **data)\n create_object(type: 'Role', root: url_for(client), data: data)\n end",
"def create\n @role = Role.new(params[:role])\n\n respond_to do |format|\n if @role.save\n format.html { redirect_to edit_role_path(@role), :notice => t('hurricane.notice.create_record_success', :type => t_type) }\n format.json { render json: @role, status: :created, location: @role }\n else\n format.html { render action: \"new\" }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_general_role(role_name)\n sleep 2\n add_new.click\n enter_general_role_name.set role_name\n is_active.click\n page.first('.dxgvCommandColumnItem_Main_Theme').click\n sleep 3\n end",
"def create\n @role.state ||= 'open'\n\n if @role.save\n flash[:notice] = \"Role successfully created.\"\n\n redirect_to(role_path @role)\n else\n flash[:error] = \"Unable to create role.\"\n\n render(:new)\n end # if-else\n end",
"def create\n create_role_directory\n generate_manifests_file\n end",
"def create\n @security_role_type = Security::RoleType.new(security_role_type_params)\n @security_role_type.user_created_id = current_user.id\n respond_to do |format|\n if @security_role_type.save\n format.html { redirect_to @security_role_type, notice: I18n.t('role_types.controller.create')}\n format.json { render :show, status: :created, location: @security_role_type }\n else\n format.html { render :new }\n format.json { render json: @security_role_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new_role\n new_role = create_role(params[:role][:name])\n\n return redirect_to admin_roles_path, flash: { alert: I18n.t(\"administrator.roles.invalid_create\") } if new_role.nil?\n\n redirect_to admin_roles_path(selected_role: new_role.id)\n end",
"def create\n @entity_role = EntityRole.new(entity_role_params)\n\n respond_to do |format|\n if @entity_role.save\n format.html { redirect_to @entity_role, notice: 'Entity role was successfully created.' }\n format.json { render :show, status: :created, location: @entity_role }\n else\n format.html { render :new }\n format.json { render json: @entity_role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @role = Role.new(params[:role])\n\n if @role.save\n redirect_to admin_roles_url\n else\n render :action => \"new\"\n end\n end",
"def create\n super\n if current_user != nil\n p = Privilege.new\n puts current_user.class\n p.user_id = current_user.id;\n p.role_id = Role.find_by_role_name(\"user\").id;\n p.save;\n end\n end",
"def create\n @role = System::Role.new(system_role_params)\n respond_to do |format|\n if @role.save\n format.html { redirect_to system_roles_url, notice: '添加角色成功.' }\n format.json { render :show, status: :created, location: @role }\n else\n format.html { render :new }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def admin_create\n begin\n @user = User.new(user_params.merge(user_channel_id: current_user.user_channel_id))\n\n raise \"Invalid role[#{@user.role}]\" unless @user.is_available_role?\n if @user.save\n flash[:success] = t(:operation_succeeded)\n redirect_to users_path\n else\n render :new\n end\n rescue Exception => e\n flash.now[:error] = e.message\n render :new\n end\n end",
"def create\n @company = Company.find(params[:company_id])\n if !can?(:manage, @company)\n raise CanCan::AccessDenied.new(\"Usted no puede administrar otra compañia\", :manage, @company)\n end\n @user = User.new(params[:user])\n @roles = Role.all\n role_ids = params[:role_ids] if params[:role_ids] \n role_ids ||= []\n @user.role_ids = role_ids\n @user.company_id = @company.id\n \n if !current_user.super_admin\n @user.super_admin = false\n end\n \n respond_to do |format|\n if @user.save\n format.html { redirect_to company_users_path(@company), notice: 'El usuario fue creado exitosamente.' }\n format.json { render json: @user, status: :created, location: @user }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def CreateRole params = {}\n \n APICall(path: 'custom_roles.json',method: 'POST',payload: params.to_json)\n \n end",
"def create\n @role = Role.new(params[:role])\n\n respond_to do |format|\n if @role.save\n format.html { redirect_to admin_roles_path, notice: 'Role was successfully created.' }\n format.json { render json: @role, status: :created, location: @role }\n else\n format.html { render action: \"new\" }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @sys_role = SysRole.new(sys_role_params)\n\n respond_to do |format|\n if @sys_role.save\n format.html { redirect_to @sys_role, notice: 'Sys role was successfully created.' }\n format.json { render :show, status: :created, location: @sys_role }\n else\n format.html { render :new }\n format.json { render json: @sys_role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def makec\n @user.add_role :celebrity\n render nothing: true\n end",
"def create\n ActiveRecord::Base.transaction do\n @role, hash = fill_role(params[:role])\n\n respond_to do |format|\n if @role.save\n flash[:notice] = 'Role was successfully created.'\n format.html { redirect_to(@role) }\n format.xml { render :xml => @role, :status => :created, :location => @role }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @role.errors, :status => :unprocessable_entity }\n end\n end\n end\n end",
"def create\n respond_to do |format|\n if @role.save\n format.html { redirect_to user_roles_path(@user), notice: I18n.t('controller.create_success_notice', model: '角色') }\n format.json { render action: 'show', status: :created, location: @role }\n else\n format.html { render action: 'new' }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_cluster_role\n @cluster_role_name = \"#{name}-cluster\"\n @cluster_role = new_chef_role(@cluster_role_name, cluster)\n role(@cluster_role_name, :own)\n end",
"def create\n @role = get_role\n flash[:notice] = t('create.success', :scope => get_i18n_scope) if @role.save and not request.xhr?\n respond_with @event, @role, :location => {:action => 'index'}\n end",
"def create\n @parent_resource = ParentResource.find(params[:child_resource][:parent_resource_id])\n require_privilege(Alberich::Privilege::CREATE, ChildResource,\n @parent_resource)\n @child_resource = ChildResource.new(params[:child_resource])\n\n respond_to do |format|\n if @child_resource.save\n @child_resource.assign_owner_roles(current_user)\n format.html { redirect_to @child_resource, notice: 'Child resource was successfully created.' }\n format.json { render json: @child_resource, status: :created, location: @child_resource }\n else\n format.html { render action: \"new\" }\n format.json { render json: @child_resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new_user\n if self.role_id.nil?\n self.role_id = 3\n end\n end",
"def new_user\n if self.role_id.nil?\n self.role_id = 3\n end\n end",
"def initialize(params)\n raise 'No companyid given' unless (params[:companyid] or params[:company])\n raise 'No name given' unless params[:name]\n\n super(params)\n\n # COPY role_ (roleid, companyid, classnameid, classpk, name, description, type_) FROM stdin;\n # +10151\t10109\t0\t0\tRegular role\tThis role is a test\t1\n\n self.classnameid ||= 0\n self.classpk ||= 0\n self.description ||= ''\n # Type: 1 = regular, 2 = community, 3 = organization\n self.type_ ||= 1\n\n self.save\n\n # Resource with code scope 1 is primkey'd to company.\n # Resource with code scope 4 is primkey'd to this role.\n\n # These are created regardless of what type_ is.\n\n # COPY resourcecode (codeid, companyid, name, scope) FROM stdin;\n # +29\t10109\tcom.liferay.portal.model.Role\t1\n # +30\t10109\tcom.liferay.portal.model.Role\t4\n\n [1,4].each do |scope|\n rc = self.resource_code(scope)\n unless rc\n ResourceCode.create(\n Company.primary_key => self.companyid,\n :name => self.liferay_class,\n :scope => scope\n )\n end\n end\n\n # COPY resource_ (resourceid, codeid, primkey) FROM stdin;\n # +33\t29\t10109\n # +34\t30\t10151\n\n self.get_resource(:scope => 1)\n r = self.get_resource(:scope => 4)\n\n # Permissions (given to administrators)\n\n # COPY permission_ (permissionid, companyid, actionid, resourceid) FROM stdin;\n # +70 10109 ASSIGN_MEMBERS 34\n # +71 10109 DEFINE_PERMISSIONS 34\n # +72 10109 DELETE 34\n # +73 10109 MANAGE_ANNOUNCEMENTS 34\n # +74 10109 PERMISSIONS 34\n # +75 10109 UPDATE 34\n # +76 10109 VIEW 34\n\n # COPY users_permissions (userid, permissionid) FROM stdin;\n # +10129\t70\n # +10129\t71\n # +10129\t72\n # +10129\t73\n # +10129\t74\n # +10129\t75\n # +10129\t76\n\n self.class.actions.each do |actionid|\n p = Permission.get(\n :companyid => self.companyid,\n :actionid => actionid,\n :resourceid => r.id\n )\n self.company.administrators.each do |user|\n user.permissions << p\n end\n end\n end",
"def create_role_directory\n `cd #{self.project_root} && mkdir -p puppet/roles/#{self.name}/manifests`\n end",
"def create\n authorize! :manage_users, :all\n @user = User.new(params[:user])\n if @user.role == 'admin' or @user.role == 'teacher'\n @user.validation_scenario = 'admin_or_teacher'\n end\n respond_to do |format|\n if @user.save\n @user.add_role @user.role\n format.html { redirect_to @user, notice: 'User was successfully created.' }\n format.json { render json: @user, status: :created, location: @user }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @user_role = UserRole.new(params[:user_role])\n\n respond_to do |format|\n if @user_role.save\n flash[:notice] = 'UserRole was successfully created.'\n format.html { redirect_to([:admin, @user_role]) }\n else\n format.html { render :action => \"new\" }\n end\n end\n end",
"def create\n abilities = []\n client_application = current_user.client_application_id.to_s\n @abilities = Role.get_method_names.sort\n @role = Role.new(role_params)\n params[:role][:role_abilities].each do |ability|\n abilities << ability.to_sym\n end\n @role.role_abilities = [{\"action\"=> abilities, \"subject\"=>[:api]}]\n @role.client_application_id = client_application\n respond_to do |format|\n if @role.save\n format.html { redirect_to roles_path, notice: 'Role was successfully created.' }\n format.json { render :index, status: :created, location: @role }\n else\n format.html { render :new }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n super do\n case @user.role\n when 'trainee'\n trainee = Trainee.new(user_id: @user.id)\n trainee.save\n when 'trainer'\n trainer = Trainer.new(user_id: @user.id)\n trainer.save\n end\n end\n end",
"def create\n @role = Role.new(params[:role])\n\n @perms = params[:permissions[\"permissions\"]]\n if @perms != nil\n @permissions = @perms[\"permissions\"]\n end\n #logger.debug \"PERMISSIONS: #{@permissions.inspect}\"\n if @permissions == nil\n @role.read = 0\n @role.write = 0\n @role.execute = 0\n end\n if @permissions != nil\n if @permissions.include?(\"read\")\n @role.read = 1\n else\n @role.read = 0\n end\n if @permissions.include?(\"write\")\n @role.write = 1\n else\n @role.write = 0\n end\n if @permissions.include?(\"execute\")\n @role.execute = 1\n else\n @role.execute = 0\n end\n end\n \n respond_to do |format|\n if @role.save\n format.html { redirect_to @role, notice: t(:role_created) }\n format.json { render json: @role, status: :created, location: @role }\n else\n format.html { render action: \"new\" }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @roles_privilege = RolesPrivilege.new(roles_privilege_params)\n\n respond_to do |format|\n if @roles_privilege.save\n format.html { redirect_to @roles_privilege, notice: 'Roles privilege was successfully created.' }\n format.json { render :show, status: :created, location: @roles_privilege }\n else\n format.html { render :new }\n format.json { render json: @roles_privilege.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_role(person_id)\n Role.new(\n :role_type_id => 20,\n :person_id => person_id,\n :organisation_id => 1,\n :contactinfo_id => 300,\n :role_title => 'Test role for person '+person_id.to_s,\n :general_note => 'Test note for person '+person_id.to_s\n )\n end",
"def create\n @company = Company.find(params[:company_id])\n @role = Role.new(params[:role])\n @role.company_id = @company.id\n respond_to do |format|\n if @role.save\n format.html { redirect_to company_role_path(@company, @role), notice: 'El rol fue creado exitosamente.' }\n format.json { render json: @role, status: :created, location: @role }\n else\n format.html { render action: \"new\" }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @cms_role = Cms::Role.new(cms_role_params)\n\n respond_to do |format|\n if @cms_role.save\n format.html { redirect_to @cms_role, notice: 'Role was successfully created.' }\n format.json { render :show, status: :created, location: @cms_role }\n else\n format.html { render :new }\n format.json { render json: @cms_role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def build_resource(hash = nil)\n super(hash)\n resource.role = User::GROUP_MEMBER_ROLE\n end",
"def create_guild_role(guild_id, reason: nil, name: nil, permissions: nil, color: nil, hoist: nil, mentionable: nil)\n response = request(\n :guilds_gid_roles, guild_id,\n :post,\n \"guilds/#{guild_id}/roles\",\n {name: name, permissions: permissions, color: color, hoist: hoist, mentionable: mentionable},\n 'X-Audit-Log-Reason': reason,\n )\n Rapture::Role.from_json(response.body)\n end",
"def create\n @user_to_role = UserToRole.new(user_to_role_params)\n\n respond_to do |format|\n if @user_to_role.save\n format.html { redirect_to @user_to_role, notice: 'User to role was successfully created.' }\n format.json { render :show, status: :created, location: @user_to_role }\n else\n format.html { render :new }\n format.json { render json: @user_to_role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @role = Role.new(role_params)\n @role.save\n \n if @role.has_pool\n \n @role.default_assignee_id = 1000000 + @role.id \n @person = Person.new\n @person.id = 1000000 + @role.id\n \n if @role.pool_display_name.length() > 0\n @person.first_name = @role.pool_display_name\n else\n @person.first_name = @role.code + \" Pool\"\n end\n @person.last_name = \"\"\n @person.save\n \n @people_role = PeopleRole.new\n @people_role.role_id = @role.id\n @people_role.person_id = 1000000 + @role.id\n @people_role.save\n end\n \n respond_to do |format|\n if @role.save\n format.html { redirect_to @role, notice: 'Role was successfully created.' }\n format.json { render :show, status: :created, location: @role }\n else\n format.html { render :new }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_role_from(key, &block)\n roles.merge!(key => create_role_subclass_from(key, &block))\n end",
"def create_facility_role\n self.facility_roles.create!(user_id: user.id, name: 'climber', email: user.email, confirmed: true )\n end",
"def create\n @grupo = Grupo.new(params[:grupo])\n authorize! :create, @grupo\n\n respond_to do |format|\n if @grupo.save\n current_user.add_role :owner, @grupo\n \n format.html { redirect_to grupo_path(@grupo), notice: 'Grupo was successfully created.' }\n format.json { render json: @grupo, status: :created, location: @grupo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @grupo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @role = Role.new(role_params)\n\n respond_to do |format|\n if @role.save\n format.html {\n redirect_to dashboard_path\n flash[:success] = @role.name+' was successfully created.' }\n format.json { render json: @role.to_json }\n else\n format.html { render action: 'new' }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @role = Role.new(params[:role])\n \n respond_to do |format|\n if @role.save\n flash[:notice] = 'Role was successfully created.'\n format.xml { render :xml => @role, :status => :created, :location => @role }\n format.js #create.js.rjs\n else\n @possible_permissions = Permission.by_category(@role.category)\n format.xml { render :xml => @role.errors, :status => :unprocessable_entity }\n format.js #create.js.rjs\n end\n end\n end",
"def create\n if can?(:create, User)\n @user = User.new(params[:user])\n password_unencrypted = params[:user][:password]\n role = Role.where(:name => \"normal\")\n if role == nil or role.empty?\n role = Role.new\n role.name = \"normal\"\n role.save\n end\n @user.roles.push(role)\n end\n\n if can?(:create, User) and @user.save\n respond_to do |format|\n ForumMailer.welcome_email(@user, password_unencrypted).deliver\n format.json { render :json => @user.to_json, :status => 200, :text => \"User was created!\" }\n format.xml { head :ok }\n format.html { redirect_to :action => :index }\n end\n else\n respond_to do |format|\n format.json { render :text => \"Could not create user.\", :status => :unprocessable_entity } # placeholder\n format.xml { head :ok }\n format.html { render :action => :new, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @lab_permissions_role = LabPermissionsRole.new(params[:lab_permissions_role])\n\n respond_to do |format|\n if @lab_permissions_role.save\n format.html { redirect_to @lab_permissions_role, notice: 'Lab permissions role was successfully created.' }\n format.json { render json: @lab_permissions_role, status: :created, location: @lab_permissions_role }\n else\n format.html { render action: \"new\" }\n format.json { render json: @lab_permissions_role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\r\n @role = Role.new(role_params)\r\n @role.save\r\n end",
"def create\n @admin_role = RoleUser.new(params[:role_user])\n\n respond_to do |format|\n if @admin_role.save\n format.html { redirect_to @role_users_path, notice: 'Role was successfully created.' }\n format.json { render json: @admin_role, status: :created, location: @admin_role }\n else\n format.html { render action: \"new\" }\n format.json { render json: @admin_role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @role = Role.new(params[:role])\n \n respond_to do |format|\n if @role.save\n format.html { redirect_to @role, notice: 'Role was successfully created.' }\n format.json { render json: @role, status: :created, location: @role }\n else\n format.html { render action: \"new\" }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @user = User.new(user_params)\n unless @user.role\n @user.role = Role.find_by_name('SuperAdmin')\n end\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to super_admin_users_path, notice: 'Super Admin was successfully created.' }\n format.json { render :show, status: :created, location: @user }\n else\n format.html { render :new }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_permissions\n # initial_step is a controller action on some resources for creation...\n if user_groups.include?(HYHULL_USER_GROUPS[:content_creator]) || \n user_groups.include?(HYHULL_USER_GROUPS[:content_access_team]) || \n @current_user.admin?\n can [:initial_step, :create], :all\n end\n\n end",
"def make_member!\n make_role!(MemberRole)\n end",
"def create\n @role = Role.new(params[:role])\n\n respond_to do |format|\n if @role.save\n format.html { redirect_to @role, notice: 'Role was successfully created.' }\n format.json { render json: @role, status: :created, location: @role }\n else\n format.html { render action: \"new\" }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def assign_default_role\n self.add_role(:newuser) if self.roles.blank?\n end",
"def assign_default_role\n self.add_role(:newuser) if self.roles.blank?\n end",
"def create\n @user_space_role = UserSpaceRole.new(params[:user_space_role])\n\n respond_to do |format|\n if @user_space_role.save\n flash[:notice] = 'UserSpaceRole was successfully created.'\n format.html { redirect_to(@user_space_role) }\n format.xml { render :xml => @user_space_role, :status => :created, :location => @user_space_role }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user_space_role.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @core_user_role = Core::UserRole.new(core_user_role_params)\n\n respond_to do |format|\n if params[:btn_cancel].present?\n format.html { redirect_to(action: \"index\")}\n format.json { head :no_content}\n elsif @core_user_role.save\n format.html { redirect_to @core_user_role, notice: 'User role was successfully created.' }\n format.json { render action: 'show', status: :created, location: @core_user_role }\n else\n format.html { render action: 'new' }\n format.json { render json: @core_user_role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n if params and params[:user]\n @role = params[:user][:role] \n \n user_session[\"role\"] = @role if user_session\n end\n super\n end",
"def create\n @role = Role.new(role_params)\n\n @str = nil\n @alert = nil\n\n if @role.save\n @str = 'Role was successfully created'\n @alert = 'panel-success'\n else\n @str = @role.errors.full_messages\n @alert = 'panel-danger'\n @role = nil\n end\n\n end",
"def create\n @role = Role.new(role_params) \n @role.permissions = []\n @role.set_permissions(params[:permissions]) if params[:permissions]\n\n respond_to do |format|\n if @role.save\n format.html { redirect_to @role, notice: 'Role was successfully created.' }\n format.json { render :show, status: :created, location: @role }\n else\n format.html { render :new }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def data_for_role_new\n {}\n end",
"def create\n @role = Role.new(role_params)\n\n respond_to do |format|\n if @role.save\n format.html { redirect_to @role, notice: 'Role was successfully created.' }\n format.json { render :show, status: :created, location: @role }\n else\n format.html { render :new }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @role = Role.new(role_params)\n\n respond_to do |format|\n if @role.save\n format.html { redirect_to @role, notice: 'Role was successfully created.' }\n format.json { render :show, status: :created, location: @role }\n else\n format.html { render :new }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @role = Role.new(role_params)\n\n respond_to do |format|\n if @role.save\n format.html { redirect_to @role, notice: 'Role was successfully created.' }\n format.json { render :show, status: :created, location: @role }\n else\n format.html { render :new }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @user = User.new(user_params)\n authorize! :create, @user\n authorize! :update, (user_params[:role_id].present? ? Role.find(user_params[:role_id]) : Role)\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to @user, notice: I18n.translate('users.flash.create.success', user: @user.fullname) }\n format.json { render :show, status: :created, location: @user }\n else\n format.html { render :new, notice: I18n.translate('users.flash.create.fail') , status: :unprocessable_entity }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @company = Company.find( params[:company_id])\n @user = @company.users.build\n @roles = ROLE\n end",
"def add_role\n role_name = \"network-#{name}\"\n unless Role.exists?(name: role_name)\n Rails.logger.info(\"Network: Adding role and attribs for #{role_name}\")\n bc = Barclamp.find_key \"network\"\n Role.transaction do\n create_auto_v6_range\n r = Role.find_or_create_by!(name: role_name,\n type: \"BarclampNetwork::Role\", # force\n jig_name: Rails.env.production? ? \"chef\" : \"test\",\n barclamp_id: bc.id,\n description: I18n.t('automatic_by', :name=>name),\n library: false,\n implicit: true,\n milestone: true, # may need more logic later, this is safest for first pass\n bootstrap: false, # don't bootstrap networks anymore.\n discovery: false ) # don't discovery networks anymore.\n RoleRequire.create!(:role_id => r.id, :requires => \"network-server\")\n # The admin net must be bound before any other network can be bound.\n RoleRequireAttrib.create!(role_id: r.id, attrib_name: 'network_interface_maps')\n RoleRequireAttrib.create!(role_id: r.id, attrib_name: 'network-current-config')\n RoleRequireAttrib.create!(role_id: r.id, attrib_name: 'network-wanted-config')\n # attributes for jig configuraiton\n Attrib.create!(:role_id => r.id,\n :barclamp_id => bc.id,\n :name => \"#{role_name}_addresses\",\n :description => \"#{name} network addresses assigned to a node\",\n :map => \"crowbar/network/#{name}/addresses\")\n Attrib.create!(:role_id => r.id,\n :barclamp_id => bc.id,\n :name => \"#{role_name}_targets\",\n :description => \"#{name} network addresses to be used as ping test targets\",\n :map => \"crowbar/network/#{name}/targets\")\n Attrib.create!(:role_id => r.id,\n :barclamp_id => bc.id,\n :name => \"#{role_name}_conduit\",\n :description => \"#{name} network conduit map for this node\",\n :map => \"crowbar/network/#{name}/conduit\")\n Attrib.create!(:role_id => r.id,\n :barclamp_id => bc.id,\n :name => \"#{role_name}_resolved_conduit\",\n :description => \"#{name} network interfaces used on this node\",\n :map => \"crowbar/network/#{name}/resolved_interfaces\")\n Attrib.create!(:role_id => r.id,\n :barclamp_id => bc.id,\n :name => \"#{role_name}_vlan\",\n :description => \"#{name} network vlan tag\",\n :map => \"crowbar/network/#{name}/vlan\")\n Attrib.create!(:role_id => r.id,\n :barclamp_id => bc.id,\n :name => \"#{role_name}_team_mode\",\n :description => \"#{name} network bonding mode\",\n :map => \"crowbar/network/#{name}/team_mode\")\n Attrib.create!(:role_id => r.id,\n :barclamp_id => bc.id,\n :name => \"#{role_name}_use_vlan\",\n :description => \"Whether the #{name} network should use a tagged VLAN interface\",\n :map => \"crowbar/network/#{name}/use_vlan\")\n Attrib.create!(:role_id => r.id,\n :barclamp_id => bc.id,\n :name => \"#{role_name}_use_team\",\n :description => \"Whether the #{name} network should bond its interfaces\",\n :map => \"crowbar/network/#{name}/use_team\")\n Attrib.create!(:role_id => r.id,\n :barclamp_id => bc.id,\n :name => \"#{role_name}_use_bridge\",\n :description => \"Whether #{name} network should create a bridge for other barclamps to use\",\n :map => \"crowbar/network/#{name}/use_bridge\")\n # attributes for hints\n # These belong to the barclamp, not the role.\n Attrib.create!(:barclamp_id => bc.id,\n :name => \"hint-#{name}-v4addr\",\n :description => \"Hint for #{name} network to assign v4 IP address\",\n :map => \"#{name}-v4addr\",\n :schema => {\n \"type\" => \"str\",\n \"required\" => true,\n \"pattern\" => '/([0-9]{1,3}\\.){3}[0-9]{1,3}/'})\n Attrib.create!(:barclamp_id => bc.id,\n :name => \"hint-#{name}-v6addr\",\n :description => \"Hint for #{name} network to assign v6 IP address\",\n :map => \"#{name}-v6addr\",\n :schema => {\n \"type\" => \"str\",\n \"required\" => true,\n \"pattern\" => '/[0-9a-f:]+/'})\n end\n end\n end",
"def render_create_success\n render json: @resource, include: [:roles], show_roles: true\n end",
"def create\n @role = Role.new(params[:role])\n\n respond_to do |format|\n if @client.roles << @role\n flash[:notice] = 'Role was successfully created.'\n format.html { redirect_to client_role_url(@client, @role) }\n format.xml { render :xml => @role, :status => :created, :location => [@client, @role] }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @role.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @user = User.new(params[:user])\n ### Add the creator of the object (in this case User) into our record\n @user.creator = current_user\n ### Save the user roles when saving the user\n #@user.save do |result|\n @user.save && check_and_set_role do |result|\n respond_to do |format|\n if result\n flash[:notice] = \"User #{@user.username} was successfully registered.\"\n# @user.has_role!(:patient) # Add default group for user\n format.html { redirect_to(@user) } # redirect_to root_url\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end\n end",
"def create_role(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateRole'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'https'\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :assume_role_policy_document\n\t\t\targs[:query]['AssumeRolePolicyDocument'] = optional[:assume_role_policy_document]\n\t\tend\n\t\tif optional.key? :description\n\t\t\targs[:query]['Description'] = optional[:description]\n\t\tend\n\t\tif optional.key? :role_name\n\t\t\targs[:query]['RoleName'] = optional[:role_name]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create\n @company = Company.new(params[:company])\n @profile = Profile.new\n\n respond_to do |format|\n if @company.save\n @profile.company = @company\n @profile.user = current_user\n @profile.save\n\n @role = Role.new\n @role.name = @company.name + \"_admin\"\n @role.client_id = CLIENT_ID\n @role.save\n\n @resource = Resource.new \n @resource.name = \"^/companies/\" + @company.id.to_s + \"($|/.*$)\" \n @resource.client_id = CLIENT_ID\n @resource.save\n\n @role.add_to_resource(@resource)\n @role.add_to_subject(Subject.find(current_user.preallowed_id)) \n \n flash[:notice] = 'Company was successfully created.'\n format.html { redirect_to(@company) }\n format.xml { render :xml => @company, :status => :created, :location => @company }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def add_role\n person\n end",
"def create\n @role_privilege = RolePrivilege.new(role_privilege_params)\n\n respond_to do |format|\n if @role_privilege.save\n format.html { redirect_to role_privileges_url, notice: 'Uloga i privilegija su uspješno povezane.' }\n format.json { render :show, status: :created, location: @role_privilege }\n else\n format.html { render :new }\n format.json { render json: @role_privilege.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @lab_role = LabRole.new(params[:lab_role])\n\n respond_to do |format|\n if @lab_role.save\n format.html { redirect_to @lab_role, notice: 'Lab role was successfully created.' }\n format.json { render json: @lab_role, status: :created, location: @lab_role }\n else\n format.html { render action: \"new\" }\n format.json { render json: @lab_role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def role; end",
"def role; end",
"def create\n #\n # TODO confirm privledges are not compromised\n #\n user = User.find_by_email(params[:role][:user_attributes][:email])\n params[:role].delete(:user_attributes) if user.present?\n\n @role = Role.new(params[:role])\n if user.present?\n if @vendor.users.exists?(user)\n flash.now.alert = \"User already has a role at this vendor.\"\n redirect_to dashboard_vendor_vendor_roles_path(@vendor)\n return\n end\n @role.user = user\n end\n @role.vendor = @vendor\n\n if @role.save\n redirect_to dashboard_vendor_vendor_roles_path(@vendor), notice: 'User successfully added.'\n else\n render 'new'\n end\n end"
] | [
"0.6872108",
"0.6832281",
"0.66914177",
"0.65840554",
"0.64816517",
"0.6438338",
"0.640479",
"0.6398303",
"0.6363379",
"0.6340463",
"0.62889224",
"0.6268303",
"0.6249968",
"0.6236322",
"0.62316823",
"0.6219937",
"0.62155324",
"0.6209823",
"0.6209662",
"0.6207588",
"0.62064195",
"0.6200228",
"0.61949486",
"0.6182818",
"0.6161345",
"0.61315876",
"0.6128969",
"0.6125429",
"0.6116515",
"0.61049867",
"0.6098005",
"0.6077907",
"0.6076701",
"0.60625046",
"0.60496336",
"0.6040794",
"0.6038647",
"0.6027665",
"0.6026533",
"0.60147506",
"0.6012151",
"0.60116315",
"0.6008974",
"0.6001984",
"0.5991002",
"0.5991002",
"0.5985317",
"0.59786266",
"0.596795",
"0.59628224",
"0.59628034",
"0.59432715",
"0.59431756",
"0.594037",
"0.5933589",
"0.59320575",
"0.5918217",
"0.58965474",
"0.588515",
"0.58831626",
"0.58652675",
"0.5861961",
"0.5855409",
"0.58551663",
"0.5845126",
"0.58450305",
"0.58443344",
"0.5842692",
"0.5840351",
"0.58348334",
"0.58315617",
"0.581462",
"0.5809441",
"0.580669",
"0.58035135",
"0.5801795",
"0.5801795",
"0.5800352",
"0.57920104",
"0.57849985",
"0.5780684",
"0.5779951",
"0.57768124",
"0.57754487",
"0.57754487",
"0.57754487",
"0.5771639",
"0.57675594",
"0.5766492",
"0.5764367",
"0.5761915",
"0.5759003",
"0.5756287",
"0.57539564",
"0.57465535",
"0.57440215",
"0.5732785",
"0.57295877",
"0.57295877",
"0.5726959"
] | 0.6225007 | 15 |
Internal handler for GUILD_ROLE_DELETE | def delete_guild_role(data)
role_id = data['role_id'].to_i
server_id = data['guild_id'].to_i
server = @servers[server_id]
server.delete_role(role_id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @core_user_role.destroy\n respond_to do |format|\n format.html { redirect_to core_user_roles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n if !grant_access(\"alter_roles\", current_user)\n head(403)\n end\n @role.destroy\n respond_to do |format|\n format.html { redirect_to roles_url, notice: 'Role was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n return unless check_permission\n\n @role.destroy\n respond_to do |format|\n format.html { redirect_to roles_url, notice: 'Role was successfully destroyed.' }\n end\n end",
"def destroy\n chef_server_rest.delete(\"roles/#{@name}\")\n end",
"def destroy\n\n\n\nrol = Role.where(:id=>current_user.role).first\n if rol.nombre == \"ACRM\"\n @role_permision = RolePermision.find(params[:id])\n @role_permision.destroy\nelse\n flash[:error] ='No tienes permiso para realizar esta accion'\n\nend\n \n \n\n respond_to do |format|\n format.html { redirect_to role_permisions_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user_role = UserRole.find(params[:id])\n @user_role.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_user_roles_url) }\n end\n end",
"def destroy\n super\n # if resource.destroy\n # @rolesuser = @Rolesuser.find_all_by_user_id(resource.id)\n # @rolesuser.each do |rolesuser|\n # rolesuser.destroy\n # end\n # end\n end",
"def destroy\n\n\nrol = Role.where(:id=>current_user.role).first\n if rol.nombre == \"ACRM\"\n \n @preparatoria_o_universidad_de_origen = PreparatoriaOUniversidadDeOrigen.find(params[:id])\n @preparatoria_o_universidad_de_origen.destroy\n\nelse\n flash[:error] ='No tienes permiso para realizar esta accion'\n\nend\n \n \n \n\n respond_to do |format|\n format.html { redirect_to preparatoria_o_universidad_de_origens_url }\n format.json { head :ok }\n end\n end",
"def destroy\n role.destroy\n respond_to do |format|\n format.html { redirect_to admin_roles_url, notice: 'Role was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sulabh_user_role.destroy\n respond_to do |format|\n format.html { redirect_to sulabh_user_roles_url, notice: 'Sulabh user role was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @role = Role.find(params[:id])\n @role.destroy\n\n respond_to do |format|\n format.html { redirect_to roles_url , :notice => t('hurricane.notice.delete_record_success', :type => t_type)}\n format.json { head :no_content }\n end\n end",
"def destroy\n\nrol = Role.where(:id=>current_user.role).first\n if rol.nombre == \"ACRM\"\n\n @subsede = Subsede.find(params[:id])\n @subsede.destroy\nelse\n flash[:error] ='No tienes permiso para realizar esta accion'\n\nend\n\n \n \n\n respond_to do |format|\n format.html { redirect_to subsedes_url }\n format.json { head :ok }\n end\n end",
"def destroy\n\n\n\nrol = Role.where(:id=>current_user.role).first\n if rol.nombre == \"ACRM\"\n \n \n @rpm = Rpm.find(params[:id])\n @rpm.destroy\nelse\n flash[:error] ='No tienes permiso para realizar esta accion'\n\nend\n\n respond_to do |format|\n format.html { redirect_to rpms_url }\n format.json { head :ok }\n end\n end",
"def destroy\n\n\nrol = Role.where(:id=>current_user.role).first\n if rol.nombre == \"ACRM\"\n\n @finalidad_cultivo = FinalidadCultivo.find(params[:id])\n @finalidad_cultivo.destroy\nelse\n flash[:error] ='No tienes permiso para realizar esta accion'\n\nend\n\n\n\n respond_to do |format|\n format.html { redirect_to finalidad_cultivos_url }\n format.json { head :ok }\n end\n end",
"def delete\n @role = Role.find(params[:id])\n \n if request.get?\n # render only\n else\n if not params[:yes].nil?\n @role.destroy\n flash[:success] = 'The role has been deleted successfully.'\n redirect_to roles_path\n else\n flash[:success] = 'The role has not been deleted.'\n redirect_to role_path(Role.find(params[:id]))\n end\n end\n\n rescue CantDeleteWithChildren\n flash[:error] = \"You have to delete or move the role's children before attempting to delete the role itself.\"\n redirect_to role_path(Role.find(params[:id]))\n rescue ActiveRecord::RecordNotFound\n flash[:error] = 'This role could not be found.'\n redirect_to roles_path\n end",
"def destroy\n\n\nrol = Role.where(:id=>current_user.role).first\n if rol.nombre == \"ACRM\"\n\n \n @status_del_tramite_de_beca = StatusDelTramiteDeBeca.find(params[:id])\n @status_del_tramite_de_beca.destroy\nelse\n flash[:error] ='No tienes permiso para realizar esta accion'\n\nend\n\n\n\n respond_to do |format|\n format.html { redirect_to status_del_tramite_de_becas_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @role_auth_ref.destroy\n respond_to do |format|\n format.html { redirect_to role_auth_refs_url, notice: 'Role auth ref was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n\nrol = Role.where(:id=>current_user.role).first\n\n if rol.nombre == \"ACRM\"\n\n\n @colegiatura = Colegiatura.find(params[:id])\n @colegiatura.destroy\n\n\nelse\n flash[:error] ='No tienes permiso para realizar esta accion'\n\nend\n \n respond_to do |format|\n format.html { redirect_to colegiaturas_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @role_privilege.destroy\n respond_to do |format|\n format.html { redirect_to role_privileges_url, notice: 'Veza je usšešno obrisana.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user_has_role_for_node.destroy\n respond_to do |format|\n format.html { redirect_to user_has_role_for_nodes_url, notice: 'User has role for node was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find params[:user_id]\n @role = Role.find params[:id]\n\n @user.roles.delete @role\n flash[:notice] = 'Assigment was successfully destroyed.'\n\n respond_to do |format|\n format.html { redirect_to :back }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user_space_role = UserSpaceRole.find(params[:id])\n @user_space_role.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_space_roles_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @admin_role = Role.find(params[:id])\n @admin_role.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_roles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @role.destroy\n respond_to do |format|\n format.html { redirect_to system_roles_url, notice: '删除角色成功.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:user_id])\n @role = Role.find(params[:id])\n if @user.has_role?(@role.name)\n @user.roles.delete(@role)\n end\n respond_to do |format|\n format.html {redirect_to :action => 'index' }\n format.xml { head :ok }\n end\n \n end",
"def destroy\n @role.destroy\n respond_to do |format|\n format.html { redirect_to management_roles_url, notice: 'Perfil was successfully removed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @roles_privilege.destroy\n respond_to do |format|\n format.html { redirect_to roles_privileges_url, notice: 'Roles privilege was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n\n\nrol = Role.where(:id=>current_user.role).first\n if rol.nombre == \"ACRM\"\n\n @status_del_admitido = StatusDelAdmitido.find(params[:id])\n @status_del_admitido.destroy\nelse\n flash[:error] ='No tienes permiso para realizar esta accion'\n\nend\n \n \n\n respond_to do |format|\n format.html { redirect_to status_del_admitidos_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @entity_role.destroy\n respond_to do |format|\n format.html { redirect_to entity_roles_url, notice: 'Entity role was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user_to_role.destroy\n respond_to do |format|\n format.html { redirect_to user_to_roles_url, notice: 'User to role was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_role\n\t\t@role = Role.find(params[:id])\n\n\t\tif @role.destroy\n\t\t\tredirect_to \"/details\"\n\t\telse\n\t\t\treder :action => \"delete_role\"\n\t\tend\n\tend",
"def destroy\n\n\n\nrol = Role.where(:id=>current_user.role).first\n if rol.nombre == \"ACRM\"\n flash[:notice] ='Por favor seleccione un programa para reemplazar el programa a borrar actual, esta accion no puede ser revertida.'\n respond_to do |format|\n format.html { redirect_to borrar_url }\n format.json { head :ok }\n end\n \n else\n flash[:error] ='No tienes permiso para realizar esta accion'\n respond_to do |format|\n format.html { redirect_to programas_url }\n format.json { head :ok }\n end\n end\n end",
"def destroy\n @role.destroy\n respond_to do |format|\n format.html { redirect_to company_roles_url(@company), notice: 'Role was successfully removed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @security_agent_role.destroy\n respond_to do |format|\n format.html { redirect_to security_agent_roles_url, notice: 'Security agent role was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n @role = Role.find(params[:id].to_i)\n \n if request.get?\n # render only\n else\n if not params[:yes].nil?\n @role.destroy\n flash[:success] = 'The role has been deleted successfully.'\n redirect_to :action => 'list'\n else\n flash[:success] = 'The role has not been deleted.'\n redirect_to :action => 'show', :id => params[:id]\n end\n end\n\n rescue CantDeleteWithChildren\n flash[:error] = \"You have to delete or move the role's children before attempting to delete the role itself.\"\n redirect_to :action => 'show', :id => params[:id]\n rescue ActiveRecord::RecordNotFound\n flash[:error] = 'This role could not be found.'\n redirect_to :action => 'list'\n end",
"def destroy\n\nrol = Role.where(:id=>current_user.role).first\n if rol.nombre == \"ACRM\"\n\n\n @correo = Correo.find(params[:id])\n @correo.destroy\n\nelse\n @correo = Correo.find(params[:id])\n flash[:error] ='No tienes permiso para realizar esta accion'\n redirect_to \"/correos/#{@correo.id}/edit/\"\n return\nend\n\n\n\n respond_to do |format|\n format.html { redirect_to \"/correos\", notice: 'correo was successfully deleted.' }\n format.json { head :ok }\n end\n end",
"def destroy\n\n\nrol = Role.where(:id=>current_user.role).first\n if rol.nombre == \"ACRM\"\n \n \n\n @status_de_la_inscripcion = StatusDeLaInscripcion.find(params[:id])\n @status_de_la_inscripcion.destroy\n\nelse\n flash[:error] ='No tienes permiso para realizar esta accion'\n\nend\n \n\n respond_to do |format|\n format.html { redirect_to status_de_la_inscripcions_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @role.destroy\n respond_to do |format|\n format.html { redirect_to roles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @security_role = Security::Role.find_by(id: @security_role_menu.security_role.id)\n @security_role.update(:user_updated_id => current_user.id)\n @security_role_menu.destroy\n respond_to do |format|\n format.html { redirect_to security_role_menus_url, notice: 'Menú eliminado exitosamente para este rol.' }\n format.json { head :no_content }\n format.js { render :layout => false }\n end\n end",
"def destroy\n @admin_role_ref.destroy\n respond_to do |format|\n format.html { redirect_to admin_role_refs_url, notice: 'Admin role ref was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @role.destroy\n respond_to do |format|\n format.html { redirect_to dashboard_path }\n format.json { head :no_content }\n end\n end",
"def delete_role\n role = Role.find(params[:role_id])\n\n # Make sure no users are assigned to the role and the role isn't a reserved role\n # before deleting\n if role.users.count.positive?\n flash[:alert] = I18n.t(\"administrator.roles.role_has_users\", user_count: role.users.count)\n return redirect_to admin_roles_path(selected_role: role.id)\n elsif Role::RESERVED_ROLE_NAMES.include?(role) || role.provider != @user_domain ||\n role.priority <= current_user.role.priority\n return redirect_to admin_roles_path(selected_role: role.id)\n else\n role.role_permissions.delete_all\n role.delete\n end\n\n redirect_to admin_roles_path\n end",
"def destroy\n respond_to do |format|\n if @role.destroy\n format.html { redirect_to(@role) }\n format.js { render (:update) {|page| page[dom_id_nested(:item, @role)].remove() } }\n else\n flash[:notice] = 'Role was not deleted.'\n format.html { redirect_to roles_path }\n format.js { render (:update) { |page| page.alert(\"Cannot delete role #{@role.name}\") }}\n end\n end\n end",
"def destroy\n @role = Role.find(params[:id])\n @role.destroy\n\n respond_to do |format|\n format.html { redirect_to(blog_roles_url(@blog)) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @role = @client.roles.find(params[:id])\n @role.destroy\n\n respond_to do |format|\n flash[:notice] = 'Role was successfully removed.' \n format.html { redirect_to(client_roles_url(@client)) }\n format.xml { head :ok }\n end\n end",
"def destroy\n\n\nrol = Role.where(:id=>current_user.role).first\n if rol.nombre == \"ACRM\"\n\n \n @mercado_metum = MercadoMetum.find(params[:id])\n @mercado_metum.destroy\nelse\n flash[:error] ='No tienes permiso para realizar esta accion'\n\nend\n \n\n respond_to do |format|\n format.html { redirect_to mercado_meta_url }\n format.json { head :ok }\n end\n end",
"def destroy\n\nrol = Role.where(:id=>current_user.role).first\n if rol.nombre == \"ACRM\"\n \n @ultimo_grado_de_estudio = UltimoGradoDeEstudio.find(params[:id])\n @ultimo_grado_de_estudio.destroy\n\nelse\n flash[:error] ='No tienes permiso para realizar esta accion'\n\nend\n\n\n respond_to do |format|\n format.html { redirect_to ultimo_grado_de_estudios_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user_role = UserRole.find(params[:id])\n @user_role.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_roles_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @sys_role.destroy\n respond_to do |format|\n format.html { redirect_to sys_roles_url, notice: 'Sys role was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @role = Role.find_by_id(params[:id])\n @role.destroy\n\n respond_to do |format|\n format.html { redirect_to(roles_url, :notice => \"User role removed.\") }\n format.xml { head :ok }\n end\n end",
"def destroy\n\nrol = Role.where(:id=>current_user.role).first\n if rol.nombre == \"ACRM\"\n\n @status_ref_pago_insc = StatusRefPagoInsc.find(params[:id])\n @status_ref_pago_insc.destroy\nelse\n flash[:error] ='No tienes permiso para realizar esta accion'\n\nend\n\n \n \n\n respond_to do |format|\n format.html { redirect_to status_ref_pago_inscs_url }\n format.json { head :ok }\n end\n end",
"def destroy \r\n @role = Role.find(params[:id])\r\n if @role.destroy\r\n msg= \"Role deleted successfully!\"\r\n else\r\n msg= \"Role delete failed!\"\r\n end\r\n redirect_to roles_path, :flash => { :notice => msg }\r\n end",
"def destroy\n @role = get_role\n get_role.destroy\n flash[:notice] = t('destroy.success', :scope => get_i18n_scope) unless request.xhr?\n respond_with @event, @role\n end",
"def destroy\n\n\nrol = Role.where(:id=>current_user.role).first\n if rol.nombre == \"ACRM\"\n \n \n @status_de_interes_de_prospecto_validado = StatusDeInteresDeProspectoValidado.find(params[:id])\n @status_de_interes_de_prospecto_validado.destroy\n\n\nelse\n flash[:error] ='No tienes permiso para realizar esta accion'\n\nend\n \n respond_to do |format|\n format.html { redirect_to status_de_interes_de_prospecto_validados_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @role = Role.find(params[:id])\n @role.destroy\n \n respond_to do |format|\n format.html { redirect_to roles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @role.destroy\n\n redirect_to roles_path\n end",
"def destroy\n @role.destroy\n respond_with @role, location: roles_path\n end",
"def destroy\n @role.destroy\n respond_with @role, location: roles_path\n end",
"def delrole(event, role)\n if @assignable_roles.include? role then\n if event.message.author.roles.find {|r| r.name == role}\n event.message.author.remove_role get_role(event, role)\n event.send_message(\"alright hun, #{role} removed\")\n else\n event.send_message(\"i don't see that role, you sure have an imagination sometimes, hun\")\n end\n else\n if event.message.author.roles.find {|r| r.name == role}\n event.send_message(\"only big kids can touch that role, cutie pie\")\n else\n event.send_message(\"tsk tsk tsk!\")\n end\n end\n end",
"def destroy\n rol = Role.where(:id=>current_user.role).first\n\n if rol.nombre == \"ACRM\"\n\n\n @achievment = Achievment.find(params[:id])\n @achievment.destroy\n\nelse\n flash[:error] ='No tienes permiso para realizar esta accion'\n\nend\n\n respond_to do |format|\n format.html { redirect_to achievments_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @role_permission.destroy\n respond_to do |format|\n format.html { redirect_to role_permissions_url, notice: 'Role permission was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @role.destroy\n respond_to do |format|\n format.html { redirect_to roles_url, notice: 'Role was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @role.destroy\n respond_to do |format|\n format.html { redirect_to roles_url, notice: 'Role was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @role.destroy\n respond_to do |format|\n format.html { redirect_to roles_url, notice: 'Role was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @role.destroy\n respond_to do |format|\n format.html { redirect_to roles_url, notice: 'Role was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @role.destroy\n respond_to do |format|\n format.html { redirect_to roles_url, notice: 'Role was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @role.destroy\n respond_to do |format|\n format.html { redirect_to roles_url, notice: 'Role was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company = Company.find(params[:company_id])\n @role = Role.find(params[:role_id])\n @access_right = @role.access_rights.find(params[:id])\n @access_right.destroy\n redirect_to company_role_path(@company, @role)\n end",
"def destroy\n @role.destroy\n respond_to do |format|\n format.html { redirect_to user_roles_path }\n format.js\n format.json { head :no_content }\n end\n end",
"def destroy\n @mg_role.destroy\n respond_to do |format|\n format.html { redirect_to mg_roles_url, notice: 'Mg role was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @role_funcion.destroy\n respond_to do |format|\n format.html { redirect_to role_funcions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @role = Role.find(params[:id])\n @role.destroy\n\n respond_to do |format|\n format.html { redirect_to roles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cms_role.destroy\n respond_to do |format|\n format.html { redirect_to cms_roles_url, notice: 'Role was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @rolepermission.destroy\n respond_to do |format|\n format.html { redirect_to rolepermissions_url, notice: 'Rolepermission was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @role.destroy\n\n flash[:notice] = \"Role successfully destroyed.\"\n\n redirect_to roles_path\n end",
"def destroy\n\n\nrol = Role.where(:id=>current_user.role).first\n if rol.nombre == \"ACRM\"\n \n\n \n @periodo_para_ingresar = PeriodoParaIngresar.find(params[:id])\n @periodo_para_ingresar.destroy\n\n\nelse\n flash[:error] ='No tienes permiso para realizar esta accion'\n\nend\n \n respond_to do |format|\n format.html { redirect_to periodo_para_ingresars_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @roles_and_permission = @roles.roles_and_permission.find(params[:id])\n @roles_and_permission.destroy\n\n respond_to do |format|\n format.html { redirect_to roles_and_permissions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @role = Role.find(params[:id])\n if @role && @role.destroy\n redirect_to dashboard_vendor_vendor_roles_path(@vendor), notice: 'User successfully removed.'\n else\n redirect_to dashboard_vendor_vendor_roles_path(@vendor)\n end\n end",
"def destroy\n @user_log = UserLog.create user: current_user, operation: 'user.log.op.destroy_role_change', target_user: @authority_change_request.user.username\n @authority_change_request.destroy\n respond_to do |format|\n format.html { redirect_to authority_change_requests_url, notice: 'Authority change request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @master_role.destroy\n respond_to do |format|\n format.html { redirect_to master_roles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @users_role.destroy\n respond_to do |format|\n format.html { redirect_to users_roles_url, notice: 'Users role was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ministerial_role.destroy\n respond_to do |format|\n format.html { redirect_to ministerial_roles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @lab_permissions_role = LabPermissionsRole.find(params[:id])\n @lab_permissions_role.destroy\n\n respond_to do |format|\n format.html { redirect_to lab_permissions_roles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @rol.destroy\n respond_to do |format|\n format.html { redirect_to roles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @userrole = Userrole.find(params[:id])\n @userrole.destroy\n\n respond_to do |format|\n format.html { redirect_to(userroles_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @role = Role.find(params[:id])\n authorize @role\n user = @role.user\n plan = @role.plan\n @role.destroy\n flash[:notice] = _('Access removed')\n deliver_if(recipients: user, key: 'users.added_as_coowner') do |_r|\n UserMailer.plan_access_removed(user, plan, current_user).deliver_now\n end\n redirect_to plan_contributors_path(plan)\n end",
"def destroy\n\nrol = Role.where(:id=>current_user.role).first\n if rol.nombre == \"ACRM\"\n\n\n \n @territorio = Territorio.find(params[:id])\n @territorio.destroy\n\nelse\n flash[:error] ='No tienes permiso para realizar esta accion'\n\nend\n\n\n\n respond_to do |format|\n format.html { redirect_to territorios_url }\n format.json { head :ok }\n end\n end",
"def delete\n @role = get_role\n respond_with @event, @role\n end",
"def destroy\n instance_variable_set \"@#{resource_singular}\", find_member\n if current_user.role==User::ROOT || current_member.user_id == current_user.id\n if current_member.destroy\n flash[:success] = \"#{resource_singular.humanize} removido com sucesso.\"\n response_for :destroy\n else\n flash[:failure] = \"#{resource_singular.humanize} could not be deleted.\"\n response_for :destroy_failed\n end\n end\n end",
"def destroy\n ActiveRecord::Base.transaction do\n @role = Role.find(params[:id])\n @role.destroy\n\n respond_to do |format|\n format.html { redirect_to(roles_url) }\n format.xml { head :ok }\n end\n end\n end",
"def destroy\n @role.destroy\n respond_to do |format|\n flash[:notice] = 'Role was successfully destroyed.'\n format.html { redirect_to roles_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n\n\nrol = Role.where(:id=>current_user.role).first\n if rol.nombre == \"ACRM\"\n \n \n @programa_de_intere = ProgramaDeIntere.find(params[:id])\n @programa_de_intere.destroy\nelse\n flash[:error] ='No tienes permiso para realizar esta accion'\n\nend\n \n \n \n\n respond_to do |format|\n format.html { redirect_to programa_de_interes_url }\n format.json { head :ok }\n end\n end",
"def destroy\n\n\nrol = Role.where(:id=>current_user.role).first\n if rol.nombre == \"ACRM\"\n \n @status_de_la_notificacion = StatusDeLaNotificacion.find(params[:id])\n @status_de_la_notificacion.destroy\n\nelse\n flash[:error] ='No tienes permiso para realizar esta accion'\n\nend\n \n \n \n\n respond_to do |format|\n format.html { redirect_to status_de_la_notificacions_url }\n format.json { head :ok }\n end\n end",
"def destroy\n\n\n\nrol = Role.where(:id=>current_user.role).first\n if rol.nombre == \"ACRM\"\n \n\n @plan_de_ventum = PlanDeVentum.find(params[:id])\n @plan_de_ventum.destroy\n\nelse\n flash[:error] ='No tienes permiso para realizar esta accion'\n\nend\n \n \n \n\n respond_to do |format|\n format.html { redirect_to plan_de_venta_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @tree_node_ac_rights = TreeNodeAcRight.find(params[:id])\n @tree_node_ac_rights.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_tree_node_tree_node_permissions_path }\n format.xml { head :ok }\n end\n end",
"def destroy\n @operations_role = OperationsRole.find(params[:id])\n @operations_role.destroy\n\n respond_to do |format|\n format.html { redirect_to(operations_roles_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @role = Role.find(params[:id])\n @role.destroy\n\n respond_to do |format|\n format.html { redirect_to(roles_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @role = Role.find(params[:id])\n @role.destroy\n\n respond_to do |format|\n format.html { redirect_to(roles_url) }\n format.xml { head :ok }\n end\n end",
"def delete_role(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DeleteRole'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'https'\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :role_name\n\t\t\targs[:query]['RoleName'] = optional[:role_name]\n\t\tend\n\t\tself.run(args)\n\tend"
] | [
"0.7093062",
"0.7026739",
"0.69979346",
"0.692597",
"0.6889344",
"0.6880559",
"0.68731064",
"0.6859878",
"0.6854104",
"0.685093",
"0.6841487",
"0.68375427",
"0.67910445",
"0.67835605",
"0.6782425",
"0.6781933",
"0.6771251",
"0.67655987",
"0.67643267",
"0.67521256",
"0.6746558",
"0.67367697",
"0.6728222",
"0.6720225",
"0.6712381",
"0.67075497",
"0.67061317",
"0.669408",
"0.6694032",
"0.66827965",
"0.6681541",
"0.66720223",
"0.6671956",
"0.6663716",
"0.6661258",
"0.665517",
"0.6646312",
"0.6635961",
"0.66329795",
"0.6621095",
"0.6614622",
"0.6607632",
"0.66068506",
"0.66063607",
"0.66029614",
"0.6599412",
"0.65950876",
"0.65841556",
"0.6566881",
"0.6563029",
"0.6558045",
"0.65562904",
"0.65528446",
"0.6548302",
"0.654786",
"0.6536559",
"0.6535837",
"0.6535837",
"0.6527543",
"0.65270996",
"0.6525861",
"0.6525279",
"0.6525279",
"0.6525279",
"0.6525279",
"0.6525279",
"0.6525279",
"0.652058",
"0.65077883",
"0.64986753",
"0.64938265",
"0.6491418",
"0.6491002",
"0.6490951",
"0.64839303",
"0.64811736",
"0.6479314",
"0.6476103",
"0.6474812",
"0.6473208",
"0.6468922",
"0.6467721",
"0.646751",
"0.64637834",
"0.6462015",
"0.6460013",
"0.6456164",
"0.6454612",
"0.64501894",
"0.6448795",
"0.64450604",
"0.644215",
"0.6434961",
"0.64329416",
"0.6428998",
"0.6427717",
"0.64205205",
"0.64205205",
"0.6419166"
] | 0.6525349 | 61 |
Internal handler for GUILD_EMOJIS_UPDATE | def update_guild_emoji(data)
server_id = data['guild_id'].to_i
server = @servers[server_id]
server.update_emoji_data(data)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update!(**args)\n @custom_emoji = args[:custom_emoji] if args.key?(:custom_emoji)\n @unicode = args[:unicode] if args.key?(:unicode)\n end",
"def update!(**args)\n @custom_emoji = args[:custom_emoji] if args.key?(:custom_emoji)\n @unicode = args[:unicode] if args.key?(:unicode)\n end",
"def update!(**args)\n @emoji = args[:emoji] if args.key?(:emoji)\n end",
"def update!(**args)\n @emoji = args[:emoji] if args.key?(:emoji)\n end",
"def update!(**args)\n @custom_emoji = args[:custom_emoji] if args.key?(:custom_emoji)\n end",
"def update\n handle_orcamento_update\n end",
"def update(msg)\n case msg\n # Handle disconnection from server\n # Note that publishing a :quit event (see #disconnect) will return a\n # :disconnected event when server has closed the connection.\n # Guest accounts and characters are deleted here.\n when :disconnected\n @conn = nil\n unsubscribe_all\n Engine.instance.db.makeswap(id)\n if @character\n world.connected_characters.delete(@character.id)\n world.connected_characters.each do |pid|\n add_event(@character.id,pid,:show,\"#{name} has disconnected.\")\n end\n Engine.instance.db.makeswap(@character.id)\n @character.account = nil\n if @character.name =~ /Guest/i\n world.all_characters.delete(@character.id)\n delete_object(@character.id)\n end\n @character = nil\n end\n if name =~ /Guest/i\n world.all_accounts.delete(id)\n delete_object(id)\n end\n # Issued when a NAWS event occurs\n # Currently this clears and resets the screen. Ideally it should attempt\n # to redraw it.\n when :termsize\n @termsize = @conn.query(:termsize)\n if vtsupport?\n publish(\"[home #{@termsize[1]},1][clearline][cursave]\" +\n \"[home 1,1][scrreset][clear][scrreg 1,#{@termsize[1]-3}][currest]\")\n end\n # Negotiation with client done. Start talking to it.\n when :initdone\n @echo = @conn.query(:echo)\n @termsize = @conn.query(:termsize)\n @terminal = @conn.query(:terminal)\n if vtsupport?\n publish(\"[home #{@termsize[1]},1][clearline][cursave]\" +\n \"[home 1,1][scrreset][clear][scrreg 1,#{@termsize[1]-3}][currest]\")\n sendmsg(LOGO)\n end\n sendmsg(BANNER)\n sendmsg(append_echo(\"login> \"))\n @mode = :name\n # This is a message from our user\n when String\n parse_messages(msg)\n else\n log.error \"Account#update unknown message - #{msg.inspect}\"\n end\n rescue\n # We squash and print out all exceptions here. There is no reason to\n # throw these back at the Connection.\n log.error $!\n end",
"def cmdh_update_resp2(msg_details)\n @log.debug \"UPDATERESPTWO handler\"\n info = YAML::load(msg_details)\n case info[:type] \n when :platf_update\n # need a platform update\n @log.debug \"Platform update is needed\"\n str = \"ATTENZIONE: questo client necessita di un aggiornamento manuale per giocare in internet.\\n\"\n str += \" Vai su cuperativa.invido.it per maggiorni informazioni.\\n\"\n str += \" Senza una versione recente, il gioco in rete non funziona.\\n\"\n str += \" *********** L'ultima versione aggiornata di cuperativa si scarica da: **************\\n\"\n str += \" #{info[:link_platf]}\\n\"\n str += \" *********************************************************\\n\"\n @cup_gui.log_sometext(str) \n #close connection\n @socket_srv.close if @socket_srv\n return\n when :nothing\n # no update, client is OK\n @log.debug \"Client already updated\"\n strtext = u\"Il programma U+00e8 giU+00e0 all'ultima versione.\\n\"\n @cup_gui.log_sometext(strtext)\n return\n when :appli_update\n # need to update the application\n server_name = info[:server].gsub('http://', \"\")\n package_name = info[:file ]\n updater = ClientUpdaterCtrl.new\n updater.set_package_src(server_name, package_name)\n updater.gui_progress = @cup_gui\n updater.net_controller = self\n updater.info_package = info\n begin \n #updater.install_package\n @model_net_data.event_cupe_raised(:ev_startupdate)\n updater.install_package_question(@model_net_data)\n rescue\n @cup_gui.log_sometext(\"ERRORE: Update non riuscito\\n\")\n @cup_gui.log_sometext(\"Riprova l'update, oppure installa la versione completa aggiornata di cuperativa (www.invido.it).\\n\")\n @socket_srv.close if @socket_srv\n end\n else\n @log.error 'Update type not recognized'\n end#case\n end",
"def mte_prepare_updating; send_request_to_mite(\"update\"); end",
"def on_update; end",
"def update ; end",
"def update\n respond_to do |format|\n kai2_ji7_params[:無齊記號].slice! '!'\n if @kai2_ji7.update(kai2_ji7_params)\n format.html { redirect_to edit_kai2_ji7_path(@kai2_ji7), notice: 'Kai2 ji7 was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @kai2_ji7.errors, status: :unprocessable_entity }\n end\n end\n end",
"def after_update; end",
"def after_update; end",
"def on_modifying_entry(state, event, *event_args)\n super\n\n # Verify validity of the submission. # TODO: simulation - remove\n if simulating\n # From UploadController#update:\n # @item, failed = upload_edit(**data)\n __debug_sim('CODE') do\n args = \"data=#{submission.data.inspect}\"\n opt = 'index: false'\n \"@item, failed = upload_edit(#{args}, #{opt})\"\n end\n bad = nil\n if (db_fail = submission.db_failure)\n self.failures << 'DB create failed'\n elsif (bad = !(submission.metadata_valid = !submission.invalid_entry))\n self.failures << 'bad metadata'\n else\n self.succeeded << submission.id\n end\n if db_fail\n __debug_sim('[edit_db_failure: true]')\n __debug_sim('The database entry could not be updated.')\n elsif bad\n __debug_sim('[edit_invalid_entry: true]')\n __debug_sim('The entry is invalid/incomplete.')\n __debug_sim('(NOTE: PROBABLE FAILURE OF CLIENT-SIDE FORM VALIDATION)')\n else\n __debug_sim('[edit_invalid_entry: false]')\n __debug_sim('[edit_db_failure: false]')\n end\n end\n\n # Verify validity of the submission.\n unless simulating\n wf_validate_submission(*event_args)\n end\n\n valid = ready?\n\n # TODO: simulation - remove\n if valid\n __debug_sim('The database entry was updated.')\n else\n __debug_sim('System generates a form error message to be displayed.')\n end\n\n # Automatically transition to the next state based on submission status.\n if valid\n advance! # NOTE: => :modified\n else\n reject! # NOTE: => :editing\n end\n self\n end",
"def edit_emoji(auth, server_id, emoji_id, name, reason = nil)\n MijDiscord::Core::API.request(\n :guilds_sid_emojis_eid,\n server_id,\n :patch,\n \"#{MijDiscord::Core::API::APIBASE_URL}/guilds/#{server_id}/emojis/#{emoji_id}\",\n { name: name }.to_json,\n Authorization: auth,\n content_type: :json,\n 'X-Audit-Log-Reason': reason\n )\n end",
"def update_message(data); end",
"def update_message(data); end",
"def update() end",
"def exp_changed\n @edit = session[:edit]\n @edit[@expkey].update_from_expression_editor(params)\n # See if only a text value changed\n if params[:chosen_value] || params[:chosen_regkey] || params[:chosen_regval] ||\n params[:chosen_cvalue || params[:chosen_suffix]] || params[:alias]\n render :update do |page|\n page << javascript_prologue\n end\n elsif @refresh_div.to_s == 'flash_msg_div'\n javascript_flash(:flash_div_id => 'exp_editor_flash')\n else\n render :update do |page|\n page << javascript_prologue\n page.replace(\"exp_editor_flash\", :partial => \"layouts/flash_msg\", :locals => {:flash_div_id => 'exp_editor_flash'})\n page << \"miqScrollTop();\" if @flash_array.present?\n page.replace(\"exp_atom_editor_div\", :partial => \"layouts/exp_atom/editor\")\n\n page << ENABLE_CALENDAR if @edit[@expkey].calendar_needed?\n @edit[@expkey].render_values_to(page)\n page << \"miqSparkle(false);\" # Need to turn off sparkle in case original ajax element gets replaced\n end\n end\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update\n\tefid = params[:extraction_form_id]\n\tsectionv = params[:section]\n\tdata_elementv = params[:data_element]\n @ef_instruction = EfInstruction.find(:first, :conditions=>[\"ef_id = ? and section = ? and data_element = ?\", efid, sectionv, data_elementv])\n if @ef_instruction.nil?\n @ef_instruction = EfInstruction.new(params[:ef_instruction])\n @ef_instruction.ef_id = efid\n @ef_instruction.section = sectionv\n @ef_instruction.data_element = data_elementv\n else\n @ef_instruction.instructions = params[:ef_instruction][\"instructions\"]\n end\n \n if @ef_instruction.save\n puts \"================== ef_instructions_controller::update close_winder - \"+\"new_\"+sectionv.downcase+\"_instr_entry\"\n\t\t@close_window = \"new_\"+sectionv.downcase+\"_instr_entry\"\n else\n\t\tproblem_html = create_error_message_html(@extraction_form_arm.errors)\n\t\tflash[:modal_error] = problem_html\n\t\t@error_partial = 'layouts/modal_info_messages'\n end\n # @ef_user_instructions is used to pass instructions to the various EF sections\n @ef_user_instructions = @ef_instruction.instructions\n # @table_container must be unique to locate which DIV instructions to update, render the @table_partial\n\t@table_container = sectionv.downcase+\"_user_instructions\"\n\t@table_partial = \"extraction_forms/instructions\"\n render \"shared/saved.js.erb\"\n end",
"def update\n\t\t# Left empty intentionally.\n\tend",
"def update;end",
"def update; end",
"def update\n \t\n end",
"def update\n \t\n end",
"def altered_world_event; end",
"def update!(**args)\n @emoji = args[:emoji] if args.key?(:emoji)\n @reaction_count = args[:reaction_count] if args.key?(:reaction_count)\n end",
"def updated(message)\n end",
"def update_help\n enc = $game_party.bestiary_known_data[:ene].keys.size\n text = \"Encountered: #{enc}/#{SES::Bestiary.get_enemy_list.size}\"\n @help_window.set_text(text)\n end",
"def after_update\n end",
"def after_update\n end",
"def update\n \n end",
"def update\n\n @imes_qh_bdlc.qhyh = current_user.email.split('@').first.upcase\n @imes_qh_bdlc.qhsj = Time.now\n @imes_qh_bdlc.qhjg = params[:qhjg]\n if params[:qhnr].present?\n @imes_qh_bdlc.qhnr = params[:qhnr]\n else\n @imes_qh_bdlc.qhnr = '同意' if params[:qhjg].eql?('Y')\n @imes_qh_bdlc.qhnr = '退件' if params[:qhjg].eql?('N')\n @imes_qh_bdlc.qhnr = '會簽' if params[:qhjg].eql?('H')\n end\n\n @imes_qh_bdlc.qhzt = '3'\n @imes_qh_bdlc.create_hui_qian(params[:email]) if params[:email].present?\n\n respond_to do |format|\n if @imes_qh_bdlc.save\n if params[:file].present?\n url = \"http://172.31.4.177:8080/iMes/FileUploader?action=QianHe&GSDM=#{@imes_qh_bdlc.gsdm}&BDBH=#{@imes_qh_bdlc.bdbh}&BDDM=#{@imes_qh_bdlc.bddm}&BZDM=#{@imes_qh_bdlc.bzdm}\"\n Timeout::timeout(30) do\n RestClient.post url, {file: params[:file]}\n end\n end\n classname = \"Imes::#{@imes_qh_bdlc.bddm}h\"\n if @imes_qh_bdlc.qhlx.eql?('A') and Object.const_defined?(classname)\n if @imes_qh_bdlc.qhjg.eql?('Y')\n klass = Object.const_get(classname)\n if klass.instance_methods.include?(:after_approved)\n object = klass.find(@imes_qh_bdlc.bdbh)\n object.after_approved\n end\n elsif @imes_qh_bdlc.qhjg.eql?('N')\n klass = Object.const_get(classname)\n if klass.instance_methods.include?(:after_rejected)\n object = klass.find(@imes_qh_bdlc.bdbh)\n object.after_rejected\n end\n end\n end\n format.html { redirect_to root_url }\n format.json { render :show, status: :ok, location: @imes_qh_bdlc }\n else\n format.html { redirect_to root_url }\n format.json { render json: @imes_qh_bdlc.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update()\n end",
"def update \n end",
"def quickupdate\r\n begin\r\n # @material = Material.new(curriculum_params)\r\n # if !@material.update_attributes(:material_name => @material.material_name, :material_type => @material.material_type_id, :material_url => @material.material_url, :description => @material.description)\r\n # respond_to do |format|\r\n # flash.now[:error] = t('comments.msg_reply_fail')\r\n # format.js { render action: 'reply_fail' }\r\n # #format.html\r\n # end\r\n # end\r\n action_id = BSON::ObjectId.from_string(params[:aes_action][:id])\r\n action = Action.find_by(:id => action_id)\r\n if action.nil?\r\n # if !action.save\r\n # respond_to do |format|\r\n # if action.errors\r\n # flash.now[:error] = action.errors.full_messages.to_sentence(:last_word_connector => ', ')\r\n # else\r\n # flash.now[:error] = t('action.msg_update_failed')\r\n # end\r\n # format.js { render partial: 'layouts/error' }\r\n # # format.html { render action: 'layouts/error' }\r\n # end\r\n # end\r\n respond_to do |format|\r\n flash.now[:error] = t('action.msg_not_found')\r\n format.js { render partial: 'mentor/error' }\r\n # format.html { render action: 'layouts/error' }\r\n end\r\n else\r\n if !action.update_attributes(:action_name => params[:aes_action][:action_name], :description => params[:aes_action][:description])\r\n respond_to do |format|\r\n if action.errors\r\n flash.now[:error] = action.errors.full_messages.to_sentence(:last_word_connector => ', ')\r\n else\r\n flash.now[:error] = t('action.msg_update_failed')\r\n end\r\n format.js { render partial: 'mentor/error' }\r\n # format.html { render action: 'layouts/error' }\r\n end\r\n else\r\n # response\r\n respond_to do |format|\r\n flash.now[:notice] = t('action.msg_update_success')\r\n format.js { render partial: 'mentor/success'}\r\n # format.html\r\n end\r\n end\r\n end\r\n rescue Exception => e\r\n logger.error(\"Action save error: #{e.message}\")\r\n respond_to do |format|\r\n flash.now[:error] = t('action.msg_update_failed')\r\n format.js { render partial: 'mentor/error' }\r\n # format.html { render action: 'layouts/error' }\r\n end\r\n end\r\n end",
"def update\r\n\r\n end",
"def update\n \n #明細マスターのパラメータ補正 \n #add180310\n set_params_replenishment\n \n\trespond_to do |format|\n #見積一覧IDをセット\n\t set_quotation_and_delivery_header\n\t \n #品目マスターへの追加・更新\n\t create_or_update_material\n\t\n\t #新規か更新かの判定処理追加 add171114\n\t status = nil\n\t \n\t action_flag = params[:working_specific_middle_item][:action_flag]\n\t if action_flag == \"new\"\n\t\t #add171122\n\t\t search_records =\n WorkingSpecificMiddleItem.exists?(:working_middle_item_name => params[:working_specific_middle_item][:working_middle_item_name])\n\t\t \n\t\t if search_records.blank?\n\t\t\n\t\t #attributesの\"id\"のみ抹消する(しないとエラー)\n\t\t if params[:working_specific_middle_item][:working_specific_small_items_attributes].present?\n\t\t params[:working_specific_middle_item][:working_specific_small_items_attributes].flatten.each do |item|\n item.delete(\"id\")\n end\n\t\t end\n\t\t #\n\t\t @working_specific_middle_item = WorkingSpecificMiddleItem.new(working_specific_middle_item_params)\n\t status = @working_specific_middle_item.save\n\t else\n\t\t #同一の品名ならば、更新とみなす(新規ボタンを押しても更新として扱い)\n\t\t status = @working_specific_middle_item.update(working_specific_middle_item_params)\n\t\t end\n\t elsif action_flag == \"edit\"\n \n status = @working_specific_middle_item.update(working_specific_middle_item_params)\n\t end\n\t #\n\n\t #if @working_specific_middle_item.update(working_specific_middle_item_params)\n\t if status == true #upa171114\n \n if params[:working_specific_middle_item][:master_insert_flag] == \"true\"\n \n\t\t if action_flag == \"new\" #登録ボタンを押した場合のみ\n \t\t\t#共通(明細)マスターへの新規追加\n create_common_master\n\t\t end\n end\n \n\t\t#add171108\n\t #手入力用IDの場合は、単位マスタへも登録する。\n\t set_working_unit\n\t\t\n\t\tif params[:move_flag] == \"1\"\n\t\t#内訳\n format.html {redirect_to quotation_detail_large_classifications_path(:quotation_header_id => params[:quotation_header_id], \n :quotation_header_name => params[:quotation_header_name], :move_flag => params[:move_flag])}\n\t\telsif params[:move_flag] == \"2\"\n\t\t#明細\n\t\t format.html {redirect_to quotation_detail_middle_classifications_path(:quotation_header_id => params[:quotation_header_id], \n :quotation_header_name => params[:quotation_header_name], :quotation_detail_large_classification_id => params[:quotation_detail_large_classification_id],\n :working_large_item_name => params[:working_large_item_name], :working_large_specification => params[:working_large_specification],\n\t\t\t :move_flag => params[:move_flag])}\n\t\telsif params[:move_flag] == \"3\"\n\t\t#納品内訳\n format.html {redirect_to delivery_slip_detail_large_classifications_path(:delivery_slip_header_id => params[:delivery_slip_header_id], \n :delivery_slip_header_name => params[:delivery_slip_header_name], :move_flag => params[:move_flag])}\n\t\telsif params[:move_flag] == \"4\"\n\t\t#納品明細\n\t\t format.html {redirect_to delivery_slip_detail_middle_classifications_path(:delivery_slip_header_id => params[:delivery_slip_header_id], \n :delivery_slip_header_name => params[:delivery_slip_header_name], :delivery_slip_detail_large_classification_id => params[:delivery_slip_detail_large_classification_id],\n :working_large_item_name => params[:working_large_item_name], :working_large_specification => params[:working_large_specification],\n\t\t\t :move_flag => params[:move_flag])}\n\t\telse\n\t\t#単独フォームからの場合(未使用)\n format.html { redirect_to @working_specific_middle_item, notice: 'Working specific middle item was successfully updated.' }\n format.json { render :show, status: :ok, location: @working_specific_middle_item }\n \tend\n\t\t\n else\n format.html { render :edit }\n format.json { render json: @working_specific_middle_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update \n end",
"def update\r\n # write some gangsta code here\r\n end",
"def update!(**args)\n @idle_shutdown_message = args[:idle_shutdown_message] if args.key?(:idle_shutdown_message)\n end",
"def update\r\n end",
"def update\r\n end",
"def update\r\n end",
"def update\r\n end",
"def update\n # Not generally used\n end",
"def update\n # Not generally used\n end",
"def update\r\n # @events = Event.find(params[:id])\r\n if @event.user_id.present?\r\n @user = User.find(@event.user_id)\r\n else\r\n @user = current_user\r\n end\r\n @pre_color = @event.event_type.present? ? @event.event_type.color : @event.dot_color\r\n\r\n new_params = event_params\r\n if new_params.has_key?(:workgroup)\r\n new_params.delete(:workgroup)\r\n end\r\n \r\n @old_title = @event.title\r\n \r\n new_params[:dot_color] = EventType.find(new_params[:type_id]).color;\r\n\r\n respond_to do |format|\r\n if @event.update(new_params)\r\n @adminOnJuror = ''\r\n if @event.user_id.present? and @event.school_id.present? and current_user.user_type == 'admin'\r\n @adminOnJuror = 'juror';\r\n end\r\n if @event.user_id?\r\n @owner = User.find(@event.user_id)\r\n else\r\n @owner = School.find(@event.school_id)\r\n end\r\n if event_params.has_key?(:workgroup)\r\n @event.event_workgroup.update(workgroup: Workgroup.find(event_params[:workgroup]));\r\n end\r\n format.html { redirect_to @event, notice: 'Händelsen har uppdaterats!' }\r\n format.json { head :no_content } \r\n format.js \r\n else\r\n format.html { render action: 'edit' }\r\n format.json { render json: @event.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n respond_to do |format|\n if @ephem.update(ephem_params)\n format.html { redirect_to @ephem, notice: 'Ephem was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @ephem.errors, status: :unprocessable_entity }\n end\n end\n end",
"def upc_e; end",
"def update\r\n end",
"def update\n respond_to do |format|\n if @adminmatrixgenu.update(adminmatrixgenu_params)\n format.html { redirect_to @adminmatrixgenu, notice: 'Adminmatrixgenu was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @adminmatrixgenu.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @yeji.update(yeji_params)\n format.html { redirect_to edit_yeji_path(@yeji), notice: 'Test was successfully updated.' }\n format.json { render :show, status: :ok, location: @yeji }\n else\n format.html { render :edit }\n format.json { render json: @yeji.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n \n end",
"def update!(**args)\n @emoji = args[:emoji] if args.key?(:emoji)\n @name = args[:name] if args.key?(:name)\n @user = args[:user] if args.key?(:user)\n end",
"def update\n respond_to do |format|\n if @lientheme.update(lientheme_params)\n format.html { redirect_to lienthemes_url, notice: 'Lientheme was successfully updated.' }\n format.json { render :show, status: :ok, location: @lientheme }\n else\n format.html { render :edit }\n format.json { render json: @lientheme.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @jeon.update(jeon_params)\n format.html { redirect_to @jeon, notice: 'Jeon was successfully updated.' }\n format.json { render :show, status: :ok, location: @jeon }\n else\n format.html { render :edit }\n format.json { render json: @jeon.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_mechanism\n\t\ttextos = params[:newTexts]\n\t\tif textos.nil?\n\t\t\ttextos = []\n\t\tend\n\n\t\tindex = params[:idResp].to_i\n\t\t# ES: Asigna el tipo de responsabilidad según el index:\n\t\t# EN: Assign the responsibility type according the index:\n\t\trespType = ''\n\t\tcase index\n\t\twhen 1\n\t\t\trespType = DELEG_RESP_1\n\t\twhen 2\n\t\t\trespType = DELEG_RESP_2\n\t\twhen 3\n\t\t\trespType = DELEG_RESP_3\n\t\twhen 4\n\t\t\trespType = DELEG_RESP_4\n\t\twhen 5\n\t\t\trespType = DELEG_RESP_5\n\t\tend\n \n # ES: Busca el detalle:\n # EN: Search the detail:\n\t\tdetail = MapDetail.where(\"decision_map_id = ? AND governance_decision_id = ? AND responsability_type = ?\", params[:idMap].to_i, params[:idDec].to_i, respType).first\n\t\ttxtActual = ''\n\n\t\tif detail.nil? # ES: Si no existia, lo crea: - EN: If not exist, create it:\n\t\t\tdetail = MapDetail.new\n\t \tdetail.governance_decision_id = params[:idDec].to_i\n\t \tdetail.decision_map_id = params[:idMap].to_i\n\t \tdetail.responsability_type = respType\n\t\tend\n\n # ES: Genera el nuevo texto y lo asigna\n # EN: Generates the new text and assign it\n\t\ttextos.each do |t|\n\t\t\tif txtActual == ''\n\t\t\t\ttxtActual+= t\n\t\t\telse\n\t\t\t\ttxtActual+= '|' + t\n\t\t\tend\n\t\tend\n\n\t\t# ES: La respuesta serán los mecanismos actuales:\n\t\t# EN: The answer will be the current mechanisms:\n\t\tmechsActuales = []\n\n\t\tif txtActual == ''\n\t\t\t# ES: Debe borrarlo, porque no va a tener nada\n\t\t\t# EN: Need to delete it, because will be empty\n\t\t\tMapDetail.delete(detail)\n\t\t\t# ES: Guarda el detalle:\n\t\t\t# EN: Save the detail:\n\t\t\trespond_to do |format|\n\t\t\t\tformat.json {render :json => mechsActuales}\n\t \tend\n\t\telse\n\t\t\tdetail.complementary_mechanisms = txtActual\n\t\t\t# ES: Guarda el detalle:\n\t\t\t# EN: Save th detail:\n\t\t\trespond_to do |format|\n\t \tif detail.save # OK\n\t \t\t# ES: Obtiene los mecanismos actuales y los envia:\n\t \t\t# EN: Get the current mechanisms and send them:\n\t \t\tidMechs = txtActual.split(\"|\")\n\t \t\tmechsActuales = ComplementaryMechanism.where(id: idMechs)\n\t \t\tformat.json {render :json => mechsActuales}\n\t \telse # ERROR\n\t \t\t\tformat.json {render :json => nil}\n\t \t\tend\n\t \tend\n\t\tend\n\tend",
"def updated_data\n\tend",
"def update\n error = []\n attachment = params[:kyu_entry].delete :attachment\n respond_to do |format|\n if @kyu_entry.update_attributes(params[:kyu_entry])\n update_entry = render_to_string(partial: \"kyu_entry\",\n locals:{kyu_entry: @kyu_entry})\n format.json { render json: update_entry.to_json}\n else\n format.json { render json: @kyu_entry.errors,\n status: :unprocessable_entity }\n end\n end\n end",
"def update(...)\n end",
"def fbo_updated_form\n end",
"def update\n @xinyongtongji = Xinyongtongji.find(params[:id])\n\n respond_to do |format|\n if @xinyongtongji.update_attributes(params[:xinyongtongji])\n format.html { redirect_to @xinyongtongji, notice: 'Xinyongtongji was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @xinyongtongji.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @eocm.update(eocm_params)\n format.html { redirect_to @eocm, notice: 'EOCM was successfully updated.' }\n format.json { render :show, status: :ok, location: @eocm }\n else\n format.html { render :edit }\n format.json { render json: @eocm.errors, status: :unprocessable_entity }\n end\n end\n end",
"def form_field_changed\n return unless load_edit(\"ems_edit__#{params[:id]}\")\n get_form_vars\n\n changed = edit_changed?\n render :update do |page|\n page << javascript_prologue\n if params[:server_emstype] || params[:default_security_protocol] # Server/protocol type changed\n page.replace_html(\"form_div\", :partial => \"shared/views/ems_common/form\")\n end\n if params[:server_emstype] # Server type changed\n unless @ems.kind_of?(ManageIQ::Providers::CloudManager)\n # Hide/show C&U credentials tab\n page << \"$('#metrics_li').#{params[:server_emstype] == \"rhevm\" ? \"show\" : \"hide\"}();\"\n end\n if [\"openstack\", \"openstack_infra\"].include?(params[:server_emstype])\n page << \"$('#port').val(#{j_str(@edit[:new][:port].to_s)});\"\n end\n # Hide/show port field\n page << \"$('#port_tr').#{%w(openstack openstack_infra rhevm).include?(params[:server_emstype]) ? \"show\" : \"hide\"}();\"\n end\n page << javascript_for_miq_button_visibility(changed)\n if @edit[:default_verify_status] != @edit[:saved_default_verify_status]\n @edit[:saved_default_verify_status] = @edit[:default_verify_status]\n page << \"miqValidateButtons('#{@edit[:default_verify_status] ? 'show' : 'hide'}', 'default_');\"\n end\n if @edit[:metrics_verify_status] != @edit[:saved_metrics_verify_status]\n @edit[:saved_metrics_verify_status] = @edit[:metrics_verify_status]\n page << \"miqValidateButtons('#{@edit[:metrics_verify_status] ? 'show' : 'hide'}', 'metrics_');\"\n end\n if @edit[:amqp_verify_status] != @edit[:saved_amqp_verify_status]\n @edit[:saved_amqp_verify_status] = @edit[:amqp_verify_status]\n page << \"miqValidateButtons('#{@edit[:amqp_verify_status] ? 'show' : 'hide'}', 'amqp_');\"\n end\n if @edit[:bearer_verify_status] != @edit[:saved_bearer_verify_status]\n @edit[:saved_bearer_verify_status] = @edit[:bearer_verify_status]\n page << \"miqValidateButtons('#{@edit[:bearer_verify_status] ? 'show' : 'hide'}', 'bearer_');\"\n end\n end\n end",
"def update\n\tend",
"def update\n\tend",
"def update\n\tend",
"def update\n\tend",
"def update\n\tend",
"def update\r\n handle_venda_update\r\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n #Nothing necessary\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end",
"def update\n end"
] | [
"0.56084317",
"0.56084317",
"0.5572472",
"0.5572472",
"0.5488843",
"0.5470801",
"0.54296994",
"0.5419812",
"0.53795534",
"0.5320633",
"0.53203297",
"0.53073967",
"0.53021216",
"0.53021216",
"0.5289584",
"0.527835",
"0.5277607",
"0.5277607",
"0.521725",
"0.5200382",
"0.51902205",
"0.51902205",
"0.51902205",
"0.51902205",
"0.51902205",
"0.51902205",
"0.51902205",
"0.51902205",
"0.5128081",
"0.51062524",
"0.51016355",
"0.50843865",
"0.5068143",
"0.5068143",
"0.50535893",
"0.5051781",
"0.5044239",
"0.5041781",
"0.5040089",
"0.5040089",
"0.50325584",
"0.50189376",
"0.50156003",
"0.50064087",
"0.4985763",
"0.49852183",
"0.4981528",
"0.49760276",
"0.49670306",
"0.49637595",
"0.4962678",
"0.4962678",
"0.4962678",
"0.4962678",
"0.49622422",
"0.49622422",
"0.4950992",
"0.49508306",
"0.4944498",
"0.49335387",
"0.4923625",
"0.49151233",
"0.49105138",
"0.49064547",
"0.48975098",
"0.48956022",
"0.48948276",
"0.48930678",
"0.48901206",
"0.48863152",
"0.4882293",
"0.48730612",
"0.48588544",
"0.48587844",
"0.4858214",
"0.4858214",
"0.4858214",
"0.4858214",
"0.4858214",
"0.4844124",
"0.48287687",
"0.48287687",
"0.48287687",
"0.48287687",
"0.48287687",
"0.48287687",
"0.48287687",
"0.48287687",
"0.48287687",
"0.48287687",
"0.48287687",
"0.4827086",
"0.48251468",
"0.48251468",
"0.48251468",
"0.48251468",
"0.48251468",
"0.48251468",
"0.48251468",
"0.48251468"
] | 0.5712303 | 0 |
Internal handler for MESSAGE_CREATE | def create_message(data); end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n create_message(params)\n end",
"def handle_create_message(message, obj, response)\n new_name = message[:name] || message[:hrn]\n msg_props = message.properties.merge({ hrn: new_name })\n\n obj.create(message[:type], msg_props, &lambda do |new_obj|\n begin\n response[:res_id] = new_obj.resource_address\n response[:uid] = new_obj.uid\n\n # Getting property status, for preparing inform msg\n add_prop_status_to_response(new_obj, msg_props.keys, response)\n\n if (cred = new_obj.certificate)\n response[:cert] = cred.to_pem_compact\n end\n # self here is the parent\n self.inform(:creation_ok, response)\n rescue => ex\n err_resp = message.create_inform_reply_message(nil, {}, src: resource_address)\n err_resp[:reason] = ex.to_s\n error \"Encountered exception, returning ERROR message\"\n debug ex.message\n debug ex.backtrace.join(\"\\n\")\n return self.inform(:error, err_resp)\n end\n end)\n end",
"def new_message\n end",
"def creating( msg )\n @log.info \"creating #{msg}\"\n end",
"def create\n @message = Message.new(message_params)\n create_q(@message)\n end",
"def create\n\t\tresponse = CreateMessageService.new(create_params).perform\n\t\tif response.success?\n\t\t\tmessage = response.result\n\t\t\trender_message_success(message)\n\t\telse\n\t\t\trender_error(:bad_request, response.errors)\n\t\tend\n\tend",
"def create\n @message = Message.new(message_params)\n @message.message_type = 'Reqular Message `'\n respond_to do |format|\n if @message.save\n format.html { redirect_to @message, notice: 'Message was successfully created.' }\n format.json { render :show, status: :created, location: @message }\n else\n format.html { render :new }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def creating( msg )\n @log.info \"creating #{msg}\"\n end",
"def create\n @conversation = Conversation.find(params[:conversation_id])\n @message = @conversation.messages.create(:body => params[:message][:body], :user_id => session[:user_id], :user_name => session[:user_name])\n\n #logger.info 'PARAMS@@@@@@@@@@@'\n #logger.info params[:message_body]\n\n respond_to do |format|\n if @message.save\n\n desc = @conversation.topic + \": \\\"\" + @message.body + \"\\\"\"\n add_event( EVENT_NEW_MESSAGE, desc[0,150], EVENTSOURCE_USER, session[:user_id], session[:user_name], nil)\n\n #MessageMailer.welcome_email(current_user).deliver\n\n format.html { redirect_to(pad_conversations_path(@pad), :notice => 'Message was successfully created.') }\n format.xml { render :xml => @message, :status => :created, :location => @message }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @message.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n # p \"MessagesController, create, here is message params\" + message_params.to_s\n message = Message.new message_params\n message.current_user = @user.id\n message.created_at = DateTime.now\n # only if have parent\n if message.save\n # even if user or owner had deleted the conversation (marked it deleted or deleted_by_user = true),\n # if one side responds to the message, the conversation accessible to user who deleted it (ie deleted and deleted_by_user = false)\n @conversation.deleted = false\n @conversation.deleted_by_user = false\n @conversation.trashed = false\n @conversation.trashed_by_user = false\n @conversation.archived = false\n @conversation.archived_by_user = false\n @conversation.save\n booking_serializer = nil\n if params[:booking_id]\n booking = Booking.find_by(id: params[:booking_id])\n # message_serializer = parse_json message\n booking_serializer = parse_json booking\n end\n conversation_serializer = parse_json @conversation\n json_response \"Created message succesfully\", true, {conversation: conversation_serializer, booking: booking_serializer}, :ok\n else\n # p \"MessagesController, create, in if else \" + message.to_s\n json_response \"Create message failed\", false, {}, :unprocessable_entity\n end\n end",
"def create\n\n logger.info params[:message].to_yaml\n @message = Message.new(params[:message])\n\n if @message.save\n UserMailer.new_message(@message).deliver\n redirect_to user_messages_path(@message.receiver)\n else\n # @messages = Message.where(\"(sender_id = ? AND receiver_id = ?) OR (sender_id = ? AND receiver_id = ?)\", current_user.id, @user.id, @user.id, current_user.id)\n render :template => user_messages_path(@message.receiver_id)\n \n end\n \n end",
"def non_atomic_create\n messages_requested = @room.messages_requested.increment\n @room.send_message_to_requested_channel(@room.messages_requested.value)\n if @room.messages_posted <= @room.max_messages\n if @message.save\n @room.messages_posted.increment\n @room.send_message_to_posted_channel(@room.messages_posted.value)\n @room.send_message_to_chat_channel(render_message_to_string)\n render nothing: true\n else\n logger.info @message.errors.inspect\n end\n else\n render nothing: true\n end\n end",
"def create\n # @message = Message.new(message_params)\n # @message is built by CanCanCan\n respond_to do |format|\n if @message.save\n @message.notify(:commoners, group: @message.conversation) if @message.in_conversation?\n @message.notify(:commoners, group: @message.discussion) if @message.in_discussion?\n format.html { redirect_to success_path, notice: _('Message sent') }\n else\n @new_message = @message\n @messages = Message.where(messageable: messageable)\n format.html { render \"#{messageable.class.class_name.downcase.pluralize}/show\" }\n end\n end\n end",
"def create\n render(status: :forbidden, text: 'Invalid message') and return if params[:message].blank? or params[:message][:content].blank?\n @channel = Channel.find(params[:channel_id])\n @message = @channel.messages.create(params.require(:message).permit(:content))\n @message.user_name = session[:user_name]\n\n if @message.save\n Pusher['presence-channel-' + params[:channel_id]].trigger('message_added', {message: {user_name: h(@message.user_name), content: view_context.auto_link(@message.content)}, time: @message.created_at.localtime.strftime('%H:%M')})\n render status: :created, body: nil\n else\n render status: :forbiden, text: 'The message can\\'t save'\n end\n end",
"def create\n #initial message hash exist only when comming from offer post. Message from inbox does not contain initial_message\n if(params[:initial_message] == \"true\")\n # Check if the users had sent message between them\n unless Usercontact.where(user_id: current_user.id, contacted_id: params[:user_to_id]).exists?\n messagebox = Messagebox.create()\n\n Usercontact.create(user_id: current_user.id, contacted_id: params[:user_to_id], messagebox_id: messagebox.id)\n # This can be written in callback but dont know how to do it...\n Usercontact.create(user_id: params[:user_to_id], contacted_id: current_user.id, messagebox_id: messagebox.id)\n end\n end\n\n\n @message = Message.new(message_params)\n\n respond_to do |format|\n if @message.save\n\n unless @message.user_to.email.blank?\n MessageNotificationMailer.message_notify(@message).deliver\n end\n\n if(params[:initial_message] == true)\n format.html { redirect_to inbox_index_path, notice: 'Message was successfully created.' }\n else\n format.html { redirect_to inbox_index_path }\n end\n format.json { render :show, status: :created, location: @message }\n else\n format.html { render :new }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @message = Message.new(message_params)\n respond_to do |format|\n if @message.save\n format.json {render json: :created}\n else\n format.json {render json: \"not created\"}\n end\n end\n end",
"def create\n msg = Message.new(message_params)\n msg.user_id = current_user.id\n msg.status = 'closed' if params[:close_tkt]\n respond_to do |format|\n if msg.save\n parent_msg = Message.where(id: msg.message_id).first if msg.message_id\n @message = parent_msg ? parent_msg : msg\n parent_msg ? MessageMailer.new_reply(parent_msg, msg).deliver : MessageMailer.new_message(msg).deliver\n format.html { redirect_to @message, notice: 'Message was successfully created.' }\n format.json { render :show, status: :created, location: @message }\n else\n parent_msg = Message.where(id: msg.message_id).first if msg.message_id\n @message = parent_msg ? parent_msg : msg\n format.html { render :new }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def atomic_create\n @room.messages_requested.increment do |messages_requested|\n @room.send_message_to_requested_channel(messages_requested)\n if messages_requested <= @room.max_messages\n @room.messages_posted.increment\n @room.send_message_to_posted_channel(@room.messages_posted.value)\n if @message.save\n @room.send_message_to_chat_channel(render_message_to_string)\n render nothing: true\n else\n logger.info @message.errors.inspect\n end\n else\n render nothing: true\n end\n end\n end",
"def create\n @message = Message.new(params[:message].except(:reference_to))\n if params[:message][:reference_to]\n ref = Message.find_by_guid( params[:message][:reference_to] )\n if !ref\n render :status => :bad_request and return\n end\n @message.reference_to = ref.id\n end\n @message.channel = @channel\n @message.poster = @user\n if !@message.save\n render_json :status => :bad_request,\n :messages => @message.errors.full_messages and return\n end\n render_json :status => :created, :entry => @message and return\n end",
"def create\n @message = current_owner.messages_as_sender.new(message_params)\n respond_to do |format|\n if @message.save\n format.html { redirect_to messages_path, notice: 'Message was successfully created.' }\n format.json { render :show, status: :created, location: @message }\n else\n format.html { render :new }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n # We only allow from system type useres\n return head :forbidden unless current_user.system?\n @message = current_account.dte_messages.new(message_params)\n #@message.sent_date = Time.parse(message_params[:sent_date]).to_s(:db) unless message_params[:sent_date].nil?\n respond_to do |format|\n if @message.save\n format.html { redirect_to @message, notice: 'Message was successfully created.' }\n format.json { render :show, status: :created, location: @message }\n else\n format.html { render :new }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n @message = current_user.messages.new(message_params)\n\n if @message\n respond_to do |format|\n if @message.save\n # debugger\n format.html do\n redirect_to @message, notice: 'Message was successfully created.'\n end\n format.json { render :_message }\n else\n format.html { render action: \"new\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"def message_template; end",
"def create\n if !params[:callback].nil? && !params[:id].nil?\n @message_table = MessageTable.where(\"id = ?\", params[:id]).first\n if @message_table.nil?\n render :text => \"#{params[:callback]}({\\\"status\\\" : \\\"error\\\", \\\"msg\\\" : \\\"信息表不存在!\\\"})\"\n elsif !@message_table.effective?\n render :text => \"#{params[:callback]}({\\\"status\\\" : \\\"error\\\", \\\"msg\\\" : \\\"信息表已过期!\\\"})\"\n else\n _message_object = {}\n @message_table.message_columns.each do |message_column|\n if message_column.type_id == 3\n if params[:message_table][message_column.column_name.to_sym].nil?\n _message_object[message_column.column_name] = []\n else\n if params[:message_table][message_column.column_name.to_sym].kind_of?(Array)\n _message_object[message_column.column_name] = params[:message_table][message_column.column_name.to_sym]\n else\n _message_object[message_column.column_name] = [].push(params[:message_table][message_column.column_name.to_sym])\n end\n end\n else\n _message_object[message_column.column_name] = params[:message_table][message_column.column_name.to_sym] || ''\n end\n end\n @message_text = MessageText.new\n @message_text.message_table_id = @message_table.id\n @message_text.text = _message_object\n @message_text.ip = request.remote_ip\n @message_text.created_at = DateTime.now\n @message_text.updated_at = DateTime.now\n if !current_user.nil?\n @message_text.user_id = current_user.uid\n @message_text.user_name = current_user.name\n end\n @message_text.save\n render :text => \"#{params[:callback]}({\\\"status\\\" : \\\"success\\\", \\\"msg\\\" : \\\"信息提交成功!\\\"})\"\n end\n \n end\n end",
"def create\n @message = current_user.send_message params[:message]\n if @message.new_record?\n render :action => \"new\"\n else\n flash[:notice] = \"The message was saved successfully.\"\n redirect_to messages_path\n end\n end",
"def create\n id = name_to_id(params[:message][:user_id])\n if( id != -1)\n params[:message][:user_id] = name_to_id(params[:message][:user_id])\n else\n redirect_to new_message_path, alert: \"Can't find user #{params[:message][:user_id]}\"\n return\n end\n \n @message = Message.new(params[:message])\n \n respond_to do |format|\n if @message.save\n format.html { redirect_to messages_path, notice: 'Message was successfully created.' }\n format.json { render json: @message, status: :created, location: @message }\n else\n format.html { render action: \"new\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n # les messages sont des tests\n @view = \"interface\" if request.referrer.include?(\"interface\")\n @view = \"chat\"\n @body = params[:message][:body]\n @phone_number = params[:message][:user]\n # création de l'utilisateur s'il n'existe pas\n # sauvegarde du message\n # parsing\n # répartition vers la bonne methode\n @interface = false\n @interface = true if request.referrer.include?(\"interface\")\n\n set_user_create_message_parse_and_point\n end",
"def create\n message = msg_params\n @msg = Msg.new(msg_params)\n thesender = @msg.sender\n thesentdate = @msg.sent\n theservertime = DateTime.now\n unless @msg.content.empty? || @msg.sender.empty?\n ActionCable.server.broadcast 'room_channel',\n content: @msg.content,\n sender: thesender,\n servertime: theservertime\n end\n end",
"def create\n @message = Message.new sender_id: current_user.id, recipient_id: message_params[:recipient_id], verb: message_params[:verb]\n\n respond_to do |format|\n if @message.save\n format.html { redirect_to @message, notice: 'Message was successfully created.' }\n format.json { render :show, status: :created, location: @message }\n else\n format.html { render :new }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def flash_created_message\n flash_message_builder(:create, flash_status_type, 'created')\n end",
"def create_notification; end",
"def create\n user = User.find_by(token: params[:token])\n new_message_params = {\n text: message_params[:text],\n conversation_id: message_params[:conversation_id],\n user_id: user.id,\n username: user.username\n }\n @message = Message.new(new_message_params)\n conversation = Conversation.find(message_params[:conversation_id])\n\n if @message.save\n # render json: @message, status: :created, location: @message\n serialized_data = ActiveModelSerializers::Adapter::Json.new(\n MessageSerializer.new(@message)\n ).serializable_hash\n MessagesChannel.broadcast_to conversation, serialized_data\n head :ok\n else\n render json: @message.errors, status: :unprocessable_entity\n end\n end",
"def create\n @conversation = @pad.conversations.create(params[:conversation])\n logger.info 'PARAMS@@@@@@@@@@@'\n logger.info params[:message_body]\n\n respond_to do |format|\n if @conversation.save\n @conversation.messages.create( :body => params[:message_body], :user_id => session[:user_id], :user_name => session[:user_name])\n\n desc = params[:conversation][:topic] + \": \\\"\" + params[:message_body] + \"\\\"\"\n add_event( EVENT_NEW_CONVERSATION, desc[0,150], EVENTSOURCE_USER, session[:user_id], session[:user_name], nil)\n\n format.html { redirect_to(pad_conversations_path(@pad), :notice => 'Conversation was successfully created.') }\n format.xml { render :xml => @conversation, :status => :created, :location => @conversation }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @conversation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n begin\n sha256 = OpenSSL::Digest::SHA256.new\n # sig_service berechnen\n digest = sha256.hexdigest(params[:timestamp].to_s + params[:recipientname].to_s + params[:name].to_s + params[:cipher].to_s + params[:iv].to_s + params[:key_recipient_enc].to_s + params[:sig_recipient].to_s)\n # public_key des Users aus der Datenbank holen\n public_key = OpenSSL::PKey::RSA.new(Base64.decode64(User.find_by_name(params[:name]).public_key))\n # sig_service vom Client entschlüsseln\n decrypt_digest = public_key.public_decrypt(Base64.decode64(params[:sig_service]))\n # Prüfen ob der Empfänger existiert\n if User.exists?(name: params[:recipientname]) then\n # sig_service überprüfen\n if decrypt_digest == digest then\n # Überprüfen ob Nachricht nicht älter als fünf Minuten\n if (Time.now.to_i - params[:timestamp].to_i) < 300 and (Time.now.to_i - params[:timestamp].to_i) >= 0 then\n @message = Message.new(message_params)\n @message.is_called = 0\n respond_to do |format|\n # Nachricht speichern\n if @message.save\n format.json { render json: '{\"status\":\"1\"}'}\n else\n format.json { render json: '{\"status\":\"2\"}'}\n end\n end\n else\n respond_to do |format|\n format.json { render json: '{\"status\":\"4\"}'}\n end\n end\n else\n respond_to do |format|\n format.json { render json: '{\"status\":\"5\"}'}\n end\n end\n else\n respond_to do |format|\n format.json { render json: '{\"status\":\"3\"}'}\n end\n end\n rescue Exception => e\n render json: '{\"status\":\"99\"}'\n end\n end",
"def create\n @message = Message.new(message_params)\n\n unless (session[:parent_message_id] || !(admin_user?))\n @message.require_recipient = true\n @message.require_type = true\n end\n @message.require_subject = true unless (session[:parent_message_id])\n\n respond_to do |format|\n if @message.save\n if session[:parent_message_id] # Reply message\n parent_message = current_user.all_messages.find(session[:parent_message_id].to_i)\n message_subject = parent_message.subject\n message_subject += t('messages.reply_postfix') if (message_subject.scan(t('messages.reply_postfix')).empty?) # \" (Reply)\"\n @message.update_attributes(from_user_id: current_user.id,\n parent_id: session[:parent_message_id].to_i,\n message_type_id: parent_message.message_type_id,\n subject: message_subject)\n recipient_user_id = parent_message.from_user_id\n else # New message\n if admin_user?\n @message.update_attributes(from_user_id: current_user.id)\n recipient_user_id = @message.recipient_user_id\n else # logged in non-admin user (know logged in because of callback)\n @message.update_attributes(from_user_id: current_user.id, message_type_id: 1)\n recipient_user_id = admin_for_customer_inquiries.id\n end\n end\n session[:parent_message_id] = nil\n @message.recipient_users.create(user_id: recipient_user_id)\n recipient_copy = @message.dup\n if recipient_copy.save\n recipient_copy.update_attributes(owner_user_id: recipient_user_id, copied_message_id: @message.id)\n recipient_copy.recipient_users.create(user_id: recipient_user_id)\n end\n if session[:messaging_context] == :index\n format.html { redirect_to messages_path, notice: t('messages.create') } # \"Message was successfully sent.\"\n format.json { render action: 'index', status: :created, location: @message }\n elsif session[:messaging_context] == :mailbox_out\n format.html { redirect_to mailbox_out_messages_path, notice: t('messages.create') } # \"Message was successfully sent.\"\n else\n format.html { redirect_to mailbox_in_messages_path, notice: t('messages.create') } # \"Message was successfully sent.\"\n end\n else\n format.html { render action: 'new' }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @message = Message.new(message_params)\n # Only handle a file upload if they can attach\n if can?(RS::AuthorisationHelper::CREATE_ATTACHMENT)\n render('new', status: :unprocessable_entity) && return if handle_file_upload(parent_param: :dashboard_message)\n\n @message.attachment = @resource_items[0] unless @resource_items.nil?\n end\n success, msg_refno = @message.save(current_user)\n # need to call return\n return redirect_to_confirmation_page(msg_refno) if success\n\n render('new', status: :unprocessable_entity)\n end",
"def create\n logger.debug(\"Entering Message create\" )\n @message = Message.new(params[:message])\n @message.read = false\n respond_to do |format|\n if @message.save\n flash[:notice] = 'Message was successfully sent.'\n format.html { redirect_to :controller => \"users\", :action => \"show\", :id => current_user.id }\n format.xml { render :xml => @message, :status => :created, :location => @message }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @message.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n message_params = params[:message]\n message_params[:text] = params[:text]\n message = Message.new(\n author_id: current_user.id,\n chat: Chat.find(message_params[:chat_id]),\n parse_mode: message_params[:parse_mode],\n text: (message_params[:text].join \"\\r\\n\\r\\n\")\n )\n message.image = message_params[:image] if message_params[:image].present?\n puts JSON.pretty_generate message.as_json\n message.save!\n redirect_to admin_message_path(message), notice: 'A message has been created'\n # Message.create!(\n # author_id: current_user.id,\n # chat: Chat.find(message_params[:chat_id]),\n # image: message_params[:image],\n # parse_mode: message_params[:parse_mode],\n # text: (message_params[:text].join \"\\r\\n\\r\\n\")\n # )\n end",
"def create\n @message = Message.new(params[:message])\n\n respond_to do |format|\n if @message.save\n format.html { redirect_to new_message_url, notice: t(\"messages.created\") }\n format.json { render json: @message, status: :created, location: @message }\n else\n format.html { render action: \"new\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n message = Message.new(message_params)\n message.user = current_user\n if message.content.blank? && !message.file.url.nil?\n message.content = \"Attachment\"\n end\n respond_to do |format|\n if message.save\n message.chatroom.users.uniq.each do |user|\n notification = Notification.where(user: user, notification_type: \"New Message\", notification_object_id: message.chatroom.id).first\n if notification.nil?\n notification = Notification.create!(user: user, notification_type: \"New Message\", notification_object_id: message.chatroom.id, read: false)\n else\n notification.read = false\n notification.save\n end\n end\n format.html {chatroom_path(message.chatroom)}\n else\n format.html {chatroom_path(message.chatroom) }\n end\n end\n\n end",
"def create\n body = message_params[:Body]\n phone_number = message_params[:From]\n @message = Message.create(body: body, phone_number: phone_number)\n @message.reply_to_user\n head :ok\n end",
"def create\n @message = Message.new(message_params)\n\n respond_to do |format|\n if @message.save\n format.html { redirect_to @message, notice: 'Message crée avec succès.' }\n format.json { render :show, status: :created, location: @message }\n else\n format.html { render :new }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_message\n @message = Message.new(params[:message])\n @message.sended_at = Time.now.to_f\n respond_to do |format|\n if @message.save\n format.html { redirect_to(\"/chat/update/#{@message.user.id}\") }\n format.xml { render :xml => @message, :status => :created, :location => @message }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @message.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def message; Message.new; end",
"def create\n message = Message.new({content: params[:message], chatroom_id: params[:chatroomId].to_i, user_id: params[:userId].to_i})\n\n if message.save\n user = message.user\n message_reactions = message.message_reactions\n\n message_reactions.map {|reaction| {reaction: reaction, user: reaction.user}}\n updatedChatroom = Chatroom.find(params[:chatroomId]) \n ActionCable.server.broadcast(\n \"chatroom_#{params[:chatroomId]}\",\n {\n newMessage: {message: message, user: user},\n messageReactions: message_reactions,\n user: user,\n updatedChatroom: updatedChatroom\n }\n )\n end\n end",
"def create\n message = Message.new(message_params)\n conversation = Conversation.find(message_params[:conversation_id])\n message.username = message.user.username\n if message.save\n serialized_data = ActiveModelSerializers::Adapter::Json.new(\n MessageSerializer.new(message)).serializable_hash\n MessagesChannel.broadcast_to(conversation, serialized_data)\n # ActionCable.server.broadcast 'conversations_channel', serialized_data\n head :ok\n # binding.pry\n end\n end",
"def create\n\tif !checklogin? then return end\n\n @message = Message.new(params[:message])\n\n respond_to do |format|\n if @message.save\n format.html { redirect_to @message, notice: 'Message was successfully created.' }\n format.json { render json: @message, status: :created, location: @message }\n else\n format.html { render action: \"new\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_message_table\n execute_sql_statement(\"CREATE TABLE messages (\\n\" \\\n \" id CHAR PRIMARY KEY, \\n\" \\\n \" sender CHAR NOT NULL, -- Hostname of sender \\n\" \\\n \" action CHAR NOT NULL, -- The action to perform \\n\" \\\n \" payload CHAR, -- Optional payload \\n\" \\\n \" ack INTEGER DEFAULT 0, -- ack sent \\n\" \\\n \" date_time CHAR NOT NULL, -- Time sent \\n\" \\\n \" direction CHAR DEFAULT 'in', -- In or out bound msg \\n\" \\\n \" processed INTEGER DEFAULT 0 \\n\" \\\n \");\".strip)\n end",
"def create\n @message = Message.new(message_params)\n respond_to do |format|\n if @message.save\n format.html { redirect_to @message, notice: 'Message was successfully created.' }\n format.json { render :show, status: :created, location: @message }\n else\n format.html { render :new }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"def create\n message = Message.new(message_params)\n message.message = params[:message_text]\n message.display_name = params[:display_name]\n message.save!\n render json: message\n end",
"def create\n @message = Message.new(params[:message])\n @message.user_id = current_user.id\n \n respond_to do |format|\n if @message.save\n format.json { render json: @message, status: :created}\n else\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @message = Message.create(message_params)\n ActionCable.server.broadcast(\"chatting_channel\", {\n data_type: \"message\",\n user_id: @message.user_id, \n content: @message.content,\n created_at: (@message.created_at.strftime(\"%m/%d %H:%M\")),\n }) if @message.present?\n head :ok\n\n end",
"def message_template=(_arg0); end",
"def create_message(data)\n message = Discordrb::Message.new(data, self)\n return message if message.from_bot? && !@should_parse_self\n return message if message.webhook? && !@attributes[:webhook_commands]\n\n unless message.author\n Discordrb::LOGGER.warn(\"Received a message (#{message.inspect}) with nil author! Ignoring, please report this if you can\")\n return\n end\n\n event = CommandEvent.new(message, self)\n\n chain = trigger?(message)\n return message unless chain\n\n # Don't allow spaces between the prefix and the command\n if chain.start_with?(' ') && !@attributes[:spaces_allowed]\n debug('Chain starts with a space')\n return message\n end\n\n if chain.strip.empty?\n debug('Chain is empty')\n return message\n end\n\n execute_chain(chain, event)\n\n # Return the message so it doesn't get parsed again during the rest of the dispatch handling\n message\n end",
"def create\n @message = Message.new params[:message]\n @message.user_id = current_user.id \n @message.save\n end",
"def create\n message = Message.new(message_params)\n message.user = current_user\n if message.save\n # 'messages' is name of channel we are broadcasting to\n ActionCable.server.broadcast 'messages',\n # Set message and user\n message: message.content,\n user: message.user.first_name\n head :ok\n end\n end",
"def create\n parse_date\n @message = Message.new(params[:message])\n if params[:message_file]\n @message_file = @message.message_files.build(params[:message_file])\n @message_file.message = @message\n end\n\n respond_to do |format|\n if @message.save\n format.html { redirect_to((@message.message_set ?\n series_path(@message.message_set) : @message),\n :notice => 'Message was successfully created.') }\n format.xml { render :xml => @message, :status => :created, :location => @message }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @message.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create_message(user_id, recipient_id, token , subject, message)\n response = self.class.post('/messages', body: { \"user_id\": user_id, \"recipient_id\": recipient_id,\"token\": token , \"subject\": subject, \"stripped-text\": message }, headers: { \"authorization\" => @auth_token })\n puts response\n\n end",
"def create\n @message = Message.new(message_params)\n\n if Permission.timeout?(user_id: current_user.id, story_id: @message.story_id)\n redirect_to informations_path, notice: \"Temps d'écriture dépassé. Veuillez réessayer.\"\n\n else\n if @message.save\n @message.check_story_finished!\n redirect_to informations_path, notice: \"Histoire continué avec succès.\"\n else\n self._fill_form\n end\n end\n\n end",
"def create\n @message = Message.new(message_param)\n @message_thread = MessageThread.find(@message.message_thread_id)\n\n @message.receiver = current_user.equal_user?(@message_thread.started_user) ? @message_thread.to_user : @message_thread.started_user\n @message.sender = current_user\n @message.is_sender_read = true\n @message.is_receiver_read = false\n\n if @message.save\n flash[:success] = \"Message has been sent!\"\n redirect_to @message_thread\n end\n end",
"def create\n @message = Message.new(message_params)\n\n if @message.save\n render json: @message, status: :created, location: @message\n else \n render json: @message.errors, status: :unprocessable_entity\n end\n end",
"def create\n \t@message = Message.new(message_params)\n \tif @message.save\n \t\tredirect_to @message \n \telse\n \t\trender \"new\"\n \tend\n end",
"def create\n @message = @messagable.received_messages.build(params[:message])\n return redirect_to :back if @messagable.class == Alliance && !user.member_of?(@messagable)\n @message.user = current_user\n if @message.save\n redirect_to polymorphic_path([@messagable, :messages])\n else\n render :action => 'new'\n end\n end",
"def create\n params[:system_message][:message_type] = SystemMessage.type_name(params[:system_message][:message_type].to_i)\n if @logged_in_user\n params[:system_message][:user_id] = @logged_in_user.id\n end\n @system_message = SystemMessage.new(params[:system_message])\n \n respond_to do |format|\n if @system_message.save\n format.html { redirect_to @system_message, notice: 'System message was successfully created.' }\n format.json { render json: @system_message, status: :created, location: @system_message }\n else\n @types = SystemMessage.type_list\n format.html { render action: \"new\"}\n format.json { render json: @system_message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @message = Message.new(message_params)\n @message.sender_id = current_user.id\n @message.recipient_id = params[:recipient_id]\n\n respond_to do |format|\n if @message.save\n flash[:notice] = \"Mesaj gönderildi.\"\n format.json { render json: {success: true} } \n # Pusher.trigger('private-'+params[:recipient_id],'new_message', {:from => current_user.name, \n # :subject => @message.subject})\n else\n flash[:error] = \"Mesaj gönderilemedi.\"\n redirect_to '/'\n end\n end\n end",
"def create\n @message = Message.new(params[:message])\n\n respond_to do |format|\n if @message.save\n format.html { redirect_to @message, notice: 'Message was successfully created.' }\n format.json { render json: @message, status: :created, location: @message }\n else\n format.html { render action: \"new\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n if message_params[:content] == nil || message_params[:content] == ''\n redirect_to request.referrer, :flash => {:error => \"You must enter a message\"}\n else\n @message = Message.new(message_params)\n @message.projectid = session[:lastproj]\n @message.user = session[:userid]\n @message.content = message_params[:content]\n @message.subject = message_params[:subject]\n if @message.save\n send_notifications(@message)\n if request.referrer\n redirect_to request.referrer, notice: \"Bulletin posted successfully.\"\n end\n else\n if request.referrer\n redirect_to request.referrer, :flash => {:error => \"You must enter a message\"}\n end\n end\n\n end\n end",
"def create\n @message = Message.new(params[:message])\n\n respond_to do |format|\n if @message.save\n format.html { redirect_to admin_message_path(@message), notice: 'Message was successfully created.' }\n format.json { render json: @message, status: :created, location: @message }\n else\n format.html { render action: \"new\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @message = Message.new(params[:message])\n respond_to do |format|\n if @message.save\n format.html { redirect_to @message, notice: 'Message was successfully created.' }\n format.json { render json: @message, status: :created, location: @message }\n else\n format.html { render action: \"new\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n # if user/trainer didn't complete the form!!!\n if params[:receiver_id] == \"\" or params[:subject] == \"\" or params[:content] == \"create a message here...\"\n if params[:receiver_id] == \"\"\n flash[:alert_receiver_id] = \"please select an athlete\"\n end\n if params[:subject] == \"\"\n flash[:alert_subject] = \"please input a subject\"\n end\n if params[:content] == \"create a message here...\"\n flash[:alert_content] = \"please input a content\"\n end\n redirect_to \"/mentor_messages/home\"\n # else user/trainer complete the form\n else\n mentor_message = MentorMessage.new(params[:mentor_message])\n mentor_message.content = params[:content]\n # user -> trainer\n if current_user != nil\n mentor_message.message_type = 0\n mentor_message.sender_id = current_user.id\n mentor_message.receiver_id = params[:receiver_id]\n # trainer -> user\n elsif current_trainer != nil\n mentor_message.message_type = 1\n mentor_message.sender_id = current_trainer.id\n mentor_message.receiver_id = params[:receiver_id]\n end\n\n mentor_message.save\n redirect_to '/mentor_messages/home'\n end\n end",
"def create\n @message_field = MessageField.new(params[:message_field])\n\n respond_to do |format|\n if @message_field.save\n format.html { redirect_to @message_field, notice: 'Message field was successfully created.' }\n format.json { render json: @message_field, status: :created, location: @message_field }\n else\n format.html { render action: \"new\" }\n format.json { render json: @message_field.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n # if params[:user_id].to_i == current_user[:id]\n # return\n # end\n @message = Message.new(message_params)\n @message.user = current_user\n @message.room_id = params[:room_id]\n @messages = Message.all\n ActionCable.server.broadcast \"room_channel_#{@message.room_id}\", message: @message\n\n if @message.save\n render json: @message\n else\n render plain: \"Failed to create a message\", status: :unprocessable_entity\n end\n end",
"def create\n message_reaction = MessageReaction.new({content: params[:reaction], message_id: params[:messageId].to_i, user_id: 1})\n\n if message_reaction.save\n updatedMessage = Message.find(params[:messageId]) \n ActionCable.server.broadcast(\n \"message_#{params[:messageId]}\",\n newMessageReaction: message_reaction,\n updatedMessage: updatedMessage,\n )\n end\n end",
"def create\n\t\t@message = Message.create!(params[:message])\n\t\trespond_to do |format|\n\t\t\tformat.js\n\t\tend\n\tend",
"def create\n @message = Message.new(params[:message])\n if @message.save\n MessageMailer.notify_private_message_sent(@message.sender, @message.receiver).deliver\n puts \"FOI\"\n end\n respond_with(@message)\n end",
"def create\n raise UserBlocked if UserBlock.between_users(current_user.id, message_params[:to_user_id]).any?\n raise NoHails if Hail.accepted.between_users(current_user.id, message_params[:to_user_id]).empty?\n\n @message = current_user.messages.new(message_params)\n\n respond_to do |format|\n if @message.save\n format.json { render :show, status: :created }\n else\n format.json { render json: @message.errors.full_messages, status: :unprocessable_entity }\n end\n end\n rescue UserBlocked\n current_user.update_attribute(:last_chatted_user_id, nil) if current_user.last_chatted_user_id == message_params[:to_user_id]\n render json: { error: 'blocked' }, status: :unprocessable_entity\n rescue NoHails\n render json: { error: 'no_hails' }, status: :unprocessable_entity\n end",
"def create\n @message = Message.new(message_params)\n\n respond_to do |format|\n if @message.save\n format.html { redirect_to @message, notice: 'Message was successfully created.' }\n format.json { render :show, status: :created, location: @message }\n else\n format.html { render :new }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @message = Message.new(message_params)\n\n respond_to do |format|\n if @message.save\n format.html { redirect_to @message, notice: 'Message was successfully created.' }\n format.json { render :show, status: :created, location: @message }\n else\n format.html { render :new }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @message = Message.new(message_params)\n\n respond_to do |format|\n if @message.save\n format.html { redirect_to @message, notice: 'Message was successfully created.' }\n format.json { render :show, status: :created, location: @message }\n else\n format.html { render :new }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @message = Message.new(message_params)\n\n respond_to do |format|\n if @message.save\n format.html { redirect_to @message, notice: 'Message was successfully created.' }\n format.json { render :show, status: :created, location: @message }\n else\n format.html { render :new }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @message = Message.new(message_params)\n\n respond_to do |format|\n if @message.save\n format.html { redirect_to @message, notice: 'Message was successfully created.' }\n format.json { render :show, status: :created, location: @message }\n else\n format.html { render :new }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @message = Message.new(message_params)\n\n respond_to do |format|\n if @message.save\n format.html { redirect_to @message, notice: 'Message was successfully created.' }\n format.json { render :show, status: :created, location: @message }\n else\n format.html { render :new }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @message = Message.new(message_params)\n\n respond_to do |format|\n if @message.save\n format.html { redirect_to @message, notice: 'Message was successfully created.' }\n format.json { render :show, status: :created, location: @message }\n else\n format.html { render :new }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @message = Message.new(message_params)\n\n respond_to do |format|\n if @message.save\n format.html { redirect_to @message, notice: 'Message was successfully created.' }\n format.json { render :show, status: :created, location: @message }\n else\n format.html { render :new }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @message = Message.new(message_params)\n\n respond_to do |format|\n if @message.save\n format.html { redirect_to @message, notice: 'Message was successfully created.' }\n format.json { render :show, status: :created, location: @message }\n else\n format.html { render :new }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @message = Message.new(message_params)\n\n respond_to do |format|\n if @message.save\n format.html { redirect_to @message, notice: 'Message was successfully created.' }\n format.json { render :show, status: :created, location: @message }\n else\n format.html { render :new }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n values = params[:message]\n \n raise BadRequestError.new('Identity and recipient_id do not match.') if !params[:identity_id].nil? && params[:identity_id] != params[:message][:recipient_id]\n \n sender = Identity.find_by_id_identifier_or_nickname(params[:message][:sender_id], :find_deleted => true) unless params[:message][:sender_id].nil?\n recipient = Identity.find_by_id_identifier_or_nickname(params[:identity_id] || params[:message][:recipient_id], :find_deleted => true)\n \n raise NotFoundError.new('Recipient #{params[:message][:recipient_id]} unknown.') if recipient.nil?\n \n values[:recipient_id] = recipient.id\n values[:sender_id] = sender.nil? ? nil : sender.id\n \n @message = Message.new(values)\n \n logger.warn \"IDENTIFIER: #{params[:identity_id] || params[:message][:recipient_id]} VALUES: #{values.inspect}, #{params.inspect}\"\n\n respond_to do |format|\n if @message.save\n format.html { redirect_to @message, notice: 'Message was successfully created.' }\n format.json { render json: @message, status: :created, location: @message }\n @message.send_via_email\n else\n format.html { render action: \"new\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create \n @message = Message.new(message_params)\n @message.sender_id = current_user.id\n\n respond_to do |format|\n if @message.save\n format.html { redirect_to @message, notice: 'Message was successfully created.' }\n format.json { render :show, status: :created, location: @message }\n else\n format.html { render :new }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @message = Message.new(params[:message])\n authorize! :create, @message\n @message.date_sent = DateTime.now\n\n if params.has_key?(:appointment_timestamp)\n if params[:appointment_timestamp].match(/(\\d{2})\\/(\\d{2})\\/(\\d{4})\\s(\\d{2}):(\\d{2})\\s(am|pm)/i)\n month, day, year, hours, minutes, ampm = $1.to_i, $2.to_i, $3.to_i, $4.to_i, $5.to_i, $6\n\n if hours == 12 && ampm == 'am'\n hours = 0\n elsif ampm == 'pm'\n hours += 11\n end\n\n @message.appointment_timestamp = Time.new(year, month, day, hours, minutes, 0, \"-01:00\")\n end\n end\n\n error = '';\n is_reply = false\n\n if params[:message].has_key?(:receiver_id)\n is_reply = true\n end\n\n if @message.subject.length < 1 || @message.message.length < 1\n error = 'You must have a subject and a message.'\n else\n @receiver_id = nil\n\n if params[:message].has_key?(:receiver_id)\n @receiver_id = params[:message][:receiver_id]\n else\n @receiver_id = User.find_id_by_email(params[:receiver_email])\n end\n\n if !@receiver_id.nil?\n @message.receiver_id = @receiver_id\n else\n error = 'The user with the email address \"' + params[:receiver_email] + '\" does not exist.'\n end\n end\n\n respond_to do |format|\n if !@receiver_id.nil? && @message.save\n if is_reply\n format.html { redirect_to message_path(@message.reply_to) }\n else\n format.html { redirect_to @message }\n end\n else\n flash[:error] = error\n\n if is_reply\n @first_convo_message = Message.new(params[:message])\n @reply_to = @first_convo_message.reply_to\n @receiver_id = params[:message][:receiver_id]\n end\n\n format.html { render action: \"new\" }\n end\n end\n end",
"def create\n _params = message_params\n if params.has_key? :key and !_params.has_key? :guestbook_id\n key = AccessKey.where(key: params[:key]).first\n if key != nil\n _params[:guestbook_id] = key.guestbook != nil ? key.guestbook.id : Guestbook.get_default.id\n end\n end\n\n # Insurance\n if _params[:guestbook_id] == nil\n _params[:guestbook_id] = Guestbook.get_default.id\n end\n guestbook = Guestbook.find(_params[:guestbook_id])\n\n # Auto approve, if passes filter\n _params[:approved] = guestbook.auto_approve\n if guestbook.filter_profanity && Obscenity.profane?(_params[:content])\n _params[:approved] = false\n end\n\n @message = Message.new(_params)\n\n respond_to do |format|\n if @message.save\n format.html { redirect_back(fallback_location: '/admin/signatures') }\n format.json { render :show, status: :created, location: @message }\n else\n format.html { redirect_to(:back, error: @message.errors.full_messages.first) }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n \t@message = Message.new\n end",
"def create\n @message = RoomMessage.create(message: params[:room_message][:message],\n user_id: current_user.id,\n room_id: params[:room_id])\n redirect_to :browse\n end",
"def create\n if @message.save\n flash[:notice] = t('created')\n \n respond_to do |format|\n format.html { redirect_to @user ? member_path(@user) : group_path(@group) }\n end\n else\n respond_to do |format|\n format.html { render :new }\n end\n end\n end",
"def create\n @message = Message.new(message_params)\n\n respond_to do |format|\n if @message.save\n format.html { redirect_to @message, notice: 'message was successfully created.' }\n format.json { render :show, status: :created, location: @message }\n else\n format.html { render :new }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def message_new\n @employees = get_all_employees\n\t emp_details = find_employee(params[:emp_name])\n\t @message = Message.new\n\t @message.resume_id = params[:id]\n\t @message.sent_to = emp_details\n\t @message.sent_by = get_logged_employee\n\t @message.message = params[:message]\n respond_to do |format|\n if @message.save\n flash[:success] = \"successfully sent the message to \\'#{params[:emp_name]}\\'.\"\n\t else\n flash[:danger] = \"unable to delivery the message.\"\n\t end\n\t end\n end",
"def create\n @store_manager_message = Store::Manager::Message.new(params[:store_manager_message])\n\n respond_to do |format|\n if @store_manager_message.save\n format.html { redirect_to @store_manager_message, notice: 'Message was successfully created.' }\n format.json { render json: @store_manager_message, status: :created, location: @store_manager_message }\n else\n format.html { render action: \"new\" }\n format.json { render json: @store_manager_message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @message = Message.new(message_params)\n\n respond_to do |format|\n if @message.save\n format.html { redirect_to messages_url, notice: 'Message was successfully created.' }\n else\n format.html { render :new }\n end\n end\n end",
"def create\n @message = Message.new(params[:message])\n @status = if @message.save then\n @message \n else\n render :json=> @message, :status=> :unprocessable_entity\n end\n end",
"def create\n @message = Message.new\n @message.create_one!(params[:message])\n #Juggernaut.publish(1, parse_chat_message(params[:message][:message], current_user))\n respond_to do |format|\n format.html { redirect_to :index }\n format.js\n end\n end"
] | [
"0.7608997",
"0.72740674",
"0.72508687",
"0.71597725",
"0.700779",
"0.70005536",
"0.6999833",
"0.6973321",
"0.6876489",
"0.6790315",
"0.6767513",
"0.67096734",
"0.67086226",
"0.6704885",
"0.6682551",
"0.66669977",
"0.6662425",
"0.6656933",
"0.6654197",
"0.66455406",
"0.6625879",
"0.66148186",
"0.6611037",
"0.6610655",
"0.66106397",
"0.6597063",
"0.65833676",
"0.65791225",
"0.65663755",
"0.65495265",
"0.65478116",
"0.65475863",
"0.6540577",
"0.65354663",
"0.65308523",
"0.65290225",
"0.65259385",
"0.65239733",
"0.6522053",
"0.650591",
"0.6503424",
"0.64936674",
"0.6493312",
"0.6488144",
"0.6485929",
"0.6482762",
"0.6481735",
"0.6467974",
"0.64435506",
"0.64366543",
"0.6424255",
"0.642195",
"0.64023226",
"0.64000994",
"0.6397138",
"0.63843876",
"0.63840735",
"0.6373797",
"0.6370921",
"0.63620746",
"0.6359648",
"0.63583195",
"0.63543993",
"0.6353781",
"0.63499665",
"0.6349039",
"0.6347433",
"0.63468623",
"0.6341114",
"0.6334605",
"0.6332198",
"0.6330751",
"0.63303834",
"0.6326797",
"0.6326326",
"0.63247013",
"0.6322204",
"0.6322204",
"0.6322204",
"0.6322204",
"0.6322204",
"0.6322204",
"0.6322204",
"0.6322204",
"0.6322204",
"0.6322204",
"0.63203824",
"0.63199455",
"0.6318473",
"0.63175446",
"0.63090205",
"0.6306127",
"0.6305747",
"0.63050807",
"0.62986255",
"0.6297787",
"0.6297738",
"0.62924457",
"0.62916034"
] | 0.80424803 | 0 |
Internal handler for TYPING_START | def start_typing(data); end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start_typing\n API::Channel.start_typing(@bot.token, @id)\n end",
"def begin_typing(&block)\n with_keyboard_focus do\n application.keyboard.when_element(:visible?) do\n yield application.keyboard if block_given?\n end\n end\n end",
"def set_typing\n @typing = Typing.find(params[:id])\n end",
"def typing(recipient:)\n\t\t# TODO Fill the method TelegramAdapter#Typing\n\t\t# Bot.deliver(recipient: recipient, sender_action:'TYPING_ON')\n\t\tchat_id = recipient['id']\n\t\t@bot.sendChatAction(chat_id: chat_id, action: 'typing')\t\n\tend",
"def types(word)\n word.each_char do |char|\n print char\n sleep(0.07)\n end\n end",
"def start_typing(_user)\n PubSub::Publisher.new.publish_for(user_participants.online.where.not(id: _user.id), 'start_typing', {source: {id: id}, user: _user.as_basic_json(:now)}, {foreground: true})\n end",
"def fix_typewriter(text); end",
"def start_typing(token, channel_id)\n request(\n __method__,\n :post,\n \"#{api_base}/channels/#{channel_id}/typing\",\n nil,\n Authorization: token\n )\n end",
"def nlu_handle_input\n # Wit processing will take a while, so we want to show activity\n @message.mark_seen\n @message.typing_on\n return if acted_on_non_questions?\n # Non-questions ruled out, we can\n # save a question to correct later, if needed\n @user.session[:needs_correction] = @message.text\n # Act on a type of question\n act_on_question_types\n # We're done replying\n @message.typing_off\n end",
"def create_typing_window\n x = @info_window.x + 20 #Graphics.width / 2 - 200\n y = @command_window.bottom_corner + 20 #Graphics.height/2\n params = {\n :max_characters => Settings::MAX_NICKNAME_LEN,\n :permitted => Text_Inputable::ALPHA_WITH_SPACING|Text_Inputable::BASE_SYMBOLS,\n :max_lines => 1,\n :title => Vocab.player_name\n }\n @rename_window = Window_SingleLineInput.new(x, y, params)\n @rename_window.set_done_handler(method(:do_rename))\n @rename_window.set_cancel_handler(method(:do_nothing))\n @rename_window.openness = 0\n end",
"def typing?\r\n\t\treturn true if repeat?(:SPACE)\r\n\t\tfor key in LETTERS\r\n\t\t\treturn true if repeat?(key)\r\n\t\tend\r\n\t\tfor key in NUMBERS\r\n\t\t\treturn true if repeat?(key)\r\n\t\tend\r\n\t\treturn false\r\n\tend",
"def typing(options={})\n last_received_channel = @last_received_user_message ? @last_received_user_message.channel : nil\n default_options = {channel: last_received_channel}\n client.typing(default_options.merge(options))\n end",
"def create\n @typing = Typing.new(typing_params)\n\n respond_to do |format|\n if @typing.save\n format.html { redirect_to @typing, notice: 'Typing was successfully created.' }\n format.json { render :show, status: :created, location: @typing }\n else\n format.html { render :new }\n format.json { render json: @typing.errors, status: :unprocessable_entity }\n end\n end\n end",
"def type(text, into:)\n node = find(into)\n\n node.click\n sleep 0.1 # wait 100 milliseconds\n node.send_keys(text)\n end",
"def type(input)\n return close_input if input == \"\\u0004\"\n\n last_command_started.write(input << \"\\n\")\n end",
"def done_typing\n variable_id = text_input_window.variable_id\n $game_variables[variable_id] = text_input_window.text\n text_input_window.close\n end",
"def update\n respond_to do |format|\n if @typing.update(typing_params)\n format.html { redirect_to @typing, notice: 'Typing was successfully updated.' }\n format.json { render :show, status: :ok, location: @typing }\n else\n format.html { render :edit }\n format.json { render json: @typing.errors, status: :unprocessable_entity }\n end\n end\n end",
"def text_input; end",
"def set_text_input(input); end",
"def start_accepting\n super\n\n @characters = 0\n end",
"def typing_params\n params.require(:typing).permit(:article_type_id, :article_id)\n end",
"def new_text_input\n end",
"def on_keypress &b\n on :keypress, &b\n end",
"def type_in(message)\n\t\tif (message.empty?)\n\t\t\tputs \"Message is empty!\"\n\t\t\treturn\n\t\tend\n\t\t\n\t\t# The m regex option specifies \"multi-line\" mode\n\t\tmessage.scan(/./m) do |char|\n\t\t\tkeystroke(*char.to_keys)\n\t\tend\n\tend",
"def type_is_text\n self.stimulus_type=\"text\"\n end",
"def type_string text, options={}\n shift_key_down = nil\n\n text.each_char do |char|\n key_to_press = KEY_PRESS_CHARS[char]\n unless key_to_press.nil?\n key_press key_to_press\n else\n key_needs_shift = SHIFTED_CHARS.include? char\n\n if shift_key_down.nil? || shift_key_down != key_needs_shift\n if key_needs_shift\n key_down :shift\n else\n key_up :shift\n end\n end\n\n type char\n shift_key_down = key_needs_shift\n end\n end\n wait options\n end",
"def type_error\n system(\"clear\")\n puts Spacer\n\n type = case @search_type\n when \"Pokemon Name\", \"Type\"\n \"numbers\"\n when \"Pokedex Number\"\n \"letters\"\n end\n \n puts \"Sorry! No #{type} please!\".colorize(:red)\n end",
"def sc_type(type, text, *params)\n __remote_control_command(\"type\", [__locator(type, *params), text, ])\n end",
"def type(w_id = nil)\n XDo::Keyboard.type(to_xdo, w_id)\n end",
"def type(text:)\n conn = multipart_connection(port: 8060)\n text.split(//).each do |c|\n path = \"/keypress/LIT_#{CGI::escape(c)}\"\n @logger.debug(\"Send Letter: \"+path)\n response = conn.post path\n return false unless response.success?\n end\n return true\n end",
"def onUserText(text, view)\r\n # The user may type in something that we can't parse as a length\r\n # so we set up some exception handling to trap that\r\n begin\r\n value = text.to_l\r\n rescue\r\n # Error parsing the text\r\n UI.beep\r\n value = nil\r\n Sketchup::set_status_text \"\", SB_VCB_VALUE\r\n end\r\n return if !value\r\n \r\n if (@state == STATE_MOVING && @selection)\r\n vec_back = @start_input_point.position - @pt_to_move\r\n vec = vec_back.reverse\r\n vec.length = value\r\n @pt_to_move = @start_input_point.position + vec\r\n move_points(vec_back)\r\n move_points(vec)\r\n view.invalidate\r\n draw(view)\r\n done\r\n end\r\nend",
"def typeahead\n # :searcher param expected to be name of a searcher with underscores, ie: ematrix_journal\n searcher = params[:searcher]\n query = params[:q] or ''\n total = params[:total] or 3\n\n if searcher.blank?\n logger.error \"Typeahead request: no searcher param provided\"\n head :bad_request\n return nil\n end\n\n searcher_string = \"QuickSearch::#{searcher.camelize}Searcher\"\n\n begin \n klass = searcher_string.constantize\n rescue NameError\n logger.error \"Typeahead request: searcher #{searcher} does not exist\"\n head :bad_request\n return nil\n end\n\n if klass.method_defined? :typeahead\n typeahead_result = klass.new(HTTPClient.new, query, total).typeahead\n\n if params.has_key? 'callback'\n render json: typeahead_result, callback: params['callback']\n else\n render json: typeahead_result\n end\n else\n logger.error \"Typeahead request: searcher #{searcher} has no typeahead method\"\n head :bad_request\n return nil\n end\n end",
"def is_texttype?(); @type == GRT_TEXTTYPE; end",
"def textViewDidBeginEditing(textView)\n handle_focus\n end",
"def setup_completion\n\t\tReadline.completion_proc = self.method( :completion_callback ).to_proc\n\t\tReadline.completer_word_break_characters = ''\n\tend",
"def type_search_text(text)\n send_keys SEARCH_BAR, text\n end",
"def type?(key)\n timeout_retry(3, 3){\n write \"TYPE #{key}\\r\\n\"\n single_line_reply\n }\n end",
"def onUserText(text, view)\r\n # The user may type in something that we can't parse as a length\r\n # so we set up some exception handling to trap that\r\n begin\r\n value = text.to_l\r\n rescue\r\n # Error parsing the text\r\n UI.beep\r\n value = nil\r\n Sketchup::set_status_text \"\", SB_VCB_VALUE\r\n end\r\n return if !value\r\n \r\n if (@state == STATE_PICK_NEXT)\r\n # update the length of the wall\r\n vec = @pts[1] - @pts[0]\r\n if( vec.length > 0.0 )\r\n vec.length = value\r\n @pts[1] = @pts[0].offset(vec)\r\n view.invalidate\r\n self.update_state\r\n end\r\n end\r\nend",
"def adv_search_name_typed\n @edit = session[:edit]\n @edit[:new_search_name] = params[:search_name] if params[:search_name]\n @edit[:search_type] = params[:search_type].to_s == \"1\" ? \"global\" : nil if params[:search_type]\n render :update do |page|\n page << javascript_prologue\n end\n end",
"def textFieldStarted(tf)\n tf.text = \"\"\n end",
"def onUserText(text, view)\r\n # The user may type in something that we can't parse as a length\r\n # so we set up some exception handling to trap that\r\n begin\r\n value = text.to_l\r\n rescue\r\n # Error parsing the text\r\n UI.beep\r\n value = nil\r\n Sketchup::set_status_text \"\", SB_VCB_VALUE\r\n end\r\n return if !value\r\n # puts \"user text = \" + value.inspect\r\n case @state\r\n when STATE_MOVING\r\n # update the offset of the window or door\r\n @offset = value\r\n find_end_points\r\n view.invalidate\r\n draw_obj\r\n Sketchup.active_model.select_tool(nil)\r\n end\r\nend",
"def autocomplete; end",
"def type string, app = system_wide\n sleep 0.1\n app.type string.to_s\n end",
"def key_up(*args, device: T.unsafe(nil)); end",
"def drb_input!\n Vedeu.bind(:_drb_input_) do |data, type|\n Vedeu.log(type: :drb, message: \"Sending input (#{type})\")\n\n case type\n when :command then Vedeu.trigger(:_command_, data)\n when :keypress then Vedeu.trigger(:_keypress_, data)\n else Vedeu.trigger(:_keypress_, data)\n end\n end\n end",
"def start_input_thread\n @input_thread ||= Thread.new do\n until @stopped\n char = getch\n @on_key.call(char)\n end\n end\n end",
"def get_user_input\n Termbox.tb_poll_event(@event)\n ascii_to_symbol @event[:ch]\n end",
"def entry_prompt\n type('Type your choice here, then press enter: '.yellow)\n end",
"def update_completion_prefix\n Qt::Application.set_override_cursor Qt::Cursor.new(Qt::WaitCursor)\n\n pos = completion_pos\n word = completion_prefix\n\n if word\n completions = @input.completion_proc.call(word)\n model = Qt::StringListModel.new(completions)\n\n @completion_pos = pos\n\n @completer.model = model\n\n if word != @completer.completion_prefix\n @completer.completion_prefix = word\n @completer.popup.current_index = @completer.completion_model.\n index(0, 0)\n end\n\n rect = cursor_rect\n rect.width = @completer.popup.size_hint_for_column(0) +\n @completer.popup.vertical_scroll_bar.size_hint.width\n\n @completer.complete rect\n else\n @completer.popup.hide\n end\n\n Qt::Application.restore_override_cursor\n end",
"def input_type; end",
"def auto_complete(editor)\n editor.cursor.read do |word|\n sword = word.to_sym \n if word == \"\\n\"\n throw :eol\n elsif editor.template.user_classes.include?(sword)\n build_suggestion(Editor.const_get(word).methods)\n elsif editor.template.context.methods.include?(sword)\n build_suggestion(editor.template.context.method(sword).parameters)\n end\n\tend\nend",
"def text_type=(value)\n self.text_type_ord = @@text_type_to_text_type_ord[value]\n end",
"def run_input_thread; end",
"def char_press\n begin\n system('stty raw -echo') # turn raw input on\n input = $stdin.getc if $stdin.ready?\n input.chr if input\n ensure\n system('stty -raw echo') # turn raw input off\n end\n end",
"def handle_autocomplete\n if (query = request.params['q'].to_s).empty?\n ''\n else\n model.autocomplete(:type=>@subtype, :request=>request, :association=>params_association, :query=>query, :exclude=>request.params['exclude']).join(\"\\n\")\n end\n end",
"def type ; :event ; end",
"def speech_recognized(object, connection, phrase)\n\t\tif @state == :DEFAULT_STATE \n\t\t\tif phrase.match(/^next/i)\n\t\t\t\tself.plugin_manager.block_rest_of_session_from_server\n\t\t\t\t@state = :DEFAULT_STATE\n\t\t\t\t# @tweetText = $1\n @telnet = Net::Telnet::new(\"Host\" => \"192.168.2.9\",\n \"Port\" => 800,\n \"Binmode\" => true,\n # \"Timeout\" => 10,\n \"Telnetmode\" => true,\n \"Prompt\" => \"\"\n ) { |resp| print \"==> \"+resp }\n # pass username and password as commands not .login method\n @telnet.cmd(\"iam:SIRINextPage\") # { |c| print c }\n # @telnet.puts(\"\") { |c| print c }\n # @telnet.write(\"\\n\\n\\n\\n\\ Ciao\")\n # @response = ''\n # @telnet.cmd(\"String\" => \"response\", \"FailEOF\" => false) # { |c| print c; @response += c }\n @telnet.close\n \n\t\t\t\treturn generate_siri_utterance(connection.lastRefId, \"Gone to next page.\")\n\t\t\t\t# return self.generate_tweet_response(connection.lastRefId, $1);\n\t\t\telsif phrase.match(/^back/i)\n \t\t\t\tself.plugin_manager.block_rest_of_session_from_server\n \t\t\t\t@state = :DEFAULT_STATE\n \t\t\t\t# @tweetText = $1\n @telnet = Net::Telnet::new(\"Host\" => \"192.168.2.9\",\n \"Port\" => 800,\n \"Binmode\" => true,\n # \"Timeout\" => 10,\n \"Telnetmode\" => true,\n \"Prompt\" => \"\"\n ) { |resp| print \"==> \"+resp }\n # pass username and password as commands not .login method\n @telnet.cmd(\"iam:SIRIPreviousPage\") # { |c| print c }\n # @telnet.puts(\"\") { |c| print c }\n # @telnet.write(\"\\n\\n\\n\\n\\ Ciao\")\n # @response = ''\n # @telnet.cmd(\"String\" => \"response\", \"FailEOF\" => false) # { |c| print c; @response += c }\n @telnet.close\n\n \t\t\t\treturn generate_siri_utterance(connection.lastRefId, \"Gone to previous page.\")\n \t\t\t\t# return self.generate_tweet_response(connection.lastRefId, $1);\n\t\t\t elsif phrase.match(/^search for (.+)/i)\n \t\t\t\tself.plugin_manager.block_rest_of_session_from_server\n \t\t\t\t@state = :DEFAULT_STATE\n \t\t\t\t# @tweetText = $1\n @telnet = Net::Telnet::new(\"Host\" => \"192.168.2.9\",\n \"Port\" => 800,\n \"Binmode\" => true,\n # \"Timeout\" => 10,\n \"Telnetmode\" => true,\n \"Prompt\" => \"\"\n ) { |resp| print \"==> \"+resp }\n # pass username and password as commands not .login method\n @telnet.cmd(\"iam:SIRISearch\"+$1) # { |c| print c }\n # @telnet.puts(\"\") { |c| print c }\n # @telnet.write(\"\\n\\n\\n\\n\\ Ciao\")\n # @response = ''\n # @telnet.cmd(\"String\" => \"response\", \"FailEOF\" => false) # { |c| print c; @response += c }\n @telnet.close\n # return self.generate_search_response(connection.lastRefId, $1);\n \t\t\t\treturn generate_siri_utterance(connection.lastRefId, \"Ok, which one do you want?\")\n \t\t\t\t# return self.generate_tweet_response(connection.lastRefId, $1);\n \t\t\t elsif phrase.match(/^the first/i)\n \t\t\t\tself.plugin_manager.block_rest_of_session_from_server\n \t\t\t\t@state = :DEFAULT_STATE\n @telnet = Net::Telnet::new(\"Host\" => \"192.168.2.9\",\"Port\" => 800,\"Binmode\" => true,\"Telnetmode\" => true,\"Prompt\" => \"\") { |resp| print \"==> \"+resp }\n @telnet.cmd(\"iam:SIRISearchIndex0\") # { |c| print c } \n @telnet.close\n \t\t\t\treturn generate_siri_utterance(connection.lastRefId, \"Here it is.\")\n \t\t elsif phrase.match(/^the second/i)\n \t\t\t\tself.plugin_manager.block_rest_of_session_from_server\n \t\t\t\t@state = :DEFAULT_STATE\n @telnet = Net::Telnet::new(\"Host\" => \"192.168.2.9\",\"Port\" => 800,\"Binmode\" => true,\"Telnetmode\" => true,\"Prompt\" => \"\") { |resp| print \"==> \"+resp }\n @telnet.cmd(\"iam:SIRISearchIndex1\") # { |c| print c } \n @telnet.close\n \t\t\t\treturn generate_siri_utterance(connection.lastRefId, \"Here it is.\")\n \t\t elsif phrase.match(/^the third/i)\n \t\t\t\tself.plugin_manager.block_rest_of_session_from_server\n \t\t\t\t@state = :DEFAULT_STATE\n @telnet = Net::Telnet::new(\"Host\" => \"192.168.2.9\",\"Port\" => 800,\"Binmode\" => true,\"Telnetmode\" => true,\"Prompt\" => \"\") { |resp| print \"==> \"+resp }\n @telnet.cmd(\"iam:SIRISearchIndex2\") # { |c| print c } \n @telnet.close\n \t\t\t\treturn generate_siri_utterance(connection.lastRefId, \"Here it is.\")\n \t\t elsif phrase.match(/^the fourth/i)\n \t\t\t\tself.plugin_manager.block_rest_of_session_from_server\n \t\t\t\t@state = :DEFAULT_STATE\n @telnet = Net::Telnet::new(\"Host\" => \"192.168.2.9\",\"Port\" => 800,\"Binmode\" => true,\"Telnetmode\" => true,\"Prompt\" => \"\") { |resp| print \"==> \"+resp }\n @telnet.cmd(\"iam:SIRISearchIndex3\") # { |c| print c } \n @telnet.close\n \t\t\t\treturn generate_siri_utterance(connection.lastRefId, \"Here it is.\")\n \t\t elsif phrase.match(/^the fifth/i)\n \t\t\t\tself.plugin_manager.block_rest_of_session_from_server\n \t\t\t\t@state = :DEFAULT_STATE\n @telnet = Net::Telnet::new(\"Host\" => \"192.168.2.9\",\"Port\" => 800,\"Binmode\" => true,\"Telnetmode\" => true,\"Prompt\" => \"\") { |resp| print \"==> \"+resp }\n @telnet.cmd(\"iam:SIRISearchIndex4\") # { |c| print c } \n @telnet.close\n \t\t\t\treturn generate_siri_utterance(connection.lastRefId, \"Here it is.\")\n \t\t\tend\n\t\t\t\n\t\telsif @state == :CONFIRM_STATE\n\t\t\tif phrase.match(/yes/i)\n\t\t\t\tself.plugin_manager.block_rest_of_session_from_server\n\t\t\t\t@state = :DEFAULT_STATE\n\t\t\t\t# @twitterClient.update(@tweetText) # this should probably be done in a seperate thread\n\t\t\t\treturn generate_siri_utterance(connection.lastRefId, \"Ok it has been posted to Twitter.\")\n\t\t\tend\n\t\t\tif phrase.match(/no/i)\n\t\t\t\tself.plugin_manager.block_rest_of_session_from_server\n\t\t\t\t@state = :DEFAULT_STATE\n\t\t\t\treturn generate_siri_utterance(connection.lastRefId, \"Ok I won't send it.\")\n\t\t\tend\n\n\t\t\tself.plugin_manager.block_rest_of_session_from_server\n\t\t\treturn generate_siri_utterance(connection.lastRefId, \"Do you want me to send it?\", \"I'm sorry. I don't understand. Do you want me to send it? Say yes or no.\", true)\n\t\tend\n\n\t\tobject\n\tend",
"def text_type=(value)\n @text_type = value\n end",
"def onUserText(text, view)\n # The user may type in something that we can't parse as a length\n # so we set up some exception handling to trap that\n begin\n value = text.to_l\n rescue\n # Error parsing the text\n UI.beep\n value = nil\n Sketchup.set_status_text '', SB_VCB_VALUE\n end\n return unless value\n case @state\n when 1\n # update the width\n vec = @pts[1] - @pts[0]\n if vec.length > 0.0\n vec.length = value\n @pts[1] = @pts[0].offset(vec)\n view.invalidate\n increment_state\n end\n when 2\n # update the height\n vec = @pts[3] - @pts[0]\n if vec.length > 0.0\n vec.length = value\n @pts[2] = @pts[1].offset(vec)\n @pts[3] = @pts[0].offset(vec)\n increment_state\n end\n end\n end",
"def prepare_for_immediate_keypress\n\t\t\t@initial_input_ready = true\n\t\t\tself.setCursorPosition(0)\n\t\t\tself.grabKeyboard\n\t\tend",
"def process_key_press( typed_line )\n # retrieve typed character\n typed_character = get_character.chr\n # process backspace\n if typed_character == \"\\177\"\n putc \"\\b \\b\"\n typed_line.chop!\n return typed_line\n # ignore return\n elsif typed_character == \"\\r\"\n return typed_line\n end\n # append typed to current line character and write it out\n typed_line = typed_line + typed_character\n putc typed_character\n typed_line\n end",
"def fill_in_prefetched_typeahead_field(opts)\n type = opts[:type] || 'twitter'\n # Poltergeist / Capybara doesn't fire the events typeahead.js\n # is listening for, so we help it out a little:\n find(opts[:wait_for]) if opts[:wait_for]\n page.execute_script <<-EOF\n $(\"[data-#{type}-typeahead]:visible\").val(\"#{opts[:with]}\").trigger(\"input\");\n $(\"[data-#{type}-typeahead]:visible\").typeahead(\"open\");\n $(\".tt-suggestion\").click();\n EOF\n end",
"def spell; end",
"def text(text_input_handle)\n end",
"def type(key)\n call_command(['type', key])\n end",
"def input \n Character.list\n input = gets.chomp\n index = input.to_i\n clear\n if index <= Character.names.length && index > 0\n adjusted_index = index - 1\n info = Character.info[adjusted_index]\n puts \"#{info}\"\n puts \"\\nType list to search for another character or exit to quit.\".colorize(:blue).colorize(:background => :black)\n elsif \n input == \"exit\" \n clear\n puts \"Goodbye!\".colorize(:green).colorize(:background => :black)\n exit! \n else \n Character.all.clear \n puts \"Incorrect selection, please try again or exit\".colorize(:red).colorize(:background => :black)\n puts \"3\".colorize(:magenta).colorize(:background => :black)\n sleep 1 \n puts \"2\".colorize(:yellow).colorize(:background => :black)\n sleep 1 \n puts \"1\".colorize(:green).colorize(:background => :black)\n sleep 1 \n clear\n call\n \n end \n end",
"def after_keypress_greeting\n begin\n _call = direction\n if _call.present?\n applet = \"{\\\"select\\\":\\\"#{_call.after_keypress_greeting(params)}\\\"}\" if defined?(_call.after_keypress_greeting)\n end\n rescue => e\n logger.error e.message\n logger.error e.backtrace.join(\"\\n\")\n end\n render :plain => applet, content_type: \"text/html\", status: 200\n end",
"def ask_hint text, deflt=nil\n f = nil\n \n #ch = get_char\n ch = get_single text\n if ch == \"ENTER\" \n return deflt\n end\n ix = get_index(ch, $viewport.size)\n f = $viewport[ix] if ix\n return f\nend",
"def on_key(ch)\n end",
"def type_select\n puts \"#{yield if block_given?}#{MESSAGE_TYPE}\"\n str = stty\n if %w[c с].include?(str)\n Train::TYPES[0]\n elsif %w[p з].include?(str)\n Train::TYPES[1]\n else\n type_select { MESSAGE_TYPE_ERROR }\n end\n end",
"def doKeyPress( value )\r\n begin\r\n maxLength = @o.maxLength\r\n if (maxLength != -1 && value.length > maxLength)\r\n original_value = value\r\n value = original_value[0..maxLength]\r\n element.log \" Supplied string is #{suppliedValue.length} chars, which exceeds the max length (#{maxLength}) of the field. Using value: #{value}\"\r\n end\r\n rescue\r\n # probably a text area - so it doesnt have a max Length\r\n maxLength = -1\r\n end\r\n for i in 0..value.length-1 \r\n #sleep element.typingspeed # typing speed\r\n c = value[i,1]\r\n #element.log \" adding c.chr \" + c #.chr.to_s\r\n @o.value = \"#{(@o.value.to_s + c)}\" #c.chr\r\n @o.fireEvent(\"onKeyDown\")\r\n @o.fireEvent(\"onKeyPress\")\r\n @o.fireEvent(\"onKeyUp\")\r\n end\r\n \r\n end",
"def onUserText(text, view)\n # The user may type in something that we can't parse as a length\n # so we set up some exception handling to trap that\n begin\n value = text.to_l\n rescue\n # Error parsing the text\n UI.beep\n value = nil\n Sketchup.set_status_text '', SB_VCB_VALUE\n end\n # Process here.\n @numSegments = value\n end",
"def summoner_spell; end",
"def scan_for_t(token); end",
"def ask_user(placeholder: \"\", identifier: , cb:)\n return if identifier == @ask_identifier\n\n @ask_identifier = identifier\n @ta.set_placeholder_text(placeholder)\n @ta.set_text(\"\")\n @ta.show()\n @keyboard.set_ta(@ta)\n @keyboard.show()\n\n bottom_space = @screen.get_height() - (@ta.get_y() + @ta.get_height())\n delta = bottom_space - @keyboard.get_height() - 3*@unit\n offset_page(delta) if delta < 0\n\n @ta.on_submit = ->(value) do\n @ta.hide()\n offset_page(0)\n cb.call(value)\n end\n end",
"def type_text(locator, text)\n Logbook.step(\"Type text '#{text}' to the input with locator #{locator}\")\n find(locator).send_keys(:backspace, text)\n end",
"def ask_twitterkeyword\r\n\tputs \"Tell me a keyowrd you would like to know more on twitter!\"\r\n\tgets.chomp.downcase\r\nend",
"def create\n @suggestion = Suggestion.new(suggestion_params)\n @suggestion.user_id = current_user.id if current_user.present?\n @suggestion.type_s = params[:suggestion][:type_s].to_i\n respond_to do |format|\n if @suggestion.save\n if @suggestion.info? || @suggestion.especial?\n flash[:info] = 'Revisaremos tu mensaje y contactaremos en breve contigo.'\n else\n flash[:info] = 'Hemos registrado tu sugerencia, recuerda que una vez al mes revisamos nuestras sugerencias y realizamos encuestas. <br> Gracias por tu opinión'\n end\n \n format.html { redirect_to root_path }\n format.json { render :show, status: :created, location: @suggestion }\n else\n format.html { render :new }\n \n end\n end\n end",
"def set_current_text_input(text_input_handle)\n end",
"def text_field; end",
"def destroy\n @typing.destroy\n respond_to do |format|\n format.html { redirect_to typings_url, notice: 'Typing was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def handle_character\n char = characters.get_next\n return interupt if char.is?(:ctrl_c)\n return cancel if char.is?(:escape)\n return go_up if char.is?(:up)\n return go_down if char.is?(:down)\n return enter if char.is?(:enter)\n return right if char.is?(:right)\n return left if char.is?(:left)\n return right if char.is?(:option_right)\n return left if char.is?(:option_left)\n\n\n if editor\n editor.auto_complete_input = char\n cancel\n end\n end",
"def suggest\n end",
"def auto_complete\n type = params[:type].to_s\n string = CGI.unescape(params[:id].to_s).strip_squeeze\n if string.blank?\n render(text: \"\\n\\n\")\n else\n auto = AutoComplete.subclass(type).new(string, params)\n results = auto.matching_strings.join(\"\\n\") + \"\\n\"\n render(text: results)\n end\n end",
"def select_question_type\n set_user_input\n if @user_input == 0\n @response = Registration.question_type_selection(@screen_id)\n @session.update_attributes(question_type_id: nil, req_no: @req_no - 1)\n else\n @question_type = QuestionType.find_by_ussd_id(@user_input)\n if @question_type\n @session.update_attributes(question_type_id: @question_type.id, req_no: @req_no)\n if URI.escape(@question_type.name) == URI.escape(\"Révision scolaire\")\n @response = Registration.select_academic_level(@screen_id)\n else\n @response = Registration.confirm_registration(@session, @screen_id)\n end\n else\n @response = Error.invalid_question_type(@screen_id)\n end\n end\n end",
"def type(key)\n call_command(['type', key])\n end",
"def type(key, &blk)\n call_command(['type', key], &blk)\n end",
"def is_text?(); @type == GRT_TEXT; end",
"def start_accepting\n @res = [\"\"]\n @indent = 0\n @prefix = nil\n\n @list_index = []\n @list_type = []\n @list_width = []\n end",
"def keypress_handler(scancode)\n i = scancode & 0x7f\n x = SCREEN_W() - 100 * 3 + (i % 3) * 100\n y = SCREEN_H() / 2 + (i / 3 - 21) * 10\n color = scancode & 0x80 != 0 ? makecol(255, 255, 0) : makecol(128, 0, 0)\n rectfill(screen, x, y, x + 95, y + 8, color)\n str = ustrzncpy(scancode_to_name(i), 12)\n textprintf_ex(screen, font, x + 1, y + 1, makecol(0, 0, 0), -1, str)\nend",
"def onUserText(text, view)\r\n # The user may type in something that we can't parse as a length\r\n # so we set up some exception handling to trap that\r\n begin\r\n value = text.to_l\r\n rescue\r\n # Error parsing the text\r\n UI.beep\r\n value = nil\r\n Sketchup::set_status_text \"\", SB_VCB_VALUE\r\n end\r\n return if !value\r\n \r\n # update the offset of the window or door\r\n @offset = value\r\n find_end_points\r\n view.invalidate\r\n self.draw_obj\r\n Sketchup.active_model.select_tool(nil)\r\nend",
"def take_user_word_input\r\n\t\t\t\t\t\t\t\t@input.gets.chomp.upcase\r\n\t\t\t\tend",
"def search_for_type(type)\n q = type\n # search for tweets containing type or #type\n # save them to DB if request is valid (ie not an exception)\n end",
"def type(key)\n send_command([:type, key])\n end",
"def input_model_text(new_text)\n pending(\"proper input text method that triggers all normal events\")\n fail\n end",
"def controlTextDidChange(notification)\n queue.cancelAllOperations\n if searchField.stringValue =~ /^\\s*$/\n @filteredData = Utf8::Symbol.all\n reloadTable\n else\n search = SearchTask.alloc.initWithTerm(searchField.stringValue)\n queue.addOperation(search)\n end\n end",
"def type(msg)\n if msg == \"A\"\n thread[:mode] == :ascii\n \"200 Type set to ASCII\"\n elsif msg == \"I\"\n thread[:mode] == :binary \n \"200 Type set to binary\"\n end\n end",
"def type(msg) # :yields: type\n if (msg == 'A')\n thread[:mode] = :ascii\n \"200 Type set to ASCII\"\n elsif (msg == 'I')\n thread[:mode] = :binary\n \"200 Type set to binary\"\n end\n end",
"def input_handler(input)\n case input\n when \"w\"\n update_direction(\"N\")\n when \"s\"\n update_direction(\"S\")\n when \"a\"\n update_direction(\"O\")\n when \"d\"\n update_direction(\"W\")\n end\nend"
] | [
"0.6774777",
"0.64316434",
"0.62740463",
"0.60293543",
"0.58119667",
"0.5730701",
"0.56031734",
"0.5587063",
"0.55658495",
"0.5550916",
"0.54618156",
"0.5433956",
"0.5390404",
"0.5302332",
"0.5228392",
"0.5191063",
"0.5180171",
"0.51741457",
"0.5156803",
"0.51085836",
"0.5076976",
"0.5066637",
"0.50630444",
"0.50386316",
"0.5003626",
"0.5002021",
"0.49920928",
"0.49881583",
"0.49711415",
"0.49605846",
"0.49592265",
"0.49557266",
"0.49237758",
"0.4911919",
"0.49059692",
"0.48968312",
"0.48913014",
"0.488829",
"0.4846854",
"0.481497",
"0.48105636",
"0.48092157",
"0.4804536",
"0.48008314",
"0.4796199",
"0.47909272",
"0.47821993",
"0.47682354",
"0.47667482",
"0.47557798",
"0.4754478",
"0.47538772",
"0.4748757",
"0.4744564",
"0.47372025",
"0.47277027",
"0.4725159",
"0.47190443",
"0.47138852",
"0.47019398",
"0.46985152",
"0.4698416",
"0.46793842",
"0.4670026",
"0.46629003",
"0.4660249",
"0.46572194",
"0.46503246",
"0.46445927",
"0.46285033",
"0.46212378",
"0.46197477",
"0.4619741",
"0.46182743",
"0.46001232",
"0.4596554",
"0.45887184",
"0.4581782",
"0.4573877",
"0.4571899",
"0.4567108",
"0.45612162",
"0.45489007",
"0.4548678",
"0.45446187",
"0.453789",
"0.45322886",
"0.4526222",
"0.45236474",
"0.45234647",
"0.45141503",
"0.45137456",
"0.45121452",
"0.45068097",
"0.45048216",
"0.44991446",
"0.44986054",
"0.4498151",
"0.44955936"
] | 0.79771054 | 0 |
Internal handler for MESSAGE_UPDATE | def update_message(data); end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def updated(message)\n end",
"def update\n # find and update a specific message\n end",
"def update\n # find and update a specific message\n end",
"def update\n # find and update a specific message\n end",
"def update\n update_q(@message, message_params)\n end",
"def update!(**args)\n @message = args[:message] if args.key?(:message)\n end",
"def update!(**args)\n @message = args[:message] if args.key?(:message)\n end",
"def updating( msg )\n @log.info \"updating #{msg}\"\n end",
"def manage_update(params)\n message = Message.find(params[:id])\n if params[:commit] == \"Send\"\n send(message)\n else\n body = params[:message][:body] || \"\"\n message.update_attributes!(body: body, sent: false)\n end\n end",
"def update\n @message = Message.find(params[:id])\n \tif userCanEditMsg?(@message)\n \t\tparams[:message][:updater_id] = current_user.id if @message.status_id == 1\n old_status_id = @message.status_id\n new_status_id = (params[:message][:status_id].nil?)? 0 : params[:message][:status_id].to_i\n \t\trespond_to do |format|\n \t\t if @message.update_attributes(params[:message])\n if new_status_id > old_status_id\n sendNewMessageMail(@message)\n noticeText = \"Сообщение успешно добавлено.\" \n newTime = Time.now\n @message.update_attributes(created_at: newTime, updated_at: newTime)\n @message.theme.update_attribute(:last_message_date, newTime) if !@message.theme.nil?\n else\n noticeText = \"Сообщение успешно обновлено.\"\n end\n link = session[:link_after_message_save] + \"#msg_#{@message.id}\"\n \t\t\t#link = \"#{theme_path(@message.theme_id)}#msg_#{@message.id}\" if @message.theme != nil\n \t\t\t#link = \"#{video_path(@message.video_id)}#msg_#{@message.id}\" if @message.video != nil\n #link = \"#{photo_album_path(@message.photo_album_id)}#msg_#{@message.id}\" if @message.photo_album != nil\n #link = \"#{photo_path(@message.photo_id)}#msg_#{@message.id}\" if @message.photo != nil\n \t\t\tif params[:photo_editions]!= nil and params[:photo_editions] != []\n \t\t\t\tphotos_params = params[:photo_editions][:photos]\n \t\t\t\tphotos_params.each do |x|\n \t\t\t\t\tphoto = Photo.find_by_id(x[1][:id])\n \t\t\t\t\tif photo != nil\n \t\t\t\t\t\tif photo.description != x[1][:description]\n \t\t\t\t\t\t\tphoto.update_attribute(:description, x[1][:description])\n \t\t\t\t\t\tend\n \t\t\t\t\tend\n \t\t\t\tend\n \t\t\tend\n jsonData = {\n content: @message.content_html\n }\n \t\t\t#link = message_path(@message.id)\n \t\t\t#link = \"#{theme_path(@message.theme_id)}#msg_#{@message.id}\" if @message.theme != nil\n \t\t\t#link = \"#{video_path(@message.video_id)}\" if @message.video != nil\n \t\t\t#link = \"#{photo_path(@message.photo_id)}\" if @message.photo != nil\n \t\t\tformat.html { redirect_to link, :notice => noticeText}\n \t\t\tformat.json { render :json => jsonData }\n \t\t else\n \t\t\t#current_user.message_draft.clean\n \t\t\t@message_to = Message.find_by(id: params[:message][:message_id], status_id: 1)\n \t\t\t@theme = Theme.find_by(id: @message.theme_id, status_id: 1)\n \t\t\t@photo = Photo.find_by(id: @message.photo_id, status_id: 1)\n \t\t\t@video = Video.find_by(id: @message.video_id)\n @album = PhotoAlbum.find_by(id: @formMessage.photo_album_id, status_id: 1)\n \t\t\tif @theme != nil\n \t\t\t\t@title = 'Изменение сообщения'\n \t\t\t\t@topic = Topic.find_by(id: @message.topic_id)\n \t\t\t\t@path_array = [\n \t\t\t\t\t\t {:name => 'Общение', :link => '/visota_life'},\n \t\t\t\t\t\t\t\t{:name => @theme.topic.name, :link => topic_path(@theme.topic)},\n \t\t\t\t\t\t\t\t{:name => @theme.name, :link => theme_path(@theme)},\n \t\t\t\t\t\t\t\t{:name => @title, :link => '#'}\n \t\t\t\t\t\t\t ]\n \t\t\tend\n \t\t\tif @photo != nil\n \n \t\t\tend\n \t\t\tif @video != nil\n \t\t\t\t@title = @header = 'Изменение комментария'\n \t\t\t\t@path_array = [\n {:name => 'Медиа', :link => '/media'},\n \t\t\t\t\t\t{:name => 'Видео', :link => '/media?t=videos&c=all'},\n \t\t\t\t\t\t{:name => @video.category_name, :link => \"/media?t=videos&c=#{@video.category_id}\"},\n \t\t\t\t\t\t{:name => @video.alter_name, :link => video_path(@video)},\n \t\t\t\t\t\t{:name => @title}\n \t\t\t\t\t\t\t ]\n \t\t\tend\t\t\t\t\n \t\t\tformat.html { render :action => \"edit\" }\n \t\t\tformat.json { render :json => @message.errors, :status => :unprocessable_entity }\n \t\t end\n \t\tend\n \telse\n \t\tredirect_to \"/404\"\n \tend\n end",
"def update\n respond_to do |format|\n if @admin_message.update(admin_message_params)\n MessageMailer.message_reply(@admin_message).deliver\n # if you use delayed_job for email deliver\n # MessageMailer.message_reply(@admin_message).send_later(:deliver)\n format.html { redirect_to admin_messages_url, notice: \"#{ t 'activerecord.successful.messages.message_updated' }\" }\n format.json { render :show, status: :ok, location: @admin_message }\n else\n format.html { render :edit }\n format.json { render json: @admin_message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @message = Message.new(:body => params[:message])\n if Messenger.add_reply(current_user, params[:id], @message)\n return_message(200, :ok)\n else\n return_message(200, :ok, {:err => {:messages => [106]}})\n end\n end",
"def update!(**args)\n @messages = args[:messages] if args.key?(:messages)\n end",
"def update!(**args)\n @message = args[:message] unless args[:message].nil?\n end",
"def update!(**args)\n @message = args[:message] unless args[:message].nil?\n end",
"def update\n @message = Message.find(params[:id])\n\tif !checkme? @message then return end\n\n respond_to do |format|\n if @message.update_attributes(params[:message])\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n message = Message.find_by(params[:id])\n if message.nil?\n render_error(\"message with id #{params[:id]} does not exist\", :not_found)\n elsif message.created_at < Time.now.utc - MAX_EDIT_PERIOD\n render_error(\"cannot update message more than #{MAX_EDIT_PERIOD} seconds old\", :forbidden)\n else\n render json: message.update(message_params)\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n\tformat.html { redirect_to subject_path(@message.subject, :page => session[:page]), notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n\tsetup_edit_message_params\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update \n set_page_title \"Private Message\"\n \n compose_message\n \n # All threaded messages share the same original ID, so we'll just call the first record\n @private_message.original_message_id = original_message_id\n \n # Validate against SPAMMY behavior\n check_flood_limit @users.uniq unless @users.nil?\n \n \n # For brevity and convinience, the error checking and the recipient assignment are addressed together, sequentially, in the following line\n if @private_message.errors.count == 0 and @private_message.save and (@users.uniq.each {|username| @private_message.recipients.create(:user_id => User.find_by_username(username).id) }) \n if ConfigurationSetting.get_setting_to_bool(\"EmailPrivateMessageNotices\")\n spawn do\n @private_message.recipient_users.each do |u|\n NotificationsMailer.deliver_private_message(@private_message,u)\n end\n end\n end\n\n flash[:notice] = \"Reply sent\"\n redirect_to private_messages_path\n else\n @original_message = @private_messages.first\n render :action => session[:action_name]\n end \n end",
"def update\n respond_to do |format|\n if @internal_message.update(internal_message_params)\n format.html { redirect_to @internal_message, notice: 'Internal message was successfully updated.' }\n format.json { render :show, status: :ok, location: @internal_message }\n else\n format.html { render :edit }\n format.json { render json: @internal_message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @messages = args[:messages] unless args[:messages].nil?\n end",
"def update\n if @message.update(message_params) \n render json: @message, status: :ok, location: @message\n else\n render json: @message.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to user_project_app_thread_url(@user,@project,@app_thread), notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { redirect_to user_project_app_thread_url(@user,@project,@app_thread), notice: @message.errors.full_messages.inspect }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!\n @service.update_message(self)\n end",
"def update\n if @message.update(message_params)\n render json: @message, status: :ok\n else\n render json: @message.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to administrators_messages_path(@message), notice: 'Новость обновлена.' }\n else\n format.html { render action: 'edit' }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @message.update(message_params)\n render json: @message\n else\n render json: @message.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to messages_url, notice: 'Message was successfully updated.' }\n else\n format.html { render :edit }\n end\n end\n end",
"def update!(**args)\n @message = args[:message] if args.key?(:message)\n @state = args[:state] if args.key?(:state)\n @update_time = args[:update_time] if args.key?(:update_time)\n end",
"def update_messages\n p = sanitize(params[:messages], [\n \"conf_message\", \"conf_prepend_venue\", \"page_message\", \"page_prepend_venue\", \"offer_id\" ])\n\n if current_account.update_attributes(p)\n render :text => \"\"\n else\n raise current_account.errors.full_messages.to_json\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: \"Message was successfully updated.\" }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: \"Message was successfully updated.\" }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n begin\n @message.update(message_params) or return render :edit\n rescue ActiveRecord::RecordNotFound\n return render :edit\n end\n @message.update(date: DateTime.now, user: @current_user)\n render :show\n end",
"def update\n respond_to do |format|\n if @msg.update(msg_params)\n format.html { redirect_to @msg, notice: 'Msg was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @msg.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @received_messages = args[:received_messages] unless args[:received_messages].nil?\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_back_to messages_path, flash: { success: 'Message was successfully updated.' } }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @message = args[:message] if args.key?(:message)\n @status = args[:status] if args.key?(:status)\n end",
"def update\n respond_to do |format|\n if @message.update_attributes(params[:message])\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n flash[:alert] = ' Message was successfully updated.'\n format.html { redirect_to @message }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @message = Message.find(params[:id])\n\n respond_to do |format|\n if @message.update_attributes(params[:message])\n format.html { redirect_to admin_message_path(@message), notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def msg_update\n # This happens if user hits F12 while a Tutorial Message is waiting\n if @timed_msg.disposed?\n # Reset Msg Flag\n $game_temp.timed_msg = nil\n # Clear Msg\n @timed_msg = nil\n # Prevents updating a disposed window which causes a crash...\n return\n end\n if @timed_msg\n if @timed_msg.visible == false\n @timed_msg.dispose\n @timed_msg = nil\n return\n end\n end\n # Update the Message Window\n @timed_msg.update\n end",
"def update!(**args)\n @message = args[:message] if args.key?(:message)\n @state = args[:state] if args.key?(:state)\n end",
"def update!(**args)\n @message = args[:message] if args.key?(:message)\n @state = args[:state] if args.key?(:state)\n end",
"def update!(**args)\n @message = args[:message] if args.key?(:message)\n @state = args[:state] if args.key?(:state)\n end",
"def update!(**args)\n @message = args[:message] if args.key?(:message)\n @state = args[:state] if args.key?(:state)\n end",
"def update!(**args)\n @message = args[:message] if args.key?(:message)\n @state = args[:state] if args.key?(:state)\n end",
"def update\n @message_field = MessageField.find(params[:id])\n\n respond_to do |format|\n if @message_field.update_attributes(params[:message_field])\n format.html { redirect_to @message_field, notice: 'Message field was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @message_field.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @msg.update(msg_params)\n format.html { redirect_to @msg, notice: 'Msg was successfully updated.' }\n format.json { render :show, status: :ok, location: @msg }\n else\n format.html { render :edit }\n format.json { render json: @msg.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Le message a bien été mis à jour.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @message = current_user.messages.find_by_id(params[:id])\n if @message\n respond_to do |format|\n if @message.update_attributes(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :_message }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n else\n not_the_owner\n end\n end",
"def update\n @message = Message.find(params[:id])\n\t\tdeny_access_unless(current_user?(@message.user))\n respond_to do |format|\n if @message.update_attributes(params[:message])\n format.html { redirect_to @message, :notice => 'Message was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @message.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n # format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n # format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n endrender :'messages/create'\n end\n end\n end",
"def update!(**args)\n @message_text = args[:message_text] if args.key?(:message_text)\n @message_time = args[:message_time] if args.key?(:message_time)\n @severity = args[:severity] if args.key?(:severity)\n end",
"def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { redirect :back }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @message = Message.find(params[:id])\n \n respond_to do |format|\n if @message.user_id != current_user.id || @message.status == \"sent\"\n flash[:error] = \"You haven't got right to modify this resource...\"\n format.html { redirect_to account_messages_path }\n format.xml { render :xml => @message.errors, :status => :unprocessable_entity }\n elsif @message.update_attributes(params[:message])\n flash[:notice] = 'Message was successfully updated.'\n format.html { redirect_to account_message_url(@message.id) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @message.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def on_receive(message)\n update\n end",
"def update\n respond_to do |format|\n if @c_message.update(c_message_params)\n format.html { redirect_to @c_message, notice: 'C message was successfully updated.' }\n format.json { render :show, status: :ok, location: @c_message }\n else\n format.html { render :edit }\n format.json { render json: @c_message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n user = User.find(params[:id])\n #get all the not fetched messages for the current user\n @messages = Message.find :all, :conditions => [\"sended_at > ?\", user.last_update]\n #update the current user last update\n user.last_update = Time.now.to_f\n user.save\n #if there's messages then renderice else none\n if @messages.length > 0\n render \"messages.html.erb\", :layout => false\n else\n render :nothing => true\n end\n end",
"def update\n respond_to do |format|\n if @custom_message.update(custom_message_params)\n format.html { redirect_to custom_messages_path, notice: 'Custom message was successfully updated.' }\n format.json { render :index, status: :ok, location: @custom_message }\n else\n format.html { render :edit }\n format.json { render json: @custom_message.errors, status: :unprocessable_entity }\n end\n end\n end"
] | [
"0.80195963",
"0.7928072",
"0.7928072",
"0.78656393",
"0.7246278",
"0.7036213",
"0.7036213",
"0.6981093",
"0.69660515",
"0.69639397",
"0.6948467",
"0.6946392",
"0.6924613",
"0.6910506",
"0.6910506",
"0.6884319",
"0.6867026",
"0.6866507",
"0.6863477",
"0.6854968",
"0.6808966",
"0.68040884",
"0.6804027",
"0.6793429",
"0.6793252",
"0.6793148",
"0.6784867",
"0.6784867",
"0.67666644",
"0.674946",
"0.67473286",
"0.6742936",
"0.6738503",
"0.67372113",
"0.6736704",
"0.6736704",
"0.6736704",
"0.6736704",
"0.6736704",
"0.6736704",
"0.6736704",
"0.6736704",
"0.6736704",
"0.6736704",
"0.6736704",
"0.6736704",
"0.6736704",
"0.6736704",
"0.6736704",
"0.6736704",
"0.6736704",
"0.6736704",
"0.6736704",
"0.6736704",
"0.6736704",
"0.6736704",
"0.6736704",
"0.6736704",
"0.6736704",
"0.6736704",
"0.6736704",
"0.6736704",
"0.6736704",
"0.6736704",
"0.6736704",
"0.6736704",
"0.67366666",
"0.6735164",
"0.6727893",
"0.6724091",
"0.6724091",
"0.672407",
"0.6718887",
"0.6718365",
"0.6717073",
"0.67079055",
"0.66938806",
"0.669321",
"0.6688004",
"0.6682973",
"0.6680255",
"0.6680255",
"0.6680255",
"0.6680255",
"0.6680255",
"0.66764617",
"0.666129",
"0.6659286",
"0.6655807",
"0.6652895",
"0.66460043",
"0.6635916",
"0.66148484",
"0.66132",
"0.6608358",
"0.66039824",
"0.65967333",
"0.658403",
"0.6576928"
] | 0.81659627 | 0 |
Internal handler for MESSAGE_DELETE | def delete_message(data); end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n # delete a specific message\n end",
"def destroy\n # delete a specific message\n end",
"def destroy\n # delete a specific message\n end",
"def delete_msg()\n MsgUtil.delete_msg(params[:ch])\n end",
"def destroy\n get_message().delete\n end",
"def messagedelete\n TDirmessage.find_by(\"dirmsg_id=?\", params[:messagedelete]).delete\n redirect_back(fallback_location: dirmsgcreate_path)\n end",
"def delete\n @client.post('/api/del_msg', id: get_attribute(:name))\n end",
"def delete_message(id)\n record \"/msg/delete/#{id}\"\n end",
"def destroy\n #@message = Message.find(params[:id])\n #@message.destroy\n #redirect_to projects_path\n current_user.delete_message(ActsAsMessageable::Message.find(params[:id]))\n redirect_to trash_url\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to success_path, notice: _('Message deleted') }\n format.json { head :no_content }\n end\n end",
"def destroy\n @msg.destroy\n respond_to do |format|\n format.html { redirect_to msgs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n end",
"def destroy\n @message.destroy\n \n flash[:success] = \"Your message was successfully deleted.\"\n redirect_to @message\n end",
"def destroy\n destroy_q(@message, messages_url)\n end",
"def destroy\n @admin_message.destroy \n respond_to do |format|\n format.html { redirect_to admin_messages_url, notice: \"#{ t 'activerecord.successful.messages.message_deleted' }\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n \t\n @message = Message.find(params[:id])\n @message.delete\n\n respond_to do |format|\n format.html { redirect_to(messages_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to administrators_messages_path(@message), notice: 'Новость удалена.' }\n end\n end",
"def destroy\n if @message.destroy\n head :no_content\n else\n render json: @message.errors, status: :unprocessable_entity\n end\n end",
"def destroy\n @message.destroy\n redirect_to action: :index\n end",
"def destroy\r\n push_notification :remove\r\n @message.destroy\r\n respond_to do |format|\r\n format.html { redirect_to channel_messages_url(@channel) }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @fdn_received_message = Fdn::ReceivedMessage.find(params[:id])\n #@fdn_received_message.destroy\n @fdn_received_message.be_trashed(current_user)\n\n respond_to do |format|\n format.html { redirect_to fdn_messages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n \n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message = Message.find(params[:id])\n\t ent = @message.theme if @message.theme != nil\n\t ent = @message.photo if @message.photo != nil\n\t ent = @message.photo_album if @message.photo_album != nil\n ent = @message.video if @message.video != nil\n \tif userCanDeleteMessage?(@message)\n theme = @message.theme\n \t\tif is_admin?\n \t\t\tif @message.status_id != 1\n \t\t\t\t@message.destroy\n \t\t\telse\n \t\t\t\t@message.update_attribute(:status_id, 2)#@message.set_as_delete\n \t\t\tend \n \t\telse\n \t\t\t@message.destroy\n \t\tend\n theme.last_msg_upd if !theme.nil?\n \t\trespond_to do |format|\n \t\t format.html { redirect_to ent }\n \t\t format.json { head :no_content }\n \t\tend\n \telse\n \t\tredirect_to '/404'\n \tend\n end",
"def destroy\n \n respond_to do |format|\n if @message.destroy\n format.html { redirect_to messages_url, notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n else\n format.html { redirect_to sent_messages_url, notice: 'cannot delete message that has already been read' }\n format.json { head :no_content }\n end\n \n end\n end",
"def destroy\n @message = Message.find(params[:id])\n @message.make_deleted(current_user.id)\n response_message = {:message => 'Message deleted successfully.'}\n respond_to do |format|\n format.xml { render :xml => response_message }\n format.json { render :json => response_message }\n end\n end",
"def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'message.deleted' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'Message was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message = Message.find(params[:id])\n if current_user.received_messages.find(@message)\n MessageRecipient.find_by_user_id_and_message_id(current_user, @message.id).destroy\n\n else\n @message.destroy\n end\n \n\n respond_to do |format|\n format.html { redirect_to account_messages_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to [@member, :messages] }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message = Message.find(params[:id])\n @message.mark_deleted(current_user)\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to admin_messages_url, notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n @service.delete_message(self)\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to user_project_app_thread_url(@user,@project,@app_thread), notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @msg.destroy\n respond_to do |format|\n format.html { redirect_to msgs_url, notice: 'Msg was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n head :no_content\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'El Mensaje ha sido eliminado correctamente!' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n head :no_content\n end",
"def destroy\n message = Message.find(params[:id])\n message.destroy\n end",
"def destroy\n @custom_message.destroy\n respond_to do |format|\n format.html { redirect_to custom_messages_url, notice: 'Custom message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'Le message a bien été supprimé.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'Message was successfully destroyed.' }\n end\n end",
"def destroy\n @c_message.destroy\n respond_to do |format|\n format.html { redirect_to c_messages_url, notice: 'C message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to current_user, notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message = Message.find(params[:id])\n @message.destroy\n render json: 'Message was successfully deleted', status: :ok\n end",
"def destroy \n if @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_path, notice: 'Post was successfully destroyed.' }\n end\n else\n respond_to do |format|\n format.html { redirect_to messages_path, error: '비밀번호가 일치하지 않습니다.' }\n end\n end\n end",
"def destroy\n @message = Message.find(params[:id])\n authorize! :destroy, @message\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url, notice: t(\"messages.deleted\") }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message = Messages.find(params[:id])\n @message.destroy\n end",
"def destroy\n @message = Message.find(params[:id])\n\tif !checkme? @message then return end\n\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n authorize_admin or return\n\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to(messages_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @message = Admin::Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_messages_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @direct_message.destroy\n \n respond_to do |format|\n format.html { redirect_to DirectMessages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to(messages_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to url_for(action: 'index'), notice: f(@message) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = current_user\n @message = current_user.extension.messages.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to(messages_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @message = Message.find(params[:id])\n @message.destroy\n respond_to do |format|\n format.html { redirect_to noticias_messages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message = Message.find(params[:id])\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"def delete_message(display_id, message_id)\n delete \"commandcenter/displays/#{display_id}/messages/#{message_id}\"\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to @contact, notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to message_user_path(@message.sender_id, @message.receiver_id), notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @message = Message.find(params[:id])\n authorize! :destroy, @message\n\n if current_user.id == @message.sender_id\n @message.sender_deleted = true\n else\n @message.receiver_deleted = true\n end\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"
] | [
"0.79247785",
"0.7870885",
"0.7825669",
"0.78194636",
"0.77664506",
"0.77519286",
"0.75718194",
"0.74972874",
"0.74636704",
"0.7311444",
"0.73051316",
"0.7284578",
"0.7276078",
"0.72565967",
"0.7245604",
"0.7238536",
"0.7228178",
"0.72203404",
"0.7219104",
"0.7218521",
"0.7215475",
"0.7215262",
"0.72109133",
"0.7193445",
"0.71909046",
"0.7188942",
"0.71709216",
"0.7170044",
"0.71668416",
"0.71668416",
"0.71500456",
"0.713781",
"0.71370816",
"0.7133197",
"0.71233624",
"0.71115375",
"0.7098755",
"0.709745",
"0.70969486",
"0.7096035",
"0.70958143",
"0.70944417",
"0.7093724",
"0.70866084",
"0.7056395",
"0.70543766",
"0.7054263",
"0.7053778",
"0.70474833",
"0.70467585",
"0.7044227",
"0.7042369",
"0.7042173",
"0.70362073",
"0.7035521",
"0.7020819",
"0.7013123",
"0.70084643",
"0.69978434",
"0.69948",
"0.6994387",
"0.69909155",
"0.6989513",
"0.6989513",
"0.6989513",
"0.6989513",
"0.69852656",
"0.6985067",
"0.6984051",
"0.6984051",
"0.6984051",
"0.6984051",
"0.6984051",
"0.6984051",
"0.6984051",
"0.6984051",
"0.6984051",
"0.6984051",
"0.6984051",
"0.6984051",
"0.6984051",
"0.6984051",
"0.6984051",
"0.6984051",
"0.6984051",
"0.6984051",
"0.6984051",
"0.6984051",
"0.6984051",
"0.6984051",
"0.6984051",
"0.6984051",
"0.6984051",
"0.6984051",
"0.6984051",
"0.6984051",
"0.6984051",
"0.6984051",
"0.6984051"
] | 0.8421452 | 0 |
Internal handler for MESSAGE_REACTION_ADD | def add_message_reaction(data); end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def handle_add_reply( m, params )\n # lame auth check\n # TODO: need to get a look into new auth system\n\n name = params[:name].downcase\n reply = params[:reply].to_s\n\n # check whether good is in database\n# status( name, @stock )\n# if @inreg == false\n# m.reply( \"#{name} does not exist.\" ); return\n# end\n\n # Put data into database, should be understandable ^^\n reply = Reply.new( @replyversion, reply )\n @reply[name] = reply\n\n # save dataset in case the bot crashes an got no chance to do so\n save\n\n m.reply( \"done\" )\n end",
"def remove_message_reaction(data); end",
"def add_actions; end",
"def alter(m_wfid, m_error, m_action, msg, tracker)\n\n case tracker['msg'].delete('_alter')\n when 'merge' then msg.merge!(tracker['msg'])\n #else ...\n end\n end",
"def recevoirMessage(message)\r\n\t\t@lstMessages[message.id] = message\r\n\tend",
"def new_message\n end",
"def append(action); end",
"def append(action); end",
"def append(action); end",
"def msg_add(c)\n\t@msg_buf << c\n end",
"def add_message(name, message)\n\t\tend",
"def add_to_inbox__do_add\r\n @inbox = params[:inbox] ? Inbox.active.find(params[:inbox]) : @for_inbox\r\n if @inbox && @inbox.accepts?(@content) && !@content.inboxes.include?(@inbox) && !@inbox.archived?\r\n @inbox_item = InboxItem.new(:inbox_id => @inbox.id, :content_id => @content.id,\r\n :allow_take_to_showcase => @inbox.require_allowing_content_adoption? ? true : params[:allow_take_to_showcase],\r\n :user_id => current_actor.id, :original_content_id => @content.original_content_id)\r\n if @inbox_item.save\r\n Activity.send_message(@inbox_item, current_actor, :submitted_to_inbox)\r\n Activity.send_message(@inbox_item, current_actor, :inbox_submission_received)\r\n else\r\n respond_to do |wants|\r\n wants.html { flash[:warning] = \"Your content has been added to your account, but not to '{{name}}' inbox. Reason: {{reason}}\" / [@inbox.title, @inbox_item.errors.full_messages.join(';')]}\r\n wants.js {}\r\n end\r\n end\r\n end\r\n end",
"def relist\n render :partial => \"message\", :object => @entry\n end",
"def done_adding(*) end",
"def create\n message_reaction = MessageReaction.new({content: params[:reaction], message_id: params[:messageId].to_i, user_id: 1})\n\n if message_reaction.save\n updatedMessage = Message.find(params[:messageId]) \n ActionCable.server.broadcast(\n \"message_#{params[:messageId]}\",\n newMessageReaction: message_reaction,\n updatedMessage: updatedMessage,\n )\n end\n end",
"def add_edit event\n # this debug is very specific. it should be removed later. We do not know about the object\n $log.debug \" UNDO GOT #{event}: #{event.type}, (#{event.text}), rej: #{@reject_update} \"\n return if @reject_update\n if @pointer < @actions.length\n $log.debug \" removing some actions since #{@pointer} < #{@actions.length} \"\n @actions.slice!(@pointer..-1)\n $log.debug \" removed actions since #{@pointer} , #{@actions.length} \"\n end\n @actions << event\n @pointer = @actions.length\n end",
"def update_message(data); end",
"def update_message(data); end",
"def handle_message\n self[:type] = HandledMessage.name\n self.save!\n self.reload\n end",
"def on_add(clicker)\n end",
"def <<(message)\n submit_message message\n self\n end",
"def send_message_post_fav_added(subscriber, msg)\n if msg == \"success\"\n text = \"L'annonce a été ajoutée à vos favoris !\"\n response = handle_manychat_response(send_content(subscriber, [create_message_text_hash(text)]))\n elsif msg == \"error_already_exists\"\n text = \"L'annonce est déjà dans vos favoris !\"\n response = handle_manychat_response(send_content(subscriber, [create_message_text_hash(text)]))\n else\n text = \"Oops, il semblerait qu'une erreur se soit produite, l'annonce n'a pas été ajoutée à vos favoris\"\n response = handle_manychat_response(send_content(subscriber, [create_message_text_hash(text)]))\n end\n return response\n end",
"def add_bonus_item(message)\n match = /(bonus item|hidden treasure)! <(?<id>.*)> \\| <(?<name>.*)>/.match(message)\n return nil unless match\n \n add_item(nil, match[:id], match[:name])\n publish Events::ADD_ITEM, match[:id], match[:name]\n end",
"def reply( r )\n @main << r\n end",
"def process_msgs\n end",
"def add(att, msg)\n fetch(att){self[att] = []} << msg\n end",
"def add_effect_message(msg)\n @effect_results.push(msg)\n end",
"def post_data\n case params[:oper]\n when 'add'\n @message = {}\n @message[\"status\"] = ''\n create\n when 'edit'\n update\n when 'del'\n destroy\n end\n end",
"def add_message(type, text)\n @messages ||= []\n @messages.push({type: type, text: text})\n end",
"def add_message(type, text, id=nil)\n @messages ||= []\n @messages.push({type: type, text: text, id: id})\n end",
"def after_add_callback(unused_submission)\n end",
"def add \n end",
"def add\n end",
"def add\n end",
"def booked\n $messages << payload\n end",
"def addAction(participant,issue,name,oldFirst,oldSecond,idFirst,idSecond)\n\t\taction = UserAction.first_or_create({\n\t\t\t:participant => participant,\n\t\t\t:issue => issue,\n\t\t\t:actionName => name,\n\t\t\t:oldContentFirst => oldFirst,\n\t\t\t:oldContentSecond => oldSecond,\n\t\t\t:newIDFirst => idFirst,\n\t\t\t:newIDSecond => idSecond,\n\t\t\t:lastModified => Time.now\n\t\t})\n\tend",
"def add message\n @events[message.sequence] = message\n end",
"def on_message(message)\n case message.action\n when :add\n @counter = @counter + message.value\n when :subtract\n @counter = @counter - message.value\n when :value\n @counter\n else\n pass\n end\n end",
"def add_revision(path, ctype, msg)\n # FIXME: implement\n raise('not implemented')\n notify(EVENT_REV, path, ctype, msg)\n end",
"def modify_message\r\n modification_rules = @conf[\"modify_rules\"]\r\n return unless modification_rules\r\n modify_url(modification_rules)\r\n end",
"def add\n\tend",
"def enqueue_history(action_id, action_msg)\n @history << { timestamp: Time.new,\n action: action_id,\n message: action_msg\n }\n end",
"def add_action(new_action)\n if action(new_action.name)\n raise DuplicateAction, \"Action '#{new_action.name}' already defined on service '#{_attributes_[:name]}'\"\n end\n\n actions << new_action\n end",
"def add_message(message)\r\n fail \"Message needs id\" unless message.respond_to?(:id)\r\n fail \"Message should respond to reply_to\" unless message.respond_to?(:reply_to)\r\n\r\n index = @messages.size-1\r\n unless (message.reply_to.nil?)\r\n index = @messages.find_index { |message_replied| message_replied.message_id.to_i == message.reply_to.to_i }\r\n message.depth = @messages.fetch(index).depth+1\r\n\r\n count = 0\r\n\r\n found = @messages[index+1..@messages.size-1].find do |last_message|\r\n result = last_message.depth < message.depth\r\n count += 1\r\n result\r\n end\r\n\r\n index += count - (found.nil? ? 0 : 1)\r\n end\r\n\r\n @messages.insert(index+1, message)\r\n changed\r\n notify_observers self, message\r\n end",
"def keep message\n @messages << message\n end",
"def action(a)\n @actions << a\n puts a.msg\n end",
"def initialize(*args)\n super\n @action = :add\nend",
"def on_matched_reply(regexp, &block)\n @matched_reply_actions ||= {}\n @matched_reply_actions[regexp] = block\n end",
"def add(param, identifier)\n @messages[param] << identifier\n end",
"def add_additional(name, type, klass)\n self.payload += self.add_record(name, type, klass).encode\n self.additional_rr += 1\n end",
"def on_message(pre, message)\n\n m_wfid = message['wfid'] || (message['fei']['wfid'] rescue nil)\n m_error = message['error']\n\n m_action = message['action']\n m_action = \"pre_#{m_action}\" if pre\n\n msg = m_action == 'error_intercepted' ? message['msg'] : message\n\n ids_to_remove = []\n\n trackers.each do |tracker_id, tracker|\n\n # filter msgs\n\n t_wfid = tracker['wfid']\n t_action = tracker['action']\n\n next if t_wfid && t_wfid != m_wfid\n next if t_action && t_action != m_action\n\n next unless does_match?(message, tracker['conditions'])\n\n if tracker_id == 'on_error' || tracker_id == 'on_terminate'\n\n fs = msg['workitem']['fields']\n\n next if m_action == 'error_intercepted' && fs['__error__']\n next if m_action == 'terminated' && (fs['__error__'] || fs['__terminate__'])\n end\n\n # remove the message post-trigger?\n\n ids_to_remove << tracker_id if tracker['msg'].delete('_auto_remove')\n\n # OK, have to pull the trigger (or alter the message) then\n\n if pre && tracker['msg']['_alter']\n alter(m_wfid, m_error, m_action, msg, tracker)\n else\n trigger(m_wfid, m_error, m_action, msg, tracker)\n end\n end\n\n remove(ids_to_remove, nil)\n end",
"def actions_relationship\n manager_id = params[:data]\n user_id = params[:user_id]\n message = params[:message]\n\n if message.eql?\"edit\"\n @user = User.find(user_id)\n respond_to do |format|\n if @user.update_attributes(team_leader_id: manager_id)\n format.json { render json: @user }\n else\n format.json { render json: @user.errors, status: :unprocessable_entity}\n end\n end\n elsif message.eql?\"remove\"\n @user = User.find(user_id)\n respond_to do |format|\n if @user.update_attributes(team_leader_id: nil)\n format.json { render json: @user }\n else\n format.json { render json: @user.errors, status: :unprocessable_entity}\n end\n end\n end\n end",
"def add\n\nend",
"def set_message_reaction\n @message_reaction = MessageReaction.find(params[:id])\n end",
"def set_message_reaction\n @message_reaction = MessageReaction.find(params[:id])\n end",
"def initialize(*args)\n\tsuper\n\t@action = :add\nend",
"def add_id_to_list(article, id_to_add)\n\n # first make sure not already requested\n array_to_check = return_array(article.request_array)\n if array_to_check.include? id_to_add.to_s\n flash[:notice] = \"You cannot request #{article.title} twice\"\n\n else\n new_request_array = article.request_array\n new_request_array << '-' + id_to_add.to_s\n article.update(request_array: new_request_array)\n\n # now check if id is added\n array_to_check = return_array(article.request_array)\n if array_to_check.include? id_to_add.to_s\n flash[:notice] = \"#{article.title} was added to your items requested list\"\n else\n flash[:notice] = \"You cannot request #{article.title}\"\n end\n\n end\n\n end",
"def add_error(msg)\n messages << msg\n end",
"def action_hook; end",
"def message( message )\n\tend",
"def net_message(message)\n @messages << message\n # Remove last element from messages history\n if messages.length > @history_length\n messages.shift\n messages.pop\n end\n end",
"def add_msg(msg, type = nil)\n ##### local message event\n puts msg\n $stdout.flush\n end",
"def add_message(message,opts={})\n # Append the message to @messages\n (@messages ||= []) << message\n end",
"def add_reminder; end",
"def add_message(story)\n lua_script = %{if not redis.call('ZSCORE', KEYS[2], ARGV[1]) then local rank = redis.call('INCR', KEYS[1]); return redis.call('ZADD', KEYS[2], rank, ARGV[1]) end}\n redis.eval lua_script, {keys: [rank.key, message_ids.key], argv: [story.id]}\n end",
"def add_reply\n \n #find the parent item with ID.\n \n @parent_item = params[:item_type].classify.constantize.find(params[:id])\n \n @reply = Comment.create(params[:comment].merge(:user => @current_user, \n :state => DEFAULT_COMMENT_STATE, \n :commentable_id => params[:id],\n :commentable_type => params[:item_type].classify)) \n @reply.save\n \n if @reply.state == 'validated'\n flash[:error] = \"\"\n flash[:notice] = I18n.t('comment.add_comment.ajax_message_comment_published')\n #else we just send an error message explaining that comment is not validated.\n else\n @error = I18n.t('comment.add_comment.ajax_message_comment_submited')\n end\n \n respond_to do |format|\n \t format.js {render :layout => false}\n \tend\n\tend",
"def addMsg(msg)\r\n puts \"addMsg: #{msg}\" if $DEBUG\r\n\r\n if (inIfMsgs?)\r\n @curIfMsgs << msg\r\n elsif (inElseMsgs?)\r\n @curElseMsgs << msg\r\n end\r\n end",
"def handle_message(request, message)\n #\n end",
"def remove_all_message_reactions(data); end",
"def enqueue_message(message); end",
"def add_message\n\t\tresponse.headers['Content-Type'] = 'text/javascript' # Tells Rails/Redis that content is JavaScript\n\t\troom = current_user.room\n\t\tmessage = params[:message]\n\t\t# -- Add new message to chatroom ---\n\t\t$redis.publish(\"add_message_#{room.id}\", {message: message, author: current_user.username}.to_json)\n\t\t# --- end ---\n\t\trender nothing: true\n\tend",
"def <<(msg)\n @changes << msg\n @block.call(msg)\n nil\n end",
"def addrecipient(msgid, recipient)\n req(\"addrecipient\", recipient, \"\", msgid, \"\")\n end",
"def get_new_messages\n get_messages_link_and_content\n end",
"def receive_msg msg\n # stub, overwrite this in your handler\n end",
"def method_added(name) # :doc:\n super\n clear_action_methods!\n end",
"def entrymsg!(msg=nil)\n msg.kind_of?(String) ? @session.chanserv.set(self.name, :entrymsg, msg) : @session.chanserv.set(self.name, :entrymsg)\n end",
"def forward_message_id=(*args); end",
"def add_to_base(msg)\n add(:base, msg)\n end",
"def process_message(message, subscriber)\n if message == 'add' || message == 'remove'\n # If the user has subscribed flip the bit\n # and let them know\n subscribed = message == 'add'\n subscriber.update subscribed: subscribed\n\n # Respond appropriately\n output = \"You are now subscribed for updates.\"\n if !subscriber.subscribed\n output = \"You have unsubscribed from notifications. Test 'add' to start receiving updates again\"\n end\n else\n # If we don't recognize the command, text back with the list of\n # available commands\n output = \"Sorry, we don't recognize that command. Available commands are: 'add' or 'remove'.\"\n end\n output\n end",
"def hook_result(messages); end",
"def handle_action\n timeline_item = find_timeline_item(self.glass_item_id)\n\n # TODO: Should we uniq these? When glass doesn't have connection, it will queue up\n # actions, so users might press the same one multiple times.\n user_actions.uniq.each do |user_action|\n type = user_action[:type] == \"CUSTOM\" ? user_action[:payload] : user_action[:type]\n json_to_return = self.reply_request_hash ? self.reply_request_hash : self.params\n timeline_item.send(\"handles_#{type.downcase}\", json_to_return)\n end if user_actions\n end",
"def append_message(mailbox, message, flags, date=nil)\n #raise ReadOnlyMailbox.new(mailbox) if @read_only\n @lock.synchronize do\n\n begin\n if(message =~ /^(From - ... ... .+?[0-9]{4}\\n)/ && date.nil?)\n timestr = $1\n message.gsub(/^#{timestr}/, '')\n timestr.chomp\n begin\n date = Time.parse(timestr)\n rescue\n date = Time.now\n end\n end\n imap.append(mailbox, message, flags, date)\n Logger.info(\"New message added to #{mailbox}\")\n rescue Object => boom\n Logger.warn(\"Failed to transer message to #{mailbox}: #{boom}\")\n end\n end\n end",
"def receive\n begin\n message = save_message\n rescue => err\n render :text => err.message, :status => 400\n return\n end\n \n begin\n message.process! params\n rescue => err\n message.reply = err.message\n ensure\n if (message.reply != \"Invalid command\")\n collection_id = get_collection_id(params[:body])\n if collection_id and collection_id >0\n message[:collection_id] = collection_id\n end\n end\n message.save\n render :text => message.reply, :content_type => \"text/plain\"\n end\n end",
"def _add_method\n :\"_add_#{singularize(self[:name])}\"\n end",
"def custom_action\n :new_note\n end",
"def handle_insert action, result; end",
"def func_add(sender, dest, args)\r\n\t\tif args.size() >= 1\r\n\t\t\tuser= sender.nick\r\n\t\t\tmatchid= args[0].to_i()\r\n\t\t\tres= @db.query(\"SELECT * FROM `users` WHERE account='#{sender.account_name}'\")\r\n\t\t\tif res.num_rows() > 0\r\n\t\t\t\tu= res.fetch_hash()\r\n\t\t\t\tuserid= u['id'].to_i()\r\n\t\t\t\terr= false\r\n\r\n\t\t\t\t# user don' want to add himself\r\n\t\t\t\t# !add <match_id> <user>\r\n\t\t\t\tif (u['level'].to_i() <= 1) and (args.size() == 2)\r\n\t\t\t\t\ttarg_account= args[1].to_s()\r\n\r\n\t\t\t\t\tres2= @db.query(\"SELECT * FROM `users` WHERE account=\\\"#{targ_account}\\\"\")\r\n\t\t\t\t\tif res2.num_rows() > 0\r\n\t\t\t\t\t\tt= res2.fetch_hash()\r\n\t\t\t\t\t\tuserid= t['id'].to_i()\r\n\t\t\t\t\t\tuser= targ_account\r\n\t\t\t\t\t# user not found, maybe his current nick was given instead of his account\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\ttarg= getUserObj(targ_account)\r\n\t\t\t\t\t\tif targ != nil\r\n\t\t\t\t\t\t\tres3= @db.query(\"SELECT * FROM `users` WHERE account=\\\"#{targ.account_name}\\\"\")\r\n\t\t\t\t\t\t\tif res3.num_rows() > 0\r\n\t\t\t\t\t\t\t\tt= res3.fetch_hash()\r\n\t\t\t\t\t\t\t\tuserid= t['id'].to_i()\r\n\t\t\t\t\t\t\t\tuser= targ.nick\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\terr= true\r\n\t\t\t\t\t\t\tend\r\n\t\t\t\t\t\t\tres3.free()\r\n\t\t\t\t\t\tend\r\n\t\t\t\t\tend\r\n\t\t\t\t\tres2.free()\r\n\t\t\t\t\tsender.notice(\"unknow user: #{targ_account}\") if err\r\n\t\t\t\tend\r\n\r\n\t\t\t\tif !err\r\n\t\t\t\t\t# check if match exists\r\n\t\t\t\t\tif matchid == 0\r\n\t\t\t\t\t\tres2= @db.query(\"SELECT * FROM `matchs` WHERE Date LIKE CONCAT(CURDATE(),'%%')\");\r\n\t\r\n\t\t\t\t\t\t# if no match found, create one\r\n\t\t\t\t\t\tif res2.num_rows() == 0\r\n\t\t\t\t\t\t\t@db.query(\"INSERT INTO matchs(Adversaires,Type,Type_Comment,Date,Etat,Maps,Server,Comments) VALUES('?','m','pcw',CONCAT(CURDATE(), ' 21:00:00'),'c','?/?','','')\");\r\n\t\t\t\t\t\t\tres2= @db.query(\"SELECT MAX(id) FROM matchs\");\r\n\t\t\t\t\t\t\t# mysql_get_field(res, 0, \"MAX(id)\", num);\r\n\t\t\t\t\t\t\tm= res2.fetch_hash()\r\n\t\t\t\t\t\t\tmatchid= m['MAX(id)']\r\n\t\t\t\t\t\tend\r\n\t\t\t\t\tend\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tres2= @db.query(\"SELECT * FROM matchs WHERE id=\\\"#{matchid}\\\" AND Etat='c'\")\r\n\t\t\t\t\tif res2.num_rows() > 0\r\n\t\t\t\t\t\tm= res2.fetch_hash()\r\n\t\t\t\t\t\t# check if user is not already registered\r\n\t\t\t\t\t\tres3= @db.query(\"SELECT * FROM link WHERE link.user='#{userid}' AND link.match='#{matchid}'\")\r\n\t\t\t\t\t\tif res3.num_rows() > 0\r\n\t\t\t\t\t\t\tsender.notice(\"#{user} already registered in match #{matchid} vs #{m['Adversaires']}\")\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t@db.query(\"INSERT INTO link(link.user,link.match) VALUES('#{userid}','#{matchid}')\")\r\n\t\t\t\t\t\t\tsender.notice(\"'#{user}' added to match #{matchid} vs #{m['Adversaires']}\")\r\n\t\t\t\t\t\t\tupdateTopic()\r\n\t\t\t\t\t\tend\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tsender.notice(\"unknow match id: #{matchid}\")\r\n\t\t\t\t\tend\r\n\t\t\t\t\tres2.free()\r\n\t\t\t\tend\r\n\r\n\t\t\telse\r\n\t\t\t\tsender.notice(\"no account in db, tell bot owner\")\r\n\t\t\tend\r\n\t\t\tres.free()\r\n\t\telse\r\n\r\n\t\tend\r\n\tend",
"def dispatch(msg)\n case msg.command\n when LINK_ESTABLISHING\n ret=on_link_establishing(msg)\n when LINK_ESTABLISHED\n ret=on_link_established(msg)\n when LINK_FAILED\n ret=on_link_failed(msg)\n when LINK_CLOSING\n ret=on_link_closing(msg)\n when LINK_CLOSED\n ret=on_link_closed(msg)\n when RECV_MESSAGE\n ret=on_recv_message(msg)\n when RECV_MESSAGE_BROKEN\n ret=on_recv_message_broken(msg)\n when RECV_MESSAGE_KILL\n ret=on_recv_message_kill(msg)\n when RECV_MESSAGE_PING\n ret=on_recv_message_ping(msg)\n when RECV_MESSAGE_PONG\n ret=on_recv_message_pong(msg)\n when RECV_MESSAGE_ERROR\n ret=on_recv_message_error(msg)\n when RECV_MESSAGE_NOTICE\n ret=on_recv_message_notice(msg)\n when RECV_RPL_INIT\n ret=on_recv_rpl_init(msg)\n when RECV_RPL_TRACELINK\n ret=on_recv_rpl_tracelink(msg)\n when RECV_RPL_TRACECONNECTING\n ret=on_recv_rpl_traceconnecting(msg)\n when RECV_RPL_TRACEHANDSHAKE\n ret=on_recv_rpl_tracehandshake(msg)\n when RECV_RPL_TRACEUNKNOWN\n ret=on_recv_rpl_traceunknown(msg)\n when RECV_RPL_TRACEOPERATOR\n ret=on_recv_rpl_traceoperator(msg)\n when RECV_RPL_TRACEUSER\n ret=on_recv_rpl_traceuser(msg)\n when RECV_RPL_TRACESERVER\n ret=on_recv_rpl_traceserver(msg)\n when RECV_RPL_TRACENEWTYPE\n ret=on_recv_rpl_tracenewtype(msg)\n when RECV_RPL_STATSLINKINF\n ret=on_recv_rpl_statslinkinf(msg)\n when RECV_RPL_STATSCOMMANDS\n ret=on_recv_rpl_statscommands(msg)\n when RECV_RPL_STATSCLINE\n ret=on_recv_rpl_statscline(msg)\n when RECV_RPL_STATSNLINE\n ret=on_recv_rpl_statsnline(msg)\n when RECV_RPL_STATSILINE\n ret=on_recv_rpl_statsiline(msg)\n when RECV_RPL_STATSKLINE\n ret=on_recv_rpl_statskline(msg)\n when RECV_RPL_STATSYLINE\n ret=on_recv_rpl_statsyline(msg)\n when RECV_RPL_ENDOFSTATS\n ret=on_recv_rpl_endofstats(msg)\n when RECV_RPL_UMODEIS\n ret=on_recv_rpl_umodeis(msg)\n when RECV_RPL_STATSLLINE\n ret=on_recv_rpl_statslline(msg)\n when RECV_RPL_STATSUPTIME\n ret=on_recv_rpl_statsuptime(msg)\n when RECV_RPL_STATSOLINE\n ret=on_recv_rpl_statsoline(msg)\n when RECV_RPL_STATSHLINE\n ret=on_recv_rpl_statshline(msg)\n when RECV_RPL_LUSERCLIENT\n ret=on_recv_rpl_luserclient(msg)\n when RECV_RPL_LUSEROP\n ret=on_recv_rpl_luserop(msg)\n when RECV_RPL_LUSERUNKNOWN\n ret=on_recv_rpl_luserunknown(msg)\n when RECV_RPL_LUSERCHANNELS\n ret=on_recv_rpl_luserchannels(msg)\n when RECV_RPL_LUSERME\n ret=on_recv_rpl_luserme(msg)\n when RECV_RPL_ADMINME\n ret=on_recv_rpl_adminme(msg)\n when RECV_RPL_ADMINLOC1\n ret=on_recv_rpl_adminloc1(msg)\n when RECV_RPL_ADMINLOC2\n ret=on_recv_rpl_adminloc2(msg)\n when RECV_RPL_ADMINEMAIL\n ret=on_recv_rpl_adminemail(msg)\n when RECV_RPL_TRACELOG\n ret=on_recv_rpl_tracelog(msg)\n when RECV_RPL_NONE\n ret=on_recv_rpl_none(msg)\n when RECV_RPL_AWAY\n ret=on_recv_rpl_away(msg)\n when RECV_RPL_USERHOST\n ret=on_recv_rpl_userhost(msg)\n when RECV_RPL_ISON\n ret=on_recv_rpl_ison(msg)\n when RECV_RPL_UNAWAY\n ret=on_recv_rpl_unaway(msg)\n when RECV_RPL_NOWAWAY\n ret=on_recv_rpl_nowaway(msg)\n when RECV_RPL_WHOISUSER\n ret=on_recv_rpl_whoisuser(msg)\n when RECV_RPL_WHOISSERVER\n ret=on_recv_rpl_whoisserver(msg)\n when RECV_RPL_WHOISOPERATOR\n ret=on_recv_rpl_whoisoperator(msg)\n when RECV_RPL_WHOWASUSER\n ret=on_recv_rpl_whowasuser(msg)\n when RECV_RPL_ENDOFWHO\n ret=on_recv_rpl_endofwho(msg)\n when RECV_RPL_WHOISIDLE\n ret=on_recv_rpl_whoisidle(msg)\n when RECV_RPL_ENDOFWHOIS\n ret=on_recv_rpl_endofwhois(msg)\n when RECV_RPL_WHOISCHANNELS\n ret=on_recv_rpl_whoischannels(msg)\n when RECV_RPL_LISTSTART\n ret=on_recv_rpl_liststart(msg)\n when RECV_RPL_LIST\n ret=on_recv_rpl_list(msg)\n when RECV_RPL_LISTEND\n ret=on_recv_rpl_listend(msg)\n when RECV_RPL_CHANNELMODEIS\n ret=on_recv_rpl_channelmodeis(msg)\n when RECV_RPL_NOTOPIC\n ret=on_recv_rpl_notopic(msg)\n when RECV_RPL_TOPIC\n ret=on_recv_rpl_topic(msg)\n when RECV_RPL_INVITING\n ret=on_recv_rpl_inviting(msg)\n when RECV_RPL_SUMMONING\n ret=on_recv_rpl_summoning(msg)\n when RECV_RPL_VERSION\n ret=on_recv_rpl_version(msg)\n when RECV_RPL_WHOREPLY\n ret=on_recv_rpl_whoreply(msg)\n when RECV_RPL_NAMREPLY\n ret=on_recv_rpl_namreply(msg)\n when RECV_RPL_LINKS\n ret=on_recv_rpl_links(msg)\n when RECV_RPL_ENDOFLINKS\n ret=on_recv_rpl_endoflinks(msg)\n when RECV_RPL_ENDOFNAME\n ret=on_recv_rpl_endofname(msg)\n when RECV_RPL_BANLIST\n ret=on_recv_rpl_banlist(msg)\n when RECV_RPL_ENDOFBANLIST\n ret=on_recv_rpl_endofbanlist(msg)\n when RECV_RPL_ENDOFWHOWAS\n ret=on_recv_rpl_endofwhowas(msg)\n when RECV_RPL_INFO\n ret=on_recv_rpl_info(msg)\n when RECV_RPL_MOTD\n ret=on_recv_rpl_motd(msg)\n when RECV_RPL_ENDOFINFO\n ret=on_recv_rpl_endofinfo(msg)\n when RECV_RPL_MOTDSTART\n ret=on_recv_rpl_motdstart(msg)\n when RECV_RPL_ENDOFMOTD\n ret=on_recv_rpl_endofmotd(msg)\n when RECV_RPL_YOUREOPER\n ret=on_recv_rpl_youreoper(msg)\n when RECV_RPL_REHASHING\n ret=on_recv_rpl_rehashing(msg)\n when RECV_RPL_TIME\n ret=on_recv_rpl_time(msg)\n when RECV_RPL_USERS\n ret=on_recv_rpl_users(msg)\n when RECV_RPL_ENDOFUSERS\n ret=on_recv_rpl_endofusers(msg)\n when RECV_RPL_NOUSERS\n ret=on_recv_rpl_nousers(msg)\n when RECV_ERR_NOSUCHNICK\n ret=on_recv_err_nosuchnick(msg)\n when RECV_ERR_NOSUCHSERVE\n ret=on_recv_err_nosuchserve(msg)\n when RECV_ERR_NOSUCHCHANNEL\n ret=on_recv_err_nosuchchannel(msg)\n when RECV_ERR_CANNOTSENDTOCHAN\n ret=on_recv_err_cannotsendtochan(msg)\n when RECV_ERR_TOOMANYCHANNELS\n ret=on_recv_err_toomanychannels(msg)\n when RECV_ERR_WASNOSUCHNICK\n ret=on_recv_err_wasnosuchnick(msg)\n when RECV_ERR_TOOMANYTARGETS\n ret=on_recv_err_toomanytargets(msg)\n when RECV_ERR_NOORIGIN\n ret=on_recv_err_noorigin(msg)\n when RECV_ERR_NORECIPIENT\n ret=on_recv_err_norecipient(msg)\n when RECV_ERR_NOTEXTTOSEND\n ret=on_recv_err_notexttosend(msg)\n when RECV_ERR_NOTOPLEVE\n ret=on_recv_err_notopleve(msg)\n when RECV_ERR_WILDTOPLEVEL\n ret=on_recv_err_wildtoplevel(msg)\n when RECV_ERR_UNKNOWNCOMMAND\n ret=on_recv_err_unknowncommand(msg)\n when RECV_ERR_NOMOTD\n ret=on_recv_err_nomotd(msg)\n when RECV_ERR_NOADMININFO\n ret=on_recv_err_noadmininfo(msg)\n when RECV_ERR_FILEERROR\n ret=on_recv_err_fileerror(msg)\n when RECV_ERR_NONICKNAMEGIVEN\n ret=on_recv_err_nonicknamegiven(msg)\n when RECV_ERR_ERRONEUSNICKNAME\n ret=on_recv_err_erroneusnickname(msg)\n when RECV_ERR_NICKNAMEINUSE\n ret=on_recv_err_nicknameinuse(msg)\n when RECV_ERR_NICKCOLLISION\n ret=on_recv_err_nickcollision(msg)\n when RECV_ERR_USERNOTINCHANNEL\n ret=on_recv_err_usernotinchannel(msg)\n when RECV_ERR_NOTONCHANNE\n ret=on_recv_err_notonchanne(msg)\n when RECV_ERR_USERONCHANNEL\n ret=on_recv_err_useronchannel(msg)\n when RECV_ERR_NOLOGIN\n ret=on_recv_err_nologin(msg)\n when RECV_ERR_SUMMONDISABLED\n ret=on_recv_err_summondisabled(msg)\n when RECV_ERR_USERSDISABLED\n ret=on_recv_err_usersdisabled(msg)\n when RECV_ERR_NOTREGISTERED\n ret=on_recv_err_notregistered(msg)\n when RECV_ERR_NEEDMOREPARAM\n ret=on_recv_err_needmoreparam(msg)\n when RECV_ERR_ALREADYREGISTRE\n ret=on_recv_err_alreadyregistre(msg)\n when RECV_ERR_NOPERMFORHOST\n ret=on_recv_err_nopermforhost(msg)\n when RECV_ERR_PASSWDMISMATCH\n ret=on_recv_err_passwdmismatch(msg)\n when RECV_ERR_YOUREBANNEDCREEP\n ret=on_recv_err_yourebannedcreep(msg)\n when RECV_ERR_KEYSET\n ret=on_recv_err_keyset(msg)\n when RECV_ERR_CHANNELISFULL\n ret=on_recv_err_channelisfull(msg)\n when RECV_ERR_UNKNOWNMODE\n ret=on_recv_err_unknownmode(msg)\n when RECV_ERR_INVITEONLYCHAN\n ret=on_recv_err_inviteonlychan(msg)\n when RECV_ERR_BANNEDFROMCHAN\n ret=on_recv_err_bannedfromchan(msg)\n when RECV_ERR_BADCHANNELKEY\n ret=on_recv_err_badchannelkey(msg)\n when RECV_ERR_NOPRIVILEGES\n ret=on_recv_err_noprivileges(msg)\n when RECV_ERR_CHANOPRIVSNEEDED\n ret=on_recv_err_chanoprivsneeded(msg)\n when RECV_ERR_CANTKILLSERVER\n ret=on_recv_err_cantkillserver(msg)\n when RECV_ERR_NOOPERHOST\n ret=on_recv_err_nooperhost(msg)\n when RECV_ERR_UMODEUNKNOWNFLAG\n ret=on_recv_err_umodeunknownflag(msg)\n when RECV_ERR_USERSDONTMATCH\n ret=on_recv_err_usersdontmatch(msg)\n when RECV_CMND_UNKNOWN\n ret=on_recv_cmnd_unknown(msg)\n when RECV_CMND_PASS\n ret=on_recv_cmnd_pass(msg)\n when RECV_CMND_NICK\n ret=on_recv_cmnd_nick(msg)\n when RECV_CMND_USER\n ret=on_recv_cmnd_user(msg)\n when RECV_CMND_SERVER\n ret=on_recv_cmnd_server(msg)\n when RECV_CMND_OPER\n ret=on_recv_cmnd_oper(msg)\n when RECV_CMND_QUIT\n ret=on_recv_cmnd_quit(msg)\n when RECV_CMND_SQUIT\n ret=on_recv_cmnd_squit(msg)\n when RECV_CMND_JOIN\n ret=on_recv_cmnd_join(msg)\n when RECV_CMND_PART\n ret=on_recv_cmnd_part(msg)\n when RECV_CMND_MODE\n ret=on_recv_cmnd_mode(msg)\n when RECV_CMND_TOPIC\n ret=on_recv_cmnd_topic(msg)\n when RECV_CMND_NAMES\n ret=on_recv_cmnd_names(msg)\n when RECV_CMND_LIST\n ret=on_recv_cmnd_list(msg)\n when RECV_CMND_INVITE\n ret=on_recv_cmnd_invite(msg)\n when RECV_CMND_KICK\n ret=on_recv_cmnd_kick(msg)\n when RECV_CMND_VERSION\n ret=on_recv_cmnd_version(msg)\n when RECV_CMND_STATAS\n ret=on_recv_cmnd_statas(msg)\n when RECV_CMND_LINK\n ret=on_recv_cmnd_link(msg)\n when RECV_CMND_TIME\n ret=on_recv_cmnd_time(msg)\n when RECV_CMND_CONNECT\n ret=on_recv_cmnd_connect(msg)\n when RECV_CMND_TRACE\n ret=on_recv_cmnd_trace(msg)\n when RECV_CMND_ADMIN\n ret=on_recv_cmnd_admin(msg)\n when RECV_CMND_INFO\n ret=on_recv_cmnd_info(msg)\n when RECV_CMND_PRIVMSG\n ret=on_recv_cmnd_privmsg(msg)\n when RECV_CMND_NOTICE\n ret=on_recv_cmnd_notice(msg)\n when RECV_CMND_WHO\n ret=on_recv_cmnd_who(msg)\n when RECV_CMND_WHOIS\n ret=on_recv_cmnd_whois(msg)\n when RECV_CMND_WHOWAS\n ret=on_recv_cmnd_whowas(msg)\n when RECV_CMND_KILL\n ret=on_recv_cmnd_kill(msg)\n when RECV_CMND_PING\n ret=on_recv_cmnd_ping(msg)\n when RECV_CMND_PONG\n ret=on_recv_cmnd_pong(msg)\n when RECV_CMND_ERROR\n ret=on_recv_cmnd_error(msg)\n when RECV_CMND_AWAY\n ret=on_recv_cmnd_away(msg)\n when RECV_CMND_REHASH\n ret=on_recv_cmnd_rehash(msg)\n when RECV_CMND_RESTART\n ret=on_recv_cmnd_restart(msg)\n when RECV_CMND_SUMMON\n ret=on_recv_cmnd_summon(msg)\n when RECV_CMND_USERS\n ret=on_recv_cmnd_users(msg)\n when RECV_CMND_WALLOPS\n ret=on_recv_cmnd_wallops(msg)\n when RECV_CMND_USERHOST\n ret=on_recv_cmnd_userhost(msg)\n when RECV_CMND_ISON\n ret=on_recv_cmnd_ison(msg)\n when RECV_CMND_CTCP_QUERY\n ret=on_recv_cmnd_ctcp_query(msg)\n when RECV_CMND_CTCP_QUERY_UNKNOWN\n ret=on_recv_cmnd_ctcp_query_unknown(msg)\n when RECV_CMND_CTCP_QUERY_PING\n ret=on_recv_cmnd_ctcp_query_ping(msg)\n when RECV_CMND_CTCP_QUERY_ECHO\n ret=on_recv_cmnd_ctcp_query_echo(msg)\n when RECV_CMND_CTCP_QUERY_TIME\n ret=on_recv_cmnd_ctcp_query_time(msg)\n when RECV_CMND_CTCP_QUERY_VERSION\n ret=on_recv_cmnd_ctcp_query_version(msg)\n when RECV_CMND_CTCP_QUERY_CLIENTINFO\n ret=on_recv_cmnd_ctcp_query_clientinfo(msg)\n when RECV_CMND_CTCP_QUERY_USERINFO\n ret=on_recv_cmnd_ctcp_query_userinfo(msg)\n when RECV_CMND_CTCP_QUERY_ACTION\n ret=on_recv_cmnd_ctcp_query_action(msg)\n when RECV_CMND_CTCP_QUERY_DCC\n ret=on_recv_cmnd_ctcp_query_dcc(msg)\n when RECV_CMND_CTCP_ANSWER\n ret=on_recv_cmnd_ctcp_answer(msg)\n when RECV_CMND_CTCP_ANSWER_UNKNOWN\n ret=on_recv_cmnd_ctcp_answer_unknown(msg)\n when RECV_CMND_CTCP_ANSWER_PING\n ret=on_recv_cmnd_ctcp_answer_ping(msg)\n when RECV_CMND_CTCP_ANSWER_ECHO\n ret=on_recv_cmnd_ctcp_answer_echo(msg)\n when RECV_CMND_CTCP_ANSWER_TIME\n ret=on_recv_cmnd_ctcp_answer_time(msg)\n when RECV_CMND_CTCP_ANSWER_VERSION\n ret=on_recv_cmnd_ctcp_answer_version(msg)\n when RECV_CMND_CTCP_ANSWER_CLIENTINFO\n ret=on_recv_cmnd_ctcp_answer_clientinfo(msg)\n when RECV_CMND_CTCP_ANSWER_USERINFO\n ret=on_recv_cmnd_ctcp_answer_userinfo(msg)\n when RECV_CMND_CTCP_ANSWER_ACTION\n ret=on_recv_cmnd_ctcp_answer_action(msg)\n when RECV_CMND_CTCP_ANSWER_DCC\n ret=on_recv_cmnd_ctcp_answer_dcc(msg)\n else\n ret=default_action(msg)\n end\n\n return ret\n end",
"def redmine_add_time_entry(m, params, certificate)\n begin\n \t#Initialisation des paramètres\n \tif (params[:message] && !params[:message].empty?)\n \t\tmessageEntry = params[:message].to_s.strip\n \telse\n \t\tmessageEntry = \"#{@redmine_l_defaultcommentmessage}\"\n \tend \n\t\t## Save a new time entry\n\t\t# Configuration of the connector\n\t\t::TimeEntry.site = @redmine_rapid_url\n\t\t::TimeEntry.user = certificate[:username]\n\t\t::TimeEntry.password = certificate[:password]\n\t\t# Saving the new timelog\n\t\tnewtimeentry = TimeEntry.new(:issue_id => params[:task], :comments => messageEntry, :activity_id =>@redmine_dev_activity, :hours => params[:spent_time])\n\t\tif ! newtimeentry.save\n \t\treturn false\n \telse \n \t\treturn true\n \tend\n rescue Exception => e\n m.reply \"error: #{e.message}\"\n end\n end",
"def update\n @message = Message.new(:body => params[:message])\n if Messenger.add_reply(current_user, params[:id], @message)\n return_message(200, :ok)\n else\n return_message(200, :ok, {:err => {:messages => [106]}})\n end\n end",
"def add_action(action)\n if !@actions.include?(action)\n @actions << action\n @actions.flatten!\n end\n end",
"def update_new_receiver\n \n @receiver_added = Receiver.last\n $receivers << @receiver_added\n respond_to do |format|\n format.html\n format.json {render json: $receivers}\n end\n end",
"def add(file); @actions << Action::AddAction.new(file); end",
"def add entry\n existing_entry = @entries[entry.msgid]\n if existing_entry\n entry = existing_entry.merge(entry)\n end\n @entries[entry.msgid] = entry\n end",
"def message(message) end",
"def messaging\n end",
"def add (level, message, options={})\n configuration = {\n :flash => true,\n :name => nil,\n :remember => false,\n :seen_in => nil,\n :seen_since => nil,\n }.update(options)\n\n # We'll need a valid name for a few different operations\n configuration[:name] = message.object_id if configuration[:name].nil?\n\n # force message names to be strings\n configuration[:name] = configuration[:name].to_s\n\n # Force :flash to false if :remember is true\n configuration[:flash] = false if configuration[:remember]\n\n # don't add if one of the see options was given, and it was already seen\n return if configuration[:seen_in] and seen?(configuration[:name], :in => configuration[:seen_in])\n return if configuration[:seen_since] and seen?(configuration[:name], :since => configuration[:seen_since])\n\n # If it already exists, delete the old one first\n destroy(configuration[:name], false)\n\n # Wow, we made it this far, I guess we better add the message\n message = OpenStruct.new({\n :name => configuration[:name],\n :level => level,\n :message => message,\n :options => configuration,\n })\n\n (@messages[level] ||= []) << message\n @by_id[configuration[:name]] = [message, level]\n end",
"def record_message\n @response.say('You can leave a message')\n @response.record(action: '/call/hook/message')\n\n @call.update(final_action: 'left_message')\n end",
"def process_message(message)\n end"
] | [
"0.5948839",
"0.5830207",
"0.5829463",
"0.5804491",
"0.5773326",
"0.5757889",
"0.56807",
"0.56807",
"0.56807",
"0.5650981",
"0.5587086",
"0.558463",
"0.554084",
"0.55269843",
"0.53942376",
"0.5393272",
"0.5343823",
"0.5343823",
"0.5341771",
"0.53301865",
"0.53294134",
"0.5303699",
"0.528736",
"0.5277618",
"0.52506167",
"0.52203643",
"0.5185608",
"0.51753503",
"0.51364714",
"0.5127028",
"0.5114035",
"0.5112436",
"0.5110328",
"0.5110328",
"0.5110161",
"0.51053524",
"0.51015455",
"0.5097968",
"0.5093218",
"0.50765896",
"0.5070558",
"0.5064284",
"0.5059473",
"0.50574917",
"0.5049255",
"0.5047305",
"0.50470823",
"0.5043696",
"0.504357",
"0.5034311",
"0.50296056",
"0.5028898",
"0.50194144",
"0.50137615",
"0.50137615",
"0.5002471",
"0.5002165",
"0.4996198",
"0.4995481",
"0.49935344",
"0.49932742",
"0.49882808",
"0.4980443",
"0.49785134",
"0.49756032",
"0.4973102",
"0.49723983",
"0.49640667",
"0.49530965",
"0.495309",
"0.49490142",
"0.4930468",
"0.49218205",
"0.49117014",
"0.49080342",
"0.4907868",
"0.48978585",
"0.4889574",
"0.4889408",
"0.48878452",
"0.48865223",
"0.48843795",
"0.4883108",
"0.48827416",
"0.4873466",
"0.48683503",
"0.48651814",
"0.48614472",
"0.48556364",
"0.48493207",
"0.48398823",
"0.4838083",
"0.48372325",
"0.4835532",
"0.48312035",
"0.48309937",
"0.48309875",
"0.48277286",
"0.48241425",
"0.48229083"
] | 0.7244814 | 0 |
Internal handler for MESSAGE_REACTION_REMOVE | def remove_message_reaction(data); end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_message(name)\n\t\tend",
"def remove_all_message_reactions(data); end",
"def delete_message(data); end",
"def delete_message(data); end",
"def supprimerMessage(indice)\r\n\t\t@lstMessages.delete(indice) if @lstMessages.has_key?(indice)\r\n\tend",
"def rm(msgid)\n req(\"rm\", \"\", \"\", msgid, \"\")\n end",
"def remove message\n @events.delete message.sequence\n end",
"def removeAction _obj, _args\n \"_obj removeAction _args;\" \n end",
"def remove!; end",
"def remove; end",
"def remove; end",
"def remove; end",
"def remove; end",
"def remove_notification_message parrent, user_id\n #ap 'NotificationModule#remove_notification_message'\n #ap user_id\n #ap parrent.id\n #ap parrent.class.name\n if notification_message = NotificationMessage.find_by(\n user_id: user_id,\n asset_id: parrent.id,\n asset_type: parrent.class.name\n )\n notification_message.destroy\n end\n end",
"def delete_msg()\n MsgUtil.delete_msg(params[:ch])\n end",
"def remover_item\n # Remove um item do final do buffer\n BUFFER.pop\n end",
"def on_message(pre, message)\n\n m_wfid = message['wfid'] || (message['fei']['wfid'] rescue nil)\n m_error = message['error']\n\n m_action = message['action']\n m_action = \"pre_#{m_action}\" if pre\n\n msg = m_action == 'error_intercepted' ? message['msg'] : message\n\n ids_to_remove = []\n\n trackers.each do |tracker_id, tracker|\n\n # filter msgs\n\n t_wfid = tracker['wfid']\n t_action = tracker['action']\n\n next if t_wfid && t_wfid != m_wfid\n next if t_action && t_action != m_action\n\n next unless does_match?(message, tracker['conditions'])\n\n if tracker_id == 'on_error' || tracker_id == 'on_terminate'\n\n fs = msg['workitem']['fields']\n\n next if m_action == 'error_intercepted' && fs['__error__']\n next if m_action == 'terminated' && (fs['__error__'] || fs['__terminate__'])\n end\n\n # remove the message post-trigger?\n\n ids_to_remove << tracker_id if tracker['msg'].delete('_auto_remove')\n\n # OK, have to pull the trigger (or alter the message) then\n\n if pre && tracker['msg']['_alter']\n alter(m_wfid, m_error, m_action, msg, tracker)\n else\n trigger(m_wfid, m_error, m_action, msg, tracker)\n end\n end\n\n remove(ids_to_remove, nil)\n end",
"def remove_command\n return if !has_manage_messages_permission?\n command.event.message.delete\n end",
"def sub_remove _value=0\n send_cmd(\"sub_remove #{_value}\")\n end",
"def destroy\n # delete a specific message\n end",
"def remove(entry); end",
"def del_msg_listener( msgName, object )\n @msgNames[msgName].delete object if defined? @msgNames\n end",
"def removeMPEventHandler _obj, _args\n \"_obj removeMPEventHandler _args;\" \n end",
"def destroy\n get_message().delete\n end",
"def del_message # for user it is delte but in db it change status to false\t\n\t\tmid = Base64.decode64(params[:id])\t\t\t \n\t\ttype = params[:type]\t\t\t \n\t\tmessage = Message.find(mid)\t\n\t\tif params[:type]=='self' \n\t\t\tmessage.update_attributes(status: false)\n\t\telse\n\t\t\tmessage.update_attributes(recipient_status: false)\n\t\tend\n\t\t\t\n\t if message \n\t\t render :json => mid and return \n\t else\n\t\t render :json => {errors: \"Please Try Again!\"} and return\n\t end\t\n\tend",
"def remove\n __flag__ :remove\n end",
"def destroy\n # delete a specific message\n end",
"def remove_item\n\n end",
"def remove_notification\n \n @ac = AttachContact.find(params[:user_id])\n RecentActivity.create(:transaction_id => @transaction.id, \n :user_id => current_user.id, \n :message => \"Removed Contact: #{@ac.user.fullname} as #{@ac.role.name if @ac.role}\")\n \n render :nothing => true\n end",
"def remove!\n self.update_attribute(:status, REMOVED)\n end",
"def remove!\n self.update_attribute(:status, REMOVED)\n end",
"def unreceive message, headers={}\n end",
"def removed; status[:removed]; end",
"def func_remove(sender, dest, args)\r\n\t\tif args.size() >= 1\r\n\t\t\tuser= sender.nick\r\n\t\t\tmatchid= args[0].to_i()\r\n\t\t\tres= @db.query(\"SELECT * FROM `users` WHERE account='#{sender.account_name}'\")\r\n\t\t\tif res.num_rows() > 0\r\n\t\t\t\tu= res.fetch_hash()\r\n\t\t\t\tuserid= u['id'].to_i()\r\n\t\t\t\terr= false\r\n\r\n\t\t\t\t# user don' want to remove himself\r\n\t\t\t\t# !remove <match_id> <user>\r\n\t\t\t\tif (u['level'].to_i() <= 1) and (args.size() == 2)\r\n\t\t\t\t\ttarg_account= args[1].to_s()\r\n\r\n\t\t\t\t\tres2= @db.query(\"SELECT * FROM `users` WHERE account=\\\"#{targ_account}\\\"\")\r\n\t\t\t\t\tif res2.num_rows() > 0\r\n\t\t\t\t\t\tt= res2.fetch_hash()\r\n\t\t\t\t\t\tuserid= t['id'].to_i()\r\n\t\t\t\t\t\tuser= targ_account\r\n\t\t\t\t\t# user not found, maybe his current nick was given instead of his account\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\ttarg= getUserObj(targ_account)\r\n\t\t\t\t\t\tif targ != nil\r\n\t\t\t\t\t\t\tres3= @db.query(\"SELECT * FROM `users` WHERE account=\\\"#{targ.account_name}\\\"\")\r\n\t\t\t\t\t\t\tif res3.num_rows() > 0\r\n\t\t\t\t\t\t\t\tt= res3.fetch_hash()\r\n\t\t\t\t\t\t\t\tuserid= t['id'].to_i()\r\n\t\t\t\t\t\t\t\tuser= targ.nick\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\terr= true\r\n\t\t\t\t\t\t\tend\r\n\t\t\t\t\t\t\tres3.free()\r\n\t\t\t\t\t\tend\r\n\t\t\t\t\tend\r\n\t\t\t\t\tres2.free()\r\n\t\t\t\t\tsender.notice(\"unknow user: #{targ_account}\") if err\r\n\t\t\t\tend\r\n\r\n\t\t\t\tif !err\r\n\t\t\t\t\tres2= @db.query(\"SELECT * FROM matchs WHERE id=\\\"#{matchid}\\\" AND Etat='c'\")\r\n\t\t\t\t\tif res2.num_rows() > 0\r\n\t\t\t\t\t\tm= res2.fetch_hash()\r\n\t\t\t\t\t\t@db.query(\"DELETE FROM link WHERE user='#{userid}' AND `match`='#{matchid}'\")\r\n\t\t\t\t\t\tsender.notice(\"'#{user}' removed from match #{matchid} vs #{m['Adversaires']}\")\r\n\t\t\t\t\t\tupdateTopic()\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tsender.notice(\"unknow match id: #{matchid}\")\r\n\t\t\t\t\tend\r\n\t\t\t\t\tres2.free()\r\n\t\t\t\tend\r\n\r\n\t\t\telse\r\n\t\t\t\tsender.notice(\"no account in db, tell bot owner\")\r\n\t\t\tend\r\n\t\t\tres.free()\r\n\t\telse\r\n\r\n\t\tend\r\n\tend",
"def parse_user_remove(msg_details)\n username = msg_details\n @userlist_table[username] = nil\n return username\n end",
"def destroy\n # delete a specific message\n end",
"def remove(*)\n super.tap do\n __debug_sim('USER initiates removal of existing entries.')\n end\n end",
"def remove\n recipient_list_members.destroy_all\n if message_recipients.count.zero?\n destroy\n else\n self.removed = true\n save!\n end\n end",
"def method_removed(*) end",
"def removeHandgunItem _obj, _args\n \"_obj removeHandgunItem _args;\" \n end",
"def _remove_method\n :\"_remove_#{self[:name].to_s.singularize}\"\n end",
"def remove list\n list_action list, \"remove\"\n end",
"def remove(file); @actions << Action::RemoveAction.new(file); end",
"def remove\n @ok_msg = t('other_popup_messages.correct.remove.media_element')\n if @ok\n bookmark = Bookmark.where(:user_id => current_user.id, :bookmarkable_type => 'MediaElement', :bookmarkable_id => @media_element_id).first\n if bookmark.nil?\n @ok = false\n @error = I18n.t('activerecord.errors.models.bookmark.problem_destroying_for_media_element')\n else\n bookmark.destroy\n if Bookmark.where(:user_id => current_user.id, :bookmarkable_type => 'MediaElement', :bookmarkable_id => @media_element_id).any?\n @ok = false\n @error = I18n.t('activerecord.errors.models.bookmark.problem_destroying_for_media_element')\n end\n end\n else\n @error = I18n.t('activerecord.errors.models.bookmark.problem_destroying_for_media_element')\n end\n if @destination == ButtonDestinations::FOUND_MEDIA_ELEMENT\n prepare_media_element_for_js\n render 'media_elements/reload.js'\n else\n render :json => {:ok => @ok, :msg => (@ok ? @ok_msg : @error)}\n end\n end",
"def unregister_message_handler(message)\n @messages.delete(message)\n end",
"def _remove_method\n :\"_remove_#{singularize(self[:name])}\"\n end",
"def removed; status[:removed] || []; end",
"def remove(value)\n #YOUR WORK HERE\n end",
"def remove!\n self.class.removed(item)\n end",
"def remove\n return unless confirm_command\n\n args.each do |name|\n messages = nil\n if name.start_with? \"HEROKU_POSTGRESQL_\"\n name = name.chomp(\"_URL\").freeze\n end\n action(\"Removing #{name} on #{app}\") do\n messages = addon_run { heroku.uninstall_addon(app, name, :confirm => app) }\n end\n display(messages[:attachment]) if messages[:attachment]\n display(messages[:message]) if messages[:message]\n end\n end",
"def alter(m_wfid, m_error, m_action, msg, tracker)\n\n case tracker['msg'].delete('_alter')\n when 'merge' then msg.merge!(tracker['msg'])\n #else ...\n end\n end",
"def on_remove(&block)\n @onRemoveBlock = block\n end",
"def delete\n @client.post('/api/del_msg', id: get_attribute(:name))\n end",
"def destroy\n @message = Message.find(params[:id])\n if current_user.received_messages.find(@message)\n MessageRecipient.find_by_user_id_and_message_id(current_user, @message.id).destroy\n\n else\n @message.destroy\n end\n \n\n respond_to do |format|\n format.html { redirect_to account_messages_url }\n format.xml { head :ok }\n end\n end",
"def remove(type); end",
"def remove_conv conv, user \n if user.id == conv.user_id\n return update_status(conv, user, 'status')\n elsif user.id == conv.recipient_id \n return update_status(conv, user, 'recipient_status')\n end\n false\n end",
"def clean_message(message); end",
"def handle_processed_mail(uid)\n @imap.uid_copy(uid, @imap_setting[:move_folder]) if (@imap_setting[:move_folder])\n @imap.uid_store(uid, \"+FLAGS\", [:Deleted])\n end",
"def list_remover(list_input_remover, item_name_remove)\n list_input_remover.delete(item_name_remove)\nend",
"def del_msg_name( msgName )\n @msgNames.delete msgName if defined? @msgNames\n end",
"def remove(params)\n params[:real_at] ||= AtStructure.new(params[:at])\n\n # Le text-item de référence\n unless params.key?(:titem_ref)\n params.merge!(titem_ref: params[:real_at].first_titem)\n end\n\n # Pour connaitre l'opération, pour faire la distinction, plus tard, entre\n # une pure suppression et un remplacement. Elle permet aussi d'enregistrer\n # l'opération dans l'historique operations.txt\n unless params.key?(:operation)\n params.merge!(operation: 'remove')\n end\n\n # Un débug (régler les valeurs en haut de ce module)\n if debug_replace? || debug_remove?\n log(\"-> remove(params=#{params.inspect})\")\n end\n\n if params[:operation] == 'remove'\n msg = \"Suppression de “#{params[:real_at].first_titem.content}” (index absolu #{params[:real_at].abs(:at)}, index relatif #{params[:real_at].at}).\"\n log(msg, true)\n end\n\n\n # Si c'est une vraie suppression (i.e. pas un remplacement), il faut\n # supprimer aussi l'espace après. S'il n'y a pas d'espace après, il faut\n # supprimer l'espace avant s'il existe.\n # La formule est différente en fonction du fait qu'on ait un rang ou\n # un index seul et une liste discontinue d'index.\n # ATTENTION AUSSI : l'espace supplémentaire à supprimer est peut-être\n # dans la liste des index à supprimer et dans ce cas il faut étudier\n # le mot suivant et le text-item non-mot suivant.\n #\n # Le but de cette partie est donc de produire la liste exacte des text-items\n # qui doivent être finalement supprimé.\n # Elle n'est valable que pour une suppression pure car pour un replacement,\n # il faut garder tous les éléments autour du mot ou des mots remplacés.\n at = params[:real_at]\n if params[:operation] == 'remove'\n if at.list?\n # Pour une liste, on doit faire un traitement particulier : il faut\n # vérifier les text-item après chaque \"trou\"\n liste_finale = at.list.dup\n at.titems.each_with_index do |titem, idx_in_list|\n # Les non-mots doivent être passés\n next if titem.non_mot?\n # On passe ce mot si le mot suivant appartient aussi à la liste\n next if at.list[idx_in_list + 1] == idx + 1\n # On passe ce mot si le mot précédent appartient aussi à la liste\n next if at.list[idx_in_list - 1] == idx - 1\n # On doit tester ce mot qui est \"seul\" dans la liste, c'est-à-dire\n # que la liste ne contient ni son mot juste après ni son mot\n # juste avant.\n next_index = idx + 1\n next_titem = extrait_titems[next_index]\n prev_index = idx - 1\n prev_index = nil if prev_index < 0\n prev_titem = prev_index.nil? ? nil : extrait_titems[prev_index]\n if next_titem && next_titem.space?\n # On l'ajoute à la liste des items à supprimer\n liste_finale.insert(idx_in_list + 1, next_index)\n elsif prev_titem && prev_titem.space?\n liste_finale.insert(idx_in_list, prev_index)\n end\n end #/ boucle sur la liste\n\n # Si la liste finale a changé, il faut corrigé le at\n if liste_finale != at.list\n params[:real_at] = at = AtStructure.new(liste_finale.join(VG))\n end\n\n else\n # Pour un rang et un index seul, le traitement est plus simple, il\n # suffit de voir l'index après le dernier.\n # Noter qu'on ne supprime pas les espaces ici, on modifie le rang\n # ou on transforme l'index en range, ceci afin de ne pas provoquer\n # de doubles suppressions\n next_index = at.last + 1\n prev_index = at.first - 1\n prev_index = nil if prev_index < 0\n if extrait_titems[next_index].space?\n params[:real_at] = at = AtStructure.new(\"#{at.first}-#{next_index}\")\n elsif prev_index && extrait_titems[prev_index].space?\n params[:real_at] = at = AtStructure.new(\"#{prev_index}-#{at.last}\")\n end\n end\n end\n\n # On mémorise l'opération pour pouvoir l'annuler\n if params.key?(:cancellor) # pas quand c'est une annulation\n at.titems.each do |titem|\n params[:cancellor] << {operation: :insert, index: titem.index, content: params[:content]}\n end\n end\n\n # SUPPRESSION\n # ------------\n # On procède vraiment à la suppression des mots dans le texte\n # lui-même, ainsi que dans la base de données avec une formule différente en\n # fonction du fait que c'est un rang ou une liste (note : un index unique\n # a été mis dans une liste pour simplifier les opérations)\n if at.range?\n extrait_titems.slice!(at.from, at.nombre)\n itexte.db.delete_text_items(from:at.abs(:from), for:at.nombre)\n else\n at.list.each { |idx| extrait_titems.slice!(idx) }\n itexte.db.delete_text_items(at.abs(:list))\n end\n\n # Si c'est vraiment une opération de destruction, on l'enregistre\n # en tant qu'opération et on actualise l'affichage en indiquant que\n # l'extrait a changé\n if params[:operation] == 'remove'\n itexte.operator.add_text_operation(params)\n update\n end\n\nend",
"def del_from_rules(msg)\n if file_util(rules_file).remove_line(msg[2])\n reply = \"Removed lines from #{rules_file} mathing #{msg[2].inspect}.\"\n else\n reply = \"Lines mathing #{msg[2].inspect} were not found.\"\n end\n\n send_response(reply)\n end",
"def delete(msg)\n read_write()\n uid = (msg.kind_of?(EasyIMAP::Message) ? msg.uid : msg)\n @conn.uid_store(uid, '+FLAGS', [:Deleted])\n expunge()\n end",
"def _rh_do_control_remove(result, remove)\n remove.each { |element| result.delete(element) }\n end",
"def removeMissionEventHandler _args\n \"removeMissionEventHandler _args;\" \n end",
"def run_on_removals(paths)\n end",
"def add_edit event\n # this debug is very specific. it should be removed later. We do not know about the object\n $log.debug \" UNDO GOT #{event}: #{event.type}, (#{event.text}), rej: #{@reject_update} \"\n return if @reject_update\n if @pointer < @actions.length\n $log.debug \" removing some actions since #{@pointer} < #{@actions.length} \"\n @actions.slice!(@pointer..-1)\n $log.debug \" removed actions since #{@pointer} , #{@actions.length} \"\n end\n @actions << event\n @pointer = @actions.length\n end",
"def displayRemoveEventHandler _obj, _args\n \"_obj displayRemoveEventHandler _args;\" \n end",
"def on_remove(args)\n event, ele, ele_id = args[:args][:event].to_sym, args[:args][:element].to_s, args[:args][:element_id].to_i\n \n if ele == \"sink\"\n tv = @tv_sinks\n elsif ele == \"source\"\n tv = @tv_sources\n else\n return nil\n end\n \n tv.rows_remove do |data|\n if data[:data][:id].to_i == ele_id\n true\n else\n false\n end\n end\n end",
"def messagedelete\n TDirmessage.find_by(\"dirmsg_id=?\", params[:messagedelete]).delete\n redirect_back(fallback_location: dirmsgcreate_path)\n end",
"def remove\n args.each do |name|\n messages = nil\n action(\"Removing #{name} from #{app}\") do\n messages = addon_run { heroku.uninstall_addon(app, name, :confirm => options[:confirm]) }\n end\n output messages[:attachment] if messages[:attachment]\n output messages[:message]\n end\n end",
"def removeItem _obj, _args\n \"_obj removeItem _args;\" \n end",
"def un_collect_msg(msgid)\n uri = \"cgi-bin/setstarmessage?t=ajax-setstarmessage&token=#{ @token }&lang=zh_CN\"\n params = {\n ajax: 1,\n f: 'json',\n lang: 'zh_CN',\n msgid: msgid,\n random: rand,\n token: @token,\n value: 0\n }\n headers = {\n referer: 'https://mp.weixin.qq.com/cgi-bin/message'\\\n \"?t=message/list&token=#{ @token }&count=20&day=7\"\n }\n resource = RestClient::Resource.new(@home_url, headers: headers,\n cookies: @cookies)\n res = resource[uri].post params\n JSON.parse res.to_s\n end",
"def callback_handler_remove\n rl_callback_handler_remove\n @rl_callback_handler = nil\n end",
"def destroy\n @message_reaction.destroy\n respond_to do |format|\n format.html { redirect_to message_reactions_url, notice: \"Message reaction was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def removeItemFromBackpack _obj, _args\n \"_obj removeItemFromBackpack _args;\" \n end",
"def remove_elem\n elem =eval(params[:type]).find(params[:elem])\n elem.position= 0\n case params[:type]\n when \"Activity\"\n elem.model_id = -1\n when \"Action\"\n elem.activity_id = -1\n when 'PfTask'\n elem.action_id = -1\n end\n elem.update_attributes(elem.attributes)\n redirect_to :action => 'show_subs', :parent_id =>params[:parent_id], :parent_type =>eval(params[:type]).get_parent_name\n end",
"def remove\n raise QueueUnderflow if empty?\n result = @info.shift\n changed\n notify_observers(self, :remove, result)\n result\n end",
"def remove_from_notification (n)\n logger.debug2 \"comment id #{id}. Notification id #{n.id}. notification key #{n.noti_key}\" if debug_notifications\n # only modify unread notifications\n return unless n.noti_read == 'N'\n cn = notifications.where(\"notification_id = ?\", n.id).first\n logger.debug2 \"cn.class = #{cn.class}\" if debug_notifications\n logger.debug2 \"cn.id = #{cn.id}\" if cn and debug_notifications\n logger.debug2 \"cn.noti_key = #{cn.noti_key}\" if cn and debug_notifications\n logger.debug2 \"cn.from_user.short_user_name = #{cn.from_user.short_user_name}\" if cn and cn.from_user and debug_notifications\n logger.debug2 \"cn.to_user.short_user_name = #{cn.to_user.short_user_name}\" if cn and cn.to_user and debug_notifications\n # find no users before and after removing this comment from notification\n old_no_users = n.api_comments.collect { |c| c.user_id }.uniq.size\n new_users = n.api_comments.find_all { |ac| ac.id != id }.collect { |ac| ac.user }.uniq\n new_no_users = new_users.size\n if new_no_users == 0\n # last user for this unread notification has been removed\n logger.debug2 \"last user for this unread notification has been removed\" if debug_notifications\n n.destroy!\n return\n end\n return if old_no_users == new_no_users # unchanged number of users => unchanged notification\n if new_no_users > 3\n # unchanged noti_key and username array. Just change number of users\n logger.debug2 \"unchanged noti_key and username array. Just change number of users\" if debug_notifications\n notifications.delete(cn) if cn\n noti_options = n.noti_options\n noti_options[:no_users] = new_no_users\n noti_options[:no_other_users] = new_no_users - 2\n n.noti_options = noti_options\n n.save!\n return\n end\n # change noti_key, username array and number of users\n if n.noti_key !~ /^([a-z_]+)_(\\d)_v(\\d+)$/\n logger.debug2 \"invalid noti key format. noti key = #{noti_key}\"\n return\n end\n logger.debug2 \"change noti_key, username array and number of users\" if debug_notifications\n noti_key_prefix, noti_key_no_users, noti_key_version = $1, $2, $3\n noti_options = n.noti_options\n (1..3).each { |i| noti_options[\"username#{i}\".to_sym] = nil }\n usernames = new_users.collect { |u| u.short_user_name }\n 0.upto(usernames.size-1).each do |i|\n noti_options[\"username#{i+1}\".to_sym] = usernames[i]\n end\n noti_options[:no_users] = new_no_users\n noti_options[:no_other_users] = new_no_users - 2\n n.noti_key = \"#{noti_key_prefix}_#{new_no_users}_v#{noti_key_version}\"\n logger.debug2 \"noti_key: old = #{n.noti_key_was}, new = #{n.noti_key}\" if debug_notifications\n n.noti_options = noti_options\n notifications.delete(cn) if cn\n n.save!\n end",
"def remove_messages(filter = nil)\n with_queue_control do |control|\n control.remove_messages(filter)\n end\n end",
"def delete(key)\n messages.delete(key)\n end",
"def remove(*args)\n commit('remove', *args)\n end",
"def remove\n if status == \"pending\"\n reject\n else\n destroy\n end\n end",
"def remove_entry \n @library = AdminLibrary.friendly.find(params[:admin_library_id])\n @entry = LibraryEntry.find(params[:id])\n if @entry.destroy \n flash[:notice] = \"#{@entry.entriable.title} was removed from your Archive!\"\n redirect_to request.referrer\n else \n flash[:alert] = \"Could not remove this from your Archive for some reason. Please contact us.\"\n redirect_to request.referrer\n end \n end",
"def delete(key)\n messages.delete(key)\n end",
"def delete(key)\n messages.delete(key)\n end",
"def run_on_removal(paths)\n super\n end",
"def remove_comment_upvote_notifications\n n = Notification.find_by(recipient: @resource.user, actor: @actor, \n action_type: \"like\",\n notifiable: @resource) if @resource.user != @actor\n if !n.nil?\n n.destroy\n @removed += 1\n end\n end",
"def irc_part_event(stem, sender, arguments) # :nodoc:\n @chan_mutex.synchronize do\n if sender[:nick] == @nick then\n drop_channel arguments[:channel]\n else\n @channel_members[arguments[:channel]].delete sender[:nick]\n end\n #TODO what should we do if we are in the middle of receiving NAMES replies?\n end\n end",
"def flunk(workitem, err_class_or_instance, *err_arguments)\n\n r = remove_workitem('reject', workitem)\n\n return flunk(workitem) if r != nil\n\n workitem.h.delete('_rev')\n\n super(workitem, err_class_or_instance, *err_arguments)\n end",
"def remove(val)\n\nend",
"def destroy\n @message = Message.find(params[:id])\n\t ent = @message.theme if @message.theme != nil\n\t ent = @message.photo if @message.photo != nil\n\t ent = @message.photo_album if @message.photo_album != nil\n ent = @message.video if @message.video != nil\n \tif userCanDeleteMessage?(@message)\n theme = @message.theme\n \t\tif is_admin?\n \t\t\tif @message.status_id != 1\n \t\t\t\t@message.destroy\n \t\t\telse\n \t\t\t\t@message.update_attribute(:status_id, 2)#@message.set_as_delete\n \t\t\tend \n \t\telse\n \t\t\t@message.destroy\n \t\tend\n theme.last_msg_upd if !theme.nil?\n \t\trespond_to do |format|\n \t\t format.html { redirect_to ent }\n \t\t format.json { head :no_content }\n \t\tend\n \telse\n \t\tredirect_to '/404'\n \tend\n end",
"def remove_method\n :\"remove_#{self[:name].to_s.singularize}\"\n end",
"def dispatch_cancel(msg)\n\n flavour = msg['flavour']\n\n participant = @context.plist.instantiate(msg['participant'])\n\n begin\n participant.cancel(Ruote::FlowExpressionId.new(msg['fei']), flavour)\n rescue => e\n raise(e) if flavour != 'kill'\n end\n\n @context.storage.put_msg(\n 'reply',\n 'fei' => msg['fei'],\n 'workitem' => msg['workitem'])\n end",
"def on_collection_deleted(event)\n return unless event.payload.key?(:collection) # legacy callback\n return if event[:collection].is_a?(ActiveFedora::Base) # handled by legacy code\n\n Hyrax.custom_queries.find_members_of(collection: event[:collection]).each do |resource|\n resource.member_of_collection_ids -= [event[:collection].id]\n Hyrax.persister.save(resource: resource)\n Hyrax.publisher\n .publish('collection.membership.updated', collection: event[:collection], user: event[:user])\n rescue StandardError\n Hyrax.logger.warn \"Failed to remove collection reference from #{work.class}:#{work.id} \" \\\n \"during cleanup for collection: #{event[:collection]}. \"\n end\n end",
"def rezm_delete_check_box(message)\n check_box_tag 'to_delete[]', message.id\n end",
"def rm(*path)\n super; on_success{ nil }\n end",
"def ftp_remove path\n return ftp_action(true, path)\n end",
"def send_remove\n Rails.logger.info \"Sending a message to #{rhizome.name}/remove of: \" <<\n rhizome_unique_id\n\n result = -1\n begin\n result = rhizome.particle\n .function 'remove',\n rhizome_unique_id\n rescue Particle::BadRequest\n msg = 'Lost contact with Rhizome or the Rhizome doesn\\'t support ' <<\n 'the \"remove\" function! Check your equipment!'\n Rails.logger.error msg\n return false\n end\n\n # If the function returned the ID we provided, it was successful\n unless result.to_i == rhizome_eid.to_i\n raise RhizomeInterfaces::Errors::RhizomeArgumentError.new('remove', result)\n end\n\n true\n end",
"def action_remove\n notifying_block do\n remove_user\n remove_group if new_resource.group\n end\n end"
] | [
"0.667572",
"0.66230637",
"0.65286845",
"0.65286845",
"0.6337768",
"0.6328019",
"0.62162626",
"0.6173989",
"0.61100453",
"0.6093377",
"0.6093377",
"0.6093377",
"0.6093377",
"0.60772717",
"0.60767573",
"0.60597223",
"0.6043116",
"0.6020181",
"0.6011349",
"0.5953205",
"0.5889439",
"0.5887605",
"0.58618736",
"0.5858397",
"0.5849316",
"0.58317894",
"0.58300906",
"0.5824555",
"0.5794528",
"0.57567996",
"0.57567996",
"0.5748267",
"0.574551",
"0.5717853",
"0.5713302",
"0.56938607",
"0.56761384",
"0.56753117",
"0.56704354",
"0.5663777",
"0.56460696",
"0.5637824",
"0.5560629",
"0.5536266",
"0.5531435",
"0.5525843",
"0.5508338",
"0.54978395",
"0.5497433",
"0.5496386",
"0.54870045",
"0.5481334",
"0.545956",
"0.5445451",
"0.54443806",
"0.54441947",
"0.54388523",
"0.5438013",
"0.5434687",
"0.54346424",
"0.5434435",
"0.54314494",
"0.5424715",
"0.54064643",
"0.54028064",
"0.5394144",
"0.5374936",
"0.5374498",
"0.5369952",
"0.5365729",
"0.5360645",
"0.5359127",
"0.53556055",
"0.53527117",
"0.53474087",
"0.53365326",
"0.53361374",
"0.53312874",
"0.53290945",
"0.53277564",
"0.53225905",
"0.53212047",
"0.53107816",
"0.5309669",
"0.5305513",
"0.5305513",
"0.530543",
"0.53052807",
"0.53015804",
"0.5295213",
"0.52940124",
"0.52937955",
"0.52911365",
"0.5287017",
"0.5285272",
"0.52836865",
"0.5283238",
"0.5277374",
"0.5276581",
"0.5276051"
] | 0.77340853 | 0 |
Internal handler for MESSAGE_REACTION_REMOVE_ALL | def remove_all_message_reactions(data); end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_message_reaction(data); end",
"def _remove_all_method\n :\"_remove_all_#{self[:name]}\"\n end",
"def _remove_all_method\n :\"_remove_all_#{self[:name]}\"\n end",
"def clean_all\n\t\t\t\t\t@messages = []\n\t\t\t\tend",
"def remove_all_method\n :\"remove_all_#{self[:name]}\"\n end",
"def unsubscribe_all\n send_action('unsubscribe_all')\n end",
"def clear_all_actions; end",
"def get_messages\n @connection.uid_search(@filter).each do |message|\n puts \"PROCESSING MESSAGE #{message}\"\n body=@connection.uid_fetch(message,\"RFC822\")[0].attr[\"RFC822\"]\n @processor.process(body, @options)\n @connection.uid_copy(message, 'Processed')\n\n @connection.uid_store(message,\"+FLAGS\",[:Deleted])\n end\n @connection.expunge\n #@connection.delete_all\n end",
"def remove_all_method\n :\"remove_all_#{self[:name]}\"\n end",
"def removeAllActions _args\n \"removeAllActions _args;\" \n end",
"def unload_reactions\n @reactor.clear if @reactor\n @reaction_files.clear if @reaction_files\n end",
"def RemoveAll()\r\n ret = _invoke(1610743824, [], [])\r\n @lastargs = WIN32OLE::ARGV\r\n ret\r\n end",
"def RemoveAll()\r\n ret = _invoke(1610743824, [], [])\r\n @lastargs = WIN32OLE::ARGV\r\n ret\r\n end",
"def remove_all\n @registry = []\n sync\n end",
"def remove_message(name)\n\t\tend",
"def remove_all()\n @items.clear()\n end",
"def supprimerMessage(indice)\r\n\t\t@lstMessages.delete(indice) if @lstMessages.has_key?(indice)\r\n\tend",
"def remove_all\n @peer.remove_all\n# @children.each { |child| scene.unindex_prop(child) } if scene\n# @children = []\n end",
"def rm(msgid)\n req(\"rm\", \"\", \"\", msgid, \"\")\n end",
"def run\n super \"Cleansing read, unflagged old messages\",\n [:Deleted] do\n @imap.expunge\n log \"Expunged deleted messages\"\n end\n end",
"def remover_item\n # Remove um item do final do buffer\n BUFFER.pop\n end",
"def remove; end",
"def remove; end",
"def remove; end",
"def remove; end",
"def delete_message(data); end",
"def delete_message(data); end",
"def action_processed(_action)\n @entities.each(&:unpass!)\n end",
"def remove_revoked_and_duplicated_messages\n @rebalance_manager.lost_partitions.each do |topic, partitions|\n partitions.each do |partition|\n @buffer.delete(topic, partition)\n end\n end\n\n @buffer.uniq!\n end",
"def removeAllHandgunItems _args\n \"removeAllHandgunItems _args;\" \n end",
"def remove!; end",
"def pre_process_batch_remove(docs, method)\n docs.map do |doc|\n self.path = doc.atomic_path unless path\n execute_callback :before_remove, doc\n unless _assigning?\n doc.apply_destroy_dependencies!\n doc.run_before_callbacks(:destroy) if method == :destroy\n end\n _target.delete_one(doc)\n _unscoped.delete_one(doc)\n unbind_one(doc)\n execute_callback :after_remove, doc\n doc.send(:as_attributes)\n end\n end",
"def remove\n recipient_list_members.destroy_all\n if message_recipients.count.zero?\n destroy\n else\n self.removed = true\n save!\n end\n end",
"def get_messages\n @connection.search(@filter).each do |message|\n body = @connection.fetch(message, \"RFC822\")[0].attr[\"RFC822\"]\n begin\n @processor.process(body)\n rescue StandardError => error\n Mailman.logger.error \"Error encountered processing message: #{message.inspect}\\n #{error.class.to_s}: #{error.message}\\n #{error.backtrace.join(\"\\n\")}\"\n next\n end\n @connection.store(message, \"+FLAGS\", @done_flags)\n end\n # Clears messages that have the Deleted flag set\n @connection.expunge\n end",
"def remove(*)\n super.tap do\n __debug_sim('USER initiates removal of existing entries.')\n end\n end",
"def removed; status[:removed] || []; end",
"def remove_from_notifications\n notifications.find_all { |n| n.noti_read == 'N' }.each do |n|\n remove_from_notification(n)\n end # each n\n end",
"def unreceive(message=nil)\n for msg, receivers in SendReceive.registry\n next if message and message.to_s != msg\n receivers.delete_if { |_, max_object| max_object == $max_object } # $max_object is the current max object\n end\n end",
"def delete_messages uids, expunge = true\n log \"DELETING [...#{uids.size} uids]\"\n imap.store uids, '+FLAGS.SILENT', [:Deleted]\n if expunge then\n log \"EXPUNGE\"\n imap.expunge\n end\n end",
"def removals()\n return @removals\n end",
"def clear!\n messages = [ ]\n @messages_mutex.synchronize do\n @messages.size.times do\n messages << @messages.shift(true)\n end\n end\n messages\n end",
"def removeAction _obj, _args\n \"_obj removeAction _args;\" \n end",
"def on_message(pre, message)\n\n m_wfid = message['wfid'] || (message['fei']['wfid'] rescue nil)\n m_error = message['error']\n\n m_action = message['action']\n m_action = \"pre_#{m_action}\" if pre\n\n msg = m_action == 'error_intercepted' ? message['msg'] : message\n\n ids_to_remove = []\n\n trackers.each do |tracker_id, tracker|\n\n # filter msgs\n\n t_wfid = tracker['wfid']\n t_action = tracker['action']\n\n next if t_wfid && t_wfid != m_wfid\n next if t_action && t_action != m_action\n\n next unless does_match?(message, tracker['conditions'])\n\n if tracker_id == 'on_error' || tracker_id == 'on_terminate'\n\n fs = msg['workitem']['fields']\n\n next if m_action == 'error_intercepted' && fs['__error__']\n next if m_action == 'terminated' && (fs['__error__'] || fs['__terminate__'])\n end\n\n # remove the message post-trigger?\n\n ids_to_remove << tracker_id if tracker['msg'].delete('_auto_remove')\n\n # OK, have to pull the trigger (or alter the message) then\n\n if pre && tracker['msg']['_alter']\n alter(m_wfid, m_error, m_action, msg, tracker)\n else\n trigger(m_wfid, m_error, m_action, msg, tracker)\n end\n end\n\n remove(ids_to_remove, nil)\n end",
"def purge_all\n @listeners.each { |type, subtypes|\n subtypes.each { |subtype, ar|\n subtypes.delete(subtype) if ar.nil? or ar.empty?\n }\n @listeners.delete(type) if subtypes.empty?\n }\n end",
"def remove list\n list_action list, \"remove\"\n end",
"def delete_all\n target.clear\n end",
"def remove_messages(filter = nil)\n with_queue_control do |control|\n control.remove_messages(filter)\n end\n end",
"def on_refresh\n removed = []\n @reminders.each do |r|\n if r.remind?\n r.remind\n removed.push(r)\n end\n end\n\n unless removed.empty?\n removed.each do |reminder|\n @reminders.delete(reminder)\n end\n end\n end",
"def remove_records(messages)\n clause = deleted_query(messages)\n\n clause.delete_all\n end",
"def run_on_removals(paths)\n end",
"def delMail(imap, folder)\n pp \"Emptying #{folder}..\"\n message_ids = imap.uid_search(\"ALL\")\n imap.uid_store(message_ids, \"+FLAGS\", [:Deleted])\n imap.expunge\nend",
"def post_process_batch_remove(docs, method)\n docs.each do |doc|\n doc.run_after_callbacks(:destroy) if method == :destroy\n doc.freeze\n doc.destroyed = true\n end\n end",
"def method_removed(*) end",
"def _rh_do_control_remove(result, remove)\n remove.each { |element| result.delete(element) }\n end",
"def sub_remove _value=0\n send_cmd(\"sub_remove #{_value}\")\n end",
"def remove_problem_upvote_notifications\n ((@resource.versions.map{ |version| version.user }).uniq - [@actor]).each do |editor|\n n = Notification.find_by(recipient: editor,\n actor: @actor,\n notifiable: @resource,\n action_type: \"like\")\n if !n.nil?\n n.destroy\n @removed += 1\n end\n end\n\n end",
"def remove_all\n @sequence.remove_all\n end",
"def clear\n messages.clear\n end",
"def clear\n messages.clear\n end",
"def forget_removed\n action = branch_merge ? :remove : :forget\n working_changeset.deleted.each do |file|\n act action, file unless target_changeset[file]\n end\n\n unless branch_merge\n working_changeset.removed.each do |file|\n forget file unless target_changeset[file]\n end\n end\n end",
"def run_on_removal(paths)\n super\n end",
"def reset\n @messages = []\n end",
"def remove message\n @events.delete message.sequence\n end",
"def run_on_removals(paths)\n paths.each do |path|\n warn \"file #{path} removed -- it's up to you to remove it from the server if desired\"\n end\n end",
"def clearAllItemsFromBackpack _args\n \"clearAllItemsFromBackpack _args;\" \n end",
"def remove_all_rules\n super\n end",
"def removeItems _obj, _args\n \"_obj removeItems _args;\" \n end",
"def remove_all_updates(component)\n @update_map.each do |k, v|\n v.delete component\n end\n end",
"def removeAllMPEventHandlers _obj, _args\n \"_obj removeAllMPEventHandlers _args;\" \n end",
"def unsubscribe_all\n # Get an array of all the email addresses accociated with this devise class.\n emails = all.map(&:email).select {|e| Devise::Models::Campaignable.valid_campaign_email? e}\n\n # Ask the list managed to subscibe all of these emails.\n list_manager.batch_unsubscribe(emails) \n end",
"def process(&after_each_message)\n Mail.all(read_only: false, delete_after_find: true) do |message|\n message.skip_deletion unless process_message(message)\n after_each_message.call(message) if after_each_message\n end\n end",
"def cleanup\n keys = redis.keys(raw_data_key('*')) + redis.keys(data_key('*'))\n multi do\n keys.each{|key| redis.del(key)}\n end\n super\n end",
"def removeAllItems _args\n \"removeAllItems _args;\" \n end",
"def unsubscribe_all_request_hooks\n EasyPost::Hooks.unsubscribe_all(:request)\n end",
"def remove\n __flag__ :remove\n end",
"def remove_all\n @owner.transaction do\n self.each { |obj| @owner.send(@remove_proc, obj) }\n end\n @members.clear\n @loaded = false # gmosx: IS this needed?\n end",
"def handle_processed_mail(uid)\n @imap.uid_copy(uid, @imap_setting[:move_folder]) if (@imap_setting[:move_folder])\n @imap.uid_store(uid, \"+FLAGS\", [:Deleted])\n end",
"def clear_messages\n @messages.clear\n end",
"def process_msgs\n end",
"def remove(entry); end",
"def remove_all_confirmation_events\n ConfirmationEvent.find_each(&:destroy)\n end",
"def delete_all_reactions_unsafe(rate_limit = 0.25)\n RestClient.delete(\n \"#{Discordrb::API.api_base}/channels/#{self.channel.id}/messages/#{self.id}/reactions\",\n Authorization: @bot.token\n )\n sleep rate_limit\n end",
"def delete_all_reactions_unsafe(rate_limit = 0.25)\n RestClient.delete(\n \"#{Discordrb::API.api_base}/channels/#{self.channel.id}/messages/#{self.id}/reactions\",\n Authorization: @bot.token\n )\n sleep rate_limit\n end",
"def removeAllMissionEventHandlers _args\n \"removeAllMissionEventHandlers _args;\" \n end",
"def delete_all_reactions_unsafe(rate_limit = 0.25)\r\n RestClient.delete(\r\n \"#{Discordrb::API.api_base}/channels/#{self.channel.id}/messages/#{self.id}/reactions\",\r\n Authorization: @bot.token\r\n )\r\n sleep rate_limit\r\n end",
"def clear\n input_manager.unsubscribe_all self\n end",
"def removeMPEventHandler _obj, _args\n \"_obj removeMPEventHandler _args;\" \n end",
"def delete_notifications\n Notification.where(origin_type: 'Message', origin_id: @message.id).destroy_all\n end",
"def clear_all\n super\n SidekiqUniqueJobs::Digests.new.del(pattern: \"*\", count: 1_000)\n end",
"def destroy_all\r\n Message.destroy_all(channel: @channel)\r\n respond_to do |format|\r\n format.html { redirect_to channel_messages_url(@channel), notice: 'Chat erfolgreich geleert.' }\r\n format.json { head :no_content }\r\n end\r\n end",
"def unregister_all\n registry.clear.default = nil\n end",
"def remove_all(*args)\n set_option_value(:remove_all, true, *args)\n end",
"def add_removals(statements)\n statements.each do |statement|\n add_removal(statement)\n end\n end",
"def delete_all\n start do |pop3|\n unless pop3.mails.empty?\n pop3.delete_all\n pop3.finish\n end\n end\n end",
"def clear_member_actions!\n\n @member_actions = []\n\n end",
"def delete_message_by_restaurant\n root_id = @parsed_json[\"message_id\"] if @parsed_json[\"message_id\"]\n check = Notifications.where(\"id=?\", root_id.to_i).first\n if check.nil?\n render :status=>412, :json=>{:status=>:failed, :error=>\"Not exist this message\"}\n else\n sql =\"notifications.alert_type != 'Publish Menu Notification' AND notifications.id=? OR notifications.reply=?\"\n notifications = Notifications.where(sql, root_id.to_i,root_id.to_i)\n for i in notifications\n i.update_attributes(:is_show=>0, :is_show_detail=>0)\n end\n render :status=>200, :json=>{:status=>:success}\n end\n end",
"def run_on_removal(paths)\n @builder.notify\n end",
"def del_msg_listener( msgName, object )\n @msgNames[msgName].delete object if defined? @msgNames\n end",
"def process_removing_labels\n unless labels_to_remove.empty?\n (labels_to_remove & issue_labels).each {|label| unlabel_issue(label)}\n end\n end",
"def un_collect_msg(msgid)\n uri = \"cgi-bin/setstarmessage?t=ajax-setstarmessage&token=#{ @token }&lang=zh_CN\"\n params = {\n ajax: 1,\n f: 'json',\n lang: 'zh_CN',\n msgid: msgid,\n random: rand,\n token: @token,\n value: 0\n }\n headers = {\n referer: 'https://mp.weixin.qq.com/cgi-bin/message'\\\n \"?t=message/list&token=#{ @token }&count=20&day=7\"\n }\n resource = RestClient::Resource.new(@home_url, headers: headers,\n cookies: @cookies)\n res = resource[uri].post params\n JSON.parse res.to_s\n end"
] | [
"0.6820369",
"0.63740325",
"0.6334058",
"0.61254525",
"0.60393846",
"0.60378236",
"0.6013697",
"0.595617",
"0.59309286",
"0.57197124",
"0.5686392",
"0.56808877",
"0.56808877",
"0.56598544",
"0.56268114",
"0.5602594",
"0.5557516",
"0.5557114",
"0.5519992",
"0.55078614",
"0.54949796",
"0.5486468",
"0.5486468",
"0.5486468",
"0.5486468",
"0.548472",
"0.548472",
"0.54845893",
"0.54829603",
"0.54704916",
"0.54500204",
"0.54435337",
"0.54417354",
"0.5432907",
"0.54037106",
"0.5396571",
"0.539443",
"0.5391411",
"0.5378182",
"0.5366464",
"0.53471833",
"0.5345888",
"0.53258866",
"0.53256124",
"0.53238696",
"0.5296518",
"0.5290672",
"0.52828455",
"0.5269508",
"0.5262416",
"0.5261426",
"0.5256913",
"0.5253621",
"0.5243828",
"0.5238712",
"0.52328146",
"0.5230518",
"0.5227551",
"0.5227551",
"0.5222647",
"0.5193671",
"0.5193666",
"0.51932865",
"0.51926684",
"0.5183449",
"0.51709723",
"0.5168374",
"0.5164589",
"0.51640826",
"0.5162094",
"0.51611125",
"0.515563",
"0.5155201",
"0.51539814",
"0.51475954",
"0.51411736",
"0.51408863",
"0.5138655",
"0.5136251",
"0.51354814",
"0.51303947",
"0.51180154",
"0.51180154",
"0.511044",
"0.5106059",
"0.5101545",
"0.5096842",
"0.5096415",
"0.50945145",
"0.5077834",
"0.50704646",
"0.5060235",
"0.50592893",
"0.5058996",
"0.50488937",
"0.50483626",
"0.50470203",
"0.50336903",
"0.5031499",
"0.50291246"
] | 0.72189426 | 0 |
Internal handler for GUILD_BAN_ADD | def add_user_ban(data); end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def msg_BAN(source, args)\n return nil\n end",
"def addHandgunItem _obj, _args\n \"_obj addHandgunItem _args;\" \n end",
"def add1\n bp = bpn\n bp.add_list_item('Apollo13',actors,hanks)\nend",
"def ban\n ban = Ban.new\n ban.steamid = params[:id]\n ban.ts = params[:ts]\n ban.sign = params[:sign]\n ban.expiry = DateTime.now.ago(-(params[:len].to_i*60))\n ban.addr = params[:addr]\n ban.reason = params[:reason]\n ban.ban_type = Ban::TYPE_SERVER\n ban.save!\n\n render :text => \"Ok\"\n end",
"def add_builder oid\n self.builders << oid if Character && !builder?(oid)\n end",
"def add_bleapp\n\t\tif authorize_agent?\n\t\t\tbegin\n\t\t\t\tproperty = Property.find(params[:bleapp][:property_id])\n\t\t\t\tbeacon = Beacon.find_by(uuid: params[:uuid].downcase)\n\t\t\t\tbleapp = property.bleeapps.build(bleapp_params)\n\t\t\t\tbleapp.beacon_id = beacon.id\n\t\t\t\tif bleapp.save\n\t\t\t\t\tparams[:images].each { |image|\n\t i = bleapp.ble_images.create(image: image)\n\t if i.save\n\t else\n\t \trender_json({\"status\" => \"Fail\", \"message\" => i.errors.full_messages.first}.to_json)\n\t \treturn\n\t end\n\t }\n\t\t\t\t\trender_json({\"status\" => \"Success\", \"message\" => \"bleapp has been saved successfully.\",\"bleapp_id\" => bleapp.id}.to_json)\n\t\t\t\telse\n\t\t\t\t\trender_json({\"status\" => \"Fail\", \"message\" => bleapp.errors.full_messages.first}.to_json)\n\t\t\t\tend\n\t\t\trescue => e\n\t\t\t\tp e.inspect\n\t\t\t\trender_json({\"status\" => \"Fail\", \"message\" => e}.to_json)\n\t\t\tend\n\t\telse\n\t\t\trender_json({\"status\" => \"Fail\", \"message\" => \"Not authorize to add bleapp(Login as agent).\"}.to_json)\n\t\tend\n\tend",
"def addItemToBackpack _obj, _args\n \"_obj addItemToBackpack _args;\" \n end",
"def on_add(clicker)\n end",
"def add_bounce\n begin\n RestClient.post $cnf['mailgun']['apikey'] + $cnf['mailgun']['bounnces'],\n :address => 'bkotu6717@gmail.com'\n rescue Exception => e\n puts \"Exception raised add_bounce:\" + e.class.to_s\n puts e.message\n end\n end",
"def remove_user_ban(data); end",
"def remove_user_ban(data); end",
"def create\n\n @offender = User.find(params[:offender_id])\n @enforcer = current_user\n\n @ban = Ban.refined_build(params, offender: @offender, enforcer: @enforcer, jurisdiction: @cloud)\n\n if authorize @ban, :create?\n if @ban.save\n render status: 200\n set_flash_message message: \"Your target was sent to the moon.\", title: \"TO THE MOON!\"\n else\n set_flash_message message: \"You used the wrong kind of magic and the canon broke.\", title: \"Moon canon malfunction\"\n build_errors_from_model @ban\n render status: 422\n end\n else\n set_flash_message message: \"Only supreme rulers are authorized to operate the moon-canon.\", title: \"No banana bag?\"\n build_errors_from_model @ban\n render status: 401\n end\n\n end",
"def add_to_inbox__do_add\r\n @inbox = params[:inbox] ? Inbox.active.find(params[:inbox]) : @for_inbox\r\n if @inbox && @inbox.accepts?(@content) && !@content.inboxes.include?(@inbox) && !@inbox.archived?\r\n @inbox_item = InboxItem.new(:inbox_id => @inbox.id, :content_id => @content.id,\r\n :allow_take_to_showcase => @inbox.require_allowing_content_adoption? ? true : params[:allow_take_to_showcase],\r\n :user_id => current_actor.id, :original_content_id => @content.original_content_id)\r\n if @inbox_item.save\r\n Activity.send_message(@inbox_item, current_actor, :submitted_to_inbox)\r\n Activity.send_message(@inbox_item, current_actor, :inbox_submission_received)\r\n else\r\n respond_to do |wants|\r\n wants.html { flash[:warning] = \"Your content has been added to your account, but not to '{{name}}' inbox. Reason: {{reason}}\" / [@inbox.title, @inbox_item.errors.full_messages.join(';')]}\r\n wants.js {}\r\n end\r\n end\r\n end\r\n end",
"def on_bid(bid)\r\n warn \"Bid \" + bid.to_s\r\n end",
"def add(client); end",
"def add_to_base(msg)\n add(:base, msg)\n end",
"def create_guild_ban(guild_id, user_id, delete_message_days: nil, reason: nil)\n query = URI.encode_www_form('delete-message-days': delete_message_days, reason: reason)\n request(\n :guilds_gid_bans_uid, guild_id,\n :put,\n \"guilds/#{guild_id}/bans/#{user_id}?\" + query,\n nil,\n 'X-Audit-Log-Reason': reason,\n )\n end",
"def add_bonus_item(message)\n match = /(bonus item|hidden treasure)! <(?<id>.*)> \\| <(?<name>.*)>/.match(message)\n return nil unless match\n \n add_item(nil, match[:id], match[:name])\n publish Events::ADD_ITEM, match[:id], match[:name]\n end",
"def add_bitch_message(bitch_message_text, &block)\n Logger.d(\"Adding bitch message for user on server : #{bitch_message_text}\")\n \n return if bitch_message_text.length == 0 or bitch_message_text.nil?\n\n json = {\n :message => {\n :abuse => bitch_message_text\n },\n :auth_token => get(:auth_token)\n }.to_json\n\n network_post(CONFIG.get(:add_bitch_message), nil, json, @on_api_call_failed) do |user_object|\n if is_valid_network_user_object?(user_object)\n @data = user_object\n Logger.d(\"Success in @user.add_bitch_message => \" + user_object.to_s)\n serialiaze() # Write the object to persistent storage\n block.call(@data) \n end\n end \n end",
"def create_ad(umsg,sock)\n channel = umsg[1]\n msg = umsg - umsg[0..2]\n if @channels.include? channel\n msg = {:id => 0 ,:channel => channel, :ad => msg.join(\" \"), :time => Time.now}\n ad_id = @@connection.insert_advice(msg[:ad],msg[:channel])\n msg[:id] = ad_id\n @msg_queue.push(msg)\n sock.write(\"Message successfully created. Channel => #{channel}\\n\")\n send_channel_msg(msg)\n else\n sock.write(\"Channel doesnt exist\\n\")\n end\n end",
"def add_buddies_to_friends_list\n if user_id.blank?\n render :status=>401,\n :json=>{:Message=>\"The user id cannot be blank for this api.\",\n :Response => \"Fail\",\n :Data => nil} \n end\n friend = User.find_by_id(user_id)\n friend.follow(requested_user)\n render :status=>200,\n :json=>{:Message=>\"Added #{friend.name} to buddy list!\",\n :Response => \"Success\",\n :Data => nil} \n end",
"def create\n #@buddy = Buddy.new(buddy_params)\n @buddy = current_user.buddies.build(buddy_params)\n\n respond_to do |format|\n if @buddy.save\n format.html { redirect_to @buddy, notice: \"Buddy was successfully created.\" }\n format.json { render :show, status: :created, location: @buddy }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @buddy.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @bid = Bid.new(params[:bid])\n\n respond_to do |format|\n if @bid.save\n format.html { redirect_to @admin_bid, notice: 'Bid was successfully created.' }\n format.json { render json: @admin_bid, status: :created, location: @admin_bid }\n else\n format.html { render action: \"new\" }\n format.json { render json: @admin_bid.errors, status: :unprocessable_entity }\n end\n end\n end",
"def add_owner(id) #account.add_owner(number that you get from Bank::Owner.new)\n @owner_id = id #adriana_account.add_owner(adriana_owner.user_id)\n end",
"def hangup\n append(Hangup.new)\n end",
"def create\n @buddy = Buddy.new(params[:buddy])\n\n respond_to do |format|\n if @buddy.save\n flash[:notice] = 'New buddy added.'\n format.html {redirect_to(user_path(session[:user_id]))}\n else\n errors = []\n @buddy.errors.each do |field,error|\n errors << error\n end\n flash[:notice] = errors\n format.html { redirect_to(user_path(session[:user_id]))}\n end\n end\n end",
"def ban(jid,reason=\"no reason\",&blk)\n set_affiliation 'outcast', jid, reason, &blk\n end",
"def add_member_to_card\n @trello.add_commander_to_card(find_member, @card)\n end",
"def add_bling(new_bling)\n @bling << new_bling\n puts \"The bike now has #{@bling.join(', ')} for bling.\"\n end",
"def create\n @bid = @swarm_request.bids.new(params[:bid])\n @bid.user = current_user\n\n respond_to do |format|\n if @bid.save\n UserMailer.bid_notification(@bid).deliver\n format.html { redirect_to(swarm_request_bid_url(:id => @bid.to_param, :swarm_request_id => @swarm_request.to_param), :notice => 'Bid was successfully created.') }\n format.xml { render :xml => @bid, :status => :created, :location => @bid }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @bid.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def add_to_base(msg)\n add(:base, msg)\n end",
"def add_to_base(msg)\n add(:base, msg)\n end",
"def add_to_base(msg)\n add(:base, msg)\n end",
"def addBackpackCargo _obj, _args\n \"_obj addBackpackCargo _args;\" \n end",
"def add_charge(desc, bond)\n self[:charges] << {\n :desc => desc.to_s.strip,\n :bond => bond.to_s.gsub('$', '').strip.to_i\n \t}\n Log.d(\"Adding charge: #{self[:charges].last[:desc]}, #{self[:charges].last[:bond]}\")\n end",
"def add_holder(id, to:)\n # takes two args, id = new holder id, to: = account id to be added to\n # can be written add holder 1, to: 3\n holder = @holders.find id\n # calls find method on holders controller and passes holder id, assigns to local variable\n account = find to\n # finds account and assigns to local variable\n account.add_holder holder\n # creates and returns message\n AddHolderSuccessMessage.new(holder, account)\n # creates message and returns it\n rescue ItemExist, HolderOnAccount => message\n # catches exceptions and saves them to a message, then executes code inside block\n message\n # returns exception as message\n end",
"def add_bank_to_list\n prompt = TTY::Prompt.new\n bank_instance_id = prompt.ask(\"Please add a bank by their bank id number =] -->\", required: true) { |q| q.in(\"1-5612\") }\n\n new_userbank = Userbank.create(user_id: self.user.id, bank_id: bank_instance_id)\n\n sleep 1\n\n new_bank = Bank.find(new_userbank.bank_id)\n if !self.user_bank_list.include? new_bank.bank_name \n puts \"Here's the updated bank list for you --> #{self.user_bank_list.uniq << new_bank.bank_name}\".green\n else\n Userbank.last.destroy #destroys the newly created Userbank isntance instead of implementing conditional\n puts \"Duplication breh.\"\n end\n\n keypress = prompt.keypress(\"***Press enter to go back to main menu***\".yellow, keys: [:return])\n\n self.main_menu if keypress\n end",
"def func_add(sender, dest, args)\r\n\t\tif args.size() >= 1\r\n\t\t\tuser= sender.nick\r\n\t\t\tmatchid= args[0].to_i()\r\n\t\t\tres= @db.query(\"SELECT * FROM `users` WHERE account='#{sender.account_name}'\")\r\n\t\t\tif res.num_rows() > 0\r\n\t\t\t\tu= res.fetch_hash()\r\n\t\t\t\tuserid= u['id'].to_i()\r\n\t\t\t\terr= false\r\n\r\n\t\t\t\t# user don' want to add himself\r\n\t\t\t\t# !add <match_id> <user>\r\n\t\t\t\tif (u['level'].to_i() <= 1) and (args.size() == 2)\r\n\t\t\t\t\ttarg_account= args[1].to_s()\r\n\r\n\t\t\t\t\tres2= @db.query(\"SELECT * FROM `users` WHERE account=\\\"#{targ_account}\\\"\")\r\n\t\t\t\t\tif res2.num_rows() > 0\r\n\t\t\t\t\t\tt= res2.fetch_hash()\r\n\t\t\t\t\t\tuserid= t['id'].to_i()\r\n\t\t\t\t\t\tuser= targ_account\r\n\t\t\t\t\t# user not found, maybe his current nick was given instead of his account\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\ttarg= getUserObj(targ_account)\r\n\t\t\t\t\t\tif targ != nil\r\n\t\t\t\t\t\t\tres3= @db.query(\"SELECT * FROM `users` WHERE account=\\\"#{targ.account_name}\\\"\")\r\n\t\t\t\t\t\t\tif res3.num_rows() > 0\r\n\t\t\t\t\t\t\t\tt= res3.fetch_hash()\r\n\t\t\t\t\t\t\t\tuserid= t['id'].to_i()\r\n\t\t\t\t\t\t\t\tuser= targ.nick\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\terr= true\r\n\t\t\t\t\t\t\tend\r\n\t\t\t\t\t\t\tres3.free()\r\n\t\t\t\t\t\tend\r\n\t\t\t\t\tend\r\n\t\t\t\t\tres2.free()\r\n\t\t\t\t\tsender.notice(\"unknow user: #{targ_account}\") if err\r\n\t\t\t\tend\r\n\r\n\t\t\t\tif !err\r\n\t\t\t\t\t# check if match exists\r\n\t\t\t\t\tif matchid == 0\r\n\t\t\t\t\t\tres2= @db.query(\"SELECT * FROM `matchs` WHERE Date LIKE CONCAT(CURDATE(),'%%')\");\r\n\t\r\n\t\t\t\t\t\t# if no match found, create one\r\n\t\t\t\t\t\tif res2.num_rows() == 0\r\n\t\t\t\t\t\t\t@db.query(\"INSERT INTO matchs(Adversaires,Type,Type_Comment,Date,Etat,Maps,Server,Comments) VALUES('?','m','pcw',CONCAT(CURDATE(), ' 21:00:00'),'c','?/?','','')\");\r\n\t\t\t\t\t\t\tres2= @db.query(\"SELECT MAX(id) FROM matchs\");\r\n\t\t\t\t\t\t\t# mysql_get_field(res, 0, \"MAX(id)\", num);\r\n\t\t\t\t\t\t\tm= res2.fetch_hash()\r\n\t\t\t\t\t\t\tmatchid= m['MAX(id)']\r\n\t\t\t\t\t\tend\r\n\t\t\t\t\tend\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tres2= @db.query(\"SELECT * FROM matchs WHERE id=\\\"#{matchid}\\\" AND Etat='c'\")\r\n\t\t\t\t\tif res2.num_rows() > 0\r\n\t\t\t\t\t\tm= res2.fetch_hash()\r\n\t\t\t\t\t\t# check if user is not already registered\r\n\t\t\t\t\t\tres3= @db.query(\"SELECT * FROM link WHERE link.user='#{userid}' AND link.match='#{matchid}'\")\r\n\t\t\t\t\t\tif res3.num_rows() > 0\r\n\t\t\t\t\t\t\tsender.notice(\"#{user} already registered in match #{matchid} vs #{m['Adversaires']}\")\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t@db.query(\"INSERT INTO link(link.user,link.match) VALUES('#{userid}','#{matchid}')\")\r\n\t\t\t\t\t\t\tsender.notice(\"'#{user}' added to match #{matchid} vs #{m['Adversaires']}\")\r\n\t\t\t\t\t\t\tupdateTopic()\r\n\t\t\t\t\t\tend\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tsender.notice(\"unknow match id: #{matchid}\")\r\n\t\t\t\t\tend\r\n\t\t\t\t\tres2.free()\r\n\t\t\t\tend\r\n\r\n\t\t\telse\r\n\t\t\t\tsender.notice(\"no account in db, tell bot owner\")\r\n\t\t\tend\r\n\t\t\tres.free()\r\n\t\telse\r\n\r\n\t\tend\r\n\tend",
"def Cobble(name, *args, &block)\n Cobble.create(name, *args, &block)\nend",
"def badge; end",
"def add(*args, &block)\n\n end",
"def setBidireccionalBuddys(userASid,userBSid,userANick,userBNick,groupForA,groupForB)\n\taddBuddyToRoster(userASid,userBSid,userBNick,groupForB,\"both\")\n\taddBuddyToRoster(userBSid,userASid,userANick,groupForA,\"both\")\n\treturn \"Done\"\nend",
"def msg_BMASK(source, args)\n # :42X BMASK 1234567890 #x b :*!*@derp *!Mibbit@* ...\n c = Channel.find_by_name(args[1])\n if not c\n raise(NoSuchChannelException, \"Couldn't find #{args[1]}\")\n end\n\n ts = args[0].to_i()\n\n if c.ts < ts\n return nil\n end\n\n if args[2] != 'b' && args[2] != 'e'\n # We've \"added\" the entry, i.e., discarded what we didn't care about\n return nil\n end\n\n args[3].split(' ').each do |ban|\n c.add_ban(ban, args[2])\n end\n\n return nil\n end",
"def create\n @ban = Ban.new(params[:ban])\n\n respond_to do |format|\n if @ban.save\n flash[:notice] = 'Ban was successfully created.'\n format.html { redirect_to(@ban) }\n format.xml { render :xml => @ban, :status => :created, :location => @ban }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @ban.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def lbAdd _obj, _args\n \"_obj lbAdd _args;\" \n end",
"def add(*args, &block)\n end",
"def add_ally host, password = nil\n @allies << Growl.new(host, \"battlecry\", [\"battlecry\"], nil, password)\n end",
"def add_bank_account bank_account_uri\n self.bank_account_uri = bank_account_uri\n save\n end",
"def action_card_bd(input)\n utoken = params[:xml][:FromUserName]\n card_info = Card.where(:utoken=>utoken).order('updated_at desc').first\n return build_response_text_temp {|msg|\n msg.Content=t(:notbindinghelp)\n } if card_info.nil?\n card_info[:isbinded]=true\n card_info.save\n #persist user request\n log_use_request {|request|\n request.lastaction = RequestAction::ACTION_JF_BIND\n }\n return build_response_text_temp {|msg|\n msg.Content = t(:bindingsuccess)\n }\n end",
"def add_guest(actor_id)\n @max_battle_member_count += 1 if battle_members.size >= max_battle_members\n fix_actor(actor_id)\n end",
"def create\n sys_bds_array = BridgeDomain.bd_ids_to_array(system_bridge_domain)\n inp_bds_array = BridgeDomain.bd_ids_to_array(@bd_ids)\n if (inp_bds_array - sys_bds_array).any?\n add_bds = BridgeDomain.bd_list_to_string(inp_bds_array - sys_bds_array)\n config_set('bridge_domain', 'system_bridge_domain', oper: 'add',\n bd: add_bds)\n end\n config_set('bridge_domain', 'create', bd: @bd_ids)\n end",
"def add\n super\n return 77\n end",
"def add_dashboard_entry\n if @frame = Frame.find(params.delete(:frame_id)) and u = User.find(params[:id])\n if dbe = GT::Framer.create_dashboard_entry(@frame, ::DashboardEntry::ENTRY_TYPE[:new_hashtag_frame], u)\n @dashboard_entry = dbe.first\n @status = 200\n else\n return render_error(404, \"error while creating dashboard entry\")\n end\n else\n return render_error(404, \"could not find that frame or user\")\n end\n end",
"def create\n @bid = @auction.bids.new(params[:bid])\n @bid.bidder = current_character\n\n respond_to do |format|\n if @bid.save\n flash[:notice] = 'Bid was successfully created.'\n format.html { redirect_to(auction_bids_path(@auction)) }\n format.xml { render :xml => @bid, :status => :created, :location => @bid }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @bid.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def set_buddy\n @buddy = Buddy.find(params[:id])\n end",
"def on_add(&block)\n @add_proc = block\n end",
"def add_builder(builder)\n if builders.has_key?(builder.name) and not Fixjour.allow_redundancy?\n raise RedundantBuilder.new(\"You already defined a builder for #{builder.klass.inspect}\")\n else\n builders[builder.name] = builder\n end\n end",
"def create\n add_breadcrumb 'New Blacklist'\n\n @blacklist = Blacklist.new(blacklist_params)\n\n respond_to do |format|\n if @blacklist.save\n format.html do\n redirect_to @blacklist, notice: 'Blacklist was successfully created.'\n end\n format.json { render :show, status: :created, location: @blacklist }\n else\n format.html { render :new , status: :unprocessable_entity }\n format.json do\n render json: @blacklist.errors, status: :unprocessable_entity\n end\n end\n end\n end",
"def add_handler(opts={})\n end",
"def add_joiner(actor_id)\n @posx = 471\n distance = @party_banners.size\n banner = BannerBG.new(@posx,191+38*distance,@viewport2)\n banner.bitmap = Cache.banner(\"[TPJ]#{actor_id}\")\n banner.opacity = 250\n banner.z = 30 + @joiners.size\n banner.move(@posx,Banner::PosY[@party_banners.size],255,15)\n @party_banners.push(banner)\n $game_party.add_actor(@joiners.shift)\n end",
"def add_ants(*args)\n end",
"def done_adding(*) end",
"def setBidireccionalBuddys(userAJid,userBJid,userANick,userBNick,groupForA,groupForB)\n\taddBuddyToRoster(userAJid,userBJid,userBNick,groupForB,\"both\")\n\taddBuddyToRoster(userBJid,userAJid,userANick,groupForA,\"both\")\n\treturn \"Done\"\nend",
"def add_bundle\n add_to_cart_common(:add_bundle, params[:id])\n end",
"def on_new_assembly_message( assembly, * )\n\t\tself.log.info \"Creating a new builder for: %p\" % [ assembly ]\n\t\tbuilder = Assemblage::AssemblyBuilder.new( assembly )\n\t\tbuilder.start\n\n\t\tself.builder_queue << builder\n\n\t\tsuper\n\tend",
"def add_to_bank\n @bank.push(@letter)\n end",
"def addWeaponPool _args\n \"addWeaponPool _args;\" \n end",
"def add_message_builder(name, &block)\n give_name(name, block)\n @message_builders << block\n end",
"def create_blocked\n end",
"def add!(child)\n #should add defensive check here: is the child a Permission or a Command?\n self.children.add(child)\n end",
"def add\n\tend",
"def insert_hook(label)\n # aby se to mohlo korektne rozbalit pri resolve\n # je potreba udavat, kolikaty byte si to ma \n # z kotvy brat\n # write_opcode(S_POINTER)\n @temp_bytecode << Hook.new(label,@hooks,3)\n @temp_bytecode << Hook.new(label,@hooks,2)\n @temp_bytecode << Hook.new(label,@hooks,1)\n @temp_bytecode << Hook.new(label,@hooks,0)\n @current_byte += 4 # adresa se vyhodnocuje jako 4B\n end",
"def add(child, left, right, top, bottom, &block)\n super(child, false, &block)\n\n gtk_instance.attach(child.gtk_instance, left, right, top, bottom)\n end",
"def command_builder; end",
"def add(*args); end",
"def add_bin(bin)\n @bins << bin\n bin.house = self\n end",
"def add_widget\n @group = Group.find(params[:id])\n @widget = Widget.find_by_id(params[:widget][:widget_id], :conditions => { :approved => true, :public => false, :user_id => current_user.id})\n\n unless @widget.nil?\n @group.widgets << @widget\n flash[:notice] = \"Widget añadido exitosamente.\" if @group.save\n else\n flash[:error] = \"No se pudo añadir este widget. Verifique que el widget a añadir sea el correcto.\"\n end\n\n redirect_to group_path(@group)\n end",
"def blacklist_add_remote\n if params[:item] and params[:item] != ''\n i = Blacklist.new(:item => params[:item], :created_at => Time.sl_local)\n i.save\n # add this to the cache if it exists\n Blacklist.add_to_cache(i) if Blacklist.cache.length > 0\n end\n render :nothing => true\n end",
"def add_a_b\n end",
"def add_bonuses\n return if @invitation.present?\n return unless @client.currency&.casecmp?('rub')\n\n request_path = '/api/internal/v1/payments.json'\n request_params = {\n payment: {\n puid: @client.id,\n source: 'new_registration',\n client_id: @client.id,\n amount: REDEEMING_AMOUNT,\n currency: @client.currency,\n },\n }\n\n if Rails.env == 'development'\n puts '================================'\n puts 'Services::Users::Registration#add_bonuses'\n puts request_path\n puts JSON.pretty_generate(request_params)\n puts '================================'\n return\n end\n\n service = Diplomat::Service.get('accounting')\n url = \"http://#{service.Address}:#{service.ServicePort}/\"\n\n conn = Faraday.new(url: url) do |faraday|\n faraday.response :logger, ::Logger.new(STDOUT), bodies: true\n faraday.adapter Faraday.default_adapter\n faraday.headers['Content-Type'] = 'application/json'\n end\n\n res = conn.post(request_path) do |req|\n req.body = request_params.to_json\n end\n end",
"def add_argument(arg); end",
"def add_argument(arg); end",
"def add_argument(arg); end",
"def adler\n\t\tend",
"def add_guild_member(data)\n server_id = data['guild_id'].to_i\n server = self.server(server_id)\n\n member = Member.new(data, server, self)\n server.add_member(member)\n end",
"def add_guild_member(data)\n server_id = data['guild_id'].to_i\n server = self.server(server_id)\n\n member = Member.new(data, server, self)\n server.add_member(member)\n end",
"def create\n @banner = Banner.new(banner_params)\n exchange_attributes_params\n respond_to do |format|\n if @banner.save\n notice = 'Banner was successfully created.' \n notice += ' <span class=\"text-danger\">Error on bidder synch process. Please try again.</span>' if @banner.campaign and not @banner.campaign.update_bidder\n format.html { redirect_to @banner, notice: notice }\n format.json { render :show, status: :created, location: @banner }\n else\n format.html { render :new }\n format.json { render json: @banner.errors, status: :unprocessable_entity }\n end\n end\n end",
"def handle_add( m, params )\n # lame auth check\n # TODO: need to get a look into new auth system\n\n name = params[:name].downcase\n machine = params[:machine].downcase\n amount = params[:amount]\n beats = params[:beats]\n\n # caluclate beats for one good and multiply with 100 -> better for later use\n beats = beats.to_f / amount.to_f\n beats *= 100\n\n # tag version || current amount || maximal amount || beats for one good || deliverybeat (always 'nil' if not reordered) || linked machine\n if machine == \"-\"\n stock = Stock.new( @stockversion, amount, amount, beats, nil, machine )\n @stock[name] = stock\n\n m.reply( \"#{name} added\" )\n elsif machine == \"yes\"\n name += \"_machine\"\n stock = Stock.new( @stockversion, amount, amount, beats, nil, machine )\n @stock[name] = stock\n\n m.reply( \"#{name} added\" )\n elsif machine == \"no\" and @stock.has_key?( name + \"_machine\" )\n machine = name + \"_machine\"\n stock = Stock.new( @stockversion, amount, amount, beats, nil, machine )\n @stock[name] = stock\n\n m.reply( \"#{name} added\" )\n else\n m.reply( \"Please first create the machine which should be linked to (same syntax, just replace the machine name with 'yes'), or use '-' to inidcate that there is no machine.\" ); return\n end\n\n # save dataset in case the bot crashes an got no chance to do so\n save\n end",
"def addBlinds()\n s_blind_loc = get_next_player(self.dealer) # location of small blind player\n b_blind_loc = get_next_player(s_blind_loc) # location of big blind player\n # get player data for small and big blind locations\n s_blind_player = get_player(s_blind_loc) # actual players to change money\n b_blind_player = get_player(b_blind_loc)\n # put money from small and big blind players into pot\n put_money(self.small_blind, s_blind_player)\n put_money(self.big_blind, b_blind_player)\n self.current_player = get_next_player(b_blind_loc)\n b_blind_player.save\n s_blind_player.save\n self.save\n end",
"def create\n @auction = Auction.find(params[:auction_id])\n params[:bid].reverse_merge!({owner_id: current_user.id})\n @bid = @auction.bids.build(params[:bid])\n \n respond_to do |format|\n if @bid.save\n format.html { redirect_to @auction, notice: 'You submitted a bid!'}\n format.json { render json: @bid, status: :created, location: @bid }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bid.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @banned = Banned.new(banned_params)\n\n respond_to do |format|\n if @banned.save\n format.html { redirect_to @banned, notice: 'Banned was successfully created.' }\n format.json { render :show, status: :created, location: @banned }\n else\n format.html { render :new }\n format.json { render json: @banned.errors, status: :unprocessable_entity }\n end\n end\n end",
"def add_bank_details(post, options)\n post[:AcceptBADirectDebitTC] = options[:tokenise_bank_account_details] || true\n if %w(account_name account_number bsb_number).any? { |k| options.has_key?(k) }\n post[:BankAccountDetails] = {\n AccountName: options[:account_name],\n AccountNumber: options[:account_number],\n BSBNumber: options[:bsb_number]\n }\n end\n end",
"def add(child); end",
"def add\n end",
"def add\n end",
"def handle_incoming_invite(*args); false; end",
"def receive_postback(postback)\n # postback.sender => { 'id' => '1008372609250235' }\n # postback.recipient => { 'id' => '2015573629214912' }\n # postback.sent_at => 2016-04-22 21:30:36 +0200\n # postback.payload => 'EXTERMINATE'\n Rails.logger.debug \"receive_postback()\"\n Rails.logger.debug \"payload = #{postback.payload}\"\n Rails.logger.debug \"state = \" + state.to_s\n \n # Store reference to this postback\n @last_postback = postback\n \n case state\n when :link_asked\n ad_config = Rails.configuration.fb.ad\n @link = (postback.payload == \"LINK-WEBSITE\" ? \n ad_config.website : ad_config.app)\n ask_for_image\n when :budget_asked\n match = postback.payload.match(/^BUDGET-(\\d+)$/i)\n @budget = match.captures.first.to_i * 100 # BUDGET-50 -> 5000 (in cents)\n ask_for_confirmation\n when :confirmation_asked\n if postback.payload == \"CONFIRM-YES\"\n create_ad\n else\n @state = 0\n ask_for_title\n end\n end\n \n advance! # next state\n end",
"def add \n end",
"def addinfo\n\nend"
] | [
"0.6248805",
"0.5861954",
"0.5841996",
"0.56147",
"0.5592438",
"0.5532081",
"0.5479989",
"0.5458416",
"0.54517585",
"0.53584355",
"0.53584355",
"0.52599037",
"0.5245032",
"0.5242702",
"0.52190423",
"0.5216284",
"0.5204837",
"0.519241",
"0.5188778",
"0.5167934",
"0.5162251",
"0.51574767",
"0.5153826",
"0.5147508",
"0.5138188",
"0.5135867",
"0.51148885",
"0.5113509",
"0.5111867",
"0.5091351",
"0.50809526",
"0.50809526",
"0.50809526",
"0.5080385",
"0.5060401",
"0.50458986",
"0.5040942",
"0.5005083",
"0.50016755",
"0.49777454",
"0.4976154",
"0.49748957",
"0.4970896",
"0.4969811",
"0.4964035",
"0.4960516",
"0.49529094",
"0.49476114",
"0.49206832",
"0.4914499",
"0.491354",
"0.49004766",
"0.4855767",
"0.48519948",
"0.48517114",
"0.484738",
"0.4843105",
"0.4829352",
"0.48281932",
"0.4820373",
"0.4818934",
"0.4810811",
"0.479724",
"0.47967649",
"0.47944918",
"0.47902444",
"0.4788552",
"0.47863707",
"0.47780967",
"0.47775903",
"0.47767305",
"0.4776623",
"0.4775756",
"0.47734165",
"0.47730473",
"0.47721455",
"0.4770206",
"0.47688568",
"0.47647086",
"0.47613564",
"0.47582388",
"0.47582388",
"0.47582388",
"0.47405985",
"0.47396448",
"0.47396448",
"0.47395664",
"0.47394451",
"0.47362277",
"0.4730374",
"0.4726041",
"0.47245833",
"0.47238383",
"0.471743",
"0.471743",
"0.47126734",
"0.47120452",
"0.47103968",
"0.4692121"
] | 0.7235239 | 0 |
Internal handler for GUILD_BAN_REMOVE | def remove_user_ban(data); end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def removeHandgunItem _obj, _args\n \"_obj removeHandgunItem _args;\" \n end",
"def unban(jid,reason=nil,&blk)\n set_affiliation 'none', jid, reason, &blk\n end",
"def removeBackpack _args\n \"removeBackpack _args;\" \n end",
"def remove_guild_ban(guild_id, user_id, reason: nil)\n request(\n :guilds_gid_bans_uid, guild_id,\n :delete,\n \"guilds/#{guild_id}/bans/#{user_id}\",\n nil,\n 'X-Audit-Log-Reason': reason,\n )\n end",
"def removeItemFromBackpack _obj, _args\n \"_obj removeItemFromBackpack _args;\" \n end",
"def unban_user(auth, server_id, user_id, reason = nil)\n MijDiscord::Core::API.request(\n :guilds_sid_bans_uid,\n server_id,\n :delete,\n \"#{MijDiscord::Core::API::APIBASE_URL}/guilds/#{server_id}/bans/#{user_id}\",\n Authorization: auth,\n 'X-Audit-Log-Reason': reason\n )\n end",
"def sub_remove _value=0\n send_cmd(\"sub_remove #{_value}\")\n end",
"def add_user_ban(data); end",
"def add_user_ban(data); end",
"def msg_BAN(source, args)\n return nil\n end",
"def remove\n return unless confirm_command\n\n args.each do |name|\n messages = nil\n if name.start_with? \"HEROKU_POSTGRESQL_\"\n name = name.chomp(\"_URL\").freeze\n end\n action(\"Removing #{name} on #{app}\") do\n messages = addon_run { heroku.uninstall_addon(app, name, :confirm => app) }\n end\n display(messages[:attachment]) if messages[:attachment]\n display(messages[:message]) if messages[:message]\n end\n end",
"def unban!\n MTurkUtils.unban_user self\n end",
"def remove_banned\n Zold::Id::BANNED.each do |id|\n @pgsql.exec('DELETE FROM payable WHERE id = $1', [id])\n end\n end",
"def remove_message_reaction(data); end",
"def func_remove(sender, dest, args)\r\n\t\tif args.size() >= 1\r\n\t\t\tuser= sender.nick\r\n\t\t\tmatchid= args[0].to_i()\r\n\t\t\tres= @db.query(\"SELECT * FROM `users` WHERE account='#{sender.account_name}'\")\r\n\t\t\tif res.num_rows() > 0\r\n\t\t\t\tu= res.fetch_hash()\r\n\t\t\t\tuserid= u['id'].to_i()\r\n\t\t\t\terr= false\r\n\r\n\t\t\t\t# user don' want to remove himself\r\n\t\t\t\t# !remove <match_id> <user>\r\n\t\t\t\tif (u['level'].to_i() <= 1) and (args.size() == 2)\r\n\t\t\t\t\ttarg_account= args[1].to_s()\r\n\r\n\t\t\t\t\tres2= @db.query(\"SELECT * FROM `users` WHERE account=\\\"#{targ_account}\\\"\")\r\n\t\t\t\t\tif res2.num_rows() > 0\r\n\t\t\t\t\t\tt= res2.fetch_hash()\r\n\t\t\t\t\t\tuserid= t['id'].to_i()\r\n\t\t\t\t\t\tuser= targ_account\r\n\t\t\t\t\t# user not found, maybe his current nick was given instead of his account\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\ttarg= getUserObj(targ_account)\r\n\t\t\t\t\t\tif targ != nil\r\n\t\t\t\t\t\t\tres3= @db.query(\"SELECT * FROM `users` WHERE account=\\\"#{targ.account_name}\\\"\")\r\n\t\t\t\t\t\t\tif res3.num_rows() > 0\r\n\t\t\t\t\t\t\t\tt= res3.fetch_hash()\r\n\t\t\t\t\t\t\t\tuserid= t['id'].to_i()\r\n\t\t\t\t\t\t\t\tuser= targ.nick\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\terr= true\r\n\t\t\t\t\t\t\tend\r\n\t\t\t\t\t\t\tres3.free()\r\n\t\t\t\t\t\tend\r\n\t\t\t\t\tend\r\n\t\t\t\t\tres2.free()\r\n\t\t\t\t\tsender.notice(\"unknow user: #{targ_account}\") if err\r\n\t\t\t\tend\r\n\r\n\t\t\t\tif !err\r\n\t\t\t\t\tres2= @db.query(\"SELECT * FROM matchs WHERE id=\\\"#{matchid}\\\" AND Etat='c'\")\r\n\t\t\t\t\tif res2.num_rows() > 0\r\n\t\t\t\t\t\tm= res2.fetch_hash()\r\n\t\t\t\t\t\t@db.query(\"DELETE FROM link WHERE user='#{userid}' AND `match`='#{matchid}'\")\r\n\t\t\t\t\t\tsender.notice(\"'#{user}' removed from match #{matchid} vs #{m['Adversaires']}\")\r\n\t\t\t\t\t\tupdateTopic()\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tsender.notice(\"unknow match id: #{matchid}\")\r\n\t\t\t\t\tend\r\n\t\t\t\t\tres2.free()\r\n\t\t\t\tend\r\n\r\n\t\t\telse\r\n\t\t\t\tsender.notice(\"no account in db, tell bot owner\")\r\n\t\t\tend\r\n\t\t\tres.free()\r\n\t\telse\r\n\r\n\t\tend\r\n\tend",
"def remove\n args.each do |name|\n messages = nil\n action(\"Removing #{name} from #{app}\") do\n messages = addon_run { heroku.uninstall_addon(app, name, :confirm => options[:confirm]) }\n end\n output messages[:attachment] if messages[:attachment]\n output messages[:message]\n end\n end",
"def removeBuddy(contact)\n \n unless SocialStream::Presence.enable\n return\n end\n \n unless contact.receiver.subject_type == \"User\" and contact.sender.subject_type == \"User\"\n return\n end\n \n #XMPP DOMAIN\n domain = SocialStream::Presence.domain\n user_sid = contact.sender.slug + \"@\" + domain\n user_name = contact.sender.name \n buddy_sid = contact.receiver.slug + \"@\" + domain\n buddy_name = contact.receiver.name\n \n #Check for bidirecctional\n \n if contact.sender.contact_actors(:type=>:user).include?(contact.receiver)\n #Bidirectional contacts\n #Execute unsetRosterForBidirectionalTie(user_sid,oldfriend_sid,oldfriendNick,oldfriendGroup)\n SocialStream::Presence::XmppServerOrder::unsetRosterForBidirectionalTie(buddy_sid,user_sid,user_name,\"SocialStream\")\n elsif contact.sender.contact_actors(:type=>:user, :direction=>:sent).include?(contact.receiver)\n #Unidirectional contacts\n SocialStream::Presence::XmppServerOrder::removeBuddyFromRoster(user_sid,buddy_sid)\n end\n \n end",
"def removeMagazinesTurret _obj, _args\n \"_obj removeMagazinesTurret _args;\" \n end",
"def remove!; end",
"def cunban(m, nick)\n nick = User(nick)\n if is_chanadmin?(m.channel, m.user) && is_botpowerful?(m.channel)\n m.channel.unban(nick.mask)\n elsif !is_chanadmin?(m.channel, m.user)\n m.reply NOTADMIN, true\n elsif !is_botpowerful?(m.channel)\n m.reply NOTOPBOT, true\n end\n end",
"def removeMagazineTurret _obj, _args\n \"_obj removeMagazineTurret _args;\" \n end",
"def remove(*)\n super.tap do\n __debug_sim('USER initiates removal of existing entries.')\n end\n end",
"def delete_blocked\n end",
"def removeAllHandgunItems _args\n \"removeAllHandgunItems _args;\" \n end",
"def remove; end",
"def remove; end",
"def remove; end",
"def remove; end",
"def unban(nick_or_host)\n @session.chanserv.unban(self.name, nick_or_host)\n end",
"def remove_smux_subagent(opts)\n opts = check_params(opts,[:subagent_info])\n super(opts)\n end",
"def remove_message(name)\n\t\tend",
"def remove_bot(key)\n @queue.push([:remove_bot, key])\n end",
"def removeMenuItem _obj, _args\n \"_obj removeMenuItem _args;\" \n end",
"def displayRemoveEventHandler _obj, _args\n \"_obj displayRemoveEventHandler _args;\" \n end",
"def ban(jid,reason=\"no reason\",&blk)\n set_affiliation 'outcast', jid, reason, &blk\n end",
"def removeMPEventHandler _obj, _args\n \"_obj removeMPEventHandler _args;\" \n end",
"def delCall call\n # Check if block has Agent channel\n puts \" --- del call start ----\\n\"\n pp call\n puts \" --- call delete ----\\n\"\n $calls.delete(call[Uniqueid])\n pp $calls.inspect\n puts \" --- end ----\\n\"\nend",
"def unlinkItem _obj, _args\n \"_obj unlinkItem _args;\" \n end",
"def unban!\n self.update_attribute(:banned, false)\n end",
"def remover_item\n # Remove um item do final do buffer\n BUFFER.pop\n end",
"def fdrop!\n @session.chanserv.fdrop(self.name)\n end",
"def blacklist_destroy_remote\n if params[:item] and params[:item] != ''\n i = Blacklist.find(:first, :conditions => ['item = ?', params[:item]])\n i.destroy if i\n # remove this from the cache if it exists\n Blacklist.delete_from_cache(i) if Blacklist.cache.length > 0\n end\n render :nothing => true\n end",
"def removeAction _obj, _args\n \"_obj removeAction _args;\" \n end",
"def on_remove(&block)\n @onRemoveBlock = block\n end",
"def removeWeapon _obj, _args\n \"_obj removeWeapon _args;\" \n end",
"def removeMagazine _obj, _args\n \"_obj removeMagazine _args;\" \n end",
"def removeEventHandler _obj, _args\n \"_obj removeEventHandler _args;\" \n end",
"def remove_item\n\n end",
"def removeItem _obj, _args\n \"_obj removeItem _args;\" \n end",
"def unban_user(token, server_id, user_id)\n request(\n __method__,\n :delete,\n \"#{api_base}/guilds/#{server_id}/bans/#{user_id}\",\n Authorization: token\n )\n end",
"def bring_down(typename, cmd)\n execute_with_fail(typename, cmd, 'to remove')\n end",
"def remove(entry); end",
"def drop( gobject )\r\n\t\t\t@contents -= [ gobject ]\r\n\t\tend",
"def remove(rid)\n do_rpc({:id=>1,\n :procedure=>:drop,\n :arguments=>[rid]\n })\n end",
"def lbDelete _obj, _args\n \"_obj lbDelete _args;\" \n end",
"def hcRemoveGroup _obj, _args\n \"_obj hcRemoveGroup _args;\" \n end",
"def removed_child_object(child, relations)\n\t super if defined? super\n\n if !task.invalidated_terminal_flag?\n if (relations.include?(EventStructure::Forwarding) || relations.include?(EventStructure::Signal)) && \n child.respond_to?(:task) && child.task == task\n\n task.invalidate_terminal_flag\n end\n end\n\tend",
"def remove_ban\n @user = User.find(params[:id])\n @user.update_attribute(:ban, false)\n flash[:notice] = \"You have un banned user #{@user.email}\"\n redirect_to :controller => 'users', :action => 'index'\n end",
"def remove_self\n self.alive = false\n fire :remove_me\n @input_manager.unsubscribe_all self\n end",
"def irc_part_event(stem, sender, arguments) # :nodoc:\n @chan_mutex.synchronize do\n if sender[:nick] == @nick then\n drop_channel arguments[:channel]\n else\n @channel_members[arguments[:channel]].delete sender[:nick]\n end\n #TODO what should we do if we are in the middle of receiving NAMES replies?\n end\n end",
"def ban_user(auth, server_id, user_id, message_days, reason = nil)\n MijDiscord::Core::API.request(\n :guilds_sid_bans_uid,\n server_id,\n :put,\n \"#{MijDiscord::Core::API::APIBASE_URL}/guilds/#{server_id}/bans/#{user_id}?delete-message-days=#{message_days}\",\n nil,\n Authorization: auth,\n 'X-Audit-Log-Reason': reason\n )\n end",
"def track_removal_item(list, klass, broken_down, from_day)\n list.each do |id|\n remove_children = id.split('_').last\n i = id.split('_').first\n self.aggregate_customs.create(removable_id: i, removable_type: klass.to_s, remove_children: remove_children)\n if(remove_children == \"true\" && (klass == DataGroupCountry || klass == DataGateway))\n track_children(i, DataGateway, broken_down, from_day) if klass == DataGroupCountry\n track_children(i, DataEntryway, broken_down, from_day) if klass == DataGateway\n end\n end if list.present?\n end",
"def user_cleaned_hook(hook_data)\n unsubscribe_hook(hook_data)\n end",
"def destroy\n @nha_xuat_ban.destroy\n respond_to do |format|\n format.html { redirect_to nha_xuat_bans_url, notice: \"Nha xuat ban was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def cleanup_hook; end",
"def method_removed(*) end",
"def rem_builder oid\n self.builders.delete oid\n end",
"def remove_command\n return if !has_manage_messages_permission?\n command.event.message.delete\n end",
"def removeTeamMember _obj, _args\n \"_obj removeTeamMember _args;\" \n end",
"def remove!\n package('skype') { action :remove }\n end",
"def removeMagazines _obj, _args\n \"_obj removeMagazines _args;\" \n end",
"def remove!(entry)\n rel_path = Wide::PathUtils.relative_to_base(base_path, entry.path)\n\n cmd = cmd_prefix.push('rm', '-f', \"path:#{rel_path}\")\n shellout(Escape.shell_command(cmd))\n\n raise CommandFailed.new(\"Failed to remove file #{src_path} in the Mercurial repository in #{base_path}\") if $? && $?.exitstatus != 0\n end",
"def delete_message(data); end",
"def delete_message(data); end",
"def collapse\n @posx = 471\n for i in 0...@party_banners.size\n @party_banners[i].move(@posx,Banner::PosY[i],255,10)\n end\n @removed.reverse_each do |j|\n $game_party.remove_actor($game_party.members[j].id)\n end\n end",
"def remove_pending(*args)\n\n\t\t# Redirect to remove connection since it is an unbiased connection removed and would do this anyway\n\t\tself.send('remove_connection', *args)\n\tend",
"def remove\n __flag__ :remove\n end",
"def remove_reason(value)\n @children['reason'][:value].delete(value)\n end",
"def removeHeadgear _args\n \"removeHeadgear _args;\" \n end",
"def unowner(jid,reason=nil,&blk)\n set_affiliation 'admin', jid, reason, &blk\n end",
"def unadmin(jid,reason=nil,&blk)\n set_affiliation 'member', jid, reason, &blk\n end",
"def remove_bobchild_relationships(bobchildren_ids)\n existing_bobchildren_ids = bobchildren.collect {|x| x.id}\n delete_child_relaitonships = existing_bobchildren_ids - bobchildren_ids\n Rails.logger.info(\"existing_bobchildren::#{existing_bobchildren_ids}\")\n delete_child_relaitonships.each do |uid|\n u = User.find(uid)\n u.bobfather_rel.destroy\n end\n end",
"def remove_superhero(superhero_conn, super_hero)\n superhero_conn.exec(\"DELETE FROM super_heros WHERE name = '#{super_hero}';\")\n end",
"def delete_user\n print_status(\"Current MySQL Users & Host Info: \")\n query = @db.query('SELECT group_concat(0x0a,host,0x3a,user) FROM mysql.user;')\n query.each { |x| puts \"#{x[0]}\".white }\n print_line(\"\")\n user = Readline.readline(\"(Username to DROP)> \", true)\n host = Readline.readline(\"(Host Entry for #{user.chomp} to DROP)> \", true)\n answer = Readline.readline(\"(Confirm: DROP #{user.chomp}@#{host.chomp} (Y/N))> \", true)\n if \"#{answer.chomp.upcase}\" == \"YES\" or \"#{answer.chomp.upcase}\" == \"Y\"\n print_status(\"OK, sending DROP request.....\")\n begin\n query = @db_connection.query('USE mysql;')\n query = @db_connection.query(\"DROP USER '#{user.chomp}'@'#{host.chomp}';\")\n query = @db_connection.query('FLUSH PRIVILEGES;')\n rescue Mysql::Error => e\n print_error(\"Problem with DROP!\")\n print_error(\"#{e}\")\n end\n print_status(\"Updated MySQL Users & Host Info: \")\n query = @db.query('SELECT group_concat(0x0a,host,0x3a,user) FROM mysql.user;')\n query.each { |x| print_line(\"#{x[0]}\") }\n print_line(\"\")\n else\n print_error(\"OK, aborting User DROP and Returning to Main Menu...\")\n end\n end",
"def remove_friend\n end",
"def destroy\n @ban = Ban.find(params[:id])\n @ban.destroy\n\n respond_to do |format|\n format.html { redirect_to(bans_url) }\n format.xml { head :ok }\n end\n end",
"def frame_drop _value=0\n send_cmd(\"frame_drop #{_value}\")\n end",
"def remove_hook(res)\n print_debug \"[PROXY] Removing beef hook from page if present\"\n res.body.gsub!(%r'<script.*?http.*?exploit.js.*?</script>', '')\n end",
"def before_destroy\n # cwd: utunes_app\n logger.info(\"=======> before_destroy invoked!\")\n\n version_str = sprintf(\"%.2d\", version )\n bundle_title = \"hc12_v#{version_str}\"\n \n bundle_folder = \"lib/bundles\"\n bundle_name=\"build_\" + bundle_title\n bundle_fq_name = bundle_folder + \"/\" + bundle_name\n \n logger.info(\"rm -R #{bundle_fq_name}\")\n logger.info( %x[rm -R #{bundle_fq_name}] )\n \n end",
"def destroy\n BuzzName.delete_buzz_name(@buzz, current_user)\n end",
"def remove_member(auth, server_id, user_id, reason = nil)\n MijDiscord::Core::API.request(\n :guilds_sid_members_uid,\n server_id,\n :delete,\n \"#{MijDiscord::Core::API::APIBASE_URL}/guilds/#{server_id}/members/#{user_id}\",\n Authorization: auth,\n content_type: :json,\n 'X-Audit-Log-Reason': reason\n )\n end",
"def destroy\n old_campaign = @banner.campaign\n notice = \"\"\n if not Bidder.ping\n notice = '<span class=\"text-danger\">Error. Unable to connect to bidder. Check staus and try again.</span>'\n else\n if @banner.destroy\n notice = 'Banner was successfully destroyed.' \n old_campaign.update_bidder if old_campaign\n else\n notice = '<span class=\"text-danger\">Bidder updated but database error. Please try again.</span>'\n end\n end\n respond_to do |format|\n format.html { redirect_to banners_url, notice: notice }\n format.json { head :no_content }\n end\n end",
"def unfollow(actor)\n contact = contact_to!(actor)\n contact.update_column(:blocked, true)\n contact\n end",
"def remove_widget(name)\n @browser.div(:id=>\"add_goodies_body\").li(:text=>/#{Regexp.escape(name)}/, :id=>/_remove_/).button.click\n end",
"def remove(child)\n# if children.delete(child)\n# scene.unindex_prop(child) if scene\n @peer.remove(child.peer)\n# end\n end",
"def remove_hook!\n client.remove_hook(full_name, github_hook_id)\n\n self.github_hook_id = nil\n end",
"def unmember(jid,reason=nil,&blk)\n set_affiliation 'none', jid, reason, &blk\n end",
"def delete_game_id_in_queue game_id, queue = nil\n current_queue = queue || craft_firebase_command(\"minesweeper/queue.json\")\n\n # getting new queue to update\n new_queue = current_queue&.reject { |queue_game_id|\n # reject chosen game\n game_id == queue_game_id\n }\n\n # update queue on server\n update_current_queue(new_queue)\nend",
"def remove\n if url = args.shift\n puts heroku.remove_drain(app, url)\n return\n else\n raise(CommandFailed, \"usage: heroku drains remove URL\")\n end\n end"
] | [
"0.6252262",
"0.6055566",
"0.6052344",
"0.5978838",
"0.5847075",
"0.5730595",
"0.5706117",
"0.5675428",
"0.5675428",
"0.56325006",
"0.5611945",
"0.5566859",
"0.5560829",
"0.5533284",
"0.5527187",
"0.55261475",
"0.55079025",
"0.54138607",
"0.54065526",
"0.53904724",
"0.5354227",
"0.5321518",
"0.53155315",
"0.53086215",
"0.5267652",
"0.5267652",
"0.5267652",
"0.5267652",
"0.5255523",
"0.52548337",
"0.5242226",
"0.5237288",
"0.52327156",
"0.5228476",
"0.5216011",
"0.52105683",
"0.5210357",
"0.5207463",
"0.5200292",
"0.51804036",
"0.51765907",
"0.51729167",
"0.5172196",
"0.5169438",
"0.5168556",
"0.5142291",
"0.5139044",
"0.51328117",
"0.5125451",
"0.5115167",
"0.5114598",
"0.5094854",
"0.5091344",
"0.50821275",
"0.5079509",
"0.50772107",
"0.50694734",
"0.5067768",
"0.50677246",
"0.5065524",
"0.50619537",
"0.5061183",
"0.50596726",
"0.5050254",
"0.50448763",
"0.5041996",
"0.5041637",
"0.50396025",
"0.50356823",
"0.5032383",
"0.50292",
"0.50251925",
"0.5021538",
"0.5021538",
"0.50192815",
"0.50190574",
"0.5017193",
"0.5012241",
"0.5010726",
"0.5006299",
"0.5005723",
"0.49747175",
"0.49729267",
"0.49672177",
"0.49667427",
"0.49484983",
"0.4948125",
"0.49477914",
"0.4946649",
"0.4946089",
"0.49331498",
"0.49261433",
"0.4920186",
"0.49199563",
"0.49167466",
"0.49128327",
"0.49116632",
"0.49066624",
"0.49007353"
] | 0.7298363 | 0 |
Notifies everything there is to be notified that the connection is now ready | def notify_ready
# Make sure to raise the event
raise_event(ReadyEvent.new(self))
LOGGER.good 'Ready'
@gateway.notify_ready
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def notify_ready\n notify(\"READY=1\")\n end",
"def notify_ready\n # Make sure to raise the event\n raise_event(ReadyEvent.new(self))\n LOGGER.good 'Ready'\n\n # Tell the run method that everything was successful\n @ws_success = true\n end",
"def send_ready_notification\n\n end",
"def connection_completed\n end",
"def socket_connected\n post_init\n end",
"def connection_completed\n\tend",
"def wait_connection; end",
"def wait_connection; end",
"def connection_status_done; end",
"def connection_completed\n# @keepalive = EM::PeriodicTimer.new(60) { send_data ' ' }\n start\n end",
"def connection_completed\n ## start sending KEEP_ALIVE_MESSAGE\n puts 'sending keep_alive sending ...'\n EM::PeriodicTimer.new(KEEP_ALIVE_INTERVAL) { send_data KEEP_ALIVE_MESSAGE }\n end",
"def on_ready\n end",
"def send_ready_signal()\n do_send(Erlang::Tuple.new([Erlang::Atom.new('ready')]))\n end",
"def on_connected\n end",
"def connection_completed\n @connection_state = :connected\n @connection_state_callback.call if @connection_state_callback\n end",
"def post_init\n self.dispatch_event(:on_connect, [self])\n self.send_data(SyncMessage.new($listen_port, $uuid).to_sendable)\n end",
"def complete_handshake\n if @state == :handshake\n log.debug { 'Handshake completed' }\n @state = :connected\n @started = Time.now\n @node.push_notification(:connection, info.merge(type: :connected))\n @node.addrs << addr\n end\n send_data P::Addr.pkt(@node.addr) if @node.config[:announce]\n end",
"def post_init\n @connected = true\n end",
"def post_init\n @connected = true\n end",
"def connection_completed\n @connected = true\n Skates.logger.debug {\n \"CONNECTED\"\n } # Very low level Logging\n end",
"def connected\n\t\tdo_send('CN1')\t# Connection command - initiate comms\n\t\n\t\t@polling_timer = schedule.every('60s') do\n\t\t\tlogger.debug \"Polling JVC\"\n\t\t\tdo_send('CN1')\t# Connection command\n\t\tend\n\tend",
"def connection_completed\n log_debug '[client-cnxn] Established server connection, sending request'\n send_request unless error?\n rescue\n fail(:RPC_ERROR, 'Connection error: %s' % $!.message) unless failed?\n end",
"def ready; end",
"def ready; end",
"def ready(packet)\n @connected = true\n\n send_nick()\n end",
"def notify_ready\n if state == :smoking\n puts \"#{name} says: I'm good on smokes, thanks\"\n else\n transition :procuring\n end\n end",
"def update_ready!(connection)\n distribution.set_ready_for(connection)\n nil\n end",
"def update_ready!(connection)\n distribution.set_ready_for(connection)\n nil\n end",
"def connection_ended\n end",
"def connection_ended\n end",
"def connection_completed\n @connected = true\n send_request @args\n end",
"def report_ready\n write_verbose_log(\"Notifier #{VERSION} ready to catch errors\", :info)\n end",
"def on_connection_established(&block)\n @on_connection_established_block = block\n end",
"def connection_completed\n connect @conn_headers # call EM supplied CONNECT method\n @log.debug(\"#{self} connection_completed done\")\n end",
"def on_001 (msg)\n when_ready if respond_to? :when_ready\n end",
"def send_ready(subs)\n self.send({\n msg: 'ready',\n subs: subs\n })\n end",
"def waited_on_connect?\n @waited_on_connect\n end",
"def setup\n EventBus.subscribe(Events::DOWN_ARE_NODES_ALIVE, self, :on_alive_request)\n info \"Startup\"\n Thread.new {\n OmfCommon.init(CONFIG[:env], communication: {url: CONFIG[:xmpp_url]}) {\n OmfCommon.comm.on_connected { |comm|\n info \"WiseOMF >> Connected to XMPP server\"\n # Test end???\n comm.on_interrupted {\n puts \"WiseOMF >> Interrupt!\"\n ResourceProxyManager.instance.handle_interrupt\n }\n }\n }\n }.run\n sleep(5)\n\n OmfRc::ResourceFactory.load_additional_resource_proxies('../lib')\n ResourceProxyManager.instance\n # Do nothing\n end",
"def connect\n succeed # Triggers all callbacks for class\n end",
"def wait_until_ready\n # this method may be left unimplemented if that is applicable\n end",
"def communicates?; !disconnected? end",
"def connectionDidFinishLoading(connection)\n super\n extract_articles_and_bundles\n\n if @articles.list.empty?\n log(\"connectionDidFinishLoading\", \"no_unread\")\n notify( \"unreadarticleslist.status\", { :s => \"no_unread\" } )\n else\n log(\"connectionDidFinishLoading\", \"done\")\n notify( \"unreadarticleslist.status\", { :s => \"done\" } )\n end\n end",
"def client_connected\n end",
"def on_connection_success &block\n @connection_success_callback = block\n end",
"def on_connecting\n\t\t\t\t@@connected = false\n\t\t\t\tpublish('zk_connecting')\n\t\t\tend",
"def on_connected\n\t\t\t\t@@connected = true\n\t\t\t\twhile not @@ensure.empty?\n\t\t\t\t\tfunc = @@ensure.shift\n\t\t\t\t\tensured func[0], *func[1]\t# func[0] == function name, func[1] == arguments\n\t\t\t\tend\n\t\t\t\tpublish('zk_connected')\n\t\t\tend",
"def connection_completed\n JR::JobLogger.log('Begin distributor handshake')\n data = {node_info: {name: @node.config[:name], server: @node.server} }\n data = Marshal.dump(data)\n send_data(data)\n end",
"def notify\n end",
"def notify_readable\n logdebug \"notify_readable\", :state => @state\n case @state\n when :initialized\n attempt_connection\n when :ready_to_read\n attempt_read\n when :write_needs_to_read\n attempt_write\n end\n end",
"def ssl_handshake_completed\n connected!\n end",
"def notify\n {}\n end",
"def notify\n {}\n end",
"def notify\n {}\n end",
"def wait_until_ready\n # this method may be left unimplemented if that is applicable log\n end",
"def connected?; connection_state == :connected end",
"def connection_completed\n @connection_completed = true\n begin_handshake\n rescue Exception\n log.fatal { \"Error in #connection_completed\" }\n p $!; puts *$@\n end",
"def notify\n {\n }\n end",
"def notify\n {\n }\n end",
"def wait_for_ready\n sleep 0.1 until ready?\n end",
"def ready?; @ready; end",
"def ready?; @ready; end",
"def ready\n @room.user_ready!(current_user)\n broadcast_ready_changed\n end",
"def connection_completed\n # We aren't completely connected yet if the connection is encrypted.\n connected! unless @network.secure?\n end",
"def after_connect\n redis_connect\n set_adapters\n set_callbacks\n end",
"def connection_completed\n start_tls\n end",
"def connection_completed\n start_tls\n end",
"def connection_completed()\n super()\n puts \"#{self} connection_completed done!\"\n end",
"def connection_completed()\n super()\n puts \"#{self} connection_completed done!\"\n end",
"def connection_completed()\n super()\n puts \"#{self} connection_completed done!\"\n end",
"def notify(context)\n \n context.connection_listeners.each do |connection_listener|\n yield connection_listener\n end\n \n end",
"def ready=(_); end",
"def wait_for_ready\n @logger.debug(\"Waiting for workers to be ready\")\n @workers.each(&:verify)\n @logger.debug(\"Workers are ready\")\n end",
"def when_ready(&block)\n handle :ready, &block\n end",
"def poll\n @connection.poll\n end",
"def wait_end()\n begin\n loop do\n sleep(TICK/1000.0) while (self.connected?() rescue nil)\n break\n end\n rescue Exception => e\n end\n end",
"def connected?; end",
"def connected?; end",
"def connected?; end",
"def wait_for_pending_sends; end",
"def connection_successful\n @connection_deferrable.succeed\n end",
"def start\n connect\n @last_alive = Time.now\n @listener = Thread.new do\n while true\n begin\n @last_alive = Time.now if @hub.fetch_command\n\n if Time.now > @last_alive + @keepalive_timeout\n @logger.error \"connection lost\" if @logger\n @last_alive = Time.now\n reconnect\n end\n\n rescue Exception => e\n exit if e.class == Interrupt\n puts e.message\n puts e.backtrace.join(\"\\n\")\n break\n end\n end\n end\n end",
"def wait_all_sent\n verify_not_closed\n @clients.each do |pub|\n pub.wait_all_sent\n end\n end",
"def connection_successful\n @authenticating = false\n opened!\n\n exec_callback_yielding_self(:connect)\n end",
"def flush_when_ready\n # make super()-safe so we can make liberal use of mixins\n end",
"def check_connection_state\n # Has the connection been established in the meantime? If yes, shut\n # down the work queues thread, all work will be done in this thread \n # from now on. \n if cached_connection_established?\n @work_queue.shutdown\n end\n end",
"def wait_action_cable_subscription\n sleep 1\n end",
"def connection_completed\n puts \"The connection for #{@my_address} has been successfully completed.\"\n end",
"def on_ready(&block)\n block_given? ? @_on_ready = block : @_on_ready\n end",
"def re_up_ready\n rdy(@max_in_flight)\n # assume these messages are coming our way. yes, this might not be the\n # case, but it's much easier to manage our RDY state with the server if\n # we treat things this way.\n @presumed_in_flight = @max_in_flight\n end",
"def prepare_connection(env)\n env.trace 'init connection'\n @env = env\n init_queue\n initialize_connection env # Defined in each endpoint\n @application.stat_connection_open\n @channel = env.params['channel']\n logger.debug \"Connected to channel #{@channel}\"\n subscribe @channel\n end",
"def connect\n start_listener!\n end",
"def post_init\n puts \"connection established\"\n \n # store the eventmachine connection object id\n @connection.id = self.object_id\n end",
"def post_init\n send_message(MosesPG::Message::StartupMessage.new(@user, @dbname))\n\n # when we enter the ready state after connecting, send self to the\n # callback\n @result = FakeResult.new(self)\n self\n end",
"def on_registration(connection)\n end",
"def connection_status_handshake; end",
"def connection_established(*args)\n\tend",
"def start\n _connect\n sleep 1\n end",
"def post_init\n $connection_list << self\n @my_connection_index = $connection_list.length\n puts \"Connection Initialized #{@my_connection_index}) #{@my_address} - #{@signature}\"\n #\n # TODO: get access to the HostIP and HostPort associated with this connection\n # if it is the local control connection, do the following\n # * do not repeat other connection traffic to this connection\n # * consider any input a command to be processed\n end",
"def set_basic_listener(on_connected, on_disconnected, on_connect_error)\n @on_connected = on_connected\n @on_disconnected = on_disconnected\n @on_connect_error = on_connect_error\n end",
"def notifier\n @loop_notify.promise\n end"
] | [
"0.7469654",
"0.7238633",
"0.68915284",
"0.66748446",
"0.66688156",
"0.657193",
"0.65401155",
"0.65401155",
"0.64917785",
"0.648263",
"0.64756733",
"0.6474577",
"0.6430575",
"0.642331",
"0.6390488",
"0.63673353",
"0.636204",
"0.6355232",
"0.6355232",
"0.63443106",
"0.63255715",
"0.6316947",
"0.627449",
"0.627449",
"0.6245592",
"0.62172854",
"0.6207561",
"0.6207561",
"0.6173937",
"0.6173937",
"0.61721647",
"0.61412627",
"0.6118451",
"0.61015195",
"0.6089538",
"0.60852677",
"0.60438347",
"0.60385436",
"0.6029177",
"0.6017989",
"0.6005358",
"0.60053027",
"0.59811425",
"0.5950109",
"0.59399146",
"0.5933619",
"0.5924906",
"0.59243244",
"0.59133977",
"0.5908827",
"0.5888101",
"0.5888101",
"0.5888101",
"0.5875873",
"0.5855187",
"0.58531576",
"0.585106",
"0.585106",
"0.58382225",
"0.58374643",
"0.58374643",
"0.5833643",
"0.5829706",
"0.5812556",
"0.58099425",
"0.58099425",
"0.5785975",
"0.5785975",
"0.5785975",
"0.57848233",
"0.57743996",
"0.574329",
"0.57340854",
"0.5719383",
"0.5716343",
"0.5700315",
"0.5700315",
"0.5700315",
"0.5694323",
"0.56883854",
"0.56847703",
"0.5674475",
"0.56742024",
"0.56722605",
"0.5669908",
"0.5666121",
"0.5662187",
"0.56468916",
"0.5628243",
"0.56124914",
"0.5597042",
"0.55820704",
"0.55787444",
"0.55694914",
"0.5564093",
"0.55607176",
"0.5558389",
"0.5557576",
"0.55575323",
"0.55500245"
] | 0.72069186 | 2 |
GET /tiendas_clientes GET /tiendas_clientes.json | def index
unless current_user.tiene_permiso_sobre? @cliente
redirect_to clientes_url, alert: 'No tienes los permisos necesarios.'
else
@tiendas_clientes = @cliente.tiendas_clientes
render layout: "dataTables"
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n get_clientes\n end",
"def index\n @clientes = Cliente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clientes }\n end\n end",
"def index\n @clients = current_user.clients\n render json: @clients\n end",
"def index\n @clientes = Cliente.all\n end",
"def index\n @clientes = Cliente.all\n end",
"def index\n @clientes = Cliente.all\n end",
"def index\n @clientes = Cliente.all\n end",
"def index\n @clients = Client.all\n render json: @clients\n end",
"def index\n @clients = Client.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n end",
"def index\n @clients = Client.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n\n end",
"def index\n @contatos_clientes = ContatosCliente.all\n end",
"def index\n @clientes_servicos = ClientesServico.all\n end",
"def index\n clients = request do\n api.request(\n :expects => 200,\n :headers => headers,\n :method => :get,\n :path => \"/oauth/clients\"\n ).body\n end\n styled_header(\"OAuth Clients\")\n styled_array(clients.map { |client|\n [client[\"name\"], client[\"id\"], client[\"redirect_uri\"]]\n })\n end",
"def index\n render json: Client.all\n end",
"def index\n @vendedor_clientes = VendedorCliente.all\n end",
"def index\n @clients = Client.all\n end",
"def index\n @clients = Client.all\n end",
"def index\n @clients = Client.all\n end",
"def index\n @clients = Client.all\n end",
"def index\n @clients = Client.all\n end",
"def index\n @clients = Client.all\n end",
"def index\n @clients = Client.all\n end",
"def index\n @clients = Client.all\n end",
"def index\n @clients = Client.all\n @uuid = params[:uuid]\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n end",
"def index\n @clients = Client.all\n end",
"def index\n sanitized_params = parse_params(client_where_params)\n clients = Client.find_all(sanitized_params)\n render json: clients\n end",
"def index\n @coleccion = Cliente.all\n end",
"def index\n @clientes = Cliente.includes(:pessoa)\n end",
"def index\n @clients = Client.where(params.except(:action, :controller, :format)).to_a # TODO: remove .to_a when Rails to_json bug fixed\n respond_with(@clients)\n end",
"def find_client\n cliente = get_cliente(params[:id])\n\n respond_to do |format|\n format.json {render json: {client: cliente}}\n end\n end",
"def index_clients\n @client = Client.all\n end",
"def get_clients\n @clients\n end",
"def get_clients\n @clients\n end",
"def index\n @page_count, @clients = Locomotive::Client.paginated(:page => (params[:page] || 1).to_i)\n display @clients\n end",
"def index\n @clients = Client.page(params[:page] || 1).per(10)\n end",
"def list_clients(json_payload={})\n conn = @client.get do |req|\n req.url \"/api/v2/client/list?\"\n req.headers[\"Authorization\"] = @token\n req.params = json_payload\n end\n conn.body\n end",
"def lista_estoque()\n @client.get(Route.new([ROTA_DID_ESTOQUE]))\n end",
"def index\n add_breadcrumb(I18n.t('model.list', model: Client.model_name.human))\n\n @clients = Client.all()\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n end",
"def clients\n @clients = Vendor.find(params[:id]).clients\n end",
"def index\n \n @qa_clients = QaClient.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @qa_clients }\n end\n end",
"def index\n @clients = Client.all.paginate(page: params[:page], per_page: 4)\n end",
"def index \n @clients = ApiClient.all\n end",
"def index\n @activacionclientets = Activacionclientet.all\n end",
"def index\r\n user = authenticate\r\n if user\r\n clients = Client.where('clientof = ?', user.id)\r\n render json: {clients: clients, message: 'Success', status: :ok}\r\n else\r\n render json: {message: 'Invalid token', status: :unauthorized}\r\n end\r\n end",
"def index\n @otg_clients = OtgClient.all\n end",
"def get_clients\n Client.get(:all).map{|c| c.to_ws}\n end",
"def index\n @clientes = apply_scopes(Cliente).order(\"#{sort_column} #{sort_direction}\").page(params[:page]).per(NUMERO_POR_PAGINA)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clientes }\n end\n end",
"def clients_index\n @clients = User.clients\n end",
"def clients\n response = User_GetClients()\n return [] if response.empty?\n unless response[\"Code\"].to_i != 0\n response[\"Client\"].collect{|c| Client.new(c[\"ClientID\"].to_i, c[\"Name\"])}\n else\n raise response[\"Code\"] + \" - \" + response[\"Message\"]\n end\n end",
"def index\n @client_infos = ClientInfo.all\n end",
"def index\n @clients = Client.search(params[:search]).order(sort_column + \" \" + sort_direction).page(params[:page]).per(10)\n respond_with(@clients)\n end",
"def index\n @empleado_clientes = EmpleadoCliente.all\n @empleados = Empleado.all\n @clientes = Cliente.all\n end",
"def index\n @clientes = Cliente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @clientes }\n end\n end",
"def show\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cliente }\n end\n end",
"def show\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cliente }\n end\n end",
"def show\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cliente }\n end\n end",
"def index\n @antecedentes = Antecedente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @antecedentes }\n end\n end",
"def index\n @cliente = Clienteempresa.where(empresa_id: current_user.empresa_id)\n end",
"def set_clientes_servico\n @clientes_servico = ClientesServico.find(params[:id])\n end",
"def index\n @clients = current_user.is_admin ? Client.all : current_user.clients\n end",
"def index\n @clients = current_user.account.clients.search(params[:search]).order(sort_column + \" \" + sort_direction).paginate(:per_page => 10, :page => params[:page])\n\n @account = current_user.account\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n end",
"def index\n @clientzs = Clientz.all\n end",
"def show\n @cliente = Cliente.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cliente }\n end\n end",
"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",
"def index\n @telefone_clientes = TelefoneCliente.paginate(:page => params[:page]).order('id DESC').por_nome(pesquisa)\n end",
"def index\n @cliente_registros = ClienteRegistro.all\n end",
"def index\n @applicationclients = Applicationclient.all\n end",
"def show\n @clientepedido = Clientepedido.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clientepedido }\n end\n end",
"def index\n @clients = Client.all.order(created_at: :desc)\n end",
"def recent\n if current_user.is_admin?\n @clients = Client.all\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @clients }\n end\n end",
"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",
"def clients\n Appointments.all.collect do |appointment|\n appointment.client\n end\n end",
"def clients\n clients = []\n each { |rec| clients << rec[:client] }\n clients.uniq\n end",
"def contas\n list_contas = JSON.parse(get_and_give_me_a_json(\"/contas\"))\n rtn = []\n list_contas.each do |c_map|\n conta = Taxcalendario::Admin::Client::Entities::Conta.new\n conta.from_hash(c_map)\n rtn << conta\n end\n rtn\n end",
"def all_booking_of_client\n\t\t@bookings = Booking.where(client_id: params[:client_id])\n\t\trender json: @bookings, status: 200\n\tend",
"def index\n @clientes = Cliente.all\n @clientes_totais = Cliente.count\n @clientes_ativos = Cliente.ativos.length\n end",
"def index\n\n @clients = Client.all\n # ClientPublishingSetting.all\n # ClientPublishingSetting.joins(:client_id)\n\n # Client.joins(:client_publishing_setting)\n # client_publishing_setting\n # posts_needed = Client.joins(:client)\n # .select(\"\n # posts.id,\n # posts.name,\n # description, #ここはusersテーブルと名前が被らない\n # user_id, #ここはusersテーブルと名前が被らない\n # users.name AS user_name #別名を付けられる\n # \")\n # render json: posts_needed\n\n # @clients = Client.joins(:client_publishing_setting)\n\n # @clients = Client.all\n # @clients_publish = ClientPublishingSetting.all\n # @clients = Client.where(client_id: @clients_publish)\n\n\n # @c = Client.all\n # @clients = ClientPublishingSetting.where(client_id: @c.client_id)\n\n\n # @clients = Client.all\n render json: @clients\n end",
"def index\n if ((current_usuario.admin?) || (current_usuario.gerente?))\n @clientes = Cliente.all.order(:nome => :asc).paginate(:page => params[:page], :per_page => 10).search(params[:search],params[:empresa])\n else\n @clientes = Cliente.find_all_by_id(current_usuario.cliente.id)\n end\n end",
"def show\n render json: @client\n end",
"def show\n @client = Client.find(params[:id])\n if @client.nil?\n @clients = Client.all\n flash.now[:alert] = \"Les détails du client n'ont pas été trouvés\"\n render \"index\"\n end\n respond_to do |format|\n format.html #show.html.erb\n format.xml { render :xml => @client }\n end\n end",
"def client_list\n @clients.each do |item|\n puts \"List of clients:\"\n puts \"----------------------------------------------\"\n puts item.name\n end\n end",
"def show\n @client = clients.find(params[:id])\n end",
"def index\n @cliente_documentos = ClienteDocumento.all\n end",
"def clients\n Harvest::Resources::Client\n end",
"def reporte_clientes_nuevos\n\t\tcurrent_year = params[:year].to_i\n\t\tdata = FacturasRecibidas.reporte_clientes_nuevos_por_mes(current_year)\n\t\trender :json => data\n\tend",
"def index\n\n if params[:ventas_seguimiento]\n cliente_id = params[:ventas_seguimiento][:cliente_id]\n @ventas_seguimientos = Ventas::Seguimiento.where(\"cliente_id = ?\",cliente_id).order(\"created_at DESC\").paginate(:page => params[:page], :per_page => 5)\n @seguimientos = Ventas::Seguimiento.new(:cliente_id => cliente_id)\n else\n @ventas_seguimientos = Ventas::Seguimiento.order(\"created_at DESC\").paginate(:page => params[:page], :per_page => 5)\n @seguimientos = Ventas::Seguimiento.new\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ventas_seguimientos }\n end\n end",
"def allclient\n @clients = Client.where(is_client:true)\n end",
"def index\n puts params\n puts params[:filter]\n \n @clients = get_clients \n @client = Client.new\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n end",
"def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end",
"def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end",
"def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end",
"def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end",
"def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end",
"def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end",
"def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end",
"def index\n @clientes = current_user.vendedor ? current_user.vendedor.clientes : Cliente.all\n\n\t\trespond_to do |format|\n format.html { render layout: \"dataTables\" }\n\t\t\tformat.csv { send_data @clientes.to_csv }\n end\n end",
"def index\n @live_clients = LiveClient.all\n end",
"def show\n client = Client.retrieve_by_id(params[:id])\n\n render json: client, serializer: SingleClientSerializer\n end",
"def index\n @cliente_emails = ClienteEmail.all\n end",
"def serialized_clients(_data)\n ActiveModel::ArraySerializer.new(_data, each_serializer: Api::V1::ClientsSerializer, root: 'clients')\n end"
] | [
"0.7446176",
"0.71840674",
"0.7053288",
"0.70309716",
"0.70309716",
"0.70309716",
"0.70309716",
"0.70276886",
"0.6857828",
"0.6833347",
"0.6812668",
"0.67595524",
"0.6737607",
"0.6732066",
"0.6704018",
"0.6682346",
"0.6682346",
"0.6682346",
"0.6682346",
"0.6682346",
"0.6682346",
"0.6682346",
"0.6682346",
"0.66664845",
"0.6666055",
"0.6662523",
"0.6645765",
"0.6639207",
"0.65935266",
"0.65699005",
"0.64960283",
"0.6492078",
"0.6492078",
"0.6479641",
"0.64382964",
"0.6435967",
"0.6433698",
"0.6424209",
"0.6358084",
"0.6356066",
"0.63479483",
"0.63352656",
"0.6301219",
"0.62981254",
"0.6268352",
"0.62628126",
"0.6258775",
"0.62373453",
"0.62325144",
"0.62184995",
"0.62170583",
"0.6215873",
"0.62062764",
"0.6184241",
"0.6184241",
"0.6184241",
"0.6183164",
"0.61824304",
"0.6180876",
"0.6163702",
"0.61489993",
"0.61347514",
"0.6124312",
"0.61210084",
"0.61206037",
"0.6116234",
"0.6107214",
"0.610109",
"0.6091749",
"0.6089051",
"0.60884374",
"0.60857326",
"0.60769075",
"0.60682416",
"0.6057528",
"0.6052466",
"0.60446346",
"0.603748",
"0.6021205",
"0.601887",
"0.60165817",
"0.6003068",
"0.6001839",
"0.59703076",
"0.59669054",
"0.59491235",
"0.5948775",
"0.5941323",
"0.5931949",
"0.5931949",
"0.5931949",
"0.5931949",
"0.5931949",
"0.5931949",
"0.5931949",
"0.592718",
"0.59252906",
"0.59215283",
"0.5910458",
"0.59070486"
] | 0.60811085 | 72 |
GET /tiendas_clientes/1 GET /tiendas_clientes/1.json | def show
unless current_user.tiene_permiso_sobre? @tienda_cliente.cliente
redirect_to clientes_url, alert: 'No tienes los permisos necesarios para ver esa tienda.'
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n get_clientes\n end",
"def index\n @clientes = Cliente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clientes }\n end\n end",
"def find_client\n cliente = get_cliente(params[:id])\n\n respond_to do |format|\n format.json {render json: {client: cliente}}\n end\n end",
"def index\n @clientes = Cliente.all\n end",
"def index\n @clientes = Cliente.all\n end",
"def index\n @clientes = Cliente.all\n end",
"def index\n @clientes = Cliente.all\n end",
"def index\n @clients = current_user.clients\n render json: @clients\n end",
"def index\n @contatos_clientes = ContatosCliente.all\n end",
"def index\n @clients = Client.all\n render json: @clients\n end",
"def index\n @clientes_servicos = ClientesServico.all\n end",
"def index\n @clients = Client.all\n @uuid = params[:uuid]\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n end",
"def index\n @clients = Client.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n end",
"def index\n @coleccion = Cliente.all\n end",
"def index\n @clients = Client.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n\n end",
"def index\n @vendedor_clientes = VendedorCliente.all\n end",
"def index\n @clients = Client.all\n end",
"def index\n @clients = Client.all\n end",
"def index\n @clients = Client.all\n end",
"def index\n @clients = Client.all\n end",
"def index\n @clients = Client.all\n end",
"def index\n @clients = Client.all\n end",
"def index\n @clients = Client.all\n end",
"def index\n @clients = Client.all\n end",
"def index\n @clientes = Cliente.includes(:pessoa)\n end",
"def index\n @clients = Client.all\n end",
"def index\n render json: Client.all\n end",
"def get_clients\n @clients\n end",
"def get_clients\n @clients\n end",
"def show\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cliente }\n end\n end",
"def show\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cliente }\n end\n end",
"def show\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cliente }\n end\n end",
"def index_clients\n @client = Client.all\n end",
"def set_clientes_servico\n @clientes_servico = ClientesServico.find(params[:id])\n end",
"def show\n @cliente = Cliente.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cliente }\n end\n end",
"def clients\n @clients = Vendor.find(params[:id]).clients\n end",
"def show\n @clientepedido = Clientepedido.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clientepedido }\n end\n end",
"def index\n sanitized_params = parse_params(client_where_params)\n clients = Client.find_all(sanitized_params)\n render json: clients\n end",
"def show\n @client = clients.find(params[:id])\n end",
"def index\n @clients = Client.where(params.except(:action, :controller, :format)).to_a # TODO: remove .to_a when Rails to_json bug fixed\n respond_with(@clients)\n end",
"def index\n @page_count, @clients = Locomotive::Client.paginated(:page => (params[:page] || 1).to_i)\n display @clients\n end",
"def show\n client = Client.retrieve_by_id(params[:id])\n\n render json: client, serializer: SingleClientSerializer\n end",
"def index\n add_breadcrumb(I18n.t('model.list', model: Client.model_name.human))\n\n @clients = Client.all()\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n end",
"def index\n @clients = Client.page(params[:page] || 1).per(10)\n end",
"def index\n @cliente = Clienteempresa.where(empresa_id: current_user.empresa_id)\n end",
"def index\n clients = request do\n api.request(\n :expects => 200,\n :headers => headers,\n :method => :get,\n :path => \"/oauth/clients\"\n ).body\n end\n styled_header(\"OAuth Clients\")\n styled_array(clients.map { |client|\n [client[\"name\"], client[\"id\"], client[\"redirect_uri\"]]\n })\n end",
"def index \n @clients = ApiClient.all\n end",
"def show\n @client = Client.find(params[:id])\n if @client.nil?\n @clients = Client.all\n flash.now[:alert] = \"Les détails du client n'ont pas été trouvés\"\n render \"index\"\n end\n respond_to do |format|\n format.html #show.html.erb\n format.xml { render :xml => @client }\n end\n end",
"def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end",
"def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end",
"def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end",
"def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end",
"def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end",
"def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end",
"def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end",
"def list_clients(json_payload={})\n conn = @client.get do |req|\n req.url \"/api/v2/client/list?\"\n req.headers[\"Authorization\"] = @token\n req.params = json_payload\n end\n conn.body\n end",
"def index\n @client_infos = ClientInfo.all\n end",
"def show\r\n @client = Client.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @client }\r\n end\r\n end",
"def index\n @telefone_clientes = TelefoneCliente.paginate(:page => params[:page]).order('id DESC').por_nome(pesquisa)\n end",
"def index\n @cliente_registros = ClienteRegistro.all\n end",
"def index\n @clients = Client.all.paginate(page: params[:page], per_page: 4)\n end",
"def index\n @clientes = apply_scopes(Cliente).order(\"#{sort_column} #{sort_direction}\").page(params[:page]).per(NUMERO_POR_PAGINA)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clientes }\n end\n end",
"def lista_estoque()\n @client.get(Route.new([ROTA_DID_ESTOQUE]))\n end",
"def index\n \n @qa_clients = QaClient.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @qa_clients }\n end\n end",
"def show\n @cliente = Cliente.find(params[:id])\n\n end",
"def index\n @activacionclientets = Activacionclientet.all\n end",
"def show\n render json: @client\n end",
"def clients_index\n @clients = User.clients\n end",
"def index\n @otg_clients = OtgClient.all\n end",
"def index\n @clientes = Cliente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @clientes }\n end\n end",
"def index\n @cliente_documentos = ClienteDocumento.all\n end",
"def index\n @clients = Client.all.order(created_at: :desc)\n end",
"def index\n @clients = current_user.account.clients.search(params[:search]).order(sort_column + \" \" + sort_direction).paginate(:per_page => 10, :page => params[:page])\n\n @account = current_user.account\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n end",
"def details\n response = CreateSend.get \"/clients/#{client_id}.json\", {}\n Hashie::Mash.new(response)\n end",
"def recent\n if current_user.is_admin?\n @clients = Client.all\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @clients }\n end\n end",
"def index\n @empleado_clientes = EmpleadoCliente.all\n @empleados = Empleado.all\n @clientes = Cliente.all\n end",
"def index\r\n user = authenticate\r\n if user\r\n clients = Client.where('clientof = ?', user.id)\r\n render json: {clients: clients, message: 'Success', status: :ok}\r\n else\r\n render json: {message: 'Invalid token', status: :unauthorized}\r\n end\r\n end",
"def 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",
"def index\n if ((current_usuario.admin?) || (current_usuario.gerente?))\n @clientes = Cliente.all.order(:nome => :asc).paginate(:page => params[:page], :per_page => 10).search(params[:search],params[:empresa])\n else\n @clientes = Cliente.find_all_by_id(current_usuario.cliente.id)\n end\n end",
"def get_clients\n Client.get(:all).map{|c| c.to_ws}\n end",
"def index\n @applicationclients = Applicationclient.all\n end",
"def index\n @clients = current_user.is_admin ? Client.all : current_user.clients\n end",
"def show\n @client = Client.find(params[:id])\n @uuid = params[:uuid]\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end",
"def clients\n Appointments.all.collect do |appointment|\n appointment.client\n end\n end",
"def index\n\n if params[:ventas_seguimiento]\n cliente_id = params[:ventas_seguimiento][:cliente_id]\n @ventas_seguimientos = Ventas::Seguimiento.where(\"cliente_id = ?\",cliente_id).order(\"created_at DESC\").paginate(:page => params[:page], :per_page => 5)\n @seguimientos = Ventas::Seguimiento.new(:cliente_id => cliente_id)\n else\n @ventas_seguimientos = Ventas::Seguimiento.order(\"created_at DESC\").paginate(:page => params[:page], :per_page => 5)\n @seguimientos = Ventas::Seguimiento.new\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ventas_seguimientos }\n end\n end",
"def show\n\n @client = Client.find(params[:id])\n end",
"def index\n @clients = Client.search(params[:search]).order(sort_column + \" \" + sort_direction).page(params[:page]).per(10)\n respond_with(@clients)\n end",
"def index\n @cliente= Cliente.find(params[:cliente_id])\n @equipos = @cliente.equipos\n end",
"def show\n @clients = get_clients\n @client = Client.find(params[:id])\n\n respond_to do |format|\n #format.html # show.html.erb\n format.json { render json: @client }\n format.js\n end\n end",
"def index\n @antecedentes = Antecedente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @antecedentes }\n end\n end",
"def index\n @clientzs = Clientz.all\n end",
"def show\n @client = Client.find(params[:id])\n end",
"def show\n @client = Client.find(params[:id])\n end",
"def show\n @client = Client.find(params[:id])\n end",
"def show\n @client = Client.find(params[:id])\n end",
"def show\n @client = Client.find(params[:id])\n end",
"def show\n @tipocliente = Tipocliente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n #format.json { render json: @tipocliente }\n end\n end",
"def show\n @cliente = Cliente.find(params[:cliente_id])\n @pago = @cliente.pagos.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pago }\n end\n end",
"def clients\n response = User_GetClients()\n return [] if response.empty?\n unless response[\"Code\"].to_i != 0\n response[\"Client\"].collect{|c| Client.new(c[\"ClientID\"].to_i, c[\"Name\"])}\n else\n raise response[\"Code\"] + \" - \" + response[\"Message\"]\n end\n end",
"def show\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @cliente }\n format.html { render layout: nil }\n format.js\n end\n end",
"def sample_clients_list(facturama)\n puts \"===== Obtener los clientes - Inicio =====\"\n\n lst_clients = facturama.clients.list # Se obtiene una lista con todos los clientes\n lst_clients_count = lst_clients.count # Cantidad inicial de clientes\n\n\n\n puts \"Cantidad inicial de clientes: \" + lst_clients_count.to_s\n\n puts \"===== Obtener los clientes - Fin =====\"\n end"
] | [
"0.74022025",
"0.7126223",
"0.7027978",
"0.70100355",
"0.70100355",
"0.70100355",
"0.70100355",
"0.6962636",
"0.6891252",
"0.68833065",
"0.68600136",
"0.678503",
"0.67841595",
"0.67773056",
"0.67754275",
"0.6702336",
"0.6694574",
"0.6694574",
"0.6694574",
"0.6694574",
"0.6694574",
"0.6694574",
"0.6694574",
"0.6694574",
"0.6681268",
"0.6680886",
"0.66490084",
"0.66468173",
"0.66468173",
"0.66236407",
"0.66236407",
"0.66236407",
"0.65799457",
"0.6574431",
"0.65512335",
"0.6489159",
"0.6484837",
"0.6473952",
"0.64556456",
"0.6429372",
"0.6429106",
"0.6428477",
"0.641902",
"0.641597",
"0.6401465",
"0.63836366",
"0.63663757",
"0.6340795",
"0.63385564",
"0.63385564",
"0.63385564",
"0.63385564",
"0.63385564",
"0.63385564",
"0.63385564",
"0.6333775",
"0.63186246",
"0.6307007",
"0.6299019",
"0.6297587",
"0.6286763",
"0.6275062",
"0.6269303",
"0.62692535",
"0.625398",
"0.6252578",
"0.62429804",
"0.62256575",
"0.61939967",
"0.6187069",
"0.617618",
"0.6165591",
"0.6158759",
"0.61558384",
"0.61543125",
"0.6152303",
"0.61512184",
"0.613711",
"0.61367637",
"0.613259",
"0.6131145",
"0.6120627",
"0.61163014",
"0.6110634",
"0.61104333",
"0.6106726",
"0.6103838",
"0.61001956",
"0.6094246",
"0.6092361",
"0.6088458",
"0.6075109",
"0.60734284",
"0.60734284",
"0.60734284",
"0.60734284",
"0.6065566",
"0.60632783",
"0.60554415",
"0.60533",
"0.60485244"
] | 0.0 | -1 |
POST /tiendas_clientes POST /tiendas_clientes.json | def create
@tienda_cliente = @cliente.tiendas_clientes.build(tienda_cliente_params)
respond_to do |format|
if @tienda_cliente.save
format.html { redirect_to @tienda_cliente, notice: 'La tienda se creó exitosamente.' }
format.json { render :show, status: :created, location: @tienda_cliente }
else
format.html { render :new }
format.json { render json: @tienda_cliente.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n\n client = Cliente.new\n\n client.nombre = params[:nombre]\n client.cedula = params[:cedula]\n client.pagina = params[:pagina]\n\n client.dirrecion = params[:dirrecion]\n client.telefono = params[:telefono]\n \n client.sector = params[:sector]\n \n\n if client.save\n \n\n render(json: client,status: 201 ,location: client)\n else\n\n render(json: client.errors,status: 422 )\n\n end\n end",
"def asignar_cliente\n @usuario = Usuario.find(params[:responsable])\n @clientes = params[:cliente]\n respond_to do |format|\n if @usuario.responsable? or @usuario.transcriptor?\n for cliente in @clientes.values\n nuevo = Cliente.create(:usuario_id => @usuario.id, :cliente_id => cliente)\n @usuario.clientes << nuevo\n end \n format.html { redirect_to @usuario, notice: 'Clientes asignados satisfactoriamente'}\n else \n format.html { redirect_to update_usuario_path, notice: 'Error en servidor. Intente más tarde' }\n end\n end\n end",
"def create\n @client = Client.new(client_params)\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to clients_url, notice: 'El cliente se creó correctamente' }\n format.json { render :index, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client = Client.new(client_params)\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Cliente cadastrado com sucesso!' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client = Client.create(client_params)\n @clients = Client.all\n flash[:notice]=\"client créé avec succès!!!\"\n end",
"def create\n\n @client = Client.new(client_params)\n\n #se não aguardar carregar os dados\n if @client.state == '...'\n sweetalert_warning('Você precisa informar o CEP e aguardar os dados do endereço serem preenchidos.', 'Aviso!', useRejections: false)\n redirect_to new_client_path and return\n end\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Cliente criado com sucesso.' }\n format.json { render :show, status: :created, location: @client }\n sweetalert_success('Cliente cadastrado com sucesso.', 'Sucesso!', useRejections: false)\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n client= Client.new\n client.cedula= params[:cedula]\n client.sector= params[:sector]\n client.nombre= params[:nombre]\n client.telefono= params[:telefono]\n client.pagina= params[:pagina]\n client.direccion= params[:direccion]\n if client.save\n render(json: client, status: 201 , location: client)\n else \n render(json: client.errors, status: 422)\n end\n end",
"def create\n @trabajo = Trabajo.new(trabajo_params)\n @cliente = Cliente.find(params[:cliente_id])\n @trabajo.cliente = @cliente\n\n respond_to do |format|\n if @trabajo.save\n TrabajoMailer.detalle_trabajo(current_user, @cliente, @trabajo).deliver\n\n format.html { redirect_to cliente_path(@cliente), notice: 'Trabajo was successfully created.' }\n format.json { render :show, status: :created, location: @trabajo }\n else\n format.html { render :new }\n format.json { render json: @trabajo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new_asignar_cliente\n @usuario = Usuario.find(params[:format])\n @usuario.clientes.build\n @clientes = Usuario.where(:admin => 0)\n end",
"def create\n @cliente = Cliente.new(params[:cliente])\n \n respond_to do |format|\n if @cliente.save\n format.html { redirect_to edit_cliente_path(@cliente), notice: 'Cliente was successfully created.' }\n format.json { render json: @cliente , status: :created, location: @cliente }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client = Client.new(client_params)\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Cliente criado com sucesso.' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @clientes_servico = ClientesServico.new(clientes_servico_params)\n\n respond_to do |format|\n if @clientes_servico.save\n format.html { redirect_to @clientes_servico, notice: 'Clientes servico was successfully created.' }\n format.json { render action: 'show', status: :created, location: @clientes_servico }\n else\n format.html { render action: 'new' }\n format.json { render json: @clientes_servico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @cliente = Cliente.new(cliente_params)\n\n respond_to do |format|\n if @cliente.save\n #--ADICIONADO\n if params[:cliente][:perfil_ids]\n \t\t params[:cliente][:perfil_ids].each do |ss|\n \t\t\t @cliente.perfilclientes.create(:cliente_id => @cliente.id, :perfil_id => ss)\n \t\t end\n end\n #--ADICIONADO\n format.html { redirect_to clientes_url, notice: 'Cliente criado com sucesso.' }\n format.json { render action: 'show', status: :created, location: @cliente }\n else\n format.html { render action: 'new' }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client = Client.new(params[:client])\n\n respond_to do |format|\n if @client.save \n format.html { redirect_to @client, :notice => 'Klijent je uspjesno kreiran.' }\n format.json { render :json => @client, :status => :created, :location => @client }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @client.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @cliente = Cliente.new(params[:cliente])\n\n respond_to do |format|\n if @cliente.save\n format.html { redirect_to @cliente, notice: 'Cliente was successfully created.' }\n format.json { render json: @cliente, status: :created, location: @cliente }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @cliente = Cliente.new(params[:cliente])\n\n respond_to do |format|\n if @cliente.save\n format.html { redirect_to @cliente, notice: 'Cliente was successfully created.' }\n format.json { render json: @cliente, status: :created, location: @cliente }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @cliente = Cliente.new(cliente_params)\n\n respond_to do |format|\n if @cliente.save\n format.html { redirect_to @cliente, notice: 'El cliente se creó exitosamente.' }\n format.json { render :show, status: :created, location: @cliente }\n else\n format.html { render :new }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n #newParams = client_params.as_json\n flash[:notice] = \"Cliente creado\"\n @client = current_freelance.clients.create(client_params)\n\n #@client = current_freelance.clients\n #@client.name = params[:name]\n #@client.surname = params[:surname]\n #@client.username = params[:username]\n #@client.password = params[:password]\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to clients_path, notice: 'Client was successfully created.' }\n #format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @clientes = Cliente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clientes }\n end\n end",
"def create\n @cliente = Cliente.new\n if params[:type] == \"PessoaFisica\"\n @cliente.pessoa = PessoaFisica.new\n else\n @cliente.pessoa = PessoaJuridica.new\n end\n @cliente.assign_attributes(cliente_params)\n respond_to do |format|\n if @cliente.save\n format.html { redirect_to action: \"index\"}\n format.json { render json: @cliente.to_json(include: [:pessoa]) }\n else\n format.html { render :new }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @objeto = Cliente.new(cliente_params)\n\n respond_to do |format|\n if @objeto.save\n set_redireccion\n format.html { redirect_to @redireccion, notice: 'Cliente was successfully created.' }\n format.json { render :show, status: :created, location: @objeto }\n else\n format.html { render :new }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @contatos_cliente = ContatosCliente.new(contatos_cliente_params)\n\n respond_to do |format|\n if @contatos_cliente.save\n format.html { redirect_to @contatos_cliente, notice: 'Contatos cliente was successfully created.' }\n format.json { render :show, status: :created, location: @contatos_cliente }\n else\n format.html { render :new }\n format.json { render json: @contatos_cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @cliente = Cliente.new(cliente_params)\n\n respond_to do |format|\n if @cliente.save\n format.html { redirect_to @cliente, notice: 'Cliente fue creado con éxito.' }\n format.json { render :show, status: :created, location: @cliente }\n else\n format.html { render :new }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @cliente = Cliente.new(params[:cliente])\n\n respond_to do |format|\n if @cliente.save\n format.html { redirect_to @cliente, notice: 'Cliente criado com sucesso.' }\n format.json { render json: @cliente, status: :created, location: @cliente }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @cliente = Cliente.new(cliente_params)\n\n respond_to do |format|\n if @cliente.save\n format.html { redirect_to @cliente, notice: 'Cliente criado com sucesso.' }\n format.json { render :show, status: :created, location: @cliente }\n else\n format.html { render :new }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def client_params\n params.require(:client).permit(:nombre, :direccion, :telefono, :email)\n end",
"def index\n @clientes = Cliente.all\n end",
"def index\n @clientes = Cliente.all\n end",
"def index\n @clientes = Cliente.all\n end",
"def index\n @clientes = Cliente.all\n end",
"def cliente_params\n params.require(:cliente).permit(:apellido, :nombre, :cliente_id, :client_type, :domicilio, :telefono, :celular, :barrio, :estado, :id_rubro, :cuit, :correo)\n end",
"def set_clientes_servico\n @clientes_servico = ClientesServico.find(params[:id])\n end",
"def index\n get_clientes\n end",
"def cliente_params\n params.require(:cliente).permit(:cartao, :nome, :data_nasc, :obs, :rua, :acumulado, :activo, \n :profissao_id, :grupocliente_id, :localidade_id, :loja_id, :vendedor_id, :sexo_id,\n :contactos_attributes => [:id, :cliente_id, :tipocontacto_id, :contacto])\n end",
"def create\n @telefone_cliente = TelefoneCliente.new(telefone_cliente_params)\n\n respond_to do |format|\n if @telefone_cliente.save\n format.html { redirect_to @telefone_cliente, notice: 'Telefone cliente was successfully created.' }\n format.json { render :show, status: :created, location: @telefone_cliente }\n else\n format.html { render :new }\n format.json { render json: @telefone_cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client = Client.new(client_params)\n\n respond_to do |format|\n if @client.save\n\n format.js\n\n format.html { redirect_to root_path, notice: 'Vous avez bien été ajouté à notre newsletter' }\n\n format.json { render :show, status: :created, location: @client }\n\n else\n\n format.html { render :new }\n\n format.json { render json: @client.errors, status: :unprocessable_entity }\n\n end\n end\n end",
"def create\n @cliente = Cliente.new(cliente_params)\n\n respond_to do |format|\n if @cliente.save\n format.html {\n flash[:success] = 'Cliente creado satisfactoriamente'\n redirect_to @cliente\n }\n format.json { render :show, status: :created, location: @cliente }\n else\n format.html { render :new }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client = current_user.clients.new(client_params)\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client = current_user.clients.build(client_params)\n \n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Client was successfully created.' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client = Client.new(params[:client])\n @client.campaign_id = session[:campaign_id]\n @groups = Group.all.map {|g| [g.name, g.id]}\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, :notice => 'Client was successfully created.' }\n format.json { render :json => @client, :status => :created, :location => @client }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @client.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @cliente = Cliente.new(cliente_params)\n @cliente.conta = Conta.new(:saldo => 0)\n respond_to do |format|\n if @cliente.save\n format.html { redirect_to @cliente, notice: 'Novo Cliente cadastrado com sucesso.' }\n format.json { render action: 'show', status: :created, location: @cliente }\n else\n format.html { render action: 'new' }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @cliente = Cliente.new(params[:cliente])\n\n respond_to do |format|\n if @cliente.save\n format.html { redirect_to @cliente, notice: 'Cadastro realizado com sucesso' }\n format.json { render json: @cliente, status: :created, location: @cliente }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new_for_order\n @cliente = Cliente.new\n\n respond_to do |format|\n format.html\n format.json { render json: @cliente }\n end\n end",
"def create\n @client = current_user.clients.build(client_params)\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Client was successfully created.' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @cliente = Cliente.new(cliente_params)\n respond_to do |format|\n if @cliente.save\n @lote = Lote.new\n @clientes = Cliente.where(:empresa => session[:selected_company])\n @cliente = Cliente.last\n format.js { render \"lotes/ajaxResults\" }\n format.html { redirect_to @cliente, notice: \"Cliente guardado con éxito.\" }\n format.json { render :show, status: :created, location: @cliente }\n else\n format.html { render :new }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n format.js { render \"lotes/ajaxResultsValidates\" }\n end\n end\n end",
"def create\n @client = Client.new(client_params)\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'client was successfully created.' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client = Client.new(params[:client])\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to clients_path, notice: 'Client was successfully created.' }\n format.json { render json: @client, status: :created, location: @client }\n else\n format.html { render action: \"new\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client = current_user.clients.build(client_params)\n\n if @client.save\n render :create, status: :created\n CareeerMailer.trial_end(current_user.email, @client).deliver_later\n CareeerMailer.welcome(current_user.email, @client).deliver_later\n else\n render json: @client.errors, status: :unprocessable_entity\n end\n end",
"def create\n @client = Client.new(client_params)\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to clients_path, notice: 'Client was successfully created.' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_ordem\n @cliente = Cliente.new(params[:cliente])\n\n respond_to do |format|\n if @cliente.save\n\t@ordem = Ordem.new(:cliente_id => @cliente.id, :user_id => current_user.id)\n\tif @ordem.save\n\t\tformat.html { redirect_to @ordem, notice: 'O cliente foi adicionado com sucesso.' }\n\t\tformat.json { render json: @cliente, status: :created, location: @cliente }\n\telse\n\t\tformat.html { render action: \"index\" }\n \tformat.json { render json: @cliente.errors, status: :unprocessable_entity }\n\tend\n else\n format.html { render action: \"new_for_order\" }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ventas_agrupador_cliente = Ventas::AgrupadorCliente.new(ventas_agrupador_cliente_params)\n\n respond_to do |format|\n if @ventas_agrupador_cliente.save\n format.html { redirect_to @ventas_agrupador_cliente, notice: 'Agrupador cliente was successfully created.' }\n format.json { render :show, status: :created, location: @ventas_agrupador_cliente }\n else\n format.html { render :new }\n format.json { render json: @ventas_agrupador_cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ventas_agrupador_cliente = Ventas::AgrupadorCliente.new(ventas_agrupador_cliente_params)\n\n respond_to do |format|\n if @ventas_agrupador_cliente.save\n format.html { redirect_to @ventas_agrupador_cliente, notice: 'Agrupador cliente was successfully created.' }\n format.json { render :show, status: :created, location: @ventas_agrupador_cliente }\n else\n format.html { render :new }\n format.json { render json: @ventas_agrupador_cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def serialized_clients(_data)\n ActiveModel::ArraySerializer.new(_data, each_serializer: Api::V1::ClientsSerializer, root: 'clients')\n end",
"def create\n @client = Client.new(params[:client])\n \n respond_to do |format|\n if @client.save\n format.html { redirect_to(@client, :notice => \"Client was successfully created. #{undo_link}\") }\n end\n respond_with(@client)\n end\n end",
"def create\n @client = Client.new(client_params)\n @client.user_id = current_user.id\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Client record was successfully created.' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client = Client.new(client_params)\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to admin_client_path(@client, search: params[:search], page: params[:page]),\n notice: 'Клиент успешно создан.' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client = Client.create(client_params)\n # byebug\n if @client.valid?\n render json: { client: ClientSerializer.new(@client) }, status: :created\n else\n render json: { error: 'failed to create account' }, status: :not_acceptable\n end \n end",
"def create\n @client = Client.new(client_params)\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Client was successfully created.' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tipocliente = Tipocliente.new(params[:tipocliente])\n\n respond_to do |format|\n if @tipocliente.save\n format.html { redirect_to @tipocliente, :notice => 'Tipocliente was successfully created.' }\n format.json { render json: @tipocliente, status: :created }\n else\n format.html { render :action => \"new\" }\n format.json { render json: @tipocliente.errors }\n end\n end\n end",
"def create\n @client = Client.new(params[:client])\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Client was successfully created.' }\n format.json { render json: @client, status: :created, location: @client }\n else\n format.html { render action: \"new\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client = Client.new(params[:client])\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Client was successfully created.' }\n format.json { render json: @client, status: :created, location: @client }\n else\n format.html { render action: \"new\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client = Client.new(params[:client])\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Client was successfully created.' }\n format.json { render json: @client, status: :created, location: @client }\n else\n format.html { render action: \"new\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client = Client.new(client_params)\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Client was successfully created.' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client = Client.new(client_params)\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Client was successfully created.' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client = Client.new(client_params)\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Client was successfully created.' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @vendedor_cliente = VendedorCliente.new(vendedor_cliente_params)\n\n respond_to do |format|\n if @vendedor_cliente.save\n format.html { redirect_to @vendedor_cliente, notice: 'Vendedor cliente was successfully created.' }\n format.json { render :show, status: :created, location: @vendedor_cliente }\n else\n format.html { render :new }\n format.json { render json: @vendedor_cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_client(options = {})\n post(:clients, clients: [options]).pop\n end",
"def create\n puts 'AQQQQQUUUUUUUIIIIII'\n json = ActiveSupport::JSON.decode(params[:pessoa])\n puts json\n @pessoa = Pessoa.new(json)\n # @address = Address.new(params[:address])\n\n # @client.addresses = @address\n\n respond_to do |format|\n if @pessoa.save\n format.html { redirect_to @pessoa, notice: 'Pessoa was successfully created.' }\n format.json { render json: @pessoa, status: :created, location: @pessoa }\n else\n format.html { render action: \"new\" }\n format.json { render json: @pessoa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def client_params\n params.require(:client).permit(:cuild, :nombre, :iva, :mail)\n end",
"def create\n @clientsOffers = ClientsOffers.new(params[:clientsOffers])\n\n respond_to do |format|\n if @clientsOffers.save\n format.html { redirect_to @clientsOffers, notice: 'ClientsOffers was succesfully created.' }\n format.json { render json: @clientsOffers, status: :created, location: @clientsOffers }\n else\n format.html { render action: \"new\" }\n format.json { render json: @clientsOffers.errors, status: :unprocesable_entity }\n end\n end\n end",
"def create\n @client = Client.new(client_params)\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: \"Client was successfully created.\" }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def client_params\n params.require(:client).permit(:name, :recruiter_id, :user_ids => [])\n end",
"def index\n @contatos_clientes = ContatosCliente.all\n end",
"def create\n @otg_client = OtgClient.new(otg_client_params)\n\n respond_to do |format|\n if @otg_client.save\n format.html { redirect_to @otg_client, notice: 'Otg client was successfully created.' }\n format.json { render :show, status: :created, location: @otg_client }\n else\n format.html { render :new }\n format.json { render json: @otg_client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @cliente = Cliente.new(params[:cliente])\n respond_to do |format|\n if @cliente.save\n format.html { render :json => {:success => true} }\n format.xml { render :xml => @cliente, :status => :created, :location => @cliente }\n else\n format.html { render :json => ( (@cliente.errors.full_messages.join(\".<br />\").to_s + \".\").to_json ) } unless @cliente.errors.empty?\n end\n end\n end",
"def create\n\n @client = Client.create(client_params)\n @sale = Sale.new(sale_params.merge(usuario: current_user, cliente: @client, copy_id: params[:copy_id], estado: sale_params[:estado].to_i))\n\n respond_to do |format|\n if @sale.save\n @sale.verificar_estado\n format.html { redirect_to sales_path, notice: 'Venta creada con exito.' }\n format.json { render :show, status: :created, location: @sale }\n else\n format.html { render :new }\n format.json { render json: @sale.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @vendedor_clientes = VendedorCliente.all\n end",
"def index\n @clientes_servicos = ClientesServico.all\n end",
"def create\n @cliente_registro = ClienteRegistro.new(cliente_registro_params)\n\n respond_to do |format|\n if @cliente_registro.save\n format.html { redirect_to @cliente_registro, notice: 'Cliente registro was successfully created.' }\n format.json { render :show, status: :created, location: @cliente_registro }\n else\n format.html { render :new }\n format.json { render json: @cliente_registro.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @clients = Client.all\n @uuid = params[:uuid]\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n end",
"def create\n @client = current_user.clients.new(client_params)\n\n @client.save\n redirect_to @client\n end",
"def index\n @clients = current_user.clients\n render json: @clients\n end",
"def create\n @clientes = Cliente.all\n @sucursales = Sucursal.where(\"cliente_id = ?\", params[:contacto][:cliente_id])\n @contacto = Contacto.new(contacto_params)\n #@contacto.cliente_id = params[:contacto][:cliente_id]\n @contacto.sucursal_id = params[:contacto][:sucursal_id]\n #@datosgenerales = Datosgenerale.where(\"cliente_id = ?\", Cliente.find_by_id(params[:contacto][:cliente_id]) )\n @datosgenerales = Datosgenerale.where(cliente_id: params[:cliente_id])\n if(params[:email] != \"\")\n @contacto.email=params[:email]\n else\n @contacto.email=nil\n end\n respond_to do |format|\n if @contacto.save\n save_contact_accounts(@contacto.id)\n save_contact_clients @contacto.id\n format.html { redirect_to @contacto, notice: 'Contacto ha sido creado exitosamente' }\n format.json { render action: 'show', status: :created, location: @contacto }\n else\n format.html { render action: 'new', :layout => \"layout_2\" }\n format.json { render json: @contacto.errors, status: :unprocessable_entity }\n end\n\n\n end\n end",
"def new\n @client = Client.new\n 1.times { @client.phones.build }\n 1.times { @client.emails.build }\n 1.times { @client.addresses.build }\n #@phone = Phone.new\n #@email = Email.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @client}\n end\n end",
"def new\n \n @selecciones = Seleccion.where(\"cliente_id = ?\",usuario_actual.id)\n respond_to do |format|\n unless @selecciones.empty?\n @peso_total = Seleccion.peso_total(usuario_actual.id)\n @precio_total = Seleccion.precio_total(usuario_actual.id)\n @tarjetas = usuario_actual.tdc\n @orden = Orden.new(:direccion_entrega=>usuario_actual.direccion)\n t = Time.now\n fecha = t.strftime(\"%Y-%m-%d\")\n client = Savon::Client.new(\"http://192.168.1.121/DistribuidorFIF/webservices/servicio.php?wsdl\")\n preorden = \"<solicitud_pedido>\n <num_orden>001</num_orden>\n <nombre_comercio>Tukiosquito</nombre_comercio>\n <fecha_solicitud>\"+fecha.to_s+\"</fecha_solicitud>\n <nombre_cliente>\"+usuario_actual.nombre+\" \"+usuario_actual.apellido+\"</nombre_cliente>\n <direccion_comercio>\n <avenida>Sucre</avenida>\n <calle>-</calle>\n <edificio_casa>CC Millenium</edificio_casa>\n <local_apt>C1-15</local_apt>\n <parroquia>Leoncio Martinez</parroquia>\n <municipio>Sucre</municipio>\n <ciudad>Caracas</ciudad>\n <estado>Miranda</estado>\n <pais>Venezuela</pais>\n </direccion_comercio>\n <direccion_destino>\n <avenida>Santa Rosa</avenida>\n <calle>Tierras Rojas</calle>\n <edificio_casa>Villa Magica</edificio_casa>\n <local_apt>69</local_apt>\n <parroquia> </parroquia>\n <municipio>Zamora</municipio>\n <ciudad>Cua</ciudad>\n <estado>Miranda</estado>\n <pais>Venezuela</pais>\n </direccion_destino>\"\n @selecciones.each do |seleccion|\n p = Producto.find(seleccion.producto_id)\n preorden = preorden+\"\n <articulo>\n <id>\"+p.id.to_s+\"</id>\n <descripcion>\"+p.descripcion+\"</descripcion>\n <peso>\"+p.peso.to_s+\"</peso>\n <cantidad>\"+seleccion.cantidad.to_s+\"</cantidad>\n <precio>\"+p.precio.to_s+\"</precio>\n </articulo>\"\n end\n preorden = preorden+\"</solicitud_pedido>\"\n response = client.request :ejemplo, body: { \"value\" => preorden } \n if response.success? \n respuesta = response.to_hash[:ejemplo_response][:return]\n datos = XmlSimple.xml_in(respuesta)\n end\n\n @precio_envio = datos[\"num_orden\"][0]\n #@arreglo = XmlSimple.xml_in('')\n #@xml = XmlSimple.xml_out(@arreglo, { 'RootName' => 'solicitud_pedido' })\n #url = 'http://192.168.1.101/Antonio/tukyosquito/proyecto/servicio/servicio.php'\n #cotizacion = SOAP::RPC::Driver.new(url)\n #cotizacion.add_method('obtener','asd')\n #tdc = Tarjeta.where(\"id = ? AND cliente_id = ?\",params[:orden][:tarjeta_id],usuario_actual.id)\n #@respuesta = cotizacion.obtener('123')\n format.html # new.html.erb\n else\n format.html { redirect_to carrito_path, notice: 'No tiene productos agregados al carro de compras para generar una orden.' }\n end\n end\n end",
"def cliente_params\n params.require(:cliente).permit(:tipo_pessoa, :nome, :documento, :contato, :endereco, :complemento, :bairro, :cidade, :cep, :uf, :telefone, :celular, :data_nascimento, :email, :observacoes)\n end",
"def index\n @clients = Client.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n\n end",
"def create\n @client = Client.new(client_params)\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to(@client, :notice => 'Le client a bien été créé.') }\n format.xml { render :xml => @client, :status => :created, :location => @client }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @client.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def client_create(global_options, options)\n result = Excon.post(\n \"#{global_options[:fenton_server_url]}/clients.json\",\n body: client_json(options),\n headers: { 'Content-Type' => 'application/json' }\n )\n\n [result.status, JSON.parse(result.body)]\n end",
"def new\n @client = Client.new\n # @client.contacts.build\n # @client.meetings.build\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client }\n format.js\n end\n end",
"def client_params\n params.require(:client).permit(:Prenom, :Nom, :DateNaissance, :nas, :Adress_id, :NombresEnfants, :CompteTaxesProprietaire,\n Etude_attributes: [:id, :_destroy, :SecteurEtudes, :Niveau, :DateDebut, :DateComplition, :client_id],\n Adress_attributes: [:id, :_destroy, :Rue, :Ville, :NumeroCivique, :CodePostal, :Province ],\n Institution_attributes: [:id, :_destroy, :Nom, :client_id])\n end",
"def index\n @clients = Client.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n end",
"def index\n @clients = Client.all\n render json: @clients\n end",
"def cliente_params\n params.require(:cliente).permit(:nome, :celular, :rg, :telefone_empresa, :numero, :bairro, :cidade, :celular_empresa, :email_empresa, :bloqueado, :telefone, :ramal, :endereco, :complemento, :empresa_id, :sexo, :data_de_nascimento, :data_de_pagamento, :setor, :cargo, :cpf)\n end",
"def create\n \n @endereco = Endereco.new(params[:endereco])\n\t@endereco.cliente_id=session[:usuario_id]\n\t\n respond_to do |format|\n if @endereco.save\n format.html { redirect_to \"/dados\", notice: 'O endereço foi cadastrado com sucesso!' }\n format.json { render json: @endereco, status: :created, location: @endereco }\n else\n format.html { render action: \"new\" }\n format.json { render json: @endereco.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n render json: Client.all\n end",
"def cliente_params\n params.require(:cliente).permit(:nombre, :email, :direccion, :telefono, :zona_id, :usuario_id, :estado, :creado_por, :actualizado_por)\n end",
"def create\n cliente = Client.find(sale_params[:client_id])\n temp = sale_params\n temp[\"client_id\"] = cliente.id\n @sale = Sale.new(temp)\n\n respond_to do |format|\n if @sale.save\n format.html { redirect_to :sales, notice: 'Venta Creada' }\n format.json { render :show, status: :created, location: @sale }\n else\n format.html { render :new }\n format.json { render json: @sale.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @cliente = Cliente.new(cliente_params)\n\n if @cliente.save\n @error = false\n @message = \"Se ha guardado el cliente\"\n get_clientes\n else\n @error = true\n @message = \"Ha ocurrido un problema al tratar de guardar el cliente. #{@cliente.errors.full_messages.to_sentence}\"\n end\n\n render 'reload_list', format: :js\n end",
"def create\n @client = Client.new(params[:client])\n flash[:notice] = 'Client was successfully created.' if @client.save\n respond_with(@client)\n end"
] | [
"0.6540972",
"0.6527762",
"0.6494968",
"0.64197373",
"0.64039224",
"0.6350697",
"0.63330895",
"0.6303754",
"0.6212286",
"0.617808",
"0.6140775",
"0.61273205",
"0.6126304",
"0.61060154",
"0.6095872",
"0.6095872",
"0.6088495",
"0.6042369",
"0.6039275",
"0.6033399",
"0.60304296",
"0.59848076",
"0.5982494",
"0.59812534",
"0.5976013",
"0.5973357",
"0.59732145",
"0.59732145",
"0.59732145",
"0.59732145",
"0.59574467",
"0.5955401",
"0.5944633",
"0.5941937",
"0.5921272",
"0.5920038",
"0.5918781",
"0.5906274",
"0.589403",
"0.5893092",
"0.5889634",
"0.58874744",
"0.58666706",
"0.58476365",
"0.5844069",
"0.58392644",
"0.58387667",
"0.5827391",
"0.58269817",
"0.58260393",
"0.58252966",
"0.58252966",
"0.58252007",
"0.5824375",
"0.5822664",
"0.5817918",
"0.5803703",
"0.5801863",
"0.58010453",
"0.57974607",
"0.57974607",
"0.57974607",
"0.5795526",
"0.5795526",
"0.5795526",
"0.57913876",
"0.5787998",
"0.5787008",
"0.5781878",
"0.5780168",
"0.577482",
"0.5773863",
"0.5768539",
"0.5764949",
"0.57446545",
"0.57421106",
"0.573869",
"0.57286155",
"0.5726759",
"0.57264805",
"0.57053417",
"0.5705304",
"0.5703857",
"0.5703313",
"0.57021445",
"0.56970525",
"0.5694447",
"0.56864464",
"0.5684945",
"0.5674932",
"0.56741977",
"0.56692964",
"0.5668303",
"0.56605273",
"0.56598496",
"0.5655888",
"0.56407475",
"0.5640695",
"0.5627282",
"0.562576"
] | 0.6701628 | 0 |
PATCH/PUT /tiendas_clientes/1 PATCH/PUT /tiendas_clientes/1.json | def update
respond_to do |format|
if @tienda_cliente.update(tienda_cliente_params)
format.html { redirect_to @tienda_cliente, notice: 'La tienda se actualizó exitosamente.' }
format.json { render :show, status: :ok, location: @tienda_cliente }
else
format.html { render :edit }
format.json { render json: @tienda_cliente.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to @client, :notice => 'El cliente se ha actualizado correctamente.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @client.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n client=Client.find_by_id params[:id]\n if client!= nil\n client.cedula=params[:cedula] ? params[:cedula]: client.cedula\n client.sector=params[:sector] ? params[:sector]: client.sector\n client.nombre=params[:nombre] ? params[:nombre]: client.nombre\n client.telefono=params[:telefono] ? params[:telefono]: client.telefono\n client.pagina=params[:pagina] ? params[:pagina]: client.pagina\n client.direccion=params[:direccion] ? params[:direccion]: client.direccion\n if client.save\n render(json: client, status: 201)\n end \n else\n render(json: client.errors, status: 404)\n end \n end",
"def update\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n if @cliente.update_attributes(params[:cliente])\n format.html { redirect_to @cliente, notice: 'Cliente atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @clientes_servico.update(clientes_servico_params)\n format.html { redirect_to @clientes_servico, notice: 'Clientes servico was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @clientes_servico.errors, status: :unprocessable_entity }\n end\n end\n end",
"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 @cliente, notice: 'Cliente 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",
"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 @cliente, notice: 'Cliente was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"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 @cliente, notice: 'Cliente was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"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 edit_cliente_path(@cliente), notice: 'Cliente was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @objeto.update(cliente_params)\n set_redireccion\n format.html { redirect_to @redireccion, notice: 'Cliente 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",
"def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to @client, :notice => 'Klijent je uspjesno izmjenjen.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @client.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @clientepedido = Clientepedido.find(params[:id])\n\n respond_to do |format|\n if @clientepedido.update_attributes(params[:clientepedido])\n format.html { redirect_to @clientepedido, notice: 'EL pedido fue actualizado.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @clientepedido.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tipocliente = Tipocliente.find(params[:id])\n\n respond_to do |format|\n if @tipocliente.update_attributes(params[:tipocliente])\n format.html { redirect_to @tipocliente, :notice => 'Tipocliente was successfully updated.' }\n format.json { render json: @tipocliente }\n else\n format.html { render :action => \"edit\" }\n format.json { render json: @tipocliente.errors }\n end\n end\n end",
"def update\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to @client, notice: 'Cliente atualizado com sucesso!' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to @client, notice: 'Cliente atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @cliente.update(cliente_params)\n #--ADICIONADO\n \t @cliente.perfilclientes.destroy_all()\n if params[:cliente][:perfil_ids]\n \t\tparams[:cliente][:perfil_ids].each do |ss|\n \t\t\t@cliente.perfilclientes.create(:cliente_id => @cliente.id, :perfil_id => ss)\n \t\tend\n end\n #--ADICIONADO\n format.html { redirect_to clientes_url, notice: 'Cliente actualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @client.update(client_params)\n render json: @client\n end",
"def update\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to clients_url, notice: 'La información del cliente se actualizó correctamente.' }\n format.json { render :index, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @cliente.update(cliente_params)\n format.html { redirect_to @cliente, notice: 'Cliente atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @telefone_cliente.update(telefone_cliente_params)\n format.html { redirect_to @telefone_cliente, notice: 'Telefone cliente was successfully updated.' }\n format.json { render :show, status: :ok, location: @telefone_cliente }\n else\n format.html { render :edit }\n format.json { render json: @telefone_cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n if @cliente.update_attributes(params[:cliente])\n format.html { render :json => {:success => true} }\n format.xml { render :xml => @cliente, :status => :created, :location => @cliente }\n else\n format.html { render :json => ( (@cliente.errors.full_messages.join(\".<br />\").to_s + \".\").to_json ) } unless @cliente.errors.empty?\n end\n end\n end",
"def update\n respond_to do |format|\n\t\t\t@cliente.attributes = cliente_params\n\t\t\tif @cliente.vendedor_id_changed?\n\t\t\t\t@cliente.fecha_asignacion = Time.now\n\t\t\tend\n if @cliente.save\n format.html { redirect_to @cliente, notice: 'El cliente se actualizó exitosamente.' }\n format.json { render :show, status: :ok, location: @cliente }\n else\n format.html { render :edit }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n #se não aguardar carregar os dados\n if client_params[:state] == '...'\n sweetalert_warning('Você precisa informar o CEP e aguardar os dados do endereço serem preenchidos.', 'Aviso!', useRejections: false)\n redirect_to edit_client_path(@client) and return\n end\n\n respond_to do |format|\n\n if @client.update(client_params)\n format.html { redirect_to @client, notice: 'Cliente atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @client }\n sweetalert_success('Cliente atualizado com sucesso.', 'Sucesso!', useRejections: false)\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @cliente.update(cliente_params)\n format.html { redirect_to @cliente, notice: 'Cliente modificado com sucesso.' }\n format.json { render :show, status: :ok, location: @cliente }\n else\n format.html { render :edit }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @contatos_cliente.update(contatos_cliente_params)\n format.html { redirect_to @contatos_cliente, notice: 'Contatos cliente was successfully updated.' }\n format.json { render :show, status: :ok, location: @contatos_cliente }\n else\n format.html { render :edit }\n format.json { render json: @contatos_cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @cliente.update(cliente_params)\n format.html { redirect_to funcionarios_path, notice: 'Cliente alterado com sucesso' }\n format.json { render :show, status: :ok, location: @cliente }\n else\n format.html { render :edit }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_client\n\t\t@client = Client.find(params[:id])\n\n\t \trespond_to do |format|\n\t\t if @client.update_attributes(client_update_params)\n\t\t format.html { redirect_to(@client, :notice => 'Entry was successfully updated.') }\n\t\t format.json { respond_with_bip(@client) }\n\t\t else\n\t\t format.html { render :action => \"edit\" }\n\t\t format.json { respond_with_bip(@client) }\n\t\t end\n\n \t end\n\tend",
"def update\n respond_to do |format|\n if @cliente.update(cliente_params)\n format.html { redirect_to @cliente, notice: 'Cliente atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @cliente }\n else\n format.html { render :edit }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch(type, info)\n path, info = type_info(type, :path), force_case(info)\n ida = type == :client ? 'client_id' : 'id'\n raise ArgumentError, \"info must include #{ida}\" unless id = info[ida]\n hdrs = headers\n if info && info['meta'] && (etag = info['meta']['version'])\n hdrs.merge!('if-match' => etag)\n end\n reply = json_parse_reply(@key_style,\n *json_patch(@target, \"#{path}/#{Addressable::URI.encode(id)}\", info, hdrs))\n\n # hide client endpoints that are not quite scim compatible\n type == :client && !reply ? get(type, info['client_id']): reply\n end",
"def update\n @productos = Car.where(:pedidoID => params[:id])\n respond_to do |format| \n if @pedido.update(pedido_params)\n \n format.html { redirect_to \"/\", notice: 'Pedido was successfully updated.' }\n format.json { render :show, status: :ok, location: @pedido }\n RestClient.post \"https://api:key-e7d79c66e74391fdf48b657624f23ddc\"\\\n \"@api.mailgun.net/v3/sandboxb9c2dadab0ea49f6b7130d1091646c59.mailgun.org/messages\",\n :from => \"Sistema de Pedidos <mailgun@sandboxb9c2dadab0ea49f6b7130d1091646c59.mailgun.org>\",\n #:to => \"proteina@sinergroup.com.mx\",\n :to => \"proteina@sinergroup.com.mx\",\n :subject => \"Solicitud de Pedido\",\n :html => (render_to_string(template: \"../views/pedidos/email\")).to_str\n else\n format.html { render :edit }\n format.json { render json: @pedido.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @client = Client.find(params[:id])\n flash[:success] = \"Cliente editado exitosamente\" if @client.update_attributes(params[:client])\n respond_with(@client)\n end",
"def set_clientes_servico\n @clientes_servico = ClientesServico.find(params[:id])\n end",
"def update\n\n params[:client][:contact_ids] ||= []\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to @client, notice: 'Client was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @cliente.update(cliente_params)\n format.html { redirect_to @cliente, notice: 'Cliente was successfully updated.' }\n format.json { render :show, status: :ok, location: @cliente }\n else\n format.html { render :edit }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @cliente.update(cliente_params)\n @cliente.reload\n format.html { redirect_to clientes_path }\n flash[:success] = \"Actualización correcta.\"\n format.json { render :show, status: :ok, location: @cliente }\n else\n format.html { render :edit }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @cliente.update(cliente_params)\n format.html { redirect_to @cliente, notice: 'Cliente fue actualizado con éxito.' }\n format.json { render :show, status: :ok, location: @cliente }\n else\n format.html { render :edit }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_client\n\t\tif(request.method == \"OPTIONS\")\n\t\t\trespond({status: 0})\n\t\telsif request.method == \"POST\"\n\t\t\trespond(update_user_client(params))\n\t\tend\n\tend",
"def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to clients_path, notice: 'Client was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to clients_path, notice: 'Client was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @client = Client.find params[:id]\n respond_to do |format|\n if @client.update_attributes(client_params)\n format.html { redirect_to client_path(@client), notice: 'Cliente fue Actualizado correctamente.' }\n else\n format.html { render :edit }\n end\n end\n end",
"def update\n respond_to do |format|\n if @cliente.update(cliente_params)\n format.html { redirect_to @cliente, notice: 'EL cliente fue actualizado.' }\n format.json { render :show, status: :ok, location: @cliente }\n else\n format.html { render :edit }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to @client, notice: 'Client was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to @client, notice: 'Client was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @clients = get_clients\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n @clients = get_clients\n #format.html { redirect_to @client, notice: 'Client was successfully updated.' }\n format.json { head :no_content }\n format.js\n else\n #format.html { render action: \"index\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end",
"def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to @client, notice: 'Client was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @trabajo.update(trabajo_params)\n format.html { redirect_to cliente_path(@cliente), notice: 'Trabajo was successfully updated.' }\n format.json { render :show, status: :ok, location: cliente_trabajo_path(@cliente, @trabajo) }\n else\n format.html { render :edit }\n format.json { render json: @trabajo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(client_params)\n format.html { redirect_to(@client, :notice => 'Les informations du client ont été mises à jour.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @client.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n if @cliente.update_attributes(params[:cliente])\n flash[:notice] = t('general.messages.update_success', model_name: t('activerecord.models.cliente'))\n format.html { redirect_to edit_cliente_path(@cliente) }\n format.json { head :no_content }\n format.js { render action: 'save.js.erb' }\n else\n flash.now[:error] = t('general.messages.update_error', model_name: t('activerecord.models.cliente'))\n format.html { render action: \"edit\" }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n format.js { render action: 'save.js.erb' }\n end\n end\n end",
"def update\n respond_to do |format|\n if @cliente.update(cliente_params)\n puts @cliente.data_nascimento\n format.html { redirect_to @cliente, notice: 'Cliente foi alterado com sucesso.' }\n format.json { render :show, status: :ok, location: @cliente }\n else\n format.html { render :edit }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @ventas_agrupador_cliente.update(ventas_agrupador_cliente_params)\n format.html { redirect_to @ventas_agrupador_cliente, notice: 'Agrupador cliente was successfully updated.' }\n format.json { render :show, status: :ok, location: @ventas_agrupador_cliente }\n else\n format.html { render :edit }\n format.json { render json: @ventas_agrupador_cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @ventas_agrupador_cliente.update(ventas_agrupador_cliente_params)\n format.html { redirect_to @ventas_agrupador_cliente, notice: 'Agrupador cliente was successfully updated.' }\n format.json { render :show, status: :ok, location: @ventas_agrupador_cliente }\n else\n format.html { render :edit }\n format.json { render json: @ventas_agrupador_cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n authorize! :update, Client\n load_client\n build_client\n save_client or render :edit\n end",
"def update\n respond_to do |format|\n if @cliente.update(cliente_params)\n format.html {\n flash[:success]='Cliente actualizado Satisfactoriamente'\n redirect_to @cliente\n }\n format.json { render :show, status: :ok, location: @cliente }\n else\n format.html { render :edit }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to @client, notice: 'Client a été mise à jour.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @cliente.pessoa = @cliente.pessoa.specific\n if @cliente.update(cliente_params)\n redirect_to @cliente, notice: \"Cliente alterado com sucesso\"\n else\n render :edit\n end\n end",
"def update\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n if @cliente.update_attributes(params[:cliente])\n flash[:notice] = 'Cliente was successfully updated.'\n format.html { redirect_to(clientes_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @cliente.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @otg_client.update(otg_client_params)\n format.html { redirect_to @otg_client, notice: 'Otg client was successfully updated.' }\n format.json { render :show, status: :ok, location: @otg_client }\n else\n format.html { render :edit }\n format.json { render json: @otg_client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @client = current_user.clients.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(client_params)\n format.html { redirect_to @client, notice: 'Event was successfully updated.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @contact = Contact.find(params[:id])\n if params[:contact][:clientId] == \"\"\n params[:contact][:clientId] = nil\n end \n\n respond_to do |format|\n if @contact.update_attributes(params[:contact])\n format.html { redirect_to @contact, notice: 'Contato atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @contact.errors, status: :unprocessable_entity }\n end\n end\n end",
"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(clientes_path, :notice => \"El cliente #{@cliente.nombre} ha sido actualizado satisfactoriamente.\") }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @cliente.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n begin\n ActiveRecord::Base.transaction do\n @client.update!(client_params)\n @client.address.update!(address_params)\n end\n format.html { redirect_to @client, notice: 'Client was successfully updated.' }\n format.json { render :show, status: :ok, location: @client }\n rescue\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n succeess_redirect_path = URI(request.referer).path.gsub 'edit', ''\n if @client.update(client_params)\n format.html { redirect_to succeess_redirect_path, notice: 'Client was successfully updated.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { redirect_to URI(request.referer).path }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n params[:client][:version] = ENV[\"VERSION\"]\r\n params[:client][:username] = current_user.username\r\n @client = Client.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @client.update_attributes(client_params)\r\n format.html { redirect_to @client, notice: 'Client 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: @client.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n respond_to do |format|\n if @servico_pacote.update(servico_pacote_params)\n format.html { redirect_to @servico_pacote, notice: 'Pacote was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @servico_pacote.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n\n if @client.update(client_params)\n format.html { redirect_to clients_path, notice: 'Client was successfully updated.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to(@client, :notice => \"Client was successfully updated. #{undo_link}\") }\n else\n format.html { render :action => \"edit\" }\n end\n end\n end",
"def update\n @tcliente = Tcliente.find(params[:id])\n\n respond_to do |format|\n if @tcliente.update_attributes(params[:tcliente])\n format.html { redirect_to(@tcliente, :notice => 'Tcliente was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tcliente.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n \tif params[:client][:logo].blank?\n \t\tparams[:client][:logo] = @client.logo\n \telse\n \t\tnew_file_name = upload_file(params[:client][:logo], \"/public/files/logo_files/\")\n\t \tFileUtils.rm Dir[\"#{Rails.root}/public/files/logo_files/\"+@client.logo.to_s]\n\t \tparams[:client][:logo] = new_file_name\n \tend\n\t \tparams[:client][:updated_by] = current_user.id\n @client.attributes = params[:client]\n if @client.save\n format.html { redirect_to clients_path, notice: 'Client was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @client = Client.find(params[:id])\n respond_to do |format|\n if @client.update_attributes(params[:client])\n \n flash[:notice] = 'Client was successfully updated.'\n format.html { redirect_to(@client) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @client.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @client = Client.find(params[:client_id])\n @casenote = Casenote.find(params[:id])\n\n respond_to do |format|\n if @casenote.update_attributes(params[:casenote])\n flash[:notice] = 'Casenote was successfully updated.'\n format.html { redirect_to(@client, @casenote) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @casenote.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @client.update_attributes(client_params)\n @clients = Client.all\n flash[:notice]=\"Client Modifier avec succès!!!\"\n end",
"def update\n @cliente = Cliente.find(params[:id])\n localidad_new\n\n nombre_antiguo= @cliente.nombre\n apellido_antiguo= @cliente.apellido\n num_doc_antiguo= @cliente.num_identidad\n direccion_antigua= @cliente.direccion\n telefono_antiguo= @cliente.telefono\n sexo_antiguo= @cliente.sexo\n localidad_antigua= @cliente.localidad.nombre\n\n respond_to do |format|\n if @cliente.update_attributes(params[:cliente])\n nombre_nuevo= @cliente.nombre\n apellido_nuevo= @cliente.apellido\n num_doc_nuevo= @cliente.num_identidad\n direccion_nueva= @cliente.direccion\n telefono_nuevo= @cliente.telefono\n sexo_nuevo= @cliente.sexo\n localidad_nueva= @cliente.localidad.nombre\n CustomLogger.info(\"Datos antes de realizar la Actualizacion de Cliente: Nombre: #{nombre_antiguo.inspect}, Apellido:#{apellido_antiguo.inspect}, Nro de RUC o CI: #{num_doc_antiguo.inspect}, Direccion: #{direccion_antigua.inspect}, Sexo:#{sexo_antiguo.inspect}, Localidad:#{localidad_antigua.inspect} .Usuario Responsable: #{current_user.funcionario.full_name.inspect}.Datos Actualizados: Nombre:#{nombre_nuevo.inspect}, Apellido:#{apellido_nuevo.inspect}, Nro de RUC o CI:#{num_doc_nuevo.inspect}, Direccion:#{direccion_nueva.inspect}, Telefono:#{telefono_nuevo.inspect}, Sexo:#{sexo_nuevo.inspect} y Localidad:#{localidad_nueva.inspect}. Fecha y Hora: #{Time.now}\")\n format.html { redirect_to @cliente, notice: 'Los datos del Cliente se han actualizado correctamente.' }\n format.json { head :no_content }\n else\n CustomLogger.error(\"Error al intentar realizar actualizacion de los siguientes datos del Cliente: Nombre: #{nombre_antiguo.inspect}, Apellido:#{apellido_antiguo.inspect}, Nro de RUC o CI: #{num_doc_antiguo.inspect}, Direccion: #{direccion_antigua.inspect}, Sexo:#{sexo_antiguo.inspect}, Localidad:#{localidad_antigua.inspect} .Usuario Responsable: #{current_user.funcionario.full_name.inspect}. Fecha y Hora: #{Time.now}\")\n format.html { render action: \"edit\" }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to user_url(@client.id), notice: 'Client was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { redirect_to edit_user_url(@client.id)}\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"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(@cliente, :notice => 'Cliente was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @cliente.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to @client, notice: 'client was successfully updated.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to @client, notice: 'client was successfully updated.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @my_studio_client = MyStudio::Client.find(params[:id])\n\n respond_to do |format|\n if @my_studio_client.update_attributes(params[:my_studio_client])\n format.html { redirect_to @my_studio_client, notice: 'Client was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @my_studio_client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n authorize @client\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_back_or_default clients_url, t('Record has been saved') }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @add_to_invoice_client.update(add_to_invoice_client_params)\n format.html { redirect_to @add_to_invoice_client, notice: 'Add to invoice client was successfully updated.' }\n format.json { render :show, status: :ok, location: @add_to_invoice_client }\n else\n format.html { render :edit }\n format.json { render json: @add_to_invoice_client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n obtener_datos()\n @status = params[:statusproyect]\n @cliente = params[:cliente] + \" \" +params[:cliente_apellido]\n respond_to do |format|\n if @ventum.update(cliente: @cliente, clave:@clave, fecha:@fecha, iva:@iva,subtotal:@preciofinal ,total:@totalcosto, descuentogeneral: @descglobal , distribuidor: @distribuidor, status: @status)\n @detail.each do |x|\n x.destroy\n end\n salvar()\n format.html { redirect_to @ventum, notice: 'Venta actualizada correctamente.' }\n format.json { render :show, status: :ok, location: @ventum }\n else\n format.html { render :edit }\n format.json { render json: @ventum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n \n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to @client, notice: 'Client was successfully updated.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to @client, notice: 'Client was successfully updated.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to @client, notice: 'Client was successfully updated.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to @client, notice: 'Client was successfully updated.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to @client, notice: 'Client was successfully updated.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to @client, notice: 'Client was successfully updated.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def edit_client\n\t\t@client = Client.find(params[:id])\n\tend",
"def update\n @fulcliente = Fulcliente.find(params[:id])\n\n respond_to do |format|\n if @fulcliente.update_attributes(params[:fulcliente])\n format.html { redirect_to @fulcliente, notice: 'Fulcliente was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fulcliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n cliente_id = @contacto.cliente_id\n @clientes = Cliente.all\n @sucursales = Sucursal.where(\"cliente_id = ?\", params[:contacto][:cliente_id])\n respond_to do |format|\n if @contacto.update(contacto_params)\n #@contacto.cliente_id = params[:contacto][:cliente_id]\n #@contacto.sucursal_id = params[:contacto][:sucursal_id]\n ReportRecipient.where(contacto_id: params[:id]).each{|c| c.destroy} if cliente_id != params[:contacto][:cliente_id]\n\n if(params[:email] != \"\")\n @contacto.email=params[:email]\n else\n @contacto.email=nil\n end\n @contacto.save!\n save_contact_accounts(params[:id])\n save_contact_clients params[:id]\n format.html { redirect_to @contacto, :notice => 'El Contacto ha sido actualizado correctamente.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit', :layout => \"layout_2\"}\n format.json { render json: @contacto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to @client, notice: 'Client record was successfully updated.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @cliente_registro.update(cliente_registro_params)\n format.html { redirect_to @cliente_registro, notice: 'Cliente registro was successfully updated.' }\n format.json { render :show, status: :ok, location: @cliente_registro }\n else\n format.html { render :edit }\n format.json { render json: @cliente_registro.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @empleado_cliente.update(empleado_cliente_params)\n format.html { redirect_to @empleado_cliente, notice: 'Empleado cliente was successfully updated.' }\n format.json { render :show, status: :ok, location: @empleado_cliente }\n else\n format.html { render :edit }\n format.json { render json: @empleado_cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to @client, notice: \"Client was successfully updated.\" }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @client = Client.find(params[:id])\n authorize! :update, @client\n\n respond_to do |format|\n if @client.update_attributes(client_params)\n format.html { redirect_to @client, :notice => 'Client was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @client.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @telefono_empresa_cliente = TelefonoEmpresaCliente.find(params[:id])\n\n respond_to do |format|\n if @telefono_empresa_cliente.update_attributes(params[:telefono_empresa_cliente])\n format.html { redirect_to(@telefono_empresa_cliente, :notice => 'Telefono empresa cliente was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @telefono_empresa_cliente.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tb_servicio.update(tb_servicio_params)\n format.html { redirect_to @tb_servicio, notice: 'Tb servicio was successfully updated.' }\n format.json { render :show, status: :ok, location: @tb_servicio }\n else\n format.html { render :edit }\n format.json { render json: @tb_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # no se puede actualizar una venta por el momento\n respond_to do |format|\n\n previous_sale = @sale\n \n if @sale.update(sale_params)\n\n @sale.cliente.update(client_params)\n \n #verifica si cambió el estado de la venta y realiza las acciones que corresponda\n Sale.verificar_cambios(previous_sale, @sale, current_user)\n #Sale.verificarCambioDeEstado(estado_anterior, @sale, current_user) if estado_anterior != @sale.estado\n \n format.html { redirect_to @sale, notice: 'Venta actualizada con exito.' }\n format.json { render :show, status: :ok, location: @sale }\n else\n format.html { render :edit }\n format.json { render json: @sale.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to(client_url, :notice => 'Client was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @client.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @clientsOffers = ClientsOffers.find(params[:id])\n\n respond_to do |format|\n if @clientsOffers.update_attributes(params[:clientsOffers])\n format.html { redirect_to @clientsOffers, notice: 'ClientsOffers was succesfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @clientsOffers.errors, status: :unprocesable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @solicitacoes_avaliacoes_servico.update(solicitacoes_avaliacoes_servico_params)\n format.html { redirect_to @solicitacoes_avaliacoes_servico, notice: 'Solicitacoes avaliacoes servico was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @solicitacoes_avaliacoes_servico.errors, status: :unprocessable_entity }\n end\n end\n end"
] | [
"0.67743903",
"0.66896874",
"0.6666911",
"0.66472733",
"0.6642194",
"0.6640146",
"0.6640146",
"0.66329837",
"0.6573523",
"0.6570198",
"0.6569454",
"0.6565012",
"0.65348125",
"0.6531919",
"0.65280366",
"0.649713",
"0.6496634",
"0.64622915",
"0.6458767",
"0.6430716",
"0.63964134",
"0.63955486",
"0.63915515",
"0.6388738",
"0.6380251",
"0.6376216",
"0.63704354",
"0.63703924",
"0.6356752",
"0.6353825",
"0.6352183",
"0.6349725",
"0.6348318",
"0.63334084",
"0.6331261",
"0.63241994",
"0.63014007",
"0.63014007",
"0.6299681",
"0.6298752",
"0.628858",
"0.628858",
"0.6277159",
"0.6264797",
"0.6242534",
"0.6228922",
"0.62277985",
"0.6222642",
"0.62219775",
"0.62219775",
"0.62074584",
"0.62060237",
"0.6202751",
"0.62017447",
"0.61914885",
"0.6170017",
"0.6158346",
"0.6150417",
"0.6123664",
"0.61141086",
"0.61113596",
"0.61032426",
"0.60810864",
"0.6080633",
"0.6080549",
"0.60748863",
"0.607263",
"0.60689294",
"0.6068173",
"0.60639226",
"0.60582083",
"0.60545796",
"0.6049271",
"0.6048898",
"0.6048898",
"0.60461515",
"0.6035769",
"0.60343516",
"0.602849",
"0.60281235",
"0.6026945",
"0.6026945",
"0.6026945",
"0.6026945",
"0.6026945",
"0.60214907",
"0.602121",
"0.6019681",
"0.60181385",
"0.6017061",
"0.6014253",
"0.6012735",
"0.6012199",
"0.6006452",
"0.60047144",
"0.60027206",
"0.60022366",
"0.6000091",
"0.5999962",
"0.5999647"
] | 0.6552312 | 12 |
DELETE /tiendas_clientes/1 DELETE /tiendas_clientes/1.json | def destroy
cliente = @tienda_cliente.cliente
if @tienda_cliente.destroy
redirect_to cliente_tiendas_clientes_url(cliente), notice: 'La tienda se borró exitosamente.'
else
@tienda_cliente.update(activo: false)
redirect_to cliente_tiendas_clientes_url(cliente), notice: 'La tienda se ha desactivado.'
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Cliente excluído com sucesso!' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Cliente apagado com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n clients_delete(@entity)\n @entity.destroy\n respond_to do |format|\n format.html { redirect_to clients_path }\n format.json { render json: {success: true} }\n end\n end",
"def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Данные по клиенту удалены.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'El Cliente fue Eliminado Exitosamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cliente = Cliente.find(params[:id])\n @cliente.destroy\n\n respond_to do |format|\n format.html { redirect_to clientes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cliente = Cliente.find(params[:id])\n @cliente.destroy\n\n respond_to do |format|\n format.html { redirect_to clientes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cliente = Cliente.find(params[:id])\n @cliente.destroy\n\n respond_to do |format|\n format.html { redirect_to clientes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cliente = Cliente.find(params[:id])\n @cliente.destroy\n\n respond_to do |format|\n format.html { redirect_to clientes_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Client a été supprimer.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @clientes_servico.destroy\n respond_to do |format|\n format.html { redirect_to clientes_servicos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @clientepedido = Clientepedido.find(params[:id])\n @clientepedido.destroy\n\n respond_to do |format|\n format.html { redirect_to clientepedidos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @otg_client.destroy\n respond_to do |format|\n format.html { redirect_to otg_clients_url, notice: 'Otg client was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cliente.destroy\n respond_to do |format|\n format.html { redirect_to clientes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @client = Client.find(params[:id])\r\n @client.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to clients_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @secubat_client = SecubatClient.find(params[:id])\n @secubat_client.destroy\n\n respond_to do |format|\n format.html { redirect_to secubat_clients_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n \n if @client.deleted_at.blank?\n @client.destroy\n else\n @client.revive\n end\n \n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :ok }\n end\n end",
"def destroy\n orden@client.destroy\n end",
"def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Cliente foi excluido.' }\n format.json { head :no_content }\n sweetalert_success('Cliente excluido com sucesso.', 'Sucesso!', useRejections: false)\n end\n end",
"def destroy\n @qa_client = QaClient.find(params[:id])\n @qa_client.destroy\n\n respond_to do |format|\n format.html { redirect_to qa_clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @my_studio_client = MyStudio::Client.find(params[:id])\n @my_studio_client.destroy\n\n respond_to do |format|\n format.html { redirect_to my_studio_clients_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n \n respond_to do |format|\n format.html { redirect_to clients_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n @uuid = params[:uuid]\n respond_to do |format|\n format.html { redirect_to :controller => 'ads', :action => 'admin_dash', :id => 1, :uuid => @uuid }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cliente.destroy\n respond_to do |format|\n format.html { redirect_to clientes_url, notice: 'Cliente removido com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n# redirect_to activacionclientets_path # ted esto para evitar que borren por la web. ok. Que valla al index. provisional ok.\n \n #@activacionclientet.destroy\n respond_to do |format|\n format.html { redirect_to activacionclientets_url, notice: 'Activacionclientes no se puede eliminar por esta via. Contacte el administrador.' } # ted esto para evitar que borren por la web\n format.json { head :no_content }\n end\n end",
"def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def destroy\n @contatos_cliente.destroy\n respond_to do |format|\n format.html { redirect_to contatos_clientes_url, notice: 'Contatos cliente was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find params[:id]\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Cliente fue Eliminado correctamente.' }\n end\n end",
"def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Client record was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n client=Client.find_by_id(params[:id])\n if client != nil\n if client.destroy\n head 204\n end\n else\n head 404\n end\n end",
"def destroy\n @evclient = Evclient.find(params[:id])\n @evclient.destroy\n\n respond_to do |format|\n format.html { redirect_to evclients_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Client was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Client was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Client was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Client was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Client was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Client was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Client was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n respond_with(@client)\n end",
"def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: \"Client was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to(clients_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to(clients_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to(clients_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @cliente = Cliente.find(params[:id])\n @cliente.destroy\n @crear = Clientesmkt.create_mikrotik\n respond_to do |format|\n format.html { redirect_to clientes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to(clients_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Client was successfully destroyed.' }\n\n format.json { head :no_content }\n end\n end",
"def destroy\n @cliente.destroy\n respond_to do |format|\n format.html { redirect_to clientes_url, notice: 'Cliente was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n chef_rest_v1.delete(\"clients/#{@name}\")\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to(clients_url) }\n end\n end",
"def destroy\n @ventas_agrupador_cliente.destroy\n respond_to do |format|\n format.html { redirect_to ventas_agrupador_clientes_url, notice: 'Agrupador cliente was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ventas_agrupador_cliente.destroy\n respond_to do |format|\n format.html { redirect_to ventas_agrupador_clientes_url, notice: 'Agrupador cliente was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n #--ADICIONADO\n @cliente.perfilclientes.destroy\n #--ADICIONADO\n @cliente.destroy\n respond_to do |format|\n format.html { redirect_to clientes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n authorize! :update, @client\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @fulcliente = Fulcliente.find(params[:id])\n @fulcliente.destroy\n\n respond_to do |format|\n format.html { redirect_to fulclientes_url }\n format.json { head :ok }\n end\n end",
"def destroy\n authorize @client\n @client.destroy\n respond_to do |format|\n format.html { redirect_back_or_default clients_url, t('Record has been deleted') }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to admin_clients_url(search: params[:search], page: params[:page]),\n notice: 'Клиент удален.' }\n format.json { head :no_content }\n end\n end",
"def delete\n client.delete(url)\n @deleted = true\nend",
"def destroy\n @telefone_cliente.destroy\n respond_to do |format|\n format.html { redirect_to telefone_clientes_url, notice: 'Telefone cliente was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cliente = Cliente.find(params[:id])\n @cliente.destroy\n\n respond_to do |format|\n format.html { redirect_to(clientes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @cliente = Cliente.find(params[:id])\n @cliente.destroy\n\n respond_to do |format|\n format.html { redirect_to(clientes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @doctor_cliente = DoctorCliente.find(params[:id])\n @doctor_cliente.destroy\n\n respond_to do |format|\n format.html { redirect_to doctor_clientes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client_info.destroy\n respond_to do |format|\n format.html { redirect_to client_infos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client_info.destroy\n respond_to do |format|\n format.html { redirect_to client_infos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @add_to_invoice_client.destroy\n respond_to do |format|\n format.html { redirect_to add_to_invoice_clients_url, notice: 'Add to invoice client was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n redirect_to clients_url\n end",
"def destroy\n @tipocliente = Tipocliente.find(params[:id])\n @tipocliente.destroy\n\n respond_to do |format|\n format.html { redirect_to tipoclientes_url }\n #format.json { head :ok }\n end\n end",
"def destroy\n @cliente.destroy\n respond_to do |format|\n format.html {\n flash[:success] = 'Empleado Eliminado satisfactoriamente'\n redirect_to clientes_url\n }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = current_user\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_path(@user) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @vendedor_cliente.destroy\n respond_to do |format|\n format.html { redirect_to vendedor_clientes_url, notice: 'Vendedor cliente was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n @clients = get_clients\n @client = Client.new\n\n respond_to do |format|\n #format.html { redirect_to clients_url }\n format.json { head :no_content }\n format.js\n end\n end",
"def destroy\n @client.delete( name )\n end",
"def destroy\n @api_client = ApiClient.find(params[:id])\n @api_client.destroy\n\n respond_to do |format|\n format.html { redirect_to api_clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @empleado_cliente.destroy\n respond_to do |format|\n format.html { redirect_to empleado_clientes_url, notice: 'Empleado cliente was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @clientsOffers = ClientsOffers.find(params[:id])\n @clientsOffers.destroy\n\n respond_to do |format|\n format.html { redirect_to clientsOffers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client.in_trash = @client.in_trash == false\n @client.save\n\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'El cliente se eliminó correctamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = clients.find(params[:id])\n @client.destroy\n redirect_to(user_company_clients_url(current_company))\n end",
"def destroy\n @client = Client.find(params[:id])\n Client.transaction do\n FileUtils.rm Dir[\"#{Rails.root}/public/files/logo_files/\"+@client.logo.to_s]\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Client was successfully deleted.' }\n format.json { head :no_content }\n end\n end\n end",
"def destroy\n @kont_klient.destroy\n respond_to do |format|\n format.html { redirect_to kont_klient_index_url, notice: 'Kont klient was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client_transaction = ClientTransaction.find(params[:id])\n @client_transaction.destroy\n\n respond_to do |format|\n format.html { redirect_to client_transactions_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @invoice_client.destroy\n respond_to do |format|\n format.html { redirect_to invoice_clients_url, notice: 'Invoice client was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client_type.destroy\n respond_to do |format|\n format.html { redirect_to client_types_url, notice: 'Tipo de Cliente deletado.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n set_redireccion\n @objeto.destroy\n respond_to do |format|\n format.html { redirect_to @redireccion, notice: 'Cliente was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to(search_results_url, :notice => \"Client was successfully destroyed. #{undo_link}\") }\n end\n end",
"def delete(client_id)\n id = client_id.to_s\n Client.collection.filter(:id => id).delete\n AuthRequest.collection.filter(:client_id => id).delete\n AccessGrant.collection.filter(:client_id => id).delete\n AccessToken.collection.filter(:client_id => id).delete\n end",
"def destroy\n @client_has_employeur.destroy\n respond_to do |format|\n format.html { redirect_to client_has_employeurs_url, notice: 'Client has employeur was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cliente = Cliente.find(params[:id])\n @cliente.destroy\n\n respond_to do |format|\n format.html { redirect_to(clientes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @client.destroy\n redirect_to index_clients_path, notice: 'Client was successfully destroyed.'\n end"
] | [
"0.7428273",
"0.74006814",
"0.7391989",
"0.7374213",
"0.73599035",
"0.7355573",
"0.73190874",
"0.73190874",
"0.73190874",
"0.73185486",
"0.73048204",
"0.7302532",
"0.7301637",
"0.7286137",
"0.72758675",
"0.7265382",
"0.7265382",
"0.7265382",
"0.7265382",
"0.7265382",
"0.7265382",
"0.7265382",
"0.7265382",
"0.7265382",
"0.7251804",
"0.7251804",
"0.72387356",
"0.72341466",
"0.7233877",
"0.7232436",
"0.72202563",
"0.71777093",
"0.7138806",
"0.7137186",
"0.7135602",
"0.7133001",
"0.7106055",
"0.7105568",
"0.7086237",
"0.7084858",
"0.7079216",
"0.7071857",
"0.7071449",
"0.70585567",
"0.7053119",
"0.7050994",
"0.7050994",
"0.7050994",
"0.7050994",
"0.7050994",
"0.7050994",
"0.7050994",
"0.7046065",
"0.70458883",
"0.704321",
"0.70429575",
"0.70429575",
"0.70340616",
"0.70329064",
"0.70322967",
"0.7029926",
"0.7027844",
"0.7026357",
"0.7021755",
"0.7021755",
"0.6991766",
"0.69857615",
"0.6981756",
"0.6976194",
"0.6972351",
"0.6949073",
"0.69442236",
"0.69341475",
"0.69341475",
"0.69274",
"0.6922659",
"0.6922449",
"0.6921702",
"0.69152564",
"0.6914867",
"0.69147",
"0.6907547",
"0.68909687",
"0.68771654",
"0.687602",
"0.6874547",
"0.6861956",
"0.6855592",
"0.6848489",
"0.6848147",
"0.68327975",
"0.6831464",
"0.68223494",
"0.6822279",
"0.6822151",
"0.6817961",
"0.6809435",
"0.680284",
"0.6799935",
"0.67989683",
"0.6797647"
] | 0.0 | -1 |
Use callbacks to share common setup or constraints between actions. | def set_tienda_cliente
@tienda_cliente = TiendaCliente.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def set_actions\n actions :all\n end",
"def define_action_helpers?; end",
"def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"def setup_handler\n end",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"def workflow\n end",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); end",
"def setup\n # override and do something appropriate\n end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"def determine_valid_action\n\n end",
"def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"def startcompany(action)\n @done = true\n action.setup\n end",
"def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def action\n end",
"def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"def config(action, *args); end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"def before_action \n end",
"def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"def action\n end",
"def matt_custom_action_begin(label); end",
"def setup\n # override this if needed\n end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"def setup_signals; end",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"def initialize(*args)\n super\n @action = :set\nend",
"def after_set_callback; end",
"def setup\n #implement in subclass;\n end",
"def lookup_action; end",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"def release_actions; end",
"def around_hooks; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def save_action; end",
"def action_target()\n \n end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"def before_setup\n # do nothing by default\n end",
"def default_action; end",
"def setup(&blk)\n @setup_block = blk\n end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend",
"def _handle_action_missing(*args); end",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"def duas1(action)\n action.call\n action.call\nend"
] | [
"0.6163821",
"0.6045432",
"0.5945441",
"0.5916224",
"0.58894575",
"0.5834073",
"0.57764685",
"0.5702474",
"0.5702474",
"0.5653258",
"0.56211996",
"0.54235053",
"0.5410683",
"0.5410683",
"0.5410683",
"0.53948104",
"0.5378064",
"0.5356684",
"0.53400385",
"0.53399503",
"0.53312254",
"0.53121567",
"0.52971965",
"0.52964705",
"0.52956307",
"0.52587366",
"0.52450675",
"0.5237777",
"0.5237777",
"0.5237777",
"0.5237777",
"0.5237777",
"0.5233381",
"0.52325714",
"0.52288216",
"0.52229726",
"0.5218362",
"0.52142864",
"0.5207988",
"0.5206337",
"0.51762295",
"0.51745105",
"0.51728606",
"0.516616",
"0.5161016",
"0.5157393",
"0.5152562",
"0.51524293",
"0.5152397",
"0.5144533",
"0.513982",
"0.51342106",
"0.5113793",
"0.5113793",
"0.5113671",
"0.51092553",
"0.51062804",
"0.50921935",
"0.5088855",
"0.5082236",
"0.5079901",
"0.5066569",
"0.5055307",
"0.5053106",
"0.50499666",
"0.50499666",
"0.5035068",
"0.50258636",
"0.50220853",
"0.5015893",
"0.50134486",
"0.5001442",
"0.50005543",
"0.4998581",
"0.49901858",
"0.49901858",
"0.4986648",
"0.49809486",
"0.49792925",
"0.4978855",
"0.49685496",
"0.49656174",
"0.49576473",
"0.49563017",
"0.4955349",
"0.49536878",
"0.4952439",
"0.49460214",
"0.494239",
"0.49334687",
"0.49315962",
"0.49266812",
"0.49261138",
"0.4925925",
"0.4922542",
"0.4920779",
"0.49173284",
"0.49169463",
"0.4916256",
"0.49162322",
"0.49156886"
] | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def tienda_cliente_params
params.require(:tienda_cliente).permit(:nombre, :direccion, :telefono)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def valid_params_request?; end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def filtering_params\n params.permit(:email)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"def filter_parameters; end",
"def filter_parameters; end",
"def list_params\n params.permit(:name)\n end",
"def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"def url_whitelist; end",
"def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"def filter_params\n params.require(:filters).permit(:letters)\n end",
"def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\n end",
"def permit_request_params\n params.permit(:address)\n end",
"def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"def secure_params\n params.require(:location).permit(:name)\n end",
"def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def url_params\n params[:url].permit(:full)\n end",
"def backend_user_params\n params.permit!\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end",
"def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end"
] | [
"0.69811666",
"0.6782836",
"0.6747644",
"0.6742015",
"0.6735273",
"0.6593917",
"0.65037674",
"0.6498627",
"0.6482372",
"0.64795715",
"0.64566946",
"0.6439213",
"0.6380714",
"0.6378147",
"0.63657266",
"0.63206697",
"0.6300169",
"0.62992156",
"0.6295538",
"0.62943023",
"0.62915146",
"0.6290595",
"0.62824667",
"0.62420255",
"0.62403506",
"0.6217174",
"0.6213706",
"0.62112075",
"0.6194868",
"0.6178784",
"0.6174678",
"0.6172499",
"0.61630744",
"0.61544263",
"0.615248",
"0.6147727",
"0.61221075",
"0.6119646",
"0.61076134",
"0.6106584",
"0.6094013",
"0.6081423",
"0.6071337",
"0.6063637",
"0.6021453",
"0.6018253",
"0.60161054",
"0.60112554",
"0.60071784",
"0.60071784",
"0.60004836",
"0.6000254",
"0.5999255",
"0.59930664",
"0.59919107",
"0.5991741",
"0.5980763",
"0.59663844",
"0.59605104",
"0.5960486",
"0.5959414",
"0.5957901",
"0.59538954",
"0.5953327",
"0.59450173",
"0.59391475",
"0.59391475",
"0.59386194",
"0.59351885",
"0.593139",
"0.5926316",
"0.5925927",
"0.59176016",
"0.59119296",
"0.5909275",
"0.5908221",
"0.59053046",
"0.58983994",
"0.58980995",
"0.58964473",
"0.5895902",
"0.5893993",
"0.58927304",
"0.5887752",
"0.58841616",
"0.5880381",
"0.58752084",
"0.586956",
"0.5868584",
"0.58679324",
"0.5867004",
"0.58667004",
"0.58642864",
"0.5863347",
"0.58626384",
"0.58615845",
"0.58594906",
"0.5854959",
"0.5854423",
"0.58506453",
"0.5850135"
] | 0.0 | -1 |
Use callbacks to share common setup or constraints between actions. | def set_playlist
@playlist = Playlist.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def define_action_helpers?; end",
"def set_actions\n actions :all\n end",
"def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def setup_handler\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def workflow\n end",
"def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup\n # override and do something appropriate\n end",
"def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"def determine_valid_action\n\n end",
"def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"def startcompany(action)\n @done = true\n action.setup\n end",
"def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def action\n end",
"def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"def config(action, *args); end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"def before_action \n end",
"def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"def action\n end",
"def matt_custom_action_begin(label); end",
"def setup\n # override this if needed\n end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"def setup_signals; end",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"def initialize(*args)\n super\n @action = :set\nend",
"def after_set_callback; end",
"def setup\n #implement in subclass;\n end",
"def lookup_action; end",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"def release_actions; end",
"def around_hooks; end",
"def save_action; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def action_target()\n \n end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"def before_setup\n # do nothing by default\n end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def default_action; end",
"def setup(&blk)\n @setup_block = blk\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); end",
"def duas1(action)\n action.call\n action.call\nend",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend"
] | [
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576",
"0.53124547",
"0.529654",
"0.5296262",
"0.52952296",
"0.52600986",
"0.52442724",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.5232394",
"0.523231",
"0.5227454",
"0.52226824",
"0.52201617",
"0.5212327",
"0.52079266",
"0.52050185",
"0.51754695",
"0.51726824",
"0.51710224",
"0.5166172",
"0.5159343",
"0.51578903",
"0.51522785",
"0.5152022",
"0.51518047",
"0.51456624",
"0.51398855",
"0.5133759",
"0.5112076",
"0.5111866",
"0.5111866",
"0.5110294",
"0.5106169",
"0.509231",
"0.50873137",
"0.5081088",
"0.508059",
"0.50677156",
"0.50562143",
"0.5050554",
"0.50474834",
"0.50474834",
"0.5036181",
"0.5026331",
"0.5022976",
"0.5015441",
"0.50121695",
"0.5000944",
"0.5000019",
"0.4996878",
"0.4989888",
"0.4989888",
"0.49864885",
"0.49797225",
"0.49785787",
"0.4976161",
"0.49683493",
"0.4965126",
"0.4958034",
"0.49559742",
"0.4954353",
"0.49535993",
"0.4952725",
"0.49467874",
"0.49423352",
"0.49325448",
"0.49282882",
"0.49269363",
"0.49269104",
"0.49252945",
"0.4923091",
"0.49194667",
"0.49174926",
"0.49173003",
"0.49171105",
"0.4915879",
"0.49155936"
] | 0.0 | -1 |
GET /empresas GET /empresas.json | def index
@institucions = Institucion.search(params[:search], params[:page])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @empresas = Empresa.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @empresas }\n end\n end",
"def index\n @expedientes = Expediente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @expedientes }\n end\n end",
"def index\n @employes = Employe.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @employes }\n end\n end",
"def index\n @empskeds = Empsked.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @empskeds }\n end\n end",
"def consulta\n fiesta = Fiesta.all\n render json: fiesta\n end",
"def index\n @empresas = Empresa.all\n end",
"def index\n @empresas = Empresa.all\n end",
"def index\n @empleados_empresas = EmpleadosEmpresa.all\n end",
"def show\n @estatuto = Estatuto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @estatuto }\n end\n end",
"def index\n @equipos = Equipo.all\n render json: @equipos, status: :ok\n end",
"def show\n @expediente = Expediente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @expediente }\n end\n end",
"def index\n @coordenador_estagios = CoordenadorEstagio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @coordenador_estagios }\n end\n end",
"def emergencias_en_curso\n @emergencies = Emergency.where(:estado => 'f')\n render json: @emergencies\n end",
"def index\n @assuntos = Assunto.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @assuntos }\n end\n end",
"def index\n @empregos = Emprego.all\n end",
"def index\n @empleados = Empleado.all\n end",
"def index\n @empleados = Empleado.all\n end",
"def show\n @employe = Employe.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employe }\n end\n end",
"def index\n @ef_pares = EfPare.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ef_pares }\n end\n end",
"def show\n @etnia = Etnia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @etnia }\n end\n end",
"def index\n @Empresas = Empresa.all\n end",
"def index\n @Empresas = Empresa.all\n end",
"def show\n @ejercicio = Ejercicio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ejercicio }\n end\n end",
"def index\n @establecimientos = Establecimiento.all\n respond_to do |format|\n format.json { \n\n if (params[:appkey].eql? appkey) #si el appkey es correcto\n\n ests = @establecimientos.map { |establecimiento| { :nombre_establecimiento => establecimiento.nombre, :id => establecimiento.id, \n :descripcion => establecimiento.descripcion, :longitud => establecimiento.longitud,\n :latitud => establecimiento.latitud, :direccion => establecimiento.direccion, :imagen => establecimiento.foto.url(:small),\n :eventos => establecimiento.eventos.map { |evento| { :nombre => evento.nombre } } } } \n render json: ests\n else\n render json: {:error => \"No autorizado\"}\n end\n\n\n\n }\n format.html { redirect_to :controller=>'login', :action=>'login' } #solo el app movil puede revisar toda la lista de establecimientos.\n end\n end",
"def index\n @employers = Employer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @employers }\n end\n end",
"def ejemplares\n\t\tsnib = Geoportal::Snib.new\n\t\tsnib.params = params\n\t\tsnib.ejemplares\n\t\t\n\t\trender json: snib.resp\n\tend",
"def show\n @empresa_servicio = EmpresaServicio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @empresa_servicio }\n end\n end",
"def index\n @employments = Employment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @employments }\n end\n end",
"def index\n @ores = Ore.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ores }\n end\n end",
"def index\n @enderecos = Endereco.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @enderecos }\n end\n end",
"def index\n @deporte_usuarios = DeporteUsuario.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @deporte_usuarios }\n end\n end",
"def show\n @estabelecimento = Estabelecimento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @estabelecimento }\n end\n end",
"def events\n url = 'https://api.artic.edu/api/v1/exhibitions?limit=35'\n\n res = RestClient.get(url)\n JSON.parse(res)\nend",
"def index\n @empleados = Empleado.search(params[:search], params[:page])\n end",
"def index\n @employees = current_owner.employees.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @employees }\n end\n end",
"def show\n @emprendedor = Emprendedor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @emprendedor }\n end\n end",
"def index\n @empregadors = Empregador.all\n end",
"def index\n @representante_empresas = RepresentanteEmpresa.all\n end",
"def show\n @estabelecimento = Estabelecimento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @estabelecimento }\n end\n end",
"def show\n @emp_month = EmpMonth.find(params[:id])\n @employees = Employee.where(\"grade IN (1,2)\").order(:name)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @emp_month }\n end\n end",
"def index\n @electors = Elector.all\n\n render json: @electors\n end",
"def employee_vacations\n #vacaciones de este año\n vacations = Employee.find(params[:id]).get_vacation_days\n\n respond_to do |format|\n format.json { render json: vacations }\n end\n end",
"def index\n @eobs = Eob.assigned\n @title = \"Posted EOBs\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @eobs }\n end\n end",
"def show\n @estacionamiento = Estacionamiento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @estacionamiento }\n end\n end",
"def index\n employees = manager.employees.active\n render json: employees.all, each_serializer: EmployeeSerializer, status: 200\n end",
"def index\n @dia_eventos = DiaEvento.all\n render json: @dia_eventos\n end",
"def index\n @antecedentes = Antecedente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @antecedentes }\n end\n end",
"def expiracion\n @usuario = Usuario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @usuario }\n end\n end",
"def index\n #Para no mostrar el empleado oculto que se usa como superuser en la base de datos y el sistema\n @employees = Employee.where(\"id != 1\")\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @employees }\n end\n end",
"def show\n @empsked = Empsked.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @empsked }\n end\n end",
"def index\n @acuerdos = Acuerdo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @acuerdos }\n end\n end",
"def index\n @rowempls = Rowempl.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rowempls }\n end\n end",
"def index\n @departamentos = Departamento.all\n\n render json: @departamentos\n end",
"def index\n\t\tvendas = Venda.all\n\t\trender json: vendas, status: :ok\n\tend",
"def index\n @titulo = \"Restaurante Dragon Ball\"\n @empresa = Empresa.find(1)\n @empresas = Empresa.all\n end",
"def index\n @palestrantes = Palestrante.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @palestrantes }\n end\n end",
"def show\n @empresa = Empresa.find(params[:id])\n @vagas = @empresa.vagas\n @funcionarios = nil\n if current_usuario.isCoordenador? or current_usuario.isAdmin?\n @funcionarios = @empresa.gestor\n @funcionarios << @empresa.admin_empresa\n end\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @empresa }\n end\n end",
"def show\n @estudiante = Estudiante.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @estudiante }\n end\n end",
"def index\n @ejemplos = Ejemplo.all\n end",
"def show\n @employ = Employ.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employ }\n end\n end",
"def show\n @escala = Escala.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @escala }\n end\n end",
"def index\n @etapas = Etapa.all\n end",
"def index\n @programa_de_interes = ProgramaDeIntere.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @programa_de_interes }\n end\n end",
"def index\n @horario_empleados = HorarioEmpleado.all\n end",
"def index\n @tutorados = Tutorado.all\n\n render json: @tutorados, status: :ok\n end",
"def index\n @repas = Repa.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @repas }\n end\n end",
"def index\n residencial = current_user.apartamento.residencial\n #@eventos = Evento.joins(:user => [{:apartamento => :residencial}])\n #.where(:residenciais => {:id => residencial.id})\n #.order(\"created_at DESC\")\n\n @eventos = Evento\n .where(:residencial_id => residencial.id)\n .order(\"created_at DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @eventos }\n end\n end",
"def index\n @ofertas = Oferta.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @ofertas }\n end\n end",
"def index\n render json: @fiestas\n end",
"def index\n @ideas = Idea.current_ideas_for(current_user).entries\n respond_with(@ideas) do |format|\n format.json { render json: @ideas }\n end\n end",
"def show\n @pessoa = Pessoa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pessoa }\n end\n end",
"def show\n @excepcion_entrega = ExcepcionEntrega.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @excepcion_entrega }\n end\n end",
"def show\n @pessoa = Pessoa.find(params[:id])\n\n respond_to do |format|\n # format.html # show.html.erb\n format.json { render json: @pessoa }\n end\n end",
"def show\n @entrada_inventario = EntradaInventario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @entrada_inventario }\n end\n end",
"def index\n @exemplaresprodutos = Exemplaresproduto.all\n end",
"def index\n @acoes = Acao.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @acoes }\n end\n end",
"def show\n @employee = Employee.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employee }\n end\n end",
"def index\n @ventas = Venta.order(\"fecha desc\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ventas }\n end\n end",
"def show\n @employee = Employee.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employee }\n end\n end",
"def show\n @emp_job = EmpJob.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @emp_job }\n end\n end",
"def index\n @vehicule_persos = VehiculePerso.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @vehicule_persos }\n end\n end",
"def index\n @asociados = Asociado.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @asociados }\n end\n end",
"def getOrden \n \t@orden = Orden.where(:rest => params[:id_res])\n \trender json: @orden\n end",
"def show\n @eou = Eou.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @eou }\n end\n end",
"def index\n @ordenes = Orden.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ordenes }\n end\n end",
"def index\n @himalayas ||= Himalaya.limit(10).order('id desc')\n @descuentos ||= Descuento.limit(10).order('id desc')\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @himalayas }\n end\n end",
"def show \n est = @establecimiento\n respond_to do |format|\n format.html\n format.json { \n\n if (params[:appkey].eql? appkey) #si el appkey es correcto\n render :json => {:nombre => @establecimiento.nombre, direccion: @establecimiento.direccion, :latitud => @establecimiento.latitud,\n :longitud => @establecimiento.longitud, :descripcion => @establecimiento.descripcion, :imagen => @establecimiento.foto.url(:small),\n :comentarios => @establecimiento.EstComentarios.map { |comentario| { :descripcion => comentario.descripcion, :usuario => comentario.usuario.nombre } } } \n\n else\n render json: {:error => \"No autorizado\"}\n end\n\n\n }\n end\n #No tiene restricciones, queda abierto para el API\n end",
"def etiquetas_por_aluno\n logger.info(params)\n @etiquetas_aluno = Etiqueta.all.where(aluno_id: params[:aluno_id])\n respond_with @etiquetas_aluno\n end",
"def show\n @espacio_deportivo = EspacioDeportivo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @espacio_deportivo }\n end\n end",
"def index\n org = Organization.find(current_employee.organization_id)\n @alerts = org.alerts\n render \"index.json.jbuilder\", status: :ok\n end",
"def show\n \t@empresa = Core::Empresa.find(params[:empresa_id])\n @core_porto = Core::Porto.find(params[:id])\n\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @core_porto }\n end\n end",
"def show\n @ventas_seguimiento = Ventas::Seguimiento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ventas_seguimiento }\n end\n end",
"def display\n @reservas = Reserva.order(fecha_inicio_estadia: :desc)\n render json: @reservas, include: [:cliente, :habitacion]\n end",
"def index\n @listes = Liste.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @listes }\n end\n end",
"def show\n @equipamento = Equipamento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @equipamento }\n end\n end",
"def index\n find_organismos\n respond_to do |format|\n format.html # index.html.erb\n format.json {render json: @organismos }\n end\n end",
"def index\n @exercises = Exercise.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @exercises }\n end\n end",
"def index\n @exercises = Exercise.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @exercises }\n end\n end",
"def index\r\n checar_super_agencia\r\n @empresas = Empresa.all\r\n end",
"def show\n @asiento = Asiento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @asiento }\n end\n end",
"def index\n @pacientes = Pacientes.all\n render json: @pacientes\n end"
] | [
"0.7540952",
"0.7004249",
"0.69645905",
"0.6842314",
"0.67357254",
"0.66989076",
"0.66989076",
"0.66750306",
"0.6673944",
"0.6635433",
"0.6625087",
"0.661472",
"0.6610647",
"0.6604201",
"0.65969485",
"0.65890557",
"0.65890557",
"0.6578836",
"0.65713525",
"0.6562834",
"0.65517986",
"0.65517986",
"0.65480024",
"0.65305984",
"0.65130705",
"0.65089256",
"0.64926887",
"0.6485806",
"0.6461105",
"0.6455861",
"0.6448746",
"0.64418995",
"0.64368516",
"0.64333487",
"0.6423984",
"0.64213616",
"0.64160675",
"0.6404939",
"0.64043367",
"0.64015895",
"0.6393147",
"0.6390042",
"0.6389372",
"0.63847995",
"0.6379581",
"0.6373335",
"0.63715583",
"0.6371429",
"0.63649297",
"0.6361805",
"0.6333164",
"0.6330052",
"0.63230306",
"0.63179153",
"0.6314549",
"0.62742156",
"0.62731683",
"0.6269162",
"0.62618583",
"0.6258824",
"0.6258203",
"0.6257632",
"0.6257162",
"0.6255639",
"0.62537175",
"0.6252327",
"0.62446654",
"0.624428",
"0.6233339",
"0.62323946",
"0.62309027",
"0.6229967",
"0.62267584",
"0.6226447",
"0.6221847",
"0.6211595",
"0.62106156",
"0.62095237",
"0.6209489",
"0.62080544",
"0.6204299",
"0.6192384",
"0.6191662",
"0.61915815",
"0.6182869",
"0.6175706",
"0.61704516",
"0.61586344",
"0.6156606",
"0.6155256",
"0.6154782",
"0.61486405",
"0.6146959",
"0.6137528",
"0.6119468",
"0.6114007",
"0.61076427",
"0.61076427",
"0.61066496",
"0.6105042",
"0.6104749"
] | 0.0 | -1 |
GET /empresas/1 GET /empresas/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @empresas = Empresa.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @empresas }\n end\n end",
"def show\n @employe = Employe.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employe }\n end\n end",
"def index\n @employes = Employe.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @employes }\n end\n end",
"def index\n @expedientes = Expediente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @expedientes }\n end\n end",
"def show\n @expediente = Expediente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @expediente }\n end\n end",
"def show\n @estatuto = Estatuto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @estatuto }\n end\n end",
"def show\n @emprendedor = Emprendedor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @emprendedor }\n end\n end",
"def index\n @empskeds = Empsked.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @empskeds }\n end\n end",
"def show\n @employ = Employ.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employ }\n end\n end",
"def show\n @empresa_servicio = EmpresaServicio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @empresa_servicio }\n end\n end",
"def show\n @estabelecimento = Estabelecimento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @estabelecimento }\n end\n end",
"def show\n @ejercicio = Ejercicio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ejercicio }\n end\n end",
"def show\n @etnia = Etnia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @etnia }\n end\n end",
"def show\n @employee = Employee.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employee }\n end\n end",
"def show\n @estabelecimento = Estabelecimento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @estabelecimento }\n end\n end",
"def show\n @employee = Employee.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employee }\n end\n end",
"def show\n @emp_month = EmpMonth.find(params[:id])\n @employees = Employee.where(\"grade IN (1,2)\").order(:name)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @emp_month }\n end\n end",
"def show\n @emp_job = EmpJob.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @emp_job }\n end\n end",
"def show\n @empsked = Empsked.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @empsked }\n end\n end",
"def consulta\n fiesta = Fiesta.all\n render json: fiesta\n end",
"def employee(employee_id)\n get(\"employees/#{employee_id}\")\n end",
"def show\n @excepcion_entrega = ExcepcionEntrega.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @excepcion_entrega }\n end\n end",
"def index\n @employments = Employment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @employments }\n end\n end",
"def show\n @estacionamiento = Estacionamiento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @estacionamiento }\n end\n end",
"def expiracion\n @usuario = Usuario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @usuario }\n end\n end",
"def show\n \t@empresa = Core::Empresa.find(params[:empresa_id])\n @core_porto = Core::Porto.find(params[:id])\n\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @core_porto }\n end\n end",
"def show\n @estudiante = Estudiante.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @estudiante }\n end\n end",
"def index\n @employers = Employer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @employers }\n end\n end",
"def index\n #Para no mostrar el empleado oculto que se usa como superuser en la base de datos y el sistema\n @employees = Employee.where(\"id != 1\")\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @employees }\n end\n end",
"def index\n @empresas = Empresa.all\n end",
"def index\n @empresas = Empresa.all\n end",
"def index\n employees = manager.employees.active\n render json: employees.all, each_serializer: EmployeeSerializer, status: 200\n end",
"def index\n @equipos = Equipo.all\n render json: @equipos, status: :ok\n end",
"def index\n @empregos = Emprego.all\n end",
"def employee_vacations\n #vacaciones de este año\n vacations = Employee.find(params[:id]).get_vacation_days\n\n respond_to do |format|\n format.json { render json: vacations }\n end\n end",
"def index\n @employees = current_owner.employees.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @employees }\n end\n end",
"def getOrden \n \t@orden = Orden.where(:rest => params[:id_res])\n \trender json: @orden\n end",
"def index\n @assuntos = Assunto.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @assuntos }\n end\n end",
"def show\n @pessoa = Pessoa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pessoa }\n end\n end",
"def show\n @pessoa = Pessoa.find(params[:id])\n\n respond_to do |format|\n # format.html # show.html.erb\n format.json { render json: @pessoa }\n end\n end",
"def index\n @ef_pares = EfPare.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ef_pares }\n end\n end",
"def show\n @entrada_inventario = EntradaInventario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @entrada_inventario }\n end\n end",
"def show\n render json: Record.where(employee_id: params[:id])\n end",
"def show\n @employer = Employer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employer }\n end\n end",
"def index\n @eobs = Eob.assigned\n @title = \"Posted EOBs\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @eobs }\n end\n end",
"def show\n @consulta = Consulta.find(params[:id])\n\n render json: @consulta\n end",
"def show\n @emp_date_detail = EmpDateDetail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @emp_date_detail }\n end\n end",
"def index\n @titulo = \"Restaurante Dragon Ball\"\n @empresa = Empresa.find(1)\n @empresas = Empresa.all\n end",
"def ejemplares\n\t\tsnib = Geoportal::Snib.new\n\t\tsnib.params = params\n\t\tsnib.ejemplares\n\t\t\n\t\trender json: snib.resp\n\tend",
"def index\n @empleados_empresas = EmpleadosEmpresa.all\n end",
"def show\r\n @asistencia = Asistencia.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @asistencia }\r\n end\r\n end",
"def index\n @rowempls = Rowempl.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rowempls }\n end\n end",
"def show\n @rowempl = Rowempl.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rowempl }\n end\n end",
"def index\n @coordenador_estagios = CoordenadorEstagio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @coordenador_estagios }\n end\n end",
"def index\n @empleados = Empleado.all\n end",
"def index\n @empleados = Empleado.all\n end",
"def index\n logement = Logement.find_by(id:params[:logement_id])\n equipement = logement.equi_securites[0].title\n equipements = logement.equi_securites[0]\n\n render json: {\n securites:equipement,\n fichier:equipements\n }\n end",
"def show\n @equipamento = Equipamento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @equipamento }\n end\n end",
"def index\n @Empresas = Empresa.all\n end",
"def index\n @Empresas = Empresa.all\n end",
"def index\n @ofertas = Oferta.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @ofertas }\n end\n end",
"def show\n @escala = Escala.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @escala }\n end\n end",
"def show\n @employment = Employment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employment }\n end\n end",
"def index\n @repas = Repa.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @repas }\n end\n end",
"def show\n @eou = Eou.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @eou }\n end\n end",
"def show\n @exalt = Exalt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exalt }\n end\n end",
"def show\n @hisd_employee = HisdEmployee.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @hisd_employee }\n end\n end",
"def show\n @ventas_seguimiento = Ventas::Seguimiento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ventas_seguimiento }\n end\n end",
"def index\n @ores = Ore.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ores }\n end\n end",
"def show\n @soiree = Soiree.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @soiree }\n end\n end",
"def show\n @respuesta = Respuesta.find(params[:id])\n\n render json: @respuesta\n end",
"def emergencias_en_curso\n @emergencies = Emergency.where(:estado => 'f')\n render json: @emergencies\n end",
"def index\n @establecimientos = Establecimiento.all\n respond_to do |format|\n format.json { \n\n if (params[:appkey].eql? appkey) #si el appkey es correcto\n\n ests = @establecimientos.map { |establecimiento| { :nombre_establecimiento => establecimiento.nombre, :id => establecimiento.id, \n :descripcion => establecimiento.descripcion, :longitud => establecimiento.longitud,\n :latitud => establecimiento.latitud, :direccion => establecimiento.direccion, :imagen => establecimiento.foto.url(:small),\n :eventos => establecimiento.eventos.map { |evento| { :nombre => evento.nombre } } } } \n render json: ests\n else\n render json: {:error => \"No autorizado\"}\n end\n\n\n\n }\n format.html { redirect_to :controller=>'login', :action=>'login' } #solo el app movil puede revisar toda la lista de establecimientos.\n end\n end",
"def index\n org = Organization.find(current_employee.organization_id)\n @alerts = org.alerts\n render \"index.json.jbuilder\", status: :ok\n end",
"def show\n @humanidades1 = Humanidades1.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @humanidades1 }\n end\n end",
"def show\n @cargo_eleicao = CargoEleicao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cargo_eleicao }\n end\n end",
"def show\n @coordenador_estagio = CoordenadorEstagio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @coordenador_estagio }\n end\n end",
"def show\n @oferta_academica = OfertaAcademica.find(params[:id])\n\n render json: @oferta_academica\n end",
"def index\n @enderecos = Endereco.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @enderecos }\n end\n end",
"def show\n @espacio_deportivo = EspacioDeportivo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @espacio_deportivo }\n end\n end",
"def show\n @depoevento = Depoevento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @depoevento }\n end\n end",
"def show\n @empleadosautorizado = Empleadosautorizado.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @empleadosautorizado }\n end\n end",
"def show\n @apunte = Apunte.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @apunte }\n end\n end",
"def index\n @representante_empresas = RepresentanteEmpresa.all\n end",
"def index\n @empregadors = Empregador.all\n end",
"def index\n residencial = current_user.apartamento.residencial\n #@eventos = Evento.joins(:user => [{:apartamento => :residencial}])\n #.where(:residenciais => {:id => residencial.id})\n #.order(\"created_at DESC\")\n\n @eventos = Evento\n .where(:residencial_id => residencial.id)\n .order(\"created_at DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @eventos }\n end\n end",
"def show\n @projeto = Projeto.find(params[:id])\n @enrollments = Enroll.find_all_by_projeto_id params[:id]\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @projeto }\n end\n end",
"def show\n @asesor = Asesor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @asesor }\n end\n end",
"def show\n @oase = Oasis.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @oase }\n end\n end",
"def index\n @exemplaresprodutos = Exemplaresproduto.all\n end",
"def show\n @etudiant = Etudiant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @etudiant }\n end\n end",
"def index\n @programa_de_interes = ProgramaDeIntere.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @programa_de_interes }\n end\n end",
"def show\n @asiento = Asiento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @asiento }\n end\n end",
"def index\n @exercises = Exercise.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @exercises }\n end\n end",
"def index\n @exercises = Exercise.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @exercises }\n end\n end",
"def show\n @calificacione = Calificacione.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @calificacione }\n end\n end",
"def events\n url = 'https://api.artic.edu/api/v1/exhibitions?limit=35'\n\n res = RestClient.get(url)\n JSON.parse(res)\nend",
"def show\n @asociado = Asociado.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @asociado }\n end\n end",
"def show\n @sitio_entrega = SitioEntrega.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sitio_entrega }\n end\n end",
"def list_customers_manager\n @manager = User.find(params[:id])\n @employees = @manager.employee\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @employees }\n end\n end",
"def show\n @exura = Exura.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @exura }\n end\n end"
] | [
"0.7233606",
"0.6870134",
"0.6861099",
"0.6827971",
"0.6791959",
"0.6784153",
"0.66661274",
"0.6626827",
"0.660911",
"0.6591215",
"0.6589608",
"0.658852",
"0.65852696",
"0.6561057",
"0.65534",
"0.6548038",
"0.654691",
"0.65348655",
"0.6528294",
"0.6479397",
"0.64476657",
"0.64367557",
"0.6436043",
"0.6428814",
"0.6423203",
"0.641683",
"0.64040816",
"0.64037764",
"0.6403329",
"0.639877",
"0.639877",
"0.6388011",
"0.63830256",
"0.637487",
"0.636201",
"0.63614196",
"0.63583696",
"0.635407",
"0.63443786",
"0.63335335",
"0.6330609",
"0.6324253",
"0.63200486",
"0.6314386",
"0.6312115",
"0.63106066",
"0.63077044",
"0.6299814",
"0.62995225",
"0.6294569",
"0.6284457",
"0.62796825",
"0.6278289",
"0.62720937",
"0.62563735",
"0.62563735",
"0.6256261",
"0.6256247",
"0.6254117",
"0.6254117",
"0.62506187",
"0.62500936",
"0.624153",
"0.62354976",
"0.6232907",
"0.6230944",
"0.62204975",
"0.6209474",
"0.6205319",
"0.620186",
"0.62004197",
"0.6191568",
"0.6184751",
"0.6177163",
"0.6175935",
"0.6170666",
"0.61684453",
"0.6168053",
"0.61649495",
"0.6163124",
"0.6158116",
"0.6151563",
"0.6151092",
"0.6139473",
"0.61371744",
"0.61263156",
"0.6125086",
"0.61215085",
"0.61163294",
"0.6115728",
"0.61147255",
"0.61128294",
"0.6110749",
"0.6108903",
"0.6108903",
"0.6108683",
"0.6107723",
"0.61043984",
"0.609876",
"0.6096902",
"0.6096582"
] | 0.0 | -1 |
POST /empresas POST /empresas.json | def create
@institucion = Institucion.new(institucion_params)
respond_to do |format|
if @institucion.save
format.html { redirect_to @institucion, notice: 'Empresa se ha creado correctamente.' }
format.json { render :show, status: :created, location: @institucion }
else
format.html { render :new }
format.json { render json: @institucion.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @empresas = Empresa.new(empresa_params)\n\n respond_to do |format|\n if @empresas.save\n format.html { redirect_to @empresas, notice: 'Empresa was successfully created.' }\n format.json { render :show, status: :created, location: @empresas }\n else\n format.html { render :new }\n format.json { render json: @empresas.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @emprestimo = Emprestimo.new(emprestimo_params)\n\n respond_to do |format|\n if @emprestimo.save\n format.html { redirect_to @emprestimo, notice: 'Reserva/Empréstimo foi Adicionado.' }\n format.json { render :show, status: :created, location: @emprestimo }\n else\n format.html { render :new }\n format.json { render json: @emprestimo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @emprego = Emprego.new(emprego_params)\n\n respond_to do |format|\n if @emprego.save\n format.html { redirect_to @emprego, notice: 'Emprego was successfully created.' }\n format.json { render action: 'show', status: :created, location: @emprego }\n else\n format.html { render action: 'new' }\n format.json { render json: @emprego.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @empleado = Empleado.new(empleado_params)\n\n respond_to do |format|\n if @empleado.save\n format.html { redirect_to @empleado, notice: 'Empleado was successfully created.' }\n format.json { render action: 'show', status: :created, location: @empleado }\n else\n format.html { render action: 'new' }\n format.json { render json: @empleado.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @empleado = Empleado.new(empleado_params)\n\n respond_to do |format|\n if @empleado.save\n format.html { redirect_to empleados_path, notice: 'Registro de Empleado creado.' }\n format.json { render :show, status: :created, location: @empleado }\n else\n format.html { render :new }\n format.json { render json: @empleado.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @empleado = Empleado.new(empleado_params)\n\n respond_to do |format|\n if @empleado.save\n format.html { redirect_to @empleado, notice: 'Empleado fue creado exitosamente.' }\n format.json { render :show, status: :created, location: @empleado }\n else\n format.html { render :new }\n format.json { render json: @empleado.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @empleado = Empleado.new(empleado_params)\n\n respond_to do |format|\n if @empleado.save\n format.html { redirect_to @empleado, notice: 'Se ha creado un nuevo empleado.' }\n format.json { render :show, status: :created, location: @empleado }\n else\n format.html { render :new }\n format.json { render json: @empleado.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @etapa = Etapa.new(etapa_params)\n\n respond_to do |format|\n if @etapa.save\n format.html { redirect_to @etapa, notice: 'Etapa fue creada exitosamente.' }\n format.json { render :show, status: :created, location: @etapa }\n else\n format.html { render :new }\n format.json { render json: @etapa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @estatuto = Estatuto.new(params[:estatuto])\n\n respond_to do |format|\n if @estatuto.save\n format.html { redirect_to @estatuto, notice: 'Estatuto was successfully created.' }\n format.json { render json: @estatuto, status: :created, location: @estatuto }\n else\n format.html { render action: \"new\" }\n format.json { render json: @estatuto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @empregador = Empregador.new(empregador_params)\n\n respond_to do |format|\n if @empregador.save\n format.html { redirect_to empregadors_path, notice: 'O Empregador foi criado com sucesso!.' }\n format.json { render :show, status: :created, location: @empregador }\n else\n format.html { render :new }\n format.json { render json: @empregador.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @exemplaresproduto = Exemplaresproduto.new(exemplaresproduto_params)\n\n respond_to do |format|\n if @exemplaresproduto.save\n format.html { redirect_to @exemplaresproduto, notice: 'Exemplaresproduto was successfully created.' }\n format.json { render :show, status: :created, location: @exemplaresproduto }\n else\n format.html { render :new }\n format.json { render json: @exemplaresproduto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @empleado_especialidad = EmpleadoEspecialidad.new(empleado_especialidad_params)\n\n respond_to do |format|\n if @empleado_especialidad.save\n format.html { redirect_to @empleado_especialidad, notice: 'Empleado especialidad was successfully created.' }\n format.json { render :show, status: :created, location: @empleado_especialidad }\n else\n format.html { render :new }\n format.json { render json: @empleado_especialidad.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @etnia = Etnia.new(params[:etnia])\n\n respond_to do |format|\n if @etnia.save\n format.html { redirect_to @etnia, notice: 'Etnia was successfully created.' }\n format.json { render json: @etnia, status: :created, location: @etnia }\n else\n format.html { render action: \"new\" }\n format.json { render json: @etnia.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @empresa = Empresa.new(empresa_params)\n\n respond_to do |format|\n if @empresa.save\n format.html { redirect_to @empresa, notice: 'Empresa creada exitosamente.' }\n format.json { render :show, status: :created, location: @empresa }\n else\n format.html { render :new }\n format.json { render json: @empresa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @empresario = Empresario.new(empresario_params)\n @empresario.creador = current_user.id\n @empresario.modificador = current_user.id\n\n respond_to do |format|\n if @empresario.save\n format.html { redirect_to @empresario, notice: 'Empresario was successfully created.' }\n format.json { render :show, status: :created, location: @empresario }\n else\n format.html { render :new }\n format.json { render json: @empresario.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @expediente = Expediente.new(params[:expediente])\n \n respond_to do |format|\n if @expediente.save\n format.html { redirect_to @expediente, notice: 'Expediente was successfully created.' }\n format.json { render json: @expediente, status: :created, location: @expediente }\n else\n format.html { render action: \"new\" }\n format.json { render json: @expediente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ejemplo = Ejemplo.new(ejemplo_params)\n\n respond_to do |format|\n if @ejemplo.save\n format.html { redirect_to @ejemplo, notice: 'Ejemplo was successfully created.' }\n format.json { render :show, status: :created, location: @ejemplo }\n else\n format.html { render :new }\n format.json { render json: @ejemplo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @solicitacao_repass = SolicitacaoRepasse.new(solicitacao_repasse_params)\n @entregas_externas = EntregaExterna.all\n @entregas_externas_usuario = []\n @entregas_externas.each { |entrega|\n if !@current_user.isMorador || entrega.encomenda.usuario.id == @current_user.id\n @entregas_externas_usuario.push(entrega)\n end\n }\n\n respond_to do |format|\n if @solicitacao_repass.save\n format.html { redirect_to @solicitacao_repass, notice: \"Solicitacao repasse was successfully created.\" }\n format.json { render :show, status: :created, location: @solicitacao_repass }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @solicitacao_repass.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @empleados_empresa = EmpleadosEmpresa.new(empleados_empresa_params)\n @empleados_empresa.status = 0\n\n respond_to do |format|\n if @empleados_empresa.save\n format.html { redirect_to @empleados_empresa, notice: 'Miembro de equipo de trabajo agregado correctamente' }\n format.json { render :show, status: :created, location: @empleados_empresa }\n else\n format.html { render :new }\n format.json { render json: @empleados_empresa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @faltante = Faltante.new(faltante_params)\n @employees = Employee.all\n @faltantes = Tipofaltante.all\n \n respond_to do |format|\n if @faltante.save\n format.html { redirect_to @faltante, notice: 'Faltante was successfully created.' }\n format.json { render :show, status: :created, location: @faltante }\n else\n format.html { render :new }\n format.json { render json: @faltante.errors, status: :unprocessable_entity }\n end\n end\n end",
"def empleado_params\n params.require(:empleado).permit(:nombre, :nombre2, :apellido1, :apellido2, :rut, :cargo, :fecha_ingreso, :foto, :comunidad_id)\n end",
"def emprego_params\n params.require(:emprego).permit(:titulo, :descricao, :data_inicio, :data_expiracao, :ID_Usuario, :ID_Tipo_de_Emprego)\n end",
"def create\n @estabelecimento = Estabelecimento.new(params[:estabelecimento])\n\n respond_to do |format|\n if @estabelecimento.save\n format.html { redirect_to @estabelecimento, :notice => 'Estabelecimento was successfully created.' }\n format.json { render :json => @estabelecimento, :status => :created, :location => @estabelecimento }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @estabelecimento.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @respuesta = Respuesta.new(params[:respuesta])\n\n if @respuesta.save\n render json: @respuesta, status: :created, location: @respuesta\n else\n render json: @respuesta.errors, status: :unprocessable_entity\n end\n end",
"def create\n @empleadosautorizado = Empleadosautorizado.new(params[:empleadosautorizado])\n\n respond_to do |format|\n if @empleadosautorizado.save\n format.html { redirect_to(@empleadosautorizado, :notice => 'Empleadosautorizado was successfully created.') }\n format.xml { render :xml => @empleadosautorizado, :status => :created, :location => @empleadosautorizado }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @empleadosautorizado.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def emprestimo_params\n params.require(:emprestimo).permit(:user_id, :equipamento_id, :data_inicio, :data_fim, :situacao)\n end",
"def emprestimo_params\n params.require(:emprestimo).permit(:aluno_id, :livro_id)\n end",
"def create\n @estabelecimento = Estabelecimento.new(params[:estabelecimento])\n\n respond_to do |format|\n if @estabelecimento.save\n format.html { redirect_to @estabelecimento, notice: 'Estabelecimento was successfully created.' }\n format.json { render json: @estabelecimento, status: :created, location: @estabelecimento }\n else\n format.html { render action: \"new\" }\n format.json { render json: @estabelecimento.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ejercicio = Ejercicio.new(params[:ejercicio])\n\n respond_to do |format|\n if @ejercicio.save\n format.html { redirect_to @ejercicio, notice: 'Ejercicio was successfully created.' }\n format.json { render json: @ejercicio, status: :created, location: @ejercicio }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ejercicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @empresa = Empresa.find(params[:empresa_id])\n\n @tipo_de_imposto = TipoDeImposto.new(tipo_de_imposto_params)\n @tipo_de_imposto.empresa_id = @empresa.id\n\n respond_to do |format|\n if @tipo_de_imposto.save\n format.html { redirect_to @empresa, notice: 'Tipo de imposto adicionado com sucesso.' }\n format.json { render :show, status: :created, location: @tipo_de_imposto }\n else\n format.html { render :new }\n format.json { render json: @tipo_de_imposto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def empleado_params\n params.require(:empleado).permit(:nro_legajo, :tipo_documento_id, :nro_documento, :apellido, :nombre, :fecha_alta, :fecha_baja)\n end",
"def create\n @emprendedor = Emprendedor.new(params[:emprendedor])\n\n respond_to do |format|\n if @emprendedor.save\n format.html { redirect_to @emprendedor, notice: 'El Emprendedor fue creado con exito.' }\n format.json { render json: @emprendedor, status: :created, location: @emprendedor }\n else\n format.html { render action: \"new\" }\n format.json { render json: @emprendedor.errors, status: :unprocessable_entity }\n end\n end\n end",
"def empleados_empresa_params\n params.require(:empleados_empresa).permit(:empresa_id, :profesional_id, :puesto)\n end",
"def create\n @responsavel = Responsavel.new(responsavel_params)\n\n if @responsavel.save\n render json: @responsavel, status: :created, location: @responsavel\n else\n render json: @responsavel.errors, status: :unprocessable_entity\n end\n end",
"def create\n @exemption = Exemption.new(exemption_params)\n\n respond_to do |format|\n if @exemption.save\n format.html { redirect_to @exemption, notice: 'Exemption was successfully created.' }\n format.json { render :show, status: :created, location: @exemption }\n else\n format.html { render :new }\n format.json { render json: @exemption.errors, status: :unprocessable_entity }\n end\n end\n end",
"def etapa_params\n params.require(:etapa).permit(:fase_id, :nm_etapa, :nr_sequencia, :responsavel_id, :obs, :created_by, :updated_by)\n end",
"def create\n @employee = Employee.new(employee_params)\n\n respond_to do |format|\n if @employee.save\n format.html { redirect_to employees_url, notice: 'Funcionário foi criado com sucesso!' }\n else\n format.html { render :new }\n format.json { render json: @employee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def empleado_params\n params.require(:empleado).permit(:codigo, :dni, :nombre, :apellido, :fechaNacimiento, :direccion, :categoria_id, :departamento_id, :antiguedad)\n end",
"def create\n @estrada = Estrada.new(estrada_params)\n\n respond_to do |format|\n if @estrada.save\n format.html { redirect_to estradas_url, notice: 'Estrada criada com sucesso.' }\n format.json { render :show, status: :created, location: @estrada }\n else\n format.html { render :new }\n format.json { render json: @estrada.errors, status: :unprocessable_entity }\n end\n end\n end",
"def empleado_params\n params.require(:empleado).permit(:nombre, :apellido, :cuit)\n end",
"def create\n @establecimiento = Establecimiento.new(establecimiento_params)\n\n respond_to do |format|\n if @establecimiento.save\n format.html { redirect_to @establecimiento, notice: 'Establecimiento was successfully created.' }\n format.json { render :show, status: :created, location: @establecimiento }\n else\n format.html { render :new }\n format.json { render json: @establecimiento.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @empl = Empl.new(empl_params)\n\n respond_to do |format|\n if @empl.save\n format.html { redirect_to @empl, notice: 'Empl was successfully created.' }\n format.json { render :show, status: :created, location: @empl }\n else\n format.html { render :new }\n format.json { render json: @empl.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @aga_employee = AgaEmployee.new(aga_employee_params)\n\n respond_to do |format|\n if @aga_employee.save\n format.html { redirect_to @aga_employee, notice: 'Aga employee was successfully created.' }\n format.json { render :show, status: :created, location: @aga_employee }\n else\n format.html { render :new }\n format.json { render json: @aga_employee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @empresas = Empresa.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @empresas }\n end\n end",
"def create\n @empresa = Empresa.new(empresa_params)\n @empresa.creador = current_user.id\n @empresa.modificador = current_user.id\n\n respond_to do |format|\n if @empresa.save\n format.html { redirect_to @empresa, notice: 'Empresa was successfully created.' }\n format.json { render :show, status: :created, location: @empresa }\n else\n format.html { render :new }\n format.json { render json: @empresa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @employe = Employe.new(employe_params)\n\n respond_to do |format|\n if @employe.save!\n \n params = {:nom => @employe.nom, :email => @employe.courriel, :password => \"password\", :role => Role.where(id: @employe.role_id).first.role}\n uri = URI.parse(\"http://fierce-earth-91666.herokuapp.com/usagers/sign_up\")\n http = Net::HTTP.new(uri.host, uri.port)\n request = Net::HTTP::Post.new(uri.request_uri)\n request.set_form_data(params)\n response = http.request(request)\n\n\n puts response.code # => 200\n puts response.body # => The body (HTML, JSON, etc)\n \n format.html { redirect_to action: :index , api_id: @employe.organisme_id }\n format.json { render :show, status: :created, location: @employe }\n else\n format.html { render :new }\n format.json { render json: @employe.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n puts 'AQQQQQUUUUUUUIIIIII'\n json = ActiveSupport::JSON.decode(params[:pessoa])\n puts json\n @pessoa = Pessoa.new(json)\n # @address = Address.new(params[:address])\n\n # @client.addresses = @address\n\n respond_to do |format|\n if @pessoa.save\n format.html { redirect_to @pessoa, notice: 'Pessoa was successfully created.' }\n format.json { render json: @pessoa, status: :created, location: @pessoa }\n else\n format.html { render action: \"new\" }\n format.json { render json: @pessoa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @empleado = Empleado.find(params[:empleado_id])\n @incidencia_empleado = @empleado.incidencia_empleados.new(incidencia_empleado_params)\n\n respond_to do |format|\n if @incidencia_empleado.save\n format.html { redirect_to [@incidencia_empleado.empleado, @incidencia_empleado], notice: 'La Incidencia fue Asignada correctamente.' }\n format.json { render :show, status: :created, location: @incidencia_empleado }\n else\n format.html { render :new }\n format.json { render json: @incidencia_empleado.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @excepcion_entrega = ExcepcionEntrega.new(params[:excepcion_entrega])\n\n respond_to do |format|\n if @excepcion_entrega.save\n format.html { redirect_to @excepcion_entrega, notice: 'Excepcion entrega was successfully created.' }\n format.json { render json: @excepcion_entrega, status: :created, location: @excepcion_entrega }\n else\n format.html { render action: \"new\" }\n format.json { render json: @excepcion_entrega.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @consulta = Consulta.new(params[:consulta])\n\n if @consulta.save\n render json: @consulta, status: :created, location: @consulta\n else\n render json: @consulta.errors, status: :unprocessable_entity\n end\n end",
"def create\n # raise params.to_s\n @employee = Employee.new(employee_params)\n\n respond_to do |format|\n if @employee.save\n format.html { redirect_to @employee, notice: 'Работник создан.' }\n format.json { render :show, status: :created, location: @employee }\n else\n format.html { render :new }\n format.json { render json: @employee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @alumno = Alumno.new(params[:alumno])\n\n respond_to do |format|\n if @alumno.save\n render json: @alumno.as_json(include: :persona), status: :created, location: @alumno\n else\n render json: @alumno.errors, status: :unprocessable_entity\n end\n end\n end",
"def create\n @eje = Eje.new(eje_params)\n\n respond_to do |format|\n if @eje.save\n format.html { redirect_to @eje, notice: 'Eje was successfully created.' }\n format.json { render :show, status: :created, location: @eje }\n else\n format.html { render :new }\n format.json { render json: @eje.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create \n examenes = params[:examenes]\n byebug \n\n if !params[:perfil][:nombre].nil? || !params[:perfil][:nombre].blank?\n @perfil = Perfil.new(perfil_params) \n @perfil.save\n \n respond_to do |format|\n if @perfil.save\n \n examenes.each do |examen|\n @perfil_examenes = PerfilExamene.new\n @perfil_examenes.perfil_id = @perfil.id\n @perfil_examenes.tipo_examen_id = examen\n @perfil_examenes.save\n end \n \n byebug\n\n format.html { redirect_to perfils_path, notice: 'El Perfil fue creado exitosamente' }\n format.json { render json: { :examenes => examen } }\n else\n \n format.html { render :new }\n format.json { render json: { :examenes => examen } }\n end\n end\n else\n \n respond_to do |format| \n format.html { redirect_to perfils_path, notice: 'El Perfil no fue creado correctamente vuelva a intentarlo' }\n format.json { render json: { :examenes => examen } } \n end\n end \n\n end",
"def create\n @employe = Employe.new(params[:employe])\n\n respond_to do |format|\n if @employe.save\n format.html { redirect_to @employe, notice: 'Employe was successfully created.' }\n format.json { render json: @employe, status: :created, location: @employe }\n else\n format.html { render action: \"new\" }\n format.json { render json: @employe.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @plan_quirurgico = PlanQuirurgico.new(plan_quirurgico_params)\n @plan_quirurgico.servicios = params[:servicios]\n @plan_quirurgico.estatus = \"En Proceso\"\n puts params\n puts @plan_quirurgico.examen \n respond_to do |format|\n if @plan_quirurgico.save\n format.html { redirect_to @plan_quirurgico, notice: 'El plan quirurgico fue registrado exitosamente.' }\n format.json { render :show, status: :created, location: @plan_quirurgico }\n else\n format.html { render :new }\n format.json { render json: @plan_quirurgico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @employee = Employee.new(params[:employee])\n\n respond_to do |format|\n if @employee.save\n CustomLogger.info(\"Se crea empleado: #{@employee}, usuario: #{current_user.inspect}, #{Time.now}\")\n format.html { redirect_to new_employee_path, notice: 'Empleado Creado Exitosamente!' }\n format.json { render json: @employee, status: :created, location: @employee }\n else\n CustomLogger.error(\"Error al crear empleado: #{@employee}, usuario: #{current_user.inspect}, #{Time.now}\")\n format.html { render action: \"new\" }\n format.json { render json: @employee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @elecapp = Elecapp.new(from: params[:from], to: params[:to], text: params[:text], date: params[:date], ATXid: params[:ATXid], linkId: params[:linkId])\n respond_to do |format|\n if @elecapp.save\n format.html { redirect_to @elecapp, notice: \"saved successfully\"}\n format.json { render json: @elecapp}\n end\n end\n end",
"def create\n @comentario_egresado = ComentarioEgresado.new(comentario_egresado_params)\n\n respond_to do |format|\n if @comentario_egresado.save\n format.html { redirect_to @comentario_egresado, notice: 'Comentario egresado was successfully created.' }\n format.json { render :show, status: :created, location: @comentario_egresado }\n else\n format.html { render :new }\n format.json { render json: @comentario_egresado.errors, status: :unprocessable_entity }\n end\n end\n end",
"def empregador_params\n params.require(:empregador).permit(:nome, :cnpj)\n end",
"def create\n @Empresa = Empresa.find(params[:empresa_id])\n p simulacion_params[:id]\n if simulacion_params[:id]!=nil\n respond_to do |format| \n format.html { render json: 1 and return}\n end\n end\n simulacion=@Empresa.simulacions.new(simulacion_params)\n respond_to do |format|\n if simulacion.save\n format.html { render json: {simulacion:simulacion}}\n else\n format.html { render action: simulacion.errors }\n end\n end\n end",
"def ejemplares\n\t\tsnib = Geoportal::Snib.new\n\t\tsnib.params = params\n\t\tsnib.ejemplares\n\t\t\n\t\trender json: snib.resp\n\tend",
"def create\n @estacionamiento = Estacionamiento.new(params[:estacionamiento])\n\n respond_to do |format|\n if @estacionamiento.save\n format.html { redirect_to @estacionamiento, notice: 'Estacionamiento was successfully created.' }\n format.json { render json: @estacionamiento, status: :created, location: @estacionamiento }\n else\n format.html { render action: \"new\" }\n format.json { render json: @estacionamiento.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @empsked = Empsked.new(params[:empsked])\n\n respond_to do |format|\n if @empsked.save\n format.html { redirect_to @empsked, notice: 'Empsked was successfully created.' }\n format.json { render json: @empsked, status: :created, location: @empsked }\n else\n format.html { render action: \"new\" }\n format.json { render json: @empsked.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @representante_empresa = RepresentanteEmpresa.new(representante_empresa_params)\n\n respond_to do |format|\n if @representante_empresa.save\n format.html { redirect_to @representante_empresa, notice: 'Representante empresa was successfully created.' }\n format.json { render :show, status: :created, location: @representante_empresa }\n else\n format.html { render :new }\n format.json { render json: @representante_empresa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def empresa_params\n params.require(:empresa).permit(:name, :ruc, :direccion, :telefono, :moneda, :igv, :about_1, :about_2, :logo)\n end",
"def create\n @enfermeras_paciente = EnfermerasPaciente.new(enfermeras_paciente_params)\n\n respond_to do |format|\n if @enfermeras_paciente.save\n format.html { redirect_to @enfermeras_paciente, notice: 'Enfermeras paciente was successfully created.' }\n format.json { render :show, status: :created, location: @enfermeras_paciente }\n else\n format.html { render :new }\n format.json { render json: @enfermeras_paciente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @empleado_cliente = EmpleadoCliente.new(empleado_cliente_params)\n\n respond_to do |format|\n if @empleado_cliente.save\n format.html { redirect_to @empleado_cliente, notice: 'Empleado cliente was successfully created.' }\n format.json { render :show, status: :created, location: @empleado_cliente }\n else\n format.html { render :new }\n format.json { render json: @empleado_cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @employee = User.new(employee_params)\n\n respond_to do |format|\n if @employee.save\n format.html { redirect_to employees_path, notice: 'El empleado ha sido creado con éxito.' }\n format.json { render :show, status: :created, location: @employee }\n else\n format.html { render :new }\n format.json { render json: @employee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.create(post_params)\n puts \"LLLLLOOOOOOOLLLLLL\"\n puts current_usuario.to_json\n @post = current_usuario.posts.create(post_params)\n \n @post.sangre = current_usuario.tipoDeSangre\n\n\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @alegeri_user_tema = AlegeriUserTema.new(alegeri_user_tema_params)\n\n respond_to do |format|\n if @alegeri_user_tema.save\n format.html { redirect_to @alegeri_user_tema, notice: 'Alegeri user tema was successfully created.' }\n format.json { render action: 'show', status: :created, location: @alegeri_user_tema }\n else\n format.html { render action: 'new' }\n format.json { render json: @alegeri_user_tema.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tipo_exame = TipoExame.new(tipo_exame_params)\n\n respond_to do |format|\n if @tipo_exame.save\n format.html { redirect_to @tipo_exame, notice: 'Tipo exame was successfully created.' }\n format.json { render :show, status: :created, location: @tipo_exame }\n else\n format.html { render :new }\n format.json { render json: @tipo_exame.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tiempo = Tiempo.new(tiempo_params)\n\n respond_to do |format|\n if @tiempo.save\n format.html { redirect_to @tiempo, notice: 'Tiempo was successfully created.' }\n format.json { render :show, status: :created, location: @tiempo }\n else\n format.html { render :new }\n format.json { render json: @tiempo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @esjiaoben = Esjiaoben.new(esjiaoben_params)\n\n respond_to do |format|\n if @esjiaoben.save\n format.html { redirect_to @esjiaoben, notice: 'Esjiaoben was successfully created.' }\n format.json { render :show, status: :created, location: @esjiaoben }\n else\n format.html { render :new }\n format.json { render json: @esjiaoben.errors, status: :unprocessable_entity }\n end\n end\n end",
"def empresa_params\n params.require(:empresa).permit(:empr_documentoIdentidad, :empr_razonSocial, :empr_nombreCorto, :empr_tipoEmpresa, :empr_sectorEconomico, :empr_docIdentReprLegal, :empr_sitioWeb, :empr_correoElectronico, :empr_otrosDatos, :empr_estadoRegistro)\n end",
"def create\n @etude = Etude.new(etude_params)\n\n respond_to do |format|\n if @etude.save\n format.html { redirect_to @etude, notice: 'Etude was successfully created.' }\n format.json { render :show, status: :created, location: @etude }\n else\n format.html { render :new }\n format.json { render json: @etude.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @employee = Employee.new(employee_params)\n @employee.user_created_id = current_user.id\n @employee.usuario_externo\n @employee.usuario = params[:employee][:usuario]\n @employee.previous_profile_security = params[:employee][:security_profiles_id]\n respond_to do |format|\n if @employee.save\n format.html { redirect_to employees_path, notice: I18n.t('.employees.controller.create') }\n format.json { render :show, status: :created, location: @employee }\n else\n format.html { render :new }\n format.json { render json: @employee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def empresario_params\n params.require(:empresario).permit(:municipio, :activo, :modificador, :creador, :descripcion, :nombre, :apellido, :cedula, :sexo, :empresa, :telefono, :celular, :email, :whatsapp, :instagram, :twitter, :facebook, :puntov, :cNombre, :cCel1, :cCel2, :cTel, :cWhatsapp, :cEmail, :picture)\n end",
"def create\n @etapa = Etapa.new(etapa_params)\n\n respond_to do |format|\n if @etapa.save\n format.html { redirect_to board_url(@etapa.board), notice: 'Etapa was successfully created.' }\n format.json { render :show, status: :created, location: @etapa }\n else\n format.html { render :new }\n format.json { render json: @etapa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @cargo_eleicao = CargoEleicao.new(params[:cargo_eleicao])\n\n respond_to do |format|\n if @cargo_eleicao.save\n format.html { redirect_to @cargo_eleicao, notice: 'Cargo eleicao was successfully created.' }\n format.json { render json: @cargo_eleicao, status: :created, location: @cargo_eleicao }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cargo_eleicao.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @empleado = Empleado.find(params[:empleado_id])\n @contrato_empleado = @empleado.contrato_empleados.new(contrato_empleado_params)\n\n respond_to do |format|\n if @contrato_empleado.save\n format.html { redirect_to [@contrato_empleado.empleado, @contrato_empleado], notice: 'Contrato Empleado was successfully created.' }\n format.json { render :show, status: :created, location: @contrato_empleado }\n else\n format.html { render :new }\n format.json { render json: @contrato_empleado.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @estabelecimento = Estabelecimento.new(estabelecimento_params)\n @usuario = Usuario.find(usuario_params[:id])\n @estabelecimento_usuario = EstabelecimentosUsuario.create(estabelecimento: @estabelecimento, usuario: @usuario, ic_criador: true)\n\n respond_to do |format|\n if @estabelecimento.save\n format.html { redirect_to @estabelecimento, notice: 'Estabelecimento was successfully created.' }\n format.json { render json: @estabelecimento }\n else\n format.html { render :new }\n format.json { render json: @estabelecimento.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tiendas_juego = TiendasJuego.new(tiendas_juego_params)\n\n respond_to do |format|\n if @tiendas_juego.save\n format.html { redirect_to @tiendas_juego, notice: 'Tiendas juego was successfully created.' }\n format.json { render :show, status: :created, location: @tiendas_juego }\n else\n format.html { render :new }\n format.json { render json: @tiendas_juego.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @asiento = Asiento.new(params[:asiento])\n\n respond_to do |format|\n if @asiento.save\n format.html { redirect_to @asiento, :notice => 'El apunte fue creado.' }\n format.json { render :json => @asiento, :status => :created, :location => @asiento }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @asiento.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @eou = Eou.new(params[:eou])\n\n respond_to do |format|\n if @eou.save\n format.html { redirect_to @eou, :notice => 'Eou was successfully created.' }\n format.json { render :json => @eou, :status => :created, :location => @eou }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @eou.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @oferta_academica = OfertaAcademica.new(params[:oferta_academica])\n\n if @oferta_academica.save\n render json: @oferta_academica, status: :created, location: @oferta_academica\n else\n render json: @oferta_academica.errors, status: :unprocessable_entity\n end\n end",
"def create\n @etape = Etape.new(params[:etape])\n\n respond_to do |format|\n if @etape.save\n format.html { redirect_to @etape, notice: 'Etape was successfully created.' }\n format.json { render json: @etape, status: :created, location: @etape }\n else\n format.html { render action: \"new\" }\n format.json { render json: @etape.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @employee = Employee.new(employee_params)\n\n if @employee.save\n render :show, status: :created, location: @employee\n else\n render json: @employee.errors, status: :unprocessable_entity\n end\n end",
"def new\n @empresa = Empresa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @empresa }\n end\n end",
"def create\n @payrolls = Payroll.all \n @employees = Employee.where(:planilla=> \"1\").order(:lastname)\n \n @horas_me = HorasMe.new(horas_me_params)\n @horas_me[:tot] = @horas_me[:dt]+ @horas_me[:fal]+@horas_me[:sub]+@horas_me[:dm]+@horas_me[:pat] +@horas_me[:vac] \n \n\n respond_to do |format|\n if @horas_me.save\n format.html { redirect_to @horas_me, notice: 'Horas me was successfully created.' }\n format.json { render :show, status: :created, location: @horas_me }\n else\n format.html { render :new }\n format.json { render json: @horas_me.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @exames_paciente = ExamesPaciente.new(exames_paciente_params)\n\n respond_to do |format|\n if @exames_paciente.save\n format.html { redirect_to @exames_paciente, notice: 'Exames paciente was successfully created.' }\n format.json { render :show, status: :created, location: @exames_paciente }\n else\n format.html { render :new }\n format.json { render json: @exames_paciente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @osoba = Osoba.new(params[:osoba])\n\n if @osoba.save\n render json: @osoba, status: :created, location: @osoba\n else\n render json: @osoba.errors, status: :unprocessable_entity\n end\n end",
"def postEntityEmployee( entity_id, title, forename, surname, job_title, description, email, phone_number)\n params = Hash.new\n params['entity_id'] = entity_id\n params['title'] = title\n params['forename'] = forename\n params['surname'] = surname\n params['job_title'] = job_title\n params['description'] = description\n params['email'] = email\n params['phone_number'] = phone_number\n return doCurl(\"post\",\"/entity/employee\",params)\n end",
"def create\n\n @horario_empleado = HorarioEmpleado.new(horario_empleado_params)\n @horario_empleado.empleado_id = params[:horario_empleado][:empleado_id]\n \n #redirect_to([@diagnostico.consultum, @diagnostico]\n\n respond_to do |format|\n if @horario_empleado.save\n format.html { redirect_to request.referrer, notice: 'Horario empleado was successfully created.' }\n #format.json { render :show, status: :created, location: @horario_empleado }\n else\n format.html { render :new }\n #format.json { render json: @horario_empleado.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @entrada_produto = EntradaProduto.new(entrada_produto_params)\n\n respond_to do |format|\n if @entrada_produto.save\n format.html { redirect_to @entrada_produto, notice: 'Entrada produto was successfully created.' }\n format.json { render :show, status: :created, location: @entrada_produto }\n else\n format.html { render :new }\n format.json { render json: @entrada_produto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def empresa_params\n params.require(:empresa).permit(:codigo, :nombre, :catfiscal_id, :ctaivacompras, :ctaivaventas)\n end",
"def create\n @estadia = Estadia.new(estadia_params)\n\n #Quando cria uma estadia nova, seta a data como a hora corrente\n @estadia.data_entrada = Time.now\n #ocupa a vaga\n @estadia.vaga.ocupada = true\n\n respond_to do |format|\n if @estadia.vaga.save && @estadia.save\n format.html { redirect_to @estadia, notice: 'Estadia was successfully created.' }\n format.json { render :show, status: :created, location: @estadia }\n else\n format.html { render :new }\n format.json { render json: @estadia.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ejercicio = Ejercicio.new(ejercicio_params)\n\n respond_to do |format|\n if @ejercicio.save\n format.html { redirect_to @ejercicio, notice: 'Ejercicio creado con exito..' }\n format.json { render :show, status: :created, location: @ejercicio }\n else\n format.html { render :new }\n format.json { render json: @ejercicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @sugerencia = Sugerencia.new(params[:sugerencia])\n\n respond_to do |format|\n if @sugerencia.save\n format.html { redirect_to @sugerencia, :notice => 'Sugerencia was successfully created.' }\n format.json { render :json => @sugerencia, :status => :created, :location => @sugerencia }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @sugerencia.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def etapa_params\n params.require(:etapa).permit(:nombre, :descripcion, :etapaAnterior)\n end",
"def create\n @entrega = Entrega.new(entrega_params)\n\n respond_to do |format|\n if @entrega.save\n format.html { redirect_to @entrega, notice: 'Entrega creada con éxito.' }\n format.json { render :show, status: :created, location: @entrega }\n else\n format.html { render :new }\n format.json { render json: @entrega.errors, status: :unprocessable_entity }\n end\n end\n end"
] | [
"0.682665",
"0.67328596",
"0.6690261",
"0.6681895",
"0.6662854",
"0.664385",
"0.66416675",
"0.66150993",
"0.6603925",
"0.65711516",
"0.65581477",
"0.6411651",
"0.64064705",
"0.63886887",
"0.6331809",
"0.62992203",
"0.6278001",
"0.62636393",
"0.6254142",
"0.62410516",
"0.6208078",
"0.6198569",
"0.6181966",
"0.61672103",
"0.6164135",
"0.6163612",
"0.61009765",
"0.609817",
"0.60734105",
"0.60694814",
"0.6068958",
"0.6059606",
"0.60535365",
"0.60510033",
"0.6045932",
"0.6043843",
"0.60427135",
"0.60426813",
"0.60371333",
"0.60353994",
"0.6032626",
"0.6019296",
"0.60029465",
"0.6000658",
"0.5993876",
"0.5992491",
"0.5989686",
"0.59756464",
"0.59697473",
"0.59696054",
"0.5965752",
"0.59642464",
"0.59628505",
"0.596249",
"0.5958119",
"0.5951134",
"0.59311527",
"0.59233695",
"0.59214306",
"0.59207577",
"0.59204245",
"0.59192604",
"0.59169376",
"0.5915657",
"0.59133995",
"0.5908562",
"0.59067094",
"0.590412",
"0.5901572",
"0.5899901",
"0.589967",
"0.58979344",
"0.5897304",
"0.58961105",
"0.5894065",
"0.5890888",
"0.58905035",
"0.5889232",
"0.58880603",
"0.588732",
"0.5887015",
"0.58857995",
"0.5884522",
"0.58837473",
"0.58783245",
"0.5876851",
"0.5876363",
"0.587342",
"0.5869905",
"0.5865501",
"0.5854596",
"0.58485234",
"0.58462256",
"0.58458596",
"0.5834859",
"0.5831558",
"0.5831118",
"0.5827546",
"0.5824851",
"0.58239055",
"0.58238304"
] | 0.0 | -1 |
PATCH/PUT /empresas/1 PATCH/PUT /empresas/1.json | def update
respond_to do |format|
if @institucion.update(institucion_params)
format.html { redirect_to @institucion, notice: 'Empresa se ha actualizado correctamente.' }
format.json { render :show, status: :ok, location: @institucion }
else
format.html { render :edit }
format.json { render json: @institucion.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @emprego.update(emprego_params)\n format.html { redirect_to @emprego, notice: 'Emprego was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @emprego.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @empleado.update(empleado_params)\n format.html { redirect_to @empleado, notice: 'Empleado was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @empleado.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @emprestimo.update(emprestimo_params)\n format.html { redirect_to @emprestimo, notice: 'Reserva/Empréstimo foi Atualizado.' }\n format.json { render :show, status: :ok, location: @emprestimo }\n else\n format.html { render :edit }\n format.json { render json: @emprestimo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n respond_to do |format|\n if @employee.update(employee_params)\n format.html { redirect_to @employee, notice: 'El contacto a sido actualizado.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @employee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @empresario.update(empresario_params) and @empresario.update_attributes(:modificador => current_user.id)\n format.html { redirect_to @empresario, notice: 'Empresario was successfully updated.' }\n format.json { render :show, status: :ok, location: @empresario }\n else\n format.html { render :edit }\n format.json { render json: @empresario.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @exemplaresproduto.update(exemplaresproduto_params)\n format.html { redirect_to @exemplaresproduto, notice: 'Exemplaresproduto was successfully updated.' }\n format.json { render :show, status: :ok, location: @exemplaresproduto }\n else\n format.html { render :edit }\n format.json { render json: @exemplaresproduto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @ejemplo.update(ejemplo_params)\n format.html { redirect_to @ejemplo, notice: 'Ejemplo was successfully updated.' }\n format.json { render :show, status: :ok, location: @ejemplo }\n else\n format.html { render :edit }\n format.json { render json: @ejemplo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @employe = Employe.find(params[:id])\n\n respond_to do |format|\n if @employe.update_attributes(params[:employe])\n format.html { redirect_to @employe, notice: 'Employe was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @employe.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if(@employee==nil)\n format.html { redirect_to employees_path, notice: 'Employee id not found' }\n elsif @employee.update(employee_params)\n format.html { redirect_to @employee, notice: 'Funcionario was successfully updated.' }\n format.json { render :show, status: :ok, location: @employee }\n else\n format.html { render :edit }\n format.json { render json: @employee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @emp1.update(emp1_params)\n format.html { redirect_to @emp1, notice: 'Emp1 was successfully updated.' }\n format.json { render :show, status: :ok, location: @emp1 }\n else\n format.html { render :edit }\n format.json { render json: @emp1.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @estatuto = Estatuto.find(params[:id])\n\n respond_to do |format|\n if @estatuto.update_attributes(params[:estatuto])\n format.html { redirect_to @estatuto, notice: 'Estatuto was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @estatuto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @oferta = Oferta.find(params[:id])\n\n respond_to do |format|\n if @oferta.update_attributes(params[:oferta])\n format.html { redirect_to [:admin, @oferta], :notice => 'Exemplo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @oferta.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @exemption.update(exemption_params)\n format.html { redirect_to @exemption, notice: 'Exemption was successfully updated.' }\n format.json { render :show, status: :ok, location: @exemption }\n else\n format.html { render :edit }\n format.json { render json: @exemption.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @empleado.update(empleado_params)\n format.html { redirect_to @empleado, notice: 'Se ha actualizado el empleado.' }\n format.json { render :show, status: :ok, location: @empleado }\n else\n format.html { render :edit }\n format.json { render json: @empleado.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @empregador.update(empregador_params)\n format.html { redirect_to empregadors_path, notice: 'O Empregador foi atualizado com sucesso!' }\n format.json { render :show, status: :ok, location: @empregador }\n else\n format.html { render :edit }\n format.json { render json: @empregador.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @employee.update(employee_params)\n format.html { redirect_to employees_path, notice: 'Employee was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @employee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @employ = Employ.find(params[:id])\n\n respond_to do |format|\n if @employ.update_attributes(params[:employ])\n format.html { redirect_to @employ, notice: 'Employ was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @employ.errors, status: :unprocessable_entity }\n end\n end\n end",
"def rest_edit(path, options={}, &blk)\n callback = Proc.new { |*args|\n @object = yield(*args) or pass\n rest_params.each { |k, v| @object.send :\"#{k}=\", v unless k == 'id' }\n\n return 400, @object.errors.to_json unless @object.valid?\n\n @object.save\n rest_respond @object\n }\n\n # Make it work with `Backbone.emulateHTTP` on.\n put path, &callback\n post path, &callback\n end",
"def rest_edit(path, options={}, &blk)\n callback = Proc.new { |*args|\n @object = yield(*args) or pass\n rest_params.each { |k, v| @object.send :\"#{k}=\", v unless k == 'id' }\n\n return 400, @object.errors.to_json unless @object.valid?\n\n @object.save\n rest_respond @object\n }\n\n # Make it work with `Backbone.emulateHTTP` on.\n put path, &callback\n post path, &callback\n end",
"def update\n respond_to do |format|\n if @employee.update(employee_params)\n format.html { redirect_to employees_url, notice: 'Employee was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @employee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @employee.update(employee_params)\n format.html { redirect_to employees_path, notice: 'El empleado ha sido actualizado con éxito.' }\n format.json { render :show, status: :ok, location: @employee }\n else\n format.html { render :edit }\n format.json { render json: @employee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @aprov_estabelecimento.update(aprov_estabelecimento_params)\n format.html { redirect_to @aprov_estabelecimento, notice: 'Aprov estabelecimento was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @aprov_estabelecimento.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @empleados_empresa.update(empleados_empresa_params)\n format.html { redirect_to @empleados_empresa, notice: 'Empleados empresa was successfully updated.' }\n format.json { render :show, status: :ok, location: @empleados_empresa }\n else\n format.html { render :edit }\n format.json { render json: @empleados_empresa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @aga_employee.update(aga_employee_params)\n format.html { redirect_to @aga_employee, notice: 'Aga employee was successfully updated.' }\n format.json { render :show, status: :ok, location: @aga_employee }\n else\n format.html { render :edit }\n format.json { render json: @aga_employee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @empresa.update(empresa_params) and @empresa.update_attributes(:modificador => current_user.id)\n format.html { redirect_to @empresa, notice: 'Empresa was successfully updated.' }\n format.json { render :show, status: :ok, location: @empresa }\n else\n format.html { render :edit }\n format.json { render json: @empresa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tipoapreensao.update(tipoapreensao_params)\n format.html { redirect_to @tipoapreensao, notice: 'Tipoapreensao was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tipoapreensao.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @employee.update(employee_params)\n format.html { redirect_to @employee, notice: 'Employee was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @employee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @employee.update(employee_params)\n format.html { redirect_to @employee, notice: 'Employee was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @employee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @employee.update(employee_params)\n format.html { redirect_to @employee, notice: 'Employee was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @employee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @empleado.update(empleado_params)\n format.html { redirect_to @empleado, notice: 'Empleado fue actualizado exitosamente.' }\n format.json { render :show, status: :ok, location: @empleado }\n else\n format.html { render :edit }\n format.json { render json: @empleado.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tiempo.update(tiempo_params)\n format.html { redirect_to @tiempo, notice: 'Tiempo was successfully updated.' }\n format.json { render :show, status: :ok, location: @tiempo }\n else\n format.html { render :edit }\n format.json { render json: @tiempo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # raise params.to_s\n respond_to do |format|\n if @employee.update(employee_params)\n format.html { redirect_to @employee, notice: 'Работник обновлен.' }\n format.json { render :show, status: :ok, location: @employee }\n else\n format.html { render :edit }\n format.json { render json: @employee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @empl.update(empl_params)\n format.html { redirect_to @empl, notice: 'Empl was successfully updated.' }\n format.json { render :show, status: :ok, location: @empl }\n else\n format.html { render :edit }\n format.json { render json: @empl.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @employee = Employee.find_by_id(params[:id])\n @employee.update_attributes({:id => params[:id],\n :name => params[:name],\n :title => params[:title],\n :status => params[:status],\n :employment_type => params[:employment_type],\n :attendance_type_id => params[:attendance_type_id],\n :hourly_rate => params[:hourly_rate],\n :location => params[:location],\n :capitalizable_group_id => params[:capitalizable_group_id],\n :leave_days => params[:leave_days],\n :commencement_date => params[:commencement_date],\n :termination_date => params[:termination_date]})\n if request.xhr?\n render :json => @employee\n end\n end",
"def update\n respond_to do |format|\n if @master_employe.update(master_employe_params)\n format.html { redirect_to @master_employe, notice: 'Employe was successfully updated.' }\n format.json { render :show, status: :ok, location: @master_employe }\n else\n format.html { render :edit }\n format.json { render json: @master_employe.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @employee = Employee.find(params[:id])\n\n respond_to do |format|\n if @employee.update_attributes(params[:employee])\n format.html { redirect_to @employee, notice: 'Employee was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @employee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @employee = Employee.find(params[:id])\n\n respond_to do |format|\n if @employee.update_attributes(params[:employee])\n format.html { redirect_to @employee, notice: 'Employee was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @employee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @etapa.update(etapa_params)\n format.html { redirect_to @etapa, notice: 'Etapa fue actualizada exitosamente.' }\n format.json { render :show, status: :ok, location: @etapa }\n else\n format.html { render :edit }\n format.json { render json: @etapa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @empleado_especialidad.update(empleado_especialidad_params)\n format.html { redirect_to @empleado_especialidad, notice: 'Empleado especialidad was successfully updated.' }\n format.json { render :show, status: :ok, location: @empleado_especialidad }\n else\n format.html { render :edit }\n format.json { render json: @empleado_especialidad.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tarefa.update(tarefa_params)\n format.html { redirect_to @tarefa, notice: 'Tarefa editada com sucesso.' }\n format.json { render :show, status: :ok, location: @tarefa }\n else\n format.html { render :edit }\n format.json { render json: @tarefa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n authorize @employee, :update?\n respond_to do |format|\n if @employee.update(employee_params)\n format.html { redirect_to @employee, notice: 'Funcionário atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @employee }\n else\n format.html { render :edit }\n format.json { render json: @employee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @prueba_json.update(prueba_json_params)\n format.html { redirect_to @prueba_json, notice: 'Prueba json was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @prueba_json.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @empleado.update(empleado_params)\n format.html { redirect_to empleados_path, notice: 'se ha actualizado el Registro.' }\n format.json { render :show, status: :ok, location: @empleado }\n else\n format.html { render :edit }\n format.json { render json: @empleado.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @alumno = Alumno.find(params[:id])\n\n respond_to do |format|\n if @alumno.update_attributes(params[:alumno])\n head :no_content\n else\n render json: @alumno.errors, status: :unprocessable_entity\n end\n end\n end",
"def update\n respond_to do |format|\n if @admin_employee.update(admin_employee_params)\n format.html { redirect_to admin_employees_path, notice: 'Funcionário foi editado com sucesso.' }\n else\n format.html { render :edit }\n format.json { render json: @admin_employee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tipo_exame.update(tipo_exame_params)\n format.html { redirect_to @tipo_exame, notice: 'Tipo exame was successfully updated.' }\n format.json { render :show, status: :ok, location: @tipo_exame }\n else\n format.html { render :edit }\n format.json { render json: @tipo_exame.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @empresa.update(empresa_params)\n format.html { redirect_to @empresa, notice: 'Empresa actualizada exitosamente.' }\n format.json { render :show, status: :ok, location: @empresa }\n else\n format.html { render :edit }\n format.json { render json: @empresa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @empolyee.update(empolyee_params)\n format.html { redirect_to @empolyee, notice: 'Empolyee was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @empolyee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @pessoa = Pessoa.find(params[:id])\n\n respond_to do |format|\n if @pessoa.update_attributes(params[:pessoa])\n format.html { redirect_to pessoas_path, notice: 'Pessoa atualizada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pessoa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @cargo_eleicao = CargoEleicao.find(params[:id])\n\n respond_to do |format|\n if @cargo_eleicao.update_attributes(params[:cargo_eleicao])\n format.html { redirect_to @cargo_eleicao, notice: 'Cargo eleicao was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cargo_eleicao.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @employee = Employee.find(params[:id])\n\n respond_to do |format|\n if @employee.update_attributes(params[:employee])\n CustomLogger.info(\"Se actualiza empleado: #{@employee}, usuario: #{current_user.inspect}, #{Time.now}\")\n format.html { redirect_to new_employee_path, notice: 'Empleado Actualizado Exitosamente!' }\n format.json { head :no_content }\n else\n CustomLogger.error(\"Error al actualizar empleado: #{@employee}, usuario: #{current_user.inspect}, #{Time.now}\")\n format.html { render action: \"edit\" }\n format.json { render json: @employee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @emp_job = EmpJob.find(params[:id])\n\n respond_to do |format|\n if @emp_job.update_attributes(params[:emp_job])\n format.html { redirect_to @emp_job, notice: 'Emp job was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @emp_job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @employe.update(employe_params)\n format.html { redirect_to @employe, notice: 'Employe was successfully updated.' }\n format.json { render :show, status: :ok, location: @employe }\n else\n format.html { render :edit }\n format.json { render json: @employe.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n @empresa_servicio = EmpresaServicio.find(params[:id])\n respond_to do |format|\n if @empresa_servicio.update_attributes(params[:empresa_servicio])\n\n format.html { redirect_to empresa_empresa_servicios_path, notice: \"Los datos del servicio fueron actualizados para la empresa #{@empresa_servicio.empresa.nombre_empresa}\"}\n \n else\n format.html { render action: \"edit\" }\n format.json { render json: @empresa_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @soiree = Soiree.find(params[:id])\n\n respond_to do |format|\n if @soiree.update_attributes(params[:soiree])\n format.html { redirect_to @soiree, notice: 'Soiree was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @soiree.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @empresa.update(empresa_params)\n format.html { redirect_to @empresa, notice: 'Empresa actualizada con éxito.' }\n format.json { render :show, status: :ok, location: @empresa }\n else\n format.html { render :edit }\n format.json { render json: @empresa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @persona = Persona.find(params[:id])\n \n respond_to do |format|\n if @persona.update_attributes(params[:persona])\n format.json { head :ok }\n else\n format.json { render :json => @persona.errors,\n :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @estabelecimento = Estabelecimento.find(params[:id])\n\n respond_to do |format|\n if @estabelecimento.update_attributes(params[:estabelecimento])\n format.html { redirect_to @estabelecimento, :notice => 'Estabelecimento was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @estabelecimento.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @resto.update(resto_params)\n format.html { redirect_to @resto, notice: 'Entry was successfully updated.' }\n format.json { render :show, status: :ok, location: @resto }\n else\n format.html { render :edit }\n format.json { render json: @resto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @employee = current_owner.employees.find(params[:id])\n puts \"#{params}\"\n respond_to do |format|\n if @employee.update_attributes(params[:employee])\n format.html { redirect_to @employee, notice: 'Employee was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @employee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @atracao = Atracao.find(params[:id])\n\n respond_to do |format|\n if @atracao.update_attributes(params[:atracao])\n format.html { redirect_to @atracao, :notice => 'Atracao was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @atracao.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\r\n @asistencia = Asistencia.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @asistencia.update_attributes(params[:asistencia])\r\n format.html { redirect_to @asistencia, notice: 'Asistencia 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: @asistencia.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n @excepcion_entrega = ExcepcionEntrega.find(params[:id]) \n\n respond_to do |format|\n if @excepcion_entrega.update_attributes(params[:excepcion_entrega])\n format.html { redirect_to @excepcion_entrega, notice: 'Excepcion entrega was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @excepcion_entrega.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n @formasdepago.empresa = current_user.empresa\n if @formasdepago.update(formasdepago_params)\n format.html { redirect_to @formasdepago, notice: 'Formasdepago was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @formasdepago.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @veiculo = Veiculo.find(params[:id])\n\n respond_to do |format|\n if @veiculo.update_attributes(params[:veiculo])\n format.html { redirect_to @veiculo, :notice => 'Veiculo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @veiculo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @fotos_empresa.update(fotos_empresa_params)\n format.html { redirect_to @fotos_empresa, notice: 'Fotos empresa was successfully updated.' }\n format.json { render :show, status: :ok, location: @fotos_empresa }\n else\n format.html { render :edit }\n format.json { render json: @fotos_empresa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @employee.update(employee_params)\n format.html { redirect_to @employee, notice: 'Employee was successfully updated.' }\n format.json { render :show, status: :ok, location: @employee }\n else\n format.html { render :edit }\n format.json { render json: @employee.errors, status: :unprocessable_entity }\n end\n\n end\n end",
"def update\n @empresa = Empresa.find(params[:id])\n @empresa.setLatLong\n respond_to do |format|\n if @empresa.update_attributes(params[:empresa])\n format.html { redirect_success(\"Empresa alterada com sucesso!\",:empresas, :index)}\n format.json { head :no_content }\n else\n format.html { redirect_error(\"Nao foi possivel editar a empresa!\",:empresas, :index)}\n format.json { render json: @empresa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @employee.update(employee_params)\n format.html { redirect_to @employee, notice: 'Employee was successfully updated.' }\n format.json { render :show, status: :ok, location: @employee }\n else\n render action: 'edit'\n end\n end\n end",
"def update\n @etnia = Etnia.find(params[:id])\n\n respond_to do |format|\n if @etnia.update_attributes(params[:etnia])\n format.html { redirect_to @etnia, notice: 'Etnia was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @etnia.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @estabelecimento = Estabelecimento.find(params[:id])\n\n respond_to do |format|\n if @estabelecimento.update_attributes(params[:estabelecimento])\n format.html { redirect_to @estabelecimento, notice: 'Estabelecimento was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @estabelecimento.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @especy = Especie.find(params[:id])\n\n respond_to do |format|\n if @especy.update_attributes(params[:especy])\n format.html { redirect_to @especy, notice: 'Especie was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @especy.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @employee.update(employee_params)\n format.html { redirect_to @employee, notice: 'Employee was successfully updated.' }\n format.json { render :show, status: :ok, location: @employee }\n else\n format.html { render :edit }\n format.json { render json: @employee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @employee.update(employee_params)\n format.html { redirect_to @employee, notice: 'Employee was successfully updated.' }\n format.json { render :show, status: :ok, location: @employee }\n else\n format.html { render :edit }\n format.json { render json: @employee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @employee.update(employee_params)\n format.html { redirect_to @employee, notice: 'Employee was successfully updated.' }\n format.json { render :show, status: :ok, location: @employee }\n else\n format.html { render :edit }\n format.json { render json: @employee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @employee.update(employee_params)\n format.html { redirect_to @employee, notice: 'Employee was successfully updated.' }\n format.json { render :show, status: :ok, location: @employee }\n else\n format.html { render :edit }\n format.json { render json: @employee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @employee.update(employee_params)\n format.html { redirect_to @employee, notice: 'Employee was successfully updated.' }\n format.json { render :show, status: :ok, location: @employee }\n else\n format.html { render :edit }\n format.json { render json: @employee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @employee.update(employee_params)\n format.html { redirect_to @employee, notice: 'Employee was successfully updated.' }\n format.json { render :show, status: :ok, location: @employee }\n else\n format.html { render :edit }\n format.json { render json: @employee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @employee.update(employee_params)\n format.html { redirect_to @employee, notice: 'Employee was successfully updated.' }\n format.json { render :show, status: :ok, location: @employee }\n else\n format.html { render :edit }\n format.json { render json: @employee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @employee.update(employee_params)\n format.html { redirect_to @employee, notice: 'Employee was successfully updated.' }\n format.json { render :show, status: :ok, location: @employee }\n else\n format.html { render :edit }\n format.json { render json: @employee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @employee.update(employee_params)\n format.html { redirect_to @employee, notice: 'Employee was successfully updated.' }\n format.json { render :show, status: :ok, location: @employee }\n else\n format.html { render :edit }\n format.json { render json: @employee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @employee.update(employee_params)\n format.html { redirect_to @employee, notice: 'Employee was successfully updated.' }\n format.json { render :show, status: :ok, location: @employee }\n else\n format.html { render :edit }\n format.json { render json: @employee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @employee.update(employee_params)\n format.html { redirect_to @employee, notice: 'Employee was successfully updated.' }\n format.json { render :show, status: :ok, location: @employee }\n else\n format.html { render :edit }\n format.json { render json: @employee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @expediente = Expediente.find(params[:id])\n\n respond_to do |format|\n if @expediente.update_attributes(params[:expediente])\n format.html { redirect_to @expediente, notice: 'Expediente was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @expediente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @forma_entrega = FormaEntrega.find(params[:id])\n\n respond_to do |format|\n if @forma_entrega.update_attributes(params[:forma_entrega])\n format.html { redirect_to @forma_entrega, notice: 'Forma entrega was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @forma_entrega.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n authorize! :manage, Employee\n if responsibility_changes?\n new_employee = Employee.new_from_old(employee_params['responsibility'], @employee)\n @employee.destroy\n new_employee.save\n @employee = new_employee\n end\n\n respond_to do |format|\n if @employee.update(employee_attrs)\n format.html { redirect_to (@employee.try(:employee) || @employee), notice: t('action.update.succeed', entity: Employee.model_name.human) }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @employee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @api_v1_todo.update(api_v1_todo_params)\n format.json { render json: @api_v1_todo, status: :ok }\n else\n format.json { render json: @api_v1_todo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @horario_entrega.update(horario_entrega_params)\n format.html { redirect_to @horario_entrega, notice: 'Horario entrega was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @horario_entrega.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @todoa.update(todoa_params)\n format.html { redirect_to todoas_url }\n format.json { render :show, status: :ok, location: @todoa }\n else\n format.html { render :edit }\n format.json { render json: @todoa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @peso = Peso.find(params[:id])\n\n respond_to do |format|\n if @peso.update_attributes(params[:peso])\n format.html { redirect_to @peso, notice: 'Peso was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @peso.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @employee.update(employee_params)\n format.html { redirect_to @employee, notice: \"Employee was successfully updated.\" }\n format.json { render :show, status: :ok, location: @employee }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @employee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @asaaddrobj = Asaaddrobj.find(params[:id])\n\n respond_to do |format|\n if @asaaddrobj.update_attributes(params[:asaaddrobj])\n format.html { redirect_to @asaaddrobj, notice: 'Asaaddrobj was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @asaaddrobj.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @solicitud.update(solicitud_params)\n format.html { redirect_to @solicitud, notice: 'Solicitud was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @solicitud.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch!\n request! :patch\n end",
"def update\n respond_to do |format|\n if @pessoa.update(pessoa_params)\n format.html { redirect_to @pessoa, notice: 'Cadastro alterado com sucesso!.' }\n format.json { render :show, status: :ok, location: @pessoa }\n else\n format.html { render :edit }\n format.json { render json: @pessoa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @objeto.update(objeto_params)\n format.html { redirect_to @objeto, notice: 'Objeto 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",
"def update\n respond_to do |format|\n if @objeto.update(objeto_params)\n format.html { redirect_to @objeto, notice: 'Objeto 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",
"def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end",
"def update\n respond_to do |format|\n if @servico_pacote.update(servico_pacote_params)\n format.html { redirect_to @servico_pacote, notice: 'Pacote was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @servico_pacote.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tipoenvolvido.update(tipoenvolvido_params)\n format.html { redirect_to @tipoenvolvido, notice: 'Tipoenvolvido was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tipoenvolvido.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update \n retorno = {erro: \"322\" ,body: \"\"}\n if @usuario.update(valid_request?)\n retorno = {erro: \"000\", body: {evento_id: @usuario.id, usuario_nome: @usuario.nome}}\n end\n render json: retorno.to_json\n end"
] | [
"0.66764665",
"0.65188104",
"0.6391711",
"0.6382479",
"0.6380362",
"0.6371382",
"0.63382274",
"0.6328772",
"0.6308569",
"0.6303294",
"0.628924",
"0.6280263",
"0.6264173",
"0.6252227",
"0.6250315",
"0.6249257",
"0.62487775",
"0.6248056",
"0.6248056",
"0.62444293",
"0.6242012",
"0.6236125",
"0.62324446",
"0.6228133",
"0.6217932",
"0.62163156",
"0.62070906",
"0.62070906",
"0.62070906",
"0.61960036",
"0.6184462",
"0.61831015",
"0.61830425",
"0.6168889",
"0.61675453",
"0.6156183",
"0.6156183",
"0.6156013",
"0.6151493",
"0.614638",
"0.6138229",
"0.61308974",
"0.612098",
"0.6119163",
"0.6117825",
"0.61159664",
"0.61134607",
"0.6111361",
"0.61104727",
"0.61074305",
"0.6103133",
"0.6102171",
"0.6099896",
"0.60926723",
"0.60849243",
"0.60788727",
"0.60703254",
"0.6052785",
"0.605164",
"0.6046388",
"0.6045163",
"0.6037",
"0.60338825",
"0.6028661",
"0.60234904",
"0.60222936",
"0.60188234",
"0.6015571",
"0.60128725",
"0.6011378",
"0.60067326",
"0.6003391",
"0.60032845",
"0.60032845",
"0.60032845",
"0.60032845",
"0.60032845",
"0.60032845",
"0.60032845",
"0.60032845",
"0.60032845",
"0.60032845",
"0.60032845",
"0.6000375",
"0.59967446",
"0.5991625",
"0.5990759",
"0.59905225",
"0.5990195",
"0.598983",
"0.59892696",
"0.5986425",
"0.59843606",
"0.5984326",
"0.5980002",
"0.5979146",
"0.5979146",
"0.5977568",
"0.5976804",
"0.59758145",
"0.59753513"
] | 0.0 | -1 |
DELETE /empresas/1 DELETE /empresas/1.json | def destroy
@institucion.destroy
respond_to do |format|
format.html { redirect_to institucions_url, notice: 'Empresa se ha eliminado correctamente.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @emprego.destroy\n respond_to do |format|\n format.html { redirect_to empregos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @empleado.destroy\n respond_to do |format|\n format.html { redirect_to empleados_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @Empresa.destroy\n respond_to do |format|\n format.html { redirect_to Empresas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @Empresa.destroy\n respond_to do |format|\n format.html { redirect_to Empresas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @estatuto = Estatuto.find(params[:id])\n @estatuto.destroy\n\n respond_to do |format|\n format.html { redirect_to estatutos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @empleado_especialidad.destroy\n respond_to do |format|\n format.html { redirect_to empleado_especialidads_url, notice: 'Empleado especialidad was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @emp1.destroy\n respond_to do |format|\n format.html { redirect_to emp1s_url, notice: 'Emp1 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @employe.destroy\n respond_to do |format|\n format.html { redirect_to employes_path(api_id: @employe.organisme_id), notice: 'Employe was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @examan.destroy\n respond_to do |format|\n format.html { redirect_to examen_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @empregador.destroy\n respond_to do |format|\n format.html { redirect_to empregadors_url, notice: 'O Empregador foi excluído com sucesso!' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exemplaresproduto.destroy\n respond_to do |format|\n format.html { redirect_to exemplaresprodutos_url, notice: 'Exemplaresproduto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @expediente = Expediente.find(params[:id])\n @expediente.destroy\n\n respond_to do |format|\n format.html { redirect_to expedientes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @emprestimo.destroy\n respond_to do |format|\n format.html { redirect_to emprestimos_url, notice: 'Reserva/Empréstimo foi Removido.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @empleado.destroy\n respond_to do |format|\n format.html { redirect_to empleados_url, notice: 'Se ha eliminado el empleado.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @empleados_empresa.destroy\n respond_to do |format|\n format.html { redirect_to empleados_empresas_url, notice: 'Empleados empresa was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @empresa.destroy\n respond_to do |format|\n format.html { redirect_to empresas_url, notice: 'Empresa eliminada exitosamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @resa.destroy\n respond_to do |format|\n format.html { redirect_to resas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @employe = Employe.find(params[:id])\n @employe.destroy\n\n respond_to do |format|\n format.html { redirect_to employes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exura = Exura.find(params[:id])\n @exura.destroy\n\n respond_to do |format|\n format.html { redirect_to exuras_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @empresa = Empresa.find(params[:id])\n @empresa.destroy\n\n respond_to do |format|\n format.html { redirect_success(\"Empresa removida com sucesso!\",:empresas, :index)}\n format.json { head :no_content }\n end\n end",
"def destroy\n @excepcion_entrega = ExcepcionEntrega.find(params[:id])\n @excepcion_entrega.destroy\n\n respond_to do |format|\n format.html { redirect_to excepcion_entregas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @empleado.destroy\n respond_to do |format|\n format.html { redirect_to empleados_url, notice: 'Empleado fue eliminado exitosamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @employee.destroy\n respond_to do |format|\n format.html { redirect_to employees_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @employee.destroy\n respond_to do |format|\n format.html { redirect_to employees_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @employee.destroy\n respond_to do |format|\n format.html { redirect_to employees_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @employee.destroy\n respond_to do |format|\n format.html { redirect_to employees_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @employee.destroy\n respond_to do |format|\n format.html { redirect_to employees_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @employee.destroy\n respond_to do |format|\n format.html { redirect_to employees_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @employee.destroy\n respond_to do |format|\n format.html { redirect_to employees_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ejemplo.destroy\n respond_to do |format|\n format.html { redirect_to ejemplos_url, notice: 'Ejemplo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @soiree = Soiree.find(params[:id])\n @soiree.destroy\n\n respond_to do |format|\n format.html { redirect_to soirees_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @efimerida.destroy\n respond_to do |format|\n format.html { redirect_to efimeridas_url, notice: 'Efimerida was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cargo_eleicao = CargoEleicao.find(params[:id])\n @cargo_eleicao.destroy\n\n respond_to do |format|\n format.html { redirect_to cargo_eleicaos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @employee.destroy\n respond_to do |format|\n format.html { redirect_to employees_url, notice: 'Funcionario was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @empl.destroy\n respond_to do |format|\n format.html { redirect_to empls_url, notice: 'Empl was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @datos_estudiante.destroy\n respond_to do |format|\n format.html { redirect_to datos_estudiantes_url, notice: 'Datos estudiante was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exalt = Exalt.find(params[:id])\n @exalt.destroy\n\n respond_to do |format|\n format.html { redirect_to exalts_url }\n format.json { head :ok }\n end\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"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.json { head :no_content }\n end\n end",
"def destroy\n @tipo_exame.destroy\n respond_to do |format|\n format.html { redirect_to tipo_exames_url, notice: 'Tipo exame was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @aga_employee.destroy\n respond_to do |format|\n format.html { redirect_to @aga_employee, notice: 'Aga employee was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @employee.destroy\n respond_to do |format|\n format.html { redirect_to employees_url, notice: 'El empleado ha sido eliminado con éxito.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @asignatura.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @apoio_educacioanl.destroy\n respond_to do |format|\n format.html { redirect_to apoio_educacioanls_url, notice: 'Apoio educacioanal foi excluído com Sucesso !' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @orden_examan.destroy\n respond_to do |format|\n format.html { redirect_to orden_examen_url, notice: 'Orden examan was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @empleado.destroy\n respond_to do |format|\n format.html { redirect_to empleados_url, notice: 'se ha borrado el Registro.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @persona = Persona.find(params[:id])\n @persona.destroy\n\n respond_to do |format|\n format.json { head :ok }\n end\n \n end",
"def destroy\n @aprov_estabelecimento.destroy\n respond_to do |format|\n format.html { redirect_to aprov_estabelecimentos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @especialidad.destroy\n respond_to do |format|\n format.html { redirect_to especialidads_url, notice: 'Servicio eliminado exitosamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @empresa_registrada = EmpresaRegistrada.find(params[:id])\n @empresa_registrada.destroy\n\n respond_to do |format|\n format.html { redirect_to empresa_registradas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @etnia = Etnia.find(params[:id])\n @etnia.destroy\n\n respond_to do |format|\n format.html { redirect_to etnias_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @estabelecimento = Estabelecimento.find(params[:id])\n @estabelecimento.destroy\n\n respond_to do |format|\n format.html { redirect_to estabelecimentos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @estabelecimento = Estabelecimento.find(params[:id])\n @estabelecimento.destroy\n\n respond_to do |format|\n format.html { redirect_to estabelecimentos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @anteproyecto_estudiante.destroy\n respond_to do |format|\n format.html { redirect_to anteproyecto_estudiantes_url, notice: 'Anteproyecto estudiante was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @empleadosautorizado = Empleadosautorizado.find(params[:id])\n @empleadosautorizado.destroy\n\n respond_to do |format|\n format.html { redirect_to(empleadosautorizados_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @asiento = Asiento.find(params[:id])\n @asiento.destroy\n\n respond_to do |format|\n format.html { redirect_to asientos_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @asociado = Asociado.find(params[:id])\n @asociado.destroy\n\n respond_to do |format|\n format.html { redirect_to asociados_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @prueba_json.destroy\n respond_to do |format|\n format.html { redirect_to prueba_jsons_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @referee.destroy\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'Referee was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @egreso.destroy\n respond_to do |format|\n format.html { redirect_to egresos_url, notice: 'Egreso was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"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.json { head :no_content }\n end\n end",
"def destroy\n @employ = Employ.find(params[:id])\n @employ.destroy\n\n respond_to do |format|\n format.html { redirect_to employs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @estacionamiento = Estacionamiento.find(params[:id])\n @estacionamiento.destroy\n\n respond_to do |format|\n format.html { redirect_to estacionamientos_url }\n format.json { head :ok }\n end\n end",
"def deleteEntityEmployee( entity_id, gen_id)\n params = Hash.new\n params['entity_id'] = entity_id\n params['gen_id'] = gen_id\n return doCurl(\"delete\",\"/entity/employee\",params)\n end",
"def destroy\n @rowempl = Rowempl.find(params[:id])\n @rowempl.destroy\n\n respond_to do |format|\n format.html { redirect_to rowempls_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @employe.destroy\n respond_to do |format|\n format.html { redirect_to employes_url, notice: 'Employe was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @employee = Employee.find(params[:id])\n @employee.destroy\n\n respond_to do |format|\n format.html { redirect_to employees_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @employee = Employee.find(params[:id])\n @employee.destroy\n\n respond_to do |format|\n format.html { redirect_to employees_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @employee = Employee.find(params[:id])\n @employee.destroy\n\n respond_to do |format|\n format.html { redirect_to employees_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @employee = Employee.find(params[:id])\n @employee.destroy\n\n respond_to do |format|\n format.html { redirect_to employees_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n Tools.write2log(current_user.id, 'Удаление', 'Сотрудники', 0, '# ' + @employee.id.to_s)\n @employee.destroy\n respond_to do |format|\n format.html { redirect_to employees_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @fotos_empresa.destroy\n respond_to do |format|\n format.html { redirect_to fotos_empresas_url, notice: 'Fotos empresa was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @empresa = Core::Empresa.find(params[:empresa_id])\n @core_porto = Core::Porto.find(params[:id])\n @core_porto.destroy\n\n respond_to do |format|\n format.html { redirect_to core_portos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @employeur.destroy\n respond_to do |format|\n format.html { redirect_to employeurs_url, notice: 'Employeur was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @humanidades1 = Humanidades1.find(params[:id])\n @humanidades1.destroy\n\n respond_to do |format|\n format.html { redirect_to humanidades1s_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @consultum = Consultum.find(params[:id])\n @consultum.destroy\n\n respond_to do |format|\n format.html { redirect_to consulta_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @repa = Repa.find(params[:id])\n @repa.destroy\n\n respond_to do |format|\n format.html { redirect_to repas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @repa = Repa.find(params[:id])\n @repa.destroy\n\n respond_to do |format|\n format.html { redirect_to repas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @empolyee.destroy\n respond_to do |format|\n format.html { redirect_to empolyees_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @expedient.destroy\n respond_to do |format|\n format.html { redirect_to expedients_url, notice: 'Expediente borrado' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @consulta_viaje.destroy\n respond_to do |format|\n format.html { redirect_to consulta_viajes_url, notice: 'Consulta viaje was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @eje.destroy\n respond_to do |format|\n format.html { redirect_to ejes_url, notice: 'Eje was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @solicitud.destroy\n respond_to do |format|\n format.html { redirect_to solicitudes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @depoevento = Depoevento.find(params[:id])\n @depoevento.destroy\n\n respond_to do |format|\n format.html { redirect_to depoeventos_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @etiquetum.destroy\n respond_to do |format|\n format.html { redirect_to etiqueta_url, notice: 'Etiqueta borrada!' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @eleccion_interna.destroy\n respond_to do |format|\n format.html { redirect_to eleccion_internas_url, notice: 'Eleccion interna was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @resto.destroy\n respond_to do |format|\n format.html { redirect_to restos_url, notice: 'Entry was deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @eleitore.destroy\n respond_to do |format|\n format.html { redirect_to eleitores_url, notice: 'Eleitore was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @proceso_examan.destroy\n respond_to do |format|\n format.html { redirect_to proceso_examen_url, notice: 'Proceso examan was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @master_employe.destroy\n respond_to do |format|\n format.html { redirect_to master_employes_url, notice: 'Employe was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @datos_insumos_reactivo.destroy\n respond_to do |format|\n format.html { redirect_to datos_insumos_reactivos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @estadia.destroy\n respond_to do |format|\n format.html { redirect_to estadia_url, notice: 'Estadia was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @entrada_inventario = EntradaInventario.find(params[:id])\n @entrada_inventario.destroy\n\n respond_to do |format|\n format.html { redirect_to entrada_inventarios_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @reentrada.destroy\n respond_to do |format|\n format.html { redirect_to reentradas_url, notice: 'Reentrada was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @asana.destroy\n respond_to do |format|\n format.html { redirect_to asanas_url, notice: 'Asana excluído com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tipo_de_imposto.destroy\n respond_to do |format|\n format.html { redirect_to @empresa, notice: 'Tipo de imposto removido com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @addre = Addre.find(params[:id])\n @addre.destroy\n\n respond_to do |format|\n format.html { redirect_to addres_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @asos_datum.destroy\n respond_to do |format|\n format.html { redirect_to asos_data_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @requerimiento = Requerimiento.find(params[:id])\n @requerimiento.destroy\n\n respond_to do |format|\n format.html { redirect_to requerimientos_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @ejercicio = Ejercicio.find(params[:id])\n @ejercicio.destroy\n\n respond_to do |format|\n format.html { redirect_to ejercicios_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @estoquemp.destroy\n respond_to do |format|\n format.html { redirect_to estoquemps_url, notice: 'Estoquemp was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"
] | [
"0.7330137",
"0.71741563",
"0.7140429",
"0.7140429",
"0.7136313",
"0.7103863",
"0.7098734",
"0.70934683",
"0.7048201",
"0.704317",
"0.70406485",
"0.70400286",
"0.7030377",
"0.70247275",
"0.7015985",
"0.7011696",
"0.6998268",
"0.69949985",
"0.698613",
"0.69727796",
"0.69556814",
"0.6954211",
"0.6933244",
"0.6933244",
"0.6933244",
"0.6933244",
"0.6933244",
"0.6933244",
"0.6933244",
"0.69317746",
"0.69202995",
"0.69143766",
"0.6911741",
"0.6908806",
"0.6907315",
"0.6905495",
"0.69048524",
"0.6901717",
"0.68952787",
"0.6895088",
"0.6891353",
"0.68851256",
"0.6883731",
"0.687951",
"0.68775254",
"0.687731",
"0.6874247",
"0.68734574",
"0.6873425",
"0.68729365",
"0.6871441",
"0.68693256",
"0.68693256",
"0.68668675",
"0.6865965",
"0.6863361",
"0.6852406",
"0.6844149",
"0.6842562",
"0.68418276",
"0.6841745",
"0.68398166",
"0.6836906",
"0.6833606",
"0.6833184",
"0.6832947",
"0.6832503",
"0.6832503",
"0.6832503",
"0.6832503",
"0.6831035",
"0.6830581",
"0.6826282",
"0.68211144",
"0.6820007",
"0.6817363",
"0.6814043",
"0.6814043",
"0.6808009",
"0.6807669",
"0.6805354",
"0.67955387",
"0.67903984",
"0.67877126",
"0.6786835",
"0.6784953",
"0.6783509",
"0.6782704",
"0.67820346",
"0.67795235",
"0.67785716",
"0.67750937",
"0.67729187",
"0.67728496",
"0.6765973",
"0.67639536",
"0.6762513",
"0.6760732",
"0.67602396",
"0.6759881",
"0.675911"
] | 0.0 | -1 |
Use callbacks to share common setup or constraints between actions. | def set_institucion
@institucion = Institucion.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def set_actions\n actions :all\n end",
"def define_action_helpers?; end",
"def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"def setup_handler\n end",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"def workflow\n end",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); end",
"def setup\n # override and do something appropriate\n end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"def determine_valid_action\n\n end",
"def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"def startcompany(action)\n @done = true\n action.setup\n end",
"def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def action\n end",
"def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"def config(action, *args); end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"def before_action \n end",
"def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"def action\n end",
"def matt_custom_action_begin(label); end",
"def setup\n # override this if needed\n end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"def setup_signals; end",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"def initialize(*args)\n super\n @action = :set\nend",
"def after_set_callback; end",
"def setup\n #implement in subclass;\n end",
"def lookup_action; end",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"def release_actions; end",
"def around_hooks; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def save_action; end",
"def action_target()\n \n end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"def before_setup\n # do nothing by default\n end",
"def default_action; end",
"def setup(&blk)\n @setup_block = blk\n end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend",
"def _handle_action_missing(*args); end",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"def duas1(action)\n action.call\n action.call\nend"
] | [
"0.6163821",
"0.6045432",
"0.5945441",
"0.5916224",
"0.58894575",
"0.5834073",
"0.57764685",
"0.5702474",
"0.5702474",
"0.5653258",
"0.56211996",
"0.54235053",
"0.5410683",
"0.5410683",
"0.5410683",
"0.53948104",
"0.5378064",
"0.5356684",
"0.53400385",
"0.53399503",
"0.53312254",
"0.53121567",
"0.52971965",
"0.52964705",
"0.52956307",
"0.52587366",
"0.52450675",
"0.5237777",
"0.5237777",
"0.5237777",
"0.5237777",
"0.5237777",
"0.5233381",
"0.52325714",
"0.52288216",
"0.52229726",
"0.5218362",
"0.52142864",
"0.5207988",
"0.5206337",
"0.51762295",
"0.51745105",
"0.51728606",
"0.516616",
"0.5161016",
"0.5157393",
"0.5152562",
"0.51524293",
"0.5152397",
"0.5144533",
"0.513982",
"0.51342106",
"0.5113793",
"0.5113793",
"0.5113671",
"0.51092553",
"0.51062804",
"0.50921935",
"0.5088855",
"0.5082236",
"0.5079901",
"0.5066569",
"0.5055307",
"0.5053106",
"0.50499666",
"0.50499666",
"0.5035068",
"0.50258636",
"0.50220853",
"0.5015893",
"0.50134486",
"0.5001442",
"0.50005543",
"0.4998581",
"0.49901858",
"0.49901858",
"0.4986648",
"0.49809486",
"0.49792925",
"0.4978855",
"0.49685496",
"0.49656174",
"0.49576473",
"0.49563017",
"0.4955349",
"0.49536878",
"0.4952439",
"0.49460214",
"0.494239",
"0.49334687",
"0.49315962",
"0.49266812",
"0.49261138",
"0.4925925",
"0.4922542",
"0.4920779",
"0.49173284",
"0.49169463",
"0.4916256",
"0.49162322",
"0.49156886"
] | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def institucion_params
params.require(:institucion).permit(:cod, :nombre, :email, :direccion, :telefono)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def valid_params_request?; end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def filtering_params\n params.permit(:email)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"def filter_parameters; end",
"def filter_parameters; end",
"def list_params\n params.permit(:name)\n end",
"def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"def url_whitelist; end",
"def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"def filter_params\n params.require(:filters).permit(:letters)\n end",
"def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\n end",
"def permit_request_params\n params.permit(:address)\n end",
"def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"def secure_params\n params.require(:location).permit(:name)\n end",
"def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def url_params\n params[:url].permit(:full)\n end",
"def backend_user_params\n params.permit!\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end",
"def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end"
] | [
"0.69811666",
"0.6782836",
"0.6747644",
"0.6742015",
"0.6735273",
"0.6593917",
"0.65037674",
"0.6498627",
"0.6482372",
"0.64795715",
"0.64566946",
"0.6439213",
"0.6380714",
"0.6378147",
"0.63657266",
"0.63206697",
"0.6300169",
"0.62992156",
"0.6295538",
"0.62943023",
"0.62915146",
"0.6290595",
"0.62824667",
"0.62420255",
"0.62403506",
"0.6217174",
"0.6213706",
"0.62112075",
"0.6194868",
"0.6178784",
"0.6174678",
"0.6172499",
"0.61630744",
"0.61544263",
"0.615248",
"0.6147727",
"0.61221075",
"0.6119646",
"0.61076134",
"0.6106584",
"0.6094013",
"0.6081423",
"0.6071337",
"0.6063637",
"0.6021453",
"0.6018253",
"0.60161054",
"0.60112554",
"0.60071784",
"0.60071784",
"0.60004836",
"0.6000254",
"0.5999255",
"0.59930664",
"0.59919107",
"0.5991741",
"0.5980763",
"0.59663844",
"0.59605104",
"0.5960486",
"0.5959414",
"0.5957901",
"0.59538954",
"0.5953327",
"0.59450173",
"0.59391475",
"0.59391475",
"0.59386194",
"0.59351885",
"0.593139",
"0.5926316",
"0.5925927",
"0.59176016",
"0.59119296",
"0.5909275",
"0.5908221",
"0.59053046",
"0.58983994",
"0.58980995",
"0.58964473",
"0.5895902",
"0.5893993",
"0.58927304",
"0.5887752",
"0.58841616",
"0.5880381",
"0.58752084",
"0.586956",
"0.5868584",
"0.58679324",
"0.5867004",
"0.58667004",
"0.58642864",
"0.5863347",
"0.58626384",
"0.58615845",
"0.58594906",
"0.5854959",
"0.5854423",
"0.58506453",
"0.5850135"
] | 0.0 | -1 |
On lit la page | def page_reading
page = Nokogiri::HTML(open("https://coinmarketcap.com/all/views/all/"))
crypto_name_array = []
crypto_value_array = []
# on récupère
page.xpath('//tr/td[3]/div').each do |crypto|
crypto_name_array.push(crypto.text)
end
page.xpath('//tr/td[5]/div').each do |value|
crypto_value_array.push(value.text)
end
general_array = crypto_name_array.zip(crypto_value_array).map { |x, y| {x=>y.delete('$,').to_f}}
return general_array
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def page; end",
"def page; end",
"def page; end",
"def page; end",
"def page; end",
"def page; end",
"def page; end",
"def page; end",
"def page; end",
"def page; end",
"def page; end",
"def page; end",
"def page_load; end",
"def set_page\n end",
"def landing() end",
"def loadHandinPage()\n end",
"def page\n\n end",
"def pages; end",
"def mission(page)\n\tend",
"def landing\n end",
"def landing\n end",
"def sample_page\n\n end",
"def landing\n \n end",
"def landing\n \n end",
"def first_mandate\n # renders static page\n end",
"def pages\n end",
"def page; self end",
"def app_landing\n end",
"def full_page\n end",
"def on_page?\n false\n end",
"def get_started\n \t@title= \"Antes de empezar...\" #Page title\n end",
"def showpage\n \n set RGhost::Cursor.showpage\n \n end",
"def location_once_scrolled_into_view; end",
"def current_page; end",
"def current_page; end",
"def page!\n save_and_open_page\n end",
"def page!\n save_and_open_page\n end",
"def kopal_layout_before_page_meta\n\n end",
"def saop\n save_and_open_page\n end",
"def turn_page\n puts \"Flipping the page...wow, you read fast!\"\n end",
"def turn_page\n puts \"Flipping the page...wow, you read fast!\"\n end",
"def accessibility_statement\n # renders static page\n end",
"def load_page\n navigate_to \"#{BOACUtils.base_url}/admin\"\n end",
"def load_page\n navigate_to \"#{BOACUtils.base_url}/admin\"\n end",
"def import_page\n end",
"def loc_view\n \n end",
"def kopal_layout_before_page_front\n\n end",
"def page=(_arg0); end",
"def page=(_arg0); end",
"def page=(_arg0); end",
"def show_pages\n false\n end",
"def page\n nil\n end",
"def show\n @page_title='Aktuator'\n end",
"def splash_page\n end",
"def kopal_layout_after_page_front\n\n end",
"def index\n @main_page = true\n end",
"def selected_page\n end",
"def page_source; end",
"def activate\n\n Page.send :include, SiteTags \n \n Page.class_eval do\n def url_with_redirect\n if self.redirect.blank? \n url_without_redirect \n else\n if self.redirect =~ /^system_name:(.+)$/\n Page.current_site.pages.find_by_system_name($1).try(:url)\n else\n self.redirect\n end\n end\n end\n \n alias_method_chain :url, :redirect\n end\n \n \n ApplicationHelper.module_eval do\n def meta_label\n meta_errors? ? 'Méně' : 'Více'\n end\n end\n\n #ArchiveIndexTagsAndMethods.module_eval do\n # tag \"title\" do |tag|\n # setup_date_parts\n # page = tag.locals.page\n # unless @year.nil?\n # I18n.l(Date.new((@year || 1).to_i, (@month || 1).to_i, (@day || 1).to_i), :format => page.title)\n # else\n # page.title\n # end\n # end\n #end\n\n #ConditionalTags::CustomElement.send :include, SiteEvaluators\n \n \n Status.class_eval do\n \tclass << self\n \t\t@@loaded_statuses = []\n \t\n \t\tdef [](value)\n \t\t\tstatus = @@loaded_statuses.find {|st| st.symbol == value.to_s.downcase.intern }\n \t\t\tunless status\n\t\t\t\t\t\tstatuses = YAML::load(Radiant::Config['page.statuses']).invert\n\t\t\t\t\t\tstatus = Status.new(:id => statuses[value.to_s].to_i, :name => value.to_s.capitalize)\n\t\t\t\t\t\t@@loaded_statuses << status\n\t\t\t\t\tend\n\t\t\t\t\tstatus\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tdef find(id)\n\t\t\t\t\tstatus = @@loaded_statuses.find {|st| st.id == id.to_i }\n\t\t\t\t\tunless status\n\t\t\t\t\t\tstatuses = YAML::load(Radiant::Config['page.statuses'])\n\t\t\t\t\t\tif statuses.has_key?(id.to_i)\n\t\t\t\t\t\t\tstatus = Status.new(:id => id.to_i, :name => statuses[id.to_i].capitalize)\n\t\t\t\t\t\t\t@@loaded_statuses << status\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t# ActiveRecord::RecordNotFound.new(\"Status with ID #{id} not found\")\n\t\t\t\t\t\t\tstatus = Status.new(:id => id.to_i, :name => \"Unknown status ##{id}\")\n\t\t\t\t\t\tend\n\t\t\t\t\tend\t\t\t\t\t\n\t\t\t\t\tstatus\n\t\t\t\tend\n\t\t\n\t\t\t\tdef find_all\n\t\t\t\t\tstatuses = YAML::load(Radiant::Config['page.statuses'])\n\t\t\t\t\tstatuses.each_pair do |id, name|\n\t\t\t\t\t\tunless @@loaded_statuses.find {|st| st.id == id.to_i }\n\t\t\t\t\t\t\t@@loaded_statuses << Status.new(:id => id.to_i, :name => name.capitalize)\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\t\t@@loaded_statuses.dup\n\t\t\t\tend \n\t\t\t\t\n \tend\n end\n \n PagePart.class_eval do \n acts_as_list :scope => :page\n default_scope :order => 'position'\n \n def after_initialize\n #nothing\n end\n end\n \n \n \n admin.pages.edit.add :part_controls, 'admin/page_parts/additional_part_controls'\n\n Admin::PagesController.class_eval do\n before_filter :add_custom_admin_assets, :only => [:edit, :new]\n\n def add_custom_admin_assets\n include_stylesheet 'admin/custom_admin'\n @meta ||= []\n @meta << {:field => \"system_name\", :type => \"text_field\", :args => [{:class => 'textbox', :maxlength => 200}]}\n @meta << {:field => \"redirect\", :type => \"text_field\", :args => [{:class => 'textbox', :maxlength => 200}]}\n end\n end\n \n \n SiteController.class_eval do\n \n def export_pdf\n page = Page.find(params[:id])\n page_url = page.full_url + '?style=print'\n page_url += '#' + params[:selected] if params[:selected]\n pdf_file = \"/tmp/#{page.slug}_#{Time.now.to_i}.pdf\"\n if system(\"wkhtmltopdf #{page_url} #{pdf_file}\")\n send_file(pdf_file, :type=>\"application/pdf\")\n else\n render :inline => '<h1>Omlouváme se</h1><p>PDF se nepodařilo vygenerovat, zkuste to prosím znovu.</p>' \n end \n end\n end\n end",
"def index\n get_own_lessons\n if @page > @pages_amount && @pages_amount != 0\n @page = @pages_amount\n get_own_lessons\n end\n render_js_or_html_index\n end",
"def imported\n @imported_page = true\n end",
"def turn_page\n puts \"Flipping the page...wow, you read fast!\"\n end",
"def turn_page\n puts \"Flipping the page...wow, you read fast!\"\n end",
"def on\n unless on_page?\n raise \"We don't appear to be on the #{self.class}\"\n end\n yield self if block_given?\n self\n end",
"def lien_bureau\n 'Votre bureau'.in_a(href:\"unanunscript/bureau/pages\") \n end",
"def set_page\n @articlespage = 'active'\n end",
"def initialize\n raise 'The page was not loaded' unless self.displayed?(30)\n end",
"def template_page(site); end",
"def page\n get_page\n nil\n end",
"def pages=(_arg0); end",
"def c_page(n)\n BestiaryConfig::PAGEFX.play\n self.index += n\n end",
"def cursor_pageup\r\n end",
"def nda_page\n render \"nda_page/nda_page\"\n @@nda_agree = false\n end",
"def onLoad\n end",
"def load_page\n page.visit('')\n end",
"def page_view(title, page, utmhid = random_id)\n check_account_params\n hey(page_view_params(title, page, utmhid))\n end",
"def kopal_layout_before_page_header\n\n end",
"def kopal_layout_after_page_meta\n\n end",
"def next_page; end",
"def load_page\n logger.info 'Loading Core homepage'\n get ConfigCore.base_url\n when_exists(page_heading, Config.medium_wait)\n end",
"def on_landing_page?\n link_text = locale('Stop Smoking Guide', 'Guía Para Dejar de Fumar')\n find('a', text: link_text)\n end",
"def set_info\n @page_header = 'Insight Engine'\n @page_secondary = 'Let\\'s get a view at 10,000 feet.'\n @page_title = 'LeadAccount | Insight Engine'\n @page_icon = 'lightbulb'\n end",
"def setup\n @page = pages(:homepage)\n end",
"def on_after_load\n end",
"def index\n redirect_to disabled_path\n # unless logged_in?\n # redirect_to tour_path\n # else\n # @current_item = \"my_hsa\"\n # end\n end",
"def load_page\n visit \"umple.php\"\n end",
"def home\r\n \r\n end",
"def kopal_layout_after_page_header\n\n end",
"def online\n current_user.online!\n render :juggernaut do |page|\n page.go_online current_user\n end\n render :nothing => true \n end",
"def online\n current_user.online!\n render :juggernaut do |page|\n page.go_online User.current\n end\n render :nothing => true \n end",
"def landing_page\n if current_user\n redirect_to actions_path(current_user[:id])\n end\n end",
"def initialize\n @page = 1\n end",
"def verify_landing_page\n @higgs.page_title_present?('Puppet Enterprise Installer')\n @higgs.link_present?('email the CEO.')\n @higgs.select_link(\"Let's get started\")\n @higgs.page_title_present?('Puppet Enterprise Installer - Choose your deployment')\n end",
"def home\n @events = Event.published.confirmed.ordered.tease\n @teaser = Teaser.current.limit(1).first\n @sponsors = Sponsor.order(\"position\").all\n @about = Content.find_by_id(6)\n @donate = Content.find_by_id(7)\n render :layout => \"homepage\"\n end",
"def initialize\n @klass = 'HOME'\n @description = nil\n # Wait for the page to be displayed with MAX_WAIT_ON_LOAD seconds timeout\n raise 'The page was not loaded' unless self.displayed?($janus::MAX_WAIT_ON_LOAD)\n end",
"def home\n\t\t# Home Page\n\tend",
"def england\n end",
"def show\n @title = @page.title\n @pages = @page.find_related_tags\n @case_studies = CaseStudy.tagged_with(@page.tag_list, :any => true)\n @locked = REDIS.exists(\"locks:pages:#{@page.id}\")\n if params[:mercury_frame] == 'true' && !@locked\n REDIS.setex(\"locks:pages:#{@page.id}\", 300, @page.canonical_title)\n elsif params[:mercury_frame] == 'true'\n render(text: \"<html><body><script type='text/javascript' charset='utf-8'>window.parent.document.location.href = '#{page_path(@page)}';</script></body></html>\", content_type: :html) and return\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @page }\n end\n end",
"def show() end",
"def show() end",
"def show() end"
] | [
"0.71319586",
"0.71319586",
"0.71319586",
"0.71319586",
"0.71319586",
"0.71319586",
"0.71319586",
"0.71319586",
"0.71319586",
"0.71319586",
"0.71319586",
"0.71319586",
"0.7017904",
"0.7001979",
"0.68669236",
"0.6735521",
"0.6669993",
"0.6664113",
"0.6635459",
"0.6630942",
"0.6630942",
"0.64978886",
"0.64898175",
"0.64898175",
"0.64722705",
"0.6464484",
"0.64595056",
"0.6343933",
"0.6320199",
"0.63125235",
"0.62879735",
"0.6249244",
"0.6163312",
"0.6162867",
"0.6162867",
"0.6142473",
"0.6142473",
"0.612826",
"0.611901",
"0.60987276",
"0.60987276",
"0.6094402",
"0.6082149",
"0.6082149",
"0.6081813",
"0.60814446",
"0.6077133",
"0.60751206",
"0.60751206",
"0.60751206",
"0.6055275",
"0.6046207",
"0.60428184",
"0.6039844",
"0.60389644",
"0.6029648",
"0.6024194",
"0.60107696",
"0.6001237",
"0.6000031",
"0.59931344",
"0.59707457",
"0.59707457",
"0.59658366",
"0.59390587",
"0.59344894",
"0.5933811",
"0.59322387",
"0.5918344",
"0.5917015",
"0.5915304",
"0.5907694",
"0.589455",
"0.58818173",
"0.58735156",
"0.5844246",
"0.5842063",
"0.5841968",
"0.5829343",
"0.5828522",
"0.58281505",
"0.58280957",
"0.5824536",
"0.5813722",
"0.58131784",
"0.5812847",
"0.58127207",
"0.58103627",
"0.5796097",
"0.57858473",
"0.5785254",
"0.57847583",
"0.57802224",
"0.57749367",
"0.576048",
"0.5745879",
"0.57440984",
"0.57428676",
"0.57309324",
"0.57309324",
"0.57309324"
] | 0.0 | -1 |
=begin Converts double value to the text description. | def convertValue(theMoney)
if theMoney == nil
raise ArgumentError, "theMoney is nil"
end
intPart = theMoney.to_i
fractPart = ((theMoney - intPart) * NUM100).round
if @currency == Currency::PER1000.to_s
fractPart = ((theMoney - intPart) * NUM1000).round
end
return convert(intPart, fractPart);
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_double_value\n\t\tend",
"def double\n Util.from_bytes :double, value\n end",
"def descr_value\n @value.to_s\n end",
"def to_s\n \"Arete : Sommet1 = #{@sommet1}, Sommet2 = #{@sommet2}, estDouble? = #{@estDouble}\\n\"\n end",
"def price_as_string\n return \"$%.2f\" % @price.to_f #PassAll:price_as_string\n end",
"def add_double(tag, value)\n write_tag(tag, Type::DOUBLE)\n @io << [value.to_f].pack('E')\n\n self\n end",
"def to_s\n \"#{( \"%.f\" % @value )}#{'%'} \"\n end",
"def estDouble()\n return @estDouble\n end",
"def format_dominance(value)\n if value.class != Float\n return \"\"\n end\n dom = value * 100\n \"%E\" % dom\n end",
"def double; end",
"def price_as_string\n \"$%.2f\" % @price\n end",
"def price_as_string()\n @price = '%.2f' % (@price)\n return \"$\"+@price.to_s \n end",
"def price_as_string()\n return \"$%0.2f\" %[@price]\n end",
"def get_double_value(field_name)\n\t\tend",
"def describe_value(value)\r\n\t\tvalue\r\n\tend",
"def to_s\n\t\t\treturn \"|%s|\" % @elements.collect {|e| \"%0.2f\" % e}.join(\", \")\n\t\tend",
"def price_as_string\n return \"$%0.2f\" % [@price]\n end",
"def toString\n sprintf('%6.2f', @value) + \" \" + @unit\n end",
"def set_double!(value)\n @objects = nil\n @memory = nil\n\n self[:type] = :double\n self[:values][:dec] = value\n end",
"def describe_value(value)\r\n\t\t\tvalue\r\n\t\tend",
"def price_as_string\n return \"$\" + '%.2f' % @price\n end",
"def pretty_metric_value(value)\n case value\n when Float, BigDecimal\n \"#{number_with_delimiter(value.floor)}%\"\n when Integer\n number_with_delimiter value\n when Date, Time\n l value.to_date\n when Array\n value.to_sentence\n else\n value\n end\n end",
"def price_as_string\n output = '%.2f' % price\n \"$\"+output.to_s\nend",
"def get_numeric(value)\n value.to_s.gsub(/(?<val>[0-9\\.]+e-?)(?<exp>[0-9]+)/) { |m|\n arr = m.split(/e/)\n if arr[1][0] =~ /[0-9]/\n \"#{arr[0]}e#{arr[1].rjust(3,'0')}\"\n else\n \"#{arr[0]}e#{arr[1][0]}#{arr[1][1..-1].rjust(3,'0')}\"\n end\n }.to_s\n end",
"def price_as_string\n \"$\"+\"%.2f\" % @price\n end",
"def price_as_string\n \"$\"+format(\"%0.2f\",@price)\n end",
"def price_as_string\n \"$\"+\"%0.2f\" % @price\n end",
"def price_as_string \n price_format = 0.0\n price_format = \"$%.2f\" % @price #formatstring\n price_format\n end",
"def set_double(attr, val); end",
"def set_double(attr, val); end",
"def display_value\n case self.value_type\n when 'Numeric'\n unless self.multiplier.nil? || self.multiplier.blank?\n \"#{self.value} #{self.multiplier}(s) <span class='badge'>#{self.convert_value_by_type} bytes</span>\"\n else\n self.value\n end\n when 'Boolean'\n self.value == '1' ? 'Yes' : 'No'\n else\n self.value\n end\n end",
"def to_s\n \"#{name} (#{serial}): Worth #{value}, recorded on #{createdAt}\"\n end",
"def to_s\n descr_value\n end",
"def type_literal_generic_float(column)\n :\"double precision\"\n end",
"def price_as_string \n \"$\" + ('%.2f' % @price).to_s\n end",
"def to_s \n return \"%s/%s\" % [@num.to_s, @den.to_s]\n end",
"def price_as_string\n format(\"$%.2f\", @price)\nend",
"def price_as_a_string()\n puts format(\"$%.2f\", @price)\n end",
"def to_s\n\t\treturn \"#@num/#@den\"\n\tend",
"def item_to_s(item)\n if item == INFINITY\n \"*\"\n elsif item.is_a?(Numeric)\n sprintf(\"%0.2f\", item)\n else\n item.to_s\n end\n end",
"def modeler_description\r\n return \"E+ measure to popolate the Kiva settings values\"\r\n end",
"def den()\n @den\n end",
"def price_as_string\n return sprintf('$%.2f', @price)\n end",
"def value\n if eng_unit_type\n \"#{data} #{eng_unit_type.tag}\"\n else\n data.to_s\n end\n end",
"def price_as_string\n sprintf(\"$%.2f\", @price)\n end",
"def as_us_dollar; end",
"def price_pretty\n number_to_currency(price_dollars)\n end",
"def modeler_description\n return 'This measure receives the power density level from the user. Then it looks for refrigerated display cases; it loops through them; it checks the current power density of each case and it substitute it with the level chosen by the user.'\n end",
"def price_as_string\n return \"$\"+format(\"%.2f\", @price)\n end",
"def price_as_string\n\t sprintf(\"$%.2f\",price)\n\n end",
"def discount_amount\n $tracer.trace(format_method(__method__))\n tt = ToolTag.new(@tag.find(\"td\")[2], format_method(__method__))\n return tt.inner_text\n end",
"def sales_price\r\n\t\tmarkup = @aquisition_cost*1.10\r\n\t\tmarkup.to_s\r\n\tend",
"def price_as_string\n\t\tformat(\"$%2.2f\", @price)\n\tend",
"def format_price price\n \"$#{'%.2f' % price}\"\n end",
"def describe_price\r\n\t\ta = []\r\n\t\ta << sprintf('$%.2f per item', per_item) unless per_item.zero?\r\n\t\ta << sprintf('$%.2f per kg', per_kg) unless per_kg.zero?\r\n\t\ta << sprintf('$%.2f', flat_rate) unless flat_rate.zero?\r\n\t\tif formula and !formula.empty?\r\n\t\t\tif formula_description and !formula_description.empty?\r\n\t\t\t\ta << formula_description\r\n\t\t\telse\r\n\t\t\t\ta << formula.gsub('I', \"'number of items'\").gsub('W', \"'total weight'\").gsub('V', \"'total value'\")\r\n\t\t\tend\r\n\t\tend\r\n\r\n\t\ta.empty? ? ((name == '[ to be advised ]') ? nil : 'no charge') : a.join(' + ')\r\n\tend",
"def describe\n return @magnitude.to_s if magnitude?\n u_descr = Units.units_descr(@units, true)\n \"#{@magnitude} #{u_descr}\"\n end",
"def formatOunces(value)\n\t\twholeNum = value[1, 4] #Pulls the 2nd (A), 3rd (B), 4th (C) and 5th (D) digit from the format 0ABCDdddd where 'd' is the decimal portion of the eVS weight convention\n\t\tdecimal = value[5, 4] #Pulls the decimal portion\n\t\treturn (\"#{wholeNum}.#{decimal}\".to_f * 16.0).round(4).to_s\n\tend",
"def formatted_price\n price / 100.0\n end",
"def display(*args)\r\n # Rails.logger.error \"Setting::FLOAT_PRECISION: #{Setting::FLOAT_PRECISION.to_s}\"\r\n options = args.extract_options!\r\n precision = Setting::FLOAT_PRECISION\r\n precision = args[0] unless args[0].nil?\r\n if ((-0.01 < self) && (self < 0.01))\r\n if options[:z]\r\n return \"-\"\r\n end \r\n end\r\n # return (sprintf(\"%.#{precision}f\", self.to_f))\r\n # modif 14/08/2012 pour utiliser number_to_currency()\r\n number_with_precision = sprintf(\"%.#{precision}f\", self.to_f)\r\n # return number_with_delimiter(number_with_precision, \" \")\r\n end",
"def price_as_string\n \"$#{sprintf('%.2f', price)}\"\n format(\"$%.2f\",price)\nend",
"def price_as_string\n sprintf(\"$%2.2f\", @price)\n end",
"def formatOunces(value)\n\t\t\twholeNum = value[1, 4] #Pulls the 2nd (A), 3rd (B), 4th (C) and 5th (D) digit from the format 0ABCDdddd where 'd' is the decimal portion of the eVS weight convention\n\t\t\tdecimal = value[5, 4] #Pulls the decimal portion\n\t\t\treturn (\"#{wholeNum}.#{decimal}\".to_f * 16.0).round(4).to_s\n\t\tend",
"def to_s\r\n \"Project #{@name} has $#{'%.2f' % @fund} towards a goal of $#{'%.2f' % @target_fund}.\"\r\nend",
"def modeler_description\n return \"Multipliers for LPD, EPD, and people densities.\"\n end",
"def format(item)\n\t\titem = \"%.2f\" % item\n\t\treturn item\n\tend",
"def price_as_string\n format(\"$%.2f\", @price)\n end",
"def price_as_string\n format(\"$%.2f\", @price)\n end",
"def tabled_format(item, value)\n \"#{item.capitalize}\" + \" \"*(75 - item.length) + \"$#{value}\"\n end",
"def to_s\n \"[#{date}] #{currency} #{value} - #{description}\"\n end",
"def monetize\n (object.unit_price * 0.01).to_s\n end",
"def display_label_descr\n currency = \" #{CustomFields::NumericFormat.find_currency_unit(option[:unit].to_sym)[:symbol]}\" if format == :currency\n \"#{label.descr}#{currency}\"\n end",
"def displayTemp()\n print \"\\t\" + '%.5f' % @myDegree + \" \" + @myScale + \"\\t\"\n end",
"def dealer_markup\n (origin_price*0.08).round\n end",
"def number_s\n return @number_s\n end",
"def details\n\t\treturn @feature + \": #{@extra_cost} + \" + @real_donation.details \n\tend",
"def details\n\t\treturn @feature + \": #{@extra_cost} + \" + @real_donation.details \n\tend",
"def massage(value)\n value.to_f\n end",
"def inspect\n \"#{'%.2f' % self.amount} #{self.currency}\"\n end",
"def _double(klass, type)\n ref = if self.class.const_defined?(klass)\n type.new(self.class.const_get(klass))\n else\n StringReference.new(klass)\n end\n\n Double.new(ref)\n end",
"def output\r\n (self.myDegrees.to_f).to_s + \" \" + self.myScale.to_s\r\n end",
"def to_s\n str = \"#{value.to_s}#{units}\"\n str += \" | #{self.text}\" if status != \"normal\"\n str\n end",
"def double_number(d)\n [ @vm.signed(d >> @vm.databits), @vm.integer(d) ]\n end",
"def to_s\n '$' + @dollars.to_s + '.' + @cents.to_s\n end",
"def human_price\n #return self.price.to_s + '元' + '(待审)' if self.type_id !='团购价' or self.is_valid.nil?# and self.reviews.sum(:status) < STATUS_LOW\n self.price == 0.0 ? \"免费\" :\"#{\"%0.2f\" %self.price}元\"\n end",
"def to_s\n @value.to_f.to_s\n end",
"def formatted_metric_value metric_value\n return \"MISSING\" unless metric_value.value\n case metric_value.metric.metric_format(:type)\n when :currency\n number_to_currency(metric_value.value, :unit => metric_value.metric.metric_format(:before))\n when :days, :hours, :minutes, :percentage\n \"#{metric_value.value.round(2)} #{metric_value.metric.metric_format(:after)}\"\n else\n metric_value.value.round(2)\n end\n end",
"def to_s\n raise CalculationError, 'Value of element is not set' if not @value\n @value.to_s\n end",
"def d(doc)\n _d = 0.0\n doc.keys.each do |term|\n _d += doc[term]**2.0\n end\n return _d\n end",
"def show_decimal_budget()\n return Money.convert_to_decimal_string(@budget)\n end",
"def dollar amt\n #TOOD: need commas in the right places\n sprintf \"$%0.02f\", amt\nend",
"def decimal_mark; end",
"def format_measure(v)\n v\n end",
"def modeler_description\n return \"This measure will demonstrate how an OpenStudio measure calling EMS functions can be used to model the performance of HVAC equipment that cannot be represented well by using single “standard” performance curve objects (cubic, quadratic, biquadratic, etc.) For example, properly characterizing some HVAC equipment objects requires using different performance curves that cover operation of different parts of the performance regime. This measure will alter (overwrite) the Coil Cooling DX Single Speed Cooling Capacity as a function of temperature performance curve object and attributes used by the simulation if the outdoor air temperature falls below a user defined threshold. This measure allows the user to define the biquadratic curve coefficients associated with the Coil Cooling DX Single Speed Cooling Capacity.\"\n end",
"def energyEfficiency()\n\t\t\t\t\"Carbs \" + carbsPercent().round(2).to_s + \"%,\\nProteins \" + proteinsPercent().round(2).to_s + \"%\\nLipids \" + lipidsPercent().round(2).to_s + \"%\\n\"\n\t\t\tend",
"def format_string(record, attribute, val)\n val\n end",
"def as_ca_dollar; end",
"def probability_s\n return @probability_s\n end",
"def as_text\n @value.as_text\n end",
"def details\n return @description + \": \" + \"#{@extra_cost}\" + \". \" + @basic_prescription.details\n end",
"def dollars(str)\n return \"$%.2f\" % str\n end",
"def dollars; end"
] | [
"0.68977493",
"0.6406998",
"0.63094735",
"0.6210827",
"0.6085217",
"0.6056762",
"0.6010243",
"0.600279",
"0.59242696",
"0.5902884",
"0.5870777",
"0.5775231",
"0.57740736",
"0.57701534",
"0.575007",
"0.57486796",
"0.57377857",
"0.5734188",
"0.5707793",
"0.57048637",
"0.56985915",
"0.56939596",
"0.5656747",
"0.5610301",
"0.5601783",
"0.5591262",
"0.5588233",
"0.5553283",
"0.5552685",
"0.5552685",
"0.5552578",
"0.55391586",
"0.55312234",
"0.5508554",
"0.5491268",
"0.54733133",
"0.5470324",
"0.54617405",
"0.5442374",
"0.54348135",
"0.5417335",
"0.53978467",
"0.5372824",
"0.53498864",
"0.5347892",
"0.53478885",
"0.5343605",
"0.53347385",
"0.5334522",
"0.53323853",
"0.53292805",
"0.5327252",
"0.5319068",
"0.53169805",
"0.53043944",
"0.53035825",
"0.5293748",
"0.52915746",
"0.528753",
"0.5286897",
"0.52834797",
"0.5275334",
"0.5265441",
"0.5264939",
"0.5261385",
"0.52533025",
"0.52533025",
"0.52528477",
"0.52479345",
"0.52440643",
"0.5243547",
"0.5237694",
"0.52311975",
"0.52119386",
"0.52026767",
"0.52026767",
"0.5188736",
"0.51831126",
"0.5170046",
"0.51669854",
"0.5159348",
"0.51590425",
"0.5153771",
"0.51476175",
"0.5146124",
"0.5140348",
"0.51355827",
"0.5135269",
"0.5132651",
"0.513132",
"0.51271",
"0.5122503",
"0.51211816",
"0.5119626",
"0.5118491",
"0.51108366",
"0.5108459",
"0.51082015",
"0.51010865",
"0.5097376",
"0.5093321"
] | 0.0 | -1 |
hour specified hour minute specified minute second specified second interval how fast the second hand advances in real time. | def initialize(hour, minute, second, interval)
@hour = hour
@minute = minute
@second = second
@interval = interval
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rational_hour(seconds); end",
"def end_of_hour\n change(min: 59, sec: 59.999)\n end",
"def end_of_hour\n change(\n min: 59,\n sec: 59,\n usec: Rational(999999999, 1000)\n )\n end",
"def setTime(hour, min, sec)\n setSec(sec) ;\n addMin(min) ;\n addHour(hour) ;\n end",
"def end_of_hour\n change(\n :min => 59,\n :sec => 59,\n :usec => 999999.999\n )\n end",
"def end_of_hour\n change(:min => 59, :sec => 59)\n end",
"def time_interval(inter_val_num=15)\n\n require 'rubygems'\n require 'active_support'\n require 'active_support/time'\n\n cur_time = Time.now\n comp_time = cur_time - cur_time.sec - cur_time.min%15*60\n base_time = comp_time + 1.hour\n\n if comp_time < base_time\n comp_time = comp_time + inter_val_num.minutes\n end\n\n return comp_time.strftime(\"%M:%S\")\n\nend",
"def next_hour(time, time_source = nil)\n seconds_left = time.to_i % 3600\n \n time + (seconds_left > 0 ? seconds_left : 3600)\n end",
"def addTime(hour, min, sec)\n addSec(sec) ;\n addMin(min) ;\n addHour(hour) ;\n end",
"def hitimes_duration_i1\n i = Hitimes::Interval.new\n i.start\n i.stop\nend",
"def tick\n\t\tif @sec > 0\n\t\t\t@sec -= 1\n\t\telse\n\t\t\t@sec = 59\n\t\t\tif min > 0\n\t\t\t\t@min -= 1\n\t\t\telse\n\t\t\t\t@min = 59\n\t\t\t\tif @hr > 0\n\t\t\t\t\t@hr -= 1\n\t\t\t\telse\n\t\t\t\t\t@hr = 23\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend",
"def absolute_hour(seconds); end",
"def time_key(time, interval)\n interval && ( time.to_i / interval ) * interval\n end",
"def hitimes_duration_i2\n Hitimes::Interval.now.stop\nend",
"def hour() end",
"def hourly(options = {})\n branch options.merge(every: :hour)\n end",
"def hourly(options = {})\n branch options.merge(every: :hour)\n end",
"def succ\n next_hour = Hour.new(\"12 AM\")\n\n next_time = (@hour + 1) % 24\n next_hour.instance_eval { @hour = next_time }\n #puts \" succ called: next_hour is #{next_hour}, #{@hour}, #{next_time}\"\n next_hour\n end",
"def tick_tock\n @hour += 1\n @minute = 0\n @second = 0\n end",
"def handle_hh_mm\n handle_sign\n @tzhour = @tokens[@index].get_tag(ScalarHour).type\n next_tag\n next_tag\n @tzminute = @tokens[@index].get_tag(ScalarMinute).type\n next_tag\n end",
"def sec() time[2] end",
"def initialize(hour = 0, minute = 0, second = 0)\n @hour = hour\n @minute = minute\n @second = second\n end",
"def next_time(time, h)\n sec, min, hour = nil\n if date_match?(time, h)\n if h[:hours].include?(time.hour)\n if h[:mins].include?(time.min)\n if sec = h[:secs].detect{|i| i > time.sec} # next second in this minute\n min = time.min\n hour = time.hour\n else # no next second, go to next minute\n if min = h[:mins].detect{|i| i > time.min}\n hour = time.hour\n else # no next minute, go to next hour\n if hour = h[:hours].detect{|i| i > time.hour}\n else # no next hour, go to future day\n begin time = time.advance(:days=>1) end until date_match?(time, h)\n end\n end\n end\n else # not this minute, find next\n if min = h[:mins].detect{|i| i > time.min}\n hour = time.hour\n else # no next minute, go to next hour\n if hour = h[:hours].detect{|i| i > time.hour}\n else # no next hour, go to future day\n begin time = time.advance(:days=>1) end until date_match?(time, h)\n end\n end\n end\n else # not this hour, find next\n if hour = h[:hours].detect{|i| i > time.hour}\n else # no next hour, go to future day\n begin time = time.advance(:days=>1) end until date_match?(time, h)\n end\n end\n else\n time = time.advance(:days => 1) until date_match?(time, h)\n end\n return time.change(:hour => hour || h[:hours].first, :min => min || h[:mins].first, :sec => sec || h[:secs].first)\n end",
"def tempo(beats_per_second)\n\t\tbeats_per_minute = beats_per_second * 60 \n\tend",
"def two_hours\n self.range('2hr')\n end",
"def timechunk(sec)\n fail \"sec = #{sec}\" if sec < 1\n 1.send(find_unit(sec)).round\n end",
"def initialize(seconds)\n @hour = seconds / 60 / 60\n @min = seconds / 60 % 60\n @sec = seconds % 60\n end",
"def rate_time\n hour = @session_time == 2 ? \"12:15\" : \"08:15\"\n DateTime.parse(hour)\n end",
"def after_midnight(time_str)\n count = 0\n hour, min = time_str.split ':'\n hour.to_i.times { count += 60 }\n count += min.to_i\n count % 1440\nend",
"def initialize(hour24, min, sec)\n @hour24 = hour24\n @min = min\n @sec = sec\n end",
"def grandclock(presenthour,&block)\n \n for i in (1..presenthour)\n block.call\n end\n \nend",
"def once_per_hour &block\n\tcurrent_hour = Time.now.hour\n\n\tblock.call\n\t\nend",
"def update!(**args)\n @hour = args[:hour] if args.key?(:hour)\n @minute = args[:minute] if args.key?(:minute)\n @nanosecond = args[:nanosecond] if args.key?(:nanosecond)\n @second = args[:second] if args.key?(:second)\n end",
"def end_of_minute\n change(\n sec: 59,\n usec: Rational(999999999, 1000)\n )\n end",
"def change_time(hour,min)\n Time.strptime(\"#{hour}:#{min}\", \"%H:%M\")\n end",
"def once_per_frame\n last = Time.now\n while true\n yield\n now = Time.now\n _next = [last + (1 / 60), now].max\n sleep(_next - now)\n last = _next\n end\nend",
"def once_per_frame\n last = Time.now\n while true\n yield\n now = Time.now\n _next = [last + (1 / 60), now].max\n sleep(_next - now)\n last = _next\n end\nend",
"def each_hours(n=1, offset=0, dur=1)\n each_seconds(n*60*60, offset*60*60, dur*60*60)\n end",
"def initialize(hour, minute)\n set_time hour, minute\n end",
"def hours() 60 * minutes end",
"def after_midnight(time)\n time_arr = time.split(':')\n hour = time_arr[0].to_i\n minutes = time_arr[1].to_i\n if hour == 24 && minutes == 0\n 0\n else\n minutes = minutes + ( hour * MINUTES_PER_HOUR )\n end\nend",
"def set_time(hour, minute)\n hour = 0 if hour.negative?\n hour = 23 if hour > 23\n minute = 0 if minute.negative?\n minute = 59 if minute > 59\n time = Time.new(0, nil, nil, hour, minute, nil, nil)\n @hour = time.hour\n @minutes = time.min\n end",
"def addHour(hour)\n addMin(hour * 60) ;\n end",
"def correct_time(time, frequency)\n time -= frequency while time > Time.now\n time += frequency while time < Time.now\n time\nend",
"def overtime_pay(hourly_rate, hours)\n hourly_rate * $overtime_rate * hours\nend",
"def start_clock\n condition = true\n while condition do\n puts \"current time : #{@hour.to_s.rjust(2, \"0\")}:#{@min.to_s.rjust(2, \"0\")}:#{@sec.to_s.rjust(2, \"0\")}\"\n sleep 1.0\n\n increment_sec\n\n check_alarm\n end\n end",
"def with_second(second)\n LocalTime.of(@hour, @minute, second, @millis)\n end",
"def ti(time)\n h, m = case time\n when String\n time.split(':').map(&:to_i)[0, 2]\n when Time\n [time.hour, time.min]\n when Date\n [time.hour, time.min]\n when DateTime\n [time.hour, time.min]\n else\n raise \"unsupported object of type #{time.class}: #{time.inspect}\"\n end\n\n # maybe remove later, sanity check\n raise \"time with granularity != 5 min: #{time}\" if m % interval_minutes != 0\n\n (h * 60 + m) / interval_minutes\n end",
"def advance_hours(hours)\n self + (hours * 60 * 60)\n end",
"def hour() time[0] end",
"def set_new_time\n @dt_in = time_in.to_datetime\n update_column(:time_in, @dt_in.change(hour: hour_in.to_i, min: min_in.to_i))\n \n @dt_out = time_out.to_datetime\n update_column(:time_out, @dt_out.change(hour: hour_out.to_i, min: min_out.to_i))\n end",
"def hour_angle\n 0.5 * (self.hour * 60 + self.min)\n end",
"def schedule(time, callback); end",
"def sec=(newsec)\n newsec = newsec.to_i\n raise ArgumentError, \"Invalid second: '#{newsec}'.\" if newsec < 0 or newsec > 60\n @t_sec = newsec.to_i\n end",
"def seconds\n (hour * 60 * 60) + (min * 60)\n end",
"def end_of_minute\n change(sec: 59.999)\n end",
"def instant(n)\n cycle = n % 60\n \n first = 1\n second = 1\n sum = 1\n \n (cycle - 2).times do\n sum = first + second\n sum %= 10\n first = second\n second = sum\n end\n sum\nend",
"def seconds ; return aseconds % SPM ; end",
"def work(interval = 5.0)\n end",
"def get_seconds_after_midnight_from_hms(h, m, s); end",
"def get_seconds_after_midnight_from_hms(h, m, s); end",
"def time_conversion(minutes)\n\t # hours = 0\n\n # while minutes >= 60 do\n # if minutes >=60\n # hours += 1\n # minutes -=60\n # end\n # end\n\n\n # new_hour = hours.to_s\n # new_minutes = minutes.to_s\n\n \tmin = minutes % 60\n hours = minutes / 60\n\n if min < 10\n \tmin = '0'+min.to_s\n end\n\n \treturn hours.to_s + ':' + min.to_s\n\nend",
"def hitimes_duration_t1\n Hitimes::TimedMetric.now('duration_t1').stop\nend",
"def next_time(*args)\n cron_schedule.next_time(*args)\n end",
"def hour_thc\n hour = @t_hour\n hour -= 12 if hour > 12\n return hour\n end",
"def after_midnight(time)\n hour,minute = time.split(':').map(&:to_i)\n \n return hour == 24 ?\n 0\n : ((hour * 60) + minute)\nend",
"def middle_of_day\n change(hour: 12)\n end",
"def middle_of_day\n change(hour: 12)\n end",
"def time_conversion(minutes)\nend",
"def after_midnight(time)\n hrs, mins = time.split(':')\n mins_in_hrs = hrs.to_i * 60\n total = mins_in_hrs + mins.to_i\n return 0 if total == 1440\n total\nend",
"def interval; end",
"def interval; end",
"def sleep_time\n 60\n end",
"def grandfather_clock(hour, sound, &block)\n hour.times do\n block.call(sound)\n end\nend",
"def after_midnight(string)\n (string[0, 2].to_i * 60 + string[3, 2].to_i) % 1440\nend",
"def lazy_sec=(newsec)\n newsec = newsec.to_i\n \n if newsec > 60 or newsec < 0\n mins = (newsec.to_f / 60.0).floor\n newsec -= (mins * 60)\n self.add_mins(mins)\n end\n \n @t_sec = newsec\n end",
"def sleepfor \n\ttimetorun = $hours * 60 * 60\n\tsleep(timetorun)\nend",
"def convert_time( start_hour, duration )\n\n start_time = @first_hour + ( ( start_hour - 1 ) * @total_hour_duration ).minutes\n end_time = @first_hour + ( ( ( start_hour - 1 + duration ) * @total_hour_duration ) - @break_length).minutes\n Period.new(start_time, end_time)\n end",
"def time_greetings\n if 5 <= Time.now.hour && Time.now.hour <= 12 \n puts \"good morning!\"\nelsif 12 <= Time.now.hour && Time.now.hour <= 18 \n puts \"good afternoon!\"\nelsif 18 <= Time.now.hour && Time.now.hour <= 20 \n puts \"good evening!\"\nelsif 20 <= Time.now.hour || Time.now.hour <= 5\n puts \"salutations comrade!\"\n end\nend",
"def end_hour_with_respecting_end_of_day\n if end_minute_without_respecting_end_of_day >= 59 and end_hour_without_respecting_end_of_day == 23\n 24\n else\n end_hour_without_respecting_end_of_day\n end\n end",
"def angl(hrs, mnts)\n 0.5 * (60 * hrs - 11 * mnts)\nend",
"def time_conversion(minutes)\n hr = 0\n min = 0\n \n while minutes >= 0\n if minutes >= 60\n minutes = minutes - 60\n hr = hr + 1\n elsif minutes < 10\n min = 0.to_s + minutes.to_s\n return hr.to_s + ':' + min.to_s\n else\n min = minutes\n return hr.to_s + ':' + min.to_s\n end\n end\nend",
"def increment_time\n @now += 1.minute\n end",
"def with_hour(hour)\n LocalTime.of(hour, @minute, @second, @millis)\n end",
"def every(interval_sec, &block)\n raise \"Missing implementation 'every'\"\n end",
"def interval ; @options[ :interval ] ; end",
"def advance(seconds:)\n @time += (seconds.to_i * 1_000)\n end",
"def findTime(t, k)\n \n # convert the given time in minutes\n minutes = ((((t[0]).ord() - ('0').ord())* 10 + \n (t[1]).ord() - ('0').ord())* 60 + \n (((t[3]).ord() - ('0').ord()) * 10 + \n (t[4]).ord() - ('0').ord()));\n \n # Add K to current minutes\n minutes += k\n \n # Obtain the new hour\n # and new minutes from minutes\n hour = (minutes / 60).to_i % 24\n \n min = minutes % 60\n \n output = \"\"\n \n # Print the hour in appropriate format\n if (hour < 10)\n output = output + 0 + hour.to_s + \":\") \n else\n output = output + hour.to_s + \":\")\n end \n \n # Print the minute in appropriate format\n if (min < 10)\n puts (0 + min.to_s) \n else\n puts (min.to_s)\n end \n\n\n end",
"def to_i\n return (((@hour*60)+@minute)*60) + @second\n end",
"def tick\n @time = next_time(true)\n end",
"def lazy_hour=(newhour)\n newhour = newhour.to_f\n \n #Add days for every 24 hours given.\n if newhour > 24 or newhour < 0\n days = (newhour.to_f / 24.0).floor\n newhour -= (days.to_f * 24.0)\n self.add_days(days)\n end\n \n #Convert any decimals to setting minute.\n diff = newhour - newhour.floor\n self.lazy_min = diff * 60 if diff > 0.0\n \n #Set the actual hour.\n self.hour = newhour.floor\n \n self\n end",
"def time_to_solve\n 1.hour\n end",
"def hours; self * HOUR; end",
"def hours; self * HOUR; end",
"def after_midnight(time_str)\n hours, minutes = time_str.split(':').map(&:to_i)\n (hours * MINUTES_PER_HOUR + minutes) % MINUTES_PER_DAY\nend",
"def set_mtimes(times)\n pm = false\n _24hr = true\n\n times_24 = []\n now = Time.now\n \n #convert to '24hr' for consistency\n #start backwards to make sure its am or pm\n times.reverse_each do |t|\n\n hr, min = t[0].to_s.split(':', 2)\n\n #change to pm\n if (min.include?(\"pm\"))\n pm = true\n _24hr = false\n end\n\n #change from pm to am\n if (min.include?(\"am\") && !_24hr)\n pm = false\n end\n\n #only am start - hackish\n if (min.include?(\"am\") && times.length < 3)\n _24hr = false\n end\n\n if (_24hr)\n augment =0\n if (hr.to_i == 12)\n augment = 12\n end\n\n t = Time.new(now.year, now.month, now.day,\n hr.to_i - augment, min[/[0-9]+/]) + 24*60*60 #add a day\n elsif (pm)\n augment = 0\n if hr.to_i != 12\n augment = 12\n end\n t = Time.new(now.year, now.month, now.day,\n hr.to_i + augment, min[/[0-9]+/])\n\n elsif (!pm & !_24hr)\n t = Time.new(now.year, now.month, now.day,\n hr.to_i, min[/[0-9]+/])\n end\n\n=begin\n #midnight seems to be latest\n if ((!pm && min.include?(\"am\") && hr.to_i == 12) ||\n ((!pm && hr.to_i == 12)))\n \n t = Time.new(now.year, now.month, now.day,\n hr.to_i - 12, min[/[0-9]+/]) + 24*60*60 #add a day\n\n elsif (!pm && min.include?(\"am\"))\n pm = false\n\n t = Time.new(now.year, now.month, now.day,\n hr.to_i, min[/[0-9]+/])\n\n elsif (pm || min.include?(\"pm\"))\n pm = true\n augment = 0\n if (hr.to_i != 12)\n augment = 12\n end\n\n t = Time.new(now.year, now.month, now.day,\n hr.to_i + augment, min[/[0-9]+/])\n\n end\n=end\n times_24.push t\n end\n\n self.mtimes = times_24\n\n end",
"def time_diff(time1, time2)\n time1_a = time1.split(':')\n time2_a = time2.split(':')\n \n hours_output = 0\n hours1 = time1_a[0].to_i\n hours2 = time2_a[0].to_i\n hours = hours2 - hours1\n \n mins = time2_a[1].to_i - time1_a[1].to_i\n \n while hours > 0\n hours_output += 60\n hours -= 1\n end\n return hours_output + mins \nend",
"def at ts\n spawn :@trange, time_to_long(ts)\n end",
"def grandfather_clock &block\n time = Time.new.hour\n if time == 0\n time = 12\n elsif time > 12\n time = time - 12\n end\n\n time.times do\n block.call\n end\n\n # Work in progress for output once every hour while code running\n # while true\n # if (Time.new.hour - time) == 1\n # block.call\n # puts \"It is #{time}o'clock!\"\n # if time == 12\n # time = 1\n # else \n # time = time + 1\n # end\n # end\n # end\nend",
"def advance_interval(time)\n case granularity\n when 'second'\n time.advance(seconds: 1)\n when 'minute'\n time.advance(minutes: 1)\n when 'fifteen_minute'\n time.advance(minutes: 15)\n when 'thirty_minute'\n time.advance(minutes: 30)\n when 'hour'\n time.advance(hours: 1)\n when 'day'\n time.advance(days: 1)\n when 'week'\n time.advance(weeks: 1)\n when 'month'\n time.advance(months: 1)\n when 'quarter'\n time.advance(months: 3)\n when 'year'\n time.advance(years: 1)\n else\n raise DruidDB::QueryError, 'Unsupported granularity'\n end\n end"
] | [
"0.6709556",
"0.614363",
"0.61361176",
"0.6059917",
"0.6019283",
"0.595288",
"0.5921481",
"0.58988297",
"0.5897865",
"0.5841987",
"0.58183527",
"0.5814105",
"0.5794004",
"0.5792468",
"0.5790944",
"0.5736809",
"0.5736809",
"0.573235",
"0.5711035",
"0.5662243",
"0.5644958",
"0.5608276",
"0.5573138",
"0.5562602",
"0.5547004",
"0.5542911",
"0.5521035",
"0.5510831",
"0.54962176",
"0.5491472",
"0.5462075",
"0.54502237",
"0.5446402",
"0.5436098",
"0.54024005",
"0.5397715",
"0.5397715",
"0.53949326",
"0.5394008",
"0.53926057",
"0.5376314",
"0.53690016",
"0.53432035",
"0.5341594",
"0.5340808",
"0.532209",
"0.532183",
"0.53199536",
"0.53127813",
"0.5310857",
"0.5308788",
"0.5301165",
"0.5297352",
"0.5278708",
"0.52755404",
"0.5272101",
"0.5259113",
"0.5254419",
"0.5251762",
"0.52374494",
"0.52374494",
"0.5232824",
"0.5226456",
"0.52197456",
"0.52185744",
"0.5203805",
"0.51959413",
"0.51959413",
"0.5187243",
"0.5185277",
"0.51837647",
"0.51837647",
"0.5183123",
"0.5179848",
"0.51638347",
"0.51635844",
"0.5151333",
"0.5147699",
"0.5136744",
"0.51350033",
"0.51332116",
"0.5127245",
"0.51254493",
"0.5113667",
"0.5104623",
"0.5102665",
"0.5102114",
"0.50705016",
"0.5055964",
"0.5055441",
"0.5055248",
"0.5048643",
"0.50451356",
"0.50449914",
"0.5043167",
"0.5041003",
"0.5032502",
"0.50289524",
"0.5023002",
"0.5021849"
] | 0.63010275 | 1 |
Ticks our clock for a specified number of turns. Our clock tick in real time according to the clock interval. | def wind_up(turns)
"Starting time: " + current time
turns.times do
sleep(@interval)
tick
end
"Finsh Time: " + current_time
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def loop(num_ticks, tick_time)\n @tick_time = tick_time\n \n (0..num_ticks).each do |tick|\n time = java.lang.System.currentTimeMillis\n\n @tick = tick\n yield tick\n\n sleep_time = @tick_time - (java.lang.System.currentTimeMillis - time)\n java.lang.Thread.sleep(sleep_time) if sleep_time > 0\n end\n end",
"def tick\n\t\tif @sec > 0\n\t\t\t@sec -= 1\n\t\telse\n\t\t\t@sec = 59\n\t\t\tif min > 0\n\t\t\t\t@min -= 1\n\t\t\telse\n\t\t\t\t@min = 59\n\t\t\t\tif @hr > 0\n\t\t\t\t\t@hr -= 1\n\t\t\t\telse\n\t\t\t\t\t@hr = 23\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend",
"def tick(seconds)\n\t\t@time += seconds\n\tend",
"def tick\n @time = next_time(true)\n end",
"def tick\n 2.times.each do\n sub_components.each(&:tick)\n sub_components.each(&:tock)\n end\n end",
"def run(ticks)\n\t\tfor i in 0..ticks\n\t\t\tputs building.to_s\n\t\t\tbuilding.tick\n\t\tend\n\t\tputs building.to_s\n\tend",
"def tick_tock\n @hour += 1\n @minute = 0\n @second = 0\n end",
"def at_tick_interval(num_of_ticks)\n yield if sensors.ticks % num_of_ticks == 0\n end",
"def tick\n @second += 1\n need_tock?\n end",
"def tick\n Kernel.sleep(length) if length > 0\n @count += 1\n end",
"def every_ticks ticks, &block\n @tick_actions << [ticks.to_i, block, ticks.to_i]\n end",
"def sync_2600_with(color_clock)\n riot.tick if color_clock % 3 == 0\n @graphics.each &:tick\n cpu.tick if color_clock % 3 == 2\n end",
"def sync_2600_with(color_clock)\n @riot.tick if color_clock % 3 == 0\n @tia.tick\n @cpu.tick if color_clock % 3 == 2\n end",
"def register_tick\r\n\t\t\t@accum_fps += 1\r\n @ticks += 1\r\n\t\t\tcurrent_second = Gosu::milliseconds / 1000\r\n\t\t\tif current_second != @current_second\r\n\t\t\t\t@current_second = current_second\r\n\t\t\t\t@fps = @accum_fps\r\n\t\t\t\t@accum_fps = 0\r\n\t\t\tend\r\n\r\n #\r\n # Calculate how many milliseconds passed since last game loop iteration.\r\n #\r\n\t\t\t@milliseconds_since_last_tick = Gosu::milliseconds - @last_value\r\n\t\t\t@last_value = Gosu::milliseconds\r\n\t\t\treturn @milliseconds_since_last_tick\r\n\t\tend",
"def update\n if @counter == 30\n self.x += 1\n elsif @counter == 60\n self.x -= 1\n @counter = 0\n end\n @counter += 1\n end",
"def ticks\r\n @fps_counter.ticks\r\n end",
"def tick_clock\n tick = @event_system.clock.tick\n @event_system.queue << tick\n tick\n end",
"def update\n if @counter == 30\n self.x -= 1\n elsif @counter == 60\n self.x += 1\n @counter = 0\n end\n @counter += 1\n end",
"def chronometer(seconds)\n last_tick = Time.now\n yield\n loop do\n sleep 0.1\n if Time.now - last_tick >= seconds\n last_tick += seconds\n yield\n end\n end\n end",
"def show(ticks = 0)\n draw\n (ticks || 0).times do |tick|\n update\n draw\n end\n end",
"def tick events\r\n turn_radar 35 if time ==0\r\n turn_gun 25 if time <3\r\n accelaterate 2\r\n turn 2\r\n fire 4 unless events ['robot_scanned'].empty?\r\n end",
"def tick\n end",
"def tick(events)\n end",
"def tick()\n\t\t\t\tpassed = Clock.runtime() - @last_tick # how long since the last tick?\n\t\t\t\tif @target_frametime\n\t\t\t\t\treturn Clock.delay(@target_frametime - passed) + passed\n\t\t\t\tend\n\t\t\t\treturn passed\n\t\t\tensure\n\t\t\t\t@last_tick = Clock.runtime()\n\t\t\t\t@ticks += 1\n\t\t\tend",
"def call_times(times)\n i = 0\n while i < times\n yield\n i += 1\n end\n end",
"def step\t\n\t\t@tick += 1\n\t\t\n\t\tif @tick == @interval\n\t\t\t@block.call\n\t\t\treset\n\t\tend\n\tend",
"def clock &block\n hour = Time.now.hour\n\n # Turn the current hour into a 12 hour clock face equivalent\n if hour == 0\n hour = 12\n elsif hour > 12\n hour = hour % 12\n end\n\n hour.times do | n |\n # Pass each hour number into the block (so it ma use it if needed) adding 1\n # cause .times starts counting from 0.\n yield n + 1\n end\nend",
"def update\n n = $seconds_per_tick\n @time += n\n\n @ticks_to_update_clock -= 1\n\n if @ticks_to_update_clock == 0\n @ticks_to_update_clock = (60 / $seconds_per_tick).to_i\n @text.text = to_s\n end\n\n if !@time.day? and @old_hour != @time.hour\n @sun_shining_mask.color.opacity = sun_mask_opacity\n @old_hour = @time.hour\n end\n end",
"def tick\n\t\t@elevators.each{|elevator| elevator.tick}\n\t\t@floors.each{|floor| floor.tick}\n\tend",
"def tick; end",
"def tick; end",
"def tick; end",
"def sleeper(clock)\n n = 0\n tm = clock\n every(0.1) do\n n += 1\n break if n == tm\n end\nend",
"def draw_override(ffi_draw)\n\n # So, work out how many seconds have passed since we started; there are\n # 60 ticks per second\n seconds = (@args.tick_count - @start_tick) / 60\n hundreds = ((@args.tick_count - @start_tick) % 60) * 100 / 60\n\n # Extract the four digits individually\n first, second = seconds.to_i.divmod(10)\n third, fourth = hundreds.to_i.divmod(10)\n\n # And render the right digit\n ffi_draw.draw_sprite_3(\n @x, @y, 48, 64, 'adrift/sprites/counter-numbers.png',\n nil, nil, nil, nil, nil, nil, nil,\n nil, nil, nil, nil, nil, nil,\n first*48, 0, 48, 64\n )\n ffi_draw.draw_sprite_3(\n @x + 48, @y, 48, 64, 'adrift/sprites/counter-numbers.png',\n nil, nil, nil, nil, nil, nil, nil,\n nil, nil, nil, nil, nil, nil,\n second*48, 0, 48, 64\n )\n ffi_draw.draw_sprite_3(\n @x + 92, @y, 10, 64, 'adrift/sprites/counter-numbers.png',\n nil, nil, nil, nil, nil, nil, nil,\n nil, nil, nil, nil, nil, nil,\n 480, 0, 10, 64\n )\n ffi_draw.draw_sprite_3(\n @x + 106, @y, 48, 64, 'adrift/sprites/counter-numbers.png',\n nil, nil, nil, nil, nil, nil, nil,\n nil, nil, nil, nil, nil, nil,\n third*48, 0, 48, 64\n )\n ffi_draw.draw_sprite_3(\n @x + 154, @y, 48, 64, 'adrift/sprites/counter-numbers.png',\n nil, nil, nil, nil, nil, nil, nil,\n nil, nil, nil, nil, nil, nil,\n fourth*48, 0, 48, 64\n )\n\n end",
"def clock(frequency)\n# TODO: extract diveder to CONSTANT\n options = {4000 => 0, #4 kHz\n 8000 => 32768, #8 kHz\n 15625 => 16384, #15.625 kHz\n 31250 => 8192, #31.25 kHz\n 62500 => 4096, #62.5 kHz\n 125000 => 2048, #125 kHz\n 250000 => 1024, #250 kHz\n 500000 => 512, #500 kHz\n 1000000 => 256, #1 MHz\n 2000000 => 128, #2 MHz\n 4000000 => 64, #4 MHz\n 8000000 => 32, #8 MHz\n 20000000 => 16 #20 MHz\n }\n divider = options[frequency]\n Rpio.driver.spi_clock(divider)\n end",
"def tick dt\n update_balance dt\n flush_output\n end",
"def times(*args)\n\t\t\t\t\trepeat *args\n\t\t\t\tend",
"def roll_times(num, pins)\n num.times {bowling.roll(pins)}\n end",
"def test_tick\n\t\t@reverseclock.tick\n\t\t#test that the hours, mins and secs values are as they should be after tick is invoked\n\t\tassert_equal(@reverseclock.hours, 23, 'tick not operating correctly')\n\t\tassert_equal(@reverseclock.mins, 59, 'tick not operating correctly')\n\t\tassert_equal(@reverseclock.secs, 59, 'tick not operating correctly')\n\t\t#As before, not sure if i need to test whether the hours, mins and secs are within the appropriate bounds as have tested them already above\n\t\t#leaving it in anyway but probably don't need it.\n\t\tassert(@reverseclock.hours >= 0 && @reverseclock.hours <= 23, 'reverse clock hours value out of bounds')\n\t\tassert(@reverseclock.mins >= 0 && @reverseclock.mins <= 59, 'reverse clock minutes value out of bounds')\n\t\tassert(@reverseclock.mins >= 0 && @reverseclock.mins <= 59, 'reverse clock seconds value out of bounds')\n\tend",
"def update_interval\n self.interval =\n case repetitions\n when 1 then 1\n when 2 then 6\n else\n (repetitions - 1) * easiness_factor\n end\n end",
"def spinright(num_times: 1)\n num_times.times do \n send_command 0x74, 0x72,0x24\n sleep 1\n end\n end",
"def setup_clock\n @clock = Clock.new()\n @clock.target_framerate = 50\n\n # Adjust the assumed granularity to match the system.\n # This helps minimize CPU usage on systems with clocks\n # that are more accurate than the default granularity.\n @clock.calibrate\n\n # Make Clock#tick return a ClockTicked event.\n @clock.enable_tick_events\n end",
"def call\n SCC::Logger.info \"[TIMER] Starting timer for #{duration} seconds, with #{interval} second intervals.\"\n call_count.times do |n|\n yield\n\n SCC::Logger.info \"[TIMER] Finished #{n+1} of #{call_count} calls.\"\n\n if (n+1) != call_count\n SCC::Logger.info \"[TIMER] Waiting #{interval} seconds till next call.\"\n sleep interval\n end\n end\n end",
"def tick\n @requests.each do |id,req|\n req.tick\n end\n end",
"def clock_tick\n instruction = @travel_instructions[@current_instruction]\n case instruction\n when 'L', 'R'\n @facing_direction = cardinal_direction_to_my(instruction)\n when 'M'\n @x_location, @y_location = coordinates_to_the(@facing_direction)\n else\n raise ArgumentError.new(\"illegal instruction #{@travel_instructions[@current_instruction]} at index #{@current_instruction}\")\n end\n @current_instruction += 1\n end",
"def start_clock\n condition = true\n while condition do\n puts \"current time : #{@hour.to_s.rjust(2, \"0\")}:#{@min.to_s.rjust(2, \"0\")}:#{@sec.to_s.rjust(2, \"0\")}\"\n sleep 1.0\n\n increment_sec\n\n check_alarm\n end\n end",
"def tick\n Grid.tick\n head :ok\n end",
"def run(n)\n puts \"start\"\n puts @building.to_s, \"\"\n n.times do |tick|\n puts \"Tick #{tick+1}\"\n @registered_items.each{ |item| item.tick }\n puts @building.to_s, \"\"\n end\n end",
"def cycles_per_100ms(iterations, time_s)\n cycles = iterations * Clock::MICROSECONDS_PER_100MS\n cycles /= time_s * Clock::MICROSECONDS_PER_SECOND\n cycles = cycles.to_i\n cycles <= 0 ? 1 : cycles\n end",
"def update(ticks = 0)\n# Chipmunk allows you to use a different timestep each frame, but it works much better when you use a fixed timestep.\n# An excellent article on why fixed timesteps for game logic can be found here: http://gafferongames.com/game-physics/fix-your-timestep/\n# cpSpaceStep(space, 1.0f/60.0f);\n @space.step 1.0/60.0\n end",
"def instant(n)\n cycle = n % 60\n \n first = 1\n second = 1\n sum = 1\n \n (cycle - 2).times do\n sum = first + second\n sum %= 10\n first = second\n second = sum\n end\n sum\nend",
"def spin_loop(number_of_iterations)\n for i in 1..number_of_iterations do\n puts \".\"\n sleep(0.5)\n end\n end",
"def compute_ticks\n smallest_interval = chrons.map {|c| c.value}.diffs.min\n nintervals = (top - bottom)/smallest_interval\n interval = smallest_interval\n while (nintervals > @maximum_intervals)\n interval = chron.next_interval_after(interval)\n nintervals = (top - bottom)/interval\n end\n\n if chron == Dataset::Chron::YYYYMM && interval >= 1.0\n @chron = Dataset::Chron::YYYY\n end\n\n if chron == Dataset::Chron::YYYYQ && interval >= 1.0\n @chron = Dataset::Chron::YYYY\n end\n\n tick_values = []\n x = chrons.first.value.round_down(interval)\n while x <= chrons.last.value.round_up(interval) do\n tick_values << x\n x += interval\n end\n tickChrons = tick_values.map do |tv|\n # TODO: clean this up, it's an ugly hack to workaround SchoolYear not having\n # a numeric constructor; there must be a cleaner way to do the initialization\n # stuff in chron.rb\n if chron == Dataset::Chron::SchoolYear\n chron.new(:yyyy => tv)\n else\n chron.new(tv)\n end\n# chron.new(tv)\n end\n\n # adjust the axis so that the first tick is inside the axis\n if tick_values.first < @bottom\n @bottom = tick_values.first - interval_size/2\n end\n\n # adjust the axis so that it extends all the way to the final tick label\n @top = tick_values.last + interval_size/2\n\n # if chron != Dataset::Chron::YYYY then\n # @ticks = chrons.map {|chron| Tick.new(self, chron)}\n # else\n # if chrons.size <= @maximum_intervals then\n # @ticks = chrons.map {|chron| Tick.new(self, chron)}\n # else\n # first_tick = chrons.first.value.round_up(5)\n # last_tick = chrons.last.value.round_down(5)\n # tickChrons = []\n # (first_tick .. last_tick).step(5) do |n|\n # tickChrons << chron.new(n)\n # end\n @ticks = tickChrons.map {|chron| Tick.new(self, chron)}\n # end\n # end\n end",
"def repeat_call(repetitions, interval)\n repetitions.times do\n yield\n sleep(interval)\n end\nend",
"def after_ticks ticks, &block\n @tick_actions << [ticks.to_i, block, false]\n end",
"def roll_n_times(rolls, pins)\n rolls.times do\n Array(pins).each { |value| @game.roll(value) }\n end\n end",
"def schedule_every(n, &block)\r\n\r\n while true do\r\n before = Time.now\r\n\r\n block.call\r\n \r\n elapsed = Time.now - before\r\n interval = n - elapsed\r\n \r\n @logger.debug \"orders processing/delivery take #{elapsed} seconds.\"\r\n \r\n sleep(interval) if interval > 0\r\n end\r\n\r\nend",
"def clk_freq(secs=1, scale=1)\n tic = sys_clkcounter\n sleep secs\n toc = sys_clkcounter\n (toc - tic) % (1<<32) / scale / secs\n end",
"def tick_every=(tick_every)\n if !tick_every.nil? && tick_every > 604800\n fail ArgumentError, 'invalid value for \"tick_every\", must be smaller than or equal to 604800.'\n end\n if !tick_every.nil? && tick_every < 30\n fail ArgumentError, 'invalid value for \"tick_every\", must be greater than or equal to 30.'\n end\n @tick_every = tick_every\n end",
"def on_timer(value=1000)\n Thread.new() {\n begin\n nbtick=(value/TICK)+1\n loop do\n i=0\n sleep(TICK/1000.0) while self.connected?() && (i+=1)<nbtick\n self.connected?() ? yield() : break\n end\n rescue Exception => e\n $stdout.puts \"#{e} :\\n #{e.backtrace.join(\"\\n \")}\"\n end\n }\n end",
"def play(board)\n 9.times {turn(board)}\nend",
"def play(board)\n 9.times {turn(board)}\nend",
"def tick\n # move balls\n @balls.each(&:move)\n # move bonuses\n @bonuses.delete_if do |bonus|\n bonus.move\n bonus.out?\n end\n # check for speedup\n @speedup_countdown -= 1\n return unless @speedup_countdown.zero?\n @speedup_countdown = GAME_SPEEDUP_INTERVAL\n @balls.each do |ball|\n ball.speed *= 1.1\n end\n end",
"def tick\n if @ticks == @samples\n @ticks = 0\n @current = @samples/(Time.now.to_f - @ref)\n @min = [@current, @min].min\n @max = [@current, @max].max\n @to_s = sprintf(\"%.2f %.2f %.2f\\n\", min, current, max)\n return true\n end\n \n @ref = Time.now.to_f if @ticks == 0\n @ticks += 1\n \n return false\n end",
"def tick\n unless @player_killed\n update_tick_count\n\n @player_killed = update_gravity\n\n if @ticks % 4 == 0\n @player_killed = update_monsters\n end\n end\n end",
"def tick args\r\n\r\n # For an example we are going to create an interface with the expressions shown in the demo.\r\n # To show each element one at a time we are going to create an if statement to separate each step\r\n # This way we can see each element introduced individually as to not get too overwhelming.\r\n\r\n #-----------Ticks\r\n # First we are going to want a variable to represent the tick count there are 60 ticks per second\r\n # Ticks also represent the number of frames of the game that exist consecutively per second\r\n ticks = args.state.tick_count # Having a variable lets us bypass using the whole expression going forward.\r\n\r\n # The tick count is useful.\r\n # It allows us to know how many instances of the game have ran,\r\n # it gives us a sense of time for our game,\r\n # and because game will update every frame,\r\n # it will allow us to differentiate actions depending on the current frame.\r\n\r\n # Something it can also allow for is the animation sprites and environments.\r\n # Unfortunately we wont have time to go over that, so expect a later tutorial to cover that.\r\n\r\n #----------- Mouse clicks and inputs\r\n # One more declaration we are going to for the tutorial is click count\r\n # Because there is a game instance every frame,\r\n # we need a way to save the changes from frame to frame\r\n # We can do this by creating a state variable.\r\n # State variables are best created in an if statement for our purposes.\r\n # If we try to create them outside of the if statement,\r\n # it can result in the variable being redeclared with it's starting value every frame.\r\n\r\n # So we create click_count\r\n # In this case, if click_count doesnt exist we create it.\r\n if !args.state.click_count\r\n\r\n args.state.click_count = 0\r\n end\r\n\r\n # We are making click_count, to track how many clicks have occurred inside the game window.\r\n # Using this we are able to change the game state every time a click occurs inside the window.\r\n # Clicking on it now will reveal a temporary message from further in the tutorial.\r\n\r\n # Now we check to see if the click has returned to the up position.\r\n # Every time this occurs we can increment click count by one.\r\n if args.inputs.mouse.up\r\n args.state.click_count += 1\r\n # We also need to reset mouse.up to 0 so it doesn't continuously increment click_count every frame.\r\n args.inputs.mouse.up = 0\r\n end\r\n # This is one of the many example of how you can use inputs to receive information from the user.\r\n # In this case we are receiving a click from the user\r\n # and depending on the number of clicks we are outputting different information onto the screen.\r\n # The way we set it up, it's kind of like a power point in that each click adds an additional component.\r\n\r\n # We can take input from any key, click or button via the\r\n # args.inputs.mouse, args.inputs.keyboard, and args.inputs.controller expressions.\r\n # Adding key designations to keyboard and controller expressions allow us to use\r\n # almost any key or button in our game.\r\n # From there we can add .up, .down, .held, .click\r\n # and all sorts of expressions to change the the information we are obtaining from a press.\r\n\r\n # There will be direct example in the sprite section of the tutorial\r\n\r\n######################################################\r\n # So where do we start?\r\n # We already have.\r\n\r\n # To get some actual output onto the screen though, we will start with labels,\r\n # but there are many other expressions\r\n # that you can expect to find in the dragonruby gametoolkit (gtk).\r\n # These expressions are: labels, lines, borders, solids, sprites, inputs, outputs, keyboard, mouse, and controller\r\n # There are many other expressions with more added with every update, but i am going to start with these.\r\n\r\n #----------- Labels\r\n\r\n # Our first label will be placed onto the top right corner of the screen.\r\n\r\n # This is the if statement that will change what pops up onto the screen\r\n # Each time we click the mouse.\r\n # If you haven't clicked once yet, CLICK NOW!\r\n if args.state.click_count == 1\r\n\r\n # To create a label with the gtk we will need to use the following array format:\r\n # X Y TEXT SIZE ALIGNMENT RED GREEN BLUE ALPHA FONT FILE\r\n args.outputs.labels << [1000, 720, \"This is a temp msg\", 5, 0, 200, 050, 100, 175, \"fonts/coolfont.ttf\"]\r\n end\r\n\r\n # The parameters start with the coordinate, x and y,\r\n # followed by the text in quotations that you want outputted,\r\n # each of which is to be separated by a comma.\r\n # After that we have the text size, alignment, of which 1 will center your text on the coordinates,\r\n # followed by red, green, and blue saturation.\r\n # Finally, the alpha is the transparency,\r\n # which needs to be set at 255 to be solid, and lastly is font with the extension .ttf.\r\n\r\n #\r\n\r\n # Click!\r\n if args.state.click_count > 2\r\n # we are going to replace this temp message with the tick count in the corner.\r\n # It will help us keep track of how many instances of the game have ran among other things.\r\n args.outputs.labels << [1000, 720, ticks, 25, 0, 200, 050, 100, 25]\r\n end\r\n\r\n # Click!\r\n if args.state.click_count > 3\r\n # We can leave off parameters if you dont need them as well.\r\n # Leaving them off will set them to a default value.\r\n args.outputs.labels << [640, 700, \"This is a game\", 0, 1] # This will be the title for the game.\r\n end\r\n\r\n # Click!\r\n if args.state.click_count > 4\r\n # We can also use a hash, which is a more readable version, that sometimes has more functionality.\r\n args.outputs.labels << {\r\n x: 10,\r\n y: 710,\r\n text: \"Lives:\",\r\n size_enum: -3,\r\n alignment_enum: 0,\r\n r: 155,\r\n g: 50,\r\n b: 50,\r\n a: 255,\r\n font: \"fonts/manaspc.ttf\"\r\n }\r\n end\r\n # Most of the expressions have a more readable version like this\r\n # which can help when you are just starting out.\r\n # Hashes may be more readable, but they are harder on performance.\r\n # Arrays are faster and easier to compile.\r\n # It's more efficient to use arrays, so once the developer gets use to them,\r\n # unless hashes are needed for functionality, arrays are the go to.\r\n\r\n #----------- Lines\r\n # Click!\r\n if args.state.click_count > 5\r\n # The next expression we will go through is lines:\r\n # X1 Y1 X2 Y2 RED GREEN BLUE ALPHA\r\n args.outputs.lines << [ 0, 600, 1280, 600, 0, 0, 0, 255]\r\n end\r\n # Lines are different but a little less complicated.\r\n # The first 4 fields are the x/y coordinate beginning and end points.\r\n # x1, y1 are the origin points, and x2, y2 are the end points to the line.\r\n # Just like with labels you can change the color of the line.\r\n # You can even make it invisible or transparent using alpha if you want.\r\n\r\n # The Line also has a hash\r\n\r\n # Click!\r\n if args.state.click_count == 7\r\n args.outputs.lines << {\r\n x: 0,\r\n y: 0,\r\n x2: 1280,\r\n y2: 720,\r\n r: 0,\r\n g: 255,\r\n b: 0,\r\n a: 255\r\n }\r\n args.outputs.lines << [0, 720, 1280, 0]\r\n end\r\n\r\n # So far so good.\r\n # Our user interface is looking alright.\r\n # I think we could make the title more distinct however.\r\n\r\n #----------- Solids and boarders\r\n\r\n # For this we are going to use some boarders and solids.\r\n # Lets declare some values.\r\n # Remember that the coordinate for the title label were: 640, 700\r\n # and alignment was selected to center the text.\r\n # Often you will want to play with the coordinate to get things where you want them.\r\n # We shall create a couple variables to assist in this process.\r\n board_x = 540\r\n board_y = 668\r\n board_w = 200\r\n board_h = 45\r\n echo = 4 # Echo is going to represent a slight modification to the original values\r\n # our echo value will allow us to change additional solids and boarders to make the background more distinct\r\n # Click!\r\n if args.state.click_count > 7\r\n\r\n # X Y WIDTH HEIGHT RED GREEN BLUE ALPHA\r\n args.outputs.borders << [board_x, board_y, board_w, board_h, 0, 0, 200, 255]\r\n end\r\n\r\n # Boarders and solids are like lines, but they start at the desired coordinate and then have\r\n # a width and height.\r\n # X, Y are the coordinates and w and h are width and height.\r\n # Similarly to the other expressions we also have alignment and color.\r\n\r\n\r\n # Click!\r\n if args.state.click_count > 8\r\n # Here we have the additional borders at an offset of size echo\r\n args.outputs.borders << [board_x - echo, board_y - echo, board_w + echo * 2, board_h + echo * 2, 200, 0, 0, 255]\r\n end\r\n if args.state.click_count > 9\r\n args.outputs.solids << [board_x - echo, board_y - echo, board_w + echo * 2, board_h + echo * 2, 35, 0, 50, 255]\r\n end\r\n\r\n echo -= 5\r\n # Changing the echo here can allow to create a depth effect\r\n # or add layers to the background of the title\r\n\r\n # Click!\r\n if args.state.click_count > 9\r\n args.outputs.solids << {\r\n x: board_x - echo,\r\n y: board_y - echo,\r\n w: board_w + echo * 2,\r\n h: board_h + echo * 2,\r\n r: 25,\r\n g: 100,\r\n b: 40,\r\n a: 255\r\n }\r\n echo = 10\r\n args.outputs.solids << [board_x - 4, board_y - echo, board_w + echo + 4, board_h + echo + 4, 0, 35, 0, 20]\r\n # This is a very basic shadow to show how these might be done.\r\n # It doesnt look great but if we used a similar looking sprite \r\n # with rounded edges we might get a better effect\r\n end\r\n\r\n # Now that our tittle is more distinct, our rough user interface is done for the movement.\r\n # The next steps will cover sprites, movement and wrapping.\r\nend",
"def run(iterations=1000)\n iterations.times { step }\n end",
"def interval(retries)\n JITTER * (rand(2 ** retries - 1) + 1)\n end",
"def spinleft(num_times: 1)\n num_times.times do \n send_command 0x73, 0x72,0x24\n sleep 1\n end\n end",
"def ticks_elapsed\n (@current_milliseconds / (@notify_frequency)).round\n end",
"def main\n balls = getBallCount()\n minutes = getMinutes()\n\n puts(ball_clock(balls, minutes))\nend",
"def every n, &block\n loop do\n log_duration { yield }\n sleep n \n end\n end",
"def tick args\n defaults args\n render args\n inputs args\n get_sounds(args) if args.state.tick_count.mod_zero? 10\nend",
"def schedule(&blk)\n @reactor.next_tick(blk)\n end",
"def chronometerWithTemporizer(seconds, to)\n\n last_tick = Time.now\n stop = Time.now + to\n yield\n while Time.now < stop\n sleep 0.1\n if Time.now - last_tick >= seconds\n last_tick += seconds\n yield\n end\n end\n end",
"def make_clock\n @clock = Clock.new()\n @clock.target_framerate = 50\n @clock.calibrate\n @clock.enable_tick_events\n end",
"def cycles_per_100ms(iterations, elapsed_time)\n cycles = (iterations * (MICROSECONDS_PER_100MS / elapsed_time)).to_i\n cycles <= 0 ? 1 : cycles\n end",
"def midi_clock(*a)\n @output.puts(MIDIMessage::SystemRealtime[\"Clock\"].new.to_a)\n end",
"def beat1(r, n)\r\n # shuffle beat\r\n t1,t2,a1,a2 = 0.45,0.25,0.4,0.5\r\n play r,amp: a1; play r+n; sleep t1\r\n play r,amp: a2; play r+n; sleep t2\r\nend",
"def addTicks(ticks)\r\n\t\tappendTicks(ticks)\r\n\t\tsortTicksByTime()\r\n\tend",
"def tick(*action_devices); end",
"def tick\n @life = @life.next_gen\n end",
"def sleep(time)\n dt = @clock + time\n\n due_to_clock = dt<=>@clock\n raise 'Time is out of range' if due_to_clock < 0\n\n @clock = dt\n end",
"def tick\n if waiting?\n receive\n else\n run(@instructions[@ic])\n @ic += 1\n end\n end",
"def time_tick timestamp\n\t @now = timestamp\n\t super\n\tend",
"def play(board)\n 9.times do |variable|\n turn(board)\n end\n end",
"def incrementturn\r\n\t\t @turn +=1\r\n\t\t getturnsleft\r\n\t\t end",
"def system_clock_tick\n @@system_clock_tick ||= LibC::sysconf(LibC::SC_CLK_TCK)\n end",
"def start\n until clock.all? { |val| val == 0 }\n print_clock\n decrement_clock\n end\n end",
"def tick\n toggleClass 'inactive', !TIMEFRAME.cover?(Time.now.hour)\n return if dead? || !TIMEFRAME.cover?(Time.now.hour)\n state, _ = next_state\n\n @messages[Date.today.to_s] ||= {}\n time = Time.now.strftime('%k:%M')\n messages = MESSAGES.select do |message, msg_time|\n msg_time == time\n end\n if !messages.empty? && !@messages[Date.today.to_s][messages.first[1]]\n message, msg_time = messages.first\n @messages[Date.today.to_s][msg_time] = true\n DesktopNotifications.notify message\n end\n\n if idle? && state\n @start_time = Time.now.to_i\n set_state state\n puts \"Next state: #{state}\"\n elsif @start_time\n diff = Time.now.to_i - @start_time.to_i\n end_state if diff.to_i > STATES[@state][:duration].to_i\n else\n if idle? && rand <= 0.001\n DesktopNotifications.notify RANDOM_MESSAGES.sample\n end\n end\n end",
"def execute_anime(n)\n @anime_pos += 1\n @anime_pos = 0 if @anime_pos >= @animation.size\n n.times do\n update_animation(true)\n end\n @anime_pos -= 1\n end",
"def increase_interval\n @interval = if @attempts.zero?\n 1\n elsif @attempts == 1\n 6\n else\n (@interval * @e_factor).to_i\n end\n\n increase_attempts\n end",
"def tick\n return if dead?\n @ticks += 1\n point.x += t(speed_x)\n point.y += t(speed_y)\n @rotation += t(angular_velocity)\n @opacity += t(opacity_delta)\n end",
"def test_120_tasks_every_second_with_ms_task\n min_time = 1\n rl = @testClass.new 120, min_time\n delta = timed_run(rl) { sleep 0.001 }\n # puts \"\\n#{delta} >? #{min_time}\"\n assert((delta / min_time) > TIMING_TOLERANCE)\n end",
"def time\n\twhile(true)\n\t\tsleep(Configuration::Turnduration)\n\t\tOrders.evaluate\n\tend\nend",
"def start_periodic_timers; end",
"def start_periodic_timers; end",
"def to_ticks(sec)\n (sec * INTERVAL).to_i\n end",
"def tick_in_seconds\n return unless VALID_TICKS.include?(tick)\n eval(tick.sub(\" \", \".\"))\n end",
"def tick\n update(:last_checked => last_time)\n end"
] | [
"0.6269858",
"0.6123167",
"0.61206996",
"0.60446733",
"0.6033775",
"0.59440416",
"0.59239256",
"0.5890349",
"0.587527",
"0.5873299",
"0.5855315",
"0.58008254",
"0.5794506",
"0.5703314",
"0.56980896",
"0.56129986",
"0.5578223",
"0.5527699",
"0.55204713",
"0.548684",
"0.5460826",
"0.54528284",
"0.544027",
"0.54397565",
"0.5438372",
"0.5412273",
"0.53808206",
"0.5373701",
"0.5367349",
"0.53668755",
"0.53668755",
"0.53668755",
"0.5346316",
"0.5328648",
"0.5310707",
"0.5251187",
"0.524447",
"0.52098036",
"0.5193311",
"0.5184215",
"0.5178006",
"0.51748645",
"0.5162965",
"0.5150451",
"0.512903",
"0.5127632",
"0.5116785",
"0.5115693",
"0.5087345",
"0.5072307",
"0.50671506",
"0.5064198",
"0.50578505",
"0.50500804",
"0.5041888",
"0.50394183",
"0.5032114",
"0.5029169",
"0.50281435",
"0.50225085",
"0.5017524",
"0.5017524",
"0.5015898",
"0.50097084",
"0.5008854",
"0.49800736",
"0.4977498",
"0.49550584",
"0.49525553",
"0.49241248",
"0.49127635",
"0.4897766",
"0.48954052",
"0.48857045",
"0.48760688",
"0.4868916",
"0.48659936",
"0.48641643",
"0.48484352",
"0.4837741",
"0.48248053",
"0.48070577",
"0.47864723",
"0.47845718",
"0.4780024",
"0.47762188",
"0.4769711",
"0.47645432",
"0.47553295",
"0.47519094",
"0.4743698",
"0.47431687",
"0.47369352",
"0.47349885",
"0.4731505",
"0.4708836",
"0.4708836",
"0.46998537",
"0.46951732",
"0.46906063"
] | 0.6106426 | 3 |
Tick will now increment the second value. | def tick
@second += 1
need_tock?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tick(seconds)\n\t\t@time += seconds\n\tend",
"def tick\n @time = next_time(true)\n end",
"def tick\n\t\tif @sec > 0\n\t\t\t@sec -= 1\n\t\telse\n\t\t\t@sec = 59\n\t\t\tif min > 0\n\t\t\t\t@min -= 1\n\t\t\telse\n\t\t\t\t@min = 59\n\t\t\t\tif @hr > 0\n\t\t\t\t\t@hr -= 1\n\t\t\t\telse\n\t\t\t\t\t@hr = 23\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend",
"def tick_tock\n @hour += 1\n @minute = 0\n @second = 0\n end",
"def tick; end",
"def tick; end",
"def tick; end",
"def tick\n end",
"def register_tick\r\n\t\t\t@accum_fps += 1\r\n @ticks += 1\r\n\t\t\tcurrent_second = Gosu::milliseconds / 1000\r\n\t\t\tif current_second != @current_second\r\n\t\t\t\t@current_second = current_second\r\n\t\t\t\t@fps = @accum_fps\r\n\t\t\t\t@accum_fps = 0\r\n\t\t\tend\r\n\r\n #\r\n # Calculate how many milliseconds passed since last game loop iteration.\r\n #\r\n\t\t\t@milliseconds_since_last_tick = Gosu::milliseconds - @last_value\r\n\t\t\t@last_value = Gosu::milliseconds\r\n\t\t\treturn @milliseconds_since_last_tick\r\n\t\tend",
"def time_tick timestamp\n\t @now = timestamp\n\t super\n\tend",
"def increment_time\n @time = @time + 1\n end",
"def tick\n @life = @life.next_gen\n end",
"def step\t\n\t\t@tick += 1\n\t\t\n\t\tif @tick == @interval\n\t\t\t@block.call\n\t\t\treset\n\t\tend\n\tend",
"def tick\n Kernel.sleep(length) if length > 0\n @count += 1\n end",
"def tick\n 2.times.each do\n sub_components.each(&:tick)\n sub_components.each(&:tock)\n end\n end",
"def advance(seconds:)\n @time += (seconds.to_i * 1_000)\n end",
"def tick dt\n update_balance dt\n flush_output\n end",
"def speed_incr _value\n send_cmd(\"speed_incr #{_value}\")\n end",
"def chronometer(seconds)\n last_tick = Time.now\n yield\n loop do\n sleep 0.1\n if Time.now - last_tick >= seconds\n last_tick += seconds\n yield\n end\n end\n end",
"def update\n if @counter == 30\n self.x += 1\n elsif @counter == 60\n self.x -= 1\n @counter = 0\n end\n @counter += 1\n end",
"def advance_1sec!\n\t\tTimecop.travel(Time.now + 1)\n\tend",
"def increment_time\n @now += 1.minute\n end",
"def advance_one_tick()\n queue_item_intentions\n flush_intentions\n send_notification({}, type: Demiurge::Notifications::TickFinished, location: \"\", zone: \"\", actor: nil)\n flush_notifications\n nil\n end",
"def loop(num_ticks, tick_time)\n @tick_time = tick_time\n \n (0..num_ticks).each do |tick|\n time = java.lang.System.currentTimeMillis\n\n @tick = tick\n yield tick\n\n sleep_time = @tick_time - (java.lang.System.currentTimeMillis - time)\n java.lang.Thread.sleep(sleep_time) if sleep_time > 0\n end\n end",
"def update\n if @counter == 30\n self.x -= 1\n elsif @counter == 60\n self.x += 1\n @counter = 0\n end\n @counter += 1\n end",
"def second\n at(1)\n end",
"def tick()\n\t\t\t\tpassed = Clock.runtime() - @last_tick # how long since the last tick?\n\t\t\t\tif @target_frametime\n\t\t\t\t\treturn Clock.delay(@target_frametime - passed) + passed\n\t\t\t\tend\n\t\t\t\treturn passed\n\t\t\tensure\n\t\t\t\t@last_tick = Clock.runtime()\n\t\t\t\t@ticks += 1\n\t\t\tend",
"def step(time)\n warn %(Timer step must be >= 0, but #{time} was given!) unless time >= 0\n @now += time\n end",
"def tick\n count = @uncounted.sum_then_reset# @uncounted = 0 # uncounted.sumThenReset();\n instantRate = count / FIVE_NANOS;\n if @initialized\n oldRate = @rate\n @rate = oldRate + (@alpha * (instantRate - oldRate))\n else \n @rate = instantRate\n @initialized = true\n end\n self\n end",
"def tick_in_seconds\n return unless VALID_TICKS.include?(tick)\n eval(tick.sub(\" \", \".\"))\n end",
"def second=(value)\n RangeValidator.validate \"DateGroupItem.second\", 0, 59, value\n @second = value\n end",
"def inc(value=1) \n if valid?\n #raise CustomError::InvalidBar unless valid?\n _set(:start_at, Time.now.to_f) unless _get(:start_at)\n _set(:current_at, Time.now.to_f)\n inc_value = _inc(:current,value)\n mylog(\"inc inc_value: #{inc_value}\")\n inc_value\n end \n end",
"def advance_seconds(secs)\n self + secs\n end",
"def increment\n @value += 1\n end",
"def tick\n update(:last_checked => last_time)\n end",
"def on_timer(value=1000)\n Thread.new() {\n begin\n nbtick=(value/TICK)+1\n loop do\n i=0\n sleep(TICK/1000.0) while self.connected?() && (i+=1)<nbtick\n self.connected?() ? yield() : break\n end\n rescue Exception => e\n $stdout.puts \"#{e} :\\n #{e.backtrace.join(\"\\n \")}\"\n end\n }\n end",
"def advance()\n @time = @time + 1\n end",
"def second; 1.second; end",
"def sec() time[2] end",
"def succ!\n @next_run += @interval\n end",
"def clock_sec_succ(seconds)\n check_pre((seconds.clock_sec?))\n ClockSec[seconds.seconds+1]\nend",
"def tick_end_time\n @ref + (@ref_ticks + 1)*@step\n end",
"def tick\n return if dead?\n @ticks += 1\n point.x += t(speed_x)\n point.y += t(speed_y)\n @rotation += t(angular_velocity)\n @opacity += t(opacity_delta)\n end",
"def update\n n = $seconds_per_tick\n @time += n\n\n @ticks_to_update_clock -= 1\n\n if @ticks_to_update_clock == 0\n @ticks_to_update_clock = (60 / $seconds_per_tick).to_i\n @text.text = to_s\n end\n\n if !@time.day? and @old_hour != @time.hour\n @sun_shining_mask.color.opacity = sun_mask_opacity\n @old_hour = @time.hour\n end\n end",
"def incr\n add(1)\n end",
"def incr major, minor\n incr_by major, minor, 1\n end",
"def increment!\n self.times += 1\n self.save\n end",
"def tick\n @tick ||= [\"2714\".hex].pack(\"U*\")\n end",
"def process_second\n @seconds += 1\n assign_nodes\n process_workers\n end",
"def tock\n @minute += 1\n end",
"def tick\n Grid.tick\n head :ok\n end",
"def tick\n defaults\n render\n input\n calc\n end",
"def lazy_sec=(newsec)\n newsec = newsec.to_i\n \n if newsec > 60 or newsec < 0\n mins = (newsec.to_f / 60.0).floor\n newsec -= (mins * 60)\n self.add_mins(mins)\n end\n \n @t_sec = newsec\n end",
"def tick\n if @ticks == @samples\n @ticks = 0\n @current = @samples/(Time.now.to_f - @ref)\n @min = [@current, @min].min\n @max = [@current, @max].max\n @to_s = sprintf(\"%.2f %.2f %.2f\\n\", min, current, max)\n return true\n end\n \n @ref = Time.now.to_f if @ticks == 0\n @ticks += 1\n \n return false\n end",
"def tick(events)\n end",
"def seconds ; return aseconds % SPM ; end",
"def tick(date=nil)\n if date.blank?\n date = Time.now\n else\n date = date.to_time\n end\n date.tick\n end",
"def countdown (x)\n while x > 0\n puts \"#{x} SECOND(S)!\"\n x -= 1\n end\n \"HAPPY NEW YEAR!\"\nend",
"def increment(metric, value = 1)\n @adapter.increment metric, value\n end",
"def tick\n defaults\n render\n calc\n input\n end",
"def update\r\n #\r\n # Register a tick with our rather standard tick/framerate counter. \r\n # Returns the amount of milliseconds since last tick. This number is used in all update()-calls.\r\n # Without this self.fps would return an incorrect value.\r\n # If you override this in your Chingu::Window class, make sure to call super.\r\n #\r\n @milliseconds_since_last_tick = @fps_counter.register_tick\r\n \r\n intermediate_update\r\n end",
"def countdown(x)\n while x > 0 \n puts \"#{x} SECOND(S)!\"\n sleep 1 \n x -= 1 \nend\nreturn \"HAPPY NEW YEAR!\"\nend",
"def sbump(stop_increment)\n new_price = @stop_order.aux_price + stop_increment\n update_stop(new_price)\n end",
"def add_countup(name, seconds, notify_frequency = nil)\n @timers[name] = Timer.new(name, Timer::COUNTUP, seconds, notify_frequency) {|timer| @game_object.notify :timer_tick, timer }\n end",
"def update_interval\n self.interval =\n case repetitions\n when 1 then 1\n when 2 then 6\n else\n (repetitions - 1) * easiness_factor\n end\n end",
"def speedIncrease(value)\n self.speedSet = self.speedGet + value\n end",
"def doubler(start)\n puts start * 2\nend",
"def incr_y(val = 1)\n update(y + val, x)\n apply_pos\n end",
"def sec=(newsec)\n newsec = newsec.to_i\n raise ArgumentError, \"Invalid second: '#{newsec}'.\" if newsec < 0 or newsec > 60\n @t_sec = newsec.to_i\n end",
"def set_value(number)\n @value = offset + (number.to_i - offset) % cycle\n value\n end",
"def after_ticks ticks, &block\n @tick_actions << [ticks.to_i, block, false]\n end",
"def inc_value(iIncrement = 1)\n super\n end",
"def ticks\r\n @fps_counter.ticks\r\n end",
"def update(sample)\n now = Time.new\n elapsed = now - @time\n @sum += sample\n if elapsed > 1.0\n @value = newValue elapsed, @sum/elapsed\n @time = now\n @sum = 0.0\n end\n end",
"def tick!\n unless @next_status.nil?\n @status = @next_status\n @next_status = nil\n return true\n end\n\n false\n end",
"def s_tuples_ts_increment\n 1000.0 / @s_tuples\n end",
"def tick\n defaults\n render\n calc\n process_inputs\n end",
"def tick\n defaults\n render\n calc\n process_inputs\n end",
"def timeCy\n (10).times {|var| puts var}\n end",
"def increment(stats, sample_rate = 1)\n update_counter stats, 1, sample_rate\n end",
"def increment(stats, sample_rate = 1)\n update_counter stats, 1, sample_rate\n end",
"def increment(node)\n change_by node, 1\n end",
"def increment!\n @value += @increment\n \n self\n end",
"def timechunk(sec)\n fail \"sec = #{sec}\" if sec < 1\n 1.send(find_unit(sec)).round\n end",
"def advance_step\n @step += 1\n @scheduling.step\n end",
"def inc_time_slot\n # ex. with 4 bits -> we want range 1..15, \n @lock.synchronize{@current_slot = (@current_slot % @max_slot) + 1}\n end",
"def advance ( delta=0 ) \n @actual += delta\n @current = @actual + offset\n @current_offset = @current.to_i/60 - @actual.to_i/60\n @updated = Time.new\n @update_count += 1\n self\n end",
"def increment(stat, sample_rate=1); count stat, 1, sample_rate end",
"def increment_count(current_count)\n current_count.to_i + 1\n end",
"def secs= value\n\t\t# рассчитанных после того, как он самостоятельно обновил self[:secs] \n\t\tself[:secs] = value # с предоставленным значением\n calc_ave # переопределить метод secs=, чтобы он вызывал calc_ave для обновления средних значений\n\tend",
"def update(ticks = 0)\n# Chipmunk allows you to use a different timestep each frame, but it works much better when you use a fixed timestep.\n# An excellent article on why fixed timesteps for game logic can be found here: http://gafferongames.com/game-physics/fix-your-timestep/\n# cpSpaceStep(space, 1.0f/60.0f);\n @space.step 1.0/60.0\n end",
"def inc(v = 1)\n sync { @v += v }\n end",
"def increment\n @counter = @counter + 1\n end",
"def incr_x(val = 1)\n update(y, x + val)\n apply_pos\n end",
"def chronometerWithTemporizer(seconds, to)\n\n last_tick = Time.now\n stop = Time.now + to\n yield\n while Time.now < stop\n sleep 0.1\n if Time.now - last_tick >= seconds\n last_tick += seconds\n yield\n end\n end\n end",
"def tick event\n raise NotImplementedError, \"Subclass responsibility to implement #tick\"\n end",
"def incr(x) x + 1 end",
"def increment_order!\n @current += 1\n end",
"def increment\n curr_value = counter\n self.counter = curr_value + 1\n save\n curr_value\n end",
"def tick\n\t\t#method does what the superclass method does....\n\t\tsuper\n\t\t\n\t\t#...method also sounds the alarm\t\n\t\tif @hours == @alarm_hours && @mins == @alarm_mins && @secs == @alarm_secs\n\t\t\tthen\n\t\t\tputs \"Beep Beep Beep!\\nThe time is #{@hours}:#{@mins}:#{@secs}\"\n\t\t\t@alarmsound = :ALARM #return ALARM for unit testing\n\t\tend\n\tend"
] | [
"0.74979687",
"0.7196552",
"0.6778341",
"0.6573163",
"0.6482976",
"0.6482976",
"0.6482976",
"0.64382243",
"0.64003307",
"0.63891745",
"0.6322627",
"0.6154744",
"0.613554",
"0.6100395",
"0.60834646",
"0.6011973",
"0.6006825",
"0.5969938",
"0.5934505",
"0.5918612",
"0.5851342",
"0.58176506",
"0.58086723",
"0.5750177",
"0.5729733",
"0.57085216",
"0.569337",
"0.5687256",
"0.56607765",
"0.5653017",
"0.56425005",
"0.56281704",
"0.5614961",
"0.5603209",
"0.55971473",
"0.5565289",
"0.5555197",
"0.5536852",
"0.5520712",
"0.54969853",
"0.5418776",
"0.5408502",
"0.53999805",
"0.53820795",
"0.5353219",
"0.53325915",
"0.5326678",
"0.5314644",
"0.53090966",
"0.5294905",
"0.52805966",
"0.5280231",
"0.5260862",
"0.5260299",
"0.5252266",
"0.52496123",
"0.5247723",
"0.52370304",
"0.5233493",
"0.52220756",
"0.5222058",
"0.52175295",
"0.521697",
"0.5191159",
"0.5187264",
"0.51862454",
"0.51820004",
"0.5180457",
"0.5170819",
"0.51632863",
"0.51617163",
"0.51378804",
"0.5123626",
"0.51190007",
"0.5117979",
"0.51179093",
"0.5103918",
"0.5103918",
"0.5090152",
"0.5085277",
"0.5085277",
"0.5084938",
"0.5082599",
"0.507113",
"0.50684506",
"0.5067814",
"0.5058445",
"0.5057281",
"0.5052219",
"0.5051619",
"0.5050047",
"0.5049203",
"0.50398964",
"0.50314695",
"0.503017",
"0.5030108",
"0.5023267",
"0.5021365",
"0.50171",
"0.50152194"
] | 0.80126786 | 0 |
If the second value == 60, then it will commit a tock | def need_tock?
if @second == 60
@second = 0
tock
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tock\n @minute += 1\n end",
"def cheat\n if @score >= 60 and !@cheating and !@cheating_two\n @cheating = true\n @score -= 60\n end\n end",
"def bust?; value > 21; end",
"def checker\n @hash.each_pair do |key, value|\n @hash[key]=value+1\n if value>=@tresholds\n @hash.delete key\n @on_expire.call key\n end\n end\n end",
"def paycheck(hours_actually_editing, paycheck_total, hourly_charge = 50)\n\t(paycheck_total/hours_actually_editing) > hourly_charge\nend",
"def verify_score(score)\n decimal = (score * 60) % 1\n [decimal, 1 - decimal].min < 0.03\nend",
"def need_tick_tock?\n if @minute == 60\n @minute = 0\n tick_tock\n end\n end",
"def tick\n @second += 1\n need_tock?\n end",
"def test_update_cash\n assert_equal(60, @bakery.update_cash(10))\n end",
"def tick_tock\n @hour += 1\n @minute = 0\n @second = 0\n end",
"def bust_method\n\tif original_total > 21 \n\t\tputs \"You have BUSTED!\"\n\telsif original_total == 21\n\t\tputs \"You got 21!\"\n\telsif original_total < 21 \n\t\tputs \"Hit or Stay?\"\n\tend \nend",
"def busted?(total)\n total > GAME_HIGH\nend",
"def finish\n transaction do\n winner = self.teams.where('score >= ?',5).first\n loser = self.teams.where('score < ?',5).first\n if winner and loser\n winner.win\n loser.lose\n self.status = 'finished'\n self.save\n end\n end\n end",
"def customer_buys_ticket_two()\n @funds -= get_price_of_film()\n sql = \"UPDATE customers SET funds = $1 WHERE id = $2\"\n values = [ @funds, @id ]\n SqlRunner.run(sql, values)\n end",
"def test_cur_sec_greater\n \tassert(@bv.timestap_correct(1, \"123456.1111\", \"123457.1111\"))\n end",
"def calculate_conditions\n if hand_value(@dealer_hand) > 21\n puts \"\\ndealer busts! You WIN!\"\n @user[:balance] += @wager\n puts \"\\nYour new balance is $#{@user[:balance]}\"\n elsif hand_value(@player_hand) == hand_value(@dealer_hand)\n puts \"\\nHand is a push! You get your money back\"\n elsif hand_value(@player_hand) > hand_value(@dealer_hand)\n puts \"\\nYou Win!\"\n @user[:balance] += @wager\n puts \"\\nYour new balance is $#{@user[:balance]}\"\n elsif hand_value(@player_hand) < hand_value(@dealer_hand)\n puts \"HOUSE WINS. Try again\"\n @user[:balance] -= @wager\n puts \"Your new balance is $#{@user[:balance]}\"\n else\n puts \"Something went wrong\"\n end\n end",
"def check_break?(hand_value)\n hand_value > 21 ? true : false\nend",
"def set_time_entry_billing_percent\n data=params\n @time_entry = TneInvoiceTimeEntry.find(data[:id])\n @previous_final_billed_amount = @time_entry.final_billed_amount\n @error=false\n if data[:value].to_i.between?(0,100)\n @time_entry.update_attributes({:billing_percent => data[:value], :billing_method_type => 2})\n @final_billed_amount = @time_entry.calculate_final_billed_amt\n else\n @error=true\n flash[:error]= \"#{t(:tne_billing)}\"\n end\n\n end",
"def can_double_bet\n return 1 unless @bankroll < @bet\n return nil\n end",
"def set_time_entry_actual_bill_rate\n data=params\n @time_entry = TneInvoiceTimeEntry.find(data[:id])\n @previous_final_billed_amount = @time_entry.calculate_final_billed_amt\n override_rate = !data[:value].blank? ? data[:value].to_f.roundf2(2) : 0\n @error=false\n #reg = /^[0-9]+(.[0-9]{1,5})$/\n if (override_rate > 0)\n ActiveRecord::Base.transaction do\n @time_entry.update_attribute(:actual_activity_rate,override_rate)\n @billed_amount = @time_entry.calculate_billed_amount\n @final_billed_amount = @time_entry.calculate_final_billed_amt\n @time_entry.update_attribute(:final_billed_amount,@final_billed_amount)\n end\n else\n @error=true\n flash[:error] = t(:flash_enter_valid_rate)\n end\n end",
"def test_exposure_rating_cannot_be_past_set_limits\n \t@schedule.exposure = 14\n \tassert @schedule.save, \"Saved!\"\n end",
"def cheat_on\n if @score >= 100 and @cheat == false\n @cheat = true\n @score -= 100\n end\n end",
"def spare?\n return false unless roll_two_val\n roll_one_val + roll_two_val == 10\n end",
"def decrement_coin(transaction_coin_value)\n empty = ''\n system_coin_value = @user_coin.value\n if transaction_coin_value.to_i >= system_coin_value\n\n if system_coin_value <= 10\n @user_coin.update(value: system_coin_value, count_status: 'low')\n admin_user = User.find_by(roles: 'Administrator')\n if admin_user.roles == 'Administrator'\n mail = UserMailer.admin_email(admin_user.admin_id, @user_coin.name, @user_coin.value, @user_coin.count_status)\n mail.deliver_now\n # mail.deliver_later!\n end\n return false\n\n end\n elsif system_coin_value > transaction_coin_value.to_i\n coin_bal = system_coin_value - transaction_coin_value.to_i\n\n if coin_bal <= 10\n @user_coin.update(value: coin_bal, count_status: 'low')\n admin_user = User.find_by(roles: 'Administrator')\n if admin_user.roles == 'Administrator'\n mail = UserMailer.admin_email(admin_user.admin_id, @user_coin.name, @user_coin.value, @user_coin.count_status)\n mail.deliver_now\n # mail.deliver_later!\n end\n return false\n \n\n elsif coin_bal > transaction_coin_value.to_i\n decrement_value = system_coin_value.to_i - transaction_coin_value.to_i\n @user_coin.update(value: decrement_value, count_status: 'low')\n return true\n end\n else\n return false\n end\n end",
"def adjust_score(pieces)\n #score increase by 10 + the number pieces removed in a given move\n @score += pieces + 10\n #in timed mode, gain one second per piece removed\n if @time_remaining\n @time_remaining += pieces * TIME_GAIN_PER_PIECE\n end\n \n #find and write the new high score if applicable\n if(@score > @high_score and @time_remaining.nil?)\n @high_score = @score\n end \n if(@score > @timed_high_score and !@time_remaining.nil?)\n @timed_high_score = @score\n end\n\n f = File.open(HIGH_SCORES_FILE, \"w+\")\n f.write(\"#{@high_score},#{@timed_high_score}\")\n f.close\n end",
"def test_for_cheap\r\n if @agent_bargain_limit\r\n @ischeap = true if @price < @agent_bargain_limit\r\n else\r\n @ischeap = true if @price < @cheap\r\n end\r\n end",
"def make_better_change(value, coins)\n\nend",
"def make_better_change(value, coins)\n\nend",
"def make_better_change(value, coins)\n\nend",
"def check_num(num)\n@num_attempts+=1\n\nif num==@secret_num\n@game_over=true\np \"you win\"\nelsif num>=@secret_num\n p \"too big\"\nelse\n p \"too small\"\nend\n\nend",
"def test_if_qualify(current_salary, monthly_payment)\n\tmonthly_salary = current_salary / 12\n\ttimes_greater = monthly_salary / monthly_payment\n\tif times_greater >= 2 \n\t\tanswer = true \n\telse\n\t\tanswer = false \n\tend\n\treturn answer\nend",
"def calculate_amount!\n self.amount = TimeEntry.per_hour * self.time\n #using self to set this as an attribute of the TimeEntry model\n\n\n # if self.amount > 1000\n # false\n # #no 'return false', as this would stop the entire callback from running\n # end\n # true\n end",
"def place_beat(croupier, money, thing, type = \"number\")\n if @money >= money\n @money -= money\n @beats.push croupier.recv_beat(money,type,thing, self)\n return true\n else\n return false\n end\n end",
"def test_execute_threshold(value = 1)\n if value == @threshold\n then return true\n end\n return false\n end",
"def put_money(amount, player)\n if amount > player.money\n amount = player.money\n end\n if amount + player.in_pot_current > self.high_bet # if player is new high bet (bets more than current highest)\n self.high_bet = amount + player.in_pot_current\n self.high_better = player.location\n end\n player.money -= amount # puts money in correct places and takes from player's pot\n player.in_pot_current += amount\n player.in_pot_hand += amount\n self.pot += amount\n player.save\n self.save\n end",
"def game_ending?\n @first_score > 3000 || @second_score > 3000\n end",
"def value_limit\n if self.value < 30\n errors.add(:value, 'cannot be below R$ 50')\n elsif self.value > self.wallet\n errors.add(:value, 'cannot exceed your current wallet')\n elsif !self.value.%(50).zero?\n errors.add(:value, 'must be multiple of 50')\n elsif self.value > 5100\n errors.add(:value, 'cannot exceed R$ 5100')\n end\n end",
"def check5(pmt)\n pmt > 5\nend",
"def adjust_for_happy_hour(preference)\n\n\t\tif($happy_hour and preference.quantity >= 2)\n\t\t\tpreference.price = preference.price/2\n\t\t\tpreference.save\n\t\t\tself.price -= preference.price\n\t\tend\n\n\t\tself.hh_flag = $happy_hour\n\n\t\tself.save\n\tend",
"def valid_init_turn(accumulated_score)\n # if intial turn accumulated_score < 300, scores are not stored\n if @allowed == false && accumulated_score >= 300\n @allowed = true\n puts 'Turn score >= 300. Now your scores will be stored'\n elsif @allowed == false\n accumulated_score = 0\n puts \"Initial turn score < 300. Your scores won't be counted yet\"\n end\n accumulated_score\n end",
"def test_move_less_3_succ\r\n \t@test_prospector.current_silver = 0\r\n \t@test_prospector.current_gold = 0\r\n \t@test_prospector.move_count = 1 \r\n \tassert_equal true, @test_prospector.move?\r\n end",
"def subract_mileage_from_shoe(mileage_of_run)\n\t\tself.mileage_total -= mileage_of_run\n\t\tself.save(:validate => false)\n\tend",
"def test_change_twice\n\t\tm = Miner.new(0)\n\t\tm.change_city(1)\n\t\tm.change_city(2)\n\t\tassert_equal(2,m.current_city)\n\tend",
"def after?(other)\n self.hsec > other.hsec\n end",
"def call_cheat\n if (@score >= 100 and !@cheat)\n @score -= 100\n @cheat = true\n end\n end",
"def need_change_password!\n if self.expire_password_after.is_a? Fixnum or self.expire_password_after.is_a? Float\n need_change_password\n self.save(:validate => false)\n end\n end",
"def sec=(newsec)\n newsec = newsec.to_i\n raise ArgumentError, \"Invalid second: '#{newsec}'.\" if newsec < 0 or newsec > 60\n @t_sec = newsec.to_i\n end",
"def defend(attacking_card)\n min = 15\n min_c = nil\n if attacking_card.suit == @trump_suit\n self.trump_cards.each do |c|\n if c.int_val > attacking_card.int_val &&\n c.int_val < min\n min_c = c\n min = c.int_val\n end\n end\n else\n self.non_trump_cards.each do |c|\n if c.int_val > attacking_card.int_val &&\n c.int_val < min && attacking_card.suit == c.suit\n min_c = c\n min = c.int_val\n end\n end\n end\n @cards.delete(min_c)\n min_c\n end",
"def set_attempts_amount\n max_number <= 10 ? 2 : 10\nend",
"def modify_wallet(bet)\n $wallet -= bet\n if $wallet < 0\n $wallet += bet\n puts \"Oops! Looks like you do not have enough money for that.\".red\n first_spin\n end\n end",
"def tiredness (hours)\n if hours == 'ok'\n @rested += 1\n elsif hours == 'bad'\n @rested -= 1\n elsif hours == 'shit'\n @rested -= 5\n elsif hours == 'amazing'\n @rested += 5\n end\n end",
"def take(values)\n return \"Should have exactly 5 arguments\" unless values.length == 5\n values = values.map(&:to_i)\n new_state = @state.zip(values).map{|x| x[0] - x[1]}\n if new_state.min >= 0\n @state = new_state\n show\n else\n \"Register doesn't have so much money\"\n end\n end",
"def blackjack?; value == 21 && @cards.length == 2; end",
"def set_time_entry_actual_duration\n data=params\n @time_entry = TneInvoiceTimeEntry.find(data[:id])\n @previous_duration = @time_entry.actual_duration\n @previous_final_billed_amount = @time_entry.calculate_final_billed_amt\n @error=true\n ActiveRecord::Base.transaction do\n if data[:value].present?\n @time_entry.start_time = nil\n @time_entry.end_time = nil\n @time_entry.actual_duration = data[:value].to_f.roundf2(2) * 60.0\n @billed_amount = @time_entry.calculate_billed_amount\n @final_billed_amount = @time_entry.calculate_final_billed_amt\n @time_entry.final_billed_amount=@final_billed_amount\n @time_entry.save\n @error=false\n end\n end\n end",
"def time_check thistime=nil\n @sugtime = thistime ? (thistime.to_i*2) : 1\n end",
"def increment_coin(transaction_coin_value)\n system_coin_value = @user_coin.value\n increment_value = system_coin_value.to_i + transaction_coin_value.to_i\n @user_coin.update(value: increment_value)\n if ((system_coin_value > 10) || (system_coin_value > transaction_coin_value.to_i))\n @user_coin.update(count_status: 'high')\n end\n end",
"def take_credits(credits)\r\n if self.credits < credits\r\n false\r\n else\r\n self.credits = self.credits - credits\r\n true\r\n end\r\n end",
"def check\n containAce = false\n i = 0\n sum = 0\n while i < @hand.length\n if 1 == num_to_value(@hand[i])\n containAce = true\n end\n sum += num_to_value(@hand[i])\n i += 1\n end\n\n if containAce\n if sum < 7\n @value = sum + 10\n elsif sum < 11\n @value = sum + 10\n @status = \"finished\"\n elsif 11 == sum\n if 2 == @hand.length \n @value = 50 # 50 means it's BLACKJACK\n @status = \"finished\"\n else\n @value = 21\n @status = \"finished\"\n end\n elsif sum < 17\n @value = sum\n else sum <= 21\n @value = sum\n @status = \"finished\"\n end\n else\n if sum < 17\n @value = sum\n else\n @value = sum\n @status = \"finished\"\n end\n end\n end",
"def test_user_must_enter_value_for_right_ascension\n \t@schedule.right_ascension = nil\n \tassert !@schedule.save, \"Worked? Saved a nil value for right ascension.\"\n end",
"def change_player_stat(player_hash,stat_to_change,amount)\n return 'Error, wrong stat.' if !player_hash.has_key?(stat_to_change)\n return player_hash[stat_to_change] = amount\nend",
"def create_points_order\n @deal = Deal.find(params[:deal_id])\n if current_consumer.total_points >= (@deal.price * 2)\n @order = Order.new\n @order.consumer_id = current_consumer.id\n @order.deal_id = params[:deal_id]\n @order.address = current_consumer.address\n if @order.save\n @consumer.total_points = (@consumer.total_points - (@deal.price.to_i*2))\n @consumer.save #this just returns false, how do i get it to actually save\n if @deal.has_exceeded_threshold?\n @deal.threshold_reached = true\n @deal.save\n end\n redirect_to edit_consumer_order_path(current_consumer, @order)\n else\n flash[:notice] = 'You have already bought a ticket for this raffle!'\n redirect_to :back\n end\n else\n flash[:notice] = 'You do not have enough points!'\n redirect_to :back\n end\n end",
"def could_be_second?(second); end",
"def test_battle_variables\n @battle.coin_toss(1, @karl.llama_atts, @sloth.sloth_atts, @karl.name, @sloth.name)\n @battle.toss_match = false\n assert_equal(@battle.starter, @sloth.sloth_atts)\n end",
"def blue_first(award)\n award.expires_in -= 1\n if award.expires_in >= 0\n award.quality += 1\n elsif award.expires_in < 0\n award.quality += 2\n end\nend",
"def changerEnSuivant #-1=>1=>0>-1\n\t\t@couleur=@couleur%3-1\n\tend",
"def action(type, amount, player)\n @player = Player.find(player.to_i)\n amount = amount.to_i\n case type\n when 'fold'\n @player.in_hand = false\n when 'bet'\n if amount > @player.money\n amount = @player.money\n end\n if amount + @player.in_pot_current < self.high_bet\n p 'invalid bet'\n else\n put_money(amount, @player)\n end\n when 'raise'\n # If player doesn't have enough money or trying to not raise enough and can't bet enough\n if amount > @player.money || (amount + @player.in_pot_current < 2*self.high_bet && 2*self.high_bet - @player.in_pot_current > @player.money)\n amount = @player.money\n elsif amount + @player.in_pot_current < self.high_bet\n amount = 2*self.high_bet - @player.in_pot_current\n else\n amount = amount + self.high_bet - @player.in_pot_current\n end\n put_money(amount, @player)\n when 'check'\n # do nothing; high better already set to be player after dealer inside of deal()\n when 'call'\n amount = self.high_bet - @player.in_pot_current\n put_money(amount, @player)\n else\n p 'invalid action'\n end\n self.current_player = self.get_next_player(@player.location) # Set next player to current\n\n @player.save\n self.save\n if self.high_better == self.current_player #progress round if you've gone back around to the high better\n # unless no one raises and it's back to big blind, bb should be able to go\n if self.high_bet <= self.big_blind && self.round == 0 && self.high_better == get_next_player(get_next_player(self.dealer))\n self.high_better = get_next_player(get_next_player(get_next_player(self.dealer)))\n else\n set_round((self.round + 1))\n deal(self.round)\n end\n end\n if self.players.where(:in_hand => true).length <= 1\n set_round(4)\n end\n\n @player.save\n self.save\n end",
"def lemonade_change(bills)\n hash = {\n 5 => 0,\n 10 => 0,\n 20 => 0\n }\n \n bills.each do |bill|\n hash[bill] += 1\n if bill != 5\n change = bill - 5\n \n until change == 0\n if change >= 20\n if hash[20] > 0\n hash[20] -=1\n change -= 20\n elsif hash[10] > 0\n hash[10] -=1\n change -= 10\n elsif hash[5] > 0\n hash[5] -=1\n change -= 5\n else\n return false\n end\n elsif change >= 10\n if hash[10] > 0\n hash[10] -=1\n change -=10\n elsif hash[5] > 0\n hash[5] -=1\n change -= 5\n else\n return false\n end\n elsif change >= 5\n if hash[5] > 0\n hash[5] -=1\n change -= 5\n else\n return false\n end\n end\n end\n \n end\n end\n true\nend",
"def update_balance dt\n @off_balance_timer.keys.each do |k|\n if @off_balance_timer[k] && (@off_balance_timer[k] -= dt) <= 0\n hear_line \"You have regained #{k.to_s}\"\n @off_balance_timer[k] = nil\n end\n end\n end",
"def check_key2\n while @key2 == @key1\n @key2 = 1 + rand(6)\n end\n end",
"def place_bet(hand)\n if @hands.include?(hand) && @cash - @bet >= 0\n hand.bet = @bet\n @total_bet += hand.bet\n @cash -= @bet\n return true\n else\n return false\n end\n end",
"def isBusted\n\t\tif @value > 21\n\t\t\treturn true\n\t\tend\n\t\treturn false\n\tend",
"def bonus_throw?\n return false unless roll_one_val && roll_two_val\n frame_number == 10 && \n roll_one_val + roll_two_val == 10\n end",
"def can_double?\n\t\treturn (@hand.length == 2 and @balance.balance >= @bet)\n\tend",
"def set_percentage(value)\n return false unless have_lock?\n cur = get_status\n set_status(cur[:message], value)\n end",
"def test_till_increases_when_guest_pays_tab\n @room1.add_drinks_to_stock(@drink2)\n @room1.serve_drink_to_guest(@guest2, @drink2)\n @room1.guest_pays_tab(@guest2)\n assert_equal(1.50, @room1.till())\n end",
"def uberB_fare_calculator(distance, minutes)\n base_fareB = 7\n bTotal = base_fareB + (0.65 * minutes.to_i) + (3.75 * distance.to_i)\n if bTotal < 15\n puts 15\n else\n puts \"The total for an UberBlack is #{bTotal}\"\n end\nend",
"def credit_check(proposed_hours)\n credits >= proposed_hours\n end",
"def need_bet_change\n result = nil\n for player in @players\n if player.bet > player.bankroll and not player.is_dealer\n @io.need_to_change_bet(player)\n result = 1\n end\n end\n return result\n end",
"def you_save\n\t\t(self.market_price > self.selling_price) ? (self.market_price - self.selling_price) : 0\n\tend",
"def update_value(quantity)\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# quantity == crypto value NOT USD\n\t\t# debugger\n\n\t\tif quantity > 0\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# BUY \n\t\t\tself.total_value = self.total_value + quantity\t\t\t# increment wallet value by quantity\n\t\telse \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# SELL\n\t\t\tself.total_value = self.total_value + quantity\t\t\t# quantity is Negative!! so adding, will decrement\n\t\tend\n\n\t\tsave!\n\tend",
"def charge\n self.credits -= 1\n self.save(:validate => false)\n end",
"def lock_float\n respond_to do |format|\n if @dailybank.update(dailybank_params)\n unless @dailybank.cashfloats.count ==2\n @cashfloat = @dailybank.cashfloats.new(float_type: \"Main Till\", period: \"Evening\", completed_by: current_user.name, fifties: 0, twenties: 0, tens: 0, fives: 0, two_pound_single: 0, pound_single: 0, fifty_single: 0, twenty_single: 0, ten_single: 0, five_single: 0, two_single: 0, one_single: 0, float_target: Rdetail.get_value(1, \"till_float_main\"))\n @cashfloat.save\n end\n format.html { redirect_to edit_dailybank_path(@dailybank)}\n format.json { render :show, status: :ok, location: @dailybank }\n else\n format.html { render :edit }\n format.json { render json: @dailybank.errors, status: :unprocessable_entity }\n end\n end\n end",
"def change_time(hike_instance)\n system 'clear'\n puts \"-----MY HIKES-----\"\n hours = @prompt.ask(\"Enter time in hours: \", required: true, convert: :int) {|input| input.in('0-24')}\n minutes = 61\n while minutes > 60 || minutes < 0\n minutes = @prompt.ask(\"Enter time in minutes: \", required: true, convert: :int) {|input| input.in('0-60')}\n end\n hike_instance.time_hiked = (hours * 3600) + (minutes * 60)\n hike_instance.save\n puts \"New time saved.\"\n @prompt.keypress(\"Press any key to continue\")\n end",
"def set_expense_entry_billing_percent\n data=params\n @tne_invoice_expense_entry = TneInvoiceExpenseEntry.find(data[:id])\n @previous_final_billed_amount = @tne_invoice_expense_entry.final_expense_amount\n if data[:value].to_i.between?(0,100)\n @tne_invoice_expense_entry.update_attributes({:billing_percent => data[:value], :billing_method_type => 2})\n @final_expense_amount = @tne_invoice_expense_entry.calculate_final_expense_amount\n else\n @error=true\n flash[:error]= \"#{t(:tne_billing)}\"\n end\n end",
"def reset\n correct = course.responses.correct.interval(self.index_no).since(self.updated_at).size\n incorrect = course.responses.incorrect.interval(self.index_no).since(self.updated_at).size\n \n return false if self.index_no < 2\n \n actual = 100.0 * (incorrect) / (correct + incorrect)\n target = 100.0 - course.accuracy_target\n \n case\n when actual > target\n update_attribute :minutes, ( self.minutes * (target+actual)/(2*actual) ).to_i\n when actual < target\n update_attribute :minutes, ( self.minutes * (3*target-actual)/(2*target) ).to_i\n else\n return false\n end\n end",
"def tired\t\r\n\tif $hours_asleep >= 8 then\r\n\t $hours_asleep = 0\r\n \t\treturn false\r\n \telse\r\n \t\t$hours_asleep += 1\r\n \t\treturn true\r\n \tend \t\t\r\nend",
"def test_mine_sutter_creek\r\n\t@test_prospector.current_location = 'Sutter Creek'\r\n\t@test_prospector.mine\r\n\tassert_operator 2, :>=, @test_prospector.current_gold\r\n\tassert_equal 0, @test_prospector.current_silver\r\n\tassert_operator 2, :>=, @test_prospector.total_gold\r\n\tassert_equal 0, @test_prospector.total_silver\r\n end",
"def lose(val)\n\t\t@wallet.add(-1 * val)\n\tend",
"def adjust_mpg(mpg, mph)\n\tif mph > 60\n\t\ttemp = mph \n\t\ttemp = temp - 60 \n\t\tminus_mpg = temp * 2 \n\t\tnew_mpg = mpg - minus_mpg \n\tend \nend",
"def blackjack?(players_cards_value, computers_cards_value, players_cards_two_value)\n if players_cards_value == 21\n puts 'BlackJack! You Win!'\n play_again\n exit\n elsif players_cards_two_value == 21\n puts 'BlackJack! You Win!'\n play_again\n exit\n elsif computers_cards_value == 21\n puts 'Blackjack! House Wins'\n play_again\n exit\n end\n end",
"def assess_situation(danger_level, save_the_day, bad_excuse)\n\n if danger_level > 50\n puts bad_excuse\n elsif danger_level > 10 && danger_level < 50\n puts save_the_day\n else\n puts \"Meh. Hard pass.\"\n end\nend",
"def provide_mortgage_2?(salary, deposit, property_value)\n loan_amount = property_value - deposit\n property_value >= 650000 ? min_deposit = 0.2 : min_deposit = 0.05 # 20%\n max_multiplier = 5 # how many annual incomes can be borrowed\n deposit >= property_value * min_deposit && \n salary * max_multiplier >= loan_amount\nend",
"def new_rate_must_be_greater_than_minimum\n if self.is_configuration_new_rate?\n errors.add(:new_rate, I18n.t('room_type_channel_mappings.create.message.new_rate_should_be_greater_than_minimum', :minimum => self.room_type.final_minimum_rate)) if\n self.new_rate < self.room_type.final_minimum_rate\n end\n end",
"def check_for_buyout\n if self.is_bought_out\n if self.bought_out_by_team_id\n self.subcontracts.future_years.each do |sub|\n sub.salary_amount *= 0.6\n sub.this_is_a_buyout = true\n sub.save!\n\n # update GM's annual actions to not allow more buyouts\n actions = AnnualGmAction.find_by_team_id_and_year(self.bought_out_by_team_id, current_year)\n actions.has_bought_out = true\n actions.bought_out_player_id = self.player.id\n actions.save!\n end\n end\n end\n end",
"def do_command2\n $game_temp.num_input_start = GameData::MAX_LEVEL\n $game_temp.num_input_variable_id = Yuki::Var::TMP1\n $game_temp.num_input_digits_max = 3\n display_message(ext_text(8997, 27))\n @wanted_data[1] = $game_variables[Yuki::Var::TMP1] if $game_variables[Yuki::Var::TMP1] > 0\n $game_temp.num_input_start = GameData::MAX_LEVEL\n $game_temp.num_input_variable_id = Yuki::Var::TMP1\n $game_temp.num_input_digits_max = 3\n display_message(ext_text(8997, 28))\n @wanted_data[2] = $game_variables[Yuki::Var::TMP1] if $game_variables[Yuki::Var::TMP1] >= @wanted_data[1]\n end",
"def set_turn\n if @turn == :player && @cpu_hand.cards.any? { |c| @total + c.value <= 31 }\n @engine.delay_update 0.5\n @turn = :cpu\n elsif @turn == :cpu && @player_hand.cards.any? { |c| @total + c.value <= 31 }\n @turn = :player\n else\n check_all_cards\n end\n end",
"def evaluate right_amt, wrong_amt\n percent = self.get_current right_amt, wrong_amt\n\n self.threshold.to_f <= percent\n end",
"def strike?\n roll_one_val && roll_one_val == 10\n end",
"def assess_situation(danger_level, save_the_day, bad_excuse)\n if danger_level >= 50\n puts bad_excuse\n elsif danger_level >= 10 && danger_level < 50\n puts save_the_day\n else\n puts \"Meh. Hard pass.\"\n end\nend",
"def higher_then_amount\n if self.amount > 20\n errors.add(:amount, \"Zakup jednorazowy ograniczono do 20.\") \n end\n end"
] | [
"0.6006742",
"0.589643",
"0.5762616",
"0.5616108",
"0.55299366",
"0.54519296",
"0.54220545",
"0.53642106",
"0.5345481",
"0.5308886",
"0.53062266",
"0.53051746",
"0.52411973",
"0.5233876",
"0.52265996",
"0.52211547",
"0.5210867",
"0.5197313",
"0.51950043",
"0.51905304",
"0.5189721",
"0.5184325",
"0.5173256",
"0.515336",
"0.5147228",
"0.5142752",
"0.5136494",
"0.5136494",
"0.5136494",
"0.51246405",
"0.5112934",
"0.5111332",
"0.51070285",
"0.5093585",
"0.50834024",
"0.50804484",
"0.5078494",
"0.5046053",
"0.5043367",
"0.5042071",
"0.50266385",
"0.50258607",
"0.5013276",
"0.50073373",
"0.500461",
"0.49918592",
"0.4979685",
"0.49762842",
"0.49740854",
"0.49723053",
"0.4968531",
"0.49650955",
"0.4962402",
"0.4962039",
"0.4959302",
"0.49552262",
"0.49400353",
"0.4937597",
"0.49245173",
"0.49219626",
"0.49144796",
"0.49126428",
"0.490977",
"0.4906138",
"0.4903652",
"0.4903196",
"0.49028248",
"0.49019042",
"0.49015343",
"0.489397",
"0.48918557",
"0.48842472",
"0.4880429",
"0.48803198",
"0.48797908",
"0.48797265",
"0.48727813",
"0.4867376",
"0.48627973",
"0.4862438",
"0.4862265",
"0.48607662",
"0.4856599",
"0.48544526",
"0.4854441",
"0.48507664",
"0.4850322",
"0.4845544",
"0.48447248",
"0.48384985",
"0.4832675",
"0.48299745",
"0.48249748",
"0.48224708",
"0.48203027",
"0.4818103",
"0.48161724",
"0.48144388",
"0.48139763",
"0.4812328"
] | 0.6561541 | 0 |
Increments the minute value. | def tock
@minute += 1
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def increment_time\n @now += 1.minute\n end",
"def advance_minutes(mins)\n self + (mins * 60)\n end",
"def minute\n set_function_and_argument(:minute, nil)\n end",
"def minute=(value)\n RangeValidator.validate \"DateGroupItem.minute\", 0, 59, value\n @minute = value\n end",
"def increment_time\n @time = @time + 1\n end",
"def min=(newmin)\n newmin = newmin.to_i\n raise ArgumentError, \"Invalid minute: '#{newmin}'.\" if newmin < 0 or newmin > 60\n @t_min = newmin\n end",
"def add_minutes(minutes)\n new_minutes = @minute + minutes\n hours_to_add = (@minute + minutes) / 60\n new_hour = @hour + hours_to_add\n\n @hour = new_hour % HOURS_ONE_DAY\n @minute = new_minutes % ONE_HOUR_IN_MINUTES\n\n self\n end",
"def addMin(min)\n addSec(min * 60) ;\n end",
"def beginning_of_minute\n change(sec: 0)\n end",
"def beginning_of_minute\n change(sec: 0)\n end",
"def add_mins(mins = 1)\n mins = mins.to_i\n cur_mins = @t_min\n next_min = cur_mins + mins\n \n if next_min >= 60\n @t_min = 0\n self.add_hours(1)\n mins_left = (mins - 1) - (60 - cur_mins)\n self.add_mins(mins_left) if mins_left > 0\n elsif next_min < 0\n @t_min = 59\n self.add_hours(-1)\n mins_left = mins + cur_mins + 1\n self.add_mins(mins_left) if mins_left > 0\n else\n @t_min = next_min\n end\n \n return self\n end",
"def minutes() 60 * seconds end",
"def +(minutes)\n @hours += minutes / 60\n @minutes += minutes % 60\n self # Return a reference to the Clock class to allow for method chaining\n end",
"def with_minute(minute)\n LocalTime.of(@hour, minute, @second, @millis)\n end",
"def minutes ; self * 60 ; end",
"def lazy_min=(newmin)\n newmin = newmin.to_f\n \n #Add hours for every 60 minutes given.\n if newmin > 60 or newmin < 0\n hours = (newmin.to_f / 60.0).floor\n newmin -= (hours.to_f * 60.0)\n self.add_hours(hours)\n end\n \n #Convert any decimals to setting the second.\n diff = newmin - newmin.floor\n self.lazy_sec = diff * 60 if diff > 0.0\n \n #Set the actual minute.\n @t_min = newmin.floor\n \n self\n end",
"def minutes; self * MINUTE; end",
"def minutes; self * MINUTE; end",
"def minute\n @minute\n end",
"def advance(seconds:)\n @time += (seconds.to_i * 1_000)\n end",
"def increase_baked_minutes(minutes)\n $baked_minutes = $baked_minutes + minutes\n end",
"def increment!\n @value += @increment\n \n self\n end",
"def end_of_minute\n change(sec: 59.999)\n end",
"def getminute()\n\t\treturn @min\n\tend",
"def increment(metric, value = 1)\n @adapter.increment metric, value\n end",
"def advance_seconds(secs)\n self + secs\n end",
"def update\n if @counter == 30\n self.x += 1\n elsif @counter == 60\n self.x -= 1\n @counter = 0\n end\n @counter += 1\n end",
"def end_of_minute\n change(\n sec: 59,\n usec: Rational(999999999, 1000)\n )\n end",
"def step(time)\n warn %(Timer step must be >= 0, but #{time} was given!) unless time >= 0\n @now += time\n end",
"def test_minute_set\n clock = Clock.new 0, -1\n alarm = AlarmClock.new 0, -1\n puts 'Wrong hour set' if clock.get_minute != 0\n puts 'Wrong hour set' if alarm.get_alarm_minute != 0\n clock.set_time 26, 0\n alarm.set_alarm 26, 0\n puts 'Wrong hour set' if clock.get_minute != 23\n puts 'Wrong hour set' if alarm.get_alarm_minute != 23\n end",
"def metric_increment(metric_name)\n metric.increment(metric_name)\n end",
"def minute\n self.to_duration.to_units(:hour, :minute, :second).fetch(:minute)\n end",
"def succ\n next_hour = Hour.new(\"12 AM\")\n\n next_time = (@hour + 1) % 24\n next_hour.instance_eval { @hour = next_time }\n #puts \" succ called: next_hour is #{next_hour}, #{@hour}, #{next_time}\"\n next_hour\n end",
"def passcode_minutes_of_inactivity_before_lock=(value)\n @passcode_minutes_of_inactivity_before_lock = value\n end",
"def minute(padded = false)\n min = (seconds_since_start_of_hour / M_SECS).to_i\n if padded && min < 10\n min = \"0#{min}\"\n end\n min\n end",
"def tick\n\t\tif @sec > 0\n\t\t\t@sec -= 1\n\t\telse\n\t\t\t@sec = 59\n\t\t\tif min > 0\n\t\t\t\t@min -= 1\n\t\t\telse\n\t\t\t\t@min = 59\n\t\t\t\tif @hr > 0\n\t\t\t\t\t@hr -= 1\n\t\t\t\telse\n\t\t\t\t\t@hr = 23\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend",
"def setMinutes(minutes)\r\n\t\t\t\t\t@minutes = minutes\r\n\t\t\t\tend",
"def minutes\n self * SECONDS_IN_MINUTES\n end",
"def password_minutes_of_inactivity_before_lock=(value)\n @password_minutes_of_inactivity_before_lock = value\n end",
"def password_minutes_of_inactivity_before_lock=(value)\n @password_minutes_of_inactivity_before_lock = value\n end",
"def update\n if @counter == 30\n self.x -= 1\n elsif @counter == 60\n self.x += 1\n @counter = 0\n end\n @counter += 1\n end",
"def advance()\n @time = @time + 1\n end",
"def minute\n if self.in_play?\n return self.round.minute\n else\n if self.finished?\n return MINUTES\n else\n return 0\n end\n end\n end",
"def increment\n @value += 1\n end",
"def *(value)\n if value.is_a?(self.class)\n self.class.new(@minutes * value.to_i)\n else\n self.class.new(@minutes * check_arguments(value))\n end\n end",
"def lazy_sec=(newsec)\n newsec = newsec.to_i\n \n if newsec > 60 or newsec < 0\n mins = (newsec.to_f / 60.0).floor\n newsec -= (mins * 60)\n self.add_mins(mins)\n end\n \n @t_sec = newsec\n end",
"def time_to_minute(time)\n time.seconds_since_midnight / 60\n end",
"def inc(value=1) \n if valid?\n #raise CustomError::InvalidBar unless valid?\n _set(:start_at, Time.now.to_f) unless _get(:start_at)\n _set(:current_at, Time.now.to_f)\n inc_value = _inc(:current,value)\n mylog(\"inc inc_value: #{inc_value}\")\n inc_value\n end \n end",
"def tick_tock\n @hour += 1\n @minute = 0\n @second = 0\n end",
"def increment!\n self.times += 1\n self.save\n end",
"def set_minutes_minute\n @minutes_minute = Minutes::Minute.includes(items: [motions: [:mover]]).find(params[:id])\n end",
"def minute(date)\n time = [pad(date.hour.to_s), pad(date.minute.to_s)].join(':')\n [time, day(date)].join(' ')\n end",
"def minutes\n (@seconds.abs / 60) % 60 * (@seconds < 0 ? -1 : 1)\n end",
"def minutes\n self.to_i * 60\n end",
"def minute_b4_midnight(start,duration)\n start -= start.hour * HOUR\n start -= start.min * MINUTE\n duration += @values[start.wday].minutes(23,59,23,59)\n start = start.next_day - MINUTE\n return start,duration\n end",
"def tick(seconds)\n\t\t@time += seconds\n\tend",
"def increment\n self.class.increment(self)\n end",
"def incr\n add(1)\n end",
"def minutes\n (seconds % 3600) / 60\n end",
"def speed_incr _value\n send_cmd(\"speed_incr #{_value}\")\n end",
"def incr major, minor\n incr_by major, minor, 1\n end",
"def succ!\n @next_run += @interval\n end",
"def next_time (from=Time.now)\n\n @cron_line.next_time(from)\n end",
"def minutes ; Duration[self * 60] ; end",
"def add_secs(secs = 1)\n secs = secs.to_i\n cur_secs = @t_sec\n next_sec = cur_secs + secs\n \n if next_sec >= 60 or next_sec <= -60\n mins = (next_sec.to_f / 60.0).floor\n @t_sec = next_sec - (mins * 60)\n self.add_mins(mins)\n else\n @t_sec = next_sec\n end\n \n return self\n end",
"def to_minutes; Rational === @val ? @val/60 : @val/60.0 end",
"def minute_timestamp_from_producer_clock\n t=Time.now\n t.strftime(\"%Y%j%H%M\").to_i\n end",
"def inc_value(iIncrement = 1)\n super\n end",
"def increment(amount = 1)\n self[:start_time] ||= Time.now\n self[:current] = (self[:current] + amount < self[:max] ? self[:current] + amount : self[:max])\n self.save\n self[:previous_time] ||= Time.now\n end",
"def minutes(num)\n t = current_time + num * SECONDS_IN_MINUTE\n {\n type: :datetime,\n value: t.iso8601\n }\n end",
"def advance_hours(hours)\n self + (hours * 60 * 60)\n end",
"def set_time(hr, min)\n time = self.current_time.split(\":\")\n time[0] = hr\n time[1] = min\n self.current_time = time.join(\":\")\n end",
"def setTime(hour, min, sec)\n setSec(sec) ;\n addMin(min) ;\n addHour(hour) ;\n end",
"def minutes\n\t\treturn self * 60\n\tend",
"def minutes\n\t\treturn self * 60\n\tend",
"def round_minutes(minutes)\n if minutes >= 60\n # Division will provide the number of hours\n @hour += (minutes / 60).floor\n # Mod will provide the number of minutes\n # TODO: Will this work?\n round_minutes(minutes % 60)\n else\n minutes\n end\n end",
"def minutes\n value_parts[1]\n end",
"def minutes\n value_parts[1]\n end",
"def increment_turn\n @players.rotate!\n end",
"def addHour(hour)\n addMin(hour * 60) ;\n end",
"def increment(node)\n change_by node, 1\n end",
"def advance ( delta=0 ) \n @actual += delta\n @current = @actual + offset\n @current_offset = @current.to_i/60 - @actual.to_i/60\n @updated = Time.new\n @update_count += 1\n self\n end",
"def incr(key, value = 1)\n mon_synchronize do\n perform [\"incr\", key, value], :proc => T_INT\n end\n end",
"def could_be_minute?(minute); end",
"def clicks_by_minute(input)\n get_method(:clicks_by_minute, input)\n end",
"def increment(start, inc)\n\t\t\t\tProc.new{start +=inc}\nend",
"def start_clock\n condition = true\n while condition do\n puts \"current time : #{@hour.to_s.rjust(2, \"0\")}:#{@min.to_s.rjust(2, \"0\")}:#{@sec.to_s.rjust(2, \"0\")}\"\n sleep 1.0\n\n increment_sec\n\n check_alarm\n end\n end",
"def apply_function_minute(scope, ast)\n scope, timestamp = apply_ast(scope, ast.children.first)\n return scope, \"(date_part('minute', #{timestamp})::integer)\"\n end",
"def seconds_in_minutes(num_min)\n\tnum_min * 60\nend",
"def incr(key, value = 1)\n mon_synchronize do\n perform [\"incr\", key, value], proc: T_INT\n end\n end",
"def increment_counter!\n # Increment the counter\n sql(:execute, %(\n INSERT INTO knifeswitch_counters (name,counter)\n VALUES (?, 1)\n ON DUPLICATE KEY UPDATE counter=counter+1\n ), namespace)\n\n # Possibly open the circuit\n sql(\n :execute,\n %(\n UPDATE knifeswitch_counters\n SET closetime = ?\n WHERE name = ? AND COUNTER >= ?\n ),\n DateTime.now + error_timeout.seconds,\n namespace, error_threshold\n )\n end",
"def chronometer(seconds)\n last_tick = Time.now\n yield\n loop do\n sleep 0.1\n if Time.now - last_tick >= seconds\n last_tick += seconds\n yield\n end\n end\n end",
"def format_minute(minute)\n first, second = minute.divmod(10)\n first_digit_arr = @@number_strs[first]\n second_digit_arr = @@number_strs[second]\n [\n first_digit_arr[0] + second_digit_arr[0],\n first_digit_arr[1] + second_digit_arr[1],\n first_digit_arr[2] + second_digit_arr[2]\n ]\n end",
"def minutes\n _nudge[1]\n end",
"def to_i\n hour * 60 + minute\n end",
"def increment_duration(&block)\n start = Process.clock_gettime(Process::CLOCK_MONOTONIC)\n yield\n ensure\n finish = Process.clock_gettime(Process::CLOCK_MONOTONIC)\n increment(finish - start)\n end",
"def countdown_display_before_restart_in_minutes=(value)\n @countdown_display_before_restart_in_minutes = value\n end",
"def increment(stat, value)\n\t\tcurrent = instance_variable_get(\"@#{stat}\") || 0\n\t\tinstance_variable_set(\"@#{stat}\", current + value)\n\tend",
"def increment\n @counter = @counter + 1\n end",
"def validate_minute(spec)\n validate_numeric(spec, 0, 59)\n end"
] | [
"0.7205509",
"0.71260184",
"0.6601368",
"0.65721387",
"0.65227187",
"0.63068146",
"0.6264998",
"0.625215",
"0.623022",
"0.623022",
"0.6229087",
"0.60351825",
"0.5974196",
"0.59446204",
"0.59301054",
"0.5906068",
"0.5895508",
"0.5895508",
"0.5892949",
"0.5737203",
"0.57295823",
"0.5698169",
"0.56758314",
"0.560794",
"0.55998343",
"0.55962807",
"0.55928665",
"0.5578698",
"0.55762404",
"0.55656886",
"0.5556533",
"0.5516188",
"0.5478566",
"0.54547733",
"0.5439249",
"0.5412263",
"0.5401811",
"0.5392568",
"0.53575844",
"0.53575844",
"0.5345023",
"0.533913",
"0.5322841",
"0.53222865",
"0.5307196",
"0.53001785",
"0.5285914",
"0.5284564",
"0.5279775",
"0.5259828",
"0.5258991",
"0.5246708",
"0.524187",
"0.52340895",
"0.52282584",
"0.52226645",
"0.52171826",
"0.52158904",
"0.5183039",
"0.5177057",
"0.51717794",
"0.5155199",
"0.513399",
"0.51301736",
"0.51293826",
"0.51197547",
"0.511527",
"0.5105394",
"0.50930005",
"0.5085557",
"0.50829095",
"0.50721616",
"0.5066684",
"0.5056249",
"0.5056249",
"0.5052598",
"0.5044973",
"0.5044973",
"0.5037409",
"0.5036739",
"0.5032352",
"0.50298995",
"0.5009382",
"0.50082093",
"0.49940816",
"0.49935463",
"0.49577832",
"0.4956671",
"0.49444023",
"0.49374267",
"0.49272275",
"0.49168178",
"0.4916792",
"0.49132878",
"0.49062344",
"0.4899485",
"0.48924816",
"0.48898712",
"0.4886696",
"0.4880845"
] | 0.6712835 | 2 |
If minute value == 60, then it will commit a ticktock | def need_tick_tock?
if @minute == 60
@minute = 0
tick_tock
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tock\n @minute += 1\n end",
"def tick_tock\n @hour += 1\n @minute = 0\n @second = 0\n end",
"def need_tock?\n if @second == 60\n @second = 0\n tock\n end\n end",
"def tick\n\t\tif @sec > 0\n\t\t\t@sec -= 1\n\t\telse\n\t\t\t@sec = 59\n\t\t\tif min > 0\n\t\t\t\t@min -= 1\n\t\t\telse\n\t\t\t\t@min = 59\n\t\t\t\tif @hr > 0\n\t\t\t\t\t@hr -= 1\n\t\t\t\telse\n\t\t\t\t\t@hr = 23\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend",
"def could_be_minute?(minute); end",
"def tick\n @second += 1\n need_tock?\n end",
"def test_tick\n\t\t@reverseclock.tick\n\t\t#test that the hours, mins and secs values are as they should be after tick is invoked\n\t\tassert_equal(@reverseclock.hours, 23, 'tick not operating correctly')\n\t\tassert_equal(@reverseclock.mins, 59, 'tick not operating correctly')\n\t\tassert_equal(@reverseclock.secs, 59, 'tick not operating correctly')\n\t\t#As before, not sure if i need to test whether the hours, mins and secs are within the appropriate bounds as have tested them already above\n\t\t#leaving it in anyway but probably don't need it.\n\t\tassert(@reverseclock.hours >= 0 && @reverseclock.hours <= 23, 'reverse clock hours value out of bounds')\n\t\tassert(@reverseclock.mins >= 0 && @reverseclock.mins <= 59, 'reverse clock minutes value out of bounds')\n\t\tassert(@reverseclock.mins >= 0 && @reverseclock.mins <= 59, 'reverse clock seconds value out of bounds')\n\tend",
"def minutely(options = {})\n branch options.merge(every: :minute)\n end",
"def minutely(options = {})\n branch options.merge(every: :minute)\n end",
"def end_of_minute\n change(sec: 59.999)\n end",
"def tempo(beats_per_second)\n\t\tbeats_per_minute = beats_per_second * 60 \n\tend",
"def test_minute_set\n clock = Clock.new 0, -1\n alarm = AlarmClock.new 0, -1\n puts 'Wrong hour set' if clock.get_minute != 0\n puts 'Wrong hour set' if alarm.get_alarm_minute != 0\n clock.set_time 26, 0\n alarm.set_alarm 26, 0\n puts 'Wrong hour set' if clock.get_minute != 23\n puts 'Wrong hour set' if alarm.get_alarm_minute != 23\n end",
"def tick\n update(:last_checked => last_time)\n end",
"def minute\n set_function_and_argument(:minute, nil)\n end",
"def tick\n @time = next_time(true)\n end",
"def tick; end",
"def tick; end",
"def tick; end",
"def tick\n end",
"def chronometer(seconds)\n last_tick = Time.now\n yield\n loop do\n sleep 0.1\n if Time.now - last_tick >= seconds\n last_tick += seconds\n yield\n end\n end\n end",
"def tick(seconds)\n\t\t@time += seconds\n\tend",
"def min=(newmin)\n newmin = newmin.to_i\n raise ArgumentError, \"Invalid minute: '#{newmin}'.\" if newmin < 0 or newmin > 60\n @t_min = newmin\n end",
"def check_cron(threshold = 10.minutes)\n last_snapshot = BitcoinStatsSnapshot.last\n seconds_since_last_snapshot = DateTime.now.to_i - last_snapshot.created_at.to_i\n return 'NOCRON' if seconds_since_last_snapshot > threshold\n 'OK'\n end",
"def in_t60(t60)\n 1.0 - (0.001 ** (1.0 / t60 / mus_srate))\n end",
"def validate_minute(spec)\n validate_numeric(spec, 0, 59)\n end",
"def end_of_minute\n change(\n sec: 59,\n usec: Rational(999999999, 1000)\n )\n end",
"def change_time(hike_instance)\n system 'clear'\n puts \"-----MY HIKES-----\"\n hours = @prompt.ask(\"Enter time in hours: \", required: true, convert: :int) {|input| input.in('0-24')}\n minutes = 61\n while minutes > 60 || minutes < 0\n minutes = @prompt.ask(\"Enter time in minutes: \", required: true, convert: :int) {|input| input.in('0-60')}\n end\n hike_instance.time_hiked = (hours * 3600) + (minutes * 60)\n hike_instance.save\n puts \"New time saved.\"\n @prompt.keypress(\"Press any key to continue\")\n end",
"def tick\n Grid.tick\n head :ok\n end",
"def tick dt\n update_balance dt\n flush_output\n end",
"def chronometerWithTemporizer(seconds, to)\n\n last_tick = Time.now\n stop = Time.now + to\n yield\n while Time.now < stop\n sleep 0.1\n if Time.now - last_tick >= seconds\n last_tick += seconds\n yield\n end\n end\n end",
"def game_played?\n minutes > 0\n end",
"def minute=(value)\n RangeValidator.validate \"DateGroupItem.minute\", 0, 59, value\n @minute = value\n end",
"def scheduled_update(time_elapsed)\n @motion.closed! if time_elapsed >= 48.hours\n end",
"def minutes() 60 * seconds end",
"def at_tick_interval(num_of_ticks)\n yield if sensors.ticks % num_of_ticks == 0\n end",
"def place_beat(croupier, money, thing, type = \"number\")\n if @money >= money\n @money -= money\n @beats.push croupier.recv_beat(money,type,thing, self)\n return true\n else\n return false\n end\n end",
"def start_clock\n condition = true\n while condition do\n puts \"current time : #{@hour.to_s.rjust(2, \"0\")}:#{@min.to_s.rjust(2, \"0\")}:#{@sec.to_s.rjust(2, \"0\")}\"\n sleep 1.0\n\n increment_sec\n\n check_alarm\n end\n end",
"def clicks_by_minute(input)\n get_method(:clicks_by_minute, input)\n end",
"def minutes?\n @name == :minutely\n end",
"def meter_maid_check\n if minutes_remaining < 0\n fine = minutes_remaining * -3\n \"Bummer! You got a $#{fine} ticket.\"\n else\n 'The meter maid came and went.'\n end\n end",
"def increment_time\n @now += 1.minute\n end",
"def scheduled_update(time_elapsed)\n if time_elapsed >= 48.hours\n @motion.voting!\n elsif !@motion.objected? && time_elapsed >= 24.hours\n @motion.voting!\n end\n end",
"def time_tick timestamp\n\t @now = timestamp\n\t super\n\tend",
"def after_ticks ticks, &block\n @tick_actions << [ticks.to_i, block, false]\n end",
"def check(time)\n self.checked = Time.at(time)\n end",
"def time_check thistime=nil\n @sugtime = thistime ? (thistime.to_i*2) : 1\n end",
"def clicks_by_minute(input)\n get_method(:clicks_by_minute, input)\n end",
"def check_close_data_presence(meeting)\n return if meeting.closed_at.present? || !minutes_data?(meeting)\n\n meeting.closed_at = Time.current\nend",
"def bake(minutes)\n \"Baking the cookie in #{minutes} mins.\"\n end",
"def minute_ago?\n if (@started < (Time.now - 60))\n @started = Time.now \n true\n else\n false\n end\n end",
"def tick\n\t\t#method does what the superclass method does....\n\t\tsuper\n\t\t\n\t\t#...method also sounds the alarm\t\n\t\tif @hours == @alarm_hours && @mins == @alarm_mins && @secs == @alarm_secs\n\t\t\tthen\n\t\t\tputs \"Beep Beep Beep!\\nThe time is #{@hours}:#{@mins}:#{@secs}\"\n\t\t\t@alarmsound = :ALARM #return ALARM for unit testing\n\t\tend\n\tend",
"def test_scm_st_012\n printf \"\\n Test 012\"\n open_periodical_analysis_setting_tab\n assert is_text_present($display_scm[\"interval_field\"])\n assert is_text_present($display_scm[\"interval_rule\"])\n assert is_element_present($display_scm_xpath[\"interval_field\"])\n assert_equal \"*/30 * * * *\",get_value($display_scm_xpath[\"interval_field\"])\n logout\n end",
"def minute_cell(half_hour)\n content_tag :td, :class => \"day_min_cell\" do\n if (half_hour%2 == 0)\n '00'\n else\n '30'\n end\n end\n end",
"def beats_per_minute\n return DEFAULT_TEMPO if @tracks.nil? || @tracks.empty?\n event = @tracks.first.events.detect { |e| e.kind_of?(MIDI::Tempo) }\n return event ? (Tempo.mpq_to_bpm(event.tempo)) : DEFAULT_TEMPO\n end",
"def set_idle_threshold!(time)\n time = time.to_i\n\n if time != 0 && time < 10\n raise ArgumentError, \"time must be >= 10 minutes\"\n end\n\n if time % 5 != 0\n raise ArgumentError, \"time must be in 5 minute increments\"\n end\n\n !!self.send!(\"+XT:3013,#{time}\")\n end",
"def timer_checkpoints\n t = self.time_remaining\n if @timer_checkpoint_hash[30] < 3 && t <= 40\n @timer_checkpoint_hash[30] += 1\n tab; \"#{@time_remaining} seconds left.\\n\".typing\n elsif @timer_checkpoint_hash[120] == 0 && t.between?(60, 140)\n @timer_checkpoint_hash[120] += 1\n tab; \"Cutting it close, #{codename}\".typing\n elsif @timer_checkpoint_hash[180] == 0 && t.between?(140, 180)\n @timer_checkpoint_hash[180] += 1\n tab; \"3 minutes. Finish the job.\\n\".typing\n elsif @timer_checkpoint_hash[240] == 0 && t.between?(200, 240)\n @timer_checkpoint_hash[240] += 1\n tab; \"Doing good. 4 minutes left.\\n\".typing\n end\n end",
"def check?\n @last_time < @check_time - 100\n end",
"def tick(date=nil)\n if date.blank?\n date = Time.now\n else\n date = date.to_time\n end\n date.tick\n end",
"def executes_at?(time)\n run_every_minute? ||\n run_this_minute_every_hour?(time) ||\n run_every_minute_this_hour?(time) ||\n run_this_minute_this_hour?(time)\n end",
"def one_billion_second bday\n one_bil_sec = bday + 1 * 10 ** 9\n if Time.new > one_bil_sec\n puts \"When you have turned one billion seconds old: #{one_bil_sec}\"\n else\n puts \"When you will turn one billion seconds old: #{one_bil_sec}\"\n end\nend",
"def ==(other)\n self.hour == other.hour && self.minute == other.minute\n end",
"def before_midnight(time)\n total_minutes = after_midnight(time)\n total_minutes == 0 ? 0 : 1440 - total_minutes\nend",
"def checkin!(time = Time.now)\n self.update_attribute(:check_in_time, time)\n end",
"def clock?\n true\n end",
"def water_status(minutes)\n if minutes < 7\n puts \"The water is not boiling yet.\"\n elsif minutes == 7\n puts \"It's just barely boiling\"\n elsif minutes == 8 \n puts \"It's boiling!\"\n else\n puts \"Hot! Hot! Hot!\"\n end\nend",
"def on_timer_timeout\n #puts \"#on_timer_minute #{@timer_minute} #{@timer_minute_limit}\"\n @timer_minute += 1\n if @timer_minute > @timer_minute_limit\n change_wallpaper\n\n # Restart timer\n reset_timer_minute\n end\n end",
"def water_status(minutes)\n if minutes < 7\n puts \"The water is not boiling yet.\"\n elsif minutes == 7\n puts \"It's just barely boiling\"\n elsif minutes == 8\n puts \"It's boiling!\"\n else\n puts \"Hot! Hot! Hot!\"\n end\nend",
"def add_check(check)\n min = config[:min_interval]\n check[:interval] = min if check[:interval] < min\n EM.add_periodic_timer(check[:interval]) do\n self.send(\"#{@os}_ping\", check)\n end\n end",
"def time_interval(inter_val_num=15)\n\n require 'rubygems'\n require 'active_support'\n require 'active_support/time'\n\n cur_time = Time.now\n comp_time = cur_time - cur_time.sec - cur_time.min%15*60\n base_time = comp_time + 1.hour\n\n if comp_time < base_time\n comp_time = comp_time + inter_val_num.minutes\n end\n\n return comp_time.strftime(\"%M:%S\")\n\nend",
"def once_per_hour &block\n\tcurrent_hour = Time.now.hour\n\n\tblock.call\n\t\nend",
"def mark_time\n @time ||= SCORE.time || \"4/4\"\n \"\\t\\\\time #{@time}\" # warning: pas de guillemets\n end",
"def work(interval = 5.0)\n end",
"def every_ticks ticks, &block\n @tick_actions << [ticks.to_i, block, ticks.to_i]\n end",
"def end_of_hour\n change(min: 59, sec: 59.999)\n end",
"def update\r\n return if $BTEST\r\n @time = $game_variables[LTS::TIME_VARIABLE_ID]\r\n if @time >= 1440\r\n @time %= 1440\r\n end\r\n @hour = @time/60\r\n @minute = @time%60\r\n $game_variables[LTS::HOUR_VARIABLE_ID] = @hour unless LTS::HOUR_VARIABLE_ID == nil\r\n $lts_time = sprintf(\"%02d:%02d\", @hour, @minute)\r\n if $lts_event_tone\r\n update_tone(0) if $lts_map_data[$game_map.map_id].part_outside?\r\n else\r\n $game_map.screen.start_tone_change(Tone.new(0,0,0,0),0)\r\n update_tone(0) if $lts_map_data[$game_map.map_id].outside?\r\n end\r\n end",
"def tick_every=(tick_every)\n if !tick_every.nil? && tick_every > 604800\n fail ArgumentError, 'invalid value for \"tick_every\", must be smaller than or equal to 604800.'\n end\n if !tick_every.nil? && tick_every < 30\n fail ArgumentError, 'invalid value for \"tick_every\", must be greater than or equal to 30.'\n end\n @tick_every = tick_every\n end",
"def end_of_hour\n change(:min => 59, :sec => 59)\n end",
"def locked?\n self.played_at <= self.class.hours_before_start_time_to_bet.hour.from_now\n end",
"def delay\n val = (self['min-time']/1000.0/60.0)\n val < 1 ? val.round(1) : val.round\n end",
"def with_minute(minute)\n LocalTime.of(@hour, minute, @second, @millis)\n end",
"def minutes ; self * 60 ; end",
"def test_cur_sec_greater\n \tassert(@bv.timestap_correct(1, \"123456.1111\", \"123457.1111\"))\n end",
"def calculate_amount!\n self.amount = TimeEntry.per_hour * self.time\n #using self to set this as an attribute of the TimeEntry model\n\n\n # if self.amount > 1000\n # false\n # #no 'return false', as this would stop the entire callback from running\n # end\n # true\n end",
"def check_temp\n\t\tif cpu_temp >= \"temp=50.0'C\"\n\t\t\tRPi::GPIO.set_high 12\n\t\t\tend\n\t\tif cpu_temp <= \"temp=49.9'C\"\n\t\t\tRPi::GPIO.set_low 12\n\t\t\tend\n\tend",
"def beginning_of_minute\n change(sec: 0)\n end",
"def beginning_of_minute\n change(sec: 0)\n end",
"def check_timestamp\n @recent.save! if Time.now - @recent.updated_at >= 600\n end",
"def finish_round\n display(\"\\n\\n ---------------- TIME TO SETTLE ---------------- \\n\\n\")\n end",
"def tired\t\r\n\tif $hours_asleep >= 8 then\r\n\t $hours_asleep = 0\r\n \t\treturn false\r\n \telse\r\n \t\t$hours_asleep += 1\r\n \t\treturn true\r\n \tend \t\t\r\nend",
"def setMinutes(minutes)\r\n\t\t\t\t\t@minutes = minutes\r\n\t\t\t\tend",
"def periodic_flush\n true\n end",
"def check_lock_time(lock_time)\n false\n end",
"def minute\n @minute\n end",
"def passcode_minutes_of_inactivity_before_lock=(value)\n @passcode_minutes_of_inactivity_before_lock = value\n end",
"def check_meter\n puts \"You have #{minutes_remaining} minutes remaining.\"\n end",
"def increment_karma_if_needed\n if $user.karma_incr_time.to_i < (Time.now.to_i-KarmaIncrementInterval)\n userkey = \"user:#{$user.id}\"\n $r.hset(userkey,\"karma_incr_time\",Time.now.to_i)\n $user.change_karma_by KarmaIncrementAmount\n end\nend",
"def step(time)\n warn %(Timer step must be >= 0, but #{time} was given!) unless time >= 0\n @now += time\n end",
"def mark_success\n @last_good_time = Time.now.to_f\n end",
"def rocket_job_cron_next_time(time = Time.now)\n RocketJob::Plugins::Rufus::CronLine.new(cron_schedule).next_time(time)\n end",
"def rocket_job_cron_next_time(time = Time.now)\n RocketJob::Plugins::Rufus::CronLine.new(cron_schedule).next_time(time)\n end"
] | [
"0.7776418",
"0.7579251",
"0.7324939",
"0.68012846",
"0.64941674",
"0.6316363",
"0.6301563",
"0.615146",
"0.615146",
"0.6073975",
"0.59590167",
"0.5943216",
"0.593197",
"0.57048863",
"0.56690484",
"0.5656231",
"0.5656231",
"0.5656231",
"0.565457",
"0.5651588",
"0.5584626",
"0.5562538",
"0.55544007",
"0.55503875",
"0.5550273",
"0.5546089",
"0.5543525",
"0.55223507",
"0.5512055",
"0.5454838",
"0.54284054",
"0.5420139",
"0.5408799",
"0.5381622",
"0.53723276",
"0.5371869",
"0.5369722",
"0.53691185",
"0.5354882",
"0.5353116",
"0.5334822",
"0.5326885",
"0.5300677",
"0.5288572",
"0.52790517",
"0.5277707",
"0.52580035",
"0.5252878",
"0.524852",
"0.5245695",
"0.52429384",
"0.52408123",
"0.52185535",
"0.5215679",
"0.5205688",
"0.520013",
"0.51895636",
"0.5166674",
"0.51535213",
"0.5151245",
"0.51417005",
"0.5133495",
"0.51326895",
"0.5131056",
"0.5129709",
"0.5121711",
"0.5116277",
"0.51101726",
"0.51053894",
"0.5097784",
"0.50959086",
"0.50945204",
"0.50899833",
"0.507647",
"0.5074205",
"0.506992",
"0.5069227",
"0.5061529",
"0.5057285",
"0.505609",
"0.5055937",
"0.5054911",
"0.5054453",
"0.50510216",
"0.5050801",
"0.5050801",
"0.50495625",
"0.5049147",
"0.5040468",
"0.50273746",
"0.5014856",
"0.5010942",
"0.5007485",
"0.5006377",
"0.5005392",
"0.50032365",
"0.49988347",
"0.49979696",
"0.49943843",
"0.49943843"
] | 0.8124774 | 0 |
Advances the hour. Minutes are set to 0 Seconds are set to 0. | def tick_tock
@hour += 1
@minute = 0
@second = 0
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def advance_hours(hours)\n self + (hours * 60 * 60)\n end",
"def succ\n next_hour = Hour.new(\"12 AM\")\n\n next_time = (@hour + 1) % 24\n next_hour.instance_eval { @hour = next_time }\n #puts \" succ called: next_hour is #{next_hour}, #{@hour}, #{next_time}\"\n next_hour\n end",
"def hour() end",
"def next_hour(time, time_source = nil)\n seconds_left = time.to_i % 3600\n \n time + (seconds_left > 0 ? seconds_left : 3600)\n end",
"def addHour(hour)\n addMin(hour * 60) ;\n end",
"def add_hours(hours = 1)\n hours = hours.to_i\n cur_hour = @t_hour\n next_hour = cur_hour + hours\n \n if next_hour >= 24\n @t_hour = 0\n self.add_days(1)\n hours_left = (hours - 1) - (24 - cur_hour)\n self.add_hours(hours_left) if hours_left > 0\n elsif next_hour < 0\n @t_hour = 23\n self.add_days(-1)\n hours_left = hours + cur_hour + 1\n self.add_hours(hours_left) if hours_left < 0\n else\n @t_hour = next_hour\n end\n \n return self\n end",
"def end_of_hour\n change(:min => 59, :sec => 59)\n end",
"def hour\n set_function_and_argument(:hour, nil)\n end",
"def lazy_hour=(newhour)\n newhour = newhour.to_f\n \n #Add days for every 24 hours given.\n if newhour > 24 or newhour < 0\n days = (newhour.to_f / 24.0).floor\n newhour -= (days.to_f * 24.0)\n self.add_days(days)\n end\n \n #Convert any decimals to setting minute.\n diff = newhour - newhour.floor\n self.lazy_min = diff * 60 if diff > 0.0\n \n #Set the actual hour.\n self.hour = newhour.floor\n \n self\n end",
"def beginning_of_hour\n change(min: 0)\n end",
"def beginning_of_hour\n change(min: 0)\n end",
"def tick\n\t\tif @sec > 0\n\t\t\t@sec -= 1\n\t\telse\n\t\t\t@sec = 59\n\t\t\tif min > 0\n\t\t\t\t@min -= 1\n\t\t\telse\n\t\t\t\t@min = 59\n\t\t\t\tif @hr > 0\n\t\t\t\t\t@hr -= 1\n\t\t\t\telse\n\t\t\t\t\t@hr = 23\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend",
"def hour_thc\n hour = @t_hour\n hour -= 12 if hour > 12\n return hour\n end",
"def hour() time[0] end",
"def hours() 60 * minutes end",
"def end_of_hour\n change(min: 59, sec: 59.999)\n end",
"def setHour(hour)\r\n\t\t\t\t\t@hour = hour\r\n\t\t\t\tend",
"def advance(seconds:)\n @time += (seconds.to_i * 1_000)\n end",
"def advance(date, time)\n date.advance(hours: time.hour, minutes: time.min, seconds: time.sec)\n end",
"def once_per_hour &block\n\tcurrent_hour = Time.now.hour\n\n\tblock.call\n\t\nend",
"def end_of_hour\n change(\n :min => 59,\n :sec => 59,\n :usec => 999999.999\n )\n end",
"def hour\n hour? ? at_hour : super\n end",
"def hour=(newhour)\n newhour = newhour.to_i\n raise ArgumentError, \"Invalid hour: '#{newhour}'.\" if newhour < 0 or newhour > 24\n @t_hour = newhour\n return self\n end",
"def rational_hour(seconds); end",
"def set_time(hour, minute)\n hour = 0 if hour.negative?\n hour = 23 if hour > 23\n minute = 0 if minute.negative?\n minute = 59 if minute > 59\n time = Time.new(0, nil, nil, hour, minute, nil, nil)\n @hour = time.hour\n @minutes = time.min\n end",
"def grandfather_clock &block\n hour = Time.new.hour\n if hour >= 13\n hour = hour - 12\n end\n if hour == 0\n hour = 12\n end\n hour.times do\n block.call\n end\nend",
"def advance()\n @time = @time + 1\n end",
"def hours; self * HOUR; end",
"def hours; self * HOUR; end",
"def change_time(hike_instance)\n system 'clear'\n puts \"-----MY HIKES-----\"\n hours = @prompt.ask(\"Enter time in hours: \", required: true, convert: :int) {|input| input.in('0-24')}\n minutes = 61\n while minutes > 60 || minutes < 0\n minutes = @prompt.ask(\"Enter time in minutes: \", required: true, convert: :int) {|input| input.in('0-60')}\n end\n hike_instance.time_hiked = (hours * 3600) + (minutes * 60)\n hike_instance.save\n puts \"New time saved.\"\n @prompt.keypress(\"Press any key to continue\")\n end",
"def grandfather_clock(&block)\n current_time = Time.new.hour\n if current_time == 0\n current_time = 12\n end\n if current_time >= 13 && current_time <=23\n current_time -= 12\n end\n puts \"The hour is #{current_time}\"\n current_time.times do\n block.call\n end\nend",
"def hour\n @hour ||= time_parts[0]\n end",
"def setTime(hour, min, sec)\n setSec(sec) ;\n addMin(min) ;\n addHour(hour) ;\n end",
"def grandfather_clock(&block)\n\tcurrent_hour = Time.now.hour\n\tif current_hour == 0\n\t\tcurrent_hour = 12\n\telsif current_hour >= 13\n\t\tcurrent_hour -= 12\n\tend\n\n\tcurrent_hour.times do\n\t\tblock.call\n\tend\nend",
"def change_time_to_beginning_of_hour\n self.starts_at = self.starts_at.beginning_of_hour()\n self.ends_at = self.starts_at.end_of_hour()\n end",
"def set_time(hr, min)\n time = self.current_time.split(\":\")\n time[0] = hr\n time[1] = min\n self.current_time = time.join(\":\")\n end",
"def first_hour=(hour)\n\t\tself.day_begins_at = Time.parse(hour)\n\tend",
"def hour\n # seconds_since_start_of_day / H_SECS\n (seconds_since_start_of_day / H_SECS).to_i\n end",
"def advance_minutes(mins)\n self + (mins * 60)\n end",
"def hours=(value)\n if value.to_s.include?(':')\n array = value.split(\":\")\n self.total_time = (array[0].to_i * 3600 + array[1].to_i * 60)\n else\n self.total_time = (value.to_f * 3600).to_i\n end\n end",
"def end_of_hour\n change(\n min: 59,\n sec: 59,\n usec: Rational(999999999, 1000)\n )\n end",
"def tock\n @minute += 1\n end",
"def increment_time\n @now += 1.minute\n end",
"def increment_time\n @time = @time + 1\n end",
"def grandfather_clock(str, &block)\n now_hour = Time.new.hour\n\n if now_hour == 0\n now_hour += 12\n elsif now_hour > 12\n now_hour -= 12\n end\n\n puts \"The hour is #{now_hour}\"\n now_hour.times do\n block.call(str)\n end\nend",
"def hours\n self.to_i * 3_600\n end",
"def settime(h, m)\t\t\t\t\n\t\t@t = Time.new(2016, 10, 12, h, m, 0)\t# set time class\n\t\t@hour = @t.strftime(\"%I\")\t\t# set hour\n\t\t@min = @t.strftime(\"%M\")\t\t# set minute\n\t\t\n\tend",
"def hours ; self * 60.minutes ; end",
"def reschedule_at(current_time, attempts)\n current_time + ((attempts**4) + 1).hours\n end",
"def absolute_hour(seconds); end",
"def time_hour; Time.now.hour; end",
"def advance_1sec!\n\t\tTimecop.travel(Time.now + 1)\n\tend",
"def grandfather_clock &block\r\n hour = (Time.new.hour + 11)%12 + 1\r\n\r\n hour.times(&block)\r\nend",
"def change_time(hour,min)\n Time.strptime(\"#{hour}:#{min}\", \"%H:%M\")\n end",
"def grandclock(presenthour,&block)\n \n for i in (1..presenthour)\n block.call\n end\n \nend",
"def clock &block\n hour = Time.now.hour\n\n # Turn the current hour into a 12 hour clock face equivalent\n if hour == 0\n hour = 12\n elsif hour > 12\n hour = hour % 12\n end\n\n hour.times do | n |\n # Pass each hour number into the block (so it ma use it if needed) adding 1\n # cause .times starts counting from 0.\n yield n + 1\n end\nend",
"def grandfather_clock &block\n hour = (Time.new.hour + 11)%12 + 1\n\n hour.times(&block)\nend",
"def handle_hh_mm\n handle_sign\n @tzhour = @tokens[@index].get_tag(ScalarHour).type\n next_tag\n next_tag\n @tzminute = @tokens[@index].get_tag(ScalarMinute).type\n next_tag\n end",
"def advance ( delta=0 ) \n @actual += delta\n @current = @actual + offset\n @current_offset = @current.to_i/60 - @actual.to_i/60\n @updated = Time.new\n @update_count += 1\n self\n end",
"def setDurationHours(durationHour)\r\n\t\t\t\t\t@durationHour = durationHour\r\n\t\t\t\tend",
"def hours\n self * SECONDS_IN_HOUR\n end",
"def hours\n \n end",
"def set_hour_created\n self.hour_created = Time.now.in_time_zone('Eastern Time (US & Canada)').hour\n end",
"def hour=(value)\n RangeValidator.validate \"DateGroupItem.hour\", 0, 23, value\n @hour = value\n end",
"def adjust_for_happy_hour(preference)\n\n\t\tif($happy_hour and preference.quantity >= 2)\n\t\t\tpreference.price = preference.price/2\n\t\t\tpreference.save\n\t\t\tself.price -= preference.price\n\t\tend\n\n\t\tself.hh_flag = $happy_hour\n\n\t\tself.save\n\tend",
"def get_hour\n self.hr.strftime(\"%H\").to_i + self.hr.strftime(\"%M\").to_d/60\n end",
"def grandfather_clock &block\n current_hour = Time.new.hour\n if current_hour > 12\n current_hour = current_hour - 12\n current_hour.times do\n block.call\n end\n else\n current_hour.times do\n block.call\n end\n end\nend",
"def find_hour(hours)\n if hours >= 0\n hours % 24\n else\n until hours >= 0\n hours += 24\n end\n hours\n end\nend",
"def hours\n Thread.current[:datet_mode] = :hours\n return self\n end",
"def grandfather_clock &block\n time = Time.new.hour\n if time == 0\n time = 12\n elsif time > 12\n time = time - 12\n end\n\n time.times do\n block.call\n end\n\n # Work in progress for output once every hour while code running\n # while true\n # if (Time.new.hour - time) == 1\n # block.call\n # puts \"It is #{time}o'clock!\"\n # if time == 12\n # time = 1\n # else \n # time = time + 1\n # end\n # end\n # end\nend",
"def hours ; Duration[self * 3600] ; end",
"def hours\n fail \"A value is required for #{__method__}\" unless @value\n return \"0/#{@value}:0:0\"\n end",
"def advance_seconds(secs)\n self + secs\n end",
"def beginning_of_day\n #(self - seconds_since_midnight).change(:usec => 0)\n change(:hour => 0)\n end",
"def hour\n self.range('hour')\n end",
"def hour_out\n @hour_out ||= time_out.hour\n end",
"def grandfather_clock(str,&block)\n current_time = Time.new.hour\n if current_time == 0\n current_time = 12\n end\n if current_time >= 13 && current_time <=23\n current_time -= 12\n end\n puts \"The hour is #{current_time}\"\n current_time.times do\n block.call(str)\n end\nend",
"def hour(system = :twenty_four_hour)\n hour = self.to_duration.to_units(:hour, :minute, :second).fetch(:hour)\n if system == :twelve_hour\n if hour == 0\n 12\n elsif hour > 12\n hour - 12\n else\n hour\n end\n elsif (system == :twenty_four_hour)\n hour\n else\n raise ArgumentError, \"system should be :twelve_hour or :twenty_four_hour\"\n end\n end",
"def hour\n components.hour\n end",
"def grandfather_clock(&block)\n (Time.new.hour % 12).times do\n block.call\n end\nend",
"def getHour(mod = 24, unit = 1)\n return normalize(getMin(0,0)/60.0, mod, unit) ;\n end",
"def opening_hour\n 11 # 11am\n end",
"def hour(date)\n h = date.minute >= 30 ? date.hour + 1 : date.hour\n time = [pad(h.to_s), '00'].join(':')\n [time, day(date)].join(' ')\n end",
"def eac(hours = 1)\n eac = today_ac(hours) + etc(hours)\n eac.round(1)\n end",
"def update\n n = $seconds_per_tick\n @time += n\n\n @ticks_to_update_clock -= 1\n\n if @ticks_to_update_clock == 0\n @ticks_to_update_clock = (60 / $seconds_per_tick).to_i\n @text.text = to_s\n end\n\n if !@time.day? and @old_hour != @time.hour\n @sun_shining_mask.color.opacity = sun_mask_opacity\n @old_hour = @time.hour\n end\n end",
"def hour_angle\n 0.5 * (self.hour * 60 + self.min)\n end",
"def beginning_of_day\n change(hour: 0)\n end",
"def hour_total(hour, day = nil, seconds = false)\n day = (day.to_time rescue Time.now).beginning_of_day\n hour = day + hour.hours\n total hour, hour + 1.hour\n end",
"def addTime(hour, min, sec)\n addSec(sec) ;\n addMin(min) ;\n addHour(hour) ;\n end",
"def set_24hour(string, pm = true)\n int = Integer(string)\n if pm\n if int != 12 then int = int + 12 end\n else\n if int == 12 then int = 0 end\n end\n return \"#{int}\";\n end",
"def advance_by(time)\n dt = @clock + time\n\n due_to_clock = dt<=>@clock\n raise 'Time is out of range' if due_to_clock < 0\n\n return if due_to_clock == 0\n raise 'Cannot advance while running' if @enabled\n\n self.advance_to dt\n end",
"def hours=(hours)\n time = hours.to_s.strip\n @hours = time\n if time =~ HOURS_REGEX\n if time.index(':')\n h, m = time.split(/:/)\n self.minutes = h.to_i * 60 + m.to_i\n elsif time.index('h')\n self.minutes = (time.gsub(/,/, '.').to_f * 60).to_i\n elsif time.index('m')\n self.minutes = time.to_i\n else\n self.minutes = time.gsub(/,/, '.').to_f * 60\n end\n else\n self.minutes = nil\n end\n end",
"def middle_of_day\n change(hour: 12)\n end",
"def middle_of_day\n change(hour: 12)\n end",
"def grandfather_clock &block\n hours_passed = Time.new.hour%12\n hours_passed.times do\n block.call\n end\nend",
"def format_time_from_hour hour\n hrs = hour.to_i\n min = ((hour - hrs) * 60.0 + 0.5).to_i\n \"%2d:%02d\" % [hrs, min]\n end",
"def adjust(time)\n time += 9*60*60 if DEBUG\n time.to_s.sub(/ \\+0900/,\"\")\n end",
"def test_minute_set\n clock = Clock.new 0, -1\n alarm = AlarmClock.new 0, -1\n puts 'Wrong hour set' if clock.get_minute != 0\n puts 'Wrong hour set' if alarm.get_alarm_minute != 0\n clock.set_time 26, 0\n alarm.set_alarm 26, 0\n puts 'Wrong hour set' if clock.get_minute != 23\n puts 'Wrong hour set' if alarm.get_alarm_minute != 23\n end",
"def initialize(hour, minute)\n set_time hour, minute\n end",
"def with_hour(hour)\n LocalTime.of(hour, @minute, @second, @millis)\n end"
] | [
"0.76520455",
"0.70104843",
"0.67804",
"0.6614284",
"0.6613331",
"0.6610804",
"0.65816593",
"0.6502101",
"0.6476486",
"0.6330718",
"0.6330718",
"0.62788576",
"0.6268018",
"0.6259763",
"0.6247819",
"0.62472886",
"0.6212615",
"0.6205877",
"0.61883897",
"0.6177508",
"0.61546403",
"0.61503136",
"0.612156",
"0.61157286",
"0.610796",
"0.61023414",
"0.6092503",
"0.6087576",
"0.6086556",
"0.60745895",
"0.60707146",
"0.6058391",
"0.6055917",
"0.599693",
"0.5995283",
"0.59825355",
"0.5977414",
"0.5964909",
"0.5953102",
"0.5949378",
"0.59157807",
"0.5915061",
"0.59093183",
"0.5877176",
"0.5859411",
"0.5850898",
"0.5849154",
"0.5837336",
"0.5833395",
"0.58273375",
"0.58245087",
"0.58155245",
"0.58154154",
"0.5809754",
"0.58056474",
"0.580508",
"0.57953197",
"0.5779997",
"0.5773595",
"0.57686526",
"0.5751991",
"0.5740715",
"0.57314676",
"0.57271665",
"0.5723006",
"0.5709225",
"0.5707491",
"0.57067895",
"0.56979",
"0.56939083",
"0.5692056",
"0.5644576",
"0.56329304",
"0.562829",
"0.56259507",
"0.56091267",
"0.56062573",
"0.55949116",
"0.55782765",
"0.55696815",
"0.55661726",
"0.55637175",
"0.5560601",
"0.5556478",
"0.5551063",
"0.554802",
"0.5547034",
"0.55439305",
"0.5542009",
"0.55407166",
"0.55405766",
"0.553313",
"0.55280125",
"0.55280125",
"0.5516225",
"0.5511783",
"0.5509773",
"0.5502834",
"0.55024105",
"0.5500432"
] | 0.64058214 | 9 |
Not bad. Not bad at all. | def current_time
"#{hour}:#{minute}:#{second}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def private; end",
"def big_bad; end",
"def probers; end",
"def missing?; end",
"def ignores; end",
"def used?; end",
"def missing; end",
"def ibu; end",
"def invalid; end",
"def awaken!\n\t\traise 'Not implemented'\n\tend",
"def anchored; end",
"def suivre; end",
"def silly_adjective; end",
"def missed?; end",
"def usable?; end",
"def sharp; accidental; end",
"def schubert; end",
"def bug\n end",
"def internship_passed; end",
"def valid; end",
"def semact?; false; end",
"def miss_reason; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def issn; end",
"def missing?; false; end",
"def too_many_hops?; end",
"def safe; end",
"def pass; end",
"def pass; end",
"def checks; end",
"def remaining; end",
"def internal; end",
"def internal?; end",
"def incomplete\r\n\r\n end",
"def ignore; end",
"def bad_smell_by_nfunctions\n end",
"def faint; end",
"def faint; end",
"def check ; true ; end",
"def reserved; end",
"def gounod; end",
"def who_we_are\r\n end",
"def berlioz; end",
"def caveats; nil end",
"def caveats; nil end",
"def fail\n\t\t# throw up this code and feed plezi your own lines :)\n\t\traise \"Plezi raising hell!\"\n\tend",
"def hiss; end",
"def celebration; end",
"def same; end",
"def placebo?; false end",
"def sharded?; false; end",
"def terpene; end",
"def failures; end",
"def failures; end",
"def failures; end",
"def isolated; end",
"def isolated; end",
"def weber; end",
"def dead?; end",
"def buzzword; end",
"def buzzword; end",
"def skipped; end",
"def tainted?() end",
"def guard; end",
"def too_complex; end",
"def taint() end",
"def pausable; end",
"def sharded?; true; end",
"def miss_reason=(_arg0); end",
"def unknown?; false; end",
"def unknown?; false; end",
"def refutal()\n end",
"def villian; end",
"def returns; end",
"def positive?; end",
"def unused\n end",
"def exceptions; end",
"def malts; end",
"def diagnostic; end",
"def strict; end",
"def specialty; end",
"def valid?; end",
"def valid?; end",
"def valid?; end",
"def valid?; end",
"def valid?; end",
"def continued_exception; end",
"def safe_by_default; end",
"def surge; end",
"def jack_handey; end",
"def under_construction\n end",
"def extra; end",
"def stderrs; end",
"def overload; end",
"def improve\n return false unless valid?\n true\n end",
"def final; end",
"def expecting; [] end",
"def exception; end"
] | [
"0.72536653",
"0.71228844",
"0.6609639",
"0.64272684",
"0.6383401",
"0.63808966",
"0.6362311",
"0.6316181",
"0.6312514",
"0.63060623",
"0.6275413",
"0.62740827",
"0.6264205",
"0.6262579",
"0.6257702",
"0.6240493",
"0.6235666",
"0.62153274",
"0.6202587",
"0.61952",
"0.6181524",
"0.6159427",
"0.6113929",
"0.6113929",
"0.6113929",
"0.6113929",
"0.61130464",
"0.60827166",
"0.60635525",
"0.6061423",
"0.6041705",
"0.6041705",
"0.6010066",
"0.5999466",
"0.5999355",
"0.59981614",
"0.59781694",
"0.59699726",
"0.59503025",
"0.5942087",
"0.5942087",
"0.59359527",
"0.5934186",
"0.5930216",
"0.5925714",
"0.591118",
"0.59001875",
"0.59001875",
"0.5899465",
"0.5897637",
"0.58888733",
"0.5873434",
"0.5857883",
"0.58498883",
"0.5842944",
"0.5832542",
"0.5832542",
"0.5832542",
"0.5828297",
"0.5828297",
"0.5826321",
"0.58126885",
"0.5806822",
"0.5806822",
"0.579737",
"0.57900965",
"0.5783007",
"0.57822716",
"0.5776823",
"0.5775678",
"0.5763591",
"0.57542276",
"0.5752484",
"0.5752484",
"0.5750714",
"0.57405216",
"0.572663",
"0.5725185",
"0.5721066",
"0.57182884",
"0.5711322",
"0.5699636",
"0.5683848",
"0.567634",
"0.56732273",
"0.56732273",
"0.56732273",
"0.56732273",
"0.56732273",
"0.5656956",
"0.5655156",
"0.56500334",
"0.5649045",
"0.5643293",
"0.56304854",
"0.5616288",
"0.5614555",
"0.56043446",
"0.5602633",
"0.5598939",
"0.55901164"
] | 0.0 | -1 |
5 Cases (1) First install, anything goes => OK (2) An old storage type was not set and the new_storage_type is :filesystem => OK (3) An old storage type was not set and the new_storage_type is :sql => NOT_OK (4) An old storage type was set and is not equal to the new storage type => NOT_OK (5) An old storage type was set and is equal to the new storage type => OK | def verify_storage_type_unchanged
if previous_run.nil? # case (1)
true
else
previous_value = previous_run['bookshelf']['storage_type']
current_value = (user_attrs['storage_type'] || 'filesystem').to_s
if previous_value.nil? && current_value == 'filesystem' # case (2)
true
elsif previous_value.nil? && current_value != 'filesystem' # case (3)
fail_with <<~EOM
Bookshelf's storage_type was previously the default of 'filesystem';
however the current configuration would result in a value of
'#{current_value}'. At this time it is not possible to change the
bookshelf storage_type post-installation.
Please set
bookshelf['storage_type'] = 'filesystem'
in /etc/#{ChefUtils::Dist::Org::LEGACY_CONF_DIR}/#{ChefUtils::Dist::Server::SERVER}.rb or leave it unset.
EOM
elsif previous_value.to_s == current_value # case (5)
true
else # everything else is invalid, including case 4 above
fail_with <<~EOM
Bookshelf's storage_type was previously '#{previous_value}'; however
the current configuration would result in a value of '#{current_value}'.
At this time it is not possible to change the bookshelf storage_type post-installation.
Please set
bookshelf['storage_type'] = '#{previous_value}'
in /etc/#{ChefUtils::Dist::Org::LEGACY_CONF_DIR}/#{ChefUtils::Dist::Server::SERVER}.rb
EOM
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_variation_storage_type\n cid = VirtualMonkey::Toolbox::determine_cloud_id(s_one)\n if cid == 232\n @storage_type = \"ros\"\n else\n pick = rand(100000) % 2\n if pick == 1\n @storage_type = \"ros\"\n else\n @storage_type = \"volume\"\n end\n end\n \n @storage_type = ENV['STORAGE_TYPE'] if ENV['STORAGE_TYPE']\n puts \"STORAGE_TYPE: #{@storage_type}\"\n @deployment.nickname += \"-STORAGE_TYPE_#{@storage_type}\"\n @deployment.save\n \n obj_behavior(@deployment, :set_input, \"db_mysql/backup/storage_type\", \"text:#{@storage_type}\")\n end",
"def storage_failure; end",
"def determine_storage(opts)\n\n if ARGV.include?('--help')\n puts %{\n\nARGUMENTS for functional tests :\n\n --fs : uses Ruote::FsStorage\n\nelse uses the in-memory Ruote::Engine (fastest, but no persistence at all)\n\n }\n exit 0\n end\n\n ps = ARGV.select { |a| a.match(/^--[a-z]/) }\n ps.delete('--split')\n\n persistent = opts.delete(:persistent)\n\n if ps.include?('--fs')\n\n require 'ruote/storage/fs_storage'\n\n require_json\n Rufus::Json.detect_backend\n\n Ruote::FsStorage.new('work', opts)\n\n elsif not ps.empty?\n\n pers = nil\n ps.find { |a| pers = locate_storage_impl(a) }\n\n raise \"no persistence found (#{ps.inspect})\" unless pers\n\n lib, path = pers\n $:.unshift(File.join(path, 'lib'))\n\n begin\n load 'test/functional_connection.rb'\n rescue LoadError => le\n begin\n load File.join(path, %w[ test functional_connection.rb ])\n rescue LoadError => lee\n begin\n load File.join(path, %w[ test integration_connection.rb ])\n rescue LoadError => leee\n p le\n p lee\n p leee\n raise leee\n end\n end\n end\n\n new_storage(opts)\n\n elsif persistent\n\n require_json\n Rufus::Json.detect_backend\n\n require 'ruote/storage/fs_storage'\n\n Ruote::FsStorage.new('work', opts)\n\n else\n\n Ruote::HashStorage.new(opts)\n end\nend",
"def storage_type\n data[:storage_type]\n end",
"def storage_type\n data[:storage_type]\n end",
"def check_metadata\n version = @db[:schema_info].first\n unless version[:magic] == Bitcoin.network[:magic_head].hth\n name = Bitcoin::NETWORKS.find{|n,d| d[:magic_head].hth == version[:magic]}[0]\n raise \"Error: DB #{@db.url} was created for '#{name}' network!\"\n end\n unless version[:backend] == backend_name\n if version[:backend] == \"sequel\" && backend_name == \"utxo\"\n log.warn { \"Note: The 'utxo' store is now the default backend.\n To keep using the full storage, change the configuration to use storage: 'sequel::#{@db.url}'.\n To use the new storage backend, delete or move #{@db.url}, or specify a different database path in the config.\" }\n end\n raise \"Error: DB #{@db.url} was created for '#{version[:backend]}' backend!\"\n end\n end",
"def setting_ok_storage_locations\n status = false\n new_storage = []\n \n if $config.has_key? \"settings\"\n if $config[\"settings\"].has_key? \"storage destinations\"\n if $config[\"settings\"][\"storage destinations\"].has_key? \"tv\"\n if $config[\"settings\"][\"storage destinations\"][\"tv\"].class == Array\n $config[\"settings\"][\"storage destinations\"][\"tv\"].push $opt[\"dst\"] if $opt.has_key? \"dst\"\n $config[\"settings\"][\"storage destinations\"][\"tv\"].uniq!\n $config[\"settings\"][\"storage destinations\"][\"tv\"].each do |directory|\n if File.directory? directory\n new_storage << directory\n end\n end\n status = true\n end\n end\n end\n end\n $config[\"settings\"][\"storage destinations\"][\"tv\"] = new_storage\n if $config[\"settings\"][\"storage destinations\"][\"tv\"].count == 0\n log \"error: no storage destinations configured!\"\n exit\n end\n return status\nend",
"def storage_options; end",
"def ensure_storage_file\n new_storage if !storage_exists?\n end",
"def filesystem_type(host)\n case host['platform']\n when %r{aix}\n 'jfs2'\n when %r{el-|centos|fedora|sles|debian|ubuntu}\n 'ext3'\n else\n # TODO: Add Solaris and OSX support, as per PUP-5201 and PUP-4823\n fail_test(\"Unable to determine a standard filesystem table type for #{host['platform']}\")\n end\n end",
"def storage_require_removable_storage_encryption\n return @storage_require_removable_storage_encryption\n end",
"def test_multicloud\n cid = VirtualMonkey::Toolbox::determine_cloud_id(s_one)\n if cid == 232\n test_cloud_files\n else\n if @storage_type == \"ros\"\n test_s3\n elsif @storage_type == \"volume\"\n test_ebs\n end\n end\n end",
"def storage_use_nfs\n super\n end",
"def exist_and_supported()\n case session.platform\n when 'linux'\n user = session.shell_command(\"whoami\")\n print_status(\"Current user is #{user}\")\n\n if (user =~ /root/)\n user_base = \"/root/\"\n else\n user_base = \"/home/#{user}/\"\n end\n\n dbvis_file = \"#{user_base}.dbvis/config70/dbvis.xml\"\n when 'windows'\n user_profile = session.sys.config.getenv('USERPROFILE')\n dbvis_file = \"#{user_profile}\\\\.dbvis\\\\config70\\\\dbvis.xml\"\n end\n\n unless file?(dbvis_file)\n #File not found, we next try with the old config path\n print_status(\"File not found: #{dbvis_file}\")\n print_status(\"This could be an older version of dbvis, trying old path\")\n\n case session.platform\n when 'linux'\n dbvis_file = \"#{user_base}.dbvis/config/dbvis.xml\"\n when 'windows'\n dbvis_file = \"#{user_profile }\\\\.dbvis\\\\config\\\\dbvis.xml\"\n end\n\n unless file?(dbvis_file)\n print_error(\"File not found: #{dbvis_file}\")\n return\n end\n\n old_version = true\n end\n\n print_status(\"Reading : #{dbvis_file}\" )\n raw_xml = \"\"\n begin\n raw_xml = read_file(dbvis_file)\n rescue EOFError\n # If there's nothing in the file, we hit EOFError\n print_error(\"Nothing read from file: #{dbvis_file}, file may be empty\")\n return\n end\n\n db_found = false\n alias_found = false\n db_type = nil\n db_type_ok = false\n\n # fetch config file\n raw_xml.each_line do |line|\n\n if line =~ /<Database id=/\n db_found = true\n elsif line =~ /<\\/Database>/\n db_found = false\n end\n\n if db_found == true\n\n # checkthe alias\n if (line =~ /<Alias>([\\S+\\s+]+)<\\/Alias>/i)\n if datastore['DBALIAS'] == $1\n alias_found = true\n print_good(\"Alias #{datastore['DBALIAS']} found in dbvis.xml\")\n end\n end\n\n if (line =~ /<Userid>([\\S+\\s+]+)<\\/Userid>/i)\n if alias_found\n print_good(\"Username for this connection : #{$1}\")\n end\n end\n\n # check the type\n if (line =~ /<Type>([\\S+\\s+]+)<\\/Type>/i)\n if alias_found\n db_type = $1\n alias_found = false\n end\n end\n end\n end\n if db_type.blank?\n print_error(\"Database alias not found in dbvis.xml\")\n end\n return db_type # That is empty if DB is not supported\n end",
"def storage_require_removable_storage_encryption=(value)\n @storage_require_removable_storage_encryption = value\n end",
"def CheckPartition(partition)\n partition = deep_copy(partition)\n freshman = {\n :valid => false,\n :name => \"unknown\",\n :arch => \"unknown\",\n :label => Ops.get_string(partition, \"label\", \"\"),\n :fs => Ops.get_symbol(partition, \"detected_fs\", :unknown),\n :fstype => Ops.get_string(partition, \"fstype\", \"unknown\")\n }\n\n p_dev = Ops.get_string(partition, \"device\", \"error\")\n p_fsid = Ops.get_integer(partition, \"fsid\", 0)\n p_type = Ops.get_symbol(partition, \"type\", :primary)\n p_detect_fs = Ops.get_symbol(partition, \"detected_fs\", :unknown)\n\n # possible root FS\n if Builtins.contains(FileSystems.possible_root_fs, p_detect_fs)\n mt_map = {\n :ext2 => \"ext2\",\n :ext3 => \"ext3\",\n :ext4 => \"ext4\",\n :btrfs => \"btrfs\",\n :reiser => \"reiserfs\",\n :xfs => \"xfs\",\n :jfs => \"jfs\"\n }\n mount_type = Ops.get(mt_map, p_detect_fs, \"\")\n\n error_message = nil\n if !(\n error_message_ref = arg_ref(error_message);\n _RunFSCKonJFS_result = RunFSCKonJFS(\n mount_type,\n p_dev,\n error_message_ref\n );\n error_message = error_message_ref.value;\n _RunFSCKonJFS_result\n )\n Ops.set(freshman, :valid, false)\n return deep_copy(freshman)\n end\n\n # mustn't be empty and must be modular\n if mount_type != \"\" && !Builtins.contains(@non_modular_fs, mount_type)\n SCR.Execute(path(\".target.modprobe\"), mount_type, \"\")\n end\n # mount (read-only) partition to Installation::destdir\n Storage.RemoveDmMapsTo(p_dev)\n if Convert.to_boolean(\n SCR.Execute(\n path(\".target.mount\"),\n [p_dev, Installation.destdir, Installation.mountlog],\n \"-o ro\"\n )\n )\n # Is this a root partition, does /etc/fstab exists?\n if Ops.greater_than(\n SCR.Read(\n path(\".target.size\"),\n Ops.add(Installation.destdir, \"/etc/fstab\")\n ),\n 0\n )\n Builtins.y2milestone(\"found fstab on %1\", partition)\n\n fstab = []\n crtab = []\n\n fstab_ref = arg_ref(fstab)\n crtab_ref = arg_ref(crtab)\n read_fstab_and_cryptotab(fstab_ref, crtab_ref, p_dev)\n fstab = fstab_ref.value\n crtab = crtab_ref.value\n Update.GetProductName\n\n fstab = Builtins.filter(fstab) do |p|\n Ops.get_string(p, \"file\", \"\") == \"/\"\n end\n\n if Builtins.size(Ops.get_string(fstab, [0, \"spec\"], \"\")) == 0\n Builtins.y2warning(\"Cannot find / entry in fstab %1\", fstab)\n end\n\n Ops.set(\n freshman,\n :valid,\n Ops.greater_than(\n Builtins.size(Ops.get_string(fstab, [0, \"spec\"], \"\")),\n 0\n ) &&\n Storage.DeviceMatchFstab(\n p_dev,\n Ops.get_string(\n # bugzilla #304269\n # DeviceMatchFstab expects _old_ not _translated_ device\n fstab,\n [0, \"spec_old\"],\n Ops.get_string(fstab, [0, \"spec\"], \"\")\n )\n )\n )\n\n # Why this doesn't match?\n # Possible reasons:\n # - /var not mounted so hwinfo cannot translate device names\n if Ops.get_boolean(freshman, :valid, false) != true\n Builtins.y2warning(\n \"Device does not match fstab: '%1' vs. '%2'\",\n p_dev,\n Ops.get_string(fstab, [0, \"spec\"], \"\")\n )\n end\n if Mode.autoinst\n # we dont care about the other checks in autoinstallation\n SCR.Execute(path(\".target.umount\"), Installation.destdir)\n return deep_copy(freshman)\n end\n\n # Get installed release name\n release = OSRelease.ReleaseInformation(Installation.destdir)\n Builtins.y2debug(\"release: %1\", release)\n if release == \"?\"\n # label for an unknown installed system\n release = _(\"Unknown\")\n end\n Ops.set(freshman, :name, release)\n\n # Right architecture?\n Ops.set(\n freshman,\n :arch,\n GetArchOfELF(Ops.add(Installation.destdir, \"/bin/bash\"))\n )\n instsys_arch = GetArchOfELF(\"/bin/bash\")\n\n # `arch_valid, see bugzilla #288201\n # installed /bin/bash and the one from inst-sys are matching\n if Ops.get_string(freshman, :arch, \"unknown\") == instsys_arch\n Builtins.y2milestone(\"Architecture (%1) is valid\", instsys_arch)\n Ops.set(freshman, :arch_valid, true) \n\n # both are PPC, bugzilla #249791\n elsif Builtins.contains(\n [\"ppc\", \"ppc64\"],\n Ops.get_string(freshman, :arch, \"unknown\")\n ) &&\n Builtins.contains([\"ppc\", \"ppc64\"], instsys_arch)\n Builtins.y2milestone(\n \"Architecture for partition %1 is %2, upgrading %3\",\n p_dev,\n Ops.get_string(freshman, :arch, \"unknown\"),\n instsys_arch\n )\n Ops.set(freshman, :arch_valid, true) \n\n # Architecture is not matching\n else\n Builtins.y2milestone(\n \"Architecture for partition %1 is %2, upgrading %3\",\n p_dev,\n Ops.get_string(freshman, :arch, \"unknown\"),\n instsys_arch\n )\n Ops.set(freshman, :arch_valid, false)\n end\n\n # If architecture is not matching, the whole partition is considered to be wrong\n if Ops.get_boolean(freshman, :arch_valid, false) != true\n Builtins.y2milestone(\n \"Architecture is not valid -> the whole partition is not valid\"\n )\n Ops.set(freshman, :valid, false)\n end\n\n if IncompleteInstallationDetected(Installation.destdir)\n Builtins.y2milestone(\n \"Incomplete installation detected, partition is not valid\"\n )\n Ops.set(freshman, :valid, false)\n end\n\n Builtins.y2milestone(\n \"Partition is valid: %1, arch is valid: %2\",\n Ops.get_boolean(freshman, :valid, false),\n Ops.get_boolean(freshman, :arch_valid, false)\n )\n end\n\n # unmount partition\n SCR.Execute(path(\".target.umount\"), Installation.destdir)\n end\n end\n\n Builtins.y2milestone(\"%1 %2\", partition, freshman)\n\n deep_copy(freshman)\n end",
"def allowed? storage\n return true if Boom.local?\n return true if allowed_storage_types.include? storage.class\n\n output error_message storage\n false\n end",
"def requires_storage_for_scan?\n true\n end",
"def check_metadata\n version = @db[:schema_info].first\n unless version[:magic] == Bitcoin.network[:magic_head].hth\n name = Bitcoin::NETWORKS.find{|n,d| d[:magic_head].hth == version[:magic]}[0]\n raise \"Error: DB #{@db.url} was created for '#{name}' network!\"\n end\n unless version[:backend] == backend_name\n # rename \"sequel\" to \"archive\" when old db is opened\n if version[:backend] == \"sequel\" && backend_name == \"archive\"\n @db[:schema_info].update(backend: \"archive\")\n else\n raise \"Error: DB #{@db.url} was created for '#{version[:backend]}' backend!\"\n end\n end\n end",
"def storage_failure=(_arg0); end",
"def test_get_is_storage_exist()\n\n name = 'First Storage'\n request = GetIsStorageExistRequest.new(name)\n\n result = @storage_api.get_is_storage_exist(request)\n assert result.code == 200, 'Error get is storage exists'\n\n end",
"def fstype\n return self['fstype'] if has_key?('fstype')\n Chef::Log.info([\n self['fstype'], current[:fstype],\n File.exists?(device) && `file -s '#{device}'`.chomp,\n self,\n ].inspect)\n return current[:fstype] if current[:fstype]\n return unless File.exists?(device)\n dev_type_str = `file -s '#{device}'`.chomp\n case\n when dev_type_str =~ /SGI XFS/ then self['fstype'] = 'xfs'\n when dev_type_str =~ /Linux.*(ext[2-4])/ then self['fstype'] = $1\n else\n raise \"Can't determine filesystem type of #{device} -- set it explicitly in node[:volumes]\"\n end\n self['fstype']\n end",
"def delete_data_with_storage_name?\n type == :retired\n end",
"def storage_type\n @dbi.storage_type\n end",
"def storage_type\n @dbi.storage_type\n end",
"def check_resource_storage_state(type_resource,url,recent_hash)\n result=\"do_nothing\"\n case type_resource\n when \"event\"\n event=Event.where(:url=> url) \n if event.size > 0 \n puts event[0].hash_resource \n if event[0].hash_resource != recent_hash\n result=\"update\" \n end\n else\n result=\"insert\" \n end\n when \"application\"\n application=Application.where(:url=> url)\n if application.size > 0\n if application[0].hash_resource != recent_hash\n result=\"update\" \n end\n else\n result=\"insert\" \n end\n when \"person\"\n person=Person.where(:url=> url)\n if person.size > 0\n if person[0].hash_resource != recent_hash\n result=\"update\" \n end\n else\n result=\"insert\" \n end\n end\n return result\n end",
"def test_02b\r\n db = ITestUtils.newdb\r\n nm = File.join(test_data,'image-1.jpg')\r\n r = db.store(nm)\r\n assert_raise ::RuntimeError do\r\n r = db.store(nm)\r\n end\r\n r = db.store(nm,:force => true) # No errors this time.\r\n end",
"def update_optional_values_depending_on_storage_type(params)\n if params[:storage_mode] != \"git\"\n params.option_for_key(:git_url).optional = true\n end\n end",
"def update_optional_values_depending_on_storage_type(params)\n if params[:storage_mode] != \"git\"\n params.option_for_key(:git_url).optional = true\n end\n end",
"def storage_type\n @grpc.default_storage_type\n end",
"def test_get_is_exist()\n\n path = 'folder7'\n versionId = nil\n storage = 'First Storage'\n request = GetIsExistRequest.new(path, versionId, storage)\n\n result = @storage_api.get_is_exist(request)\n assert result.code == 200, 'Error get is file or folder exist'\n assert result.file_exist != nil\n\n end",
"def check_storage(user_id)\n user_plan=UserPlan.find_by_user_id(user_id)\n plan=Plan.find(user_plan.plan_id)\n storage1=(user_plan.storage/1024*1024).to_f\n\n if plan.storage.to_i > storage1\n return flag=true.to_s\n else\n return flag=false.to_s\n end\n end",
"def storage_require_device_encryption\n return @storage_require_device_encryption\n end",
"def block_storage?\n name.include?(\"BlockStorage\")\n end",
"def check_storage(user_id)\n user_plan=UserPlan.find_by_user_id(user_id)\n plan=Plan.find(user_plan.plan_id)\n storage1=(user_plan.storage/1024*1024).to_f\n if plan.storage.to_i > storage1\n return flag=true.to_s\n else\n return flag=false.to_s\n end\n end",
"def set_storage_type\n @storage_type = StorageType.find(params[:id])\n end",
"def storage_require_encryption=(value)\n @storage_require_encryption = value\n end",
"def storage_require_encryption=(value)\n @storage_require_encryption = value\n end",
"def can_post_install?\n return false unless has_os?\n\n ![\"vmware_esxi\", \"hyperv\", \"suse11\", \"suse12\"].include?(os_image_type.downcase)\n end",
"def storage?\n options[:storage]\n end",
"def verify_im_installed?(installed_directory)\n step \"Verify IBM Installation Manager is installed into directory: #{installed_directory}\"\n step 'Verify 1/3: IBM Installation Manager Launcher'\n fail_test \"Launcher has not been found in: #{installed_directory}/eclipse\" if agent.file_exist?(\"#{installed_directory}/eclipse/launcher\") == false\n\n step 'Verify 2/3: IBM Installation Manager License File'\n fail_test \"License file has not been found in: #{installed_directory}/license\" if agent.file_exist?(\"#{installed_directory}/license/es/license.txt\") == false\n\n step 'Verify 3/3: IBM Installation Manager Version'\n fail_test \"Version has not been found in: #{installed_directory}/properties/version\" if agent.file_exist?(\"#{installed_directory}/properties/version/IBM_Installation_Manager.*\") == false\nend",
"def load_storage_system(item)\n warn_msg = \"Both StorageSystem name '#{storage_system_name}' and IP '#{storage_system_ip}' were provided. Name is being ignored!\"\n Chef::Log.warn(warn_msg) if storage_system_name && storage_system_ip\n if storage_system_ip\n item.set_storage_system(OneviewSDK::StorageSystem.new(item.client, credentials: { ip_hostname: storage_system_ip }))\n elsif storage_system_name\n item.set_storage_system(OneviewSDK::StorageSystem.new(item.client, name: storage_system_name))\n end\n end",
"def reset_fs_uuid(fs_type, device)\n case fs_type\n when /xfs/\n cmd = \"#{COMMANDS[:xfs_admin]} -U generate #{device}\"\n when /ext/\n cmd = \"#{COMMANDS[:e2fsck]} -f -y #{device}\"\n _rc, o, e = Command.execute(cmd, false)\n\n OpenNebula.log e if o.empty?\n\n cmd = \"#{COMMANDS[:tune2fs]} -U random #{device}\"\n else\n return true\n end\n\n rc, o, e = Command.execute(cmd, false)\n return true if rc.zero?\n\n OpenNebula.log_error \"#{__method__}: error changing UUID: #{o}\\n#{e}\\n\"\n false\n end",
"def prepare_for_installation; end",
"def check_catalog_version\n return report_results! unless check_preserved_object_and_moab_record_versions_match\n\n return report_results! unless check_for_moab_on_storage\n\n # MoabRecord status is not currently 'invalid_checksum'\n return report_results! unless moab_on_storage_validator.can_validate_current_comp_moab_status?(moab_record: moab_record)\n\n # An expected outcome if nothing changes on storage.\n return report_versions_match if moab_record.version == moab_on_storage_version\n\n # An expected outcome if new version added to storage. Validate and update the MoabRecord version.\n return validate_moab_on_storage_and_report_results if moab_record.version < moab_on_storage_version\n\n # An error when moab_record.version > moab_on_storage_version\n report_moab_record_greater_than_moab_on_storage_version\n end",
"def storage_require_encryption\n return @storage_require_encryption\n end",
"def storage_require_encryption\n return @storage_require_encryption\n end",
"def storage_require_device_encryption=(value)\n @storage_require_device_encryption = value\n end",
"def storage_available?\n return @storage_available if @storage_available\n\n if @storage_available = Gitlab::Git::Storage::ForkedStorageCheck\n .storage_available?(storage_path, storage_timeout, access_retries)\n track_storage_accessible\n else\n track_storage_inaccessible\n end\n\n @storage_available\n end",
"def update\n respond_to do |format|\n if @storage_type.update(storage_type_params)\n format.html { redirect_to @storage_type, notice: 'Storage type was successfully updated.' }\n format.json { render :show, status: :ok, location: @storage_type }\n else\n format.html { render :edit }\n format.json { render json: @storage_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def test_volume_size(server,expected_size)\n puts \"Testing with: #{@mount_point} #{expected_size}\"\nputs \"THIS DOES NOT WORK - cause of rounding errors during volume size determination, FS overhead and df's output\"\nputs \"Need to query the volumes attached to the server and verify that they #{expected_size}/#{@stripe_count}\"\nputs \"Check that the server's volumes are #{expected_size}\"\n# server.spot_check_command(\"df -kh | awk -F\\\" \\\" -v -v size=#{expected_size}G '/#{@mount_point}/ {exit $2!=size}'\")\n end",
"def get_proper_storage_for_create(size, local_path = nil)\n FC::Storage.select_proper_storage_for_create(get_create_storages, size) do |storages|\n local_storages = storages.select{|storage| FC::Storage.curr_host == storage.host}\n # find same storage device as local_path device\n if local_path && !local_storages.empty?\n dev = File.stat(local_path).dev\n dev_storage = local_storages.select{|storage| dev == File.stat(storage.path).dev}.first\n local_storages = [dev_storage] if dev_storage\n end\n # if no local storages - use all storages\n local_storages = storages if local_storages.empty?\n local_storages\n end\n end",
"def create_storage_system(request_body)\n response = request(:post, '/devmgr/v2/storage-systems', request_body.to_json)\n status(response, 201, 'Storage Creation Failed')\n end",
"def create_storage_system(request_body)\n response = request(:post, '/devmgr/v2/storage-systems', request_body.to_json)\n status(response, 201, 'Storage Creation Failed')\n end",
"def detect_database_type! # :nodoc:\n @file.seek(-3, IO::SEEK_END)\n @ip_bits = 32\n\n 0.upto(STRUCTURE_INFO_MAX_SIZE - 1) do |i|\n if @file.read(3).bytes.all? { |byte| byte == 255 }\n @database_type =\n\t if @file.respond_to?(:getbyte)\n\t @file.getbyte\n\t else\n\t @file.getc\n\t end\n\n @database_type -= 105 if @database_type >= 106\n\n if (@database_type == Edition::REGION_REV0)\n # Region Edition, pre June 2003\n @database_segments = [STATE_BEGIN_REV0]\n elsif (@database_type == Edition::REGION_REV1)\n # Region Edition, post June 2003\n @database_segments = [STATE_BEGIN_REV1]\n elsif @database_type == Edition::CITY_REV0 ||\n @database_type == Edition::CITY_REV1 ||\n @database_type == Edition::ORG ||\n @database_type == Edition::ORG_V6 ||\n @database_type == Edition::ISP ||\n @database_type == Edition::ISP_V6 ||\n\t @database_type == Edition::REGISTRAR ||\n\t @database_type == Edition::REGISTRAR_V6 ||\n\t @database_type == Edition::USERTYPE ||\t # Many of these files mis-identify as ASNUM files\n\t @database_type == Edition::USERTYPE_V6 ||\n @database_type == Edition::DOMAIN ||\n @database_type == Edition::DOMAIN_V6 ||\n @database_type == Edition::ASNUM ||\n @database_type == Edition::ASNUM_V6 ||\n\t @database_type == Edition::NETSPEED_REV1 ||\n\t @database_type == Edition::NETSPEED_REV1_V6 ||\n\t @database_type == Edition::LOCATIONA ||\n\t # @database_type == Edition::LOCATIONA_V6 ||\n\t @database_type == Edition::ACCURACYRADIUS ||\n\t @database_type == Edition::ACCURACYRADIUS_V6 ||\n @database_type == Edition::CITYCONF ||\n @database_type == Edition::COUNTRYCONF ||\n @database_type == Edition::REGIONCONF ||\n @database_type == Edition::POSTALCONF ||\n @database_type == Edition::CITY_REV0_V6 ||\n @database_type == Edition::CITY_REV1_V6\n\n # City/Org Editions have two segments, read offset of second segment\n @database_segments = [0]\n sr = @file.read(3).unpack(\"C*\")\n @database_segments[0] += le_to_ui(sr)\n\n end\n\n\tcase @database_type\n\twhen Edition::COUNTRY\n\twhen Edition::NETSPEED_REV1\n\twhen Edition::ASNUM\n\twhen Edition::CITY_REV0\n\twhen Edition::CITY_REV1\n\twhen Edition::REGION_REV0\n\twhen Edition::REGION_REV1\n\t @ip_bits = 32\n\t @record_length = 3\n\n\twhen Edition::ORG,\n\t Edition::DOMAIN,\n\t Edition::ISP\n\t @ip_bits = 32\n\t @record_length = 4\n\n\twhen Edition::ASNUM_V6,\n\t Edition::CITY_REV0_V6,\n\t Edition::CITY_REV1_V6,\n\t Edition::NETSPEED_REV1_V6,\n\t Edition::COUNTRY_V6,\n\t Edition::PROXY\n\t @ip_bits = 128\n\t @record_length = 3\n\n\twhen Edition::ACCURACYRADIUS_V6,\n\t Edition::DOMAIN_V6,\n\t Edition::ISP_V6,\n\t Edition::LARGE_COUNTRY_V6,\n\t Edition::LOCATIONA_V6,\n\t Edition::ORG_V6,\n\t Edition::REGISTRAR_V6,\n\t Edition::USERTYPE_V6\n\t @ip_bits = 128\n\t @record_length = 4\n\n\telse\n\t raise \"unimplemented database type\"\n\tend\n\n break\n else\n @file.seek(-4, IO::SEEK_CUR)\n end\n end\n\n if (@database_type == Edition::COUNTRY ||\n @database_type == Edition::PROXY ||\n @database_type == Edition::COUNTRY_V6 ||\n @database_type == Edition::NETSPEED)\n @database_segments = [COUNTRY_BEGIN]\n end\n\n # puts \"Detected IPv#{@ip_bits == 32 ? '4' : '6'} database_type #{@database_type} with #{@database_segments[0]} records of length #{@record_length} (data starts at #{@database_segments[0]*@record_length*2})\"\n end",
"def os_type\n vm.storage_profile.os_disk.os_type\n end",
"def check_product_type\n\t\t\tif self.product_category_id == 1\n\t\t\t\tInventory.create!(product_id: self.id, xsmall: 0, small: 0, medium: 0, large: 0, xlarge: 0, xxlarge: 0)\n\t\t\tend\n\t\tend",
"def test_successful_store(encryption=false)\n store_successful(encryption, nil, nil)\n end",
"def check_required_disk_space\n old_data_dir_size = Du.du(old_data_dir)\n # new_data_dir might not exist at the point of making this check.\n # In that case check the first existing directory above it.\n new_dir = dir_or_existing_parent(new_data_dir)\n free_disk_space = Statfs.new(new_dir).free_space\n\n if old_data_dir_size < (free_disk_space * 0.90)\n Chef::Log.info(\"!!!!!!!!!!!!! Old data dir size: #{old_data_dir_size}\")\n Chef::Log.info(\"Free disk space: #{free_disk_space}\")\n Chef::Log.info('Free space is sufficient to start upgrade')\n true\n else\n Chef::Log.fatal('Insufficient free space on disk to complete upgrade.')\n Chef::Log.fatal(\"The current postgresql data directory contains #{old_data_dir_size} KB of data but only #{free_disk_space} KB is available on disk.\")\n Chef::Log.fatal(\"The upgrade process requires at least #{old_data_dir_size / 0.90} KB.\")\n raise 'Insufficient Disk Space to Upgrade'\n end\n end",
"def storage_exists?(storage_name)\n adapter.storage_exists?(storage_name)\n end",
"def check_storage(email_to)\n Helpers::log(\"checking storage information..\")\n df = ssh_df_inst\n if df.nil?\n Helpers::log(\"The storage information for #{hostname} cannot be accessed\")\n else\n percentage = df.split(\":\")[2].to_i\n if percentage >= STORAGE_THRESHOLD\n hostname = ssh_hostname\n Helpers::log(\"#{hostname} has exceeded the storage threshold: \" + \n \"#{STORAGE_THRESHOLD}%.\")\n if !email_to.nil?\n msg = \"#{hostname} is currently at #{percentage}%.\\n\" +\n \"It is over the #{STORAGE_THRESHOLD}% threshold.\\n\"\n Emailer::send_email(EMAIL_FROM, email_to,\n \"Time to clean up #{hostname}\", msg)\n end\n end\n df\n end\n end",
"def check_required_disk_space\n old_data_dir_size = Du.du(old_data_dir)\n # new_data_dir might not exist at the point of making this check.\n # In that case check the first existing directory above it.\n new_dir = dir_or_existing_parent(new_data_dir)\n free_disk_space = Statfs.new(new_dir).free_space\n\n if old_data_dir_size < (free_disk_space * 0.90)\n Chef::Log.debug(\"Old data dir size: #{old_data_dir_size}\")\n Chef::Log.debug(\" Free disk space: #{free_disk_space}\")\n Chef::Log.debug('Free space is sufficient to start upgrade')\n true\n else\n Chef::Log.fatal('Insufficient free space on disk to complete upgrade.')\n Chef::Log.fatal(\"The current postgresql data directory contains #{old_data_dir_size} KB of data but only #{free_disk_space} KB is available on disk.\")\n Chef::Log.fatal(\"The upgrade process requires at least #{old_data_dir_size / 0.90} KB.\")\n raise 'Insufficient Disk Space to Upgrade'\n end\n end",
"def installer_package?\n installer_type.blank?\n end",
"def backup_minister_installed?\n software_installed?(APP_NAME)\n end",
"def set_devices(storage_config)\n storage_config = deep_copy(storage_config)\n Builtins.y2milestone(\"entering set_devices with %1\", storage_config)\n first_set = false\n failed = false\n auto_targetmap = Builtins.listmap(storage_config) do |drive|\n device = \"\"\n Builtins.y2milestone(\"Working on drive: %1\", drive)\n # FIXME: Check if physical drives > 1\n if Ops.get_string(drive, \"device\", \"\") == \"ask\"\n dev = DiskSelectionDialog()\n if dev != nil\n first_set = true\n device = dev\n end\n\n next { device => drive }\n end\n if !first_set &&\n (Ops.get_string(drive, \"device\", \"\") == \"\" ||\n Ops.get_string(drive, \"device\", \"\") == \"ask\")\n device = Storage.GetPartDisk\n Builtins.y2milestone(\"device: %1\", device)\n first_set = true\n next { device => drive }\n elsif Ops.get_string(drive, \"device\", \"\") != \"\"\n dev = Ops.get_string(drive, \"device\", \"\")\n if dev == \"\"\n dev = \"error\"\n Builtins.y2error(\"Missing device name in partitioning plan\")\n failed = true\n end\n\n next { dev => drive }\n end\n end\n\n return nil if failed\n\n auto_targetmap = Builtins.mapmap(auto_targetmap) do |device, d|\n # Convert from Old Style\n if Builtins.haskey(d, \"use\")\n Builtins.y2milestone(\n \"converting from \\\"use\\\" to new style: %1\",\n device\n )\n if Ops.get_string(d, \"use\", \"\") == \"free\"\n Ops.set(d, \"prefer_remove\", false)\n elsif Ops.get_string(d, \"use\", \"\") == \"all\"\n Ops.set(d, \"prefer_remove\", true)\n elsif Ops.get_string(d, \"use\", \"\") == \"linux\"\n Ops.set(d, \"keep_partition_num\", GetNoneLinuxPartitions(device))\n Ops.set(d, \"prefer_remove\", true)\n else\n uselist = Builtins.filter(\n Builtins.splitstring(Ops.get_string(d, \"use\", \"\"), \",\")\n ) { |s| s != \"\" }\n Builtins.y2milestone(\"uselist: %1\", uselist)\n keeplist = []\n all = GetAllPartitions(device)\n Builtins.y2milestone(\"all list: %1\", all)\n Builtins.foreach(all) do |i|\n if !Builtins.contains(uselist, Builtins.sformat(\"%1\", i))\n keeplist = Builtins.add(keeplist, i)\n end\n end\n Builtins.y2milestone(\"keeplist: %1\", keeplist)\n Ops.set(d, \"keep_partition_num\", keeplist)\n\n if Ops.greater_than(Builtins.size(keeplist), 0)\n Ops.set(d, \"prefer_remove\", true)\n end\n end\n else\n Ops.set(d, \"use\", \"all\")\n end\n # see if <usepart> is used and add the partitions to <keep_partition_num>\n Builtins.foreach(Ops.get_list(d, \"partitions\", [])) do |p|\n if Ops.get_integer(p, \"usepart\", -1) != -1\n Ops.set(\n d,\n \"keep_partition_num\",\n Builtins.add(\n Ops.get_list(d, \"keep_partition_num\", []),\n Ops.get_integer(p, \"usepart\", -1)\n )\n )\n end\n end\n Ops.set(\n d,\n \"keep_partition_num\",\n Builtins.toset(Ops.get_list(d, \"keep_partition_num\", []))\n )\n { device => d }\n end\n\n Builtins.y2milestone(\n \"processed autoyast partition plan: %1\",\n auto_targetmap\n )\n deep_copy(auto_targetmap)\n end",
"def upgrade_os(new_version)\n if new_version.to_f > @os_version\n @os_version = new_version\n \"Upgrade to #{@os} v#{os_version} complete.\"\n elsif new_version.to_f == @os_version\n 'Software is up to date.'\n else\n \"Upgrade failed. Cannot install older versions of #{@os}\"\n end\n end",
"def storage_options=(_arg0); end",
"def create_storages\n @storages = []\n @encryption_info = @ms_off_crypto.encryption_info\n @encrypted_package = @ms_off_crypto.encrypted_package\n\n @storages << Storage.new('EncryptionInfo', :data=>encryption_info, :left=>3, :right=>11) # example shows right child. do we need the summary info????\n @storages << Storage.new('EncryptedPackage', :data=>encrypted_package, :color=>Storage::COLORS[:red])\n @storages << Storage.new([6].pack(\"c\")+\"DataSpaces\", :child=>5, :modified =>129685612740945580, :created=>129685612740819979)\n @storages << version\n @storages << data_space_map\n @storages << Storage.new('DataSpaceInfo', :right=>8, :child=>7, :created=>129685612740828880,:modified=>129685612740831800)\n @storages << strong_encryption_data_space\n @storages << Storage.new('TransformInfo', :color => Storage::COLORS[:red], :child=>9, :created=>129685612740834130, :modified=>129685612740943959)\n @storages << Storage.new('StrongEncryptionTransform', :child=>10, :created=>129685612740834169, :modified=>129685612740942280)\n @storages << primary \n # @storages << summary_information\n # @storages << document_summary_information\n\n # we do this at the end as we need to build the minifat stream to determine the size. #HOWEVER - it looks like the size should not include the padding?\n @storages.unshift Storage.new('Root Entry', :type=>Storage::TYPES[:root], :color=>Storage::COLORS[:red], :child=>1, :data => mini_fat_stream)\n\n end",
"def object_storage?\n name.include?(\"ObjectStorage\")\n end",
"def resolve_cloud_type\n cloud_type = File.read(File.join(self.filesystem.right_scale_state_dir, 'cloud')) rescue nil\n @ec2 = false\n @rackspace = false\n @eucalyptus = false\n case cloud_type\n when 'ec2' then ec2 = true\n when 'rackspace' then @rackspace = true\n when 'eucalyptus' then eucalyptus = true\n end\n end",
"def storage_exists?(storage_name)\n statement = <<-SQL.compress_lines\n SELECT COUNT(*)\n FROM \"information_schema\".\"tables\"\n WHERE \"table_type\" = 'BASE TABLE'\n AND \"table_schema\" = ?\n AND \"table_name\" = ?\n SQL\n\n query(statement, schema_name, storage_name).first > 0\n end",
"def check_file_type\n if is_image_type?\n {\n thumb: '100x100>',\n medium: '640x360>',\n large: '1920x1080>'\n }\n elsif is_video_type?\n {\n thumb: { :geometry => \"100x100#\", format: 'jpg', :time => 5 },\n mp4_sd: { :geometry => \"640x360#\", format: 'mp4', :processors => [:transcoder] },\n mp4_hd: { :geometry => \"1920x1080#\", format: 'mp4', :processors => [:transcoder] },\n #webm_sd: { :geometry => \"640x360#\", format: 'webm', :processors => [:transcoder] },\n webm_hd: { :geometry => \"1920x1080#\", format: 'webm', :processors => [:transcoder] }\n }\n else\n {}\n end\n end",
"def storage; end",
"def set_unit_pack_product_type\n\n\tunit_pack_product_type = UnitPackProductType.find_by_type_code(self.type_code)\n\t if unit_pack_product_type != nil \n\t\t self.unit_pack_product_type = unit_pack_product_type\n\t\t return true\n\t else\n\t\terrors.add_to_base(\"combination of: 'type_code' is invalid- it must be unique\")\n\t\t return false\n\tend\nend",
"def save_version?\n version_condition_met? && altered?\n end",
"def test_08d\r\n db = ITestUtils.newdb\r\n db.hooks = hooks()\r\n\r\n nm = File.join(test_data,'image-1.jpg')\r\n db.store(nm)\r\n assert_equal 1,db.hooks.count[:creates]\r\n assert_equal false,!!db.hooks.params[:force]\r\n db.store(nm,:force => true)\r\n assert_equal 2,db.hooks.count[:creates]\r\n assert_equal true,db.hooks.params[:force]\r\n end",
"def set_storage_system(storage_system)\n storage_system.retrieve! unless storage_system['uri']\n @data['storageSystemUri'] = storage_system['uri']\n end",
"def has_storage\n #10 MB\n if(calculate_storage(current_user) > (1024*1024*5))\n flash[:danger] = \"You are over the storage limit! Please delete some files to upload more.\"\n redirect_to assets_url\n end\n end",
"def installed?\n false\n end",
"def check_file_type\n if image_type? || gif_type?\n {\n thumb: '200x200>',\n medium: '500x500>'\n }\n elsif video_type?\n {\n thumb: { geometry: '200x200>' , format: 'jpg', frame_index: 2 },\n medium: { geometry: '500x500>' , format: 'jpg', frame_index: 2 }\n }\n elsif pdf_type?\n {\n thumb: ['200x200>', :png],\n medium: ['500x500>', :png]\n }\n else\n {}\n end\n end",
"def changeMetadataType\n begin\n old_type = params[:metadatatypename].to_s.strip.downcase\n new_type = params[:new_metadata_type].to_s.strip.downcase\n puts \"old_t: \" + old_type\n puts \"new_t: \" + new_type\n\n if old_type == \"\"\n render :text => \"Type of metadata not given\", :status => 404\n return\n end\n\n if new_type == \"\"\n render :text => \"Type of new metadata not given\", :status => 404\n return\n end\n\n # Find old metadata type\n @metadatatype = MetadataType.find_by_name(old_type)\n\n # If old metadata type was not found\n if @metadatatype == nil\n render :text => \"Old metadata type not found\", :status => 404\n return\n end\n\n # Check that new type doesn't exist already\n # @@existing_metadata_types listed in the beginning of file\n if MetadataType.find_by_name(new_type) or @@existing_metadata_types.include?(new_type)\n render :text => \"Type of new metadata already exists\", :status => 404\n return\n end\n\n # Change metadata type name\n @metadatatype.update_attribute(:name, new_type)\n render :text => \"Metadata type changed\", :status => 200\n return\n\n rescue => e\n puts \"Error in changing metadatatype: #{e.to_s}\".background(:red)\n render :text => \"Conflict\", :status => 409\n return\n end\n end",
"def addVolume(dev, size, type: \"gp2\")\n if @cloud_id.nil? or @cloud_id.empty?\n MU.log \"#{self} didn't have a cloud id, couldn't determine 'active?' status\", MU::ERR\n return true\n end\n az = nil\n MU::Cloud::AWS.ec2(region: @config['region'], credentials: @config['credentials']).describe_instances(\n instance_ids: [@cloud_id]\n ).reservations.each { |resp|\n if !resp.nil? and !resp.instances.nil?\n resp.instances.each { |instance|\n az = instance.placement.availability_zone\n instance.block_device_mappings.each { |vol|\n if vol.device_name == dev\n MU.log \"A volume #{dev} already attached to #{self}, skipping\", MU::NOTICE\n return\n end\n }\n }\n end\n }\n MU.log \"Creating #{size}GB #{type} volume on #{dev} for #{@cloud_id}\"\n creation = MU::Cloud::AWS.ec2(region: @config['region'], credentials: @config['credentials']).create_volume(\n availability_zone: az,\n size: size,\n volume_type: type\n )\n begin\n sleep 3\n creation = MU::Cloud::AWS.ec2(region: @config['region'], credentials: @config['credentials']).describe_volumes(volume_ids: [creation.volume_id]).volumes.first\n if ![\"creating\", \"available\"].include?(creation.state)\n raise MuError, \"Saw state '#{creation.state}' while creating #{size}GB #{type} volume on #{dev} for #{@cloud_id}\"\n end\n end while creation.state != \"available\"\n\n if @deploy\n MU::MommaCat.listStandardTags.each_pair { |key, value|\n MU::MommaCat.createTag(creation.volume_id, key, value, region: @config['region'], credentials: @config['credentials'])\n }\n MU::MommaCat.createTag(creation.volume_id, \"Name\", \"#{MU.deploy_id}-#{@config[\"name\"].upcase}-#{dev.upcase}\", region: @config['region'], credentials: @config['credentials'])\n end\n\n attachment = MU::Cloud::AWS.ec2(region: @config['region'], credentials: @config['credentials']).attach_volume(\n device: dev,\n instance_id: @cloud_id,\n volume_id: creation.volume_id\n )\n\n begin\n sleep 3\n attachment = MU::Cloud::AWS.ec2(region: @config['region'], credentials: @config['credentials']).describe_volumes(volume_ids: [attachment.volume_id]).volumes.first.attachments.first\n if ![\"attaching\", \"attached\"].include?(attachment.state)\n raise MuError, \"Saw state '#{creation.state}' while creating #{size}GB #{type} volume on #{dev} for #{@cloud_id}\"\n end\n end while attachment.state != \"attached\"\n end",
"def check_if_native(entity) #volumes or snapshots\n native = extension = false\n #check if 'native' volume API present:\n begin\n response = @connection.req(\"GET\", \"/#{entity}\")\n native = true if response.code.match(/^20.$/)\n return true, entity\n rescue OpenStack::Exception::ItemNotFound => not_found\n native = false\n end\n #check if available as extension:\n begin\n response = @connection.req(\"GET\", \"/os-#{entity}\")\n extension = true if response.code.match(/^20.$/)\n return false, \"os-#{entity}\"\n rescue OpenStack::Exception::ItemNotFound => not_found\n extension = false\n end\n raise OpenStack::Exception::NotImplemented.new(\"No Volumes support for this provider\", 501, \"No #{entity} Support\") unless (native || extension)\n end",
"def storage_class\n raise NotImplementedError\n end",
"def create_version\n v_stream= [60, \"Microsoft.Container.DataSpaces\".bytes.to_a, 1, 1, 1].flatten!.pack VERSION_PACKING\n Storage.new('Version', :data=>v_stream, :size=>v_stream.size)\n end",
"def update_necessary?\n load_mixlib_versioning\n cur_version = Mixlib::Versioning.parse(current_version)\n # we have to \"resolve\" partial versions like \"12\" through mixlib-install before comparing them here\n des_version =\n if new_resource.download_url_override\n # probably in an air-gapped environment.\n Mixlib::Versioning.parse(desired_version)\n else\n Mixlib::Versioning.parse(Array(mixlib_install.artifact_info).first.version)\n end\n Chef::Log.debug(\"The current chef-client version is #{cur_version} and the desired version is #{desired_version}\")\n new_resource.prevent_downgrade ? (des_version > cur_version) : (des_version != cur_version)\nend",
"def test_ruby_264\n assert @cluster.keyspace('simplex').has_table?('rb264')\n table_meta = @cluster.keyspace('simplex').table('rb264')\n assert(!table_meta.options.compact_storage?)\n end",
"def requires_external_tests_for_qe?\n required_external_tests_for_transition(:from => 'NEW_FILES', :to => 'QE').any?\n end",
"def verify_unchanged_external_flag\n # Given that someone may move a back-end to a new instance and update the\n # front-ends with the shared chef-server.rb, we may reasonably expect to\n # see this value change on the front end - so let's not call that out as an error.\n\n # This test isn't valid until we're bootstrapped (which could\n # encompass multiple runs in case of error). Before bootstrap,\n # the default value of 'false' will be in place, and having a\n # differing value is valid.\n if OmnibusHelper.has_been_bootstrapped? && backend? && previous_run\n if (cs_pg_attr.key? 'external') && (cs_pg_attr['external'] != previous_run['postgresql']['external'])\n fail_with err_CSPG001_cannot_change_external_flag\n end\n end\n end",
"def addVolume(dev, size, type: \"gp2\", delete_on_termination: false)\n\n if setDeleteOntermination(dev, delete_on_termination)\n MU.log \"A volume #{dev} already attached to #{self}, skipping\", MU::NOTICE\n return\n end\n\n MU.log \"Creating #{size}GB #{type} volume on #{dev} for #{@cloud_id}\"\n creation = MU::Cloud::AWS.ec2(region: @region, credentials: @credentials).create_volume(\n availability_zone: cloud_desc.placement.availability_zone,\n size: size,\n volume_type: type\n )\n\n MU.retrier(wait: 3, loop_if: Proc.new {\n creation = MU::Cloud::AWS.ec2(region: @region, credentials: @credentials).describe_volumes(volume_ids: [creation.volume_id]).volumes.first\n if ![\"creating\", \"available\"].include?(creation.state)\n raise MuError, \"Saw state '#{creation.state}' while creating #{size}GB #{type} volume on #{dev} for #{@cloud_id}\"\n end\n creation.state != \"available\"\n })\n\n\n if @deploy\n MU::Cloud::AWS.createStandardTags(\n creation.volume_id,\n region: @region,\n credentials: @credentials,\n optional: @config['optional_tags'],\n nametag: @mu_name+\"-\"+dev.upcase,\n othertags: @config['tags']\n )\n end\n\n MU.log \"Attaching #{creation.volume_id} as #{dev} to #{@cloud_id} in #{@region} (credentials #{@credentials})\"\n attachment = nil\n MU.retrier([Aws::EC2::Errors::IncorrectState], wait: 15, max: 4) {\n attachment = MU::Cloud::AWS.ec2(region: @region, credentials: @credentials).attach_volume(\n device: dev,\n instance_id: @cloud_id,\n volume_id: creation.volume_id\n )\n }\n\n begin\n att_resp = MU::Cloud::AWS.ec2(region: @region, credentials: @credentials).describe_volumes(volume_ids: [attachment.volume_id])\n if att_resp and att_resp.volumes and !att_resp.volumes.empty? and\n att_resp.volumes.first.attachments and\n !att_resp.volumes.first.attachments.empty?\n attachment = att_resp.volumes.first.attachments.first\n if !attachment.nil? and ![\"attaching\", \"attached\"].include?(attachment.state)\n raise MuError, \"Saw state '#{creation.state}' while creating #{size}GB #{type} volume on #{dev} for #{@cloud_id}\"\n end\n end\n end while attachment.nil? or attachment.state != \"attached\"\n\n # Set delete_on_termination, which for some reason is an instance\n # attribute and not on the attachment\n setDeleteOntermination(dev, delete_on_termination)\n end",
"def ensure_physical_databases!\n @ensure_physical_databases ||= create_physical_databases\n end",
"def postConditionalGLSConnection\n# 4A107\n dataProtection = DataProtection.new\n result = (dataProtection.checkDataEncrypted('cougaar') >= 100)\n saveResult(result, \"4a107\", \"no persisted data encrypted if dataprotection is not turned on\")\n#exit 0\n\n end",
"def storage_exists?(storage_name)\n statement = <<-EOS.compress_lines\n SELECT COUNT(*)\n FROM `information_schema`.`columns`\n WHERE `table_schema` = ? AND `table_name` = ?\n EOS\n\n query(statement, db_name, storage_name).first > 0\n end",
"def upgrade_model_storage(repository, model)\n raise NotImplementedError\n end",
"def check_physical_product_file_exists\n f = File.expand_path('simple_store/lib/products/physical_product.rb', @work_dir)\n mark_file_exists(f)\n end",
"def update_necessary?\n load_mixlib_versioning\n cur_version = Mixlib::Versioning.parse(current_version)\n des_version = Mixlib::Versioning.parse(desired_version)\n Chef::Log.debug(\"The current chef-client version is #{cur_version} and the desired version is #{desired_version}\")\n new_resource.prevent_downgrade ? (des_version > cur_version) : (des_version != cur_version)\nend",
"def flag_for_upgrade!\n self.upgrade_needed = true\n save(:validate => false)\n end",
"def mount_resize_fs(device, directory, fs_type, disk)\n size = disk['SIZE'].to_i if disk['SIZE']\n osize = disk['ORIGINAL_SIZE'].to_i if disk['ORIGINAL_SIZE']\n\n # TODO: osize is always < size after 1st resize during deployment\n return mount_dev(device, directory) unless size > osize\n\n OpenNebula.log_info \"Resizing filesystem #{fs_type} on #{device}\"\n\n case fs_type\n when /xfs/\n rc = mount_dev(device, directory)\n return false unless rc\n\n Command.execute(\"#{COMMANDS[:xfs_growfs]} -d #{directory}\", false)\n when /ext/\n err = \"#{__method__}: failed to resize #{device}\\n\"\n\n cmd = \"#{COMMANDS[:e2fsck]} -f -y #{device}\"\n _rc, o, e = Command.execute(cmd, false)\n\n if o.empty?\n OpenNebula.log_error(\"#{err}#{e}\")\n else\n cmd = \"#{COMMANDS[:resize2fs]} #{device}\"\n rc, _o, e = Command.execute(cmd, false)\n\n if rc != 0\n OpenNebula.log_error(\"#{err}#{e}\")\n return false\n end\n end\n\n rc = mount_dev(device, directory)\n else\n OpenNebula.log_info 'Skipped filesystem resize'\n\n rc = mount_dev(device, directory)\n end\n\n rc\n end",
"def retrieve_success?\n replication.update_admin\n success = replication.store_requested\n raise \"Admin node did not accept fixity: #{replication.fixity_value}\" unless success\n replication.update_local\n end",
"def rackspace_cloudbackup_test_platforms\n return {\n ubuntu: %w(12.04),\n debian: %w(7.2), # Requires Fauxhai chicanery as https://github.com/customink/fauxhai/pull/60\n # hasn't made its way to RubyGems yet.\n centos: %w(6.4 6.5)\n }\nend"
] | [
"0.68890625",
"0.6241801",
"0.59194773",
"0.5850532",
"0.5850532",
"0.5808165",
"0.57523435",
"0.57252544",
"0.5650731",
"0.5593707",
"0.5557879",
"0.5479037",
"0.5478838",
"0.5432302",
"0.54239285",
"0.54142946",
"0.54085827",
"0.5400725",
"0.53981584",
"0.5386897",
"0.5369656",
"0.5352112",
"0.53347164",
"0.53266275",
"0.53266275",
"0.5318119",
"0.5297019",
"0.52935565",
"0.52935565",
"0.5286771",
"0.52667296",
"0.5266043",
"0.5258848",
"0.52530795",
"0.5248051",
"0.5208922",
"0.517935",
"0.517935",
"0.5179277",
"0.5172299",
"0.51683223",
"0.5153682",
"0.51505315",
"0.5144156",
"0.51335466",
"0.5122373",
"0.5122373",
"0.5115305",
"0.51146716",
"0.51109105",
"0.5108074",
"0.5102848",
"0.50971174",
"0.5097071",
"0.50876755",
"0.5086562",
"0.50845975",
"0.5082108",
"0.5075504",
"0.5064443",
"0.5051976",
"0.5038342",
"0.5038065",
"0.5032394",
"0.5031499",
"0.5024223",
"0.50238407",
"0.50237954",
"0.5023087",
"0.5017297",
"0.50033313",
"0.49975014",
"0.49961933",
"0.49850518",
"0.49840957",
"0.49827322",
"0.49822745",
"0.49800766",
"0.49711803",
"0.49652523",
"0.49637824",
"0.49636304",
"0.49475402",
"0.4946196",
"0.49444634",
"0.49386764",
"0.49380618",
"0.49289814",
"0.4924832",
"0.49241886",
"0.49154207",
"0.49126664",
"0.49117264",
"0.49084887",
"0.49077827",
"0.49065658",
"0.49043167",
"0.4893",
"0.48922384",
"0.4890902"
] | 0.76222897 | 0 |
Use callbacks to share common setup or constraints between actions. | def set_task
@task = Task.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def define_action_helpers?; end",
"def set_actions\n actions :all\n end",
"def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"def setup_handler\n end",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"def workflow\n end",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); end",
"def setup\n # override and do something appropriate\n end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"def determine_valid_action\n\n end",
"def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"def startcompany(action)\n @done = true\n action.setup\n end",
"def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"def action\n end",
"def config(action, *args); end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"def before_action \n end",
"def action\n end",
"def setup\n # override this if needed\n end",
"def matt_custom_action_begin(label); end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"def setup_signals; end",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"def initialize(*args)\n super\n @action = :set\nend",
"def after_set_callback; end",
"def setup\n #implement in subclass;\n end",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"def lookup_action; end",
"def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"def around_hooks; end",
"def release_actions; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def save_action; end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"def action_target()\n \n end",
"def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"def before_setup\n # do nothing by default\n end",
"def setup(&blk)\n @setup_block = blk\n end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def default_action; end",
"def callback_phase\n super\n end",
"def advice\n end",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"def _handle_action_missing(*args); end",
"def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend",
"def call\n setup_context\n super\n end",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end"
] | [
"0.6163443",
"0.604317",
"0.5943409",
"0.59143174",
"0.5887026",
"0.58335453",
"0.57738566",
"0.5701527",
"0.5701527",
"0.56534666",
"0.5618685",
"0.54237175",
"0.5407991",
"0.5407991",
"0.5407991",
"0.5394463",
"0.5376582",
"0.5355932",
"0.53376216",
"0.5337122",
"0.5329516",
"0.5311442",
"0.52963835",
"0.52955836",
"0.5295297",
"0.5258503",
"0.52442217",
"0.5235414",
"0.5235414",
"0.5235414",
"0.5235414",
"0.5235414",
"0.5234908",
"0.5230927",
"0.52263695",
"0.5222485",
"0.5216462",
"0.52128595",
"0.52070963",
"0.520529",
"0.517586",
"0.5174021",
"0.5172379",
"0.5165636",
"0.5161574",
"0.51556087",
"0.5153217",
"0.5152898",
"0.5151238",
"0.5144674",
"0.51387095",
"0.51342636",
"0.5113545",
"0.51131564",
"0.51131564",
"0.5107665",
"0.5107052",
"0.50908124",
"0.5089785",
"0.50814754",
"0.50807786",
"0.5064482",
"0.5053022",
"0.50526255",
"0.5050246",
"0.5050246",
"0.50329554",
"0.5023997",
"0.5021236",
"0.5014815",
"0.5014393",
"0.4999298",
"0.49990913",
"0.4997733",
"0.49884573",
"0.49884573",
"0.49840933",
"0.49786162",
"0.49784446",
"0.49782816",
"0.49659815",
"0.49655175",
"0.4956222",
"0.49543875",
"0.49536037",
"0.495265",
"0.4951427",
"0.49438462",
"0.49436793",
"0.49335384",
"0.49321616",
"0.49264926",
"0.49247074",
"0.49246994",
"0.49226475",
"0.49194494",
"0.49152806",
"0.49149707",
"0.49149227",
"0.49144953",
"0.49141943"
] | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def task_params
params.require(:task).permit(:title, :content, :completed, :date_completed, :list_id,
list:[:name, :id, :user_id, :privacy, :description, :status])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def valid_params_request?; end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def filtering_params\n params.permit(:email)\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"def list_params\n params.permit(:name)\n end",
"def filter_parameters; end",
"def filter_parameters; end",
"def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"def url_whitelist; end",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def filter_params\n params.require(:filters).permit(:letters)\n end",
"def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\n end",
"def permit_request_params\n params.permit(:address)\n end",
"def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"def secure_params\n params.require(:location).permit(:name)\n end",
"def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def url_params\n params[:url].permit(:full)\n end",
"def backend_user_params\n params.permit!\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end"
] | [
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",
"0.62894756",
"0.6283177",
"0.6242471",
"0.62382483",
"0.6217549",
"0.6214457",
"0.6209053",
"0.6193042",
"0.6177802",
"0.6174604",
"0.61714715",
"0.6161512",
"0.6151757",
"0.6150663",
"0.61461",
"0.61213595",
"0.611406",
"0.6106206",
"0.6105114",
"0.6089039",
"0.6081015",
"0.6071004",
"0.60620916",
"0.6019971",
"0.601788",
"0.6011056",
"0.6010898",
"0.6005122",
"0.6005122",
"0.6001556",
"0.6001049",
"0.59943926",
"0.5992201",
"0.59909594",
"0.5990628",
"0.5980841",
"0.59669393",
"0.59589154",
"0.5958826",
"0.5957911",
"0.5957385",
"0.5953072",
"0.59526145",
"0.5943361",
"0.59386164",
"0.59375334",
"0.59375334",
"0.5933856",
"0.59292704",
"0.59254247",
"0.5924164",
"0.59167904",
"0.59088355",
"0.5907542",
"0.59064597",
"0.5906243",
"0.5898226",
"0.589687",
"0.5896091",
"0.5894501",
"0.5894289",
"0.5891739",
"0.58860534",
"0.5882406",
"0.587974",
"0.58738774",
"0.5869024",
"0.58679986",
"0.5867561",
"0.5865932",
"0.5864461",
"0.58639693",
"0.58617616",
"0.5861436",
"0.5860451",
"0.58602303",
"0.5854586",
"0.58537364",
"0.5850427",
"0.5850199"
] | 0.0 | -1 |
Is +date+ included in the temporal expression. | def includes?(date)
@days.include?(date.day)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def includes?(date)\n false\n end",
"def explicit_date?(date)\n \t\t!(/(?<relative_date>#{EXISTING_PATTERNS[:explicit_dates]})/.match(date)).nil?\n \tend",
"def include?(date)\n unless date.instance_of?(Date)\n raise ArgumentError, \"Parameters must be of class Date\"\n end\n\n return date >= @start_date && date < @end_date\n end",
"def relative_date? date\n \t\tall_durations = EXISTING_PATTERNS[:weekdays] + EXISTING_PATTERNS[:months] + EXISTING_PATTERNS[:durations]\n \t\t!(/(#{EXISTING_PATTERNS[:relative_tense]}) (#{all_durations})/.match(date)).nil? \n \tend",
"def has_date?\n header.has_date?\n end",
"def include? date_time\n return false if !(date_time.is_a?(String) or date_time.is_a?(DateTime))\n helper = DateTimeIndexHelper\n if date_time.is_a?(String)\n date_precision = helper.determine_date_precision_of date_time\n date_time = helper.date_time_from date_time, date_precision\n end\n\n result = @data.bsearch {|d| d[0] >= date_time }\n result[0] == date_time\n end",
"def contains?(date)\n year == date.year && month == date.month\n end",
"def has_date?\n !fields.select { |f| f.responsible_for?('Date') }.empty?\n end",
"def contains(date)\n if (date >= @start_date) && (date < @end_date)\n return true\n else\n date < @start_date || date >= @end_date\n return false\n end\n end",
"def includes?(date)\n @years.include?(date.year)\n end",
"def has_date?\n @date == ''\n end",
"def has_date?(date)\n\t\t@log.has_key?(date)\n\tend",
"def has_date?\n\t\t@date == ''\n\tend",
"def date?\n type == \"DATE\"\n end",
"def include? date\n @resolution = nil\t\n return true if check_anchor? && date == @anchor \n return mismatch(:day) unless day_of_week_matches?(date)\n return mismatch(:year) unless year_matches?(date) if @unit == :years\n return mismatch(:month) unless month_matches?(date) if [:months, :years].include?(@unit)\n return mismatch(:week) unless week_matches?(date) if [:years, :months, :weeks].include?(@unit)\n if [:years, :months, :weeks, :days].include?(@unit)\n return mismatch(:day) unless day_matches?(date)\n\t return mismatch(:time) unless time_matches?(date)\n end\n if @unit == :hours\n\t return mismatch(:hour) unless hour_matches?(date)\n\t return mismatch(:sub_hour) unless sub_hour_matches?(date)\n end\n if @unit == :minutes\n\t return mismatch(:minute) unless minute_matches?(date)\n\t return mismatch(:second) unless second_matches?(date)\n end\n @resolution = nil\t\n true\n end",
"def has_date?\n format = self.format.gsub(/(\"[^\"]*\"|#|\\[[\\w.]+\\])/,'')\n \n !(format =~ /[ymdwhq]/).nil?\n end",
"def include?(date)\n date >= start_date && date < self.next.date\n end",
"def date_of_application?(d)\n d[:date_applied] >= 15.days.ago.to_date\n #RIDICULOUSE BRAIN WARPING ONE! AHH!!!\n #what I'm really asking is April 24th less than April 15th on a plotted line from left to right? Nope! \n\nend",
"def active_on?(date)\n relieving_date.nil? || relieving_date >= date\n end",
"def existed_at?(aTime)\n return @date >= aTime\n end",
"def date_present(date)\n return unless date.is_a?(Date) || date.is_a?(String)\n\n date.present? ? format_bgs_date(date) : nil\n end",
"def date\n @resource.datacite_dates.where.not(date: [nil, '']).count > 0\n end",
"def covered?\n unless expr_date.nil?\n return ((expr_date<=>Date.today )> 0 ) ? true : false\n end\n false\n end",
"def include?(new_date)\n return start_date <= new_date && end_date > new_date\n end",
"def date_valid?(date)\n\tvalid_dates = Date.parse(DATA_START_DATE)..Date.today\n\tif valid_dates.cover?(date)\n\t\treturn true\n\telse\n\t\tputs \"\\n Date must be after #{DATA_START_DATE} and before today.\"\n\t\treturn false\n\tend\nend",
"def date_match?(date, h)\n h[:months].include?(date.month) and h[:days].include?(date.day) and h[:wdays].include?(date.wday)\n end",
"def date?\n false\n end",
"def accepts_outcome_date?\n accepted_outcome_types.member?('date')\n end",
"def check_before_date_requirements(date)\n return true unless release_before_date? && release_date.present?\n date <= release_date\n end",
"def check_fixed_date_requirements(date)\n return true unless release_fixed_date? && release_date.present?\n date == release_date\n end",
"def contains?(date_or_time)\n \t# TODO We need to make sure time zones are properly handled, probably!\n\n \tstarts_on <= date_or_time && date_or_time < ends_on\n end",
"def isDay date, path\n extend TCD::Common\n path_date= getDateTimeFromPath(path) rescue getDateFromPath(path)\n path_date.year==date.year and path_date.month==date.month and\n path_date.day==date.day\n end",
"def date_given?\n params.has_key?(:date_posted)\n end",
"def is_date\n @is_date\n end",
"def present_study?(date = Time.now)\n study.id == 1 || (study.id == 2 && study_form_changed_on && study_form_changed_on > date.to_date)\n end",
"def is_target_date? ( date ) \n d = date.to_date\n check = false\n if d >= @dStart.to_date && d <= @dEnd.to_date\n check = true\n end\n return check\n end",
"def is_target_date?(date) \n d = date.to_date\n check = false\n if d >= @dStart && d <= @dEnd\n check = true\n end\n return check\n end",
"def has_valid_date?\n self.time_event < Time.now.advance(days: 1)\n end",
"def reiwa?\n Date.new(2019, 5, 1) <= self\n end",
"def attested_for?(date)\n last_attested_on && last_attested_on > date.to_time\n end",
"def hasDate?\n if self.getDateStr == \"\" then out = false else out = true end \n return out\n end",
"def out_of_date?(stamp)\n @prerequisites.any? do |n| \n prereq_time = application[n, @scope].timestamp\n return false if prereq_time == Rake::EARLY\n\n prereq_time > stamp\n end\n end",
"def year_only?(date)\n\t\tdate.length == 4 && @@year_rgx.match(date)\n\tend",
"def conflicts_with_date?(date)\n date.between(self.start_date, self.end_date)\n end",
"def includes?(date)\n @weeks.include?(week_from_front(date)) ||\n @weeks.include?(week_from_back(date))\n end",
"def date_include?(date_range)\n # if date >= @checkin_date && date <= @checkout_date\n start_date = date_range.checkin_date\n end_date = date_range.checkout_date\n\n if start_date >= @checkin_date && end_date <= @checkout_date\n return true\n else\n return false\n end\n end",
"def contains?(date_or_time)\n starts_on <= date_or_time && date_or_time < ends_on\n end",
"def date_before (date)\n Predicate.new(:date_before, { date: date }) do |o|\n o <= date\n end\n end",
"def valid_date?(date)\n date =~ %r(\\A\\d{4}\\/\\d{1,2}\\/\\d{1,2}\\z)\n end",
"def can_check_in_on_date(date)\n begin\n date = Date.parse(date) unless date.is_a? Date # ensure date is a Date object if passed in as a string\n\n case FREQUENCIES.keys[frequency]\n when \"Daily\"\n true\n when \"Specific Days\"\n days.include?(date.strftime('%a')) # %a = Mon, Tues, Wed, etc.\n when \"Times Per Week\"\n needs_check_in_on_date(date) or has_check_in_on_date(date)\n else\n false\n end\n rescue\n false\n end\n end",
"def valid_date?(date)\r\n raise CLXException, 'Date must be of type DateTime' unless date.is_a? DateTime\r\n end",
"def show_date_condition\n false\n end",
"def is_date?\r\n\t\ttemp = self.gsub(/[-.\\/]/, '')\r\n\t\t['%m%d%Y','%m%d%y','%M%D%Y','%M%D%y','%d%m%y','%D%M%y'].each do |f|\r\n\t\t\tbegin\r\n\r\n\t\t\t\treturn false if Date.strptime(temp, f)\r\n\t\t\t\trescue\r\n\t\t\t\t#do nothing\r\n\t\t\tend\r\n\t\tend\r\n\r\n\t\treturn true\r\n\tend",
"def temporal?\n properties.include?(\"temporal\")\n end",
"def valid_date(date)\n date_regex = APP_CONFIG['ui']['dates']['regex']\n\n return !/#{date_regex}/.match(date.downcase).nil?\n end",
"def valid_date?(date)\n begin\n Date.parse(date) && date.match?(/\\d{4}\\-\\d{2}\\-\\d{2}/)\n rescue\n false\n end\n end",
"def active?(date)\n case [weekdays.empty?, holidays.empty?]\n when [true, true]\n return true\n when [false, true]\n return weekdays.include?(DAY[date.wday])\n when [true, false]\n return !holidays.include?(date)\n else\n weekdays.include?(DAY[date.wday]) && !holidays.include?(date)\n end\n rescue NoMethodError\n p 'provided date is not valid'\n false\n end",
"def can_be_date?\n raise NoMethodError, \"This method is no longer supported.\"\n end",
"def looks_like_date?(value)\n value.is_a?(Date) || value.is_a?(Time)\n end",
"def available?(date)\n availability.occurs_at?(date)\n end",
"def matches? string\n return true if !(@before || @after)\n\n t = Time.parse string[%r|<key>Creation Date</key>\\s+<date>(.*?)</date>|,1]\n\n return (\n !(@before && t >= @before) && # NOT (@before defined and event occurs after @before)\n !(@after && t <= @after)\n )\n end",
"def contains?(_name, _date)\r\n if (@log.has_key?(_date))\r\n for i in @log[_date]\r\n if i.name == _name\r\n return true\r\n end\r\n end\r\n else\r\n return false\r\n end\r\n return false\r\n end",
"def has_aired\n self.airdate < Time.now\n end",
"def out_of_date?(stamp)\n puts \"jsdb: checking_out_of_date\"\n @prerequisites.each do |pr|\n p pr\n end\n @prerequisites.any? { |n| application[n, @scope].timestamp > stamp }\n end",
"def week_include_date?(week_date, daily_date)\n dates = get_daily_incremental_folders_within_week_url(week_date)\n dates.detect{|d| Date.parse(d) == daily_date}\n end",
"def start_date?\r\n !event_start_date.blank?\r\n end",
"def in_date_period(month: T.unsafe(nil), year: T.unsafe(nil)); end",
"def rely_on_built_at?\n return false if created_at.to_date != RUBYGEMS_IMPORT_DATE\n\n built_at && built_at <= RUBYGEMS_IMPORT_DATE\n end",
"def can_procreate_on?(date)\n fertility_range.cover? date if (date and fertility_range)\n end",
"def available_today?(date)\n raise 'Date must be a String or Date object' unless(date.is_a?(String) || date.is_a?(Date))\n date = Date.strptime(date, '%Y-%m-%d') if date.is_a?(String)\n Date.current >= date\n end",
"def started?\n start_date.present?\n end",
"def isDateDuplicated?(date)\n # binding.pry\n self.user_times.none?{ |day_time| day_time.clock_in.to_s.slice(8, 2) == date }\n # binding.pry \n end",
"def future?\n start_date.future?\n end",
"def interpret_relative_date date\n \t\tall_durations = EXISTING_PATTERNS[:weekdays] + EXISTING_PATTERNS[:months] + EXISTING_PATTERNS[:durations]\n\t \trelative_date = /(?<tense>#{EXISTING_PATTERNS[:relative_tense]}) (?<type>#{all_durations})(\\s at)*/.match(date)\n\n \t\t# Check if the user is referring to a weekday\n\t \tif weekday?(relative_date[:type])\n \t \t\tif (relative_date[:tense] == 'next')\n\t\t\t\tdate_of_next(relative_date[:type])\n\t \t\telse\n\t \t\t\tdate_of_previous(relative_date[:type])\n\t \t\tend\n\t \telse\n \t\t\ttense = (relative_date[:tense] == 'next') ? 'from_now' : 'ago'\n\t \t\tcalculate_datetime(relative_date[:type], 1, tense)\n\t \tend\n \tend",
"def vulnerable?(dates=@@OPEN_DATES)\n cves(dates).any?\n end",
"def valid_future_date?(env, date, attribute_name: :embargo_release_date)\n return true if date.present? && date.future?\n\n env.curation_concern.errors.add(attribute_name, \"Must be a future date.\")\n false\n end",
"def check_new_date(date, field_name)\n dt = parse_datetime_string(date)\n if dt == nil\n return false\n end\n check_now_date(dt, field_name)\n end",
"def valid_template_embargo_date?(env, date, template)\n # Added this to allow admins to override embargo settings in admin set\n return true if env.current_ability.admin?\n original_valid_template_embargo_date?(env, date, template)\n end",
"def expiration_date_valid?\n expiration_date.is_a? Date\n end",
"def include_year_in_dates?\n if @time.year != Date.today.year\n # If the year was in the past, always include the year\n return true\n end\n\n if @time.year == Date.today.year && @time.month < (Date.today.month - 4)\n # If the year is this year, include if it happened more than 6 months\n # ago.\n return true\n end\n end",
"def validate_date(date)\n begin\n Date.parse(date.to_s)\n true\n rescue ArgumentError\n false\n end\n end",
"def includes(time)\r\n includesDay(time.wday) and includesTime(time.strftime(\"%H%M\"))\r\n end",
"def date_after (date)\n Predicate.new(:date_after, { date: date }) do |o|\n o >= date\n end\n end",
"def add_date(predicate, date, required = false, fmt = nil)\n add(predicate, to_iso8601(parse_date(date, fmt)), required)\n end",
"def single_date?\n event_type.to_sym == :single\n end",
"def legacy?\n date < Date.new(2014, 06, 06)\n end",
"def valid_template_embargo_date?(env, date, template)\n return true if template.blank?\n\n # Validate against template's release_date requirements\n return true if template.valid_release_date?(date)\n\n env.curation_concern.errors.add(:embargo_release_date, \"Release date specified does not match permission template release requirements for selected AdminSet.\")\n false\n end",
"def valid_release_date?(date)\n # Validate date against all release date requirements\n check_no_delay_requirements(date) && check_before_date_requirements(date) && check_fixed_date_requirements(date)\n end",
"def events_at?(date)\n !@calendar_events[date].empty?\n end",
"def date_valid?(date)\n valid_dates = Date.parse(DATA_START_DATE)..Date.today\n if valid_dates.cover?(date)\n return true\n else\n puts \"\\nDate must be after #{DATA_START_DATE} and before today.\"\n return false\n end\nend",
"def pickup_date_entered?\n pickup_date.present?\n end",
"def test?(date_or_time)\n if fixed?\n resolve(date_or_time) == date_or_time\n elsif moving?\n resolve(date_or_time) == date_or_time\n else\n false\n end\n end",
"def is_date(*keys)\n keys.each do |key|\n matches(key, FORMATS[:date], \"#{key} must be a date in the form MM/DD/YYYY\")\n end\n end",
"def date_is_not_ancient?(date)\n date > Date.new(1900)\n end",
"def test_date date\n res = true\n res = res && @min_date_filter <= date if @min_date_filter\n res = res && @max_date_filter >= date if @max_date_filter\n res\n end",
"def exact_date?(options = {})\n from_date(options) == to_date(options)\n end",
"def week_matches? date\n\t if @unit == :weeks \n \t return true if @frequency == 1\n \t return ((Recurring.week_of_year(date) - Recurring.week_of_year(@anchor)) % @frequency) == 0\n \tend\n \tif @weeks\n \t @weeks.include?(Recurring.nth_instance_of_day_in_month(date)) || @weeks.include?(Recurring.nth_negative_instance_of_day_in_month(date))\n \telse\n \t true\n \tend\n end",
"def is_status_free (date)\n that_date = date\n return that_date < Date.today \n #komentarz na przyszlosc: #Date.new(2009,6,13)\n end",
"def valid_date?\n !!(params[:date].match(/\\d{4}-(0[1-9]|1[0-2])-\\d{2}/)) && Date.parse(params[:date]) rescue false \n end",
"def valid_date?\n errors.add(:date, \"can't be in the past\") if !date.blank? and date < Date.today\n end"
] | [
"0.7954536",
"0.74254596",
"0.7111029",
"0.7108957",
"0.7042194",
"0.6931208",
"0.6882395",
"0.6876057",
"0.6869571",
"0.6859489",
"0.6835791",
"0.6779143",
"0.6731515",
"0.66136134",
"0.6532193",
"0.6522187",
"0.6486998",
"0.6404552",
"0.6387765",
"0.6377243",
"0.6331364",
"0.6310623",
"0.62501854",
"0.6222325",
"0.621142",
"0.6192207",
"0.6173794",
"0.61362284",
"0.611248",
"0.6091762",
"0.6077216",
"0.60722905",
"0.607007",
"0.6064297",
"0.60420144",
"0.6033211",
"0.60236955",
"0.6004833",
"0.6000986",
"0.5994488",
"0.59776944",
"0.5971296",
"0.5970751",
"0.59521013",
"0.5921888",
"0.5904072",
"0.5898721",
"0.5898503",
"0.58930594",
"0.5868514",
"0.5858284",
"0.5852479",
"0.5838363",
"0.5834732",
"0.5827428",
"0.5814578",
"0.5811544",
"0.58074754",
"0.580379",
"0.5794771",
"0.5766234",
"0.5763681",
"0.5747407",
"0.57451624",
"0.5738633",
"0.5720945",
"0.5720009",
"0.5715733",
"0.5712685",
"0.57125366",
"0.5707672",
"0.5704845",
"0.5701709",
"0.5697983",
"0.5695991",
"0.56944627",
"0.569357",
"0.5692075",
"0.56799245",
"0.567973",
"0.5678738",
"0.56724864",
"0.5669865",
"0.56641674",
"0.5664037",
"0.5658301",
"0.56582457",
"0.56580144",
"0.5645405",
"0.564448",
"0.56425256",
"0.56414986",
"0.5639241",
"0.5634784",
"0.5615644",
"0.5604167",
"0.55971974",
"0.55968803",
"0.558145",
"0.55787665"
] | 0.684476 | 10 |
Human readable version of the temporal expression. | def inspect
"the day of the month is the " +
ordinal_list(@days)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_s\n @expression.to_s\n end",
"def inspect\n \"#{time.strftime(\"%Y-%m-%d %H:%M:%S\")} #{period.abbreviation}\"\n end",
"def to_temporal_sexp\n Dumper.dump(self)\n end",
"def tir_f\n format_f(self.tir)\n end",
"def to_s\n return @exp\n end",
"def exp_text\n @exp.to_s\n end",
"def iso8601\n string = 'P'\n day = self.class.new 1, :day\n\n expand.each do |measured|\n string << 'T' if !string.include?('T') && measured < day\n string << measured.humanized_amount\n string << measured.unit.to_s[0, 1].capitalize\n end\n\n string\n end",
"def inspect\n \"#{year}-W#{week}-#{day}\"\n end",
"def describe\n if twilight?\n \"[#{time.capitalize}], day #{day_number}\"\n else\n \"#{time.capitalize}time (day #{day_number})\"\n end\n end",
"def details\n return @description + \"; is set to: \" + \"#{@duration}\" + \"hour - at a cost of: \" + \"#{@cost}\"\n end",
"def readable_inspect\n strftime('%a, %d %b %Y')\n end",
"def describe\n return @magnitude.to_s if magnitude?\n u_descr = Units.units_descr(@units, true)\n \"#{@magnitude} #{u_descr}\"\n end",
"def to_s\n \"#{name} orbital: x^#{ang_moment.l} y^#{ang_moment.m} z^#{ang_moment.n}, #{basis_functions.length} function(s):\\n\" + \n basis_functions.map{|function| \"\\t\\t\" + function.to_s}.join(\",\\n\")\n end",
"def details\n return @description + \": \" +\n @duration.to_s + \" hour for \" +\n @cost.to_s + \" euros.\"\n end",
"def to_s( )\n\t\t\"#@title by #@artist <<#@duration>>\"\n\tend",
"def to_s()\n \"#{@location}-#{@op}@#{@time.iso8601(9)}\"\n end",
"def inspect\n \"#<#{self.class.name} id: #{id}, priority: #{priority}, symbol_first: #{symbol_first}, thousands_separator: #{thousands_separator}, html_entity: #{html_entity}, decimal_mark: #{decimal_mark}, name: #{name}, symbol: #{symbol}, subunit_to_unit: #{subunit_to_unit}, iso_code: #{iso_code}, subunit: #{subunit}>\"\n end",
"def describe\n I18n.l(event_time, format: :short) + ' - ' + event_name\n end",
"def to_s\n return \"#{location} #{purpose} #{hour} #{min} #{day}\"\n end",
"def to_s\n \"#{xnow},#{ynow}\"\n end",
"def to_s\n \"time sig #{@data[0]}/#{2**@data[1]}\"\n end",
"def to_s\n \"Movie: #{@tittle}, #{@genre}, #{@country}, #{@date}, #{@time} min\"\n end",
"def to_s()\n\t\tself.to_chrono()\n\tend",
"def to_s\n\n s = \"\\n\\n==== #{self.class} ====\"\n\n find_expressions.each do |fexp|\n\n s << \"\\n\"\n if fexp.kind_of?(RawExpression)\n s << \"*raw\"\n else\n s << \" \"\n end\n s << fexp.fei.to_s\n end\n s << \"\\n==== . ====\\n\"\n\n s\n end",
"def title \n t = ['Natures']\n t += @period.list_months.to_abbr_with_year \n t << 'Total' \n end",
"def ymmText\n ans = date_of_manufacture\n ans += ' ' + make.name \n\tif model\n \tans += ' ' + model.name\n\tend\n if submodel\n ans += ' ' + submodel.name\n end\n return ans\n end",
"def name\n if active\n expr.descending ? \"#{expr.expression}_desc\" : \"#{expr.expression}_asc\"\n else\n expr.expression\n end.to_s\n end",
"def to_s\n txt = name\n txt += \" (#{self.year})\" if self.year && self.year > 0\n return txt\n end",
"def summary()\n\t\treturn \"#{@name} is a wonderful planet! It is a beautiful #{color} color! #{@name} has a mass of #{mass_kg} kg and is #{distance_from_sun_km} km from the sun. You might be surprised to find that: #{fun_fact}.\"\n\tend",
"def inspect\n \"#<#{self.class}:#{self.object_id}, :year => #{@year}, :month => #{@month}, :day => #{@day} >\"\n end",
"def description()\n return \"#{@name} is a #{@color} colored planet, it has #{@moon_count} moons, and it's #{@distance_from_the_sun} from the Sun. It is #{@robots} that there are robots there, and it is #{@cats} that there are cats there.\"\n end",
"def modeler_description\n return 'This measure uses the EnergyPlus Energy Management System to log and report emissions based on user-provided future and historical years as well as future, historical hourly, and historical annual subregions.'\n end",
"def inspect\n 'Id: ' + @id.to_s +\n ', Expires on: ' + display_expiry_date +\n ', Level: ' + map_number_to_word_level(@level) +\n ', Number of days left to expire: ' + display_num_of_days_left +\n ', Description: ' + @description % self\n end",
"def to_s()\n \"\\#<TimeDuration %s>\" % timestr() ;\n end",
"def to_s\n return \"#{\"%04d\" % @t_year}-#{\"%02d\" % @t_month}-#{\"%02d\" % @t_day} #{\"%02d\" % @t_hour}:#{\"%02d\" % @t_min}:#{\"%02d\" % @t_sec}\"\n end",
"def heading\n \"{{%.2fms}}\" % self.class.times.values.inject(0.0) do |sum, obj|\n sum + obj\n end\n end",
"def get_time\n\t\t@time.inspect\n\tend",
"def inspect\n context = @solution.map{|k, v| \"#{k}: #{v}\"}.join(',')\n \"#<Twilio.Taskrouter.V1.WorkflowRealTimeStatisticsContext #{context}>\"\n end",
"def to_s\n str = \"TimetabledLesson: \"\n str << @schoolday.full_sem_date\n str << \"; \" << @lesson.to_s(:brief)\n str << \"; \" << (@obstacle ? @obstacle.reason : \"nil\")\n str\n end",
"def to_s\n \"[#{date}] #{currency} #{value} - #{description}\"\n end",
"def arrival_time_name\n nice_time(expected_arrival)\n end",
"def inspect\n if @_st_is_gmt\n strftime(\"%a %b %d %H:%M:%S UTC %Y\")\n else\n strftime(\"%a %b %d %H:%M:%S %z %Y\")\n end\n end",
"def summary\n return \"\\nThis planet is called #{@name}. It is #{@color} in color, #{@mass_kg} kilograms in weight, \n and #{@distance_from_sun_km} kilometers from the sun. A fun fact about this planet: #{@fun_fact}.\"\n end",
"def to_s\n operator_string + \" \" + @expression.to_s\n end",
"def modeler_description\n return \"This measure will demonstrate how an OpenStudio measure calling EMS functions can be used to investigate dynamic envelope technologies such as emulating thermochromic window performance using EMS actuators and control types. This measure will replace the construction description of a user-selected window based on the outside surface temperature of that window, evaluated at each timestep\"\n end",
"def time label = nil\n @time = @time || Time.now\n label.to_s + ' (' + ( Time.now - @time ).to_s + ')'\n end",
"def tt(time, format=:short); '13:37'; end",
"def to_s\n \"FiscalYear #{ year }: #{ fd(days.first) } to #{ fd(days.last) }\"\n end",
"def get_verbose_name\n v = get_date_schedule() + ' ' + get_verb_description()\n v = v + self.patient.get_full_name unless self.patient_id.nil? || (self.patient_id == 0)\n v = v + ' ' unless self.notes.blank? || self.patient_id.nil? || self.patient_id == 0\n v = v + self.notes unless self.notes.blank?\n v\n end",
"def name\n meet_on.to_s(:long)\n end",
"def descr_value\n @value.to_s\n end",
"def to_s\n \"[name, symbolicName, realName]: #{@name}, #{@symbolicName}, #{@realName}\"\n end",
"def to_s\n context = @solution.map{|k, v| \"#{k}: #{v}\"}.join(',')\n \"#<Twilio.Taskrouter.V1.WorkflowRealTimeStatisticsContext #{context}>\"\n end",
"def desc\n OrderedExpression.new(@expression, true, :nulls=>@nulls)\n end",
"def to_s\n resolve\n desc.to_s\n end",
"def race_at_display\n \"#{try(:year)}-#{try(:month)}-#{try(:day)} #{post_time}\".to_s\n end",
"def to_s\n context = @solution.map {|k, v| \"#{k}: #{v}\"}.join(',')\n \"#<Twilio.Taskrouter.V1.WorkflowRealTimeStatisticsContext #{context}>\"\n end",
"def to_label\n \"#{time}\"\n end",
"def to_s\n [\n @name.to_s,\n \" - Time Elapsed: #{duration.round(3)}\",\n \" - Started: #{@start_time.strftime('%T')}\",\n \" - Ended: #{@end_time.strftime('%T')}\"\n ].join(\"\\n\")\n end",
"def tt\n autofill I18n.t('.')\n end",
"def info\n @info ||= \"Magnitude #{@magnitude}\\n#{@text}\\n#{@local_time}\"\n end",
"def code\n return \"#{\"%04d\" % @t_year}#{\"%02d\" % @t_month}#{\"%02d\" % @t_day}#{\"%02d\" % @t_hour}#{\"%02d\" % @t_min}#{\"%02d\" % @t_sec}#{\"%05d\" % @t_usec}\"\n end",
"def transaction_summary()\n 'Adjustment ' + adjustment_type\n end",
"def to_s\n return @magnitude.to_s if magnitude?\n u_descr = Units.units_descr(@units)\n \"#{@magnitude}*#{u_descr}\"\n end",
"def now_str() _format_dt DateTime.now, DT_TM end",
"def text_name\n summary.to_s\n end",
"def to_s\n dte = self.date.strftime('%b %d %I:%M %P')\n des = self.description\n loc = self.location\n \"#{dte} #{des} #{loc}\"\n end",
"def inspect\n \"#<#{self.class.name || 'AnonymousClass'} \" + self.class.attribute_names.map do |name|\n val = self.send(name)\n val_display = if val.is_a?(String)\n %Q(\"#{val}\")\n elsif val.nil?\n 'nil'\n elsif val.is_a?(DateTime)\n val.utc.iso8601(3)\n elsif val.is_a?(Enumerable) && val.empty?\n '[]'\n else\n val.to_s\n end\n \"#{name}: #{val_display}\"\n end.join(', ') + '>'\n end",
"def to_s\n \"DGO (Diagnosis output) from #{Time.at(@timestamp).to_s}\"\n end",
"def summary\n self.to_s\n end",
"def summary\n return \"The planet #{@name} is #{@color} in color. It weighs #{@mass_kg} kilograms and is #{@distance_from_sun_km} kilometers from the sun. Fun fact: #{@fun_fact}.\"\n end",
"def inspect\n \"#<#{ self.class.name } equilibrium=#{ '%f' % @equilibrium }>\"\n end",
"def details\n return @description + \": \" + \"#{@extra_cost}\" + \". \" + @basic_tran.details\n end",
"def get_verbose_name\n \"#{season.get_season_type} #{get_pool_type}, #{get_event_type}: #{get_category_type} #{get_gender_type_code} => #{get_timing}\"\n end",
"def name\n return \"New Time Constraint\" if !id\n # Not clear when this field is accesed for an invalid, unsaved TC record.\n key ? (\"time constraint \" + key.name) : \"unattached time constraint\"\n end",
"def x; cat @time.strftime('%x') end",
"def to_s\n descr_value\n end",
"def summary\n return \"Welcome to planet #{name} - #{distance_from_sun_km}km from the sun. We spin a #{color} mass of #{mass_kg}. Did you know, #{name} is [the] #{fun_fact}!\"\n end",
"def get_verbose_name\n \"#{get_meeting_program_verbose_name}: #{rank}) #{athlete_name} (#{year_of_birth}), #{get_timing}\"\n end",
"def time_s\n time_to_s(time)\n end",
"def to_s\n \"#{name} (#{serial}): Worth #{value}, recorded on #{createdAt}\"\n end",
"def print_expression(expression)\n string = ''\n if expression.is_a? Yarpler::Models::Forall\n range = expression.range.to_s\n range=range.tr(\",[]\", '')\n string << \"[#{expression} #{expression.variable} for #{range}]->\" + print_expression(expression.expression)\n elsif expression.is_a? Yarpler::Models::Cardinality\n string << \"[#{expression}]\\n\"\n string << \"[#{expression}]->\" + print_expression(expression.element)\n elsif expression.is_a? Yarpler::Models::Field\n string << \"[#{expression} #{expression.variable}.#{expression.attribute}]\\n\"\n elsif expression.is_a? Yarpler::Models::Literal\n string << \"[#{expression} #{expression.value}]\\n\"\n elsif expression.is_a? Yarpler::Models::Instance\n string << \"[#{expression} #{expression.variable}]\\n\"\n elsif expression.is_a? Yarpler::Models::CountFunction\n string << \"[#{expression}} for #{expression.range.variable}.#{expression.range.attribute} ]\\n\"\n string << \"[#{expression}} for #{expression.range.variable}.#{expression.range.attribute} ]--\" + print_expression(expression.where)\n elsif expression.is_a? Yarpler::Models::SumValueFunction\n string << \"[#{expression}} #{expression.attribute} of #{expression.set.variable}.#{expression.set.attribute} ]\\n\"\n elsif expression.is_a? Yarpler::Models::Expression\n string << \"[#{expression} #{expression.operator}]\\n\"\n string << \"[#{expression} #{expression.operator}]->\" + print_expression(expression.left)\n string << \"[#{expression} #{expression.operator}]->\" + print_expression(expression.right)\n else\n puts expression.class.to_s + ' missing.'\n end\n string\n end",
"def info\n @model + \" \" + @year\n end",
"def to_s\n 'Id: ' + @id.to_s +\n ', Expires on: ' + display_expiry_date +\n ', Level: ' + map_number_to_word_level(@level) +\n ', Number of days left to expire: ' + display_num_of_days_left +\n ', Description: ' + @description % self\n end",
"def inspect\n\t\treturn \"#<%p:%0#x {%d} '%s' (%s): [%s] %s>\" % [\n\t\t\tself.class,\n\t\t\tself.object_id * 2,\n\t\t\tself.synsetid,\n\t\t\tself.words.map(&:to_s).join(', '),\n\t\t\tself.part_of_speech,\n\t\t\tself.lexical_domain,\n\t\t\tself.definition,\n\t\t]\n\tend",
"def get_verbose_name\n # [Steve, 20140725] This is surely excessively long/repetitive too:\n \"#{edition} #{description} #{header_year} - #{get_federation_type} - (#{begin_date ? begin_date.strftime('%Y') : '?'}/#{end_date ? end_date.strftime('%y') : '?'}) \"\n end",
"def to_s\n\t\treturn \"#{name} is #{age} YO!\"\n\tend",
"def getChrono()\n return @data[1].to_s + \"' \" + @data[2].to_s + \"''\"\n end",
"def to_s\n\t\tMonth.month_names[@month-1][0..2] + \" \" + @year.to_s\n\tend",
"def inspect\n \"#<#{self.class}: #@utc_offset,#@std_offset,#@abbreviation>\"\n end",
"def evaluation_detail\n name\n end",
"def inspect\n \"the day of the month is the \" + ordinal_list(@parts)\n end",
"def to_s\n s = @display.strftime(time_format)\n case @display_granularity\n when :ten_minute\n s.chop!\n s << \"~\"\n when :one_hour\n s.chop!\n s.chop!\n s << \"~~\"\n end\n return s\n end",
"def GetCurrentFormattedTimeForDiagLogs()\n Time.now.utc.strftime(\"%Y-%m-%dT%H:%M:%S.%6NZ\")\n end",
"def GetCurrentFormattedTimeForDiagLogs()\n Time.now.utc.strftime(\"%Y-%m-%dT%H:%M:%S.%6NZ\")\n end",
"def to_expr\n return @signal.to_expr\n end",
"def t(column)\n object.class.human_attribute_name(column.to_sym)\n end",
"def to_s(reference_note=Note.new(c4, 4))\n [ times_segment,\n fraction,\n tuplet_opening_tag,\n tuplet_contents(reference_note),\n tuplet_closing_tag\n ].join(\" \")\n end",
"def briefing\n \"#{date.min} #{date.hour} #{date.day} #{date.month} 0 #{ab_command}\"\n end",
"def to_s\n \"SAR (Signal Analysis Results) from %s\\n\" % Time.at(@timestamp).to_s\n end",
"def to_s\n\t\t\treturn \"name: #{name}; start: #{@start_time}; end: #{@end_time};\"\n\t\tend"
] | [
"0.6368355",
"0.63165367",
"0.631618",
"0.6250106",
"0.61675483",
"0.6109238",
"0.60927266",
"0.6077167",
"0.59858847",
"0.59774345",
"0.59648234",
"0.5896879",
"0.5882015",
"0.5861977",
"0.5860485",
"0.58481055",
"0.5821307",
"0.5814742",
"0.5814547",
"0.58117825",
"0.58005065",
"0.57802725",
"0.5758012",
"0.5753935",
"0.5749269",
"0.57486415",
"0.57244015",
"0.5724396",
"0.5719083",
"0.5709462",
"0.566899",
"0.56666106",
"0.5664181",
"0.5664118",
"0.5663747",
"0.5658264",
"0.5652529",
"0.5650837",
"0.5640164",
"0.56379944",
"0.56176054",
"0.56168956",
"0.5605606",
"0.55949265",
"0.5588863",
"0.55419284",
"0.5541924",
"0.5535949",
"0.5533632",
"0.55259174",
"0.55241483",
"0.5519075",
"0.5512094",
"0.55070454",
"0.54867446",
"0.5484477",
"0.54819155",
"0.54803103",
"0.5479562",
"0.54789186",
"0.5478202",
"0.54700875",
"0.54678226",
"0.54613125",
"0.5455538",
"0.54550797",
"0.54504746",
"0.544428",
"0.5438333",
"0.5436321",
"0.54355305",
"0.54353666",
"0.5433197",
"0.5428042",
"0.5419397",
"0.54133517",
"0.54084533",
"0.5397441",
"0.53894573",
"0.53819686",
"0.5376871",
"0.537675",
"0.5374486",
"0.53714556",
"0.5368023",
"0.536797",
"0.5366791",
"0.53635037",
"0.53605056",
"0.5353669",
"0.53512055",
"0.5351192",
"0.5350605",
"0.5349013",
"0.5349013",
"0.53475463",
"0.53451866",
"0.5341936",
"0.5341335",
"0.5335492",
"0.53347766"
] | 0.0 | -1 |
Encode the temporal expression into +codes+. | def encode(codes)
encode_list(codes, @days)
codes << encoding_token
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def encode(codes)\n encode_list(codes, @years)\n codes << encoding_token\n end",
"def encode(codes)\n encode_list(codes, @weeks)\n codes << encoding_token\n end",
"def encode\n @code = \"\"\n add_check_digit_and_ensure_even_digit_size\n 0.step(@encodable.size - 1, 2) do |i|\n first = SYMBOLOGY[@encodable[i]]\n second = SYMBOLOGY[@encodable[i+1]]\n @code += 0.upto(4).map { |j| first[j] + second[j] }.join\n end \n @code = SYMBOLOGY[:start] + @code + SYMBOLOGY[:stop]\n self\n end",
"def to_code\n \"(#{@x.map(&:to_code).join(\" + \")})\"\n end",
"def to_code\n \"(#{@x.map(&:to_code).join(\" * \")})\"\n end",
"def encode_with(coder); end",
"def code(*codes); end",
"def code(*codes); end",
"def to_code\n \"#{@x}\"\n end",
"def encode encoder, options = {}\n if encoder.respond_to? :to_sym\n CodeRay.encode(input, lang, encoder, options)\n else\n encoder.encode_tokens tokens, options\n end\n end",
"def codify(txt)\n enclose('code', txt)\n end",
"def encode\n transform :encode \n end",
"def encode(code, options = T.unsafe(nil)); end",
"def to_code\n \"(#{@x.to_code} ** #{@y.to_code})\"\n end",
"def encode_with(coder)\n vars = instance_variables.map { |x| x.to_s }\n no_emit = Configurizer::Configuration._no_emit_vars.reject { |x| x.nil? or x.empty? }\n no_emit = no_emit | [\"_no_emit_vars\"]\n\n vars = vars - no_emit.collect { |x| \"@\" + x }\n\n vars.each do |var|\n var_val = eval(var)\n coder[var.gsub('@', '')] = var_val\n end\n end",
"def to_code\n \"(-#{@x.to_code})\"\n end",
"def array_to_code(arr)\n code = ''\n arr.each_with_index do |part, i|\n code << ' + ' if i > 0\n case part\n when Symbol\n code << part.to_s\n when String\n code << %{\"#{part}\"}\n else\n raise \"Don't know how to compile array part: #{part.class} [#{i}]\"\n end\n end\n code\n end",
"def encode\n type_byte + encode_data\n end",
"def encode_with(coder)\n coder.scalar = @source\n end",
"def code\n return \"#{\"%04d\" % @t_year}#{\"%02d\" % @t_month}#{\"%02d\" % @t_day}#{\"%02d\" % @t_hour}#{\"%02d\" % @t_min}#{\"%02d\" % @t_sec}#{\"%05d\" % @t_usec}\"\n end",
"def encode\n s = \"#{punpack_string(@ts)}#{punpack_string(@ls)}\"\n [@type, @length, @value].pack(\"#{s}a*\")\n end",
"def base_encode(digits)\n return digits unless @code\n digits.map do |i|\n case i\n when '-', DOT, DIV\n i\n else\n code[i]\n end\n end\n end",
"def encode(*); self; end",
"def encode(codes)\n codes << \"<MyExt::never>\"\n end",
"def coder; end",
"def encode(code, lang, options = T.unsafe(nil)); end",
"def encode_event(exi_event)\n end",
"def encode_code( str, rs )\n\t\t\t#str.gsub( %r{&}, '&' ).\n\t\t\t\t#gsub( %r{<}, '<' ).\n\t\t\t\t#gsub( %r{>}, '>' ).\n\t\t\t\t#gsub( CodeEscapeRegexp ) {|match| EscapeTable[match][:md5]}\n return str\n\t\tend",
"def encode(string, symbols = WHITESPACE)\n bits_per_symbol = (Math.log(symbols.length) / Math.log(2)).floor\n result = ''\n reg = %r{#{'.?' * bits_per_symbol}}\n string.unpack('B*')[0].scan(reg) do | bits |\n result << symbols[bits.to_i(2)]\n end\n result\n end",
"def encode(code, lang, format, options = T.unsafe(nil)); end",
"def code\n # create an Array to collect all fields\n fields = [@trajectory, @eye, @target, @up, @params].map {|f| f.to_s}\n # create code by trajectory and azcode of fields\n return \"#{@trajectory.upcase}-#{azcode(fields)}\"\n end",
"def encode_edata\n s = Metasm::Shellcode.assemble @@cpu, self\n s.encoded\n end",
"def encode_string; end",
"def encode(object)\n engine.encode(object)\n end",
"def emit_code value\n statement :code, value\n end",
"def encode(text); end",
"def encode(text); end",
"def encoder; end",
"def encoder; end",
"def to_code\n \"(#{@x.to_code} - #{@y.to_code})\"\n end",
"def encode_value(value)\n case value\n when Time\n value.to_i\n else\n value\n end\n end",
"def encode\n # no op\n end",
"def exp_code(date, kind)\n _date = date.delete(\"-/\")\n return \"%s%s\" % [ _date[5,1], _date[2,2] ] if kind.nil?\n case kind[0,1].upcase\n when \"C\": return \"%s%s\" % [ CALL_CODES[_date[4,2].to_i], _date[2,2] ]\n when \"P\": return \"%s%s\" % [ PUT_CODES[_date[4,2].to_i], _date[2,2] ]\n when \"F\": return \"%s%s\" % [ FUT_CODES[_date[4,2].to_i], _date[2,2] ]\n else\n return \"%s%s\" % [ _date[5,1], _date[2,2] ]\n end\n end",
"def encode(string); end",
"def encode_tokens(tokens, options = T.unsafe(nil)); end",
"def build_code(tree, ch_arr, invert)\n\tcode_table = Hash.new\n\tif(invert == 0)\n\t\tch_arr.each { |key, value|\n\t\t\tcode = encode(tree, key)\n\t\t\tcode_table[key] = code\n\t\t}\n\telsif(invert==1)\n\t\tch_arr.each { |key, value|\n\t\t\tcode = encode(tree, key)\n\t\t\tcode_table[code] = key\n\t\t}\n\tend\n\treturn code_table\nend",
"def encode\n raise NotImplementedError\n end",
"def encode!; end",
"def encode\n index = e_byte(@idx)\n e_byte(NEW_CACHE)+index+@value.encode\n end",
"def encode\n s = \"#{@value}\\000\"\n\n n = 0\n @lengths.each do |l|\n s << [@types[n]].pack(\"#{punpack_string(l)}\")\n n += 1\n end\n s\n end",
"def to_code\n if @sexp\n \"/*:#{@sexp.line}:#{@sexp.column}*/#{@code}\"\n else\n @code\n end\n end",
"def code(a_code)\n\t\ta_code\n\tend",
"def register_codes\n @register_codes ||= @registers.inject({}) do |memo, (_, r)|\n memo[r.opcode] = r\n memo\n end\n end",
"def encode\n @word.chars.map do |letter|\n index = @abc.index(letter) \n @abc_reverse[index]\n end.join\n \n end",
"def encode_tokens(tokens, format, options = T.unsafe(nil)); end",
"def operation\n encode_tz(:o, 32)\n end",
"def encodeing(array)\n i = 0\n freq = 0\n value = 0\n encoding = []\n while i < array.length\n freq = array[i]\n value = array[i + 1]\n freq.times { encoding << value }\n i += 2\n end\n encoding\nend",
"def encode_traces(traces)\n to_send = []\n traces.each do |trace|\n to_send << trace.map(&:to_hash)\n end\n encode(to_send)\n end",
"def encode_file\n # open 'orginal' to read from\n # fr = File.open(\"#{original_datei}\", 'r') dann muss die Datei explizit geschlossen werden\n File.open(\"#{original_datei}\", 'r') {|fr|\n # create 'encoded' to write to\n File.open(\"encoded_#{original_datei}\",'w') { |fw|\n # encode each letter and then write to 'encoded'\n fr.each_byte{|byte|\n fw << encode(byte).chr\n }\n }\n }\n end",
"def encode_char(immune, input)\n input\n end",
"def encode_time(value)\n encode_uint64(value.to_i)\n end",
"def to_code\n \"Math::tan(#{@x.to_code})\"\n end",
"def string=(code); end",
"def encode_entity(entity)\n Yajl::Encoder.encode(entity)\n end",
"def add_expression_result_escaped(code)\n with_buffer{@src << ' << ' << @escapefunc << '((' << code << '))'}\n end",
"def encode(tokens)\n return nil if tokens.nil?\n tokens = [tokens] unless tokens.is_a?(Array)\n\n # TODO: tokens need to be unique (duplicates need to remain at the end), remember\n # the order from left to right is oldest to newest - any duplicates should always be newest\n # (i.e. if we 'track' a user using the same token on the same day 2x - the second visit's position\n # should be meaningful) -- i.e. order of tracking => A, F, B, F, C should encode as A|B|F|C, NOT A|F|B|C\n tokens.map{|t| encode_token(t) }.join(config.separator)\n end",
"def to_s\n @code.to_s\n end",
"def emit(code)\n @code << code\n end",
"def emit(code)\n @code << code\n end",
"def emit(code)\n @code << code\n end",
"def timecodes\n return [] if start_time.nil?\n start_hour = start_time.strftime(\"%H\")\n start_min = start_time.strftime(\"%M\").to_i < 30 ? \"00\" : \"30\"\n curr_time = Time.parse(\"#{start_hour}:#{start_min}\")\n timecode_array = []\n while curr_time < Time.parse(\"#{end_time.strftime(\"%H\")}:#{end_time.strftime(\"%M\")}\") - 1.second\n timecode_array << \"#{curr_time.strftime(\"%H\").to_i}:#{curr_time.strftime(\"%M\")}\"\n curr_time = curr_time + 30.minutes\n end\n timecode_array_with_days = []\n %w(monday tuesday wednesday thursday friday saturday sunday).each do |day|\n timecode_array_with_days << timecode_array.collect{|t| \"#{t}_#{day}\"}.flatten if read_attribute(day)\n end\n timecode_array_with_days.flatten\n end",
"def to_s\n code.to_s\n end",
"def encode_time(time) #:nodoc:\n time.utc.strftime(\"%FT%TZ\")\n end",
"def dec2code dec\n out = ''\n while (dec>0)\n out << SYMBOLS[dec % SYMBOLS_LENGTH]\n dec = dec / SYMBOLS_LENGTH\n end\n out\n end",
"def encode(x, y, tool)\n (x << X_OFFSET) | (y << Y_OFFSET) | tool\nend",
"def encode_tokens tokens, options = {}\n options = @options.merge options\n @scanner = tokens.scanner if tokens.respond_to? :scanner\n setup options\n compile tokens, options\n finish options\n end",
"def encode\n ret = [ id & 0xff, id >> 8, data_type ]\n ret << Zigbee::ZCL::DataType.class_for(data_type).new(value).encode_data\n ret.flatten\n end",
"def to_code\n \"Math::sin(#{@x.to_code})\"\n end",
"def encode_string_ex; end",
"def encoder=(_arg0); end",
"def encode!(*); self; end",
"def encode(value)\n value.to_s(BASE)\n end",
"def to_ics\n encoded_value = self.class.type.encode(value)\n \"#{name}#{separator}#{encoded_value}\"\n end",
"def compile_to_c\n operator_c_string + \"(\" + @expression.compile_to_c + \")\"\n end",
"def translation_codes(preferred_code_sets)\n tx_codes = []\n codes.each_pair do |code_set, code_list|\n code_list.each do |code|\n tx_codes << {'code' => code, 'code_set' => code_set}\n end\n end\n\n tx_codes - [preferred_code(preferred_code_sets)]\n end",
"def encode\n ed = encode_edata\n if not ed.reloc.empty?\n puts 'W: encoded string has unresolved relocations: ' + ed.reloc.map { |o, r| r.target.inspect }.join(', ')\n end\n ed.fill\n ed.data\n end",
"def to_s\r\n code \r\n end",
"def encode_char(immune,input)\n return input if immune.include?(input)\n return input if hex(input).nil?\n return \"#{@escape_char}#{input}\"\n end",
"def encode( tokens, outputstream)\n #Helper method on outputstream to write single bits\n class << outputstream\n def init\n @byte = 0\n @bit_count = 0\n end\n def write_bit( bit)\n @byte += bit\n @bit_count += 1\n if 8 == @bit_count\n write( @byte.chr)\n init\n else\n @byte <<= 1\n end\n end\n def fill_up\n if 0 < @bit_count\n (8 - @bit_count).times { write_bit( 0) }\n end\n end\n end\n \n token_to_code = {}\n each{ |code, token| token_to_code[token] = code}\n \n if tokens.include?( TERMINATOR)\n warn \"Input contains the end-token. Results will be incorrect!\"\n end\n \n outputstream.init\n (tokens.dup << TERMINATOR).each do |token|\n #Not going for the extra credit: I don't encode by walking the tree\n code = token_to_code[token]\n raise ArgumentError.new( \"Token #{token.inspect} not found in tree\") unless code\n code.each{ |bit| outputstream.write_bit( bit) }\n end\n outputstream.fill_up\n end",
"def code(*jsstmts)\n if jsstmts.length == 0\n _code\n else\n # the JS statements passed in should have already been marshalled.\n # consequently, there should only be Strings containing JS code.\n # however, call .to_s() on each just in case any JsValue objects\n # were passed in.\n _code.concat jsstmts.map { |js| js.to_s + COLON_NL }\n self\n end\n end",
"def to_code(cc, out)\n\t\t\traise InternalError.new(\"#{self.class.name}: to_code not implemented\")\n\t\tend",
"def encode_entities(*instructions)\n return HTMLEntities.encode_entities(self, *instructions)\n end",
"def translation_codes(preferred_code_sets,value_set_map=nil)\n tx_codes = []\n matching_codes = value_set_map ? codes_in_code_set(value_set_map) : codes\n matching_codes.each_pair do |code_set, code_list|\n code_list.each do |code|\n tx_codes << {'code' => code, 'code_set' => code_set}\n end\n end\n\n tx_codes - [preferred_code(preferred_code_sets, :codes, value_set_map)]\n end",
"def write_bytecode(value)\n write_bytecode_to(value, @temp_bytecode)\n end",
"def encode i\n return @sequence[0,1] if i == 0\n s = ''\n while i > 0\n s << @sequence[i.modulo(@base)]\n i /= @base\n end\n s.reverse\n end",
"def codes\n [@attrs['Code'], @attrs['StationTogether1'], @attrs['StationTogether2']].compact\n end",
"def to_code\n \"Math::atan(#{@x.to_code})\"\n end",
"def encoder(reverse_newspy)\n\n vowels = %w[ a e i o u ]\n consonants = %w[ b c d f g h j k l m n p q r s t v w x y z ]\n\n split_reverse_newspy = reverse_newspy.downcase.split(//)\n\n encoded_name = split_reverse_newspy.map do |character|\n if vowels.include?(character)\n vowels.rotate(1)[vowels.index(character)]\n elsif consonants.include?(character)\n consonants.rotate(1)[consonants.index(character)]\n elsif character == \"u\"\n character = \"a\"\n elseif character == \"z\"\n character = \"b\"\n else character = \" \"\n end\n end\n p encoded_name.join\n end",
"def expressions_from_iseq(bytecodes, locals)\n bytecodes.reduce([]) do |stack, inst|\n puts \"INST: #{inst}\"\n # annoyingly, labels have have their own format\n # UGGGGLY, TODO: refactor\n if inst.is_a?(Symbol) && inst.to_s =~ /^label/\n if ih = self.half_pop_if(inst, stack)\n stack << ih\n elsif iff = self.pop_if(inst, stack)\n stack << iff \n else \n stack << Label.new(inst)\n end\n\n next stack\n elsif inst.is_a?(Fixnum)\n # TODO: What's with the plain numbers?\n next stack\n end\n\n case inst[0]\n # TODO\n when :throw \n # TODO?\n when :trace, :pop, :putnil, :leave\n \n when :branchunless\n test = stack.pop\n if_hole = IfHole.new(test, inst[1], nil, nil, nil)\n stack << if_hole\n when :branchif\n stack << self.pop_while(inst, stack)\n when :jump\n stack << Jump.new(inst[1])\n\n when :putobject_OP_INT2FIX_O_0_C_ \n stack << Literal.new(0)\n when :putobject_OP_INT2FIX_O_1_C_ \n stack << Literal.new(1)\n when :putobject\n stack << Literal.new(inst[1])\n when :putstring\n stack << Literal.new(inst[1])\n when :putself\n stack << Self.new\n when :newarray\n stack << self.pop_array(inst[1], stack)\n when :duparrray\n stack << ArrayLiteral.new(inst[1].map{ |v| Literal.new(v)})\n\n when :getlocal\n stack << self.get_local(inst[2], inst[1])\n when :getlocal_OP__WC__1\n stack << self.get_local(1, inst[1])\n when :getlocal_OP__WC__0\n stack << self.get_local(0, inst[1])\n\n when :setlocal\n stack << self.pop_assignment(inst[2], inst[1], stack)\n when :setlocal_OP__WC__1\n stack << self.pop_assignment(1, inst[1], stack)\n when :setlocal_OP__WC__0\n stack << self.pop_assignment(0, inst[1], stack)\n\n when :send\n stack << self.pop_expression(inst[1], stack)\n when :opt_send_simple\n stack << self.pop_expression(inst[1], stack)\n when :opt_lt\n stack << self.pop_expression(inst[1], stack)\n when :opt_le\n stack << self.pop_expression(inst[1], stack)\n when :opt_plus\n stack << self.pop_expression(inst[1], stack)\n # TODO: The other opts and sends\n else\n puts \"UNKNOWN\"\n end\n\n stack\n end\n end",
"def encode(_)\n raise NotImplementedError\n end"
] | [
"0.6798391",
"0.67676747",
"0.6424279",
"0.6258846",
"0.6153673",
"0.6051423",
"0.5778526",
"0.5778526",
"0.5729366",
"0.5700355",
"0.56043607",
"0.56033397",
"0.5588766",
"0.5533201",
"0.5488222",
"0.5450914",
"0.5442591",
"0.5410525",
"0.53952473",
"0.5386026",
"0.53570044",
"0.5338277",
"0.5299384",
"0.52929306",
"0.52866024",
"0.5248667",
"0.52172893",
"0.5215736",
"0.52123475",
"0.5205639",
"0.51708895",
"0.51682425",
"0.51490986",
"0.5148381",
"0.51339954",
"0.51300186",
"0.51300186",
"0.51212406",
"0.51212406",
"0.51158065",
"0.51110727",
"0.5098089",
"0.5085529",
"0.5071961",
"0.5070873",
"0.50707495",
"0.5057976",
"0.5050319",
"0.504056",
"0.5036315",
"0.5020421",
"0.5017513",
"0.50144774",
"0.5009898",
"0.5006756",
"0.5002436",
"0.4999781",
"0.49867177",
"0.4982287",
"0.49732006",
"0.4965518",
"0.49627486",
"0.4960981",
"0.49585629",
"0.49579665",
"0.49561223",
"0.49490422",
"0.49453694",
"0.49453694",
"0.49453694",
"0.4938207",
"0.49228135",
"0.49223587",
"0.4908205",
"0.4905966",
"0.48990995",
"0.48854086",
"0.48840675",
"0.48832193",
"0.48742354",
"0.48737666",
"0.48520994",
"0.4837864",
"0.48287228",
"0.48248848",
"0.4823971",
"0.48220834",
"0.48108286",
"0.48081914",
"0.47985834",
"0.479427",
"0.47910285",
"0.47902477",
"0.47843218",
"0.47772554",
"0.47657785",
"0.47637767",
"0.47620982",
"0.47500882",
"0.47457612"
] | 0.73046476 | 0 |
POST /sessions POST /sessions.json | def create
user=ApiM8::Client::Account::Users.instance.login(params[:login], params[:password])
puts user.current_user
if user
session[:current_user_id]=user.id
redirect_to role_super_admin_dashboards_url, :notice => "Logged in as #{params[:login]}!"
else
flash[:danger] = 'Invalid email/password combination' # Not quite right!
render "new"
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @session = SessionService.new(current_user).create_from_web! session_params\n\n respond_to do |format|\n format.html { redirect_to @session, notice: 'Session was successfully created.' }\n format.json { render json: @session, status: :created }\n end\n end",
"def post_params(path, params, session)\n post path, params, {\"rack.session\" => {\"uid\" => session['uid']}}\n end",
"def create\n @session = @event.sessions.new(params[:session])\n\n respond_to do |format|\n if @session.save\n format.html { redirect_to [@event, @session], notice: 'Session was successfully created.' }\n format.json { render json: [@event, @session], status: :created, location: [@event, @session] }\n else\n format.html { render action: \"new\" }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @session = Session.new(session_params)\n\n respond_to do |format|\n if @session.save\n format.html { redirect_to @session }\n format.json { render :show, status: :created, location: @session }\n else\n format.html { render :new }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @session_resource = SessionResource.new(session_resource_params)\n\n if @session_resource.save\n render json: @session_resource, status: :created, location: @session_resource\n else\n render json: @session_resource.errors, status: :unprocessable_entity\n end\n end",
"def create\n @current_session = CurrentSession.new(params[:current_session])\n\n if @current_session.save\n render json: @current_session, status: :created, location: @current_session\n else\n render json: @current_session.errors, status: :unprocessable_entity\n end\n end",
"def create\n @session = Session.new(session_params)\n\n respond_to do |format|\n if @session.save\n reset_session\n session[:user_id] = @session.user.id\n format.html { redirect_to root_path, notice: 'Login success!' }\n format.json { render :show, status: :created, location: @session }\n else\n format.html { render :new }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def store_session(res)\n res.set_cookie('_req_room_session', path: '/', value: data.to_json)\n end",
"def create\n # respond_to do |format|\n # if @user_session.save\n # format.html { redirect_to @user_session, notice: 'User session was successfully created.' }\n # format.json { render action: 'show', status: :created, location: @user_session }\n # else\n # format.html { render action: 'new' }\n # format.json { render json: @user_session.errors, status: :unprocessable_entity }\n # end\n # end\n\n #binding.pry\n user = User.get_user(user_session_params[:username], user_session_params[:password])\n if user != nil\n session = UserSession.login(user)\n response = {\n html: '',\n json: { username: user.username, token: session.key, status: 200 }\n }\n end\n respond_to do |format|\n if user != nil\n cookies[:auth] = {\n value: response[:json],\n expires: 1.year.from_now\n }\n format.html { render text: response[:html] }\n format.json { render json: response[:json] }\n else\n format.html { render text: '', status: :unauthorized }\n format.json { render text: '', status: :unauthorized }\n end\n end\n\n\n end",
"def create\n @session = Session.new(session_params)\n authorize @session\n\n respond_to do |format|\n if @session.save\n format.html { redirect_to @session, notice: 'Session was successfully created.' }\n format.json { render :show, status: :created, location: @session }\n else\n format.html { render :new }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_smite_api_session\n session_timestamp = Time.now.getutc.strftime(\"%Y%m%d%H%M%S\")\n session_string = \"#{ENV['SMITE_API_DEV_ID']}\" + 'createsession' + \"#{ENV['SMITE_API_AUTHKEY']}\" + session_timestamp\n session_signature = Digest::MD5.hexdigest(session_string)\n\n smite_session = RestClient.get(\"#{SMITE_PC_URL}/createsessionJson/#{ENV['SMITE_API_DEV_ID']}/#{session_signature}/#{session_timestamp}\")\n JSON.parse(smite_session)['session_id']\nend",
"def create\n @session = ::Session.authenticate(session_params)\n\n if @session.save\n render :show, status: :created, location: @session\n else\n render json: @session.errors, status: :unprocessable_entity\n end\n end",
"def create\n @user_session = UserSession.new(params[:user_session])\n\n respond_to do |format|\n if @user_session.save\n format.html { redirect_to(:home, :notice => 'Login successful.') }\n format.json { render :json => @user_session, :status => :created, :location => @user_session }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @user_session.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def get_session(options = {})\n resp = @connection.post do |req|\n req.headers = { :Accept => 'application/json'}\n req.url 'v1/sessions'\n req.body = options.to_json\n end\n check_response_for_errors resp.body\n end",
"def get_session\n session = Session.create!(key: Random.rand(0xFFFFFFFF).to_s)\n render json: { id: session.id, key: session.key }\n end",
"def generateSession\n sessionId = SecureRandom.base58(24)\n @test.update(session_id: sessionId)\n\n # set expiry date to 15 minutes from now\n @test.update(session_expired_at: Time.now + 15*60)\n\n render json: sessionId\n end",
"def create\n return if Settings.readonly \n\n @session = Session.new(session_params)\n\n respond_to do |format|\n if @session.save\n format.html { redirect_to sessions_url, notice: 'Session was successfully created.' }\n format.json { render :show, status: :created, location: @session }\n else\n format.html { render :new }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n \n # remove any existing session of this user\n # TODO: update custom validations in model to work with this\n @session = Session.where(\"sender_id = #{session_params[:sender_id]} OR recipient_id = #{session_params[:sender_id]}\").first\n @session.destroy if @session\n \n @session = Session.new(session_params)\n \n if @session.valid?\n @session.session_id = Session.createSession(request.remote_addr).to_s\n @session.sender_token = Session.generateToken(@session.session_id, @session.sender.id.to_s)\n @session.recipient_token = Session.generateToken(@session.session_id, @session.recipient.id.to_s)\n end\n\n respond_to do |format|\n if @session.save\n format.html { redirect_to @session, notice: 'Session was successfully created.' }\n format.json { render action: 'show', status: :created, location: @session }\n else\n format.html { render action: 'new' }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def start_session(nick)\n usr = User.first(:nickname=>params[:nickname])\n p User.all\n if usr != nil\n sid = gen_sessionid\n\n #associate nick with sid & IP & communication password\n $sessions[nick] = {:ip=>@env['REMOTE_ADDR'], :sid=> sid, :lastrequest=> Time.now.to_i}\n\n #return JSON with sessionid\n return {:sid => sid}\n end\n return 'error'\nend",
"def create\n @session = Session.new(session_params)\n @session.created_by = current_user.id\n\n respond_to do |format|\n if @session.save\n format.html { redirect_to game_session_path(@session), notice: 'Session was successfully created.' }\n format.json { render action: 'show', status: :created, location: @session }\n else\n format.html { render action: 'new' }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @user_session = UserSession.new(params[:user_session])\n\n respond_to do |format|\n if @user_session.save\n format.html { redirect_to :back, :notice => \"You have successfully logged in\" }\n format.json { render json: @user_session, status: :created, location: @user_session }\n else\n format.html { redirect_to :back, :error => \"Your email or password is incorrect\" }\n format.json { render json: @user_session.errors, status: :unauthorized }\n end\n end\n end",
"def create\n @ykt_session = YktSession.new(params[:ykt_session])\n\n respond_to do |format|\n if @ykt_session.save\n format.html { redirect_to @ykt_session, notice: 'Ykt session was successfully created.' }\n format.json { render json: @ykt_session, status: :created, location: @ykt_session }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ykt_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n if Rails.env == 'development'\n Rails.logger.debug \"Cookies:\\n\" + cookies.to_yaml\n Rails.logger.debug \"Session:\\n\" + session.to_yaml\n end\n \n @user_session = UserSession.new(params[:user_session])\n\n respond_to do |format|\n if @user_session.save\n @user_session.user.reset_appearance!\n \n # Make sure any stale forum logins are cleared\n cookies[\"Vanilla\"] = {:value => \"\", :domain => \".worlize.com\"}\n cookies[\"Vanilla-Volatile\"] = {:value => \"\", :domain => \".worlize.com\"}\n\n # default_url = enter_room_url(@user_session.user.worlds.first.rooms.first.guid)\n default_url = enter_room_url(Room.gate_room_guid)\n\n format.html { redirect_back_or_default(default_url) }\n format.json do\n render :json => {\n :success => true,\n :redirect_to => get_redirect_back_or_default_url(default_url)\n }\n end\n else\n format.html { render :action => \"new\" }\n format.json do\n render :json => {\n :success => false\n }\n end\n end\n end\n end",
"def write_session(env, sid, session, options); end",
"def login(email, password)\n post api_v1_user_session_path, \n headers: { 'CONTENT_TYPE' => 'application/json', 'ACCEPT' => 'application/json' },\n params: { email: email, password: password }.to_json\nend",
"def store_session(res)\n end",
"def check_session\n data = { :account => Encryptor.encrypt({:id => id, :phone => phone, :password => password}.to_json, :key => $secret_key) }\n\n response = RestClient.post \"#{$service_url}/api/account/check_session\", data, { :content_type => :json, :accept => :json }\n\n JSON.parse(response)\n rescue => error\n { :session => false }\n end",
"def create\n return unless restrict_to_hosts\n\n @session = @event.sessions.new(session_params)\n\n respond_to do |format|\n if @session.save\n format.html { redirect_to [@event, @session], notice: 'Session was successfully created.' }\n format.json { render :show, status: :created, location: [@event, @session] }\n else\n format.html { render :new }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def save_session(session)\n \n end",
"def create\n session = Session.new\n session.name = params[:name]\n session.description = params[:description]\n session.start_time = params[:date]\n # TODO: need date\n # TODO: need topic\n session.active = true;\n # add ot_session.id\n ot_session = @@opentok.create_session({media_mode: :routed})\n session.session_id = ot_session.session_id\n # try and save the session\n saved = session.save\n # add moderators\n params[:moderators].each do |moderator|\n SessionUser.create(session_id: session.id, user_id: moderator[:id], role: 'moderator', center_stage: true)\n end\n # add subscribers\n params[:subscribers].each do |subscriber|\n puts subscriber\n SessionUser.create(session_id: session.id, user_id: subscriber[:id], role: 'publisher', center_stage: false)\n end\n if saved\n render json: {message: \"Event: #{session.name} successfully added\"}, status: 200\n else\n render json: {errors: session.errors.to_json}, status: 500\n end\n end",
"def create\n @user_session = UserSession.new(params[:user_session])\n\n if @user_session.save\n respond_to do |format|\n format.html { redirect_back_or }\n format.json { render json: @user_session, status: :created, location: @user_session }\n end \n else\n render :layout => false\n end\n \n end",
"def store_session(res)\n res.set_cookie(@cookie.to_json)\n debugger\n end",
"def create\n @user = User.new(user_params)\n @user.save!\n render json: @user, serializer: V1::SessionSerializer\n rescue StandardError => e\n render json: { error: e.message }, status: :unprocessable_entity\n end",
"def create\n @session = Session.new(params[:session])\n @session.start=Time.now\n @session.cabin.vacant=false\n @session.cabin.save\n\n respond_to do |format|\n if @session.save\n format.html { redirect_to @session, notice: 'Session was successfully created.' }\n format.json { render json: @session, status: :created, location: @session }\n else\n format.html { render action: \"new\" }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @yoga_session = YogaSession.new(params[:yoga_session])\n\n respond_to do |format|\n if @yoga_session.save\n format.html { redirect_to @yoga_session, notice: 'Yoga session was successfully created.' }\n format.json { render json: @yoga_session, status: :created, location: @yoga_session }\n else\n format.html { render action: \"new\" }\n format.json { render json: @yoga_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create value=nil\n # TODO: only certain keys are recognised in a session create request,\n # should raise an error on others.\n raw = @conn.put do |req|\n req.url \"/v1/session/create\"\n req.body = (if value.kind_of?(String) then value else JSON.generate(value) end) unless value.nil?\n end\n body = JSON.parse(raw.body)\n return body[\"ID\"]\n end",
"def create\n @session = FitnessSession.create(session_params)\n if @session.type_session_id == 1\n CyclingSession.create(:fitness_session_id =>@session.id)\n elsif @session.type_session_id == 2\n WeightLiftingSession.create(:fitness_session_id =>@session.id)\n else\n JoggingSession.create(:fitness_session_id =>@session.id)\n end\n\n #respond_to do |format|\n if @session.save\n redirect_to '/fitness_sessions/',notice: \"\"\n #format.html { redirect_to @session, notice: 'Session was successfully created.' }\n #format.json { render :show, status: :created, location: @session }\n else\n #format.html { render :new }\n redirect_to '/fitness_sessions/',notice: \"\"\n #format.json { render json: @session.errors, status: :unprocessable_entity }\n #end\n end\n end",
"def create\n @client = current_client\n @session = @client.session\n debug { \"SessionsController#create - #{@session.inspect}\"}\n raise \"ResourceOwner from token != session.owner\" if doorkeeper_token.resource_owner_id != @session.owner.id\n\n @client.update_attributes!(client_params)\n render json: @client, status: :created, serializer: Sso::ClientSerializer\n end",
"def create\n @session = Session.new(params[:session].merge(conference: active_conference))\n\n respond_to do |format|\n if @session.save\n format.html { redirect_to @session, notice: 'Session was successfully created.' }\n format.json { render json: @session, status: :created, location: @session }\n else\n format.html { render action: \"new\" }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def login\n user = User.last\n login!(user)\n ses = session[:session_token]\n render json: {\"ses\": ses}\n end",
"def create\n flybuys_number = params[:session][:flybuys_number]\n\n @session = Session.new(\n flybuys_number: flybuys_number,\n password: params[:session][:password],\n )\n\n validate_login = ValidateLogin.new(@session)\n\n respond_to do |format|\n if validate_login.call\n session[:flybuys_number] = flybuys_number\n\n format.html { redirect_to root_path, notice: 'Login successful' }\n format.json { render :show, status: :created, location: @session }\n else\n format.html { render :new, notice: 'Invaild login' }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def start_session\n render json: @student, serializer: StudentSerializerSession\n end",
"def sessions=(value)\n @sessions = value\n end",
"def index\n @sessions = @event.sessions\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sessions }\n end\n end",
"def create\n params[:game_session][:passcode] = generate_token\n @game_session = GameSession.new(game_session_params)\n\n Rails.logger.info \"Session Create - Players \" + @game_session.number_of_players.to_s\n\n respond_to do |format|\n if @game_session.save\n format.html { redirect_to @game_session, notice: 'Game session was successfully created.' }\n format.json { render :show, status: :created, location: @game_session }\n else\n format.html { render :new }\n format.json { render json: @game_session.errors, status: :unprocessable_entity }\n end\n\n GameSession.new_session_player(@game_session.id, @game_session.number_of_players)\n \n end\n end",
"def create\r\n @user = User.new user_params\r\n\r\n if @user.save\r\n render json: @user, serializer: SessionSerializer, root: nil\r\n else\r\n render json: { errors: @user.errors }, status: :unprocessable_entity\r\n end\r\n end",
"def store_session(session_id, data)\n set(\"session:#{session_id}\", data)\n end",
"def session(email, password)\n post('/session', body: { email: email, password: password }, unauthenticated: true)\n end",
"def create_session(channel_id, options={})\n match = post_json(\"sessions\", options.merge(\n :channel_id => channel_id.to_s\n ))[:body].match(%r{/sessions/([^/]+)})\n match[1] if match\n end",
"def create\n reset_session\n params[:user] ||= {}\n username = params[:user][:username].to_s\n password = params[:user][:password].to_s\n user = User.where('username = ? and crypted_password = ?', username, User.encrypt(password)).first\n\n params[:client_uid] = 'Web Platform' if request.format.html?\n \n if user && params[:client_uid]\n session_obj = Session.create(user_id:user.id, client_uid:params[:client_uid])\n session[:app_session_id] = session_obj.id\n session[:user_id] = user.id\n\n if request.format.html?\n redirect_to controller: 'main'\n elsif request.format.json?\n render json: {success: true, session: session_obj.to_json}\n end\n else\n if request.format.html?\n flash[:alert] = \"Cannot login, please try again\"\n render action: 'new'\n elsif request.format.json?\n render json: {success: false, message: 'Cannot login, please try again'}\n end\n end\n end",
"def session_get\n nessus_rest_get(\"session\")\n end",
"def create\n @session_login = current_user.session_logins.build(session_login_params)\n respond_to do |format|\n if @session_login.save\n format.html { redirect_to @session_login, notice: \"Session login was successfully created.\" }\n format.json { render :show, status: :created, location: @session_login }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @session_login.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_session_with_http_info(start, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: SessionApi.create_session ...\"\n end\n # verify the required parameter 'start' is set\n fail ArgumentError, \"Missing the required parameter 'start' when calling SessionApi.create_session\" if start.nil?\n # resource path\n local_var_path = \"/session/add\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'start'] = start\n query_params[:'boat_id'] = opts[:'boat_id'] if !opts[:'boat_id'].nil?\n query_params[:'trip_id'] = opts[:'trip_id'] if !opts[:'trip_id'].nil?\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'InlineResponse20043')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SessionApi#create_session\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def create\n @session_info = SessionInfo.new(params[:session_info])\n\n respond_to do |format|\n if @session_info.save\n format.html { redirect_to session_information_path, notice: 'Session Info was successfully set up!' }\n format.json { render json: @session_info, status: :created, location: @session_info }\n else\n format.html { render action: \"new\" }\n format.json { render json: @session_info.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_auth_sessions(data)\n session[:authentication_token] = data[\"data\"][\"token\"][\"access_token\"]\n session[:refresh_token] = data[\"data\"][\"token\"][\"refresh_token\"]\n session[:expires_at] = DateTime.now + data[\"data\"][\"token\"][\"expires_in\"].to_i.seconds\n end",
"def create\n @session = Session.new(params[:session])\n\n respond_to do |format|\n if @session.save\n flash[:notice] = t 'flash.notice.successfully.created', :object => Session.human_name\n format.html { redirect_to(@session) }\n format.xml { render :xml => @session, :status => :created, :location => @session }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @session.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @session = Session.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @session }\n end\n end",
"def session\n end",
"def create\n @ergo_session = ErgoSession.new(ergo_session_params)\n\n respond_to do |format|\n if @ergo_session.save\n format.html { redirect_to @ergo_session, notice: 'Ergo session was successfully created.' }\n format.json { render :show, status: :created, location: @ergo_session }\n else\n format.html { render :new }\n format.json { render json: @ergo_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @session_operation = SessionOperation.new(session_operation_params)\n\n respond_to do |format|\n if @session_operation.save\n format.html { redirect_to @session_operation, notice: 'Session operation was successfully created.' }\n format.json { render action: 'show', status: :created, location: @session_operation }\n else\n format.html { render action: 'new' }\n format.json { render json: @session_operation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def store_session(res)\n attributes = { path: '/', value: @cookie.to_json }\n res.set_cookie('_rails_lite_app', attributes)\n #store_session(response) that will put the session into a cookie\n# and set it using Rack::Response#set_cookie.\n# The first argument to #set_cookie is the name of the cookie which\n# should be _rails_lite_app.\n# The second argument is the cookie attributes. These are merely a hash\n# of path: ..., value: ..., where path is the path where our cookie is\n# available and value is a string. Since we want to pass a collection\n# (our session store) in the cookie, we can serialize our instance\n# variable using JSON. The path should be / (our root url) so the cookie\n# will available at every path.\n# NB: In order for this to work properly, the path and value keys in\n# your hash must be symbols, not strings.\n end",
"def index\n active_sessions = []\n my_sessions = []\n history_sessions = []\n join_sessions = current_user.join_sessions\n Session.all.each { |session|\n if session.user_id == current_user.id\n my_sessions.push session_srz(session)\n elsif join_sessions.any? {|js| js.session_id == session.id} and session.close\n history_sessions.push session_srz(session)\n else\n active_sessions.push session_srz(session)\n end\n }\n\n\n json_object = {\n data: {\n active_sessions: active_sessions,\n my_sessions: my_sessions,\n history_sessions: history_sessions\n #history_sessions: current_user.join_sessions\n }\n }\n\n render json: json_object,\n status: :ok,\n include: %w(session.lock)#nil\n\n #ok_request render_json#, %w(user)\n end",
"def create_session(token, params={})\n params.merge!('token' => token)\n params.merge!(params) { |k,v| v.to_s } # custom parameters must be strings\n response = post(PLURAL_PATH, params)\n response.id = response.id.strip if response.id\n response\n end",
"def write_session(request, sid, session_data, options)\n session = get_session_record(request, sid)\n session.data = session_data\n session.save ? session.session_id : false\n end",
"def session_enduser\n session[:enduser] = params[:enduser]\n\n respond_to do |format|\n format.json { head :ok }\n end\n end",
"def post(url, json_body)\n setup_or_refresh_rest_session\n @session.post(url: url, json_body: json_body)\n end",
"def new_session(options={})\n if supports_sessions?\n api.rest_method('ADD_AUTHORIZATION', {\n :scope => 'session',\n :note => \"RHC/#{RHC::VERSION::STRING} (from #{Socket.gethostname rescue 'unknown'} on #{RUBY_PLATFORM})\",\n :reuse => true\n }, options)\n end\n end",
"def create\n @tutoring_session = TutoringSession.new(params[:tutoring_session])\n\n respond_to do |format|\n if @tutoring_session.save\n format.html { redirect_to @tutoring_session, notice: 'Tutoring session was successfully created.' }\n format.json { render json: @tutoring_session, status: :created, location: @tutoring_session }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tutoring_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n user = User.from_omniauth(env[\"omniauth.auth\"])\n session[:user_id] = user.id\n me=User.find(user.id)\n me.loggedin=true\n me.tutoring=false\n me.request=Request.new(class_name:\"3365f80a5cccb3e76443df3b736b26e8\")\n me.save\n render erb: :'sessions#create'\nend",
"def store_session(res)\n res.set_cookie(cookie_key, { value: @cookie.to_json, path: '/' })\n end",
"def create\n user = User.find_by_email(params[:session][:email])\n respond_to do |format|\n if user && user.authenticate(params[:session][:password])\n sign_in user # create a cookie\n format.json { render json: user.active_model_serializer.new(user, {}) }\n format.html { redirect_back_or user }\n else\n #raise SessionsController::InvalidAuth\n render 'new'\n end\n end\n end",
"def create\n @tsession = Tsession.new(tsession_params)\n\n respond_to do |format|\n if @tsession.save\n format.html { redirect_to @tsession, notice: 'Tsession was successfully created.' }\n format.json { render action: 'show', status: :created, location: @tsession }\n else\n format.html { render action: 'new' }\n format.json { render json: @tsession.errors, status: :unprocessable_entity }\n end\n end\n end",
"def session() request.session end",
"def store_session(res)\n cookie = WEBrick::Cookie.new('_rails_lite_app', @session.to_json)\n res.cookies << cookie\n end",
"def write_session(req, sid, session, options)\n @lock.set_session_data(req.env, sid, session, options)\n end",
"def index\n @sessions = Session.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sessions }\n end\n end",
"def store_session(res)\n res.set_cookie(\"_rails_lite_app\", { path: \"/\", value: \"#{@cookie.to_json}\" })\n # p res\n # res[\"_rails_lite_app\"] = @cookie.to_json\n end",
"def create\n @user = User.new user_params\n if @user.save\n render json: @user, serializer: Api::SessionSerializer, root: nil\n else\n render json: { error: @user.errors.full_messages }, status: :unprocessable_entity\n end\n end",
"def create\n @user = User\n .find_by(email: get_parameters[:email].downcase)\n .try(:authenticate, get_parameters[:password]) \n\n if @user\n jwt_payload = {\n user_id: @user.id\n }\n render json: {\n status: 201,\n message: \"Successfully created new user session.\",\n user: @user,\n jwt: User.encode_jwt(jwt_payload)\n }\n\n else\n render json: {\n status: 401,\n message: \"Failed to create new user session.\"\n }\n end\n end",
"def new\n @session = Session.new\n\n respond_to do |format|\n format.json { render json: @session }\n format.html # new.html.erb\n end\n end",
"def create\n @server = Server.new(server_params)\n @server.session_id = request.session.id\n\n respond_to do |format|\n if @server.save\n format.html { redirect_to @server, notice: 'Server was successfully created.' }\n format.json { render :show, status: :created, location: @server }\n else\n format.html { render :new }\n format.json { render json: @server.errors, status: :unprocessable_entity }\n end\n end\n end",
"def start_session\n generate_token(:token)\n setup_session\n update_last_session\n end",
"def session_params\n params.require(:session).permit(:email, :password)\n end",
"def session_params\n params.require(:session).permit(:email, :password)\n end",
"def session_params\n params.require(:session).permit(:email, :password)\n end",
"def create\n @manager_session = ManagerSession.create(ManagerSession.all_sessions_endpoint)\n respond_to do |format|\n format.html { redirect_to manager_sessions_path }\n format.json { render :show, status: :created, location: @manager_session }\n end\n if @manager_session.count > 50000000\n @manager_session.first.delete\n end\n end",
"def create\n @session = Session.new(session_params)\n\n newYear = session_params[\"sessionDate(1i)\"]; # year\n newMonth = session_params[\"sessionDate(2i)\"]; # month\n newDay = session_params[\"sessionDate(3i)\"]; # day\n newHour = session_params[\"sessionDate(4i)\"]; # hour\n newMin = session_params[\"sessionDate(5i)\"]; # minute\n sessionLen = session_params[\"sessionLength\"]; # session length\n sessionLen = (sessionLen.to_i + 15)/60; # 15 minute break between sessions\n \n newDate = Time.new(newYear, newMonth, newDay, newHour, newMin);\n \n #temporarily hardcoding open/close times. \n openHour = Time.new(newYear, newMonth, newDay, 9, 0);\n closeHour = Time.new(newYear, newMonth, newDay, 21, 0);\n \n #temporarily hardcoding lunch hours\n lunchHour = Time.new(newYear, newMonth, newDay, 12, 0);\n \n validSessionTime = isValidSessionTime(newDate, openHour, closeHour, lunchHour, sessionLen)\n \n respond_to do |format|\n if validSessionTime\n format.html { render :new }\n flash[:alert] = \"Session unavailable at that time.\"\n else\n if @session.save\n format.html { redirect_to @session, notice: 'Session was successfully created.' }\n format.json { render :show, status: :created, location: @session }\n else\n format.html { render :new }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"def create\n @user_session = UserSession.new(params[:user_session])\n\n respond_to do |format|\n if @user_session.save\n format.html { redirect_to(backend_root_path, :notice => 'Login Successful') }\n format.xml { render :xml => @user_session, :status => :created, :location => @user_session }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user_session.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def save_session\n\t\tsession[:todos] = @todos.all_todos.to_json\n\tend",
"def session\n @req.session\n end",
"def session_params\n params.require(:session).permit(:email, :password, :remember_device)\n end",
"def session_params\n params.require(:session).permit(:key)\n end",
"def session_params\n params.require(:session).permit(:name, :password)\n end",
"def create\n\t \t\tmodule_grand_access = permission_control(\"session\",\"create\")\n\t \t\tif module_grand_access\n\t \t\t\tsession = Session.new(session_params)\n\t \t\t\tsession.created_by = current_user.id\n\t \t\t\tif session.save!\n\t \t\t\t\trender json: session, status: :created\n\t \t\t\telse\n\t \t\t\t\trender json: session.errors,status: :bad_request\n\t \t\t\tend\n\t \t\telse\n \t \t\t\trender json: { error: \"You dont have permission to perform this action,Please contact Site admin\" }, status: :unauthorized\t \t\t\t\n\t\t\tend\n\t \tend",
"def store_session(res)\n res.set_cookie\n end",
"def create_session(session_id, data)\n session_id = escape(session_id)\n new_session = new(session_id, data)\n new_session\n end",
"def store_session(res)\n my_cookie = WEBrick::Cookie.new('_rails_lite_app', @cookies.to_json)\n res.cookies << my_cookie\n end",
"def show\n render json: @session_resource\n end",
"def create\n @sevone_session = SevoneSession.new(sevone_session_params)\n\n respond_to do |format|\n if @sevone_session.save\n format.html { redirect_to @sevone_session, notice: 'Sevone session was successfully created.' }\n format.json { render :show, status: :created, location: @sevone_session }\n else\n format.html { render :new }\n format.json { render json: @sevone_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_session\n \n end",
"def create\n @user = User.find_by(email: session_params[\"email\"])\n if @user\n login!\n render json: {\n status: :created, \n logged_in: true, \n user: @user,\n profile: @user.profile\n \n }\n # render json: @session, status: :created, location: @session\n else\n render json: { status: 401 }\n # render json: @session.errors, status: :unprocessable_entity\n end\n end"
] | [
"0.70373255",
"0.7007398",
"0.6930623",
"0.6902813",
"0.6752149",
"0.6736444",
"0.6726408",
"0.6619362",
"0.6601675",
"0.6594401",
"0.65655935",
"0.6541066",
"0.65188426",
"0.6512475",
"0.6509723",
"0.64883345",
"0.6485823",
"0.6464108",
"0.6461902",
"0.64483804",
"0.64408696",
"0.6414387",
"0.64016724",
"0.63911355",
"0.638988",
"0.6383706",
"0.6354038",
"0.63239175",
"0.6315014",
"0.6311582",
"0.63016737",
"0.6278815",
"0.6272114",
"0.622719",
"0.6212724",
"0.6212389",
"0.62123644",
"0.61993635",
"0.6195576",
"0.61867815",
"0.61399937",
"0.61323285",
"0.6124482",
"0.6115698",
"0.6108679",
"0.6103137",
"0.6095746",
"0.60834205",
"0.6083273",
"0.6082361",
"0.60796195",
"0.6076612",
"0.6072554",
"0.6069487",
"0.6065758",
"0.6050414",
"0.60418856",
"0.6037317",
"0.60299677",
"0.602833",
"0.60229415",
"0.6019835",
"0.60026056",
"0.6000297",
"0.5997344",
"0.5984142",
"0.59832907",
"0.5980839",
"0.5975293",
"0.5971679",
"0.597072",
"0.59700155",
"0.595315",
"0.595113",
"0.5946885",
"0.59463227",
"0.5942359",
"0.59344196",
"0.59338915",
"0.59246284",
"0.59234506",
"0.5921499",
"0.5919827",
"0.5919827",
"0.5919827",
"0.59195083",
"0.5909674",
"0.59012073",
"0.58997613",
"0.58787054",
"0.58670074",
"0.5859498",
"0.5855345",
"0.5846415",
"0.58431596",
"0.5837713",
"0.5835981",
"0.58291316",
"0.5829008",
"0.5828936",
"0.582621"
] | 0.0 | -1 |
DELETE /sessions/1 DELETE /sessions/1.json | def destroy
sign_out
redirect_to login_url, alert: "Successfully logged out"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @session = Session.find(params[:id])\n @session.destroy\n\n respond_to do |format|\n format.html { redirect_to sessions_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @session = Session.find(params[:id])\n @session.destroy\n\n respond_to do |format|\n format.html { redirect_to sessions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @session.destroy\n\n respond_to do |format|\n format.html { redirect_to sessions_url }\n format.json { head :ok }\n end\n end",
"def destroy\n Session.delete(params[:id])\n reset_session\n\n if request.format.html?\n redirect_to \"/sessions/new\"\n elsif requeset.format.json?\n render json: {success: true}\n end\n end",
"def destroy\n @session.destroy\n respond_to do |format|\n format.html { redirect_to sessions_url }\n format.json { head :no_content }\n end\n end",
"def delete_session\n request.method = :get\n request.uri = '_session'\n Couchdbtools.execute(request)\n end",
"def destroy\n @yoga_session = YogaSession.find(params[:id])\n @yoga_session.destroy\n\n respond_to do |format|\n format.html { redirect_to yoga_sessions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @session_info = SessionInfo.first\n @session_info.destroy\n\n respond_to do |format|\n format.html { redirect_to session_infos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @session = Session.find(params[:id])\r\n @session.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to(sessions_url) }\r\n format.xml { head :ok }\r\n format.json { head :ok }\r\n\r\n end\r\n end",
"def destroy\n @otg_sess.destroy\n respond_to do |format|\n format.html { redirect_to otg_sesses_url, notice: 'Otg sess was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ykt_session = YktSession.find(params[:id])\n @ykt_session.destroy\n\n respond_to do |format|\n format.html { redirect_to ykt_sessions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tsession.destroy\n respond_to do |format|\n format.html { redirect_to tsessions_url }\n format.json { head :no_content }\n end\n end",
"def delete_session(env, sid, options); end",
"def destroy\n @session.destroy\n respond_to do |format|\n format.html { redirect_to sessions_url, notice: 'Session was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @session.destroy\n respond_to do |format|\n format.html { redirect_to sessions_url, notice: 'Session was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @session.destroy\n respond_to do |format|\n format.html { redirect_to sessions_url, notice: 'Session was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @session.destroy\n respond_to do |format|\n format.html { redirect_to sessions_url, notice: 'Session was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete(url)\n setup_or_refresh_rest_session\n @session.delete(url: url)\n end",
"def destroy\n @session = Session.find(params[:id])\n @session.destroy\n\n respond_to do |format|\n format.html { redirect_to(sessions_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @study_session = StudySession.find(params[:id])\n @study_session.destroy\n\n respond_to do |format|\n format.html { redirect_to study_sessions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n\n if(params[:token].nil?)\n response.status = 400\n render json: {msg: \"Token is not defined\"}\n return\n end\n\n session = validate_session(params[:token])\n\n if session.nil?\n response.status = 401\n render json: {}\n return\n end\n\n begin\n obj = User.find(params[:id])\n\n unless session.user.id == obj.id\n response.status = 403\n render json: {}\n return\n end\n\n # This is what slows down the response.\n # Big DB transactions that delete by foreign key.\n obj.time_sessions.destroy_all\n obj.login_sessions.destroy_all\n\n obj.destroy\n response.status = 20\n render json: {msg: obj.time_sessions.methods}\n rescue ActiveRecord::RecordNotFound => e\n response.status = 404\n render json: {}\n rescue Exception => e\n response.status = 500\n render json: {msg: e}\n end\n\n end",
"def delete(path, params={}) # :nodoc:\n handle_response(@session.delete(path, MultiJson.dump(params)))\n end",
"def destroy\n return if Settings.readonly \n\n @session.destroy\n respond_to do |format|\n format.html { redirect_to sessions_url, notice: 'Session was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sevone_session.destroy\n respond_to do |format|\n format.html { redirect_to sevone_sessions_url, notice: 'Sevone session was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @session_operation.destroy\n respond_to do |format|\n format.html { redirect_to session_operations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user_session.destroy\n respond_to do |format|\n format.html { redirect_to user_sessions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @discovery_session = DiscoverySession.find(params[:id])\n @discovery_session.destroy\n\n respond_to do |format|\n format.html { redirect_to discovery_sessions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @session_replica.destroy\n respond_to do |format|\n format.html { redirect_to session_replicas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n logout\n render json: {:ok => true}\n end",
"def destroy\n set_session\n\n if @session.destroy\n respond_to do |format|\n format.html { redirect_back allow_other_host: false, fallback_location: batch_connect_sessions_url, notice: t(\"dashboard.batch_connect_sessions_status_blurb_delete_success\") }\n format.json { head :no_content }\n end\n else\n respond_to do |format|\n format.html { redirect_back allow_other_host: false, fallback_location: batch_connect_sessions_url, alert: t(\"dashboard.batch_connect_sessions_status_blurb_delete_failure\") }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @user_session = UserSession.find(params[:id])\n @user_session.destroy\n\n respond_to do |format|\n format.html { redirect_to \"/signin\", notice: 'Goodbye!' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sessao.destroy\n respond_to do |format|\n format.html { redirect_to sessaos_url, notice: 'Sessao was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy \n session.delete :user_id \n head :no_content \n end",
"def destroy\n @sessao.destroy\n respond_to do |format|\n format.html { redirect_to sessaos_url, notice: \"Sessao was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n session_user.destroy\n render json: session_user\n end",
"def destroy\n @session_login.destroy\n respond_to do |format|\n format.html { redirect_to session_logins_url, notice: \"Session login was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @session_resource.destroy\n\n head :no_content\n end",
"def destroy\n @current_session = CurrentSession.find(params[:id])\n @current_session.destroy\n\n head :no_content\n end",
"def destroy\n id = shift_argument ||\n raise(Heroku::Command::CommandFailed, \"Usage: sessions:destroy [ID]\")\n session = request do\n api.request(\n :expects => 200,\n :headers => headers,\n :method => :delete,\n :path => \"/oauth/sessions/#{CGI.escape(id)}\"\n ).body\n end\n puts %{Destroyed \"#{session[\"description\"]}\".}\n end",
"def destroy\n if @session.created_by == current_user.id\n @session.destroy\n else\n flash[:notice] = \"Cannot delete session as you did not create it.\"\n end\n respond_to do |format|\n format.html { redirect_to game_sessions_url }\n format.json { head :no_content }\n end\n end",
"def delete_session(session_id)\n delete(\"session:#{session_id}\")\n end",
"def destroy\n @user=User.where(:authentication_token=>params[:api_key]).first\n @user.reset_authentication_token!\n render :json => { :message => [\"Session deleted.\"] }, :success => true, :status => :ok\n end",
"def destroy\n @ergo_session.destroy\n respond_to do |format|\n format.html { redirect_to ergo_sessions_url, notice: 'Ergo session was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user_session = UserSession.find(params[:id])\n if @user_session then @user_session.destroy end\n\n respond_to do |format|\n format.html { redirect_to :back, :notice => \"You have successfully logged out\" }\n format.json { head :ok }\n end\n end",
"def log_out\n get '/sessions/destroy'\nend",
"def log_out\n get '/sessions/destroy'\nend",
"def destroy\n @session.destroy\n redirect_to '/fitness_sessions/',notice: \"\"\n #respond_to do |format|\n #format.html { redirect_to sessions_url, notice: 'Session was successfully destroyed.' }\n #format.json { head :no_content }\n #end\n end",
"def delete_sessions(user_id:)\n path = '/users/{userId}/sessions'\n .gsub('{userId}', user_id)\n\n if user_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"userId\"')\n end\n\n params = {\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'DELETE',\n path: path,\n headers: headers,\n params: params,\n )\n end",
"def logout\n # delete the session\n session.delete :user_id\n render json: { message: \"Logged Out\" }\n end",
"def destroy\n session[:user_id] = nil\n head(:ok, status: :no_content) \n end",
"def destroy\n @tutoring_session = TutoringSession.find(params[:id])\n @tutoring_session.destroy\n\n respond_to do |format|\n format.html { redirect_to tutoring_sessions_url }\n format.json { head :no_content }\n end\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @exercise_session.destroy\n respond_to do |format|\n format.html { redirect_to exercise_sessions_url, notice: 'Exercise session was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def deleteSession(sessionID)\n call :deleteSession, :sessionID => sessionID\n end",
"def destroy\n @user_session = UserSession.find\n @user_session.destroy\n\n respond_to do |format|\n format.html { redirect_to(:users, :notice => 'Goodbye!') }\n format.json { head :no_content }\n end\n end",
"def log_out \n get '/sessions/destroy'\nend",
"def log_out \n get '/sessions/destroy'\nend",
"def log_out \n get '/sessions/destroy'\nend",
"def log_out \n get '/sessions/destroy'\nend",
"def log_out \n get '/sessions/destroy'\nend",
"def destroy\n\n @session = @event.sessions.find(params[:id])\n\n #when destroying the last session, also destroy the related event\n #i know i can refactor this\n # event = Event.find(@session.event_id)\n # if event.sessions.count == 1\n # event.destroy\n # end\n \n @session.destroy\n\n respond_to do |format|\n format.html { redirect_to event_sessions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @guest_session_association.destroy\n respond_to do |format|\n format.html { redirect_to jam_sessions_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n session.delete(:user)\n end",
"def destroy\n @session_type = SessionType.find(params[:id])\n @session_type.destroy\n\n respond_to do |format|\n format.html { redirect_to session_types_url }\n format.json { head :no_content }\n end\n end",
"def delete_session(user_id:, session_id:)\n path = '/users/{userId}/sessions/{sessionId}'\n .gsub('{userId}', user_id)\n .gsub('{sessionId}', session_id)\n\n if user_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"userId\"')\n end\n\n if session_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"sessionId\"')\n end\n\n params = {\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'DELETE',\n path: path,\n headers: headers,\n params: params,\n )\n end",
"def destroy\n @polling_session = PollingSession.find(params[:id])\n @polling_session.destroy\n\n respond_to do |format|\n format.html { redirect_to polling_sessions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n session.delete :name\n end",
"def destroy\n @session_time.destroy\n respond_to do |format|\n format.html { redirect_to session_times_url, notice: 'Session time was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user_session = UserSession.find\n @user_session.destroy if @user_session\n\n respond_to do |format|\n format.html do\n gflash success: {value: 'Successfully logged out.', time: 5000}\n redirect_to root_path\n end\n format.json { head :no_content }\n end\n end",
"def delete_sessions(node)\n @sessions.delete_all(node)\n end",
"def delete\n if @session\n @session.destroy\n @session = nil\n end\n end",
"def destroy\n session[:user_id] = nil\n response.status=(200)\n render json: {status: \"Success\", message: [\"Successfully Logged Out\"]}\n end",
"def delete_session\n session[:userid] = nil\n session[:attributes] = nil\n end",
"def destroy_session2_id\n url = \"https://208.65.111.144/rest/Session/logout/{'session_id':'#{get_session2}'}\"\n begin\n apiRequest(url)\n rescue Restclient::InternalServerError => e\n error_message = e.response[e.response.index('faultstring')+14..-3]\n if error_message != \"Session id is expired or doesn't exist\"\n puts \"Something went wrong trying to logout\"\n end\n end\n @@session_id = nil\n end",
"def destroy\n @session_note.destroy\n respond_to do |format|\n format.html { redirect_to session_notes_url, notice: 'Session note was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game_session.destroy\n respond_to do |format|\n format.html { redirect_to game_sessions_url, notice: 'Game session was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy_session\n response_handler(rest_delete('/rest/login-sessions'))\n self\n end",
"def destroy\n session.delete :user_id\n redirect_to root_path\n end",
"def destroy\n @pool_session = PoolSession.find(params[:id])\n @pool_session.destroy\n\n respond_to do |format|\n format.html { redirect_to(sessions_url) }\n format.xml { head :ok }\n end\n end",
"def delete\n java_session = @java_request.getSession(false)\n java_session.invalidate if java_session\n end",
"def destroy\n @session.clear\n end",
"def destroy\n self.class.delete_all(\"session_id='#{session_id}'\")\n end",
"def destroy\n @session_event.destroy\n respond_to do |format|\n format.html { redirect_to session_events_url, notice: 'Session event was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @trial = Trial.find(params[:id])\n @trial.users.delete(User.find session[:userID])\n logger.info(@trial.users)\n session[:current_trial] = nil\n respond_to do |format|\n format.html { redirect_to :controller => 'home', :action => 'index' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @qa_session = @qa_session_file.qa_session\n @qa_session_file.destroy\n respond_to do |format|\n format.html { redirect_to qa_session_url(@qa_session), notice: 'qa_session file was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @training_session = TrainingSession.find(params[:id])\n @training_session.destroy\n\n respond_to do |format|\n format.html { redirect_to training_sessions_url }\n format.json { head :no_content }\n end\n end",
"def logout\n response = @session.delete\n @auth_token = nil\n @rest.default_headers = { 'Content-Type' => 'application/json' }\n response\n end",
"def destroy\n session.delete :user_id\n redirect_to '/'\n end",
"def destroy\n session[:flybuys_number] = nil\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'Session was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @interview_session = InterviewSession.find(params[:id])\n @interview_session.destroy\n\n respond_to do |format|\n format.html { redirect_to(interview_sessions_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n # Delete the user access tokens on logout\n User.find(session[:user_id]).delete\n # Delete the session as well\n session = {}\n \n redirect_to root_path\n end",
"def destroy\n @csession.destroy\n respond_to do |format|\n format.html { redirect_to csessions_url, notice: 'Csession was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user_session = UserSession.find \n @user_session.destroy\n\n respond_to do |format|\n format.html { redirect_to(:controller=>'home', :action=> 'index') }\n format.xml { head :ok }\n end\n end",
"def destroy\n @lift_session.destroy\n respond_to do |format|\n format.html { redirect_to lift_sessions_url, notice: 'Lift session was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user_session = UserSession.find\n @user_session.destroy\n session.clear\n \n respond_to do |format|\n format.html { redirect_to(root_path, :notice => 'Volte sempre! Afinal, não custa nada tentar.') }\n format.xml { head :ok }\n end\n end",
"def destroy\n @obsession.destroy\n respond_to do |format|\n format.html { redirect_to obsessions_url, notice: 'Obsession was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n session[:developer_id] = nil\n redirect_to sessions_new_path\n end",
"def delete\n request(:delete)\n end",
"def destroy #RESTful convention - destroy action to delete sessions (sign out)\n sign_out # defer to sign_out function for signing out\n redirect_to root_path\n end",
"def destroy\n reset_session\n respond_to do |format|\n format.html { redirect_to '/', notice: 'User was successfully logged out.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @analysis_session.destroy\n respond_to do |format|\n format.html { redirect_to analysis_sessions_url, notice: 'Analysis session was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"
] | [
"0.7547095",
"0.7505047",
"0.74601185",
"0.7408997",
"0.7386861",
"0.7356258",
"0.7299738",
"0.72481555",
"0.7219981",
"0.7211935",
"0.7209504",
"0.7153417",
"0.7149718",
"0.7106548",
"0.7106548",
"0.7106548",
"0.7106548",
"0.7098076",
"0.7054706",
"0.70518315",
"0.7028367",
"0.70241046",
"0.7005392",
"0.69738",
"0.6969132",
"0.69544834",
"0.69416946",
"0.69376063",
"0.69159085",
"0.6915765",
"0.6913744",
"0.68742216",
"0.68738157",
"0.68720925",
"0.68650115",
"0.68558455",
"0.68541586",
"0.6853593",
"0.6851949",
"0.6825519",
"0.6807904",
"0.6807653",
"0.6806887",
"0.68028986",
"0.67825115",
"0.67825115",
"0.6781683",
"0.6779862",
"0.67769885",
"0.6775345",
"0.6772832",
"0.67720693",
"0.6769995",
"0.6768682",
"0.6760795",
"0.6758865",
"0.6758865",
"0.6758865",
"0.6758865",
"0.6758865",
"0.67458427",
"0.67409104",
"0.6740208",
"0.67086136",
"0.6708393",
"0.6693451",
"0.66718745",
"0.66651046",
"0.6637528",
"0.66368043",
"0.66364676",
"0.6635623",
"0.66344476",
"0.66285557",
"0.66207534",
"0.661723",
"0.66054606",
"0.6601291",
"0.659864",
"0.6588431",
"0.65817827",
"0.65728164",
"0.6557746",
"0.65313804",
"0.6502115",
"0.64900875",
"0.6482972",
"0.64810306",
"0.6477973",
"0.64761984",
"0.64753366",
"0.64694005",
"0.6465779",
"0.6464387",
"0.6459843",
"0.64575166",
"0.6449429",
"0.64486855",
"0.6447683",
"0.64473605",
"0.6446736"
] | 0.0 | -1 |
Is this an "infinite" paginator | def infinite?
@count.nil?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def paginator; end",
"def paginated?\n false\n end",
"def paginate; false; end",
"def paginator=(_arg0); end",
"def paginate!\n paginated?? nil : page!(1)\n end",
"def paginated?\n current_page && current_page > 0\n end",
"def paginated?\n page_count > 1\n end",
"def paginate\n paginated?? self : page(1)\n end",
"def paginate?\n @paginator || @condition_blocks.any?(&:paginate?)\n end",
"def paginated?\n @pages and @pages.length > 1\n end",
"def test_next_not_truncated_when_fewer_than_three_next_pages\n pg = Ruhoh::Parsers::Posts::Paginator.new(1, @five_posts)\n pages = pg.paginate()\n page = pages['index_pages'][1]\n assert_equal([3, 4, 5], page['next'].map {|p| p['page_number']})\n assert_equal(['/index/3/', '/index/4/', '/index/5/'], page['next'].map { |p| p['url'] })\n assert_equal(nil, page['next_truncated'])\n end",
"def paginator\n per_page = @ruhoh.db.config(\"paginator\")[\"per_page\"]\n current_page = master.context[\"page\"]['current_page'].to_i rescue 0\n current_page = current_page.zero? ? 1 : current_page\n offset = (current_page-1)*per_page\n\n page_batch = all[offset, per_page]\n raise \"Page does not exist\" unless page_batch\n page_batch\n end",
"def out_of_range?\n current_page > total_pages\n end",
"def paginate_at ()\n return 8\n end",
"def paginated?\n return false unless current_page\n true\n end",
"def next_page?\n return (@query[:startPage] * (@query[:count] + 1)) < @total_results\n end",
"def test_next_is_truncated_when_more_than_three_next_pages\n pg = Ruhoh::Parsers::Posts::Paginator.new(1, @five_posts)\n pages = pg.paginate()\n page = pages['index_pages'][0]\n assert_equal([2, 3, 4], page['next'].map {|p| p['page_number']}) \n assert_equal(['/index/2/', '/index/3/', '/index/4/'], page['next'].map { |p| p['url'] })\n assert_equal('/index/5/', page['next_truncated'])\n end",
"def paginated?\n\t\t\t!next_page_url.nil?||!prev_page_url.nil?\n\t\tend",
"def more_pages?\n return false if start_index == 0\n (self.start_index + self.page_length) -1 < self.total_result_count\n end",
"def infinite?\n @recur_iterator.infinite?\n end",
"def page_count\n 1\n end",
"def paginatable?; paginatable; end",
"def next_page?\n page.zero? || page < total_pages\n end",
"def paginatable?\n raise NotImplemented\n end",
"def next?\n current_page < total_pages\n end",
"def next?\n return @pages > @page\n end",
"def out_of_bounds?\n current_page > total_pages\n end",
"def pagination_from(collection)\n collection.offset_value + 1\n end",
"def ensure_paginated(objs)\n if !objs.respond_to?(:total_entries) && objs.respond_to?(:paginate)\n objs.paginate(:page => 1, :per_page => 1000000)\n else\n objs\n end\n end",
"def out_of_bounds?\n current_page > page_count\n end",
"def paging?\n @paging\n end",
"def paginate(collection)\n will_paginate(collection, :inner_window => 2)\n end",
"def pagination?(doc)\n !page_count(doc).nil?\n end",
"def items\n if ( @paginator.items_per_page.kind_of?(Array) )\n @number <= @paginator.items_per_page.size ? @paginator.items_per_page[@number-1] : @paginator.items_per_page.last\n else\n @paginator.items_per_page\n end\n end",
"def paginate!(curr_page)\n return if !hard_paginate?\n @page = curr_page.to_i\n raise ArgumentError if @page < 1 || @page > total_pages\n adj_page = @page - 1 > 0 ? @page - 1 : 0 \n @prev_page = adj_page > 0 ? adj_page : nil\n @next_page = page < total_pages ? (@page + 1) : nil\n @data.only!(adj_page * per_page..(@page * per_page - 1))\n end",
"def out_of_bounds?\n current_page > total_pages\n end",
"def max_pages() 1 end",
"def begin; pager.offset page; end",
"def next_page_collection\n next_page ? page(next_page, per_page) : nil\n end",
"def next; pager.page(page + 1); end",
"def fleets_paginated_pages(current_page, total_pages)\n return (1..total_pages).to_a unless total_pages > 13\n\n paginated_pages(current_page, total_pages)\n end",
"def has_next_page?\n @current_page < page_count\n end",
"def pagination_candidate?(config, page); end",
"def show_pagination? response = nil\n response ||= @response\n response.limit_value > 0 && response.total_pages > 1\n end",
"def show_pagination? response = nil\n response ||= @response\n response.limit_value > 0 && response.total_pages > 1\n end",
"def paginated?\n @choices.size > page_size\n end",
"def has_next?\n return self.current_page != self.total_pages && self.total_pages > 1\n end",
"def page_count\n @collection.max + 1\n end",
"def paginations(collection)\n content_tag :div, class: 'page-wrapper' do\n if collection.next_page\n will_paginate collection, renderer: BootstrapPagination::Rails\n else\n content_tag :div, \"没有更多了\", class: 'no-more'\n end\n end\n end",
"def leading\n (@total_pages > 0) ? 1 : nil\n end",
"def paginate opts = {}\n @paginator = true\n page = (opts[:page] || 1).to_i\n per_page = (opts[:per_page] || 20).to_i\n page = 1 if page < 1\n limit( per_page, ( page - 1 ) * per_page )\n end",
"def infinite?\n @count.nil?\n end",
"def paginate\n raise NoMethodError.new('paginate')\n end",
"def has_next?()\n return false if @limit != nil && @offset >= @limit\n\n load_next_page() if @data == nil\n\n return true if @pos < @data.length\n\n return false if !@truncated\n\n load_next_page()\n\n @pos < @data.length\n end",
"def calculate_next\n n = @current_page + 1\n n > @total_pages || n <= 0 ? nil : n\n end",
"def paginator_navigation\n paginator_config = {\"borders\"=>5, \"per_page\"=>10}.merge(config[\"paginator\"] || {})\n page_count = all.length\n total_pages = (page_count.to_f/paginator_config[\"per_page\"]).ceil\n current_page = master.page_data['current_page'].to_i\n current_page = current_page.zero? ? 1 : current_page\n\n left_dots = ((current_page+1)/2).ceil\n right_dots = ((total_pages+current_page)/2).ceil\n borders = paginator_config[\"borders\"]\n\n pages = total_pages.times.select { |i|\n i+1 <= borders || i+1 > total_pages-borders ||\n (i+1 >= current_page-(borders/2).ceil && i+1 <= current_page+(borders/2).ceil) ||\n i+1 == left_dots || i+1 == right_dots\n }.map { |i|\n url = i.zero? && paginator_config[\"root_page\"] ?\n paginator_config[\"root_page\"] : \"#{paginator_config[\"url\"]}/#{i+1}\"\n name = (i+1 > borders) && (i+1 < total_pages-borders) &&\n ((i+1 < current_page-(borders/2).ceil) || (i+1 > current_page+(borders/2).ceil)) &&\n (i+1 == left_dots || i+1 == right_dots) ? '…' : \"#{i+1}\"\n\n {\n \"url\" => ruhoh.to_url(url),\n \"name\" => name,\n \"is_active_page\" => (i+1 == current_page),\n \"title\" => \"#{i+1}\"\n }\n }\n pages\n end",
"def max_pages\n if Kaminari.config.respond_to? :max_pages\n nil\n else\n super\n end\n end",
"def paginate_items(items)\n paginated_items = items.paginate(paginate_options)\n next_page_exists = paginated_items.length > @limit || paginated_items.next_page\n add_link_header(offset: (offset + 1)) if next_page_exists\n paginated_items[0..(@limit - 1)] # get paginated_collection of length 'limit'\n end",
"def paginated?(result)\n PAGINATION_PROXY_INTERFACE.each do |meth|\n result.send(meth)\n end\n true\n rescue NoMethodError\n false\n end",
"def page_range\n 1..page_count\n end",
"def more_invoices\n # logic to see how many possbile pages there are...\n total_invoices = Invoice.find(:all).length\n logger.debug total_invoices\n pages_possible = total_invoices / 5.0\n dec = pages_possible.abs.modulo(1) \n if(dec > 0.0)\n pages_possible = pages_possible.to_i + 1\n end\n \n # if less than 5 invoices for x user do not try and load.\n if(total_invoices <= 5)\n render :text => \"Fail\"\n else\n @invoices = Invoice.page(params[:page]).per(5)\n current_page = params[:page].to_i\n total_page = @invoices.length\n if(current_page > pages_possible)\n render :text => \"Fail\"\n else\n render :layout => false \n end\n end\n \n end",
"def has_next_page\n if first\n paged_nodes.length >= first\n else\n false\n end\n end",
"def pager( page_count, page_current )\n display = [10, page_count].min\n return (1..display) if display < 10\n return (1..10) if page_current < 6\n return ((page_count-10)..page_count) if (page_count - page_current) < 5\n return ((page_current-5)..page_current+5)\n end",
"def page_num_checker \n\t\t@page_num < @total_page || @total_page == 0\n\tend",
"def paginator\n @paginator ||=\n context[:paginator] || ManifestItem::Paginator.new(h.controller)\n end",
"def pagination_enabled?(site); end",
"def pagination_range\n case JSONAPI.configuration.default_paginator\n when :paged\n number = page_params['number'].to_i.nonzero? || 1\n size = page_params['size'].to_i.nonzero? || JSONAPI.configuration.default_page_size\n (number - 1) * size..number * size - 1\n when :offset\n offset = page_params['offset'].to_i.nonzero? || 0\n limit = page_params['limit'].to_i.nonzero? || JSONAPI.configuration.default_page_size\n offset..offset + limit - 1\n else\n paginator.pagination_range(page_params)\n end\n end",
"def pager; end",
"def pagination_to(collection)\n collection.last_page? ? collection.total_count : collection.offset_value + collection.limit_value\n end",
"def more?\n @current < @pages\n end",
"def render_pagination(items=nil, remote=false)\n items ||= collection\n if items.any? && items.respond_to?(:total_pages) && items.total_pages > 1\n render(\"pagination\", :entries => items, :remote => remote)\n end\n end",
"def next_page?\n page_number < last_page_number\n end",
"def next_page?\n !next_page_number.nil?\n end",
"def test_previous_when_more_than_three_prev_pages\n pg = Ruhoh::Parsers::Posts::Paginator.new(1, @five_posts)\n pages = pg.paginate()\n page = pages['index_pages'][4]\n assert_equal([2, 3, 4], page['prev'].map {|p| p['page_number']}) \n assert_equal(['/index/2/', '/index/3/', '/index/4/'], page['prev'].map { |p| p['url'] })\n assert_equal('/index/1/', page['prev_truncated'])\n end",
"def paginate\n @max_pages = (@transactions_all.size/TRANSACTIONS_PER_PAGE) + 1\n if(@max_pages == 0)\n @max_pages = 1 # Because @max_pages indexes from 0, if its 0 change it to 1\n end\n\n # Boundary conditions for pages, a user should not be able to paginate under 0 or over the max limit\n if(@page >= @max_pages || @page < 0)\n redirect_to transactions_path\n end\n end",
"def all_pagination_is_present\n return unless pagination && count.nil?\n\n errors.add(:count, ErrorMessage[\"should be present if pagination is being used\", \"6.4\"])\n end",
"def paginate(paginator, args = {})\n instantiate(paginate_ids(paginator), args)\n end",
"def last_page?; ! @doc.has_key? 'next' end",
"def page_count()\n if @pages >= 500\n return true\n end\n else\n return false\n end",
"def total_pages\n -1\n end",
"def paginator\n @paginator ||= paginator_klass.new(page_params)\n end",
"def any?\n !total_pages.zero?\n end",
"def paginated_products\n p = self.products.where(:admin_validation => true)\n unless self.page.blank?\n p.page(self.page)\n end\n end",
"def paginated_collected(options = {})\n paginated(options)\n end",
"def paginator_view(env)\n path = env['PATH_INFO'].reverse.chomp(\"/\").reverse\n resource = @ruhoh.collections.paginator_urls.find do |a, b|\n \"/#{ path }\" =~ %r{^#{ b }}\n end\n resource = resource[0] if resource\n return false unless resource\n\n page_number = path.match(/([1-9]+)$/)[0] rescue nil\n\n return false unless @ruhoh.collections.exist?(resource)\n return false if page_number.to_i.zero?\n\n collection = @ruhoh.collection(resource)\n config = collection.config[\"paginator\"] || {}\n\n url = \"#{config[\"url\"]}/#{page_number}\"\n \n view = @ruhoh.master_view({\"resource\" => resource})\n view.page_data = {\n \"layout\" => config[\"layout\"],\n \"current_page\" => page_number,\n \"url\" => @ruhoh.to_url(url)\n }\n view\n end",
"def paginate\n @max_pages = (@accounts.size/ACCOUNTS_PER_PAGE) + 1\n if(@max_pages == 0)\n @max_pages = 1 # Because @max_pages indexes from 0, if its 0 change it to 1\n end\n\n # Boundary conditions for pages, a user should not be able to paginate under 0 or over the max limit\n if(@page >= @max_pages || @page < 0)\n redirect_to admin_accounts_path\n end\n end",
"def pages_no_count!(collection, opts = {})\n return unless collection && is_paginated?(collection)\n\n options_query_parameters, original_params, original_url = handle_url(opts)\n\n pages_without_count(collection, options_query_parameters, original_params, original_url)\n end",
"def test_previous_when_fewer_than_three_prev_pages\n pg = Ruhoh::Parsers::Posts::Paginator.new(1, @five_posts)\n pages = pg.paginate()\n page = pages['index_pages'][3]\n assert_equal([1, 2, 3], page['prev'].map {|p| p['page_number']})\n assert_equal(['/index/1/', '/index/2/', '/index/3/'], page['prev'].map { |p| p['url'] })\n assert_equal(nil, page['prev_truncated'])\n end",
"def trailing\n (@total_pages > 0) ? @total_pages : nil\n end",
"def page_number\n\t\t\t\treturn 0 if @total_results == 0\n\t\t\t\t@offset + 1\n\t\t\tend",
"def auto_paginate\n ENV['NEARMISS_AUTO_PAGINATE'] || true\n end",
"def first_page?\n page_number > first_page_number\n end",
"def last_page?\n return true\n # hack to remove this call so we don't do any counting\n #current_page >= total_pages\n end",
"def next_page; end",
"def paginator(paginator_range: DEFAULT_PAGINATOR_RANGE)\n range = (1..paginator_range)\n if (@page - paginator_range / 2) > 0 && (@page + paginator_range / 2) <= @pages\n range = ((@page - paginator_range / 2)..(@page + paginator_range / 2))\n elsif (@page - (paginator_range / 2)) > 0 && @page + paginator_range >= @pages\n range = ((@pages - (paginator_range - 1))..@pages)\n end\n range.to_a\n end",
"def page_index(item_index)\n return -1 if item_index < 0 || item_index > item_count-1 \n item_index/@per_page \n end",
"def pagination_needed?\n # Using #to_a stops active record trying to be clever\n # by converting queries to select count(*)s which then need to be repeated.\n @pagination_needed ||= primary_records.to_a.size > API_PAGE_SIZE\n end",
"def paginated(collection, options = {})\n respond_with_object_and_type collection, options, :paginated, false\n end",
"def pagination\n settings.pagination || 50\n end"
] | [
"0.76346296",
"0.7188816",
"0.7165192",
"0.7015973",
"0.7010716",
"0.6958979",
"0.68820834",
"0.68741125",
"0.6809616",
"0.6730568",
"0.6706848",
"0.6696838",
"0.6685148",
"0.6625548",
"0.6611017",
"0.6597203",
"0.65867126",
"0.65758854",
"0.65721875",
"0.6534182",
"0.644101",
"0.6417963",
"0.64151615",
"0.64097244",
"0.63732475",
"0.63354254",
"0.63339067",
"0.6318844",
"0.6316483",
"0.63120764",
"0.63076776",
"0.6295805",
"0.6281421",
"0.6275532",
"0.62743586",
"0.62582326",
"0.625546",
"0.6241311",
"0.6236988",
"0.6229456",
"0.619865",
"0.6185522",
"0.6177231",
"0.6156076",
"0.6156076",
"0.614799",
"0.61451405",
"0.61423177",
"0.6128862",
"0.6125145",
"0.61248755",
"0.61234134",
"0.6122904",
"0.61185575",
"0.6118114",
"0.61135644",
"0.61047834",
"0.6073127",
"0.6040382",
"0.6033843",
"0.6032129",
"0.60023534",
"0.5992737",
"0.5992509",
"0.5989365",
"0.5988425",
"0.5979722",
"0.59668326",
"0.59633505",
"0.5962528",
"0.59621435",
"0.59610903",
"0.59382766",
"0.59372807",
"0.5933276",
"0.59234446",
"0.590197",
"0.590121",
"0.59011984",
"0.5891527",
"0.5876722",
"0.5844116",
"0.5843504",
"0.5841918",
"0.58412796",
"0.5839336",
"0.5837789",
"0.58284676",
"0.582313",
"0.5819162",
"0.58191586",
"0.581758",
"0.58138037",
"0.5812248",
"0.5804874",
"0.58023024",
"0.5797839",
"0.5795153",
"0.57949"
] | 0.61497724 | 46 |
GET /thing_types GET /thing_types.json | def index
@thing_types = ThingType.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n authorize @thing, :get_types?\n @thing_types = @thing.thing_types\n end",
"def pet_types\r\n BnetApi::make_request('/wow/data/pet/types')\r\n end",
"def show\n @type = Type.find(params[:id])\n @things = @type.things\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @type }\n end\n end",
"def index\n @types = Type.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @types.lookup(params[:q]) }\n end\n end",
"def index\n @clothing_types = ClothingType.all\n end",
"def places_kinds\n render json: Place.places_kinds\n end",
"def get_resource_types\n Occi::Log.debug(\"Getting resource types ...\")\n collection = @model.get Occi::Core::Resource.kind\n collection.kinds.collect { |kind| kind.term }\n end",
"def show\n if params[:term]\n @types = Type.all(:conditions => ['typeName LIKE ?', \"%#{params[:term]}%\"])\n else\n @type = Type.find(params[:id])\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @types }\n end\n end",
"def index\n @taxonomies = Taxonomy.find_all_by_taxonomy_type(params[:taxonomy_type].presence || 'category')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @taxonomies }\n end\n end",
"def types\n types = Question.distinct.pluck(:type)\n render json: types.to_a\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @resource_types }\n end\n end",
"def index\n @entry_types = EntryType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @entry_types }\n end\n end",
"def get_lesson_types\n get \"lessonTypes.json\"\n end",
"def index\n @vehicle_types = VehicleType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @vehicle_types }\n end\n end",
"def index \n respond_to do |format|\n format.html # index.html.erb\n format.json { \n asset_types = AssetType.all\n render json: asset_types \n }\n end\n end",
"def index\n @special_needs_types = SpecialNeedsType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @special_needs_types }\n end\n end",
"def index\n @language_types = LanguageType.all\n\n render json: @language_types\n end",
"def index\n @typings = Typing.all\n end",
"def index\n @hardware_types = HardwareType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @hardware_types }\n end\n end",
"def index\n @observation_types = ObservationType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @observation_types }\n end\n end",
"def index\n render json: usage(params[:type])\n end",
"def index\n @specification_types = SpecificationType.all.order(\"display_order\")\n\n render json: @specification_types, each_serializer: Web::V1::SpecificationTypeSerializer\n end",
"def index\n @act_types = ActType.order(:name).page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @act_types }\n end\n end",
"def index\n types = @user.tried_beer_ratings.last.beer_types.map do |type|\n {name: type.name, description: type.beg_description}\n end\n render json: types\n end",
"def index\n @trait_types = TraitType.all\n\n render json: @trait_types\n end",
"def index\n @weapons_types = WeaponsType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @weapons_types }\n end\n end",
"def get_available_types_from_usage(usage) #TODO: Research use\n return @client.raw(\"get\", \"/helpers/available-types/#{usage}\")\n end",
"def get_available_types_from_usage(usage)\n # TODO: Research use\n @client.raw('get', \"/helpers/available-types/#{usage}\")\n end",
"def index\n @technotypes = Technotype.all\n\n respond_to do |format|\n format.json { render json: @technotypes, status: 200 }\n end\n end",
"def index\n @talk_types = TalkType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @talk_types }\n end\n end",
"def types\n aux = WorkOrderType.by_name\n render json: serialized_work_order_types(aux)\n end",
"def index\n @weapon_types = WeaponType.all\n\n render json: @weapon_types\n end",
"def cmd_types argv\n setup argv\n response = @api.types\n msg response\n return response\n end",
"def index\n @crate_types = CrateType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @crate_types }\n end\n end",
"def index\n @novelty_types = NoveltyType.all\n end",
"def index\n @types = Type.all\n end",
"def index\n @shape_types = ShapeType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shape_types }\n end\n end",
"def list(type)\n get(resource_path_for_entity_type(type) + \"?rows=all\")\n end",
"def get_resource_types\n get_types(Occi::Core::Resource.kind)\n end",
"def court_types\n render json: GamePass.court_types_options\n end",
"def index\n @cloth_types = ClothType.all\n end",
"def index\n @realty_types = RealtyType.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @realty_types }\n end\n end",
"def index\n @resources = Resource.eager_load(:resource_type).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @resources }\n end\n end",
"def index\n @sample_types = SampleType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sample_types }\n end\n end",
"def show\n @all_type=Api::V1::AdminType.all\n render json: @all_type\n end",
"def index\n @type_people = TypePerson.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @type_people }\n end\n end",
"def index\n @techaxis_types = TechaxisType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @techaxis_types }\n end\n end",
"def get_entity_types\n Occi::Log.debug(\"Getting entity types ...\")\n @model.kinds.collect { |kind| kind.term }\n end",
"def index\n @run_types = RunType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @run_types }\n end\n end",
"def index\n @material_types = MaterialType.all\n\n render json: @material_types\n end",
"def index\n @typegroups = Typegroup.all\n respond_to do |format|\n format.html\n format.json { render json: @typegroups }\n end\n end",
"def index\n @edge_types = EdgeType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @edge_types }\n end\n end",
"def index\n @timerecord_types = TimerecordType.paginate(:page => params[:page], :per_page => per_page).order('id')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @timerecord_types }\n end\n end",
"def appointment_types(params = {})\n scope 'default'\n get('schedule/appointmenttypes/', params)\n end",
"def index\n @trtypes = Trtype.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @trtypes }\n end\n end",
"def index\n @types = ItemType.all\n end",
"def index\n @company_types = CompanyType.all\n\n render json: @company_types\n end",
"def index\n @product_types = ProductType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @product_types }\n end\n end",
"def index\n @sample_types = SampleType.all.sort_by(&:name)\n @first = if @sample_types.any?\n @sample_types[0].name\n else\n 'no sample types'\n end\n\n respond_to do |format|\n format.html { render layout: 'aq2' }\n format.json do\n render json: @sample_types\n .sort { |a, b| a.name <=> b.name }\n .to_json(methods: :field_types)\n end\n end\n end",
"def ride_types(args = {})\n make_request(\n http_method: :get,\n endpoint: path_for(:ride_types),\n access_token: args.delete(:access_token),\n options: { query: args }\n )\n end",
"def show\n @realty_type = RealtyType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @realty_type }\n end\n end",
"def index\n @product_types = ProductType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @product_types }\n end\n end",
"def getMetadatatypes\n \n @queryparams = params\n \n # Get all metadatatypes\n @results = MetadataType.find(:all, :order => \"updated_at ASC\" )\n \n if params[:format] && params[:format]== \"json\" || params[:format] == \"yaml\"\n @yaml_results = {}\n @results.each do |result|\n @yaml_results.merge!({result.name => result.value_type})\n end\n \n end\n \n # host parameter, needed when creating atom-feed\n if request.ssl?\n @host = \"https://#{request.host}\"\n else\n @host = \"http://#{request.host}\"\n end\n\n if request.port != nil and request.port != 80\n @host += \":#{request.port}\"\n end \n \n # Create atom feed\n @host = @@http_host\n respond_to do |format|\n if @queryparams[:format] == nil\n format.html {render :getmetadatatypes, :layout=>true }\n else\n format.html {render :getmetadatatypes, :layout=>true }\n format.atom {render :getmetadatatypes, :layout=>false }\n format.yaml {render :text => YAML.dump(@yaml_results), :layout=>false }\n format.json {render :text => JSON.dump(@yaml_results), :layout=>false }\n end\n end\n end",
"def index\n respond_to do |format|\n format.html { @product_types = ProductType.all }\n format.json { @product_types = ProductType.order(:name) }\n end\n end",
"def types\n @client.make_request :get, reports_path\n end",
"def index\n @bagtypes = Bagtype.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bagtypes }\n end\n end",
"def types\n @title = 'Resource Type Listing A-Z'\n @objects_by_letter = objects_by_letter(:puppet_type)\n erb(:objects)\nend",
"def get_all_outypes\n path = \"/d2l/api/lp/#{$lp_ver}/outypes/\"\n _get(path)\nend",
"def test_ListPlatformTypes\n\t\tcolName = 'types'\n\t\tretClass = LeanTesting::PlatformType\n\t\tresp = rcol(colName, ['_id', 'name'])\n\t\t@client.debugReturn = {'data'=> JSON.generate(resp), 'status'=> 200}\n\n\t\tcol = @client.platform.types.all\n\n\t\tassert_equal resp[colName], col.toArray\n\t\tassert_instance_of retClass, col.collection[0]\n\t\tassert_equal resp['meta']['pagination']['total'], col.total\n\t\tassert_equal resp['meta']['pagination']['total_pages'], col.totalPages\n\t\tassert_equal resp['meta']['pagination']['count'], col.count\n\tend",
"def types()\n\t\t@pokemon_types = []\n\t\t@pokemon_api[\"types\"].each do |i|\n\t\t\t@pokemon_types.push(i[\"type\"][\"name\"].capitalize)\n\t\tend\n\t\treturn @pokemon_types\n\tend",
"def index\n @discipline_types = DisciplineType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @discipline_types }\n end\n end",
"def index\n @typeconges = Typeconge.all\n end",
"def index\n @task_types = TaskType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @task_types }\n end\n end",
"def index\n @identifier_types = IdentifierType.order(:position).page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @identifier_types }\n end\n end",
"def type\n @json['type']\n end",
"def show\n render json: @specification_type, serializer: Web::V1::SpecificationTypeSerializer\n end",
"def index\n @entity_types = EntityType.paginate(:page => params[:page], :per_page => per_page).order(sort_column + ' ' + sort_direction)\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @entity_types }\n end\n end",
"def index\n @ftypes = Ftype.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ftypes }\n end\n end",
"def index\n @title = \"Типы лечения\"\n @treatment_types = TreatmentType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @treatment_types }\n end\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vehicle_type }\n end\n end",
"def index\n @recipe_types = RecipeType.all\n end",
"def index\n @spec_types = SpecType.all\n end",
"def mock_types(extra=[])\n types = extra.concat(fixture_cartridges)\n ActiveResource::HttpMock.respond_to(false) do |mock|\n mock.get '/broker/rest/cartridges.json', anonymous_json_header, types.to_json\n end\n types = CartridgeType.cached.all\n assert types.length > 0\n assert Rails.cache.read(CartridgeType.cached.send(:cache_key_for, :find_every))\n types\n end",
"def index\n @bike_types = BikeType.all.order(\"updated_at DESC\").order(\"created_at DESC\")\n\n render json: @bike_types #each_serializer: Web::V1::BikeTypeSerializer\n end",
"def index\n @leavetypes = Leavetype.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @leavetypes }\n end\n end",
"def index\n @leavetypes = Leavetype.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @leavetypes }\n end\n end",
"def all_of_type\n Resource::AllOfType.new(type)\n end",
"def index\n @mtypes = Mtype.order(:code)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mtypes }\n end\n end",
"def index\n @event_types = EventType.sorted\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @event_types }\n end\n end",
"def get_universe_types_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UniverseApi.get_universe_types ...\"\n end\n if opts[:'datasource'] && !['tranquility', 'singularity'].include?(opts[:'datasource'])\n fail ArgumentError, 'invalid value for \"datasource\", must be one of tranquility, singularity'\n end\n if !opts[:'page'].nil? && opts[:'page'] < 1\n fail ArgumentError, 'invalid value for \"opts[:\"page\"]\" when calling UniverseApi.get_universe_types, must be greater than or equal to 1.'\n end\n\n # resource path\n local_var_path = \"/universe/types/\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'datasource'] = opts[:'datasource'] if !opts[:'datasource'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'user_agent'] = opts[:'user_agent'] if !opts[:'user_agent'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'X-User-Agent'] = opts[:'x_user_agent'] if !opts[:'x_user_agent'].nil?\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<Integer>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UniverseApi#get_universe_types\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n @food_type_id = @foodTypes.first\n\n if params['type']\n @foods = Food.includes(:type).includes(:nutritional_information).where( type_id: params['type']['type_id']).paginate(page: params[:page])\n else\n @foods = Food.includes(:type).includes(:nutritional_information).where( type_id: @food_type_id).paginate(page: params[:page])\n end\n\n respond_with @foods\n end",
"def set_thing_type\n @thing_type = ThingType.find(params[:id])\n end",
"def index\n @pubtypes = Pubtype.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pubtypes }\n end\n end",
"def index\n @ctypes = Ctype.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ctypes }\n end\n end",
"def index\n authorize! :show, PointsEntryType\n load_active_points_entry_types\n\n respond_to do |format|\n format.html\n format.json { render json: @points_entry_types }\n end\n end",
"def index\n @am_run_observation_types = AmRunObservationType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @am_run_observation_types }\n end\n end",
"def describe_types\n [@options[:type]].flatten.join('/')\n end",
"def index\n @specialties = Specialty.all\n\n render json: @specialties\n end",
"def index\n @task_types = @project.task_types\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @task_types }\n end\n end",
"def show\n @kind = Kind.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kind }\n end\n end"
] | [
"0.77523476",
"0.70706415",
"0.6908508",
"0.66675395",
"0.6655826",
"0.6577568",
"0.65704393",
"0.65353847",
"0.6500588",
"0.6479018",
"0.6475635",
"0.64227796",
"0.6385143",
"0.6375576",
"0.6360951",
"0.6337234",
"0.6300508",
"0.6299166",
"0.6293892",
"0.6274894",
"0.626127",
"0.6241301",
"0.6236898",
"0.62300366",
"0.62289566",
"0.6228354",
"0.6215188",
"0.6187156",
"0.61595374",
"0.6134495",
"0.6134489",
"0.6098777",
"0.6082129",
"0.60645264",
"0.60501134",
"0.6047527",
"0.60460275",
"0.6045636",
"0.60354143",
"0.6028912",
"0.6027977",
"0.60267025",
"0.6006761",
"0.60008603",
"0.59968644",
"0.5984324",
"0.59768647",
"0.5972628",
"0.5959827",
"0.59481925",
"0.5948127",
"0.59444284",
"0.59273094",
"0.59234095",
"0.592279",
"0.59222764",
"0.5922161",
"0.591983",
"0.5909111",
"0.5908035",
"0.5907785",
"0.5902875",
"0.588426",
"0.5877931",
"0.5864052",
"0.58538705",
"0.58374226",
"0.5834323",
"0.583158",
"0.582896",
"0.5821649",
"0.5819711",
"0.5816484",
"0.5808069",
"0.5800353",
"0.57959735",
"0.5786895",
"0.57864743",
"0.5786214",
"0.57803273",
"0.57787275",
"0.5778593",
"0.5777903",
"0.5777536",
"0.57735115",
"0.57735115",
"0.57647896",
"0.57563436",
"0.5754054",
"0.57333976",
"0.573073",
"0.5728573",
"0.57199097",
"0.5716678",
"0.57159036",
"0.57099664",
"0.57096565",
"0.57034606",
"0.5699972",
"0.56935126"
] | 0.715947 | 1 |
GET /thing_types/1 GET /thing_types/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n authorize @thing, :get_types?\n @thing_types = @thing.thing_types\n end",
"def show\n @type = Type.find(params[:id])\n @things = @type.things\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @type }\n end\n end",
"def index\n @thing_types = ThingType.all\n end",
"def show\n if params[:term]\n @types = Type.all(:conditions => ['typeName LIKE ?', \"%#{params[:term]}%\"])\n else\n @type = Type.find(params[:id])\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @types }\n end\n end",
"def index\n @clothing_types = ClothingType.all\n end",
"def index\n @types = Type.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @types.lookup(params[:q]) }\n end\n end",
"def show\n @realty_type = RealtyType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @realty_type }\n end\n end",
"def index\n render json: usage(params[:type])\n end",
"def set_thing_type\n @thing_type = ThingType.find(params[:id])\n end",
"def pet_types\r\n BnetApi::make_request('/wow/data/pet/types')\r\n end",
"def index\n @special_needs_types = SpecialNeedsType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @special_needs_types }\n end\n end",
"def show\n @thing = Thing.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @thing }\n end\n end",
"def show\n @kind = Kind.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kind }\n end\n end",
"def index\n @taxonomies = Taxonomy.find_all_by_taxonomy_type(params[:taxonomy_type].presence || 'category')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @taxonomies }\n end\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @resource_types }\n end\n end",
"def index\n @entry_types = EntryType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @entry_types }\n end\n end",
"def index\n @sample_types = SampleType.all.sort_by(&:name)\n @first = if @sample_types.any?\n @sample_types[0].name\n else\n 'no sample types'\n end\n\n respond_to do |format|\n format.html { render layout: 'aq2' }\n format.json do\n render json: @sample_types\n .sort { |a, b| a.name <=> b.name }\n .to_json(methods: :field_types)\n end\n end\n end",
"def index\n @typings = Typing.all\n end",
"def index\n @vehicle_types = VehicleType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @vehicle_types }\n end\n end",
"def show\n @entry_type = EntryType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @entry_type }\n end\n end",
"def show\n @building_type = BuildingType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @building_type }\n end\n end",
"def index \n respond_to do |format|\n format.html # index.html.erb\n format.json { \n asset_types = AssetType.all\n render json: asset_types \n }\n end\n end",
"def show\n @observation_type = ObservationType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @observation_type }\n end\n end",
"def type\n @json['type']\n end",
"def index\n @hardware_types = HardwareType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @hardware_types }\n end\n end",
"def show\n @category_type = CategoryType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category_type }\n end\n end",
"def show\n render json: @specification_type, serializer: Web::V1::SpecificationTypeSerializer\n end",
"def index\n @observation_types = ObservationType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @observation_types }\n end\n end",
"def index\n @weapons_types = WeaponsType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @weapons_types }\n end\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vehicle_type }\n end\n end",
"def show\n @special_needs_type = SpecialNeedsType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @special_needs_type }\n end\n end",
"def show\n @client_type = ClientType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client_type }\n end\n end",
"def index\n @language_types = LanguageType.all\n\n render json: @language_types\n end",
"def places_kinds\n render json: Place.places_kinds\n end",
"def index\n @type_people = TypePerson.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @type_people }\n end\n end",
"def index\n @talk_types = TalkType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @talk_types }\n end\n end",
"def show\n @appliance_type = ApplianceType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @appliance_type }\n end\n end",
"def show\n @types_of_apprenticeship = TypesOfApprenticeship.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @types_of_apprenticeship }\n end\n end",
"def index\n @food_type_id = @foodTypes.first\n\n if params['type']\n @foods = Food.includes(:type).includes(:nutritional_information).where( type_id: params['type']['type_id']).paginate(page: params[:page])\n else\n @foods = Food.includes(:type).includes(:nutritional_information).where( type_id: @food_type_id).paginate(page: params[:page])\n end\n\n respond_with @foods\n end",
"def show\n @jewelry_type = JewelryType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @jewelry_type }\n end\n end",
"def show\n @type_person = TypePerson.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @type_person }\n end\n end",
"def show\n @girltype = Girltype.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @girltype }\n end\n end",
"def index\n @sample_types = SampleType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sample_types }\n end\n end",
"def index\n @act_types = ActType.order(:name).page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @act_types }\n end\n end",
"def show\n @type_of_cleaning_and_washing = TypeOfCleaningAndWashing.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @type_of_cleaning_and_washing }\n end\n end",
"def show\n @gl_type = GlType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gl_type }\n end\n end",
"def find(id)\n response = RestClient.get(\"#{@type.Resource}/#{id}\")\n @type.from_json response['data']\n end",
"def index\n @technotypes = Technotype.all\n\n respond_to do |format|\n format.json { render json: @technotypes, status: 200 }\n end\n end",
"def show\n @all_type=Api::V1::AdminType.all\n render json: @all_type\n end",
"def index\n @crate_types = CrateType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @crate_types }\n end\n end",
"def show\n @type = Type.find(params[:id])\n end",
"def show\n @person = people_type.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person }\n end\n end",
"def types\n types = Question.distinct.pluck(:type)\n render json: types.to_a\n end",
"def show\n @weapons_type = WeaponsType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @weapons_type }\n end\n end",
"def index\n @specification_types = SpecificationType.all.order(\"display_order\")\n\n render json: @specification_types, each_serializer: Web::V1::SpecificationTypeSerializer\n end",
"def show\n @act_type = ActType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @act_type }\n end\n end",
"def show\n @hardware_type = HardwareType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @hardware_type }\n end\n end",
"def index\n @realty_types = RealtyType.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @realty_types }\n end\n end",
"def index\n types = @user.tried_beer_ratings.last.beer_types.map do |type|\n {name: type.name, description: type.beg_description}\n end\n render json: types\n end",
"def show\n @metric_type = MetricType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @metric_type }\n end\n end",
"def show\n @sample_type = SampleType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sample_type }\n end\n end",
"def show\n @itype = Itype.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @itype }\n end\n end",
"def show\n @question_type = QuestionType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @question_type }\n end\n end",
"def index\n @types = Type.all\n end",
"def create\n @thing_type = ThingType.new(thing_type_params)\n\n respond_to do |format|\n if @thing_type.save\n format.html { redirect_to @thing_type, notice: 'Thing type was successfully created.' }\n format.json { render :show, status: :created, location: @thing_type }\n else\n format.html { render :new }\n format.json { render json: @thing_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @weapon_types = WeaponType.all\n\n render json: @weapon_types\n end",
"def index\n @run_types = RunType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @run_types }\n end\n end",
"def show\n @collection_type = CollectionType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @collection_type }\n end\n end",
"def index\n @resources = Resource.eager_load(:resource_type).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @resources }\n end\n end",
"def show\n @talk_type = TalkType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @talk_type }\n end\n end",
"def index\n @novelty_types = NoveltyType.all\n end",
"def index\n @trait_types = TraitType.all\n\n render json: @trait_types\n end",
"def show\n @talktype = Talktype.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @talktype }\n end\n end",
"def index\n @facts = fact_type.all\n @title = fact_type\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @facts }\n end\n end",
"def show\n @instance_type = InstanceType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @instance_type }\n end\n end",
"def getPageInfoByIDType(id, type)\n request('getPageInfoByIDType', {'id' => id, 'type' => type})\nend",
"def index\n @cloth_types = ClothType.all\n end",
"def index\n @shape_types = ShapeType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shape_types }\n end\n end",
"def show\n @incident_type = IncidentType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @incident_type }\n end\n end",
"def index\n @techaxis_types = TechaxisType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @techaxis_types }\n end\n end",
"def type\n response[\"type\"]\n end",
"def type\n response[\"type\"]\n end",
"def show\n @crate_type = CrateType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @crate_type }\n end\n end",
"def show\n @ctype = Ctype.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ctype }\n end\n end",
"def show\n render json: @bike_type\n end",
"def index\n @types = ItemType.all\n end",
"def show\n respond_to do |format|\n format.html\n format.json { render json: @typegroup }\n end\n end",
"def show\n @value_type = ValueType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @value_type }\n end\n end",
"def index\n @product_types = ProductType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @product_types }\n end\n end",
"def get(type, id)\n info = json_get(@target, \"#{type_info(type, :path)}/#{Addressable::URI.encode(id)}\",\n @key_style, headers)\n\n fake_client_id(info) if type == :client # hide client reply, not quite scim\n info\n end",
"def index\n @product_types = ProductType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @product_types }\n end\n end",
"def show\n @page_type = PageType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @page_type }\n end\n end",
"def get_thing(query_hash)\n query = {\"type\" => \"/type/edition\"}.merge(query_hash)\n response = open(@api_url + \"/things?query=\" + CGI.escape(query.to_json) ).read\n JSON.parse(response)\n end",
"def resource_type\n /(\\/api\\/(?<type>\\w+)\\/?)/ =~ full_url\n type.capitalize\n end",
"def index\n @material_types = MaterialType.all\n\n render json: @material_types\n end",
"def show\n @business_type = BusinessType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @business_type }\n end\n end",
"def type_params\n params.from_jsonapi.require(:type).permit(:name)\n end",
"def show\n render json: @trait_type\n end",
"def type\n @json_body['type']\n end",
"def thing_type_id\n return @children['thing-type-id'][:value]\n end",
"def show\n @ope_kind = OpeKind.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ope_kind }\n end\n end"
] | [
"0.73535776",
"0.7349672",
"0.68903476",
"0.6349735",
"0.63371956",
"0.63362056",
"0.632931",
"0.62958324",
"0.6260286",
"0.62339693",
"0.6182233",
"0.61668485",
"0.6151782",
"0.6129324",
"0.6118446",
"0.6093532",
"0.6080097",
"0.6009512",
"0.6005692",
"0.59963727",
"0.59903747",
"0.5986856",
"0.5980936",
"0.59786916",
"0.595354",
"0.594698",
"0.5946426",
"0.5939617",
"0.5922061",
"0.5910908",
"0.5892151",
"0.588684",
"0.5876616",
"0.58599514",
"0.58548343",
"0.5853578",
"0.5853554",
"0.5843647",
"0.5842245",
"0.58389103",
"0.5830887",
"0.5827798",
"0.5822111",
"0.5820371",
"0.5797357",
"0.5796267",
"0.5788879",
"0.5787302",
"0.57839835",
"0.5782756",
"0.57766336",
"0.5770362",
"0.57679063",
"0.5759112",
"0.5755952",
"0.5755309",
"0.57549584",
"0.5744259",
"0.5738153",
"0.57296246",
"0.5728828",
"0.57247096",
"0.5724426",
"0.57220185",
"0.57199496",
"0.5718745",
"0.5717303",
"0.5716361",
"0.5715096",
"0.571468",
"0.5712987",
"0.5710578",
"0.57101756",
"0.57099456",
"0.570523",
"0.5699041",
"0.568873",
"0.5680485",
"0.56803447",
"0.56675243",
"0.56659806",
"0.56659806",
"0.5657522",
"0.56483793",
"0.56442773",
"0.5639823",
"0.56383115",
"0.5633618",
"0.56328017",
"0.5626001",
"0.56196535",
"0.5615513",
"0.561293",
"0.5610022",
"0.5610012",
"0.5605171",
"0.56024945",
"0.5602093",
"0.55997336",
"0.5593123",
"0.55907017"
] | 0.0 | -1 |
POST /thing_types POST /thing_types.json | def create
@thing_type = ThingType.new(thing_type_params)
respond_to do |format|
if @thing_type.save
format.html { redirect_to @thing_type, notice: 'Thing type was successfully created.' }
format.json { render :show, status: :created, location: @thing_type }
else
format.html { render :new }
format.json { render json: @thing_type.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def type_params\n params.from_jsonapi.require(:type).permit(:name)\n end",
"def pet_types\r\n BnetApi::make_request('/wow/data/pet/types')\r\n end",
"def clothing_type_params\n params.require(:clothing_type).permit(:name)\n end",
"def thing_type_params\n params.require(:thing_type).permit(:name, :avatar)\n end",
"def add_dummy_type\n params[:data] ||= {}\n params[:data][:type] = resource_klass._type.to_s\n end",
"def add_thing( thing )\n data = {\n token: @applicationToken,\n name: thing.name,\n display_name: thing.display_name\n }\n if( thing.product_type.length > 0 )\n data[:product_type] = thing.product_type\n end\n\n @httpHelper.post_data( 'thing', data )\n end",
"def create\n @clothing_type = ClothingType.new(clothing_type_params)\n\n respond_to do |format|\n if @clothing_type.save\n format.html { redirect_to @clothing_type, notice: 'Clothing type was successfully created.' }\n format.json { render :show, status: :created, location: @clothing_type }\n else\n format.html { render :new }\n format.json { render json: @clothing_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_types\n @types.each do |type|\n create_type(type) unless Type.where(name: type['name']).first\n end\n end",
"def set_thing_type\n @thing_type = ThingType.find(params[:id])\n end",
"def create\n @realty_type = RealtyType.new(params[:realty_type])\n\n respond_to do |format|\n if @realty_type.save\n format.html { redirect_to @realty_type, notice: 'Realty type was successfully created.' }\n format.json { render json: @realty_type, status: :created, location: @realty_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @realty_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n authorize @thing, :get_types?\n @thing_types = @thing.thing_types\n end",
"def create\n @type = Type.new(type_params)\n\n unless @type.save\n render json: @type.errors, status: :unprocessable_entity\n end\n \n end",
"def index\n @thing_types = ThingType.all\n end",
"def create\n @observation_type = ObservationType.new(params[:observation_type])\n\n respond_to do |format|\n if @observation_type.save\n format.html { redirect_to @observation_type, notice: 'Observation type was successfully created.' }\n format.json { render json: @observation_type, status: :created, location: @observation_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @observation_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @novelty_type = NoveltyType.new(novelty_type_params)\n\n respond_to do |format|\n if @novelty_type.save\n format.html { redirect_to @novelty_type, notice: 'Novelty type was successfully created.' }\n format.json { render :show, status: :created, location: @novelty_type }\n else\n format.html { render :new }\n format.json { render json: @novelty_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @valid_type = ValidType.new(valid_type_params)\n @valid_type.typed = true\n\n respond_to do |format|\n if @valid_type.save\n format.html { redirect_to valid_types_path, notice: 'Entity Type was successfully created.' }\n format.json { render :show, status: :created, location: @valid_type }\n else\n format.html { render :new }\n format.js { render :new }\n format.json { render json: @valid_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def housing_type_params\n params.require(:housing_type).permit(:name)\n end",
"def create\n field_type_ids = params[:entry_type].delete(\"field_type_ids\")\n @entry_type = EntryType.new(params[:entry_type])\n @entry_type.field_type_ids = field_type_ids\n @entry_type.form_code = build_form_code(@entry_type.field_types)\n @entry_type.model_code = build_model_code(@entry_type.name, @entry_type.field_types)\n @entry_type.model = build_model_from_code(@entry_type)\n\n respond_to do |format|\n if @entry_type.save\n format.html { redirect_to @entry_type, notice: 'Entry type was successfully created.' }\n format.json { render json: @entry_type, status: :created, location: @entry_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @entry_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @register_animal_type = Register::AnimalType.new(register_animal_type_params)\n\n respond_to do |format|\n if @register_animal_type.save\n format.html { redirect_to register_animal_types_path, success: 'O tipo de animal foi criado com sucesso.' }\n format.json { render :index, status: :created, location: @register_animal_type }\n else\n format.html { render :new }\n format.json { render json: @register_animal_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_types\n\t[]\nend",
"def create_types\n\t[]\nend",
"def create_break_type(body:)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::POST,\n '/v2/labor/break-types',\n 'default')\n .header_param(new_parameter('application/json', key: 'Content-Type'))\n .body_param(new_parameter(body))\n .header_param(new_parameter('application/json', key: 'accept'))\n .body_serializer(proc do |param| param.to_json unless param.nil? end)\n .auth(Single.new('global')))\n .response(new_response_handler\n .deserializer(APIHelper.method(:json_deserialize))\n .is_api_response(true)\n .convertor(ApiResponse.method(:create)))\n .execute\n end",
"def create\n @collection = current_user.collections.find(params[:collection_id])\n @entity_type = @collection.entity_types.new(params[:entity_type])\n\n respond_to do |format|\n if @entity_type.save\n format.html { redirect_to collection_entity_types_path(@collection), notice: 'Type was successfully created.' }\n format.json { render json: @entity_type, status: :created, location: @entity_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @entity_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def type_params\n params.require(:type).permit( :name)\n end",
"def type_params\n params.require(:type).permit(:name)\n end",
"def create\n @type = Type.new(type_params)\n @sub_types = params[:subtype_attributes]\n if @type.save\n @sub_types.each do |subtype|\n @subtype = @type.subtype.new\n @subtype.name = subtype[\"name\"]\n @subtype.code = subtype[\"code\"]\n @subtype.save\n end\n flash[:notice] = 'Type was successfully created.'\n redirect_to types_path\n else\n flash[:error] = @type.errors.full_messages\n render \"new\"\n end\n end",
"def create\n @spec_type = SpecType.new(spec_type_params)\n\n respond_to do |format|\n if @spec_type.save\n format.html { redirect_to @spec_type, notice: 'Spec type was successfully created.' }\n format.json { render :show, status: :created, location: @spec_type }\n else\n format.html { render :new }\n format.json { render json: @spec_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def json_params\n params.require(:json).permit(:type, :data)\n end",
"def create\n @recipe_type = RecipeType.new(recipe_type_params)\n\n respond_to do |format|\n if @recipe_type.save\n format.html { redirect_to @recipe_type, notice: \"Recipe type was successfully created.\" }\n format.json { render :show, status: :created, location: @recipe_type }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @recipe_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def register_animal_type_params\n params.require(:register_animal_type).permit(:nme_animal, :obs, :image)\n end",
"def create_types\n\t\t[]\n\tend",
"def create_types\n\t\t[]\n\tend",
"def create\n @entity_type = EntityType.new(entity_type_params)\n @entity_type.collection_id = @collection.id\n respond_to do |format|\n if @entity_type.save\n format.html { redirect_to collection_entity_types_path(@collection), notice: 'The entity type was successfully created.' }\n format.json { render :show, status: :created, location: @entity_type }\n else\n format.html { render :new }\n format.json { render json: @entity_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def wine_type_params\n params.require(:wine_type).permit(:type, :graphic_url, :food_id)\n end",
"def create\n @building_type = BuildingType.new(params[:building_type])\n\n respond_to do |format|\n if @building_type.save\n format.html { redirect_to @building_type, notice: 'Building type was successfully created.' }\n format.json { render json: @building_type, status: :created, location: @building_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @building_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @worktype = current_ou.worktypes.new(worktype_params)\n\n respond_to do |format|\n if @worktype.save\n format.html { redirect_to worktypes_path, notice: 'Worktype was successfully created.' }\n format.json { render :show, status: :created, location: @worktype }\n else\n format.html { render :new }\n format.json { render json: @worktype.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @thing = Thing.new(params[:thing])\n\n respond_to do |format|\n if @thing.save\n format.html { redirect_to @thing, notice: 'Thing was successfully created.' }\n format.json { render json: @thing, status: :created, location: @thing }\n else\n format.html { render action: \"new\" }\n format.json { render json: @thing.errors, status: :unprocessable_entity }\n end\n end\n end",
"def rec_new\n @beer_types_to_try = BeerType.limit(6).map{|type| [type.id, type.name]}\n render json: @beer_types_to_try\n end",
"def create\n @jewelry_type = JewelryType.new(params[:jewelry_type])\n\n respond_to do |format|\n if @jewelry_type.save\n format.html { redirect_to @jewelry_type, notice: 'Jewelry type was successfully created.' }\n format.json { render json: @jewelry_type, status: :created, location: @jewelry_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @jewelry_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @special_needs_type = SpecialNeedsType.new(params[:special_needs_type])\n\n respond_to do |format|\n if @special_needs_type.save\n format.html { redirect_to @special_needs_type, :notice => 'Tipo de necessidade especial criada com sucesso.' }\n format.json { render :json => @special_needs_type, :status => :created, :location => @special_needs_type }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @special_needs_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @typing = Typing.new(typing_params)\n\n respond_to do |format|\n if @typing.save\n format.html { redirect_to @typing, notice: 'Typing was successfully created.' }\n format.json { render :show, status: :created, location: @typing }\n else\n format.html { render :new }\n format.json { render json: @typing.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @hardware_type = HardwareType.new(params[:hardware_type])\n\n respond_to do |format|\n if @hardware_type.save\n format.html { redirect_to @hardware_type, notice: 'Hardware type was successfully created.' }\n format.json { render json: @hardware_type, status: :created, location: @hardware_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @hardware_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @act_type = ActType.new(params[:act_type])\n\n respond_to do |format|\n if @act_type.save\n format.html { redirect_to @act_type, notice: 'Тип документа успешно создан.' }\n format.json { render json: @act_type, status: :created, location: @act_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @act_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def cloth_type_params\n params.require(:cloth_type).permit(:name)\n end",
"def create\n @itemtype = Itemtype.new(itemtype_params)\n\n respond_to do |format|\n if @itemtype.save\n format.html { redirect_to @itemtype, notice: 'Itemtype was successfully created.' }\n format.json { render :show, status: :created, location: @itemtype }\n else\n format.html { render :new }\n format.json { render json: @itemtype.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @trait_type = TraitType.new(trait_type_params)\n\n if @trait_type.save\n render json: @trait_type, status: :created, location: @trait_type\n else\n render json: @trait_type.errors, status: :unprocessable_entity\n end\n end",
"def create\n @treatment_type = TreatmentType.new(params[:treatment_type])\n\n respond_to do |format|\n if @treatment_type.save\n flash[:success] = \"Тип успешно добавлен.\"\n format.html { redirect_to @treatment_type }\n format.json { render json: @treatment_type, status: :created, location: @treatment_type }\n else\n flash.now[:error] = \"Тип с таким названием не может быть добавлен!\"\n format.html { render action: \"new\" }\n format.json { render json: @treatment_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @appliance_type = ApplianceType.new(params[:appliance_type])\n\n respond_to do |format|\n if @appliance_type.save\n format.html { redirect_to @appliance_type, notice: 'Appliance type was successfully created.' }\n format.json { render json: @appliance_type, status: :created, location: @appliance_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @appliance_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @language_type = LanguageType.new(language_type_params)\n\n if @language_type.save\n render json: @language_type, status: :created, location: @language_type\n else\n render json: @language_type.errors, status: :unprocessable_entity\n end\n end",
"def create\n @specialty = Specialty.new(params[:specialty])\n\n respond_to do |format|\n if @specialty.save\n format.html { redirect_to posts_path, notice: 'Specialty was successfully created.' }\n format.json { render json: @specialty, status: :created, location: @specialty }\n else\n format.html { render action: \"new\" }\n format.json { render json: @specialty.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @model_type = ModelType.new(model_type_params)\n @model = Model.friendly.find(params[:model_id])\n respond_to do |format|\n if @model_type.save\n format.html { render :new }\n format.json { render :show, status: :created, location: @model_type }\n else\n format.html { render :new }\n format.json { render json: @model_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @drug_test = DrugTest.new(params[:drug_test])\n @test_types = params[:test_types]\n @test_types_all = []\n @test_types.each do |id| \n @test_types_all +=[TestType.find_by_id(id)]\n end\n @drug_test.test_types=@test_types_all\n respond_to do |format|\n \n if @drug_test.save\n format.html { redirect_to @drug_test, notice: 'Teste de droga foi criado com sucesso.' }\n format.json { render json: @drug_test, status: :created, location: @drug_test }\n else\n format.html { render action: \"new\" }\n format.json { render json: @drug_test.errors, status: :unprocessable_entity }\n end\n end\n end",
"def animal_type_params\n params.require(:animal_type).permit(:nome)\n end",
"def create\n @cloth_type = ClothType.new(cloth_type_params)\n\n respond_to do |format|\n if @cloth_type.save\n format.html { redirect_to @cloth_type, notice: \"Cloth type was successfully created.\" }\n format.json { render :show, status: :created, location: @cloth_type }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @cloth_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @entity_type = EntityType.new(entity_type_params)\n\n respond_to do |format|\n if @entity_type.save\n format.html { redirect_to @entity_type, notice: 'Entity type was successfully created.' }\n format.json { render :show, status: :created, location: @entity_type }\n else\n format.html { render :new }\n format.json { render json: @entity_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @paper_type = PaperType.new(params[:paper_type])\n\n respond_to do |format|\n if @paper_type.save\n format.html { redirect_to @paper_type, notice: 'Paper type was successfully created.' }\n format.json { render json: @paper_type, status: :created, location: @paper_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @paper_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def evals_types\n call_path = \"evals/types\"\n data = build_post_data(\"\")\n perform_post(build_url(call_path), data)\n end",
"def create\n\n @object_type = ObjectType.new(params[:object_type].except(:rows, :columns))\n\n if params[:object_type][:handler] == 'collection'\n @object_type.rows = params[:object_type][:rows]\n @object_type.columns = params[:object_type][:columns]\n end\n\n respond_to do |format|\n if @object_type.save\n format.html { redirect_to object_types_url, notice: \"Object type #{@object_type.name} was successfully created.\" }\n format.json { render json: @object_type, status: :created, location: @object_type }\n else\n format.html { render action: 'new', layout: 'aq2-plain' }\n format.json { render json: @object_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @modeltype = Modeltype.new(modeltype_params)\n\n respond_to do |format|\n if @modeltype.save\n format.html { redirect_to @modeltype, notice: 'Modeltype was successfully created.' }\n format.json { render :show, status: :created, location: @modeltype }\n else\n format.html { render :new }\n format.json { render json: @modeltype.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @techaxis_type = TechaxisType.new(params[:techaxis_type])\n\n respond_to do |format|\n if @techaxis_type.save\n format.html { redirect_to @techaxis_type, :notice => t('controllermessage.insert') }\n format.json { render :json => @techaxis_type, :status => :created, :location => @techaxis_type }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @techaxis_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @weapon_type = WeaponType.new(weapon_type_params)\n\n if @weapon_type.save\n render json: @weapon_type, status: :created, location: @weapon_type\n else\n render json: @weapon_type.errors, status: :unprocessable_entity\n end\n end",
"def create\n # @thing = Thing.new(thing_params)\n\n # respond_to do |format|\n # if @thing.save\n # format.html { redirect_to @thing, notice: 'Thing was successfully created.' }\n # format.json { render :show, status: :created, location: @thing }\n # else\n # format.html { render :new }\n # format.json { render json: @thing.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"def create\n @weapons_type = WeaponsType.new(params[:weapons_type])\n\n respond_to do |format|\n if @weapons_type.save\n format.html { redirect_to @weapons_type, notice: 'Weapons type was successfully created.' }\n format.json { render json: @weapons_type, status: :created, location: @weapons_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @weapons_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @specialty = Specialty.new(specialty_params)\n\n if @specialty.save\n render json: @specialty, status: :created, location: @specialty\n else\n render json: @specialty.errors, status: :unprocessable_entity\n end\n end",
"def thing_params\n params.require(:thing).permit(:name, :thing_id, :created_at, :updated_at)\n end",
"def create\n @kind = Kind.new(params[:kind])\n\n respond_to do |format|\n if @kind.save\n format.html { redirect_to @kind, notice: 'Kind was successfully created.' }\n format.json { render json: @kind, status: :created, location: @kind }\n else\n format.html { render action: \"new\" }\n format.json { render json: @kind.errors, status: :unprocessable_entity }\n end\n end\n end",
"def type_name_params\n params.require(:type_name).permit(:type_id, :name)\n end",
"def cmd_types argv\n setup argv\n response = @api.types\n msg response\n return response\n end",
"def entity_type_params\n params.require(:entity_type).permit(:type)\n end",
"def create\n section_type_ids = params[:site_type].delete(\"section_type_ids\")\n @site_type = SiteType.new(params[:site_type])\n @site_type.section_type_ids = section_type_ids\n\n respond_to do |format|\n if @site_type.save\n format.html { redirect_to @site_type, notice: 'Site type was successfully created.' }\n format.json { render json: @site_type, status: :created, location: @site_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @site_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @bike_type = BikeType.new(bike_type_params)\n\n if @bike_type.save\n audit(@bike_type, current_user)\n render json: @bike_type, status: :created\n else\n render json: @bike_type.errors, status: :unprocessable_entity\n end\n end",
"def create\n @thing = current_user.things.new(params[:thing])\n\n respond_to do |format|\n if @thing.save\n format.html { redirect_to things_path }\n format.json { render json: @thing, status: :created, location: @thing }\n else\n format.html { render action: \"new\" }\n format.json { render json: @thing.errors, status: :unprocessable_entity }\n end\n end\n end",
"def creature_type_params\n params.require(:creature_type).permit(:name)\n end",
"def location_type_params\n params.require(:location_type).permit(:name,\n :location_types => [])\n end",
"def types\n types = Question.distinct.pluck(:type)\n render json: types.to_a\n end",
"def types\n commit('types', nil)\n end",
"def create\n @techaxis = Techaxis.new(params[:techaxis])\n @techaxis.techaxis_type_id = params[:techaxis_type_id]\n \n respond_to do |format|\n if @techaxis.save\n format.html { redirect_to techaxis_type_techaxes_path, :notice => t('controllermessage.insert') }\n format.json { render :json => @techaxis, :status => :created, :location => @techaxis }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @techaxis.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @question_type = QuestionType.new(params[:question_type])\n\n respond_to do |format|\n if @question_type.save\n format.html { redirect_to @question_type, notice: 'Question type was successfully created.' }\n format.json { render json: @question_type, status: :created, location: @question_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @question_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @talk_type = TalkType.new(params[:talk_type])\n\n respond_to do |format|\n if @talk_type.save\n flash[:notice] = 'Talk type was successfully created.'\n format.html { redirect_to :action => :index }\n format.json { render json: @talk_type, status: :created, location: @talk_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @talk_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @talktype = Talktype.new(params[:talktype])\n\n respond_to do |format|\n if @talktype.save\n format.html { redirect_to @talktype, notice: 'Talktype was successfully created.' }\n format.json { render json: @talktype, status: :created, location: @talktype }\n else\n format.html { render action: \"new\" }\n format.json { render json: @talktype.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @incident_type = IncidentType.new(params[:incident_type])\n\n respond_to do |format|\n if @incident_type.save\n format.html { redirect_to @incident_type, notice: 'Incident type was successfully created.' }\n format.json { render json: @incident_type, status: :created, location: @incident_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @incident_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @registry_therapy_type = Registry::TherapyType.new(registry_therapy_type_params)\n\n respond_to do |format|\n if @registry_therapy_type.save\n format.html { redirect_to @registry_therapy_type, notice: 'Tipo de terapia fue creado exitosamente.' }\n format.json { render :show, status: :created, location: @registry_therapy_type }\n else\n format.html { render :new }\n format.json { render json: @registry_therapy_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @bugtype = Bugtype.new(bugtype_params)\n\n respond_to do |format|\n if @bugtype.save\n format.html { redirect_to bugtypes_path, notice: 'Bugtype was successfully created.' }\n format.json { render :index, status: :created, location: @bugtype }\n else\n format.html { render :new }\n format.json { render json: @bugtype.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n image = {id: nil}\n if type_params[:image]\n image = Picture.create(name: type_params[:name], image: type_params[:image], description: \"Image of #{type_params[:name]} type\")\n else\n image = Picture.where(id: type_params[:image_id]).first if type_params[:image_id]\n end\n\n @type = Type.new(name: type_params[:name], description: type_params[:description], picture_id: image[:id])\n\n respond_to do |format|\n if @type.save\n format.html { redirect_to director_types_path, notice: 'Type was successfully created.' }\n format.json { render :show, status: :created, location: @type }\n else\n @pictures = Picture.where(trash: false)\n format.html { render :new }\n format.json { render json: @type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @water_type = WaterType.new(water_type_params)\n\n respond_to do |format|\n if @water_type.save\n format.html { redirect_to admin_water_types_path, notice: 'Water type was successfully created.' }\n format.json { render action: 'show', status: :created, location: @water_type }\n else\n format.html { render action: 'new' }\n format.json { render json: @water_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def activity_types_post_with_http_info(name, icon_key, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ActivityTypesApi.activity_types_post ...\"\n end\n # verify the required parameter 'name' is set\n if @api_client.config.client_side_validation && name.nil?\n fail ArgumentError, \"Missing the required parameter 'name' when calling ActivityTypesApi.activity_types_post\"\n end\n # verify the required parameter 'icon_key' is set\n if @api_client.config.client_side_validation && icon_key.nil?\n fail ArgumentError, \"Missing the required parameter 'icon_key' when calling ActivityTypesApi.activity_types_post\"\n end\n # resource path\n local_var_path = \"/activityTypes\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # form parameters\n form_params = {}\n form_params[\"name\"] = name\n form_params[\"icon_key\"] = icon_key\n form_params[\"color\"] = opts[:'color'] if !opts[:'color'].nil?\n\n # http body (model)\n post_body = nil\n auth_names = [ 'access_token' ]\n response = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ActivityTypesApi#activity_types_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return response\n end",
"def update\n\n raw = params[:sample_type]\n st = SampleType.find(raw[:id])\n\n st.name = raw[:name]\n st.description = raw[:description]\n st.save\n st.save_field_types raw[:field_types]\n\n render json: { sample_type: st }\n\n end",
"def create\n @value_type = ValueType.new(params[:value_type])\n\n respond_to do |format|\n if @value_type.save\n format.html { redirect_to @value_type, notice: 'Value type was successfully created.' }\n format.json { render json: @value_type, status: :created, location: @value_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @value_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @good_type = GoodType.new(good_type_params)\n\n respond_to do |format|\n if @good_type.save\n format.html { redirect_to @good_type, notice: 'Good type was successfully created.' }\n format.json { render :show, status: :created, location: @good_type }\n else\n format.html { render :new }\n format.json { render json: @good_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @daytype = Daytype.new(params[:daytype])\n\n respond_to do |format|\n if @daytype.save\n format.html { redirect_to @daytype, notice: 'Daytype was successfully created.' }\n format.json { render json: @daytype, status: :created, location: @daytype }\n else\n format.html { render action: \"new\" }\n format.json { render json: @daytype.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @girltype = Girltype.new(params[:girltype])\n\n respond_to do |format|\n if @girltype.save\n format.html { redirect_to @girltype, notice: 'Girltype was successfully created.' }\n format.json { render json: @girltype, status: :created, location: @girltype }\n else\n format.html { render action: \"new\" }\n format.json { render json: @girltype.errors, status: :unprocessable_entity }\n end\n end\n end",
"def trip_type_params\n params.require(:trip_type).permit(:name)\n end",
"def create\n @kind_of_boat = KindOfBoat.new(kind_of_boat_params)\n\n respond_to do |format|\n if @kind_of_boat.save\n format.html { redirect_to @kind_of_boat, notice: 'Kind of boat was successfully created.' }\n format.json { render :show, status: :created, location: @kind_of_boat }\n else\n format.html { render :new }\n format.json { render json: @kind_of_boat.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @hw_type = HwType.new(hw_type_params)\n\n respond_to do |format|\n if @hw_type.save\n format.html { redirect_to @hw_type, notice: 'Hw type was successfully created.' }\n format.json { render :show, status: :created, location: @hw_type }\n else\n format.html { render :new }\n format.json { render json: @hw_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category_type = CategoryType.new(params[:category_type])\n\n respond_to do |format|\n if @category_type.save\n format.html { redirect_to @category_type, notice: 'Category type was successfully created.' }\n format.json { render json: @category_type, status: :created, location: @category_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def novelty_type_params\n params.require(:novelty_type).permit(:description)\n end",
"def thing_category_params\n params.require(:thing_category).permit(:name)\n end",
"def create\n @nametype = Nametype.new(nametype_params)\n\n respond_to do |format|\n if @nametype.save\n format.html { redirect_to @nametype, notice: 'Nametype was successfully created.' }\n format.json { render :show, status: :created, location: @nametype }\n else\n format.html { render :new }\n format.json { render json: @nametype.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @incident_type = IncidentType.new(incident_type_params)\n\n respond_to do |format|\n if @incident_type.save\n format.html { redirect_to admin_incident_types_path, notice: 'Incident type was successfully created.' }\n format.json { render :show, status: :created, location: @incident_type }\n else\n format.html { render :new }\n format.json { render json: @incident_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @realty_type = RealtyType.new(params[:realty_type])\n\n respond_to do |format|\n if @realty_type.save\n flash[:notice] = 'RealtyType was successfully created.'\n format.html { redirect_to(@realty_type) }\n format.xml { render :xml => @realty_type, :status => :created, :location => @realty_type }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @realty_type.errors, :status => :unprocessable_entity }\n end\n end\n end"
] | [
"0.6508891",
"0.6320648",
"0.61794466",
"0.6159986",
"0.6116042",
"0.60842395",
"0.6062709",
"0.6006655",
"0.59865385",
"0.59825236",
"0.597014",
"0.595698",
"0.5864639",
"0.5772186",
"0.576734",
"0.5742168",
"0.5713445",
"0.56968474",
"0.5688395",
"0.5671396",
"0.5671396",
"0.5641232",
"0.560848",
"0.5600466",
"0.55931276",
"0.5591958",
"0.5577",
"0.5576587",
"0.55711687",
"0.55688906",
"0.5557713",
"0.5557713",
"0.555571",
"0.55486184",
"0.55250156",
"0.5511969",
"0.5508705",
"0.5499629",
"0.5497442",
"0.549245",
"0.54807454",
"0.5456865",
"0.54541546",
"0.54510176",
"0.5449131",
"0.54478925",
"0.54303133",
"0.5426736",
"0.5423979",
"0.5417928",
"0.541737",
"0.5406683",
"0.53989714",
"0.53989625",
"0.53963107",
"0.5380285",
"0.53676444",
"0.53660953",
"0.53657275",
"0.5363786",
"0.535419",
"0.53482383",
"0.5342317",
"0.5337619",
"0.5336906",
"0.53327996",
"0.53279996",
"0.5326008",
"0.5322571",
"0.53218144",
"0.5318731",
"0.53175384",
"0.5317018",
"0.5311202",
"0.5307098",
"0.53059673",
"0.53049237",
"0.5304563",
"0.5303884",
"0.5300526",
"0.53004587",
"0.5298522",
"0.52947104",
"0.5292724",
"0.52914906",
"0.5291311",
"0.5289654",
"0.5288952",
"0.528555",
"0.5282013",
"0.5281111",
"0.5277291",
"0.52771384",
"0.52702296",
"0.5266769",
"0.5260077",
"0.5259178",
"0.5258424",
"0.5253368",
"0.52517754"
] | 0.6824022 | 0 |
PATCH/PUT /thing_types/1 PATCH/PUT /thing_types/1.json | def update
respond_to do |format|
if @thing_type.update(thing_type_params)
format.html { redirect_to @thing_type, notice: 'Thing type was successfully updated.' }
format.json { render :show, status: :ok, location: @thing_type }
else
format.html { render :edit }
format.json { render json: @thing_type.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @clothing_type.update(clothing_type_params)\n format.html { redirect_to @clothing_type, notice: 'Clothing type was successfully updated.' }\n format.json { render :show, status: :ok, location: @clothing_type }\n else\n format.html { render :edit }\n format.json { render json: @clothing_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @thing = Thing.find(params[:id])\n\n respond_to do |format|\n if @thing.update_attributes(params[:thing])\n format.html { redirect_to things_path, notice: 'Your thing was successfully updated!' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @thing.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @thing = Thing.find(params[:id])\n\n respond_to do |format|\n if @thing.update_attributes(params[:thing])\n format.html { redirect_to @thing, notice: 'Thing was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @thing.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @realty_type = RealtyType.find(params[:id])\n\n respond_to do |format|\n if @realty_type.update_attributes(params[:realty_type])\n format.html { redirect_to @realty_type, notice: 'Realty type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @realty_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_thing_type\n @thing_type = ThingType.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @spec_type.update(spec_type_params)\n format.html { redirect_to @spec_type, notice: 'Spec type was successfully updated.' }\n format.json { render :show, status: :ok, location: @spec_type }\n else\n format.html { render :edit }\n format.json { render json: @spec_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch(type, info)\n path, info = type_info(type, :path), force_case(info)\n ida = type == :client ? 'client_id' : 'id'\n raise ArgumentError, \"info must include #{ida}\" unless id = info[ida]\n hdrs = headers\n if info && info['meta'] && (etag = info['meta']['version'])\n hdrs.merge!('if-match' => etag)\n end\n reply = json_parse_reply(@key_style,\n *json_patch(@target, \"#{path}/#{Addressable::URI.encode(id)}\", info, hdrs))\n\n # hide client endpoints that are not quite scim compatible\n type == :client && !reply ? get(type, info['client_id']): reply\n end",
"def update\n @thing = Thing.find(params[:id])\n params[:thing][:place_id] = place_id_from_form\n params[:thing][:owner_ids] = [ ] if params[:thing][:owner_ids].nil?\n params[:thing][:keeper_ids] = [ ] if params[:thing][:keeper_ids].nil?\n\n respond_to do |format|\n if @thing.update_attributes(params[:thing])\n format.html { redirect_to(@thing, :notice => 'Thing was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @thing.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n # respond_to do |format|\n # if @thing.update(thing_params)\n # format.html { redirect_to @thing, notice: 'Thing was successfully updated.' }\n # format.json { render :show, status: :ok, location: @thing }\n # else\n # format.html { render :edit }\n # format.json { render json: @thing.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"def update\n @special_needs_type = SpecialNeedsType.find(params[:id])\n\n respond_to do |format|\n if @special_needs_type.update_attributes(params[:special_needs_type])\n format.html { redirect_to @special_needs_type, :notice => 'Tipo de necessidade especial atualizada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @special_needs_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @novelty_type.update(novelty_type_params)\n format.html { redirect_to @novelty_type, notice: 'Novelty type was successfully updated.' }\n format.json { render :show, status: :ok, location: @novelty_type }\n else\n format.html { render :edit }\n format.json { render json: @novelty_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @recipe_type.update(recipe_type_params)\n format.html { redirect_to @recipe_type, notice: \"Recipe type was successfully updated.\" }\n format.json { render :show, status: :ok, location: @recipe_type }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @recipe_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @thing = current_user.things.find(params[:id])\n\n respond_to do |format|\n if @thing.update_attributes(params[:thing])\n format.html { redirect_to @thing }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @thing.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @type.update(type_params)\n end",
"def update!(**args)\n @kind = args[:kind] if args.key?(:kind)\n end",
"def update!(**args)\n @kind = args[:kind] if args.key?(:kind)\n end",
"def update!(**args)\n @kind = args[:kind] if args.key?(:kind)\n end",
"def update!(**args)\n @kind = args[:kind] if args.key?(:kind)\n end",
"def update!(**args)\n @kind = args[:kind] if args.key?(:kind)\n end",
"def update!(**args)\n @kind = args[:kind] if args.key?(:kind)\n end",
"def update_question_type\n form_params = params.require(:form).permit(:question_id, :question_type)\n\n render json: Question.update_question_type(form_params)\n end",
"def update\n\n raw = params[:sample_type]\n st = SampleType.find(raw[:id])\n\n st.name = raw[:name]\n st.description = raw[:description]\n st.save\n st.save_field_types raw[:field_types]\n\n render json: { sample_type: st }\n\n end",
"def update\n respond_to do |format|\n if @model_type.update(model_type_params)\n format.html { redirect_to @model_type, notice: 'Model type was successfully updated.' }\n format.json { render :show, status: :ok, location: @model_type }\n else\n format.html { render :edit }\n format.json { render json: @model_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @cloth_type.update(cloth_type_params)\n format.html { redirect_to @cloth_type, notice: \"Cloth type was successfully updated.\" }\n format.json { render :show, status: :ok, location: @cloth_type }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @cloth_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @jewelry_type = JewelryType.find(params[:id])\n\n respond_to do |format|\n if @jewelry_type.update_attributes(params[:jewelry_type])\n format.html { redirect_to @jewelry_type, notice: 'Jewelry type was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @jewelry_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_break_type(id:,\n body:)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::PUT,\n '/v2/labor/break-types/{id}',\n 'default')\n .template_param(new_parameter(id, key: 'id')\n .should_encode(true))\n .header_param(new_parameter('application/json', key: 'Content-Type'))\n .body_param(new_parameter(body))\n .header_param(new_parameter('application/json', key: 'accept'))\n .body_serializer(proc do |param| param.to_json unless param.nil? end)\n .auth(Single.new('global')))\n .response(new_response_handler\n .deserializer(APIHelper.method(:json_deserialize))\n .is_api_response(true)\n .convertor(ApiResponse.method(:create)))\n .execute\n end",
"def update \t\n record = AssetType.find(params[:id])\n record.update_attributes(params[:record])\n \n respond_to do |format|\n format.html\n format.json {\n render json: {}\n }\n end\n end",
"def change_type\n\t\t\trender json: User.update_type_by_id(params[:id], params[:type], params[:is])\n\t\tend",
"def update\n @act_type = ActType.find(params[:id])\n\n respond_to do |format|\n if @act_type.update_attributes(params[:act_type])\n format.html { redirect_to @act_type, notice: 'Данные типа документа успешно обновлены.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @act_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @trait_type = TraitType.find(params[:id])\n\n if @trait_type.update(trait_type_params)\n head :no_content\n else\n render json: @trait_type.errors, status: :unprocessable_entity\n end\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n @entry_type = EntryType.find(params[:id])\n\n respond_to do |format|\n field_type_ids = params[:entry_type].delete(\"field_type_ids\")\n @entry_type.field_type_ids = field_type_ids if field_type_ids\n params[:entry_type].delete(\"form_code\")\n if @entry_type.update_attributes(params[:entry_type])\n format.html { redirect_to @entry_type, notice: 'Entry type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @entry_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @appliance_type = ApplianceType.find(params[:id])\n\n respond_to do |format|\n if @appliance_type.update_attributes(params[:appliance_type])\n format.html { redirect_to @appliance_type, notice: 'Appliance type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @appliance_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @good_type.update(good_type_params)\n format.html { redirect_to @good_type, notice: 'Good type was successfully updated.' }\n format.json { render :show, status: :ok, location: @good_type }\n else\n format.html { render :edit }\n format.json { render json: @good_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @client_type = ClientType.find(params[:id])\n\n respond_to do |format|\n if @client_type.update_attributes(params[:client_type])\n format.html { redirect_to @client_type, notice: 'Client type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @client_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @thing_to_do.update(thing_to_do_params)\n format.html { redirect_to @thing_to_do, notice: 'Thing to do was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @thing_to_do.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @crate_type = CrateType.find(params[:id])\n\n respond_to do |format|\n if @crate_type.update_attributes(params[:crate_type])\n format.html { redirect_to @crate_type, :notice => 'Crate type was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @crate_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @kind = args[:kind] unless args[:kind].nil?\n @listings = args[:listings] unless args[:listings].nil?\n end",
"def update!(**args)\n @kind = args[:kind] unless args[:kind].nil?\n @listings = args[:listings] unless args[:listings].nil?\n end",
"def update\n @value_type = ValueType.find(params[:id])\n\n respond_to do |format|\n if @value_type.update_attributes(params[:value_type])\n format.html { redirect_to @value_type, notice: 'Value type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @value_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @breadcrumb = 'update'\n @entity_type = EntityType.find(params[:id])\n @entity_type.updated_by = current_user.id if !current_user.nil?\n \n respond_to do |format|\n if @entity_type.update_attributes(params[:entity_type])\n format.html { redirect_to @entity_type,\n notice: (crud_notice('updated', @entity_type) + \"#{undo_link(@entity_type)}\").html_safe }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @entity_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @observation_type = ObservationType.find(params[:id])\n\n respond_to do |format|\n if @observation_type.update_attributes(params[:observation_type])\n format.html { redirect_to @observation_type, notice: 'Observation type was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @observation_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @kind = Kind.find(params[:id])\n\n respond_to do |format|\n if @kind.update_attributes(params[:kind])\n format.html { redirect_to @kind, notice: 'Kind was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @kind.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to_update({thing: @author})\n end",
"def update\n prms = @boat_type.is_modification? ? modification_params : boat_type_params\n respond_to do |format|\n if @boat_type.update(prms)\n format.html { redirect_to edit_boat_type_path(@boat_type), notice: 'Тип лодки успешно обновлён' }\n format.json { render json: @boat_type.hash_view('control'), status: :ok}\n else\n format.html { render :edit }\n format.json { render json: @boat_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @kind = args[:kind] if args.key?(:kind)\n @name = args[:name] if args.key?(:name)\n @status = args[:status] if args.key?(:status)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n @gl_type = GlType.find(params[:id])\n\n respond_to do |format|\n if @gl_type.update_attributes(gl_type_params)\n format.html { redirect_to gl_types_path, notice: 'Gl type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gl_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @girltype = Girltype.find(params[:id])\n\n respond_to do |format|\n if @girltype.update_attributes(params[:girltype])\n format.html { redirect_to @girltype, notice: 'Girltype was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @girltype.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @type = args[:type] if args.key?(:type)\n @id = args[:id] if args.key?(:id)\n end",
"def update\n respond_to do |format|\n if @affected_type.update(affected_type_params)\n format.html { redirect_to @affected_type, notice: 'Affected type was successfully updated.' }\n format.json { render :show, status: :ok, location: @affected_type }\n else\n format.html { render :edit }\n format.json { render json: @affected_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @item_type.update(item_type_params)\n format.html { redirect_to @item_type, notice: 'ItemType was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @item_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @let_type.update(let_type_params)\n format.html { redirect_to @let_type, notice: 'Let type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @let_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @collection = @entity_type.collection\n respond_to do |format|\n if @entity_type.update(entity_type_params)\n format.html { redirect_to collection_entity_types_path(@collection), notice: 'The entity type was successfully updated.' }\n format.json { render :show, status: :ok, location: @entity_type }\n else\n format.html { render :edit }\n format.json { render json: @entity_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @kind_of_boat.update(kind_of_boat_params)\n format.html { redirect_to @kind_of_boat, notice: 'Kind of boat was successfully updated.' }\n format.json { render :show, status: :ok, location: @kind_of_boat }\n else\n format.html { render :edit }\n format.json { render json: @kind_of_boat.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @kind = args[:kind] if args.key?(:kind)\n @name = args[:name] if args.key?(:name)\n @starred = args[:starred] if args.key?(:starred)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n respond_to do |format|\n if @clothing.update(clothing_params)\n format.html { redirect_to @clothing, notice: 'Clothing was successfully updated.' }\n format.json { render :show, status: :ok, location: @clothing }\n else\n format.html { render :edit }\n format.json { render json: @clothing.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @brake_type.update(brake_type_params)\n format.html { redirect_to brake_types_path, notice: 'Brake type was successfully updated.' }\n format.json { render :show, status: :ok, location: @brake_type }\n else\n format.html { render :edit }\n format.json { render json: @brake_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @realty_type = RealtyType.find(params[:id])\n\n respond_to do |format|\n if @realty_type.update_attributes(params[:realty_type])\n flash[:notice] = 'RealtyType was successfully updated.'\n format.html { redirect_to(@realty_type) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @realty_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @entity_type.update(entity_type_params)\n format.html { redirect_to @entity_type, notice: 'Entity type was successfully updated.' }\n format.json { render :show, status: :ok, location: @entity_type }\n else\n format.html { render :edit }\n format.json { render json: @entity_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @building_type = BuildingType.find(params[:id])\n\n respond_to do |format|\n if @building_type.update_attributes(params[:building_type])\n format.html { redirect_to @building_type, notice: 'Building type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @building_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @api_v1_admin_type.update(api_v1_admin_type_params)\n format.html { redirect_to @api_v1_admin_type, notice: 'Admin type was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_admin_type }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_admin_type.errors, status: :unprocessable_entity }\n end\n end\n end"
] | [
"0.6670715",
"0.63565385",
"0.62737274",
"0.62680906",
"0.62027663",
"0.61963594",
"0.6146416",
"0.6131429",
"0.61234885",
"0.61108285",
"0.607953",
"0.6012331",
"0.60122883",
"0.5985591",
"0.5979754",
"0.5979754",
"0.5979754",
"0.5979754",
"0.5979754",
"0.5979754",
"0.5979047",
"0.5966593",
"0.5956399",
"0.59479374",
"0.59145516",
"0.59127265",
"0.590938",
"0.59055334",
"0.58810014",
"0.5880121",
"0.58749425",
"0.5873694",
"0.5873694",
"0.5873694",
"0.5873694",
"0.5873694",
"0.5873694",
"0.5873694",
"0.5873694",
"0.5873694",
"0.5873694",
"0.5873694",
"0.5873694",
"0.5873694",
"0.5873694",
"0.5873694",
"0.5873694",
"0.5873694",
"0.5873694",
"0.5873694",
"0.5873694",
"0.5873694",
"0.5873694",
"0.5873694",
"0.5873694",
"0.5873694",
"0.5873694",
"0.5873694",
"0.5873694",
"0.5873694",
"0.5873694",
"0.5873694",
"0.5873694",
"0.5873694",
"0.5873694",
"0.5873694",
"0.5873694",
"0.5873694",
"0.5873694",
"0.5873694",
"0.58705485",
"0.58577347",
"0.5856734",
"0.58430403",
"0.5834793",
"0.5834153",
"0.5827904",
"0.5827904",
"0.5825869",
"0.5821701",
"0.58190286",
"0.58187914",
"0.5818313",
"0.58150977",
"0.5809005",
"0.5807387",
"0.5793036",
"0.5789778",
"0.5776303",
"0.57739407",
"0.5767081",
"0.5766521",
"0.57637787",
"0.57631457",
"0.5762894",
"0.5762243",
"0.57615334",
"0.57608575",
"0.5750086",
"0.5749517"
] | 0.7190378 | 0 |
DELETE /thing_types/1 DELETE /thing_types/1.json | def destroy
@thing_type.destroy
respond_to do |format|
format.html { redirect_to thing_types_url, notice: 'Thing type was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @clothing_type.destroy\n respond_to do |format|\n format.html { redirect_to clothing_types_url, notice: 'Clothing type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @type = Type.find(params[:id])\n @type.destroy\n\n respond_to do |format|\n format.html { redirect_to types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @realty_type = RealtyType.find(params[:id])\n @realty_type.destroy\n\n respond_to do |format|\n format.html { redirect_to realty_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @thing = Thing.find(params[:id])\n @thing.destroy\n\n respond_to do |format|\n format.html { redirect_to things_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @thing = Thing.find(params[:id])\n @thing.destroy\n\n respond_to do |format|\n format.html { redirect_to things_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @girltype = Girltype.find(params[:id])\n @girltype.destroy\n\n respond_to do |format|\n format.html { redirect_to girltypes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @dishtype.destroy\n respond_to do |format|\n format.html { redirect_to dishtypes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @type = Type.find(params[:type])\n @type.destroy\n\n respond_to do |format|\n format.html { redirect_to company_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @jewelry_type = JewelryType.find(params[:id])\n @jewelry_type.destroy\n\n respond_to do |format|\n format.html { redirect_to jewelry_types_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @novelty_type.destroy\n respond_to do |format|\n format.html { redirect_to novelty_types_url, notice: 'Novelty type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gl_type = GlType.find(params[:id])\n @gl_type.destroy\n\n respond_to do |format|\n format.html { redirect_to gl_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @diet_type.destroy\n respond_to do |format|\n format.html { redirect_to diet_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @dish_type.destroy\n respond_to do |format|\n format.html { redirect_to dish_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client_type = ClientType.find(params[:id])\n @client_type.destroy\n\n respond_to do |format|\n format.html { redirect_to client_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item_type.destroy\n respond_to do |format|\n format.html { redirect_to item_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @appliance_type = ApplianceType.find(params[:id])\n @appliance_type.destroy\n\n respond_to do |format|\n format.html { redirect_to appliance_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n asset_type = AssetType.find(params[:id])\n asset_type.destroy\n\n respond_to do |format|\n format.html { redirect_to asset_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @act_type = ActType.find(params[:id])\n @act_type.destroy\n\n respond_to do |format|\n format.html { redirect_to act_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @observation_type = ObservationType.find(params[:id])\n @observation_type.destroy\n\n respond_to do |format|\n format.html { redirect_to observation_types_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @kind = Kind.find(params[:id])\n @kind.destroy\n\n respond_to do |format|\n format.html { redirect_to kinds_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cloth_type.destroy\n respond_to do |format|\n format.html { redirect_to cloth_types_url, notice: \"Cloth type was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vehicle_type.destroy\n respond_to do |format|\n format.html { redirect_to vehicle_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @thing.destroy\n respond_to do |format|\n format.html { redirect_to things_url, notice: 'The thing was deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @testtype.destroy\n respond_to do |format|\n format.html { redirect_to testtypes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @realty_type = RealtyType.find(params[:id])\n @realty_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(realty_types_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @awon_record_type.destroy\n respond_to do |format|\n format.html { redirect_to awon_record_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vehicletype.destroy\n respond_to do |format|\n format.html { redirect_to vehicletypes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @crossbowtype.destroy\n respond_to do |format|\n format.html { redirect_to crossbowtypes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @affected_type.destroy\n respond_to do |format|\n format.html { redirect_to affected_types_url, notice: 'Affected type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @recipe_type.destroy\n respond_to do |format|\n format.html { redirect_to recipe_types_url, notice: \"Recipe type was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @metric_type = MetricType.find(params[:id])\n @metric_type.destroy\n\n respond_to do |format|\n format.html { redirect_to metric_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @incident_type = IncidentType.find(params[:id])\n @incident_type.destroy\n\n respond_to do |format|\n format.html { redirect_to incident_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @talktype = Talktype.find(params[:id])\n @talktype.destroy\n\n respond_to do |format|\n format.html { redirect_to talktypes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @entry_type = EntryType.find(params[:id])\n @entry_type.destroy\n\n respond_to do |format|\n format.html { redirect_to entry_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @api_v1_admin_type.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_admin_types_url, notice: 'Admin type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @dash_type = DashType.find(params[:id])\n @dash_type.destroy\n\n respond_to do |format|\n format.html { redirect_to dash_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @collection_type = CollectionType.find(params[:id])\n @collection_type.destroy\n\n respond_to do |format|\n format.html { redirect_to collection_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @agency_type = AgencyType.find(params[:id])\n @agency_type.destroy\n\n respond_to do |format|\n format.html { redirect_to agency_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @type_animal.destroy\n respond_to do |format|\n format.html { redirect_to type_animals_url, notice: 'Type animal was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gig_type.destroy\n respond_to do |format|\n format.html { redirect_to gig_types_url, notice: 'Gig type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @crate_type = CrateType.find(params[:id])\n @crate_type.destroy\n\n respond_to do |format|\n format.html { redirect_to crate_types_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @instance_type.destroy\n respond_to do |format|\n format.html { redirect_to instance_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sample_type = SampleType.find(params[:id])\n @sample_type.destroy\n\n respond_to do |format|\n format.html { redirect_to sample_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @good_type.destroy\n respond_to do |format|\n format.html { redirect_to good_types_url, notice: 'Good type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @spec_type.destroy\n respond_to do |format|\n format.html { redirect_to spec_types_url, notice: 'Spec type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @talk_type = TalkType.find(params[:id])\n @talk_type.destroy\n\n respond_to do |format|\n format.html { redirect_to talk_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @garbage_type.destroy\n respond_to do |format|\n format.html { redirect_to garbage_types_url, notice: 'Garbage type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @building_type = BuildingType.find(params[:id])\n @building_type.destroy\n\n respond_to do |format|\n format.html { redirect_to building_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @os_type = OsType.find(params[:id])\n @os_type.destroy\n\n respond_to do |format|\n format.html { redirect_to os_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @shape_type = ShapeType.find(params[:id])\n @shape_type.destroy\n\n\t\tmsg = I18n.t('app.msgs.success_deleted', :obj => I18n.t('app.common.shape_type'))\n\t\tsend_status_update(I18n.t('app.msgs.cache_cleared', :action => msg))\n respond_to do |format|\n format.html { redirect_to admin_shape_types_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @thing = Thing.find(params[:id])\n @thing.destroy\n\n respond_to do |format|\n format.html { redirect_to(things_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @fish_type = FishType.find(params[:id])\n @fish_type.destroy\n\n respond_to do |format|\n format.html { redirect_to fish_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @itype = Itype.find(params[:id])\n @itype.destroy\n\n respond_to do |format|\n format.html { redirect_to itypes_url }\n format.json { head :no_content }\n end\n end",
"def delete_resource(type, id, data = {})\n model = fetch_generic_object_definition(type, id, data)\n delete_resource_main_action(type, model, data)\n model\n rescue => err\n raise BadRequestError, \"Deleting #{model_ident(model, type)} - #{err}\"\n end",
"def destroy\n @thing = current_user.things.find(params[:id])\n @thing.destroy\n\n respond_to do |format|\n format.html { redirect_to things_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @edge_type = EdgeType.find(params[:id])\n @edge_type.destroy\n\n respond_to do |format|\n format.html { redirect_to edge_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @model_type.destroy\n respond_to do |format|\n format.html { redirect_to model_types_url, notice: 'Model type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ad_type = AdType.find(params[:id])\n @ad_type.destroy\n\n respond_to do |format|\n format.html { redirect_to ad_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @business_type = BusinessType.find(params[:id])\n @business_type.destroy\n\n respond_to do |format|\n format.html { redirect_to business_types_url }\n format.json { head :no_content }\n end\n end",
"def delete(type, id)\n http_delete @target, \"#{type_info(type, :path)}/#{Addressable::URI.encode(id)}\", @auth_header, @zone\n end",
"def destroy\n @all_field_type = AllFieldType.find(params[:id])\n @all_field_type.destroy\n\n respond_to do |format|\n format.html { redirect_to all_field_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @heat_type = HeatType.find(params[:id])\n @heat_type.destroy\n\n respond_to do |format|\n format.html { redirect_to heat_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tax_type = TaxType.find(params[:id])\n @tax_type.destroy\n\n respond_to do |format|\n format.html { redirect_to tax_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @itemtype.destroy\n respond_to do |format|\n format.html { redirect_to itemtypes_url, notice: 'Itemtype was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bs_type.destroy\n respond_to do |format|\n format.html { redirect_to bs_types_url, notice: 'Bs type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @stuff = Stuff.find(params[:id])\n @stuff.destroy\n\n respond_to do |format|\n format.html { redirect_to stuff_index_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @water_type.destroy\n respond_to do |format|\n format.html { redirect_to admin_water_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @flat_type.destroy\n respond_to do |format|\n format.html { redirect_to flat_types_url, notice: 'Flat type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bagtype = Bagtype.find(params[:id])\n @bagtype.destroy\n\n respond_to do |format|\n format.html { redirect_to bagtypes_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @brew_type.destroy\n respond_to do |format|\n format.html { redirect_to brew_types_url, notice: 'Brew type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @question_type = QuestionType.find(params[:id])\n @question_type.destroy\n\n respond_to do |format|\n format.html { redirect_to question_types_url }\n format.json { head :no_content }\n end\n end",
"def delete\n render json: Item.delete(params[\"id\"])\n end",
"def destroy\n @special_needs_type = SpecialNeedsType.find(params[:id])\n @special_needs_type.destroy\n\n respond_to do |format|\n format.html { redirect_to special_needs_types_url, :notice => 'Tipo de necessidade especial excluída com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @type_of_cleaning_and_washing = TypeOfCleaningAndWashing.find(params[:id])\n @type_of_cleaning_and_washing.destroy\n\n respond_to do |format|\n format.html { redirect_to type_of_cleaning_and_washings_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @techaxis_type = TechaxisType.find(params[:id])\n @techaxis_type.destroy\n\n respond_to do |format|\n format.html { redirect_to techaxis_types_url, :notice => t('controllermessage.delete') }\n format.json { head :no_content }\n end\n end",
"def destroy\n @fieldtype = Fieldtype.find(params[:id])\n @fieldtype.destroy\n\n respond_to do |format|\n format.html { redirect_to fieldtypes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @step_type = StepType.find(params[:id])\n @step_type.destroy\n\n respond_to do |format|\n format.html { redirect_to step_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bet_type.destroy\n respond_to do |format|\n format.html { redirect_to bet_types_url, notice: 'Type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @typeconge.destroy\n respond_to do |format|\n format.html { redirect_to typeconges_url, notice: 'Typeconge was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @identifier_type.destroy\n\n respond_to do |format|\n format.html { redirect_to identifier_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @fueltype = Fueltype.find(params[:id])\n @fueltype.destroy\n\n respond_to do |format|\n format.html { redirect_to fueltypes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @brake_type.destroy\n respond_to do |format|\n format.html { redirect_to brake_types_url, notice: 'Brake type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @collection = @entity_type.collection\n @entity_type.destroy\n respond_to do |format|\n format.html { redirect_to collection_entity_types_path(@collection), notice: 'The entity type was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @volume_type = VolumeType.find(params[:id])\n @volume_type.destroy\n\n respond_to do |format|\n format.html { redirect_to volume_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @travel_type = TravelType.find(params[:id])\n @travel_type.destroy\n\n respond_to do |format|\n format.html { redirect_to travel_types_url }\n format.json { head :ok }\n end\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @category_type = CategoryType.find(params[:id])\n @category_type.destroy\n\n respond_to do |format|\n format.html { redirect_to category_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @stuff = Stuff.find(params[:id])\n @stuff.destroy\n\n respond_to do |format|\n format.html { redirect_to stuffs_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @stakeholder_type = StakeholderType.find(params[:id])\n @stakeholder_type.destroy\n\n respond_to do |format|\n format.html { redirect_to stakeholder_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @arc_type.destroy\n respond_to do |format|\n format.html { redirect_to arc_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @modeltype.destroy\n respond_to do |format|\n format.html { redirect_to modeltypes_url, notice: 'Modeltype was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tyre.destroy\n respond_to do |format|\n format.html { redirect_to tyres_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @aircraft_type.destroy\n respond_to do |format|\n format.html { redirect_to aircraft_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @weapons_type = WeaponsType.find(params[:id])\n @weapons_type.destroy\n\n respond_to do |format|\n format.html { redirect_to weapons_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mall_type = MallType.find(params[:id])\n @mall_type.destroy\n\n respond_to do |format|\n format.html { redirect_to mall_types_url }\n format.json { head :no_content }\n end\n end",
"def _delete(type, *args)\n type = type.to_s.camelize\n metadata = args.map { |full_name| {:full_name => full_name} }\n request :delete do |soap|\n soap.body = {\n :metadata => metadata\n }.merge(attributes!(type))\n end\n end",
"def destroy\n @oma_relation_type = OmaRelationType.find(params[:id])\n @oma_relation_type.destroy\n\n respond_to do |format|\n format.html { redirect_to oma_relation_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @let_type.destroy\n respond_to do |format|\n format.html { redirect_to let_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @anything.destroy\n respond_to do |format|\n format.html { redirect_to anythings_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @entity_type.destroy\n respond_to do |format|\n format.html { redirect_to entity_types_url, notice: 'Entity type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"
] | [
"0.7085014",
"0.7023634",
"0.6995377",
"0.690573",
"0.690573",
"0.6840859",
"0.68237853",
"0.6813082",
"0.67557",
"0.67516804",
"0.6749158",
"0.6742377",
"0.6736162",
"0.6736045",
"0.6734368",
"0.6719228",
"0.67088735",
"0.6699809",
"0.6693963",
"0.66872084",
"0.668263",
"0.66641253",
"0.66555285",
"0.6641077",
"0.6627794",
"0.6625201",
"0.662123",
"0.66185385",
"0.6593287",
"0.65918785",
"0.6588456",
"0.65882933",
"0.6583274",
"0.65810114",
"0.6580916",
"0.6569953",
"0.6562509",
"0.6560807",
"0.6559471",
"0.6557994",
"0.65546",
"0.6553702",
"0.65499735",
"0.65480727",
"0.65423256",
"0.654129",
"0.65386075",
"0.6534855",
"0.6533578",
"0.6532447",
"0.6522411",
"0.6517906",
"0.6510499",
"0.65102047",
"0.65075684",
"0.65049636",
"0.6503296",
"0.65028405",
"0.6499584",
"0.6498913",
"0.64972895",
"0.64956635",
"0.6494173",
"0.6492263",
"0.64911664",
"0.6488363",
"0.64864564",
"0.64856815",
"0.64804375",
"0.64734197",
"0.64713275",
"0.64710057",
"0.6470657",
"0.64667106",
"0.6465782",
"0.64568126",
"0.64553005",
"0.64537585",
"0.6448909",
"0.6448158",
"0.64468426",
"0.6444924",
"0.64447445",
"0.6443535",
"0.64415914",
"0.64398706",
"0.643039",
"0.64297867",
"0.6427149",
"0.6427106",
"0.64169294",
"0.6415937",
"0.64110637",
"0.6408134",
"0.6406613",
"0.64026904",
"0.6396917",
"0.63959587",
"0.6393478",
"0.63931996"
] | 0.75017405 | 0 |
Use callbacks to share common setup or constraints between actions. | def set_thing_type
@thing_type = ThingType.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def define_action_helpers?; end",
"def set_actions\n actions :all\n end",
"def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def setup_handler\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def workflow\n end",
"def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup\n # override and do something appropriate\n end",
"def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"def determine_valid_action\n\n end",
"def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"def startcompany(action)\n @done = true\n action.setup\n end",
"def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def action\n end",
"def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"def config(action, *args); end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"def before_action \n end",
"def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"def action\n end",
"def matt_custom_action_begin(label); end",
"def setup\n # override this if needed\n end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"def setup_signals; end",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"def initialize(*args)\n super\n @action = :set\nend",
"def after_set_callback; end",
"def setup\n #implement in subclass;\n end",
"def lookup_action; end",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"def release_actions; end",
"def around_hooks; end",
"def save_action; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def action_target()\n \n end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"def before_setup\n # do nothing by default\n end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def default_action; end",
"def setup(&blk)\n @setup_block = blk\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); end",
"def duas1(action)\n action.call\n action.call\nend",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend"
] | [
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576",
"0.53124547",
"0.529654",
"0.5296262",
"0.52952296",
"0.52600986",
"0.52442724",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.5232394",
"0.523231",
"0.5227454",
"0.52226824",
"0.52201617",
"0.5212327",
"0.52079266",
"0.52050185",
"0.51754695",
"0.51726824",
"0.51710224",
"0.5166172",
"0.5159343",
"0.51578903",
"0.51522785",
"0.5152022",
"0.51518047",
"0.51456624",
"0.51398855",
"0.5133759",
"0.5112076",
"0.5111866",
"0.5111866",
"0.5110294",
"0.5106169",
"0.509231",
"0.50873137",
"0.5081088",
"0.508059",
"0.50677156",
"0.50562143",
"0.5050554",
"0.50474834",
"0.50474834",
"0.5036181",
"0.5026331",
"0.5022976",
"0.5015441",
"0.50121695",
"0.5000944",
"0.5000019",
"0.4996878",
"0.4989888",
"0.4989888",
"0.49864885",
"0.49797225",
"0.49785787",
"0.4976161",
"0.49683493",
"0.4965126",
"0.4958034",
"0.49559742",
"0.4954353",
"0.49535993",
"0.4952725",
"0.49467874",
"0.49423352",
"0.49325448",
"0.49282882",
"0.49269363",
"0.49269104",
"0.49252945",
"0.4923091",
"0.49194667",
"0.49174926",
"0.49173003",
"0.49171105",
"0.4915879",
"0.49155936"
] | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def thing_type_params
params.require(:thing_type).permit(:name, :avatar)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def valid_params_request?; end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def filtering_params\n params.permit(:email)\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"def list_params\n params.permit(:name)\n end",
"def filter_parameters; end",
"def filter_parameters; end",
"def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"def url_whitelist; end",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def filter_params\n params.require(:filters).permit(:letters)\n end",
"def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\n end",
"def permit_request_params\n params.permit(:address)\n end",
"def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"def secure_params\n params.require(:location).permit(:name)\n end",
"def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def url_params\n params[:url].permit(:full)\n end",
"def backend_user_params\n params.permit!\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end"
] | [
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",
"0.62894756",
"0.6283177",
"0.6242471",
"0.62382483",
"0.6217549",
"0.6214457",
"0.6209053",
"0.6193042",
"0.6177802",
"0.6174604",
"0.61714715",
"0.6161512",
"0.6151757",
"0.6150663",
"0.61461",
"0.61213595",
"0.611406",
"0.6106206",
"0.6105114",
"0.6089039",
"0.6081015",
"0.6071004",
"0.60620916",
"0.6019971",
"0.601788",
"0.6011056",
"0.6010898",
"0.6005122",
"0.6005122",
"0.6001556",
"0.6001049",
"0.59943926",
"0.5992201",
"0.59909594",
"0.5990628",
"0.5980841",
"0.59669393",
"0.59589154",
"0.5958826",
"0.5957911",
"0.5957385",
"0.5953072",
"0.59526145",
"0.5943361",
"0.59386164",
"0.59375334",
"0.59375334",
"0.5933856",
"0.59292704",
"0.59254247",
"0.5924164",
"0.59167904",
"0.59088355",
"0.5907542",
"0.59064597",
"0.5906243",
"0.5898226",
"0.589687",
"0.5896091",
"0.5894501",
"0.5894289",
"0.5891739",
"0.58860534",
"0.5882406",
"0.587974",
"0.58738774",
"0.5869024",
"0.58679986",
"0.5867561",
"0.5865932",
"0.5864461",
"0.58639693",
"0.58617616",
"0.5861436",
"0.5860451",
"0.58602303",
"0.5854586",
"0.58537364",
"0.5850427",
"0.5850199"
] | 0.0 | -1 |
add a test db.execute("INSERT INTO tasks (task, due_date, completed) VALUES ('pay bills again', '9/4/17', 'false')") | def create_task (db, task, due_date, completed)
db.execute("INSERT INTO tasks (task, due_date, completed) VALUES (?, ?, ?)", [task, due_date, completed])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_task(db, task, date_needed, notes)\n db.execute(\"INSERT INTO list (task, date_needed, notes) VALUES (?, ?, ?)\", [task, date_needed, notes])\nend",
"def add_task(db, table_name, name, time, importance)\n\tdb.execute(\"INSERT INTO #{table_name} (task_name, task_time, importance) VALUES (?, ?, ?)\", [name, time, importance])\nend",
"def add_item(db, new_item, new_date)\n db.execute(\"INSERT INTO todolist (item, date, done) VALUES (?, ?, ?)\", [new_item, new_date, \"false\"])\nend",
"def add_todo(db, act_id)\n\tdb.execute(\"INSERT INTO todo (activity_id, done) VALUES (?,'false')\", [act_id])\n\nend",
"def insert task\n now = Time.now.to_i\n tasks = @db[:tasks]\n tasks.insert :title => task.title,\n :status => task.getStatus,\n :created => now,\n :wake => now,\n :changed => 0,\n :path => task.getPath,\n :data => Marshal::dump(task)\n end",
"def add_restaurant(db, name, type, wait_time, phone)\n db.execute(\"INSERT INTO restaurants (name, type, wait_time, phone) VALUES (?, ?, ?, ?)\", [name, type, wait_time, phone])\nend",
"def update_task(db, id, task, date_needed, notes)\n db.execute(\"UPDATE list SET task=?, date_needed=?, notes=? WHERE id=?\", [task, date_needed, notes, id])\nend",
"def storeTask(param) \n @Handle.execute(\"INSERT INTO Task(OWNER_ID,askedbyID,estimated_time,actual_time,date_created)\" +\n \" values ('#{param.Owner.ID}','#{param.AskedBy.ID}','#{param.EstimatedTime.to_s}','#{param.ActualTime.to_s}','#{param.DateCreated.to_s}')\")\n end",
"def needed_appointments(db, business_name, address)\n db.execute(\"INSERT INTO reminders (business_name, address) VALUES (?, ?)\", [business_name, address])\nend",
"def create_vacation(db, vacationName, destination, timeOut)\r\n db.execute(\"INSERT INTO summer_vacation (vacationName, destination, timeOut) VALUES (?, ?, ?)\", [vacationName, destination, timeOut])\r\nend",
"def create_reminder(date, reminder)\r\n norm_date = normalize_date(date)\r\n $DB.execute(\"INSERT INTO reminders (date, reminder) VALUES (?,?)\",\r\n [norm_date, reminder])\r\nend",
"def save\n if @id\n # Update\n DB.execute(\"UPDATE tasks SET title = ?, description = ?, done = ? WHERE id = ?\", @title, @description, @done, @id)\n else\n # Insert\n DB.execute(\"INSERT INTO tasks (title, description, done) VALUES (?, ?, ?)\", @title, @description, @done)\n @id = DB.last_insert_row_id\n end\n end",
"def make_task_due(title, description, done=false, due_date)\n taskdue = Task.new\n taskdue.title = title\n taskdue.description = description\n taskdue.done = done\n taskdue.due_date = due_date\n taskdue.save\nend",
"def create_bboard(db, name, task, importance)\n db.execute(\"INSERT INTO bboard (name, task, importance) VALUES (?, ?, ?)\", [name, task, importance])\nend",
"def add_chores(db, name, complete_by_day)\r\n\tdb.execute(\"INSERT INTO chores (name, complete_by_day, family_id) VALUES (?, ?, 0)\", [name, complete_by_day])\r\nend",
"def add_activity(db, name)\n\tdb.execute(\"INSERT INTO activities (name) VALUES (?)\", [name])\nend",
"def add_macros(db, date, total_calories, total_fat, total_carbs, total_protein)\n db.execute(\"INSERT INTO food_log (date, total_calories, total_fat, total_carbs, total_protein) VALUES (?, ?, ?, ?, ?)\", [date, total_calories, total_fat, total_carbs, total_protein])\nend",
"def add_run(db, distance, duration)\n db.execute(\"INSERT INTO runs (distance, duration) VALUES (?, ?)\", [distance, duration])\nend",
"def create_new_hero(db, name, age, specialty, turing_award)\r\n db.execute(\"INSERT INTO tech_heroes(name, age, specialty, turing_award) VALUES (?, ?, ?, ?)\", [name, age, specialty, turing_award])\r\nend",
"def add_input (db, user_input)\r\n db.execute(\"INSERT INTO strength (date, exercise, weight, reps, minutes, difficult) VALUES (?, ?, ?, ?, ?, ?)\", [user_input])\r\nend",
"def create_event(db, name, type, date, happened)\n db.execute(\"INSERT INTO events (event_name, type_of_event, date_of_event, has_happened) VALUES (?, ?, ?, ?)\", [name, type, date, happened])\nend",
"def submit_time_in(user_id,location,time,date)\n db_params = {\n host: ENV['host'],\n port: ENV['port'],\n dbname: ENV['dbname'],\n user: ENV['user'],\n password: ENV['password']\n }\n db = PG::Connection.new(db_params)\n # db.exec(\"UPDATE info SET status= 'in' WHERE user_id = '#{user_id}'\")\n db.exec(\"INSERT INTO timesheet_new(user_id,time_in,lunch_start,lunch_end,time_out,date,date_out,location)VALUES('#{user_id}','#{time}','N/A','N/A','N/A','#{date}','#{date}','#{location}')\")\n db.close\nend",
"def add_interest(db, interest)\n db.execute(\"INSERT INTO interests (interest) VALUES (?)\", [interest])\nend",
"def add_symptom(db, symptom, date, time_of_day, severity)\n $db.execute(\"INSERT INTO symptoms (symptom, date, time_of_day, severity) VALUES (?, ?, ?, ?)\", [symptom, date, time_of_day, severity])\nend",
"def create_recipe(db,name,description,length,difficulty)\n q = \"INSERT INTO recipes (name,description,length,difficulty) VALUES ('#{name}','#{description}',#{length},#{difficulty});\"\n return db.execute(q)\nend",
"def create_user(db, name, weight, exercise, progression)\n db.execute(\"INSERT INTO user (name, weight, exercise, progression) VALUES (?, ?, ?, ?)\", [name, weight, exercise, progression])\nend",
"def create_new_todo(list_id, todo_name)\n sql = \"INSERT INTO todos (name, list_id) VALUES ($1, $2)\"\n query(sql, todo_name, list_id)\n end",
"def create_new_update(database, user_id, update_text)\r\n database.execute(\"INSERT INTO updates (user_id, update_text, update_datetime) VALUES (?, ?, date('now'))\", [user_id, update_text])\r\nend",
"def insert_start (db, event)\n\tdb.execute(\"INSERT INTO start (event) VALUES (?)\", [event])\nend",
"def add_project(db, proj_name, client)\n db.execute(\"INSERT INTO projects (name, client) VALUES (?, ?)\", [proj_name, client])\nend",
"def add_to_test(test, student_first, student_last, grade)\n db.execute(\"INSERT INTO #{test} (student_first, student_last, grade) VALUES (?, ?, ?);\", [student_first, student_last, grade])\nend",
"def add_to_list(database, item, quantity, store_name, purchased)\n $database.execute(\"INSERT INTO shopping (item, quantity, store_name, purchased) VALUES (?, ?, ?, ?)\", [item, quantity, store_name, purchased])\nend",
"def enter_calories(db, day, amt_burned, member_id) \n month = Time.now.strftime(\"%m\") \n db.execute(\"INSERT INTO calories (day, month, amt_burned, member_id) VALUES (?, ?, ?, ?)\", [day, month, amt_burned, member_id]) \nend",
"def create_dessert(db, dessert_name, dessert_description)\n db.execute(\"INSERT INTO dessert (dessert_name, dessert_description) VALUES (?, ?)\", [dessert_name, dessert_description])\nend",
"def insert_records(date, search_term, rank, listing, url)\n db = SQLite3::Database.open('/Users/JW/RubymineProjects/Ruby-Test/store.sqlite')\n db.execute (\"INSERT INTO records (date, search_term, rank, listing, url) VALUES ('#{date}', '#{search_term}', #{rank}, '#{listing}', '#{url}')\")\nend",
"def create_song(db,song_name,artist_name,playlist_id)\n\tdb.execute(\"INSERT INTO songlist (song_name,artist_name,playlist_id) VALUES ('#{song_name}', '#{artist_name}', #{playlist_id});\")\nend",
"def create_pokemon(db, name, age, location, move)\n db.execute(\"INSERT INTO pokemon (name, age, location, move) VALUES (?, ?, ?, ?)\", [name, age, location, move])\nend",
"def add_lower_body(db, name, complete, user_id)\n\tcomplete = \"incomplete\"\n\tdb.execute(\"INSERT INTO lower_body (name, complete, user_id) VALUES (?,?,?)\", [name, complete, user_id])\n\tputs \"added leg workout\"\nend",
"def add_price(asin, title, price_s, price_i, day, day_i)\r\n $db.execute(\"INSERT INTO prices (asin, title, price_s, price_i, day, day_i) VALUES (?,?,?,?,?,?)\", [asin, title, price_s, price_i, day, day_i])\r\nend",
"def create_movie(db, title, year,rating)\n db.execute(\"INSERT INTO movies (title, year, rating) VALUES (?, ?, ?)\", [title,year,rating])\nend",
"def new_entry (total_cost, tip_percentage, people, total_cost_with_tip, final_per_person)\n DATABASE.execute(\"INSERT INTO split_checks (total_cost, tip_percentage, people, total_cost_with_tip, final_per_person) VALUES (#{total_cost}, #{tip_percentage}, #{people}, #{total_cost_with_tip}, #{final_per_person});\")\nend",
"def create_entry()\n\tdb.execute( \"INSERT INTO test (name, codename) VALUES (?, ?)\", [name, code_name])\n\nend",
"def add_user(db, user_name)\r\nadd_user = '\r\n\r\n\tINSERT INTO users \r\n\r\n\t(name, cache, expected_income, actual_income, expenses, month)\r\n\tVALUES (?,0,0,0,0,1)'\r\n\tdb.execute(add_user, [user_name]) \r\nend",
"def insert_into_table(db, product, exp_date, prod_type)\n\tdb.execute(\"INSERT INTO products (name, expiration_date, type_id) VALUES (?, ?, ?)\",[product, exp_date, prod_type])\nend",
"def insert_link(url, comment)\n open_db { |db|\n db.execute(\"insert into links (url, comment, time) values ('#{url}', '#{comment}', datetime('now', 'localtime'));\") \n }\nend",
"def create_user(db,first_name,last_name,is_artist,playlist_id)\n\tdb.execute(\"INSERT INTO users (first_name,last_name,is_artist,playlist_id) VALUES ('#{first_name}', '#{last_name}', '#{is_artist}', #{playlist_id});\")\nend",
"def add_lifts(db, date, body_weight, squats, bench_press, overhead_press, deadlifts, power_cleans, comments)\n db.execute(\"INSERT INTO lifting (date, body_weight, squats, bench_press, overhead_press, deadlifts, power_cleans, comments) VALUES (?, ?, ?, ?, ?, ?, ?, ?)\", [date, body_weight, squats, bench_press, overhead_press, deadlifts, power_cleans, comments])\nend",
"def add_exercise(db)\n puts \"What is the name of the exercise you want to add?\"\n exercise = gets.chomp\n if is_existing_exercise(db, exercise)\n puts \"#{exercise} is already in the database.\"\n else\n db.execute(\"INSERT INTO exercises (name) VALUES (?)\", [name])\n puts \"#{exercise} was added to the database.\"\n end\nend",
"def create_note(db, category, name, note)\n db.execute(\"INSERT INTO notes (category, name, note) VALUES (?, ?, ?)\", [category, name, note])\nend",
"def add_reciever(db, name, gift, cost)\n db.execute(\"INSERT INTO personal_gift (name, gift, cost, purchased_id) VALUES (?, ?, ?, 2)\", [name, gift, cost])\nend",
"def create_task(data)\n pid = data[\"project_id\"]\n priority = data[\"priority\"]\n description = data[\"description\"]\n status = false\n\n response = @db.exec_params(%Q[\n INSERT INTO tasks(project_id, priority, description, status)\n VALUES ($1, $2, $3, $4)\n RETURNING id;\n ], [pid, priority, description, status])\n\n response.first[\"id\"]\n end",
"def create_task\n task = Task.create!(\n description: 'Test Task'\n )\nend",
"def add_upper_body(db, name, complete, user_id)\n\tcomplete = \"incomplete\"\n\tdb.execute(\"INSERT INTO upper_body (name, complete, user_id) VALUES (?,?,?)\", [name, complete, user_id])\n\tputs \"added upper body workout\"\nend",
"def create_kitten(db, name, age)\r\n db.execute(\"INSERT INTO kittens (name, age) VALUES (?, ?)\", [name, age])\r\nend",
"def add_book(db, title, author, rating)\n db.execute(\"INSERT INTO books (title, author, rating) VALUES (?, ?, ?)\", [title, author, rating])\nend",
"def add_new_school(db, name)\n db.execute(\"INSERT INTO school (name) VALUES (?)\", [name])\nend",
"def add_item(db)\n\tcreate_table_cmd = <<-SQL\n\tCREATE TABLE IF NOT EXISTS items (\n\t\tid INTEGER PRIMARY KEY,\n\t\tname VARCHAR(255),\n\t\tcalories INT\n\t)\n\tSQL\n\tdb.execute(create_table_cmd)\n\n\t$table_exists = true\n\n\tputs \"Please enter item name:\"\n\titem_name = gets.chomp\n\tputs \"Please enter calories for #{item_name}:\"\n\tcals = gets.chomp.to_i\n\tdb.execute(\"INSERT INTO items (name, calories) VALUES (? ,?)\", [item_name, cals])\n\tputs \"Item added successfully!\"\nend",
"def save\n Chef.db.execute (\n <<-SQL\n INSERT INTO chefs (first_name, last_name , birthday, email , phone , created_at , updated_at)\n --Wasn't able to tale place holders(sql injections) i.e. VALUES(?, ?, ?, ?, ?, ?, ?) BECAUSE \"NOT NULL constraint failed: chefs.first_name (SQLite3::ConstraintException)\"\n VALUES('#{@first_name}', '#{@last_name}', '#{@birthday}', '#{@email}', '#{@phone}', '#{@created_at}', '#{@updated_at}')\n ;\n OR\n -- para evitar SQL injection, se usa \"?,\", vale mencionar que debe usarse en despues del \"OR\" o de lo contrario lanza un error\n VALUES (?, ?, ?, ?, ?, ?, ?, )\n ;\n SQL\n )\n #Execute a SELECT without the \"<<-SQL SQL\" sintaxis, taken from the docuemntation frames: http://www.rubydoc.info/gems/sqlite3/frames\n Chef.db.execute( \"SELECT * FROM chefs\" ) do |row|\n p row\n end\n\n end",
"def add_make(db, make)\n db.execute(\"INSERT INTO makes (make) VALUES (?)\", [make])\nend",
"def insert_task(task, tasklist)\n result = @client.execute(\n api_method: @api.tasks.insert,\n body_object: task,\n parameters: {tasklist: tasklist[\"id\"]}\n )\n #get_tasks(tasklist)\n end",
"def create_pokemon(db, pokemon, cp, location)\n db.execute(\"INSERT INTO pokemon (pokemon, cp, location) VALUES (?, ?, ?)\", [pokemon, cp, location])\nend",
"def create_regimen(db, name, age, vitamin)\n db.execute(\"INSERT INTO regimen (name, age, vitamin) VALUES (?, ?, ?)\", [name, age, vitamin])\nend",
"def schedule(db, date, patient_id, time)\n\tdb.execute(\"INSERT INTO calendar (date, patient_id, time) VALUES (?, ?, ?)\", [date, patient_id, time])\nend",
"def paycycle_hours(user_id, hours, start_date)\n db_params = {\n host: ENV['host'],\n port: ENV['port'],\n dbname: ENV['dbname'],\n user: ENV['user'],\n password: ENV['password']\n }\n db = PG::Connection.new(db_params)\n check = db.exec(\"SELECT * FROM payperiod_hours WHERE user_id = '#{user_id}' AND start_date = '#{start_date}'\")\n if check.num_tuples.zero? == true \n db.exec(\"INSERT INTO payperiod_hours(user_id,monday,tuesday,wednesday,thursday,friday,saturday,sunday,start_date)VALUES('#{user_id}','#{hours[0]}','#{hours[1]}','#{hours[2]}','#{hours[3]}','#{hours[4]}','#{hours[5]}','#{hours[6]}','#{start_date}')\")\n true\n else\n false\n end\n db.close\nend",
"def time_entry_insert(h)\n \t\trows = @database.execute <<-SQL\n\t\t\tINSERT INTO time_entries\n\t\t\t\t(time_entry_id\n\t\t\t\t, staff_id\n\t\t\t\t, project_id\n\t\t\t\t, task_id\n\t\t\t\t, hours\n\t\t\t\t, date\n\t\t\t\t, notes\n\t\t\t\t, billed\n\t\t\t\t)\n\t\t\tVALUES\n\t\t\t\t('#{h['time_entry_id']}'\n\t\t\t\t, '#{h['staff_id']}'\n\t\t\t\t, '#{h['project_id']}'\n\t\t\t\t, '#{h['task_id']}'\n\t\t\t\t, '#{h['hours']}'\n\t\t\t\t, '#{h['date']}'\n\t\t\t\t, '#{h['notes']}'\n\t\t\t\t, '#{h['billed']}'\n\t\t\t\t)\n\t\tSQL\n\tend",
"def add_subject(database, name)\r\n\tdatabase.execute(\"INSERT INTO subjects (name) VALUES (?)\", [name])\r\nend",
"def save\n # 2.1 First check if the @id exists\n if @id\n # 2.3 IF it does THEN UPDATE\n DB.execute(\n 'UPDATE tasks SET title = ?, description = ?, done = ? WHERE id = ?',\n @title, @description, @done, @id\n )\n else\n # 2.4 IF NOT THEN CREATE/INSERT\n DB.execute(\n 'INSERT INTO tasks (title, description, done) VALUES (?, ?, ?)',\n @title, @description, @done\n )\n # 2.5 After INSERTING we GET LAST_CREATED_ID and assign to @id\n @id = DB.last_insert_row_id\n end\n end",
"def create_kitten(db, name, age)\n db.execute(\"INSERT INTO kittens (name, age) VALUES (?, ?)\", [name, age])\nend",
"def create_kitten(db, name, age)\n db.execute(\"INSERT INTO kittens (name, age) VALUES (?, ?)\", [name, age])\nend",
"def create_kitten(db, name, age)\n db.execute(\"INSERT INTO kittens (name, age) VALUES (?, ?)\", [name, age])\nend",
"def create_kitten(db, name, age)\n db.execute(\"INSERT INTO kittens (name, age) VALUES (?, ?)\", [name, age])\nend",
"def create_kitten(db, name, age)\n db.execute(\"INSERT INTO kittens (name, age) VALUES (?, ?)\", [name, age])\nend",
"def create_kitten(db, name, age)\n db.execute(\"INSERT INTO kittens (name, age) VALUES (?, ?)\", [name, age])\nend",
"def create_kitten(db, name, age)\n db.execute(\"INSERT INTO kittens (name, age) VALUES (?, ?)\", [name, age])\nend",
"def create_kitten(db, name, age)\n db.execute(\"INSERT INTO kittens (name, age) VALUES (?, ?)\", [name, age])\nend",
"def create_kitten(db, name, age)\n db.execute(\"INSERT INTO kittens (name, age) VALUES (?, ?)\", [name, age])\nend",
"def create_user (db, first_name, last_name, age, location, social_media,time,date)\n\tdb.execute(\"INSERT INTO users (first_name, last_name, age, location, social_media, time, date) values (?,?,?,?,?,?,?)\",[first_name,last_name,age,location,social_media,time,date])\nend",
"def mark_done(db, id)\n db.execute(\"UPDATE todolist SET done=? WHERE id=?\", [\"true\", id])\nend",
"def add_media(db, mediatype, title, rentLease, mediaconsumed)\r\n\tdb.execute('INSERT INTO media (mediatype, title, rentLease, mediaconsumed) VALUES (?, ?, ?, ?)', [mediatype, title, rentLease, mediaconsumed])\r\nend",
"def create_business(database, name, industry)\n database.execute(\"INSERT INTO businesses (name, industry) VALUES (?, ?)\", [name, industry])\nend",
"def create_new_item(name, price)\n client = create_db_client\n client.query(\"insert into items (name, price) values ('#{name}', '#{price}')\")\nend",
"def add_entry(db, book_name, year_pubished, genre, author, rating, read)\n\tdb.execute(\"INSERT INTO books (book_name, year_pubished, genre, author, rating, read) VALUES (?, ?, ?, ?, ?, ?)\", [book_name, year_pubished, genre, author, rating, read])\nend",
"def add_produce (db, name, serving_size, calories, protein, carbs, fat)\n db.execute(\"INSERT INTO produce (name, serving_size, calories, protein, carbs, fat) VALUES (?, ?, ?, ?, ?, ?)\", [name, serving_size, calories, protein, carbs, fat])\nend",
"def insert \n DATABASE.execute(\"INSERT INTO contents (slide_order, title, body) \n VALUES (#{@slide_order}, '#{@title}', '#{@body}')\")\n @id = DATABASE.last_insert_row_id\n end",
"def create_employee(database, first_name, last_name, wage, title, last_four_ssn, business_id)\n database.execute(\"INSERT INTO employees (first_name, last_name, wage, title, last_four_ssn, business_id) VALUES (?, ?, ?, ?, ?, ?)\", [first_name, last_name, wage, title, last_four_ssn, business_id])\nend",
"def add_vehicle(db)\r\n puts \"What year is the vehicle?\"\r\n year = gets.chomp\r\n puts \"What is the make of the vehicle? (Honda, Toyota, Ford, etc.)\"\r\n make = gets.chomp\r\n puts \"What is the model of the vehicle?\"\r\n model = gets.chomp\r\n db.execute(\"INSERT INTO vehicles (year, make, model) VALUES (#{year}, '#{make}', '#{model}')\")\r\nend",
"def add_song(db, artist, song, rating, explicit_lyrics, user_id, platform_id)\n db.execute(\"INSERT INTO music (artist, song, rating, explicit_lyrics, user_id, platform_id) VALUES (?, ?, ?, ?, ?, ?)\", [artist, song, rating, explicit_lyrics, user_id, platform_id])\nend",
"def create_schema\n puts \"Preparing table\"\n\n \tquery = <<-QUERY\n \t\tCREATE TABLE tasks (\n \t\t\tid INTEGER PRIMARY KEY,\n \t\t\ttitle TEXT NOT NULL,\n \t\t\tdescription TEXT,\n \t\t\tcompleted TEXT\n \t\t);\n \tQUERY\n db.execute(\"DROP TABLE IF EXISTS tasks;\")\n \tdb.execute(query)\n\n puts \"Table creation completed!\"\n\n end",
"def new_patient(db, name, dob, insurance)\n\t\n\tdb.execute(\"INSERT INTO patient_info (name, dob, insurance) VALUES (?, ?, ?)\", [name, dob, insurance])\n\nend",
"def add_student(first_name, last_name, birthdate)\n @conn.exec(\"INSERT INTO students_db (first_name, last_name, birthday) VALUES ('#{first_name}', '#{last_name}', '#{last_name}', '#{birthdate}');\")\nend",
"def insert(todo)\n todo = Rutodo::Database::Todo.new(\n title: todo.title,\n description: todo.description,\n done: todo.status == :finished\n )\n\n todo.save\n\n todo.as_entity\n end",
"def create_playlist(db,playlist)\n\tdb.execute(\"INSERT INTO playlist (playlist_name) VALUES ('#{playlist}');\")\nend",
"def create_main_course(db, name, main_course_descr)\n db.execute(\"INSERT INTO main_course (name, main_course_descr) VALUES (?, ?)\", [name, main_course_descr])\nend",
"def add_person\n puts \"Enter Name:\"\n name = gets.chomp\n puts \"Enter Job:\"\n job = gets.chomp\n puts \"Enter Gender:\"\n gender = gets.chomp\n puts \"Enter Age:\"\n age = gets.chomp\n\n $db.execute(\"INSERT INTO people (name, job, gender, age) VALUES (?, ?, ?, ?)\", name, job, gender, age)\nend",
"def insert_film(title, date, channel, start_time, end_time, year, desc, duration)\n title = title.gsub(/[']/, \"\\\\'\")\n desc = desc.gsub(/[']/, \"\")\n @db.execute(\"INSERT OR IGNORE INTO Films \\\nVALUES ('#{title.escape_single_quotes}', '#{date}', '#{channel}', \\\n'#{start_time}', '#{end_time}', '#{year}', '#{desc.escape_single_quotes}', #{duration})\")\nend",
"def create_tasks(p)\n java_import org.dspace.storage.rdbms.DatabaseManager\n java_import org.dspace.workflow.WorkflowManager\n java_import org.dspace.storage.rdbms.TableRow\n\n # Get the workflow_ids, item_ids that aren't yet assigned to person\n sql = \"SELECT workflow_id,item_id from workflowitem WHERE workflow_id not in (SELECT workflow_id FROM TASKLISTITEM WHERE eperson_id = #{p.getID})\"\n puts sql\n\n tri = DatabaseManager.queryTable(DSpace.context, 'workflowitem', sql)\n row = DatabaseManager.row('tasklistitem')\n row.setColumn('eperson_id', p.getID)\n while (n = tri.next)\n wid = n.getIntColumn('workflow_id')\n item_id = n.getIntColumn('item_id')\n i = DItem.find(item_id)\n puts \"#{wid}\\t#{i.getName}\"\n\n row.setColumn('workflow_id', wid)\n DatabaseManager.insert(DSpace.context, row)\n end\n nil\nend",
"def complete_activity(db, act_id)\n\tdb.execute(\"UPDATE todo SET done='true' WHERE activity_id = ?\", [act_id])\nend",
"def add_friend(db, friend_name, age, birth_month, birth_day, likes_birthdays)\n db.execute(\"INSERT INTO friends (friend_name, age, birth_month, birth_day, likes_birthdays) VALUES (?, ?, ?, ?, ?)\", [friend_name, age, birth_month, birth_day, likes_birthdays])\nend",
"def add_student(first_name, last_name, birthdate)\n @conn.exec(\"INSERT INTO students (first_name, last_name, birthdate) VALUES ('#{first_name}', '#{last_name}', '#{birthdate}');\")\nend",
"def add_student(first_name, last_name, birthdate)\n @conn.exec(\"INSERT INTO students (first_name, last_name, birthdate) VALUES ('#{first_name}', '#{last_name}', '#{birthdate}');\")\nend"
] | [
"0.86859226",
"0.8082236",
"0.8040265",
"0.8022535",
"0.71406865",
"0.70912725",
"0.7056773",
"0.68811536",
"0.6844786",
"0.6838136",
"0.68121916",
"0.6774782",
"0.6772722",
"0.66671634",
"0.6625227",
"0.6621133",
"0.6615321",
"0.65995914",
"0.6586554",
"0.65757394",
"0.6574861",
"0.657111",
"0.6567768",
"0.65670353",
"0.6566864",
"0.6548823",
"0.6529031",
"0.64952415",
"0.64937186",
"0.6485238",
"0.6479406",
"0.6475606",
"0.64711094",
"0.6465908",
"0.645449",
"0.6448189",
"0.64442325",
"0.6438707",
"0.6433104",
"0.6427656",
"0.64276",
"0.6374001",
"0.6363918",
"0.634632",
"0.63451284",
"0.63410985",
"0.6340874",
"0.63396126",
"0.6330678",
"0.6325026",
"0.6311099",
"0.6299881",
"0.62981474",
"0.6297966",
"0.628298",
"0.62766206",
"0.6271946",
"0.6260138",
"0.62557834",
"0.62552917",
"0.6250808",
"0.6245524",
"0.6242779",
"0.62196225",
"0.62176853",
"0.62031573",
"0.6201465",
"0.62013096",
"0.62013096",
"0.62013096",
"0.62013096",
"0.62013096",
"0.62013096",
"0.62013096",
"0.62013096",
"0.62013096",
"0.61913",
"0.61897564",
"0.61812776",
"0.6180173",
"0.6178126",
"0.6173782",
"0.617056",
"0.6168585",
"0.6167425",
"0.6155508",
"0.61497694",
"0.6142267",
"0.61315656",
"0.6128809",
"0.61231476",
"0.61080736",
"0.6106675",
"0.61057216",
"0.6099305",
"0.60914433",
"0.60888773",
"0.6082402",
"0.6082293",
"0.6082293"
] | 0.8983653 | 0 |
Downloads historical prices using the YahooFinance gem. | def initialize(ticker, from_date, to_date)
@from_date = from_date
@to_date = to_date
# @raw_data = YahooFinance::get_historical_quotes(ticker, @from_date-Extra_Days, to_date).reverse
quote = get_quote(ticker)
@raw_data = transpose_reverse(quote)
convert_raw_data_strings!
# We will never have need of the extraneous dates so we trim here
@dates = trim_dates
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_historic_stock_data(ticker, date_from, date_to, frequency = \"1d\")\n url = \"https://query1.finance.yahoo.com/v7/finance/download/#{ticker}?period1=#{date_from.strftime(\"%s\")}&period2=#{date_to.strftime(\"%s\")}&interval=#{frequency}&events=history\"\n\n request = Typhoeus::Request.new(url)\n request.run\n result = request.response.body\n\n result.split(\"\\n\").drop(1).map { |row| YahooDataPoint.new(row) }\n end",
"def stock_historical_data(ticker)\n ############################################################################\n # Yahoo Finance historical quotes has been deprecated\n # YahooFinance::Client.new.historical_quotes(ticker, { start_date: Date.today - days, end_date: Date.today })\n ############################################################################\n i = 0\n history = { date: [], price: [] }\n\n url = \"https://finance.yahoo.com/quote/\" + ticker + \"/history?\"\n doc = Nokogiri::HTML(open(url))\n data = doc.at('table[data-test=\"historical-prices\"]')\n\n while i < data.children[1].children.length do\n check = data.children[1].children[i].text\n\n if (!check.include?('Dividend') && !check.include?('Split'))\n \thistory[:date] << data.children[1].children[i].children[0].text\n \thistory[:price] << data.children[1].children[i].children[5].text.to_f\n end\n\n i+=1\n end\n history\n end",
"def get_historical_quotes(from, to)\n \tstocks = Stock.find(:all)\n \tfor stock in stocks\n \t\t\n market = (sec.market == 'sh' ? 'ss' : sec.market) \n sid = (sec.market == 'hk' ? sec.sid.slice(1,4) : sec.sid)\n \t\t\t\n \t\tYahooFinance::get_HistoricalQuotes( \"#{sid}.#{market}\", \n Date.parse(from),\n Date.parse(to) ) {|hq|\n \t\t\tquote = Quote.new\n \t\t\tquote.security = stock\n \t\t\tquote.sid = stock.sid\n \t\t\tquote.market = stock.market\n \t\t\tquote.name = stock.name\n quote.result_date = hq.date\n \t\t\tquote.open = hq.open\n \t\t\tquote.high = hq.high\n \t\t\tquote.low = hq.low\n \t\t\tquote.close = hq.close\n \t\t\tquote.adjClose = hq.adjClose\n \t\t\tquote.vol = hq.volume\n \t\t\tquote.save!\n \t\t}\n\t end\n end",
"def get_url\n\t\t@url = \"http://finance.yahoo.com/q?s=#{@big_symbol}\"\n\tend",
"def get_basic_info\n yahoo_client = YahooFinance::Client.new\n @data = yahoo_client.quotes([@stock.ticker_symbol], [:open, :high, :low, :close, :last_trade_price, :change, :change_in_percent, :dividend_yield])\n respond_to do |format|\n format.json { render json: @data, status: :ok }\n format.html { @data }\n end\n url = \"https://www.quandl.com/api/v3/datasets/SF0/\" + @stock.ticker_symbol + \"_BVPS_MRY.json?api_key=rWvJtw9jPu2px-yskKZ4\"\n resp = HTTP.get(url)\n @history = JSON.parse(resp, symbolize_keys: true)\n\n end_date = Date.today\n start_date = Date.today.prev_month \n\n fred_url = \"https://api.stlouisfed.org/fred/series/observations?series_id=DGS5&api_key=d9f592689a18d841cab93825d4e060c7&file_type=json&observation_start=\" + start_date.strftime('%Y-%m-%e') + \"&observation_end=\" + end_date.strftime('%Y-%m-%e') + \"\"\n fred_resp = HTTP.get(fred_url)\n five_year_interest_rates = JSON.parse(fred_resp, symbolize_keys: true)\n interest_rate = five_year_interest_rates[\"observations\"].last[\"value\"].to_f\n\n if @history[\"dataset\"].nil?\n @derivative_fypm = \"N/A\"\n @linear_fypm = \"N/A\"\n @rate_fypm = \"N/A\"\n else\n book_values = @history[\"dataset\"][\"data\"]\n # derivative FYPM values\n v1 = book_values[3][1].to_f - book_values[4][1].to_f\n v2 = book_values[2][1].to_f - book_values[3][1].to_f\n v3 = book_values[1][1].to_f - book_values[2][1].to_f\n v4 = book_values[0][1].to_f - book_values[1][1].to_f\n @div = @data[0].dividend_yield.to_f\n price = @data[0].last_trade_price.to_f\n five_year_div_yield = ((((@div * 0.01) + 1.0) ** 5.0) - 1.0) * 100.0\n five_year_interest_rate_yield = 100 * ((((interest_rate/100) + 1) ** 5) - 1)\n # variables for derivative book value linear fit\n sigma_x = 6.0\n sigma_x_squared = 14.0\n sigma_y = v1 + v2 + v3 + v4\n sigma_xy = v2 + v3*2.0 + v4*3.0\n n = 4.0\n # derivative book value linear fit\n a = ((sigma_y*sigma_x_squared) - (sigma_x*sigma_xy))/((n*sigma_x_squared)-(sigma_x**2))\n b = ((n*sigma_xy) - (sigma_x*sigma_y))/((n*sigma_x_squared)-(sigma_x**2))\n five_year_book_value_added = (6.5*b + a)*5.0\n five_year_book_value_yield = (five_year_book_value_added/price)*100\n # derivative FYPM final calc\n @derivative_fypm = ((five_year_book_value_yield + five_year_div_yield)/five_year_interest_rate_yield)\n\n # non- derivative FYPM values\n v1 = book_values[4][1].to_f\n v2 = book_values[3][1].to_f\n v3 = book_values[2][1].to_f\n v4 = book_values[1][1].to_f\n v5 = book_values[0][1].to_f\n # variables for non-derivative book value linear fit\n sigma_x = 10.0\n sigma_x_squared = 30.0\n sigma_y = v1 + v2 + v3 + v4 + v5\n sigma_xy = v2 + v3*2.0 + v4*3.0 + v5*4.0\n n = 5.0\n # non-derivative book value linear fit\n a = ((sigma_y*sigma_x_squared) - (sigma_x*sigma_xy))/((n*sigma_x_squared)-(sigma_x**2))\n b = ((n*sigma_xy) - (sigma_x*sigma_y))/((n*sigma_x_squared)-(sigma_x**2))\n five_year_book_value_added_linear = (10.0*b + a) - v5\n five_year_book_value_added_rate = 5.0*b\n five_year_book_value_yield_linear = (five_year_book_value_added_linear/price)*100\n five_year_book_value_yield_rate = (five_year_book_value_added_rate/price)*100\n # non-derivative FYPM final calc\n @linear_fypm = ((five_year_book_value_yield_linear + five_year_div_yield)/five_year_interest_rate_yield)\n @rate_fypm = ((five_year_book_value_yield_rate + five_year_div_yield)/five_year_interest_rate_yield)\n\n # get change from previous day\n last_fypm = StockDatum.where(ticker_symbol: @stock.ticker_symbol).order(\"created_at DESC\").first\n if last_fypm.nil?\n @linear_change = nil\n @rate_change = nil\n @derivative_change = nil\n else\n @linear_change = ((@linear_fypm / last_fypm.linear_fypm ) - 1.0) * 100.0\n @rate_change = ((@rate_fypm / last_fypm.rate_fypm ) - 1) * 100\n @derivative_change = ((@derivative_fypm / last_fypm.derivative_fypm ) - 1) * 100\n end\n\n end\n end",
"def fetch_history(days)\n raw = YahooFinance::get_historical_quotes_days(self.stock_id, days)\n raw.each do |r|\n rd = Rawdatum.find_or_create_by_stock_map_id_and_record_date(self.id, r[0])\n rd.open_price = r[1]\n rd.high_price = r[2]\n rd.low_price = r[3]\n rd.close_price = r[4]\n rd.volume = r[5]\n rd.adjusted_close_price = r[6]\n rd.save\n end\n end",
"def fetch_csv(ticker, start_date = nil, end_date = nil, period = 'd')\n connection = nil\n\n # retry 3-times in case it sends unauthorized\n 3.times do |_i|\n begin\n url = build_url(ticker, start_date, end_date, period)\n connection = open(url, 'Cookie' => @cookie)\n break\n rescue OpenURI::HTTPError => e\n fetch_credentials\n end\n end\n\n data = CSV.parse(connection.read, converters: :numeric)\n\n raise 'Yahoo.fetch_csv unable to fetch data' unless data.is_a? Array\n data\n end",
"def stockquote(stock)\n url = URI(\"https://apidojo-yahoo-finance-v1.p.rapidapi.com/market/v2/get-quotes?region=US&symbols=#{@stock}\")\n\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n \n request = Net::HTTP::Get.new(url)\n request[\"x-rapidapi-key\"] = ENV['X_RAPIDAPI_KEY']\n request[\"x-rapidapi-host\"] = 'apidojo-yahoo-finance-v1.p.rapidapi.com'\n \n response = http.request(request)\n quoteResponse = JSON.parse(response.read_body)['quoteResponse']\n result = quoteResponse['result']\n @zero = result[0]\n puts \"Symbol = #{@zero['symbol']}, Exchange = #{@zero['fullExchangeName']}, Bid = #{@zero['bid']}, Ask = #{@zero['ask']}\"\n\n return \"<div class =col>\n <h2>Symbol=<a>#{@zero['symbol']}</a></h2>\n <h4>Exchange=<a>#{@zero['fullExchangeName']}</a></h4>\n <h4>Bid=<a>#{@zero['bid']}</a></h4>\n <h4>Ask=<a>#{@zero['ask']}</a></h4>\n </div>\"\n end",
"def quotes_historical(**args)\n valid_params?(args)\n params = convert_params(args)\n client.get(\"#{ENDPOINT}/quotes/historical\", options: params.compact).tap do |resp|\n resp.body = [resp.body]\n end\n end",
"def quotes_historical(**args)\n valid_params?(args)\n params = convert_params(args)\n client.get(\"#{ENDPOINT}/quotes/historical\", options: params.compact).tap do |resp|\n resp.body = [resp.body]\n end\n end",
"def bid_history(opts={})\r\n opts[:output] = 'json'\r\n opts[:callback] = 'callback'\r\n Yahoo::Request.get(\"http://auctions.yahooapis.jp/AuctionWebService/V1/BidHistory\", Yahoo::Api.merge(opts))\r\n end",
"def quotes_historical(**args)\n params = convert_params(args)\n client.get(\"#{ENDPOINT}/quotes/historical\", options: params.compact).tap do |resp|\n resp.body = resp.body[:quotes]\n end\n end",
"def last_years_performance\n client = YahooFinance::Client.new\n quotes = client.historical_quotes(self.stock_symbol, {period: :monthly})\n last_years_quotes = quotes.select {|quote| quote.trade_date.include?(1.year.ago.year.to_s)}\n last_years_quotes.map {|quote| quote.close.to_f * quantity}.reverse\n end",
"def historical_trades(options)\n request :verified, :get, :historicalTrades, options\n end",
"def url\r\n \"http://quote.yahoo.com/d/quotes.csv?s=#{symbol}&f=#{tags.join(\"\")}&e=.csv\"\r\n end",
"def history_usd\n rest.get stats_path(:historyUSD) do |response|\n response_handler response\n end\n end",
"def get_HistoricalData\r\n # Get Historical Data\r\n printf \"@I:Get Historical Data from #{@fx_base.historical_base_url}\\n\"\r\n @fx_base.db_list.each do |key,value|\r\n url = @fx_base.historical_base_url + \"ccy=\" + value[1].to_s + \"&type=d\"\r\n file = @fx_base.data_dir + \"/\" + value[3]\r\n printf \"[#{key}]Get Historical Data from #{url} ... \"\r\n @CSVFiles[key] = file\r\n f = open(file,\"w\")\r\n open(url).each do |line|\r\n f.printf line\r\n end\r\n f.close\r\n printf \"Done\\n\"\r\n printf \" - #{file} (#{File::stat(file).mtime})\\n\"\r\n # Check File Size\r\n if File::stat(file).size < 10000\r\n printf \"@E:Maybe could not get Historical Data. please check #{file}\\n\"\r\n exit 1\r\n end\r\n end\r\n end",
"def show\n\t\tyahoo_client = YahooFinance::Client.new\n\t\t@data = yahoo_client.quotes([\"AER\", \"AYR\", \"FLY\", \"AL\", \"ACY\", \"WLFC\"], [:symbol, :name, :ask, :change, :change_in_percent, :market_capitalization])\n\tend",
"def get_quote(ticker, args = {})\n if args.is_a? Hash\n start_date = args[:start_date] if args[:start_date]\n start_date ||= args[:s] if args[:s]\n\n end_date = args[:end_date] if args[:end_date]\n end_date ||= args[:e] if args[:e]\n\n period = args[:period] if args[:period]\n period ||= args[:p] if args[:p]\n end\n\n csv = @yahoo_client.get_csv(ticker, start_date, end_date, period, 'quote')\n create_quotes_from_csv(csv)\n end",
"def make_request(symbol, start_date, end_date, callback)\n url = \"http://itable.finance.yahoo.com\" +\n \"/table.csv?s=#{ symbol }&g=d\" +\n \"&a=#{ start_date.month - 1 }&b=#{ start_date.mday }&c=#{ start_date.year }\" +\n \"&d=#{ end_date.month - 1 }&e=#{ end_date.mday }&f=#{ end_date.year.to_s }\"\n\n request = Typhoeus::Request.new(url, :method => :get)\n\n request.on_complete {|response|\n if response.code == 200\n if response.body[0..40] != \"Date,Open,High,Low,Close,Volume,Adj Close\"\n raise YahooFinanceException.new(\" * Error: Unknown response body from Yahoo - #{ response.body[0..40] } ...\")\n else\n # good response. go.\n callback.call(response.body)\n end\n elsif response.code == 404\n raise SymbolNotFoundException.new(symbol + \" not found at Yahoo\")\n else\n raise YahooFinanceException.new(\"Error communicating with Yahoo. Response code #{ response.code }. URL: \" +\n \"#{ url }. Response: #{ response.inspect }\")\n end\n }\n\n request\n end",
"def get_info_index\n @i = 0\n yahoo_client = YahooFinance::Client.new\n @tickers = Array.new\n @stocks.each do |stock|\n @tickers.push(stock.ticker_symbol)\n end\n #array of the amount change\n @index_data = yahoo_client.quotes([@tickers], [:change])\n end",
"def calculate_stocks\n stocks = stocks_owned\n .map { |stock| {ticker: stock[0], shares: stock[1]} }\n .sort_by { |stock| stock[:ticker] }\n\n # url = \"https://cloud.iexapis.com/stable/stock/market/batch?types=quote,chart&range=1d&token=#pk_2d262b4b89114ceda9b7ada2d9e99bb9&symbols=\"\n # stocks.each { |stock| url += \"#{stock[:ticker]},\"}\n # response = JSON.parse(open(url).read)\n\n stocks.each_with_index do |stock, idx| \n response = JSON.parse(open(\"https://cloud.iexapis.com/stable/stock/market/batch?types=quote,chart&range=1d&token=pk_2d262b4b89114ceda9b7ada2d9e99bb9&symbols=#{stock[:ticker]}\").read)\n\n \n stock[:price] = response[stock[:ticker]]['quote']['latestPrice']\n stock[:intraday] = response[stock[:ticker]]['chart']\n end\n\n stocks\n end",
"def get_ticker_tape_info \n yahoo_client = YahooFinance::Client.new\n @ticker_data = yahoo_client.quotes([\"^GSPC\", \"^IXIC\", \"CL=F\", \"GC=F\", \"EURUSD=X\"], [:last_trade_price, :change, :change_in_percent])\n respond_to do |format|\n format.json { render json: @ticker_data, status: :ok }\n format.html { @ticker_data }\n end\n end",
"def updatePrice()\n\t\t# ビットコインヒストリカルデータの取得\n\t\tget_btc_api()\n\n\t\t# 日経平均を中心にkabutanで取得できる国内銘柄\n\t\tarrCode = getKabutanTicker()\n # 一気に250銘柄進めようとすると負荷をかけてしまうためまずい→updated_atを見ながら当日取得していない銘柄を5銘柄ずつくらい取得する\n\t\tif !arrCode.nil?\n\t arrCode.each do |code|\n\t\t\t\tticker_without_t = code.gsub(/-T/, '').to_s\n\t getPriceKabutan(ticker_without_t)\n\t end\n\t\tend\n\n\t\t#株価指数(YahooFinanceで取得可能なもの)\n\t\tarrCode = getYahooTicker()\n\t\tif !arrCode.nil?\n\t\t\tarrCode.each_with_index do |code, i|\n\t\t\t\tp \"#{i}番目の株価取得中\"\n\t\t\t\tgetPriceYahoo(code)\n\t\t\tend\n\t\tend\n\tend",
"def show\n @net_investment = 0\n @stock = Stock.find(params[:id])\n @investments = Investment.where(stock_id: @stock.id).limit(10)\n @my_investments = Investment.where(stock_id: @stock.id, member_id: current_member.id)\n @my_investments.each do |investment|\n @net_investment += investment.share_change\n end \n @stock.price = StockQuote::Stock.quote(@stock.ticker).last_trade_price_only\n @stock.save\n require 'net/http'\n\n begin\n @url = 'http://chart.finance.yahoo.com/z?s=%{ticker}' % {ticker: @stock.ticker}\n @resp = Net::HTTP.get_response(URI.parse(@url)) # get_response takes an URI object\n rescue\n print \"Connection error.\"\n end \n end",
"def stock_details_for_list(symbol_list)\n\t\t\tsymbol_list = symbol_list.collect { |symbol| sanitize_symbol(symbol) }\n\n return [] if symbol_list.blank?\n\n\t\t\tfield_mappings = {\n\t\t\t\tname: 'n',\n\t\t\t\tsymbol: 's',\n\t\t\t\task: 'a',\n\t\t\t\task_realtime: 'b2',\n\t\t\t\tbid: 'b',\n\t\t\t\tbid_realtime: 'b3',\n\t\t\t\tdays_range: 'm',\n\t\t\t\tyear_range: 'w',\n\t\t\t\topen: 'o',\n\t\t\t\tprevious_close: 'p',\n\t\t\t\tvolume: 'v',\n\t\t\t\tdividend_yield: 'y',\n\t\t\t\tearnings_share: 'e',\n\t\t\t\tstock_exchange: 'x',\n\t\t\t\tlast_trade_time: 't1',\n\t\t\t\teps_estimate_current_year: 'e7',\n\t\t\t\teps_estimate_next_year: 'e8',\n\t\t\t\teps_estimate_next_quarter: 'e9',\n\t\t\t\tpe_ratio: 'r',\n\t\t\t\ttwo_hundred_day_moving_average: 'm4',\n\t\t\t\tfifty_day_moving_average: 'm3',\n\t\t\t\tlast_trade_date: 'd1'\n\t\t\t}\n\n\t\t\tstart_time = Time.now.to_f\n\n csv = RestClient.get \"http://download.finance.yahoo.com/d/quotes.csv?s=#{symbol_list.join(',')}&f=#{field_mappings.values.join}\"\n\n\t\t\tall_details = CSV.parse(csv).collect do |row|\n\t\t\t\tdetails = Hash[field_mappings.keys.zip(row.collect { |v| v.to_s.strip.gsub(/['\"]/, '')} )]\n\n quote = create_openstruct(details)\n\n\t\t\t\tunless quote.name == quote.symbol\n\t\t\t\t\tquote.currently_trading = (Date.strptime(quote.last_trade_date, '%m/%d/%Y') == Date.today)\n\n quote.current_price = [quote.ask_realtime, quote.ask, quote.previous_close].detect do |value|\n\t\t\t\t\t\tvalue.to_f > 0.0\n end\n\n\t\t\t\t\tquote.current_bid = quote.bid_realtime || quote.bid\n\n\t\t\t\t\tquote.buy_price = quote.current_price.to_f + Order::TRANSACTION_FEE\n\n\t\t\t\t\tquote.statements_url = \"http://investing.money.msn.com/investments/sec-filings/?symbol=#{quote.symbol}\"\n\n # calculate stock trend\n close = quote.previous_close.to_f\n\n current = quote.current_price.to_f\n\n point_change = (current - close)\n\n quote.point_change = (point_change >= 0 ? '+' : '') + point_change.round(2).to_s\n\n\t\t\t\t\tquote.percent_change = ((point_change / close)*100).round(2)\n\n quote.trend_direction = quote.percent_change >= 0 ? 'up' : 'down'\n\n\t\t\t\t\tquote\n\t\t\t\telse\n\t\t\t\t\treturn nil\n\t\t\t\tend\n\t\t\tend\n\n\t\t\t#Rails.logger.debug \" Yahoo (#{((Time.now.to_f-start_time)*1000.0).round} ms): #{symbol_list}\" unless Rails.env.production?\n\n return Hash[symbol_list.zip(all_details)]\n\n\t\tend",
"def get_data\n\t \thydra = Typhoeus::Hydra.hydra\n\n\t \tfirst_url = \"http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20(%22#{self.stock_ticker}%22)&format=json%0A%09%09&env=http%3A%2F%2Fdatatables.org%2Falltables.env\"\n\t \tsecond_url = \"http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.keystats%20where%20symbol%20in%20(%22#{self.stock_ticker}%22)&format=json%0A%09%09&env=http%3A%2F%2Fdatatables.org%2Falltables.env\"\n\t \tthird_url = \"http://www.quandl.com/api/v1/datasets/DMDRN/#{self.stock_ticker}_ALLFINANCIALRATIOS.csv?auth_token=#{ENV['QUANDL_API_TOKEN']}\"\n\t \tfourth_url = \"http://www.quandl.com/api/v1/datasets/PSYCH/#{self.stock_ticker}_I.json?&auth_token=auth_token=#{ENV['QUANDL_API_TOKEN']}&trim_start=#{Chronic.parse(\"last week\").strftime(\"%F\")}&trim_end=#{Chronic.parse(\"today\").strftime(\"%F\")}&sort_order=desc\"\n\n\t \t(((first_url) =~ URI::DEFAULT_PARSER.regexp[:ABS_URI]) == 0) ? first_request = Typhoeus::Request.new(first_url) : (return false)\n\t \tsecond_request = Typhoeus::Request.new(second_url) \n\t \tthird_request = Typhoeus::Request.new(third_url) \n\t \tfourth_request = Typhoeus::Request.new(fourth_url) \n\n\t \thydra.queue first_request\n\t \thydra.queue second_request\n\t \thydra.queue third_request\n\t \thydra.queue fourth_request\n\t \t\n\t \thydra.run\n\n\t\t\tfirst_request.response.options[:response_code] == 200 ? first_response = first_request.response : (return false )\n\t \tsecond_response = second_request.response\n\t \tthird_response = third_request.response \n\t \tfourth_response = fourth_request.response\n\n\t \t@quotes = JSON.parse(first_response.body) if !first_response.body.nil?\n\n\t \t@key_stats = JSON.parse(second_response.body) \n\n\t \tthird_request.response.options[:response_code] == 200 ? @quandl_data = CSV.parse(third_response.body) : @quandl_data = nil\n\n\t \tfourth_request.response.options[:response_code] == 200 ? @psych_data = JSON.parse(fourth_response.body) : @psych_data = nil\n\n\t \t@tradier = $tradier_client.quote(self.stock_ticker)\n\n\t \tmethod(:assign_yahooQuotes).call\n\t \tmethod(:assign_yahooKeyStats).call\n\t \tmethod(:assign_quandlStockData).call\n\t \tmethod(:assign_quandlPsychData).call\n\t \tmethod(:assign_databaseValues).call\n\t \tmethod(:assign_stockProfile).call\n\t \tmethod(:assign_tradierQuote).call\n\n\t end",
"def livequote(ticker)\n\tfunction = 'TIME_SERIES_INTRADAY'\n\tsymbol = ticker\n\tinterval = '1min' \n\tapikey = '4528' #provided at registration\n\turl = \"http://www.alphavantage.co/query?function=#{function}&symbol=#{symbol}&interval=#{interval}&apikey=#{apikey}\"\n\turi = URI(url)\n\tresponse = Net::HTTP.get(uri)\n\tinfo = JSON.parse(response)\n\treturn info.values[1].values[0].values[3].to_f.round(2)\nend",
"def api\n url = \"http://ichart.yahoo.com/table.csv?s=#{ params[:s] }&g=d&\"\n end_month = Date.today.month - 1\n end_day = Date.today.day\n end_year = Date.today.year\n\n start_date_params = \"a=#{ end_month }&b=#{ end_day }&c=#{ end_year - 1 }\"\n end_date_params = \"d=#{ end_month }&e=#{ end_day }&f=#{ end_year }\"\n\n url += start_date_params + '&' + end_date_params\n\n puts url\n res = Net::HTTP.get(URI(url))\n render inline: res\n end",
"def ohlcv_historical(**args)\n valid_params?(args)\n params = convert_params(args)\n client.get(\"#{ENDPOINT}/ohlcv/historical\", options: params.compact).tap do |resp|\n resp.body = [resp.body]\n end\n end",
"def get_latest_price(ticker)\n result = get_historic_stock_data(ticker, @fake_time - 2.days, @fake_time + 2.days, \"1d\")\n price_result = 0\n result.each { |point| \n # Since markets are closed on weekends and holidays, we must take the latest day the market was open\n if point.date < @fake_time \n price_result = point.average_price\n end\n }\n price_result\n end",
"def get_value\n current_price = YahooFinance::get_quotes(YahooFinance::StandardQuote, @ticker.upcase)[@ticker.upcase].lastTrade\n current_price * @shares\n end",
"def retrieve_rates(date)\n path = \"http://openexchangerates.org/api/historical/#{date.to_s}.json?app_id=#{$app_id}\"\n response = Net::HTTP.get_response(URI.parse path)\n # TODO: error handling\n response.body\nend",
"def initialize(options)\n if options.nil? || !options.is_a?(Hash)\n raise QuoteException, \"You must provide a hash of stock symbols to fetch data\"\n end\n if options[:stock_symbols].nil? || options[:stock_symbols].empty?\n raise QuoteException, \"You must provide atleast one stock symbol to fetch data\"\n end\n if !(options[:read_parameters] && options[:read_parameters].any?)\n options[:read_parameters] = [:last_trade_price_only, :last_trade_date]\n end\n options[:stock_symbols] = Array.new << options[:stock_symbols] unless options[:stock_symbols].is_a?(Array)\n @interface = YahooStock::Interface::Quote.new(options)\n end",
"def book_ticker(options)\n request :public, :get, :bookTicker, options\n end",
"def show\n if Stock.check_valid(params[:symbol])\n if Stock.not_exists?(params[:symbol])\n create\n end\n $stock = Stock.find(params[:symbol])\n # Gather and check chart data\n @input = Stock.get_overview(params)\n if @input === 404\n not_found\n else\n @data = YahooFinance.quotes([params[:symbol]], [:name, :last_trade_price, :ask, :bid, :open, :close, :volume, :market_capitalization, :dividend_yield, :dividend_per_share, :change, :change_in_percent, :last_trade_date, :stock_exchange])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: $stock }\n end\n end\n else\n not_found\n end\n end",
"def get_price\n request_url = \"https://api.intrinio.com/data_point?identifier=#{ticker}&item=last_price\"\n restclient = RestClient::Resource.new(request_url,ENV[\"INTRINIO_USERNAME\"],ENV[\"INTRINIO_PASSWORD\"])\n response = restclient.get\n\n price = JSON.parse(response)\n\n self.price = price[\"value\"].to_f\n self.save\n #\n # api_key = ENV[\"BAR_CHART_API\"]\n #\n # url = \"http://marketdata.websol.barchart.com/getQuote.json?key=#{api_key}&symbols=#{self.ticker}\"\n #\n # response = RestClient.get(url)\n #\n # data = JSON.parse(response)\n #\n # if data[\"status\"][\"code\"] == 200\n # self.price = data[\"results\"][0][\"lastPrice\"].to_f\n # self.save\n # end\n end",
"def real_time_quote\n response = Unirest.get(\"http://www.24hgold.com/english/gold_silver_prices_charts.aspx/GetLastValue?sCurrency=USD\", \n headers: { \"Content-Type\" => \"application/json\" }, \n parameters: { :age => 23, :foo => \"bar\" })\n \n response.code # Status code\n response.headers # Response headers\n response.body # Parsed body\n response.raw_body # Unparsed body\n gold_silver_price = JSON.parse(response.raw_body)\n #puts \"from service: \" + gold_silver_price.to_s\n gold_price = gold_silver_price[\"d\"][1][0] + gold_silver_price[\"d\"][1][2..7].gsub(\",\",\".\") \n silver_price = gold_silver_price[\"d\"][6].gsub(/\\s+/,\"\").gsub(\",\",\".\")\n puts gold_price\n #puts silver_price\n [::Forecasting::Quote::from_symbol_and_price(\"GOLD\",gold_price),::Forecasting::Quote::from_symbol_and_price(\"SILVER\",silver_price)]\n end",
"def quote_hash\n portfolio = YahooFinance::Client.new\n stock = [self.stock_symbol]\n\n returned_instance = portfolio.quotes(stock, [:name, :last_trade_date, :last_trade_time, :last_trade_price, :ask])\n returned_instance[0]\n end",
"def grab_html\n\t\t@unbendable_html = HTTParty.get('http://finance.yahoo.com/q?s=TSLA')\n\tend",
"def stoxx\n puts \"\\n******* stoxx *******\"\n\n # == data format: yyyymmdd[hhmm[ss]]\n startDate = \"20170121\" + \"000000\"\n endDate = \"20170317\" + \"000000\"\n symbol = \"IBM\"\n remote_key = Rails.application.config.bar_chart_key\n\n remote_url = \"https://marketdata.websol.barchart.com\"\n remote_url += \"/getHistory.json?key=\" + remote_key + \"&symbol=\" + symbol\n remote_url += \"&type=daily&startDate=\" + startDate + \"&endDate=\" + endDate\n\n json_data = HTTParty.get(remote_url)\n puts \" ** json_data['results'].length: #{json_data['results'].length.inspect}\"\n @stock_data = json_data['results']\n\n end",
"def initialize(ticker_name, proxies=DEFAULT_PROXIES)\n @ticker_name = ticker_name\n @proxies = proxies\n @url = URI(BASE_URL + ticker_name + MYTOKEN)\n @price_data = HTTParty.get(url=@url, proxies=@proxies).parsed_response\n end",
"def bid_history_detail(opts={})\r\n opts[:output] = 'json'\r\n opts[:callback] = 'callback'\r\n Yahoo::Request.get(\"http://auctions.yahooapis.jp/AuctionWebService/V1/BidHistoryDetail\", Yahoo::Api.merge(opts))\r\n end",
"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",
"def download_prices() \n\t\t \t \t \t\n\t\t\t\t@dropbox_token = DropboxSession.deserialize(Linkdropbox.first.dropbox_token)\n\t\t\t\tclient = DropboxClient.new(@dropbox_token)\n\t\t\t\tcontents, metadata = client.get_file_and_metadata('Grupo8/DBPrecios.accdb')\n\t\t\t\tbegin\n\t\t\t\t open('public/jars/DBPrecios.accdb', 'wb') {|f| f.puts contents }\n\t\t\t\t \n\t\t\t\t \n\t\t\t\trescue\n\t\t\t\t flash[:success] = \"Exception occured while downloading...\"\t\t\n\n\t \t\tend \n\n\t \t\tLinkdropbox.import_prices_to_csv\t\n\tend",
"def show\n @portfolio = Portfolio.find(params[:id])\n\n \n # @stocks = YahooFinance.quotes([@portfolio.stocks.group_by(&:stock_symbol)], [:ask, :bid], { raw: false } )\n # additional resources :\n # https://github.com/herval/yahoo-finance\n # https://github.com/rlazoti/yahoofinance-example/blob/master/view_stocks.rb\n\n @stocks = YahooFinance.quotes(@portfolio.stocks.group_by(&:stock_symbol), [:ask, :bid, :symbol, :last_trade_price], { raw: false } )\n \n\n @stock = Stock.new\n @stock.portfolio_id = @portfolio.id\n end",
"def get_float_from_yahoo\n url = \"http://finance.yahoo.com/q/ks?s=#{ticker}\"\n doc = open_url_or_nil(url)\n\n begin\n shares = doc.xpath('//tr').detect{ |tr| tr.xpath('./td').first != nil && tr.xpath('./td').first.text.match(/Shares Outstanding/) }.xpath('./td').last.text\n puts shares\n shares = case shares.last\n when \"B\"\n sales.chop.to_f * BILLION\n when \"M\"\n sales.chop.to_f * MILLION\n else\n sales.chop.first.to_f * BILLION\n end\n\n rescue\n end\n shares.to_i\n end",
"def get_current_stock_price(stock_symbol_name)\n quote_type = YahooFinance::StandardQuote\n quote_symbol = stock_symbol_name\n YahooFinance::get_quotes(quote_type,quote_symbol) do |qt|\n @current_stock_price = qt.lastTrade\n return @current_stock_price\n end\n end",
"def exchanges_ticker_data_download(request, opts = {})\n data, _status_code, _headers = exchanges_ticker_data_download_with_http_info(request, opts)\n data\n end",
"def selling_list(opts={})\r\n opts[:output] = 'json'\r\n opts[:callback] = 'callback'\r\n Yahoo::Request.get(\"http://auctions.yahooapis.jp/AuctionWebService/V2/sellingList\", Yahoo::Api.merge(opts))\r\n end",
"def call\n query_params = {\n base: params[:base_currency],\n symbols: params[:exchange_currency],\n start_at: params[:duration].to_i.days.ago.to_date.to_s, # remove this magic\n end_at: Date.today.to_s # this one too\n }.to_query\n\n url = \"#{URL_BASE}/history?#{query_params}\"\n\n self.class.fetch(url)\n end",
"def get_stock(stock_ticker)\n stock = StockQuote::Stock.quote(stock_ticker)\n return stock\nend",
"def show\n @stock = Stock.find(params[:id])\n @quote = YahooFinance::get_standard_quotes(@stock.ticker)[@stock.ticker]\n @tweets = Twitter.search('$' + @stock.ticker).results\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @stock }\n end\n end",
"def exchanges_download_candles(request, opts = {})\n data, _status_code, _headers = exchanges_download_candles_with_http_info(request, opts)\n data\n end",
"def ticker\n ticker = get('/api/1/BTCUSD/ticker')\n Ticker.instance.buy = value_currency ticker['buy']\n Ticker.instance.high = value_currency ticker['high']\n Ticker.instance.price = value_currency ticker['last_all']\n Ticker.instance.low = value_currency ticker['low']\n Ticker.instance.sell = value_currency ticker['sell']\n Ticker.instance.volume = value_bitcoin ticker['vol']\n Ticker.instance.vwap = value_currency ticker['vwap']\n Ticker.instance.avg = value_currency ticker['avg']\n Ticker.instance.last_local = value_currency ticker['last_local']\n Ticker.instance\n end",
"def market_data\n endpoint = \"#{HOST}/v1/cryptocurrency/listings/latest\"\n get(endpoint)\n end",
"def get_ticker(ticker, date_range)\n request = Quandl::Request.new(ticker, date_range)\n request.result\n end",
"def grab_ytd_stock_performance\n ytd_stock_performance = @market_doc.css(\"ul.module-body.wsod.how-stocks-doing\")\n ytd_stock_performance.css(\"a.quote\").each do |x|\n name = x.css(\"span.column.quote-name\").text\n if x.css(\"span.column.quote-change.posData\").text != \"\"\n change = x.css(\"span.column.quote-change.posData\").text\n elsif x.css(\"span.column.quote-change.negData\").text != \"\"\n change = x.css(\"span.column.quote-change.negData\").text\n end\n @ytd_stock_performance << [name, change]\n end\n end",
"def get_graph_data\n #check for the amount of data the function needs to return, defualt = 3\n @date_scalar = params.has_key?(:num_months) ? params[:num_months] : 3\n #string -> int\n @date_scalar = @date_scalar.to_i\n #make a float copy\n @date_scalar_float = @date_scalar.to_f\n\n #instantiate YQuotes client to get historical data\n yahoo_client = YQuotes::Client.new\n #retrieve the data\n @graph_data = yahoo_client.get_quote(\n @stock.ticker_symbol, { \n #get one data point for each day\n period: 'd', \n #calculate the first date needed based on the amount of data requested\n #24*60*60*365 converts the fractions of a year into seconds\n start_date: (Time.now - (24*60*60*365*(@date_scalar_float/12))).strftime(\"%Y-%m-%d\"), \n #current date\n end_date: Time.now.strftime(\"%Y-%m-%d\")\n })\n\n @low = @graph_data.adj_close.min\n @max = @graph_data.adj_close.max\n #used to see if more data is requested than exists\n #i.e. request 12 months of data for a 3-month old stock \n @overflow = false;\n #figure out how many data points were returned\n @array_size = @graph_data.index.max+1\n @i = 0\n #the number of points that will be displayed on the graph\n num_points = @array_size/150\n start_time = Time.now\n #initialize empty array\n @array_data = Array.new\n #checks for overflow, first case: no overflow \n if (@array_size > (251*(@date_scalar_float/12))-2)\n (@array_size).times do\n if !(num_points == 0)\n #decide whether or not to add it to data set based on number of points desired\n if @i % num_points == 0\n #add to data set that will be used to make graph\n @array_data.push([@graph_data.date[@i], @graph_data.adj_close[@i]])\n end\n #always add the first point\n else\n #add to data set that will be used to make graph\n @array_data.push([@graph_data.date[@i], @graph_data.adj_close[@i]])\n end\n @i += 1\n end\n #overflow\n else\n (@array_size).times do\n if !(num_points == 0)\n if @i % num_points == 0\n @array_data.push([@graph_data.date[@i], @graph_data.adj_close[@i]])\n end\n else\n @array_data.push([@graph_data.date[@i], @graph_data.adj_close[@i]])\n end\n \n @i += 1\n \n end\n #used to display warning\n @overflow = true\n @array_data.push(@overflow)\n end\n\n #convert to a json string for easy parsing in javascript function\n @json_string = @array_data.to_json \n respond_to do |format|\n #for AJAX call to dynamically update graph\n format.json { render json: @array_data, status: :ok }\n format.html { @json_string }\n end\n end",
"def bitfinex_pull( pr1, pr2, int, int2, quant )\n # Data pulled, parsed from JSON\n parsed_tick_vals = http_With_Timeout(\"https://api.bitfinex.com/v2/candles/trade:#{int}:t#{pr2}/hist?limit=#{quant}\")\n unless parsed_tick_vals then return end\n \n # For each tick\n parsed_tick_vals.each do |tick|\n addCandlestick(\"Bitfinex\", pr1, Time.at(tick[0] / 1000).to_datetime, tick[1], tick[3], tick[4], tick[2], int2)\n end\n puts \"finished adding values for this interval\"\n end",
"def getData(ticker, extraPoints)\n # This method should return false if the ticker symbol is invalid. In this sample\n # code, as we are using a random number generator for the data, all ticker symbol\n # is allowed, but we still assumed an empty symbol is invalid.\n if ticker == \"\"\n return false\n end\n\n # In this demo, we can get 15 min, daily, weekly or monthly data depending on the\n # time range.\n # @resolution = 86400\n # if durationInDays <= 10\n # # 10 days or less, we assume 15 minute data points are available\n # @resolution = 900\n# \n # # We need to adjust the startDate backwards for the extraPoints. We assume 6.5\n # # hours trading time per day, and 5 trading days per week.\n # dataPointsPerDay = 6.5 * 3600 / @resolution\n # adjustedStartDate = startDate - startDate % 86400 - (\n # extraPoints / dataPointsPerDay * 7 / 5 + 0.9999999\n # ).to_i * 86400 - 2 * 86400\n# \n # # Get the required 15 min data\n # get15MinData(ticker, adjustedStartDate, endDate)\n# \n # elsif durationInDays >= 4.5 * 360\n # # 4 years or more - use monthly data points.\n # @resolution = 30 * 86400\n# \n # # Adjust startDate backwards to cater for extraPoints\n # yMD = ChartDirector::getChartYMD(startDate)\n # currentMonth = (yMD / 100).to_i % 100 - extraPoints\n # currentYear = (yMD / 10000).to_i\n # while currentMonth < 1\n # currentYear = currentYear - 1\n # currentMonth = currentMonth + 12\n # end\n # adjustedStartDate = ChartDirector::chartTime(currentYear, currentMonth, 1)\n# \n # # Get the required monthly data\n # getMonthlyData(ticker, adjustedStartDate, endDate)\n# \n # elsif durationInDays >= 1.5 * 360\n # # 1 year or more - use weekly points.\n # @resolution = 7 * 86400\n# \n # # Adjust startDate backwards to cater for extraPoints\n # adjustedStartDate = startDate - extraPoints * 7 * 86400 - 6 * 86400\n# \n # # Get the required weekly data\n # getWeeklyData(ticker, adjustedStartDate, endDate)\n# \n # else\n # # Default - use daily points\n # @resolution = 86400\n# \n # # Adjust startDate backwards to cater for extraPoints. We multiply the days by\n # # 7/5 as we assume 1 week has 5 trading days.\n # adjustedStartDate = startDate - startDate % 86400 - ((extraPoints * 7 + 4) / 5\n # ).to_i * 86400 - 2 * 86400\n# \n # # Get the required daily data\n # getDailyData(ticker, adjustedStartDate, endDate)\n # end\n \n stock_details = Stock.find_by_stock_name(ticker).stocks_details\n @timeStamps = stock_details.collect(&:date)[-250..-1]\n @timeStamps.map! do |e| \n e = e.to_time\n e = ChartDirector::chartTime2(e.to_i) \n end\n @highData = stock_details.collect(&:high)[-250..-1]\n @lowData = stock_details.collect(&:low)[-250..-1]\n @openData = stock_details.collect(&:open)[-250..-1]\n @closeData = stock_details.collect(&:close)[-250..-1]\n @volData = stock_details.collect(&:volume)[-250..-1]\n #debugger\n \n return true\n end",
"def trade\n @target_tickers.each do |ticker|\n price = @yahoo_api.get_latest_price(ticker)\n # Buy if cheap enough\n if price < @target_prices[ticker][:min_price]\n @ib_api.buy(ticker, 100, price)\n end\n # Sell if expensive enough\n if price > @target_prices[ticker][:max_price]\n @ib_api.sell(ticker, 100, price)\n end\n end\n end",
"def index\n\n @current_prices = []\n @properties = current_user.properties\n\n\n\n @properties.each do |stock|\n url = 'https://www.google.com/finance/info?q=NYSE%3A' + stock.symbol.to_s\n uri = URI(url)\n response = Net::HTTP.get(uri)\n json = JSON.parse(response[5..(response.length - 3)])\n current_price = json[\"l\"].to_f\n @current_prices.push(current_price)\n end\n end",
"def update_stock_price(tckr)\n #return a float with current price\n\n #api\n url = 'https://cloud.iexapis.com/stable'\n end_point = \"/stock/#{tckr.downcase}/batch?\"\n query_string = \"types=quote&\"\n\n composite_url = \"#{url}#{end_point}#{query_string}token=#{TOKEN}\"\n\n response = Validation.validate_api(composite_url)\n # stock_valid(response)\n #url\n #endpoints\n #querystring => transform some array of companytickers into string separated by commas\n\n #parse with json\n\n json = JSON.parse(response[1])\n\n #pp json[\"quote\"]\n\n return [json[\"quote\"][\"companyName\"], json[\"quote\"][\"latestPrice\"]]\n\n\n end",
"def retrieveYahoo\n \t working = false\n\n while !working do\n \tbegin\n\t\t\t@auth_consumer=OAuth::Consumer.new @consumer_key, \n\t\t\t\t\t\t\t\t\t @consumer_secret, {\n\t\t\t\t\t\t\t\t\t :site\t\t\t\t\t=> @yahoo_oauth_url,\n\t\t\t\t\t\t\t\t\t :scheme => :query_string,\n\t\t\t\t\t\t\t\t\t :http_method\t\t\t=> :get,\n\t\t\t\t\t\t\t\t\t :request_token_path => @yahoo_oauth_request_token_path,\n\t\t\t\t\t\t\t\t\t :access_token_path => @yahoo_oauth_access_token_path,\n\t\t\t\t\t\t\t\t\t :authorize_path => @yahoo_oauth_authorize_path\n\t\t\t\t\t\t\t\t\t }\n\t \n\t\t\t# Set request token \n\t\t\t@request_token = @auth_consumer.get_request_token(:oauth_callback => @callback_url)\n\t\t\tsession[:request_token] = @request_token\n\t\t\tworking = true\n\n\t\trescue\n\t\t\tputs \"Error!!!\"\n\t\tend\n \tend\n end",
"def call_api\n url = \"#{@base_uri}/stock\"\n params = {symbol: @symbol, api_token: @api_key}\n\n if @exchange\n params[:stock_exchange] = @exchange\n end\n\n Lita.logger.debug \"call_api: #{url} #{params.inspect}\"\n\n @response = RestClient.get url, {params: params}\n\n Lita.logger.debug \"response: #{@response}\"\n end",
"def historic_trading(region, year, month)\n region = AEMO::Region.new(region) if region.is_a?(String)\n\n month = Kernel.format('%02d', month)\n url = 'https://aemo.com.au/aemo/data/nem/priceanddemand/' \\\n \"PRICE_AND_DEMAND_#{year}#{month}_#{region}1.csv\"\n\n response = HTTParty.get(url)\n parse_response(response)\n end",
"def stock_watchlist(ticker)\n YahooFinance::Client.new.quotes(ticker, watchlist_info)\n end",
"def global_metrics_quotes_historical_get(opts = {})\n data, _status_code, _headers = global_metrics_quotes_historical_get_with_http_info(opts)\n data\n end",
"def get_value(symbol)\n \tyahoo_client = YahooFinance::Client.new\n \tdata = yahoo_client.quotes([symbol], [:ask])\n \tdata[0].ask\n end",
"def index\n #@future_tickers = FutureTicker.all\n @future_tickers = $influxdb.query(\"select * from ticker where contract_type='#{params[:contract_type]}' and symbol='#{params[:symbol]}'\").first[\"values\"]\n end",
"def index\n \n @stocks = Stock.select{ |s| s['user_id']==current_user.id}\n @tickers = Array[]\n @recommendations = Recommendation.all\n @stockprofiles = Stockprofile.all\n\n\n\n @api = StockQuote::Stock.new(api_key: ENV['iexcloud_api_key'])\n @finnhub_api_key = ENV['finnhub_api_key']\n \n @iexcloud_api_key = ENV['iexcloud_api_key']\n @baseurl_iexcloud = \"https://cloud.iexapis.com/stable/stock/\"\n\n @tradier_api_key = ENV['tradier_api_key']\n @baseurl_tradier = ENV['baseurl_tradier'] # /options/expirations\"\n\n get_watchlist_stocks_live_quotes\n\n\n\n #StockquoteDownloadJob.set(wait: 1.minute).perform_later\n #StockquoteDownloadJob.perform_later\n #StockquoteDownloadJob.perform_later(\"refresh_options\")\n #StockquoteDownloadJob.perform_later(\"clear_oldoptions\")\n #StockquoteDownloadJob.perform_later(\"delete_all_options\")\n #StockquoteDownloadJob.perform_later(\"metadata\")\n #StockquoteDownloadJob.perform_later(\"delete_stockprofiles\")\n #StockquoteDownloadJob.perform_later(\"delete_recommendations\")\n end",
"def candles(sym='btcusd', options={})\n #Hashie::Mash.new(\n #self.class.get(\"/v1/candles/#{sym}\", options).parsed_response\n nil\n end",
"def historic_stock(year)\n\n data = query_strategy.historic_stock(year)\n\n end",
"def last_price\n logger.info 'LAST PRICE LOAD BEGIN.'\n instruments = Instrument.select(:id, :symbol).joins(positions: :portfolio).where(portfolios: { user_id: current_user.id }).order(:symbol).distinct # Get instrument list. Added .order for WebMock testing.\n trades = DataCache.price_values(instruments, params.key?('livePrices'))\n logger.info 'LAST PRICE LOAD END.'\n render json: trades, each_serializer: TradeSerializer\n end",
"def price_history(symbol)\n uri = URI(PRICE_HISTORY_URL)\n res = Net::HTTP.post_form(uri, 'Symbol' => symbol)\n html_history = Pathname(__FILE__).join(\"..\", \"..\", \"raw\", \"#{symbol}-pricehistory.html\")\n csv_history = Pathname(__FILE__).join(\"..\", \"..\", \"price\", \"#{symbol.downcase}.csv\")\n\n File.open(html_history, 'w') do |f|\n f.write res.body\n end\n \n first_line = true\n\n CSV.open(csv_history, 'wb') do |csv|\n doc = Nokogiri::HTML(open(html_history))\n\n doc.css('.displayTable tr').each do |tr|\n if first_line\n first_line = false\n next\n end\n\n tds = tr.css('td').map(&:text)\n csv << tds\n end\n\n csv << [\"Date\", \"Close\", \"Open\"]\n end\n\n temp_file = Pathname(__FILE__).join(\"..\",\"..\",\"raw\",\"rev\")\n `tac #{csv_history} > #{temp_file} && cat #{temp_file} > #{csv_history}`\n throw `could not reverse file` unless $? == 0\n puts \"wrote #{symbol} prices to #{csv_history}\"\nend",
"def get_openexchangerates(currency_code,base_code,key)\n # this is tested as working and so far is seen as the best in the lot \n # this one when free will only do lookups compared to USD, also limits to 1000 lookup per month so only 1 per hour\n # at $12/month Hourly Updates, 10,000 api request/month\n # at $47/month 30-minute Updates, 100,000 api request/month\n # at $97/month 10-minute Updates, unlimited api request/month + currency conversion requests\n # does lookup more than one currency at a time\n #https://openexchangerates.org/api/latest.json?app_id=xxxxxxx\n # see: https://openexchangerates.org/\n # example usage:\n # result = get_openexchangerates(\"THB\",\"JPY\", openexchangerates_key)\n # puts \"rate: \" + result[\"rate\"].to_s ; rate: 2.935490234019467\n #\n # inputs: \n # currency_code: the currency code to lookup example THB\n # base_code: the currency base to use in calculating exchange example USD or THB or BTC\n # key: the api authentication key obtained from https://openexchangerates.org\n #\n # return results:\n # rate: the calculated rate of exchange\n # timestamp: time the rate was taken in seconds_since_epoch_integer format (not sure how accurate as the time is the same for all asset currency)\n # datetime: time in standard human readable format example: 2016-09-15T08:00:14+07:00\n # base: the base code of the currency being calculated example USD\n # example if 1 USD is selling for 34.46 THB then rate will return 34.46 for base USD\n # example#2 if 1 USD is selling for 101.19 KES then rate will return 101.19 for base of USD\n # example#3 with the same values above 1 THB is selling for 2.901 KES so rate will return 2.901 for base of KES \n puts \"get_openexchangerates started\"\n url_start = \"https://openexchangerates.org/api/latest.json?app_id=\"\n url_end = \"\"\n send = url_start + key\n #puts \"sending: #{send}\"\n begin\n #postdata = RestClient.get send , { :Accept => '*/*', 'accept-encoding' => \"gzip, deflate\", :user_agent => \"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0\"}\n postdata = RestClient.get send , { :Accept => '*/*', 'accept-encoding' => \"gzip, deflate\"}\n rescue => e\n puts \"fail in get_openexchangerate at RestClient.get error: #{e}\"\n data_out = {}\n data_out[\"service\"] = \"openexchangerates.org\"\n data_out[\"status\"] = \"fail\"\n return data_out\n end\n #puts \"postdata: \" + postdata\n data = JSON.parse(postdata)\n data_out = {}\n data_out[\"status\"] = \"pass\"\n if (base_code == \"USD\")\n #defaults to USD\n data_out[\"currency_code\"] = currency_code\n data_out[\"base\"] = base_code\n data_out[\"datetime\"] = Time.at(data[\"timestamp\"]).to_datetime.to_s\n #date[\"rate\"] = data[\"rates\"][currency_code]\n data_out[\"rate\"] = (data[\"rates\"][currency_code]).to_s\n data_out[\"ask\"] = data_out[\"rate\"]\n data_out[\"bid\"] = data_out[\"rate\"]\n data_out[\"service\"] = \"openexchangerates.org\"\n puts \"data_out: #{data_out}\"\n return data_out\n end\n puts \"here??\"\n usd_base_rate = data[\"rates\"][currency_code]\n base_rate = data[\"rates\"][base_code]\n rate = base_rate / usd_base_rate\n data_out[\"currency_code\"] = currency_code\n #data_out[\"rate\"] = rate.to_s\n #data_out[\"ask\"] = data_out[\"rate\"]\n #data_out[\"bid\"] = data_out[\"rate\"]\n data_out[\"rate\"] = (1.0 / rate.to_f)\n data_out[\"ask\"] = data_out[\"rate\"].to_f\n data_out[\"bid\"] = data_out[\"rate\"].to_f\n data_out[\"base\"] = base_code\n data_out[\"datetime\"] = Time.at(data[\"timestamp\"]).to_datetime.to_s\n data_out[\"service\"] = \"openexchangerates.org\"\n puts \"data_out: #{data_out}\"\n return data_out\nend",
"def get_openexchangerates(currency_code,base_code,key)\n # this is tested as working and so far is seen as the best in the lot \n # this one when free will only do lookups compared to USD, also limits to 1000 lookup per month so only 1 per hour\n # at $12/month Hourly Updates, 10,000 api request/month\n # at $47/month 30-minute Updates, 100,000 api request/month\n # at $97/month 10-minute Updates, unlimited api request/month + currency conversion requests\n # does lookup more than one currency at a time\n #https://openexchangerates.org/api/latest.json?app_id=xxxxxxx\n # see: https://openexchangerates.org/\n # example usage:\n # result = get_openexchangerates(\"THB\",\"JPY\", openexchangerates_key)\n # puts \"rate: \" + result[\"rate\"].to_s ; rate: 2.935490234019467\n #\n # inputs: \n # currency_code: the currency code to lookup example THB\n # base_code: the currency base to use in calculating exchange example USD or THB or BTC\n # key: the api authentication key obtained from https://openexchangerates.org\n #\n # return results:\n # rate: the calculated rate of exchange\n # timestamp: time the rate was taken in seconds_since_epoch_integer format (not sure how accurate as the time is the same for all asset currency)\n # datetime: time in standard human readable format example: 2016-09-15T08:00:14+07:00\n # base: the base code of the currency being calculated example USD\n # example if 1 USD is selling for 34.46 THB then rate will return 34.46 for base USD\n # example#2 if 1 USD is selling for 101.19 KES then rate will return 101.19 for base of USD\n # example#3 with the same values above 1 THB is selling for 2.901 KES so rate will return 2.901 for base of KES \n puts \"get_openexchangerates started\"\n url_start = \"https://openexchangerates.org/api/latest.json?app_id=\"\n url_end = \"\"\n send = url_start + key\n #puts \"sending: #{send}\"\n begin\n #postdata = RestClient.get send , { :Accept => '*/*', 'accept-encoding' => \"gzip, deflate\", :user_agent => \"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0\"}\n postdata = RestClient.get send , { :Accept => '*/*', 'accept-encoding' => \"gzip, deflate\"}\n rescue => e\n puts \"fail in get_openexchangerate at RestClient.get error: #{e}\"\n data_out = {}\n data_out[\"service\"] = \"openexchangerates.org\"\n data_out[\"status\"] = \"fail\"\n return data_out\n end\n #puts \"postdata: \" + postdata\n data = JSON.parse(postdata)\n data_out = {}\n data_out[\"status\"] = \"pass\"\n if (base_code == \"USD\")\n #defaults to USD\n data_out[\"currency_code\"] = currency_code\n data_out[\"base\"] = base_code\n data_out[\"datetime\"] = Time.at(data[\"timestamp\"]).to_datetime.to_s\n #date[\"rate\"] = data[\"rates\"][currency_code]\n data_out[\"rate\"] = (data[\"rates\"][currency_code]).to_s\n data_out[\"ask\"] = data_out[\"rate\"]\n data_out[\"bid\"] = data_out[\"rate\"]\n data_out[\"service\"] = \"openexchangerates.org\"\n puts \"data_out: #{data_out}\"\n return data_out\n end\n puts \"here??\"\n usd_base_rate = data[\"rates\"][currency_code]\n base_rate = data[\"rates\"][base_code]\n rate = base_rate / usd_base_rate\n data_out[\"currency_code\"] = currency_code\n #data_out[\"rate\"] = rate.to_s\n #data_out[\"ask\"] = data_out[\"rate\"]\n #data_out[\"bid\"] = data_out[\"rate\"]\n data_out[\"rate\"] = (1.0 / rate.to_f)\n data_out[\"ask\"] = data_out[\"rate\"].to_f\n data_out[\"bid\"] = data_out[\"rate\"].to_f\n data_out[\"base\"] = base_code\n data_out[\"datetime\"] = Time.at(data[\"timestamp\"]).to_datetime.to_s\n data_out[\"service\"] = \"openexchangerates.org\"\n puts \"data_out: #{data_out}\"\n return data_out\nend",
"def index\n @stocks = Stock.all \n \n @stocks.each do |x|\n x.price = StockQuote::Stock.quote(x.ticker).last_trade_price_only\n x.save\n end \n end",
"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 \nend",
"def load_all_raw_data_into_redis\n\t$all_stock_list.each do |symbol,name|\n\t\tputs \"#{symbol} start\"\n\t\tyahoo_get_raw_data_from_file(symbol)\n\tend\n\nend",
"def get_rates(source)\n\t\t\trequire 'money/bank/open_exchange_rates_bank'\n\t\t\toxr = Money::Bank::OpenExchangeRatesBank.new\n\t\t\toxr.app_id = Rails.application.credentials.openexchangerates[:api_key]\n\t oxr.source = source\n\t oxr.update_rates\n\n\t oxr.cache = '/tmp/cache/exchange_rates.json'\n\t oxr.ttl_in_seconds = 86400\n\n\t return oxr.rates\n\t\tend",
"def scrapeForCurrentData()\n url = \"https://ca.finance.yahoo.com/quote/\" + @stockTicker + \"/key-statistics?\"\n result = {}\n page = Nokogiri::HTML(open(url))\n main_contents = page.css('tr td')\n main_contents.search('sup').remove\n main_contents.each_with_index do |content, index|\n if index%2 == 0\n result[content.text] = main_contents[index+1].text\n end\n end\n #puts result\n return result\n end",
"def prices (currency='TWD')\n get '/prices/' + currency\n end",
"def timeSeriesDaily(symbol)\n response = self.class.get(\"?function=TIME_SERIES_DAILY&symbol=#{symbol}&apikey=#{self.apikey}\")\n\n if response.success?\n response\n else\n raise response.response\n end\n end",
"def get_quarterly\n # get last year earnings\n l_year = latest_eps.year\n\n # get which quarters are the last 4\n fp = doc.xpath('//tr').detect{ |tr| tr.xpath('./td').first != nil && tr.xpath('./td').first['title'] == \"Fiscal Period\" }\n fp = fp.xpath('./td') if fp\n\n if fp.nil?\n puts \"--------------------------------------Cannot get info for #{ticker}\"\n return false\n end\n # Find last year by counting 'td's up to \"TMM\"\n years_available = 0 # Some stocks may not have 10 years worth of data\n for i in 1..fp.size\n if fp[i].nil? || !fp[i].text.match(\"TTM\").nil?\n break\n end\n years_available = i\n end\n\n puts \"Counted #{years_available} years of available data for #{ticker}\"\n\n update_year = 1 # Some stocks may not be updated for 2012 yet\n update_year = 0 if fp[years_available].text.last == \"2\"\n\n\n\n\n #Acces data page\n url = \"http://www.gurufocus.com/financials/#{ticker}\"\n doc = open_url_or_nil(url)\n if doc.nil?\n puts \"Could not get quarterly finantial data from gurufocus.com\"\n return false\n end\n\n # Get last 4 quarters quarterly data\n # Check first if all 4 quarters are available?\n (1..4).each do |i|\n if fp[i].nil? || !fp[i].text.match(\"TTM\").nil?\n break\n end\n years_available = i\n end\n\n puts \"Counted #{years_available} years of available data for #{ticker}\"\n\n update_year = 1 # Some stocks may not be updated for 2012 yet\n update_year = 0 if fp[years_available].text.last == \"2\"\n\n # A boolean to test if current asset values are available\n using_current_data = true\n\n # Scrape data from doc\n # Current Assets\n ca = doc.xpath('//tr').detect{ |tr| tr.xpath('./td').first != nil && tr.xpath('./td').first['title'] == \"Total Current Assets\" }\n if ca\n ca = ca.xpath('./td')\n else\n using_current_data = false\n end\n\n ta = doc.xpath('//tr').detect{ |tr| tr.xpath('./td').first != nil && tr.xpath('./td').first['title'] == \"Total Assets\" }\n ta = ta.xpath('./td') if ta\n\n cl = doc.xpath('//tr').detect{ |tr| tr.xpath('./td').first != nil && tr.xpath('./td').first['title'] == \"Total Current Liabilities\" }\n if cl\n cl = cl.xpath('./td')\n else\n using_current_data = false\n end\n\n tl = doc.xpath('//tr').detect{ |tr| tr.xpath('./td').first != nil && tr.xpath('./td').first['title'] == \"Total Liabilities\" }\n tl = tl.xpath('./td') if tl\n\n # Debt, book value, net tangible assets\n ltd = doc.xpath('//tr').detect{ |tr| tr.xpath('./td').first != nil && tr.xpath('./td').first['title'] == \"Long-Term Debt\" }\n ltd = ltd.xpath('./td') if ltd\n\n bv = doc.xpath('//tr').detect{ |tr| tr.xpath('./td').first != nil && tr.xpath('./td').first['title'] == \"Total Equity\" }\n bv = bv.xpath('./td') if bv\n\n ocs = doc.xpath('//tr').detect{ |tr| tr.xpath('./td').first != nil && tr.xpath('./td').first['title'] == \"Other Current Assets\" }\n ocs = ocs.xpath('./td') if ocs\n\n # Create balance sheet for 10 years\n (1..years_available).each do |i|\n cas = \"\"\n cls = \"\"\n ntas = \"\"\n if using_current_data\n cas = (clean_string(ca[i].text).to_f.round * MILLION).to_s\n cls = (clean_string(cl[i].text).to_f.round * MILLION).to_s\n if ocs\n ntas = (( clean_string(ca[i].text).to_f - clean_string(ocs[i].text).to_f - clean_string(cl[i].text).to_f ).round * MILLION ).to_s\n else\n ntas = cas\n end\n end\n\n # Some trusts don't have liabilities\n tler = \"\"\n tler = (clean_string(tl[i].text).to_f.round * MILLION).to_s if tl\n der = \"\"\n der = (clean_string(ltd[i].text).to_f.round * MILLION).to_s if ltd\n bver = \"\"\n bver = (clean_string(bv[i].text).to_f.round * MILLION).to_s if bv\n bs = BalanceSheet.create(:stock_id => self.id,\n :year => YEAR - (years_available+1 - i) - update_year, #This reveses the year from i\n :current_assets => cas,\n :total_assets => (clean_string(ta[i].text).to_f.round * MILLION).to_s,\n :current_liabilities => cls,\n :total_liabilities => tler,\n :long_term_debt => der,\n :net_tangible_assets => ntas,\n :book_value => bver,\n :quarter => q)\n puts \"Got bs data for #{ticker}, year: #{bs.year}, ta = #{bs.total_assets}\" if !bs.id.nil?\n end\n\n update_attributes( :has_currant_ratio => using_current_data)\n\n end",
"def assign_yahooQuotes\n\t \t@quotes[\"query\"][\"results\"][\"quote\"][\"ErrorIndicationreturnedforsymbolchangedinvalid\"].nil? ? @yahooQuote = @quotes[\"query\"][\"results\"][\"quote\"] : (return false)\n\t end",
"def refresh_rates\n read_from_url\n end",
"def ticker\n Client.current.get(\"#{resource_url}/ticker\")\n end",
"def task_three\n @url = build_url('exchanges/ticker')\n @url = add_query({ ids: 'BTC', convert: 'EUR' })\n payload = Net::HTTP.get(@url)\n data = JSON.parse(payload)\n data\n end",
"def fetch_currency_exchange_data\n Hash.from_xml(Net::HTTP.get(URI.parse(EXCHANGE_URL)))\n end",
"def get_current_stock_data(input)\n url = \"https://www.alphavantage.co/query?function=TIME_SERIES_DAILY&symbol=#{input}&apikey=#{ENV['STOCKS_API_KEY']}\"\n response = RestClient.get(url)\n my_response = JSON.parse(response)\n if my_response[\"Error Message\"] == \"Invalid API call. Please retry or visit the documentation (https://www.alphavantage.co/documentation/) for TIME_SERIES_DAILY.\" || my_response[\"Note\"] == \"Thank you for using Alpha Vantage! Our standard API call frequency is 5 calls per minute and 500 calls per day. Please visit https://www.alphavantage.co/premium/ if you would like to target a higher API call frequency.\"\n false\n else\n daily_stock_info = my_response[\"Time Series (Daily)\"][current_date_to_YYYYMMDD]\n end\nend",
"def tick\n exchange_market_codes = self.exchange_markets.pluck(:code)\n\n api.marketdata['return']['markets'].each do |market|\n next unless exchange_market_codes.include? market[1]['marketid']\n\n exchange_market = self.exchange_markets.find_by(code: market[1]['marketid'])\n Trades::CryptsyWorker.perform_async(exchange_market.id, market[1]['recenttrades'])\n #Orders::CryptsyWorker.perform_async(exchange_market.id, market[1]['sellorders'], market[1]['buyorders'])\n end\n end",
"def quote\n endpoint = 'https://www.alphavantage.co/'\n query = \"query?function=GLOBAL_QUOTE&symbol=#{@current_symbol}&apikey=#{@api}\"\n\n resp = JSON.parse(URI.open(\"#{endpoint}#{query}\").read)['Global Quote']\n\n if resp.nil?\n @value = Stock::NO_VALUE\n @movement = Stock::NO_CHANGE\n else\n @value = resp['05. price'].to_i\n change = resp['09. change'].to_i\n\n @movement = if change.positive?\n Stock::POS_CHANGE\n elsif change.negative?\n Stock::NEG_CHANGE\n elsif change.zero?\n Stock::NO_CHANGE\n else\n Stock::NO_CHANGE\n end\n end\n\n old_value = @cache[@current_symbol]\n @cache[@current_symbol] = \"#{@current_symbol} $#{@value} #{@movement}\"\n\n return unless @cache[@current_symbol] != old_value\n\n # TODO: DRY this up, make sure it isn't being called too much (see init_cache)\n # TODO: simple file operations like this are a good candidate for optimization/moving\n File.open(Stock::CACHE_FILENAME, 'w') do |file|\n file.write(@cache.to_json)\n end\n\n @cache[@current_symbol]\n end",
"def latest_market_data\n cryptsy = Cryptsy::API::Client.new\n # TODO: I need exception handling here because\n # when cryptsy fails to respond to my request, \n # it causes the program to crash.\n cryptsy.marketdata(self.cryptsy_market_id)\n end",
"def trades(symbol=\"tBTCUSD\", params={})\n check_params(params, %i{limit start end sort})\n get(\"trades/#{symbol}\", params).body\n end",
"def graph_data\n\n\t\t# stock data\n\t\t@stock_data = HistoricalStockPrice.where(:stock_id => @stock_object.id).pluck(:last_traded_at, :price)\n\t\t\n\t\t@stock_data.map! { |time, price| [time.to_time.to_i * 1000, price.to_f] }\n\t\t@stock_data.sort_by! { |time, price| time }\n\t\t\n\t\t# puts \"stock data is:\"\n\t\t# @stock_data.each do |time, price|\n\t\t# \tputs \"Time: #{time}, Price: #{price}\"\n\t\t# end\n\n \treturn @stock_data\n \tend",
"def parse_daily_value\n doc = Nokogiri::HTML(open(company_url))\n price = price_from(doc)\n pe_ttm = pe_ttm_from(doc)\n pb = pb_from(doc)\n\n response = RestClient.get(capital_structure_url)\n json = RestClient.get(capital_structure_json_url, cookies: response.cookies)\n json = JSON.parse(json)\n\n total_shares = total_shares(json)\n circulating_shares = circulating_shares(json)\n\n { \n date: Date.today,\n total_shares: total_shares,\n circulating_shares: circulating_shares,\n price: price,\n pe_ttm: pe_ttm,\n pb: pb\n }\n end",
"def retrieve\n retrieve_latest unless File.exists?('exchange_rates.store')\n fx_hash = YAML::load_file('exchange_rates.store')['rates']\n\n fx_hash = retrieve_latest if fx_hash['downloaded_at'] < Chronic.parse('last weekday').to_date\n return fx_hash\n end",
"def cryptocurrency_listings_historical_get(opts = {})\n data, _status_code, _headers = cryptocurrency_listings_historical_get_with_http_info(opts)\n data\n end",
"def scrape_data(mark = \"0\")\n\n # Mark as updated, so as not to download if not needed\n markn = mark\n last_mark = self.mark\n if !self.mark.nil? && !last_mark.match(markn).nil?\n puts \"Skipping downloading data for #{ticker} - not going to download\"\n return true\n end\n\n # Check if earnings data look strange, if so delete them\n earnings2012 = eps.select{|e| e.year == 2012 }.first\n earnings2011 = eps.select{|e| e.year == 2011 }.first\n condition = earnings2012 && earnings2011 && earnings2012.revenue == earnings2011.revenue && earnings2012.net_income == earnings2011.net_income\n if condition\n eps.map{ |s| s.delete }\n self.reload\n puts \"[NOTE] earnings deleted for #{ticker} beacuse they apear to be erroneous\"\n end\n\n # retriev:\n # From: gurufocus.com\n get_data_from_gurufocus # Retrievs: ta,tl, ca, cl, ltd, nta, bv\n # Revenue, income, and eps\n get_numshares # numshares - Not needed for first 1000 up to NU\n update_price\n get_dividends\n\n get_eps\n\n # mark stock as updated\n update_attributes( :mark => markn)\n end"
] | [
"0.7207063",
"0.6724181",
"0.66878104",
"0.66245997",
"0.65237755",
"0.6413913",
"0.6313322",
"0.6294406",
"0.6293501",
"0.6293501",
"0.62682635",
"0.6252363",
"0.6178697",
"0.6169673",
"0.61425257",
"0.6113415",
"0.61125386",
"0.61097056",
"0.6092002",
"0.60838354",
"0.60778993",
"0.6057967",
"0.6046115",
"0.604334",
"0.6018725",
"0.60091895",
"0.59796983",
"0.5957788",
"0.5953578",
"0.5948996",
"0.593139",
"0.59234977",
"0.59210557",
"0.58734125",
"0.5873004",
"0.5858587",
"0.5850492",
"0.58363575",
"0.58058876",
"0.58046424",
"0.5776819",
"0.57658124",
"0.5747106",
"0.5662723",
"0.5660242",
"0.56536347",
"0.5652593",
"0.5649457",
"0.56446224",
"0.5637531",
"0.56272686",
"0.5566265",
"0.55621064",
"0.55568045",
"0.5548393",
"0.5547009",
"0.55451834",
"0.5531986",
"0.55311584",
"0.55274093",
"0.5526184",
"0.55245394",
"0.55211073",
"0.5516362",
"0.54936296",
"0.5476403",
"0.5461327",
"0.5443506",
"0.5440003",
"0.5435756",
"0.5414173",
"0.5412969",
"0.5399268",
"0.53887665",
"0.53864604",
"0.53850406",
"0.5384278",
"0.5384278",
"0.5379362",
"0.5377191",
"0.5360217",
"0.5348872",
"0.53459346",
"0.53448063",
"0.53435904",
"0.53388774",
"0.5331753",
"0.5317986",
"0.53036004",
"0.53008306",
"0.5299808",
"0.52942985",
"0.52809715",
"0.5277154",
"0.5269991",
"0.5267453",
"0.52645594",
"0.5255091",
"0.5250015",
"0.5218028",
"0.5217961"
] | 0.0 | -1 |
Replace this with your real tests. | def test_aggregation
dta = Foci::Aggregators::DownloadTotalAggregator.new
parser = Foci::LogParser.new
fields = parser.parse_line('193.34.112.161 - - [06/May/2007:07:04:47 -0500] "GET /" 200 22600 "-" "-" dist.co... 25')
vhost = Vhost.find_by_host('dist.example.com')
assert_not_nil vhost
period = Period.find_by_name('Dec 2004')
assert_not_nil period
dta.process(vhost, period, fields)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def testing\n # ...\n end",
"def __dummy_test__\n end",
"def tests; end",
"def tests; end",
"def spec; end",
"def spec; end",
"def self_test; end",
"def self_test; end",
"def test \n end",
"def test_0_dummy\n\t\tend",
"def test\n\n end",
"def test\n end",
"def test\n end",
"def test\n end",
"def private; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def test_method\n end",
"def before_test(test); end",
"def before_test(test); end",
"def graffiti_test\n end",
"def test_truth\n end",
"def test_should_get_index \n get :index\n assert_response :success #making sure the request was successful\n assert_not_nil (:products) # ensuring that it assigns a valid products instance variable.\n end",
"def test_case; end",
"def test_cases; end",
"def running_test_case; end",
"def test_connection\n end",
"def testloop\n \n end",
"def should; super end",
"def test_nothing\n end",
"def default_test\r\n end",
"def my_tests\n end",
"def test_setup\r\n \r\n end",
"def test_intialize\r\n\tassert_equal 0, @test_prospector.current_gold\r\n\tassert_equal 0, @test_prospector.current_silver\r\n\tassert_equal 0, @test_prospector.total_gold\r\n\tassert_equal 0, @test_prospector.total_silver\r\n\tassert_equal 0, @test_prospector.move_count\r\n\tassert_nil @test_prospector.previous_location\r\n\tassert_equal 0, @test_prospector.num_days\r\n\tassert_equal 'Sutter Creek', @test_prospector.current_location\r\n end",
"def testing_end\n end",
"def test_next_song\n \n \n assert true\n end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def assertions; end",
"def assertions; end",
"def test_hack\n assert(true)\n end",
"def setup\n\n end",
"def setup\n\n end",
"def setup\n\n end",
"def test_attributes\n assert_equal \"Gallery 1\", @gallery.title\n assert @gallery.active?\n assert_equal \"f82dd0bd-4711-4578-ac47-4661257e69a6\", @gallery.guid\n end",
"def teardown; end",
"def teardown; end",
"def setup\n \n end",
"def setup\n \n end",
"def setup\n \n end",
"def setup\n \n end",
"def setup\n \n end",
"def setup\n \n end",
"def setup\n \n end",
"def before_assert\n end",
"def test_fake_rubies_found\n\t\ttest_main = Main.new(3, 4, 6)\n\t\ttest_graph = Graph.new(10)\n\t\ttest_main.fake_rubies_found(7)\n\t\ttest_main.fake_rubies_found(7)\n\t\tassert test_main.num_fake_rubies, 14\n\tend",
"def setup\n end",
"def setup\n end",
"def setup\n end",
"def setup\n end",
"def setup\n end",
"def setup\n end",
"def test_entry\n raise \"Implement this method in your test class\"\n end",
"def tests_song_not_found\n assert_equal =\n end\n\nend",
"def test_playlist\n end",
"def test_listchunk_attributes\n\t\t\n\tend",
"def love_test\nend",
"def test_entry_attrs\n raise \"Implement this method in your test class\"\n end",
"def test_truth\n assert true\n end",
"def stest_method_1(test); end",
"def teardown\r\n end",
"def default_test\n end",
"def test_037\n\n login\n\n #Create some PUs\n\n for i in 0..2\n create_pu('sample_pu'+i.to_s)\n end\n\n pus = Pu.find_all_by_name('sample_pu1')\n pu = pus.last\n pu.created_at =\"2009-05-08 11:30:50\"\n pu.save\n pus = Pu.find_all_by_name('sample_pu2')\n pu = pus.last\n pu.created_at =\"2008-05-08 14:30:50\"\n pu.save\n @@year = \"2009\"\n @@hour = \"14\"\n\n # Open PU management page\n open_pu_management_page_1\n\n # Arbitrary filtering is performed to PU name.\n assert_equal _(\"PU name\"), get_selected_label(\"find_box\")\n\n\n # you have no relevance\n filtering('3')\n assert !is_text_present('sample_pu1')\n assert !is_text_present('sample_pu2')\n assert is_text_present(_('A PU does not exist.'))\n sleep 2\n\n # Delete created data\n @@pu= Pu.find_by_name('sample_pu1')\n @@pu2= Pu.find_by_name('sample_pu2')\n @@pu.destroy\n @@pu2.destroy\n logout\n end",
"def run_fe_tests\n end",
"def after_test(_test); end",
"def after_test(_test); end",
"def after_test(_test); end",
"def setup; end",
"def tests=(_arg0); end",
"def tests=(_arg0); end",
"def test_truth\n april = riders(:rider_1)\n assert_equal \"April Jones\", april.name\n trigger = horses(:horse_1)\n assert_equal \"Trigger\", trigger.name\n event2 = events(:event_2)\n assert_equal \"5 Horse Scramble\", event2.name\n \n end",
"def test_BooksForAnAuthor\n loginRegisterBazzarVoice\n writeReview \n assert true \n end"
] | [
"0.7446459",
"0.6956364",
"0.69155836",
"0.69155836",
"0.6864151",
"0.6864151",
"0.66406286",
"0.66406286",
"0.66253287",
"0.6547665",
"0.6524571",
"0.6484549",
"0.6484549",
"0.6484549",
"0.6403847",
"0.6389188",
"0.6389188",
"0.6389188",
"0.6389188",
"0.6389188",
"0.6389188",
"0.6389188",
"0.6389188",
"0.6389188",
"0.6389188",
"0.6389188",
"0.6389188",
"0.6389188",
"0.6389188",
"0.6389188",
"0.6389188",
"0.6389188",
"0.6389188",
"0.6389188",
"0.6385941",
"0.6354074",
"0.6354074",
"0.6350063",
"0.6317573",
"0.6271346",
"0.62341285",
"0.6210424",
"0.6183045",
"0.61626923",
"0.61574936",
"0.6137384",
"0.61362237",
"0.61194503",
"0.611745",
"0.61087",
"0.6098303",
"0.606717",
"0.6058555",
"0.6057699",
"0.6057699",
"0.6057699",
"0.6057699",
"0.6045397",
"0.6045397",
"0.6029009",
"0.60160005",
"0.60160005",
"0.60160005",
"0.6014079",
"0.5998994",
"0.5998994",
"0.5991374",
"0.5991374",
"0.5991374",
"0.5991374",
"0.5991374",
"0.5991374",
"0.5991374",
"0.5989936",
"0.59822077",
"0.59556234",
"0.59556234",
"0.59556234",
"0.59556234",
"0.59556234",
"0.59556234",
"0.5950605",
"0.59497803",
"0.5943133",
"0.59424186",
"0.5932352",
"0.59296894",
"0.5929659",
"0.5917424",
"0.59144044",
"0.5913393",
"0.5905494",
"0.5899468",
"0.58910733",
"0.58910733",
"0.58910733",
"0.5889112",
"0.5883961",
"0.5883961",
"0.5880121",
"0.5877717"
] | 0.0 | -1 |
require 'backports' gem install backports / array:rotate / ruby 1.8 | def memory_usage
`ps -o rss= -p #{Process.pid}`.to_i # in kilobytes
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def converted_arrays; end",
"def rotate(arr)\n\nend",
"def instantiate_new_array\n<<<<<<< HEAD\n Array.new\nend",
"def rotate_array(array)\n array[1..-1] << array[0]\nend",
"def rotate_array(array)\narray[1..-1] + [array[0]]\nend",
"def rotate_array(array)\n array[1..-1] + [array[0]] \nend",
"def rotate_array(ar)\n ar[1..-1] << ar[0]\nend",
"def rotate_without_changing(arr)\n\nend",
"def rotate_backwards(arr)\n\nend",
"def rotate_array(array)\n array[1..-1] + [array[0]]\nend",
"def rotate_array(array)\n array[1..-1] + [array[0]]\nend",
"def rotate_array(array)\n array[1..-1] + [array[0]]\nend",
"def rotate_array(array)\n array[1..-1] + [array[0]]\nend",
"def rotate_array(array)\n array[1..-1] + [array[0]]\nend",
"def rotate_array(array)\n array[1..-1] + [array[0]]\nend",
"def rotate_array(array)\n array[1..-1] + [array[0]]\nend",
"def rotate_array(array)\n array[1..-1] + [array[0]]\nend",
"def rotate_array(array)\n array[1..-1] + [array[0]]\nend",
"def rotate_array(array)\n array[1..-1] + [array[0]]\nend",
"def rotate_array(array)\n array[1..-1] + [array[0]]\nend",
"def rotate_array(array)\n array[1..-1] + [array[0]]\nend",
"def rotate_array(array)\n array[1..-1] + [array[0]]\nend",
"def rotate_array(array)\n results = []\n results << array\n results = results.flatten\n last = results.shift \n results << last\nend",
"def rotate_array(numbers)\n numbers[1..-1] + [numbers[0]]\nend",
"def rotate_array(numbers)\n numbers[1..-1] + [numbers[0]]\nend",
"def rotate_array(array)\n array[1..-1] + [array[0]] # brackets added to array[0] to force it to an array from integer.\nend",
"def rotate_array(array)\n array[1..-1] + array[0..0]\nend",
"def rotate_array(ary)\r\n ary[1..-1] << ary[0]\r\nend",
"def rotate_array(array)\n new_array = array.dup \n new_array << new_array.shift \nend",
"def rotate_array_alt(arr)\n arr[1..-1] + [arr[0]]\nend",
"def install_order(arr)\n\nend",
"def rotate_array(array)\n copy = array.dup\n popped = copy.shift\n copy << popped\nend",
"def rotate_array(array)\n new_array = array\n\n last = new_array.shift\n new_array << last\n\n p new_array\nend",
"def my_rotate(arr)\n print arr.rotate\n end",
"def rotate_array(array)\n arr2 = []\n arr2.concat(array[1..-1]) << array[0]\nend",
"def rotate_array(arr)\n arr[1..-1] + [arr[0]]\nend",
"def rotate_array(arr)\n arr[1..-1] + [arr[0]]\nend",
"def rotate_array(arr)\n arr[1..-1] + [arr[0]]\nend",
"def rotate_array(arr)\n arr[1..-1] + [arr[0]]\nend",
"def rotate_array(arr)\n arr[1..-1] + [arr[0]]\nend",
"def rotate_array(arr)\n arr[1..-1] + [arr[0]]\nend",
"def rotate_array(arr)\n arr[1..-1] + [arr[0]]\nend",
"def rotate_90(array)\n a = copy array\n a.transpose.map { |e| e.reverse }\nend",
"def rotate_arr(arr)\n result_arr = arr.map{|num| num}\n result_arr << result_arr[0]\n result_arr.shift\n result_arr\nend",
"def rotate_array(arr)\n array = arr.dup\n array << array.shift\nend",
"def rotate_array(arr)\nnew_arr = []\narr.each do |num|\nnew_arr << num\nend\t\nnew_arr << new_arr.shift\nend",
"def my_rotate!(array, amt)\n\nend",
"def rotate_array(ary)\n ary[1..-1] + [ary[0]] # need to concatenate 2 arrays\nend",
"def rotate_array(arr)\narr.drop(1) + arr[0...1]\nend",
"def rotate_array(array)\n result = []\n array.each_with_index do |value, index|\n result.push(value) if index > 0\n end\n result.push(array[0])\n result\nend",
"def rotate_array(arr)\n results = arr.map { |n| n }\n results << results.shift\nend",
"def rotate_array(array)\n result = []\n result << array.shift\n # array << result[-1] # can use either the push method of << operator\n array.push(result[-1])\nend",
"def rotate_array(aArray, off_x, off_y, rel_angle, change_in_place=false)\r\n # - - - - - - - - - - - - - - - - - - - - -\r\nend",
"def my_rotate(num = 1)\n new_array = []\n \n new_array\nend",
"def rotate_array(array)\n array.values_at(1..-1, 0)\nend",
"def rotate_array(array)\n arr = array.dup\n p arr.push(arr.shift)\nend",
"def rotate_array(ary)\r\n return ary if ary.nil?\r\n ary[1..-1] << ary[0]\r\nend",
"def rotate_array(arr)\n\narr_new = arr.clone\narr_new.push(arr_new[0]).shift\narr_new\nend",
"def rotate_array(unrotated)\n unrotated[1..] + [unrotated.first]\nend",
"def rotate_array(unrotated)\n unrotated[1..] + [unrotated.first]\nend",
"def rotate_array(numbers)\n new_numbers = []\n new_numbers << numbers[1,numbers.size] << numbers[0]\n new_numbers.flatten\nend",
"def rotate_array(array)\n array[1, array.size] << array[0]\nend",
"def rotate_array(array)\r\n result = array.select {|x| x}\r\n result << result.shift\r\nend",
"def \n \n using_shift(array)\n #-X- (arg_of_array) // empalm //\n \n array.shift()\n \nend",
"def rotate_array(array)\n [array[1..-1], array[0]].flatten\nend",
"def rotate_array(arr)\n arr_copy = arr.dup\n arr_copy << arr_copy.shift\nend",
"def rotate_array(ary)\n ary[1..-1] + [ary[0]]\nend",
"def rotate_array(ary)\n ary[1..-1] + [ary[0]]\nend",
"def rotate_array(list)\n list[1..-1] + [list[0]]\nend",
"def rotate_array(arr)\n new_arr = arr.clone\n new_arr << new_arr.shift\n new_arr\nend",
"def rotate_array(arr)\n arr[1..(arr.size - 1)] << arr[0]\nend",
"def rotate_array(arr)\n arr[1..(arr.size - 1)] << arr[0]\nend",
"def rotate_array(arr)\n [arr[1..-1],arr[0]].flatten\nend",
"def rotate_array(arr, num)\n num.times do \n ele = arr.pop \n arr.unshif(ele)\n end\n return arr \nend",
"def rotate_array(array_of_numbers)\n rotated_array = array_of_numbers.clone\n rotated_array << rotated_array.shift\n\n rotated_array\nend",
"def rotate_array(array)\n rotated = array[1..-1]\n first = array.first\n rotated.push(first)\nend",
"def rotate_array(arr)\n local_array = arr.clone\n local_array << local_array.shift\nend",
"def lcts(array)\nend",
"def rotate_array(array)\n first_value = array.slice(0)\n other_values = array.slice(1..-1)\n other_values << first_value\nend",
"def rotate_array(array)\n first_value = array.slice(0)\n other_values = array.slice(1..-1)\n other_values << first_value\nend",
"def rotate_array1(arr)\n rotated_arr = arr.map { |element| element }\n rotated_arr.push(rotated_arr.shift)\n\n rotated_arr\nend",
"def rotate_array(arr)\n [*arr[1..-1], *arr[0, 1]]\nend",
"def rotate_array(arr)\n arr[1...arr.size] + [arr[0]]\nend",
"def rotate_array(arr)\n arr[1...arr.size] + [arr[0]]\nend",
"def rotate_array(arr)\n\tnew_arr = arr.dup\n\tlast = new_arr.shift\n\tnew_arr << last\nend",
"def rotate_array(array)\n array.drop(1) + array.take(1)\nend",
"def rotate_array(arr)\n arr2 = arr.dup\n first = arr2.shift\n arr2 << first\nend",
"def rotate_array(numbers)\n arr = []\n numbers.each { |num| arr << num }\n arr.push(numbers[0]).shift\n arr\nend",
"def rotate_array(arr)\n rotated = arr.clone\n rotated.insert(-1, rotated.shift)\nend",
"def rotate_array(input_array)\n return input_array if input_array.size <= 1\n new_array = []\n index_counter = 1\n loop do\n new_array << input_array[index_counter]\n index_counter += 1\n break if index_counter >= input_array.size\n end\n new_array << input_array[0]\n new_array\nend",
"def rotate_array(arr)\n arr1 = arr.clone\n f = arr1.shift\n arr1 << f\nend",
"def rotate_array(array)\n new_array = array.dup\n first_element = new_array.shift\n new_array.append(first_element)\n new_array\nend",
"def rotate_array(arr)\n new_arr = arr.clone # avoid mutation\n first_element = new_arr.shift\n new_arr << first_element # could've called new_arr.shift here instead\n new_arr # later realized that this is redundant\nend",
"def my_rotate(arr, offset=1)\r\n # your code goes here\r\n # take first offset elements and append to end of array\r\n shift = offset % arr.length\r\n arr.drop(shift) + arr.take(shift)\r\nend",
"def rotate_array(arr)\n place_holder = arr.clone\n x = place_holder.slice!(0)\n place_holder.push(x)\nend",
"def array_converter(*args)\n \nend",
"def rotate_array(arr)\n new_arr = arr.dup\n new_arr.push(new_arr.shift)\nend",
"def rotate_array(array)\n arr_copy = array.clone\n return arr_copy if arr_copy.empty?\n arr_copy.push(arr_copy.shift)\nend",
"def rotate_array(arr)\n arr.empty? ? arr : arr[1..-1] << arr[0]\nend",
"def rotate_array(ary)\n new_ary = []\n ary.each { |e| new_ary << e}\n new_ary << new_ary.shift\n new_ary\nend",
"def rotate_array(array)\n new_array = array.select { |element| element }\n new_array << new_array.shift\nend"
] | [
"0.60965025",
"0.60379744",
"0.60223967",
"0.59507906",
"0.59231126",
"0.59180856",
"0.5883893",
"0.58836436",
"0.5883235",
"0.58569205",
"0.58569205",
"0.58569205",
"0.58569205",
"0.58569205",
"0.58569205",
"0.58569205",
"0.58569205",
"0.58569205",
"0.58569205",
"0.58569205",
"0.58569205",
"0.58569205",
"0.5850458",
"0.58356124",
"0.58356124",
"0.5820205",
"0.58072364",
"0.5804621",
"0.57870626",
"0.57855195",
"0.57801104",
"0.57795286",
"0.5768844",
"0.57670724",
"0.5763497",
"0.5727979",
"0.5727979",
"0.5727979",
"0.5727979",
"0.5727979",
"0.5727979",
"0.5727979",
"0.57278544",
"0.57260233",
"0.5722808",
"0.5712397",
"0.5707509",
"0.56862706",
"0.5684811",
"0.5683923",
"0.5681056",
"0.5676384",
"0.5672466",
"0.56700927",
"0.5665148",
"0.5660982",
"0.5657851",
"0.5655452",
"0.56550884",
"0.56550884",
"0.5651729",
"0.5649405",
"0.56157607",
"0.56156",
"0.5615551",
"0.5603632",
"0.5593812",
"0.5593812",
"0.5593305",
"0.5586913",
"0.55825126",
"0.55825126",
"0.5580234",
"0.5580178",
"0.5564066",
"0.55597556",
"0.5541746",
"0.5525538",
"0.5502729",
"0.5501733",
"0.5500323",
"0.549833",
"0.5482225",
"0.5482225",
"0.5479977",
"0.5466306",
"0.54526216",
"0.5450338",
"0.5445185",
"0.54422426",
"0.5436633",
"0.54331696",
"0.54188395",
"0.5418275",
"0.540945",
"0.5405871",
"0.54041094",
"0.53964746",
"0.5388041",
"0.53772163",
"0.5367043"
] | 0.0 | -1 |
check if puzzle solved. | def solved?
# pour toutes les pièces
(0..8).each { |i|
# la case est encore vide : solved = false
return false if @cases[i] == nil
# sinon, est-ce que les pièces matchent entre elles.
return false if not self.match?(i)
}
# sinon, ca match partout : le puzzle est résolu (solved) !
return true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def solved?\n end",
"def solved?\n @solution != nil\n end",
"def solve\n\n #Loop until the puzzle is solved or until one\n #loop didn't change any values\n #--------------------------------------------------\n puzzle_check\n \n #If the puzzle wasn't solved, try one more time\n if !@value_changed\n @value_changed = true\n puzzle_check\n end\n \n puts \"Solved: #{@solved}, Unable to solve:#{!@value_changed}\"\n end",
"def solved?\n # Return whether the total passed in is equal to the total for a valid house.\n def is_valid_house_total?(total)\n return total == 45\n end\n\n # Return the total of adding up all the cells in this house.\n def house_total(house)\n return house.inject(0) {|sum, cell| sum + cell.to_i }\n end\n\n ## Check whether all the houses in the puzzle have valid totals.\n ##\n\n each_row do |row|\n return false unless is_valid_house_total?(house_total(row))\n end\n\n each_column do |column|\n return false unless is_valid_house_total?(house_total(column))\n end\n\n each_nonet do |nonet|\n return false unless is_valid_house_total?(house_total(nonet))\n end\n end",
"def solved?\n !@grid.nil? && @grid.missing == 0\n end",
"def solved?\n cols = @grid.transpose\n return false unless (0..8).all? {|i| check_cols(i) && check_row(i)}\n (0..2).each do |horiz| \n (0..2).each {|vert| return false unless check_square(horiz,vert)}\n end\n true\n end",
"def solvable?\n find_solution > 0\n end",
"def solved?\n result = false\n @data.each do |turn|\n result = turn[:key].red >= 4 if !turn[:key].nil?\n break if result == true\n end\n @solved = result\n result\n end",
"def solved?\n !@grid.nil? && @grid.missing == 0\n end",
"def solved?\n unknown_count == 0\n end",
"def solved?\n @state == @goal\n end",
"def is_solution? \n zero= false\n 0.upto(@width-1) do |x|\n 0.upto(@height-1) do |y|\n if @pole[x][y]==0\n zero = true\n break\n end\n end\n end\n print \"Je to reseni, pyco!\\n\" if !zero\n return !zero \n end",
"def check_puzzle(puzzle, board=Nil)\n solver = PuzzleSolver.new(puzzle)\n answer = solver.solve\n stack = solver.stack\n\n if answer.nil?\n return -1\n end\n if !board.nil? && !board_matches(board, answer)\n return -1\n end\n difficulty = stack.length\n state, second = PuzzleSolver.new(board, stack).solve_next # TODO CLEANUP\n if !second.nil?\n return -1\n end\n\n difficulty\n end",
"def solved?(board)\n if\n board.each do |row|\n end\n else\n false\n end\n\nend",
"def solved?\n @solution !~ /-/\n end",
"def solution_for?(puzzle)\n solution? and puzzle.subset?(self)\n end",
"def solved?\n p @solved\n end",
"def solved?\n !!self.answers.select {|x| x.correct}[0]\n end",
"def solved\n all_queens_placed && attacks_possible != true\n end",
"def solved?(board_array)\n return valid?(board_array) && valid?(transpose_arrays(board_array)) && valid?(create_grid(board_array))\nend",
"def board_solved?\r\n # Check that all the cells are filled with values\r\n #\r\n (0 .. 8).each do |row|\r\n (0 .. 8).each do |col|\r\n return false unless board[row][col] > 0\r\n end\r\n end\r\n \r\n # Check column constraints\r\n #\r\n @board.each do |column|\r\n return false unless column.uniq.size == 9\r\n end\r\n \r\n # Check row constraints\r\n #\r\n @board.transpose.each do |column|\r\n return false unless column.uniq.size == 9\r\n end\r\n \r\n # Check box constraints\r\n #\r\n (0 .. 2).each do |box_x|\r\n (0 .. 2).each do |box_y|\r\n box_vals = []\r\n \r\n (0 .. 2).each do |i|\r\n (0 .. 2).each do |j|\r\n box_vals << @board[3 * box_x + i][3 * box_y + j]\r\n end\r\n end\r\n \r\n return false unless box_vals.uniq.size == 9\r\n end\r\n end\r\n \r\n true\r\n end",
"def verifierCorrect()\n return @solution.equals(@partie.getCurrentGrid())\n end",
"def test_solve_sudoku\n assert_equal(false, @sudoku_1.sudoku_complete?(@sudoku_1))\n @sudoku_1.solve_sudoku(@sudoku_1)\n assert_equal(true, @sudoku_1.sudoku_complete?(@sudoku_1))\n end",
"def solved_by?(contestant)\n if solutions.where(:user_id => contestant).empty?\n return false # not solved\n else\n return true # solved\n end\n end",
"def solve!\n return false unless valid?\n return @board.join if solved?\n\n unsolved = @board.index(\"0\")\n\n (1..9).each do |possible|\n @board[unsolved] = possible\n solution = Sudoku.new(@board.join).solve!\n return solution if solution\n end\n\n false\n end",
"def failed?\n solutions.empty?\n end",
"def complete?(params)\n if @puzzle.complete?\n if @puzzle.to_s == @solution.to_s\n return JSON.generate({complete: true, accurate: true})\n else\n return JSON.generate({complete: true, accurate: false})\n end\n else\n return JSON.generate({complete: false, accurate: false})\n end\n end",
"def solve\n # If the puzzle has already been solved, don't solve it again, just return.\n return self if solved?\n\n # If the puzzle is not valid, we'll error out.\n @algorithm.solve(self) if valid?\n\n self\n # Catch puzzle validity errors\n rescue => e\n puts \"Error: #{e.message}\"\n exit\n end",
"def solved?\n first_empty_index.nil? && legal?\n end",
"def complete?\n if @puzzle.include? \".\"\n return false\n else\n return true\n end\n end",
"def solve(puzzle = @puzzle)\n #make sure we have unknown spaces\n puts \"SOLVE CALLED\"\n puzzle.propogate_constraints\n puts puzzle.present\n if puzzle.solved?\n puts \"SOLVED\"\n return puzzle\n elsif puzzle.invalid?\n puts \"INVALID\"\n return false\n else\n puts \"PUZZLE NOT SOLVED AND PUZZLE NOT INVALID\"\n new_copy = copy(puzzle)\n puts new_copy.present\n\n unknown = new_copy.spaces.select { |space| !space.known? }\n space_to_guess = unknown.sort { |a, b| a.possibilities.size <=> b.possibilities.size } [0]\n puts \"#{space_to_guess}\"\n guess = space_to_guess.possibilities.to_a[0]\n puts \"Assigning #{guess} to #{space_to_guess.coords}\"\n new_copy.assign(space_to_guess, guess)\n puts new_copy.present\n if(solve(new_copy))\n return new_copy\n else\n puts \"eliminating #{guess} from #{space_to_guess.coords}\"\n puzzle.eliminate(puzzle.get_space(space_to_guess.coords), guess)\n puzzle.propogate_constraints\n solve(puzzle)\n end\n end\n end",
"def is_solved?\n return false unless is_rows_valid?\n return false unless is_columns_valid?\n return false unless is_subgrids_valid?\n true\n end",
"def solved?(board)\n if board.include?(\"-\")\n false\n else true\n end\nend",
"def check(board, solution)\n available_indications = board.next_boards.map do |board_with_move|\n solution.call(board_with_move)\n end\n required_indications = (0..(@board_length - 1)).to_a\n impossible_indications = (required_indications - available_indications)\n unless impossible_indications.empty?\n puts \"no move available to indicate #{impossible_indications} for #{board}\"\n puts \"boards_with_moves #{boards_with_moves}\"\n puts \"available #{available_indications}\"\n end\n impossible_indications.empty?\n end",
"def solved?\n self.fittest.fitness >= 1.0\n end",
"def solve\n\t\t\n\t\tcell_index = 0\n\t\t# move to the right position..\n\t\t# puts @unsolved.length.to_s + \" unknown cells!\"\n\n\t\twhile cell_index >= 0 && cell_index < @unsolved.length do\n\t\t\tcell = @unsolved[cell_index];\n\t\t\t\n\t\t\tpossible = cell.nextPossible()\t\n\n\t\t\tif possible > 9 || possible <= 0\n\t\t\t\tcell.set(0)\n\t\t\t\tcell_index -= 1\n\t\t\telse\n\t\t\t\tcell.set(possible)\n\t\t\t\tcell_index += 1\n\t\t\tend\t\t\t\t\t\t\t\n\t\tend\n\n\t\tif cell_index < 0\n\t\t\treturn false\n\t\telse\n\t\t\treturn true\n\t\tend\n\tend",
"def solvable?\n\t\tsteps > 0\n\tend",
"def solve\n fail 'invalid game given' unless @grid.valid?\n puts \"missing values #{@grid.missing}, filled #{@grid.filled}\"\n end",
"def solved?\n letter = won_across?\n return letter if letter\n letter = won_up_and_down?\n return letter if letter\n letter = won_diagonally?\n return letter if letter\n false\n end",
"def solved?(board)\n board.all? { |row| row.flatten.length == 9 && row.sort == [1,2,3,4,5,6,7,8,9] }\nend",
"def solvable?\n steps > 0\n end",
"def checker\n @correct_pos = 0\n @correct_num = 0\n x = 0\n @guess.each do |i|\n if (i == @solution[x])\n @correct_pos += 1\n elsif @solution.include?(i)\n @correct_num += 1\n end\n x += 1\n end\n end",
"def solved?\n\t\treturn @blocks.clues == showingClues\n\tend",
"def same?(puzzle, target)\n if puzzle == target\n return true\n else\n return false\n end\nend",
"def solved\n @solved = @rows.flatten.include?(\"0\") ? false : true\n end",
"def test_solve_empty_3x3\n square = MagicSquare.new(3)\n square.solve\n assert square.solved?\n assert_equal @@solutions.first, square.solution\n end",
"def solved_check\n ->() { true }\n end",
"def solved?(user)\n\t\tif SolvedProblem.find_by(user_id: user.id, problem_id: self.id)\n\t\t\treturn true\n\t\telse\n\t\t\treturn false\n\t\tend\n\tend",
"def solver\n if checkrule(0)\n puts \"Success!!!\"\n else\n puts \"No solution found\"\n end\n end",
"def solved?(board_string)\n board_array = board_to_array(board_string)\n solved_board = add_number?(board_array)\n return solved_board\nend",
"def solved? (guesses, word)\n\tsolved = true\n\thits = []\n\tword.length.times do |i|\n\t\thits << word[i]\n\tend\n\thits.each do |hit|\n\t\tunless guesses.include? hit\n\t\t\tsolved = false\n\t\tend\n\tend\n\tsolved\n\n\n\t\nend",
"def solved sol\n\tfor i in 0...sol.size\n\t\tfor j in 0...sol[i].size\n\t\t\tif sol[i][j].ord < 'a'.ord\n\t\t\t\treturn false\n\t\t\tend\n\t\tend\n\tend\n\n\treturn true\nend",
"def solved?(challenge, solution)\n challenge == encrypt(solution)\n end",
"def solve(puzzle)\n result = Array.new\n puzzle['puzzle'].each_with_index do |row, rowindex|\n row.each_with_index do |column, colindex|\n if puzzle['puzzle'][rowindex][colindex] == true\n result.push({'X' => colindex, 'Y' => rowindex, 'Size' => 1})\n end\n end\n end\n return result\n end",
"def solvable?\n @cube_state.solvable?\n end",
"def valid?\n 1.upto(puzzle.size) { |index| return false unless valid_row?(index - 1) && valid_column?(index - 1) }\n sections.all? { |section| valid_section?(section) }\n end",
"def solution_exists?\n ! @solved_node.nil?\n end",
"def solve!\n simple_sudoku_logic\n puts \"HERE'S YOUR BOARD, SOLVED. ?\"\n display_board\n end",
"def solution_checker(array)\n if array.length > 1\n # Create a board that can be manipulated without affecting the original board\n internal_board = []\n column_counter = 1\n row_counter = 1\n 4.times do\n 4.times do\n internal_board.push(Square.new([column_counter, row_counter]))\n column_counter = column_counter + 1\n end\n row_counter = row_counter + 1\n column_counter = 1\n end\n #Label squares on the board as occupied\n array.each do |piece|\n square = internal_board.find {|s| s.location == piece.location}\n square.occupied = true\n square.piece = piece\n end\n array.each_with_index do |piece, index|\n if array.include?(piece) && piece != array.last\n original_square = internal_board.find {|s| s.location == piece.location}\n blocker = piece.impediments?([(array[index + 1]).column, (array[index + 1]).row], internal_board)\n if blocker\n break\n elsif piece.move([(array[index + 1]).column, (array[index + 1]).row])\n captured_piece = array[index + 1]\n array.uniq!{|piece| piece.location}\n original_square.occupied = false\n original_square.piece = nil\n new_moves = array.permutation.to_a\n new_moves.each do |new_array|\n new_array.map {|a| a.dup}\n end\n new_moves.each do |new_array|\n solution_checker(array)\n end\n else\n break\n end\n else\n break\n end\n end\n end\nend",
"def solved?(board)\n if board.join.match(/\\D/)\n false\n else\n true\n end\nend",
"def resivo?\n \n if pogodci < 17\n return false\n end\n \n kopiraj = self.dup\n kopiraj.solve!\n \n return kopiraj.reseno?\n end",
"def solve_until_complete\n old_truth_table = nil\n while old_truth_table != @truth_table\n old_truth_table = @truth_table.dup\n solve_once\n end\n @solved = true\n end",
"def solve(row, col)\n\tif row == 9 then\n\t\treturn true\n\tend\n\t\n\tif col == 9 then\n\t\treturn solve(row +1, 0)\n\tend\n\t\n\tif @sudokuBoard[row][col] != 0 then\n\t\treturn solve(row, col +1)\n\tend\n\t\n\t1.upto(9) {\n\t|num|\n\t\n\tif check(row,col,num) then\n\t\t@sudokuBoard[row][col] = num\n\t\tif solve(row, col+1) then\n\t\t\treturn true\n\t\tend\n\tend\n\t}\n\t\n\t@sudokuBoard[row][col] = 0\n\treturn false\n\t\n\t\n\tend",
"def validSolution(board)\n return false if board.flatten.size != 81\n return false if board.flatten.any? { |el| el.class != Fixnum }\n return false if board.size != 9\n board.each do |row|\n return false if row.any? { |el| el < 1 || el > 9 }\n return false if row.uniq.size != 9\n end\n (0..8).each do |col|\n this_col = []\n (0..8).each do |el|\n this_col << board[el][col]\n end\n return false if this_col.uniq.size != 9\n end\n [-1, 2, 5].each do |xoffset|\n [-1, 2, 5].each do |yoffset|\n this_square = []\n (1..3).each do |x|\n (1..3).each do |y|\n this_square << board[x + xoffset][y + yoffset]\n end\n end\n return false if this_square.uniq.size != 9\n end\n end\n true\nend",
"def solvable?\n return true if full?\n\n state_array_copy = @state_array.dup\n start_index = state_array_copy.index(false)\n index_stack = [start_index]\n connected_found = 0\n until index_stack.empty?\n index = index_stack.pop\n next if state_array_copy[index]\n\n state_array_copy[index] = true\n connected_found += 1\n index_stack += neighbor_indices(index)\n end\n return false unless connected_found + @num_occupied == @size ** @dimension\n\n num_dead_ends = (0...@size ** @dimension).to_a.count do |index|\n !@state_array[index] && neighbor_indices(index).count { |neighbor_index| !@state_array[neighbor_index] } == 1\n end\n return num_dead_ends <= 1\n end",
"def done?(assignments)\n \tassignments.size == problem.vars.size\n end",
"def valid?\n tally = Hash.new(0)\n tally[:xxx] = 1\n \n 5.times do |u|\n 5.times do |h|\n if !@solution[h][u].nil?\n tally[@solution[h][u]] += 1\n end\n end\n return true if tally.values.max < 2\n end\n puts \"invalid: #{tally.inspect}\"\n puts self.to_s\n return false\n end",
"def hook_solution?(a); end",
"def solve!\n \t# keep looping if previous board doesn't match current board (new grids are being solved)\n\t \twhile true do\n\t\t \t@sudoku.each_with_index do |row, rowindex|\n\t\t \t\trow.each_with_index do |cell, cellindex|\n\t\t \t\t\t# duplicate sudoku board to solve grids and compare with previous board\n\t\t \t\t\t@sudokudup = @sudoku.dup\n\t\t \t\t\t# get the array of numbers from current column \n\t\t \t\t\tcol = @sudoku.transpose[cellindex]\n\t\t \t\t\t# find unsolved grids\n\t\t \t\t\tnext if cell != 0\n\t\t \t\t\t# form an array of possible solutions, starting with all numbers from 1 to 9\n\t\t \t\t\tsolutions=(1..9).to_a\n\t\t \t\t\t# loop through numbers from 1 to 9, delete the number from solutions if it appears in current row/column\n\t\t \t\t\t1.upto(9) {|x| solutions.delete(x) if row.include?(x)}\n\t\t \t\t\t1.upto(9) {|x| solutions.delete(x) if col.include?(x)}\n\n\t\t \t\t\t# get the numbers from current box(3x3 grid)\n\t\t \t\t\t# example (number in each grids represent column index):\n\t\t \t\t\t# | 0 1 2 | - 0 (row/array index)\n\t\t \t\t\t# | 0 1 2 | - 1\n\t\t \t\t\t# | 0 1 2 | - 2\n\t\t \t\t\t# ---------\n\t\t \t\t\t# box_x returns the array/row index of the top left number of current box (refer to sample board)\n\t\t \t\t\tbox_x = (rowindex./3)*3\n\t\t \t\t\tbox = []\n\t\t \t\t\t# loop through the 3 rows in the box\n\t\t \t\t\t3.times do\n\t\t \t\t\t\t# box_y returns the column index of the top left number of current box (refer to sample board)\n\t\t \t\t\t\tbox_y=(cellindex./3)*3\n\t\t \t\t\t\t# loop through the 3 columns for each rows\n\t\t \t\t\t\t3.times do\n\t\t \t\t\t\t\t# insert current number into the 'box' array\n\t\t \t\t\t\t\tbox << @sudoku[box_x][box_y]\n\t\t \t\t\t\t\t# get the next column index from the current row\n\t\t \t\t\t\t\tbox_y += 1\n\t\t \t\t\t\tend\n\t\t \t\t\t\t# get the next row/array index\n\t\t \t\t\t\tbox_x += 1\n\t\t \t\t\tend\n\t\t \t\t\t# delete number from solutions if it appears in current box\n\t\t \t\t\t1.upto(9) {|x| solutions.delete(x) if box.include?(x)}\n\t\t \t\t\t# if solutions contain only 1 number, the current grid will be replaced with the number\n\t\t \t\t\t@sudoku[rowindex][cellindex] = solutions[0] if solutions.length == 1\n\t\t \t\tend\n\t\t \tend\n\t\t \tif @sudoku == @sudokudup\n\t\t \t\tguess\n\t\t \t\treturn @sudoku.flatten.join\n\t\t \t\tbreak\n\t\t \tend\n\t\tend\n end",
"def solved?(board)\n board.detect{|row| row.include?(nil)}\nend",
"def solve(puzzle, row, column = 0)\n return puzzle.flatten if column == 4\n return nil if permissible_values(puzzle, row, column).empty?\n p \"puzzle: #{puzzle}\"\n p \"row: #{row}\"\n p \"column: #{column}\"\n blank_puzzle.each { |i_in_row|\n i_in_row.each { |i_in_column|\n permissible_values(puzzle, i_in_row, i_in_column).map do |value|\n solve(update_puzzle(puzzle.dup, value, row, column), row, column + 1)\n end\n }\n }\nend",
"def solution_correct?\n current = params[:solution].strip\n current.gsub!(/\\/\\*[\\w\\s]*\\*\\//,\"\") \n current.gsub!(/--.*\\n/,\"\")\n existing = format_str(@lesson.solution.strip)\n current = format_str(current.strip)\n if existing == current\n return true\n else\n existing_arr = existing.split\n current_arr = current.split\n len= existing_arr.length\n err =[]\n j=0 \n for i in 0..len\n if existing_arr[i]!=current_arr[i]\n err[j]= existing_arr[i]\n j=j+1 \n end\n end\n return err\n end \n end",
"def problem?\n analysis.any? { |c| !c.ok? }\n end",
"def done_or_not(board)\n\tif chk_horizontal(board) == true && chk_vertical(board) == true && chk_region(board) == true\n\t\t'Finished!'\n\telse \n\t\t'Try again!'\n\tend \nend",
"def first_puzzle a\n # write down your solution to puzzle 1 here\nend",
"def correct?\n\t\treturn finished? && Game.slot(slot).first.winner == winner\n\tend",
"def solution\n solve unless solved?\n @solution\n end",
"def complete\n #81 times for each block in the puzzle\n @board.each do |key, value|\n next if value != 0\n\n candidatesArray = grand_filter(key)\n\n candidatesArray.each do |possibility|\n @board[key] = possibility\n foundAll = complete\n if(foundAll == true)\n return true\n end\n end\n\n # finished trying all the candidates, backtrack\n @board[key] = 0\n return false\n end\n\n return true\n end",
"def converged?\n\t\tnew_board = Board.new\n\t\tnew_board.board = board.dup\n\t\tnew_board.free_positions.each do |position|\n\t\t\tif new_board.add_queen_to_board(position)\n\t\t\t\treturn false\n\t\t\tend\n\t\tend\n\n\t\treturn true\n\tend",
"def reversed?(puzzle, target)\n if puzzle.reverse == target\n return true\n else\n return false\n end\nend",
"def guessed_all_correct?\n end",
"def done?\n # legal_moves(state).empty?\n # Try to speed up by disregarding possibility of draw\n false\n end",
"def board_is_valid?(board)\n conflicts(board) == 0\nend",
"def solve!\n end",
"def solve\n end",
"def valid?\n # Valid puzzle has 9 rows.\n unless @puzzle.size == 9\n raise RuntimeError, \"Sudoku puzzle must have 9 rows.\"\n end\n\n # Valid puzzle has 9 columns of 9 cells.\n each_row do |row|\n unless row.size == 9\n raise RuntimeError, \"Each row in the Sudoku puzzle must have 9 cells.\"\n end\n end\n\n # Valid puzzle has valid cells.\n each do |cell|\n cell.valid?\n end\n\n #TODO: Find out if there are conflicts in row, column or nonet.\n\n # If we get this far without error, the puzzle is valid.\n return true\n end",
"def solve\n while !solved?\n step\n end\n\n self\n end",
"def test_complete_sudoku_true\n assert_equal(true, @c_sudoku_1.sudoku_complete?(@c_sudoku_1))\n end",
"def full?\n answer= @board.each {|box| return false if taken?(box) == false }\n unless answer ==false \n true\n end\n end",
"def run_tests()\n check_solution(1, [1, 4, 10, 13, 15], true)\n check_solution(2, [1, 4, 10, 10, 13, 15], true)\n check_solution(3, [1, 2, 5, 3, 4 ], false)\nend",
"def run_tests()\n check_solution(1, [1, 4, 10, 13, 15], true)\n check_solution(2, [1, 4, 10, 10, 13, 15], true)\n check_solution(3, [1, 2, 5, 3, 4 ], false)\nend",
"def check_sudoku(grid)\n return (check_rows(grid) and check_cols(grid) and check_squares(grid))\nend",
"def solve(puzzle)\n raise NotImplementedError, \"Subclass must implement this method.\"\n end",
"def board_is_correct?()\n _row_checker() && _column_checker() && _square_checker\n end",
"def valid?\n 81.times do |i|\n return false if @board[i] == 0\n return false unless check?(i)\n end\n\n true\n end",
"def finished?\n !board[1..-1].include?(false)\n end",
"def set_solution\r\n @solutions = true\r\n end",
"def game_over\n if @counter == 0 && !(@puzzle_array.join == user.word_to_guess)\n puts \"You didn't get it! The word was #{user.word_to_guess}.\"\n return true\n elsif @counter == 0 && @puzzle_array.join == user.word_to_guess\n puts \"Congrats! You won!\"\n graphic\n return true\n elsif @puzzle_array.join == user.word_to_guess\n puts \"Congrats! You won!\"\n return true\n else\n return false\n end\n end",
"def solve\n possibleMovements.each do |delta|\n moveBy delta\n break if solve\n undoMoveBy delta\n end\n adjacentToFinish?\n end",
"def solved?\n empty_slots.empty? # => same as empty_slots.length == 0\n end"
] | [
"0.8040121",
"0.7899613",
"0.77969956",
"0.7770005",
"0.7699044",
"0.76792985",
"0.76619756",
"0.7654912",
"0.76367146",
"0.754697",
"0.7524984",
"0.7505174",
"0.73927504",
"0.736069",
"0.73512703",
"0.73334247",
"0.73215824",
"0.72496474",
"0.7147381",
"0.71325177",
"0.7087817",
"0.705321",
"0.70168185",
"0.7008317",
"0.694311",
"0.69363177",
"0.69287395",
"0.68683815",
"0.6857401",
"0.6850857",
"0.68422145",
"0.6837628",
"0.6827137",
"0.6824325",
"0.68108547",
"0.68096876",
"0.6764356",
"0.67582345",
"0.6756717",
"0.67430234",
"0.6742287",
"0.6728749",
"0.67260075",
"0.67230916",
"0.6715773",
"0.66841155",
"0.66311353",
"0.6619712",
"0.66192144",
"0.6609059",
"0.65918595",
"0.65703696",
"0.6542629",
"0.65343624",
"0.6509605",
"0.6502372",
"0.64820325",
"0.64512694",
"0.6441195",
"0.64345473",
"0.6388379",
"0.6372264",
"0.63626397",
"0.63623905",
"0.6361806",
"0.63601995",
"0.6358623",
"0.6306507",
"0.6303147",
"0.6287607",
"0.62839377",
"0.624315",
"0.623919",
"0.62361103",
"0.62316215",
"0.62265795",
"0.62127465",
"0.6207044",
"0.62054837",
"0.6202983",
"0.620168",
"0.61940914",
"0.6189723",
"0.6189528",
"0.61806446",
"0.6165536",
"0.614724",
"0.61433715",
"0.613184",
"0.61208594",
"0.61208594",
"0.6105983",
"0.60976857",
"0.60828125",
"0.608104",
"0.6075031",
"0.60735756",
"0.60664654",
"0.6054558",
"0.6054038"
] | 0.8175004 | 0 |
0 > 1, 1 > 0 2 > 3, 3 > 2 ... | def opposite n
if n%2 == 0
return n+1
else
return n-1
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def solution(a)\n if a.count >= 3\n distances = []\n last = nil\n (1...a.count - 1).each { |i|\n if a[i] > a[i - 1] and a[i] > a[i + 1]\n distances << i - last if last\n last = i\n end\n }\n puts distances.inspect\n \n (distances.count + 1).downto(1) { |flags|\n return flags if distances.all? { |d| d >= flags }\n }\n end\n 0\nend",
"def two_or_more\n -3\n end",
"def straight(ranks)\n return (ranks.max - ranks.min) == 4 && ranks.uniq.size == 5\nend",
"def given\n [6,5,3,1,8,7,2,3]\nend",
"def d(n)\n return [true, 0] if n.nil?\n return [true, 1] if n.right.nil? && n.left.nil?\n\n rb, rh = n.right ? d(n.right) : [true, 0]\n lb, lh = n.left ? d(n.left) : [true, 0]\n\n [\n rb && lb && (rh - lh).abs <= 1,\n [rh, lh].max + 1\n ]\nend",
"def one_or_more\n -2\n end",
"def _reduce_17(val, _values)\n AST::IntegerEqual.new val.first, val.last \nend",
"def ArithGeo(arr)\n return \"Arithmetic\" if (1..arr.length - 1).map {|i| arr[i] - arr[i - 1]}.uniq.size == 1\n return \"Geometric\" if (1..arr.length - 1).map {|i| arr[i] / arr[i - 1]}.uniq.size == 1\n -1\nend",
"def fator n\n\n\treturn [-1, 1] if n<0\n\treturn [0, 1] if n==0\n\treturn [1, 1] if n==1\n\treturn [2, 1] if n==2\n\treturn [n>>1,2] if ((n%2)==0)\n\n\ti, j, k = n, 0, 0\n\n\ti += j and k = (i**(0.5)).to_i and j += ((j==0)?1:2) while (i-k*k>0)\n\n\tk += (j-1)>>1;\n\tn /= k;\n\n\treturn [n,k] if n>=k\n\treturn [k,n] if n<k\n\nend",
"def minimumBribes(q)\n count = 0\n q.each_with_index do |element, index|\n return 'Too chaotic' if element-index-1>2\n start_index = index < 100 ? 0 : index-100\n\n (start_index..index-1).each do |x|\n count +=1 if q[x] > element\n end\n end \n count\nend",
"def minimumBribes(q)\n i = q.length - 1\n bribes = 0\n while i >= 0\n #if a value is in a position greater than value - or + 3 it is chaotic\n if q[i] - i > 3\n return \"Too chaotic\"\n end\n\n j = 0 > q[i] - 2 ? 0 : (q[i] - 2)\n while j < i\n if (q[j] > q[i])\n bribes += 1\n end\n j += 1\n end\n i -= 1\n end\n bribes\nend",
"def sequential(number)\r\n # number.digits.reverse.each_with_index do |num, idx|\r\n # if idx + 1 == num\r\n # return true\r\n # end\r\n # end\r\n \r\n number.digits.reverse.all? {|num| num.index + 1 == num }\r\nend",
"def solution(n)\n # write your code in Ruby 2.2\n max_gap, current_gap, one_detected = 0, 0, false\n\n bin = n.to_s(2).split(\"\")\n\n bin.each do |elem|\n one_detected = true if elem == \"1\"\n if one_detected && elem == \"0\"\n current_gap += 1\n else\n current_gap = 0\n end\n max_gap = current_gap if current_gap > max_gap\n end\n\n return max_gap\nend",
"def buddy(start, nd)\r\n start.upto(nd) do |n|\r\n potential_match = sum_divisors(n)\r\n next if potential_match < n\r\n return \"(#{n} #{potential_match})\" if sum_divisors(potential_match) == n\r\n end\r\n 'Nothing'\r\nend",
"def minimumBribes(q)\n bribe = 0\n # reverse iteration\n for i in (q.size - 1).downto(0)\n # if line configuration is not possible\n if (q[i] - (i + 1)) > 2\n puts \"Too chaotic\"\n return\n end\n # check bribes at left \n for e in ([q[i] - 2, 0].max..i)\n bribe += 1 if q[e] > q[i]\n end\n end\n\n puts bribe\nend",
"def solution(n)\n siblings = n.to_s.chars.each_slice(1).to_a\n siblings.sort {|x,y| -(x <=> y)}.join.to_i\nend",
"def minimumBribes(q)\n cont = 0\n for i in (q.size-1).downto(2)\n #p \" (#{i}) ==> #{q}\"\n if !v(q,i)\n cont = \"Too chaotic\"\n break\n elsif q[i]-1 != i\n if q[i-1]-1 == i \n aux = q[i]\n q[i] = q[i-1]\n q[i-1] = aux\n else\n aux = q[i]\n q[i] = q[i-2]\n q[i-2] = q[i-1]\n q[i-1] = aux\n cont += 1 \n end\n cont += 1 \n end\n end\n printf \"%s\\n\", q[0] != 1 && cont != \"Too chaotic\" ? cont+1 : cont\nend",
"def by_three?(n)\n return n % 3 == 0\nend",
"def probability_exact\n\t\t str_format=\"%0#{nr}b\"\n\t\t combinations=2**nr\n\t\t #p str_format\n\t\t total_w=combinations.times.map do |i|\n comb=sprintf(str_format,i)\n w_local=comb.length.times.inject(0) do |ac,j|\n sgn=comb[j]==\"0\" ? -1 : 1\n\t\t\t\t ac+(j+1)*sgn\n end\n\t\t end.sort\n\n \t\t total_w.find_all do |v| \n if @tails==:both\n v<=-w.abs or v>=w.abs\n elsif @tails==:left\n v<=w\n elsif @tails==:right\n \t\t\t\t v>=w\n end\n \t\t end.count/(combinations.to_f)\n end",
"def dutch_national_flag2(ar, index)\n i = 0\n j = ar.size - 1\n x = ar[index]\n while i < j do\n i += 1 while ar[i] <= x && i < j\n j -= 1 while ar[j] > x && j > i\n ar[i], ar[j] = ar[j], ar[i]\n end\n i = 0\n j-= 1\n while i < j do\n i += 1 while ar[i] < x && i < j\n j -= 1 while ar[j] == x && j > i\n ar[i], ar[j] = ar[j], ar[i]\n end\n ar\nend",
"def interesting_number(number)\n return false if number.to_s.split(\"\").length < 3 \n number.to_s.split(\"\").sort[0] == \"0\" ? number.to_s.split(\"\").delete_at(0) && number.to_s.split(\"\").push(\"0\") : x = x\n return number.to_s.split(\"\")[0] < number.to_s.split(\"\")[-1] ? number.to_s.split(\"\").sort == number.to_s.split(\"\") || false : number.to_s.split(\"\").sort.reverse == number.to_s.split(\"\") || false\nend",
"def Threesum(arr)\n target = arr.first\n arr.combination(3).to_a.any? {|comb| comb.reduce(0 , :+) == target}\nend",
"def o_gen_rating(numbers, idx)\n return numbers.first if numbers.size == 1\n\n zeroes = []\n ones = []\n numbers.each { |num| num[idx] == \"0\" ? zeroes.push(num) : ones.push(num) }\n next_nums = zeroes.size <= ones.size ? numbers - zeroes : numbers - ones\n o_gen_rating(next_nums, idx + 1)\nend",
"def >=(p0) end",
"def >=(p0) end",
"def >=(p0) end",
"def missing_term(terms)\n # 1\n s = Hash.new(0)\n s[terms[1] - terms[0]] += 1\n s[terms[2] - terms[1]] += 1\n s[terms[3] - terms[2]] += 1\n\n # 2\n value = s.select { |_, v| v >= 1 }.keys[0]\n\n # 3\n terms.each_with_index do |term, index|\n return term+value if term+value != terms[index+1]\n end\n\n false\nend",
"def abundants_less_than( n )\r\n\tabundants = []\r\n\t(12..n).each do |i|\r\n\t\tabundants << i if Math.proper_factors(i).inject(:+) > i\r\n\tend\r\n\tabundants\r\nend",
"def positive_dominant(arr)\n #Your code here\n arr_uniq = arr.uniq\n pos_arr = []\n neg_arr = []\n arr_uniq.map do |x|\n if x > 0\n pos_arr.push(x)\n else\n neg_arr.push(x)\n end\n end\n\n if pos_arr.length > neg_arr.length\n return true\n else\n return false\n end\n\nend",
"def lucas_numbers(n)\n comparison = [2,1]\n if n > 1\n (n - 1).times do\n new = comparison.inject(:+)\n comparison = [comparison.last, new]\n end\n return comparison.last\n elsif n < 0\n n.abs.times do\n new = comparison.pop - comparison.first\n comparison.unshift(new)\n end\n return comparison.first\n else\n return comparison[n]\n end\nend",
"def lcs_phase_two(arr)\n return arr.max if arr.max < 0 #edge case\n\n current = 0\n largest = 0\n\n arr.each do |ele|\n current += ele\n current = 0 if current < 0 #bookmark\n largest = current if largest < current\n end\n\n largest\nend",
"def >\n a = pop\n b = pop\n push b > a ? -1 : 0\n end",
"def low_two_of_a_kind\n values.reverse.each do |i|\n if values.reverse.count(i) == 2\n return i\n end\n end\n return false\n end",
"def fences(data)\n return lower_bound(data)..upper_bound(data)\n end",
"def test\n\t\t@a+@b > @c && @a+@c > @b && @b+@c > @a\n\tend",
"def values\n{\n :A => 1, :B => 3, :C => 3, :D => 2,\n :E => 1, :F => 4, :G => 2, :H => 4,\n :I => 1, :J => 8, :K => 5, :L => 1,\n :M => 3, :N => 1, :O => 1, :P => 3,\n :Q => 10, :R => 1, :S => 1, :T => 1,\n :U => 1, :V => 4, :W => 4, :X => 8,\n :Y => 4, :Z => 10\n}\nend",
"def scale_balancing(arr)\n light, heavy = arr.first.scan(/\\d+/).map(&:to_i).sort\n weights = arr.last.scan(/\\d+/).map(&:to_i)\n weights.each_with_index do |weight, idx|\n if light + weight == heavy\n return weight.to_s\n elsif light + weight < heavy\n break if idx == weights.size - 1\n remaining = weights[0...idx] + weights[(idx + 1)..-1]\n remaining.each_with_index do |weight2, idx2|\n if light + weight + weight2 == heavy\n if idx <= idx2\n return [weight, weight2].join(',')\n else\n return [weight2, weight].join(',')\n end\n end\n end\n elsif light + weight > heavy\n break if idx == weights.size - 1\n remaining = weights[0...idx] + weights[(idx + 1)..-1]\n remaining.each_with_index do |weight2, idx2|\n if light + weight == heavy + weight2\n if idx <= idx2\n return [weight, weight2].join(',')\n else\n return [weight2, weight].join(',')\n end\n end\n end\n end\n end\n 'not possible'\nend",
"def my_min_phase_2(list)\n min = list[0]\n (1...list.length).each do |i|\n min = list[i] if list[i] < min\n end\n min\nend",
"def cracklepop3\n (1..100).zip(Array.new 100, nil).map do |i,x|\n [i%3, i%5].map.with_index do |y, j| \n x = x.to_s + ['crackle','pop'][j] if y==0\n end\n x ? x : i\n end\nend",
"def maxseq_indexes(*args)\n # total now means \"total value, where they start, where they finish\"\n total = start = finish = 0\n # current too\n current = curr_start = curr_finish =0\n args.each_with_index do |el,idx|\n if current+el >= 0\n current+=el\n curr_finish = idx\n else\n current = 0\n curr_start = idx+1\n end\n if current >= total\n total = current\n start = curr_start\n finish = curr_finish\n end\n end\n total.zero? ? [] : args[start..finish] \nend",
"def iq_test(numbers)\n x = numbers.split.map(&:to_i).map(&:even?)\n x.count(true) > 1 ? x.index(false) : x.index(true)\nend",
"def thousand_switches(integer)\n array = Array.new(integer, false)\n 1.upto(integer) do |n|\n array.map!.with_index do |element, index| \n if (index + 1) % n == 0\n !element\n else\n element\n end\n end\n end\n output = []\n array.each_with_index {|element, index| output << (index + 1) if element == true }\n output\nend",
"def rain(input)\n i = 1\n tally = 0\n left = 0\n rights = input.reverse.reduce([]) { |acc, x| acc.push([x, acc.last || 0].max) }.reverse\n while i < input.length - 1\n item = input[i]\n right = rights[i]\n cutoff = [left, right].min\n left = item if left < item\n diff = cutoff - item\n tally += diff if diff > 0\n i += 1\n end\n tally\nend",
"def run_enum\n arr = (0..10).to_a\n find(arr) { |el| el > 1 }\n find(arr) { |el| el < 1 }\n # find(arr) { |el| el > 1 }\n end",
"def <=(p0) end",
"def solution(a)\n # write your code in Ruby 2.2\n binding.pry\n trips = Hash.new {|h,k| h[k]=0}\n start = 0\n ending = 0\n min = nil\n a.each_with_index do |trip,i|\n ending = i\n\n if trips[trip] == 0\n min = ending - start\n end\n trips[trip] += 1\n\n while start < ending\n break if trips[a[start]] - 1 == 0\n trips[start] -= 1\n start += 1\n min = ending - start if ending-start < min\n end\n end\n min\nend",
"def pairs_to_zero(nums)\n # Write your code here\n c = []\n a = nums.select { |n| c.push(n) if n < 0 }\n nums.delete_if { |n| c.push(n) if n < 0 }\n i = 0 \n pairs = 0\n a = a.map { |n| n*-1 }\n loop do \n if nums.count(a[i]) > 0\n pairs += 1\n end\n i += 1\n break if i == a.length\n end\n return pairs\nend",
"def vampire_test(a,b)\n if a <= 0 and b <= 0\n false\n elsif \n \n else\n arr = (a*b).to_s.chars.map(&:to_i)\n [arr.include?(a), arr.include?(b), (arr.last != 0)].include?(false)\n end\nend",
"def solve(a0, a1, a2, b0, b1, b2)\n relative_score = [\n a0 > b0 ? 1 : (b0 > a0 ? -1 : 0),\n a1 > b1 ? 1 : (b1 > a1 ? -1 : 0),\n a2 > b2 ? 1 : (b2 > a2 ? -1 : 0),\n ]\n [relative_score.select{|x| x == 1}.count, relative_score.select{|x| x == -1}.count]\nend",
"def pickingNumbers(a)\n my_h = Hash.new(0)\n a.each do |elem|\n my_h[elem] = a.select {|x| (elem-x).abs < 2}\n end\n my_h.max_by {|i,v| v.size}[1].size - 1\nend",
"def ject(ary)\nr = [ary]\nw = []\n\nr.flatten.each do |y| \n\tif y == 0\n\t\tw << 0\n\telse\n\t\t3.times {|idx| w << ( y / (idx + 2) )}\n\tend\nend\nw\nend",
"def repeated_number_ranges(arr)\n\n\nend",
"def solution(a)\r\n # write your code in Ruby 2.2\r\n #trangular\r\n # a[0] = 10\r\n # a[2] = 5\r\n # a[4] = 8\r\n # 10 + 5 > 8\r\n # 5 + 8 > 10\r\n #8 + 10 > 5\r\n \r\n \r\n l=a.count\r\n \r\n i=0\r\n while(i<l) do\r\n j=i+1\r\n while(j<l) do\r\n k=j+1\r\n \r\n \r\n while(k<l) do\r\n if((a[i] + a[j] > a[k]) && (a[j] +a[k] > a[i]) && (a[k] + a[i] >a[j]))\r\n return 1\r\n end\r\n k+=1 \r\n end \r\n \r\n j+=1 \r\n end\r\n i+=1\r\n end\r\n \r\n return 0\r\n \r\nend",
"def nchooser(n, r)\n\n (1..n).reduce(:*) / ( (1..r).reduce(:*) * (1..(n-r)).reduce(:*) )\n\nend",
"def plusMinus(arr)\n posCount = 0\n negCount = 0\n\n arr.each do |e|\n if e < 0\n negCount += 1\n elsif e > 0\n posCount += 1\n end\n end\n\n len = arr.length*1.0\n posProp = posCount/(len)\n negProp = negCount/(len)\n zeroProp = 1 - posProp - negProp\n\n puts posProp\n puts negProp\n puts zeroProp\nend",
"def get_number_of_1s(number)\n if number < 0\n sign = -1\n number = number * -1\n end\n count = 0\n while (number>0)\n number = (number & number-1)\n count += 1\n end\n count\nend",
"def neaten_numbers(nums)\n nums.sort!\n str = nil\n range = nil\n nums.each_index do |index|\n if nums[index+1] == nums[index]+1\n range = nums[index] unless range\n else\n if range\n if str\n str = \"#{str}, #{range}-#{nums[index]}\"\n else\n str = \"#{range}-#{nums[index]}\"\n end\n range = nil\n else\n if str\n str = \"#{str}, #{nums[index]}\"\n else\n str = \"#{nums[index]}\"\n end\n end\n end\n end\n return str\n end",
"def _reduce_36(val, _values, result)\n result = logop(:and, val[0], val[2])\n \n result\nend",
"def minimumBribes(q)\n sum = 0\n q.each_with_index do |v,i|\n if v-(1+i) > 2\n puts \"Too chaotic\"\n return\n end\n bound = [v-2,0].max\n (bound..i-1).each do |j|\n sum+=1 if q[j] > v\n end\n end\n puts sum\nend",
"def valid?(side1, side2, side3)\n return false if (side1 <= 0) || (side2 <= 0) || (side3 <= 0)\n tmp = [side1, side2, side3]\n tmp.sort!\n tmp[0..1].sum > tmp[-1]\nend",
"def solution(a)\n s= a.sort\n 0.step(s.size - 1).inject(0) do |result, x|\n z= x+2\n (x+1).step(s.size - 1).inject(result) do |acc, y|\n z+=1 while z < s.size && s[x] + s[y] > s[z]\n acc += z-y-1\n end\n end\nend",
"def factorize(n)\n factorize_greater_than(1, n).flatten.sort\nend",
"def high_and_low(numbers)\n arr = numbers.split.map(&:to_i).sort\n arr.size > 1 ? \"#{arr.pop} #{arr.shift}\" : \"#{arr[0]} #{arr[0]}\"\nend",
"def temp(temp1, temp2)\n return ( temp1 < 0 && temp2 > 100 ) || ( temp1 > 100 && temp2 < 0 );\nend",
"def get_to(options={})\n options = {\n :goal => 100,\n :digits => '123456789',\n :ops => %w[- - +],\n :verbose => false,\n :return_counts => false\n } .merge(options)\n digits= options[:digits]\n goal, digits, ops, verbose, return_counts = *options.values_at(:goal, :digits, :ops, :verbose, :return_counts)\n operators = Permutation.for(ops).map{|perm| perm.project}.uniq\n puts \"Looking for #{goal}, digits=#{digits}, operators=#{ops.inspect}\"\n counts = Hash.new(0)\n found_in_a_row = 0\n digits.each_partition(ops.size + 1) do |numbers|\n operators.each do |ops|\n op_index = -1\n eqn = numbers.zip(ops).flatten.compact.join(' ')\n val = eval(eqn)\n counts[val] += 1 if return_counts\n found = val == goal\n puts \"********************************\" if found_in_a_row == 0 && found\n puts \"********************************\" unless found_in_a_row == 0 || found\n puts \"#{eqn} = #{val}\" if verbose || goal == val\n found_in_a_row = found ? found_in_a_row + 1 : 0\n end\n end\n return_counts ? counts.select {|key,value| value > 1} : nil\nend",
"def solution3(a)\n freq = {}\n a.each do |num|\n num = num.abs\n freq[num] ? next : freq[num] = 1\n end\n freq.size\nend",
"def collisions(arr)\n new_arr = []\n result = []\n arr.each do |i|\n if i > 0\n new_arr << i\n else\n if new_arr.empty?\n result << i\n else\n if new_arr[-1] == -(i)\n new_arr.pop\n else\n while !new_arr.empty? && new_arr[-1] < -(i)\n new_arr.pop\n end\n if new_arr.empty?\n result << i\n end\n end\n end\n end\n end\n return (result.concat(new_arr))\nend",
"def variant_for_poisson(seq)\n seq_size = seq.size\n l = seq[0].size - 1\n var = []\n (0..l).to_a.each do |pos|\n nt = []\n seq.each do |s|\n nt << s[pos]\n end\n count_nt = count(nt)\n v = seq_size - count_nt.values.max\n var << v\n end\n var_count = count(var)\n var_count.sort_by{|key,value|key}.to_h\nend",
"def req_num_case1(n1)\n case \n when 0 .. 50\n \"#{n1} is between 0 and 50\"\n when 51 .. 100\n \"#{n1} is between 51 and 100\"\n else\n \"#{n1} is above 100\"\n end\nend",
"def solution(a)\n return 0 if a.length < 3\n a.sort.each_cons(3) { |e| return 1 if e[0] + e[1] > e[2] }\n return 0\nend",
"def solution(a)\n return 0 if a.count < 3\n \n a.sort!\n for i in (2...a.count)\n x = a[i - 2]\n y = a[i - 1]\n z = a[i]\n \n return 1 if x + y > z && x + z > y && z + y > x\n end\n \n return 0\nend",
"def low_missing(input)\n i = 0\n while i < input.length\n item = input[i]\n next i += 1 if input[item] == input[i]\n next i += 1 if item < 0 || item > input.length - 1\n input[i], input[item] = input[item], input[i]\n end\n out = 1\n out += 1 while out == input[out]\n out\nend",
"def key_for_min_value(hash)\n if hash.count < 2\n return hash[0]\n else \n num = 42\n hash.each do |key, value|\n if value <= num\n num = value\n end\n end\n hash.invert[num] \n end\nend",
"def methods_ascending es\n (1..Float::INFINITY).lazy\n .map {|n| methods_ascending_last_n(es,n).count }\n .take_while {|e| e > 0 }\n .force\nend",
"def got_three? (array)\n arr=[]\n(1..array.length-2).each{|x| arr.push(true) if array[x-1]== array[x] && array[x+1]== array[x] }\narr.include?(true)\nend",
"def is_zero_balanced(array)\n return false if array.reduce(:+) != 0\n return true if array.uniq.first == 0\n positives = array.select do |n|\n n > 0\n end\n positives.each do |n|\n # array.include? (-n) ? return true : return false\n if array.include? -n\n return true\n else\n return false\n end\n end\nend",
"def sequential(set)\n set.enum_for(:each_with_index).map do |n, i|\n index = [i - 1, 0].max\n n - set[index]\n end\n end",
"def filter_by_factor_of(enum, x)\n x -= 1\n result = []\n result << enum.first\n current = 1\n while current < x do\n current += 1\n result << enum[enum.length / x * current]\n end \n result << enum.last\n result\n end",
"def make_hundred\n arr = [\"+\", \"-\", \"\"].repeated_permutation(8).to_a.map do |operators|\n ((1..9).to_a).zip(operators).flatten.compact\n end.map(&:join).select {|x| eval(x) == 100}\nend",
"def count_up(number)\n if number < 0\n (number..1).to_a\n else\n (1..number).to_a\n end\nend",
"def test\n\t\tvar = if @a >= @b+@c or @b >= @a+@c or @c >= @b+@a then 5\n\t\telsif @a == @b and @a == @c then var = 1\n\t\telsif @a**2 == @b**2 + @c**2 or @b**2 == @a**2 + @c**2 or\n\t\t\t@c**2 == @b**2 + @a**2 then var = 4\n\t\telsif @a == @b or @a == @c or @b == @c then var = 2\n\t\telse var = 3\n\t\tend\n\n\t\treturn var\n\tend",
"def stepper(nums)\n table = Array.new(nums.length).fill(false)\n table[0]= true;\n\n table.each_with_index do |entry, idx|\n if entry == true\n maxRange = nums[idx]\n (1..maxRange).each do |step|\n if step < table.length\n table[step] = true\n end\n end\n end\n end\n table.last\nend",
"def grader(score)\n case score\n when 0.6...0.7 then \"D\"\n when 0.7...0.8 then \"C\"\n when 0.8...0.9 then \"B\"\n when 0.9..1 then \"A\"\n else \"F\"\n end\nend",
"def got_three?(array)\n returned = false\n array.each_cons(3) { |new|\n if new.max == new.min \n returned = true\n end\n }\nreturned\nend",
"def minoffour(num1, num2, num3, num4)\n if num1 < num2 and num1 < num3 and num1 < num4\n return num1\n end\n if num2 < num1 and num2 < num3 and num2 < num4\n return num2\n end\n if num3 < num1 and num3 < num2 and num3 < num4\n return num3\n end\n if num4 < num1 and num4 < num2 and num4 < num3\n return num4\n end\nend",
"def key_for_min_value(name_hash)\n number = 0\n storage = nil\n name_hash.each do |key, value|\n if number == 0 || value < number\n storage = key\n number = value\nend\nend\nstorage\nend",
"def sort_vector(ary)\n\tneg,pos = [],[]\n\tary.each do |val|\n\t\tif val >= 0\n\t\t\tpos << val\n\t\telse\n\t\t\tneg << val\n\t\tend\n\tend\n\t#sorts min -> max\n\tpos.sort!\n\tneg.sort!\n\treturn pos,neg\nend",
"def abundant_below(num)\n (12...(num/2 +1)).select{|n| abundant_number?(n)}\nend",
"def ordinals(numbers)\n# ordinals = []\n# numbers.map do |number|\n# if number = 1\n# number.to_s + 'st'\n# elsif number = 2\n# number.to_s + 'nd'\n# elsif number = 3\n# number.to_s + 'rd'\n# elsif\n# number.to_s + 'th'\n# end\n# end\nend",
"def |\n a = pop\n b = pop\n push (a == -1) || (b == -1) ? -1 : 0\n end",
"def zero_or_more\n -1\n end",
"def index_greater_than(arr)\n final = []\n arr.each_with_index {|element, index| final << element * index if index > element }\n final\nend",
"def comb_select()\r\n\tmin_runner = 10\r\n\tmax_runner = 100\r\n\tgreater_than = 1000000\r\n\tcounter = 0\r\n\t\r\n\tfor runner in (min_runner..max_runner)\r\n\t\trun_f = factorial(runner)\r\n\t\tmin_select = (runner/4).to_i\r\n\t\tfor selection in (2..runner-1)\r\n\t\t\tdivider = factorial(selection) * factorial(runner - selection)\r\n\t\t\tcounter += 1 if run_f / divider > greater_than\r\n\t\tend\r\n\tend\r\n\treturn counter\r\nend",
"def probability_n_of_a_kind(minimum_count, actual_count)\n debug = false\n gap = [(minimum_count - actual_count), 0].max # number of dice needed for minimum\n puts \"minimum count: #{minimum_count}, actual count: #{actual_count}, gap: #{gap}\" if debug\n if gap == 0 \n useful_results = 1\n reroll_count = 0\n else\n case [minimum_count, gap]\n when [3, 1] # need 1 of 3 to match\n # sequences with 1 of 3 dice: --*, -*-, *--\n # sequences with 2 of 3 dice: -**, *-*, **-\n # sequences with 3 of 3 dice: *** \n useful_results = (3*5*5)+(3*5)+1 \n when [3, 2] # need 2 of 4 to match\n # sequences with 2 of 4 dice: --**, -*-*, -**-, *--*, *-*-, **--\n # sequences with 3 of 4 dice: -***, *-**, ***-\n # sequences with 4 of 4 dice: ****\n useful_results = (6*5*5)+(4*5)+1\n when [3, 3] # need 3 of 5 to match\n # sequences with 3 of 5: --***, -**-*, -***-, *--**, *-*-*, *-**-, **--*, **-*-, ***--\n # sequences with 4 of 5: -****, *-***, ***-*, ****-\n # sequences with 5 of 5: ***** \n useful_results = (9*5*5)+(4*5)+1\n when [4, 1] # need 1 of 2 to match\n # sequences with 1 of 2 dice: -*, *-\n # sequences with 2 of 2 dice: **\n useful_results = (2*5)+1 \n when [4, 2] # need 2 of 3 to match\n # sequences with 2 of 3: -**, *-*, **-\n # sequences with 3 of 3: ***\n useful_results = (4*5)+1\n when [4, 3] # need 3 of 4 dice to match\n # sequences with 3 of 4 dice: -***, *-**, ***-\n # sequences with 4 of 4 dice: ****\n useful_results = (3*5)+1\n when [4, 4] # need 4 of 5 dice to match\n # sequences with 4 of 5: -****, *-***, ***-*, ****-\n # sequences with 5 of 5: ***** \n useful_results = (4*5)+1 \n else\n raise \"pair [#{minimum_count}, #{gap}] not expected\"\n end\n reroll_count = 5 - actual_count\n end\n puts \"useful results: #{useful_results}, reroll count: #{reroll_count}\" if debug\n p = calculate_probability(useful_results, reroll_count)\n return p\n end",
"def pair_zeros(arr)\n arr.select.each_with_index do |num, idx|\n num != 0 || (num == 0 && count(arr, num, idx) % 2 == 1)\n end\nend",
"def many_results(n)\r\n\treturn 1, n /2, n\r\nend",
"def most_specific_subdivision; end",
"def cantor_pairing(n, m)\n (n + m) * (n + m + 1) / 2 + m\nend",
"def matching_rules(number, rules)\n result = []\n rules.each do |rule, ranges|\n ranges.each do |range|\n next if number < range[0] || number > range[1]\n\n result.append(rule)\n break\n end\n end\n result\nend",
"def x_all_but_self(a)\n zero_qty = a.count(0)\n return products = Array.new(a.size,0) if zero_qty > 1\n total_x = 1\n products = []\n a.each { |e| total_x *= e if e != 0}\n if zero_qty == 1\n a.each { |e| products << (e != 0 ? 0 : total_x) }\n else\n a.each { |e| products << total_x / e}\n end\n return products\nend",
"def initialize_variations(a, b)\n [0] * ([a.max, b.max].max+1)\nend"
] | [
"0.59299797",
"0.592578",
"0.58229417",
"0.578304",
"0.5769303",
"0.57264405",
"0.572091",
"0.5707745",
"0.5699283",
"0.5682707",
"0.566053",
"0.5631282",
"0.563103",
"0.56309247",
"0.56306064",
"0.56291914",
"0.55934346",
"0.5591577",
"0.55827373",
"0.55789196",
"0.55756795",
"0.5575136",
"0.55709344",
"0.5569685",
"0.5569685",
"0.5569685",
"0.5560746",
"0.55598754",
"0.55575633",
"0.5538762",
"0.5537449",
"0.5535716",
"0.5524689",
"0.5517016",
"0.548608",
"0.54834497",
"0.54754025",
"0.54657686",
"0.5463555",
"0.5458744",
"0.54417515",
"0.5438974",
"0.5425046",
"0.54224634",
"0.5422153",
"0.54060674",
"0.5391102",
"0.5388675",
"0.5386546",
"0.5380939",
"0.5376083",
"0.53707856",
"0.53691226",
"0.5366261",
"0.5361919",
"0.5360257",
"0.53595316",
"0.5353794",
"0.5351291",
"0.53503364",
"0.53431654",
"0.5340728",
"0.5339213",
"0.53365785",
"0.53250796",
"0.5322036",
"0.5315305",
"0.5315254",
"0.5314482",
"0.5307784",
"0.52835643",
"0.52830637",
"0.5280923",
"0.52783245",
"0.527699",
"0.52741504",
"0.527168",
"0.52679664",
"0.5266142",
"0.52652836",
"0.5264556",
"0.5261032",
"0.52603084",
"0.5259146",
"0.52589",
"0.5258069",
"0.52529615",
"0.52490115",
"0.524713",
"0.5246903",
"0.52455145",
"0.52451855",
"0.52418244",
"0.5241445",
"0.5241416",
"0.5241371",
"0.52396053",
"0.5235992",
"0.52341944",
"0.52340674",
"0.5227546"
] | 0.0 | -1 |
This method creates a new outgoing message. | def initialize(from, to, provider, message)
@from = from
@to = to
@provider = provider
@message = message
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_outgoing_message(phone_number, body, message_id = nil, outgoing_count = nil)\n if phone_number.can_receive_email? && allow_email_gateway? &&\n (! allow_commercial_gateway? || prefer_email? )\n to = \"#{phone_number.number}@#{phone_number.provider_email}\"\n from = \"#{name}@mmptext.info\"\n elsif allow_commercial_gateway? && phone_number.can_receive_gateway? && incoming_phone_number.present?\n to = phone_number.number\n from = incoming_phone_number.phone_number\n else\n raise \"List & subscriber settings make sending message impossible for number #{phone_number.number} [list: #{name}].\"\n end\n\n Resque.enqueue(OutgoingMessageJob, id, to, from, body, message_id, outgoing_count)\n end",
"def newMessage\n message = Message.last\n\n MagicMailer.newMessage(message)\n end",
"def new_message(from, to, subject, message)\r\n rec = to.clone\r\n subs = to.concat([from])\r\n conv = Conversation.create(subs)\r\n time = Time.new\r\n message = Message.create(from, rec, subject, time, message, nil)\r\n\r\n subs.each{ |s| self.message_boxes[s.to_s].add_conversation(conv)}\r\n conv.add_message(message)\r\n\r\n self.conversations.store(conv.conversation_id.to_s, conv)\r\n conv\r\n end",
"def reply\n message = self.class.new(:subject => subject, :body => body)\n message.sender = sender\n message.to(to)\n message\n end",
"def create_message(options = {})\n post(\"inbox/messages\", messages: [options]).pop\n end",
"def create_message(data); end",
"def create_message(data); end",
"def reply\n message = self.message.class.new(:subject => subject, :body => body)\n message.sender = receiver\n message.to(sender)\n message\n end",
"def newMessage\n @message = Message.new\n end",
"def new_message(msg,opts={})\n opts = default_opts.merge(opts)\n msg_uri = RDF::URI.new(\"http://cogi.strinz.me/messages/#{opts[:id]}\")\n mem = repo\n rdf_msg = Cogibara::Message.for(msg_uri)\n\n mem.insert([msg_uri, RDF.type, onto_class.Message])\n rdf_msg.message = msg\n rdf_msg.message_id = opts[:id] if opts[:id]\n # mem.insert([msg_uri, onto_prop.message_string, msg])\n # mem.insert([msg_uri, onto_prop.message_id, opts[:id]]) if opts[:id]\n\n if opts[:to]\n u_to = Cogibara::User.new(opts[:to])\n u_to.received_messages << rdf_msg.subject\n rdf_msg.to = u_to.subject\n u_to.save\n # mem.insert([msg_uri, onto_prop.to_user, opts[:to]]) if opts[:to]\n end\n\n if opts[:from]\n u_from = Cogibara::User.new(opts[:from])\n u_from.sent_messages << rdf_msg.subject\n rdf_msg.from = u_from.subject\n u_from.save\n # mem.insert([msg_uri, onto_prop.from_user, opts[:from]])\n end\n\n rdf_msg.save\n\n rdf_msg\n end",
"def create\n message = msg_params\n @msg = Msg.new(msg_params)\n thesender = @msg.sender\n thesentdate = @msg.sent\n theservertime = DateTime.now\n unless @msg.content.empty? || @msg.sender.empty?\n ActionCable.server.broadcast 'room_channel',\n content: @msg.content,\n sender: thesender,\n servertime: theservertime\n end\n end",
"def new\n @direct_message = DirectMessage.new\n end",
"def create\n create_message(params)\n end",
"def create_message(user_id, recipient_id, token , subject, message)\n response = self.class.post('/messages', body: { \"user_id\": user_id, \"recipient_id\": recipient_id,\"token\": token , \"subject\": subject, \"stripped-text\": message }, headers: { \"authorization\" => @auth_token })\n puts response\n\n end",
"def create\n @message = Message.new(params[:message])\n if @message.save\n MessageMailer.notify_private_message_sent(@message.sender, @message.receiver).deliver\n puts \"FOI\"\n end\n respond_with(@message)\n end",
"def create\n @message_out = MessageOut.new(message_out_params)\n\n respond_to do |format|\n if @message_out.save\n format.html { redirect_to @message_out, notice: 'Message out was successfully created.' }\n format.json { render :show, status: :created, location: @message_out }\n else\n format.html { render :new }\n format.json { render json: @message_out.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @to = User.find(params[:message][:to])\n current_user.send_message(@to, params[:message][:topic], params[:message][:body])\n redirect_to outbox_url\n end",
"def create\n body = message_params[:Body]\n phone_number = message_params[:From]\n @message = Message.create(body: body, phone_number: phone_number)\n @message.reply_to_user\n head :ok\n end",
"def new\n @message = Message.new\n end",
"def new\n @message = Message.new\n end",
"def new\n @message = Message.new\n end",
"def new\n @message = Message.new\n end",
"def new\n @message = Message.new\n end",
"def new\n @message = Message.new\n end",
"def new\n @message = Message.new\n end",
"def new\n @message = Message.new\n end",
"def forward\n message = self.message.class.new(:subject => subject, :body => body)\n message.sender = receiver\n message\n end",
"def message_create(originator, recipients, body, params={})\n # Convert an array of recipients to a comma-separated string.\n recipients = recipients.join(',') if recipients.kind_of?(Array)\n\n Message.new(request(\n :post,\n 'messages',\n params.merge({\n :originator => originator.to_s,\n :body => body.to_s,\n :recipients => recipients })))\n end",
"def message_create(originator, recipients, body, params = {})\n # Convert an array of recipients to a comma-separated string.\n recipients = recipients.join(',') if recipients.is_a?(Array)\n\n Message.new(request(\n :post,\n 'messages',\n params.merge(originator: originator.to_s,\n body: body.to_s,\n recipients: recipients)\n ))\n end",
"def new\n \t@message = Message.new\n end",
"def create\n to = params[:to]\n\n unless to\n raise IOError, \"Incorrect params for sending text message\" \n end\n\n @client = Twilio::REST::Client.new(\n CONFIG[:twilio_account_sid],\n CONFIG[:twilio_auth_token])\n\n @account = @client.account\n @message = @account.sms.messages.create({\n :from => CONFIG[:twilio_phone_number],\n :to => to,\n :body => \"Happy Mining! #{CONFIG[:ios_app_link]}\"}) \n\n rescue => ex\n handle_exception(ex)\n ensure\n respond_to do |format|\n format.json\n end\n end",
"def forward\n message = self.class.new(:subject => subject, :body => body)\n message.sender = sender\n message\n end",
"def create\n logger.debug(\"Entering Message create\" )\n @message = Message.new(params[:message])\n @message.read = false\n respond_to do |format|\n if @message.save\n flash[:notice] = 'Message was successfully sent.'\n format.html { redirect_to :controller => \"users\", :action => \"show\", :id => current_user.id }\n format.xml { render :xml => @message, :status => :created, :location => @message }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @message.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @message = Message.new params[:message]\n @message.save\n respond_with @message, location: after_send_path, notice: t('hyalin.messages.sent_success')\n end",
"def create\n values = params[:message]\n \n raise BadRequestError.new('Identity and recipient_id do not match.') if !params[:identity_id].nil? && params[:identity_id] != params[:message][:recipient_id]\n \n sender = Identity.find_by_id_identifier_or_nickname(params[:message][:sender_id], :find_deleted => true) unless params[:message][:sender_id].nil?\n recipient = Identity.find_by_id_identifier_or_nickname(params[:identity_id] || params[:message][:recipient_id], :find_deleted => true)\n \n raise NotFoundError.new('Recipient #{params[:message][:recipient_id]} unknown.') if recipient.nil?\n \n values[:recipient_id] = recipient.id\n values[:sender_id] = sender.nil? ? nil : sender.id\n \n @message = Message.new(values)\n \n logger.warn \"IDENTIFIER: #{params[:identity_id] || params[:message][:recipient_id]} VALUES: #{values.inspect}, #{params.inspect}\"\n\n respond_to do |format|\n if @message.save\n format.html { redirect_to @message, notice: 'Message was successfully created.' }\n format.json { render json: @message, status: :created, location: @message }\n @message.send_via_email\n else\n format.html { render action: \"new\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @message = Message.new(params[:message])\n if params[:recipient_ids]\n recipients = User.find(params[:recipient_ids])\n for rec in recipients\n @message.recipients << MessageRecipient.new({:user_id => rec.id, :message_id => @message.id, :read => :false, :parent_id => current_user.id})\n end\n end\n\n respond_to do |format|\n if current_user.messages << @message\n if params[:sendmethod] == \"Instant\"\n if @message.send_message!\n flash[:notice] = \"Successfully sent...\"\n format.html { redirect_to sent_account_messages_url }\n else\n flash[:error] = \"An error has been raised...\"\n end\n else\n flash[:notice] = 'Message was successfully created.'\n format.html { redirect_to outbox_account_messages_url }\n end\n \n \n format.xml { render :xml => @message, :status => :created, :location => @message }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @message.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def write_message\n\t\t# sender will be the current user\n\t\t@user = current_user\n\t\t@message = Message.new\n\t\t@message.sender = current_user\n\t\t@unread_messages = Message.find(:all, :conditions => {:receiver_id => current_user.id, :unread => true})\n\t\t# if reciever has been specified, automatically use his/her name in the \"To:\" box\n\t\tif params[:receiver]\n\t\t\t@message.receiver = User.find_by_login(params[:receiver])\n\t\tend\n end",
"def new\n @message = Message.new\n respond_with @message\n end",
"def create\n @message = Message.new(message_params)\n create_q(@message)\n end",
"def create\n @outmessage = Outmessage.new\n @outmessage.destination = params[:outmessage][:destination]\n @outmessage.message = params[:outmessage][:message]\n @outmessage.user = User.find_by_username(session[:user_id].username)\n\n if @outmessage.save\n if (params[:ajax_request])\n render :layout => false\n end\n notify_push_user(@outmessage)\n end\n end",
"def create_message\n @message = Message.new(params[:message])\n @message.sended_at = Time.now.to_f\n respond_to do |format|\n if @message.save\n format.html { redirect_to(\"/chat/update/#{@message.user.id}\") }\n format.xml { render :xml => @message, :status => :created, :location => @message }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @message.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @message = Message.new(message_params)\n if @message.save\n @message.action = 'SEND'\n @message.save\n\n # Send SMS text\n boot_twilio\n sms = @client.messages.create(\n body: @message.text,\n from: Rails.application.secrets.twilio_number,\n to: @message.number,\n )\n redirect_to @message, alert: \"SMS Text sent.\"\n else\n render 'new'\n end\n end",
"def create\n @message = current_owner.messages_as_sender.new(message_params)\n respond_to do |format|\n if @message.save\n format.html { redirect_to messages_path, notice: 'Message was successfully created.' }\n format.json { render :show, status: :created, location: @message }\n else\n format.html { render :new }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @message = Message.new(message_params.merge(read: false))\n\n if @message.sender == @message.message_thread.seller\n @message.receiver = @message.message_thread.buyer\n else\n @message.receiver = @message.message_thread.seller\n end\n\n respond_to do |format|\n if @message.save\n MessageBroadcastController.publish('/messages', @message.detailed_attributes)\n format.json { render json: @message.attributes, status: :created }\n else\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def msg(target, message)\n buffer_output Net::YAIL::OutgoingEvent.new(:type => :msg, :target => target, :message => message)\n end",
"def new_message(params = {})\n response = post('secret_mails/new.json', params)\n Croudia::Object::SecretMail.new(response)\n end",
"def create\n message = Message.new(message_params)\n message.user = current_user\n if message.save\n # 'messages' is name of channel we are broadcasting to\n ActionCable.server.broadcast 'messages',\n # Set message and user\n message: message.content,\n user: message.user.first_name\n head :ok\n end\n end",
"def create\n directmessage = DirectMessage.new(permitted_params)\n conversation = Conversation.find(permitted_params[:conversation_id])\n if directmessage.save\n serialized_data = ActiveModelSerializers::Adapter::Json.new(\n DirectMessageSerializer.new(directmessage)\n ).serializable_hash\n DirectMessagesChannel.broadcast_to conversation, serialized_data\n head :ok\n end\n end",
"def create\n msg = Message.new(message_params)\n msg.user_id = current_user.id\n msg.status = 'closed' if params[:close_tkt]\n respond_to do |format|\n if msg.save\n parent_msg = Message.where(id: msg.message_id).first if msg.message_id\n @message = parent_msg ? parent_msg : msg\n parent_msg ? MessageMailer.new_reply(parent_msg, msg).deliver : MessageMailer.new_message(msg).deliver\n format.html { redirect_to @message, notice: 'Message was successfully created.' }\n format.json { render :show, status: :created, location: @message }\n else\n parent_msg = Message.where(id: msg.message_id).first if msg.message_id\n @message = parent_msg ? parent_msg : msg\n format.html { render :new }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @message = Message.new(message_param)\n @message_thread = MessageThread.find(@message.message_thread_id)\n\n @message.receiver = current_user.equal_user?(@message_thread.started_user) ? @message_thread.to_user : @message_thread.started_user\n @message.sender = current_user\n @message.is_sender_read = true\n @message.is_receiver_read = false\n\n if @message.save\n flash[:success] = \"Message has been sent!\"\n redirect_to @message_thread\n end\n end",
"def create\n user = User.find_by(token: params[:token])\n new_message_params = {\n text: message_params[:text],\n conversation_id: message_params[:conversation_id],\n user_id: user.id,\n username: user.username\n }\n @message = Message.new(new_message_params)\n conversation = Conversation.find(message_params[:conversation_id])\n\n if @message.save\n # render json: @message, status: :created, location: @message\n serialized_data = ActiveModelSerializers::Adapter::Json.new(\n MessageSerializer.new(@message)\n ).serializable_hash\n MessagesChannel.broadcast_to conversation, serialized_data\n head :ok\n else\n render json: @message.errors, status: :unprocessable_entity\n end\n end",
"def create\n\n\n @message = Message.new(message_params)\n @message.user_id = current_user.id\n @message.body = params[:message][:body]\n @message.save\n\n Recipient.create!(:message_id=>@message.id, :user_id=>params[:to_user_id],:sender_id => current_user.id, :receiver_id => params[:to_user_id],:status=>false)\n\n redirect_to \"/profile/#{current_user.id}\"\n end",
"def send_my_message\n account_sid = 'ACe330ba04d082392df4cb3511dcb72cec'\n auth_token = '2008ea097713e401a16c54029058da82'\n @client = Twilio::REST::Client.new account_sid, auth_token\n @client.account.messages.create(\n :from => @from,\n :to => @to,\n :body => @body\n )\n end",
"def create\n \n @message = current_user.messages.build(params[:message])\n if @message.save\n \n \n @account_sid = 'ACdb43c99b5deb7d4ed12083140f41bab3'\n @auth_token = '11dbb8cbba9b004652469aa77e51183c'\n\n # set up a client to talk to the Twilio REST API\n @client = Twilio::REST::Client.new(@account_sid, @auth_token)\n ha = HashWithIndifferentAccess.new(params[:message])\n mssg = ha['content']\n\n friends = {\n \"+14159006499\" => \"Jered\",\n \"+11111111111\" => \"Chris\",\n \"+11111111111\" => \"Kathryn\"}\n\n @account = @client.account\n @message = @account.sms.messages.create({:to => '+14159006499', :from => '+18319204556', :body => mssg})\n puts @message\n flash[:success] = \"Message created!\"\n redirect_to 'http://www.bugl.co/acknowledge.html'\n\n else\n @feed_items = []\n render 'static_pages/home'\n end\n \n @message = Message.new(params[:message])\n\n respond_to do |format|\n if @message.save\n \n format.json { render json: @message, status: :created, location: @message }\n else\n \n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @outgoing_message_log = OutgoingMessageLog.new(params[:outgoing_message_log])\n\n respond_to do |format|\n if @outgoing_message_log.save\n format.html { redirect_to @outgoing_message_log, notice: 'Outgoing message log was successfully created.' }\n format.json { render json: @outgoing_message_log, status: :created, location: @outgoing_message_log }\n else\n format.html { render action: \"new\" }\n format.json { render json: @outgoing_message_log.errors, status: :unprocessable_entity }\n end\n end\n end",
"def reply\n message = self.message.class.new(:subject => \"Re: #{subject}\",\n :body => body.gsub(/^/, '> '))\n message.sender = receiver\n message.to(sender)\n message\n end",
"def message(user, text)\n post('/direct_messages/new.json', :user => user, :text => text)\n end",
"def message(user, text)\n post('/direct_messages/new.json', :user => user, :text => text)\n end",
"def create\n @private_message = PrivateMessage.new(private_message_params)\n\n respond_to do |format|\n @private_message.user_from_id = current_user.id\n if @private_message.save\n unless User.where(id: @private_message.user_to_id).count.zero?\n ActionMailer::Base.mail(\n from: 'SaveCode.RU <admin@savecode.ru>',\n to: \"#{@private_message.user_to.username} <#{@private_message.user_to.email}>\",\n subject: 'SaveCode.RU сообщает о новом личном сообщении',\n body: render_to_string(file: 'private_messages/email', layout: false)\n ).deliver if @private_message.user_to_id && @private_message.user_to_id != @private_message.user_from_id\n\n format.html { redirect_to \"/pm/outbox/#{@private_message.id}.html\", notice: I18n.t('Private message was successfully created') }\n format.json { render action: 'show', status: :created, location: @private_message }\n else\n @private_message.errors.add(:user_to_id, t('This user not found'))\n format.html { render action: 'new' }\n format.json { render json: @private_message.errors, status: :unprocessable_entity }\n end\n else\n format.html { render action: 'new' }\n format.json { render json: @private_message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @message = @messagable.received_messages.build(params[:message])\n return redirect_to :back if @messagable.class == Alliance && !user.member_of?(@messagable)\n @message.user = current_user\n if @message.save\n redirect_to polymorphic_path([@messagable, :messages])\n else\n render :action => 'new'\n end\n end",
"def create\n params[:message][:to] = User.find_by_fullname(params[:message][:to]).id\n @message = Message.new(params[:message])\n @message.from = current_user.id\n @message.seen = false\n if @message.save\n flash[:notice] = \"Message sent\"\n else\n flash[:notice] = \"Message not sent\"\n end\n redirect_to(:action => 'index')\n end",
"def create_message_from_message_internal(raw_message)\n Message.new(raw_message)\n end",
"def message_new\n @employees = get_all_employees\n\t emp_details = find_employee(params[:emp_name])\n\t @message = Message.new\n\t @message.resume_id = params[:id]\n\t @message.sent_to = emp_details\n\t @message.sent_by = get_logged_employee\n\t @message.message = params[:message]\n respond_to do |format|\n if @message.save\n flash[:success] = \"successfully sent the message to \\'#{params[:emp_name]}\\'.\"\n\t else\n flash[:danger] = \"unable to delivery the message.\"\n\t end\n\t end\n end",
"def new_message\n end",
"def create\n @receiver = User.find(message_params[:receiver])\n @message = Message.create(sender: current_user, receiver: @receiver, status: 0, message: message_params[:message])\n if @message.save\n flash[:success] = 'Message was successfully sent.'\n redirect_to new_message_path\n else\n flash[:error] = 'Something wrong!'\n render :new\n end\n end",
"def send_sms(to_phone_number, message)\n # message = {to:, from:, body: \"Hello\\n\\nWorld\"}\n # binding.pry\n @@client.messages.create(\n from: @@from,\n to: to_phone_number,\n body: message\n )\n end",
"def create_message_and_publish(type, props = {}, core_props = {}, block = nil)\n debug \"(#{id}) create_message_and_publish '#{type}': #{props.inspect}: #{core_props.inspect}\"\n core_props[:src] ||= OmfCommon.comm.local_address\n msg = OmfCommon::Message.create(type, props, core_props)\n publish(msg, { routing_key: \"o.op\" }, &block)\n end",
"def create\n @message = Message.new(message: params[:message_content], from_id: current_user.id, to_id: params[:to_id])\n respond_to do |format|\n if @message.save\n format.html { redirect_to user_path(@message.to_id), notice: 'Message was successfully sent.' }\n else\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_message(queue_name, message_text, options = {})\n query = {}\n\n unless options.empty?\n query[\"visibilitytimeout\"] = options[:visibility_timeout] if options[:visibility_timeout]\n query[\"messagettl\"] = options[:message_ttl] if options[:message_ttl]\n query[\"timeout\"] = options[:timeout].to_s if options[:timeout]\n end\n\n uri = messages_uri(queue_name, query)\n body = Serialization.message_to_xml(message_text, options[:encode])\n\n response = call(:post, uri, body, {}, options)\n Serialization.queue_messages_from_xml(response.body, options[:decode])\n end",
"def create\n @message = Message.new sender_id: current_user.id, recipient_id: message_params[:recipient_id], verb: message_params[:verb]\n\n respond_to do |format|\n if @message.save\n format.html { redirect_to @message, notice: 'Message was successfully created.' }\n format.json { render :show, status: :created, location: @message }\n else\n format.html { render :new }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new_message(message)\n @message = message\n mail\n end",
"def send_message(to:, body:)\n twilio_client.api.account.messages.create(\n from: ENV['TWILIO_PHONE_NUMBER'],\n to: \"+1#{to}\",\n body: body\n )\n end",
"def twilio\n account_sid = ENV[\"TWILIO_SID\"]\n auth_token = ENV['TWILIO_TOKEN']\n client = Twilio::REST::Client.new account_sid, auth_token\n\n from = \"8452633595\"\n\n client.account.messages.create(\n :from => from,\n :to => self.phone,\n :body => \"#{self.title} - #{self.full_desc} ($#{self.price})\"\n )\n puts \"Sent message\"\n end",
"def create\n # @direct_message = DirectMessage.new(params[:direct_message])\n @direct_message = User.find(params[:user_id]).direct_messages.build(params[:direct_message])\n @direct_message.from_id = current_user.id\n @direct_message.unread = true\n\n respond_to do |format|\n if @direct_message.save\n format.html { redirect_to user_profile_path(@direct_message.to_user), notice: 'Direct message was successfully sent.' }\n format.json { render json: @direct_message, status: :created, location: @direct_message }\n else\n format.html { render action: \"new\" }\n format.json { render json: @direct_message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @message = Message.new(message_params)\n\n if @message.save\n SharpenAPI.send_sms(@message.message, @message.recipient_numbers)\n redirect_to admin_bat_signal_path, notice: 'Message was successfully sent'\n else\n format.html { render :new }\n format.json do\n render json: @message.errors, status: :unprocessable_entity\n end\n end\n end",
"def create\n\t\tchannel_sid = params[:channel_sid]\n\t\t@client = Twilio::REST::Client.new(ENV['account_sid'], ENV['auth_token'])\n\t\t# Add the member\n\t\tservice = @client.chat.v2.services(ENV['service_sid'])\n\t\tchannel = service.channels(channel_sid)\n\t\tmessage = channel.messages.create(body: params[:body])\n\t\tputs message\n\t\tresponse = \"{\\n\\\"message\\\": \\\"Message sent\\\"\\n}\"\n\t\tjson_response(response)\n\tend",
"def new\n @message = current_user.messages.build\n @action = \"New\"\n\n if !params[:perform].nil?\n @existing_message = Message.find(params[:id]) unless params[:id].nil?\n @message.subject = @existing_message.subject \n @message.body = @existing_message.body\n\n if (params[:perform] == \"forward\")\n @action = \"Forwarding\"\n end\n\n if (params[:perform] == \"reply\")\n @action = \"Replying to\"\n @message.to @existing_message.sender\n end\n\n if (params[:perform] == \"reply_to_all\")\n @action = \"Replying to All\"\n @message.to @existing_message.sender, @existing_message.recipients.to_a.collect{|recipient| recipient.receiver}\n end\n end\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @message }\n end\n end",
"def create\n \n @message = Message.new(body: params[:message][:body], sender_id: current_user.id, receiver_id: params[:message][:receiver_id])\n \n #@message = current_user.messages.build(message_params)\n #@message.save\n #respond_with { @message }\n\n respond_to do |format|\n if @message.save\n format.html { redirect_to message_user_path(@message.sender_id, @message.receiver_id), notice: 'Message was successfully created.' }\n format.json { render :show, status: :created, location: @message }\n else\n format.html { render :new }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def message(body: nil, to: nil, from: nil, method: nil, action: nil, status_callback: nil, **keyword_args)\n message = Message.new(\n body: body,\n to: to,\n from: from,\n method: method,\n action: action,\n status_callback: status_callback,\n **keyword_args\n )\n\n yield(message) if block_given?\n append(message)\n end",
"def new\n @message = Mailboxer::Message.new\n p User.get_recipient_list(@user.id)\n p 'hola world'\n @recipients = User.get_recipient_list(@user.id)\n end",
"def create\n @fdn_received_message = Fdn::ReceivedMessage.new(params[:fdn_received_message])\n\n respond_to do |format|\n if @fdn_received_message.save\n format.html { redirect_to @fdn_received_message, notice: 'Received message was successfully created.' }\n format.json { render json: @fdn_received_message, status: :created, location: @fdn_received_message }\n else\n format.html { render action: \"new\" }\n format.json { render json: @fdn_received_message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def build_message\n @subject = RecipientsFor::Subject.new\n @content = RecipientsFor::Content.new\n end",
"def create\n @internal_message = InternalMessage.new(internal_message_params)\n\n respond_to do |format|\n if @internal_message.save\n format.html { redirect_to @internal_message, notice: 'Internal message was successfully created.' }\n format.json { render :show, status: :created, location: @internal_message }\n else\n format.html { render :new }\n format.json { render json: @internal_message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n chatroommessage = ChatroomMessage.new(permitted_params)\n chatroom = Chatroom.find(permitted_params[:chatroom_id])\n if chatroommessage.save\n serialized_data = ActiveModelSerializers::Adapter::Json.new(\n ChatroomMessageSerializer.new(chatroommessage)\n ).serializable_hash\n ChatroomMessagesChannel.broadcast_to chatroom, serialized_data\n head :ok\n end\n end",
"def create\n @direct_message = DirectMessage.new(params[:direct_message])\n\n respond_to do |format|\n if @direct_message.save\n \tcurrent_user.sent_messages << @direct_message\n format.html { redirect_to @direct_message, notice: 'Message was successfully created.' }\n format.json { render json: @direct_message, status: :created, location: @direct_message }\n else\n format.html { render action: \"new\" }\n format.json { render json: @direct_message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n # create an incoming sms object\n sms = Sms::Message.create(:from => params[:sms_test][:from], :body => params[:sms_test][:body], :mission => current_mission)\n\n # submit it to the handle method over in the SmsController and get the reply\n reply = SmsController.handle_sms(sms)\n\n # save the reply and let the sent_at default to now\n reply.save if reply\n\n # render the body of the reply\n render :text => reply ? reply.body : \"<em>#{t('sms_console.no_reply')}</em>\".html_safe\n end",
"def new_message(*phrases) Message.new(*phrases); end",
"def create\n @message = current_user.send_message params[:message]\n if @message.new_record?\n render :action => \"new\"\n else\n flash[:notice] = \"The message was saved successfully.\"\n redirect_to messages_path\n end\n end",
"def message(body: nil, to: nil, from: nil, action: nil, method: nil, status_callback: nil, **keyword_args)\n message = Message.new(body: body, to: to, from: from, action: action, method: method, status_callback: status_callback, **keyword_args)\n\n yield(message) if block_given?\n append(message)\n end",
"def create_message(options={})\n author = options[:author]\n messageable = options[:messageable]\n params = options[:params]\n subject = RecipientsFor::Subject.new(params)\n subject.messageable_type = messageable.class.name\n subject.messageable_id = messageable.id\n if subject.save\n set_author_on_subject(author, subject)\n create_reader_infos(\n messageble: messageable,\n subject: subject\n )\n ActiveSupport::Notifications.instrument('message_created', subject_id: subject.id)\n end\n subject\n end",
"def create\n @members = Member.all\n @message = Message.new(message_params)\n @message.sender = current_member\n\n respond_to do |format|\n if @message.save\n # Send managers an email letting them know there's a new message\n BackstageMailer.waiting_for_approval(@message).deliver_later unless can? :approve, @message\n\n format.html { redirect_back_to messages_path, flash: { success: 'Message was successfully created.' } }\n format.json { render action: 'show', status: :created, location: @message }\n else\n format.html { render action: 'new' }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create(from:, to:, body:, date_sent: Time.now)\n raise 'from must be a String' unless from.is_a?(String)\n raise 'to must be a String' unless to.is_a?(String)\n raise 'date_sent must be a Time' unless date_sent.is_a?(Time)\n\n message_id = \"message:#{next_message_id}\"\n\n # Add composite index\n redis.zadd(MESSAGE_INDEX_SET, 0,\n \"#{to}:#{date_sent.to_i}:#{message_id}\")\n\n # Add message hash\n redis.hmset(message_id,\n 'from', from,\n 'to', to,\n 'body', body,\n 'date_sent', date_sent\n )\n end",
"def create\n @message = Message.new(message_params)\n\n respond_to do |format|\n if @message.save\n format.html { redirect_to @message, notice: \"Message sent to #{@message.receiver.full_name}.\" }\n format.json { render :show, status: :created, location: @message }\n else\n format.html { render :new }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n logger.debug(\"Entering Message new\" )\n @message = Message.new\n @message.sent_user = current_user.id\n @message.recv_user = params[:receiver]\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @message }\n end\n end",
"def create\n @message = Message.new(params[:message])\n\n respond_to do |format|\n if @message.save\n recipient_phone = Phone.find_by_number(@message.number)\n \t recipient_phone ||= User.create!.phones.create!(:number => @message.number)\n @message.send_SMS(@message.raw_message, recipient_phone, \"\", @message.app.id)\n format.html { redirect_to messages_path, notice: 'Message was successfully sent.' }\n format.json { render json: @message, status: :created, location: @message }\n else\n format.html { render action: \"new\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def sending_message(to, msg)\n\t begin\n\t\t @client = Twilio::REST::Client.new @account_sid, @auth_token\n\t\t data = {\n\t\t\t\t:from => \"+\" + Rails.application.secrets.from_number.to_s, \n\t\t\t\t:to => to,\n\t\t\t\t:body => msg, \n\t\t\t}\n\t\t\tputs data.inspect\n\t\t\t@client.account.messages.create(data)\n\t\trescue\n raise \"Message not send\"\n\t\tend\n end",
"def create\n if backend_request?\n @messaging_message = Messaging::Message.new(params[:messaging_message])\n else\n @messaging_message = Messaging::Message.new\n \n if !params[:message].has_key?(:sender_id) && !current_character.nil?\n @messaging_message[:sender_id] = current_character.id\n end\n \n #resolve recipient (by name, id or to the whole alliance?)\n if params[:message].has_key? :recipient_name\n @recipient = Fundamental::Character.find_by_name_case_insensitive(params[:message][:recipient_name])\n raise NotFoundError.new('Unknown Recipient.') if @recipient.nil?\n @messaging_message[:recipient_id] = @recipient.id\n elsif params[:message].has_key? :alliance_id\n raise ForbiddenError.new('Not allowed to send a mail to another alliance.') if current_character.nil? || current_character.alliance_id != params[:message][:alliance_id].to_i\n raise ForbiddenError.new('Not allowed to send a mail to the whole alliance.') if current_character.nil? || !current_character.alliance_leader?\n @messaging_message[:type_id] = Messaging::Message::ALLIANCE_TYPE_ID\n else\n @messaging_message[:recipient_id] = params[:message][:recipient_id].to_i\n end\n\n @messaging_message[:subject] = CGI::escapeHTML(params[:message][:subject] || \"-\")\n @messaging_message[:body] = format_body(CGI::escapeHTML(params[:message][:body] || \"\")) # we have to escape html here, because the body field is displayed \"raw\" in the client. reason: we want to allow battle reports to be formatted with html \n end \n \n role = determine_access_role(@messaging_message.sender_id, nil) \n raise ForbiddenError.new(\"Tried to forge a message from another sender.\") unless role == :owner || admin? || staff?\n \n raise BadRequestError.new('Malformed message could not be delivered.') unless @messaging_message.valid? \n \n if !@messaging_message.save \n raise BadRequestError.new('could not save and deliver message') if event.save\n end\n\n @recipient ||= @messaging_message.recipient\n\n if !@recipient.nil? && @recipient.offline?\n ip_access = IdentityProvider::Access.new(\n identity_provider_base_url: GAME_SERVER_CONFIG['identity_provider_base_url'],\n game_identifier: GAME_SERVER_CONFIG['game_identifier'],\n scopes: ['5dentity'],\n )\n ip_access.deliver_message_notification(@recipient, @messaging_message.sender, @messaging_message) \n end\n \n respond_to do |format|\n format.html do\n raise ForbiddenError.new('Backend Access Forbidden.') unless admin? || staff?\n redirect_to @messaging_message, notice: 'Message was successfully created.' \n end\n format.json { render json: [], status: :created, location: @messaging_message }\n end \n end",
"def create\n @message = Message.new(message_params)\n # require authentication + channel membership\n @message.author_id = @current_user.id;\n @message.channel_id = @channel.id;\n\n if @message.save\n # later we can require only broadcasting to 'live' users\n @channel.users.each do |user|\n UserChannel.broadcast_to(user, {message: @message})\n end\n render json: {ok: true}, status: :created\n else\n errors = {}\n @message.errors.each { |err| errors[err] = @message.errors.full_messages_for(err) }\n render json: errors, status: :unprocessable_entity\n end\n end",
"def create\n @message = Message.create(message_params)\n ActionCable.server.broadcast(\"chatting_channel\", {\n data_type: \"message\",\n user_id: @message.user_id, \n content: @message.content,\n created_at: (@message.created_at.strftime(\"%m/%d %H:%M\")),\n }) if @message.present?\n head :ok\n\n end",
"def create\n\t\tresponse = CreateMessageService.new(create_params).perform\n\t\tif response.success?\n\t\t\tmessage = response.result\n\t\t\trender_message_success(message)\n\t\telse\n\t\t\trender_error(:bad_request, response.errors)\n\t\tend\n\tend",
"def create\n # if params[:user_id].to_i == current_user[:id]\n # return\n # end\n @message = Message.new(message_params)\n @message.user = current_user\n @message.room_id = params[:room_id]\n @messages = Message.all\n ActionCable.server.broadcast \"room_channel_#{@message.room_id}\", message: @message\n\n if @message.save\n render json: @message\n else\n render plain: \"Failed to create a message\", status: :unprocessable_entity\n end\n end"
] | [
"0.6863068",
"0.6395797",
"0.6387949",
"0.63805705",
"0.6282034",
"0.6275927",
"0.6275927",
"0.62690103",
"0.6263038",
"0.62115824",
"0.61757183",
"0.612014",
"0.6118242",
"0.603402",
"0.60270935",
"0.6020818",
"0.601037",
"0.59878224",
"0.59351647",
"0.59351647",
"0.59351647",
"0.59351647",
"0.59351647",
"0.59351647",
"0.59351647",
"0.59351647",
"0.5928832",
"0.59241563",
"0.59212947",
"0.59153134",
"0.5908432",
"0.5905369",
"0.5895442",
"0.58815324",
"0.587811",
"0.5851013",
"0.58321154",
"0.58198",
"0.5812442",
"0.58076024",
"0.5798306",
"0.57866716",
"0.5774145",
"0.57715154",
"0.5761133",
"0.5738417",
"0.5735241",
"0.573357",
"0.57308894",
"0.5723985",
"0.57184815",
"0.5710279",
"0.5709525",
"0.5687199",
"0.5660361",
"0.56547284",
"0.5641392",
"0.5641392",
"0.5632733",
"0.5632459",
"0.56318897",
"0.5630691",
"0.5624976",
"0.5622579",
"0.5622109",
"0.5619066",
"0.56186277",
"0.5595543",
"0.55831623",
"0.5572798",
"0.5562043",
"0.5560687",
"0.5547697",
"0.5546281",
"0.55421776",
"0.55375487",
"0.55319905",
"0.55243134",
"0.55238336",
"0.5522504",
"0.5517463",
"0.55138296",
"0.5509319",
"0.55090314",
"0.54966426",
"0.54963046",
"0.5491417",
"0.5488927",
"0.5478964",
"0.54762024",
"0.54749465",
"0.5469301",
"0.5467496",
"0.54498875",
"0.5446761",
"0.54430974",
"0.54380965",
"0.5430214",
"0.5428693",
"0.54270566",
"0.542617"
] | 0.0 | -1 |
This method sends an email message disguised as an SMS message. | def deliver
Mail.new(from: from, to: formatted_to, body: sanitized_message).deliver!
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def send_sms!(msg)\n return false unless sms_alerts and phone_number_is_valid? and not mobile_carrier.blank?\n PersonMailer.send_sms(self, msg).deliver\n end",
"def send_sms(number, subject, carrier, message)\n SMSMailer.sms_mailer(number, subject, carrier, message).deliver_now\n end",
"def send_sms_message(text, to, from)\n deliver_message_via_carrier(text, to, from)\nend",
"def send_sms(sms, options={})\n send_to_phone(sms.phone_number, sms.actual_message, options)\n end",
"def reminder_sms(email)\n @url = 'http://onebreath.io'\n mail(to: email, subject: '', from: '_onebreath')\n end",
"def send_an_email(message, subject, to)\n message_params = {}\n message_params[:from] = 'QuikSort Bot <***@quiksort.in>'\n message_params[:to] = to\n message_params[:subject] = subject\n message_params[:text] = message\n logger.info $MG_CLIENT.send_message 'quiksort.in', message_params\nend",
"def send_message(message)\n @message = message\n mail to: \"colinsmix@gmail.com\", from: @message['email'], subject: \"Message Received from Music Blog Gatherer\"\n end",
"def twilio_send_text_message!(client,phone_num,msg)\n begin\n sms = client.account.sms.messages.create(\n :from => TWILIO_PHONE,\n :to => phone_num,\n :body => msg)\n rescue Exception => e\n puts \"Problems with twilio:\\n#{e}\"\n end\n end",
"def send_message\n unless message_sent\n twilio_client.messages.create(\n from: ENV.fetch(\"TWILIO_PHONE_NUMBER\"),\n to: contact.phone_number,\n body: content,\n )\n update(message_sent: true)\n end\n end",
"def deliver(message, options = {})\n options = options.reverse_merge default_options\n to = recipient.respond_to?(:call) ? recipient.call(message) : recipient\n message.body message.body.encode(options[:charset]) if options[:charset].presence\n ActionMailerSMSMailer.forward_sms(to, message, options.compact).deliver_now\n message.to\n end",
"def sms(number, message, sec=SMS_SEND_TIMEOUT)\n @logger.log(\"Sending message.\")\n\n msg = ATPhone::SMS::Message.new(message, number)\n \n # Turn on text mode\n send(\"AT+CMGF=1\")\n # Specify number\n raw_send(\"AT+CMGS=\\\"#{msg.number}\\\"\\r\")\n # send message\n raw_send(msg.text + EOM, sec)\n end",
"def send_sms(message)\n api_response = \"\"\n if !self.mobile.blank?\n txtlocal = Txtlocal.find_by_sms_type(Txtlocal::GROUP_CHAT)\n if !txtlocal.nil?\n txtlocal.message_contents = message\n api_response = txtlocal.send_sms(self.mobile)\n end\n else\n api_response = \"You have not provided any mobile number. Please go to your 'Account' to set up a mobile number\"\n end\n return api_response\n end",
"def send_message\n if message.present?\n sender.send_message(receiver, message, I18n.t(\"activity.verb.#{ contact_verb }.#{ receiver.subject_type }.message\", :name => sender.name))\n end\n end",
"def send_sms phone, message\n message = URI.escape message\n response = RestClient.get \"#{sender_base_url}/?from=#{@from}&to=#{phone}&text=#{message}&pass=#{@application_pass}\"\n @response = Response.new response\n end",
"def send_text_message(text_message)\n number_to_send_to = text_message.receiver\n message = text_message.content\n twilio_sid = \"AC50070372767bdf26a090b08007bba07f\"\n twilio_token = \"8ae1cdbb08d55b99cab34174c3cd8bbb\"\n twilio_phone_number = \"2245209581\"\n @twilio_client = Twilio::REST::Client.new twilio_sid, twilio_token\n @twilio_client.account.sms.messages.create(\n :from => \"+1#{twilio_phone_number}\",\n :to => number_to_send_to,\n :body => message\n )\n \n end",
"def send(txt, to, options = {})\n options.default = nil\n api_request(\"sendSms.php\", {\n txt: txt,\n to: to,\n idGroup: options[:idGroup],\n source: options[:source],\n flash: options[:flash],\n dateTimeSend: options[:dateTimeSend],\n onlydelivery: options[:onlydelivery],\n use_alfasource: options[:use_alfasource],\n discountID: options[:discountID],\n channel: options[:channel]\n })\n end",
"def send_sms(to_phone_number, message)\n # message = {to:, from:, body: \"Hello\\n\\nWorld\"}\n # binding.pry\n @@client.messages.create(\n from: @@from,\n to: to_phone_number,\n body: message\n )\n end",
"def send_message(recipients, msg_body, subject, sanitize_text=true, attachment=nil, message_timestamp = Time.now)\n convo = Mailboxer::ConversationBuilder.new({\n :subject => subject,\n :created_at => message_timestamp,\n :updated_at => message_timestamp\n }).build\n\n message = Mailboxer::MessageBuilder.new({\n :sender => self,\n :conversation => convo,\n :recipients => recipients,\n :body => msg_body,\n :subject => subject,\n :attachment => attachment,\n :created_at => message_timestamp,\n :updated_at => message_timestamp\n }).build\n\n message.deliver false, sanitize_text\n end",
"def send_sms_confirmation!\n return false if txter_sms_blocked?\n return true if sms_confirmed?\n return false if txter_sms_phone_number.blank?\n\n confirmation_code = Txter.generate_confirmation_code\n\n # Use this class' confirmation_message method if it\n # exists, otherwise use the generic message\n message = (self.class.respond_to?(:confirmation_message) ?\n self.class :\n Txter).confirmation_message(confirmation_code)\n\n if message.to_s.size > 160\n raise ArgumentError, \"SMS Confirmation Message is too long. Limit it to 160 characters of unescaped text.\"\n end\n\n response = Txter.deliver(message, txter_sms_phone_number)\n\n if response.success?\n update_txter_sms_confirmation confirmation_code\n else\n false\n end\n end",
"def send_message(subject, text, campaign_id, to_email)\n ret_msg = nil\n if !to_email.blank?\n begin\n response = RestClient.post \"#{BASE_URI}/messages\",\n :from => \"Mailgun Test User <xxxx@xxxxxxx.com>\",\n :to => to_email,\n :subject => subject,\n :html => \" #{text} <br/> A <a href='http://www.google.com'>sample link</a> is atttached \n to test the click event of the email link.\",\n \"o:campaign\" => campaign_id\n ret_msg = response.code == 200 ? \"Success\" : \"Failed\"\n rescue Exception => e\n Rails.logger.debug e.message\n end\n end\n ret_msg\n end",
"def send_message(phone_number, message)\n command = Command.new('SendSMSBasic', license_key)\n MessageStatus.new(\n Response.parse(\n command.execute({:PhoneNumber => phone_number, :Message => message})\n )[\"SmsReturn\"]\n )\n end",
"def send_mail\n @message = params[:message]\n user = User.find_by_email('lucev.ivan@gmail.com')\n ContactMailer.contact_message(user, @message).deliver\n redirect_to :back, :notice => 'Uspješno poslan email'\n end",
"def send_sms(content, tonumber)\n tonumber = format(tonumber);\n \tbegin\n @client.messages.create({\n \t :from => @from_number,\n \t :to => tonumber,\n \t :body => content,\n })\n rescue Twilio::REST::RequestError => e\n message = I18n.t(\"errors.sms_not_sent\")\n rescue NoMethodError => e\n message = I18n.t(\"errors.sms_not_sent\")\n else\n message = I18n.t(\"notice.success\")\n end\n\n return message\n\n end",
"def send_email(from, from_alias, to, to_alias, subject, message) #Sending emails!\n\tmsg = <<END_OF_MESSAGE\nFrom: #{from_alias} <#{from}>\nTo: #{to_alias} <#{to}>\nReply-to: noreply@sirmxe.info\nSubject: #{subject}\n\t\n#{message}\nEND_OF_MESSAGE\n\t\n\tNet::SMTP.start('127.0.0.1') do |smtp|\n\t\tsmtp.send_message msg, from, to\n\tend\nend",
"def sending_message(to, msg)\n\t begin\n\t\t @client = Twilio::REST::Client.new @account_sid, @auth_token\n\t\t data = {\n\t\t\t\t:from => \"+\" + Rails.application.secrets.from_number.to_s, \n\t\t\t\t:to => to,\n\t\t\t\t:body => msg, \n\t\t\t}\n\t\t\tputs data.inspect\n\t\t\t@client.account.messages.create(data)\n\t\trescue\n raise \"Message not send\"\n\t\tend\n end",
"def send\n if @to.nil? || @from.nil? || @message.nil?\n raise ArgumentError, \"You need to include 'to' and 'from' numbers and a message to send an SMS\"\n end\n to = @to.gsub(\" \",\"\")\n from = @from.gsub(\" \",\"\")\n parameters = {\n \"sms-send-to\" => to,\n \"sms-send-from\" => from,\n \"sms-message\" => @message[0..159]\n }\n request = @browser.post(\"#{VoipfoneClient::API_POST_URL}?smsSend\", parameters)\n response = parse_response(request)\n if response == \"ok\"\n return true\n else\n raise VoipfoneAPIError, response\n end\n end",
"def send_message(user_id, message)\n @user = User.find(user_id)\n @message = message\n mail(to: @user.email, subject: 'You have a message from')\n end",
"def deliver(message, _options = {})\n raise ArgumentError, \"too many recipients, max. is #{MAX_RECIPIENT}\" if message.to.length > MAX_RECIPIENT\n\n # perform request\n @obh_client.send_sms(post_params(message))\n message.to\n end",
"def smtp_send(to,from,subject,message)\n msgstr = message.join(\"\\n\")\n from_smtp = \"#{from.gsub(\" \",\".\")}@#{SMTPDOMAIN}\"\n msg = [ \"From: #{from_smtp}\\n\",\"To: #{to}\\n\",\"Subject: #{subject}\\n\", \"\\n\", \"#{msgstr}\" ]\n Net::SMTP.start(SMTPSERVER, 25) do |smtp|\n smtp.send_message msg, from_smtp, to\n end\n end",
"def send_sms_verification_code\n number_to_send_to = phone_number\n verification_code = phone_verification_code\n sms_message_body = I18n.t(\"devise.phone.message_body\", :verification_code => verification_code)\n\n sms = Sms.new\n sms.phone_number = number_to_send_to\n sms.message = sms_message_body\n return false unless sms.send!\n\n true\n end",
"def broadcast_message(subject,\n message,\n recipients,\n send_to = 'PCB_Design_Tracker_Users <dtg-noreply@lists.teradyne.com>')\n\n @message = message\n\n mail( :to => send_to,\n :subject => subject,\n :cc => recipients.uniq,\n :bcc => [] #override default\n ) \n \n end",
"def send_message(subject, message, recipients, adminEmail, params)\n # execute_operation(:send_message, { nickname: nickname, subject: subject, recipients: recipients, message: message, adminEmail: adminEmail params: params })\n raise RuntimeError, 'Not implemented'\n end",
"def perform(message, to_number)\n logger.info \"Sending message to #{to_number}\"\n TwilioService.new({\n to: to_number,\n msg: message\n }).send_sms\n end",
"def send phone_number\n account = CLIENT.account \n message = account.sms.messages.create({from: TAKEAWAY_NUMBER , to: phone_number, body: \"Thanks for your order! It shall arrive no later than #{@delivery_time.strftime(\"%H\")}:#{@delivery_time.strftime(\"%M\")}.\"})\n message.body\n end",
"def send_message(recipients, msg, sanitize_text=true, message_timestamp = Time.now)\n\n message = Alerter::MessageBuilder.new({\n :sender => self,\n :recipients => recipients,\n :msg => msg,\n :created_at => message_timestamp,\n :updated_at => message_timestamp\n }).build\n\n message.deliver false, sanitize_text\n end",
"def send_message(message)\n @message = message\n\n mail to: \"debbieblass@web.de\",\n subject: \"Message from GoLunch Visitor\"\n end",
"def send_sms(destination, message, params = {})\n execute_operation(:send_sms, { destination: destination, message: message, params: params } )\n end",
"def deliver(sms)\n create_sms(sms).submit()\n end",
"def send_message(name, email, subject, message)\n #@greeting = \"Hi\"\n\n #mail( to: \"noreplypoint@gmail.com\" )\n @name = name.to_s\n @email = email.to_s\n @subject = subject.to_s \n @message = message.to_s + \" FROM: \" + @name.to_s\n \n mail(to: 'noreplypoint@gmail.com', subject: @subject.to_s)\n end",
"def send_message\n response = RestClient::Request.new(\n :method => :post,\n :url => \"https://api.twilio.com/2010-04-01/Accounts/#{ENV['TWILIO_ACCOUNT_SID']}/Messages.json\",\n :user => ENV['TWILIO_ACCOUNT_SID'],\n :password => ENV['TWILIO_AUTH_TOKEN'],\n :payload => { :Body => body,\n :To => Contact.find(self.contact_id).number,\n :From => ENV['USER_NUMBER'] }\n ).execute\n end",
"def send_email\n UserMailer.send_message(params[:id],params[:message][:message]).deliver_now\n render html: 'You sent a message'\n end",
"def contact_message(contact_email)\n @contact_email=contact_email\n \n\n mail to: \"amfsg@aol.com\", subject: \"Message Sent From raisebusinessomeony.com: #{contact_email.subject}\", from: contact_email.email, reply_to: contact_email.email\n end",
"def send(message)\n info(\"[Emailvision] Send -> #{message}\")\n end",
"def sendEmail(from, to, subject, message)\n toMail = \"\"\n to.each { |x| toMail= toMail + \",#{x}\" }\n\nmsg = <<END_OF_MESSAGE\nFrom: <#{from}>\nTo: <#{toMail}>\nSubject: #{subject}\n\n#{message}\nEND_OF_MESSAGE\n\n Net::SMTP.start('smtp.bcm.tmc.edu') do |smtp|\n smtp.send_message msg, from, to\n end\n end",
"def send_message(token, payload, save_to_sentitems = true, user = nil)\n request_url = user_context(user) << \"/SendMail\"\n\n # Wrap message in the sendmail JSON structure\n send_mail_json = {\n 'Message' => payload,\n 'SaveToSentItems' => save_to_sentitems\n }\n\n send_response = make_api_call \"POST\", request_url, token, nil, send_mail_json\n\n return nil if send_response.nil? || send_response.empty?\n\n parse_response(send_response)\n end",
"def send_confirmation_sms\n SmsApi.send_sms \"+1#{self.phone}\", \"Your confirmation code for StreetEats is #{self.phone_confirmation_code}\"\n end",
"def send_message(message_id, params = {})\n @api.post(\"#{@api.path}/List/#{@id}/Email/#{message_id}/Send\", params: params)\n end",
"def send_twilio_mms\n # Get your Account Sid and Auth Token from twilio.com/user/account\n\n account_sid = 'add your account sid'\n auth_token = 'add your auth token'\n\n # set up a client to talk to the Twilio REST API\n client = Twilio::REST::Client.new account_sid, auth_token\n\n\n mms_message_body = \"name:#{self.contact.name}\"\n mms_message_body += \"\" #quick way to create spacing inbetween txt lines\n mms_message_body += \"phone: #{self.contact.phone_number}\"\n mms_message_body += \"\" #quick way to create spacing inbetween txt lines\n mms_message_body += \"#{self.message}\"\n end",
"def sms number, message\n response = @connection.cmd \"String\" =>\"sms send #{number} #{message}\", \"Match\" => /OK|KO:(.*)/, \"Timeout\" => 5\n if response.chomp == \"OK\"\n true\n else\n raise response.chomp.sub \"KO:\",''\n end\n end",
"def deliver_message_via_carrier(text, to, from)\n SMS_CARRIER.deliver_message(text, to, from)\nend",
"def deliver_message(options)\n self.sms_service_provider||= default_service_provider\n\n # set the actual message if it differs; not a before_save to reduce the\n # overhead of checking for all commits\n self.actual_message = substituted_draft_message\n\n result = (self.sms_service_provider).send_sms(self)\n self.unique_id = result[:unique_id] if result.is_a?(Hash)\n \n result\n end",
"def sendmail\n run_mail_tools_queue(@command) do |msg, env|\n # Send the Message\n msg.puts @qmsg.message\n msg.close\n\n env.write('F' + @qmsg.return_path + \"\\0\")\n p @qmsg.recipients\n @qmsg.recipients.each { |r| env.write('T' + r + \"\\0\") }\n env.write(\"\\0\") # End of \"file\"\n end\n\n MailTools::Result.new(@qmsg, :queue, @exit_code)\n end",
"def send_message(to:, body:)\n twilio_client.api.account.messages.create(\n from: ENV['TWILIO_PHONE_NUMBER'],\n to: \"+1#{to}\",\n body: body\n )\n end",
"def deliver_email\n\t\treturn not_validated_error unless EmailValidator.new(content: content).validated?\n\t\tformatted_content = EmailFormatter.new(content: content, service: service).format\n\n\t\tif service == \"mandrill\"\n\t\t\tself.class.base_uri \"https://mandrillapp.com/api/1.0\"\n\t\t\tresponse = self.class.post(\"/messages/send.json\", body: {\"key\" => ENV.fetch(\"MANDRILL_API_KEY\"), \"message\" => formatted_content})\n\t\t\tif response[\"status\"] == \"sent\"\n\t\t\t\t\"Yay! Your email is on it's way!!\"\n\t\t\telse\n\t\t\t\t\"Oh no. That email couldn't be delivered\"\n\t\t\tend\n\n\t\telsif service == \"mailgun\"\n\t\t\tself.class.base_uri \"https://api.mailgun.net/v3/sandboxaebea391c02a4a0494ab285e2adf8170.mailgun.org\"\n\t\t\tself.class.basic_auth 'api', ENV.fetch(\"MAILGUN_API_KEY\")\n\t\t\tresponse = self.class.post(\"/messages\", body: formatted_content)\n\t\t\tif response[\"message\"] == \"Queued. Thank you.\"\n\t\t\t\t\"Yay! Your email is on it's way!!\"\n\t\t\telse\n\t\t\t\t\"Oh no. That email couldn't be delivered\"\n\t\t\tend\n\t\tend\n\tend",
"def send_text_message(client:, user:, body:, tax_return: nil, locale: nil, to: nil)\n intake = Hub::ClientsController::HubClientPresenter.new(client).intake\n return unless intake.sms_notification_opt_in_yes?\n\n if intake.sms_notification_opt_in_yes? && !intake.sms_phone_number.present?\n DatadogApi.increment('clients.missing_sms_phone_number_for_sms_opt_in')\n return\n end\n\n replacement_args = { body: body, client: client, preparer: user, tax_return: tax_return, locale: locale }\n replaced_body = ReplacementParametersService.new(**replacement_args).process\n client.outgoing_text_messages.create!(\n to_phone_number: to || intake.sms_phone_number,\n sent_at: DateTime.now,\n user: user,\n body: replaced_body,\n )\n end",
"def send_email(to, subject, content)\r\n\r\n end",
"def contact_email(message)\n @message = message\n @from = @message.email\n mail(from: message.email, reply_to: message.email, subject: message.subject)\n end",
"def send_message(phone_number, message, options={})\n raise SmsOnRails::SmsError.new(\"Override send_message in subclass #{self.class}\")\n end",
"def deliver(sms)\n new.deliver!(sms)\n end",
"def email_friend(sent_to,message,subject)\n @message=message\n mail to: 'shashitripathi253@gmail.com,'+sent_to,:subject => subject\n end",
"def send_email(from, from_alias, to, to_alias, subject, message)\n\tmsg = <<END_OF_MESSAGE\nFrom: #{from_alias} <#{from}>\nTo: #{to_alias} <#{to}>\nMIME-Version: 1.0\nContent-type: text/plain\nSubject: #{subject}\n\n#{message}\nEND_OF_MESSAGE\n\n\tNet::SMTP.start('mr1.ufz.de',\n 25,\n 'localhost.localdomain',\n 'bilke', $password) do |smtp|\n\t\tputs \"Sending email to #{to_alias} <#{to}>...\"\n smtp.send_message(msg, from, to)\n\tend\nend",
"def send_message\n AWS_SQS.send_message(\n queue_url: ENV.fetch('NOTIFY_QUEUE_URL', ''),\n message_group_id: ENV.fetch('NOTIFY_GROUP_ID', 'VCCS_CONTACT_FORM'),\n message_body: attributes,\n message_attributes: {\n 'contentType' => { string_value: 'application/json', data_type: 'String' }\n }\n )\n end",
"def send_message(email, text)\n @notification_server.send_message email, text\n end",
"def send_email(message)\n @message = message\n mail to: \"china@pozitive.biz, coddeys@gmail.com\", subject: \"Request from website\"\n end",
"def mail\n if @message.to.empty?\n flash.now[:no_server] = true\n return render :edit\n end\n\n MessageMailerSenderJob.perform_later(@message)\n @message.sent!\n render :show\n end",
"def email_message(subject, msg, to, html = false)\n if (!@dry_run)\n msg_hash = {:to => to,\n :subject => \"#{SUBJECT_PREFIX}#{subject}\",\n :from => @from,\n :via => :smtp,\n :via_options => @mail_options }\n if html\n msg_hash[:html_body] = \"<PRE>#{msg}</PRE>\"\n else\n msg_hash[:body] = msg\n end\n Pony.mail(msg_hash)\n else\n puts \"email message to: #{to}:\"\n puts msg\n end\n end",
"def sendemail(subject,content,to=nil) \n from = \"saq@xj.cninfo.net\" \n to = [\"saq@xj.cninfo.net\"] if to.nil? \n sendmessage = \"Subject: \"+subject +\"\\n\\n\"+content \n smtp = Net::SMTP.start(\"mail.xj.cninfo.net\",25,\"mail.xj.cninfo.net\",'saq','wei720503',:login) \n smtp.send_message sendmessage,from,to \n smtp.finish \n end",
"def send_sms(sms_number, msg_text, importance)\n # Use a fixed test number for dev and test (non production) environments\n sms_number = self.class.test_sms_number unless Rails.env.production?\n\n raise FphsException, \"Invalid SMS importance: #{importance}\" unless valid_importance?(importance)\n\n aws_sns_client.publish(\n phone_number: sms_number,\n message: msg_text,\n message_attributes: {\n 'AWS.SNS.SMS.SenderID' => {\n data_type: 'String',\n string_value: self.class.sender_id\n },\n 'AWS.SNS.SMS.SMSType' => {\n data_type: 'String',\n string_value: importance\n }\n }\n )\n end",
"def send_email\n Kernel.const_defined?(:MobileInfo) and\n System.ntpd_wait(60) do\n MobileInfo.send_email\n end\n end",
"def ms_send_message(token, message_id)\n send_message_url = \"/v1.0/me/messages/#{message_id}/send\"\n req_method = 'post'\n query = {}\n response = make_api_call send_message_url, token, query,req_method\n raise response.parsed_response.to_s || \"Request returned #{response.code}\" unless response.code == 202\n response\n end",
"def send_notifications(unituser, msg)\n user = unituser.user\n user.send_sms(msg)\n UserMailer.send_email(user, user.email, msg).deliver if user.contact_flags[1] == \"1\"\n UserMailer.send_email(user, user.email2, msg).deliver if user.contact_flags[3] == \"1\"\n end",
"def send_my_message\n account_sid = 'ACe330ba04d082392df4cb3511dcb72cec'\n auth_token = '2008ea097713e401a16c54029058da82'\n @client = Twilio::REST::Client.new account_sid, auth_token\n @client.account.messages.create(\n :from => @from,\n :to => @to,\n :body => @body\n )\n end",
"def mail_send(mail, message)\n\tGmail.connect('metaldroope@gmail.com', 'superpassword123') do |gmail|\n\t\temail = gmail.compose do\n\t\t to mail['mail']\n\t\t subject \"Top DJ News\"\n\t\t body message\n\t\tend\n\t\temail.deliver!\n\tend\nend",
"def send_email(message, receiver)\n @conversation = message.conversation\n if @conversation.lock_email_notification_once == true\n @conversation.update_column :lock_email_notification_once, false\n return false\n end\n\n # Don't use the mailboxer mailer for community public questions.\n if @conversation.mailboxer_label_id == Mailboxer::Label::PUBLIC_QUESTION.id\n return false\n end\n\n if receiver.is_a? User\n send_email_to_user(message, receiver)\n else\n send_email_to_admin(message, receiver)\n end\n end",
"def send_message(message_id, params = {})\n @api.post(\"#{@api.path}/Group/#{@id}/Email/#{message_id}/Send\", params: params)\n end",
"def send_email(from, from_alias, to, to_alias, subject, message)\n \tmsg = <<END_OF_MESSAGE\nFrom: #{from_alias} <#{from}>\nTo: #{to_alias} <#{to}>\nMIME-Version: 1.0\nContent-type: text/plain\nSubject: #{subject}\n\n#{message}\nEND_OF_MESSAGE\n\n \tNet::SMTP.start('imap.leipzig.ufz.de',\n 25,\n 'localhost.localdomain',\n 'bilke', $password, :plain) do |smtp|\n \t\tputs \"Sending email to #{to_alias} <#{to}>...\"\n smtp.send_message(msg, from, to)\n \tend\n end",
"def mail_message(subject, content)\n message = ''\n message << \"From: Do Not Reply <nobody@stanford.edu>\\n\"\n message << \"To: #{EMAIL_TO}\\n\"\n message << \"Subject: #{subject}\\n\"\n message << \"\\n\"\n message << content\n\n Net::SMTP.start('localhost') do |smtp|\n smtp.send_message message, 'nobody@stanford.edu', EMAIL_TO\n end\nend",
"def send_message\n Pony.mail({\n :from => params[:email], \n :to => 'info_the_lodge@gmail.com',\n :subject => params[:email] + \" has contacted you - Phone: \" + params[:phone], \n :body => params[:email] + params[:message],\n :via => :smtp,\n :via_options => {\n :address => 'smtp.gmail.com', \n :port => '587', \n :enable_starttls_auto => true,\n :user_name => 'info_the_lodge',\n :password => 'secret',\n :authentication => :plain,\n :domain => 'localhost.localdomain'\n }}) \n end",
"def send_request\n message_request = mail_params\n puts \"#############################################\"\n p message_request[:messages].values\n sender = message_request[:sender]\n messages = message_request[:messages]\n messages = messages.to_hash.map { |m| m[1] }\n\n mailing_service = GoogleApiServices::MailingService.new(google_auth_client)\n mailing_service.send(sender: sender, messages: messages)\n end",
"def deliver_message\n\t\ttext = interpolate_text @template.text\n\t\tbegin \n\t\t\tsent_sms = send_sms(\"+#{@user.phone}\", text)\n\t\trescue Exception => e\n\t\t\tlogger.info \"Exception thrown interacting with Twillio: #{e}\"\n\t\t\treturn false\n\t\tend\n\n\t\tif(sent_sms.status != \"failed\")\n\t\t\tmessage = Message.create!(user: @user, template: @template, text: text)\n\t\t\ttrue\t\n\t\telse\n\t\t\tlogger.info \"Message failed to send: #{sent_sms}\"\n\t\t\tfalse\n\t\tend\n\tend",
"def send_text_message(body)\n if self.mobile.present?\n begin\n TWILIO_CLIENT.messages.create(from: ENV['TWILIO_PHONE_NUMBER'], to: self.mobile, body: body)\n rescue Twilio::REST::RequestError => e\n puts \"Twilio Error: #{e.message}\"\n end\n end\n end",
"def deliver!(sms = @sms) #:nodoc:\n raise \"no SMS object available for delivery!\" unless sms\n logger.info \"Sending SMS: #{sms} via #{sms.delivery}\" unless logger.nil?\n \n begin\n send(\"perform_delivery_#{sms.delivery}\", sms) if perform_deliveries\n rescue Exception => e \n raise e if raise_delivery_errors\n end\n \n logger.info \"SMS Sent!\" unless logger.nil?\n return sms\n end",
"def send(sender, to, subject, text, options={})\n orig_options = options\n options = {\n :sender => sender,\n :to => to || [],\n :subject => subject,\n :text => text\n }\n options.merge!(orig_options)\n message = create_java_message(options)\n convert_mail_exceptions { service.send(message) }\n end",
"def send_twitter_message!(sendto, subject, message)\n send_message({:sendto => sendto, :subject => subject, :message => message})\n end",
"def send_message\n if self.id != 1\n admin_sender = User.find(1)\n user_receiver = self\n message = Message.new\n message.subject = \"It's Official! You're in.\"\n message.body = \"As a member of the VVI community, you're now able to contact other volunteers directly, share your own experiences online, and stay active in our mission to make the world of international volunteering more transparent, more organized, and more excellent. \n <br /><br />We can't thank you enough for joining the cause! And we're here if you need anything.\n <br /><br />--VolunteerVoice Team\"\n message.recipient = user_receiver\n message.sender = admin_sender\n message.save\n end\n end",
"def send_sms\n status = self.status\n if status.upcase == 'INTERVENTION'\n self.message\n end\n end",
"def perform (msg, to_phone, from_phone=ENV['ST_MAIN_NO'], type=SMS, next_sequence={})\n if type == MMS\n # send MMS to user\n begin\n mms(msg, to_phone, from_phone, next_sequence)\n\n rescue Twilio::REST::RequestError => e\n puts \"we've encountered a Twilio error.\"\n # TODO: describe the ramifications\n email_admins(\"Twilio Error\", \"Status: #{Time.now.to_s}\\nFailed MMS send, #{e.inspect}, \\nphone_number: #{to_phone}.\")\n Sidekiq.logger.warn e\n end\n else # SMS\n begin\n sms(msg, to_phone, from_phone, next_sequence)\n\n rescue Twilio::REST::RequestError => e\n puts \"we've encountered a Twilio error.\"\n # TODO: describe the ramifications\n email_admins(\"Twilio Error\", \"Status: #{Time.now.to_s}\\nFailed SMS send, #{e.inspect}, \\nphone_number: #{to_phone}.\")\n Sidekiq.logger.warn e\n end\n end\n end",
"def new_message_email(conversation, message_id)\n @message = Message.find(message_id)\n @user_id = @message.user_id\n @sender_id = conversation.sender_id\n @recipient_id = conversation.recipient_id\n if @user_id == @sender_id\n @user = User.find(@recipient_id)\n @sender = User.find(@sender_id)\n else\n @user = User.find(@sender_id)\n @sender = User.find(@recipient_id)\n end\n mail(to: @user.email, from: \"Moonlight <notifications@moonlight.sg>\", subject: \"#{@sender.first_name} sent you a new message!\")\n end",
"def send_mail_now(sender_mail, sender_name, sender_phone, msg)\n @sender_mail = sender_mail\n @sender_name = sender_name\n @sender_phone = sender_phone\n @feedback_msg = msg\n\n mail :to => [\"sysadmin@venki-spb.ru\", \"pavel.polushkin@gmail.com\", \"a_10@bk.ru\"], :subject => \"VENKI-SPB.RU \" + sender_name\n end",
"def sendmail(message, from, to, replyto=nil, locals=nil)\n message = ERB.new(<<-EOS).result(binding)\nFrom: <%= $config[:sender] %>\nTo: <%= to %>\nReply-To: <%= replyto.nil? ? from : replyto %>\n#{message}\n#{$messages[:footer]}\n EOS\n Net::SMTP.start($config[:'smtp-host'], $config[:'smtp-port']) do |smtp|\n smtp.send_message message, from, to\n end\n end",
"def send\n begin\n response = RestClient.post \"https://api:#{ENV['MG_API_KEY']}\"\\\n \"@api.mailgun.net/v3/#{ENV['MG_DOMAIN']}/messages\",\n from: \"#{@params['from_name']} <#{@params['from']}>\",\n to: \"#{@params['to_name']}, #{@params['to']}\",\n subject: \"#{@params['subject']}\",\n html: \"#{ActionController::Base.helpers.sanitize(@params[\"body\"])}\"\n rescue RestClient::ExceptionWithResponse => e\n @errors = e.response\n end\n end",
"def send_an_sms_message(message_request, opts = {})\n data, _status_code, _headers = send_an_sms_message_with_http_info(message_request, opts)\n data\n end",
"def spam(user, message:, subject:)\n @user = user\n @message = message\n mail(to: @user.email, reply_to: \"noreply@codetriage.com\", subject: subject)\n end",
"def send_sms!(msg, allow_multiple = false)\n if msg.to_s.size > 160 && !allow_multiple\n raise ArgumentError, \"SMS Message is too long. Either specify that you want multiple messages or shorten the string.\"\n end\n return false if msg.to_s.strip.blank? || txter_sms_blocked?\n return false unless sms_confirmed?\n\n # split into pieces that fit as individual messages.\n msg.to_s.scan(/.{1,160}/m).map do |text|\n if Txter.deliver(text, txter_sms_phone_number).success?\n text.size\n else\n false\n end\n end\n end",
"def contact_email(message)\n @message = message\n @dest_email = 'team@calblueprint.org'\n\n mail(:to => @dest_email, :from => @message.email, :subject => @message.subject)\n\n end",
"def send_message(msg)\n send_data({:type => :message, :body => msg})\n end",
"def send_email\n g = GmailSender.new(USER_NAME, PASSWORD)\n\n g.send(:to => to,\n :subject => @subject,\n :content => full_content)\n end",
"def send_request(from, to, title, message)\n RestClient.post API_URL+\"/messages\",\n :from => from.email,\n :to => to.email,\n :subject => \"UROP Application for \"+title+\" from \"+from.first_name+\" \"+from.last_name,\n :text => message\n end",
"def send_text\n Rails.logger.info \"Sending \\\"#{text}\\\" to #{number}...\"\n Twilio::Sms.message(TWILIO_CONFIG['caller_id'], number, text)\n end",
"def create\n @message = Message.new(message_params)\n if @message.save\n @message.action = 'SEND'\n @message.save\n\n # Send SMS text\n boot_twilio\n sms = @client.messages.create(\n body: @message.text,\n from: Rails.application.secrets.twilio_number,\n to: @message.number,\n )\n redirect_to @message, alert: \"SMS Text sent.\"\n else\n render 'new'\n end\n end",
"def send_message\n error_check\n if @message_config[:debug]\n puts \"\\n\\n<=> Debug Mode <=>\"\n puts \"Via: #{@message_config[:via]}\"\n puts \"From: #{@message_config[:from]}\"\n puts \"To: #{@message_config[:to]}\"\n puts \"Cc: #{@message_config[:cc]}\" unless @message_config[:cc].nil?\n puts \"Bcc: #{@message_config[:bcc]}\" unless @message_config[:bcc].nil?\n puts \"Subject: #{@message_config[:subject]}\\n\\n\"\n puts @message_config[:body]\n else\n Pony.mail(\n to: @message_config[:to],\n from: @message_config[:from],\n subject: @message_config[:subject],\n body: @message_config[:body],\n cc: @message_config[:cc],\n bcc: @message_config[:bcc],\n via: @message_config[:via],\n headers: { \"mailer\" => \"nikkyMail\" }\n )\n sleep @message_config[:sleep]\n end\n end"
] | [
"0.76776797",
"0.7592039",
"0.74998206",
"0.71865207",
"0.7096294",
"0.70588815",
"0.70246905",
"0.6962636",
"0.6950622",
"0.6894564",
"0.68856657",
"0.6871104",
"0.6825135",
"0.6818493",
"0.68159103",
"0.6803716",
"0.6798487",
"0.67855805",
"0.6771584",
"0.67590785",
"0.66988903",
"0.6695682",
"0.6695412",
"0.66721165",
"0.666901",
"0.66629124",
"0.66618544",
"0.66542065",
"0.66045403",
"0.6602834",
"0.65968174",
"0.6583117",
"0.6560068",
"0.6560026",
"0.6558786",
"0.6540646",
"0.6514225",
"0.65136814",
"0.65099055",
"0.6509231",
"0.6505547",
"0.6505143",
"0.64938706",
"0.6474414",
"0.64724296",
"0.64680445",
"0.64677805",
"0.6460502",
"0.64604145",
"0.64575994",
"0.6455366",
"0.64467067",
"0.6446268",
"0.64403",
"0.64363956",
"0.6424984",
"0.64220625",
"0.64106554",
"0.6404107",
"0.6397055",
"0.6394664",
"0.63906944",
"0.63905144",
"0.63703406",
"0.6366266",
"0.63601905",
"0.6337306",
"0.63245493",
"0.63242805",
"0.6323996",
"0.632072",
"0.6314219",
"0.6308241",
"0.63080025",
"0.63070095",
"0.6300902",
"0.62961644",
"0.6296144",
"0.62889767",
"0.628103",
"0.62786627",
"0.6264142",
"0.624325",
"0.6230221",
"0.6229312",
"0.62228686",
"0.62222266",
"0.6220899",
"0.6219832",
"0.6213708",
"0.6209049",
"0.62079906",
"0.62024844",
"0.61958456",
"0.6193919",
"0.6192092",
"0.6186043",
"0.61788183",
"0.61753446",
"0.6174492",
"0.6172713"
] | 0.0 | -1 |
This method formats the TO address to include the provider. | def formatted_to
"#{to}@#{Base.gateways[@provider][:sms]}" rescue raise "Invalid provider"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to\n @to ||= unquoted_address_header(:to)\n end",
"def to\n address_list_fetch('to')\n end",
"def stamp_to\n to = validate_to\n raise StanzaErrors::BadRequest.new(self, 'modify') unless to\n to.bare.tap do |bare|\n self['to'] = bare.to_s\n end\n end",
"def mailing_address\n return unless @user.loa3?\n\n dig_out('addresses', 'address_pou', VAProfile::Models::Address::CORRESPONDENCE)\n end",
"def format_address\n street + \", \" + zip\n end",
"def format_address_plain(addr, sep = \"<br />\")\n street_2 = (addr.street_2 == nil || addr.street_2 == \"\") ? \"\" : (addr.street_2 + sep)\n \"#{addr.street_1}#{sep}#{street_2}#{addr.city}, #{addr.state} #{addr.zip}\"\n end",
"def formatted_address\n \"#{self.street_address}, #{self.city}, #{self.state} #{self.zip_code}\"\n end",
"def to_s\n u = uri\n u = u.gsub(/^mailto: */i, '')\n\n if cn.length > 0\n \"#{cn.inspect} <#{uri}>\"\n else\n uri\n end\n end",
"def to_url\n scheme =\n case phone_number_type\n when 'phone' then 'tel'\n when 'mobile' then 'tel'\n when 'fax' then 'fax'\n when 'email' then 'mailto'\n end\n\n return unless scheme\n\n \"#{scheme}:#{number}\"\n end",
"def to_email_address\n @to_email_address\n end",
"def to_email_address\n @to_email_address\n end",
"def postal_format_entire_address(co, person_name: nil)\n first_lines = person_name.nil? ? [co.name] : [co.name, person_name.to_s]\n\n address_lines = []\n # address_items = co.main_address.address_array(Address.max_visibility)\n address = co.main_address\n address_lines << address.street_address\n address_lines << \"#{address.post_code} #{address.city}\"\n\n first_lines + address_lines\n end",
"def sponsorship_mailto(conference)\n [\n 'mailto:',\n conference.contact.sponsor_email,\n '?subject=',\n url_encode(conference.short_title),\n '%20Sponsorship'\n ].join\n end",
"def sponsorship_mailto(conference)\n [\n 'mailto:',\n conference.contact.sponsor_email,\n '?subject=',\n url_encode(conference.short_title),\n '%20Sponsorship'\n ].join\n end",
"def to_s\n @formatted_address\n end",
"def join_address(row, from, to)\n address = from.upto(to).map {|i| row[i].to_s.strip}\n address.delete('')\n capitalize_words(address.join(', '))\n end",
"def validate_to\n @to = validate_address(TO)\n end",
"def get_text_address()\n\t\temail = self.phoneNumber.to_s + self.provider\n\t\treturn email\n end",
"def to_s\n \"#{fullname}: #{address}\"\n end",
"def address_full\n \"#{self.address.titleize}, Toronto, ON\"\n end",
"def to\n @to ||= {email: wrapped_object.primary_email_value, name: wrapped_object.name}\n end",
"def to_uri_format(to_format)\n return to_format.gsub(/\\W/, \"+\").gsub(/[+]+/, \"+\").force_encoding('UTF-8')\n end",
"def address\n \"%s %s %s %s\"%([self.prefecture_code,self.address_city,self.address_street,self.address_building])\n end",
"def to_addresses\n emails = interest_addresses.concat(focus_addresses)\n if emails.empty?\n emails << 'info@unglobalcompact.org'\n end\n emails.uniq\n end",
"def as_email_to\n return email if name.nil?\n\n %(#{name} <#{email}>)\n end",
"def to_addrs\n to ? [to].flatten : []\n end",
"def payment_format_address(payment)\n address = ''\n return address.html_safe if payment.nil?\n address << \"<address><strong>#{payment.firstname} #{payment.lastname}</strong><br />\"\n address << \"#{payment.unit} - \" if payment.unit && payment.unit.length > 0\n address << \"#{payment.address1}<br />\"\n address << \"#{payment.address2}<br />\" if payment.address2 && payment.address2.length > 0\n address << \"#{payment.city}, #{payment.province}, #{Carmen::Country.coded(payment.country).name}<br />#{payment.postal_code}</address>\"\n address.html_safe\n end",
"def determine_team_from_address(team, recipient=nil)\n \"#{team.name} <#{NOTIFICATIONS_FROM_ADDRESS}>\"\n end",
"def rcptto(to_addr); end",
"def mailing\n out = address1.to_s\n out += \"<br />\" unless out.strip.empty? || address2.to_s.empty?\n out += address2.to_s\n out += \"<br />\" unless out.strip.empty?\n out += city.to_s\n out += \", \" if city.present? && state.present?\n out += state if state.present?\n out += \"<br />\" + zip.to_s if zip.present?\n out += \"<br />\" unless out.strip.empty? || !country.present?\n out += country_ref.name if country.present?\n out\n end",
"def address(format = :full)\n if state_code.to_s != \"\"\n s = \", #{state_code}\"\n elsif state.to_s != \"\"\n s = \", #{state}\"\n else\n s = \"\"\n end\n \"#{city}#{s} #{postal_code}, #{country}\".sub(/^[ ,]*/, '')\n end",
"def phone_formatted_for_display\r\n return number_to_phone(phone, {:area_code => true})\r\n end",
"def create_full_address\n \"#{address_line1}, #{city}, #{state} #{zip}\"\n end",
"def address\n\t\taddress_str = \"\"\n\t\taddress_str += \"#{address_street}\\n\" unless address_street.blank?\n\t\taddress_str += \"#{address_city}, \" unless address_city.blank?\n\t\taddress_str += \"#{address_state} \" unless address_state.blank?\n\t\taddress_str += \"#{address_zip}\" unless address_zip.blank?\n\t\taddress_str\n\tend",
"def phone_to(phone_number, name = T.unsafe(nil), html_options = T.unsafe(nil), &block); end",
"def to(value)\n merge(gadrto: value.to_s)\n end",
"def full_address; end",
"def secondary_address; end",
"def email_address_link user\n \"<a href=\\\"mailto:#{user.email}\\\">#{user.name} <#{user.email}></a>\"\n end",
"def tel_to(text)\n groups = text.to_s.scan(/(?:^\\+)?\\d+/)\n if groups.size > 1 && groups[0][0] == '+'\n # remove leading 0 in area code if this is an international number\n groups[1] = groups[1][1..-1] if groups[1][0] == '0'\n groups.delete_at(1) if groups[1].size == 0 # remove if it was only a 0\n end\n link_to text, \"tel:#{groups.join '-'}\"\n end",
"def sns\n return '' unless @parts\n return '' unless @parts[:street_number] && @parts[:street_name] && @parts[:state]\n\n \"#{@parts[:street_number]}#{@parts[:street_name]}#{@parts[:state]}\".standardize\n end",
"def mandrill_to\n if to\n to.each_with_index.map do |value,index|\n {\n 'email' => value,\n 'name' => self[:to].display_names[index]\n }\n end\n else\n []\n end\n end",
"def address\n\t\t\taddress = [self.address_1, self.try(:address_2), \"#{self.city} #{self.try(:state)}\", \"#{self.try(:zip)}\"].compact\n\t\t\taddress.delete(\"\")\n\t\t\taddress.join(\"<br/>\")\n\t\tend",
"def canonicalize(address_line)\n address_line.gsub(/\"[^\"]+\"/, '') # Git rid of quoted part of \"Joe Smith, the third\" <joe@gmail.com> addresses\n .split(/[,;]+/) # Account for multiple addresses delimited by either comma or semicolon\n .map(&:strip) # Git rid of surrounding whitespace\n .map { |a| a.gsub(/.*<(.+)>$/, '\\1') } # Strip angle brackets and any leading friendly names that weren't quoted\n .join(',') # ...and join them back together with the Tahi standard email separator\n end",
"def to\n @to = Array.new\n if new_hope == CHECKED\n @to << NEW_HOPE\n end\n if bridges == CHECKED\n @to << BRIDGES\n end\n if confirmation == CHECKED\n @to << @email\n end\n @to\n end",
"def formatted_email(contact)\n \"#{contact.username} <#{contact.email}>\"\n end",
"def get_address(autopilot_contact)\n\t\taddress = []\n\t\taddress << autopilot_contact[\"MailingStreet\"] unless autopilot_contact[\"MailingStreet\"].nil?\n\t\taddress << autopilot_contact[\"MailingCity\"] unless autopilot_contact[\"MailingCity\"].nil?\n\t\taddress << autopilot_contact[\"MailingCountry\"] unless autopilot_contact[\"MailingCountry\"].nil?\n\t\taddress.join(\",\")\n\tend",
"def full_bill_address\n # hopefully addresses never have pipes in them\n [bill_address_line_1, bill_address_line_2].join(' | ')\n end",
"def to_s\n \"\\nAddress:\\n#{line_one}\\n#{line_two}\\n#{city} #{state} #{zip}\"\n end",
"def full_address\n\t\t\"#{street}, #{postal_code}, #{city}, #{country}\"\n\tend",
"def run\n verified = @to_address\n\n puts \"#{verified.name || verified.company}\",\n \"#{verified.street1}\",\n \"#{verified.street2}\",\n \"#{verified.city}, #{verified.state} #{verified.zip}\",\n ''\n end",
"def email_address2_label\n #unit_test_no_generate: email_address2_label, span.className(create_ats_regex_string(\"ats-emailaddr2lbl\"))\n $tracer.trace(__method__)\n return ToolTag.new(span.className(create_ats_regex_string(\"ats-emailaddr2lbl\")), __method__)\n end",
"def to_s\n context = @solution.map{|k, v| \"#{k}: #{v}\"}.join(',')\n \"#<Twilio.Routes.V2.PhoneNumberContext #{context}>\"\n end",
"def friendly_address\n friendly_address = ''\n if @address.is_a?(Hash)\n friendly_address = @address.values.map do |x|\n if x.is_a?(Hash)\n x = x.values.map { |y| y.is_a?(Hash) ? y.values.join(' ') : y }.join(' ')\n end\n x\n end.join(', ')\n end\n friendly_address\n end",
"def full_address\n\t\t[\"#{self.street}\", self.city, self.country].compact.join(', ')\n\tend",
"def address\n AddressBuilder.new(opts).to_xml\n end",
"def format_phone_number\n area_code = self.phone_number.slice!(0,3)\n area_code = '(' + area_code + ') '\n return area_code + self.phone_number.insert(3, '-')\n end",
"def to_s\n context = @solution.map{|k, v| \"#{k}: #{v}\"}.join(',')\n \"#<Twilio.Lookups.V2.PhoneNumberContext #{context}>\"\n end",
"def full_address\n \"#{address}, #{city}, #{state}, #{zip}\"\n end",
"def address\n [street, [postal_code, l].join(' ')].join(\"\\n\")\n end",
"def shorten_mail_adr(adr)\n pattern = /\\S*(@|\\sved\\s)\\S*/\n adr =~ pattern\n (adr = adr.sub(/#{$&}/, \"<a href=\\\"mailto:#{$&}\\\">email</a>\")) unless $& == nil\n return adr\n end",
"def payer_address_two(*options)\n @payer.address_two.to_s.strip.upcase\n end",
"def prober_address\n super\n end",
"def formatted_phone_number\n Phonelib.parse(phone_number).local_number\n end",
"def formatted_phone_number\n Phonelib.parse(phone_number).local_number\n end",
"def formatted_phone_number\n Phonelib.parse(phone_number).local_number\n end",
"def address(format = :full)\n fail\n end",
"def to_s\n \"#{street_address}, #{city}, #{state} #{zip_5}\"\n end",
"def full_street_address\n\t\treturn \"#{self.street}, #{self.city}, #{self.state}, #{self.zip}\"\n\tend",
"def full_address\n return \"#{@address}, #{@apart} #{@city} #{@state}, 60611\"\n end",
"def to_s\n fields = []\n fields << name\n fields << \"\"\n fields << address.to_s\n fields << \"\"\n fields << \"Telefon: #{phonenumber}\"\n fields << \"E-Mail: #{email}\"\n fields << \"WWW: #{www}\"\n fields.join(\"\\n\")\n end",
"def format\n spacify(postcode.upcase)\n end",
"def inbound_address\n [\"#{slug}-in\", inbound_host].join('@')\n end",
"def format_phone\n if Phoner::Phone.valid? self.phone\n pn = Phoner::Phone.parse phone, :country_code => '1'\n self.phone = pn.format(\"(%a) %f-%l\")\n end\n end",
"def address\n address = \"#{self.street_address}, #{self.city}, #{self.country}\"\n \n end",
"def full_street_address\n \"#{street_address}, #{city}, #{state}\"\n end",
"def full_address\n \"#{region}, #{district}, #{street_type} #{street_name}, д. #{house_number} кв. #{apartment}\"\n end",
"def address\n \"#{self.building} #{return_data_format(self.street)} #{self.zipcode}\"\n end",
"def check_to(v)\n return true unless v\n return true if v.size == 0\n\n v.split(/[,;]/).each do |addr|\n # check url safety as path-rootless\n if /\\A(?:%\\h\\h|[!$&-.0-;=@-Z_a-z~])*\\z/ !~ addr\n raise InvalidComponentError,\n \"an address in 'to' is invalid as URI #{addr.dump}\"\n end\n\n # check addr-spec\n # don't s/\\+/ /g\n addr.gsub!(/%\\h\\h/, URI::TBLDECWWWCOMP_)\n if EMAIL_REGEXP !~ addr\n raise InvalidComponentError,\n \"an address in 'to' is invalid as uri-escaped addr-spec #{addr.dump}\"\n end\n end\n\n true\n end",
"def street_address\n\t\treturn \"#96, Railway Layout, Vijaynagar\"\n\tend",
"def to=( val )\n header[:to] = val\n end",
"def address_for_print(separator = \"\\n\")\n person.sdb.address.for_print(local_or_permanent_address, separator)\n end",
"def try_to_fix address\n parts = address.split(\",\")\n if parts.shift\n parts.join(',')\n else\n address\n end\n end",
"def format_email!\n @email.gsub!(/@/, \"%40\")\n end",
"def ship_to_address(options)\n for setting in [:first_name, :last_name, :company, :city, :state, :zip, :country] do\n if options[setting] then\n add_field 'x_ship_to_' + setting.to_s, options[setting]\n end\n end\n raise 'must use :address1 and/or :address2' if options[:address]\n add_field 'x_ship_to_address', (options[:address1].to_s + ' ' + options[:address2].to_s).strip\n end",
"def to_s\n \"#{tag} #{[@from.source, @to].quoteize.compact.flatten * \" \"}\"\n end",
"def to_s\n email_address = self.primary_email\n if email_address.nil? || email_address.empty?\n \"#{self.first_name} #{self.surname}\"\n else\n \"#{self.first_name} #{self.surname} <#{email_address}>\"\n end\n end",
"def to_s\n [self.address_1, self.address_2].compact.join(', ')\n end",
"def encode_email_address( addr )\n\n\t\t\trval = ''\n\t\t\t(\"mailto:\" + addr).each_byte {|b|\n\t\t\t\tcase b\n\t\t\t\twhen ?:\n\t\t\t\t\trval += \":\"\n\t\t\t\twhen ?@\n\t\t\t\t\trval += Encoders[ rand(2) ][ b ]\n\t\t\t\telse\n\t\t\t\t\tr = rand(100)\n\t\t\t\t\trval += (\n\t\t\t\t\t\tr > 90 ? Encoders[2][ b ] :\n\t\t\t\t\t\tr < 45 ? Encoders[1][ b ] :\n\t\t\t\t\t\t\t\t Encoders[0][ b ]\n\t\t\t\t\t)\n\t\t\t\tend\n\t\t\t}\n\n\t\t\treturn %{<a href=\"%s\">%s</a>} % [ rval, rval.sub(/.+?:/, '') ]\n\t\tend",
"def get_to_addresses\n\n return [] if self.to_addresses.nil?\n return self.to_addresses.split(Email::ADDRESS_SEPARATOR)\n end",
"def office_formatted_address\n self.dig_for_string(\"agentSummary\", \"office\", \"officeAddress\", \"formattedAddress\")\n end",
"def shipping_recipient\n \"#{shipping_address.name} <#{contact_email}>\"\n end",
"def address\n [address_line_1, address_line_2, town_city, county, postcode].join(\", \")\n end",
"def address\n [street, city, state, country].compact.join(', ')\n end",
"def email_address2_field\n #unit_test_no_generate: email_address2_field, input.className(create_ats_regex_string(\"ats-emailaddr2field\"))\n $tracer.trace(__method__)\n return ToolTag.new(input.className(create_ats_regex_string(\"ats-emailaddr2field\")), __method__)\n end",
"def full_order_to_address\n ship_address.address1 + ' ' + ship_address.address2\n end",
"def address\n # match Geocoder::Result::Google#formatted_address\n \"#{street}, #{city}, #{state} #{zip}, #{country}\"\n end",
"def full_address\n return\"#{self.client},#{self.rep_address_one} #{self.rep_address_two},#{self.city},#{self.state},#{self.zipcode}\"\n end",
"def text_address\n [street, city, state].join(\" \")\n end",
"def add_tel(s=nil, number: s)\n @to_s = 'tel:' + number\n end"
] | [
"0.6852653",
"0.64515",
"0.6396367",
"0.61574036",
"0.612608",
"0.61088604",
"0.6006481",
"0.60062873",
"0.5912349",
"0.5888783",
"0.5870044",
"0.58464557",
"0.58068854",
"0.58068854",
"0.5804907",
"0.58012307",
"0.5797022",
"0.57720786",
"0.5770777",
"0.57604456",
"0.5705903",
"0.5649758",
"0.5632419",
"0.561267",
"0.56088436",
"0.5555123",
"0.55150074",
"0.550812",
"0.54848367",
"0.54586387",
"0.5457201",
"0.5456452",
"0.5452489",
"0.5439365",
"0.5421942",
"0.54195523",
"0.54162043",
"0.5401483",
"0.5395445",
"0.5385529",
"0.5368695",
"0.5352233",
"0.53439325",
"0.5339255",
"0.53388363",
"0.53291965",
"0.53248465",
"0.53235173",
"0.53209454",
"0.532005",
"0.5319356",
"0.5319198",
"0.5304969",
"0.52986956",
"0.52946794",
"0.52912223",
"0.5288877",
"0.5287819",
"0.5287019",
"0.52835083",
"0.52809834",
"0.52790755",
"0.52786654",
"0.52690923",
"0.52690923",
"0.52690923",
"0.52638376",
"0.52600133",
"0.52541095",
"0.5252501",
"0.5251019",
"0.5243784",
"0.5242612",
"0.52423364",
"0.5240763",
"0.52398217",
"0.52331465",
"0.5222345",
"0.5219201",
"0.5208817",
"0.5206265",
"0.51963747",
"0.51939094",
"0.5193024",
"0.51806086",
"0.5173567",
"0.5168861",
"0.5167248",
"0.51670974",
"0.5166123",
"0.51603395",
"0.5158335",
"0.5157799",
"0.5156154",
"0.51558095",
"0.5151866",
"0.51506436",
"0.5150177",
"0.5149518",
"0.51438457"
] | 0.7275079 | 0 |
This method sanitizes the message body. | def sanitized_message
message.to_s[0,140]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate_body\n if @body && /\\b(?:html|xml)\\b/ =~ @type\n @body.scrub!\n end\n end",
"def sanitize\n scrub_payload_emails\n scrub_actor_attributes\n end",
"def cleanup_body(body)\n delimiters = Setting.mail_handler_body_delimiters.to_s.split(/[\\r\\n]+/).reject(&:blank?).map {|s| Regexp.escape(s)}\n unless delimiters.empty?\n regex = Regexp.new(\"^[> ]*(#{ delimiters.join('|') })\\s*[\\r\\n].*\", Regexp::MULTILINE)\n body = body.gsub(regex, '')\n end\n body.strip\n end",
"def clean_message\n self.message = Loofah.fragment(self.message).scrub!(:strip).text\n end",
"def clean_body(text)\n text = strip_bad_chars(text)\n text.gsub!(/(\\r)?\\n/, \"\");\n text.gsub!(/\\s+/, ' ');\n\n # clean start and end whitespace\n text = text.strip;\n return text\nend",
"def sanitize_attributes\n if self.sanitize_level\n self.body = Sanitize.clean(self.body_raw, self.sanitize_level)\n self.title = Sanitize.clean(self.title, self.sanitize_level)\n else\n self.body = self.body_raw\n end\n end",
"def sanitize_mail(mail)\n if mail.content_type.start_with? 'text/html'\n html = mail.body.decoded.encode('utf-8', mail.charset)\n Sanitize.fragment(html, Sanitize::Config.merge(Sanitize::Config::RELAXED,\n remove_contents: ['style']\n ))\n else\n Rack::Utils.escape_html(mail.body.decoded)\n end\n end",
"def sanitized_html\n @sanitized_html ||= begin\n return nil if html_part.nil?\n Envelope::MessageTools.sanitize(html_part)\n end\n end",
"def body_clean\n text = \"\"\n\n # Iterate through each line\n body.split(/\\n/).each do |line|\n # Included replies \"> some text\"\n next if line.match(/^>+/) \n next if line.match(/On.*wrote:/)\n # Outlook reply style\n break if line.match(/-{4,}Original Message-{4,}/)\n # Signature break \"--\"\n break if line.match(/^\\s*\\-{2,}\\s*$/)\n # Lines with only whitespace - blank them\n line.gsub(/^\\s+$/, \"\")\n\n text += line + \"\\n\"\n end\n\n # Clean out multiple line breaks throughout (longer than one blank line)\n text.gsub!(/\\n{3,}/, \"\\n\\n\") \n # Clean up multiple line breaks at end (none)\n text.gsub!(/\\n{2,}$/, \"\\n\")\n\n return text\n end",
"def clean_html\n HTML::WhiteListSanitizer.allowed_protocols << 'data'\n self.content = ActionController::Base.helpers.sanitize(self.body, :tags => ALLOWED_TAGS, :attributes => ALLOWED_ATTRIBUTES)\n end",
"def clean_message(message); end",
"def sanitized_message(tags_to_exclude: [], html_safe: true, escape_before_sanitizing: false)\n return self.message if self.message.blank?\n\n allowed_tags, allowed_attributes = Recognition.allowed_html_tags_and_attributes(tags_to_exclude: tags_to_exclude)\n opts = { tags: allowed_tags, attributes: allowed_attributes}\n\n message = self.message\n message = CGI.escapeHTML(message) if escape_before_sanitizing\n message = sanitize(message, opts)\n message = message.to_str unless html_safe # back to String from ActiveSupport::SafeBuffer\n message\n end",
"def cooked_body\n raw_body.preprocess\n end",
"def body\n BadWord.filter_bad_words(read_attribute(:body))\n end",
"def clean\n self.short_msg = sanitize(short_msg)\n self.long_msg = sanitize(long_msg)\n end",
"def check_body\n return true if body.blank?\n\n limit = 1_500_000\n current_length = body.length\n return true if body.length <= limit\n\n raise Exceptions::UnprocessableEntity, \"body of article is too large, #{current_length} chars - only #{limit} allowed\" if !ApplicationHandleInfo.postmaster?\n\n logger.warn \"WARNING: cut string because of database length #{self.class}.body(#{limit} but is #{current_length})\"\n self.body = body[0, limit]\n end",
"def cleaned_up_text_body(format = false)\n # http://stackoverflow.com/a/15098459\n caller = caller_locations(1,1)[0].label\n if caller == 'receive_issue' || caller == 'receive_issue_reply'\n html_body\n else\n super\n end\n rescue => e\n # log error\n RedmineHtmlMailHandler::HtmlMailHandlerLogger.write(:error, \"ERROR=#{e.message}\")\n RedmineHtmlMailHandler::HtmlMailHandlerLogger.write(:error, \"BACKTRACE=\\n#{e.backtrace.join(\"\\n\")}\")\n # raise error that can be catched by 'notify_invalid_mail_handler' plugin\n raise RedmineHtmlMailHandler::Error, e.message\n end",
"def get_body_for_quoting\n # Find the body text and remove emails for privacy/anti-spam reasons\n text = get_main_body_text\n self.mask_special_emails!(text)\n self.remove_privacy_sensitive_things!(text)\n\n # Remove existing quoted sections\n text = self.remove_lotus_quoting(text, '')\n text = IncomingMessage.remove_quoted_sections(text, \"\")\n end",
"def sanitize!; end",
"def cleanRecipeParams\n val = self.body.gsub(/\\s+/, \"\")\n return val\n end",
"def sanitize\n self.summary = sanitize_string(summary)\n self.description = sanitize_string(description)\n self.post_install_message = sanitize_string(post_install_message)\n self.authors = authors.collect {|a| sanitize_string(a) }\n end",
"def clean\n self.subject = sanitize self.subject\n end",
"def body_to_string\n sanitized_body.keys.sort_by(&:downcase).map{|key| \"#{key}=#{@body[key]}\" }.join(\"\")\n end",
"def blank_body?\n Sanitize.clean(self.body).gsub(/[ | ]/, '').blank? \n end",
"def sanitize\n\t\t@message.gsub!(/[^a-zA-Z]/, \"\")\n\t\t@message.upcase!\n\n\t\tremainder = @message.length % 5\n\t\tif remainder > 0\n\t\t\t(5 - remainder).times do\t\t\t\t\n\t\t\t\t@message << \"X\"\n\t\t\tend\n\t\tend\n\n\t\t@grouped = @message.scan(/...../)\n\tend",
"def flash_message_sanitize(message)\n sanitize(message, :tags=>%w[p div span a ul li b i br hr], :attributes=>%w[class href data-modal-id]).full_stop\n end",
"def sanitize_content\n self.title = helpers.sanitize(self.title)\n self.user_name = helpers.sanitize(self.user_name)\n end",
"def clean\n self.subject = sanitize subject\n end",
"def transform_body(body)\n return [] if body.blank?\n lines = body.respond_to?(:lines) ? body.lines : body.split(\"\\n\")\n lines.map(&:strip)\n end",
"def html_safe_body\n safe_body = RedCloth.new(body)\n safe_body.filter_html = true\n safe_body.to_html\n end",
"def body\n ret = read_attribute(:body)\n if ret.nil?\n return ret\n end\n ret = ret.strip\n ret = ret.gsub(/(?:\\n\\s*){2,}/, \"\\n\\n\") # remove excess linebreaks that unnecessarily space it out\n ret\n end",
"def body_column(record)\n sanitize(record.body)\n end",
"def obfuscate_body(body)\n return nil if body.nil?\n return '' if body.empty?\n\n body.gsub(@property_pattern) do\n m = Regexp.last_match\n property_name = m[2]\n value = m[4] || m[5]\n # copy value 'cause it's part of m[0]\n m[0].sub(value, obfuscate_value(property_name, value.dup))\n end\n end",
"def sanitize(context,input)\n safe = ''\n begin\n safe = antisamy(context,input)\n rescue Exception => e\n end\n safe\n end",
"def set_body\n self.body = \"\" unless body\n body\n end",
"def set_body\n self.body = \"\" unless body\n body\n end",
"def sanitize!\n return self if @sanitized\n replace(HTMLEntities.new.encode(self))\n @sanitized = true\n return self\n end",
"def set_body\n self.body = \"\" unless self.body\n end",
"def regexremoveXSSFromBodyText(input )\n if( input != nil )\n output = input\n re = /(?i)(<script(.|\\n)*?<\\/script>|onload=|onclick=|alert\\((.|\\n)*?\\)|onmouseover|javascript:|onerror=|onfocus=|ondblclick=|onkeyup=|onkeydown=|onabort=|style=)/\n $matches = input.scan(re).size\n\n while $matches > 0 do\n output = output.to_s.gsub(Regexp.new(re), '') \n $matches = output.scan(re).size\n end\n input = output\n end\n end",
"def sanitize_data(data)\n data\n end",
"def escape_body\n self.body = ERB::Util.html_escape(body)\n end",
"def construct_body(template = @template)\n\t\t@body = ERB.new(template).result(binding)\n\t\tallowed_elements = ['a', 'h1', 'h2', 'h3', 'p', 'ul', 'li']\n\t\tallowed_attributes = {'a' => ['href']}\n\t\tallowed_link_protocols = {'a' => {'href' => ['http', 'https', 'mailto']}}\n\t\treturn Sanitize.clean(@body, :elements => allowed_elements, :attributes => allowed_attributes, :protocols => allowed_link_protocols)\n\tend",
"def validate_and_sanitize\n super\n end",
"def run\n migrated_body = @body.dup\n migrated_body.gsub!(/\\|[\\t ]*\\r?[\\n]/, \"|\\n\")\n migrated_body\n end",
"def clean_response(body)\n body.gsub!(/\\/\\//, '')\n\n # Google sends hex encoded data, we need to fix that\n (33..47).each do |char|\n body.gsub!(/\\\\x#{char.to_s(16)}/, char.chr)\n end\n\n body\n end",
"def normalize(string)\n new_body = normalize_entities(string)\n # Fix mismatched tags. Yes, it's faster to do it per-message\n # than all at once.\n new_body = Pipio::TagBalancer.new(new_body).balance\n if @sender_alias[0,3] == '***'\n # \"***<alias>\" is what pidgin sets as the alias for a /me action\n @sender_alias.slice!(0,3)\n new_body = \"*#{new_body}*\"\n end\n\n new_body\n end",
"def sanitize_blog_body(str)\n ret = str.gsub(\"<h4 class=\\\"itemTitle\\\"></h4>\", \" \")\n ret.gsub!(\"<br />\",\"\\n\")\n \n ret\n end",
"def process_message_body\n @attachments = []\n if @mail.multipart?\n @body, @html = [], []\n scan_parts(@mail)\n @body = @body.join(\"\\n\")\n @html = @html.join(\"\\n\")\n else\n if @mail.content_type =~ /text\\/html/\n @html = @mail.body.to_s\n @body = ''\n else\n @body = @mail.body.to_s\n @html = ''\n end\n end\n\n @body = convert_to_utf8(@body)\n @html = convert_to_utf8(@html)\n end",
"def sanitize(string_or_io)\n Loofah.scrub_fragment(string_or_io, :escape).to_s\n end",
"def clean_up_contents()\n # very minimal\n # elements = ['p', 'b', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'], attributes={})\n\n if self.contents?\n html = self.contents\n email_regex = /<p>Email:\\s+((\\w|\\-|\\_|\\.)+\\@((\\w|\\-|\\_)+\\.)+[a-zA-Z]{2,})/i\n\n html.gsub! /\\[endif\\]--/ , ''\n html.gsub! /[\\n|\\r]/ , ' '\n html.gsub! / / , ' '\n\n # this will convert UNICODE into ASCII. \n #It will also strip any possiblity of using a foreign language!\n #converter = Iconv.new('ASCII//IGNORE//TRANSLIT', 'UTF-8') \n #html = converter.iconv(html).unpack('U*').select{ |cp| cp < 127 }.pack('U*')\n # keep only the things we want.\n unless (Sanitize::Config::RELAXED[:attributes][\"table\"].include?(\"align\"))\n Sanitize::Config::RELAXED[:attributes][\"table\"] << \"align\"\n end\n\n config = Sanitize::Config::RELAXED\n if (html.encoding.name == 'ASCII-8BIT')\n config[:output_encoding] = 'ASCII'\n end\n html = Sanitize.clean( html, config)\n\n # butt up any tags\n html.gsub! />\\s+</ , '><'\n\n #remove email address lines\n html.gsub! email_regex , '<p>'\n\n # post sanitize cleanup of empty blocks\n # the order of removal is import - this is the way word stacks these elements\n html.gsub! /<i><\\/i>/ , ''\n html.gsub! /<b><\\/b>/ , ''\n html.gsub! /<\\/b><b>/ , ''\n html.gsub! /<p><\\/p>/ , ''\n html.gsub! /<p><b><\\/b><\\/p>/ , ''\n\n # misc - fix butted times\n html.gsub! /(\\d)am / , '\\1 am '\n html.gsub! /(\\d)pm / , '\\1 pm '\n # misc - remove multiple space that may cause doc specific regexs to fail (in dates for example)\n html.gsub! /\\s+/ , ' '\n\n # add new lines at the end of lines\n html.gsub! /<\\/(p|h\\d|dt|dd|dl)>/, '</\\1>' + \"\\n\"\n html.gsub! /<dl>/ , '<dl>' + \"\\n\"\n\n self.contents = html\n end\n end",
"def sanitize_description\n self.description = Sanitize.fragment(self.description, Sanitize::Config::BASIC)\n end",
"def normalize_body(normalized_headers, body)\n case body\n when nil\n return body\n when ::Hash, ::Array\n body_hash = body\n when ::String\n # use unparsed original body to avoid losing information when we are\n # unable to parse or parse a literal JSON string as happens in the case\n # of RightAPI's health-check.\n return @body\n end\n case ct = compute_content_type(normalized_headers)\n when 'application/x-www-form-urlencoded'\n result = build_query_string(body_hash)\n normalize_content_length(normalized_headers, result)\n else\n result = ::JSON.dump(body_hash)\n normalize_content_length(normalized_headers, result)\n end\n result\n end",
"def plain_text_body\n\n return @plain_text_body unless @plain_text_body.nil?\n\n part = email.text_part || email.html_part || email\n @plain_text_body = Redmine::CodesetUtil.to_utf8(part.body.decoded, part.charset)\n\n # strip html tags and remove doctype directive\n @plain_text_body = ActionController::Base.helpers.strip_tags(@plain_text_body.strip) unless email.text_part\n @plain_text_body.sub! %r{^<!DOCTYPE .*$}, ''\n @plain_text_body\n\n end",
"def sanitize(body)\n # If a tweet contains a long string of non breaking letters it breaks the layout of the widget.\n # Using CSS doesn't seem to work so this is a quick & dirty hack to force words to wrap.\n body = body.split.map do |word| \n word.size > 30 ? word.chars.each_slice(30).to_a.map { |arr| arr.push('-').join }.join[0..-2] : word\n end\n body.join(\" \").gsub(/[@#]?(coffee|xero)/i) { |match| \"<span class='twitter-#{match.downcase.gsub(/[#@]/,'')}'>#{match}</span>\" }\nend",
"def sanitize(text)\n sanitized_text = text.dup\n\n # Strip URLs\n sanitized_text.gsub!(URL_REGEX, '')\n\n # Strip @mention style tokens\n sanitized_text.gsub!(MENTION_REGEX, '')\n\n sanitized_text\n end",
"def sanitized_response\n strip_tags(response.body.to_s).strip\n end",
"def clean()\n #strip all illegal content here. (scripts, shit that will break layout, etc.)\n end",
"def fix_newlines\n unless self.body.nil?\n self.body = self.body.gsub('\\n', \"\\n\")\n end\n end",
"def sanitize content #:nodoc:\n if content.is_a? String\n content.chomp!\n content.gsub!(/\\t/, ' ') # don't display tab\n content.gsub!(/[^[:print:]]/, '') # don't display non print characters\n else\n content\n end\n end",
"def sanitize content #:nodoc:\n if content.is_a? String\n content.chomp!\n content.gsub!(/\\t/, ' ') # don't display tab\n content.gsub!(/[^[:print:]]/, '') # don't display non print characters\n else\n content\n end\n end",
"def clean_description\n ActionView::Base.full_sanitizer.sanitize(description)\n end",
"def normalize_message(message, limit=nil, &block)\n message.scan(/[^\\n\\r]{1,#{limit||LIMIT_MESSAGE}}/, &block)\n end",
"def exclude_from_xss_checks; %w{ body html } end",
"def sanitize(text)\n text.gsub('<', '<').gsub('>', '>')\n end",
"def validate\n if self.body.empty? || self.body =~ /^\\s+$/\n errors.add(:body, \"^Please enter your annotation\")\n end\n if !MySociety::Validate.uses_mixed_capitals(self.body)\n errors.add(:body, '^Please write your annotation using a mixture of capital and lower case letters. This makes it easier for others to read.')\n end\n end",
"def sanitize!\n\t\t\t@doc.downcase!\n\t\t\t@doc.gsub!(/<style.*?\\/style>/m, '')\n\t\t\t@doc.gsub!(/<script.*?\\/script>/m, '')\n\t\t\t@doc.gsub!(/<.*?>/m, ' ')\n\t\t\t@doc.gsub!(/\\s+/, ' ')\n\t\tend",
"def sanitize_attributes\n %w(author title description keyword).each do |field|\n self.send(\"#{field}=\",HTMLEntities.new.decode(self.send(field)))\n end\n end",
"def test_simple_empty_body\n @mail = SignedMail.new(\"test: test\\r\\n\\r\\n\")\n @mail.body_canonicalization = 'simple'\n\n assert_equal \"\\r\\n\", @mail.canonical_body\n end",
"def normalize!\n if body_allowed?\n if calculate_content_length?\n @headers[Const::CONTENT_LENGTH] = body.inject(0) do |length, part|\n length + ::Rack::Utils.bytesize(part)\n end.to_s\n end\n else\n @headers.delete(Const::CONTENT_TYPE)\n @headers.delete(Const::CONTENT_LENGTH)\n @body = []\n end\n end",
"def body\n process_message_body if !@body\n @body\n end",
"def sanitize_bio(bio)\n permit_scrubber = Rails::Html::PermitScrubber.new\n permit_scrubber.tags = %w(h3 h4 p ul li ol strong em span sup sub)\n sanitize bio, tags: %w(h3 h4 p ul li ol strong em span sup sub), scrubber: permit_scrubber\n end",
"def sanitize_html\n self.data = self.class.clean_html(self.data) unless self.data.nil?\n end",
"def clean_article_body\n get_source_selectors.each do |selector|\n if @page.search(selector).present?\n @page = page.search(selector)\n break\n end\n end\n # Strip unwanted spaces and newlines.\n @page.collect {|elt| elt.content.strip.gsub(/\\n|\\r/, '').gsub(/\\ +/, ' ')}.join(' ')\n end",
"def sanitize(tainted)\n untainted = tainted\n \n untainted = rule1_sanitize(tainted)\n \n # Start - RULE #2 - Attribute Escape Before Inserting Untrusted Data into HTML Common Attributes\n # End - RULE #2 - Attribute Escape Before Inserting Untrusted Data into HTML Common Attributes\n \n # Start - RULE #3 - JavaScript Escape Before Inserting Untrusted Data into HTML JavaScript Data Values\n # End - RULE #3 - JavaScript Escape Before Inserting Untrusted Data into HTML JavaScript Data Values\n \n # Start - RULE #4 - CSS Escape Before Inserting Untrusted Data into HTML Style Property Values\n # End - RULE #4 - CSS Escape Before Inserting Untrusted Data into HTML Style Property Values\n \n untainted\n end",
"def sanitize_as_html!\n Engine.clean!(self)\n end",
"def sanitize_as_html!\n Engine.clean!(self)\n end",
"def sanitize_attributes\n # Summary, content are sanitized with an HTML sanitizer, we want imgs etc to be present.\n # Other attributes are sanitized by stripping tags, they should be plain text.\n self.content = Sanitizer.sanitize_html self.content\n self.summary = Sanitizer.sanitize_html self.summary\n\n self.title = Sanitizer.sanitize_plaintext self.title\n self.author = Sanitizer.sanitize_plaintext self.author\n self.guid = Sanitizer.sanitize_plaintext self.guid\n self.url = Sanitizer.sanitize_plaintext self.url\n end",
"def body\n @body ||= process_text(@raw_body)\n end",
"def sanitize_description(description)\n ActionController::Base.helpers.strip_tags(description)\n end",
"def sanitize_header_field(value)\n value.to_s\n .gsub(\"\\r\\n\", \"\\n\")\n .gsub(HEADER_FIELD_SANITIZER_PATTERN, HEADER_FIELD_SANITIZER_MAPPING)\n end",
"def message_body\n return message.spanish_body if parent.spanish_speaking?\n return message.body\n end",
"def sanitize(input, options={})\n return \"\" if input.nil? or input.empty?\n \n # Only take elements inside of <body>\n @doc = Hpricot(input)\n @doc = Hpricot(@doc.at(\"body\").inner_html) if @doc.at(\"body\")\n sanitized = Aqueduct::RailsSanitizer.white_list_sanitizer.sanitize(@doc.to_html)\n\n # Start parsing sanitized doc\n @doc = Hpricot(sanitized)\n\n # Rewrite all id's to appened network_key\n append_id(@options[:append]) unless @options[:append].nil?\n\n @options[:formatted] == false ? @doc.to_html.gsub(/\\r|\\n/i,'') : @doc.to_html \n end",
"def error_body(body)\n if body['type'] == 'error' && body['value']\n body['value']\n else\n ''\n end\n end",
"def validate_and_sanitize\n validate\n end",
"def sanitize_written_content(content)\n unless content[P_TAG] || content[BR_TAG]\n content = if content[BLOCKQUOTE_QUICK_SEARCH] && content[BLOCKQUOTE_TAG]\n content.gsub(LINEBREAK, BR)\n else\n simple_format_largebreak(content, sanitize: false)\n end\n end\n\n Glowfic::Sanitizers.written(content)\n end",
"def to_sanitize\n Sanitize.new(to_hash)\n end",
"def sanitize_data\n sanitize_name\n sanitize_city\n sanitize_zip_code\n sanitize_address\n end",
"def sanitize_data\n sanitize_name\n sanitize_city\n sanitize_zip_code\n sanitize_address\n end",
"def sanitize_details\n self.details = ActionController::Base.helpers.sanitize(details, { :tags => ALLOWED_HTML_TAGS_IN_DETAILS } )\n end",
"def parse_body( data )\n return [ data.delete(\"\\0\") ]\n end",
"def sanitize(text)\n return nil if text.nil? || text.empty?\n string = text.to_s # ensure we have a string\n\n doc = Nokogiri::HTML.parse(text)\n\n doc.xpath('//@style').remove\n doc.xpath('//@class').remove\n doc.xpath('//@id').remove\n doc.xpath('//@font-size').remove\n doc.xpath('//@color').remove\n doc.xpath('//@size').remove\n doc.xpath('//@face').remove\n doc.xpath('//@bgcolor').remove\n doc.xpath('//comment()').remove\n\n # remove \"bad\" elements\n doc.css('script, link, img, style').each { |node| node.remove }\n\n # convert all <div>s to <p>s\n doc.css('div').each do |div|\n node = doc.create_element 'p'\n node.inner_html = div.inner_html\n div.replace(node)\n end\n\n # remove <font> and <span> tags, but preserve their content\n doc.css('font, span').each do |node|\n node.swap(node.children)\n end\n\n # removing tags leaves dangling text nodes that should really be merged, so let's\n # re-build the document\n doc = Nokogiri::HTML.parse(doc.to_s)\n\n # wrap orphaned text nodes in <p> tags\n doc.css('html body').children.each do |orphan|\n if orphan.class == Nokogiri::XML::Text && !orphan.text.strip.gsub(Envelope::Message::ALL_SPACES, '').empty?\n node = doc.create_element 'p'\n node.inner_html = orphan.text\n orphan.replace(node)\n end\n end\n\n # remove all <p><br><p>\n doc.css('p br').each do |node|\n node.remove\n end\n\n # convert all new lines to br and trim content\n doc.css('p').each do |node|\n node.inner_html = node.inner_html.gsub(\"\\n\", '<br>').strip\n end\n\n # remove empty tags\n doc.css('html body > *').each do |node|\n unless %w(br p).include?(node.name)\n node.remove if node.inner_html.gsub(Envelope::Message::ALL_SPACES, '').empty?\n end\n end\n\n doc.css('html body > *').to_s.gsub(/[\\n\\t]+?/, '')\n end",
"def sanitize_input(str)\n str.chomp.strip \n # remueve al final del string los \\n,\\t,\\r(chomp) \n #y remueve los espacios en blanco (strip)\n end",
"def message body\r\n checksum = body.reduce(0) { |a, byte| a ^ byte }\r\n \r\n [\r\n STX,\r\n *(body + [checksum]).map { |byte|\r\n # Escape special bytes in a message.\r\n # @see \"London DI Kit.pdf\" page 4\r\n SPECIAL_BYTES.include?(byte) ? [ESC, byte + 0x80] : byte\r\n }.flatten,\r\n ETX\r\n ]\r\nend",
"def error_message\n parsed_body.strip\n end",
"def clean(message)\n message = message.to_s.strip\n message.gsub!(/\\e\\[[0-9;]*m/, '') # remove useless ansi color codes\n message\n end",
"def original_body\n @original_body\n end",
"def validate_and_sanitize\n r = super\n return r unless r.success?\n\n success\n end",
"def sanitize_input(params)\n params[\"etd\"][\"abstract\"] = ::InputSanitizer.sanitize(params[\"etd\"][\"abstract\"])\n params[\"etd\"][\"table_of_contents\"] = ::InputSanitizer.sanitize(params[\"etd\"][\"table_of_contents\"])\n end",
"def app_sanitize(html)\n sanitize(html, attributes: %w[style])\n end",
"def sanitize text\n [' ', '\\r\\n', \"\\r\\n\", \"\\n\", \"\\r\", \"\\t\", / ^/, / $+/, /^ /, /^ /].each { |text_to_remove|\n text.gsub!(text_to_remove,'')\n }\n return text\n end"
] | [
"0.7031387",
"0.70212257",
"0.6961889",
"0.6948664",
"0.6917089",
"0.6835991",
"0.6805405",
"0.6748517",
"0.6724432",
"0.6719474",
"0.6689921",
"0.6673553",
"0.660771",
"0.65629137",
"0.6402586",
"0.6368258",
"0.6292628",
"0.6287936",
"0.62827325",
"0.62174624",
"0.6215756",
"0.6207394",
"0.6194317",
"0.6152613",
"0.6126322",
"0.6118591",
"0.6116285",
"0.60482174",
"0.6042249",
"0.6005297",
"0.59983665",
"0.59902275",
"0.5931652",
"0.5929205",
"0.59284765",
"0.59284765",
"0.5927578",
"0.5927235",
"0.59042954",
"0.5890339",
"0.58463717",
"0.5840027",
"0.5800635",
"0.57876205",
"0.5762352",
"0.57550514",
"0.57493657",
"0.5744482",
"0.57423294",
"0.5741044",
"0.57299",
"0.5729245",
"0.57239735",
"0.57104534",
"0.5702515",
"0.5697542",
"0.56721324",
"0.56708115",
"0.5660005",
"0.5660005",
"0.56589645",
"0.5650928",
"0.5648986",
"0.5641902",
"0.56390864",
"0.56296897",
"0.5624143",
"0.56106865",
"0.5593311",
"0.5582108",
"0.5581103",
"0.5577774",
"0.5572539",
"0.557055",
"0.55665374",
"0.55665374",
"0.55626124",
"0.55562425",
"0.5549914",
"0.55462706",
"0.55361086",
"0.55332965",
"0.5531042",
"0.55307996",
"0.55282277",
"0.55277437",
"0.55247575",
"0.55247575",
"0.55139714",
"0.548154",
"0.5458218",
"0.54575634",
"0.5452696",
"0.5443499",
"0.54410595",
"0.5434972",
"0.54176986",
"0.5415007",
"0.54130167",
"0.541263"
] | 0.7102011 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.